generated from coulomb/repo-seed
feat: add v2 api consumer bootstrap endpoints
This commit is contained in:
@@ -280,6 +280,26 @@ instance HasPath ApiV2HubCapabilityManifestsController where
|
||||
pathTo ApiV2UpdateHubCapabilityManifestAction { hubCapabilityManifestId } = "/api/v2/hub-capability-manifests/" <> tshow hubCapabilityManifestId
|
||||
pathTo ApiV2ActivateHubCapabilityManifestAction { hubCapabilityManifestId } = "/api/v2/hub-capability-manifests/" <> tshow hubCapabilityManifestId <> "/activate"
|
||||
|
||||
instance CanRoute ApiV2ApiConsumersController where
|
||||
parseRoute' = do
|
||||
_ <- string "/api/v2/api-consumers"
|
||||
choice
|
||||
[ do endOfInput; pure ApiV2IndexApiConsumersAction
|
||||
, do _ <- string "/"; cId <- parseUUID
|
||||
choice
|
||||
[ do _ <- string "/api-keys"; endOfInput
|
||||
pure ApiV2CreateApiConsumerKeyAction { apiConsumerId = Id cId }
|
||||
, do endOfInput
|
||||
pure ApiV2ShowApiConsumerAction { apiConsumerId = Id cId }
|
||||
]
|
||||
]
|
||||
|
||||
instance HasPath ApiV2ApiConsumersController where
|
||||
pathTo ApiV2IndexApiConsumersAction = "/api/v2/api-consumers"
|
||||
pathTo ApiV2ShowApiConsumerAction { apiConsumerId } = "/api/v2/api-consumers/" <> tshow apiConsumerId
|
||||
pathTo ApiV2CreateApiConsumerAction = "/api/v2/api-consumers"
|
||||
pathTo ApiV2CreateApiConsumerKeyAction { apiConsumerId } = "/api/v2/api-consumers/" <> tshow apiConsumerId <> "/api-keys"
|
||||
|
||||
instance CanRoute ApiV2WidgetPatternsController where
|
||||
parseRoute' = do
|
||||
_ <- string "/api/v2/widget-patterns"
|
||||
|
||||
Reference in New Issue
Block a user