@scalar/cli 2.8.0 → 2.11.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 (111) hide show
  1. package/README.md +84 -1076
  2. package/chunks/action-25QMCP5G.js +122 -0
  3. package/chunks/{action-354TUG4H.js → action-2VF6LODL.js} +20 -16
  4. package/chunks/{action-XIUO64C7.js → action-5I4XDPPG.js} +20 -14
  5. package/chunks/action-6M5PTDF6.js +100 -0
  6. package/chunks/{action-NVI5DWFP.js → action-73ELLN3T.js} +8 -11
  7. package/chunks/{action-Y6NXJQ4H.js → action-7H3AWCHX.js} +21 -16
  8. package/chunks/{action-LLH4QPXM.js → action-BRSLSOE5.js} +19 -18
  9. package/chunks/{action-EOAVVL52.js → action-CQQCKSNS.js} +17 -22
  10. package/chunks/action-D5QWDNQ2.js +65 -0
  11. package/chunks/{action-Y7OUGD56.js → action-DQDHBOLJ.js} +34 -31
  12. package/chunks/{action-5SK5NE7E.js → action-EYPYQQVM.js} +18 -23
  13. package/chunks/{action-YRX6SN5F.js → action-FMA5ECUA.js} +12 -10
  14. package/chunks/{action-7PEQXDWT.js → action-GXDJLF2G.js} +134 -25
  15. package/chunks/action-HUICEXJZ.js +75 -0
  16. package/chunks/action-IH6G77C5.js +38 -0
  17. package/chunks/{action-H3RTILLM.js → action-IIQMZVRJ.js} +1 -1
  18. package/chunks/action-IQM54ITT.js +164 -0
  19. package/chunks/{action-UIKH4SZX.js → action-J5TO3UJW.js} +32 -26
  20. package/chunks/{action-H6OUJWWM.js → action-KC3ZCNDR.js} +17 -22
  21. package/chunks/{action-6BYGBXRC.js → action-L7TMS3Q3.js} +44 -37
  22. package/chunks/{action-GWXLHL2Z.js → action-LAAHRDSR.js} +5 -4
  23. package/chunks/{action-FCAYFPVR.js → action-LR75GHBA.js} +14 -11
  24. package/chunks/action-MJMLQFLT.js +1552 -0
  25. package/chunks/action-NHU4CUKT.js +130 -0
  26. package/chunks/action-NKTFNFU7.js +64 -0
  27. package/chunks/{action-F7A2K74G.js → action-NMW5WPD2.js} +12 -16
  28. package/chunks/{action-VOFDW3U2.js → action-OTPXODUE.js} +8 -7
  29. package/chunks/{action-43YBNBDR.js → action-RPCDNGCI.js} +54 -39
  30. package/chunks/{action-QQZLPI42.js → action-RQCXSJPZ.js} +55 -27
  31. package/chunks/action-SOYSVG67.js +147 -0
  32. package/chunks/action-Y7EBKCUU.js +16 -0
  33. package/chunks/{action-WFDNRA7D.js → action-YN4TE7TG.js} +24 -23
  34. package/chunks/{action-AQRPFQKI.js → action-ZGNVWTHZ.js} +14 -12
  35. package/chunks/action-ZKKRPLDK.js +64 -0
  36. package/chunks/{action-HT2DJ34Z.js → action-ZUZL7R3H.js} +20 -15
  37. package/chunks/{actions-OGIVBQC7.js → actions-S6K76HCW.js} +46 -19
  38. package/chunks/{agent-ASPV3R5U.js → agent-IRNEV4K5.js} +46 -9
  39. package/chunks/{asyncapi-QNFKXHEI.js → asyncapi-WQPIQMEZ.js} +15 -10
  40. package/chunks/{build.action-NM6CAE5F.js → build.action-CLBVKFWD.js} +28 -24
  41. package/chunks/chunk-25XERWCE.js +1058 -0
  42. package/chunks/chunk-3RIUDHLG.js +467 -0
  43. package/chunks/{chunk-MLSZVVTT.js → chunk-3TFOA64C.js} +19 -8
  44. package/chunks/{chunk-HGOD6THU.js → chunk-4JKXZ5CF.js} +12 -25
  45. package/chunks/{chunk-C2KAWRIX.js → chunk-5ENKYZA4.js} +1 -1
  46. package/chunks/{chunk-W24BETFG.js → chunk-5L7V7RCH.js} +10 -10
  47. package/chunks/chunk-6PSYZO3U.js +24 -0
  48. package/chunks/{chunk-IMG35UXX.js → chunk-ALYM4ZB2.js} +1 -1
  49. package/chunks/chunk-AVZFSWPD.js +37 -0
  50. package/chunks/{chunk-5UHLAJQD.js → chunk-BQYVSPAI.js} +36 -10
  51. package/chunks/{chunk-XXSQUBXS.js → chunk-CSSTCHHF.js} +6212 -4642
  52. package/chunks/chunk-DFOZG7ZV.js +15 -0
  53. package/chunks/{chunk-22HYZ7LE.js → chunk-DQD2753S.js} +3 -3
  54. package/chunks/{action-F2ZJNURT.js → chunk-EBNFCIKS.js} +7 -10
  55. package/chunks/{chunk-EXY3ZTV4.js → chunk-F3OPMYME.js} +143 -301
  56. package/chunks/{chunk-FDC2IESH.js → chunk-FG5AOTDN.js} +8519 -14702
  57. package/chunks/chunk-GKCVATQJ.js +92 -0
  58. package/chunks/{chunk-PH3WFNXJ.js → chunk-GMHIK5K2.js} +1 -1
  59. package/chunks/{chunk-GTV2BVXV.js → chunk-GYR5E6RB.js} +2 -2
  60. package/chunks/{chunk-OJ2EWIJH.js → chunk-HZN6IIPZ.js} +11 -6
  61. package/chunks/{chunk-IKT5F47M.js → chunk-I57ID5K7.js} +24 -11
  62. package/chunks/{chunk-BPGFSSUH.js → chunk-KOD2HX5I.js} +1 -1
  63. package/chunks/{chunk-L3UXDCBI.js → chunk-LOLVJNI5.js} +4 -4
  64. package/chunks/{chunk-KCCFN4F7.js → chunk-MN2AFJXM.js} +36 -29
  65. package/chunks/{chunk-UXJ753NV.js → chunk-N5CJ5MTY.js} +5 -13
  66. package/chunks/chunk-NAC63XJF.js +10 -0
  67. package/chunks/{chunk-2OCWX42S.js → chunk-NWJ37GI2.js} +166 -22
  68. package/chunks/{chunk-3ZJYGGAA.js → chunk-ORCUZITN.js} +1 -1
  69. package/chunks/chunk-QMLRYD76.js +24 -0
  70. package/chunks/{chunk-KKRGBXCE.js → chunk-SEURG74P.js} +303 -209
  71. package/chunks/{chunk-R5LK6VPY.js → chunk-SOV4POMS.js} +370 -264
  72. package/chunks/chunk-T34TL6KL.js +222 -0
  73. package/chunks/{chunk-5DEU2DVL.js → chunk-U6VE6JOS.js} +3 -15
  74. package/chunks/{chunk-YILQODZF.js → chunk-UFSFY7Z4.js} +23 -20
  75. package/chunks/{chunk-6YPQGVF4.js → chunk-ULRJZXMS.js} +1 -1
  76. package/chunks/chunk-US54KYOJ.js +131 -0
  77. package/chunks/chunk-V6LUKXBV.js +37 -0
  78. package/chunks/{chunk-5JLVQVKO.js → chunk-VRZSDUZK.js} +190 -152
  79. package/chunks/chunk-VUXPDHTQ.js +22 -0
  80. package/chunks/chunk-XP5UM7SF.js +21 -0
  81. package/chunks/chunk-Y6XGC4K5.js +311 -0
  82. package/chunks/{create.action-FUQ2BVJA.js → create.action-ITEOQ644.js} +34 -30
  83. package/chunks/{delete.action-47E66R3I.js → delete.action-77MFPLUN.js} +30 -26
  84. package/chunks/{delete.action-BTDFH7WY.js → delete.action-C6VX4S5Q.js} +30 -26
  85. package/chunks/{get.action-XC7KC2JO.js → get.action-3BP4FHZC.js} +20 -14
  86. package/chunks/get.action-LNBOWUVE.js +95 -0
  87. package/chunks/list.action-6CRFQPJT.js +156 -0
  88. package/chunks/list.action-KR5YIDR4.js +126 -0
  89. package/chunks/{publish.action-OS27XOX4.js → publish.action-YBORRPBM.js} +49 -42
  90. package/chunks/query-WKATAJJ6.js +129 -0
  91. package/chunks/scripts-6CI6U32J.js +102 -0
  92. package/chunks/{update.action-AEIBLCWD.js → update.action-O7TSXDGV.js} +34 -27
  93. package/chunks/{update.action-ZMS4CQ3T.js → update.action-QZI7M2MV.js} +34 -27
  94. package/index.js +579 -382
  95. package/package.json +15 -14
  96. package/skills/scalar-cli/SKILL.md +52 -46
  97. package/template.md +71 -136
  98. package/chunks/action-CA4QYPI6.js +0 -125
  99. package/chunks/action-JAHFRYWZ.js +0 -423
  100. package/chunks/action-KTYOCA2V.js +0 -229
  101. package/chunks/action-LEUD5P2U.js +0 -92
  102. package/chunks/action-LXGXKXZZ.js +0 -72
  103. package/chunks/action-W3C53GPH.js +0 -54
  104. package/chunks/action-YLF2G4G5.js +0 -37
  105. package/chunks/chunk-6XWCMJDB.js +0 -404
  106. package/chunks/chunk-K74E42RV.js +0 -7311
  107. package/chunks/chunk-QVQ4PNVL.js +0 -610
  108. package/chunks/chunk-XEDGMZJD.js +0 -366
  109. package/chunks/list.action-LXKEUYKO.js +0 -116
  110. package/chunks/list.action-OFGLMRE7.js +0 -95
  111. package/docs.html +0 -6245
@@ -0,0 +1,92 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ BaseCollections
4
+ } from "./chunk-NWJ37GI2.js";
5
+ import {
6
+ sdkTrackedApiVersionSpec
7
+ } from "./chunk-FG5AOTDN.js";
8
+ import {
9
+ err,
10
+ ok
11
+ } from "./chunk-5ENKYZA4.js";
12
+ import {
13
+ managedDocSchema
14
+ } from "./chunk-MN2AFJXM.js";
15
+
16
+ // src/domains/sdk/inspect-sdk.ts
17
+ var sdkMetadata = (sdk, builds) => {
18
+ const latestBuild = builds.filter((build) => build.sdk.uid === sdk.uid).reduce(
19
+ (latest, build) => !latest || build.createdAt > latest.createdAt ? build : latest,
20
+ null
21
+ );
22
+ return {
23
+ uid: sdk.uid,
24
+ namespace: sdk.namespace,
25
+ slug: sdk.slug,
26
+ title: sdk.title,
27
+ description: sdk.description,
28
+ isPrivate: sdk.isPrivate,
29
+ createdAt: sdk.createdAt,
30
+ updatedAt: sdk.updatedAt,
31
+ api: sdk.apiUid ? {
32
+ uid: sdk.apiUid,
33
+ trackedVersion: sdkTrackedApiVersionSpec(sdk) ?? null
34
+ } : null,
35
+ currentVersion: sdk.currentVersion,
36
+ targets: sdk.targets.map(({ language, slug }) => ({ language, slug })),
37
+ versions: sdk.versions.map((version) => ({
38
+ version: version.version,
39
+ apiVersion: version.apiVersion,
40
+ status: version.status,
41
+ languages: version.languages,
42
+ createdAt: version.createdAt ?? null,
43
+ publishedAt: version.publishedAt ?? null,
44
+ targets: Object.entries(version.targets).map(([language, state]) => ({
45
+ language,
46
+ activeBuild: state.activeBuild ?? null,
47
+ builtAt: state.builtAt ?? null
48
+ }))
49
+ })),
50
+ latestBuild: latestBuild ? {
51
+ uid: latestBuild.uid,
52
+ version: latestBuild.sdk.version,
53
+ createdAt: latestBuild.createdAt,
54
+ api: {
55
+ uid: latestBuild.api.uid,
56
+ namespace: latestBuild.api.namespace,
57
+ slug: latestBuild.api.slug,
58
+ version: latestBuild.api.version
59
+ },
60
+ targets: latestBuild.targets.map(
61
+ ({ language, slug, buildStatus, gitStatus }) => ({
62
+ language,
63
+ slug,
64
+ buildStatus,
65
+ gitStatus: gitStatus ?? null
66
+ })
67
+ )
68
+ } : null
69
+ };
70
+ };
71
+ var inspectSdk = async (client, teamUid, sdk, builds) => {
72
+ const metadata = sdkMetadata(sdk, builds);
73
+ if (!sdk.apiUid || !metadata.api) return ok({ ...metadata, api: null });
74
+ const api = await client.getOne({
75
+ collectionPath: BaseCollections.ManagedDocs(teamUid),
76
+ query: { uid: sdk.apiUid },
77
+ schema: managedDocSchema.nullable()
78
+ });
79
+ if (api.error) return err(api.message);
80
+ return ok({
81
+ ...metadata,
82
+ api: {
83
+ ...metadata.api,
84
+ namespace: api.data?.namespace ?? null,
85
+ slug: api.data?.slug ?? null
86
+ }
87
+ });
88
+ };
89
+
90
+ export {
91
+ inspectSdk
92
+ };
@@ -1,7 +1,7 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  registryUrl
4
- } from "./chunk-GTV2BVXV.js";
4
+ } from "./chunk-GYR5E6RB.js";
5
5
 
6
6
  // src/domains/registry/helpers/fetch.ts
7
7
  async function fetchFromRegistry(path, accessToken) {
@@ -1,10 +1,10 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  config
4
- } from "./chunk-UXJ753NV.js";
4
+ } from "./chunk-N5CJ5MTY.js";
5
5
  import {
6
6
  RegistryAsset
7
- } from "./chunk-KCCFN4F7.js";
7
+ } from "./chunk-MN2AFJXM.js";
8
8
 
9
9
  // src/domains/registry/helpers/links.ts
10
10
  function registryUrl(path) {
@@ -1,4 +1,7 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ completeFiles
4
+ } from "./chunk-DFOZG7ZV.js";
2
5
 
3
6
  // src/domains/document/bundle/index.ts
4
7
  import { Command } from "commander";
@@ -21,11 +24,12 @@ var parseFetchLimit = (value) => parseIntegerOption(value, 1, Number.MAX_SAFE_IN
21
24
  var DEFAULT_FETCH_CONCURRENCY = 5;
22
25
  function BundleCommand() {
23
26
  const cmd = new Command("bundle");
24
- cmd.description(
25
- "Bundle an OpenAPI document by resolving all references and external dependencies"
27
+ cmd.description("Bundle external references into a single API description");
28
+ cmd.argument("[file|url]", "API description file path or URL to bundle");
29
+ cmd.option(
30
+ "-o, --output <file>",
31
+ "Output file (required for URLs; otherwise overwrites the input file)"
26
32
  );
27
- cmd.argument("[file|url]", "Path to OpenAPI file or URL to bundle");
28
- cmd.option("-o, --output <file>", "Path to save the bundled output file");
29
33
  cmd.option("--treeShake", "Remove unused components from the bundled output");
30
34
  cmd.option(
31
35
  "--urlMap",
@@ -33,11 +37,12 @@ function BundleCommand() {
33
37
  );
34
38
  cmd.option(
35
39
  "--fetchLimit <limit>",
36
- "Maximum number of URLs to fetch during bundling at the same time",
40
+ "Maximum number of concurrent URL fetches",
37
41
  parseFetchLimit
38
42
  );
43
+ completeFiles(cmd, ["file|url"], ["--output"]);
39
44
  cmd.action(async (...args) => {
40
- const { bundleAction } = await import("./action-EOAVVL52.js");
45
+ const { bundleAction } = await import("./action-CQQCKSNS.js");
41
46
  return bundleAction(...args);
42
47
  });
43
48
  return cmd;
@@ -13779,6 +13779,18 @@ var slugify2 = (str, options) => {
13779
13779
  const ascii = options?.ascii ?? false;
13780
13780
  return str.normalize(ascii ? "NFD" : "NFC").toLowerCase().trim().replace(ascii ? /[^a-z0-9\s.-]/g : /[^\p{L}\p{M}\p{N}\s.-]/gu, "").replace(/[\s-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 255);
13781
13781
  };
13782
+ function deduplicateSlugInSet({ slug, used, limit = 100 }) {
13783
+ if (!used.has(slug)) {
13784
+ used.add(slug);
13785
+ return slug;
13786
+ }
13787
+ let i = 1;
13788
+ while (i < limit && used.has(`${slug}-${i}`))
13789
+ i++;
13790
+ const result = `${slug}-${i}`;
13791
+ used.add(result);
13792
+ return result;
13793
+ }
13782
13794
 
13783
13795
  // ../../packages/entities/dist/utility/utility.js
13784
13796
  import { customAlphabet } from "nanoid";
@@ -17246,16 +17258,16 @@ var NANOID_ALPHABET = "useandom26T198340PX75pxJACKVERYMINDBUSHWOLFGQZbfghjklqvwy
17246
17258
  var nanoid3 = (size) => {
17247
17259
  return customAlphabet(NANOID_ALPHABET, 21)(size);
17248
17260
  };
17249
- var emailSchema = external_exports.email().overwrite((s) => s.toLowerCase()).meta({ id: "email" });
17250
- var timestampSchema = external_exports.number().int().min(0).meta({ id: "timestamp" });
17251
- var nanoidSchema = external_exports.string().min(5).meta({ id: "nanoid" });
17261
+ var emailSchema = external_exports.email().overwrite((s) => s.toLowerCase()).meta({ id: "email", examples: ["alex@example.com"] });
17262
+ var timestampSchema = external_exports.number().int().min(0).meta({ id: "timestamp", examples: [1735689600] });
17263
+ var nanoidSchema = external_exports.string().min(5).meta({ id: "nanoid", examples: ["UakgbKJ5m9gl0JDMbcJqL"] });
17252
17264
  var brandedUid = () => nanoidSchema.brand();
17253
17265
  var mintUid = () => nanoid3();
17254
17266
  var entitySchema = external_exports.object({
17255
- uid: nanoidSchema.default(nanoid3).meta({ default: "nanoid()" }),
17256
- createdAt: timestampSchema.default(unixTimestamp).meta({ default: "unixTimestamp()" }),
17257
- updatedAt: timestampSchema.default(unixTimestamp).meta({ default: "unixTimestamp()" })
17258
- }).meta({ id: "entity", default: "nanoid()" });
17267
+ uid: nanoidSchema.default(nanoid3).meta({ default: void 0 }),
17268
+ createdAt: timestampSchema.default(unixTimestamp).meta({ default: void 0 }),
17269
+ updatedAt: timestampSchema.default(unixTimestamp).meta({ default: void 0 })
17270
+ }).meta({ id: "entity" });
17259
17271
  function unixTimestamp(date5 = Date.now()) {
17260
17272
  return Math.floor(new Date(date5).getTime() / 1e3);
17261
17273
  }
@@ -17270,11 +17282,11 @@ var deployEnvironmentsSchema = external_exports.enum(Environments).optional().de
17270
17282
  var regexSemverNumberedGroups = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
17271
17283
  var semverSchema = external_exports.string().regex(regexSemverNumberedGroups, {
17272
17284
  message: "Version must be a valid semver format (e.g. 0.1.0)"
17273
- }).meta({ id: "semver" });
17285
+ }).meta({ id: "semver", examples: ["1.2.0"] });
17274
17286
  var RESERVED_VERSION_NAMES = ["latest"];
17275
17287
  var docVersionSchema = external_exports.string().min(1, { message: "Version must be a non-empty string" }).refine((v) => !RESERVED_VERSION_NAMES.includes(v.toLowerCase()), {
17276
17288
  message: `Version cannot be a reserved name: ${["latest"].join(", ")}`
17277
- }).meta({ id: "version" });
17289
+ }).meta({ id: "version", examples: ["1.2.0"] });
17278
17290
  function compareVersionsDesc(a, b) {
17279
17291
  const aValid = semver.valid(a);
17280
17292
  const bValid = semver.valid(b);
@@ -17289,7 +17301,7 @@ function compareVersionsDesc(a, b) {
17289
17301
  var regexSlug = /^[a-z](?:[a-z0-9-]*[a-z0-9])?$/;
17290
17302
  var slugSchema = external_exports.string().min(1, "Slug is required").max(60, "Slug must be less than 60 characters").regex(regexSlug, {
17291
17303
  message: "Slug can have lowercase letters, digits, or hyphens. It must start with a lowercase letter and end with a letter or number."
17292
- }).meta({ id: "slug" });
17304
+ }).meta({ id: "slug", examples: ["acme-api"] });
17293
17305
  var toAsciiSlugOrUndefined = (title) => {
17294
17306
  const candidate = slugify2(title, { ascii: true }).replace(/\./g, "").replace(/-+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60).replace(/-+$/, "").replace(/^[^a-z]+/, "");
17295
17307
  return slugSchema.safeParse(candidate).success ? candidate : void 0;
@@ -17310,7 +17322,7 @@ var originSchema = external_exports.codec(external_exports.string(), external_ex
17310
17322
  }),
17311
17323
  encode: (arr) => arr.map((x) => typeof x === "string" ? x : x.source).join(", ")
17312
17324
  }).meta({ id: "origin" });
17313
- var namespaceSchema = external_exports.string().regex(/^[a-zA-Z0-9-_]+$/, 'Namespaces can only contain letters, numbers, "-", and "_".').toLowerCase().min(2, "Namespaces need to be at least 2 characters.").max(50, "Namespaces need to be less than 50 characters.").meta({ id: "namespace" });
17325
+ var namespaceSchema = external_exports.string().regex(/^[a-zA-Z0-9-_]+$/, 'Namespaces can only contain letters, numbers, "-", and "_".').toLowerCase().min(2, "Namespaces need to be at least 2 characters.").max(50, "Namespaces need to be less than 50 characters.").meta({ id: "namespace", examples: ["acme"] });
17314
17326
  var objectSchema = external_exports.record(external_exports.union([external_exports.string(), external_exports.number(), external_exports.symbol()]), external_exports.any()).meta({ id: "object" });
17315
17327
  var registryMetaSchema = external_exports.object({
17316
17328
  namespace: external_exports.string(),
@@ -17324,6 +17336,7 @@ export {
17324
17336
  randomAccessGroupSlug,
17325
17337
  randomManagedDocSlug,
17326
17338
  slugify2 as slugify,
17339
+ deduplicateSlugInSet,
17327
17340
  schemaModel,
17328
17341
  nanoid3 as nanoid,
17329
17342
  emailSchema,
@@ -10,7 +10,7 @@ var DownloadIsolateCommand = () => {
10
10
  const cmd = new Command("download-isolate");
11
11
  cmd.description("Download the docs preview server");
12
12
  cmd.action(async () => {
13
- const { downloadIsolate } = await import("./action-GWXLHL2Z.js");
13
+ const { downloadIsolate } = await import("./action-LAAHRDSR.js");
14
14
  await downloadIsolate();
15
15
  });
16
16
  return cmd;
@@ -1,14 +1,14 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  displayError
4
- } from "./chunk-3ZJYGGAA.js";
4
+ } from "./chunk-ORCUZITN.js";
5
5
  import {
6
6
  ISOLATE_DIR,
7
7
  ISOLATE_EXTRACTION_DIR
8
- } from "./chunk-BPGFSSUH.js";
8
+ } from "./chunk-KOD2HX5I.js";
9
9
  import {
10
10
  config
11
- } from "./chunk-UXJ753NV.js";
11
+ } from "./chunk-N5CJ5MTY.js";
12
12
  import {
13
13
  output
14
14
  } from "./chunk-T5HJUAWB.js";
@@ -409,7 +409,7 @@ async function downloadIsolate() {
409
409
  const existingIsolateVersion = await getExistingIsolateVersion();
410
410
  const version = config.ssgDocsIsolateVersion;
411
411
  if (version === existingIsolateVersion) return;
412
- const logger = output.info({ animate: true }).loader("Downloading the docs preview server. This may take a minute...");
412
+ const logger = output.info({ animate: true }).loader("Downloading the docs preview server\u2026");
413
413
  try {
414
414
  const completion = await installIsolate(version, existingIsolateVersion);
415
415
  logger.update("loader", 0, { content: completion });
@@ -2,18 +2,14 @@ import { createRequire as $$cR } from "node:module"; const require = $$cR(import
2
2
  import {
3
3
  baseRegistrySchema,
4
4
  docVersionToolSchema
5
- } from "./chunk-6XWCMJDB.js";
6
- import {
7
- HTTP_METHODS
8
- } from "./chunk-XEDGMZJD.js";
5
+ } from "./chunk-25XERWCE.js";
9
6
  import {
10
7
  brandedUid,
11
- compareVersionsDesc,
12
8
  docVersionSchema,
13
9
  external_exports,
14
10
  mintUid,
15
11
  nanoidSchema
16
- } from "./chunk-IKT5F47M.js";
12
+ } from "./chunk-I57ID5K7.js";
17
13
 
18
14
  // ../../packages/entities/dist/rule/default-data.js
19
15
  var scalarRuleset = `extends: spectral:oas
@@ -47,44 +43,59 @@ var ApiEmbedStatus;
47
43
  })(ApiEmbedStatus || (ApiEmbedStatus = {}));
48
44
  var managedDocTool = docVersionToolSchema;
49
45
  var managedDocVersionSchema = external_exports.object({
50
- uid: nanoidSchema,
46
+ uid: nanoidSchema.meta({ examples: ["UakgbKJ5m9gl0JDMbcJqL"] }),
51
47
  /** Millisecond base timestamp of versions */
52
- createdAt: external_exports.number(),
53
- version: docVersionSchema,
48
+ createdAt: external_exports.number().meta({ examples: [17356896e5] }),
49
+ version: docVersionSchema.meta({ examples: ["1.2.0"] }),
54
50
  /** OpenAPI version normalized on upload */
55
- upgraded: external_exports.boolean().default(false),
51
+ upgraded: external_exports.boolean().default(false).meta({ examples: [false] }),
56
52
  /** Endpoints (path + method pairs) counted at ingest; null when unknown */
57
- endpointCount: external_exports.number().int().nullable().default(null),
53
+ endpointCount: external_exports.number().int().nullable().default(null).meta({ examples: [12] }),
58
54
  /** Vector embeddings processed, agent is enabled */
59
- embedStatus: external_exports.enum(ApiEmbedStatus).nullable().default(null),
60
- tags: external_exports.string().array().default([]),
55
+ embedStatus: external_exports.enum(ApiEmbedStatus).nullable().default(null).meta({ examples: ["complete"] }),
56
+ tags: external_exports.string().array().default([]).meta({ examples: [["products", "orders"]] }),
61
57
  tools: managedDocTool.array().optional(),
62
58
  /** SHA-256 hex digest of the YAML content the version serves (from its chain head) */
63
- yamlSha: external_exports.string().optional(),
59
+ yamlSha: external_exports.string().optional().meta({
60
+ examples: [
61
+ "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789"
62
+ ]
63
+ }),
64
64
  /** SHA-256 hex digest of the JSON content the version serves (from its chain head) */
65
- jsonSha: external_exports.string().optional()
65
+ jsonSha: external_exports.string().optional().meta({
66
+ examples: [
67
+ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
68
+ ]
69
+ })
66
70
  }).meta({ id: "managed-doc-version" });
67
71
  var managedDocTypeSchema = external_exports.enum(["openapi", "asyncapi"]);
68
72
  var managedDocSchema = baseRegistrySchema.extend({
69
73
  /** Own uid, branded so it cannot be confused with another entity's uid */
70
- uid: brandedUid().default(mintUid).meta({ default: "nanoid()" }),
74
+ uid: brandedUid().default(mintUid).meta({ default: void 0 }),
71
75
  /** The current version served to consumers by default */
72
- version: docVersionSchema,
76
+ version: docVersionSchema.meta({ examples: ["1.2.0"] }),
73
77
  /**
74
78
  * Whether the document is an OpenAPI or AsyncAPI description, detected from
75
79
  * the document content on upload. Defaults to 'openapi' so records created
76
80
  * before this field existed parse as OpenAPI, matching the registry's
77
81
  * original OpenAPI-only behavior.
78
82
  */
79
- type: managedDocTypeSchema.default("openapi"),
83
+ type: managedDocTypeSchema.default("openapi").meta({ examples: ["openapi"] }),
80
84
  /** Initial upload format, used as the editor default. Absent on older APIs. */
81
- sourceFormat: external_exports.enum(["json", "yaml"]).optional(),
85
+ sourceFormat: external_exports.enum(["json", "yaml"]).optional().meta({ examples: ["yaml"] }),
82
86
  /**
83
87
  * Denormalized highest-ranked version label, maintained at ingest so
84
88
  * `latest` resolution and list views never re-sort the versions collection.
85
89
  * Absent until the document goes through the instance-based ingest path.
86
90
  */
87
91
  latestVersion: docVersionSchema.optional(),
92
+ /**
93
+ * The head of every line other than production, keyed by environment tag:
94
+ * its highest version and the version it serves by default. Production's
95
+ * head stays on `latestVersion` and `version`; read any line through
96
+ * `docHead`.
97
+ */
98
+ heads: external_exports.record(external_exports.string(), external_exports.object({ latest: docVersionSchema, current: docVersionSchema })).default({}),
88
99
  /**
89
100
  * @deprecated Never read anywhere — superseded by `source` on the base
90
101
  * registry schema. Dropped at decommission.
@@ -107,7 +118,7 @@ var managedDocSchema = baseRegistrySchema.extend({
107
118
  */
108
119
  sourceUrl: external_exports.url().optional(),
109
120
  /** Theme assigned to API, supports custom theme slugs */
110
- theme: external_exports.string().default(""),
121
+ theme: external_exports.string().default("").meta({ examples: ["default"] }),
111
122
  /**
112
123
  * @deprecated The collaborative YJS doc it pointed at was never built —
113
124
  * no consumer exists anywhere. Dropped at decommission.
@@ -115,7 +126,7 @@ var managedDocSchema = baseRegistrySchema.extend({
115
126
  editableUid: external_exports.string(),
116
127
  ruleset: external_exports.string().default(scalarRuleset),
117
128
  /** Enable Agent Scalar */
118
- agentEnabled: external_exports.boolean().default(true),
129
+ agentEnabled: external_exports.boolean().default(true).meta({ examples: [true] }),
119
130
  /**
120
131
  * Scalar verified status
121
132
  *
@@ -125,6 +136,10 @@ var managedDocSchema = baseRegistrySchema.extend({
125
136
  verified: external_exports.boolean().default(false)
126
137
  }).meta({ id: "managed-doc" });
127
138
 
139
+ // ../../node_modules/.pnpm/@scalar+helpers@0.16.1/node_modules/@scalar/helpers/dist/http/http-methods.js
140
+ var HTTP_METHODS = ["delete", "get", "head", "options", "patch", "post", "put", "query", "trace"];
141
+ var httpMethods = Object.freeze(new Set(HTTP_METHODS));
142
+
128
143
  // ../../packages/entities/dist/managed-doc/count-endpoints.js
129
144
  var MAX_OPERATIONS_PER_PATH_ITEM = HTTP_METHODS.length;
130
145
 
@@ -135,18 +150,10 @@ function detectManagedDocType(document) {
135
150
  }
136
151
  return "openapi";
137
152
  }
138
- function getLegacyWysiwygVersion(versions) {
139
- if (versions.includes("latest")) {
140
- return "latest";
141
- }
142
- const latestVersion = [...versions].sort((a, b) => compareVersionsDesc(a, b))[0];
143
- return latestVersion ?? "latest";
144
- }
145
153
 
146
154
  export {
147
155
  ruleSchema,
148
156
  detectManagedDocType,
149
- getLegacyWysiwygVersion,
150
157
  RegistryAsset,
151
158
  managedDocVersionSchema,
152
159
  managedDocSchema
@@ -1,17 +1,10 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ version
4
+ } from "./chunk-US54KYOJ.js";
2
5
 
3
6
  // src/config.ts
4
7
  import { portNumbers } from "get-port";
5
-
6
- // package.json
7
- var name = "@scalar/cli";
8
- var version = "2.8.0";
9
- var bin = {
10
- scalar: "./dist/index.js",
11
- "scalar-cli": "./dist/index.js"
12
- };
13
-
14
- // src/config.ts
15
8
  var config = {
16
9
  projects: {
17
10
  dashboard: process.env.DASHBOARD_URL ?? "https://dashboard.scalar.com",
@@ -22,6 +15,8 @@ var config = {
22
15
  api: process.env.BASE_URL ?? "https://services.scalar.com"
23
16
  },
24
17
  auth: {
18
+ /** The auth server the CLI signs in with and trades personal tokens at */
19
+ origin: process.env.AUTH_URL ?? "https://auth.scalar.com",
25
20
  callback: {
26
21
  preferredPortRange: process.env.PREFERRED_PORT ? Number.parseInt(process.env.PREFERRED_PORT) : portNumbers(4799, 5100)
27
22
  }
@@ -32,8 +27,5 @@ var config = {
32
27
  };
33
28
 
34
29
  export {
35
- name,
36
- version,
37
- bin,
38
30
  config
39
31
  };
@@ -0,0 +1,10 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+
3
+ // src/helpers/option-choices.ts
4
+ var DOCUMENT_FORMATS = ["json", "yaml"];
5
+ var PRIVACY_VALUES = ["true", "false", "public", "private"];
6
+
7
+ export {
8
+ DOCUMENT_FORMATS,
9
+ PRIVACY_VALUES
10
+ };