@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
@@ -1,213 +1,256 @@
1
1
  import { gql } from 'graphql-tag';
2
2
  import {
3
+ campaignAccessFragment,
3
4
  campaignFragment,
4
- campaignTemplateElementFragment,
5
+ campaignGenerationLifecycleFragment,
6
+ campaignSettingsFragment,
5
7
  campaignTemplateFragment,
8
+ campaignTemplateLifecycleFragment,
6
9
  } from '../fragments/campaignFragments.ts';
10
+ import { storageFileFragment } from '../fragments/storageFragments.ts';
7
11
 
8
12
  /**
9
- * Returns a GENERATING template immediately. The definition is written by a
10
- * durable job, and the settled ACTIVE or ERROR state arrives over the
11
- * websocket as a $campaignTemplateFragment patch.
13
+ * Returns a GENERATING campaign immediately. The draft is written by a
14
+ * durable job, then a GraphQL-only GENERATED websocket patch tells observers
15
+ * to refetch the persisted COMPLETE or ERROR result.
12
16
  */
13
17
 
14
- export const createCampaignTemplateMtn = gql`
15
- mutation createCampaignTemplate (
18
+ export const createCampaignMtn = gql`
19
+ mutation createCampaign (
16
20
  $organizationId: GenericID!
17
- $kind: CampaignKind!
21
+ $templateId: GenericID!
18
22
  $instructions: String
19
23
  $sourceStorageIds: [GenericID!]
20
24
  $title: String
21
- $siteId: GenericID
22
25
  ) {
23
- createCampaignTemplate (
26
+ createCampaign (
24
27
  organizationId: $organizationId
25
- kind: $kind
28
+ templateId: $templateId
26
29
  instructions: $instructions
27
30
  sourceStorageIds: $sourceStorageIds
28
31
  title: $title
29
- siteId: $siteId
30
32
  ) {
31
- ...campaignTemplateFragment
33
+ ...campaignFragment
32
34
  }
33
35
  }
34
- ${campaignTemplateElementFragment}
35
- ${campaignTemplateFragment}
36
+ ${campaignFragment}
36
37
  `;
37
38
 
38
- export const retryCampaignTemplateGenerationMtn = gql`
39
- mutation retryCampaignTemplateGeneration (
39
+ export const retryCampaignGenerationMtn = gql`
40
+ mutation retryCampaignGeneration (
40
41
  $organizationId: GenericID!
41
- $templateId: GenericID!
42
+ $campaignId: GenericID!
42
43
  ) {
43
- retryCampaignTemplateGeneration (
44
+ retryCampaignGeneration (
44
45
  organizationId: $organizationId
45
- templateId: $templateId
46
+ campaignId: $campaignId
46
47
  ) {
47
- ...campaignTemplateFragment
48
+ ...campaignGenerationLifecycleFragment
48
49
  }
49
50
  }
50
- ${campaignTemplateElementFragment}
51
- ${campaignTemplateFragment}
51
+ ${campaignGenerationLifecycleFragment}
52
52
  `;
53
53
 
54
- export const updateCampaignTemplateMtn = gql`
55
- mutation updateCampaignTemplate (
56
- $organizationId: GenericID!
57
- $templateId: GenericID!
58
- $title: String
59
- $description: String
60
- $responseWorkflowId: GenericID
61
- $siteId: GenericID
62
- $headerImageStorageId: GenericID
63
- $settings: CampaignSettingsInput
54
+ /**
55
+ * Create one empty, editable campaign template owned by the organization.
56
+ */
57
+
58
+ export const createCampaignTemplateMtn = gql`
59
+ mutation createCampaignTemplate (
60
+ $input: CreateCampaignTemplateInput!
64
61
  ) {
65
- updateCampaignTemplate (
66
- organizationId: $organizationId
67
- templateId: $templateId
68
- title: $title
69
- description: $description
70
- responseWorkflowId: $responseWorkflowId
71
- siteId: $siteId
72
- headerImageStorageId: $headerImageStorageId
73
- settings: $settings
74
- ) {
62
+ createCampaignTemplate (input: $input) {
75
63
  ...campaignTemplateFragment
76
64
  }
77
65
  }
78
- ${campaignTemplateElementFragment}
79
66
  ${campaignTemplateFragment}
80
67
  `;
81
68
 
82
- export const saveCampaignTemplateDefinitionMtn = gql`
83
- mutation saveCampaignTemplateDefinition (
84
- $organizationId: GenericID!
85
- $templateId: GenericID!
86
- $sections: [CampaignSectionInput!]!
69
+ /**
70
+ * Apply one optimistic-concurrency editor patch to a reusable template.
71
+ */
72
+
73
+ export const editCampaignTemplateMtn = gql`
74
+ mutation editCampaignTemplate (
75
+ $input: EditCampaignTemplateInput!
87
76
  ) {
88
- saveCampaignTemplateDefinition (
89
- organizationId: $organizationId
90
- templateId: $templateId
91
- sections: $sections
92
- ) {
93
- ...campaignTemplateFragment
77
+ editCampaignTemplate (input: $input) {
78
+ editVersion
94
79
  }
95
80
  }
96
- ${campaignTemplateElementFragment}
97
- ${campaignTemplateFragment}
98
81
  `;
99
82
 
100
- export const saveCampaignDefinitionMtn = gql`
101
- mutation saveCampaignDefinition (
102
- $organizationId: GenericID!
103
- $campaignId: GenericID!
104
- $title: String
105
- $description: String
106
- $sections: [CampaignSectionInput!]!
83
+ /**
84
+ * Apply one optimistic-concurrency editor patch to a campaign.
85
+ */
86
+
87
+ export const editCampaignMtn = gql`
88
+ mutation editCampaign (
89
+ $input: EditCampaignInput!
107
90
  ) {
108
- saveCampaignDefinition (
109
- organizationId: $organizationId
110
- campaignId: $campaignId
111
- title: $title
112
- description: $description
113
- sections: $sections
114
- ) {
115
- ...campaignFragment
91
+ editCampaign (input: $input) {
92
+ editVersion
116
93
  }
117
94
  }
118
- ${campaignFragment}
119
95
  `;
120
96
 
121
- export const archiveCampaignTemplateMtn = gql`
122
- mutation archiveCampaignTemplate (
97
+ /**
98
+ * Finalize a direct header-image upload before linking it through an editor
99
+ * patch. The ordinary GCS webhook remains the idempotent fallback.
100
+ */
101
+ export const finalizeCampaignHeaderImageUploadMtn = gql`
102
+ mutation finalizeCampaignHeaderImageUpload (
123
103
  $organizationId: GenericID!
124
- $templateId: GenericID!
104
+ $storageId: GenericID!
125
105
  ) {
126
- archiveCampaignTemplate (
106
+ finalizeCampaignHeaderImageUpload (
127
107
  organizationId: $organizationId
128
- templateId: $templateId
108
+ storageId: $storageId
129
109
  ) {
130
- ...campaignTemplateFragment
110
+ ...storageFileFragment
131
111
  }
132
112
  }
133
- ${campaignTemplateElementFragment}
134
- ${campaignTemplateFragment}
113
+ ${storageFileFragment}
135
114
  `;
136
115
 
137
- export const publishCampaignMtn = gql`
138
- mutation publishCampaign (
116
+ /**
117
+ * Finalize a direct campaign-element image upload before linking it through
118
+ * an editor patch. The ordinary GCS webhook remains the idempotent fallback.
119
+ */
120
+ export const finalizeCampaignElementImageUploadMtn = gql`
121
+ mutation finalizeCampaignElementImageUpload (
139
122
  $organizationId: GenericID!
140
- $templateId: GenericID!
141
- $audience: CampaignAudience!
142
- $idempotencyKey: String
143
- $title: String
144
- $description: String
145
- $settings: CampaignSettingsInput
146
- $opensAt: String
147
- $closesAt: String
148
- $scheduledAt: String
123
+ $storageId: GenericID!
149
124
  ) {
150
- publishCampaign (
125
+ finalizeCampaignElementImageUpload (
151
126
  organizationId: $organizationId
152
- templateId: $templateId
153
- audience: $audience
154
- idempotencyKey: $idempotencyKey
155
- title: $title
156
- description: $description
157
- settings: $settings
158
- opensAt: $opensAt
159
- closesAt: $closesAt
160
- scheduledAt: $scheduledAt
127
+ storageId: $storageId
161
128
  ) {
162
- ...campaignFragment
129
+ ...storageFileFragment
163
130
  }
164
131
  }
165
- ${campaignFragment}
132
+ ${storageFileFragment}
166
133
  `;
167
134
 
168
- export const sendCampaignEmailMtn = gql`
169
- mutation sendCampaignEmail (
170
- $organizationId: GenericID!
171
- $templateId: GenericID!
172
- $inboundContactIds: [GenericID!]
173
- $sendBatchId: String
135
+ /**
136
+ * Apply one versioned public-form audience change.
137
+ */
138
+
139
+ export const updateCampaignAccessMtn = gql`
140
+ mutation updateCampaignAccess (
141
+ $input: UpdateCampaignAccessInput!
174
142
  ) {
175
- sendCampaignEmail (
176
- organizationId: $organizationId
177
- templateId: $templateId
178
- inboundContactIds: $inboundContactIds
179
- sendBatchId: $sendBatchId
143
+ updateCampaignAccess (input: $input) {
144
+ ...campaignAccessFragment
145
+ }
146
+ }
147
+ ${campaignAccessFragment}
148
+ `;
149
+
150
+ /*
151
+ * Submit or replace one complete response against the publication currently
152
+ * shown to the respondent.
153
+ */
154
+ export const submitCampaignResponseMtn = gql`
155
+ mutation submitCampaignResponse (
156
+ $publicId: String!
157
+ $childOrgId: GenericID
158
+ $expectedPublicationVersion: Int!
159
+ $answers: [SubmitCampaignAnswerInput!]!
160
+ $sendResponseCopyToEmail: Boolean
161
+ ) {
162
+ submitCampaignResponse (
163
+ publicId: $publicId
164
+ childOrgId: $childOrgId
165
+ expectedPublicationVersion: $expectedPublicationVersion
166
+ answers: $answers
167
+ sendResponseCopyToEmail: $sendResponseCopyToEmail
180
168
  ) {
169
+ responseId
170
+ submittedAt
171
+ }
172
+ }
173
+ `;
174
+
175
+ /**
176
+ * Create one editable public-form campaign draft from an active template.
177
+ */
178
+ export const createFormCampaignDraftMtn = gql`
179
+ mutation createFormCampaignDraft (
180
+ $input: CreateFormCampaignDraftInput!
181
+ ) {
182
+ createFormCampaignDraft (input: $input) {
181
183
  ...campaignFragment
182
184
  }
183
185
  }
184
186
  ${campaignFragment}
185
187
  `;
186
188
 
187
- export const closeCampaignMtn = gql`
188
- mutation closeCampaign (
189
- $organizationId: GenericID!
190
- $campaignId: GenericID!
189
+ /**
190
+ * Create one editable email campaign draft from an active email template.
191
+ */
192
+ export const createEmailCampaignDraftMtn = gql`
193
+ mutation createEmailCampaignDraft (
194
+ $input: CreateEmailCampaignDraftInput!
191
195
  ) {
192
- closeCampaign (
193
- organizationId: $organizationId
194
- campaignId: $campaignId
195
- ) {
196
+ createEmailCampaignDraft (input: $input) {
196
197
  ...campaignFragment
197
198
  }
198
199
  }
199
200
  ${campaignFragment}
200
201
  `;
201
202
 
202
- export const cancelCampaignMtn = gql`
203
- mutation cancelCampaign (
203
+ /**
204
+ * Edit one campaign's versioned settings, draft reset, or lifecycle.
205
+ */
206
+ export const editCampaignSettingsMtn = gql`
207
+ mutation editCampaignSettings (
208
+ $input: EditCampaignSettingsInput!
209
+ ) {
210
+ editCampaignSettings (input: $input) {
211
+ ...campaignSettingsFragment
212
+ }
213
+ }
214
+ ${campaignSettingsFragment}
215
+ `;
216
+
217
+ /*
218
+ * Send one test of an email campaign's saved content to a member of the organization.
219
+ */
220
+ export const sendCampaignTestEmailMtn = gql`
221
+ mutation sendCampaignTestEmail (
222
+ $input: SendCampaignTestEmailInput!
223
+ ) {
224
+ sendCampaignTestEmail (input: $input) {
225
+ toEmail
226
+ }
227
+ }
228
+ `;
229
+
230
+ export const archiveCampaignTemplateMtn = gql`
231
+ mutation archiveCampaignTemplate (
204
232
  $organizationId: GenericID!
205
- $campaignId: GenericID!
233
+ $templateId: GenericID!
206
234
  ) {
207
- cancelCampaign (
235
+ archiveCampaignTemplate (
208
236
  organizationId: $organizationId
209
- campaignId: $campaignId
237
+ templateId: $templateId
210
238
  ) {
239
+ ...campaignTemplateLifecycleFragment
240
+ }
241
+ }
242
+ ${campaignTemplateLifecycleFragment}
243
+ `;
244
+
245
+ /**
246
+ * @deprecated Create an email campaign draft, select its audience lists, and use
247
+ * editCampaignSettings with command.sendEmail.
248
+ */
249
+ export const sendCampaignEmailMtn = gql`
250
+ mutation sendCampaignEmail (
251
+ $input: SendCampaignEmailInput!
252
+ ) {
253
+ sendCampaignEmail (input: $input) {
211
254
  ...campaignFragment
212
255
  }
213
256
  }
@@ -0,0 +1,23 @@
1
+ import { gql } from 'graphql-tag';
2
+
3
+ export const submitContactRequestMtn = gql`
4
+ mutation submitContactRequest (
5
+ $email: String!
6
+ $firstName: String!
7
+ $lastName: String!
8
+ $jobTitle: String!
9
+ $companyName: String!
10
+ $industry: ContactIndustry!
11
+ $turnstileToken: String!
12
+ ) {
13
+ submitContactRequest (
14
+ email: $email
15
+ firstName: $firstName
16
+ lastName: $lastName
17
+ jobTitle: $jobTitle
18
+ companyName: $companyName
19
+ industry: $industry
20
+ turnstileToken: $turnstileToken
21
+ )
22
+ }
23
+ `;
@@ -1,24 +1,22 @@
1
1
  import { gql } from 'graphql-tag';
2
- import {
3
- dataTableCellFragment,
4
- dataTableFragment,
5
- dataTableRowFragment,
6
- } from '../fragments/dataTableFragments.ts';
2
+ import { dataTableFragment } from '../fragments/dataTableFragments.ts';
7
3
 
8
- export const createDataTableMtn = gql`
9
- mutation createDataTable (
4
+ export const renameDataTableMtn = gql`
5
+ mutation renameDataTable (
10
6
  $organizationId: GenericID!
7
+ $dataTableId: GenericID!
11
8
  $title: String!
12
- $name: String
13
- $description: String
14
9
  ) {
15
- createDataTable (
10
+ renameDataTable (
16
11
  organizationId: $organizationId
12
+ dataTableId: $dataTableId
17
13
  title: $title
18
- name: $name
19
- description: $description
20
- )
14
+ ) {
15
+ ...dataTableFragment
16
+ }
21
17
  }
18
+
19
+ ${dataTableFragment}
22
20
  `;
23
21
 
24
22
  export const deleteDataTableMtn = gql`
@@ -33,74 +31,19 @@ mutation deleteDataTable (
33
31
  }
34
32
  `;
35
33
 
36
- export const editDataTableCellsMtn = gql`
37
- mutation editDataTableCells (
34
+ export const exportDataTableToFileMtn = gql`
35
+ mutation exportDataTableToFile (
38
36
  $organizationId: GenericID!
39
37
  $dataTableId: GenericID!
40
- $cells: [DataTableCellEditInput!]!
41
- $commandId: String
42
38
  ) {
43
- editDataTableCells (
39
+ exportDataTableToFile (
44
40
  organizationId: $organizationId
45
41
  dataTableId: $dataTableId
46
- cells: $cells
47
- commandId: $commandId
48
42
  ) {
49
- ...dataTableCellFragment
43
+ fileUri
44
+ name
45
+ contentType
46
+ size
50
47
  }
51
48
  }
52
-
53
- ${dataTableCellFragment}
54
- `;
55
-
56
- export const deleteDataTableRowsMtn = gql`
57
- mutation deleteDataTableRows (
58
- $organizationId: GenericID!
59
- $dataTableId: GenericID!
60
- $dataTableRowIds: [GenericID!]!
61
- $commandId: String
62
- $previewClientId: String
63
- $previewEnvelopeId: String
64
- $previewSeq: BigInt
65
- ) {
66
- deleteDataTableRows (
67
- organizationId: $organizationId
68
- dataTableId: $dataTableId
69
- dataTableRowIds: $dataTableRowIds
70
- commandId: $commandId
71
- previewClientId: $previewClientId
72
- previewEnvelopeId: $previewEnvelopeId
73
- previewSeq: $previewSeq
74
- ) {
75
- ...dataTableRowFragment
76
- }
77
- }
78
-
79
- ${dataTableRowFragment}
80
- `;
81
-
82
- export const editDataTableDesignMtn = gql`
83
- mutation editDataTableDesign (
84
- $organizationId: GenericID!
85
- $dataTableId: GenericID!
86
- $design: DataTableDesignPatchInput!
87
- $commandId: String
88
- $previewClientId: String
89
- $previewEnvelopeId: String
90
- $previewSeq: BigInt
91
- ) {
92
- editDataTableDesign (
93
- organizationId: $organizationId
94
- dataTableId: $dataTableId
95
- design: $design
96
- commandId: $commandId
97
- previewClientId: $previewClientId
98
- previewEnvelopeId: $previewEnvelopeId
99
- previewSeq: $previewSeq
100
- ) {
101
- ...dataTableFragment
102
- }
103
- }
104
-
105
- ${dataTableFragment}
106
49
  `;