@tailor-platform/sdk 1.78.0 → 1.80.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 (62) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/{application-CUxVA7Fs.mjs → application-C1d52JP9.mjs} +290 -224
  3. package/dist/application-C1d52JP9.mjs.map +1 -0
  4. package/dist/application-Nlh9BHQf.mjs +3 -0
  5. package/dist/cli/commands/tailordb/migrate/bundler.d.mts +3 -2
  6. package/dist/cli/index.mjs +27 -53
  7. package/dist/cli/index.mjs.map +1 -1
  8. package/dist/cli/lib.mjs +3 -6
  9. package/dist/cli/lib.mjs.map +1 -1
  10. package/dist/cli/tsconfig-paths-hook.d.mts +1 -0
  11. package/dist/cli/tsconfig-paths-hook.mjs +153 -0
  12. package/dist/completion/zsh-worker.zsh +1 -1
  13. package/dist/configure/config/types.d.mts +5 -1
  14. package/dist/configure/index.mjs +7 -6
  15. package/dist/configure/index.mjs.map +1 -1
  16. package/dist/configure/services/auth/types.d.mts +18 -23
  17. package/dist/configure/services/tailordb/schema.d.mts +1 -7
  18. package/dist/configure/services/workflow/execution-policy.d.mts +2 -2
  19. package/dist/configure/types/type.d.mts +1 -9
  20. package/dist/{globals-CvizbGLY.mjs → globals-B-n_3uYu.mjs} +11 -5
  21. package/dist/globals-B-n_3uYu.mjs.map +1 -0
  22. package/dist/{runtime-BD2vYJFT.mjs → register-typescript-runtime-Bd4bcLbW.mjs} +399 -124
  23. package/dist/register-typescript-runtime-Bd4bcLbW.mjs.map +1 -0
  24. package/dist/{registry-CYBRvfaU.mjs → registry-CXi7rJq7.mjs} +3 -2
  25. package/dist/registry-CXi7rJq7.mjs.map +1 -0
  26. package/dist/runtime/field-parse.d.mts +11 -0
  27. package/dist/runtime/globals.d.mts +4 -1
  28. package/dist/runtime/index.mjs +1 -1
  29. package/dist/runtime/workflow.d.mts +79 -15
  30. package/dist/runtime/workflow.mjs +2 -2
  31. package/dist/{schema-U6DxoZ8D.mjs → schema-CYrle8JZ.mjs} +42 -24
  32. package/dist/schema-CYrle8JZ.mjs.map +1 -0
  33. package/dist/{service-D12iQGcS.mjs → service-CDPatibu.mjs} +31 -17
  34. package/dist/service-CDPatibu.mjs.map +1 -0
  35. package/dist/service-Cg7Qibit.mjs +3 -0
  36. package/dist/vitest/environment.mjs +1 -1
  37. package/dist/vitest/index.mjs +36 -10
  38. package/dist/vitest/index.mjs.map +1 -1
  39. package/dist/vitest/mocks/workflow.d.mts +29 -15
  40. package/dist/vitest/setup.mjs +1 -1
  41. package/dist/workflow-CkIDJpdg.mjs +69 -0
  42. package/dist/workflow-CkIDJpdg.mjs.map +1 -0
  43. package/docs/cli/application.md +6 -0
  44. package/docs/cli-reference.md +21 -21
  45. package/docs/configuration.md +2 -0
  46. package/docs/runtime.md +2 -2
  47. package/docs/services/auth.md +2 -2
  48. package/docs/services/tailordb.md +2 -0
  49. package/docs/services/workflow.md +2 -2
  50. package/docs/testing.md +2 -2
  51. package/package.json +7 -6
  52. package/dist/application-CUxVA7Fs.mjs.map +0 -1
  53. package/dist/application-Dp_-ioiP.mjs +0 -3
  54. package/dist/configure/types/field-runtime.d.mts +0 -17
  55. package/dist/globals-CvizbGLY.mjs.map +0 -1
  56. package/dist/registry-CYBRvfaU.mjs.map +0 -1
  57. package/dist/runtime-BD2vYJFT.mjs.map +0 -1
  58. package/dist/schema-U6DxoZ8D.mjs.map +0 -1
  59. package/dist/service-CghpdV-9.mjs +0 -3
  60. package/dist/service-D12iQGcS.mjs.map +0 -1
  61. package/dist/workflow-DSwnYPPP.mjs +0 -45
  62. package/dist/workflow-DSwnYPPP.mjs.map +0 -1
@@ -1,18 +1,12 @@
1
1
  import { TailorEnv } from "../../runtime/types.mjs";
2
- import { TriggerJobFunctionOptions } from "../../runtime/workflow.mjs";
2
+ import { StartJobFunctionOptions, StartWorkflowOptions } from "../../runtime/workflow.mjs";
3
3
  import { WorkflowJob } from "../../configure/services/workflow/job.mjs";
4
4
  import { Workflow } from "../../configure/services/workflow/workflow.mjs";
5
5
  import { WaitPointInstance } from "../../configure/services/workflow/wait-point.mjs";
6
6
  import { Mock } from "vitest";
7
7
  //#region src/vitest/mocks/workflow.d.ts
8
- type JobHandler = (jobName: string, args: unknown, options?: TriggerJobFunctionOptions) => unknown;
9
- type TriggerWorkflowOptions = {
10
- authInvoker?: {
11
- namespace: string;
12
- machineUserName: string;
13
- };
14
- };
15
- type TriggerHandlerFn = (workflowName: string, args: unknown, options?: TriggerWorkflowOptions) => string;
8
+ type JobHandler = (jobName: string, args: unknown, options?: StartJobFunctionOptions) => unknown;
9
+ type TriggerHandlerFn = (workflowName: string, args: unknown, options?: StartWorkflowOptions) => string;
16
10
  type ResumeHandlerFn = (executionId: string) => string;
17
11
  type WaitHandlerFn = (key: string, payload: unknown) => unknown;
18
12
  type ResolveHandler = (executionId: string, key: string, callback: (payload: unknown) => unknown) => unknown | Promise<unknown>;
@@ -23,12 +17,17 @@ type SetWaitHandler = {
23
17
  interface TriggeredJob {
24
18
  jobName: string;
25
19
  args: unknown;
26
- options?: TriggerJobFunctionOptions;
20
+ options?: StartJobFunctionOptions;
27
21
  }
28
22
  type WaitPayload<Payload> = [Payload] extends [undefined] ? undefined : Payload;
29
23
  /**
30
24
  * Acquire a disposable mock for workflow operations (`tailor.workflow`).
31
25
  * Restored on dispose.
26
+ *
27
+ * Canonical names (`startWorkflow`, `startJobFunction`, `resumeWorkflowExecution`)
28
+ * and their frozen aliases (`triggerWorkflow`, `triggerJobFunction`, `resumeWorkflow`)
29
+ * share the same underlying `vi.fn`, so calls through either name are recorded
30
+ * once and handlers configured on either name apply to both.
32
31
  * @returns Disposable workflow mock control object
33
32
  * @example
34
33
  * ```typescript
@@ -44,11 +43,26 @@ type WaitPayload<Payload> = [Payload] extends [undefined] ? undefined : Payload;
44
43
  * ```
45
44
  */
46
45
  declare function mockWorkflow(): {
47
- /** The `triggerJobFunction` `vi.fn`. */
48
- triggerJobFunction: Mock<(jobName: string, args?: unknown, _options?: TriggerJobFunctionOptions) => unknown>;
49
- /** The `triggerWorkflow` `vi.fn`. */
50
- triggerWorkflow: Mock<(workflowName: string, args?: unknown, _options?: TriggerWorkflowOptions) => Promise<string>>;
51
- /** The `resumeWorkflow` `vi.fn`. */
46
+ /** The `startJobFunction` `vi.fn`. */
47
+ startJobFunction: Mock<(jobName: string, args?: unknown, _options?: StartJobFunctionOptions) => unknown>;
48
+ /**
49
+ * Frozen alias of `startJobFunction` (same `vi.fn` reference).
50
+ * @deprecated Use `startJobFunction` instead.
51
+ */
52
+ triggerJobFunction: Mock<(jobName: string, args?: unknown, _options?: StartJobFunctionOptions) => unknown>;
53
+ /** The `startWorkflow` `vi.fn`. */
54
+ startWorkflow: Mock<(workflowName: string, args?: unknown, _options?: StartWorkflowOptions) => Promise<string>>;
55
+ /**
56
+ * Frozen alias of `startWorkflow` (same `vi.fn` reference).
57
+ * @deprecated Use `startWorkflow` instead.
58
+ */
59
+ triggerWorkflow: Mock<(workflowName: string, args?: unknown, _options?: StartWorkflowOptions) => Promise<string>>;
60
+ /** The `resumeWorkflowExecution` `vi.fn`. */
61
+ resumeWorkflowExecution: Mock<(executionId: string) => Promise<string>>;
62
+ /**
63
+ * Frozen alias of `resumeWorkflowExecution` (same `vi.fn` reference).
64
+ * @deprecated Use `resumeWorkflowExecution` instead.
65
+ */
52
66
  resumeWorkflow: Mock<(executionId: string) => Promise<string>>;
53
67
  /** The `wait` `vi.fn`. */
54
68
  wait: Mock<(_key: string, _payload?: unknown) => unknown>;
@@ -1,4 +1,4 @@
1
- import { t as RUNTIME_FLAG_KEY } from "../globals-CvizbGLY.mjs";
1
+ import { t as RUNTIME_FLAG_KEY } from "../globals-B-n_3uYu.mjs";
2
2
  import { t as mockSecretmanager } from "../secretmanager-IY4UvinW.mjs";
3
3
  import { pathToFileURL } from "node:url";
4
4
  import { afterEach, beforeAll, beforeEach } from "vitest";
@@ -0,0 +1,69 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-DXywRVcq.mjs";
2
+
3
+ //#region src/runtime/workflow.ts
4
+ var workflow_exports = /* @__PURE__ */ __exportAll({
5
+ resolve: () => resolve,
6
+ resumeWorkflow: () => resumeWorkflow,
7
+ resumeWorkflowExecution: () => resumeWorkflowExecution,
8
+ startJobFunction: () => startJobFunction,
9
+ startWorkflow: () => startWorkflow,
10
+ triggerJobFunction: () => triggerJobFunction,
11
+ triggerWorkflow: () => triggerWorkflow,
12
+ wait: () => wait
13
+ });
14
+ const api = () => globalThis.tailor.workflow;
15
+ /**
16
+ * See {@link TailorWorkflowAPI.startWorkflow}.
17
+ * @param args - Forwarded to {@link TailorWorkflowAPI.startWorkflow}
18
+ * @returns The execution ID of the started workflow
19
+ */
20
+ const startWorkflow = (...args) => api().startWorkflow(...args);
21
+ /**
22
+ * Frozen alias for {@link startWorkflow}. Kept for backward compatibility.
23
+ * @deprecated Use {@link startWorkflow} instead.
24
+ * @param args - Forwarded to {@link TailorWorkflowAPI.triggerWorkflow}
25
+ * @returns The execution ID of the triggered workflow
26
+ */
27
+ const triggerWorkflow = (...args) => api().triggerWorkflow(...args);
28
+ /**
29
+ * See {@link TailorWorkflowAPI.resumeWorkflowExecution}.
30
+ * @param args - Forwarded to {@link TailorWorkflowAPI.resumeWorkflowExecution}
31
+ * @returns The execution ID of the resumed workflow
32
+ */
33
+ const resumeWorkflowExecution = (...args) => api().resumeWorkflowExecution(...args);
34
+ /**
35
+ * Frozen alias for {@link resumeWorkflowExecution}. Kept for backward compatibility.
36
+ * @deprecated Use {@link resumeWorkflowExecution} instead.
37
+ * @param args - Forwarded to {@link TailorWorkflowAPI.resumeWorkflow}
38
+ * @returns The execution ID of the resumed workflow
39
+ */
40
+ const resumeWorkflow = (...args) => api().resumeWorkflow(...args);
41
+ /**
42
+ * See {@link TailorWorkflowAPI.startJobFunction}.
43
+ * @param args - Forwarded to {@link TailorWorkflowAPI.startJobFunction}
44
+ * @returns The job's return value
45
+ */
46
+ const startJobFunction = (...args) => api().startJobFunction(...args);
47
+ /**
48
+ * Frozen alias for {@link startJobFunction}. Kept for backward compatibility.
49
+ * @deprecated Use {@link startJobFunction} instead.
50
+ * @param args - Forwarded to {@link TailorWorkflowAPI.triggerJobFunction}
51
+ * @returns The job's return value
52
+ */
53
+ const triggerJobFunction = (...args) => api().triggerJobFunction(...args);
54
+ /**
55
+ * See {@link TailorWorkflowAPI.wait}.
56
+ * @param args - Forwarded to {@link TailorWorkflowAPI.wait}
57
+ * @returns The payload supplied by the corresponding `resolve` call
58
+ */
59
+ const wait = (...args) => api().wait(...args);
60
+ /**
61
+ * See {@link TailorWorkflowAPI.resolve}.
62
+ * @param args - Forwarded to {@link TailorWorkflowAPI.resolve}
63
+ * @returns A promise that resolves once the resolve has been recorded
64
+ */
65
+ const resolve = (...args) => api().resolve(...args);
66
+
67
+ //#endregion
68
+ export { startWorkflow as a, wait as c, startJobFunction as i, workflow_exports as l, resumeWorkflow as n, triggerJobFunction as o, resumeWorkflowExecution as r, triggerWorkflow as s, resolve as t };
69
+ //# sourceMappingURL=workflow-CkIDJpdg.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-CkIDJpdg.mjs","names":[],"sources":["../src/runtime/workflow.ts"],"sourcesContent":["/**\n * Workflow utilities.\n *\n * Thin typed wrapper around the platform-provided `tailor.workflow` runtime API.\n * At runtime this delegates to `globalThis.tailor.workflow`. Use `mockWorkflow`\n * from `@tailor-platform/sdk/vitest` to mock these calls in unit tests.\n *\n * The canonical names (`startWorkflow`, `startJobFunction`,\n * `resumeWorkflowExecution`) mirror the public `tailor.v1` RPC vocabulary.\n * The pre-alignment names (`triggerWorkflow`, `triggerJobFunction`,\n * `resumeWorkflow`) are kept as frozen aliases that reference the same platform\n * implementations, so existing code continues to work unchanged.\n * @example\n * import { workflow } from \"@tailor-platform/sdk/runtime\";\n *\n * const executionId = await workflow.startWorkflow(\"myWorkflow\", { data: \"value\" });\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * Specifies the machine user that should be used to execute the workflow.\n * This allows workflows to run with specific authentication context.\n */\nexport interface AuthInvoker {\n /** The namespace where the machine user is defined */\n namespace: string;\n /** The name of the machine user to use for workflow execution */\n machineUserName: string;\n}\n\n/** Options for {@link startWorkflow}. */\nexport interface StartWorkflowOptions {\n /** Optional authentication invoker to specify which machine user should execute the workflow */\n authInvoker?: AuthInvoker;\n}\n\n/**\n * Frozen alias for {@link StartWorkflowOptions}. Kept for backward compatibility.\n * @deprecated Use {@link StartWorkflowOptions} instead.\n */\nexport type TriggerWorkflowOptions = StartWorkflowOptions;\n\ndeclare const executionPolicyKeyBrand: unique symbol;\n\n/**\n * A concrete runtime key produced by an execution policy instance — either an\n * exact-match policy's `.key`, or a wildcard policy's `.keyFor(suffix)` (see\n * `defineWorkflowExecutionPolicies`). Branded so an arbitrary string that\n * wasn't derived from a declared policy can't be passed as `executionPolicyKey`.\n */\nexport type ExecutionPolicyKey = string & { readonly [executionPolicyKeyBrand]: never };\n\n/** Options for {@link startJobFunction}. */\nexport interface StartJobFunctionOptions {\n /**\n * Execution policy key matched by the platform against the policies\n * declared with `defineWorkflowExecutionPolicies` in `tailor.config.ts`.\n */\n executionPolicyKey?: ExecutionPolicyKey;\n}\n\n/**\n * Frozen alias for {@link StartJobFunctionOptions}. Kept for backward compatibility.\n * @deprecated Use {@link StartJobFunctionOptions} instead.\n */\nexport type TriggerJobFunctionOptions = StartJobFunctionOptions;\n\n/**\n * Platform API surface for `tailor.workflow`. Describes the shape the platform\n * runtime injects on `globalThis.tailor.workflow`.\n *\n * Each method below is also re-exported as a top-level named export from this\n * module so callers can either `import * as workflow from\n * \"@tailor-platform/sdk/runtime/workflow\"` or pick individual methods.\n */\nexport interface TailorWorkflowAPI {\n /**\n * Starts a workflow and returns its execution ID.\n *\n * Canonical name that mirrors the `tailor.v1` RPC vocabulary.\n * {@link triggerWorkflow} is a frozen alias that resolves to the same\n * platform implementation.\n * @param workflowName - Workflow name as defined in tailor.config\n * @param args - Arguments forwarded to the workflow's main job\n * @param options - Optional start options (e.g. `authInvoker`)\n * @returns The execution ID of the started workflow\n */\n startWorkflow(workflowName: string, args?: any, options?: StartWorkflowOptions): Promise<string>;\n\n /**\n * Frozen alias for {@link startWorkflow}. Kept for backward compatibility.\n * @deprecated Use {@link startWorkflow} instead.\n */\n triggerWorkflow(\n workflowName: string,\n args?: any,\n options?: TriggerWorkflowOptions,\n ): Promise<string>;\n\n /**\n * Resumes a failed or pending-retry workflow execution and returns its execution ID.\n *\n * Canonical name that mirrors the `tailor.v1` RPC vocabulary.\n * {@link resumeWorkflow} is a frozen alias that resolves to the same\n * platform implementation.\n * @param executionId - The execution to resume\n * @returns The execution ID of the resumed workflow\n */\n resumeWorkflowExecution(executionId: string): Promise<string>;\n\n /**\n * Frozen alias for {@link resumeWorkflowExecution}. Kept for backward compatibility.\n * @deprecated Use {@link resumeWorkflowExecution} instead.\n */\n resumeWorkflow(executionId: string): Promise<string>;\n\n /**\n * Starts a job function and returns its result.\n *\n * Canonical name that mirrors the `tailor.v1` RPC vocabulary.\n * {@link triggerJobFunction} is a frozen alias that resolves to the same\n * platform implementation.\n * @param jobName - Job name as defined in the workflow\n * @param args - Arguments forwarded to the job\n * @param options - Optional start options (e.g. `executionPolicyKey`)\n * @returns The job's return value\n */\n startJobFunction(jobName: string, args?: any, options?: StartJobFunctionOptions): any;\n\n /**\n * Frozen alias for {@link startJobFunction}. Kept for backward compatibility.\n * @deprecated Use {@link startJobFunction} instead.\n */\n triggerJobFunction(jobName: string, args?: any, options?: TriggerJobFunctionOptions): any;\n\n /**\n * Suspends the current workflow execution and waits for an external signal to resume.\n * @param key - Wait point key\n * @param payload - Optional payload to record with the wait point\n * @returns The payload supplied by the corresponding `resolve` call\n */\n wait(key: string, payload?: any): any;\n\n /**\n * Resolves a waiting workflow execution, causing it to resume.\n * @param executionId - The execution to resume\n * @param key - Wait point key to resolve\n * @param callback - Callback receiving the wait payload; its return value is forwarded to `wait`\n * @returns A promise that resolves once the resolve has been recorded\n */\n resolve(executionId: string, key: string, callback: (waitPayload: any) => any): Promise<void>;\n}\n\nconst api = (): TailorWorkflowAPI =>\n (globalThis as { tailor: { workflow: TailorWorkflowAPI } }).tailor.workflow;\n\n/**\n * See {@link TailorWorkflowAPI.startWorkflow}.\n * @param args - Forwarded to {@link TailorWorkflowAPI.startWorkflow}\n * @returns The execution ID of the started workflow\n */\nexport const startWorkflow: TailorWorkflowAPI[\"startWorkflow\"] = (...args) =>\n api().startWorkflow(...args);\n\n/**\n * Frozen alias for {@link startWorkflow}. Kept for backward compatibility.\n * @deprecated Use {@link startWorkflow} instead.\n * @param args - Forwarded to {@link TailorWorkflowAPI.triggerWorkflow}\n * @returns The execution ID of the triggered workflow\n */\nexport const triggerWorkflow: TailorWorkflowAPI[\"triggerWorkflow\"] = (...args) =>\n api().triggerWorkflow(...args);\n\n/**\n * See {@link TailorWorkflowAPI.resumeWorkflowExecution}.\n * @param args - Forwarded to {@link TailorWorkflowAPI.resumeWorkflowExecution}\n * @returns The execution ID of the resumed workflow\n */\nexport const resumeWorkflowExecution: TailorWorkflowAPI[\"resumeWorkflowExecution\"] = (...args) =>\n api().resumeWorkflowExecution(...args);\n\n/**\n * Frozen alias for {@link resumeWorkflowExecution}. Kept for backward compatibility.\n * @deprecated Use {@link resumeWorkflowExecution} instead.\n * @param args - Forwarded to {@link TailorWorkflowAPI.resumeWorkflow}\n * @returns The execution ID of the resumed workflow\n */\nexport const resumeWorkflow: TailorWorkflowAPI[\"resumeWorkflow\"] = (...args) =>\n api().resumeWorkflow(...args);\n\n/**\n * See {@link TailorWorkflowAPI.startJobFunction}.\n * @param args - Forwarded to {@link TailorWorkflowAPI.startJobFunction}\n * @returns The job's return value\n */\nexport const startJobFunction: TailorWorkflowAPI[\"startJobFunction\"] = (...args) =>\n api().startJobFunction(...args);\n\n/**\n * Frozen alias for {@link startJobFunction}. Kept for backward compatibility.\n * @deprecated Use {@link startJobFunction} instead.\n * @param args - Forwarded to {@link TailorWorkflowAPI.triggerJobFunction}\n * @returns The job's return value\n */\nexport const triggerJobFunction: TailorWorkflowAPI[\"triggerJobFunction\"] = (...args) =>\n api().triggerJobFunction(...args);\n\n/**\n * See {@link TailorWorkflowAPI.wait}.\n * @param args - Forwarded to {@link TailorWorkflowAPI.wait}\n * @returns The payload supplied by the corresponding `resolve` call\n */\nexport const wait: TailorWorkflowAPI[\"wait\"] = (...args) => api().wait(...args);\n\n/**\n * See {@link TailorWorkflowAPI.resolve}.\n * @param args - Forwarded to {@link TailorWorkflowAPI.resolve}\n * @returns A promise that resolves once the resolve has been recorded\n */\nexport const resolve: TailorWorkflowAPI[\"resolve\"] = (...args) => api().resolve(...args);\n"],"mappings":";;;;;;;;;;;;;AA0JA,MAAM,YACH,WAA2D,OAAO;;;;;;AAOrE,MAAa,iBAAqD,GAAG,SACnE,IAAI,CAAC,CAAC,cAAc,GAAG,IAAI;;;;;;;AAQ7B,MAAa,mBAAyD,GAAG,SACvE,IAAI,CAAC,CAAC,gBAAgB,GAAG,IAAI;;;;;;AAO/B,MAAa,2BAAyE,GAAG,SACvF,IAAI,CAAC,CAAC,wBAAwB,GAAG,IAAI;;;;;;;AAQvC,MAAa,kBAAuD,GAAG,SACrE,IAAI,CAAC,CAAC,eAAe,GAAG,IAAI;;;;;;AAO9B,MAAa,oBAA2D,GAAG,SACzE,IAAI,CAAC,CAAC,iBAAiB,GAAG,IAAI;;;;;;;AAQhC,MAAa,sBAA+D,GAAG,SAC7E,IAAI,CAAC,CAAC,mBAAmB,GAAG,IAAI;;;;;;AAOlC,MAAa,QAAmC,GAAG,SAAS,IAAI,CAAC,CAAC,KAAK,GAAG,IAAI;;;;;;AAO9E,MAAa,WAAyC,GAAG,SAAS,IAAI,CAAC,CAAC,QAAQ,GAAG,IAAI"}
@@ -133,6 +133,8 @@ tailor-sdk deploy --config apps/buyer/tailor.config.ts,apps/supplier/tailor.conf
133
133
 
134
134
  When multiple configs are provided, `deploy` creates or updates all configured services first, then updates the applications. This lets one application reference resources owned by another config with `external: true` during the same deploy.
135
135
 
136
+ Each config's `files` and `ignores` patterns (see [Service Configuration](../configuration.md#service-configuration)) resolve relative to that config's own directory, not the directory you ran `deploy` from. For example, `apps/buyer/tailor.config.ts` declaring `files: ["db/**/*.ts"]` loads files from `apps/buyer/db/`, independent of where `apps/supplier/tailor.config.ts`'s patterns resolve. If a config's relative patterns match nothing under its own directory, the SDK falls back to the invocation directory and logs a warning (see [Service Configuration](../configuration.md#service-configuration) for details).
137
+
136
138
  **Migration Handling:**
137
139
 
138
140
  When migrations are configured (`db.tailordb.migration` in config), the `deploy` command automatically:
@@ -144,6 +146,10 @@ When migrations are configured (`db.tailordb.migration` in config), the `deploy`
144
146
 
145
147
  See [Automatic Migration Execution](../services/tailordb-migration.md#automatic-migration-execution) for details on automatic migration execution.
146
148
 
149
+ **Concurrent Deploys:**
150
+
151
+ Deploys that target the same workspace and application from the same project directory are serialized while secrets and auth connections are updated: one deploy proceeds and the other waits for it to finish. A deploy that cannot proceed within 5 minutes fails with an error, which normally means another deploy is still running. If a previous deploy was interrupted, the next deploy recovers automatically within about a minute. Deploys to different workspaces or applications are not affected.
152
+
147
153
  **Schema Check:**
148
154
 
149
155
  By default, `deploy` performs two verification steps:
@@ -65,27 +65,27 @@ tailor-sdk deploy --env-file .env --env-file .env.production
65
65
 
66
66
  You can use environment variables to configure workspace and authentication:
67
67
 
68
- | Variable | Description |
69
- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
70
- | `TAILOR_PLATFORM_WORKSPACE_ID` | Workspace ID for deployment commands |
71
- | `TAILOR_PLATFORM_ORGANIZATION_ID` | Organization ID for organization commands |
72
- | `TAILOR_PLATFORM_FOLDER_ID` | Folder ID for folder commands |
73
- | `TAILOR_PLATFORM_TOKEN` | Authentication token (alternative to `login`) |
74
- | `TAILOR_TOKEN` | **Deprecated.** Use `TAILOR_PLATFORM_TOKEN` instead |
75
- | `TAILOR_PLATFORM_PROFILE` | Workspace profile name |
76
- | `TAILOR_PLATFORM_SDK_CONFIG_PATH` | Path to SDK config file |
77
- | `TAILOR_PLATFORM_SDK_DTS_PATH` | Output path for generated `tailor.d.ts` type definition file |
78
- | `TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID` | Client ID for `login --machine-user` |
79
- | `TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET` | Client secret for `login --machine-user` |
80
- | `TAILOR_PLATFORM_MACHINE_USER_NAME` | Default machine user name for `query`, `workflow start`, `function test-run`, `machineuser token` |
81
- | `TAILOR_PLATFORM_URL` | Platform API base URL. Saved into profiles created with `profile create --platform-url` |
82
- | `TAILOR_PLATFORM_OAUTH2_CLIENT_ID` | OAuth2 client ID for user login. Saved into profiles created with `profile create --oauth2-client-id` |
83
- | `TAILOR_PLATFORM_CONSOLE_URL` | Console base URL. Saved into profiles created with `profile create --console-url` |
84
- | `TAILOR_BUNDLE_CONCURRENCY` | Max concurrent bundle workers for `deploy` (resolvers/executors/workflows). Defaults to CPU count |
85
- | `TAILOR_APPLY_CONCURRENCY` | Max concurrent unary platform RPCs during `apply`/`deploy` (streaming uploads are not gated). Defaults to 16 |
86
- | `VISUAL` / `EDITOR` | Preferred editor for commands that open files (e.g., `vim`, `code`, `nano`) |
87
- | `TAILOR_CRASH_REPORTS_LOCAL` | Local crash log writing: `on` (default) or `off` |
88
- | `TAILOR_CRASH_REPORTS_REMOTE` | Automatic crash report submission: `off` (default) or `on` |
68
+ | Variable | Description |
69
+ | -------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
70
+ | `TAILOR_PLATFORM_WORKSPACE_ID` | Workspace ID for deployment commands |
71
+ | `TAILOR_PLATFORM_ORGANIZATION_ID` | Organization ID for organization commands |
72
+ | `TAILOR_PLATFORM_FOLDER_ID` | Folder ID for folder commands |
73
+ | `TAILOR_PLATFORM_TOKEN` | Authentication token (alternative to `login`) |
74
+ | `TAILOR_TOKEN` | **Deprecated.** Use `TAILOR_PLATFORM_TOKEN` instead |
75
+ | `TAILOR_PLATFORM_PROFILE` | Workspace profile name |
76
+ | `TAILOR_PLATFORM_SDK_CONFIG_PATH` | Path to SDK config file |
77
+ | `TAILOR_PLATFORM_SDK_DTS_PATH` | Output path for generated `tailor.d.ts` type definition file |
78
+ | `TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID` | Client ID for `login --machine-user` |
79
+ | `TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET` | Client secret for `login --machine-user` |
80
+ | `TAILOR_PLATFORM_MACHINE_USER_NAME` | Default machine user name for `query`, `workflow start`, `function test-run`, `machineuser token` |
81
+ | `TAILOR_PLATFORM_URL` | Platform API base URL. Saved into profiles created with `profile create --platform-url` |
82
+ | `TAILOR_PLATFORM_OAUTH2_CLIENT_ID` | OAuth2 client ID for user login. Saved into profiles created with `profile create --oauth2-client-id` |
83
+ | `TAILOR_PLATFORM_CONSOLE_URL` | Console base URL. Saved into profiles created with `profile create --console-url` |
84
+ | `TAILOR_BUNDLE_CONCURRENCY` | Max concurrent bundle workers for `deploy` (resolvers/executors/workflows). Defaults to CPU count |
85
+ | `TAILOR_APPLY_CONCURRENCY` | Max concurrent platform RPCs during `apply`/`deploy`. Defaults to 16 |
86
+ | `VISUAL` / `EDITOR` | Preferred editor for commands that open files (e.g., `vim`, `code`, `nano`) |
87
+ | `TAILOR_CRASH_REPORTS_LOCAL` | Local crash log writing: `on` (default) or `off` |
88
+ | `TAILOR_CRASH_REPORTS_REMOTE` | Automatic crash report submission: `off` (default) or `on` |
89
89
 
90
90
  ### Authentication Token Priority
91
91
 
@@ -82,6 +82,8 @@ export default defineConfig({
82
82
 
83
83
  **ignores**: Glob patterns to exclude files. Optional. By default, `**/*.test.ts` and `**/*.spec.ts` are automatically ignored. If you explicitly specify `ignores`, the default patterns will not be applied. Use `ignores: []` to include all files including test files.
84
84
 
85
+ **Pattern resolution**: `files` and `ignores` patterns are resolved relative to the directory of the `tailor.config.ts` file that declares them, not the directory you run the command from. This matters when deploying [multiple configs](./cli/application.md#deploy) together — each config's patterns only match files under its own directory. If a config's _relative_ patterns match nothing under its own directory, the SDK falls back to resolving them from the directory you ran the command from and logs a warning (this fallback doesn't apply to already-absolute patterns, since their resolution can't change). Update such patterns to be relative to the config's own directory — this fallback will be removed in v2.
86
+
85
87
  ### External Resources
86
88
 
87
89
  You can reference resources managed by Terraform or other SDK projects to include them in your application's subgraph. External resources are not deployed by this project but can be used for shared access across multiple applications.
package/docs/runtime.md CHANGED
@@ -31,7 +31,7 @@ const token = await authconnection.getConnectionToken("google");
31
31
  const client = new idp.Client({ namespace: "my-namespace" });
32
32
  const { users } = await client.users({ first: 10 });
33
33
 
34
- const executionId = await workflow.triggerWorkflow("approval", { reportId });
34
+ const executionId = await workflow.startWorkflow("approval", { reportId });
35
35
 
36
36
  const invoker = context.getInvoker();
37
37
 
@@ -79,7 +79,7 @@ The runtime entry re-exports the following namespaces. Detailed signatures, para
79
79
  - `secretmanager` — secret-vault access (`getSecret`, `getSecrets`)
80
80
  - `authconnection` — OAuth-style connection tokens (`getConnectionToken`)
81
81
  - `idp` — IdP user management (`new Client({ namespace })`)
82
- - `workflow` — workflow & job control (`triggerWorkflow`, `resumeWorkflow`, `triggerJobFunction`, `wait`, `resolve`)
82
+ - `workflow` — workflow & job control (`startWorkflow`, `resumeWorkflowExecution`, `startJobFunction`, `wait`, `resolve`; the pre-alignment names `triggerWorkflow`, `resumeWorkflow`, `triggerJobFunction` are kept as frozen aliases)
83
83
  - `context` — execution context (`getInvoker`)
84
84
  - `file` — `tailordb.file` BLOB API (`upload`, `download`, `downloadAsBase64`, `delete`, `getMetadata`, `downloadStream`, `uploadStream`, `openDownloadStream` _(deprecated)_)
85
85
  - `aigateway` — AI Gateway URL resolution (`get`)
@@ -107,7 +107,7 @@ userProfile: {
107
107
 
108
108
  **usernameField**: The field in the TailorDB type used as the username. This field must have a unique constraint (`.unique()`) since it is used to uniquely identify users.
109
109
 
110
- **attributes**: Specifies which fields from the TailorDB type are used as user attributes. Set to `true` to enable a field. Enabled attributes must be assigned values in all machine user definitions. Only fields with ValueOperand types (string, boolean, string[], boolean[]) can be used as attributes. The `id` field and datetime/date/time types are excluded.
110
+ **attributes**: Specifies which fields from the TailorDB type are used as user attributes. Set to `true` to enable a field. Machine user definitions must assign values to attributes derived from required fields; attributes derived from optional fields may be omitted (see [Machine Users](#machine-users)). Only fields with ValueOperand types (string, boolean, string[], boolean[]) can be used as attributes. The `id` field and datetime/date/time types are excluded.
111
111
 
112
112
  ## Attribute List
113
113
 
@@ -200,7 +200,7 @@ machineUsers: {
200
200
  },
201
201
  ```
202
202
 
203
- **attributes**: Values for attributes enabled in `userProfile.attributes` (or all fields defined in `machineUserAttributes` when `userProfile` is omitted). All enabled fields must be set here. These values are accessible via `user.attributes`:
203
+ **attributes**: Values for attributes enabled in `userProfile.attributes` (or fields defined in `machineUserAttributes` when `userProfile` is omitted). Attribute keys mirror the field's optionality: attributes derived from required fields must be set, while attributes derived from optional fields may be omitted. Setting an attribute to `null` or `undefined` is equivalent to omitting it — the attribute is deployed as unset. These values are accessible via `user.attributes`:
204
204
 
205
205
  ```typescript
206
206
  // In a resolver
@@ -672,6 +672,8 @@ Configure Permission and GQLPermission. For details, see the [TailorDB Permissio
672
672
 
673
673
  **Important**: Following the secure-by-default principle, all operations are denied if permissions are not configured. You must explicitly grant permissions for each operation (create, read, update, delete).
674
674
 
675
+ `generate`/`deploy` reject a type that has no `.permission()`, or no `.gqlPermission()` while GraphQL operations are enabled for it (see [GraphQL Operations](#graphql-operations) above). Disable GraphQL exposure entirely with `.features({ gqlOperations: { create: false, update: false, delete: false, read: false } })` if a type only needs record-level permission.
676
+
675
677
  ```typescript
676
678
  db.type("User", {
677
679
  name: db.string(),
@@ -401,7 +401,7 @@ An exact-key policy applies to dispatches whose runtime key equals the policy ke
401
401
 
402
402
  ### Referencing a Policy from a Workflow
403
403
 
404
- Pass the runtime key through the `executionPolicyKey` option on `job.trigger()` or `tailor.workflow.triggerJobFunction()`. For exact-key policies, use `<policy>.key` directly — it's typed so only a value that came from a declared policy can be passed. For wildcard policies (`matchType: "prefix"`), there is no `<policy>.key` — call `<policy>.keyFor(suffix)` to build the concrete key. `keyFor` joins the prefix and suffix with `.` by default; override it with `separator` — the second argument to `defineWorkflowExecutionPolicies` (applies to every policy in the group), or a `def` field on a single `defineWorkflowExecutionPolicy`.
404
+ Pass the runtime key through the `executionPolicyKey` option on `job.trigger()` or `tailor.workflow.startJobFunction()` (or its frozen alias `triggerJobFunction`). For exact-key policies, use `<policy>.key` directly — it's typed so only a value that came from a declared policy can be passed. For wildcard policies (`matchType: "prefix"`), there is no `<policy>.key` — call `<policy>.keyFor(suffix)` to build the concrete key. `keyFor` joins the prefix and suffix with `.` by default; override it with `separator` — the second argument to `defineWorkflowExecutionPolicies` (applies to every policy in the group), or a `def` field on a single `defineWorkflowExecutionPolicy`.
405
405
 
406
406
  ```typescript
407
407
  import { createWorkflowJob } from "@tailor-platform/sdk";
@@ -427,7 +427,7 @@ export const mainJob = createWorkflowJob({
427
427
  });
428
428
  ```
429
429
 
430
- The same `executionPolicyKey` option is available on `tailor.workflow.triggerJobFunction(name, args, options)` for jobs invoked by name.
430
+ The same `executionPolicyKey` option is available on `tailor.workflow.startJobFunction(name, args, options)` (or the frozen alias `tailor.workflow.triggerJobFunction`) for jobs invoked by name.
431
431
 
432
432
  ## Triggering a Workflow from a Resolver
433
433
 
package/docs/testing.md CHANGED
@@ -598,7 +598,7 @@ describe("resolveApproval resolver", () => {
598
598
 
599
599
  #### Resolvers that resume failed workflows
600
600
 
601
- Resolvers or executors that call `workflow.resumeWorkflow(executionId)` delegate to `tailor.workflow.resumeWorkflow` at runtime. With the `tailor-runtime` environment active, use `mockWorkflow().setResumeHandler` to control the returned execution ID and inspect `resumeWorkflow.mock.calls`:
601
+ Resolvers or executors that call `workflow.resumeWorkflowExecution(executionId)` delegate to `tailor.workflow.resumeWorkflowExecution` at runtime. With the `tailor-runtime` environment active, use `mockWorkflow().setResumeHandler` to control the returned execution ID and inspect `resumeWorkflowExecution.mock.calls`:
602
602
 
603
603
  ```typescript
604
604
  import { unauthenticatedTailorUser } from "@tailor-platform/sdk/test";
@@ -618,7 +618,7 @@ describe("retryFailedWorkflow resolver", () => {
618
618
  });
619
619
 
620
620
  expect(result).toEqual({ resumedExecutionId: "exec-resumed-123" });
621
- expect(wf.resumeWorkflow.mock.calls).toEqual([["exec-failed-456"]]);
621
+ expect(wf.resumeWorkflowExecution.mock.calls).toEqual([["exec-failed-456"]]);
622
622
  });
623
623
  });
624
624
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk",
3
- "version": "1.78.0",
3
+ "version": "1.80.0",
4
4
  "description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -159,7 +159,7 @@
159
159
  "@opentelemetry/resources": "2.9.0",
160
160
  "@opentelemetry/sdk-trace-node": "2.9.0",
161
161
  "@opentelemetry/semantic-conventions": "1.43.0",
162
- "@oxc-project/types": "0.139.0",
162
+ "@oxc-project/types": "0.140.0",
163
163
  "@standard-schema/spec": "1.1.0",
164
164
  "@tailor-platform/function-kysely-tailordb": "0.1.3",
165
165
  "@toiroakr/lines-db": "0.10.1",
@@ -171,10 +171,11 @@
171
171
  "date-fns": "4.4.0",
172
172
  "es-toolkit": "1.49.0",
173
173
  "find-up-simple": "1.0.1",
174
+ "get-tsconfig": "4.14.0",
174
175
  "globals": "17.7.0",
175
176
  "graphql": "17.0.2",
176
177
  "inflection": "3.0.2",
177
- "kysely": "0.29.3",
178
+ "kysely": "0.29.4",
178
179
  "madge": "8.0.0",
179
180
  "mime-types": "3.0.2",
180
181
  "open": "11.0.0",
@@ -190,7 +191,7 @@
190
191
  "std-env": "4.2.0",
191
192
  "table": "6.9.0",
192
193
  "ts-cron-validator": "1.1.5",
193
- "tsx": "4.23.0",
194
+ "tsx": "4.23.1",
194
195
  "type-fest": "5.8.0",
195
196
  "undici": "8.7.0",
196
197
  "xdg-basedir": "5.1.0",
@@ -206,9 +207,9 @@
206
207
  "@vitest/coverage-v8": "4.1.10",
207
208
  "oxfmt": "0.58.0",
208
209
  "oxlint": "1.73.0",
209
- "oxlint-tsgolint": "0.24.0",
210
+ "oxlint-tsgolint": "0.25.0",
210
211
  "sonda": "0.14.0",
211
- "tsdown": "0.22.5",
212
+ "tsdown": "0.22.7",
212
213
  "typescript": "6.0.3",
213
214
  "vitest": "4.1.10",
214
215
  "zinfer": "0.2.5",