@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
@@ -3,78 +3,44 @@
3
3
  *
4
4
  * Each fragment NAME is the realtime contract: the cache keys one of these
5
5
  * spreads as `$<fragmentName>:<id>`, which is byte-identical to what the
6
- * server pushes through FRAGMENT_NAMES.campaignTemplate / campaign /
7
- * campaignTemplateElement. Renaming a fragment here silently stops websocket
8
- * patches from landing on the cached row.
6
+ * server pushes through FRAGMENT_NAMES.campaignTemplate / campaign. Renaming a
7
+ * fragment here silently stops websocket patches from landing on the cached
8
+ * row.
9
9
  */
10
10
 
11
11
  /**
12
- * One element of a template definition. "kind" is the structural role and
13
- * "type" is how a QUESTION is answered; type is null for SECTION and CONTENT.
12
+ * Org-side campaign template core selection. Edit-session queries inline this
13
+ * selection so fragment cache updates cannot pair a newer revision with an
14
+ * older editor definition from the query response.
14
15
  */
15
16
 
16
- export const campaignTemplateElementFragment = `fragment campaignTemplateElementFragment on CampaignElement {
17
- id
18
- parentId
19
- kind
20
- type
21
- key
22
- order
23
- label
24
- description
25
- placeholder
26
- required
27
- options {
28
- value
29
- label
30
- }
31
- validation {
32
- minLength
33
- maxLength
34
- min
35
- max
36
- pattern
37
- maxFiles
38
- acceptedContentTypes
39
- }
40
- visibleWhen {
41
- elementKey
42
- operator
43
- values
44
- }
45
- settings {
46
- numbered
47
- fullWidth
48
- }
49
- files {
50
- id
51
- uri
52
- contentType
53
- }
54
- }`;
55
-
56
- /**
57
- * Org-side reusable campaign template, with its element tree.
58
- */
59
-
60
- export const campaignTemplateFragment = `fragment campaignTemplateFragment on CampaignTemplate {
17
+ export const campaignTemplateFieldsSelection = `
61
18
  id
62
19
  organizationId
20
+ editVersion
63
21
  kind
64
22
  status
65
23
  generationError
66
24
  title
67
25
  description
68
- responseWorkflowId
69
- siteId
70
26
  settings {
71
27
  __typename
72
28
  ... on EmailCampaignSettings {
73
29
  subject
74
- body
75
- bodyHTML
76
- replyToAgentDomain
30
+ preheader
31
+ aiAgentDomain
77
32
  secondaryReplyToEmail
33
+ sendAt
34
+ design {
35
+ canvasColor
36
+ contentColor
37
+ contentWidth
38
+ fontFamily
39
+ textColor
40
+ linkColor
41
+ padding
42
+ }
43
+ trackOpens
78
44
  }
79
45
  ... on FormCampaignSettings {
80
46
  color
@@ -86,14 +52,146 @@ export const campaignTemplateFragment = `fragment campaignTemplateFragment on Ca
86
52
  id
87
53
  uri
88
54
  contentType
55
+ imageData {
56
+ averageColor
57
+ }
89
58
  }
90
- elements {
91
- ...campaignTemplateElementFragment
92
- }
59
+ __deleted: deleted
60
+ archivedAt
93
61
  createdAt
94
- updatedAt
62
+ updatedAt`;
63
+
64
+ /**
65
+ * Reusable normalized campaign template core for non-atomic consumers.
66
+ */
67
+
68
+ export const campaignTemplateFragment = `fragment campaignTemplateFragment on CampaignTemplate {
69
+ ${campaignTemplateFieldsSelection}
95
70
  }`;
96
71
 
72
+ /**
73
+ * Canonical editor fields. CampaignEditor has no id, so this remains a direct
74
+ * reusable selection rather than a fragment/cache identity.
75
+ */
76
+
77
+ export const campaignEditorFieldsSelection = `reservedQuestionKeys
78
+ definition {
79
+ sections {
80
+ key
81
+ order
82
+ label
83
+ description
84
+ settings {
85
+ numbered
86
+ fullWidth
87
+ }
88
+ files {
89
+ id
90
+ order
91
+ uri
92
+ contentType
93
+ size
94
+ name
95
+ }
96
+ elements {
97
+ key
98
+ kind
99
+ type
100
+ order
101
+ label
102
+ description
103
+ placeholder
104
+ options {
105
+ value
106
+ label
107
+ }
108
+ required
109
+ validation {
110
+ minLength
111
+ maxLength
112
+ min
113
+ max
114
+ maxFiles
115
+ acceptedContentTypes
116
+ }
117
+ visibleWhen {
118
+ elementKey
119
+ operator
120
+ values
121
+ }
122
+ settings {
123
+ numbered
124
+ fullWidth
125
+ }
126
+ files {
127
+ id
128
+ order
129
+ uri
130
+ contentType
131
+ size
132
+ name
133
+ }
134
+ }
135
+ }
136
+ }
137
+ emailDefinition {
138
+ schemaVersion
139
+ rows {
140
+ key
141
+ order
142
+ settings {
143
+ backgroundColor
144
+ padding
145
+ }
146
+ columns {
147
+ key
148
+ order
149
+ width
150
+ blocks {
151
+ key
152
+ order
153
+ type
154
+ content {
155
+ text
156
+ richText
157
+ url
158
+ altText
159
+ heading
160
+ headingLevel
161
+ buttonLabel
162
+ buttonUrl
163
+ links {
164
+ label
165
+ url
166
+ }
167
+ }
168
+ settings {
169
+ alignment
170
+ textColor
171
+ backgroundColor
172
+ fontSize
173
+ padding
174
+ height
175
+ buttonStyle
176
+ }
177
+ files {
178
+ id
179
+ order
180
+ uri
181
+ contentType
182
+ size
183
+ name
184
+ imageData {
185
+ width
186
+ height
187
+ }
188
+ }
189
+ }
190
+ }
191
+ }
192
+ }
193
+ `;
194
+
97
195
  /**
98
196
  * Template list row. Deliberately omits the element tree so a list page does
99
197
  * not pull every definition in the organization.
@@ -102,6 +200,8 @@ export const campaignTemplateFragment = `fragment campaignTemplateFragment on Ca
102
200
  export const campaignTemplateSummaryFragment = `fragment campaignTemplateSummaryFragment on CampaignTemplateSummary {
103
201
  id
104
202
  organizationId
203
+ editable
204
+ editVersion
105
205
  kind
106
206
  status
107
207
  generationError
@@ -112,86 +212,75 @@ export const campaignTemplateSummaryFragment = `fragment campaignTemplateSummary
112
212
  uri
113
213
  contentType
114
214
  }
215
+ preview {
216
+ uri
217
+ width
218
+ height
219
+ updatedAt
220
+ }
221
+ __deleted: deleted
222
+ archivedAt
115
223
  createdAt
116
224
  updatedAt
117
225
  cursor
118
226
  }`;
119
227
 
228
+ /*
229
+ * Narrow template lifecycle patch returned by archive operations. It is
230
+ * mapped into campaignTemplateFragment by the cache without pretending that
231
+ * an UPDATE ... RETURNING row contains joined header storage metadata.
232
+ */
233
+ export const campaignTemplateLifecycleFragment = `fragment campaignTemplateLifecycleFragment on CampaignTemplate {
234
+ id
235
+ status
236
+ __deleted: deleted
237
+ archivedAt
238
+ generationError
239
+ updatedAt
240
+ }`;
241
+
120
242
  /**
121
- * One published campaign, including its campaign-owned form definition.
243
+ * Campaign core selection, including unpublished public-form drafts.
244
+ * Edit-session queries inline this selection to keep it atomic with the editor
245
+ * definition returned by the same response.
122
246
  */
123
247
 
124
- export const campaignFragment = `fragment campaignFragment on Campaign {
248
+ export const campaignFieldsSelection = `
125
249
  id
126
250
  organizationId
251
+ editVersion
252
+ publishedEditVersion
127
253
  templateId
128
254
  kind
129
255
  status
256
+ generationStatus
257
+ generationError
258
+ generationProgress
259
+ generationProgressStage
130
260
  publicId
131
261
  audience
262
+ emailRecipientSelectionMode
263
+ audienceFrozenAt
132
264
  title
133
265
  description
134
- definitionSnapshot {
135
- schemaVersion
136
- snapshotSource
137
- sections {
138
- key
139
- order
140
- label
141
- description
142
- settings {
143
- numbered
144
- fullWidth
145
- }
146
- elements {
147
- key
148
- kind
149
- type
150
- order
151
- label
152
- description
153
- placeholder
154
- options {
155
- value
156
- label
157
- }
158
- required
159
- validation {
160
- minLength
161
- maxLength
162
- min
163
- max
164
- pattern
165
- maxFiles
166
- acceptedContentTypes
167
- }
168
- visibleWhen {
169
- elementKey
170
- operator
171
- values
172
- }
173
- settings {
174
- numbered
175
- fullWidth
176
- }
177
- files {
178
- id
179
- order
180
- uri
181
- contentType
182
- size
183
- }
184
- }
185
- }
186
- }
187
266
  settings {
188
267
  __typename
189
268
  ... on EmailCampaignSettings {
190
269
  subject
191
- body
192
- bodyHTML
193
- replyToAgentDomain
270
+ preheader
271
+ aiAgentDomain
194
272
  secondaryReplyToEmail
273
+ sendAt
274
+ design {
275
+ canvasColor
276
+ contentColor
277
+ contentWidth
278
+ fontFamily
279
+ textColor
280
+ linkColor
281
+ padding
282
+ }
283
+ trackOpens
195
284
  }
196
285
  ... on FormCampaignSettings {
197
286
  color
@@ -199,20 +288,132 @@ export const campaignFragment = `fragment campaignFragment on Campaign {
199
288
  confirmationMessage
200
289
  }
201
290
  }
202
- siteId
203
291
  headerImage {
204
292
  id
205
293
  uri
206
294
  contentType
295
+ imageData {
296
+ averageColor
297
+ }
207
298
  }
208
299
  scheduledAt
209
- opensAt
210
300
  closesAt
211
- publishedAt
301
+ startedAt
212
302
  completedAt
213
303
  errorMessage
304
+ __deleted: deleted
305
+ archivedAt
214
306
  isOpen
215
307
  createdAt
308
+ updatedAt`;
309
+
310
+ /**
311
+ * Reusable normalized campaign core for non-atomic consumers.
312
+ */
313
+
314
+ export const campaignFragment = `fragment campaignFragment on Campaign {
315
+ ${campaignFieldsSelection}
316
+ }`;
317
+
318
+ /*
319
+ * Narrow campaign generation lifecycle patch returned by retry operations.
320
+ */
321
+ export const campaignGenerationLifecycleFragment = `fragment campaignGenerationLifecycleFragment on Campaign {
322
+ id
323
+ organizationId
324
+ editVersion
325
+ generationStatus
326
+ generationError
327
+ generationProgress
328
+ generationProgressStage
329
+ updatedAt
330
+ }`;
331
+
332
+ /*
333
+ * Narrow access policy returned after changing one public-form audience.
334
+ */
335
+ export const campaignAccessFragment = `fragment campaignAccessFragment on Campaign {
336
+ id
337
+ organizationId
338
+ editVersion
339
+ publishedEditVersion
340
+ audience
341
+ updatedAt
342
+ }`;
343
+
344
+ /**
345
+ * Lifecycle-only campaign mutation payload. Keeping media and definition fields
346
+ * absent prevents a bare server row from clearing richer cached campaign data.
347
+ */
348
+
349
+ export const campaignLifecycleFragment = `fragment campaignLifecycleFragment on Campaign {
350
+ id
351
+ organizationId
352
+ publishedEditVersion
353
+ status
354
+ publicId
355
+ audience
356
+ emailRecipientSelectionMode
357
+ audienceFrozenAt
358
+ scheduledAt
359
+ closesAt
360
+ startedAt
361
+ completedAt
362
+ errorMessage
363
+ __deleted: deleted
364
+ archivedAt
365
+ isOpen
366
+ updatedAt
367
+ }`;
368
+
369
+ /**
370
+ * Campaign settings mutation payload. It carries the editor revision alongside
371
+ * lifecycle and form appearance fields without returning media or definition data.
372
+ */
373
+
374
+ export const campaignSettingsFragment = `fragment campaignSettingsFragment on Campaign {
375
+ id
376
+ organizationId
377
+ editVersion
378
+ publishedEditVersion
379
+ status
380
+ publicId
381
+ audience
382
+ emailRecipientSelectionMode
383
+ audienceFrozenAt
384
+ settings {
385
+ __typename
386
+ ... on EmailCampaignSettings {
387
+ subject
388
+ preheader
389
+ aiAgentDomain
390
+ secondaryReplyToEmail
391
+ sendAt
392
+ design {
393
+ canvasColor
394
+ contentColor
395
+ contentWidth
396
+ fontFamily
397
+ textColor
398
+ linkColor
399
+ padding
400
+ }
401
+ trackOpens
402
+ }
403
+ ... on FormCampaignSettings {
404
+ color
405
+ backgroundFillStyle
406
+ confirmationMessage
407
+ }
408
+ }
409
+ scheduledAt
410
+ closesAt
411
+ startedAt
412
+ completedAt
413
+ errorMessage
414
+ __deleted: deleted
415
+ archivedAt
416
+ isOpen
216
417
  updatedAt
217
418
  }`;
218
419
 
@@ -221,20 +422,38 @@ export const campaignFragment = `fragment campaignFragment on Campaign {
221
422
  */
222
423
 
223
424
  export const campaignSummaryFragment = `fragment campaignSummaryFragment on CampaignSummary {
425
+ preview { uri width height updatedAt }
224
426
  id
225
427
  organizationId
226
428
  templateId
227
429
  kind
228
430
  status
431
+ generationStatus
432
+ generationError
433
+ generationProgress
434
+ generationProgressStage
229
435
  publicId
230
436
  audience
437
+ emailRecipientSelectionMode
438
+ audienceFrozenAt
439
+ audienceCount
440
+ audiencePreview
231
441
  title
232
- opensAt
442
+ scheduledAt
233
443
  closesAt
234
- publishedAt
444
+ startedAt
235
445
  completedAt
446
+ __deleted: deleted
447
+ archivedAt
448
+ metrics {
449
+ responseCount
450
+ recipientCount
451
+ deliveredCount
452
+ openedCount
453
+ }
236
454
  isOpen
237
455
  createdAt
456
+ updatedAt
238
457
  cursor
239
458
  }`;
240
459
 
@@ -243,21 +462,55 @@ export const campaignSummaryFragment = `fragment campaignSummaryFragment on Camp
243
462
  * of this projection until a response detail surface needs them.
244
463
  */
245
464
 
246
- export const campaignResponseFragment = `fragment campaignResponseFragment on CampaignResponse {
465
+ export const campaignResponseSummaryFragment = `fragment campaignResponseSummaryFragment on CampaignResponseSummary {
466
+ aiAnswersComplete
467
+ aiFinishedAt
247
468
  id
248
469
  cursor
249
470
  campaignId
250
- templateId
251
471
  respondentName
252
472
  respondentEmail
253
473
  childOrgId
254
474
  childOrgName
255
- status
256
475
  submittedAt
257
476
  activityAt
258
477
  createdAt
259
478
  }`;
260
479
 
480
+ /**
481
+ * One complete submitted form response for the organization-side detail modal.
482
+ */
483
+
484
+ export const campaignResponseFragment = `fragment campaignResponseFragment on CampaignResponse {
485
+ aiAnswersComplete
486
+ aiFinishedAt
487
+ id
488
+ campaignId
489
+ campaignTitle
490
+ respondentName
491
+ respondentEmail
492
+ childOrgId
493
+ childOrgName
494
+ childOrgOperation
495
+ answers {
496
+ elementKey
497
+ question
498
+ values
499
+ }
500
+ submittedAt
501
+ activityAt
502
+ createdAt
503
+ }`;
504
+
505
+ /*
506
+ * Aggregate response metrics for one public-form campaign.
507
+ */
508
+ export const campaignResponseOverviewFragment = `fragment campaignResponseOverviewFragment on CampaignResponseOverview {
509
+ id
510
+ submittedCount
511
+ responseRate
512
+ }`;
513
+
261
514
  /**
262
515
  * One email campaign recipient snapshot, as the organization sees it.
263
516
  */
@@ -267,11 +520,47 @@ export const campaignRecipientFragment = `fragment campaignRecipientFragment on
267
520
  cursor
268
521
  campaignId
269
522
  inboundContactId
523
+ emailAddressId
524
+ outboundEmailId
270
525
  emailAddress
271
526
  personName
527
+ deliveryStatus
528
+ sentAt
529
+ deliveredAt
530
+ openedAt
272
531
  invitedAt
273
532
  firstOpenedAt
274
533
  respondedAt
275
- revokedAt
534
+ bouncedAt
535
+ bounceType
536
+ spamComplaintAt
537
+ errorMessage
538
+ suppressionReason
276
539
  createdAt
277
540
  }`;
541
+
542
+ /*
543
+ * Aggregate delivery and engagement metrics for one email campaign.
544
+ */
545
+ export const campaignRecipientOverviewFragment = `fragment campaignRecipientOverviewFragment on CampaignRecipientOverview {
546
+ id
547
+ totalCount
548
+ selectedCount
549
+ queuedCount
550
+ processingCount
551
+ sentCount
552
+ deliveredCount
553
+ openedCount
554
+ respondedCount
555
+ bouncedCount
556
+ spamComplaintCount
557
+ failedCount
558
+ retryableCount
559
+ unknownCount
560
+ suppressedCount
561
+ excludedCount
562
+ audienceLists {
563
+ id
564
+ name
565
+ }
566
+ }`;