From a1132142ffe0c0c06f9374ccc57deddcfe34c77c Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Thu, 11 Dec 2025 17:25:38 -0600 Subject: [PATCH] feat(api): Add RapiDoc Mini component for API operation pages The feature is shippable, but needs a few small fixes and we'll need to update or alias all API docs links for Core and Ent3. - Add rapidoc-mini.ts TypeScript component with CDN loading and theme sync - Add api-operation layout for standalone operation pages - Add rapidoc-mini.html partial for reusable RapiDoc rendering - Add rapidoc-custom.css for RapiDoc style overrides - Register rapidoc-mini component in main.js - Add article data for cloud-dedicated and clustered products - Update API reference Cypress tests --- api-docs/influxdb3/core/v3/ref.yml | 40 +- api-docs/influxdb3/enterprise/v3/ref.yml | 173 +-------- .../scripts/dist/generate-openapi-articles.js | 128 ++++++- .../dist/openapi-paths-to-hugo-data/index.js | 16 + api-docs/scripts/generate-openapi-articles.ts | 176 ++++++++- .../openapi-paths-to-hugo-data/index.ts | 20 + assets/js/components/rapidoc-mini.ts | 334 +++++++++++++++++ assets/js/main.js | 2 + assets/styles/layouts/_api-layout.scss | 53 ++- assets/styles/layouts/_sidebar.scss | 13 +- cypress/e2e/content/api-reference.cy.js | 156 ++++++++ .../influxdb/cloud-dedicated/articles.json | 30 ++ .../influxdb/clustered/articles.json | 66 ++++ .../influxdb/influxdb3_core/articles.json | 170 +++------ .../influxdb/influxdb3_core/articles.yml | 295 +++++---------- .../influxdb3_enterprise/articles.json | 194 +++------- .../influxdb3_enterprise/articles.yml | 354 +++++------------- layouts/api-operation/operation.html | 73 ++++ layouts/api/list.html | 18 +- layouts/partials/api/rapidoc-mini.html | 135 +++++++ layouts/partials/api/rapidoc.html | 150 +++++++- layouts/partials/sidebar/api-menu-items.html | 56 ++- static/css/rapidoc-custom.css | 18 + 23 files changed, 1692 insertions(+), 978 deletions(-) create mode 100644 assets/js/components/rapidoc-mini.ts create mode 100644 data/article_data/influxdb/cloud-dedicated/articles.json create mode 100644 data/article_data/influxdb/clustered/articles.json create mode 100644 layouts/api-operation/operation.html create mode 100644 layouts/partials/api/rapidoc-mini.html create mode 100644 static/css/rapidoc-custom.css diff --git a/api-docs/influxdb3/core/v3/ref.yml b/api-docs/influxdb3/core/v3/ref.yml index ca8b8d55c..a8d7c5469 100644 --- a/api-docs/influxdb3/core/v3/ref.yml +++ b/api-docs/influxdb3/core/v3/ref.yml @@ -90,33 +90,20 @@ tags: - [Manage the Distinct Value Cache](/influxdb3/core/admin/distinct-value-cache/) - [Manage the Last Value Cache](/influxdb3/core/admin/last-value-cache/) - - name: Compatibility endpoints + - name: Migrate from InfluxDB v1 or v2 + x-traitTag: true description: | - InfluxDB 3 provides compatibility endpoints for InfluxDB 1.x and InfluxDB 2.x workloads and clients. + Migrate your existing InfluxDB v1 or v2 workloads to InfluxDB 3. - ### Write data using v1- or v2-compatible endpoints + InfluxDB 3 provides compatibility endpoints that work with InfluxDB 1.x and 2.x client libraries and tools. + Operations marked with v1 or v2 badges are compatible with the respective InfluxDB version. - - [`/api/v2/write` endpoint](#operation/PostV2Write) - for InfluxDB v2 clients and when you bring existing InfluxDB v2 write workloads to InfluxDB 3. - - [`/write` endpoint](#operation/PostV1Write) for InfluxDB v1 clients and when you bring existing InfluxDB v1 write workloads to InfluxDB 3. + ### Migration guides - For new workloads, use the [`/api/v3/write_lp` endpoint](#operation/PostWriteLP). - - All endpoints accept the same line protocol format. - - ### Query data - - Use the HTTP [`/query`](#operation/GetV1ExecuteQuery) endpoint for InfluxDB v1 clients and v1 query workloads using InfluxQL. - - For new workloads, use one of the following: - - - HTTP [`/api/v3/query_sql` endpoint](#operation/GetExecuteQuerySQL) for new query workloads using SQL. - - HTTP [`/api/v3/query_influxql` endpoint](#operation/GetExecuteInfluxQLQuery) for new query workloads using InfluxQL. - - Flight SQL and InfluxDB 3 _Flight+gRPC_ APIs for querying with SQL or InfluxQL. For more information about using Flight APIs, see [InfluxDB 3 client libraries](https://github.com/InfluxCommunity?q=influxdb3&type=public&language=&sort=). - - ### Server information - - Server information endpoints such as `/health` and `metrics` are compatible with InfluxDB 1.x and InfluxDB 2.x clients. + - [Migrate from InfluxDB v1](/influxdb3/core/guides/migrate/influxdb-1x/) - For users migrating from InfluxDB 1.x + - [Migrate from InfluxDB v2](/influxdb3/core/guides/migrate/influxdb-2x/) - For users migrating from InfluxDB 2.x or Cloud + - [Use compatibility APIs to write data](/influxdb3/core/write-data/http-api/compatibility-apis/) - v1 and v2 write endpoints + - [Use the v1 HTTP query API](/influxdb3/core/query-data/execute-queries/influxdb-v1-api/) - InfluxQL queries via HTTP - name: Database description: Manage databases - description: | @@ -340,7 +327,6 @@ paths: '413': description: Request entity too large. tags: - - Compatibility endpoints - Write data x-influxdata-guides: - title: Use compatibility APIs to write data @@ -429,7 +415,6 @@ paths: '413': description: Request entity too large. tags: - - Compatibility endpoints - Write data x-influxdata-guides: - title: Use compatibility APIs to write data @@ -852,7 +837,6 @@ paths: description: Unprocessable entity. tags: - Query data - - Compatibility endpoints x-influxdata-guides: - title: Use the InfluxDB v1 HTTP query API and InfluxQL to query data href: /influxdb3/core/query-data/execute-queries/influxdb-v1-api/ @@ -970,7 +954,6 @@ paths: description: Unprocessable entity. tags: - Query data - - Compatibility endpoints x-influxdata-guides: - title: Use the InfluxDB v1 HTTP query API and InfluxQL to query data href: /influxdb3/core/query-data/execute-queries/influxdb-v1-api/ @@ -999,7 +982,6 @@ paths: description: Service is unavailable. tags: - Server information - - Compatibility endpoints /ping: get: operationId: GetPing @@ -2693,10 +2675,10 @@ x-tagGroups: tags: - Quick start - Authentication + - Migrate from InfluxDB v1 or v2 - Cache data - Common parameters - Response codes - - Compatibility endpoints - Database - Processing engine - Server information diff --git a/api-docs/influxdb3/enterprise/v3/ref.yml b/api-docs/influxdb3/enterprise/v3/ref.yml index 1116a91d4..b68a86a55 100644 --- a/api-docs/influxdb3/enterprise/v3/ref.yml +++ b/api-docs/influxdb3/enterprise/v3/ref.yml @@ -5,18 +5,15 @@ info: The InfluxDB HTTP API for InfluxDB 3 Enterprise provides a programmatic interface for interacting with InfluxDB 3 Enterprise databases and resources. Use this API to: - - Write data to InfluxDB 3 Enterprise databases - Query data using SQL or InfluxQL - Process data using Processing engine plugins - Manage databases, tables, and Processing engine triggers - Perform administrative tasks and access system information - The API includes endpoints under the following paths: - `/api/v3`: InfluxDB 3 Enterprise native endpoints - `/`: Compatibility endpoints for InfluxDB v1 workloads and clients - `/api/v2/write`: Compatibility endpoint for InfluxDB v2 workloads and clients -