@scalar/types 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @scalar/types
|
|
2
2
|
|
|
3
|
+
## 0.2.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 591562f: feat: add support for x-scalar-security-body extension
|
|
8
|
+
- Updated dependencies [591562f]
|
|
9
|
+
- @scalar/openapi-types@0.3.6
|
|
10
|
+
|
|
11
|
+
## 0.2.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- c10e191: feat(oauth2): add support for x-tokenName extension
|
|
16
|
+
|
|
3
17
|
## 0.2.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -132,6 +132,10 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
132
132
|
token: z.ZodDefault<z.ZodString>;
|
|
133
133
|
/** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */
|
|
134
134
|
'x-scalar-security-query': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
135
|
+
/** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */
|
|
136
|
+
'x-scalar-security-body': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
137
|
+
/** Extension to specify custom token name in the response (defaults to 'access_token') */
|
|
138
|
+
'x-tokenName': z.ZodOptional<z.ZodString>;
|
|
135
139
|
}, {
|
|
136
140
|
type: z.ZodDefault<z.ZodLiteral<"implicit">>;
|
|
137
141
|
authorizationUrl: z.ZodDefault<z.ZodString>;
|
|
@@ -146,6 +150,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
146
150
|
authorizationUrl: string;
|
|
147
151
|
'x-scalar-redirect-uri': string;
|
|
148
152
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
153
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
154
|
+
'x-tokenName'?: string | undefined;
|
|
149
155
|
}, {
|
|
150
156
|
type?: "implicit" | undefined;
|
|
151
157
|
token?: string | undefined;
|
|
@@ -154,6 +160,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
154
160
|
selectedScopes?: string[] | undefined;
|
|
155
161
|
'x-scalar-client-id'?: string | undefined;
|
|
156
162
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
163
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
164
|
+
'x-tokenName'?: string | undefined;
|
|
157
165
|
authorizationUrl?: string | undefined;
|
|
158
166
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
159
167
|
}>>;
|
|
@@ -175,6 +183,10 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
175
183
|
token: z.ZodDefault<z.ZodString>;
|
|
176
184
|
/** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */
|
|
177
185
|
'x-scalar-security-query': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
186
|
+
/** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */
|
|
187
|
+
'x-scalar-security-body': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
188
|
+
/** Extension to specify custom token name in the response (defaults to 'access_token') */
|
|
189
|
+
'x-tokenName': z.ZodOptional<z.ZodString>;
|
|
178
190
|
}, {
|
|
179
191
|
type: z.ZodDefault<z.ZodLiteral<"password">>;
|
|
180
192
|
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
@@ -193,6 +205,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
193
205
|
tokenUrl: string;
|
|
194
206
|
clientSecret: string;
|
|
195
207
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
208
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
209
|
+
'x-tokenName'?: string | undefined;
|
|
196
210
|
}, {
|
|
197
211
|
type?: "password" | undefined;
|
|
198
212
|
username?: string | undefined;
|
|
@@ -203,6 +217,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
203
217
|
selectedScopes?: string[] | undefined;
|
|
204
218
|
'x-scalar-client-id'?: string | undefined;
|
|
205
219
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
220
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
221
|
+
'x-tokenName'?: string | undefined;
|
|
206
222
|
tokenUrl?: string | undefined;
|
|
207
223
|
clientSecret?: string | undefined;
|
|
208
224
|
}>>;
|
|
@@ -224,6 +240,10 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
224
240
|
token: z.ZodDefault<z.ZodString>;
|
|
225
241
|
/** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */
|
|
226
242
|
'x-scalar-security-query': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
243
|
+
/** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */
|
|
244
|
+
'x-scalar-security-body': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
245
|
+
/** Extension to specify custom token name in the response (defaults to 'access_token') */
|
|
246
|
+
'x-tokenName': z.ZodOptional<z.ZodString>;
|
|
227
247
|
}, {
|
|
228
248
|
type: z.ZodDefault<z.ZodLiteral<"clientCredentials">>;
|
|
229
249
|
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
@@ -238,6 +258,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
238
258
|
tokenUrl: string;
|
|
239
259
|
clientSecret: string;
|
|
240
260
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
261
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
262
|
+
'x-tokenName'?: string | undefined;
|
|
241
263
|
}, {
|
|
242
264
|
type?: "clientCredentials" | undefined;
|
|
243
265
|
token?: string | undefined;
|
|
@@ -246,6 +268,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
246
268
|
selectedScopes?: string[] | undefined;
|
|
247
269
|
'x-scalar-client-id'?: string | undefined;
|
|
248
270
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
271
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
272
|
+
'x-tokenName'?: string | undefined;
|
|
249
273
|
tokenUrl?: string | undefined;
|
|
250
274
|
clientSecret?: string | undefined;
|
|
251
275
|
}>>;
|
|
@@ -267,6 +291,10 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
267
291
|
token: z.ZodDefault<z.ZodString>;
|
|
268
292
|
/** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */
|
|
269
293
|
'x-scalar-security-query': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
294
|
+
/** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */
|
|
295
|
+
'x-scalar-security-body': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
296
|
+
/** Extension to specify custom token name in the response (defaults to 'access_token') */
|
|
297
|
+
'x-tokenName': z.ZodOptional<z.ZodString>;
|
|
270
298
|
}, {
|
|
271
299
|
type: z.ZodDefault<z.ZodLiteral<"authorizationCode">>;
|
|
272
300
|
authorizationUrl: z.ZodDefault<z.ZodString>;
|
|
@@ -287,6 +315,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
287
315
|
clientSecret: string;
|
|
288
316
|
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
289
317
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
318
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
319
|
+
'x-tokenName'?: string | undefined;
|
|
290
320
|
}, {
|
|
291
321
|
type?: "authorizationCode" | undefined;
|
|
292
322
|
token?: string | undefined;
|
|
@@ -295,6 +325,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
295
325
|
selectedScopes?: string[] | undefined;
|
|
296
326
|
'x-scalar-client-id'?: string | undefined;
|
|
297
327
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
328
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
329
|
+
'x-tokenName'?: string | undefined;
|
|
298
330
|
authorizationUrl?: string | undefined;
|
|
299
331
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
300
332
|
tokenUrl?: string | undefined;
|
|
@@ -314,6 +346,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
314
346
|
tokenUrl: string;
|
|
315
347
|
clientSecret: string;
|
|
316
348
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
349
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
350
|
+
'x-tokenName'?: string | undefined;
|
|
317
351
|
} | undefined;
|
|
318
352
|
implicit?: {
|
|
319
353
|
type: "implicit";
|
|
@@ -325,6 +359,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
325
359
|
authorizationUrl: string;
|
|
326
360
|
'x-scalar-redirect-uri': string;
|
|
327
361
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
362
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
363
|
+
'x-tokenName'?: string | undefined;
|
|
328
364
|
} | undefined;
|
|
329
365
|
clientCredentials?: {
|
|
330
366
|
type: "clientCredentials";
|
|
@@ -336,6 +372,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
336
372
|
tokenUrl: string;
|
|
337
373
|
clientSecret: string;
|
|
338
374
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
375
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
376
|
+
'x-tokenName'?: string | undefined;
|
|
339
377
|
} | undefined;
|
|
340
378
|
authorizationCode?: {
|
|
341
379
|
type: "authorizationCode";
|
|
@@ -350,6 +388,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
350
388
|
clientSecret: string;
|
|
351
389
|
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
352
390
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
391
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
392
|
+
'x-tokenName'?: string | undefined;
|
|
353
393
|
} | undefined;
|
|
354
394
|
}, {
|
|
355
395
|
password?: {
|
|
@@ -362,6 +402,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
362
402
|
selectedScopes?: string[] | undefined;
|
|
363
403
|
'x-scalar-client-id'?: string | undefined;
|
|
364
404
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
405
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
406
|
+
'x-tokenName'?: string | undefined;
|
|
365
407
|
tokenUrl?: string | undefined;
|
|
366
408
|
clientSecret?: string | undefined;
|
|
367
409
|
} | undefined;
|
|
@@ -373,6 +415,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
373
415
|
selectedScopes?: string[] | undefined;
|
|
374
416
|
'x-scalar-client-id'?: string | undefined;
|
|
375
417
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
418
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
419
|
+
'x-tokenName'?: string | undefined;
|
|
376
420
|
authorizationUrl?: string | undefined;
|
|
377
421
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
378
422
|
} | undefined;
|
|
@@ -384,6 +428,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
384
428
|
selectedScopes?: string[] | undefined;
|
|
385
429
|
'x-scalar-client-id'?: string | undefined;
|
|
386
430
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
431
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
432
|
+
'x-tokenName'?: string | undefined;
|
|
387
433
|
tokenUrl?: string | undefined;
|
|
388
434
|
clientSecret?: string | undefined;
|
|
389
435
|
} | undefined;
|
|
@@ -395,6 +441,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
395
441
|
selectedScopes?: string[] | undefined;
|
|
396
442
|
'x-scalar-client-id'?: string | undefined;
|
|
397
443
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
444
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
445
|
+
'x-tokenName'?: string | undefined;
|
|
398
446
|
authorizationUrl?: string | undefined;
|
|
399
447
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
400
448
|
tokenUrl?: string | undefined;
|
|
@@ -423,6 +471,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
423
471
|
tokenUrl: string;
|
|
424
472
|
clientSecret: string;
|
|
425
473
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
474
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
475
|
+
'x-tokenName'?: string | undefined;
|
|
426
476
|
} | undefined;
|
|
427
477
|
implicit?: {
|
|
428
478
|
type: "implicit";
|
|
@@ -434,6 +484,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
434
484
|
authorizationUrl: string;
|
|
435
485
|
'x-scalar-redirect-uri': string;
|
|
436
486
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
487
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
488
|
+
'x-tokenName'?: string | undefined;
|
|
437
489
|
} | undefined;
|
|
438
490
|
clientCredentials?: {
|
|
439
491
|
type: "clientCredentials";
|
|
@@ -445,6 +497,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
445
497
|
tokenUrl: string;
|
|
446
498
|
clientSecret: string;
|
|
447
499
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
500
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
501
|
+
'x-tokenName'?: string | undefined;
|
|
448
502
|
} | undefined;
|
|
449
503
|
authorizationCode?: {
|
|
450
504
|
type: "authorizationCode";
|
|
@@ -459,6 +513,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
459
513
|
clientSecret: string;
|
|
460
514
|
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
461
515
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
516
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
517
|
+
'x-tokenName'?: string | undefined;
|
|
462
518
|
} | undefined;
|
|
463
519
|
};
|
|
464
520
|
description?: string | undefined;
|
|
@@ -480,6 +536,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
480
536
|
selectedScopes?: string[] | undefined;
|
|
481
537
|
'x-scalar-client-id'?: string | undefined;
|
|
482
538
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
539
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
540
|
+
'x-tokenName'?: string | undefined;
|
|
483
541
|
tokenUrl?: string | undefined;
|
|
484
542
|
clientSecret?: string | undefined;
|
|
485
543
|
} | undefined;
|
|
@@ -491,6 +549,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
491
549
|
selectedScopes?: string[] | undefined;
|
|
492
550
|
'x-scalar-client-id'?: string | undefined;
|
|
493
551
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
552
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
553
|
+
'x-tokenName'?: string | undefined;
|
|
494
554
|
authorizationUrl?: string | undefined;
|
|
495
555
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
496
556
|
} | undefined;
|
|
@@ -502,6 +562,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
502
562
|
selectedScopes?: string[] | undefined;
|
|
503
563
|
'x-scalar-client-id'?: string | undefined;
|
|
504
564
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
565
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
566
|
+
'x-tokenName'?: string | undefined;
|
|
505
567
|
tokenUrl?: string | undefined;
|
|
506
568
|
clientSecret?: string | undefined;
|
|
507
569
|
} | undefined;
|
|
@@ -513,6 +575,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
513
575
|
selectedScopes?: string[] | undefined;
|
|
514
576
|
'x-scalar-client-id'?: string | undefined;
|
|
515
577
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
578
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
579
|
+
'x-tokenName'?: string | undefined;
|
|
516
580
|
authorizationUrl?: string | undefined;
|
|
517
581
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
518
582
|
tokenUrl?: string | undefined;
|
|
@@ -607,6 +671,10 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
607
671
|
token: z.ZodDefault<z.ZodString>;
|
|
608
672
|
/** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */
|
|
609
673
|
'x-scalar-security-query': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
674
|
+
/** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */
|
|
675
|
+
'x-scalar-security-body': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
676
|
+
/** Extension to specify custom token name in the response (defaults to 'access_token') */
|
|
677
|
+
'x-tokenName': z.ZodOptional<z.ZodString>;
|
|
610
678
|
}, {
|
|
611
679
|
type: z.ZodDefault<z.ZodLiteral<"implicit">>;
|
|
612
680
|
authorizationUrl: z.ZodDefault<z.ZodString>;
|
|
@@ -621,6 +689,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
621
689
|
authorizationUrl: string;
|
|
622
690
|
'x-scalar-redirect-uri': string;
|
|
623
691
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
692
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
693
|
+
'x-tokenName'?: string | undefined;
|
|
624
694
|
}, {
|
|
625
695
|
type?: "implicit" | undefined;
|
|
626
696
|
token?: string | undefined;
|
|
@@ -629,6 +699,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
629
699
|
selectedScopes?: string[] | undefined;
|
|
630
700
|
'x-scalar-client-id'?: string | undefined;
|
|
631
701
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
702
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
703
|
+
'x-tokenName'?: string | undefined;
|
|
632
704
|
authorizationUrl?: string | undefined;
|
|
633
705
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
634
706
|
}>>;
|
|
@@ -650,6 +722,10 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
650
722
|
token: z.ZodDefault<z.ZodString>;
|
|
651
723
|
/** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */
|
|
652
724
|
'x-scalar-security-query': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
725
|
+
/** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */
|
|
726
|
+
'x-scalar-security-body': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
727
|
+
/** Extension to specify custom token name in the response (defaults to 'access_token') */
|
|
728
|
+
'x-tokenName': z.ZodOptional<z.ZodString>;
|
|
653
729
|
}, {
|
|
654
730
|
type: z.ZodDefault<z.ZodLiteral<"password">>;
|
|
655
731
|
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
@@ -668,6 +744,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
668
744
|
tokenUrl: string;
|
|
669
745
|
clientSecret: string;
|
|
670
746
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
747
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
748
|
+
'x-tokenName'?: string | undefined;
|
|
671
749
|
}, {
|
|
672
750
|
type?: "password" | undefined;
|
|
673
751
|
username?: string | undefined;
|
|
@@ -678,6 +756,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
678
756
|
selectedScopes?: string[] | undefined;
|
|
679
757
|
'x-scalar-client-id'?: string | undefined;
|
|
680
758
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
759
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
760
|
+
'x-tokenName'?: string | undefined;
|
|
681
761
|
tokenUrl?: string | undefined;
|
|
682
762
|
clientSecret?: string | undefined;
|
|
683
763
|
}>>;
|
|
@@ -699,6 +779,10 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
699
779
|
token: z.ZodDefault<z.ZodString>;
|
|
700
780
|
/** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */
|
|
701
781
|
'x-scalar-security-query': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
782
|
+
/** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */
|
|
783
|
+
'x-scalar-security-body': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
784
|
+
/** Extension to specify custom token name in the response (defaults to 'access_token') */
|
|
785
|
+
'x-tokenName': z.ZodOptional<z.ZodString>;
|
|
702
786
|
}, {
|
|
703
787
|
type: z.ZodDefault<z.ZodLiteral<"clientCredentials">>;
|
|
704
788
|
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
@@ -713,6 +797,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
713
797
|
tokenUrl: string;
|
|
714
798
|
clientSecret: string;
|
|
715
799
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
800
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
801
|
+
'x-tokenName'?: string | undefined;
|
|
716
802
|
}, {
|
|
717
803
|
type?: "clientCredentials" | undefined;
|
|
718
804
|
token?: string | undefined;
|
|
@@ -721,6 +807,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
721
807
|
selectedScopes?: string[] | undefined;
|
|
722
808
|
'x-scalar-client-id'?: string | undefined;
|
|
723
809
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
810
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
811
|
+
'x-tokenName'?: string | undefined;
|
|
724
812
|
tokenUrl?: string | undefined;
|
|
725
813
|
clientSecret?: string | undefined;
|
|
726
814
|
}>>;
|
|
@@ -742,6 +830,10 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
742
830
|
token: z.ZodDefault<z.ZodString>;
|
|
743
831
|
/** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */
|
|
744
832
|
'x-scalar-security-query': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
833
|
+
/** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */
|
|
834
|
+
'x-scalar-security-body': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
835
|
+
/** Extension to specify custom token name in the response (defaults to 'access_token') */
|
|
836
|
+
'x-tokenName': z.ZodOptional<z.ZodString>;
|
|
745
837
|
}, {
|
|
746
838
|
type: z.ZodDefault<z.ZodLiteral<"authorizationCode">>;
|
|
747
839
|
authorizationUrl: z.ZodDefault<z.ZodString>;
|
|
@@ -762,6 +854,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
762
854
|
clientSecret: string;
|
|
763
855
|
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
764
856
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
857
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
858
|
+
'x-tokenName'?: string | undefined;
|
|
765
859
|
}, {
|
|
766
860
|
type?: "authorizationCode" | undefined;
|
|
767
861
|
token?: string | undefined;
|
|
@@ -770,6 +864,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
770
864
|
selectedScopes?: string[] | undefined;
|
|
771
865
|
'x-scalar-client-id'?: string | undefined;
|
|
772
866
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
867
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
868
|
+
'x-tokenName'?: string | undefined;
|
|
773
869
|
authorizationUrl?: string | undefined;
|
|
774
870
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
775
871
|
tokenUrl?: string | undefined;
|
|
@@ -789,6 +885,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
789
885
|
tokenUrl: string;
|
|
790
886
|
clientSecret: string;
|
|
791
887
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
888
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
889
|
+
'x-tokenName'?: string | undefined;
|
|
792
890
|
} | undefined;
|
|
793
891
|
implicit?: {
|
|
794
892
|
type: "implicit";
|
|
@@ -800,6 +898,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
800
898
|
authorizationUrl: string;
|
|
801
899
|
'x-scalar-redirect-uri': string;
|
|
802
900
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
901
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
902
|
+
'x-tokenName'?: string | undefined;
|
|
803
903
|
} | undefined;
|
|
804
904
|
clientCredentials?: {
|
|
805
905
|
type: "clientCredentials";
|
|
@@ -811,6 +911,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
811
911
|
tokenUrl: string;
|
|
812
912
|
clientSecret: string;
|
|
813
913
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
914
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
915
|
+
'x-tokenName'?: string | undefined;
|
|
814
916
|
} | undefined;
|
|
815
917
|
authorizationCode?: {
|
|
816
918
|
type: "authorizationCode";
|
|
@@ -825,6 +927,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
825
927
|
clientSecret: string;
|
|
826
928
|
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
827
929
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
930
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
931
|
+
'x-tokenName'?: string | undefined;
|
|
828
932
|
} | undefined;
|
|
829
933
|
}, {
|
|
830
934
|
password?: {
|
|
@@ -837,6 +941,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
837
941
|
selectedScopes?: string[] | undefined;
|
|
838
942
|
'x-scalar-client-id'?: string | undefined;
|
|
839
943
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
944
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
945
|
+
'x-tokenName'?: string | undefined;
|
|
840
946
|
tokenUrl?: string | undefined;
|
|
841
947
|
clientSecret?: string | undefined;
|
|
842
948
|
} | undefined;
|
|
@@ -848,6 +954,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
848
954
|
selectedScopes?: string[] | undefined;
|
|
849
955
|
'x-scalar-client-id'?: string | undefined;
|
|
850
956
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
957
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
958
|
+
'x-tokenName'?: string | undefined;
|
|
851
959
|
authorizationUrl?: string | undefined;
|
|
852
960
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
853
961
|
} | undefined;
|
|
@@ -859,6 +967,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
859
967
|
selectedScopes?: string[] | undefined;
|
|
860
968
|
'x-scalar-client-id'?: string | undefined;
|
|
861
969
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
970
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
971
|
+
'x-tokenName'?: string | undefined;
|
|
862
972
|
tokenUrl?: string | undefined;
|
|
863
973
|
clientSecret?: string | undefined;
|
|
864
974
|
} | undefined;
|
|
@@ -870,6 +980,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
870
980
|
selectedScopes?: string[] | undefined;
|
|
871
981
|
'x-scalar-client-id'?: string | undefined;
|
|
872
982
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
983
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
984
|
+
'x-tokenName'?: string | undefined;
|
|
873
985
|
authorizationUrl?: string | undefined;
|
|
874
986
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
875
987
|
tokenUrl?: string | undefined;
|
|
@@ -892,6 +1004,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
892
1004
|
tokenUrl: string;
|
|
893
1005
|
clientSecret: string;
|
|
894
1006
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1007
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1008
|
+
'x-tokenName'?: string | undefined;
|
|
895
1009
|
} | undefined;
|
|
896
1010
|
implicit?: {
|
|
897
1011
|
type: "implicit";
|
|
@@ -903,6 +1017,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
903
1017
|
authorizationUrl: string;
|
|
904
1018
|
'x-scalar-redirect-uri': string;
|
|
905
1019
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1020
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1021
|
+
'x-tokenName'?: string | undefined;
|
|
906
1022
|
} | undefined;
|
|
907
1023
|
clientCredentials?: {
|
|
908
1024
|
type: "clientCredentials";
|
|
@@ -914,6 +1030,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
914
1030
|
tokenUrl: string;
|
|
915
1031
|
clientSecret: string;
|
|
916
1032
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1033
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1034
|
+
'x-tokenName'?: string | undefined;
|
|
917
1035
|
} | undefined;
|
|
918
1036
|
authorizationCode?: {
|
|
919
1037
|
type: "authorizationCode";
|
|
@@ -928,6 +1046,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
928
1046
|
clientSecret: string;
|
|
929
1047
|
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
930
1048
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1049
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1050
|
+
'x-tokenName'?: string | undefined;
|
|
931
1051
|
} | undefined;
|
|
932
1052
|
};
|
|
933
1053
|
description?: string | undefined;
|
|
@@ -947,6 +1067,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
947
1067
|
selectedScopes?: string[] | undefined;
|
|
948
1068
|
'x-scalar-client-id'?: string | undefined;
|
|
949
1069
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1070
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1071
|
+
'x-tokenName'?: string | undefined;
|
|
950
1072
|
tokenUrl?: string | undefined;
|
|
951
1073
|
clientSecret?: string | undefined;
|
|
952
1074
|
} | undefined;
|
|
@@ -958,6 +1080,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
958
1080
|
selectedScopes?: string[] | undefined;
|
|
959
1081
|
'x-scalar-client-id'?: string | undefined;
|
|
960
1082
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1083
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1084
|
+
'x-tokenName'?: string | undefined;
|
|
961
1085
|
authorizationUrl?: string | undefined;
|
|
962
1086
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
963
1087
|
} | undefined;
|
|
@@ -969,6 +1093,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
969
1093
|
selectedScopes?: string[] | undefined;
|
|
970
1094
|
'x-scalar-client-id'?: string | undefined;
|
|
971
1095
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1096
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1097
|
+
'x-tokenName'?: string | undefined;
|
|
972
1098
|
tokenUrl?: string | undefined;
|
|
973
1099
|
clientSecret?: string | undefined;
|
|
974
1100
|
} | undefined;
|
|
@@ -980,6 +1106,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
980
1106
|
selectedScopes?: string[] | undefined;
|
|
981
1107
|
'x-scalar-client-id'?: string | undefined;
|
|
982
1108
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1109
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1110
|
+
'x-tokenName'?: string | undefined;
|
|
983
1111
|
authorizationUrl?: string | undefined;
|
|
984
1112
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
985
1113
|
tokenUrl?: string | undefined;
|
|
@@ -1130,6 +1258,10 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1130
1258
|
token: z.ZodDefault<z.ZodString>;
|
|
1131
1259
|
/** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */
|
|
1132
1260
|
'x-scalar-security-query': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1261
|
+
/** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */
|
|
1262
|
+
'x-scalar-security-body': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1263
|
+
/** Extension to specify custom token name in the response (defaults to 'access_token') */
|
|
1264
|
+
'x-tokenName': z.ZodOptional<z.ZodString>;
|
|
1133
1265
|
}, {
|
|
1134
1266
|
type: z.ZodDefault<z.ZodLiteral<"implicit">>;
|
|
1135
1267
|
authorizationUrl: z.ZodDefault<z.ZodString>;
|
|
@@ -1144,6 +1276,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1144
1276
|
authorizationUrl: string;
|
|
1145
1277
|
'x-scalar-redirect-uri': string;
|
|
1146
1278
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1279
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1280
|
+
'x-tokenName'?: string | undefined;
|
|
1147
1281
|
}, {
|
|
1148
1282
|
type?: "implicit" | undefined;
|
|
1149
1283
|
token?: string | undefined;
|
|
@@ -1152,6 +1286,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1152
1286
|
selectedScopes?: string[] | undefined;
|
|
1153
1287
|
'x-scalar-client-id'?: string | undefined;
|
|
1154
1288
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1289
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1290
|
+
'x-tokenName'?: string | undefined;
|
|
1155
1291
|
authorizationUrl?: string | undefined;
|
|
1156
1292
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
1157
1293
|
}>>;
|
|
@@ -1173,6 +1309,10 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1173
1309
|
token: z.ZodDefault<z.ZodString>;
|
|
1174
1310
|
/** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */
|
|
1175
1311
|
'x-scalar-security-query': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1312
|
+
/** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */
|
|
1313
|
+
'x-scalar-security-body': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1314
|
+
/** Extension to specify custom token name in the response (defaults to 'access_token') */
|
|
1315
|
+
'x-tokenName': z.ZodOptional<z.ZodString>;
|
|
1176
1316
|
}, {
|
|
1177
1317
|
type: z.ZodDefault<z.ZodLiteral<"password">>;
|
|
1178
1318
|
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
@@ -1191,6 +1331,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1191
1331
|
tokenUrl: string;
|
|
1192
1332
|
clientSecret: string;
|
|
1193
1333
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1334
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1335
|
+
'x-tokenName'?: string | undefined;
|
|
1194
1336
|
}, {
|
|
1195
1337
|
type?: "password" | undefined;
|
|
1196
1338
|
username?: string | undefined;
|
|
@@ -1201,6 +1343,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1201
1343
|
selectedScopes?: string[] | undefined;
|
|
1202
1344
|
'x-scalar-client-id'?: string | undefined;
|
|
1203
1345
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1346
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1347
|
+
'x-tokenName'?: string | undefined;
|
|
1204
1348
|
tokenUrl?: string | undefined;
|
|
1205
1349
|
clientSecret?: string | undefined;
|
|
1206
1350
|
}>>;
|
|
@@ -1222,6 +1366,10 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1222
1366
|
token: z.ZodDefault<z.ZodString>;
|
|
1223
1367
|
/** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */
|
|
1224
1368
|
'x-scalar-security-query': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1369
|
+
/** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */
|
|
1370
|
+
'x-scalar-security-body': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1371
|
+
/** Extension to specify custom token name in the response (defaults to 'access_token') */
|
|
1372
|
+
'x-tokenName': z.ZodOptional<z.ZodString>;
|
|
1225
1373
|
}, {
|
|
1226
1374
|
type: z.ZodDefault<z.ZodLiteral<"clientCredentials">>;
|
|
1227
1375
|
tokenUrl: z.ZodDefault<z.ZodString>;
|
|
@@ -1236,6 +1384,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1236
1384
|
tokenUrl: string;
|
|
1237
1385
|
clientSecret: string;
|
|
1238
1386
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1387
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1388
|
+
'x-tokenName'?: string | undefined;
|
|
1239
1389
|
}, {
|
|
1240
1390
|
type?: "clientCredentials" | undefined;
|
|
1241
1391
|
token?: string | undefined;
|
|
@@ -1244,6 +1394,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1244
1394
|
selectedScopes?: string[] | undefined;
|
|
1245
1395
|
'x-scalar-client-id'?: string | undefined;
|
|
1246
1396
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1397
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1398
|
+
'x-tokenName'?: string | undefined;
|
|
1247
1399
|
tokenUrl?: string | undefined;
|
|
1248
1400
|
clientSecret?: string | undefined;
|
|
1249
1401
|
}>>;
|
|
@@ -1265,6 +1417,10 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1265
1417
|
token: z.ZodDefault<z.ZodString>;
|
|
1266
1418
|
/** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */
|
|
1267
1419
|
'x-scalar-security-query': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1420
|
+
/** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */
|
|
1421
|
+
'x-scalar-security-body': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1422
|
+
/** Extension to specify custom token name in the response (defaults to 'access_token') */
|
|
1423
|
+
'x-tokenName': z.ZodOptional<z.ZodString>;
|
|
1268
1424
|
}, {
|
|
1269
1425
|
type: z.ZodDefault<z.ZodLiteral<"authorizationCode">>;
|
|
1270
1426
|
authorizationUrl: z.ZodDefault<z.ZodString>;
|
|
@@ -1285,6 +1441,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1285
1441
|
clientSecret: string;
|
|
1286
1442
|
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
1287
1443
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1444
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1445
|
+
'x-tokenName'?: string | undefined;
|
|
1288
1446
|
}, {
|
|
1289
1447
|
type?: "authorizationCode" | undefined;
|
|
1290
1448
|
token?: string | undefined;
|
|
@@ -1293,6 +1451,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1293
1451
|
selectedScopes?: string[] | undefined;
|
|
1294
1452
|
'x-scalar-client-id'?: string | undefined;
|
|
1295
1453
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1454
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1455
|
+
'x-tokenName'?: string | undefined;
|
|
1296
1456
|
authorizationUrl?: string | undefined;
|
|
1297
1457
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
1298
1458
|
tokenUrl?: string | undefined;
|
|
@@ -1312,6 +1472,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1312
1472
|
tokenUrl: string;
|
|
1313
1473
|
clientSecret: string;
|
|
1314
1474
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1475
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1476
|
+
'x-tokenName'?: string | undefined;
|
|
1315
1477
|
} | undefined;
|
|
1316
1478
|
implicit?: {
|
|
1317
1479
|
type: "implicit";
|
|
@@ -1323,6 +1485,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1323
1485
|
authorizationUrl: string;
|
|
1324
1486
|
'x-scalar-redirect-uri': string;
|
|
1325
1487
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1488
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1489
|
+
'x-tokenName'?: string | undefined;
|
|
1326
1490
|
} | undefined;
|
|
1327
1491
|
clientCredentials?: {
|
|
1328
1492
|
type: "clientCredentials";
|
|
@@ -1334,6 +1498,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1334
1498
|
tokenUrl: string;
|
|
1335
1499
|
clientSecret: string;
|
|
1336
1500
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1501
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1502
|
+
'x-tokenName'?: string | undefined;
|
|
1337
1503
|
} | undefined;
|
|
1338
1504
|
authorizationCode?: {
|
|
1339
1505
|
type: "authorizationCode";
|
|
@@ -1348,6 +1514,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1348
1514
|
clientSecret: string;
|
|
1349
1515
|
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
1350
1516
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1517
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1518
|
+
'x-tokenName'?: string | undefined;
|
|
1351
1519
|
} | undefined;
|
|
1352
1520
|
}, {
|
|
1353
1521
|
password?: {
|
|
@@ -1360,6 +1528,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1360
1528
|
selectedScopes?: string[] | undefined;
|
|
1361
1529
|
'x-scalar-client-id'?: string | undefined;
|
|
1362
1530
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1531
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1532
|
+
'x-tokenName'?: string | undefined;
|
|
1363
1533
|
tokenUrl?: string | undefined;
|
|
1364
1534
|
clientSecret?: string | undefined;
|
|
1365
1535
|
} | undefined;
|
|
@@ -1371,6 +1541,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1371
1541
|
selectedScopes?: string[] | undefined;
|
|
1372
1542
|
'x-scalar-client-id'?: string | undefined;
|
|
1373
1543
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1544
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1545
|
+
'x-tokenName'?: string | undefined;
|
|
1374
1546
|
authorizationUrl?: string | undefined;
|
|
1375
1547
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
1376
1548
|
} | undefined;
|
|
@@ -1382,6 +1554,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1382
1554
|
selectedScopes?: string[] | undefined;
|
|
1383
1555
|
'x-scalar-client-id'?: string | undefined;
|
|
1384
1556
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1557
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1558
|
+
'x-tokenName'?: string | undefined;
|
|
1385
1559
|
tokenUrl?: string | undefined;
|
|
1386
1560
|
clientSecret?: string | undefined;
|
|
1387
1561
|
} | undefined;
|
|
@@ -1393,6 +1567,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1393
1567
|
selectedScopes?: string[] | undefined;
|
|
1394
1568
|
'x-scalar-client-id'?: string | undefined;
|
|
1395
1569
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1570
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1571
|
+
'x-tokenName'?: string | undefined;
|
|
1396
1572
|
authorizationUrl?: string | undefined;
|
|
1397
1573
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
1398
1574
|
tokenUrl?: string | undefined;
|
|
@@ -1421,6 +1597,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1421
1597
|
tokenUrl: string;
|
|
1422
1598
|
clientSecret: string;
|
|
1423
1599
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1600
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1601
|
+
'x-tokenName'?: string | undefined;
|
|
1424
1602
|
} | undefined;
|
|
1425
1603
|
implicit?: {
|
|
1426
1604
|
type: "implicit";
|
|
@@ -1432,6 +1610,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1432
1610
|
authorizationUrl: string;
|
|
1433
1611
|
'x-scalar-redirect-uri': string;
|
|
1434
1612
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1613
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1614
|
+
'x-tokenName'?: string | undefined;
|
|
1435
1615
|
} | undefined;
|
|
1436
1616
|
clientCredentials?: {
|
|
1437
1617
|
type: "clientCredentials";
|
|
@@ -1443,6 +1623,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1443
1623
|
tokenUrl: string;
|
|
1444
1624
|
clientSecret: string;
|
|
1445
1625
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1626
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1627
|
+
'x-tokenName'?: string | undefined;
|
|
1446
1628
|
} | undefined;
|
|
1447
1629
|
authorizationCode?: {
|
|
1448
1630
|
type: "authorizationCode";
|
|
@@ -1457,6 +1639,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1457
1639
|
clientSecret: string;
|
|
1458
1640
|
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
1459
1641
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1642
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1643
|
+
'x-tokenName'?: string | undefined;
|
|
1460
1644
|
} | undefined;
|
|
1461
1645
|
};
|
|
1462
1646
|
description?: string | undefined;
|
|
@@ -1478,6 +1662,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1478
1662
|
selectedScopes?: string[] | undefined;
|
|
1479
1663
|
'x-scalar-client-id'?: string | undefined;
|
|
1480
1664
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1665
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1666
|
+
'x-tokenName'?: string | undefined;
|
|
1481
1667
|
tokenUrl?: string | undefined;
|
|
1482
1668
|
clientSecret?: string | undefined;
|
|
1483
1669
|
} | undefined;
|
|
@@ -1489,6 +1675,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1489
1675
|
selectedScopes?: string[] | undefined;
|
|
1490
1676
|
'x-scalar-client-id'?: string | undefined;
|
|
1491
1677
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1678
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1679
|
+
'x-tokenName'?: string | undefined;
|
|
1492
1680
|
authorizationUrl?: string | undefined;
|
|
1493
1681
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
1494
1682
|
} | undefined;
|
|
@@ -1500,6 +1688,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1500
1688
|
selectedScopes?: string[] | undefined;
|
|
1501
1689
|
'x-scalar-client-id'?: string | undefined;
|
|
1502
1690
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1691
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1692
|
+
'x-tokenName'?: string | undefined;
|
|
1503
1693
|
tokenUrl?: string | undefined;
|
|
1504
1694
|
clientSecret?: string | undefined;
|
|
1505
1695
|
} | undefined;
|
|
@@ -1511,6 +1701,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1511
1701
|
selectedScopes?: string[] | undefined;
|
|
1512
1702
|
'x-scalar-client-id'?: string | undefined;
|
|
1513
1703
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1704
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1705
|
+
'x-tokenName'?: string | undefined;
|
|
1514
1706
|
authorizationUrl?: string | undefined;
|
|
1515
1707
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
1516
1708
|
tokenUrl?: string | undefined;
|
|
@@ -1559,6 +1751,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1559
1751
|
tokenUrl: string;
|
|
1560
1752
|
clientSecret: string;
|
|
1561
1753
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1754
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1755
|
+
'x-tokenName'?: string | undefined;
|
|
1562
1756
|
} | undefined;
|
|
1563
1757
|
implicit?: {
|
|
1564
1758
|
type: "implicit";
|
|
@@ -1570,6 +1764,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1570
1764
|
authorizationUrl: string;
|
|
1571
1765
|
'x-scalar-redirect-uri': string;
|
|
1572
1766
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1767
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1768
|
+
'x-tokenName'?: string | undefined;
|
|
1573
1769
|
} | undefined;
|
|
1574
1770
|
clientCredentials?: {
|
|
1575
1771
|
type: "clientCredentials";
|
|
@@ -1581,6 +1777,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1581
1777
|
tokenUrl: string;
|
|
1582
1778
|
clientSecret: string;
|
|
1583
1779
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1780
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1781
|
+
'x-tokenName'?: string | undefined;
|
|
1584
1782
|
} | undefined;
|
|
1585
1783
|
authorizationCode?: {
|
|
1586
1784
|
type: "authorizationCode";
|
|
@@ -1595,6 +1793,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1595
1793
|
clientSecret: string;
|
|
1596
1794
|
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
1597
1795
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1796
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1797
|
+
'x-tokenName'?: string | undefined;
|
|
1598
1798
|
} | undefined;
|
|
1599
1799
|
};
|
|
1600
1800
|
description?: string | undefined;
|
|
@@ -1640,6 +1840,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1640
1840
|
selectedScopes?: string[] | undefined;
|
|
1641
1841
|
'x-scalar-client-id'?: string | undefined;
|
|
1642
1842
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1843
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1844
|
+
'x-tokenName'?: string | undefined;
|
|
1643
1845
|
tokenUrl?: string | undefined;
|
|
1644
1846
|
clientSecret?: string | undefined;
|
|
1645
1847
|
} | undefined;
|
|
@@ -1651,6 +1853,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1651
1853
|
selectedScopes?: string[] | undefined;
|
|
1652
1854
|
'x-scalar-client-id'?: string | undefined;
|
|
1653
1855
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1856
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1857
|
+
'x-tokenName'?: string | undefined;
|
|
1654
1858
|
authorizationUrl?: string | undefined;
|
|
1655
1859
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
1656
1860
|
} | undefined;
|
|
@@ -1662,6 +1866,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1662
1866
|
selectedScopes?: string[] | undefined;
|
|
1663
1867
|
'x-scalar-client-id'?: string | undefined;
|
|
1664
1868
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1869
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1870
|
+
'x-tokenName'?: string | undefined;
|
|
1665
1871
|
tokenUrl?: string | undefined;
|
|
1666
1872
|
clientSecret?: string | undefined;
|
|
1667
1873
|
} | undefined;
|
|
@@ -1673,6 +1879,8 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<
|
|
|
1673
1879
|
selectedScopes?: string[] | undefined;
|
|
1674
1880
|
'x-scalar-client-id'?: string | undefined;
|
|
1675
1881
|
'x-scalar-security-query'?: Record<string, string> | undefined;
|
|
1882
|
+
'x-scalar-security-body'?: Record<string, string> | undefined;
|
|
1883
|
+
'x-tokenName'?: string | undefined;
|
|
1676
1884
|
authorizationUrl?: string | undefined;
|
|
1677
1885
|
'x-scalar-redirect-uri'?: string | undefined;
|
|
1678
1886
|
tokenUrl?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security-scheme.d.ts","sourceRoot":"","sources":["../../src/entities/security-scheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAsBvB,eAAO,MAAM,sBAAsB,wCAAyC,CAAA;AAc5E,eAAO,MAAM,oBAAoB;;;;IAV/B,8EAA8E;;IAE9E,6FAA6F;;;;IAb7F,0EAA0E;;;;;;;;;;;;;;;;;;;;EAqBsC,CAAA;AAClH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAkCvE,eAAO,MAAM,kBAAkB;;;;IA3B7B;;;OAGG;;IAOH;;;;OAIG;;;;IA3CH,0EAA0E;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDgC,CAAA;AAC5G,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAanE,eAAO,MAAM,oBAAoB;;;;IAP/B;;;OAGG;;;;IAlEH,0EAA0E;;;;;;;;;;;;;;EAsEa,CAAA;AACzF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"security-scheme.d.ts","sourceRoot":"","sources":["../../src/entities/security-scheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAsBvB,eAAO,MAAM,sBAAsB,wCAAyC,CAAA;AAc5E,eAAO,MAAM,oBAAoB;;;;IAV/B,8EAA8E;;IAE9E,6FAA6F;;;;IAb7F,0EAA0E;;;;;;;;;;;;;;;;;;;;EAqBsC,CAAA;AAClH,MAAM,MAA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}
|
|
@@ -69,7 +69,11 @@ const flowsCommon = z.object({
|
|
|
69
69
|
/** The auth token */
|
|
70
70
|
"token": z.string().default(""),
|
|
71
71
|
/** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */
|
|
72
|
-
"x-scalar-security-query": z.record(z.string(), z.string()).optional()
|
|
72
|
+
"x-scalar-security-query": z.record(z.string(), z.string()).optional(),
|
|
73
|
+
/** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */
|
|
74
|
+
"x-scalar-security-body": z.record(z.string(), z.string()).optional(),
|
|
75
|
+
/** Extension to specify custom token name in the response (defaults to 'access_token') */
|
|
76
|
+
"x-tokenName": z.string().optional()
|
|
73
77
|
});
|
|
74
78
|
const defaultRedirectUri = typeof window !== "undefined" ? window.location.origin + window.location.pathname : "";
|
|
75
79
|
const pkceOptions = ["SHA-256", "plain", "no"];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/entities/security-scheme.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from 'zod'\n\nimport { type ENTITY_BRANDS, nanoidSchema } from '../utils/nanoid'\n\n// ---------------------------------------------------------------------------\n// COMMON PROPS FOR ALL SECURITY SCHEMES\n\n/** Some common properties used in all security schemes */\nconst commonProps = z.object({\n /* A description for security scheme. CommonMark syntax MAY be used for rich text representation. */\n description: z.string().optional(),\n})\n\nconst extendedSecuritySchema = z.object({\n uid: nanoidSchema.brand<ENTITY_BRANDS['SECURITY_SCHEME']>(),\n /** The name key that links a security requirement to a security object */\n nameKey: z.string().optional().default(''),\n})\n\n// ---------------------------------------------------------------------------\n// API KEY\n\nexport const securitySchemeApiKeyIn = ['query', 'header', 'cookie'] as const\n\nconst oasSecuritySchemeApiKey = commonProps.extend({\n type: z.literal('apiKey'),\n /** REQUIRED. The name of the header, query or cookie parameter to be used. */\n name: z.string().optional().default(''),\n /** REQUIRED. The location of the API key. Valid values are \"query\", \"header\" or \"cookie\". */\n in: z.enum(securitySchemeApiKeyIn).optional().default('header').catch('header'),\n})\n\nconst apiKeyValueSchema = z.object({\n value: z.string().default(''),\n})\n\nexport const securityApiKeySchema = oasSecuritySchemeApiKey.merge(extendedSecuritySchema).merge(apiKeyValueSchema)\nexport type SecuritySchemeApiKey = z.infer<typeof securityApiKeySchema>\n\n// ---------------------------------------------------------------------------\n// HTTP\n\nconst oasSecuritySchemeHttp = commonProps.extend({\n type: z.literal('http'),\n /**\n * REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in\n * [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry.\n */\n scheme: z\n .string()\n .toLowerCase()\n .pipe(z.enum(['basic', 'bearer']))\n .optional()\n .default('basic'),\n /**\n * A hint to the client to identify how the bearer token is formatted.\n * Bearer tokens are usually generated by an authorization server, so\n * this information is primarily for documentation purposes.\n */\n bearerFormat: z\n .union([z.literal('JWT'), z.string()])\n .optional()\n .default('JWT'),\n})\n\nconst httpValueSchema = z.object({\n username: z.string().default(''),\n password: z.string().default(''),\n token: z.string().default(''),\n})\n\nexport const securityHttpSchema = oasSecuritySchemeHttp.merge(extendedSecuritySchema).merge(httpValueSchema)\nexport type SecuritySchemaHttp = z.infer<typeof securityHttpSchema>\n\n// ---------------------------------------------------------------------------\n// OPENID CONNECT\nconst oasSecuritySchemeOpenId = commonProps.extend({\n type: z.literal('openIdConnect'),\n /**\n * REQUIRED. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the\n * form of a URL. The OpenID Connect standard requires the use of TLS.\n */\n openIdConnectUrl: z.string().optional().default(''),\n})\n\nexport const securityOpenIdSchema = oasSecuritySchemeOpenId.merge(extendedSecuritySchema)\nexport type SecuritySchemaOpenId = z.infer<typeof securityOpenIdSchema>\n\n// ---------------------------------------------------------------------------\n\n/**\n * REQUIRED. The authorization URL to be used for this flow. This MUST be in\n * the form of a URL. The OAuth2 standard requires the use of TLS.\n */\nconst authorizationUrl = z.string().default('')\n\n/**\n * REQUIRED. The token URL to be used for this flow. This MUST be in the\n * form of a URL. The OAuth2 standard requires the use of TLS.\n */\nconst tokenUrl = z.string().default('')\n\n/** Common properties used across all oauth2 flows */\nconst flowsCommon = z.object({\n /**\n * The URL to be used for obtaining refresh tokens. This MUST be in the form of a\n * URL. The OAuth2 standard requires the use of TLS.\n */\n 'refreshUrl': z.string().optional().default(''),\n /**\n * REQUIRED. The available scopes for the OAuth2 security scheme. A map\n * between the scope name and a short description for it. The map MAY be empty.\n */\n 'scopes': z.record(z.string(), z.string().optional().default('')).optional().default({}).catch({}),\n 'selectedScopes': z.array(z.string()).optional().default([]),\n /** Extension to save the client Id associated with an oauth flow */\n 'x-scalar-client-id': z.string().optional().default(''),\n /** The auth token */\n 'token': z.string().default(''),\n /** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */\n 'x-scalar-security-query': z.record(z.string(), z.string()).optional(),\n})\n\n/** Setup a default redirect uri if we can */\nconst defaultRedirectUri = typeof window !== 'undefined' ? window.location.origin + window.location.pathname : ''\n\n/** Options for the x-usePkce extension */\nexport const pkceOptions = ['SHA-256', 'plain', 'no'] as const\n\n/** Oauth2 security scheme */\nconst oasSecuritySchemeOauth2 = commonProps.extend({\n type: z.literal('oauth2'),\n /** The default scopes for the oauth flow */\n 'x-default-scopes': z.string().or(z.array(z.string())).optional(),\n /** REQUIRED. An object containing configuration information for the flow types supported. */\n flows: z\n .object({\n /** Configuration for the OAuth Implicit flow */\n implicit: flowsCommon.extend({\n 'type': z.literal('implicit').default('implicit'),\n authorizationUrl,\n 'x-scalar-redirect-uri': z.string().optional().default(defaultRedirectUri),\n }),\n /** Configuration for the OAuth Resource Owner Password flow */\n password: flowsCommon.extend({\n type: z.literal('password').default('password'),\n tokenUrl,\n clientSecret: z.string().default(''),\n username: z.string().default(''),\n password: z.string().default(''),\n }),\n /** Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0. */\n clientCredentials: flowsCommon.extend({\n type: z.literal('clientCredentials').default('clientCredentials'),\n tokenUrl,\n clientSecret: z.string().default(''),\n }),\n /** Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.*/\n authorizationCode: flowsCommon.extend({\n 'type': z.literal('authorizationCode').default('authorizationCode'),\n authorizationUrl,\n 'x-usePkce': z.enum(pkceOptions).optional().default('no'),\n 'x-scalar-redirect-uri': z.string().optional().default(defaultRedirectUri),\n tokenUrl,\n 'clientSecret': z.string().default(''),\n }),\n })\n .partial()\n .default({\n implicit: { type: 'implicit', authorizationUrl: 'http://localhost:8080' },\n }),\n})\n\nexport const securityOauthSchema = oasSecuritySchemeOauth2.merge(extendedSecuritySchema)\n\nexport type SecuritySchemeOauth2 = z.infer<typeof securityOauthSchema>\nexport type SecuritySchemeOauth2Payload = z.input<typeof securityOauthSchema>\nexport type Oauth2Flow = NonNullable<\n SecuritySchemeOauth2['flows']['authorizationCode' | 'clientCredentials' | 'implicit' | 'password']\n>\n/** Payload for the oauth 2 flows + extensions */\nexport type Oauth2FlowPayload = NonNullable<SecuritySchemeOauth2Payload['flows']>[\n | 'authorizationCode'\n | 'clientCredentials'\n | 'implicit'\n | 'password'] &\n Record<`x-${string}`, string>\n\n// ---------------------------------------------------------------------------\n// Final Types\n\n/**\n * Security Requirement\n * Lists the required security schemes to execute this operation OR the whole collection/spec.\n * The name used for each property MUST correspond to a security scheme declared in the Security\n * Schemes under the Components Object.\n *\n * The key (name) here will be matched to the key of the securityScheme for linking\n *\n * @see https://spec.openapis.org/oas/latest.html#security-requirement-object\n */\nexport const oasSecurityRequirementSchema = z.record(z.string(), z.array(z.string()).optional().default([]))\n\n/** OAS Compliant security schemes */\nexport const oasSecuritySchemeSchema = z.union([\n oasSecuritySchemeApiKey,\n oasSecuritySchemeHttp,\n oasSecuritySchemeOauth2,\n oasSecuritySchemeOpenId,\n])\n\n/** Extended security schemes for workspace usage */\nexport const securitySchemeSchema = z\n .discriminatedUnion('type', [securityApiKeySchema, securityHttpSchema, securityOpenIdSchema, securityOauthSchema])\n .transform((data) => {\n // Set selected scopes from x-default-scopes\n if (data.type === 'oauth2' && data['x-default-scopes']?.length) {\n const keys = Object.keys(data.flows) as Array<keyof typeof data.flows>\n keys.forEach((key) => {\n if (data.flows[key]?.selectedScopes && data['x-default-scopes']) {\n data.flows[key].selectedScopes = [data['x-default-scopes']].flat()\n }\n })\n }\n return data\n })\n\n/**\n * Security Scheme Object\n *\n * @see https://spec.openapis.org/oas/latest.html#security-scheme-object\n */\nexport type SecurityScheme = z.infer<typeof securitySchemeSchema>\nexport type SecuritySchemePayload = z.input<typeof securitySchemeSchema>\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,SAAS;AAElB,SAA6B,oBAAoB;AAMjD,MAAM,cAAc,EAAE,OAAO;AAAA;AAAA,EAE3B,aAAa,EAAE,OAAO,EAAE,SAAS;AACnC,CAAC;AAED,MAAM,yBAAyB,EAAE,OAAO;AAAA,EACtC,KAAK,aAAa,MAAwC;AAAA;AAAA,EAE1D,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;AAC3C,CAAC;AAKM,MAAM,yBAAyB,CAAC,SAAS,UAAU,QAAQ;AAElE,MAAM,0BAA0B,YAAY,OAAO;AAAA,EACjD,MAAM,EAAE,QAAQ,QAAQ;AAAA;AAAA,EAExB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;AAAA;AAAA,EAEtC,IAAI,EAAE,KAAK,sBAAsB,EAAE,SAAS,EAAE,QAAQ,QAAQ,EAAE,MAAM,QAAQ;AAChF,CAAC;AAED,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE;AAC9B,CAAC;AAEM,MAAM,uBAAuB,wBAAwB,MAAM,sBAAsB,EAAE,MAAM,iBAAiB;AAMjH,MAAM,wBAAwB,YAAY,OAAO;AAAA,EAC/C,MAAM,EAAE,QAAQ,MAAM;AAAA;AAAA;AA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S,EAAE,QAAQ,CAAC,CAAC;AAAA;AAAA,EAE3D,sBAAsB,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;AAAA;AAAA,EAEtD,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE;AAAA;AAAA,EAE9B,2BAA2B,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,SAAS;
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\n\nimport { type ENTITY_BRANDS, nanoidSchema } from '../utils/nanoid'\n\n// ---------------------------------------------------------------------------\n// COMMON PROPS FOR ALL SECURITY SCHEMES\n\n/** Some common properties used in all security schemes */\nconst commonProps = z.object({\n /* A description for security scheme. CommonMark syntax MAY be used for rich text representation. */\n description: z.string().optional(),\n})\n\nconst extendedSecuritySchema = z.object({\n uid: nanoidSchema.brand<ENTITY_BRANDS['SECURITY_SCHEME']>(),\n /** The name key that links a security requirement to a security object */\n nameKey: z.string().optional().default(''),\n})\n\n// ---------------------------------------------------------------------------\n// API KEY\n\nexport const securitySchemeApiKeyIn = ['query', 'header', 'cookie'] as const\n\nconst oasSecuritySchemeApiKey = commonProps.extend({\n type: z.literal('apiKey'),\n /** REQUIRED. The name of the header, query or cookie parameter to be used. */\n name: z.string().optional().default(''),\n /** REQUIRED. The location of the API key. Valid values are \"query\", \"header\" or \"cookie\". */\n in: z.enum(securitySchemeApiKeyIn).optional().default('header').catch('header'),\n})\n\nconst apiKeyValueSchema = z.object({\n value: z.string().default(''),\n})\n\nexport const securityApiKeySchema = oasSecuritySchemeApiKey.merge(extendedSecuritySchema).merge(apiKeyValueSchema)\nexport type SecuritySchemeApiKey = z.infer<typeof securityApiKeySchema>\n\n// ---------------------------------------------------------------------------\n// HTTP\n\nconst oasSecuritySchemeHttp = commonProps.extend({\n type: z.literal('http'),\n /**\n * REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in\n * [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry.\n */\n scheme: z\n .string()\n .toLowerCase()\n .pipe(z.enum(['basic', 'bearer']))\n .optional()\n .default('basic'),\n /**\n * A hint to the client to identify how the bearer token is formatted.\n * Bearer tokens are usually generated by an authorization server, so\n * this information is primarily for documentation purposes.\n */\n bearerFormat: z\n .union([z.literal('JWT'), z.string()])\n .optional()\n .default('JWT'),\n})\n\nconst httpValueSchema = z.object({\n username: z.string().default(''),\n password: z.string().default(''),\n token: z.string().default(''),\n})\n\nexport const securityHttpSchema = oasSecuritySchemeHttp.merge(extendedSecuritySchema).merge(httpValueSchema)\nexport type SecuritySchemaHttp = z.infer<typeof securityHttpSchema>\n\n// ---------------------------------------------------------------------------\n// OPENID CONNECT\nconst oasSecuritySchemeOpenId = commonProps.extend({\n type: z.literal('openIdConnect'),\n /**\n * REQUIRED. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the\n * form of a URL. The OpenID Connect standard requires the use of TLS.\n */\n openIdConnectUrl: z.string().optional().default(''),\n})\n\nexport const securityOpenIdSchema = oasSecuritySchemeOpenId.merge(extendedSecuritySchema)\nexport type SecuritySchemaOpenId = z.infer<typeof securityOpenIdSchema>\n\n// ---------------------------------------------------------------------------\n\n/**\n * REQUIRED. The authorization URL to be used for this flow. This MUST be in\n * the form of a URL. The OAuth2 standard requires the use of TLS.\n */\nconst authorizationUrl = z.string().default('')\n\n/**\n * REQUIRED. The token URL to be used for this flow. This MUST be in the\n * form of a URL. The OAuth2 standard requires the use of TLS.\n */\nconst tokenUrl = z.string().default('')\n\n/** Common properties used across all oauth2 flows */\nconst flowsCommon = z.object({\n /**\n * The URL to be used for obtaining refresh tokens. This MUST be in the form of a\n * URL. The OAuth2 standard requires the use of TLS.\n */\n 'refreshUrl': z.string().optional().default(''),\n /**\n * REQUIRED. The available scopes for the OAuth2 security scheme. A map\n * between the scope name and a short description for it. The map MAY be empty.\n */\n 'scopes': z.record(z.string(), z.string().optional().default('')).optional().default({}).catch({}),\n 'selectedScopes': z.array(z.string()).optional().default([]),\n /** Extension to save the client Id associated with an oauth flow */\n 'x-scalar-client-id': z.string().optional().default(''),\n /** The auth token */\n 'token': z.string().default(''),\n /** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */\n 'x-scalar-security-query': z.record(z.string(), z.string()).optional(),\n /** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */\n 'x-scalar-security-body': z.record(z.string(), z.string()).optional(),\n /** Extension to specify custom token name in the response (defaults to 'access_token') */\n 'x-tokenName': z.string().optional(),\n})\n\n/** Setup a default redirect uri if we can */\nconst defaultRedirectUri = typeof window !== 'undefined' ? window.location.origin + window.location.pathname : ''\n\n/** Options for the x-usePkce extension */\nexport const pkceOptions = ['SHA-256', 'plain', 'no'] as const\n\n/** Oauth2 security scheme */\nconst oasSecuritySchemeOauth2 = commonProps.extend({\n type: z.literal('oauth2'),\n /** The default scopes for the oauth flow */\n 'x-default-scopes': z.string().or(z.array(z.string())).optional(),\n /** REQUIRED. An object containing configuration information for the flow types supported. */\n flows: z\n .object({\n /** Configuration for the OAuth Implicit flow */\n implicit: flowsCommon.extend({\n 'type': z.literal('implicit').default('implicit'),\n authorizationUrl,\n 'x-scalar-redirect-uri': z.string().optional().default(defaultRedirectUri),\n }),\n /** Configuration for the OAuth Resource Owner Password flow */\n password: flowsCommon.extend({\n type: z.literal('password').default('password'),\n tokenUrl,\n clientSecret: z.string().default(''),\n username: z.string().default(''),\n password: z.string().default(''),\n }),\n /** Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0. */\n clientCredentials: flowsCommon.extend({\n type: z.literal('clientCredentials').default('clientCredentials'),\n tokenUrl,\n clientSecret: z.string().default(''),\n }),\n /** Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.*/\n authorizationCode: flowsCommon.extend({\n 'type': z.literal('authorizationCode').default('authorizationCode'),\n authorizationUrl,\n 'x-usePkce': z.enum(pkceOptions).optional().default('no'),\n 'x-scalar-redirect-uri': z.string().optional().default(defaultRedirectUri),\n tokenUrl,\n 'clientSecret': z.string().default(''),\n }),\n })\n .partial()\n .default({\n implicit: { type: 'implicit', authorizationUrl: 'http://localhost:8080' },\n }),\n})\n\nexport const securityOauthSchema = oasSecuritySchemeOauth2.merge(extendedSecuritySchema)\n\nexport type SecuritySchemeOauth2 = z.infer<typeof securityOauthSchema>\nexport type SecuritySchemeOauth2Payload = z.input<typeof securityOauthSchema>\nexport type Oauth2Flow = NonNullable<\n SecuritySchemeOauth2['flows']['authorizationCode' | 'clientCredentials' | 'implicit' | 'password']\n>\n/** Payload for the oauth 2 flows + extensions */\nexport type Oauth2FlowPayload = NonNullable<SecuritySchemeOauth2Payload['flows']>[\n | 'authorizationCode'\n | 'clientCredentials'\n | 'implicit'\n | 'password'] &\n Record<`x-${string}`, string>\n\n// ---------------------------------------------------------------------------\n// Final Types\n\n/**\n * Security Requirement\n * Lists the required security schemes to execute this operation OR the whole collection/spec.\n * The name used for each property MUST correspond to a security scheme declared in the Security\n * Schemes under the Components Object.\n *\n * The key (name) here will be matched to the key of the securityScheme for linking\n *\n * @see https://spec.openapis.org/oas/latest.html#security-requirement-object\n */\nexport const oasSecurityRequirementSchema = z.record(z.string(), z.array(z.string()).optional().default([]))\n\n/** OAS Compliant security schemes */\nexport const oasSecuritySchemeSchema = z.union([\n oasSecuritySchemeApiKey,\n oasSecuritySchemeHttp,\n oasSecuritySchemeOauth2,\n oasSecuritySchemeOpenId,\n])\n\n/** Extended security schemes for workspace usage */\nexport const securitySchemeSchema = z\n .discriminatedUnion('type', [securityApiKeySchema, securityHttpSchema, securityOpenIdSchema, securityOauthSchema])\n .transform((data) => {\n // Set selected scopes from x-default-scopes\n if (data.type === 'oauth2' && data['x-default-scopes']?.length) {\n const keys = Object.keys(data.flows) as Array<keyof typeof data.flows>\n keys.forEach((key) => {\n if (data.flows[key]?.selectedScopes && data['x-default-scopes']) {\n data.flows[key].selectedScopes = [data['x-default-scopes']].flat()\n }\n })\n }\n return data\n })\n\n/**\n * Security Scheme Object\n *\n * @see https://spec.openapis.org/oas/latest.html#security-scheme-object\n */\nexport type SecurityScheme = z.infer<typeof securitySchemeSchema>\nexport type SecuritySchemePayload = z.input<typeof securitySchemeSchema>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAElB,SAA6B,oBAAoB;AAMjD,MAAM,cAAc,EAAE,OAAO;AAAA;AAAA,EAE3B,aAAa,EAAE,OAAO,EAAE,SAAS;AACnC,CAAC;AAED,MAAM,yBAAyB,EAAE,OAAO;AAAA,EACtC,KAAK,aAAa,MAAwC;AAAA;AAAA,EAE1D,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;AAC3C,CAAC;AAKM,MAAM,yBAAyB,CAAC,SAAS,UAAU,QAAQ;AAElE,MAAM,0BAA0B,YAAY,OAAO;AAAA,EACjD,MAAM,EAAE,QAAQ,QAAQ;AAAA;AAAA,EAExB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;AAAA;AAAA,EAEtC,IAAI,EAAE,KAAK,sBAAsB,EAAE,SAAS,EAAE,QAAQ,QAAQ,EAAE,MAAM,QAAQ;AAChF,CAAC;AAED,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE;AAC9B,CAAC;AAEM,MAAM,uBAAuB,wBAAwB,MAAM,sBAAsB,EAAE,MAAM,iBAAiB;AAMjH,MAAM,wBAAwB,YAAY,OAAO;AAAA,EAC/C,MAAM,EAAE,QAAQ,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,QAAQ,EACL,OAAO,EACP,YAAY,EACZ,KAAK,EAAE,KAAK,CAAC,SAAS,QAAQ,CAAC,CAAC,EAChC,SAAS,EACT,QAAQ,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMlB,cAAc,EACX,MAAM,CAAC,EAAE,QAAQ,KAAK,GAAG,EAAE,OAAO,CAAC,CAAC,EACpC,SAAS,EACT,QA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
22
22
|
},
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"nanoid": "5.1.5",
|
|
68
68
|
"zod": "3.24.1",
|
|
69
|
-
"@scalar/openapi-types": "0.3.
|
|
69
|
+
"@scalar/openapi-types": "0.3.6"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/har-format": "^1.2.15",
|