@scalar/cli 2.12.2 → 2.13.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 (94) hide show
  1. package/README.md +221 -2
  2. package/chunks/{action-JXCU2JKC.js → action-27BJMHFD.js} +38 -6
  3. package/chunks/{action-WLPCBFRE.js → action-4EJA6UEB.js} +16 -16
  4. package/chunks/{action-JDXGQSQN.js → action-5MJTAO5X.js} +36 -23
  5. package/chunks/{action-H5XQIZKX.js → action-6FPGU5SY.js} +51 -24
  6. package/chunks/{action-HMPATNVE.js → action-6RQDLMOM.js} +53 -30
  7. package/chunks/{action-Y7EBKCUU.js → action-ASBFLTOA.js} +1 -1
  8. package/chunks/{action-HRRNN33O.js → action-AWHBOHGW.js} +68 -89
  9. package/chunks/{action-UOH5L2JF.js → action-ENN7KFBZ.js} +93 -54
  10. package/chunks/{action-ZNBXKA7T.js → action-ESVI46KE.js} +4 -4
  11. package/chunks/{action-LCTTNNFD.js → action-EVNUUWR5.js} +33 -17
  12. package/chunks/{action-OWWGJ34K.js → action-F6JSCBEU.js} +34 -16
  13. package/chunks/{action-2RIPHL6V.js → action-FZNFBX6U.js} +23 -6
  14. package/chunks/{action-DJ6FLPXH.js → action-GNYNOFDK.js} +15 -5
  15. package/chunks/{action-HOLFCPUY.js → action-JSYHIEYP.js} +12 -12
  16. package/chunks/action-KTY5ICV5.js +55 -0
  17. package/chunks/{action-IIQMZVRJ.js → action-LRR52RXL.js} +10 -8
  18. package/chunks/{action-Z3UXS5KI.js → action-LVYFHK4D.js} +6 -4
  19. package/chunks/{action-XBTIONQD.js → action-NN7QF6MI.js} +9 -6
  20. package/chunks/{action-2GIOY3HU.js → action-OD4GNHM3.js} +48 -28
  21. package/chunks/{action-OY5LI7TW.js → action-OZWRV54F.js} +9 -8
  22. package/chunks/{action-AZNY2B7G.js → action-QZV6IPK4.js} +26 -11
  23. package/chunks/action-S7PMEFCE.js +423 -0
  24. package/chunks/{action-6IL6KE3L.js → action-SZ6SG3RB.js} +16 -16
  25. package/chunks/{action-PRLW546C.js → action-U3MQZ5ZQ.js} +12 -12
  26. package/chunks/action-UAGYB4ZS.js +48 -0
  27. package/chunks/{action-U3R6AXJY.js → action-UVAYACFA.js} +6 -6
  28. package/chunks/{action-7OJTNQRM.js → action-VXEJNBNR.js} +9 -8
  29. package/chunks/{action-KE53K5EJ.js → action-W24B4YT5.js} +14 -14
  30. package/chunks/{action-QA5ATGWB.js → action-WQICTF7K.js} +67 -45
  31. package/chunks/{action-SFRYHYTZ.js → action-WUWWJGRJ.js} +6 -4
  32. package/chunks/{action-II3OJSGP.js → action-Y4YLWZHL.js} +12 -12
  33. package/chunks/{action-2NJJO35T.js → action-YEAOKB6V.js} +13 -11
  34. package/chunks/{action-LGNWFVEG.js → action-YFTRHKOK.js} +63 -48
  35. package/chunks/{action-QEYNGQXG.js → action-YQSSXJAX.js} +10 -7
  36. package/chunks/{action-IYUOT7XX.js → action-ZL2CXRJR.js} +8 -6
  37. package/chunks/{actions-DKQERAKZ.js → actions-GHHWF4Q2.js} +20 -18
  38. package/chunks/{agent-KQKNJZKK.js → agent-XAHNA4MB.js} +3 -3
  39. package/chunks/{asyncapi-MKBEQYBV.js → asyncapi-TICSLZRM.js} +52 -42
  40. package/chunks/{build.action-EGAOPKSX.js → build.action-AURC6QZ6.js} +37 -20
  41. package/chunks/{chunk-ZZTCEMCG.js → chunk-2AK5O3NQ.js} +2 -2
  42. package/chunks/chunk-2I6V7AI3.js +68 -0
  43. package/chunks/chunk-2XWUFFEZ.js +133 -0
  44. package/chunks/{chunk-7GOHWSPA.js → chunk-62OOT7FY.js} +5 -2
  45. package/chunks/{chunk-W2JGSGIQ.js → chunk-7K6I2GUG.js} +15 -9
  46. package/chunks/{chunk-5VZSFLRO.js → chunk-7O5H2SQP.js} +2 -2
  47. package/chunks/{chunk-FJREFWEE.js → chunk-7S34K2P3.js} +1 -1
  48. package/chunks/{chunk-PIWBFJX3.js → chunk-AOZQPCWI.js} +2 -0
  49. package/chunks/{chunk-EBNFCIKS.js → chunk-APX65SRT.js} +2 -1
  50. package/chunks/{chunk-GZA7GEZW.js → chunk-B3XOSR6W.js} +2 -2
  51. package/chunks/{chunk-VJAVNG6U.js → chunk-CSJIKXUD.js} +1 -1
  52. package/chunks/{chunk-MLBEF6MB.js → chunk-DDDYR2HF.js} +1 -1
  53. package/chunks/{chunk-TQL55CUG.js → chunk-EXJUFF6G.js} +1 -1
  54. package/chunks/{chunk-W6FLDNRM.js → chunk-IRA5BW2J.js} +2 -2
  55. package/chunks/chunk-IRQJDPZE.js +34 -0
  56. package/chunks/{chunk-ZK76AK3B.js → chunk-KPLWZIOV.js} +22 -3
  57. package/chunks/chunk-LK2ZIDHH.js +32 -0
  58. package/chunks/{chunk-3DKOVKCV.js → chunk-M2MMGSLK.js} +5 -5
  59. package/chunks/{chunk-FD364GM7.js → chunk-NRHHB3YY.js} +1 -1
  60. package/chunks/{chunk-W3Y5X3X3.js → chunk-OVKTA5CX.js} +12 -5
  61. package/chunks/chunk-PVDORWEM.js +167 -0
  62. package/chunks/chunk-RAJM56L7.js +60 -0
  63. package/chunks/{chunk-UJU2ORWU.js → chunk-RAU5KE6F.js} +1 -1
  64. package/chunks/{chunk-V6LUKXBV.js → chunk-RE5Z56QD.js} +2 -2
  65. package/chunks/chunk-SNQFFEYH.js +11 -0
  66. package/chunks/{chunk-GUF4PKDL.js → chunk-TI4NDKQC.js} +6 -5
  67. package/chunks/{chunk-VRZRTOZF.js → chunk-TKT5UW3G.js} +2 -2
  68. package/chunks/{chunk-A27OERJM.js → chunk-TVPVXL73.js} +7 -7
  69. package/chunks/{chunk-4RF2NKQN.js → chunk-TYNF7ROW.js} +1 -1
  70. package/chunks/{chunk-HDNCXPCZ.js → chunk-VNF2GRZA.js} +2 -2
  71. package/chunks/chunk-WDFZ7WYJ.js +16 -0
  72. package/chunks/{chunk-672Y6REB.js → chunk-WKW5W2ZP.js} +1 -1
  73. package/chunks/chunk-XUX6JXU5.js +58 -0
  74. package/chunks/{chunk-6YOXEMMX.js → chunk-Y2OQOAY7.js} +1 -1
  75. package/chunks/{create.action-UUDVWZ3F.js → create.action-O3HN6GV2.js} +32 -23
  76. package/chunks/{delete.action-XRP3VU5C.js → delete.action-2L2RWLPI.js} +36 -22
  77. package/chunks/{delete.action-EUQ4ESLJ.js → delete.action-KEBI2QCS.js} +38 -22
  78. package/chunks/{get.action-IYA5Q3RI.js → get.action-BUNTDW54.js} +13 -11
  79. package/chunks/{get.action-UHCFOKUQ.js → get.action-WDMTCZZR.js} +14 -14
  80. package/chunks/{list.action-3CCWEEAM.js → list.action-JNSEJVHX.js} +14 -14
  81. package/chunks/{list.action-D3GHA6S5.js → list.action-NSK7OBRH.js} +16 -16
  82. package/chunks/{publish.action-HIVWJ7QE.js → publish.action-ZRZQUL7S.js} +49 -29
  83. package/chunks/{update.action-NSKVEZES.js → update.action-7TA46AE6.js} +36 -22
  84. package/chunks/{update.action-VOZNA7BV.js → update.action-O2R5ODGG.js} +47 -27
  85. package/index.js +226 -149
  86. package/package.json +1 -1
  87. package/skills/scalar-cli/SKILL.md +4 -2
  88. package/template.md +220 -1
  89. package/chunks/action-RNVV27ET.js +0 -165
  90. package/chunks/action-ZHDGAUGG.js +0 -38
  91. package/chunks/chunk-AC62V47N.js +0 -38
  92. package/chunks/chunk-EGOXR5FB.js +0 -15
  93. package/chunks/chunk-JFIXNSPP.js +0 -26
  94. package/chunks/{action-UHXBY3RD.js → action-3P66ZSL3.js} +1 -1
@@ -1,10 +1,10 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  BaseCollections
4
- } from "./chunk-GUF4PKDL.js";
4
+ } from "./chunk-TI4NDKQC.js";
5
5
  import {
6
6
  getDatabaseClient
7
- } from "./chunk-W3Y5X3X3.js";
7
+ } from "./chunk-OVKTA5CX.js";
8
8
  import {
9
9
  publishRecordSchema
10
10
  } from "./chunk-VRZSDUZK.js";
@@ -1,7 +1,7 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  version
4
- } from "./chunk-FD364GM7.js";
4
+ } from "./chunk-NRHHB3YY.js";
5
5
 
6
6
  // src/config.ts
7
7
  import { portNumbers } from "get-port";
@@ -1,7 +1,7 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  config
4
- } from "./chunk-VJAVNG6U.js";
4
+ } from "./chunk-CSJIKXUD.js";
5
5
  import {
6
6
  roleSchema
7
7
  } from "./chunk-F3TQHNSQ.js";
@@ -4,7 +4,7 @@ import {
4
4
  mcpChannelModes,
5
5
  mcpEnvironmentPolicies,
6
6
  mcpServerChannelSchema
7
- } from "./chunk-PIWBFJX3.js";
7
+ } from "./chunk-AOZQPCWI.js";
8
8
  import {
9
9
  environmentSlugSchema
10
10
  } from "./chunk-Q26DFKTY.js";
@@ -1,7 +1,7 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  mcpEnvironmentSchema
4
- } from "./chunk-TQL55CUG.js";
4
+ } from "./chunk-EXJUFF6G.js";
5
5
  import {
6
6
  billingPlanSchema
7
7
  } from "./chunk-F3TQHNSQ.js";
@@ -26,7 +26,7 @@ import {
26
26
  mcpServerSchema,
27
27
  mcpServerVersionSchema,
28
28
  monthlyUsageSchema
29
- } from "./chunk-PIWBFJX3.js";
29
+ } from "./chunk-AOZQPCWI.js";
30
30
  import {
31
31
  environmentSlugSchema
32
32
  } from "./chunk-Q26DFKTY.js";
@@ -0,0 +1,34 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+
3
+ // src/helpers/input-policy.ts
4
+ import { AsyncLocalStorage } from "node:async_hooks";
5
+ import { Command } from "commander";
6
+ var policy = new AsyncLocalStorage();
7
+ var InputPolicyCommand = class extends Command {
8
+ parse(argv, options) {
9
+ return policy.run(false, () => super.parse(argv, options));
10
+ }
11
+ async parseAsync(argv, options) {
12
+ return policy.run(false, () => super.parseAsync(argv, options));
13
+ }
14
+ };
15
+ var isInputDisabled = () => policy.getStore() ?? false;
16
+ function configureInputPolicy(program) {
17
+ const register = (command) => {
18
+ if (!command.options.some((option) => option.long === "--no-input")) {
19
+ command.option("--no-input", "Disable prompts and browser launches");
20
+ }
21
+ for (const child of command.commands) register(child);
22
+ };
23
+ register(program);
24
+ program.hook("preAction", (_command, actionCommand) => {
25
+ const disabled = (command) => command !== null && (command.opts().input === false || disabled(command.parent));
26
+ policy.enterWith(disabled(actionCommand));
27
+ });
28
+ }
29
+
30
+ export {
31
+ InputPolicyCommand,
32
+ isInputDisabled,
33
+ configureInputPolicy
34
+ };
@@ -3,15 +3,15 @@ import {
3
3
  SdkLanguage,
4
4
  sdkVersionStatusSchema,
5
5
  sdkVersionTargetStateSchema
6
- } from "./chunk-6YOXEMMX.js";
6
+ } from "./chunk-Y2OQOAY7.js";
7
7
  import {
8
8
  cloudflareHostnameStateSchema
9
- } from "./chunk-TQL55CUG.js";
9
+ } from "./chunk-EXJUFF6G.js";
10
10
  import {
11
11
  RegistryResourceTypes,
12
12
  baseRegistrySchema,
13
13
  contentShaSchema
14
- } from "./chunk-PIWBFJX3.js";
14
+ } from "./chunk-AOZQPCWI.js";
15
15
  import {
16
16
  brandedUid,
17
17
  docVersionSchema,
@@ -322,6 +322,25 @@ var limitsSnapshotSchema = external_exports.strictObject({
322
322
  teams: external_exports.array(epochSchema)
323
323
  });
324
324
 
325
+ // ../../packages/entities/dist/auth/secret-revocation.js
326
+ var SECRET_REVOCATION_TTL_MS = 120 * 6e4;
327
+ var secretRevocationSchema = entitySchema.extend({
328
+ /** `secretAddressKey`, `teamSecretsKey` or `ALL_SECRETS_KEY` */
329
+ key: external_exports.string().min(1),
330
+ /** Epoch ms of the latest change */
331
+ revokedBefore: external_exports.number().int(),
332
+ /** `revokedBefore` plus `SECRET_REVOCATION_TTL_MS`, as a Date for the TTL index */
333
+ expiresAt: external_exports.date()
334
+ });
335
+ var secretRevocationSnapshotSchema = external_exports.strictObject({
336
+ /** Epoch ms on the clock of whoever read the rows, sampled before the read */
337
+ syncedAt: external_exports.number().int().min(0),
338
+ secrets: external_exports.array(external_exports.strictObject({
339
+ key: external_exports.string(),
340
+ revokedBefore: external_exports.number().int()
341
+ }))
342
+ });
343
+
325
344
  // ../../packages/entities/dist/auth/vcs-link-state.js
326
345
  var vcsProviderSchema = external_exports.enum(["github", "bitbucket"]);
327
346
  var vcsLinkStateSchema = external_exports.object({
@@ -0,0 +1,32 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ PRIVACY_VALUES
4
+ } from "./chunk-NAC63XJF.js";
5
+ import {
6
+ err,
7
+ ok
8
+ } from "./chunk-5ENKYZA4.js";
9
+ import {
10
+ external_exports
11
+ } from "./chunk-I57ID5K7.js";
12
+
13
+ // src/helpers/visibility.ts
14
+ var normalizeVisibility = (options) => {
15
+ const legacy = external_exports.enum(PRIVACY_VALUES).optional().safeParse(options.isPrivate);
16
+ if (!legacy.success) return err(legacy.error.issues[0].message);
17
+ if (options.public && options.private) {
18
+ return err("Use either --public or --private, not both.");
19
+ }
20
+ const legacyVisibility = legacy.data === void 0 ? void 0 : legacy.data === "true" || legacy.data === "private";
21
+ const visibility = options.private ? true : options.public ? false : void 0;
22
+ if (visibility !== void 0 && legacyVisibility !== void 0 && visibility !== legacyVisibility) {
23
+ return err(
24
+ "--isPrivate conflicts with the visibility flag. Use matching values or a single visibility option."
25
+ );
26
+ }
27
+ return ok(visibility ?? legacyVisibility);
28
+ };
29
+
30
+ export {
31
+ normalizeVisibility
32
+ };
@@ -1,17 +1,17 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  BaseCollections
4
- } from "./chunk-GUF4PKDL.js";
4
+ } from "./chunk-TI4NDKQC.js";
5
5
  import {
6
6
  sdkTrackedApiVersionSpec
7
- } from "./chunk-ZZTCEMCG.js";
7
+ } from "./chunk-2AK5O3NQ.js";
8
+ import {
9
+ managedDocSchema
10
+ } from "./chunk-TYNF7ROW.js";
8
11
  import {
9
12
  err,
10
13
  ok
11
14
  } from "./chunk-5ENKYZA4.js";
12
- import {
13
- managedDocSchema
14
- } from "./chunk-4RF2NKQN.js";
15
15
 
16
16
  // src/domains/sdk/inspect-sdk.ts
17
17
  var sdkMetadata = (sdk, builds) => {
@@ -2,7 +2,7 @@ import { createRequire as $$cR } from "node:module"; const require = $$cR(import
2
2
 
3
3
  // package.json
4
4
  var name = "@scalar/cli";
5
- var version = "2.12.2";
5
+ var version = "2.13.0";
6
6
  var bin = {
7
7
  scalar: "./dist/index.js",
8
8
  "scalar-cli": "./dist/index.js"
@@ -1,10 +1,10 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  getAuthData
4
- } from "./chunk-MLBEF6MB.js";
4
+ } from "./chunk-DDDYR2HF.js";
5
5
  import {
6
6
  config
7
- } from "./chunk-VJAVNG6U.js";
7
+ } from "./chunk-CSJIKXUD.js";
8
8
  import {
9
9
  external_exports,
10
10
  objectSchema,
@@ -95,6 +95,7 @@ function createAccess(baseURL) {
95
95
  function makeRequest(options) {
96
96
  return fetch(`${baseURL}${options.url}`, {
97
97
  method: options.method,
98
+ signal: options.signal,
98
99
  headers: {
99
100
  ...options.headers,
100
101
  // An empty bearer token is always rejected — omit the header so the
@@ -110,9 +111,10 @@ function createAccess(baseURL) {
110
111
  return formatResponse({ data: await res.json(), status: res.status }, options.schema);
111
112
  }).catch((err) => formatError(err));
112
113
  }
113
- function get({ collectionPath, query, schema, type }) {
114
+ function get({ collectionPath, query, schema, type, signal }) {
114
115
  const data = schemaModel({ collectionPath, query }, getRecordRequestSchema);
115
116
  return makeRequest({
117
+ signal,
116
118
  url: `/database/get-${type}`,
117
119
  method: "POST",
118
120
  data,
@@ -267,17 +269,22 @@ function initDatabase(baseUrl) {
267
269
  }
268
270
 
269
271
  // src/helpers/database.ts
270
- var getDatabaseClient = async () => {
272
+ function createDatabaseClient(accessToken) {
271
273
  const client = initDatabase(`${config.services.api}/rtdb`);
274
+ client.updateAccessToken(accessToken);
275
+ return client;
276
+ }
277
+ var getDatabaseClient = async () => {
272
278
  const auth = await getAuthData();
279
+ const client = createDatabaseClient(auth.accessToken);
273
280
  auth.addEventListener((state) => {
274
281
  Object.assign(auth, state);
275
282
  client.updateAccessToken(state.accessToken);
276
283
  });
277
- client.updateAccessToken(auth.accessToken);
278
284
  return client;
279
285
  };
280
286
 
281
287
  export {
288
+ createDatabaseClient,
282
289
  getDatabaseClient
283
290
  };
@@ -0,0 +1,167 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ getPublishDeploymentUrl
4
+ } from "./chunk-7S34K2P3.js";
5
+ import {
6
+ writeJson
7
+ } from "./chunk-SNQFFEYH.js";
8
+ import {
9
+ createDatabaseClient
10
+ } from "./chunk-OVKTA5CX.js";
11
+ import {
12
+ publishRecordSchema
13
+ } from "./chunk-VRZSDUZK.js";
14
+ import {
15
+ output
16
+ } from "./chunk-T5HJUAWB.js";
17
+ import {
18
+ external_exports
19
+ } from "./chunk-I57ID5K7.js";
20
+
21
+ // src/domains/project/deployments/observe.ts
22
+ import { performance } from "node:perf_hooks";
23
+ import { setTimeout as sleep } from "node:timers/promises";
24
+ var timeoutSchema = external_exports.coerce.number().positive().finite().max(2147483);
25
+ var defaultWaitSeconds = 600;
26
+ function recoveryCommand(publishUid) {
27
+ return `scalar project deployments get ${publishUid} --wait`;
28
+ }
29
+ function printRecord(record) {
30
+ console.log(`Build ID: ${record.uid}`);
31
+ console.log(`Status: ${record.status}`);
32
+ if (record.message) console.log(record.message);
33
+ if (record.status !== "deployed") return;
34
+ const url = getPublishDeploymentUrl(record);
35
+ if (url)
36
+ console.log(`${record.preview ? "Preview URL" : "Deployment URL"}: ${url}`);
37
+ if (record.hasWarnings) {
38
+ output.warn().title("The build finished with warnings").line("Check the build log in the Scalar Dashboard for details.").print();
39
+ }
40
+ }
41
+ async function observePublish({
42
+ teamUid,
43
+ accessToken,
44
+ publishUid,
45
+ wait = true,
46
+ timeout = defaultWaitSeconds,
47
+ json = false
48
+ }) {
49
+ const controller = new AbortController();
50
+ const deadline = performance.now() + timeout * 1e3;
51
+ const timer = setTimeout(() => controller.abort(), timeout * 1e3);
52
+ const interruption = { code: 0 };
53
+ const interrupt = (code) => {
54
+ interruption.code = code;
55
+ controller.abort();
56
+ };
57
+ const onInterrupt = () => interrupt(130);
58
+ const onTerminate = () => interrupt(143);
59
+ process.once("SIGINT", onInterrupt);
60
+ process.once("SIGTERM", onTerminate);
61
+ function visibilityError(message) {
62
+ console.error(`${message}
63
+ Build ID: ${publishUid}
64
+ Stopping local waiting does not cancel the remote build; deployment may continue.
65
+ Inspect with the original team selected: ${recoveryCommand(publishUid)}`);
66
+ process.exitCode = interruption.code || 1;
67
+ }
68
+ try {
69
+ const client = createDatabaseClient(accessToken);
70
+ const progress = { message: "" };
71
+ while (!controller.signal.aborted) {
72
+ const response = await client.getOne({
73
+ collectionPath: `team/${teamUid}/publish`,
74
+ query: { uid: publishUid },
75
+ schema: publishRecordSchema,
76
+ signal: controller.signal
77
+ });
78
+ if (controller.signal.aborted) break;
79
+ if (response.error) {
80
+ visibilityError(
81
+ "Could not load deployment status. The build outcome is unknown."
82
+ );
83
+ return;
84
+ }
85
+ const parsed = publishRecordSchema.safeParse(response.data);
86
+ if (!parsed.success || parsed.data.uid !== publishUid) {
87
+ visibilityError(
88
+ "Could not read the requested build record. The build outcome is unknown."
89
+ );
90
+ return;
91
+ }
92
+ const record = parsed.data;
93
+ if (!wait || record.status !== "pending" && record.status !== "building") {
94
+ if (json && record.status === "deployed") {
95
+ writeJson({
96
+ uid: record.uid,
97
+ status: "deployed",
98
+ url: getPublishDeploymentUrl(record) ?? null,
99
+ preview: record.preview,
100
+ hasWarnings: record.hasWarnings ?? false
101
+ });
102
+ } else if (!json) {
103
+ printRecord(record);
104
+ }
105
+ if (wait && record.status !== "deployed") {
106
+ console.error(
107
+ `Build ${publishUid} has status ${record.status}; it is not a confirmed deployment. ${record.message}`
108
+ );
109
+ process.exitCode = 1;
110
+ }
111
+ return;
112
+ }
113
+ const message = `${record.status}: ${record.message}`;
114
+ if (!json && message !== progress.message) {
115
+ console.error(message);
116
+ progress.message = message;
117
+ }
118
+ await sleep(
119
+ Math.max(0, Math.min(3e3, deadline - performance.now())),
120
+ void 0,
121
+ { signal: controller.signal }
122
+ );
123
+ }
124
+ visibilityError(
125
+ interruption.code ? "Operation cancelled." : "Timed out waiting for deployment status."
126
+ );
127
+ } catch {
128
+ visibilityError(
129
+ interruption.code ? "Operation cancelled." : controller.signal.aborted ? "Timed out waiting for deployment status." : "Could not load deployment status. The build outcome is unknown."
130
+ );
131
+ } finally {
132
+ clearTimeout(timer);
133
+ process.removeListener("SIGINT", onInterrupt);
134
+ process.removeListener("SIGTERM", onTerminate);
135
+ }
136
+ }
137
+ async function finishPublish(args) {
138
+ if (args.json) {
139
+ if (!args.wait) {
140
+ writeJson({
141
+ uid: args.publishUid,
142
+ status: "accepted"
143
+ });
144
+ return;
145
+ }
146
+ await observePublish(args);
147
+ return;
148
+ }
149
+ console.log(`Build ID: ${args.publishUid}`);
150
+ console.log(
151
+ `Inspect with the original team selected: ${recoveryCommand(args.publishUid)}`
152
+ );
153
+ if (!args.wait) {
154
+ console.log(
155
+ "Publish accepted. Deployment is not yet confirmed; the remote build continues."
156
+ );
157
+ return;
158
+ }
159
+ await observePublish(args);
160
+ }
161
+
162
+ export {
163
+ timeoutSchema,
164
+ defaultWaitSeconds,
165
+ observePublish,
166
+ finishPublish
167
+ };
@@ -0,0 +1,60 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ isInputDisabled
4
+ } from "./chunk-IRQJDPZE.js";
5
+ import {
6
+ err,
7
+ ok
8
+ } from "./chunk-5ENKYZA4.js";
9
+
10
+ // src/helpers/url-opener.ts
11
+ import { spawn } from "node:child_process";
12
+ var openBrowser = async (url) => {
13
+ if (isInputDisabled() || process.env.NODE_ENV === "INTEGRATION")
14
+ return ok(void 0);
15
+ const platform = process.platform;
16
+ if (platform !== "darwin" && platform !== "linux" && platform !== "win32") {
17
+ return err(
18
+ `Cannot open a browser on ${platform}. Open this URL manually: ${url}`
19
+ );
20
+ }
21
+ const command = platform === "win32" ? "powershell.exe" : platform === "darwin" ? "open" : "xdg-open";
22
+ const args = platform === "win32" ? [
23
+ "-NoProfile",
24
+ "-NonInteractive",
25
+ "-Command",
26
+ "Start-Process -FilePath $env:SCALAR_BROWSER_URL -ErrorAction Stop"
27
+ ] : [url];
28
+ const result = await new Promise((resolve, reject) => {
29
+ const child = spawn(command, args, {
30
+ shell: false,
31
+ windowsHide: true,
32
+ detached: true,
33
+ stdio: "ignore",
34
+ ...platform === "win32" ? { env: { ...process.env, SCALAR_BROWSER_URL: url } } : {}
35
+ });
36
+ const timer = setTimeout(() => {
37
+ child.unref();
38
+ resolve();
39
+ }, 500);
40
+ child.once("error", (error) => {
41
+ clearTimeout(timer);
42
+ reject(error);
43
+ });
44
+ child.once("exit", (code, signal) => {
45
+ clearTimeout(timer);
46
+ if (code === 0) resolve();
47
+ else
48
+ reject(new Error(`${command} exited with ${signal ?? `code ${code}`}`));
49
+ });
50
+ }).then(() => ok(void 0)).catch(
51
+ (error) => err(
52
+ `Could not open your browser: ${error.message}. Open this URL manually: ${url}`
53
+ )
54
+ );
55
+ return result;
56
+ };
57
+
58
+ export {
59
+ openBrowser
60
+ };
@@ -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-ZNBXKA7T.js");
13
+ const { downloadIsolate } = await import("./action-ESVI46KE.js");
14
14
  await downloadIsolate();
15
15
  });
16
16
  return cmd;
@@ -12,8 +12,8 @@ import path from "node:path";
12
12
  import chokidar from "chokidar";
13
13
  var watchFile = async (file, callback, options) => {
14
14
  if (isUrl(file)) {
15
- setInterval(callback, 5e3);
16
- return;
15
+ const interval = setInterval(callback, 5e3);
16
+ return { unsubscribe: () => clearInterval(interval) };
17
17
  }
18
18
  const absoluteFilePath = path.resolve(file);
19
19
  if (!fs.existsSync(absoluteFilePath)) {
@@ -0,0 +1,11 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+
3
+ // src/helpers/std-out/json.ts
4
+ function writeJson(result) {
5
+ process.stdout.write(`${JSON.stringify(result, null, 2)}
6
+ `);
7
+ }
8
+
9
+ export {
10
+ writeJson
11
+ };
@@ -5,19 +5,19 @@ import {
5
5
  loginPortalSchema,
6
6
  managedSchema,
7
7
  workspaceSchema
8
- } from "./chunk-ZK76AK3B.js";
8
+ } from "./chunk-KPLWZIOV.js";
9
9
  import {
10
10
  userSchema
11
11
  } from "./chunk-YTTDYTVB.js";
12
12
  import {
13
13
  sdkSchema
14
- } from "./chunk-6YOXEMMX.js";
14
+ } from "./chunk-Y2OQOAY7.js";
15
15
  import {
16
16
  FEEDBACK_PATH_MAX_LENGTH,
17
17
  helpfulReasons,
18
18
  siteDeploySchema,
19
19
  unhelpfulReasons
20
- } from "./chunk-TQL55CUG.js";
20
+ } from "./chunk-EXJUFF6G.js";
21
21
  import {
22
22
  teamSchema
23
23
  } from "./chunk-F3TQHNSQ.js";
@@ -29,12 +29,12 @@ import {
29
29
  import {
30
30
  managedDocSchema,
31
31
  ruleSchema
32
- } from "./chunk-4RF2NKQN.js";
32
+ } from "./chunk-TYNF7ROW.js";
33
33
  import {
34
34
  docInstanceOriginSchema,
35
35
  docInstanceSchema,
36
36
  docVersionRecordSchema
37
- } from "./chunk-PIWBFJX3.js";
37
+ } from "./chunk-AOZQPCWI.js";
38
38
  import {
39
39
  brandedUid,
40
40
  emailSchema,
@@ -218,6 +218,7 @@ var BaseCollections = {
218
218
  AuthSessions: "auth-sessions",
219
219
  AuthCounters: "auth-counters",
220
220
  AuthRevocations: "auth-revocations",
221
+ SecretRevocations: "secret-revocations",
221
222
  SecretMetadata: (teamUid) => `team/${teamUid}/secrets`,
222
223
  SecretValues: (teamUid) => `team/${teamUid}/secret-values`,
223
224
  Vars: (teamUid) => `team/${teamUid}/vars`,
@@ -5,10 +5,10 @@ import {
5
5
  import {
6
6
  ISOLATE_DIR,
7
7
  ISOLATE_EXTRACTION_DIR
8
- } from "./chunk-UJU2ORWU.js";
8
+ } from "./chunk-RAU5KE6F.js";
9
9
  import {
10
10
  config
11
- } from "./chunk-VJAVNG6U.js";
11
+ } from "./chunk-CSJIKXUD.js";
12
12
  import {
13
13
  output
14
14
  } from "./chunk-T5HJUAWB.js";
@@ -14,16 +14,16 @@ import {
14
14
  webhookSubscriptionSchema,
15
15
  workspaceSchema,
16
16
  workspaceVersionSchema
17
- } from "./chunk-ZK76AK3B.js";
17
+ } from "./chunk-KPLWZIOV.js";
18
18
  import {
19
19
  userSchema
20
20
  } from "./chunk-YTTDYTVB.js";
21
21
  import {
22
22
  sdkSchema
23
- } from "./chunk-6YOXEMMX.js";
23
+ } from "./chunk-Y2OQOAY7.js";
24
24
  import {
25
25
  mcpEnvironmentSchema
26
- } from "./chunk-TQL55CUG.js";
26
+ } from "./chunk-EXJUFF6G.js";
27
27
  import {
28
28
  RENEWAL_MARGIN_MS,
29
29
  SESSION_EXPIRED,
@@ -33,10 +33,10 @@ import {
33
33
  needsRenewal,
34
34
  refreshToken,
35
35
  renewAuth
36
- } from "./chunk-MLBEF6MB.js";
36
+ } from "./chunk-DDDYR2HF.js";
37
37
  import {
38
38
  config
39
- } from "./chunk-VJAVNG6U.js";
39
+ } from "./chunk-CSJIKXUD.js";
40
40
  import {
41
41
  UnifiedDocsMigrationStatus,
42
42
  pendingInviteSchema,
@@ -57,7 +57,7 @@ import {
57
57
  managedDocSchema,
58
58
  managedDocVersionSchema,
59
59
  ruleSchema
60
- } from "./chunk-4RF2NKQN.js";
60
+ } from "./chunk-TYNF7ROW.js";
61
61
  import {
62
62
  createdMcpServerSchema,
63
63
  docInstanceSchema,
@@ -67,7 +67,7 @@ import {
67
67
  registryGitBindingSchema,
68
68
  registryPublishRecordSchema,
69
69
  secretMetadataSchema
70
- } from "./chunk-PIWBFJX3.js";
70
+ } from "./chunk-AOZQPCWI.js";
71
71
  import {
72
72
  teamEnvironmentSchema
73
73
  } from "./chunk-Q26DFKTY.js";
@@ -2,7 +2,7 @@ import { createRequire as $$cR } from "node:module"; const require = $$cR(import
2
2
  import {
3
3
  baseRegistrySchema,
4
4
  docVersionToolSchema
5
- } from "./chunk-PIWBFJX3.js";
5
+ } from "./chunk-AOZQPCWI.js";
6
6
  import {
7
7
  brandedUid,
8
8
  docVersionSchema,
@@ -28,7 +28,7 @@ function BundleCommand() {
28
28
  cmd.argument("[file|url]", "API description file path or URL to bundle");
29
29
  cmd.option(
30
30
  "-o, --output <file>",
31
- "Output file, or - for YAML on stdout (required for URLs and non-interactive use; otherwise confirms overwriting the input file)"
31
+ "Output file, or - for stdout in the input format (required for URLs and non-interactive use; otherwise confirms overwriting the input file)"
32
32
  );
33
33
  cmd.option("--treeShake", "Remove unused components from the bundled output");
34
34
  cmd.option(
@@ -42,7 +42,7 @@ function BundleCommand() {
42
42
  );
43
43
  completeFiles(cmd, ["file|url"], ["--output"]);
44
44
  cmd.action(async (...args) => {
45
- const { bundleAction } = await import("./action-OWWGJ34K.js");
45
+ const { bundleAction } = await import("./action-F6JSCBEU.js");
46
46
  return bundleAction(...args);
47
47
  });
48
48
  return cmd;