@tailor-platform/sdk 1.44.2 → 1.45.1

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 (73) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/{actor-DzCuoMlP.d.mts → actor-BmxQeMFP.d.mts} +2 -2
  3. package/dist/{application-7wtQzifE.mjs → application-B4zVVNRS.mjs} +28 -27
  4. package/dist/application-B4zVVNRS.mjs.map +1 -0
  5. package/dist/application-BIzicxMA.mjs +4 -0
  6. package/dist/cli/index.mjs +29 -29
  7. package/dist/cli/index.mjs.map +1 -1
  8. package/dist/cli/lib.d.mts +6 -6
  9. package/dist/cli/lib.mjs +8 -8
  10. package/dist/cli/lib.mjs.map +1 -1
  11. package/dist/{client-DcuQRqSd.mjs → client-BwXkoiMq.mjs} +3 -3
  12. package/dist/{client-DcuQRqSd.mjs.map → client-BwXkoiMq.mjs.map} +1 -1
  13. package/dist/{client-IsYnTV5A.mjs → client-DTaArWQr.mjs} +1 -1
  14. package/dist/configure/index.d.mts +5 -5
  15. package/dist/configure/index.mjs +16 -4
  16. package/dist/configure/index.mjs.map +1 -1
  17. package/dist/{crash-report-DQen2i_W.mjs → crash-report-BUHzuzDn.mjs} +1 -1
  18. package/dist/{crash-report-DVZsX1bs.mjs → crash-report-CtYCva4d.mjs} +3 -3
  19. package/dist/{crash-report-DVZsX1bs.mjs.map → crash-report-CtYCva4d.mjs.map} +1 -1
  20. package/dist/{errors-_M2TVoWh.mjs → errors-wNQxQQBH.mjs} +1 -1
  21. package/dist/{errors-_M2TVoWh.mjs.map → errors-wNQxQQBH.mjs.map} +1 -1
  22. package/dist/{file-utils-775qWKoo.mjs → file-utils-DjNi_3U_.mjs} +9 -9
  23. package/dist/file-utils-DjNi_3U_.mjs.map +1 -0
  24. package/dist/{index-DdsUV-aA.d.mts → index-B5_4Tzm2.d.mts} +2 -2
  25. package/dist/{index-BEEL1-6Z.d.mts → index-BBvPd9Uv.d.mts} +2 -2
  26. package/dist/{index-BOfTiouP.d.mts → index-DUKJPEwq.d.mts} +41 -8
  27. package/dist/{index-0Dk-fDWi.d.mts → index-DV-5OIEv.d.mts} +2 -2
  28. package/dist/{index-ZZYEd_0R.d.mts → index-Dxe6alSZ.d.mts} +2 -2
  29. package/dist/{interceptor-4UC-KTno.mjs → interceptor-CrcDfLPq.mjs} +1 -1
  30. package/dist/{interceptor-4UC-KTno.mjs.map → interceptor-CrcDfLPq.mjs.map} +1 -1
  31. package/dist/{kysely-type-BQsYEZoY.mjs → kysely-type-B8aRz_oC.mjs} +6 -6
  32. package/dist/kysely-type-B8aRz_oC.mjs.map +1 -0
  33. package/dist/multiline-e3IpANmS.mjs +39 -0
  34. package/dist/multiline-e3IpANmS.mjs.map +1 -0
  35. package/dist/{package-json-CRzw5eUf.mjs → package-json-6Px8bDpG.mjs} +1 -1
  36. package/dist/{package-json-CRzw5eUf.mjs.map → package-json-6Px8bDpG.mjs.map} +1 -1
  37. package/dist/package-json-7sRXVndJ.mjs +4 -0
  38. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  39. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  40. package/dist/plugin/builtin/file-utils/index.mjs +1 -1
  41. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
  42. package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
  43. package/dist/plugin/builtin/seed/index.d.mts +1 -1
  44. package/dist/plugin/builtin/seed/index.mjs +1 -1
  45. package/dist/plugin/index.d.mts +2 -2
  46. package/dist/{repl-editor-DjycioU-.mjs → repl-editor-BlT2dFtm.mjs} +1 -1
  47. package/dist/{repl-editor-DjycioU-.mjs.map → repl-editor-BlT2dFtm.mjs.map} +1 -1
  48. package/dist/{runtime-CEj_sAfP.mjs → runtime-D5AJYWnF.mjs} +85 -39
  49. package/dist/runtime-D5AJYWnF.mjs.map +1 -0
  50. package/dist/{seed-BkVKgsxf.mjs → seed-DrKY5yIF.mjs} +15 -15
  51. package/dist/seed-DrKY5yIF.mjs.map +1 -0
  52. package/dist/{service-CCnx_IFw.mjs → service-CCgw66c6.mjs} +2 -2
  53. package/dist/{service-CCnx_IFw.mjs.map → service-CCgw66c6.mjs.map} +1 -1
  54. package/dist/{tailor-db-field-D_z185oq.d.mts → tailor-db-field-Hx9OqPWY.d.mts} +5 -2
  55. package/dist/telemetry-BvI1EgMG.mjs +4 -0
  56. package/dist/{telemetry-B6Le9XT-.mjs → telemetry-DXitz4RH.mjs} +2 -2
  57. package/dist/{telemetry-B6Le9XT-.mjs.map → telemetry-DXitz4RH.mjs.map} +1 -1
  58. package/dist/utils/test/index.d.mts +3 -3
  59. package/dist/{workflow.generated-B7Mupf5V.d.mts → workflow.generated-DFljpJh7.d.mts} +2 -2
  60. package/docs/cli/tailordb.md +35 -415
  61. package/docs/services/executor.md +15 -1
  62. package/docs/services/idp.md +2 -2
  63. package/docs/services/tailordb-migration.md +418 -0
  64. package/docs/services/tailordb.md +6 -0
  65. package/package.json +4 -5
  66. package/dist/application-7wtQzifE.mjs.map +0 -1
  67. package/dist/application-P55ZFKHG.mjs +0 -4
  68. package/dist/file-utils-775qWKoo.mjs.map +0 -1
  69. package/dist/kysely-type-BQsYEZoY.mjs.map +0 -1
  70. package/dist/package-json-DR_mqrCW.mjs +0 -4
  71. package/dist/runtime-CEj_sAfP.mjs.map +0 -1
  72. package/dist/seed-BkVKgsxf.mjs.map +0 -1
  73. package/dist/telemetry-C_WXxIo0.mjs +0 -4
@@ -0,0 +1,4 @@
1
+
2
+ import { n as generatePluginFilesIfNeeded, r as loadApplication, t as defineApplication } from "./application-B4zVVNRS.mjs";
3
+
4
+ export { defineApplication };
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { G as PATScope, R as AuthInvokerSchema, c as fetchUserInfo, d as initOperatorClient, h as userAgent, i as fetchAll, j as FunctionExecution_Type, n as closeConnectionPool, o as fetchPaged, s as fetchPlatformMachineUserToken, u as initOAuth2Client } from "../client-DcuQRqSd.mjs";
3
+ import { G as PATScope, R as AuthInvokerSchema, c as fetchUserInfo, d as initOperatorClient, h as userAgent, i as fetchAll, j as FunctionExecution_Type, n as closeConnectionPool, o as fetchPaged, s as fetchPlatformMachineUserToken, u as initOAuth2Client } from "../client-BwXkoiMq.mjs";
4
4
  import { n as logger, r as styles } from "../logger-DTNAMYGy.mjs";
5
- import { $ as deleteCommand$3, At as executionsCommand, C as listCommand$13, Cn as toPageDirection, Ct as jobsCommand, E as resumeCommand, Et as startCommand, F as showCommand, Ft as getCommand$1, G as getCommand$5, H as treeCommand, I as logBetaWarning, Lt as apply, N as generateCommand$1, Nt as functionExecutionStatusToString, O as listCommand$12, Ot as getCommand$6, Pt as formatKeyValueTable, R as removeCommand$1, Rt as executeScript, Sn as paginationArgs, T as healthCommand, U as listCommand$11, Vt as parseMigrationLabelNumber, Y as listCommand$10, Z as getCommand$4, Zt as formatMigrationNumber, _n as commonArgs, _t as webhookCommand, at as getCommand$3, b as createCommand$4, bn as isVerbose, bt as listCommand$6, c as listCommand$14, ct as tokenCommand, dn as sdkNameLabelKey, dt as generate, en as getMigrationFilePath, f as restoreCommand, fn as trnPrefix, ft as listCommand$7, g as getCommand$7, gn as defineAppCommand, i as updateCommand$4, in as loadDiff, j as truncateCommand, ln as getNamespacesWithMigrations, lt as listCommand$8, m as listCommand$15, mn as apiCommand, mt as getCommand$2, o as removeCommand, q as updateCommand$2, r as queryCommand, rn as isValidMigrationNumber, rt as listCommand$9, t as isNativeTypeScriptRuntime, tn as getMigrationFiles, tt as createCommand$3, u as inviteCommand, un as prompt, v as deleteCommand$4, vn as confirmationArgs, vt as triggerCommand, wn as workspaceArgs, xn as pagedLogArgs, yn as deploymentArgs, z as updateCommand$3 } from "../runtime-CEj_sAfP.mjs";
6
- import { C as loadWorkspaceId, D as writePlatformConfig, E as saveUserTokens, S as loadAccessToken, T as resolveTokens, _ as getDistDir, a as WorkflowJobSchema, b as deleteUserTokens, c as ExecutorSchema, i as resolveInlineSourcemap, l as INVOKER_EXPR, o as ResolverSchema, w as readPlatformConfig, x as fetchLatestToken, y as loadConfig } from "../application-7wtQzifE.mjs";
7
- import { t as readPackageJson } from "../package-json-CRzw5eUf.mjs";
8
- import { n as isCLIError } from "../errors-_M2TVoWh.mjs";
9
- import { a as JSON_FOOTER_MARKER, i as CRASH_LOG_EXTENSION, o as parseCrashReportConfig, r as sendCrashReport, t as initCrashReporting } from "../crash-report-DVZsX1bs.mjs";
5
+ import { $ as deleteCommand$3, At as executionsCommand, C as listCommand$13, Cn as toPageDirection, Ct as jobsCommand, E as resumeCommand, Et as startCommand, F as showCommand, Ft as getCommand$1, G as getCommand$5, H as treeCommand, I as logBetaWarning, Lt as apply, N as generateCommand$1, Nt as functionExecutionStatusToString, O as listCommand$12, Ot as getCommand$6, Pt as formatKeyValueTable, R as removeCommand$1, Rt as executeScript, Sn as paginationArgs, T as healthCommand, U as listCommand$11, Vt as parseMigrationLabelNumber, Y as listCommand$10, Z as getCommand$4, Zt as formatMigrationNumber, _n as commonArgs, _t as webhookCommand, at as getCommand$3, b as createCommand$4, bn as isVerbose, bt as listCommand$6, c as listCommand$14, ct as tokenCommand, dn as sdkNameLabelKey, dt as generate, en as getMigrationFilePath, f as restoreCommand, fn as trnPrefix, ft as listCommand$7, g as getCommand$7, gn as defineAppCommand, i as updateCommand$4, in as loadDiff, j as truncateCommand, ln as getNamespacesWithMigrations, lt as listCommand$8, m as listCommand$15, mn as apiCommand, mt as getCommand$2, o as removeCommand, q as updateCommand$2, r as queryCommand, rn as isValidMigrationNumber, rt as listCommand$9, t as isNativeTypeScriptRuntime, tn as getMigrationFiles, tt as createCommand$3, u as inviteCommand, un as prompt, v as deleteCommand$4, vn as confirmationArgs, vt as triggerCommand, wn as workspaceArgs, xn as pagedLogArgs, yn as deploymentArgs, z as updateCommand$3 } from "../runtime-D5AJYWnF.mjs";
6
+ import { C as loadWorkspaceId, D as writePlatformConfig, E as saveUserTokens, S as loadAccessToken, T as resolveTokens, _ as getDistDir, a as WorkflowJobSchema, b as deleteUserTokens, c as ExecutorSchema, i as resolveInlineSourcemap, l as INVOKER_EXPR, o as ResolverSchema, w as readPlatformConfig, x as fetchLatestToken, y as loadConfig } from "../application-B4zVVNRS.mjs";
7
+ import { t as multiline } from "../multiline-e3IpANmS.mjs";
8
+ import { t as readPackageJson } from "../package-json-6Px8bDpG.mjs";
9
+ import { n as isCLIError } from "../errors-wNQxQQBH.mjs";
10
+ import { a as JSON_FOOTER_MARKER, i as CRASH_LOG_EXTENSION, o as parseCrashReportConfig, r as sendCrashReport, t as initCrashReporting } from "../crash-report-CtYCva4d.mjs";
10
11
  import { createRequire } from "node:module";
11
12
  import { arg, defineCommand, runCommand, runMain } from "politty";
12
13
  import { withCompletionCommand } from "politty/completion";
@@ -16,7 +17,6 @@ import { timestampDate } from "@bufbuild/protobuf/wkt";
16
17
  import * as path from "pathe";
17
18
  import { dirname, resolve } from "pathe";
18
19
  import { pathToFileURL } from "node:url";
19
- import ml from "multiline-ts";
20
20
  import { generateCodeVerifier } from "@badgateway/oauth2-client";
21
21
  import { Code, ConnectError } from "@connectrpc/connect";
22
22
  import * as http from "node:http";
@@ -48,7 +48,7 @@ const applyCommand = defineAppCommand({
48
48
  "clean-cache": arg(z.boolean().optional(), { description: "Clean the bundle cache before building" })
49
49
  }).strict(),
50
50
  run: async (args) => {
51
- const { initTelemetry } = await import("../telemetry-C_WXxIo0.mjs");
51
+ const { initTelemetry } = await import("../telemetry-BvI1EgMG.mjs");
52
52
  await initTelemetry();
53
53
  await apply({
54
54
  workspaceId: args["workspace-id"],
@@ -1047,16 +1047,16 @@ function generateEntry(detected, sourceFile, env, machineUser, workspaceId) {
1047
1047
  const absoluteSourcePath = path.resolve(sourceFile);
1048
1048
  switch (detected.type) {
1049
1049
  case "plain":
1050
- if (detected.namedMain) return ml`
1050
+ if (detected.namedMain) return multiline`
1051
1051
  export { main } from "${absoluteSourcePath}";
1052
1052
  `;
1053
- return ml`
1053
+ return multiline`
1054
1054
  import _fn from "${absoluteSourcePath}";
1055
1055
  export { _fn as main };
1056
1056
  `;
1057
1057
  case "resolver": {
1058
1058
  const userExpr = buildMachineUserExpr(machineUser, workspaceId);
1059
- return ml`
1059
+ return multiline`
1060
1060
  import _internalResolver from "${absoluteSourcePath}";
1061
1061
  import { t } from "@tailor-platform/sdk";
1062
1062
 
@@ -1089,7 +1089,7 @@ function generateEntry(detected, sourceFile, env, machineUser, workspaceId) {
1089
1089
  }
1090
1090
  case "executor": {
1091
1091
  const actorExpr = buildMachineActorExpr(machineUser, workspaceId);
1092
- return ml`
1092
+ return multiline`
1093
1093
  import _internalExecutor from "${absoluteSourcePath}";
1094
1094
 
1095
1095
  const _env = ${JSON.stringify(env)};
@@ -1105,7 +1105,7 @@ function generateEntry(detected, sourceFile, env, machineUser, workspaceId) {
1105
1105
  }
1106
1106
  case "workflow-job": {
1107
1107
  const exportName = detected.exportName;
1108
- return ml`
1108
+ return multiline`
1109
1109
  import { ${exportName} } from "${absoluteSourcePath}";
1110
1110
 
1111
1111
  const env = ${JSON.stringify(env)};
@@ -1543,7 +1543,7 @@ const generateCommand = defineAppCommand({
1543
1543
  })
1544
1544
  }).strict(),
1545
1545
  run: async (args) => {
1546
- const { initTelemetry } = await import("../telemetry-C_WXxIo0.mjs");
1546
+ const { initTelemetry } = await import("../telemetry-BvI1EgMG.mjs");
1547
1547
  await initTelemetry();
1548
1548
  await generate({
1549
1549
  configPath: args.config,
@@ -1898,7 +1898,7 @@ const listCommand$4 = defineAppCommand({
1898
1898
  const config = await readPlatformConfig();
1899
1899
  const profiles = Object.entries(config.profiles);
1900
1900
  if (profiles.length === 0) {
1901
- logger.info(ml`
1901
+ logger.info(multiline`
1902
1902
  No profiles found.
1903
1903
  Please create a profile first using 'tailor-sdk profile create' command.
1904
1904
  `);
@@ -3731,9 +3731,9 @@ const upgradeCommand = defineAppCommand({
3731
3731
  })
3732
3732
  }).strict(),
3733
3733
  run: async (args) => {
3734
- const { initTelemetry } = await import("../telemetry-C_WXxIo0.mjs");
3734
+ const { initTelemetry } = await import("../telemetry-BvI1EgMG.mjs");
3735
3735
  await initTelemetry();
3736
- const { upgrade } = await import("../service-CCnx_IFw.mjs");
3736
+ const { upgrade } = await import("../service-CCgw66c6.mjs");
3737
3737
  await upgrade({
3738
3738
  from: args.from,
3739
3739
  dryRun: args["dry-run"],
@@ -3750,11 +3750,11 @@ const currentCommand = defineAppCommand({
3750
3750
  args: z.object({}).strict(),
3751
3751
  run: async () => {
3752
3752
  const config = await readPlatformConfig();
3753
- if (!config.current_user) throw new Error(ml`
3753
+ if (!config.current_user) throw new Error(multiline`
3754
3754
  Current user not set.
3755
3755
  Please login first using 'tailor-sdk login' command to register a user.
3756
3756
  `);
3757
- if (!config.users[config.current_user]) throw new Error(ml`
3757
+ if (!config.users[config.current_user]) throw new Error(multiline`
3758
3758
  Current user '${config.current_user}' not found in registered users.
3759
3759
  Please login again using 'tailor-sdk login' command to register the user.
3760
3760
  `);
@@ -3772,7 +3772,7 @@ const listCommand$1 = defineAppCommand({
3772
3772
  const config = await readPlatformConfig();
3773
3773
  const users = Object.keys(config.users);
3774
3774
  if (users.length === 0) {
3775
- logger.info(ml`
3775
+ logger.info(multiline`
3776
3776
  No users found.
3777
3777
  Please login first using 'tailor-sdk login' command to register a user.
3778
3778
  `);
@@ -3834,7 +3834,7 @@ function printCreatedToken(name, token, write, action) {
3834
3834
  scopes,
3835
3835
  token
3836
3836
  });
3837
- else logger.log(ml`
3837
+ else logger.log(multiline`
3838
3838
  Personal access token ${action} successfully.
3839
3839
 
3840
3840
  name: ${name}
@@ -3862,7 +3862,7 @@ const createCommand = defineAppCommand({
3862
3862
  }).strict(),
3863
3863
  run: async (args) => {
3864
3864
  const config = await readPlatformConfig();
3865
- if (!config.current_user) throw new Error(ml`
3865
+ if (!config.current_user) throw new Error(multiline`
3866
3866
  No user logged in.
3867
3867
  Please login first using 'tailor-sdk login' command.
3868
3868
  `);
@@ -3888,7 +3888,7 @@ const deleteCommand = defineAppCommand({
3888
3888
  }) }).strict(),
3889
3889
  run: async (args) => {
3890
3890
  const config = await readPlatformConfig();
3891
- if (!config.current_user) throw new Error(ml`
3891
+ if (!config.current_user) throw new Error(multiline`
3892
3892
  No user logged in.
3893
3893
  Please login first using 'tailor-sdk login' command.
3894
3894
  `);
@@ -3905,7 +3905,7 @@ const listCommand = defineAppCommand({
3905
3905
  args: z.object({ ...paginationArgs() }).strict(),
3906
3906
  run: async (args) => {
3907
3907
  const config = await readPlatformConfig();
3908
- if (!config.current_user) throw new Error(ml`
3908
+ if (!config.current_user) throw new Error(multiline`
3909
3909
  No user logged in.
3910
3910
  Please login first using 'tailor-sdk login' command.
3911
3911
  `);
@@ -3920,7 +3920,7 @@ const listCommand = defineAppCommand({
3920
3920
  return [personalAccessTokens, nextPageToken];
3921
3921
  }, { limit: args.limit });
3922
3922
  if (pats.length === 0 && !args.json) {
3923
- logger.info(ml`
3923
+ logger.info(multiline`
3924
3924
  No personal access tokens found.
3925
3925
  Please create a token using 'tailor-sdk user pat create' command.
3926
3926
  `);
@@ -3958,7 +3958,7 @@ const updateCommand = defineAppCommand({
3958
3958
  }).strict(),
3959
3959
  run: async (args) => {
3960
3960
  const config = await readPlatformConfig();
3961
- if (!config.current_user) throw new Error(ml`
3961
+ if (!config.current_user) throw new Error(multiline`
3962
3962
  No user logged in.
3963
3963
  Please login first using 'tailor-sdk login' command.
3964
3964
  `);
@@ -4001,7 +4001,7 @@ const switchCommand = defineAppCommand({
4001
4001
  }) }).strict(),
4002
4002
  run: async (args) => {
4003
4003
  const config = await readPlatformConfig();
4004
- if (!config.users[args.user]) throw new Error(ml`
4004
+ if (!config.users[args.user]) throw new Error(multiline`
4005
4005
  User "${args.user}" not found.
4006
4006
  Please login first using 'tailor-sdk login' command to register this user.
4007
4007
  `);
@@ -4149,11 +4149,11 @@ runMain(mainCommand, {
4149
4149
  if (isVerbose() && error.stack) logger.debug(`\nStack trace:\n${error.stack}`);
4150
4150
  } else logger.error(`Unknown error: ${error}`);
4151
4151
  if (!isCLIError(error) && (!(error instanceof Error) || error instanceof TypeError || error instanceof RangeError)) {
4152
- const { reportCrash } = await import("../crash-report-DQen2i_W.mjs");
4152
+ const { reportCrash } = await import("../crash-report-BUHzuzDn.mjs");
4153
4153
  await reportCrash(error, "handledError");
4154
4154
  }
4155
4155
  }
4156
- const { shutdownTelemetry } = await import("../telemetry-C_WXxIo0.mjs");
4156
+ const { shutdownTelemetry } = await import("../telemetry-BvI1EgMG.mjs");
4157
4157
  await shutdownTelemetry();
4158
4158
  }
4159
4159
  });