@softr/sdk 0.0.56-alpha.2 → 0.0.56

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.
@@ -77,8 +77,8 @@ type LinkedRecordInput = { id: string };
77
77
 
78
78
  type WorkspaceUser = {
79
79
  id: string;
80
- name: string;
81
- email: EmailAddress;
80
+ name: string | null;
81
+ email: EmailAddress | null;
82
82
  avatarUrl: string | null;
83
83
  };
84
84
 
@@ -2,7 +2,7 @@ import * as react1 from "react";
2
2
 
3
3
  //#region src/default-error-overlay.d.ts
4
4
  type Props = {
5
- error: Error;
5
+ error: unknown;
6
6
  reset?: () => void;
7
7
  };
8
8
  declare function DefaultErrorOverlay({
@@ -88,9 +88,9 @@ function DevView({ error, reset }) {
88
88
  ] }),
89
89
  /* @__PURE__ */ jsx("pre", {
90
90
  style: s.message,
91
- children: error.message
91
+ children: error instanceof Error ? error.message : String(error)
92
92
  }),
93
- error.stack && /* @__PURE__ */ jsx(StackTrace, { stack: error.stack }),
93
+ error instanceof Error && error.stack && /* @__PURE__ */ jsx(StackTrace, { stack: error.stack }),
94
94
  /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(RetryButton, { onClick: reset }) })
95
95
  ]
96
96
  })
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.0.56-alpha.2";
2
+ var version = "0.0.56";
3
3
 
4
4
  //#endregion
5
5
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softr/sdk",
3
- "version": "0.0.56-alpha.2",
3
+ "version": "0.0.56",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
@@ -11,7 +11,7 @@ description: >-
11
11
  metadata:
12
12
  type: core
13
13
  library: softr-sdk
14
- library_version: 0.0.55
14
+ library_version: 0.0.56
15
15
  ---
16
16
 
17
17
  # Softr SDK core
@@ -16,7 +16,7 @@ description: >-
16
16
  metadata:
17
17
  type: sub-skill
18
18
  library: softr-sdk
19
- library_version: 0.0.55
19
+ library_version: 0.0.56
20
20
  ---
21
21
 
22
22
  **Boundary.** `auth` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build.
@@ -12,7 +12,7 @@ description: >-
12
12
  metadata:
13
13
  type: sub-skill
14
14
  library: softr-sdk
15
- library_version: 0.0.55
15
+ library_version: 0.0.56
16
16
  ---
17
17
 
18
18
  **Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler or a server-side route hook — importing it into a component fails the build. `defineQuery` and every type come from `@softr/sdk` and can be imported anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.55
12
+ library_version: 0.0.56
13
13
  ---
14
14
 
15
15
  # The current user
@@ -10,7 +10,7 @@ description: >-
10
10
  metadata:
11
11
  type: sub-skill
12
12
  library: softr-sdk
13
- library_version: 0.0.55
13
+ library_version: 0.0.56
14
14
  ---
15
15
 
16
16
  **Boundary.** `upload` lives on `@softr/sdk/server` and runs inside server functions. `useFileUpload` and `FileItem` live on `@softr/sdk` and run in components. `FileAttachment` comes from `@softr/sdk` and can be imported anywhere.
@@ -10,7 +10,7 @@ description: >-
10
10
  metadata:
11
11
  type: sub-skill
12
12
  library: softr-sdk
13
- library_version: 0.0.55
13
+ library_version: 0.0.56
14
14
  ---
15
15
 
16
16
  **Boundary.** `integration` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineIntegration` and every type come from `@softr/sdk` and can be imported anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.55
12
+ library_version: 0.0.56
13
13
  ---
14
14
 
15
15
  **Boundary.** `softrMcpMiddleware` lives on `@softr/sdk` and is registered once, in `src/start.ts`. The actions you hand it are the same `defineQuery` / `defineMutation` values the app's own pages use — declared wherever they already live, not duplicated for MCP.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.55
12
+ library_version: 0.0.56
13
13
  ---
14
14
 
15
15
  # Installing the app
@@ -11,7 +11,7 @@ description: >-
11
11
  metadata:
12
12
  type: sub-skill
13
13
  library: softr-sdk
14
- library_version: 0.0.55
14
+ library_version: 0.0.56
15
15
  ---
16
16
 
17
17
  **Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineMutation` and every type come from `@softr/sdk` and can be imported anywhere.
@@ -13,7 +13,7 @@ description: >-
13
13
  metadata:
14
14
  type: sub-skill
15
15
  library: softr-sdk
16
- library_version: 0.0.55
16
+ library_version: 0.0.56
17
17
  ---
18
18
 
19
19
  **Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler or a server-side route hook — importing it into a component fails the build. The same holds for any helper that calls `ds`: declare it inside the handler. A function at module level that calls `ds` keeps the server-only import in the browser bundle, and every page stops loading until it moves. `defineQuery` and every type come from `@softr/sdk` and can be imported anywhere.
@@ -183,7 +183,7 @@ A read the datasource turns down throws rather than coming back empty, and it th
183
183
 
184
184
  ## Typing
185
185
 
186
- Queries you write are type safe and a type error is shown when there's a mistake. For an in depth reference on what fields every datasource has, read `docs/datasources/README.md` first — it lists every registered datasource with a link to its file. Follow those links to get field ids, types, and constraints. Do not guess filenames from table names.
186
+ Queries you write are type safe and a type error is shown when there's a mistake. The records a read returns are typed the same way, so never validate them again with a zod schema of your own. A schema guesses each field's shape, and one value it misses, such as a person with no email, throws for the whole read and the page stops loading. Show each field with a fallback instead: `record.fields.owner?.name ?? '—'`. For an in depth reference on what fields every datasource has, read `docs/datasources/README.md` first — it lists every registered datasource with a link to its file. Follow those links to get field ids, types, and constraints. Do not guess filenames from table names.
187
187
 
188
188
  ## References
189
189
 
@@ -27,7 +27,7 @@ CHECKBOX: boolean
27
27
  SELECT: { id: string; label: string | null } // generated with literal id and label unions
28
28
  LINKED_RECORD: { id: string; label: string | null } // label is the linked record's primary field
29
29
  DATE_RANGE: { from: string; to: string }
30
- USER: { id: string; name: string; email: string; avatarUrl: string | null }
30
+ USER: { id: string; name: string | null; email: string | null; avatarUrl: string | null }
31
31
  ATTACHMENT: {
32
32
  id: string | null
33
33
  filename: string | null
@@ -56,6 +56,10 @@ Every scalar above is `| null` on the record unless the field allows multiple en
56
56
  <td>{record.fields.status}</td>
57
57
  ```
58
58
 
59
+ **CREATED_BY and UPDATED_BY** are the person's name as a plain string, not a `USER` object.
60
+
61
+ **USER** can lack a name or an email: show `owner?.name ?? owner?.email ?? '—'`, never assume either is there.
62
+
59
63
  **DURATION** is milliseconds, whatever format the field displays in: `3600000` is one hour.
60
64
 
61
65
  **DATETIME at date precision** is generated as a `DATE` field and holds `'2026-03-14'`, not a timestamp.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.55
12
+ library_version: 0.0.56
13
13
  ---
14
14
 
15
15
  **Boundary.** `Audience` and `defineVisibility` come from `@softr/sdk` and work anywhere.
@@ -13,7 +13,7 @@ description: >-
13
13
  metadata:
14
14
  type: sub-skill
15
15
  library: softr-sdk
16
- library_version: 0.0.55
16
+ library_version: 0.0.56
17
17
  ---
18
18
 
19
19
  **Boundary.** `defineVisibility`, the access functions and the error predicates come from `@softr/sdk` and work anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.55
12
+ library_version: 0.0.56
13
13
  ---
14
14
 
15
15
  **Boundary.** `workflow` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineWorkflow` and every type come from `@softr/sdk` and can be imported anywhere.