feat(core): add integration-backed search
This commit is contained in:
parent
41d11a8a89
commit
129012c3ee
50 changed files with 1745 additions and 478 deletions
|
|
@ -33,6 +33,21 @@ export const IntegrationHandler = HttpApiBuilder.group(Api, "server.integration"
|
|||
return yield* response(service.get(ctx.params.integrationID))
|
||||
}),
|
||||
)
|
||||
.handle(
|
||||
"integration.capability.select",
|
||||
Effect.fn(function* (ctx) {
|
||||
const service = yield* Integration.Service
|
||||
const integration = yield* service.get(ctx.params.integrationID)
|
||||
if (!integration?.capabilities.some((capability) => capability.type === ctx.payload.capability)) {
|
||||
return yield* new InvalidRequestError({
|
||||
message: `Capability not found: ${ctx.payload.capability}`,
|
||||
kind: "integration_capability_not_found",
|
||||
})
|
||||
}
|
||||
yield* service.capability.search.select(ctx.params.integrationID)
|
||||
return HttpApiSchema.NoContent.make()
|
||||
}),
|
||||
)
|
||||
.handle(
|
||||
"integration.connect.key",
|
||||
Effect.fn(function* (ctx) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue