@lotics/app-sdk 0.133.45 → 0.133.48

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/queries.d.ts CHANGED
@@ -58,6 +58,15 @@ export interface QueryOptions<C extends string = string> {
58
58
  };
59
59
  /** `false` reads no rows: a total alone. Default `true`. */
60
60
  rows?: boolean;
61
+ /** The columns each row is read with, beside its address (`__source_record_id`, …): a screen drawing a few columns of a
62
+ * wide query names them, and `[]` reads which rows the set holds alone. Part of the read's key. Absent, every column. */
63
+ fields?: readonly C[];
64
+ /**
65
+ * `"changed"`: a realtime push re-reads only the rows it changed, where the server states the rows can be answered so
66
+ * (a row keeps its place, a new row lands last), instead of the whole read. Not with `limit`, `page` or `more`. Part of the
67
+ * read's key. Default: the whole read again.
68
+ */
69
+ refresh?: "changed";
61
70
  }
62
71
  export interface QueryState<R> {
63
72
  rows: R[];
@@ -130,6 +139,10 @@ export interface QueryCall {
130
139
  total?: boolean;
131
140
  /** `false` reads no rows: a total alone. Default `true`. */
132
141
  rows?: boolean;
142
+ /** The output columns each row holds, beside its address (`__source_record_id`, …); `[]` reads the rows' records alone. Absent, every column. */
143
+ fields?: readonly string[];
144
+ /** `"changed"`: a push re-reads only the rows it changed where the server states they can be answered so ([useQuery](./queries.ts)'s `refresh`). Part of the key. */
145
+ refresh?: "changed";
133
146
  }
134
147
  /**
135
148
  * Several declared queries read together, one state per call in the calls' order — for a surface whose
package/dist/router.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  setUrlParams,
7
7
  settleOpen,
8
8
  subscribeOpen
9
- } from "./chunk-WW2P5AH3.js";
9
+ } from "./chunk-NS3BIL73.js";
10
10
 
11
11
  // src/router.tsx
12
12
  import { useEffect, useLayoutEffect, useRef } from "react";
package/dist/rpc.d.ts CHANGED
@@ -74,6 +74,8 @@ export interface AppContext {
74
74
  /** The member groups the viewer is in, by id — absent from an older host and for a visitor from outside the
75
75
  * organization. */
76
76
  group_ids?: string[];
77
+ /** The viewer administers the app's workspace; absent from an older host, a visitor and a standalone page, read as false. */
78
+ admin?: boolean;
77
79
  /** The app declared `comments`; `useComments` also needs a signed-in member. */
78
80
  comments_enabled: boolean;
79
81
  /** The IANA zone every instant is dated in; absent from an older host, which
@@ -178,7 +180,7 @@ export declare function postHostNotification(message: HostNotification): void;
178
180
  * host owns the realtime socket because the frame holds no credentials; inert
179
181
  * standalone.
180
182
  */
181
- export declare function subscribeQueriesChanged(cb: (aliases: string[]) => void): () => void;
183
+ export declare function subscribeQueriesChanged(cb: (aliases: string[], changes: QueryChanges | undefined) => void): () => void;
182
184
  export declare function registerQueryAlias(alias: string): () => void;
183
185
  /**
184
186
  * Re-read after this app's own write — the realtime push is too slow for it.
@@ -187,8 +189,10 @@ export declare function registerQueryAlias(alias: string): () => void;
187
189
  * tables a workflow touched.
188
190
  */
189
191
  export declare function notifyLocalWrite(reads?: readonly string[]): void;
190
- /** What a host tells the app: the queries named are stale, and every mounted hook of one reads again. */
191
- export declare function queriesChanged(aliases: readonly string[]): void;
192
+ /** Per alias named, each changed table it reads: the ids of the records that changed, or null where unknown. */
193
+ export type QueryChanges = Readonly<Record<string, Readonly<Record<string, readonly string[] | null>>>>;
194
+ /** What a host tells the app: the queries named are stale, and every mounted hook of one reads again. `changes`, when the host names it, says which records. */
195
+ export declare function queriesChanged(aliases: readonly string[], changes?: QueryChanges): void;
192
196
  /**
193
197
  * Keeps the loading cover up until the returned release runs, for a page that has not yet drawn what its requests will
194
198
  * feed. Releasing the last hold starts the two-frame check; releasing again does nothing.