@jsb188/graphql 1.1.11 → 1.1.13

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.
Files changed (174) hide show
  1. package/LICENSE +21 -0
  2. package/audience.d.ts +205 -0
  3. package/cache/config.ts +65 -28
  4. package/cache/index.helpers.ts +96 -0
  5. package/cache/index.ts +364 -808
  6. package/cache/mounted-queries.ts +33 -0
  7. package/cache/optimistic-ui-runtime.ts +46 -0
  8. package/cache/optimistic-ui.ts +401 -0
  9. package/cache/persist.ts +107 -22
  10. package/cache/realtime-fence.ts +47 -0
  11. package/cache/realtime-live.ts +17 -0
  12. package/cache/store.ts +22 -64
  13. package/cache/value.helpers.ts +17 -0
  14. package/{drafts/store.ts → client/draft-persistence-indexed-db.ts} +19 -3
  15. package/{drafts/index.ts → client/draft-persistence.ts} +13 -39
  16. package/client/index.ts +4 -2
  17. package/client/request.helpers.ts +14 -0
  18. package/client/request.ts +122 -232
  19. package/client/storage-asset.ts +58 -0
  20. package/gql/fragments/accountAuthFragments.ts +0 -4
  21. package/gql/fragments/agentMemoryFragments.ts +5 -1
  22. package/gql/fragments/agentNoteFragments.ts +156 -0
  23. package/gql/fragments/aiChatFragments.ts +35 -11
  24. package/gql/fragments/aiChatLinkFragments.ts +8 -0
  25. package/gql/fragments/audienceFragments.ts +76 -0
  26. package/gql/fragments/dataTableFragments.ts +48 -80
  27. package/gql/fragments/emailFragments.ts +49 -21
  28. package/gql/fragments/emailOutreachFragments.ts +281 -0
  29. package/gql/fragments/fieldDocFragments.ts +222 -40
  30. package/gql/fragments/inboundContactFragments.ts +2 -0
  31. package/gql/fragments/libraryFragments.ts +120 -0
  32. package/gql/fragments/logFragments.ts +93 -2
  33. package/gql/fragments/organizationFragments.ts +12 -0
  34. package/gql/fragments/qrCodeFragments.ts +29 -0
  35. package/gql/fragments/scheduleFragments.ts +574 -145
  36. package/gql/fragments/sheetFragments.ts +86 -424
  37. package/gql/fragments/storageFragments.ts +25 -1
  38. package/gql/fragments/workWaitFragments.ts +13 -0
  39. package/gql/fragments/workflowFragments.ts +32 -4
  40. package/gql/mutations/agentMemoryMutations.ts +32 -0
  41. package/gql/mutations/agentNoteMutations.ts +64 -0
  42. package/gql/mutations/aiChatLinkMutations.ts +13 -0
  43. package/gql/mutations/aiChatMutations.ts +34 -4
  44. package/gql/mutations/audienceMutations.ts +58 -0
  45. package/gql/mutations/authMutations.ts +24 -28
  46. package/gql/mutations/billingMutations.ts +24 -0
  47. package/gql/mutations/contactMutations.ts +23 -0
  48. package/gql/mutations/dataTableMutations.ts +18 -75
  49. package/gql/mutations/emailMutations.ts +22 -0
  50. package/gql/mutations/emailOutreachMutations.ts +139 -0
  51. package/gql/mutations/fieldDocMutations.ts +162 -13
  52. package/gql/mutations/index.ts +10 -5
  53. package/gql/mutations/organizationMutations.ts +6 -0
  54. package/gql/mutations/qrCodeMutations.ts +20 -0
  55. package/gql/mutations/scheduleMutations.ts +389 -417
  56. package/gql/mutations/sheetMutations.ts +62 -118
  57. package/gql/mutations/storageMutations.ts +1 -1
  58. package/gql/mutations/workflowMutations.ts +94 -0
  59. package/gql/queries/agentMemoryQueries.ts +12 -2
  60. package/gql/queries/agentNoteQueries.ts +86 -0
  61. package/gql/queries/aiChatQueries.ts +63 -12
  62. package/gql/queries/audienceQueries.ts +104 -0
  63. package/gql/queries/authQueries.ts +20 -4
  64. package/gql/queries/billingQueries.ts +114 -9
  65. package/gql/queries/dataTableQueries.ts +43 -75
  66. package/gql/queries/emailOutreachQueries.ts +282 -0
  67. package/gql/queries/emailQueries.ts +48 -64
  68. package/gql/queries/emailReplyReportQueries.ts +127 -0
  69. package/gql/queries/fieldDocQueries.ts +128 -98
  70. package/gql/queries/inboundContactQueries.ts +15 -4
  71. package/gql/queries/index.ts +5 -3
  72. package/gql/queries/libraryQueries.ts +112 -0
  73. package/gql/queries/logQueries.ts +86 -12
  74. package/gql/queries/organizationQueries.ts +44 -12
  75. package/gql/queries/qrCodeQueries.ts +27 -0
  76. package/gql/queries/scheduleQueries.ts +401 -278
  77. package/gql/queries/sheetQueries.ts +94 -165
  78. package/gql/queries/storageQueries.ts +11 -4
  79. package/gql/queries/workflowQueries.ts +61 -12
  80. package/gql/reactivity.ts +98 -0
  81. package/gql/recordReads.ts +171 -0
  82. package/hooks/index.helpers.ts +52 -0
  83. package/hooks/index.ts +920 -715
  84. package/hooks/use-agentMemory-mtn.ts +29 -31
  85. package/hooks/use-agentMemory-qry.ts +15 -3
  86. package/hooks/use-agentNote-mtn.ts +89 -0
  87. package/hooks/use-agentNote-qry.ts +162 -0
  88. package/hooks/use-agentNote-recovery.helpers.ts +58 -0
  89. package/hooks/use-agentNote-recovery.ts +57 -0
  90. package/hooks/use-aiChat-mtn.ts +104 -115
  91. package/hooks/use-aiChat-qry.helpers.ts +124 -0
  92. package/hooks/use-aiChat-qry.ts +254 -387
  93. package/hooks/use-aiChat-stream-mtn.ts +14 -0
  94. package/hooks/use-audience-mtn.ts +170 -0
  95. package/hooks/use-audience-qry.helpers.ts +39 -0
  96. package/hooks/use-audience-qry.ts +245 -0
  97. package/hooks/use-auth-mtn.ts +30 -1
  98. package/hooks/use-billing-mtn.ts +31 -0
  99. package/hooks/use-billing-qry.ts +76 -0
  100. package/hooks/use-dataTable-mtn.ts +23 -115
  101. package/hooks/use-dataTable-qry.ts +69 -914
  102. package/hooks/use-email-mtn.ts +26 -0
  103. package/hooks/use-email-qry.helpers.ts +37 -0
  104. package/hooks/use-email-qry.ts +44 -174
  105. package/hooks/use-emailOutreach-mtn.ts +211 -0
  106. package/hooks/use-emailOutreach-qry.helpers.ts +25 -0
  107. package/hooks/use-emailOutreach-qry.ts +367 -0
  108. package/hooks/use-emailOutreachReplyReport-qry.ts +46 -0
  109. package/hooks/use-fieldDoc-mtn.ts +244 -32
  110. package/hooks/use-fieldDoc-qry.helpers.ts +49 -0
  111. package/hooks/use-fieldDoc-qry.ts +134 -102
  112. package/hooks/use-inboundContact-qry.ts +7 -9
  113. package/hooks/use-library-qry.ts +233 -0
  114. package/hooks/use-log-mtn.ts +25 -12
  115. package/hooks/use-log-qry.ts +99 -46
  116. package/hooks/use-organization-qry.ts +16 -60
  117. package/hooks/use-qrCode-mtn.ts +40 -0
  118. package/hooks/use-qrCode-qry.ts +78 -0
  119. package/hooks/use-schedule-mtn.ts +231 -348
  120. package/hooks/use-schedule-qry.ts +208 -139
  121. package/hooks/use-schedule-reactive.ts +218 -0
  122. package/hooks/use-sheet-mtn.ts +91 -199
  123. package/hooks/use-sheet-qry.ts +88 -237
  124. package/hooks/use-storage-qry.ts +84 -61
  125. package/hooks/use-workflow-mtn.ts +84 -23
  126. package/hooks/use-workflow-qry.ts +60 -61
  127. package/libs/ai-chat-link-events.ts +78 -0
  128. package/libs/ai-chat-outgoing.helpers.ts +153 -0
  129. package/libs/ai-chat-outgoing.ts +11 -0
  130. package/libs/ai-chat-outgoing.types.ts +25 -0
  131. package/libs/ai-chat-run-realtime.ts +20 -0
  132. package/libs/ai-chat-submission-realtime.ts +150 -0
  133. package/libs/data-changes.helpers.ts +161 -0
  134. package/libs/data-changes.ts +382 -0
  135. package/libs/fragment-realtime-sequence.ts +55 -0
  136. package/libs/open-sheet.ts +138 -0
  137. package/libs/record-read.ts +327 -0
  138. package/libs/sheet-command-batch.ts +45 -0
  139. package/libs/sheet-realtime-packet.ts +53 -0
  140. package/libs/sheet-view-realtime-router.ts +99 -0
  141. package/loaders/emailPreference.ts +69 -0
  142. package/loaders/rest.ts +12 -0
  143. package/package.json +77 -25
  144. package/schedule.d.ts +1183 -0
  145. package/sse.helpers.ts +19 -0
  146. package/sse.ts +26 -115
  147. package/types.d.ts +48 -25
  148. package/cache/index.test.ts +0 -881
  149. package/client/data-table-realtime-subscriptions.test.ts +0 -740
  150. package/client/data-table-realtime-subscriptions.ts +0 -955
  151. package/client/data-table-realtime.test.ts +0 -792
  152. package/client/data-table-realtime.ts +0 -1218
  153. package/client/fragment-realtime-sequence.ts +0 -52
  154. package/client/open-sheet.ts +0 -137
  155. package/client/request-managed-session.test.ts +0 -574
  156. package/client/request-no-store.test.ts +0 -157
  157. package/client/sse-ticket.test.ts +0 -26
  158. package/deno.lock +0 -170
  159. package/deno.test.json +0 -10
  160. package/gql/fragments/agentDocFragments.ts +0 -46
  161. package/gql/fragments/billingFragments.ts +0 -14
  162. package/gql/fragments/campaignFragments.ts +0 -277
  163. package/gql/mutations/agentDocMutations.ts +0 -177
  164. package/gql/mutations/campaignMutations.ts +0 -215
  165. package/gql/queries/agentDocQueries.ts +0 -120
  166. package/gql/queries/appQueries.ts +0 -14
  167. package/gql/queries/campaignQueries.ts +0 -127
  168. package/hooks/use-agentDoc-mtn.ts +0 -285
  169. package/hooks/use-agentDoc-qry.ts +0 -208
  170. package/hooks/use-app-qry.ts +0 -22
  171. package/hooks/use-campaign-mtn.ts +0 -377
  172. package/hooks/use-campaign-qry.ts +0 -257
  173. package/loaders/campaign.ts +0 -137
  174. package/tsconfig.json +0 -13
@@ -1,996 +1,151 @@
1
- import { makeVariablesKey } from '@jsb188/app/utils/logic.ts';
2
- import {
3
- graphqlRequestNoStore,
4
- useQuery,
5
- useReactiveFragment,
6
- useReactiveFragmentMap,
7
- useUpdateObservers,
8
- } from '@jsb188/graphql/client';
1
+ import { FRAGMENT_NAMES, getFragmentBaseName, makeFragmentKey } from '@jsb188/mday/constants/graphqlReactivity.ts';
9
2
  import { GRID_ITEM_LIST_LIMIT } from '@jsb188/mday/constants/sheet.ts';
10
- import type { DataTablesFilterArgs } from '@jsb188/mday/types/dataTable.d.ts';
3
+ import type { DtSortDirectionEnum } from '@jsb188/mday/types/dt.d.ts';
11
4
  import type { GridItemSortEnum } from '@jsb188/mday/types/sheet.d.ts';
12
- import {
13
- FRAGMENT_NAMES,
14
- getFragmentBaseName,
15
- makeFragmentKey,
16
- } from '@jsb188/mday/constants/graphqlReactivity.ts';
17
- import { useLayoutEffect, useMemo } from 'react';
18
- import {
19
- addFragmentToCache,
20
- loadFragment,
21
- resetQuery,
22
- setDataToCache,
23
- updateFragment,
24
- } from '../cache/index.ts';
25
- import {
26
- type DataTableRealtimeSnapshot,
27
- dataTableRealtimeSequenceGate,
28
- } from '../client/data-table-realtime.ts';
29
- import {
30
- type DataTableRealtimeSubscription,
31
- dataTableRealtimeSubscriptions,
32
- getDataTableRealtimeFragmentValue,
33
- getDataTableRealtimeQuerySubscriptions,
34
- normalizeDataTableRealtimeSubscriptions,
35
- resolveDataTableRealtimeQueryResult,
36
- } from '../client/data-table-realtime-subscriptions.ts';
37
- import {
38
- dataTableChangesQry,
39
- dataTableQry,
40
- dataTableRowsSnapshotQry,
41
- dataTablesQry,
42
- } from '../gql/queries/dataTableQueries.ts';
43
- import type {
44
- PaginationArgs,
45
- UpdateObserversFn,
46
- UseQueryParams,
47
- } from '../types.d.ts';
5
+ import { dataTableQry, dataTableRowsQry, dataTableRunsQry, dataTablesQry } from '../gql/queries/dataTableQueries.ts';
6
+ import type { PaginationArgs, UseQueryParams } from '../types.d.ts';
7
+ import { useQuery, useReactiveFragment, useReactiveFragmentMap } from './index.ts';
48
8
 
49
- /**
50
- * Constants
51
- */
52
-
53
- const SHEET_ROWS_LIMIT = 200;
54
- const DATA_TABLE_CHANGES_LIMIT = 100;
55
- const ACTIVE_DATA_TABLE_SNAPSHOT_PAGES = new Map<
56
- string,
57
- Map<
58
- string,
59
- {
60
- count: number;
61
- variables: ActiveDataTableRowsVariables;
62
- }
63
- >
64
- >();
65
-
66
- type ActiveDataTableRowsVariables = {
67
- cursor?: string | null;
68
- dataTableId: string;
69
- limit: number;
70
- organizationId: string;
71
- };
72
-
73
- export type DataTableRealtimeRecoveryStatus =
74
- | 'CANCELLED'
75
- | 'RECOVERED'
76
- | 'RETRY';
77
-
78
- export type DataTableChangeSeqInput = string | bigint;
79
-
80
- export type DataTableChangesVariables = {
81
- afterSeq: DataTableChangeSeqInput;
82
- dataTableId?: string | null;
83
- limit?: number;
84
- organizationId?: string | null;
9
+ export type DataTablesFilterVariables = {
10
+ search?: string | null;
85
11
  };
86
12
 
87
13
  export type DataTablesVariables = PaginationArgs & {
88
- filter?: DataTablesFilterArgs | null;
14
+ filter?: DataTablesFilterVariables | null;
89
15
  organizationId?: string | null;
90
16
  sort?: GridItemSortEnum | null;
91
17
  };
92
18
 
93
- type DataTableRowsSnapshotResult = DataTableRealtimeSnapshot & {
94
- currentSeq: string;
95
- dataTable: any;
96
- dataTableId: string;
97
- rows: any[];
19
+ export type DataTableRowsVariables = {
20
+ organizationId?: string | null;
21
+ dataTableId?: string | null;
22
+ sort?: { column: string; direction: DtSortDirectionEnum } | null;
23
+ cursor?: string | null;
24
+ limit?: number | null;
98
25
  };
99
26
 
100
- /*
101
- * Normalize one DataTable journal cursor without losing BIGINT precision.
102
- */
103
- function normalizeDataTableChangeSeq(value: DataTableChangeSeqInput) {
104
- if (typeof value === 'string' && !/^\d+$/.test(value.trim())) {
105
- throw new TypeError(
106
- 'DataTable change seq must be a non-negative base-10 integer.',
107
- );
108
- }
109
-
110
- try {
111
- const seq = BigInt(typeof value === 'string' ? value.trim() : value);
112
- if (seq < 0n || seq > 9223372036854775807n) {
113
- throw new TypeError(
114
- 'DataTable change seq must fit in a PostgreSQL BIGINT.',
115
- );
116
- }
117
- return seq.toString();
118
- } catch (error) {
119
- if (error instanceof TypeError) {
120
- throw error;
121
- }
122
- throw new TypeError(
123
- 'DataTable change seq must be a non-negative base-10 integer.',
124
- );
125
- }
126
- }
127
-
128
- /*
129
- * Return one stable registry key for active snapshot page consumers.
130
- */
131
- function getActiveDataTableSnapshotKey(
132
- organizationId: string,
133
- dataTableId: string,
134
- ) {
135
- return `${organizationId}:${dataTableId}`;
136
- }
137
-
138
- /*
139
- * Register complete row-query variables for safe recovery. Duplicate mounts
140
- * share reference counts and one table sequence gate.
141
- */
142
- function registerActiveDataTableSnapshot(
143
- organizationId: string,
144
- dataTableId: string,
145
- realtimeToken: string | null | undefined,
146
- cursor: string | null | undefined,
147
- limit: number,
148
- ) {
149
- const key = getActiveDataTableSnapshotKey(organizationId, dataTableId);
150
- const variables = { cursor, dataTableId, limit, organizationId };
151
- const variablesKey = makeVariablesKey(variables);
152
- const pages =
153
- ACTIVE_DATA_TABLE_SNAPSHOT_PAGES.get(key) ||
154
- new Map<
155
- string,
156
- {
157
- count: number;
158
- variables: ActiveDataTableRowsVariables;
159
- }
160
- >();
161
- const currentPage = pages.get(variablesKey);
162
- pages.set(variablesKey, {
163
- count: (currentPage?.count || 0) + 1,
164
- variables,
165
- });
166
- ACTIVE_DATA_TABLE_SNAPSHOT_PAGES.set(key, pages);
167
- const unregisterGate = dataTableRealtimeSequenceGate.registerTable(
168
- organizationId,
169
- dataTableId,
170
- );
171
- const unregisterRoom = dataTableRealtimeSubscriptions.register(
172
- getDataTableRealtimeQuerySubscriptions(
173
- organizationId,
174
- dataTableId,
175
- realtimeToken,
176
- ),
177
- );
178
-
179
- let active = true;
180
- return () => {
181
- if (!active) {
182
- return;
183
- }
184
- active = false;
185
- const nextCount = (pages.get(variablesKey)?.count || 1) - 1;
186
- if (nextCount > 0) {
187
- pages.set(variablesKey, {
188
- count: nextCount,
189
- variables,
190
- });
191
- } else {
192
- pages.delete(variablesKey);
193
- }
194
- if (!pages.size) {
195
- ACTIVE_DATA_TABLE_SNAPSHOT_PAGES.delete(key);
196
- }
197
- unregisterGate();
198
- unregisterRoom();
199
- };
200
- }
201
-
202
- /*
203
- * Subscribe one mounted feature to a deduped set of DataTable rooms while a
204
- * token-independent gate registration preserves its cursor through rotation.
205
- */
206
- export function useDataTableRealtimeSubscriptions(
207
- subscriptions: DataTableRealtimeSubscription[],
208
- ) {
209
- const normalizedSubscriptions =
210
- normalizeDataTableRealtimeSubscriptions(subscriptions);
211
- const subscriptionsKey = JSON.stringify(normalizedSubscriptions);
212
- const scopesKey = JSON.stringify(
213
- normalizedSubscriptions.map(({ organizationId, dataTableId }) => ({
214
- organizationId,
215
- dataTableId,
216
- })),
217
- );
218
- useLayoutEffect(() => {
219
- return dataTableRealtimeSubscriptions.register(
220
- JSON.parse(subscriptionsKey) as DataTableRealtimeSubscription[],
221
- );
222
- }, [subscriptionsKey]);
223
- useLayoutEffect(() => {
224
- const normalizedScopes = JSON.parse(scopesKey) as Array<{
225
- dataTableId: string;
226
- organizationId: string;
227
- }>;
228
- const unregisterSequenceGates = normalizedScopes.map(
229
- ({ organizationId, dataTableId }) =>
230
- dataTableRealtimeSequenceGate.registerTable(
231
- organizationId,
232
- dataTableId,
233
- ),
234
- );
235
-
236
- return () => {
237
- unregisterSequenceGates.forEach((unregister) => {
238
- unregister();
239
- });
240
- };
241
- }, [scopesKey]);
242
- }
243
-
244
- /*
245
- * Return every mounted rows-query page for one table in stable key order.
246
- */
247
- function getActiveDataTableSnapshotPages(
248
- organizationId: string,
249
- dataTableId: string,
250
- ) {
251
- return [
252
- ...(ACTIVE_DATA_TABLE_SNAPSHOT_PAGES.get(
253
- getActiveDataTableSnapshotKey(organizationId, dataTableId),
254
- )?.values() || []),
255
- ]
256
- .map((entry) => entry.variables)
257
- .sort((left, right) =>
258
- makeVariablesKey(left).localeCompare(makeVariablesKey(right)),
259
- );
260
- }
261
-
262
- /*
263
- * Validate a watermark-bearing snapshot before it can mutate normalized cache.
264
- */
265
- function isApplicableDataTableRowsSnapshot(
266
- snapshot: unknown,
267
- organizationId: string,
268
- dataTableId: string,
269
- ): snapshot is DataTableRowsSnapshotResult {
270
- if (!snapshot || typeof snapshot !== 'object' || Array.isArray(snapshot)) {
271
- return false;
272
- }
273
- const value = snapshot as Partial<DataTableRowsSnapshotResult>;
274
- if (
275
- value.dataTableId !== dataTableId ||
276
- value.dataTable?.id !== dataTableId ||
277
- !Array.isArray(value.rows)
278
- ) {
279
- return false;
280
- }
281
- if (typeof value.currentSeq !== 'string' || !/^\d+$/.test(value.currentSeq)) {
282
- return false;
283
- }
284
-
285
- return dataTableRealtimeSequenceGate.canApplySnapshot(
286
- organizationId,
287
- dataTableId,
288
- value.currentSeq,
289
- );
290
- }
291
-
292
- /*
293
- * Record an accepted snapshot after the GraphQL client has synchronously
294
- * normalized it. Only an initial page is complete enough to move the table
295
- * baseline; cursor pages contribute per-fragment version fences only.
296
- */
297
- function acknowledgeAppliedDataTableRowsSnapshot(
298
- snapshot: DataTableRowsSnapshotResult,
299
- organizationId: string,
300
- dataTableId: string,
301
- cursor?: PaginationArgs['cursor'] | null,
302
- ) {
303
- dataTableRealtimeSequenceGate.recordSnapshotFragments(
304
- organizationId,
305
- dataTableId,
306
- snapshot,
307
- );
308
- if (!cursor) {
309
- dataTableRealtimeSequenceGate.acknowledgeSnapshot(
310
- organizationId,
311
- dataTableId,
312
- snapshot.currentSeq,
313
- );
314
- }
315
- }
316
-
317
- /*
318
- * Return all dataTable cell records nested under the provided dataTable rows.
319
- */
320
-
321
- function getDataTableRowCells(dataTableRows?: any[] | null) {
322
- return dataTableRows?.flatMap((row) => row.cells || []) || null;
323
- }
324
-
325
- /*
326
- * Merge reactive dataTable cell fragments back into their parent dataTable rows.
327
- */
328
-
329
- function mergeReactiveCellsIntoRows(
330
- dataTableRows?: any[] | null,
331
- dataTableCells?: any[] | null,
332
- ) {
333
- if (!dataTableRows || !dataTableCells) {
334
- return dataTableRows;
335
- }
336
-
337
- const cellMap = new Map(dataTableCells.map((cell) => [cell.id, cell]));
338
- let changedRows = false;
339
-
340
- const nextRows = dataTableRows.map((row) => {
341
- let changedCells = false;
342
- const nextCells =
343
- row.cells?.map((cell: any) => {
344
- const nextCell = cellMap.get(cell.id) || cell;
345
- if (nextCell !== cell) {
346
- changedCells = true;
347
- }
348
-
349
- return nextCell;
350
- }) || [];
351
-
352
- if (!changedCells) {
353
- return row;
354
- }
355
-
356
- changedRows = true;
357
-
358
- return {
359
- ...row,
360
- cells: nextCells,
361
- };
362
- });
363
-
364
- return changedRows ? nextRows : dataTableRows;
365
- }
366
-
367
- /*
368
- * Get reactive dataTable rows and their nested cell fragments.
369
- */
370
-
371
- export function useReactiveDataTableRows(dataTableRows?: any[] | null) {
372
- const reactiveRows = useReactiveFragmentMap(
373
- dataTableRows || null,
374
- getFragmentBaseName(FRAGMENT_NAMES.dataTableRow),
375
- );
376
- const reactiveCells = useReactiveFragmentMap(
377
- getDataTableRowCells(reactiveRows || dataTableRows),
378
- getFragmentBaseName(FRAGMENT_NAMES.dataTableCell),
379
- );
380
-
381
- return mergeReactiveCellsIntoRows(
382
- reactiveRows || dataTableRows,
383
- reactiveCells,
384
- );
385
- }
386
-
387
- /*
388
- * Return the query key that belongs to one dataTable rows variables payload.
389
- */
390
-
391
- function getDataTableRowsQueryKey(variables: Record<string, unknown>) {
392
- return `#dataTableRowsSnapshot:${makeVariablesKey(variables)}`;
393
- }
394
-
395
- /*
396
- * Return the exact singular DataTable query key for one owned table.
397
- */
398
- function getDataTableQueryKey(organizationId: string, dataTableId: string) {
399
- return `#dataTable:${makeVariablesKey({ organizationId, dataTableId })}`;
400
- }
401
-
402
- /*
403
- * Invalidate every mounted row page for one table so cursor pages are never
404
- * treated as covered by a smaller first-page recovery snapshot.
405
- */
406
- function invalidateActiveDataTableRowsQueries(
407
- organizationId: string,
408
- dataTableId: string,
409
- updateObservers: UpdateObserversFn,
410
- ) {
411
- getActiveDataTableSnapshotPages(organizationId, dataTableId).forEach(
412
- (variables) => {
413
- resetQuery(
414
- getDataTableRowsQueryKey(variables),
415
- true,
416
- updateObservers,
417
- true,
418
- );
419
- },
420
- );
421
- }
422
-
423
- /*
424
- * Hide a table whose latest authorized room set no longer includes it, clear
425
- * its sequencing baseline, and force every mounted query to re-evaluate.
426
- */
427
- export function invalidateDataTableRealtimeSubscription(
428
- organizationId: string,
429
- dataTableId: string,
430
- updateObservers: UpdateObserversFn,
431
- ) {
432
- const fragmentKey = makeFragmentKey(FRAGMENT_NAMES.dataTable, dataTableId);
433
- const updated = updateFragment(
434
- fragmentKey,
435
- { __deleted: true, active: false },
436
- null,
437
- false,
438
- updateObservers,
439
- );
440
- if (!updated) {
441
- addFragmentToCache(fragmentKey, {
442
- __deleted: true,
443
- active: false,
444
- id: dataTableId,
445
- });
446
- updateObservers({ fragmentIds: [fragmentKey] });
447
- }
448
- resetQuery(
449
- getDataTableQueryKey(organizationId, dataTableId),
450
- true,
451
- updateObservers,
452
- true,
453
- );
454
- invalidateActiveDataTableRowsQueries(
455
- organizationId,
456
- dataTableId,
457
- updateObservers,
458
- );
459
- dataTableRealtimeSequenceGate.clearTable(organizationId, dataTableId);
460
- }
461
-
462
- /*
463
- * Force mounted metadata and row queries to refetch after bounded snapshot
464
- * recovery is exhausted without incorrectly marking the table as revoked.
465
- */
466
- export function refreshDataTableRealtimeSubscription(
467
- organizationId: string,
468
- dataTableId: string,
469
- updateObservers: UpdateObserversFn,
470
- ) {
471
- const fragmentKey = makeFragmentKey(FRAGMENT_NAMES.dataTable, dataTableId);
472
- addFragmentToCache(fragmentKey, null);
473
- updateObservers({ fragmentIds: [fragmentKey] });
474
- resetQuery(
475
- getDataTableQueryKey(organizationId, dataTableId),
476
- true,
477
- updateObservers,
478
- true,
479
- );
480
- invalidateActiveDataTableRowsQueries(
481
- organizationId,
482
- dataTableId,
483
- updateObservers,
484
- );
485
- dataTableRealtimeSequenceGate.clearTable(organizationId, dataTableId);
486
- }
487
-
488
- /*
489
- * Refetch only one mounted DataTable metadata query so it can publish a fresh
490
- * signed realtime capability without disturbing rows or sequence baselines.
491
- */
492
- export function renewDataTableRealtimeCapability(
493
- organizationId: string,
494
- dataTableId: string,
495
- updateObservers: UpdateObserversFn,
496
- ) {
497
- resetQuery(
498
- getDataTableQueryKey(organizationId, dataTableId),
499
- true,
500
- updateObservers,
501
- true,
502
- );
503
- }
504
-
505
- /*
506
- * Add front-end deleted status to deleted or inactive DataTable records.
507
- */
508
-
509
- function mapDataTableDeletedStatus(dataTable: any) {
510
- if (
511
- !dataTable ||
512
- dataTable.__deleted ||
513
- (!dataTable.deletedAt && dataTable.active !== false)
514
- ) {
515
- return dataTable;
516
- }
517
-
518
- return {
519
- ...dataTable,
520
- __deleted: true,
521
- };
522
- }
523
-
524
- /*
525
- * Clear a stale client-only deleted flag from cached DataTable fragments when
526
- * a fresh authoritative result reports the table alive. Server payloads never
527
- * carry __deleted, so fragment merges would otherwise preserve a wrongly
528
- * poisoned flag through every refetch (and its persisted snapshot).
529
- */
530
- function healDataTableDeletedFlags(
531
- dataTables: any[] | null | undefined,
532
- updateObservers: UpdateObserversFn,
533
- ) {
534
- dataTables?.forEach((dataTable) => {
535
- if (!dataTable?.id || dataTable.active === false || dataTable.deletedAt) {
536
- return;
537
- }
538
-
539
- const fragmentKey = makeFragmentKey(FRAGMENT_NAMES.dataTable, dataTable.id);
540
- if (loadFragment(fragmentKey)?.__deleted) {
541
- updateFragment(
542
- fragmentKey,
543
- { __deleted: false },
544
- null,
545
- false,
546
- updateObservers,
547
- );
548
- }
549
- });
550
- }
27
+ export type DataTableRunsVariables = {
28
+ organizationId?: string | null;
29
+ dataTableId?: string | null;
30
+ limit?: number | null;
31
+ };
551
32
 
552
33
  /*
553
34
  * Return whether one useDataTables input is the paginated variables object.
554
35
  */
555
- function isDataTablesVariables(
556
- value: string | null | undefined | DataTablesVariables,
557
- ): value is DataTablesVariables {
36
+ function isDataTablesVariables(value: string | null | undefined | DataTablesVariables): value is DataTablesVariables {
558
37
  return !!value && typeof value === 'object';
559
38
  }
560
39
 
561
40
  /*
562
41
  * Return GraphQL variables for the paginated dataTables query.
563
42
  */
564
- function getDataTablesQueryVariables(
565
- organizationIdOrVariables?: string | null | DataTablesVariables,
566
- active?: boolean | null,
567
- ): DataTablesVariables {
568
- if (isDataTablesVariables(organizationIdOrVariables)) {
569
- return {
570
- ...organizationIdOrVariables,
571
- after: organizationIdOrVariables.after ?? true,
572
- cursor: organizationIdOrVariables.cursor ?? null,
573
- filter: organizationIdOrVariables.filter ?? null,
574
- limit: organizationIdOrVariables.limit ?? GRID_ITEM_LIST_LIMIT,
575
- sort: organizationIdOrVariables.sort || 'UPDATED_AT_DESC',
576
- };
577
- }
578
-
43
+ function getDataTablesQueryVariables(organizationIdOrVariables?: string | null | DataTablesVariables): DataTablesVariables {
44
+ const variables = isDataTablesVariables(organizationIdOrVariables)
45
+ ? organizationIdOrVariables
46
+ : { organizationId: organizationIdOrVariables };
579
47
  return {
580
- organizationId: organizationIdOrVariables,
581
- after: true,
582
- cursor: null,
583
- filter: { active },
584
- limit: GRID_ITEM_LIST_LIMIT,
585
- sort: 'UPDATED_AT_DESC',
48
+ ...variables,
49
+ after: variables.after ?? true,
50
+ cursor: variables.cursor ?? null,
51
+ filter: variables.filter ?? null,
52
+ limit: variables.limit ?? GRID_ITEM_LIST_LIMIT,
53
+ sort: variables.sort || 'UPDATED_AT_DESC',
586
54
  };
587
55
  }
588
56
 
589
57
  /**
590
- * Fetch dataTables for an organization.
58
+ * Fetch the listed data tables of an organization the viewer may read, newest first.
591
59
  */
592
-
593
- export function useDataTables(
594
- organizationId?: string | null | DataTablesVariables,
595
- active?: boolean | null,
596
- params: UseQueryParams = {},
597
- ) {
598
- const variables = getDataTablesQueryVariables(organizationId, active);
599
- const updateObservers = useUpdateObservers();
60
+ export function useDataTables(organizationId?: string | null | DataTablesVariables, params: UseQueryParams = {}) {
61
+ const variables = getDataTablesQueryVariables(organizationId);
600
62
  const { data, ...rest } = useQuery(dataTablesQry, {
601
63
  variables,
602
- skip: !variables.organizationId,
603
64
  ...params,
604
- onCompleted: (result: any, error: any, completedVariables?: any) => {
605
- healDataTableDeletedFlags(result?.dataTables, updateObservers);
606
- params.onCompleted?.(result, error, completedVariables);
607
- },
65
+ skip: !variables.organizationId || !!params.skip,
608
66
  });
609
- const dataTables = useReactiveFragmentMap(
610
- data?.dataTables || null,
611
- getFragmentBaseName(FRAGMENT_NAMES.dataTable),
612
- );
613
- const dataTablesWithDeletedStatus = useMemo(
614
- () => dataTables?.map(mapDataTableDeletedStatus) || dataTables,
615
- [dataTables],
616
- );
67
+ const dataTables = useReactiveFragmentMap(data?.dataTables || null, getFragmentBaseName(FRAGMENT_NAMES.dataTable));
617
68
 
618
69
  return {
619
- dataTables: dataTablesWithDeletedStatus,
70
+ dataTables,
620
71
  ...rest,
621
72
  };
622
73
  }
623
74
 
624
75
  /*
625
- * Fetch one dataTable by id.
76
+ * Fetch one data table (metadata, columns, sync state and owner note).
626
77
  */
627
-
628
- export function useDataTable(
629
- dataTableId?: string | null,
630
- organizationId?: string | null,
631
- params: UseQueryParams = {},
632
- ) {
633
- const cachedDataTable = useReactiveDataTableFragment(dataTableId || '', null);
634
- const updateObservers = useUpdateObservers();
78
+ export function useDataTable(dataTableId?: string | null, organizationId?: string | null, params: UseQueryParams = {}) {
635
79
  const { data, ...rest } = useQuery(dataTableQry, {
636
80
  variables: {
637
81
  organizationId,
638
82
  dataTableId,
639
83
  },
640
84
  ...params,
641
- skip: !organizationId || !dataTableId || Boolean(params.skip),
642
- onCompleted: (result: any, error: any, completedVariables?: any) => {
643
- healDataTableDeletedFlags(
644
- result?.dataTable ? [result.dataTable] : null,
645
- updateObservers,
646
- );
647
- params.onCompleted?.(result, error, completedVariables);
648
- },
85
+ skip: !organizationId || !dataTableId || !!params.skip,
649
86
  });
650
-
651
- // IMPORTANT: Keep `|| data?.dataTable` here -- this prevents an incorrect !dataTable state and `loading` state mismatch
652
- // It's either that or we have to NOT use useMemo() here, both are valid options.
653
- const dataTable =
654
- useMemo(
655
- () => mapDataTableDeletedStatus(data?.dataTable),
656
- [data?.dataTable],
657
- ) || data?.dataTable;
658
- const resolvedDataTable = useMemo(
659
- () => resolveDataTableRealtimeQueryResult(dataTable, cachedDataTable),
660
- [dataTable, cachedDataTable],
661
- );
662
- useDataTableRealtimeSubscriptions(
663
- getDataTableRealtimeQuerySubscriptions(
664
- organizationId,
665
- dataTableId,
666
- resolvedDataTable?.realtimeToken,
667
- Boolean(params.skip),
668
- ),
669
- );
87
+ const dataTable = useReactiveDataTableFragment(dataTableId || '', data?.dataTable || null, rest.updatedCount);
670
88
 
671
89
  return {
672
- dataTable: resolvedDataTable,
90
+ dataTable: dataTable?.id === dataTableId ? dataTable : null,
673
91
  ...rest,
674
92
  };
675
93
  }
676
94
 
677
- /**
678
- * Fetch rows and cells for one dataTable.
95
+ /*
96
+ * Fetch one keyset page of a data table's live rows (100 by default), in id
97
+ * order or sorted by one column. Rows the page holds update in place; other
98
+ * row changes show the declared notice.
679
99
  */
680
-
681
- export function useDataTableRows(
682
- dataTableId?: string | null,
683
- organizationId?: string | null,
684
- cursor?: string | null,
685
- limit: number = SHEET_ROWS_LIMIT,
686
- params: UseQueryParams = {},
687
- realtimeToken?: string | null,
688
- ) {
689
- const skipQuery = !organizationId || !dataTableId || Boolean(params.skip);
690
- const variables = {
691
- dataTableId,
692
- organizationId,
693
- cursor,
694
- limit,
100
+ export function useDataTableRows(variables: DataTableRowsVariables, params: UseQueryParams = {}) {
101
+ const queryVariables = {
102
+ organizationId: variables.organizationId,
103
+ dataTableId: variables.dataTableId,
104
+ sort: variables.sort ?? null,
105
+ cursor: variables.cursor ?? null,
106
+ limit: variables.limit ?? 100,
695
107
  };
696
- useLayoutEffect(() => {
697
- if (skipQuery || !organizationId || !dataTableId) {
698
- return;
699
- }
700
-
701
- return registerActiveDataTableSnapshot(
702
- organizationId,
703
- dataTableId,
704
- realtimeToken,
705
- cursor,
706
- limit,
707
- );
708
- }, [organizationId, dataTableId, realtimeToken, cursor, limit, skipQuery]);
709
-
710
- const { data, ...rest } = useQuery(dataTableRowsSnapshotQry, {
711
- variables,
108
+ const { data, ...rest } = useQuery(dataTableRowsQry, {
109
+ variables: queryVariables,
712
110
  ...params,
713
- skip: skipQuery,
714
- rejectedResultRetryCount: 1,
715
- shouldAcceptResult: (result: any) => {
716
- const snapshot = result?.dataTableRowsSnapshot;
717
- return (
718
- !organizationId ||
719
- !dataTableId ||
720
- isApplicableDataTableRowsSnapshot(snapshot, organizationId, dataTableId)
721
- );
722
- },
723
- onCompleted: (result: any, error: any, completedVariables?: any) => {
724
- const snapshot = result?.dataTableRowsSnapshot;
725
- if (
726
- organizationId &&
727
- dataTableId &&
728
- isApplicableDataTableRowsSnapshot(snapshot, organizationId, dataTableId)
729
- ) {
730
- acknowledgeAppliedDataTableRowsSnapshot(
731
- snapshot,
732
- organizationId,
733
- dataTableId,
734
- completedVariables?.cursor,
735
- );
736
- }
737
- params.onCompleted?.(result, error, completedVariables);
738
- },
111
+ skip: !queryVariables.organizationId || !queryVariables.dataTableId || !!params.skip,
739
112
  });
740
113
 
741
- const queryMatchesVariables =
742
- rest.queryKey === getDataTableRowsQueryKey(variables) ||
743
- rest.variablesKey === makeVariablesKey(variables);
744
- const snapshot = queryMatchesVariables ? data?.dataTableRowsSnapshot : null;
745
- const dataTableRows = useReactiveDataTableRows(snapshot?.rows || null);
746
114
  return {
747
- dataTableRows: queryMatchesVariables ? dataTableRows : undefined,
115
+ dataTableRows: data?.dataTableRows || null,
748
116
  ...rest,
749
117
  };
750
118
  }
751
119
 
752
120
  /*
753
- * Replace the singular metadata query and fragment from one authoritative
754
- * watermark-bearing rows snapshot.
121
+ * Fetch the newest change batches (runs) of a data table.
755
122
  */
756
- function applyDataTableRecoveryMetadata(
757
- snapshot: DataTableRowsSnapshotResult,
758
- organizationId: string,
759
- dataTableId: string,
760
- updateObservers: UpdateObserversFn,
761
- ) {
762
- const dataTable = {
763
- ...snapshot.dataTable,
764
- __deleted:
765
- snapshot.dataTable?.active === false ||
766
- Boolean(snapshot.dataTable?.deletedAt),
767
- };
768
- const variables = { organizationId, dataTableId };
769
- setDataToCache(
770
- { dataTable },
771
- dataTableQry,
772
- variables,
773
- undefined,
774
- updateObservers,
775
- );
776
- addFragmentToCache(
777
- makeFragmentKey(FRAGMENT_NAMES.dataTable, dataTableId),
778
- getDataTableRealtimeFragmentValue(dataTable),
779
- );
780
- updateObservers({
781
- fragmentIds: [makeFragmentKey(FRAGMENT_NAMES.dataTable, dataTableId)],
782
- queryId: getDataTableQueryKey(organizationId, dataTableId),
783
- });
784
- }
785
-
786
- /*
787
- * Fetch and apply one authoritative snapshot after the server confirms room
788
- * membership. First pages are replaced atomically, cursor pages are invalidated
789
- * for refetch, and metadata-only subscriptions still receive a fenced snapshot.
790
- */
791
- export async function recoverDataTableRealtimeSubscription(
792
- organizationId: string,
793
- dataTableId: string,
794
- observedToSeq: string,
795
- updateObservers: UpdateObserversFn,
796
- params: {
797
- authToken?: string | null;
798
- shouldApply?: () => boolean;
799
- } = {},
800
- ): Promise<DataTableRealtimeRecoveryStatus> {
801
- const pages = getActiveDataTableSnapshotPages(organizationId, dataTableId);
802
- const initialPages = pages.filter((variables) => !variables.cursor);
803
- const cursorPages = pages.filter((variables) => Boolean(variables.cursor));
804
- const maxLimit = Math.max(
805
- 1,
806
- ...initialPages.map((variables) => variables.limit),
807
- );
808
- const requestVariables = {
809
- dataTableId,
810
- organizationId,
811
- cursor: null,
812
- limit: maxLimit,
813
- };
814
- const result = await graphqlRequestNoStore(
815
- dataTableRowsSnapshotQry,
816
- requestVariables,
817
- {
818
- authToken: params.authToken,
819
- },
820
- );
821
- const snapshot = result?.dataTableRowsSnapshot;
822
- if (params.shouldApply && !params.shouldApply()) {
823
- return 'CANCELLED';
824
- }
825
- if (
826
- result?.error ||
827
- !isApplicableDataTableRowsSnapshot(snapshot, organizationId, dataTableId)
828
- ) {
829
- return 'RETRY';
830
- }
831
-
832
- if (BigInt(snapshot.currentSeq) < BigInt(observedToSeq)) {
833
- return 'RETRY';
834
- }
835
- applyDataTableRecoveryMetadata(
836
- snapshot,
837
- organizationId,
838
- dataTableId,
839
- updateObservers,
840
- );
841
- cursorPages.forEach((variables) => {
842
- resetQuery(
843
- getDataTableRowsQueryKey(variables),
844
- true,
845
- updateObservers,
846
- true,
847
- );
848
- });
849
- initialPages.forEach((variables) => {
850
- setDataToCache(
851
- {
852
- dataTableRowsSnapshot: {
853
- ...snapshot,
854
- rows: snapshot.rows.slice(0, variables.limit),
855
- },
856
- },
857
- dataTableRowsSnapshotQry,
858
- variables,
859
- undefined,
860
- updateObservers,
861
- );
862
- updateObservers({
863
- queryId: getDataTableRowsQueryKey(variables),
864
- });
865
- });
866
- dataTableRealtimeSequenceGate.recordSnapshotFragments(
867
- organizationId,
868
- dataTableId,
869
- snapshot,
870
- );
871
- if (dataTableRealtimeSequenceGate.isRegistered(organizationId, dataTableId)) {
872
- dataTableRealtimeSequenceGate.acknowledgeSnapshot(
873
- organizationId,
874
- dataTableId,
875
- snapshot.currentSeq,
876
- );
877
- }
878
- return 'RECOVERED';
879
- }
880
-
881
- /*
882
- * Read one bounded DataTable journal tail for diagnostics or recovery target
883
- * selection. Only an applied watermark-bearing snapshot may acknowledge state.
884
- */
885
- export function useDataTableChanges(
886
- variables: DataTableChangesVariables,
887
- params: UseQueryParams = {},
888
- ) {
123
+ export function useDataTableRuns(variables: DataTableRunsVariables, params: UseQueryParams = {}) {
889
124
  const queryVariables = {
890
- dataTableId: variables.dataTableId,
891
125
  organizationId: variables.organizationId,
892
- afterSeq: normalizeDataTableChangeSeq(variables.afterSeq),
893
- limit: variables.limit ?? DATA_TABLE_CHANGES_LIMIT,
126
+ dataTableId: variables.dataTableId,
127
+ limit: variables.limit ?? 10,
894
128
  };
895
- const { data, ...rest } = useQuery(dataTableChangesQry, {
129
+ const { data, ...rest } = useQuery(dataTableRunsQry, {
896
130
  variables: queryVariables,
897
131
  ...params,
898
- skip:
899
- !queryVariables.organizationId ||
900
- !queryVariables.dataTableId ||
901
- !!params.skip,
132
+ skip: !queryVariables.organizationId || !queryVariables.dataTableId || !!params.skip,
902
133
  });
903
134
 
904
135
  return {
905
- dataTableChanges: data?.dataTableChanges,
136
+ dataTableRuns: data?.dataTableRuns || null,
906
137
  ...rest,
907
138
  };
908
139
  }
909
140
 
910
- /*
911
- * Fetch a one-shot uncached DataTable journal tail for future realtime gap
912
- * recovery. The tail alone cannot acknowledge local state; an awaited
913
- * watermark-bearing snapshot must do that. Auth-scoped requests never share
914
- * cached or in-flight results.
915
- */
916
- export async function fetchDataTableChangesTail(
917
- organizationId: string,
918
- dataTableId: string,
919
- afterSeq: DataTableChangeSeqInput,
920
- params: {
921
- authToken?: string | null;
922
- limit?: number;
923
- } = {},
924
- ) {
925
- const result = (await graphqlRequestNoStore(
926
- dataTableChangesQry,
927
- {
928
- organizationId,
929
- dataTableId,
930
- afterSeq: normalizeDataTableChangeSeq(afterSeq),
931
- limit: params.limit ?? DATA_TABLE_CHANGES_LIMIT,
932
- },
933
- {
934
- authToken: params.authToken,
935
- },
936
- )) as { dataTableChanges?: any; error?: unknown } | null;
937
- if (result?.error) {
938
- return null;
939
- }
940
-
941
- return result?.dataTableChanges || null;
942
- }
943
-
944
141
  /**
945
- * Get reactive dataTable fragment.
142
+ * Get the reactive data table fragment.
946
143
  */
947
-
948
- export function useReactiveDataTableFragment(
949
- dataTableId: string,
950
- currentData?: any,
951
- queryCount?: number,
952
- ) {
953
- const dataTable = useReactiveFragment(
954
- currentData,
955
- [makeFragmentKey(FRAGMENT_NAMES.dataTable, dataTableId)],
956
- queryCount,
957
- );
958
- const dataTableWithDeletedStatus = useMemo(
959
- () => mapDataTableDeletedStatus(dataTable),
960
- [dataTable],
961
- );
962
-
963
- return dataTableWithDeletedStatus;
144
+ export function useReactiveDataTableFragment(dataTableId: string, currentData?: any, queryCount?: number) {
145
+ return useReactiveFragment(currentData, dataTableId ? [makeFragmentKey(FRAGMENT_NAMES.dataTable, dataTableId)] : [], queryCount);
964
146
  }
965
147
 
966
- /**
967
- * Get reactive dataTable row fragment.
968
- */
969
-
970
- export function useReactiveDataTableRowFragment(
971
- dataTableRowId: string,
972
- currentData?: any,
973
- queryCount?: number,
974
- ) {
975
- return useReactiveFragment(
976
- currentData,
977
- [makeFragmentKey(FRAGMENT_NAMES.dataTableRow, dataTableRowId)],
978
- queryCount,
979
- );
980
- }
981
-
982
- /**
983
- * Get reactive dataTable cell fragment.
984
- */
985
-
986
- export function useReactiveDataTableCellFragment(
987
- dataTableCellId: string,
988
- currentData?: any,
989
- queryCount?: number,
990
- ) {
991
- return useReactiveFragment(
992
- currentData,
993
- [makeFragmentKey(FRAGMENT_NAMES.dataTableCell, dataTableCellId)],
994
- queryCount,
995
- );
148
+ /* Observe cached data table metadata for a list of identities without requesting rows or document details. */
149
+ export function useReactiveDataTableFragmentMap(currentData: { id: string }[] | null) {
150
+ return useReactiveFragmentMap(currentData, getFragmentBaseName(FRAGMENT_NAMES.dataTable));
996
151
  }