@tailor-platform/sdk 2.7.0 → 2.8.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.
@@ -46,10 +46,10 @@ declare function mockFile(options?: MockFileOptions): {
46
46
  calls: FileCall[];
47
47
  clear(): void;
48
48
  reset(): void;
49
- delete: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<void>>;
50
49
  upload: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string, data: string | ArrayBuffer | Uint8Array | number[], options?: FileUploadOptions) => Promise<FileUploadResponse>>;
51
50
  download: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<FileDownloadResponse>>;
52
51
  downloadAsBase64: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<FileDownloadAsBase64Response>>;
52
+ delete: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<void>>;
53
53
  getMetadata: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<FileMetadata>>;
54
54
  downloadStream: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string) => Promise<FileDownloadStreamResponse>>;
55
55
  uploadStream: Mock<(namespace: string, tableName: string, fieldName: string, recordId: string, readableStream: ReadableStream<Uint8Array | ArrayBuffer>, options?: FileUploadStreamOptions) => Promise<FileUploadResponse>>;
@@ -44,6 +44,23 @@ export default createExecutor({
44
44
  });
45
45
  ```
46
46
 
47
+ ### Disabling an Executor
48
+
49
+ Set `disabled: true` to deploy an executor without letting it run. The definition stays deployed, and the platform skips dispatching jobs to it.
50
+
51
+ ```typescript
52
+ export default createExecutor({
53
+ name: "user-welcome-paused",
54
+ disabled: true,
55
+ trigger: recordCreatedTrigger({ type: user }),
56
+ operation: { kind: "function", body: async () => {} },
57
+ });
58
+ ```
59
+
60
+ A disabled executor does not count as a subscriber when `deploy` resolves `publishEvents` on the resource its trigger names. Publishing is not enabled on that resource's behalf, and an explicit `publishEvents: false` on it is not rejected. If the resource was publishing only for this executor, the next `deploy` turns publishing back off — so disabling the last subscriber of a shared table changes that table for every config that reads its events.
61
+
62
+ The trigger is still deployed, so it must still name a resource the deploy declares; a disabled executor whose trigger names nothing fails the deploy exactly as an enabled one does.
63
+
47
64
  ## Trigger Types
48
65
 
49
66
  ### Record Triggers
@@ -330,7 +330,7 @@ defineIdp("my-idp", {
330
330
  });
331
331
  ```
332
332
 
333
- **Auto-configuration:** When `publishEvents` is omitted, `deploy` sets it from the executors taking part in the same run: `true` while one of their `idpUser` triggers targets this IdP, and `false` once none does. Removing the last such trigger turns publishing back off on the next `deploy`. Targeting is per-IdP: an executor specifies which IdP it subscribes to via the trigger's `idp` option (required in multi-IdP projects). Set the value explicitly to override:
333
+ **Auto-configuration:** When `publishEvents` is omitted, `deploy` sets it from the executors taking part in the same run: `true` while one of their `idpUser` triggers targets this IdP, and `false` once none does. Removing the last such trigger turns publishing back off on the next `deploy`, as does disabling the last executor that carries one. Targeting is per-IdP: an executor specifies which IdP it subscribes to via the trigger's `idp` option (required in multi-IdP projects). Set the value explicitly to override:
334
334
 
335
335
  - `publishEvents: true`: always publish events.
336
336
  - `publishEvents: false`: never publish events. `deploy` rejects this with an error if an `idpUser` trigger taking part in the same run targets this IdP — either remove `publishEvents: false` or remove the matching trigger.
@@ -310,7 +310,7 @@ createResolver({
310
310
 
311
311
  **Use cases:**
312
312
 
313
- 1. **Auto-detection (recommended)**: Don't set `publishEvents` - `deploy` enables it while an executor taking part in the same run needs it
313
+ 1. **Auto-detection (recommended)**: Don't set `publishEvents` - `deploy` enables it while an executor taking part in the same run needs it. An executor declared with `disabled: true` never runs, so it does not count
314
314
 
315
315
  ```typescript
316
316
  // publishEvents is automatically enabled because an executor uses this resolver
@@ -519,6 +519,8 @@ db.table("User", {
519
519
  - When `publishEvents: true`, record creation/update/deletion events are published
520
520
  - When not specified, `deploy` sets it from the executors taking part in the same run: `true` while one of them uses this table with `recordCreatedTrigger`, `recordUpdatedTrigger`, or `recordDeletedTrigger`, and `false` once none does. Removing the last such trigger turns publishing back off on the next `deploy`
521
521
  - When explicitly set to `false` while an executor taking part in the same run uses this table, `deploy` fails
522
+ - An executor declared with `disabled: true` never runs, so it does not count as using the table
523
+ - While a `deploy` applies pending migrations, every table in the migrating namespace is read-only: create, update, delete, and bulk-upsert operations are disabled while the existing read setting is preserved. Record event publishing is also switched off so a migration script's writes do not reach executors from the previous deploy. After success, the configured settings take effect. If a later migration fails, settings from the last confirmed checkpoint are restored; an uncommitted migration restores existing tables' prior settings and leaves its newly created tables restricted until a successful retry. Restoration is skipped if the checkpoint number or migration history changed concurrently, or if checkpoint ownership cannot be verified. A table left behind by a failed post-checkpoint deletion also remains read-only for manual recovery
522
524
 
523
525
  **Use cases:**
524
526
 
@@ -563,6 +565,8 @@ db.table("User", {
563
565
 
564
566
  Control which GraphQL operations (`create`, `update`, `delete`, `read`) are exposed for a table. All operations are enabled by default.
565
567
 
568
+ While a `deploy` applies pending migrations, every GraphQL operation — `create`, `update`, `delete`, `read`, and bulk upsert — is switched off across the migrating namespace, so nothing reads or writes an intermediate schema. After success, the configured operations take effect. If a later migration fails, operations from the last confirmed checkpoint are restored; an uncommitted migration restores existing tables' prior operations and leaves its newly created tables restricted until a successful retry. Restoration is skipped if the checkpoint number or migration history changed concurrently.
569
+
566
570
  ```typescript
567
571
  db.table("Order", {
568
572
  status: db.string(),
@@ -208,7 +208,7 @@ export default createWorkflow({
208
208
 
209
209
  Workflows can publish execution lifecycle events for executors. When an executor subscribes to a workflow's events, `deploy` enables publishing automatically. A `workflowExecution*` trigger enables it on the workflow, and a `workflowJobExecution*` trigger enables it on every job that workflow runs. See [Workflow Execution Triggers](./executor.md#workflow-execution-triggers).
210
210
 
211
- Publishing follows the subscription in both directions: removing the last subscribing trigger turns it back off on the next `deploy`.
211
+ Publishing follows the subscription in both directions: removing the last subscribing trigger turns it back off on the next `deploy`, as does disabling the last executor that carries one.
212
212
 
213
213
  Set `publishEvents` explicitly to pin the value instead. Use `true` to publish workflow-level events with no subscribing executor:
214
214
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -164,7 +164,7 @@
164
164
  "@opentelemetry/resources": "2.10.0",
165
165
  "@opentelemetry/sdk-trace-node": "2.10.0",
166
166
  "@opentelemetry/semantic-conventions": "1.43.0",
167
- "@oxc-project/types": "0.146.0",
167
+ "@oxc-project/types": "0.147.0",
168
168
  "@secretlint/core": "13.0.4",
169
169
  "@secretlint/secretlint-rule-preset-recommend": "13.0.4",
170
170
  "@standard-schema/spec": "1.1.0",
@@ -185,7 +185,7 @@
185
185
  "kysely": "0.29.5",
186
186
  "mime-types": "3.0.2",
187
187
  "open": "11.0.1",
188
- "oxc-parser": "0.146.0",
188
+ "oxc-parser": "0.147.0",
189
189
  "p-limit": "7.3.1",
190
190
  "pathe": "2.0.3",
191
191
  "pgsql-ast-parser": "12.0.2",
@@ -202,22 +202,22 @@
202
202
  },
203
203
  "devDependencies": {
204
204
  "@opentelemetry/sdk-trace-base": "2.10.0",
205
+ "@tailor-platform/shared": "^0.0.0",
206
+ "@tailor-platform/tailor-proto": "^0.0.1",
205
207
  "@types/mime-types": "3.0.1",
206
208
  "@types/node": "24.13.3",
207
209
  "@types/semver": "7.8.0",
208
210
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
209
211
  "@vitest/coverage-v8": "4.1.11",
210
- "eslint-plugin-zod": "4.9.1",
211
- "oxfmt": "0.64.0",
212
- "oxlint": "1.79.0",
212
+ "eslint-plugin-zod": "4.10.0",
213
+ "oxfmt": "0.65.0",
214
+ "oxlint": "1.80.0",
213
215
  "oxlint-tsgolint": "7.0.2001",
214
216
  "sonda": "0.14.0",
215
217
  "tsdown": "0.22.14",
216
218
  "typescript": "6.0.3",
217
219
  "vitest": "4.1.11",
218
- "zinfer": "0.2.8",
219
- "@tailor-platform/shared": "^0.0.0",
220
- "@tailor-platform/tailor-proto": "^0.0.1"
220
+ "zinfer": "0.2.8"
221
221
  },
222
222
  "peerDependencies": {
223
223
  "@electric-sql/pglite": ">=0.2.0",