@scalar/types 0.1.4 → 0.1.6
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 +16 -0
- package/dist/api-reference/api-reference-configuration.d.ts +528 -8
- package/dist/api-reference/api-reference-configuration.d.ts.map +1 -1
- package/dist/api-reference/api-reference-configuration.js +12 -2
- package/dist/entities/security-scheme.d.ts +168 -2
- package/dist/entities/security-scheme.d.ts.map +1 -1
- package/dist/entities/security-scheme.js +16 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @scalar/types
|
|
2
2
|
|
|
3
|
+
## 0.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3783345: feat: add some callbacks to sidebar items
|
|
8
|
+
|
|
9
|
+
## 0.1.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- e09dab3: feat: multiple configurations with multiple sources
|
|
14
|
+
- 04e27a1: feat: support x-default-scopes
|
|
15
|
+
- Updated dependencies [e62e677]
|
|
16
|
+
- Updated dependencies [82f16a5]
|
|
17
|
+
- @scalar/openapi-types@0.2.0
|
|
18
|
+
|
|
3
19
|
## 0.1.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -248,6 +248,508 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
|
|
|
248
248
|
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
249
249
|
}>;
|
|
250
250
|
export type ApiClientConfiguration = z.infer<typeof apiClientConfigurationSchema>;
|
|
251
|
+
/** Configuration for the Api Client without the transform since it cannot be merged */
|
|
252
|
+
declare const _apiReferenceConfigurationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
253
|
+
/**
|
|
254
|
+
* URL to an OpenAPI/Swagger document
|
|
255
|
+
**/
|
|
256
|
+
url: z.ZodOptional<z.ZodString>;
|
|
257
|
+
/**
|
|
258
|
+
* Directly embed the OpenAPI document.
|
|
259
|
+
* Can be a string, object, function returning an object, or null.
|
|
260
|
+
*
|
|
261
|
+
* @remarks It’s recommended to pass a URL instead of content.
|
|
262
|
+
**/
|
|
263
|
+
content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>, z.ZodNull]>>;
|
|
264
|
+
/**
|
|
265
|
+
* The title of the OpenAPI document.
|
|
266
|
+
*
|
|
267
|
+
* @example 'Scalar Galaxy'
|
|
268
|
+
*/
|
|
269
|
+
title: z.ZodOptional<z.ZodString>;
|
|
270
|
+
/**
|
|
271
|
+
* The slug of the OpenAPI document used in the URL.
|
|
272
|
+
*
|
|
273
|
+
* If none is passed, the title will be used.
|
|
274
|
+
*
|
|
275
|
+
* If no title is used, it’ll just use the index.
|
|
276
|
+
*
|
|
277
|
+
* @example 'scalar-galaxy'
|
|
278
|
+
*/
|
|
279
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
280
|
+
/**
|
|
281
|
+
* The OpenAPI/Swagger document to render
|
|
282
|
+
*
|
|
283
|
+
* @deprecated Use `url` and `content` on the top level instead.
|
|
284
|
+
**/
|
|
285
|
+
spec: z.ZodOptional<z.ZodObject<{
|
|
286
|
+
/**
|
|
287
|
+
* URL to an OpenAPI/Swagger document
|
|
288
|
+
*
|
|
289
|
+
* @deprecated Please move `url` to the top level and remove the `spec` prefix.
|
|
290
|
+
*
|
|
291
|
+
* @example
|
|
292
|
+
* ```ts
|
|
293
|
+
* const oldConfiguration = {
|
|
294
|
+
* spec: {
|
|
295
|
+
* url: 'https://example.com/openapi.json',
|
|
296
|
+
* },
|
|
297
|
+
* }
|
|
298
|
+
*
|
|
299
|
+
* const newConfiguration = {
|
|
300
|
+
* url: 'https://example.com/openapi.json',
|
|
301
|
+
* }
|
|
302
|
+
* ```
|
|
303
|
+
**/
|
|
304
|
+
url: z.ZodOptional<z.ZodString>;
|
|
305
|
+
/**
|
|
306
|
+
* Directly embed the OpenAPI document.
|
|
307
|
+
* Can be a string, object, function returning an object, or null.
|
|
308
|
+
*
|
|
309
|
+
* @remarks It's recommended to pass a URL instead of content.
|
|
310
|
+
*
|
|
311
|
+
* @deprecated Please move `content` to the top level and remove the `spec` prefix.
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* ```ts
|
|
315
|
+
* const oldConfiguration = {
|
|
316
|
+
* spec: {
|
|
317
|
+
* content: '…',
|
|
318
|
+
* },
|
|
319
|
+
* }
|
|
320
|
+
*
|
|
321
|
+
* const newConfiguration = {
|
|
322
|
+
* content: '…',
|
|
323
|
+
* }
|
|
324
|
+
* ```
|
|
325
|
+
**/
|
|
326
|
+
content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>, z.ZodNull]>>;
|
|
327
|
+
/**
|
|
328
|
+
* The title of the OpenAPI document.
|
|
329
|
+
*
|
|
330
|
+
* @example 'Scalar Galaxy'
|
|
331
|
+
*
|
|
332
|
+
* @deprecated Please move `title` to the top level and remove the `spec` prefix.
|
|
333
|
+
*/
|
|
334
|
+
title: z.ZodOptional<z.ZodString>;
|
|
335
|
+
/**
|
|
336
|
+
* The slug of the OpenAPI document used in the URL.
|
|
337
|
+
*
|
|
338
|
+
* If none is passed, the title will be used.
|
|
339
|
+
*
|
|
340
|
+
* If no title is used, it’ll just use the index.
|
|
341
|
+
*
|
|
342
|
+
* @example 'scalar-galaxy'
|
|
343
|
+
*
|
|
344
|
+
* @deprecated Please move `slug` to the top level and remove the `spec` prefix.
|
|
345
|
+
*/
|
|
346
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
347
|
+
}, "strip", z.ZodTypeAny, {
|
|
348
|
+
url?: string | undefined;
|
|
349
|
+
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
350
|
+
title?: string | undefined;
|
|
351
|
+
slug?: string | undefined;
|
|
352
|
+
}, {
|
|
353
|
+
url?: string | undefined;
|
|
354
|
+
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
355
|
+
title?: string | undefined;
|
|
356
|
+
slug?: string | undefined;
|
|
357
|
+
}>>;
|
|
358
|
+
/** Prefill authentication */
|
|
359
|
+
authentication: z.ZodOptional<z.ZodAny>;
|
|
360
|
+
/** Base URL for the API server */
|
|
361
|
+
baseServerURL: z.ZodOptional<z.ZodString>;
|
|
362
|
+
/**
|
|
363
|
+
* Whether to hide the client button
|
|
364
|
+
* @default false
|
|
365
|
+
*/
|
|
366
|
+
hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
367
|
+
/** URL to a request proxy for the API client */
|
|
368
|
+
proxyUrl: z.ZodOptional<z.ZodString>;
|
|
369
|
+
/** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */
|
|
370
|
+
searchHotKey: z.ZodOptional<z.ZodEnum<["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]>>;
|
|
371
|
+
/** List of OpenAPI server objects */
|
|
372
|
+
servers: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
373
|
+
/**
|
|
374
|
+
* Whether to show the sidebar
|
|
375
|
+
* @default true
|
|
376
|
+
*/
|
|
377
|
+
showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
378
|
+
/** A string to use one of the color presets */
|
|
379
|
+
theme: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<["alternate", "default", "moon", "purple", "solarized", "bluePlanet", "deepSpace", "saturn", "kepler", "elysiajs", "fastify", "mars", "none"]>>>>;
|
|
380
|
+
/** Integration type identifier */
|
|
381
|
+
_integration: z.ZodOptional<z.ZodNullable<z.ZodEnum<["adonisjs", "docusaurus", "dotnet", "elysiajs", "express", "fastapi", "fastify", "go", "hono", "html", "laravel", "litestar", "nestjs", "nextjs", "nitro", "nuxt", "platformatic", "react", "rust", "vue"]>>>;
|
|
382
|
+
}, {
|
|
383
|
+
/**
|
|
384
|
+
* The layout to use for the references
|
|
385
|
+
* @default 'modern'
|
|
386
|
+
*/
|
|
387
|
+
layout: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<["modern", "classic"]>>>>;
|
|
388
|
+
/**
|
|
389
|
+
* URL to a request proxy for the API client
|
|
390
|
+
* @deprecated Use proxyUrl instead
|
|
391
|
+
*/
|
|
392
|
+
proxy: z.ZodOptional<z.ZodString>;
|
|
393
|
+
/**
|
|
394
|
+
* Whether the spec input should show
|
|
395
|
+
* @default false
|
|
396
|
+
*/
|
|
397
|
+
isEditable: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
398
|
+
/**
|
|
399
|
+
* Controls whether the references show a loading state in the intro
|
|
400
|
+
* @default false
|
|
401
|
+
*/
|
|
402
|
+
isLoading: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
403
|
+
/**
|
|
404
|
+
* Whether to show models in the sidebar, search, and content.
|
|
405
|
+
* @default false
|
|
406
|
+
*/
|
|
407
|
+
hideModels: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
408
|
+
/**
|
|
409
|
+
* Whether to show the "Download OpenAPI Document" button
|
|
410
|
+
* @default false
|
|
411
|
+
*/
|
|
412
|
+
hideDownloadButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
413
|
+
/**
|
|
414
|
+
* Whether to show the "Test Request" button
|
|
415
|
+
* @default false
|
|
416
|
+
*/
|
|
417
|
+
hideTestRequestButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
418
|
+
/**
|
|
419
|
+
* Whether to show the sidebar search bar
|
|
420
|
+
* @default false
|
|
421
|
+
*/
|
|
422
|
+
hideSearch: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
423
|
+
/** Whether dark mode is on or off initially (light mode) */
|
|
424
|
+
darkMode: z.ZodOptional<z.ZodBoolean>;
|
|
425
|
+
/** forceDarkModeState makes it always this state no matter what */
|
|
426
|
+
forceDarkModeState: z.ZodOptional<z.ZodEnum<["dark", "light"]>>;
|
|
427
|
+
/**
|
|
428
|
+
* Whether to show the dark mode toggle
|
|
429
|
+
* @default false
|
|
430
|
+
*/
|
|
431
|
+
hideDarkModeToggle: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
432
|
+
/**
|
|
433
|
+
* If used, passed data will be added to the HTML header
|
|
434
|
+
* @see https://unhead.unjs.io/usage/composables/use-seo-meta
|
|
435
|
+
*/
|
|
436
|
+
metaData: z.ZodOptional<z.ZodAny>;
|
|
437
|
+
/**
|
|
438
|
+
* Path to a favicon image
|
|
439
|
+
* @default undefined
|
|
440
|
+
* @example '/favicon.svg'
|
|
441
|
+
*/
|
|
442
|
+
favicon: z.ZodOptional<z.ZodString>;
|
|
443
|
+
/**
|
|
444
|
+
* List of httpsnippet clients to hide from the clients menu
|
|
445
|
+
* By default hides Unirest, pass `[]` to show all clients
|
|
446
|
+
*/
|
|
447
|
+
hiddenClients: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>, z.ZodArray<z.ZodString, "many">, z.ZodLiteral<true>]>>;
|
|
448
|
+
/** Determine the HTTP client that's selected by default */
|
|
449
|
+
defaultHttpClient: z.ZodOptional<z.ZodObject<{
|
|
450
|
+
targetKey: z.ZodType<"http" | "c" | "clojure" | "csharp" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart", z.ZodTypeDef, "http" | "c" | "clojure" | "csharp" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart">;
|
|
451
|
+
clientKey: z.ZodString;
|
|
452
|
+
}, "strip", z.ZodTypeAny, {
|
|
453
|
+
targetKey: "http" | "c" | "clojure" | "csharp" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
454
|
+
clientKey: string;
|
|
455
|
+
}, {
|
|
456
|
+
targetKey: "http" | "c" | "clojure" | "csharp" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
457
|
+
clientKey: string;
|
|
458
|
+
}>>;
|
|
459
|
+
/** Custom CSS to be added to the page */
|
|
460
|
+
customCss: z.ZodOptional<z.ZodString>;
|
|
461
|
+
/** onSpecUpdate is fired on spec/swagger content change */
|
|
462
|
+
onSpecUpdate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodVoid>>;
|
|
463
|
+
/** onServerChange is fired on selected server change */
|
|
464
|
+
onServerChange: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodVoid>>;
|
|
465
|
+
/** onDocumentSelect is fired when the config is selected */
|
|
466
|
+
onDocumentSelect: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
467
|
+
/** Callback fired when the reference is fully loaded */
|
|
468
|
+
onLoaded: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
469
|
+
/**
|
|
470
|
+
* onShowMore is fired when the user clicks the "Show more" button on the references
|
|
471
|
+
* @param tagId - The ID of the tag that was clicked
|
|
472
|
+
*/
|
|
473
|
+
onShowMore: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
474
|
+
/**
|
|
475
|
+
* onSidebarClick is fired when the user clicks on a sidebar item
|
|
476
|
+
* @param href - The href of the sidebar item that was clicked
|
|
477
|
+
*/
|
|
478
|
+
onSidebarClick: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
479
|
+
/**
|
|
480
|
+
* Route using paths instead of hashes, your server MUST support this
|
|
481
|
+
* @example '/standalone-api-reference/:custom(.*)?'
|
|
482
|
+
* @experimental
|
|
483
|
+
* @default undefined
|
|
484
|
+
*/
|
|
485
|
+
pathRouting: z.ZodOptional<z.ZodObject<{
|
|
486
|
+
/** Base path for the API reference */
|
|
487
|
+
basePath: z.ZodString;
|
|
488
|
+
}, "strip", z.ZodTypeAny, {
|
|
489
|
+
basePath: string;
|
|
490
|
+
}, {
|
|
491
|
+
basePath: string;
|
|
492
|
+
}>>;
|
|
493
|
+
/**
|
|
494
|
+
* Customize the heading portion of the hash
|
|
495
|
+
* @param heading - The heading object
|
|
496
|
+
* @returns A string ID used to generate the URL hash
|
|
497
|
+
* @default (heading) => `#description/${heading.slug}`
|
|
498
|
+
*/
|
|
499
|
+
generateHeadingSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
500
|
+
slug: z.ZodDefault<z.ZodString>;
|
|
501
|
+
}, "strip", z.ZodTypeAny, {
|
|
502
|
+
slug: string;
|
|
503
|
+
}, {
|
|
504
|
+
slug?: string | undefined;
|
|
505
|
+
}>], z.ZodUnknown>, z.ZodString>>;
|
|
506
|
+
/**
|
|
507
|
+
* Customize the model portion of the hash
|
|
508
|
+
* @param model - The model object with a name property
|
|
509
|
+
* @returns A string ID used to generate the URL hash
|
|
510
|
+
* @default (model) => slug(model.name)
|
|
511
|
+
*/
|
|
512
|
+
generateModelSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
513
|
+
name: z.ZodDefault<z.ZodString>;
|
|
514
|
+
}, "strip", z.ZodTypeAny, {
|
|
515
|
+
name: string;
|
|
516
|
+
}, {
|
|
517
|
+
name?: string | undefined;
|
|
518
|
+
}>], z.ZodUnknown>, z.ZodString>>;
|
|
519
|
+
/**
|
|
520
|
+
* Customize the tag portion of the hash
|
|
521
|
+
* @param tag - The tag object
|
|
522
|
+
* @returns A string ID used to generate the URL hash
|
|
523
|
+
* @default (tag) => slug(tag.name)
|
|
524
|
+
*/
|
|
525
|
+
generateTagSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
526
|
+
name: z.ZodDefault<z.ZodString>;
|
|
527
|
+
}, "strip", z.ZodTypeAny, {
|
|
528
|
+
name: string;
|
|
529
|
+
}, {
|
|
530
|
+
name?: string | undefined;
|
|
531
|
+
}>], z.ZodUnknown>, z.ZodString>>;
|
|
532
|
+
/**
|
|
533
|
+
* Customize the operation portion of the hash
|
|
534
|
+
* @param operation - The operation object
|
|
535
|
+
* @returns A string ID used to generate the URL hash
|
|
536
|
+
* @default (operation) => `${operation.method}${operation.path}`
|
|
537
|
+
*/
|
|
538
|
+
generateOperationSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
539
|
+
path: z.ZodString;
|
|
540
|
+
operationId: z.ZodOptional<z.ZodString>;
|
|
541
|
+
method: z.ZodString;
|
|
542
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
543
|
+
}, "strip", z.ZodTypeAny, {
|
|
544
|
+
path: string;
|
|
545
|
+
method: string;
|
|
546
|
+
operationId?: string | undefined;
|
|
547
|
+
summary?: string | undefined;
|
|
548
|
+
}, {
|
|
549
|
+
path: string;
|
|
550
|
+
method: string;
|
|
551
|
+
operationId?: string | undefined;
|
|
552
|
+
summary?: string | undefined;
|
|
553
|
+
}>], z.ZodUnknown>, z.ZodString>>;
|
|
554
|
+
/**
|
|
555
|
+
* Customize the webhook portion of the hash
|
|
556
|
+
* @param webhook - The webhook object
|
|
557
|
+
* @returns A string ID used to generate the URL hash
|
|
558
|
+
* @default (webhook) => slug(webhook.name)
|
|
559
|
+
*/
|
|
560
|
+
generateWebhookSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
561
|
+
name: z.ZodString;
|
|
562
|
+
method: z.ZodOptional<z.ZodString>;
|
|
563
|
+
}, "strip", z.ZodTypeAny, {
|
|
564
|
+
name: string;
|
|
565
|
+
method?: string | undefined;
|
|
566
|
+
}, {
|
|
567
|
+
name: string;
|
|
568
|
+
method?: string | undefined;
|
|
569
|
+
}>], z.ZodUnknown>, z.ZodString>>;
|
|
570
|
+
/**
|
|
571
|
+
* To handle redirects, pass a function that will recieve:
|
|
572
|
+
* - The current path with hash if pathRouting is enabled
|
|
573
|
+
* - The current hash if hashRouting (default)
|
|
574
|
+
* And then passes that to history.replaceState
|
|
575
|
+
*
|
|
576
|
+
* @example hashRouting (default)
|
|
577
|
+
* ```ts
|
|
578
|
+
* redirect: (hash: string) => hash.replace('#v1/old-path', '#v2/new-path')
|
|
579
|
+
* ```
|
|
580
|
+
* @example pathRouting
|
|
581
|
+
* ```ts
|
|
582
|
+
* redirect: (pathWithHash: string) => {
|
|
583
|
+
* if (pathWithHash.includes('#')) {
|
|
584
|
+
* return pathWithHash.replace('/v1/tags/user#operation/get-user', '/v1/tags/user/operation/get-user')
|
|
585
|
+
* }
|
|
586
|
+
* return null
|
|
587
|
+
* }
|
|
588
|
+
* ```
|
|
589
|
+
*/
|
|
590
|
+
redirect: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodOptional<z.ZodNullable<z.ZodString>>>>;
|
|
591
|
+
/**
|
|
592
|
+
* Whether to include default fonts
|
|
593
|
+
* @default true
|
|
594
|
+
*/
|
|
595
|
+
withDefaultFonts: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
596
|
+
/** Whether to expand all tags by default */
|
|
597
|
+
defaultOpenAllTags: z.ZodOptional<z.ZodBoolean>;
|
|
598
|
+
/**
|
|
599
|
+
* Function to sort tags
|
|
600
|
+
* @default 'alpha' for alphabetical sorting
|
|
601
|
+
*/
|
|
602
|
+
tagsSorter: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"alpha">, z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodAny], z.ZodUnknown>, z.ZodNumber>]>>;
|
|
603
|
+
/**
|
|
604
|
+
* Function to sort operations
|
|
605
|
+
* @default 'alpha' for alphabetical sorting
|
|
606
|
+
*/
|
|
607
|
+
operationsSorter: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"alpha">, z.ZodLiteral<"method">, z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodAny], z.ZodUnknown>, z.ZodNumber>]>>;
|
|
608
|
+
}>, "strip", z.ZodTypeAny, {
|
|
609
|
+
hideClientButton: boolean;
|
|
610
|
+
showSidebar: boolean;
|
|
611
|
+
theme: "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "none";
|
|
612
|
+
layout: "modern" | "classic";
|
|
613
|
+
isEditable: boolean;
|
|
614
|
+
isLoading: boolean;
|
|
615
|
+
hideModels: boolean;
|
|
616
|
+
hideDownloadButton: boolean;
|
|
617
|
+
hideTestRequestButton: boolean;
|
|
618
|
+
hideSearch: boolean;
|
|
619
|
+
hideDarkModeToggle: boolean;
|
|
620
|
+
withDefaultFonts: boolean;
|
|
621
|
+
url?: string | undefined;
|
|
622
|
+
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
623
|
+
title?: string | undefined;
|
|
624
|
+
slug?: string | undefined;
|
|
625
|
+
spec?: {
|
|
626
|
+
url?: string | undefined;
|
|
627
|
+
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
628
|
+
title?: string | undefined;
|
|
629
|
+
slug?: string | undefined;
|
|
630
|
+
} | undefined;
|
|
631
|
+
authentication?: any;
|
|
632
|
+
baseServerURL?: string | undefined;
|
|
633
|
+
proxyUrl?: string | undefined;
|
|
634
|
+
searchHotKey?: "o" | "n" | "c" | "r" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
|
|
635
|
+
servers?: any[] | undefined;
|
|
636
|
+
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
637
|
+
proxy?: string | undefined;
|
|
638
|
+
darkMode?: boolean | undefined;
|
|
639
|
+
forceDarkModeState?: "dark" | "light" | undefined;
|
|
640
|
+
metaData?: any;
|
|
641
|
+
favicon?: string | undefined;
|
|
642
|
+
hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
|
|
643
|
+
defaultHttpClient?: {
|
|
644
|
+
targetKey: "http" | "c" | "clojure" | "csharp" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
645
|
+
clientKey: string;
|
|
646
|
+
} | undefined;
|
|
647
|
+
customCss?: string | undefined;
|
|
648
|
+
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
649
|
+
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
650
|
+
onDocumentSelect?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
651
|
+
onLoaded?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
652
|
+
onShowMore?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
653
|
+
onSidebarClick?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
654
|
+
pathRouting?: {
|
|
655
|
+
basePath: string;
|
|
656
|
+
} | undefined;
|
|
657
|
+
generateHeadingSlug?: ((args_0: {
|
|
658
|
+
slug?: string | undefined;
|
|
659
|
+
}, ...args: unknown[]) => string) | undefined;
|
|
660
|
+
generateModelSlug?: ((args_0: {
|
|
661
|
+
name?: string | undefined;
|
|
662
|
+
}, ...args: unknown[]) => string) | undefined;
|
|
663
|
+
generateTagSlug?: ((args_0: {
|
|
664
|
+
name?: string | undefined;
|
|
665
|
+
}, ...args: unknown[]) => string) | undefined;
|
|
666
|
+
generateOperationSlug?: ((args_0: {
|
|
667
|
+
path: string;
|
|
668
|
+
method: string;
|
|
669
|
+
operationId?: string | undefined;
|
|
670
|
+
summary?: string | undefined;
|
|
671
|
+
}, ...args: unknown[]) => string) | undefined;
|
|
672
|
+
generateWebhookSlug?: ((args_0: {
|
|
673
|
+
name: string;
|
|
674
|
+
method?: string | undefined;
|
|
675
|
+
}, ...args: unknown[]) => string) | undefined;
|
|
676
|
+
redirect?: ((args_0: string, ...args: unknown[]) => string | null | undefined) | undefined;
|
|
677
|
+
defaultOpenAllTags?: boolean | undefined;
|
|
678
|
+
tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
679
|
+
operationsSorter?: "method" | "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
680
|
+
}, {
|
|
681
|
+
url?: string | undefined;
|
|
682
|
+
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
683
|
+
title?: string | undefined;
|
|
684
|
+
slug?: string | undefined;
|
|
685
|
+
spec?: {
|
|
686
|
+
url?: string | undefined;
|
|
687
|
+
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
688
|
+
title?: string | undefined;
|
|
689
|
+
slug?: string | undefined;
|
|
690
|
+
} | undefined;
|
|
691
|
+
authentication?: any;
|
|
692
|
+
baseServerURL?: string | undefined;
|
|
693
|
+
hideClientButton?: unknown;
|
|
694
|
+
proxyUrl?: string | undefined;
|
|
695
|
+
searchHotKey?: "o" | "n" | "c" | "r" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
|
|
696
|
+
servers?: any[] | undefined;
|
|
697
|
+
showSidebar?: unknown;
|
|
698
|
+
theme?: unknown;
|
|
699
|
+
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
700
|
+
layout?: unknown;
|
|
701
|
+
proxy?: string | undefined;
|
|
702
|
+
isEditable?: unknown;
|
|
703
|
+
isLoading?: unknown;
|
|
704
|
+
hideModels?: unknown;
|
|
705
|
+
hideDownloadButton?: unknown;
|
|
706
|
+
hideTestRequestButton?: unknown;
|
|
707
|
+
hideSearch?: unknown;
|
|
708
|
+
darkMode?: boolean | undefined;
|
|
709
|
+
forceDarkModeState?: "dark" | "light" | undefined;
|
|
710
|
+
hideDarkModeToggle?: unknown;
|
|
711
|
+
metaData?: any;
|
|
712
|
+
favicon?: string | undefined;
|
|
713
|
+
hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
|
|
714
|
+
defaultHttpClient?: {
|
|
715
|
+
targetKey: "http" | "c" | "clojure" | "csharp" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
716
|
+
clientKey: string;
|
|
717
|
+
} | undefined;
|
|
718
|
+
customCss?: string | undefined;
|
|
719
|
+
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
720
|
+
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
721
|
+
onDocumentSelect?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
722
|
+
onLoaded?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
723
|
+
onShowMore?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
724
|
+
onSidebarClick?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
725
|
+
pathRouting?: {
|
|
726
|
+
basePath: string;
|
|
727
|
+
} | undefined;
|
|
728
|
+
generateHeadingSlug?: ((args_0: {
|
|
729
|
+
slug: string;
|
|
730
|
+
}, ...args: unknown[]) => string) | undefined;
|
|
731
|
+
generateModelSlug?: ((args_0: {
|
|
732
|
+
name: string;
|
|
733
|
+
}, ...args: unknown[]) => string) | undefined;
|
|
734
|
+
generateTagSlug?: ((args_0: {
|
|
735
|
+
name: string;
|
|
736
|
+
}, ...args: unknown[]) => string) | undefined;
|
|
737
|
+
generateOperationSlug?: ((args_0: {
|
|
738
|
+
path: string;
|
|
739
|
+
method: string;
|
|
740
|
+
operationId?: string | undefined;
|
|
741
|
+
summary?: string | undefined;
|
|
742
|
+
}, ...args: unknown[]) => string) | undefined;
|
|
743
|
+
generateWebhookSlug?: ((args_0: {
|
|
744
|
+
name: string;
|
|
745
|
+
method?: string | undefined;
|
|
746
|
+
}, ...args: unknown[]) => string) | undefined;
|
|
747
|
+
redirect?: ((args_0: string, ...args: unknown[]) => string | null | undefined) | undefined;
|
|
748
|
+
withDefaultFonts?: unknown;
|
|
749
|
+
defaultOpenAllTags?: boolean | undefined;
|
|
750
|
+
tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
751
|
+
operationsSorter?: "method" | "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
752
|
+
}>;
|
|
251
753
|
/** Configuration for the Api Reference */
|
|
252
754
|
export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
|
|
253
755
|
/**
|
|
@@ -464,6 +966,18 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
464
966
|
onServerChange: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodVoid>>;
|
|
465
967
|
/** onDocumentSelect is fired when the config is selected */
|
|
466
968
|
onDocumentSelect: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
969
|
+
/** Callback fired when the reference is fully loaded */
|
|
970
|
+
onLoaded: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
971
|
+
/**
|
|
972
|
+
* onShowMore is fired when the user clicks the "Show more" button on the references
|
|
973
|
+
* @param tagId - The ID of the tag that was clicked
|
|
974
|
+
*/
|
|
975
|
+
onShowMore: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
976
|
+
/**
|
|
977
|
+
* onSidebarClick is fired when the user clicks on a sidebar item
|
|
978
|
+
* @param href - The href of the sidebar item that was clicked
|
|
979
|
+
*/
|
|
980
|
+
onSidebarClick: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
467
981
|
/**
|
|
468
982
|
* Route using paths instead of hashes, your server MUST support this
|
|
469
983
|
* @example '/standalone-api-reference/:custom(.*)?'
|
|
@@ -555,8 +1069,6 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
555
1069
|
name: string;
|
|
556
1070
|
method?: string | undefined;
|
|
557
1071
|
}>], z.ZodUnknown>, z.ZodString>>;
|
|
558
|
-
/** Callback fired when the reference is fully loaded */
|
|
559
|
-
onLoaded: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
|
|
560
1072
|
/**
|
|
561
1073
|
* To handle redirects, pass a function that will recieve:
|
|
562
1074
|
* - The current path with hash if pathRouting is enabled
|
|
@@ -638,6 +1150,9 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
638
1150
|
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
639
1151
|
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
640
1152
|
onDocumentSelect?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
1153
|
+
onLoaded?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
1154
|
+
onShowMore?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
1155
|
+
onSidebarClick?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
641
1156
|
pathRouting?: {
|
|
642
1157
|
basePath: string;
|
|
643
1158
|
} | undefined;
|
|
@@ -660,7 +1175,6 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
660
1175
|
name: string;
|
|
661
1176
|
method?: string | undefined;
|
|
662
1177
|
}, ...args: unknown[]) => string) | undefined;
|
|
663
|
-
onLoaded?: ((...args: unknown[]) => void) | undefined;
|
|
664
1178
|
redirect?: ((args_0: string, ...args: unknown[]) => string | null | undefined) | undefined;
|
|
665
1179
|
defaultOpenAllTags?: boolean | undefined;
|
|
666
1180
|
tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
@@ -707,6 +1221,9 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
707
1221
|
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
708
1222
|
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
709
1223
|
onDocumentSelect?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
1224
|
+
onLoaded?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
1225
|
+
onShowMore?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
1226
|
+
onSidebarClick?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
710
1227
|
pathRouting?: {
|
|
711
1228
|
basePath: string;
|
|
712
1229
|
} | undefined;
|
|
@@ -729,7 +1246,6 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
729
1246
|
name: string;
|
|
730
1247
|
method?: string | undefined;
|
|
731
1248
|
}, ...args: unknown[]) => string) | undefined;
|
|
732
|
-
onLoaded?: ((...args: unknown[]) => void) | undefined;
|
|
733
1249
|
redirect?: ((args_0: string, ...args: unknown[]) => string | null | undefined) | undefined;
|
|
734
1250
|
withDefaultFonts?: unknown;
|
|
735
1251
|
defaultOpenAllTags?: boolean | undefined;
|
|
@@ -778,6 +1294,9 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
778
1294
|
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
779
1295
|
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
780
1296
|
onDocumentSelect?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
1297
|
+
onLoaded?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
1298
|
+
onShowMore?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
1299
|
+
onSidebarClick?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
781
1300
|
pathRouting?: {
|
|
782
1301
|
basePath: string;
|
|
783
1302
|
} | undefined;
|
|
@@ -800,7 +1319,6 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
800
1319
|
name: string;
|
|
801
1320
|
method?: string | undefined;
|
|
802
1321
|
}, ...args: unknown[]) => string) | undefined;
|
|
803
|
-
onLoaded?: ((...args: unknown[]) => void) | undefined;
|
|
804
1322
|
redirect?: ((args_0: string, ...args: unknown[]) => string | null | undefined) | undefined;
|
|
805
1323
|
defaultOpenAllTags?: boolean | undefined;
|
|
806
1324
|
tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
@@ -847,6 +1365,9 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
847
1365
|
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
848
1366
|
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
849
1367
|
onDocumentSelect?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
1368
|
+
onLoaded?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
1369
|
+
onShowMore?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
1370
|
+
onSidebarClick?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
850
1371
|
pathRouting?: {
|
|
851
1372
|
basePath: string;
|
|
852
1373
|
} | undefined;
|
|
@@ -869,7 +1390,6 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
869
1390
|
name: string;
|
|
870
1391
|
method?: string | undefined;
|
|
871
1392
|
}, ...args: unknown[]) => string) | undefined;
|
|
872
|
-
onLoaded?: ((...args: unknown[]) => void) | undefined;
|
|
873
1393
|
redirect?: ((args_0: string, ...args: unknown[]) => string | null | undefined) | undefined;
|
|
874
1394
|
withDefaultFonts?: unknown;
|
|
875
1395
|
defaultOpenAllTags?: boolean | undefined;
|
|
@@ -877,7 +1397,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
877
1397
|
operationsSorter?: "method" | "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
878
1398
|
}>;
|
|
879
1399
|
/** Configuration after parsing, this is the main type */
|
|
880
|
-
export type ApiReferenceConfiguration = Omit<z.infer<typeof
|
|
1400
|
+
export type ApiReferenceConfiguration = Omit<z.infer<typeof _apiReferenceConfigurationSchema>, 'proxy' | 'spec'> & {
|
|
881
1401
|
authentication?: AuthenticationConfiguration;
|
|
882
1402
|
};
|
|
883
1403
|
/** Api Config which includes the default config */
|
|
@@ -892,7 +1412,7 @@ export type ApiReferenceConfigurationWithSources = Omit<ApiReferenceConfiguratio
|
|
|
892
1412
|
})[];
|
|
893
1413
|
};
|
|
894
1414
|
/** Configuration for multiple Api References */
|
|
895
|
-
export type AnyApiReferenceConfiguration = Partial<ApiReferenceConfiguration> | Partial<ApiReferenceConfigurationWithSources> | Partial<ApiReferenceConfigurationWithDefault>[];
|
|
1415
|
+
export type AnyApiReferenceConfiguration = Partial<ApiReferenceConfiguration> | Partial<ApiReferenceConfigurationWithSources> | Partial<ApiReferenceConfigurationWithDefault>[] | Partial<ApiReferenceConfigurationWithSources>[];
|
|
896
1416
|
/** Typeguard to check to narrow the configs to the one with sources */
|
|
897
1417
|
export declare const isConfigurationWithSources: (config: AnyApiReferenceConfiguration) => config is Partial<ApiReferenceConfigurationWithSources>;
|
|
898
1418
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-reference-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-configuration.ts"],"names":[],"mappings":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AClB,CAAA;AAED,qDAAqD;AACrD,MAAM,MAAM,oCAAoC,GAAG,IAAI,CAAC,oCAAoC,EAAE,SAAS,CAAC,GAAG;IACzG,OAAO,EAAE,CAAC,iBAAiB,GAAG;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,EAAE,CAAA;CACvD,CAAA;AAED,gDAAgD;AAChD,MAAM,MAAM,4BAA4B,GACpC,OAAO,CAAC,yBAAyB,CAAC,GAClC,OAAO,CAAC,oCAAoC,CAAC,GAC7C,OAAO,CAAC,oCAAoC,CAAC,EAAE,GAC/C,OAAO,CAAC,oCAAoC,CAAC,EAAE,CAAA;AAEnD,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,WAC7B,4BAA4B,KACnC,MAAM,IAAI,OAAO,CAAC,oCAAoC,CAC0C,CAAA"}
|
|
@@ -286,6 +286,18 @@ const _apiReferenceConfigurationSchema = apiClientConfigurationSchema.merge(z.ob
|
|
|
286
286
|
onServerChange: z.function().args(z.string()).returns(z.void()).optional(),
|
|
287
287
|
/** onDocumentSelect is fired when the config is selected */
|
|
288
288
|
onDocumentSelect: z.function().returns(z.void().or(z.void().promise())).optional(),
|
|
289
|
+
/** Callback fired when the reference is fully loaded */
|
|
290
|
+
onLoaded: z.function().returns(z.void().or(z.void().promise())).optional(),
|
|
291
|
+
/**
|
|
292
|
+
* onShowMore is fired when the user clicks the "Show more" button on the references
|
|
293
|
+
* @param tagId - The ID of the tag that was clicked
|
|
294
|
+
*/
|
|
295
|
+
onShowMore: z.function().args(z.string()).returns(z.void().or(z.void().promise())).optional(),
|
|
296
|
+
/**
|
|
297
|
+
* onSidebarClick is fired when the user clicks on a sidebar item
|
|
298
|
+
* @param href - The href of the sidebar item that was clicked
|
|
299
|
+
*/
|
|
300
|
+
onSidebarClick: z.function().args(z.string()).returns(z.void().or(z.void().promise())).optional(),
|
|
289
301
|
/**
|
|
290
302
|
* Route using paths instead of hashes, your server MUST support this
|
|
291
303
|
* @example '/standalone-api-reference/:custom(.*)?'
|
|
@@ -356,8 +368,6 @@ const _apiReferenceConfigurationSchema = apiClientConfigurationSchema.merge(z.ob
|
|
|
356
368
|
}))
|
|
357
369
|
.returns(z.string())
|
|
358
370
|
.optional(),
|
|
359
|
-
/** Callback fired when the reference is fully loaded */
|
|
360
|
-
onLoaded: z.function().returns(z.void()).optional(),
|
|
361
371
|
/**
|
|
362
372
|
* To handle redirects, pass a function that will recieve:
|
|
363
373
|
* - The current path with hash if pathRouting is enabled
|
|
@@ -110,6 +110,8 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
110
110
|
description: z.ZodOptional<z.ZodString>;
|
|
111
111
|
}, {
|
|
112
112
|
type: z.ZodLiteral<"oauth2">;
|
|
113
|
+
/** The default scopes for the oauth flow */
|
|
114
|
+
'x-default-scopes': z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
113
115
|
/** REQUIRED. An object containing configuration information for the flow types supported. */
|
|
114
116
|
flows: z.ZodDefault<z.ZodObject<{
|
|
115
117
|
implicit: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
@@ -437,11 +439,13 @@ export declare const securityOauthSchema: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
437
439
|
} | undefined;
|
|
438
440
|
};
|
|
439
441
|
description?: string | undefined;
|
|
442
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
440
443
|
}, {
|
|
441
444
|
type: "oauth2";
|
|
442
445
|
description?: string | undefined;
|
|
443
446
|
uid?: string | undefined;
|
|
444
447
|
nameKey?: string | undefined;
|
|
448
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
445
449
|
flows?: {
|
|
446
450
|
password?: {
|
|
447
451
|
type?: "password" | undefined;
|
|
@@ -554,6 +558,8 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
554
558
|
description: z.ZodOptional<z.ZodString>;
|
|
555
559
|
}, {
|
|
556
560
|
type: z.ZodLiteral<"oauth2">;
|
|
561
|
+
/** The default scopes for the oauth flow */
|
|
562
|
+
'x-default-scopes': z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
557
563
|
/** REQUIRED. An object containing configuration information for the flow types supported. */
|
|
558
564
|
flows: z.ZodDefault<z.ZodObject<{
|
|
559
565
|
implicit: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
@@ -875,9 +881,11 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
875
881
|
} | undefined;
|
|
876
882
|
};
|
|
877
883
|
description?: string | undefined;
|
|
884
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
878
885
|
}, {
|
|
879
886
|
type: "oauth2";
|
|
880
887
|
description?: string | undefined;
|
|
888
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
881
889
|
flows?: {
|
|
882
890
|
password?: {
|
|
883
891
|
type?: "password" | undefined;
|
|
@@ -944,7 +952,7 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
944
952
|
openIdConnectUrl?: string | undefined;
|
|
945
953
|
}>]>;
|
|
946
954
|
/** Extended security schemes for workspace usage */
|
|
947
|
-
export declare const securitySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
955
|
+
export declare const securitySchemeSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
948
956
|
description: z.ZodOptional<z.ZodString>;
|
|
949
957
|
}, {
|
|
950
958
|
type: z.ZodLiteral<"apiKey">;
|
|
@@ -1046,6 +1054,8 @@ export declare const securitySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.
|
|
|
1046
1054
|
description: z.ZodOptional<z.ZodString>;
|
|
1047
1055
|
}, {
|
|
1048
1056
|
type: z.ZodLiteral<"oauth2">;
|
|
1057
|
+
/** The default scopes for the oauth flow */
|
|
1058
|
+
'x-default-scopes': z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
1049
1059
|
/** REQUIRED. An object containing configuration information for the flow types supported. */
|
|
1050
1060
|
flows: z.ZodDefault<z.ZodObject<{
|
|
1051
1061
|
implicit: z.ZodOptional<z.ZodObject<z.objectUtil.extendShape<{
|
|
@@ -1373,11 +1383,13 @@ export declare const securitySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.
|
|
|
1373
1383
|
} | undefined;
|
|
1374
1384
|
};
|
|
1375
1385
|
description?: string | undefined;
|
|
1386
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
1376
1387
|
}, {
|
|
1377
1388
|
type: "oauth2";
|
|
1378
1389
|
description?: string | undefined;
|
|
1379
1390
|
uid?: string | undefined;
|
|
1380
1391
|
nameKey?: string | undefined;
|
|
1392
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
1381
1393
|
flows?: {
|
|
1382
1394
|
password?: {
|
|
1383
1395
|
type?: "password" | undefined;
|
|
@@ -1425,7 +1437,161 @@ export declare const securitySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.
|
|
|
1425
1437
|
'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
|
|
1426
1438
|
} | undefined;
|
|
1427
1439
|
} | undefined;
|
|
1428
|
-
}>]
|
|
1440
|
+
}>]>, {
|
|
1441
|
+
type: "apiKey";
|
|
1442
|
+
value: string;
|
|
1443
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
1444
|
+
nameKey: string;
|
|
1445
|
+
name: string;
|
|
1446
|
+
in: "cookie" | "query" | "header";
|
|
1447
|
+
description?: string | undefined;
|
|
1448
|
+
} | {
|
|
1449
|
+
type: "http";
|
|
1450
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
1451
|
+
nameKey: string;
|
|
1452
|
+
scheme: "basic" | "bearer";
|
|
1453
|
+
bearerFormat: string;
|
|
1454
|
+
username: string;
|
|
1455
|
+
password: string;
|
|
1456
|
+
token: string;
|
|
1457
|
+
description?: string | undefined;
|
|
1458
|
+
} | {
|
|
1459
|
+
type: "openIdConnect";
|
|
1460
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
1461
|
+
nameKey: string;
|
|
1462
|
+
openIdConnectUrl: string;
|
|
1463
|
+
description?: string | undefined;
|
|
1464
|
+
} | {
|
|
1465
|
+
type: "oauth2";
|
|
1466
|
+
uid: string & z.BRAND<"securityScheme">;
|
|
1467
|
+
nameKey: string;
|
|
1468
|
+
flows: {
|
|
1469
|
+
password?: {
|
|
1470
|
+
type: "password";
|
|
1471
|
+
username: string;
|
|
1472
|
+
password: string;
|
|
1473
|
+
token: string;
|
|
1474
|
+
refreshUrl: string;
|
|
1475
|
+
scopes: Record<string, string>;
|
|
1476
|
+
selectedScopes: string[];
|
|
1477
|
+
'x-scalar-client-id': string;
|
|
1478
|
+
tokenUrl: string;
|
|
1479
|
+
clientSecret: string;
|
|
1480
|
+
} | undefined;
|
|
1481
|
+
implicit?: {
|
|
1482
|
+
type: "implicit";
|
|
1483
|
+
token: string;
|
|
1484
|
+
refreshUrl: string;
|
|
1485
|
+
scopes: Record<string, string>;
|
|
1486
|
+
selectedScopes: string[];
|
|
1487
|
+
'x-scalar-client-id': string;
|
|
1488
|
+
authorizationUrl: string;
|
|
1489
|
+
'x-scalar-redirect-uri': string;
|
|
1490
|
+
} | undefined;
|
|
1491
|
+
clientCredentials?: {
|
|
1492
|
+
type: "clientCredentials";
|
|
1493
|
+
token: string;
|
|
1494
|
+
refreshUrl: string;
|
|
1495
|
+
scopes: Record<string, string>;
|
|
1496
|
+
selectedScopes: string[];
|
|
1497
|
+
'x-scalar-client-id': string;
|
|
1498
|
+
tokenUrl: string;
|
|
1499
|
+
clientSecret: string;
|
|
1500
|
+
} | undefined;
|
|
1501
|
+
authorizationCode?: {
|
|
1502
|
+
type: "authorizationCode";
|
|
1503
|
+
token: string;
|
|
1504
|
+
refreshUrl: string;
|
|
1505
|
+
scopes: Record<string, string>;
|
|
1506
|
+
selectedScopes: string[];
|
|
1507
|
+
'x-scalar-client-id': string;
|
|
1508
|
+
authorizationUrl: string;
|
|
1509
|
+
'x-scalar-redirect-uri': string;
|
|
1510
|
+
tokenUrl: string;
|
|
1511
|
+
clientSecret: string;
|
|
1512
|
+
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
1513
|
+
} | undefined;
|
|
1514
|
+
};
|
|
1515
|
+
description?: string | undefined;
|
|
1516
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
1517
|
+
}, {
|
|
1518
|
+
type: "apiKey";
|
|
1519
|
+
value?: string | undefined;
|
|
1520
|
+
description?: string | undefined;
|
|
1521
|
+
uid?: string | undefined;
|
|
1522
|
+
nameKey?: string | undefined;
|
|
1523
|
+
name?: string | undefined;
|
|
1524
|
+
in?: unknown;
|
|
1525
|
+
} | {
|
|
1526
|
+
type: "http";
|
|
1527
|
+
description?: string | undefined;
|
|
1528
|
+
uid?: string | undefined;
|
|
1529
|
+
nameKey?: string | undefined;
|
|
1530
|
+
scheme?: string | undefined;
|
|
1531
|
+
bearerFormat?: string | undefined;
|
|
1532
|
+
username?: string | undefined;
|
|
1533
|
+
password?: string | undefined;
|
|
1534
|
+
token?: string | undefined;
|
|
1535
|
+
} | {
|
|
1536
|
+
type: "openIdConnect";
|
|
1537
|
+
description?: string | undefined;
|
|
1538
|
+
uid?: string | undefined;
|
|
1539
|
+
nameKey?: string | undefined;
|
|
1540
|
+
openIdConnectUrl?: string | undefined;
|
|
1541
|
+
} | {
|
|
1542
|
+
type: "oauth2";
|
|
1543
|
+
description?: string | undefined;
|
|
1544
|
+
uid?: string | undefined;
|
|
1545
|
+
nameKey?: string | undefined;
|
|
1546
|
+
'x-default-scopes'?: string | string[] | undefined;
|
|
1547
|
+
flows?: {
|
|
1548
|
+
password?: {
|
|
1549
|
+
type?: "password" | undefined;
|
|
1550
|
+
username?: string | undefined;
|
|
1551
|
+
password?: string | undefined;
|
|
1552
|
+
token?: string | undefined;
|
|
1553
|
+
refreshUrl?: string | undefined;
|
|
1554
|
+
scopes?: unknown;
|
|
1555
|
+
selectedScopes?: string[] | undefined;
|
|
1556
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1557
|
+
tokenUrl?: string | undefined;
|
|
1558
|
+
clientSecret?: string | undefined;
|
|
1559
|
+
} | undefined;
|
|
1560
|
+
implicit?: {
|
|
1561
|
+
type?: "implicit" | undefined;
|
|
1562
|
+
token?: string | undefined;
|
|
1563
|
+
refreshUrl?: string | undefined;
|
|
1564
|
+
scopes?: unknown;
|
|
1565
|
+
selectedScopes?: string[] | undefined;
|
|
1566
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1567
|
+
authorizationUrl?: string | undefined;
|
|
1568
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
1569
|
+
} | undefined;
|
|
1570
|
+
clientCredentials?: {
|
|
1571
|
+
type?: "clientCredentials" | undefined;
|
|
1572
|
+
token?: string | undefined;
|
|
1573
|
+
refreshUrl?: string | undefined;
|
|
1574
|
+
scopes?: unknown;
|
|
1575
|
+
selectedScopes?: string[] | undefined;
|
|
1576
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1577
|
+
tokenUrl?: string | undefined;
|
|
1578
|
+
clientSecret?: string | undefined;
|
|
1579
|
+
} | undefined;
|
|
1580
|
+
authorizationCode?: {
|
|
1581
|
+
type?: "authorizationCode" | undefined;
|
|
1582
|
+
token?: string | undefined;
|
|
1583
|
+
refreshUrl?: string | undefined;
|
|
1584
|
+
scopes?: unknown;
|
|
1585
|
+
selectedScopes?: string[] | undefined;
|
|
1586
|
+
'x-scalar-client-id'?: string | undefined;
|
|
1587
|
+
authorizationUrl?: string | undefined;
|
|
1588
|
+
'x-scalar-redirect-uri'?: string | undefined;
|
|
1589
|
+
tokenUrl?: string | undefined;
|
|
1590
|
+
clientSecret?: string | undefined;
|
|
1591
|
+
'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
|
|
1592
|
+
} | undefined;
|
|
1593
|
+
} | undefined;
|
|
1594
|
+
}>;
|
|
1429
1595
|
/**
|
|
1430
1596
|
* Security Scheme Object
|
|
1431
1597
|
*
|
|
@@ -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;AAsCvE,0CAA0C;AAC1C,eAAO,MAAM,WAAW,qCAAsC,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,oBAAo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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqNxE,CAAA;AAEJ;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|
|
@@ -104,6 +104,8 @@ const pkceOptions = ['SHA-256', 'plain', 'no'];
|
|
|
104
104
|
/** Oauth2 security scheme */
|
|
105
105
|
const oasSecuritySchemeOauth2 = commonProps.extend({
|
|
106
106
|
type: z.literal('oauth2'),
|
|
107
|
+
/** The default scopes for the oauth flow */
|
|
108
|
+
'x-default-scopes': z.string().or(z.array(z.string())).optional(),
|
|
107
109
|
/** REQUIRED. An object containing configuration information for the flow types supported. */
|
|
108
110
|
flows: z
|
|
109
111
|
.object({
|
|
@@ -169,11 +171,19 @@ const oasSecuritySchemeSchema = z.union([
|
|
|
169
171
|
oasSecuritySchemeOpenId,
|
|
170
172
|
]);
|
|
171
173
|
/** Extended security schemes for workspace usage */
|
|
172
|
-
const securitySchemeSchema = z
|
|
173
|
-
securityApiKeySchema,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
const securitySchemeSchema = z
|
|
175
|
+
.union([securityApiKeySchema, securityHttpSchema, securityOpenIdSchema, securityOauthSchema])
|
|
176
|
+
.transform((data) => {
|
|
177
|
+
// Set selected scopes from x-default-scopes
|
|
178
|
+
if (data.type === 'oauth2' && data['x-default-scopes']?.length) {
|
|
179
|
+
const keys = Object.keys(data.flows);
|
|
180
|
+
keys.forEach((key) => {
|
|
181
|
+
if (data.flows[key]?.selectedScopes && data['x-default-scopes']) {
|
|
182
|
+
data.flows[key].selectedScopes = [data['x-default-scopes']].flat();
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return data;
|
|
187
|
+
});
|
|
178
188
|
|
|
179
189
|
export { oasSecurityRequirementSchema, oasSecuritySchemeSchema, pkceOptions, securityApiKeySchema, securityHttpSchema, securityOauthSchema, securityOpenIdSchema, securitySchemeApiKeyIn, securitySchemeSchema };
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"scalar",
|
|
17
17
|
"references"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.1.
|
|
19
|
+
"version": "0.1.6",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"nanoid": "^5.1.5",
|
|
64
64
|
"type-fest": "^4.20.0",
|
|
65
65
|
"zod": "^3.23.8",
|
|
66
|
-
"@scalar/openapi-types": "0.
|
|
66
|
+
"@scalar/openapi-types": "0.2.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/har-format": "^1.2.15",
|