@scalar/oas-utils 0.2.101 → 0.2.103
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 +23 -0
- package/dist/entities/shared/index.d.ts +1 -1
- package/dist/entities/shared/index.d.ts.map +1 -1
- package/dist/entities/shared/index.js +1 -1
- package/dist/entities/shared/utility.d.ts +3 -0
- package/dist/entities/shared/utility.d.ts.map +1 -1
- package/dist/entities/shared/utility.js +6 -1
- package/dist/entities/spec/collection.d.ts +6 -6
- package/dist/entities/spec/collection.d.ts.map +1 -1
- package/dist/entities/spec/collection.js +2 -2
- package/dist/entities/spec/index.d.ts +1 -0
- package/dist/entities/spec/index.d.ts.map +1 -1
- package/dist/entities/spec/index.js +1 -0
- package/dist/entities/spec/operation.d.ts +243 -0
- package/dist/entities/spec/operation.d.ts.map +1 -0
- package/dist/entities/spec/operation.js +9 -0
- package/dist/entities/spec/request-examples.d.ts.map +1 -1
- package/dist/entities/spec/request-examples.js +5 -3
- package/dist/entities/spec/requests.d.ts +3 -3
- package/dist/entities/spec/requests.d.ts.map +1 -1
- package/dist/entities/spec/requests.js +2 -2
- package/dist/helpers/ensure-protocol.d.ts +3 -0
- package/dist/helpers/ensure-protocol.d.ts.map +1 -0
- package/dist/helpers/ensure-protocol.js +12 -0
- package/dist/helpers/index.d.ts +2 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +2 -1
- package/dist/helpers/merge-urls.d.ts +15 -0
- package/dist/helpers/merge-urls.d.ts.map +1 -0
- package/dist/helpers/merge-urls.js +72 -0
- package/dist/helpers/redirectToProxy.d.ts.map +1 -1
- package/dist/helpers/redirectToProxy.js +5 -0
- package/dist/helpers/regexHelpers.d.ts +2 -0
- package/dist/helpers/regexHelpers.d.ts.map +1 -1
- package/dist/helpers/regexHelpers.js +2 -0
- package/dist/migrations/data-version.d.ts +2 -1
- package/dist/migrations/data-version.d.ts.map +1 -1
- package/dist/migrations/data-version.js +2 -1
- package/dist/migrations/migrator.d.ts +2 -2
- package/dist/migrations/migrator.d.ts.map +1 -1
- package/dist/migrations/migrator.js +4 -0
- package/dist/migrations/v-2.4.0/types.generated.d.ts +363 -24
- package/dist/migrations/v-2.4.0/types.generated.d.ts.map +1 -1
- package/dist/migrations/v-2.5.0/index.d.ts +3 -0
- package/dist/migrations/v-2.5.0/index.d.ts.map +1 -0
- package/dist/migrations/v-2.5.0/index.js +1 -0
- package/dist/migrations/v-2.5.0/migration.d.ts +5 -0
- package/dist/migrations/v-2.5.0/migration.d.ts.map +1 -0
- package/dist/migrations/v-2.5.0/migration.js +46 -0
- package/dist/migrations/v-2.5.0/types.generated.d.ts +38 -0
- package/dist/migrations/v-2.5.0/types.generated.d.ts.map +1 -0
- package/dist/transforms/import-spec.d.ts +5 -0
- package/dist/transforms/import-spec.d.ts.map +1 -1
- package/dist/transforms/import-spec.js +54 -30
- package/dist/transforms/index.js +1 -1
- package/package.json +11 -6
- package/dist/helpers/concatenateUrlAndPath.d.ts +0 -5
- package/dist/helpers/concatenateUrlAndPath.d.ts.map +0 -1
- package/dist/helpers/concatenateUrlAndPath.js +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @scalar/oas-utils
|
|
2
2
|
|
|
3
|
+
## 0.2.103
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0f5df68: chore: refactored send request with extensive test suite
|
|
8
|
+
- 937f791: chore: alias request to operation
|
|
9
|
+
- Updated dependencies [a30e7cc]
|
|
10
|
+
- @scalar/types@0.0.31
|
|
11
|
+
- @scalar/themes@0.9.65
|
|
12
|
+
|
|
13
|
+
## 0.2.102
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- a34f834: feat: adds accept header by default
|
|
18
|
+
- ef98b9c: fix: setting initial security with no requirements
|
|
19
|
+
- a34f834: feat: adds v-2.5.0 accept header migration
|
|
20
|
+
- ebdf762: feat: add back complex security requirements
|
|
21
|
+
- Updated dependencies [f9bf5f1]
|
|
22
|
+
- @scalar/openapi-types@0.1.7
|
|
23
|
+
- @scalar/types@0.0.30
|
|
24
|
+
- @scalar/themes@0.9.64
|
|
25
|
+
|
|
3
26
|
## 0.2.101
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { type Nanoid, type SelectedSecuritySchemeUids, nanoidSchema, selectedSecuritySchemeUidSchema, } from './utility.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/shared/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,0BAA0B,EAC/B,YAAY,EACZ,+BAA+B,GAChC,MAAM,WAAW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { nanoidSchema } from './utility.js';
|
|
1
|
+
export { nanoidSchema, selectedSecuritySchemeUidSchema } from './utility.js';
|
|
@@ -3,4 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
export declare const nanoidSchema: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
4
4
|
/** UID format for objects */
|
|
5
5
|
export type Nanoid = z.infer<typeof nanoidSchema>;
|
|
6
|
+
/** Schema for selectedSecuritySchemeUids */
|
|
7
|
+
export declare const selectedSecuritySchemeUidSchema: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodArray<z.ZodDefault<z.ZodOptional<z.ZodString>>, "many">]>, "many">>;
|
|
8
|
+
export type SelectedSecuritySchemeUids = z.infer<typeof selectedSecuritySchemeUidSchema>;
|
|
6
9
|
//# sourceMappingURL=utility.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../../src/entities/shared/utility.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,gCAAgC;AAChC,eAAO,MAAM,YAAY,0CAIC,CAAA;AAE1B,6BAA6B;AAC7B,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../../src/entities/shared/utility.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,gCAAgC;AAChC,eAAO,MAAM,YAAY,0CAIC,CAAA;AAE1B,6BAA6B;AAC7B,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAEjD,4CAA4C;AAC5C,eAAO,MAAM,+BAA+B,wJAG9B,CAAA;AAEd,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,+BAA+B,CACvC,CAAA"}
|
|
@@ -7,5 +7,10 @@ const nanoidSchema = z
|
|
|
7
7
|
.min(7)
|
|
8
8
|
.optional()
|
|
9
9
|
.default(() => nanoid());
|
|
10
|
+
/** Schema for selectedSecuritySchemeUids */
|
|
11
|
+
const selectedSecuritySchemeUidSchema = z
|
|
12
|
+
.union([nanoidSchema, nanoidSchema.array()])
|
|
13
|
+
.array()
|
|
14
|
+
.default([]);
|
|
10
15
|
|
|
11
|
-
export { nanoidSchema };
|
|
16
|
+
export { nanoidSchema, selectedSecuritySchemeUidSchema };
|
|
@@ -226,7 +226,7 @@ export declare const extendedCollectionSchema: z.ZodObject<{
|
|
|
226
226
|
/** A list of security schemes UIDs associated with the collection */
|
|
227
227
|
securitySchemes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
228
228
|
/** List of currently selected security scheme UIDs, these can be overridden per request */
|
|
229
|
-
selectedSecuritySchemeUids: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodOptional<z.ZodString>>, "many">>;
|
|
229
|
+
selectedSecuritySchemeUids: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodArray<z.ZodDefault<z.ZodOptional<z.ZodString>>, "many">]>, "many">>;
|
|
230
230
|
/** The currently selected server */
|
|
231
231
|
selectedServerUid: z.ZodDefault<z.ZodString>;
|
|
232
232
|
/** UIDs which refer to servers on the workspace base */
|
|
@@ -262,7 +262,7 @@ export declare const extendedCollectionSchema: z.ZodObject<{
|
|
|
262
262
|
uid: string;
|
|
263
263
|
children: string[];
|
|
264
264
|
securitySchemes: string[];
|
|
265
|
-
selectedSecuritySchemeUids: string[];
|
|
265
|
+
selectedSecuritySchemeUids: (string | string[])[];
|
|
266
266
|
selectedServerUid: string;
|
|
267
267
|
servers: string[];
|
|
268
268
|
requests: string[];
|
|
@@ -275,7 +275,7 @@ export declare const extendedCollectionSchema: z.ZodObject<{
|
|
|
275
275
|
uid?: string | undefined;
|
|
276
276
|
children?: (string | undefined)[] | undefined;
|
|
277
277
|
securitySchemes?: string[] | undefined;
|
|
278
|
-
selectedSecuritySchemeUids?: (string | undefined)[] | undefined;
|
|
278
|
+
selectedSecuritySchemeUids?: (string | (string | undefined)[] | undefined)[] | undefined;
|
|
279
279
|
selectedServerUid?: string | undefined;
|
|
280
280
|
servers?: (string | undefined)[] | undefined;
|
|
281
281
|
requests?: (string | undefined)[] | undefined;
|
|
@@ -427,7 +427,7 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
427
427
|
/** A list of security schemes UIDs associated with the collection */
|
|
428
428
|
securitySchemes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
429
429
|
/** List of currently selected security scheme UIDs, these can be overridden per request */
|
|
430
|
-
selectedSecuritySchemeUids: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodOptional<z.ZodString>>, "many">>;
|
|
430
|
+
selectedSecuritySchemeUids: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodArray<z.ZodDefault<z.ZodOptional<z.ZodString>>, "many">]>, "many">>;
|
|
431
431
|
/** The currently selected server */
|
|
432
432
|
selectedServerUid: z.ZodDefault<z.ZodString>;
|
|
433
433
|
/** UIDs which refer to servers on the workspace base */
|
|
@@ -467,7 +467,7 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
467
467
|
security: Record<string, string[]>[];
|
|
468
468
|
'x-scalar-icon': string;
|
|
469
469
|
securitySchemes: string[];
|
|
470
|
-
selectedSecuritySchemeUids: string[];
|
|
470
|
+
selectedSecuritySchemeUids: (string | string[])[];
|
|
471
471
|
selectedServerUid: string;
|
|
472
472
|
servers: string[];
|
|
473
473
|
requests: string[];
|
|
@@ -558,7 +558,7 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
558
558
|
example?: string | undefined;
|
|
559
559
|
}> | undefined;
|
|
560
560
|
securitySchemes?: string[] | undefined;
|
|
561
|
-
selectedSecuritySchemeUids?: (string | undefined)[] | undefined;
|
|
561
|
+
selectedSecuritySchemeUids?: (string | (string | undefined)[] | undefined)[] | undefined;
|
|
562
562
|
selectedServerUid?: string | undefined;
|
|
563
563
|
servers?: (string | undefined)[] | undefined;
|
|
564
564
|
requests?: (string | undefined)[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/collection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/collection.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,mBAAmB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AO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { nanoidSchema, selectedSecuritySchemeUidSchema } from '../shared/utility.js';
|
|
1
2
|
import { xScalarEnvironmentsSchema } from './x-scalar-environments.js';
|
|
2
3
|
import { xScalarSecretsSchema } from './x-scalar-secrets.js';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { oasSecurityRequirementSchema } from './security.js';
|
|
5
6
|
import { oasInfoSchema, oasExternalDocumentationSchema } from './spec-objects.js';
|
|
6
|
-
import { nanoidSchema } from '../shared/utility.js';
|
|
7
7
|
|
|
8
8
|
const oasCollectionSchema = z.object({
|
|
9
9
|
/**
|
|
@@ -53,7 +53,7 @@ const extendedCollectionSchema = z.object({
|
|
|
53
53
|
/** A list of security schemes UIDs associated with the collection */
|
|
54
54
|
securitySchemes: z.string().array().default([]),
|
|
55
55
|
/** List of currently selected security scheme UIDs, these can be overridden per request */
|
|
56
|
-
selectedSecuritySchemeUids:
|
|
56
|
+
selectedSecuritySchemeUids: selectedSecuritySchemeUidSchema,
|
|
57
57
|
/** The currently selected server */
|
|
58
58
|
selectedServerUid: z.string().default(''),
|
|
59
59
|
/** UIDs which refer to servers on the workspace base */
|
|
@@ -8,4 +8,5 @@ export * from './security.js';
|
|
|
8
8
|
export * from './x-scalar-environments.js';
|
|
9
9
|
type FetchRequest = Request;
|
|
10
10
|
export type { FetchRequest };
|
|
11
|
+
export { type Operation, type OperationPayload, operationSchema, } from './operation.js';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,yBAAyB,CAAA;AAEvC,KAAK,YAAY,GAAG,OAAO,CAAA;AAC3B,YAAY,EAAE,YAAY,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,yBAAyB,CAAA;AAEvC,KAAK,YAAY,GAAG,OAAO,CAAA;AAC3B,YAAY,EAAE,YAAY,EAAE,CAAA;AAE5B,OAAO,EACL,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,eAAe,GAChB,MAAM,aAAa,CAAA"}
|
|
@@ -6,3 +6,4 @@ export { oasContactSchema, oasExternalDocumentationSchema, oasInfoSchema, oasLic
|
|
|
6
6
|
export { oasParameterSchema, parameterStyleSchema, parameterTypeSchema } from './parameters.js';
|
|
7
7
|
export { oasSecurityRequirementSchema, oasSecuritySchemeSchema, pkceOptions, securityApiKeySchema, securityHttpSchema, securityOauthSchema, securityOpenIdSchema, securitySchemeApiKeyIn, securitySchemeSchema } from './security.js';
|
|
8
8
|
export { xScalarEnvVarSchema, xScalarEnvironmentSchema, xScalarEnvironmentsSchema } from './x-scalar-environments.js';
|
|
9
|
+
export { operationSchema } from './operation.js';
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aliases Request to Operation which is closer to the spec,
|
|
3
|
+
* also will not conflict with the builtin Request class
|
|
4
|
+
*/
|
|
5
|
+
import { type RequestPayload, type Request as RequestType } from './requests.js';
|
|
6
|
+
export type Operation = RequestType;
|
|
7
|
+
export type OperationPayload = RequestPayload;
|
|
8
|
+
export declare const operationSchema: import("zod").ZodObject<import("zod").objectUtil.extendShape<Omit<{
|
|
9
|
+
tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
10
|
+
summary: import("zod").ZodOptional<import("zod").ZodString>;
|
|
11
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
12
|
+
operationId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
13
|
+
security: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>>>, "many">>;
|
|
14
|
+
requestBody: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
15
|
+
parameters: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
16
|
+
in: import("zod").ZodEnum<["path", "query", "header", "cookie"]>;
|
|
17
|
+
name: import("zod").ZodString;
|
|
18
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
19
|
+
required: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
|
|
20
|
+
deprecated: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
|
|
21
|
+
schema: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
22
|
+
content: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
23
|
+
style: import("zod").ZodOptional<import("zod").ZodEnum<["matrix", "simple", "form", "label", "spaceDelimited", "pipeDelimited", "deepObject"]>>;
|
|
24
|
+
example: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
25
|
+
examples: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
26
|
+
value: import("zod").ZodUnknown;
|
|
27
|
+
summary: import("zod").ZodOptional<import("zod").ZodString>;
|
|
28
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
29
|
+
value?: unknown;
|
|
30
|
+
summary?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
value?: unknown;
|
|
33
|
+
summary?: string | undefined;
|
|
34
|
+
}>>>;
|
|
35
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
36
|
+
required: boolean;
|
|
37
|
+
name: string;
|
|
38
|
+
in: "path" | "query" | "header" | "cookie";
|
|
39
|
+
deprecated: boolean;
|
|
40
|
+
description?: string | undefined;
|
|
41
|
+
example?: unknown;
|
|
42
|
+
schema?: unknown;
|
|
43
|
+
content?: unknown;
|
|
44
|
+
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
45
|
+
examples?: Record<string, {
|
|
46
|
+
value?: unknown;
|
|
47
|
+
summary?: string | undefined;
|
|
48
|
+
}> | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
name: string;
|
|
51
|
+
in: "path" | "query" | "header" | "cookie";
|
|
52
|
+
required?: boolean | undefined;
|
|
53
|
+
description?: string | undefined;
|
|
54
|
+
example?: unknown;
|
|
55
|
+
deprecated?: boolean | undefined;
|
|
56
|
+
schema?: unknown;
|
|
57
|
+
content?: unknown;
|
|
58
|
+
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
59
|
+
examples?: Record<string, {
|
|
60
|
+
value?: unknown;
|
|
61
|
+
summary?: string | undefined;
|
|
62
|
+
}> | undefined;
|
|
63
|
+
}>, "many">>;
|
|
64
|
+
externalDocs: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
65
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
66
|
+
url: import("zod").ZodDefault<import("zod").ZodString>;
|
|
67
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
68
|
+
url: string;
|
|
69
|
+
description?: string | undefined;
|
|
70
|
+
}, {
|
|
71
|
+
description?: string | undefined;
|
|
72
|
+
url?: string | undefined;
|
|
73
|
+
}>>;
|
|
74
|
+
deprecated: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
75
|
+
responses: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
76
|
+
'x-scalar-examples': import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
77
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
78
|
+
body: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
79
|
+
encoding: import("zod").ZodEnum<["application/json", "text/plain", "text/html", "application/javascript", "application/xml", "application/yaml", "application/edn", "application/octet-stream", "application/x-www-form-urlencoded", "multipart/form-data", "binary"]>;
|
|
80
|
+
content: import("zod").ZodUnion<[import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>, import("zod").ZodString]>;
|
|
81
|
+
file: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
|
|
82
|
+
url: import("zod").ZodString;
|
|
83
|
+
base64: import("zod").ZodOptional<import("zod").ZodString>;
|
|
84
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
85
|
+
url: string;
|
|
86
|
+
base64?: string | undefined;
|
|
87
|
+
}, {
|
|
88
|
+
url: string;
|
|
89
|
+
base64?: string | undefined;
|
|
90
|
+
}>>>;
|
|
91
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
92
|
+
content: string | Record<string, any>;
|
|
93
|
+
encoding: "application/json" | "text/plain" | "text/html" | "application/javascript" | "application/xml" | "application/yaml" | "application/edn" | "application/octet-stream" | "application/x-www-form-urlencoded" | "multipart/form-data" | "binary";
|
|
94
|
+
file?: {
|
|
95
|
+
url: string;
|
|
96
|
+
base64?: string | undefined;
|
|
97
|
+
} | null | undefined;
|
|
98
|
+
}, {
|
|
99
|
+
content: string | Record<string, any>;
|
|
100
|
+
encoding: "application/json" | "text/plain" | "text/html" | "application/javascript" | "application/xml" | "application/yaml" | "application/edn" | "application/octet-stream" | "application/x-www-form-urlencoded" | "multipart/form-data" | "binary";
|
|
101
|
+
file?: {
|
|
102
|
+
url: string;
|
|
103
|
+
base64?: string | undefined;
|
|
104
|
+
} | null | undefined;
|
|
105
|
+
}>>;
|
|
106
|
+
parameters: import("zod").ZodObject<{
|
|
107
|
+
path: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
108
|
+
query: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
109
|
+
headers: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
110
|
+
cookies: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
111
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
112
|
+
path?: Record<string, string> | undefined;
|
|
113
|
+
cookies?: Record<string, string> | undefined;
|
|
114
|
+
query?: Record<string, string> | undefined;
|
|
115
|
+
headers?: Record<string, string> | undefined;
|
|
116
|
+
}, {
|
|
117
|
+
path?: Record<string, string> | undefined;
|
|
118
|
+
cookies?: Record<string, string> | undefined;
|
|
119
|
+
query?: Record<string, string> | undefined;
|
|
120
|
+
headers?: Record<string, string> | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
123
|
+
parameters: {
|
|
124
|
+
path?: Record<string, string> | undefined;
|
|
125
|
+
cookies?: Record<string, string> | undefined;
|
|
126
|
+
query?: Record<string, string> | undefined;
|
|
127
|
+
headers?: Record<string, string> | undefined;
|
|
128
|
+
};
|
|
129
|
+
name?: string | undefined;
|
|
130
|
+
body?: {
|
|
131
|
+
content: string | Record<string, any>;
|
|
132
|
+
encoding: "application/json" | "text/plain" | "text/html" | "application/javascript" | "application/xml" | "application/yaml" | "application/edn" | "application/octet-stream" | "application/x-www-form-urlencoded" | "multipart/form-data" | "binary";
|
|
133
|
+
file?: {
|
|
134
|
+
url: string;
|
|
135
|
+
base64?: string | undefined;
|
|
136
|
+
} | null | undefined;
|
|
137
|
+
} | undefined;
|
|
138
|
+
}, {
|
|
139
|
+
parameters: {
|
|
140
|
+
path?: Record<string, string> | undefined;
|
|
141
|
+
cookies?: Record<string, string> | undefined;
|
|
142
|
+
query?: Record<string, string> | undefined;
|
|
143
|
+
headers?: Record<string, string> | undefined;
|
|
144
|
+
};
|
|
145
|
+
name?: string | undefined;
|
|
146
|
+
body?: {
|
|
147
|
+
content: string | Record<string, any>;
|
|
148
|
+
encoding: "application/json" | "text/plain" | "text/html" | "application/javascript" | "application/xml" | "application/yaml" | "application/edn" | "application/octet-stream" | "application/x-www-form-urlencoded" | "multipart/form-data" | "binary";
|
|
149
|
+
file?: {
|
|
150
|
+
url: string;
|
|
151
|
+
base64?: string | undefined;
|
|
152
|
+
} | null | undefined;
|
|
153
|
+
} | undefined;
|
|
154
|
+
}>>>;
|
|
155
|
+
'x-internal': import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
156
|
+
'x-scalar-ignore': import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
157
|
+
}, "x-scalar-examples">, {
|
|
158
|
+
type: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodLiteral<"request">>>;
|
|
159
|
+
uid: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
160
|
+
path: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
161
|
+
method: import("zod").ZodDefault<import("zod").ZodEnum<["connect", "delete", "get", "head", "options", "patch", "post", "put", "trace"]>>;
|
|
162
|
+
servers: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>, "many">>;
|
|
163
|
+
selectedServerUid: import("zod").ZodDefault<import("zod").ZodString>;
|
|
164
|
+
examples: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>, "many">>;
|
|
165
|
+
selectedSecuritySchemeUids: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>, import("zod").ZodArray<import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>, "many">]>, "many">>;
|
|
166
|
+
}>, "strip", import("zod").ZodTypeAny, {
|
|
167
|
+
path: string;
|
|
168
|
+
type: "request";
|
|
169
|
+
uid: string;
|
|
170
|
+
selectedSecuritySchemeUids: (string | string[])[];
|
|
171
|
+
selectedServerUid: string;
|
|
172
|
+
servers: string[];
|
|
173
|
+
examples: string[];
|
|
174
|
+
method: "options" | "connect" | "delete" | "get" | "head" | "patch" | "post" | "put" | "trace";
|
|
175
|
+
description?: string | undefined;
|
|
176
|
+
summary?: string | undefined;
|
|
177
|
+
externalDocs?: {
|
|
178
|
+
url: string;
|
|
179
|
+
description?: string | undefined;
|
|
180
|
+
} | undefined;
|
|
181
|
+
'x-internal'?: boolean | undefined;
|
|
182
|
+
'x-scalar-ignore'?: boolean | undefined;
|
|
183
|
+
security?: Record<string, string[]>[] | undefined;
|
|
184
|
+
tags?: string[] | undefined;
|
|
185
|
+
deprecated?: boolean | undefined;
|
|
186
|
+
operationId?: string | undefined;
|
|
187
|
+
parameters?: {
|
|
188
|
+
required: boolean;
|
|
189
|
+
name: string;
|
|
190
|
+
in: "path" | "query" | "header" | "cookie";
|
|
191
|
+
deprecated: boolean;
|
|
192
|
+
description?: string | undefined;
|
|
193
|
+
example?: unknown;
|
|
194
|
+
schema?: unknown;
|
|
195
|
+
content?: unknown;
|
|
196
|
+
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
197
|
+
examples?: Record<string, {
|
|
198
|
+
value?: unknown;
|
|
199
|
+
summary?: string | undefined;
|
|
200
|
+
}> | undefined;
|
|
201
|
+
}[] | undefined;
|
|
202
|
+
requestBody?: any;
|
|
203
|
+
responses?: Record<string, any> | undefined;
|
|
204
|
+
}, {
|
|
205
|
+
path?: string | undefined;
|
|
206
|
+
type?: "request" | undefined;
|
|
207
|
+
uid?: string | undefined;
|
|
208
|
+
description?: string | undefined;
|
|
209
|
+
summary?: string | undefined;
|
|
210
|
+
externalDocs?: {
|
|
211
|
+
description?: string | undefined;
|
|
212
|
+
url?: string | undefined;
|
|
213
|
+
} | undefined;
|
|
214
|
+
'x-internal'?: boolean | undefined;
|
|
215
|
+
'x-scalar-ignore'?: boolean | undefined;
|
|
216
|
+
security?: Record<string, string[] | undefined>[] | undefined;
|
|
217
|
+
selectedSecuritySchemeUids?: (string | (string | undefined)[] | undefined)[] | undefined;
|
|
218
|
+
selectedServerUid?: string | undefined;
|
|
219
|
+
servers?: (string | undefined)[] | undefined;
|
|
220
|
+
tags?: string[] | undefined;
|
|
221
|
+
deprecated?: boolean | undefined;
|
|
222
|
+
examples?: (string | undefined)[] | undefined;
|
|
223
|
+
operationId?: string | undefined;
|
|
224
|
+
parameters?: {
|
|
225
|
+
name: string;
|
|
226
|
+
in: "path" | "query" | "header" | "cookie";
|
|
227
|
+
required?: boolean | undefined;
|
|
228
|
+
description?: string | undefined;
|
|
229
|
+
example?: unknown;
|
|
230
|
+
deprecated?: boolean | undefined;
|
|
231
|
+
schema?: unknown;
|
|
232
|
+
content?: unknown;
|
|
233
|
+
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
|
|
234
|
+
examples?: Record<string, {
|
|
235
|
+
value?: unknown;
|
|
236
|
+
summary?: string | undefined;
|
|
237
|
+
}> | undefined;
|
|
238
|
+
}[] | undefined;
|
|
239
|
+
requestBody?: any;
|
|
240
|
+
responses?: Record<string, any> | undefined;
|
|
241
|
+
method?: "options" | "connect" | "delete" | "get" | "head" | "patch" | "post" | "put" | "trace" | undefined;
|
|
242
|
+
}>;
|
|
243
|
+
//# sourceMappingURL=operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/operation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,OAAO,IAAI,WAAW,EAE5B,MAAM,YAAY,CAAA;AAEnB,MAAM,MAAM,SAAS,GAAG,WAAW,CAAA;AACnC,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAA;AAC7C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAgB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-examples.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/request-examples.ts"],"names":[],"mappings":"AAOA,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;AAKtC;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAezC,CAAA;AAUF,kFAAkF;AAClF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,8BAA8B,CACtC,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;GAKtB,CAAA;AAEb;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE;;;;GAIG;AACH,eAAO,MAAM,oBAA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;;;;;;;;;;;;IAiB/B,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEvC,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAOjE,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB;IAC/B,qCAAqC;;;;QA7CrC;;;;WAIG;;QAEH,0EAA0E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgD1E,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,cAAc;;;;;;;;;;;;;;;;EA8D9D;AAKD,6DAA6D;AAC7D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB;;;;;;;;;;;;;;;EAuD1D;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,GACd,cAAc,CAuGhB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { keysOf } from '@scalar/object-utils/arrays';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { nanoidSchema } from '../shared/utility.js';
|
|
3
4
|
import { schemaModel } from '../../helpers/schema-model.js';
|
|
4
5
|
import { getRequestBodyFromOperation } from '../../spec-getters/getRequestBodyFromOperation.js';
|
|
5
6
|
import { getServerVariableExamples } from '../../spec-getters/getServerVariableExamples.js';
|
|
6
|
-
import { nanoidSchema } from '../shared/utility.js';
|
|
7
7
|
|
|
8
8
|
// ---------------------------------------------------------------------------
|
|
9
9
|
// Example Parameters
|
|
@@ -145,7 +145,9 @@ const requestExampleSchema = z.object({
|
|
|
145
145
|
.object({
|
|
146
146
|
path: requestExampleParametersSchema.array().default([]),
|
|
147
147
|
query: requestExampleParametersSchema.array().default([]),
|
|
148
|
-
headers: requestExampleParametersSchema
|
|
148
|
+
headers: requestExampleParametersSchema
|
|
149
|
+
.array()
|
|
150
|
+
.default([{ key: 'Accept', value: '*/*', enabled: true }]),
|
|
149
151
|
cookies: requestExampleParametersSchema.array().default([]),
|
|
150
152
|
})
|
|
151
153
|
.optional()
|
|
@@ -286,7 +288,7 @@ function createExampleFromRequest(request, name, server) {
|
|
|
286
288
|
cookie: [],
|
|
287
289
|
// deprecated TODO: add zod transform to remove
|
|
288
290
|
header: [],
|
|
289
|
-
headers: [],
|
|
291
|
+
headers: [{ key: 'Accept', value: '*/*', enabled: true }],
|
|
290
292
|
};
|
|
291
293
|
// Populated the separated params
|
|
292
294
|
request.parameters?.forEach((p) => parameters[p.in].push(createParamInstance(p)));
|
|
@@ -506,12 +506,12 @@ export declare const requestSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
506
506
|
/** List of example UIDs associated with the request */
|
|
507
507
|
examples: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodOptional<z.ZodString>>, "many">>;
|
|
508
508
|
/** List of security scheme UIDs associated with the request */
|
|
509
|
-
selectedSecuritySchemeUids: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodOptional<z.ZodString>>, "many">>;
|
|
509
|
+
selectedSecuritySchemeUids: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodArray<z.ZodDefault<z.ZodOptional<z.ZodString>>, "many">]>, "many">>;
|
|
510
510
|
}>, "strip", z.ZodTypeAny, {
|
|
511
511
|
path: string;
|
|
512
512
|
type: "request";
|
|
513
513
|
uid: string;
|
|
514
|
-
selectedSecuritySchemeUids: string[];
|
|
514
|
+
selectedSecuritySchemeUids: (string | string[])[];
|
|
515
515
|
selectedServerUid: string;
|
|
516
516
|
servers: string[];
|
|
517
517
|
examples: string[];
|
|
@@ -558,7 +558,7 @@ export declare const requestSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
558
558
|
'x-internal'?: boolean | undefined;
|
|
559
559
|
'x-scalar-ignore'?: boolean | undefined;
|
|
560
560
|
security?: Record<string, string[] | undefined>[] | undefined;
|
|
561
|
-
selectedSecuritySchemeUids?: (string | undefined)[] | undefined;
|
|
561
|
+
selectedSecuritySchemeUids?: (string | (string | undefined)[] | undefined)[] | undefined;
|
|
562
562
|
selectedServerUid?: string | undefined;
|
|
563
563
|
servers?: (string | undefined)[] | undefined;
|
|
564
564
|
tags?: string[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/requests.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/requests.ts"],"names":[],"mappings":"AAKA,OAAO,EAAkB,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,oBAAoB,CAAA;AAI9E,eAAO,MAAM,cAAc,2FAUjB,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAE3D,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG;IACzD,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,wCAAwC;IACxC,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,kCAAkC;IAClC,QAAQ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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEvB,sBAAsB;;;;;;IAetB,eAAe;;IAEf,qBAAqB;;IAErB,kDAAkD;;IAElD,oCAAoC;;IAEpC,uDAAuD;;IAEvD,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOlC,CAAA;AAE/B,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"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { nanoidSchema, selectedSecuritySchemeUidSchema } from '../shared/utility.js';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import { oasParameterSchema } from './parameters.js';
|
|
3
4
|
import { xScalarExampleSchema } from './request-examples.js';
|
|
4
5
|
import { oasSecurityRequirementSchema } from './security.js';
|
|
5
6
|
import { oasExternalDocumentationSchema } from './spec-objects.js';
|
|
6
|
-
import { nanoidSchema } from '../shared/utility.js';
|
|
7
7
|
|
|
8
8
|
const requestMethods = [
|
|
9
9
|
'connect',
|
|
@@ -89,7 +89,7 @@ const extendedRequestSchema = z.object({
|
|
|
89
89
|
/** List of example UIDs associated with the request */
|
|
90
90
|
examples: nanoidSchema.array().default([]),
|
|
91
91
|
/** List of security scheme UIDs associated with the request */
|
|
92
|
-
selectedSecuritySchemeUids:
|
|
92
|
+
selectedSecuritySchemeUids: selectedSecuritySchemeUidSchema,
|
|
93
93
|
});
|
|
94
94
|
/** Unified request schema for client usage */
|
|
95
95
|
const requestSchema = oasRequestSchema
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensure-protocol.d.ts","sourceRoot":"","sources":["../../src/helpers/ensure-protocol.ts"],"names":[],"mappings":"AAEA,uCAAuC;AACvC,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMlD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { REGEX } from './regexHelpers.js';
|
|
2
|
+
|
|
3
|
+
/** Ensure URL has a protocol prefix */
|
|
4
|
+
function ensureProtocol(url) {
|
|
5
|
+
if (REGEX.PATH.test(url) || REGEX.PROTOCOL.test(url)) {
|
|
6
|
+
return url;
|
|
7
|
+
}
|
|
8
|
+
// Default to http if no protocol is specified
|
|
9
|
+
return `http://${url.replace(/^\//, '')}`;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { ensureProtocol };
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { isDefined } from './is-defined.js';
|
|
2
2
|
export { shouldIgnoreEntity } from './shouldIgnoreEntity.js';
|
|
3
|
-
export
|
|
3
|
+
export { combineUrlAndPath, mergeSearchParams, mergeUrls } from './merge-urls.js';
|
|
4
|
+
export { ensureProtocol } from './ensure-protocol.js';
|
|
4
5
|
export * from './createHash.js';
|
|
5
6
|
export * from './fetchSpecFromUrl.js';
|
|
6
7
|
export * from './fetchWithProxyFallback.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA;AACzC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA"}
|
package/dist/helpers/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { isDefined } from './is-defined.js';
|
|
2
2
|
export { shouldIgnoreEntity } from './shouldIgnoreEntity.js';
|
|
3
|
-
export {
|
|
3
|
+
export { combineUrlAndPath, mergeSearchParams, mergeUrls } from './merge-urls.js';
|
|
4
|
+
export { ensureProtocol } from './ensure-protocol.js';
|
|
4
5
|
export { createHash } from './createHash.js';
|
|
5
6
|
export { fetchSpecFromUrl } from './fetchSpecFromUrl.js';
|
|
6
7
|
export { fetchWithProxyFallback } from './fetchWithProxyFallback.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merges multiple URLSearchParams objects, preserving multiple values per param
|
|
3
|
+
* within each source, but later sources overwrite earlier ones completely
|
|
4
|
+
* This should de-dupe our query params while allowing multiple keys for "arrays"
|
|
5
|
+
*/
|
|
6
|
+
export declare const mergeSearchParams: (...params: URLSearchParams[]) => URLSearchParams;
|
|
7
|
+
/** Combines a base URL and a path ensuring there's only one slash between them */
|
|
8
|
+
export declare const combineUrlAndPath: (url: string, path: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a URL from the path and server
|
|
11
|
+
* also optionally merges query params if you include urlSearchParams
|
|
12
|
+
* This was re-written without using URL to support variables in the scheme
|
|
13
|
+
*/
|
|
14
|
+
export declare const mergeUrls: (url: string, path: string, urlParams?: URLSearchParams) => string;
|
|
15
|
+
//# sourceMappingURL=merge-urls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-urls.d.ts","sourceRoot":"","sources":["../../src/helpers/merge-urls.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,cACjB,eAAe,EAAE,KAC3B,eA6BF,CAAA;AAED,kFAAkF;AAClF,eAAO,MAAM,iBAAiB,QAAS,MAAM,QAAQ,MAAM,WAQ1D,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,QACf,MAAM,QACL,MAAM,cACD,eAAe,WAiC3B,CAAA"}
|