@scalar/oas-utils 0.2.64 → 0.2.66
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 +26 -0
- package/dist/entities/environment/environment.js +1 -1
- package/dist/entities/spec/parameters.d.ts +21 -0
- package/dist/entities/spec/parameters.d.ts.map +1 -1
- package/dist/entities/spec/parameters.js +7 -0
- package/dist/entities/spec/request-examples.d.ts.map +1 -1
- package/dist/entities/spec/request-examples.js +11 -1
- package/dist/entities/spec/requests.d.ts +62 -0
- package/dist/entities/spec/requests.d.ts.map +1 -1
- package/dist/entities/spec/security.d.ts +1 -27
- package/dist/entities/spec/security.d.ts.map +1 -1
- package/dist/entities/spec/security.js +35 -16
- package/dist/helpers/fetchWithProxyFallback.d.ts +8 -3
- package/dist/helpers/fetchWithProxyFallback.d.ts.map +1 -1
- package/dist/helpers/fetchWithProxyFallback.js +7 -21
- package/dist/migrations/v-2.1.0/migration.d.ts +5 -0
- package/dist/migrations/v-2.1.0/migration.d.ts.map +1 -1
- package/dist/spec-getters/getExampleFromSchema.d.ts.map +1 -1
- package/dist/spec-getters/getExampleFromSchema.js +22 -9
- package/dist/transforms/import-spec.d.ts +3 -1
- package/dist/transforms/import-spec.d.ts.map +1 -1
- package/dist/transforms/import-spec.js +8 -6
- package/dist/transforms/index.js +1 -1
- package/package.json +6 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @scalar/oas-utils
|
|
2
2
|
|
|
3
|
+
## 0.2.66
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c929284: fix: add default redirectURI and prefix relative redirectURIs with activeServer
|
|
8
|
+
- 2275977: feat: import from way more sources, leverage the proxy more
|
|
9
|
+
- 3a0c367: fix: improve handling of non-string enums in parameter schema
|
|
10
|
+
- 89a2cc7: fix: preselect auth in the modal
|
|
11
|
+
|
|
12
|
+
## 0.2.65
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 3bec045: fix: adds example and examples to parameter schema
|
|
17
|
+
- 743474e: feat: favors hexa for environment color
|
|
18
|
+
- cfe9b85: fix: added safe parsing for oauth examples
|
|
19
|
+
- 4d45f7b: fix: improve parameter instance creation by handling enum values for number types
|
|
20
|
+
- 6599473: fix: arrays with allOf items render invalid examples
|
|
21
|
+
- 0e19781: feat: fix reactivitiy of references + client
|
|
22
|
+
- Updated dependencies [fb798c8]
|
|
23
|
+
- Updated dependencies [bb3dc9d]
|
|
24
|
+
- Updated dependencies [0e19781]
|
|
25
|
+
- @scalar/types@0.0.18
|
|
26
|
+
- @scalar/themes@0.9.45
|
|
27
|
+
- @scalar/object-utils@1.1.11
|
|
28
|
+
|
|
3
29
|
## 0.2.64
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -4,7 +4,7 @@ import { nanoidSchema } from '../shared/utility.js';
|
|
|
4
4
|
const environmentSchema = z.object({
|
|
5
5
|
uid: nanoidSchema,
|
|
6
6
|
name: z.string().optional().default('Default Environment'),
|
|
7
|
-
color: z.string().optional().default('
|
|
7
|
+
color: z.string().optional().default('#0082D0'),
|
|
8
8
|
value: z.string().default(''),
|
|
9
9
|
isDefault: z.boolean().optional(),
|
|
10
10
|
});
|
|
@@ -18,6 +18,17 @@ export declare const oasParameterSchema: z.ZodObject<{
|
|
|
18
18
|
content: z.ZodOptional<z.ZodUnknown>;
|
|
19
19
|
/** Defaulted according to @url https://spec.openapis.org/oas/v3.1.0#parameter-object */
|
|
20
20
|
style: z.ZodOptional<z.ZodEnum<["matrix", "simple", "form", "label", "spaceDelimited", "pipeDelimited", "deepObject"]>>;
|
|
21
|
+
example: z.ZodOptional<z.ZodUnknown>;
|
|
22
|
+
examples: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
23
|
+
value: z.ZodUnknown;
|
|
24
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
value?: unknown;
|
|
27
|
+
summary?: string | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
value?: unknown;
|
|
30
|
+
summary?: string | undefined;
|
|
31
|
+
}>>>;
|
|
21
32
|
}, "strip", z.ZodTypeAny, {
|
|
22
33
|
required: boolean;
|
|
23
34
|
name: string;
|
|
@@ -27,6 +38,11 @@ export declare const oasParameterSchema: z.ZodObject<{
|
|
|
27
38
|
schema?: unknown;
|
|
28
39
|
content?: unknown;
|
|
29
40
|
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
41
|
+
example?: unknown;
|
|
42
|
+
examples?: Record<string, {
|
|
43
|
+
value?: unknown;
|
|
44
|
+
summary?: string | undefined;
|
|
45
|
+
}> | undefined;
|
|
30
46
|
}, {
|
|
31
47
|
name: string;
|
|
32
48
|
in: "path" | "query" | "header" | "cookie";
|
|
@@ -36,6 +52,11 @@ export declare const oasParameterSchema: z.ZodObject<{
|
|
|
36
52
|
schema?: unknown;
|
|
37
53
|
content?: unknown;
|
|
38
54
|
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
55
|
+
example?: unknown;
|
|
56
|
+
examples?: Record<string, {
|
|
57
|
+
value?: unknown;
|
|
58
|
+
summary?: string | undefined;
|
|
59
|
+
}> | undefined;
|
|
39
60
|
}>;
|
|
40
61
|
export type RequestParameter = z.infer<typeof oasParameterSchema>;
|
|
41
62
|
export type RequestParameterPayload = z.input<typeof oasParameterSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/parameters.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvC,eAAO,MAAM,mBAAmB,kDAAgD,CAAA;AAChF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE3D,eAAO,MAAM,oBAAoB,mGAQ/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;IAI7B,yBAAyB;;IAEzB,yBAAyB;;;;IAIzB,wFAAwF
|
|
1
|
+
{"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/parameters.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvC,eAAO,MAAM,mBAAmB,kDAAgD,CAAA;AAChF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE3D,eAAO,MAAM,oBAAoB,mGAQ/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;IAI7B,yBAAyB;;IAEzB,yBAAyB;;;;IAIzB,wFAAwF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYjD,CAAA;AAEzC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AACjE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
|
|
@@ -25,6 +25,13 @@ const oasParameterSchema = z.object({
|
|
|
25
25
|
content: z.unknown().optional(),
|
|
26
26
|
/** Defaulted according to @url https://spec.openapis.org/oas/v3.1.0#parameter-object */
|
|
27
27
|
style: parameterStyleSchema.optional(),
|
|
28
|
+
example: z.unknown().optional(),
|
|
29
|
+
examples: z
|
|
30
|
+
.record(z.string(), z.object({
|
|
31
|
+
value: z.unknown(),
|
|
32
|
+
summary: z.string().optional(),
|
|
33
|
+
}))
|
|
34
|
+
.optional(),
|
|
28
35
|
});
|
|
29
36
|
|
|
30
37
|
export { oasParameterSchema, parameterStyleSchema, parameterTypeSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-examples.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/request-examples.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC,eAAO,MAAM,8BAA8B;;;;;;IAMzC,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUlF,CAAA;AAEF,kFAAkF;AAClF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,8BAA8B,CACtC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,uEAQ7B,CAAA;AACV,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAA;AAEtE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;YAjCnC,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDlF,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;gBAvD/B,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;YAAlF,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuElF,CAAA;AAEF,qDAAqD;AACrD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAKxE,6DAA6D;AAC7D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB;;;;;;;;;;;;;;;EA4C1D;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,GACd,cAAc,CAiGhB"}
|
|
@@ -83,7 +83,16 @@ function createParamInstance(param) {
|
|
|
83
83
|
* - Need to handle non-string parameters much better
|
|
84
84
|
* - Need to handle unions/array values for schema
|
|
85
85
|
*/
|
|
86
|
-
const value = String(schema?.default ??
|
|
86
|
+
const value = String(schema?.default ??
|
|
87
|
+
schema?.examples?.[0] ??
|
|
88
|
+
schema?.example ??
|
|
89
|
+
param.examples?.[Object.keys(param.examples)[0]]?.value ??
|
|
90
|
+
param.example ??
|
|
91
|
+
'');
|
|
92
|
+
// Handle non-string enums
|
|
93
|
+
const parseEnum = schema?.enum && schema?.type !== 'string'
|
|
94
|
+
? schema.enum?.map(String)
|
|
95
|
+
: schema?.enum;
|
|
87
96
|
// safe parse the example
|
|
88
97
|
const example = schemaModel({
|
|
89
98
|
...schema,
|
|
@@ -93,6 +102,7 @@ function createParamInstance(param) {
|
|
|
93
102
|
required: param.required,
|
|
94
103
|
/** Initialized all required properties to enabled */
|
|
95
104
|
enabled: !!param.required,
|
|
105
|
+
enum: parseEnum,
|
|
96
106
|
}, requestExampleParametersSchema, false);
|
|
97
107
|
if (!example) {
|
|
98
108
|
console.warn(`Example at ${param.name} is invalid.`);
|
|
@@ -73,6 +73,17 @@ export declare const oasRequestSchema: z.ZodObject<{
|
|
|
73
73
|
schema: z.ZodOptional<z.ZodUnknown>;
|
|
74
74
|
content: z.ZodOptional<z.ZodUnknown>;
|
|
75
75
|
style: z.ZodOptional<z.ZodEnum<["matrix", "simple", "form", "label", "spaceDelimited", "pipeDelimited", "deepObject"]>>;
|
|
76
|
+
example: z.ZodOptional<z.ZodUnknown>;
|
|
77
|
+
examples: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
78
|
+
value: z.ZodUnknown;
|
|
79
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
value?: unknown;
|
|
82
|
+
summary?: string | undefined;
|
|
83
|
+
}, {
|
|
84
|
+
value?: unknown;
|
|
85
|
+
summary?: string | undefined;
|
|
86
|
+
}>>>;
|
|
76
87
|
}, "strip", z.ZodTypeAny, {
|
|
77
88
|
required: boolean;
|
|
78
89
|
name: string;
|
|
@@ -82,6 +93,11 @@ export declare const oasRequestSchema: z.ZodObject<{
|
|
|
82
93
|
schema?: unknown;
|
|
83
94
|
content?: unknown;
|
|
84
95
|
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
96
|
+
example?: unknown;
|
|
97
|
+
examples?: Record<string, {
|
|
98
|
+
value?: unknown;
|
|
99
|
+
summary?: string | undefined;
|
|
100
|
+
}> | undefined;
|
|
85
101
|
}, {
|
|
86
102
|
name: string;
|
|
87
103
|
in: "path" | "query" | "header" | "cookie";
|
|
@@ -91,6 +107,11 @@ export declare const oasRequestSchema: z.ZodObject<{
|
|
|
91
107
|
schema?: unknown;
|
|
92
108
|
content?: unknown;
|
|
93
109
|
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
110
|
+
example?: unknown;
|
|
111
|
+
examples?: Record<string, {
|
|
112
|
+
value?: unknown;
|
|
113
|
+
summary?: string | undefined;
|
|
114
|
+
}> | undefined;
|
|
94
115
|
}>, "many">>;
|
|
95
116
|
/**
|
|
96
117
|
* External documentation object
|
|
@@ -128,6 +149,11 @@ export declare const oasRequestSchema: z.ZodObject<{
|
|
|
128
149
|
schema?: unknown;
|
|
129
150
|
content?: unknown;
|
|
130
151
|
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
152
|
+
example?: unknown;
|
|
153
|
+
examples?: Record<string, {
|
|
154
|
+
value?: unknown;
|
|
155
|
+
summary?: string | undefined;
|
|
156
|
+
}> | undefined;
|
|
131
157
|
}[] | undefined;
|
|
132
158
|
requestBody?: any;
|
|
133
159
|
responses?: Record<string, any> | undefined;
|
|
@@ -151,6 +177,11 @@ export declare const oasRequestSchema: z.ZodObject<{
|
|
|
151
177
|
schema?: unknown;
|
|
152
178
|
content?: unknown;
|
|
153
179
|
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
180
|
+
example?: unknown;
|
|
181
|
+
examples?: Record<string, {
|
|
182
|
+
value?: unknown;
|
|
183
|
+
summary?: string | undefined;
|
|
184
|
+
}> | undefined;
|
|
154
185
|
}[] | undefined;
|
|
155
186
|
requestBody?: any;
|
|
156
187
|
responses?: Record<string, any> | undefined;
|
|
@@ -201,6 +232,17 @@ export declare const requestSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
201
232
|
schema: z.ZodOptional<z.ZodUnknown>;
|
|
202
233
|
content: z.ZodOptional<z.ZodUnknown>;
|
|
203
234
|
style: z.ZodOptional<z.ZodEnum<["matrix", "simple", "form", "label", "spaceDelimited", "pipeDelimited", "deepObject"]>>;
|
|
235
|
+
example: z.ZodOptional<z.ZodUnknown>;
|
|
236
|
+
examples: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
237
|
+
value: z.ZodUnknown;
|
|
238
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
239
|
+
}, "strip", z.ZodTypeAny, {
|
|
240
|
+
value?: unknown;
|
|
241
|
+
summary?: string | undefined;
|
|
242
|
+
}, {
|
|
243
|
+
value?: unknown;
|
|
244
|
+
summary?: string | undefined;
|
|
245
|
+
}>>>;
|
|
204
246
|
}, "strip", z.ZodTypeAny, {
|
|
205
247
|
required: boolean;
|
|
206
248
|
name: string;
|
|
@@ -210,6 +252,11 @@ export declare const requestSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
210
252
|
schema?: unknown;
|
|
211
253
|
content?: unknown;
|
|
212
254
|
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
255
|
+
example?: unknown;
|
|
256
|
+
examples?: Record<string, {
|
|
257
|
+
value?: unknown;
|
|
258
|
+
summary?: string | undefined;
|
|
259
|
+
}> | undefined;
|
|
213
260
|
}, {
|
|
214
261
|
name: string;
|
|
215
262
|
in: "path" | "query" | "header" | "cookie";
|
|
@@ -219,6 +266,11 @@ export declare const requestSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
219
266
|
schema?: unknown;
|
|
220
267
|
content?: unknown;
|
|
221
268
|
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
269
|
+
example?: unknown;
|
|
270
|
+
examples?: Record<string, {
|
|
271
|
+
value?: unknown;
|
|
272
|
+
summary?: string | undefined;
|
|
273
|
+
}> | undefined;
|
|
222
274
|
}>, "many">>;
|
|
223
275
|
/**
|
|
224
276
|
* External documentation object
|
|
@@ -279,6 +331,11 @@ export declare const requestSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
279
331
|
schema?: unknown;
|
|
280
332
|
content?: unknown;
|
|
281
333
|
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
334
|
+
example?: unknown;
|
|
335
|
+
examples?: Record<string, {
|
|
336
|
+
value?: unknown;
|
|
337
|
+
summary?: string | undefined;
|
|
338
|
+
}> | undefined;
|
|
282
339
|
}[] | undefined;
|
|
283
340
|
requestBody?: any;
|
|
284
341
|
responses?: Record<string, any> | undefined;
|
|
@@ -310,6 +367,11 @@ export declare const requestSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
310
367
|
schema?: unknown;
|
|
311
368
|
content?: unknown;
|
|
312
369
|
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
370
|
+
example?: unknown;
|
|
371
|
+
examples?: Record<string, {
|
|
372
|
+
value?: unknown;
|
|
373
|
+
summary?: string | undefined;
|
|
374
|
+
}> | undefined;
|
|
313
375
|
}[] | undefined;
|
|
314
376
|
requestBody?: any;
|
|
315
377
|
responses?: Record<string, any> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/requests.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAIxD,eAAO,MAAM,cAAc,2FAUjB,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,C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,oCAAoC;;IAEpC,uDAAuD;;IAEvD,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKS,CAAA;AAC1E,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AACnD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA"}
|
|
@@ -92,33 +92,7 @@ export type SecuritySchemeOauth2ExampleValue = Extract<SecuritySchemeExampleValu
|
|
|
92
92
|
*
|
|
93
93
|
* TODO: we can probably remove this unless we really want to keep it separate
|
|
94
94
|
*/
|
|
95
|
-
export declare function authExampleFromSchema(scheme: SecurityScheme, baseValues?: any):
|
|
96
|
-
type: "apiKey";
|
|
97
|
-
value: string;
|
|
98
|
-
name: string;
|
|
99
|
-
} | {
|
|
100
|
-
type: "http";
|
|
101
|
-
username: string;
|
|
102
|
-
password: string;
|
|
103
|
-
token: string;
|
|
104
|
-
} | {
|
|
105
|
-
type: "oauth-implicit";
|
|
106
|
-
token: string;
|
|
107
|
-
} | {
|
|
108
|
-
type: "oauth-password";
|
|
109
|
-
username: string;
|
|
110
|
-
password: string;
|
|
111
|
-
token: string;
|
|
112
|
-
clientSecret: string;
|
|
113
|
-
} | {
|
|
114
|
-
type: "oauth-clientCredentials";
|
|
115
|
-
token: string;
|
|
116
|
-
clientSecret: string;
|
|
117
|
-
} | {
|
|
118
|
-
type: "oauth-authorizationCode";
|
|
119
|
-
token: string;
|
|
120
|
-
clientSecret: string;
|
|
121
|
-
};
|
|
95
|
+
export declare function authExampleFromSchema(scheme: SecurityScheme, baseValues?: any): SecuritySchemeExampleValue | null;
|
|
122
96
|
export declare const securitySchemeApiKeyIn: readonly ["query", "header", "cookie"];
|
|
123
97
|
export declare const securityApiKeySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
124
98
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/security.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/security.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA6CvB;;;GAGG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAO3C,CAAA;AAEF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAA;AAED,gDAAgD;AAChD,MAAM,MAAM,gCAAgC,GAAG,OAAO,CACpD,0BAA0B,EAC1B;IAAE,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAC5B,CAAA;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,EACtB,UAAU,GAAE,GAAQ,GACnB,0BAA0B,GAAG,IAAI,CAuCnC;AAoBD,eAAO,MAAM,sBAAsB,wCAAyC,CAAA;AAU5E,eAAO,MAAM,oBAAoB;;;;IAN/B,8EAA8E;;IAE9E,6FAA6F;;;;IAb7F,0EAA0E;;;;;;;;;;;;;;;;EAmB3E,CAAA;AACD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AA4BvE,eAAO,MAAM,kBAAkB;;;;IArB7B;;;OAGG;;IAOH;;;;OAIG;;;;IAzCH,0EAA0E;;;;;;;;;;;;;;;;EAkD3E,CAAA;AACD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAanE,eAAO,MAAM,oBAAoB;;;;IAP/B;;;OAGG;;;;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;;;;;;;;;;;;;;QARH;;;WAGG;;QAEH;;;WAGG;;;;;;;;;;;;;;;;;;;;;;;;;IAyDH,oEAAoE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA7FpE;;;OAGG;;;;;;;;;;IA4HH,CAAA;AAEF,oDAAoD;AACpD,eAAO,MAAM,oBAAoB;;;;IAhL/B,8EAA8E;;IAE9E,6FAA6F;;;;IAb7F,0EAA0E;;;;;;;;;;;;;;;;;;;;IA2B1E;;;OAGG;;IAOH;;;;OAIG;;;;IAzCH,0EAA0E;;;;;;;;;;;;;;;;;;;;IAyD1E;;;OAGG;;;;IA5DH,0EAA0E;;;;;;;;;;;;;;;;;;IAoJ1E,6FAA6F;;QA/D7F;;;WAGG;;QAEH;;;WAGG;;;;;;;;;;;;;;;;;;;;;;QARH;;;WAGG;;QAEH;;;WAGG;;;;;;;;;;;;;;;;;;;QARH;;;WAGG;;QAEH;;;WAGG;;;;;;;;;;;;;;;;;;;QARH;;;WAGG;;QAEH;;;WAGG;;;;;;;;;;;;;;;;;;;;;;;;;IAyDH,oEAAoE;;;;IAtJpE,0EAA0E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgM1E,CAAA;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { schemaModel } from '../../helpers/schema-model.js';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import { nanoidSchema } from '../shared/utility.js';
|
|
3
4
|
|
|
@@ -53,21 +54,29 @@ const securitySchemeExampleValueSchema = z.union([
|
|
|
53
54
|
* TODO: we can probably remove this unless we really want to keep it separate
|
|
54
55
|
*/
|
|
55
56
|
function authExampleFromSchema(scheme, baseValues = {}) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (scheme.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
57
|
+
try {
|
|
58
|
+
if (scheme.type === 'apiKey') {
|
|
59
|
+
return schemaModel({ name: scheme.name, ...baseValues }, apiKeyExampleSchema, false);
|
|
60
|
+
}
|
|
61
|
+
if (scheme.type === 'http') {
|
|
62
|
+
return schemaModel(baseValues, httpExampleSchema, false);
|
|
63
|
+
}
|
|
64
|
+
if (scheme.type === 'oauth2') {
|
|
65
|
+
if (scheme.flow.type === 'authorizationCode')
|
|
66
|
+
return schemaModel(baseValues, oauthAuthorizationCodeExampleSchema, false);
|
|
67
|
+
if (scheme.flow.type === 'clientCredentials')
|
|
68
|
+
return schemaModel(baseValues, oauthClientCredentialsExampleSchema, false);
|
|
69
|
+
if (scheme.flow.type === 'implicit')
|
|
70
|
+
return schemaModel(baseValues, oauthImplicitExampleSchema, false);
|
|
71
|
+
if (scheme.flow.type === 'password')
|
|
72
|
+
return schemaModel(baseValues, oauthPasswordExampleSchema, false);
|
|
73
|
+
}
|
|
69
74
|
}
|
|
70
|
-
|
|
75
|
+
catch (e) {
|
|
76
|
+
console.error(e);
|
|
77
|
+
}
|
|
78
|
+
console.warn('[@scalar/oas-utils:security] Invalid schema for oauth example', baseValues);
|
|
79
|
+
return null;
|
|
71
80
|
}
|
|
72
81
|
// ---------------------------------------------------------------------------
|
|
73
82
|
// COMMON PROPS FOR ALL SECURITY SCHEMES
|
|
@@ -160,13 +169,20 @@ const oauthCommon = z.object({
|
|
|
160
169
|
.default({}),
|
|
161
170
|
selectedScopes: z.array(z.string()).optional().default([]),
|
|
162
171
|
});
|
|
172
|
+
/** Setup a default redirect uri if we can */
|
|
173
|
+
const defaultRedirectUri = typeof window !== 'undefined'
|
|
174
|
+
? window.location.origin + window.location.pathname
|
|
175
|
+
: '';
|
|
163
176
|
const oasOauthFlowSchema = z
|
|
164
177
|
.discriminatedUnion('type', [
|
|
165
178
|
/** Configuration for the OAuth Implicit flow */
|
|
166
179
|
oauthCommon.extend({
|
|
167
180
|
'type': z.literal('implicit'),
|
|
168
181
|
authorizationUrl,
|
|
169
|
-
'x-scalar-redirect-uri': z
|
|
182
|
+
'x-scalar-redirect-uri': z
|
|
183
|
+
.string()
|
|
184
|
+
.optional()
|
|
185
|
+
.default(defaultRedirectUri),
|
|
170
186
|
}),
|
|
171
187
|
/** Configuration for the OAuth Resource Owner Password flow */
|
|
172
188
|
oauthCommon.extend({
|
|
@@ -182,7 +198,10 @@ const oasOauthFlowSchema = z
|
|
|
182
198
|
oauthCommon.extend({
|
|
183
199
|
'type': z.literal('authorizationCode'),
|
|
184
200
|
authorizationUrl,
|
|
185
|
-
'x-scalar-redirect-uri': z
|
|
201
|
+
'x-scalar-redirect-uri': z
|
|
202
|
+
.string()
|
|
203
|
+
.optional()
|
|
204
|
+
.default(defaultRedirectUri),
|
|
186
205
|
tokenUrl,
|
|
187
206
|
}),
|
|
188
207
|
])
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
export type FetchWithProxyFallbackOptions = {
|
|
2
|
+
proxy?: string;
|
|
3
|
+
/**
|
|
4
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Request/cache
|
|
5
|
+
*/
|
|
6
|
+
cache?: RequestInit['cache'];
|
|
7
|
+
};
|
|
1
8
|
/**
|
|
2
9
|
* Fetches an OpenAPI document with a proxy fallback mechanism.
|
|
3
10
|
*
|
|
4
11
|
* If a proxy is provided and the URL requires it, it will first attempt to fetch using the proxy.
|
|
5
12
|
* If the proxy fetch fails or is not used, it will fall back to a direct fetch.
|
|
6
|
-
*
|
|
7
|
-
* Also handles cases where the input is a JSON object instead of a URL.
|
|
8
13
|
*/
|
|
9
|
-
export declare function fetchWithProxyFallback(
|
|
14
|
+
export declare function fetchWithProxyFallback(url: string, { proxy, cache }: FetchWithProxyFallbackOptions): Promise<Response>;
|
|
10
15
|
//# sourceMappingURL=fetchWithProxyFallback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchWithProxyFallback.d.ts","sourceRoot":"","sources":["../../src/helpers/fetchWithProxyFallback.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetchWithProxyFallback.d.ts","sourceRoot":"","sources":["../../src/helpers/fetchWithProxyFallback.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,6BAA6B,GAAG;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;CAC7B,CAAA;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,MAAM,EACX,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,6BAA6B,qBAwBhD"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { resolve } from '@scalar/import';
|
|
2
1
|
import { shouldUseProxy, redirectToProxy } from './redirectToProxy.js';
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -6,38 +5,25 @@ import { shouldUseProxy, redirectToProxy } from './redirectToProxy.js';
|
|
|
6
5
|
*
|
|
7
6
|
* If a proxy is provided and the URL requires it, it will first attempt to fetch using the proxy.
|
|
8
7
|
* If the proxy fetch fails or is not used, it will fall back to a direct fetch.
|
|
9
|
-
*
|
|
10
|
-
* Also handles cases where the input is a JSON object instead of a URL.
|
|
11
8
|
*/
|
|
12
|
-
async function fetchWithProxyFallback(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (typeof value === 'object' && value !== null) {
|
|
17
|
-
const json = JSON.stringify(value, null, 2);
|
|
18
|
-
return {
|
|
19
|
-
ok: true,
|
|
20
|
-
status: 200,
|
|
21
|
-
text: async () => json,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
if (typeof url !== 'string') {
|
|
25
|
-
throw new Error(`[fetchWithProxyFallback] Can’t fetch URL: ${url}`);
|
|
26
|
-
}
|
|
9
|
+
async function fetchWithProxyFallback(url, { proxy, cache }) {
|
|
10
|
+
const fetchOptions = {
|
|
11
|
+
cache: cache || 'default',
|
|
12
|
+
};
|
|
27
13
|
const shouldTryProxy = shouldUseProxy(proxy, url);
|
|
28
14
|
const initialUrl = shouldTryProxy ? redirectToProxy(proxy, url) : url;
|
|
29
15
|
try {
|
|
30
|
-
const result = await fetch(initialUrl,
|
|
16
|
+
const result = await fetch(initialUrl, fetchOptions);
|
|
31
17
|
if (result.ok || !shouldTryProxy) {
|
|
32
18
|
return result;
|
|
33
19
|
}
|
|
34
20
|
// Retry without proxy if the initial request failed
|
|
35
|
-
return await fetch(url,
|
|
21
|
+
return await fetch(url, fetchOptions);
|
|
36
22
|
}
|
|
37
23
|
catch (error) {
|
|
38
24
|
if (shouldTryProxy) {
|
|
39
25
|
// If proxy failed, try without it
|
|
40
|
-
return await fetch(url,
|
|
26
|
+
return await fetch(url, fetchOptions);
|
|
41
27
|
}
|
|
42
28
|
throw error;
|
|
43
29
|
}
|
|
@@ -203,6 +203,11 @@ export declare const migrate_v_2_1_0: (data: Omit<v_0_0_0.Data, "folders">) => {
|
|
|
203
203
|
schema?: unknown;
|
|
204
204
|
content?: unknown;
|
|
205
205
|
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
206
|
+
example?: unknown;
|
|
207
|
+
examples?: Record<string, {
|
|
208
|
+
value?: unknown;
|
|
209
|
+
summary?: string | undefined;
|
|
210
|
+
}> | undefined;
|
|
206
211
|
}[];
|
|
207
212
|
type: "request";
|
|
208
213
|
method: "options" | "delete" | "get" | "connect" | "head" | "patch" | "post" | "put" | "trace";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,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BACtB,CAAC;oBACR,CAAN;sBAAmC,CAAC;uBACf,CAAC;uBAChB,CAAA;uBAAoC,CAAC;wBAIvC,CADH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAUU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA0Iyd,CAAC;;6BAA4E,CAAC;;;;;;;;;;CADljB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getExampleFromSchema.d.ts","sourceRoot":"","sources":["../../src/spec-getters/getExampleFromSchema.ts"],"names":[],"mappings":"AAwDA;;GAEG;AACH,eAAO,MAAM,oBAAoB,WACvB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YACjB;IACR;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC/B;;OAEG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAA;CACzC,UACM,MAAM,iBACE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,SAC3B,MAAM,KACZ,
|
|
1
|
+
{"version":3,"file":"getExampleFromSchema.d.ts","sourceRoot":"","sources":["../../src/spec-getters/getExampleFromSchema.ts"],"names":[],"mappings":"AAwDA;;GAEG;AACH,eAAO,MAAM,oBAAoB,WACvB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YACjB;IACR;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC/B;;OAEG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAA;CACzC,UACM,MAAM,iBACE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,SAC3B,MAAM,KACZ,GAqTF,CAAA"}
|
|
@@ -170,19 +170,32 @@ const getExampleFromSchema = (schema, options, level = 0, parentSchema, name) =>
|
|
|
170
170
|
}
|
|
171
171
|
// Check whether the array has a anyOf, oneOf, or allOf rule
|
|
172
172
|
if (schema.items) {
|
|
173
|
-
//
|
|
174
|
-
|
|
173
|
+
// First handle allOf separately since it needs special handling
|
|
174
|
+
if (schema.items.allOf) {
|
|
175
|
+
// If the first item is an object type, merge all schemas
|
|
176
|
+
if (schema.items.allOf[0].type === 'object') {
|
|
177
|
+
const mergedExample = getExampleFromSchema({ type: 'object', allOf: schema.items.allOf }, options, level + 1, schema);
|
|
178
|
+
return cache(schema, wrapItems
|
|
179
|
+
? [{ [itemsXmlTagName]: mergedExample }]
|
|
180
|
+
: [mergedExample]);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
// For non-objects (like strings), collect all examples
|
|
184
|
+
const examples = schema.items.allOf
|
|
185
|
+
.map((item) => getExampleFromSchema(item, options, level + 1, schema))
|
|
186
|
+
.filter((item) => item !== undefined);
|
|
187
|
+
return cache(schema, wrapItems
|
|
188
|
+
? examples.map((example) => ({ [itemsXmlTagName]: example }))
|
|
189
|
+
: examples);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
// Handle other rules (anyOf, oneOf)
|
|
193
|
+
const rules = ['anyOf', 'oneOf'];
|
|
175
194
|
for (const rule of rules) {
|
|
176
|
-
// Skip early if the rule is not defined
|
|
177
195
|
if (!schema.items[rule]) {
|
|
178
196
|
continue;
|
|
179
197
|
}
|
|
180
|
-
|
|
181
|
-
const schemas = ['anyOf', 'oneOf'].includes(rule)
|
|
182
|
-
? // Use the first item only
|
|
183
|
-
schema.items[rule].slice(0, 1)
|
|
184
|
-
: // Use all items
|
|
185
|
-
schema.items[rule];
|
|
198
|
+
const schemas = schema.items[rule].slice(0, 1);
|
|
186
199
|
const exampleFromRule = schemas
|
|
187
200
|
.map((item) => getExampleFromSchema(item, options, level + 1, schema))
|
|
188
201
|
.filter((item) => item !== undefined);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type Collection, type CollectionPayload, type Request, type RequestExample, type Server, type Tag } from '../entities/spec/index.js';
|
|
2
|
-
import { type SecurityScheme } from '../entities/spec/security.js';
|
|
2
|
+
import { type SecurityScheme, type SecuritySchemeExampleValue } from '../entities/spec/security.js';
|
|
3
3
|
import type { OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
4
4
|
import type { ReferenceConfiguration } from '@scalar/types/legacy';
|
|
5
5
|
import type { UnknownObject } from '@scalar/types/utils';
|
|
6
|
+
/** Pre-fill baseValues if we have authentication config */
|
|
7
|
+
export declare const getBaseAuthValues: (scheme: SecurityScheme, auth?: ReferenceConfiguration["authentication"]) => Record<string, never> | Partial<SecuritySchemeExampleValue>;
|
|
6
8
|
/** Takes a string or object and parses it into an openapi spec compliant schema */
|
|
7
9
|
export declare const parseSchema: (spec: string | UnknownObject) => Promise<{
|
|
8
10
|
schema: OpenAPIV3.Document | OpenAPIV3_1.Document;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-spec.d.ts","sourceRoot":"","sources":["../../src/transforms/import-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,cAAc,EAGnB,KAAK,MAAM,EACX,KAAK,GAAG,EAOT,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"import-spec.d.ts","sourceRoot":"","sources":["../../src/transforms/import-spec.ts"],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AAG,WAAW,CAAC,QAAQ,CAAA;IACjD,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,eAAe,EAAE,cAAc,EAAE,CAAA;CAClC,GACD;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CAC5C,CAkRA"}
|
|
@@ -42,7 +42,7 @@ const convertOauth2Flows = (security, nameKey, auth) => {
|
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
44
|
/** Pre-fill baseValues if we have authentication config */
|
|
45
|
-
const
|
|
45
|
+
const getBaseAuthValues = (scheme, auth) => {
|
|
46
46
|
if (!auth)
|
|
47
47
|
return {};
|
|
48
48
|
// ApiKey
|
|
@@ -262,16 +262,18 @@ async function importSpecToWorkspace(spec, { authentication, documentUrl, setCol
|
|
|
262
262
|
// Generate Collection
|
|
263
263
|
// Create the auth examples
|
|
264
264
|
const auth = securitySchemes?.reduce((prev, s) => {
|
|
265
|
-
const baseValues =
|
|
265
|
+
const baseValues = getBaseAuthValues(s, authentication);
|
|
266
266
|
const example = authExampleFromSchema(s, baseValues);
|
|
267
267
|
if (example)
|
|
268
268
|
prev[s.uid] = example;
|
|
269
269
|
return prev;
|
|
270
270
|
}, {});
|
|
271
|
-
|
|
271
|
+
const securityKeys = Object.keys(security);
|
|
272
272
|
let selectedSecuritySchemeUids = [];
|
|
273
|
-
|
|
274
|
-
|
|
273
|
+
/** Selected security scheme UIDs for the collection, defaults to the first key */
|
|
274
|
+
if (setCollectionSecurity && securityKeys.length) {
|
|
275
|
+
const preferred = authentication?.preferredSecurityScheme || securityKeys[0];
|
|
276
|
+
const uid = securitySchemeMap[preferred];
|
|
275
277
|
selectedSecuritySchemeUids = [uid];
|
|
276
278
|
}
|
|
277
279
|
const collection = collectionSchema.parse({
|
|
@@ -307,4 +309,4 @@ async function importSpecToWorkspace(spec, { authentication, documentUrl, setCol
|
|
|
307
309
|
};
|
|
308
310
|
}
|
|
309
311
|
|
|
310
|
-
export { importSpecToWorkspace, parseSchema };
|
|
312
|
+
export { getBaseAuthValues, importSpecToWorkspace, parseSchema };
|
package/dist/transforms/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { importSpecToWorkspace, parseSchema } from './import-spec.js';
|
|
1
|
+
export { getBaseAuthValues, importSpecToWorkspace, parseSchema } from './import-spec.js';
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"specification",
|
|
17
17
|
"yaml"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.2.
|
|
19
|
+
"version": "0.2.66",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -106,20 +106,19 @@
|
|
|
106
106
|
"nanoid": "^5.0.7",
|
|
107
107
|
"yaml": "^2.4.5",
|
|
108
108
|
"zod": "^3.23.8",
|
|
109
|
-
"@scalar/import": "0.0.3",
|
|
110
|
-
"@scalar/object-utils": "1.1.10",
|
|
111
109
|
"@scalar/openapi-types": "0.1.4",
|
|
112
|
-
"@scalar/
|
|
113
|
-
"@scalar/
|
|
110
|
+
"@scalar/object-utils": "1.1.11",
|
|
111
|
+
"@scalar/themes": "0.9.45",
|
|
112
|
+
"@scalar/types": "0.0.18"
|
|
114
113
|
},
|
|
115
114
|
"devDependencies": {
|
|
116
115
|
"type-fest": "^4.20.0",
|
|
117
116
|
"vite": "^5.4.9",
|
|
118
117
|
"vitest": "^1.6.0",
|
|
119
118
|
"zod-to-ts": "^1.2.0",
|
|
119
|
+
"@scalar/build-tooling": "0.1.11",
|
|
120
120
|
"@scalar/openapi-parser": "0.8.8",
|
|
121
|
-
"@scalar/openapi-types": "0.1.4"
|
|
122
|
-
"@scalar/build-tooling": "0.1.11"
|
|
121
|
+
"@scalar/openapi-types": "0.1.4"
|
|
123
122
|
},
|
|
124
123
|
"scripts": {
|
|
125
124
|
"build": "scalar-build-rollup",
|