@scalar/oas-utils 0.2.46 → 0.2.48
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 +22 -0
- package/dist/entities/spec/collection.d.ts +4 -0
- package/dist/entities/spec/collection.d.ts.map +1 -1
- package/dist/entities/spec/collection.js +10 -8
- package/dist/entities/spec/security.d.ts +6 -6
- package/dist/entities/spec/security.d.ts.map +1 -1
- package/dist/entities/spec/security.js +6 -1
- package/dist/migrations/local-storage.js +1 -1
- package/dist/migrations/v-2.1.0/migration.d.ts +1 -0
- package/dist/migrations/v-2.1.0/migration.d.ts.map +1 -1
- package/dist/migrations/v-2.1.0/migration.js +12 -11
- package/dist/transforms/export-spec.d.ts +1 -0
- package/dist/transforms/export-spec.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @scalar/oas-utils
|
|
2
2
|
|
|
3
|
+
## 0.2.48
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- dc20180: feat(api-client): custom icons for collections
|
|
8
|
+
- Updated dependencies [f961940]
|
|
9
|
+
- Updated dependencies [f961940]
|
|
10
|
+
- @scalar/types@0.0.11
|
|
11
|
+
- @scalar/themes@0.9.32
|
|
12
|
+
|
|
13
|
+
## 0.2.47
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 2b8ce6c: feat: adds safe-parsing to the end of the migration
|
|
18
|
+
- 9aa4562: fix: lowerCase http auth schemes before validation
|
|
19
|
+
- Updated dependencies [2b8ce6c]
|
|
20
|
+
- Updated dependencies [7beeef3]
|
|
21
|
+
- @scalar/object-utils@1.1.9
|
|
22
|
+
- @scalar/themes@0.9.31
|
|
23
|
+
- @scalar/types@0.0.10
|
|
24
|
+
|
|
3
25
|
## 0.2.46
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -260,6 +260,8 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
260
260
|
components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
261
261
|
/** TODO: Type these */
|
|
262
262
|
webhooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
263
|
+
/** A custom icon representing the collection */
|
|
264
|
+
'x-scalar-icon': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
263
265
|
}, {
|
|
264
266
|
uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
265
267
|
/** A list of security schemes UIDs associated with the collection */
|
|
@@ -365,6 +367,7 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
365
367
|
children: string[];
|
|
366
368
|
openapi: string;
|
|
367
369
|
security: Record<string, string[]>[];
|
|
370
|
+
'x-scalar-icon': string;
|
|
368
371
|
securitySchemes: string[];
|
|
369
372
|
selectedServerUid: string;
|
|
370
373
|
servers: string[];
|
|
@@ -451,6 +454,7 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
451
454
|
security?: Record<string, string[] | undefined>[] | undefined;
|
|
452
455
|
components?: Record<string, unknown> | undefined;
|
|
453
456
|
webhooks?: Record<string, unknown> | undefined;
|
|
457
|
+
'x-scalar-icon'?: string | undefined;
|
|
454
458
|
securitySchemes?: string[] | undefined;
|
|
455
459
|
selectedServerUid?: string | undefined;
|
|
456
460
|
servers?: (string | undefined)[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/collection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/collection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAyCvB,eAAO,MAAM,wBAAwB;;IAEnC,qEAAqE;;IAErE,oCAAoC;;IAEpC,wDAAwD;;IAExD,gDAAgD;;IAEhD,8CAA8C;;IAE9C,gEAAgE;;IAEhE;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA9C3B;;;;;;OAMG;;;;;;;;;;;;IAGH,uBAAuB;;IAEvB,uBAAuB;;IAEvB,gDAAgD;;;;IAYhD,qEAAqE;;IAErE,oCAAoC;;IAEpC,wDAAwD;;IAExD,gDAAgD;;IAEhD,8CAA8C;;IAE9C,gEAAgE;;IAEhE;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMJ,CAAA;AACD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA"}
|
|
@@ -4,8 +4,8 @@ import { oasInfoSchema, oasExternalDocumentationSchema } from './spec-objects.js
|
|
|
4
4
|
import { nanoidSchema } from '../shared/utility.js';
|
|
5
5
|
|
|
6
6
|
const oasCollectionSchema = z.object({
|
|
7
|
-
type: z.literal('collection').optional().default('collection'),
|
|
8
|
-
openapi: z
|
|
7
|
+
'type': z.literal('collection').optional().default('collection'),
|
|
8
|
+
'openapi': z
|
|
9
9
|
.union([
|
|
10
10
|
z.string(),
|
|
11
11
|
z.literal('3.0.0'),
|
|
@@ -14,8 +14,8 @@ const oasCollectionSchema = z.object({
|
|
|
14
14
|
])
|
|
15
15
|
.optional()
|
|
16
16
|
.default('3.1.0'),
|
|
17
|
-
jsonSchemaDialect: z.string().optional(),
|
|
18
|
-
info: oasInfoSchema.optional(),
|
|
17
|
+
'jsonSchemaDialect': z.string().optional(),
|
|
18
|
+
'info': oasInfoSchema.optional(),
|
|
19
19
|
/**
|
|
20
20
|
* A declaration of which security mechanisms can be used across the API. The list of
|
|
21
21
|
* values includes alternative security requirement objects that can be used. Only
|
|
@@ -23,12 +23,14 @@ const oasCollectionSchema = z.object({
|
|
|
23
23
|
* Individual operations can override this definition. To make security optional, an empty
|
|
24
24
|
* security requirement ({}) can be included in the array.
|
|
25
25
|
*/
|
|
26
|
-
security: z.array(oasSecurityRequirementSchema).optional().default([]),
|
|
27
|
-
externalDocs: oasExternalDocumentationSchema.optional(),
|
|
26
|
+
'security': z.array(oasSecurityRequirementSchema).optional().default([]),
|
|
27
|
+
'externalDocs': oasExternalDocumentationSchema.optional(),
|
|
28
28
|
/** TODO: Type these */
|
|
29
|
-
components: z.record(z.string(), z.unknown()).optional(),
|
|
29
|
+
'components': z.record(z.string(), z.unknown()).optional(),
|
|
30
30
|
/** TODO: Type these */
|
|
31
|
-
webhooks: z.record(z.string(), z.unknown()).optional(),
|
|
31
|
+
'webhooks': z.record(z.string(), z.unknown()).optional(),
|
|
32
|
+
/** A custom icon representing the collection */
|
|
33
|
+
'x-scalar-icon': z.string().optional().default('interface-content-folder'),
|
|
32
34
|
// These properties will be stripped out and mapped back as id lists
|
|
33
35
|
// servers
|
|
34
36
|
// paths/**
|
|
@@ -156,7 +156,7 @@ export declare const securityHttpSchema: z.ZodObject<z.objectUtil.extendShape<z.
|
|
|
156
156
|
* REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in
|
|
157
157
|
* [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry.
|
|
158
158
|
*/
|
|
159
|
-
scheme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["basic", "bearer"]
|
|
159
|
+
scheme: z.ZodDefault<z.ZodOptional<z.ZodPipeline<z.ZodString, z.ZodEnum<["basic", "bearer"]>>>>;
|
|
160
160
|
/**
|
|
161
161
|
* A hint to the client to identify how the bearer token is formatted.
|
|
162
162
|
* Bearer tokens are usually generated by an authorization server, so
|
|
@@ -179,7 +179,7 @@ export declare const securityHttpSchema: z.ZodObject<z.objectUtil.extendShape<z.
|
|
|
179
179
|
uid?: string | undefined;
|
|
180
180
|
description?: string | undefined;
|
|
181
181
|
nameKey?: string | undefined;
|
|
182
|
-
scheme?:
|
|
182
|
+
scheme?: string | undefined;
|
|
183
183
|
bearerFormat?: string | undefined;
|
|
184
184
|
}>;
|
|
185
185
|
export type SecuritySchemaHttp = z.infer<typeof securityHttpSchema>;
|
|
@@ -447,7 +447,7 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
447
447
|
* REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in
|
|
448
448
|
* [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry.
|
|
449
449
|
*/
|
|
450
|
-
scheme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["basic", "bearer"]
|
|
450
|
+
scheme: z.ZodDefault<z.ZodOptional<z.ZodPipeline<z.ZodString, z.ZodEnum<["basic", "bearer"]>>>>;
|
|
451
451
|
/**
|
|
452
452
|
* A hint to the client to identify how the bearer token is formatted.
|
|
453
453
|
* Bearer tokens are usually generated by an authorization server, so
|
|
@@ -462,7 +462,7 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
462
462
|
}, {
|
|
463
463
|
type: "http";
|
|
464
464
|
description?: string | undefined;
|
|
465
|
-
scheme?:
|
|
465
|
+
scheme?: string | undefined;
|
|
466
466
|
bearerFormat?: string | undefined;
|
|
467
467
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
468
468
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -706,7 +706,7 @@ export declare const securitySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.
|
|
|
706
706
|
* REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in
|
|
707
707
|
* [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry.
|
|
708
708
|
*/
|
|
709
|
-
scheme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["basic", "bearer"]
|
|
709
|
+
scheme: z.ZodDefault<z.ZodOptional<z.ZodPipeline<z.ZodString, z.ZodEnum<["basic", "bearer"]>>>>;
|
|
710
710
|
/**
|
|
711
711
|
* A hint to the client to identify how the bearer token is formatted.
|
|
712
712
|
* Bearer tokens are usually generated by an authorization server, so
|
|
@@ -729,7 +729,7 @@ export declare const securitySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.
|
|
|
729
729
|
uid?: string | undefined;
|
|
730
730
|
description?: string | undefined;
|
|
731
731
|
nameKey?: string | undefined;
|
|
732
|
-
scheme?:
|
|
732
|
+
scheme?: string | undefined;
|
|
733
733
|
bearerFormat?: string | undefined;
|
|
734
734
|
}>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
735
735
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/security.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA6CvB;;;GAGG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AO,oBAAoB,CAAC,CAAA"}
|
|
@@ -100,7 +100,12 @@ const oasSecuritySchemeHttp = commonProps.extend({
|
|
|
100
100
|
* REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in
|
|
101
101
|
* [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry.
|
|
102
102
|
*/
|
|
103
|
-
scheme: z
|
|
103
|
+
scheme: z
|
|
104
|
+
.string()
|
|
105
|
+
.toLowerCase()
|
|
106
|
+
.pipe(z.enum(['basic', 'bearer']))
|
|
107
|
+
.optional()
|
|
108
|
+
.default('basic'),
|
|
104
109
|
/**
|
|
105
110
|
* A hint to the client to identify how the bearer token is formatted.
|
|
106
111
|
* Bearer tokens are usually generated by an authorization server, so
|
|
@@ -19,7 +19,7 @@ const getLocalStorageVersion = () => {
|
|
|
19
19
|
// Flatted + types means 2.1.0
|
|
20
20
|
try {
|
|
21
21
|
const [collection] = Object.values(parse(collectionStr) ?? {});
|
|
22
|
-
if (collection
|
|
22
|
+
if (collection?.type === 'collection')
|
|
23
23
|
return '2.1.0';
|
|
24
24
|
if (dataVersion)
|
|
25
25
|
return dataVersion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../../src/migrations/v-2.1.0/migration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAInE,mCAAmC;AACnC,eAAO,MAAM,eAAe,SAAU,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;;;;;;;;;;oBAG/C,CAAC;mBAIjB,CADJ;qBAA4C,CAAC;;;;0BAKlC,CAAC;mBACR,CAAA
|
|
1
|
+
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../../src/migrations/v-2.1.0/migration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAInE,mCAAmC;AACnC,eAAO,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAuI2jB,CAAC;;6BAA4E,CAAC;;;;;;;;;;CADrpB,CAAA"}
|
|
@@ -103,19 +103,20 @@ const migrate_v_2_1_0 = (data) => {
|
|
|
103
103
|
return prev;
|
|
104
104
|
}, {});
|
|
105
105
|
return {
|
|
106
|
-
type: 'collection',
|
|
107
|
-
openapi: c.spec?.openapi || '3.1.0',
|
|
108
|
-
info: c.spec?.info || { title: 'OpenAPI Spec', version: '0.0.1' },
|
|
109
|
-
security: c.spec?.security || [],
|
|
110
|
-
externalDocs: c.spec?.externalDocs,
|
|
111
|
-
uid: c.uid,
|
|
106
|
+
'type': 'collection',
|
|
107
|
+
'openapi': c.spec?.openapi || '3.1.0',
|
|
108
|
+
'info': c.spec?.info || { title: 'OpenAPI Spec', version: '0.0.1' },
|
|
109
|
+
'security': c.spec?.security || [],
|
|
110
|
+
'externalDocs': c.spec?.externalDocs,
|
|
111
|
+
'uid': c.uid,
|
|
112
112
|
securitySchemes,
|
|
113
|
-
selectedServerUid: c.selectedServerUid || c.spec?.serverUids?.[0] || '',
|
|
114
|
-
servers: c.spec?.serverUids || [],
|
|
115
|
-
requests: [...requestUids],
|
|
116
|
-
tags: [...tagUids],
|
|
113
|
+
'selectedServerUid': c.selectedServerUid || c.spec?.serverUids?.[0] || '',
|
|
114
|
+
'servers': c.spec?.serverUids || [],
|
|
115
|
+
'requests': [...requestUids],
|
|
116
|
+
'tags': [...tagUids],
|
|
117
117
|
auth,
|
|
118
|
-
children: c.childUids || [],
|
|
118
|
+
'children': c.childUids || [],
|
|
119
|
+
'x-scalar-icon': 'interface-content-folder',
|
|
119
120
|
};
|
|
120
121
|
});
|
|
121
122
|
// Cookies
|
|
@@ -8,6 +8,7 @@ export declare function exportSpecFromWorkspace({ collection, requests, }: {
|
|
|
8
8
|
children: string[];
|
|
9
9
|
openapi: string;
|
|
10
10
|
security: Record<string, string[]>[];
|
|
11
|
+
'x-scalar-icon': string;
|
|
11
12
|
securitySchemes: string[];
|
|
12
13
|
selectedServerUid: string;
|
|
13
14
|
servers: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-spec.d.ts","sourceRoot":"","sources":["../../src/transforms/export-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,OAAO,EAEb,MAAM,iBAAiB,CAAA;AAMxB,wBAAgB,uBAAuB,CAAC,EACtC,UAAU,EACV,QAAQ,GACT,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC
|
|
1
|
+
{"version":3,"file":"export-spec.d.ts","sourceRoot":"","sources":["../../src/transforms/export-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,OAAO,EAEb,MAAM,iBAAiB,CAAA;AAMxB,wBAAgB,uBAAuB,CAAC,EACtC,UAAU,EACV,QAAQ,GACT,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA"}
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"specification",
|
|
17
17
|
"yaml"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.2.
|
|
19
|
+
"version": "0.2.48",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -92,10 +92,10 @@
|
|
|
92
92
|
"nanoid": "^5.0.7",
|
|
93
93
|
"yaml": "^2.4.5",
|
|
94
94
|
"zod": "^3.23.8",
|
|
95
|
-
"@scalar/object-utils": "1.1.
|
|
95
|
+
"@scalar/object-utils": "1.1.9",
|
|
96
96
|
"@scalar/openapi-types": "0.1.1",
|
|
97
|
-
"@scalar/
|
|
98
|
-
"@scalar/
|
|
97
|
+
"@scalar/themes": "0.9.32",
|
|
98
|
+
"@scalar/types": "0.0.11"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"rollup": "^4.16.4",
|
|
@@ -103,8 +103,8 @@
|
|
|
103
103
|
"vite": "^5.2.10",
|
|
104
104
|
"vitest": "^1.6.0",
|
|
105
105
|
"zod-to-ts": "^1.2.0",
|
|
106
|
-
"@scalar/openapi-parser": "0.8.3",
|
|
107
106
|
"@scalar/build-tooling": "0.1.10",
|
|
107
|
+
"@scalar/openapi-parser": "0.8.4",
|
|
108
108
|
"@scalar/openapi-types": "0.1.1"
|
|
109
109
|
},
|
|
110
110
|
"scripts": {
|