@softr/sdk 0.0.56-alpha.2 → 0.0.56-alpha.3

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-alpha.3";
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-alpha.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
@@ -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.