docusaurus-theme-openapi-docs 0.0.0-1294 → 0.0.0-1295

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 (60) hide show
  1. package/lib/markdown/schema.js +4 -5
  2. package/lib/theme/ApiExplorer/Authorization/index.js +9 -10
  3. package/lib/theme/ApiExplorer/Body/index.js +4 -5
  4. package/lib/theme/ApiExplorer/Export/index.js +9 -2
  5. package/lib/theme/ApiExplorer/FormFileUpload/index.js +1 -2
  6. package/lib/theme/ApiExplorer/FormLabel/index.js +1 -2
  7. package/lib/theme/ApiExplorer/FormTextInput/index.js +1 -2
  8. package/lib/theme/ApiExplorer/LiveEditor/index.js +1 -2
  9. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +5 -3
  10. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +1 -2
  11. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +1 -2
  12. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +1 -2
  13. package/lib/theme/ApiExplorer/ParamOptions/index.js +2 -3
  14. package/lib/theme/ApiExplorer/Request/index.js +17 -18
  15. package/lib/theme/ApiExplorer/Response/index.js +7 -11
  16. package/lib/theme/ApiExplorer/SecuritySchemes/index.js +57 -50
  17. package/lib/theme/ApiExplorer/Server/index.js +2 -3
  18. package/lib/theme/ApiTabs/index.js +1 -2
  19. package/lib/theme/Example/index.js +3 -4
  20. package/lib/theme/ParamsDetails/index.js +1 -2
  21. package/lib/theme/ParamsItem/index.js +7 -8
  22. package/lib/theme/RequestSchema/index.js +4 -6
  23. package/lib/theme/ResponseExamples/index.js +3 -4
  24. package/lib/theme/ResponseSchema/index.js +2 -3
  25. package/lib/theme/Schema/index.js +8 -9
  26. package/lib/theme/SchemaExpansion/index.js +4 -5
  27. package/lib/theme/SchemaItem/index.js +9 -10
  28. package/lib/theme/StatusCodes/index.js +2 -4
  29. package/lib/theme/translationIds.d.ts +1 -99
  30. package/lib/theme/translationIds.js +0 -116
  31. package/package.json +3 -3
  32. package/src/markdown/schema.ts +4 -5
  33. package/src/theme/ApiExplorer/Authorization/index.tsx +9 -10
  34. package/src/theme/ApiExplorer/Body/index.tsx +7 -5
  35. package/src/theme/ApiExplorer/Export/index.tsx +6 -2
  36. package/src/theme/ApiExplorer/FormFileUpload/index.tsx +1 -2
  37. package/src/theme/ApiExplorer/FormLabel/index.tsx +1 -2
  38. package/src/theme/ApiExplorer/FormTextInput/index.tsx +1 -2
  39. package/src/theme/ApiExplorer/LiveEditor/index.tsx +1 -2
  40. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +5 -3
  41. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +1 -2
  42. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +1 -2
  43. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +1 -2
  44. package/src/theme/ApiExplorer/ParamOptions/index.tsx +2 -3
  45. package/src/theme/ApiExplorer/Request/index.tsx +23 -18
  46. package/src/theme/ApiExplorer/Response/index.tsx +10 -8
  47. package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +60 -52
  48. package/src/theme/ApiExplorer/Server/index.tsx +8 -3
  49. package/src/theme/ApiTabs/index.tsx +1 -2
  50. package/src/theme/Example/index.tsx +3 -4
  51. package/src/theme/ParamsDetails/index.tsx +1 -2
  52. package/src/theme/ParamsItem/index.tsx +13 -8
  53. package/src/theme/RequestSchema/index.tsx +4 -5
  54. package/src/theme/ResponseExamples/index.tsx +3 -4
  55. package/src/theme/ResponseSchema/index.tsx +2 -3
  56. package/src/theme/Schema/index.tsx +8 -9
  57. package/src/theme/SchemaExpansion/index.tsx +4 -5
  58. package/src/theme/SchemaItem/index.tsx +18 -10
  59. package/src/theme/StatusCodes/index.tsx +2 -3
  60. package/src/theme/translationIds.ts +37 -113
@@ -16,7 +16,6 @@ const react_1 = __importDefault(require("react"));
16
16
  const Translate_1 = require("@docusaurus/Translate");
17
17
  const Example_1 = require("@theme/Example");
18
18
  const Markdown_1 = __importDefault(require("@theme/Markdown"));
19
- const translationIds_1 = require("@theme/translationIds");
20
19
  const clsx_1 = __importDefault(require("clsx"));
21
20
  const schema_1 = require("../../markdown/schema");
22
21
  const utils_1 = require("../../markdown/utils");
@@ -29,11 +28,11 @@ const transformEnumDescriptions = (enumDescriptions) => {
29
28
  const getEnumDescriptionMarkdown = (enumDescriptions) => {
30
29
  if (enumDescriptions?.length) {
31
30
  const enumValue = (0, Translate_1.translate)({
32
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.ENUM_VALUE,
31
+ id: "theme.openapi.schemaItem.enumValue",
33
32
  message: "Enum Value",
34
33
  });
35
34
  const description = (0, Translate_1.translate)({
36
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.ENUM_DESCRIPTION,
35
+ id: "theme.openapi.schemaItem.enumDescription",
37
36
  message: "Description",
38
37
  });
39
38
  return `| ${enumValue} | ${description} |
@@ -84,7 +83,7 @@ function SchemaItem(props) {
84
83
  "span",
85
84
  { className: "openapi-schema__required" },
86
85
  (0, Translate_1.translate)({
87
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.REQUIRED,
86
+ id: "theme.openapi.schemaItem.required",
88
87
  message: "required",
89
88
  })
90
89
  )
@@ -94,7 +93,7 @@ function SchemaItem(props) {
94
93
  "span",
95
94
  { className: "openapi-schema__deprecated" },
96
95
  (0, Translate_1.translate)({
97
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.DEPRECATED,
96
+ id: "theme.openapi.schemaItem.deprecated",
98
97
  message: "deprecated",
99
98
  })
100
99
  )
@@ -104,7 +103,7 @@ function SchemaItem(props) {
104
103
  "span",
105
104
  { className: "openapi-schema__nullable" },
106
105
  (0, Translate_1.translate)({
107
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.NULLABLE,
106
+ id: "theme.openapi.schemaItem.nullable",
108
107
  message: "nullable",
109
108
  })
110
109
  )
@@ -151,7 +150,7 @@ function SchemaItem(props) {
151
150
  "strong",
152
151
  null,
153
152
  (0, Translate_1.translate)({
154
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.DEFAULT_VALUE,
153
+ id: "theme.openapi.schemaItem.defaultValue",
155
154
  message: "Default value:",
156
155
  }),
157
156
  " "
@@ -170,7 +169,7 @@ function SchemaItem(props) {
170
169
  "strong",
171
170
  null,
172
171
  (0, Translate_1.translate)({
173
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.DEFAULT_VALUE,
172
+ id: "theme.openapi.schemaItem.defaultValue",
174
173
  message: "Default value:",
175
174
  }),
176
175
  " "
@@ -198,7 +197,7 @@ function SchemaItem(props) {
198
197
  "strong",
199
198
  null,
200
199
  (0, Translate_1.translate)({
201
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.CONSTANT_VALUE,
200
+ id: "theme.openapi.schemaItem.constantValue",
202
201
  message: "Constant value:",
203
202
  }),
204
203
  " "
@@ -217,7 +216,7 @@ function SchemaItem(props) {
217
216
  "strong",
218
217
  null,
219
218
  (0, Translate_1.translate)({
220
- id: translationIds_1.OPENAPI_SCHEMA_ITEM.CONSTANT_VALUE,
219
+ id: "theme.openapi.schemaItem.constantValue",
221
220
  message: "Constant value:",
222
221
  }),
223
222
  " "
@@ -19,7 +19,6 @@ const Markdown_1 = __importDefault(require("@theme/Markdown"));
19
19
  const ResponseHeaders_1 = __importDefault(require("@theme/ResponseHeaders"));
20
20
  const ResponseSchema_1 = __importDefault(require("@theme/ResponseSchema"));
21
21
  const TabItem_1 = __importDefault(require("@theme/TabItem"));
22
- const translationIds_1 = require("@theme/translationIds");
23
22
  const StatusCodes = ({ label, id, responses }) => {
24
23
  if (!responses) return null;
25
24
  const codes = Object.keys(responses);
@@ -64,8 +63,7 @@ const StatusCodes = ({ label, id, responses }) => {
64
63
  "strong",
65
64
  null,
66
65
  (0, Translate_1.translate)({
67
- id: translationIds_1.OPENAPI_STATUS_CODES
68
- .RESPONSE_HEADERS,
66
+ id: "theme.openapi.statusCodes.responseHeaders",
69
67
  message: "Response Headers",
70
68
  })
71
69
  )
@@ -77,7 +75,7 @@ const StatusCodes = ({ label, id, responses }) => {
77
75
  ),
78
76
  react_1.default.createElement(ResponseSchema_1.default, {
79
77
  title: (0, Translate_1.translate)({
80
- id: translationIds_1.OPENAPI_STATUS_CODES.SCHEMA_TITLE,
78
+ id: "theme.openapi.statusCodes.schemaTitle",
81
79
  message: "Schema",
82
80
  }),
83
81
  body: { content: response.content },
@@ -1,99 +1 @@
1
- export declare const OPENAPI_RESPONSE: {
2
- TITLE: string;
3
- CLEAR: string;
4
- PLACEHOLDER: string;
5
- HEADERS_TAB: string;
6
- };
7
- export declare const OPENAPI_TABS: {
8
- RESPONSES_LABEL: string;
9
- };
10
- export declare const OPENAPI_REQUEST: {
11
- BODY_TITLE: string;
12
- ACCEPT_TITLE: string;
13
- SEND_BUTTON: string;
14
- REQUIRED_LABEL: string;
15
- REQUEST_TITLE: string;
16
- COLLAPSE_ALL: string;
17
- EXPAND_ALL: string;
18
- BASE_URL_TITLE: string;
19
- AUTH_TITLE: string;
20
- PARAMETERS_TITLE: string;
21
- FETCHING_MESSAGE: string;
22
- CONNECTION_FAILED: string;
23
- ERROR_TIMEOUT: string;
24
- ERROR_NETWORK: string;
25
- ERROR_CORS: string;
26
- ERROR_UNKNOWN: string;
27
- };
28
- export declare const OPENAPI_SERVER: {
29
- EDIT_BUTTON: string;
30
- HIDE_BUTTON: string;
31
- };
32
- export declare const OPENAPI_PARAM_OPTIONS: {
33
- SHOW_OPTIONAL: string;
34
- HIDE_OPTIONAL: string;
35
- };
36
- export declare const OPENAPI_FORM_FILE_UPLOAD: {
37
- CLEAR_BUTTON: string;
38
- };
39
- export declare const OPENAPI_FORM: {
40
- FIELD_REQUIRED: string;
41
- };
42
- export declare const OPENAPI_AUTH: {
43
- BEARER_TOKEN: string;
44
- USERNAME: string;
45
- PASSWORD: string;
46
- SECURITY_SCHEME: string;
47
- };
48
- export declare const OPENAPI_RESPONSE_EXAMPLES: {
49
- EXAMPLE: string;
50
- AUTO_EXAMPLE: string;
51
- };
52
- export declare const OPENAPI_BODY: {
53
- EXAMPLE_FROM_SCHEMA: string;
54
- };
55
- export declare const OPENAPI_STATUS_CODES: {
56
- RESPONSE_HEADERS: string;
57
- SCHEMA_TITLE: string;
58
- };
59
- export declare const OPENAPI_SCHEMA: {
60
- NO_SCHEMA: string;
61
- };
62
- export declare const OPENAPI_SCHEMA_EXPANSION: {
63
- BUTTON_LABEL: string;
64
- MENU_LABEL: string;
65
- ALL: string;
66
- DEPTH_OPTION: string;
67
- };
68
- export declare const OPENAPI_SCHEMA_ITEM: {
69
- CHARACTERS: string;
70
- NON_EMPTY: string;
71
- REQUIRED: string;
72
- DEPRECATED: string;
73
- NULLABLE: string;
74
- DEFAULT_VALUE: string;
75
- EXAMPLE: string;
76
- EXAMPLES: string;
77
- DESCRIPTION: string;
78
- CONSTANT_VALUE: string;
79
- ENUM_VALUE: string;
80
- ENUM_DESCRIPTION: string;
81
- POSSIBLE_VALUES: string;
82
- EXPRESSION: string;
83
- ONE_OF: string;
84
- ANY_OF: string;
85
- };
86
- export declare const OPENAPI_PARAMS_DETAILS: {
87
- PARAMETERS_TITLE: string;
88
- };
89
- export declare const OPENAPI_SECURITY_SCHEMES: {
90
- NAME: string;
91
- TYPE: string;
92
- SCOPES: string;
93
- IN: string;
94
- FLOWS: string;
95
- DESCRIPTION: string;
96
- SCHEME: string;
97
- BEARER_FORMAT: string;
98
- OPEN_ID_CONNECT_URL: string;
99
- };
1
+ export {};
@@ -6,119 +6,3 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.OPENAPI_SECURITY_SCHEMES =
10
- exports.OPENAPI_PARAMS_DETAILS =
11
- exports.OPENAPI_SCHEMA_ITEM =
12
- exports.OPENAPI_SCHEMA_EXPANSION =
13
- exports.OPENAPI_SCHEMA =
14
- exports.OPENAPI_STATUS_CODES =
15
- exports.OPENAPI_BODY =
16
- exports.OPENAPI_RESPONSE_EXAMPLES =
17
- exports.OPENAPI_AUTH =
18
- exports.OPENAPI_FORM =
19
- exports.OPENAPI_FORM_FILE_UPLOAD =
20
- exports.OPENAPI_PARAM_OPTIONS =
21
- exports.OPENAPI_SERVER =
22
- exports.OPENAPI_REQUEST =
23
- exports.OPENAPI_TABS =
24
- exports.OPENAPI_RESPONSE =
25
- void 0;
26
- exports.OPENAPI_RESPONSE = {
27
- TITLE: "theme.openapi.response.title",
28
- CLEAR: "theme.openapi.response.clear",
29
- PLACEHOLDER: "theme.openapi.response.placeholder",
30
- HEADERS_TAB: "theme.openapi.response.headersTab",
31
- };
32
- exports.OPENAPI_TABS = {
33
- RESPONSES_LABEL: "theme.openapi.tabs.responses.label",
34
- };
35
- exports.OPENAPI_REQUEST = {
36
- BODY_TITLE: "theme.openapi.request.body.title",
37
- ACCEPT_TITLE: "theme.openapi.request.accept.title",
38
- SEND_BUTTON: "theme.openapi.request.sendButton",
39
- REQUIRED_LABEL: "theme.openapi.request.requiredLabel",
40
- REQUEST_TITLE: "theme.openapi.request.title",
41
- COLLAPSE_ALL: "theme.openapi.request.collapseAll",
42
- EXPAND_ALL: "theme.openapi.request.expandAll",
43
- BASE_URL_TITLE: "theme.openapi.request.baseUrl.title",
44
- AUTH_TITLE: "theme.openapi.request.auth.title",
45
- PARAMETERS_TITLE: "theme.openapi.request.parameters.title",
46
- FETCHING_MESSAGE: "theme.openapi.request.fetchingMessage",
47
- CONNECTION_FAILED: "theme.openapi.request.connectionFailed",
48
- ERROR_TIMEOUT: "theme.openapi.request.error.timeout",
49
- ERROR_NETWORK: "theme.openapi.request.error.network",
50
- ERROR_CORS: "theme.openapi.request.error.cors",
51
- ERROR_UNKNOWN: "theme.openapi.request.error.unknown",
52
- };
53
- exports.OPENAPI_SERVER = {
54
- EDIT_BUTTON: "theme.openapi.server.editButton",
55
- HIDE_BUTTON: "theme.openapi.server.hideButton",
56
- };
57
- exports.OPENAPI_PARAM_OPTIONS = {
58
- SHOW_OPTIONAL: "theme.openapi.paramOptions.showOptional",
59
- HIDE_OPTIONAL: "theme.openapi.paramOptions.hideOptional",
60
- };
61
- exports.OPENAPI_FORM_FILE_UPLOAD = {
62
- CLEAR_BUTTON: "theme.openapi.formFileUpload.clearButton",
63
- };
64
- exports.OPENAPI_FORM = {
65
- FIELD_REQUIRED: "theme.openapi.form.fieldRequired",
66
- };
67
- exports.OPENAPI_AUTH = {
68
- BEARER_TOKEN: "theme.openapi.auth.bearerToken",
69
- USERNAME: "theme.openapi.auth.username",
70
- PASSWORD: "theme.openapi.auth.password",
71
- SECURITY_SCHEME: "theme.openapi.auth.securityScheme",
72
- };
73
- exports.OPENAPI_RESPONSE_EXAMPLES = {
74
- EXAMPLE: "theme.openapi.responseExamples.example",
75
- AUTO_EXAMPLE: "theme.openapi.responseExamples.autoExample",
76
- };
77
- exports.OPENAPI_BODY = {
78
- EXAMPLE_FROM_SCHEMA: "theme.openapi.body.exampleFromSchema",
79
- };
80
- exports.OPENAPI_STATUS_CODES = {
81
- RESPONSE_HEADERS: "theme.openapi.statusCodes.responseHeaders",
82
- SCHEMA_TITLE: "theme.openapi.statusCodes.schemaTitle",
83
- };
84
- exports.OPENAPI_SCHEMA = {
85
- NO_SCHEMA: "theme.openapi.schema.noSchema",
86
- };
87
- exports.OPENAPI_SCHEMA_EXPANSION = {
88
- BUTTON_LABEL: "theme.openapi.schema.expansion.button",
89
- MENU_LABEL: "theme.openapi.schema.expansion.menu",
90
- ALL: "theme.openapi.schema.expansion.all",
91
- DEPTH_OPTION: "theme.openapi.schema.expansion.depthOption",
92
- };
93
- exports.OPENAPI_SCHEMA_ITEM = {
94
- CHARACTERS: "theme.openapi.schemaItem.characters",
95
- NON_EMPTY: "theme.openapi.schemaItem.nonEmpty",
96
- REQUIRED: "theme.openapi.schemaItem.required",
97
- DEPRECATED: "theme.openapi.schemaItem.deprecated",
98
- NULLABLE: "theme.openapi.schemaItem.nullable",
99
- DEFAULT_VALUE: "theme.openapi.schemaItem.defaultValue",
100
- EXAMPLE: "theme.openapi.schemaItem.example",
101
- EXAMPLES: "theme.openapi.schemaItem.examples",
102
- DESCRIPTION: "theme.openapi.schemaItem.description",
103
- CONSTANT_VALUE: "theme.openapi.schemaItem.constantValue",
104
- ENUM_VALUE: "theme.openapi.schemaItem.enumValue",
105
- ENUM_DESCRIPTION: "theme.openapi.schemaItem.enumDescription",
106
- POSSIBLE_VALUES: "theme.openapi.schemaItem.possibleValues",
107
- EXPRESSION: "theme.openapi.schemaItem.expression",
108
- ONE_OF: "theme.openapi.schemaItem.oneOf",
109
- ANY_OF: "theme.openapi.schemaItem.anyOf",
110
- };
111
- exports.OPENAPI_PARAMS_DETAILS = {
112
- PARAMETERS_TITLE: "theme.openapi.paramsDetails.parametersTitle",
113
- };
114
- exports.OPENAPI_SECURITY_SCHEMES = {
115
- NAME: "theme.openapi.securitySchemes.name",
116
- TYPE: "theme.openapi.securitySchemes.type",
117
- SCOPES: "theme.openapi.securitySchemes.scopes",
118
- IN: "theme.openapi.securitySchemes.in",
119
- FLOWS: "theme.openapi.securitySchemes.flows",
120
- DESCRIPTION: "theme.openapi.securitySchemes.description",
121
- SCHEME: "theme.openapi.securitySchemes.scheme",
122
- BEARER_FORMAT: "theme.openapi.securitySchemes.bearerFormat",
123
- OPEN_ID_CONNECT_URL: "theme.openapi.securitySchemes.openIdConnectUrl",
124
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "docusaurus-theme-openapi-docs",
3
3
  "description": "OpenAPI theme for Docusaurus.",
4
- "version": "0.0.0-1294",
4
+ "version": "0.0.0-1295",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -38,7 +38,7 @@
38
38
  "@types/postman-collection": "^3.5.11",
39
39
  "@types/react-modal": "^3.16.3",
40
40
  "concurrently": "^9.2.0",
41
- "docusaurus-plugin-openapi-docs": "0.0.0-1294",
41
+ "docusaurus-plugin-openapi-docs": "0.0.0-1295",
42
42
  "docusaurus-plugin-sass": "^0.2.6",
43
43
  "eslint-plugin-prettier": "^5.5.1"
44
44
  },
@@ -82,5 +82,5 @@
82
82
  "engines": {
83
83
  "node": ">=14"
84
84
  },
85
- "gitHead": "dcce97d6a3cae4f76af8f02e81571e8ce5a394ac"
85
+ "gitHead": "794540bb4937ec12827e46aa936f8cb29fc7b2ab"
86
86
  }
@@ -7,7 +7,6 @@
7
7
 
8
8
  import { translate } from "@docusaurus/Translate";
9
9
 
10
- import { OPENAPI_SCHEMA_ITEM } from "../theme/translationIds";
11
10
  import { SchemaObject } from "../types";
12
11
 
13
12
  /**
@@ -158,7 +157,7 @@ export function getQualifierMessage(schema?: SchemaObject): string | undefined {
158
157
  }
159
158
 
160
159
  let message = `**${translate({
161
- id: OPENAPI_SCHEMA_ITEM.POSSIBLE_VALUES,
160
+ id: "theme.openapi.schemaItem.possibleValues",
162
161
  message: "Possible values:",
163
162
  })}** `;
164
163
 
@@ -177,11 +176,11 @@ export function getQualifierMessage(schema?: SchemaObject): string | undefined {
177
176
  let minLength;
178
177
  let maxLength;
179
178
  const charactersMessage = translate({
180
- id: OPENAPI_SCHEMA_ITEM.CHARACTERS,
179
+ id: "theme.openapi.schemaItem.characters",
181
180
  message: "characters",
182
181
  });
183
182
  const nonEmptyMessage = translate({
184
- id: OPENAPI_SCHEMA_ITEM.NON_EMPTY,
183
+ id: "theme.openapi.schemaItem.nonEmpty",
185
184
  message: "non-empty",
186
185
  });
187
186
  if (schema.minLength && schema.minLength > 1) {
@@ -246,7 +245,7 @@ export function getQualifierMessage(schema?: SchemaObject): string | undefined {
246
245
 
247
246
  if (schema.pattern) {
248
247
  const expressionMessage = translate({
249
- id: OPENAPI_SCHEMA_ITEM.EXPRESSION,
248
+ id: "theme.openapi.schemaItem.expression",
250
249
  message: "Value must match regular expression",
251
250
  });
252
251
  qualifierGroups.push(`${expressionMessage} \`${schema.pattern}\``);
@@ -12,7 +12,6 @@ import FormItem from "@theme/ApiExplorer/FormItem";
12
12
  import FormSelect from "@theme/ApiExplorer/FormSelect";
13
13
  import FormTextInput from "@theme/ApiExplorer/FormTextInput";
14
14
  import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
15
- import { OPENAPI_AUTH } from "@theme/translationIds";
16
15
 
17
16
  import { setAuthData, setSelectedAuth } from "./slice";
18
17
 
@@ -37,7 +36,7 @@ function Authorization() {
37
36
  <FormItem>
38
37
  <FormSelect
39
38
  label={translate({
40
- id: OPENAPI_AUTH.SECURITY_SCHEME,
39
+ id: "theme.openapi.auth.securityScheme",
41
40
  message: "Security Scheme",
42
41
  })}
43
42
  options={optionKeys}
@@ -54,11 +53,11 @@ function Authorization() {
54
53
  <FormItem key={a.key + "-bearer"}>
55
54
  <FormTextInput
56
55
  label={translate({
57
- id: OPENAPI_AUTH.BEARER_TOKEN,
56
+ id: "theme.openapi.auth.bearerToken",
58
57
  message: "Bearer Token",
59
58
  })}
60
59
  placeholder={translate({
61
- id: OPENAPI_AUTH.BEARER_TOKEN,
60
+ id: "theme.openapi.auth.bearerToken",
62
61
  message: "Bearer Token",
63
62
  })}
64
63
  password
@@ -83,11 +82,11 @@ function Authorization() {
83
82
  <FormItem key={a.key + "-oauth2"}>
84
83
  <FormTextInput
85
84
  label={translate({
86
- id: OPENAPI_AUTH.BEARER_TOKEN,
85
+ id: "theme.openapi.auth.bearerToken",
87
86
  message: "Bearer Token",
88
87
  })}
89
88
  placeholder={translate({
90
- id: OPENAPI_AUTH.BEARER_TOKEN,
89
+ id: "theme.openapi.auth.bearerToken",
91
90
  message: "Bearer Token",
92
91
  })}
93
92
  password
@@ -113,11 +112,11 @@ function Authorization() {
113
112
  <FormItem>
114
113
  <FormTextInput
115
114
  label={translate({
116
- id: OPENAPI_AUTH.USERNAME,
115
+ id: "theme.openapi.auth.username",
117
116
  message: "Username",
118
117
  })}
119
118
  placeholder={translate({
120
- id: OPENAPI_AUTH.USERNAME,
119
+ id: "theme.openapi.auth.username",
121
120
  message: "Username",
122
121
  })}
123
122
  value={data[a.key].username ?? ""}
@@ -136,11 +135,11 @@ function Authorization() {
136
135
  <FormItem>
137
136
  <FormTextInput
138
137
  label={translate({
139
- id: OPENAPI_AUTH.PASSWORD,
138
+ id: "theme.openapi.auth.password",
140
139
  message: "Password",
141
140
  })}
142
141
  placeholder={translate({
143
- id: OPENAPI_AUTH.PASSWORD,
142
+ id: "theme.openapi.auth.password",
144
143
  message: "Password",
145
144
  })}
146
145
  password
@@ -16,7 +16,6 @@ import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
16
16
  import Markdown from "@theme/Markdown";
17
17
  import SchemaTabs from "@theme/SchemaTabs";
18
18
  import TabItem from "@theme/TabItem";
19
- import { OPENAPI_BODY, OPENAPI_REQUEST } from "@theme/translationIds";
20
19
  import { sampleFromSchema } from "docusaurus-plugin-openapi-docs/lib/openapi/createSchemaExample";
21
20
  import type { RequestBodyObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
22
21
  import format from "xml-formatter";
@@ -292,7 +291,10 @@ function Body({
292
291
  <FormFileUpload
293
292
  placeholder={
294
293
  schema.description ||
295
- translate({ id: OPENAPI_REQUEST.BODY_TITLE, message: "Body" })
294
+ translate({
295
+ id: "theme.openapi.request.body.title",
296
+ message: "Body",
297
+ })
296
298
  }
297
299
  onChange={(file: any) => {
298
300
  if (file === undefined) {
@@ -322,7 +324,7 @@ function Body({
322
324
  {/* @ts-ignore */}
323
325
  <TabItem
324
326
  label={translate({
325
- id: OPENAPI_BODY.EXAMPLE_FROM_SCHEMA,
327
+ id: "theme.openapi.body.exampleFromSchema",
326
328
  message: "Example (from schema)",
327
329
  })}
328
330
  value="Example (from schema)"
@@ -412,7 +414,7 @@ function Body({
412
414
  {/* @ts-ignore */}
413
415
  <TabItem
414
416
  label={translate({
415
- id: OPENAPI_BODY.EXAMPLE_FROM_SCHEMA,
417
+ id: "theme.openapi.body.exampleFromSchema",
416
418
  message: "Example (from schema)",
417
419
  })}
418
420
  value="Example (from schema)"
@@ -453,7 +455,7 @@ function Body({
453
455
  {/* @ts-ignore */}
454
456
  <TabItem
455
457
  label={translate({
456
- id: OPENAPI_BODY.EXAMPLE_FROM_SCHEMA,
458
+ id: "theme.openapi.body.exampleFromSchema",
457
459
  message: "Example (from schema)",
458
460
  })}
459
461
  value="Example (from schema)"
@@ -7,6 +7,7 @@
7
7
 
8
8
  import React from "react";
9
9
 
10
+ import { translate } from "@docusaurus/Translate";
10
11
  import fileSaver from "file-saver";
11
12
 
12
13
  const saveFile = (url: string) => {
@@ -24,7 +25,7 @@ function Export({ url, proxy }: any) {
24
25
  className="dropdown dropdown--hoverable dropdown--right"
25
26
  >
26
27
  <button className="export-button button button--sm button--secondary">
27
- Export
28
+ {translate({ id: "theme.openapi.export.button", message: "Export" })}
28
29
  </button>
29
30
  <ul className="export-dropdown dropdown__menu">
30
31
  <li>
@@ -36,7 +37,10 @@ function Export({ url, proxy }: any) {
36
37
  className="dropdown__link"
37
38
  href={`${url}`}
38
39
  >
39
- OpenAPI Spec
40
+ {translate({
41
+ id: "theme.openapi.export.openapiSpec",
42
+ message: "OpenAPI Spec",
43
+ })}
40
44
  </a>
41
45
  </li>
42
46
  </ul>
@@ -9,7 +9,6 @@ import React, { useState } from "react";
9
9
 
10
10
  import { translate } from "@docusaurus/Translate";
11
11
  import FloatingButton from "@theme/ApiExplorer/FloatingButton";
12
- import { OPENAPI_FORM_FILE_UPLOAD } from "@theme/translationIds";
13
12
  import MagicDropzone from "react-magic-dropzone";
14
13
 
15
14
  type PreviewFile = { preview: string } & File;
@@ -105,7 +104,7 @@ function FormFileUpload({ placeholder, onChange }: Props) {
105
104
  }}
106
105
  >
107
106
  {translate({
108
- id: OPENAPI_FORM_FILE_UPLOAD.CLEAR_BUTTON,
107
+ id: "theme.openapi.formFileUpload.clearButton",
109
108
  message: "Clear",
110
109
  })}
111
110
  </button>
@@ -8,7 +8,6 @@
8
8
  import React from "react";
9
9
 
10
10
  import { translate } from "@docusaurus/Translate";
11
- import { OPENAPI_SCHEMA_ITEM } from "@theme/translationIds";
12
11
 
13
12
  export interface Props {
14
13
  htmlFor?: string;
@@ -31,7 +30,7 @@ function FormLabel({ htmlFor, label, type, required }: Props) {
31
30
  {required && (
32
31
  <span className="openapi-schema__required">
33
32
  {translate({
34
- id: OPENAPI_SCHEMA_ITEM.REQUIRED,
33
+ id: "theme.openapi.schemaItem.required",
35
34
  message: "required",
36
35
  })}
37
36
  </span>
@@ -11,7 +11,6 @@ import React, { useId } from "react";
11
11
  import { translate } from "@docusaurus/Translate";
12
12
  import { ErrorMessage } from "@hookform/error-message";
13
13
  import FormLabel from "@theme/ApiExplorer/FormLabel";
14
- import { OPENAPI_FORM } from "@theme/translationIds";
15
14
  import clsx from "clsx";
16
15
  import { useFormContext } from "react-hook-form";
17
16
 
@@ -59,7 +58,7 @@ function FormTextInput({
59
58
  {...register(paramName, {
60
59
  required: isRequired
61
60
  ? translate({
62
- id: OPENAPI_FORM.FIELD_REQUIRED,
61
+ id: "theme.openapi.form.fieldRequired",
63
62
  message: "This field is required",
64
63
  })
65
64
  : false,
@@ -11,7 +11,6 @@ import { usePrismTheme } from "@docusaurus/theme-common";
11
11
  import { translate } from "@docusaurus/Translate";
12
12
  import useIsBrowser from "@docusaurus/useIsBrowser";
13
13
  import { ErrorMessage } from "@hookform/error-message";
14
- import { OPENAPI_FORM } from "@theme/translationIds";
15
14
  import clsx from "clsx";
16
15
  import { Controller, useFormContext } from "react-hook-form";
17
16
  import { LiveProvider, LiveEditor, withLive } from "react-live";
@@ -89,7 +88,7 @@ function App({
89
88
  required:
90
89
  isRequired && !code
91
90
  ? translate({
92
- id: OPENAPI_FORM.FIELD_REQUIRED,
91
+ id: "theme.openapi.form.fieldRequired",
93
92
  message: "This field is required",
94
93
  })
95
94
  : false,
@@ -15,7 +15,6 @@ import FormSelect from "@theme/ApiExplorer/FormSelect";
15
15
  import FormTextInput from "@theme/ApiExplorer/FormTextInput";
16
16
  import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
17
17
  import { useTypedDispatch } from "@theme/ApiItem/hooks";
18
- import { OPENAPI_FORM } from "@theme/translationIds";
19
18
  import { Controller, useFormContext } from "react-hook-form";
20
19
 
21
20
  export interface ParamProps {
@@ -138,7 +137,7 @@ export default function ParamArrayFormItem({
138
137
  rules={{
139
138
  required: param.required
140
139
  ? translate({
141
- id: OPENAPI_FORM.FIELD_REQUIRED,
140
+ id: "theme.openapi.form.fieldRequired",
142
141
  message: "This field is required",
143
142
  })
144
143
  : false,
@@ -177,7 +176,10 @@ export default function ParamArrayFormItem({
177
176
  className="openapi-explorer__thin-btn"
178
177
  onClick={handleAddItem}
179
178
  >
180
- Add item
179
+ {translate({
180
+ id: "theme.openapi.paramArray.addItem",
181
+ message: "Add item",
182
+ })}
181
183
  </button>
182
184
  </>
183
185
  )}
@@ -12,7 +12,6 @@ import { ErrorMessage } from "@hookform/error-message";
12
12
  import FormSelect from "@theme/ApiExplorer/FormSelect";
13
13
  import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
14
14
  import { useTypedDispatch } from "@theme/ApiItem/hooks";
15
- import { OPENAPI_FORM } from "@theme/translationIds";
16
15
  import { Controller, useFormContext } from "react-hook-form";
17
16
 
18
17
  export interface ParamProps {
@@ -60,7 +59,7 @@ export default function ParamBooleanFormItem({
60
59
  rules={{
61
60
  required: param.required
62
61
  ? translate({
63
- id: OPENAPI_FORM.FIELD_REQUIRED,
62
+ id: "theme.openapi.form.fieldRequired",
64
63
  message: "This field is required",
65
64
  })
66
65
  : false,