@scalar/types 0.3.0 → 0.3.1

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/api-reference/api-client-configuration.d.ts +122 -0
  3. package/dist/api-reference/api-client-configuration.d.ts.map +1 -0
  4. package/dist/api-reference/api-client-configuration.js +7 -0
  5. package/dist/api-reference/api-client-configuration.js.map +7 -0
  6. package/dist/{api-client → api-reference}/api-client-plugin.d.ts +6 -3
  7. package/dist/api-reference/api-client-plugin.d.ts.map +1 -0
  8. package/dist/{api-client → api-reference}/api-client-plugin.js +10 -10
  9. package/dist/{api-client → api-reference}/api-client-plugin.js.map +3 -3
  10. package/dist/api-reference/api-reference-configuration.d.ts +58 -525
  11. package/dist/api-reference/api-reference-configuration.d.ts.map +1 -1
  12. package/dist/api-reference/api-reference-configuration.js +264 -501
  13. package/dist/api-reference/api-reference-configuration.js.map +2 -2
  14. package/dist/api-reference/api-reference-plugin.d.ts +4 -4
  15. package/dist/api-reference/api-reference-plugin.d.ts.map +1 -1
  16. package/dist/api-reference/api-reference-plugin.js +5 -5
  17. package/dist/api-reference/api-reference-plugin.js.map +2 -2
  18. package/dist/api-reference/base-configuration.d.ts +118 -0
  19. package/dist/api-reference/base-configuration.d.ts.map +1 -0
  20. package/dist/api-reference/base-configuration.js +139 -0
  21. package/dist/api-reference/base-configuration.js.map +7 -0
  22. package/dist/api-reference/html-rendering-configuration.d.ts +2 -2
  23. package/dist/api-reference/html-rendering-configuration.d.ts.map +1 -1
  24. package/dist/api-reference/html-rendering-configuration.js.map +2 -2
  25. package/dist/api-reference/index.d.ts +6 -3
  26. package/dist/api-reference/index.d.ts.map +1 -1
  27. package/dist/api-reference/index.js +12 -3
  28. package/dist/api-reference/index.js.map +2 -2
  29. package/dist/api-reference/source-configuration.d.ts +18 -0
  30. package/dist/api-reference/source-configuration.d.ts.map +1 -0
  31. package/dist/api-reference/source-configuration.js +87 -0
  32. package/dist/api-reference/source-configuration.js.map +7 -0
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +1 -1
  36. package/dist/index.js.map +2 -2
  37. package/dist/snippetz/snippetz.d.ts +1 -1
  38. package/dist/snippetz/snippetz.d.ts.map +1 -1
  39. package/dist/snippetz/snippetz.js +1 -0
  40. package/dist/snippetz/snippetz.js.map +2 -2
  41. package/package.json +2 -2
  42. package/dist/api-client/api-client-plugin.d.ts.map +0 -1
  43. package/dist/api-client/index.d.ts +0 -2
  44. package/dist/api-client/index.d.ts.map +0 -1
  45. package/dist/api-client/index.js +0 -6
  46. package/dist/api-client/index.js.map +0 -7
@@ -1,157 +1,27 @@
1
- import { z } from 'zod';
1
+ import { type ZodType, z } from 'zod';
2
2
  import type { AuthenticationConfiguration } from './authentication-configuration.js';
3
- /** Configuration for the OpenAPI/Swagger specification */
4
- export declare const specConfigurationSchema: z.ZodObject<{
5
- url: z.ZodOptional<z.ZodString>;
6
- content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>]>>;
3
+ import { type SourceConfiguration } from './source-configuration.js';
4
+ /**
5
+ * Standard configuration for the Api Reference.
6
+ *
7
+ * This is used internally to the configure the applications and does not include the sources.
8
+ *
9
+ * Sources should only be specified in the user facing configurations.
10
+ *
11
+ * In the the future it is likely sources will be removed completely from the configuration and instead
12
+ * specified through a separate addDocument interface.
13
+ */
14
+ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
7
15
  title: z.ZodOptional<z.ZodString>;
8
16
  slug: z.ZodOptional<z.ZodString>;
9
- }, z.core.$strip>;
10
- export type SpecConfiguration = z.infer<typeof specConfigurationSchema>;
11
- /** Configuration for the Api Client */
12
- export declare const apiClientConfigurationSchema: z.ZodObject<{
13
- url: z.ZodOptional<z.ZodString>;
14
- content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>]>>;
15
- title: z.ZodOptional<z.ZodString>;
16
- slug: z.ZodOptional<z.ZodString>;
17
- spec: z.ZodOptional<z.ZodObject<{
18
- url: z.ZodOptional<z.ZodString>;
19
- content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>]>>;
20
- title: z.ZodOptional<z.ZodString>;
21
- slug: z.ZodOptional<z.ZodString>;
22
- }, z.core.$strip>>;
23
17
  authentication: z.ZodOptional<z.ZodAny>;
24
18
  baseServerURL: z.ZodOptional<z.ZodString>;
25
19
  hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
26
20
  proxyUrl: z.ZodOptional<z.ZodString>;
27
21
  searchHotKey: z.ZodOptional<z.ZodEnum<{
28
- c: "c";
29
- r: "r";
30
22
  a: "a";
31
23
  b: "b";
32
- d: "d";
33
- e: "e";
34
- f: "f";
35
- g: "g";
36
- h: "h";
37
- i: "i";
38
- j: "j";
39
- k: "k";
40
- l: "l";
41
- m: "m";
42
- n: "n";
43
- o: "o";
44
- p: "p";
45
- q: "q";
46
- s: "s";
47
- t: "t";
48
- u: "u";
49
- v: "v";
50
- w: "w";
51
- x: "x";
52
- y: "y";
53
- z: "z";
54
- }>>;
55
- servers: z.ZodOptional<z.ZodArray<z.ZodAny>>;
56
- showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
57
- showToolbar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
58
- never: "never";
59
- always: "always";
60
- localhost: "localhost";
61
- }>>>>;
62
- operationTitleSource: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
63
- summary: "summary";
64
- path: "path";
65
- }>>>>;
66
- theme: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
67
- default: "default";
68
- alternate: "alternate";
69
- moon: "moon";
70
- purple: "purple";
71
- solarized: "solarized";
72
- bluePlanet: "bluePlanet";
73
- deepSpace: "deepSpace";
74
- saturn: "saturn";
75
- kepler: "kepler";
76
- elysiajs: "elysiajs";
77
- fastify: "fastify";
78
- mars: "mars";
79
- laserwave: "laserwave";
80
- none: "none";
81
- }>>>>;
82
- _integration: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
83
- go: "go";
84
- rust: "rust";
85
- elysiajs: "elysiajs";
86
- fastify: "fastify";
87
- adonisjs: "adonisjs";
88
- docusaurus: "docusaurus";
89
- dotnet: "dotnet";
90
- express: "express";
91
- fastapi: "fastapi";
92
- hono: "hono";
93
- html: "html";
94
- laravel: "laravel";
95
- litestar: "litestar";
96
- nestjs: "nestjs";
97
- nextjs: "nextjs";
98
- nitro: "nitro";
99
- nuxt: "nuxt";
100
- platformatic: "platformatic";
101
- react: "react";
102
- svelte: "svelte";
103
- vue: "vue";
104
- }>>>;
105
- onRequestSent: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.ZodVoid>>;
106
- persistAuth: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
107
- plugins: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodObject<{
108
- name: z.ZodString;
109
- views: z.ZodOptional<z.ZodObject<{
110
- 'request.section': z.ZodOptional<z.ZodArray<z.ZodObject<{
111
- title: z.ZodOptional<z.ZodString>;
112
- component: z.ZodUnknown;
113
- props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
114
- }, z.core.$strip>>>;
115
- 'response.section': z.ZodOptional<z.ZodArray<z.ZodObject<{
116
- title: z.ZodOptional<z.ZodString>;
117
- component: z.ZodUnknown;
118
- props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
119
- }, z.core.$strip>>>;
120
- }, z.core.$strip>>;
121
- hooks: z.ZodOptional<z.ZodObject<{
122
- onBeforeRequest: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
123
- request: z.ZodCustom<Request, Request>;
124
- }, z.core.$strip>], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
125
- onResponseReceived: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
126
- response: z.ZodCustom<Response, Response>;
127
- operation: z.ZodRecord<z.ZodString, z.ZodAny>;
128
- }, z.core.$strip>], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
129
- }, z.core.$strip>>;
130
- }, z.core.$strip>>>>;
131
- telemetry: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
132
- }, z.core.$strip>;
133
- export type ApiClientConfiguration = z.infer<typeof apiClientConfigurationSchema>;
134
- /** Configuration for the Api Client without the transform since it cannot be merged */
135
- declare const _apiReferenceConfigurationSchema: z.ZodObject<{
136
- url: z.ZodOptional<z.ZodString>;
137
- content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>]>>;
138
- title: z.ZodOptional<z.ZodString>;
139
- slug: z.ZodOptional<z.ZodString>;
140
- spec: z.ZodOptional<z.ZodObject<{
141
- url: z.ZodOptional<z.ZodString>;
142
- content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>]>>;
143
- title: z.ZodOptional<z.ZodString>;
144
- slug: z.ZodOptional<z.ZodString>;
145
- }, z.core.$strip>>;
146
- authentication: z.ZodOptional<z.ZodAny>;
147
- baseServerURL: z.ZodOptional<z.ZodString>;
148
- hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
149
- proxyUrl: z.ZodOptional<z.ZodString>;
150
- searchHotKey: z.ZodOptional<z.ZodEnum<{
151
24
  c: "c";
152
- r: "r";
153
- a: "a";
154
- b: "b";
155
25
  d: "d";
156
26
  e: "e";
157
27
  f: "f";
@@ -166,6 +36,7 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<{
166
36
  o: "o";
167
37
  p: "p";
168
38
  q: "q";
39
+ r: "r";
169
40
  s: "s";
170
41
  t: "t";
171
42
  u: "u";
@@ -203,8 +74,6 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<{
203
74
  none: "none";
204
75
  }>>>>;
205
76
  _integration: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
206
- go: "go";
207
- rust: "rust";
208
77
  elysiajs: "elysiajs";
209
78
  fastify: "fastify";
210
79
  adonisjs: "adonisjs";
@@ -212,6 +81,7 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<{
212
81
  dotnet: "dotnet";
213
82
  express: "express";
214
83
  fastapi: "fastapi";
84
+ go: "go";
215
85
  hono: "hono";
216
86
  html: "html";
217
87
  laravel: "laravel";
@@ -222,6 +92,7 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<{
222
92
  nuxt: "nuxt";
223
93
  platformatic: "platformatic";
224
94
  react: "react";
95
+ rust: "rust";
225
96
  svelte: "svelte";
226
97
  vue: "vue";
227
98
  }>>>;
@@ -266,7 +137,7 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<{
266
137
  favicon: z.ZodOptional<z.ZodString>;
267
138
  hiddenClients: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>, z.ZodArray<z.ZodString>, z.ZodLiteral<true>]>>;
268
139
  defaultHttpClient: z.ZodOptional<z.ZodObject<{
269
- targetKey: z.ZodCustom<"c" | "clojure" | "csharp" | "dart" | "http" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "rust" | "shell" | "swift", "c" | "clojure" | "csharp" | "dart" | "http" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "rust" | "shell" | "swift">;
140
+ targetKey: z.ZodCustom<"c" | "r" | "go" | "rust" | "clojure" | "csharp" | "dart" | "http" | "fsharp" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "ruby" | "shell" | "swift", "c" | "r" | "go" | "rust" | "clojure" | "csharp" | "dart" | "http" | "fsharp" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "ruby" | "shell" | "swift">;
270
141
  clientKey: z.ZodString;
271
142
  }, z.core.$strip>>;
272
143
  customCss: z.ZodOptional<z.ZodString>;
@@ -311,394 +182,56 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<{
311
182
  orderSchemaPropertiesBy: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"alpha">, z.ZodLiteral<"preserve">]>>>>;
312
183
  orderRequiredPropertiesFirst: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
313
184
  }, z.core.$strip>;
185
+ /**
186
+ * Configuration for the Scalar Api Reference integrations
187
+ *
188
+ * See the type `ApiReferenceConfigurationWithSource` or `AnyApiReferenceConfiguration`\
189
+ * for the configuration that includes the sources for you OpenAPI documents
190
+ */
191
+ export type ApiReferenceConfiguration = Omit<z.infer<typeof apiReferenceConfigurationSchema>, // Remove deprecated attributes
192
+ // Remove deprecated attributes
193
+ 'proxy' | 'spec' | 'authentication'> & {
194
+ authentication?: AuthenticationConfiguration;
195
+ } & {
196
+ /** @deprecated
197
+ * This type now refers to the base configuration that does not include the sources.
198
+ * Use the type `ApiReferenceConfigurationWithSource` instead.
199
+ */
200
+ url?: SourceConfiguration['url'];
201
+ /** @deprecated
202
+ * This type now refers to the base configuration that does not include the sources.
203
+ * Use the type `ApiReferenceConfigurationWithSource` instead.
204
+ */
205
+ content?: SourceConfiguration['content'];
206
+ };
207
+ /** Migrate the configuration through a transform */
314
208
  /** Configuration for the Api Reference */
315
- export declare const apiReferenceConfigurationSchema: z.ZodPipe<z.ZodObject<{
316
- url: z.ZodOptional<z.ZodString>;
317
- content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>]>>;
318
- title: z.ZodOptional<z.ZodString>;
319
- slug: z.ZodOptional<z.ZodString>;
320
- spec: z.ZodOptional<z.ZodObject<{
321
- url: z.ZodOptional<z.ZodString>;
322
- content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>]>>;
323
- title: z.ZodOptional<z.ZodString>;
324
- slug: z.ZodOptional<z.ZodString>;
325
- }, z.core.$strip>>;
326
- authentication: z.ZodOptional<z.ZodAny>;
327
- baseServerURL: z.ZodOptional<z.ZodString>;
328
- hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
329
- proxyUrl: z.ZodOptional<z.ZodString>;
330
- searchHotKey: z.ZodOptional<z.ZodEnum<{
331
- c: "c";
332
- r: "r";
333
- a: "a";
334
- b: "b";
335
- d: "d";
336
- e: "e";
337
- f: "f";
338
- g: "g";
339
- h: "h";
340
- i: "i";
341
- j: "j";
342
- k: "k";
343
- l: "l";
344
- m: "m";
345
- n: "n";
346
- o: "o";
347
- p: "p";
348
- q: "q";
349
- s: "s";
350
- t: "t";
351
- u: "u";
352
- v: "v";
353
- w: "w";
354
- x: "x";
355
- y: "y";
356
- z: "z";
357
- }>>;
358
- servers: z.ZodOptional<z.ZodArray<z.ZodAny>>;
359
- showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
360
- showToolbar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
361
- never: "never";
362
- always: "always";
363
- localhost: "localhost";
364
- }>>>>;
365
- operationTitleSource: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
366
- summary: "summary";
367
- path: "path";
368
- }>>>>;
369
- theme: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
370
- default: "default";
371
- alternate: "alternate";
372
- moon: "moon";
373
- purple: "purple";
374
- solarized: "solarized";
375
- bluePlanet: "bluePlanet";
376
- deepSpace: "deepSpace";
377
- saturn: "saturn";
378
- kepler: "kepler";
379
- elysiajs: "elysiajs";
380
- fastify: "fastify";
381
- mars: "mars";
382
- laserwave: "laserwave";
383
- none: "none";
384
- }>>>>;
385
- _integration: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
386
- go: "go";
387
- rust: "rust";
388
- elysiajs: "elysiajs";
389
- fastify: "fastify";
390
- adonisjs: "adonisjs";
391
- docusaurus: "docusaurus";
392
- dotnet: "dotnet";
393
- express: "express";
394
- fastapi: "fastapi";
395
- hono: "hono";
396
- html: "html";
397
- laravel: "laravel";
398
- litestar: "litestar";
399
- nestjs: "nestjs";
400
- nextjs: "nextjs";
401
- nitro: "nitro";
402
- nuxt: "nuxt";
403
- platformatic: "platformatic";
404
- react: "react";
405
- svelte: "svelte";
406
- vue: "vue";
407
- }>>>;
408
- onRequestSent: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.ZodVoid>>;
409
- persistAuth: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
410
- telemetry: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
411
- layout: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
412
- modern: "modern";
413
- classic: "classic";
414
- }>>>>;
415
- proxy: z.ZodOptional<z.ZodString>;
416
- fetch: z.ZodOptional<z.ZodCustom<(input: string | URL | Request, init?: RequestInit) => Promise<Response>, (input: string | URL | Request, init?: RequestInit) => Promise<Response>>>;
417
- plugins: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodObject<{
418
- name: z.ZodString;
419
- extensions: z.ZodArray<z.ZodObject<{
420
- name: z.ZodString;
421
- component: z.ZodUnknown;
422
- renderer: z.ZodOptional<z.ZodUnknown>;
423
- }, z.core.$strip>>;
424
- }, z.core.$strip>>>>;
425
- isEditable: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
426
- isLoading: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
427
- hideModels: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
428
- documentDownloadType: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
429
- none: "none";
430
- yaml: "yaml";
431
- json: "json";
432
- both: "both";
433
- direct: "direct";
434
- }>>>>;
435
- hideDownloadButton: z.ZodOptional<z.ZodBoolean>;
436
- hideTestRequestButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
437
- hideSearch: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
438
- showOperationId: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
439
- darkMode: z.ZodOptional<z.ZodBoolean>;
440
- forceDarkModeState: z.ZodOptional<z.ZodEnum<{
441
- dark: "dark";
442
- light: "light";
443
- }>>;
444
- hideDarkModeToggle: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
445
- metaData: z.ZodOptional<z.ZodAny>;
446
- favicon: z.ZodOptional<z.ZodString>;
447
- hiddenClients: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>, z.ZodArray<z.ZodString>, z.ZodLiteral<true>]>>;
448
- defaultHttpClient: z.ZodOptional<z.ZodObject<{
449
- targetKey: z.ZodCustom<"c" | "clojure" | "csharp" | "dart" | "http" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "rust" | "shell" | "swift", "c" | "clojure" | "csharp" | "dart" | "http" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "rust" | "shell" | "swift">;
450
- clientKey: z.ZodString;
451
- }, z.core.$strip>>;
452
- customCss: z.ZodOptional<z.ZodString>;
453
- onSpecUpdate: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.ZodVoid>>;
454
- onServerChange: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.ZodVoid>>;
455
- onDocumentSelect: z.ZodType<(() => Promise<void> | void) | undefined>;
456
- onLoaded: z.ZodType<(() => Promise<void> | void) | undefined>;
457
- onBeforeRequest: z.ZodType<((a: {
458
- request: Request;
459
- }) => Promise<void> | void) | undefined>;
460
- onShowMore: z.ZodType<((a: string) => Promise<void> | void) | undefined>;
461
- onSidebarClick: z.ZodType<((a: string) => Promise<void> | void) | undefined>;
462
- pathRouting: z.ZodOptional<z.ZodObject<{
463
- basePath: z.ZodString;
464
- }, z.core.$strip>>;
465
- generateHeadingSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
466
- slug: z.ZodDefault<z.ZodString>;
467
- }, z.core.$strip>], null>, z.ZodString>>;
468
- generateModelSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
469
- name: z.ZodDefault<z.ZodString>;
470
- }, z.core.$strip>], null>, z.ZodString>>;
471
- generateTagSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
472
- name: z.ZodDefault<z.ZodString>;
473
- }, z.core.$strip>], null>, z.ZodString>>;
474
- generateOperationSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
475
- path: z.ZodString;
476
- operationId: z.ZodOptional<z.ZodString>;
477
- method: z.ZodString;
478
- summary: z.ZodOptional<z.ZodString>;
479
- }, z.core.$strip>], null>, z.ZodString>>;
480
- generateWebhookSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
481
- name: z.ZodString;
482
- method: z.ZodOptional<z.ZodString>;
483
- }, z.core.$strip>], null>, z.ZodString>>;
484
- redirect: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.ZodOptional<z.ZodNullable<z.ZodString>>>>;
485
- withDefaultFonts: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
486
- defaultOpenAllTags: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
487
- expandAllModelSections: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
488
- expandAllResponses: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
489
- tagsSorter: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"alpha">, z.ZodFunction<z.ZodTuple<readonly [z.ZodAny, z.ZodAny], null>, z.ZodNumber>]>>;
490
- operationsSorter: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"alpha">, z.ZodLiteral<"method">, z.ZodFunction<z.ZodTuple<readonly [z.ZodAny, z.ZodAny], null>, z.ZodNumber>]>>;
491
- orderSchemaPropertiesBy: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"alpha">, z.ZodLiteral<"preserve">]>>>>;
492
- orderRequiredPropertiesFirst: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
493
- }, z.core.$strip>, z.ZodTransform<{
494
- hideClientButton: boolean;
495
- showSidebar: boolean;
496
- showToolbar: "never" | "always" | "localhost";
497
- operationTitleSource: "summary" | "path";
498
- theme: "default" | "alternate" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "laserwave" | "none";
499
- persistAuth: boolean;
500
- telemetry: boolean;
501
- layout: "modern" | "classic";
502
- isEditable: boolean;
503
- isLoading: boolean;
504
- hideModels: boolean;
505
- documentDownloadType: "none" | "yaml" | "json" | "both" | "direct";
506
- hideTestRequestButton: boolean;
507
- hideSearch: boolean;
508
- showOperationId: boolean;
509
- hideDarkModeToggle: boolean;
510
- onDocumentSelect: (() => Promise<void> | void) | undefined;
511
- onLoaded: (() => Promise<void> | void) | undefined;
512
- onBeforeRequest: ((a: {
513
- request: Request;
514
- }) => Promise<void> | void) | undefined;
515
- onShowMore: ((a: string) => Promise<void> | void) | undefined;
516
- onSidebarClick: ((a: string) => Promise<void> | void) | undefined;
517
- withDefaultFonts: boolean;
518
- defaultOpenAllTags: boolean;
519
- expandAllModelSections: boolean;
520
- expandAllResponses: boolean;
521
- orderSchemaPropertiesBy: "alpha" | "preserve";
522
- orderRequiredPropertiesFirst: boolean;
523
- url?: string | undefined;
524
- content?: string | Record<string, any> | z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>> | null | undefined;
525
- title?: string | undefined;
526
- slug?: string | undefined;
527
- spec?: {
528
- url?: string | undefined;
529
- content?: string | Record<string, any> | z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>> | null | undefined;
530
- title?: string | undefined;
531
- slug?: string | undefined;
532
- } | undefined;
533
- authentication?: any;
534
- baseServerURL?: string | undefined;
535
- proxyUrl?: string | undefined;
536
- searchHotKey?: "c" | "r" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
537
- servers?: any[] | undefined;
538
- _integration?: "go" | "rust" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "svelte" | "vue" | null | undefined;
539
- onRequestSent?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodString], null>, z.ZodVoid> | undefined;
540
- proxy?: string | undefined;
541
- fetch?: ((input: string | URL | Request, init?: RequestInit) => Promise<Response>) | undefined;
542
- plugins?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodObject<{
543
- name: z.ZodString;
544
- extensions: z.ZodArray<z.ZodObject<{
545
- name: z.ZodString;
546
- component: z.ZodUnknown;
547
- renderer: z.ZodOptional<z.ZodUnknown>;
548
- }, z.core.$strip>>;
549
- }, z.core.$strip>>[] | undefined;
550
- hideDownloadButton?: boolean | undefined;
551
- darkMode?: boolean | undefined;
552
- forceDarkModeState?: "dark" | "light" | undefined;
553
- metaData?: any;
554
- favicon?: string | undefined;
555
- hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
556
- defaultHttpClient?: {
557
- targetKey: "c" | "clojure" | "csharp" | "dart" | "http" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "rust" | "shell" | "swift";
558
- clientKey: string;
559
- } | undefined;
560
- customCss?: string | undefined;
561
- onSpecUpdate?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodString], null>, z.ZodVoid> | undefined;
562
- onServerChange?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodString], null>, z.ZodVoid> | undefined;
563
- pathRouting?: {
564
- basePath: string;
565
- } | undefined;
566
- generateHeadingSlug?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodObject<{
567
- slug: z.ZodDefault<z.ZodString>;
568
- }, z.core.$strip>], null>, z.ZodString> | undefined;
569
- generateModelSlug?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodObject<{
570
- name: z.ZodDefault<z.ZodString>;
571
- }, z.core.$strip>], null>, z.ZodString> | undefined;
572
- generateTagSlug?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodObject<{
573
- name: z.ZodDefault<z.ZodString>;
574
- }, z.core.$strip>], null>, z.ZodString> | undefined;
575
- generateOperationSlug?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodObject<{
576
- path: z.ZodString;
577
- operationId: z.ZodOptional<z.ZodString>;
578
- method: z.ZodString;
579
- summary: z.ZodOptional<z.ZodString>;
580
- }, z.core.$strip>], null>, z.ZodString> | undefined;
581
- generateWebhookSlug?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodObject<{
582
- name: z.ZodString;
583
- method: z.ZodOptional<z.ZodString>;
584
- }, z.core.$strip>], null>, z.ZodString> | undefined;
585
- redirect?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodString], null>, z.ZodOptional<z.ZodNullable<z.ZodString>>> | undefined;
586
- tagsSorter?: "alpha" | z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodAny, z.ZodAny], null>, z.ZodNumber> | undefined;
587
- operationsSorter?: "method" | "alpha" | z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodAny, z.ZodAny], null>, z.ZodNumber> | undefined;
588
- }, {
589
- hideClientButton: boolean;
590
- showSidebar: boolean;
591
- showToolbar: "never" | "always" | "localhost";
592
- operationTitleSource: "summary" | "path";
593
- theme: "default" | "alternate" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "laserwave" | "none";
594
- persistAuth: boolean;
595
- telemetry: boolean;
596
- layout: "modern" | "classic";
597
- isEditable: boolean;
598
- isLoading: boolean;
599
- hideModels: boolean;
600
- documentDownloadType: "none" | "yaml" | "json" | "both" | "direct";
601
- hideTestRequestButton: boolean;
602
- hideSearch: boolean;
603
- showOperationId: boolean;
604
- hideDarkModeToggle: boolean;
605
- onDocumentSelect: (() => Promise<void> | void) | undefined;
606
- onLoaded: (() => Promise<void> | void) | undefined;
607
- onBeforeRequest: ((a: {
608
- request: Request;
609
- }) => Promise<void> | void) | undefined;
610
- onShowMore: ((a: string) => Promise<void> | void) | undefined;
611
- onSidebarClick: ((a: string) => Promise<void> | void) | undefined;
612
- withDefaultFonts: boolean;
613
- defaultOpenAllTags: boolean;
614
- expandAllModelSections: boolean;
615
- expandAllResponses: boolean;
616
- orderSchemaPropertiesBy: "alpha" | "preserve";
617
- orderRequiredPropertiesFirst: boolean;
618
- url?: string | undefined;
619
- content?: string | Record<string, any> | z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>> | null | undefined;
620
- title?: string | undefined;
621
- slug?: string | undefined;
622
- spec?: {
623
- url?: string | undefined;
624
- content?: string | Record<string, any> | z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>> | null | undefined;
625
- title?: string | undefined;
626
- slug?: string | undefined;
627
- } | undefined;
628
- authentication?: any;
629
- baseServerURL?: string | undefined;
630
- proxyUrl?: string | undefined;
631
- searchHotKey?: "c" | "r" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
632
- servers?: any[] | undefined;
633
- _integration?: "go" | "rust" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "svelte" | "vue" | null | undefined;
634
- onRequestSent?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodString], null>, z.ZodVoid> | undefined;
635
- proxy?: string | undefined;
636
- fetch?: ((input: string | URL | Request, init?: RequestInit) => Promise<Response>) | undefined;
637
- plugins?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodObject<{
638
- name: z.ZodString;
639
- extensions: z.ZodArray<z.ZodObject<{
640
- name: z.ZodString;
641
- component: z.ZodUnknown;
642
- renderer: z.ZodOptional<z.ZodUnknown>;
643
- }, z.core.$strip>>;
644
- }, z.core.$strip>>[] | undefined;
645
- hideDownloadButton?: boolean | undefined;
646
- darkMode?: boolean | undefined;
647
- forceDarkModeState?: "dark" | "light" | undefined;
648
- metaData?: any;
649
- favicon?: string | undefined;
650
- hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
651
- defaultHttpClient?: {
652
- targetKey: "c" | "clojure" | "csharp" | "dart" | "http" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "rust" | "shell" | "swift";
653
- clientKey: string;
654
- } | undefined;
655
- customCss?: string | undefined;
656
- onSpecUpdate?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodString], null>, z.ZodVoid> | undefined;
657
- onServerChange?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodString], null>, z.ZodVoid> | undefined;
658
- pathRouting?: {
659
- basePath: string;
660
- } | undefined;
661
- generateHeadingSlug?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodObject<{
662
- slug: z.ZodDefault<z.ZodString>;
663
- }, z.core.$strip>], null>, z.ZodString> | undefined;
664
- generateModelSlug?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodObject<{
665
- name: z.ZodDefault<z.ZodString>;
666
- }, z.core.$strip>], null>, z.ZodString> | undefined;
667
- generateTagSlug?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodObject<{
668
- name: z.ZodDefault<z.ZodString>;
669
- }, z.core.$strip>], null>, z.ZodString> | undefined;
670
- generateOperationSlug?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodObject<{
671
- path: z.ZodString;
672
- operationId: z.ZodOptional<z.ZodString>;
673
- method: z.ZodString;
674
- summary: z.ZodOptional<z.ZodString>;
675
- }, z.core.$strip>], null>, z.ZodString> | undefined;
676
- generateWebhookSlug?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodObject<{
677
- name: z.ZodString;
678
- method: z.ZodOptional<z.ZodString>;
679
- }, z.core.$strip>], null>, z.ZodString> | undefined;
680
- redirect?: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodString], null>, z.ZodOptional<z.ZodNullable<z.ZodString>>> | undefined;
681
- tagsSorter?: "alpha" | z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodAny, z.ZodAny], null>, z.ZodNumber> | undefined;
682
- operationsSorter?: "method" | "alpha" | z.core.$InferOuterFunctionType<z.ZodTuple<readonly [z.ZodAny, z.ZodAny], null>, z.ZodNumber> | undefined;
683
- }>>;
684
- /** Configuration after parsing, this is the main type */
685
- export type ApiReferenceConfiguration = Omit<z.infer<typeof _apiReferenceConfigurationSchema>, 'proxy' | 'spec' | 'authentication'> & {
209
+ export declare const apiReferenceConfigurationWithSourceSchema: ZodType<Omit<ApiReferenceConfiguration, 'url' | 'content'> & SourceConfiguration>;
210
+ /**
211
+ * User facing configuration that includes the document source configuration
212
+ */
213
+ export type ApiReferenceConfigurationWithSource = Omit<z.infer<typeof apiReferenceConfigurationWithSourceSchema>, 'proxy' | 'spec' | 'authentication'> & {
686
214
  authentication?: AuthenticationConfiguration;
687
215
  };
688
- /** Api Config which includes the default config */
689
- type ApiReferenceConfigurationWithDefault = ApiReferenceConfiguration & {
216
+ /**
217
+ * When providing an array of configurations we extend with the default attribute
218
+ * which indicates which configuration should be used as the default one
219
+ */
220
+ export type ApiReferenceConfigurationWithDefault = ApiReferenceConfigurationWithSource & {
690
221
  /** Whether to use this config as the default one */
691
222
  default?: boolean;
692
223
  };
693
- /** Configuration for a single config with sources */
694
- export type ApiReferenceConfigurationWithSources = Omit<ApiReferenceConfigurationWithDefault, 'default'> & {
695
- sources: (SpecConfiguration & {
224
+ /**
225
+ * Configuration for a single config with multiple sources
226
+ * The configuration will be shared between the documents
227
+ */
228
+ export type ApiReferenceConfigurationWithMultipleSources = ApiReferenceConfigurationWithSource & {
229
+ sources: (SourceConfiguration & {
696
230
  default?: boolean;
697
231
  })[];
698
232
  };
699
233
  /** Configuration for multiple Api References */
700
- export type AnyApiReferenceConfiguration = Partial<ApiReferenceConfiguration> | Partial<ApiReferenceConfigurationWithSources> | Partial<ApiReferenceConfigurationWithDefault>[] | Partial<ApiReferenceConfigurationWithSources>[];
234
+ export type AnyApiReferenceConfiguration = Partial<ApiReferenceConfigurationWithSource> | Partial<ApiReferenceConfigurationWithMultipleSources> | Partial<ApiReferenceConfigurationWithDefault>[] | Partial<ApiReferenceConfigurationWithMultipleSources>[];
701
235
  /** Typeguard to check to narrow the configs to the one with sources */
702
- export declare const isConfigurationWithSources: (config: AnyApiReferenceConfiguration) => config is Partial<ApiReferenceConfigurationWithSources>;
703
- export {};
236
+ export declare const isConfigurationWithSources: (config: AnyApiReferenceConfiguration) => config is Partial<ApiReferenceConfigurationWithMultipleSources>;
704
237
  //# sourceMappingURL=api-reference-configuration.d.ts.map