@scalar/oas-utils 0.10.8 → 0.10.9
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 +6 -0
- package/dist/entities/cookie/cookie.js +11 -15
- package/dist/entities/cookie/index.js +1 -5
- package/dist/entities/environment/environment.js +7 -11
- package/dist/entities/environment/index.js +1 -5
- package/dist/entities/hotkeys/hotkeys.js +116 -111
- package/dist/entities/hotkeys/index.js +1 -6
- package/dist/entities/shared/index.js +1 -7
- package/dist/entities/shared/utility.js +9 -9
- package/dist/entities/spec/collection.js +91 -89
- package/dist/entities/spec/index.js +10 -59
- package/dist/entities/spec/operation.js +6 -6
- package/dist/entities/spec/parameters.js +38 -38
- package/dist/entities/spec/request-examples.js +421 -331
- package/dist/entities/spec/requests.js +102 -84
- package/dist/entities/spec/server.js +61 -46
- package/dist/entities/spec/spec-objects.js +121 -76
- package/dist/entities/spec/x-scalar-environments.js +18 -20
- package/dist/entities/spec/x-scalar-secrets.js +6 -8
- package/dist/entities/workspace/index.js +1 -7
- package/dist/entities/workspace/workspace.js +47 -46
- package/dist/helpers/client-plugins.js +13 -13
- package/dist/helpers/fetch-document.js +30 -25
- package/dist/helpers/fetch-with-proxy-fallback.js +26 -21
- package/dist/helpers/index.d.ts +1 -2
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +80 -119
- package/dist/helpers/normalize-mime-type-object.js +19 -18
- package/dist/helpers/normalize-mime-type.js +11 -9
- package/dist/helpers/operation-stability.js +25 -20
- package/dist/helpers/parse.d.ts +0 -4
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +77 -77
- package/dist/helpers/schema-model.js +13 -16
- package/dist/helpers/security/get-schemes.js +7 -8
- package/dist/helpers/security/has-token.js +18 -19
- package/dist/helpers/security/index.js +2 -7
- package/dist/helpers/servers.js +128 -79
- package/dist/helpers/should-ignore-entity.js +4 -5
- package/dist/migrations/data-version.js +15 -7
- package/dist/migrations/generate-types.js +34 -37
- package/dist/migrations/index.js +4 -18
- package/dist/migrations/local-storage.js +31 -29
- package/dist/migrations/migrate-to-indexdb.js +706 -529
- package/dist/migrations/migrator.js +58 -54
- package/dist/migrations/semver.js +24 -24
- package/dist/migrations/v-0.0.0/types.generated.js +1 -1
- package/dist/migrations/v-2.1.0/migration.js +272 -258
- package/dist/migrations/v-2.1.0/types.generated.js +1 -1
- package/dist/migrations/v-2.2.0/migration.js +99 -96
- package/dist/migrations/v-2.2.0/types.generated.js +1 -1
- package/dist/migrations/v-2.3.0/migration.js +45 -48
- package/dist/migrations/v-2.3.0/types.generated.js +1 -1
- package/dist/migrations/v-2.4.0/migration.js +25 -25
- package/dist/migrations/v-2.4.0/types.generated.js +1 -1
- package/dist/migrations/v-2.5.0/migration.js +122 -139
- package/dist/migrations/v-2.5.0/types.generated.js +1 -1
- package/dist/spec-getters/get-example-from-schema.js +489 -385
- package/dist/spec-getters/get-parameters-from-operation.js +39 -23
- package/dist/spec-getters/get-request-body-from-operation.d.ts.map +1 -1
- package/dist/spec-getters/get-request-body-from-operation.js +168 -126
- package/dist/spec-getters/get-server-variable-examples.js +10 -13
- package/dist/spec-getters/index.js +4 -11
- package/dist/transforms/import-spec.js +381 -291
- package/dist/transforms/index.js +1 -11
- package/package.json +15 -19
- package/dist/entities/cookie/cookie.js.map +0 -7
- package/dist/entities/cookie/index.js.map +0 -7
- package/dist/entities/environment/environment.js.map +0 -7
- package/dist/entities/environment/index.js.map +0 -7
- package/dist/entities/hotkeys/hotkeys.js.map +0 -7
- package/dist/entities/hotkeys/index.js.map +0 -7
- package/dist/entities/shared/index.js.map +0 -7
- package/dist/entities/shared/utility.js.map +0 -7
- package/dist/entities/spec/collection.js.map +0 -7
- package/dist/entities/spec/index.js.map +0 -7
- package/dist/entities/spec/operation.js.map +0 -7
- package/dist/entities/spec/parameters.js.map +0 -7
- package/dist/entities/spec/request-examples.js.map +0 -7
- package/dist/entities/spec/requests.js.map +0 -7
- package/dist/entities/spec/server.js.map +0 -7
- package/dist/entities/spec/spec-objects.js.map +0 -7
- package/dist/entities/spec/x-scalar-environments.js.map +0 -7
- package/dist/entities/spec/x-scalar-secrets.js.map +0 -7
- package/dist/entities/workspace/index.js.map +0 -7
- package/dist/entities/workspace/workspace.js.map +0 -7
- package/dist/helpers/client-plugins.js.map +0 -7
- package/dist/helpers/fetch-document.js.map +0 -7
- package/dist/helpers/fetch-with-proxy-fallback.js.map +0 -7
- package/dist/helpers/index.js.map +0 -7
- package/dist/helpers/normalize-mime-type-object.js.map +0 -7
- package/dist/helpers/normalize-mime-type.js.map +0 -7
- package/dist/helpers/operation-stability.js.map +0 -7
- package/dist/helpers/parse.js.map +0 -7
- package/dist/helpers/pretty-print-json.d.ts +0 -9
- package/dist/helpers/pretty-print-json.d.ts.map +0 -1
- package/dist/helpers/pretty-print-json.js +0 -38
- package/dist/helpers/pretty-print-json.js.map +0 -7
- package/dist/helpers/schema-model.js.map +0 -7
- package/dist/helpers/security/get-schemes.js.map +0 -7
- package/dist/helpers/security/has-token.js.map +0 -7
- package/dist/helpers/security/index.js.map +0 -7
- package/dist/helpers/servers.js.map +0 -7
- package/dist/helpers/should-ignore-entity.js.map +0 -7
- package/dist/migrations/data-version.js.map +0 -7
- package/dist/migrations/generate-types.js.map +0 -7
- package/dist/migrations/index.js.map +0 -7
- package/dist/migrations/local-storage.js.map +0 -7
- package/dist/migrations/migrate-to-indexdb.js.map +0 -7
- package/dist/migrations/migrator.js.map +0 -7
- package/dist/migrations/semver.js.map +0 -7
- package/dist/migrations/v-0.0.0/types.generated.js.map +0 -7
- package/dist/migrations/v-2.1.0/migration.js.map +0 -7
- package/dist/migrations/v-2.1.0/types.generated.js.map +0 -7
- package/dist/migrations/v-2.2.0/migration.js.map +0 -7
- package/dist/migrations/v-2.2.0/types.generated.js.map +0 -7
- package/dist/migrations/v-2.3.0/migration.js.map +0 -7
- package/dist/migrations/v-2.3.0/types.generated.js.map +0 -7
- package/dist/migrations/v-2.4.0/migration.js.map +0 -7
- package/dist/migrations/v-2.4.0/types.generated.js.map +0 -7
- package/dist/migrations/v-2.5.0/migration.js.map +0 -7
- package/dist/migrations/v-2.5.0/types.generated.js.map +0 -7
- package/dist/spec-getters/get-example-from-schema.js.map +0 -7
- package/dist/spec-getters/get-parameters-from-operation.js.map +0 -7
- package/dist/spec-getters/get-request-body-from-operation.js.map +0 -7
- package/dist/spec-getters/get-server-variable-examples.js.map +0 -7
- package/dist/spec-getters/index.js.map +0 -7
- package/dist/transforms/import-spec.js.map +0 -7
- package/dist/transforms/index.js.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { nanoidSchema } from
|
|
3
|
-
const cookieSchema = z.object({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { nanoidSchema } from '@scalar/types/utils';
|
|
3
|
+
export const cookieSchema = z.object({
|
|
4
|
+
uid: nanoidSchema.brand(),
|
|
5
|
+
/** Defines the cookie name and its value. A cookie definition begins with a name-value pair. */
|
|
6
|
+
name: z.string().default(''),
|
|
7
|
+
value: z.string().default(''),
|
|
8
|
+
/** Defines the host to which the cookie will be sent. */
|
|
9
|
+
domain: z.string().optional(),
|
|
10
|
+
/** Indicates the path that must exist in the requested URL for the browser to send the Cookie header. */
|
|
11
|
+
path: z.string().optional(),
|
|
12
12
|
});
|
|
13
|
-
export {
|
|
14
|
-
cookieSchema
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=cookie.js.map
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
const environmentSchema = z.object({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const environmentSchema = z.object({
|
|
3
|
+
uid: z.string().brand(),
|
|
4
|
+
name: z.string().optional().default('Default Environment'),
|
|
5
|
+
color: z.string().optional().default('#FFFFFF'),
|
|
6
|
+
value: z.string().default(''),
|
|
7
|
+
isDefault: z.boolean().optional(),
|
|
8
8
|
});
|
|
9
|
-
export {
|
|
10
|
-
environmentSchema
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=environment.js.map
|
|
@@ -1,113 +1,118 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Array of all of the events that we support
|
|
3
|
+
*/
|
|
4
|
+
export const HOTKEY_EVENT_NAMES = [
|
|
5
|
+
'addTopNav',
|
|
6
|
+
'closeModal',
|
|
7
|
+
'closeTopNav',
|
|
8
|
+
'createNew',
|
|
9
|
+
'executeRequest',
|
|
10
|
+
'focusAddressBar',
|
|
11
|
+
'focusRequestSearch',
|
|
12
|
+
'jumpToLastTab',
|
|
13
|
+
'jumpToTab',
|
|
14
|
+
'navigateSearchResultsDown',
|
|
15
|
+
'navigateSearchResultsUp',
|
|
16
|
+
'navigateTopNavLeft',
|
|
17
|
+
'navigateTopNavRight',
|
|
18
|
+
'openCommandPalette',
|
|
19
|
+
'selectSearchResult',
|
|
20
|
+
'toggleSidebar',
|
|
18
21
|
];
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Array of all of the hotkeys that we support
|
|
24
|
+
*
|
|
25
|
+
* Space is a special case because its actually ' ' but we name it space here and will handle it separately
|
|
26
|
+
* If you need more
|
|
27
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
|
|
28
|
+
*/
|
|
29
|
+
export const KEYDOWN_KEYS = [
|
|
30
|
+
'Space',
|
|
31
|
+
'Backspace',
|
|
32
|
+
'Tab',
|
|
33
|
+
'Enter',
|
|
34
|
+
'Escape',
|
|
35
|
+
'ArrowDown',
|
|
36
|
+
'ArrowLeft',
|
|
37
|
+
'ArrowRight',
|
|
38
|
+
'ArrowUp',
|
|
39
|
+
'End',
|
|
40
|
+
'Home',
|
|
41
|
+
'PageDown',
|
|
42
|
+
'PageUp',
|
|
43
|
+
'Delete',
|
|
44
|
+
'0',
|
|
45
|
+
'1',
|
|
46
|
+
'2',
|
|
47
|
+
'3',
|
|
48
|
+
'4',
|
|
49
|
+
'5',
|
|
50
|
+
'6',
|
|
51
|
+
'7',
|
|
52
|
+
'8',
|
|
53
|
+
'9',
|
|
54
|
+
'a',
|
|
55
|
+
'b',
|
|
56
|
+
'c',
|
|
57
|
+
'd',
|
|
58
|
+
'e',
|
|
59
|
+
'f',
|
|
60
|
+
'g',
|
|
61
|
+
'h',
|
|
62
|
+
'i',
|
|
63
|
+
'j',
|
|
64
|
+
'k',
|
|
65
|
+
'l',
|
|
66
|
+
'm',
|
|
67
|
+
'n',
|
|
68
|
+
'o',
|
|
69
|
+
'p',
|
|
70
|
+
'q',
|
|
71
|
+
'r',
|
|
72
|
+
's',
|
|
73
|
+
't',
|
|
74
|
+
'u',
|
|
75
|
+
'v',
|
|
76
|
+
'w',
|
|
77
|
+
'x',
|
|
78
|
+
'y',
|
|
79
|
+
'z',
|
|
80
|
+
'0',
|
|
81
|
+
'1',
|
|
82
|
+
'2',
|
|
83
|
+
'3',
|
|
84
|
+
'4',
|
|
85
|
+
'5',
|
|
86
|
+
'6',
|
|
87
|
+
'7',
|
|
88
|
+
'8',
|
|
89
|
+
'9',
|
|
90
|
+
'*',
|
|
91
|
+
'+',
|
|
92
|
+
'-',
|
|
93
|
+
'.',
|
|
94
|
+
'/',
|
|
95
|
+
'F1',
|
|
96
|
+
'F2',
|
|
97
|
+
'F3',
|
|
98
|
+
'F4',
|
|
99
|
+
'F5',
|
|
100
|
+
'F6',
|
|
101
|
+
'F7',
|
|
102
|
+
'F8',
|
|
103
|
+
'F9',
|
|
104
|
+
'F10',
|
|
105
|
+
'F11',
|
|
106
|
+
'F12',
|
|
107
|
+
';',
|
|
108
|
+
'=',
|
|
109
|
+
',',
|
|
110
|
+
'-',
|
|
111
|
+
'.',
|
|
112
|
+
'/',
|
|
113
|
+
'`',
|
|
114
|
+
'[',
|
|
115
|
+
'\\',
|
|
116
|
+
']',
|
|
117
|
+
'',
|
|
108
118
|
];
|
|
109
|
-
export {
|
|
110
|
-
HOTKEY_EVENT_NAMES,
|
|
111
|
-
KEYDOWN_KEYS
|
|
112
|
-
};
|
|
113
|
-
//# sourceMappingURL=hotkeys.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Schema for selectedSecuritySchemeUids */
|
|
3
|
+
export const selectedSecuritySchemeUidSchema = z
|
|
4
|
+
.union([
|
|
5
|
+
z.string().brand(),
|
|
6
|
+
z.string().brand().array(),
|
|
7
|
+
])
|
|
8
|
+
.array()
|
|
9
|
+
.default([]);
|
|
@@ -1,93 +1,95 @@
|
|
|
1
|
-
import { oasSecurityRequirementSchema } from
|
|
2
|
-
import { nanoidSchema } from
|
|
3
|
-
import { z } from
|
|
4
|
-
import { selectedSecuritySchemeUidSchema } from
|
|
5
|
-
import { xScalarEnvironmentsSchema } from
|
|
6
|
-
import { xScalarSecretsSchema } from
|
|
7
|
-
import { oasExternalDocumentationSchema, oasInfoSchema } from
|
|
1
|
+
import { oasSecurityRequirementSchema } from '@scalar/types/entities';
|
|
2
|
+
import { nanoidSchema } from '@scalar/types/utils';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { selectedSecuritySchemeUidSchema } from '../../entities/shared/utility.js';
|
|
5
|
+
import { xScalarEnvironmentsSchema } from '../../entities/spec/x-scalar-environments.js';
|
|
6
|
+
import { xScalarSecretsSchema } from '../../entities/spec/x-scalar-secrets.js';
|
|
7
|
+
import { oasExternalDocumentationSchema, oasInfoSchema } from './spec-objects.js';
|
|
8
8
|
const oasCollectionSchema = z.object({
|
|
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
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated
|
|
11
|
+
* Needs to be remove as it is not a spec property
|
|
12
|
+
*/
|
|
13
|
+
'type': z.literal('collection').optional().default('collection'),
|
|
14
|
+
'openapi': z
|
|
15
|
+
.union([z.string(), z.literal('3.0.0'), z.literal('3.1.0'), z.literal('4.0.0')])
|
|
16
|
+
.optional()
|
|
17
|
+
.default('3.1.0'),
|
|
18
|
+
'jsonSchemaDialect': z.string().optional(),
|
|
19
|
+
'info': oasInfoSchema.catch({
|
|
20
|
+
title: 'API',
|
|
21
|
+
version: '1.0',
|
|
22
|
+
}),
|
|
23
|
+
/**
|
|
24
|
+
* A declaration of which security mechanisms can be used across the API. The list of
|
|
25
|
+
* values includes alternative security requirement objects that can be used. Only
|
|
26
|
+
* one of the security requirement objects need to be satisfied to authorize a request.
|
|
27
|
+
* Individual operations can override this definition. To make security optional, an empty
|
|
28
|
+
* security requirement ({}) can be included in the array.
|
|
29
|
+
*/
|
|
30
|
+
'security': z.array(oasSecurityRequirementSchema).optional().default([]),
|
|
31
|
+
'externalDocs': oasExternalDocumentationSchema.optional().catch(undefined),
|
|
32
|
+
/** TODO: Type these */
|
|
33
|
+
'components': z.record(z.string(), z.unknown()).optional(),
|
|
34
|
+
/** TODO: Type these */
|
|
35
|
+
'webhooks': z.record(z.string(), z.unknown()).optional(),
|
|
36
|
+
/** A custom icon representing the collection */
|
|
37
|
+
'x-scalar-icon': z.string().optional().default('interface-content-folder'),
|
|
38
|
+
'x-scalar-active-environment': z.string().optional(),
|
|
39
|
+
'x-scalar-environments': xScalarEnvironmentsSchema.optional(),
|
|
40
|
+
'x-scalar-secrets': xScalarSecretsSchema.optional(),
|
|
41
|
+
// These properties will be stripped out and mapped back as id lists
|
|
42
|
+
// servers
|
|
43
|
+
// paths/**
|
|
44
|
+
// servers
|
|
45
|
+
// tags
|
|
46
|
+
// security
|
|
44
47
|
});
|
|
45
48
|
const extendedCollectionSchema = z.object({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
49
|
+
uid: nanoidSchema.brand(),
|
|
50
|
+
/** A list of security schemes UIDs associated with the collection */
|
|
51
|
+
securitySchemes: z.string().array().default([]),
|
|
52
|
+
/** List of currently selected security scheme UIDs, these can be overridden per request */
|
|
53
|
+
selectedSecuritySchemeUids: selectedSecuritySchemeUidSchema,
|
|
54
|
+
/** The currently selected server */
|
|
55
|
+
selectedServerUid: z.string().brand().optional(),
|
|
56
|
+
/** UIDs which refer to servers on the workspace base */
|
|
57
|
+
servers: z.string().brand().array().default([]),
|
|
58
|
+
/** Request UIDs associated with a collection */
|
|
59
|
+
requests: z.string().brand().array().default([]),
|
|
60
|
+
/** Tag UIDs associated with the collection */
|
|
61
|
+
tags: z.string().brand().array().default([]),
|
|
62
|
+
/** List of requests without tags and top level tag "folders" */
|
|
63
|
+
children: z
|
|
64
|
+
.union([z.string().brand(), z.string().brand()])
|
|
65
|
+
.array()
|
|
66
|
+
.default([]),
|
|
67
|
+
/**
|
|
68
|
+
* A link to where this document is stored
|
|
69
|
+
*
|
|
70
|
+
* - Used for watch mode
|
|
71
|
+
* - Possibly useful for Git sync down the line
|
|
72
|
+
*/
|
|
73
|
+
documentUrl: z.string().optional(),
|
|
74
|
+
/**
|
|
75
|
+
* Enables polling of OpenAPI document urls
|
|
76
|
+
*
|
|
77
|
+
* @remarks Only effective when `documentUrl` is set
|
|
78
|
+
*/
|
|
79
|
+
watchMode: z.boolean().optional().default(false),
|
|
80
|
+
/** Keeps track of which integration is associated with the specific collection */
|
|
81
|
+
integration: z.string().nullable().optional(),
|
|
82
|
+
/**
|
|
83
|
+
* Selected authentication will be set at the collection level instead of the request level
|
|
84
|
+
*
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
useCollectionSecurity: z.boolean().optional().default(false),
|
|
88
|
+
/**
|
|
89
|
+
* Status of the watcher from above
|
|
90
|
+
*
|
|
91
|
+
* @defaults to idle for all collections, doesn't mean that it can watch for changes
|
|
92
|
+
*/
|
|
93
|
+
watchModeStatus: z.enum(['IDLE', 'WATCHING', 'ERROR']).optional().default('IDLE'),
|
|
88
94
|
});
|
|
89
|
-
const collectionSchema = oasCollectionSchema.merge(extendedCollectionSchema);
|
|
90
|
-
export {
|
|
91
|
-
collectionSchema
|
|
92
|
-
};
|
|
93
|
-
//# sourceMappingURL=collection.js.map
|
|
95
|
+
export const collectionSchema = oasCollectionSchema.merge(extendedCollectionSchema);
|
|
@@ -1,59 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from
|
|
11
|
-
import { collectionSchema } from "./collection.js";
|
|
12
|
-
import {
|
|
13
|
-
operationSchema
|
|
14
|
-
} from "./operation.js";
|
|
15
|
-
import { oasParameterSchema } from "./parameters.js";
|
|
16
|
-
import {
|
|
17
|
-
createExampleFromRequest,
|
|
18
|
-
requestExampleParametersSchema,
|
|
19
|
-
requestExampleSchema
|
|
20
|
-
} from "./request-examples.js";
|
|
21
|
-
import {
|
|
22
|
-
requestSchema
|
|
23
|
-
} from "./requests.js";
|
|
24
|
-
import { serverSchema } from "./server.js";
|
|
25
|
-
import {
|
|
26
|
-
oasContactSchema,
|
|
27
|
-
oasExternalDocumentationSchema,
|
|
28
|
-
oasInfoSchema,
|
|
29
|
-
oasLicenseSchema,
|
|
30
|
-
tagSchema
|
|
31
|
-
} from "./spec-objects.js";
|
|
32
|
-
import {
|
|
33
|
-
xScalarEnvironmentsSchema
|
|
34
|
-
} from "./x-scalar-environments.js";
|
|
35
|
-
export {
|
|
36
|
-
collectionSchema,
|
|
37
|
-
createExampleFromRequest,
|
|
38
|
-
oasContactSchema,
|
|
39
|
-
oasExternalDocumentationSchema,
|
|
40
|
-
oasInfoSchema,
|
|
41
|
-
oasLicenseSchema,
|
|
42
|
-
oasParameterSchema,
|
|
43
|
-
oasSecurityRequirementSchema,
|
|
44
|
-
oasSecuritySchemeSchema,
|
|
45
|
-
operationSchema,
|
|
46
|
-
pkceOptions,
|
|
47
|
-
requestExampleParametersSchema,
|
|
48
|
-
requestExampleSchema,
|
|
49
|
-
requestSchema,
|
|
50
|
-
securityApiKeySchema,
|
|
51
|
-
securityHttpSchema,
|
|
52
|
-
securityOauthSchema,
|
|
53
|
-
securityOpenIdSchema,
|
|
54
|
-
securitySchemeSchema,
|
|
55
|
-
serverSchema,
|
|
56
|
-
tagSchema,
|
|
57
|
-
xScalarEnvironmentsSchema
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
/** Re-exported here for ease of use but we should use the other ones directly */
|
|
2
|
+
export { oasSecurityRequirementSchema, oasSecuritySchemeSchema, pkceOptions, securityApiKeySchema, securityHttpSchema, securityOauthSchema, securityOpenIdSchema, securitySchemeSchema, } from '@scalar/types/entities';
|
|
3
|
+
export { collectionSchema } from './collection.js';
|
|
4
|
+
export { operationSchema, } from './operation.js';
|
|
5
|
+
export { oasParameterSchema } from './parameters.js';
|
|
6
|
+
export { createExampleFromRequest, requestExampleParametersSchema, requestExampleSchema, } from './request-examples.js';
|
|
7
|
+
export { requestSchema, } from './requests.js';
|
|
8
|
+
export { serverSchema } from './server.js';
|
|
9
|
+
export { oasContactSchema, oasExternalDocumentationSchema, oasInfoSchema, oasLicenseSchema, tagSchema, } from './spec-objects.js';
|
|
10
|
+
export { xScalarEnvironmentsSchema, } from './x-scalar-environments.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Aliases Request to Operation which is closer to the spec,
|
|
3
|
+
* also will not conflict with the builtin Request class
|
|
4
|
+
*/
|
|
5
|
+
import { requestSchema } from './requests.js';
|
|
6
|
+
export const operationSchema = requestSchema;
|