docusaurus-plugin-openapi-docs 1.1.2 → 1.1.5

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 (37) hide show
  1. package/README.md +1 -1
  2. package/lib/markdown/createLogo.d.ts +2 -0
  3. package/lib/markdown/createLogo.js +19 -0
  4. package/lib/markdown/createRequestBodyDetails.d.ts +9 -2
  5. package/lib/markdown/createRequestBodyDetails.js +2 -2
  6. package/lib/markdown/createRequestSchema.d.ts +21 -0
  7. package/lib/markdown/createRequestSchema.js +680 -0
  8. package/lib/markdown/{createSchemaDetails.d.ts → createResponseSchema.d.ts} +2 -2
  9. package/lib/markdown/{createSchemaDetails.js → createResponseSchema.js} +289 -48
  10. package/lib/markdown/createStatusCodes.js +117 -4
  11. package/lib/markdown/index.d.ts +1 -1
  12. package/lib/markdown/index.js +12 -3
  13. package/lib/markdown/schema.js +50 -14
  14. package/lib/markdown/schema.test.js +18 -18
  15. package/lib/openapi/createExample.js +27 -14
  16. package/lib/openapi/openapi.d.ts +1 -1
  17. package/lib/openapi/openapi.js +30 -19
  18. package/lib/openapi/types.d.ts +8 -1
  19. package/lib/openapi/utils/loadAndResolveSpec.js +13 -0
  20. package/lib/sidebars/index.d.ts +1 -1
  21. package/lib/sidebars/index.js +14 -5
  22. package/lib/types.d.ts +1 -1
  23. package/package.json +8 -8
  24. package/src/markdown/createLogo.ts +21 -0
  25. package/src/markdown/createRequestBodyDetails.ts +11 -4
  26. package/src/markdown/createRequestSchema.ts +848 -0
  27. package/src/markdown/{createSchemaDetails.ts → createResponseSchema.ts} +350 -54
  28. package/src/markdown/createStatusCodes.ts +149 -9
  29. package/src/markdown/index.ts +34 -3
  30. package/src/markdown/schema.test.ts +18 -18
  31. package/src/markdown/schema.ts +60 -14
  32. package/src/openapi/createExample.ts +31 -14
  33. package/src/openapi/openapi.ts +21 -13
  34. package/src/openapi/types.ts +9 -1
  35. package/src/openapi/utils/loadAndResolveSpec.ts +13 -0
  36. package/src/sidebars/index.ts +17 -7
  37. package/src/types.ts +1 -1
package/README.md CHANGED
@@ -246,7 +246,7 @@ yarn docusaurus gen-api-docs:version petstore:all
246
246
  Run the following to bootstrap a Docsaurus v2 site (classic theme) with `docusaurus-openapi-docs`:
247
247
 
248
248
  ```bash
249
- npx create-docusaurus@2.0.0-rc.1 my-website --package-manager yarn
249
+ npx create-docusaurus@2.0.1 my-website --package-manager yarn
250
250
  ```
251
251
 
252
252
  > When prompted to select a template choose `Git repository`.
@@ -0,0 +1,2 @@
1
+ import { LogoObject } from "../openapi/types";
2
+ export declare function createLogo(logo: LogoObject | undefined, darkLogo: LogoObject | undefined): string;
@@ -0,0 +1,19 @@
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 });
9
+ exports.createLogo = void 0;
10
+ const utils_1 = require("./utils");
11
+ function createLogo(logo, darkLogo) {
12
+ return (0, utils_1.guard)(logo || darkLogo, () => [
13
+ (0, utils_1.create)("ApiLogo", {
14
+ logo: logo,
15
+ darkLogo: darkLogo,
16
+ }),
17
+ ]);
18
+ }
19
+ exports.createLogo = createLogo;
@@ -1,6 +1,13 @@
1
+ import { MediaTypeObject } from "../openapi/types";
1
2
  interface Props {
2
3
  title: string;
3
- body: any;
4
+ body: {
5
+ content?: {
6
+ [key: string]: MediaTypeObject;
7
+ };
8
+ description?: string;
9
+ required?: boolean;
10
+ };
4
11
  }
5
- export declare function createRequestBodyDetails({ title, body }: Props): string | undefined;
12
+ export declare function createRequestBodyDetails({ title, body }: Props): any;
6
13
  export {};
@@ -7,8 +7,8 @@
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.createRequestBodyDetails = void 0;
10
- const createSchemaDetails_1 = require("./createSchemaDetails");
10
+ const createRequestSchema_1 = require("./createRequestSchema");
11
11
  function createRequestBodyDetails({ title, body }) {
12
- return (0, createSchemaDetails_1.createSchemaDetails)({ title, body });
12
+ return (0, createRequestSchema_1.createRequestSchema)({ title, body });
13
13
  }
14
14
  exports.createRequestBodyDetails = createRequestBodyDetails;
@@ -0,0 +1,21 @@
1
+ import { MediaTypeObject, SchemaObject } from "../openapi/types";
2
+ /**
3
+ * Returns a merged representation of allOf array of schemas.
4
+ */
5
+ export declare function mergeAllOf(allOf: SchemaObject[]): {
6
+ mergedSchemas: any;
7
+ required: any;
8
+ };
9
+ interface Props {
10
+ style?: any;
11
+ title: string;
12
+ body: {
13
+ content?: {
14
+ [key: string]: MediaTypeObject;
15
+ };
16
+ description?: string;
17
+ required?: string[] | boolean;
18
+ };
19
+ }
20
+ export declare function createRequestSchema({ title, body, ...rest }: Props): string | undefined;
21
+ export {};