@jsb188/graphql 1.1.10 → 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 (176) hide show
  1. package/audience.d.ts +343 -0
  2. package/cache/config.ts +98 -50
  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 +1017 -127
  8. package/cache/index.ts +1256 -1269
  9. package/cache/optimistic-ui-runtime.ts +46 -0
  10. package/cache/optimistic-ui.ts +401 -0
  11. package/cache/persist.ts +800 -0
  12. package/cache/store.ts +395 -0
  13. package/cache/value.helpers.ts +17 -0
  14. package/client/draft-persistence-indexed-db.ts +413 -0
  15. package/client/draft-persistence.ts +152 -0
  16. package/client/index.ts +3 -0
  17. package/client/request.helpers.ts +14 -0
  18. package/client/request.ts +870 -164
  19. package/deno.lock +187 -0
  20. package/deno.test.json +10 -4
  21. package/gql/eagerQueryMap.ts +12 -0
  22. package/gql/fragments/accountAuthFragments.ts +5 -0
  23. package/gql/fragments/accountFragments.ts +0 -3
  24. package/gql/fragments/accountSessionFragments.ts +16 -0
  25. package/gql/fragments/agentMemoryFragments.ts +23 -0
  26. package/gql/fragments/agentNoteFragments.ts +150 -0
  27. package/gql/fragments/aiChatFragments.ts +42 -0
  28. package/gql/fragments/audienceFragments.ts +141 -0
  29. package/gql/fragments/campaignFragments.ts +566 -0
  30. package/gql/fragments/dataTableFragments.ts +50 -192
  31. package/gql/fragments/emailFragments.ts +32 -17
  32. package/gql/fragments/fieldDocFragments.ts +264 -0
  33. package/gql/fragments/inboundContactFragments.ts +2 -0
  34. package/gql/fragments/logFragments.ts +101 -69
  35. package/gql/fragments/organizationFragments.ts +53 -5
  36. package/gql/fragments/qrCodeFragments.ts +29 -0
  37. package/gql/fragments/scheduleFragments.ts +667 -0
  38. package/gql/fragments/sheetFragments.ts +304 -63
  39. package/gql/fragments/storageFragments.ts +45 -0
  40. package/gql/fragments/workflowFragments.ts +41 -5
  41. package/gql/mutations/accountMutations.ts +0 -2
  42. package/gql/mutations/agentMemoryMutations.ts +68 -0
  43. package/gql/mutations/agentNoteMutations.ts +62 -0
  44. package/gql/mutations/aiChatMutations.ts +49 -4
  45. package/gql/mutations/audienceMutations.ts +71 -0
  46. package/gql/mutations/authMutations.ts +203 -18
  47. package/gql/mutations/billingMutations.ts +17 -27
  48. package/gql/mutations/campaignMutations.ts +258 -0
  49. package/gql/mutations/contactMutations.ts +23 -0
  50. package/gql/mutations/dataTableMutations.ts +19 -54
  51. package/gql/mutations/fieldDocMutations.ts +173 -0
  52. package/gql/mutations/index.ts +10 -2
  53. package/gql/mutations/logMutations.ts +6 -29
  54. package/gql/mutations/organizationMutations.ts +19 -4
  55. package/gql/mutations/qrCodeMutations.ts +20 -0
  56. package/gql/mutations/scheduleMutations.ts +1121 -0
  57. package/gql/mutations/sheetMutations.ts +221 -60
  58. package/gql/mutations/storageMutations.ts +19 -0
  59. package/gql/mutations/workflowMutations.ts +60 -0
  60. package/gql/queries/agentMemoryQueries.ts +28 -0
  61. package/gql/queries/agentNoteQueries.ts +89 -0
  62. package/gql/queries/aiChatQueries.ts +70 -2
  63. package/gql/queries/audienceQueries.ts +128 -0
  64. package/gql/queries/authQueries.ts +47 -0
  65. package/gql/queries/billingQueries.ts +118 -6
  66. package/gql/queries/campaignQueries.ts +236 -0
  67. package/gql/queries/dataTableQueries.ts +61 -13
  68. package/gql/queries/emailQueries.ts +26 -17
  69. package/gql/queries/emailReplyReportQueries.ts +76 -0
  70. package/gql/queries/fieldDocQueries.ts +166 -0
  71. package/gql/queries/inboundContactQueries.ts +4 -0
  72. package/gql/queries/index.ts +10 -2
  73. package/gql/queries/logQueries.ts +68 -30
  74. package/gql/queries/organizationQueries.ts +65 -1
  75. package/gql/queries/qrCodeQueries.ts +20 -0
  76. package/gql/queries/scheduleQueries.ts +691 -0
  77. package/gql/queries/sheetQueries.ts +244 -26
  78. package/gql/queries/storageQueries.ts +38 -0
  79. package/gql/queries/workflowQueries.ts +77 -2
  80. package/hooks/index.helpers.test.ts +50 -0
  81. package/hooks/index.helpers.ts +52 -0
  82. package/hooks/index.ts +2254 -982
  83. package/hooks/use-account-mtn.ts +76 -81
  84. package/hooks/use-agentMemory-mtn.ts +71 -0
  85. package/hooks/use-agentMemory-qry.ts +56 -0
  86. package/hooks/use-agentNote-mtn.ts +82 -0
  87. package/hooks/use-agentNote-qry.ts +190 -0
  88. package/hooks/use-agentNote-recovery.helpers.test.ts +68 -0
  89. package/hooks/use-agentNote-recovery.helpers.ts +58 -0
  90. package/hooks/use-agentNote-recovery.ts +72 -0
  91. package/hooks/use-aiChat-mtn.ts +220 -141
  92. package/hooks/use-aiChat-qry.helpers.test.ts +63 -0
  93. package/hooks/use-aiChat-qry.helpers.ts +124 -0
  94. package/hooks/use-aiChat-qry.ts +341 -237
  95. package/hooks/use-aiChat-stream-mtn.ts +14 -0
  96. package/hooks/use-app-qry.ts +12 -9
  97. package/hooks/use-audience-mtn.ts +194 -0
  98. package/hooks/use-audience-qry.helpers.test.ts +80 -0
  99. package/hooks/use-audience-qry.helpers.ts +63 -0
  100. package/hooks/use-audience-qry.ts +330 -0
  101. package/hooks/use-auth-mtn.ts +435 -252
  102. package/hooks/use-auth-qry.ts +51 -0
  103. package/hooks/use-billing-mtn.ts +31 -0
  104. package/hooks/use-billing-qry.ts +76 -0
  105. package/hooks/use-campaign-generation-recovery.ts +53 -0
  106. package/hooks/use-campaign-mtn.ts +436 -0
  107. package/hooks/use-campaign-qry.helpers.ts +40 -0
  108. package/hooks/use-campaign-qry.ts +834 -0
  109. package/hooks/use-dataTable-mtn.ts +37 -46
  110. package/hooks/use-dataTable-qry.ts +102 -128
  111. package/hooks/use-email-qry.helpers.ts +37 -0
  112. package/hooks/use-email-qry.ts +56 -86
  113. package/hooks/use-emailCampaignReplyReport-qry.ts +27 -0
  114. package/hooks/use-fieldDoc-mtn.ts +262 -0
  115. package/hooks/use-fieldDoc-qry.helpers.test.ts +65 -0
  116. package/hooks/use-fieldDoc-qry.helpers.ts +49 -0
  117. package/hooks/use-fieldDoc-qry.ts +212 -0
  118. package/hooks/use-inboundContact-mtn.ts +19 -16
  119. package/hooks/use-inboundContact-qry.ts +62 -56
  120. package/hooks/use-integration-mtn.ts +56 -38
  121. package/hooks/use-integration-qry.ts +24 -9
  122. package/hooks/use-log-mtn.ts +88 -59
  123. package/hooks/use-log-qry.ts +150 -73
  124. package/hooks/use-organization-mtn.ts +334 -277
  125. package/hooks/use-organization-qry.ts +155 -129
  126. package/hooks/use-publicFormEmail-mtn.ts +27 -0
  127. package/hooks/use-qrCode-mtn.ts +40 -0
  128. package/hooks/use-qrCode-qry.ts +78 -0
  129. package/hooks/use-schedule-mtn.ts +589 -0
  130. package/hooks/use-schedule-qry.ts +738 -0
  131. package/hooks/use-schedule-reactive.ts +486 -0
  132. package/hooks/use-sheet-mtn.ts +157 -79
  133. package/hooks/use-sheet-qry.ts +221 -92
  134. package/hooks/use-storage-mtn.ts +81 -41
  135. package/hooks/use-storage-qry.ts +128 -14
  136. package/hooks/use-workflow-mtn.ts +72 -0
  137. package/hooks/use-workflow-qry.ts +184 -47
  138. package/libs/ai-chat-outgoing.helpers.ts +153 -0
  139. package/libs/ai-chat-outgoing.ts +11 -0
  140. package/libs/ai-chat-outgoing.types.ts +25 -0
  141. package/libs/ai-chat-run-realtime.ts +20 -0
  142. package/libs/ai-chat-submission-realtime.ts +150 -0
  143. package/libs/fragment-realtime-sequence.ts +55 -0
  144. package/libs/fragment-recovery.test.ts +326 -0
  145. package/libs/fragment-recovery.ts +325 -0
  146. package/libs/open-sheet.ts +138 -0
  147. package/libs/orchestrator-realtime.helpers.test.ts +229 -0
  148. package/libs/orchestrator-realtime.helpers.ts +317 -0
  149. package/libs/orchestrator-realtime.ts +433 -0
  150. package/libs/request-cache-regression.test.ts +122 -0
  151. package/libs/request-managed-session.test.ts +574 -0
  152. package/libs/request-no-store.test.ts +419 -0
  153. package/libs/sheet-command-batch.ts +44 -0
  154. package/libs/sheet-view-realtime-router.test.ts +214 -0
  155. package/libs/sheet-view-realtime-router.ts +99 -0
  156. package/libs/sse-ticket.test.ts +26 -0
  157. package/loaders/campaign.test.ts +186 -0
  158. package/loaders/campaign.ts +110 -0
  159. package/loaders/emailPreference.ts +75 -0
  160. package/loaders/rest.ts +12 -0
  161. package/package.json +119 -71
  162. package/schedule.d.ts +1790 -0
  163. package/sse.helpers.ts +19 -0
  164. package/sse.ts +70 -106
  165. package/tests/agent-note-detail-cache.test.ts +120 -0
  166. package/tests/agent-note-search.test.ts +444 -0
  167. package/tsconfig.json +11 -10
  168. package/types.d.ts +77 -26
  169. package/utils.ts +78 -49
  170. package/gql/fragments/billingFragments.ts +0 -25
  171. package/gql/fragments/productFragments.ts +0 -39
  172. package/gql/fragments/reportFragments.ts +0 -90
  173. package/gql/queries/productQueries.ts +0 -31
  174. package/gql/queries/reportQueries.ts +0 -134
  175. package/hooks/use-product-qry.ts +0 -67
  176. package/hooks/use-report-qry.ts +0 -153
@@ -1,5 +1,11 @@
1
1
  import { gql } from 'graphql-tag';
2
- import { sheetCellFragment, sheetFragment, sheetRangeFragment, sheetRegionFragment } from '../fragments/sheetFragments.ts';
2
+ import {
3
+ sheetCellFragment,
4
+ sheetFragment,
5
+ sheetTabFragment,
6
+ sheetTabMutationResultFragment,
7
+ sheetViewPatchFragment,
8
+ } from '../fragments/sheetFragments.ts';
3
9
 
4
10
  export const createSheetMtn = gql`
5
11
  mutation createSheet (
@@ -8,7 +14,6 @@ mutation createSheet (
8
14
  $name: String
9
15
  $description: String
10
16
  $position: Float
11
- $design: SheetDesignPatchInput
12
17
  ) {
13
18
  createSheet (
14
19
  organizationId: $organizationId
@@ -16,13 +21,8 @@ mutation createSheet (
16
21
  name: $name
17
22
  description: $description
18
23
  position: $position
19
- design: $design
20
- ) {
21
- ...sheetFragment
22
- }
24
+ )
23
25
  }
24
-
25
- ${sheetFragment}
26
26
  `;
27
27
 
28
28
  export const updateSheetMtn = gql`
@@ -33,8 +33,6 @@ mutation updateSheet (
33
33
  $name: String
34
34
  $description: String
35
35
  $position: Float
36
- $design: SheetDesignPatchInput
37
- $active: Boolean
38
36
  ) {
39
37
  updateSheet (
40
38
  organizationId: $organizationId
@@ -43,8 +41,6 @@ mutation updateSheet (
43
41
  name: $name
44
42
  description: $description
45
43
  position: $position
46
- design: $design
47
- active: $active
48
44
  ) {
49
45
  ...sheetFragment
50
46
  }
@@ -53,116 +49,281 @@ mutation updateSheet (
53
49
  ${sheetFragment}
54
50
  `;
55
51
 
56
- export const editSheetCellsMtn = gql`
57
- mutation editSheetCells (
52
+ export const deleteSheetMtn = gql`
53
+ mutation deleteSheet (
58
54
  $organizationId: GenericID!
59
55
  $sheetId: GenericID!
60
- $cells: [SheetCellEditInput!]!
61
56
  ) {
62
- editSheetCells (
57
+ deleteSheet (
63
58
  organizationId: $organizationId
64
59
  sheetId: $sheetId
65
- cells: $cells
60
+ )
61
+ }
62
+ `;
63
+
64
+ export const updateSheetAccessMtn = gql`
65
+ mutation updateSheetAccess (
66
+ $organizationId: GenericID!
67
+ $sheetId: GenericID!
68
+ $access: DocAccessInput!
69
+ ) {
70
+ updateSheetAccess (
71
+ organizationId: $organizationId
72
+ sheetId: $sheetId
73
+ access: $access
66
74
  ) {
67
- ...sheetCellFragment
75
+ ...sheetFragment
68
76
  }
69
77
  }
70
78
 
71
- ${sheetCellFragment}
79
+ ${sheetFragment}
72
80
  `;
73
81
 
74
- export const clearSheetCellMtn = gql`
75
- mutation clearSheetCell (
82
+ export const createSheetTabMtn = gql`
83
+ mutation createSheetTab (
76
84
  $organizationId: GenericID!
77
85
  $sheetId: GenericID!
78
- $rowIndex: Int!
79
- $columnIndex: Int!
86
+ $commandId: String!
87
+ $sessionId: String!
80
88
  ) {
81
- clearSheetCell (
89
+ createSheetTab (
82
90
  organizationId: $organizationId
83
91
  sheetId: $sheetId
84
- rowIndex: $rowIndex
85
- columnIndex: $columnIndex
92
+ commandId: $commandId
93
+ sessionId: $sessionId
86
94
  ) {
87
- ...sheetCellFragment
95
+ ...sheetTabMutationResultFragment
88
96
  }
89
97
  }
90
98
 
91
- ${sheetCellFragment}
99
+ ${sheetTabMutationResultFragment}
92
100
  `;
93
101
 
94
- export const upsertSheetRangeMtn = gql`
95
- mutation upsertSheetRange (
102
+ export const importSheetFromFileMtn = gql`
103
+ mutation importSheetFromFile (
104
+ $organizationId: GenericID!
105
+ $fileUri: String!
106
+ $mode: SheetImportMode!
107
+ $sheetId: GenericID
108
+ $title: String
109
+ ) {
110
+ importSheetFromFile (
111
+ organizationId: $organizationId
112
+ fileUri: $fileUri
113
+ mode: $mode
114
+ sheetId: $sheetId
115
+ title: $title
116
+ ) {
117
+ id
118
+ status
119
+ mode
120
+ sheetId
121
+ errorCode
122
+ uncomputedFormulaCells
123
+ }
124
+ }
125
+ `;
126
+
127
+ export const exportSheetToFileMtn = gql`
128
+ mutation exportSheetToFile (
96
129
  $organizationId: GenericID!
97
130
  $sheetId: GenericID!
98
- $rangeId: GenericID
99
- $range: SheetRangeInput!
131
+ $sheetTabId: GenericID
132
+ $format: SheetExportFormat!
100
133
  ) {
101
- upsertSheetRange (
134
+ exportSheetToFile (
102
135
  organizationId: $organizationId
103
136
  sheetId: $sheetId
104
- rangeId: $rangeId
105
- range: $range
137
+ sheetTabId: $sheetTabId
138
+ format: $format
106
139
  ) {
107
- ...sheetRangeFragment
140
+ fileUri
141
+ name
142
+ contentType
143
+ size
108
144
  }
109
145
  }
146
+ `;
110
147
 
111
- ${sheetRangeFragment}
148
+ export const updateSheetTabMtn = gql`
149
+ mutation updateSheetTab (
150
+ $organizationId: GenericID!
151
+ $sheetId: GenericID!
152
+ $sheetTabId: GenericID!
153
+ $name: String
154
+ $commandId: String!
155
+ $sessionId: String!
156
+ ) {
157
+ updateSheetTab (
158
+ organizationId: $organizationId
159
+ sheetId: $sheetId
160
+ sheetTabId: $sheetTabId
161
+ name: $name
162
+ commandId: $commandId
163
+ sessionId: $sessionId
164
+ ) {
165
+ ...sheetTabMutationResultFragment
166
+ }
167
+ }
168
+
169
+ ${sheetTabMutationResultFragment}
112
170
  `;
113
171
 
114
- export const deleteSheetRangeMtn = gql`
115
- mutation deleteSheetRange (
172
+ export const setSheetTabHiddenMtn = gql`
173
+ mutation setSheetTabHidden (
116
174
  $organizationId: GenericID!
117
175
  $sheetId: GenericID!
118
- $rangeId: GenericID!
176
+ $sheetTabId: GenericID!
177
+ $hidden: Boolean!
178
+ $commandId: String!
179
+ $sessionId: String!
119
180
  ) {
120
- deleteSheetRange (
181
+ setSheetTabHidden (
121
182
  organizationId: $organizationId
122
183
  sheetId: $sheetId
123
- rangeId: $rangeId
184
+ sheetTabId: $sheetTabId
185
+ hidden: $hidden
186
+ commandId: $commandId
187
+ sessionId: $sessionId
124
188
  ) {
125
- ...sheetRangeFragment
189
+ ...sheetTabMutationResultFragment
126
190
  }
127
191
  }
128
192
 
129
- ${sheetRangeFragment}
193
+ ${sheetTabMutationResultFragment}
130
194
  `;
131
195
 
132
- export const upsertSheetDataTableRegionMtn = gql`
133
- mutation upsertSheetDataTableRegion (
196
+ export const reorderSheetTabsMtn = gql`
197
+ mutation reorderSheetTabs (
134
198
  $organizationId: GenericID!
135
199
  $sheetId: GenericID!
136
- $regionId: GenericID
137
- $region: SheetRegionInput!
200
+ $positions: [SheetTabPositionInput!]!
201
+ $commandId: String!
202
+ $sessionId: String!
138
203
  ) {
139
- upsertSheetDataTableRegion (
204
+ reorderSheetTabs (
140
205
  organizationId: $organizationId
141
206
  sheetId: $sheetId
142
- regionId: $regionId
143
- region: $region
207
+ positions: $positions
208
+ commandId: $commandId
209
+ sessionId: $sessionId
144
210
  ) {
145
- ...sheetRegionFragment
211
+ ...sheetTabMutationResultFragment
146
212
  }
147
213
  }
148
214
 
149
- ${sheetRegionFragment}
215
+ ${sheetTabMutationResultFragment}
150
216
  `;
151
217
 
152
- export const deleteSheetRegionMtn = gql`
153
- mutation deleteSheetRegion (
218
+ export const deleteSheetTabMtn = gql`
219
+ mutation deleteSheetTab (
154
220
  $organizationId: GenericID!
155
221
  $sheetId: GenericID!
156
- $regionId: GenericID!
222
+ $sheetTabId: GenericID!
223
+ $commandId: String!
224
+ $sessionId: String!
157
225
  ) {
158
- deleteSheetRegion (
226
+ deleteSheetTab (
159
227
  organizationId: $organizationId
160
228
  sheetId: $sheetId
161
- regionId: $regionId
229
+ sheetTabId: $sheetTabId
230
+ commandId: $commandId
231
+ sessionId: $sessionId
162
232
  ) {
163
- ...sheetRegionFragment
233
+ ...sheetTabMutationResultFragment
164
234
  }
165
235
  }
166
236
 
167
- ${sheetRegionFragment}
237
+ ${sheetTabMutationResultFragment}
238
+ `;
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
+
245
+ export const editSheetCommandBatchMtn = gql`
246
+ mutation editSheetCommandBatch (
247
+ $contractVersion: Int!
248
+ $organizationId: GenericID!
249
+ $sheetId: GenericID!
250
+ $envelopeId: String!
251
+ $clientId: String!
252
+ $sessionId: String!
253
+ $clientSeq: Int!
254
+ $commands: [SheetCommandInput!]!
255
+ ) {
256
+ editSheetCommandBatch (
257
+ contractVersion: $contractVersion
258
+ organizationId: $organizationId
259
+ sheetId: $sheetId
260
+ envelopeId: $envelopeId
261
+ clientId: $clientId
262
+ sessionId: $sessionId
263
+ clientSeq: $clientSeq
264
+ commands: $commands
265
+ ) {
266
+ actorAccountId
267
+ envelopeId
268
+ clientId
269
+ clientSeq
270
+ replayed
271
+ committedCommandIds
272
+ noWriteCommandIds
273
+
274
+ settlements {
275
+ commandId
276
+ errorCode
277
+
278
+ result {
279
+ commandId
280
+ commandStatus
281
+ replayed
282
+ requiresSnapshot
283
+ undoRecorded
284
+ axisMoveOps {
285
+ schemaVersion
286
+ commandId
287
+ sheetTabId
288
+ axis
289
+ sourceStartIndex
290
+ sourceEndIndex
291
+ targetStartIndex
292
+ baseRevision
293
+ resultRevision
294
+ baseDesignRevision
295
+ resultDesignRevision
296
+ }
297
+
298
+ tabRevisions {
299
+ sheetTabId
300
+ baseRevision
301
+ resultRevision
302
+ baseDesignRevision
303
+ resultDesignRevision
304
+ journalFromSeq
305
+ journalToSeq
306
+ }
307
+
308
+ conflict {
309
+ code
310
+ message
311
+ historyBoundary
312
+ invalidatesTargetCommandId
313
+ targetType
314
+ targetKey
315
+ }
316
+
317
+ }
318
+ }
319
+
320
+ authoritativePatches {
321
+ ...sheetViewPatchFragment
322
+ }
323
+ }
324
+ }
325
+
326
+ ${sheetViewPatchFragment}
327
+ ${sheetCellFragment}
328
+ ${sheetTabFragment}
168
329
  `;
@@ -7,6 +7,7 @@ mutation createSignedUploadUrl (
7
7
  $contentType: String!
8
8
  $fileSize: Int!
9
9
  $uploadIntent: StorageIntentObject!
10
+ $moderationToken: String
10
11
  ) {
11
12
  createSignedUploadUrl (
12
13
  organizationId: $organizationId
@@ -14,10 +15,13 @@ mutation createSignedUploadUrl (
14
15
  contentType: $contentType
15
16
  fileSize: $fileSize
16
17
  uploadIntent: $uploadIntent
18
+ moderationToken: $moderationToken
17
19
  ) {
18
20
  id
19
21
  signedUrl
20
22
  fileUri
23
+ contentCrc32c
24
+ contentSha256
21
25
  }
22
26
  }
23
27
  `;
@@ -33,3 +37,18 @@ mutation deleteStorageFile (
33
37
  )
34
38
  }
35
39
  `;
40
+
41
+ export const createGeneratedFileDownloadLinkMtn = gql`
42
+ mutation createGeneratedFileDownloadLink (
43
+ $organizationId: GenericID!
44
+ $code: String!
45
+ ) {
46
+ createGeneratedFileDownloadLink (
47
+ organizationId: $organizationId
48
+ code: $code
49
+ ) {
50
+ url
51
+ expiresAt
52
+ }
53
+ }
54
+ `;
@@ -0,0 +1,60 @@
1
+ import { gql } from 'graphql-tag';
2
+ import { workflowFragment } from '../fragments/workflowFragments.ts';
3
+
4
+ export const cancelReminderMtn = gql`
5
+ mutation cancelReminder (
6
+ $organizationId: GenericID!
7
+ $workflowId: GenericID!
8
+ ) {
9
+ cancelReminder (
10
+ organizationId: $organizationId
11
+ workflowId: $workflowId
12
+ ) {
13
+ ...workflowFragment
14
+ }
15
+ }
16
+
17
+ ${workflowFragment}
18
+ `;
19
+
20
+ export const updateReminderMtn = gql`
21
+ mutation updateReminder (
22
+ $organizationId: GenericID!
23
+ $workflowId: GenericID!
24
+ $title: String
25
+ $schedule: String
26
+ $scheduleInterval: Int
27
+ $nextAt: DateTime
28
+ ) {
29
+ updateReminder (
30
+ organizationId: $organizationId
31
+ workflowId: $workflowId
32
+ title: $title
33
+ schedule: $schedule
34
+ scheduleInterval: $scheduleInterval
35
+ nextAt: $nextAt
36
+ ) {
37
+ ...workflowFragment
38
+ }
39
+ }
40
+
41
+ ${workflowFragment}
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
+ `;
@@ -0,0 +1,28 @@
1
+ import { gql } from 'graphql-tag';
2
+ import { agentMemoryFragment } from '../fragments/agentMemoryFragments.ts';
3
+
4
+ export const agentMemoriesQry = gql`
5
+ query agentMemories (
6
+ $organizationId: GenericID!
7
+ $scope: AgentMemoryScope
8
+ $accountId: GenericID
9
+ $inboundContactId: GenericID
10
+ $surface: AgentMemorySurface
11
+ $status: AgentMemoryStatus
12
+ $limit: Int
13
+ ) {
14
+ agentMemories (
15
+ organizationId: $organizationId
16
+ scope: $scope
17
+ accountId: $accountId
18
+ inboundContactId: $inboundContactId
19
+ surface: $surface
20
+ status: $status
21
+ limit: $limit
22
+ ) {
23
+ ...agentMemoryFragment
24
+ }
25
+ }
26
+
27
+ ${agentMemoryFragment}
28
+ `;
@@ -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,9 +1,28 @@
1
1
  import { gql } from 'graphql-tag';
2
- import { aiChatFragment, aiChatMessageFragment } from '../fragments/aiChatFragments.ts';
2
+ import { aiChatFragment, aiChatMessageFragment, aiChatRunFragment } from '../fragments/aiChatFragments.ts';
3
+ import { storageFileFragment } from '../fragments/storageFragments.ts';
4
+
5
+ export const aiChatMetadataQry = gql`
6
+ query aiChatMetadata (
7
+ $aiChatId: GenericID!
8
+ ) {
9
+ aiChatMetadata (
10
+ aiChatId: $aiChatId
11
+ ) {
12
+ id
13
+ summary
14
+ latestRun {
15
+ ...aiChatRunFragment
16
+ }
17
+ }
18
+ }
19
+ ${aiChatRunFragment}
20
+ `;
3
21
 
4
22
  export const aiChatQry = gql`
5
23
  query aiChat (
6
24
  $aiChatId: GenericID!
25
+ $includeWork: Boolean! = false
7
26
  $limit: Int
8
27
  ) {
9
28
  aiChat (
@@ -11,10 +30,14 @@ query aiChat (
11
30
  ) {
12
31
  cursor
13
32
  inProgress
33
+ latestRun {
34
+ ...aiChatRunFragment
35
+ }
14
36
  ...aiChatFragment
15
37
 
16
38
  messages (
17
39
  limit: $limit
40
+ includeWork: $includeWork
18
41
  ) {
19
42
  ...aiChatMessageFragment
20
43
  }
@@ -23,11 +46,14 @@ query aiChat (
23
46
 
24
47
  ${aiChatFragment}
25
48
  ${aiChatMessageFragment}
49
+ ${aiChatRunFragment}
50
+ ${storageFileFragment}
26
51
  `;
27
52
 
28
53
  export const aiChatMessagesQry = gql`
29
54
  query aiChatMessages (
30
55
  $aiChatId: GenericID!
56
+ $includeWork: Boolean! = false
31
57
  $cursor: Cursor
32
58
  $after: Boolean!
33
59
  $limit: Int!
@@ -37,17 +63,49 @@ query aiChatMessages (
37
63
  cursor: $cursor
38
64
  after: $after
39
65
  limit: $limit
66
+ includeWork: $includeWork
40
67
  ) {
41
68
  ...aiChatMessageFragment
42
69
  }
43
70
  }
44
71
 
45
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
+ }
46
104
  `;
47
105
 
48
106
  export const aiChatsQry = gql`
49
107
  query aiChats (
50
- $organizationId: GenericID!
108
+ $organizationId: GenericID
51
109
  $filter: AIChatsFilter
52
110
  $cursor: Cursor
53
111
  $after: Boolean!
@@ -67,3 +125,13 @@ query aiChats (
67
125
 
68
126
  ${aiChatFragment}
69
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
+ `;