@tailor-platform/create-sdk 2.0.0-next.1 → 2.0.0-next.10

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 (100) hide show
  1. package/CHANGELOG.md +175 -0
  2. package/package.json +10 -9
  3. package/templates/executor/.oxlintrc.json +9 -1
  4. package/templates/executor/__dot__gitignore +1 -1
  5. package/templates/executor/package.json +11 -9
  6. package/templates/executor/src/db/auditLog.ts +1 -1
  7. package/templates/executor/src/db/notification.ts +1 -1
  8. package/templates/executor/src/db/user.ts +1 -1
  9. package/templates/executor/src/generated/db.ts +3 -3
  10. package/templates/executor/tailor.d.ts +4 -2
  11. package/templates/generators/.oxlintrc.json +9 -1
  12. package/templates/generators/README.md +1 -1
  13. package/templates/generators/__dot__gitignore +1 -1
  14. package/templates/generators/package.json +14 -9
  15. package/templates/generators/src/db/category.ts +1 -1
  16. package/templates/generators/src/db/order.ts +1 -1
  17. package/templates/generators/src/db/product.ts +1 -1
  18. package/templates/generators/src/db/user.ts +1 -1
  19. package/templates/generators/src/generated/db.ts +3 -3
  20. package/templates/generators/src/generated/files.ts +5 -5
  21. package/templates/generators/src/resolver/getProduct.test.ts +31 -27
  22. package/templates/generators/src/seed/data/Order.schema.ts +2 -2
  23. package/templates/generators/src/seed/data/Product.schema.ts +2 -2
  24. package/templates/generators/src/seed/data/User.schema.ts +2 -2
  25. package/templates/generators/tailor.d.ts +4 -2
  26. package/templates/hello-world/.oxlintrc.json +9 -1
  27. package/templates/hello-world/README.md +6 -6
  28. package/templates/hello-world/__dot__gitignore +1 -1
  29. package/templates/hello-world/package.json +10 -8
  30. package/templates/hello-world/src/db/user.ts +1 -1
  31. package/templates/hello-world/src/generated/kysely-tailordb.ts +1 -1
  32. package/templates/hello-world/tailor.d.ts +4 -2
  33. package/templates/inventory-management/.oxlintrc.json +9 -1
  34. package/templates/inventory-management/README.md +8 -8
  35. package/templates/inventory-management/__dot__gitignore +1 -1
  36. package/templates/inventory-management/package.json +10 -8
  37. package/templates/inventory-management/src/db/category.ts +1 -1
  38. package/templates/inventory-management/src/db/contact.ts +1 -1
  39. package/templates/inventory-management/src/db/inventory.ts +2 -2
  40. package/templates/inventory-management/src/db/notification.ts +1 -1
  41. package/templates/inventory-management/src/db/order.ts +1 -1
  42. package/templates/inventory-management/src/db/orderItem.ts +12 -8
  43. package/templates/inventory-management/src/db/product.ts +1 -1
  44. package/templates/inventory-management/src/db/user.ts +1 -1
  45. package/templates/inventory-management/src/executor/checkInventory.ts +0 -1
  46. package/templates/inventory-management/src/generated/kysely-tailordb.ts +9 -9
  47. package/templates/inventory-management/src/resolver/registerOrder.ts +4 -2
  48. package/templates/inventory-management/tailor.d.ts +4 -2
  49. package/templates/multi-application/.oxlintrc.json +9 -1
  50. package/templates/multi-application/README.md +2 -2
  51. package/templates/multi-application/__dot__gitignore +1 -1
  52. package/templates/multi-application/apps/admin/db/adminNote.ts +2 -2
  53. package/templates/multi-application/apps/admin/tailor.config.ts +1 -1
  54. package/templates/multi-application/apps/user/db/user.ts +1 -1
  55. package/templates/multi-application/apps/user/tailor.config.ts +1 -1
  56. package/templates/multi-application/package.json +10 -8
  57. package/templates/resolver/.oxlintrc.json +9 -1
  58. package/templates/resolver/README.md +2 -2
  59. package/templates/resolver/__dot__gitignore +1 -1
  60. package/templates/resolver/package.json +11 -9
  61. package/templates/resolver/src/db/user.ts +1 -1
  62. package/templates/resolver/src/generated/db.ts +1 -1
  63. package/templates/resolver/src/resolver/add.test.ts +4 -3
  64. package/templates/resolver/src/resolver/incrementUserAge.test.ts +6 -5
  65. package/templates/resolver/src/resolver/showEnv.test.ts +2 -2
  66. package/templates/resolver/src/resolver/showUserInfo.test.ts +12 -9
  67. package/templates/resolver/src/resolver/showUserInfo.ts +3 -3
  68. package/templates/resolver/src/resolver/upsertUsers.test.ts +2 -2
  69. package/templates/resolver/tailor.d.ts +4 -2
  70. package/templates/static-web-site/.oxlintrc.json +9 -1
  71. package/templates/static-web-site/__dot__gitignore +1 -1
  72. package/templates/static-web-site/package.json +10 -8
  73. package/templates/static-web-site/src/db/user.ts +1 -1
  74. package/templates/static-web-site/tailor.d.ts +4 -2
  75. package/templates/tailordb/.oxlintrc.json +9 -1
  76. package/templates/tailordb/README.md +1 -1
  77. package/templates/tailordb/__dot__gitignore +1 -1
  78. package/templates/tailordb/package.json +11 -9
  79. package/templates/tailordb/src/db/category.ts +1 -1
  80. package/templates/tailordb/src/db/comment.ts +4 -2
  81. package/templates/tailordb/src/db/task.ts +19 -27
  82. package/templates/tailordb/src/db/user.ts +1 -1
  83. package/templates/tailordb/src/generated/db.ts +3 -3
  84. package/templates/tailordb/tailor.d.ts +4 -2
  85. package/templates/workflow/.oxlintrc.json +9 -1
  86. package/templates/workflow/README.md +2 -2
  87. package/templates/workflow/__dot__gitignore +1 -1
  88. package/templates/workflow/e2e/globalSetup.ts +1 -1
  89. package/templates/workflow/e2e/workflow.test.ts +1 -1
  90. package/templates/workflow/package.json +12 -10
  91. package/templates/workflow/src/db/order.ts +1 -1
  92. package/templates/workflow/src/db/user.ts +1 -1
  93. package/templates/workflow/src/generated/db.ts +2 -2
  94. package/templates/workflow/src/resolver/resolveApproval.test.ts +18 -13
  95. package/templates/workflow/src/workflow/approval.test.ts +16 -11
  96. package/templates/workflow/src/workflow/approval.ts +2 -2
  97. package/templates/workflow/src/workflow/order-fulfillment.test.ts +30 -18
  98. package/templates/workflow/src/workflow/order-fulfillment.ts +3 -3
  99. package/templates/workflow/tailor.d.ts +4 -2
  100. package/templates/generators/src/seed/exec.mjs +0 -485
package/CHANGELOG.md CHANGED
@@ -1,11 +1,186 @@
1
1
  # @tailor-platform/create-sdk
2
2
 
3
+ ## 2.0.0-next.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1837](https://github.com/tailor-platform/sdk/pull/1837) [`b74966b`](https://github.com/tailor-platform/sdk/commit/b74966bcefa499df1cbb5ef7e36ca76442658579) Thanks [@toiroakr](https://github.com/toiroakr)! - Update politty to v0.11.3
8
+
9
+ ## 2.0.0-next.9
10
+
11
+ ## 1.83.0
12
+
13
+ ## 1.82.0
14
+
15
+ ## 1.81.0
16
+
17
+ ## 1.80.1
18
+
19
+ ## 1.80.0
20
+
21
+ ### Minor Changes
22
+
23
+ - [#1737](https://github.com/tailor-platform/sdk/pull/1737) [`e349b9e`](https://github.com/tailor-platform/sdk/commit/e349b9e3d9c61f324f21dea92dd08055493a2c6d) Thanks [@dqn](https://github.com/dqn)! - Add lint rules that flag the external /api prefix in HTTP adapter path patterns and permission settings that grant access unconditionally, and enable them in newly scaffolded projects.
24
+
25
+ ## 1.79.0
26
+
27
+ ## 2.0.0-next.8
28
+
29
+ ## 2.0.0-next.7
30
+
31
+ ### Major Changes
32
+
33
+ - [#1782](https://github.com/tailor-platform/sdk/pull/1782) [`c971797`](https://github.com/tailor-platform/sdk/commit/c971797c9bfa035a43771c46f2b1c3bd93f989a9) Thanks [@toiroakr](https://github.com/toiroakr)! - Rename `Workflow.trigger()` (returned by `createWorkflow()`) and `WorkflowJob.trigger()` (returned by `createWorkflowJob()`) to `.start()`, aligning the SDK's ergonomic verb with the platform's `start*` RPC vocabulary:
34
+
35
+ ```diff
36
+ const inventory = checkInventory.trigger({ orderId: input.orderId });
37
+ +const inventory = checkInventory.start({ orderId: input.orderId });
38
+
39
+ -const workflowRunId = await orderProcessingWorkflow.trigger(args, { invoker: "manager" });
40
+ +const workflowRunId = await orderProcessingWorkflow.start(args, { invoker: "manager" });
41
+ ```
42
+
43
+ `mockWorkflow()`'s `wf.job(definition)` / `wf.workflow(definition)` now return a mock of the `.start` method, and `wf.setTriggerHandler` / `wf.triggeredJobs` are renamed to `wf.setStartHandler` / `wf.startedJobs`. No codemod ships for the `.trigger()` → `.start()` call-site rename itself — see the `v2/workflow-start-rename` migration guide entry for manual migration steps.
44
+
45
+ ### Minor Changes
46
+
47
+ - [#1737](https://github.com/tailor-platform/sdk/pull/1737) [`e349b9e`](https://github.com/tailor-platform/sdk/commit/e349b9e3d9c61f324f21dea92dd08055493a2c6d) Thanks [@dqn](https://github.com/dqn)! - Add lint rules that flag the external /api prefix in HTTP adapter path patterns and permission settings that grant access unconditionally, and enable them in newly scaffolded projects.
48
+
49
+ ## 2.0.0-next.6
50
+
51
+ ## 2.0.0-next.5
52
+
53
+ ### Patch Changes
54
+
55
+ - [#1753](https://github.com/tailor-platform/sdk/pull/1753) [`6bff945`](https://github.com/tailor-platform/sdk/commit/6bff94505f3dbe11a8be36ef301e3641ee2cba89) Thanks [@dqn](https://github.com/dqn)! - Add typed, service-specific Vitest mock controls for runtime APIs and update generated project tests to use them.
56
+
57
+ ## 2.0.0-next.4
58
+
59
+ ### Major Changes
60
+
61
+ - [#1693](https://github.com/tailor-platform/sdk/pull/1693) [`4751214`](https://github.com/tailor-platform/sdk/commit/4751214c0923e094a844f9ce322279a47e871075) Thanks [@dqn](https://github.com/dqn)! - Rename the TailorDB schema builder from `db.type()` to `db.table()`.
62
+
63
+ Update TailorDB definitions:
64
+
65
+ ```diff
66
+ import { db } from "@tailor-platform/sdk";
67
+
68
+ -export const user = db.type("User", {
69
+ +export const user = db.table("User", {
70
+ name: db.string(),
71
+ });
72
+ ```
73
+
74
+ ### Patch Changes
75
+
76
+ - [#1704](https://github.com/tailor-platform/sdk/pull/1704) [`9c81d9c`](https://github.com/tailor-platform/sdk/commit/9c81d9c18b1d29b3e9307ea17fe54c8ce55f4dda) Thanks [@dqn](https://github.com/dqn)! - Remove flat value and default exports from `@tailor-platform/sdk/runtime/*` subpath modules. Import each subpath through its self-named namespace export instead, for example `import { iconv } from "@tailor-platform/sdk/runtime/iconv"`.
77
+
78
+ The aggregate `@tailor-platform/sdk/runtime` entry remains named-only, and its deprecated `file.deleteFile` alias is removed in favor of `file.delete`. The v2 codemod rewrites straightforward namespace-star subpath imports, flat named value imports, and aggregate `file.deleteFile` calls to the new namespace-object style.
79
+
80
+ `TailorContextAPI` and `TailorWorkflowAPI` now describe the SDK wrapper objects. Code that types the platform-provided `globalThis.tailor.context` or `globalThis.tailor.workflow` objects directly must use `PlatformContextAPI` or `PlatformWorkflowAPI` instead.
81
+
82
+ ## 2.0.0-next.3
83
+
84
+ ### Major Changes
85
+
86
+ - [#1684](https://github.com/tailor-platform/sdk/pull/1684) [`de3ef5e`](https://github.com/tailor-platform/sdk/commit/de3ef5e7421a998624154df5e90da62e17664524) Thanks [@dqn](https://github.com/dqn)! - Restore Tailor field outputs for UUID, date, datetime, time, and decimal fields to plain string-compatible types and remove the strict scalar string migration guidance.
87
+
88
+ - [#1556](https://github.com/tailor-platform/sdk/pull/1556) [`645949e`](https://github.com/tailor-platform/sdk/commit/645949ed64bda8b82fc44c0db54928698b12a2eb) Thanks [@toiroakr](https://github.com/toiroakr)! - Rename `defineWaitPoint` and `defineWaitPoints` to `createWaitPoint` and `createWaitPoints`.
89
+
90
+ These functions create runtime instances with `.wait()` and `.resolve()` methods that call the platform API at runtime, so the `create*` prefix is more accurate. Update any usages:
91
+
92
+ ```diff
93
+ -import { defineWaitPoint, defineWaitPoints } from "@tailor-platform/sdk";
94
+ +import { createWaitPoint, createWaitPoints } from "@tailor-platform/sdk";
95
+
96
+ -export const approval = defineWaitPoint<Payload, Result>("approval");
97
+ +export const approval = createWaitPoint<Payload, Result>("approval");
98
+
99
+ -export const waitPoints = defineWaitPoints((define) => ({ ... }));
100
+ +export const waitPoints = createWaitPoints((define) => ({ ... }));
101
+ ```
102
+
103
+ ### Patch Changes
104
+
105
+ - [#1559](https://github.com/tailor-platform/sdk/pull/1559) [`ff8ef1c`](https://github.com/tailor-platform/sdk/commit/ff8ef1c1323daf81812c182e146fd53da20e676e) Thanks [@dqn](https://github.com/dqn)! - Rename auth attribute module augmentation from `AttributeMap` to `Attributes`.
106
+
107
+ - [#1563](https://github.com/tailor-platform/sdk/pull/1563) [`501e8bf`](https://github.com/tailor-platform/sdk/commit/501e8bfdd2bca7201a1c9b036bf72087476da416) Thanks [@dqn](https://github.com/dqn)! - Standardize SDK-owned environment variables on the `TAILOR_*` namespace.
108
+
109
+ Replace the removed SDK-specific environment variables with their new names: `TAILOR_CONFIG_PATH`, `TAILOR_DTS_PATH`, `TAILOR_CI_ALLOW_ID_INJECTION`, `TAILOR_DEPLOY_BUILD_ONLY`, `TAILOR_BUILD_OUTPUT_DIR`, `TAILOR_SKILLS_SOURCE`, `TAILOR_TEMPLATE_SDK_VERSION`, `TAILOR_PLATFORM_URL`, `TAILOR_PLATFORM_OAUTH2_CLIENT_ID`, `TAILOR_INLINE_SOURCEMAP`, `TAILOR_QUERY_NEWLINE_ON_ENTER`, and `TAILOR_APP_LOG_LEVEL`. The deprecated `TAILOR_TOKEN` fallback is removed; use `TAILOR_PLATFORM_TOKEN`. The v2 codemod rewrites unambiguous removed SDK environment variable names and flags generic names such as `LOG_LEVEL` and `PLATFORM_URL` for manual review.
110
+
111
+ ## 2.0.0-next.2
112
+ ### Major Changes
113
+
114
+
115
+
116
+ - [#1498](https://github.com/tailor-platform/sdk/pull/1498) [`83145db`](https://github.com/tailor-platform/sdk/commit/83145db9a0d243aa68c1b641c2b6026771a62188) Thanks [@dqn](https://github.com/dqn)! - Set `db.fields.timestamps()` `updatedAt` when records are created and make the generated field non-null. `createdAt` keeps its existing create-time behavior, while `updatedAt` keeps its update-time behavior and now also gets a create hook that preserves provided values and falls back to the current time.
117
+
118
+ Update create-sdk templates so scaffolded projects use the new non-null `updatedAt` Kysely types and seed schemas.
119
+
120
+ Existing TailorDB schemas that already use this helper will change `updatedAt` from optional to required. Backfill existing records that have `updatedAt: null` before applying the schema change.
121
+
122
+ ### Patch Changes
123
+
124
+
125
+
126
+ - [#1509](https://github.com/tailor-platform/sdk/pull/1509) [`7cadaa7`](https://github.com/tailor-platform/sdk/commit/7cadaa7c4987b81130ca80ba80bc5d5b26276394) Thanks [@dqn](https://github.com/dqn)! - Rename resolver, executor, workflow trigger, and typed workflow start machine-user options from `authInvoker` to `invoker`.
127
+
128
+ Update create-sdk templates and the v2 auth invoker codemod to generate the new `invoker` option.
129
+
130
+
131
+ - [#1484](https://github.com/tailor-platform/sdk/pull/1484) [`a376dc8`](https://github.com/tailor-platform/sdk/commit/a376dc8cd053d20744c90104e8b44ed2729ffe8c) Thanks [@dqn](https://github.com/dqn)! - Remove the deprecated `openDownloadStream` file streaming API. Use `downloadStream` for streamed file downloads.
132
+
133
+ The generated file utilities now emit `downloadFileStream`, which calls `downloadStream` and returns `FileDownloadStreamResponse`, instead of the removed `openFileDownloadStream` helper.
134
+
3
135
  ## 2.0.0-next.1
4
136
 
5
137
  ## 2.0.0-next.0
6
138
 
7
139
  ## 1.66.0
8
140
 
141
+ ## 1.71.0
142
+
143
+ ## 1.75.0
144
+
145
+ ## 1.74.1
146
+
147
+ ## 1.74.0
148
+
149
+ ## 1.73.3
150
+
151
+ ## 1.73.2
152
+
153
+ ## 1.73.1
154
+
155
+ ## 1.73.0
156
+
157
+ ## 1.72.0
158
+
159
+ ## 1.70.1
160
+ ### Patch Changes
161
+
162
+
163
+
164
+ - [#1569](https://github.com/tailor-platform/sdk/pull/1569) [`259dec9`](https://github.com/tailor-platform/sdk/commit/259dec92592c7927bcfb0e2d5dcbbd0e206eeba3) Thanks [@dqn](https://github.com/dqn)! - Fix TailorDB migration drift checks to normalize reconstructed snapshots and remote schemas through the same snapshot shape before comparison.
165
+
166
+ ## 1.70.0
167
+
168
+ ## 1.69.0
169
+ ### Patch Changes
170
+
171
+
172
+
173
+ - [#1533](https://github.com/tailor-platform/sdk/pull/1533) [`e3bc2ce`](https://github.com/tailor-platform/sdk/commit/e3bc2ce65ab30ee53e5de0eb48ca6c24049fcd1b) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency politty to v0.9.2
174
+
175
+ ## 1.68.0
176
+
177
+ ## 1.67.1
178
+
179
+ ## 1.67.0
180
+
181
+ ## 1.66.1
182
+
183
+ ## 1.66.0
9
184
  ## 1.65.0
10
185
 
11
186
  ## 1.64.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/create-sdk",
3
- "version": "2.0.0-next.1",
3
+ "version": "2.0.0-next.10",
4
4
  "description": "A CLI tool to quickly create a new Tailor Platform SDK project",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -17,19 +17,20 @@
17
17
  ],
18
18
  "type": "module",
19
19
  "dependencies": {
20
- "@clack/prompts": "1.5.1",
21
- "execa": "9.6.1",
20
+ "@clack/prompts": "1.7.0",
21
+ "execa": "10.0.0",
22
22
  "picocolors": "1.1.1",
23
23
  "pkg-types": "2.3.1",
24
- "politty": "0.6.0",
24
+ "politty": "0.11.3",
25
25
  "zod": "4.4.3"
26
26
  },
27
27
  "devDependencies": {
28
- "@types/node": "24.13.2",
29
- "oxlint": "1.69.0",
30
- "oxlint-tsgolint": "0.23.0",
31
- "tsdown": "0.22.2",
32
- "typescript": "5.9.3"
28
+ "@types/node": "24.13.3",
29
+ "eslint-plugin-zod": "4.7.0",
30
+ "oxlint": "1.74.0",
31
+ "oxlint-tsgolint": "0.25.0",
32
+ "tsdown": "0.22.12",
33
+ "typescript": "6.0.3"
33
34
  },
34
35
  "scripts": {
35
36
  "build": "tsdown",
@@ -1,14 +1,22 @@
1
1
  {
2
2
  "$schema": "./node_modules/oxlint/configuration_schema.json",
3
3
  "plugins": ["typescript"],
4
+ "jsPlugins": [
5
+ {
6
+ "name": "tailor-sdk",
7
+ "specifier": "@tailor-platform/eslint-plugin-sdk"
8
+ }
9
+ ],
4
10
  "categories": {
5
11
  "correctness": "error"
6
12
  },
7
13
  "env": {
8
14
  "builtin": true
9
15
  },
10
- "ignorePatterns": [".tailor-sdk/", "src/generated/", "tailor.d.ts"],
16
+ "ignorePatterns": [".tailor/", "src/generated/", "tailor.d.ts"],
11
17
  "rules": {
18
+ "tailor-sdk/no-api-prefix-in-path-pattern": "warn",
19
+ "tailor-sdk/no-unconditional-permit": "warn",
12
20
  "no-case-declarations": "error",
13
21
  "no-empty": "error",
14
22
  "no-fallthrough": "error",
@@ -1,2 +1,2 @@
1
1
  node_modules/
2
- .tailor-sdk/
2
+ .tailor/
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "executor",
3
+ "version": "0.0.0",
3
4
  "private": true,
4
5
  "type": "module",
5
6
  "scripts": {
6
- "generate": "tailor-sdk generate",
7
- "deploy": "tailor-sdk deploy",
7
+ "generate": "tailor generate",
8
+ "deploy": "tailor deploy",
8
9
  "test": "vitest --project unit",
9
10
  "test:unit": "vitest --project unit",
10
11
  "format": "oxfmt --write .",
@@ -14,12 +15,13 @@
14
15
  "typecheck": "tsc --noEmit"
15
16
  },
16
17
  "devDependencies": {
17
- "@tailor-platform/sdk": "2.0.0-next.1",
18
- "@types/node": "24.13.2",
19
- "oxfmt": "0.54.0",
20
- "oxlint": "1.69.0",
21
- "oxlint-tsgolint": "0.23.0",
22
- "typescript": "5.9.3",
23
- "vitest": "4.1.8"
18
+ "@tailor-platform/eslint-plugin-sdk": "0.2.0-next.0",
19
+ "@tailor-platform/sdk": "2.0.0-next.10",
20
+ "@types/node": "24.13.3",
21
+ "oxfmt": "0.59.0",
22
+ "oxlint": "1.74.0",
23
+ "oxlint-tsgolint": "0.25.0",
24
+ "typescript": "6.0.3",
25
+ "vitest": "4.1.10"
24
26
  }
25
27
  }
@@ -1,7 +1,7 @@
1
1
  import { db } from "@tailor-platform/sdk";
2
2
 
3
3
  export const auditLog = db
4
- .type("AuditLog", "Records system events for auditing", {
4
+ .table("AuditLog", "Records system events for auditing", {
5
5
  action: db.string(),
6
6
  entityType: db.string(),
7
7
  entityId: db.uuid(),
@@ -2,7 +2,7 @@ import { db } from "@tailor-platform/sdk";
2
2
  import { user } from "./user";
3
3
 
4
4
  export const notification = db
5
- .type("Notification", {
5
+ .table("Notification", {
6
6
  userId: db.uuid().relation({
7
7
  type: "n-1",
8
8
  toward: { type: user },
@@ -1,7 +1,7 @@
1
1
  import { db } from "@tailor-platform/sdk";
2
2
 
3
3
  export const user = db
4
- .type("User", {
4
+ .table("User", {
5
5
  name: db.string(),
6
6
  email: db.string().unique(),
7
7
  role: db.enum(["ADMIN", "MEMBER"]),
@@ -20,7 +20,7 @@ export interface Namespace {
20
20
  entityId: string;
21
21
  message: string;
22
22
  createdAt: Generated<Timestamp>;
23
- updatedAt: Timestamp | null;
23
+ updatedAt: Generated<Timestamp>;
24
24
  }
25
25
 
26
26
  Notification: {
@@ -30,7 +30,7 @@ export interface Namespace {
30
30
  body: string;
31
31
  isRead: boolean;
32
32
  createdAt: Generated<Timestamp>;
33
- updatedAt: Timestamp | null;
33
+ updatedAt: Generated<Timestamp>;
34
34
  }
35
35
 
36
36
  User: {
@@ -39,7 +39,7 @@ export interface Namespace {
39
39
  email: string;
40
40
  role: "ADMIN" | "MEMBER";
41
41
  createdAt: Generated<Timestamp>;
42
- updatedAt: Timestamp | null;
42
+ updatedAt: Generated<Timestamp>;
43
43
  }
44
44
  }
45
45
  }
@@ -1,9 +1,9 @@
1
1
  // This file is auto-generated by @tailor-platform/sdk
2
2
  // Do not edit this file manually
3
- // Regenerated automatically when running 'tailor-sdk deploy' or 'tailor-sdk generate'
3
+ // Regenerated automatically when running 'tailor deploy' or 'tailor generate'
4
4
 
5
5
  declare module "@tailor-platform/sdk" {
6
- interface AttributeMap {
6
+ interface Attributes {
7
7
  role: string;
8
8
  }
9
9
  interface AttributeList {
@@ -16,6 +16,8 @@ declare module "@tailor-platform/sdk" {
16
16
  interface IdpNameRegistry {
17
17
  "main-idp": true;
18
18
  }
19
+ interface ConnectionNameRegistry {}
20
+ interface AIGatewayNameRegistry {}
19
21
  }
20
22
 
21
23
  export {};
@@ -1,14 +1,22 @@
1
1
  {
2
2
  "$schema": "./node_modules/oxlint/configuration_schema.json",
3
3
  "plugins": ["typescript"],
4
+ "jsPlugins": [
5
+ {
6
+ "name": "tailor-sdk",
7
+ "specifier": "@tailor-platform/eslint-plugin-sdk"
8
+ }
9
+ ],
4
10
  "categories": {
5
11
  "correctness": "error"
6
12
  },
7
13
  "env": {
8
14
  "builtin": true
9
15
  },
10
- "ignorePatterns": [".tailor-sdk/", "src/generated/", "src/seed/", "tailor.d.ts"],
16
+ "ignorePatterns": [".tailor/", "src/generated/", "src/seed/", "tailor.d.ts"],
11
17
  "rules": {
18
+ "tailor-sdk/no-api-prefix-in-path-pattern": "warn",
19
+ "tailor-sdk/no-unconditional-permit": "warn",
12
20
  "no-case-declarations": "error",
13
21
  "no-empty": "error",
14
22
  "no-fallthrough": "error",
@@ -7,7 +7,7 @@ Demonstrates all built-in generator plugins for the Tailor Platform SDK.
7
7
  - **kyselyTypePlugin** - Generates Kysely type definitions for type-safe database queries
8
8
  - **enumConstantsPlugin** - Generates enum constant objects from `db.enum()` fields
9
9
  - **fileUtilsPlugin** - Generates file upload/download utility functions
10
- - **seedPlugin** - Generates seed data templates and execution script
10
+ - **seedPlugin** - Generates seed data templates and schemas (run them with the `tailor seed` commands from `@tailor-platform/sdk-plugin-seed`)
11
11
 
12
12
  ## Generated Files
13
13
 
@@ -1,2 +1,2 @@
1
1
  node_modules/
2
- .tailor-sdk/
2
+ .tailor/
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "generators",
3
+ "version": "0.0.0",
3
4
  "private": true,
4
5
  "type": "module",
5
6
  "scripts": {
6
- "generate": "tailor-sdk generate",
7
- "deploy": "tailor-sdk deploy",
7
+ "generate": "tailor generate",
8
+ "deploy": "tailor deploy",
9
+ "seed": "tailor seed apply",
10
+ "seed:validate": "tailor seed validate",
8
11
  "test": "vitest --project unit",
9
12
  "test:unit": "vitest --project unit",
10
13
  "format": "oxfmt --write .",
@@ -14,12 +17,14 @@
14
17
  "typecheck": "tsc --noEmit"
15
18
  },
16
19
  "devDependencies": {
17
- "@tailor-platform/sdk": "2.0.0-next.1",
18
- "@types/node": "24.13.2",
19
- "oxfmt": "0.54.0",
20
- "oxlint": "1.69.0",
21
- "oxlint-tsgolint": "0.23.0",
22
- "typescript": "5.9.3",
23
- "vitest": "4.1.8"
20
+ "@tailor-platform/eslint-plugin-sdk": "0.2.0-next.0",
21
+ "@tailor-platform/sdk": "2.0.0-next.10",
22
+ "@tailor-platform/sdk-plugin-seed": "0.1.0-next.2",
23
+ "@types/node": "24.13.3",
24
+ "oxfmt": "0.59.0",
25
+ "oxlint": "1.74.0",
26
+ "oxlint-tsgolint": "0.25.0",
27
+ "typescript": "6.0.3",
28
+ "vitest": "4.1.10"
24
29
  }
25
30
  }
@@ -1,7 +1,7 @@
1
1
  import { db } from "@tailor-platform/sdk";
2
2
 
3
3
  export const category = db
4
- .type("Category", {
4
+ .table("Category", {
5
5
  name: db.string(),
6
6
  slug: db.string().unique(),
7
7
  parentCategoryId: db.uuid({ optional: true }).relation({
@@ -3,7 +3,7 @@ import { product } from "./product";
3
3
  import { user } from "./user";
4
4
 
5
5
  export const order = db
6
- .type("Order", {
6
+ .table("Order", {
7
7
  productId: db.uuid().relation({
8
8
  type: "n-1",
9
9
  toward: { type: product },
@@ -2,7 +2,7 @@ import { db } from "@tailor-platform/sdk";
2
2
  import { category } from "./category";
3
3
 
4
4
  export const product = db
5
- .type("Product", {
5
+ .table("Product", {
6
6
  name: db.string(),
7
7
  description: db.string({ optional: true }),
8
8
  price: db.float(),
@@ -1,7 +1,7 @@
1
1
  import { db } from "@tailor-platform/sdk";
2
2
 
3
3
  export const user = db
4
- .type("User", {
4
+ .table("User", {
5
5
  name: db.string(),
6
6
  email: db.string().unique(),
7
7
  role: db.enum([
@@ -28,7 +28,7 @@ export interface Namespace {
28
28
  totalPrice: number;
29
29
  status: "PENDING" | "CONFIRMED" | "SHIPPED" | "DELIVERED" | "CANCELLED";
30
30
  createdAt: Generated<Timestamp>;
31
- updatedAt: Timestamp | null;
31
+ updatedAt: Generated<Timestamp>;
32
32
  }
33
33
 
34
34
  Product: {
@@ -39,7 +39,7 @@ export interface Namespace {
39
39
  status: "DRAFT" | "ACTIVE" | "DISCONTINUED";
40
40
  categoryId: string | null;
41
41
  createdAt: Generated<Timestamp>;
42
- updatedAt: Timestamp | null;
42
+ updatedAt: Generated<Timestamp>;
43
43
  }
44
44
 
45
45
  User: {
@@ -48,7 +48,7 @@ export interface Namespace {
48
48
  email: string;
49
49
  role: "ADMIN" | "MEMBER" | "VIEWER";
50
50
  createdAt: Generated<Timestamp>;
51
- updatedAt: Timestamp | null;
51
+ updatedAt: Generated<Timestamp>;
52
52
  }
53
53
  }
54
54
  }
@@ -1,9 +1,9 @@
1
- import * as file from "@tailor-platform/sdk/runtime/file";
1
+ import { file } from "@tailor-platform/sdk/runtime/file";
2
2
  import type {
3
3
  FileUploadOptions,
4
4
  FileUploadResponse,
5
5
  FileMetadata,
6
- FileStreamIterator,
6
+ FileDownloadStreamResponse,
7
7
  } from "@tailor-platform/sdk/runtime/file";
8
8
 
9
9
  export interface TypeWithFiles {
@@ -50,10 +50,10 @@ export async function getFileMetadata<T extends keyof TypeWithFiles>(
50
50
  return await file.getMetadata(namespaces[type], type, field, recordId);
51
51
  }
52
52
 
53
- export async function openFileDownloadStream<T extends keyof TypeWithFiles>(
53
+ export async function downloadFileStream<T extends keyof TypeWithFiles>(
54
54
  type: T,
55
55
  field: TypeWithFiles[T]["fields"],
56
56
  recordId: string,
57
- ): Promise<FileStreamIterator> {
58
- return await file.openDownloadStream(namespaces[type], type, field, recordId);
57
+ ): Promise<FileDownloadStreamResponse> {
58
+ return await file.downloadStream(namespaces[type], type, field, recordId);
59
59
  }
@@ -1,4 +1,3 @@
1
- import { unauthenticatedTailorUser } from "@tailor-platform/sdk/test";
2
1
  import { mockTailordb } from "@tailor-platform/sdk/vitest";
3
2
  import { describe, expect, test } from "vitest";
4
3
  import resolver from "./getProduct";
@@ -6,23 +5,26 @@ import resolver from "./getProduct";
6
5
  describe("getProduct resolver", () => {
7
6
  test("returns product with category", async () => {
8
7
  using db = mockTailordb();
9
- // Select product
10
- db.enqueueResult({
11
- id: "product-1",
12
- name: "Widget",
13
- price: 9.99,
14
- status: "ACTIVE",
15
- categoryId: "cat-1",
16
- description: null,
17
- createdAt: new Date(),
18
- updatedAt: null,
19
- });
20
- // Select category
21
- db.enqueueResult({ name: "Gadgets" });
8
+ db.enqueueRows(
9
+ [
10
+ {
11
+ id: "product-1",
12
+ name: "Widget",
13
+ price: 9.99,
14
+ status: "ACTIVE",
15
+ categoryId: "cat-1",
16
+ description: null,
17
+ createdAt: new Date(),
18
+ updatedAt: null,
19
+ },
20
+ ],
21
+ [{ name: "Gadgets" }],
22
+ );
22
23
 
23
24
  const result = await resolver.body({
24
25
  input: { productId: "product-1" },
25
- user: unauthenticatedTailorUser,
26
+ caller: null,
27
+ invoker: null,
26
28
  env: {},
27
29
  });
28
30
 
@@ -37,21 +39,23 @@ describe("getProduct resolver", () => {
37
39
 
38
40
  test("returns product without category", async () => {
39
41
  using db = mockTailordb();
40
- // Select product (no categoryId)
41
- db.enqueueResult({
42
- id: "product-2",
43
- name: "Standalone Item",
44
- price: 19.99,
45
- status: "DRAFT",
46
- categoryId: null,
47
- description: null,
48
- createdAt: new Date(),
49
- updatedAt: null,
50
- });
42
+ db.enqueueRows([
43
+ {
44
+ id: "product-2",
45
+ name: "Standalone Item",
46
+ price: 19.99,
47
+ status: "DRAFT",
48
+ categoryId: null,
49
+ description: null,
50
+ createdAt: new Date(),
51
+ updatedAt: null,
52
+ },
53
+ ]);
51
54
 
52
55
  const result = await resolver.body({
53
56
  input: { productId: "product-2" },
54
- user: unauthenticatedTailorUser,
57
+ caller: null,
58
+ invoker: null,
55
59
  env: {},
56
60
  });
57
61
 
@@ -4,8 +4,8 @@ import { createTailorDBHook, createStandardSchema } from "@tailor-platform/sdk/t
4
4
  import { order } from "../../db/order";
5
5
 
6
6
  const schemaType = t.object({
7
- ...order.pickFields(["id","createdAt"], { optional: true }),
8
- ...order.omitFields(["id","createdAt"]),
7
+ ...order.pickFields(["id"], { optional: true }),
8
+ ...order.omitFields(["id"]),
9
9
  });
10
10
 
11
11
  const hook = createTailorDBHook(order);
@@ -4,8 +4,8 @@ import { createTailorDBHook, createStandardSchema } from "@tailor-platform/sdk/t
4
4
  import { product } from "../../db/product";
5
5
 
6
6
  const schemaType = t.object({
7
- ...product.pickFields(["id","createdAt"], { optional: true }),
8
- ...product.omitFields(["id","createdAt"]),
7
+ ...product.pickFields(["id"], { optional: true }),
8
+ ...product.omitFields(["id"]),
9
9
  });
10
10
 
11
11
  const hook = createTailorDBHook(product);