diff --git a/.github/workflows/sync-management-api-docs.yml b/.github/workflows/sync-management-api-docs.yml index bd7143263d..35a61a768a 100644 --- a/.github/workflows/sync-management-api-docs.yml +++ b/.github/workflows/sync-management-api-docs.yml @@ -37,7 +37,7 @@ jobs: - name: Generate docs working-directory: apps/docs - run: pnpm tsx scripts/generate-docs.ts + run: pnpm run generate:management-api-docs - name: Check for changes id: changes diff --git a/apps/docs/content/docs/management-api/endpoints/connections/delete-connections.mdx b/apps/docs/content/docs/management-api/endpoints/connections/delete-connections-by-id.mdx similarity index 61% rename from apps/docs/content/docs/management-api/endpoints/connections/delete-connections.mdx rename to apps/docs/content/docs/management-api/endpoints/connections/delete-connections-by-id.mdx index 836146fcef..dcb69fdba3 100644 --- a/apps/docs/content/docs/management-api/endpoints/connections/delete-connections.mdx +++ b/apps/docs/content/docs/management-api/endpoints/connections/delete-connections-by-id.mdx @@ -2,17 +2,20 @@ title: Delete connection full: true _openapi: - path: "/v1/connections/{id}" method: DELETE toc: [] structuredData: headings: [] contents: - content: Deletes the connection with the given ID. + path: '/v1/connections/{id}' +url: /management-api/endpoints/connections/delete-connections-by-id +metaTitle: 'DELETE /v1/connections/{id} | Delete connection' +metaDescription: 'Management API: Deletes the connection with the given ID.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Deletes the connection with the given ID. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/connections/get-connections-by-id.mdx b/apps/docs/content/docs/management-api/endpoints/connections/get-connections-by-id.mdx new file mode 100644 index 0000000000..6b260c43e1 --- /dev/null +++ b/apps/docs/content/docs/management-api/endpoints/connections/get-connections-by-id.mdx @@ -0,0 +1,21 @@ +--- +title: Get connection +full: true +_openapi: + method: GET + toc: [] + structuredData: + headings: [] + contents: + - content: Returns the connection with the given ID. + path: '/v1/connections/{id}' +url: /management-api/endpoints/connections/get-connections-by-id +metaTitle: 'GET /v1/connections/{id} | Get connection' +metaDescription: 'Management API: Returns the connection with the given ID.' +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + +Returns the connection with the given ID. + + diff --git a/apps/docs/content/docs/management-api/endpoints/connections/get-connections.mdx b/apps/docs/content/docs/management-api/endpoints/connections/get-connections.mdx index 4d24ec18b5..1047bea4fd 100644 --- a/apps/docs/content/docs/management-api/endpoints/connections/get-connections.mdx +++ b/apps/docs/content/docs/management-api/endpoints/connections/get-connections.mdx @@ -1,18 +1,21 @@ --- -title: Get connection +title: List connections full: true _openapi: - path: "/v1/connections/{id}" method: GET toc: [] structuredData: headings: [] contents: - - content: Returns the connection with the given ID. + - content: 'Returns all connections the actor has access to, with optional database filter.' + path: /v1/connections +url: /management-api/endpoints/connections/get-connections +metaTitle: GET /v1/connections | List connections +metaDescription: 'Management API: Returns all connections the actor has access to, with optional database filter.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} -Returns the connection with the given ID. +Returns all connections the actor has access to, with optional database filter. -age document={"management-api"} operations={[{"path":"/v1/connections","method":"get"}]} /> \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/connections/post-connections.mdx b/apps/docs/content/docs/management-api/endpoints/connections/post-connections.mdx index 4c09b1d19a..fc1f6ce2bd 100644 --- a/apps/docs/content/docs/management-api/endpoints/connections/post-connections.mdx +++ b/apps/docs/content/docs/management-api/endpoints/connections/post-connections.mdx @@ -2,17 +2,20 @@ title: Create connection full: true _openapi: - path: "/v1/connections" method: POST toc: [] structuredData: headings: [] contents: - content: Creates a new connection for the specified database. + path: /v1/connections +url: /management-api/endpoints/connections/post-connections +metaTitle: POST /v1/connections | Create connection +metaDescription: 'Management API: Creates a new connection for the specified database.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Creates a new connection for the specified database. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/database-backups/get-databases-id-backups.mdx b/apps/docs/content/docs/management-api/endpoints/database-backups/get-databases-by-database-id-backups.mdx similarity index 57% rename from apps/docs/content/docs/management-api/endpoints/database-backups/get-databases-id-backups.mdx rename to apps/docs/content/docs/management-api/endpoints/database-backups/get-databases-by-database-id-backups.mdx index 1279af6eac..81b302e7c6 100644 --- a/apps/docs/content/docs/management-api/endpoints/database-backups/get-databases-id-backups.mdx +++ b/apps/docs/content/docs/management-api/endpoints/database-backups/get-databases-by-database-id-backups.mdx @@ -2,17 +2,20 @@ title: Get list of backups full: true _openapi: - path: "/v1/databases/{databaseId}/backups" method: GET toc: [] structuredData: headings: [] contents: - content: Returns backups for the specified database. + path: '/v1/databases/{databaseId}/backups' +url: /management-api/endpoints/database-backups/get-databases-by-database-id-backups +metaTitle: 'GET /v1/databases/{databaseId}/backups | Get list of backups' +metaDescription: 'Management API: Returns backups for the specified database.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Returns backups for the specified database. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/database-usage/get-databases-id-usage.mdx b/apps/docs/content/docs/management-api/endpoints/database-usage/get-databases-by-database-id-usage.mdx similarity index 57% rename from apps/docs/content/docs/management-api/endpoints/database-usage/get-databases-id-usage.mdx rename to apps/docs/content/docs/management-api/endpoints/database-usage/get-databases-by-database-id-usage.mdx index 6ec21de90c..1bf8e97d59 100644 --- a/apps/docs/content/docs/management-api/endpoints/database-usage/get-databases-id-usage.mdx +++ b/apps/docs/content/docs/management-api/endpoints/database-usage/get-databases-by-database-id-usage.mdx @@ -2,17 +2,20 @@ title: Get database usage metrics full: true _openapi: - path: "/v1/databases/{databaseId}/usage" method: GET toc: [] structuredData: headings: [] contents: - content: Returns usage metrics for the specified database. + path: '/v1/databases/{databaseId}/usage' +url: /management-api/endpoints/database-usage/get-databases-by-database-id-usage +metaTitle: 'GET /v1/databases/{databaseId}/usage | Get database usage metrics' +metaDescription: 'Management API: Returns usage metrics for the specified database.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Returns usage metrics for the specified database. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/databases-connections/delete-connections.mdx b/apps/docs/content/docs/management-api/endpoints/databases-connections/delete-connections.mdx deleted file mode 100644 index 331540164e..0000000000 --- a/apps/docs/content/docs/management-api/endpoints/databases-connections/delete-connections.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: Delete database connection string -metaTitle: DELETE /v1/connections/{id} | Remove Connection String -metaDescription: 'Management API: Deletes the database connection string with the given ID. DELETE /v1/connections/{id}.' -full: true -_openapi: - path: '/v1/connections/{id}' - method: DELETE - toc: [] - structuredData: - headings: [] - contents: - - content: Deletes the database connection string with the given ID. -url: /management-api/endpoints/databases-connections/delete-connections ---- - -{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} - -Deletes the database connection string with the given ID. - - diff --git a/apps/docs/content/docs/management-api/endpoints/databases-connections/get-databases-id-connections.mdx b/apps/docs/content/docs/management-api/endpoints/databases-connections/get-databases-by-database-id-connections.mdx similarity index 55% rename from apps/docs/content/docs/management-api/endpoints/databases-connections/get-databases-id-connections.mdx rename to apps/docs/content/docs/management-api/endpoints/databases-connections/get-databases-by-database-id-connections.mdx index b286f5a7d7..c8e03045e7 100644 --- a/apps/docs/content/docs/management-api/endpoints/databases-connections/get-databases-id-connections.mdx +++ b/apps/docs/content/docs/management-api/endpoints/databases-connections/get-databases-by-database-id-connections.mdx @@ -2,17 +2,20 @@ title: Get list of database connections full: true _openapi: - path: "/v1/databases/{databaseId}/connections" method: GET toc: [] structuredData: headings: [] contents: - content: Returns all connections for the given database. + path: '/v1/databases/{databaseId}/connections' +url: /management-api/endpoints/databases-connections/get-databases-by-database-id-connections +metaTitle: 'GET /v1/databases/{databaseId}/connections | Get list of database connections' +metaDescription: 'Management API: Returns all connections for the given database.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Returns all connections for the given database. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/databases-connections/meta.json b/apps/docs/content/docs/management-api/endpoints/databases-connections/meta.json index f1a4e0604c..e9bb2a7872 100644 --- a/apps/docs/content/docs/management-api/endpoints/databases-connections/meta.json +++ b/apps/docs/content/docs/management-api/endpoints/databases-connections/meta.json @@ -1,4 +1,7 @@ { "title": "Connections", - "pages": ["get-databases-id-connections", "post-databases-id-connections", "delete-connections"] + "pages": [ + "get-databases-by-database-id-connections", + "post-databases-by-database-id-connections" + ] } diff --git a/apps/docs/content/docs/management-api/endpoints/databases-connections/post-databases-id-connections.mdx b/apps/docs/content/docs/management-api/endpoints/databases-connections/post-databases-by-database-id-connections.mdx similarity index 55% rename from apps/docs/content/docs/management-api/endpoints/databases-connections/post-databases-id-connections.mdx rename to apps/docs/content/docs/management-api/endpoints/databases-connections/post-databases-by-database-id-connections.mdx index b02f15ad21..ea1e128b79 100644 --- a/apps/docs/content/docs/management-api/endpoints/databases-connections/post-databases-id-connections.mdx +++ b/apps/docs/content/docs/management-api/endpoints/databases-connections/post-databases-by-database-id-connections.mdx @@ -2,17 +2,20 @@ title: Create database connection string full: true _openapi: - path: "/v1/databases/{databaseId}/connections" method: POST toc: [] structuredData: headings: [] contents: - content: Creates a new connection string for the given database. + path: '/v1/databases/{databaseId}/connections' +url: /management-api/endpoints/databases-connections/post-databases-by-database-id-connections +metaTitle: 'POST /v1/databases/{databaseId}/connections | Create database connection string' +metaDescription: 'Management API: Creates a new connection string for the given database.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Creates a new connection string for the given database. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/databases/delete-databases-id.mdx b/apps/docs/content/docs/management-api/endpoints/databases/delete-databases-by-database-id.mdx similarity index 59% rename from apps/docs/content/docs/management-api/endpoints/databases/delete-databases-id.mdx rename to apps/docs/content/docs/management-api/endpoints/databases/delete-databases-by-database-id.mdx index 76902f2ac0..8d69a086ee 100644 --- a/apps/docs/content/docs/management-api/endpoints/databases/delete-databases-id.mdx +++ b/apps/docs/content/docs/management-api/endpoints/databases/delete-databases-by-database-id.mdx @@ -2,17 +2,20 @@ title: Delete database full: true _openapi: - path: "/v1/databases/{databaseId}" method: DELETE toc: [] structuredData: headings: [] contents: - content: Deletes the database with the given ID. + path: '/v1/databases/{databaseId}' +url: /management-api/endpoints/databases/delete-databases-by-database-id +metaTitle: 'DELETE /v1/databases/{databaseId} | Delete database' +metaDescription: 'Management API: Deletes the database with the given ID.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Deletes the database with the given ID. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/databases/get-databases-id.mdx b/apps/docs/content/docs/management-api/endpoints/databases/get-databases-by-database-id.mdx similarity index 60% rename from apps/docs/content/docs/management-api/endpoints/databases/get-databases-id.mdx rename to apps/docs/content/docs/management-api/endpoints/databases/get-databases-by-database-id.mdx index 55ec10d108..2ee7aee1f6 100644 --- a/apps/docs/content/docs/management-api/endpoints/databases/get-databases-id.mdx +++ b/apps/docs/content/docs/management-api/endpoints/databases/get-databases-by-database-id.mdx @@ -2,17 +2,20 @@ title: Get database full: true _openapi: - path: "/v1/databases/{databaseId}" method: GET toc: [] structuredData: headings: [] contents: - content: Returns the database with the given ID. + path: '/v1/databases/{databaseId}' +url: /management-api/endpoints/databases/get-databases-by-database-id +metaTitle: 'GET /v1/databases/{databaseId} | Get database' +metaDescription: 'Management API: Returns the database with the given ID.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Returns the database with the given ID. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/databases/get-databases.mdx b/apps/docs/content/docs/management-api/endpoints/databases/get-databases.mdx index 4ed40935fa..18db000c5b 100644 --- a/apps/docs/content/docs/management-api/endpoints/databases/get-databases.mdx +++ b/apps/docs/content/docs/management-api/endpoints/databases/get-databases.mdx @@ -2,19 +2,20 @@ title: List databases full: true _openapi: - path: "/v1/databases" method: GET toc: [] structuredData: headings: [] contents: - - content: >- - Returns all databases the token has access to. Optionally filter by - project ID. + - content: Returns all databases the token has access to. Optionally filter by project ID. + path: /v1/databases +url: /management-api/endpoints/databases/get-databases +metaTitle: GET /v1/databases | List databases +metaDescription: 'Management API: Returns all databases the token has access to. Optionally filter by project ID.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Returns all databases the token has access to. Optionally filter by project ID. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/databases/get-projects-id-databases.mdx b/apps/docs/content/docs/management-api/endpoints/databases/get-projects-by-project-id-databases.mdx similarity index 57% rename from apps/docs/content/docs/management-api/endpoints/databases/get-projects-id-databases.mdx rename to apps/docs/content/docs/management-api/endpoints/databases/get-projects-by-project-id-databases.mdx index 6602a6cb2b..2754fade05 100644 --- a/apps/docs/content/docs/management-api/endpoints/databases/get-projects-id-databases.mdx +++ b/apps/docs/content/docs/management-api/endpoints/databases/get-projects-by-project-id-databases.mdx @@ -2,17 +2,20 @@ title: Get list of databases full: true _openapi: - path: "/v1/projects/{projectId}/databases" method: GET toc: [] structuredData: headings: [] contents: - content: Returns databases for the given project. + path: '/v1/projects/{projectId}/databases' +url: /management-api/endpoints/databases/get-projects-by-project-id-databases +metaTitle: 'GET /v1/projects/{projectId}/databases | Get list of databases' +metaDescription: 'Management API: Returns databases for the given project.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Returns databases for the given project. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/databases/meta.json b/apps/docs/content/docs/management-api/endpoints/databases/meta.json index 5505a1f046..7790d45347 100644 --- a/apps/docs/content/docs/management-api/endpoints/databases/meta.json +++ b/apps/docs/content/docs/management-api/endpoints/databases/meta.json @@ -1,9 +1,9 @@ { "title": "Databases", "pages": [ - "get-projects-id-databases", - "get-databases-id", - "post-projects-id-databases", - "delete-databases-id" + "get-projects-by-project-id-databases", + "get-databases-by-database-id", + "post-projects-by-project-id-databases", + "delete-databases-by-database-id" ] } diff --git a/apps/docs/content/docs/management-api/endpoints/databases/patch-databases-id.mdx b/apps/docs/content/docs/management-api/endpoints/databases/patch-databases-by-database-id.mdx similarity index 59% rename from apps/docs/content/docs/management-api/endpoints/databases/patch-databases-id.mdx rename to apps/docs/content/docs/management-api/endpoints/databases/patch-databases-by-database-id.mdx index eb82b54010..f46d0f2816 100644 --- a/apps/docs/content/docs/management-api/endpoints/databases/patch-databases-id.mdx +++ b/apps/docs/content/docs/management-api/endpoints/databases/patch-databases-by-database-id.mdx @@ -2,17 +2,20 @@ title: Update database full: true _openapi: - path: "/v1/databases/{databaseId}" method: PATCH toc: [] structuredData: headings: [] contents: - content: Updates the database with the given ID. + path: '/v1/databases/{databaseId}' +url: /management-api/endpoints/databases/patch-databases-by-database-id +metaTitle: 'PATCH /v1/databases/{databaseId} | Update database' +metaDescription: 'Management API: Updates the database with the given ID.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Updates the database with the given ID. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/databases/post-databases.mdx b/apps/docs/content/docs/management-api/endpoints/databases/post-databases.mdx index bbf284e61b..1137e0afc5 100644 --- a/apps/docs/content/docs/management-api/endpoints/databases/post-databases.mdx +++ b/apps/docs/content/docs/management-api/endpoints/databases/post-databases.mdx @@ -2,17 +2,20 @@ title: Create database full: true _openapi: - path: "/v1/databases" method: POST toc: [] structuredData: headings: [] contents: - content: Creates a new database in the specified project. + path: /v1/databases +url: /management-api/endpoints/databases/post-databases +metaTitle: POST /v1/databases | Create database +metaDescription: 'Management API: Creates a new database in the specified project.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Creates a new database in the specified project. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/databases/post-projects-id-databases.mdx b/apps/docs/content/docs/management-api/endpoints/databases/post-projects-by-project-id-databases.mdx similarity index 57% rename from apps/docs/content/docs/management-api/endpoints/databases/post-projects-id-databases.mdx rename to apps/docs/content/docs/management-api/endpoints/databases/post-projects-by-project-id-databases.mdx index 1d75bbc864..80001821c2 100644 --- a/apps/docs/content/docs/management-api/endpoints/databases/post-projects-id-databases.mdx +++ b/apps/docs/content/docs/management-api/endpoints/databases/post-projects-by-project-id-databases.mdx @@ -2,17 +2,20 @@ title: Create database full: true _openapi: - path: "/v1/projects/{projectId}/databases" method: POST toc: [] structuredData: headings: [] contents: - content: Creates a new database for the given project. + path: '/v1/projects/{projectId}/databases' +url: /management-api/endpoints/databases/post-projects-by-project-id-databases +metaTitle: 'POST /v1/projects/{projectId}/databases | Create database' +metaDescription: 'Management API: Creates a new database for the given project.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Creates a new database for the given project. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/integrations/delete-integrations.mdx b/apps/docs/content/docs/management-api/endpoints/integrations/delete-integrations-by-id.mdx similarity index 61% rename from apps/docs/content/docs/management-api/endpoints/integrations/delete-integrations.mdx rename to apps/docs/content/docs/management-api/endpoints/integrations/delete-integrations-by-id.mdx index 42ff94b1e4..4bddffe9bc 100644 --- a/apps/docs/content/docs/management-api/endpoints/integrations/delete-integrations.mdx +++ b/apps/docs/content/docs/management-api/endpoints/integrations/delete-integrations-by-id.mdx @@ -2,17 +2,20 @@ title: Delete integration full: true _openapi: - path: "/v1/integrations/{id}" method: DELETE toc: [] structuredData: headings: [] contents: - content: Revokes the integration tokens by integration ID. + path: '/v1/integrations/{id}' +url: /management-api/endpoints/integrations/delete-integrations-by-id +metaTitle: 'DELETE /v1/integrations/{id} | Delete integration' +metaDescription: 'Management API: Revokes the integration tokens by integration ID.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Revokes the integration tokens by integration ID. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/integrations/delete-workspaces-id-integrations-id.mdx b/apps/docs/content/docs/management-api/endpoints/integrations/delete-workspaces-by-workspace-id-integrations-by-client-id.mdx similarity index 59% rename from apps/docs/content/docs/management-api/endpoints/integrations/delete-workspaces-id-integrations-id.mdx rename to apps/docs/content/docs/management-api/endpoints/integrations/delete-workspaces-by-workspace-id-integrations-by-client-id.mdx index b46ef61e8a..523e899d68 100644 --- a/apps/docs/content/docs/management-api/endpoints/integrations/delete-workspaces-id-integrations-id.mdx +++ b/apps/docs/content/docs/management-api/endpoints/integrations/delete-workspaces-by-workspace-id-integrations-by-client-id.mdx @@ -2,17 +2,20 @@ title: Revoke integration tokens full: true _openapi: - path: "/v1/workspaces/{workspaceId}/integrations/{clientId}" method: DELETE toc: [] structuredData: headings: [] contents: - content: Revokes the integration tokens with the given client ID. + path: '/v1/workspaces/{workspaceId}/integrations/{clientId}' +url: /management-api/endpoints/integrations/delete-workspaces-by-workspace-id-integrations-by-client-id +metaTitle: 'DELETE /v1/workspaces/{workspaceId}/integrations/{clientId} | Revoke integration tokens' +metaDescription: 'Management API: Revokes the integration tokens with the given client ID.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Revokes the integration tokens with the given client ID. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/integrations/get-integrations-by-id.mdx b/apps/docs/content/docs/management-api/endpoints/integrations/get-integrations-by-id.mdx new file mode 100644 index 0000000000..5858beee2a --- /dev/null +++ b/apps/docs/content/docs/management-api/endpoints/integrations/get-integrations-by-id.mdx @@ -0,0 +1,21 @@ +--- +title: Get integration by ID +full: true +_openapi: + method: GET + toc: [] + structuredData: + headings: [] + contents: + - content: Returns a single integration by its ID. + path: '/v1/integrations/{id}' +url: /management-api/endpoints/integrations/get-integrations-by-id +metaTitle: 'GET /v1/integrations/{id} | Get integration by ID' +metaDescription: 'Management API: Returns a single integration by its ID.' +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + +Returns a single integration by its ID. + + diff --git a/apps/docs/content/docs/management-api/endpoints/integrations/get-integrations.mdx b/apps/docs/content/docs/management-api/endpoints/integrations/get-integrations.mdx index 1fcd07acba..03326d0854 100644 --- a/apps/docs/content/docs/management-api/endpoints/integrations/get-integrations.mdx +++ b/apps/docs/content/docs/management-api/endpoints/integrations/get-integrations.mdx @@ -1,18 +1,21 @@ --- -title: Get integration by ID +title: Get list of integrations full: true _openapi: - path: "/v1/integrations/{id}" method: GET toc: [] structuredData: headings: [] contents: - - content: Returns a single integration by its ID. + - content: Returns integrations filtered by workspace ID. + path: /v1/integrations +url: /management-api/endpoints/integrations/get-integrations +metaTitle: GET /v1/integrations | Get list of integrations +metaDescription: 'Management API: Returns integrations filtered by workspace ID.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} -Returns a single integration by its ID. +Returns integrations filtered by workspace ID. -"}]} /> \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/integrations/get-workspaces-id-integrations.mdx b/apps/docs/content/docs/management-api/endpoints/integrations/get-workspaces-by-workspace-id-integrations.mdx similarity index 55% rename from apps/docs/content/docs/management-api/endpoints/integrations/get-workspaces-id-integrations.mdx rename to apps/docs/content/docs/management-api/endpoints/integrations/get-workspaces-by-workspace-id-integrations.mdx index 9e7d012187..76a800c1e3 100644 --- a/apps/docs/content/docs/management-api/endpoints/integrations/get-workspaces-id-integrations.mdx +++ b/apps/docs/content/docs/management-api/endpoints/integrations/get-workspaces-by-workspace-id-integrations.mdx @@ -2,17 +2,20 @@ title: Get list of integrations full: true _openapi: - path: "/v1/workspaces/{workspaceId}/integrations" method: GET toc: [] structuredData: headings: [] contents: - content: Returns integrations for the given workspace. + path: '/v1/workspaces/{workspaceId}/integrations' +url: /management-api/endpoints/integrations/get-workspaces-by-workspace-id-integrations +metaTitle: 'GET /v1/workspaces/{workspaceId}/integrations | Get list of integrations' +metaDescription: 'Management API: Returns integrations for the given workspace.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Returns integrations for the given workspace. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/integrations/meta.json b/apps/docs/content/docs/management-api/endpoints/integrations/meta.json index 4c515b9dfd..c7cb0bca43 100644 --- a/apps/docs/content/docs/management-api/endpoints/integrations/meta.json +++ b/apps/docs/content/docs/management-api/endpoints/integrations/meta.json @@ -1,4 +1,7 @@ { "title": "Integrations", - "pages": ["get-workspaces-id-integrations", "delete-workspaces-id-integrations-id"] + "pages": [ + "get-workspaces-by-workspace-id-integrations", + "delete-workspaces-by-workspace-id-integrations-by-client-id" + ] } diff --git a/apps/docs/content/docs/management-api/endpoints/misc/get-regions-accelerate.mdx b/apps/docs/content/docs/management-api/endpoints/misc/get-regions-accelerate.mdx index d9af0e49e4..bf8c927f2b 100644 --- a/apps/docs/content/docs/management-api/endpoints/misc/get-regions-accelerate.mdx +++ b/apps/docs/content/docs/management-api/endpoints/misc/get-regions-accelerate.mdx @@ -2,17 +2,20 @@ title: Get Prisma Accelerate regions full: true _openapi: - path: "/v1/regions/accelerate" method: GET toc: [] structuredData: headings: [] contents: - content: Returns all available regions for Prisma Accelerate. + path: /v1/regions/accelerate +url: /management-api/endpoints/misc/get-regions-accelerate +metaTitle: GET /v1/regions/accelerate | Get Prisma Accelerate regions +metaDescription: 'Management API: Returns all available regions for Prisma Accelerate.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Returns all available regions for Prisma Accelerate. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/misc/get-regions-postgres.mdx b/apps/docs/content/docs/management-api/endpoints/misc/get-regions-postgres.mdx index 6b4d919cac..234be6b55d 100644 --- a/apps/docs/content/docs/management-api/endpoints/misc/get-regions-postgres.mdx +++ b/apps/docs/content/docs/management-api/endpoints/misc/get-regions-postgres.mdx @@ -2,17 +2,20 @@ title: Get Prisma Postgres regions full: true _openapi: - path: "/v1/regions/postgres" method: GET toc: [] structuredData: headings: [] contents: - content: Returns all available regions for Prisma Postgres. + path: /v1/regions/postgres +url: /management-api/endpoints/misc/get-regions-postgres +metaTitle: GET /v1/regions/postgres | Get Prisma Postgres regions +metaDescription: 'Management API: Returns all available regions for Prisma Postgres.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Returns all available regions for Prisma Postgres. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/projects/delete-projects.mdx b/apps/docs/content/docs/management-api/endpoints/projects/delete-projects-by-id.mdx similarity index 62% rename from apps/docs/content/docs/management-api/endpoints/projects/delete-projects.mdx rename to apps/docs/content/docs/management-api/endpoints/projects/delete-projects-by-id.mdx index bc040e2dc7..e2e6add30e 100644 --- a/apps/docs/content/docs/management-api/endpoints/projects/delete-projects.mdx +++ b/apps/docs/content/docs/management-api/endpoints/projects/delete-projects-by-id.mdx @@ -2,17 +2,20 @@ title: Delete project full: true _openapi: - path: "/v1/projects/{id}" method: DELETE toc: [] structuredData: headings: [] contents: - content: Deletes the project with the given ID. + path: '/v1/projects/{id}' +url: /management-api/endpoints/projects/delete-projects-by-id +metaTitle: 'DELETE /v1/projects/{id} | Delete project' +metaDescription: 'Management API: Deletes the project with the given ID.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Deletes the project with the given ID. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/projects/get-projects-by-id.mdx b/apps/docs/content/docs/management-api/endpoints/projects/get-projects-by-id.mdx new file mode 100644 index 0000000000..6b844ec487 --- /dev/null +++ b/apps/docs/content/docs/management-api/endpoints/projects/get-projects-by-id.mdx @@ -0,0 +1,21 @@ +--- +title: Get project +full: true +_openapi: + method: GET + toc: [] + structuredData: + headings: [] + contents: + - content: Returns the project with the given ID. + path: '/v1/projects/{id}' +url: /management-api/endpoints/projects/get-projects-by-id +metaTitle: 'GET /v1/projects/{id} | Get project' +metaDescription: 'Management API: Returns the project with the given ID.' +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + +Returns the project with the given ID. + + diff --git a/apps/docs/content/docs/management-api/endpoints/projects/get-projects.mdx b/apps/docs/content/docs/management-api/endpoints/projects/get-projects.mdx index 03c0c1481f..a331aa539a 100644 --- a/apps/docs/content/docs/management-api/endpoints/projects/get-projects.mdx +++ b/apps/docs/content/docs/management-api/endpoints/projects/get-projects.mdx @@ -1,18 +1,21 @@ --- -title: Get project +title: Get list of projects full: true _openapi: - path: "/v1/projects/{id}" method: GET toc: [] structuredData: headings: [] contents: - - content: Returns the project with the given ID. + - content: Returns the list of projects the token has access to. + path: /v1/projects +url: /management-api/endpoints/projects/get-projects +metaTitle: GET /v1/projects | Get list of projects +metaDescription: 'Management API: Returns the list of projects the token has access to.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} -Returns the project with the given ID. +Returns the list of projects the token has access to. -rojects","method":"get"}]} /> \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/projects/meta.json b/apps/docs/content/docs/management-api/endpoints/projects/meta.json index 3c3a194f96..0da874b2b1 100644 --- a/apps/docs/content/docs/management-api/endpoints/projects/meta.json +++ b/apps/docs/content/docs/management-api/endpoints/projects/meta.json @@ -1,4 +1,9 @@ { "title": "Projects", - "pages": ["get-projects", "post-projects", "post-projects-transfer", "delete-projects"] + "pages": [ + "get-projects", + "post-projects", + "post-projects-by-id-transfer", + "delete-projects-by-id" + ] } diff --git a/apps/docs/content/docs/management-api/endpoints/projects/patch-projects.mdx b/apps/docs/content/docs/management-api/endpoints/projects/patch-projects-by-id.mdx similarity index 63% rename from apps/docs/content/docs/management-api/endpoints/projects/patch-projects.mdx rename to apps/docs/content/docs/management-api/endpoints/projects/patch-projects-by-id.mdx index 2aee9664ea..16119a9799 100644 --- a/apps/docs/content/docs/management-api/endpoints/projects/patch-projects.mdx +++ b/apps/docs/content/docs/management-api/endpoints/projects/patch-projects-by-id.mdx @@ -2,17 +2,20 @@ title: Update project full: true _openapi: - path: "/v1/projects/{id}" method: PATCH toc: [] structuredData: headings: [] contents: - content: Updates the project with the given ID. + path: '/v1/projects/{id}' +url: /management-api/endpoints/projects/patch-projects-by-id +metaTitle: 'PATCH /v1/projects/{id} | Update project' +metaDescription: 'Management API: Updates the project with the given ID.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Updates the project with the given ID. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/projects/post-projects-transfer.mdx b/apps/docs/content/docs/management-api/endpoints/projects/post-projects-by-id-transfer.mdx similarity index 60% rename from apps/docs/content/docs/management-api/endpoints/projects/post-projects-transfer.mdx rename to apps/docs/content/docs/management-api/endpoints/projects/post-projects-by-id-transfer.mdx index f09794a467..71e32796f1 100644 --- a/apps/docs/content/docs/management-api/endpoints/projects/post-projects-transfer.mdx +++ b/apps/docs/content/docs/management-api/endpoints/projects/post-projects-by-id-transfer.mdx @@ -2,17 +2,20 @@ title: Transfer project full: true _openapi: - path: "/v1/projects/{id}/transfer" method: POST toc: [] structuredData: headings: [] contents: - content: Transfer the project with the given ID to the new owner's workspace + path: '/v1/projects/{id}/transfer' +url: /management-api/endpoints/projects/post-projects-by-id-transfer +metaTitle: 'POST /v1/projects/{id}/transfer | Transfer project' +metaDescription: 'Management API: Transfer the project with the given ID to the new owner''s workspace' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Transfer the project with the given ID to the new owner's workspace - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/projects/post-projects.mdx b/apps/docs/content/docs/management-api/endpoints/projects/post-projects.mdx index 0a9d36039b..d63dffb6e0 100644 --- a/apps/docs/content/docs/management-api/endpoints/projects/post-projects.mdx +++ b/apps/docs/content/docs/management-api/endpoints/projects/post-projects.mdx @@ -2,17 +2,20 @@ title: Create project with a postgres database full: true _openapi: - path: "/v1/projects" method: POST toc: [] structuredData: headings: [] contents: - content: Creates a new project with a postgres database. + path: /v1/projects +url: /management-api/endpoints/projects/post-projects +metaTitle: POST /v1/projects | Create project with a postgres database +metaDescription: 'Management API: Creates a new project with a postgres database.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Creates a new project with a postgres database. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/regions/get-regions.mdx b/apps/docs/content/docs/management-api/endpoints/regions/get-regions.mdx index d56f372311..e60cc1fcf6 100644 --- a/apps/docs/content/docs/management-api/endpoints/regions/get-regions.mdx +++ b/apps/docs/content/docs/management-api/endpoints/regions/get-regions.mdx @@ -2,19 +2,20 @@ title: Get all regions full: true _openapi: - path: "/v1/regions" method: GET toc: [] structuredData: headings: [] contents: - - content: >- - Returns all available regions across products. Optionally filter by - product. + - content: Returns all available regions across products. Optionally filter by product. + path: /v1/regions +url: /management-api/endpoints/regions/get-regions +metaTitle: GET /v1/regions | Get all regions +metaDescription: 'Management API: Returns all available regions across products. Optionally filter by product.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} Returns all available regions across products. Optionally filter by product. - \ No newline at end of file + diff --git a/apps/docs/content/docs/management-api/endpoints/workspaces/get-workspaces-by-id.mdx b/apps/docs/content/docs/management-api/endpoints/workspaces/get-workspaces-by-id.mdx new file mode 100644 index 0000000000..3b9d415615 --- /dev/null +++ b/apps/docs/content/docs/management-api/endpoints/workspaces/get-workspaces-by-id.mdx @@ -0,0 +1,21 @@ +--- +title: Get workspace +full: true +_openapi: + method: GET + toc: [] + structuredData: + headings: [] + contents: + - content: Returns the workspace with the given ID. + path: '/v1/workspaces/{id}' +url: /management-api/endpoints/workspaces/get-workspaces-by-id +metaTitle: 'GET /v1/workspaces/{id} | Get workspace' +metaDescription: 'Management API: Returns the workspace with the given ID.' +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + +Returns the workspace with the given ID. + + diff --git a/apps/docs/content/docs/management-api/endpoints/workspaces/get-workspaces.mdx b/apps/docs/content/docs/management-api/endpoints/workspaces/get-workspaces.mdx index 1f69cc7c49..b64fa3006c 100644 --- a/apps/docs/content/docs/management-api/endpoints/workspaces/get-workspaces.mdx +++ b/apps/docs/content/docs/management-api/endpoints/workspaces/get-workspaces.mdx @@ -1,18 +1,21 @@ --- -title: Get workspace +title: Get list of workspaces full: true _openapi: - path: "/v1/workspaces/{id}" method: GET toc: [] structuredData: headings: [] contents: - - content: Returns the workspace with the given ID. + - content: Returns the list of workspaces the current token can access. + path: /v1/workspaces +url: /management-api/endpoints/workspaces/get-workspaces +metaTitle: GET /v1/workspaces | Get list of workspaces +metaDescription: 'Management API: Returns the list of workspaces the current token can access.' --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} -Returns the workspace with the given ID. +Returns the list of workspaces the current token can access. -":"/v1/workspaces","method":"get"}]} /> \ No newline at end of file + diff --git a/apps/docs/package.json b/apps/docs/package.json index 5d55fef0ae..902e5531c1 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -5,6 +5,7 @@ "type": "module", "scripts": { "fetch-openapi": "tsx ./scripts/fetch-openapi.ts", + "generate:management-api-docs": "rimraf ./content/docs/management-api/endpoints/**/*.mdx && pnpm run fetch-openapi && tsx ./scripts/generate-docs.ts && fumadocs-mdx", "prebuild": "rimraf out", "build": "pnpm run fetch-openapi && next build", "dev": "next dev", diff --git a/apps/docs/scripts/generate-docs.ts b/apps/docs/scripts/generate-docs.ts index f355a3c02a..0c684bcb26 100644 --- a/apps/docs/scripts/generate-docs.ts +++ b/apps/docs/scripts/generate-docs.ts @@ -1,4 +1,5 @@ import { generateFiles } from "fumadocs-openapi"; +import matter from "gray-matter"; import { openapi } from "@/lib/openapi"; void generateFiles({ @@ -16,7 +17,6 @@ void generateFiles({ const cleanName = operationId .replace(/V\d+/g, "") - .replace(/By[A-Z][a-z]*/g, "") .replace(/([a-z])([A-Z])/g, "$1-$2") .toLowerCase(); @@ -26,31 +26,94 @@ void generateFiles({ return output.item.name; }, beforeWrite(files) { + const operationByFilePath = new Map(); + + for (const entries of Object.values(this.generatedEntries)) { + for (const entry of entries) { + if (entry.type !== "operation") continue; + operationByFilePath.set(entry.path, { + path: entry.item.path, + method: entry.item.method.toUpperCase(), + title: entry.info.title, + description: entry.info.description, + }); + } + } + for (const file of files) { - const frontmatterMatch = file.content.match(/^---\n([\s\S]*?)\n---/); - if (frontmatterMatch) { - const frontmatter = frontmatterMatch[1]; - if (frontmatter.includes("_openapi:")) { - const apiPageMatch = file.content.match(/]*operations=\{(\[.*?\])\}/s); - if (apiPageMatch) { - try { - const operations = JSON.parse(apiPageMatch[1].replace(/'/g, '"')); - if (operations[0]?.path) { - const path = operations[0].path; - - const updatedFrontmatter = frontmatter.replace( - /(_openapi:\s*\n\s*method:)/, - `_openapi:\n path: "${path}"\n method:`, - ); - - file.content = file.content.replace(frontmatter, updatedFrontmatter); - } - } catch (e) { - console.warn(`Failed to parse operations for ${file.path}:`, e); - } - } - } + const operation = operationByFilePath.get(file.path); + if (!operation) continue; + + const parsed = matter(file.content); + const data = parsed.data as Record; + + let changed = false; + + const openapiData = + typeof data._openapi === "object" && data._openapi !== null + ? (data._openapi as Record) + : {}; + + if (data._openapi !== openapiData) { + data._openapi = openapiData; + changed = true; + } + + if (openapiData.path !== operation.path) { + openapiData.path = operation.path; + changed = true; + } + + if (openapiData.method !== operation.method) { + openapiData.method = operation.method; + changed = true; } + + const normalizedPath = file.path + .replace(/\\/g, "/") + .replace(/\.mdx$/, "") + .replace(/^management-api\/endpoints\//, ""); + const url = `/management-api/endpoints/${normalizedPath}`; + + if (data.url !== url) { + data.url = url; + changed = true; + } + + const title = + typeof data.title === "string" && data.title.trim().length > 0 + ? data.title.trim() + : operation.title; + const metaTitle = `${operation.method} ${operation.path} | ${title}`; + + if (data.metaTitle !== metaTitle) { + data.metaTitle = metaTitle; + changed = true; + } + + const description = + typeof operation.description === "string" && operation.description.trim().length > 0 + ? operation.description.trim() + : `${operation.method} ${operation.path}.`; + const metaDescription = description.startsWith("Management API:") + ? description + : `Management API: ${description}`; + + if (data.metaDescription !== metaDescription) { + data.metaDescription = metaDescription; + changed = true; + } + + if (!changed) continue; + + file.content = matter.stringify(parsed.content, data, { + lineWidth: -1, + } as Parameters[2]); } }, }); diff --git a/apps/docs/src/app/og/[...slug]/route.tsx b/apps/docs/src/app/og/[...slug]/route.tsx index 69bc0779db..650967d602 100644 --- a/apps/docs/src/app/og/[...slug]/route.tsx +++ b/apps/docs/src/app/og/[...slug]/route.tsx @@ -19,8 +19,18 @@ const HTTP_METHOD_COLORS = { GET: "#07DC71", POST: "#51A2FF", DELETE: "#FF6467", + PATCH: "#F7B955", } as const; +type OpenApiMetadata = { + method?: string; + path?: string; +}; + +type PageFrontmatter = { + _openapi?: OpenApiMetadata; +}; + function PrismaOGImage({ title, description, @@ -30,10 +40,12 @@ function PrismaOGImage({ }: { title: string; description?: string; - method?: "GET" | "POST" | "DELETE"; + method?: string; apiPath?: string; section?: string; }) { + const methodColor = method ? HTTP_METHOD_COLORS[method as keyof typeof HTTP_METHOD_COLORS] ?? "#71e8df" : null; + return (
- {method ? ( + {method && methodColor ? (
{method} @@ -200,8 +212,9 @@ export async function GET(_req: Request, { params }: RouteContext<"/og/[...slug] const page = source.getPage(slug.slice(0, -1)) ?? sourceV6.getPage(slug.slice(0, -1)); if (!page) notFound(); - const method = (page.data as any)?._openapi?.method as "GET" | "POST" | "DELETE" | undefined; - const apiPath = (page.data as any)?._openapi?.path as string | undefined; + const openApiMetadata = (page.data as PageFrontmatter)._openapi; + const method = openApiMetadata?.method; + const apiPath = openApiMetadata?.path; const section = page.slugs[0]; return new ImageResponse( diff --git a/package.json b/package.json index daab08195c..ecae1facf0 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "dev": "turbo run dev", "check": "turbo run check", "types:check": "turbo run types:check", + "generate:management-api-docs": "pnpm --filter docs run generate:management-api-docs", "lint:links": "turbo run lint:links --filter=docs", "lint:external-links": "turbo run lint:external-links --filter=docs", "lint:code": "turbo run lint:code --filter=docs",