@scalar/types 0.0.40 → 0.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @scalar/types
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 39c0f47: chore: export multi doc types
8
+
9
+ ## 0.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 5f9a8a2: feat!: remove the spec prefix, make content and url top-level attributes
14
+
15
+ ## 0.0.41
16
+
17
+ ### Patch Changes
18
+
19
+ - fc6a45e: refactor: use import aliases
20
+
3
21
  ## 0.0.40
4
22
 
5
23
  ### Patch Changes
@@ -1,18 +1,53 @@
1
1
  import { z } from 'zod';
2
2
  /** Configuration for the OpenAPI/Swagger specification */
3
3
  export declare const specConfigurationSchema: z.ZodObject<{
4
- /** URL to an OpenAPI/Swagger document */
4
+ /**
5
+ * URL to an OpenAPI/Swagger document
6
+ *
7
+ * @deprecated Please move `url` to the top level and remove the `spec` prefix.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const oldConfiguration = {
12
+ * spec: {
13
+ * url: 'https://example.com/openapi.json',
14
+ * },
15
+ * }
16
+ *
17
+ * const newConfiguration = {
18
+ * url: 'https://example.com/openapi.json',
19
+ * }
20
+ * ```
21
+ **/
5
22
  url: z.ZodOptional<z.ZodString>;
6
23
  /**
7
24
  * Directly embed the OpenAPI document.
8
25
  * Can be a string, object, function returning an object, or null.
26
+ *
9
27
  * @remarks It's recommended to pass a URL instead of content.
10
- */
28
+ *
29
+ * @deprecated Please move `content` to the top level and remove the `spec` prefix.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const oldConfiguration = {
34
+ * spec: {
35
+ * content: '…',
36
+ * },
37
+ * }
38
+ *
39
+ * const newConfiguration = {
40
+ * content: '…',
41
+ * }
42
+ * ```
43
+ **/
11
44
  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]>>;
12
45
  /**
13
46
  * The title of the OpenAPI document.
14
47
  *
15
48
  * @example 'Scalar Galaxy'
49
+ *
50
+ * @deprecated Please move `title` to the top level and remove the `spec` prefix.
16
51
  */
17
52
  title: z.ZodOptional<z.ZodString>;
18
53
  /**
@@ -23,6 +58,8 @@ export declare const specConfigurationSchema: z.ZodObject<{
23
58
  * If no title is used, it’ll just use the index.
24
59
  *
25
60
  * @example 'scalar-galaxy'
61
+ *
62
+ * @deprecated Please move `slug` to the top level and remove the `spec` prefix.
26
63
  */
27
64
  slug: z.ZodOptional<z.ZodString>;
28
65
  }, "strip", z.ZodTypeAny, {
@@ -39,40 +76,86 @@ export declare const specConfigurationSchema: z.ZodObject<{
39
76
  export type SpecConfiguration = z.infer<typeof specConfigurationSchema>;
40
77
  /** Configuration for the Api Client */
41
78
  export declare const apiClientConfigurationSchema: z.ZodObject<{
42
- /** Prefill authentication */
43
- authentication: z.ZodOptional<z.ZodAny>;
44
- /** Base URL for the API server */
45
- baseServerURL: z.ZodOptional<z.ZodString>;
46
79
  /**
47
- * Whether to hide the client button
48
- * @default false
80
+ * URL to an OpenAPI/Swagger document
81
+ **/
82
+ url: z.ZodOptional<z.ZodString>;
83
+ /**
84
+ * Directly embed the OpenAPI document.
85
+ * Can be a string, object, function returning an object, or null.
86
+ *
87
+ * @remarks It’s recommended to pass a URL instead of content.
88
+ **/
89
+ 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]>>;
90
+ /**
91
+ * The title of the OpenAPI document.
92
+ *
93
+ * @example 'Scalar Galaxy'
49
94
  */
50
- hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
51
- /** URL to a request proxy for the API client */
52
- proxyUrl: z.ZodOptional<z.ZodString>;
53
- /** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */
54
- 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"]>>;
55
- /** List of OpenAPI server objects */
56
- servers: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
95
+ title: z.ZodOptional<z.ZodString>;
57
96
  /**
58
- * Whether to show the sidebar
59
- * @default true
97
+ * The slug of the OpenAPI document used in the URL.
98
+ *
99
+ * If none is passed, the title will be used.
100
+ *
101
+ * If no title is used, it’ll just use the index.
102
+ *
103
+ * @example 'scalar-galaxy'
60
104
  */
61
- showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
62
- /** The Swagger/OpenAPI spec to render */
105
+ slug: z.ZodOptional<z.ZodString>;
106
+ /**
107
+ * The OpenAPI/Swagger document to render
108
+ *
109
+ * @deprecated Use `url` and `content` on the top level instead.
110
+ **/
63
111
  spec: z.ZodOptional<z.ZodObject<{
64
- /** URL to an OpenAPI/Swagger document */
112
+ /**
113
+ * URL to an OpenAPI/Swagger document
114
+ *
115
+ * @deprecated Please move `url` to the top level and remove the `spec` prefix.
116
+ *
117
+ * @example
118
+ * ```ts
119
+ * const oldConfiguration = {
120
+ * spec: {
121
+ * url: 'https://example.com/openapi.json',
122
+ * },
123
+ * }
124
+ *
125
+ * const newConfiguration = {
126
+ * url: 'https://example.com/openapi.json',
127
+ * }
128
+ * ```
129
+ **/
65
130
  url: z.ZodOptional<z.ZodString>;
66
131
  /**
67
132
  * Directly embed the OpenAPI document.
68
133
  * Can be a string, object, function returning an object, or null.
134
+ *
69
135
  * @remarks It's recommended to pass a URL instead of content.
70
- */
136
+ *
137
+ * @deprecated Please move `content` to the top level and remove the `spec` prefix.
138
+ *
139
+ * @example
140
+ * ```ts
141
+ * const oldConfiguration = {
142
+ * spec: {
143
+ * content: '…',
144
+ * },
145
+ * }
146
+ *
147
+ * const newConfiguration = {
148
+ * content: '…',
149
+ * }
150
+ * ```
151
+ **/
71
152
  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]>>;
72
153
  /**
73
154
  * The title of the OpenAPI document.
74
155
  *
75
156
  * @example 'Scalar Galaxy'
157
+ *
158
+ * @deprecated Please move `title` to the top level and remove the `spec` prefix.
76
159
  */
77
160
  title: z.ZodOptional<z.ZodString>;
78
161
  /**
@@ -83,6 +166,8 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
83
166
  * If no title is used, it’ll just use the index.
84
167
  *
85
168
  * @example 'scalar-galaxy'
169
+ *
170
+ * @deprecated Please move `slug` to the top level and remove the `spec` prefix.
86
171
  */
87
172
  slug: z.ZodOptional<z.ZodString>;
88
173
  }, "strip", z.ZodTypeAny, {
@@ -96,6 +181,26 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
96
181
  title?: string | undefined;
97
182
  slug?: string | undefined;
98
183
  }>>;
184
+ /** Prefill authentication */
185
+ authentication: z.ZodOptional<z.ZodAny>;
186
+ /** Base URL for the API server */
187
+ baseServerURL: z.ZodOptional<z.ZodString>;
188
+ /**
189
+ * Whether to hide the client button
190
+ * @default false
191
+ */
192
+ hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
193
+ /** URL to a request proxy for the API client */
194
+ proxyUrl: z.ZodOptional<z.ZodString>;
195
+ /** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */
196
+ 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"]>>;
197
+ /** List of OpenAPI server objects */
198
+ servers: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
199
+ /**
200
+ * Whether to show the sidebar
201
+ * @default true
202
+ */
203
+ showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
99
204
  /** A string to use one of the color presets */
100
205
  theme: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<["alternate", "default", "moon", "purple", "solarized", "bluePlanet", "deepSpace", "saturn", "kepler", "elysiajs", "fastify", "mars", "none"]>>>>;
101
206
  /** Integration type identifier */
@@ -104,19 +209,33 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
104
209
  hideClientButton: boolean;
105
210
  showSidebar: boolean;
106
211
  theme: "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "none";
212
+ url?: string | undefined;
213
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
214
+ title?: string | undefined;
215
+ slug?: string | undefined;
216
+ spec?: {
217
+ url?: string | undefined;
218
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
219
+ title?: string | undefined;
220
+ slug?: string | undefined;
221
+ } | undefined;
107
222
  authentication?: any;
108
223
  baseServerURL?: string | undefined;
109
224
  proxyUrl?: string | undefined;
110
225
  searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
111
226
  servers?: any[] | undefined;
227
+ _integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
228
+ }, {
229
+ url?: string | undefined;
230
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
231
+ title?: string | undefined;
232
+ slug?: string | undefined;
112
233
  spec?: {
113
234
  url?: string | undefined;
114
235
  content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
115
236
  title?: string | undefined;
116
237
  slug?: string | undefined;
117
238
  } | undefined;
118
- _integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
119
- }, {
120
239
  authentication?: any;
121
240
  baseServerURL?: string | undefined;
122
241
  hideClientButton?: unknown;
@@ -124,52 +243,92 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
124
243
  searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
125
244
  servers?: any[] | undefined;
126
245
  showSidebar?: unknown;
127
- spec?: {
128
- url?: string | undefined;
129
- content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
130
- title?: string | undefined;
131
- slug?: string | undefined;
132
- } | undefined;
133
246
  theme?: unknown;
134
247
  _integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
135
248
  }>;
136
249
  export type ApiClientConfiguration = z.infer<typeof apiClientConfigurationSchema>;
137
250
  /** Configuration for the Api Reference */
138
251
  export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
139
- /** Prefill authentication */
140
- authentication: z.ZodOptional<z.ZodAny>;
141
- /** Base URL for the API server */
142
- baseServerURL: z.ZodOptional<z.ZodString>;
143
252
  /**
144
- * Whether to hide the client button
145
- * @default false
253
+ * URL to an OpenAPI/Swagger document
254
+ **/
255
+ url: z.ZodOptional<z.ZodString>;
256
+ /**
257
+ * Directly embed the OpenAPI document.
258
+ * Can be a string, object, function returning an object, or null.
259
+ *
260
+ * @remarks It’s recommended to pass a URL instead of content.
261
+ **/
262
+ 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]>>;
263
+ /**
264
+ * The title of the OpenAPI document.
265
+ *
266
+ * @example 'Scalar Galaxy'
146
267
  */
147
- hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
148
- /** URL to a request proxy for the API client */
149
- proxyUrl: z.ZodOptional<z.ZodString>;
150
- /** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */
151
- 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"]>>;
152
- /** List of OpenAPI server objects */
153
- servers: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
268
+ title: z.ZodOptional<z.ZodString>;
154
269
  /**
155
- * Whether to show the sidebar
156
- * @default true
270
+ * The slug of the OpenAPI document used in the URL.
271
+ *
272
+ * If none is passed, the title will be used.
273
+ *
274
+ * If no title is used, it’ll just use the index.
275
+ *
276
+ * @example 'scalar-galaxy'
157
277
  */
158
- showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
159
- /** The Swagger/OpenAPI spec to render */
278
+ slug: z.ZodOptional<z.ZodString>;
279
+ /**
280
+ * The OpenAPI/Swagger document to render
281
+ *
282
+ * @deprecated Use `url` and `content` on the top level instead.
283
+ **/
160
284
  spec: z.ZodOptional<z.ZodObject<{
161
- /** URL to an OpenAPI/Swagger document */
285
+ /**
286
+ * URL to an OpenAPI/Swagger document
287
+ *
288
+ * @deprecated Please move `url` to the top level and remove the `spec` prefix.
289
+ *
290
+ * @example
291
+ * ```ts
292
+ * const oldConfiguration = {
293
+ * spec: {
294
+ * url: 'https://example.com/openapi.json',
295
+ * },
296
+ * }
297
+ *
298
+ * const newConfiguration = {
299
+ * url: 'https://example.com/openapi.json',
300
+ * }
301
+ * ```
302
+ **/
162
303
  url: z.ZodOptional<z.ZodString>;
163
304
  /**
164
305
  * Directly embed the OpenAPI document.
165
306
  * Can be a string, object, function returning an object, or null.
307
+ *
166
308
  * @remarks It's recommended to pass a URL instead of content.
167
- */
309
+ *
310
+ * @deprecated Please move `content` to the top level and remove the `spec` prefix.
311
+ *
312
+ * @example
313
+ * ```ts
314
+ * const oldConfiguration = {
315
+ * spec: {
316
+ * content: '…',
317
+ * },
318
+ * }
319
+ *
320
+ * const newConfiguration = {
321
+ * content: '…',
322
+ * }
323
+ * ```
324
+ **/
168
325
  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]>>;
169
326
  /**
170
327
  * The title of the OpenAPI document.
171
328
  *
172
329
  * @example 'Scalar Galaxy'
330
+ *
331
+ * @deprecated Please move `title` to the top level and remove the `spec` prefix.
173
332
  */
174
333
  title: z.ZodOptional<z.ZodString>;
175
334
  /**
@@ -180,6 +339,8 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
180
339
  * If no title is used, it’ll just use the index.
181
340
  *
182
341
  * @example 'scalar-galaxy'
342
+ *
343
+ * @deprecated Please move `slug` to the top level and remove the `spec` prefix.
183
344
  */
184
345
  slug: z.ZodOptional<z.ZodString>;
185
346
  }, "strip", z.ZodTypeAny, {
@@ -193,6 +354,26 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
193
354
  title?: string | undefined;
194
355
  slug?: string | undefined;
195
356
  }>>;
357
+ /** Prefill authentication */
358
+ authentication: z.ZodOptional<z.ZodAny>;
359
+ /** Base URL for the API server */
360
+ baseServerURL: z.ZodOptional<z.ZodString>;
361
+ /**
362
+ * Whether to hide the client button
363
+ * @default false
364
+ */
365
+ hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
366
+ /** URL to a request proxy for the API client */
367
+ proxyUrl: z.ZodOptional<z.ZodString>;
368
+ /** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */
369
+ 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"]>>;
370
+ /** List of OpenAPI server objects */
371
+ servers: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
372
+ /**
373
+ * Whether to show the sidebar
374
+ * @default true
375
+ */
376
+ showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
196
377
  /** A string to use one of the color presets */
197
378
  theme: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<["alternate", "default", "moon", "purple", "solarized", "bluePlanet", "deepSpace", "saturn", "kepler", "elysiajs", "fastify", "mars", "none"]>>>>;
198
379
  /** Integration type identifier */
@@ -418,17 +599,21 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
418
599
  hideSearch: boolean;
419
600
  hideDarkModeToggle: boolean;
420
601
  withDefaultFonts: boolean;
421
- authentication?: any;
422
- baseServerURL?: string | undefined;
423
- proxyUrl?: string | undefined;
424
- searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
425
- servers?: any[] | undefined;
602
+ url?: string | undefined;
603
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
604
+ title?: string | undefined;
605
+ slug?: string | undefined;
426
606
  spec?: {
427
607
  url?: string | undefined;
428
608
  content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
429
609
  title?: string | undefined;
430
610
  slug?: string | undefined;
431
611
  } | undefined;
612
+ authentication?: any;
613
+ baseServerURL?: string | undefined;
614
+ proxyUrl?: string | undefined;
615
+ searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
616
+ servers?: any[] | undefined;
432
617
  _integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
433
618
  proxy?: string | undefined;
434
619
  darkMode?: boolean | undefined;
@@ -471,6 +656,16 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
471
656
  tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
472
657
  operationsSorter?: "method" | "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
473
658
  }, {
659
+ url?: string | undefined;
660
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
661
+ title?: string | undefined;
662
+ slug?: string | undefined;
663
+ spec?: {
664
+ url?: string | undefined;
665
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
666
+ title?: string | undefined;
667
+ slug?: string | undefined;
668
+ } | undefined;
474
669
  authentication?: any;
475
670
  baseServerURL?: string | undefined;
476
671
  hideClientButton?: unknown;
@@ -478,12 +673,6 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
478
673
  searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
479
674
  servers?: any[] | undefined;
480
675
  showSidebar?: unknown;
481
- spec?: {
482
- url?: string | undefined;
483
- content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
484
- title?: string | undefined;
485
- slug?: string | undefined;
486
- } | undefined;
487
676
  theme?: unknown;
488
677
  _integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
489
678
  layout?: unknown;
@@ -546,17 +735,21 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
546
735
  hideSearch: boolean;
547
736
  hideDarkModeToggle: boolean;
548
737
  withDefaultFonts: boolean;
549
- authentication?: any;
550
- baseServerURL?: string | undefined;
551
- proxyUrl?: string | undefined;
552
- searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
553
- servers?: any[] | undefined;
738
+ url?: string | undefined;
739
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
740
+ title?: string | undefined;
741
+ slug?: string | undefined;
554
742
  spec?: {
555
743
  url?: string | undefined;
556
744
  content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
557
745
  title?: string | undefined;
558
746
  slug?: string | undefined;
559
747
  } | undefined;
748
+ authentication?: any;
749
+ baseServerURL?: string | undefined;
750
+ proxyUrl?: string | undefined;
751
+ searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
752
+ servers?: any[] | undefined;
560
753
  _integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
561
754
  proxy?: string | undefined;
562
755
  darkMode?: boolean | undefined;
@@ -599,6 +792,16 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
599
792
  tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
600
793
  operationsSorter?: "method" | "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
601
794
  }, {
795
+ url?: string | undefined;
796
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
797
+ title?: string | undefined;
798
+ slug?: string | undefined;
799
+ spec?: {
800
+ url?: string | undefined;
801
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
802
+ title?: string | undefined;
803
+ slug?: string | undefined;
804
+ } | undefined;
602
805
  authentication?: any;
603
806
  baseServerURL?: string | undefined;
604
807
  hideClientButton?: unknown;
@@ -606,12 +809,6 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
606
809
  searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
607
810
  servers?: any[] | undefined;
608
811
  showSidebar?: unknown;
609
- spec?: {
610
- url?: string | undefined;
611
- content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
612
- title?: string | undefined;
613
- slug?: string | undefined;
614
- } | undefined;
615
812
  theme?: unknown;
616
813
  _integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
617
814
  layout?: unknown;
@@ -664,43 +861,89 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
664
861
  operationsSorter?: "method" | "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
665
862
  }>;
666
863
  /** Configuration after parsing, this is the main type */
667
- export type ApiReferenceConfiguration = Omit<z.infer<typeof apiReferenceConfigurationSchema>, 'proxy'>;
864
+ export type ApiReferenceConfiguration = Omit<z.infer<typeof apiReferenceConfigurationSchema>, 'proxy' | 'spec'>;
668
865
  /** Props for the ApiReference components, coming from user input */
669
866
  export declare const apiReferenceConfigurationWithSourcesSchema: z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
670
- /** Prefill authentication */
671
- authentication: z.ZodOptional<z.ZodAny>;
672
- /** Base URL for the API server */
673
- baseServerURL: z.ZodOptional<z.ZodString>;
674
867
  /**
675
- * Whether to hide the client button
676
- * @default false
868
+ * URL to an OpenAPI/Swagger document
869
+ **/
870
+ url: z.ZodOptional<z.ZodString>;
871
+ /**
872
+ * Directly embed the OpenAPI document.
873
+ * Can be a string, object, function returning an object, or null.
874
+ *
875
+ * @remarks It’s recommended to pass a URL instead of content.
876
+ **/
877
+ 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]>>;
878
+ /**
879
+ * The title of the OpenAPI document.
880
+ *
881
+ * @example 'Scalar Galaxy'
677
882
  */
678
- hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
679
- /** URL to a request proxy for the API client */
680
- proxyUrl: z.ZodOptional<z.ZodString>;
681
- /** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */
682
- 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"]>>;
683
- /** List of OpenAPI server objects */
684
- servers: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
883
+ title: z.ZodOptional<z.ZodString>;
685
884
  /**
686
- * Whether to show the sidebar
687
- * @default true
885
+ * The slug of the OpenAPI document used in the URL.
886
+ *
887
+ * If none is passed, the title will be used.
888
+ *
889
+ * If no title is used, it’ll just use the index.
890
+ *
891
+ * @example 'scalar-galaxy'
688
892
  */
689
- showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
690
- /** The Swagger/OpenAPI spec to render */
893
+ slug: z.ZodOptional<z.ZodString>;
894
+ /**
895
+ * The OpenAPI/Swagger document to render
896
+ *
897
+ * @deprecated Use `url` and `content` on the top level instead.
898
+ **/
691
899
  spec: z.ZodOptional<z.ZodObject<{
692
- /** URL to an OpenAPI/Swagger document */
900
+ /**
901
+ * URL to an OpenAPI/Swagger document
902
+ *
903
+ * @deprecated Please move `url` to the top level and remove the `spec` prefix.
904
+ *
905
+ * @example
906
+ * ```ts
907
+ * const oldConfiguration = {
908
+ * spec: {
909
+ * url: 'https://example.com/openapi.json',
910
+ * },
911
+ * }
912
+ *
913
+ * const newConfiguration = {
914
+ * url: 'https://example.com/openapi.json',
915
+ * }
916
+ * ```
917
+ **/
693
918
  url: z.ZodOptional<z.ZodString>;
694
919
  /**
695
920
  * Directly embed the OpenAPI document.
696
921
  * Can be a string, object, function returning an object, or null.
922
+ *
697
923
  * @remarks It's recommended to pass a URL instead of content.
698
- */
924
+ *
925
+ * @deprecated Please move `content` to the top level and remove the `spec` prefix.
926
+ *
927
+ * @example
928
+ * ```ts
929
+ * const oldConfiguration = {
930
+ * spec: {
931
+ * content: '…',
932
+ * },
933
+ * }
934
+ *
935
+ * const newConfiguration = {
936
+ * content: '…',
937
+ * }
938
+ * ```
939
+ **/
699
940
  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]>>;
700
941
  /**
701
942
  * The title of the OpenAPI document.
702
943
  *
703
944
  * @example 'Scalar Galaxy'
945
+ *
946
+ * @deprecated Please move `title` to the top level and remove the `spec` prefix.
704
947
  */
705
948
  title: z.ZodOptional<z.ZodString>;
706
949
  /**
@@ -711,6 +954,8 @@ export declare const apiReferenceConfigurationWithSourcesSchema: z.ZodEffects<z.
711
954
  * If no title is used, it’ll just use the index.
712
955
  *
713
956
  * @example 'scalar-galaxy'
957
+ *
958
+ * @deprecated Please move `slug` to the top level and remove the `spec` prefix.
714
959
  */
715
960
  slug: z.ZodOptional<z.ZodString>;
716
961
  }, "strip", z.ZodTypeAny, {
@@ -724,6 +969,26 @@ export declare const apiReferenceConfigurationWithSourcesSchema: z.ZodEffects<z.
724
969
  title?: string | undefined;
725
970
  slug?: string | undefined;
726
971
  }>>;
972
+ /** Prefill authentication */
973
+ authentication: z.ZodOptional<z.ZodAny>;
974
+ /** Base URL for the API server */
975
+ baseServerURL: z.ZodOptional<z.ZodString>;
976
+ /**
977
+ * Whether to hide the client button
978
+ * @default false
979
+ */
980
+ hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
981
+ /** URL to a request proxy for the API client */
982
+ proxyUrl: z.ZodOptional<z.ZodString>;
983
+ /** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */
984
+ 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"]>>;
985
+ /** List of OpenAPI server objects */
986
+ servers: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
987
+ /**
988
+ * Whether to show the sidebar
989
+ * @default true
990
+ */
991
+ showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
727
992
  /** A string to use one of the color presets */
728
993
  theme: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<["alternate", "default", "moon", "purple", "solarized", "bluePlanet", "deepSpace", "saturn", "kepler", "elysiajs", "fastify", "mars", "none"]>>>>;
729
994
  /** Integration type identifier */
@@ -938,69 +1203,82 @@ export declare const apiReferenceConfigurationWithSourcesSchema: z.ZodEffects<z.
938
1203
  */
939
1204
  operationsSorter: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"alpha">, z.ZodLiteral<"method">, z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodAny], z.ZodUnknown>, z.ZodNumber>]>>;
940
1205
  }>, {
941
- spec: z.ZodObject<{
942
- sources: z.ZodArray<z.ZodObject<{
943
- /** URL to an OpenAPI/Swagger document */
944
- url: z.ZodOptional<z.ZodString>;
945
- /**
946
- * Directly embed the OpenAPI document.
947
- * Can be a string, object, function returning an object, or null.
948
- * @remarks It's recommended to pass a URL instead of content.
949
- */
950
- 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]>>;
951
- /**
952
- * The title of the OpenAPI document.
953
- *
954
- * @example 'Scalar Galaxy'
955
- */
956
- title: z.ZodOptional<z.ZodString>;
957
- /**
958
- * The slug of the OpenAPI document used in the URL.
959
- *
960
- * If none is passed, the title will be used.
961
- *
962
- * If no title is used, it’ll just use the index.
963
- *
964
- * @example 'scalar-galaxy'
965
- */
966
- slug: z.ZodOptional<z.ZodString>;
967
- }, "strip", z.ZodTypeAny, {
968
- url?: string | undefined;
969
- content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
970
- title?: string | undefined;
971
- slug?: string | undefined;
972
- }, {
973
- url?: string | undefined;
974
- content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
975
- title?: string | undefined;
976
- slug?: string | undefined;
977
- }>, "many">;
1206
+ sources: z.ZodArray<z.ZodObject<{
1207
+ /**
1208
+ * URL to an OpenAPI/Swagger document
1209
+ *
1210
+ * @deprecated Please move `url` to the top level and remove the `spec` prefix.
1211
+ *
1212
+ * @example
1213
+ * ```ts
1214
+ * const oldConfiguration = {
1215
+ * spec: {
1216
+ * url: 'https://example.com/openapi.json',
1217
+ * },
1218
+ * }
1219
+ *
1220
+ * const newConfiguration = {
1221
+ * url: 'https://example.com/openapi.json',
1222
+ * }
1223
+ * ```
1224
+ **/
1225
+ url: z.ZodOptional<z.ZodString>;
1226
+ /**
1227
+ * Directly embed the OpenAPI document.
1228
+ * Can be a string, object, function returning an object, or null.
1229
+ *
1230
+ * @remarks It's recommended to pass a URL instead of content.
1231
+ *
1232
+ * @deprecated Please move `content` to the top level and remove the `spec` prefix.
1233
+ *
1234
+ * @example
1235
+ * ```ts
1236
+ * const oldConfiguration = {
1237
+ * spec: {
1238
+ * content: '…',
1239
+ * },
1240
+ * }
1241
+ *
1242
+ * const newConfiguration = {
1243
+ * content: '…',
1244
+ * }
1245
+ * ```
1246
+ **/
1247
+ 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]>>;
1248
+ /**
1249
+ * The title of the OpenAPI document.
1250
+ *
1251
+ * @example 'Scalar Galaxy'
1252
+ *
1253
+ * @deprecated Please move `title` to the top level and remove the `spec` prefix.
1254
+ */
1255
+ title: z.ZodOptional<z.ZodString>;
1256
+ /**
1257
+ * The slug of the OpenAPI document used in the URL.
1258
+ *
1259
+ * If none is passed, the title will be used.
1260
+ *
1261
+ * If no title is used, it’ll just use the index.
1262
+ *
1263
+ * @example 'scalar-galaxy'
1264
+ *
1265
+ * @deprecated Please move `slug` to the top level and remove the `spec` prefix.
1266
+ */
1267
+ slug: z.ZodOptional<z.ZodString>;
978
1268
  }, "strip", z.ZodTypeAny, {
979
- sources: {
980
- url?: string | undefined;
981
- content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
982
- title?: string | undefined;
983
- slug?: string | undefined;
984
- }[];
1269
+ url?: string | undefined;
1270
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1271
+ title?: string | undefined;
1272
+ slug?: string | undefined;
985
1273
  }, {
986
- sources: {
987
- url?: string | undefined;
988
- content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
989
- title?: string | undefined;
990
- slug?: string | undefined;
991
- }[];
992
- }>;
1274
+ url?: string | undefined;
1275
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1276
+ title?: string | undefined;
1277
+ slug?: string | undefined;
1278
+ }>, "many">;
993
1279
  }>, "strip", z.ZodTypeAny, {
994
1280
  hideClientButton: boolean;
995
1281
  showSidebar: boolean;
996
- spec: {
997
- sources: {
998
- url?: string | undefined;
999
- content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1000
- title?: string | undefined;
1001
- slug?: string | undefined;
1002
- }[];
1003
- };
1004
1282
  theme: "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "none";
1005
1283
  layout: "modern" | "classic";
1006
1284
  isEditable: boolean;
@@ -1010,6 +1288,22 @@ export declare const apiReferenceConfigurationWithSourcesSchema: z.ZodEffects<z.
1010
1288
  hideSearch: boolean;
1011
1289
  hideDarkModeToggle: boolean;
1012
1290
  withDefaultFonts: boolean;
1291
+ sources: {
1292
+ url?: string | undefined;
1293
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1294
+ title?: string | undefined;
1295
+ slug?: string | undefined;
1296
+ }[];
1297
+ url?: string | undefined;
1298
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1299
+ title?: string | undefined;
1300
+ slug?: string | undefined;
1301
+ spec?: {
1302
+ url?: string | undefined;
1303
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1304
+ title?: string | undefined;
1305
+ slug?: string | undefined;
1306
+ } | undefined;
1013
1307
  authentication?: any;
1014
1308
  baseServerURL?: string | undefined;
1015
1309
  proxyUrl?: string | undefined;
@@ -1057,14 +1351,22 @@ export declare const apiReferenceConfigurationWithSourcesSchema: z.ZodEffects<z.
1057
1351
  tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
1058
1352
  operationsSorter?: "method" | "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
1059
1353
  }, {
1060
- spec: {
1061
- sources: {
1062
- url?: string | undefined;
1063
- content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1064
- title?: string | undefined;
1065
- slug?: string | undefined;
1066
- }[];
1067
- };
1354
+ sources: {
1355
+ url?: string | undefined;
1356
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1357
+ title?: string | undefined;
1358
+ slug?: string | undefined;
1359
+ }[];
1360
+ url?: string | undefined;
1361
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1362
+ title?: string | undefined;
1363
+ slug?: string | undefined;
1364
+ spec?: {
1365
+ url?: string | undefined;
1366
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1367
+ title?: string | undefined;
1368
+ slug?: string | undefined;
1369
+ } | undefined;
1068
1370
  authentication?: any;
1069
1371
  baseServerURL?: string | undefined;
1070
1372
  hideClientButton?: unknown;
@@ -1125,14 +1427,6 @@ export declare const apiReferenceConfigurationWithSourcesSchema: z.ZodEffects<z.
1125
1427
  }>, {
1126
1428
  hideClientButton: boolean;
1127
1429
  showSidebar: boolean;
1128
- spec: {
1129
- sources: {
1130
- url?: string | undefined;
1131
- content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1132
- title?: string | undefined;
1133
- slug?: string | undefined;
1134
- }[];
1135
- };
1136
1430
  theme: "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "none";
1137
1431
  layout: "modern" | "classic";
1138
1432
  isEditable: boolean;
@@ -1142,6 +1436,22 @@ export declare const apiReferenceConfigurationWithSourcesSchema: z.ZodEffects<z.
1142
1436
  hideSearch: boolean;
1143
1437
  hideDarkModeToggle: boolean;
1144
1438
  withDefaultFonts: boolean;
1439
+ sources: {
1440
+ url?: string | undefined;
1441
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1442
+ title?: string | undefined;
1443
+ slug?: string | undefined;
1444
+ }[];
1445
+ url?: string | undefined;
1446
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1447
+ title?: string | undefined;
1448
+ slug?: string | undefined;
1449
+ spec?: {
1450
+ url?: string | undefined;
1451
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1452
+ title?: string | undefined;
1453
+ slug?: string | undefined;
1454
+ } | undefined;
1145
1455
  authentication?: any;
1146
1456
  baseServerURL?: string | undefined;
1147
1457
  proxyUrl?: string | undefined;
@@ -1189,14 +1499,22 @@ export declare const apiReferenceConfigurationWithSourcesSchema: z.ZodEffects<z.
1189
1499
  tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
1190
1500
  operationsSorter?: "method" | "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
1191
1501
  }, {
1192
- spec: {
1193
- sources: {
1194
- url?: string | undefined;
1195
- content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1196
- title?: string | undefined;
1197
- slug?: string | undefined;
1198
- }[];
1199
- };
1502
+ sources: {
1503
+ url?: string | undefined;
1504
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1505
+ title?: string | undefined;
1506
+ slug?: string | undefined;
1507
+ }[];
1508
+ url?: string | undefined;
1509
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1510
+ title?: string | undefined;
1511
+ slug?: string | undefined;
1512
+ spec?: {
1513
+ url?: string | undefined;
1514
+ content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
1515
+ title?: string | undefined;
1516
+ slug?: string | undefined;
1517
+ } | undefined;
1200
1518
  authentication?: any;
1201
1519
  baseServerURL?: string | undefined;
1202
1520
  hideClientButton?: unknown;
@@ -1255,7 +1573,9 @@ export declare const apiReferenceConfigurationWithSourcesSchema: z.ZodEffects<z.
1255
1573
  tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
1256
1574
  operationsSorter?: "method" | "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
1257
1575
  }>;
1258
- export type ApiReferenceConfigurationWithSources = Omit<z.infer<typeof apiReferenceConfigurationWithSourcesSchema>, 'proxy'>;
1576
+ export type ApiReferenceConfigurationWithSources = Omit<z.infer<typeof apiReferenceConfigurationWithSourcesSchema>, 'proxy' | 'spec'>;
1577
+ /** Configuration for multiple Api References */
1578
+ export type MultiReferenceConfiguration = Partial<ApiReferenceConfiguration> | Partial<ApiReferenceConfiguration>[] | Partial<ApiReferenceConfigurationWithSources>;
1259
1579
  /** Typeguard to check to narrow the configs to the one with sources */
1260
- export declare const isConfigurationWithSources: (config: Partial<ApiReferenceConfiguration> | Partial<ApiReferenceConfiguration>[] | Partial<ApiReferenceConfigurationWithSources>) => config is Partial<ApiReferenceConfigurationWithSources>;
1580
+ export declare const isConfigurationWithSources: (config: MultiReferenceConfiguration) => config is Partial<ApiReferenceConfigurationWithSources>;
1261
1581
  //# sourceMappingURL=api-reference-configuration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-reference-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA8EvB,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB;IAClC,yCAAyC;;IAEzC;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;;;;;OAQG;;;;;;;;;;;;EAEH,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAQvE,uCAAuC;AACvC,eAAO,MAAM,4BAA4B;IACvC,6BAA6B;;IAE7B,kCAAkC;;IAElC;;;OAGG;;IAEH,gDAAgD;;IAEhD,mFAAmF;;IAEnF,qCAAqC;;IAErC;;;OAGG;;IAEH,yCAAyC;;QAvDzC,yCAAyC;;QAEzC;;;;WAIG;;QAEH;;;;WAIG;;QAEH;;;;;;;;WAQG;;;;;;;;;;;;;IAmCH,+CAA+C;;IAE/C,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAElC,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AA0PjF,0CAA0C;AAC1C,eAAO,MAAM,+BAA+B;IAvR1C,6BAA6B;;IAE7B,kCAAkC;;IAElC;;;OAGG;;IAEH,gDAAgD;;IAEhD,mFAAmF;;IAEnF,qCAAqC;;IAErC;;;OAGG;;IAEH,yCAAyC;;QAvDzC,yCAAyC;;QAEzC;;;;WAIG;;QAEH;;;;WAIG;;QAEH;;;;;;;;WAQG;;;;;;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;;;;;;;;;;;;;;;;YAiBI;;QAEJ;;;;;;;;;;;;;;;;;;;;YAoBI;;QAEJ;;;;;;WAMG;;QAEH;;;;;;;;;;WAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+VwE,CAAA;AAC7E,MAAM,MAAM,oCAAoC,GAAG,IAAI,CACrD,CAAC,CAAC,KAAK,CAAC,OAAO,0CAA0C,CAAC,EAE1D,OAAO,GAAG,MAAM,CACjB,CAAA;AAED,gDAAgD;AAChD,MAAM,MAAM,2BAA2B,GACnC,OAAO,CAAC,yBAAyB,CAAC,GAClC,OAAO,CAAC,yBAAyB,CAAC,EAAE,GACpC,OAAO,CAAC,oCAAoC,CAAC,CAAA;AAEjD,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,WAC7B,2BAA2B,KAClC,MAAM,IAAI,OAAO,CAAC,oCAAoC,CAC0C,CAAA"}
@@ -73,18 +73,53 @@ const integrationEnum = z
73
73
  .nullable();
74
74
  /** Configuration for the OpenAPI/Swagger specification */
75
75
  const specConfigurationSchema = z.object({
76
- /** URL to an OpenAPI/Swagger document */
76
+ /**
77
+ * URL to an OpenAPI/Swagger document
78
+ *
79
+ * @deprecated Please move `url` to the top level and remove the `spec` prefix.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * const oldConfiguration = {
84
+ * spec: {
85
+ * url: 'https://example.com/openapi.json',
86
+ * },
87
+ * }
88
+ *
89
+ * const newConfiguration = {
90
+ * url: 'https://example.com/openapi.json',
91
+ * }
92
+ * ```
93
+ **/
77
94
  url: z.string().optional(),
78
95
  /**
79
96
  * Directly embed the OpenAPI document.
80
97
  * Can be a string, object, function returning an object, or null.
98
+ *
81
99
  * @remarks It's recommended to pass a URL instead of content.
82
- */
100
+ *
101
+ * @deprecated Please move `content` to the top level and remove the `spec` prefix.
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * const oldConfiguration = {
106
+ * spec: {
107
+ * content: '…',
108
+ * },
109
+ * }
110
+ *
111
+ * const newConfiguration = {
112
+ * content: '…',
113
+ * }
114
+ * ```
115
+ **/
83
116
  content: z.union([z.string(), z.record(z.any()), z.function().returns(z.record(z.any())), z.null()]).optional(),
84
117
  /**
85
118
  * The title of the OpenAPI document.
86
119
  *
87
120
  * @example 'Scalar Galaxy'
121
+ *
122
+ * @deprecated Please move `title` to the top level and remove the `spec` prefix.
88
123
  */
89
124
  title: z.string().optional(),
90
125
  /**
@@ -95,6 +130,8 @@ const specConfigurationSchema = z.object({
95
130
  * If no title is used, it’ll just use the index.
96
131
  *
97
132
  * @example 'scalar-galaxy'
133
+ *
134
+ * @deprecated Please move `slug` to the top level and remove the `spec` prefix.
98
135
  */
99
136
  slug: z.string().optional(),
100
137
  });
@@ -105,6 +142,39 @@ const pathRoutingSchema = z.object({
105
142
  });
106
143
  /** Configuration for the Api Client */
107
144
  const apiClientConfigurationSchema = z.object({
145
+ /**
146
+ * URL to an OpenAPI/Swagger document
147
+ **/
148
+ url: z.string().optional(),
149
+ /**
150
+ * Directly embed the OpenAPI document.
151
+ * Can be a string, object, function returning an object, or null.
152
+ *
153
+ * @remarks It’s recommended to pass a URL instead of content.
154
+ **/
155
+ content: z.union([z.string(), z.record(z.any()), z.function().returns(z.record(z.any())), z.null()]).optional(),
156
+ /**
157
+ * The title of the OpenAPI document.
158
+ *
159
+ * @example 'Scalar Galaxy'
160
+ */
161
+ title: z.string().optional(),
162
+ /**
163
+ * The slug of the OpenAPI document used in the URL.
164
+ *
165
+ * If none is passed, the title will be used.
166
+ *
167
+ * If no title is used, it’ll just use the index.
168
+ *
169
+ * @example 'scalar-galaxy'
170
+ */
171
+ slug: z.string().optional(),
172
+ /**
173
+ * The OpenAPI/Swagger document to render
174
+ *
175
+ * @deprecated Use `url` and `content` on the top level instead.
176
+ **/
177
+ spec: specConfigurationSchema.optional(),
108
178
  /** Prefill authentication */
109
179
  authentication: z.any().optional(), // Temp until we bring in the new auth
110
180
  /** Base URL for the API server */
@@ -125,8 +195,6 @@ const apiClientConfigurationSchema = z.object({
125
195
  * @default true
126
196
  */
127
197
  showSidebar: z.boolean().optional().default(true).catch(true),
128
- /** The Swagger/OpenAPI spec to render */
129
- spec: specConfigurationSchema.optional(),
130
198
  /** A string to use one of the color presets */
131
199
  theme: themeIdEnum.optional().default('default').catch('default'),
132
200
  /** Integration type identifier */
@@ -326,13 +394,22 @@ const _apiReferenceConfigurationSchema = apiClientConfigurationSchema.merge(z.ob
326
394
  }));
327
395
  /** Configuration for the Api Reference with sources before transforming */
328
396
  const _apiReferenceConfigurationWithSourcesSchema = _apiReferenceConfigurationSchema.merge(z.object({
329
- spec: z.object({
330
- sources: z.array(specConfigurationSchema),
331
- }),
397
+ sources: z.array(specConfigurationSchema),
332
398
  }));
333
399
  /** Migrate the configuration through a transform */
334
400
  const migrateConfiguration = (_configuration) => {
335
401
  const configuration = { ..._configuration };
402
+ // Remove the spec prefix
403
+ if (configuration.spec?.url) {
404
+ console.warn(`[DEPRECATED] You’re using the deprecated 'spec.url' attribute. Remove the spec prefix and move the 'url' attribute to the top level.`);
405
+ configuration.url = configuration.spec.url;
406
+ delete configuration.spec;
407
+ }
408
+ if (configuration.spec?.content) {
409
+ console.warn(`[DEPRECATED] You’re using the deprecated 'spec.content' attribute. Remove the spec prefix and move the 'content' attribute to the top level.`);
410
+ configuration.content = configuration.spec.content;
411
+ delete configuration.spec;
412
+ }
336
413
  // Migrate legacy theme variables
337
414
  if (configuration.customCss) {
338
415
  configuration.customCss = migrateThemeVariables(configuration.customCss);
@@ -358,6 +435,6 @@ const apiReferenceConfigurationSchema = _apiReferenceConfigurationSchema.transfo
358
435
  /** Props for the ApiReference components, coming from user input */
359
436
  const apiReferenceConfigurationWithSourcesSchema = _apiReferenceConfigurationWithSourcesSchema.transform(migrateConfiguration);
360
437
  /** Typeguard to check to narrow the configs to the one with sources */
361
- const isConfigurationWithSources = (config) => Boolean(!Array.isArray(config) && config.spec && 'sources' in config.spec && Array.isArray(config.spec.sources));
438
+ const isConfigurationWithSources = (config) => Boolean(!Array.isArray(config) && config && 'sources' in config && Array.isArray(config.sources));
362
439
 
363
440
  export { apiClientConfigurationSchema, apiReferenceConfigurationSchema, apiReferenceConfigurationWithSourcesSchema, isConfigurationWithSources, specConfigurationSchema };
@@ -1,4 +1,4 @@
1
- import type { ApiReferenceConfiguration } from '../api-reference/api-reference-configuration.ts';
1
+ import type { ApiReferenceConfigurationWithSources } from '../api-reference/api-reference-configuration.ts';
2
2
  import { z } from 'zod';
3
3
  /**
4
4
  * Zod schema for HTML rendering configuration
@@ -30,5 +30,5 @@ export declare const htmlRenderingConfigurationSchema: z.ZodObject<{
30
30
  *
31
31
  * It’s the ApiReferenceConfiguration, but extended with the `pageTitle` and `cdn` options.
32
32
  */
33
- export type HtmlRenderingConfiguration = ApiReferenceConfiguration & z.infer<typeof htmlRenderingConfigurationSchema>;
33
+ export type HtmlRenderingConfiguration = Partial<ApiReferenceConfigurationWithSources> & z.infer<typeof htmlRenderingConfigurationSchema>;
34
34
  //# sourceMappingURL=html-rendering-configuration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"html-rendering-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/html-rendering-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAA;AAC/F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;GAEG;AACH,eAAO,MAAM,gCAAgC;IAC3C;;;;;;;;OAQG;;IAEH;;OAEG;;;;;;;;EAEH,CAAA;AAEF;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAA"}
1
+ {"version":3,"file":"html-rendering-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/html-rendering-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,gDAAgD,CAAA;AAC1G,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;GAEG;AACH,eAAO,MAAM,gCAAgC;IAC3C;;;;;;;;OAQG;;IAEH;;OAEG;;;;;;;;EAEH,CAAA;AAEF;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,oCAAoC,CAAC,GACpF,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAA"}
@@ -1,4 +1,4 @@
1
- export { type ApiClientConfiguration, type ApiReferenceConfiguration, type ApiReferenceConfigurationWithSources, type SpecConfiguration, apiClientConfigurationSchema, apiReferenceConfigurationSchema, apiReferenceConfigurationWithSourcesSchema, specConfigurationSchema, isConfigurationWithSources, } from './api-reference-configuration.ts';
1
+ export { type ApiClientConfiguration, type ApiReferenceConfiguration, type ApiReferenceConfigurationWithSources, type MultiReferenceConfiguration, type SpecConfiguration, apiClientConfigurationSchema, apiReferenceConfigurationSchema, apiReferenceConfigurationWithSourcesSchema, specConfigurationSchema, isConfigurationWithSources, } from './api-reference-configuration.ts';
2
2
  export { type HtmlRenderingConfiguration, htmlRenderingConfigurationSchema, } from './html-rendering-configuration.ts';
3
3
  export { migrateThemeVariables } from './helpers/migrate-theme-variables.ts';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api-reference/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,oCAAoC,EACzC,KAAK,iBAAiB,EACtB,4BAA4B,EAC5B,+BAA+B,EAC/B,0CAA0C,EAC1C,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EACL,KAAK,0BAA0B,EAC/B,gCAAgC,GACjC,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api-reference/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,oCAAoC,EACzC,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,4BAA4B,EAC5B,+BAA+B,EAC/B,0CAA0C,EAC1C,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EACL,KAAK,0BAA0B,EAC/B,gCAAgC,GACjC,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA"}
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "scalar",
17
17
  "references"
18
18
  ],
19
- "version": "0.0.40",
19
+ "version": "0.1.1",
20
20
  "engines": {
21
21
  "node": ">=18"
22
22
  },
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=api-reference-configuration.test-d.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api-reference-configuration.test-d.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-configuration.test-d.ts"],"names":[],"mappings":""}