@scalar/oas-utils 0.11.0 → 0.12.0
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 +13 -0
- package/dist/helpers/index.d.ts +0 -82
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +0 -78
- package/dist/migrations/migrate-to-indexdb.d.ts.map +1 -1
- package/dist/migrations/migrate-to-indexdb.js +1 -1
- package/dist/migrations/v-2.5.0/types.generated.d.ts +428 -34
- package/dist/migrations/v-2.5.0/types.generated.d.ts.map +1 -1
- package/package.json +8 -62
- package/dist/entities/cookie/cookie.d.ts +0 -15
- package/dist/entities/cookie/cookie.d.ts.map +0 -1
- package/dist/entities/cookie/cookie.js +0 -12
- package/dist/entities/cookie/index.d.ts +0 -2
- package/dist/entities/cookie/index.d.ts.map +0 -1
- package/dist/entities/cookie/index.js +0 -1
- package/dist/entities/environment/environment.d.ts +0 -12
- package/dist/entities/environment/environment.d.ts.map +0 -1
- package/dist/entities/environment/environment.js +0 -8
- package/dist/entities/environment/index.d.ts +0 -2
- package/dist/entities/environment/index.d.ts.map +0 -1
- package/dist/entities/environment/index.js +0 -1
- package/dist/entities/hotkeys/hotkeys.d.ts +0 -15
- package/dist/entities/hotkeys/hotkeys.d.ts.map +0 -1
- package/dist/entities/hotkeys/hotkeys.js +0 -118
- package/dist/entities/hotkeys/index.d.ts +0 -2
- package/dist/entities/hotkeys/index.d.ts.map +0 -1
- package/dist/entities/hotkeys/index.js +0 -1
- package/dist/entities/shared/index.d.ts +0 -2
- package/dist/entities/shared/index.d.ts.map +0 -1
- package/dist/entities/shared/index.js +0 -1
- package/dist/entities/shared/utility.d.ts +0 -5
- package/dist/entities/shared/utility.d.ts.map +0 -1
- package/dist/entities/shared/utility.js +0 -9
- package/dist/entities/spec/collection.d.ts +0 -133
- package/dist/entities/spec/collection.d.ts.map +0 -1
- package/dist/entities/spec/collection.js +0 -95
- package/dist/entities/spec/index.d.ts +0 -12
- package/dist/entities/spec/index.d.ts.map +0 -1
- package/dist/entities/spec/index.js +0 -10
- package/dist/entities/spec/operation.d.ts +0 -99
- package/dist/entities/spec/operation.d.ts.map +0 -1
- package/dist/entities/spec/operation.js +0 -6
- package/dist/entities/spec/parameters.d.ts +0 -44
- package/dist/entities/spec/parameters.d.ts.map +0 -1
- package/dist/entities/spec/parameters.js +0 -41
- package/dist/entities/spec/request-examples.d.ts +0 -380
- package/dist/entities/spec/request-examples.d.ts.map +0 -1
- package/dist/entities/spec/request-examples.js +0 -449
- package/dist/entities/spec/requests.d.ts +0 -137
- package/dist/entities/spec/requests.d.ts.map +0 -1
- package/dist/entities/spec/requests.js +0 -123
- package/dist/entities/spec/server.d.ts +0 -15
- package/dist/entities/spec/server.d.ts.map +0 -1
- package/dist/entities/spec/server.js +0 -67
- package/dist/entities/spec/spec-objects.d.ts +0 -171
- package/dist/entities/spec/spec-objects.d.ts.map +0 -1
- package/dist/entities/spec/spec-objects.js +0 -134
- package/dist/entities/spec/x-scalar-environments.d.ts +0 -22
- package/dist/entities/spec/x-scalar-environments.d.ts.map +0 -1
- package/dist/entities/spec/x-scalar-environments.js +0 -22
- package/dist/entities/spec/x-scalar-secrets.d.ts +0 -6
- package/dist/entities/spec/x-scalar-secrets.d.ts.map +0 -1
- package/dist/entities/spec/x-scalar-secrets.js +0 -8
- package/dist/entities/workspace/index.d.ts +0 -2
- package/dist/entities/workspace/index.d.ts.map +0 -1
- package/dist/entities/workspace/index.js +0 -1
- package/dist/entities/workspace/workspace.d.ts +0 -236
- package/dist/entities/workspace/workspace.d.ts.map +0 -1
- package/dist/entities/workspace/workspace.js +0 -49
- package/dist/helpers/fetch-document.d.ts +0 -7
- package/dist/helpers/fetch-document.d.ts.map +0 -1
- package/dist/helpers/fetch-document.js +0 -32
- package/dist/helpers/fetch-with-proxy-fallback.d.ts +0 -15
- package/dist/helpers/fetch-with-proxy-fallback.d.ts.map +0 -1
- package/dist/helpers/fetch-with-proxy-fallback.js +0 -29
- package/dist/helpers/normalize-mime-type-object.d.ts +0 -8
- package/dist/helpers/normalize-mime-type-object.d.ts.map +0 -1
- package/dist/helpers/normalize-mime-type-object.js +0 -21
- package/dist/helpers/normalize-mime-type.d.ts +0 -10
- package/dist/helpers/normalize-mime-type.d.ts.map +0 -1
- package/dist/helpers/normalize-mime-type.js +0 -12
- package/dist/helpers/operation-stability.d.ts +0 -19
- package/dist/helpers/operation-stability.d.ts.map +0 -1
- package/dist/helpers/operation-stability.js +0 -24
- package/dist/helpers/schema-model.d.ts +0 -5
- package/dist/helpers/schema-model.d.ts.map +0 -1
- package/dist/helpers/schema-model.js +0 -14
- package/dist/helpers/security/get-schemes.d.ts +0 -97
- package/dist/helpers/security/get-schemes.d.ts.map +0 -1
- package/dist/helpers/security/get-schemes.js +0 -8
- package/dist/helpers/security/has-token.d.ts +0 -4
- package/dist/helpers/security/has-token.d.ts.map +0 -1
- package/dist/helpers/security/has-token.js +0 -19
- package/dist/helpers/security/index.d.ts +0 -3
- package/dist/helpers/security/index.d.ts.map +0 -1
- package/dist/helpers/security/index.js +0 -2
- package/dist/helpers/servers.d.ts +0 -24
- package/dist/helpers/servers.d.ts.map +0 -1
- package/dist/helpers/servers.js +0 -146
- package/dist/helpers/should-ignore-entity.d.ts +0 -8
- package/dist/helpers/should-ignore-entity.d.ts.map +0 -1
- package/dist/helpers/should-ignore-entity.js +0 -4
- package/dist/migrations/generate-types.d.ts +0 -2
- package/dist/migrations/generate-types.d.ts.map +0 -1
- package/dist/migrations/generate-types.js +0 -53
- package/dist/spec-getters/get-example-from-schema.d.ts +0 -36
- package/dist/spec-getters/get-example-from-schema.d.ts.map +0 -1
- package/dist/spec-getters/get-example-from-schema.js +0 -521
- package/dist/spec-getters/get-parameters-from-operation.d.ts +0 -17
- package/dist/spec-getters/get-parameters-from-operation.d.ts.map +0 -1
- package/dist/spec-getters/get-parameters-from-operation.js +0 -40
- package/dist/spec-getters/get-request-body-from-operation.d.ts +0 -14
- package/dist/spec-getters/get-request-body-from-operation.d.ts.map +0 -1
- package/dist/spec-getters/get-request-body-from-operation.js +0 -176
- package/dist/spec-getters/get-server-variable-examples.d.ts +0 -4
- package/dist/spec-getters/get-server-variable-examples.d.ts.map +0 -1
- package/dist/spec-getters/get-server-variable-examples.js +0 -12
- package/dist/spec-getters/index.d.ts +0 -5
- package/dist/spec-getters/index.d.ts.map +0 -1
- package/dist/spec-getters/index.js +0 -4
- package/dist/transforms/import-spec.d.ts +0 -64
- package/dist/transforms/import-spec.d.ts.map +0 -1
- package/dist/transforms/import-spec.js +0 -397
- package/dist/transforms/index.d.ts +0 -2
- package/dist/transforms/index.d.ts.map +0 -1
- package/dist/transforms/index.js +0 -1
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
declare const modifiers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"Meta">, z.ZodLiteral<"Control">, z.ZodLiteral<"Shift">, z.ZodLiteral<"Alt">, z.ZodLiteral<"default">]>>>>;
|
|
3
|
-
export type HotKeyModifiers = z.infer<typeof modifiers>;
|
|
4
|
-
declare const hotKeys: z.ZodRecord<z.ZodEnum<{
|
|
5
|
-
"": "";
|
|
6
|
-
Space: "Space";
|
|
7
|
-
Backspace: "Backspace";
|
|
8
|
-
Tab: "Tab";
|
|
9
|
-
Enter: "Enter";
|
|
10
|
-
Escape: "Escape";
|
|
11
|
-
ArrowDown: "ArrowDown";
|
|
12
|
-
ArrowLeft: "ArrowLeft";
|
|
13
|
-
ArrowRight: "ArrowRight";
|
|
14
|
-
ArrowUp: "ArrowUp";
|
|
15
|
-
End: "End";
|
|
16
|
-
Home: "Home";
|
|
17
|
-
PageDown: "PageDown";
|
|
18
|
-
PageUp: "PageUp";
|
|
19
|
-
Delete: "Delete";
|
|
20
|
-
0: "0";
|
|
21
|
-
1: "1";
|
|
22
|
-
2: "2";
|
|
23
|
-
3: "3";
|
|
24
|
-
4: "4";
|
|
25
|
-
5: "5";
|
|
26
|
-
6: "6";
|
|
27
|
-
7: "7";
|
|
28
|
-
8: "8";
|
|
29
|
-
9: "9";
|
|
30
|
-
a: "a";
|
|
31
|
-
b: "b";
|
|
32
|
-
c: "c";
|
|
33
|
-
d: "d";
|
|
34
|
-
e: "e";
|
|
35
|
-
f: "f";
|
|
36
|
-
g: "g";
|
|
37
|
-
h: "h";
|
|
38
|
-
i: "i";
|
|
39
|
-
j: "j";
|
|
40
|
-
k: "k";
|
|
41
|
-
l: "l";
|
|
42
|
-
m: "m";
|
|
43
|
-
n: "n";
|
|
44
|
-
o: "o";
|
|
45
|
-
p: "p";
|
|
46
|
-
q: "q";
|
|
47
|
-
r: "r";
|
|
48
|
-
s: "s";
|
|
49
|
-
t: "t";
|
|
50
|
-
u: "u";
|
|
51
|
-
v: "v";
|
|
52
|
-
w: "w";
|
|
53
|
-
x: "x";
|
|
54
|
-
y: "y";
|
|
55
|
-
z: "z";
|
|
56
|
-
"*": "*";
|
|
57
|
-
"+": "+";
|
|
58
|
-
"-": "-";
|
|
59
|
-
".": ".";
|
|
60
|
-
"/": "/";
|
|
61
|
-
F1: "F1";
|
|
62
|
-
F2: "F2";
|
|
63
|
-
F3: "F3";
|
|
64
|
-
F4: "F4";
|
|
65
|
-
F5: "F5";
|
|
66
|
-
F6: "F6";
|
|
67
|
-
F7: "F7";
|
|
68
|
-
F8: "F8";
|
|
69
|
-
F9: "F9";
|
|
70
|
-
F10: "F10";
|
|
71
|
-
F11: "F11";
|
|
72
|
-
F12: "F12";
|
|
73
|
-
";": ";";
|
|
74
|
-
"=": "=";
|
|
75
|
-
",": ",";
|
|
76
|
-
"`": "`";
|
|
77
|
-
"[": "[";
|
|
78
|
-
"\\": "\\";
|
|
79
|
-
"]": "]";
|
|
80
|
-
}> & z.core.$partial, z.ZodObject<{
|
|
81
|
-
modifiers: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"Meta">, z.ZodLiteral<"Control">, z.ZodLiteral<"Shift">, z.ZodLiteral<"Alt">, z.ZodLiteral<"default">]>>>>>;
|
|
82
|
-
event: z.ZodEnum<{
|
|
83
|
-
addTopNav: "addTopNav";
|
|
84
|
-
closeModal: "closeModal";
|
|
85
|
-
closeTopNav: "closeTopNav";
|
|
86
|
-
createNew: "createNew";
|
|
87
|
-
executeRequest: "executeRequest";
|
|
88
|
-
focusAddressBar: "focusAddressBar";
|
|
89
|
-
focusRequestSearch: "focusRequestSearch";
|
|
90
|
-
jumpToLastTab: "jumpToLastTab";
|
|
91
|
-
jumpToTab: "jumpToTab";
|
|
92
|
-
navigateSearchResultsDown: "navigateSearchResultsDown";
|
|
93
|
-
navigateSearchResultsUp: "navigateSearchResultsUp";
|
|
94
|
-
navigateTopNavLeft: "navigateTopNavLeft";
|
|
95
|
-
navigateTopNavRight: "navigateTopNavRight";
|
|
96
|
-
openCommandPalette: "openCommandPalette";
|
|
97
|
-
selectSearchResult: "selectSearchResult";
|
|
98
|
-
toggleSidebar: "toggleSidebar";
|
|
99
|
-
}>;
|
|
100
|
-
}, z.core.$strip>>;
|
|
101
|
-
export type HotKeyConfig = z.infer<typeof hotKeys>;
|
|
102
|
-
export declare const workspaceSchema: z.ZodObject<{
|
|
103
|
-
uid: z.core.$ZodBranded<z.ZodDefault<z.ZodString>, "workspace", "out">;
|
|
104
|
-
name: z.ZodDefault<z.ZodString>;
|
|
105
|
-
description: z.ZodDefault<z.ZodString>;
|
|
106
|
-
collections: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "collection", "out">>>;
|
|
107
|
-
environments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
108
|
-
hotKeyConfig: z.ZodOptional<z.ZodObject<{
|
|
109
|
-
modifiers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"Meta">, z.ZodLiteral<"Control">, z.ZodLiteral<"Shift">, z.ZodLiteral<"Alt">, z.ZodLiteral<"default">]>>>>;
|
|
110
|
-
hotKeys: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
111
|
-
"": "";
|
|
112
|
-
Space: "Space";
|
|
113
|
-
Backspace: "Backspace";
|
|
114
|
-
Tab: "Tab";
|
|
115
|
-
Enter: "Enter";
|
|
116
|
-
Escape: "Escape";
|
|
117
|
-
ArrowDown: "ArrowDown";
|
|
118
|
-
ArrowLeft: "ArrowLeft";
|
|
119
|
-
ArrowRight: "ArrowRight";
|
|
120
|
-
ArrowUp: "ArrowUp";
|
|
121
|
-
End: "End";
|
|
122
|
-
Home: "Home";
|
|
123
|
-
PageDown: "PageDown";
|
|
124
|
-
PageUp: "PageUp";
|
|
125
|
-
Delete: "Delete";
|
|
126
|
-
0: "0";
|
|
127
|
-
1: "1";
|
|
128
|
-
2: "2";
|
|
129
|
-
3: "3";
|
|
130
|
-
4: "4";
|
|
131
|
-
5: "5";
|
|
132
|
-
6: "6";
|
|
133
|
-
7: "7";
|
|
134
|
-
8: "8";
|
|
135
|
-
9: "9";
|
|
136
|
-
a: "a";
|
|
137
|
-
b: "b";
|
|
138
|
-
c: "c";
|
|
139
|
-
d: "d";
|
|
140
|
-
e: "e";
|
|
141
|
-
f: "f";
|
|
142
|
-
g: "g";
|
|
143
|
-
h: "h";
|
|
144
|
-
i: "i";
|
|
145
|
-
j: "j";
|
|
146
|
-
k: "k";
|
|
147
|
-
l: "l";
|
|
148
|
-
m: "m";
|
|
149
|
-
n: "n";
|
|
150
|
-
o: "o";
|
|
151
|
-
p: "p";
|
|
152
|
-
q: "q";
|
|
153
|
-
r: "r";
|
|
154
|
-
s: "s";
|
|
155
|
-
t: "t";
|
|
156
|
-
u: "u";
|
|
157
|
-
v: "v";
|
|
158
|
-
w: "w";
|
|
159
|
-
x: "x";
|
|
160
|
-
y: "y";
|
|
161
|
-
z: "z";
|
|
162
|
-
"*": "*";
|
|
163
|
-
"+": "+";
|
|
164
|
-
"-": "-";
|
|
165
|
-
".": ".";
|
|
166
|
-
"/": "/";
|
|
167
|
-
F1: "F1";
|
|
168
|
-
F2: "F2";
|
|
169
|
-
F3: "F3";
|
|
170
|
-
F4: "F4";
|
|
171
|
-
F5: "F5";
|
|
172
|
-
F6: "F6";
|
|
173
|
-
F7: "F7";
|
|
174
|
-
F8: "F8";
|
|
175
|
-
F9: "F9";
|
|
176
|
-
F10: "F10";
|
|
177
|
-
F11: "F11";
|
|
178
|
-
F12: "F12";
|
|
179
|
-
";": ";";
|
|
180
|
-
"=": "=";
|
|
181
|
-
",": ",";
|
|
182
|
-
"`": "`";
|
|
183
|
-
"[": "[";
|
|
184
|
-
"\\": "\\";
|
|
185
|
-
"]": "]";
|
|
186
|
-
}> & z.core.$partial, z.ZodObject<{
|
|
187
|
-
modifiers: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"Meta">, z.ZodLiteral<"Control">, z.ZodLiteral<"Shift">, z.ZodLiteral<"Alt">, z.ZodLiteral<"default">]>>>>>;
|
|
188
|
-
event: z.ZodEnum<{
|
|
189
|
-
addTopNav: "addTopNav";
|
|
190
|
-
closeModal: "closeModal";
|
|
191
|
-
closeTopNav: "closeTopNav";
|
|
192
|
-
createNew: "createNew";
|
|
193
|
-
executeRequest: "executeRequest";
|
|
194
|
-
focusAddressBar: "focusAddressBar";
|
|
195
|
-
focusRequestSearch: "focusRequestSearch";
|
|
196
|
-
jumpToLastTab: "jumpToLastTab";
|
|
197
|
-
jumpToTab: "jumpToTab";
|
|
198
|
-
navigateSearchResultsDown: "navigateSearchResultsDown";
|
|
199
|
-
navigateSearchResultsUp: "navigateSearchResultsUp";
|
|
200
|
-
navigateTopNavLeft: "navigateTopNavLeft";
|
|
201
|
-
navigateTopNavRight: "navigateTopNavRight";
|
|
202
|
-
openCommandPalette: "openCommandPalette";
|
|
203
|
-
selectSearchResult: "selectSearchResult";
|
|
204
|
-
toggleSidebar: "toggleSidebar";
|
|
205
|
-
}>;
|
|
206
|
-
}, z.core.$strip>>>;
|
|
207
|
-
}, z.core.$strip>>;
|
|
208
|
-
activeEnvironmentId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
209
|
-
cookies: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "cookie", "out">>>;
|
|
210
|
-
proxyUrl: z.ZodOptional<z.ZodString>;
|
|
211
|
-
themeId: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
212
|
-
default: "default";
|
|
213
|
-
alternate: "alternate";
|
|
214
|
-
moon: "moon";
|
|
215
|
-
purple: "purple";
|
|
216
|
-
solarized: "solarized";
|
|
217
|
-
bluePlanet: "bluePlanet";
|
|
218
|
-
deepSpace: "deepSpace";
|
|
219
|
-
saturn: "saturn";
|
|
220
|
-
kepler: "kepler";
|
|
221
|
-
elysiajs: "elysiajs";
|
|
222
|
-
fastify: "fastify";
|
|
223
|
-
mars: "mars";
|
|
224
|
-
laserwave: "laserwave";
|
|
225
|
-
none: "none";
|
|
226
|
-
}>>>>;
|
|
227
|
-
selectedHttpClient: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
228
|
-
targetKey: z.ZodString;
|
|
229
|
-
clientKey: z.ZodString;
|
|
230
|
-
}, z.core.$strip>>>;
|
|
231
|
-
}, z.core.$strip>;
|
|
232
|
-
/** The base scalar workspace */
|
|
233
|
-
export type Workspace = z.infer<typeof workspaceSchema>;
|
|
234
|
-
export type WorkspacePayload = z.input<typeof workspaceSchema>;
|
|
235
|
-
export {};
|
|
236
|
-
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../../src/entities/workspace/workspace.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,QAAA,MAAM,SAAS,oLAGQ,CAAA;AAEvB,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvD,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAMZ,CAAA;AACD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAA;AASlD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8B1B,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,49 +0,0 @@
|
|
|
1
|
-
import { themeIds } from '@scalar/themes';
|
|
2
|
-
import { nanoidSchema } from '@scalar/types/utils';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
import { HOTKEY_EVENT_NAMES, KEYDOWN_KEYS } from '../hotkeys/hotkeys.js';
|
|
5
|
-
const modifiers = z
|
|
6
|
-
.array(z.union([z.literal('Meta'), z.literal('Control'), z.literal('Shift'), z.literal('Alt'), z.literal('default')]))
|
|
7
|
-
.optional()
|
|
8
|
-
.default(['default']);
|
|
9
|
-
const hotKeys = z.partialRecord(z.enum(KEYDOWN_KEYS), z.object({
|
|
10
|
-
modifiers: modifiers.optional(),
|
|
11
|
-
event: z.enum(HOTKEY_EVENT_NAMES),
|
|
12
|
-
}));
|
|
13
|
-
const hotKeyConfigSchema = z
|
|
14
|
-
.object({
|
|
15
|
-
modifiers,
|
|
16
|
-
hotKeys: hotKeys.optional(),
|
|
17
|
-
})
|
|
18
|
-
.optional();
|
|
19
|
-
export const workspaceSchema = z.object({
|
|
20
|
-
uid: nanoidSchema.brand(),
|
|
21
|
-
name: z.string().default('Default Workspace'),
|
|
22
|
-
/** Workspace description */
|
|
23
|
-
description: z.string().default('Basic Scalar Workspace'),
|
|
24
|
-
/** List of all collection uids in a given workspace */
|
|
25
|
-
collections: z.array(z.string().brand()).default([]),
|
|
26
|
-
/** List of all environment uids in a given workspace, TODO: why is this a record? */
|
|
27
|
-
environments: z.record(z.string(), z.string()).default({}),
|
|
28
|
-
/** Customize hotkeys */
|
|
29
|
-
hotKeyConfig: hotKeyConfigSchema,
|
|
30
|
-
/** Active Environment ID to use for requests */
|
|
31
|
-
activeEnvironmentId: z.string().optional().default('default'),
|
|
32
|
-
/** List of all cookie uids in a given workspace */
|
|
33
|
-
cookies: z.array(z.string().brand()).default([]),
|
|
34
|
-
/** Workspace level proxy for all requests to be sent through */
|
|
35
|
-
proxyUrl: z.string().optional(),
|
|
36
|
-
/** Workspace level theme, we might move this to user level later */
|
|
37
|
-
themeId: z.enum(themeIds).optional().default('default').catch('default'),
|
|
38
|
-
/** Currently selected snippet client */
|
|
39
|
-
selectedHttpClient: z
|
|
40
|
-
.object({
|
|
41
|
-
targetKey: z.string(),
|
|
42
|
-
clientKey: z.string(),
|
|
43
|
-
})
|
|
44
|
-
.optional()
|
|
45
|
-
.default({
|
|
46
|
-
targetKey: 'shell',
|
|
47
|
-
clientKey: 'curl',
|
|
48
|
-
}),
|
|
49
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fetches an OpenAPI/Swagger document from a given URL
|
|
3
|
-
*
|
|
4
|
-
* @throws an error if the fetch fails
|
|
5
|
-
*/
|
|
6
|
-
export declare function fetchDocument(url: string, proxyUrl?: string, fetcher?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>, prettyPrint?: boolean): Promise<string>;
|
|
7
|
-
//# sourceMappingURL=fetch-document.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-document.d.ts","sourceRoot":"","sources":["../../src/helpers/fetch-document.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,EAC7F,WAAW,UAAO,GACjB,OAAO,CAAC,MAAM,CAAC,CA4BjB"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { redirectToProxy } from '@scalar/helpers/url/redirect-to-proxy';
|
|
2
|
-
import { formatJsonOrYamlString } from './parse.js';
|
|
3
|
-
// Doesn't work
|
|
4
|
-
const OLD_PROXY_URL = 'https://api.scalar.com/request-proxy';
|
|
5
|
-
// Does work
|
|
6
|
-
const NEW_PROXY_URL = 'https://proxy.scalar.com';
|
|
7
|
-
/**
|
|
8
|
-
* Fetches an OpenAPI/Swagger document from a given URL
|
|
9
|
-
*
|
|
10
|
-
* @throws an error if the fetch fails
|
|
11
|
-
*/
|
|
12
|
-
export async function fetchDocument(url, proxyUrl, fetcher, prettyPrint = true) {
|
|
13
|
-
// This replaces the OLD_PROXY_URL with the NEW_PROXY_URL on the fly.
|
|
14
|
-
if (proxyUrl === OLD_PROXY_URL) {
|
|
15
|
-
// biome-ignore lint/style/noParameterAssign: It's ok, let's make an exception here.
|
|
16
|
-
proxyUrl = NEW_PROXY_URL;
|
|
17
|
-
}
|
|
18
|
-
const response = await (fetcher ? fetcher(url, undefined) : fetch(redirectToProxy(proxyUrl, url)));
|
|
19
|
-
// Looks like the request failed
|
|
20
|
-
if (response.status !== 200) {
|
|
21
|
-
console.error(`[fetchDocument] Failed to fetch the OpenAPI document from ${url} (Status: ${response.status})`);
|
|
22
|
-
if (!proxyUrl) {
|
|
23
|
-
console.warn(`[fetchDocument] Tried to fetch the OpenAPI document from ${url} without a proxy. Are the CORS headers configured to allow cross-domain requests? https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS`);
|
|
24
|
-
}
|
|
25
|
-
throw new Error(`Failed to fetch the OpenAPI document from ${url} (Status: ${response.status})`);
|
|
26
|
-
}
|
|
27
|
-
// If it's JSON, make it pretty
|
|
28
|
-
if (prettyPrint) {
|
|
29
|
-
return formatJsonOrYamlString(await response.text());
|
|
30
|
-
}
|
|
31
|
-
return await response.text();
|
|
32
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type FetchWithProxyFallbackOptions = {
|
|
2
|
-
proxyUrl: string | undefined;
|
|
3
|
-
/**
|
|
4
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Request/cache
|
|
5
|
-
*/
|
|
6
|
-
cache?: RequestInit['cache'];
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Fetches an OpenAPI document with a proxyUrl fallback mechanism.
|
|
10
|
-
*
|
|
11
|
-
* If a proxy is provided and the URL requires it, it will first attempt to fetch using the proxy.
|
|
12
|
-
* If the proxy fetch fails or is not used, it will fall back to a direct fetch.
|
|
13
|
-
*/
|
|
14
|
-
export declare function fetchWithProxyFallback(url: string, { proxyUrl, cache }: FetchWithProxyFallbackOptions): Promise<Response>;
|
|
15
|
-
//# sourceMappingURL=fetch-with-proxy-fallback.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-with-proxy-fallback.d.ts","sourceRoot":"","sources":["../../src/helpers/fetch-with-proxy-fallback.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;CAC7B,CAAA;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,6BAA6B,qBAuB3G"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { redirectToProxy, shouldUseProxy } from '@scalar/helpers/url/redirect-to-proxy';
|
|
2
|
-
/**
|
|
3
|
-
* Fetches an OpenAPI document with a proxyUrl fallback mechanism.
|
|
4
|
-
*
|
|
5
|
-
* If a proxy is provided and the URL requires it, it will first attempt to fetch using the proxy.
|
|
6
|
-
* If the proxy fetch fails or is not used, it will fall back to a direct fetch.
|
|
7
|
-
*/
|
|
8
|
-
export async function fetchWithProxyFallback(url, { proxyUrl, cache }) {
|
|
9
|
-
const fetchOptions = {
|
|
10
|
-
cache: cache || 'default',
|
|
11
|
-
};
|
|
12
|
-
const shouldTryProxy = shouldUseProxy(proxyUrl, url);
|
|
13
|
-
const initialUrl = shouldTryProxy ? redirectToProxy(proxyUrl, url) : url;
|
|
14
|
-
try {
|
|
15
|
-
const result = await fetch(initialUrl, fetchOptions);
|
|
16
|
-
if (result.ok || !shouldTryProxy) {
|
|
17
|
-
return result;
|
|
18
|
-
}
|
|
19
|
-
// Retry without proxyUrl if the initial request failed
|
|
20
|
-
return await fetch(url, fetchOptions);
|
|
21
|
-
}
|
|
22
|
-
catch (error) {
|
|
23
|
-
if (shouldTryProxy) {
|
|
24
|
-
// If proxyUrl failed, try without it
|
|
25
|
-
return await fetch(url, fetchOptions);
|
|
26
|
-
}
|
|
27
|
-
throw error;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ResponseObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
-
/**
|
|
3
|
-
* Remove charset from content types
|
|
4
|
-
*
|
|
5
|
-
* Example: `application/json; charset=utf-8` -> `application/json`
|
|
6
|
-
*/
|
|
7
|
-
export declare function normalizeMimeTypeObject(content?: ResponseObject['content']): ResponseObject['content'];
|
|
8
|
-
//# sourceMappingURL=normalize-mime-type-object.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-mime-type-object.d.ts","sourceRoot":"","sources":["../../src/helpers/normalize-mime-type-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAA;AAGlG;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,cAAc,CAAC,SAAS,CAAC,CAiBtG"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { normalizeMimeType } from './normalize-mime-type.js';
|
|
2
|
-
/**
|
|
3
|
-
* Remove charset from content types
|
|
4
|
-
*
|
|
5
|
-
* Example: `application/json; charset=utf-8` -> `application/json`
|
|
6
|
-
*/
|
|
7
|
-
export function normalizeMimeTypeObject(content) {
|
|
8
|
-
if (!content) {
|
|
9
|
-
return content;
|
|
10
|
-
}
|
|
11
|
-
const newContent = {
|
|
12
|
-
...content,
|
|
13
|
-
};
|
|
14
|
-
Object.entries(newContent).forEach(([key, value]) => {
|
|
15
|
-
const normalizedKey = normalizeMimeType(key);
|
|
16
|
-
if (normalizedKey) {
|
|
17
|
-
newContent[normalizedKey] = value;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
return newContent;
|
|
21
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ContentType } from '@scalar/types/legacy';
|
|
2
|
-
/**
|
|
3
|
-
* Normalizes a MIME type to a standard format.
|
|
4
|
-
*
|
|
5
|
-
* Input: application/problem+json; charset=utf-8
|
|
6
|
-
* Output: application/json
|
|
7
|
-
*/
|
|
8
|
-
export declare function normalizeMimeType(contentType: undefined): undefined;
|
|
9
|
-
export declare function normalizeMimeType(contentType: string): ContentType;
|
|
10
|
-
//# sourceMappingURL=normalize-mime-type.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-mime-type.d.ts","sourceRoot":"","sources":["../../src/helpers/normalize-mime-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAEvD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,SAAS,GAAG,SAAS,CAAA;AACpE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export function normalizeMimeType(contentType) {
|
|
2
|
-
if (typeof contentType !== 'string') {
|
|
3
|
-
return undefined;
|
|
4
|
-
}
|
|
5
|
-
return contentType
|
|
6
|
-
// Remove '; charset=utf-8'
|
|
7
|
-
.replace(/;.*$/, '')
|
|
8
|
-
// Remove 'problem+' but keep vendor-specific vnd and fhir mime types
|
|
9
|
-
.replace(/\/(?!.*vnd\.|fhir\+).*\+/, '/')
|
|
10
|
-
// Remove whitespace
|
|
11
|
-
.trim();
|
|
12
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { XScalarStability } from '@scalar/types/legacy';
|
|
2
|
-
type OperationStability = {
|
|
3
|
-
deprecated?: boolean;
|
|
4
|
-
'x-scalar-stability'?: unknown;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Returns true if an operation is considered deprecated.
|
|
8
|
-
*/
|
|
9
|
-
export declare const isOperationDeprecated: (operation: OperationStability) => boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Get operation stability from deprecated or x-scalar-stability
|
|
12
|
-
*/
|
|
13
|
-
export declare const getOperationStability: (operation: OperationStability) => XScalarStability | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Get Operation stability tailwind color class
|
|
16
|
-
*/
|
|
17
|
-
export declare const getOperationStabilityColor: (operation: OperationStability) => string;
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=operation-stability.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operation-stability.d.ts","sourceRoot":"","sources":["../../src/helpers/operation-stability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEvD,KAAK,kBAAkB,GAAG;IACxB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,WAAW,kBAAkB,KAAG,OACmB,CAAA;AAEzF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,WAAW,kBAAkB,KAAG,gBAAgB,GAAG,SAC+B,CAAA;AAExH;;GAEG;AACH,eAAO,MAAM,0BAA0B,GAAI,WAAW,kBAAkB,KAAG,MAW1E,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { XScalarStability } from '@scalar/types/legacy';
|
|
2
|
-
/**
|
|
3
|
-
* Returns true if an operation is considered deprecated.
|
|
4
|
-
*/
|
|
5
|
-
export const isOperationDeprecated = (operation) => operation.deprecated || operation['x-scalar-stability'] === XScalarStability.Deprecated;
|
|
6
|
-
/**
|
|
7
|
-
* Get operation stability from deprecated or x-scalar-stability
|
|
8
|
-
*/
|
|
9
|
-
export const getOperationStability = (operation) => operation.deprecated ? XScalarStability.Deprecated : operation['x-scalar-stability'];
|
|
10
|
-
/**
|
|
11
|
-
* Get Operation stability tailwind color class
|
|
12
|
-
*/
|
|
13
|
-
export const getOperationStabilityColor = (operation) => {
|
|
14
|
-
switch (getOperationStability(operation)) {
|
|
15
|
-
case XScalarStability.Deprecated:
|
|
16
|
-
return 'text-red';
|
|
17
|
-
case XScalarStability.Experimental:
|
|
18
|
-
return 'text-orange';
|
|
19
|
-
case XScalarStability.Stable:
|
|
20
|
-
return 'text-green';
|
|
21
|
-
default:
|
|
22
|
-
return '';
|
|
23
|
-
}
|
|
24
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type z from 'zod';
|
|
2
|
-
/** Parse an value from a given schema with optional error or null return */
|
|
3
|
-
export declare function schemaModel<T extends z.ZodType, I = any>(data: I, schema: T, throwError?: true, errorLocation?: string): z.infer<T>;
|
|
4
|
-
export declare function schemaModel<T, I = any>(data: I, schema: T, throwError?: false, errorLocation?: string): z.infer<T> | null;
|
|
5
|
-
//# sourceMappingURL=schema-model.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema-model.d.ts","sourceRoot":"","sources":["../../src/helpers/schema-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,4EAA4E;AAC5E,wBAAgB,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,GAAG,EACtD,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,CAAC,EACT,UAAU,CAAC,EAAE,IAAI,EACjB,aAAa,CAAC,EAAE,MAAM,GACrB,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACb,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,EACpC,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,CAAC,EACT,UAAU,CAAC,EAAE,KAAK,EAClB,aAAa,CAAC,EAAE,MAAM,GACrB,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** Parse a Zod */
|
|
2
|
-
export function schemaModel(data, schema, throwError = true, errorLocation) {
|
|
3
|
-
const result = schema.safeParse(data);
|
|
4
|
-
if (!result.success) {
|
|
5
|
-
console.group('Schema Error' + (errorLocation ? ` - ${errorLocation}` : ''));
|
|
6
|
-
console.warn(JSON.stringify(result.error.format(), null, 2));
|
|
7
|
-
console.log('Received: ', data);
|
|
8
|
-
console.groupEnd();
|
|
9
|
-
}
|
|
10
|
-
if (throwError && !result.success) {
|
|
11
|
-
throw new Error('Zod validation failure');
|
|
12
|
-
}
|
|
13
|
-
return result.data;
|
|
14
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import type { SecurityScheme } from '@scalar/types/entities';
|
|
2
|
-
import type { Operation } from '../../entities/spec/operation.js';
|
|
3
|
-
/** Parses a list of selected security scheme uids which may be an array or single uid and returns a flattened array of security schemes */
|
|
4
|
-
export declare const getSchemes: (selectedSecuritySchemes: Operation["selectedSecuritySchemeUids"], securitySchemes: Record<SecurityScheme["uid"], SecurityScheme>) => NonNullable<{
|
|
5
|
-
type: "apiKey";
|
|
6
|
-
name: string;
|
|
7
|
-
in: "cookie" | "query" | "header";
|
|
8
|
-
uid: string & import("zod").$brand<"securityScheme">;
|
|
9
|
-
nameKey: string;
|
|
10
|
-
value: string;
|
|
11
|
-
description?: string | undefined;
|
|
12
|
-
} | {
|
|
13
|
-
type: "http";
|
|
14
|
-
scheme: "basic" | "bearer";
|
|
15
|
-
bearerFormat: string;
|
|
16
|
-
uid: string & import("zod").$brand<"securityScheme">;
|
|
17
|
-
nameKey: string;
|
|
18
|
-
username: string;
|
|
19
|
-
password: string;
|
|
20
|
-
token: string;
|
|
21
|
-
description?: string | undefined;
|
|
22
|
-
} | {
|
|
23
|
-
type: "openIdConnect";
|
|
24
|
-
openIdConnectUrl: string;
|
|
25
|
-
uid: string & import("zod").$brand<"securityScheme">;
|
|
26
|
-
nameKey: string;
|
|
27
|
-
description?: string | undefined;
|
|
28
|
-
} | {
|
|
29
|
-
type: "oauth2";
|
|
30
|
-
flows: {
|
|
31
|
-
implicit?: {
|
|
32
|
-
refreshUrl: string;
|
|
33
|
-
scopes: Record<string, string>;
|
|
34
|
-
selectedScopes: string[];
|
|
35
|
-
"x-scalar-client-id": string;
|
|
36
|
-
token: string;
|
|
37
|
-
type: "implicit";
|
|
38
|
-
authorizationUrl: string;
|
|
39
|
-
"x-scalar-redirect-uri": string;
|
|
40
|
-
"x-scalar-security-query"?: Record<string, string> | undefined;
|
|
41
|
-
"x-scalar-security-body"?: Record<string, string> | undefined;
|
|
42
|
-
"x-tokenName"?: string | undefined;
|
|
43
|
-
} | undefined;
|
|
44
|
-
password?: {
|
|
45
|
-
refreshUrl: string;
|
|
46
|
-
scopes: Record<string, string>;
|
|
47
|
-
selectedScopes: string[];
|
|
48
|
-
"x-scalar-client-id": string;
|
|
49
|
-
token: string;
|
|
50
|
-
type: "password";
|
|
51
|
-
tokenUrl: string;
|
|
52
|
-
clientSecret: string;
|
|
53
|
-
username: string;
|
|
54
|
-
password: string;
|
|
55
|
-
"x-scalar-security-query"?: Record<string, string> | undefined;
|
|
56
|
-
"x-scalar-security-body"?: Record<string, string> | undefined;
|
|
57
|
-
"x-tokenName"?: string | undefined;
|
|
58
|
-
"x-scalar-credentials-location"?: "header" | "body" | undefined;
|
|
59
|
-
} | undefined;
|
|
60
|
-
clientCredentials?: {
|
|
61
|
-
refreshUrl: string;
|
|
62
|
-
scopes: Record<string, string>;
|
|
63
|
-
selectedScopes: string[];
|
|
64
|
-
"x-scalar-client-id": string;
|
|
65
|
-
token: string;
|
|
66
|
-
type: "clientCredentials";
|
|
67
|
-
tokenUrl: string;
|
|
68
|
-
clientSecret: string;
|
|
69
|
-
"x-scalar-security-query"?: Record<string, string> | undefined;
|
|
70
|
-
"x-scalar-security-body"?: Record<string, string> | undefined;
|
|
71
|
-
"x-tokenName"?: string | undefined;
|
|
72
|
-
"x-scalar-credentials-location"?: "header" | "body" | undefined;
|
|
73
|
-
} | undefined;
|
|
74
|
-
authorizationCode?: {
|
|
75
|
-
refreshUrl: string;
|
|
76
|
-
scopes: Record<string, string>;
|
|
77
|
-
selectedScopes: string[];
|
|
78
|
-
"x-scalar-client-id": string;
|
|
79
|
-
token: string;
|
|
80
|
-
type: "authorizationCode";
|
|
81
|
-
authorizationUrl: string;
|
|
82
|
-
"x-usePkce": "SHA-256" | "plain" | "no";
|
|
83
|
-
"x-scalar-redirect-uri": string;
|
|
84
|
-
tokenUrl: string;
|
|
85
|
-
clientSecret: string;
|
|
86
|
-
"x-scalar-security-query"?: Record<string, string> | undefined;
|
|
87
|
-
"x-scalar-security-body"?: Record<string, string> | undefined;
|
|
88
|
-
"x-tokenName"?: string | undefined;
|
|
89
|
-
"x-scalar-credentials-location"?: "header" | "body" | undefined;
|
|
90
|
-
} | undefined;
|
|
91
|
-
};
|
|
92
|
-
uid: string & import("zod").$brand<"securityScheme">;
|
|
93
|
-
nameKey: string;
|
|
94
|
-
description?: string | undefined;
|
|
95
|
-
'x-default-scopes'?: string[] | undefined;
|
|
96
|
-
}>[];
|
|
97
|
-
//# sourceMappingURL=get-schemes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-schemes.d.ts","sourceRoot":"","sources":["../../../src/helpers/security/get-schemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAG5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAE1D,2IAA2I;AAC3I,eAAO,MAAM,UAAU,GACrB,yBAAyB,SAAS,CAAC,4BAA4B,CAAC,EAChE,iBAAiB,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAOg1mB,CAAC;;;;;;;;;qCAAiV,CAAC;oCAA0E,CAAC;yBAA+D,CAAC;;gBAA6D,CAAC;;;;;;;;;;;qCAA0X,CAAC;oCAA0E,CAAC;yBAA+D,CAAC;2CAAiE,CAAC;;yBAAiF,CAAC;;;;;;;;;qCAAuU,CAAC;oCAA0E,CAAC;yBAA+D,CAAC;2CAAiE,CAAC;;yBAAiF,CAAC;;;;;;;;;;;;qCAA+c,CAAC;oCAA0E,CAAC;yBAA+D,CAAC;2CAAiE,CAAC;;;;;;;IADz0rB,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { isDefined } from '@scalar/helpers/array/is-defined';
|
|
2
|
-
/** Parses a list of selected security scheme uids which may be an array or single uid and returns a flattened array of security schemes */
|
|
3
|
-
export const getSchemes = (selectedSecuritySchemes, securitySchemes) => {
|
|
4
|
-
const uids = new Set(selectedSecuritySchemes.flat());
|
|
5
|
-
return Array.from(uids)
|
|
6
|
-
.map((uid) => securitySchemes[uid])
|
|
7
|
-
.filter(isDefined);
|
|
8
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { SecurityScheme } from '@scalar/types/entities';
|
|
2
|
-
/** Pass in a security scheme and it will return true if it has a token or value depending on the scheme type */
|
|
3
|
-
export declare const hasToken: (scheme: SecurityScheme) => Boolean;
|
|
4
|
-
//# sourceMappingURL=has-token.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"has-token.d.ts","sourceRoot":"","sources":["../../../src/helpers/security/has-token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,gHAAgH;AAChH,eAAO,MAAM,QAAQ,GAAI,QAAQ,cAAc,KAAG,OAwBjD,CAAA"}
|