@gitbook/react-openapi 1.2.1 → 1.3.1

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 (83) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/OpenAPICodeSample.jsx +7 -4
  3. package/dist/OpenAPIDisclosure.d.ts +1 -0
  4. package/dist/OpenAPIDisclosure.jsx +6 -3
  5. package/dist/OpenAPIDisclosureGroup.jsx +16 -15
  6. package/dist/OpenAPIRequestBody.jsx +7 -2
  7. package/dist/OpenAPIRequestBodyHeaderType.d.ts +8 -0
  8. package/dist/OpenAPIRequestBodyHeaderType.jsx +25 -0
  9. package/dist/OpenAPIResponse.d.ts +1 -1
  10. package/dist/OpenAPIResponse.jsx +20 -4
  11. package/dist/OpenAPIResponseExample.jsx +15 -3
  12. package/dist/OpenAPIResponses.jsx +6 -1
  13. package/dist/OpenAPISchema.d.ts +9 -2
  14. package/dist/OpenAPISchema.jsx +87 -91
  15. package/dist/OpenAPISchemaName.d.ts +1 -1
  16. package/dist/OpenAPISchemaName.jsx +5 -5
  17. package/dist/OpenAPISecurities.jsx +59 -1
  18. package/dist/OpenAPISelect.jsx +1 -0
  19. package/dist/OpenAPISpec.jsx +16 -1
  20. package/dist/OpenAPIWebhookExample.jsx +1 -1
  21. package/dist/StaticSection.jsx +1 -1
  22. package/dist/code-samples.js +6 -3
  23. package/dist/generateSchemaExample.js +19 -14
  24. package/dist/getDisclosureLabel.d.ts +7 -0
  25. package/dist/getDisclosureLabel.js +18 -0
  26. package/dist/schemas/OpenAPISchemaItem.d.ts +7 -0
  27. package/dist/schemas/OpenAPISchemaItem.jsx +16 -0
  28. package/dist/schemas/OpenAPISchemas.jsx +3 -9
  29. package/dist/translations/de.d.ts +7 -1
  30. package/dist/translations/de.js +10 -4
  31. package/dist/translations/en.d.ts +7 -1
  32. package/dist/translations/en.js +9 -3
  33. package/dist/translations/es.d.ts +7 -1
  34. package/dist/translations/es.js +10 -4
  35. package/dist/translations/fr.d.ts +7 -1
  36. package/dist/translations/fr.js +11 -5
  37. package/dist/translations/index.d.ts +63 -9
  38. package/dist/translations/ja.d.ts +7 -1
  39. package/dist/translations/ja.js +9 -3
  40. package/dist/translations/nl.d.ts +7 -1
  41. package/dist/translations/nl.js +9 -3
  42. package/dist/translations/no.d.ts +7 -1
  43. package/dist/translations/no.js +10 -4
  44. package/dist/translations/pt-br.d.ts +7 -1
  45. package/dist/translations/pt-br.js +10 -4
  46. package/dist/translations/zh.d.ts +7 -1
  47. package/dist/translations/zh.js +10 -4
  48. package/dist/tsconfig.build.tsbuildinfo +1 -1
  49. package/dist/utils.d.ts +1 -0
  50. package/dist/utils.js +38 -0
  51. package/package.json +2 -2
  52. package/src/OpenAPICodeSample.tsx +7 -6
  53. package/src/OpenAPIDisclosure.tsx +7 -3
  54. package/src/OpenAPIDisclosureGroup.tsx +49 -48
  55. package/src/OpenAPIRequestBody.tsx +11 -2
  56. package/src/OpenAPIRequestBodyHeaderType.tsx +36 -0
  57. package/src/OpenAPIResponse.tsx +37 -5
  58. package/src/OpenAPIResponseExample.tsx +46 -35
  59. package/src/OpenAPIResponses.tsx +4 -4
  60. package/src/OpenAPISchema.tsx +157 -130
  61. package/src/OpenAPISchemaName.tsx +10 -8
  62. package/src/OpenAPISecurities.tsx +111 -7
  63. package/src/OpenAPISelect.tsx +1 -1
  64. package/src/OpenAPISpec.tsx +21 -1
  65. package/src/OpenAPIWebhookExample.tsx +2 -2
  66. package/src/StaticSection.tsx +1 -1
  67. package/src/code-samples.test.ts +3 -2
  68. package/src/code-samples.ts +19 -12
  69. package/src/generateSchemaExample.test.ts +20 -0
  70. package/src/generateSchemaExample.ts +9 -1
  71. package/src/getDisclosureLabel.ts +25 -0
  72. package/src/schemas/OpenAPISchemaItem.tsx +34 -0
  73. package/src/schemas/OpenAPISchemas.tsx +7 -13
  74. package/src/translations/de.ts +10 -4
  75. package/src/translations/en.ts +9 -3
  76. package/src/translations/es.ts +10 -4
  77. package/src/translations/fr.ts +11 -5
  78. package/src/translations/ja.ts +9 -3
  79. package/src/translations/nl.ts +9 -3
  80. package/src/translations/no.ts +10 -4
  81. package/src/translations/pt-br.ts +10 -4
  82. package/src/translations/zh.ts +10 -4
  83. package/src/utils.ts +37 -0
@@ -21,8 +21,10 @@ export declare const translations: {
21
21
  body: string;
22
22
  payload: string;
23
23
  headers: string;
24
+ header: string;
24
25
  authorizations: string;
25
26
  responses: string;
27
+ response: string;
26
28
  path_parameters: string;
27
29
  query_parameters: string;
28
30
  header_parameters: string;
@@ -35,7 +37,11 @@ export declare const translations: {
35
37
  show: string;
36
38
  hide: string;
37
39
  available_items: string;
38
- child_attributes: string;
40
+ available_scopes: string;
41
+ possible_values: string;
42
+ properties: string;
43
+ or: string;
44
+ and: string;
39
45
  };
40
46
  de: {
41
47
  required: string;
@@ -58,8 +64,10 @@ export declare const translations: {
58
64
  body: string;
59
65
  payload: string;
60
66
  headers: string;
67
+ header: string;
61
68
  authorizations: string;
62
69
  responses: string;
70
+ response: string;
63
71
  path_parameters: string;
64
72
  query_parameters: string;
65
73
  header_parameters: string;
@@ -72,7 +80,11 @@ export declare const translations: {
72
80
  show: string;
73
81
  hide: string;
74
82
  available_items: string;
75
- child_attributes: string;
83
+ available_scopes: string;
84
+ properties: string;
85
+ or: string;
86
+ and: string;
87
+ possible_values: string;
76
88
  };
77
89
  es: {
78
90
  required: string;
@@ -95,8 +107,10 @@ export declare const translations: {
95
107
  body: string;
96
108
  payload: string;
97
109
  headers: string;
110
+ header: string;
98
111
  authorizations: string;
99
112
  responses: string;
113
+ response: string;
100
114
  path_parameters: string;
101
115
  query_parameters: string;
102
116
  header_parameters: string;
@@ -109,7 +123,11 @@ export declare const translations: {
109
123
  show: string;
110
124
  hide: string;
111
125
  available_items: string;
112
- child_attributes: string;
126
+ available_scopes: string;
127
+ properties: string;
128
+ or: string;
129
+ and: string;
130
+ possible_values: string;
113
131
  };
114
132
  fr: {
115
133
  required: string;
@@ -132,8 +150,10 @@ export declare const translations: {
132
150
  body: string;
133
151
  payload: string;
134
152
  headers: string;
153
+ header: string;
135
154
  authorizations: string;
136
155
  responses: string;
156
+ response: string;
137
157
  path_parameters: string;
138
158
  query_parameters: string;
139
159
  header_parameters: string;
@@ -146,7 +166,11 @@ export declare const translations: {
146
166
  show: string;
147
167
  hide: string;
148
168
  available_items: string;
149
- child_attributes: string;
169
+ available_scopes: string;
170
+ properties: string;
171
+ or: string;
172
+ and: string;
173
+ possible_values: string;
150
174
  };
151
175
  ja: {
152
176
  required: string;
@@ -169,8 +193,10 @@ export declare const translations: {
169
193
  body: string;
170
194
  payload: string;
171
195
  headers: string;
196
+ header: string;
172
197
  authorizations: string;
173
198
  responses: string;
199
+ response: string;
174
200
  path_parameters: string;
175
201
  query_parameters: string;
176
202
  header_parameters: string;
@@ -183,7 +209,11 @@ export declare const translations: {
183
209
  show: string;
184
210
  hide: string;
185
211
  available_items: string;
186
- child_attributes: string;
212
+ available_scopes: string;
213
+ properties: string;
214
+ or: string;
215
+ and: string;
216
+ possible_values: string;
187
217
  };
188
218
  nl: {
189
219
  required: string;
@@ -206,8 +236,10 @@ export declare const translations: {
206
236
  body: string;
207
237
  payload: string;
208
238
  headers: string;
239
+ header: string;
209
240
  authorizations: string;
210
241
  responses: string;
242
+ response: string;
211
243
  path_parameters: string;
212
244
  query_parameters: string;
213
245
  header_parameters: string;
@@ -220,7 +252,11 @@ export declare const translations: {
220
252
  show: string;
221
253
  hide: string;
222
254
  available_items: string;
223
- child_attributes: string;
255
+ available_scopes: string;
256
+ properties: string;
257
+ or: string;
258
+ and: string;
259
+ possible_values: string;
224
260
  };
225
261
  no: {
226
262
  required: string;
@@ -243,8 +279,10 @@ export declare const translations: {
243
279
  body: string;
244
280
  payload: string;
245
281
  headers: string;
282
+ header: string;
246
283
  authorizations: string;
247
284
  responses: string;
285
+ response: string;
248
286
  path_parameters: string;
249
287
  query_parameters: string;
250
288
  header_parameters: string;
@@ -257,7 +295,11 @@ export declare const translations: {
257
295
  show: string;
258
296
  hide: string;
259
297
  available_items: string;
260
- child_attributes: string;
298
+ available_scopes: string;
299
+ properties: string;
300
+ or: string;
301
+ and: string;
302
+ possible_values: string;
261
303
  };
262
304
  'pt-br': {
263
305
  required: string;
@@ -280,8 +322,10 @@ export declare const translations: {
280
322
  body: string;
281
323
  payload: string;
282
324
  headers: string;
325
+ header: string;
283
326
  authorizations: string;
284
327
  responses: string;
328
+ response: string;
285
329
  path_parameters: string;
286
330
  query_parameters: string;
287
331
  header_parameters: string;
@@ -294,7 +338,11 @@ export declare const translations: {
294
338
  show: string;
295
339
  hide: string;
296
340
  available_items: string;
297
- child_attributes: string;
341
+ available_scopes: string;
342
+ properties: string;
343
+ or: string;
344
+ and: string;
345
+ possible_values: string;
298
346
  };
299
347
  zh: {
300
348
  required: string;
@@ -317,8 +365,10 @@ export declare const translations: {
317
365
  body: string;
318
366
  payload: string;
319
367
  headers: string;
368
+ header: string;
320
369
  authorizations: string;
321
370
  responses: string;
371
+ response: string;
322
372
  path_parameters: string;
323
373
  query_parameters: string;
324
374
  header_parameters: string;
@@ -331,7 +381,11 @@ export declare const translations: {
331
381
  show: string;
332
382
  hide: string;
333
383
  available_items: string;
334
- child_attributes: string;
384
+ available_scopes: string;
385
+ properties: string;
386
+ or: string;
387
+ and: string;
388
+ possible_values: string;
335
389
  };
336
390
  };
337
391
  export type TranslationLocale = keyof typeof translations;
@@ -19,8 +19,10 @@ export declare const ja: {
19
19
  body: string;
20
20
  payload: string;
21
21
  headers: string;
22
+ header: string;
22
23
  authorizations: string;
23
24
  responses: string;
25
+ response: string;
24
26
  path_parameters: string;
25
27
  query_parameters: string;
26
28
  header_parameters: string;
@@ -33,5 +35,9 @@ export declare const ja: {
33
35
  show: string;
34
36
  hide: string;
35
37
  available_items: string;
36
- child_attributes: string;
38
+ available_scopes: string;
39
+ properties: string;
40
+ or: string;
41
+ and: string;
42
+ possible_values: string;
37
43
  };
@@ -19,8 +19,10 @@ export var ja = {
19
19
  body: '本文',
20
20
  payload: 'ペイロード',
21
21
  headers: 'ヘッダー',
22
+ header: 'ヘッダー',
22
23
  authorizations: '認可',
23
24
  responses: 'レスポンス',
25
+ response: 'レスポンス',
24
26
  path_parameters: 'パスパラメータ',
25
27
  query_parameters: 'クエリパラメータ',
26
28
  header_parameters: 'ヘッダーパラメータ',
@@ -30,8 +32,12 @@ export var ja = {
30
32
  success: '成功',
31
33
  redirect: 'リダイレクト',
32
34
  error: 'エラー',
33
- show: '表示',
34
- hide: '非表示',
35
+ show: '${1}を表示',
36
+ hide: '${1}を非表示',
35
37
  available_items: '利用可能なアイテム',
36
- child_attributes: '子属性',
38
+ available_scopes: '利用可能なスコープ',
39
+ properties: 'プロパティ',
40
+ or: 'または',
41
+ and: 'かつ',
42
+ possible_values: '可能な値',
37
43
  };
@@ -19,8 +19,10 @@ export declare const nl: {
19
19
  body: string;
20
20
  payload: string;
21
21
  headers: string;
22
+ header: string;
22
23
  authorizations: string;
23
24
  responses: string;
25
+ response: string;
24
26
  path_parameters: string;
25
27
  query_parameters: string;
26
28
  header_parameters: string;
@@ -33,5 +35,9 @@ export declare const nl: {
33
35
  show: string;
34
36
  hide: string;
35
37
  available_items: string;
36
- child_attributes: string;
38
+ available_scopes: string;
39
+ properties: string;
40
+ or: string;
41
+ and: string;
42
+ possible_values: string;
37
43
  };
@@ -19,8 +19,10 @@ export var nl = {
19
19
  body: 'Body',
20
20
  payload: 'Payload',
21
21
  headers: 'Headers',
22
+ header: 'Header',
22
23
  authorizations: 'Autorisaties',
23
24
  responses: 'Reacties',
25
+ response: 'Reactie',
24
26
  path_parameters: 'Padparameters',
25
27
  query_parameters: 'Queryparameters',
26
28
  header_parameters: 'Headerparameters',
@@ -30,8 +32,12 @@ export var nl = {
30
32
  success: 'Succes',
31
33
  redirect: 'Omleiding',
32
34
  error: 'Fout',
33
- show: 'Toon',
34
- hide: 'Verbergen',
35
+ show: 'Toon ${1}',
36
+ hide: 'Verberg ${1}',
35
37
  available_items: 'Beschikbare items',
36
- child_attributes: 'Kindattributen',
38
+ available_scopes: 'Beschikbare scopes',
39
+ properties: 'Eigenschappen',
40
+ or: 'of',
41
+ and: 'en',
42
+ possible_values: 'Mogelijke waarden',
37
43
  };
@@ -19,8 +19,10 @@ export declare const no: {
19
19
  body: string;
20
20
  payload: string;
21
21
  headers: string;
22
+ header: string;
22
23
  authorizations: string;
23
24
  responses: string;
25
+ response: string;
24
26
  path_parameters: string;
25
27
  query_parameters: string;
26
28
  header_parameters: string;
@@ -33,5 +35,9 @@ export declare const no: {
33
35
  show: string;
34
36
  hide: string;
35
37
  available_items: string;
36
- child_attributes: string;
38
+ available_scopes: string;
39
+ properties: string;
40
+ or: string;
41
+ and: string;
42
+ possible_values: string;
37
43
  };
@@ -18,9 +18,11 @@ export var no = {
18
18
  nullable: 'Kan være null',
19
19
  body: 'Brødtekst',
20
20
  payload: 'Nyttelast',
21
- headers: 'Overskrifter',
21
+ headers: 'Headers',
22
+ header: 'Header',
22
23
  authorizations: 'Autorisasjoner',
23
24
  responses: 'Responser',
25
+ response: 'Respons',
24
26
  path_parameters: 'Sti-parametere',
25
27
  query_parameters: 'Forespørselsparametere',
26
28
  header_parameters: 'Header-parametere',
@@ -30,8 +32,12 @@ export var no = {
30
32
  success: 'Suksess',
31
33
  redirect: 'Viderekobling',
32
34
  error: 'Feil',
33
- show: 'Vis',
34
- hide: 'Skjul',
35
+ show: 'Vis ${1}',
36
+ hide: 'Skjul ${1}',
35
37
  available_items: 'Tilgjengelige elementer',
36
- child_attributes: 'Barneattributter',
38
+ available_scopes: 'Tilgjengelige scopes',
39
+ properties: 'Egenskaper',
40
+ or: 'eller',
41
+ and: 'og',
42
+ possible_values: 'Mulige verdier',
37
43
  };
@@ -19,8 +19,10 @@ export declare const pt_br: {
19
19
  body: string;
20
20
  payload: string;
21
21
  headers: string;
22
+ header: string;
22
23
  authorizations: string;
23
24
  responses: string;
25
+ response: string;
24
26
  path_parameters: string;
25
27
  query_parameters: string;
26
28
  header_parameters: string;
@@ -33,5 +35,9 @@ export declare const pt_br: {
33
35
  show: string;
34
36
  hide: string;
35
37
  available_items: string;
36
- child_attributes: string;
38
+ available_scopes: string;
39
+ properties: string;
40
+ or: string;
41
+ and: string;
42
+ possible_values: string;
37
43
  };
@@ -18,9 +18,11 @@ export var pt_br = {
18
18
  nullable: 'Nulo',
19
19
  body: 'Corpo',
20
20
  payload: 'Carga útil',
21
- headers: 'Cabeçalhos',
21
+ headers: 'Headers',
22
+ header: 'Header',
22
23
  authorizations: 'Autorizações',
23
24
  responses: 'Respostas',
25
+ response: 'Resposta',
24
26
  path_parameters: 'Parâmetros de rota',
25
27
  query_parameters: 'Parâmetros de consulta',
26
28
  header_parameters: 'Parâmetros de cabeçalho',
@@ -30,8 +32,12 @@ export var pt_br = {
30
32
  success: 'Sucesso',
31
33
  redirect: 'Redirecionamento',
32
34
  error: 'Erro',
33
- show: 'Mostrar',
34
- hide: 'Ocultar',
35
+ show: 'Mostrar ${1}',
36
+ hide: 'Ocultar ${1}',
35
37
  available_items: 'Itens disponíveis',
36
- child_attributes: 'Atributos filhos',
38
+ available_scopes: 'Scopes disponíveis',
39
+ properties: 'Propriedades',
40
+ or: 'ou',
41
+ and: 'e',
42
+ possible_values: 'Valores possíveis',
37
43
  };
@@ -19,8 +19,10 @@ export declare const zh: {
19
19
  body: string;
20
20
  payload: string;
21
21
  headers: string;
22
+ header: string;
22
23
  authorizations: string;
23
24
  responses: string;
25
+ response: string;
24
26
  path_parameters: string;
25
27
  query_parameters: string;
26
28
  header_parameters: string;
@@ -33,5 +35,9 @@ export declare const zh: {
33
35
  show: string;
34
36
  hide: string;
35
37
  available_items: string;
36
- child_attributes: string;
38
+ available_scopes: string;
39
+ properties: string;
40
+ or: string;
41
+ and: string;
42
+ possible_values: string;
37
43
  };
@@ -18,9 +18,11 @@ export var zh = {
18
18
  nullable: '可为 null',
19
19
  body: '请求体',
20
20
  payload: '有效载荷',
21
- headers: '头部信息',
21
+ headers: '头字段',
22
+ header: '头部',
22
23
  authorizations: '授权',
23
24
  responses: '响应',
25
+ response: '响应',
24
26
  path_parameters: '路径参数',
25
27
  query_parameters: '查询参数',
26
28
  header_parameters: '头参数',
@@ -30,8 +32,12 @@ export var zh = {
30
32
  success: '成功',
31
33
  redirect: '重定向',
32
34
  error: '错误',
33
- show: '显示',
34
- hide: '隐藏',
35
+ show: '显示${1}',
36
+ hide: '隐藏${1}',
35
37
  available_items: '可用项',
36
- child_attributes: '子属性',
38
+ available_scopes: '可用范围',
39
+ properties: '属性',
40
+ or: '或',
41
+ and: '和',
42
+ possible_values: '可能的值',
37
43
  };