@gitbook/react-openapi 1.4.3 → 1.5.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 (225) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/index.d.ts +663 -10
  3. package/dist/index.js +3873 -8
  4. package/package.json +11 -7
  5. package/dist/InteractiveSection.d.ts +0 -33
  6. package/dist/InteractiveSection.jsx +0 -61
  7. package/dist/Markdown.d.ts +0 -4
  8. package/dist/Markdown.jsx +0 -5
  9. package/dist/OpenAPICodeSample.d.ts +0 -19
  10. package/dist/OpenAPICodeSample.jsx +0 -230
  11. package/dist/OpenAPICodeSampleInteractive.d.ts +0 -14
  12. package/dist/OpenAPICodeSampleInteractive.jsx +0 -73
  13. package/dist/OpenAPICodeSampleSelector.d.ts +0 -14
  14. package/dist/OpenAPICodeSampleSelector.jsx +0 -44
  15. package/dist/OpenAPICopyButton.d.ts +0 -13
  16. package/dist/OpenAPICopyButton.jsx +0 -35
  17. package/dist/OpenAPIDisclosure.d.ts +0 -11
  18. package/dist/OpenAPIDisclosure.jsx +0 -30
  19. package/dist/OpenAPIDisclosureGroup.d.ts +0 -23
  20. package/dist/OpenAPIDisclosureGroup.jsx +0 -83
  21. package/dist/OpenAPIExample.d.ts +0 -16
  22. package/dist/OpenAPIExample.jsx +0 -36
  23. package/dist/OpenAPIMediaType.d.ts +0 -21
  24. package/dist/OpenAPIMediaType.jsx +0 -61
  25. package/dist/OpenAPIOperation.d.ts +0 -10
  26. package/dist/OpenAPIOperation.jsx +0 -25
  27. package/dist/OpenAPIOperationContext.d.ts +0 -16
  28. package/dist/OpenAPIOperationContext.jsx +0 -26
  29. package/dist/OpenAPIOperationDescription.d.ts +0 -9
  30. package/dist/OpenAPIOperationDescription.jsx +0 -22
  31. package/dist/OpenAPIOperationStability.d.ts +0 -9
  32. package/dist/OpenAPIOperationStability.jsx +0 -27
  33. package/dist/OpenAPIPath.d.ts +0 -18
  34. package/dist/OpenAPIPath.jsx +0 -55
  35. package/dist/OpenAPIPrefillContextProvider.d.ts +0 -22
  36. package/dist/OpenAPIPrefillContextProvider.jsx +0 -19
  37. package/dist/OpenAPIRequestBody.d.ts +0 -11
  38. package/dist/OpenAPIRequestBody.jsx +0 -28
  39. package/dist/OpenAPIRequestBodyHeaderType.d.ts +0 -8
  40. package/dist/OpenAPIRequestBodyHeaderType.jsx +0 -25
  41. package/dist/OpenAPIResponse.d.ts +0 -10
  42. package/dist/OpenAPIResponse.jsx +0 -57
  43. package/dist/OpenAPIResponseExample.d.ts +0 -9
  44. package/dist/OpenAPIResponseExample.jsx +0 -105
  45. package/dist/OpenAPIResponseExampleContent.d.ts +0 -22
  46. package/dist/OpenAPIResponseExampleContent.jsx +0 -60
  47. package/dist/OpenAPIResponses.d.ts +0 -9
  48. package/dist/OpenAPIResponses.jsx +0 -77
  49. package/dist/OpenAPISchema.d.ts +0 -27
  50. package/dist/OpenAPISchema.jsx +0 -400
  51. package/dist/OpenAPISchemaName.d.ts +0 -16
  52. package/dist/OpenAPISchemaName.jsx +0 -43
  53. package/dist/OpenAPISchemaServer.d.ts +0 -12
  54. package/dist/OpenAPISchemaServer.jsx +0 -8
  55. package/dist/OpenAPISecurities.d.ts +0 -9
  56. package/dist/OpenAPISecurities.jsx +0 -114
  57. package/dist/OpenAPISelect.d.ts +0 -22
  58. package/dist/OpenAPISelect.jsx +0 -44
  59. package/dist/OpenAPISpec.d.ts +0 -6
  60. package/dist/OpenAPISpec.jsx +0 -80
  61. package/dist/OpenAPITabs.d.ts +0 -26
  62. package/dist/OpenAPITabs.jsx +0 -109
  63. package/dist/OpenAPIWebhook.d.ts +0 -10
  64. package/dist/OpenAPIWebhook.jsx +0 -23
  65. package/dist/OpenAPIWebhookExample.d.ts +0 -6
  66. package/dist/OpenAPIWebhookExample.jsx +0 -41
  67. package/dist/ScalarApiButton.d.ts +0 -14
  68. package/dist/ScalarApiButton.jsx +0 -81
  69. package/dist/StaticSection.d.ts +0 -13
  70. package/dist/StaticSection.jsx +0 -32
  71. package/dist/code-samples.d.ts +0 -17
  72. package/dist/code-samples.js +0 -427
  73. package/dist/common/OpenAPIColumnSpec.d.ts +0 -6
  74. package/dist/common/OpenAPIColumnSpec.jsx +0 -20
  75. package/dist/common/OpenAPIOperationDescription.d.ts +0 -6
  76. package/dist/common/OpenAPIOperationDescription.jsx +0 -19
  77. package/dist/common/OpenAPIStability.d.ts +0 -4
  78. package/dist/common/OpenAPIStability.jsx +0 -15
  79. package/dist/common/OpenAPISummary.d.ts +0 -6
  80. package/dist/common/OpenAPISummary.jsx +0 -30
  81. package/dist/contentTypeChecks.d.ts +0 -10
  82. package/dist/contentTypeChecks.js +0 -30
  83. package/dist/context.d.ts +0 -75
  84. package/dist/context.js +0 -43
  85. package/dist/decycle.d.ts +0 -2
  86. package/dist/decycle.js +0 -70
  87. package/dist/dereference.d.ts +0 -5
  88. package/dist/dereference.js +0 -68
  89. package/dist/generateSchemaExample.d.ts +0 -45
  90. package/dist/generateSchemaExample.js +0 -342
  91. package/dist/getDisclosureLabel.d.ts +0 -7
  92. package/dist/getDisclosureLabel.js +0 -18
  93. package/dist/getOrCreateStoreByKey.d.ts +0 -10
  94. package/dist/getOrCreateStoreByKey.js +0 -19
  95. package/dist/json2xml.d.ts +0 -4
  96. package/dist/json2xml.js +0 -7
  97. package/dist/resolveOpenAPIOperation.d.ts +0 -11
  98. package/dist/resolveOpenAPIOperation.js +0 -173
  99. package/dist/resolveOpenAPIWebhook.d.ts +0 -11
  100. package/dist/resolveOpenAPIWebhook.js +0 -127
  101. package/dist/schemas/OpenAPISchemaItem.d.ts +0 -7
  102. package/dist/schemas/OpenAPISchemaItem.jsx +0 -16
  103. package/dist/schemas/OpenAPISchemas.d.ts +0 -14
  104. package/dist/schemas/OpenAPISchemas.jsx +0 -59
  105. package/dist/schemas/index.d.ts +0 -2
  106. package/dist/schemas/index.js +0 -2
  107. package/dist/schemas/resolveOpenAPISchemas.d.ts +0 -10
  108. package/dist/schemas/resolveOpenAPISchemas.js +0 -61
  109. package/dist/stringifyOpenAPI.d.ts +0 -4
  110. package/dist/stringifyOpenAPI.js +0 -15
  111. package/dist/translate.d.ts +0 -10
  112. package/dist/translate.jsx +0 -75
  113. package/dist/translations/de.d.ts +0 -43
  114. package/dist/translations/de.js +0 -43
  115. package/dist/translations/en.d.ts +0 -43
  116. package/dist/translations/en.js +0 -43
  117. package/dist/translations/es.d.ts +0 -43
  118. package/dist/translations/es.js +0 -43
  119. package/dist/translations/fr.d.ts +0 -43
  120. package/dist/translations/fr.js +0 -43
  121. package/dist/translations/index.d.ts +0 -395
  122. package/dist/translations/index.js +0 -27
  123. package/dist/translations/ja.d.ts +0 -43
  124. package/dist/translations/ja.js +0 -43
  125. package/dist/translations/nl.d.ts +0 -43
  126. package/dist/translations/nl.js +0 -43
  127. package/dist/translations/no.d.ts +0 -43
  128. package/dist/translations/no.js +0 -43
  129. package/dist/translations/pt-br.d.ts +0 -43
  130. package/dist/translations/pt-br.js +0 -43
  131. package/dist/translations/types.d.ts +0 -5
  132. package/dist/translations/types.js +0 -1
  133. package/dist/translations/zh.d.ts +0 -43
  134. package/dist/translations/zh.js +0 -43
  135. package/dist/tsconfig.build.tsbuildinfo +0 -1
  136. package/dist/types.d.ts +0 -31
  137. package/dist/types.js +0 -1
  138. package/dist/util/example.d.ts +0 -35
  139. package/dist/util/example.jsx +0 -103
  140. package/dist/util/server.d.ts +0 -9
  141. package/dist/util/server.js +0 -44
  142. package/dist/util/tryit-prefill.d.ts +0 -20
  143. package/dist/util/tryit-prefill.js +0 -129
  144. package/dist/utils.d.ts +0 -50
  145. package/dist/utils.js +0 -224
  146. package/src/InteractiveSection.tsx +0 -147
  147. package/src/Markdown.tsx +0 -12
  148. package/src/OpenAPICodeSample.tsx +0 -330
  149. package/src/OpenAPICodeSampleInteractive.tsx +0 -136
  150. package/src/OpenAPICodeSampleSelector.tsx +0 -94
  151. package/src/OpenAPICopyButton.tsx +0 -72
  152. package/src/OpenAPIDisclosure.tsx +0 -46
  153. package/src/OpenAPIDisclosureGroup.tsx +0 -158
  154. package/src/OpenAPIExample.tsx +0 -55
  155. package/src/OpenAPIMediaType.tsx +0 -139
  156. package/src/OpenAPIOperation.tsx +0 -35
  157. package/src/OpenAPIOperationContext.tsx +0 -45
  158. package/src/OpenAPIOperationDescription.tsx +0 -34
  159. package/src/OpenAPIOperationStability.tsx +0 -39
  160. package/src/OpenAPIPath.tsx +0 -90
  161. package/src/OpenAPIPrefillContextProvider.tsx +0 -40
  162. package/src/OpenAPIRequestBody.tsx +0 -54
  163. package/src/OpenAPIRequestBodyHeaderType.tsx +0 -36
  164. package/src/OpenAPIResponse.tsx +0 -82
  165. package/src/OpenAPIResponseExample.tsx +0 -151
  166. package/src/OpenAPIResponseExampleContent.tsx +0 -125
  167. package/src/OpenAPIResponses.tsx +0 -125
  168. package/src/OpenAPISchema.test.ts +0 -172
  169. package/src/OpenAPISchema.tsx +0 -654
  170. package/src/OpenAPISchemaName.tsx +0 -80
  171. package/src/OpenAPISchemaServer.tsx +0 -34
  172. package/src/OpenAPISecurities.tsx +0 -231
  173. package/src/OpenAPISelect.tsx +0 -96
  174. package/src/OpenAPISpec.tsx +0 -138
  175. package/src/OpenAPITabs.tsx +0 -147
  176. package/src/OpenAPIWebhook.tsx +0 -33
  177. package/src/OpenAPIWebhookExample.tsx +0 -60
  178. package/src/ScalarApiButton.tsx +0 -132
  179. package/src/StaticSection.tsx +0 -91
  180. package/src/__snapshots__/json2xml.test.ts.snap +0 -18
  181. package/src/code-samples.test.ts +0 -714
  182. package/src/code-samples.ts +0 -448
  183. package/src/common/OpenAPIColumnSpec.tsx +0 -31
  184. package/src/common/OpenAPIOperationDescription.tsx +0 -31
  185. package/src/common/OpenAPIStability.tsx +0 -23
  186. package/src/common/OpenAPISummary.tsx +0 -45
  187. package/src/contentTypeChecks.ts +0 -39
  188. package/src/context.ts +0 -99
  189. package/src/decycle.ts +0 -68
  190. package/src/dereference.ts +0 -29
  191. package/src/generateSchemaExample.test.ts +0 -1040
  192. package/src/generateSchemaExample.ts +0 -530
  193. package/src/getDisclosureLabel.ts +0 -25
  194. package/src/getOrCreateStoreByKey.ts +0 -33
  195. package/src/index.ts +0 -10
  196. package/src/json2xml.test.ts +0 -46
  197. package/src/json2xml.ts +0 -8
  198. package/src/resolveOpenAPIOperation.test.ts +0 -177
  199. package/src/resolveOpenAPIOperation.ts +0 -151
  200. package/src/resolveOpenAPIWebhook.ts +0 -99
  201. package/src/schemas/OpenAPISchemaItem.tsx +0 -34
  202. package/src/schemas/OpenAPISchemas.tsx +0 -98
  203. package/src/schemas/index.ts +0 -2
  204. package/src/schemas/resolveOpenAPISchemas.test.ts +0 -174
  205. package/src/schemas/resolveOpenAPISchemas.ts +0 -28
  206. package/src/stringifyOpenAPI.ts +0 -25
  207. package/src/translate.tsx +0 -80
  208. package/src/translations/de.ts +0 -43
  209. package/src/translations/en.ts +0 -43
  210. package/src/translations/es.ts +0 -43
  211. package/src/translations/fr.ts +0 -43
  212. package/src/translations/index.ts +0 -33
  213. package/src/translations/ja.ts +0 -43
  214. package/src/translations/nl.ts +0 -43
  215. package/src/translations/no.ts +0 -43
  216. package/src/translations/pt-br.ts +0 -43
  217. package/src/translations/types.ts +0 -7
  218. package/src/translations/zh.ts +0 -43
  219. package/src/types.ts +0 -46
  220. package/src/util/example.tsx +0 -129
  221. package/src/util/server.test.ts +0 -58
  222. package/src/util/server.ts +0 -47
  223. package/src/util/tryit-prefill.test.ts +0 -311
  224. package/src/util/tryit-prefill.ts +0 -160
  225. package/src/utils.ts +0 -255
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @gitbook/react-openapi
2
2
 
3
+ ## 1.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 295f03d: Republish packages
8
+ - Updated dependencies [295f03d]
9
+ - @gitbook/expr@1.2.2
10
+ - @gitbook/openapi-parser@3.0.3
11
+
12
+ ## 1.5.0
13
+
14
+ ### Minor Changes
15
+
16
+ - 529f940: Fix OpenAPISecurities and code sample not using operation security requirements
17
+
18
+ ### Patch Changes
19
+
20
+ - eea8f1e: Enhance OpenAPI security scopes handling
21
+ - 8e99871: Highlight discriminator properties in oneOf, allOf, anyOf objects
22
+ - f3e4041: Adapt OpenAPI code samples to prefill API key using visitor data
23
+ - 319a1e5: Ensure operation security requirements inherits from spec-level when not defined
24
+ - 754cc11: Fix merge logic for allOf alternatives
25
+ - d7948e3: Fix OpenAPI response showing as JSON instead of YAML when it should
26
+ - a4c3399: Fix OpenAPI alternatives not showing
27
+ - Updated dependencies [a629900]
28
+ - @gitbook/expr@1.2.1
29
+
3
30
  ## 1.4.3
4
31
 
5
32
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,10 +1,663 @@
1
- export * from './schemas';
2
- export * from './OpenAPIOperation';
3
- export * from './OpenAPIWebhook';
4
- export * from './OpenAPIOperationContext';
5
- export * from './OpenAPIPrefillContextProvider';
6
- export * from './resolveOpenAPIOperation';
7
- export * from './resolveOpenAPIWebhook';
8
- export type { OpenAPIOperationData, OpenAPIWebhookData } from './types';
9
- export type { OpenAPIContextInput } from './context';
10
- export { checkIsValidLocale } from './translations';
1
+ import * as react2 from "react";
2
+ import { Filesystem, OpenAPICustomOperationProperties, OpenAPICustomPrefillProperties, OpenAPICustomSpecProperties, OpenAPISchema, OpenAPIV3, OpenAPIV3xDocument } from "@gitbook/openapi-parser";
3
+ import "flatted";
4
+
5
+ //#region src/translations/en.d.ts
6
+ declare const en: {
7
+ required: string;
8
+ deprecated: string;
9
+ deprecated_and_sunset_on: string;
10
+ stability_experimental: string;
11
+ stability_alpha: string;
12
+ stability_beta: string;
13
+ discriminator: string;
14
+ copy_to_clipboard: string;
15
+ copied: string;
16
+ no_content: string;
17
+ unresolved_reference: string;
18
+ circular_reference: string;
19
+ read_only: string;
20
+ write_only: string;
21
+ optional: string;
22
+ min: string;
23
+ max: string;
24
+ nullable: string;
25
+ body: string;
26
+ payload: string;
27
+ headers: string;
28
+ header: string;
29
+ authorizations: string;
30
+ responses: string;
31
+ response: string;
32
+ path_parameters: string;
33
+ query_parameters: string;
34
+ header_parameters: string;
35
+ attributes: string;
36
+ test_it: string;
37
+ information: string;
38
+ success: string;
39
+ redirect: string;
40
+ error: string;
41
+ show: string;
42
+ hide: string;
43
+ available_items: string;
44
+ required_scopes: string;
45
+ possible_values: string;
46
+ properties: string;
47
+ or: string;
48
+ and: string;
49
+ };
50
+ //#endregion
51
+ //#region src/translations/types.d.ts
52
+ type TranslationKey = keyof typeof en;
53
+ type Translation = { [key in TranslationKey]: string };
54
+ //#endregion
55
+ //#region src/translations/index.d.ts
56
+ declare const translations: {
57
+ en: {
58
+ required: string;
59
+ deprecated: string;
60
+ deprecated_and_sunset_on: string;
61
+ stability_experimental: string;
62
+ stability_alpha: string;
63
+ stability_beta: string;
64
+ discriminator: string;
65
+ copy_to_clipboard: string;
66
+ copied: string;
67
+ no_content: string;
68
+ unresolved_reference: string;
69
+ circular_reference: string;
70
+ read_only: string;
71
+ write_only: string;
72
+ optional: string;
73
+ min: string;
74
+ max: string;
75
+ nullable: string;
76
+ body: string;
77
+ payload: string;
78
+ headers: string;
79
+ header: string;
80
+ authorizations: string;
81
+ responses: string;
82
+ response: string;
83
+ path_parameters: string;
84
+ query_parameters: string;
85
+ header_parameters: string;
86
+ attributes: string;
87
+ test_it: string;
88
+ information: string;
89
+ success: string;
90
+ redirect: string;
91
+ error: string;
92
+ show: string;
93
+ hide: string;
94
+ available_items: string;
95
+ required_scopes: string;
96
+ possible_values: string;
97
+ properties: string;
98
+ or: string;
99
+ and: string;
100
+ };
101
+ de: {
102
+ required: string;
103
+ deprecated: string;
104
+ deprecated_and_sunset_on: string;
105
+ stability_experimental: string;
106
+ stability_alpha: string;
107
+ stability_beta: string;
108
+ discriminator: string;
109
+ copy_to_clipboard: string;
110
+ copied: string;
111
+ no_content: string;
112
+ unresolved_reference: string;
113
+ circular_reference: string;
114
+ read_only: string;
115
+ write_only: string;
116
+ optional: string;
117
+ min: string;
118
+ max: string;
119
+ nullable: string;
120
+ body: string;
121
+ payload: string;
122
+ headers: string;
123
+ header: string;
124
+ authorizations: string;
125
+ responses: string;
126
+ response: string;
127
+ path_parameters: string;
128
+ query_parameters: string;
129
+ header_parameters: string;
130
+ attributes: string;
131
+ test_it: string;
132
+ information: string;
133
+ success: string;
134
+ redirect: string;
135
+ error: string;
136
+ show: string;
137
+ hide: string;
138
+ available_items: string;
139
+ required_scopes: string;
140
+ properties: string;
141
+ or: string;
142
+ and: string;
143
+ possible_values: string;
144
+ };
145
+ es: {
146
+ required: string;
147
+ deprecated: string;
148
+ deprecated_and_sunset_on: string;
149
+ stability_experimental: string;
150
+ stability_alpha: string;
151
+ stability_beta: string;
152
+ discriminator: string;
153
+ copy_to_clipboard: string;
154
+ copied: string;
155
+ no_content: string;
156
+ unresolved_reference: string;
157
+ circular_reference: string;
158
+ read_only: string;
159
+ write_only: string;
160
+ optional: string;
161
+ min: string;
162
+ max: string;
163
+ nullable: string;
164
+ body: string;
165
+ payload: string;
166
+ headers: string;
167
+ header: string;
168
+ authorizations: string;
169
+ responses: string;
170
+ response: string;
171
+ path_parameters: string;
172
+ query_parameters: string;
173
+ header_parameters: string;
174
+ attributes: string;
175
+ test_it: string;
176
+ information: string;
177
+ success: string;
178
+ redirect: string;
179
+ error: string;
180
+ show: string;
181
+ hide: string;
182
+ available_items: string;
183
+ required_scopes: string;
184
+ properties: string;
185
+ or: string;
186
+ and: string;
187
+ possible_values: string;
188
+ };
189
+ fr: {
190
+ required: string;
191
+ deprecated: string;
192
+ deprecated_and_sunset_on: string;
193
+ stability_experimental: string;
194
+ stability_alpha: string;
195
+ stability_beta: string;
196
+ discriminator: string;
197
+ copy_to_clipboard: string;
198
+ copied: string;
199
+ no_content: string;
200
+ unresolved_reference: string;
201
+ circular_reference: string;
202
+ read_only: string;
203
+ write_only: string;
204
+ optional: string;
205
+ min: string;
206
+ max: string;
207
+ nullable: string;
208
+ body: string;
209
+ payload: string;
210
+ headers: string;
211
+ header: string;
212
+ authorizations: string;
213
+ responses: string;
214
+ response: string;
215
+ path_parameters: string;
216
+ query_parameters: string;
217
+ header_parameters: string;
218
+ attributes: string;
219
+ test_it: string;
220
+ information: string;
221
+ success: string;
222
+ redirect: string;
223
+ error: string;
224
+ show: string;
225
+ hide: string;
226
+ available_items: string;
227
+ required_scopes: string;
228
+ properties: string;
229
+ or: string;
230
+ and: string;
231
+ possible_values: string;
232
+ };
233
+ ja: {
234
+ required: string;
235
+ deprecated: string;
236
+ deprecated_and_sunset_on: string;
237
+ stability_experimental: string;
238
+ stability_alpha: string;
239
+ stability_beta: string;
240
+ discriminator: string;
241
+ copy_to_clipboard: string;
242
+ copied: string;
243
+ no_content: string;
244
+ unresolved_reference: string;
245
+ circular_reference: string;
246
+ read_only: string;
247
+ write_only: string;
248
+ optional: string;
249
+ min: string;
250
+ max: string;
251
+ nullable: string;
252
+ body: string;
253
+ payload: string;
254
+ headers: string;
255
+ header: string;
256
+ authorizations: string;
257
+ responses: string;
258
+ response: string;
259
+ path_parameters: string;
260
+ query_parameters: string;
261
+ header_parameters: string;
262
+ attributes: string;
263
+ test_it: string;
264
+ information: string;
265
+ success: string;
266
+ redirect: string;
267
+ error: string;
268
+ show: string;
269
+ hide: string;
270
+ available_items: string;
271
+ required_scopes: string;
272
+ properties: string;
273
+ or: string;
274
+ and: string;
275
+ possible_values: string;
276
+ };
277
+ nl: {
278
+ required: string;
279
+ deprecated: string;
280
+ deprecated_and_sunset_on: string;
281
+ stability_experimental: string;
282
+ stability_alpha: string;
283
+ stability_beta: string;
284
+ discriminator: string;
285
+ copy_to_clipboard: string;
286
+ copied: string;
287
+ no_content: string;
288
+ unresolved_reference: string;
289
+ circular_reference: string;
290
+ read_only: string;
291
+ write_only: string;
292
+ optional: string;
293
+ min: string;
294
+ max: string;
295
+ nullable: string;
296
+ body: string;
297
+ payload: string;
298
+ headers: string;
299
+ header: string;
300
+ authorizations: string;
301
+ responses: string;
302
+ response: string;
303
+ path_parameters: string;
304
+ query_parameters: string;
305
+ header_parameters: string;
306
+ attributes: string;
307
+ test_it: string;
308
+ information: string;
309
+ success: string;
310
+ redirect: string;
311
+ error: string;
312
+ show: string;
313
+ hide: string;
314
+ available_items: string;
315
+ required_scopes: string;
316
+ properties: string;
317
+ or: string;
318
+ and: string;
319
+ possible_values: string;
320
+ };
321
+ no: {
322
+ required: string;
323
+ deprecated: string;
324
+ deprecated_and_sunset_on: string;
325
+ stability_experimental: string;
326
+ stability_alpha: string;
327
+ stability_beta: string;
328
+ discriminator: string;
329
+ copy_to_clipboard: string;
330
+ copied: string;
331
+ no_content: string;
332
+ unresolved_reference: string;
333
+ circular_reference: string;
334
+ read_only: string;
335
+ write_only: string;
336
+ optional: string;
337
+ min: string;
338
+ max: string;
339
+ nullable: string;
340
+ body: string;
341
+ payload: string;
342
+ headers: string;
343
+ header: string;
344
+ authorizations: string;
345
+ responses: string;
346
+ response: string;
347
+ path_parameters: string;
348
+ query_parameters: string;
349
+ header_parameters: string;
350
+ attributes: string;
351
+ test_it: string;
352
+ information: string;
353
+ success: string;
354
+ redirect: string;
355
+ error: string;
356
+ show: string;
357
+ hide: string;
358
+ available_items: string;
359
+ required_scopes: string;
360
+ properties: string;
361
+ or: string;
362
+ and: string;
363
+ possible_values: string;
364
+ };
365
+ 'pt-br': {
366
+ required: string;
367
+ deprecated: string;
368
+ deprecated_and_sunset_on: string;
369
+ stability_experimental: string;
370
+ stability_alpha: string;
371
+ stability_beta: string;
372
+ discriminator: string;
373
+ copy_to_clipboard: string;
374
+ copied: string;
375
+ no_content: string;
376
+ unresolved_reference: string;
377
+ circular_reference: string;
378
+ read_only: string;
379
+ write_only: string;
380
+ optional: string;
381
+ min: string;
382
+ max: string;
383
+ nullable: string;
384
+ body: string;
385
+ payload: string;
386
+ headers: string;
387
+ header: string;
388
+ authorizations: string;
389
+ responses: string;
390
+ response: string;
391
+ path_parameters: string;
392
+ query_parameters: string;
393
+ header_parameters: string;
394
+ attributes: string;
395
+ test_it: string;
396
+ information: string;
397
+ success: string;
398
+ redirect: string;
399
+ error: string;
400
+ show: string;
401
+ hide: string;
402
+ available_items: string;
403
+ required_scopes: string;
404
+ properties: string;
405
+ or: string;
406
+ and: string;
407
+ possible_values: string;
408
+ };
409
+ zh: {
410
+ required: string;
411
+ deprecated: string;
412
+ deprecated_and_sunset_on: string;
413
+ stability_experimental: string;
414
+ stability_alpha: string;
415
+ stability_beta: string;
416
+ discriminator: string;
417
+ copy_to_clipboard: string;
418
+ copied: string;
419
+ no_content: string;
420
+ unresolved_reference: string;
421
+ circular_reference: string;
422
+ read_only: string;
423
+ write_only: string;
424
+ optional: string;
425
+ min: string;
426
+ max: string;
427
+ nullable: string;
428
+ body: string;
429
+ payload: string;
430
+ headers: string;
431
+ header: string;
432
+ authorizations: string;
433
+ responses: string;
434
+ response: string;
435
+ path_parameters: string;
436
+ query_parameters: string;
437
+ header_parameters: string;
438
+ attributes: string;
439
+ test_it: string;
440
+ information: string;
441
+ success: string;
442
+ redirect: string;
443
+ error: string;
444
+ show: string;
445
+ hide: string;
446
+ available_items: string;
447
+ required_scopes: string;
448
+ properties: string;
449
+ or: string;
450
+ and: string;
451
+ possible_values: string;
452
+ };
453
+ };
454
+ type TranslationLocale = keyof typeof translations;
455
+ /**
456
+ * Check if the locale is valid.
457
+ */
458
+ declare function checkIsValidLocale(locale: string): locale is TranslationLocale;
459
+ //#endregion
460
+ //#region src/context.d.ts
461
+ interface OpenAPIClientContext {
462
+ /**
463
+ * The translation language to use.
464
+ */
465
+ translation: Translation;
466
+ /**
467
+ * Icons used in the block.
468
+ */
469
+ icons: {
470
+ chevronDown: React.ReactNode;
471
+ chevronRight: React.ReactNode;
472
+ plus: React.ReactNode;
473
+ };
474
+ /**
475
+ * Force all sections to be opened by default.
476
+ * @default false
477
+ */
478
+ defaultInteractiveOpened?: boolean;
479
+ /**
480
+ * The key of the block
481
+ */
482
+ blockKey?: string;
483
+ /**
484
+ * Optional id attached to the heading and used as an anchor.
485
+ */
486
+ id?: string;
487
+ /**
488
+ * Mark the context as a client context.
489
+ */
490
+ $$isClientContext$$: true;
491
+ }
492
+ interface OpenAPIContext extends Omit<OpenAPIClientContext, '$$isClientContext$$'> {
493
+ /**
494
+ * Render a code block.
495
+ */
496
+ renderCodeBlock: (props: {
497
+ code: string;
498
+ syntax: string;
499
+ }) => React.ReactNode;
500
+ /**
501
+ * Render the heading of the operation.
502
+ */
503
+ renderHeading: (props: {
504
+ deprecated: boolean;
505
+ title: string;
506
+ stability?: string;
507
+ }) => React.ReactNode;
508
+ /**
509
+ * Render the document of the operation.
510
+ */
511
+ renderDocument: (props: {
512
+ document: object;
513
+ }) => React.ReactNode;
514
+ /**
515
+ * Specification URL.
516
+ */
517
+ specUrl: string;
518
+ }
519
+ interface OpenAPIContextInput extends Omit<OpenAPIContext, 'translation'> {
520
+ /**
521
+ * The translation language to use.
522
+ * @default 'en'
523
+ */
524
+ locale?: TranslationLocale | undefined;
525
+ }
526
+ //#endregion
527
+ //#region src/schemas/OpenAPISchemas.d.ts
528
+ /**
529
+ * OpenAPI Schemas component.
530
+ */
531
+ declare function OpenAPISchemas(props: {
532
+ className?: string;
533
+ schemas: OpenAPISchema[];
534
+ context: OpenAPIContextInput;
535
+ /**
536
+ * Whether to show the schema directly if there is only one.
537
+ */
538
+ grouped?: boolean;
539
+ }): react2.JSX.Element | null;
540
+ //#endregion
541
+ //#region src/schemas/resolveOpenAPISchemas.d.ts
542
+ /**
543
+ * Resolve an OpenAPI schemas from a file and compile it to a more usable format.
544
+ * Schemas are extracted from the OpenAPI components.schemas
545
+ */
546
+ declare function resolveOpenAPISchemas(filesystem: Filesystem<OpenAPIV3xDocument>, options: {
547
+ schemas: string[];
548
+ }): Promise<{
549
+ schemas: OpenAPISchema[];
550
+ } | null>;
551
+ //#endregion
552
+ //#region src/types.d.ts
553
+ type OpenAPIServerVariableWithCustomProperties = OpenAPIV3.ServerVariableObject & OpenAPICustomPrefillProperties;
554
+ /**
555
+ * OpenAPI ServerObject type extended to provide x-gitbook prefill custom properties at the variable level.
556
+ */
557
+ type OpenAPIServerWithCustomProperties = Omit<OpenAPIV3.ServerObject, 'variables'> & {
558
+ variables?: {
559
+ [variable: string]: OpenAPIServerVariableWithCustomProperties;
560
+ };
561
+ } & OpenAPICustomPrefillProperties;
562
+ type OpenAPISecurityScope = [string, string | undefined];
563
+ type OpenAPICustomSecurityScheme = OpenAPIV3.SecuritySchemeObject & OpenAPICustomPrefillProperties & {
564
+ required?: boolean;
565
+ scopes?: OpenAPISecurityScope[] | null;
566
+ };
567
+ interface OpenAPIOperationData extends OpenAPICustomSpecProperties {
568
+ path: string;
569
+ method: string;
570
+ /** Servers to be used for this operation */
571
+ servers: OpenAPIServerWithCustomProperties[];
572
+ /** Spec of the operation */
573
+ operation: OpenAPIV3.OperationObject<OpenAPICustomOperationProperties>;
574
+ /** Securities that should be used for this operation */
575
+ securities: [string, OpenAPICustomSecurityScheme][];
576
+ }
577
+ interface OpenAPIWebhookData extends OpenAPICustomSpecProperties {
578
+ name: string;
579
+ method: string;
580
+ /** Servers to be used for this operation */
581
+ servers: OpenAPIV3.ServerObject[];
582
+ /** Spec of the webhook */
583
+ operation: OpenAPIV3.OperationObject<OpenAPICustomOperationProperties>;
584
+ }
585
+ //#endregion
586
+ //#region src/OpenAPIOperation.d.ts
587
+ /**
588
+ * Display an interactive OpenAPI operation.
589
+ */
590
+ declare function OpenAPIOperation(props: {
591
+ className?: string;
592
+ data: OpenAPIOperationData;
593
+ context: OpenAPIContextInput;
594
+ }): react2.JSX.Element;
595
+ //#endregion
596
+ //#region src/OpenAPIWebhook.d.ts
597
+ /**
598
+ * Display an interactive OpenAPI webhook.
599
+ */
600
+ declare function OpenAPIWebhook(props: {
601
+ className?: string;
602
+ data: OpenAPIWebhookData;
603
+ context: OpenAPIContextInput;
604
+ }): react2.JSX.Element;
605
+ //#endregion
606
+ //#region src/OpenAPIOperationContext.d.ts
607
+ interface OpenAPIOperationPointer {
608
+ path: string;
609
+ method: string;
610
+ }
611
+ interface OpenAPIOperationContextValue {
612
+ onOpenClient: (pointer: OpenAPIOperationPointer) => void;
613
+ }
614
+ /**
615
+ * Provider for the OpenAPIOperationContext.
616
+ */
617
+ declare function OpenAPIOperationContextProvider(props: React.PropsWithChildren<Partial<OpenAPIOperationContextValue>>): react2.JSX.Element;
618
+ /**
619
+ * Hook to access the OpenAPIOperationContext.
620
+ */
621
+ declare function useOpenAPIOperationContext(): OpenAPIOperationContextValue;
622
+ //#endregion
623
+ //#region src/OpenAPIPrefillContextProvider.d.ts
624
+ /**
625
+ * Prefill data that can be used to dynamically inject info into OpenAPI operation blocks.
626
+ *
627
+ * This is typically dynamic input context, such as visitor data or environment info.
628
+ */
629
+ type PrefillInputContextData = Record<string, unknown>;
630
+ /**
631
+ * Context value is function that returns prefill data.
632
+ */
633
+ type PrefillContextValue = () => PrefillInputContextData | null;
634
+ /**
635
+ * Provide context to help prefill dynamic info like visitor data in OpenAPI blocks.
636
+ */
637
+ declare function OpenAPIPrefillContextProvider(props: react2.PropsWithChildren<{
638
+ getPrefillInputContextData: () => PrefillInputContextData | null;
639
+ }>): react2.JSX.Element;
640
+ /**
641
+ * Hook to access the prefill context function.
642
+ */
643
+ declare function useOpenAPIPrefillContext(): PrefillContextValue;
644
+ //#endregion
645
+ //#region src/resolveOpenAPIOperation.d.ts
646
+ /**
647
+ * Resolve an OpenAPI operation in a file and compile it to a more usable format.
648
+ */
649
+ declare function resolveOpenAPIOperation(filesystem: Filesystem<OpenAPIV3xDocument>, operationDescriptor: {
650
+ path: string;
651
+ method: string;
652
+ }): Promise<OpenAPIOperationData | null>;
653
+ //#endregion
654
+ //#region src/resolveOpenAPIWebhook.d.ts
655
+ /**
656
+ * Resolve an OpenAPI webhook in a file and compile it to a more usable format.
657
+ */
658
+ declare function resolveOpenAPIWebhook(filesystem: Filesystem<OpenAPIV3xDocument>, webhookDescriptor: {
659
+ name: string;
660
+ method: string;
661
+ }): Promise<OpenAPIWebhookData | null>;
662
+ //#endregion
663
+ export { type OpenAPIContextInput, OpenAPIOperation, OpenAPIOperationContextProvider, type OpenAPIOperationData, OpenAPIPrefillContextProvider, OpenAPISchemas, OpenAPIWebhook, type OpenAPIWebhookData, PrefillInputContextData, checkIsValidLocale, resolveOpenAPIOperation, resolveOpenAPISchemas, resolveOpenAPIWebhook, useOpenAPIOperationContext, useOpenAPIPrefillContext };