@scalar/openapi-parser 0.5.0 → 0.7.0

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 (33) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +6 -6
  3. package/dist/lib/Validator/Validator.d.ts +1 -1
  4. package/dist/pipeline.d.ts +153 -210
  5. package/dist/src/index.d.ts +27 -0
  6. package/dist/src/index.js +0 -2
  7. package/dist/src/lib/Validator/Validator.js +1 -1
  8. package/dist/src/pipeline.js +15 -25
  9. package/dist/src/polyfills/path.js +3 -6
  10. package/dist/src/utils/filter.js +8 -3
  11. package/dist/src/utils/isYaml.js +3 -2
  12. package/dist/src/utils/load/load.js +19 -6
  13. package/dist/src/utils/load/plugins/fetchUrls.d.ts +17 -0
  14. package/dist/src/utils/load/plugins/{fetchUrlsPlugin.js → fetchUrls.js} +7 -7
  15. package/dist/src/utils/load/plugins/readFiles.d.ts +5 -0
  16. package/dist/src/utils/load/plugins/{readFilesPlugin.js → readFiles.js} +3 -3
  17. package/dist/src/utils/normalize.js +3 -1
  18. package/dist/src/utils/upgrade.js +5 -3
  19. package/dist/src/utils/upgradeFromThreeToThreeOne.js +3 -4
  20. package/dist/src/utils/workThroughQueue.js +24 -0
  21. package/dist/types/index.d.ts +23 -8
  22. package/dist/utils/dereference.d.ts +2 -2
  23. package/dist/utils/details.d.ts +2 -6
  24. package/dist/utils/filter.d.ts +2 -2
  25. package/dist/utils/load/load.d.ts +2 -2
  26. package/dist/utils/resolveReferences.d.ts +1 -1
  27. package/dist/utils/upgrade.d.ts +2 -2
  28. package/dist/webpack-stats.json +1 -1
  29. package/package.json +15 -4
  30. package/dist/index.d.ts +0 -29
  31. package/dist/utils/load/plugins/fetchUrlsPlugin.d.ts +0 -10
  32. package/dist/utils/load/plugins/readFilesPlugin.d.ts +0 -5
  33. /package/dist/types/{openapi.d.ts → openapi-types.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @scalar/openapi-parser
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ec01324: refactor!: use dedicated entrypoints for the plugins
8
+
9
+ ### Patch Changes
10
+
11
+ - c6944f2: fix: ajv import broken in CJS environments
12
+
13
+ ## 0.6.0
14
+
15
+ ### Minor Changes
16
+
17
+ - 61252ab: refactor!: most functions return an object now
18
+
19
+ ### Patch Changes
20
+
21
+ - c9dd499: feat: intercept fetch requests
22
+ - 61252ab: fix: max call stack exceeded error
23
+
3
24
  ## 0.5.0
4
25
 
5
26
  ### Minor Changes
package/README.md CHANGED
@@ -47,12 +47,12 @@ const file = `{
47
47
  "paths": {}
48
48
  }`
49
49
 
50
- const result = await validate(file)
50
+ const { valid, errors } = await validate(file)
51
51
 
52
- console.log(result.valid)
52
+ console.log(valid)
53
53
 
54
- if (!result.valid) {
55
- console.log(result.errors)
54
+ if (!valid) {
55
+ console.log(errors)
56
56
  }
57
57
  ```
58
58
 
@@ -70,7 +70,7 @@ const file = `{
70
70
  "paths": {}
71
71
  }`
72
72
 
73
- const result = await dereference(file)
73
+ const { version } = await dereference(file)
74
74
 
75
- console.log(result.version)
75
+ console.log(version)
76
76
  ```
@@ -1,5 +1,5 @@
1
1
  import Ajv04 from 'ajv-draft-04';
2
- import Ajv2020 from 'ajv/dist/2020';
2
+ import Ajv2020 from 'ajv/dist/2020.js';
3
3
  import { OpenApiVersion } from '../../configuration.js';
4
4
  import { AnyObject, Filesystem, ValidateResult } from '../../types/index.js';
5
5
 
@@ -1,14 +1,15 @@
1
- import { AnyObject, Filesystem, ErrorObject } from './types/index.js';
1
+ import { AnyObject, LoadResult, DereferenceResult, ValidateResult, UpgradeResult, FilterResult, Filesystem, DetailsResult } from './types/index.js';
2
+ import { dereference } from './utils/dereference.js';
2
3
  import { filter } from './utils/filter.js';
3
4
  import { load, LoadPlugin } from './utils/load/load.js';
4
5
  import { upgrade } from './utils/upgrade.js';
5
- import { OpenAPI } from './types/openapi.js';
6
+ import { validate } from './utils/validate.js';
6
7
 
7
8
  /**
8
9
  * A queuable action for the pipeline
9
10
  */
10
11
  type Action = {
11
- action: typeof load | typeof upgrade | typeof filter;
12
+ action: typeof load | typeof upgrade | typeof filter | typeof dereference | typeof validate;
12
13
  options?: AnyObject;
13
14
  };
14
15
  /**
@@ -36,42 +37,36 @@ declare function openapi(): {
36
37
  declare function loadAction(specification: AnyApiDefinitionFormat, options?: {
37
38
  plugins: LoadPlugin[];
38
39
  }): {
39
- get: () => Promise<AnyObject>;
40
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
41
+ filesystem: Filesystem;
42
+ }>>;
40
43
  files: () => Promise<Filesystem>;
41
- details: () => Promise<{
42
- version: "2.0" | "3.0" | "3.1";
43
- specificationType: string;
44
- specificationVersion: string;
45
- }>;
44
+ details: () => Promise<DetailsResult>;
46
45
  filter: (callback: (Specification: AnyObject) => boolean) => {
47
- get: () => Promise<AnyObject>;
46
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
47
+ filesystem: Filesystem;
48
+ }>>;
48
49
  files: () => Promise<Filesystem>;
49
- details: () => Promise<{
50
- version: "2.0" | "3.0" | "3.1";
51
- specificationType: string;
52
- specificationVersion: string;
53
- }>;
50
+ details: () => Promise<DetailsResult>;
54
51
  filter: () => any;
55
52
  upgrade: () => {
56
- get: () => Promise<AnyObject>;
53
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
54
+ filesystem: Filesystem;
55
+ }>>;
57
56
  files: () => Promise<Filesystem>;
58
- details: () => Promise<{
59
- version: "2.0" | "3.0" | "3.1";
60
- specificationType: string;
61
- specificationVersion: string;
62
- }>;
57
+ details: () => Promise<DetailsResult>;
63
58
  filter: (callback: (Specification: AnyObject) => boolean) => any;
64
- validate: () => Promise<{
59
+ validate: () => {
65
60
  filter: (callback: (Specification: AnyObject) => boolean) => any;
66
- get: () => Promise<AnyObject>;
61
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
62
+ filesystem: Filesystem;
63
+ }>>;
67
64
  files: () => Promise<Filesystem>;
68
- details: () => Promise<{
69
- version: "2.0" | "3.0" | "3.1";
70
- specificationType: string;
71
- specificationVersion: string;
72
- }>;
65
+ details: () => Promise<DetailsResult>;
73
66
  dereference: () => {
74
- get: () => Promise<AnyObject>;
67
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
68
+ filesystem: Filesystem;
69
+ }>>;
75
70
  files: () => Promise<Filesystem>;
76
71
  filter: (callback: (Specification: AnyObject) => boolean) => any;
77
72
  toJson: () => Promise<string>;
@@ -79,14 +74,11 @@ declare function loadAction(specification: AnyApiDefinitionFormat, options?: {
79
74
  };
80
75
  toJson: () => Promise<string>;
81
76
  toYaml: () => Promise<string>;
82
- valid: boolean;
83
- specification?: OpenAPI.Document<{}>;
84
- version?: string;
85
- errors?: ErrorObject[];
86
- schema?: OpenAPI.Document<{}>;
87
- }>;
77
+ };
88
78
  dereference: () => {
89
- get: () => Promise<AnyObject>;
79
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
80
+ filesystem: Filesystem;
81
+ }>>;
90
82
  files: () => Promise<Filesystem>;
91
83
  filter: (callback: (Specification: AnyObject) => boolean) => any;
92
84
  toJson: () => Promise<string>;
@@ -95,17 +87,17 @@ declare function loadAction(specification: AnyApiDefinitionFormat, options?: {
95
87
  toJson: () => Promise<string>;
96
88
  toYaml: () => Promise<string>;
97
89
  };
98
- validate: () => Promise<{
90
+ validate: () => {
99
91
  filter: (callback: (Specification: AnyObject) => boolean) => any;
100
- get: () => Promise<AnyObject>;
92
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
93
+ filesystem: Filesystem;
94
+ }>>;
101
95
  files: () => Promise<Filesystem>;
102
- details: () => Promise<{
103
- version: "2.0" | "3.0" | "3.1";
104
- specificationType: string;
105
- specificationVersion: string;
106
- }>;
96
+ details: () => Promise<DetailsResult>;
107
97
  dereference: () => {
108
- get: () => Promise<AnyObject>;
98
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
99
+ filesystem: Filesystem;
100
+ }>>;
109
101
  files: () => Promise<Filesystem>;
110
102
  filter: (callback: (Specification: AnyObject) => boolean) => any;
111
103
  toJson: () => Promise<string>;
@@ -113,14 +105,11 @@ declare function loadAction(specification: AnyApiDefinitionFormat, options?: {
113
105
  };
114
106
  toJson: () => Promise<string>;
115
107
  toYaml: () => Promise<string>;
116
- valid: boolean;
117
- specification?: OpenAPI.Document<{}>;
118
- version?: string;
119
- errors?: ErrorObject[];
120
- schema?: OpenAPI.Document<{}>;
121
- }>;
108
+ };
122
109
  dereference: () => {
123
- get: () => Promise<AnyObject>;
110
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
111
+ filesystem: Filesystem;
112
+ }>>;
124
113
  files: () => Promise<Filesystem>;
125
114
  filter: (callback: (Specification: AnyObject) => boolean) => any;
126
115
  toJson: () => Promise<string>;
@@ -130,34 +119,30 @@ declare function loadAction(specification: AnyApiDefinitionFormat, options?: {
130
119
  toYaml: () => Promise<string>;
131
120
  };
132
121
  upgrade: () => {
133
- get: () => Promise<AnyObject>;
122
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
123
+ filesystem: Filesystem;
124
+ }>>;
134
125
  files: () => Promise<Filesystem>;
135
- details: () => Promise<{
136
- version: "2.0" | "3.0" | "3.1";
137
- specificationType: string;
138
- specificationVersion: string;
139
- }>;
126
+ details: () => Promise<DetailsResult>;
140
127
  filter: (callback: (Specification: AnyObject) => boolean) => {
141
- get: () => Promise<AnyObject>;
128
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
129
+ filesystem: Filesystem;
130
+ }>>;
142
131
  files: () => Promise<Filesystem>;
143
- details: () => Promise<{
144
- version: "2.0" | "3.0" | "3.1";
145
- specificationType: string;
146
- specificationVersion: string;
147
- }>;
132
+ details: () => Promise<DetailsResult>;
148
133
  filter: () => any;
149
134
  upgrade: () => any;
150
- validate: () => Promise<{
135
+ validate: () => {
151
136
  filter: (callback: (Specification: AnyObject) => boolean) => any;
152
- get: () => Promise<AnyObject>;
137
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
138
+ filesystem: Filesystem;
139
+ }>>;
153
140
  files: () => Promise<Filesystem>;
154
- details: () => Promise<{
155
- version: "2.0" | "3.0" | "3.1";
156
- specificationType: string;
157
- specificationVersion: string;
158
- }>;
141
+ details: () => Promise<DetailsResult>;
159
142
  dereference: () => {
160
- get: () => Promise<AnyObject>;
143
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
144
+ filesystem: Filesystem;
145
+ }>>;
161
146
  files: () => Promise<Filesystem>;
162
147
  filter: (callback: (Specification: AnyObject) => boolean) => any;
163
148
  toJson: () => Promise<string>;
@@ -165,14 +150,11 @@ declare function loadAction(specification: AnyApiDefinitionFormat, options?: {
165
150
  };
166
151
  toJson: () => Promise<string>;
167
152
  toYaml: () => Promise<string>;
168
- valid: boolean;
169
- specification?: OpenAPI.Document<{}>;
170
- version?: string;
171
- errors?: ErrorObject[];
172
- schema?: OpenAPI.Document<{}>;
173
- }>;
153
+ };
174
154
  dereference: () => {
175
- get: () => Promise<AnyObject>;
155
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
156
+ filesystem: Filesystem;
157
+ }>>;
176
158
  files: () => Promise<Filesystem>;
177
159
  filter: (callback: (Specification: AnyObject) => boolean) => any;
178
160
  toJson: () => Promise<string>;
@@ -181,20 +163,20 @@ declare function loadAction(specification: AnyApiDefinitionFormat, options?: {
181
163
  toJson: () => Promise<string>;
182
164
  toYaml: () => Promise<string>;
183
165
  };
184
- validate: () => Promise<{
166
+ validate: () => {
185
167
  filter: (callback: (Specification: AnyObject) => boolean) => {
186
- get: () => Promise<AnyObject>;
168
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
169
+ filesystem: Filesystem;
170
+ }>>;
187
171
  files: () => Promise<Filesystem>;
188
- details: () => Promise<{
189
- version: "2.0" | "3.0" | "3.1";
190
- specificationType: string;
191
- specificationVersion: string;
192
- }>;
172
+ details: () => Promise<DetailsResult>;
193
173
  filter: () => any;
194
174
  upgrade: () => any;
195
- validate: () => Promise<any>;
175
+ validate: () => any;
196
176
  dereference: () => {
197
- get: () => Promise<AnyObject>;
177
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
178
+ filesystem: Filesystem;
179
+ }>>;
198
180
  files: () => Promise<Filesystem>;
199
181
  filter: (callback: (Specification: AnyObject) => boolean) => any;
200
182
  toJson: () => Promise<string>;
@@ -203,27 +185,25 @@ declare function loadAction(specification: AnyApiDefinitionFormat, options?: {
203
185
  toJson: () => Promise<string>;
204
186
  toYaml: () => Promise<string>;
205
187
  };
206
- get: () => Promise<AnyObject>;
188
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
189
+ filesystem: Filesystem;
190
+ }>>;
207
191
  files: () => Promise<Filesystem>;
208
- details: () => Promise<{
209
- version: "2.0" | "3.0" | "3.1";
210
- specificationType: string;
211
- specificationVersion: string;
212
- }>;
192
+ details: () => Promise<DetailsResult>;
213
193
  dereference: () => {
214
- get: () => Promise<AnyObject>;
194
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
195
+ filesystem: Filesystem;
196
+ }>>;
215
197
  files: () => Promise<Filesystem>;
216
198
  filter: (callback: (Specification: AnyObject) => boolean) => {
217
- get: () => Promise<AnyObject>;
199
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
200
+ filesystem: Filesystem;
201
+ }>>;
218
202
  files: () => Promise<Filesystem>;
219
- details: () => Promise<{
220
- version: "2.0" | "3.0" | "3.1";
221
- specificationType: string;
222
- specificationVersion: string;
223
- }>;
203
+ details: () => Promise<DetailsResult>;
224
204
  filter: () => any;
225
205
  upgrade: () => any;
226
- validate: () => Promise<any>;
206
+ validate: () => any;
227
207
  dereference: () => any;
228
208
  toJson: () => Promise<string>;
229
209
  toYaml: () => Promise<string>;
@@ -233,43 +213,31 @@ declare function loadAction(specification: AnyApiDefinitionFormat, options?: {
233
213
  };
234
214
  toJson: () => Promise<string>;
235
215
  toYaml: () => Promise<string>;
236
- valid: boolean;
237
- specification?: OpenAPI.Document<{}>;
238
- version?: string;
239
- errors?: ErrorObject[];
240
- schema?: OpenAPI.Document<{}>;
241
- }>;
216
+ };
242
217
  dereference: () => {
243
- get: () => Promise<AnyObject>;
218
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
219
+ filesystem: Filesystem;
220
+ }>>;
244
221
  files: () => Promise<Filesystem>;
245
222
  filter: (callback: (Specification: AnyObject) => boolean) => {
246
- get: () => Promise<AnyObject>;
223
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
224
+ filesystem: Filesystem;
225
+ }>>;
247
226
  files: () => Promise<Filesystem>;
248
- details: () => Promise<{
249
- version: "2.0" | "3.0" | "3.1";
250
- specificationType: string;
251
- specificationVersion: string;
252
- }>;
227
+ details: () => Promise<DetailsResult>;
253
228
  filter: () => any;
254
229
  upgrade: () => any;
255
- validate: () => Promise<{
230
+ validate: () => {
256
231
  filter: (callback: (Specification: AnyObject) => boolean) => any;
257
- get: () => Promise<AnyObject>;
232
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
233
+ filesystem: Filesystem;
234
+ }>>;
258
235
  files: () => Promise<Filesystem>;
259
- details: () => Promise<{
260
- version: "2.0" | "3.0" | "3.1";
261
- specificationType: string;
262
- specificationVersion: string;
263
- }>;
236
+ details: () => Promise<DetailsResult>;
264
237
  dereference: () => any;
265
238
  toJson: () => Promise<string>;
266
239
  toYaml: () => Promise<string>;
267
- valid: boolean;
268
- specification?: OpenAPI.Document<{}>;
269
- version?: string;
270
- errors?: ErrorObject[];
271
- schema?: OpenAPI.Document<{}>;
272
- }>;
240
+ };
273
241
  dereference: () => any;
274
242
  toJson: () => Promise<string>;
275
243
  toYaml: () => Promise<string>;
@@ -280,28 +248,26 @@ declare function loadAction(specification: AnyApiDefinitionFormat, options?: {
280
248
  toJson: () => Promise<string>;
281
249
  toYaml: () => Promise<string>;
282
250
  };
283
- validate: () => Promise<{
251
+ validate: () => {
284
252
  filter: (callback: (Specification: AnyObject) => boolean) => {
285
- get: () => Promise<AnyObject>;
253
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
254
+ filesystem: Filesystem;
255
+ }>>;
286
256
  files: () => Promise<Filesystem>;
287
- details: () => Promise<{
288
- version: "2.0" | "3.0" | "3.1";
289
- specificationType: string;
290
- specificationVersion: string;
291
- }>;
257
+ details: () => Promise<DetailsResult>;
292
258
  filter: () => any;
293
259
  upgrade: () => {
294
- get: () => Promise<AnyObject>;
260
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
261
+ filesystem: Filesystem;
262
+ }>>;
295
263
  files: () => Promise<Filesystem>;
296
- details: () => Promise<{
297
- version: "2.0" | "3.0" | "3.1";
298
- specificationType: string;
299
- specificationVersion: string;
300
- }>;
264
+ details: () => Promise<DetailsResult>;
301
265
  filter: (callback: (Specification: AnyObject) => boolean) => any;
302
- validate: () => Promise<any>;
266
+ validate: () => any;
303
267
  dereference: () => {
304
- get: () => Promise<AnyObject>;
268
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
269
+ filesystem: Filesystem;
270
+ }>>;
305
271
  files: () => Promise<Filesystem>;
306
272
  filter: (callback: (Specification: AnyObject) => boolean) => any;
307
273
  toJson: () => Promise<string>;
@@ -310,9 +276,11 @@ declare function loadAction(specification: AnyApiDefinitionFormat, options?: {
310
276
  toJson: () => Promise<string>;
311
277
  toYaml: () => Promise<string>;
312
278
  };
313
- validate: () => Promise<any>;
279
+ validate: () => any;
314
280
  dereference: () => {
315
- get: () => Promise<AnyObject>;
281
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
282
+ filesystem: Filesystem;
283
+ }>>;
316
284
  files: () => Promise<Filesystem>;
317
285
  filter: (callback: (Specification: AnyObject) => boolean) => any;
318
286
  toJson: () => Promise<string>;
@@ -321,40 +289,36 @@ declare function loadAction(specification: AnyApiDefinitionFormat, options?: {
321
289
  toJson: () => Promise<string>;
322
290
  toYaml: () => Promise<string>;
323
291
  };
324
- get: () => Promise<AnyObject>;
292
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
293
+ filesystem: Filesystem;
294
+ }>>;
325
295
  files: () => Promise<Filesystem>;
326
- details: () => Promise<{
327
- version: "2.0" | "3.0" | "3.1";
328
- specificationType: string;
329
- specificationVersion: string;
330
- }>;
296
+ details: () => Promise<DetailsResult>;
331
297
  dereference: () => {
332
- get: () => Promise<AnyObject>;
298
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
299
+ filesystem: Filesystem;
300
+ }>>;
333
301
  files: () => Promise<Filesystem>;
334
302
  filter: (callback: (Specification: AnyObject) => boolean) => {
335
- get: () => Promise<AnyObject>;
303
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
304
+ filesystem: Filesystem;
305
+ }>>;
336
306
  files: () => Promise<Filesystem>;
337
- details: () => Promise<{
338
- version: "2.0" | "3.0" | "3.1";
339
- specificationType: string;
340
- specificationVersion: string;
341
- }>;
307
+ details: () => Promise<DetailsResult>;
342
308
  filter: () => any;
343
309
  upgrade: () => {
344
- get: () => Promise<AnyObject>;
310
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
311
+ filesystem: Filesystem;
312
+ }>>;
345
313
  files: () => Promise<Filesystem>;
346
- details: () => Promise<{
347
- version: "2.0" | "3.0" | "3.1";
348
- specificationType: string;
349
- specificationVersion: string;
350
- }>;
314
+ details: () => Promise<DetailsResult>;
351
315
  filter: (callback: (Specification: AnyObject) => boolean) => any;
352
- validate: () => Promise<any>;
316
+ validate: () => any;
353
317
  dereference: () => any;
354
318
  toJson: () => Promise<string>;
355
319
  toYaml: () => Promise<string>;
356
320
  };
357
- validate: () => Promise<any>;
321
+ validate: () => any;
358
322
  dereference: () => any;
359
323
  toJson: () => Promise<string>;
360
324
  toYaml: () => Promise<string>;
@@ -364,73 +328,52 @@ declare function loadAction(specification: AnyApiDefinitionFormat, options?: {
364
328
  };
365
329
  toJson: () => Promise<string>;
366
330
  toYaml: () => Promise<string>;
367
- valid: boolean;
368
- specification?: OpenAPI.Document<{}>;
369
- version?: string;
370
- errors?: ErrorObject[];
371
- schema?: OpenAPI.Document<{}>;
372
- }>;
331
+ };
373
332
  dereference: () => {
374
- get: () => Promise<AnyObject>;
333
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
334
+ filesystem: Filesystem;
335
+ }>>;
375
336
  files: () => Promise<Filesystem>;
376
337
  filter: (callback: (Specification: AnyObject) => boolean) => {
377
- get: () => Promise<AnyObject>;
338
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
339
+ filesystem: Filesystem;
340
+ }>>;
378
341
  files: () => Promise<Filesystem>;
379
- details: () => Promise<{
380
- version: "2.0" | "3.0" | "3.1";
381
- specificationType: string;
382
- specificationVersion: string;
383
- }>;
342
+ details: () => Promise<DetailsResult>;
384
343
  filter: () => any;
385
344
  upgrade: () => {
386
- get: () => Promise<AnyObject>;
345
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
346
+ filesystem: Filesystem;
347
+ }>>;
387
348
  files: () => Promise<Filesystem>;
388
- details: () => Promise<{
389
- version: "2.0" | "3.0" | "3.1";
390
- specificationType: string;
391
- specificationVersion: string;
392
- }>;
349
+ details: () => Promise<DetailsResult>;
393
350
  filter: (callback: (Specification: AnyObject) => boolean) => any;
394
- validate: () => Promise<{
351
+ validate: () => {
395
352
  filter: (callback: (Specification: AnyObject) => boolean) => any;
396
- get: () => Promise<AnyObject>;
353
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
354
+ filesystem: Filesystem;
355
+ }>>;
397
356
  files: () => Promise<Filesystem>;
398
- details: () => Promise<{
399
- version: "2.0" | "3.0" | "3.1";
400
- specificationType: string;
401
- specificationVersion: string;
402
- }>;
357
+ details: () => Promise<DetailsResult>;
403
358
  dereference: () => any;
404
359
  toJson: () => Promise<string>;
405
360
  toYaml: () => Promise<string>;
406
- valid: boolean;
407
- specification?: OpenAPI.Document<{}>;
408
- version?: string;
409
- errors?: ErrorObject[];
410
- schema?: OpenAPI.Document<{}>;
411
- }>;
361
+ };
412
362
  dereference: () => any;
413
363
  toJson: () => Promise<string>;
414
364
  toYaml: () => Promise<string>;
415
365
  };
416
- validate: () => Promise<{
366
+ validate: () => {
417
367
  filter: (callback: (Specification: AnyObject) => boolean) => any;
418
- get: () => Promise<AnyObject>;
368
+ get: () => Promise<Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
369
+ filesystem: Filesystem;
370
+ }>>;
419
371
  files: () => Promise<Filesystem>;
420
- details: () => Promise<{
421
- version: "2.0" | "3.0" | "3.1";
422
- specificationType: string;
423
- specificationVersion: string;
424
- }>;
372
+ details: () => Promise<DetailsResult>;
425
373
  dereference: () => any;
426
374
  toJson: () => Promise<string>;
427
375
  toYaml: () => Promise<string>;
428
- valid: boolean;
429
- specification?: OpenAPI.Document<{}>;
430
- version?: string;
431
- errors?: ErrorObject[];
432
- schema?: OpenAPI.Document<{}>;
433
- }>;
376
+ };
434
377
  dereference: () => any;
435
378
  toJson: () => Promise<string>;
436
379
  toYaml: () => Promise<string>;
@@ -0,0 +1,27 @@
1
+ export { Validator, jsonSchemaVersions } from '../lib/Validator/Validator.js';
2
+ export { ResolveReferencesResult, resolveReferences } from '../utils/resolveReferences.js';
3
+ export { AjvOptions, AnyObject, DereferenceResult, DetailsResult, ErrorObject, Filesystem, FilesystemEntry, FilterResult, LoadResult, UpgradeResult, ValidateResult } from '../types/index.js';
4
+ export { dereference } from '../utils/dereference.js';
5
+ export { details } from '../utils/details.js';
6
+ export { escapeJsonPointer } from '../utils/escapeJsonPointer.js';
7
+ export { filter } from '../utils/filter.js';
8
+ export { getEntrypoint } from '../utils/getEntrypoint.js';
9
+ export { getListOfReferences } from '../utils/getListOfReferences.js';
10
+ export { getSegmentsFromPath } from '../utils/getSegmentsFromPath.js';
11
+ export { isFilesystem } from '../utils/isFilesystem.js';
12
+ export { isJson } from '../utils/isJson.js';
13
+ export { isObject } from '../utils/isObject.js';
14
+ export { isYaml } from '../utils/isYaml.js';
15
+ export { LoadPlugin, load } from '../utils/load/load.js';
16
+ export { normalize } from '../utils/normalize.js';
17
+ export { toJson } from '../utils/toJson.js';
18
+ export { toYaml } from '../utils/toYaml.js';
19
+ export { transformErrors } from '../utils/transformErrors.js';
20
+ export { traverse } from '../utils/traverse.js';
21
+ export { unescapeJsonPointer } from '../utils/unescapeJsonPointer.js';
22
+ export { upgrade } from '../utils/upgrade.js';
23
+ export { upgradeFromThreeToThreeOne } from '../utils/upgradeFromThreeToThreeOne.js';
24
+ export { upgradeFromTwoToThree } from '../utils/upgradeFromTwoToThree.js';
25
+ export { validate } from '../utils/validate.js';
26
+ export { Action, AnyApiDefinitionFormat, Queue, openapi } from '../pipeline.js';
27
+ export { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '../types/openapi-types.js';
package/dist/src/index.js CHANGED
@@ -13,8 +13,6 @@ export { isJson } from './utils/isJson.js';
13
13
  export { isObject } from './utils/isObject.js';
14
14
  export { isYaml } from './utils/isYaml.js';
15
15
  export { load } from './utils/load/load.js';
16
- export { fetchUrlsPlugin, fetchUrlsPluginDefaultConfiguration } from './utils/load/plugins/fetchUrlsPlugin.js';
17
- export { readFilesPlugin } from './utils/load/plugins/readFilesPlugin.js';
18
16
  export { normalize } from './utils/normalize.js';
19
17
  export { toJson } from './utils/toJson.js';
20
18
  export { toYaml } from './utils/toYaml.js';