@lotics/app-sdk 0.45.0 → 0.46.0

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/AGENTS.md CHANGED
@@ -133,7 +133,12 @@ Pick by intent. (→ open the `.d.ts` for the exact signature.)
133
133
  - **`readSelect(cell)`** → `ResolvedOption[]` `{ key, label, color? }` (a cell carries key+label; the
134
134
  `color` is populated by `useFieldOptions`, not the cell). **`readMembers(cell)`** → `{ id, name,
135
135
  email? }[]`. **`readLinks(cell)` / `row.link`** → `{ id, display }`. **`readFiles(cell)`** →
136
- `AppFile[]` with presigned `url` + `thumbnail_url` (24 h). **`readLocked(row)`** `boolean` from the
136
+ `AppFile[]` with presigned `url` + `thumbnail_url` (24 h) **+ `size` (bytes) + `created_at` (ISO
137
+ date-added), resolved from the file object at read**. Surface size/date as **dedicated sortable
138
+ `Table` columns over the RAW numeric** — the `tpl_documents` document-register pattern (a `Size`
139
+ column `align:"right"` + an `Added` column, formatted only at display; NOT a crammed `FileRow` `meta`
140
+ string, which sorts wrong — "8.4 MB" < "96 KB"). `size` is absent for older files until backfilled —
141
+ render it only when present. **`readLocked(row)`** → `boolean` from the
137
142
  `__source_locked` addressing column.
138
143
  - **`project` only what you render** and `filter` server-side: a bare `from_table` ships every column
139
144
  — incl. `files` with storage keys — to the client (over-exposure + presign-500 at scale). A code
package/dist/src/row.d.ts CHANGED
@@ -68,6 +68,16 @@ export interface AppFile {
68
68
  url: string;
69
69
  /** Presigned thumbnail URL for images, when the server produced one. */
70
70
  thumbnail_url?: string;
71
+ /** Byte size of the file, resolved from the file object at serving time. Absent
72
+ * for older files not yet backfilled — show a size only when present. Prefer a
73
+ * dedicated sortable `Table` column over the RAW number (the `tpl_documents`
74
+ * register: a right-aligned "Size" column, formatted at display) — not a crammed
75
+ * `FileRow` meta string, which sorts wrong ("8.4 MB" < "96 KB"). */
76
+ size?: number | null;
77
+ /** ISO upload timestamp (date-added), resolved at serving time. Show as a
78
+ * dedicated "Added" `Table` column (format with `formatDate`), sortable over the
79
+ * raw ISO value. */
80
+ created_at?: string;
71
81
  }
72
82
  /**
73
83
  * files field → the attached files with their presigned `url` (empty if none).
package/dist/src/row.js CHANGED
@@ -123,12 +123,16 @@ export function readFiles(v) {
123
123
  const filename = f.filename;
124
124
  const mime = f.mime_type;
125
125
  const thumb = f.thumbnail_url;
126
+ const size = f.size;
127
+ const created_at = f.created_at;
126
128
  out.push({
127
129
  id,
128
130
  filename: typeof filename === "string" ? filename : "",
129
131
  mime_type: typeof mime === "string" ? mime : "",
130
132
  url,
131
133
  thumbnail_url: typeof thumb === "string" ? thumb : undefined,
134
+ size: typeof size === "number" ? size : undefined,
135
+ created_at: typeof created_at === "string" ? created_at : undefined,
132
136
  });
133
137
  }
134
138
  return out;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/app-sdk",
3
- "version": "0.45.0",
3
+ "version": "0.46.0",
4
4
  "description": "Runtime SDK for Lotics custom-code apps — typed hooks, postMessage bridge, mount entry point",
5
5
  "type": "module",
6
6
  "exports": {