@tailor-platform/sdk 1.29.0 → 1.30.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 (33) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{application-Clwpv84E.mjs → application-Bf8SUAtR.mjs} +89 -73
  3. package/dist/application-Bf8SUAtR.mjs.map +1 -0
  4. package/dist/{application-Dl1d7w-b.mjs → application-DAQVP9CS.mjs} +1 -1
  5. package/dist/cli/index.mjs +66 -35
  6. package/dist/cli/index.mjs.map +1 -1
  7. package/dist/cli/lib.d.mts +208 -43
  8. package/dist/cli/lib.mjs +23 -25
  9. package/dist/cli/lib.mjs.map +1 -1
  10. package/dist/configure/index.d.mts +4 -4
  11. package/dist/{env-BuMbIknz.d.mts → env-DiWYe80_.d.mts} +2 -2
  12. package/dist/{index-CbnLNm14.d.mts → index-2WQbf_LH.d.mts} +2 -2
  13. package/dist/{index-cD9sQLTh.d.mts → index-BU7Cd5I4.d.mts} +4 -4
  14. package/dist/{index-B0Lrzywd.d.mts → index-DCEMVfJA.d.mts} +2 -2
  15. package/dist/{index-D1AM_02Y.d.mts → index-HvMUWjvV.d.mts} +2 -2
  16. package/dist/{index-CyapgSFI.d.mts → index-rH_De6hM.d.mts} +2 -2
  17. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  18. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  19. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
  20. package/dist/plugin/builtin/seed/index.d.mts +1 -1
  21. package/dist/plugin/index.d.mts +2 -2
  22. package/dist/{plugin-D3a0-qe0.d.mts → plugin-C-UdAM8C.d.mts} +2 -2
  23. package/dist/{query-B1-hq2Hm.mjs → query-C3oQTLvb.mjs} +604 -108
  24. package/dist/query-C3oQTLvb.mjs.map +1 -0
  25. package/dist/schema-BePzTFBV.mjs.map +1 -1
  26. package/dist/utils/test/index.d.mts +2 -2
  27. package/dist/{workflow.generated-BsgIlrH-.d.mts → workflow.generated-C5wMcCjB.d.mts} +2 -2
  28. package/docs/cli/function.md +1 -1
  29. package/docs/cli/organization.md +426 -0
  30. package/docs/cli-reference.md +20 -2
  31. package/package.json +2 -2
  32. package/dist/application-Clwpv84E.mjs.map +0 -1
  33. package/dist/query-B1-hq2Hm.mjs.map +0 -1
@@ -3,7 +3,7 @@ import "./brand-GZnI4eYb.mjs";
3
3
  import "./logger-CqezTedh.mjs";
4
4
  import "./client-CZmQBXAY.mjs";
5
5
  import "./package-json-D3x2nBPB.mjs";
6
- import { n as generatePluginFilesIfNeeded, r as loadApplication, t as defineApplication } from "./application-Clwpv84E.mjs";
6
+ import { n as generatePluginFilesIfNeeded, r as loadApplication, t as defineApplication } from "./application-Bf8SUAtR.mjs";
7
7
  import "./seed-CWkIDWMb.mjs";
8
8
  import "./file-utils-Bctuzn3x.mjs";
9
9
  import "./kysely-type-B_IecdK9.mjs";
@@ -3,10 +3,10 @@ import "../chunk-DEt8GZDa.mjs";
3
3
  import "../schema-BePzTFBV.mjs";
4
4
  import "../brand-GZnI4eYb.mjs";
5
5
  import { n as logger, r as styles } from "../logger-CqezTedh.mjs";
6
- import { $t as workspaceArgs, C as listCommand$10, E as resumeCommand, F as showCommand, Ft as isValidMigrationNumber, G as listCommand$7, Ht as prompt, I as logBetaWarning, It as loadDiff, Jt as defineAppCommand, Mt as getMigrationFilePath, N as generateCommand$1, Nt as getMigrationFiles, O as listCommand$9, Q as listCommand$6, Qt as isVerbose, R as removeCommand$1, T as healthCommand, Ut as sdkNameLabelKey, V as getCommand$2, Vt as getNamespacesWithMigrations, W as tokenCommand, Wt as trnPrefix, X as triggerCommand, Xt as confirmationArgs, Y as webhookCommand, Yt as commonArgs, Zt as deploymentArgs, b as createCommand$3, c as listCommand$11, ct as executionsCommand, dt as functionExecutionStatusToString, f as restoreCommand, ft as formatKeyValueTable, g as getCommand$4, gt as executeScript, ht as apply, i as updateCommand$2, it as startCommand, j as truncateCommand, kt as formatMigrationNumber, m as listCommand$12, n as queryCommand, o as removeCommand, ot as getCommand$3, pt as getCommand$1, q as generate, qt as apiCommand, r as isCLIError, tt as jobsCommand, u as inviteCommand, v as deleteCommand$3, yt as parseMigrationLabelNumber, z as listCommand$8 } from "../query-B1-hq2Hm.mjs";
6
+ import { $ as deleteCommand$3, $t as isValidMigrationNumber, At as formatKeyValueTable, C as listCommand$12, E as resumeCommand, Et as executionsCommand, F as showCommand, G as getCommand$4, H as treeCommand, I as logBetaWarning, Lt as parseMigrationLabelNumber, N as generateCommand$1, Nt as apply, O as listCommand$11, Pt as executeScript, R as removeCommand$1, St as startCommand, T as healthCommand, U as listCommand$10, Xt as getMigrationFilePath, Y as listCommand$9, Z as getCommand$3, Zt as getMigrationFiles, _n as workspaceArgs, an as getNamespacesWithMigrations, at as getCommand$2, b as createCommand$4, c as listCommand$13, cn as trnPrefix, ct as tokenCommand, dn as apiCommand, dt as generate, en as loadDiff, f as restoreCommand, fn as defineAppCommand, g as getCommand$6, gn as isVerbose, gt as listCommand$6, hn as deploymentArgs, i as updateCommand$4, j as truncateCommand, jt as getCommand$1, kt as functionExecutionStatusToString, lt as listCommand$7, m as listCommand$14, mn as confirmationArgs, mt as triggerCommand, n as queryCommand, o as removeCommand, on as prompt, pn as commonArgs, pt as webhookCommand, q as updateCommand$2, qt as formatMigrationNumber, r as isCLIError, rt as listCommand$8, sn as sdkNameLabelKey, tt as createCommand$3, u as inviteCommand, v as deleteCommand$4, wt as getCommand$5, yt as jobsCommand, z as updateCommand$3 } from "../query-C3oQTLvb.mjs";
7
7
  import { E as FunctionExecution_Type, M as AuthInvokerSchema, a as fetchPlatformMachineUserToken, c as initOAuth2Client, l as initOperatorClient, n as closeConnectionPool, o as fetchUserInfo, p as userAgent, r as fetchAll, z as PATScope } from "../client-CZmQBXAY.mjs";
8
8
  import { t as readPackageJson } from "../package-json-D3x2nBPB.mjs";
9
- import { S as writePlatformConfig, a as loadConfig, b as loadWorkspaceId, c as ExecutorSchema, g as getDistDir, i as resolveInlineSourcemap, o as WorkflowJobSchema, u as ResolverSchema, v as fetchLatestToken, x as readPlatformConfig, y as loadAccessToken } from "../application-Clwpv84E.mjs";
9
+ import { S as writePlatformConfig, a as loadConfig, b as loadWorkspaceId, c as ExecutorSchema, g as getDistDir, i as resolveInlineSourcemap, o as WorkflowJobSchema, u as ResolverSchema, v as fetchLatestToken, x as readPlatformConfig, y as loadAccessToken } from "../application-Bf8SUAtR.mjs";
10
10
  import "../seed-CWkIDWMb.mjs";
11
11
  import "../file-utils-Bctuzn3x.mjs";
12
12
  import "../kysely-type-B_IecdK9.mjs";
@@ -324,7 +324,6 @@ async function bundleForTestRun(options) {
324
324
  const baseName = `test-run--${detected.name}`;
325
325
  const scriptName = `${baseName}.js`;
326
326
  const entryPath = path.join(outputDir, `${baseName}.entry.js`);
327
- const outputPath = path.join(outputDir, scriptName);
328
327
  const entryContent = generateEntry(detected, sourceFile, env, machineUser, workspaceId);
329
328
  fs$1.writeFileSync(entryPath, entryContent);
330
329
  let tsconfig;
@@ -333,25 +332,24 @@ async function bundleForTestRun(options) {
333
332
  } catch {
334
333
  tsconfig = void 0;
335
334
  }
336
- await rolldown.build(rolldown.defineConfig({
337
- input: entryPath,
338
- output: {
339
- file: outputPath,
340
- format: "esm",
341
- sourcemap: inlineSourcemap ? "inline" : true,
342
- minify: inlineSourcemap ? { mangle: { keepNames: true } } : true,
343
- codeSplitting: false
344
- },
345
- tsconfig,
346
- treeshake: {
347
- moduleSideEffects: false,
348
- annotations: true,
349
- unknownGlobalSideEffects: false
350
- },
351
- logLevel: "silent"
352
- }));
353
335
  return {
354
- bundledCode: fs$1.readFileSync(outputPath, "utf-8"),
336
+ bundledCode: (await rolldown.build({
337
+ input: entryPath,
338
+ write: false,
339
+ output: {
340
+ format: "esm",
341
+ sourcemap: inlineSourcemap ? "inline" : true,
342
+ minify: inlineSourcemap ? { mangle: { keepNames: true } } : true,
343
+ codeSplitting: false
344
+ },
345
+ tsconfig,
346
+ treeshake: {
347
+ moduleSideEffects: false,
348
+ annotations: true,
349
+ unknownGlobalSideEffects: false
350
+ },
351
+ logLevel: "silent"
352
+ })).output[0].code,
355
353
  scriptName
356
354
  };
357
355
  }
@@ -617,7 +615,7 @@ When a \`.js\` file is provided, detection and bundling are skipped and the file
617
615
  desc: "Run a specific workflow job by name"
618
616
  },
619
617
  {
620
- cmd: ".tailor-sdk/resolvers/add.js --arg '{\"input\":{\"a\":1,\"b\":2}}'",
618
+ cmd: "build/resolvers/add.js --arg '{\"input\":{\"a\":1,\"b\":2}}'",
621
619
  desc: "Run a pre-bundled .js file directly"
622
620
  }
623
621
  ],
@@ -1061,6 +1059,37 @@ const openCommand = defineAppCommand({
1061
1059
  }
1062
1060
  });
1063
1061
 
1062
+ //#endregion
1063
+ //#region src/cli/commands/organization/folder/index.ts
1064
+ const folderCommand = defineCommand({
1065
+ name: "folder",
1066
+ description: "Manage organization folders.",
1067
+ subCommands: {
1068
+ create: createCommand$3,
1069
+ delete: deleteCommand$3,
1070
+ get: getCommand$3,
1071
+ list: listCommand$9,
1072
+ update: updateCommand$2
1073
+ }
1074
+ });
1075
+
1076
+ //#endregion
1077
+ //#region src/cli/commands/organization/index.ts
1078
+ const organizationCommand = defineCommand({
1079
+ name: "organization",
1080
+ description: "Manage Tailor Platform organizations.",
1081
+ subCommands: {
1082
+ folder: folderCommand,
1083
+ get: getCommand$4,
1084
+ list: listCommand$10,
1085
+ tree: treeCommand,
1086
+ update: updateCommand$3
1087
+ },
1088
+ async run() {
1089
+ await runCommand(listCommand$10, []);
1090
+ }
1091
+ });
1092
+
1064
1093
  //#endregion
1065
1094
  //#region src/cli/commands/profile/create.ts
1066
1095
  const createCommand$2 = defineAppCommand({
@@ -3107,14 +3136,14 @@ const workflowCommand = defineCommand({
3107
3136
  name: "workflow",
3108
3137
  description: "Manage workflows and workflow executions.",
3109
3138
  subCommands: {
3110
- list: listCommand$9,
3111
- get: getCommand$3,
3139
+ list: listCommand$11,
3140
+ get: getCommand$5,
3112
3141
  start: startCommand,
3113
3142
  executions: executionsCommand,
3114
3143
  resume: resumeCommand
3115
3144
  },
3116
3145
  async run() {
3117
- await runCommand(listCommand$9, []);
3146
+ await runCommand(listCommand$11, []);
3118
3147
  }
3119
3148
  });
3120
3149
 
@@ -3125,10 +3154,10 @@ const appCommand = defineCommand({
3125
3154
  description: "Manage workspace applications",
3126
3155
  subCommands: {
3127
3156
  health: healthCommand,
3128
- list: listCommand$10
3157
+ list: listCommand$12
3129
3158
  },
3130
3159
  async run() {
3131
- await runCommand(listCommand$10, []);
3160
+ await runCommand(listCommand$12, []);
3132
3161
  }
3133
3162
  });
3134
3163
 
@@ -3139,12 +3168,12 @@ const userCommand = defineCommand({
3139
3168
  description: "Manage workspace users",
3140
3169
  subCommands: {
3141
3170
  invite: inviteCommand,
3142
- list: listCommand$11,
3171
+ list: listCommand$13,
3143
3172
  remove: removeCommand,
3144
- update: updateCommand$2
3173
+ update: updateCommand$4
3145
3174
  },
3146
3175
  async run() {
3147
- await runCommand(listCommand$11, []);
3176
+ await runCommand(listCommand$13, []);
3148
3177
  }
3149
3178
  });
3150
3179
 
@@ -3155,15 +3184,15 @@ const workspaceCommand = defineCommand({
3155
3184
  description: "Manage Tailor Platform workspaces.",
3156
3185
  subCommands: {
3157
3186
  app: appCommand,
3158
- create: createCommand$3,
3159
- delete: deleteCommand$3,
3160
- get: getCommand$4,
3161
- list: listCommand$12,
3187
+ create: createCommand$4,
3188
+ delete: deleteCommand$4,
3189
+ get: getCommand$6,
3190
+ list: listCommand$14,
3162
3191
  restore: restoreCommand,
3163
3192
  user: userCommand
3164
3193
  },
3165
3194
  async run() {
3166
- await runCommand(listCommand$12, []);
3195
+ await runCommand(listCommand$14, []);
3167
3196
  }
3168
3197
  });
3169
3198
 
@@ -3189,6 +3218,7 @@ const mainCommand = withCompletionCommand(defineCommand({
3189
3218
  machineuser: machineuserCommand,
3190
3219
  oauth2client: oauth2clientCommand,
3191
3220
  open: openCommand,
3221
+ organization: organizationCommand,
3192
3222
  profile: profileCommand,
3193
3223
  query: queryCommand,
3194
3224
  remove: removeCommand$1,
@@ -3205,6 +3235,7 @@ const mainCommand = withCompletionCommand(defineCommand({
3205
3235
  runMain(mainCommand, {
3206
3236
  version: packageJson.version,
3207
3237
  globalArgs: z.object(commonArgs),
3238
+ displayErrors: false,
3208
3239
  cleanup: async ({ error }) => {
3209
3240
  if (error) {
3210
3241
  if (isCLIError(error)) {