docusaurus-plugin-openapi-docs 0.0.0-736 → 0.0.0-738
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/markdown/createStatusCodes.js +1 -1
- package/lib/openapi/utils/utils/openapi.js +1 -1
- package/package.json +2 -2
- package/src/index.ts +67 -67
- package/src/markdown/createAuthentication.ts +8 -8
- package/src/markdown/createContactInfo.ts +2 -2
- package/src/markdown/createDeprecationNotice.ts +1 -1
- package/src/markdown/createLicense.ts +1 -1
- package/src/markdown/createLogo.ts +1 -1
- package/src/markdown/createParamsDetails.ts +1 -1
- package/src/markdown/createRequestSchema.ts +1 -1
- package/src/markdown/createResponseSchema.ts +1 -1
- package/src/markdown/createSchema.test.ts +2 -2
- package/src/markdown/createSchema.ts +32 -32
- package/src/markdown/createStatusCodes.ts +6 -6
- package/src/markdown/schema.ts +3 -3
- package/src/markdown/utils.ts +1 -1
- package/src/openapi/createRequestExample.ts +3 -6
- package/src/openapi/createResponseExample.ts +3 -6
- package/src/openapi/openapi.test.ts +3 -3
- package/src/openapi/openapi.ts +23 -23
- package/src/openapi/utils/loadAndResolveSpec.ts +3 -3
- package/src/openapi/utils/services/OpenAPIParser.ts +11 -11
- package/src/openapi/utils/services/RedocNormalizedOptions.ts +25 -25
- package/src/openapi/utils/utils/helpers.ts +5 -5
- package/src/openapi/utils/utils/openapi.ts +31 -31
- package/src/options.ts +2 -2
- package/src/sidebars/index.ts +16 -16
|
@@ -275,7 +275,7 @@ function createStatusCodes({ label, id, responses }) {
|
|
|
275
275
|
responseHeaders &&
|
|
276
276
|
(0, createDetails_1.createDetails)({
|
|
277
277
|
className: "openapi-markdown__details",
|
|
278
|
-
"data-
|
|
278
|
+
"data-collapsed": true,
|
|
279
279
|
open: false,
|
|
280
280
|
style: { textAlign: "left", marginBottom: "1rem" },
|
|
281
281
|
children: [
|
|
@@ -534,7 +534,7 @@ exports.setSecuritySchemePrefix = setSecuritySchemePrefix;
|
|
|
534
534
|
const shortenHTTPVerb = (verb) => ({
|
|
535
535
|
delete: "del",
|
|
536
536
|
options: "opts",
|
|
537
|
-
}
|
|
537
|
+
}[verb] || verb);
|
|
538
538
|
exports.shortenHTTPVerb = shortenHTTPVerb;
|
|
539
539
|
function isRedocExtension(key) {
|
|
540
540
|
const redocExtensions = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-plugin-openapi-docs",
|
|
3
3
|
"description": "OpenAPI plugin for Docusaurus.",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-738",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=14"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "4c48921ed3b574960f207d9f5ce8f9de6feab169"
|
|
64
64
|
}
|
package/src/index.ts
CHANGED
|
@@ -41,7 +41,7 @@ export function isURL(str: string): boolean {
|
|
|
41
41
|
export function getDocsPluginConfig(
|
|
42
42
|
presetsPlugins: any[],
|
|
43
43
|
plugin: string,
|
|
44
|
-
pluginId: string
|
|
44
|
+
pluginId: string
|
|
45
45
|
): Object | undefined {
|
|
46
46
|
// eslint-disable-next-line array-callback-return
|
|
47
47
|
const filteredConfig = presetsPlugins.filter((data) => {
|
|
@@ -90,7 +90,7 @@ function getPluginInstances(plugins: any[]): any {
|
|
|
90
90
|
|
|
91
91
|
export default function pluginOpenAPIDocs(
|
|
92
92
|
context: LoadContext,
|
|
93
|
-
options: PluginOptions
|
|
93
|
+
options: PluginOptions
|
|
94
94
|
): Plugin<LoadedContent> {
|
|
95
95
|
const {
|
|
96
96
|
config,
|
|
@@ -106,7 +106,7 @@ export default function pluginOpenAPIDocs(
|
|
|
106
106
|
let docData: any = getDocsPluginConfig(
|
|
107
107
|
presetsPlugins,
|
|
108
108
|
docsPlugin,
|
|
109
|
-
docsPluginId
|
|
109
|
+
docsPluginId
|
|
110
110
|
);
|
|
111
111
|
let docRouteBasePath = docData ? docData.routeBasePath : undefined;
|
|
112
112
|
let docPath = docData ? (docData.path ? docData.path : "docs") : undefined;
|
|
@@ -141,7 +141,7 @@ export default function pluginOpenAPIDocs(
|
|
|
141
141
|
const [loadedApi, tags, tagGroups] = await processOpenapiFiles(
|
|
142
142
|
openapiFiles,
|
|
143
143
|
options,
|
|
144
|
-
sidebarOptions
|
|
144
|
+
sidebarOptions!
|
|
145
145
|
);
|
|
146
146
|
if (!fs.existsSync(outputDir)) {
|
|
147
147
|
try {
|
|
@@ -150,7 +150,7 @@ export default function pluginOpenAPIDocs(
|
|
|
150
150
|
} catch (err) {
|
|
151
151
|
console.error(
|
|
152
152
|
chalk.red(`Failed to create "${outputDir}"`),
|
|
153
|
-
chalk.yellow(err)
|
|
153
|
+
chalk.yellow(err)
|
|
154
154
|
);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
@@ -163,7 +163,7 @@ export default function pluginOpenAPIDocs(
|
|
|
163
163
|
loadedApi,
|
|
164
164
|
tags,
|
|
165
165
|
docPath,
|
|
166
|
-
tagGroups
|
|
166
|
+
tagGroups
|
|
167
167
|
);
|
|
168
168
|
|
|
169
169
|
const sidebarSliceTemplate = `module.exports = {{{slice}}};`;
|
|
@@ -176,12 +176,12 @@ export default function pluginOpenAPIDocs(
|
|
|
176
176
|
try {
|
|
177
177
|
fs.writeFileSync(`${outputDir}/sidebar.js`, view, "utf8");
|
|
178
178
|
console.log(
|
|
179
|
-
chalk.green(`Successfully created "${outputDir}/sidebar.js"`)
|
|
179
|
+
chalk.green(`Successfully created "${outputDir}/sidebar.js"`)
|
|
180
180
|
);
|
|
181
181
|
} catch (err) {
|
|
182
182
|
console.error(
|
|
183
183
|
chalk.red(`Failed to write "${outputDir}/sidebar.js"`),
|
|
184
|
-
chalk.yellow(err)
|
|
184
|
+
chalk.yellow(err)
|
|
185
185
|
);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
@@ -295,7 +295,7 @@ custom_edit_url: null
|
|
|
295
295
|
info: InfoPageMetadata;
|
|
296
296
|
tag: TagPageMetadata;
|
|
297
297
|
schema: SchemaPageMetadata;
|
|
298
|
-
}[key]
|
|
298
|
+
}[key]
|
|
299
299
|
) => string;
|
|
300
300
|
} = {
|
|
301
301
|
api: apiPageGenerator,
|
|
@@ -345,19 +345,19 @@ custom_edit_url: null
|
|
|
345
345
|
// kebabCase(arg) returns 0-length string when arg is undefined
|
|
346
346
|
if (item.id.length === 0) {
|
|
347
347
|
throw Error(
|
|
348
|
-
"Operation must have summary or operationId defined"
|
|
348
|
+
"Operation must have summary or operationId defined"
|
|
349
349
|
);
|
|
350
350
|
}
|
|
351
351
|
fs.writeFileSync(`${outputDir}/${item.id}.api.mdx`, view, "utf8");
|
|
352
352
|
console.log(
|
|
353
353
|
chalk.green(
|
|
354
|
-
`Successfully created "${outputDir}/${item.id}.api.mdx"
|
|
355
|
-
)
|
|
354
|
+
`Successfully created "${outputDir}/${item.id}.api.mdx"`
|
|
355
|
+
)
|
|
356
356
|
);
|
|
357
357
|
} catch (err) {
|
|
358
358
|
console.error(
|
|
359
359
|
chalk.red(`Failed to write "${outputDir}/${item.id}.api.mdx"`),
|
|
360
|
-
chalk.yellow(err)
|
|
360
|
+
chalk.yellow(err)
|
|
361
361
|
);
|
|
362
362
|
}
|
|
363
363
|
}
|
|
@@ -371,22 +371,22 @@ custom_edit_url: null
|
|
|
371
371
|
? fs.writeFileSync(
|
|
372
372
|
`${outputDir}/${item.id}.info.mdx`,
|
|
373
373
|
utils,
|
|
374
|
-
"utf8"
|
|
374
|
+
"utf8"
|
|
375
375
|
)
|
|
376
376
|
: fs.writeFileSync(
|
|
377
377
|
`${outputDir}/${item.id}.info.mdx`,
|
|
378
378
|
view,
|
|
379
|
-
"utf8"
|
|
379
|
+
"utf8"
|
|
380
380
|
);
|
|
381
381
|
console.log(
|
|
382
382
|
chalk.green(
|
|
383
|
-
`Successfully created "${outputDir}/${item.id}.info.mdx"
|
|
384
|
-
)
|
|
383
|
+
`Successfully created "${outputDir}/${item.id}.info.mdx"`
|
|
384
|
+
)
|
|
385
385
|
);
|
|
386
386
|
} catch (err) {
|
|
387
387
|
console.error(
|
|
388
388
|
chalk.red(`Failed to write "${outputDir}/${item.id}.info.mdx"`),
|
|
389
|
-
chalk.yellow(err)
|
|
389
|
+
chalk.yellow(err)
|
|
390
390
|
);
|
|
391
391
|
}
|
|
392
392
|
}
|
|
@@ -398,17 +398,17 @@ custom_edit_url: null
|
|
|
398
398
|
fs.writeFileSync(
|
|
399
399
|
`${outputDir}/${item.id}.tag.mdx`,
|
|
400
400
|
tagUtils,
|
|
401
|
-
"utf8"
|
|
401
|
+
"utf8"
|
|
402
402
|
);
|
|
403
403
|
console.log(
|
|
404
404
|
chalk.green(
|
|
405
|
-
`Successfully created "${outputDir}/${item.id}.tag.mdx"
|
|
406
|
-
)
|
|
405
|
+
`Successfully created "${outputDir}/${item.id}.tag.mdx"`
|
|
406
|
+
)
|
|
407
407
|
);
|
|
408
408
|
} catch (err) {
|
|
409
409
|
console.error(
|
|
410
410
|
chalk.red(`Failed to write "${outputDir}/${item.id}.tag.mdx"`),
|
|
411
|
-
chalk.yellow(err)
|
|
411
|
+
chalk.yellow(err)
|
|
412
412
|
);
|
|
413
413
|
}
|
|
414
414
|
}
|
|
@@ -420,12 +420,12 @@ custom_edit_url: null
|
|
|
420
420
|
try {
|
|
421
421
|
fs.mkdirSync(`${outputDir}/schemas`, { recursive: true });
|
|
422
422
|
console.log(
|
|
423
|
-
chalk.green(`Successfully created "${outputDir}/schemas"`)
|
|
423
|
+
chalk.green(`Successfully created "${outputDir}/schemas"`)
|
|
424
424
|
);
|
|
425
425
|
} catch (err) {
|
|
426
426
|
console.error(
|
|
427
427
|
chalk.red(`Failed to create "${outputDir}/schemas"`),
|
|
428
|
-
chalk.yellow(err)
|
|
428
|
+
chalk.yellow(err)
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
431
|
}
|
|
@@ -439,19 +439,19 @@ custom_edit_url: null
|
|
|
439
439
|
fs.writeFileSync(
|
|
440
440
|
`${outputDir}/schemas/${item.id}.schema.mdx`,
|
|
441
441
|
schemaView,
|
|
442
|
-
"utf8"
|
|
442
|
+
"utf8"
|
|
443
443
|
);
|
|
444
444
|
console.log(
|
|
445
445
|
chalk.green(
|
|
446
|
-
`Successfully created "${outputDir}/${item.id}.schema.mdx"
|
|
447
|
-
)
|
|
446
|
+
`Successfully created "${outputDir}/${item.id}.schema.mdx"`
|
|
447
|
+
)
|
|
448
448
|
);
|
|
449
449
|
} catch (err) {
|
|
450
450
|
console.error(
|
|
451
451
|
chalk.red(
|
|
452
|
-
`Failed to write "${outputDir}/${item.id}.schema.mdx"
|
|
452
|
+
`Failed to write "${outputDir}/${item.id}.schema.mdx"`
|
|
453
453
|
),
|
|
454
|
-
chalk.yellow(err)
|
|
454
|
+
chalk.yellow(err)
|
|
455
455
|
);
|
|
456
456
|
}
|
|
457
457
|
}
|
|
@@ -486,12 +486,12 @@ custom_edit_url: null
|
|
|
486
486
|
if (err) {
|
|
487
487
|
console.error(
|
|
488
488
|
chalk.red(`Cleanup failed for "${apiDir}/${mdx}"`),
|
|
489
|
-
chalk.yellow(err)
|
|
489
|
+
chalk.yellow(err)
|
|
490
490
|
);
|
|
491
491
|
} else {
|
|
492
492
|
console.log(chalk.green(`Cleanup succeeded for "${apiDir}/${mdx}"`));
|
|
493
493
|
}
|
|
494
|
-
})
|
|
494
|
+
})
|
|
495
495
|
);
|
|
496
496
|
|
|
497
497
|
schemaMdxFiles.map((mdx) =>
|
|
@@ -499,14 +499,14 @@ custom_edit_url: null
|
|
|
499
499
|
if (err) {
|
|
500
500
|
console.error(
|
|
501
501
|
chalk.red(`Cleanup failed for "${apiDir}/schemas/${mdx}"`),
|
|
502
|
-
chalk.yellow(err)
|
|
502
|
+
chalk.yellow(err)
|
|
503
503
|
);
|
|
504
504
|
} else {
|
|
505
505
|
console.log(
|
|
506
|
-
chalk.green(`Cleanup succeeded for "${apiDir}/schemas/${mdx}"`)
|
|
506
|
+
chalk.green(`Cleanup succeeded for "${apiDir}/schemas/${mdx}"`)
|
|
507
507
|
);
|
|
508
508
|
}
|
|
509
|
-
})
|
|
509
|
+
})
|
|
510
510
|
);
|
|
511
511
|
|
|
512
512
|
sidebarFile.map((sidebar) =>
|
|
@@ -514,14 +514,14 @@ custom_edit_url: null
|
|
|
514
514
|
if (err) {
|
|
515
515
|
console.error(
|
|
516
516
|
chalk.red(`Cleanup failed for "${apiDir}/${sidebar}"`),
|
|
517
|
-
chalk.yellow(err)
|
|
517
|
+
chalk.yellow(err)
|
|
518
518
|
);
|
|
519
519
|
} else {
|
|
520
520
|
console.log(
|
|
521
|
-
chalk.green(`Cleanup succeeded for "${apiDir}/${sidebar}"`)
|
|
521
|
+
chalk.green(`Cleanup succeeded for "${apiDir}/${sidebar}"`)
|
|
522
522
|
);
|
|
523
523
|
}
|
|
524
|
-
})
|
|
524
|
+
})
|
|
525
525
|
);
|
|
526
526
|
}
|
|
527
527
|
|
|
@@ -540,12 +540,12 @@ custom_edit_url: null
|
|
|
540
540
|
try {
|
|
541
541
|
fs.writeFileSync(`${outputDir}/versions.json`, versionsJson, "utf8");
|
|
542
542
|
console.log(
|
|
543
|
-
chalk.green(`Successfully created "${outputDir}/versions.json"`)
|
|
543
|
+
chalk.green(`Successfully created "${outputDir}/versions.json"`)
|
|
544
544
|
);
|
|
545
545
|
} catch (err) {
|
|
546
546
|
console.error(
|
|
547
547
|
chalk.red(`Failed to write "${outputDir}/versions.json"`),
|
|
548
|
-
chalk.yellow(err)
|
|
548
|
+
chalk.yellow(err)
|
|
549
549
|
);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
@@ -556,11 +556,11 @@ custom_edit_url: null
|
|
|
556
556
|
if (err) {
|
|
557
557
|
console.error(
|
|
558
558
|
chalk.red(`Cleanup failed for "${outputDir}/versions.json"`),
|
|
559
|
-
chalk.yellow(err)
|
|
559
|
+
chalk.yellow(err)
|
|
560
560
|
);
|
|
561
561
|
} else {
|
|
562
562
|
console.log(
|
|
563
|
-
chalk.green(`Cleanup succeeded for "${outputDir}/versions.json"`)
|
|
563
|
+
chalk.green(`Cleanup succeeded for "${outputDir}/versions.json"`)
|
|
564
564
|
);
|
|
565
565
|
}
|
|
566
566
|
});
|
|
@@ -574,7 +574,7 @@ custom_edit_url: null
|
|
|
574
574
|
cli
|
|
575
575
|
.command(`gen-api-docs`)
|
|
576
576
|
.description(
|
|
577
|
-
`Generates OpenAPI docs in MDX file format and sidebar.js (if enabled)
|
|
577
|
+
`Generates OpenAPI docs in MDX file format and sidebar.js (if enabled).`
|
|
578
578
|
)
|
|
579
579
|
.usage("<id>")
|
|
580
580
|
.arguments("<id>")
|
|
@@ -592,7 +592,7 @@ custom_edit_url: null
|
|
|
592
592
|
targetDocsPluginId = pluginConfig.docsPluginId;
|
|
593
593
|
} catch {
|
|
594
594
|
console.error(
|
|
595
|
-
chalk.red(`OpenAPI docs plugin ID '${pluginId}' not found.`)
|
|
595
|
+
chalk.red(`OpenAPI docs plugin ID '${pluginId}' not found.`)
|
|
596
596
|
);
|
|
597
597
|
return;
|
|
598
598
|
}
|
|
@@ -600,8 +600,8 @@ custom_edit_url: null
|
|
|
600
600
|
if (pluginInstances.length > 1) {
|
|
601
601
|
console.error(
|
|
602
602
|
chalk.red(
|
|
603
|
-
"OpenAPI docs plugin ID must be specified when more than one plugin instance exists."
|
|
604
|
-
)
|
|
603
|
+
"OpenAPI docs plugin ID must be specified when more than one plugin instance exists."
|
|
604
|
+
)
|
|
605
605
|
);
|
|
606
606
|
return;
|
|
607
607
|
}
|
|
@@ -612,8 +612,8 @@ custom_edit_url: null
|
|
|
612
612
|
if (targetConfig[id]) {
|
|
613
613
|
console.error(
|
|
614
614
|
chalk.red(
|
|
615
|
-
"Can't use id 'all' for OpenAPI docs configuration key."
|
|
616
|
-
)
|
|
615
|
+
"Can't use id 'all' for OpenAPI docs configuration key."
|
|
616
|
+
)
|
|
617
617
|
);
|
|
618
618
|
} else {
|
|
619
619
|
Object.keys(targetConfig).forEach(async function (key) {
|
|
@@ -622,7 +622,7 @@ custom_edit_url: null
|
|
|
622
622
|
}
|
|
623
623
|
} else if (!targetConfig[id]) {
|
|
624
624
|
console.error(
|
|
625
|
-
chalk.red(`ID '${id}' does not exist in OpenAPI docs config.`)
|
|
625
|
+
chalk.red(`ID '${id}' does not exist in OpenAPI docs config.`)
|
|
626
626
|
);
|
|
627
627
|
} else {
|
|
628
628
|
await generateApiDocs(targetConfig[id], targetDocsPluginId);
|
|
@@ -632,7 +632,7 @@ custom_edit_url: null
|
|
|
632
632
|
cli
|
|
633
633
|
.command(`gen-api-docs:version`)
|
|
634
634
|
.description(
|
|
635
|
-
`Generates versioned OpenAPI docs in MDX file format, versions.js and sidebar.js (if enabled)
|
|
635
|
+
`Generates versioned OpenAPI docs in MDX file format, versions.js and sidebar.js (if enabled).`
|
|
636
636
|
)
|
|
637
637
|
.usage("<id:version>")
|
|
638
638
|
.arguments("<id:version>")
|
|
@@ -650,7 +650,7 @@ custom_edit_url: null
|
|
|
650
650
|
targetDocsPluginId = pluginConfig.docsPluginId;
|
|
651
651
|
} catch {
|
|
652
652
|
console.error(
|
|
653
|
-
chalk.red(`OpenAPI docs plugin ID '${pluginId}' not found.`)
|
|
653
|
+
chalk.red(`OpenAPI docs plugin ID '${pluginId}' not found.`)
|
|
654
654
|
);
|
|
655
655
|
return;
|
|
656
656
|
}
|
|
@@ -658,8 +658,8 @@ custom_edit_url: null
|
|
|
658
658
|
if (pluginInstances.length > 1) {
|
|
659
659
|
console.error(
|
|
660
660
|
chalk.red(
|
|
661
|
-
"OpenAPI docs plugin ID must be specified when more than one plugin instance exists."
|
|
662
|
-
)
|
|
661
|
+
"OpenAPI docs plugin ID must be specified when more than one plugin instance exists."
|
|
662
|
+
)
|
|
663
663
|
);
|
|
664
664
|
return;
|
|
665
665
|
}
|
|
@@ -690,8 +690,8 @@ custom_edit_url: null
|
|
|
690
690
|
if (versions[id]) {
|
|
691
691
|
console.error(
|
|
692
692
|
chalk.red(
|
|
693
|
-
"Can't use id 'all' for OpenAPI docs versions configuration key."
|
|
694
|
-
)
|
|
693
|
+
"Can't use id 'all' for OpenAPI docs versions configuration key."
|
|
694
|
+
)
|
|
695
695
|
);
|
|
696
696
|
} else {
|
|
697
697
|
await generateVersions(mergedVersions, parentConfig.outputDir);
|
|
@@ -707,8 +707,8 @@ custom_edit_url: null
|
|
|
707
707
|
} else if (!versions[versionId]) {
|
|
708
708
|
console.error(
|
|
709
709
|
chalk.red(
|
|
710
|
-
`Version ID '${versionId}' does not exist in OpenAPI docs versions config
|
|
711
|
-
)
|
|
710
|
+
`Version ID '${versionId}' does not exist in OpenAPI docs versions config.`
|
|
711
|
+
)
|
|
712
712
|
);
|
|
713
713
|
} else {
|
|
714
714
|
const versionConfig = versions[versionId];
|
|
@@ -724,7 +724,7 @@ custom_edit_url: null
|
|
|
724
724
|
cli
|
|
725
725
|
.command(`clean-api-docs`)
|
|
726
726
|
.description(
|
|
727
|
-
`Clears the generated OpenAPI docs MDX files and sidebar.js (if enabled)
|
|
727
|
+
`Clears the generated OpenAPI docs MDX files and sidebar.js (if enabled).`
|
|
728
728
|
)
|
|
729
729
|
.usage("<id>")
|
|
730
730
|
.arguments("<id>")
|
|
@@ -740,7 +740,7 @@ custom_edit_url: null
|
|
|
740
740
|
targetConfig = pluginConfig.config ?? {};
|
|
741
741
|
} catch {
|
|
742
742
|
console.error(
|
|
743
|
-
chalk.red(`OpenAPI docs plugin ID '${pluginId}' not found.`)
|
|
743
|
+
chalk.red(`OpenAPI docs plugin ID '${pluginId}' not found.`)
|
|
744
744
|
);
|
|
745
745
|
return;
|
|
746
746
|
}
|
|
@@ -748,8 +748,8 @@ custom_edit_url: null
|
|
|
748
748
|
if (pluginInstances.length > 1) {
|
|
749
749
|
console.error(
|
|
750
750
|
chalk.red(
|
|
751
|
-
"OpenAPI docs plugin ID must be specified when more than one plugin instance exists."
|
|
752
|
-
)
|
|
751
|
+
"OpenAPI docs plugin ID must be specified when more than one plugin instance exists."
|
|
752
|
+
)
|
|
753
753
|
);
|
|
754
754
|
return;
|
|
755
755
|
}
|
|
@@ -759,8 +759,8 @@ custom_edit_url: null
|
|
|
759
759
|
if (targetConfig[id]) {
|
|
760
760
|
console.error(
|
|
761
761
|
chalk.red(
|
|
762
|
-
"Can't use id 'all' for OpenAPI docs configuration key."
|
|
763
|
-
)
|
|
762
|
+
"Can't use id 'all' for OpenAPI docs configuration key."
|
|
763
|
+
)
|
|
764
764
|
);
|
|
765
765
|
} else {
|
|
766
766
|
Object.keys(targetConfig).forEach(async function (key) {
|
|
@@ -775,7 +775,7 @@ custom_edit_url: null
|
|
|
775
775
|
cli
|
|
776
776
|
.command(`clean-api-docs:version`)
|
|
777
777
|
.description(
|
|
778
|
-
`Clears the versioned, generated OpenAPI docs MDX files, versions.json and sidebar.js (if enabled)
|
|
778
|
+
`Clears the versioned, generated OpenAPI docs MDX files, versions.json and sidebar.js (if enabled).`
|
|
779
779
|
)
|
|
780
780
|
.usage("<id:version>")
|
|
781
781
|
.arguments("<id:version>")
|
|
@@ -791,7 +791,7 @@ custom_edit_url: null
|
|
|
791
791
|
targetConfig = pluginConfig.config ?? {};
|
|
792
792
|
} catch {
|
|
793
793
|
console.error(
|
|
794
|
-
chalk.red(`OpenAPI docs plugin ID '${pluginId}' not found.`)
|
|
794
|
+
chalk.red(`OpenAPI docs plugin ID '${pluginId}' not found.`)
|
|
795
795
|
);
|
|
796
796
|
return;
|
|
797
797
|
}
|
|
@@ -799,8 +799,8 @@ custom_edit_url: null
|
|
|
799
799
|
if (pluginInstances.length > 1) {
|
|
800
800
|
console.error(
|
|
801
801
|
chalk.red(
|
|
802
|
-
"OpenAPI docs plugin ID must be specified when more than one plugin instance exists."
|
|
803
|
-
)
|
|
802
|
+
"OpenAPI docs plugin ID must be specified when more than one plugin instance exists."
|
|
803
|
+
)
|
|
804
804
|
);
|
|
805
805
|
return;
|
|
806
806
|
}
|
|
@@ -815,7 +815,7 @@ custom_edit_url: null
|
|
|
815
815
|
if (versionId === "all") {
|
|
816
816
|
if (versions[id]) {
|
|
817
817
|
chalk.red(
|
|
818
|
-
"Can't use id 'all' for OpenAPI docs versions configuration key."
|
|
818
|
+
"Can't use id 'all' for OpenAPI docs versions configuration key."
|
|
819
819
|
);
|
|
820
820
|
} else {
|
|
821
821
|
await cleanVersions(parentConfig.outputDir);
|
|
@@ -35,20 +35,20 @@ export function createAuthentication(securitySchemes: SecuritySchemeObject) {
|
|
|
35
35
|
create("td", {
|
|
36
36
|
children: [
|
|
37
37
|
guard(tokenUrl, () =>
|
|
38
|
-
create("p", { children: `Token URL: ${tokenUrl}` })
|
|
38
|
+
create("p", { children: `Token URL: ${tokenUrl}` })
|
|
39
39
|
),
|
|
40
40
|
guard(authorizationUrl, () =>
|
|
41
41
|
create("p", {
|
|
42
42
|
children: `Authorization URL: ${authorizationUrl}`,
|
|
43
|
-
})
|
|
43
|
+
})
|
|
44
44
|
),
|
|
45
45
|
guard(refreshUrl, () =>
|
|
46
|
-
create("p", { children: `Refresh URL: ${refreshUrl}` })
|
|
46
|
+
create("p", { children: `Refresh URL: ${refreshUrl}` })
|
|
47
47
|
),
|
|
48
48
|
create("span", { children: "Scopes:" }),
|
|
49
49
|
create("ul", {
|
|
50
50
|
children: Object.entries(scopes).map(([scope, description]) =>
|
|
51
|
-
create("li", { children: `${scope}: ${description}` })
|
|
51
|
+
create("li", { children: `${scope}: ${description}` })
|
|
52
52
|
),
|
|
53
53
|
}),
|
|
54
54
|
],
|
|
@@ -98,7 +98,7 @@ export function createAuthentication(securitySchemes: SecuritySchemeObject) {
|
|
|
98
98
|
create("th", { children: "Bearer format:" }),
|
|
99
99
|
create("td", { children: bearerFormat }),
|
|
100
100
|
],
|
|
101
|
-
})
|
|
101
|
+
})
|
|
102
102
|
),
|
|
103
103
|
],
|
|
104
104
|
}),
|
|
@@ -131,7 +131,7 @@ export function createAuthentication(securitySchemes: SecuritySchemeObject) {
|
|
|
131
131
|
create("th", { children: "OpenID Connect URL:" }),
|
|
132
132
|
create("td", { children: openIdConnectUrl }),
|
|
133
133
|
],
|
|
134
|
-
})
|
|
134
|
+
})
|
|
135
135
|
),
|
|
136
136
|
],
|
|
137
137
|
}),
|
|
@@ -180,14 +180,14 @@ export function createAuthentication(securitySchemes: SecuritySchemeObject) {
|
|
|
180
180
|
label: formatTabLabel(
|
|
181
181
|
schemeKey,
|
|
182
182
|
schemeObj.type,
|
|
183
|
-
schemeObj.scheme
|
|
183
|
+
schemeObj.scheme
|
|
184
184
|
),
|
|
185
185
|
value: `${schemeKey}`,
|
|
186
186
|
children: [
|
|
187
187
|
createDescription(schemeObj.description),
|
|
188
188
|
createAuthenticationTable(schemeObj),
|
|
189
189
|
],
|
|
190
|
-
})
|
|
190
|
+
})
|
|
191
191
|
),
|
|
192
192
|
}),
|
|
193
193
|
],
|
|
@@ -32,7 +32,7 @@ export function createContactInfo(contact: ContactObject) {
|
|
|
32
32
|
create("a", {
|
|
33
33
|
href: `mailto:${email}`,
|
|
34
34
|
children: `${email}`,
|
|
35
|
-
})
|
|
35
|
+
})
|
|
36
36
|
),
|
|
37
37
|
],
|
|
38
38
|
}),
|
|
@@ -45,7 +45,7 @@ export function createContactInfo(contact: ContactObject) {
|
|
|
45
45
|
children: `${url}`,
|
|
46
46
|
}),
|
|
47
47
|
],
|
|
48
|
-
})
|
|
48
|
+
})
|
|
49
49
|
),
|
|
50
50
|
],
|
|
51
51
|
});
|