@scalar/cli 1.9.4 → 1.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/docs.html +124 -97
  2. package/index.js +89 -774
  3. package/package.json +10 -10
package/index.js CHANGED
@@ -68957,12 +68957,15 @@ function ansiRegex({ onlyFirst = false } = {}) {
68957
68957
  return new RegExp(pattern, onlyFirst ? void 0 : "g");
68958
68958
  }
68959
68959
 
68960
- // ../../node_modules/.pnpm/strip-ansi@7.1.2/node_modules/strip-ansi/index.js
68960
+ // ../../node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.js
68961
68961
  var regex = ansiRegex();
68962
68962
  function stripAnsi(string4) {
68963
68963
  if (typeof string4 !== "string") {
68964
68964
  throw new TypeError(`Expected a \`string\`, got \`${typeof string4}\``);
68965
68965
  }
68966
+ if (!string4.includes("\x1B") && !string4.includes("\x9B")) {
68967
+ return string4;
68968
+ }
68966
68969
  return string4.replace(regex, "");
68967
68970
  }
68968
68971
 
@@ -69164,7 +69167,7 @@ import { Command as Command50 } from "commander";
69164
69167
 
69165
69168
  // package.json
69166
69169
  var name = "@scalar/cli";
69167
- var version = "1.9.4";
69170
+ var version = "1.9.6";
69168
69171
  var bin = {
69169
69172
  scalar: "./dist/index.js",
69170
69173
  "scalar-cli": "./dist/index.js"
@@ -86455,7 +86458,7 @@ function compareVersionsDesc(a, b) {
86455
86458
  return b.localeCompare(a);
86456
86459
  }
86457
86460
  var regexSlug = /^[a-z](?:[a-z0-9-]*[a-z0-9])?$/;
86458
- var slugSchema = external_exports.string().min(1, "Slug is required").min(3, "Slug must be at least 3 characters").max(60, "Slug must be less than 60 characters").regex(regexSlug, {
86461
+ var slugSchema = external_exports.string().min(1, "Slug is required").max(60, "Slug must be less than 60 characters").regex(regexSlug, {
86459
86462
  message: "Slug can have lowercase letters, digits, or hyphens. It must start with a lowercase letter and end with a letter or number."
86460
86463
  }).meta({ id: "slug" });
86461
86464
  var toRegistrySlug = (title) => {
@@ -86696,14 +86699,16 @@ var siteDeploySchema = entitySchema.extend({
86696
86699
 
86697
86700
  // ../../packages/entities/dist/login-portals/customization.js
86698
86701
  var loginPortalEmailSchema = external_exports.object({
86702
+ /** @deprecated No longer rendered in the email template */
86699
86703
  logo: external_exports.string().default(""),
86704
+ /** @deprecated No longer rendered in the email template */
86700
86705
  logoSize: external_exports.string().default("100"),
86701
86706
  buttonText: external_exports.string().max(50).default("Login"),
86702
86707
  message: external_exports.string().max(1e3).default("Click to access private documentation hosted by scalar.com"),
86703
86708
  title: external_exports.string().max(100).default("Private Docs"),
86704
86709
  mainColor: external_exports.string().max(100).default("#2a2f45"),
86705
86710
  mainBackground: external_exports.string().max(100).default("#f6f6f6"),
86706
- cardColor: external_exports.string().max(100).default("2a2f45"),
86711
+ cardColor: external_exports.string().max(100).default("#2a2f45"),
86707
86712
  cardBackground: external_exports.string().max(100).default("#fff"),
86708
86713
  buttonColor: external_exports.string().max(100).default("#fff"),
86709
86714
  buttonBackground: external_exports.string().max(100).default("#0f0f0f")
@@ -86976,7 +86981,7 @@ var monthlyUsageSchema = zod_default.object({
86976
86981
  messages: zod_default.number()
86977
86982
  }).meta({ id: "monthly-usage" });
86978
86983
 
86979
- // ../../node_modules/.pnpm/@scalar+helpers@0.6.0/node_modules/@scalar/helpers/dist/http/http-methods.js
86984
+ // ../../node_modules/.pnpm/@scalar+helpers@0.8.0/node_modules/@scalar/helpers/dist/http/http-methods.js
86980
86985
  var HTTP_METHODS = ["delete", "get", "head", "options", "patch", "post", "put", "trace"];
86981
86986
  var httpMethods = Object.freeze(new Set(HTTP_METHODS));
86982
86987
 
@@ -87687,10 +87692,9 @@ var githubRepositorySchema = external_exports.object({
87687
87692
  linkedBy: external_exports.string(),
87688
87693
  installationId: external_exports.number().int(),
87689
87694
  id: external_exports.number().int(),
87690
- /** `owner/repo` form from the GitHub API */
87691
87695
  name: external_exports.string().min(2),
87692
87696
  branch: external_exports.string().default("main"),
87693
- configPath: external_exports.string().default(""),
87697
+ configPath: external_exports.string().default("scalar.config.json"),
87694
87698
  publishOnMerge: external_exports.boolean().default(true),
87695
87699
  publishPreviews: external_exports.boolean().default(false),
87696
87700
  prComments: external_exports.boolean().default(false),
@@ -87706,7 +87710,7 @@ var bitbucketRepositorySchema = external_exports.object({
87706
87710
  /** `workspaceSlug/repoSlug` for display, mirrored from GitHub for symmetry */
87707
87711
  name: external_exports.string().min(2),
87708
87712
  branch: external_exports.string().default("main"),
87709
- configPath: external_exports.string().default(""),
87713
+ configPath: external_exports.string().default("scalar.config.json"),
87710
87714
  publishOnMerge: external_exports.boolean().default(true),
87711
87715
  publishPreviews: external_exports.boolean().default(false),
87712
87716
  prComments: external_exports.boolean().default(false),
@@ -90372,11 +90376,11 @@ function docsProjectApiFactory(requestService) {
90372
90376
  })
90373
90377
  });
90374
90378
  }
90375
- async function updateConfigPath(projectUid, configPath) {
90379
+ async function updateRepoSettings(projectUid, patch) {
90376
90380
  return await requestService.request({
90377
- url: "core/docs-projects/update-config-path",
90381
+ url: "core/docs-projects/update-repo-settings",
90378
90382
  method: "post",
90379
- data: { projectUid, configPath },
90383
+ data: { projectUid, ...patch },
90380
90384
  schema: external_exports.null()
90381
90385
  });
90382
90386
  }
@@ -90439,7 +90443,7 @@ function docsProjectApiFactory(requestService) {
90439
90443
  deleteProject,
90440
90444
  getProject,
90441
90445
  getGitCredentials,
90442
- updateConfigPath,
90446
+ updateRepoSettings,
90443
90447
  linkGithub,
90444
90448
  unlinkGithub,
90445
90449
  linkBitbucket,
@@ -90904,6 +90908,45 @@ function publishApiFactory(requestService) {
90904
90908
  schema: external_exports.object({ publishUid: nanoidSchema })
90905
90909
  });
90906
90910
  }
90911
+ async function createPreviewSandbox() {
90912
+ return await requestService.request({
90913
+ url: "publish-deploy/preview-sandbox",
90914
+ method: "post",
90915
+ schema: external_exports.object({
90916
+ sandboxId: external_exports.string(),
90917
+ gitUrl: external_exports.string()
90918
+ })
90919
+ });
90920
+ }
90921
+ async function startPreviewSandboxServer({ sandboxId, configPath }) {
90922
+ return await requestService.request({
90923
+ url: "publish-deploy/preview-sandbox/start-server",
90924
+ method: "post",
90925
+ data: { sandboxId, configPath },
90926
+ schema: external_exports.object({
90927
+ previewUrl: external_exports.string()
90928
+ })
90929
+ });
90930
+ }
90931
+ async function stopPreviewSandbox({ sandboxId, keepalive }) {
90932
+ return await requestService.request({
90933
+ url: "publish-deploy/preview-sandbox/stop",
90934
+ method: "post",
90935
+ data: { sandboxId },
90936
+ schema: external_exports.null(),
90937
+ ...keepalive && { keepalive: true }
90938
+ });
90939
+ }
90940
+ async function getPreviewSandboxLog({ sandboxId }) {
90941
+ return await requestService.request({
90942
+ url: "publish-deploy/preview-sandbox/log",
90943
+ method: "post",
90944
+ data: { sandboxId },
90945
+ schema: external_exports.object({
90946
+ log: external_exports.string().nullable()
90947
+ })
90948
+ });
90949
+ }
90907
90950
  async function checkDNSRecords(domain2) {
90908
90951
  return await requestService.request({
90909
90952
  url: "core/publish/dns-check",
@@ -91032,6 +91075,10 @@ function publishApiFactory(requestService) {
91032
91075
  publishGithub: publishGithub2,
91033
91076
  publishTemplate,
91034
91077
  publishWysiwyg,
91078
+ createPreviewSandbox,
91079
+ startPreviewSandboxServer,
91080
+ stopPreviewSandbox,
91081
+ getPreviewSandboxLog,
91035
91082
  exportWysiwyg,
91036
91083
  checkDNSRecords,
91037
91084
  unpublish,
@@ -91440,7 +91487,7 @@ var config2 = {
91440
91487
  }
91441
91488
  },
91442
91489
  cdnUrl: process.env.CDN_URL ?? "https://cdn.scalar.com",
91443
- ssgDocsIsolateVersion: process.env.SSG_DOCS_ISOLATE_VERSION ?? "1.4.1"
91490
+ ssgDocsIsolateVersion: process.env.SSG_DOCS_ISOLATE_VERSION ?? "1.4.2"
91444
91491
  };
91445
91492
 
91446
91493
  // src/domains/auth/login/helpers/personal-token-generate-access.ts
@@ -94423,747 +94470,6 @@ var internalLinkNavigationEntrySchema = linkNavigationEntrySchema.extend({
94423
94470
  uid: nanoidSchema
94424
94471
  });
94425
94472
 
94426
- // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/api-reference/api-client-plugin.js
94427
- var sectionViewSchema = external_exports.object({
94428
- title: external_exports.string().optional(),
94429
- // Since this is meant to be a Vue component, we'll use unknown
94430
- component: external_exports.unknown(),
94431
- props: external_exports.record(external_exports.string(), external_exports.any()).optional()
94432
- });
94433
- var viewsSchema = external_exports.object({
94434
- "request.section": external_exports.array(sectionViewSchema).optional(),
94435
- "response.section": external_exports.array(sectionViewSchema).optional()
94436
- });
94437
- var hooksSchema = external_exports.object({
94438
- onBeforeRequest: external_exports.function({
94439
- input: [external_exports.object({ request: external_exports.any() })]
94440
- // Why no output? https://github.com/scalar/scalar/pull/7047
94441
- // output: z.union([z.void(), z.promise(z.void())]),
94442
- }).optional(),
94443
- onResponseReceived: external_exports.function({
94444
- input: [external_exports.object({ response: external_exports.instanceof(Response), operation: external_exports.record(external_exports.string(), external_exports.any()) })]
94445
- // Why no output? https://github.com/scalar/scalar/pull/7047
94446
- // output: z.union([z.void(), z.promise(z.void())]),
94447
- }).optional()
94448
- });
94449
- var apiClientPluginSchema = external_exports.function({
94450
- input: [],
94451
- output: external_exports.object({
94452
- name: external_exports.string(),
94453
- views: viewsSchema.optional(),
94454
- hooks: hooksSchema.optional()
94455
- })
94456
- });
94457
-
94458
- // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/api-reference/base-configuration.js
94459
- var externalUrlsSchema = zod_default.object({
94460
- dashboardUrl: zod_default.string().prefault("https://dashboard.scalar.com"),
94461
- registryUrl: zod_default.string().prefault("https://registry.scalar.com"),
94462
- proxyUrl: zod_default.string().prefault("https://proxy.scalar.com"),
94463
- apiBaseUrl: zod_default.string().prefault("https://api.scalar.com")
94464
- });
94465
- var OLD_PROXY_URL = "https://api.scalar.com/request-proxy";
94466
- var NEW_PROXY_URL = "https://proxy.scalar.com";
94467
- var baseConfigurationSchema = zod_default.object({
94468
- /**
94469
- * The title of the OpenAPI document.
94470
- *
94471
- * @example 'Scalar Galaxy'
94472
- */
94473
- title: zod_default.string().optional(),
94474
- /**
94475
- * The slug of the OpenAPI document used in the URL.
94476
- *
94477
- * If none is passed, the title will be used.
94478
- *
94479
- * If no title is used, it'll just use the index.
94480
- *
94481
- * @example 'scalar-galaxy'
94482
- */
94483
- slug: zod_default.string().optional(),
94484
- /** Prefill authentication */
94485
- authentication: zod_default.any().optional(),
94486
- // Temp until we bring in the new auth
94487
- /** Base URL for the API server */
94488
- baseServerURL: zod_default.string().optional(),
94489
- /**
94490
- * Whether to hide the client button
94491
- * @default false
94492
- */
94493
- hideClientButton: zod_default.boolean().optional().default(false).catch(false),
94494
- /** URL to a request proxy for the API client */
94495
- proxyUrl: zod_default.string().optional(),
94496
- /**
94497
- * Default OAuth 2.0 redirect URI used to prefill auth flows in the API client.
94498
- *
94499
- * This is especially useful in desktop wrappers (for example Electron),
94500
- * where `window.location` can be a `file://` URL that OAuth providers reject.
94501
- */
94502
- oauth2RedirectUri: zod_default.string().optional(),
94503
- /** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */
94504
- searchHotKey: zod_default.enum([
94505
- "a",
94506
- "b",
94507
- "c",
94508
- "d",
94509
- "e",
94510
- "f",
94511
- "g",
94512
- "h",
94513
- "i",
94514
- "j",
94515
- "k",
94516
- "l",
94517
- "m",
94518
- "n",
94519
- "o",
94520
- "p",
94521
- "q",
94522
- "r",
94523
- "s",
94524
- "t",
94525
- "u",
94526
- "v",
94527
- "w",
94528
- "x",
94529
- "y",
94530
- "z"
94531
- ]).optional(),
94532
- /** List of OpenAPI server objects */
94533
- servers: zod_default.array(zod_default.any()).optional(),
94534
- // Using any for OpenAPIV3_1.ServerObject
94535
- /**
94536
- * Whether to show the sidebar
94537
- * @default true
94538
- */
94539
- showSidebar: zod_default.boolean().optional().default(true).catch(true),
94540
- /**
94541
- * Whether and when to show the developer tools.
94542
- *
94543
- * @default 'localhost' to only show the toolbar on localhost or similar hosts
94544
- */
94545
- showDeveloperTools: zod_default.enum(["always", "localhost", "never"]).optional().default("localhost").catch("localhost"),
94546
- /**
94547
- * Sets the visibility of the developer tools
94548
- * @default 'localhost' to only show the toolbar on localhost or similar hosts
94549
- * @deprecated Use showDeveloperTools instead
94550
- */
94551
- showToolbar: zod_default.enum(["always", "localhost", "never"]).optional().default("localhost").catch("localhost"),
94552
- /**
94553
- * Whether to use the operation summary or the operation path for the sidebar and search
94554
- * @default 'summary'
94555
- */
94556
- operationTitleSource: zod_default.enum(["summary", "path"]).optional().default("summary").catch("summary"),
94557
- /** A string to use one of the color presets */
94558
- theme: zod_default.enum([
94559
- "alternate",
94560
- "default",
94561
- "moon",
94562
- "purple",
94563
- "solarized",
94564
- "bluePlanet",
94565
- "deepSpace",
94566
- "saturn",
94567
- "kepler",
94568
- "elysiajs",
94569
- "fastify",
94570
- "mars",
94571
- "laserwave",
94572
- "none"
94573
- ]).optional().default("default").catch("default"),
94574
- /** Integration type identifier */
94575
- _integration: zod_default.enum([
94576
- "adonisjs",
94577
- "astro",
94578
- "docusaurus",
94579
- "dotnet",
94580
- "elysiajs",
94581
- "express",
94582
- "fastapi",
94583
- "fastify",
94584
- "go",
94585
- "hono",
94586
- "html",
94587
- "laravel",
94588
- "litestar",
94589
- "nestjs",
94590
- "nextjs",
94591
- "nitro",
94592
- "nuxt",
94593
- "platformatic",
94594
- "react",
94595
- "rust",
94596
- "svelte",
94597
- "vue"
94598
- ]).nullable().optional(),
94599
- /** onRequestSent is fired when a request is sent */
94600
- onRequestSent: zod_default.function({
94601
- input: [zod_default.string()],
94602
- output: zod_default.void()
94603
- }).optional(),
94604
- /** Whether to persist auth to local storage */
94605
- persistAuth: zod_default.boolean().optional().default(false).catch(false),
94606
- /** Plugins for the API client */
94607
- plugins: zod_default.array(apiClientPluginSchema).optional(),
94608
- /** Enables / disables telemetry */
94609
- telemetry: zod_default.boolean().optional().default(true),
94610
- /** A bunch of external URLs to Scalar's services. */
94611
- externalUrls: externalUrlsSchema.prefault({})
94612
- });
94613
-
94614
- // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/api-reference/source-configuration.js
94615
- var sourceConfigurationSchema = zod_default.object({
94616
- default: zod_default.boolean().default(false).optional().catch(false),
94617
- /**
94618
- * URL to an OpenAPI/Swagger document
94619
- * @example
94620
- * ```ts
94621
- * const oldConfiguration = {
94622
- * spec: {
94623
- * url: 'https://example.com/openapi.json',
94624
- * },
94625
- * }
94626
- *
94627
- * const newConfiguration = {
94628
- * url: 'https://example.com/openapi.json',
94629
- * }
94630
- * ```
94631
- **/
94632
- url: zod_default.string().optional(),
94633
- /**
94634
- * Directly embed the OpenAPI document.
94635
- * Can be a string, object, function returning an object, or null.
94636
- *
94637
- * @remarks It's recommended to pass a URL instead of content.
94638
- * @example
94639
- * ```ts
94640
- * const oldConfiguration = {
94641
- * spec: {
94642
- * content: '…',
94643
- * },
94644
- * }
94645
- *
94646
- * const newConfiguration = {
94647
- * content: '…',
94648
- * }
94649
- * ```
94650
- **/
94651
- content: zod_default.union([
94652
- zod_default.string(),
94653
- zod_default.null(),
94654
- zod_default.record(zod_default.string(), zod_default.any()),
94655
- zod_default.function({
94656
- input: [],
94657
- output: zod_default.record(zod_default.string(), zod_default.any())
94658
- })
94659
- ]).optional(),
94660
- /**
94661
- * The title of the OpenAPI document.
94662
- *
94663
- * @example 'Scalar Galaxy'
94664
- *
94665
- * @deprecated Please move `title` to the top level and remove the `spec` prefix.
94666
- */
94667
- title: zod_default.string().optional(),
94668
- /**
94669
- * The slug of the OpenAPI document used in the URL.
94670
- *
94671
- * If none is passed, the title will be used.
94672
- *
94673
- * If no title is used, it'll just use the index.
94674
- *
94675
- * @example 'scalar-galaxy'
94676
- *
94677
- * @deprecated Please move `slug` to the top level and remove the `spec` prefix.
94678
- */
94679
- slug: zod_default.string().optional(),
94680
- /**
94681
- * The OpenAPI/Swagger document to render
94682
- *
94683
- * @deprecated Use `url` and `content` on the top level instead.
94684
- **/
94685
- spec: zod_default.object({
94686
- url: zod_default.string().optional(),
94687
- content: zod_default.union([
94688
- zod_default.string(),
94689
- zod_default.null(),
94690
- zod_default.record(zod_default.string(), zod_default.any()),
94691
- zod_default.function({
94692
- input: [],
94693
- output: zod_default.record(zod_default.string(), zod_default.any())
94694
- })
94695
- ]).optional()
94696
- }).optional(),
94697
- /**
94698
- * Agent Scalar configuration
94699
- **/
94700
- agent: zod_default.object({
94701
- key: zod_default.string().optional(),
94702
- disabled: zod_default.boolean().optional(),
94703
- /**
94704
- * When true, hide the control to add more APIs in the agent chat.
94705
- * Only preloaded/registry documents are shown; the public API list is not offered.
94706
- */
94707
- hideAddApi: zod_default.boolean().optional()
94708
- }).optional()
94709
- });
94710
-
94711
- // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/api-reference/api-client-configuration.js
94712
- var apiClientConfigurationSchema = baseConfigurationSchema.extend(sourceConfigurationSchema.shape);
94713
-
94714
- // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/api-reference/api-reference-plugin.js
94715
- var openApiExtensionSchema = external_exports.object({
94716
- /**
94717
- * Name of specification extension property. Has to start with `x-`.
94718
- *
94719
- * @example
94720
- * ```yaml
94721
- * x-custom-extension: foobar
94722
- * ```
94723
- */
94724
- name: external_exports.string().regex(/^x-/),
94725
- /**
94726
- * Vue component to render the specification extension
94727
- */
94728
- component: external_exports.unknown(),
94729
- /**
94730
- * Custom renderer to render the specification extension
94731
- */
94732
- renderer: external_exports.unknown().optional()
94733
- });
94734
- var viewComponentSchema = external_exports.object({
94735
- /**
94736
- * Vue component to render in the view
94737
- */
94738
- component: external_exports.unknown(),
94739
- /**
94740
- * Custom renderer to render the view component (e.g., ReactRenderer)
94741
- */
94742
- renderer: external_exports.unknown().optional(),
94743
- /**
94744
- * Additional props to pass to the component
94745
- */
94746
- props: external_exports.record(external_exports.string(), external_exports.any()).optional()
94747
- });
94748
- var viewsSchema2 = external_exports.object({
94749
- /**
94750
- * Renders after the Models section
94751
- */
94752
- "content.end": external_exports.array(viewComponentSchema).optional()
94753
- });
94754
- var lifecycleHooksSchema = external_exports.object({
94755
- /** Called when the API Reference is initialized */
94756
- onInit: external_exports.function({
94757
- input: [external_exports.object({ config: baseConfigurationSchema.partial() })]
94758
- }).optional(),
94759
- /** Called when the API Reference configuration changes */
94760
- onConfigChange: external_exports.function({
94761
- input: [external_exports.object({ config: baseConfigurationSchema.partial() })]
94762
- }).optional(),
94763
- /** Called when the API Reference is destroyed */
94764
- onDestroy: external_exports.function({ input: [] }).optional()
94765
- });
94766
- var apiReferencePluginSchema = external_exports.function({
94767
- input: [],
94768
- output: external_exports.object({
94769
- name: external_exports.string(),
94770
- extensions: external_exports.array(openApiExtensionSchema),
94771
- /**
94772
- * Components to render at specific views in the API Reference
94773
- */
94774
- views: viewsSchema2.optional(),
94775
- /**
94776
- * Lifecycle hooks for the plugin
94777
- */
94778
- hooks: lifecycleHooksSchema.optional(),
94779
- /**
94780
- * Client plugins to pass to the embedded API client.
94781
- * Use this to extend the API client from an API reference plugin.
94782
- */
94783
- apiClientPlugins: external_exports.array(external_exports.any()).optional()
94784
- })
94785
- });
94786
-
94787
- // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/api-reference/api-reference-configuration.js
94788
- var fetchLikeSchema = external_exports.custom();
94789
- var apiReferenceConfigurationSchema = baseConfigurationSchema.extend({
94790
- /**
94791
- * The layout to use for the references
94792
- * @default 'modern'
94793
- */
94794
- layout: external_exports.enum(["modern", "classic"]).optional().default("modern").catch("modern"),
94795
- /**
94796
- * URL to a request proxy for the API client
94797
- * @deprecated Use proxyUrl instead
94798
- */
94799
- proxy: external_exports.string().optional(),
94800
- /**
94801
- * Custom fetch function for custom logic
94802
- *
94803
- * Can be used to add custom headers, handle auth, etc.
94804
- */
94805
- fetch: fetchLikeSchema.optional(),
94806
- /**
94807
- * Plugins for the API reference
94808
- */
94809
- plugins: external_exports.array(apiReferencePluginSchema).optional(),
94810
- /**
94811
- * Allows the user to inject an editor for the spec
94812
- * @default false
94813
- */
94814
- isEditable: external_exports.boolean().optional().default(false).catch(false),
94815
- /**
94816
- * Controls whether the references show a loading state in the intro
94817
- * @default false
94818
- */
94819
- isLoading: external_exports.boolean().optional().default(false).catch(false),
94820
- /**
94821
- * Whether to show models in the sidebar, search, and content.
94822
- * @default false
94823
- */
94824
- hideModels: external_exports.boolean().optional().default(false).catch(false),
94825
- /**
94826
- * Sets the file type of the document to download, set to `none` to hide the download button
94827
- * @default 'both'
94828
- */
94829
- documentDownloadType: external_exports.enum(["yaml", "json", "both", "direct", "none"]).optional().default("both").catch("both"),
94830
- /**
94831
- * Whether to show the "Download OpenAPI Document" button
94832
- * @default false
94833
- * @deprecated Use `documentDownloadType: 'none'` instead
94834
- */
94835
- hideDownloadButton: external_exports.boolean().optional(),
94836
- /**
94837
- * Whether to show the "Test Request" button
94838
- * @default false
94839
- */
94840
- hideTestRequestButton: external_exports.boolean().optional().default(false).catch(false),
94841
- /**
94842
- * Whether to show the sidebar search bar
94843
- * @default false
94844
- */
94845
- hideSearch: external_exports.boolean().optional().default(false).catch(false),
94846
- /**
94847
- * Whether to show the operationId
94848
- *
94849
- * @default false
94850
- */
94851
- showOperationId: external_exports.boolean().optional().default(false).catch(false),
94852
- /** Whether dark mode is on or off initially (light mode) */
94853
- darkMode: external_exports.boolean().optional(),
94854
- /** forceDarkModeState makes it always this state no matter what */
94855
- forceDarkModeState: external_exports.enum(["dark", "light"]).optional(),
94856
- /**
94857
- * Whether to show the dark mode toggle
94858
- * @default false
94859
- */
94860
- hideDarkModeToggle: external_exports.boolean().optional().default(false).catch(false),
94861
- /**
94862
- * If used, passed data will be added to the HTML header
94863
- * @see https://unhead.unjs.io/usage/composables/use-seo-meta
94864
- */
94865
- metaData: external_exports.any().optional(),
94866
- // Using any for UseSeoMetaInput since it's an external type
94867
- /**
94868
- * Path to a favicon image
94869
- * @default undefined
94870
- * @example '/favicon.svg'
94871
- */
94872
- favicon: external_exports.string().optional(),
94873
- /**
94874
- * List of httpsnippet clients to hide from the clients menu
94875
- * By default hides Unirest, pass `[]` to show all clients
94876
- */
94877
- hiddenClients: external_exports.union([external_exports.record(external_exports.string(), external_exports.union([external_exports.boolean(), external_exports.array(external_exports.string())])), external_exports.array(external_exports.string()), external_exports.literal(true)]).optional(),
94878
- /** Determine the HTTP client that's selected by default */
94879
- defaultHttpClient: external_exports.object({
94880
- targetKey: external_exports.custom(),
94881
- clientKey: external_exports.string()
94882
- }).optional(),
94883
- /** Custom CSS to be added to the page */
94884
- customCss: external_exports.string().optional(),
94885
- /** onSpecUpdate is fired on spec/swagger content change */
94886
- onSpecUpdate: external_exports.function({
94887
- input: [external_exports.string()],
94888
- output: external_exports.void()
94889
- }).optional(),
94890
- /** onServerChange is fired on selected server change */
94891
- onServerChange: external_exports.function({
94892
- input: [external_exports.string()],
94893
- output: external_exports.void()
94894
- }).optional(),
94895
- /** onDocumentSelect is fired when the config is selected */
94896
- onDocumentSelect: external_exports.function({
94897
- input: []
94898
- // Why no output? https://github.com/scalar/scalar/pull/7047
94899
- // output: z.union([z.void(), z.promise(z.void())]),
94900
- }).optional(),
94901
- /** Callback fired when the reference is fully loaded */
94902
- onLoaded: external_exports.function().optional(),
94903
- /** Fired before the outbound request is built; callback receives a mutable request builder (RequestFactory). Experimental API. */
94904
- onBeforeRequest: external_exports.function({
94905
- input: [
94906
- external_exports.object({
94907
- request: external_exports.instanceof(Request),
94908
- requestBuilder: external_exports.unknown(),
94909
- envVariables: external_exports.record(external_exports.string(), external_exports.string())
94910
- })
94911
- ]
94912
- // Why no output? https://github.com/scalar/scalar/pull/7047
94913
- // output: z.union([z.void(), z.promise(z.void())]),
94914
- }).optional(),
94915
- /**
94916
- * onShowMore is fired when the user clicks the "Show more" button on the references
94917
- * @param tagId - The ID of the tag that was clicked
94918
- */
94919
- onShowMore: external_exports.function({
94920
- input: [external_exports.string()]
94921
- // Why no output? https://github.com/scalar/scalar/pull/7047
94922
- // output: z.union([z.void(), z.promise(z.void())]),
94923
- }).optional(),
94924
- /**
94925
- * onSidebarClick is fired when the user clicks on a sidebar item
94926
- * @param href - The href of the sidebar item that was clicked
94927
- */
94928
- onSidebarClick: external_exports.function({
94929
- input: [external_exports.string()]
94930
- // Why no output? https://github.com/scalar/scalar/pull/7047
94931
- // output: z.union([z.void(), z.promise(z.void())]),
94932
- }).optional(),
94933
- /**
94934
- * Route using paths instead of hashes, your server MUST support this
94935
- * @example '/standalone-api-reference/:custom(.*)?'
94936
- * @experimental
94937
- * @default undefined
94938
- */
94939
- pathRouting: external_exports.object({
94940
- basePath: external_exports.string()
94941
- }).optional(),
94942
- /**
94943
- * MCP (Model Context Protocol) configuration
94944
- * Optional. When provided, enables MCP integration with the given name and url.
94945
- */
94946
- mcp: external_exports.object({
94947
- /** Display name for the MCP server */
94948
- name: external_exports.string().optional(),
94949
- /** URL of the MCP server */
94950
- url: external_exports.string().optional(),
94951
- /** When true, disables the MCP integration */
94952
- disabled: external_exports.boolean().optional()
94953
- }).optional(),
94954
- /**
94955
- * Customize the heading portion of the hash
94956
- * @param heading - The heading object
94957
- * @returns A string ID used to generate the URL hash
94958
- * @default (heading) => `#description/${heading.slug}`
94959
- */
94960
- generateHeadingSlug: external_exports.function({
94961
- input: [external_exports.object({ slug: external_exports.string().default("headingSlug") })],
94962
- output: external_exports.string()
94963
- }).optional(),
94964
- /**
94965
- * Customize the model portion of the hash
94966
- * @param model - The model object with a name property
94967
- * @returns A string ID used to generate the URL hash
94968
- * @default (model) => slug(model.name)
94969
- */
94970
- generateModelSlug: external_exports.function({
94971
- input: [external_exports.object({ name: external_exports.string().default("modelName") })],
94972
- output: external_exports.string()
94973
- }).optional(),
94974
- /**
94975
- * Customize the tag portion of the hash
94976
- * @param tag - The tag object
94977
- * @returns A string ID used to generate the URL hash
94978
- * @default (tag) => slug(tag.name)
94979
- */
94980
- generateTagSlug: external_exports.function({
94981
- input: [external_exports.object({ name: external_exports.string().default("tagName") })],
94982
- output: external_exports.string()
94983
- }).optional(),
94984
- /**
94985
- * Customize the operation portion of the hash
94986
- * @param operation - The operation object
94987
- * @returns A string ID used to generate the URL hash
94988
- * @default (operation) => `${operation.method}${operation.path}`
94989
- */
94990
- generateOperationSlug: external_exports.function({
94991
- input: [
94992
- external_exports.object({
94993
- path: external_exports.string(),
94994
- operationId: external_exports.string().optional(),
94995
- method: external_exports.string(),
94996
- summary: external_exports.string().optional()
94997
- })
94998
- ],
94999
- output: external_exports.string()
95000
- }).optional(),
95001
- /**
95002
- * Customize the webhook portion of the hash
95003
- * @param webhook - The webhook object
95004
- * @returns A string ID used to generate the URL hash
95005
- * @default (webhook) => slug(webhook.name)
95006
- */
95007
- generateWebhookSlug: external_exports.function({
95008
- input: [
95009
- external_exports.object({
95010
- name: external_exports.string(),
95011
- method: external_exports.string().optional()
95012
- })
95013
- ],
95014
- output: external_exports.string()
95015
- }).optional(),
95016
- /**
95017
- * To handle redirects, pass a function that will receive:
95018
- * - The current path with hash if pathRouting is enabled
95019
- * - The current hash if hashRouting (default)
95020
- * And then passes that to history.replaceState
95021
- *
95022
- * @example hashRouting (default)
95023
- * ```ts
95024
- * redirect: (hash: string) => hash.replace('#v1/old-path', '#v2/new-path')
95025
- * ```
95026
- * @example pathRouting
95027
- * ```ts
95028
- * redirect: (pathWithHash: string) => {
95029
- * if (pathWithHash.includes('#')) {
95030
- * return pathWithHash.replace('/v1/tags/user#operation/get-user', '/v1/tags/user/operation/get-user')
95031
- * }
95032
- * return null
95033
- * }
95034
- * ```
95035
- */
95036
- redirect: external_exports.function({
95037
- input: [external_exports.string()],
95038
- output: external_exports.string().nullable().optional()
95039
- }).optional(),
95040
- /**
95041
- * Whether to include default fonts
95042
- * @default true
95043
- */
95044
- withDefaultFonts: external_exports.boolean().optional().default(true).catch(true),
95045
- /**
95046
- * Whether to expand the first tag in the sidebar when no specific URL target is present
95047
- * @default true
95048
- */
95049
- defaultOpenFirstTag: external_exports.boolean().optional().default(true).catch(true),
95050
- /**
95051
- * Whether to expand all tags by default
95052
- *
95053
- * Warning this can cause performance issues on big documents
95054
- * @default false
95055
- */
95056
- defaultOpenAllTags: external_exports.boolean().optional().default(false).catch(false),
95057
- /**
95058
- * Whether to expand all models by default
95059
- *
95060
- * Warning this can cause performance issues on big documents
95061
- * @default false
95062
- */
95063
- expandAllModelSections: external_exports.boolean().optional().default(false).catch(false),
95064
- /**
95065
- * Whether to expand all responses by default
95066
- *
95067
- * Warning this can cause performance issues on big documents
95068
- * @default false
95069
- */
95070
- expandAllResponses: external_exports.boolean().optional().default(false).catch(false),
95071
- /**
95072
- * Function to sort tags
95073
- * @default 'alpha' for alphabetical sorting
95074
- */
95075
- tagsSorter: external_exports.union([
95076
- external_exports.literal("alpha"),
95077
- external_exports.function({
95078
- input: [external_exports.any(), external_exports.any()],
95079
- output: external_exports.number()
95080
- })
95081
- ]).optional(),
95082
- /**
95083
- * Function to sort operations
95084
- * @default 'alpha' for alphabetical sorting
95085
- */
95086
- operationsSorter: external_exports.union([
95087
- external_exports.literal("alpha"),
95088
- external_exports.literal("method"),
95089
- external_exports.function({
95090
- input: [external_exports.any(), external_exports.any()],
95091
- output: external_exports.number()
95092
- })
95093
- ]).optional(),
95094
- /**
95095
- * Order the schema properties by
95096
- * @default 'alpha' for alphabetical sorting
95097
- */
95098
- orderSchemaPropertiesBy: external_exports.union([external_exports.literal("alpha"), external_exports.literal("preserve")]).optional().default("alpha").catch("alpha"),
95099
- /**
95100
- * Sort the schema properties by required ones first
95101
- * @default true
95102
- */
95103
- orderRequiredPropertiesFirst: external_exports.boolean().optional().default(true).catch(true)
95104
- });
95105
- var apiReferenceConfigurationWithSourceSchema = apiReferenceConfigurationSchema.extend(sourceConfigurationSchema.shape).transform((configuration) => {
95106
- if (configuration.hideDownloadButton) {
95107
- console.warn(`[DEPRECATED] You're using the deprecated 'hideDownloadButton' attribute. Use 'documentDownloadType: 'none'' instead.`);
95108
- configuration.documentDownloadType = "none";
95109
- }
95110
- if (configuration.spec?.url) {
95111
- console.warn(`[DEPRECATED] You're using the deprecated 'spec.url' attribute. Remove the spec prefix and move the 'url' attribute to the top level.`);
95112
- configuration.url = configuration.spec.url;
95113
- delete configuration.spec;
95114
- }
95115
- if (configuration.spec?.content) {
95116
- console.warn(`[DEPRECATED] You're using the deprecated 'spec.content' attribute. Remove the spec prefix and move the 'content' attribute to the top level.`);
95117
- configuration.content = configuration.spec.content;
95118
- delete configuration.spec;
95119
- }
95120
- if (configuration.proxy) {
95121
- console.warn(`[DEPRECATED] You're using the deprecated 'proxy' attribute, rename it to 'proxyUrl' or update the package.`);
95122
- if (!configuration.proxyUrl) {
95123
- configuration.proxyUrl = configuration.proxy;
95124
- }
95125
- delete configuration.proxy;
95126
- }
95127
- if (configuration.proxyUrl === OLD_PROXY_URL) {
95128
- console.warn(`[DEPRECATED] Warning: configuration.proxyUrl points to our old proxy (${OLD_PROXY_URL}).`);
95129
- console.warn(`[DEPRECATED] We are overwriting the value and use the new proxy URL (${NEW_PROXY_URL}) instead.`);
95130
- console.warn(`[DEPRECATED] Action Required: You should manually update your configuration to use the new URL (${NEW_PROXY_URL}). Read more: https://github.com/scalar/scalar`);
95131
- configuration.proxyUrl = NEW_PROXY_URL;
95132
- }
95133
- if (configuration.showToolbar && configuration.showToolbar !== "localhost") {
95134
- console.warn(`[DEPRECATED] You're using the deprecated 'showToolbar' attribute. Use 'showDeveloperTools' instead.`);
95135
- configuration.showDeveloperTools = configuration.showToolbar;
95136
- delete configuration.showToolbar;
95137
- }
95138
- return configuration;
95139
- });
95140
-
95141
- // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/api-reference/html-rendering-configuration.js
95142
- var htmlRenderingConfigurationSchema = external_exports.object({
95143
- /**
95144
- * The URL to the Scalar API Reference JS CDN.
95145
- *
95146
- * Use this to pin a specific version of the Scalar API Reference.
95147
- *
95148
- * @default https://cdn.jsdelivr.net/npm/@scalar/api-reference
95149
- *
95150
- * @example https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.122
95151
- */
95152
- cdn: external_exports.string().optional().default("https://cdn.jsdelivr.net/npm/@scalar/api-reference"),
95153
- /**
95154
- * The title of the page.
95155
- */
95156
- pageTitle: external_exports.string().optional().default("Scalar API Reference")
95157
- });
95158
-
95159
- // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/legacy/reference-config.js
95160
- var XScalarStability;
95161
- (function(XScalarStability2) {
95162
- XScalarStability2["Deprecated"] = "deprecated";
95163
- XScalarStability2["Experimental"] = "experimental";
95164
- XScalarStability2["Stable"] = "stable";
95165
- })(XScalarStability || (XScalarStability = {}));
95166
-
95167
94473
  // ../../packages/scalar-config/dist/schema/ruleset.js
95168
94474
  var blockPublishOnSchema2 = external_exports.enum(["error", "warning", "info", "hint", "none"]).describe("Severity threshold at or above which ruleset findings block publishing.");
95169
94475
  var rulesetConfigSchema = external_exports.object({
@@ -95176,26 +94482,35 @@ var rulesetConfigSchema = external_exports.object({
95176
94482
  });
95177
94483
 
95178
94484
  // ../../packages/scalar-config/dist/schema/navigation/openapi.js
95179
- var scopedApiConfigSchema = apiReferenceConfigurationSchema.pick({
95180
- authentication: true,
95181
- expandAllResponses: true,
95182
- expandAllModelSections: true,
95183
- defaultOpenAllTags: true,
95184
- defaultHttpClient: true,
95185
- hiddenClients: true,
95186
- showOperationId: true,
95187
- hideTestRequestButton: true,
95188
- hideDownloadButton: true,
95189
- documentDownloadType: true,
95190
- hideModels: true,
95191
- plugins: true,
95192
- proxyUrl: true,
95193
- orderSchemaPropertiesBy: true,
95194
- orderRequiredPropertiesFirst: true,
95195
- operationTitleSource: true,
95196
- servers: true,
95197
- hideClientButton: true,
95198
- baseServerURL: true
94485
+ var httpClientSchema = external_exports.object({
94486
+ targetKey: external_exports.string(),
94487
+ clientKey: external_exports.string()
94488
+ });
94489
+ var hiddenClientsSchema = external_exports.union([
94490
+ external_exports.record(external_exports.string(), external_exports.union([external_exports.boolean(), external_exports.string().array()])),
94491
+ external_exports.string().array(),
94492
+ external_exports.literal(true)
94493
+ ]);
94494
+ var scopedApiConfigSchema = external_exports.object({
94495
+ authentication: external_exports.custom().optional(),
94496
+ expandAllResponses: external_exports.boolean().default(false),
94497
+ expandAllModelSections: external_exports.boolean().default(false),
94498
+ defaultOpenAllTags: external_exports.boolean().default(false),
94499
+ defaultHttpClient: httpClientSchema.optional(),
94500
+ hiddenClients: hiddenClientsSchema.optional(),
94501
+ showOperationId: external_exports.boolean().default(false),
94502
+ hideTestRequestButton: external_exports.boolean().default(false),
94503
+ hideDownloadButton: external_exports.boolean().optional(),
94504
+ documentDownloadType: external_exports.enum(["both", "yaml", "json", "direct", "none"]).default("both"),
94505
+ hideModels: external_exports.boolean().default(false),
94506
+ plugins: external_exports.unknown().array().optional(),
94507
+ proxyUrl: external_exports.string().optional(),
94508
+ orderSchemaPropertiesBy: external_exports.enum(["alpha", "preserve"]).default("alpha"),
94509
+ orderRequiredPropertiesFirst: external_exports.boolean().default(true),
94510
+ operationTitleSource: external_exports.enum(["summary", "path"]).default("summary"),
94511
+ servers: external_exports.unknown().array().optional(),
94512
+ hideClientButton: external_exports.boolean().default(false),
94513
+ baseServerURL: external_exports.string().optional()
95199
94514
  });
95200
94515
  var openapiNavigationEntryBase = external_exports.object({
95201
94516
  title: titleSchema.optional(),