expose list integrations api

This commit is contained in:
Maidul Islam
2024-04-11 19:41:55 -04:00
parent 945d81ad4b
commit 79de7f9f5b
4 changed files with 17 additions and 3 deletions
+3
View File
@@ -551,5 +551,8 @@ export const INTEGRATION = {
}, },
DELETE: { DELETE: {
integrationId: "The ID of the integration object." integrationId: "The ID of the integration object."
},
LIST_INTEGRATION: {
workspaceId: "The ID of the project to list integrations for."
} }
}; };
@@ -7,7 +7,7 @@ import {
UserEncryptionKeysSchema, UserEncryptionKeysSchema,
UsersSchema UsersSchema
} from "@app/db/schemas"; } from "@app/db/schemas";
import { INTEGRATION_AUTH, PROJECTS } from "@app/lib/api-docs"; import { INTEGRATION, INTEGRATION_AUTH, PROJECTS } from "@app/lib/api-docs";
import { readLimit, writeLimit } from "@app/server/config/rateLimiter"; import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
import { verifyAuth } from "@app/server/plugins/auth/verify-auth"; import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
import { AuthMode } from "@app/services/auth/auth-type"; import { AuthMode } from "@app/services/auth/auth-type";
@@ -326,8 +326,14 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
rateLimit: readLimit rateLimit: readLimit
}, },
schema: { schema: {
description: "List integrations for a project.",
security: [
{
bearerAuth: []
}
],
params: z.object({ params: z.object({
workspaceId: z.string().trim() workspaceId: z.string().trim().describe(INTEGRATION.LIST_INTEGRATION.workspaceId)
}), }),
response: { response: {
200: z.object({ 200: z.object({
@@ -0,0 +1,4 @@
---
title: "List project integrations"
openapi: "GET /api/v1/workspace/{workspaceId}/integrations"
---
+2 -1
View File
@@ -519,7 +519,8 @@
"api-reference/endpoints/integrations/delete-auth-by-id", "api-reference/endpoints/integrations/delete-auth-by-id",
"api-reference/endpoints/integrations/create", "api-reference/endpoints/integrations/create",
"api-reference/endpoints/integrations/update", "api-reference/endpoints/integrations/update",
"api-reference/endpoints/integrations/delete" "api-reference/endpoints/integrations/delete",
"api-reference/endpoints/integrations/list-project-integrations"
] ]
}, },
{ {