@jsb188/graphql 1.1.12 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/audience.d.ts +14 -152
- package/cache/config.ts +35 -32
- package/cache/index.helpers.ts +1 -1
- package/cache/index.ts +73 -44
- package/cache/mounted-queries.ts +33 -0
- package/cache/persist.ts +10 -4
- package/cache/realtime-fence.ts +47 -0
- package/cache/realtime-live.ts +17 -0
- package/client/draft-persistence.ts +10 -39
- package/client/index.ts +2 -1
- package/client/request.ts +9 -34
- package/client/storage-asset.ts +58 -0
- package/gql/fragments/accountAuthFragments.ts +0 -4
- package/gql/fragments/agentNoteFragments.ts +8 -2
- package/gql/fragments/aiChatFragments.ts +0 -2
- package/gql/fragments/aiChatLinkFragments.ts +8 -0
- package/gql/fragments/audienceFragments.ts +1 -66
- package/gql/fragments/emailFragments.ts +27 -4
- package/gql/fragments/emailOutreachFragments.ts +281 -0
- package/gql/fragments/inboundContactFragments.ts +1 -1
- package/gql/fragments/libraryFragments.ts +120 -0
- package/gql/fragments/organizationFragments.ts +4 -2
- package/gql/fragments/scheduleFragments.ts +241 -324
- package/gql/fragments/sheetFragments.ts +4 -53
- package/gql/fragments/workWaitFragments.ts +13 -0
- package/gql/fragments/workflowFragments.ts +20 -4
- package/gql/mutations/agentNoteMutations.ts +2 -0
- package/gql/mutations/aiChatLinkMutations.ts +13 -0
- package/gql/mutations/aiChatMutations.ts +4 -6
- package/gql/mutations/audienceMutations.ts +0 -13
- package/gql/mutations/authMutations.ts +12 -60
- package/gql/mutations/emailMutations.ts +22 -0
- package/gql/mutations/emailOutreachMutations.ts +139 -0
- package/gql/mutations/index.ts +3 -1
- package/gql/mutations/organizationMutations.ts +2 -2
- package/gql/mutations/scheduleMutations.ts +61 -787
- package/gql/mutations/storageMutations.ts +1 -0
- package/gql/mutations/workflowMutations.ts +76 -0
- package/gql/queries/agentMemoryQueries.ts +6 -2
- package/gql/queries/agentNoteQueries.ts +26 -29
- package/gql/queries/aiChatQueries.ts +39 -40
- package/gql/queries/audienceQueries.ts +31 -55
- package/gql/queries/authQueries.ts +16 -6
- package/gql/queries/billingQueries.ts +26 -10
- package/gql/queries/dataTableQueries.ts +24 -15
- package/gql/queries/emailOutreachQueries.ts +282 -0
- package/gql/queries/emailQueries.ts +39 -12
- package/gql/queries/emailReplyReportQueries.ts +60 -9
- package/gql/queries/fieldDocQueries.ts +36 -14
- package/gql/queries/inboundContactQueries.ts +11 -4
- package/gql/queries/index.ts +2 -2
- package/gql/queries/libraryQueries.ts +112 -0
- package/gql/queries/logQueries.ts +31 -12
- package/gql/queries/organizationQueries.ts +31 -12
- package/gql/queries/qrCodeQueries.ts +11 -4
- package/gql/queries/scheduleQueries.ts +252 -505
- package/gql/queries/sheetQueries.ts +36 -14
- package/gql/queries/storageQueries.ts +11 -4
- package/gql/queries/workflowQueries.ts +53 -10
- package/gql/reactivity.ts +98 -0
- package/gql/recordReads.ts +171 -0
- package/hooks/index.ts +79 -52
- package/hooks/use-agentNote-mtn.ts +7 -0
- package/hooks/use-agentNote-qry.ts +30 -58
- package/hooks/use-agentNote-recovery.ts +6 -21
- package/hooks/use-aiChat-mtn.ts +9 -4
- package/hooks/use-aiChat-qry.ts +28 -7
- package/hooks/use-audience-mtn.ts +0 -24
- package/hooks/use-audience-qry.helpers.ts +0 -24
- package/hooks/use-audience-qry.ts +1 -86
- package/hooks/use-dataTable-mtn.ts +3 -3
- package/hooks/use-dataTable-qry.ts +7 -2
- package/hooks/use-email-mtn.ts +26 -0
- package/hooks/use-email-qry.helpers.ts +1 -1
- package/hooks/use-email-qry.ts +18 -3
- package/hooks/use-emailOutreach-mtn.ts +211 -0
- package/hooks/use-emailOutreach-qry.helpers.ts +25 -0
- package/hooks/use-emailOutreach-qry.ts +367 -0
- package/hooks/use-emailOutreachReplyReport-qry.ts +46 -0
- package/hooks/use-fieldDoc-qry.ts +1 -1
- package/hooks/use-library-qry.ts +233 -0
- package/hooks/use-qrCode-qry.ts +1 -1
- package/hooks/use-schedule-mtn.ts +10 -300
- package/hooks/use-schedule-qry.ts +168 -680
- package/hooks/use-schedule-reactive.ts +71 -339
- package/hooks/use-sheet-qry.ts +6 -1
- package/hooks/use-workflow-mtn.ts +45 -1
- package/hooks/use-workflow-qry.ts +22 -2
- package/libs/ai-chat-link-events.ts +78 -0
- package/libs/data-changes.helpers.ts +161 -0
- package/libs/data-changes.ts +382 -0
- package/libs/fragment-realtime-sequence.ts +3 -3
- package/libs/record-read.ts +327 -0
- package/libs/sheet-command-batch.ts +3 -2
- package/libs/sheet-realtime-packet.ts +53 -0
- package/loaders/emailPreference.ts +18 -24
- package/package.json +44 -17
- package/schedule.d.ts +267 -874
- package/types.d.ts +3 -1
- package/cache/index.chat-activity.test.ts +0 -119
- package/cache/index.chat.test.ts +0 -92
- package/cache/index.regression.test.ts +0 -149
- package/cache/index.test.ts +0 -1209
- package/deno.lock +0 -187
- package/deno.test.json +0 -12
- package/gql/fragments/campaignFragments.ts +0 -566
- package/gql/mutations/campaignMutations.ts +0 -258
- package/gql/queries/appQueries.ts +0 -14
- package/gql/queries/campaignQueries.ts +0 -236
- package/hooks/index.helpers.test.ts +0 -50
- package/hooks/use-agentNote-recovery.helpers.test.ts +0 -68
- package/hooks/use-aiChat-qry.helpers.test.ts +0 -63
- package/hooks/use-app-qry.ts +0 -22
- package/hooks/use-audience-qry.helpers.test.ts +0 -80
- package/hooks/use-campaign-generation-recovery.ts +0 -53
- package/hooks/use-campaign-mtn.ts +0 -436
- package/hooks/use-campaign-qry.helpers.ts +0 -40
- package/hooks/use-campaign-qry.ts +0 -834
- package/hooks/use-emailCampaignReplyReport-qry.ts +0 -27
- package/hooks/use-fieldDoc-qry.helpers.test.ts +0 -65
- package/hooks/use-publicFormEmail-mtn.ts +0 -27
- package/libs/fragment-recovery.test.ts +0 -326
- package/libs/fragment-recovery.ts +0 -325
- package/libs/orchestrator-realtime.helpers.test.ts +0 -229
- package/libs/orchestrator-realtime.helpers.ts +0 -317
- package/libs/orchestrator-realtime.ts +0 -433
- package/libs/request-cache-regression.test.ts +0 -122
- package/libs/request-managed-session.test.ts +0 -574
- package/libs/request-no-store.test.ts +0 -419
- package/libs/sheet-view-realtime-router.test.ts +0 -214
- package/libs/sse-ticket.test.ts +0 -26
- package/loaders/campaign.test.ts +0 -186
- package/loaders/campaign.ts +0 -110
- package/tests/agent-note-detail-cache.test.ts +0 -120
- package/tests/agent-note-search.test.ts +0 -444
- package/tsconfig.json +0 -13
|
@@ -1,738 +1,226 @@
|
|
|
1
1
|
import { useQuery } from '@jsb188/graphql/client';
|
|
2
|
+
import type { DocumentNode } from 'graphql';
|
|
2
3
|
import * as documents from '../gql/queries/scheduleQueries.ts';
|
|
3
4
|
import type * as Schedule from '../schedule.d.ts';
|
|
4
5
|
import type { UseQueryParams } from '../types.d.ts';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
variables: { ...variables, ...params.variables },
|
|
42
|
-
skip: !variables.organizationId || !!params.skip,
|
|
43
|
-
});
|
|
44
|
-
return {
|
|
45
|
-
...rest,
|
|
46
|
-
scheduleResources: (data?.scheduleResources ??
|
|
47
|
-
null) as Array<Schedule.ScheduleResourceGQL> | null,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/*
|
|
52
|
-
* Read scheduleCodeTypes with top-level variables aligned to server reset targets.
|
|
53
|
-
*/
|
|
54
|
-
export function useScheduleCodeTypes(
|
|
55
|
-
p: Partial<Schedule.ScheduleCodeTypesVariables> | string | null | undefined,
|
|
56
|
-
params: UseQueryParams = {},
|
|
57
|
-
) {
|
|
58
|
-
const variables: Partial<Schedule.ScheduleCodeTypesVariables> =
|
|
59
|
-
typeof p === 'string' ? { organizationId: p } : p || {};
|
|
60
|
-
const { data, ...rest } = useQuery(documents.scheduleCodeTypesQry, {
|
|
61
|
-
...params,
|
|
62
|
-
variables: { ...variables, ...params.variables },
|
|
63
|
-
skip: !variables.organizationId || !!params.skip,
|
|
64
|
-
});
|
|
65
|
-
return {
|
|
66
|
-
...rest,
|
|
67
|
-
scheduleCodeTypes: (data?.scheduleCodeTypes ??
|
|
68
|
-
null) as Array<Schedule.ScheduleCodeTypeGQL> | null,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/*
|
|
73
|
-
* Read scheduleResourceUsage with top-level variables aligned to server reset targets.
|
|
74
|
-
*/
|
|
75
|
-
export function useScheduleResourceUsage(
|
|
76
|
-
p: Partial<Schedule.ScheduleResourceUsageVariables>,
|
|
77
|
-
params: UseQueryParams = {},
|
|
78
|
-
) {
|
|
79
|
-
const variables: Partial<Schedule.ScheduleResourceUsageVariables> = p;
|
|
80
|
-
const { data, ...rest } = useQuery(documents.scheduleResourceUsageQry, {
|
|
81
|
-
...params,
|
|
82
|
-
variables: { ...variables, ...params.variables },
|
|
83
|
-
skip:
|
|
84
|
-
!variables.organizationId ||
|
|
85
|
-
!variables.projectId ||
|
|
86
|
-
!variables.from ||
|
|
87
|
-
!variables.to ||
|
|
88
|
-
!!params.skip,
|
|
89
|
-
});
|
|
90
|
-
return {
|
|
91
|
-
...rest,
|
|
92
|
-
scheduleResourceUsage: (data?.scheduleResourceUsage ??
|
|
93
|
-
null) as Array<Schedule.ScheduleResourceUsageDayGQL> | null,
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/*
|
|
98
|
-
* Read scheduleCalendars with top-level variables aligned to server reset targets.
|
|
99
|
-
*/
|
|
100
|
-
export function useScheduleCalendars(
|
|
101
|
-
p: Partial<Schedule.ScheduleCalendarsVariables> | string | null | undefined,
|
|
102
|
-
params: UseQueryParams = {},
|
|
103
|
-
) {
|
|
104
|
-
const variables: Partial<Schedule.ScheduleCalendarsVariables> =
|
|
105
|
-
typeof p === 'string' ? { organizationId: p } : p || {};
|
|
106
|
-
const { data, ...rest } = useQuery(documents.scheduleCalendarsQry, {
|
|
107
|
-
...params,
|
|
108
|
-
variables: { ...variables, ...params.variables },
|
|
109
|
-
skip: !variables.organizationId || !!params.skip,
|
|
110
|
-
});
|
|
111
|
-
return {
|
|
112
|
-
...rest,
|
|
113
|
-
scheduleCalendars: (data?.scheduleCalendars ??
|
|
114
|
-
null) as Array<Schedule.ScheduleCalendarGQL> | null,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/*
|
|
119
|
-
* Read scheduleCalendar with top-level variables aligned to server reset targets.
|
|
120
|
-
*/
|
|
121
|
-
export function useScheduleCalendar(
|
|
122
|
-
p: Partial<Schedule.ScheduleCalendarVariables>,
|
|
123
|
-
params: UseQueryParams = {},
|
|
124
|
-
) {
|
|
125
|
-
const variables: Partial<Schedule.ScheduleCalendarVariables> = p;
|
|
126
|
-
const { data, ...rest } = useQuery(documents.scheduleCalendarQry, {
|
|
127
|
-
...params,
|
|
128
|
-
variables: { ...variables, ...params.variables },
|
|
129
|
-
skip: !variables.calendarId || !!params.skip,
|
|
130
|
-
});
|
|
131
|
-
return {
|
|
132
|
-
...rest,
|
|
133
|
-
scheduleCalendar: (data?.scheduleCalendar ??
|
|
134
|
-
null) as Schedule.ScheduleCalendarGQL | null,
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/*
|
|
139
|
-
* Read scheduleOccurrences with top-level variables aligned to server reset targets.
|
|
140
|
-
*/
|
|
141
|
-
export function useScheduleOccurrences(
|
|
142
|
-
p: Partial<Schedule.ScheduleOccurrencesVariables>,
|
|
143
|
-
params: UseQueryParams = {},
|
|
144
|
-
) {
|
|
145
|
-
const variables: Partial<Schedule.ScheduleOccurrencesVariables> = p;
|
|
146
|
-
const { data, ...rest } = useQuery(documents.scheduleOccurrencesQry, {
|
|
147
|
-
...params,
|
|
148
|
-
variables: { ...variables, ...params.variables },
|
|
149
|
-
skip:
|
|
150
|
-
!variables.organizationId ||
|
|
151
|
-
!variables.calendarId ||
|
|
152
|
-
!variables.from ||
|
|
153
|
-
!variables.to ||
|
|
154
|
-
!!params.skip,
|
|
155
|
-
});
|
|
156
|
-
return {
|
|
157
|
-
...rest,
|
|
158
|
-
scheduleOccurrences: (data?.scheduleOccurrences ??
|
|
159
|
-
null) as Schedule.ScheduleOccurrenceWindowGQL | null,
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/*
|
|
164
|
-
* Read scheduleOccurrence with top-level variables aligned to server reset targets.
|
|
165
|
-
*/
|
|
166
|
-
export function useScheduleOccurrence(
|
|
167
|
-
p: Partial<Schedule.ScheduleOccurrenceVariables>,
|
|
168
|
-
params: UseQueryParams = {},
|
|
169
|
-
) {
|
|
170
|
-
const variables: Partial<Schedule.ScheduleOccurrenceVariables> = p;
|
|
171
|
-
const { data, ...rest } = useQuery(documents.scheduleOccurrenceQry, {
|
|
172
|
-
...params,
|
|
173
|
-
variables: { ...variables, ...params.variables },
|
|
174
|
-
skip: !variables.organizationId || !variables.occurrenceId || !!params.skip,
|
|
175
|
-
});
|
|
176
|
-
return {
|
|
177
|
-
...rest,
|
|
178
|
-
scheduleOccurrence: (data?.scheduleOccurrence ??
|
|
179
|
-
null) as Schedule.ScheduleOccurrenceGQL | null,
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/*
|
|
184
|
-
* Read scheduleMyShifts with top-level variables aligned to server reset targets.
|
|
185
|
-
*/
|
|
186
|
-
export function useScheduleMyShifts(
|
|
187
|
-
p: Partial<Schedule.ScheduleMyShiftsVariables>,
|
|
188
|
-
params: UseQueryParams = {},
|
|
189
|
-
) {
|
|
190
|
-
const variables: Partial<Schedule.ScheduleMyShiftsVariables> = p;
|
|
191
|
-
const { data, ...rest } = useQuery(documents.scheduleMyShiftsQry, {
|
|
192
|
-
...params,
|
|
193
|
-
variables: { ...variables, ...params.variables },
|
|
194
|
-
skip:
|
|
195
|
-
!variables.organizationId ||
|
|
196
|
-
!variables.from ||
|
|
197
|
-
!variables.to ||
|
|
198
|
-
!!params.skip,
|
|
199
|
-
});
|
|
200
|
-
return {
|
|
201
|
-
...rest,
|
|
202
|
-
scheduleMyShifts: (data?.scheduleMyShifts ??
|
|
203
|
-
null) as Schedule.ScheduleOccurrenceWindowGQL | null,
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/*
|
|
208
|
-
* Read scheduleOpenShifts with top-level variables aligned to server reset targets.
|
|
209
|
-
*/
|
|
210
|
-
export function useScheduleOpenShifts(
|
|
211
|
-
p: Partial<Schedule.ScheduleOpenShiftsVariables>,
|
|
212
|
-
params: UseQueryParams = {},
|
|
213
|
-
) {
|
|
214
|
-
const variables: Partial<Schedule.ScheduleOpenShiftsVariables> = p;
|
|
215
|
-
const { data, ...rest } = useQuery(documents.scheduleOpenShiftsQry, {
|
|
216
|
-
...params,
|
|
217
|
-
variables: { ...variables, ...params.variables },
|
|
218
|
-
skip:
|
|
219
|
-
!variables.organizationId ||
|
|
220
|
-
!variables.from ||
|
|
221
|
-
!variables.to ||
|
|
222
|
-
!!params.skip,
|
|
223
|
-
});
|
|
224
|
-
return {
|
|
225
|
-
...rest,
|
|
226
|
-
scheduleOpenShifts: (data?.scheduleOpenShifts ??
|
|
227
|
-
null) as Array<Schedule.ScheduleOpenShiftGQL> | null,
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/*
|
|
232
|
-
* Read scheduleShiftEligibility with top-level variables aligned to server reset targets.
|
|
233
|
-
*/
|
|
234
|
-
export function useScheduleShiftEligibility(
|
|
235
|
-
p: Partial<Schedule.ScheduleShiftEligibilityVariables>,
|
|
236
|
-
params: UseQueryParams = {},
|
|
237
|
-
) {
|
|
238
|
-
const variables: Partial<Schedule.ScheduleShiftEligibilityVariables> = p;
|
|
239
|
-
const { data, ...rest } = useQuery(documents.scheduleShiftEligibilityQry, {
|
|
240
|
-
...params,
|
|
241
|
-
variables: { ...variables, ...params.variables },
|
|
242
|
-
skip: !variables.organizationId || !variables.occurrenceId || !!params.skip,
|
|
243
|
-
});
|
|
244
|
-
return {
|
|
245
|
-
...rest,
|
|
246
|
-
scheduleShiftEligibility: (data?.scheduleShiftEligibility ??
|
|
247
|
-
null) as Schedule.ScheduleEligibilityGQL | null,
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/*
|
|
252
|
-
* Read scheduleShiftCandidates with top-level variables aligned to server reset targets.
|
|
253
|
-
*/
|
|
254
|
-
export function useScheduleShiftCandidates(
|
|
255
|
-
p: Partial<Schedule.ScheduleShiftCandidatesVariables>,
|
|
256
|
-
params: UseQueryParams = {},
|
|
257
|
-
) {
|
|
258
|
-
const variables: Partial<Schedule.ScheduleShiftCandidatesVariables> = p;
|
|
259
|
-
const { data, ...rest } = useQuery(documents.scheduleShiftCandidatesQry, {
|
|
260
|
-
...params,
|
|
261
|
-
variables: { ...variables, ...params.variables },
|
|
262
|
-
skip: !variables.organizationId || !variables.occurrenceId || !!params.skip,
|
|
263
|
-
});
|
|
264
|
-
return {
|
|
265
|
-
...rest,
|
|
266
|
-
scheduleShiftCandidates: (data?.scheduleShiftCandidates ??
|
|
267
|
-
null) as Array<Schedule.ScheduleShiftCandidateGQL> | null,
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
/*
|
|
272
|
-
* Read scheduleSeriesList with top-level variables aligned to server reset targets.
|
|
273
|
-
*/
|
|
274
|
-
export function useScheduleSeriesList(
|
|
275
|
-
p: Partial<Schedule.ScheduleSeriesListVariables>,
|
|
276
|
-
params: UseQueryParams = {},
|
|
277
|
-
) {
|
|
278
|
-
const variables: Partial<Schedule.ScheduleSeriesListVariables> = p;
|
|
279
|
-
const { data, ...rest } = useQuery(documents.scheduleSeriesListQry, {
|
|
280
|
-
...params,
|
|
281
|
-
variables: { ...variables, ...params.variables },
|
|
282
|
-
skip: !variables.organizationId || !variables.calendarId || !!params.skip,
|
|
283
|
-
});
|
|
284
|
-
return {
|
|
285
|
-
...rest,
|
|
286
|
-
scheduleSeriesList: (data?.scheduleSeriesList ??
|
|
287
|
-
null) as Array<Schedule.ScheduleSeriesGQL> | null,
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/*
|
|
292
|
-
* Read scheduleDemands with top-level variables aligned to server reset targets.
|
|
293
|
-
*/
|
|
294
|
-
export function useScheduleDemands(
|
|
295
|
-
p: Partial<Schedule.ScheduleDemandsVariables>,
|
|
296
|
-
params: UseQueryParams = {},
|
|
297
|
-
) {
|
|
298
|
-
const variables: Partial<Schedule.ScheduleDemandsVariables> = p;
|
|
299
|
-
const { data, ...rest } = useQuery(documents.scheduleDemandsQry, {
|
|
300
|
-
...params,
|
|
301
|
-
variables: { ...variables, ...params.variables },
|
|
302
|
-
skip:
|
|
303
|
-
!variables.organizationId ||
|
|
304
|
-
!variables.calendarId ||
|
|
305
|
-
!variables.from ||
|
|
306
|
-
!variables.to ||
|
|
307
|
-
!!params.skip,
|
|
308
|
-
});
|
|
309
|
-
return {
|
|
310
|
-
...rest,
|
|
311
|
-
scheduleDemands: (data?.scheduleDemands ??
|
|
312
|
-
null) as Array<Schedule.ScheduleDemandGQL> | null,
|
|
7
|
+
type ScheduleQueryResult<K extends string, R> = Omit<
|
|
8
|
+
ReturnType<typeof useQuery>,
|
|
9
|
+
'data'
|
|
10
|
+
> &
|
|
11
|
+
Record<K, R | null>;
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Compose one schedule read hook. Variables stay top-level so they line up
|
|
15
|
+
* with the scope keys of the server's changes; the query is skipped until every
|
|
16
|
+
* required variable is set. A string argument fills the first required variable.
|
|
17
|
+
*/
|
|
18
|
+
function composeScheduleQueryHook<V extends object, R, K extends string>(
|
|
19
|
+
document: DocumentNode,
|
|
20
|
+
resultKey: K,
|
|
21
|
+
requiredKeys: Array<keyof V & string>,
|
|
22
|
+
) {
|
|
23
|
+
/*
|
|
24
|
+
* Read one schedule query and return its result under the query's name.
|
|
25
|
+
*/
|
|
26
|
+
return function useScheduleQuery(
|
|
27
|
+
p: Partial<V> | string | null | undefined,
|
|
28
|
+
params: UseQueryParams = {},
|
|
29
|
+
): ScheduleQueryResult<K, R> {
|
|
30
|
+
const variables = (
|
|
31
|
+
typeof p === 'string' ? { [requiredKeys[0]]: p } : p || {}
|
|
32
|
+
) as Partial<V>;
|
|
33
|
+
const { data, ...rest } = useQuery(document, {
|
|
34
|
+
...params,
|
|
35
|
+
variables: { ...variables, ...params.variables },
|
|
36
|
+
skip: requiredKeys.some((key) => !variables[key]) || !!params.skip,
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
...rest,
|
|
40
|
+
[resultKey]: (data?.[resultKey] ?? null) as R | null,
|
|
41
|
+
} as ScheduleQueryResult<K, R>;
|
|
313
42
|
};
|
|
314
43
|
}
|
|
315
44
|
|
|
316
45
|
/*
|
|
317
|
-
* Read
|
|
46
|
+
* Read the organization's work calendars with their dated exceptions.
|
|
318
47
|
*/
|
|
319
|
-
export
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
...params,
|
|
327
|
-
variables: { ...variables, ...params.variables },
|
|
328
|
-
skip: !variables.organizationId || !!params.skip,
|
|
329
|
-
});
|
|
330
|
-
return {
|
|
331
|
-
...rest,
|
|
332
|
-
scheduleRules: (data?.scheduleRules ??
|
|
333
|
-
null) as Array<Schedule.ScheduleRuleGQL> | null,
|
|
334
|
-
};
|
|
335
|
-
}
|
|
48
|
+
export const useScheduleWorkCalendars = composeScheduleQueryHook<
|
|
49
|
+
Schedule.ScheduleWorkCalendarsVariables,
|
|
50
|
+
Array<Schedule.ScheduleWorkCalendarGQL>,
|
|
51
|
+
'scheduleWorkCalendars'
|
|
52
|
+
>(documents.scheduleWorkCalendarsQry, 'scheduleWorkCalendars', [
|
|
53
|
+
'organizationId',
|
|
54
|
+
]);
|
|
336
55
|
|
|
337
56
|
/*
|
|
338
|
-
* Read
|
|
57
|
+
* Read one work calendar with its dated exceptions.
|
|
339
58
|
*/
|
|
340
|
-
export
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
skip:
|
|
349
|
-
!variables.organizationId ||
|
|
350
|
-
!variables.calendarId ||
|
|
351
|
-
!variables.from ||
|
|
352
|
-
!variables.to ||
|
|
353
|
-
!!params.skip,
|
|
354
|
-
});
|
|
355
|
-
return {
|
|
356
|
-
...rest,
|
|
357
|
-
scheduleViolations: (data?.scheduleViolations ??
|
|
358
|
-
null) as Array<Schedule.ScheduleViolationGQL> | null,
|
|
359
|
-
};
|
|
360
|
-
}
|
|
59
|
+
export const useScheduleWorkCalendar = composeScheduleQueryHook<
|
|
60
|
+
Schedule.ScheduleWorkCalendarVariables,
|
|
61
|
+
Schedule.ScheduleWorkCalendarGQL,
|
|
62
|
+
'scheduleWorkCalendar'
|
|
63
|
+
>(documents.scheduleWorkCalendarQry, 'scheduleWorkCalendar', [
|
|
64
|
+
'organizationId',
|
|
65
|
+
'workCalendarId',
|
|
66
|
+
]);
|
|
361
67
|
|
|
362
68
|
/*
|
|
363
|
-
* Read
|
|
69
|
+
* Read the organization's resources, optionally of some kinds only.
|
|
364
70
|
*/
|
|
365
|
-
export
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
const { data, ...rest } = useQuery(documents.schedulePublishPreflightQry, {
|
|
371
|
-
...params,
|
|
372
|
-
variables: { ...variables, ...params.variables },
|
|
373
|
-
skip:
|
|
374
|
-
!variables.organizationId ||
|
|
375
|
-
!variables.calendarId ||
|
|
376
|
-
!variables.from ||
|
|
377
|
-
!variables.to ||
|
|
378
|
-
!!params.skip,
|
|
379
|
-
});
|
|
380
|
-
return {
|
|
381
|
-
...rest,
|
|
382
|
-
schedulePublishPreflight: (data?.schedulePublishPreflight ??
|
|
383
|
-
null) as Schedule.SchedulePublishPreflightGQL | null,
|
|
384
|
-
};
|
|
385
|
-
}
|
|
71
|
+
export const useScheduleResources = composeScheduleQueryHook<
|
|
72
|
+
Schedule.ScheduleResourcesVariables,
|
|
73
|
+
Array<Schedule.ScheduleResourceGQL>,
|
|
74
|
+
'scheduleResources'
|
|
75
|
+
>(documents.scheduleResourcesQry, 'scheduleResources', ['organizationId']);
|
|
386
76
|
|
|
387
77
|
/*
|
|
388
|
-
* Read
|
|
78
|
+
* Read one resource with its capacity periods and the viewer's own channels.
|
|
389
79
|
*/
|
|
390
|
-
export
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
skip: !variables.organizationId || !variables.calendarId || !!params.skip,
|
|
399
|
-
});
|
|
400
|
-
return {
|
|
401
|
-
...rest,
|
|
402
|
-
schedulePublications: (data?.schedulePublications ??
|
|
403
|
-
null) as Array<Schedule.SchedulePublicationGQL> | null,
|
|
404
|
-
};
|
|
405
|
-
}
|
|
80
|
+
export const useScheduleResource = composeScheduleQueryHook<
|
|
81
|
+
Schedule.ScheduleResourceVariables,
|
|
82
|
+
Schedule.ScheduleResourceGQL,
|
|
83
|
+
'scheduleResource'
|
|
84
|
+
>(documents.scheduleResourceQry, 'scheduleResource', [
|
|
85
|
+
'organizationId',
|
|
86
|
+
'resourceId',
|
|
87
|
+
]);
|
|
406
88
|
|
|
407
89
|
/*
|
|
408
|
-
* Read
|
|
90
|
+
* Read the activity code types of an organization or one project.
|
|
409
91
|
*/
|
|
410
|
-
export
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
const { data, ...rest } = useQuery(documents.scheduleRequestsQry, {
|
|
416
|
-
...params,
|
|
417
|
-
variables: { ...variables, ...params.variables },
|
|
418
|
-
skip: !variables.organizationId || !!params.skip,
|
|
419
|
-
});
|
|
420
|
-
return {
|
|
421
|
-
...rest,
|
|
422
|
-
scheduleRequests: (data?.scheduleRequests ??
|
|
423
|
-
null) as Array<Schedule.ScheduleRequestGQL> | null,
|
|
424
|
-
};
|
|
425
|
-
}
|
|
92
|
+
export const useScheduleCodeTypes = composeScheduleQueryHook<
|
|
93
|
+
Schedule.ScheduleCodeTypesVariables,
|
|
94
|
+
Array<Schedule.ScheduleCodeTypeGQL>,
|
|
95
|
+
'scheduleCodeTypes'
|
|
96
|
+
>(documents.scheduleCodeTypesQry, 'scheduleCodeTypes', ['organizationId']);
|
|
426
97
|
|
|
427
98
|
/*
|
|
428
|
-
* Read
|
|
99
|
+
* Read per-day resource demand and availability for a project histogram.
|
|
429
100
|
*/
|
|
430
|
-
export
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
return {
|
|
441
|
-
...rest,
|
|
442
|
-
scheduleRequest: (data?.scheduleRequest ??
|
|
443
|
-
null) as Schedule.ScheduleRequestGQL | null,
|
|
444
|
-
};
|
|
445
|
-
}
|
|
101
|
+
export const useScheduleResourceUsage = composeScheduleQueryHook<
|
|
102
|
+
Schedule.ScheduleResourceUsageVariables,
|
|
103
|
+
Array<Schedule.ScheduleResourceUsageDayGQL>,
|
|
104
|
+
'scheduleResourceUsage'
|
|
105
|
+
>(documents.scheduleResourceUsageQry, 'scheduleResourceUsage', [
|
|
106
|
+
'organizationId',
|
|
107
|
+
'projectId',
|
|
108
|
+
'from',
|
|
109
|
+
'to',
|
|
110
|
+
]);
|
|
446
111
|
|
|
447
112
|
/*
|
|
448
|
-
* Read
|
|
113
|
+
* Read the schedule calendars (locations) the viewer can see.
|
|
449
114
|
*/
|
|
450
|
-
export
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
const { data, ...rest } = useQuery(documents.scheduleTimeOffListQry, {
|
|
456
|
-
...params,
|
|
457
|
-
variables: { ...variables, ...params.variables },
|
|
458
|
-
skip: !variables.organizationId || !!params.skip,
|
|
459
|
-
});
|
|
460
|
-
return {
|
|
461
|
-
...rest,
|
|
462
|
-
scheduleTimeOffList: (data?.scheduleTimeOffList ??
|
|
463
|
-
null) as Array<Schedule.ScheduleTimeOffGQL> | null,
|
|
464
|
-
};
|
|
465
|
-
}
|
|
115
|
+
export const useScheduleCalendars = composeScheduleQueryHook<
|
|
116
|
+
Schedule.ScheduleCalendarsVariables,
|
|
117
|
+
Array<Schedule.ScheduleCalendarGQL>,
|
|
118
|
+
'scheduleCalendars'
|
|
119
|
+
>(documents.scheduleCalendarsQry, 'scheduleCalendars', ['organizationId']);
|
|
466
120
|
|
|
467
121
|
/*
|
|
468
|
-
* Read
|
|
122
|
+
* Read one calendar's roster window for calendar-local dates fromDate..toDate:
|
|
123
|
+
* its seats with the roles, rooms and people they name.
|
|
469
124
|
*/
|
|
470
|
-
export
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
});
|
|
481
|
-
return {
|
|
482
|
-
...rest,
|
|
483
|
-
scheduleProjects: (data?.scheduleProjects ??
|
|
484
|
-
null) as Array<Schedule.ScheduleProjectGQL> | null,
|
|
485
|
-
};
|
|
486
|
-
}
|
|
125
|
+
export const useScheduleShifts = composeScheduleQueryHook<
|
|
126
|
+
Schedule.ScheduleShiftsVariables,
|
|
127
|
+
Schedule.ScheduleRosterWindowGQL,
|
|
128
|
+
'scheduleShifts'
|
|
129
|
+
>(documents.scheduleShiftsQry, 'scheduleShifts', [
|
|
130
|
+
'organizationId',
|
|
131
|
+
'calendarId',
|
|
132
|
+
'fromDate',
|
|
133
|
+
'toDate',
|
|
134
|
+
]);
|
|
487
135
|
|
|
488
136
|
/*
|
|
489
|
-
* Read
|
|
137
|
+
* Read the viewer's own seats across calendars (identity-authorized).
|
|
490
138
|
*/
|
|
491
|
-
export
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
skip: !variables.projectId || !!params.skip,
|
|
501
|
-
});
|
|
502
|
-
return {
|
|
503
|
-
...rest,
|
|
504
|
-
scheduleProject: (data?.scheduleProject ??
|
|
505
|
-
null) as Schedule.ScheduleProjectGQL | null,
|
|
506
|
-
};
|
|
507
|
-
}
|
|
139
|
+
export const useScheduleMyShifts = composeScheduleQueryHook<
|
|
140
|
+
Schedule.ScheduleMyShiftsVariables,
|
|
141
|
+
Schedule.ScheduleShiftWindowGQL,
|
|
142
|
+
'scheduleMyShifts'
|
|
143
|
+
>(documents.scheduleMyShiftsQry, 'scheduleMyShifts', [
|
|
144
|
+
'organizationId',
|
|
145
|
+
'fromDate',
|
|
146
|
+
'toDate',
|
|
147
|
+
]);
|
|
508
148
|
|
|
509
149
|
/*
|
|
510
|
-
* Read
|
|
150
|
+
* Read one calendar's stored rule findings for fromDate..toDate.
|
|
511
151
|
*/
|
|
512
|
-
export
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
const { data, ...rest } = useQuery(documents.scheduleProjectNetworkQry, {
|
|
523
|
-
...params,
|
|
524
|
-
variables: { ...variables, ...params.variables },
|
|
525
|
-
skip: !variables.projectId || !!params.skip,
|
|
526
|
-
});
|
|
527
|
-
return {
|
|
528
|
-
...rest,
|
|
529
|
-
scheduleProjectNetwork: (data?.scheduleProjectNetwork ??
|
|
530
|
-
null) as Schedule.ScheduleProjectNetworkGQL | null,
|
|
531
|
-
};
|
|
532
|
-
}
|
|
152
|
+
export const useScheduleViolations = composeScheduleQueryHook<
|
|
153
|
+
Schedule.ScheduleViolationsVariables,
|
|
154
|
+
Array<Schedule.ScheduleViolationGQL>,
|
|
155
|
+
'scheduleViolations'
|
|
156
|
+
>(documents.scheduleViolationsQry, 'scheduleViolations', [
|
|
157
|
+
'organizationId',
|
|
158
|
+
'calendarId',
|
|
159
|
+
'fromDate',
|
|
160
|
+
'toDate',
|
|
161
|
+
]);
|
|
533
162
|
|
|
534
163
|
/*
|
|
535
|
-
* Read
|
|
164
|
+
* Read time off the viewer may see.
|
|
536
165
|
*/
|
|
537
|
-
export
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
typeof p === 'string' ? { projectId: p } : p || {};
|
|
543
|
-
const { data, ...rest } = useQuery(documents.scheduleProjectRunsQry, {
|
|
544
|
-
...params,
|
|
545
|
-
variables: { ...variables, ...params.variables },
|
|
546
|
-
skip: !variables.projectId || !!params.skip,
|
|
547
|
-
});
|
|
548
|
-
return {
|
|
549
|
-
...rest,
|
|
550
|
-
scheduleProjectRuns: (data?.scheduleProjectRuns ??
|
|
551
|
-
null) as Array<Schedule.ScheduleProjectRunGQL> | null,
|
|
552
|
-
};
|
|
553
|
-
}
|
|
166
|
+
export const useScheduleTimeOffList = composeScheduleQueryHook<
|
|
167
|
+
Schedule.ScheduleTimeOffListVariables,
|
|
168
|
+
Array<Schedule.ScheduleTimeOffGQL>,
|
|
169
|
+
'scheduleTimeOffList'
|
|
170
|
+
>(documents.scheduleTimeOffListQry, 'scheduleTimeOffList', ['organizationId']);
|
|
554
171
|
|
|
555
172
|
/*
|
|
556
|
-
* Read
|
|
173
|
+
* Read the to-dos of one location (calendarId) or one project (projectId): name
|
|
174
|
+
* exactly one. Default statuses: the open ones.
|
|
557
175
|
*/
|
|
558
|
-
export
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
const { data, ...rest } = useQuery(documents.scheduleProjectRunQry, {
|
|
564
|
-
...params,
|
|
565
|
-
variables: { ...variables, ...params.variables },
|
|
566
|
-
skip: !variables.projectId || !variables.runId || !!params.skip,
|
|
567
|
-
});
|
|
568
|
-
return {
|
|
569
|
-
...rest,
|
|
570
|
-
scheduleProjectRun: (data?.scheduleProjectRun ??
|
|
571
|
-
null) as Schedule.ScheduleProjectRunGQL | null,
|
|
572
|
-
};
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
/*
|
|
576
|
-
* Read scheduleBaselines with top-level variables aligned to server reset targets.
|
|
577
|
-
*/
|
|
578
|
-
export function useScheduleBaselines(
|
|
579
|
-
p: Partial<Schedule.ScheduleBaselinesVariables> | string | null | undefined,
|
|
580
|
-
params: UseQueryParams = {},
|
|
581
|
-
) {
|
|
582
|
-
const variables: Partial<Schedule.ScheduleBaselinesVariables> =
|
|
583
|
-
typeof p === 'string' ? { projectId: p } : p || {};
|
|
584
|
-
const { data, ...rest } = useQuery(documents.scheduleBaselinesQry, {
|
|
585
|
-
...params,
|
|
586
|
-
variables: { ...variables, ...params.variables },
|
|
587
|
-
skip: !variables.projectId || !!params.skip,
|
|
588
|
-
});
|
|
589
|
-
return {
|
|
590
|
-
...rest,
|
|
591
|
-
scheduleBaselines: (data?.scheduleBaselines ??
|
|
592
|
-
null) as Array<Schedule.ScheduleBaselineGQL> | null,
|
|
593
|
-
};
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
/*
|
|
597
|
-
* Read scheduleBaselineActivities with top-level variables aligned to server reset targets.
|
|
598
|
-
*/
|
|
599
|
-
export function useScheduleBaselineActivities(
|
|
600
|
-
p: Partial<Schedule.ScheduleBaselineActivitiesVariables>,
|
|
601
|
-
params: UseQueryParams = {},
|
|
602
|
-
) {
|
|
603
|
-
const variables: Partial<Schedule.ScheduleBaselineActivitiesVariables> = p;
|
|
604
|
-
const { data, ...rest } = useQuery(documents.scheduleBaselineActivitiesQry, {
|
|
605
|
-
...params,
|
|
606
|
-
variables: { ...variables, ...params.variables },
|
|
607
|
-
skip: !variables.projectId || !variables.baselineId || !!params.skip,
|
|
608
|
-
});
|
|
609
|
-
return {
|
|
610
|
-
...rest,
|
|
611
|
-
scheduleBaselineActivities: (data?.scheduleBaselineActivities ??
|
|
612
|
-
null) as Array<Schedule.ScheduleBaselineActivityGQL> | null,
|
|
613
|
-
};
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
/*
|
|
617
|
-
* Read scheduleBaselineVariance with top-level variables aligned to server reset targets.
|
|
618
|
-
*/
|
|
619
|
-
export function useScheduleBaselineVariance(
|
|
620
|
-
p: Partial<Schedule.ScheduleBaselineVarianceVariables>,
|
|
621
|
-
params: UseQueryParams = {},
|
|
622
|
-
) {
|
|
623
|
-
const variables: Partial<Schedule.ScheduleBaselineVarianceVariables> = p;
|
|
624
|
-
const { data, ...rest } = useQuery(documents.scheduleBaselineVarianceQry, {
|
|
625
|
-
...params,
|
|
626
|
-
variables: { ...variables, ...params.variables },
|
|
627
|
-
skip: !variables.projectId || !!params.skip,
|
|
628
|
-
});
|
|
629
|
-
return {
|
|
630
|
-
...rest,
|
|
631
|
-
scheduleBaselineVariance: (data?.scheduleBaselineVariance ??
|
|
632
|
-
null) as Schedule.ScheduleBaselineVarianceGQL | null,
|
|
633
|
-
};
|
|
634
|
-
}
|
|
176
|
+
export const useScheduleTasks = composeScheduleQueryHook<
|
|
177
|
+
Schedule.ScheduleTasksVariables,
|
|
178
|
+
Array<Schedule.ScheduleTaskGQL>,
|
|
179
|
+
'scheduleTasks'
|
|
180
|
+
>(documents.scheduleTasksQry, 'scheduleTasks', ['organizationId']);
|
|
635
181
|
|
|
636
182
|
/*
|
|
637
|
-
* Read
|
|
183
|
+
* Read the viewer's own to-dos across the organization (by their own PERSON).
|
|
184
|
+
* Default statuses: the open ones.
|
|
638
185
|
*/
|
|
639
|
-
export
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
const { data, ...rest } = useQuery(documents.scheduleWorkCalendarQry, {
|
|
645
|
-
...params,
|
|
646
|
-
variables: { ...variables, ...params.variables },
|
|
647
|
-
skip:
|
|
648
|
-
!variables.organizationId || !variables.workCalendarId || !!params.skip,
|
|
649
|
-
});
|
|
650
|
-
return {
|
|
651
|
-
...rest,
|
|
652
|
-
scheduleWorkCalendar: (data?.scheduleWorkCalendar ??
|
|
653
|
-
null) as Schedule.ScheduleWorkCalendarGQL | null | null,
|
|
654
|
-
};
|
|
655
|
-
}
|
|
186
|
+
export const useScheduleMyTasks = composeScheduleQueryHook<
|
|
187
|
+
Schedule.ScheduleMyTasksVariables,
|
|
188
|
+
Array<Schedule.ScheduleTaskGQL>,
|
|
189
|
+
'scheduleMyTasks'
|
|
190
|
+
>(documents.scheduleMyTasksQry, 'scheduleMyTasks', ['organizationId']);
|
|
656
191
|
|
|
657
192
|
/*
|
|
658
|
-
* Read
|
|
193
|
+
* Read the organization's projects.
|
|
659
194
|
*/
|
|
660
|
-
export
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
const { data, ...rest } = useQuery(documents.scheduleResourceQry, {
|
|
666
|
-
...params,
|
|
667
|
-
variables: { ...variables, ...params.variables },
|
|
668
|
-
skip: !variables.organizationId || !variables.resourceId || !!params.skip,
|
|
669
|
-
});
|
|
670
|
-
return {
|
|
671
|
-
...rest,
|
|
672
|
-
scheduleResource: (data?.scheduleResource ??
|
|
673
|
-
null) as Schedule.ScheduleResourceGQL | null | null,
|
|
674
|
-
};
|
|
675
|
-
}
|
|
195
|
+
export const useScheduleProjects = composeScheduleQueryHook<
|
|
196
|
+
Schedule.ScheduleProjectsVariables,
|
|
197
|
+
Array<Schedule.ScheduleProjectGQL>,
|
|
198
|
+
'scheduleProjects'
|
|
199
|
+
>(documents.scheduleProjectsQry, 'scheduleProjects', ['organizationId']);
|
|
676
200
|
|
|
677
201
|
/*
|
|
678
|
-
* Read
|
|
202
|
+
* Read one project's network: WBS, activities, links, assignments and inputs.
|
|
679
203
|
*/
|
|
680
|
-
export
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
const { data, ...rest } = useQuery(documents.scheduleSeriesQry, {
|
|
686
|
-
...params,
|
|
687
|
-
variables: { ...variables, ...params.variables },
|
|
688
|
-
skip: !variables.organizationId || !variables.seriesId || !!params.skip,
|
|
689
|
-
});
|
|
690
|
-
return {
|
|
691
|
-
...rest,
|
|
692
|
-
scheduleSeries: (data?.scheduleSeries ??
|
|
693
|
-
null) as Schedule.ScheduleSeriesGQL | null | null,
|
|
694
|
-
};
|
|
695
|
-
}
|
|
204
|
+
export const useScheduleProjectNetwork = composeScheduleQueryHook<
|
|
205
|
+
Schedule.ScheduleProjectNetworkVariables,
|
|
206
|
+
Schedule.ScheduleProjectNetworkGQL,
|
|
207
|
+
'scheduleProjectNetwork'
|
|
208
|
+
>(documents.scheduleProjectNetworkQry, 'scheduleProjectNetwork', ['projectId']);
|
|
696
209
|
|
|
697
210
|
/*
|
|
698
|
-
* Read
|
|
211
|
+
* Read one project's schedule runs, newest first.
|
|
699
212
|
*/
|
|
700
|
-
export
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
const { data, ...rest } = useQuery(
|
|
706
|
-
documents.scheduleCalendarAccessGrantsQry,
|
|
707
|
-
{
|
|
708
|
-
...params,
|
|
709
|
-
variables: { ...variables, ...params.variables },
|
|
710
|
-
skip: !variables.organizationId || !variables.calendarId || !!params.skip,
|
|
711
|
-
},
|
|
712
|
-
);
|
|
713
|
-
return {
|
|
714
|
-
...rest,
|
|
715
|
-
scheduleCalendarAccessGrants: (data?.scheduleCalendarAccessGrants ??
|
|
716
|
-
null) as Array<Schedule.ScheduleDocAccessGrantGQL> | null,
|
|
717
|
-
};
|
|
718
|
-
}
|
|
213
|
+
export const useScheduleProjectRuns = composeScheduleQueryHook<
|
|
214
|
+
Schedule.ScheduleProjectRunsVariables,
|
|
215
|
+
Array<Schedule.ScheduleProjectRunGQL>,
|
|
216
|
+
'scheduleProjectRuns'
|
|
217
|
+
>(documents.scheduleProjectRunsQry, 'scheduleProjectRuns', ['projectId']);
|
|
719
218
|
|
|
720
219
|
/*
|
|
721
|
-
* Read
|
|
220
|
+
* Read one project's baselines.
|
|
722
221
|
*/
|
|
723
|
-
export
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
const { data, ...rest } = useQuery(documents.scheduleProjectAccessGrantsQry, {
|
|
729
|
-
...params,
|
|
730
|
-
variables: { ...variables, ...params.variables },
|
|
731
|
-
skip: !variables.organizationId || !variables.projectId || !!params.skip,
|
|
732
|
-
});
|
|
733
|
-
return {
|
|
734
|
-
...rest,
|
|
735
|
-
scheduleProjectAccessGrants: (data?.scheduleProjectAccessGrants ??
|
|
736
|
-
null) as Array<Schedule.ScheduleDocAccessGrantGQL> | null,
|
|
737
|
-
};
|
|
738
|
-
}
|
|
222
|
+
export const useScheduleBaselines = composeScheduleQueryHook<
|
|
223
|
+
Schedule.ScheduleBaselinesVariables,
|
|
224
|
+
Array<Schedule.ScheduleBaselineGQL>,
|
|
225
|
+
'scheduleBaselines'
|
|
226
|
+
>(documents.scheduleBaselinesQry, 'scheduleBaselines', ['projectId']);
|