@tailor-platform/sdk 1.6.1 → 1.6.2

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.
@@ -1,10 +1,10 @@
1
- import { a as OAuth2ClientSchema, c as tailorUserMap, d as styles, f as symbols, i as ExecutorSchema, l as loadFilesWithIgnores, n as WorkflowJobSchema, o as ResolverSchema, r as WorkflowSchema, s as stringifyFunction, t as defineApplication, u as logger } from "./application-ByT5pepr.mjs";
1
+ import { a as OAuth2ClientSchema, c as tailorUserMap, d as styles, f as symbols, i as ExecutorSchema, l as loadFilesWithIgnores, n as WorkflowJobSchema, o as ResolverSchema, r as WorkflowSchema, s as stringifyFunction, t as defineApplication, u as logger } from "./application-4cO5Zvfo.mjs";
2
2
  import { createRequire } from "node:module";
3
- import { defineCommand } from "citty";
3
+ import { arg, defineCommand } from "politty";
4
+ import { z } from "zod";
4
5
  import * as fs$2 from "node:fs";
5
6
  import { parseEnv } from "node:util";
6
7
  import * as path from "pathe";
7
- import { z } from "zod";
8
8
  import chalk from "chalk";
9
9
  import { formatDistanceToNowStrict } from "date-fns";
10
10
  import { getBorderCharacters, table } from "table";
@@ -106,66 +106,50 @@ function loadEnvFiles(envFiles, envFilesIfExists) {
106
106
  * script path, causing warnings (twice due to tsx loader).
107
107
  */
108
108
  const commonArgs = {
109
- "env-file": {
110
- type: "string",
111
- description: "Path to the environment file (error if not found)",
112
- alias: "e"
113
- },
114
- "env-file-if-exists": {
115
- type: "string",
116
- description: "Path to the environment file (ignored if not found)"
117
- },
118
- verbose: {
119
- type: "boolean",
120
- description: "Enable verbose logging",
121
- default: false
122
- }
109
+ "env-file": arg(z.string().optional(), {
110
+ alias: "e",
111
+ description: "Path to the environment file (error if not found)"
112
+ }),
113
+ "env-file-if-exists": arg(z.string().optional(), { description: "Path to the environment file (ignored if not found)" }),
114
+ verbose: arg(z.boolean().default(false), { description: "Enable verbose logging" })
123
115
  };
124
116
  /**
125
117
  * Arguments for commands that require workspace context
126
118
  */
127
119
  const workspaceArgs = {
128
- "workspace-id": {
129
- type: "string",
130
- description: "Workspace ID",
131
- alias: "w"
132
- },
133
- profile: {
134
- type: "string",
135
- description: "Workspace profile",
136
- alias: "p"
137
- }
120
+ "workspace-id": arg(z.string().optional(), {
121
+ alias: "w",
122
+ description: "Workspace ID"
123
+ }),
124
+ profile: arg(z.string().optional(), {
125
+ alias: "p",
126
+ description: "Workspace profile"
127
+ })
138
128
  };
139
129
  /**
140
130
  * Arguments for commands that interact with deployed resources (includes config)
141
131
  */
142
132
  const deploymentArgs = {
143
133
  ...workspaceArgs,
144
- config: {
145
- type: "string",
146
- description: "Path to SDK config file",
134
+ config: arg(z.string().default("tailor.config.ts"), {
147
135
  alias: "c",
148
- default: "tailor.config.ts"
149
- }
136
+ description: "Path to SDK config file"
137
+ })
150
138
  };
151
139
  /**
152
140
  * Arguments for commands that require confirmation
153
141
  */
154
- const confirmationArgs = { yes: {
155
- type: "boolean",
156
- description: "Skip confirmation prompts",
142
+ const confirmationArgs = { yes: arg(z.boolean().default(false), {
157
143
  alias: "y",
158
- default: false
159
- } };
144
+ description: "Skip confirmation prompts"
145
+ }) };
160
146
  /**
161
147
  * Arguments for JSON output
162
148
  */
163
- const jsonArgs = { json: {
164
- type: "boolean",
165
- description: "Output as JSON",
149
+ const jsonArgs = { json: arg(z.boolean().default(false), {
166
150
  alias: "j",
167
- default: false
168
- } };
151
+ description: "Output as JSON"
152
+ }) };
169
153
  /**
170
154
  * Wrapper for command handlers that provides:
171
155
  * - Environment file loading
@@ -175,8 +159,7 @@ const jsonArgs = { json: {
175
159
  * @param handler - Command handler function
176
160
  * @returns Wrapped handler
177
161
  */
178
- const withCommonArgs = (handler) => async (context) => {
179
- const { args } = context;
162
+ const withCommonArgs = (handler) => async (args) => {
180
163
  try {
181
164
  if ("json" in args && typeof args.json === "boolean") logger.jsonMode = args.json;
182
165
  loadEnvFiles(args["env-file"], args["env-file-if-exists"]);
@@ -1307,26 +1290,21 @@ async function apiCall(options) {
1307
1290
  };
1308
1291
  }
1309
1292
  const apiCommand = defineCommand({
1310
- meta: {
1311
- name: "api",
1312
- description: "Call Tailor Platform API endpoints directly"
1313
- },
1314
- args: {
1293
+ name: "api",
1294
+ description: "Call Tailor Platform API endpoints directly",
1295
+ args: z.object({
1315
1296
  ...commonArgs,
1316
1297
  ...jsonArgs,
1317
1298
  ...workspaceArgs,
1318
- body: {
1319
- type: "string",
1320
- description: "Request body as JSON",
1299
+ body: arg(z.string().default("{}"), {
1321
1300
  alias: "b",
1322
- default: "{}"
1323
- },
1324
- endpoint: {
1325
- type: "positional",
1326
- description: "API endpoint to call (e.g., 'GetApplication' or 'tailor.v1.OperatorService/GetApplication')",
1327
- required: true
1328
- }
1329
- },
1301
+ description: "Request body as JSON"
1302
+ }),
1303
+ endpoint: arg(z.string(), {
1304
+ positional: true,
1305
+ description: "API endpoint to call (e.g., 'GetApplication' or 'tailor.v1.OperatorService/GetApplication')"
1306
+ })
1307
+ }),
1330
1308
  run: withCommonArgs(async (args) => {
1331
1309
  const result = await apiCall({
1332
1310
  profile: args.profile,
@@ -1475,8 +1453,8 @@ function getImportSource(node) {
1475
1453
  if (node.type === "CallExpression") {
1476
1454
  const callExpr = node;
1477
1455
  if (callExpr.callee.type === "Identifier" && callExpr.callee.name === "require") {
1478
- const arg = callExpr.arguments[0];
1479
- if (arg && "type" in arg && arg.type === "Literal" && "value" in arg && typeof arg.value === "string") return arg.value;
1456
+ const arg$1 = callExpr.arguments[0];
1457
+ if (arg$1 && "type" in arg$1 && arg$1.type === "Literal" && "value" in arg$1 && typeof arg$1.value === "string") return arg$1.value;
1480
1458
  }
1481
1459
  }
1482
1460
  return null;
@@ -3812,7 +3790,6 @@ ${mapFields}
3812
3790
  return ` ${key}: ${typeof value === "string" ? `"${value}"` : String(value)};`;
3813
3791
  }).join("\n") : "";
3814
3792
  return ml`
3815
- /* eslint-disable @typescript-eslint/no-empty-object-type */
3816
3793
  // This file is auto-generated by @tailor-platform/sdk
3817
3794
  // Do not edit this file manually
3818
3795
  // Regenerated automatically when running 'tailor-sdk apply' or 'tailor-sdk generate'
@@ -7144,12 +7121,12 @@ async function waitForExecution$1(client, workspaceId, executionId, pollInterval
7144
7121
  * @returns {Promise<ScriptExecutionResult>} Execution result
7145
7122
  */
7146
7123
  async function executeScript(options) {
7147
- const { client, workspaceId, name, code, arg, invoker, pollInterval } = options;
7124
+ const { client, workspaceId, name, code, arg: arg$1, invoker, pollInterval } = options;
7148
7125
  const executionId = (await client.testExecScript({
7149
7126
  workspaceId,
7150
7127
  name,
7151
7128
  code,
7152
- arg: arg ?? JSON.stringify({}),
7129
+ arg: arg$1 ?? JSON.stringify({}),
7153
7130
  invoker
7154
7131
  })).executionId;
7155
7132
  const result = await waitForExecution$1(client, workspaceId, executionId, pollInterval);
@@ -8795,43 +8772,18 @@ async function buildWorkflow(collectedJobs, mainJobNames, env, triggerContext) {
8795
8772
  return bundleWorkflowJobs(collectedJobs, mainJobNames, env, triggerContext);
8796
8773
  }
8797
8774
  const applyCommand = defineCommand({
8798
- meta: {
8799
- name: "apply",
8800
- description: "Apply Tailor configuration to generate files"
8801
- },
8802
- args: {
8775
+ name: "apply",
8776
+ description: "Apply Tailor configuration to generate files",
8777
+ args: z.object({
8803
8778
  ...commonArgs,
8804
- "workspace-id": {
8805
- type: "string",
8806
- description: "ID of the workspace to apply the configuration to",
8807
- alias: "w"
8808
- },
8809
- profile: {
8810
- type: "string",
8811
- description: "Workspace profile to use",
8812
- alias: "p"
8813
- },
8814
- config: {
8815
- type: "string",
8816
- description: "Path to SDK config file",
8817
- alias: "c",
8818
- default: "tailor.config.ts"
8819
- },
8820
- "dry-run": {
8821
- type: "boolean",
8822
- description: "Run the command without making any changes",
8823
- alias: "d"
8824
- },
8825
- yes: {
8826
- type: "boolean",
8827
- description: "Skip all confirmation prompts",
8828
- alias: "y"
8829
- },
8830
- "no-schema-check": {
8831
- type: "boolean",
8832
- description: "Skip schema diff check against migration snapshots"
8833
- }
8834
- },
8779
+ ...deploymentArgs,
8780
+ ...confirmationArgs,
8781
+ "dry-run": arg(z.boolean().optional(), {
8782
+ alias: "d",
8783
+ description: "Run the command without making any changes"
8784
+ }),
8785
+ "no-schema-check": arg(z.boolean().optional(), { description: "Skip schema diff check against migration snapshots" })
8786
+ }),
8835
8787
  run: withCommonArgs(async (args) => {
8836
8788
  await apply({
8837
8789
  workspaceId: args["workspace-id"],
@@ -8839,7 +8791,7 @@ const applyCommand = defineCommand({
8839
8791
  configPath: args.config,
8840
8792
  dryRun: args["dry-run"],
8841
8793
  yes: args.yes,
8842
- noSchemaCheck: args["schema-check"] === false
8794
+ noSchemaCheck: args["no-schema-check"]
8843
8795
  });
8844
8796
  })
8845
8797
  });
@@ -9538,25 +9490,19 @@ async function generate$1(options) {
9538
9490
  if (watch$1) await manager.watch();
9539
9491
  }
9540
9492
  const generateCommand$1 = defineCommand({
9541
- meta: {
9542
- name: "generate",
9543
- description: "Generate files using Tailor configuration"
9544
- },
9545
- args: {
9493
+ name: "generate",
9494
+ description: "Generate files using Tailor configuration",
9495
+ args: z.object({
9546
9496
  ...commonArgs,
9547
- config: {
9548
- type: "string",
9549
- description: "Path to SDK config file",
9497
+ config: arg(z.string().default("tailor.config.ts"), {
9550
9498
  alias: "c",
9551
- default: "tailor.config.ts"
9552
- },
9553
- watch: {
9554
- type: "boolean",
9555
- description: "Watch for type/resolver changes and regenerate",
9499
+ description: "Path to SDK config file"
9500
+ }),
9501
+ watch: arg(z.boolean().default(false), {
9556
9502
  alias: "W",
9557
- default: false
9558
- }
9559
- },
9503
+ description: "Watch for type/resolver changes and regenerate"
9504
+ })
9505
+ }),
9560
9506
  run: withCommonArgs(async (args) => {
9561
9507
  await generate$1({
9562
9508
  configPath: args.config,
@@ -9611,15 +9557,13 @@ async function listMachineUsers(options) {
9611
9557
  })).map(machineUserInfo);
9612
9558
  }
9613
9559
  const listCommand$3 = defineCommand({
9614
- meta: {
9615
- name: "list",
9616
- description: "List all machine users"
9617
- },
9618
- args: {
9560
+ name: "list",
9561
+ description: "List all machine users",
9562
+ args: z.object({
9619
9563
  ...commonArgs,
9620
9564
  ...jsonArgs,
9621
9565
  ...deploymentArgs
9622
- },
9566
+ }),
9623
9567
  run: withCommonArgs(async (args) => {
9624
9568
  const machineUsers = await listMachineUsers({
9625
9569
  workspaceId: args["workspace-id"],
@@ -9668,20 +9612,17 @@ async function getMachineUserToken(options) {
9668
9612
  };
9669
9613
  }
9670
9614
  const tokenCommand = defineCommand({
9671
- meta: {
9672
- name: "token",
9673
- description: "Get machine user token"
9674
- },
9675
- args: {
9615
+ name: "token",
9616
+ description: "Get machine user token",
9617
+ args: z.object({
9676
9618
  ...commonArgs,
9677
9619
  ...jsonArgs,
9678
9620
  ...deploymentArgs,
9679
- name: {
9680
- type: "positional",
9681
- description: "Machine user name",
9682
- required: true
9683
- }
9684
- },
9621
+ name: arg(z.string(), {
9622
+ positional: true,
9623
+ description: "Machine user name"
9624
+ })
9625
+ }),
9685
9626
  run: withCommonArgs(async (args) => {
9686
9627
  const token = await getMachineUserToken({
9687
9628
  name: args.name,
@@ -9774,20 +9715,17 @@ async function getOAuth2Client(options) {
9774
9715
  }
9775
9716
  }
9776
9717
  const getCommand$1 = defineCommand({
9777
- meta: {
9778
- name: "get",
9779
- description: "Get OAuth2 client credentials"
9780
- },
9781
- args: {
9718
+ name: "get",
9719
+ description: "Get OAuth2 client credentials",
9720
+ args: z.object({
9782
9721
  ...commonArgs,
9783
9722
  ...jsonArgs,
9784
9723
  ...deploymentArgs,
9785
- name: {
9786
- type: "positional",
9787
- description: "OAuth2 client name",
9788
- required: true
9789
- }
9790
- },
9724
+ name: arg(z.string(), {
9725
+ positional: true,
9726
+ description: "OAuth2 client name"
9727
+ })
9728
+ }),
9791
9729
  run: withCommonArgs(async (args) => {
9792
9730
  const credentials = await getOAuth2Client({
9793
9731
  name: args.name,
@@ -9831,15 +9769,13 @@ async function listOAuth2Clients(options) {
9831
9769
  })).map(toOAuth2ClientInfo);
9832
9770
  }
9833
9771
  const listCommand$2 = defineCommand({
9834
- meta: {
9835
- name: "list",
9836
- description: "List all OAuth2 clients"
9837
- },
9838
- args: {
9772
+ name: "list",
9773
+ description: "List all OAuth2 clients",
9774
+ args: z.object({
9839
9775
  ...commonArgs,
9840
9776
  ...jsonArgs,
9841
9777
  ...deploymentArgs
9842
- },
9778
+ }),
9843
9779
  run: withCommonArgs(async (args) => {
9844
9780
  const oauth2Clients = await listOAuth2Clients({
9845
9781
  workspaceId: args["workspace-id"],
@@ -9910,35 +9846,13 @@ async function remove(options) {
9910
9846
  await execRemove(client, workspaceId, application, config);
9911
9847
  }
9912
9848
  const removeCommand = defineCommand({
9913
- meta: {
9914
- name: "remove",
9915
- description: "Remove all resources managed by the application"
9916
- },
9917
- args: {
9849
+ name: "remove",
9850
+ description: "Remove all resources managed by the application",
9851
+ args: z.object({
9918
9852
  ...commonArgs,
9919
- "workspace-id": {
9920
- type: "string",
9921
- description: "Workspace ID",
9922
- alias: "w"
9923
- },
9924
- profile: {
9925
- type: "string",
9926
- description: "Workspace profile",
9927
- alias: "p"
9928
- },
9929
- config: {
9930
- type: "string",
9931
- description: "Path to SDK config file",
9932
- alias: "c",
9933
- default: "tailor.config.ts"
9934
- },
9935
- yes: {
9936
- type: "boolean",
9937
- description: "Skip confirmation prompt",
9938
- alias: "y",
9939
- default: false
9940
- }
9941
- },
9853
+ ...deploymentArgs,
9854
+ ...confirmationArgs
9855
+ }),
9942
9856
  run: withCommonArgs(async (args) => {
9943
9857
  const { client, workspaceId, application, config } = await loadOptions$1({
9944
9858
  workspaceId: args["workspace-id"],
@@ -9998,30 +9912,13 @@ async function show(options) {
9998
9912
  })).application);
9999
9913
  }
10000
9914
  const showCommand = defineCommand({
10001
- meta: {
10002
- name: "show",
10003
- description: "Show applied application information"
10004
- },
10005
- args: {
9915
+ name: "show",
9916
+ description: "Show applied application information",
9917
+ args: z.object({
10006
9918
  ...commonArgs,
10007
9919
  ...jsonArgs,
10008
- "workspace-id": {
10009
- type: "string",
10010
- description: "Workspace ID",
10011
- alias: "w"
10012
- },
10013
- profile: {
10014
- type: "string",
10015
- description: "Workspace profile",
10016
- alias: "p"
10017
- },
10018
- config: {
10019
- type: "string",
10020
- description: "Path to SDK config file",
10021
- alias: "c",
10022
- default: "tailor.config.ts"
10023
- }
10024
- },
9920
+ ...deploymentArgs
9921
+ }),
10025
9922
  run: withCommonArgs(async (args) => {
10026
9923
  const appInfo = await show({
10027
9924
  workspaceId: args["workspace-id"],
@@ -10545,7 +10442,7 @@ async function generate(options) {
10545
10442
  return;
10546
10443
  }
10547
10444
  if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
10548
- const { defineApplication: defineApplication$1 } = await import("./application-dwcUabL3.mjs");
10445
+ const { defineApplication: defineApplication$1 } = await import("./application-3rIUD7cq.mjs");
10549
10446
  const application = defineApplication$1(config);
10550
10447
  for (const { namespace, migrationsDir } of namespacesWithMigrations) {
10551
10448
  logger.info(`Processing namespace: ${styles.bold(namespace)}`);
@@ -10671,35 +10568,27 @@ async function openInEditor(filePath) {
10671
10568
  * CLI command definition for generate
10672
10569
  */
10673
10570
  const generateCommand = defineCommand({
10674
- meta: {
10675
- name: "generate",
10676
- description: "Generate migration files for TailorDB schema changes"
10677
- },
10678
- args: {
10571
+ name: "generate",
10572
+ description: "Generate migration files for TailorDB schema changes",
10573
+ args: z.object({
10679
10574
  ...commonArgs,
10680
- name: {
10681
- type: "string",
10682
- description: "Optional description for the migration",
10683
- alias: "n"
10684
- },
10685
- yes: {
10686
- type: "boolean",
10687
- description: "Skip confirmation prompts",
10688
- alias: "y",
10689
- default: false
10690
- },
10691
- init: {
10692
- type: "boolean",
10693
- description: "Delete existing migrations and start fresh",
10694
- default: false
10695
- }
10696
- },
10575
+ ...confirmationArgs,
10576
+ config: arg(z.string().default("tailor.config.ts"), {
10577
+ alias: "c",
10578
+ description: "Path to SDK config file"
10579
+ }),
10580
+ name: arg(z.string().optional(), {
10581
+ alias: "n",
10582
+ description: "Optional description for the migration"
10583
+ }),
10584
+ init: arg(z.boolean().default(false), { description: "Delete existing migrations and start fresh" })
10585
+ }),
10697
10586
  run: withCommonArgs(async (args) => {
10698
10587
  await generate({
10699
- configPath: typeof args.config === "string" ? args.config : void 0,
10700
- name: typeof args.name === "string" ? args.name : void 0,
10701
- yes: Boolean(args.yes),
10702
- init: Boolean(args.init)
10588
+ configPath: args.config,
10589
+ name: args.name,
10590
+ yes: args.yes,
10591
+ init: args.init
10703
10592
  });
10704
10593
  })
10705
10594
  });
@@ -10837,38 +10726,27 @@ async function $truncate(options) {
10837
10726
  }
10838
10727
  }
10839
10728
  const truncateCommand = defineCommand({
10840
- meta: {
10841
- name: "truncate",
10842
- description: "Truncate TailorDB tables"
10843
- },
10844
- args: {
10729
+ name: "truncate",
10730
+ description: "Truncate TailorDB tables",
10731
+ args: z.object({
10845
10732
  ...commonArgs,
10846
- types: {
10847
- type: "positional",
10848
- description: "Type names to truncate",
10849
- required: false
10850
- },
10851
- all: {
10852
- type: "boolean",
10853
- description: "Truncate all tables in all namespaces",
10854
- default: false,
10855
- alias: "a"
10856
- },
10857
- namespace: {
10858
- type: "string",
10859
- description: "Truncate all tables in specified namespace",
10860
- alias: "n"
10861
- },
10862
- yes: {
10863
- type: "boolean",
10864
- description: "Skip confirmation prompt",
10865
- alias: "y",
10866
- default: false
10867
- },
10868
- ...deploymentArgs
10869
- },
10733
+ ...deploymentArgs,
10734
+ ...confirmationArgs,
10735
+ types: arg(z.string().array().optional(), {
10736
+ positional: true,
10737
+ description: "Type names to truncate"
10738
+ }),
10739
+ all: arg(z.boolean().default(false), {
10740
+ alias: "a",
10741
+ description: "Truncate all tables in all namespaces"
10742
+ }),
10743
+ namespace: arg(z.string().optional(), {
10744
+ alias: "n",
10745
+ description: "Truncate all tables in specified namespace"
10746
+ })
10747
+ }),
10870
10748
  run: withCommonArgs(async (args) => {
10871
- const types = args._.length > 0 ? args._.map((arg) => String(arg)).filter(Boolean) : void 0;
10749
+ const types = args.types && args.types.length > 0 ? args.types : void 0;
10872
10750
  await $truncate({
10873
10751
  workspaceId: args["workspace-id"],
10874
10752
  profile: args.profile,
@@ -10929,30 +10807,23 @@ function humanizeRelativeTime(isoString) {
10929
10807
 
10930
10808
  //#endregion
10931
10809
  //#region src/cli/workflow/args.ts
10932
- const nameArgs = { name: {
10933
- type: "positional",
10934
- description: "Workflow name",
10935
- required: true
10936
- } };
10810
+ const nameArgs = { name: arg(z.string(), {
10811
+ positional: true,
10812
+ description: "Workflow name"
10813
+ }) };
10937
10814
  const waitArgs = {
10938
- wait: {
10939
- type: "boolean",
10815
+ wait: arg(z.boolean().default(false), {
10940
10816
  alias: "W",
10941
- description: "Wait for execution to complete",
10942
- default: false
10943
- },
10944
- interval: {
10945
- type: "string",
10946
- description: "Polling interval when using --wait",
10817
+ description: "Wait for execution to complete"
10818
+ }),
10819
+ interval: arg(z.string().default("3s"), {
10947
10820
  alias: "i",
10948
- default: "3s"
10949
- },
10950
- logs: {
10951
- type: "boolean",
10821
+ description: "Polling interval when using --wait"
10822
+ }),
10823
+ logs: arg(z.boolean().default(false), {
10952
10824
  alias: "l",
10953
- description: "Display job execution logs after completion (requires --wait)",
10954
- default: false
10955
- }
10825
+ description: "Display job execution logs after completion (requires --wait)"
10826
+ })
10956
10827
  };
10957
10828
 
10958
10829
  //#endregion
@@ -11247,36 +11118,27 @@ function printExecutionWithLogs(execution) {
11247
11118
  }
11248
11119
  }
11249
11120
  const executionsCommand = defineCommand({
11250
- meta: {
11251
- name: "executions",
11252
- description: "List or get workflow executions"
11253
- },
11254
- args: {
11121
+ name: "executions",
11122
+ description: "List or get workflow executions",
11123
+ args: z.object({
11255
11124
  ...commonArgs,
11256
11125
  ...jsonArgs,
11257
11126
  ...workspaceArgs,
11258
- executionId: {
11259
- type: "positional",
11260
- description: "Execution ID (if provided, shows details)",
11261
- required: false
11262
- },
11263
- "workflow-name": {
11264
- type: "string",
11265
- description: "Filter by workflow name (list mode only)",
11266
- alias: "n"
11267
- },
11268
- status: {
11269
- type: "string",
11270
- description: "Filter by status (list mode only)",
11271
- alias: "s"
11272
- },
11127
+ executionId: arg(z.string().optional(), {
11128
+ positional: true,
11129
+ description: "Execution ID (if provided, shows details)"
11130
+ }),
11131
+ "workflow-name": arg(z.string().optional(), {
11132
+ alias: "n",
11133
+ description: "Filter by workflow name (list mode only)"
11134
+ }),
11135
+ status: arg(z.string().optional(), {
11136
+ alias: "s",
11137
+ description: "Filter by status (list mode only)"
11138
+ }),
11273
11139
  ...waitArgs,
11274
- logs: {
11275
- type: "boolean",
11276
- description: "Display job execution logs (detail mode only)",
11277
- default: false
11278
- }
11279
- },
11140
+ logs: arg(z.boolean().default(false), { description: "Display job execution logs (detail mode only)" })
11141
+ }),
11280
11142
  run: withCommonArgs(async (args) => {
11281
11143
  if (args.executionId) {
11282
11144
  const interval = parseDuration(args.interval);
@@ -11342,16 +11204,14 @@ async function getWorkflow(options) {
11342
11204
  }
11343
11205
  }
11344
11206
  const getCommand = defineCommand({
11345
- meta: {
11346
- name: "get",
11347
- description: "Get workflow details"
11348
- },
11349
- args: {
11207
+ name: "get",
11208
+ description: "Get workflow details",
11209
+ args: z.object({
11350
11210
  ...commonArgs,
11351
11211
  ...jsonArgs,
11352
11212
  ...workspaceArgs,
11353
11213
  ...nameArgs
11354
- },
11214
+ }),
11355
11215
  run: withCommonArgs(async (args) => {
11356
11216
  const workflow = await getWorkflow({
11357
11217
  name: args.name,
@@ -11387,15 +11247,13 @@ async function listWorkflows(options) {
11387
11247
  })).map(toWorkflowListInfo);
11388
11248
  }
11389
11249
  const listCommand$1 = defineCommand({
11390
- meta: {
11391
- name: "list",
11392
- description: "List all workflows"
11393
- },
11394
- args: {
11250
+ name: "list",
11251
+ description: "List all workflows",
11252
+ args: z.object({
11395
11253
  ...commonArgs,
11396
11254
  ...jsonArgs,
11397
11255
  ...workspaceArgs
11398
- },
11256
+ }),
11399
11257
  run: withCommonArgs(async (args) => {
11400
11258
  const workflows = await listWorkflows({
11401
11259
  workspaceId: args["workspace-id"],
@@ -11530,12 +11388,12 @@ async function startWorkflow(options) {
11530
11388
  namespace: application.authNamespace,
11531
11389
  machineUserName: options.machineUser
11532
11390
  });
11533
- const arg = options.arg === void 0 ? void 0 : typeof options.arg === "string" ? options.arg : JSON.stringify(options.arg);
11391
+ const arg$1 = options.arg === void 0 ? void 0 : typeof options.arg === "string" ? options.arg : JSON.stringify(options.arg);
11534
11392
  const { executionId } = await client.testStartWorkflow({
11535
11393
  workspaceId,
11536
11394
  workflowId: workflow.id,
11537
11395
  authInvoker,
11538
- arg
11396
+ arg: arg$1
11539
11397
  });
11540
11398
  return {
11541
11399
  executionId,
@@ -11554,28 +11412,23 @@ async function startWorkflow(options) {
11554
11412
  }
11555
11413
  }
11556
11414
  const startCommand = defineCommand({
11557
- meta: {
11558
- name: "start",
11559
- description: "Start a workflow execution"
11560
- },
11561
- args: {
11415
+ name: "start",
11416
+ description: "Start a workflow execution",
11417
+ args: z.object({
11562
11418
  ...commonArgs,
11563
11419
  ...jsonArgs,
11564
11420
  ...deploymentArgs,
11565
11421
  ...nameArgs,
11566
- machineuser: {
11567
- type: "string",
11568
- description: "Machine user name",
11422
+ machineuser: arg(z.string(), {
11569
11423
  alias: "m",
11570
- required: true
11571
- },
11572
- arg: {
11573
- type: "string",
11574
- description: "Workflow argument (JSON string)",
11575
- alias: "a"
11576
- },
11424
+ description: "Machine user name"
11425
+ }),
11426
+ arg: arg(z.string().optional(), {
11427
+ alias: "a",
11428
+ description: "Workflow argument (JSON string)"
11429
+ }),
11577
11430
  ...waitArgs
11578
- },
11431
+ }),
11579
11432
  run: withCommonArgs(async (args) => {
11580
11433
  const interval = parseDuration(args.interval);
11581
11434
  const { executionId, wait } = await startWorkflow({
@@ -11643,21 +11496,18 @@ async function resumeWorkflow(options) {
11643
11496
  }
11644
11497
  }
11645
11498
  const resumeCommand = defineCommand({
11646
- meta: {
11647
- name: "resume",
11648
- description: "Resume a failed workflow execution"
11649
- },
11650
- args: {
11499
+ name: "resume",
11500
+ description: "Resume a failed workflow execution",
11501
+ args: z.object({
11651
11502
  ...commonArgs,
11652
11503
  ...jsonArgs,
11653
11504
  ...workspaceArgs,
11654
- executionId: {
11655
- type: "positional",
11656
- description: "Failed execution ID",
11657
- required: true
11658
- },
11505
+ executionId: arg(z.string(), {
11506
+ positional: true,
11507
+ description: "Failed execution ID"
11508
+ }),
11659
11509
  ...waitArgs
11660
- },
11510
+ }),
11661
11511
  run: withCommonArgs(async (args) => {
11662
11512
  const interval = parseDuration(args.interval);
11663
11513
  const { executionId, wait } = await resumeWorkflow({
@@ -11740,51 +11590,37 @@ async function createWorkspace(options) {
11740
11590
  })).workspace);
11741
11591
  }
11742
11592
  const createCommand = defineCommand({
11743
- meta: {
11744
- name: "create",
11745
- description: "Create new workspace"
11746
- },
11747
- args: {
11593
+ name: "create",
11594
+ description: "Create new workspace",
11595
+ args: z.object({
11748
11596
  ...commonArgs,
11749
11597
  ...jsonArgs,
11750
- name: {
11751
- type: "string",
11752
- description: "Workspace name",
11753
- required: true,
11754
- alias: "n"
11755
- },
11756
- region: {
11757
- type: "string",
11758
- description: "Workspace region (us-west, asia-northeast)",
11759
- required: true,
11760
- alias: "r"
11761
- },
11762
- "delete-protection": {
11763
- type: "boolean",
11764
- description: "Enable delete protection",
11598
+ name: arg(z.string(), {
11599
+ alias: "n",
11600
+ description: "Workspace name"
11601
+ }),
11602
+ region: arg(z.string(), {
11603
+ alias: "r",
11604
+ description: "Workspace region (us-west, asia-northeast)"
11605
+ }),
11606
+ "delete-protection": arg(z.boolean().default(false), {
11765
11607
  alias: "d",
11766
- default: false
11767
- },
11768
- "organization-id": {
11769
- type: "string",
11770
- description: "Organization ID to workspace associate with",
11771
- alias: "o"
11772
- },
11773
- "folder-id": {
11774
- type: "string",
11775
- description: "Folder ID to workspace associate with",
11776
- alias: "f"
11777
- },
11778
- "profile-name": {
11779
- type: "string",
11780
- description: "Profile name to create",
11781
- alias: "p"
11782
- },
11783
- "profile-user": {
11784
- type: "string",
11785
- description: "User email for the profile (defaults to current user)"
11786
- }
11787
- },
11608
+ description: "Enable delete protection"
11609
+ }),
11610
+ "organization-id": arg(z.string().optional(), {
11611
+ alias: "o",
11612
+ description: "Organization ID to workspace associate with"
11613
+ }),
11614
+ "folder-id": arg(z.string().optional(), {
11615
+ alias: "f",
11616
+ description: "Folder ID to workspace associate with"
11617
+ }),
11618
+ "profile-name": arg(z.string().optional(), {
11619
+ alias: "p",
11620
+ description: "Profile name to create"
11621
+ }),
11622
+ "profile-user": arg(z.string().optional(), { description: "User email for the profile (defaults to current user)" })
11623
+ }),
11788
11624
  run: withCommonArgs(async (args) => {
11789
11625
  const workspace = await createWorkspace({
11790
11626
  name: args.name,
@@ -11850,25 +11686,16 @@ async function deleteWorkspace(options) {
11850
11686
  await client.deleteWorkspace({ workspaceId });
11851
11687
  }
11852
11688
  const deleteCommand = defineCommand({
11853
- meta: {
11854
- name: "delete",
11855
- description: "Delete workspace"
11856
- },
11857
- args: {
11689
+ name: "delete",
11690
+ description: "Delete workspace",
11691
+ args: z.object({
11858
11692
  ...commonArgs,
11859
- "workspace-id": {
11860
- type: "string",
11861
- description: "Workspace ID",
11862
- required: true,
11863
- alias: "w"
11864
- },
11865
- yes: {
11866
- type: "boolean",
11867
- description: "Skip confirmation prompt",
11868
- alias: "y",
11869
- default: false
11870
- }
11871
- },
11693
+ "workspace-id": arg(z.string(), {
11694
+ alias: "w",
11695
+ description: "Workspace ID"
11696
+ }),
11697
+ ...confirmationArgs
11698
+ }),
11872
11699
  run: withCommonArgs(async (args) => {
11873
11700
  const { client, workspaceId } = await loadOptions({ workspaceId: args["workspace-id"] });
11874
11701
  let workspace;
@@ -11919,19 +11746,16 @@ async function listWorkspaces(options) {
11919
11746
  return results;
11920
11747
  }
11921
11748
  const listCommand = defineCommand({
11922
- meta: {
11923
- name: "list",
11924
- description: "List all Tailor Platform workspaces"
11925
- },
11926
- args: {
11749
+ name: "list",
11750
+ description: "List all Tailor Platform workspaces",
11751
+ args: z.object({
11927
11752
  ...commonArgs,
11928
11753
  ...jsonArgs,
11929
- limit: {
11930
- type: "string",
11754
+ limit: arg(z.string().optional(), {
11931
11755
  alias: "l",
11932
11756
  description: "Maximum number of workspaces to list"
11933
- }
11934
- },
11757
+ })
11758
+ }),
11935
11759
  run: withCommonArgs(async (args) => {
11936
11760
  let limit;
11937
11761
  try {
@@ -11950,4 +11774,4 @@ const listCommand = defineCommand({
11950
11774
 
11951
11775
  //#endregion
11952
11776
  export { getMigrationFiles as $, getOAuth2Client as A, parseMigrationLabelNumber as B, show as C, PATScope as Ct, listCommand$2 as D, jsonArgs as Dt, removeCommand as E, deploymentArgs as Et, generate$1 as F, SCHEMA_FILE_NAME as G, DIFF_FILE_NAME as H, generateCommand$1 as I, createSnapshotFromLocalTypes as J, compareLocalTypesWithSnapshot as K, apply as L, tokenCommand as M, listCommand$3 as N, listOAuth2Clients as O, withCommonArgs as Ot, listMachineUsers as P, getMigrationFilePath as Q, applyCommand as R, logBetaWarning as S, readPackageJson as St, remove as T, confirmationArgs as Tt, INITIAL_SCHEMA_NUMBER as U, DB_TYPES_FILE_NAME as V, MIGRATE_FILE_NAME as W, getLatestMigrationNumber as X, formatMigrationNumber as Y, getMigrationDirPath as Z, listWorkflowExecutions as _, writePlatformConfig as _t, createCommand as a, formatMigrationDiff as at, generate as b, initOAuth2Client as bt, resumeWorkflow as c, trnPrefix as ct, listCommand$1 as d, apiCall as dt, getNextMigrationNumber as et, listWorkflows as f, apiCommand as ft, getWorkflowExecution as g, readPlatformConfig as gt, executionsCommand as h, loadWorkspaceId as ht, deleteWorkspace as i, formatDiffSummary as it, getMachineUserToken as j, getCommand$1 as k, workspaceArgs as kt, startCommand as l, generateUserTypes as lt, getWorkflow as m, loadAccessToken as mt, listWorkspaces as n, loadDiff as nt, createWorkspace as o, hasChanges as ot, getCommand as p, fetchLatestToken as pt, compareSnapshots as q, deleteCommand as r, reconstructSnapshotFromMigrations as rt, resumeCommand as s, getNamespacesWithMigrations as st, listCommand as t, isValidMigrationNumber as tt, startWorkflow as u, loadConfig as ut, truncate as v, fetchAll as vt, showCommand as w, commonArgs as wt, generateCommand as x, initOperatorClient as xt, truncateCommand as y, fetchUserInfo as yt, MIGRATION_LABEL_KEY as z };
11953
- //# sourceMappingURL=list-DU6Y_JM5.mjs.map
11777
+ //# sourceMappingURL=list-Cgj8IR2N.mjs.map