@tailor-platform/sdk 1.81.0 → 1.83.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 (58) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/application-CP7JKG9R.mjs +3 -0
  3. package/dist/{application-DDe0er6L.mjs → application-Cp0FxIm2.mjs} +26 -10
  4. package/dist/application-Cp0FxIm2.mjs.map +1 -0
  5. package/dist/cli/index.mjs +9 -9
  6. package/dist/cli/lib.mjs +2 -2
  7. package/dist/cli/skills.mjs +1 -1
  8. package/dist/completion/zsh-worker.zsh +1 -1
  9. package/dist/configure/config/types.d.mts +3 -1
  10. package/dist/configure/index.mjs +3 -3
  11. package/dist/configure/index.mjs.map +1 -1
  12. package/dist/configure/services/workflow/execution-policy.d.mts +2 -2
  13. package/dist/{crashreport-BNWUM6Kf.mjs → crashreport-DMYuHnBN.mjs} +2 -2
  14. package/dist/{crashreport-BNWUM6Kf.mjs.map → crashreport-DMYuHnBN.mjs.map} +1 -1
  15. package/dist/{crashreport-BafWvjjX.mjs → crashreport-ecqnz51B.mjs} +1 -1
  16. package/dist/{globals-DUqEetIh.mjs → globals-DraXTdqg.mjs} +6 -5
  17. package/dist/globals-DraXTdqg.mjs.map +1 -0
  18. package/dist/{logger-BwS4ppwO.mjs → logger-CXQq9YIp.mjs} +110 -13
  19. package/dist/logger-CXQq9YIp.mjs.map +1 -0
  20. package/dist/{logger-B-fqZe2W.mjs → logger-t5ASCDZm.mjs} +6 -7
  21. package/dist/{logger-B-fqZe2W.mjs.map → logger-t5ASCDZm.mjs.map} +1 -1
  22. package/dist/{register-typescript-runtime-QAWucsg0.mjs → register-typescript-runtime-CCHyKeXO.mjs} +129 -19
  23. package/dist/register-typescript-runtime-CCHyKeXO.mjs.map +1 -0
  24. package/dist/{registry-CXi7rJq7.mjs → registry-Ct0Wgxp1.mjs} +3 -3
  25. package/dist/registry-Ct0Wgxp1.mjs.map +1 -0
  26. package/dist/runtime/index.mjs +2 -2
  27. package/dist/runtime/logger.mjs +1 -1
  28. package/dist/runtime/workflow.d.mts +39 -21
  29. package/dist/runtime/workflow.mjs +2 -2
  30. package/dist/{service-CDPatibu.mjs → service-B0MaodSg.mjs} +2 -2
  31. package/dist/{service-CDPatibu.mjs.map → service-B0MaodSg.mjs.map} +1 -1
  32. package/dist/{service-Cp0I7ZFe.mjs → service-CIGSGg9I.mjs} +2 -2
  33. package/dist/{service-Cp0I7ZFe.mjs.map → service-CIGSGg9I.mjs.map} +1 -1
  34. package/dist/service-KnAiVofD.mjs +3 -0
  35. package/dist/utils/test/index.mjs +18 -12
  36. package/dist/utils/test/index.mjs.map +1 -1
  37. package/dist/utils/test/mock.d.mts +2 -2
  38. package/dist/vitest/environment.mjs +1 -1
  39. package/dist/vitest/index.mjs +30 -24
  40. package/dist/vitest/index.mjs.map +1 -1
  41. package/dist/vitest/mocks/workflow.d.mts +20 -15
  42. package/dist/vitest/setup.mjs +1 -1
  43. package/dist/{workflow-CkIDJpdg.mjs → workflow-B2mwc7aT.mjs} +17 -9
  44. package/dist/workflow-B2mwc7aT.mjs.map +1 -0
  45. package/docs/configuration.md +3 -1
  46. package/docs/runtime.md +1 -1
  47. package/docs/services/tailordb-migration.md +5 -3
  48. package/docs/services/workflow.md +2 -2
  49. package/docs/testing.md +1 -1
  50. package/package.json +3 -3
  51. package/dist/application-B1_7Wm37.mjs +0 -3
  52. package/dist/application-DDe0er6L.mjs.map +0 -1
  53. package/dist/globals-DUqEetIh.mjs.map +0 -1
  54. package/dist/logger-BwS4ppwO.mjs.map +0 -1
  55. package/dist/register-typescript-runtime-QAWucsg0.mjs.map +0 -1
  56. package/dist/registry-CXi7rJq7.mjs.map +0 -1
  57. package/dist/service-Cg7Qibit.mjs +0 -3
  58. package/dist/workflow-CkIDJpdg.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 1.83.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1873](https://github.com/tailor-platform/sdk/pull/1873) [`79f5d61`](https://github.com/tailor-platform/sdk/commit/79f5d61993354dccb7a973a00b7e0f54a5dc0a60) Thanks [@k1LoW](https://github.com/k1LoW)! - Add `tailor.workflow.execJobFunction` as the canonical name for executing a workflow job function and returning its result. `startJobFunction` and `triggerJobFunction` remain available as aliases with the same behavior; `@deprecated` markers now point users at `execJobFunction`. Bundled workflow output emitted by the SDK now targets the canonical `execJobFunction` name.
8
+
9
+ - [#1861](https://github.com/tailor-platform/sdk/pull/1861) [`c970daf`](https://github.com/tailor-platform/sdk/commit/c970daf4bef76d0d83db5e4bf8405e156bd89a4e) Thanks [@dqn](https://github.com/dqn)! - Classify type-level unique index changes as breaking in `tailordb migration generate`: adding a unique index (or adding `unique` to an existing index, or changing a unique index's field set) now prompts for confirmation and auto-generates a `migrate.ts` that resolves duplicate value combinations before the constraint is enforced. During deploy, the pre-migration phase withholds the new unique index (or keeps the previous definition) until the migration script has run.
10
+
11
+ ## 1.82.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#1866](https://github.com/tailor-platform/sdk/pull/1866) [`1ae2485`](https://github.com/tailor-platform/sdk/commit/1ae24854f049ac51036842bacf4f35eb74ecd50c) Thanks [@toiroakr](https://github.com/toiroakr)! - `logLevel` now also controls `logger.*` calls (from `@tailor-platform/sdk/runtime`) in bundled functions, in addition to `console.*`. `logger.debug`/`logger.info`/`logger.warn`/`logger.error` are dropped at the same thresholds as their `console` counterparts.
16
+
17
+ ### Patch Changes
18
+
19
+ - [#1848](https://github.com/tailor-platform/sdk/pull/1848) [`6f16760`](https://github.com/tailor-platform/sdk/commit/6f167606f01d3eacf157e81f7b7f4c6026b2dc99) Thanks [@toiroakr](https://github.com/toiroakr)! - Replaced the `table` dependency (heavy transitive deps, low OpenSSF Scorecard) with an in-house single-line box-drawing table renderer used by the CLI's tabular output (`logger.out`, `formatTable`/`formatKeyValueTable`/`formatTableWithHeaders`). Column width calculation now uses the small, dependency-free `get-east-asian-width` package for correct alignment with full-width (CJK) characters. No user-facing behavior change is expected.
20
+
3
21
  ## 1.81.0
4
22
 
5
23
  ### Minor Changes
@@ -0,0 +1,3 @@
1
+ import { n as generatePluginFilesIfNeeded, r as loadApplication, t as defineApplication } from "./application-Cp0FxIm2.mjs";
2
+
3
+ export { defineApplication, generatePluginFilesIfNeeded };
@@ -1,7 +1,7 @@
1
1
  import { n as isSdkBranded } from "./brand-Eo4pLXPJ.mjs";
2
2
  import { t as assertDefined } from "./assert-DBxo8jPo.mjs";
3
- import { a as parseBoolean, n as logger, r as styles } from "./logger-BwS4ppwO.mjs";
4
- import { a as TailorFieldSchema, i as AuthInvokerSchema, n as ExecutorSchema, o as loadFilesWithIgnores, r as AuthConfigSchema, s as functionSchema, t as createExecutorService } from "./service-CDPatibu.mjs";
3
+ import { a as parseBoolean, n as logger, r as styles } from "./logger-CXQq9YIp.mjs";
4
+ import { a as TailorFieldSchema, i as AuthInvokerSchema, n as ExecutorSchema, o as loadFilesWithIgnores, r as AuthConfigSchema, s as functionSchema, t as createExecutorService } from "./service-B0MaodSg.mjs";
5
5
  import { t as multiline } from "./multiline-sfHpTZZK.mjs";
6
6
  import { t as isPluginGeneratedType } from "./type-source-DH_LH20p.mjs";
7
7
  import { t as userAgent } from "./user-agent-DX2Jnw0-.mjs";
@@ -260,7 +260,7 @@ function retryInterceptor() {
260
260
  logger.debug(`retry: ${req.method.name} returned AlreadyExists on attempt ${i + 1}; treating as success (prior attempt likely committed)`);
261
261
  return synthesizeEmptyUnaryResponse(req);
262
262
  }
263
- const { reportCrash } = await import("./crashreport-BafWvjjX.mjs");
263
+ const { reportCrash } = await import("./crashreport-ecqnz51B.mjs");
264
264
  await reportCrash(error, "handledError");
265
265
  }
266
266
  if (req.method.name !== "CreateWorkspace" && isRetirable(error, req.method.idempotency)) {
@@ -2008,7 +2008,7 @@ function transformFunctionTriggers(source, triggerContext, currentFilePath) {
2008
2008
  transformedCall = `tailor.workflow.triggerWorkflow(${JSON.stringify(call.targetName)}, ${call.argsText || "undefined"}${optionsPart})`;
2009
2009
  } else {
2010
2010
  const optionsPart = call.optionsText !== void 0 ? `, ${call.optionsText}` : "";
2011
- transformedCall = `(async () => tailor.workflow.triggerJobFunction(${JSON.stringify(call.targetName)}, ${call.argsText || "undefined"}${optionsPart}))()`;
2011
+ transformedCall = `(async () => tailor.workflow.execJobFunction(${JSON.stringify(call.targetName)}, ${call.argsText || "undefined"}${optionsPart}))()`;
2012
2012
  }
2013
2013
  replacements.push({
2014
2014
  start: call.callRange.start,
@@ -2057,20 +2057,36 @@ const DEBUG_LEVEL_CONSOLE_METHODS = [
2057
2057
  ];
2058
2058
  const WARN_LEVEL_CONSOLE_METHODS = ["console.warn"];
2059
2059
  const ERROR_LEVEL_CONSOLE_METHODS = ["console.error"];
2060
+ const DEBUG_LEVEL_LOGGER_METHODS = ["globalThis.tailor.logger.debug"];
2061
+ const INFO_LEVEL_LOGGER_METHODS = ["globalThis.tailor.logger.info"];
2062
+ const WARN_LEVEL_LOGGER_METHODS = ["globalThis.tailor.logger.warn"];
2063
+ const ERROR_LEVEL_LOGGER_METHODS = ["globalThis.tailor.logger.error"];
2060
2064
  const MANUAL_PURE_FUNCTIONS_BY_LOG_LEVEL = {
2061
2065
  DEBUG: [],
2062
- INFO: DEBUG_LEVEL_CONSOLE_METHODS,
2063
- WARN: [...DEBUG_LEVEL_CONSOLE_METHODS, ...INFO_LEVEL_CONSOLE_METHODS],
2066
+ INFO: [...DEBUG_LEVEL_CONSOLE_METHODS, ...DEBUG_LEVEL_LOGGER_METHODS],
2067
+ WARN: [
2068
+ ...DEBUG_LEVEL_CONSOLE_METHODS,
2069
+ ...INFO_LEVEL_CONSOLE_METHODS,
2070
+ ...DEBUG_LEVEL_LOGGER_METHODS,
2071
+ ...INFO_LEVEL_LOGGER_METHODS
2072
+ ],
2064
2073
  ERROR: [
2065
2074
  ...DEBUG_LEVEL_CONSOLE_METHODS,
2066
2075
  ...INFO_LEVEL_CONSOLE_METHODS,
2067
- ...WARN_LEVEL_CONSOLE_METHODS
2076
+ ...WARN_LEVEL_CONSOLE_METHODS,
2077
+ ...DEBUG_LEVEL_LOGGER_METHODS,
2078
+ ...INFO_LEVEL_LOGGER_METHODS,
2079
+ ...WARN_LEVEL_LOGGER_METHODS
2068
2080
  ],
2069
2081
  SILENT: [
2070
2082
  ...DEBUG_LEVEL_CONSOLE_METHODS,
2071
2083
  ...INFO_LEVEL_CONSOLE_METHODS,
2072
2084
  ...WARN_LEVEL_CONSOLE_METHODS,
2073
- ...ERROR_LEVEL_CONSOLE_METHODS
2085
+ ...ERROR_LEVEL_CONSOLE_METHODS,
2086
+ ...DEBUG_LEVEL_LOGGER_METHODS,
2087
+ ...INFO_LEVEL_LOGGER_METHODS,
2088
+ ...WARN_LEVEL_LOGGER_METHODS,
2089
+ ...ERROR_LEVEL_LOGGER_METHODS
2074
2090
  ]
2075
2091
  };
2076
2092
  function normalizeBundleLogLevel(value) {
@@ -4999,7 +5015,7 @@ const RetryPolicySchema = z.object({
4999
5015
  });
5000
5016
  const ConcurrencyPolicySchema = z.object({ maxConcurrentExecutions: z.number().int().min(1).max(1e3).describe("Maximum number of concurrent executions (1-1000)") });
5001
5017
  const ExecutionPolicyNameSchema = z.string().regex(/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/, "Invalid execution policy name: must match [a-z0-9-] (3-63 chars; must start and end with [a-z0-9])").describe("Workspace-unique execution policy name embedded in the resource TRN");
5002
- const ExecutionPolicyKeySchema = z.string().regex(/^[a-z0-9][a-z0-9_:.-]{0,62}[a-z0-9*]$/, "Invalid execution policy key: must match [a-z0-9_:.-] (2-64 chars; must start with [a-z0-9] and end with [a-z0-9] or a trailing '*')").describe("Execution policy key passed to startJobFunction's (or its frozen alias triggerJobFunction's) executionPolicyKey option");
5018
+ const ExecutionPolicyKeySchema = z.string().regex(/^[a-z0-9][a-z0-9_:.-]{0,62}[a-z0-9*]$/, "Invalid execution policy key: must match [a-z0-9_:.-] (2-64 chars; must start with [a-z0-9] and end with [a-z0-9] or a trailing '*')").describe("Execution policy key passed to execJobFunction's (or its aliases startJobFunction / triggerJobFunction) executionPolicyKey option");
5003
5019
  const WorkflowJobFunctionExecutionPolicySchema = z.object({
5004
5020
  name: ExecutionPolicyNameSchema,
5005
5021
  key: ExecutionPolicyKeySchema,
@@ -5741,4 +5757,4 @@ async function loadApplication(params) {
5741
5757
 
5742
5758
  //#endregion
5743
5759
  export { defaultPlatformBaseUrl as A, getPlatformBaseUrl as B, getPluginGenerationDependencies as C, hashContent as D, getDistDir as E, fetchPlatformMachineUserToken as F, rememberPlatformConfigForToken as G, initOperatorClient as H, fetchUserInfo as I, createApplyLimiter as J, resolveStaticWebsiteUrls as K, getConsoleBaseUrl as L, fetchAllTolerant as M, fetchMachineUserToken as N, hashFile as O, fetchPaged as P, getOAuth2ClientId as R, resolveBundleLogLevel as S, createBundleCache as T, isDefaultPlatform as U, initOAuth2Client as V, normalizeBaseUrl as W, LOG_LEVELS as Y, stringifyFunction as _, resolveInlineSourcemap as a, composeFunctionTreeshakeOptions as b, ResolverSchema as c, buildExecutorArgsExpr as d, buildResolverOperationHookExpr as f, TailorDBTypeSchema as g, assertUniqueTailorDBTypeNamesWithExternal as h, resolverBundleKey as i, fetchAll as j, closeConnectionPool as k, HTTP_METHODS as l, assertUniqueLocalTailorDBTypeNames as m, generatePluginFilesIfNeeded as n, WorkflowJobFunctionExecutionPolicySchema as o, buildResolverPermissionAndInputCheckExpr as p, byName as q, loadApplication as r, WorkflowJobSchema as s, defineApplication as t, INVOKER_EXPR as u, resolveTSConfigWithFallback as v, hasGenerationHooks as w, createLogLevelTreeshakeOptions as x, platformBundleDefinePlugin as y, getOrNull as z };
5744
- //# sourceMappingURL=application-DDe0er6L.mjs.map
5760
+ //# sourceMappingURL=application-Cp0FxIm2.mjs.map