@jsb188/graphql 1.1.12 → 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/LICENSE +21 -0
  2. package/audience.d.ts +14 -152
  3. package/cache/config.ts +35 -32
  4. package/cache/index.helpers.ts +1 -1
  5. package/cache/index.ts +73 -44
  6. package/cache/mounted-queries.ts +33 -0
  7. package/cache/persist.ts +10 -4
  8. package/cache/realtime-fence.ts +47 -0
  9. package/cache/realtime-live.ts +17 -0
  10. package/client/draft-persistence.ts +10 -39
  11. package/client/index.ts +2 -1
  12. package/client/request.ts +9 -34
  13. package/client/storage-asset.ts +58 -0
  14. package/gql/fragments/accountAuthFragments.ts +0 -4
  15. package/gql/fragments/agentNoteFragments.ts +8 -2
  16. package/gql/fragments/aiChatFragments.ts +0 -2
  17. package/gql/fragments/aiChatLinkFragments.ts +8 -0
  18. package/gql/fragments/audienceFragments.ts +1 -66
  19. package/gql/fragments/emailFragments.ts +27 -4
  20. package/gql/fragments/emailOutreachFragments.ts +281 -0
  21. package/gql/fragments/inboundContactFragments.ts +1 -1
  22. package/gql/fragments/libraryFragments.ts +120 -0
  23. package/gql/fragments/organizationFragments.ts +4 -2
  24. package/gql/fragments/scheduleFragments.ts +241 -324
  25. package/gql/fragments/sheetFragments.ts +4 -53
  26. package/gql/fragments/workWaitFragments.ts +13 -0
  27. package/gql/fragments/workflowFragments.ts +20 -4
  28. package/gql/mutations/agentNoteMutations.ts +2 -0
  29. package/gql/mutations/aiChatLinkMutations.ts +13 -0
  30. package/gql/mutations/aiChatMutations.ts +4 -6
  31. package/gql/mutations/audienceMutations.ts +0 -13
  32. package/gql/mutations/authMutations.ts +12 -60
  33. package/gql/mutations/emailMutations.ts +22 -0
  34. package/gql/mutations/emailOutreachMutations.ts +139 -0
  35. package/gql/mutations/index.ts +3 -1
  36. package/gql/mutations/organizationMutations.ts +2 -2
  37. package/gql/mutations/scheduleMutations.ts +61 -787
  38. package/gql/mutations/storageMutations.ts +1 -0
  39. package/gql/mutations/workflowMutations.ts +76 -0
  40. package/gql/queries/agentMemoryQueries.ts +6 -2
  41. package/gql/queries/agentNoteQueries.ts +26 -29
  42. package/gql/queries/aiChatQueries.ts +39 -40
  43. package/gql/queries/audienceQueries.ts +31 -55
  44. package/gql/queries/authQueries.ts +16 -6
  45. package/gql/queries/billingQueries.ts +26 -10
  46. package/gql/queries/dataTableQueries.ts +24 -15
  47. package/gql/queries/emailOutreachQueries.ts +282 -0
  48. package/gql/queries/emailQueries.ts +39 -12
  49. package/gql/queries/emailReplyReportQueries.ts +60 -9
  50. package/gql/queries/fieldDocQueries.ts +36 -14
  51. package/gql/queries/inboundContactQueries.ts +11 -4
  52. package/gql/queries/index.ts +2 -2
  53. package/gql/queries/libraryQueries.ts +112 -0
  54. package/gql/queries/logQueries.ts +31 -12
  55. package/gql/queries/organizationQueries.ts +31 -12
  56. package/gql/queries/qrCodeQueries.ts +11 -4
  57. package/gql/queries/scheduleQueries.ts +252 -505
  58. package/gql/queries/sheetQueries.ts +36 -14
  59. package/gql/queries/storageQueries.ts +11 -4
  60. package/gql/queries/workflowQueries.ts +53 -10
  61. package/gql/reactivity.ts +98 -0
  62. package/gql/recordReads.ts +171 -0
  63. package/hooks/index.ts +79 -52
  64. package/hooks/use-agentNote-mtn.ts +7 -0
  65. package/hooks/use-agentNote-qry.ts +30 -58
  66. package/hooks/use-agentNote-recovery.ts +6 -21
  67. package/hooks/use-aiChat-mtn.ts +9 -4
  68. package/hooks/use-aiChat-qry.ts +28 -7
  69. package/hooks/use-audience-mtn.ts +0 -24
  70. package/hooks/use-audience-qry.helpers.ts +0 -24
  71. package/hooks/use-audience-qry.ts +1 -86
  72. package/hooks/use-dataTable-mtn.ts +3 -3
  73. package/hooks/use-dataTable-qry.ts +7 -2
  74. package/hooks/use-email-mtn.ts +26 -0
  75. package/hooks/use-email-qry.helpers.ts +1 -1
  76. package/hooks/use-email-qry.ts +18 -3
  77. package/hooks/use-emailOutreach-mtn.ts +211 -0
  78. package/hooks/use-emailOutreach-qry.helpers.ts +25 -0
  79. package/hooks/use-emailOutreach-qry.ts +367 -0
  80. package/hooks/use-emailOutreachReplyReport-qry.ts +46 -0
  81. package/hooks/use-fieldDoc-qry.ts +1 -1
  82. package/hooks/use-library-qry.ts +233 -0
  83. package/hooks/use-qrCode-qry.ts +1 -1
  84. package/hooks/use-schedule-mtn.ts +10 -300
  85. package/hooks/use-schedule-qry.ts +168 -680
  86. package/hooks/use-schedule-reactive.ts +71 -339
  87. package/hooks/use-sheet-qry.ts +6 -1
  88. package/hooks/use-workflow-mtn.ts +45 -1
  89. package/hooks/use-workflow-qry.ts +22 -2
  90. package/libs/ai-chat-link-events.ts +78 -0
  91. package/libs/data-changes.helpers.ts +161 -0
  92. package/libs/data-changes.ts +382 -0
  93. package/libs/fragment-realtime-sequence.ts +3 -3
  94. package/libs/record-read.ts +327 -0
  95. package/libs/sheet-command-batch.ts +3 -2
  96. package/libs/sheet-realtime-packet.ts +53 -0
  97. package/loaders/emailPreference.ts +18 -24
  98. package/package.json +44 -17
  99. package/schedule.d.ts +267 -874
  100. package/types.d.ts +3 -1
  101. package/cache/index.chat-activity.test.ts +0 -119
  102. package/cache/index.chat.test.ts +0 -92
  103. package/cache/index.regression.test.ts +0 -149
  104. package/cache/index.test.ts +0 -1209
  105. package/deno.lock +0 -187
  106. package/deno.test.json +0 -12
  107. package/gql/fragments/campaignFragments.ts +0 -566
  108. package/gql/mutations/campaignMutations.ts +0 -258
  109. package/gql/queries/appQueries.ts +0 -14
  110. package/gql/queries/campaignQueries.ts +0 -236
  111. package/hooks/index.helpers.test.ts +0 -50
  112. package/hooks/use-agentNote-recovery.helpers.test.ts +0 -68
  113. package/hooks/use-aiChat-qry.helpers.test.ts +0 -63
  114. package/hooks/use-app-qry.ts +0 -22
  115. package/hooks/use-audience-qry.helpers.test.ts +0 -80
  116. package/hooks/use-campaign-generation-recovery.ts +0 -53
  117. package/hooks/use-campaign-mtn.ts +0 -436
  118. package/hooks/use-campaign-qry.helpers.ts +0 -40
  119. package/hooks/use-campaign-qry.ts +0 -834
  120. package/hooks/use-emailCampaignReplyReport-qry.ts +0 -27
  121. package/hooks/use-fieldDoc-qry.helpers.test.ts +0 -65
  122. package/hooks/use-publicFormEmail-mtn.ts +0 -27
  123. package/libs/fragment-recovery.test.ts +0 -326
  124. package/libs/fragment-recovery.ts +0 -325
  125. package/libs/orchestrator-realtime.helpers.test.ts +0 -229
  126. package/libs/orchestrator-realtime.helpers.ts +0 -317
  127. package/libs/orchestrator-realtime.ts +0 -433
  128. package/libs/request-cache-regression.test.ts +0 -122
  129. package/libs/request-managed-session.test.ts +0 -574
  130. package/libs/request-no-store.test.ts +0 -419
  131. package/libs/sheet-view-realtime-router.test.ts +0 -214
  132. package/libs/sse-ticket.test.ts +0 -26
  133. package/loaders/campaign.test.ts +0 -186
  134. package/loaders/campaign.ts +0 -110
  135. package/tests/agent-note-detail-cache.test.ts +0 -120
  136. package/tests/agent-note-search.test.ts +0 -444
  137. package/tsconfig.json +0 -13
@@ -0,0 +1,281 @@
1
+ /*
2
+ * Email outreach fragments.
3
+ *
4
+ * Each fragment NAME is the realtime contract: the cache keys a spread as
5
+ * `$<fragmentName>:<id>`, which is byte-identical to what the server pushes
6
+ * through FRAGMENT_NAMES.emailOutreach / emailOutreachRecipient. Renaming a
7
+ * fragment here silently stops websocket patches from landing on cached rows.
8
+ */
9
+
10
+ /*
11
+ * The complete outreach record, shared by the detail query and every safety-valve
12
+ * mutation response. It spreads workWaitItemFragment (waitingFor), so every
13
+ * document that includes it appends that fragment's text too.
14
+ */
15
+ export const emailOutreachFragment = `fragment emailOutreachFragment on EmailOutreach {
16
+ id
17
+ organizationId
18
+ status
19
+ editVersion
20
+ deliveryVersion
21
+ title
22
+ contentFormat
23
+ subject
24
+ preheader
25
+ bodyText
26
+ definition {
27
+ schemaVersion
28
+ rows {
29
+ key
30
+ order
31
+ settings {
32
+ backgroundColor
33
+ padding
34
+ }
35
+ columns {
36
+ key
37
+ order
38
+ width
39
+ blocks {
40
+ key
41
+ order
42
+ type
43
+ content {
44
+ text
45
+ richText
46
+ url
47
+ altText
48
+ heading
49
+ headingLevel
50
+ buttonLabel
51
+ buttonUrl
52
+ links {
53
+ label
54
+ url
55
+ }
56
+ }
57
+ settings {
58
+ alignment
59
+ textColor
60
+ backgroundColor
61
+ fontSize
62
+ padding
63
+ height
64
+ buttonStyle
65
+ }
66
+ files {
67
+ id
68
+ order
69
+ uri
70
+ contentType
71
+ size
72
+ name
73
+ imageData {
74
+ width
75
+ height
76
+ }
77
+ }
78
+ }
79
+ }
80
+ }
81
+ }
82
+ design {
83
+ canvasColor
84
+ contentColor
85
+ contentWidth
86
+ fontFamily
87
+ textColor
88
+ linkColor
89
+ padding
90
+ }
91
+ trackOpens
92
+ recipientSource
93
+ exclusions {
94
+ emailAddressIds
95
+ organizationIds
96
+ emails
97
+ }
98
+ audienceListId
99
+ audienceListName
100
+ audienceFrozenAt
101
+ replyToSenders
102
+ replyInstructions
103
+ secondaryReplyToEmail
104
+ agentNoteDisabled
105
+ agentNoteInstructions
106
+ previewedAt
107
+ previewedEditVersion
108
+ previewUrl
109
+ approvedAt
110
+ approvedEditVersion
111
+ approvedBy {
112
+ id
113
+ name
114
+ }
115
+ approvedByAccountId
116
+ createdByAccountId
117
+ aiChatId
118
+ clonedFromId
119
+ followUpOfEmailOutreachId
120
+ reportIntoEmailOutreachId
121
+ waitingFor {
122
+ ...workWaitItemFragment
123
+ }
124
+ scheduledAt
125
+ startedAt
126
+ completedAt
127
+ errorMessage
128
+ sendInfo {
129
+ senderAddress
130
+ replyAddress
131
+ timeZone
132
+ replyDomain
133
+ }
134
+ __deleted: deleted
135
+ archivedAt
136
+ createdAt
137
+ updatedAt
138
+ }`;
139
+
140
+ /*
141
+ * Outreach list row. PARTIALS_MAP stores it under the emailOutreachFragment
142
+ * identity, so realtime lifecycle patches update list and detail consumers alike.
143
+ * It omits content and reply instructions.
144
+ */
145
+ export const emailOutreachSummaryFragment = `fragment emailOutreachSummaryFragment on EmailOutreachSummary {
146
+ id
147
+ organizationId
148
+ status
149
+ deliveryVersion
150
+ title
151
+ contentFormat
152
+ subject
153
+ recipientSource
154
+ audienceListId
155
+ audienceListName
156
+ audienceFrozenAt
157
+ createdByAccountId
158
+ scheduledAt
159
+ startedAt
160
+ completedAt
161
+ errorMessage
162
+ __deleted: deleted
163
+ archivedAt
164
+ metrics {
165
+ recipientCount
166
+ deliveredCount
167
+ openedCount
168
+ respondedCount
169
+ }
170
+ createdAt
171
+ updatedAt
172
+ cursor
173
+ }`;
174
+
175
+ /*
176
+ * One entry of an outreach's append-only progress history (newest first).
177
+ */
178
+ export const emailOutreachEventFragment = `fragment emailOutreachEventFragment on EmailOutreachEvent {
179
+ id
180
+ emailOutreachId
181
+ event
182
+ source
183
+ editVersion
184
+ accountId
185
+ summary
186
+ createdAt
187
+ }`;
188
+
189
+ /* Share current draft audience counts and sending limits across the editor and confirmation screen. */
190
+ export const emailOutreachAudiencePreviewFragment = `fragment emailOutreachAudiencePreviewFragment on EmailOutreachAudiencePreview {
191
+ id
192
+ emailOutreachId
193
+ editVersion
194
+ selectedCount
195
+ eligibleCount
196
+ duplicateCount
197
+ excludedCount
198
+ exclusions { reason count }
199
+ frozenRecipientCount
200
+ sendLimits { recipientLimit monthlyRecipientLimit monthlyRecipientsRemaining sendingPaused }
201
+ }`;
202
+
203
+ /* Share candidate identities and memberships; operations add the canonical nested address fragment beside this spread. */
204
+ export const emailOutreachAudienceMemberFragment = `fragment emailOutreachAudienceMemberFragment on EmailOutreachAudienceMember {
205
+ id
206
+ cursor
207
+ organizationId
208
+ emailOutreachId
209
+ recipientSource
210
+ emailAddressId
211
+ normalizedEmail
212
+ personName
213
+ inboundContactId
214
+ childOrganizationId
215
+ organizationName
216
+ contactId
217
+ reason
218
+ memberships {
219
+ memberId
220
+ audienceListId
221
+ listName
222
+ personName
223
+ subscriptionStatus
224
+ subscriptionVersion
225
+ removedAt
226
+ }
227
+ }`;
228
+
229
+ /*
230
+ * One frozen outreach recipient with its newest delivery outcome.
231
+ */
232
+ export const emailOutreachRecipientFragment = `fragment emailOutreachRecipientFragment on EmailOutreachRecipient {
233
+ id
234
+ cursor
235
+ emailOutreachId
236
+ inboundContactId
237
+ emailAddressId
238
+ outboundEmailId
239
+ emailAddress
240
+ personName
241
+ deliveryStatus
242
+ sentAt
243
+ deliveredAt
244
+ openedAt
245
+ invitedAt
246
+ firstOpenedAt
247
+ respondedAt
248
+ bouncedAt
249
+ bounceType
250
+ spamComplaintAt
251
+ errorMessage
252
+ suppressionReason
253
+ createdAt
254
+ }`;
255
+
256
+ /*
257
+ * Aggregate delivery and engagement counts for one outreach, keyed by the outreach id.
258
+ */
259
+ export const emailOutreachRecipientOverviewFragment = `fragment emailOutreachRecipientOverviewFragment on EmailOutreachRecipientOverview {
260
+ id
261
+ totalCount
262
+ selectedCount
263
+ queuedCount
264
+ processingCount
265
+ sentCount
266
+ deliveredCount
267
+ openedCount
268
+ respondedCount
269
+ notRepliedCount
270
+ bouncedCount
271
+ spamComplaintCount
272
+ failedCount
273
+ retryableCount
274
+ unknownCount
275
+ suppressedCount
276
+ excludedCount
277
+ audienceLists {
278
+ id
279
+ name
280
+ }
281
+ }`;
@@ -5,7 +5,7 @@ export const inboundContactFragment = `fragment inboundContactFragment on Inboun
5
5
  personName
6
6
  email
7
7
  emailEligible
8
- campaignEmailSuppressed
8
+ emailOutreachSuppressed
9
9
  phone
10
10
  memory
11
11
  associated {
@@ -0,0 +1,120 @@
1
+ /*
2
+ * Share the complete light library file record (every field of LibraryFile) across readers and future library views.
3
+ * The first picture URL identifies its protected thumbnail on the assets server.
4
+ */
5
+ export const libraryFileFragment = `fragment libraryFileFragment on LibraryFile {
6
+ id
7
+ organizationId
8
+ kind
9
+ format
10
+ origin
11
+ source
12
+ title
13
+ useWhen
14
+ gist
15
+ scope
16
+ listed
17
+ sensitivity
18
+ folderId
19
+ purposes {
20
+ id
21
+ name
22
+ }
23
+ parties {
24
+ id
25
+ relatedOrgId
26
+ inboundContactId
27
+ name
28
+ relation
29
+ }
30
+ approvedAt
31
+ approvedByAccountId
32
+ archivedAt
33
+ archiveKind
34
+ lifecycleReason
35
+ replacedByFileId
36
+ possibleReplacementFileId
37
+ effectiveFrom
38
+ effectiveUntil
39
+ pinnedFields
40
+ fileName
41
+ fileContentType
42
+ firstImageUrl
43
+ fileCount
44
+ senderName
45
+ senderEmail
46
+ pageCount
47
+ contentRevision
48
+ analysisStatus
49
+ analysisError
50
+ analysisRevision
51
+ analyzedAt
52
+ labeledAt
53
+ organizedAt
54
+ createdByAccountId
55
+ createdByAgent
56
+ createdAt
57
+ updatedAt
58
+ cursor
59
+ }`;
60
+
61
+ export const libraryFileAnalysisFragment = `fragment libraryFileAnalysisFragment on LibraryFileAnalysis {
62
+ id
63
+ revision
64
+ stale
65
+ data
66
+ }`;
67
+
68
+ export const libraryFileContentFragment = `fragment libraryFileContentFragment on LibraryFileContent {
69
+ id
70
+ contentRevision
71
+ content
72
+ }`;
73
+
74
+ /*
75
+ * One window of a cited chunk. The id names the file, the brief's analysisId, the chunk and the span, so a cached
76
+ * window is never shown against another brief's span.
77
+ */
78
+ export const libraryFileCitationFragment = `fragment libraryFileCitationFragment on LibraryFileCitation {
79
+ id
80
+ current
81
+ ordinal
82
+ page
83
+ heading
84
+ ocr
85
+ text
86
+ highlightStart
87
+ highlightEnd
88
+ truncatedBefore
89
+ truncatedAfter
90
+ }`;
91
+
92
+ export const libraryFileNoteFragment = `fragment libraryFileNoteFragment on LibraryFileNote {
93
+ id
94
+ libraryFileId
95
+ text
96
+ accountId
97
+ authorName
98
+ channel
99
+ createdAt
100
+ }`;
101
+
102
+ export const libraryFileObjectFragment = `fragment libraryFileObjectFragment on LibraryFileObject {
103
+ id
104
+ ordinal
105
+ name
106
+ contentType
107
+ size
108
+ url
109
+ }`;
110
+
111
+ export const libraryFolderFragment = `fragment libraryFolderFragment on LibraryFolder {
112
+ id
113
+ organizationId
114
+ parentId
115
+ name
116
+ description
117
+ position
118
+ pinned
119
+ fileCount
120
+ }`;
@@ -18,12 +18,13 @@ export const organizationFragment = `fragment organizationFragment on Organizati
18
18
  }
19
19
 
20
20
  settings {
21
- schedule { defaultSurface }
22
21
  id
22
+ schedule { payWeekStart ageGroups { key label } }
23
23
  timeZone
24
24
  language
25
25
  displayTranslatedLogs
26
26
  translateLanguage
27
+ allowMcpConnections
27
28
  logRevisionsProof
28
29
  color
29
30
  priorityService
@@ -57,12 +58,13 @@ export const organizationFragment = `fragment organizationFragment on Organizati
57
58
  }`;
58
59
 
59
60
  export const organizationSettingsFragment = `fragment organizationSettingsFragment on OrganizationSettings {
60
- schedule { defaultSurface }
61
61
  id
62
+ schedule { payWeekStart ageGroups { key label } }
62
63
  timeZone
63
64
  language
64
65
  displayTranslatedLogs
65
66
  translateLanguage
67
+ allowMcpConnections
66
68
  logRevisionsProof
67
69
  color
68
70
  priorityService