@scalar/types 0.3.2 → 0.5.0

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 (53) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/api-reference/api-client-configuration.d.ts +7 -0
  3. package/dist/api-reference/api-client-configuration.d.ts.map +1 -1
  4. package/dist/api-reference/api-reference-configuration.d.ts +28 -19
  5. package/dist/api-reference/api-reference-configuration.d.ts.map +1 -1
  6. package/dist/api-reference/api-reference-configuration.js +7 -6
  7. package/dist/api-reference/api-reference-configuration.js.map +2 -2
  8. package/dist/api-reference/api-reference-plugin.d.ts +15 -1
  9. package/dist/api-reference/api-reference-plugin.d.ts.map +1 -1
  10. package/dist/api-reference/api-reference-plugin.js +26 -3
  11. package/dist/api-reference/api-reference-plugin.js.map +2 -2
  12. package/dist/api-reference/authentication-configuration.test-d.js.map +2 -2
  13. package/dist/api-reference/base-configuration.d.ts +6 -0
  14. package/dist/api-reference/base-configuration.d.ts.map +1 -1
  15. package/dist/api-reference/base-configuration.js +8 -0
  16. package/dist/api-reference/base-configuration.js.map +2 -2
  17. package/dist/api-reference/index.d.ts +2 -2
  18. package/dist/api-reference/index.d.ts.map +1 -1
  19. package/dist/api-reference/index.js.map +2 -2
  20. package/dist/api-reference/source-configuration.d.ts +1 -0
  21. package/dist/api-reference/source-configuration.d.ts.map +1 -1
  22. package/dist/api-reference/source-configuration.js +1 -0
  23. package/dist/api-reference/source-configuration.js.map +2 -2
  24. package/dist/entities/index.d.ts +1 -0
  25. package/dist/entities/index.d.ts.map +1 -1
  26. package/dist/entities/index.js.map +2 -2
  27. package/dist/entities/security-scheme.d.ts +8 -9
  28. package/dist/entities/security-scheme.d.ts.map +1 -1
  29. package/dist/entities/security-scheme.js +0 -1
  30. package/dist/entities/security-scheme.js.map +2 -2
  31. package/dist/index.d.ts +5 -2
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +4 -1
  34. package/dist/index.js.map +2 -2
  35. package/dist/legacy/index.d.ts +3 -1
  36. package/dist/legacy/index.d.ts.map +1 -1
  37. package/dist/legacy/index.js +4 -1
  38. package/dist/legacy/index.js.map +2 -2
  39. package/dist/legacy/reference-config.d.ts +1 -211
  40. package/dist/legacy/reference-config.d.ts.map +1 -1
  41. package/dist/legacy/reference-config.js.map +2 -2
  42. package/dist/snippetz/index.d.ts +3 -1
  43. package/dist/snippetz/index.d.ts.map +1 -1
  44. package/dist/snippetz/index.js +4 -1
  45. package/dist/snippetz/index.js.map +2 -2
  46. package/dist/utils/index.d.ts +3 -1
  47. package/dist/utils/index.d.ts.map +1 -1
  48. package/dist/utils/index.js.map +2 -2
  49. package/dist/utils/nanoid.d.ts +1 -1
  50. package/dist/utils/nanoid.d.ts.map +1 -1
  51. package/dist/utils/nanoid.js +1 -1
  52. package/dist/utils/nanoid.js.map +2 -2
  53. package/package.json +4 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @scalar/types
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#7373](https://github.com/scalar/scalar/pull/7373) [`cbedfab`](https://github.com/scalar/scalar/commit/cbedfab576502069be27ceacbea145a917214e47) Thanks [@marcalexiei](https://github.com/marcalexiei)! - feat(types): legacy - remove unused types
8
+
9
+ - [#7373](https://github.com/scalar/scalar/pull/7373) [`cbedfab`](https://github.com/scalar/scalar/commit/cbedfab576502069be27ceacbea145a917214e47) Thanks [@marcalexiei](https://github.com/marcalexiei)! - feat(types): removes `export *` from non-index exports
10
+
11
+ ### Patch Changes
12
+
13
+ - [#7320](https://github.com/scalar/scalar/pull/7320) [`44aeef0`](https://github.com/scalar/scalar/commit/44aeef01073801165e339163462378b7b62ff68d) Thanks [@hanspagel](https://github.com/hanspagel)! - feat: rename showToolbar to showDeveloperTools
14
+
15
+ ## 0.4.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#7129](https://github.com/scalar/scalar/pull/7129) [`6ec8c29`](https://github.com/scalar/scalar/commit/6ec8c299d912111b029e8058979d00968b70691a) Thanks [@geoffgscott](https://github.com/geoffgscott)! - Simplify ApiReferences state management and migrate to new shared sidebar component. Eliminates the useSidebar and useNav hooks in favour of event bubbling and centralized state management in ApiReference.vue
20
+
21
+ ### Patch Changes
22
+
23
+ - [#7086](https://github.com/scalar/scalar/pull/7086) [`eb022f2`](https://github.com/scalar/scalar/commit/eb022f2c8f93c84a04c0093fefe8a1e05d6ec80d) Thanks [@hanspagel](https://github.com/hanspagel)! - feat: new `content.end` slot for the plugin API
24
+
25
+ - [#7094](https://github.com/scalar/scalar/pull/7094) [`eba18d0`](https://github.com/scalar/scalar/commit/eba18d06267a163a8f91396a66f817100ee59461) Thanks [@geoffgscott](https://github.com/geoffgscott)! - Migrate to workspace store as primary source of truth.
26
+
27
+ - Updated dependencies [[`2239843`](https://github.com/scalar/scalar/commit/2239843150ed16d1ca35b0b1f8e90cd3e35be7ce)]:
28
+ - @scalar/openapi-types@0.5.1
29
+
3
30
  ## 0.3.2
4
31
 
5
32
  ### Patch Changes
@@ -34,6 +34,11 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
34
34
  }>>;
35
35
  servers: z.ZodOptional<z.ZodArray<z.ZodAny>>;
36
36
  showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
37
+ showDeveloperTools: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
38
+ never: "never";
39
+ always: "always";
40
+ localhost: "localhost";
41
+ }>>>>;
37
42
  showToolbar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
38
43
  never: "never";
39
44
  always: "always";
@@ -63,6 +68,7 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
63
68
  elysiajs: "elysiajs";
64
69
  fastify: "fastify";
65
70
  adonisjs: "adonisjs";
71
+ astro: "astro";
66
72
  docusaurus: "docusaurus";
67
73
  dotnet: "dotnet";
68
74
  express: "express";
@@ -109,6 +115,7 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
109
115
  }, z.core.$strip>>;
110
116
  }, z.core.$strip>>>>;
111
117
  telemetry: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
118
+ default: z.ZodCatch<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
112
119
  url: z.ZodOptional<z.ZodString>;
113
120
  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>>]>>;
114
121
  title: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"api-client-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-client-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAKxB,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAkE,CAAA;AAE3G,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
1
+ {"version":3,"file":"api-client-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-client-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAKxB,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAkE,CAAA;AAE3G,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
@@ -48,6 +48,11 @@ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
48
48
  }>>;
49
49
  servers: z.ZodOptional<z.ZodArray<z.ZodAny>>;
50
50
  showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
51
+ showDeveloperTools: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
52
+ never: "never";
53
+ always: "always";
54
+ localhost: "localhost";
55
+ }>>>>;
51
56
  showToolbar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
52
57
  never: "never";
53
58
  always: "always";
@@ -77,6 +82,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
77
82
  elysiajs: "elysiajs";
78
83
  fastify: "fastify";
79
84
  adonisjs: "adonisjs";
85
+ astro: "astro";
80
86
  docusaurus: "docusaurus";
81
87
  dotnet: "dotnet";
82
88
  express: "express";
@@ -112,6 +118,13 @@ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
112
118
  component: z.ZodUnknown;
113
119
  renderer: z.ZodOptional<z.ZodUnknown>;
114
120
  }, z.core.$strip>>;
121
+ views: z.ZodOptional<z.ZodObject<{
122
+ 'content.end': z.ZodOptional<z.ZodArray<z.ZodObject<{
123
+ component: z.ZodUnknown;
124
+ renderer: z.ZodOptional<z.ZodUnknown>;
125
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
126
+ }, z.core.$strip>>>;
127
+ }, z.core.$strip>>;
115
128
  }, z.core.$strip>>>>;
116
129
  isEditable: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
117
130
  isLoading: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
@@ -144,7 +157,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
144
157
  onSpecUpdate: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.ZodVoid>>;
145
158
  onServerChange: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.ZodVoid>>;
146
159
  onDocumentSelect: z.ZodType<(() => Promise<void> | void) | undefined>;
147
- onLoaded: z.ZodType<(() => Promise<void> | void) | undefined>;
160
+ onLoaded: z.ZodType<((slug: string) => Promise<void> | void) | undefined>;
148
161
  onBeforeRequest: z.ZodType<((a: {
149
162
  request: Request;
150
163
  }) => Promise<void> | void) | undefined>;
@@ -182,17 +195,23 @@ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
182
195
  orderSchemaPropertiesBy: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"alpha">, z.ZodLiteral<"preserve">]>>>>;
183
196
  orderRequiredPropertiesFirst: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
184
197
  }, z.core.$strip>;
198
+ /**
199
+ * Pure configuration without the sources
200
+ *
201
+ * @deprecated Remove this once the types have been fully migrated
202
+ */
203
+ export type ApiReferenceConfigurationRaw = Omit<z.infer<typeof apiReferenceConfigurationSchema>, // Remove deprecated attributes
204
+ // Remove deprecated attributes
205
+ 'proxy' | 'spec' | 'authentication' | 'showToolbar'> & {
206
+ authentication?: AuthenticationConfiguration;
207
+ };
185
208
  /**
186
209
  * Configuration for the Scalar Api Reference integrations
187
210
  *
188
211
  * See the type `ApiReferenceConfigurationWithSource` or `AnyApiReferenceConfiguration`\
189
212
  * for the configuration that includes the sources for you OpenAPI documents
190
213
  */
191
- export type ApiReferenceConfiguration = Omit<z.infer<typeof apiReferenceConfigurationSchema>, // Remove deprecated attributes
192
- // Remove deprecated attributes
193
- 'proxy' | 'spec' | 'authentication'> & {
194
- authentication?: AuthenticationConfiguration;
195
- } & {
214
+ export type ApiReferenceConfiguration = ApiReferenceConfigurationRaw & {
196
215
  /** @deprecated
197
216
  * This type now refers to the base configuration that does not include the sources.
198
217
  * Use the type `ApiReferenceConfigurationWithSource` instead.
@@ -210,28 +229,18 @@ export declare const apiReferenceConfigurationWithSourceSchema: ZodType<Omit<Api
210
229
  /**
211
230
  * User facing configuration that includes the document source configuration
212
231
  */
213
- export type ApiReferenceConfigurationWithSource = Omit<z.infer<typeof apiReferenceConfigurationWithSourceSchema>, 'proxy' | 'spec' | 'authentication'> & {
232
+ export type ApiReferenceConfigurationWithSource = Omit<z.infer<typeof apiReferenceConfigurationWithSourceSchema>, 'proxy' | 'spec' | 'authentication' | 'showToolbar'> & {
214
233
  authentication?: AuthenticationConfiguration;
215
234
  };
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 & {
221
- /** Whether to use this config as the default one */
222
- default?: boolean;
223
- };
224
235
  /**
225
236
  * Configuration for a single config with multiple sources
226
237
  * The configuration will be shared between the documents
227
238
  */
228
239
  export type ApiReferenceConfigurationWithMultipleSources = ApiReferenceConfigurationWithSource & {
229
- sources: (SourceConfiguration & {
230
- default?: boolean;
231
- })[];
240
+ sources: SourceConfiguration[];
232
241
  };
233
242
  /** Configuration for multiple Api References */
234
- export type AnyApiReferenceConfiguration = Partial<ApiReferenceConfigurationWithSource> | Partial<ApiReferenceConfigurationWithMultipleSources> | Partial<ApiReferenceConfigurationWithDefault>[] | Partial<ApiReferenceConfigurationWithMultipleSources>[];
243
+ export type AnyApiReferenceConfiguration = Partial<ApiReferenceConfigurationWithSource> | Partial<ApiReferenceConfigurationWithMultipleSources> | Partial<ApiReferenceConfigurationWithSource>[] | Partial<ApiReferenceConfigurationWithMultipleSources>[];
235
244
  /** Typeguard to check to narrow the configs to the one with sources */
236
245
  export declare const isConfigurationWithSources: (config: AnyApiReferenceConfiguration) => config is Partial<ApiReferenceConfigurationWithMultipleSources>;
237
246
  //# 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,EAA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CAAmC,CAAC,GAC5C,OAAO,CAAC,4CAA4C,CAAC,GACrD,OAAO,CAAC,mCAAmC,CAAC,EAAE,GAC9C,OAAO,CAAC,4CAA4C,CAAC,EAAE,CAAA;AAE3D,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,GACrC,QAAQ,4BAA4B,KACnC,MAAM,IAAI,OAAO,CAAC,4CAA4C,CACkC,CAAA"}
@@ -116,11 +116,7 @@ const apiReferenceConfigurationSchema = baseConfigurationSchema.extend({
116
116
  // output: z.union([z.void(), z.promise(z.void())]),
117
117
  }).optional(),
118
118
  /** Callback fired when the reference is fully loaded */
119
- onLoaded: z.function({
120
- input: []
121
- // Why no output? https://github.com/scalar/scalar/pull/7047
122
- // output: z.union([z.void(), z.promise(z.void())]),
123
- }).optional(),
119
+ onLoaded: z.function().optional(),
124
120
  /** onBeforeRequest is fired before the request is sent. You can modify the request here. */
125
121
  onBeforeRequest: z.function({
126
122
  input: [z.object({ request: z.instanceof(Request) })]
@@ -217,7 +213,7 @@ const apiReferenceConfigurationSchema = baseConfigurationSchema.extend({
217
213
  output: z.string()
218
214
  }).optional(),
219
215
  /**
220
- * To handle redirects, pass a function that will recieve:
216
+ * To handle redirects, pass a function that will receive:
221
217
  * - The current path with hash if pathRouting is enabled
222
218
  * - The current hash if hashRouting (default)
223
219
  * And then passes that to history.replaceState
@@ -338,6 +334,11 @@ const apiReferenceConfigurationWithSourceSchema = apiReferenceConfigurationSchem
338
334
  );
339
335
  configuration.proxyUrl = NEW_PROXY_URL;
340
336
  }
337
+ if (configuration.showToolbar && configuration.showToolbar !== "localhost") {
338
+ console.warn(`[DEPRECATED] You're using the deprecated 'showToolbar' attribute. Use 'showDeveloperTools' instead.`);
339
+ configuration.showDeveloperTools = configuration.showToolbar;
340
+ delete configuration.showToolbar;
341
+ }
341
342
  return configuration;
342
343
  });
343
344
  const isConfigurationWithSources = (config) => Boolean(!Array.isArray(config) && config && "sources" in config && Array.isArray(config.sources));
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/api-reference/api-reference-configuration.ts"],
4
- "sourcesContent": ["import { type ZodType, z } from 'zod'\n\nimport type { TargetId } from '../snippetz'\nimport { apiReferencePluginSchema } from './api-reference-plugin'\nimport type { AuthenticationConfiguration } from './authentication-configuration'\nimport { NEW_PROXY_URL, OLD_PROXY_URL, baseConfigurationSchema } from './base-configuration'\nimport { type SourceConfiguration, sourceConfigurationSchema } from './source-configuration'\n\n// Zod Schemas don't work well with async functions, so we use a custom type instead.\nconst fetchLikeSchema = z.custom<(input: string | URL | Request, init?: RequestInit) => Promise<Response>>()\n\n/**\n * Standard configuration for the Api Reference.\n *\n * This is used internally to the configure the applications and does not include the sources.\n *\n * Sources should only be specified in the user facing configurations.\n *\n * In the the future it is likely sources will be removed completely from the configuration and instead\n * specified through a separate addDocument interface.\n */\nexport const apiReferenceConfigurationSchema = baseConfigurationSchema.extend({\n /**\n * The layout to use for the references\n * @default 'modern'\n */\n layout: z.enum(['modern', 'classic']).optional().default('modern').catch('modern'),\n /**\n * URL to a request proxy for the API client\n * @deprecated Use proxyUrl instead\n */\n proxy: z.string().optional(),\n /**\n * Custom fetch function for custom logic\n *\n * Can be used to add custom headers, handle auth, etc.\n */\n fetch: fetchLikeSchema.optional(),\n /**\n * Plugins for the API reference\n */\n plugins: z.array(apiReferencePluginSchema).optional(),\n /**\n * Allows the user to inject an editor for the spec\n * @default false\n */\n isEditable: z.boolean().optional().default(false).catch(false),\n /**\n * Controls whether the references show a loading state in the intro\n * @default false\n */\n isLoading: z.boolean().optional().default(false).catch(false),\n /**\n * Whether to show models in the sidebar, search, and content.\n * @default false\n */\n hideModels: z.boolean().optional().default(false).catch(false),\n /**\n * Sets the file type of the document to download, set to `none` to hide the download button\n * @default 'both'\n */\n documentDownloadType: z.enum(['yaml', 'json', 'both', 'direct', 'none']).optional().default('both').catch('both'),\n /**\n * Whether to show the \"Download OpenAPI Document\" button\n * @default false\n * @deprecated Use `documentDownloadType: 'none'` instead\n */\n hideDownloadButton: z.boolean().optional(),\n /**\n * Whether to show the \"Test Request\" button\n * @default false\n */\n hideTestRequestButton: z.boolean().optional().default(false).catch(false),\n /**\n * Whether to show the sidebar search bar\n * @default false\n */\n hideSearch: z.boolean().optional().default(false).catch(false),\n /**\n * Whether to show the operationId\n *\n * @default false\n */\n showOperationId: z.boolean().optional().default(false).catch(false),\n /** Whether dark mode is on or off initially (light mode) */\n darkMode: z.boolean().optional(),\n /** forceDarkModeState makes it always this state no matter what */\n forceDarkModeState: z.enum(['dark', 'light']).optional(),\n /**\n * Whether to show the dark mode toggle\n * @default false\n */\n hideDarkModeToggle: z.boolean().optional().default(false).catch(false),\n /**\n * If used, passed data will be added to the HTML header\n * @see https://unhead.unjs.io/usage/composables/use-seo-meta\n */\n metaData: z.any().optional(), // Using any for UseSeoMetaInput since it's an external type\n /**\n * Path to a favicon image\n * @default undefined\n * @example '/favicon.svg'\n */\n favicon: z.string().optional(),\n /**\n * List of httpsnippet clients to hide from the clients menu\n * By default hides Unirest, pass `[]` to show all clients\n */\n hiddenClients: z\n .union([z.record(z.string(), z.union([z.boolean(), z.array(z.string())])), z.array(z.string()), z.literal(true)])\n .optional(),\n /** Determine the HTTP client that's selected by default */\n defaultHttpClient: z\n .object({\n targetKey: z.custom<TargetId>(),\n clientKey: z.string(),\n })\n .optional(),\n /** Custom CSS to be added to the page */\n customCss: z.string().optional(),\n /** onSpecUpdate is fired on spec/swagger content change */\n onSpecUpdate: z\n .function({\n input: [z.string()],\n output: z.void(),\n })\n .optional(),\n /** onServerChange is fired on selected server change */\n onServerChange: z\n .function({\n input: [z.string()],\n output: z.void(),\n })\n .optional(),\n /** onDocumentSelect is fired when the config is selected */\n onDocumentSelect: z\n .function({\n input: [],\n // Why no output? https://github.com/scalar/scalar/pull/7047\n // output: z.union([z.void(), z.promise(z.void())]),\n })\n .optional() as z.ZodType<(() => Promise<void> | void) | undefined>,\n /** Callback fired when the reference is fully loaded */\n onLoaded: z\n .function({\n input: [],\n // Why no output? https://github.com/scalar/scalar/pull/7047\n // output: z.union([z.void(), z.promise(z.void())]),\n })\n .optional() as z.ZodType<(() => Promise<void> | void) | undefined>,\n /** onBeforeRequest is fired before the request is sent. You can modify the request here. */\n onBeforeRequest: z\n .function({\n input: [z.object({ request: z.instanceof(Request) })],\n // Why no output? https://github.com/scalar/scalar/pull/7047\n // output: z.union([z.void(), z.promise(z.void())]),\n })\n .optional() as z.ZodType<((a: { request: Request }) => Promise<void> | void) | undefined>,\n /**\n * onShowMore is fired when the user clicks the \"Show more\" button on the references\n * @param tagId - The ID of the tag that was clicked\n */\n onShowMore: z\n .function({\n input: [z.string()],\n // Why no output? https://github.com/scalar/scalar/pull/7047\n // output: z.union([z.void(), z.promise(z.void())]),\n })\n .optional() as z.ZodType<((a: string) => Promise<void> | void) | undefined>,\n /**\n * onSidebarClick is fired when the user clicks on a sidebar item\n * @param href - The href of the sidebar item that was clicked\n */\n onSidebarClick: z\n .function({\n input: [z.string()],\n // Why no output? https://github.com/scalar/scalar/pull/7047\n // output: z.union([z.void(), z.promise(z.void())]),\n })\n .optional() as z.ZodType<((a: string) => Promise<void> | void) | undefined>,\n /**\n * Route using paths instead of hashes, your server MUST support this\n * @example '/standalone-api-reference/:custom(.*)?'\n * @experimental\n * @default undefined\n */\n pathRouting: z\n .object({\n basePath: z.string(),\n })\n .optional(),\n /**\n * Customize the heading portion of the hash\n * @param heading - The heading object\n * @returns A string ID used to generate the URL hash\n * @default (heading) => `#description/${heading.slug}`\n */\n generateHeadingSlug: z\n .function({\n input: [z.object({ slug: z.string().default('headingSlug') })],\n output: z.string(),\n })\n .optional(),\n /**\n * Customize the model portion of the hash\n * @param model - The model object with a name property\n * @returns A string ID used to generate the URL hash\n * @default (model) => slug(model.name)\n */\n generateModelSlug: z\n .function({\n input: [z.object({ name: z.string().default('modelName') })],\n output: z.string(),\n })\n .optional(),\n /**\n * Customize the tag portion of the hash\n * @param tag - The tag object\n * @returns A string ID used to generate the URL hash\n * @default (tag) => slug(tag.name)\n */\n generateTagSlug: z\n .function({\n input: [z.object({ name: z.string().default('tagName') })],\n output: z.string(),\n })\n .optional(),\n /**\n * Customize the operation portion of the hash\n * @param operation - The operation object\n * @returns A string ID used to generate the URL hash\n * @default (operation) => `${operation.method}${operation.path}`\n */\n generateOperationSlug: z\n .function({\n input: [\n z.object({\n path: z.string(),\n operationId: z.string().optional(),\n method: z.string(),\n summary: z.string().optional(),\n }),\n ],\n output: z.string(),\n })\n .optional(),\n /**\n * Customize the webhook portion of the hash\n * @param webhook - The webhook object\n * @returns A string ID used to generate the URL hash\n * @default (webhook) => slug(webhook.name)\n */\n generateWebhookSlug: z\n .function({\n input: [\n z.object({\n name: z.string(),\n method: z.string().optional(),\n }),\n ],\n output: z.string(),\n })\n .optional(),\n /**\n * To handle redirects, pass a function that will recieve:\n * - The current path with hash if pathRouting is enabled\n * - The current hash if hashRouting (default)\n * And then passes that to history.replaceState\n *\n * @example hashRouting (default)\n * ```ts\n * redirect: (hash: string) => hash.replace('#v1/old-path', '#v2/new-path')\n * ```\n * @example pathRouting\n * ```ts\n * redirect: (pathWithHash: string) => {\n * if (pathWithHash.includes('#')) {\n * return pathWithHash.replace('/v1/tags/user#operation/get-user', '/v1/tags/user/operation/get-user')\n * }\n * return null\n * }\n * ```\n */\n redirect: z\n .function({\n input: [z.string()],\n output: z.string().nullable().optional(),\n })\n .optional(),\n /**\n * Whether to include default fonts\n * @default true\n */\n withDefaultFonts: z.boolean().optional().default(true).catch(true),\n /**\n * Whether to expand all tags by default\n *\n * Warning this can cause performance issues on big documents\n * @default false\n */\n defaultOpenAllTags: z.boolean().optional().default(false).catch(false),\n /**\n * Whether to expand all models by default\n *\n * Warning this can cause performance issues on big documents\n * @default false\n */\n expandAllModelSections: z.boolean().optional().default(false).catch(false),\n /**\n * Whether to expand all responses by default\n *\n * Warning this can cause performance issues on big documents\n * @default false\n */\n expandAllResponses: z.boolean().optional().default(false).catch(false),\n /**\n * Function to sort tags\n * @default 'alpha' for alphabetical sorting\n */\n tagsSorter: z\n .union([\n z.literal('alpha'),\n z.function({\n input: [z.any(), z.any()],\n output: z.number(),\n }),\n ])\n .optional(),\n /**\n * Function to sort operations\n * @default 'alpha' for alphabetical sorting\n */\n operationsSorter: z\n .union([\n z.literal('alpha'),\n z.literal('method'),\n z.function({\n input: [z.any(), z.any()],\n output: z.number(),\n }),\n ])\n .optional(),\n /**\n * Order the schema properties by\n * @default 'alpha' for alphabetical sorting\n */\n orderSchemaPropertiesBy: z\n .union([z.literal('alpha'), z.literal('preserve')])\n .optional()\n .default('alpha')\n .catch('alpha'),\n /**\n * Sort the schema properties by required ones first\n * @default true\n */\n orderRequiredPropertiesFirst: z.boolean().optional().default(true).catch(true),\n})\n\n/**\n * Configuration for the Scalar Api Reference integrations\n *\n * See the type `ApiReferenceConfigurationWithSource` or `AnyApiReferenceConfiguration`\\\n * for the configuration that includes the sources for you OpenAPI documents\n */\nexport type ApiReferenceConfiguration = Omit<\n z.infer<typeof apiReferenceConfigurationSchema>, // Remove deprecated attributes\n 'proxy' | 'spec' | 'authentication'\n> & {\n authentication?: AuthenticationConfiguration\n} & {\n /** @deprecated\n * This type now refers to the base configuration that does not include the sources.\n * Use the type `ApiReferenceConfigurationWithSource` instead.\n */\n url?: SourceConfiguration['url']\n /** @deprecated\n * This type now refers to the base configuration that does not include the sources.\n * Use the type `ApiReferenceConfigurationWithSource` instead.\n */\n content?: SourceConfiguration['content']\n}\n\n/** Migrate the configuration through a transform */\n// const migrateConfiguration = <T extends z.infer<typeof _apiReferenceConfigurationSchema>>\n\n/** Configuration for the Api Reference */\nexport const apiReferenceConfigurationWithSourceSchema: ZodType<\n Omit<ApiReferenceConfiguration, 'url' | 'content'> & SourceConfiguration\n> = apiReferenceConfigurationSchema.extend(sourceConfigurationSchema.shape).transform((configuration) => {\n // Migrate hideDownloadButton to documentDownloadType\n if (configuration.hideDownloadButton) {\n console.warn(\n `[DEPRECATED] You're using the deprecated 'hideDownloadButton' attribute. Use 'documentDownloadType: 'none'' instead.`,\n )\n\n configuration.documentDownloadType = 'none'\n }\n\n // Remove the spec prefix\n if (configuration.spec?.url) {\n console.warn(\n `[DEPRECATED] You're using the deprecated 'spec.url' attribute. Remove the spec prefix and move the 'url' attribute to the top level.`,\n )\n\n configuration.url = configuration.spec.url\n delete configuration.spec\n }\n\n if (configuration.spec?.content) {\n console.warn(\n `[DEPRECATED] You're using the deprecated 'spec.content' attribute. Remove the spec prefix and move the 'content' attribute to the top level.`,\n )\n\n configuration.content = configuration.spec.content\n delete configuration.spec\n }\n\n // Migrate proxy URL\n if (configuration.proxy) {\n console.warn(\n `[DEPRECATED] You're using the deprecated 'proxy' attribute, rename it to 'proxyUrl' or update the package.`,\n )\n\n if (!configuration.proxyUrl) {\n configuration.proxyUrl = configuration.proxy\n }\n\n delete configuration.proxy\n }\n\n if (configuration.proxyUrl === OLD_PROXY_URL) {\n console.warn(`[DEPRECATED] Warning: configuration.proxyUrl points to our old proxy (${OLD_PROXY_URL}).`)\n console.warn(`[DEPRECATED] We are overwriting the value and use the new proxy URL (${NEW_PROXY_URL}) instead.`)\n console.warn(\n `[DEPRECATED] Action Required: You should manually update your configuration to use the new URL (${NEW_PROXY_URL}). Read more: https://github.com/scalar/scalar`,\n )\n\n configuration.proxyUrl = NEW_PROXY_URL\n }\n\n return configuration\n})\n\n/**\n * User facing configuration that includes the document source configuration\n */\nexport type ApiReferenceConfigurationWithSource = Omit<\n z.infer<typeof apiReferenceConfigurationWithSourceSchema>,\n // Remove deprecated attributes\n 'proxy' | 'spec' | 'authentication'\n> & {\n authentication?: AuthenticationConfiguration\n}\n\n/**\n * When providing an array of configurations we extend with the default attribute\n * which indicates which configuration should be used as the default one\n */\nexport type ApiReferenceConfigurationWithDefault = ApiReferenceConfigurationWithSource & {\n /** Whether to use this config as the default one */\n default?: boolean\n}\n\n/**\n * Configuration for a single config with multiple sources\n * The configuration will be shared between the documents\n */\nexport type ApiReferenceConfigurationWithMultipleSources = ApiReferenceConfigurationWithSource & {\n sources: (SourceConfiguration & { default?: boolean })[]\n}\n\n/** Configuration for multiple Api References */\nexport type AnyApiReferenceConfiguration =\n | Partial<ApiReferenceConfigurationWithSource>\n | Partial<ApiReferenceConfigurationWithMultipleSources>\n | Partial<ApiReferenceConfigurationWithDefault>[]\n | Partial<ApiReferenceConfigurationWithMultipleSources>[]\n\n/** Typeguard to check to narrow the configs to the one with sources */\nexport const isConfigurationWithSources = (\n config: AnyApiReferenceConfiguration,\n): config is Partial<ApiReferenceConfigurationWithMultipleSources> =>\n Boolean(!Array.isArray(config) && config && 'sources' in config && Array.isArray(config.sources))\n"],
5
- "mappings": "AAAA,SAAuB,SAAS;AAGhC,SAAS,gCAAgC;AAEzC,SAAS,eAAe,eAAe,+BAA+B;AACtE,SAAmC,iCAAiC;AAGpE,MAAM,kBAAkB,EAAE,OAAiF;AAYpG,MAAM,kCAAkC,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5E,QAAQ,EAAE,KAAK,CAAC,UAAU,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,QAAQ,EAAE,MAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,EAKjF,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM3B,OAAO,gBAAgB,SAAS;AAAA;AAAA;AAAA;AAAA,EAIhC,SAAS,EAAE,MAAM,wBAAwB,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAKpD,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAK,EAAE,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,EAK7D,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAK,EAAE,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5D,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAK,EAAE,MAAM,KAAK;AAAA;A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MAAM,QAAQ,OAAO,OAAO,CAAC;",
4
+ "sourcesContent": ["import { type ZodType, z } from 'zod'\n\nimport type { TargetId } from '../snippetz'\nimport { apiReferencePluginSchema } from './api-reference-plugin'\nimport type { AuthenticationConfiguration } from './authentication-configuration'\nimport { NEW_PROXY_URL, OLD_PROXY_URL, baseConfigurationSchema } from './base-configuration'\nimport { type SourceConfiguration, sourceConfigurationSchema } from './source-configuration'\n\n// Zod Schemas don't work well with async functions, so we use a custom type instead.\nconst fetchLikeSchema = z.custom<(input: string | URL | Request, init?: RequestInit) => Promise<Response>>()\n\n/**\n * Standard configuration for the Api Reference.\n *\n * This is used internally to the configure the applications and does not include the sources.\n *\n * Sources should only be specified in the user facing configurations.\n *\n * In the the future it is likely sources will be removed completely from the configuration and instead\n * specified through a separate addDocument interface.\n */\nexport const apiReferenceConfigurationSchema = baseConfigurationSchema.extend({\n /**\n * The layout to use for the references\n * @default 'modern'\n */\n layout: z.enum(['modern', 'classic']).optional().default('modern').catch('modern'),\n /**\n * URL to a request proxy for the API client\n * @deprecated Use proxyUrl instead\n */\n proxy: z.string().optional(),\n /**\n * Custom fetch function for custom logic\n *\n * Can be used to add custom headers, handle auth, etc.\n */\n fetch: fetchLikeSchema.optional(),\n /**\n * Plugins for the API reference\n */\n plugins: z.array(apiReferencePluginSchema).optional(),\n /**\n * Allows the user to inject an editor for the spec\n * @default false\n */\n isEditable: z.boolean().optional().default(false).catch(false),\n /**\n * Controls whether the references show a loading state in the intro\n * @default false\n */\n isLoading: z.boolean().optional().default(false).catch(false),\n /**\n * Whether to show models in the sidebar, search, and content.\n * @default false\n */\n hideModels: z.boolean().optional().default(false).catch(false),\n /**\n * Sets the file type of the document to download, set to `none` to hide the download button\n * @default 'both'\n */\n documentDownloadType: z.enum(['yaml', 'json', 'both', 'direct', 'none']).optional().default('both').catch('both'),\n /**\n * Whether to show the \"Download OpenAPI Document\" button\n * @default false\n * @deprecated Use `documentDownloadType: 'none'` instead\n */\n hideDownloadButton: z.boolean().optional(),\n /**\n * Whether to show the \"Test Request\" button\n * @default false\n */\n hideTestRequestButton: z.boolean().optional().default(false).catch(false),\n /**\n * Whether to show the sidebar search bar\n * @default false\n */\n hideSearch: z.boolean().optional().default(false).catch(false),\n /**\n * Whether to show the operationId\n *\n * @default false\n */\n showOperationId: z.boolean().optional().default(false).catch(false),\n /** Whether dark mode is on or off initially (light mode) */\n darkMode: z.boolean().optional(),\n /** forceDarkModeState makes it always this state no matter what */\n forceDarkModeState: z.enum(['dark', 'light']).optional(),\n /**\n * Whether to show the dark mode toggle\n * @default false\n */\n hideDarkModeToggle: z.boolean().optional().default(false).catch(false),\n /**\n * If used, passed data will be added to the HTML header\n * @see https://unhead.unjs.io/usage/composables/use-seo-meta\n */\n metaData: z.any().optional(), // Using any for UseSeoMetaInput since it's an external type\n /**\n * Path to a favicon image\n * @default undefined\n * @example '/favicon.svg'\n */\n favicon: z.string().optional(),\n /**\n * List of httpsnippet clients to hide from the clients menu\n * By default hides Unirest, pass `[]` to show all clients\n */\n hiddenClients: z\n .union([z.record(z.string(), z.union([z.boolean(), z.array(z.string())])), z.array(z.string()), z.literal(true)])\n .optional(),\n /** Determine the HTTP client that's selected by default */\n defaultHttpClient: z\n .object({\n targetKey: z.custom<TargetId>(),\n clientKey: z.string(),\n })\n .optional(),\n /** Custom CSS to be added to the page */\n customCss: z.string().optional(),\n /** onSpecUpdate is fired on spec/swagger content change */\n onSpecUpdate: z\n .function({\n input: [z.string()],\n output: z.void(),\n })\n .optional(),\n /** onServerChange is fired on selected server change */\n onServerChange: z\n .function({\n input: [z.string()],\n output: z.void(),\n })\n .optional(),\n /** onDocumentSelect is fired when the config is selected */\n onDocumentSelect: z\n .function({\n input: [],\n // Why no output? https://github.com/scalar/scalar/pull/7047\n // output: z.union([z.void(), z.promise(z.void())]),\n })\n .optional() as z.ZodType<(() => Promise<void> | void) | undefined>,\n /** Callback fired when the reference is fully loaded */\n onLoaded: z.function().optional() as z.ZodType<((slug: string) => Promise<void> | void) | undefined>,\n /** onBeforeRequest is fired before the request is sent. You can modify the request here. */\n onBeforeRequest: z\n .function({\n input: [z.object({ request: z.instanceof(Request) })],\n // Why no output? https://github.com/scalar/scalar/pull/7047\n // output: z.union([z.void(), z.promise(z.void())]),\n })\n .optional() as z.ZodType<((a: { request: Request }) => Promise<void> | void) | undefined>,\n /**\n * onShowMore is fired when the user clicks the \"Show more\" button on the references\n * @param tagId - The ID of the tag that was clicked\n */\n onShowMore: z\n .function({\n input: [z.string()],\n // Why no output? https://github.com/scalar/scalar/pull/7047\n // output: z.union([z.void(), z.promise(z.void())]),\n })\n .optional() as z.ZodType<((a: string) => Promise<void> | void) | undefined>,\n /**\n * onSidebarClick is fired when the user clicks on a sidebar item\n * @param href - The href of the sidebar item that was clicked\n */\n onSidebarClick: z\n .function({\n input: [z.string()],\n // Why no output? https://github.com/scalar/scalar/pull/7047\n // output: z.union([z.void(), z.promise(z.void())]),\n })\n .optional() as z.ZodType<((a: string) => Promise<void> | void) | undefined>,\n /**\n * Route using paths instead of hashes, your server MUST support this\n * @example '/standalone-api-reference/:custom(.*)?'\n * @experimental\n * @default undefined\n */\n pathRouting: z\n .object({\n basePath: z.string(),\n })\n .optional(),\n /**\n * Customize the heading portion of the hash\n * @param heading - The heading object\n * @returns A string ID used to generate the URL hash\n * @default (heading) => `#description/${heading.slug}`\n */\n generateHeadingSlug: z\n .function({\n input: [z.object({ slug: z.string().default('headingSlug') })],\n output: z.string(),\n })\n .optional(),\n /**\n * Customize the model portion of the hash\n * @param model - The model object with a name property\n * @returns A string ID used to generate the URL hash\n * @default (model) => slug(model.name)\n */\n generateModelSlug: z\n .function({\n input: [z.object({ name: z.string().default('modelName') })],\n output: z.string(),\n })\n .optional(),\n /**\n * Customize the tag portion of the hash\n * @param tag - The tag object\n * @returns A string ID used to generate the URL hash\n * @default (tag) => slug(tag.name)\n */\n generateTagSlug: z\n .function({\n input: [z.object({ name: z.string().default('tagName') })],\n output: z.string(),\n })\n .optional(),\n /**\n * Customize the operation portion of the hash\n * @param operation - The operation object\n * @returns A string ID used to generate the URL hash\n * @default (operation) => `${operation.method}${operation.path}`\n */\n generateOperationSlug: z\n .function({\n input: [\n z.object({\n path: z.string(),\n operationId: z.string().optional(),\n method: z.string(),\n summary: z.string().optional(),\n }),\n ],\n output: z.string(),\n })\n .optional(),\n /**\n * Customize the webhook portion of the hash\n * @param webhook - The webhook object\n * @returns A string ID used to generate the URL hash\n * @default (webhook) => slug(webhook.name)\n */\n generateWebhookSlug: z\n .function({\n input: [\n z.object({\n name: z.string(),\n method: z.string().optional(),\n }),\n ],\n output: z.string(),\n })\n .optional(),\n /**\n * To handle redirects, pass a function that will receive:\n * - The current path with hash if pathRouting is enabled\n * - The current hash if hashRouting (default)\n * And then passes that to history.replaceState\n *\n * @example hashRouting (default)\n * ```ts\n * redirect: (hash: string) => hash.replace('#v1/old-path', '#v2/new-path')\n * ```\n * @example pathRouting\n * ```ts\n * redirect: (pathWithHash: string) => {\n * if (pathWithHash.includes('#')) {\n * return pathWithHash.replace('/v1/tags/user#operation/get-user', '/v1/tags/user/operation/get-user')\n * }\n * return null\n * }\n * ```\n */\n redirect: z\n .function({\n input: [z.string()],\n output: z.string().nullable().optional(),\n })\n .optional(),\n /**\n * Whether to include default fonts\n * @default true\n */\n withDefaultFonts: z.boolean().optional().default(true).catch(true),\n /**\n * Whether to expand all tags by default\n *\n * Warning this can cause performance issues on big documents\n * @default false\n */\n defaultOpenAllTags: z.boolean().optional().default(false).catch(false),\n /**\n * Whether to expand all models by default\n *\n * Warning this can cause performance issues on big documents\n * @default false\n */\n expandAllModelSections: z.boolean().optional().default(false).catch(false),\n /**\n * Whether to expand all responses by default\n *\n * Warning this can cause performance issues on big documents\n * @default false\n */\n expandAllResponses: z.boolean().optional().default(false).catch(false),\n /**\n * Function to sort tags\n * @default 'alpha' for alphabetical sorting\n */\n tagsSorter: z\n .union([\n z.literal('alpha'),\n z.function({\n input: [z.any(), z.any()],\n output: z.number(),\n }),\n ])\n .optional(),\n /**\n * Function to sort operations\n * @default 'alpha' for alphabetical sorting\n */\n operationsSorter: z\n .union([\n z.literal('alpha'),\n z.literal('method'),\n z.function({\n input: [z.any(), z.any()],\n output: z.number(),\n }),\n ])\n .optional(),\n /**\n * Order the schema properties by\n * @default 'alpha' for alphabetical sorting\n */\n orderSchemaPropertiesBy: z\n .union([z.literal('alpha'), z.literal('preserve')])\n .optional()\n .default('alpha')\n .catch('alpha'),\n /**\n * Sort the schema properties by required ones first\n * @default true\n */\n orderRequiredPropertiesFirst: z.boolean().optional().default(true).catch(true),\n})\n\n/**\n * Pure configuration without the sources\n *\n * @deprecated Remove this once the types have been fully migrated\n */\nexport type ApiReferenceConfigurationRaw = Omit<\n z.infer<typeof apiReferenceConfigurationSchema>, // Remove deprecated attributes\n 'proxy' | 'spec' | 'authentication' | 'showToolbar'\n> & {\n authentication?: AuthenticationConfiguration\n}\n\n/**\n * Configuration for the Scalar Api Reference integrations\n *\n * See the type `ApiReferenceConfigurationWithSource` or `AnyApiReferenceConfiguration`\\\n * for the configuration that includes the sources for you OpenAPI documents\n */\nexport type ApiReferenceConfiguration = ApiReferenceConfigurationRaw & {\n /** @deprecated\n * This type now refers to the base configuration that does not include the sources.\n * Use the type `ApiReferenceConfigurationWithSource` instead.\n */\n url?: SourceConfiguration['url']\n /** @deprecated\n * This type now refers to the base configuration that does not include the sources.\n * Use the type `ApiReferenceConfigurationWithSource` instead.\n */\n content?: SourceConfiguration['content']\n}\n\n/** Migrate the configuration through a transform */\n// const migrateConfiguration = <T extends z.infer<typeof _apiReferenceConfigurationSchema>>\n\n/** Configuration for the Api Reference */\nexport const apiReferenceConfigurationWithSourceSchema: ZodType<\n Omit<ApiReferenceConfiguration, 'url' | 'content'> & SourceConfiguration\n> = apiReferenceConfigurationSchema.extend(sourceConfigurationSchema.shape).transform((configuration) => {\n // Migrate hideDownloadButton to documentDownloadType\n if (configuration.hideDownloadButton) {\n console.warn(\n `[DEPRECATED] You're using the deprecated 'hideDownloadButton' attribute. Use 'documentDownloadType: 'none'' instead.`,\n )\n\n configuration.documentDownloadType = 'none'\n }\n\n // Remove the spec prefix\n if (configuration.spec?.url) {\n console.warn(\n `[DEPRECATED] You're using the deprecated 'spec.url' attribute. Remove the spec prefix and move the 'url' attribute to the top level.`,\n )\n\n configuration.url = configuration.spec.url\n delete configuration.spec\n }\n\n if (configuration.spec?.content) {\n console.warn(\n `[DEPRECATED] You're using the deprecated 'spec.content' attribute. Remove the spec prefix and move the 'content' attribute to the top level.`,\n )\n\n configuration.content = configuration.spec.content\n delete configuration.spec\n }\n\n // Migrate proxy URL\n if (configuration.proxy) {\n console.warn(\n `[DEPRECATED] You're using the deprecated 'proxy' attribute, rename it to 'proxyUrl' or update the package.`,\n )\n\n if (!configuration.proxyUrl) {\n configuration.proxyUrl = configuration.proxy\n }\n\n delete configuration.proxy\n }\n\n if (configuration.proxyUrl === OLD_PROXY_URL) {\n console.warn(`[DEPRECATED] Warning: configuration.proxyUrl points to our old proxy (${OLD_PROXY_URL}).`)\n console.warn(`[DEPRECATED] We are overwriting the value and use the new proxy URL (${NEW_PROXY_URL}) instead.`)\n console.warn(\n `[DEPRECATED] Action Required: You should manually update your configuration to use the new URL (${NEW_PROXY_URL}). Read more: https://github.com/scalar/scalar`,\n )\n\n configuration.proxyUrl = NEW_PROXY_URL\n }\n\n // Migrate showToolbar to showDeveloperTools\n if (configuration.showToolbar && configuration.showToolbar !== 'localhost') {\n console.warn(`[DEPRECATED] You're using the deprecated 'showToolbar' attribute. Use 'showDeveloperTools' instead.`)\n\n configuration.showDeveloperTools = configuration.showToolbar\n\n // @ts-expect-error - We're deleting the deprecated attribute\n delete configuration.showToolbar\n }\n\n return configuration\n})\n\n/**\n * User facing configuration that includes the document source configuration\n */\nexport type ApiReferenceConfigurationWithSource = Omit<\n z.infer<typeof apiReferenceConfigurationWithSourceSchema>,\n // Remove deprecated attributes\n 'proxy' | 'spec' | 'authentication' | 'showToolbar'\n> & {\n authentication?: AuthenticationConfiguration\n}\n\n/**\n * Configuration for a single config with multiple sources\n * The configuration will be shared between the documents\n */\nexport type ApiReferenceConfigurationWithMultipleSources = ApiReferenceConfigurationWithSource & {\n sources: SourceConfiguration[]\n}\n\n/** Configuration for multiple Api References */\nexport type AnyApiReferenceConfiguration =\n | Partial<ApiReferenceConfigurationWithSource>\n | Partial<ApiReferenceConfigurationWithMultipleSources>\n | Partial<ApiReferenceConfigurationWithSource>[]\n | Partial<ApiReferenceConfigurationWithMultipleSources>[]\n\n/** Typeguard to check to narrow the configs to the one with sources */\nexport const isConfigurationWithSources = (\n config: AnyApiReferenceConfiguration,\n): config is Partial<ApiReferenceConfigurationWithMultipleSources> =>\n Boolean(!Array.isArray(config) && config && 'sources' in config && Array.isArray(config.sources))\n"],
5
+ "mappings": "AAAA,SAAuB,SAAS;AAGhC,SAAS,gCAAgC;AAEzC,SAAS,eAAe,eAAe,+BAA+B;AACtE,SAAmC,iCAAiC;AAGpE,MAAM,kBAAkB,EAAE,OAAiF;AAYpG,MAAM,kCAAkC,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5E,QAAQ,EAAE,KAAK,CAAC,UAAU,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,QAAQ,EAAE,MAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,EAKjF,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM3B,OAAO,gBAAgB,SAAS;AAAA;AAAA;AAAA;AAAA,EAIhC,SAAS,EAAE,MAAM,wBAAwB,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAKpD,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAK,EAAE,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,EAK7D,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAK,EAAE,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,EA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Ac,qBAAqB,cAAc;AAGjD,WAAO,cAAc;AAAA,EACvB;AAEA,SAAO;AACT,CAAC;AA6BM,MAAM,6BAA6B,CACxC,WAEA,QAAQ,CAAC,MAAM,QAAQ,MAAM,KAAK,UAAU,aAAa,UAAU,MAAM,QAAQ,OAAO,OAAO,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,9 +1,14 @@
1
1
  import { z } from 'zod';
2
- export declare const openApiExtensionSchema: z.ZodObject<{
2
+ declare const openApiExtensionSchema: z.ZodObject<{
3
3
  name: z.ZodString;
4
4
  component: z.ZodUnknown;
5
5
  renderer: z.ZodOptional<z.ZodUnknown>;
6
6
  }, z.core.$strip>;
7
+ declare const viewComponentSchema: z.ZodObject<{
8
+ component: z.ZodUnknown;
9
+ renderer: z.ZodOptional<z.ZodUnknown>;
10
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
11
+ }, z.core.$strip>;
7
12
  export declare const apiReferencePluginSchema: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodObject<{
8
13
  name: z.ZodString;
9
14
  extensions: z.ZodArray<z.ZodObject<{
@@ -11,7 +16,16 @@ export declare const apiReferencePluginSchema: z.ZodFunction<z.ZodTuple<readonly
11
16
  component: z.ZodUnknown;
12
17
  renderer: z.ZodOptional<z.ZodUnknown>;
13
18
  }, z.core.$strip>>;
19
+ views: z.ZodOptional<z.ZodObject<{
20
+ 'content.end': z.ZodOptional<z.ZodArray<z.ZodObject<{
21
+ component: z.ZodUnknown;
22
+ renderer: z.ZodOptional<z.ZodUnknown>;
23
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
24
+ }, z.core.$strip>>>;
25
+ }, z.core.$strip>>;
14
26
  }, z.core.$strip>>;
15
27
  export type SpecificationExtension = z.infer<typeof openApiExtensionSchema>;
28
+ export type ViewComponent = z.infer<typeof viewComponentSchema>;
16
29
  export type ApiReferencePlugin = z.infer<typeof apiReferencePluginSchema>;
30
+ export {};
17
31
  //# sourceMappingURL=api-reference-plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-reference-plugin.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,sBAAsB;;;;iBAkBjC,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;kBAMnC,CAAA;AAGF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAC3E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
1
+ {"version":3,"file":"api-reference-plugin.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,QAAA,MAAM,sBAAsB;;;;iBAkB1B,CAAA;AAEF,QAAA,MAAM,mBAAmB;;;;iBAavB,CAAA;AASF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;kBAUnC,CAAA;AAGF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAC3E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC/D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
@@ -18,15 +18,38 @@ const openApiExtensionSchema = z.object({
18
18
  */
19
19
  renderer: z.unknown().optional()
20
20
  });
21
+ const viewComponentSchema = z.object({
22
+ /**
23
+ * Vue component to render in the view
24
+ */
25
+ component: z.unknown(),
26
+ /**
27
+ * Custom renderer to render the view component (e.g., ReactRenderer)
28
+ */
29
+ renderer: z.unknown().optional(),
30
+ /**
31
+ * Additional props to pass to the component
32
+ */
33
+ props: z.record(z.string(), z.any()).optional()
34
+ });
35
+ const viewsSchema = z.object({
36
+ /**
37
+ * Renders after the Models section
38
+ */
39
+ "content.end": z.array(viewComponentSchema).optional()
40
+ });
21
41
  const apiReferencePluginSchema = z.function({
22
42
  input: [],
23
43
  output: z.object({
24
44
  name: z.string(),
25
- extensions: z.array(openApiExtensionSchema)
45
+ extensions: z.array(openApiExtensionSchema),
46
+ /**
47
+ * Components to render at specific views in the API Reference
48
+ */
49
+ views: viewsSchema.optional()
26
50
  })
27
51
  });
28
52
  export {
29
- apiReferencePluginSchema,
30
- openApiExtensionSchema
53
+ apiReferencePluginSchema
31
54
  };
32
55
  //# sourceMappingURL=api-reference-plugin.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/api-reference/api-reference-plugin.ts"],
4
- "sourcesContent": ["import { z } from 'zod'\n\nexport const openApiExtensionSchema = z.object({\n /**\n * Name of specification extension property. Has to start with `x-`.\n *\n * @example\n * ```yaml\n * x-custom-extension: foobar\n * ```\n */\n name: z.string().regex(/^x-/),\n /**\n * Vue component to render the specification extension\n */\n component: z.unknown(),\n /**\n * Custom renderer to render the specification extension\n */\n renderer: z.unknown().optional(),\n})\n\nexport const apiReferencePluginSchema = z.function({\n input: [],\n output: z.object({\n name: z.string(),\n extensions: z.array(openApiExtensionSchema),\n }),\n})\n\n// Infer the types from the schemas\nexport type SpecificationExtension = z.infer<typeof openApiExtensionSchema>\nexport type ApiReferencePlugin = z.infer<typeof apiReferencePluginSchema>\n"],
5
- "mappings": "AAAA,SAAS,SAAS;AAEX,MAAM,yBAAyB,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS7C,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA,EAI5B,WAAW,EAAE,QAAQ;AAAA;AAAA;AAAA;AAAA,EAIrB,UAAU,EAAE,QAAQ,EAAE,SAAS;AACjC,CAAC;AAEM,MAAM,2BAA2B,EAAE,SAAS;AAAA,EACjD,OAAO,CAAC;AAAA,EACR,QAAQ,EAAE,OAAO;AAAA,IACf,MAAM,EAAE,OAAO;AAAA,IACf,YAAY,EAAE,MAAM,sBAAsB;AAAA,EAC5C,CAAC;AACH,CAAC;",
4
+ "sourcesContent": ["import { z } from 'zod'\n\nconst openApiExtensionSchema = z.object({\n /**\n * Name of specification extension property. Has to start with `x-`.\n *\n * @example\n * ```yaml\n * x-custom-extension: foobar\n * ```\n */\n name: z.string().regex(/^x-/),\n /**\n * Vue component to render the specification extension\n */\n component: z.unknown(),\n /**\n * Custom renderer to render the specification extension\n */\n renderer: z.unknown().optional(),\n})\n\nconst viewComponentSchema = z.object({\n /**\n * Vue component to render in the view\n */\n component: z.unknown(),\n /**\n * Custom renderer to render the view component (e.g., ReactRenderer)\n */\n renderer: z.unknown().optional(),\n /**\n * Additional props to pass to the component\n */\n props: z.record(z.string(), z.any()).optional(),\n})\n\nconst viewsSchema = z.object({\n /**\n * Renders after the Models section\n */\n 'content.end': z.array(viewComponentSchema).optional(),\n})\n\nexport const apiReferencePluginSchema = z.function({\n input: [],\n output: z.object({\n name: z.string(),\n extensions: z.array(openApiExtensionSchema),\n /**\n * Components to render at specific views in the API Reference\n */\n views: viewsSchema.optional(),\n }),\n})\n\n// Infer the types from the schemas\nexport type SpecificationExtension = z.infer<typeof openApiExtensionSchema>\nexport type ViewComponent = z.infer<typeof viewComponentSchema>\nexport type ApiReferencePlugin = z.infer<typeof apiReferencePluginSchema>\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAElB,MAAM,yBAAyB,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAStC,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA,EAI5B,WAAW,EAAE,QAAQ;AAAA;AAAA;AAAA;AAAA,EAIrB,UAAU,EAAE,QAAQ,EAAE,SAAS;AACjC,CAAC;AAED,MAAM,sBAAsB,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA,EAInC,WAAW,EAAE,QAAQ;AAAA;AAAA;AAAA;AAAA,EAIrB,UAAU,EAAE,QAAQ,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,EAI/B,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC,EAAE,SAAS;AAChD,CAAC;AAED,MAAM,cAAc,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA,EAI3B,eAAe,EAAE,MAAM,mBAAmB,EAAE,SAAS;AACvD,CAAC;AAEM,MAAM,2BAA2B,EAAE,SAAS;AAAA,EACjD,OAAO,CAAC;AAAA,EACR,QAAQ,EAAE,OAAO;AAAA,IACf,MAAM,EAAE,OAAO;AAAA,IACf,YAAY,EAAE,MAAM,sBAAsB;AAAA;AAAA;AAAA;AAAA,IAI1C,OAAO,YAAY,SAAS;AAAA,EAC9B,CAAC;AACH,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/api-reference/authentication-configuration.test-d.ts"],
4
- "sourcesContent": ["import { assertType, describe, it } from 'vitest'\nimport type { AuthenticationConfiguration } from './authentication-configuration'\n\ndescribe('ApiReferenceConfiguration', () => {\n it('ensure we are generating correct types for preferredSecurityScheme', () => {\n assertType<AuthenticationConfiguration>({ preferredSecurityScheme: 'apiKey' })\n assertType<AuthenticationConfiguration>({ preferredSecurityScheme: ['apiKey', 'bearerAuth'] })\n assertType<AuthenticationConfiguration>({\n preferredSecurityScheme: ['apiKey', ['basic', 'oauth2'], ['apiKey', 'bearerAuth', 'oauth2']],\n })\n assertType<AuthenticationConfiguration>({\n // @ts-expect-error incorrect type\n preferredSecurityScheme: 47,\n })\n assertType<AuthenticationConfiguration>({\n // @ts-expect-error incorrect type\n preferredSecurityScheme: [22, null],\n })\n })\n\n it('ensure we are generating correct types for securitySchemes', () => {\n assertType<AuthenticationConfiguration>({\n securitySchemes: {\n apiKey: { type: 'apiKey', name: 'api_key', in: 'header' },\n },\n })\n assertType<AuthenticationConfiguration>({\n securitySchemes: {\n bearerAuth: { type: 'http', scheme: 'bearer', bearerFormat: 'JWT' },\n },\n })\n assertType<AuthenticationConfiguration>({\n securitySchemes: {\n oauth2: {\n type: 'oauth2',\n flows: {\n implicit: { scopes: { 'read:items': 'Read access to items' } },\n password: {\n username: 'username',\n password: 'password',\n },\n },\n },\n },\n })\n })\n})\n"],
5
- "mappings": "AAAA,SAAS,YAAY,UAAU,UAAU;AAGzC,SAAS,6BAA6B,MAAM;AAC1C,KAAG,sEAAsE,MAAM;AAC7E,eAAwC,EAAE,yBAAyB,SAAS,CAAC;AAC7E,eAAwC,EAAE,yBAAyB,CAAC,UAAU,YAAY,EAAE,CAAC;AAC7F,eAAwC;AAAA,MACtC,yBAAyB,CAAC,UAAU,CAAC,SAAS,QAAQ,GAAG,CAAC,UAAU,cAAc,QAAQ,CAAC;AAAA,IAC7F,CAAC;AACD,eAAwC;AAAA;AAAA,MAEtC,yBAAyB;AAAA,IAC3B,CAAC;AACD,eAAwC;AAAA;AAAA,MAEtC,yBAAyB,CAAC,IAAI,IAAI;AAAA,IACpC,CAAC;AAAA,EACH,CAAC;AAED,KAAG,8DAA8D,MAAM;AACrE,eAAwC;AAAA,MACtC,iBAAiB;AAAA,QACf,QAAQ,EAAE,MAAM,UAAU,MAAM,WAAW,IAAI,SAAS;AAAA,MAC1D;AAAA,IACF,CAAC;AACD,eAAwC;AAAA,MACtC,iBAAiB;AAAA,QACf,YAAY,EAAE,MAAM,QAAQ,QAAQ,UAAU,cAAc,MAAM;AAAA,MACpE;AAAA,IACF,CAAC;AACD,eAAwC;AAAA,MACtC,iBAAiB;AAAA,QACf,QAAQ;AAAA,UACN,MAAM;AAAA,UACN,OAAO;AAAA,YACL,UAAU,EAAE,QAAQ,EAAE,cAAc,uBAAuB,EAAE;AAAA,YAC7D,UAAU;AAAA,cACR,UAAU;AAAA,cACV,UAAU;AAAA,YACZ;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
4
+ "sourcesContent": ["import { assertType, describe, it } from 'vitest'\n\nimport type { AuthenticationConfiguration } from './authentication-configuration'\n\ndescribe('ApiReferenceConfiguration', () => {\n it('ensure we are generating correct types for preferredSecurityScheme', () => {\n assertType<AuthenticationConfiguration>({ preferredSecurityScheme: 'apiKey' })\n assertType<AuthenticationConfiguration>({ preferredSecurityScheme: ['apiKey', 'bearerAuth'] })\n assertType<AuthenticationConfiguration>({\n preferredSecurityScheme: ['apiKey', ['basic', 'oauth2'], ['apiKey', 'bearerAuth', 'oauth2']],\n })\n assertType<AuthenticationConfiguration>({\n // @ts-expect-error incorrect type\n preferredSecurityScheme: 47,\n })\n assertType<AuthenticationConfiguration>({\n // @ts-expect-error incorrect type\n preferredSecurityScheme: [22, null],\n })\n })\n\n it('ensure we are generating correct types for securitySchemes', () => {\n assertType<AuthenticationConfiguration>({\n securitySchemes: {\n apiKey: { type: 'apiKey', name: 'api_key', in: 'header' },\n },\n })\n assertType<AuthenticationConfiguration>({\n securitySchemes: {\n bearerAuth: { type: 'http', scheme: 'bearer', bearerFormat: 'JWT' },\n },\n })\n assertType<AuthenticationConfiguration>({\n securitySchemes: {\n oauth2: {\n type: 'oauth2',\n flows: {\n implicit: { scopes: { 'read:items': 'Read access to items' } },\n password: {\n username: 'username',\n password: 'password',\n },\n },\n },\n },\n })\n })\n})\n"],
5
+ "mappings": "AAAA,SAAS,YAAY,UAAU,UAAU;AAIzC,SAAS,6BAA6B,MAAM;AAC1C,KAAG,sEAAsE,MAAM;AAC7E,eAAwC,EAAE,yBAAyB,SAAS,CAAC;AAC7E,eAAwC,EAAE,yBAAyB,CAAC,UAAU,YAAY,EAAE,CAAC;AAC7F,eAAwC;AAAA,MACtC,yBAAyB,CAAC,UAAU,CAAC,SAAS,QAAQ,GAAG,CAAC,UAAU,cAAc,QAAQ,CAAC;AAAA,IAC7F,CAAC;AACD,eAAwC;AAAA;AAAA,MAEtC,yBAAyB;AAAA,IAC3B,CAAC;AACD,eAAwC;AAAA;AAAA,MAEtC,yBAAyB,CAAC,IAAI,IAAI;AAAA,IACpC,CAAC;AAAA,EACH,CAAC;AAED,KAAG,8DAA8D,MAAM;AACrE,eAAwC;AAAA,MACtC,iBAAiB;AAAA,QACf,QAAQ,EAAE,MAAM,UAAU,MAAM,WAAW,IAAI,SAAS;AAAA,MAC1D;AAAA,IACF,CAAC;AACD,eAAwC;AAAA,MACtC,iBAAiB;AAAA,QACf,YAAY,EAAE,MAAM,QAAQ,QAAQ,UAAU,cAAc,MAAM;AAAA,MACpE;AAAA,IACF,CAAC;AACD,eAAwC;AAAA,MACtC,iBAAiB;AAAA,QACf,QAAQ;AAAA,UACN,MAAM;AAAA,UACN,OAAO;AAAA,YACL,UAAU,EAAE,QAAQ,EAAE,cAAc,uBAAuB,EAAE;AAAA,YAC7D,UAAU;AAAA,cACR,UAAU;AAAA,cACV,UAAU;AAAA,YACZ;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
6
6
  "names": []
7
7
  }
@@ -39,6 +39,11 @@ export declare const baseConfigurationSchema: z.ZodObject<{
39
39
  }>>;
40
40
  servers: z.ZodOptional<z.ZodArray<z.ZodAny>>;
41
41
  showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
42
+ showDeveloperTools: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
43
+ never: "never";
44
+ always: "always";
45
+ localhost: "localhost";
46
+ }>>>>;
42
47
  showToolbar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
43
48
  never: "never";
44
49
  always: "always";
@@ -68,6 +73,7 @@ export declare const baseConfigurationSchema: z.ZodObject<{
68
73
  elysiajs: "elysiajs";
69
74
  fastify: "fastify";
70
75
  adonisjs: "adonisjs";
76
+ astro: "astro";
71
77
  docusaurus: "docusaurus";
72
78
  dotnet: "dotnet";
73
79
  express: "express";
@@ -1 +1 @@
1
- {"version":3,"file":"base-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/base-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAInB,eAAO,MAAM,aAAa,yCAAyC,CAAA;AACnE,eAAO,MAAM,aAAa,6BAA6B,CAAA;AAEvD,gEAAgE;AAChE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyIlC,CAAA"}
1
+ {"version":3,"file":"base-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/base-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAInB,eAAO,MAAM,aAAa,yCAAyC,CAAA;AACnE,eAAO,MAAM,aAAa,6BAA6B,CAAA;AAEvD,gEAAgE;AAChE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiJlC,CAAA"}
@@ -68,9 +68,16 @@ const baseConfigurationSchema = z.object({
68
68
  * @default true
69
69
  */
70
70
  showSidebar: z.boolean().optional().default(true).catch(true),
71
+ /**
72
+ * Whether and when to show the developer tools.
73
+ *
74
+ * @default 'localhost' to only show the toolbar on localhost or similar hosts
75
+ */
76
+ showDeveloperTools: z.enum(["always", "localhost", "never"]).optional().default("localhost").catch("localhost"),
71
77
  /**
72
78
  * Sets the visibility of the developer tools
73
79
  * @default 'localhost' to only show the toolbar on localhost or similar hosts
80
+ * @deprecated Use showDeveloperTools instead
74
81
  */
75
82
  showToolbar: z.enum(["always", "localhost", "never"]).optional().default("localhost").catch("localhost"),
76
83
  /**
@@ -98,6 +105,7 @@ const baseConfigurationSchema = z.object({
98
105
  /** Integration type identifier */
99
106
  _integration: z.enum([
100
107
  "adonisjs",
108
+ "astro",
101
109
  "docusaurus",
102
110
  "dotnet",
103
111
  "elysiajs",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/api-reference/base-configuration.ts"],
4
- "sourcesContent": ["import z from 'zod'\n\nimport { apiClientPluginSchema } from './api-client-plugin'\n\nexport const OLD_PROXY_URL = 'https://api.scalar.com/request-proxy'\nexport const NEW_PROXY_URL = 'https://proxy.scalar.com'\n\n/** Shared configuration for the Api Reference and Api Client */\nexport const baseConfigurationSchema = z.object({\n /**\n * The title of the OpenAPI document.\n *\n * @example 'Scalar Galaxy'\n */\n title: z.string().optional(),\n /**\n * The slug of the OpenAPI document used in the URL.\n *\n * If none is passed, the title will be used.\n *\n * If no title is used, it'll just use the index.\n *\n * @example 'scalar-galaxy'\n */\n slug: z.string().optional(),\n /** Prefill authentication */\n authentication: z.any().optional(), // Temp until we bring in the new auth\n /** Base URL for the API server */\n baseServerURL: z.string().optional(),\n /**\n * Whether to hide the client button\n * @default false\n */\n hideClientButton: z.boolean().optional().default(false).catch(false),\n /** URL to a request proxy for the API client */\n proxyUrl: z.string().optional(),\n /** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */\n searchHotKey: z\n .enum([\n 'a',\n 'b',\n 'c',\n 'd',\n 'e',\n 'f',\n 'g',\n 'h',\n 'i',\n 'j',\n 'k',\n 'l',\n 'm',\n 'n',\n 'o',\n 'p',\n 'q',\n 'r',\n 's',\n 't',\n 'u',\n 'v',\n 'w',\n 'x',\n 'y',\n 'z',\n ])\n .optional(),\n /** List of OpenAPI server objects */\n servers: z.array(z.any()).optional(), // Using any for OpenAPIV3_1.ServerObject\n /**\n * Whether to show the sidebar\n * @default true\n */\n showSidebar: z.boolean().optional().default(true).catch(true),\n /**\n * Sets the visibility of the developer tools\n * @default 'localhost' to only show the toolbar on localhost or similar hosts\n */\n showToolbar: z.enum(['always', 'localhost', 'never']).optional().default('localhost').catch('localhost'),\n /**\n * Whether to use the operation summary or the operation path for the sidebar and search\n * @default 'summary'\n */\n operationTitleSource: z.enum(['summary', 'path']).optional().default('summary').catch('summary'),\n /** A string to use one of the color presets */\n theme: z\n .enum([\n 'alternate',\n 'default',\n 'moon',\n 'purple',\n 'solarized',\n 'bluePlanet',\n 'deepSpace',\n 'saturn',\n 'kepler',\n 'elysiajs',\n 'fastify',\n 'mars',\n 'laserwave',\n 'none',\n ])\n .optional()\n .default('default')\n .catch('default'),\n /** Integration type identifier */\n _integration: z\n .enum([\n 'adonisjs',\n 'docusaurus',\n 'dotnet',\n 'elysiajs',\n 'express',\n 'fastapi',\n 'fastify',\n 'go',\n 'hono',\n 'html',\n 'laravel',\n 'litestar',\n 'nestjs',\n 'nextjs',\n 'nitro',\n 'nuxt',\n 'platformatic',\n 'react',\n 'rust',\n 'svelte',\n 'vue',\n ])\n .nullable()\n .optional(),\n /** onRequestSent is fired when a request is sent */\n onRequestSent: z\n .function({\n input: [z.string()],\n output: z.void(),\n })\n .optional(),\n /** Whether to persist auth to local storage */\n persistAuth: z.boolean().optional().default(false).catch(false),\n /** Plugins for the API client */\n plugins: z.array(apiClientPluginSchema).optional(),\n /** Enables / disables telemetry*/\n telemetry: z.boolean().optional().default(true),\n})\n"],
5
- "mappings": "AAAA,OAAO,OAAO;AAEd,SAAS,6BAA6B;AAE/B,MAAM,gBAAgB;AACtB,MAAM,gBAAgB;AAGtB,MAAM,0BAA0B,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9C,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAU3B,MAAM,EAAE,OAAO,EAAE,SAAS;AAA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AAAA,IACA;AAAA,EACF,CAAC,EACA,SAAS,EACT,QAAQ,SAAS,EACjB,MAAM,SAAS;AAAA;AAAA,EAElB,cAAc,EACX,KAAK;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,EACA,SAAS,EACT,SAAS;AAAA;AAAA,EAEZ,eAAe,EACZ,SAAS;AAAA,IACR,OAAO,CAAC,EAAE,OAAO,CAAC;AAAA,IAClB,QAAQ,EAAE,KAAK;AAAA,EACjB,CAAC,EACA,SAAS;AAAA;AAAA,EAEZ,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAK,EAAE,MAAM,KAAK;AAAA;AAAA,EAE9D,SAAS,EAAE,MAAM,qBAAqB,EAAE,SAAS;AAAA;AAAA,EAEjD,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,IAAI;AAChD,CAAC;",
4
+ "sourcesContent": ["import z from 'zod'\n\nimport { apiClientPluginSchema } from './api-client-plugin'\n\nexport const OLD_PROXY_URL = 'https://api.scalar.com/request-proxy'\nexport const NEW_PROXY_URL = 'https://proxy.scalar.com'\n\n/** Shared configuration for the Api Reference and Api Client */\nexport const baseConfigurationSchema = z.object({\n /**\n * The title of the OpenAPI document.\n *\n * @example 'Scalar Galaxy'\n */\n title: z.string().optional(),\n /**\n * The slug of the OpenAPI document used in the URL.\n *\n * If none is passed, the title will be used.\n *\n * If no title is used, it'll just use the index.\n *\n * @example 'scalar-galaxy'\n */\n slug: z.string().optional(),\n /** Prefill authentication */\n authentication: z.any().optional(), // Temp until we bring in the new auth\n /** Base URL for the API server */\n baseServerURL: z.string().optional(),\n /**\n * Whether to hide the client button\n * @default false\n */\n hideClientButton: z.boolean().optional().default(false).catch(false),\n /** URL to a request proxy for the API client */\n proxyUrl: z.string().optional(),\n /** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */\n searchHotKey: z\n .enum([\n 'a',\n 'b',\n 'c',\n 'd',\n 'e',\n 'f',\n 'g',\n 'h',\n 'i',\n 'j',\n 'k',\n 'l',\n 'm',\n 'n',\n 'o',\n 'p',\n 'q',\n 'r',\n 's',\n 't',\n 'u',\n 'v',\n 'w',\n 'x',\n 'y',\n 'z',\n ])\n .optional(),\n /** List of OpenAPI server objects */\n servers: z.array(z.any()).optional(), // Using any for OpenAPIV3_1.ServerObject\n /**\n * Whether to show the sidebar\n * @default true\n */\n showSidebar: z.boolean().optional().default(true).catch(true),\n /**\n * Whether and when to show the developer tools.\n *\n * @default 'localhost' to only show the toolbar on localhost or similar hosts\n */\n showDeveloperTools: z.enum(['always', 'localhost', 'never']).optional().default('localhost').catch('localhost'),\n /**\n * Sets the visibility of the developer tools\n * @default 'localhost' to only show the toolbar on localhost or similar hosts\n * @deprecated Use showDeveloperTools instead\n */\n showToolbar: z.enum(['always', 'localhost', 'never']).optional().default('localhost').catch('localhost'),\n /**\n * Whether to use the operation summary or the operation path for the sidebar and search\n * @default 'summary'\n */\n operationTitleSource: z.enum(['summary', 'path']).optional().default('summary').catch('summary'),\n /** A string to use one of the color presets */\n theme: z\n .enum([\n 'alternate',\n 'default',\n 'moon',\n 'purple',\n 'solarized',\n 'bluePlanet',\n 'deepSpace',\n 'saturn',\n 'kepler',\n 'elysiajs',\n 'fastify',\n 'mars',\n 'laserwave',\n 'none',\n ])\n .optional()\n .default('default')\n .catch('default'),\n /** Integration type identifier */\n _integration: z\n .enum([\n 'adonisjs',\n 'astro',\n 'docusaurus',\n 'dotnet',\n 'elysiajs',\n 'express',\n 'fastapi',\n 'fastify',\n 'go',\n 'hono',\n 'html',\n 'laravel',\n 'litestar',\n 'nestjs',\n 'nextjs',\n 'nitro',\n 'nuxt',\n 'platformatic',\n 'react',\n 'rust',\n 'svelte',\n 'vue',\n ])\n .nullable()\n .optional(),\n /** onRequestSent is fired when a request is sent */\n onRequestSent: z\n .function({\n input: [z.string()],\n output: z.void(),\n })\n .optional(),\n /** Whether to persist auth to local storage */\n persistAuth: z.boolean().optional().default(false).catch(false),\n /** Plugins for the API client */\n plugins: z.array(apiClientPluginSchema).optional(),\n /** Enables / disables telemetry*/\n telemetry: z.boolean().optional().default(true),\n})\n"],
5
+ "mappings": "AAAA,OAAO,OAAO;AAEd,SAAS,6BAA6B;AAE/B,MAAM,gBAAgB;AACtB,MAAM,gBAAgB;AAGtB,MAAM,0BAA0B,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9C,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAU3B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAE1B,gBAAgB,EAAE,IAAI,EAAE,SAAS;AAAA;AAAA;AAAA,EAEjC,eAAe,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAKnC,kBAAkB,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAK,EAAE,MAAM,KAAK;AAAA;AAAA,EAEnE,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAE9B,cAAc,EACX,KAAK;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,EACA,SAAS;AAAA;AAAA,EAEZ,SAAS,EAA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AE,KAAK;AAAA,EACjB,CAAC,EACA,SAAS;AAAA;AAAA,EAEZ,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAK,EAAE,MAAM,KAAK;AAAA;AAAA,EAE9D,SAAS,EAAE,MAAM,qBAAqB,EAAE,SAAS;AAAA;AAAA,EAEjD,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,IAAI;AAChD,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  export { type ApiClientConfiguration, apiClientConfigurationSchema, } from './api-client-configuration.js';
2
2
  export { type ApiClientPlugin, apiClientPluginSchema, hooksSchema } from './api-client-plugin.js';
3
- export { type AnyApiReferenceConfiguration, type ApiReferenceConfiguration, type ApiReferenceConfigurationWithDefault, type ApiReferenceConfigurationWithMultipleSources, type ApiReferenceConfigurationWithSource, apiReferenceConfigurationSchema, apiReferenceConfigurationWithSourceSchema, isConfigurationWithSources, } from './api-reference-configuration.js';
4
- export type { ApiReferencePlugin, SpecificationExtension, } from './api-reference-plugin.js';
3
+ export { type AnyApiReferenceConfiguration, type ApiReferenceConfiguration, type ApiReferenceConfigurationRaw, type ApiReferenceConfigurationWithMultipleSources, type ApiReferenceConfigurationWithSource, apiReferenceConfigurationSchema, apiReferenceConfigurationWithSourceSchema, isConfigurationWithSources, } from './api-reference-configuration.js';
4
+ export type { ApiReferencePlugin, SpecificationExtension, ViewComponent, } from './api-reference-plugin.js';
5
5
  export type { ApiReferenceInstance, CreateApiReference } from './html-api.js';
6
6
  export { type HtmlRenderingConfiguration, htmlRenderingConfigurationSchema, } from './html-rendering-configuration.js';
7
7
  export { type SourceConfiguration, sourceConfigurationSchema, } from './source-configuration.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api-reference/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,sBAAsB,EAC3B,4BAA4B,GAC7B,MAAM,4BAA4B,CAAA;AACnC,OAAO,E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,wBAAwB,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/api-reference/index.ts"],
4
- "sourcesContent": ["// biome-ignore lint/performance/noBarrelFile: exporting from a block\nexport {\n type ApiClientConfiguration,\n apiClientConfigurationSchema,\n} from './api-client-configuration'\nexport { type ApiClientPlugin, apiClientPluginSchema, hooksSchema } from './api-client-plugin'\nexport {\n type AnyApiReferenceConfiguration,\n type ApiReferenceConfiguration,\n type ApiReferenceConfigurationWithDefault,\n type ApiReferenceConfigurationWithMultipleSources,\n type ApiReferenceConfigurationWithSource,\n apiReferenceConfigurationSchema,\n apiReferenceConfigurationWithSourceSchema,\n isConfigurationWithSources,\n} from './api-reference-configuration'\nexport type {\n ApiReferencePlugin,\n SpecificationExtension,\n} from './api-reference-plugin'\nexport type { ApiReferenceInstance, CreateApiReference } from './html-api'\nexport {\n type HtmlRenderingConfiguration,\n htmlRenderingConfigurationSchema,\n} from './html-rendering-configuration'\nexport {\n type SourceConfiguration,\n sourceConfigurationSchema,\n} from './source-configuration'\n"],
5
- "mappings": "AACA;AAAA,EAEE;AAAA,OACK;AACP,SAA+B,uBAAuB,mBAAmB;AACzE;AAAA,EAME;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP;AAAA,EAEE;AAAA,OACK;AACP;AAAA,EAEE;AAAA,OACK;",
4
+ "sourcesContent": ["// biome-ignore lint/performance/noBarrelFile: exporting from a block\nexport {\n type ApiClientConfiguration,\n apiClientConfigurationSchema,\n} from './api-client-configuration'\nexport { type ApiClientPlugin, apiClientPluginSchema, hooksSchema } from './api-client-plugin'\nexport {\n type AnyApiReferenceConfiguration,\n type ApiReferenceConfiguration,\n type ApiReferenceConfigurationRaw,\n type ApiReferenceConfigurationWithMultipleSources,\n type ApiReferenceConfigurationWithSource,\n apiReferenceConfigurationSchema,\n apiReferenceConfigurationWithSourceSchema,\n isConfigurationWithSources,\n} from './api-reference-configuration'\nexport type {\n ApiReferencePlugin,\n SpecificationExtension,\n ViewComponent,\n} from './api-reference-plugin'\nexport type { ApiReferenceInstance, CreateApiReference } from './html-api'\nexport {\n type HtmlRenderingConfiguration,\n htmlRenderingConfigurationSchema,\n} from './html-rendering-configuration'\nexport {\n type SourceConfiguration,\n sourceConfigurationSchema,\n} from './source-configuration'\n"],
5
+ "mappings": "AACA;AAAA,EAEE;AAAA,OACK;AACP,SAA+B,uBAAuB,mBAAmB;AACzE;AAAA,EAME;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOP;AAAA,EAEE;AAAA,OACK;AACP;AAAA,EAEE;AAAA,OACK;",
6
6
  "names": []
7
7
  }
@@ -5,6 +5,7 @@ import z from 'zod';
5
5
  * or used independently. Some configurations may have multiple sources.
6
6
  */
7
7
  export declare const sourceConfigurationSchema: z.ZodObject<{
8
+ default: z.ZodCatch<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
8
9
  url: z.ZodOptional<z.ZodString>;
9
10
  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>>]>>;
10
11
  title: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"source-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/source-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;iBAuFpC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}
1
+ {"version":3,"file":"source-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/source-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;iBAwFpC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}