@scalar/types 0.1.2 → 0.1.4
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 +15 -0
- package/dist/api-reference/api-reference-configuration.d.ts +37 -737
- package/dist/api-reference/api-reference-configuration.d.ts.map +1 -1
- package/dist/api-reference/api-reference-configuration.js +3 -7
- package/dist/api-reference/authentication-configuration.d.ts +53 -0
- package/dist/api-reference/authentication-configuration.d.ts.map +1 -0
- package/dist/api-reference/authentication-configuration.test-d.d.ts +2 -0
- package/dist/api-reference/authentication-configuration.test-d.d.ts.map +1 -0
- package/dist/api-reference/index.d.ts +1 -1
- package/dist/api-reference/index.d.ts.map +1 -1
- package/dist/api-reference/index.js +1 -1
- package/dist/entities/index.d.ts +2 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +1 -0
- package/dist/entities/security-scheme.d.ts +1436 -0
- package/dist/entities/security-scheme.d.ts.map +1 -0
- package/dist/entities/security-scheme.js +179 -0
- package/dist/legacy/reference-config.d.ts +15 -19
- package/dist/legacy/reference-config.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/nanoid.d.ts +18 -0
- package/dist/utils/nanoid.d.ts.map +1 -0
- package/dist/utils/nanoid.js +11 -0
- package/package.json +8 -1
|
@@ -0,0 +1,1436 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const securitySchemeApiKeyIn: readonly ["query", "header", "cookie"];
|
|
3
|
+
export declare const securityApiKeySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
4
|
+
description: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, {
|
|
6
|
+
type: z.ZodLiteral<"apiKey">;
|
|
7
|
+
/** REQUIRED. The name of the header, query or cookie parameter to be used. */
|
|
8
|
+
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
9
|
+
/** REQUIRED. The location of the API key. Valid values are "query", "header" or "cookie". */
|
|
10
|
+
in: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<["query", "header", "cookie"]>>>>;
|
|
11
|
+
}>, {
|
|
12
|
+
uid: z.ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
|
|
13
|
+
/** The name key that links a security requirement to a security object */
|
|
14
|
+
nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
15
|
+
}>, {
|
|
16
|
+
value: z.ZodDefault<z.ZodString>;
|
|
17
|
+
}>, "strip", z.ZodTypeAny, {
|
|
18
|
+
type: "apiKey";
|
|
19
|
+
value: string;
|
|
20
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
21
|
+
nameKey: string;
|
|
22
|
+
name: string;
|
|
23
|
+
in: "cookie" | "query" | "header";
|
|
24
|
+
description?: string | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
type: "apiKey";
|
|
27
|
+
value?: string | undefined;
|
|
28
|
+
description?: string | undefined;
|
|
29
|
+
uid?: string | undefined;
|
|
30
|
+
nameKey?: string | undefined;
|
|
31
|
+
name?: string | undefined;
|
|
32
|
+
in?: unknown;
|
|
33
|
+
}>;
|
|
34
|
+
export type SecuritySchemeApiKey = z.infer<typeof securityApiKeySchema>;
|
|
35
|
+
export declare const securityHttpSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
36
|
+
description: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, {
|
|
38
|
+
type: z.ZodLiteral<"http">;
|
|
39
|
+
/**
|
|
40
|
+
* REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in
|
|
41
|
+
* [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry.
|
|
42
|
+
*/
|
|
43
|
+
scheme: z.ZodDefault<z.ZodOptional<z.ZodPipeline<z.ZodString, z.ZodEnum<["basic", "bearer"]>>>>;
|
|
44
|
+
/**
|
|
45
|
+
* A hint to the client to identify how the bearer token is formatted.
|
|
46
|
+
* Bearer tokens are usually generated by an authorization server, so
|
|
47
|
+
* this information is primarily for documentation purposes.
|
|
48
|
+
*/
|
|
49
|
+
bearerFormat: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"JWT">, z.ZodString]>>>;
|
|
50
|
+
}>, {
|
|
51
|
+
uid: z.ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
|
|
52
|
+
/** The name key that links a security requirement to a security object */
|
|
53
|
+
nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
54
|
+
}>, {
|
|
55
|
+
username: z.ZodDefault<z.ZodString>;
|
|
56
|
+
password: z.ZodDefault<z.ZodString>;
|
|
57
|
+
token: z.ZodDefault<z.ZodString>;
|
|
58
|
+
}>, "strip", z.ZodTypeAny, {
|
|
59
|
+
type: "http";
|
|
60
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
61
|
+
nameKey: string;
|
|
62
|
+
scheme: "basic" | "bearer";
|
|
63
|
+
bearerFormat: string;
|
|
64
|
+
username: string;
|
|
65
|
+
password: string;
|
|
66
|
+
token: string;
|
|
67
|
+
description?: string | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
type: "http";
|
|
70
|
+
description?: string | undefined;
|
|
71
|
+
uid?: string | undefined;
|
|
72
|
+
nameKey?: string | undefined;
|
|
73
|
+
scheme?: string | undefined;
|
|
74
|
+
bearerFormat?: string | undefined;
|
|
75
|
+
username?: string | undefined;
|
|
76
|
+
password?: string | undefined;
|
|
77
|
+
token?: string | undefined;
|
|
78
|
+
}>;
|
|
79
|
+
export type SecuritySchemaHttp = z.infer<typeof securityHttpSchema>;
|
|
80
|
+
export declare const securityOpenIdSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
81
|
+
description: z.ZodOptional<z.ZodString>;
|
|
82
|
+
}, {
|
|
83
|
+
type: z.ZodLiteral<"openIdConnect">;
|
|
84
|
+
/**
|
|
85
|
+
* REQUIRED. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the
|
|
86
|
+
* form of a URL. The OpenID Connect standard requires the use of TLS.
|
|
87
|
+
*/
|
|
88
|
+
openIdConnectUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
89
|
+
}>, {
|
|
90
|
+
uid: z.ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
|
|
91
|
+
/** The name key that links a security requirement to a security object */
|
|
92
|
+
nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
93
|
+
}>, "strip", z.ZodTypeAny, {
|
|
94
|
+
type: "openIdConnect";
|
|
95
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
96
|
+
nameKey: string;
|
|
97
|
+
openIdConnectUrl: string;
|
|
98
|
+
description?: string | undefined;
|
|
99
|
+
}, {
|
|
100
|
+
type: "openIdConnect";
|
|
101
|
+
description?: string | undefined;
|
|
102
|
+
uid?: string | undefined;
|
|
103
|
+
nameKey?: string | undefined;
|
|
104
|
+
openIdConnectUrl?: string | undefined;
|
|
105
|
+
}>;
|
|
106
|
+
export type SecuritySchemaOpenId = z.infer<typeof securityOpenIdSchema>;
|
|
107
|
+
/** Options for the x-usePkce extension */
|
|
108
|
+
export declare const pkceOptions: readonly ["SHA-256", "plain", "no"];
|
|
109
|
+
export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
110
|
+
description: z.ZodOptional<z.ZodString>;
|
|
111
|
+
}, {
|
|
112
|
+
type: z.ZodLiteral<"oauth2">;
|
|
113
|
+
/** REQUIRED. An object containing configuration information for the flow types supported. */
|
|
114
|
+
flows: z.ZodDefault<z.ZodObject<{
|
|
115
|
+
implicit: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
116
|
+
/**
|
|
117
|
+
* The URL to be used for obtaining refresh tokens. This MUST be in the form of a
|
|
118
|
+
* URL. The OAuth2 standard requires the use of TLS.
|
|
119
|
+
*/
|
|
120
|
+
refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
121
|
+
/**
|
|
122
|
+
* REQUIRED. The available scopes for the OAuth2 security scheme. A map
|
|
123
|
+
* between the scope name and a short description for it. The map MAY be empty.
|
|
124
|
+
*/
|
|
125
|
+
scopes: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodString>>>>>>;
|
|
126
|
+
selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
127
|
+
/** Extension to save the client Id associated with an oauth flow */
|
|
128
|
+
'x-scalar-client-id': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
129
|
+
/** The auth token */
|
|
130
|
+
token: z.ZodDefault<z.ZodString>;
|
|
131
|
+
}, {
|
|
132
|
+
type: z.ZodDefault<z.ZodLiteral<"implicit">>;
|
|
133
|
+
authorizationUrl: z.ZodDefault<z.ZodString>;
|
|
134
|
+
'x-scalar-redirect-uri': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
135
|
+
}>, "strip", z.ZodTypeAny, {
|
|
136
|
+
type: "implicit";
|
|
137
|
+
token: string;
|
|
138
|
+
refreshUrl: string;
|
|
139
|
+
scopes: Record<string, string>;
|
|
140
|
+
selectedScopes: string[];
|
|
141
|
+
'x-scalar-client-id': string;
|
|
142
|
+
authorizationUrl: string;
|
|
143
|
+
'x-scalar-redirect-uri': string;
|
|
144
|
+
}, {
|
|
145
|
+
type?: "implicit" | undefined;
|
|
146
|
+
token?: string | undefined;
|
|
147
|
+
refreshUrl?: string | undefined;
|
|
148
|
+
scopes?: unknown;
|
|
149
|
+
selectedScopes?: string[] | undefined;
|
|
150
|
+
'x-scalar-client-id'?: string | undefined;
|
|
151
|
+
authorizationUrl?: string | undefined;
|
|
152
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
153
|
+
}>>;
|
|
154
|
+
password: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
155
|
+
/**
|
|
156
|
+
* The URL to be used for obtaining refresh tokens. This MUST be in the form of a
|
|
157
|
+
* URL. The OAuth2 standard requires the use of TLS.
|
|
158
|
+
*/
|
|
159
|
+
refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
160
|
+
/**
|
|
161
|
+
* REQUIRED. The available scopes for the OAuth2 security scheme. A map
|
|
162
|
+
* between the scope name and a short description for it. The map MAY be empty.
|
|
163
|
+
*/
|
|
164
|
+
scopes: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodString>>>>>>;
|
|
165
|
+
selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
166
|
+
/** Extension to save the client Id associated with an oauth flow */
|
|
167
|
+
'x-scalar-client-id': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
168
|
+
/** The auth token */
|
|
169
|
+
token: z.ZodDefault<z.ZodString>;
|
|
170
|
+
}, {
|
|
171
|
+
type: z.ZodDefault<z.ZodLiteral<"password">>;
|
|
172
|
+
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
173
|
+
clientSecret: z.ZodDefault<z.ZodString>;
|
|
174
|
+
username: z.ZodDefault<z.ZodString>;
|
|
175
|
+
password: z.ZodDefault<z.ZodString>;
|
|
176
|
+
}>, "strip", z.ZodTypeAny, {
|
|
177
|
+
type: "password";
|
|
178
|
+
username: string;
|
|
179
|
+
password: string;
|
|
180
|
+
token: string;
|
|
181
|
+
refreshUrl: string;
|
|
182
|
+
scopes: Record<string, string>;
|
|
183
|
+
selectedScopes: string[];
|
|
184
|
+
'x-scalar-client-id': string;
|
|
185
|
+
tokenUrl: string;
|
|
186
|
+
clientSecret: string;
|
|
187
|
+
}, {
|
|
188
|
+
type?: "password" | undefined;
|
|
189
|
+
username?: string | undefined;
|
|
190
|
+
password?: string | undefined;
|
|
191
|
+
token?: string | undefined;
|
|
192
|
+
refreshUrl?: string | undefined;
|
|
193
|
+
scopes?: unknown;
|
|
194
|
+
selectedScopes?: string[] | undefined;
|
|
195
|
+
'x-scalar-client-id'?: string | undefined;
|
|
196
|
+
tokenUrl?: string | undefined;
|
|
197
|
+
clientSecret?: string | undefined;
|
|
198
|
+
}>>;
|
|
199
|
+
clientCredentials: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
200
|
+
/**
|
|
201
|
+
* The URL to be used for obtaining refresh tokens. This MUST be in the form of a
|
|
202
|
+
* URL. The OAuth2 standard requires the use of TLS.
|
|
203
|
+
*/
|
|
204
|
+
refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
205
|
+
/**
|
|
206
|
+
* REQUIRED. The available scopes for the OAuth2 security scheme. A map
|
|
207
|
+
* between the scope name and a short description for it. The map MAY be empty.
|
|
208
|
+
*/
|
|
209
|
+
scopes: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodString>>>>>>;
|
|
210
|
+
selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
211
|
+
/** Extension to save the client Id associated with an oauth flow */
|
|
212
|
+
'x-scalar-client-id': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
213
|
+
/** The auth token */
|
|
214
|
+
token: z.ZodDefault<z.ZodString>;
|
|
215
|
+
}, {
|
|
216
|
+
type: z.ZodDefault<z.ZodLiteral<"clientCredentials">>;
|
|
217
|
+
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
218
|
+
clientSecret: z.ZodDefault<z.ZodString>;
|
|
219
|
+
}>, "strip", z.ZodTypeAny, {
|
|
220
|
+
type: "clientCredentials";
|
|
221
|
+
token: string;
|
|
222
|
+
refreshUrl: string;
|
|
223
|
+
scopes: Record<string, string>;
|
|
224
|
+
selectedScopes: string[];
|
|
225
|
+
'x-scalar-client-id': string;
|
|
226
|
+
tokenUrl: string;
|
|
227
|
+
clientSecret: string;
|
|
228
|
+
}, {
|
|
229
|
+
type?: "clientCredentials" | undefined;
|
|
230
|
+
token?: string | undefined;
|
|
231
|
+
refreshUrl?: string | undefined;
|
|
232
|
+
scopes?: unknown;
|
|
233
|
+
selectedScopes?: string[] | undefined;
|
|
234
|
+
'x-scalar-client-id'?: string | undefined;
|
|
235
|
+
tokenUrl?: string | undefined;
|
|
236
|
+
clientSecret?: string | undefined;
|
|
237
|
+
}>>;
|
|
238
|
+
authorizationCode: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
239
|
+
/**
|
|
240
|
+
* The URL to be used for obtaining refresh tokens. This MUST be in the form of a
|
|
241
|
+
* URL. The OAuth2 standard requires the use of TLS.
|
|
242
|
+
*/
|
|
243
|
+
refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
244
|
+
/**
|
|
245
|
+
* REQUIRED. The available scopes for the OAuth2 security scheme. A map
|
|
246
|
+
* between the scope name and a short description for it. The map MAY be empty.
|
|
247
|
+
*/
|
|
248
|
+
scopes: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodString>>>>>>;
|
|
249
|
+
selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
250
|
+
/** Extension to save the client Id associated with an oauth flow */
|
|
251
|
+
'x-scalar-client-id': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
252
|
+
/** The auth token */
|
|
253
|
+
token: z.ZodDefault<z.ZodString>;
|
|
254
|
+
}, {
|
|
255
|
+
type: z.ZodDefault<z.ZodLiteral<"authorizationCode">>;
|
|
256
|
+
authorizationUrl: z.ZodDefault<z.ZodString>;
|
|
257
|
+
/**
|
|
258
|
+
* Whether to use PKCE for the authorization code flow.
|
|
259
|
+
*
|
|
260
|
+
* TODO: add docs
|
|
261
|
+
*/
|
|
262
|
+
'x-usePkce': z.ZodDefault<z.ZodOptional<z.ZodEnum<["SHA-256", "plain", "no"]>>>;
|
|
263
|
+
'x-scalar-redirect-uri': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
264
|
+
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
265
|
+
clientSecret: z.ZodDefault<z.ZodString>;
|
|
266
|
+
}>, "strip", z.ZodTypeAny, {
|
|
267
|
+
type: "authorizationCode";
|
|
268
|
+
token: string;
|
|
269
|
+
refreshUrl: string;
|
|
270
|
+
scopes: Record<string, string>;
|
|
271
|
+
selectedScopes: string[];
|
|
272
|
+
'x-scalar-client-id': string;
|
|
273
|
+
authorizationUrl: string;
|
|
274
|
+
'x-scalar-redirect-uri': string;
|
|
275
|
+
tokenUrl: string;
|
|
276
|
+
clientSecret: string;
|
|
277
|
+
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
278
|
+
}, {
|
|
279
|
+
type?: "authorizationCode" | undefined;
|
|
280
|
+
token?: string | undefined;
|
|
281
|
+
refreshUrl?: string | undefined;
|
|
282
|
+
scopes?: unknown;
|
|
283
|
+
selectedScopes?: string[] | undefined;
|
|
284
|
+
'x-scalar-client-id'?: string | undefined;
|
|
285
|
+
authorizationUrl?: string | undefined;
|
|
286
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
287
|
+
tokenUrl?: string | undefined;
|
|
288
|
+
clientSecret?: string | undefined;
|
|
289
|
+
'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
|
|
290
|
+
}>>;
|
|
291
|
+
}, "strip", z.ZodTypeAny, {
|
|
292
|
+
password?: {
|
|
293
|
+
type: "password";
|
|
294
|
+
username: string;
|
|
295
|
+
password: string;
|
|
296
|
+
token: string;
|
|
297
|
+
refreshUrl: string;
|
|
298
|
+
scopes: Record<string, string>;
|
|
299
|
+
selectedScopes: string[];
|
|
300
|
+
'x-scalar-client-id': string;
|
|
301
|
+
tokenUrl: string;
|
|
302
|
+
clientSecret: string;
|
|
303
|
+
} | undefined;
|
|
304
|
+
implicit?: {
|
|
305
|
+
type: "implicit";
|
|
306
|
+
token: string;
|
|
307
|
+
refreshUrl: string;
|
|
308
|
+
scopes: Record<string, string>;
|
|
309
|
+
selectedScopes: string[];
|
|
310
|
+
'x-scalar-client-id': string;
|
|
311
|
+
authorizationUrl: string;
|
|
312
|
+
'x-scalar-redirect-uri': string;
|
|
313
|
+
} | undefined;
|
|
314
|
+
clientCredentials?: {
|
|
315
|
+
type: "clientCredentials";
|
|
316
|
+
token: string;
|
|
317
|
+
refreshUrl: string;
|
|
318
|
+
scopes: Record<string, string>;
|
|
319
|
+
selectedScopes: string[];
|
|
320
|
+
'x-scalar-client-id': string;
|
|
321
|
+
tokenUrl: string;
|
|
322
|
+
clientSecret: string;
|
|
323
|
+
} | undefined;
|
|
324
|
+
authorizationCode?: {
|
|
325
|
+
type: "authorizationCode";
|
|
326
|
+
token: string;
|
|
327
|
+
refreshUrl: string;
|
|
328
|
+
scopes: Record<string, string>;
|
|
329
|
+
selectedScopes: string[];
|
|
330
|
+
'x-scalar-client-id': string;
|
|
331
|
+
authorizationUrl: string;
|
|
332
|
+
'x-scalar-redirect-uri': string;
|
|
333
|
+
tokenUrl: string;
|
|
334
|
+
clientSecret: string;
|
|
335
|
+
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
336
|
+
} | undefined;
|
|
337
|
+
}, {
|
|
338
|
+
password?: {
|
|
339
|
+
type?: "password" | undefined;
|
|
340
|
+
username?: string | undefined;
|
|
341
|
+
password?: string | undefined;
|
|
342
|
+
token?: string | undefined;
|
|
343
|
+
refreshUrl?: string | undefined;
|
|
344
|
+
scopes?: unknown;
|
|
345
|
+
selectedScopes?: string[] | undefined;
|
|
346
|
+
'x-scalar-client-id'?: string | undefined;
|
|
347
|
+
tokenUrl?: string | undefined;
|
|
348
|
+
clientSecret?: string | undefined;
|
|
349
|
+
} | undefined;
|
|
350
|
+
implicit?: {
|
|
351
|
+
type?: "implicit" | undefined;
|
|
352
|
+
token?: string | undefined;
|
|
353
|
+
refreshUrl?: string | undefined;
|
|
354
|
+
scopes?: unknown;
|
|
355
|
+
selectedScopes?: string[] | undefined;
|
|
356
|
+
'x-scalar-client-id'?: string | undefined;
|
|
357
|
+
authorizationUrl?: string | undefined;
|
|
358
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
359
|
+
} | undefined;
|
|
360
|
+
clientCredentials?: {
|
|
361
|
+
type?: "clientCredentials" | undefined;
|
|
362
|
+
token?: string | undefined;
|
|
363
|
+
refreshUrl?: string | undefined;
|
|
364
|
+
scopes?: unknown;
|
|
365
|
+
selectedScopes?: string[] | undefined;
|
|
366
|
+
'x-scalar-client-id'?: string | undefined;
|
|
367
|
+
tokenUrl?: string | undefined;
|
|
368
|
+
clientSecret?: string | undefined;
|
|
369
|
+
} | undefined;
|
|
370
|
+
authorizationCode?: {
|
|
371
|
+
type?: "authorizationCode" | undefined;
|
|
372
|
+
token?: string | undefined;
|
|
373
|
+
refreshUrl?: string | undefined;
|
|
374
|
+
scopes?: unknown;
|
|
375
|
+
selectedScopes?: string[] | undefined;
|
|
376
|
+
'x-scalar-client-id'?: string | undefined;
|
|
377
|
+
authorizationUrl?: string | undefined;
|
|
378
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
379
|
+
tokenUrl?: string | undefined;
|
|
380
|
+
clientSecret?: string | undefined;
|
|
381
|
+
'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
|
|
382
|
+
} | undefined;
|
|
383
|
+
}>>;
|
|
384
|
+
}>, {
|
|
385
|
+
uid: z.ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
|
|
386
|
+
/** The name key that links a security requirement to a security object */
|
|
387
|
+
nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
388
|
+
}>, "strip", z.ZodTypeAny, {
|
|
389
|
+
type: "oauth2";
|
|
390
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
391
|
+
nameKey: string;
|
|
392
|
+
flows: {
|
|
393
|
+
password?: {
|
|
394
|
+
type: "password";
|
|
395
|
+
username: string;
|
|
396
|
+
password: string;
|
|
397
|
+
token: string;
|
|
398
|
+
refreshUrl: string;
|
|
399
|
+
scopes: Record<string, string>;
|
|
400
|
+
selectedScopes: string[];
|
|
401
|
+
'x-scalar-client-id': string;
|
|
402
|
+
tokenUrl: string;
|
|
403
|
+
clientSecret: string;
|
|
404
|
+
} | undefined;
|
|
405
|
+
implicit?: {
|
|
406
|
+
type: "implicit";
|
|
407
|
+
token: string;
|
|
408
|
+
refreshUrl: string;
|
|
409
|
+
scopes: Record<string, string>;
|
|
410
|
+
selectedScopes: string[];
|
|
411
|
+
'x-scalar-client-id': string;
|
|
412
|
+
authorizationUrl: string;
|
|
413
|
+
'x-scalar-redirect-uri': string;
|
|
414
|
+
} | undefined;
|
|
415
|
+
clientCredentials?: {
|
|
416
|
+
type: "clientCredentials";
|
|
417
|
+
token: string;
|
|
418
|
+
refreshUrl: string;
|
|
419
|
+
scopes: Record<string, string>;
|
|
420
|
+
selectedScopes: string[];
|
|
421
|
+
'x-scalar-client-id': string;
|
|
422
|
+
tokenUrl: string;
|
|
423
|
+
clientSecret: string;
|
|
424
|
+
} | undefined;
|
|
425
|
+
authorizationCode?: {
|
|
426
|
+
type: "authorizationCode";
|
|
427
|
+
token: string;
|
|
428
|
+
refreshUrl: string;
|
|
429
|
+
scopes: Record<string, string>;
|
|
430
|
+
selectedScopes: string[];
|
|
431
|
+
'x-scalar-client-id': string;
|
|
432
|
+
authorizationUrl: string;
|
|
433
|
+
'x-scalar-redirect-uri': string;
|
|
434
|
+
tokenUrl: string;
|
|
435
|
+
clientSecret: string;
|
|
436
|
+
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
437
|
+
} | undefined;
|
|
438
|
+
};
|
|
439
|
+
description?: string | undefined;
|
|
440
|
+
}, {
|
|
441
|
+
type: "oauth2";
|
|
442
|
+
description?: string | undefined;
|
|
443
|
+
uid?: string | undefined;
|
|
444
|
+
nameKey?: string | undefined;
|
|
445
|
+
flows?: {
|
|
446
|
+
password?: {
|
|
447
|
+
type?: "password" | undefined;
|
|
448
|
+
username?: string | undefined;
|
|
449
|
+
password?: string | undefined;
|
|
450
|
+
token?: string | undefined;
|
|
451
|
+
refreshUrl?: string | undefined;
|
|
452
|
+
scopes?: unknown;
|
|
453
|
+
selectedScopes?: string[] | undefined;
|
|
454
|
+
'x-scalar-client-id'?: string | undefined;
|
|
455
|
+
tokenUrl?: string | undefined;
|
|
456
|
+
clientSecret?: string | undefined;
|
|
457
|
+
} | undefined;
|
|
458
|
+
implicit?: {
|
|
459
|
+
type?: "implicit" | undefined;
|
|
460
|
+
token?: string | undefined;
|
|
461
|
+
refreshUrl?: string | undefined;
|
|
462
|
+
scopes?: unknown;
|
|
463
|
+
selectedScopes?: string[] | undefined;
|
|
464
|
+
'x-scalar-client-id'?: string | undefined;
|
|
465
|
+
authorizationUrl?: string | undefined;
|
|
466
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
467
|
+
} | undefined;
|
|
468
|
+
clientCredentials?: {
|
|
469
|
+
type?: "clientCredentials" | undefined;
|
|
470
|
+
token?: string | undefined;
|
|
471
|
+
refreshUrl?: string | undefined;
|
|
472
|
+
scopes?: unknown;
|
|
473
|
+
selectedScopes?: string[] | undefined;
|
|
474
|
+
'x-scalar-client-id'?: string | undefined;
|
|
475
|
+
tokenUrl?: string | undefined;
|
|
476
|
+
clientSecret?: string | undefined;
|
|
477
|
+
} | undefined;
|
|
478
|
+
authorizationCode?: {
|
|
479
|
+
type?: "authorizationCode" | undefined;
|
|
480
|
+
token?: string | undefined;
|
|
481
|
+
refreshUrl?: string | undefined;
|
|
482
|
+
scopes?: unknown;
|
|
483
|
+
selectedScopes?: string[] | undefined;
|
|
484
|
+
'x-scalar-client-id'?: string | undefined;
|
|
485
|
+
authorizationUrl?: string | undefined;
|
|
486
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
487
|
+
tokenUrl?: string | undefined;
|
|
488
|
+
clientSecret?: string | undefined;
|
|
489
|
+
'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
|
|
490
|
+
} | undefined;
|
|
491
|
+
} | undefined;
|
|
492
|
+
}>;
|
|
493
|
+
export type SecuritySchemeOauth2 = z.infer<typeof securityOauthSchema>;
|
|
494
|
+
export type SecuritySchemeOauth2Payload = z.input<typeof securityOauthSchema>;
|
|
495
|
+
export type Oauth2Flow = NonNullable<SecuritySchemeOauth2['flows']['authorizationCode' | 'clientCredentials' | 'implicit' | 'password']>;
|
|
496
|
+
/** Payload for the oauth 2 flows + extensions */
|
|
497
|
+
export type Oauth2FlowPayload = NonNullable<SecuritySchemeOauth2Payload['flows']>['authorizationCode' | 'clientCredentials' | 'implicit' | 'password'] & Record<`x-${string}`, string>;
|
|
498
|
+
/**
|
|
499
|
+
* Security Requirement
|
|
500
|
+
* Lists the required security schemes to execute this operation OR the whole collection/spec.
|
|
501
|
+
* The name used for each property MUST correspond to a security scheme declared in the Security
|
|
502
|
+
* Schemes under the Components Object.
|
|
503
|
+
*
|
|
504
|
+
* The key (name) here will be matched to the key of the securityScheme for linking
|
|
505
|
+
*
|
|
506
|
+
* @see https://spec.openapis.org/oas/latest.html#security-requirement-object
|
|
507
|
+
*/
|
|
508
|
+
export declare const oasSecurityRequirementSchema: z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>>;
|
|
509
|
+
/** OAS Compliant security schemes */
|
|
510
|
+
export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
|
|
511
|
+
description: z.ZodOptional<z.ZodString>;
|
|
512
|
+
}, {
|
|
513
|
+
type: z.ZodLiteral<"apiKey">;
|
|
514
|
+
/** REQUIRED. The name of the header, query or cookie parameter to be used. */
|
|
515
|
+
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
516
|
+
/** REQUIRED. The location of the API key. Valid values are "query", "header" or "cookie". */
|
|
517
|
+
in: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<["query", "header", "cookie"]>>>>;
|
|
518
|
+
}>, "strip", z.ZodTypeAny, {
|
|
519
|
+
type: "apiKey";
|
|
520
|
+
name: string;
|
|
521
|
+
in: "cookie" | "query" | "header";
|
|
522
|
+
description?: string | undefined;
|
|
523
|
+
}, {
|
|
524
|
+
type: "apiKey";
|
|
525
|
+
description?: string | undefined;
|
|
526
|
+
name?: string | undefined;
|
|
527
|
+
in?: unknown;
|
|
528
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
529
|
+
description: z.ZodOptional<z.ZodString>;
|
|
530
|
+
}, {
|
|
531
|
+
type: z.ZodLiteral<"http">;
|
|
532
|
+
/**
|
|
533
|
+
* REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in
|
|
534
|
+
* [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry.
|
|
535
|
+
*/
|
|
536
|
+
scheme: z.ZodDefault<z.ZodOptional<z.ZodPipeline<z.ZodString, z.ZodEnum<["basic", "bearer"]>>>>;
|
|
537
|
+
/**
|
|
538
|
+
* A hint to the client to identify how the bearer token is formatted.
|
|
539
|
+
* Bearer tokens are usually generated by an authorization server, so
|
|
540
|
+
* this information is primarily for documentation purposes.
|
|
541
|
+
*/
|
|
542
|
+
bearerFormat: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"JWT">, z.ZodString]>>>;
|
|
543
|
+
}>, "strip", z.ZodTypeAny, {
|
|
544
|
+
type: "http";
|
|
545
|
+
scheme: "basic" | "bearer";
|
|
546
|
+
bearerFormat: string;
|
|
547
|
+
description?: string | undefined;
|
|
548
|
+
}, {
|
|
549
|
+
type: "http";
|
|
550
|
+
description?: string | undefined;
|
|
551
|
+
scheme?: string | undefined;
|
|
552
|
+
bearerFormat?: string | undefined;
|
|
553
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
554
|
+
description: z.ZodOptional<z.ZodString>;
|
|
555
|
+
}, {
|
|
556
|
+
type: z.ZodLiteral<"oauth2">;
|
|
557
|
+
/** REQUIRED. An object containing configuration information for the flow types supported. */
|
|
558
|
+
flows: z.ZodDefault<z.ZodObject<{
|
|
559
|
+
implicit: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
560
|
+
/**
|
|
561
|
+
* The URL to be used for obtaining refresh tokens. This MUST be in the form of a
|
|
562
|
+
* URL. The OAuth2 standard requires the use of TLS.
|
|
563
|
+
*/
|
|
564
|
+
refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
565
|
+
/**
|
|
566
|
+
* REQUIRED. The available scopes for the OAuth2 security scheme. A map
|
|
567
|
+
* between the scope name and a short description for it. The map MAY be empty.
|
|
568
|
+
*/
|
|
569
|
+
scopes: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodString>>>>>>;
|
|
570
|
+
selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
571
|
+
/** Extension to save the client Id associated with an oauth flow */
|
|
572
|
+
'x-scalar-client-id': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
573
|
+
/** The auth token */
|
|
574
|
+
token: z.ZodDefault<z.ZodString>;
|
|
575
|
+
}, {
|
|
576
|
+
type: z.ZodDefault<z.ZodLiteral<"implicit">>;
|
|
577
|
+
authorizationUrl: z.ZodDefault<z.ZodString>;
|
|
578
|
+
'x-scalar-redirect-uri': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
579
|
+
}>, "strip", z.ZodTypeAny, {
|
|
580
|
+
type: "implicit";
|
|
581
|
+
token: string;
|
|
582
|
+
refreshUrl: string;
|
|
583
|
+
scopes: Record<string, string>;
|
|
584
|
+
selectedScopes: string[];
|
|
585
|
+
'x-scalar-client-id': string;
|
|
586
|
+
authorizationUrl: string;
|
|
587
|
+
'x-scalar-redirect-uri': string;
|
|
588
|
+
}, {
|
|
589
|
+
type?: "implicit" | undefined;
|
|
590
|
+
token?: string | undefined;
|
|
591
|
+
refreshUrl?: string | undefined;
|
|
592
|
+
scopes?: unknown;
|
|
593
|
+
selectedScopes?: string[] | undefined;
|
|
594
|
+
'x-scalar-client-id'?: string | undefined;
|
|
595
|
+
authorizationUrl?: string | undefined;
|
|
596
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
597
|
+
}>>;
|
|
598
|
+
password: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
599
|
+
/**
|
|
600
|
+
* The URL to be used for obtaining refresh tokens. This MUST be in the form of a
|
|
601
|
+
* URL. The OAuth2 standard requires the use of TLS.
|
|
602
|
+
*/
|
|
603
|
+
refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
604
|
+
/**
|
|
605
|
+
* REQUIRED. The available scopes for the OAuth2 security scheme. A map
|
|
606
|
+
* between the scope name and a short description for it. The map MAY be empty.
|
|
607
|
+
*/
|
|
608
|
+
scopes: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodString>>>>>>;
|
|
609
|
+
selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
610
|
+
/** Extension to save the client Id associated with an oauth flow */
|
|
611
|
+
'x-scalar-client-id': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
612
|
+
/** The auth token */
|
|
613
|
+
token: z.ZodDefault<z.ZodString>;
|
|
614
|
+
}, {
|
|
615
|
+
type: z.ZodDefault<z.ZodLiteral<"password">>;
|
|
616
|
+
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
617
|
+
clientSecret: z.ZodDefault<z.ZodString>;
|
|
618
|
+
username: z.ZodDefault<z.ZodString>;
|
|
619
|
+
password: z.ZodDefault<z.ZodString>;
|
|
620
|
+
}>, "strip", z.ZodTypeAny, {
|
|
621
|
+
type: "password";
|
|
622
|
+
username: string;
|
|
623
|
+
password: string;
|
|
624
|
+
token: string;
|
|
625
|
+
refreshUrl: string;
|
|
626
|
+
scopes: Record<string, string>;
|
|
627
|
+
selectedScopes: string[];
|
|
628
|
+
'x-scalar-client-id': string;
|
|
629
|
+
tokenUrl: string;
|
|
630
|
+
clientSecret: string;
|
|
631
|
+
}, {
|
|
632
|
+
type?: "password" | undefined;
|
|
633
|
+
username?: string | undefined;
|
|
634
|
+
password?: string | undefined;
|
|
635
|
+
token?: string | undefined;
|
|
636
|
+
refreshUrl?: string | undefined;
|
|
637
|
+
scopes?: unknown;
|
|
638
|
+
selectedScopes?: string[] | undefined;
|
|
639
|
+
'x-scalar-client-id'?: string | undefined;
|
|
640
|
+
tokenUrl?: string | undefined;
|
|
641
|
+
clientSecret?: string | undefined;
|
|
642
|
+
}>>;
|
|
643
|
+
clientCredentials: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
644
|
+
/**
|
|
645
|
+
* The URL to be used for obtaining refresh tokens. This MUST be in the form of a
|
|
646
|
+
* URL. The OAuth2 standard requires the use of TLS.
|
|
647
|
+
*/
|
|
648
|
+
refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
649
|
+
/**
|
|
650
|
+
* REQUIRED. The available scopes for the OAuth2 security scheme. A map
|
|
651
|
+
* between the scope name and a short description for it. The map MAY be empty.
|
|
652
|
+
*/
|
|
653
|
+
scopes: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodString>>>>>>;
|
|
654
|
+
selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
655
|
+
/** Extension to save the client Id associated with an oauth flow */
|
|
656
|
+
'x-scalar-client-id': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
657
|
+
/** The auth token */
|
|
658
|
+
token: z.ZodDefault<z.ZodString>;
|
|
659
|
+
}, {
|
|
660
|
+
type: z.ZodDefault<z.ZodLiteral<"clientCredentials">>;
|
|
661
|
+
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
662
|
+
clientSecret: z.ZodDefault<z.ZodString>;
|
|
663
|
+
}>, "strip", z.ZodTypeAny, {
|
|
664
|
+
type: "clientCredentials";
|
|
665
|
+
token: string;
|
|
666
|
+
refreshUrl: string;
|
|
667
|
+
scopes: Record<string, string>;
|
|
668
|
+
selectedScopes: string[];
|
|
669
|
+
'x-scalar-client-id': string;
|
|
670
|
+
tokenUrl: string;
|
|
671
|
+
clientSecret: string;
|
|
672
|
+
}, {
|
|
673
|
+
type?: "clientCredentials" | undefined;
|
|
674
|
+
token?: string | undefined;
|
|
675
|
+
refreshUrl?: string | undefined;
|
|
676
|
+
scopes?: unknown;
|
|
677
|
+
selectedScopes?: string[] | undefined;
|
|
678
|
+
'x-scalar-client-id'?: string | undefined;
|
|
679
|
+
tokenUrl?: string | undefined;
|
|
680
|
+
clientSecret?: string | undefined;
|
|
681
|
+
}>>;
|
|
682
|
+
authorizationCode: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
683
|
+
/**
|
|
684
|
+
* The URL to be used for obtaining refresh tokens. This MUST be in the form of a
|
|
685
|
+
* URL. The OAuth2 standard requires the use of TLS.
|
|
686
|
+
*/
|
|
687
|
+
refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
688
|
+
/**
|
|
689
|
+
* REQUIRED. The available scopes for the OAuth2 security scheme. A map
|
|
690
|
+
* between the scope name and a short description for it. The map MAY be empty.
|
|
691
|
+
*/
|
|
692
|
+
scopes: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodString>>>>>>;
|
|
693
|
+
selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
694
|
+
/** Extension to save the client Id associated with an oauth flow */
|
|
695
|
+
'x-scalar-client-id': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
696
|
+
/** The auth token */
|
|
697
|
+
token: z.ZodDefault<z.ZodString>;
|
|
698
|
+
}, {
|
|
699
|
+
type: z.ZodDefault<z.ZodLiteral<"authorizationCode">>;
|
|
700
|
+
authorizationUrl: z.ZodDefault<z.ZodString>;
|
|
701
|
+
/**
|
|
702
|
+
* Whether to use PKCE for the authorization code flow.
|
|
703
|
+
*
|
|
704
|
+
* TODO: add docs
|
|
705
|
+
*/
|
|
706
|
+
'x-usePkce': z.ZodDefault<z.ZodOptional<z.ZodEnum<["SHA-256", "plain", "no"]>>>;
|
|
707
|
+
'x-scalar-redirect-uri': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
708
|
+
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
709
|
+
clientSecret: z.ZodDefault<z.ZodString>;
|
|
710
|
+
}>, "strip", z.ZodTypeAny, {
|
|
711
|
+
type: "authorizationCode";
|
|
712
|
+
token: string;
|
|
713
|
+
refreshUrl: string;
|
|
714
|
+
scopes: Record<string, string>;
|
|
715
|
+
selectedScopes: string[];
|
|
716
|
+
'x-scalar-client-id': string;
|
|
717
|
+
authorizationUrl: string;
|
|
718
|
+
'x-scalar-redirect-uri': string;
|
|
719
|
+
tokenUrl: string;
|
|
720
|
+
clientSecret: string;
|
|
721
|
+
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
722
|
+
}, {
|
|
723
|
+
type?: "authorizationCode" | undefined;
|
|
724
|
+
token?: string | undefined;
|
|
725
|
+
refreshUrl?: string | undefined;
|
|
726
|
+
scopes?: unknown;
|
|
727
|
+
selectedScopes?: string[] | undefined;
|
|
728
|
+
'x-scalar-client-id'?: string | undefined;
|
|
729
|
+
authorizationUrl?: string | undefined;
|
|
730
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
731
|
+
tokenUrl?: string | undefined;
|
|
732
|
+
clientSecret?: string | undefined;
|
|
733
|
+
'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
|
|
734
|
+
}>>;
|
|
735
|
+
}, "strip", z.ZodTypeAny, {
|
|
736
|
+
password?: {
|
|
737
|
+
type: "password";
|
|
738
|
+
username: string;
|
|
739
|
+
password: string;
|
|
740
|
+
token: string;
|
|
741
|
+
refreshUrl: string;
|
|
742
|
+
scopes: Record<string, string>;
|
|
743
|
+
selectedScopes: string[];
|
|
744
|
+
'x-scalar-client-id': string;
|
|
745
|
+
tokenUrl: string;
|
|
746
|
+
clientSecret: string;
|
|
747
|
+
} | undefined;
|
|
748
|
+
implicit?: {
|
|
749
|
+
type: "implicit";
|
|
750
|
+
token: string;
|
|
751
|
+
refreshUrl: string;
|
|
752
|
+
scopes: Record<string, string>;
|
|
753
|
+
selectedScopes: string[];
|
|
754
|
+
'x-scalar-client-id': string;
|
|
755
|
+
authorizationUrl: string;
|
|
756
|
+
'x-scalar-redirect-uri': string;
|
|
757
|
+
} | undefined;
|
|
758
|
+
clientCredentials?: {
|
|
759
|
+
type: "clientCredentials";
|
|
760
|
+
token: string;
|
|
761
|
+
refreshUrl: string;
|
|
762
|
+
scopes: Record<string, string>;
|
|
763
|
+
selectedScopes: string[];
|
|
764
|
+
'x-scalar-client-id': string;
|
|
765
|
+
tokenUrl: string;
|
|
766
|
+
clientSecret: string;
|
|
767
|
+
} | undefined;
|
|
768
|
+
authorizationCode?: {
|
|
769
|
+
type: "authorizationCode";
|
|
770
|
+
token: string;
|
|
771
|
+
refreshUrl: string;
|
|
772
|
+
scopes: Record<string, string>;
|
|
773
|
+
selectedScopes: string[];
|
|
774
|
+
'x-scalar-client-id': string;
|
|
775
|
+
authorizationUrl: string;
|
|
776
|
+
'x-scalar-redirect-uri': string;
|
|
777
|
+
tokenUrl: string;
|
|
778
|
+
clientSecret: string;
|
|
779
|
+
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
780
|
+
} | undefined;
|
|
781
|
+
}, {
|
|
782
|
+
password?: {
|
|
783
|
+
type?: "password" | undefined;
|
|
784
|
+
username?: string | undefined;
|
|
785
|
+
password?: string | undefined;
|
|
786
|
+
token?: string | undefined;
|
|
787
|
+
refreshUrl?: string | undefined;
|
|
788
|
+
scopes?: unknown;
|
|
789
|
+
selectedScopes?: string[] | undefined;
|
|
790
|
+
'x-scalar-client-id'?: string | undefined;
|
|
791
|
+
tokenUrl?: string | undefined;
|
|
792
|
+
clientSecret?: string | undefined;
|
|
793
|
+
} | undefined;
|
|
794
|
+
implicit?: {
|
|
795
|
+
type?: "implicit" | undefined;
|
|
796
|
+
token?: string | undefined;
|
|
797
|
+
refreshUrl?: string | undefined;
|
|
798
|
+
scopes?: unknown;
|
|
799
|
+
selectedScopes?: string[] | undefined;
|
|
800
|
+
'x-scalar-client-id'?: string | undefined;
|
|
801
|
+
authorizationUrl?: string | undefined;
|
|
802
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
803
|
+
} | undefined;
|
|
804
|
+
clientCredentials?: {
|
|
805
|
+
type?: "clientCredentials" | undefined;
|
|
806
|
+
token?: string | undefined;
|
|
807
|
+
refreshUrl?: string | undefined;
|
|
808
|
+
scopes?: unknown;
|
|
809
|
+
selectedScopes?: string[] | undefined;
|
|
810
|
+
'x-scalar-client-id'?: string | undefined;
|
|
811
|
+
tokenUrl?: string | undefined;
|
|
812
|
+
clientSecret?: string | undefined;
|
|
813
|
+
} | undefined;
|
|
814
|
+
authorizationCode?: {
|
|
815
|
+
type?: "authorizationCode" | undefined;
|
|
816
|
+
token?: string | undefined;
|
|
817
|
+
refreshUrl?: string | undefined;
|
|
818
|
+
scopes?: unknown;
|
|
819
|
+
selectedScopes?: string[] | undefined;
|
|
820
|
+
'x-scalar-client-id'?: string | undefined;
|
|
821
|
+
authorizationUrl?: string | undefined;
|
|
822
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
823
|
+
tokenUrl?: string | undefined;
|
|
824
|
+
clientSecret?: string | undefined;
|
|
825
|
+
'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
|
|
826
|
+
} | undefined;
|
|
827
|
+
}>>;
|
|
828
|
+
}>, "strip", z.ZodTypeAny, {
|
|
829
|
+
type: "oauth2";
|
|
830
|
+
flows: {
|
|
831
|
+
password?: {
|
|
832
|
+
type: "password";
|
|
833
|
+
username: string;
|
|
834
|
+
password: string;
|
|
835
|
+
token: string;
|
|
836
|
+
refreshUrl: string;
|
|
837
|
+
scopes: Record<string, string>;
|
|
838
|
+
selectedScopes: string[];
|
|
839
|
+
'x-scalar-client-id': string;
|
|
840
|
+
tokenUrl: string;
|
|
841
|
+
clientSecret: string;
|
|
842
|
+
} | undefined;
|
|
843
|
+
implicit?: {
|
|
844
|
+
type: "implicit";
|
|
845
|
+
token: string;
|
|
846
|
+
refreshUrl: string;
|
|
847
|
+
scopes: Record<string, string>;
|
|
848
|
+
selectedScopes: string[];
|
|
849
|
+
'x-scalar-client-id': string;
|
|
850
|
+
authorizationUrl: string;
|
|
851
|
+
'x-scalar-redirect-uri': string;
|
|
852
|
+
} | undefined;
|
|
853
|
+
clientCredentials?: {
|
|
854
|
+
type: "clientCredentials";
|
|
855
|
+
token: string;
|
|
856
|
+
refreshUrl: string;
|
|
857
|
+
scopes: Record<string, string>;
|
|
858
|
+
selectedScopes: string[];
|
|
859
|
+
'x-scalar-client-id': string;
|
|
860
|
+
tokenUrl: string;
|
|
861
|
+
clientSecret: string;
|
|
862
|
+
} | undefined;
|
|
863
|
+
authorizationCode?: {
|
|
864
|
+
type: "authorizationCode";
|
|
865
|
+
token: string;
|
|
866
|
+
refreshUrl: string;
|
|
867
|
+
scopes: Record<string, string>;
|
|
868
|
+
selectedScopes: string[];
|
|
869
|
+
'x-scalar-client-id': string;
|
|
870
|
+
authorizationUrl: string;
|
|
871
|
+
'x-scalar-redirect-uri': string;
|
|
872
|
+
tokenUrl: string;
|
|
873
|
+
clientSecret: string;
|
|
874
|
+
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
875
|
+
} | undefined;
|
|
876
|
+
};
|
|
877
|
+
description?: string | undefined;
|
|
878
|
+
}, {
|
|
879
|
+
type: "oauth2";
|
|
880
|
+
description?: string | undefined;
|
|
881
|
+
flows?: {
|
|
882
|
+
password?: {
|
|
883
|
+
type?: "password" | undefined;
|
|
884
|
+
username?: string | undefined;
|
|
885
|
+
password?: string | undefined;
|
|
886
|
+
token?: string | undefined;
|
|
887
|
+
refreshUrl?: string | undefined;
|
|
888
|
+
scopes?: unknown;
|
|
889
|
+
selectedScopes?: string[] | undefined;
|
|
890
|
+
'x-scalar-client-id'?: string | undefined;
|
|
891
|
+
tokenUrl?: string | undefined;
|
|
892
|
+
clientSecret?: string | undefined;
|
|
893
|
+
} | undefined;
|
|
894
|
+
implicit?: {
|
|
895
|
+
type?: "implicit" | undefined;
|
|
896
|
+
token?: string | undefined;
|
|
897
|
+
refreshUrl?: string | undefined;
|
|
898
|
+
scopes?: unknown;
|
|
899
|
+
selectedScopes?: string[] | undefined;
|
|
900
|
+
'x-scalar-client-id'?: string | undefined;
|
|
901
|
+
authorizationUrl?: string | undefined;
|
|
902
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
903
|
+
} | undefined;
|
|
904
|
+
clientCredentials?: {
|
|
905
|
+
type?: "clientCredentials" | undefined;
|
|
906
|
+
token?: string | undefined;
|
|
907
|
+
refreshUrl?: string | undefined;
|
|
908
|
+
scopes?: unknown;
|
|
909
|
+
selectedScopes?: string[] | undefined;
|
|
910
|
+
'x-scalar-client-id'?: string | undefined;
|
|
911
|
+
tokenUrl?: string | undefined;
|
|
912
|
+
clientSecret?: string | undefined;
|
|
913
|
+
} | undefined;
|
|
914
|
+
authorizationCode?: {
|
|
915
|
+
type?: "authorizationCode" | undefined;
|
|
916
|
+
token?: string | undefined;
|
|
917
|
+
refreshUrl?: string | undefined;
|
|
918
|
+
scopes?: unknown;
|
|
919
|
+
selectedScopes?: string[] | undefined;
|
|
920
|
+
'x-scalar-client-id'?: string | undefined;
|
|
921
|
+
authorizationUrl?: string | undefined;
|
|
922
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
923
|
+
tokenUrl?: string | undefined;
|
|
924
|
+
clientSecret?: string | undefined;
|
|
925
|
+
'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
|
|
926
|
+
} | undefined;
|
|
927
|
+
} | undefined;
|
|
928
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
929
|
+
description: z.ZodOptional<z.ZodString>;
|
|
930
|
+
}, {
|
|
931
|
+
type: z.ZodLiteral<"openIdConnect">;
|
|
932
|
+
/**
|
|
933
|
+
* REQUIRED. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the
|
|
934
|
+
* form of a URL. The OpenID Connect standard requires the use of TLS.
|
|
935
|
+
*/
|
|
936
|
+
openIdConnectUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
937
|
+
}>, "strip", z.ZodTypeAny, {
|
|
938
|
+
type: "openIdConnect";
|
|
939
|
+
openIdConnectUrl: string;
|
|
940
|
+
description?: string | undefined;
|
|
941
|
+
}, {
|
|
942
|
+
type: "openIdConnect";
|
|
943
|
+
description?: string | undefined;
|
|
944
|
+
openIdConnectUrl?: string | undefined;
|
|
945
|
+
}>]>;
|
|
946
|
+
/** Extended security schemes for workspace usage */
|
|
947
|
+
export declare const securitySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
948
|
+
description: z.ZodOptional<z.ZodString>;
|
|
949
|
+
}, {
|
|
950
|
+
type: z.ZodLiteral<"apiKey">;
|
|
951
|
+
/** REQUIRED. The name of the header, query or cookie parameter to be used. */
|
|
952
|
+
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
953
|
+
/** REQUIRED. The location of the API key. Valid values are "query", "header" or "cookie". */
|
|
954
|
+
in: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<["query", "header", "cookie"]>>>>;
|
|
955
|
+
}>, {
|
|
956
|
+
uid: z.ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
|
|
957
|
+
/** The name key that links a security requirement to a security object */
|
|
958
|
+
nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
959
|
+
}>, {
|
|
960
|
+
value: z.ZodDefault<z.ZodString>;
|
|
961
|
+
}>, "strip", z.ZodTypeAny, {
|
|
962
|
+
type: "apiKey";
|
|
963
|
+
value: string;
|
|
964
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
965
|
+
nameKey: string;
|
|
966
|
+
name: string;
|
|
967
|
+
in: "cookie" | "query" | "header";
|
|
968
|
+
description?: string | undefined;
|
|
969
|
+
}, {
|
|
970
|
+
type: "apiKey";
|
|
971
|
+
value?: string | undefined;
|
|
972
|
+
description?: string | undefined;
|
|
973
|
+
uid?: string | undefined;
|
|
974
|
+
nameKey?: string | undefined;
|
|
975
|
+
name?: string | undefined;
|
|
976
|
+
in?: unknown;
|
|
977
|
+
}>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
978
|
+
description: z.ZodOptional<z.ZodString>;
|
|
979
|
+
}, {
|
|
980
|
+
type: z.ZodLiteral<"http">;
|
|
981
|
+
/**
|
|
982
|
+
* REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in
|
|
983
|
+
* [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry.
|
|
984
|
+
*/
|
|
985
|
+
scheme: z.ZodDefault<z.ZodOptional<z.ZodPipeline<z.ZodString, z.ZodEnum<["basic", "bearer"]>>>>;
|
|
986
|
+
/**
|
|
987
|
+
* A hint to the client to identify how the bearer token is formatted.
|
|
988
|
+
* Bearer tokens are usually generated by an authorization server, so
|
|
989
|
+
* this information is primarily for documentation purposes.
|
|
990
|
+
*/
|
|
991
|
+
bearerFormat: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"JWT">, z.ZodString]>>>;
|
|
992
|
+
}>, {
|
|
993
|
+
uid: z.ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
|
|
994
|
+
/** The name key that links a security requirement to a security object */
|
|
995
|
+
nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
996
|
+
}>, {
|
|
997
|
+
username: z.ZodDefault<z.ZodString>;
|
|
998
|
+
password: z.ZodDefault<z.ZodString>;
|
|
999
|
+
token: z.ZodDefault<z.ZodString>;
|
|
1000
|
+
}>, "strip", z.ZodTypeAny, {
|
|
1001
|
+
type: "http";
|
|
1002
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
1003
|
+
nameKey: string;
|
|
1004
|
+
scheme: "basic" | "bearer";
|
|
1005
|
+
bearerFormat: string;
|
|
1006
|
+
username: string;
|
|
1007
|
+
password: string;
|
|
1008
|
+
token: string;
|
|
1009
|
+
description?: string | undefined;
|
|
1010
|
+
}, {
|
|
1011
|
+
type: "http";
|
|
1012
|
+
description?: string | undefined;
|
|
1013
|
+
uid?: string | undefined;
|
|
1014
|
+
nameKey?: string | undefined;
|
|
1015
|
+
scheme?: string | undefined;
|
|
1016
|
+
bearerFormat?: string | undefined;
|
|
1017
|
+
username?: string | undefined;
|
|
1018
|
+
password?: string | undefined;
|
|
1019
|
+
token?: string | undefined;
|
|
1020
|
+
}>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
1021
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1022
|
+
}, {
|
|
1023
|
+
type: z.ZodLiteral<"openIdConnect">;
|
|
1024
|
+
/**
|
|
1025
|
+
* REQUIRED. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the
|
|
1026
|
+
* form of a URL. The OpenID Connect standard requires the use of TLS.
|
|
1027
|
+
*/
|
|
1028
|
+
openIdConnectUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1029
|
+
}>, {
|
|
1030
|
+
uid: z.ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
|
|
1031
|
+
/** The name key that links a security requirement to a security object */
|
|
1032
|
+
nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1033
|
+
}>, "strip", z.ZodTypeAny, {
|
|
1034
|
+
type: "openIdConnect";
|
|
1035
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
1036
|
+
nameKey: string;
|
|
1037
|
+
openIdConnectUrl: string;
|
|
1038
|
+
description?: string | undefined;
|
|
1039
|
+
}, {
|
|
1040
|
+
type: "openIdConnect";
|
|
1041
|
+
description?: string | undefined;
|
|
1042
|
+
uid?: string | undefined;
|
|
1043
|
+
nameKey?: string | undefined;
|
|
1044
|
+
openIdConnectUrl?: string | undefined;
|
|
1045
|
+
}>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
1046
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1047
|
+
}, {
|
|
1048
|
+
type: z.ZodLiteral<"oauth2">;
|
|
1049
|
+
/** REQUIRED. An object containing configuration information for the flow types supported. */
|
|
1050
|
+
flows: z.ZodDefault<z.ZodObject<{
|
|
1051
|
+
implicit: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
1052
|
+
/**
|
|
1053
|
+
* The URL to be used for obtaining refresh tokens. This MUST be in the form of a
|
|
1054
|
+
* URL. The OAuth2 standard requires the use of TLS.
|
|
1055
|
+
*/
|
|
1056
|
+
refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1057
|
+
/**
|
|
1058
|
+
* REQUIRED. The available scopes for the OAuth2 security scheme. A map
|
|
1059
|
+
* between the scope name and a short description for it. The map MAY be empty.
|
|
1060
|
+
*/
|
|
1061
|
+
scopes: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodString>>>>>>;
|
|
1062
|
+
selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
1063
|
+
/** Extension to save the client Id associated with an oauth flow */
|
|
1064
|
+
'x-scalar-client-id': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1065
|
+
/** The auth token */
|
|
1066
|
+
token: z.ZodDefault<z.ZodString>;
|
|
1067
|
+
}, {
|
|
1068
|
+
type: z.ZodDefault<z.ZodLiteral<"implicit">>;
|
|
1069
|
+
authorizationUrl: z.ZodDefault<z.ZodString>;
|
|
1070
|
+
'x-scalar-redirect-uri': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1071
|
+
}>, "strip", z.ZodTypeAny, {
|
|
1072
|
+
type: "implicit";
|
|
1073
|
+
token: string;
|
|
1074
|
+
refreshUrl: string;
|
|
1075
|
+
scopes: Record<string, string>;
|
|
1076
|
+
selectedScopes: string[];
|
|
1077
|
+
'x-scalar-client-id': string;
|
|
1078
|
+
authorizationUrl: string;
|
|
1079
|
+
'x-scalar-redirect-uri': string;
|
|
1080
|
+
}, {
|
|
1081
|
+
type?: "implicit" | undefined;
|
|
1082
|
+
token?: string | undefined;
|
|
1083
|
+
refreshUrl?: string | undefined;
|
|
1084
|
+
scopes?: unknown;
|
|
1085
|
+
selectedScopes?: string[] | undefined;
|
|
1086
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1087
|
+
authorizationUrl?: string | undefined;
|
|
1088
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
1089
|
+
}>>;
|
|
1090
|
+
password: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
1091
|
+
/**
|
|
1092
|
+
* The URL to be used for obtaining refresh tokens. This MUST be in the form of a
|
|
1093
|
+
* URL. The OAuth2 standard requires the use of TLS.
|
|
1094
|
+
*/
|
|
1095
|
+
refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1096
|
+
/**
|
|
1097
|
+
* REQUIRED. The available scopes for the OAuth2 security scheme. A map
|
|
1098
|
+
* between the scope name and a short description for it. The map MAY be empty.
|
|
1099
|
+
*/
|
|
1100
|
+
scopes: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodString>>>>>>;
|
|
1101
|
+
selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
1102
|
+
/** Extension to save the client Id associated with an oauth flow */
|
|
1103
|
+
'x-scalar-client-id': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1104
|
+
/** The auth token */
|
|
1105
|
+
token: z.ZodDefault<z.ZodString>;
|
|
1106
|
+
}, {
|
|
1107
|
+
type: z.ZodDefault<z.ZodLiteral<"password">>;
|
|
1108
|
+
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
1109
|
+
clientSecret: z.ZodDefault<z.ZodString>;
|
|
1110
|
+
username: z.ZodDefault<z.ZodString>;
|
|
1111
|
+
password: z.ZodDefault<z.ZodString>;
|
|
1112
|
+
}>, "strip", z.ZodTypeAny, {
|
|
1113
|
+
type: "password";
|
|
1114
|
+
username: string;
|
|
1115
|
+
password: string;
|
|
1116
|
+
token: string;
|
|
1117
|
+
refreshUrl: string;
|
|
1118
|
+
scopes: Record<string, string>;
|
|
1119
|
+
selectedScopes: string[];
|
|
1120
|
+
'x-scalar-client-id': string;
|
|
1121
|
+
tokenUrl: string;
|
|
1122
|
+
clientSecret: string;
|
|
1123
|
+
}, {
|
|
1124
|
+
type?: "password" | undefined;
|
|
1125
|
+
username?: string | undefined;
|
|
1126
|
+
password?: string | undefined;
|
|
1127
|
+
token?: string | undefined;
|
|
1128
|
+
refreshUrl?: string | undefined;
|
|
1129
|
+
scopes?: unknown;
|
|
1130
|
+
selectedScopes?: string[] | undefined;
|
|
1131
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1132
|
+
tokenUrl?: string | undefined;
|
|
1133
|
+
clientSecret?: string | undefined;
|
|
1134
|
+
}>>;
|
|
1135
|
+
clientCredentials: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
1136
|
+
/**
|
|
1137
|
+
* The URL to be used for obtaining refresh tokens. This MUST be in the form of a
|
|
1138
|
+
* URL. The OAuth2 standard requires the use of TLS.
|
|
1139
|
+
*/
|
|
1140
|
+
refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1141
|
+
/**
|
|
1142
|
+
* REQUIRED. The available scopes for the OAuth2 security scheme. A map
|
|
1143
|
+
* between the scope name and a short description for it. The map MAY be empty.
|
|
1144
|
+
*/
|
|
1145
|
+
scopes: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodString>>>>>>;
|
|
1146
|
+
selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
1147
|
+
/** Extension to save the client Id associated with an oauth flow */
|
|
1148
|
+
'x-scalar-client-id': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1149
|
+
/** The auth token */
|
|
1150
|
+
token: z.ZodDefault<z.ZodString>;
|
|
1151
|
+
}, {
|
|
1152
|
+
type: z.ZodDefault<z.ZodLiteral<"clientCredentials">>;
|
|
1153
|
+
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
1154
|
+
clientSecret: z.ZodDefault<z.ZodString>;
|
|
1155
|
+
}>, "strip", z.ZodTypeAny, {
|
|
1156
|
+
type: "clientCredentials";
|
|
1157
|
+
token: string;
|
|
1158
|
+
refreshUrl: string;
|
|
1159
|
+
scopes: Record<string, string>;
|
|
1160
|
+
selectedScopes: string[];
|
|
1161
|
+
'x-scalar-client-id': string;
|
|
1162
|
+
tokenUrl: string;
|
|
1163
|
+
clientSecret: string;
|
|
1164
|
+
}, {
|
|
1165
|
+
type?: "clientCredentials" | undefined;
|
|
1166
|
+
token?: string | undefined;
|
|
1167
|
+
refreshUrl?: string | undefined;
|
|
1168
|
+
scopes?: unknown;
|
|
1169
|
+
selectedScopes?: string[] | undefined;
|
|
1170
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1171
|
+
tokenUrl?: string | undefined;
|
|
1172
|
+
clientSecret?: string | undefined;
|
|
1173
|
+
}>>;
|
|
1174
|
+
authorizationCode: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
1175
|
+
/**
|
|
1176
|
+
* The URL to be used for obtaining refresh tokens. This MUST be in the form of a
|
|
1177
|
+
* URL. The OAuth2 standard requires the use of TLS.
|
|
1178
|
+
*/
|
|
1179
|
+
refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1180
|
+
/**
|
|
1181
|
+
* REQUIRED. The available scopes for the OAuth2 security scheme. A map
|
|
1182
|
+
* between the scope name and a short description for it. The map MAY be empty.
|
|
1183
|
+
*/
|
|
1184
|
+
scopes: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodString>>>>>>;
|
|
1185
|
+
selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
1186
|
+
/** Extension to save the client Id associated with an oauth flow */
|
|
1187
|
+
'x-scalar-client-id': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1188
|
+
/** The auth token */
|
|
1189
|
+
token: z.ZodDefault<z.ZodString>;
|
|
1190
|
+
}, {
|
|
1191
|
+
type: z.ZodDefault<z.ZodLiteral<"authorizationCode">>;
|
|
1192
|
+
authorizationUrl: z.ZodDefault<z.ZodString>;
|
|
1193
|
+
/**
|
|
1194
|
+
* Whether to use PKCE for the authorization code flow.
|
|
1195
|
+
*
|
|
1196
|
+
* TODO: add docs
|
|
1197
|
+
*/
|
|
1198
|
+
'x-usePkce': z.ZodDefault<z.ZodOptional<z.ZodEnum<["SHA-256", "plain", "no"]>>>;
|
|
1199
|
+
'x-scalar-redirect-uri': z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1200
|
+
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
1201
|
+
clientSecret: z.ZodDefault<z.ZodString>;
|
|
1202
|
+
}>, "strip", z.ZodTypeAny, {
|
|
1203
|
+
type: "authorizationCode";
|
|
1204
|
+
token: string;
|
|
1205
|
+
refreshUrl: string;
|
|
1206
|
+
scopes: Record<string, string>;
|
|
1207
|
+
selectedScopes: string[];
|
|
1208
|
+
'x-scalar-client-id': string;
|
|
1209
|
+
authorizationUrl: string;
|
|
1210
|
+
'x-scalar-redirect-uri': string;
|
|
1211
|
+
tokenUrl: string;
|
|
1212
|
+
clientSecret: string;
|
|
1213
|
+
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
1214
|
+
}, {
|
|
1215
|
+
type?: "authorizationCode" | undefined;
|
|
1216
|
+
token?: string | undefined;
|
|
1217
|
+
refreshUrl?: string | undefined;
|
|
1218
|
+
scopes?: unknown;
|
|
1219
|
+
selectedScopes?: string[] | undefined;
|
|
1220
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1221
|
+
authorizationUrl?: string | undefined;
|
|
1222
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
1223
|
+
tokenUrl?: string | undefined;
|
|
1224
|
+
clientSecret?: string | undefined;
|
|
1225
|
+
'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
|
|
1226
|
+
}>>;
|
|
1227
|
+
}, "strip", z.ZodTypeAny, {
|
|
1228
|
+
password?: {
|
|
1229
|
+
type: "password";
|
|
1230
|
+
username: string;
|
|
1231
|
+
password: string;
|
|
1232
|
+
token: string;
|
|
1233
|
+
refreshUrl: string;
|
|
1234
|
+
scopes: Record<string, string>;
|
|
1235
|
+
selectedScopes: string[];
|
|
1236
|
+
'x-scalar-client-id': string;
|
|
1237
|
+
tokenUrl: string;
|
|
1238
|
+
clientSecret: string;
|
|
1239
|
+
} | undefined;
|
|
1240
|
+
implicit?: {
|
|
1241
|
+
type: "implicit";
|
|
1242
|
+
token: string;
|
|
1243
|
+
refreshUrl: string;
|
|
1244
|
+
scopes: Record<string, string>;
|
|
1245
|
+
selectedScopes: string[];
|
|
1246
|
+
'x-scalar-client-id': string;
|
|
1247
|
+
authorizationUrl: string;
|
|
1248
|
+
'x-scalar-redirect-uri': string;
|
|
1249
|
+
} | undefined;
|
|
1250
|
+
clientCredentials?: {
|
|
1251
|
+
type: "clientCredentials";
|
|
1252
|
+
token: string;
|
|
1253
|
+
refreshUrl: string;
|
|
1254
|
+
scopes: Record<string, string>;
|
|
1255
|
+
selectedScopes: string[];
|
|
1256
|
+
'x-scalar-client-id': string;
|
|
1257
|
+
tokenUrl: string;
|
|
1258
|
+
clientSecret: string;
|
|
1259
|
+
} | undefined;
|
|
1260
|
+
authorizationCode?: {
|
|
1261
|
+
type: "authorizationCode";
|
|
1262
|
+
token: string;
|
|
1263
|
+
refreshUrl: string;
|
|
1264
|
+
scopes: Record<string, string>;
|
|
1265
|
+
selectedScopes: string[];
|
|
1266
|
+
'x-scalar-client-id': string;
|
|
1267
|
+
authorizationUrl: string;
|
|
1268
|
+
'x-scalar-redirect-uri': string;
|
|
1269
|
+
tokenUrl: string;
|
|
1270
|
+
clientSecret: string;
|
|
1271
|
+
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
1272
|
+
} | undefined;
|
|
1273
|
+
}, {
|
|
1274
|
+
password?: {
|
|
1275
|
+
type?: "password" | undefined;
|
|
1276
|
+
username?: string | undefined;
|
|
1277
|
+
password?: string | undefined;
|
|
1278
|
+
token?: string | undefined;
|
|
1279
|
+
refreshUrl?: string | undefined;
|
|
1280
|
+
scopes?: unknown;
|
|
1281
|
+
selectedScopes?: string[] | undefined;
|
|
1282
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1283
|
+
tokenUrl?: string | undefined;
|
|
1284
|
+
clientSecret?: string | undefined;
|
|
1285
|
+
} | undefined;
|
|
1286
|
+
implicit?: {
|
|
1287
|
+
type?: "implicit" | undefined;
|
|
1288
|
+
token?: string | undefined;
|
|
1289
|
+
refreshUrl?: string | undefined;
|
|
1290
|
+
scopes?: unknown;
|
|
1291
|
+
selectedScopes?: string[] | undefined;
|
|
1292
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1293
|
+
authorizationUrl?: string | undefined;
|
|
1294
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
1295
|
+
} | undefined;
|
|
1296
|
+
clientCredentials?: {
|
|
1297
|
+
type?: "clientCredentials" | undefined;
|
|
1298
|
+
token?: string | undefined;
|
|
1299
|
+
refreshUrl?: string | undefined;
|
|
1300
|
+
scopes?: unknown;
|
|
1301
|
+
selectedScopes?: string[] | undefined;
|
|
1302
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1303
|
+
tokenUrl?: string | undefined;
|
|
1304
|
+
clientSecret?: string | undefined;
|
|
1305
|
+
} | undefined;
|
|
1306
|
+
authorizationCode?: {
|
|
1307
|
+
type?: "authorizationCode" | undefined;
|
|
1308
|
+
token?: string | undefined;
|
|
1309
|
+
refreshUrl?: string | undefined;
|
|
1310
|
+
scopes?: unknown;
|
|
1311
|
+
selectedScopes?: string[] | undefined;
|
|
1312
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1313
|
+
authorizationUrl?: string | undefined;
|
|
1314
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
1315
|
+
tokenUrl?: string | undefined;
|
|
1316
|
+
clientSecret?: string | undefined;
|
|
1317
|
+
'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
|
|
1318
|
+
} | undefined;
|
|
1319
|
+
}>>;
|
|
1320
|
+
}>, {
|
|
1321
|
+
uid: z.ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
|
|
1322
|
+
/** The name key that links a security requirement to a security object */
|
|
1323
|
+
nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1324
|
+
}>, "strip", z.ZodTypeAny, {
|
|
1325
|
+
type: "oauth2";
|
|
1326
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
1327
|
+
nameKey: string;
|
|
1328
|
+
flows: {
|
|
1329
|
+
password?: {
|
|
1330
|
+
type: "password";
|
|
1331
|
+
username: string;
|
|
1332
|
+
password: string;
|
|
1333
|
+
token: string;
|
|
1334
|
+
refreshUrl: string;
|
|
1335
|
+
scopes: Record<string, string>;
|
|
1336
|
+
selectedScopes: string[];
|
|
1337
|
+
'x-scalar-client-id': string;
|
|
1338
|
+
tokenUrl: string;
|
|
1339
|
+
clientSecret: string;
|
|
1340
|
+
} | undefined;
|
|
1341
|
+
implicit?: {
|
|
1342
|
+
type: "implicit";
|
|
1343
|
+
token: string;
|
|
1344
|
+
refreshUrl: string;
|
|
1345
|
+
scopes: Record<string, string>;
|
|
1346
|
+
selectedScopes: string[];
|
|
1347
|
+
'x-scalar-client-id': string;
|
|
1348
|
+
authorizationUrl: string;
|
|
1349
|
+
'x-scalar-redirect-uri': string;
|
|
1350
|
+
} | undefined;
|
|
1351
|
+
clientCredentials?: {
|
|
1352
|
+
type: "clientCredentials";
|
|
1353
|
+
token: string;
|
|
1354
|
+
refreshUrl: string;
|
|
1355
|
+
scopes: Record<string, string>;
|
|
1356
|
+
selectedScopes: string[];
|
|
1357
|
+
'x-scalar-client-id': string;
|
|
1358
|
+
tokenUrl: string;
|
|
1359
|
+
clientSecret: string;
|
|
1360
|
+
} | undefined;
|
|
1361
|
+
authorizationCode?: {
|
|
1362
|
+
type: "authorizationCode";
|
|
1363
|
+
token: string;
|
|
1364
|
+
refreshUrl: string;
|
|
1365
|
+
scopes: Record<string, string>;
|
|
1366
|
+
selectedScopes: string[];
|
|
1367
|
+
'x-scalar-client-id': string;
|
|
1368
|
+
authorizationUrl: string;
|
|
1369
|
+
'x-scalar-redirect-uri': string;
|
|
1370
|
+
tokenUrl: string;
|
|
1371
|
+
clientSecret: string;
|
|
1372
|
+
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
1373
|
+
} | undefined;
|
|
1374
|
+
};
|
|
1375
|
+
description?: string | undefined;
|
|
1376
|
+
}, {
|
|
1377
|
+
type: "oauth2";
|
|
1378
|
+
description?: string | undefined;
|
|
1379
|
+
uid?: string | undefined;
|
|
1380
|
+
nameKey?: string | undefined;
|
|
1381
|
+
flows?: {
|
|
1382
|
+
password?: {
|
|
1383
|
+
type?: "password" | undefined;
|
|
1384
|
+
username?: string | undefined;
|
|
1385
|
+
password?: string | undefined;
|
|
1386
|
+
token?: string | undefined;
|
|
1387
|
+
refreshUrl?: string | undefined;
|
|
1388
|
+
scopes?: unknown;
|
|
1389
|
+
selectedScopes?: string[] | undefined;
|
|
1390
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1391
|
+
tokenUrl?: string | undefined;
|
|
1392
|
+
clientSecret?: string | undefined;
|
|
1393
|
+
} | undefined;
|
|
1394
|
+
implicit?: {
|
|
1395
|
+
type?: "implicit" | undefined;
|
|
1396
|
+
token?: string | undefined;
|
|
1397
|
+
refreshUrl?: string | undefined;
|
|
1398
|
+
scopes?: unknown;
|
|
1399
|
+
selectedScopes?: string[] | undefined;
|
|
1400
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1401
|
+
authorizationUrl?: string | undefined;
|
|
1402
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
1403
|
+
} | undefined;
|
|
1404
|
+
clientCredentials?: {
|
|
1405
|
+
type?: "clientCredentials" | undefined;
|
|
1406
|
+
token?: string | undefined;
|
|
1407
|
+
refreshUrl?: string | undefined;
|
|
1408
|
+
scopes?: unknown;
|
|
1409
|
+
selectedScopes?: string[] | undefined;
|
|
1410
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1411
|
+
tokenUrl?: string | undefined;
|
|
1412
|
+
clientSecret?: string | undefined;
|
|
1413
|
+
} | undefined;
|
|
1414
|
+
authorizationCode?: {
|
|
1415
|
+
type?: "authorizationCode" | undefined;
|
|
1416
|
+
token?: string | undefined;
|
|
1417
|
+
refreshUrl?: string | undefined;
|
|
1418
|
+
scopes?: unknown;
|
|
1419
|
+
selectedScopes?: string[] | undefined;
|
|
1420
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1421
|
+
authorizationUrl?: string | undefined;
|
|
1422
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
1423
|
+
tokenUrl?: string | undefined;
|
|
1424
|
+
clientSecret?: string | undefined;
|
|
1425
|
+
'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
|
|
1426
|
+
} | undefined;
|
|
1427
|
+
} | undefined;
|
|
1428
|
+
}>]>;
|
|
1429
|
+
/**
|
|
1430
|
+
* Security Scheme Object
|
|
1431
|
+
*
|
|
1432
|
+
* @see https://spec.openapis.org/oas/latest.html#security-scheme-object
|
|
1433
|
+
*/
|
|
1434
|
+
export type SecurityScheme = z.infer<typeof securitySchemeSchema>;
|
|
1435
|
+
export type SecuritySchemePayload = z.input<typeof securitySchemeSchema>;
|
|
1436
|
+
//# sourceMappingURL=security-scheme.d.ts.map
|