docusaurus-plugin-openapi-docs 0.0.0-346 → 0.0.0-348

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.
Files changed (54) hide show
  1. package/package.json +2 -2
  2. package/lib/index.d.ts +0 -3
  3. package/lib/index.js +0 -194
  4. package/lib/markdown/createDeprecationNotice.d.ts +0 -6
  5. package/lib/markdown/createDeprecationNotice.js +0 -19
  6. package/lib/markdown/createDescription.d.ts +0 -1
  7. package/lib/markdown/createDescription.js +0 -16
  8. package/lib/markdown/createDetails.d.ts +0 -2
  9. package/lib/markdown/createDetails.js +0 -18
  10. package/lib/markdown/createDetailsSummary.d.ts +0 -2
  11. package/lib/markdown/createDetailsSummary.js +0 -18
  12. package/lib/markdown/createFullWidthTable.d.ts +0 -2
  13. package/lib/markdown/createFullWidthTable.js +0 -18
  14. package/lib/markdown/createParamsDetails.d.ts +0 -7
  15. package/lib/markdown/createParamsDetails.js +0 -44
  16. package/lib/markdown/createParamsTable.d.ts +0 -7
  17. package/lib/markdown/createParamsTable.js +0 -80
  18. package/lib/markdown/createRequestBodyDetails.d.ts +0 -6
  19. package/lib/markdown/createRequestBodyDetails.js +0 -14
  20. package/lib/markdown/createRequestBodyTable.d.ts +0 -6
  21. package/lib/markdown/createRequestBodyTable.js +0 -14
  22. package/lib/markdown/createSchemaDetails.d.ts +0 -14
  23. package/lib/markdown/createSchemaDetails.js +0 -241
  24. package/lib/markdown/createSchemaTable.d.ts +0 -14
  25. package/lib/markdown/createSchemaTable.js +0 -217
  26. package/lib/markdown/createStatusCodes.d.ts +0 -6
  27. package/lib/markdown/createStatusCodes.js +0 -47
  28. package/lib/markdown/createVersionBadge.d.ts +0 -1
  29. package/lib/markdown/createVersionBadge.js +0 -20
  30. package/lib/markdown/index.d.ts +0 -3
  31. package/lib/markdown/index.js +0 -43
  32. package/lib/markdown/schema.d.ts +0 -3
  33. package/lib/markdown/schema.js +0 -100
  34. package/lib/markdown/schema.test.d.ts +0 -1
  35. package/lib/markdown/schema.test.js +0 -171
  36. package/lib/markdown/utils.d.ts +0 -7
  37. package/lib/markdown/utils.js +0 -33
  38. package/lib/openapi/createExample.d.ts +0 -2
  39. package/lib/openapi/createExample.js +0 -113
  40. package/lib/openapi/index.d.ts +0 -1
  41. package/lib/openapi/index.js +0 -12
  42. package/lib/openapi/openapi.d.ts +0 -11
  43. package/lib/openapi/openapi.js +0 -231
  44. package/lib/openapi/openapi.test.d.ts +0 -1
  45. package/lib/openapi/openapi.test.js +0 -33
  46. package/lib/openapi/types.d.ts +0 -332
  47. package/lib/openapi/types.js +0 -8
  48. package/lib/options.d.ts +0 -4
  49. package/lib/options.js +0 -18
  50. package/lib/sidebars/index.d.ts +0 -3
  51. package/lib/sidebars/index.js +0 -89
  52. package/lib/types.d.ts +0 -68
  53. package/lib/types.js +0 -8
  54. package/yarn-error.log +0 -15179
@@ -1,89 +0,0 @@
1
- "use strict";
2
- /* ============================================================================
3
- * Copyright (c) Palo Alto Networks
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- * ========================================================================== */
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const clsx_1 = __importDefault(require("clsx"));
13
- const uniq_1 = __importDefault(require("lodash/uniq"));
14
- function isApiItem(item) {
15
- return item.type === "api";
16
- }
17
- function groupByTags(items, sidebarOptions, options) {
18
- // TODO: Figure out how to handle these
19
- // const intros = items.filter(isInfoItem).map((item) => {
20
- // return {
21
- // type: "link" as const,
22
- // label: item.title,
23
- // href: item.permalink,
24
- // docId: item.id,
25
- // };
26
- // });
27
- const { outputDir } = options;
28
- const { sidebarCollapsed, sidebarCollapsible, customProps } = sidebarOptions;
29
- const apiItems = items.filter(isApiItem);
30
- // TODO: make sure we only take the first tag
31
- const tags = (0, uniq_1.default)(apiItems
32
- .flatMap((item) => item.api.tags)
33
- .filter((item) => !!item));
34
- // TODO: optimize this or make it a function
35
- const basePath = outputDir
36
- .slice(outputDir.indexOf("/", 1))
37
- .replace(/^\/+/g, "");
38
- function createDocItem(item) {
39
- var _a, _b;
40
- const sidebar_label = item.frontMatter.sidebar_label;
41
- const title = item.title;
42
- const id = item.id;
43
- return {
44
- type: "doc",
45
- id: `${basePath}/${item.id}`,
46
- label: (_b = (_a = sidebar_label) !== null && _a !== void 0 ? _a : title) !== null && _b !== void 0 ? _b : id,
47
- customProps: customProps,
48
- className: (0, clsx_1.default)({
49
- "menu__list-item--deprecated": item.api.deprecated,
50
- "api-method": !!item.api.method,
51
- }, item.api.method),
52
- };
53
- }
54
- const tagged = tags
55
- .map((tag) => {
56
- return {
57
- type: "category",
58
- label: tag,
59
- collapsible: sidebarCollapsible,
60
- collapsed: sidebarCollapsed,
61
- items: apiItems
62
- .filter((item) => { var _a; return !!((_a = item.api.tags) === null || _a === void 0 ? void 0 : _a.includes(tag)); })
63
- .map(createDocItem),
64
- };
65
- })
66
- .filter((item) => item.items.length > 0); // Filter out any categories with no items.
67
- // const untagged = [
68
- // // TODO: determine if needed and how
69
- // {
70
- // type: "category" as const,
71
- // label: "UNTAGGED",
72
- // // collapsible: options.sidebarCollapsible, TODO: add option
73
- // // collapsed: options.sidebarCollapsed, TODO: add option
74
- // items: apiItems
75
- // //@ts-ignore
76
- // .filter(({ api }) => api.tags === undefined || api.tags.length === 0)
77
- // .map(createDocItem),
78
- // },
79
- // ];
80
- return [...tagged];
81
- }
82
- function generateSidebarSlice(sidebarOptions, options, api) {
83
- let sidebarSlice = [];
84
- if (sidebarOptions.groupPathsBy === "tags") {
85
- sidebarSlice = groupByTags(api, sidebarOptions, options);
86
- }
87
- return sidebarSlice;
88
- }
89
- exports.default = generateSidebarSlice;
package/lib/types.d.ts DELETED
@@ -1,68 +0,0 @@
1
- import type Request from "@paloaltonetworks/postman-collection";
2
- import { InfoObject, OperationObject, SecuritySchemeObject } from "./openapi/types";
3
- export type { PropSidebarItemCategory, SidebarItemLink, PropSidebar, PropSidebarItem, } from "@docusaurus/plugin-content-docs-types";
4
- export interface PluginOptions {
5
- id?: string;
6
- config: {
7
- [key: string]: ApiOptions;
8
- };
9
- }
10
- export interface ApiOptions {
11
- specPath: string;
12
- outputDir: string;
13
- template?: string;
14
- sidebarOptions?: SidebarOptions;
15
- }
16
- export interface LoadedContent {
17
- loadedApi: ApiMetadata[];
18
- }
19
- export declare type ApiMetadata = ApiPageMetadata | InfoPageMetadata;
20
- export interface ApiMetadataBase {
21
- sidebar?: string;
22
- previous?: ApiNavLink;
23
- next?: ApiNavLink;
24
- id: string;
25
- unversionedId: string;
26
- title: string;
27
- description: string;
28
- source: string;
29
- sourceDirName: string;
30
- slug: string;
31
- permalink: string;
32
- sidebarPosition?: number;
33
- frontMatter: Record<string, unknown>;
34
- }
35
- export interface ApiPageMetadata extends ApiMetadataBase {
36
- json?: string;
37
- type: "api";
38
- api: ApiItem;
39
- markdown?: string;
40
- }
41
- export interface ApiItem extends OperationObject {
42
- method: string;
43
- path: string;
44
- jsonRequestBodyExample: string;
45
- securitySchemes?: {
46
- [key: string]: SecuritySchemeObject;
47
- };
48
- postman?: Request;
49
- info: InfoObject;
50
- }
51
- export interface InfoPageMetadata extends ApiMetadataBase {
52
- type: "info";
53
- info: ApiInfo;
54
- markdown?: string;
55
- }
56
- export declare type ApiInfo = InfoObject;
57
- export interface ApiNavLink {
58
- title: string;
59
- permalink: string;
60
- }
61
- export interface SidebarOptions {
62
- groupPathsBy?: string;
63
- customProps?: {
64
- [key: string]: unknown;
65
- };
66
- sidebarCollapsible?: boolean;
67
- sidebarCollapsed?: boolean;
68
- }
package/lib/types.js DELETED
@@ -1,8 +0,0 @@
1
- "use strict";
2
- /* ============================================================================
3
- * Copyright (c) Palo Alto Networks
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- * ========================================================================== */
8
- Object.defineProperty(exports, "__esModule", { value: true });