@lotics/app-sdk 0.133.23 → 0.133.24

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/index.d.ts CHANGED
@@ -36,7 +36,7 @@ export type { MockAgent, MockAgentRun } from "./mock_agent_run.js";
36
36
  export type { AppWorkflows, AppWorkflowResults, AppQueries, AppQueryColumns, AppAgents, AppAgentResults } from "./types.js";
37
37
  export { row, readLinks } from "./shared_types.js";
38
38
  export type { ResolvedLink } from "./shared_types.js";
39
- export { readLocked, readLockedBy, readCreatedAt, readUpdatedAt, PENDING } from "./row.js";
39
+ export { readLocked, readLockedBy, readLockedTells, readCreatedAt, readUpdatedAt, PENDING } from "./row.js";
40
40
  export { useNewRecord, newRecordId } from "./new_record.js";
41
41
  export type { NewRecordApi } from "./new_record.js";
42
42
  export { useRecents } from "./use_recents.js";
package/dist/index.js CHANGED
@@ -11839,6 +11839,10 @@ function readLockedBy(rowValue) {
11839
11839
  const by = rowValue["__source_locked_by"];
11840
11840
  return Array.isArray(by) ? by.filter((name) => typeof name === "string") : [];
11841
11841
  }
11842
+ function readLockedTells(rowValue) {
11843
+ if (!rowValue || typeof rowValue !== "object") return false;
11844
+ return rowValue["__source_locked_change"] === "tell";
11845
+ }
11842
11846
  function rowInstant(rowValue, column) {
11843
11847
  if (!rowValue || typeof rowValue !== "object") return null;
11844
11848
  const raw = rowValue[column];
@@ -15711,6 +15715,7 @@ export {
15711
15715
  readLinks,
15712
15716
  readLocked,
15713
15717
  readLockedBy,
15718
+ readLockedTells,
15714
15719
  readMembers,
15715
15720
  readSelect,
15716
15721
  readUpdatedAt,
package/dist/row.d.ts CHANGED
@@ -17,6 +17,11 @@ export declare function readLocked(rowValue: unknown): boolean;
17
17
  * no one — an unlocked row, or a reader from outside the organization.
18
18
  */
19
19
  export declare function readLockedBy(rowValue: unknown): string[];
20
+ /**
21
+ * Whether a change to a locked row, stated with its reason, is written at once (`__source_locked_change`): its table
22
+ * tells the people `readLockedBy` names instead of asking them. False where the change waits for one of them.
23
+ */
24
+ export declare function readLockedTells(rowValue: unknown): boolean;
20
25
  /** `__created_at` of the row's record; null on a grouped row. Pass the whole row. */
21
26
  export declare function readCreatedAt(rowValue: unknown): Date | null;
22
27
  /** `__updated_at`, as {@link readCreatedAt}. */
@@ -415,6 +415,7 @@ the server's answer is the only check — the rule the filter keys follow too.
415
415
  | `readFiles(cell)` | files cell → `AppFile[]` | attached files with presigned URLs (`[]` when empty), a LOOKUP of a files field included |
416
416
  | `readLocked(rowObj)` | the whole **row** → `boolean` | the record's lock state from `__source_locked` |
417
417
  | `readLockedBy(rowObj)` | the whole **row** → `string[]` | who can change a locked record, by name, from `__source_locked_by` (`[]` for an outsider) |
418
+ | `readLockedTells(rowObj)` | the whole **row** → `boolean` | whether a change to the locked record, sent with a reason, is saved at once and those people told, from `__source_locked_change` |
418
419
  | `readCreatedAt(rowObj)` | the whole **row** → `Date \| null` | when the record was created, from `__created_at` |
419
420
  | `readUpdatedAt(rowObj)` | the whole **row** → `Date \| null` | when the record was last updated, from `__updated_at` |
420
421
 
package/docs/mutations.md CHANGED
@@ -440,7 +440,7 @@ Row-level query results carry a `__source_locked` addressing column automaticall
440
440
  project/filter/sort/join but not grouping, where rows stop being records).
441
441
  `readLocked(row)` — pass the **whole row**, not a cell — returns `true` for a locked record,
442
442
  `false` when the flag is absent (`dist/row.d.ts`). Use it to render a locked state and to
443
- switch the save path. `readLockedBy(row)` names who can change it — the people who manage its table (its owner, its
443
+ switch the save path. `readLockedTells(row)` is `true` where the row's table saves a change sent with a reason at once and tells the people who manage it, `false` where the change waits for their approval. `readLockedBy(row)` names who can change it — the people who manage its table (its owner, its
444
444
  managers and its workspace's admins) — for a member of the app's organization; `[]` for anyone else.
445
445
 
446
446
  ### What a write against a locked record does
@@ -466,7 +466,8 @@ lock exists to route changes through review).
466
466
  ### The change-request path: `request_locked_record_change`
467
467
 
468
468
  For a locked record, the save becomes one change request carrying the **diffed** change set
469
- plus a reason. The workflow body calls the `request_locked_record_change` tool:
469
+ plus a reason. Where `readLockedTells(row)` is `true` the same call writes the record at once and
470
+ answers `status: "applied"` with no `request_id`, so word the answer from `req.status`. The workflow body calls the `request_locked_record_change` tool:
470
471
 
471
472
  ```js
472
473
  // alias e.g. "requestOrderChange" — inputs: record_id (record_link), changes (json), reason (text)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/app-sdk",
3
- "version": "0.133.23",
3
+ "version": "0.133.24",
4
4
  "description": "The SDK a Lotics custom-code app reads and writes through — typed hooks over the host bridge, cell readers, mount() and AppRouter",
5
5
  "type": "module",
6
6
  "exports": {