@assembly-js/app-foundation 0.0.18 → 0.0.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assembly-js/app-foundation",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "Versioned foundation helpers and build context for Assembly generated apps",
5
5
  "type": "module",
6
6
  "files": [
@@ -4,7 +4,7 @@
4
4
 
5
5
  - **Display (prefer the helper):** `getAirtableTableSchema` + `formatAirtableRecords` from `@assembly-js/app-foundation/server` return raw + display per field so sorts and writes keep machine values. They format percent / currency / number / date / dateTime / duration from field options, and resolve linked IDs to the linked table's primary field. A missing linked record stays the raw ID. Server-side only — pass the `getIntegration` client.
6
6
  - **Computed-field errors:** formula/lookup/rollup cells can come back as an error-state object (`{state:"error",errorType:"emptyDependency"}`) or a numeric special value (`{specialValue:"NaN"}`) instead of a real value — never render a cell object raw. The helper guards this (`display` becomes `—`, `raw` stays untouched); code that skips the helper must guard for it itself.
7
- - **Display without the helper, or a display-only table:** pass `cellFormat: "string"` on `list-records` to get Airtable's formatted strings. Trade-off: values come back as display strings, so you lose machine-readable raw numbers/IDs for sorting and writes — don't use this when you also edit or sort those cells. Otherwise do the schema path yourself: format percent as `(value * 100)` + `%` (precision from field options); for each `multipleRecordLinks` field, `list-records` on `options.linkedTableId` with `filterByFormula` `OR(RECORD_ID()='rec…',…)` (chunk the OR — one page can collect more IDs than a safe formula length), `fields` set to only the linked table's primary field, and substitute labels. Failures keep the raw ID.
7
+ - **Display without the helper, or a display-only table:** pass `cellFormat: "string"` on `list-records` to get Airtable's formatted strings — with `timeZone` (IANA name) and `userLocale`, which Airtable requires alongside it. Trade-off: values come back as display strings, so you lose machine-readable raw numbers/IDs for sorting and writes — don't use this when you also edit or sort those cells. Otherwise do the schema path yourself: format percent as `(value * 100)` + `%` (precision from field options); for each `multipleRecordLinks` field, `list-records` on `options.linkedTableId` with `filterByFormula` `OR(RECORD_ID()='rec…',…)` (chunk the OR — one page can collect more IDs than a safe formula length), `fields` set to only the linked table's primary field, and substitute labels. Failures keep the raw ID.
8
8
  - **Pagination:** `list-bases` takes `cursor` and returns `nextOffset`. `list-records` takes `offset` and returns `offset`. Passing the wrong key silently drops the next page.
9
9
  - **`fields` is overloaded:** on `list-records` it is an array of field names to return; on `create-record` / `update-record` it is a name-or-id-keyed map of values to write. An array on a write, or a map on a read, is rejected.
10
10
  - Resolve `baseId` with `list-bases` and table/field names with `get-base-schema` before writes. `tableIdOrName` accepts either; schema field ids survive a user renaming the column.