@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,315 +1,691 @@
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,
6
11
  scheduleResourceFragment,
7
12
  scheduleSeriesFragment,
13
+ scheduleTimeOffFragment,
14
+ scheduleViolationFragment,
15
+ scheduleWorkCalendarFragment,
8
16
  } from '../fragments/scheduleFragments.ts';
9
17
 
10
- // NOTE: viewerPermission and viewerCanEditAccess are per-viewer facts the
11
- // server resolves for the requesting account. They are selected outside the
12
- // fragment because realtime emits never carry them — a restricted calendar
13
- // never broadcasts its rows at all — and the fragment must stay aligned with
14
- // the server's emit field list.
18
+ export const scheduleWorkCalendarsQry = gql`
19
+ query scheduleWorkCalendars($organizationId: GenericID!) {
20
+ scheduleWorkCalendars(organizationId: $organizationId) {
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
+ `;
15
36
 
16
- export const scheduleCalendarsQry = gql`
17
- query scheduleCalendars (
18
- $organizationId: GenericID!
19
- $includeNetwork: Boolean
20
- ) {
21
- scheduleCalendars (
22
- organizationId: $organizationId
23
- includeNetwork: $includeNetwork
24
- ) {
25
- ...scheduleCalendarFragment
37
+ export const scheduleResourcesQry = gql`
38
+ query scheduleResources($organizationId: GenericID!, $kind: ScheduleResourceKind, $includeRetired: Boolean, $search: String) {
39
+ scheduleResources(organizationId: $organizationId, kind: $kind, includeRetired: $includeRetired, search: $search) {
40
+ ...scheduleResourceFragment
41
+ viewerNotify {
42
+ channels
43
+ }
44
+ availability {
45
+ id
46
+ resourceId
47
+ startsOn
48
+ endsOn
49
+ maxUnitsPerDay
50
+ note
51
+ }
52
+ }
53
+ }
54
+ ${scheduleResourceFragment}
55
+ `;
26
56
 
27
- viewerPermission
28
- viewerCanEditAccess
29
- }
57
+ export const scheduleCodeTypesQry = gql`
58
+ query scheduleCodeTypes($organizationId: GenericID!, $projectId: GenericID) {
59
+ scheduleCodeTypes(organizationId: $organizationId, projectId: $projectId) {
60
+ id
61
+ organizationId
62
+ projectId
63
+ key
64
+ name
65
+ values {
66
+ key
67
+ label
68
+ color
69
+ }
70
+ ordinal
71
+ }
30
72
  }
31
73
 
32
- ${scheduleCalendarFragment}
33
74
  `;
34
75
 
35
- export const scheduleCalendarQry = gql`
36
- query scheduleCalendar (
37
- $calendarId: GenericID!
38
- ) {
39
- scheduleCalendar (
40
- calendarId: $calendarId
41
- ) {
42
- ...scheduleCalendarFragment
43
-
44
- viewerPermission
45
- viewerCanEditAccess
46
- }
76
+ export const scheduleResourceUsageQry = gql`
77
+ query scheduleResourceUsage($organizationId: GenericID!, $projectId: GenericID!, $resourceIds: [GenericID!], $from: String!, $to: String!) {
78
+ scheduleResourceUsage(organizationId: $organizationId, projectId: $projectId, resourceIds: $resourceIds, from: $from, to: $to) {
79
+ resourceId
80
+ date
81
+ demandUnits
82
+ externalUnits
83
+ availableUnits
84
+ overallocated
47
85
  }
86
+ }
87
+
88
+ `;
48
89
 
90
+ export const scheduleCalendarsQry = gql`
91
+ query scheduleCalendars($organizationId: GenericID!) {
92
+ scheduleCalendars(organizationId: $organizationId) {
93
+ ...scheduleCalendarFragment
94
+ viewerPermission
95
+ viewerCanEdit
96
+ viewerCanEditAccess
97
+ viewerIsManager
98
+ viewerResourceId
99
+ }
100
+ }
49
101
  ${scheduleCalendarFragment}
50
102
  `;
51
103
 
52
- // NOTE: This is a WINDOW query, not a cursor page. Its cache entry is keyed by
53
- // the date range the calendar happens to be showing, which is why any
54
- // structural change (a new occurrence, a cancellation, a materialization pass)
55
- // resets it through getScheduleOccurrencesResetQueryTargets rather than trying to
56
- // patch a page the client may never have fetched.
57
- //
58
- // It is deliberately per-calendar rather than taking a list: the reset key is
59
- // an exact per-variable match, so one query per calendar lets an edit on one
60
- // calendar leave every other overlaid calendar's cache untouched.
104
+ export const scheduleCalendarQry = gql`
105
+ query scheduleCalendar($calendarId: GenericID!) {
106
+ scheduleCalendar(calendarId: $calendarId) {
107
+ ...scheduleCalendarFragment
108
+ viewerPermission
109
+ viewerCanEdit
110
+ viewerCanEditAccess
111
+ viewerIsManager
112
+ viewerResourceId
113
+ }
114
+ }
115
+ ${scheduleCalendarFragment}
116
+ `;
61
117
 
62
118
  export const scheduleOccurrencesQry = gql`
63
- query scheduleOccurrences (
64
- $organizationId: GenericID!
65
- $calendarId: GenericID!
66
- $from: DateTime!
67
- $to: DateTime!
68
- $publishedOnly: Boolean
69
- $mineOnly: Boolean
70
- $limit: Int
71
- ) {
72
- scheduleOccurrences (
73
- organizationId: $organizationId
74
- calendarId: $calendarId
75
- from: $from
76
- to: $to
77
- publishedOnly: $publishedOnly
78
- mineOnly: $mineOnly
79
- limit: $limit
80
- ) {
81
- ...scheduleOccurrenceFragment
82
- }
119
+ query scheduleOccurrences($organizationId: GenericID!, $calendarId: GenericID!, $from: DateTime!, $to: DateTime!, $publishedOnly: Boolean, $mineOnly: Boolean, $kinds: [ScheduleOccurrenceKind!]) {
120
+ scheduleOccurrences(organizationId: $organizationId, calendarId: $calendarId, from: $from, to: $to, publishedOnly: $publishedOnly, mineOnly: $mineOnly, kinds: $kinds) {
121
+ occurrences {
122
+ ...scheduleOccurrenceFragment
123
+ }
124
+ hasMore
125
+ from
126
+ to
127
+ }
83
128
  }
84
-
85
129
  ${scheduleOccurrenceFragment}
86
130
  `;
87
131
 
88
132
  export const scheduleOccurrenceQry = gql`
89
- query scheduleOccurrence (
90
- $occurrenceId: GenericID!
91
- ) {
92
- scheduleOccurrence (
93
- occurrenceId: $occurrenceId
94
- ) {
95
- ...scheduleOccurrenceFragment
96
- }
133
+ query scheduleOccurrence($organizationId: GenericID!, $occurrenceId: GenericID!) {
134
+ scheduleOccurrence(organizationId: $organizationId, occurrenceId: $occurrenceId) {
135
+ ...scheduleOccurrenceFragment
97
136
  }
137
+ }
138
+ ${scheduleOccurrenceFragment}
139
+ `;
98
140
 
141
+ export const scheduleMyShiftsQry = gql`
142
+ query scheduleMyShifts($organizationId: GenericID!, $from: DateTime!, $to: DateTime!) {
143
+ scheduleMyShifts(organizationId: $organizationId, from: $from, to: $to) {
144
+ occurrences {
145
+ ...scheduleOccurrenceFragment
146
+ }
147
+ hasMore
148
+ from
149
+ to
150
+ }
151
+ }
99
152
  ${scheduleOccurrenceFragment}
100
153
  `;
101
154
 
102
- export const scheduleResourcesQry = gql`
103
- query scheduleResources (
104
- $organizationId: GenericID!
105
- ) {
106
- scheduleResources (
107
- organizationId: $organizationId
108
- ) {
109
- ...scheduleResourceFragment
110
- }
155
+ export const scheduleOpenShiftsQry = gql`
156
+ query scheduleOpenShifts($organizationId: GenericID!, $calendarId: GenericID, $from: DateTime!, $to: DateTime!, $forMe: Boolean) {
157
+ scheduleOpenShifts(organizationId: $organizationId, calendarId: $calendarId, from: $from, to: $to, forMe: $forMe) {
158
+ occurrence {
159
+ ...scheduleOccurrenceFragment
160
+ }
161
+ slotKey
162
+ openCount
163
+ eligibility {
164
+ eligible
165
+ slotKey
166
+ reasons {
167
+ code
168
+ severity
169
+ ruleId
170
+ startAt
171
+ endAt
172
+ message
173
+ }
174
+ }
175
+ }
176
+ }
177
+ ${scheduleOccurrenceFragment}
178
+ `;
179
+
180
+ export const scheduleShiftEligibilityQry = gql`
181
+ query scheduleShiftEligibility($organizationId: GenericID!, $occurrenceId: GenericID!, $slotKey: String, $resourceId: GenericID) {
182
+ scheduleShiftEligibility(organizationId: $organizationId, occurrenceId: $occurrenceId, slotKey: $slotKey, resourceId: $resourceId) {
183
+ eligible
184
+ slotKey
185
+ reasons {
186
+ code
187
+ severity
188
+ ruleId
189
+ startAt
190
+ endAt
191
+ message
192
+ }
193
+ }
111
194
  }
112
195
 
113
- ${scheduleResourceFragment}
114
196
  `;
115
197
 
116
- export const scheduleSeriesQry = gql`
117
- query scheduleSeries (
118
- $organizationId: GenericID!
119
- $seriesId: GenericID!
120
- ) {
121
- scheduleSeries (
122
- organizationId: $organizationId
123
- seriesId: $seriesId
124
- ) {
125
- ...scheduleSeriesFragment
126
- }
198
+ export const scheduleShiftCandidatesQry = gql`
199
+ query scheduleShiftCandidates($organizationId: GenericID!, $occurrenceId: GenericID!, $slotKey: String) {
200
+ scheduleShiftCandidates(organizationId: $organizationId, occurrenceId: $occurrenceId, slotKey: $slotKey) {
201
+ resource {
202
+ ...scheduleResourceFragment
203
+ viewerNotify {
204
+ channels
205
+ }
206
+ availability {
207
+ id
208
+ resourceId
209
+ startsOn
210
+ endsOn
211
+ maxUnitsPerDay
212
+ note
213
+ }
214
+ }
215
+ eligibility {
216
+ eligible
217
+ slotKey
218
+ reasons {
219
+ code
220
+ severity
221
+ ruleId
222
+ startAt
223
+ endAt
224
+ message
225
+ }
226
+ }
227
+ }
127
228
  }
229
+ ${scheduleResourceFragment}
230
+ `;
128
231
 
232
+ export const scheduleSeriesListQry = gql`
233
+ query scheduleSeriesList($organizationId: GenericID!, $calendarId: GenericID!, $includeInactive: Boolean) {
234
+ scheduleSeriesList(organizationId: $organizationId, calendarId: $calendarId, includeInactive: $includeInactive) {
235
+ ...scheduleSeriesFragment
236
+ }
237
+ }
129
238
  ${scheduleSeriesFragment}
130
239
  `;
131
240
 
132
- // NOTE: The evaluation is computed on read and never cached server-side — the
133
- // whole value of it is that it reflects the schedule as it stands right now.
134
- // "message" is the breach rendered in this organization's own language,
135
- // resolved from the rule-template registry; it is null only when nothing is
136
- // registered for the rule kind, in which case the client shows generic copy.
137
-
138
- export const scheduleEvaluationQry = gql`
139
- query scheduleEvaluation (
140
- $organizationId: GenericID!
141
- $calendarId: GenericID!
142
- $from: DateTime!
143
- $to: DateTime!
144
- ) {
145
- scheduleEvaluation (
146
- organizationId: $organizationId
147
- calendarId: $calendarId
148
- from: $from
149
- to: $to
150
- ) {
151
- calendarId
152
- windowStart
153
- windowEnd
154
- segmentCount
155
- blockingCount
156
- draftCount
157
-
158
- violations {
159
- ruleId
160
- templateKey
161
- message
162
- kind
163
- severity
164
- resourceId
165
- occurrenceId
166
- actorAccountId
167
- segmentStart
168
- segmentEnd
169
- detail
170
- key
171
- }
172
- }
241
+ export const scheduleDemandsQry = gql`
242
+ query scheduleDemands($organizationId: GenericID!, $calendarId: GenericID!, $from: DateTime!, $to: DateTime!) {
243
+ scheduleDemands(organizationId: $organizationId, calendarId: $calendarId, from: $from, to: $to) {
244
+ id
245
+ calendarId
246
+ resourceId
247
+ key
248
+ quantity
249
+ startAt
250
+ endAt
251
+ note
252
+ }
173
253
  }
254
+
174
255
  `;
175
256
 
176
257
  export const scheduleRulesQry = gql`
177
- query scheduleRules (
178
- $organizationId: GenericID!
179
- $calendarId: GenericID
180
- ) {
181
- scheduleRules (
182
- organizationId: $organizationId
183
- calendarId: $calendarId
184
- ) {
185
- id
186
- organizationId
187
- calendarId
188
- resourceId
189
- kind
190
- label
191
- templateKey
192
- config
193
- severity
194
- effectiveFrom
195
- effectiveTo
196
- ordinal
197
- version
198
- createdAt
199
- updatedAt
200
- }
201
- }
202
- `;
203
-
204
- // NOTE: Templates have no id — they are resolved most-specific-first from
205
- // three layers and returned flattened — so they are selected inline rather
206
- // than through a fragment.
207
-
208
- export const scheduleRuleTemplatesQry = gql`
209
- query scheduleRuleTemplates (
210
- $organizationId: GenericID!
211
- ) {
212
- scheduleRuleTemplates (
213
- organizationId: $organizationId
214
- ) {
215
- kind
216
- key
217
- label
218
- description
219
- messageTemplate
220
- defaultConfig
221
- defaultSeverity
222
- ordinal
223
- }
224
- }
225
- `;
226
-
227
- export const scheduleDemandQry = gql`
228
- query scheduleDemand (
229
- $organizationId: GenericID!
230
- $from: DateTime!
231
- $to: DateTime!
232
- ) {
233
- scheduleDemand (
234
- organizationId: $organizationId
235
- from: $from
236
- to: $to
237
- ) {
238
- id
239
- organizationId
240
- resourceId
241
- category
242
- startAt
243
- endAt
244
- quantity
245
- source
246
- createdAt
247
- updatedAt
248
- }
249
- }
250
- `;
251
-
252
- // NOTE: Both request lists reset on any request change in the organization
253
- // (getScheduleRequestsResetQueryTargets), because a claim moves a row OFF the
254
- // open board and ONTO the approval queue — a membership change no fragment
255
- // patch can express.
258
+ query scheduleRules($organizationId: GenericID!, $calendarId: GenericID) {
259
+ scheduleRules(organizationId: $organizationId, calendarId: $calendarId) {
260
+ key
261
+ id
262
+ organizationId
263
+ calendarId
264
+ resourceId
265
+ kind
266
+ label
267
+ config {
268
+ ratios {
269
+ key
270
+ childrenPerAdult
271
+ }
272
+ predicate {
273
+ roles
274
+ qualifications
275
+ tags
276
+ }
277
+ minAdults
278
+ windowDays
279
+ maxMinutes
280
+ minRestMinutes
281
+ }
282
+ severity
283
+ active
284
+ ordinal
285
+ }
286
+ }
256
287
 
257
- export const scheduleRequestsQry = gql`
258
- query scheduleRequests (
259
- $organizationId: GenericID!
260
- $calendarId: GenericID
261
- $statuses: [String!]
262
- $mineOnly: Boolean
263
- $offeredToMe: Boolean
264
- $limit: Int
265
- ) {
266
- scheduleRequests (
267
- organizationId: $organizationId
268
- calendarId: $calendarId
269
- statuses: $statuses
270
- mineOnly: $mineOnly
271
- offeredToMe: $offeredToMe
272
- limit: $limit
273
- ) {
274
- ...scheduleRequestFragment
275
- }
288
+ `;
289
+
290
+ export const scheduleViolationsQry = gql`
291
+ query scheduleViolations($organizationId: GenericID!, $calendarId: GenericID!, $from: DateTime!, $to: DateTime!) {
292
+ scheduleViolations(organizationId: $organizationId, calendarId: $calendarId, from: $from, to: $to) {
293
+ ...scheduleViolationFragment
294
+ }
295
+ }
296
+ ${scheduleViolationFragment}
297
+ `;
298
+
299
+ export const schedulePublishPreflightQry = gql`
300
+ query schedulePublishPreflight($organizationId: GenericID!, $calendarId: GenericID!, $from: DateTime!, $to: DateTime!) {
301
+ schedulePublishPreflight(organizationId: $organizationId, calendarId: $calendarId, from: $from, to: $to) {
302
+ draftCount
303
+ blockingCount
304
+ warningKeys
305
+ violations {
306
+ ...scheduleViolationFragment
307
+ }
308
+ diagnostics {
309
+ code
310
+ message
311
+ resourceId
312
+ ruleId
313
+ }
314
+ }
315
+ }
316
+ ${scheduleViolationFragment}
317
+ `;
318
+
319
+ export const schedulePublicationsQry = gql`
320
+ query schedulePublications($organizationId: GenericID!, $calendarId: GenericID!, $cursor: Cursor, $after: Boolean, $limit: Int) {
321
+ schedulePublications(organizationId: $organizationId, calendarId: $calendarId, cursor: $cursor, after: $after, limit: $limit) {
322
+ ...schedulePublicationFragment
323
+ viewerAcknowledgedAt
324
+ }
276
325
  }
326
+ ${schedulePublicationFragment}
327
+ `;
277
328
 
329
+ export const scheduleRequestsQry = gql`
330
+ query scheduleRequests($organizationId: GenericID!, $calendarId: GenericID, $kinds: [ScheduleRequestKind!], $statuses: [ScheduleRequestStatus!], $involvingMe: Boolean, $from: DateTime, $to: DateTime, $cursor: Cursor, $after: Boolean, $limit: Int) {
331
+ scheduleRequests(organizationId: $organizationId, calendarId: $calendarId, kinds: $kinds, statuses: $statuses, involvingMe: $involvingMe, from: $from, to: $to, cursor: $cursor, after: $after, limit: $limit) {
332
+ ...scheduleRequestFragment
333
+ occurrence {
334
+ ...scheduleOccurrenceFragment
335
+ }
336
+ targetOccurrence {
337
+ ...scheduleOccurrenceFragment
338
+ }
339
+ eligibility {
340
+ eligible
341
+ slotKey
342
+ reasons {
343
+ code
344
+ severity
345
+ ruleId
346
+ startAt
347
+ endAt
348
+ message
349
+ }
350
+ }
351
+ viewerIsRequester
352
+ viewerIsCounterparty
353
+ viewerCanDecide
354
+ }
355
+ }
278
356
  ${scheduleRequestFragment}
357
+ ${scheduleOccurrenceFragment}
279
358
  `;
280
359
 
281
360
  export const scheduleRequestQry = gql`
282
- query scheduleRequest (
283
- $organizationId: GenericID!
284
- $requestId: GenericID!
285
- ) {
286
- scheduleRequest (
287
- organizationId: $organizationId
288
- requestId: $requestId
289
- ) {
290
- ...scheduleRequestFragment
291
- }
361
+ query scheduleRequest($organizationId: GenericID!, $requestId: GenericID!) {
362
+ scheduleRequest(organizationId: $organizationId, requestId: $requestId) {
363
+ ...scheduleRequestFragment
364
+ occurrence {
365
+ ...scheduleOccurrenceFragment
366
+ }
367
+ targetOccurrence {
368
+ ...scheduleOccurrenceFragment
369
+ }
370
+ eligibility {
371
+ eligible
372
+ slotKey
373
+ reasons {
374
+ code
375
+ severity
376
+ ruleId
377
+ startAt
378
+ endAt
379
+ message
380
+ }
381
+ }
382
+ viewerIsRequester
383
+ viewerIsCounterparty
384
+ viewerCanDecide
385
+ }
292
386
  }
293
-
294
387
  ${scheduleRequestFragment}
388
+ ${scheduleOccurrenceFragment}
389
+ `;
390
+
391
+ export const scheduleTimeOffListQry = gql`
392
+ query scheduleTimeOffList($organizationId: GenericID!, $resourceIds: [GenericID!], $statuses: [ScheduleTimeOffStatus!], $mine: Boolean, $from: DateTime, $to: DateTime, $cursor: Cursor, $after: Boolean, $limit: Int) {
393
+ scheduleTimeOffList(organizationId: $organizationId, resourceIds: $resourceIds, statuses: $statuses, mine: $mine, from: $from, to: $to, cursor: $cursor, after: $after, limit: $limit) {
394
+ ...scheduleTimeOffFragment
395
+ conflictingAssignments {
396
+ ...scheduleOccurrenceFragment
397
+ }
398
+ releasedAssignmentIds
399
+ viewerIsRequester
400
+ viewerCanDecide
401
+ }
402
+ }
403
+ ${scheduleTimeOffFragment}
404
+ ${scheduleOccurrenceFragment}
405
+ `;
406
+
407
+ export const scheduleProjectsQry = gql`
408
+ query scheduleProjects($organizationId: GenericID!, $statuses: [ScheduleProjectStatus!], $includeArchived: Boolean, $search: String) {
409
+ scheduleProjects(organizationId: $organizationId, statuses: $statuses, includeArchived: $includeArchived, search: $search) {
410
+ ...scheduleProjectFragment
411
+ activityCount
412
+ unreviewedCount
413
+ viewerPermission
414
+ viewerCanEdit
415
+ viewerCanEditAccess
416
+ viewerIsManager
417
+ }
418
+ }
419
+ ${scheduleProjectFragment}
420
+ ${scheduleProjectRunFragment}
421
+ `;
422
+
423
+ export const scheduleProjectQry = gql`
424
+ query scheduleProject($projectId: GenericID!) {
425
+ scheduleProject(projectId: $projectId) {
426
+ ...scheduleProjectFragment
427
+ activityCount
428
+ unreviewedCount
429
+ viewerPermission
430
+ viewerCanEdit
431
+ viewerCanEditAccess
432
+ viewerIsManager
433
+ }
434
+ }
435
+ ${scheduleProjectFragment}
436
+ ${scheduleProjectRunFragment}
437
+ `;
438
+
439
+ export const scheduleProjectNetworkQry = gql`
440
+ query scheduleProjectNetwork($projectId: GenericID!, $filter: ScheduleNetworkFilter) {
441
+ scheduleProjectNetwork(projectId: $projectId, filter: $filter) {
442
+ project {
443
+ ...scheduleProjectFragment
444
+ activityCount
445
+ unreviewedCount
446
+ viewerPermission
447
+ viewerCanEdit
448
+ viewerCanEditAccess
449
+ viewerIsManager
450
+ }
451
+ wbsNodes {
452
+ id
453
+ projectId
454
+ parentId
455
+ code
456
+ name
457
+ path
458
+ depth
459
+ ordinal
460
+ startAt
461
+ finishAt
462
+ percentComplete
463
+ }
464
+ activities {
465
+ ...scheduleActivityFragment
466
+ }
467
+ relationships {
468
+ ...scheduleRelationshipFragment
469
+ }
470
+ assignments {
471
+ id
472
+ projectId
473
+ activityId
474
+ resourceId
475
+ plannedUnits
476
+ unitsPerDay
477
+ actualUnits
478
+ remainingUnits
479
+ }
480
+ baselineActivities {
481
+ plannedStartAt
482
+ plannedFinishAt
483
+ id
484
+ baselineId
485
+ activityId
486
+ code
487
+ name
488
+ startAt
489
+ finishAt
490
+ plannedDurationMinutes
491
+ totalFloatMinutes
492
+ plannedUnits
493
+ percentComplete
494
+ }
495
+ resources {
496
+ ...scheduleResourceFragment
497
+ viewerNotify {
498
+ channels
499
+ }
500
+ availability {
501
+ id
502
+ resourceId
503
+ startsOn
504
+ endsOn
505
+ maxUnitsPerDay
506
+ note
507
+ }
508
+ }
509
+ workCalendars {
510
+ ...scheduleWorkCalendarFragment
511
+ exceptions {
512
+ id
513
+ workCalendarId
514
+ date
515
+ ranges {
516
+ start
517
+ end
518
+ }
519
+ note
520
+ }
521
+ }
522
+ networkRevision
523
+ totalActivityCount
524
+ filtered
525
+ truncated
526
+ }
527
+ }
528
+ ${scheduleProjectFragment}
529
+ ${scheduleActivityFragment}
530
+ ${scheduleRelationshipFragment}
531
+ ${scheduleResourceFragment}
532
+ ${scheduleWorkCalendarFragment}
533
+ ${scheduleProjectRunFragment}
534
+ `;
535
+
536
+ export const scheduleProjectRunsQry = gql`
537
+ query scheduleProjectRuns($projectId: GenericID!, $cursor: Cursor, $after: Boolean, $limit: Int) {
538
+ scheduleProjectRuns(projectId: $projectId, cursor: $cursor, after: $after, limit: $limit) {
539
+ ...scheduleProjectRunFragment
540
+ }
541
+ }
542
+ ${scheduleProjectRunFragment}
543
+ `;
544
+
545
+ export const scheduleProjectRunQry = gql`
546
+ query scheduleProjectRun($projectId: GenericID!, $runId: GenericID!) {
547
+ scheduleProjectRun(projectId: $projectId, runId: $runId) {
548
+ ...scheduleProjectRunFragment
549
+ }
550
+ }
551
+ ${scheduleProjectRunFragment}
552
+ `;
553
+
554
+ export const scheduleBaselinesQry = gql`
555
+ query scheduleBaselines($projectId: GenericID!, $cursor: Cursor, $after: Boolean, $limit: Int) {
556
+ scheduleBaselines(projectId: $projectId, cursor: $cursor, after: $after, limit: $limit) {
557
+ id
558
+ projectId
559
+ name
560
+ note
561
+ dataDateAt
562
+ isCurrent
563
+ createdByAccountId
564
+ createdAt
565
+ cursor
566
+ }
567
+ }
568
+
569
+ `;
570
+
571
+ export const scheduleBaselineActivitiesQry = gql`
572
+ query scheduleBaselineActivities($projectId: GenericID!, $baselineId: GenericID!) {
573
+ scheduleBaselineActivities(projectId: $projectId, baselineId: $baselineId) {
574
+ plannedStartAt
575
+ plannedFinishAt
576
+ id
577
+ baselineId
578
+ activityId
579
+ code
580
+ name
581
+ startAt
582
+ finishAt
583
+ plannedDurationMinutes
584
+ totalFloatMinutes
585
+ plannedUnits
586
+ percentComplete
587
+ }
588
+ }
589
+
295
590
  `;
296
591
 
297
- export const scheduleRequestEventsQry = gql`
298
- query scheduleRequestEvents (
299
- $organizationId: GenericID!
300
- $requestId: GenericID!
301
- ) {
302
- scheduleRequestEvents (
303
- organizationId: $organizationId
304
- requestId: $requestId
305
- ) {
306
- id
307
- requestId
308
- fromStatus
309
- toStatus
310
- actorAccountId
311
- detail
312
- createdAt
313
- }
592
+ export const scheduleBaselineVarianceQry = gql`
593
+ query scheduleBaselineVariance($projectId: GenericID!, $baselineId: GenericID) {
594
+ scheduleBaselineVariance(projectId: $projectId, baselineId: $baselineId) {
595
+ baseline {
596
+ id
597
+ projectId
598
+ name
599
+ note
600
+ dataDateAt
601
+ isCurrent
602
+ createdByAccountId
603
+ createdAt
604
+ cursor
314
605
  }
606
+ rows {
607
+ activityId
608
+ code
609
+ baselineStartAt
610
+ baselineFinishAt
611
+ startAt
612
+ finishAt
613
+ startVarianceMinutes
614
+ finishVarianceMinutes
615
+ durationVarianceMinutes
616
+ floatVarianceMinutes
617
+ }
618
+ slippedCount
619
+ addedCount
620
+ removedCount
621
+ finishVarianceMinutes
622
+ }
623
+ }
624
+
625
+ `;
626
+
627
+ export const scheduleWorkCalendarQry = gql`
628
+ query scheduleWorkCalendar($organizationId: GenericID!, $workCalendarId: GenericID!) {
629
+ scheduleWorkCalendar(organizationId: $organizationId, workCalendarId: $workCalendarId) {
630
+ ...scheduleWorkCalendarFragment
631
+ exceptions {
632
+ id
633
+ workCalendarId
634
+ date
635
+ ranges {
636
+ start
637
+ end
638
+ }
639
+ note
640
+ }
641
+ }
642
+ }
643
+ ${scheduleWorkCalendarFragment}
644
+ `;
645
+
646
+ export const scheduleResourceQry = gql`
647
+ query scheduleResource($organizationId: GenericID!, $resourceId: GenericID!) {
648
+ scheduleResource(organizationId: $organizationId, resourceId: $resourceId) {
649
+ ...scheduleResourceFragment
650
+ viewerNotify {
651
+ channels
652
+ }
653
+ availability {
654
+ id
655
+ resourceId
656
+ startsOn
657
+ endsOn
658
+ maxUnitsPerDay
659
+ note
660
+ }
661
+ }
662
+ }
663
+ ${scheduleResourceFragment}
664
+ `;
665
+
666
+ export const scheduleSeriesQry = gql`
667
+ query scheduleSeries($organizationId: GenericID!, $seriesId: GenericID!) {
668
+ scheduleSeries(organizationId: $organizationId, seriesId: $seriesId) {
669
+ ...scheduleSeriesFragment
670
+ }
671
+ }
672
+ ${scheduleSeriesFragment}
673
+ `;
674
+
675
+ export const scheduleCalendarAccessGrantsQry = gql`
676
+ query scheduleCalendarAccessGrants($organizationId: GenericID!, $calendarId: GenericID!) {
677
+ scheduleCalendarAccessGrants(organizationId: $organizationId, calendarId: $calendarId) {
678
+ granteeType granteeId permission
679
+ }
680
+ }
681
+
682
+ `;
683
+
684
+ export const scheduleProjectAccessGrantsQry = gql`
685
+ query scheduleProjectAccessGrants($organizationId: GenericID!, $projectId: GenericID!) {
686
+ scheduleProjectAccessGrants(organizationId: $organizationId, projectId: $projectId) {
687
+ granteeType granteeId permission
688
+ }
689
+ }
690
+
315
691
  `;