@tailor-platform/sdk 1.45.1 → 1.46.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 (37) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/application-B4zVVNRS.mjs.map +1 -1
  3. package/dist/cli/index.mjs +71 -49
  4. package/dist/cli/index.mjs.map +1 -1
  5. package/dist/cli/lib.d.mts +7 -7
  6. package/dist/cli/lib.mjs +2 -2
  7. package/dist/cli/lib.mjs.map +1 -1
  8. package/dist/configure/index.d.mts +1 -1
  9. package/dist/{crash-report-BUHzuzDn.mjs → crashreport-6mcMyWu4.mjs} +1 -1
  10. package/dist/{crash-report-CtYCva4d.mjs → crashreport-DGeGj9BF.mjs} +8 -8
  11. package/dist/crashreport-DGeGj9BF.mjs.map +1 -0
  12. package/dist/{index-DUKJPEwq.d.mts → index-PB0otrDj.d.mts} +3 -3
  13. package/dist/{runtime-D5AJYWnF.mjs → runtime-B67skpW-.mjs} +258 -98
  14. package/dist/runtime-B67skpW-.mjs.map +1 -0
  15. package/dist/telemetry-21afNV9_.mjs +4 -0
  16. package/dist/{telemetry-DXitz4RH.mjs → telemetry-DcL8Fsm_.mjs} +1 -1
  17. package/dist/{telemetry-DXitz4RH.mjs.map → telemetry-DcL8Fsm_.mjs.map} +1 -1
  18. package/dist/utils/test/index.d.mts +1 -1
  19. package/docs/cli/application.md +19 -17
  20. package/docs/cli/crashreport.md +119 -0
  21. package/docs/cli/executor.md +9 -9
  22. package/docs/cli/function.md +5 -5
  23. package/docs/cli/tailordb.md +1 -1
  24. package/docs/cli/workflow.md +8 -8
  25. package/docs/cli-reference.md +8 -8
  26. package/docs/generator/builtin.md +36 -0
  27. package/docs/quickstart.md +2 -2
  28. package/docs/services/auth.md +2 -2
  29. package/docs/services/secret.md +4 -4
  30. package/docs/services/tailordb-migration.md +10 -10
  31. package/docs/services/tailordb.md +1 -1
  32. package/package.json +9 -10
  33. package/dist/crash-report-CtYCva4d.mjs.map +0 -1
  34. package/dist/runtime-D5AJYWnF.mjs.map +0 -1
  35. package/dist/telemetry-BvI1EgMG.mjs +0 -4
  36. package/docs/cli/crash-report.md +0 -118
  37. /package/dist/{application-BIzicxMA.mjs → application-Boa_11Nv.mjs} +0 -0
@@ -6,7 +6,7 @@ import { C as loadWorkspaceId, D as writePlatformConfig, S as loadAccessToken, _
6
6
  import { t as multiline } from "./multiline-e3IpANmS.mjs";
7
7
  import { t as readPackageJson } from "./package-json-6Px8bDpG.mjs";
8
8
  import { n as isCLIError, t as createCLIError } from "./errors-wNQxQQBH.mjs";
9
- import { r as withSpan } from "./telemetry-DXitz4RH.mjs";
9
+ import { r as withSpan } from "./telemetry-DcL8Fsm_.mjs";
10
10
  import { arg, createDefineCommand, defineCommand, runCommand } from "politty";
11
11
  import { z } from "zod";
12
12
  import * as fs$1 from "node:fs";
@@ -25,14 +25,13 @@ import * as crypto from "node:crypto";
25
25
  import { createHash } from "node:crypto";
26
26
  import { resolveTSConfig } from "pkg-types";
27
27
  import { ScalarType, create, fromJson, toJson } from "@bufbuild/protobuf";
28
+ import { ExitPromptError } from "@inquirer/core";
29
+ import { confirm, input, password } from "@inquirer/prompts";
30
+ import { isCI } from "std-env";
28
31
  import * as rolldown from "rolldown";
29
32
  import * as fs from "node:fs/promises";
30
33
  import { glob } from "node:fs/promises";
31
34
  import * as inflection from "inflection";
32
- import { ExitPromptError } from "@inquirer/core";
33
- import { confirm, input, password } from "@inquirer/prompts";
34
- import { isCI } from "std-env";
35
- import ora from "ora";
36
35
  import { setTimeout as setTimeout$1 } from "timers/promises";
37
36
  import { spawn } from "node:child_process";
38
37
  import { watch } from "chokidar";
@@ -599,6 +598,30 @@ Values already present in \`--body\` are never overridden. If a value cannot be
599
598
  }
600
599
  });
601
600
 
601
+ //#endregion
602
+ //#region src/cli/shared/prompt.ts
603
+ /**
604
+ * Wraps a prompt function with CI guard and cancellation handling.
605
+ * @param fn - A prompt function from `@inquirer/prompts`
606
+ * @returns A wrapped function that throws in CI and exits on cancel
607
+ */
608
+ function withGuard(fn) {
609
+ return async (...args) => {
610
+ if (isCI) throw new CIPromptError();
611
+ try {
612
+ return await fn(...args);
613
+ } catch (error) {
614
+ if (error instanceof ExitPromptError) process.exit(130);
615
+ throw error;
616
+ }
617
+ };
618
+ }
619
+ const prompt = {
620
+ confirm: withGuard(confirm),
621
+ text: withGuard(input),
622
+ password: withGuard(password)
623
+ };
624
+
602
625
  //#endregion
603
626
  //#region src/cli/cache/types.ts
604
627
  const cacheOutputFileSchema = z.object({
@@ -813,7 +836,7 @@ ${machineUserFields}
813
836
  return multiline`
814
837
  // This file is auto-generated by @tailor-platform/sdk
815
838
  // Do not edit this file manually
816
- // Regenerated automatically when running 'tailor-sdk apply' or 'tailor-sdk generate'
839
+ // Regenerated automatically when running 'tailor-sdk deploy' or 'tailor-sdk generate'
817
840
 
818
841
  declare module "@tailor-platform/sdk" {
819
842
  interface AttributeMap ${mapBody}
@@ -1240,7 +1263,7 @@ function copyMetadataToExtendedType(original, extended) {
1240
1263
  }
1241
1264
 
1242
1265
  //#endregion
1243
- //#region src/cli/commands/apply/change-set.ts
1266
+ //#region src/cli/commands/deploy/change-set.ts
1244
1267
  /**
1245
1268
  * Create a new ChangeSet for tracking resource changes.
1246
1269
  * @param title - Title for the change set
@@ -1309,7 +1332,7 @@ function formatPlanSummary(summary) {
1309
1332
  }
1310
1333
 
1311
1334
  //#endregion
1312
- //#region src/cli/commands/apply/compare.ts
1335
+ //#region src/cli/commands/deploy/compare.ts
1313
1336
  /**
1314
1337
  * Stable JSON-like serialization that sorts object keys and ignores proto runtime metadata.
1315
1338
  * @param value - Value to serialize
@@ -1349,7 +1372,7 @@ function areNormalizedEqual(left, right) {
1349
1372
  }
1350
1373
 
1351
1374
  //#endregion
1352
- //#region src/cli/commands/apply/label.ts
1375
+ //#region src/cli/commands/deploy/label.ts
1353
1376
  /**
1354
1377
  * Build TRN prefix for a workspace.
1355
1378
  * @param workspaceId - Workspace ID
@@ -1390,7 +1413,7 @@ async function buildMetaRequest(trn, appName, existingLabels) {
1390
1413
  }
1391
1414
 
1392
1415
  //#endregion
1393
- //#region src/cli/commands/apply/application.ts
1416
+ //#region src/cli/commands/deploy/application.ts
1394
1417
  /**
1395
1418
  * Apply application changes for the given phase.
1396
1419
  * @param client - Operator client instance
@@ -1573,7 +1596,7 @@ function protoSubgraph(subgraph) {
1573
1596
  }
1574
1597
 
1575
1598
  //#endregion
1576
- //#region src/cli/commands/apply/secrets-state.ts
1599
+ //#region src/cli/commands/deploy/secrets-state.ts
1577
1600
  const SecretsStateSchema = z.object({
1578
1601
  vaults: z.record(z.string(), z.record(z.string(), z.string())),
1579
1602
  connections: z.record(z.string(), z.string()).optional()
@@ -1618,7 +1641,7 @@ function hashValue(value) {
1618
1641
  }
1619
1642
 
1620
1643
  //#endregion
1621
- //#region src/cli/commands/apply/auth-connection.ts
1644
+ //#region src/cli/commands/deploy/auth-connection.ts
1622
1645
  function connectionTrn(workspaceId, name) {
1623
1646
  return `${trnPrefix(workspaceId)}:auth-connection:${name}`;
1624
1647
  }
@@ -1843,7 +1866,7 @@ async function applyAuthConnections(client, result, phase) {
1843
1866
  }
1844
1867
 
1845
1868
  //#endregion
1846
- //#region src/cli/commands/apply/function-registry.ts
1869
+ //#region src/cli/commands/deploy/function-registry.ts
1847
1870
  const CHUNK_SIZE = 64 * 1024;
1848
1871
  /**
1849
1872
  * Compute SHA-256 content hash for a script string.
@@ -2170,7 +2193,7 @@ async function applyFunctionRegistry(client, workspaceId, result, phase = "creat
2170
2193
  }
2171
2194
 
2172
2195
  //#endregion
2173
- //#region src/cli/commands/apply/grouped-display.ts
2196
+ //#region src/cli/commands/deploy/grouped-display.ts
2174
2197
  /**
2175
2198
  * Convert grouped function registry changes into mutable name sets.
2176
2199
  * @param changes - Grouped function registry changes
@@ -2485,7 +2508,7 @@ function parseIdPPermission(rawPermission) {
2485
2508
  }
2486
2509
 
2487
2510
  //#endregion
2488
- //#region src/cli/commands/apply/idp.ts
2511
+ //#region src/cli/commands/deploy/idp.ts
2489
2512
  /**
2490
2513
  * Build the vault name for an IdP client.
2491
2514
  * @param namespaceName - IdP namespace name
@@ -2946,7 +2969,7 @@ function protoIdPOperand(operand) {
2946
2969
  }
2947
2970
 
2948
2971
  //#endregion
2949
- //#region src/cli/commands/apply/auth.ts
2972
+ //#region src/cli/commands/deploy/auth.ts
2950
2973
  /**
2951
2974
  * Apply auth-related changes for the given phase.
2952
2975
  * @param client - Operator client instance
@@ -4077,31 +4100,7 @@ async function planAuthHooks(client, workspaceId, auths, deletedServices, forceA
4077
4100
  }
4078
4101
 
4079
4102
  //#endregion
4080
- //#region src/cli/shared/prompt.ts
4081
- /**
4082
- * Wraps a prompt function with CI guard and cancellation handling.
4083
- * @param fn - A prompt function from `@inquirer/prompts`
4084
- * @returns A wrapped function that throws in CI and exits on cancel
4085
- */
4086
- function withGuard(fn) {
4087
- return async (...args) => {
4088
- if (isCI) throw new CIPromptError();
4089
- try {
4090
- return await fn(...args);
4091
- } catch (error) {
4092
- if (error instanceof ExitPromptError) process.exit(130);
4093
- throw error;
4094
- }
4095
- };
4096
- }
4097
- const prompt = {
4098
- confirm: withGuard(confirm),
4099
- text: withGuard(input),
4100
- password: withGuard(password)
4101
- };
4102
-
4103
- //#endregion
4104
- //#region src/cli/commands/apply/confirm.ts
4103
+ //#region src/cli/commands/deploy/confirm.ts
4105
4104
  /**
4106
4105
  * Confirm reassignment of resources when owner conflicts are detected.
4107
4106
  * @param conflicts - Detected owner conflicts
@@ -4186,7 +4185,7 @@ async function confirmImportantResourceDeletion(resources, yes) {
4186
4185
  }
4187
4186
 
4188
4187
  //#endregion
4189
- //#region src/cli/commands/apply/auth-invoker.ts
4188
+ //#region src/cli/commands/deploy/auth-invoker.ts
4190
4189
  /**
4191
4190
  * Normalize an authInvoker value to the object form required by the proto payload.
4192
4191
  *
@@ -4212,7 +4211,7 @@ function normalizeAuthInvoker(authInvoker, authNamespace, context) {
4212
4211
  }
4213
4212
 
4214
4213
  //#endregion
4215
- //#region src/cli/commands/apply/executor.ts
4214
+ //#region src/cli/commands/deploy/executor.ts
4216
4215
  /**
4217
4216
  * Apply executor-related changes for the given phase.
4218
4217
  * @param client - Operator client instance
@@ -4590,7 +4589,7 @@ function protoExecutor(application, executor) {
4590
4589
  }
4591
4590
 
4592
4591
  //#endregion
4593
- //#region src/cli/commands/apply/resolver.ts
4592
+ //#region src/cli/commands/deploy/resolver.ts
4594
4593
  const SCALAR_TYPE_MAP = {
4595
4594
  uuid: {
4596
4595
  kind: "ScalarType",
@@ -4961,7 +4960,7 @@ function protoFields(fields, baseName, isInput) {
4961
4960
  }
4962
4961
 
4963
4962
  //#endregion
4964
- //#region src/cli/commands/apply/secret-manager.ts
4963
+ //#region src/cli/commands/deploy/secret-manager.ts
4965
4964
  /**
4966
4965
  * Plan secret manager changes based on current and desired state.
4967
4966
  * @param context - Planning context
@@ -5182,7 +5181,7 @@ async function applySecretManager(client, result, phase = "create-update", appli
5182
5181
  }
5183
5182
 
5184
5183
  //#endregion
5185
- //#region src/cli/commands/apply/staticwebsite.ts
5184
+ //#region src/cli/commands/deploy/staticwebsite.ts
5186
5185
  /**
5187
5186
  * Apply static website changes for the given phase.
5188
5187
  * @param client - Operator client instance
@@ -6763,7 +6762,171 @@ async function executeScript(options) {
6763
6762
  }
6764
6763
 
6765
6764
  //#endregion
6766
- //#region src/cli/commands/apply/tailordb/migration.ts
6765
+ //#region src/cli/shared/spinner.ts
6766
+ const FRAMES = [
6767
+ "⠋",
6768
+ "⠙",
6769
+ "⠹",
6770
+ "⠸",
6771
+ "⠼",
6772
+ "⠴",
6773
+ "⠦",
6774
+ "⠧",
6775
+ "⠇",
6776
+ "⠏"
6777
+ ];
6778
+ const FRAME_INTERVAL_MS = 80;
6779
+ const CURSOR_HIDE = "\x1B[?25l";
6780
+ const CURSOR_SHOW = "\x1B[?25h";
6781
+ const CLEAR_LINE = "\x1B[2K";
6782
+ const CURSOR_TO_START = "\r";
6783
+ const CURSOR_UP = "\x1B[1A";
6784
+ const SYNC_BEGIN = "\x1B[?2026h";
6785
+ const SYNC_END = "\x1B[?2026l";
6786
+ const ANSI_RE = /\u001B\[[0-9;]*[a-zA-Z]/g;
6787
+ function visibleLength(s) {
6788
+ return s.replace(ANSI_RE, "").length;
6789
+ }
6790
+ const activeSpinners = /* @__PURE__ */ new Set();
6791
+ let exitHookInstalled = false;
6792
+ let signalHookInstalled = false;
6793
+ function installExitHook() {
6794
+ if (exitHookInstalled) return;
6795
+ exitHookInstalled = true;
6796
+ process.on("exit", () => {
6797
+ for (const s of activeSpinners) s.cleanupOnExit();
6798
+ });
6799
+ }
6800
+ function installSignalHook() {
6801
+ if (signalHookInstalled) return;
6802
+ signalHookInstalled = true;
6803
+ const handler = () => {
6804
+ for (const s of [...activeSpinners]) s.stop();
6805
+ };
6806
+ process.prependListener("SIGINT", handler);
6807
+ process.prependListener("SIGTERM", handler);
6808
+ }
6809
+ var Spinner = class {
6810
+ text;
6811
+ #indent;
6812
+ #stream;
6813
+ #isEnabled;
6814
+ #frame = 0;
6815
+ #timer;
6816
+ #linesDrawn = 0;
6817
+ #started = false;
6818
+ constructor(options = {}) {
6819
+ this.text = "";
6820
+ this.#indent = options.indent ?? 0;
6821
+ this.#stream = options.stream ?? process.stderr;
6822
+ this.#isEnabled = Boolean(this.#stream.isTTY);
6823
+ }
6824
+ start(text) {
6825
+ if (text !== void 0) this.text = text;
6826
+ if (!this.#isEnabled) {
6827
+ this.#writeLine(`- ${this.text}`);
6828
+ return this;
6829
+ }
6830
+ if (this.#started) return this;
6831
+ installExitHook();
6832
+ installSignalHook();
6833
+ activeSpinners.add(this);
6834
+ this.#started = true;
6835
+ this.#stream.write(CURSOR_HIDE);
6836
+ this.#renderFrame();
6837
+ this.#timer = setInterval(() => this.#renderFrame(), FRAME_INTERVAL_MS);
6838
+ if (typeof this.#timer.unref === "function") this.#timer.unref();
6839
+ return this;
6840
+ }
6841
+ stop() {
6842
+ if (!this.#started) return this;
6843
+ this.#started = false;
6844
+ if (this.#timer) {
6845
+ clearInterval(this.#timer);
6846
+ this.#timer = void 0;
6847
+ }
6848
+ if (this.#isEnabled) {
6849
+ this.#clearDrawn();
6850
+ this.#stream.write(CURSOR_SHOW);
6851
+ }
6852
+ activeSpinners.delete(this);
6853
+ return this;
6854
+ }
6855
+ succeed(text) {
6856
+ return this.#stopAndPersist(symbols.success, text);
6857
+ }
6858
+ fail(text) {
6859
+ return this.#stopAndPersist(symbols.error, text);
6860
+ }
6861
+ warn(text) {
6862
+ return this.#stopAndPersist(symbols.warning, text);
6863
+ }
6864
+ /**
6865
+ * Called by the global exit hook to restore the cursor.
6866
+ * @internal
6867
+ */
6868
+ cleanupOnExit() {
6869
+ if (this.#timer) {
6870
+ clearInterval(this.#timer);
6871
+ this.#timer = void 0;
6872
+ }
6873
+ if (this.#isEnabled) this.#stream.write(CURSOR_SHOW);
6874
+ }
6875
+ #stopAndPersist(symbol, text) {
6876
+ if (text !== void 0) this.text = text;
6877
+ if (this.#started) {
6878
+ this.#started = false;
6879
+ if (this.#timer) {
6880
+ clearInterval(this.#timer);
6881
+ this.#timer = void 0;
6882
+ }
6883
+ if (this.#isEnabled) {
6884
+ this.#clearDrawn();
6885
+ this.#stream.write(CURSOR_SHOW);
6886
+ }
6887
+ activeSpinners.delete(this);
6888
+ }
6889
+ this.#writeLine(`${symbol} ${this.text}`);
6890
+ return this;
6891
+ }
6892
+ #renderFrame() {
6893
+ this.#stream.write(SYNC_BEGIN);
6894
+ this.#clearDrawn();
6895
+ const frame = styles.info(FRAMES[this.#frame] ?? FRAMES[0]);
6896
+ this.#frame = (this.#frame + 1) % FRAMES.length;
6897
+ const line = `${" ".repeat(this.#indent)}${frame} ${this.text}`;
6898
+ this.#stream.write(line);
6899
+ this.#stream.write(SYNC_END);
6900
+ const cols = this.#stream.columns || 80;
6901
+ this.#linesDrawn = Math.max(1, Math.ceil(visibleLength(line) / cols));
6902
+ }
6903
+ #clearDrawn() {
6904
+ if (this.#linesDrawn === 0) return;
6905
+ this.#stream.write(CURSOR_TO_START);
6906
+ this.#stream.write(CLEAR_LINE);
6907
+ for (let i = 1; i < this.#linesDrawn; i++) {
6908
+ this.#stream.write(CURSOR_UP);
6909
+ this.#stream.write(CLEAR_LINE);
6910
+ }
6911
+ this.#linesDrawn = 0;
6912
+ }
6913
+ #writeLine(content) {
6914
+ const indent = " ".repeat(this.#indent);
6915
+ this.#stream.write(`${indent}${content}\n`);
6916
+ }
6917
+ };
6918
+ /**
6919
+ * Create a terminal spinner. Falls back to a single line write in non-TTY
6920
+ * environments so output stays useful in CI logs.
6921
+ * @param options - Spinner options
6922
+ * @returns A Spinner instance
6923
+ */
6924
+ function spinner(options) {
6925
+ return new Spinner(options);
6926
+ }
6927
+
6928
+ //#endregion
6929
+ //#region src/cli/commands/deploy/tailordb/migration.ts
6767
6930
  /**
6768
6931
  * Migration execution service for TailorDB migrations
6769
6932
  *
@@ -6895,16 +7058,13 @@ async function executeMigrations(context, migrations) {
6895
7058
  logger.info(`Using machine user: ${styles.bold(machineUserName)} for namespace '${namespace}'`);
6896
7059
  for (const migration of namespaceMigrations) {
6897
7060
  const migrationLabel = `${migration.namespace}/${formatMigrationNumber(migration.number)}`;
6898
- const spinner = ora({
6899
- text: `Executing migration ${migrationLabel}...`,
6900
- prefixText: ""
6901
- }).start();
7061
+ const sp = spinner().start(`Executing migration ${migrationLabel}...`);
6902
7062
  const result = await executeSingleMigration(options, migration);
6903
7063
  if (result.success) {
6904
- spinner.succeed(`Migration ${migrationLabel} completed successfully`);
7064
+ sp.succeed(`Migration ${migrationLabel} completed successfully`);
6905
7065
  if (result.logs && result.logs.trim()) logger.log(`Logs:\n${result.logs}`);
6906
7066
  } else {
6907
- spinner.fail(`Migration ${migrationLabel} failed`);
7067
+ sp.fail(`Migration ${migrationLabel} failed`);
6908
7068
  if (result.logs) logger.error(`Logs:\n${result.logs}`);
6909
7069
  throw new Error(result.error ?? "Migration failed");
6910
7070
  }
@@ -6941,7 +7101,7 @@ function groupMigrationsByNamespace(migrations) {
6941
7101
  }
6942
7102
 
6943
7103
  //#endregion
6944
- //#region src/cli/commands/apply/tailordb/index.ts
7104
+ //#region src/cli/commands/deploy/tailordb/index.ts
6945
7105
  /**
6946
7106
  * Fetch all TailorDB types from remote for a namespace
6947
7107
  * @param {OperatorClient} client - Operator client instance
@@ -8187,7 +8347,7 @@ function formatMigrationCheckResults(results) {
8187
8347
  }
8188
8348
 
8189
8349
  //#endregion
8190
- //#region src/cli/commands/apply/workflow.ts
8350
+ //#region src/cli/commands/deploy/workflow.ts
8191
8351
  /**
8192
8352
  * Apply workflow changes for the given phase.
8193
8353
  * @param client - Operator client instance
@@ -8476,7 +8636,7 @@ function normalizeRetryPolicyForCompare(policy) {
8476
8636
  }
8477
8637
 
8478
8638
  //#endregion
8479
- //#region src/cli/commands/apply/apply.ts
8639
+ //#region src/cli/commands/deploy/deploy.ts
8480
8640
  function applicationTrn(workspaceId, name) {
8481
8641
  return `trn:v1:workspace:${workspaceId}:application:${name}`;
8482
8642
  }
@@ -8656,13 +8816,13 @@ function summarizePlanResults(results, displayEntries, serviceActions) {
8656
8816
  return summary;
8657
8817
  }
8658
8818
  /**
8659
- * Apply the configured application to the Tailor platform.
8660
- * @param options - Options for apply execution
8819
+ * Deploy the configured application to the Tailor platform.
8820
+ * @param options - Options for deploy execution
8661
8821
  * @returns Promise that resolves to `{ bundledScripts }` when `buildOnly` is true, otherwise void
8662
8822
  */
8663
- async function apply(options) {
8664
- return withSpan("apply", async (rootSpan) => {
8665
- rootSpan.setAttribute("apply.dry_run", options?.dryRun ?? false);
8823
+ async function deploy(options) {
8824
+ return withSpan("deploy", async (rootSpan) => {
8825
+ rootSpan.setAttribute("deploy.dry_run", options?.dryRun ?? false);
8666
8826
  const { config, application, workflowBuildResult, bundledScripts, buildOnly } = await withSpan("build", async () => {
8667
8827
  const { config, plugins } = await withSpan("build.loadConfig", () => loadConfig(options?.configPath));
8668
8828
  const dryRun = options?.dryRun ?? false;
@@ -9531,19 +9691,19 @@ async function getWorkflowExecution(options) {
9531
9691
  };
9532
9692
  }
9533
9693
  async function waitWithSpinner(waitFn, interval, json) {
9534
- const spinner = !json ? ora().start("Waiting for workflow to complete...") : null;
9694
+ const sp = !json ? spinner().start("Waiting for workflow to complete...") : null;
9535
9695
  const updateInterval = setInterval(() => {
9536
- if (spinner) spinner.text = `Waiting for workflow to complete... (${formatTime$2(/* @__PURE__ */ new Date())})`;
9696
+ if (sp) sp.text = `Waiting for workflow to complete... (${formatTime$2(/* @__PURE__ */ new Date())})`;
9537
9697
  }, interval);
9538
9698
  try {
9539
9699
  const result = await waitFn();
9540
9700
  const coloredStatus = colorizeStatus$1(WorkflowExecution_Status[result.status]);
9541
- if (result.status === "SUCCESS") spinner?.succeed(`Completed: ${coloredStatus}`);
9542
- else spinner?.fail(`Completed: ${coloredStatus}`);
9701
+ if (result.status === "SUCCESS") sp?.succeed(`Completed: ${coloredStatus}`);
9702
+ else sp?.fail(`Completed: ${coloredStatus}`);
9543
9703
  return result;
9544
9704
  } finally {
9545
9705
  clearInterval(updateInterval);
9546
- spinner?.stop();
9706
+ sp?.stop();
9547
9707
  }
9548
9708
  }
9549
9709
  /**
@@ -9591,7 +9751,7 @@ const executionsCommand = defineAppCommand({
9591
9751
  args: z.object({
9592
9752
  ...workspaceArgs,
9593
9753
  ...pagedLogArgs,
9594
- executionId: arg(z.string().optional(), {
9754
+ "execution-id": arg(z.string().optional(), {
9595
9755
  positional: true,
9596
9756
  description: "Execution ID (if provided, shows details)"
9597
9757
  }),
@@ -9713,7 +9873,7 @@ async function waitForExecution(options) {
9713
9873
  const { client, workspaceId, executionId, interval, showProgress, trackJobs } = options;
9714
9874
  let lastStatus;
9715
9875
  let lastRunningJobs;
9716
- const spinner = showProgress ? ora({ indent: 2 }).start("Waiting for workflow to complete...") : null;
9876
+ const sp = showProgress ? spinner({ indent: 2 }).start("Waiting for workflow to complete...") : null;
9717
9877
  try {
9718
9878
  while (true) {
9719
9879
  const { execution } = await client.getWorkflowExecution({
@@ -9721,19 +9881,19 @@ async function waitForExecution(options) {
9721
9881
  executionId
9722
9882
  });
9723
9883
  if (!execution) {
9724
- spinner?.fail(`Execution '${executionId}' not found.`);
9884
+ sp?.fail(`Execution '${executionId}' not found.`);
9725
9885
  throw new Error(`Execution '${executionId}' not found.`);
9726
9886
  }
9727
9887
  const now = formatTime$1(/* @__PURE__ */ new Date());
9728
9888
  const coloredStatus = colorizeStatus(execution.status);
9729
9889
  if (execution.status !== lastStatus) {
9730
9890
  if (showProgress) {
9731
- spinner?.stop();
9891
+ sp?.stop();
9732
9892
  logger.info(`Status: ${coloredStatus}`, {
9733
9893
  mode: "stream",
9734
9894
  indent: 2
9735
9895
  });
9736
- spinner?.start(`Waiting for workflow to complete...`);
9896
+ sp?.start(`Waiting for workflow to complete...`);
9737
9897
  }
9738
9898
  lastStatus = execution.status;
9739
9899
  }
@@ -9741,27 +9901,27 @@ async function waitForExecution(options) {
9741
9901
  const runningJobs = getRunningJobs(execution);
9742
9902
  if (runningJobs && runningJobs !== lastRunningJobs) {
9743
9903
  if (showProgress) {
9744
- spinner?.stop();
9904
+ sp?.stop();
9745
9905
  logger.info(`Job | ${runningJobs}: ${coloredStatus}`, {
9746
9906
  mode: "stream",
9747
9907
  indent: 2
9748
9908
  });
9749
- spinner?.start(`Waiting for workflow to complete...`);
9909
+ sp?.start(`Waiting for workflow to complete...`);
9750
9910
  }
9751
9911
  lastRunningJobs = runningJobs;
9752
9912
  }
9753
9913
  }
9754
- if (spinner) spinner.text = `Waiting for workflow to complete... (${now})`;
9914
+ if (sp) sp.text = `Waiting for workflow to complete... (${now})`;
9755
9915
  if (isTerminalStatus(execution.status)) {
9756
- if (execution.status === WorkflowExecution_Status.SUCCESS) spinner?.succeed(`Completed: ${coloredStatus}`);
9757
- else if (execution.status === WorkflowExecution_Status.FAILED) spinner?.fail(`Completed: ${coloredStatus}`);
9758
- else spinner?.warn(`Completed: ${coloredStatus}`);
9916
+ if (execution.status === WorkflowExecution_Status.SUCCESS) sp?.succeed(`Completed: ${coloredStatus}`);
9917
+ else if (execution.status === WorkflowExecution_Status.FAILED) sp?.fail(`Completed: ${coloredStatus}`);
9918
+ else sp?.warn(`Completed: ${coloredStatus}`);
9759
9919
  return toWorkflowExecutionInfo(execution);
9760
9920
  }
9761
9921
  await sleep(interval);
9762
9922
  }
9763
9923
  } catch (error) {
9764
- spinner?.stop();
9924
+ sp?.stop();
9765
9925
  throw error;
9766
9926
  }
9767
9927
  }
@@ -9984,7 +10144,7 @@ async function watchExecutorJob(options) {
9984
10144
  profile: options.profile
9985
10145
  });
9986
10146
  const interval = options.interval ?? 3e3;
9987
- const spinner = ora().start("Waiting for executor job to complete...");
10147
+ const sp = spinner().start("Waiting for executor job to complete...");
9988
10148
  try {
9989
10149
  const { executor } = await client.getExecutorExecutor({
9990
10150
  workspaceId,
@@ -10002,13 +10162,13 @@ async function watchExecutorJob(options) {
10002
10162
  })).job;
10003
10163
  if (!job) throw new Error(`Job '${options.jobId}' not found.`);
10004
10164
  if (isExecutorJobTerminalStatus(job.status)) break;
10005
- spinner.text = `Waiting for executor job... (${formatTime(/* @__PURE__ */ new Date())})`;
10165
+ sp.text = `Waiting for executor job... (${formatTime(/* @__PURE__ */ new Date())})`;
10006
10166
  await setTimeout$1(interval);
10007
10167
  }
10008
10168
  const jobInfo = toExecutorJobInfo(job);
10009
10169
  const coloredStatus = colorizeExecutorJobStatus(jobInfo.status);
10010
- if (job.status === ExecutorJobStatus.SUCCESS) spinner.succeed(`Executor job completed: ${coloredStatus}`);
10011
- else spinner.fail(`Executor job completed: ${coloredStatus}`);
10170
+ if (job.status === ExecutorJobStatus.SUCCESS) sp.succeed(`Executor job completed: ${coloredStatus}`);
10171
+ else sp.fail(`Executor job completed: ${coloredStatus}`);
10012
10172
  const attemptInfos = (await fetchAll(async (pageToken, maxPageSize) => {
10013
10173
  const { attempts, nextPageToken } = await client.listExecutorJobAttempts({
10014
10174
  workspaceId,
@@ -10026,7 +10186,7 @@ async function watchExecutorJob(options) {
10026
10186
  const operationReference = attemptInfos[0]?.operationReference;
10027
10187
  if (operationReference) switch (targetType) {
10028
10188
  case ExecutorTargetType.WORKFLOW:
10029
- spinner.stop();
10189
+ sp.stop();
10030
10190
  try {
10031
10191
  const executionResult = await waitForExecution({
10032
10192
  client,
@@ -10067,7 +10227,7 @@ async function watchExecutorJob(options) {
10067
10227
  }
10068
10228
  case ExecutorTargetType.FUNCTION:
10069
10229
  case ExecutorTargetType.JOB_FUNCTION:
10070
- spinner.start(`Waiting for function execution ${operationReference}...`);
10230
+ sp.start(`Waiting for function execution ${operationReference}...`);
10071
10231
  try {
10072
10232
  while (true) {
10073
10233
  const { execution } = await client.getFunctionExecution({
@@ -10078,8 +10238,8 @@ async function watchExecutorJob(options) {
10078
10238
  if (isFunctionExecutionTerminalStatus(execution.status)) {
10079
10239
  const statusStr = functionExecutionStatusToString(execution.status);
10080
10240
  const coloredFnStatus = colorizeFunctionExecutionStatus(statusStr);
10081
- if (execution.status === FunctionExecution_Status.SUCCESS) spinner.succeed(`Function execution completed: ${coloredFnStatus}`);
10082
- else spinner.fail(`Function execution completed: ${coloredFnStatus}`);
10241
+ if (execution.status === FunctionExecution_Status.SUCCESS) sp.succeed(`Function execution completed: ${coloredFnStatus}`);
10242
+ else sp.fail(`Function execution completed: ${coloredFnStatus}`);
10083
10243
  return {
10084
10244
  job: jobDetail,
10085
10245
  targetType: targetTypeStr,
@@ -10088,11 +10248,11 @@ async function watchExecutorJob(options) {
10088
10248
  functionLogs: options.logs ? execution.logs || void 0 : void 0
10089
10249
  };
10090
10250
  }
10091
- spinner.text = `Waiting for function execution... (${formatTime(/* @__PURE__ */ new Date())})`;
10251
+ sp.text = `Waiting for function execution... (${formatTime(/* @__PURE__ */ new Date())})`;
10092
10252
  await setTimeout$1(interval);
10093
10253
  }
10094
10254
  } catch (error) {
10095
- spinner.warn(`Could not track function execution: ${error instanceof Error ? error.message : error}`);
10255
+ sp.warn(`Could not track function execution: ${error instanceof Error ? error.message : error}`);
10096
10256
  return {
10097
10257
  job: jobDetail,
10098
10258
  targetType: targetTypeStr,
@@ -10107,7 +10267,7 @@ async function watchExecutorJob(options) {
10107
10267
  targetType: targetTypeStr
10108
10268
  };
10109
10269
  } finally {
10110
- spinner.stop();
10270
+ sp.stop();
10111
10271
  }
10112
10272
  }
10113
10273
  function printJobWithAttempts(job) {
@@ -10170,11 +10330,11 @@ const jobsCommand = defineAppCommand({
10170
10330
  ],
10171
10331
  args: z.object({
10172
10332
  ...workspaceArgs,
10173
- executorName: arg(z.string(), {
10333
+ "executor-name": arg(z.string(), {
10174
10334
  positional: true,
10175
10335
  description: "Executor name"
10176
10336
  }),
10177
- jobId: arg(z.string().optional(), {
10337
+ "job-id": arg(z.string().optional(), {
10178
10338
  positional: true,
10179
10339
  description: "Job ID (if provided, shows job details)"
10180
10340
  }),
@@ -10423,7 +10583,7 @@ The \`--logs\` option displays logs from the downstream execution when available
10423
10583
  ],
10424
10584
  args: z.object({
10425
10585
  ...workspaceArgs,
10426
- executorName: arg(z.string(), {
10586
+ "executor-name": arg(z.string(), {
10427
10587
  positional: true,
10428
10588
  description: "Executor name"
10429
10589
  }),
@@ -12972,7 +13132,7 @@ function generateMigrationScript(diff) {
12972
13132
  * This script handles data migration for breaking schema changes.
12973
13133
  * Edit this file to implement your data migration logic.
12974
13134
  *
12975
- * The transaction is managed by the apply command.
13135
+ * The transaction is managed by the deploy command.
12976
13136
  * If any operation fails, all changes will be rolled back.
12977
13137
  */
12978
13138
 
@@ -13131,7 +13291,7 @@ async function generate(options) {
13131
13291
  if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
13132
13292
  let pluginManager;
13133
13293
  if (plugins.length > 0) pluginManager = new PluginManager(plugins);
13134
- const { defineApplication } = await import("./application-BIzicxMA.mjs");
13294
+ const { defineApplication } = await import("./application-Boa_11Nv.mjs");
13135
13295
  const application = defineApplication({
13136
13296
  config,
13137
13297
  pluginManager
@@ -13228,7 +13388,7 @@ async function generateDiffFromSnapshot(previousSnapshot, currentSnapshot, migra
13228
13388
  if (result.dbTypesFilePath) logger.info(` DB types: ${result.dbTypesFilePath}`);
13229
13389
  logger.newline();
13230
13390
  logger.log("A migration script was generated for breaking changes.");
13231
- logger.log("Please review and edit the script before running 'tailor-sdk apply'.");
13391
+ logger.log("Please review and edit the script before running 'tailor-sdk deploy'.");
13232
13392
  const editor = getConfiguredEditorCommand();
13233
13393
  if (!editor) return;
13234
13394
  try {
@@ -13567,7 +13727,7 @@ const resumeCommand = defineAppCommand({
13567
13727
  description: "Resume a failed or pending workflow execution.",
13568
13728
  args: z.object({
13569
13729
  ...workspaceArgs,
13570
- executionId: arg(z.string(), {
13730
+ "execution-id": arg(z.string(), {
13571
13731
  positional: true,
13572
13732
  description: "Failed execution ID"
13573
13733
  }),
@@ -15279,5 +15439,5 @@ function isDeno() {
15279
15439
  }
15280
15440
 
15281
15441
  //#endregion
15282
- export { deleteCommand$1 as $, getMigrationDirPath as $t, truncate as A, executionsCommand as At, updateOrganization as B, MIGRATION_LABEL_KEY as Bt, listCommand$2 as C, toPageDirection as Cn, jobsCommand as Ct, resumeWorkflow as D, startWorkflow as Dt, resumeCommand as E, startCommand as Et, showCommand as F, getCommand$6 as Ft, getCommand$1 as G, INITIAL_SCHEMA_NUMBER as Gt, treeCommand as H, bundleMigrationScript as Ht, logBetaWarning as I, getExecutor as It, updateFolder as J, compareLocalTypesWithSnapshot as Jt, getOrganization as K, MIGRATE_FILE_NAME as Kt, remove as L, apply as Lt, generate as M, listWorkflowExecutions as Mt, generateCommand as N, functionExecutionStatusToString as Nt, listCommand$3 as O, getCommand$5 as Ot, show as P, formatKeyValueTable as Pt, getFolder as Q, getLatestMigrationNumber as Qt, removeCommand$1 as R, executeScript as Rt, listApps as S, paginationArgs as Sn, getExecutorJob as St, healthCommand as T, watchExecutorJob as Tt, listCommand$4 as U, DB_TYPES_FILE_NAME as Ut, organizationTree as V, parseMigrationLabelNumber as Vt, listOrganizations as W, DIFF_FILE_NAME as Wt, listFolders as X, createSnapshotFromLocalTypes as Xt, listCommand$5 as Y, compareSnapshots as Yt, getCommand$2 as Z, formatMigrationNumber as Zt, getWorkspace as _, commonArgs as _n, webhookCommand as _t, updateUser as a, reconstructSnapshotFromMigrations as an, getCommand$3 as at, createCommand as b, isVerbose as bn, listCommand$9 as bt, listCommand as c, hasChanges as cn, tokenCommand as ct, inviteUser as d, sdkNameLabelKey as dn, generate$1 as dt, getMigrationFilePath as en, deleteFolder as et, restoreCommand as f, trnPrefix as fn, listCommand$8 as ft, getCommand as g, defineAppCommand as gn, listWebhookExecutors as gt, listWorkspaces as h, apiCall as hn, getFunctionRegistry as ht, updateCommand as i, loadDiff as in, listOAuth2Clients as it, truncateCommand as j, getWorkflowExecution as jt, listWorkflows as k, getWorkflow as kt, listUsers as l, getNamespacesWithMigrations as ln, listCommand$7 as lt, listCommand$1 as m, apiCommand as mn, getCommand$4 as mt, query as n, getNextMigrationNumber as nn, createFolder as nt, removeCommand as o, formatDiffSummary as on, getOAuth2Client as ot, restoreWorkspace as p, generateUserTypes as pn, listFunctionRegistries as pt, updateCommand$2 as q, SCHEMA_FILE_NAME as qt, queryCommand as r, isValidMigrationNumber as rn, listCommand$6 as rt, removeUser as s, formatMigrationDiff as sn, getMachineUserToken as st, isNativeTypeScriptRuntime as t, getMigrationFiles as tn, createCommand$1 as tt, inviteCommand as u, prompt as un, listMachineUsers as ut, deleteCommand as v, confirmationArgs as vn, triggerCommand as vt, getAppHealth as w, workspaceArgs as wn, listExecutorJobs as wt, createWorkspace as x, pagedLogArgs as xn, listExecutors as xt, deleteWorkspace as y, deploymentArgs as yn, triggerExecutor as yt, updateCommand$1 as z, waitForExecution$1 as zt };
15283
- //# sourceMappingURL=runtime-D5AJYWnF.mjs.map
15442
+ export { deleteCommand$1 as $, getMigrationDirPath as $t, truncate as A, executionsCommand as At, updateOrganization as B, MIGRATION_LABEL_KEY as Bt, listCommand$2 as C, toPageDirection as Cn, jobsCommand as Ct, resumeWorkflow as D, startWorkflow as Dt, resumeCommand as E, startCommand as Et, showCommand as F, getCommand$6 as Ft, getCommand$1 as G, INITIAL_SCHEMA_NUMBER as Gt, treeCommand as H, bundleMigrationScript as Ht, logBetaWarning as I, getExecutor as It, updateFolder as J, compareLocalTypesWithSnapshot as Jt, getOrganization as K, MIGRATE_FILE_NAME as Kt, remove as L, deploy as Lt, generate as M, listWorkflowExecutions as Mt, generateCommand as N, functionExecutionStatusToString as Nt, listCommand$3 as O, getCommand$5 as Ot, show as P, formatKeyValueTable as Pt, getFolder as Q, getLatestMigrationNumber as Qt, removeCommand$1 as R, executeScript as Rt, listApps as S, paginationArgs as Sn, getExecutorJob as St, healthCommand as T, watchExecutorJob as Tt, listCommand$4 as U, DB_TYPES_FILE_NAME as Ut, organizationTree as V, parseMigrationLabelNumber as Vt, listOrganizations as W, DIFF_FILE_NAME as Wt, listFolders as X, createSnapshotFromLocalTypes as Xt, listCommand$5 as Y, compareSnapshots as Yt, getCommand$2 as Z, formatMigrationNumber as Zt, getWorkspace as _, commonArgs as _n, webhookCommand as _t, updateUser as a, reconstructSnapshotFromMigrations as an, getCommand$3 as at, createCommand as b, isVerbose as bn, listCommand$9 as bt, listCommand as c, hasChanges as cn, tokenCommand as ct, inviteUser as d, trnPrefix as dn, generate$1 as dt, getMigrationFilePath as en, deleteFolder as et, restoreCommand as f, generateUserTypes as fn, listCommand$8 as ft, getCommand as g, defineAppCommand as gn, listWebhookExecutors as gt, listWorkspaces as h, apiCall as hn, getFunctionRegistry as ht, updateCommand as i, loadDiff as in, listOAuth2Clients as it, truncateCommand as j, getWorkflowExecution as jt, listWorkflows as k, getWorkflow as kt, listUsers as l, getNamespacesWithMigrations as ln, listCommand$7 as lt, listCommand$1 as m, apiCommand as mn, getCommand$4 as mt, query as n, getNextMigrationNumber as nn, createFolder as nt, removeCommand as o, formatDiffSummary as on, getOAuth2Client as ot, restoreWorkspace as p, prompt as pn, listFunctionRegistries as pt, updateCommand$2 as q, SCHEMA_FILE_NAME as qt, queryCommand as r, isValidMigrationNumber as rn, listCommand$6 as rt, removeUser as s, formatMigrationDiff as sn, getMachineUserToken as st, isNativeTypeScriptRuntime as t, getMigrationFiles as tn, createCommand$1 as tt, inviteCommand as u, sdkNameLabelKey as un, listMachineUsers as ut, deleteCommand as v, confirmationArgs as vn, triggerCommand as vt, getAppHealth as w, workspaceArgs as wn, listExecutorJobs as wt, createWorkspace as x, pagedLogArgs as xn, listExecutors as xt, deleteWorkspace as y, deploymentArgs as yn, triggerExecutor as yt, updateCommand$1 as z, waitForExecution$1 as zt };
15443
+ //# sourceMappingURL=runtime-B67skpW-.mjs.map