@lotics/app-sdk 0.120.2 → 0.121.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
@@ -20,7 +20,7 @@ This file is the index. The **exact type** of anything is its shipped declaratio
20
20
  | [docs/workflows.md](./docs/workflows.md) | **The workflow-BODY reference** — the JS subset a body may use, opaque `fld_*`/`opt_*` keys, every step form, the accepted sugar, helpers, record-write surfaces, the traps and the verify loop. |
21
21
  | [docs/recipes.md](./docs/recipes.md) | Task-shaped how-tos — returning a generated file, returning structured data, parameterized lookups, composable optional filters, cell decoding, testing an AI action without spending credits. |
22
22
  | [docs/files.md](./docs/files.md) | Files end to end — `useFileUpload` and its `fidelity` and a photo's `place`, `renameFile` (a new file over the same bytes), `useAttachments`/`useAttachmentPiles`, `readFiles` and presigned URLs (a bearer credential — never logged or persisted), workflow-generated files, naming a zip's entries, the delivery bounds. |
23
- | [docs/members_and_options.md](./docs/members_and_options.md) | People, select options and comments — `useMembers`, `useFieldOptions`, `useViewer`, `useWorkspaceTimezone`/`useWorkspaceCurrency`, `useAppContext`, the workspace's zone at the root, `useComments`, a record's activity (`useRecordActivity`). |
23
+ | [docs/members_and_options.md](./docs/members_and_options.md) | People, select options and comments — `useMembers`, `useFieldOptions`, `useViewer`, `useWorkspaceTimezone`/`useWorkspaceCurrency`, `useAppContext`, the workspace's zone at the root, `useComments`, a record's activity and the undo of one change (`useRecordActivity`, `undoRecordChange`). |
24
24
  | [docs/navigation_and_state.md](./docs/navigation_and_state.md) | `AppRouter` (embedded/standalone URL model, the screens and `drawers` it reports to the host), `useUrlState` + `urlParam` codecs, `useRecents`, `useFolderPick`. |
25
25
  | [docs/ai.md](./docs/ai.md) | `useAgentRun` (structured vs free-text, streaming parts, the agent's ask-back), `askAi`, `useAiContext`, and what the member's own chat agent can do with the app while it is open. |
26
26
  | [docs/security.md](./docs/security.md) | **Read before shipping** — the owner-principal model, `is_current_member` scoping, write attribution, group gates, public-app bounds, why a per-input bound is a tenancy floor rather than an authorization check. |
@@ -1,4 +1,4 @@
1
- import type { ActivityEntry } from "./shared_types.js";
1
+ import type { ActivityEntry, ActivityUndoResult } from "./shared_types.js";
2
2
  export interface RecordActivityState {
3
3
  /** Newest first. */
4
4
  entries: ActivityEntry[];
@@ -6,7 +6,7 @@ export interface RecordActivityState {
6
6
  next: string | undefined;
7
7
  loading: boolean;
8
8
  error: string | null;
9
- /** A signed-in member; standalone nothing is read and `entries` stays empty. */
9
+ /** A signed-in member of the app's organization; for anyone else nothing is read and `entries` stays empty. */
10
10
  available: boolean;
11
11
  refetch: () => void;
12
12
  }
@@ -25,3 +25,16 @@ export interface RecordActivityOptions {
25
25
  * ```
26
26
  */
27
27
  export declare function useRecordActivity(entity: string, record_id: string, options?: RecordActivityOptions): RecordActivityState;
28
+ /**
29
+ * Put one change entry of the record's activity back, as the viewer's own save: each field the entry changed returns
30
+ * to what it held before it where the record still holds what the entry wrote. The answer names the fields put back
31
+ * (`reverted`) and those left as they stand (`kept`), each with its `reason` — `changed_since`, or `refused` where the
32
+ * table refused the write (a lock, a check) — and arrives once the record's reads are read anew. Refused for an entry
33
+ * whose `undoable` is false: the record's making, an undo, an entry already put back, and a viewer who may not write
34
+ * the record.
35
+ *
36
+ * ```tsx
37
+ * const { reverted, kept } = await undoRecordChange("job", recordId, entry.id);
38
+ * ```
39
+ */
40
+ export declare function undoRecordChange(entity: string, record_id: string, entry_id: string): Promise<ActivityUndoResult>;