@uidu/client 3.21.0 → 3.23.0
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/CHANGELOG.md +13 -0
- package/dist/declarations/src/candidates.d.ts +69 -3
- package/dist/declarations/src/comments.d.ts +47 -0
- package/dist/declarations/src/contracts.d.ts +2 -0
- package/dist/declarations/src/decisions.d.ts +58 -0
- package/dist/declarations/src/generated/index.d.ts +6727 -1966
- package/dist/declarations/src/index.d.ts +10 -4
- package/dist/declarations/src/models.d.ts +28 -1
- package/dist/declarations/src/mutations.d.ts +156 -1
- package/dist/declarations/src/votes.d.ts +114 -0
- package/dist/uidu-client.cjs.dev.js +301 -3
- package/dist/uidu-client.cjs.prod.js +301 -3
- package/dist/uidu-client.esm.js +286 -4
- package/package.json +1 -1
- package/src/candidates.ts +21 -2
- package/src/comments.ts +44 -0
- package/src/decisions.test.ts +275 -0
- package/src/decisions.ts +135 -0
- package/src/generated/index.ts +1209 -36
- package/src/index.ts +26 -0
- package/src/models.ts +50 -0
- package/src/mutations.ts +72 -0
- package/src/queries/candidates/CandidateMutations.graphql +14 -9
- package/src/queries/candidates/CandidateQueries.graphql +1 -7
- package/src/queries/candidates/PoolContactFields.graphql +29 -0
- package/src/queries/comments/Comments.graphql +65 -0
- package/src/queries/contacts/AddressMutations.graphql +41 -0
- package/src/queries/contacts/EmailAddressMutations.graphql +39 -0
- package/src/queries/contacts/PhoneNumberMutations.graphql +39 -0
- package/src/queries/decisions/DecisionFields.graphql +83 -0
- package/src/queries/decisions/DecisionMutations.graphql +59 -0
- package/src/queries/decisions/DecisionQueries.graphql +32 -0
- package/src/queries/models/ModelFields.graphql +2 -0
- package/src/queries/models/ModelQueries.graphql +33 -0
- package/src/queries/votes/Votes.graphql +60 -0
- package/src/recruiting.test.ts +41 -0
- package/src/votes.ts +38 -0
package/src/index.ts
CHANGED
|
@@ -98,6 +98,12 @@ export {
|
|
|
98
98
|
createDeal,
|
|
99
99
|
updateDeal,
|
|
100
100
|
createOrganization,
|
|
101
|
+
createAddress,
|
|
102
|
+
updateAddress,
|
|
103
|
+
createEmailAddress,
|
|
104
|
+
updateEmailAddress,
|
|
105
|
+
createPhoneNumber,
|
|
106
|
+
updatePhoneNumber,
|
|
101
107
|
createKbCollection,
|
|
102
108
|
updateKbCollection,
|
|
103
109
|
deleteKbCollection,
|
|
@@ -184,6 +190,7 @@ export {
|
|
|
184
190
|
listPools,
|
|
185
191
|
getPool,
|
|
186
192
|
createPoolContact,
|
|
193
|
+
updatePoolContact,
|
|
187
194
|
deletePoolContact,
|
|
188
195
|
} from './candidates';
|
|
189
196
|
export type {
|
|
@@ -326,6 +333,23 @@ export {
|
|
|
326
333
|
} from './goals';
|
|
327
334
|
export type { Goal, Timeframe } from './goals';
|
|
328
335
|
|
|
336
|
+
export {
|
|
337
|
+
listDecisions,
|
|
338
|
+
getDecision,
|
|
339
|
+
createDecision,
|
|
340
|
+
answerDecision,
|
|
341
|
+
} from './decisions';
|
|
342
|
+
export type {
|
|
343
|
+
Decision,
|
|
344
|
+
DecisionResponse,
|
|
345
|
+
DecisionResponseType,
|
|
346
|
+
DecisionWithResponses,
|
|
347
|
+
} from './decisions';
|
|
348
|
+
export { listComments, createComment } from './comments';
|
|
349
|
+
export type { Comment } from './comments';
|
|
350
|
+
export { vote, unvote } from './votes';
|
|
351
|
+
export type { Vote } from './votes';
|
|
352
|
+
|
|
329
353
|
export {
|
|
330
354
|
listExpenseReports,
|
|
331
355
|
getExpenseReport,
|
|
@@ -351,6 +375,7 @@ export {
|
|
|
351
375
|
getModel,
|
|
352
376
|
listModelItems,
|
|
353
377
|
getModelItem,
|
|
378
|
+
getModelItemLog,
|
|
354
379
|
createModel,
|
|
355
380
|
updateModel,
|
|
356
381
|
createField,
|
|
@@ -372,5 +397,6 @@ export type {
|
|
|
372
397
|
ModelField,
|
|
373
398
|
ModelFieldOption,
|
|
374
399
|
ModelItem,
|
|
400
|
+
ModelItemLogEvent,
|
|
375
401
|
EnsureModelOptions,
|
|
376
402
|
} from './models';
|
package/src/models.ts
CHANGED
|
@@ -20,6 +20,8 @@ import {
|
|
|
20
20
|
type FieldValueAttributes,
|
|
21
21
|
GetModelDocument,
|
|
22
22
|
GetModelItemDocument,
|
|
23
|
+
GetModelItemLogDocument,
|
|
24
|
+
type GetModelItemLogQuery,
|
|
23
25
|
ListAppModelsDocument,
|
|
24
26
|
ListModelItemsDocument,
|
|
25
27
|
type ModelFieldFragment,
|
|
@@ -39,6 +41,7 @@ import {
|
|
|
39
41
|
type UpdateModelMutationVariables,
|
|
40
42
|
} from './generated';
|
|
41
43
|
import { UiduError } from './types';
|
|
44
|
+
import { nodes } from './utils/relay';
|
|
42
45
|
|
|
43
46
|
/**
|
|
44
47
|
* The data engine a custom app keeps its records in: the Models of its own
|
|
@@ -107,6 +110,53 @@ export async function getModelItem(
|
|
|
107
110
|
return node?.__typename === 'ModelItem' ? node : null;
|
|
108
111
|
}
|
|
109
112
|
|
|
113
|
+
/** One event of a ModelItem's history, as `getModelItemLog` returns it. */
|
|
114
|
+
export type ModelItemLogEvent = NonNullable<
|
|
115
|
+
NonNullable<
|
|
116
|
+
NonNullable<
|
|
117
|
+
Extract<
|
|
118
|
+
NonNullable<GetModelItemLogQuery['node']>,
|
|
119
|
+
{ __typename: 'ModelItem' }
|
|
120
|
+
>['logs']['edges']
|
|
121
|
+
>[number]
|
|
122
|
+
>['node']
|
|
123
|
+
> & {
|
|
124
|
+
/**
|
|
125
|
+
* `data.changes`: each changed Field's GlobalID → `[from, to]`, the raw
|
|
126
|
+
* `content.value` (a select's is the option's GlobalID). The record's own
|
|
127
|
+
* columns that changed are in it too, under their names.
|
|
128
|
+
*/
|
|
129
|
+
changes: Record<string, [unknown, unknown]>;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* A ModelItem's history: the events of its own stream, by default only
|
|
134
|
+
* `Database::ModelItem::Updated`, each with who (`currentUser`), when
|
|
135
|
+
* (`timestamp`) and what changed (`changes`). Needs Database::ModelItem::ReadLog
|
|
136
|
+
* in a custom app. Empty when the id is not a ModelItem or can't be seen.
|
|
137
|
+
*/
|
|
138
|
+
export async function getModelItemLog(
|
|
139
|
+
client: UiduClient,
|
|
140
|
+
variables: { id: string; types?: string[]; first?: number; after?: string },
|
|
141
|
+
): Promise<ModelItemLogEvent[]> {
|
|
142
|
+
const { types = ['Database::ModelItem::Updated'], ...rest } = variables;
|
|
143
|
+
const { node } = await client.query(GetModelItemLogDocument, {
|
|
144
|
+
...rest,
|
|
145
|
+
types,
|
|
146
|
+
});
|
|
147
|
+
if (node?.__typename !== 'ModelItem') return [];
|
|
148
|
+
return nodes(node.logs).map((event) => {
|
|
149
|
+
const changes = (event.data as { changes?: unknown } | null)?.changes;
|
|
150
|
+
return {
|
|
151
|
+
...event,
|
|
152
|
+
changes:
|
|
153
|
+
changes && typeof changes === 'object'
|
|
154
|
+
? (changes as Record<string, [unknown, unknown]>)
|
|
155
|
+
: {},
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
110
160
|
// --- writes -----------------------------------------------------------------
|
|
111
161
|
|
|
112
162
|
/**
|
package/src/mutations.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
// place; read functions stay in their per-scope domain files.
|
|
6
6
|
import type { UiduClient } from './client';
|
|
7
7
|
import {
|
|
8
|
+
CreateAddressDocument,
|
|
9
|
+
type CreateAddressMutationVariables,
|
|
8
10
|
CreateChannelDocument,
|
|
9
11
|
type CreateChannelMutationVariables,
|
|
10
12
|
CreateChannelKbCollectionDocument,
|
|
@@ -17,6 +19,8 @@ import {
|
|
|
17
19
|
type CreateCompensationMutationVariables,
|
|
18
20
|
CreateDealDocument,
|
|
19
21
|
type CreateDealMutationVariables,
|
|
22
|
+
CreateEmailAddressDocument,
|
|
23
|
+
type CreateEmailAddressMutationVariables,
|
|
20
24
|
CreateEmployeeDocument,
|
|
21
25
|
type CreateEmployeeMutationVariables,
|
|
22
26
|
CreateEmployeeCertificationDocument,
|
|
@@ -35,6 +39,8 @@ import {
|
|
|
35
39
|
type CreateKbCollectionMutationVariables,
|
|
36
40
|
CreateOrganizationDocument,
|
|
37
41
|
type CreateOrganizationMutationVariables,
|
|
42
|
+
CreatePhoneNumberDocument,
|
|
43
|
+
type CreatePhoneNumberMutationVariables,
|
|
38
44
|
CreateTimeClockDocument,
|
|
39
45
|
type CreateTimeClockMutationVariables,
|
|
40
46
|
DeleteCompensationDocument,
|
|
@@ -46,6 +52,8 @@ import {
|
|
|
46
52
|
DiscardRecordDocument,
|
|
47
53
|
type DiscardRecordMutation,
|
|
48
54
|
type DiscardRecordMutationVariables,
|
|
55
|
+
UpdateAddressDocument,
|
|
56
|
+
type UpdateAddressMutationVariables,
|
|
49
57
|
UpdateChannelDocument,
|
|
50
58
|
type UpdateChannelMutationVariables,
|
|
51
59
|
UpdateChannelKbCollectionDocument,
|
|
@@ -58,6 +66,8 @@ import {
|
|
|
58
66
|
type UpdateDealMutationVariables,
|
|
59
67
|
UpdateDonationCampaignDocument,
|
|
60
68
|
type UpdateDonationCampaignMutationVariables,
|
|
69
|
+
UpdateEmailAddressDocument,
|
|
70
|
+
type UpdateEmailAddressMutationVariables,
|
|
61
71
|
UpdateEmployeeDocument,
|
|
62
72
|
type UpdateEmployeeMutationVariables,
|
|
63
73
|
UpdateEmploymentDocument,
|
|
@@ -76,6 +86,8 @@ import {
|
|
|
76
86
|
type UpdateKbCollectionMutationVariables,
|
|
77
87
|
UpdateNoteDocument,
|
|
78
88
|
type UpdateNoteMutationVariables,
|
|
89
|
+
UpdatePhoneNumberDocument,
|
|
90
|
+
type UpdatePhoneNumberMutationVariables,
|
|
79
91
|
UpdateSpaceDocument,
|
|
80
92
|
type UpdateSpaceMutationVariables,
|
|
81
93
|
UpdateStoryDocument,
|
|
@@ -211,6 +223,66 @@ export async function createOrganization(
|
|
|
211
223
|
) {
|
|
212
224
|
return (await c.mutate(CreateOrganizationDocument, v)).createOrganization ?? null;
|
|
213
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* Create an address on an addressable record (a Contact or Organization):
|
|
228
|
+
* `{ input: { attributes: { addressableId, address, kind, primary, … } } }`.
|
|
229
|
+
* Returns the payload (with `errors`) or null. The new address is at
|
|
230
|
+
* `address.node`.
|
|
231
|
+
*/
|
|
232
|
+
export async function createAddress(c: UiduClient, v: CreateAddressMutationVariables) {
|
|
233
|
+
return (await c.mutate(CreateAddressDocument, v)).createAddress ?? null;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Update an address: `{ input: { id, attributes } }`. Returns the payload
|
|
237
|
+
* (with `errors`) or null.
|
|
238
|
+
*/
|
|
239
|
+
export async function updateAddress(c: UiduClient, v: UpdateAddressMutationVariables) {
|
|
240
|
+
return (await c.mutate(UpdateAddressDocument, v)).updateAddress ?? null;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Create an email address on an emailable record (a Contact or Organization):
|
|
244
|
+
* `{ input: { attributes: { emailableId, email, kind, primary, … } } }`.
|
|
245
|
+
* Returns the payload (with `errors`) or null. The new email address is at
|
|
246
|
+
* `emailAddress.node`.
|
|
247
|
+
*/
|
|
248
|
+
export async function createEmailAddress(
|
|
249
|
+
c: UiduClient,
|
|
250
|
+
v: CreateEmailAddressMutationVariables,
|
|
251
|
+
) {
|
|
252
|
+
return (await c.mutate(CreateEmailAddressDocument, v)).createEmailAddress ?? null;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Update an email address: `{ input: { id, attributes } }`. Returns the
|
|
256
|
+
* payload (with `errors`) or null.
|
|
257
|
+
*/
|
|
258
|
+
export async function updateEmailAddress(
|
|
259
|
+
c: UiduClient,
|
|
260
|
+
v: UpdateEmailAddressMutationVariables,
|
|
261
|
+
) {
|
|
262
|
+
return (await c.mutate(UpdateEmailAddressDocument, v)).updateEmailAddress ?? null;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Create a phone number on a phoneable record (a Contact or Organization):
|
|
266
|
+
* `{ input: { attributes: { phoneableId, phone, kind, primary, … } } }`.
|
|
267
|
+
* Returns the payload (with `errors`) or null. The new phone number is at
|
|
268
|
+
* `phoneNumber.node`.
|
|
269
|
+
*/
|
|
270
|
+
export async function createPhoneNumber(
|
|
271
|
+
c: UiduClient,
|
|
272
|
+
v: CreatePhoneNumberMutationVariables,
|
|
273
|
+
) {
|
|
274
|
+
return (await c.mutate(CreatePhoneNumberDocument, v)).createPhoneNumber ?? null;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Update a phone number: `{ input: { id, attributes } }`. Returns the payload
|
|
278
|
+
* (with `errors`) or null.
|
|
279
|
+
*/
|
|
280
|
+
export async function updatePhoneNumber(
|
|
281
|
+
c: UiduClient,
|
|
282
|
+
v: UpdatePhoneNumberMutationVariables,
|
|
283
|
+
) {
|
|
284
|
+
return (await c.mutate(UpdatePhoneNumberDocument, v)).updatePhoneNumber ?? null;
|
|
285
|
+
}
|
|
214
286
|
|
|
215
287
|
// --- People / HR (employees & employments) ---
|
|
216
288
|
// An Employee is the HR record wrapping a workspace User (`userId`); an
|
|
@@ -32,15 +32,7 @@ mutation CreatePoolContact($input: CreatePoolContactInput!) {
|
|
|
32
32
|
createPoolContact(input: $input) {
|
|
33
33
|
poolContact {
|
|
34
34
|
node {
|
|
35
|
-
|
|
36
|
-
pool {
|
|
37
|
-
id
|
|
38
|
-
name
|
|
39
|
-
}
|
|
40
|
-
contact {
|
|
41
|
-
id
|
|
42
|
-
name
|
|
43
|
-
}
|
|
35
|
+
...PoolContactSummary
|
|
44
36
|
}
|
|
45
37
|
}
|
|
46
38
|
errors {
|
|
@@ -51,6 +43,19 @@ mutation CreatePoolContact($input: CreatePoolContactInput!) {
|
|
|
51
43
|
}
|
|
52
44
|
}
|
|
53
45
|
|
|
46
|
+
mutation UpdatePoolContact($input: UpdatePoolContactInput!) {
|
|
47
|
+
updatePoolContact(input: $input) {
|
|
48
|
+
poolContact {
|
|
49
|
+
...PoolContactSummary
|
|
50
|
+
}
|
|
51
|
+
errors {
|
|
52
|
+
key
|
|
53
|
+
name
|
|
54
|
+
type
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
54
59
|
mutation DeletePoolContact($input: DeletePoolContactInput!) {
|
|
55
60
|
deletePoolContact(input: $input) {
|
|
56
61
|
errors {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# One entry in a talent pool, which is one referral: who sent the person
|
|
2
|
+
# (`source`, a referring Organization or the User who pointed them out), the
|
|
3
|
+
# channel and the day.
|
|
4
|
+
fragment PoolContactSummary on PoolContact {
|
|
5
|
+
id
|
|
6
|
+
createdAt
|
|
7
|
+
sourceChannel
|
|
8
|
+
referredOn
|
|
9
|
+
source {
|
|
10
|
+
__typename
|
|
11
|
+
... on Organization {
|
|
12
|
+
id
|
|
13
|
+
name
|
|
14
|
+
}
|
|
15
|
+
... on User {
|
|
16
|
+
id
|
|
17
|
+
name
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
pool {
|
|
21
|
+
id
|
|
22
|
+
name
|
|
23
|
+
}
|
|
24
|
+
contact {
|
|
25
|
+
id
|
|
26
|
+
name
|
|
27
|
+
email
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Comments on any commentable record — for a custom app, one of its ModelItems
|
|
2
|
+
# or Decisions — read through `node(id:)`. Only the fields Comments::Comment::Read
|
|
3
|
+
# lets a session see: no attachments, votes or admin paths.
|
|
4
|
+
|
|
5
|
+
fragment CommentFields on Comment {
|
|
6
|
+
id
|
|
7
|
+
bodyData
|
|
8
|
+
parent {
|
|
9
|
+
id
|
|
10
|
+
}
|
|
11
|
+
createdAt
|
|
12
|
+
updatedAt
|
|
13
|
+
contact {
|
|
14
|
+
id
|
|
15
|
+
name
|
|
16
|
+
avatar
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
query ListComments($commentableId: ID!, $first: Int, $after: String) {
|
|
21
|
+
node(id: $commentableId) {
|
|
22
|
+
__typename
|
|
23
|
+
... on ModelItem {
|
|
24
|
+
id
|
|
25
|
+
comments(first: $first, after: $after) {
|
|
26
|
+
pageInfo {
|
|
27
|
+
hasNextPage
|
|
28
|
+
endCursor
|
|
29
|
+
}
|
|
30
|
+
edges {
|
|
31
|
+
node {
|
|
32
|
+
...CommentFields
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
... on Decision {
|
|
38
|
+
id
|
|
39
|
+
comments(first: $first, after: $after) {
|
|
40
|
+
pageInfo {
|
|
41
|
+
hasNextPage
|
|
42
|
+
endCursor
|
|
43
|
+
}
|
|
44
|
+
edges {
|
|
45
|
+
node {
|
|
46
|
+
...CommentFields
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
mutation CreateComment($input: CreateCommentInput!) {
|
|
55
|
+
createComment(input: $input) {
|
|
56
|
+
comment {
|
|
57
|
+
...CommentFields
|
|
58
|
+
}
|
|
59
|
+
errors {
|
|
60
|
+
key
|
|
61
|
+
name
|
|
62
|
+
type
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
mutation CreateAddress($input: CreateAddressInput!) {
|
|
2
|
+
createAddress(input: $input) {
|
|
3
|
+
address {
|
|
4
|
+
node {
|
|
5
|
+
id
|
|
6
|
+
address
|
|
7
|
+
formattedAddress
|
|
8
|
+
kind
|
|
9
|
+
name
|
|
10
|
+
primary
|
|
11
|
+
placeId
|
|
12
|
+
url
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
errors {
|
|
16
|
+
key
|
|
17
|
+
name
|
|
18
|
+
type
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
mutation UpdateAddress($input: UpdateAddressInput!) {
|
|
24
|
+
updateAddress(input: $input) {
|
|
25
|
+
address {
|
|
26
|
+
id
|
|
27
|
+
address
|
|
28
|
+
formattedAddress
|
|
29
|
+
kind
|
|
30
|
+
name
|
|
31
|
+
primary
|
|
32
|
+
placeId
|
|
33
|
+
url
|
|
34
|
+
}
|
|
35
|
+
errors {
|
|
36
|
+
key
|
|
37
|
+
name
|
|
38
|
+
type
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
mutation CreateEmailAddress($input: CreateEmailAddressInput!) {
|
|
2
|
+
createEmailAddress(input: $input) {
|
|
3
|
+
emailAddress {
|
|
4
|
+
node {
|
|
5
|
+
id
|
|
6
|
+
email
|
|
7
|
+
kind
|
|
8
|
+
name
|
|
9
|
+
primary
|
|
10
|
+
verified
|
|
11
|
+
verifiedAt
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
errors {
|
|
15
|
+
key
|
|
16
|
+
name
|
|
17
|
+
type
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
mutation UpdateEmailAddress($input: UpdateEmailAddressInput!) {
|
|
23
|
+
updateEmailAddress(input: $input) {
|
|
24
|
+
emailAddress {
|
|
25
|
+
id
|
|
26
|
+
email
|
|
27
|
+
kind
|
|
28
|
+
name
|
|
29
|
+
primary
|
|
30
|
+
verified
|
|
31
|
+
verifiedAt
|
|
32
|
+
}
|
|
33
|
+
errors {
|
|
34
|
+
key
|
|
35
|
+
name
|
|
36
|
+
type
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
mutation CreatePhoneNumber($input: CreatePhoneNumberInput!) {
|
|
2
|
+
createPhoneNumber(input: $input) {
|
|
3
|
+
phoneNumber {
|
|
4
|
+
node {
|
|
5
|
+
id
|
|
6
|
+
phone
|
|
7
|
+
kind
|
|
8
|
+
name
|
|
9
|
+
primary
|
|
10
|
+
verified
|
|
11
|
+
verifiedAt
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
errors {
|
|
15
|
+
key
|
|
16
|
+
name
|
|
17
|
+
type
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
mutation UpdatePhoneNumber($input: UpdatePhoneNumberInput!) {
|
|
23
|
+
updatePhoneNumber(input: $input) {
|
|
24
|
+
phoneNumber {
|
|
25
|
+
id
|
|
26
|
+
phone
|
|
27
|
+
kind
|
|
28
|
+
name
|
|
29
|
+
primary
|
|
30
|
+
verified
|
|
31
|
+
verifiedAt
|
|
32
|
+
}
|
|
33
|
+
errors {
|
|
34
|
+
key
|
|
35
|
+
name
|
|
36
|
+
type
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# A decision as a custom app session token may read it (Decisions::Decision::Read
|
|
2
|
+
# in uidu's CustomApps::Permissions): what is proposed, its options, the answers
|
|
3
|
+
# and where it stands. Asking for a field outside that list — members,
|
|
4
|
+
# attachments, relationships, logs — fails the whole query for a session.
|
|
5
|
+
# A responder or owner is a User or a Contact; for anything else (an agent, a
|
|
6
|
+
# workflow run) only `__typename` comes back.
|
|
7
|
+
|
|
8
|
+
fragment DecisionPerson on DecisionResponder {
|
|
9
|
+
__typename
|
|
10
|
+
... on User {
|
|
11
|
+
id
|
|
12
|
+
name
|
|
13
|
+
avatar
|
|
14
|
+
}
|
|
15
|
+
... on Contact {
|
|
16
|
+
id
|
|
17
|
+
name
|
|
18
|
+
avatar
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
fragment DecisionResponseFields on DecisionResponse {
|
|
23
|
+
id
|
|
24
|
+
responseType
|
|
25
|
+
value
|
|
26
|
+
reason
|
|
27
|
+
createdAt
|
|
28
|
+
updatedAt
|
|
29
|
+
decisionOption {
|
|
30
|
+
id
|
|
31
|
+
}
|
|
32
|
+
responder {
|
|
33
|
+
...DecisionPerson
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
fragment DecisionFields on Decision {
|
|
38
|
+
id
|
|
39
|
+
name
|
|
40
|
+
descriptionData
|
|
41
|
+
kind
|
|
42
|
+
config
|
|
43
|
+
aasmState
|
|
44
|
+
isAnonymous
|
|
45
|
+
multiSelect
|
|
46
|
+
answerable
|
|
47
|
+
closesAt
|
|
48
|
+
closedAt
|
|
49
|
+
outcomeData
|
|
50
|
+
participantCount
|
|
51
|
+
responseCount
|
|
52
|
+
consensusLevel
|
|
53
|
+
results
|
|
54
|
+
createdAt
|
|
55
|
+
updatedAt
|
|
56
|
+
owner {
|
|
57
|
+
__typename
|
|
58
|
+
... on User {
|
|
59
|
+
id
|
|
60
|
+
name
|
|
61
|
+
avatar
|
|
62
|
+
}
|
|
63
|
+
... on Contact {
|
|
64
|
+
id
|
|
65
|
+
name
|
|
66
|
+
avatar
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
myResponse {
|
|
70
|
+
...DecisionResponseFields
|
|
71
|
+
}
|
|
72
|
+
decisionOptions {
|
|
73
|
+
edges {
|
|
74
|
+
node {
|
|
75
|
+
id
|
|
76
|
+
name
|
|
77
|
+
descriptionData
|
|
78
|
+
position
|
|
79
|
+
responseCount
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# A custom app may set only workspaceAppId, kind, name and descriptionData on
|
|
2
|
+
# create, and only responseType and reason on an answer (Decisions::Decision::*
|
|
3
|
+
# in uidu's CustomApps::Permissions).
|
|
4
|
+
|
|
5
|
+
mutation CreateDecision($input: CreateDecisionInput!) {
|
|
6
|
+
createDecision(input: $input) {
|
|
7
|
+
decision {
|
|
8
|
+
node {
|
|
9
|
+
...DecisionFields
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
errors {
|
|
13
|
+
key
|
|
14
|
+
name
|
|
15
|
+
type
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
mutation OpenDecision($input: OpenDecisionInput!) {
|
|
21
|
+
openDecision(input: $input) {
|
|
22
|
+
decision {
|
|
23
|
+
...DecisionFields
|
|
24
|
+
}
|
|
25
|
+
errors {
|
|
26
|
+
key
|
|
27
|
+
name
|
|
28
|
+
type
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
mutation CreateDecisionResponse($input: CreateDecisionResponseInput!) {
|
|
34
|
+
createDecisionResponse(input: $input) {
|
|
35
|
+
decisionResponse {
|
|
36
|
+
node {
|
|
37
|
+
...DecisionResponseFields
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
errors {
|
|
41
|
+
key
|
|
42
|
+
name
|
|
43
|
+
type
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
mutation UpdateDecisionResponse($input: UpdateDecisionResponseInput!) {
|
|
49
|
+
updateDecisionResponse(input: $input) {
|
|
50
|
+
decisionResponse {
|
|
51
|
+
...DecisionResponseFields
|
|
52
|
+
}
|
|
53
|
+
errors {
|
|
54
|
+
key
|
|
55
|
+
name
|
|
56
|
+
type
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Under a custom app session uidu narrows `decisions` to the app's own
|
|
2
|
+
# (`workspace_app_id`); with a Bearer it is every decision of the workspace.
|
|
3
|
+
query ListDecisions($params: SearchParams, $first: Int, $after: String) {
|
|
4
|
+
currentWorkspace {
|
|
5
|
+
decisions(params: $params, first: $first, after: $after) {
|
|
6
|
+
pageInfo {
|
|
7
|
+
hasNextPage
|
|
8
|
+
endCursor
|
|
9
|
+
}
|
|
10
|
+
edges {
|
|
11
|
+
node {
|
|
12
|
+
...DecisionFields
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
query GetDecision($id: ID!) {
|
|
20
|
+
currentWorkspace {
|
|
21
|
+
decision(id: $id) {
|
|
22
|
+
...DecisionFields
|
|
23
|
+
decisionResponses {
|
|
24
|
+
edges {
|
|
25
|
+
node {
|
|
26
|
+
...DecisionResponseFields
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|