@jsb188/graphql 1.1.8 → 1.1.11
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/cache/config.ts +66 -42
- package/cache/index.test.ts +881 -0
- package/cache/index.ts +1815 -979
- package/cache/persist.ts +721 -0
- package/cache/store.ts +437 -0
- package/client/data-table-realtime-subscriptions.test.ts +740 -0
- package/client/data-table-realtime-subscriptions.ts +955 -0
- package/client/data-table-realtime.test.ts +792 -0
- package/client/data-table-realtime.ts +1218 -0
- package/client/fragment-realtime-sequence.ts +52 -0
- package/client/index.ts +4 -2
- package/client/open-sheet.ts +137 -0
- package/client/request-managed-session.test.ts +574 -0
- package/client/request-no-store.test.ts +157 -0
- package/client/request.ts +973 -143
- package/client/sse-ticket.test.ts +26 -0
- package/deno.lock +170 -0
- package/deno.test.json +10 -0
- package/drafts/index.ts +149 -0
- package/drafts/store.ts +397 -0
- package/gql/eagerQueryMap.ts +12 -0
- package/gql/fragments/accountAuthFragments.ts +5 -0
- package/gql/fragments/accountFragments.ts +1 -3
- package/gql/fragments/accountSessionFragments.ts +16 -0
- package/gql/fragments/agentDocFragments.ts +46 -0
- package/gql/fragments/agentMemoryFragments.ts +19 -0
- package/gql/fragments/aiChatFragments.ts +17 -0
- package/gql/fragments/billingFragments.ts +0 -11
- package/gql/fragments/campaignFragments.ts +277 -0
- package/gql/fragments/dataTableFragments.ts +102 -0
- package/gql/fragments/emailFragments.ts +36 -0
- package/gql/fragments/fieldDocFragments.ts +82 -0
- package/gql/fragments/inboundContactFragments.ts +15 -0
- package/gql/fragments/integrationFragments.ts +22 -0
- package/gql/fragments/logFragments.ts +33 -64
- package/gql/fragments/organizationFragments.ts +94 -21
- package/gql/fragments/scheduleFragments.ts +155 -0
- package/gql/fragments/sheetFragments.ts +675 -0
- package/gql/fragments/storageFragments.ts +21 -1
- package/gql/fragments/workflowFragments.ts +67 -0
- package/gql/mutations/accountMutations.ts +24 -4
- package/gql/mutations/agentDocMutations.ts +177 -0
- package/gql/mutations/agentMemoryMutations.ts +36 -0
- package/gql/mutations/aiChatMutations.ts +43 -3
- package/gql/mutations/authMutations.ts +160 -19
- package/gql/mutations/campaignMutations.ts +215 -0
- package/gql/mutations/dataTableMutations.ts +106 -0
- package/gql/mutations/fieldDocMutations.ts +24 -0
- package/gql/mutations/inboundContactMutations.ts +24 -0
- package/gql/mutations/index.ts +17 -8
- package/gql/mutations/integrationMutations.ts +25 -0
- package/gql/mutations/logMutations.ts +10 -19
- package/gql/mutations/organizationMutations.ts +160 -2
- package/gql/mutations/scheduleMutations.ts +423 -0
- package/gql/mutations/sheetMutations.ts +385 -0
- package/gql/mutations/storageMutations.ts +21 -2
- package/gql/mutations/workflowMutations.ts +42 -0
- package/gql/queries/agentDocQueries.ts +120 -0
- package/gql/queries/agentMemoryQueries.ts +22 -0
- package/gql/queries/aiChatQueries.ts +18 -2
- package/gql/queries/authQueries.ts +41 -0
- package/gql/queries/billingQueries.ts +24 -1
- package/gql/queries/campaignQueries.ts +127 -0
- package/gql/queries/dataTableQueries.ts +134 -0
- package/gql/queries/emailQueries.ts +96 -0
- package/gql/queries/fieldDocQueries.ts +158 -0
- package/gql/queries/inboundContactQueries.ts +40 -0
- package/gql/queries/index.ts +17 -6
- package/gql/queries/logQueries.ts +42 -32
- package/gql/queries/organizationQueries.ts +113 -8
- package/gql/queries/scheduleQueries.ts +315 -0
- package/gql/queries/sheetQueries.ts +383 -0
- package/gql/queries/storageQueries.ts +38 -0
- package/gql/queries/workflowQueries.ts +99 -0
- package/hooks/index.ts +2104 -860
- package/hooks/use-account-mtn.ts +91 -48
- package/hooks/use-agentDoc-mtn.ts +285 -0
- package/hooks/use-agentDoc-qry.ts +208 -0
- package/hooks/use-agentMemory-mtn.ts +73 -0
- package/hooks/use-agentMemory-qry.ts +44 -0
- package/hooks/use-aiChat-mtn.ts +248 -97
- package/hooks/use-aiChat-qry.ts +501 -191
- package/hooks/use-app-qry.ts +14 -11
- package/hooks/use-auth-mtn.ts +410 -256
- package/hooks/use-auth-qry.ts +51 -0
- package/hooks/use-campaign-mtn.ts +377 -0
- package/hooks/use-campaign-qry.ts +257 -0
- package/hooks/use-dataTable-mtn.ts +170 -0
- package/hooks/use-dataTable-qry.ts +996 -0
- package/hooks/use-email-qry.ts +227 -0
- package/hooks/use-fieldDoc-mtn.ts +50 -0
- package/hooks/use-fieldDoc-qry.ts +180 -0
- package/hooks/use-inboundContact-mtn.ts +34 -0
- package/hooks/use-inboundContact-qry.ts +96 -0
- package/hooks/use-integration-mtn.ts +77 -0
- package/hooks/use-integration-qry.ts +30 -0
- package/hooks/use-log-mtn.ts +77 -61
- package/hooks/use-log-qry.ts +99 -72
- package/hooks/use-organization-mtn.ts +409 -80
- package/hooks/use-organization-qry.ts +211 -92
- package/hooks/use-schedule-mtn.ts +416 -0
- package/hooks/use-schedule-qry.ts +157 -0
- package/hooks/use-sheet-mtn.ts +367 -0
- package/hooks/use-sheet-qry.ts +440 -0
- package/hooks/use-storage-mtn.ts +83 -42
- package/hooks/use-storage-qry.ts +104 -13
- package/hooks/use-workflow-mtn.ts +55 -0
- package/hooks/use-workflow-qry.ts +230 -0
- package/loaders/campaign.ts +137 -0
- package/package.json +94 -52
- package/sse.ts +158 -105
- package/tsconfig.json +13 -0
- package/types.d.ts +60 -29
- package/utils.ts +77 -50
- package/gql/fragments/actionFragments.ts +0 -16
- package/gql/fragments/productFragments.ts +0 -63
- package/gql/fragments/reportFragments.ts +0 -48
- package/gql/mutations/billingMutations.ts +0 -34
- package/gql/queries/productQueries.ts +0 -70
- package/gql/queries/reportQueries.ts +0 -66
- package/hooks/use-product-qry.ts +0 -109
- package/hooks/use-report-qry.ts +0 -69
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { gql } from 'graphql-tag';
|
|
2
|
-
import {
|
|
2
|
+
import { accountFragment } from '../fragments/accountFragments.ts';
|
|
3
|
+
import { integrationConnectionFragment } from '../fragments/integrationFragments.ts';
|
|
4
|
+
import {
|
|
5
|
+
organizationChildFragment,
|
|
6
|
+
organizationComplianceFragment,
|
|
7
|
+
organizationFragment,
|
|
8
|
+
organizationRelationshipFragment,
|
|
9
|
+
organizationSiteFragment,
|
|
10
|
+
orgPageRouteFragment,
|
|
11
|
+
} from '../fragments/organizationFragments.ts';
|
|
12
|
+
import { emailFragment, phoneFragment } from '../fragments/otherFragments.ts';
|
|
13
|
+
import { storageFileFragment } from '../fragments/storageFragments.ts';
|
|
3
14
|
|
|
4
15
|
// Always use organizationRelationship() instead
|
|
5
16
|
|
|
@@ -32,6 +43,10 @@ query organizationRelationship (
|
|
|
32
43
|
|
|
33
44
|
compliance {
|
|
34
45
|
...organizationComplianceFragment
|
|
46
|
+
|
|
47
|
+
files {
|
|
48
|
+
...storageFileFragment
|
|
49
|
+
}
|
|
35
50
|
}
|
|
36
51
|
}
|
|
37
52
|
}
|
|
@@ -40,6 +55,7 @@ query organizationRelationship (
|
|
|
40
55
|
${organizationFragment}
|
|
41
56
|
${organizationComplianceFragment}
|
|
42
57
|
${organizationRelationshipFragment}
|
|
58
|
+
${storageFileFragment}
|
|
43
59
|
`;
|
|
44
60
|
|
|
45
61
|
export const myOrganizationsQry = gql`
|
|
@@ -51,8 +67,45 @@ query myOrganizations {
|
|
|
51
67
|
...organizationFragment
|
|
52
68
|
membersCount
|
|
53
69
|
|
|
70
|
+
logTaxonomy {
|
|
71
|
+
operation
|
|
72
|
+
groups {
|
|
73
|
+
key
|
|
74
|
+
label
|
|
75
|
+
ordinal
|
|
76
|
+
requiredFields
|
|
77
|
+
orRequiredFields
|
|
78
|
+
}
|
|
79
|
+
activities {
|
|
80
|
+
key
|
|
81
|
+
groupKey
|
|
82
|
+
agentText
|
|
83
|
+
ordinal
|
|
84
|
+
requiredFields
|
|
85
|
+
orRequiredFields
|
|
86
|
+
}
|
|
87
|
+
fieldDefs {
|
|
88
|
+
key
|
|
89
|
+
fieldType
|
|
90
|
+
required
|
|
91
|
+
ordinal
|
|
92
|
+
agentHint
|
|
93
|
+
options
|
|
94
|
+
allowedUnits
|
|
95
|
+
groupKey
|
|
96
|
+
activityKey
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
54
100
|
compliance {
|
|
55
101
|
...organizationComplianceFragment
|
|
102
|
+
|
|
103
|
+
files {
|
|
104
|
+
...storageFileFragment
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
integrations {
|
|
108
|
+
...integrationConnectionFragment
|
|
56
109
|
}
|
|
57
110
|
}
|
|
58
111
|
}
|
|
@@ -61,6 +114,8 @@ query myOrganizations {
|
|
|
61
114
|
${organizationFragment}
|
|
62
115
|
${organizationComplianceFragment}
|
|
63
116
|
${organizationRelationshipFragment}
|
|
117
|
+
${integrationConnectionFragment}
|
|
118
|
+
${storageFileFragment}
|
|
64
119
|
`;
|
|
65
120
|
|
|
66
121
|
export const childOrganizationsQry = gql`
|
|
@@ -86,6 +141,10 @@ query childOrganizations (
|
|
|
86
141
|
|
|
87
142
|
compliance {
|
|
88
143
|
...organizationComplianceFragment
|
|
144
|
+
|
|
145
|
+
files {
|
|
146
|
+
...storageFileFragment
|
|
147
|
+
}
|
|
89
148
|
}
|
|
90
149
|
}
|
|
91
150
|
}
|
|
@@ -94,20 +153,66 @@ query childOrganizations (
|
|
|
94
153
|
${organizationChildFragment}
|
|
95
154
|
${organizationFragment}
|
|
96
155
|
${organizationComplianceFragment}
|
|
156
|
+
${storageFileFragment}
|
|
157
|
+
`;
|
|
158
|
+
|
|
159
|
+
export const organizationMembersQry = gql`
|
|
160
|
+
query organizationMembers (
|
|
161
|
+
$organizationId: GenericID!
|
|
162
|
+
$showGuests: Boolean
|
|
163
|
+
) {
|
|
164
|
+
organizationMembers (
|
|
165
|
+
organizationId: $organizationId
|
|
166
|
+
showGuests: $showGuests
|
|
167
|
+
) {
|
|
168
|
+
...organizationRelationshipFragment
|
|
169
|
+
|
|
170
|
+
account {
|
|
171
|
+
...accountFragment
|
|
172
|
+
|
|
173
|
+
email {
|
|
174
|
+
...emailFragment
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
phone {
|
|
178
|
+
...phoneFragment
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
${organizationRelationshipFragment}
|
|
185
|
+
${accountFragment}
|
|
186
|
+
${emailFragment}
|
|
187
|
+
${phoneFragment}
|
|
188
|
+
`;
|
|
189
|
+
|
|
190
|
+
export const organizationSitesQry = gql`
|
|
191
|
+
query organizationSites (
|
|
192
|
+
$organizationId: GenericID!
|
|
193
|
+
$parentId: GenericID!
|
|
194
|
+
) {
|
|
195
|
+
organizationSites (
|
|
196
|
+
organizationId: $organizationId
|
|
197
|
+
parentId: $parentId
|
|
198
|
+
) {
|
|
199
|
+
...organizationSiteFragment
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
${organizationSiteFragment}
|
|
97
204
|
`;
|
|
98
205
|
|
|
99
|
-
export const
|
|
100
|
-
query
|
|
206
|
+
export const pageRoutesQry = gql`
|
|
207
|
+
query pageRoutes (
|
|
101
208
|
$organizationId: GenericID!
|
|
102
|
-
$operation: OrganizationOperation!
|
|
103
209
|
) {
|
|
104
|
-
|
|
210
|
+
pageRoutes (
|
|
105
211
|
organizationId: $organizationId
|
|
106
|
-
operation: $operation
|
|
107
212
|
) {
|
|
108
|
-
...
|
|
213
|
+
...orgPageRouteFragment
|
|
109
214
|
}
|
|
110
215
|
}
|
|
111
216
|
|
|
112
|
-
${
|
|
217
|
+
${orgPageRouteFragment}
|
|
113
218
|
`;
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { gql } from 'graphql-tag';
|
|
2
|
+
import {
|
|
3
|
+
scheduleCalendarFragment,
|
|
4
|
+
scheduleOccurrenceFragment,
|
|
5
|
+
scheduleRequestFragment,
|
|
6
|
+
scheduleResourceFragment,
|
|
7
|
+
scheduleSeriesFragment,
|
|
8
|
+
} from '../fragments/scheduleFragments.ts';
|
|
9
|
+
|
|
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.
|
|
15
|
+
|
|
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
|
|
26
|
+
|
|
27
|
+
viewerPermission
|
|
28
|
+
viewerCanEditAccess
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
${scheduleCalendarFragment}
|
|
33
|
+
`;
|
|
34
|
+
|
|
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
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
${scheduleCalendarFragment}
|
|
50
|
+
`;
|
|
51
|
+
|
|
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.
|
|
61
|
+
|
|
62
|
+
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
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
${scheduleOccurrenceFragment}
|
|
86
|
+
`;
|
|
87
|
+
|
|
88
|
+
export const scheduleOccurrenceQry = gql`
|
|
89
|
+
query scheduleOccurrence (
|
|
90
|
+
$occurrenceId: GenericID!
|
|
91
|
+
) {
|
|
92
|
+
scheduleOccurrence (
|
|
93
|
+
occurrenceId: $occurrenceId
|
|
94
|
+
) {
|
|
95
|
+
...scheduleOccurrenceFragment
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
${scheduleOccurrenceFragment}
|
|
100
|
+
`;
|
|
101
|
+
|
|
102
|
+
export const scheduleResourcesQry = gql`
|
|
103
|
+
query scheduleResources (
|
|
104
|
+
$organizationId: GenericID!
|
|
105
|
+
) {
|
|
106
|
+
scheduleResources (
|
|
107
|
+
organizationId: $organizationId
|
|
108
|
+
) {
|
|
109
|
+
...scheduleResourceFragment
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
${scheduleResourceFragment}
|
|
114
|
+
`;
|
|
115
|
+
|
|
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
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
${scheduleSeriesFragment}
|
|
130
|
+
`;
|
|
131
|
+
|
|
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
|
+
}
|
|
173
|
+
}
|
|
174
|
+
`;
|
|
175
|
+
|
|
176
|
+
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.
|
|
256
|
+
|
|
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
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
${scheduleRequestFragment}
|
|
279
|
+
`;
|
|
280
|
+
|
|
281
|
+
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
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
${scheduleRequestFragment}
|
|
295
|
+
`;
|
|
296
|
+
|
|
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
|
+
}
|
|
314
|
+
}
|
|
315
|
+
`;
|