@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.
- package/audience.d.ts +343 -0
- package/cache/config.ts +98 -50
- package/cache/index.chat-activity.test.ts +119 -0
- package/cache/index.chat.test.ts +92 -0
- package/cache/index.helpers.ts +96 -0
- package/cache/index.regression.test.ts +149 -0
- package/cache/index.test.ts +1017 -127
- package/cache/index.ts +1256 -1269
- package/cache/optimistic-ui-runtime.ts +46 -0
- package/cache/optimistic-ui.ts +401 -0
- package/cache/persist.ts +800 -0
- package/cache/store.ts +395 -0
- package/cache/value.helpers.ts +17 -0
- package/client/draft-persistence-indexed-db.ts +413 -0
- package/client/draft-persistence.ts +152 -0
- package/client/index.ts +3 -0
- package/client/request.helpers.ts +14 -0
- package/client/request.ts +870 -164
- package/deno.lock +187 -0
- package/deno.test.json +10 -4
- package/gql/eagerQueryMap.ts +12 -0
- package/gql/fragments/accountAuthFragments.ts +5 -0
- package/gql/fragments/accountFragments.ts +0 -3
- package/gql/fragments/accountSessionFragments.ts +16 -0
- package/gql/fragments/agentMemoryFragments.ts +23 -0
- package/gql/fragments/agentNoteFragments.ts +150 -0
- package/gql/fragments/aiChatFragments.ts +42 -0
- package/gql/fragments/audienceFragments.ts +141 -0
- package/gql/fragments/campaignFragments.ts +566 -0
- package/gql/fragments/dataTableFragments.ts +50 -192
- package/gql/fragments/emailFragments.ts +32 -17
- package/gql/fragments/fieldDocFragments.ts +264 -0
- package/gql/fragments/inboundContactFragments.ts +2 -0
- package/gql/fragments/logFragments.ts +101 -69
- package/gql/fragments/organizationFragments.ts +53 -5
- package/gql/fragments/qrCodeFragments.ts +29 -0
- package/gql/fragments/scheduleFragments.ts +667 -0
- package/gql/fragments/sheetFragments.ts +304 -63
- package/gql/fragments/storageFragments.ts +45 -0
- package/gql/fragments/workflowFragments.ts +41 -5
- package/gql/mutations/accountMutations.ts +0 -2
- package/gql/mutations/agentMemoryMutations.ts +68 -0
- package/gql/mutations/agentNoteMutations.ts +62 -0
- package/gql/mutations/aiChatMutations.ts +49 -4
- package/gql/mutations/audienceMutations.ts +71 -0
- package/gql/mutations/authMutations.ts +203 -18
- package/gql/mutations/billingMutations.ts +17 -27
- package/gql/mutations/campaignMutations.ts +258 -0
- package/gql/mutations/contactMutations.ts +23 -0
- package/gql/mutations/dataTableMutations.ts +19 -54
- package/gql/mutations/fieldDocMutations.ts +173 -0
- package/gql/mutations/index.ts +10 -2
- package/gql/mutations/logMutations.ts +6 -29
- package/gql/mutations/organizationMutations.ts +19 -4
- package/gql/mutations/qrCodeMutations.ts +20 -0
- package/gql/mutations/scheduleMutations.ts +1121 -0
- package/gql/mutations/sheetMutations.ts +221 -60
- package/gql/mutations/storageMutations.ts +19 -0
- package/gql/mutations/workflowMutations.ts +60 -0
- package/gql/queries/agentMemoryQueries.ts +28 -0
- package/gql/queries/agentNoteQueries.ts +89 -0
- package/gql/queries/aiChatQueries.ts +70 -2
- package/gql/queries/audienceQueries.ts +128 -0
- package/gql/queries/authQueries.ts +47 -0
- package/gql/queries/billingQueries.ts +118 -6
- package/gql/queries/campaignQueries.ts +236 -0
- package/gql/queries/dataTableQueries.ts +61 -13
- package/gql/queries/emailQueries.ts +26 -17
- package/gql/queries/emailReplyReportQueries.ts +76 -0
- package/gql/queries/fieldDocQueries.ts +166 -0
- package/gql/queries/inboundContactQueries.ts +4 -0
- package/gql/queries/index.ts +10 -2
- package/gql/queries/logQueries.ts +68 -30
- package/gql/queries/organizationQueries.ts +65 -1
- package/gql/queries/qrCodeQueries.ts +20 -0
- package/gql/queries/scheduleQueries.ts +691 -0
- package/gql/queries/sheetQueries.ts +244 -26
- package/gql/queries/storageQueries.ts +38 -0
- package/gql/queries/workflowQueries.ts +77 -2
- package/hooks/index.helpers.test.ts +50 -0
- package/hooks/index.helpers.ts +52 -0
- package/hooks/index.ts +2254 -982
- package/hooks/use-account-mtn.ts +76 -81
- package/hooks/use-agentMemory-mtn.ts +71 -0
- package/hooks/use-agentMemory-qry.ts +56 -0
- package/hooks/use-agentNote-mtn.ts +82 -0
- package/hooks/use-agentNote-qry.ts +190 -0
- package/hooks/use-agentNote-recovery.helpers.test.ts +68 -0
- package/hooks/use-agentNote-recovery.helpers.ts +58 -0
- package/hooks/use-agentNote-recovery.ts +72 -0
- package/hooks/use-aiChat-mtn.ts +220 -141
- package/hooks/use-aiChat-qry.helpers.test.ts +63 -0
- package/hooks/use-aiChat-qry.helpers.ts +124 -0
- package/hooks/use-aiChat-qry.ts +341 -237
- package/hooks/use-aiChat-stream-mtn.ts +14 -0
- package/hooks/use-app-qry.ts +12 -9
- package/hooks/use-audience-mtn.ts +194 -0
- package/hooks/use-audience-qry.helpers.test.ts +80 -0
- package/hooks/use-audience-qry.helpers.ts +63 -0
- package/hooks/use-audience-qry.ts +330 -0
- package/hooks/use-auth-mtn.ts +435 -252
- package/hooks/use-auth-qry.ts +51 -0
- package/hooks/use-billing-mtn.ts +31 -0
- package/hooks/use-billing-qry.ts +76 -0
- package/hooks/use-campaign-generation-recovery.ts +53 -0
- package/hooks/use-campaign-mtn.ts +436 -0
- package/hooks/use-campaign-qry.helpers.ts +40 -0
- package/hooks/use-campaign-qry.ts +834 -0
- package/hooks/use-dataTable-mtn.ts +37 -46
- package/hooks/use-dataTable-qry.ts +102 -128
- package/hooks/use-email-qry.helpers.ts +37 -0
- package/hooks/use-email-qry.ts +56 -86
- package/hooks/use-emailCampaignReplyReport-qry.ts +27 -0
- package/hooks/use-fieldDoc-mtn.ts +262 -0
- package/hooks/use-fieldDoc-qry.helpers.test.ts +65 -0
- package/hooks/use-fieldDoc-qry.helpers.ts +49 -0
- package/hooks/use-fieldDoc-qry.ts +212 -0
- package/hooks/use-inboundContact-mtn.ts +19 -16
- package/hooks/use-inboundContact-qry.ts +62 -56
- package/hooks/use-integration-mtn.ts +56 -38
- package/hooks/use-integration-qry.ts +24 -9
- package/hooks/use-log-mtn.ts +88 -59
- package/hooks/use-log-qry.ts +150 -73
- package/hooks/use-organization-mtn.ts +334 -277
- package/hooks/use-organization-qry.ts +155 -129
- package/hooks/use-publicFormEmail-mtn.ts +27 -0
- package/hooks/use-qrCode-mtn.ts +40 -0
- package/hooks/use-qrCode-qry.ts +78 -0
- package/hooks/use-schedule-mtn.ts +589 -0
- package/hooks/use-schedule-qry.ts +738 -0
- package/hooks/use-schedule-reactive.ts +486 -0
- package/hooks/use-sheet-mtn.ts +157 -79
- package/hooks/use-sheet-qry.ts +221 -92
- package/hooks/use-storage-mtn.ts +81 -41
- package/hooks/use-storage-qry.ts +128 -14
- package/hooks/use-workflow-mtn.ts +72 -0
- package/hooks/use-workflow-qry.ts +184 -47
- package/libs/ai-chat-outgoing.helpers.ts +153 -0
- package/libs/ai-chat-outgoing.ts +11 -0
- package/libs/ai-chat-outgoing.types.ts +25 -0
- package/libs/ai-chat-run-realtime.ts +20 -0
- package/libs/ai-chat-submission-realtime.ts +150 -0
- package/libs/fragment-realtime-sequence.ts +55 -0
- package/libs/fragment-recovery.test.ts +326 -0
- package/libs/fragment-recovery.ts +325 -0
- package/libs/open-sheet.ts +138 -0
- package/libs/orchestrator-realtime.helpers.test.ts +229 -0
- package/libs/orchestrator-realtime.helpers.ts +317 -0
- package/libs/orchestrator-realtime.ts +433 -0
- package/libs/request-cache-regression.test.ts +122 -0
- package/libs/request-managed-session.test.ts +574 -0
- package/libs/request-no-store.test.ts +419 -0
- package/libs/sheet-command-batch.ts +44 -0
- package/libs/sheet-view-realtime-router.test.ts +214 -0
- package/libs/sheet-view-realtime-router.ts +99 -0
- package/libs/sse-ticket.test.ts +26 -0
- package/loaders/campaign.test.ts +186 -0
- package/loaders/campaign.ts +110 -0
- package/loaders/emailPreference.ts +75 -0
- package/loaders/rest.ts +12 -0
- package/package.json +119 -71
- package/schedule.d.ts +1790 -0
- package/sse.helpers.ts +19 -0
- package/sse.ts +70 -106
- package/tests/agent-note-detail-cache.test.ts +120 -0
- package/tests/agent-note-search.test.ts +444 -0
- package/tsconfig.json +11 -10
- package/types.d.ts +77 -26
- package/utils.ts +78 -49
- package/gql/fragments/billingFragments.ts +0 -25
- package/gql/fragments/productFragments.ts +0 -39
- package/gql/fragments/reportFragments.ts +0 -90
- package/gql/queries/productQueries.ts +0 -31
- package/gql/queries/reportQueries.ts +0 -134
- package/hooks/use-product-qry.ts +0 -67
- package/hooks/use-report-qry.ts +0 -153
|
@@ -1,171 +1,44 @@
|
|
|
1
|
+
// The one DataTable fragment: every listing, detail and mutation selects it,
|
|
2
|
+
// and the server's $dataTableFragment realtime updates patch it.
|
|
1
3
|
export const dataTableFragment = `fragment dataTableFragment on DataTable {
|
|
2
4
|
id
|
|
5
|
+
cursor
|
|
3
6
|
organizationId
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
kind
|
|
9
|
+
source
|
|
6
10
|
title
|
|
7
11
|
description
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
format
|
|
28
|
-
instructions
|
|
29
|
-
openLink
|
|
30
|
-
humansOnly
|
|
31
|
-
humansCannotEdit
|
|
32
|
-
hidden
|
|
33
|
-
indexed
|
|
34
|
-
width
|
|
35
|
-
|
|
36
|
-
source {
|
|
37
|
-
path
|
|
38
|
-
table
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
options {
|
|
42
|
-
label
|
|
43
|
-
value
|
|
44
|
-
color
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
views {
|
|
49
|
-
id
|
|
50
|
-
name
|
|
51
|
-
layout
|
|
52
|
-
iconName
|
|
53
|
-
color
|
|
54
|
-
description
|
|
55
|
-
columnsOrder
|
|
56
|
-
stickyTop
|
|
57
|
-
stickyLeft
|
|
58
|
-
humansCannotEdit
|
|
59
|
-
|
|
60
|
-
rowModel {
|
|
61
|
-
type
|
|
62
|
-
|
|
63
|
-
dimensions {
|
|
64
|
-
key
|
|
65
|
-
label
|
|
66
|
-
|
|
67
|
-
source {
|
|
68
|
-
type
|
|
69
|
-
cellKey
|
|
70
|
-
formulaKey
|
|
71
|
-
dimensionKey
|
|
72
|
-
table
|
|
73
|
-
path
|
|
74
|
-
sourceCellKey
|
|
75
|
-
sourceCellKeys
|
|
76
|
-
operation
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
generator {
|
|
81
|
-
keyPrefix
|
|
82
|
-
|
|
83
|
-
dateSeries {
|
|
84
|
-
key
|
|
85
|
-
label
|
|
86
|
-
sourceCellKey
|
|
87
|
-
grain
|
|
88
|
-
weekStart
|
|
89
|
-
|
|
90
|
-
range {
|
|
91
|
-
type
|
|
92
|
-
start
|
|
93
|
-
end
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
dimensions {
|
|
98
|
-
key
|
|
99
|
-
label
|
|
100
|
-
|
|
101
|
-
source {
|
|
102
|
-
type
|
|
103
|
-
cellKey
|
|
104
|
-
|
|
105
|
-
values {
|
|
106
|
-
value
|
|
107
|
-
label
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
measures {
|
|
113
|
-
key
|
|
114
|
-
label
|
|
115
|
-
operation
|
|
116
|
-
sourceCellKey
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
columns {
|
|
122
|
-
key
|
|
123
|
-
label
|
|
124
|
-
humanLabel
|
|
125
|
-
iconName
|
|
126
|
-
fieldType
|
|
127
|
-
humanFieldType
|
|
128
|
-
openLink
|
|
129
|
-
humansCannotEdit
|
|
130
|
-
width
|
|
131
|
-
|
|
132
|
-
source {
|
|
133
|
-
type
|
|
134
|
-
cellKey
|
|
135
|
-
formulaKey
|
|
136
|
-
dimensionKey
|
|
137
|
-
table
|
|
138
|
-
path
|
|
139
|
-
sourceCellKey
|
|
140
|
-
sourceCellKeys
|
|
141
|
-
operation
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
options {
|
|
145
|
-
label
|
|
146
|
-
value
|
|
147
|
-
color
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
filters {
|
|
152
|
-
id
|
|
153
|
-
columnKey
|
|
154
|
-
operator
|
|
155
|
-
value
|
|
156
|
-
enabled
|
|
157
|
-
}
|
|
12
|
+
rowCount
|
|
13
|
+
revision
|
|
14
|
+
syncState
|
|
15
|
+
syncError
|
|
16
|
+
syncedAt
|
|
17
|
+
derivePausedAt
|
|
18
|
+
derivePauseReason
|
|
19
|
+
canManage
|
|
20
|
+
archivedAt
|
|
21
|
+
|
|
22
|
+
columns {
|
|
23
|
+
key
|
|
24
|
+
label
|
|
25
|
+
type
|
|
26
|
+
origin
|
|
27
|
+
unit
|
|
28
|
+
currency
|
|
29
|
+
retired
|
|
30
|
+
}
|
|
158
31
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
32
|
+
coverageWarnings {
|
|
33
|
+
code
|
|
34
|
+
columnKey
|
|
35
|
+
message
|
|
36
|
+
}
|
|
163
37
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
38
|
+
ownerNote {
|
|
39
|
+
id
|
|
40
|
+
headline
|
|
41
|
+
emoji
|
|
169
42
|
}
|
|
170
43
|
|
|
171
44
|
createdAt
|
|
@@ -174,39 +47,24 @@ export const dataTableFragment = `fragment dataTableFragment on DataTable {
|
|
|
174
47
|
|
|
175
48
|
export const dataTableRowFragment = `fragment dataTableRowFragment on DataTableRow {
|
|
176
49
|
id
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
viewRowKey
|
|
184
|
-
position
|
|
185
|
-
metadata
|
|
50
|
+
key
|
|
51
|
+
cells
|
|
52
|
+
sourceReadableId
|
|
53
|
+
derivePending
|
|
54
|
+
deriveError
|
|
55
|
+
changedAt
|
|
186
56
|
}`;
|
|
187
57
|
|
|
188
|
-
export const
|
|
58
|
+
export const dataTableRunFragment = `fragment dataTableRunFragment on DataTableRun {
|
|
189
59
|
id
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
datetimeValue
|
|
201
|
-
relatedTable
|
|
202
|
-
relatedId
|
|
203
|
-
reference {
|
|
204
|
-
dataTableId
|
|
205
|
-
dataTableRowId
|
|
206
|
-
cellKey
|
|
207
|
-
}
|
|
208
|
-
referenceStatus
|
|
209
|
-
|
|
210
|
-
createdAt
|
|
211
|
-
updatedAt
|
|
60
|
+
cause
|
|
61
|
+
added
|
|
62
|
+
changed
|
|
63
|
+
removed
|
|
64
|
+
derived
|
|
65
|
+
llmCalls
|
|
66
|
+
reason
|
|
67
|
+
error
|
|
68
|
+
startedAt
|
|
69
|
+
finishedAt
|
|
212
70
|
}`;
|
|
@@ -1,26 +1,41 @@
|
|
|
1
|
-
export const
|
|
2
|
-
name
|
|
3
|
-
contentType
|
|
4
|
-
contentLength
|
|
5
|
-
}`;
|
|
6
|
-
|
|
7
|
-
export const inboundEmailFragment = `fragment inboundEmailFragment on InboundEmail {
|
|
1
|
+
export const emailMessageFragment = `fragment emailMessageFragment on EmailMessage {
|
|
8
2
|
id
|
|
9
3
|
cursor
|
|
10
4
|
organizationId
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
subject
|
|
14
|
-
postmarkMessageId
|
|
5
|
+
direction
|
|
6
|
+
kind
|
|
15
7
|
status
|
|
16
|
-
|
|
8
|
+
statusGroup
|
|
9
|
+
statusDetail
|
|
10
|
+
fromEmail
|
|
11
|
+
fromName
|
|
12
|
+
toEmail
|
|
13
|
+
toName
|
|
14
|
+
subject
|
|
17
15
|
previewText
|
|
18
|
-
|
|
16
|
+
postmarkMessageId
|
|
17
|
+
campaignId
|
|
18
|
+
relatedEmailMessageId
|
|
19
|
+
occurredAt
|
|
20
|
+
}`;
|
|
21
|
+
|
|
22
|
+
export const emailMessageDetailsFragment = `fragment emailMessageDetailsFragment on EmailMessage {
|
|
23
|
+
id
|
|
19
24
|
bodyText
|
|
20
|
-
|
|
21
|
-
...inboundEmailAttachmentFragment
|
|
22
|
-
}
|
|
23
|
-
receivedAt
|
|
25
|
+
bodyFormat
|
|
24
26
|
processingStartedAt
|
|
25
27
|
processingCompletedAt
|
|
28
|
+
replyToEmail
|
|
29
|
+
cc
|
|
30
|
+
replyToName
|
|
31
|
+
suppressionReason
|
|
32
|
+
sentAt
|
|
33
|
+
deliveredAt
|
|
34
|
+
firstOpenedAt
|
|
35
|
+
bouncedAt
|
|
36
|
+
bounceType
|
|
37
|
+
spamComplaintAt
|
|
38
|
+
broadcast
|
|
39
|
+
relatedLogIds
|
|
40
|
+
updatedAt
|
|
26
41
|
}`;
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
// Program-owned group fields shared by program lists, forms and editor sources.
|
|
2
|
+
export const fieldDocProgramGroupFragment = `fragment fieldDocProgramGroupFragment on FieldDocProgramGroup {
|
|
3
|
+
id
|
|
4
|
+
fieldDocProgramId
|
|
5
|
+
name
|
|
6
|
+
order
|
|
7
|
+
}`;
|
|
8
|
+
|
|
9
|
+
// Org-agnostic program fields. Per-organization data (enrollment state, forms)
|
|
10
|
+
// never goes on this fragment: one cache entry is shared by every organization.
|
|
11
|
+
export const fieldDocProgramFragment = `fragment fieldDocProgramFragment on FieldDocProgram {
|
|
12
|
+
id
|
|
13
|
+
isCatalog
|
|
14
|
+
name
|
|
15
|
+
shortName
|
|
16
|
+
description
|
|
17
|
+
categoryKey
|
|
18
|
+
operations
|
|
19
|
+
layout {
|
|
20
|
+
columns
|
|
21
|
+
headers
|
|
22
|
+
gridLayoutStyle
|
|
23
|
+
}
|
|
24
|
+
retired
|
|
25
|
+
}`;
|
|
26
|
+
|
|
27
|
+
// Enrollment scalars only; id is "<organizationId>:<programId>". Program and
|
|
28
|
+
// forms are selected beside it (fieldDocProgramEnrollmentStatement).
|
|
29
|
+
export const fieldDocProgramEnrollmentFragment = `fragment fieldDocProgramEnrollmentFragment on FieldDocProgramEnrollment {
|
|
30
|
+
id
|
|
31
|
+
organizationId
|
|
32
|
+
archivedAt
|
|
33
|
+
restorableUntil
|
|
34
|
+
}`;
|
|
35
|
+
|
|
36
|
+
// The form; org-agnostic
|
|
37
|
+
export const fieldDocFragment = `fragment fieldDocFragment on FieldDoc {
|
|
38
|
+
order
|
|
39
|
+
id
|
|
40
|
+
fieldDocProgramId
|
|
41
|
+
documentName
|
|
42
|
+
title
|
|
43
|
+
draftTitle
|
|
44
|
+
description
|
|
45
|
+
frequency
|
|
46
|
+
isProgramDoc
|
|
47
|
+
retired
|
|
48
|
+
published
|
|
49
|
+
publishedRevisionNumber
|
|
50
|
+
hasDraft
|
|
51
|
+
}`;
|
|
52
|
+
|
|
53
|
+
// The one submission shape, shared by submission lists and the document header.
|
|
54
|
+
// Spread it directly in operations, never inside another fragment.
|
|
55
|
+
export const fieldDocSubmissionFragment = `fragment fieldDocSubmissionFragment on FieldDocSubmission {
|
|
56
|
+
id
|
|
57
|
+
cursor
|
|
58
|
+
readableId
|
|
59
|
+
fieldDocId
|
|
60
|
+
fieldDocProgramId
|
|
61
|
+
programName
|
|
62
|
+
programShortName
|
|
63
|
+
isProgramDoc
|
|
64
|
+
definitionRevisionId
|
|
65
|
+
|
|
66
|
+
organizationId
|
|
67
|
+
organizationName
|
|
68
|
+
childOrgId
|
|
69
|
+
childOrgName
|
|
70
|
+
siteId
|
|
71
|
+
location
|
|
72
|
+
|
|
73
|
+
documentName
|
|
74
|
+
title
|
|
75
|
+
frequency
|
|
76
|
+
period
|
|
77
|
+
status
|
|
78
|
+
statusOverridden
|
|
79
|
+
summary
|
|
80
|
+
identifierHint
|
|
81
|
+
|
|
82
|
+
instanceKey
|
|
83
|
+
instanceStatus
|
|
84
|
+
instanceClosedAt
|
|
85
|
+
|
|
86
|
+
activityAt
|
|
87
|
+
createdAt
|
|
88
|
+
updatedAt
|
|
89
|
+
}`;
|
|
90
|
+
|
|
91
|
+
// Immutable definition revision scalars; sections and elements are selected
|
|
92
|
+
// beside it with their own fragments
|
|
93
|
+
export const fieldDocDefinitionFragment = `fragment fieldDocDefinitionFragment on FieldDocDefinition {
|
|
94
|
+
id
|
|
95
|
+
fieldDocId
|
|
96
|
+
revisionNumber
|
|
97
|
+
title
|
|
98
|
+
description
|
|
99
|
+
}`;
|
|
100
|
+
|
|
101
|
+
export const fieldDocDefinitionSectionFragment = `fragment fieldDocDefinitionSectionFragment on FieldDocDefinitionSection {
|
|
102
|
+
id
|
|
103
|
+
key
|
|
104
|
+
title
|
|
105
|
+
description
|
|
106
|
+
}`;
|
|
107
|
+
|
|
108
|
+
export const fieldDocDefinitionElementFragment = `fragment fieldDocDefinitionElementFragment on FieldDocDefinitionElement {
|
|
109
|
+
id
|
|
110
|
+
key
|
|
111
|
+
kind
|
|
112
|
+
label
|
|
113
|
+
description
|
|
114
|
+
options
|
|
115
|
+
required
|
|
116
|
+
allowMultipleAnswers
|
|
117
|
+
doNotAllowNotes
|
|
118
|
+
answerType
|
|
119
|
+
tableColumns {
|
|
120
|
+
key
|
|
121
|
+
label
|
|
122
|
+
type
|
|
123
|
+
required
|
|
124
|
+
options
|
|
125
|
+
}
|
|
126
|
+
lineNumber
|
|
127
|
+
}`;
|
|
128
|
+
|
|
129
|
+
// One answer; id is "<submissionId>:<key>". Spread it directly in operations,
|
|
130
|
+
// never inside another fragment.
|
|
131
|
+
export const fieldDocAnswerFragment = `fragment fieldDocAnswerFragment on FieldDocAnswer {
|
|
132
|
+
id
|
|
133
|
+
key
|
|
134
|
+
text
|
|
135
|
+
tableRows {
|
|
136
|
+
id
|
|
137
|
+
cells {
|
|
138
|
+
key
|
|
139
|
+
text
|
|
140
|
+
isCustomBooleanLabel
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
answerState
|
|
144
|
+
answerReason
|
|
145
|
+
note
|
|
146
|
+
warningNote
|
|
147
|
+
referenceIds
|
|
148
|
+
}`;
|
|
149
|
+
|
|
150
|
+
// Edit session scalars only; id is "<organizationId>:<fieldDocId>". The source,
|
|
151
|
+
// editor and custom instructions are selected beside it (fieldDocEditSessionStatement).
|
|
152
|
+
export const fieldDocEditSessionFragment = `fragment fieldDocEditSessionFragment on FieldDocEditSession {
|
|
153
|
+
id
|
|
154
|
+
organizationId
|
|
155
|
+
mode
|
|
156
|
+
manageable
|
|
157
|
+
}`;
|
|
158
|
+
|
|
159
|
+
// id is "<organizationId>:<fieldDocId>"
|
|
160
|
+
export const fieldDocEditorSourceFragment = `fragment fieldDocEditorSourceFragment on FieldDocEditorSource {
|
|
161
|
+
order
|
|
162
|
+
id
|
|
163
|
+
fieldDocId
|
|
164
|
+
organizationId
|
|
165
|
+
fieldDocProgramId
|
|
166
|
+
isProgramDoc
|
|
167
|
+
documentName
|
|
168
|
+
frequency
|
|
169
|
+
editVersion
|
|
170
|
+
hasDraft
|
|
171
|
+
draftStale
|
|
172
|
+
publishedRevisionNumber
|
|
173
|
+
draftUpdatedAt
|
|
174
|
+
}`;
|
|
175
|
+
|
|
176
|
+
// Nested fragments are selected directly by operations, never spread inside another fragment.
|
|
177
|
+
export const fieldDocProgramStatement = `...fieldDocProgramFragment
|
|
178
|
+
groups {
|
|
179
|
+
...fieldDocProgramGroupFragment
|
|
180
|
+
}`;
|
|
181
|
+
|
|
182
|
+
export const fieldDocStatement = `...fieldDocFragment
|
|
183
|
+
group {
|
|
184
|
+
...fieldDocProgramGroupFragment
|
|
185
|
+
}`;
|
|
186
|
+
|
|
187
|
+
export const fieldDocEditorSourceStatement = `...fieldDocEditorSourceFragment
|
|
188
|
+
group {
|
|
189
|
+
...fieldDocProgramGroupFragment
|
|
190
|
+
}`;
|
|
191
|
+
|
|
192
|
+
export const fieldDocProgramImports = `${fieldDocProgramFragment}
|
|
193
|
+
${fieldDocProgramGroupFragment}`;
|
|
194
|
+
export const fieldDocImports = `${fieldDocFragment}
|
|
195
|
+
${fieldDocProgramGroupFragment}`;
|
|
196
|
+
export const fieldDocEditorSourceImports = `${fieldDocEditorSourceFragment}
|
|
197
|
+
${fieldDocProgramGroupFragment}`;
|
|
198
|
+
|
|
199
|
+
// The enrollment selection shared by fieldDocProgramEnrollments and every
|
|
200
|
+
// mutation returning FieldDocProgramEnrollment, so all of them cache the same tree
|
|
201
|
+
export const fieldDocProgramEnrollmentStatement = `...fieldDocProgramEnrollmentFragment
|
|
202
|
+
|
|
203
|
+
fieldDocSubmissionUpdates {
|
|
204
|
+
fieldDocId
|
|
205
|
+
lastSubmissionUpdatedAt
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
program {
|
|
209
|
+
${fieldDocProgramStatement}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
forms {
|
|
213
|
+
${fieldDocStatement}
|
|
214
|
+
}`;
|
|
215
|
+
|
|
216
|
+
export const fieldDocProgramEnrollmentImports = `
|
|
217
|
+
${fieldDocProgramEnrollmentFragment}
|
|
218
|
+
${fieldDocProgramGroupFragment}
|
|
219
|
+
${fieldDocProgramFragment}
|
|
220
|
+
${fieldDocFragment}
|
|
221
|
+
`;
|
|
222
|
+
|
|
223
|
+
// The edit session selection shared by fieldDocEditSession and
|
|
224
|
+
// editFieldDocCustomInstructions, so the mutation result updates the cached session
|
|
225
|
+
export const fieldDocEditSessionStatement = `...fieldDocEditSessionFragment
|
|
226
|
+
|
|
227
|
+
fieldDoc {
|
|
228
|
+
${fieldDocEditorSourceStatement}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
editor {
|
|
232
|
+
definition {
|
|
233
|
+
title
|
|
234
|
+
description
|
|
235
|
+
agentHint
|
|
236
|
+
sections {
|
|
237
|
+
key
|
|
238
|
+
label
|
|
239
|
+
description
|
|
240
|
+
hint
|
|
241
|
+
elements {
|
|
242
|
+
key
|
|
243
|
+
kind
|
|
244
|
+
label
|
|
245
|
+
description
|
|
246
|
+
hint
|
|
247
|
+
options
|
|
248
|
+
required
|
|
249
|
+
settings
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
customInstructions {
|
|
256
|
+
elementKey
|
|
257
|
+
instructions
|
|
258
|
+
updatedAt
|
|
259
|
+
}`;
|
|
260
|
+
|
|
261
|
+
export const fieldDocEditSessionImports = `
|
|
262
|
+
${fieldDocEditSessionFragment}
|
|
263
|
+
${fieldDocEditorSourceImports}
|
|
264
|
+
`;
|