@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,423 +1,1121 @@
1
1
  import { gql } from 'graphql-tag';
2
2
  import {
3
+ scheduleActivityFragment,
3
4
  scheduleCalendarFragment,
4
5
  scheduleOccurrenceFragment,
6
+ scheduleProjectFragment,
7
+ scheduleProjectRunFragment,
8
+ schedulePublicationFragment,
9
+ scheduleRelationshipFragment,
5
10
  scheduleRequestFragment,
11
+ scheduleResourceFragment,
12
+ scheduleSeriesFragment,
13
+ scheduleTimeOffFragment,
14
+ scheduleViolationFragment,
15
+ scheduleWorkCalendarFragment,
6
16
  } from '../fragments/scheduleFragments.ts';
7
17
 
8
- // NOTE: Every occurrence mutation returns the full fragment, including the
9
- // hydrated slots and assignments, so the calendar patches in place rather than
10
- // refetching the window. "version" is the optimistic-lock token: read it from
11
- // the occurrence you are editing and echo it back, or a second editor's change
12
- // is silently overwritten.
18
+ export const createScheduleWorkCalendarMtn = gql`
19
+ mutation createScheduleWorkCalendar($input: CreateScheduleWorkCalendarInput!) {
20
+ createScheduleWorkCalendar(input: $input) {
21
+ ...scheduleWorkCalendarFragment
22
+ exceptions {
23
+ id
24
+ workCalendarId
25
+ date
26
+ ranges {
27
+ start
28
+ end
29
+ }
30
+ note
31
+ }
32
+ }
33
+ }
34
+ ${scheduleWorkCalendarFragment}
35
+ `;
13
36
 
14
- export const createScheduleOccurrenceMtn = gql`
15
- mutation createScheduleOccurrence (
16
- $organizationId: GenericID!
17
- $calendarId: GenericID!
18
- $kind: String
19
- $title: String!
20
- $note: String
21
- $location: String
22
- $resourceId: GenericID
23
- $siteId: GenericID
24
- $startAt: DateTime!
25
- $endAt: DateTime!
26
- $timeZone: String
27
- $allDay: Boolean
28
- $status: String
29
- $slots: [ScheduleSlotInput!]
30
- ) {
31
- createScheduleOccurrence (
32
- organizationId: $organizationId
33
- calendarId: $calendarId
34
- kind: $kind
35
- title: $title
36
- note: $note
37
- location: $location
38
- resourceId: $resourceId
39
- siteId: $siteId
40
- startAt: $startAt
41
- endAt: $endAt
42
- timeZone: $timeZone
43
- allDay: $allDay
44
- status: $status
45
- slots: $slots
46
- ) {
47
- ...scheduleOccurrenceFragment
48
- }
37
+ export const updateScheduleWorkCalendarMtn = gql`
38
+ mutation updateScheduleWorkCalendar($input: UpdateScheduleWorkCalendarInput!) {
39
+ updateScheduleWorkCalendar(input: $input) {
40
+ ...scheduleWorkCalendarFragment
41
+ exceptions {
42
+ id
43
+ workCalendarId
44
+ date
45
+ ranges {
46
+ start
47
+ end
49
48
  }
49
+ note
50
+ }
51
+ }
52
+ }
53
+ ${scheduleWorkCalendarFragment}
54
+ `;
50
55
 
51
- ${scheduleOccurrenceFragment}
56
+ export const setScheduleWorkCalendarExceptionMtn = gql`
57
+ mutation setScheduleWorkCalendarException($input: SetScheduleWorkCalendarExceptionInput!) {
58
+ setScheduleWorkCalendarException(input: $input) {
59
+ ...scheduleWorkCalendarFragment
60
+ exceptions {
61
+ id
62
+ workCalendarId
63
+ date
64
+ ranges {
65
+ start
66
+ end
67
+ }
68
+ note
69
+ }
70
+ }
71
+ }
72
+ ${scheduleWorkCalendarFragment}
52
73
  `;
53
74
 
54
- export const updateScheduleOccurrenceMtn = gql`
55
- mutation updateScheduleOccurrence (
56
- $organizationId: GenericID!
57
- $occurrenceId: GenericID!
58
- $version: String
59
- $title: String
60
- $note: String
61
- $location: String
62
- $resourceId: GenericID
63
- $siteId: GenericID
64
- $startAt: DateTime
65
- $endAt: DateTime
66
- $timeZone: String
67
- $allDay: Boolean
68
- $status: String
69
- $slots: [ScheduleSlotInput!]
70
- ) {
71
- updateScheduleOccurrence (
72
- organizationId: $organizationId
73
- occurrenceId: $occurrenceId
74
- version: $version
75
- title: $title
76
- note: $note
77
- location: $location
78
- resourceId: $resourceId
79
- siteId: $siteId
80
- startAt: $startAt
81
- endAt: $endAt
82
- timeZone: $timeZone
83
- allDay: $allDay
84
- status: $status
85
- slots: $slots
86
- ) {
87
- ...scheduleOccurrenceFragment
88
- }
75
+ export const deleteScheduleWorkCalendarMtn = gql`
76
+ mutation deleteScheduleWorkCalendar($input: DeleteScheduleWorkCalendarInput!) {
77
+ deleteScheduleWorkCalendar(input: $input)
89
78
  }
90
79
 
91
- ${scheduleOccurrenceFragment}
92
80
  `;
93
81
 
94
- // NOTE: Cancelling keeps the row and strikes it through on the calendar.
95
- // Somebody looking for a shift that was cancelled has to be able to find it,
96
- // rather than wonder whether they imagined it.
82
+ export const createScheduleResourceMtn = gql`
83
+ mutation createScheduleResource($input: CreateScheduleResourceInput!) {
84
+ createScheduleResource(input: $input) {
85
+ ...scheduleResourceFragment
86
+ viewerNotify {
87
+ channels
88
+ }
89
+ availability {
90
+ id
91
+ resourceId
92
+ startsOn
93
+ endsOn
94
+ maxUnitsPerDay
95
+ note
96
+ }
97
+ }
98
+ }
99
+ ${scheduleResourceFragment}
100
+ `;
97
101
 
98
- export const cancelScheduleOccurrenceMtn = gql`
99
- mutation cancelScheduleOccurrence (
100
- $organizationId: GenericID!
101
- $occurrenceId: GenericID!
102
- ) {
103
- cancelScheduleOccurrence (
104
- organizationId: $organizationId
105
- occurrenceId: $occurrenceId
106
- ) {
107
- ...scheduleOccurrenceFragment
108
- }
102
+ export const updateScheduleResourceMtn = gql`
103
+ mutation updateScheduleResource($input: UpdateScheduleResourceInput!) {
104
+ updateScheduleResource(input: $input) {
105
+ ...scheduleResourceFragment
106
+ viewerNotify {
107
+ channels
108
+ }
109
+ availability {
110
+ id
111
+ resourceId
112
+ startsOn
113
+ endsOn
114
+ maxUnitsPerDay
115
+ note
116
+ }
109
117
  }
118
+ }
119
+ ${scheduleResourceFragment}
120
+ `;
110
121
 
111
- ${scheduleOccurrenceFragment}
122
+ export const createScheduleResourceAvailabilityMtn = gql`
123
+ mutation createScheduleResourceAvailability($input: CreateScheduleResourceAvailabilityInput!) {
124
+ createScheduleResourceAvailability(input: $input) {
125
+ ...scheduleResourceFragment
126
+ viewerNotify {
127
+ channels
128
+ }
129
+ availability {
130
+ id
131
+ resourceId
132
+ startsOn
133
+ endsOn
134
+ maxUnitsPerDay
135
+ note
136
+ }
137
+ }
138
+ }
139
+ ${scheduleResourceFragment}
112
140
  `;
113
141
 
114
- export const deleteScheduleOccurrenceMtn = gql`
115
- mutation deleteScheduleOccurrence (
116
- $organizationId: GenericID!
117
- $occurrenceId: GenericID!
118
- ) {
119
- deleteScheduleOccurrence (
120
- organizationId: $organizationId
121
- occurrenceId: $occurrenceId
122
- )
142
+ export const deleteScheduleResourceAvailabilityMtn = gql`
143
+ mutation deleteScheduleResourceAvailability($input: DeleteScheduleResourceAvailabilityInput!) {
144
+ deleteScheduleResourceAvailability(input: $input) {
145
+ ...scheduleResourceFragment
146
+ viewerNotify {
147
+ channels
123
148
  }
149
+ availability {
150
+ id
151
+ resourceId
152
+ startsOn
153
+ endsOn
154
+ maxUnitsPerDay
155
+ note
156
+ }
157
+ }
158
+ }
159
+ ${scheduleResourceFragment}
124
160
  `;
125
161
 
126
- export const createScheduleCalendarMtn = gql`
127
- mutation createScheduleCalendar (
128
- $organizationId: GenericID!
129
- $kind: String
130
- $name: String!
131
- $description: String
132
- $timeZone: String
133
- $siteId: GenericID
134
- $color: String
135
- ) {
136
- createScheduleCalendar (
137
- organizationId: $organizationId
138
- kind: $kind
139
- name: $name
140
- description: $description
141
- timeZone: $timeZone
142
- siteId: $siteId
143
- color: $color
144
- ) {
145
- ...scheduleCalendarFragment
146
-
147
- viewerPermission
148
- viewerCanEditAccess
149
- }
162
+ export const updateMyScheduleNotifyPrefsMtn = gql`
163
+ mutation updateMyScheduleNotifyPrefs($input: UpdateMyScheduleNotifyPrefsInput!) {
164
+ updateMyScheduleNotifyPrefs(input: $input) {
165
+ ...scheduleResourceFragment
166
+ viewerNotify {
167
+ channels
168
+ }
169
+ availability {
170
+ id
171
+ resourceId
172
+ startsOn
173
+ endsOn
174
+ maxUnitsPerDay
175
+ note
150
176
  }
177
+ }
178
+ }
179
+ ${scheduleResourceFragment}
180
+ `;
151
181
 
182
+ export const createScheduleCalendarMtn = gql`
183
+ mutation createScheduleCalendar($input: CreateScheduleCalendarInput!) {
184
+ createScheduleCalendar(input: $input) {
185
+ ...scheduleCalendarFragment
186
+ viewerPermission
187
+ viewerCanEdit
188
+ viewerCanEditAccess
189
+ viewerIsManager
190
+ viewerResourceId
191
+ }
192
+ }
152
193
  ${scheduleCalendarFragment}
153
194
  `;
154
195
 
155
196
  export const updateScheduleCalendarMtn = gql`
156
- mutation updateScheduleCalendar (
157
- $organizationId: GenericID!
158
- $calendarId: GenericID!
159
- $name: String
160
- $description: String
161
- $timeZone: String
162
- $siteId: GenericID
163
- $color: String
164
- $ordinal: Int
165
- ) {
166
- updateScheduleCalendar (
167
- organizationId: $organizationId
168
- calendarId: $calendarId
169
- name: $name
170
- description: $description
171
- timeZone: $timeZone
172
- siteId: $siteId
173
- color: $color
174
- ordinal: $ordinal
175
- ) {
176
- ...scheduleCalendarFragment
177
-
178
- viewerPermission
179
- viewerCanEditAccess
180
- }
197
+ mutation updateScheduleCalendar($input: UpdateScheduleCalendarInput!) {
198
+ updateScheduleCalendar(input: $input) {
199
+ ...scheduleCalendarFragment
200
+ viewerPermission
201
+ viewerCanEdit
202
+ viewerCanEditAccess
203
+ viewerIsManager
204
+ viewerResourceId
205
+ }
181
206
  }
207
+ ${scheduleCalendarFragment}
208
+ `;
182
209
 
210
+ export const updateScheduleCalendarAccessMtn = gql`
211
+ mutation updateScheduleCalendarAccess($input: UpdateScheduleCalendarAccessInput!) {
212
+ updateScheduleCalendarAccess(input: $input) {
213
+ ...scheduleCalendarFragment
214
+ viewerPermission
215
+ viewerCanEdit
216
+ viewerCanEditAccess
217
+ viewerIsManager
218
+ viewerResourceId
219
+ }
220
+ }
183
221
  ${scheduleCalendarFragment}
184
222
  `;
185
223
 
224
+ export const deleteScheduleCalendarMtn = gql`
225
+ mutation deleteScheduleCalendar($input: DeleteScheduleCalendarInput!) {
226
+ deleteScheduleCalendar(input: $input)
227
+ }
228
+
229
+ `;
230
+
231
+ export const createScheduleSeriesMtn = gql`
232
+ mutation createScheduleSeries($input: CreateScheduleSeriesInput!) {
233
+ createScheduleSeries(input: $input) {
234
+ series {
235
+ ...scheduleSeriesFragment
236
+ }
237
+ createdCount
238
+ updatedCount
239
+ propagatedCount
240
+ skippedCount
241
+ deletedCount
242
+ detached {
243
+ ...scheduleOccurrenceFragment
244
+ }
245
+ unslottedAssignmentIds
246
+ }
247
+ }
248
+ ${scheduleSeriesFragment}
249
+ ${scheduleOccurrenceFragment}
250
+ `;
251
+
252
+ export const updateScheduleSeriesMtn = gql`
253
+ mutation updateScheduleSeries($input: UpdateScheduleSeriesInput!) {
254
+ updateScheduleSeries(input: $input) {
255
+ series {
256
+ ...scheduleSeriesFragment
257
+ }
258
+ createdCount
259
+ updatedCount
260
+ propagatedCount
261
+ skippedCount
262
+ deletedCount
263
+ detached {
264
+ ...scheduleOccurrenceFragment
265
+ }
266
+ unslottedAssignmentIds
267
+ }
268
+ }
269
+ ${scheduleSeriesFragment}
270
+ ${scheduleOccurrenceFragment}
271
+ `;
272
+
273
+ export const deleteScheduleSeriesMtn = gql`
274
+ mutation deleteScheduleSeries($input: DeleteScheduleSeriesInput!) {
275
+ deleteScheduleSeries(input: $input)
276
+ }
277
+
278
+ `;
279
+
280
+ export const createScheduleOccurrenceMtn = gql`
281
+ mutation createScheduleOccurrence($input: CreateScheduleOccurrenceInput!) {
282
+ createScheduleOccurrence(input: $input) {
283
+ ...scheduleOccurrenceFragment
284
+ }
285
+ }
286
+ ${scheduleOccurrenceFragment}
287
+ `;
288
+
289
+ export const updateScheduleOccurrenceMtn = gql`
290
+ mutation updateScheduleOccurrence($input: UpdateScheduleOccurrenceInput!) {
291
+ updateScheduleOccurrence(input: $input) {
292
+ ...scheduleOccurrenceFragment
293
+ }
294
+ }
295
+ ${scheduleOccurrenceFragment}
296
+ `;
297
+
298
+ export const cancelScheduleOccurrenceMtn = gql`
299
+ mutation cancelScheduleOccurrence($input: CancelScheduleOccurrenceInput!) {
300
+ cancelScheduleOccurrence(input: $input) {
301
+ ...scheduleOccurrenceFragment
302
+ }
303
+ }
304
+ ${scheduleOccurrenceFragment}
305
+ `;
306
+
307
+ export const deleteScheduleOccurrenceMtn = gql`
308
+ mutation deleteScheduleOccurrence($input: DeleteScheduleOccurrenceInput!) {
309
+ deleteScheduleOccurrence(input: $input)
310
+ }
311
+
312
+ `;
313
+
186
314
  export const assignScheduleOccurrenceMtn = gql`
187
- mutation assignScheduleOccurrence (
188
- $organizationId: GenericID!
189
- $occurrenceId: GenericID!
190
- $slotId: GenericID
191
- $actorType: String
192
- $actorAccountId: GenericID
193
- $actorOrganizationId: GenericID
194
- $actorContactId: GenericID
195
- $startAt: DateTime
196
- $endAt: DateTime
197
- ) {
198
- assignScheduleOccurrence (
199
- organizationId: $organizationId
200
- occurrenceId: $occurrenceId
201
- slotId: $slotId
202
- actorType: $actorType
203
- actorAccountId: $actorAccountId
204
- actorOrganizationId: $actorOrganizationId
205
- actorContactId: $actorContactId
206
- startAt: $startAt
207
- endAt: $endAt
208
- ) {
209
- id
210
- organizationId
211
- occurrenceId
212
- slotId
213
- actorType
214
- actorAccountId
215
- actorOrganizationId
216
- actorContactId
217
- status
218
- startAt
219
- endAt
220
- assignedByAccountId
221
- releasedAt
222
- }
315
+ mutation assignScheduleOccurrence($input: AssignScheduleOccurrenceInput!) {
316
+ assignScheduleOccurrence(input: $input) {
317
+ occurrence {
318
+ ...scheduleOccurrenceFragment
319
+ }
320
+ assignment {
321
+ id
322
+ occurrenceId
323
+ resourceId
324
+ accountId
325
+ resourceName
326
+ slotKey
327
+ status
328
+ note
329
+ assignedByAccountId
330
+ source {
331
+ kind
332
+ requestId
333
+ timeOffId
334
+ workflowId
335
+ }
336
+ releasedAt
337
+ createdAt
338
+ updatedAt
223
339
  }
340
+ eligibility {
341
+ eligible
342
+ slotKey
343
+ reasons {
344
+ code
345
+ severity
346
+ ruleId
347
+ startAt
348
+ endAt
349
+ message
350
+ }
351
+ }
352
+ }
353
+ }
354
+ ${scheduleOccurrenceFragment}
224
355
  `;
225
356
 
226
357
  export const releaseScheduleAssignmentMtn = gql`
227
- mutation releaseScheduleAssignment (
228
- $organizationId: GenericID!
229
- $assignmentId: GenericID!
230
- ) {
231
- releaseScheduleAssignment (
232
- organizationId: $organizationId
233
- assignmentId: $assignmentId
234
- ) {
235
- id
236
- organizationId
237
- occurrenceId
238
- status
239
- releasedAt
240
- }
241
- }
242
- `;
243
-
244
- // NOTE: Publishing is two-phase. It re-evaluates the window and refuses on a
245
- // blocking breach unless that exact violation key was acknowledged, so the
246
- // caller sends back the keys it showed the publisher — not a blanket "force".
247
-
248
- export const publishScheduleMtn = gql`
249
- mutation publishSchedule (
250
- $organizationId: GenericID!
251
- $calendarId: GenericID!
252
- $from: DateTime!
253
- $to: DateTime!
254
- $acknowledgedViolationKeys: [String!]
255
- ) {
256
- publishSchedule (
257
- organizationId: $organizationId
258
- calendarId: $calendarId
259
- from: $from
260
- to: $to
261
- acknowledgedViolationKeys: $acknowledgedViolationKeys
262
- ) {
263
- publicationId
264
- publishedCount
265
-
266
- violations {
267
- ruleId
268
- templateKey
269
- message
270
- kind
271
- severity
272
- resourceId
273
- occurrenceId
274
- actorAccountId
275
- segmentStart
276
- segmentEnd
277
- detail
278
- key
279
- }
280
- }
358
+ mutation releaseScheduleAssignment($input: ReleaseScheduleAssignmentInput!) {
359
+ releaseScheduleAssignment(input: $input) {
360
+ occurrence {
361
+ ...scheduleOccurrenceFragment
362
+ }
363
+ assignment {
364
+ id
365
+ occurrenceId
366
+ resourceId
367
+ accountId
368
+ resourceName
369
+ slotKey
370
+ status
371
+ note
372
+ assignedByAccountId
373
+ source {
374
+ kind
375
+ requestId
376
+ timeOffId
377
+ workflowId
378
+ }
379
+ releasedAt
380
+ createdAt
381
+ updatedAt
382
+ }
383
+ eligibility {
384
+ eligible
385
+ slotKey
386
+ reasons {
387
+ code
388
+ severity
389
+ ruleId
390
+ startAt
391
+ endAt
392
+ message
393
+ }
394
+ }
281
395
  }
396
+ }
397
+ ${scheduleOccurrenceFragment}
282
398
  `;
283
399
 
284
- export const createScheduleRequestMtn = gql`
285
- mutation createScheduleRequest (
286
- $organizationId: GenericID!
287
- $calendarId: GenericID!
288
- $kind: String!
289
- $sourceAssignmentId: GenericID
290
- $targetAssignmentId: GenericID
291
- $targetOccurrenceId: GenericID
292
- $startAt: DateTime
293
- $endAt: DateTime
294
- $reason: String
295
- $expiresAt: DateTime
296
- ) {
297
- createScheduleRequest (
298
- organizationId: $organizationId
299
- calendarId: $calendarId
300
- kind: $kind
301
- sourceAssignmentId: $sourceAssignmentId
302
- targetAssignmentId: $targetAssignmentId
303
- targetOccurrenceId: $targetOccurrenceId
304
- startAt: $startAt
305
- endAt: $endAt
306
- reason: $reason
307
- expiresAt: $expiresAt
308
- ) {
309
- ...scheduleRequestFragment
310
- }
400
+ export const publishScheduleWindowMtn = gql`
401
+ mutation publishScheduleWindow($input: PublishScheduleWindowInput!) {
402
+ publishScheduleWindow(input: $input) {
403
+ refusal {
404
+ code
405
+ blockingCount
406
+ unacknowledgedKeys
407
+ }
408
+ publication {
409
+ ...schedulePublicationFragment
410
+ viewerAcknowledgedAt
411
+ }
412
+ publishedCount
413
+ violations {
414
+ ...scheduleViolationFragment
415
+ }
416
+ unacknowledgedKeys
417
+ diagnostics {
418
+ code
419
+ message
420
+ resourceId
421
+ ruleId
422
+ }
423
+ }
424
+ }
425
+ ${schedulePublicationFragment}
426
+ ${scheduleViolationFragment}
427
+ `;
428
+
429
+ export const acknowledgeSchedulePublicationMtn = gql`
430
+ mutation acknowledgeSchedulePublication($input: AcknowledgeSchedulePublicationInput!) {
431
+ acknowledgeSchedulePublication(input: $input) {
432
+ ...schedulePublicationFragment
433
+ viewerAcknowledgedAt
434
+ }
435
+ }
436
+ ${schedulePublicationFragment}
437
+ `;
438
+
439
+ export const evaluateScheduleWindowMtn = gql`
440
+ mutation evaluateScheduleWindow($input: EvaluateScheduleWindowInput!) {
441
+ evaluateScheduleWindow(input: $input) {
442
+ complete
443
+ violations {
444
+ ...scheduleViolationFragment
445
+ }
446
+ diagnostics {
447
+ code
448
+ message
449
+ resourceId
450
+ ruleId
451
+ }
452
+ }
453
+ }
454
+ ${scheduleViolationFragment}
455
+ `;
456
+
457
+ export const createScheduleRuleMtn = gql`
458
+ mutation createScheduleRule($input: CreateScheduleRuleInput!) {
459
+ createScheduleRule(input: $input) {
460
+ key
461
+ id
462
+ organizationId
463
+ calendarId
464
+ resourceId
465
+ kind
466
+ label
467
+ config {
468
+ ratios {
469
+ key
470
+ childrenPerAdult
471
+ }
472
+ predicate {
473
+ roles
474
+ qualifications
475
+ tags
476
+ }
477
+ minAdults
478
+ windowDays
479
+ maxMinutes
480
+ minRestMinutes
481
+ }
482
+ severity
483
+ active
484
+ ordinal
485
+ }
311
486
  }
312
487
 
313
- ${scheduleRequestFragment}
314
488
  `;
315
489
 
316
- // NOTE: First accept wins. A losing claimant gets a plain error, which is an
317
- // ordinary outcome rather than a failure — somebody else took the shift a
318
- // moment ago — so the UI reports it as news, not as a fault.
490
+ export const updateScheduleRuleMtn = gql`
491
+ mutation updateScheduleRule($input: UpdateScheduleRuleInput!) {
492
+ updateScheduleRule(input: $input) {
493
+ key
494
+ id
495
+ organizationId
496
+ calendarId
497
+ resourceId
498
+ kind
499
+ label
500
+ config {
501
+ ratios {
502
+ key
503
+ childrenPerAdult
504
+ }
505
+ predicate {
506
+ roles
507
+ qualifications
508
+ tags
509
+ }
510
+ minAdults
511
+ windowDays
512
+ maxMinutes
513
+ minRestMinutes
514
+ }
515
+ severity
516
+ active
517
+ ordinal
518
+ }
519
+ }
319
520
 
320
- export const claimScheduleRequestMtn = gql`
321
- mutation claimScheduleRequest (
322
- $organizationId: GenericID!
323
- $requestId: GenericID!
324
- ) {
325
- claimScheduleRequest (
326
- organizationId: $organizationId
327
- requestId: $requestId
328
- ) {
329
- ...scheduleRequestFragment
330
- }
521
+ `;
522
+
523
+ export const deleteScheduleRuleMtn = gql`
524
+ mutation deleteScheduleRule($input: DeleteScheduleRuleInput!) {
525
+ deleteScheduleRule(input: $input)
526
+ }
527
+
528
+ `;
529
+
530
+ export const createScheduleDemandMtn = gql`
531
+ mutation createScheduleDemand($input: CreateScheduleDemandInput!) {
532
+ createScheduleDemand(input: $input) {
533
+ id
534
+ calendarId
535
+ resourceId
536
+ key
537
+ quantity
538
+ startAt
539
+ endAt
540
+ note
541
+ }
331
542
  }
332
543
 
333
- ${scheduleRequestFragment}
334
544
  `;
335
545
 
336
- export const declineScheduleRequestMtn = gql`
337
- mutation declineScheduleRequest (
338
- $organizationId: GenericID!
339
- $requestId: GenericID!
340
- $decisionNote: String
341
- ) {
342
- declineScheduleRequest (
343
- organizationId: $organizationId
344
- requestId: $requestId
345
- decisionNote: $decisionNote
346
- ) {
347
- ...scheduleRequestFragment
348
- }
546
+ export const deleteScheduleDemandMtn = gql`
547
+ mutation deleteScheduleDemand($input: DeleteScheduleDemandInput!) {
548
+ deleteScheduleDemand(input: $input)
349
549
  }
350
550
 
551
+ `;
552
+
553
+ export const createScheduleRequestMtn = gql`
554
+ mutation createScheduleRequest($input: CreateScheduleRequestInput!) {
555
+ createScheduleRequest(input: $input) {
556
+ request {
557
+ ...scheduleRequestFragment
558
+ occurrence {
559
+ ...scheduleOccurrenceFragment
560
+ }
561
+ targetOccurrence {
562
+ ...scheduleOccurrenceFragment
563
+ }
564
+ eligibility {
565
+ eligible
566
+ slotKey
567
+ reasons {
568
+ code
569
+ severity
570
+ ruleId
571
+ startAt
572
+ endAt
573
+ message
574
+ }
575
+ }
576
+ viewerIsRequester
577
+ viewerIsCounterparty
578
+ viewerCanDecide
579
+ }
580
+ eligibility {
581
+ eligible
582
+ slotKey
583
+ reasons {
584
+ code
585
+ severity
586
+ ruleId
587
+ startAt
588
+ endAt
589
+ message
590
+ }
591
+ }
592
+ occurrence {
593
+ ...scheduleOccurrenceFragment
594
+ }
595
+ }
596
+ }
351
597
  ${scheduleRequestFragment}
598
+ ${scheduleOccurrenceFragment}
352
599
  `;
353
600
 
354
- export const withdrawScheduleRequestMtn = gql`
355
- mutation withdrawScheduleRequest (
356
- $organizationId: GenericID!
357
- $requestId: GenericID!
358
- ) {
359
- withdrawScheduleRequest (
360
- organizationId: $organizationId
361
- requestId: $requestId
362
- ) {
363
- ...scheduleRequestFragment
364
- }
601
+ export const respondScheduleRequestMtn = gql`
602
+ mutation respondScheduleRequest($input: RespondScheduleRequestInput!) {
603
+ respondScheduleRequest(input: $input) {
604
+ ...scheduleRequestFragment
605
+ occurrence {
606
+ ...scheduleOccurrenceFragment
607
+ }
608
+ targetOccurrence {
609
+ ...scheduleOccurrenceFragment
610
+ }
611
+ eligibility {
612
+ eligible
613
+ slotKey
614
+ reasons {
615
+ code
616
+ severity
617
+ ruleId
618
+ startAt
619
+ endAt
620
+ message
621
+ }
622
+ }
623
+ viewerIsRequester
624
+ viewerIsCounterparty
625
+ viewerCanDecide
365
626
  }
627
+ }
628
+ ${scheduleRequestFragment}
629
+ ${scheduleOccurrenceFragment}
630
+ `;
366
631
 
632
+ export const withdrawScheduleRequestMtn = gql`
633
+ mutation withdrawScheduleRequest($input: WithdrawScheduleRequestInput!) {
634
+ withdrawScheduleRequest(input: $input) {
635
+ ...scheduleRequestFragment
636
+ occurrence {
637
+ ...scheduleOccurrenceFragment
638
+ }
639
+ targetOccurrence {
640
+ ...scheduleOccurrenceFragment
641
+ }
642
+ eligibility {
643
+ eligible
644
+ slotKey
645
+ reasons {
646
+ code
647
+ severity
648
+ ruleId
649
+ startAt
650
+ endAt
651
+ message
652
+ }
653
+ }
654
+ viewerIsRequester
655
+ viewerIsCounterparty
656
+ viewerCanDecide
657
+ }
658
+ }
367
659
  ${scheduleRequestFragment}
660
+ ${scheduleOccurrenceFragment}
368
661
  `;
369
662
 
370
663
  export const decideScheduleRequestMtn = gql`
371
- mutation decideScheduleRequest (
372
- $organizationId: GenericID!
373
- $requestId: GenericID!
374
- $approve: Boolean!
375
- $decisionNote: String
376
- ) {
377
- decideScheduleRequest (
378
- organizationId: $organizationId
379
- requestId: $requestId
380
- approve: $approve
381
- decisionNote: $decisionNote
382
- ) {
383
- ...scheduleRequestFragment
384
- }
664
+ mutation decideScheduleRequest($input: DecideScheduleRequestInput!) {
665
+ decideScheduleRequest(input: $input) {
666
+ request {
667
+ ...scheduleRequestFragment
668
+ occurrence {
669
+ ...scheduleOccurrenceFragment
670
+ }
671
+ targetOccurrence {
672
+ ...scheduleOccurrenceFragment
673
+ }
674
+ eligibility {
675
+ eligible
676
+ slotKey
677
+ reasons {
678
+ code
679
+ severity
680
+ ruleId
681
+ startAt
682
+ endAt
683
+ message
684
+ }
685
+ }
686
+ viewerIsRequester
687
+ viewerIsCounterparty
688
+ viewerCanDecide
689
+ }
690
+ eligibility {
691
+ eligible
692
+ slotKey
693
+ reasons {
694
+ code
695
+ severity
696
+ ruleId
697
+ startAt
698
+ endAt
699
+ message
700
+ }
701
+ }
702
+ occurrence {
703
+ ...scheduleOccurrenceFragment
704
+ }
705
+ }
385
706
  }
386
-
387
707
  ${scheduleRequestFragment}
708
+ ${scheduleOccurrenceFragment}
709
+ `;
710
+
711
+ export const createScheduleTimeOffMtn = gql`
712
+ mutation createScheduleTimeOff($input: CreateScheduleTimeOffInput!) {
713
+ createScheduleTimeOff(input: $input) {
714
+ ...scheduleTimeOffFragment
715
+ conflictingAssignments {
716
+ ...scheduleOccurrenceFragment
717
+ }
718
+ releasedAssignmentIds
719
+ viewerIsRequester
720
+ viewerCanDecide
721
+ }
722
+ }
723
+ ${scheduleTimeOffFragment}
724
+ ${scheduleOccurrenceFragment}
725
+ `;
726
+
727
+ export const decideScheduleTimeOffMtn = gql`
728
+ mutation decideScheduleTimeOff($input: DecideScheduleTimeOffInput!) {
729
+ decideScheduleTimeOff(input: $input) {
730
+ ...scheduleTimeOffFragment
731
+ conflictingAssignments {
732
+ ...scheduleOccurrenceFragment
733
+ }
734
+ releasedAssignmentIds
735
+ viewerIsRequester
736
+ viewerCanDecide
737
+ }
738
+ }
739
+ ${scheduleTimeOffFragment}
740
+ ${scheduleOccurrenceFragment}
741
+ `;
742
+
743
+ export const cancelScheduleTimeOffMtn = gql`
744
+ mutation cancelScheduleTimeOff($input: CancelScheduleTimeOffInput!) {
745
+ cancelScheduleTimeOff(input: $input) {
746
+ ...scheduleTimeOffFragment
747
+ conflictingAssignments {
748
+ ...scheduleOccurrenceFragment
749
+ }
750
+ releasedAssignmentIds
751
+ viewerIsRequester
752
+ viewerCanDecide
753
+ }
754
+ }
755
+ ${scheduleTimeOffFragment}
756
+ ${scheduleOccurrenceFragment}
757
+ `;
758
+
759
+ export const createScheduleProjectMtn = gql`
760
+ mutation createScheduleProject($input: CreateScheduleProjectInput!) {
761
+ createScheduleProject(input: $input) {
762
+ ...scheduleProjectFragment
763
+ activityCount
764
+ unreviewedCount
765
+ viewerPermission
766
+ viewerCanEdit
767
+ viewerCanEditAccess
768
+ viewerIsManager
769
+ }
770
+ }
771
+ ${scheduleProjectFragment}
772
+ ${scheduleProjectRunFragment}
773
+ `;
774
+
775
+ export const updateScheduleProjectMtn = gql`
776
+ mutation updateScheduleProject($input: UpdateScheduleProjectInput!) {
777
+ updateScheduleProject(input: $input) {
778
+ ...scheduleProjectFragment
779
+ activityCount
780
+ unreviewedCount
781
+ viewerPermission
782
+ viewerCanEdit
783
+ viewerCanEditAccess
784
+ viewerIsManager
785
+ }
786
+ }
787
+ ${scheduleProjectFragment}
788
+ ${scheduleProjectRunFragment}
789
+ `;
790
+
791
+ export const updateScheduleProjectAccessMtn = gql`
792
+ mutation updateScheduleProjectAccess($input: UpdateScheduleProjectAccessInput!) {
793
+ updateScheduleProjectAccess(input: $input) {
794
+ ...scheduleProjectFragment
795
+ activityCount
796
+ unreviewedCount
797
+ viewerPermission
798
+ viewerCanEdit
799
+ viewerCanEditAccess
800
+ viewerIsManager
801
+ }
802
+ }
803
+ ${scheduleProjectFragment}
804
+ ${scheduleProjectRunFragment}
805
+ `;
806
+
807
+ export const deleteScheduleProjectMtn = gql`
808
+ mutation deleteScheduleProject($input: DeleteScheduleProjectInput!) {
809
+ deleteScheduleProject(input: $input)
810
+ }
811
+
812
+ `;
813
+
814
+ export const createScheduleWbsNodeMtn = gql`
815
+ mutation createScheduleWbsNode($input: CreateScheduleWbsNodeInput!) {
816
+ createScheduleWbsNode(input: $input) {
817
+ id
818
+ projectId
819
+ parentId
820
+ code
821
+ name
822
+ path
823
+ depth
824
+ ordinal
825
+ startAt
826
+ finishAt
827
+ percentComplete
828
+ }
829
+ }
830
+
831
+ `;
832
+
833
+ export const updateScheduleWbsNodeMtn = gql`
834
+ mutation updateScheduleWbsNode($input: UpdateScheduleWbsNodeInput!) {
835
+ updateScheduleWbsNode(input: $input) {
836
+ id
837
+ projectId
838
+ parentId
839
+ code
840
+ name
841
+ path
842
+ depth
843
+ ordinal
844
+ startAt
845
+ finishAt
846
+ percentComplete
847
+ }
848
+ }
849
+
850
+ `;
851
+
852
+ export const deleteScheduleWbsNodeMtn = gql`
853
+ mutation deleteScheduleWbsNode($input: DeleteScheduleWbsNodeInput!) {
854
+ deleteScheduleWbsNode(input: $input)
855
+ }
856
+
857
+ `;
858
+
859
+ export const createScheduleActivityMtn = gql`
860
+ mutation createScheduleActivity($input: CreateScheduleActivityInput!) {
861
+ createScheduleActivity(input: $input) {
862
+ ...scheduleActivityFragment
863
+ }
864
+ }
865
+ ${scheduleActivityFragment}
866
+ `;
867
+
868
+ export const createScheduleActivitiesMtn = gql`
869
+ mutation createScheduleActivities($input: CreateScheduleActivitiesInput!) {
870
+ createScheduleActivities(input: $input) {
871
+ ...scheduleActivityFragment
872
+ }
873
+ }
874
+ ${scheduleActivityFragment}
875
+ `;
876
+
877
+ export const updateScheduleActivityMtn = gql`
878
+ mutation updateScheduleActivity($input: UpdateScheduleActivityInput!) {
879
+ updateScheduleActivity(input: $input) {
880
+ ...scheduleActivityFragment
881
+ }
882
+ }
883
+ ${scheduleActivityFragment}
884
+ `;
885
+
886
+ export const updateScheduleActivitiesProgressMtn = gql`
887
+ mutation updateScheduleActivitiesProgress($input: UpdateScheduleActivitiesProgressInput!) {
888
+ updateScheduleActivitiesProgress(input: $input) {
889
+ ...scheduleActivityFragment
890
+ }
891
+ }
892
+ ${scheduleActivityFragment}
893
+ `;
894
+
895
+ export const deleteScheduleActivitiesMtn = gql`
896
+ mutation deleteScheduleActivities($input: DeleteScheduleActivitiesInput!) {
897
+ deleteScheduleActivities(input: $input)
898
+ }
899
+
900
+ `;
901
+
902
+ export const moveScheduleActivitiesMtn = gql`
903
+ mutation moveScheduleActivities($input: MoveScheduleActivitiesInput!) {
904
+ moveScheduleActivities(input: $input) {
905
+ ...scheduleActivityFragment
906
+ }
907
+ }
908
+ ${scheduleActivityFragment}
909
+ `;
910
+
911
+ export const reviewScheduleActivitiesMtn = gql`
912
+ mutation reviewScheduleActivities($input: ReviewScheduleActivitiesInput!) {
913
+ reviewScheduleActivities(input: $input) {
914
+ ...scheduleActivityFragment
915
+ }
916
+ }
917
+ ${scheduleActivityFragment}
918
+ `;
919
+
920
+ export const createScheduleRelationshipsMtn = gql`
921
+ mutation createScheduleRelationships($input: CreateScheduleRelationshipsInput!) {
922
+ createScheduleRelationships(input: $input) {
923
+ relationships {
924
+ ...scheduleRelationshipFragment
925
+ }
926
+ cycleActivityIds
927
+ duplicateCount
928
+ }
929
+ }
930
+ ${scheduleRelationshipFragment}
931
+ `;
932
+
933
+ export const replaceScheduleActivityPredecessorsMtn = gql`
934
+ mutation replaceScheduleActivityPredecessors($input: ReplaceScheduleActivityPredecessorsInput!) {
935
+ replaceScheduleActivityPredecessors(input: $input) {
936
+ activity {
937
+ ...scheduleActivityFragment
938
+ }
939
+ relationships {
940
+ ...scheduleRelationshipFragment
941
+ }
942
+ }
943
+ }
944
+ ${scheduleActivityFragment}
945
+ ${scheduleRelationshipFragment}
946
+ `;
947
+
948
+ export const updateScheduleRelationshipMtn = gql`
949
+ mutation updateScheduleRelationship($input: UpdateScheduleRelationshipInput!) {
950
+ updateScheduleRelationship(input: $input) {
951
+ ...scheduleRelationshipFragment
952
+ }
953
+ }
954
+ ${scheduleRelationshipFragment}
955
+ `;
956
+
957
+ export const deleteScheduleRelationshipsMtn = gql`
958
+ mutation deleteScheduleRelationships($input: DeleteScheduleRelationshipsInput!) {
959
+ deleteScheduleRelationships(input: $input)
960
+ }
961
+
962
+ `;
963
+
964
+ export const replaceScheduleActivityAssignmentMtn = gql`
965
+ mutation replaceScheduleActivityAssignment($input: ReplaceScheduleActivityAssignmentInput!) {
966
+ replaceScheduleActivityAssignment(input: $input) {
967
+ id
968
+ projectId
969
+ activityId
970
+ resourceId
971
+ plannedUnits
972
+ unitsPerDay
973
+ actualUnits
974
+ remainingUnits
975
+ }
976
+ }
977
+
978
+ `;
979
+
980
+ export const deleteScheduleActivityAssignmentMtn = gql`
981
+ mutation deleteScheduleActivityAssignment($input: DeleteScheduleActivityAssignmentInput!) {
982
+ deleteScheduleActivityAssignment(input: $input)
983
+ }
984
+
985
+ `;
986
+
987
+ export const runScheduleProjectMtn = gql`
988
+ mutation runScheduleProject($input: RunScheduleProjectInput!) {
989
+ runScheduleProject(input: $input) {
990
+ ...scheduleProjectRunFragment
991
+ }
992
+ }
993
+ ${scheduleProjectRunFragment}
388
994
  `;
389
995
 
390
- // NOTE: The raw token is returned exactly once, here. Only a hash is stored,
391
- // so it can never be retrieved again — the UI has to show it now or the
392
- // subscription is unusable.
393
-
394
- export const createScheduleFeedTokenMtn = gql`
395
- mutation createScheduleFeedToken (
396
- $organizationId: GenericID!
397
- $calendarId: GenericID
398
- $scope: String
399
- ) {
400
- createScheduleFeedToken (
401
- organizationId: $organizationId
402
- calendarId: $calendarId
403
- scope: $scope
404
- ) {
405
- id
406
- calendarId
407
- scope
408
- token
409
- }
410
- }
411
- `;
412
-
413
- export const revokeScheduleFeedTokenMtn = gql`
414
- mutation revokeScheduleFeedToken (
415
- $organizationId: GenericID!
416
- $feedTokenId: GenericID!
417
- ) {
418
- revokeScheduleFeedToken (
419
- organizationId: $organizationId
420
- feedTokenId: $feedTokenId
421
- )
996
+ export const cancelScheduleProjectRunMtn = gql`
997
+ mutation cancelScheduleProjectRun($input: CancelScheduleProjectRunInput!) {
998
+ cancelScheduleProjectRun(input: $input) {
999
+ ...scheduleProjectRunFragment
422
1000
  }
1001
+ }
1002
+ ${scheduleProjectRunFragment}
1003
+ `;
1004
+
1005
+ export const createScheduleBaselineMtn = gql`
1006
+ mutation createScheduleBaseline($input: CreateScheduleBaselineInput!) {
1007
+ createScheduleBaseline(input: $input) {
1008
+ id
1009
+ projectId
1010
+ name
1011
+ note
1012
+ dataDateAt
1013
+ isCurrent
1014
+ createdByAccountId
1015
+ createdAt
1016
+ cursor
1017
+ }
1018
+ }
1019
+
1020
+ `;
1021
+
1022
+ export const setScheduleCurrentBaselineMtn = gql`
1023
+ mutation setScheduleCurrentBaseline($input: SetScheduleCurrentBaselineInput!) {
1024
+ setScheduleCurrentBaseline(input: $input) {
1025
+ ...scheduleProjectFragment
1026
+ activityCount
1027
+ unreviewedCount
1028
+ viewerPermission
1029
+ viewerCanEdit
1030
+ viewerCanEditAccess
1031
+ viewerIsManager
1032
+ }
1033
+ }
1034
+ ${scheduleProjectFragment}
1035
+ ${scheduleProjectRunFragment}
1036
+ `;
1037
+
1038
+ export const deleteScheduleBaselineMtn = gql`
1039
+ mutation deleteScheduleBaseline($input: DeleteScheduleBaselineInput!) {
1040
+ deleteScheduleBaseline(input: $input)
1041
+ }
1042
+
1043
+ `;
1044
+
1045
+ export const replaceScheduleCodeTypeMtn = gql`
1046
+ mutation replaceScheduleCodeType($input: ReplaceScheduleCodeTypeInput!) {
1047
+ replaceScheduleCodeType(input: $input) {
1048
+ id
1049
+ organizationId
1050
+ projectId
1051
+ key
1052
+ name
1053
+ values {
1054
+ key
1055
+ label
1056
+ color
1057
+ }
1058
+ ordinal
1059
+ }
1060
+ }
1061
+
1062
+ `;
1063
+
1064
+ export const deleteScheduleCodeTypeMtn = gql`
1065
+ mutation deleteScheduleCodeType($input: DeleteScheduleCodeTypeInput!) {
1066
+ deleteScheduleCodeType(input: $input)
1067
+ }
1068
+
1069
+ `;
1070
+
1071
+ export const importScheduleProjectPlanMtn = gql`
1072
+ mutation importScheduleProjectPlan($input: ScheduleImportPlanInput!) {
1073
+ importScheduleProjectPlan(input: $input) {
1074
+ applied
1075
+ dryRun
1076
+ wbsCreated
1077
+ wbsUpdated
1078
+ activitiesCreated
1079
+ activitiesUpdated
1080
+ activitiesSkipped
1081
+ activitiesDeleted
1082
+ relationshipsCreated
1083
+ assignmentsWritten
1084
+ errors {
1085
+ code
1086
+ section
1087
+ index
1088
+ rowCode
1089
+ message
1090
+ }
1091
+ cycleCodes
1092
+ run {
1093
+ ...scheduleProjectRunFragment
1094
+ }
1095
+ }
1096
+ }
1097
+ ${scheduleProjectRunFragment}
1098
+ `;
1099
+
1100
+ export const deleteScheduleActivityMtn = gql`
1101
+ mutation deleteScheduleActivity($input: DeleteScheduleActivityInput!) {
1102
+ deleteScheduleActivity(input: $input)
1103
+ }
1104
+
1105
+ `;
1106
+
1107
+ export const createScheduleRelationshipMtn = gql`
1108
+ mutation createScheduleRelationship($input: CreateScheduleRelationshipInput!) {
1109
+ createScheduleRelationship(input: $input) {
1110
+ ...scheduleRelationshipFragment
1111
+ }
1112
+ }
1113
+ ${scheduleRelationshipFragment}
1114
+ `;
1115
+
1116
+ export const deleteScheduleRelationshipMtn = gql`
1117
+ mutation deleteScheduleRelationship($input: DeleteScheduleRelationshipInput!) {
1118
+ deleteScheduleRelationship(input: $input)
1119
+ }
1120
+
423
1121
  `;