docs-v2/api-docs/openapi/plugins/docs-content.js

25 lines
812 B
JavaScript
Raw Normal View History

const path = require('path');
const { toJSON } = require('./helpers/content-helper');
function getVersioned(filename) {
const apiDocsRoot=path.resolve(process.env.API_DOCS_ROOT_PATH || process.cwd());
feat(v3): Restructure API docs for v3 (#5408) * v3 management API Fixes #5397 - Adds an API reference doc for the HTTP management API openapi spec (https://github.com/influxdata/granite/blob/main/openapi.yaml) (Cloud Dedicated only) - Doesn't fetch changes for any specs except for the Management spec. - Adds summaries and fixes descriptions in spec overrides. - Removes versions in spec overrides. - Adds configuration for generating API reference docs, Hugo frontmatter, setting the default API (for the [product]/api/ URL) - Restructures `/api-docs` to better allow for multiple APIs (and customizations) per product - Adds `[product]/api/v2/` docs URL for cloud products (currently set as the "default" API, `[product]/api`) - Refactors `generate-api-docs` to remove specific conditions and use the new directory structure. - Redocly update fixes some theme formatting issues - Tested the following URLs: - http://localhost:1313/influxdb/v2/api/ - http://localhost:1313/influxdb/v2/api/v1-compatibility/ - http://localhost:1313/influxdb/cloud/api/ - http://localhost:1313/influxdb/cloud/api/v2/ - http://localhost:1313/influxdb/cloud-dedicated/api/ - http://localhost:1313/influxdb/cloud-dedicated/api/v2/ - http://localhost:1313/influxdb/cloud/api/v1-compatibility/ - http://localhost:1313/influxdb/cloud-dedicated/api/v1-compatibility/ - http://localhost:1313/influxdb/cloud-serverless/ - http://localhost:1313/influxdb/cloud-serverless/api/v2/ - http://localhost:1313/influxdb/cloud-serverless/api/v1-compatibility/ - http://localhost:1313/influxdb/clustered/api/ - http://localhost:1313/influxdb/clustered/api/v2/ - http://localhost:1313/influxdb/clustered/api/v1-compatibility/ * fix(v3): Remove Management API from menu * Update api-docs/cloud-dedicated/v2/content/info.yml * show management api in nav, update nav names --------- Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> Co-authored-by: Scott Anderson <scott@influxdata.com>
2024-04-09 23:02:12 +00:00
let contentPath = path.join(apiDocsRoot, process.env.INFLUXDB_PRODUCT, process.env.INFLUXDB_API_NAME, 'content');
content = toJSON(path.join(contentPath, filename));
if (content) {
return content;
} else {
// If the content is not found in the product/api folder, try the product folder
return toJSON(path.join(apiDocsRoot, process.env.INFLUXDB_PRODUCT, 'content', filename));
}
}
const info = () => getVersioned('info.yml');
feat(v3): Restructure API docs for v3 (#5408) * v3 management API Fixes #5397 - Adds an API reference doc for the HTTP management API openapi spec (https://github.com/influxdata/granite/blob/main/openapi.yaml) (Cloud Dedicated only) - Doesn't fetch changes for any specs except for the Management spec. - Adds summaries and fixes descriptions in spec overrides. - Removes versions in spec overrides. - Adds configuration for generating API reference docs, Hugo frontmatter, setting the default API (for the [product]/api/ URL) - Restructures `/api-docs` to better allow for multiple APIs (and customizations) per product - Adds `[product]/api/v2/` docs URL for cloud products (currently set as the "default" API, `[product]/api`) - Refactors `generate-api-docs` to remove specific conditions and use the new directory structure. - Redocly update fixes some theme formatting issues - Tested the following URLs: - http://localhost:1313/influxdb/v2/api/ - http://localhost:1313/influxdb/v2/api/v1-compatibility/ - http://localhost:1313/influxdb/cloud/api/ - http://localhost:1313/influxdb/cloud/api/v2/ - http://localhost:1313/influxdb/cloud-dedicated/api/ - http://localhost:1313/influxdb/cloud-dedicated/api/v2/ - http://localhost:1313/influxdb/cloud/api/v1-compatibility/ - http://localhost:1313/influxdb/cloud-dedicated/api/v1-compatibility/ - http://localhost:1313/influxdb/cloud-serverless/ - http://localhost:1313/influxdb/cloud-serverless/api/v2/ - http://localhost:1313/influxdb/cloud-serverless/api/v1-compatibility/ - http://localhost:1313/influxdb/clustered/api/ - http://localhost:1313/influxdb/clustered/api/v2/ - http://localhost:1313/influxdb/clustered/api/v1-compatibility/ * fix(v3): Remove Management API from menu * Update api-docs/cloud-dedicated/v2/content/info.yml * show management api in nav, update nav names --------- Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> Co-authored-by: Scott Anderson <scott@influxdata.com>
2024-04-09 23:02:12 +00:00
const servers = () => getVersioned('servers.yml');
const tagGroups = () => getVersioned('tag-groups.yml');
module.exports = {
info,
feat(v3): Restructure API docs for v3 (#5408) * v3 management API Fixes #5397 - Adds an API reference doc for the HTTP management API openapi spec (https://github.com/influxdata/granite/blob/main/openapi.yaml) (Cloud Dedicated only) - Doesn't fetch changes for any specs except for the Management spec. - Adds summaries and fixes descriptions in spec overrides. - Removes versions in spec overrides. - Adds configuration for generating API reference docs, Hugo frontmatter, setting the default API (for the [product]/api/ URL) - Restructures `/api-docs` to better allow for multiple APIs (and customizations) per product - Adds `[product]/api/v2/` docs URL for cloud products (currently set as the "default" API, `[product]/api`) - Refactors `generate-api-docs` to remove specific conditions and use the new directory structure. - Redocly update fixes some theme formatting issues - Tested the following URLs: - http://localhost:1313/influxdb/v2/api/ - http://localhost:1313/influxdb/v2/api/v1-compatibility/ - http://localhost:1313/influxdb/cloud/api/ - http://localhost:1313/influxdb/cloud/api/v2/ - http://localhost:1313/influxdb/cloud-dedicated/api/ - http://localhost:1313/influxdb/cloud-dedicated/api/v2/ - http://localhost:1313/influxdb/cloud/api/v1-compatibility/ - http://localhost:1313/influxdb/cloud-dedicated/api/v1-compatibility/ - http://localhost:1313/influxdb/cloud-serverless/ - http://localhost:1313/influxdb/cloud-serverless/api/v2/ - http://localhost:1313/influxdb/cloud-serverless/api/v1-compatibility/ - http://localhost:1313/influxdb/clustered/api/ - http://localhost:1313/influxdb/clustered/api/v2/ - http://localhost:1313/influxdb/clustered/api/v1-compatibility/ * fix(v3): Remove Management API from menu * Update api-docs/cloud-dedicated/v2/content/info.yml * show management api in nav, update nav names --------- Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> Co-authored-by: Scott Anderson <scott@influxdata.com>
2024-04-09 23:02:12 +00:00
servers,
tagGroups,
}