@eloxiv/client 0.0.0-stage → 0.1.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.
Files changed (269) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -2
  3. package/dist/Account.d.ts +131 -0
  4. package/dist/Account.d.ts.map +1 -0
  5. package/dist/Account.js +169 -0
  6. package/dist/Account.js.map +1 -0
  7. package/dist/Agent.d.ts +496 -0
  8. package/dist/Agent.d.ts.map +1 -0
  9. package/dist/Agent.js +228 -0
  10. package/dist/Agent.js.map +1 -0
  11. package/dist/AgentSync.d.ts +990 -0
  12. package/dist/AgentSync.d.ts.map +1 -0
  13. package/dist/AgentSync.js +46 -0
  14. package/dist/AgentSync.js.map +1 -0
  15. package/dist/AppState.d.ts +127 -0
  16. package/dist/AppState.d.ts.map +1 -0
  17. package/dist/AppState.js +145 -0
  18. package/dist/AppState.js.map +1 -0
  19. package/dist/AppStateSync.d.ts +193 -0
  20. package/dist/AppStateSync.d.ts.map +1 -0
  21. package/dist/AppStateSync.js +23 -0
  22. package/dist/AppStateSync.js.map +1 -0
  23. package/dist/Auth.d.ts +95 -0
  24. package/dist/Auth.d.ts.map +1 -0
  25. package/dist/Auth.js +139 -0
  26. package/dist/Auth.js.map +1 -0
  27. package/dist/Avatars.d.ts +53 -0
  28. package/dist/Avatars.d.ts.map +1 -0
  29. package/dist/Avatars.js +121 -0
  30. package/dist/Avatars.js.map +1 -0
  31. package/dist/BrowserAnalytics.d.ts +56 -0
  32. package/dist/BrowserAnalytics.d.ts.map +1 -0
  33. package/dist/BrowserAnalytics.js +94 -0
  34. package/dist/BrowserAnalytics.js.map +1 -0
  35. package/dist/Chat.d.ts +712 -0
  36. package/dist/Chat.d.ts.map +1 -0
  37. package/dist/Chat.js +883 -0
  38. package/dist/Chat.js.map +1 -0
  39. package/dist/ChatIntegrity.d.ts +63 -0
  40. package/dist/ChatIntegrity.d.ts.map +1 -0
  41. package/dist/ChatIntegrity.js +89 -0
  42. package/dist/ChatIntegrity.js.map +1 -0
  43. package/dist/ChatSends.d.ts +103 -0
  44. package/dist/ChatSends.d.ts.map +1 -0
  45. package/dist/ChatSends.js +157 -0
  46. package/dist/ChatSends.js.map +1 -0
  47. package/dist/Client.d.ts +113 -0
  48. package/dist/Client.d.ts.map +1 -0
  49. package/dist/Client.js +189 -0
  50. package/dist/Client.js.map +1 -0
  51. package/dist/Collab.d.ts +138 -0
  52. package/dist/Collab.d.ts.map +1 -0
  53. package/dist/Collab.js +454 -0
  54. package/dist/Collab.js.map +1 -0
  55. package/dist/CollabTools.d.ts +129 -0
  56. package/dist/CollabTools.d.ts.map +1 -0
  57. package/dist/CollabTools.js +277 -0
  58. package/dist/CollabTools.js.map +1 -0
  59. package/dist/Connections.d.ts +288 -0
  60. package/dist/Connections.d.ts.map +1 -0
  61. package/dist/Connections.js +316 -0
  62. package/dist/Connections.js.map +1 -0
  63. package/dist/Consent.d.ts +338 -0
  64. package/dist/Consent.d.ts.map +1 -0
  65. package/dist/Consent.js +142 -0
  66. package/dist/Consent.js.map +1 -0
  67. package/dist/Desktop.d.ts +61 -0
  68. package/dist/Desktop.d.ts.map +1 -0
  69. package/dist/Desktop.js +101 -0
  70. package/dist/Desktop.js.map +1 -0
  71. package/dist/Directory.d.ts +36 -0
  72. package/dist/Directory.d.ts.map +1 -0
  73. package/dist/Directory.js +42 -0
  74. package/dist/Directory.js.map +1 -0
  75. package/dist/ErrorReporter.d.ts +48 -0
  76. package/dist/ErrorReporter.d.ts.map +1 -0
  77. package/dist/ErrorReporter.js +70 -0
  78. package/dist/ErrorReporter.js.map +1 -0
  79. package/dist/ExpoSqlite.d.ts +7 -0
  80. package/dist/ExpoSqlite.d.ts.map +1 -0
  81. package/dist/ExpoSqlite.js +7 -0
  82. package/dist/ExpoSqlite.js.map +1 -0
  83. package/dist/FileSync.d.ts +265 -0
  84. package/dist/FileSync.d.ts.map +1 -0
  85. package/dist/FileSync.js +29 -0
  86. package/dist/FileSync.js.map +1 -0
  87. package/dist/FileTables.gen.d.ts +109 -0
  88. package/dist/FileTables.gen.d.ts.map +1 -0
  89. package/dist/FileTables.gen.js +23 -0
  90. package/dist/FileTables.gen.js.map +1 -0
  91. package/dist/Foldkit.d.ts +487 -0
  92. package/dist/Foldkit.d.ts.map +1 -0
  93. package/dist/Foldkit.js +617 -0
  94. package/dist/Foldkit.js.map +1 -0
  95. package/dist/History.d.ts +133 -0
  96. package/dist/History.d.ts.map +1 -0
  97. package/dist/History.js +210 -0
  98. package/dist/History.js.map +1 -0
  99. package/dist/InboxSync.d.ts +428 -0
  100. package/dist/InboxSync.d.ts.map +1 -0
  101. package/dist/InboxSync.js +37 -0
  102. package/dist/InboxSync.js.map +1 -0
  103. package/dist/KernelTables.gen.d.ts +1522 -0
  104. package/dist/KernelTables.gen.d.ts.map +1 -0
  105. package/dist/KernelTables.gen.js +307 -0
  106. package/dist/KernelTables.gen.js.map +1 -0
  107. package/dist/Make.d.ts +75 -0
  108. package/dist/Make.d.ts.map +1 -0
  109. package/dist/Make.js +70 -0
  110. package/dist/Make.js.map +1 -0
  111. package/dist/Models.d.ts +88 -0
  112. package/dist/Models.d.ts.map +1 -0
  113. package/dist/Models.js +80 -0
  114. package/dist/Models.js.map +1 -0
  115. package/dist/Optimistic.d.ts +120 -0
  116. package/dist/Optimistic.d.ts.map +1 -0
  117. package/dist/Optimistic.js +231 -0
  118. package/dist/Optimistic.js.map +1 -0
  119. package/dist/PlatformSync.d.ts +273 -0
  120. package/dist/PlatformSync.d.ts.map +1 -0
  121. package/dist/PlatformSync.js +92 -0
  122. package/dist/PlatformSync.js.map +1 -0
  123. package/dist/Poll.d.ts +113 -0
  124. package/dist/Poll.d.ts.map +1 -0
  125. package/dist/Poll.js +179 -0
  126. package/dist/Poll.js.map +1 -0
  127. package/dist/Preferences.d.ts +18 -0
  128. package/dist/Preferences.d.ts.map +1 -0
  129. package/dist/Preferences.js +22 -0
  130. package/dist/Preferences.js.map +1 -0
  131. package/dist/Proposals.d.ts +29 -0
  132. package/dist/Proposals.d.ts.map +1 -0
  133. package/dist/Proposals.js +41 -0
  134. package/dist/Proposals.js.map +1 -0
  135. package/dist/React.d.ts +17 -0
  136. package/dist/React.d.ts.map +1 -0
  137. package/dist/React.js +17 -0
  138. package/dist/React.js.map +1 -0
  139. package/dist/Reader.d.ts +35 -0
  140. package/dist/Reader.d.ts.map +1 -0
  141. package/dist/Reader.js +136 -0
  142. package/dist/Reader.js.map +1 -0
  143. package/dist/Resources.d.ts +98 -0
  144. package/dist/Resources.d.ts.map +1 -0
  145. package/dist/Resources.js +161 -0
  146. package/dist/Resources.js.map +1 -0
  147. package/dist/Rows.d.ts +4 -0
  148. package/dist/Rows.d.ts.map +1 -0
  149. package/dist/Rows.js +16 -0
  150. package/dist/Rows.js.map +1 -0
  151. package/dist/Runtime.d.ts +254 -0
  152. package/dist/Runtime.d.ts.map +1 -0
  153. package/dist/Runtime.js +1249 -0
  154. package/dist/Runtime.js.map +1 -0
  155. package/dist/RuntimeRuns.d.ts +74 -0
  156. package/dist/RuntimeRuns.d.ts.map +1 -0
  157. package/dist/RuntimeRuns.js +118 -0
  158. package/dist/RuntimeRuns.js.map +1 -0
  159. package/dist/ServicesSync.d.ts +286 -0
  160. package/dist/ServicesSync.d.ts.map +1 -0
  161. package/dist/ServicesSync.js +40 -0
  162. package/dist/ServicesSync.js.map +1 -0
  163. package/dist/Session.d.ts +226 -0
  164. package/dist/Session.d.ts.map +1 -0
  165. package/dist/Session.js +763 -0
  166. package/dist/Session.js.map +1 -0
  167. package/dist/ShareGrant.d.ts +47 -0
  168. package/dist/ShareGrant.d.ts.map +1 -0
  169. package/dist/ShareGrant.js +20 -0
  170. package/dist/ShareGrant.js.map +1 -0
  171. package/dist/Sharing.d.ts +203 -0
  172. package/dist/Sharing.d.ts.map +1 -0
  173. package/dist/Sharing.js +520 -0
  174. package/dist/Sharing.js.map +1 -0
  175. package/dist/Skew.d.ts +52 -0
  176. package/dist/Skew.d.ts.map +1 -0
  177. package/dist/Skew.js +77 -0
  178. package/dist/Skew.js.map +1 -0
  179. package/dist/SpacesSync.d.ts +247 -0
  180. package/dist/SpacesSync.d.ts.map +1 -0
  181. package/dist/SpacesSync.js +30 -0
  182. package/dist/SpacesSync.js.map +1 -0
  183. package/dist/Storage.d.ts +51 -0
  184. package/dist/Storage.d.ts.map +1 -0
  185. package/dist/Storage.js +107 -0
  186. package/dist/Storage.js.map +1 -0
  187. package/dist/Sync.d.ts +48 -0
  188. package/dist/Sync.d.ts.map +1 -0
  189. package/dist/Sync.js +48 -0
  190. package/dist/Sync.js.map +1 -0
  191. package/dist/SyncTables.d.ts +13 -0
  192. package/dist/SyncTables.d.ts.map +1 -0
  193. package/dist/SyncTables.js +13 -0
  194. package/dist/SyncTables.js.map +1 -0
  195. package/dist/Tab.d.ts +36 -0
  196. package/dist/Tab.d.ts.map +1 -0
  197. package/dist/Tab.js +44 -0
  198. package/dist/Tab.js.map +1 -0
  199. package/dist/Transport.d.ts +139 -0
  200. package/dist/Transport.d.ts.map +1 -0
  201. package/dist/Transport.js +232 -0
  202. package/dist/Transport.js.map +1 -0
  203. package/dist/Upload.d.ts +41 -0
  204. package/dist/Upload.d.ts.map +1 -0
  205. package/dist/Upload.js +93 -0
  206. package/dist/Upload.js.map +1 -0
  207. package/dist/WebMcp.d.ts +78 -0
  208. package/dist/WebMcp.d.ts.map +1 -0
  209. package/dist/WebMcp.js +204 -0
  210. package/dist/WebMcp.js.map +1 -0
  211. package/dist/index.d.ts +27 -0
  212. package/dist/index.d.ts.map +1 -0
  213. package/dist/index.js +27 -0
  214. package/dist/index.js.map +1 -0
  215. package/package.json +97 -3
  216. package/src/Account.ts +249 -0
  217. package/src/Agent.ts +387 -0
  218. package/src/AgentSync.ts +59 -0
  219. package/src/AppState.ts +222 -0
  220. package/src/AppStateSync.ts +26 -0
  221. package/src/Auth.ts +225 -0
  222. package/src/Avatars.ts +144 -0
  223. package/src/BrowserAnalytics.ts +133 -0
  224. package/src/Chat.ts +1150 -0
  225. package/src/ChatIntegrity.ts +130 -0
  226. package/src/ChatSends.ts +209 -0
  227. package/src/Client.ts +319 -0
  228. package/src/Collab.ts +524 -0
  229. package/src/CollabTools.ts +381 -0
  230. package/src/Connections.ts +517 -0
  231. package/src/Consent.ts +176 -0
  232. package/src/Desktop.ts +139 -0
  233. package/src/Directory.ts +71 -0
  234. package/src/ErrorReporter.ts +112 -0
  235. package/src/ExpoSqlite.ts +6 -0
  236. package/src/FileSync.ts +34 -0
  237. package/src/FileTables.gen.ts +23 -0
  238. package/src/Foldkit.ts +960 -0
  239. package/src/History.ts +337 -0
  240. package/src/InboxSync.ts +47 -0
  241. package/src/KernelTables.gen.ts +329 -0
  242. package/src/Make.ts +120 -0
  243. package/src/Models.ts +134 -0
  244. package/src/Optimistic.ts +364 -0
  245. package/src/PlatformSync.ts +156 -0
  246. package/src/Poll.ts +227 -0
  247. package/src/Preferences.ts +42 -0
  248. package/src/Proposals.ts +57 -0
  249. package/src/React.ts +26 -0
  250. package/src/Reader.ts +180 -0
  251. package/src/Resources.ts +257 -0
  252. package/src/Rows.ts +16 -0
  253. package/src/Runtime.ts +1409 -0
  254. package/src/RuntimeRuns.ts +180 -0
  255. package/src/ServicesSync.ts +58 -0
  256. package/src/Session.ts +814 -0
  257. package/src/ShareGrant.ts +20 -0
  258. package/src/Sharing.ts +696 -0
  259. package/src/Skew.ts +97 -0
  260. package/src/SpacesSync.ts +61 -0
  261. package/src/Storage.ts +167 -0
  262. package/src/Sync.ts +125 -0
  263. package/src/SyncTables.ts +12 -0
  264. package/src/Tab.ts +59 -0
  265. package/src/Transport.ts +321 -0
  266. package/src/Upload.ts +125 -0
  267. package/src/WebMcp.ts +279 -0
  268. package/src/index.ts +26 -0
  269. package/src/web-globals.d.ts +103 -0
@@ -0,0 +1,428 @@
1
+ import { approvalRequestRelationships, approvalRequestTable, notificationTable, workItemTable } from "./KernelTables.gen.ts";
2
+ export { approvalRequestRelationships, approvalRequestTable, notificationTable, workItemTable };
3
+ export declare const inboxTables: readonly [import("@rocicorp/zero").TableBuilderWithColumns<{
4
+ name: "workItem";
5
+ columns: {
6
+ readonly id: {
7
+ type: "string";
8
+ optional: false;
9
+ customType: string;
10
+ };
11
+ readonly orgId: {
12
+ type: "string";
13
+ optional: false;
14
+ customType: string;
15
+ } & {
16
+ serverName: string;
17
+ };
18
+ readonly module: {
19
+ type: "string";
20
+ optional: false;
21
+ customType: string;
22
+ };
23
+ readonly source: {
24
+ type: "string";
25
+ optional: false;
26
+ customType: string;
27
+ };
28
+ readonly sourceId: {
29
+ type: "string";
30
+ optional: false;
31
+ customType: string;
32
+ } & {
33
+ serverName: string;
34
+ };
35
+ readonly state: {
36
+ type: "string";
37
+ optional: false;
38
+ customType: "dismissed" | "done" | "in_progress" | "open" | "waiting";
39
+ };
40
+ readonly sourceState: Omit<{
41
+ type: "string";
42
+ optional: false;
43
+ customType: string;
44
+ } & {
45
+ serverName: string;
46
+ }, "optional"> & {
47
+ optional: true;
48
+ };
49
+ readonly assigneeUserId: Omit<{
50
+ type: "string";
51
+ optional: false;
52
+ customType: string;
53
+ } & {
54
+ serverName: string;
55
+ }, "optional"> & {
56
+ optional: true;
57
+ };
58
+ readonly assigneeGroupId: Omit<{
59
+ type: "string";
60
+ optional: false;
61
+ customType: string;
62
+ } & {
63
+ serverName: string;
64
+ }, "optional"> & {
65
+ optional: true;
66
+ };
67
+ readonly assignedBy: Omit<{
68
+ type: "string";
69
+ optional: false;
70
+ customType: string;
71
+ } & {
72
+ serverName: string;
73
+ }, "optional"> & {
74
+ optional: true;
75
+ };
76
+ readonly title: {
77
+ type: "string";
78
+ optional: false;
79
+ customType: string;
80
+ };
81
+ readonly linkModule: {
82
+ type: "string";
83
+ optional: false;
84
+ customType: string;
85
+ } & {
86
+ serverName: string;
87
+ };
88
+ readonly linkEntity: {
89
+ type: "string";
90
+ optional: false;
91
+ customType: string;
92
+ } & {
93
+ serverName: string;
94
+ };
95
+ readonly linkId: {
96
+ type: "string";
97
+ optional: false;
98
+ customType: string;
99
+ } & {
100
+ serverName: string;
101
+ };
102
+ readonly view: Omit<{
103
+ type: "string";
104
+ optional: false;
105
+ customType: string;
106
+ }, "optional"> & {
107
+ optional: true;
108
+ };
109
+ readonly dueAt: Omit<{
110
+ type: "number";
111
+ optional: false;
112
+ customType: number;
113
+ } & {
114
+ serverName: string;
115
+ }, "optional"> & {
116
+ optional: true;
117
+ };
118
+ readonly createdAt: {
119
+ type: "number";
120
+ optional: false;
121
+ customType: number;
122
+ } & {
123
+ serverName: string;
124
+ };
125
+ readonly updatedAt: {
126
+ type: "number";
127
+ optional: false;
128
+ customType: number;
129
+ } & {
130
+ serverName: string;
131
+ };
132
+ readonly closedAt: Omit<{
133
+ type: "number";
134
+ optional: false;
135
+ customType: number;
136
+ } & {
137
+ serverName: string;
138
+ }, "optional"> & {
139
+ optional: true;
140
+ };
141
+ };
142
+ primaryKey: readonly [string, ...string[]];
143
+ } & {
144
+ primaryKey: ["id"];
145
+ }>, import("@rocicorp/zero").TableBuilderWithColumns<{
146
+ name: "notification";
147
+ columns: {
148
+ readonly id: {
149
+ type: "string";
150
+ optional: false;
151
+ customType: string;
152
+ };
153
+ readonly orgId: {
154
+ type: "string";
155
+ optional: false;
156
+ customType: string;
157
+ } & {
158
+ serverName: string;
159
+ };
160
+ readonly recipientId: {
161
+ type: "string";
162
+ optional: false;
163
+ customType: string;
164
+ } & {
165
+ serverName: string;
166
+ };
167
+ readonly category: {
168
+ type: "string";
169
+ optional: false;
170
+ customType: string;
171
+ };
172
+ readonly title: {
173
+ type: "string";
174
+ optional: false;
175
+ customType: string;
176
+ };
177
+ readonly body: {
178
+ type: "string";
179
+ optional: false;
180
+ customType: string;
181
+ };
182
+ readonly linkModule: Omit<{
183
+ type: "string";
184
+ optional: false;
185
+ customType: string;
186
+ } & {
187
+ serverName: string;
188
+ }, "optional"> & {
189
+ optional: true;
190
+ };
191
+ readonly linkEntity: Omit<{
192
+ type: "string";
193
+ optional: false;
194
+ customType: string;
195
+ } & {
196
+ serverName: string;
197
+ }, "optional"> & {
198
+ optional: true;
199
+ };
200
+ readonly linkId: Omit<{
201
+ type: "string";
202
+ optional: false;
203
+ customType: string;
204
+ } & {
205
+ serverName: string;
206
+ }, "optional"> & {
207
+ optional: true;
208
+ };
209
+ readonly createdAt: {
210
+ type: "number";
211
+ optional: false;
212
+ customType: number;
213
+ } & {
214
+ serverName: string;
215
+ };
216
+ readonly readAt: Omit<{
217
+ type: "number";
218
+ optional: false;
219
+ customType: number;
220
+ } & {
221
+ serverName: string;
222
+ }, "optional"> & {
223
+ optional: true;
224
+ };
225
+ readonly dismissedAt: Omit<{
226
+ type: "number";
227
+ optional: false;
228
+ customType: number;
229
+ } & {
230
+ serverName: string;
231
+ }, "optional"> & {
232
+ optional: true;
233
+ };
234
+ };
235
+ primaryKey: readonly [string, ...string[]];
236
+ } & {
237
+ primaryKey: ["id"];
238
+ }>, import("@rocicorp/zero").TableBuilderWithColumns<{
239
+ name: "approvalRequest";
240
+ columns: {
241
+ readonly id: {
242
+ type: "string";
243
+ optional: false;
244
+ customType: string;
245
+ };
246
+ readonly orgId: {
247
+ type: "string";
248
+ optional: false;
249
+ customType: string;
250
+ } & {
251
+ serverName: string;
252
+ };
253
+ readonly requesterId: {
254
+ type: "string";
255
+ optional: false;
256
+ customType: string;
257
+ } & {
258
+ serverName: string;
259
+ };
260
+ readonly action: {
261
+ type: "string";
262
+ optional: false;
263
+ customType: string;
264
+ };
265
+ readonly title: {
266
+ type: "string";
267
+ optional: false;
268
+ customType: string;
269
+ };
270
+ readonly input: {
271
+ type: "json";
272
+ optional: false;
273
+ customType: import("@rocicorp/zero").ReadonlyJSONValue;
274
+ };
275
+ readonly quorum: {
276
+ type: "number";
277
+ optional: false;
278
+ customType: number;
279
+ };
280
+ readonly allowSelfApproval: {
281
+ type: "boolean";
282
+ optional: false;
283
+ customType: boolean;
284
+ } & {
285
+ serverName: string;
286
+ };
287
+ readonly status: {
288
+ type: "string";
289
+ optional: false;
290
+ customType: "approved" | "expired" | "pending" | "rejected";
291
+ };
292
+ readonly approvals: {
293
+ type: "number";
294
+ optional: false;
295
+ customType: number;
296
+ };
297
+ readonly expiresAt: Omit<{
298
+ type: "number";
299
+ optional: false;
300
+ customType: number;
301
+ } & {
302
+ serverName: string;
303
+ }, "optional"> & {
304
+ optional: true;
305
+ };
306
+ readonly createdAt: {
307
+ type: "number";
308
+ optional: false;
309
+ customType: number;
310
+ } & {
311
+ serverName: string;
312
+ };
313
+ readonly decidedAt: Omit<{
314
+ type: "number";
315
+ optional: false;
316
+ customType: number;
317
+ } & {
318
+ serverName: string;
319
+ }, "optional"> & {
320
+ optional: true;
321
+ };
322
+ readonly execution: Omit<{
323
+ type: "json";
324
+ optional: false;
325
+ customType: import("@rocicorp/zero").ReadonlyJSONValue;
326
+ }, "optional"> & {
327
+ optional: true;
328
+ };
329
+ };
330
+ primaryKey: readonly [string, ...string[]];
331
+ } & {
332
+ primaryKey: ["id"];
333
+ }>];
334
+ export declare const inboxRelationships: readonly [{
335
+ name: "approvalRequest";
336
+ relationships: {
337
+ shares: [{
338
+ readonly sourceField: readonly ("action" | "allowSelfApproval" | "approvals" | "createdAt" | "decidedAt" | "execution" | "expiresAt" | "id" | "input" | "orgId" | "quorum" | "requesterId" | "status" | "title")[];
339
+ readonly destField: readonly ("granteeId" | "granteeKind" | "id" | "permission" | "resourceId" | "resourceType")[];
340
+ readonly destSchema: "shareGrant";
341
+ readonly cardinality: 'many';
342
+ }];
343
+ };
344
+ }];
345
+ /** Named queries, namespaced like a module's (`inbox.items`, `notifications.mine`, `approvals.requests`). */
346
+ export declare const inboxQueries: {
347
+ inbox: {
348
+ /** Open work items (the kernel adds: assigned to you or your groups, in the organisation you act in). */
349
+ items: import("@rocicorp/zero").QueryDefinition<"workItem", import("@rocicorp/zero").ReadonlyJSONValue | undefined, import("@rocicorp/zero").ReadonlyJSONValue | undefined, {
350
+ readonly id: string;
351
+ readonly orgId: string;
352
+ readonly module: string;
353
+ readonly source: string;
354
+ readonly sourceId: string;
355
+ readonly state: "dismissed" | "done" | "in_progress" | "open" | "waiting";
356
+ readonly sourceState: string | null;
357
+ readonly assigneeUserId: string | null;
358
+ readonly assigneeGroupId: string | null;
359
+ readonly assignedBy: string | null;
360
+ readonly title: string;
361
+ readonly linkModule: string;
362
+ readonly linkEntity: string;
363
+ readonly linkId: string;
364
+ readonly view: string | null;
365
+ readonly dueAt: number | null;
366
+ readonly createdAt: number;
367
+ readonly updatedAt: number;
368
+ readonly closedAt: number | null;
369
+ }, unknown>;
370
+ /** Every work item, closed ones too. */
371
+ all: import("@rocicorp/zero").QueryDefinition<"workItem", import("@rocicorp/zero").ReadonlyJSONValue | undefined, import("@rocicorp/zero").ReadonlyJSONValue | undefined, {
372
+ readonly id: string;
373
+ readonly orgId: string;
374
+ readonly module: string;
375
+ readonly source: string;
376
+ readonly sourceId: string;
377
+ readonly state: "dismissed" | "done" | "in_progress" | "open" | "waiting";
378
+ readonly sourceState: string | null;
379
+ readonly assigneeUserId: string | null;
380
+ readonly assigneeGroupId: string | null;
381
+ readonly assignedBy: string | null;
382
+ readonly title: string;
383
+ readonly linkModule: string;
384
+ readonly linkEntity: string;
385
+ readonly linkId: string;
386
+ readonly view: string | null;
387
+ readonly dueAt: number | null;
388
+ readonly createdAt: number;
389
+ readonly updatedAt: number;
390
+ readonly closedAt: number | null;
391
+ }, unknown>;
392
+ };
393
+ notifications: {
394
+ mine: import("@rocicorp/zero").QueryDefinition<"notification", import("@rocicorp/zero").ReadonlyJSONValue | undefined, import("@rocicorp/zero").ReadonlyJSONValue | undefined, {
395
+ readonly id: string;
396
+ readonly orgId: string;
397
+ readonly recipientId: string;
398
+ readonly category: string;
399
+ readonly title: string;
400
+ readonly body: string;
401
+ readonly linkModule: string | null;
402
+ readonly linkEntity: string | null;
403
+ readonly linkId: string | null;
404
+ readonly createdAt: number;
405
+ readonly readAt: number | null;
406
+ readonly dismissedAt: number | null;
407
+ }, unknown>;
408
+ };
409
+ approvals: {
410
+ requests: import("@rocicorp/zero").QueryDefinition<"approvalRequest", import("@rocicorp/zero").ReadonlyJSONValue | undefined, import("@rocicorp/zero").ReadonlyJSONValue | undefined, {
411
+ readonly id: string;
412
+ readonly orgId: string;
413
+ readonly requesterId: string;
414
+ readonly action: string;
415
+ readonly title: string;
416
+ readonly input: import("@rocicorp/zero").ReadonlyJSONValue;
417
+ readonly quorum: number;
418
+ readonly allowSelfApproval: boolean;
419
+ readonly status: "approved" | "expired" | "pending" | "rejected";
420
+ readonly approvals: number;
421
+ readonly expiresAt: number | null;
422
+ readonly createdAt: number;
423
+ readonly decidedAt: number | null;
424
+ readonly execution: import("@rocicorp/zero").ReadonlyJSONValue;
425
+ }, unknown>;
426
+ };
427
+ };
428
+ //# sourceMappingURL=InboxSync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InboxSync.d.ts","sourceRoot":"","sources":["../src/InboxSync.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACd,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,aAAa,EAAE,CAAA;AAE/F,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAoE,CAAA;AAC5F,eAAO,MAAM,kBAAkB;;;;;;;;;;EAA0C,CAAA;AASzE,6GAA6G;AAC7G,eAAO,MAAM,YAAY;IACvB,KAAK;QACH,yGAAyG;QACzG,KAAK;;;;;;;;;;;;;;;;;;;;;QAGL,wCAAwC;QACxC,GAAG;;;;;;;;;;;;;;;;;;;;;;IAEL,aAAa;QACX,IAAI;;;;;;;;;;;;;;;IAEN,SAAS;QACP,QAAQ;;;;;;;;;;;;;;;;;CAEX,CAAA"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The unified inbox in each person's replica: the kernel-provided modules' synced tables (work items,
3
+ * notifications, approval requests; generated from their Drizzle tables, `KernelTables.gen.ts`) and their named
4
+ * queries. An app that installs the kernel's inbox modules adds `inboxTables`, `inboxRelationships` and
5
+ * `inboxQueries` to its sync schema. The kernel infers each query's entity from the table it reads and filters it
6
+ * by that entity's read policy: a person's replica holds only the work items assigned to them or to one of their
7
+ * groups, their own notifications, and the approval requests they made or may decide, in the organisation they
8
+ * act in.
9
+ */
10
+ import { createBuilder, createSchema, defineQueryWithType } from "@rocicorp/zero";
11
+ import { approvalRequestRelationships, approvalRequestTable, notificationTable, workItemTable, } from "./KernelTables.gen.js";
12
+ import { shareGrant } from "./ShareGrant.js";
13
+ export { approvalRequestRelationships, approvalRequestTable, notificationTable, workItemTable };
14
+ export const inboxTables = [workItemTable, notificationTable, approvalRequestTable];
15
+ export const inboxRelationships = [approvalRequestRelationships];
16
+ const localSchema = createSchema({
17
+ tables: [workItemTable, notificationTable, approvalRequestTable, shareGrant],
18
+ relationships: [approvalRequestRelationships],
19
+ });
20
+ const zql = createBuilder(localSchema);
21
+ const defineQuery = defineQueryWithType();
22
+ /** Named queries, namespaced like a module's (`inbox.items`, `notifications.mine`, `approvals.requests`). */
23
+ export const inboxQueries = {
24
+ inbox: {
25
+ /** Open work items (the kernel adds: assigned to you or your groups, in the organisation you act in). */
26
+ items: defineQuery(() => zql.workItem.where("state", "IN", ["open", "in_progress", "waiting"]).orderBy("createdAt", "desc").limit(200)),
27
+ /** Every work item, closed ones too. */
28
+ all: defineQuery(() => zql.workItem.orderBy("updatedAt", "desc").limit(500)),
29
+ },
30
+ notifications: {
31
+ mine: defineQuery(() => zql.notification.orderBy("createdAt", "desc").limit(200)),
32
+ },
33
+ approvals: {
34
+ requests: defineQuery(() => zql.approvalRequest.orderBy("createdAt", "desc").limit(200)),
35
+ },
36
+ };
37
+ //# sourceMappingURL=InboxSync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InboxSync.js","sourceRoot":"","sources":["../src/InboxSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACjF,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,GACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,aAAa,EAAE,CAAA;AAE/F,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,aAAa,EAAE,iBAAiB,EAAE,oBAAoB,CAAU,CAAA;AAC5F,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,4BAA4B,CAAU,CAAA;AAEzE,MAAM,WAAW,GAAG,YAAY,CAAC;IAC/B,MAAM,EAAE,CAAC,aAAa,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,UAAU,CAAC;IAC5E,aAAa,EAAE,CAAC,4BAA4B,CAAC;CAC9C,CAAC,CAAA;AACF,MAAM,GAAG,GAAG,aAAa,CAAC,WAAW,CAAC,CAAA;AACtC,MAAM,WAAW,GAAG,mBAAmB,EAAsB,CAAA;AAE7D,6GAA6G;AAC7G,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,KAAK,EAAE;QACL,yGAAyG;QACzG,KAAK,EAAE,WAAW,CAAC,GAAG,EAAE,CACtB,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAC9G;QACD,wCAAwC;QACxC,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KAC7E;IACD,aAAa,EAAE;QACb,IAAI,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KAClF;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACzF;CACF,CAAA"}