docusaurus-plugin-openapi-docs 0.0.0-1000

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 (163) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +361 -0
  3. package/lib/index.d.ts +9 -0
  4. package/lib/index.js +709 -0
  5. package/lib/markdown/createArrayBracket.d.ts +2 -0
  6. package/lib/markdown/createArrayBracket.js +36 -0
  7. package/lib/markdown/createAuthentication.d.ts +2 -0
  8. package/lib/markdown/createAuthentication.js +171 -0
  9. package/lib/markdown/createAuthorization.d.ts +1 -0
  10. package/lib/markdown/createAuthorization.js +15 -0
  11. package/lib/markdown/createCallbackMethodEndpoint.d.ts +1 -0
  12. package/lib/markdown/createCallbackMethodEndpoint.js +20 -0
  13. package/lib/markdown/createCallbacks.d.ts +6 -0
  14. package/lib/markdown/createCallbacks.js +77 -0
  15. package/lib/markdown/createContactInfo.d.ts +2 -0
  16. package/lib/markdown/createContactInfo.js +39 -0
  17. package/lib/markdown/createDeprecationNotice.d.ts +6 -0
  18. package/lib/markdown/createDeprecationNotice.js +20 -0
  19. package/lib/markdown/createDescription.d.ts +1 -0
  20. package/lib/markdown/createDescription.js +13 -0
  21. package/lib/markdown/createDetails.d.ts +2 -0
  22. package/lib/markdown/createDetails.js +17 -0
  23. package/lib/markdown/createDetailsSummary.d.ts +2 -0
  24. package/lib/markdown/createDetailsSummary.js +17 -0
  25. package/lib/markdown/createDownload.d.ts +1 -0
  26. package/lib/markdown/createDownload.js +16 -0
  27. package/lib/markdown/createHeading.d.ts +1 -0
  28. package/lib/markdown/createHeading.js +20 -0
  29. package/lib/markdown/createLicense.d.ts +2 -0
  30. package/lib/markdown/createLicense.js +32 -0
  31. package/lib/markdown/createLogo.d.ts +2 -0
  32. package/lib/markdown/createLogo.js +18 -0
  33. package/lib/markdown/createMethodEndpoint.d.ts +1 -0
  34. package/lib/markdown/createMethodEndpoint.js +20 -0
  35. package/lib/markdown/createParamsDetails.d.ts +6 -0
  36. package/lib/markdown/createParamsDetails.js +18 -0
  37. package/lib/markdown/createRequestBodyDetails.d.ts +13 -0
  38. package/lib/markdown/createRequestBodyDetails.js +13 -0
  39. package/lib/markdown/createRequestHeader.d.ts +1 -0
  40. package/lib/markdown/createRequestHeader.js +21 -0
  41. package/lib/markdown/createRequestSchema.d.ts +14 -0
  42. package/lib/markdown/createRequestSchema.js +20 -0
  43. package/lib/markdown/createResponseSchema.d.ts +14 -0
  44. package/lib/markdown/createResponseSchema.js +20 -0
  45. package/lib/markdown/createSchema.d.ts +9 -0
  46. package/lib/markdown/createSchema.js +668 -0
  47. package/lib/markdown/createSchema.test.d.ts +1 -0
  48. package/lib/markdown/createSchema.test.js +913 -0
  49. package/lib/markdown/createStatusCodes.d.ts +9 -0
  50. package/lib/markdown/createStatusCodes.js +63 -0
  51. package/lib/markdown/createTermsOfService.d.ts +1 -0
  52. package/lib/markdown/createTermsOfService.js +31 -0
  53. package/lib/markdown/createVendorExtensions.d.ts +1 -0
  54. package/lib/markdown/createVendorExtensions.js +24 -0
  55. package/lib/markdown/createVersionBadge.d.ts +1 -0
  56. package/lib/markdown/createVersionBadge.js +19 -0
  57. package/lib/markdown/index.d.ts +5 -0
  58. package/lib/markdown/index.js +92 -0
  59. package/lib/markdown/schema.d.ts +3 -0
  60. package/lib/markdown/schema.js +154 -0
  61. package/lib/markdown/schema.test.d.ts +1 -0
  62. package/lib/markdown/schema.test.js +181 -0
  63. package/lib/markdown/utils.d.ts +20 -0
  64. package/lib/markdown/utils.js +68 -0
  65. package/lib/openapi/createRequestExample.d.ts +2 -0
  66. package/lib/openapi/createRequestExample.js +191 -0
  67. package/lib/openapi/createResponseExample.d.ts +2 -0
  68. package/lib/openapi/createResponseExample.js +192 -0
  69. package/lib/openapi/index.d.ts +1 -0
  70. package/lib/openapi/index.js +12 -0
  71. package/lib/openapi/openapi.d.ts +12 -0
  72. package/lib/openapi/openapi.js +544 -0
  73. package/lib/openapi/openapi.test.d.ts +1 -0
  74. package/lib/openapi/openapi.test.js +33 -0
  75. package/lib/openapi/types.d.ts +354 -0
  76. package/lib/openapi/types.js +8 -0
  77. package/lib/openapi/utils/loadAndResolveSpec.d.ts +2 -0
  78. package/lib/openapi/utils/loadAndResolveSpec.js +153 -0
  79. package/lib/openapi/utils/services/OpenAPIParser.d.ts +52 -0
  80. package/lib/openapi/utils/services/OpenAPIParser.js +343 -0
  81. package/lib/openapi/utils/services/RedocNormalizedOptions.d.ts +100 -0
  82. package/lib/openapi/utils/services/RedocNormalizedOptions.js +170 -0
  83. package/lib/openapi/utils/types/index.d.ts +2 -0
  84. package/lib/openapi/utils/types/index.js +23 -0
  85. package/lib/openapi/utils/types/open-api.d.ts +305 -0
  86. package/lib/openapi/utils/types/open-api.js +8 -0
  87. package/lib/openapi/utils/types.d.ts +306 -0
  88. package/lib/openapi/utils/types.js +8 -0
  89. package/lib/openapi/utils/utils/JsonPointer.d.ts +51 -0
  90. package/lib/openapi/utils/utils/JsonPointer.js +95 -0
  91. package/lib/openapi/utils/utils/helpers.d.ts +43 -0
  92. package/lib/openapi/utils/utils/helpers.js +230 -0
  93. package/lib/openapi/utils/utils/index.d.ts +3 -0
  94. package/lib/openapi/utils/utils/index.js +25 -0
  95. package/lib/openapi/utils/utils/openapi.d.ts +40 -0
  96. package/lib/openapi/utils/utils/openapi.js +605 -0
  97. package/lib/options.d.ts +2 -0
  98. package/lib/options.js +69 -0
  99. package/lib/sidebars/index.d.ts +4 -0
  100. package/lib/sidebars/index.js +226 -0
  101. package/lib/sidebars/utils.d.ts +2 -0
  102. package/lib/sidebars/utils.js +30 -0
  103. package/lib/types.d.ts +135 -0
  104. package/lib/types.js +8 -0
  105. package/package.json +69 -0
  106. package/src/index.ts +945 -0
  107. package/src/markdown/__snapshots__/createSchema.test.ts.snap +1605 -0
  108. package/src/markdown/createArrayBracket.ts +35 -0
  109. package/src/markdown/createAuthentication.ts +201 -0
  110. package/src/markdown/createAuthorization.ts +13 -0
  111. package/src/markdown/createCallbackMethodEndpoint.ts +19 -0
  112. package/src/markdown/createCallbacks.ts +101 -0
  113. package/src/markdown/createContactInfo.ts +41 -0
  114. package/src/markdown/createDeprecationNotice.ts +31 -0
  115. package/src/markdown/createDescription.ts +12 -0
  116. package/src/markdown/createDetails.ts +16 -0
  117. package/src/markdown/createDetailsSummary.ts +16 -0
  118. package/src/markdown/createDownload.ts +15 -0
  119. package/src/markdown/createHeading.ts +23 -0
  120. package/src/markdown/createLicense.ts +34 -0
  121. package/src/markdown/createLogo.ts +21 -0
  122. package/src/markdown/createMethodEndpoint.ts +19 -0
  123. package/src/markdown/createParamsDetails.ts +22 -0
  124. package/src/markdown/createRequestBodyDetails.ts +24 -0
  125. package/src/markdown/createRequestHeader.ts +24 -0
  126. package/src/markdown/createRequestSchema.ts +32 -0
  127. package/src/markdown/createResponseSchema.ts +32 -0
  128. package/src/markdown/createSchema.test.ts +1075 -0
  129. package/src/markdown/createSchema.ts +862 -0
  130. package/src/markdown/createStatusCodes.ts +63 -0
  131. package/src/markdown/createTermsOfService.ts +30 -0
  132. package/src/markdown/createVendorExtensions.ts +22 -0
  133. package/src/markdown/createVersionBadge.ts +22 -0
  134. package/src/markdown/index.ts +144 -0
  135. package/src/markdown/schema.test.ts +208 -0
  136. package/src/markdown/schema.ts +185 -0
  137. package/src/markdown/utils.ts +89 -0
  138. package/src/openapi/__fixtures__/examples/openapi.yaml +49 -0
  139. package/src/openapi/createRequestExample.ts +235 -0
  140. package/src/openapi/createResponseExample.ts +238 -0
  141. package/src/openapi/index.ts +8 -0
  142. package/src/openapi/openapi.test.ts +40 -0
  143. package/src/openapi/openapi.ts +697 -0
  144. package/src/openapi/types.ts +455 -0
  145. package/src/openapi/utils/loadAndResolveSpec.ts +171 -0
  146. package/src/openapi/utils/services/OpenAPIParser.ts +434 -0
  147. package/src/openapi/utils/services/RedocNormalizedOptions.ts +330 -0
  148. package/src/openapi/utils/types/index.ts +10 -0
  149. package/src/openapi/utils/types/open-api.ts +303 -0
  150. package/src/openapi/utils/types.ts +303 -0
  151. package/src/openapi/utils/utils/JsonPointer.ts +99 -0
  152. package/src/openapi/utils/utils/helpers.ts +239 -0
  153. package/src/openapi/utils/utils/index.ts +11 -0
  154. package/src/openapi/utils/utils/openapi.ts +771 -0
  155. package/src/openapi-to-postmanv2.d.ts +10 -0
  156. package/src/options.ts +77 -0
  157. package/src/plugin-content-docs-types.d.ts +42 -0
  158. package/src/plugin-openapi.d.ts +87 -0
  159. package/src/postman-collection.d.ts +10 -0
  160. package/src/sidebars/index.ts +322 -0
  161. package/src/sidebars/utils.ts +29 -0
  162. package/src/types.ts +176 -0
  163. package/tsconfig.json +7 -0
@@ -0,0 +1,305 @@
1
+ import { Omit } from "./index";
2
+ export interface OpenAPISpec {
3
+ openapi: string;
4
+ info: OpenAPIInfo;
5
+ servers?: OpenAPIServer[];
6
+ paths: OpenAPIPaths;
7
+ components?: OpenAPIComponents;
8
+ security?: OpenAPISecurityRequirement[];
9
+ tags?: OpenAPITag[];
10
+ externalDocs?: OpenAPIExternalDocumentation;
11
+ "x-webhooks"?: OpenAPIPaths;
12
+ webhooks?: OpenAPIPaths;
13
+ }
14
+ export interface OpenAPIInfo {
15
+ title: string;
16
+ version: string;
17
+ description?: string;
18
+ summary?: string;
19
+ termsOfService?: string;
20
+ contact?: OpenAPIContact;
21
+ license?: OpenAPILicense;
22
+ }
23
+ export interface OpenAPIServer {
24
+ url: string;
25
+ description?: string;
26
+ variables?: {
27
+ [name: string]: OpenAPIServerVariable;
28
+ };
29
+ }
30
+ export interface OpenAPIServerVariable {
31
+ enum?: string[];
32
+ default: string;
33
+ description?: string;
34
+ }
35
+ export interface OpenAPIPaths {
36
+ [path: string]: OpenAPIPath;
37
+ }
38
+ export interface OpenAPIRef {
39
+ $ref: string;
40
+ }
41
+ export type Referenced<T> = OpenAPIRef | T;
42
+ export interface OpenAPIPath {
43
+ summary?: string;
44
+ description?: string;
45
+ get?: OpenAPIOperation;
46
+ put?: OpenAPIOperation;
47
+ post?: OpenAPIOperation;
48
+ delete?: OpenAPIOperation;
49
+ options?: OpenAPIOperation;
50
+ head?: OpenAPIOperation;
51
+ patch?: OpenAPIOperation;
52
+ trace?: OpenAPIOperation;
53
+ servers?: OpenAPIServer[];
54
+ parameters?: Array<Referenced<OpenAPIParameter>>;
55
+ $ref?: string;
56
+ }
57
+ export interface OpenAPIXCodeSample {
58
+ lang: string;
59
+ label?: string;
60
+ source: string;
61
+ }
62
+ export interface OpenAPIOperation {
63
+ tags?: string[];
64
+ summary?: string;
65
+ description?: string;
66
+ externalDocs?: OpenAPIExternalDocumentation;
67
+ operationId?: string;
68
+ parameters?: Array<Referenced<OpenAPIParameter>>;
69
+ requestBody?: Referenced<OpenAPIRequestBody>;
70
+ responses: OpenAPIResponses;
71
+ callbacks?: {
72
+ [name: string]: Referenced<OpenAPICallback>;
73
+ };
74
+ deprecated?: boolean;
75
+ security?: OpenAPISecurityRequirement[];
76
+ servers?: OpenAPIServer[];
77
+ "x-codeSamples"?: OpenAPIXCodeSample[];
78
+ "x-code-samples"?: OpenAPIXCodeSample[];
79
+ }
80
+ export interface OpenAPIParameter {
81
+ name: string;
82
+ in?: OpenAPIParameterLocation;
83
+ description?: string;
84
+ required?: boolean;
85
+ deprecated?: boolean;
86
+ allowEmptyValue?: boolean;
87
+ style?: OpenAPIParameterStyle;
88
+ explode?: boolean;
89
+ allowReserved?: boolean;
90
+ schema?: Referenced<OpenAPISchema>;
91
+ example?: any;
92
+ examples?: {
93
+ [media: string]: Referenced<OpenAPIExample>;
94
+ };
95
+ content?: {
96
+ [media: string]: OpenAPIMediaType;
97
+ };
98
+ encoding?: Record<string, OpenAPIEncoding>;
99
+ const?: any;
100
+ }
101
+ export interface OpenAPIExample {
102
+ value: any;
103
+ summary?: string;
104
+ description?: string;
105
+ externalValue?: string;
106
+ }
107
+ export interface OpenAPISchema {
108
+ $ref?: string;
109
+ type?: string | string[];
110
+ properties?: {
111
+ [name: string]: OpenAPISchema;
112
+ };
113
+ patternProperties?: {
114
+ [name: string]: OpenAPISchema;
115
+ };
116
+ additionalProperties?: boolean | OpenAPISchema;
117
+ unevaluatedProperties?: boolean | OpenAPISchema;
118
+ description?: string;
119
+ default?: any;
120
+ items?: OpenAPISchema | OpenAPISchema[] | boolean;
121
+ required?: string[];
122
+ readOnly?: boolean;
123
+ writeOnly?: boolean;
124
+ deprecated?: boolean;
125
+ format?: string;
126
+ externalDocs?: OpenAPIExternalDocumentation;
127
+ discriminator?: OpenAPIDiscriminator;
128
+ nullable?: boolean;
129
+ oneOf?: OpenAPISchema[];
130
+ anyOf?: OpenAPISchema[];
131
+ allOf?: OpenAPISchema[];
132
+ not?: OpenAPISchema;
133
+ title?: string;
134
+ multipleOf?: number;
135
+ maximum?: number;
136
+ exclusiveMaximum?: boolean | number;
137
+ minimum?: number;
138
+ exclusiveMinimum?: boolean | number;
139
+ maxLength?: number;
140
+ minLength?: number;
141
+ pattern?: string;
142
+ maxItems?: number;
143
+ minItems?: number;
144
+ uniqueItems?: boolean;
145
+ maxProperties?: number;
146
+ minProperties?: number;
147
+ enum?: any[];
148
+ example?: any;
149
+ if?: OpenAPISchema;
150
+ else?: OpenAPISchema;
151
+ then?: OpenAPISchema;
152
+ examples?: any[];
153
+ const?: string;
154
+ contentEncoding?: string;
155
+ contentMediaType?: string;
156
+ prefixItems?: OpenAPISchema[];
157
+ additionalItems?: OpenAPISchema | boolean;
158
+ }
159
+ export interface OpenAPIDiscriminator {
160
+ propertyName: string;
161
+ mapping?: {
162
+ [name: string]: string;
163
+ };
164
+ "x-explicitMappingOnly"?: boolean;
165
+ }
166
+ export interface OpenAPIMediaType {
167
+ schema?: Referenced<OpenAPISchema>;
168
+ example?: any;
169
+ examples?: {
170
+ [name: string]: Referenced<OpenAPIExample>;
171
+ };
172
+ encoding?: {
173
+ [field: string]: OpenAPIEncoding;
174
+ };
175
+ }
176
+ export interface OpenAPIEncoding {
177
+ contentType: string;
178
+ headers?: {
179
+ [name: string]: Referenced<OpenAPIHeader>;
180
+ };
181
+ style: OpenAPIParameterStyle;
182
+ explode: boolean;
183
+ allowReserved: boolean;
184
+ }
185
+ export type OpenAPIParameterLocation = "query" | "header" | "path" | "cookie";
186
+ export type OpenAPIParameterStyle = "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject";
187
+ export interface OpenAPIRequestBody {
188
+ description?: string;
189
+ required?: boolean;
190
+ content: {
191
+ [mime: string]: OpenAPIMediaType;
192
+ };
193
+ "x-examples"?: {
194
+ [mime: string]: {
195
+ [name: string]: Referenced<OpenAPIExample>;
196
+ };
197
+ };
198
+ "x-example"?: {
199
+ [mime: string]: any;
200
+ };
201
+ }
202
+ export interface OpenAPIResponses {
203
+ [code: string]: Referenced<OpenAPIResponse>;
204
+ }
205
+ export interface OpenAPIResponse extends Pick<OpenAPIRequestBody, "description" | "x-examples" | "x-example"> {
206
+ headers?: {
207
+ [name: string]: Referenced<OpenAPIHeader>;
208
+ };
209
+ links?: {
210
+ [name: string]: Referenced<OpenAPILink>;
211
+ };
212
+ content?: {
213
+ [mime: string]: OpenAPIMediaType;
214
+ };
215
+ }
216
+ export interface OpenAPILink {
217
+ $ref?: string;
218
+ }
219
+ export type OpenAPIHeader = Omit<OpenAPIParameter, "in" | "name">;
220
+ export interface OpenAPICallback {
221
+ [name: string]: OpenAPIPath;
222
+ }
223
+ export interface OpenAPIComponents {
224
+ schemas?: {
225
+ [name: string]: Referenced<OpenAPISchema>;
226
+ };
227
+ responses?: {
228
+ [name: string]: Referenced<OpenAPIResponse>;
229
+ };
230
+ parameters?: {
231
+ [name: string]: Referenced<OpenAPIParameter>;
232
+ };
233
+ examples?: {
234
+ [name: string]: Referenced<OpenAPIExample>;
235
+ };
236
+ requestBodies?: {
237
+ [name: string]: Referenced<OpenAPIRequestBody>;
238
+ };
239
+ headers?: {
240
+ [name: string]: Referenced<OpenAPIHeader>;
241
+ };
242
+ securitySchemes?: {
243
+ [name: string]: Referenced<OpenAPISecurityScheme>;
244
+ };
245
+ links?: {
246
+ [name: string]: Referenced<OpenAPILink>;
247
+ };
248
+ callbacks?: {
249
+ [name: string]: Referenced<OpenAPICallback>;
250
+ };
251
+ }
252
+ export interface OpenAPISecurityRequirement {
253
+ [name: string]: string[];
254
+ }
255
+ export interface OpenAPISecurityScheme {
256
+ type: "apiKey" | "http" | "oauth2" | "openIdConnect";
257
+ description?: string;
258
+ name?: string;
259
+ in?: "query" | "header" | "cookie";
260
+ scheme?: string;
261
+ bearerFormat: string;
262
+ flows: {
263
+ implicit?: {
264
+ refreshUrl?: string;
265
+ scopes: Record<string, string>;
266
+ authorizationUrl: string;
267
+ };
268
+ password?: {
269
+ refreshUrl?: string;
270
+ scopes: Record<string, string>;
271
+ tokenUrl: string;
272
+ };
273
+ clientCredentials?: {
274
+ refreshUrl?: string;
275
+ scopes: Record<string, string>;
276
+ tokenUrl: string;
277
+ };
278
+ authorizationCode?: {
279
+ refreshUrl?: string;
280
+ scopes: Record<string, string>;
281
+ tokenUrl: string;
282
+ };
283
+ };
284
+ openIdConnectUrl?: string;
285
+ }
286
+ export interface OpenAPITag {
287
+ name: string;
288
+ description?: string;
289
+ externalDocs?: OpenAPIExternalDocumentation;
290
+ "x-displayName"?: string;
291
+ }
292
+ export interface OpenAPIExternalDocumentation {
293
+ description?: string;
294
+ url: string;
295
+ }
296
+ export interface OpenAPIContact {
297
+ name?: string;
298
+ url?: string;
299
+ email?: string;
300
+ }
301
+ export interface OpenAPILicense {
302
+ name: string;
303
+ url?: string;
304
+ identifier?: string;
305
+ }
@@ -0,0 +1,8 @@
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 });
@@ -0,0 +1,306 @@
1
+ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
2
+ export interface OpenAPISpec {
3
+ openapi: string;
4
+ info: OpenAPIInfo;
5
+ servers?: OpenAPIServer[];
6
+ paths: OpenAPIPaths;
7
+ components?: OpenAPIComponents;
8
+ security?: OpenAPISecurityRequirement[];
9
+ tags?: OpenAPITag[];
10
+ externalDocs?: OpenAPIExternalDocumentation;
11
+ "x-webhooks"?: OpenAPIPaths;
12
+ webhooks?: OpenAPIPaths;
13
+ }
14
+ export interface OpenAPIInfo {
15
+ title: string;
16
+ version: string;
17
+ description?: string;
18
+ summary?: string;
19
+ termsOfService?: string;
20
+ contact?: OpenAPIContact;
21
+ license?: OpenAPILicense;
22
+ }
23
+ export interface OpenAPIServer {
24
+ url: string;
25
+ description?: string;
26
+ variables?: {
27
+ [name: string]: OpenAPIServerVariable;
28
+ };
29
+ }
30
+ export interface OpenAPIServerVariable {
31
+ enum?: string[];
32
+ default: string;
33
+ description?: string;
34
+ }
35
+ export interface OpenAPIPaths {
36
+ [path: string]: OpenAPIPath;
37
+ }
38
+ export interface OpenAPIRef {
39
+ $ref: string;
40
+ }
41
+ export type Referenced<T> = OpenAPIRef | T;
42
+ export interface OpenAPIPath {
43
+ summary?: string;
44
+ description?: string;
45
+ get?: OpenAPIOperation;
46
+ put?: OpenAPIOperation;
47
+ post?: OpenAPIOperation;
48
+ delete?: OpenAPIOperation;
49
+ options?: OpenAPIOperation;
50
+ head?: OpenAPIOperation;
51
+ patch?: OpenAPIOperation;
52
+ trace?: OpenAPIOperation;
53
+ servers?: OpenAPIServer[];
54
+ parameters?: Array<Referenced<OpenAPIParameter>>;
55
+ $ref?: string;
56
+ }
57
+ export interface OpenAPIXCodeSample {
58
+ lang: string;
59
+ label?: string;
60
+ source: string;
61
+ }
62
+ export interface OpenAPIOperation {
63
+ tags?: string[];
64
+ summary?: string;
65
+ description?: string;
66
+ externalDocs?: OpenAPIExternalDocumentation;
67
+ operationId?: string;
68
+ parameters?: Array<Referenced<OpenAPIParameter>>;
69
+ requestBody?: Referenced<OpenAPIRequestBody>;
70
+ responses: OpenAPIResponses;
71
+ callbacks?: {
72
+ [name: string]: Referenced<OpenAPICallback>;
73
+ };
74
+ deprecated?: boolean;
75
+ security?: OpenAPISecurityRequirement[];
76
+ servers?: OpenAPIServer[];
77
+ "x-codeSamples"?: OpenAPIXCodeSample[];
78
+ "x-code-samples"?: OpenAPIXCodeSample[];
79
+ }
80
+ export interface OpenAPIParameter {
81
+ name: string;
82
+ in?: OpenAPIParameterLocation;
83
+ description?: string;
84
+ required?: boolean;
85
+ deprecated?: boolean;
86
+ allowEmptyValue?: boolean;
87
+ style?: OpenAPIParameterStyle;
88
+ explode?: boolean;
89
+ allowReserved?: boolean;
90
+ schema?: Referenced<OpenAPISchema>;
91
+ example?: any;
92
+ examples?: {
93
+ [media: string]: Referenced<OpenAPIExample>;
94
+ };
95
+ content?: {
96
+ [media: string]: OpenAPIMediaType;
97
+ };
98
+ encoding?: Record<string, OpenAPIEncoding>;
99
+ const?: any;
100
+ }
101
+ export interface OpenAPIExample {
102
+ value: any;
103
+ summary?: string;
104
+ description?: string;
105
+ externalValue?: string;
106
+ }
107
+ export interface OpenAPISchema {
108
+ $ref?: string;
109
+ type?: string | string[];
110
+ properties?: {
111
+ [name: string]: OpenAPISchema;
112
+ };
113
+ patternProperties?: {
114
+ [name: string]: OpenAPISchema;
115
+ };
116
+ additionalProperties?: boolean | OpenAPISchema;
117
+ unevaluatedProperties?: boolean | OpenAPISchema;
118
+ description?: string;
119
+ default?: any;
120
+ items?: OpenAPISchema | OpenAPISchema[] | boolean;
121
+ required?: string[];
122
+ readOnly?: boolean;
123
+ writeOnly?: boolean;
124
+ deprecated?: boolean;
125
+ format?: string;
126
+ externalDocs?: OpenAPIExternalDocumentation;
127
+ discriminator?: OpenAPIDiscriminator;
128
+ nullable?: boolean;
129
+ oneOf?: OpenAPISchema[];
130
+ anyOf?: OpenAPISchema[];
131
+ allOf?: OpenAPISchema[];
132
+ not?: OpenAPISchema;
133
+ title?: string;
134
+ multipleOf?: number;
135
+ maximum?: number;
136
+ exclusiveMaximum?: boolean | number;
137
+ minimum?: number;
138
+ exclusiveMinimum?: boolean | number;
139
+ maxLength?: number;
140
+ minLength?: number;
141
+ pattern?: string;
142
+ maxItems?: number;
143
+ minItems?: number;
144
+ uniqueItems?: boolean;
145
+ maxProperties?: number;
146
+ minProperties?: number;
147
+ enum?: any[];
148
+ example?: any;
149
+ if?: OpenAPISchema;
150
+ else?: OpenAPISchema;
151
+ then?: OpenAPISchema;
152
+ examples?: any[];
153
+ const?: string;
154
+ contentEncoding?: string;
155
+ contentMediaType?: string;
156
+ prefixItems?: OpenAPISchema[];
157
+ additionalItems?: OpenAPISchema | boolean;
158
+ }
159
+ export interface OpenAPIDiscriminator {
160
+ propertyName: string;
161
+ mapping?: {
162
+ [name: string]: string;
163
+ };
164
+ "x-explicitMappingOnly"?: boolean;
165
+ }
166
+ export interface OpenAPIMediaType {
167
+ schema?: Referenced<OpenAPISchema>;
168
+ example?: any;
169
+ examples?: {
170
+ [name: string]: Referenced<OpenAPIExample>;
171
+ };
172
+ encoding?: {
173
+ [field: string]: OpenAPIEncoding;
174
+ };
175
+ }
176
+ export interface OpenAPIEncoding {
177
+ contentType: string;
178
+ headers?: {
179
+ [name: string]: Referenced<OpenAPIHeader>;
180
+ };
181
+ style: OpenAPIParameterStyle;
182
+ explode: boolean;
183
+ allowReserved: boolean;
184
+ }
185
+ export type OpenAPIParameterLocation = "query" | "header" | "path" | "cookie";
186
+ export type OpenAPIParameterStyle = "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject";
187
+ export interface OpenAPIRequestBody {
188
+ description?: string;
189
+ required?: boolean;
190
+ content: {
191
+ [mime: string]: OpenAPIMediaType;
192
+ };
193
+ "x-examples"?: {
194
+ [mime: string]: {
195
+ [name: string]: Referenced<OpenAPIExample>;
196
+ };
197
+ };
198
+ "x-example"?: {
199
+ [mime: string]: any;
200
+ };
201
+ }
202
+ export interface OpenAPIResponses {
203
+ [code: string]: Referenced<OpenAPIResponse>;
204
+ }
205
+ export interface OpenAPIResponse extends Pick<OpenAPIRequestBody, "description" | "x-examples" | "x-example"> {
206
+ headers?: {
207
+ [name: string]: Referenced<OpenAPIHeader>;
208
+ };
209
+ links?: {
210
+ [name: string]: Referenced<OpenAPILink>;
211
+ };
212
+ content?: {
213
+ [mime: string]: OpenAPIMediaType;
214
+ };
215
+ }
216
+ export interface OpenAPILink {
217
+ $ref?: string;
218
+ }
219
+ export type OpenAPIHeader = Omit<OpenAPIParameter, "in" | "name">;
220
+ export interface OpenAPICallback {
221
+ [name: string]: OpenAPIPath;
222
+ }
223
+ export interface OpenAPIComponents {
224
+ schemas?: {
225
+ [name: string]: Referenced<OpenAPISchema>;
226
+ };
227
+ responses?: {
228
+ [name: string]: Referenced<OpenAPIResponse>;
229
+ };
230
+ parameters?: {
231
+ [name: string]: Referenced<OpenAPIParameter>;
232
+ };
233
+ examples?: {
234
+ [name: string]: Referenced<OpenAPIExample>;
235
+ };
236
+ requestBodies?: {
237
+ [name: string]: Referenced<OpenAPIRequestBody>;
238
+ };
239
+ headers?: {
240
+ [name: string]: Referenced<OpenAPIHeader>;
241
+ };
242
+ securitySchemes?: {
243
+ [name: string]: Referenced<OpenAPISecurityScheme>;
244
+ };
245
+ links?: {
246
+ [name: string]: Referenced<OpenAPILink>;
247
+ };
248
+ callbacks?: {
249
+ [name: string]: Referenced<OpenAPICallback>;
250
+ };
251
+ }
252
+ export interface OpenAPISecurityRequirement {
253
+ [name: string]: string[];
254
+ }
255
+ export interface OpenAPISecurityScheme {
256
+ type: "apiKey" | "http" | "oauth2" | "openIdConnect";
257
+ description?: string;
258
+ name?: string;
259
+ in?: "query" | "header" | "cookie";
260
+ scheme?: string;
261
+ bearerFormat: string;
262
+ flows: {
263
+ implicit?: {
264
+ refreshUrl?: string;
265
+ scopes: Record<string, string>;
266
+ authorizationUrl: string;
267
+ };
268
+ password?: {
269
+ refreshUrl?: string;
270
+ scopes: Record<string, string>;
271
+ tokenUrl: string;
272
+ };
273
+ clientCredentials?: {
274
+ refreshUrl?: string;
275
+ scopes: Record<string, string>;
276
+ tokenUrl: string;
277
+ };
278
+ authorizationCode?: {
279
+ refreshUrl?: string;
280
+ scopes: Record<string, string>;
281
+ tokenUrl: string;
282
+ };
283
+ };
284
+ openIdConnectUrl?: string;
285
+ }
286
+ export interface OpenAPITag {
287
+ name: string;
288
+ description?: string;
289
+ externalDocs?: OpenAPIExternalDocumentation;
290
+ "x-displayName"?: string;
291
+ }
292
+ export interface OpenAPIExternalDocumentation {
293
+ description?: string;
294
+ url: string;
295
+ }
296
+ export interface OpenAPIContact {
297
+ name?: string;
298
+ url?: string;
299
+ email?: string;
300
+ }
301
+ export interface OpenAPILicense {
302
+ name: string;
303
+ url?: string;
304
+ identifier?: string;
305
+ }
306
+ export {};
@@ -0,0 +1,8 @@
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 });
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Wrapper for JsonPointer. Provides common operations
3
+ */
4
+ export declare class JsonPointer {
5
+ /**
6
+ * returns last JsonPointer token
7
+ * if level > 1 returns levels last (second last/third last)
8
+ * @example
9
+ * // returns subpath
10
+ * JsonPointerHelper.baseName('/path/0/subpath')
11
+ * // returns foo
12
+ * JsonPointerHelper.baseName('/path/foo/subpath', 2)
13
+ */
14
+ static baseName(pointer: any, level?: number): string;
15
+ /**
16
+ * returns dirname of pointer
17
+ * if level > 1 returns corresponding dirname in the hierarchy
18
+ * @example
19
+ * // returns /path/0
20
+ * JsonPointerHelper.dirName('/path/0/subpath')
21
+ * // returns /path
22
+ * JsonPointerHelper.dirName('/path/foo/subpath', 2)
23
+ */
24
+ static dirName(pointer: any, level?: number): string;
25
+ /**
26
+ * returns relative path tokens
27
+ * @example
28
+ * // returns ['subpath']
29
+ * JsonPointerHelper.relative('/path/0', '/path/0/subpath')
30
+ * // returns ['foo', 'subpath']
31
+ * JsonPointerHelper.relative('/path', '/path/foo/subpath')
32
+ */
33
+ static relative(from: any, to: any): string[];
34
+ /**
35
+ * overridden JsonPointer original parse to take care of prefixing '#' symbol
36
+ * that is not valid JsonPointer
37
+ */
38
+ static parse(pointer: any): string[];
39
+ /**
40
+ * Creates a JSON pointer path, by joining one or more tokens to a base path.
41
+ *
42
+ * @param {string} base - The base path
43
+ * @param {string|string[]} tokens - The token(s) to append (e.g. ["name", "first"])
44
+ * @returns {string}
45
+ */
46
+ static join(base: any, tokens: any): string;
47
+ static get(object: object, pointer: string): any;
48
+ static compile(tokens: string[]): string;
49
+ static escape(pointer: string): string;
50
+ }
51
+ export default JsonPointer;