@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.
- package/dist/codegen/softr-env.js +2 -2
- package/dist/default-error-overlay.d.ts +1 -1
- package/dist/default-error-overlay.js +2 -2
- package/dist/package.js +1 -1
- package/package.json +1 -1
- package/skills/softr-sdk/record-queries/SKILL.md +1 -1
- package/skills/softr-sdk/record-queries/references/field-types.md +5 -1
|
@@ -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
package/package.json
CHANGED
|
@@ -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.
|