@scalar/oas-utils 0.2.140 → 0.2.141
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 +12 -0
- package/dist/entities/cookie/cookie.js +14 -13
- package/dist/entities/cookie/cookie.js.map +7 -0
- package/dist/entities/cookie/index.d.ts +1 -1
- package/dist/entities/cookie/index.d.ts.map +1 -1
- package/dist/entities/cookie/index.js +5 -1
- package/dist/entities/cookie/index.js.map +7 -0
- package/dist/entities/environment/environment.js +10 -9
- package/dist/entities/environment/environment.js.map +7 -0
- package/dist/entities/environment/index.d.ts +1 -1
- package/dist/entities/environment/index.d.ts.map +1 -1
- package/dist/entities/environment/index.js +5 -1
- package/dist/entities/environment/index.js.map +7 -0
- package/dist/entities/hotkeys/hotkeys.js +109 -116
- package/dist/entities/hotkeys/hotkeys.js.map +7 -0
- package/dist/entities/hotkeys/index.d.ts +1 -1
- package/dist/entities/hotkeys/index.d.ts.map +1 -1
- package/dist/entities/hotkeys/index.js +6 -1
- package/dist/entities/hotkeys/index.js.map +7 -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 +7 -1
- package/dist/entities/shared/index.js.map +7 -0
- package/dist/entities/shared/utility.js +9 -12
- package/dist/entities/shared/utility.js.map +7 -0
- package/dist/entities/spec/collection.d.ts.map +1 -1
- package/dist/entities/spec/collection.js +91 -94
- package/dist/entities/spec/collection.js.map +7 -0
- package/dist/entities/spec/index.d.ts +8 -8
- package/dist/entities/spec/index.d.ts.map +1 -1
- package/dist/entities/spec/index.js +59 -9
- package/dist/entities/spec/index.js.map +7 -0
- package/dist/entities/spec/operation.d.ts +1 -1
- package/dist/entities/spec/operation.d.ts.map +1 -1
- package/dist/entities/spec/operation.js +5 -8
- package/dist/entities/spec/operation.js.map +7 -0
- package/dist/entities/spec/operation.test.js +43 -0
- package/dist/entities/spec/operation.test.js.map +7 -0
- package/dist/entities/spec/parameters.d.ts +1 -1
- package/dist/entities/spec/parameters.d.ts.map +1 -1
- package/dist/entities/spec/parameters.js +40 -38
- package/dist/entities/spec/parameters.js.map +7 -0
- package/dist/entities/spec/parameters.test.js +71 -0
- package/dist/entities/spec/parameters.test.js.map +7 -0
- package/dist/entities/spec/request-example.test.js +637 -0
- package/dist/entities/spec/request-example.test.js.map +7 -0
- package/dist/entities/spec/request-examples.d.ts +3 -3
- package/dist/entities/spec/request-examples.d.ts.map +1 -1
- package/dist/entities/spec/request-examples.js +323 -338
- package/dist/entities/spec/request-examples.js.map +7 -0
- package/dist/entities/spec/requests.d.ts +6 -8
- package/dist/entities/spec/requests.d.ts.map +1 -1
- package/dist/entities/spec/requests.js +80 -101
- package/dist/entities/spec/requests.js.map +7 -0
- package/dist/entities/spec/server.js +47 -63
- package/dist/entities/spec/server.js.map +7 -0
- package/dist/entities/spec/server.test.js +120 -0
- package/dist/entities/spec/server.test.js.map +7 -0
- package/dist/entities/spec/spec-objects.d.ts.map +1 -1
- package/dist/entities/spec/spec-objects.js +77 -121
- package/dist/entities/spec/spec-objects.js.map +7 -0
- package/dist/entities/spec/spec-objects.test.js +205 -0
- package/dist/entities/spec/spec-objects.test.js.map +7 -0
- package/dist/entities/spec/x-scalar-environments.js +21 -18
- package/dist/entities/spec/x-scalar-environments.js.map +7 -0
- package/dist/entities/spec/x-scalar-environments.test.js +11 -0
- package/dist/entities/spec/x-scalar-environments.test.js.map +7 -0
- package/dist/entities/spec/x-scalar-secrets.js +8 -6
- package/dist/entities/spec/x-scalar-secrets.js.map +7 -0
- package/dist/entities/spec/x-scalar-secrets.test.js +11 -0
- package/dist/entities/spec/x-scalar-secrets.test.js.map +7 -0
- package/dist/entities/workspace/index.d.ts +1 -1
- package/dist/entities/workspace/index.d.ts.map +1 -1
- package/dist/entities/workspace/index.js +7 -1
- package/dist/entities/workspace/index.js.map +7 -0
- package/dist/entities/workspace/workspace.js +46 -50
- package/dist/entities/workspace/workspace.js.map +7 -0
- package/dist/helpers/create-hash.js +15 -18
- package/dist/helpers/create-hash.js.map +7 -0
- package/dist/helpers/ensure-protocol.js +9 -10
- package/dist/helpers/ensure-protocol.js.map +7 -0
- package/dist/helpers/ensure-protocol.test.js +70 -0
- package/dist/helpers/ensure-protocol.test.js.map +7 -0
- package/dist/helpers/fetch-document.js +24 -32
- package/dist/helpers/fetch-document.js.map +7 -0
- package/dist/helpers/fetch-document.test.js +63 -0
- package/dist/helpers/fetch-document.test.js.map +7 -0
- package/dist/helpers/fetch-with-proxy-fallback.js +20 -28
- package/dist/helpers/fetch-with-proxy-fallback.js.map +7 -0
- package/dist/helpers/find-variables.d.ts +1 -1
- package/dist/helpers/find-variables.d.ts.map +1 -1
- package/dist/helpers/find-variables.js +6 -8
- package/dist/helpers/find-variables.js.map +7 -0
- package/dist/helpers/find-variables.test.js +20 -0
- package/dist/helpers/find-variables.test.js.map +7 -0
- package/dist/helpers/http-methods.d.ts +1 -1
- package/dist/helpers/http-methods.d.ts.map +1 -1
- package/dist/helpers/http-methods.js +60 -66
- package/dist/helpers/http-methods.js.map +7 -0
- package/dist/helpers/http-status-codes.js +319 -317
- package/dist/helpers/http-status-codes.js.map +7 -0
- package/dist/helpers/index.d.ts +27 -27
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +73 -27
- package/dist/helpers/index.js.map +7 -0
- package/dist/helpers/is-defined.js +5 -14
- package/dist/helpers/is-defined.js.map +7 -0
- package/dist/helpers/is-defined.test.js +37 -0
- package/dist/helpers/is-defined.test.js.map +7 -0
- package/dist/helpers/is-local-url.js +11 -16
- package/dist/helpers/is-local-url.js.map +7 -0
- package/dist/helpers/is-local-url.test.js +40 -0
- package/dist/helpers/is-local-url.test.js.map +7 -0
- package/dist/helpers/is-valid-url.js +9 -18
- package/dist/helpers/is-valid-url.js.map +7 -0
- package/dist/helpers/is-valid-url.test.js +17 -0
- package/dist/helpers/is-valid-url.test.js.map +7 -0
- package/dist/helpers/iterate-title.js +11 -15
- package/dist/helpers/iterate-title.js.map +7 -0
- package/dist/helpers/json2xml.js +40 -47
- package/dist/helpers/json2xml.js.map +7 -0
- package/dist/helpers/json2xml.test.js +19 -0
- package/dist/helpers/json2xml.test.js.map +7 -0
- package/dist/helpers/local-storage.js +13 -15
- package/dist/helpers/local-storage.js.map +7 -0
- package/dist/helpers/make-url-absolute.js +11 -17
- package/dist/helpers/make-url-absolute.js.map +7 -0
- package/dist/helpers/make-url-absolute.test.js +61 -0
- package/dist/helpers/make-url-absolute.test.js.map +7 -0
- package/dist/helpers/merge-urls.js +50 -75
- package/dist/helpers/merge-urls.js.map +7 -0
- package/dist/helpers/merge-urls.test.js +339 -0
- package/dist/helpers/merge-urls.test.js.map +7 -0
- package/dist/helpers/normalize-mime-type-object.js +21 -31
- package/dist/helpers/normalize-mime-type-object.js.map +7 -0
- package/dist/helpers/normalize-mime-type-object.test.js +53 -0
- package/dist/helpers/normalize-mime-type-object.test.js.map +7 -0
- package/dist/helpers/normalize-mime-type.js +8 -18
- package/dist/helpers/normalize-mime-type.js.map +7 -0
- package/dist/helpers/normalize-mime-type.test.js +33 -0
- package/dist/helpers/normalize-mime-type.test.js.map +7 -0
- package/dist/helpers/object.js +12 -18
- package/dist/helpers/object.js.map +7 -0
- package/dist/helpers/omit-undefined-values.js +17 -19
- package/dist/helpers/omit-undefined-values.js.map +7 -0
- package/dist/helpers/omit-undefined-values.test.js +89 -0
- package/dist/helpers/omit-undefined-values.test.js.map +7 -0
- package/dist/helpers/parse.js +71 -83
- package/dist/helpers/parse.js.map +7 -0
- package/dist/helpers/parse.test.js +45 -0
- package/dist/helpers/parse.test.js.map +7 -0
- package/dist/helpers/pretty-print-json.js +31 -35
- package/dist/helpers/pretty-print-json.js.map +7 -0
- package/dist/helpers/pretty-print-json.test.js +28 -0
- package/dist/helpers/pretty-print-json.test.js.map +7 -0
- package/dist/helpers/redirect-to-proxy.js +46 -83
- package/dist/helpers/redirect-to-proxy.js.map +7 -0
- package/dist/helpers/redirect-to-proxy.test.js +54 -0
- package/dist/helpers/redirect-to-proxy.test.js.map +7 -0
- package/dist/helpers/regex-helpers.js +11 -9
- package/dist/helpers/regex-helpers.js.map +7 -0
- package/dist/helpers/regex-helpers.test.js +154 -0
- package/dist/helpers/regex-helpers.test.js.map +7 -0
- package/dist/helpers/replace-variables.js +13 -16
- package/dist/helpers/replace-variables.js.map +7 -0
- package/dist/helpers/replace-variables.test.js +30 -0
- package/dist/helpers/replace-variables.test.js.map +7 -0
- package/dist/helpers/schema-model.js +15 -14
- package/dist/helpers/schema-model.js.map +7 -0
- package/dist/helpers/security/get-schemes.d.ts +1 -1
- package/dist/helpers/security/get-schemes.d.ts.map +1 -1
- package/dist/helpers/security/get-schemes.js +7 -9
- package/dist/helpers/security/get-schemes.js.map +7 -0
- package/dist/helpers/security/get-schemes.test.js +71 -0
- package/dist/helpers/security/get-schemes.test.js.map +7 -0
- package/dist/helpers/security/has-token.js +18 -19
- package/dist/helpers/security/has-token.js.map +7 -0
- package/dist/helpers/security/has-token.test.js +157 -0
- package/dist/helpers/security/has-token.test.js.map +7 -0
- package/dist/helpers/security/index.d.ts +2 -2
- package/dist/helpers/security/index.d.ts.map +1 -1
- package/dist/helpers/security/index.js +7 -2
- package/dist/helpers/security/index.js.map +7 -0
- package/dist/helpers/should-ignore-entity.d.ts +2 -2
- package/dist/helpers/should-ignore-entity.d.ts.map +1 -1
- package/dist/helpers/should-ignore-entity.js +5 -6
- package/dist/helpers/should-ignore-entity.js.map +7 -0
- package/dist/helpers/ssr-state.js +6 -6
- package/dist/helpers/ssr-state.js.map +7 -0
- package/dist/helpers/string.js +6 -18
- package/dist/helpers/string.js.map +7 -0
- package/dist/migrations/data-version.js +7 -17
- package/dist/migrations/data-version.js.map +7 -0
- package/dist/migrations/generate-types.js +56 -0
- package/dist/migrations/generate-types.js.map +7 -0
- package/dist/migrations/index.d.ts +3 -3
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +10 -3
- package/dist/migrations/index.js.map +7 -0
- package/dist/migrations/local-storage.d.ts +1 -1
- package/dist/migrations/local-storage.d.ts.map +1 -1
- package/dist/migrations/local-storage.js +27 -32
- package/dist/migrations/local-storage.js.map +7 -0
- package/dist/migrations/migrator.d.ts +1 -1
- package/dist/migrations/migrator.d.ts.map +1 -1
- package/dist/migrations/migrator.js +51 -58
- package/dist/migrations/migrator.js.map +7 -0
- package/dist/migrations/semver.js +23 -25
- package/dist/migrations/semver.js.map +7 -0
- package/dist/migrations/semver.test.js +21 -0
- package/dist/migrations/semver.test.js.map +7 -0
- package/dist/migrations/v-0.0.0/types.generated.js +1 -0
- package/dist/migrations/v-0.0.0/types.generated.js.map +7 -0
- package/dist/migrations/v-2.1.0/migration.d.ts +2 -2
- package/dist/migrations/v-2.1.0/migration.d.ts.map +1 -1
- package/dist/migrations/v-2.1.0/migration.js +256 -273
- package/dist/migrations/v-2.1.0/migration.js.map +7 -0
- package/dist/migrations/v-2.1.0/types.generated.js +1 -0
- package/dist/migrations/v-2.1.0/types.generated.js.map +7 -0
- package/dist/migrations/v-2.2.0/migration.d.ts +2 -2
- package/dist/migrations/v-2.2.0/migration.d.ts.map +1 -1
- package/dist/migrations/v-2.2.0/migration.js +95 -100
- package/dist/migrations/v-2.2.0/migration.js.map +7 -0
- package/dist/migrations/v-2.2.0/types.generated.js +1 -0
- package/dist/migrations/v-2.2.0/types.generated.js.map +7 -0
- package/dist/migrations/v-2.3.0/migration.d.ts +2 -2
- package/dist/migrations/v-2.3.0/migration.d.ts.map +1 -1
- package/dist/migrations/v-2.3.0/migration.js +47 -46
- package/dist/migrations/v-2.3.0/migration.js.map +7 -0
- package/dist/migrations/v-2.3.0/types.generated.js +1 -0
- package/dist/migrations/v-2.3.0/types.generated.js.map +7 -0
- package/dist/migrations/v-2.4.0/migration.d.ts +2 -2
- package/dist/migrations/v-2.4.0/migration.d.ts.map +1 -1
- package/dist/migrations/v-2.4.0/migration.js +24 -26
- package/dist/migrations/v-2.4.0/migration.js.map +7 -0
- package/dist/migrations/v-2.4.0/migration.test.js +90 -0
- package/dist/migrations/v-2.4.0/migration.test.js.map +7 -0
- package/dist/migrations/v-2.4.0/types.generated.js +1 -0
- package/dist/migrations/v-2.4.0/types.generated.js.map +7 -0
- package/dist/migrations/v-2.5.0/migration.d.ts +2 -2
- package/dist/migrations/v-2.5.0/migration.d.ts.map +1 -1
- package/dist/migrations/v-2.5.0/migration.js +135 -119
- package/dist/migrations/v-2.5.0/migration.js.map +7 -0
- package/dist/migrations/v-2.5.0/migration.test.js +108 -0
- package/dist/migrations/v-2.5.0/migration.test.js.map +7 -0
- package/dist/migrations/v-2.5.0/types.generated.d.ts +8 -8
- package/dist/migrations/v-2.5.0/types.generated.d.ts.map +1 -1
- package/dist/migrations/v-2.5.0/types.generated.js +1 -0
- package/dist/migrations/v-2.5.0/types.generated.js.map +7 -0
- package/dist/spec-getters/get-example-from-schema.js +206 -268
- package/dist/spec-getters/get-example-from-schema.js.map +7 -0
- package/dist/spec-getters/get-example-from-schema.test.js +1092 -0
- package/dist/spec-getters/get-example-from-schema.test.js.map +7 -0
- package/dist/spec-getters/get-parameters-from-operation.js +22 -42
- package/dist/spec-getters/get-parameters-from-operation.js.map +7 -0
- package/dist/spec-getters/get-parameters-from-operation.test.js +178 -0
- package/dist/spec-getters/get-parameters-from-operation.test.js.map +7 -0
- package/dist/spec-getters/get-request-body-from-operation.js +110 -162
- package/dist/spec-getters/get-request-body-from-operation.js.map +7 -0
- package/dist/spec-getters/get-request-body-from-operation.test.js +289 -0
- package/dist/spec-getters/get-request-body-from-operation.test.js.map +7 -0
- package/dist/spec-getters/get-server-variable-examples.d.ts +1 -1
- package/dist/spec-getters/get-server-variable-examples.d.ts.map +1 -1
- package/dist/spec-getters/get-server-variable-examples.js +12 -11
- package/dist/spec-getters/get-server-variable-examples.js.map +7 -0
- package/dist/spec-getters/index.d.ts +4 -4
- package/dist/spec-getters/index.d.ts.map +1 -1
- package/dist/spec-getters/index.js +11 -4
- package/dist/spec-getters/index.js.map +7 -0
- package/dist/transforms/import-spec.d.ts +6 -6
- package/dist/transforms/import-spec.d.ts.map +1 -1
- package/dist/transforms/import-spec.js +313 -425
- package/dist/transforms/import-spec.js.map +7 -0
- package/dist/transforms/import-spec.test.js +1124 -0
- package/dist/transforms/import-spec.test.js.map +7 -0
- package/dist/transforms/index.d.ts +1 -1
- package/dist/transforms/index.d.ts.map +1 -1
- package/dist/transforms/index.js +7 -1
- package/dist/transforms/index.js.map +7 -0
- package/package.json +9 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-objects.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/spec-objects.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;IAEzB,mDAAmD;;IAEnD,2GAA2G;;IAE3G;;OAEG;;;;;;;;;;;;;;;;;;EAG0B,CAAA;AAEjC;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;IAEzB,+DAA+D;;IAE/D,sFAAsF;;IAEtF,0GAA0G;;;;;;;;;;;;;;;;;;EAG7E,CAAA;AAEjC;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;IAEtB,sCAAsC;;IAEtC,kCAAkC;;IAElC,4FAA4F;;IAE5F,oFAAoF;;IAEpF,mDAAmD;;QA3BnD,+DAA+D;;QAE/D,sFAAsF;;QAEtF,0GAA0G;;;;;;;;;;;;;;;;;;;IAyB1G,mDAAmD;;QAjDnD,mDAAmD;;QAEnD,2GAA2G;;QAE3G;;WAEG;;;;;;;;;;;;;;;;;;;IA6CH;;;OAGG;;;
|
|
1
|
+
{"version":3,"file":"spec-objects.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/spec-objects.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;IAEzB,mDAA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6G;;QAE7G,yFAAyF;;;;;;;;;;;;;;;;;;;;;;IAkC3F,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGvB,CAAA;AAEF,eAAO,MAAM,SAAS;IAhBpB;;OAEG;;IAEH,qCAAqC;;IAErC,6FAA6F;;IAE7F,sDAAsD;;QAjCpD,6GAA6G;;QAE7G,yFAAyF;;;;;;;;;;;;;;;;;;;;;;IAkC3F,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,125 +1,81 @@
|
|
|
1
|
-
import { omitUndefinedValues } from
|
|
2
|
-
import { XScalarSdkInstallationSchema } from
|
|
3
|
-
import { nanoidSchema } from
|
|
4
|
-
import { z } from
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
.object({
|
|
52
|
-
/** REQUIRED. The title of the API. */
|
|
53
|
-
title: z.string().catch('API'),
|
|
54
|
-
/** A short summary of the API. */
|
|
55
|
-
summary: z.string().optional().catch(undefined),
|
|
56
|
-
/** A description of the API. CommonMark syntax MAY be used for rich text representation. */
|
|
57
|
-
description: z.string().optional().catch(undefined),
|
|
58
|
-
/** A URL to the Terms of Service for the API. This MUST be in the form of a URL. */
|
|
59
|
-
termsOfService: z.string().url().optional().catch(undefined),
|
|
60
|
-
/** The contact information for the exposed API. */
|
|
61
|
-
contact: oasContactSchema.optional().catch(undefined),
|
|
62
|
-
/** The license information for the exposed API. */
|
|
63
|
-
license: oasLicenseSchema.optional().catch(undefined),
|
|
64
|
-
/**
|
|
65
|
-
* REQUIRED. The version of the OpenAPI Document (which is distinct from the OpenAPI Specification version or the
|
|
66
|
-
* version of the API being described or the version of the OpenAPI Description).
|
|
67
|
-
*/
|
|
68
|
-
version: z.string().catch('1.0'),
|
|
69
|
-
})
|
|
70
|
-
.merge(XScalarSdkInstallationSchema)
|
|
71
|
-
.transform(omitUndefinedValues);
|
|
72
|
-
/**
|
|
73
|
-
* External Documentation Object
|
|
74
|
-
*
|
|
75
|
-
* Allows referencing an external resource for extended documentation.
|
|
76
|
-
*
|
|
77
|
-
* @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#external-documentation-object
|
|
78
|
-
*/
|
|
79
|
-
const oasExternalDocumentationSchema = z
|
|
80
|
-
.object({
|
|
81
|
-
/** A description of the target documentation. CommonMark syntax MAY be used for rich text representation. */
|
|
82
|
-
description: z.string().optional().catch(undefined),
|
|
83
|
-
/** REQUIRED. The URL for the target documentation. This MUST be in the form of a URL. */
|
|
84
|
-
url: z.string(),
|
|
85
|
-
})
|
|
86
|
-
.transform(omitUndefinedValues);
|
|
87
|
-
const xScalarNestedSchema = z
|
|
88
|
-
.object({
|
|
89
|
-
tagName: z.string(),
|
|
90
|
-
})
|
|
91
|
-
.array();
|
|
92
|
-
/**
|
|
93
|
-
* Tag Object
|
|
94
|
-
*
|
|
95
|
-
* Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag
|
|
96
|
-
* defined in the Operation Object instances.
|
|
97
|
-
*
|
|
98
|
-
* @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#tag-object
|
|
99
|
-
*/
|
|
1
|
+
import { omitUndefinedValues } from "../../helpers/omit-undefined-values.js";
|
|
2
|
+
import { XScalarSdkInstallationSchema } from "@scalar/openapi-types/schemas/extensions";
|
|
3
|
+
import { nanoidSchema } from "@scalar/types/utils";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
const oasLicenseSchema = z.object({
|
|
6
|
+
/** REQUIRED. The license name used for the API. */
|
|
7
|
+
name: z.string().optional().nullable().catch(null),
|
|
8
|
+
/** An SPDX license expression for the API. The identifier field is mutually exclusive of the url field. */
|
|
9
|
+
identifier: z.string().optional().catch(void 0),
|
|
10
|
+
/**
|
|
11
|
+
* A URI for the license used for the API. This MUST be in the form of a URI. The url field is mutually exclusive of the identifier field.
|
|
12
|
+
*/
|
|
13
|
+
url: z.string().url().optional().catch(void 0)
|
|
14
|
+
}).transform(omitUndefinedValues);
|
|
15
|
+
const oasContactSchema = z.object({
|
|
16
|
+
/** The identifying name of the contact person/organization. */
|
|
17
|
+
name: z.string().optional(),
|
|
18
|
+
/** The URL pointing to the contact information. This MUST be in the form of a URL. */
|
|
19
|
+
url: z.string().url().optional().catch(void 0),
|
|
20
|
+
/** The email address of the contact person/organization. This MUST be in the form of an email address. */
|
|
21
|
+
email: z.string().optional().catch(void 0)
|
|
22
|
+
}).transform(omitUndefinedValues);
|
|
23
|
+
const oasInfoSchema = z.object({
|
|
24
|
+
/** REQUIRED. The title of the API. */
|
|
25
|
+
title: z.string().catch("API"),
|
|
26
|
+
/** A short summary of the API. */
|
|
27
|
+
summary: z.string().optional().catch(void 0),
|
|
28
|
+
/** A description of the API. CommonMark syntax MAY be used for rich text representation. */
|
|
29
|
+
description: z.string().optional().catch(void 0),
|
|
30
|
+
/** A URL to the Terms of Service for the API. This MUST be in the form of a URL. */
|
|
31
|
+
termsOfService: z.string().url().optional().catch(void 0),
|
|
32
|
+
/** The contact information for the exposed API. */
|
|
33
|
+
contact: oasContactSchema.optional().catch(void 0),
|
|
34
|
+
/** The license information for the exposed API. */
|
|
35
|
+
license: oasLicenseSchema.optional().catch(void 0),
|
|
36
|
+
/**
|
|
37
|
+
* REQUIRED. The version of the OpenAPI Document (which is distinct from the OpenAPI Specification version or the
|
|
38
|
+
* version of the API being described or the version of the OpenAPI Description).
|
|
39
|
+
*/
|
|
40
|
+
version: z.string().catch("1.0")
|
|
41
|
+
}).merge(XScalarSdkInstallationSchema).transform(omitUndefinedValues);
|
|
42
|
+
const oasExternalDocumentationSchema = z.object({
|
|
43
|
+
/** A description of the target documentation. CommonMark syntax MAY be used for rich text representation. */
|
|
44
|
+
description: z.string().optional().catch(void 0),
|
|
45
|
+
/** REQUIRED. The URL for the target documentation. This MUST be in the form of a URL. */
|
|
46
|
+
url: z.string()
|
|
47
|
+
}).transform(omitUndefinedValues);
|
|
48
|
+
const xScalarNestedSchema = z.object({
|
|
49
|
+
tagName: z.string()
|
|
50
|
+
}).array();
|
|
100
51
|
const oasTagSchema = z.object({
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
52
|
+
// TODO: Remove
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated Needs to be remove as it is not a spec property
|
|
55
|
+
*/
|
|
56
|
+
"type": z.literal("tag").optional().default("tag"),
|
|
57
|
+
/** REQUIRED. The name of the tag. */
|
|
58
|
+
"name": z.string(),
|
|
59
|
+
/** A description for the tag. CommonMark syntax MAY be used for rich text representation. */
|
|
60
|
+
"description": z.string().optional().catch(void 0),
|
|
61
|
+
/** Additional external documentation for this tag. */
|
|
62
|
+
"externalDocs": oasExternalDocumentationSchema.optional(),
|
|
63
|
+
"x-scalar-children": xScalarNestedSchema.default([]).optional(),
|
|
64
|
+
/** Hide collections */
|
|
65
|
+
"x-internal": z.boolean().optional(),
|
|
66
|
+
"x-scalar-ignore": z.boolean().optional()
|
|
116
67
|
});
|
|
117
68
|
const tagSchema = oasTagSchema.extend({
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
.union([z.string().brand(), z.string().brand()])
|
|
121
|
-
.array()
|
|
122
|
-
.default([]),
|
|
69
|
+
uid: nanoidSchema.brand(),
|
|
70
|
+
children: z.union([z.string().brand(), z.string().brand()]).array().default([])
|
|
123
71
|
});
|
|
124
|
-
|
|
125
|
-
|
|
72
|
+
export {
|
|
73
|
+
oasContactSchema,
|
|
74
|
+
oasExternalDocumentationSchema,
|
|
75
|
+
oasInfoSchema,
|
|
76
|
+
oasLicenseSchema,
|
|
77
|
+
oasTagSchema,
|
|
78
|
+
tagSchema,
|
|
79
|
+
xScalarNestedSchema
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=spec-objects.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/entities/spec/spec-objects.ts"],
|
|
4
|
+
"sourcesContent": ["import { omitUndefinedValues } from '@/helpers/omit-undefined-values'\nimport { XScalarSdkInstallationSchema } from '@scalar/openapi-types/schemas/extensions'\nimport { type ENTITY_BRANDS, nanoidSchema } from '@scalar/types/utils'\nimport { z } from 'zod'\n\n/**\n * License Object\n *\n * License information for the exposed API.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#license-object\n */\nexport const oasLicenseSchema = z\n .object({\n /** REQUIRED. The license name used for the API. */\n name: z.string().optional().nullable().catch(null),\n /** An SPDX license expression for the API. The identifier field is mutually exclusive of the url field. */\n identifier: z.string().optional().catch(undefined),\n /**\n * A URI for the license used for the API. This MUST be in the form of a URI. The url field is mutually exclusive of the identifier field.\n */\n url: z.string().url().optional().catch(undefined),\n })\n .transform(omitUndefinedValues)\n\n/**\n * Contact Object\n *\n * Contact information for the exposed API.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#contact-object\n */\nexport const oasContactSchema = z\n .object({\n /** The identifying name of the contact person/organization. */\n name: z.string().optional(),\n /** The URL pointing to the contact information. This MUST be in the form of a URL. */\n url: z.string().url().optional().catch(undefined),\n /** The email address of the contact person/organization. This MUST be in the form of an email address. */\n email: z.string().optional().catch(undefined),\n })\n .transform(omitUndefinedValues)\n\n/**\n * Info Object\n *\n * The object provides metadata about the API. The metadata MAY be used by the clients if needed,\n * and MAY be presented in editing or documentation generation tools for convenience.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#info-object\n */\nexport const oasInfoSchema = z\n .object({\n /** REQUIRED. The title of the API. */\n title: z.string().catch('API'),\n /** A short summary of the API. */\n summary: z.string().optional().catch(undefined),\n /** A description of the API. CommonMark syntax MAY be used for rich text representation. */\n description: z.string().optional().catch(undefined),\n /** A URL to the Terms of Service for the API. This MUST be in the form of a URL. */\n termsOfService: z.string().url().optional().catch(undefined),\n /** The contact information for the exposed API. */\n contact: oasContactSchema.optional().catch(undefined),\n /** The license information for the exposed API. */\n license: oasLicenseSchema.optional().catch(undefined),\n /**\n * REQUIRED. The version of the OpenAPI Document (which is distinct from the OpenAPI Specification version or the\n * version of the API being described or the version of the OpenAPI Description).\n */\n version: z.string().catch('1.0'),\n })\n .merge(XScalarSdkInstallationSchema)\n .transform(omitUndefinedValues)\n\n/**\n * External Documentation Object\n *\n * Allows referencing an external resource for extended documentation.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#external-documentation-object\n */\nexport const oasExternalDocumentationSchema = z\n .object({\n /** A description of the target documentation. CommonMark syntax MAY be used for rich text representation. */\n description: z.string().optional().catch(undefined),\n /** REQUIRED. The URL for the target documentation. This MUST be in the form of a URL. */\n url: z.string(),\n })\n .transform(omitUndefinedValues)\n\nexport type ExternalDocumentation = z.infer<typeof oasExternalDocumentationSchema>\n\nexport const xScalarNestedSchema = z\n .object({\n tagName: z.string(),\n })\n .array()\n\n/**\n * Tag Object\n *\n * Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag\n * defined in the Operation Object instances.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#tag-object\n */\nexport const oasTagSchema = z.object({\n // TODO: Remove\n /**\n * @deprecated Needs to be remove as it is not a spec property\n */\n 'type': z.literal('tag').optional().default('tag'),\n /** REQUIRED. The name of the tag. */\n 'name': z.string(),\n /** A description for the tag. CommonMark syntax MAY be used for rich text representation. */\n 'description': z.string().optional().catch(undefined),\n /** Additional external documentation for this tag. */\n 'externalDocs': oasExternalDocumentationSchema.optional(),\n 'x-scalar-children': xScalarNestedSchema.default([]).optional(),\n /** Hide collections */\n 'x-internal': z.boolean().optional(),\n 'x-scalar-ignore': z.boolean().optional(),\n})\n\nexport const tagSchema = oasTagSchema.extend({\n uid: nanoidSchema.brand<ENTITY_BRANDS['TAG']>(),\n children: z\n .union([z.string().brand<ENTITY_BRANDS['OPERATION']>(), z.string().brand<ENTITY_BRANDS['TAG']>()])\n .array()\n .default([]),\n})\n\nexport type Tag = z.infer<typeof tagSchema>\nexport type TagPayload = z.input<typeof tagSchema>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,2BAA2B;AACpC,SAAS,oCAAoC;AAC7C,SAA6B,oBAAoB;AACjD,SAAS,SAAS;AASX,MAAM,mBAAmB,EAC7B,OAAO;AAAA;AAAA,EAEN,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,IAAI;AAAA;AAAA,EAEjD,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAS;AAAA;AAAA;AAAA;AAAA,EAIjD,KAAK,EAAE,OAAO,EAAE,IAAI,EA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AQ,KAAK;AAAA;AAAA,EAEjD,QAAQ,EAAE,OAAO;AAAA;AAAA,EAEjB,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAS;AAAA;AAAA,EAEpD,gBAAgB,+BAA+B,SAAS;AAAA,EACxD,qBAAqB,oBAAoB,QAAQ,CAAC,CAAC,EAAE,SAAS;AAAA;AAAA,EAE9D,cAAc,EAAE,QAAQ,EAAE,SAAS;AAAA,EACnC,mBAAmB,EAAE,QAAQ,EAAE,SAAS;AAC1C,CAAC;AAEM,MAAM,YAAY,aAAa,OAAO;AAAA,EAC3C,KAAK,aAAa,MAA4B;AAAA,EAC9C,UAAU,EACP,MAAM,CAAC,EAAE,OAAO,EAAE,MAAkC,GAAG,EAAE,OAAO,EAAE,MAA4B,CAAC,CAAC,EAChG,MAAM,EACN,QAAQ,CAAC,CAAC;AACf,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { oasInfoSchema } from "./spec-objects.js";
|
|
3
|
+
describe("spec-objects", () => {
|
|
4
|
+
describe("oasInfoSchema", () => {
|
|
5
|
+
describe("title", () => {
|
|
6
|
+
it("parses title", () => {
|
|
7
|
+
const title = oasInfoSchema.parse({
|
|
8
|
+
title: "My API"
|
|
9
|
+
});
|
|
10
|
+
expect(title).toMatchObject({
|
|
11
|
+
title: "My API"
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
it("defaults to API", () => {
|
|
15
|
+
const title = oasInfoSchema.parse({});
|
|
16
|
+
expect(title).toMatchObject({
|
|
17
|
+
title: "API"
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
it("ignores invalid title", () => {
|
|
21
|
+
const title = oasInfoSchema.parse({
|
|
22
|
+
title: 123
|
|
23
|
+
});
|
|
24
|
+
expect(title).toMatchObject({ title: "API" });
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
describe("summary", () => {
|
|
28
|
+
it("parses summary", () => {
|
|
29
|
+
const info = oasInfoSchema.parse({
|
|
30
|
+
summary: "A brief summary of the API"
|
|
31
|
+
});
|
|
32
|
+
expect(info).toMatchObject({
|
|
33
|
+
summary: "A brief summary of the API"
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
it("ignores invalid summary", () => {
|
|
37
|
+
const info = oasInfoSchema.parse({
|
|
38
|
+
summary: 123
|
|
39
|
+
});
|
|
40
|
+
expect(info.summary).toBeUndefined();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
describe("description", () => {
|
|
44
|
+
it("parses description", () => {
|
|
45
|
+
const info = oasInfoSchema.parse({
|
|
46
|
+
description: "A detailed description of the API"
|
|
47
|
+
});
|
|
48
|
+
expect(info).toMatchObject({
|
|
49
|
+
description: "A detailed description of the API"
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
it("ignores invalid description", () => {
|
|
53
|
+
const info = oasInfoSchema.parse({
|
|
54
|
+
description: 123
|
|
55
|
+
});
|
|
56
|
+
expect(info.description).toBeUndefined();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
describe("version", () => {
|
|
60
|
+
it("parses version", () => {
|
|
61
|
+
const version = oasInfoSchema.parse({
|
|
62
|
+
version: "1.0.0"
|
|
63
|
+
});
|
|
64
|
+
expect(version).toMatchObject({ version: "1.0.0" });
|
|
65
|
+
});
|
|
66
|
+
it("defaults to 1.0", () => {
|
|
67
|
+
const version = oasInfoSchema.parse({});
|
|
68
|
+
expect(version).toMatchObject({ version: "1.0" });
|
|
69
|
+
});
|
|
70
|
+
it("ignores invalid version", () => {
|
|
71
|
+
const version = oasInfoSchema.parse({
|
|
72
|
+
version: 123
|
|
73
|
+
});
|
|
74
|
+
expect(version).toMatchObject({ version: "1.0" });
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
describe("contact", () => {
|
|
78
|
+
it("parses contact object", () => {
|
|
79
|
+
const info = oasInfoSchema.parse({
|
|
80
|
+
contact: {
|
|
81
|
+
name: "John Doe",
|
|
82
|
+
url: "https://example.com",
|
|
83
|
+
email: "john.doe@example.com"
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
expect(info).toMatchObject({
|
|
87
|
+
contact: {
|
|
88
|
+
name: "John Doe",
|
|
89
|
+
url: "https://example.com",
|
|
90
|
+
email: "john.doe@example.com"
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
it("ignores invalid contact", () => {
|
|
95
|
+
const info = oasInfoSchema.parse({
|
|
96
|
+
contact: 123
|
|
97
|
+
});
|
|
98
|
+
expect(info.contact).toStrictEqual(void 0);
|
|
99
|
+
});
|
|
100
|
+
it("works with just the name", () => {
|
|
101
|
+
const info = oasInfoSchema.parse({
|
|
102
|
+
contact: {
|
|
103
|
+
name: "John Doe"
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
expect(info).toMatchObject({
|
|
107
|
+
contact: {
|
|
108
|
+
name: "John Doe"
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
it("works with just the url", () => {
|
|
113
|
+
const info = oasInfoSchema.parse({
|
|
114
|
+
contact: {
|
|
115
|
+
url: "https://example.com"
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
expect(info).toMatchObject({
|
|
119
|
+
contact: {
|
|
120
|
+
url: "https://example.com"
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
it("works with just the email", () => {
|
|
125
|
+
const info = oasInfoSchema.parse({
|
|
126
|
+
contact: {
|
|
127
|
+
email: "john.doe@example.com"
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
expect(info).toMatchObject({
|
|
131
|
+
contact: {
|
|
132
|
+
email: "john.doe@example.com"
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
it("keeps invalid emails", () => {
|
|
137
|
+
const info = oasInfoSchema.parse({
|
|
138
|
+
contact: {
|
|
139
|
+
name: "John Doe",
|
|
140
|
+
url: "invalid",
|
|
141
|
+
email: "invalid",
|
|
142
|
+
something: "random"
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
expect(info.contact).toStrictEqual({
|
|
146
|
+
name: "John Doe",
|
|
147
|
+
email: "invalid"
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
describe("license", () => {
|
|
152
|
+
it("parses license object", () => {
|
|
153
|
+
const info = oasInfoSchema.parse({
|
|
154
|
+
license: {
|
|
155
|
+
name: "MIT",
|
|
156
|
+
url: "https://opensource.org/licenses/MIT",
|
|
157
|
+
identifier: "MIT"
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
expect(info).toMatchObject({
|
|
161
|
+
license: {
|
|
162
|
+
name: "MIT",
|
|
163
|
+
url: "https://opensource.org/licenses/MIT",
|
|
164
|
+
identifier: "MIT"
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
it("ignores invalid license", () => {
|
|
169
|
+
const info = oasInfoSchema.parse({
|
|
170
|
+
license: 123
|
|
171
|
+
});
|
|
172
|
+
expect(info.license).toStrictEqual(void 0);
|
|
173
|
+
});
|
|
174
|
+
it("works with just the name", () => {
|
|
175
|
+
const info = oasInfoSchema.parse({
|
|
176
|
+
license: {
|
|
177
|
+
name: "MIT"
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
expect(info).toMatchObject({
|
|
181
|
+
license: {
|
|
182
|
+
name: "MIT"
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
describe("termsOfService", () => {
|
|
188
|
+
it("parses termsOfService", () => {
|
|
189
|
+
const info = oasInfoSchema.parse({
|
|
190
|
+
termsOfService: "https://example.com/terms-of-service"
|
|
191
|
+
});
|
|
192
|
+
expect(info).toMatchObject({
|
|
193
|
+
termsOfService: "https://example.com/terms-of-service"
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
it("ignores invalid termsOfService", () => {
|
|
197
|
+
const info = oasInfoSchema.parse({
|
|
198
|
+
termsOfService: 123
|
|
199
|
+
});
|
|
200
|
+
expect(info.termsOfService).toStrictEqual(void 0);
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
//# sourceMappingURL=spec-objects.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/entities/spec/spec-objects.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { oasInfoSchema } from './spec-objects'\n\ndescribe('spec-objects', () => {\n describe('oasInfoSchema', () => {\n describe('title', () => {\n it('parses title', () => {\n const title = oasInfoSchema.parse({\n title: 'My API',\n })\n\n expect(title).toMatchObject({\n title: 'My API',\n })\n })\n\n it('defaults to API', () => {\n const title = oasInfoSchema.parse({})\n\n expect(title).toMatchObject({\n title: 'API',\n })\n })\n\n it('ignores invalid title', () => {\n const title = oasInfoSchema.parse({\n title: 123,\n })\n\n expect(title).toMatchObject({ title: 'API' })\n })\n })\n\n describe('summary', () => {\n it('parses summary', () => {\n const info = oasInfoSchema.parse({\n summary: 'A brief summary of the API',\n })\n\n expect(info).toMatchObject({\n summary: 'A brief summary of the API',\n })\n })\n\n it('ignores invalid summary', () => {\n const info = oasInfoSchema.parse({\n summary: 123,\n })\n\n expect(info.summary).toBeUndefined()\n })\n })\n\n describe('description', () => {\n it('parses description', () => {\n const info = oasInfoSchema.parse({\n description: 'A detailed description of the API',\n })\n\n expect(info).toMatchObject({\n description: 'A detailed description of the API',\n })\n })\n\n it('ignores invalid description', () => {\n const info = oasInfoSchema.parse({\n description: 123,\n })\n\n expect(info.description).toBeUndefined()\n })\n })\n\n describe('version', () => {\n it('parses version', () => {\n const version = oasInfoSchema.parse({\n version: '1.0.0',\n })\n\n expect(version).toMatchObject({ version: '1.0.0' })\n })\n\n it('defaults to 1.0', () => {\n const version = oasInfoSchema.parse({})\n\n expect(version).toMatchObject({ version: '1.0' })\n })\n\n it('ignores invalid version', () => {\n const version = oasInfoSchema.parse({\n version: 123,\n })\n\n expect(version).toMatchObject({ version: '1.0' })\n })\n })\n\n describe('contact', () => {\n it('parses contact object', () => {\n const info = oasInfoSchema.parse({\n contact: {\n name: 'John Doe',\n url: 'https://example.com',\n email: 'john.doe@example.com',\n },\n })\n\n expect(info).toMatchObject({\n contact: {\n name: 'John Doe',\n url: 'https://example.com',\n email: 'john.doe@example.com',\n },\n })\n })\n\n it('ignores invalid contact', () => {\n const info = oasInfoSchema.parse({\n contact: 123,\n })\n\n expect(info.contact).toStrictEqual(undefined)\n })\n\n it('works with just the name', () => {\n const info = oasInfoSchema.parse({\n contact: {\n name: 'John Doe',\n },\n })\n\n expect(info).toMatchObject({\n contact: {\n name: 'John Doe',\n },\n })\n })\n\n it('works with just the url', () => {\n const info = oasInfoSchema.parse({\n contact: {\n url: 'https://example.com',\n },\n })\n\n expect(info).toMatchObject({\n contact: {\n url: 'https://example.com',\n },\n })\n })\n\n it('works with just the email', () => {\n const info = oasInfoSchema.parse({\n contact: {\n email: 'john.doe@example.com',\n },\n })\n\n expect(info).toMatchObject({\n contact: {\n email: 'john.doe@example.com',\n },\n })\n })\n\n it('keeps invalid emails', () => {\n const info = oasInfoSchema.parse({\n contact: {\n name: 'John Doe',\n url: 'invalid',\n email: 'invalid',\n something: 'random',\n },\n })\n\n expect(info.contact).toStrictEqual({\n name: 'John Doe',\n email: 'invalid',\n })\n })\n })\n\n describe('license', () => {\n it('parses license object', () => {\n const info = oasInfoSchema.parse({\n license: {\n name: 'MIT',\n url: 'https://opensource.org/licenses/MIT',\n identifier: 'MIT',\n },\n })\n\n expect(info).toMatchObject({\n license: {\n name: 'MIT',\n url: 'https://opensource.org/licenses/MIT',\n identifier: 'MIT',\n },\n })\n })\n\n it('ignores invalid license', () => {\n const info = oasInfoSchema.parse({\n license: 123,\n })\n\n expect(info.license).toStrictEqual(undefined)\n })\n\n it('works with just the name', () => {\n const info = oasInfoSchema.parse({\n license: {\n name: 'MIT',\n },\n })\n\n expect(info).toMatchObject({\n license: {\n name: 'MIT',\n },\n })\n })\n })\n\n describe('termsOfService', () => {\n it('parses termsOfService', () => {\n const info = oasInfoSchema.parse({\n termsOfService: 'https://example.com/terms-of-service',\n })\n\n expect(info).toMatchObject({\n termsOfService: 'https://example.com/terms-of-service',\n })\n })\n\n it('ignores invalid termsOfService', () => {\n const info = oasInfoSchema.parse({\n termsOfService: 123,\n })\n\n expect(info.termsOfService).toStrictEqual(undefined)\n })\n })\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,qBAAqB;AAE9B,SAAS,gBAAgB,MAAM;AAC7B,WAAS,iBAAiB,MAAM;AAC9B,aAAS,SAAS,MAAM;AACtB,SAAG,gBAAgB,MAAM;AACvB,cAAM,QAAQ,cAAc,MAAM;AAAA,UAChC,OAAO;AAAA,QACT,CAAC;AAED,eAAO,KAAK,EAAE,cAAc;AAAA,UAC1B,OAAO;AAAA,QACT,CAAC;AAAA,MACH,CAAC;AAED,SAAG,mBAAmB,MAAM;AAC1B,cAAM,QAAQ,cAAc,MAAM,CAAC,CAAC;AAEpC,eAAO,KAAK,EAAE,cAAc;AAAA,UAC1B,OAAO;AAAA,QACT,CAAC;AAAA,MACH,CAAC;AAED,SAAG,yBAAyB,MAAM;AAChC,cAAM,QAAQ,cAAc,MAAM;AAAA,UAChC,OAAO;AAAA,QACT,CAAC;AAED,eAAO,KAAK,EAAE,cAAc,EAAE,OAAO,MAAM,CAAC;AAAA,MAC9C,CAAC;AAAA,IACH,CAAC;AAED,aAAS,WAAW,MAAM;AACxB,SAAG,kBAAkB,MAAM;AACzB,cAAM,OAAO,cAAc,MAAM;AAAA,UAC/B,SAAS;AAAA,QACX,CAAC;AAED,eAAO,IAAI,EAAE,cAAc;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26 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
|
|
1
|
+
import { z } from "zod";
|
|
3
2
|
const xScalarEnvVarSchema = z.union([
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
z.object({
|
|
4
|
+
description: z.string().optional(),
|
|
5
|
+
default: z.string().default("")
|
|
6
|
+
}),
|
|
7
|
+
z.string()
|
|
9
8
|
]);
|
|
10
9
|
const xScalarEnvironmentSchema = z.object({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
description: z.string().optional(),
|
|
11
|
+
color: z.string().optional(),
|
|
12
|
+
/** A map of variables by name */
|
|
13
|
+
variables: z.record(z.string(), xScalarEnvVarSchema)
|
|
15
14
|
});
|
|
16
|
-
/** A map of environments by name */
|
|
17
15
|
const xScalarEnvironmentsSchema = z.record(
|
|
18
|
-
/** Name */
|
|
19
|
-
z.string(),
|
|
20
|
-
/** Environment definition */
|
|
21
|
-
xScalarEnvironmentSchema
|
|
22
|
-
|
|
23
|
-
export {
|
|
16
|
+
/** Name */
|
|
17
|
+
z.string(),
|
|
18
|
+
/** Environment definition */
|
|
19
|
+
xScalarEnvironmentSchema
|
|
20
|
+
);
|
|
21
|
+
export {
|
|
22
|
+
xScalarEnvVarSchema,
|
|
23
|
+
xScalarEnvironmentSchema,
|
|
24
|
+
xScalarEnvironmentsSchema
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=x-scalar-environments.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/entities/spec/x-scalar-environments.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\n\nexport type XScalarEnvVar = z.infer<typeof xScalarEnvVarSchema>\n\nexport const xScalarEnvVarSchema = z.union([\n z.object({\n description: z.string().optional(),\n default: z.string().default(''),\n }),\n z.string(),\n])\n\nexport const xScalarEnvironmentSchema = z.object({\n description: z.string().optional(),\n color: z.string().optional(),\n /** A map of variables by name */\n variables: z.record(z.string(), xScalarEnvVarSchema),\n})\n\n/** A map of environments by name */\nexport const xScalarEnvironmentsSchema = z.record(\n /** Name */\n z.string(),\n /** Environment definition */\n xScalarEnvironmentSchema,\n)\n\nexport type XScalarEnvironment = z.infer<typeof xScalarEnvironmentSchema>\nexport type XScalarEnvironments = z.infer<typeof xScalarEnvironmentsSchema>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAIX,MAAM,sBAAsB,EAAE,MAAM;AAAA,EACzC,EAAE,OAAO;AAAA,IACP,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,IACjC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE;AAAA,EAChC,CAAC;AAAA,EACD,EAAE,OAAO;AACX,CAAC;AAEM,MAAM,2BAA2B,EAAE,OAAO;AAAA,EAC/C,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAE3B,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,mBAAmB;AACrD,CAAC;AAGM,MAAM,4BAA4B,EAAE;AAAA;AAAA,EAEzC,EAAE,OAAO;AAAA;AAAA,EAET;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { parseJsonOrYaml } from "../../helpers/parse.js";
|
|
3
|
+
import baseDefinition from "@/spec-extentions/x-scalar-environments.yaml?raw";
|
|
4
|
+
import { xScalarEnvironmentsSchema } from "./x-scalar-environments.js";
|
|
5
|
+
describe("x-scalar-environments", () => {
|
|
6
|
+
it("Handles spec definition", () => {
|
|
7
|
+
const parsed = parseJsonOrYaml(baseDefinition);
|
|
8
|
+
expect(xScalarEnvironmentsSchema.parse(parsed["x-scalar-environments"])).toEqual(parsed["x-scalar-environments"]);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=x-scalar-environments.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/entities/spec/x-scalar-environments.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { parseJsonOrYaml } from '@/helpers/parse'\nimport baseDefinition from '@/spec-extentions/x-scalar-environments.yaml?raw'\nimport { xScalarEnvironmentsSchema } from './x-scalar-environments'\n\ndescribe('x-scalar-environments', () => {\n it('Handles spec definition', () => {\n const parsed = parseJsonOrYaml(baseDefinition)\n\n expect(xScalarEnvironmentsSchema.parse(parsed['x-scalar-environments'])).toEqual(parsed['x-scalar-environments'])\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,uBAAuB;AAChC,OAAO,oBAAoB;AAC3B,SAAS,iCAAiC;AAE1C,SAAS,yBAAyB,MAAM;AACtC,KAAG,2BAA2B,MAAM;AAClC,UAAM,SAAS,gBAAgB,cAAc;AAE7C,WAAO,0BAA0B,MAAM,OAAO,uBAAuB,CAAC,CAAC,EAAE,QAAQ,OAAO,uBAAuB,CAAC;AAAA,EAClH,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
|
|
1
|
+
import { z } from "zod";
|
|
3
2
|
const xScalarSecretVarSchema = z.object({
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
description: z.string().optional(),
|
|
4
|
+
example: z.string().optional()
|
|
6
5
|
});
|
|
7
6
|
const xScalarSecretsSchema = z.record(z.string(), xScalarSecretVarSchema);
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
export {
|
|
8
|
+
xScalarSecretVarSchema,
|
|
9
|
+
xScalarSecretsSchema
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=x-scalar-secrets.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/entities/spec/x-scalar-secrets.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\n\nexport const xScalarSecretVarSchema = z.object({\n description: z.string().optional(),\n example: z.string().optional(),\n})\n\nexport const xScalarSecretsSchema = z.record(z.string(), xScalarSecretVarSchema)\nexport type XScalarSecrets = z.infer<typeof xScalarSecretsSchema>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAEX,MAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,SAAS,EAAE,OAAO,EAAE,SAAS;AAC/B,CAAC;AAEM,MAAM,uBAAuB,EAAE,OAAO,EAAE,OAAO,GAAG,sBAAsB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { parseJsonOrYaml } from "../../helpers/parse.js";
|
|
3
|
+
import baseDefinition from "@/spec-extentions/x-scalar-environments.yaml?raw";
|
|
4
|
+
import { xScalarSecretsSchema } from "./x-scalar-secrets.js";
|
|
5
|
+
describe("x-scalar-secrets", () => {
|
|
6
|
+
it("Handles spec definition", () => {
|
|
7
|
+
const parsed = parseJsonOrYaml(baseDefinition);
|
|
8
|
+
expect(xScalarSecretsSchema.parse(parsed["x-scalar-secrets"])).toEqual(parsed["x-scalar-secrets"]);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=x-scalar-secrets.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/entities/spec/x-scalar-secrets.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { parseJsonOrYaml } from '@/helpers/parse'\nimport baseDefinition from '@/spec-extentions/x-scalar-environments.yaml?raw'\nimport { xScalarSecretsSchema } from './x-scalar-secrets'\n\ndescribe('x-scalar-secrets', () => {\n it('Handles spec definition', () => {\n const parsed = parseJsonOrYaml(baseDefinition)\n\n expect(xScalarSecretsSchema.parse(parsed['x-scalar-secrets'])).toEqual(parsed['x-scalar-secrets'])\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,uBAAuB;AAChC,OAAO,oBAAoB;AAC3B,SAAS,4BAA4B;AAErC,SAAS,oBAAoB,MAAM;AACjC,KAAG,2BAA2B,MAAM;AAClC,UAAM,SAAS,gBAAgB,cAAc;AAE7C,WAAO,qBAAqB,MAAM,OAAO,kBAAkB,CAAC,CAAC,EAAE,QAAQ,OAAO,kBAAkB,CAAC;AAAA,EACnG,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { type HotKeyConfig, type HotKeyModifiers, type Workspace, type WorkspacePayload, workspaceSchema, } from './workspace.
|
|
1
|
+
export { type HotKeyConfig, type HotKeyModifiers, type Workspace, type WorkspacePayload, workspaceSchema, } from './workspace.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,eAAe,GAChB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,eAAe,GAChB,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/entities/workspace/index.ts"],
|
|
4
|
+
"sourcesContent": ["export {\n type HotKeyConfig,\n type HotKeyModifiers,\n type Workspace,\n type WorkspacePayload,\n workspaceSchema,\n} from './workspace'\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EAKE;AAAA,OACK;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|