@tailor-platform/sdk 0.14.1 → 0.14.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 0.14.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#146](https://github.com/tailor-platform/sdk/pull/146) [`0197d09`](https://github.com/tailor-platform/sdk/commit/0197d09cd9bd65d3d6981d99a58b352e0cf43754) Thanks [@toiroakr](https://github.com/toiroakr)! - fix: workflow bundle bug
8
+
9
+ - [#147](https://github.com/tailor-platform/sdk/pull/147) [`2d2feed`](https://github.com/tailor-platform/sdk/commit/2d2feedce031bdf321707506a597a98ae863236d) Thanks [@toiroakr](https://github.com/toiroakr)! - feat(cli): add workflow command
10
+
11
+ - [#129](https://github.com/tailor-platform/sdk/pull/129) [`b8a2fa0`](https://github.com/tailor-platform/sdk/commit/b8a2fa098016b2e053afdb3b517114d46369657f) Thanks [@riku99](https://github.com/riku99)! - Add a lint-based guard for TailorDB field hooks/validate scripts that detects references to non-local variables/functions and fails apply when such external dependencies are present.
12
+
3
13
  ## 0.14.1
4
14
 
5
15
  ### Patch Changes
@@ -265,5 +265,107 @@ interface OAuth2ClientListOptions {
265
265
  }
266
266
  declare function oauth2ClientList(options?: OAuth2ClientListOptions): Promise<OAuth2ClientInfo[]>;
267
267
  //#endregion
268
- export { type ApplicationInfo, type ApplyOptions, type CodeGenerator, type Executor, type GenerateOptions, type GeneratorInput, type GeneratorResult, type MachineUserInfo, type MachineUserListOptions, type MachineUserTokenInfo, type MachineUserTokenOptions, type OAuth2ClientCredentials, type OAuth2ClientGetOptions, type OAuth2ClientInfo, type OAuth2ClientListOptions, type RemoveOptions, type Resolver, type ShowOptions, type ParsedTailorDBType as TailorDBType, type WorkspaceCreateOptions, type WorkspaceDeleteOptions, type WorkspaceInfo, apply, generate, generateUserTypes, loadConfig, machineUserList, machineUserToken, oauth2ClientGet, oauth2ClientList, remove, show, workspaceCreate, workspaceDelete, workspaceList };
268
+ //#region src/cli/workflow/transform.d.ts
269
+ interface WorkflowListInfo {
270
+ name: string;
271
+ mainJob: string;
272
+ jobFunctions: number;
273
+ updatedAt: string;
274
+ }
275
+ interface WorkflowInfo {
276
+ name: string;
277
+ id: string;
278
+ mainJob: string;
279
+ jobFunctions: string;
280
+ createdAt: string;
281
+ updatedAt: string;
282
+ }
283
+ interface WorkflowJobExecutionInfo {
284
+ id: string;
285
+ stackedJobName: string;
286
+ status: string;
287
+ executionId: string;
288
+ startedAt: string;
289
+ finishedAt: string;
290
+ }
291
+ interface WorkflowExecutionInfo {
292
+ id: string;
293
+ workflowName: string;
294
+ status: string;
295
+ jobExecutions: number;
296
+ startedAt: string;
297
+ finishedAt: string;
298
+ }
299
+ interface WorkflowStartResult {
300
+ executionId: string;
301
+ }
302
+ interface WorkflowResumeResult {
303
+ executionId: string;
304
+ }
305
+ //#endregion
306
+ //#region src/cli/workflow/list.d.ts
307
+ interface WorkflowListOptions {
308
+ workspaceId?: string;
309
+ profile?: string;
310
+ }
311
+ declare function workflowList(options?: WorkflowListOptions): Promise<WorkflowListInfo[]>;
312
+ //#endregion
313
+ //#region src/cli/workflow/get.d.ts
314
+ interface WorkflowGetOptions {
315
+ nameOrId: string;
316
+ workspaceId?: string;
317
+ profile?: string;
318
+ }
319
+ declare function workflowGet(options: WorkflowGetOptions): Promise<WorkflowInfo>;
320
+ //#endregion
321
+ //#region src/cli/workflow/start.d.ts
322
+ interface WorkflowStartOptions {
323
+ nameOrId: string;
324
+ machineUser: string;
325
+ arg?: string;
326
+ workspaceId?: string;
327
+ profile?: string;
328
+ configPath?: string;
329
+ wait?: boolean;
330
+ interval?: number;
331
+ format: "table" | "json";
332
+ }
333
+ declare function workflowStart(options: WorkflowStartOptions): Promise<WorkflowStartResult | WorkflowExecutionInfo>;
334
+ //#endregion
335
+ //#region src/cli/workflow/executions.d.ts
336
+ interface WorkflowExecutionsListOptions {
337
+ workspaceId?: string;
338
+ profile?: string;
339
+ workflowName?: string;
340
+ status?: string;
341
+ }
342
+ interface WorkflowExecutionGetOptions {
343
+ executionId: string;
344
+ workspaceId?: string;
345
+ profile?: string;
346
+ wait?: boolean;
347
+ interval?: number;
348
+ logs?: boolean;
349
+ }
350
+ interface WorkflowExecutionDetailInfo extends WorkflowExecutionInfo {
351
+ jobDetails?: (WorkflowJobExecutionInfo & {
352
+ logs?: string;
353
+ result?: string;
354
+ })[];
355
+ }
356
+ declare function workflowExecutionsList(options?: WorkflowExecutionsListOptions): Promise<WorkflowExecutionInfo[]>;
357
+ declare function workflowExecutionGet(options: WorkflowExecutionGetOptions): Promise<WorkflowExecutionDetailInfo>;
358
+ //#endregion
359
+ //#region src/cli/workflow/resume.d.ts
360
+ interface WorkflowResumeOptions {
361
+ executionId: string;
362
+ workspaceId?: string;
363
+ profile?: string;
364
+ wait?: boolean;
365
+ interval?: number;
366
+ format: "table" | "json";
367
+ }
368
+ declare function workflowResume(options: WorkflowResumeOptions): Promise<WorkflowResumeResult | WorkflowExecutionInfo>;
369
+ //#endregion
370
+ export { type ApplicationInfo, type ApplyOptions, type CodeGenerator, type Executor, type GenerateOptions, type GeneratorInput, type GeneratorResult, type MachineUserInfo, type MachineUserListOptions, type MachineUserTokenInfo, type MachineUserTokenOptions, type OAuth2ClientCredentials, type OAuth2ClientGetOptions, type OAuth2ClientInfo, type OAuth2ClientListOptions, type RemoveOptions, type Resolver, type ShowOptions, type ParsedTailorDBType as TailorDBType, type WorkflowExecutionGetOptions, type WorkflowExecutionInfo, type WorkflowExecutionsListOptions, type WorkflowGetOptions, type WorkflowInfo, type WorkflowJobExecutionInfo, type WorkflowListInfo, type WorkflowListOptions, type WorkflowResumeOptions, type WorkflowResumeResult, type WorkflowStartOptions, type WorkflowStartResult, type WorkspaceCreateOptions, type WorkspaceDeleteOptions, type WorkspaceInfo, apply, generate, generateUserTypes, loadConfig, machineUserList, machineUserToken, oauth2ClientGet, oauth2ClientList, remove, show, workflowExecutionGet, workflowExecutionsList, workflowGet, workflowList, workflowResume, workflowStart, workspaceCreate, workspaceDelete, workspaceList };
269
371
  //# sourceMappingURL=api.d.mts.map
package/dist/cli/api.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { apply, generate, generateUserTypes, loadConfig, machineUserList, machineUserToken, oauth2ClientGet, oauth2ClientList, remove, show, workspaceCreate, workspaceDelete, workspaceList } from "../list-CCYkqZyi.mjs";
1
+ import { apply, generate, generateUserTypes, loadConfig, machineUserList, machineUserToken, oauth2ClientGet, oauth2ClientList, remove, show, workflowExecutionGet, workflowExecutionsList, workflowGet, workflowList, workflowResume, workflowStart, workspaceCreate, workspaceDelete, workspaceList } from "../resume-Bk4u_qL4.mjs";
2
2
  import "../job-BGBMNqRW.mjs";
3
3
  import { register } from "node:module";
4
4
 
@@ -6,5 +6,5 @@ import { register } from "node:module";
6
6
  register("tsx", import.meta.url, { data: {} });
7
7
 
8
8
  //#endregion
9
- export { apply, generate, generateUserTypes, loadConfig, machineUserList, machineUserToken, oauth2ClientGet, oauth2ClientList, remove, show, workspaceCreate, workspaceDelete, workspaceList };
9
+ export { apply, generate, generateUserTypes, loadConfig, machineUserList, machineUserToken, oauth2ClientGet, oauth2ClientList, remove, show, workflowExecutionGet, workflowExecutionsList, workflowGet, workflowList, workflowResume, workflowStart, workspaceCreate, workspaceDelete, workspaceList };
10
10
  //# sourceMappingURL=api.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.mjs","names":[],"sources":["../../src/cli/api.ts"],"sourcesContent":["// CLI API exports for programmatic usage\nimport { register } from \"node:module\";\n\n// Register tsx to handle TypeScript files when using CLI API programmatically\nregister(\"tsx\", import.meta.url, { data: {} });\n\nexport { apply } from \"./apply/index\";\nexport type { ApplyOptions } from \"./apply/index\";\nexport { generate } from \"./generator/index\";\nexport type { GenerateOptions } from \"./generator/options\";\nexport { loadConfig } from \"./config-loader\";\nexport { generateUserTypes } from \"./type-generator\";\nexport type {\n CodeGenerator,\n GeneratorInput,\n GeneratorResult,\n} from \"./generator/types\";\nexport type { ParsedTailorDBType as TailorDBType } from \"@/parser/service/tailordb/types\";\nexport type { Resolver } from \"@/parser/service/resolver\";\nexport type { Executor } from \"@/parser/service/executor\";\n\nexport { show, type ShowOptions, type ApplicationInfo } from \"./show\";\nexport { remove, type RemoveOptions } from \"./remove\";\nexport {\n workspaceCreate,\n type WorkspaceCreateOptions,\n} from \"./workspace/create\";\nexport { workspaceList } from \"./workspace/list\";\nexport {\n workspaceDelete,\n type WorkspaceDeleteOptions,\n} from \"./workspace/delete\";\nexport type { WorkspaceInfo } from \"./workspace/transform\";\nexport {\n machineUserList,\n type MachineUserListOptions,\n type MachineUserInfo,\n} from \"./machineuser/list\";\nexport {\n machineUserToken,\n type MachineUserTokenOptions,\n type MachineUserTokenInfo,\n} from \"./machineuser/token\";\nexport {\n oauth2ClientGet,\n type OAuth2ClientGetOptions,\n} from \"./oauth2client/get\";\nexport {\n oauth2ClientList,\n type OAuth2ClientListOptions,\n} from \"./oauth2client/list\";\nexport type {\n OAuth2ClientInfo,\n OAuth2ClientCredentials,\n} from \"./oauth2client/transform\";\n"],"mappings":";;;;;AAIA,SAAS,OAAO,OAAO,KAAK,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC"}
1
+ {"version":3,"file":"api.mjs","names":[],"sources":["../../src/cli/api.ts"],"sourcesContent":["// CLI API exports for programmatic usage\nimport { register } from \"node:module\";\n\n// Register tsx to handle TypeScript files when using CLI API programmatically\nregister(\"tsx\", import.meta.url, { data: {} });\n\nexport { apply } from \"./apply/index\";\nexport type { ApplyOptions } from \"./apply/index\";\nexport { generate } from \"./generator/index\";\nexport type { GenerateOptions } from \"./generator/options\";\nexport { loadConfig } from \"./config-loader\";\nexport { generateUserTypes } from \"./type-generator\";\nexport type {\n CodeGenerator,\n GeneratorInput,\n GeneratorResult,\n} from \"./generator/types\";\nexport type { ParsedTailorDBType as TailorDBType } from \"@/parser/service/tailordb/types\";\nexport type { Resolver } from \"@/parser/service/resolver\";\nexport type { Executor } from \"@/parser/service/executor\";\n\nexport { show, type ShowOptions, type ApplicationInfo } from \"./show\";\nexport { remove, type RemoveOptions } from \"./remove\";\nexport {\n workspaceCreate,\n type WorkspaceCreateOptions,\n} from \"./workspace/create\";\nexport { workspaceList } from \"./workspace/list\";\nexport {\n workspaceDelete,\n type WorkspaceDeleteOptions,\n} from \"./workspace/delete\";\nexport type { WorkspaceInfo } from \"./workspace/transform\";\nexport {\n machineUserList,\n type MachineUserListOptions,\n type MachineUserInfo,\n} from \"./machineuser/list\";\nexport {\n machineUserToken,\n type MachineUserTokenOptions,\n type MachineUserTokenInfo,\n} from \"./machineuser/token\";\nexport {\n oauth2ClientGet,\n type OAuth2ClientGetOptions,\n} from \"./oauth2client/get\";\nexport {\n oauth2ClientList,\n type OAuth2ClientListOptions,\n} from \"./oauth2client/list\";\nexport type {\n OAuth2ClientInfo,\n OAuth2ClientCredentials,\n} from \"./oauth2client/transform\";\nexport { workflowList, type WorkflowListOptions } from \"./workflow/list\";\nexport { workflowGet, type WorkflowGetOptions } from \"./workflow/get\";\nexport { workflowStart, type WorkflowStartOptions } from \"./workflow/start\";\nexport {\n workflowExecutionsList,\n workflowExecutionGet,\n type WorkflowExecutionsListOptions,\n type WorkflowExecutionGetOptions,\n} from \"./workflow/executions\";\nexport { workflowResume, type WorkflowResumeOptions } from \"./workflow/resume\";\nexport type {\n WorkflowListInfo,\n WorkflowInfo,\n WorkflowExecutionInfo,\n WorkflowJobExecutionInfo,\n WorkflowStartResult,\n WorkflowResumeResult,\n} from \"./workflow/transform\";\n"],"mappings":";;;;;AAIA,SAAS,OAAO,OAAO,KAAK,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC"}
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
- import { PATScope, applyCommand, commonArgs, createCommand, deleteCommand, fetchAll, fetchLatestToken, fetchUserInfo, formatArgs, generateCommand, getCommand, initOAuth2Client, initOperatorClient, listCommand as listCommand$5, listCommand$1 as listCommand$6, listCommand$2 as listCommand, loadAccessToken, loadConfig, loadWorkspaceId, parseFormat, printWithFormat, readPackageJson, readPlatformConfig, removeCommand, showCommand, tokenCommand, withCommonArgs, writePlatformConfig } from "../list-CCYkqZyi.mjs";
2
+ import { PATScope, applyCommand, commonArgs, createCommand, deleteCommand, executionsCommand, fetchAll, fetchLatestToken, fetchUserInfo, formatArgs, generateCommand, getCommand, getCommand$1, initOAuth2Client, initOperatorClient, listCommand as listCommand$1, listCommand$1 as listCommand$6, listCommand$2 as listCommand$7, listCommand$3 as listCommand, loadAccessToken, loadConfig, loadWorkspaceId, parseFormat, printWithFormat, readPackageJson, readPlatformConfig, removeCommand, resumeCommand, showCommand, startCommand, tokenCommand, withCommonArgs, writePlatformConfig } from "../resume-Bk4u_qL4.mjs";
3
3
  import "../job-BGBMNqRW.mjs";
4
4
  import { register } from "node:module";
5
5
  import { defineCommand, runCommand, runMain } from "citty";
6
6
  import { z } from "zod";
7
+ import * as crypto from "node:crypto";
7
8
  import ml from "multiline-ts";
8
- import { consola } from "consola";
9
+ import { consola as consola$1 } from "consola";
9
10
  import { generateCodeVerifier } from "@badgateway/oauth2-client";
10
11
  import { timestampDate } from "@bufbuild/protobuf/wkt";
11
12
  import { Code, ConnectError } from "@connectrpc/connect";
12
13
  import chalk from "chalk";
13
14
  import { spawnSync } from "node:child_process";
14
- import * as crypto from "node:crypto";
15
15
  import * as http from "node:http";
16
16
  import open from "open";
17
17
 
@@ -52,7 +52,7 @@ const initCommand = defineCommand({
52
52
  const version = packageJson$1.version && packageJson$1.version !== "0.0.0" ? packageJson$1.version : "latest";
53
53
  let packageManager = detectPackageManager();
54
54
  if (!packageManager) {
55
- consola.warn("⚠️ Could not detect package manager, defaulting to npm");
55
+ consola$1.warn("⚠️ Could not detect package manager, defaulting to npm");
56
56
  packageManager = "npm";
57
57
  }
58
58
  const initArgs = [
@@ -62,7 +62,7 @@ const initCommand = defineCommand({
62
62
  ...packageManager === "npm" ? ["--"] : [],
63
63
  ...args.template ? ["--template", args.template] : []
64
64
  ];
65
- consola.log(`Running: ${packageManager} ${initArgs.join(" ")}`);
65
+ consola$1.log(`Running: ${packageManager} ${initArgs.join(" ")}`);
66
66
  spawnSync(packageManager, initArgs, { stdio: "inherit" });
67
67
  })
68
68
  });
@@ -129,11 +129,11 @@ const startAuthServer = async () => {
129
129
  state,
130
130
  codeVerifier
131
131
  });
132
- consola.info(`Opening browser for login:\n\n${authorizeUri}\n`);
132
+ consola$1.info(`Opening browser for login:\n\n${authorizeUri}\n`);
133
133
  try {
134
134
  await open(authorizeUri);
135
135
  } catch {
136
- consola.warn("Failed to open browser automatically. Please open the URL above manually.");
136
+ consola$1.warn("Failed to open browser automatically. Please open the URL above manually.");
137
137
  }
138
138
  });
139
139
  });
@@ -146,7 +146,7 @@ const loginCommand = defineCommand({
146
146
  args: commonArgs,
147
147
  run: withCommonArgs(async () => {
148
148
  await startAuthServer();
149
- consola.success("Successfully logged in to Tailor Platform.");
149
+ consola$1.success("Successfully logged in to Tailor Platform.");
150
150
  })
151
151
  });
152
152
 
@@ -162,7 +162,7 @@ const logoutCommand = defineCommand({
162
162
  const pfConfig = readPlatformConfig();
163
163
  const tokens = pfConfig.current_user ? pfConfig.users[pfConfig.current_user] : void 0;
164
164
  if (!tokens) {
165
- consola.warn("You are not logged in.");
165
+ consola$1.warn("You are not logged in.");
166
166
  return;
167
167
  }
168
168
  initOAuth2Client().revoke({
@@ -173,7 +173,7 @@ const logoutCommand = defineCommand({
173
173
  delete pfConfig.users[pfConfig.current_user];
174
174
  pfConfig.current_user = null;
175
175
  writePlatformConfig(pfConfig);
176
- consola.success("Successfully logged out from Tailor Platform.");
176
+ consola$1.success("Successfully logged out from Tailor Platform.");
177
177
  })
178
178
  });
179
179
 
@@ -185,11 +185,11 @@ const machineuserCommand = defineCommand({
185
185
  description: "Manage machine users"
186
186
  },
187
187
  subCommands: {
188
- list: listCommand$6,
188
+ list: listCommand$7,
189
189
  token: tokenCommand
190
190
  },
191
191
  async run() {
192
- await runCommand(listCommand$6, { rawArgs: [] });
192
+ await runCommand(listCommand$7, { rawArgs: [] });
193
193
  }
194
194
  });
195
195
 
@@ -201,11 +201,11 @@ const oauth2clientCommand = defineCommand({
201
201
  description: "Manage OAuth2 clients"
202
202
  },
203
203
  subCommands: {
204
- get: getCommand,
205
- list: listCommand$5
204
+ get: getCommand$1,
205
+ list: listCommand$6
206
206
  },
207
207
  async run() {
208
- await runCommand(listCommand$5, { rawArgs: [] });
208
+ await runCommand(listCommand$6, { rawArgs: [] });
209
209
  }
210
210
  });
211
211
 
@@ -252,7 +252,7 @@ const createCommand$3 = defineCommand({
252
252
  workspace_id: args["workspace-id"]
253
253
  };
254
254
  writePlatformConfig(config);
255
- if (format === "table") consola.success(`Profile "${args.name}" created successfully.`);
255
+ if (format === "table") consola$1.success(`Profile "${args.name}" created successfully.`);
256
256
  const profileInfo = {
257
257
  name: args.name,
258
258
  user: args.user,
@@ -282,13 +282,13 @@ const deleteCommand$3 = defineCommand({
282
282
  if (!config.profiles[args.name]) throw new Error(`Profile "${args.name}" not found.`);
283
283
  delete config.profiles[args.name];
284
284
  writePlatformConfig(config);
285
- consola.success(`Profile "${args.name}" deleted successfully.`);
285
+ consola$1.success(`Profile "${args.name}" deleted successfully.`);
286
286
  })
287
287
  });
288
288
 
289
289
  //#endregion
290
290
  //#region src/cli/profile/list.ts
291
- const listCommand$4 = defineCommand({
291
+ const listCommand$5 = defineCommand({
292
292
  meta: {
293
293
  name: "list",
294
294
  description: "List all profiles"
@@ -302,7 +302,7 @@ const listCommand$4 = defineCommand({
302
302
  const config = readPlatformConfig();
303
303
  const profiles = Object.entries(config.profiles);
304
304
  if (profiles.length === 0) {
305
- consola.info(ml`
305
+ consola$1.info(ml`
306
306
  No profiles found.
307
307
  Please create a profile first using 'tailor-sdk profile create' command.
308
308
  `);
@@ -362,7 +362,7 @@ const updateCommand$1 = defineCommand({
362
362
  profile.user = newUser;
363
363
  profile.workspace_id = newWorkspaceId;
364
364
  writePlatformConfig(config);
365
- if (format === "table") consola.success(`Profile "${args.name}" updated successfully`);
365
+ if (format === "table") consola$1.success(`Profile "${args.name}" updated successfully`);
366
366
  const profileInfo = {
367
367
  name: args.name,
368
368
  user: newUser,
@@ -382,11 +382,11 @@ const profileCommand = defineCommand({
382
382
  subCommands: {
383
383
  create: createCommand$3,
384
384
  delete: deleteCommand$3,
385
- list: listCommand$4,
385
+ list: listCommand$5,
386
386
  update: updateCommand$1
387
387
  },
388
388
  async run() {
389
- await runCommand(listCommand$4, { rawArgs: [] });
389
+ await runCommand(listCommand$5, { rawArgs: [] });
390
390
  }
391
391
  });
392
392
 
@@ -449,7 +449,7 @@ const createSecretCommand = defineCommand({
449
449
  }
450
450
  throw error;
451
451
  }
452
- consola.success(`Secret: ${args.name} created in vault: ${args["vault-name"]}`);
452
+ consola$1.success(`Secret: ${args.name} created in vault: ${args["vault-name"]}`);
453
453
  })
454
454
  });
455
455
 
@@ -500,8 +500,8 @@ const deleteSecretCommand = defineCommand({
500
500
  profile: args.profile
501
501
  });
502
502
  if (!args.yes) {
503
- if (await consola.prompt(`Enter the secret name to confirm deletion ("${args.name}"): `, { type: "text" }) !== args.name) {
504
- consola.info("Secret deletion cancelled.");
503
+ if (await consola$1.prompt(`Enter the secret name to confirm deletion ("${args.name}"): `, { type: "text" }) !== args.name) {
504
+ consola$1.info("Secret deletion cancelled.");
505
505
  return;
506
506
  }
507
507
  }
@@ -515,7 +515,7 @@ const deleteSecretCommand = defineCommand({
515
515
  if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Secret "${args.name}" not found in vault "${args["vault-name"]}".`);
516
516
  throw error;
517
517
  }
518
- consola.success(`Secret: ${args.name} deleted from vault: ${args["vault-name"]}`);
518
+ consola$1.success(`Secret: ${args.name} deleted from vault: ${args["vault-name"]}`);
519
519
  })
520
520
  });
521
521
 
@@ -643,7 +643,7 @@ const updateSecretCommand = defineCommand({
643
643
  if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Secret "${args.name}" not found in vault "${args["vault-name"]}".`);
644
644
  throw error;
645
645
  }
646
- consola.success(`Secret: ${args.name} updated in vault: ${args["vault-name"]}`);
646
+ consola$1.success(`Secret: ${args.name} updated in vault: ${args["vault-name"]}`);
647
647
  })
648
648
  });
649
649
 
@@ -691,7 +691,7 @@ const createCommand$2 = defineCommand({
691
691
  if (error instanceof ConnectError && error.code === Code.AlreadyExists) throw new Error(`Vault "${args.name}" already exists.`);
692
692
  throw error;
693
693
  }
694
- consola.success(`Vault: ${args.name} created`);
694
+ consola$1.success(`Vault: ${args.name} created`);
695
695
  })
696
696
  });
697
697
 
@@ -737,8 +737,8 @@ const deleteCommand$2 = defineCommand({
737
737
  profile: args.profile
738
738
  });
739
739
  if (!args.yes) {
740
- if (await consola.prompt(`Enter the vault name to confirm deletion ("${args.name}"): `, { type: "text" }) !== args.name) {
741
- consola.info("Vault deletion cancelled.");
740
+ if (await consola$1.prompt(`Enter the vault name to confirm deletion ("${args.name}"): `, { type: "text" }) !== args.name) {
741
+ consola$1.info("Vault deletion cancelled.");
742
742
  return;
743
743
  }
744
744
  }
@@ -751,7 +751,7 @@ const deleteCommand$2 = defineCommand({
751
751
  if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Vault "${args.name}" not found.`);
752
752
  throw error;
753
753
  }
754
- consola.success(`Vault: ${args.name} deleted`);
754
+ consola$1.success(`Vault: ${args.name} deleted`);
755
755
  })
756
756
  });
757
757
 
@@ -782,7 +782,7 @@ async function vaultList(options) {
782
782
  return [vaults, nextPageToken];
783
783
  })).map(vaultInfo);
784
784
  }
785
- const listCommand$3 = defineCommand({
785
+ const listCommand$4 = defineCommand({
786
786
  meta: {
787
787
  name: "list",
788
788
  description: "List Secret Manager vaults"
@@ -821,10 +821,10 @@ const vaultCommand = defineCommand({
821
821
  subCommands: {
822
822
  create: createCommand$2,
823
823
  delete: deleteCommand$2,
824
- list: listCommand$3
824
+ list: listCommand$4
825
825
  },
826
826
  async run() {
827
- await runCommand(listCommand$3, { rawArgs: [] });
827
+ await runCommand(listCommand$4, { rawArgs: [] });
828
828
  }
829
829
  });
830
830
 
@@ -855,14 +855,14 @@ async function truncateSingleType(options, client) {
855
855
  namespaceName: options.namespaceName,
856
856
  tailordbTypeName: options.typeName
857
857
  });
858
- consola.success(`Truncated type "${options.typeName}" in namespace "${options.namespaceName}"`);
858
+ consola$1.success(`Truncated type "${options.typeName}" in namespace "${options.namespaceName}"`);
859
859
  }
860
860
  async function truncateNamespace(workspaceId, namespaceName, client) {
861
861
  await client.truncateTailorDBTypes({
862
862
  workspaceId,
863
863
  namespaceName
864
864
  });
865
- consola.success(`Truncated all types in namespace "${namespaceName}"`);
865
+ consola$1.success(`Truncated all types in namespace "${namespaceName}"`);
866
866
  }
867
867
  async function getAllNamespaces(configPath) {
868
868
  const { config } = await loadConfig(configPath);
@@ -905,32 +905,32 @@ async function truncate(options) {
905
905
  const namespaces = await getAllNamespaces(options?.configPath);
906
906
  if (hasAll) {
907
907
  if (namespaces.length === 0) {
908
- consola.warn("No namespaces found in config file.");
908
+ consola$1.warn("No namespaces found in config file.");
909
909
  return;
910
910
  }
911
911
  if (!options?.yes) {
912
912
  const namespaceList = namespaces.join(", ");
913
- if (!await consola.prompt(`This will truncate ALL tables in the following namespaces: ${namespaceList}. Continue? (yes/no)`, {
913
+ if (!await consola$1.prompt(`This will truncate ALL tables in the following namespaces: ${namespaceList}. Continue? (yes/no)`, {
914
914
  type: "confirm",
915
915
  initial: false
916
916
  })) {
917
- consola.info("Truncate cancelled.");
917
+ consola$1.info("Truncate cancelled.");
918
918
  return;
919
919
  }
920
920
  }
921
921
  for (const namespace of namespaces) await truncateNamespace(workspaceId, namespace, client);
922
- consola.success("Truncated all tables in all namespaces");
922
+ consola$1.success("Truncated all tables in all namespaces");
923
923
  return;
924
924
  }
925
925
  if (hasNamespace && options?.namespace) {
926
926
  const namespace = options.namespace;
927
927
  if (!namespaces.includes(namespace)) throw new Error(`Namespace "${namespace}" not found in config. Available namespaces: ${namespaces.join(", ")}`);
928
928
  if (!options.yes) {
929
- if (!await consola.prompt(`This will truncate ALL tables in namespace "${namespace}". Continue? (yes/no)`, {
929
+ if (!await consola$1.prompt(`This will truncate ALL tables in namespace "${namespace}". Continue? (yes/no)`, {
930
930
  type: "confirm",
931
931
  initial: false
932
932
  })) {
933
- consola.info("Truncate cancelled.");
933
+ consola$1.info("Truncate cancelled.");
934
934
  return;
935
935
  }
936
936
  }
@@ -949,11 +949,11 @@ async function truncate(options) {
949
949
  if (notFoundTypes.length > 0) throw new Error(`The following types were not found in any namespace: ${notFoundTypes.join(", ")}`);
950
950
  if (!options.yes) {
951
951
  const typeList = typeNames.join(", ");
952
- if (!await consola.prompt(`This will truncate the following types: ${typeList}. Continue? (yes/no)`, {
952
+ if (!await consola$1.prompt(`This will truncate the following types: ${typeList}. Continue? (yes/no)`, {
953
953
  type: "confirm",
954
954
  initial: false
955
955
  })) {
956
- consola.info("Truncate cancelled.");
956
+ consola$1.info("Truncate cancelled.");
957
957
  return;
958
958
  }
959
959
  }
@@ -1048,7 +1048,7 @@ const currentCommand = defineCommand({
1048
1048
  run: withCommonArgs(async () => {
1049
1049
  const config = readPlatformConfig();
1050
1050
  if (!config.current_user) {
1051
- consola.warn(ml`
1051
+ consola$1.warn(ml`
1052
1052
  Current user not set.
1053
1053
  Please login first using 'tailor-sdk login' command to register a user.
1054
1054
  `);
@@ -1064,7 +1064,7 @@ const currentCommand = defineCommand({
1064
1064
 
1065
1065
  //#endregion
1066
1066
  //#region src/cli/user/list.ts
1067
- const listCommand$1 = defineCommand({
1067
+ const listCommand$2 = defineCommand({
1068
1068
  meta: {
1069
1069
  name: "list",
1070
1070
  description: "List all users"
@@ -1078,7 +1078,7 @@ const listCommand$1 = defineCommand({
1078
1078
  const config = readPlatformConfig();
1079
1079
  const users = Object.keys(config.users);
1080
1080
  if (users.length === 0) {
1081
- consola.info(ml`
1081
+ consola$1.info(ml`
1082
1082
  No users found.
1083
1083
  Please login first using 'tailor-sdk login' command to register a user.
1084
1084
  `);
@@ -1214,13 +1214,13 @@ const deleteCommand$1 = defineCommand({
1214
1214
  `);
1215
1215
  const token = await fetchLatestToken(config, config.current_user);
1216
1216
  await (await initOperatorClient(token)).deletePersonalAccessToken({ name: args.name });
1217
- consola.success(`Personal access token "${args.name}" deleted successfully.`);
1217
+ consola$1.success(`Personal access token "${args.name}" deleted successfully.`);
1218
1218
  })
1219
1219
  });
1220
1220
 
1221
1221
  //#endregion
1222
1222
  //#region src/cli/user/pat/list.ts
1223
- const listCommand$2 = defineCommand({
1223
+ const listCommand$3 = defineCommand({
1224
1224
  meta: {
1225
1225
  name: "list",
1226
1226
  description: "List all personal access tokens"
@@ -1243,7 +1243,7 @@ const listCommand$2 = defineCommand({
1243
1243
  return [personalAccessTokens, nextPageToken];
1244
1244
  });
1245
1245
  if (pats.length === 0) {
1246
- consola.info(ml`
1246
+ consola$1.info(ml`
1247
1247
  No personal access tokens found.
1248
1248
  Please create a token using 'tailor-sdk user pat create' command.
1249
1249
  `);
@@ -1315,11 +1315,11 @@ const patCommand = defineCommand({
1315
1315
  subCommands: {
1316
1316
  create: createCommand$1,
1317
1317
  delete: deleteCommand$1,
1318
- list: listCommand$2,
1318
+ list: listCommand$3,
1319
1319
  update: updateCommand
1320
1320
  },
1321
1321
  async run(context) {
1322
- await runCommand(listCommand$2, { rawArgs: context.rawArgs || [] });
1322
+ await runCommand(listCommand$3, { rawArgs: context.rawArgs || [] });
1323
1323
  }
1324
1324
  });
1325
1325
 
@@ -1346,7 +1346,7 @@ const useCommand = defineCommand({
1346
1346
  `);
1347
1347
  config.current_user = args.user;
1348
1348
  writePlatformConfig(config);
1349
- consola.success(`Current user set to "${args.user}" successfully.`);
1349
+ consola$1.success(`Current user set to "${args.user}" successfully.`);
1350
1350
  })
1351
1351
  });
1352
1352
 
@@ -1359,10 +1359,29 @@ const userCommand = defineCommand({
1359
1359
  },
1360
1360
  subCommands: {
1361
1361
  current: currentCommand,
1362
- list: listCommand$1,
1362
+ list: listCommand$2,
1363
1363
  pat: patCommand,
1364
1364
  use: useCommand
1365
1365
  },
1366
+ async run() {
1367
+ await runCommand(listCommand$2, { rawArgs: [] });
1368
+ }
1369
+ });
1370
+
1371
+ //#endregion
1372
+ //#region src/cli/workflow/index.ts
1373
+ const workflowCommand = defineCommand({
1374
+ meta: {
1375
+ name: "workflow",
1376
+ description: "Manage workflows"
1377
+ },
1378
+ subCommands: {
1379
+ list: listCommand$1,
1380
+ get: getCommand,
1381
+ start: startCommand,
1382
+ executions: executionsCommand,
1383
+ resume: resumeCommand
1384
+ },
1366
1385
  async run() {
1367
1386
  await runCommand(listCommand$1, { rawArgs: [] });
1368
1387
  }
@@ -1409,6 +1428,7 @@ const mainCommand = defineCommand({
1409
1428
  tailordb: tailordbCommand,
1410
1429
  secret: secretCommand,
1411
1430
  user: userCommand,
1431
+ workflow: workflowCommand,
1412
1432
  workspace: workspaceCommand
1413
1433
  }
1414
1434
  });