mirror of
https://github.com/LukeHagar/developer.sailpoint.com.git
synced 2025-12-08 04:19:37 +00:00
adding versioning for nerm apis
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -50,6 +50,12 @@ yarn.lock
|
||||
!/docs/api/nerm/authentication.md
|
||||
!/docs/api/nerm/pagination-metadata-filtering.md
|
||||
!/docs/api/nerm/getting-started.md
|
||||
!/docs/api/nerm/v1/authentication.md
|
||||
!/docs/api/nerm/v1/pagination-metadata-filtering.md
|
||||
!/docs/api/nerm/v1/getting-started.md
|
||||
!/docs/api/nerm/v2025/authentication.md
|
||||
!/docs/api/nerm/v2025/pagination-metadata-filtering.md
|
||||
!/docs/api/nerm/v2025/getting-started.md
|
||||
|
||||
|
||||
!/docs/api/beta/getting-started.md
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
"clean-api-docs": "docusaurus clean-api-docs",
|
||||
"gen-api-docs:version": "docusaurus gen-api-docs:version",
|
||||
"clean-api-docs:version": "docusaurus clean-api-docs:version",
|
||||
"gen-api-docs-all": "npm run merge-all-code-examples && npm run gen-all-api-specs-code-examples && docusaurus gen-api-docs:version isc_versioned:all --plugin-id isc-api && docusaurus gen-api-docs isc_versioned --plugin-id isc-api && docusaurus gen-api-docs iiq --plugin-id iiq-api && docusaurus gen-api-docs nerm --plugin-id nerm-api",
|
||||
"clean-api-docs-all": "docusaurus clean-api-docs isc_versioned --plugin-id isc-api && docusaurus clean-api-docs:version isc_versioned:all --plugin-id isc-api && docusaurus clean-api-docs iiq --plugin-id iiq-api && docusaurus clean-api-docs nerm --plugin-id nerm-api",
|
||||
"gen-api-docs-all": "npm run merge-all-code-examples && npm run gen-all-api-specs-code-examples && docusaurus gen-api-docs:version isc_versioned:all --plugin-id isc-api && docusaurus gen-api-docs isc_versioned --plugin-id isc-api && docusaurus gen-api-docs iiq --plugin-id iiq-api && docusaurus gen-api-docs:version nerm_versioned:all --plugin-id nerm-api && docusaurus gen-api-docs nerm_versioned --plugin-id nerm-api",
|
||||
"clean-api-docs-all": "docusaurus clean-api-docs isc_versioned --plugin-id isc-api && docusaurus clean-api-docs:version isc_versioned:all --plugin-id isc-api && docusaurus clean-api-docs iiq --plugin-id iiq-api docusaurus clean-api-docs nerm_versioned --plugin-id nerm-api && docusaurus clean-api-docs:version nerm_versioned:all --plugin-id nerm-api && ",
|
||||
"rebuild-docs": "npm run clean-api-docs-all && npm run gen-api-docs-all",
|
||||
"beta-merge-code-examples": "node src/components/mergeoverlayfiles.js static/code-examples/beta/python_code_examples_overlay.yaml static/code-examples/beta/powershell_code_examples_overlay.yaml static/code-examples/beta/go_code_examples_overlay.yaml",
|
||||
"speecy-beta-spec": "speccy resolve --quiet static/api-specs/idn/sailpoint-api.beta.yaml -o static/code-examples/beta/beta.yaml",
|
||||
@@ -39,7 +39,8 @@
|
||||
"sentence-case-v3": "node src/components/updateSpecsSentenceCase.js static/code-examples/v3/v3.yaml",
|
||||
"sentence-case-v2024": "node src/components/updateSpecsSentenceCase.js static/code-examples/v2024/v2024.yaml",
|
||||
"sentence-case-v2025": "node src/components/updateSpecsSentenceCase.js static/code-examples/v2025/v2025.yaml",
|
||||
"sentence-case-all": "npm run sentence-case-beta && npm run sentence-case-v3 && npm run sentence-case-v2024 && npm run sentence-case-v2025"
|
||||
"sentence-case-all": "npm run sentence-case-beta && npm run sentence-case-v3 && npm run sentence-case-v2024 && npm run sentence-case-v2025",
|
||||
"version-nerm": "docusaurus gen-api-docs:version nerm_versioned:all --plugin-id nerm-api && docusaurus gen-api-docs nerm_versioned --plugin-id nerm-api"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/faster": "3.8.1",
|
||||
|
||||
68
plugins.ts
68
plugins.ts
@@ -1,5 +1,5 @@
|
||||
const {createApiPageMD} = require('./createApiPageMD');
|
||||
import clsx from "clsx";
|
||||
import clsx from 'clsx';
|
||||
|
||||
const pluginConfig = [
|
||||
[
|
||||
@@ -89,34 +89,35 @@ const pluginConfig = [
|
||||
groupPathsBy: 'tag',
|
||||
categoryLinkSource: 'tag',
|
||||
sidebarGenerators: {
|
||||
createDocItem(
|
||||
item,
|
||||
{ sidebarOptions: { customProps }, basePath }
|
||||
) {
|
||||
createDocItem(item, {sidebarOptions: {customProps}, basePath}) {
|
||||
const sidebar_label = item.frontMatter.sidebar_label;
|
||||
const title = item.title;
|
||||
const id =
|
||||
item.type === "schema" ? `schemas/${item.id}` : item.id;
|
||||
item.type === 'schema' ? `schemas/${item.id}` : item.id;
|
||||
const className =
|
||||
item.type === "api"
|
||||
item.type === 'api'
|
||||
? clsx(
|
||||
{
|
||||
"menu__list-item--deprecated": item.api.deprecated,
|
||||
"menu__list-item--experimental": !!item.api.parameters?.find(header => header.name === 'X-SailPoint-Experimental'), // checks for existence of extension and adds "experimental" class
|
||||
"api-method": !!item.api.method,
|
||||
'menu__list-item--deprecated': item.api.deprecated,
|
||||
'menu__list-item--experimental':
|
||||
!!item.api.parameters?.find(
|
||||
(header) =>
|
||||
header.name === 'X-SailPoint-Experimental',
|
||||
), // checks for existence of extension and adds "experimental" class
|
||||
'api-method': !!item.api.method,
|
||||
},
|
||||
item.api.method
|
||||
item.api.method,
|
||||
)
|
||||
: clsx(
|
||||
{
|
||||
"menu__list-item--deprecated": item.schema.deprecated,
|
||||
'menu__list-item--deprecated': item.schema.deprecated,
|
||||
},
|
||||
"schema"
|
||||
'schema',
|
||||
);
|
||||
return {
|
||||
type: "doc" as const,
|
||||
type: 'doc' as const,
|
||||
id:
|
||||
basePath === "" || undefined
|
||||
basePath === '' || undefined
|
||||
? `${id}`
|
||||
: `${basePath}/${id}`,
|
||||
label: (sidebar_label as string) ?? title ?? id,
|
||||
@@ -124,10 +125,12 @@ const pluginConfig = [
|
||||
className: className ? className : undefined,
|
||||
};
|
||||
},
|
||||
}},
|
||||
},
|
||||
},
|
||||
version: 'v2025',
|
||||
label: 'v2025',
|
||||
downloadUrl: 'https://raw.githubusercontent.com/sailpoint-oss/api-specs/refs/heads/main/dereferenced/deref-sailpoint-api.v2025.yaml',
|
||||
downloadUrl:
|
||||
'https://raw.githubusercontent.com/sailpoint-oss/api-specs/refs/heads/main/dereferenced/deref-sailpoint-api.v2025.yaml',
|
||||
baseUrl: '/docs/api/v2025',
|
||||
template: 'api.mustache',
|
||||
markdownGenerators: {
|
||||
@@ -137,21 +140,24 @@ const pluginConfig = [
|
||||
v2024: {
|
||||
specPath: 'static/code-examples/v2024/v2024.yaml',
|
||||
outputDir: 'docs/api/v2024',
|
||||
downloadUrl: 'https://raw.githubusercontent.com/sailpoint-oss/api-specs/main/dereferenced/deref-sailpoint-api.v2024.yaml',
|
||||
downloadUrl:
|
||||
'https://raw.githubusercontent.com/sailpoint-oss/api-specs/main/dereferenced/deref-sailpoint-api.v2024.yaml',
|
||||
label: 'v2024',
|
||||
baseUrl: '/docs/api/v2024',
|
||||
},
|
||||
v3: {
|
||||
specPath: 'static/code-examples/v3/v3.yaml',
|
||||
outputDir: 'docs/api/v3',
|
||||
downloadUrl: 'https://raw.githubusercontent.com/sailpoint-oss/api-specs/main/dereferenced/deref-sailpoint-api.v3.yaml',
|
||||
downloadUrl:
|
||||
'https://raw.githubusercontent.com/sailpoint-oss/api-specs/main/dereferenced/deref-sailpoint-api.v3.yaml',
|
||||
label: 'v3',
|
||||
baseUrl: '/docs/api/v3',
|
||||
},
|
||||
beta: {
|
||||
specPath: 'static/code-examples/beta/beta.yaml',
|
||||
outputDir: 'docs/api/beta',
|
||||
downloadUrl: 'https://raw.githubusercontent.com/sailpoint-oss/api-specs/main/dereferenced/deref-sailpoint-api.beta.yaml',
|
||||
downloadUrl:
|
||||
'https://raw.githubusercontent.com/sailpoint-oss/api-specs/main/dereferenced/deref-sailpoint-api.beta.yaml',
|
||||
label: 'Beta',
|
||||
baseUrl: '/docs/api/beta',
|
||||
},
|
||||
@@ -186,21 +192,33 @@ const pluginConfig = [
|
||||
id: 'nerm-api',
|
||||
docsPluginId: 'nerm',
|
||||
config: {
|
||||
nerm: {
|
||||
specPath: 'static/api-specs/nerm/openapi.yaml',
|
||||
outputDir: 'docs/api/nerm/v1',
|
||||
nerm_versioned: {
|
||||
version: 'v2025', // The default version shown
|
||||
label: 'v2025',
|
||||
specPath: 'static/api-specs/nerm/v2025/v2025.yaml',
|
||||
outputDir: 'docs/api/nerm/v2025',
|
||||
downloadUrl:
|
||||
'https://raw.githubusercontent.com/sailpoint-oss/api-specs/main/dereferenced/deref-sailpoint-api.nerm.yaml',
|
||||
'https://raw.githubusercontent.com/sailpoint-oss/api-specs/main/dereferenced/deref-sailpoint-api.nerm.v2025.yaml',
|
||||
baseUrl: '/docs/api/nerm/v2025',
|
||||
sidebarOptions: {
|
||||
groupPathsBy: 'tag',
|
||||
categoryLinkSource: 'tag',
|
||||
},
|
||||
template: 'api.mustache',
|
||||
versions: {
|
||||
v1: {
|
||||
label: 'v1',
|
||||
specPath: 'static/api-specs/nerm/openapi.yaml',
|
||||
outputDir: 'docs/api/nerm/v1',
|
||||
baseUrl: '/docs/api/nerm/v1',
|
||||
downloadUrl:
|
||||
'https://raw.githubusercontent.com/sailpoint-oss/api-specs/main/dereferenced/deref-sailpoint-api.nerm.v1.yaml',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
export default pluginConfig;
|
||||
|
||||
103
sidebars.ts
103
sidebars.ts
@@ -12,46 +12,50 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
|
||||
|
||||
Create as many sidebars as you want.
|
||||
*/
|
||||
import { versionSelector, versionCrumb } from 'docusaurus-plugin-openapi-docs/lib/sidebars/utils';
|
||||
import versions from './docs/api/v2025/versions.json';
|
||||
import {
|
||||
versionSelector,
|
||||
versionCrumb,
|
||||
} from 'docusaurus-plugin-openapi-docs/lib/sidebars/utils';
|
||||
import versions from './docs/api/v2025/versions.json';
|
||||
import nermVersions from './docs/api/nerm/v2025/versions.json';
|
||||
|
||||
const sidebars: SidebarsConfig = {
|
||||
const sidebars: SidebarsConfig = {
|
||||
openApiSidebar: [
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Documentation',
|
||||
collapsible: false,
|
||||
link: { type: 'doc', id: 'docs' },
|
||||
link: {type: 'doc', id: 'docs'},
|
||||
items: [
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Extensibility',
|
||||
link: { type: 'doc', id: 'extensibility' },
|
||||
items: [{ type: 'autogenerated', dirName: 'extensibility' }],
|
||||
link: {type: 'doc', id: 'extensibility'},
|
||||
items: [{type: 'autogenerated', dirName: 'extensibility'}],
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Connectivity',
|
||||
link: { type: 'doc', id: 'connectivity' },
|
||||
items: [{ type: 'autogenerated', dirName: 'connectivity' }],
|
||||
link: {type: 'doc', id: 'connectivity'},
|
||||
items: [{type: 'autogenerated', dirName: 'connectivity'}],
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Tools',
|
||||
link: { type: 'doc', id: 'tools' },
|
||||
items: [{ type: 'autogenerated', dirName: 'tools' }],
|
||||
link: {type: 'doc', id: 'tools'},
|
||||
items: [{type: 'autogenerated', dirName: 'tools'}],
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Reporting',
|
||||
link: { type: 'doc', id: 'reporting' },
|
||||
items: [{ type: 'autogenerated', dirName: 'reporting' }],
|
||||
link: {type: 'doc', id: 'reporting'},
|
||||
items: [{type: 'autogenerated', dirName: 'reporting'}],
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Guides',
|
||||
link: { type: 'doc', id: 'guides' },
|
||||
items: [{ type: 'autogenerated', dirName: 'guides' }],
|
||||
link: {type: 'doc', id: 'guides'},
|
||||
items: [{type: 'autogenerated', dirName: 'guides'}],
|
||||
},
|
||||
{
|
||||
type: 'link',
|
||||
@@ -66,13 +70,15 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
|
||||
type: 'category',
|
||||
label: 'Documentation',
|
||||
collapsible: false,
|
||||
link: { type: 'doc', id: 'iiq' },
|
||||
link: {type: 'doc', id: 'iiq'},
|
||||
items: [
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Plugin Developer Guide',
|
||||
link: { type: 'doc', id: 'plugin-developer-guide' },
|
||||
items: [{ type: 'autogenerated', dirName: 'iiq/plugin-developer-guide' }],
|
||||
link: {type: 'doc', id: 'plugin-developer-guide'},
|
||||
items: [
|
||||
{type: 'autogenerated', dirName: 'iiq/plugin-developer-guide'},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'link',
|
||||
@@ -97,17 +103,55 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
|
||||
items: require('./docs/api/iiq/sidebar.ts'),
|
||||
},
|
||||
],
|
||||
nermSideBar: [
|
||||
nerm_2025_sidebar: [
|
||||
{
|
||||
type: 'html',
|
||||
defaultStyle: true,
|
||||
value: versionSelector(nermVersions),
|
||||
className: 'version-button',
|
||||
},
|
||||
{
|
||||
type: 'html',
|
||||
defaultStyle: true,
|
||||
value: versionCrumb(`v2025`),
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'NERM',
|
||||
collapsible: true,
|
||||
link: { type: 'doc', id: 'api/non-employee' },
|
||||
customProps: { description: 'NERM API specifications.' },
|
||||
items: [
|
||||
{ type: 'doc', id: 'api/nerm/getting-started' },
|
||||
{ type: 'doc', id: 'api/nerm/authentication' },
|
||||
{ type: 'doc', id: 'api/nerm/pagination-metadata-filtering' },
|
||||
label: 'NERM v2025 APIs',
|
||||
link: {
|
||||
type: 'generated-index',
|
||||
title: 'NERM v2025 APIs',
|
||||
description:
|
||||
'These are the Non-employee Risk Management APIs for SailPoint.',
|
||||
slug: '/api/nerm/v2025',
|
||||
},
|
||||
items: require('./docs/api/nerm/v2025/sidebar.ts'),
|
||||
},
|
||||
],
|
||||
nermSideBar: [
|
||||
{
|
||||
type: 'html',
|
||||
defaultStyle: true,
|
||||
value: versionSelector(nermVersions),
|
||||
className: 'version-button',
|
||||
},
|
||||
{
|
||||
type: 'html',
|
||||
defaultStyle: true,
|
||||
value: versionCrumb(`v1`), // or dynamically detect the current version
|
||||
},
|
||||
{
|
||||
type: 'doc',
|
||||
id: 'api/nerm/getting-started',
|
||||
},
|
||||
{
|
||||
type: 'doc',
|
||||
id: 'api/nerm/authentication',
|
||||
},
|
||||
{
|
||||
type: 'doc',
|
||||
id: 'api/nerm/pagination-metadata-filtering',
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'NERM v1 API',
|
||||
@@ -121,8 +165,6 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
|
||||
items: require('./docs/api/nerm/v1/sidebar.ts'),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
isc_2025_sidebar: [
|
||||
{
|
||||
type: 'html',
|
||||
@@ -351,7 +393,6 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
|
||||
items: require('./docs/api/v3/sidebar.ts'),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default sidebars;
|
||||
};
|
||||
|
||||
export default sidebars;
|
||||
|
||||
Reference in New Issue
Block a user