@tailor-platform/create-sdk 2.0.0-next.3 → 2.0.0-next.4

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 (39) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/package.json +1 -1
  3. package/templates/executor/package.json +1 -1
  4. package/templates/executor/src/db/auditLog.ts +1 -1
  5. package/templates/executor/src/db/notification.ts +1 -1
  6. package/templates/executor/src/db/user.ts +1 -1
  7. package/templates/generators/package.json +1 -1
  8. package/templates/generators/src/db/category.ts +1 -1
  9. package/templates/generators/src/db/order.ts +1 -1
  10. package/templates/generators/src/db/product.ts +1 -1
  11. package/templates/generators/src/db/user.ts +1 -1
  12. package/templates/generators/src/generated/files.ts +1 -1
  13. package/templates/hello-world/package.json +1 -1
  14. package/templates/hello-world/src/db/user.ts +1 -1
  15. package/templates/inventory-management/package.json +1 -1
  16. package/templates/inventory-management/src/db/category.ts +1 -1
  17. package/templates/inventory-management/src/db/contact.ts +1 -1
  18. package/templates/inventory-management/src/db/inventory.ts +1 -1
  19. package/templates/inventory-management/src/db/notification.ts +1 -1
  20. package/templates/inventory-management/src/db/order.ts +1 -1
  21. package/templates/inventory-management/src/db/orderItem.ts +1 -1
  22. package/templates/inventory-management/src/db/product.ts +1 -1
  23. package/templates/inventory-management/src/db/user.ts +1 -1
  24. package/templates/multi-application/apps/admin/db/adminNote.ts +1 -1
  25. package/templates/multi-application/apps/user/db/user.ts +1 -1
  26. package/templates/multi-application/package.json +1 -1
  27. package/templates/resolver/package.json +1 -1
  28. package/templates/resolver/src/db/user.ts +1 -1
  29. package/templates/static-web-site/package.json +1 -1
  30. package/templates/static-web-site/src/db/user.ts +1 -1
  31. package/templates/tailordb/README.md +1 -1
  32. package/templates/tailordb/package.json +1 -1
  33. package/templates/tailordb/src/db/category.ts +1 -1
  34. package/templates/tailordb/src/db/comment.ts +1 -1
  35. package/templates/tailordb/src/db/task.ts +1 -1
  36. package/templates/tailordb/src/db/user.ts +1 -1
  37. package/templates/workflow/package.json +1 -1
  38. package/templates/workflow/src/db/order.ts +1 -1
  39. package/templates/workflow/src/db/user.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @tailor-platform/create-sdk
2
2
 
3
+ ## 2.0.0-next.4
4
+
5
+ ### Major Changes
6
+
7
+ - [#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()`.
8
+
9
+ Update TailorDB definitions:
10
+
11
+ ```diff
12
+ import { db } from "@tailor-platform/sdk";
13
+
14
+ -export const user = db.type("User", {
15
+ +export const user = db.table("User", {
16
+ name: db.string(),
17
+ });
18
+ ```
19
+
20
+ ### Patch Changes
21
+
22
+ - [#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"`.
23
+
24
+ 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.
25
+
26
+ `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.
27
+
3
28
  ## 2.0.0-next.3
4
29
 
5
30
  ### Major Changes
@@ -61,6 +86,8 @@
61
86
 
62
87
  ## 1.71.0
63
88
 
89
+ ## 1.75.0
90
+
64
91
  ## 1.74.1
65
92
 
66
93
  ## 1.74.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/create-sdk",
3
- "version": "2.0.0-next.3",
3
+ "version": "2.0.0-next.4",
4
4
  "description": "A CLI tool to quickly create a new Tailor Platform SDK project",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -15,7 +15,7 @@
15
15
  "typecheck": "tsc --noEmit"
16
16
  },
17
17
  "devDependencies": {
18
- "@tailor-platform/sdk": "2.0.0-next.3",
18
+ "@tailor-platform/sdk": "2.0.0-next.4",
19
19
  "@types/node": "24.13.2",
20
20
  "oxfmt": "0.57.0",
21
21
  "oxlint": "1.72.0",
@@ -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"]),
@@ -15,7 +15,7 @@
15
15
  "typecheck": "tsc --noEmit"
16
16
  },
17
17
  "devDependencies": {
18
- "@tailor-platform/sdk": "2.0.0-next.3",
18
+ "@tailor-platform/sdk": "2.0.0-next.4",
19
19
  "@types/node": "24.13.2",
20
20
  "oxfmt": "0.57.0",
21
21
  "oxlint": "1.72.0",
@@ -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([
@@ -1,4 +1,4 @@
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,
@@ -13,7 +13,7 @@
13
13
  "typecheck": "tsc --noEmit"
14
14
  },
15
15
  "devDependencies": {
16
- "@tailor-platform/sdk": "2.0.0-next.3",
16
+ "@tailor-platform/sdk": "2.0.0-next.4",
17
17
  "@types/node": "24.13.2",
18
18
  "oxfmt": "0.57.0",
19
19
  "oxlint": "1.72.0",
@@ -5,7 +5,7 @@ import {
5
5
  } from "@tailor-platform/sdk";
6
6
 
7
7
  export const user = db
8
- .type("User", {
8
+ .table("User", {
9
9
  name: db.string().description("Name of the user"),
10
10
  email: db.string().unique().description("Email address of the user"),
11
11
  role: db.enum(["MANAGER", "STAFF"]),
@@ -13,7 +13,7 @@
13
13
  "typecheck": "tsc --noEmit"
14
14
  },
15
15
  "devDependencies": {
16
- "@tailor-platform/sdk": "2.0.0-next.3",
16
+ "@tailor-platform/sdk": "2.0.0-next.4",
17
17
  "@types/node": "24.13.2",
18
18
  "oxfmt": "0.57.0",
19
19
  "oxlint": "1.72.0",
@@ -2,7 +2,7 @@ import { db } from "@tailor-platform/sdk";
2
2
  import { gqlPermissionManager, permissionManager } from "./common/permission";
3
3
 
4
4
  export const category = db
5
- .type("Category", {
5
+ .table("Category", {
6
6
  name: db.string().description("Name of the category").unique(),
7
7
  description: db.string({ optional: true }).description("Description of the category"),
8
8
  ...db.fields.timestamps(),
@@ -2,7 +2,7 @@ import { db } from "@tailor-platform/sdk";
2
2
  import { gqlPermissionManager, permissionManager } from "./common/permission";
3
3
 
4
4
  export const contact = db
5
- .type("Contact", {
5
+ .table("Contact", {
6
6
  name: db.string().description("Name of the contact"),
7
7
  email: db.string().unique().description("Email address of the contact"),
8
8
  phone: db.string({ optional: true }).description("Phone number of the contact"),
@@ -3,7 +3,7 @@ import { gqlPermissionLoggedIn, permissionLoggedIn } from "./common/permission";
3
3
  import { product } from "./product";
4
4
 
5
5
  export const inventory = db
6
- .type("Inventory", {
6
+ .table("Inventory", {
7
7
  productId: db
8
8
  .uuid()
9
9
  .description("ID of the product")
@@ -2,7 +2,7 @@ import { db } from "@tailor-platform/sdk";
2
2
  import { loggedIn, managerRole, permissionManager } from "./common/permission";
3
3
 
4
4
  export const notification = db
5
- .type("Notification", {
5
+ .table("Notification", {
6
6
  message: db.string().description("Notification message"),
7
7
  ...db.fields.timestamps(),
8
8
  })
@@ -3,7 +3,7 @@ import { contact } from "./contact";
3
3
  import { gqlPermissionLoggedIn, permissionLoggedIn } from "./common/permission";
4
4
 
5
5
  export const order = db
6
- .type("Order", {
6
+ .table("Order", {
7
7
  name: db.string().description("Name of the order"),
8
8
  description: db.string({ optional: true }).description("Description of the order"),
9
9
  orderDate: db.datetime().description("Date of the order"),
@@ -4,7 +4,7 @@ import { product } from "./product";
4
4
  import { gqlPermissionLoggedIn, permissionLoggedIn } from "./common/permission";
5
5
 
6
6
  export const orderItem = db
7
- .type("OrderItem", {
7
+ .table("OrderItem", {
8
8
  orderId: db
9
9
  .uuid()
10
10
  .description("ID of the order")
@@ -3,7 +3,7 @@ import { category } from "./category";
3
3
  import { gqlPermissionManager, permissionManager } from "./common/permission";
4
4
 
5
5
  export const product = db
6
- .type("Product", {
6
+ .table("Product", {
7
7
  name: db.string().description("Name of the product"),
8
8
  description: db.string({ optional: true }).description("Description of the product"),
9
9
  categoryId: db
@@ -2,7 +2,7 @@ import { db } from "@tailor-platform/sdk";
2
2
  import { gqlPermissionManager, permissionManager } from "./common/permission";
3
3
 
4
4
  export const user = db
5
- .type("User", {
5
+ .table("User", {
6
6
  name: db.string().description("Name of the user"),
7
7
  email: db.string().unique().description("Email address of the user"),
8
8
  role: db.enum(["MANAGER", "STAFF"]),
@@ -5,7 +5,7 @@ import {
5
5
  } from "@tailor-platform/sdk";
6
6
 
7
7
  export const adminNote = db
8
- .type("AdminNote", {
8
+ .table("AdminNote", {
9
9
  title: db.string(),
10
10
  content: db.string(),
11
11
  authorId: db.uuid().hooks({ create: ({ invoker }) => invoker?.id ?? crypto.randomUUID() }),
@@ -5,7 +5,7 @@ import {
5
5
  } from "@tailor-platform/sdk";
6
6
 
7
7
  export const user = db
8
- .type("User", {
8
+ .table("User", {
9
9
  name: db.string().unique(),
10
10
  role: db.enum(["USER", "ADMIN"]),
11
11
  ...db.fields.timestamps(),
@@ -14,7 +14,7 @@
14
14
  "typecheck": "tsc --noEmit"
15
15
  },
16
16
  "devDependencies": {
17
- "@tailor-platform/sdk": "2.0.0-next.3",
17
+ "@tailor-platform/sdk": "2.0.0-next.4",
18
18
  "@types/node": "24.13.2",
19
19
  "oxfmt": "0.57.0",
20
20
  "oxlint": "1.72.0",
@@ -15,7 +15,7 @@
15
15
  "typecheck": "tsc --noEmit"
16
16
  },
17
17
  "devDependencies": {
18
- "@tailor-platform/sdk": "2.0.0-next.3",
18
+ "@tailor-platform/sdk": "2.0.0-next.4",
19
19
  "@types/node": "24.13.2",
20
20
  "oxfmt": "0.57.0",
21
21
  "oxlint": "1.72.0",
@@ -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
  age: db.int(),
@@ -13,7 +13,7 @@
13
13
  "typecheck": "tsc --noEmit"
14
14
  },
15
15
  "devDependencies": {
16
- "@tailor-platform/sdk": "2.0.0-next.3",
16
+ "@tailor-platform/sdk": "2.0.0-next.4",
17
17
  "@types/node": "24.13.2",
18
18
  "oxfmt": "0.57.0",
19
19
  "oxlint": "1.72.0",
@@ -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"]),
@@ -1,6 +1,6 @@
1
1
  # TailorDB Template
2
2
 
3
- Comprehensive TailorDB type definitions demonstrating all features of `db.type()`.
3
+ Comprehensive TailorDB type definitions demonstrating all features of `db.table()`.
4
4
 
5
5
  ## Features
6
6
 
@@ -15,7 +15,7 @@
15
15
  "typecheck": "tsc --noEmit"
16
16
  },
17
17
  "devDependencies": {
18
- "@tailor-platform/sdk": "2.0.0-next.3",
18
+ "@tailor-platform/sdk": "2.0.0-next.4",
19
19
  "@types/node": "24.13.2",
20
20
  "oxfmt": "0.57.0",
21
21
  "oxlint": "1.72.0",
@@ -2,7 +2,7 @@ import { db } from "@tailor-platform/sdk";
2
2
  import { allPermission, allGqlPermission } from "./permission";
3
3
 
4
4
  export const category = db
5
- .type("Category", "Task category with hierarchical structure", {
5
+ .table("Category", "Task category with hierarchical structure", {
6
6
  name: db.string(),
7
7
  description: db.string({ optional: true }),
8
8
  parentCategoryId: db.uuid({ optional: true }).relation({
@@ -4,7 +4,7 @@ import { task } from "./task";
4
4
  import { user } from "./user";
5
5
 
6
6
  export const comment = db
7
- .type("Comment", "A comment on a task", {
7
+ .table("Comment", "A comment on a task", {
8
8
  body: db.string().validate([({ value }) => value.length >= 1, "Comment must not be empty"]),
9
9
  taskId: db.uuid().relation({
10
10
  type: "n-1",
@@ -4,7 +4,7 @@ import { rolePermission, roleGqlPermission } from "./permission";
4
4
  import { user } from "./user";
5
5
 
6
6
  export const task = db
7
- .type("Task", "A task with comprehensive features", {
7
+ .table("Task", "A task with comprehensive features", {
8
8
  title: db
9
9
  .string()
10
10
  .validate(
@@ -2,7 +2,7 @@ import { db } from "@tailor-platform/sdk";
2
2
  import { allPermission, allGqlPermission } from "./permission";
3
3
 
4
4
  export const user = db
5
- .type("User", {
5
+ .table("User", {
6
6
  name: db.string(),
7
7
  email: db.string().unique(),
8
8
  role: db.enum([
@@ -16,7 +16,7 @@
16
16
  "typecheck": "tsc --noEmit"
17
17
  },
18
18
  "devDependencies": {
19
- "@tailor-platform/sdk": "2.0.0-next.3",
19
+ "@tailor-platform/sdk": "2.0.0-next.4",
20
20
  "@types/node": "24.13.2",
21
21
  "graphql": "17.0.1",
22
22
  "graphql-request": "7.4.0",
@@ -1,7 +1,7 @@
1
1
  import { db } from "@tailor-platform/sdk";
2
2
 
3
3
  export const order = db
4
- .type("Order", {
4
+ .table("Order", {
5
5
  customerName: db.string(),
6
6
  amount: db.int(),
7
7
  status: db.enum(["PENDING", "PROCESSING", "COMPLETED", "FAILED"]),
@@ -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
  age: db.int(),