@jsb188/graphql 1.1.11 → 1.1.12

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 (165) hide show
  1. package/audience.d.ts +343 -0
  2. package/cache/config.ts +58 -24
  3. package/cache/index.chat-activity.test.ts +119 -0
  4. package/cache/index.chat.test.ts +92 -0
  5. package/cache/index.helpers.ts +96 -0
  6. package/cache/index.regression.test.ts +149 -0
  7. package/cache/index.test.ts +370 -42
  8. package/cache/index.ts +326 -799
  9. package/cache/optimistic-ui-runtime.ts +46 -0
  10. package/cache/optimistic-ui.ts +401 -0
  11. package/cache/persist.ts +98 -19
  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} +5 -2
  16. package/client/index.ts +3 -2
  17. package/client/request.helpers.ts +14 -0
  18. package/client/request.ts +130 -215
  19. package/deno.lock +17 -0
  20. package/deno.test.json +2 -0
  21. package/gql/fragments/agentMemoryFragments.ts +5 -1
  22. package/gql/fragments/agentNoteFragments.ts +150 -0
  23. package/gql/fragments/aiChatFragments.ts +36 -10
  24. package/gql/fragments/audienceFragments.ts +141 -0
  25. package/gql/fragments/campaignFragments.ts +415 -126
  26. package/gql/fragments/dataTableFragments.ts +48 -80
  27. package/gql/fragments/emailFragments.ts +28 -23
  28. package/gql/fragments/fieldDocFragments.ts +222 -40
  29. package/gql/fragments/inboundContactFragments.ts +2 -0
  30. package/gql/fragments/logFragments.ts +93 -2
  31. package/gql/fragments/organizationFragments.ts +10 -0
  32. package/gql/fragments/qrCodeFragments.ts +29 -0
  33. package/gql/fragments/scheduleFragments.ts +652 -140
  34. package/gql/fragments/sheetFragments.ts +84 -373
  35. package/gql/fragments/storageFragments.ts +25 -1
  36. package/gql/fragments/workflowFragments.ts +13 -1
  37. package/gql/mutations/agentMemoryMutations.ts +32 -0
  38. package/gql/mutations/agentNoteMutations.ts +62 -0
  39. package/gql/mutations/aiChatMutations.ts +36 -4
  40. package/gql/mutations/audienceMutations.ts +71 -0
  41. package/gql/mutations/authMutations.ts +45 -1
  42. package/gql/mutations/billingMutations.ts +24 -0
  43. package/gql/mutations/campaignMutations.ts +170 -127
  44. package/gql/mutations/contactMutations.ts +23 -0
  45. package/gql/mutations/dataTableMutations.ts +18 -75
  46. package/gql/mutations/fieldDocMutations.ts +162 -13
  47. package/gql/mutations/index.ts +8 -5
  48. package/gql/mutations/organizationMutations.ts +6 -0
  49. package/gql/mutations/qrCodeMutations.ts +20 -0
  50. package/gql/mutations/scheduleMutations.ts +1052 -354
  51. package/gql/mutations/sheetMutations.ts +62 -118
  52. package/gql/mutations/storageMutations.ts +0 -1
  53. package/gql/mutations/workflowMutations.ts +18 -0
  54. package/gql/queries/agentMemoryQueries.ts +6 -0
  55. package/gql/queries/agentNoteQueries.ts +89 -0
  56. package/gql/queries/aiChatQueries.ts +56 -4
  57. package/gql/queries/audienceQueries.ts +128 -0
  58. package/gql/queries/authQueries.ts +6 -0
  59. package/gql/queries/billingQueries.ts +95 -6
  60. package/gql/queries/campaignQueries.ts +132 -23
  61. package/gql/queries/dataTableQueries.ts +24 -65
  62. package/gql/queries/emailQueries.ts +18 -61
  63. package/gql/queries/emailReplyReportQueries.ts +76 -0
  64. package/gql/queries/fieldDocQueries.ts +100 -92
  65. package/gql/queries/inboundContactQueries.ts +4 -0
  66. package/gql/queries/index.ts +3 -1
  67. package/gql/queries/logQueries.ts +62 -7
  68. package/gql/queries/organizationQueries.ts +13 -0
  69. package/gql/queries/qrCodeQueries.ts +20 -0
  70. package/gql/queries/scheduleQueries.ts +633 -257
  71. package/gql/queries/sheetQueries.ts +59 -152
  72. package/gql/queries/workflowQueries.ts +10 -4
  73. package/hooks/index.helpers.test.ts +50 -0
  74. package/hooks/index.helpers.ts +52 -0
  75. package/hooks/index.ts +863 -685
  76. package/hooks/use-agentMemory-mtn.ts +29 -31
  77. package/hooks/use-agentMemory-qry.ts +15 -3
  78. package/hooks/use-agentNote-mtn.ts +82 -0
  79. package/hooks/use-agentNote-qry.ts +190 -0
  80. package/hooks/use-agentNote-recovery.helpers.test.ts +68 -0
  81. package/hooks/use-agentNote-recovery.helpers.ts +58 -0
  82. package/hooks/use-agentNote-recovery.ts +72 -0
  83. package/hooks/use-aiChat-mtn.ts +96 -112
  84. package/hooks/use-aiChat-qry.helpers.test.ts +63 -0
  85. package/hooks/use-aiChat-qry.helpers.ts +124 -0
  86. package/hooks/use-aiChat-qry.ts +229 -383
  87. package/hooks/use-aiChat-stream-mtn.ts +14 -0
  88. package/hooks/use-audience-mtn.ts +194 -0
  89. package/hooks/use-audience-qry.helpers.test.ts +80 -0
  90. package/hooks/use-audience-qry.helpers.ts +63 -0
  91. package/hooks/use-audience-qry.ts +330 -0
  92. package/hooks/use-auth-mtn.ts +30 -1
  93. package/hooks/use-billing-mtn.ts +31 -0
  94. package/hooks/use-billing-qry.ts +76 -0
  95. package/hooks/use-campaign-generation-recovery.ts +53 -0
  96. package/hooks/use-campaign-mtn.ts +224 -165
  97. package/hooks/use-campaign-qry.helpers.ts +40 -0
  98. package/hooks/use-campaign-qry.ts +631 -54
  99. package/hooks/use-dataTable-mtn.ts +23 -115
  100. package/hooks/use-dataTable-qry.ts +66 -916
  101. package/hooks/use-email-qry.helpers.ts +37 -0
  102. package/hooks/use-email-qry.ts +33 -178
  103. package/hooks/use-emailCampaignReplyReport-qry.ts +27 -0
  104. package/hooks/use-fieldDoc-mtn.ts +244 -32
  105. package/hooks/use-fieldDoc-qry.helpers.test.ts +65 -0
  106. package/hooks/use-fieldDoc-qry.helpers.ts +49 -0
  107. package/hooks/use-fieldDoc-qry.ts +134 -102
  108. package/hooks/use-inboundContact-qry.ts +7 -9
  109. package/hooks/use-log-mtn.ts +25 -12
  110. package/hooks/use-log-qry.ts +99 -46
  111. package/hooks/use-organization-qry.ts +16 -60
  112. package/hooks/use-publicFormEmail-mtn.ts +27 -0
  113. package/hooks/use-qrCode-mtn.ts +40 -0
  114. package/hooks/use-qrCode-qry.ts +78 -0
  115. package/hooks/use-schedule-mtn.ts +506 -333
  116. package/hooks/use-schedule-qry.ts +682 -101
  117. package/hooks/use-schedule-reactive.ts +486 -0
  118. package/hooks/use-sheet-mtn.ts +91 -199
  119. package/hooks/use-sheet-qry.ts +84 -238
  120. package/hooks/use-storage-qry.ts +84 -61
  121. package/hooks/use-workflow-mtn.ts +39 -22
  122. package/hooks/use-workflow-qry.ts +40 -61
  123. package/libs/ai-chat-outgoing.helpers.ts +153 -0
  124. package/libs/ai-chat-outgoing.ts +11 -0
  125. package/libs/ai-chat-outgoing.types.ts +25 -0
  126. package/libs/ai-chat-run-realtime.ts +20 -0
  127. package/libs/ai-chat-submission-realtime.ts +150 -0
  128. package/libs/fragment-realtime-sequence.ts +55 -0
  129. package/libs/fragment-recovery.test.ts +326 -0
  130. package/libs/fragment-recovery.ts +325 -0
  131. package/libs/open-sheet.ts +138 -0
  132. package/libs/orchestrator-realtime.helpers.test.ts +229 -0
  133. package/libs/orchestrator-realtime.helpers.ts +317 -0
  134. package/libs/orchestrator-realtime.ts +433 -0
  135. package/libs/request-cache-regression.test.ts +122 -0
  136. package/{client → libs}/request-managed-session.test.ts +1 -1
  137. package/libs/request-no-store.test.ts +419 -0
  138. package/libs/sheet-command-batch.ts +44 -0
  139. package/libs/sheet-view-realtime-router.test.ts +214 -0
  140. package/libs/sheet-view-realtime-router.ts +99 -0
  141. package/loaders/campaign.test.ts +186 -0
  142. package/loaders/campaign.ts +56 -83
  143. package/loaders/emailPreference.ts +75 -0
  144. package/loaders/rest.ts +12 -0
  145. package/package.json +42 -17
  146. package/schedule.d.ts +1790 -0
  147. package/sse.helpers.ts +19 -0
  148. package/sse.ts +26 -115
  149. package/tests/agent-note-detail-cache.test.ts +120 -0
  150. package/tests/agent-note-search.test.ts +444 -0
  151. package/types.d.ts +46 -25
  152. package/client/data-table-realtime-subscriptions.test.ts +0 -740
  153. package/client/data-table-realtime-subscriptions.ts +0 -955
  154. package/client/data-table-realtime.test.ts +0 -792
  155. package/client/data-table-realtime.ts +0 -1218
  156. package/client/fragment-realtime-sequence.ts +0 -52
  157. package/client/open-sheet.ts +0 -137
  158. package/client/request-no-store.test.ts +0 -157
  159. package/gql/fragments/agentDocFragments.ts +0 -46
  160. package/gql/fragments/billingFragments.ts +0 -14
  161. package/gql/mutations/agentDocMutations.ts +0 -177
  162. package/gql/queries/agentDocQueries.ts +0 -120
  163. package/hooks/use-agentDoc-mtn.ts +0 -285
  164. package/hooks/use-agentDoc-qry.ts +0 -208
  165. /package/{client → libs}/sse-ticket.test.ts +0 -0
@@ -1,11 +1,9 @@
1
1
  import { gql } from 'graphql-tag';
2
2
  import {
3
3
  sheetCellFragment,
4
- sheetCommandResultFragment,
5
4
  sheetFragment,
6
- sheetRangeFragment,
7
- sheetRegionFragment,
8
5
  sheetTabFragment,
6
+ sheetTabMutationResultFragment,
9
7
  sheetViewPatchFragment,
10
8
  } from '../fragments/sheetFragments.ts';
11
9
 
@@ -85,21 +83,20 @@ export const createSheetTabMtn = gql`
85
83
  mutation createSheetTab (
86
84
  $organizationId: GenericID!
87
85
  $sheetId: GenericID!
86
+ $commandId: String!
87
+ $sessionId: String!
88
88
  ) {
89
89
  createSheetTab (
90
90
  organizationId: $organizationId
91
91
  sheetId: $sheetId
92
+ commandId: $commandId
93
+ sessionId: $sessionId
92
94
  ) {
93
- ...sheetFragment
94
-
95
- tabs {
96
- ...sheetTabFragment
97
- }
95
+ ...sheetTabMutationResultFragment
98
96
  }
99
97
  }
100
98
 
101
- ${sheetFragment}
102
- ${sheetTabFragment}
99
+ ${sheetTabMutationResultFragment}
103
100
  `;
104
101
 
105
102
  export const importSheetFromFileMtn = gql`
@@ -154,8 +151,8 @@ mutation updateSheetTab (
154
151
  $sheetId: GenericID!
155
152
  $sheetTabId: GenericID!
156
153
  $name: String
157
- $commandId: String
158
- $sessionId: String
154
+ $commandId: String!
155
+ $sessionId: String!
159
156
  ) {
160
157
  updateSheetTab (
161
158
  organizationId: $organizationId
@@ -165,125 +162,114 @@ mutation updateSheetTab (
165
162
  commandId: $commandId
166
163
  sessionId: $sessionId
167
164
  ) {
168
- ...sheetTabFragment
165
+ ...sheetTabMutationResultFragment
169
166
  }
170
167
  }
171
168
 
172
- ${sheetTabFragment}
169
+ ${sheetTabMutationResultFragment}
173
170
  `;
174
171
 
175
- export const reorderSheetTabsMtn = gql`
176
- mutation reorderSheetTabs (
172
+ export const setSheetTabHiddenMtn = gql`
173
+ mutation setSheetTabHidden (
177
174
  $organizationId: GenericID!
178
175
  $sheetId: GenericID!
179
- $positions: [SheetTabPositionInput!]!
180
- $commandId: String
181
- $sessionId: String
176
+ $sheetTabId: GenericID!
177
+ $hidden: Boolean!
178
+ $commandId: String!
179
+ $sessionId: String!
182
180
  ) {
183
- reorderSheetTabs (
181
+ setSheetTabHidden (
184
182
  organizationId: $organizationId
185
183
  sheetId: $sheetId
186
- positions: $positions
184
+ sheetTabId: $sheetTabId
185
+ hidden: $hidden
187
186
  commandId: $commandId
188
187
  sessionId: $sessionId
189
188
  ) {
190
- ...sheetFragment
191
-
192
- tabs {
193
- ...sheetTabFragment
194
- }
189
+ ...sheetTabMutationResultFragment
195
190
  }
196
191
  }
197
192
 
198
- ${sheetFragment}
199
- ${sheetTabFragment}
193
+ ${sheetTabMutationResultFragment}
200
194
  `;
201
195
 
202
- export const deleteSheetTabMtn = gql`
203
- mutation deleteSheetTab (
196
+ export const reorderSheetTabsMtn = gql`
197
+ mutation reorderSheetTabs (
204
198
  $organizationId: GenericID!
205
199
  $sheetId: GenericID!
206
- $sheetTabId: GenericID!
200
+ $positions: [SheetTabPositionInput!]!
201
+ $commandId: String!
202
+ $sessionId: String!
207
203
  ) {
208
- deleteSheetTab (
204
+ reorderSheetTabs (
209
205
  organizationId: $organizationId
210
206
  sheetId: $sheetId
211
- sheetTabId: $sheetTabId
212
- )
207
+ positions: $positions
208
+ commandId: $commandId
209
+ sessionId: $sessionId
210
+ ) {
211
+ ...sheetTabMutationResultFragment
212
+ }
213
213
  }
214
+
215
+ ${sheetTabMutationResultFragment}
214
216
  `;
215
217
 
216
- export const editSheetRegionCommandMtn = gql`
217
- mutation editSheetRegionCommand (
218
+ export const deleteSheetTabMtn = gql`
219
+ mutation deleteSheetTab (
218
220
  $organizationId: GenericID!
219
221
  $sheetId: GenericID!
220
222
  $sheetTabId: GenericID!
221
- $operation: SheetRegionCommandOperation!
222
- $regionId: GenericID
223
- $region: SheetRegionInput
224
223
  $commandId: String!
225
224
  $sessionId: String!
226
- $sourceClientId: String
227
- $baseRevision: BigInt!
228
- $baseDesignRevision: BigInt!
229
- $includeInOperationalHistory: Boolean
230
225
  ) {
231
- editSheetRegionCommand (
226
+ deleteSheetTab (
232
227
  organizationId: $organizationId
233
228
  sheetId: $sheetId
234
229
  sheetTabId: $sheetTabId
235
- operation: $operation
236
- regionId: $regionId
237
- region: $region
238
230
  commandId: $commandId
239
231
  sessionId: $sessionId
240
- sourceClientId: $sourceClientId
241
- baseRevision: $baseRevision
242
- baseDesignRevision: $baseDesignRevision
243
- includeInOperationalHistory: $includeInOperationalHistory
244
232
  ) {
245
- ...sheetCommandResultFragment
246
-
247
- affectedTabs {
248
- ...sheetTabFragment
249
- }
233
+ ...sheetTabMutationResultFragment
250
234
  }
251
235
  }
252
236
 
253
- ${sheetCommandResultFragment}
254
- ${sheetCellFragment}
255
- ${sheetTabFragment}
237
+ ${sheetTabMutationResultFragment}
256
238
  `;
257
239
 
240
+ // NOTE: editSheetCommandBatch sends one sealed command envelope (wire contract
241
+ // v4): envelopeId is the idempotency key, clientId + clientSeq order the
242
+ // envelopes of one page/document, and sessionId scopes undo only. It is
243
+ // always requested no-store; the client applies the patches to its tab stores.
244
+
258
245
  export const editSheetCommandBatchMtn = gql`
259
246
  mutation editSheetCommandBatch (
247
+ $contractVersion: Int!
260
248
  $organizationId: GenericID!
261
249
  $sheetId: GenericID!
262
250
  $envelopeId: String!
263
- $sourceClientId: String!
264
- $previewSeq: BigInt!
265
- $commands: [SheetCommandBatchItemInput!]!
251
+ $clientId: String!
252
+ $sessionId: String!
253
+ $clientSeq: Int!
254
+ $commands: [SheetCommandInput!]!
266
255
  ) {
267
256
  editSheetCommandBatch (
257
+ contractVersion: $contractVersion
268
258
  organizationId: $organizationId
269
259
  sheetId: $sheetId
270
260
  envelopeId: $envelopeId
271
- sourceClientId: $sourceClientId
272
- previewSeq: $previewSeq
261
+ clientId: $clientId
262
+ sessionId: $sessionId
263
+ clientSeq: $clientSeq
273
264
  commands: $commands
274
265
  ) {
275
266
  actorAccountId
276
267
  envelopeId
277
- sourceClientId
278
- committedPreviewSeq
279
- previewAuthorities {
280
- clientId
281
- envelopeId
282
- previewSeq
283
- serverSeq
284
- sheetTabId
285
- targetKeys
286
- }
268
+ clientId
269
+ clientSeq
270
+ replayed
271
+ committedCommandIds
272
+ noWriteCommandIds
287
273
 
288
274
  settlements {
289
275
  commandId
@@ -294,6 +280,7 @@ mutation editSheetCommandBatch (
294
280
  commandStatus
295
281
  replayed
296
282
  requiresSnapshot
283
+ undoRecorded
297
284
  axisMoveOps {
298
285
  schemaVersion
299
286
  commandId
@@ -326,6 +313,7 @@ mutation editSheetCommandBatch (
326
313
  targetType
327
314
  targetKey
328
315
  }
316
+
329
317
  }
330
318
  }
331
319
 
@@ -337,49 +325,5 @@ mutation editSheetCommandBatch (
337
325
 
338
326
  ${sheetViewPatchFragment}
339
327
  ${sheetCellFragment}
340
- ${sheetRangeFragment}
341
- ${sheetRegionFragment}
342
- ${sheetTabFragment}
343
- `;
344
-
345
- export const editSheetStructureCommandMtn = gql`
346
- mutation editSheetStructureCommand (
347
- $organizationId: GenericID!
348
- $sheetId: GenericID!
349
- $sheetTabId: GenericID!
350
- $operation: SheetStructureOperation!
351
- $index: Int!
352
- $confirmDestructive: Boolean!
353
- $commandId: String!
354
- $sessionId: String!
355
- $sourceClientId: String
356
- $baseRevision: BigInt!
357
- $baseDesignRevision: BigInt!
358
- $includeInOperationalHistory: Boolean
359
- ) {
360
- editSheetStructureCommand (
361
- organizationId: $organizationId
362
- sheetId: $sheetId
363
- sheetTabId: $sheetTabId
364
- operation: $operation
365
- index: $index
366
- confirmDestructive: $confirmDestructive
367
- commandId: $commandId
368
- sessionId: $sessionId
369
- sourceClientId: $sourceClientId
370
- baseRevision: $baseRevision
371
- baseDesignRevision: $baseDesignRevision
372
- includeInOperationalHistory: $includeInOperationalHistory
373
- ) {
374
- ...sheetCommandResultFragment
375
-
376
- affectedTabs {
377
- ...sheetTabFragment
378
- }
379
- }
380
- }
381
-
382
- ${sheetCommandResultFragment}
383
- ${sheetCellFragment}
384
328
  ${sheetTabFragment}
385
329
  `;
@@ -49,7 +49,6 @@ mutation createGeneratedFileDownloadLink (
49
49
  ) {
50
50
  url
51
51
  expiresAt
52
- isPublic
53
52
  }
54
53
  }
55
54
  `;
@@ -40,3 +40,21 @@ mutation updateReminder (
40
40
 
41
41
  ${workflowFragment}
42
42
  `;
43
+
44
+ export const editProgramWorkflowMtn = gql`
45
+ mutation editProgramWorkflow (
46
+ $input: EditProgramWorkflowInput!
47
+ ) {
48
+ editProgramWorkflow (input: $input) {
49
+ ...workflowFragment
50
+ }
51
+ }
52
+
53
+ ${workflowFragment}
54
+ `;
55
+
56
+ export const deleteWorkflowMtn = gql`
57
+ mutation deleteWorkflow($organizationId: GenericID!, $workflowId: GenericID!) {
58
+ deleteWorkflow(organizationId: $organizationId, workflowId: $workflowId)
59
+ }
60
+ `;
@@ -5,12 +5,18 @@ export const agentMemoriesQry = gql`
5
5
  query agentMemories (
6
6
  $organizationId: GenericID!
7
7
  $scope: AgentMemoryScope
8
+ $accountId: GenericID
9
+ $inboundContactId: GenericID
10
+ $surface: AgentMemorySurface
8
11
  $status: AgentMemoryStatus
9
12
  $limit: Int
10
13
  ) {
11
14
  agentMemories (
12
15
  organizationId: $organizationId
13
16
  scope: $scope
17
+ accountId: $accountId
18
+ inboundContactId: $inboundContactId
19
+ surface: $surface
14
20
  status: $status
15
21
  limit: $limit
16
22
  ) {
@@ -0,0 +1,89 @@
1
+ import { gql } from 'graphql-tag';
2
+ import { agentNoteDetailFragment, agentNoteFragment } from '../fragments/agentNoteFragments.ts';
3
+
4
+ export const agentNoteBootstrapProgressQry = gql`
5
+ query agentNoteBootstrapProgress ($organizationId: GenericID!) {
6
+ agentNoteBootstrapProgress (organizationId: $organizationId) {
7
+ outcome
8
+ lastReviewedAt
9
+ nextReviewAt
10
+ }
11
+ }
12
+ `;
13
+
14
+ export const agentNotesRevisionQry = gql`
15
+ query agentNotesRevision ($organizationId: GenericID!) {
16
+ agentNotesRevision (organizationId: $organizationId)
17
+ }
18
+ `;
19
+
20
+ // One complete homepage collection; groups and "show more" are local display state.
21
+ export const agentNotesQry = gql`
22
+ query agentNotes ($organizationId: GenericID!) {
23
+ agentNotes (organizationId: $organizationId) {
24
+ ...agentNoteFragment
25
+ }
26
+ }
27
+
28
+ ${agentNoteFragment}
29
+ `;
30
+
31
+ export const searchAgentNotesQry = gql`
32
+ query searchAgentNotes (
33
+ $organizationId: GenericID!
34
+ $query: String!
35
+ $kinds: [AgentNoteKind!]
36
+ $includeArchived: Boolean
37
+ $limit: Int
38
+ ) {
39
+ searchAgentNotes (
40
+ organizationId: $organizationId
41
+ query: $query
42
+ kinds: $kinds
43
+ includeArchived: $includeArchived
44
+ limit: $limit
45
+ ) {
46
+ items {
47
+ ...agentNoteFragment
48
+ }
49
+ revision
50
+ }
51
+ }
52
+
53
+ ${agentNoteFragment}
54
+ `;
55
+
56
+ export const agentNoteQry = gql`
57
+ query agentNote (
58
+ $organizationId: GenericID!
59
+ $agentNoteId: GenericID!
60
+ ) {
61
+ agentNote (
62
+ organizationId: $organizationId
63
+ agentNoteId: $agentNoteId
64
+ ) {
65
+ ...agentNoteDetailFragment
66
+ }
67
+ }
68
+
69
+ ${agentNoteDetailFragment}
70
+ `;
71
+
72
+ // The organization's focus for one web form template: the starting focus of
73
+ // the note of every campaign created from it afterwards (null when unset)
74
+ export const campaignTemplateAgentNoteFocusQry = gql`
75
+ query campaignTemplateAgentNoteFocus (
76
+ $organizationId: GenericID!
77
+ $campaignTemplateId: GenericID!
78
+ ) {
79
+ campaignTemplateAgentNoteFocus (
80
+ organizationId: $organizationId
81
+ campaignTemplateId: $campaignTemplateId
82
+ ) {
83
+ organizationId
84
+ campaignTemplateId
85
+ focus
86
+ updatedAt
87
+ }
88
+ }
89
+ `;
@@ -1,8 +1,6 @@
1
1
  import { gql } from 'graphql-tag';
2
- import {
3
- aiChatFragment,
4
- aiChatMessageFragment,
5
- } from '../fragments/aiChatFragments.ts';
2
+ import { aiChatFragment, aiChatMessageFragment, aiChatRunFragment } from '../fragments/aiChatFragments.ts';
3
+ import { storageFileFragment } from '../fragments/storageFragments.ts';
6
4
 
7
5
  export const aiChatMetadataQry = gql`
8
6
  query aiChatMetadata (
@@ -13,13 +11,18 @@ query aiChatMetadata (
13
11
  ) {
14
12
  id
15
13
  summary
14
+ latestRun {
15
+ ...aiChatRunFragment
16
+ }
16
17
  }
17
18
  }
19
+ ${aiChatRunFragment}
18
20
  `;
19
21
 
20
22
  export const aiChatQry = gql`
21
23
  query aiChat (
22
24
  $aiChatId: GenericID!
25
+ $includeWork: Boolean! = false
23
26
  $limit: Int
24
27
  ) {
25
28
  aiChat (
@@ -27,10 +30,14 @@ query aiChat (
27
30
  ) {
28
31
  cursor
29
32
  inProgress
33
+ latestRun {
34
+ ...aiChatRunFragment
35
+ }
30
36
  ...aiChatFragment
31
37
 
32
38
  messages (
33
39
  limit: $limit
40
+ includeWork: $includeWork
34
41
  ) {
35
42
  ...aiChatMessageFragment
36
43
  }
@@ -39,11 +46,14 @@ query aiChat (
39
46
 
40
47
  ${aiChatFragment}
41
48
  ${aiChatMessageFragment}
49
+ ${aiChatRunFragment}
50
+ ${storageFileFragment}
42
51
  `;
43
52
 
44
53
  export const aiChatMessagesQry = gql`
45
54
  query aiChatMessages (
46
55
  $aiChatId: GenericID!
56
+ $includeWork: Boolean! = false
47
57
  $cursor: Cursor
48
58
  $after: Boolean!
49
59
  $limit: Int!
@@ -53,12 +63,44 @@ query aiChatMessages (
53
63
  cursor: $cursor
54
64
  after: $after
55
65
  limit: $limit
66
+ includeWork: $includeWork
56
67
  ) {
57
68
  ...aiChatMessageFragment
58
69
  }
59
70
  }
60
71
 
61
72
  ${aiChatMessageFragment}
73
+ ${storageFileFragment}
74
+ `;
75
+
76
+ export const orchestratorArtifactsQry = gql`
77
+ query orchestratorArtifacts (
78
+ $aiChatId: GenericID!
79
+ ) {
80
+ orchestratorArtifacts (
81
+ aiChatId: $aiChatId
82
+ ) {
83
+ aiChatId
84
+ runId
85
+ callId
86
+ organizationId
87
+ toolName
88
+ kind
89
+ action
90
+ sheetId
91
+ sheetTabId
92
+ dataTableId
93
+ fieldDocId
94
+ fieldDocProgramId
95
+ hasDraft
96
+ draftStateAt
97
+ workflowId
98
+ active
99
+ title
100
+ replayed
101
+ at
102
+ }
103
+ }
62
104
  `;
63
105
 
64
106
  export const aiChatsQry = gql`
@@ -83,3 +125,13 @@ query aiChats (
83
125
 
84
126
  ${aiChatFragment}
85
127
  `;
128
+
129
+ export const aiChatWorkMessagesQry = gql`
130
+ query aiChatMessages($aiChatId: GenericID!, $runId: String!, $cursor: Cursor, $after: Boolean!, $limit: Int!) {
131
+ aiChatMessages(aiChatId: $aiChatId, runId: $runId, cursor: $cursor, after: $after, limit: $limit) {
132
+ ...aiChatMessageFragment
133
+ }
134
+ }
135
+ ${aiChatMessageFragment}
136
+ ${storageFileFragment}
137
+ `;
@@ -0,0 +1,128 @@
1
+ import { gql } from 'graphql-tag';
2
+ import {
3
+ audienceEmailAddressFragment,
4
+ audienceEventFragment,
5
+ audienceListFragment,
6
+ audienceListMemberFragment,
7
+ campaignAudienceMemberFragment,
8
+ campaignAudiencePreviewFragment,
9
+ campaignAudienceSessionFragment,
10
+ } from '../fragments/audienceFragments.ts';
11
+
12
+ export const audienceListsQry = gql`
13
+ query audienceLists(
14
+ $organizationId: GenericID!
15
+ $filter: AudienceListsFilter
16
+ $sort: AudienceListsSort
17
+ $cursor: Cursor
18
+ $after: Boolean!
19
+ $limit: Int!
20
+ ) {
21
+ audienceLists(organizationId: $organizationId, filter: $filter, sort: $sort, cursor: $cursor, after: $after, limit: $limit) {
22
+ ...audienceListFragment
23
+ count
24
+ }
25
+ }
26
+ ${audienceListFragment}
27
+ `;
28
+
29
+ export const audienceListQry = gql`
30
+ query audienceList($organizationId: GenericID!, $audienceListId: GenericID!) {
31
+ audienceList(organizationId: $organizationId, audienceListId: $audienceListId) {
32
+ ...audienceListFragment
33
+ }
34
+ }
35
+ ${audienceListFragment}
36
+ `;
37
+
38
+ export const audienceListMembersQry = gql`
39
+ query audienceListMembers(
40
+ $organizationId: GenericID!
41
+ $filter: AudienceListMembersFilter!
42
+ $sort: AudienceListMembersSort
43
+ $cursor: Cursor
44
+ $after: Boolean!
45
+ $limit: Int!
46
+ ) {
47
+ audienceListMembers(organizationId: $organizationId, filter: $filter, sort: $sort, cursor: $cursor, after: $after, limit: $limit) {
48
+ ...audienceListMemberFragment
49
+ address {
50
+ ...audienceEmailAddressFragment
51
+ }
52
+ }
53
+ }
54
+ ${audienceListMemberFragment}
55
+ ${audienceEmailAddressFragment}
56
+ `;
57
+
58
+ export const audienceListOverviewQry = gql`
59
+ query audienceListOverview($organizationId: GenericID!, $audienceListId: GenericID!) {
60
+ audienceListOverview(organizationId: $organizationId, audienceListId: $audienceListId) {
61
+ total
62
+ subscribed
63
+ unsubscribed
64
+ nonSubscribed
65
+ pending
66
+ cleaned
67
+ eligible
68
+ }
69
+ }
70
+ `;
71
+
72
+ export const audienceEmailAddressQry = gql`
73
+ query audienceEmailAddress($organizationId: GenericID!, $emailAddressId: GenericID!) {
74
+ audienceEmailAddress(organizationId: $organizationId, emailAddressId: $emailAddressId) {
75
+ ...audienceEmailAddressFragment
76
+ }
77
+ }
78
+ ${audienceEmailAddressFragment}
79
+ `;
80
+
81
+ export const audienceAddressHistoryQry = gql`
82
+ query audienceAddressHistory($organizationId: GenericID!, $emailAddressId: GenericID!, $afterId: GenericID, $limit: Int) {
83
+ audienceAddressHistory(organizationId: $organizationId, emailAddressId: $emailAddressId, afterId: $afterId, limit: $limit) {
84
+ ...audienceEventFragment
85
+ }
86
+ }
87
+ ${audienceEventFragment}
88
+ `;
89
+
90
+ /*
91
+ * Cache/WS contract: one root carries the campaign-keyed session and preview fragments, written together by
92
+ * this query and by setCampaignAudience, and refreshed by one ALWAYS reset targeting { organizationId, campaignId }.
93
+ */
94
+ export const campaignAudienceQry = gql`
95
+ query campaignAudience($organizationId: GenericID!, $campaignId: GenericID!) {
96
+ campaignAudience(organizationId: $organizationId, campaignId: $campaignId) {
97
+ session { ...campaignAudienceSessionFragment }
98
+ preview { ...campaignAudiencePreviewFragment }
99
+ }
100
+ }
101
+ ${campaignAudienceSessionFragment}
102
+ ${campaignAudiencePreviewFragment}
103
+ `;
104
+
105
+ /*
106
+ * Cache/WS contract: pages of this query are dropped and refetched by RESET_ONLY resets
107
+ * targeting { organizationId, campaignId? }; rows are never patched through fragments.
108
+ */
109
+ export const campaignAudienceMembersQry = gql`
110
+ query campaignAudienceMembers(
111
+ $organizationId: GenericID!
112
+ $campaignId: GenericID!
113
+ $filter: CampaignAudienceMembersFilter
114
+ $sort: CampaignAudienceMembersSort
115
+ $cursor: Cursor
116
+ $after: Boolean!
117
+ $limit: Int!
118
+ ) {
119
+ campaignAudienceMembers(organizationId: $organizationId, campaignId: $campaignId, filter: $filter, sort: $sort, cursor: $cursor, after: $after, limit: $limit) {
120
+ ...campaignAudienceMemberFragment
121
+ address {
122
+ ...audienceEmailAddressFragment
123
+ }
124
+ }
125
+ }
126
+ ${campaignAudienceMemberFragment}
127
+ ${audienceEmailAddressFragment}
128
+ `;
@@ -14,6 +14,12 @@ const ORGANIZATION_AUTHORIZATION_FIELDS = `
14
14
  }
15
15
  `;
16
16
 
17
+ export const agentLoginAvailableQry = gql`
18
+ query agentLoginAvailable {
19
+ agentLoginAvailable
20
+ }
21
+ `;
22
+
17
23
  export const myAccountSessionsQry = gql`
18
24
  query myAccountSessions {
19
25
  myAccountSessions {