@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.
- package/LICENSE +21 -0
- package/audience.d.ts +14 -152
- package/cache/config.ts +35 -32
- package/cache/index.helpers.ts +1 -1
- package/cache/index.ts +73 -44
- package/cache/mounted-queries.ts +33 -0
- package/cache/persist.ts +10 -4
- package/cache/realtime-fence.ts +47 -0
- package/cache/realtime-live.ts +17 -0
- package/client/draft-persistence.ts +10 -39
- package/client/index.ts +2 -1
- package/client/request.ts +9 -34
- package/client/storage-asset.ts +58 -0
- package/gql/fragments/accountAuthFragments.ts +0 -4
- package/gql/fragments/agentNoteFragments.ts +8 -2
- package/gql/fragments/aiChatFragments.ts +0 -2
- package/gql/fragments/aiChatLinkFragments.ts +8 -0
- package/gql/fragments/audienceFragments.ts +1 -66
- package/gql/fragments/emailFragments.ts +27 -4
- package/gql/fragments/emailOutreachFragments.ts +281 -0
- package/gql/fragments/inboundContactFragments.ts +1 -1
- package/gql/fragments/libraryFragments.ts +120 -0
- package/gql/fragments/organizationFragments.ts +4 -2
- package/gql/fragments/scheduleFragments.ts +241 -324
- package/gql/fragments/sheetFragments.ts +4 -53
- package/gql/fragments/workWaitFragments.ts +13 -0
- package/gql/fragments/workflowFragments.ts +20 -4
- package/gql/mutations/agentNoteMutations.ts +2 -0
- package/gql/mutations/aiChatLinkMutations.ts +13 -0
- package/gql/mutations/aiChatMutations.ts +4 -6
- package/gql/mutations/audienceMutations.ts +0 -13
- package/gql/mutations/authMutations.ts +12 -60
- package/gql/mutations/emailMutations.ts +22 -0
- package/gql/mutations/emailOutreachMutations.ts +139 -0
- package/gql/mutations/index.ts +3 -1
- package/gql/mutations/organizationMutations.ts +2 -2
- package/gql/mutations/scheduleMutations.ts +61 -787
- package/gql/mutations/storageMutations.ts +1 -0
- package/gql/mutations/workflowMutations.ts +76 -0
- package/gql/queries/agentMemoryQueries.ts +6 -2
- package/gql/queries/agentNoteQueries.ts +26 -29
- package/gql/queries/aiChatQueries.ts +39 -40
- package/gql/queries/audienceQueries.ts +31 -55
- package/gql/queries/authQueries.ts +16 -6
- package/gql/queries/billingQueries.ts +26 -10
- package/gql/queries/dataTableQueries.ts +24 -15
- package/gql/queries/emailOutreachQueries.ts +282 -0
- package/gql/queries/emailQueries.ts +39 -12
- package/gql/queries/emailReplyReportQueries.ts +60 -9
- package/gql/queries/fieldDocQueries.ts +36 -14
- package/gql/queries/inboundContactQueries.ts +11 -4
- package/gql/queries/index.ts +2 -2
- package/gql/queries/libraryQueries.ts +112 -0
- package/gql/queries/logQueries.ts +31 -12
- package/gql/queries/organizationQueries.ts +31 -12
- package/gql/queries/qrCodeQueries.ts +11 -4
- package/gql/queries/scheduleQueries.ts +252 -505
- package/gql/queries/sheetQueries.ts +36 -14
- package/gql/queries/storageQueries.ts +11 -4
- package/gql/queries/workflowQueries.ts +53 -10
- package/gql/reactivity.ts +98 -0
- package/gql/recordReads.ts +171 -0
- package/hooks/index.ts +79 -52
- package/hooks/use-agentNote-mtn.ts +7 -0
- package/hooks/use-agentNote-qry.ts +30 -58
- package/hooks/use-agentNote-recovery.ts +6 -21
- package/hooks/use-aiChat-mtn.ts +9 -4
- package/hooks/use-aiChat-qry.ts +28 -7
- package/hooks/use-audience-mtn.ts +0 -24
- package/hooks/use-audience-qry.helpers.ts +0 -24
- package/hooks/use-audience-qry.ts +1 -86
- package/hooks/use-dataTable-mtn.ts +3 -3
- package/hooks/use-dataTable-qry.ts +7 -2
- package/hooks/use-email-mtn.ts +26 -0
- package/hooks/use-email-qry.helpers.ts +1 -1
- package/hooks/use-email-qry.ts +18 -3
- package/hooks/use-emailOutreach-mtn.ts +211 -0
- package/hooks/use-emailOutreach-qry.helpers.ts +25 -0
- package/hooks/use-emailOutreach-qry.ts +367 -0
- package/hooks/use-emailOutreachReplyReport-qry.ts +46 -0
- package/hooks/use-fieldDoc-qry.ts +1 -1
- package/hooks/use-library-qry.ts +233 -0
- package/hooks/use-qrCode-qry.ts +1 -1
- package/hooks/use-schedule-mtn.ts +10 -300
- package/hooks/use-schedule-qry.ts +168 -680
- package/hooks/use-schedule-reactive.ts +71 -339
- package/hooks/use-sheet-qry.ts +6 -1
- package/hooks/use-workflow-mtn.ts +45 -1
- package/hooks/use-workflow-qry.ts +22 -2
- package/libs/ai-chat-link-events.ts +78 -0
- package/libs/data-changes.helpers.ts +161 -0
- package/libs/data-changes.ts +382 -0
- package/libs/fragment-realtime-sequence.ts +3 -3
- package/libs/record-read.ts +327 -0
- package/libs/sheet-command-batch.ts +3 -2
- package/libs/sheet-realtime-packet.ts +53 -0
- package/loaders/emailPreference.ts +18 -24
- package/package.json +44 -17
- package/schedule.d.ts +267 -874
- package/types.d.ts +3 -1
- package/cache/index.chat-activity.test.ts +0 -119
- package/cache/index.chat.test.ts +0 -92
- package/cache/index.regression.test.ts +0 -149
- package/cache/index.test.ts +0 -1209
- package/deno.lock +0 -187
- package/deno.test.json +0 -12
- package/gql/fragments/campaignFragments.ts +0 -566
- package/gql/mutations/campaignMutations.ts +0 -258
- package/gql/queries/appQueries.ts +0 -14
- package/gql/queries/campaignQueries.ts +0 -236
- package/hooks/index.helpers.test.ts +0 -50
- package/hooks/use-agentNote-recovery.helpers.test.ts +0 -68
- package/hooks/use-aiChat-qry.helpers.test.ts +0 -63
- package/hooks/use-app-qry.ts +0 -22
- package/hooks/use-audience-qry.helpers.test.ts +0 -80
- package/hooks/use-campaign-generation-recovery.ts +0 -53
- package/hooks/use-campaign-mtn.ts +0 -436
- package/hooks/use-campaign-qry.helpers.ts +0 -40
- package/hooks/use-campaign-qry.ts +0 -834
- package/hooks/use-emailCampaignReplyReport-qry.ts +0 -27
- package/hooks/use-fieldDoc-qry.helpers.test.ts +0 -65
- package/hooks/use-publicFormEmail-mtn.ts +0 -27
- package/libs/fragment-recovery.test.ts +0 -326
- package/libs/fragment-recovery.ts +0 -325
- package/libs/orchestrator-realtime.helpers.test.ts +0 -229
- package/libs/orchestrator-realtime.helpers.ts +0 -317
- package/libs/orchestrator-realtime.ts +0 -433
- package/libs/request-cache-regression.test.ts +0 -122
- package/libs/request-managed-session.test.ts +0 -574
- package/libs/request-no-store.test.ts +0 -419
- package/libs/sheet-view-realtime-router.test.ts +0 -214
- package/libs/sse-ticket.test.ts +0 -26
- package/loaders/campaign.test.ts +0 -186
- package/loaders/campaign.ts +0 -110
- package/tests/agent-note-detail-cache.test.ts +0 -120
- package/tests/agent-note-search.test.ts +0 -444
- package/tsconfig.json +0 -13
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { gql } from 'graphql-tag';
|
|
2
|
+
import { audienceEmailAddressFragment } from '../fragments/audienceFragments.ts';
|
|
3
|
+
import {
|
|
4
|
+
emailOutreachAudienceMemberFragment,
|
|
5
|
+
emailOutreachAudiencePreviewFragment,
|
|
6
|
+
emailOutreachEventFragment,
|
|
7
|
+
emailOutreachFragment,
|
|
8
|
+
emailOutreachRecipientFragment,
|
|
9
|
+
emailOutreachRecipientOverviewFragment,
|
|
10
|
+
emailOutreachSummaryFragment,
|
|
11
|
+
} from '../fragments/emailOutreachFragments.ts';
|
|
12
|
+
import { live } from '../reactivity.ts';
|
|
13
|
+
import { workWaitItemFragment } from '../fragments/workWaitFragments.ts';
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
* One organization's outreach, newest first, keyset paginated. Membership and
|
|
17
|
+
* metric changes (an `added` outreach, recipient activity) show the declared
|
|
18
|
+
* notice.
|
|
19
|
+
*/
|
|
20
|
+
export const emailOutreachListQry = live(
|
|
21
|
+
gql`
|
|
22
|
+
query emailOutreachList (
|
|
23
|
+
$organizationId: GenericID!
|
|
24
|
+
$filter: EmailOutreachListFilter
|
|
25
|
+
$cursor: Cursor
|
|
26
|
+
$after: Boolean!
|
|
27
|
+
$limit: Int!
|
|
28
|
+
) {
|
|
29
|
+
emailOutreachList (
|
|
30
|
+
organizationId: $organizationId
|
|
31
|
+
filter: $filter
|
|
32
|
+
cursor: $cursor
|
|
33
|
+
after: $after
|
|
34
|
+
limit: $limit
|
|
35
|
+
) {
|
|
36
|
+
...emailOutreachSummaryFragment
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
${emailOutreachSummaryFragment}
|
|
40
|
+
`,
|
|
41
|
+
{ refresh: 'notice', lists: ['emailOutreach'], derived: ['emailOutreachRecipient'] },
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
* The follow-ups of one original, for its route sidebar. Not a table, so a follow-up added or moved refetches it
|
|
46
|
+
* quietly instead of raising the "new data" notice. It shows no metrics, so recipient activity does not refresh it.
|
|
47
|
+
* The alias keeps it apart from emailOutreachListQry's declaration; rows share the canonical outreach summary cache.
|
|
48
|
+
*/
|
|
49
|
+
export const emailOutreachFollowUpsQry = live(
|
|
50
|
+
gql`
|
|
51
|
+
query emailOutreachFollowUps (
|
|
52
|
+
$organizationId: GenericID!
|
|
53
|
+
$filter: EmailOutreachListFilter
|
|
54
|
+
$cursor: Cursor
|
|
55
|
+
$after: Boolean!
|
|
56
|
+
$limit: Int!
|
|
57
|
+
) {
|
|
58
|
+
emailOutreachFollowUps: emailOutreachList (
|
|
59
|
+
organizationId: $organizationId
|
|
60
|
+
filter: $filter
|
|
61
|
+
cursor: $cursor
|
|
62
|
+
after: $after
|
|
63
|
+
limit: $limit
|
|
64
|
+
) {
|
|
65
|
+
...emailOutreachSummaryFragment
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
${emailOutreachSummaryFragment}
|
|
69
|
+
`,
|
|
70
|
+
{ refresh: 'auto', lists: ['emailOutreach'] },
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
/* Keep each filtered group and cursor in the query result. Members share the canonical outreach summary cache across lists. */
|
|
74
|
+
export const emailOutreachGroupsQry = live(
|
|
75
|
+
gql`
|
|
76
|
+
query emailOutreachGroups (
|
|
77
|
+
$organizationId: GenericID!
|
|
78
|
+
$filter: EmailOutreachListFilter
|
|
79
|
+
$cursor: Cursor
|
|
80
|
+
$limit: Int!
|
|
81
|
+
) {
|
|
82
|
+
emailOutreachGroups (
|
|
83
|
+
organizationId: $organizationId
|
|
84
|
+
filter: $filter
|
|
85
|
+
cursor: $cursor
|
|
86
|
+
limit: $limit
|
|
87
|
+
) {
|
|
88
|
+
id
|
|
89
|
+
cursor
|
|
90
|
+
title
|
|
91
|
+
members { ...emailOutreachSummaryFragment }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
${emailOutreachSummaryFragment}
|
|
95
|
+
`,
|
|
96
|
+
{ refresh: 'notice', lists: ['emailOutreach'], derived: ['emailOutreachRecipient', 'emailOutreachGroup'] },
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
export const emailOutreachQry = live(
|
|
100
|
+
gql`
|
|
101
|
+
query emailOutreach (
|
|
102
|
+
$emailOutreachId: GenericID!
|
|
103
|
+
) {
|
|
104
|
+
emailOutreach (
|
|
105
|
+
emailOutreachId: $emailOutreachId
|
|
106
|
+
) {
|
|
107
|
+
...emailOutreachFragment
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
${emailOutreachFragment}
|
|
111
|
+
${workWaitItemFragment}
|
|
112
|
+
`,
|
|
113
|
+
{ refresh: 'auto', derived: ['emailOutreach', 'emailOutreachGroup'] },
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
/* Summary requests the picker field alongside the same canonical detail fragment. */
|
|
117
|
+
export const emailOutreachWithGroupSendsQry = live(
|
|
118
|
+
gql`
|
|
119
|
+
query emailOutreach($emailOutreachId: GenericID!, $includeGroupSends: Boolean! = false) {
|
|
120
|
+
emailOutreach(emailOutreachId: $emailOutreachId) {
|
|
121
|
+
...emailOutreachFragment
|
|
122
|
+
groupSends @include(if: $includeGroupSends) { id title createdAt }
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
${emailOutreachFragment}
|
|
126
|
+
${workWaitItemFragment}
|
|
127
|
+
`,
|
|
128
|
+
{ refresh: 'auto', derived: ['emailOutreach', 'emailOutreachGroup'] },
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
export const emailOutreachEditHistoryQry = live(
|
|
132
|
+
gql`
|
|
133
|
+
query emailOutreachEditHistory($emailOutreachId: GenericID!) {
|
|
134
|
+
emailOutreachEditHistory(emailOutreachId: $emailOutreachId) {
|
|
135
|
+
...emailOutreachEventFragment
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
${emailOutreachEventFragment}
|
|
139
|
+
`,
|
|
140
|
+
{ refresh: 'auto', derived: ['emailOutreach'] },
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
/*
|
|
144
|
+
* Page through the selected sends by mailbox. The nested recipient reuses its canonical fragment.
|
|
145
|
+
*/
|
|
146
|
+
export const emailOutreachRecipientsQry = live(
|
|
147
|
+
gql`
|
|
148
|
+
query emailOutreachRecipients (
|
|
149
|
+
$emailOutreachId: GenericID!
|
|
150
|
+
$sendIds: [GenericID!]
|
|
151
|
+
$filter: EmailOutreachRecipientsFilter!
|
|
152
|
+
$sort: EmailOutreachRecipientSort
|
|
153
|
+
$cursor: Cursor
|
|
154
|
+
$after: Boolean!
|
|
155
|
+
$limit: Int!
|
|
156
|
+
) {
|
|
157
|
+
emailOutreachRecipients (
|
|
158
|
+
sendIds: $sendIds
|
|
159
|
+
emailOutreachId: $emailOutreachId
|
|
160
|
+
filter: $filter
|
|
161
|
+
sort: $sort
|
|
162
|
+
cursor: $cursor
|
|
163
|
+
after: $after
|
|
164
|
+
limit: $limit
|
|
165
|
+
) {
|
|
166
|
+
id cursor activityAt recipient { ...emailOutreachRecipientFragment }
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
${emailOutreachRecipientFragment}
|
|
170
|
+
`,
|
|
171
|
+
{ refresh: 'auto', lists: ['emailOutreachRecipient'], derived: ['emailOutreach', 'emailOutreachGroup'] },
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
/*
|
|
175
|
+
* Fetch aggregate delivery and engagement counts for one outreach.
|
|
176
|
+
*/
|
|
177
|
+
export const emailOutreachRecipientOverviewQry = live(
|
|
178
|
+
gql`
|
|
179
|
+
query emailOutreachRecipientOverview (
|
|
180
|
+
$emailOutreachId: GenericID!
|
|
181
|
+
) {
|
|
182
|
+
emailOutreachRecipientOverview (
|
|
183
|
+
emailOutreachId: $emailOutreachId
|
|
184
|
+
) {
|
|
185
|
+
...emailOutreachRecipientOverviewFragment
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
${emailOutreachRecipientOverviewFragment}
|
|
189
|
+
`,
|
|
190
|
+
{ refresh: 'auto', derived: ['emailOutreach', 'emailOutreachRecipient'] },
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
/* Read the saved audience using the same eligibility and limits that sending enforces. */
|
|
194
|
+
export const emailOutreachAudiencePreviewQry = live(
|
|
195
|
+
gql`
|
|
196
|
+
query emailOutreachAudiencePreview($emailOutreachId: GenericID!) {
|
|
197
|
+
emailOutreachAudiencePreview(emailOutreachId: $emailOutreachId) {
|
|
198
|
+
...emailOutreachAudiencePreviewFragment
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
${emailOutreachAudiencePreviewFragment}
|
|
202
|
+
`,
|
|
203
|
+
{ refresh: 'auto', derived: ['emailOutreach'] },
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
/* Page draft recipients with complete shared address health data for list and network sources. */
|
|
207
|
+
export const emailOutreachAudienceMembersQry = live(
|
|
208
|
+
gql`
|
|
209
|
+
query emailOutreachAudienceMembers(
|
|
210
|
+
$emailOutreachId: GenericID!
|
|
211
|
+
$filter: EmailOutreachAudienceMembersFilter
|
|
212
|
+
$sort: EmailOutreachAudienceMembersSort
|
|
213
|
+
$cursor: Cursor
|
|
214
|
+
$after: Boolean!
|
|
215
|
+
$limit: Int!
|
|
216
|
+
) {
|
|
217
|
+
emailOutreachAudienceMembers(emailOutreachId: $emailOutreachId, filter: $filter, sort: $sort, cursor: $cursor, after: $after, limit: $limit) {
|
|
218
|
+
...emailOutreachAudienceMemberFragment
|
|
219
|
+
address { ...audienceEmailAddressFragment }
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
${emailOutreachAudienceMemberFragment}
|
|
223
|
+
${audienceEmailAddressFragment}
|
|
224
|
+
`,
|
|
225
|
+
{ refresh: 'auto', lists: ['emailOutreachAudienceMember'], derived: ['emailOutreach'] },
|
|
226
|
+
);
|
|
227
|
+
|
|
228
|
+
/*
|
|
229
|
+
* Read the selected sends' mailbox reply-rate intervals without loading individual recipients.
|
|
230
|
+
*/
|
|
231
|
+
export const emailOutreachEngagementHistoryQry = live(
|
|
232
|
+
gql`
|
|
233
|
+
query emailOutreachEngagementHistory($emailOutreachId: GenericID!, $sendIds: [GenericID!]) {
|
|
234
|
+
emailOutreachEngagementHistory(emailOutreachId: $emailOutreachId, sendIds: $sendIds) {
|
|
235
|
+
bucket
|
|
236
|
+
timeZone
|
|
237
|
+
sentCount
|
|
238
|
+
repliedCount
|
|
239
|
+
intervals { periodStart periodEnd sent replied }
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
`,
|
|
243
|
+
{ refresh: 'auto', derived: ['emailOutreach', 'emailOutreachRecipient', 'emailOutreachGroup'] },
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
/* Read the recipient graph totals independently of list pagination and filters. */
|
|
247
|
+
export const emailOutreachRecipientOutcomesQry = live(
|
|
248
|
+
gql`
|
|
249
|
+
query emailOutreachRecipientOutcomes($emailOutreachId: GenericID!, $sendIds: [GenericID!]) {
|
|
250
|
+
emailOutreachRecipientOutcomes(emailOutreachId: $emailOutreachId, sendIds: $sendIds) { outcome count }
|
|
251
|
+
}
|
|
252
|
+
`,
|
|
253
|
+
{ refresh: 'auto', derived: ['emailOutreach', 'emailOutreachRecipient', 'emailOutreachGroup'] },
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
/* Read the product ranking without transferring order lines. */
|
|
257
|
+
export const emailOutreachProductOrdersQry = live(
|
|
258
|
+
gql`
|
|
259
|
+
query emailOutreachProductOrders($emailOutreachId: GenericID!, $sendIds: [GenericID!]) {
|
|
260
|
+
emailOutreachProductOrders(emailOutreachId: $emailOutreachId, sendIds: $sendIds) {
|
|
261
|
+
orderCount
|
|
262
|
+
valueCents
|
|
263
|
+
unpricedLineCount
|
|
264
|
+
products { key label orderCount valueCents quantities { unit quantity } }
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
`,
|
|
268
|
+
{ refresh: 'auto', derived: ['emailOutreachReply', 'emailOutreachGroup'] },
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
/* Load the selected product's source replies and pack quantities on demand. */
|
|
272
|
+
export const emailOutreachProductOrderLinesQry = live(
|
|
273
|
+
gql`
|
|
274
|
+
query emailOutreachProductOrderLines($emailOutreachId: GenericID!, $sendIds: [GenericID!], $productKey: String!, $offset: Int!) {
|
|
275
|
+
emailOutreachProductOrderLines(emailOutreachId: $emailOutreachId, sendIds: $sendIds, productKey: $productKey, offset: $offset) {
|
|
276
|
+
hasMore
|
|
277
|
+
lines { quantity unit valueCents orderedAt sourceEmailMessageId }
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
`,
|
|
281
|
+
{ refresh: 'auto', derived: ['emailOutreachReply', 'emailOutreachGroup'] },
|
|
282
|
+
);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { gql } from 'graphql-tag';
|
|
2
|
-
import {
|
|
3
|
-
emailMessageDetailsFragment,
|
|
4
|
-
emailMessageFragment,
|
|
5
|
-
} from '../fragments/emailFragments.ts';
|
|
2
|
+
import { emailConversationMessageFragment, emailMessageDetailsFragment, emailMessageFragment } from '../fragments/emailFragments.ts';
|
|
6
3
|
import { storageFileFragment } from '../fragments/storageFragments.ts';
|
|
4
|
+
import { live } from '../reactivity.ts';
|
|
7
5
|
|
|
8
|
-
export const emailMessageQry =
|
|
6
|
+
export const emailMessageQry = live(
|
|
7
|
+
gql`
|
|
9
8
|
query emailMessage (
|
|
10
9
|
$organizationId: GenericID!
|
|
11
10
|
$emailMessageId: ID!
|
|
@@ -15,20 +14,27 @@ query emailMessage (
|
|
|
15
14
|
emailMessageId: $emailMessageId
|
|
16
15
|
) {
|
|
17
16
|
...emailMessageFragment
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
details {
|
|
18
|
+
...emailMessageDetailsFragment
|
|
19
|
+
files { ...storageFileFragment }
|
|
20
|
+
}
|
|
21
|
+
conversation {
|
|
22
|
+
messages { ...emailConversationMessageFragment }
|
|
23
|
+
nextCursor
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
|
|
28
|
+
${emailConversationMessageFragment}
|
|
26
29
|
${storageFileFragment}
|
|
27
30
|
${emailMessageFragment}
|
|
28
31
|
${emailMessageDetailsFragment}
|
|
29
|
-
|
|
32
|
+
`,
|
|
33
|
+
{ refresh: 'auto', derived: ['emailMessage'] },
|
|
34
|
+
);
|
|
30
35
|
|
|
31
|
-
export const emailMessagesQry =
|
|
36
|
+
export const emailMessagesQry = live(
|
|
37
|
+
gql`
|
|
32
38
|
query emailMessages (
|
|
33
39
|
$organizationId: GenericID!
|
|
34
40
|
$filter: EmailMessagesFilter
|
|
@@ -50,4 +56,25 @@ query emailMessages (
|
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
${emailMessageFragment}
|
|
53
|
-
|
|
59
|
+
`,
|
|
60
|
+
{ refresh: 'notice', lists: ['emailMessage'] },
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// A continuation is a cursor-specific page. Cache its envelope under its query variables so it cannot replace
|
|
64
|
+
// the first conversation page or another cursor on the shared email message fragment.
|
|
65
|
+
export const emailMessageConversationPageQry = live(
|
|
66
|
+
gql`
|
|
67
|
+
query emailMessageConversationPage ($organizationId: GenericID!, $emailMessageId: ID!, $cursor: Cursor!) {
|
|
68
|
+
emailMessageConversationPage: emailMessage(organizationId: $organizationId, emailMessageId: $emailMessageId) {
|
|
69
|
+
id
|
|
70
|
+
organizationId
|
|
71
|
+
conversation(cursor: $cursor) {
|
|
72
|
+
messages { ...emailConversationMessageFragment }
|
|
73
|
+
nextCursor
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
${emailConversationMessageFragment}
|
|
78
|
+
`,
|
|
79
|
+
{ refresh: 'auto' },
|
|
80
|
+
);
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import { gql } from 'graphql-tag';
|
|
2
|
+
import { live } from '../reactivity.ts';
|
|
2
3
|
|
|
3
|
-
// Both the note summary and
|
|
4
|
+
// Both the note summary and outreach replies table use this complete inline selection.
|
|
4
5
|
// Report DTOs have no entity identity and must not enter normalized/persisted fragments.
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
$
|
|
6
|
+
export const emailOutreachReplyReportQry = live(
|
|
7
|
+
gql`
|
|
8
|
+
query emailOutreachReplyReport (
|
|
9
|
+
$emailOutreachId: GenericID!
|
|
10
|
+
$sendIds: [GenericID!]
|
|
9
11
|
) {
|
|
10
|
-
|
|
12
|
+
emailOutreachReplyReport (emailOutreachId: $emailOutreachId, sendIds: $sendIds) {
|
|
11
13
|
organizationId
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
emailOutreachId
|
|
15
|
+
emailOutreachTitle
|
|
16
|
+
sources { emailOutreachId title replyCount }
|
|
14
17
|
readAt
|
|
15
18
|
availability
|
|
16
19
|
definitionReason
|
|
17
20
|
limitReason
|
|
18
21
|
instructions
|
|
22
|
+
limitations
|
|
19
23
|
coverage {
|
|
20
24
|
linkedReplyCount
|
|
21
25
|
spamReplyCount
|
|
@@ -31,9 +35,23 @@ query emailCampaignReplyReport (
|
|
|
31
35
|
key
|
|
32
36
|
label
|
|
33
37
|
type
|
|
38
|
+
unit
|
|
39
|
+
list {
|
|
40
|
+
entryCount
|
|
41
|
+
quantityTotal
|
|
42
|
+
otherUnitCount
|
|
43
|
+
entries {
|
|
44
|
+
key
|
|
45
|
+
label
|
|
46
|
+
respondentCount
|
|
47
|
+
fieldQuantity
|
|
48
|
+
quantities { unit quantity }
|
|
49
|
+
}
|
|
50
|
+
}
|
|
34
51
|
answeredCount
|
|
35
52
|
unclearCount
|
|
36
53
|
withdrawnCount
|
|
54
|
+
notApplicableCount
|
|
37
55
|
missingCount
|
|
38
56
|
unitGroupCount
|
|
39
57
|
omittedUnitGroups
|
|
@@ -62,6 +80,7 @@ query emailCampaignReplyReport (
|
|
|
62
80
|
answers {
|
|
63
81
|
fieldKey
|
|
64
82
|
status
|
|
83
|
+
entries { label quantity unit }
|
|
65
84
|
numberValue
|
|
66
85
|
textValue
|
|
67
86
|
booleanValue
|
|
@@ -73,4 +92,36 @@ query emailCampaignReplyReport (
|
|
|
73
92
|
}
|
|
74
93
|
}
|
|
75
94
|
}
|
|
76
|
-
|
|
95
|
+
`,
|
|
96
|
+
{ refresh: 'notice', derived: ['emailOutreachReply', 'emailOutreach', 'emailOutreachGroup'] },
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
// These scoped chart values have no entity identity and are kept in query state.
|
|
100
|
+
export const emailOutreachResponseChartsQry = live(
|
|
101
|
+
gql`
|
|
102
|
+
query emailOutreachResponseCharts (
|
|
103
|
+
$emailOutreachId: GenericID!
|
|
104
|
+
$sendIds: [GenericID!]
|
|
105
|
+
) {
|
|
106
|
+
emailOutreachResponseCharts (emailOutreachId: $emailOutreachId, sendIds: $sendIds) {
|
|
107
|
+
organizationId
|
|
108
|
+
emailOutreachId
|
|
109
|
+
readAt
|
|
110
|
+
charts {
|
|
111
|
+
kind
|
|
112
|
+
title
|
|
113
|
+
fieldKeys
|
|
114
|
+
measure
|
|
115
|
+
unit
|
|
116
|
+
total
|
|
117
|
+
average
|
|
118
|
+
respondentCount
|
|
119
|
+
excludedCount
|
|
120
|
+
omittedCount
|
|
121
|
+
points { key label value count periodDate listed }
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
`,
|
|
126
|
+
{ refresh: 'auto', derived: ['emailOutreachReply', 'emailOutreach', 'emailOutreachGroup'] },
|
|
127
|
+
);
|
|
@@ -13,8 +13,10 @@ import {
|
|
|
13
13
|
fieldDocSubmissionFragment,
|
|
14
14
|
} from '../fragments/fieldDocFragments.ts';
|
|
15
15
|
import { storageFileFragment } from '../fragments/storageFragments.ts';
|
|
16
|
+
import { live } from '../reactivity.ts';
|
|
16
17
|
|
|
17
|
-
export const fieldDocProgramEnrollmentsQry =
|
|
18
|
+
export const fieldDocProgramEnrollmentsQry = live(
|
|
19
|
+
gql`
|
|
18
20
|
query fieldDocProgramEnrollments (
|
|
19
21
|
$organizationId: GenericID!
|
|
20
22
|
$fieldDocProgramId: GenericID
|
|
@@ -28,9 +30,12 @@ query fieldDocProgramEnrollments (
|
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
${fieldDocProgramEnrollmentImports}
|
|
31
|
-
|
|
33
|
+
`,
|
|
34
|
+
{ refresh: 'auto', derived: ['fieldDocProgramEnrollment', 'fieldDocProgram'] },
|
|
35
|
+
);
|
|
32
36
|
|
|
33
|
-
export const fieldDocProgramCatalogQry =
|
|
37
|
+
export const fieldDocProgramCatalogQry = live(
|
|
38
|
+
gql`
|
|
34
39
|
query fieldDocProgramCatalog (
|
|
35
40
|
$organizationId: GenericID!
|
|
36
41
|
) {
|
|
@@ -42,9 +47,12 @@ query fieldDocProgramCatalog (
|
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
${fieldDocProgramImports}
|
|
45
|
-
|
|
50
|
+
`,
|
|
51
|
+
{ refresh: 'auto', lists: ['fieldDocProgram'] },
|
|
52
|
+
);
|
|
46
53
|
|
|
47
|
-
export const fieldDocProgramMetadataQry =
|
|
54
|
+
export const fieldDocProgramMetadataQry = live(
|
|
55
|
+
gql`
|
|
48
56
|
query fieldDocProgramMetadata (
|
|
49
57
|
$fieldDocProgramId: GenericID!
|
|
50
58
|
) {
|
|
@@ -56,9 +64,12 @@ query fieldDocProgramMetadata (
|
|
|
56
64
|
}
|
|
57
65
|
|
|
58
66
|
${fieldDocProgramImports}
|
|
59
|
-
|
|
67
|
+
`,
|
|
68
|
+
{ refresh: 'auto' },
|
|
69
|
+
);
|
|
60
70
|
|
|
61
|
-
export const fieldDocSubmissionsQry =
|
|
71
|
+
export const fieldDocSubmissionsQry = live(
|
|
72
|
+
gql`
|
|
62
73
|
query fieldDocSubmissions (
|
|
63
74
|
$organizationId: GenericID!
|
|
64
75
|
$filter: FieldDocSubmissionsFilter!
|
|
@@ -78,9 +89,12 @@ query fieldDocSubmissions (
|
|
|
78
89
|
}
|
|
79
90
|
|
|
80
91
|
${fieldDocSubmissionFragment}
|
|
81
|
-
|
|
92
|
+
`,
|
|
93
|
+
{ refresh: 'notice', lists: ['fieldDocSubmission'] },
|
|
94
|
+
);
|
|
82
95
|
|
|
83
|
-
export const fieldDocSubmissionDocumentQry =
|
|
96
|
+
export const fieldDocSubmissionDocumentQry = live(
|
|
97
|
+
gql`
|
|
84
98
|
query fieldDocSubmissionDocument (
|
|
85
99
|
$fieldDocSubmissionId: GenericID!
|
|
86
100
|
) {
|
|
@@ -133,9 +147,12 @@ ${fieldDocDefinitionSectionFragment}
|
|
|
133
147
|
${fieldDocDefinitionElementFragment}
|
|
134
148
|
${storageFileFragment}
|
|
135
149
|
${fieldDocAnswerFragment}
|
|
136
|
-
|
|
150
|
+
`,
|
|
151
|
+
{ refresh: 'auto', derived: ['fieldDocSubmissionDocument'] },
|
|
152
|
+
);
|
|
137
153
|
|
|
138
|
-
export const fieldDocSubmissionMetadataQry =
|
|
154
|
+
export const fieldDocSubmissionMetadataQry = live(
|
|
155
|
+
gql`
|
|
139
156
|
query fieldDocSubmissionMetadata (
|
|
140
157
|
$fieldDocSubmissionId: GenericID!
|
|
141
158
|
) {
|
|
@@ -147,9 +164,12 @@ query fieldDocSubmissionMetadata (
|
|
|
147
164
|
description
|
|
148
165
|
}
|
|
149
166
|
}
|
|
150
|
-
|
|
167
|
+
`,
|
|
168
|
+
{ refresh: 'auto' },
|
|
169
|
+
);
|
|
151
170
|
|
|
152
|
-
export const fieldDocEditSessionQry =
|
|
171
|
+
export const fieldDocEditSessionQry = live(
|
|
172
|
+
gql`
|
|
153
173
|
query fieldDocEditSession (
|
|
154
174
|
$organizationId: GenericID!
|
|
155
175
|
$fieldDocId: GenericID!
|
|
@@ -163,4 +183,6 @@ query fieldDocEditSession (
|
|
|
163
183
|
}
|
|
164
184
|
|
|
165
185
|
${fieldDocEditSessionImports}
|
|
166
|
-
|
|
186
|
+
`,
|
|
187
|
+
{ refresh: 'auto', derived: ['fieldDocEditSession'], skipOwnChanges: true },
|
|
188
|
+
);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { gql } from 'graphql-tag';
|
|
2
2
|
import { inboundContactFragment } from '../fragments/inboundContactFragments.ts';
|
|
3
|
+
import { live } from '../reactivity.ts';
|
|
3
4
|
|
|
4
|
-
export const inboundContactQry =
|
|
5
|
+
export const inboundContactQry = live(
|
|
6
|
+
gql`
|
|
5
7
|
query inboundContact (
|
|
6
8
|
$organizationId: GenericID!
|
|
7
9
|
$inboundContactId: GenericID!
|
|
@@ -15,9 +17,12 @@ query inboundContact (
|
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
${inboundContactFragment}
|
|
18
|
-
|
|
20
|
+
`,
|
|
21
|
+
{ refresh: 'auto' },
|
|
22
|
+
);
|
|
19
23
|
|
|
20
|
-
export const inboundContactsQry =
|
|
24
|
+
export const inboundContactsQry = live(
|
|
25
|
+
gql`
|
|
21
26
|
query inboundContacts (
|
|
22
27
|
$organizationId: GenericID!
|
|
23
28
|
$sort: InboundContactsSort
|
|
@@ -41,4 +46,6 @@ query inboundContacts (
|
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
${inboundContactFragment}
|
|
44
|
-
|
|
49
|
+
`,
|
|
50
|
+
{ refresh: 'auto', lists: ['inboundContact'] },
|
|
51
|
+
);
|
package/gql/queries/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export * from './audienceQueries.ts';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './libraryQueries.ts';
|
|
3
3
|
export * from './agentMemoryQueries.ts';
|
|
4
4
|
export * from './agentNoteQueries.ts';
|
|
5
5
|
export * from './aiChatQueries.ts';
|
|
6
|
-
export * from './appQueries.ts';
|
|
7
6
|
export * from './authQueries.ts';
|
|
8
7
|
export * from './billingQueries.ts';
|
|
9
8
|
export * from './dataTableQueries.ts';
|
|
10
9
|
export * from './emailQueries.ts';
|
|
10
|
+
export * from './emailOutreachQueries.ts';
|
|
11
11
|
export * from './emailReplyReportQueries.ts';
|
|
12
12
|
export * from './fieldDocQueries.ts';
|
|
13
13
|
export * from './inboundContactQueries.ts';
|