generated from coulomb/repo-seed
feat: add v2 api consumer bootstrap endpoints
This commit is contained in:
@@ -93,6 +93,8 @@ buildOpenApiSpec = do
|
||||
]
|
||||
, "Hub" .= hubSchema
|
||||
, "HubCapabilityManifest" .= manifestSchema
|
||||
, "ApiConsumer" .= apiConsumerSchema
|
||||
, "ApiKey" .= apiKeySchema
|
||||
, "Widget" .= widgetSchema
|
||||
, "InteractionEvent" .= interactionEventSchema
|
||||
, "Annotation" .= annotationSchema
|
||||
@@ -136,6 +138,14 @@ buildPaths = object
|
||||
, "/hub-capability-manifests/{id}/activate" .= object
|
||||
[ "post" .= writeOpWithSummary "Activate HubCapabilityManifest" "HubCapabilityManifest" "ActivateHubCapabilityManifestRequest"
|
||||
]
|
||||
, "/api-consumers" .= object
|
||||
[ "get" .= listOp "ApiConsumer" []
|
||||
, "post" .= writeOp "ApiConsumer" "CreateApiConsumerRequest"
|
||||
]
|
||||
, "/api-consumers/{id}" .= getShowPath "ApiConsumer"
|
||||
, "/api-consumers/{id}/api-keys" .= object
|
||||
[ "post" .= writeOpWithSummary "Create ApiKey" "ApiKey" "CreateApiKeyRequest"
|
||||
]
|
||||
, "/widgets" .= object
|
||||
[ "get" .= listOp "Widget" []
|
||||
, "post" .= writeOp "Widget" "CreateWidgetRequest"
|
||||
@@ -351,6 +361,39 @@ manifestSchema = object
|
||||
]
|
||||
]
|
||||
|
||||
apiConsumerSchema :: Value
|
||||
apiConsumerSchema = object
|
||||
[ "type" .= ("object" :: Text)
|
||||
, "properties" .= object
|
||||
[ "id" .= uuidProp
|
||||
, "name" .= strProp
|
||||
, "description" .= strProp
|
||||
, "hubCapabilityManifestId" .= uuidProp
|
||||
, "rateLimitPerMinute" .= object ["type" .= ("integer" :: Text)]
|
||||
, "quotaPerDay" .= object ["type" .= ("integer" :: Text)]
|
||||
, "quotaResetsAt" .= dtProp
|
||||
, "isActive" .= object ["type" .= ("boolean" :: Text)]
|
||||
, "createdAt" .= dtProp
|
||||
, "updatedAt" .= dtProp
|
||||
]
|
||||
]
|
||||
|
||||
apiKeySchema :: Value
|
||||
apiKeySchema = object
|
||||
[ "type" .= ("object" :: Text)
|
||||
, "properties" .= object
|
||||
[ "id" .= uuidProp
|
||||
, "apiConsumerId" .= uuidProp
|
||||
, "keyPrefix" .= strProp
|
||||
, "scopes" .= strProp
|
||||
, "tokenType" .= strProp
|
||||
, "expiresAt" .= dtProp
|
||||
, "revokedAt" .= dtProp
|
||||
, "lastUsedAt" .= dtProp
|
||||
, "createdAt" .= dtProp
|
||||
]
|
||||
]
|
||||
|
||||
interactionEventSchema :: Value
|
||||
interactionEventSchema = object
|
||||
[ "type" .= ("object" :: Text)
|
||||
|
||||
Reference in New Issue
Block a user