@scalar/oas-utils 0.2.105 → 0.2.107
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 +19 -0
- package/dist/entities/cookie/cookie.d.ts +2 -2
- package/dist/entities/cookie/cookie.js +1 -1
- package/dist/entities/environment/environment.d.ts +2 -2
- package/dist/entities/environment/environment.js +1 -1
- package/dist/entities/shared/utility.d.ts +13 -1
- package/dist/entities/shared/utility.d.ts.map +1 -1
- package/dist/entities/shared/utility.js +4 -1
- package/dist/entities/spec/collection.d.ts +46 -46
- package/dist/entities/spec/collection.d.ts.map +1 -1
- package/dist/entities/spec/collection.js +11 -16
- package/dist/entities/spec/operation.d.ts +22 -22
- package/dist/entities/spec/parameters.d.ts +4 -4
- package/dist/entities/spec/request-examples.d.ts +5 -5
- package/dist/entities/spec/request-examples.d.ts.map +1 -1
- package/dist/entities/spec/request-examples.js +25 -62
- package/dist/entities/spec/requests.d.ts +30 -30
- package/dist/entities/spec/requests.d.ts.map +1 -1
- package/dist/entities/spec/requests.js +6 -18
- package/dist/entities/spec/security.d.ts +22 -22
- package/dist/entities/spec/security.d.ts.map +1 -1
- package/dist/entities/spec/security.js +7 -22
- package/dist/entities/spec/server.d.ts +2 -2
- package/dist/entities/spec/server.d.ts.map +1 -1
- package/dist/entities/spec/server.js +3 -5
- package/dist/entities/spec/spec-objects.d.ts +5 -5
- package/dist/entities/spec/spec-objects.d.ts.map +1 -1
- package/dist/entities/spec/spec-objects.js +6 -3
- package/dist/entities/spec/x-scalar-secrets.d.ts +4 -4
- package/dist/entities/spec/x-scalar-secrets.d.ts.map +1 -1
- package/dist/entities/workspace/workspace.d.ts +7 -7
- package/dist/entities/workspace/workspace.d.ts.map +1 -1
- package/dist/entities/workspace/workspace.js +5 -5
- package/dist/helpers/fetchSpecFromUrl.d.ts.map +1 -1
- package/dist/helpers/fetchSpecFromUrl.js +1 -1
- package/dist/helpers/json2xml.d.ts.map +1 -1
- package/dist/helpers/json2xml.js +3 -7
- package/dist/migrations/migrator.d.ts +1 -1
- package/dist/migrations/migrator.d.ts.map +1 -1
- package/dist/migrations/v-2.5.0/migration.d.ts +1 -1
- package/dist/migrations/v-2.5.0/migration.d.ts.map +1 -1
- package/dist/migrations/v-2.5.0/migration.js +66 -3
- package/dist/migrations/v-2.5.0/types.generated.d.ts +17 -17
- package/dist/migrations/v-2.5.0/types.generated.d.ts.map +1 -1
- package/dist/transforms/import-spec.d.ts +1 -1
- package/dist/transforms/import-spec.d.ts.map +1 -1
- package/dist/transforms/import-spec.js +26 -41
- package/package.json +7 -7
|
@@ -9,7 +9,7 @@ const commonProps = z.object({
|
|
|
9
9
|
description: z.string().optional(),
|
|
10
10
|
});
|
|
11
11
|
const extendedSecuritySchema = z.object({
|
|
12
|
-
uid: nanoidSchema,
|
|
12
|
+
uid: nanoidSchema.brand(),
|
|
13
13
|
/** The name key that links a security requirement to a security object */
|
|
14
14
|
nameKey: z.string().optional().default(''),
|
|
15
15
|
});
|
|
@@ -26,9 +26,7 @@ const oasSecuritySchemeApiKey = commonProps.extend({
|
|
|
26
26
|
const apiKeyValueSchema = z.object({
|
|
27
27
|
value: z.string().default(''),
|
|
28
28
|
});
|
|
29
|
-
const securityApiKeySchema = oasSecuritySchemeApiKey
|
|
30
|
-
.merge(extendedSecuritySchema)
|
|
31
|
-
.merge(apiKeyValueSchema);
|
|
29
|
+
const securityApiKeySchema = oasSecuritySchemeApiKey.merge(extendedSecuritySchema).merge(apiKeyValueSchema);
|
|
32
30
|
// ---------------------------------------------------------------------------
|
|
33
31
|
// HTTP
|
|
34
32
|
const oasSecuritySchemeHttp = commonProps.extend({
|
|
@@ -58,9 +56,7 @@ const httpValueSchema = z.object({
|
|
|
58
56
|
password: z.string().default(''),
|
|
59
57
|
token: z.string().default(''),
|
|
60
58
|
});
|
|
61
|
-
const securityHttpSchema = oasSecuritySchemeHttp
|
|
62
|
-
.merge(extendedSecuritySchema)
|
|
63
|
-
.merge(httpValueSchema);
|
|
59
|
+
const securityHttpSchema = oasSecuritySchemeHttp.merge(extendedSecuritySchema).merge(httpValueSchema);
|
|
64
60
|
// ---------------------------------------------------------------------------
|
|
65
61
|
// OPENID CONNECT
|
|
66
62
|
const oasSecuritySchemeOpenId = commonProps.extend({
|
|
@@ -94,10 +90,7 @@ const flowsCommon = z.object({
|
|
|
94
90
|
* REQUIRED. The available scopes for the OAuth2 security scheme. A map
|
|
95
91
|
* between the scope name and a short description for it. The map MAY be empty.
|
|
96
92
|
*/
|
|
97
|
-
'scopes': z
|
|
98
|
-
.record(z.string(), z.string().optional().default(''))
|
|
99
|
-
.optional()
|
|
100
|
-
.default({}),
|
|
93
|
+
'scopes': z.record(z.string(), z.string().optional().default('')).optional().default({}),
|
|
101
94
|
'selectedScopes': z.array(z.string()).optional().default([]),
|
|
102
95
|
/** Extension to save the client Id associated with an oauth flow */
|
|
103
96
|
'x-scalar-client-id': z.string().optional().default(''),
|
|
@@ -105,9 +98,7 @@ const flowsCommon = z.object({
|
|
|
105
98
|
'token': z.string().default(''),
|
|
106
99
|
});
|
|
107
100
|
/** Setup a default redirect uri if we can */
|
|
108
|
-
const defaultRedirectUri = typeof window !== 'undefined'
|
|
109
|
-
? window.location.origin + window.location.pathname
|
|
110
|
-
: '';
|
|
101
|
+
const defaultRedirectUri = typeof window !== 'undefined' ? window.location.origin + window.location.pathname : '';
|
|
111
102
|
/** Options for the x-usePkce extension */
|
|
112
103
|
const pkceOptions = ['SHA-256', 'plain', 'no'];
|
|
113
104
|
/** Oauth2 security scheme */
|
|
@@ -120,10 +111,7 @@ const oasSecuritySchemeOauth2 = commonProps.extend({
|
|
|
120
111
|
implicit: flowsCommon.extend({
|
|
121
112
|
'type': z.literal('implicit'),
|
|
122
113
|
authorizationUrl,
|
|
123
|
-
'x-scalar-redirect-uri': z
|
|
124
|
-
.string()
|
|
125
|
-
.optional()
|
|
126
|
-
.default(defaultRedirectUri),
|
|
114
|
+
'x-scalar-redirect-uri': z.string().optional().default(defaultRedirectUri),
|
|
127
115
|
}),
|
|
128
116
|
/** Configuration for the OAuth Resource Owner Password flow */
|
|
129
117
|
password: flowsCommon.extend({
|
|
@@ -149,10 +137,7 @@ const oasSecuritySchemeOauth2 = commonProps.extend({
|
|
|
149
137
|
* TODO: add docs
|
|
150
138
|
*/
|
|
151
139
|
'x-usePkce': z.enum(pkceOptions).optional().default('no'),
|
|
152
|
-
'x-scalar-redirect-uri': z
|
|
153
|
-
.string()
|
|
154
|
-
.optional()
|
|
155
|
-
.default(defaultRedirectUri),
|
|
140
|
+
'x-scalar-redirect-uri': z.string().optional().default(defaultRedirectUri),
|
|
156
141
|
tokenUrl,
|
|
157
142
|
'clientSecret': z.string().default(''),
|
|
158
143
|
}),
|
|
@@ -94,9 +94,9 @@ export declare const serverSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
94
94
|
value?: string;
|
|
95
95
|
}>>>;
|
|
96
96
|
}, {
|
|
97
|
-
uid: z.ZodDefault<z.ZodOptional<z.ZodString
|
|
97
|
+
uid: z.ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "server">;
|
|
98
98
|
}>, "strip", z.ZodTypeAny, {
|
|
99
|
-
uid: string
|
|
99
|
+
uid: string & z.BRAND<"server">;
|
|
100
100
|
url: string;
|
|
101
101
|
description?: string | undefined;
|
|
102
102
|
variables?: Record<string, Omit<OpenAPIV3_1.ServerVariableObject, "enum"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,KAAK,SAAS,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB;IAClC;;OAEG;;IAEH;;;;OAIG;;IAEH;;OAEG;;;;;;;;;;EAEH,CAAA;
|
|
1
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od';
|
|
2
1
|
import { nanoidSchema } from '../shared/utility.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Server Variable Object
|
|
@@ -32,9 +32,7 @@ const extendedServerVariableSchema = oasServerVariableSchema
|
|
|
32
32
|
})
|
|
33
33
|
.refine((data) => {
|
|
34
34
|
// Set default to the first enum value if invalid
|
|
35
|
-
if (Array.isArray(data.enum) &&
|
|
36
|
-
!data.enum.includes(data.default ?? '') &&
|
|
37
|
-
data.enum.length > 0) {
|
|
35
|
+
if (Array.isArray(data.enum) && !data.enum.includes(data.default ?? '') && data.enum.length > 0) {
|
|
38
36
|
data.default = data.enum[0];
|
|
39
37
|
}
|
|
40
38
|
if (Array.isArray(data.enum) && data.enum.length === 0) {
|
|
@@ -66,7 +64,7 @@ const oasServerSchema = z.object({
|
|
|
66
64
|
variables: z.record(z.string(), extendedServerVariableSchema).optional(),
|
|
67
65
|
});
|
|
68
66
|
const serverSchema = oasServerSchema.extend({
|
|
69
|
-
uid: nanoidSchema,
|
|
67
|
+
uid: nanoidSchema.brand(),
|
|
70
68
|
});
|
|
71
69
|
|
|
72
70
|
export { oasServerSchema, oasServerVariableSchema, serverSchema };
|
|
@@ -265,13 +265,13 @@ export declare const tagSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
265
265
|
'x-internal': z.ZodOptional<z.ZodBoolean>;
|
|
266
266
|
'x-scalar-ignore': z.ZodOptional<z.ZodBoolean>;
|
|
267
267
|
}, {
|
|
268
|
-
uid: z.ZodDefault<z.ZodOptional<z.ZodString
|
|
269
|
-
children: z.ZodDefault<z.ZodArray<z.
|
|
268
|
+
uid: z.ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "tag">;
|
|
269
|
+
children: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodBranded<z.ZodString, "operation">, z.ZodBranded<z.ZodString, "tag">]>, "many">>;
|
|
270
270
|
}>, "strip", z.ZodTypeAny, {
|
|
271
271
|
type: "tag";
|
|
272
|
-
uid: string
|
|
272
|
+
uid: string & z.BRAND<"tag">;
|
|
273
273
|
name: string;
|
|
274
|
-
children: string[];
|
|
274
|
+
children: ((string & z.BRAND<"tag">) | (string & z.BRAND<"operation">))[];
|
|
275
275
|
description?: string | undefined;
|
|
276
276
|
externalDocs?: {
|
|
277
277
|
url: string;
|
|
@@ -296,7 +296,7 @@ export declare const tagSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
296
296
|
}[] | undefined;
|
|
297
297
|
'x-internal'?: boolean | undefined;
|
|
298
298
|
'x-scalar-ignore'?: boolean | undefined;
|
|
299
|
-
children?:
|
|
299
|
+
children?: string[] | undefined;
|
|
300
300
|
}>;
|
|
301
301
|
export type Tag = z.infer<typeof tagSchema>;
|
|
302
302
|
export type TagPayload = z.input<typeof tagSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-objects.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/spec-objects.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;IAC3B,mDAAmD;;IAEnD,2GAA2G;;IAE3G;;;OAGG;;;;;;;;;;EAEH,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;IAC3B,+DAA+D;;IAE/D,sFAAsF;;IAEtF,0GAA0G;;;;;;;;;;EAE1G,CAAA;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa;IACxB,sCAAsC;;IAEtC,kCAAkC;;IAElC,4FAA4F;;IAE5F,oFAAoF;;IAEpF,mDAAmD;;QAxBnD,+DAA+D;;QAE/D,sFAAsF;;QAEtF,0GAA0G;;;;;;;;;;;IAsB1G,mDAAmD;;QA5CnD,mDAAmD;;QAEnD,2GAA2G;;QAE3G;;;WAGG;;;;;;;;;;;IAuCH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;IAgCzF,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGvB,CAAA;AAEF,eAAO,MAAM,SAAS;IAlBpB;;;;OAIG;;IAEH,qCAAqC;;IAErC,6FAA6F;;IAE7F,sDAAsD;;QA/BtD,6GAA6G;;QAE7G,yFAAyF;;;;;;;;;;;;;;;;IAgCzF,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWvB,CAAA;AAEF,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAC3C,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import { nanoidSchema } from '../shared/utility.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* License information for the exposed API.
|
|
@@ -100,8 +100,11 @@ const oasTagSchema = z.object({
|
|
|
100
100
|
'x-scalar-ignore': z.boolean().optional(),
|
|
101
101
|
});
|
|
102
102
|
const tagSchema = oasTagSchema.extend({
|
|
103
|
-
uid: nanoidSchema,
|
|
104
|
-
children:
|
|
103
|
+
uid: nanoidSchema.brand(),
|
|
104
|
+
children: z
|
|
105
|
+
.union([z.string().brand(), z.string().brand()])
|
|
106
|
+
.array()
|
|
107
|
+
.default([]),
|
|
105
108
|
});
|
|
106
109
|
|
|
107
110
|
export { oasContactSchema, oasExternalDocumentationSchema, oasInfoSchema, oasLicenseSchema, oasTagSchema, tagSchema, xScalarNestedSchema };
|
|
@@ -3,21 +3,21 @@ export declare const xScalarSecretVarSchema: z.ZodObject<{
|
|
|
3
3
|
description: z.ZodOptional<z.ZodString>;
|
|
4
4
|
example: z.ZodOptional<z.ZodString>;
|
|
5
5
|
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
description?: string | undefined;
|
|
7
6
|
example?: string | undefined;
|
|
8
|
-
}, {
|
|
9
7
|
description?: string | undefined;
|
|
8
|
+
}, {
|
|
10
9
|
example?: string | undefined;
|
|
10
|
+
description?: string | undefined;
|
|
11
11
|
}>;
|
|
12
12
|
export declare const xScalarSecretsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
13
13
|
description: z.ZodOptional<z.ZodString>;
|
|
14
14
|
example: z.ZodOptional<z.ZodString>;
|
|
15
15
|
}, "strip", z.ZodTypeAny, {
|
|
16
|
-
description?: string | undefined;
|
|
17
16
|
example?: string | undefined;
|
|
18
|
-
}, {
|
|
19
17
|
description?: string | undefined;
|
|
18
|
+
}, {
|
|
20
19
|
example?: string | undefined;
|
|
20
|
+
description?: string | undefined;
|
|
21
21
|
}>>;
|
|
22
22
|
export type XScalarSecrets = z.infer<typeof xScalarSecretsSchema>;
|
|
23
23
|
//# sourceMappingURL=x-scalar-secrets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x-scalar-secrets.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/x-scalar-secrets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,sBAAsB;;;;;;;;;EAGjC,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;GAA+C,CAAA;
|
|
1
|
+
{"version":3,"file":"x-scalar-secrets.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/x-scalar-secrets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,sBAAsB;;;;;;;;;EAGjC,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;GAA+C,CAAA;AAChF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|
|
@@ -13,13 +13,13 @@ declare const hotKeys: z.ZodRecord<z.ZodEnum<["Space", "Backspace", "Tab", "Ente
|
|
|
13
13
|
}>>;
|
|
14
14
|
export type HotKeyConfig = z.infer<typeof hotKeys>;
|
|
15
15
|
export declare const workspaceSchema: z.ZodObject<{
|
|
16
|
-
uid: z.ZodDefault<z.ZodOptional<z.ZodString
|
|
16
|
+
uid: z.ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "workspace">;
|
|
17
17
|
name: z.ZodDefault<z.ZodString>;
|
|
18
18
|
/** Workspace description */
|
|
19
19
|
description: z.ZodDefault<z.ZodString>;
|
|
20
20
|
/** List of all collection uids in a given workspace */
|
|
21
|
-
collections: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
22
|
-
/** List of all environment uids in a given workspace */
|
|
21
|
+
collections: z.ZodDefault<z.ZodArray<z.ZodBranded<z.ZodString, "collection">, "many">>;
|
|
22
|
+
/** List of all environment uids in a given workspace, TODO: why is this a record? */
|
|
23
23
|
environments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
24
24
|
/** Customize hotkeys */
|
|
25
25
|
hotKeyConfig: z.ZodOptional<z.ZodObject<{
|
|
@@ -50,7 +50,7 @@ export declare const workspaceSchema: z.ZodObject<{
|
|
|
50
50
|
/** Active Environment ID to use for requests */
|
|
51
51
|
activeEnvironmentId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
52
52
|
/** List of all cookie uids in a given workspace */
|
|
53
|
-
cookies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
53
|
+
cookies: z.ZodDefault<z.ZodArray<z.ZodBranded<z.ZodString, "cookie">, "many">>;
|
|
54
54
|
/** Workspace level proxy for all requests to be sent through */
|
|
55
55
|
proxyUrl: z.ZodOptional<z.ZodString>;
|
|
56
56
|
/** Workspace level theme, we might move this to user level later */
|
|
@@ -67,13 +67,13 @@ export declare const workspaceSchema: z.ZodObject<{
|
|
|
67
67
|
clientKey: string;
|
|
68
68
|
}>>>;
|
|
69
69
|
}, "strip", z.ZodTypeAny, {
|
|
70
|
-
uid: string
|
|
70
|
+
uid: string & z.BRAND<"workspace">;
|
|
71
71
|
name: string;
|
|
72
72
|
description: string;
|
|
73
|
-
collections: string[];
|
|
73
|
+
collections: (string & z.BRAND<"collection">)[];
|
|
74
74
|
environments: Record<string, string>;
|
|
75
75
|
activeEnvironmentId: string;
|
|
76
|
-
cookies: string[];
|
|
76
|
+
cookies: (string & z.BRAND<"cookie">)[];
|
|
77
77
|
themeId: "default" | "alternate" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "none";
|
|
78
78
|
selectedHttpClient: {
|
|
79
79
|
targetKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../../src/entities/workspace/workspace.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AASvB,QAAA,MAAM,SAAS,yIAAoD,CAAA;AAEnE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvD,QAAA,MAAM,OAAO;;;;;;;;;GAMZ,CAAA;AACD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAA;AASlD,eAAO,MAAM,eAAe;;;IAG1B,4BAA4B;;IAE5B,uDAAuD;;IAEvD,
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../../src/entities/workspace/workspace.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AASvB,QAAA,MAAM,SAAS,yIAAoD,CAAA;AAEnE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvD,QAAA,MAAM,OAAO;;;;;;;;;GAMZ,CAAA;AACD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAA;AASlD,eAAO,MAAM,eAAe;;;IAG1B,4BAA4B;;IAE5B,uDAAuD;;IAEvD,qFAAqF;;IAErF,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;IAExB,iDAAiD;;IAEjD,mDAAmD;;IAEnD,gEAAgE;;IAEhE,oEAAoE;;IAEpE,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWxC,CAAA;AAEF,gCAAgC;AAChC,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AACvD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { themeIds } from '@scalar/themes';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { KEYDOWN_KEYS, HOTKEY_EVENT_NAMES } from '../hotkeys/hotkeys.js';
|
|
4
3
|
import { nanoidSchema } from '../shared/utility.js';
|
|
4
|
+
import { KEYDOWN_KEYS, HOTKEY_EVENT_NAMES } from '../hotkeys/hotkeys.js';
|
|
5
5
|
|
|
6
6
|
const modifier = z
|
|
7
7
|
.enum(['Meta', 'Control', 'Shift', 'Alt', 'default'])
|
|
@@ -19,20 +19,20 @@ const hotKeyConfigSchema = z
|
|
|
19
19
|
})
|
|
20
20
|
.optional();
|
|
21
21
|
const workspaceSchema = z.object({
|
|
22
|
-
uid: nanoidSchema,
|
|
22
|
+
uid: nanoidSchema.brand(),
|
|
23
23
|
name: z.string().default('Default Workspace'),
|
|
24
24
|
/** Workspace description */
|
|
25
25
|
description: z.string().default('Basic Scalar Workspace'),
|
|
26
26
|
/** List of all collection uids in a given workspace */
|
|
27
|
-
collections: z.array(z.string()).default([]),
|
|
28
|
-
/** List of all environment uids in a given workspace */
|
|
27
|
+
collections: z.array(z.string().brand()).default([]),
|
|
28
|
+
/** List of all environment uids in a given workspace, TODO: why is this a record? */
|
|
29
29
|
environments: z.record(z.string()).default({}),
|
|
30
30
|
/** Customize hotkeys */
|
|
31
31
|
hotKeyConfig: hotKeyConfigSchema,
|
|
32
32
|
/** Active Environment ID to use for requests */
|
|
33
33
|
activeEnvironmentId: z.string().optional().default('default'),
|
|
34
34
|
/** List of all cookie uids in a given workspace */
|
|
35
|
-
cookies: z.array(z.string()).default([]),
|
|
35
|
+
cookies: z.array(z.string().brand()).default([]),
|
|
36
36
|
/** Workspace level proxy for all requests to be sent through */
|
|
37
37
|
proxyUrl: z.string().optional(),
|
|
38
38
|
/** Workspace level theme, we might move this to user level later */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchSpecFromUrl.d.ts","sourceRoot":"","sources":["../../src/helpers/fetchSpecFromUrl.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wBAAsB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"fetchSpecFromUrl.d.ts","sourceRoot":"","sources":["../../src/helpers/fetchSpecFromUrl.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,UAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CA0BpG"}
|
|
@@ -13,7 +13,7 @@ const NEW_PROXY_URL = 'https://proxy.scalar.com';
|
|
|
13
13
|
async function fetchSpecFromUrl(url, proxy, beautify = true) {
|
|
14
14
|
// This replaces the OLD_PROXY_URL with the NEW_PROXY_URL on the fly.
|
|
15
15
|
if (proxy === OLD_PROXY_URL) {
|
|
16
|
-
//
|
|
16
|
+
// biome-ignore lint/style/noParameterAssign: It’s ok, let’s make an exception here.
|
|
17
17
|
proxy = NEW_PROXY_URL;
|
|
18
18
|
}
|
|
19
19
|
// To use a proxy or not to use a proxy
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json2xml.d.ts","sourceRoot":"","sources":["../../src/helpers/json2xml.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"json2xml.d.ts","sourceRoot":"","sources":["../../src/helpers/json2xml.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,UAyC/D"}
|
package/dist/helpers/json2xml.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This function converts an object to XML.
|
|
3
3
|
*/
|
|
4
4
|
function json2xml(data, tab) {
|
|
5
|
-
const toXml =
|
|
5
|
+
const toXml = (value, key, indentation) => {
|
|
6
6
|
let xml = '';
|
|
7
7
|
if (value instanceof Array) {
|
|
8
8
|
for (let i = 0, n = value.length; i < n; i++) {
|
|
@@ -28,11 +28,7 @@ function json2xml(data, tab) {
|
|
|
28
28
|
else if (m.charAt(0) != '@')
|
|
29
29
|
xml += toXml(value[m], m, indentation + '\t');
|
|
30
30
|
}
|
|
31
|
-
xml +=
|
|
32
|
-
(xml.charAt(xml.length - 1) == '\n' ? indentation : '') +
|
|
33
|
-
'</' +
|
|
34
|
-
key +
|
|
35
|
-
'>';
|
|
31
|
+
xml += (xml.charAt(xml.length - 1) == '\n' ? indentation : '') + '</' + key + '>';
|
|
36
32
|
}
|
|
37
33
|
}
|
|
38
34
|
else {
|
|
@@ -41,7 +37,7 @@ function json2xml(data, tab) {
|
|
|
41
37
|
return xml;
|
|
42
38
|
};
|
|
43
39
|
let xml = '';
|
|
44
|
-
//
|
|
40
|
+
// biome-ignore lint/nursery/useGuardForIn: Yeah, it’s ok. But feel free to fix it.
|
|
45
41
|
for (const key in data) {
|
|
46
42
|
xml += toXml(data[key], key, '');
|
|
47
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrator.d.ts","sourceRoot":"","sources":["../../src/migrations/migrator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"migrator.d.ts","sourceRoot":"","sources":["../../src/migrations/migrator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAmB,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEpE,6CAA6C;AAC7C,eAAO,MAAM,QAAQ,QAAO,OAAO,CAAC,WAAW,CA0C9C,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { v_2_4_0 } from '../../migrations/v-2.4.0/types.generated';
|
|
2
2
|
import type { v_2_5_0 } from './types.generated';
|
|
3
3
|
/** V-2.4.0 to V-2.5.0 migration */
|
|
4
|
-
export declare const migrate_v_2_5_0: (data: v_2_4_0.DataRecord) => v_2_5_0
|
|
4
|
+
export declare const migrate_v_2_5_0: (data: v_2_4_0.DataRecord) => v_2_5_0["DataRecord"];
|
|
5
5
|
//# sourceMappingURL=migration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../../src/migrations/v-2.5.0/migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAEnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../../src/migrations/v-2.5.0/migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAEnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAMhD,mCAAmC;AACnC,eAAO,MAAM,eAAe,SAAU,OAAO,CAAC,UAAU,KAAG,OAAO,CAAC,YAAY,CA4J9E,CAAA"}
|
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
/** V-2.4.0 to V-2.5.0 migration */
|
|
2
2
|
const migrate_v_2_5_0 = (data) => {
|
|
3
3
|
console.info('Performing data migration v-2.4.0 to v-2.5.0');
|
|
4
|
+
const cookies = Object.entries(data.cookies || {}).reduce((acc, [key, cookie]) => {
|
|
5
|
+
acc[key] = {
|
|
6
|
+
...cookie,
|
|
7
|
+
uid: cookie.uid,
|
|
8
|
+
};
|
|
9
|
+
return acc;
|
|
10
|
+
}, {});
|
|
11
|
+
const collections = Object.entries(data.collections || {}).reduce((acc, [key, collection]) => {
|
|
12
|
+
acc[key] = {
|
|
13
|
+
...collection,
|
|
14
|
+
uid: collection.uid,
|
|
15
|
+
selectedSecuritySchemeUids: collection.selectedSecuritySchemeUids,
|
|
16
|
+
servers: collection.servers.map((uid) => uid),
|
|
17
|
+
tags: collection.tags.map((uid) => uid),
|
|
18
|
+
requests: collection.requests.map((uid) => uid),
|
|
19
|
+
children: collection.children.map((uid) => uid),
|
|
20
|
+
selectedServerUid: collection.selectedServerUid,
|
|
21
|
+
};
|
|
22
|
+
return acc;
|
|
23
|
+
}, {});
|
|
24
|
+
const environments = Object.entries(data.environments || {}).reduce((acc, [key, environment]) => {
|
|
25
|
+
acc[key] = {
|
|
26
|
+
...environment,
|
|
27
|
+
uid: environment.uid,
|
|
28
|
+
};
|
|
29
|
+
return acc;
|
|
30
|
+
}, {});
|
|
31
|
+
const requests = Object.entries(data.requests || {}).reduce((acc, [key, request]) => {
|
|
32
|
+
acc[key] = {
|
|
33
|
+
...request,
|
|
34
|
+
uid: request.uid,
|
|
35
|
+
servers: request.servers,
|
|
36
|
+
selectedServerUid: request.selectedServerUid,
|
|
37
|
+
examples: request.examples,
|
|
38
|
+
selectedSecuritySchemeUids: request.selectedSecuritySchemeUids,
|
|
39
|
+
};
|
|
40
|
+
return acc;
|
|
41
|
+
}, {});
|
|
4
42
|
const requestExamples = Object.entries(data.requestExamples || {}).reduce((acc, [key, example]) => {
|
|
5
43
|
const headers = example.parameters.headers;
|
|
6
44
|
// Check if "Accept" header exists
|
|
@@ -12,6 +50,8 @@ const migrate_v_2_5_0 = (data) => {
|
|
|
12
50
|
// Update the example with potentially modified headers
|
|
13
51
|
acc[key] = {
|
|
14
52
|
...example,
|
|
53
|
+
uid: example.uid,
|
|
54
|
+
requestUid: example.requestUid,
|
|
15
55
|
parameters: {
|
|
16
56
|
...example.parameters,
|
|
17
57
|
headers,
|
|
@@ -19,15 +59,21 @@ const migrate_v_2_5_0 = (data) => {
|
|
|
19
59
|
};
|
|
20
60
|
return acc;
|
|
21
61
|
}, {});
|
|
62
|
+
const securitySchemes = Object.entries(data.securitySchemes || {}).reduce((acc, [key, securityScheme]) => {
|
|
63
|
+
acc[key] = {
|
|
64
|
+
...securityScheme,
|
|
65
|
+
uid: securityScheme.uid,
|
|
66
|
+
};
|
|
67
|
+
return acc;
|
|
68
|
+
}, {});
|
|
22
69
|
const servers = Object.entries(data.servers || {}).reduce((acc, [key, server]) => {
|
|
23
70
|
acc[key] = {
|
|
24
71
|
...server,
|
|
72
|
+
uid: server.uid,
|
|
25
73
|
variables: Object.entries(server.variables || {}).reduce((variablesAcc, [variableKey, variable]) => {
|
|
26
74
|
variablesAcc[variableKey] = {
|
|
27
75
|
...variable,
|
|
28
|
-
enum: variable.enum && variable.enum.length > 0
|
|
29
|
-
? variable.enum
|
|
30
|
-
: undefined,
|
|
76
|
+
enum: variable.enum && variable.enum.length > 0 ? variable.enum : undefined,
|
|
31
77
|
default: variable.default ?? '',
|
|
32
78
|
description: variable.description,
|
|
33
79
|
};
|
|
@@ -36,9 +82,20 @@ const migrate_v_2_5_0 = (data) => {
|
|
|
36
82
|
};
|
|
37
83
|
return acc;
|
|
38
84
|
}, {});
|
|
85
|
+
const tags = Object.entries(data.tags || {}).reduce((acc, [key, tag]) => {
|
|
86
|
+
acc[key] = {
|
|
87
|
+
...tag,
|
|
88
|
+
uid: tag.uid,
|
|
89
|
+
children: tag.children,
|
|
90
|
+
};
|
|
91
|
+
return acc;
|
|
92
|
+
}, {});
|
|
39
93
|
const workspaces = Object.entries(data.workspaces || {}).reduce((acc, [key, workspace]) => {
|
|
40
94
|
acc[key] = {
|
|
41
95
|
...workspace,
|
|
96
|
+
uid: workspace.uid,
|
|
97
|
+
collections: workspace.collections.map((uid) => uid),
|
|
98
|
+
cookies: workspace.cookies.map((uid) => uid),
|
|
42
99
|
selectedHttpClient: {
|
|
43
100
|
targetKey: 'shell',
|
|
44
101
|
clientKey: 'curl',
|
|
@@ -48,8 +105,14 @@ const migrate_v_2_5_0 = (data) => {
|
|
|
48
105
|
}, {});
|
|
49
106
|
return {
|
|
50
107
|
...data,
|
|
108
|
+
collections,
|
|
109
|
+
cookies,
|
|
110
|
+
environments,
|
|
111
|
+
requests,
|
|
51
112
|
requestExamples,
|
|
113
|
+
securitySchemes,
|
|
52
114
|
servers,
|
|
115
|
+
tags,
|
|
53
116
|
workspaces,
|
|
54
117
|
};
|
|
55
118
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { Cookie
|
|
2
|
-
import type { Environment
|
|
3
|
-
import type { Collection
|
|
4
|
-
import type { Workspace
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import type { Cookie } from '../../entities/cookie/index.js';
|
|
2
|
+
import type { Environment } from '../../entities/environment/index.js';
|
|
3
|
+
import type { Collection, Request, RequestExample, Server, SecurityScheme, Tag } from '../../entities/spec/index.js';
|
|
4
|
+
import type { Workspace } from '../../entities/workspace/index.js';
|
|
5
|
+
export type v_2_5_0 = {
|
|
6
|
+
Cookie: Cookie;
|
|
7
|
+
Environment: Environment;
|
|
8
|
+
Collection: Collection;
|
|
9
|
+
Request: Request;
|
|
10
|
+
RequestExample: RequestExample;
|
|
11
|
+
SecurityScheme: SecurityScheme;
|
|
12
|
+
Server: Server;
|
|
13
|
+
Tag: Tag;
|
|
14
|
+
Workspace: Workspace;
|
|
15
|
+
DataRecord: {
|
|
16
16
|
collections: Record<string, Collection>;
|
|
17
17
|
cookies: Record<string, Cookie>;
|
|
18
18
|
environments: Record<string, Environment>;
|
|
@@ -23,7 +23,7 @@ export declare namespace v_2_5_0 {
|
|
|
23
23
|
tags: Record<string, Tag>;
|
|
24
24
|
workspaces: Record<string, Workspace>;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
DataArray: {
|
|
27
27
|
collections: Collection[];
|
|
28
28
|
cookies: Cookie[];
|
|
29
29
|
environments: Environment[];
|
|
@@ -34,5 +34,5 @@ export declare namespace v_2_5_0 {
|
|
|
34
34
|
tags: Tag[];
|
|
35
35
|
workspaces: Workspace[];
|
|
36
36
|
};
|
|
37
|
-
}
|
|
37
|
+
};
|
|
38
38
|
//# sourceMappingURL=types.generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.generated.d.ts","sourceRoot":"","sources":["../../../src/migrations/v-2.5.0/types.generated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.generated.d.ts","sourceRoot":"","sources":["../../../src/migrations/v-2.5.0/types.generated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACvG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAErD,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,WAAW,CAAA;IACxB,UAAU,EAAE,UAAU,CAAA;IACt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
|
17
17
|
}>;
|
|
18
18
|
/** Converts selected security requirements to uids */
|
|
19
|
-
export declare const getSelectedSecuritySchemeUids: (securityRequirements:
|
|
19
|
+
export declare const getSelectedSecuritySchemeUids: (securityRequirements: (string | string[])[], preferredSecurityNames: (string | string[])[] | undefined, securitySchemeMap: Record<string, SecurityScheme["uid"]>) => SelectedSecuritySchemeUids;
|
|
20
20
|
export type ImportSpecToWorkspaceArgs = Pick<CollectionPayload, 'documentUrl' | 'watchMode'> & Pick<ReferenceConfiguration, 'authentication' | 'baseServerURL' | 'servers'> & {
|
|
21
21
|
/** Sets the preferred security scheme on the collection instead of the requests */
|
|
22
22
|
setCollectionSecurity?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-spec.d.ts","sourceRoot":"","sources":["../../src/transforms/import-spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAA;AAC3E,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,cAAc,EAGnB,KAAK,MAAM,EACX,KAAK,GAAG,EAMT,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAEL,KAAK,cAAc,EAGpB,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"import-spec.d.ts","sourceRoot":"","sources":["../../src/transforms/import-spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAA;AAC3E,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,cAAc,EAGnB,KAAK,MAAM,EACX,KAAK,GAAG,EAMT,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAEL,KAAK,cAAc,EAGpB,MAAM,0BAA0B,CAAA;AAMjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,sB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