docusaurus-plugin-openapi-docs 0.0.0-1055 → 0.0.0-1068

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.
@@ -11,11 +11,13 @@ const utils_1 = require("./utils");
11
11
  function createRequestHeader(header) {
12
12
  return [
13
13
  (0, utils_1.create)("Heading", {
14
- children: header,
15
14
  id: header.replace(" ", "-").toLowerCase(),
16
15
  as: "h2",
17
16
  className: "openapi-tabs__heading",
18
- }, { inline: true }),
19
- `\n\n`,
17
+ children: [
18
+ `<Translate id="theme.openapi.request.title">${header}</Translate>`,
19
+ ],
20
+ }),
21
+ "\n\n",
20
22
  ];
21
23
  }
@@ -316,7 +316,7 @@ function createDetailsNode(name, schemaName, schema, required, nullable) {
316
316
  : required === true, () => [
317
317
  (0, utils_1.create)("span", {
318
318
  className: "openapi-schema__required",
319
- children: "required",
319
+ children: "<Translate id='theme.openapi.schemaItem.required'>required</Translate>",
320
320
  }),
321
321
  ]),
322
322
  (0, utils_1.guard)(schema.deprecated, () => [
@@ -454,7 +454,7 @@ function createPropertyDiscriminator(name, schemaName, schema, discriminator, re
454
454
  (0, utils_1.guard)(required, () => [
455
455
  (0, utils_1.create)("span", {
456
456
  className: "openapi-schema__required",
457
- children: "required",
457
+ children: "<Translate id='theme.openapi.schemaItem.required'>required</Translate>",
458
458
  }),
459
459
  ]),
460
460
  ],
@@ -37,7 +37,8 @@ function createApiPageMD({ title, api: { deprecated, "x-deprecated-description":
37
37
  `import StatusCodes from "@theme/StatusCodes";\n`,
38
38
  `import OperationTabs from "@theme/OperationTabs";\n`,
39
39
  `import TabItem from "@theme/TabItem";\n`,
40
- `import Heading from "@theme/Heading";\n\n`,
40
+ `import Heading from "@theme/Heading";\n`,
41
+ `import Translate from "@docusaurus/Translate";\n\n`,
41
42
  (0, createHeading_1.createHeading)(title),
42
43
  (0, createMethodEndpoint_1.createMethodEndpoint)(method, path),
43
44
  infoPath && (0, createAuthorization_1.createAuthorization)(infoPath),
package/lib/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { SidebarItemDoc } from "@docusaurus/plugin-content-docs/src/sidebars/types";
1
+ import type { SidebarItemDoc } from "@docusaurus/plugin-content-docs/lib/sidebars/types";
2
2
  import { InfoObject, OperationObject, SchemaObject, SecuritySchemeObject, TagObject } from "./openapi/types";
3
- export type { PropSidebarItemCategory, SidebarItemLink, PropSidebar, PropSidebarItem, } from "@docusaurus/plugin-content-docs-types";
3
+ export type { PropSidebarItemCategory, SidebarItemLink, PropSidebar, PropSidebarItem, } from "@docusaurus/plugin-content-docs/lib/sidebars/types";
4
4
  export interface PluginOptions {
5
5
  id?: string;
6
6
  docsPlugin?: string;
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-1055",
4
+ "version": "0.0.0-1068",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -65,5 +65,5 @@
65
65
  "engines": {
66
66
  "node": ">=14"
67
67
  },
68
- "gitHead": "032eb64b64b19ba5d04fad6c1dcfaa2a96952f71"
68
+ "gitHead": "d18835ed938d31e72d4c57d272902a3818eac708"
69
69
  }
@@ -9,16 +9,14 @@ import { create } from "./utils";
9
9
 
10
10
  export function createRequestHeader(header: string) {
11
11
  return [
12
- create(
13
- "Heading",
14
- {
15
- children: header,
16
- id: header.replace(" ", "-").toLowerCase(),
17
- as: "h2",
18
- className: "openapi-tabs__heading",
19
- },
20
- { inline: true }
21
- ),
22
- `\n\n`,
12
+ create("Heading", {
13
+ id: header.replace(" ", "-").toLowerCase(),
14
+ as: "h2",
15
+ className: "openapi-tabs__heading",
16
+ children: [
17
+ `<Translate id="theme.openapi.request.title">${header}</Translate>`,
18
+ ],
19
+ }),
20
+ "\n\n",
23
21
  ];
24
22
  }
@@ -375,7 +375,8 @@ function createDetailsNode(
375
375
  () => [
376
376
  create("span", {
377
377
  className: "openapi-schema__required",
378
- children: "required",
378
+ children:
379
+ "<Translate id='theme.openapi.schemaItem.required'>required</Translate>",
379
380
  }),
380
381
  ]
381
382
  ),
@@ -530,7 +531,8 @@ function createPropertyDiscriminator(
530
531
  guard(required, () => [
531
532
  create("span", {
532
533
  className: "openapi-schema__required",
533
- children: "required",
534
+ children:
535
+ "<Translate id='theme.openapi.schemaItem.required'>required</Translate>",
534
536
  }),
535
537
  ]),
536
538
  ],
@@ -72,7 +72,8 @@ export function createApiPageMD({
72
72
  `import StatusCodes from "@theme/StatusCodes";\n`,
73
73
  `import OperationTabs from "@theme/OperationTabs";\n`,
74
74
  `import TabItem from "@theme/TabItem";\n`,
75
- `import Heading from "@theme/Heading";\n\n`,
75
+ `import Heading from "@theme/Heading";\n`,
76
+ `import Translate from "@docusaurus/Translate";\n\n`,
76
77
  createHeading(title),
77
78
  createMethodEndpoint(method, path),
78
79
  infoPath && createAuthorization(infoPath),
@@ -11,7 +11,7 @@ import type { FrontMatter as DocsFrontMatter } from "@docusaurus/types";
11
11
  import type { Props as DocsProps } from "@docusaurus/types";
12
12
 
13
13
  declare module "docusaurus-plugin-openapi-docs" {
14
- import type { PropSidebars } from "@docusaurus/plugin-content-docs-types";
14
+ import type { PropSidebars } from "@docusaurus/plugin-content-docs/lib/sidebars/types";
15
15
 
16
16
  export type Options = Partial<import("./types").APIOptions>;
17
17
 
package/src/types.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  * ========================================================================== */
7
7
 
8
- import { SidebarItemDoc } from "@docusaurus/plugin-content-docs/src/sidebars/types";
8
+ import type { SidebarItemDoc } from "@docusaurus/plugin-content-docs/lib/sidebars/types";
9
9
  import Request from "postman-collection";
10
10
 
11
11
  import {
@@ -21,7 +21,7 @@ export type {
21
21
  SidebarItemLink,
22
22
  PropSidebar,
23
23
  PropSidebarItem,
24
- } from "@docusaurus/plugin-content-docs-types";
24
+ } from "@docusaurus/plugin-content-docs/lib/sidebars/types";
25
25
  export interface PluginOptions {
26
26
  id?: string;
27
27
  docsPlugin?: string;
@@ -1,42 +0,0 @@
1
- /* ============================================================================
2
- * Copyright (c) Palo Alto Networks
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- * ========================================================================== */
7
-
8
- declare module "@docusaurus/plugin-content-docs-types" {
9
- // Makes all properties visible when hovering over the type
10
- type Expand<T extends Record<string, unknown>> = { [P in keyof T]: T[P] };
11
-
12
- export type SidebarItemBase = {
13
- className?: string;
14
- customProps?: Record<string, unknown>;
15
- };
16
-
17
- export type SidebarItemLink = SidebarItemBase & {
18
- type: "link";
19
- href: string;
20
- label: string;
21
- docId: string;
22
- };
23
-
24
- type SidebarItemCategoryBase = SidebarItemBase & {
25
- type: "category";
26
- label: string;
27
- collapsed: boolean;
28
- collapsible: boolean;
29
- };
30
-
31
- export type PropSidebarItemCategory = Expand<
32
- SidebarItemCategoryBase & {
33
- items: PropSidebarItem[];
34
- }
35
- >;
36
-
37
- export type PropSidebarItem = SidebarItemLink | PropSidebarItemCategory;
38
- export type PropSidebar = PropSidebarItem[];
39
- export type PropSidebars = {
40
- [sidebarId: string]: PropSidebar;
41
- };
42
- }