@scalar/openapi-parser 0.5.0 → 0.6.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.
- package/CHANGELOG.md +11 -0
- package/README.md +6 -6
- package/dist/index.d.ts +2 -2
- package/dist/pipeline.d.ts +153 -210
- package/dist/src/pipeline.js +15 -25
- package/dist/src/utils/filter.js +8 -3
- package/dist/src/utils/isYaml.js +3 -2
- package/dist/src/utils/load/load.js +19 -6
- package/dist/src/utils/load/plugins/fetchUrlsPlugin.js +1 -1
- package/dist/src/utils/normalize.js +3 -1
- package/dist/src/utils/upgrade.js +5 -3
- package/dist/src/utils/workThroughQueue.js +24 -0
- package/dist/types/index.d.ts +23 -8
- package/dist/utils/dereference.d.ts +2 -2
- package/dist/utils/details.d.ts +2 -6
- package/dist/utils/filter.d.ts +2 -2
- package/dist/utils/load/load.d.ts +2 -2
- package/dist/utils/load/plugins/fetchUrlsPlugin.d.ts +7 -0
- package/dist/utils/resolveReferences.d.ts +1 -1
- package/dist/utils/upgrade.d.ts +2 -2
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -4
- /package/dist/types/{openapi.d.ts → openapi-types.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @scalar/openapi-parser
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 61252ab: refactor!: most functions return an object now
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- c9dd499: feat: intercept fetch requests
|
|
12
|
+
- 61252ab: fix: max call stack exceeded error
|
|
13
|
+
|
|
3
14
|
## 0.5.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -47,12 +47,12 @@ const file = `{
|
|
|
47
47
|
"paths": {}
|
|
48
48
|
}`
|
|
49
49
|
|
|
50
|
-
const
|
|
50
|
+
const { valid, errors } = await validate(file)
|
|
51
51
|
|
|
52
|
-
console.log(
|
|
52
|
+
console.log(valid)
|
|
53
53
|
|
|
54
|
-
if (!
|
|
55
|
-
console.log(
|
|
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
|
|
73
|
+
const { version } = await dereference(file)
|
|
74
74
|
|
|
75
|
-
console.log(
|
|
75
|
+
console.log(version)
|
|
76
76
|
```
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Validator, jsonSchemaVersions } from './lib/Validator/Validator.js';
|
|
2
2
|
export { ResolveReferencesResult, resolveReferences } from './utils/resolveReferences.js';
|
|
3
|
-
export { AjvOptions, AnyObject, ErrorObject, Filesystem, FilesystemEntry,
|
|
3
|
+
export { AjvOptions, AnyObject, DereferenceResult, DetailsResult, ErrorObject, Filesystem, FilesystemEntry, FilterResult, LoadResult, UpgradeResult, ValidateResult } from './types/index.js';
|
|
4
4
|
export { dereference } from './utils/dereference.js';
|
|
5
5
|
export { details } from './utils/details.js';
|
|
6
6
|
export { escapeJsonPointer } from './utils/escapeJsonPointer.js';
|
|
@@ -26,4 +26,4 @@ export { upgradeFromThreeToThreeOne } from './utils/upgradeFromThreeToThreeOne.j
|
|
|
26
26
|
export { upgradeFromTwoToThree } from './utils/upgradeFromTwoToThree.js';
|
|
27
27
|
export { validate } from './utils/validate.js';
|
|
28
28
|
export { Action, AnyApiDefinitionFormat, Queue, openapi } from './pipeline.js';
|
|
29
|
-
export { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from './types/openapi.js';
|
|
29
|
+
export { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from './types/openapi-types.js';
|
package/dist/pipeline.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { AnyObject, Filesystem,
|
|
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 {
|
|
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<
|
|
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<
|
|
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<
|
|
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: () =>
|
|
59
|
+
validate: () => {
|
|
65
60
|
filter: (callback: (Specification: AnyObject) => boolean) => any;
|
|
66
|
-
get: () => Promise<
|
|
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<
|
|
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
|
-
|
|
83
|
-
specification?: OpenAPI.Document<{}>;
|
|
84
|
-
version?: string;
|
|
85
|
-
errors?: ErrorObject[];
|
|
86
|
-
schema?: OpenAPI.Document<{}>;
|
|
87
|
-
}>;
|
|
77
|
+
};
|
|
88
78
|
dereference: () => {
|
|
89
|
-
get: () => Promise<
|
|
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: () =>
|
|
90
|
+
validate: () => {
|
|
99
91
|
filter: (callback: (Specification: AnyObject) => boolean) => any;
|
|
100
|
-
get: () => Promise<
|
|
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<
|
|
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
|
-
|
|
117
|
-
specification?: OpenAPI.Document<{}>;
|
|
118
|
-
version?: string;
|
|
119
|
-
errors?: ErrorObject[];
|
|
120
|
-
schema?: OpenAPI.Document<{}>;
|
|
121
|
-
}>;
|
|
108
|
+
};
|
|
122
109
|
dereference: () => {
|
|
123
|
-
get: () => Promise<
|
|
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<
|
|
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<
|
|
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: () =>
|
|
135
|
+
validate: () => {
|
|
151
136
|
filter: (callback: (Specification: AnyObject) => boolean) => any;
|
|
152
|
-
get: () => Promise<
|
|
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<
|
|
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
|
-
|
|
169
|
-
specification?: OpenAPI.Document<{}>;
|
|
170
|
-
version?: string;
|
|
171
|
-
errors?: ErrorObject[];
|
|
172
|
-
schema?: OpenAPI.Document<{}>;
|
|
173
|
-
}>;
|
|
153
|
+
};
|
|
174
154
|
dereference: () => {
|
|
175
|
-
get: () => Promise<
|
|
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: () =>
|
|
166
|
+
validate: () => {
|
|
185
167
|
filter: (callback: (Specification: AnyObject) => boolean) => {
|
|
186
|
-
get: () => Promise<
|
|
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: () =>
|
|
175
|
+
validate: () => any;
|
|
196
176
|
dereference: () => {
|
|
197
|
-
get: () => Promise<
|
|
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<
|
|
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<
|
|
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<
|
|
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: () =>
|
|
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
|
-
|
|
237
|
-
specification?: OpenAPI.Document<{}>;
|
|
238
|
-
version?: string;
|
|
239
|
-
errors?: ErrorObject[];
|
|
240
|
-
schema?: OpenAPI.Document<{}>;
|
|
241
|
-
}>;
|
|
216
|
+
};
|
|
242
217
|
dereference: () => {
|
|
243
|
-
get: () => Promise<
|
|
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<
|
|
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: () =>
|
|
230
|
+
validate: () => {
|
|
256
231
|
filter: (callback: (Specification: AnyObject) => boolean) => any;
|
|
257
|
-
get: () => Promise<
|
|
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
|
-
|
|
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: () =>
|
|
251
|
+
validate: () => {
|
|
284
252
|
filter: (callback: (Specification: AnyObject) => boolean) => {
|
|
285
|
-
get: () => Promise<
|
|
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<
|
|
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: () =>
|
|
266
|
+
validate: () => any;
|
|
303
267
|
dereference: () => {
|
|
304
|
-
get: () => Promise<
|
|
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: () =>
|
|
279
|
+
validate: () => any;
|
|
314
280
|
dereference: () => {
|
|
315
|
-
get: () => Promise<
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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: () =>
|
|
316
|
+
validate: () => any;
|
|
353
317
|
dereference: () => any;
|
|
354
318
|
toJson: () => Promise<string>;
|
|
355
319
|
toYaml: () => Promise<string>;
|
|
356
320
|
};
|
|
357
|
-
validate: () =>
|
|
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
|
-
|
|
368
|
-
specification?: OpenAPI.Document<{}>;
|
|
369
|
-
version?: string;
|
|
370
|
-
errors?: ErrorObject[];
|
|
371
|
-
schema?: OpenAPI.Document<{}>;
|
|
372
|
-
}>;
|
|
331
|
+
};
|
|
373
332
|
dereference: () => {
|
|
374
|
-
get: () => Promise<
|
|
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<
|
|
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<
|
|
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: () =>
|
|
351
|
+
validate: () => {
|
|
395
352
|
filter: (callback: (Specification: AnyObject) => boolean) => any;
|
|
396
|
-
get: () => Promise<
|
|
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
|
-
|
|
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: () =>
|
|
366
|
+
validate: () => {
|
|
417
367
|
filter: (callback: (Specification: AnyObject) => boolean) => any;
|
|
418
|
-
get: () => Promise<
|
|
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
|
-
|
|
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>;
|
package/dist/src/pipeline.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { workThroughQueue } from './utils/workThroughQueue.js';
|
|
2
2
|
import { upgrade } from './utils/upgrade.js';
|
|
3
3
|
import { validate } from './utils/validate.js';
|
|
4
4
|
import { dereference } from './utils/dereference.js';
|
|
@@ -51,10 +51,11 @@ function upgradeAction(queue) {
|
|
|
51
51
|
toYaml: () => toYamlAction(queue)
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
function validateAction(queue) {
|
|
55
|
+
queue.tasks.push({
|
|
56
|
+
action: validate
|
|
57
|
+
});
|
|
56
58
|
return {
|
|
57
|
-
...await validate(filesystem),
|
|
58
59
|
filter: (callback) => filterAction(queue, callback),
|
|
59
60
|
get: () => getAction(queue),
|
|
60
61
|
files: () => filesAction(queue),
|
|
@@ -94,38 +95,27 @@ function filterAction(queue, callback) {
|
|
|
94
95
|
};
|
|
95
96
|
}
|
|
96
97
|
async function getAction(queue) {
|
|
97
|
-
const
|
|
98
|
-
|
|
98
|
+
const result = await workThroughQueue(queue);
|
|
99
|
+
if (result.specification === void 0) {
|
|
100
|
+
result.specification = getEntrypoint(result.filesystem).specification;
|
|
101
|
+
}
|
|
102
|
+
return result;
|
|
99
103
|
}
|
|
100
104
|
async function filesAction(queue) {
|
|
101
|
-
|
|
105
|
+
const { filesystem } = await workThroughQueue(queue);
|
|
106
|
+
return filesystem;
|
|
102
107
|
}
|
|
103
108
|
async function detailsAction(queue) {
|
|
104
|
-
const filesystem = await workThroughQueue(queue);
|
|
109
|
+
const { filesystem } = await workThroughQueue(queue);
|
|
105
110
|
return details(getEntrypoint(filesystem).specification);
|
|
106
111
|
}
|
|
107
112
|
async function toJsonAction(queue) {
|
|
108
|
-
const filesystem = await workThroughQueue(queue);
|
|
113
|
+
const { filesystem } = await workThroughQueue(queue);
|
|
109
114
|
return toJson(getEntrypoint(filesystem).specification);
|
|
110
115
|
}
|
|
111
116
|
async function toYamlAction(queue) {
|
|
112
|
-
const filesystem = await workThroughQueue(queue);
|
|
117
|
+
const { filesystem } = await workThroughQueue(queue);
|
|
113
118
|
return toYaml(getEntrypoint(filesystem).specification);
|
|
114
119
|
}
|
|
115
|
-
async function workThroughQueue(queue) {
|
|
116
|
-
let specification = queue.specification;
|
|
117
|
-
for (const { action, options } of queue.tasks) {
|
|
118
|
-
if (typeof action !== "function") {
|
|
119
|
-
console.warn("[queue] The given action is not a function:", action);
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
122
|
-
if (action.constructor.name === "AsyncFunction") {
|
|
123
|
-
specification = await action(specification, options);
|
|
124
|
-
} else {
|
|
125
|
-
specification = action(specification, options);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return makeFilesystem(specification);
|
|
129
|
-
}
|
|
130
120
|
|
|
131
121
|
export { openapi };
|
package/dist/src/utils/filter.js
CHANGED
|
@@ -4,9 +4,14 @@ import { traverse } from './traverse.js';
|
|
|
4
4
|
|
|
5
5
|
function filter(specification, callback) {
|
|
6
6
|
const filesystem = makeFilesystem(specification);
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
return {
|
|
8
|
+
specification: traverse(
|
|
9
|
+
getEntrypoint(filesystem).specification,
|
|
10
|
+
(schema) => {
|
|
11
|
+
return callback(schema) ? schema : void 0;
|
|
12
|
+
}
|
|
13
|
+
)
|
|
14
|
+
};
|
|
10
15
|
}
|
|
11
16
|
|
|
12
17
|
export { filter };
|
package/dist/src/utils/isYaml.js
CHANGED
|
@@ -1,30 +1,41 @@
|
|
|
1
|
+
import { getEntrypoint } from '../getEntrypoint.js';
|
|
1
2
|
import { getListOfReferences } from '../getListOfReferences.js';
|
|
2
3
|
import { makeFilesystem } from '../makeFilesystem.js';
|
|
3
4
|
import { normalize } from '../normalize.js';
|
|
4
5
|
|
|
5
6
|
async function load(value, options) {
|
|
6
7
|
if (options?.filesystem && options?.filesystem.find((entry) => entry.filename === value)) {
|
|
7
|
-
return
|
|
8
|
+
return {
|
|
9
|
+
filesystem: options.filesystem
|
|
10
|
+
};
|
|
8
11
|
}
|
|
9
12
|
const plugin = options?.plugins?.find((plugin2) => plugin2.check(value));
|
|
10
13
|
const content = normalize(plugin ? await plugin.get(value) : value);
|
|
11
14
|
if (content === void 0) {
|
|
12
|
-
return
|
|
15
|
+
return {
|
|
16
|
+
filesystem: []
|
|
17
|
+
};
|
|
13
18
|
}
|
|
14
19
|
let filesystem = makeFilesystem(content, {
|
|
15
20
|
filename: options?.filename ?? null
|
|
16
21
|
});
|
|
17
|
-
const
|
|
22
|
+
const newEntry = options?.filename ? filesystem.find((entry) => entry.filename === options?.filename) : getEntrypoint(filesystem);
|
|
23
|
+
const listOfReferences = newEntry.references ?? getListOfReferences(content);
|
|
18
24
|
if (listOfReferences.length === 0) {
|
|
19
|
-
return
|
|
25
|
+
return {
|
|
26
|
+
filesystem
|
|
27
|
+
};
|
|
20
28
|
}
|
|
21
29
|
for (const reference of listOfReferences) {
|
|
22
30
|
const plugin2 = options?.plugins?.find((plugin3) => plugin3.check(reference));
|
|
31
|
+
if (!plugin2) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
23
34
|
const target = plugin2.check(reference) && plugin2.resolvePath ? plugin2.resolvePath(value, reference) : reference;
|
|
24
35
|
if (filesystem.find((entry) => entry.filename === reference)) {
|
|
25
36
|
continue;
|
|
26
37
|
}
|
|
27
|
-
const referencedFiles = await load(target, {
|
|
38
|
+
const { filesystem: referencedFiles } = await load(target, {
|
|
28
39
|
...options,
|
|
29
40
|
// Make the filename the exact same value as the $ref
|
|
30
41
|
// TODO: This leads to problems, if there are multiple references with the same file name but in different folders
|
|
@@ -40,7 +51,9 @@ async function load(value, options) {
|
|
|
40
51
|
})
|
|
41
52
|
];
|
|
42
53
|
}
|
|
43
|
-
return
|
|
54
|
+
return {
|
|
55
|
+
filesystem
|
|
56
|
+
};
|
|
44
57
|
}
|
|
45
58
|
|
|
46
59
|
export { load };
|
|
@@ -26,7 +26,7 @@ const fetchUrlsPlugin = (customConfiguration) => {
|
|
|
26
26
|
}
|
|
27
27
|
try {
|
|
28
28
|
numberOfRequests++;
|
|
29
|
-
const response = await fetch(value);
|
|
29
|
+
const response = await (configuration?.fetch ? configuration.fetch(value) : fetch(value));
|
|
30
30
|
return await response.text();
|
|
31
31
|
} catch (error) {
|
|
32
32
|
console.error("[fetchUrlsPlugin]", error.message, `(${value})`);
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { getEntrypoint } from './getEntrypoint.js';
|
|
2
|
-
import { isFilesystem } from './isFilesystem.js';
|
|
3
2
|
import { makeFilesystem } from './makeFilesystem.js';
|
|
4
3
|
import { upgradeFromThreeToThreeOne } from './upgradeFromThreeToThreeOne.js';
|
|
5
4
|
import { upgradeFromTwoToThree } from './upgradeFromTwoToThree.js';
|
|
6
5
|
|
|
7
6
|
function upgrade(specification, _options) {
|
|
8
7
|
const upgraders = [upgradeFromTwoToThree, upgradeFromThreeToThreeOne];
|
|
9
|
-
const wasFilesystem = isFilesystem(specification);
|
|
10
8
|
const result = upgraders.reduce(
|
|
11
9
|
(specification2, upgrader) => upgrader(specification2),
|
|
12
10
|
getEntrypoint(makeFilesystem(specification)).specification
|
|
13
11
|
);
|
|
14
|
-
return
|
|
12
|
+
return {
|
|
13
|
+
specification: result,
|
|
14
|
+
// TODO: Make dynamic
|
|
15
|
+
version: "3.1"
|
|
16
|
+
};
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export { upgrade };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
async function workThroughQueue(queue) {
|
|
2
|
+
let specification = queue.specification;
|
|
3
|
+
let result;
|
|
4
|
+
for (const { action, options } of queue.tasks) {
|
|
5
|
+
if (typeof action !== "function") {
|
|
6
|
+
console.warn("[queue] The given action is not a function:", action);
|
|
7
|
+
continue;
|
|
8
|
+
}
|
|
9
|
+
if (action.constructor.name === "AsyncFunction") {
|
|
10
|
+
result = {
|
|
11
|
+
...result,
|
|
12
|
+
...await action(result?.filesystem ?? specification, options)
|
|
13
|
+
};
|
|
14
|
+
} else {
|
|
15
|
+
result = {
|
|
16
|
+
...result,
|
|
17
|
+
...action(result?.filesystem ?? specification, options)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { workThroughQueue };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { ERRORS } from '../configuration.js';
|
|
2
|
-
import { OpenAPI } from './openapi.js';
|
|
3
|
-
export { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from './openapi.js';
|
|
1
|
+
import { OpenApiVersion, ERRORS } from '../configuration.js';
|
|
2
|
+
import { OpenAPI } from './openapi-types.js';
|
|
3
|
+
export { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from './openapi-types.js';
|
|
4
4
|
|
|
5
5
|
type AnyObject = Record<string, any>;
|
|
6
|
+
type LoadResult = {
|
|
7
|
+
filesystem: Filesystem;
|
|
8
|
+
};
|
|
6
9
|
type ValidateResult = {
|
|
7
10
|
valid: boolean;
|
|
8
11
|
specification?: OpenAPI.Document;
|
|
@@ -10,16 +13,28 @@ type ValidateResult = {
|
|
|
10
13
|
errors?: ErrorObject[];
|
|
11
14
|
schema?: OpenAPI.Document;
|
|
12
15
|
};
|
|
13
|
-
type
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
type UpgradeResult = {
|
|
17
|
+
specification: OpenAPI.Document;
|
|
18
|
+
version: string;
|
|
19
|
+
};
|
|
20
|
+
type FilterResult = {
|
|
21
|
+
specification: OpenAPI.Document;
|
|
16
22
|
};
|
|
17
|
-
type
|
|
23
|
+
type DetailsResult = {
|
|
24
|
+
version: OpenApiVersion;
|
|
25
|
+
specificationType: string;
|
|
26
|
+
specificationVersion: string;
|
|
27
|
+
};
|
|
28
|
+
type DereferenceResult = {
|
|
18
29
|
version: string | undefined;
|
|
19
30
|
specification?: OpenAPI.Document;
|
|
20
31
|
schema?: OpenAPI.Document;
|
|
21
32
|
errors?: ErrorObject[];
|
|
22
33
|
};
|
|
34
|
+
type ErrorObject = {
|
|
35
|
+
message: string;
|
|
36
|
+
code?: keyof typeof ERRORS | string;
|
|
37
|
+
};
|
|
23
38
|
type AjvOptions = {
|
|
24
39
|
strict?: boolean | 'log';
|
|
25
40
|
};
|
|
@@ -39,4 +54,4 @@ type FilesystemEntry = {
|
|
|
39
54
|
specification: AnyObject;
|
|
40
55
|
};
|
|
41
56
|
|
|
42
|
-
export { type AjvOptions, type AnyObject, type ErrorObject, type Filesystem, type FilesystemEntry, OpenAPI, type
|
|
57
|
+
export { type AjvOptions, type AnyObject, type DereferenceResult, type DetailsResult, type ErrorObject, type Filesystem, type FilesystemEntry, type FilterResult, type LoadResult, OpenAPI, type UpgradeResult, type ValidateResult };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyObject, Filesystem,
|
|
1
|
+
import { AnyObject, Filesystem, DereferenceResult } from '../types/index.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Validates an OpenAPI schema and resolves all references.
|
|
5
5
|
*/
|
|
6
|
-
declare function dereference(value: string | AnyObject | Filesystem): Promise<
|
|
6
|
+
declare function dereference(value: string | AnyObject | Filesystem): Promise<DereferenceResult>;
|
|
7
7
|
|
|
8
8
|
export { dereference };
|
package/dist/utils/details.d.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { AnyObject } from '../types/index.js';
|
|
1
|
+
import { AnyObject, DetailsResult } from '../types/index.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Get versions of the OpenAPI specification.
|
|
5
5
|
*/
|
|
6
|
-
declare function details(specification: AnyObject):
|
|
7
|
-
version: "2.0" | "3.0" | "3.1";
|
|
8
|
-
specificationType: string;
|
|
9
|
-
specificationVersion: string;
|
|
10
|
-
};
|
|
6
|
+
declare function details(specification: AnyObject): DetailsResult;
|
|
11
7
|
|
|
12
8
|
export { details };
|
package/dist/utils/filter.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyObject } from '../types/index.js';
|
|
1
|
+
import { AnyObject, FilterResult } from '../types/index.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Filter the specification based on the callback
|
|
5
5
|
*/
|
|
6
|
-
declare function filter(specification: AnyObject, callback: (schema: AnyObject) => boolean):
|
|
6
|
+
declare function filter(specification: AnyObject, callback: (schema: AnyObject) => boolean): FilterResult;
|
|
7
7
|
|
|
8
8
|
export { filter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Filesystem } from '../../types/index.js';
|
|
1
|
+
import { Filesystem, LoadResult } from '../../types/index.js';
|
|
2
2
|
|
|
3
3
|
type LoadPlugin = {
|
|
4
4
|
check: (value?: any) => boolean;
|
|
@@ -11,6 +11,6 @@ declare function load(value: any, options?: {
|
|
|
11
11
|
plugins?: LoadPlugin[];
|
|
12
12
|
filename?: string;
|
|
13
13
|
filesystem?: Filesystem;
|
|
14
|
-
}): Promise<
|
|
14
|
+
}): Promise<LoadResult>;
|
|
15
15
|
|
|
16
16
|
export { type LoadPlugin, load };
|
|
@@ -4,7 +4,14 @@ declare const fetchUrlsPluginDefaultConfiguration: {
|
|
|
4
4
|
limit: number;
|
|
5
5
|
};
|
|
6
6
|
declare const fetchUrlsPlugin: (customConfiguration?: {
|
|
7
|
+
/**
|
|
8
|
+
* Limit the number of requests. Set to `false` to disable the limit.
|
|
9
|
+
*/
|
|
7
10
|
limit?: number | false;
|
|
11
|
+
/**
|
|
12
|
+
* Fetch function to use instead of the global fetch. Use this to intercept requests.
|
|
13
|
+
*/
|
|
14
|
+
fetch?: (url: string) => Promise<Response>;
|
|
8
15
|
}) => LoadPlugin;
|
|
9
16
|
|
|
10
17
|
export { fetchUrlsPlugin, fetchUrlsPluginDefaultConfiguration };
|
package/dist/utils/upgrade.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyObject, Filesystem } from '../types/index.js';
|
|
1
|
+
import { AnyObject, Filesystem, UpgradeResult } from '../types/index.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Upgrade specification to OpenAPI 3.1.0
|
|
5
5
|
*/
|
|
6
|
-
declare function upgrade(specification: AnyObject | Filesystem, _options?: AnyObject):
|
|
6
|
+
declare function upgrade(specification: AnyObject | Filesystem, _options?: AnyObject): UpgradeResult;
|
|
7
7
|
|
|
8
8
|
export { upgrade };
|
package/dist/webpack-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"builtAt":1717167358859,"assets":[{"name":"src/index.js","size":1587},{"name":"src/pipeline.js","size":3978},{"name":"src/lib/Validator/Validator.js","size":3166},{"name":"src/utils/resolveReferences.js","size":2951},{"name":"src/utils/dereference.js","size":566},{"name":"src/utils/details.js","size":571},{"name":"src/utils/escapeJsonPointer.js","size":122},{"name":"src/utils/filter.js","size":392},{"name":"src/utils/getEntrypoint.js","size":121},{"name":"src/utils/getListOfReferences.js","size":477},{"name":"src/utils/getSegmentsFromPath.js","size":228},{"name":"src/utils/isFilesystem.js","size":189},{"name":"src/utils/isJson.js","size":129},{"name":"src/utils/isObject.js","size":112},{"name":"src/utils/isYaml.js","size":249},{"name":"src/utils/load/load.js","size":1581},{"name":"src/utils/load/plugins/fetchUrlsPlugin.js","size":1065},{"name":"src/utils/load/plugins/readFilesPlugin.js","size":1224},{"name":"src/utils/normalize.js","size":393},{"name":"src/utils/toJson.js","size":78},{"name":"src/utils/toYaml.js","size":99},{"name":"src/utils/transformErrors.js","size":402},{"name":"src/utils/traverse.js","size":557},{"name":"src/utils/unescapeJsonPointer.js","size":136},{"name":"src/utils/upgrade.js","size":717},{"name":"src/utils/upgradeFromThreeToThreeOne.js","size":2127},{"name":"src/utils/upgradeFromTwoToThree.js","size":109},{"name":"src/utils/validate.js","size":413},{"name":"src/utils/makeFilesystem.js","size":520},{"name":"src/configuration.js","size":858},{"name":"src/utils/betterAjvErrors/index.js","size":439},{"name":"schemas/v2.0/schema.json.js","size":30949},{"name":"schemas/v3.0/schema.json.js","size":25234},{"name":"schemas/v3.1/schema.json.js","size":24839},{"name":"src/utils/betterAjvErrors/helpers.js","size":3303},{"name":"src/polyfills/path.js","size":1963},{"name":"src/utils/betterAjvErrors/utils.js","size":756},{"name":"src/utils/betterAjvErrors/validation-errors/enum.js","size":1252},{"name":"src/utils/betterAjvErrors/validation-errors/default.js","size":444},{"name":"src/utils/betterAjvErrors/validation-errors/unevaluated-prop.js","size":505},{"name":"src/utils/betterAjvErrors/validation-errors/required.js","size":384},{"name":"src/utils/betterAjvErrors/validation-errors/pattern.js","size":493},{"name":"src/utils/betterAjvErrors/validation-errors/additional-prop.js","size":501},{"name":"src/utils/betterAjvErrors/validation-errors/base.js","size":648}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["src/index.js"],"names":["src/index"]},{"id":"1610f8d","entry":false,"initial":true,"files":["src/pipeline.js"],"names":["src/pipeline"]},{"id":"a5b5029","entry":false,"initial":true,"files":["src/lib/Validator/Validator.js"],"names":["src/lib/Validator/Validator"]},{"id":"aea20c6","entry":false,"initial":true,"files":["src/utils/resolveReferences.js"],"names":["src/utils/resolveReferences"]},{"id":"f9b6a1a","entry":false,"initial":true,"files":["src/utils/dereference.js"],"names":["src/utils/dereference"]},{"id":"c64a2fa","entry":false,"initial":true,"files":["src/utils/details.js"],"names":["src/utils/details"]},{"id":"398f36d","entry":false,"initial":true,"files":["src/utils/escapeJsonPointer.js"],"names":["src/utils/escapeJsonPointer"]},{"id":"6c7ec36","entry":false,"initial":true,"files":["src/utils/filter.js"],"names":["src/utils/filter"]},{"id":"c07bf08","entry":false,"initial":true,"files":["src/utils/getEntrypoint.js"],"names":["src/utils/getEntrypoint"]},{"id":"13f9e1e","entry":false,"initial":true,"files":["src/utils/getListOfReferences.js"],"names":["src/utils/getListOfReferences"]},{"id":"b5bffbd","entry":false,"initial":true,"files":["src/utils/getSegmentsFromPath.js"],"names":["src/utils/getSegmentsFromPath"]},{"id":"8ea971a","entry":false,"initial":true,"files":["src/utils/isFilesystem.js"],"names":["src/utils/isFilesystem"]},{"id":"20e0bc7","entry":false,"initial":true,"files":["src/utils/isJson.js"],"names":["src/utils/isJson"]},{"id":"3180f00","entry":false,"initial":true,"files":["src/utils/isObject.js"],"names":["src/utils/isObject"]},{"id":"2305281","entry":false,"initial":true,"files":["src/utils/isYaml.js"],"names":["src/utils/isYaml"]},{"id":"6e9fd1a","entry":false,"initial":true,"files":["src/utils/load/load.js"],"names":["src/utils/load/load"]},{"id":"924bd2a","entry":false,"initial":true,"files":["src/utils/load/plugins/fetchUrlsPlugin.js"],"names":["src/utils/load/plugins/fetchUrlsPlugin"]},{"id":"eb4c5f3","entry":false,"initial":true,"files":["src/utils/load/plugins/readFilesPlugin.js"],"names":["src/utils/load/plugins/readFilesPlugin"]},{"id":"c62fce7","entry":false,"initial":true,"files":["src/utils/normalize.js"],"names":["src/utils/normalize"]},{"id":"ff23e2d","entry":false,"initial":true,"files":["src/utils/toJson.js"],"names":["src/utils/toJson"]},{"id":"893a485","entry":false,"initial":true,"files":["src/utils/toYaml.js"],"names":["src/utils/toYaml"]},{"id":"8d99789","entry":false,"initial":true,"files":["src/utils/transformErrors.js"],"names":["src/utils/transformErrors"]},{"id":"e6dbaad","entry":false,"initial":true,"files":["src/utils/traverse.js"],"names":["src/utils/traverse"]},{"id":"a5b1973","entry":false,"initial":true,"files":["src/utils/unescapeJsonPointer.js"],"names":["src/utils/unescapeJsonPointer"]},{"id":"7e74bc8","entry":false,"initial":true,"files":["src/utils/upgrade.js"],"names":["src/utils/upgrade"]},{"id":"acc1a8d","entry":false,"initial":true,"files":["src/utils/upgradeFromThreeToThreeOne.js"],"names":["src/utils/upgradeFromThreeToThreeOne"]},{"id":"d98a7d1","entry":false,"initial":true,"files":["src/utils/upgradeFromTwoToThree.js"],"names":["src/utils/upgradeFromTwoToThree"]},{"id":"ec25ebd","entry":false,"initial":true,"files":["src/utils/validate.js"],"names":["src/utils/validate"]},{"id":"90e5eec","entry":false,"initial":true,"files":["src/utils/makeFilesystem.js"],"names":["src/utils/makeFilesystem"]},{"id":"1eb4908","entry":false,"initial":true,"files":["src/configuration.js"],"names":["src/configuration"]},{"id":"a7c663b","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/index.js"],"names":["src/utils/betterAjvErrors/index"]},{"id":"7d833d7","entry":false,"initial":true,"files":["schemas/v2.0/schema.json.js"],"names":["schemas/v2.0/schema.json"]},{"id":"3870082","entry":false,"initial":true,"files":["schemas/v3.0/schema.json.js"],"names":["schemas/v3.0/schema.json"]},{"id":"ba96e53","entry":false,"initial":true,"files":["schemas/v3.1/schema.json.js"],"names":["schemas/v3.1/schema.json"]},{"id":"003968b","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/helpers.js"],"names":["src/utils/betterAjvErrors/helpers"]},{"id":"20a5186","entry":false,"initial":true,"files":["src/polyfills/path.js"],"names":["src/polyfills/path"]},{"id":"8c3e592","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/utils.js"],"names":["src/utils/betterAjvErrors/utils"]},{"id":"b67304b","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/validation-errors/enum.js"],"names":["src/utils/betterAjvErrors/validation-errors/enum"]},{"id":"0587cdd","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/validation-errors/default.js"],"names":["src/utils/betterAjvErrors/validation-errors/default"]},{"id":"4f9c5a8","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/validation-errors/unevaluated-prop.js"],"names":["src/utils/betterAjvErrors/validation-errors/unevaluated-prop"]},{"id":"74cdbcb","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/validation-errors/required.js"],"names":["src/utils/betterAjvErrors/validation-errors/required"]},{"id":"8f5040f","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/validation-errors/pattern.js"],"names":["src/utils/betterAjvErrors/validation-errors/pattern"]},{"id":"7c5b700","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/validation-errors/additional-prop.js"],"names":["src/utils/betterAjvErrors/validation-errors/additional-prop"]},{"id":"372b5cd","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/validation-errors/base.js"],"names":["src/utils/betterAjvErrors/validation-errors/base"]}],"modules":[{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/pipeline.ts","size":3466,"chunks":["1610f8d"]},{"name":"./src/lib/Validator/Validator.ts","size":2737,"chunks":["a5b5029"]},{"name":"./src/utils/resolveReferences.ts","size":2702,"chunks":["aea20c6"]},{"name":"./src/utils/dereference.ts","size":333,"chunks":["f9b6a1a"]},{"name":"./src/utils/details.ts","size":493,"chunks":["c64a2fa"]},{"name":"./src/utils/escapeJsonPointer.ts","size":90,"chunks":["398f36d"]},{"name":"./src/utils/filter.ts","size":222,"chunks":["6c7ec36"]},{"name":"./src/utils/getEntrypoint.ts","size":93,"chunks":["c07bf08"]},{"name":"./src/utils/getListOfReferences.ts","size":400,"chunks":["13f9e1e"]},{"name":"./src/utils/getSegmentsFromPath.ts","size":129,"chunks":["b5bffbd"]},{"name":"./src/utils/isFilesystem.ts","size":162,"chunks":["8ea971a"]},{"name":"./src/utils/isJson.ts","size":108,"chunks":["20e0bc7"]},{"name":"./src/utils/isObject.ts","size":89,"chunks":["3180f00"]},{"name":"./src/utils/isYaml.ts","size":197,"chunks":["2305281"]},{"name":"./src/utils/load/load.ts","size":1396,"chunks":["6e9fd1a"]},{"name":"./src/utils/load/plugins/fetchUrlsPlugin.ts","size":998,"chunks":["924bd2a"]},{"name":"./src/utils/load/plugins/readFilesPlugin.ts","size":971,"chunks":["eb4c5f3"]},{"name":"./src/utils/normalize.ts","size":288,"chunks":["c62fce7"]},{"name":"./src/utils/toJson.ts","size":57,"chunks":["ff23e2d"]},{"name":"./src/utils/toYaml.ts","size":43,"chunks":["893a485"]},{"name":"./src/utils/transformErrors.ts","size":309,"chunks":["8d99789"]},{"name":"./src/utils/traverse.ts","size":534,"chunks":["e6dbaad"]},{"name":"./src/utils/unescapeJsonPointer.ts","size":102,"chunks":["a5b1973"]},{"name":"./src/utils/upgrade.ts","size":392,"chunks":["7e74bc8"]},{"name":"./src/utils/upgradeFromThreeToThreeOne.ts","size":2043,"chunks":["acc1a8d"]},{"name":"./src/utils/upgradeFromTwoToThree.ts","size":73,"chunks":["d98a7d1"]},{"name":"./src/utils/validate.ts","size":276,"chunks":["ec25ebd"]},{"name":"./src/utils/makeFilesystem.ts","size":332,"chunks":["90e5eec"]},{"name":"./src/configuration.ts","size":628,"chunks":["1eb4908"]},{"name":"./src/utils/betterAjvErrors/index.ts","size":371,"chunks":["a7c663b"]},{"name":"./schemas/v2.0/schema.json","size":30812,"chunks":["7d833d7"]},{"name":"./schemas/v3.0/schema.json","size":25091,"chunks":["3870082"]},{"name":"./schemas/v3.1/schema.json","size":24706,"chunks":["ba96e53"]},{"name":"./src/utils/betterAjvErrors/helpers.ts","size":2636,"chunks":["003968b"]},{"name":"./src/polyfills/path.ts","size":1912,"chunks":["20a5186"]},{"name":"./src/utils/betterAjvErrors/utils.js","size":637,"chunks":["8c3e592"]},{"name":"./src/utils/betterAjvErrors/validation-errors/enum.js","size":1099,"chunks":["b67304b"]},{"name":"./src/utils/betterAjvErrors/validation-errors/default.js","size":350,"chunks":["0587cdd"]},{"name":"./src/utils/betterAjvErrors/validation-errors/unevaluated-prop.js","size":403,"chunks":["4f9c5a8"]},{"name":"./src/utils/betterAjvErrors/validation-errors/required.js","size":289,"chunks":["74cdbcb"]},{"name":"./src/utils/betterAjvErrors/validation-errors/pattern.js","size":399,"chunks":["8f5040f"]},{"name":"./src/utils/betterAjvErrors/validation-errors/additional-prop.js","size":400,"chunks":["7c5b700"]},{"name":"./src/utils/betterAjvErrors/validation-errors/base.js","size":603,"chunks":["372b5cd"]}]}
|
|
1
|
+
{"builtAt":1717672264982,"assets":[{"name":"src/index.js","size":1587},{"name":"src/pipeline.js","size":3563},{"name":"src/lib/Validator/Validator.js","size":3166},{"name":"src/utils/resolveReferences.js","size":2951},{"name":"src/utils/dereference.js","size":566},{"name":"src/utils/details.js","size":571},{"name":"src/utils/escapeJsonPointer.js","size":122},{"name":"src/utils/filter.js","size":443},{"name":"src/utils/getEntrypoint.js","size":121},{"name":"src/utils/getListOfReferences.js","size":477},{"name":"src/utils/getSegmentsFromPath.js","size":228},{"name":"src/utils/isFilesystem.js","size":189},{"name":"src/utils/isJson.js","size":129},{"name":"src/utils/isObject.js","size":112},{"name":"src/utils/isYaml.js","size":250},{"name":"src/utils/load/load.js","size":1924},{"name":"src/utils/load/plugins/fetchUrlsPlugin.js","size":1119},{"name":"src/utils/load/plugins/readFilesPlugin.js","size":1224},{"name":"src/utils/normalize.js","size":431},{"name":"src/utils/toJson.js","size":78},{"name":"src/utils/toYaml.js","size":99},{"name":"src/utils/transformErrors.js","size":402},{"name":"src/utils/traverse.js","size":557},{"name":"src/utils/unescapeJsonPointer.js","size":136},{"name":"src/utils/upgrade.js","size":644},{"name":"src/utils/upgradeFromThreeToThreeOne.js","size":2127},{"name":"src/utils/upgradeFromTwoToThree.js","size":109},{"name":"src/utils/validate.js","size":413},{"name":"src/utils/workThroughQueue.js","size":637},{"name":"src/utils/makeFilesystem.js","size":520},{"name":"src/configuration.js","size":858},{"name":"src/utils/betterAjvErrors/index.js","size":439},{"name":"schemas/v2.0/schema.json.js","size":30949},{"name":"schemas/v3.0/schema.json.js","size":25234},{"name":"schemas/v3.1/schema.json.js","size":24839},{"name":"src/utils/betterAjvErrors/helpers.js","size":3303},{"name":"src/polyfills/path.js","size":1963},{"name":"src/utils/betterAjvErrors/utils.js","size":756},{"name":"src/utils/betterAjvErrors/validation-errors/enum.js","size":1252},{"name":"src/utils/betterAjvErrors/validation-errors/default.js","size":444},{"name":"src/utils/betterAjvErrors/validation-errors/unevaluated-prop.js","size":505},{"name":"src/utils/betterAjvErrors/validation-errors/required.js","size":384},{"name":"src/utils/betterAjvErrors/validation-errors/pattern.js","size":493},{"name":"src/utils/betterAjvErrors/validation-errors/additional-prop.js","size":501},{"name":"src/utils/betterAjvErrors/validation-errors/base.js","size":648}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["src/index.js"],"names":["src/index"]},{"id":"1610f8d","entry":false,"initial":true,"files":["src/pipeline.js"],"names":["src/pipeline"]},{"id":"a5b5029","entry":false,"initial":true,"files":["src/lib/Validator/Validator.js"],"names":["src/lib/Validator/Validator"]},{"id":"aea20c6","entry":false,"initial":true,"files":["src/utils/resolveReferences.js"],"names":["src/utils/resolveReferences"]},{"id":"f9b6a1a","entry":false,"initial":true,"files":["src/utils/dereference.js"],"names":["src/utils/dereference"]},{"id":"c64a2fa","entry":false,"initial":true,"files":["src/utils/details.js"],"names":["src/utils/details"]},{"id":"398f36d","entry":false,"initial":true,"files":["src/utils/escapeJsonPointer.js"],"names":["src/utils/escapeJsonPointer"]},{"id":"6c7ec36","entry":false,"initial":true,"files":["src/utils/filter.js"],"names":["src/utils/filter"]},{"id":"c07bf08","entry":false,"initial":true,"files":["src/utils/getEntrypoint.js"],"names":["src/utils/getEntrypoint"]},{"id":"13f9e1e","entry":false,"initial":true,"files":["src/utils/getListOfReferences.js"],"names":["src/utils/getListOfReferences"]},{"id":"b5bffbd","entry":false,"initial":true,"files":["src/utils/getSegmentsFromPath.js"],"names":["src/utils/getSegmentsFromPath"]},{"id":"8ea971a","entry":false,"initial":true,"files":["src/utils/isFilesystem.js"],"names":["src/utils/isFilesystem"]},{"id":"20e0bc7","entry":false,"initial":true,"files":["src/utils/isJson.js"],"names":["src/utils/isJson"]},{"id":"3180f00","entry":false,"initial":true,"files":["src/utils/isObject.js"],"names":["src/utils/isObject"]},{"id":"2305281","entry":false,"initial":true,"files":["src/utils/isYaml.js"],"names":["src/utils/isYaml"]},{"id":"6e9fd1a","entry":false,"initial":true,"files":["src/utils/load/load.js"],"names":["src/utils/load/load"]},{"id":"924bd2a","entry":false,"initial":true,"files":["src/utils/load/plugins/fetchUrlsPlugin.js"],"names":["src/utils/load/plugins/fetchUrlsPlugin"]},{"id":"eb4c5f3","entry":false,"initial":true,"files":["src/utils/load/plugins/readFilesPlugin.js"],"names":["src/utils/load/plugins/readFilesPlugin"]},{"id":"c62fce7","entry":false,"initial":true,"files":["src/utils/normalize.js"],"names":["src/utils/normalize"]},{"id":"ff23e2d","entry":false,"initial":true,"files":["src/utils/toJson.js"],"names":["src/utils/toJson"]},{"id":"893a485","entry":false,"initial":true,"files":["src/utils/toYaml.js"],"names":["src/utils/toYaml"]},{"id":"8d99789","entry":false,"initial":true,"files":["src/utils/transformErrors.js"],"names":["src/utils/transformErrors"]},{"id":"e6dbaad","entry":false,"initial":true,"files":["src/utils/traverse.js"],"names":["src/utils/traverse"]},{"id":"a5b1973","entry":false,"initial":true,"files":["src/utils/unescapeJsonPointer.js"],"names":["src/utils/unescapeJsonPointer"]},{"id":"7e74bc8","entry":false,"initial":true,"files":["src/utils/upgrade.js"],"names":["src/utils/upgrade"]},{"id":"acc1a8d","entry":false,"initial":true,"files":["src/utils/upgradeFromThreeToThreeOne.js"],"names":["src/utils/upgradeFromThreeToThreeOne"]},{"id":"d98a7d1","entry":false,"initial":true,"files":["src/utils/upgradeFromTwoToThree.js"],"names":["src/utils/upgradeFromTwoToThree"]},{"id":"ec25ebd","entry":false,"initial":true,"files":["src/utils/validate.js"],"names":["src/utils/validate"]},{"id":"7c18e02","entry":false,"initial":true,"files":["src/utils/workThroughQueue.js"],"names":["src/utils/workThroughQueue"]},{"id":"90e5eec","entry":false,"initial":true,"files":["src/utils/makeFilesystem.js"],"names":["src/utils/makeFilesystem"]},{"id":"1eb4908","entry":false,"initial":true,"files":["src/configuration.js"],"names":["src/configuration"]},{"id":"a7c663b","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/index.js"],"names":["src/utils/betterAjvErrors/index"]},{"id":"7d833d7","entry":false,"initial":true,"files":["schemas/v2.0/schema.json.js"],"names":["schemas/v2.0/schema.json"]},{"id":"3870082","entry":false,"initial":true,"files":["schemas/v3.0/schema.json.js"],"names":["schemas/v3.0/schema.json"]},{"id":"ba96e53","entry":false,"initial":true,"files":["schemas/v3.1/schema.json.js"],"names":["schemas/v3.1/schema.json"]},{"id":"003968b","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/helpers.js"],"names":["src/utils/betterAjvErrors/helpers"]},{"id":"20a5186","entry":false,"initial":true,"files":["src/polyfills/path.js"],"names":["src/polyfills/path"]},{"id":"8c3e592","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/utils.js"],"names":["src/utils/betterAjvErrors/utils"]},{"id":"b67304b","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/validation-errors/enum.js"],"names":["src/utils/betterAjvErrors/validation-errors/enum"]},{"id":"0587cdd","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/validation-errors/default.js"],"names":["src/utils/betterAjvErrors/validation-errors/default"]},{"id":"4f9c5a8","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/validation-errors/unevaluated-prop.js"],"names":["src/utils/betterAjvErrors/validation-errors/unevaluated-prop"]},{"id":"74cdbcb","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/validation-errors/required.js"],"names":["src/utils/betterAjvErrors/validation-errors/required"]},{"id":"8f5040f","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/validation-errors/pattern.js"],"names":["src/utils/betterAjvErrors/validation-errors/pattern"]},{"id":"7c5b700","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/validation-errors/additional-prop.js"],"names":["src/utils/betterAjvErrors/validation-errors/additional-prop"]},{"id":"372b5cd","entry":false,"initial":true,"files":["src/utils/betterAjvErrors/validation-errors/base.js"],"names":["src/utils/betterAjvErrors/validation-errors/base"]}],"modules":[{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/pipeline.ts","size":3047,"chunks":["1610f8d"]},{"name":"./src/lib/Validator/Validator.ts","size":2737,"chunks":["a5b5029"]},{"name":"./src/utils/resolveReferences.ts","size":2702,"chunks":["aea20c6"]},{"name":"./src/utils/dereference.ts","size":333,"chunks":["f9b6a1a"]},{"name":"./src/utils/details.ts","size":493,"chunks":["c64a2fa"]},{"name":"./src/utils/escapeJsonPointer.ts","size":90,"chunks":["398f36d"]},{"name":"./src/utils/filter.ts","size":273,"chunks":["6c7ec36"]},{"name":"./src/utils/getEntrypoint.ts","size":93,"chunks":["c07bf08"]},{"name":"./src/utils/getListOfReferences.ts","size":400,"chunks":["13f9e1e"]},{"name":"./src/utils/getSegmentsFromPath.ts","size":129,"chunks":["b5bffbd"]},{"name":"./src/utils/isFilesystem.ts","size":162,"chunks":["8ea971a"]},{"name":"./src/utils/isJson.ts","size":108,"chunks":["20e0bc7"]},{"name":"./src/utils/isObject.ts","size":89,"chunks":["3180f00"]},{"name":"./src/utils/isYaml.ts","size":198,"chunks":["2305281"]},{"name":"./src/utils/load/load.ts","size":1686,"chunks":["6e9fd1a"]},{"name":"./src/utils/load/plugins/fetchUrlsPlugin.ts","size":1052,"chunks":["924bd2a"]},{"name":"./src/utils/load/plugins/readFilesPlugin.ts","size":971,"chunks":["eb4c5f3"]},{"name":"./src/utils/normalize.ts","size":326,"chunks":["c62fce7"]},{"name":"./src/utils/toJson.ts","size":57,"chunks":["ff23e2d"]},{"name":"./src/utils/toYaml.ts","size":43,"chunks":["893a485"]},{"name":"./src/utils/transformErrors.ts","size":309,"chunks":["8d99789"]},{"name":"./src/utils/traverse.ts","size":534,"chunks":["e6dbaad"]},{"name":"./src/utils/unescapeJsonPointer.ts","size":102,"chunks":["a5b1973"]},{"name":"./src/utils/upgrade.ts","size":369,"chunks":["7e74bc8"]},{"name":"./src/utils/upgradeFromThreeToThreeOne.ts","size":2043,"chunks":["acc1a8d"]},{"name":"./src/utils/upgradeFromTwoToThree.ts","size":73,"chunks":["d98a7d1"]},{"name":"./src/utils/validate.ts","size":276,"chunks":["ec25ebd"]},{"name":"./src/utils/workThroughQueue.ts","size":606,"chunks":["7c18e02"]},{"name":"./src/utils/makeFilesystem.ts","size":332,"chunks":["90e5eec"]},{"name":"./src/configuration.ts","size":628,"chunks":["1eb4908"]},{"name":"./src/utils/betterAjvErrors/index.ts","size":371,"chunks":["a7c663b"]},{"name":"./schemas/v2.0/schema.json","size":30812,"chunks":["7d833d7"]},{"name":"./schemas/v3.0/schema.json","size":25091,"chunks":["3870082"]},{"name":"./schemas/v3.1/schema.json","size":24706,"chunks":["ba96e53"]},{"name":"./src/utils/betterAjvErrors/helpers.ts","size":2636,"chunks":["003968b"]},{"name":"./src/polyfills/path.ts","size":1912,"chunks":["20a5186"]},{"name":"./src/utils/betterAjvErrors/utils.js","size":637,"chunks":["8c3e592"]},{"name":"./src/utils/betterAjvErrors/validation-errors/enum.js","size":1099,"chunks":["b67304b"]},{"name":"./src/utils/betterAjvErrors/validation-errors/default.js","size":350,"chunks":["0587cdd"]},{"name":"./src/utils/betterAjvErrors/validation-errors/unevaluated-prop.js","size":403,"chunks":["4f9c5a8"]},{"name":"./src/utils/betterAjvErrors/validation-errors/required.js","size":289,"chunks":["74cdbcb"]},{"name":"./src/utils/betterAjvErrors/validation-errors/pattern.js","size":399,"chunks":["8f5040f"]},{"name":"./src/utils/betterAjvErrors/validation-errors/additional-prop.js","size":400,"chunks":["7c5b700"]},{"name":"./src/utils/betterAjvErrors/validation-errors/base.js","size":603,"chunks":["372b5cd"]}]}
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"author": "Scalar (https://github.com/scalar)",
|
|
13
13
|
"homepage": "https://github.com/scalar/scalar",
|
|
14
14
|
"bugs": "https://github.com/scalar/scalar/issues/new/choose",
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.6.0",
|
|
16
16
|
"engines": {
|
|
17
17
|
"node": ">=18"
|
|
18
18
|
},
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
35
35
|
"@rollup/plugin-json": "^6.1.0",
|
|
36
36
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
37
|
-
"@types/node": "^20.
|
|
38
|
-
"glob": "^10.
|
|
37
|
+
"@types/node": "^20.14.0",
|
|
38
|
+
"glob": "^10.4.1",
|
|
39
39
|
"just-diff": "^6.0.2",
|
|
40
40
|
"rollup": "^4.18.0",
|
|
41
41
|
"rollup-plugin-dts": "^6.1.1",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"tslib": "^2.6.2"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"ajv": "^8.
|
|
48
|
+
"ajv": "^8.14.0",
|
|
49
49
|
"ajv-draft-04": "^1.0.0",
|
|
50
50
|
"ajv-formats": "^3.0.1",
|
|
51
51
|
"jsonpointer": "^5.0.1",
|
|
File without changes
|