@uidu/client 3.18.0 → 3.19.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/declarations/src/calls.d.ts +9 -1
  3. package/dist/declarations/src/candidates.d.ts +102 -0
  4. package/dist/declarations/src/contracts.d.ts +8 -0
  5. package/dist/declarations/src/field-values.d.ts +34 -0
  6. package/dist/declarations/src/generated/index.d.ts +11792 -5143
  7. package/dist/declarations/src/index.d.ts +17 -3
  8. package/dist/declarations/src/meetings.d.ts +41 -0
  9. package/dist/declarations/src/mutations.d.ts +80 -131
  10. package/dist/declarations/src/reviews.d.ts +195 -0
  11. package/dist/declarations/src/skills.d.ts +34 -0
  12. package/dist/declarations/src/work-sites.d.ts +9 -0
  13. package/dist/uidu-client.cjs.dev.js +402 -31
  14. package/dist/uidu-client.cjs.prod.js +402 -31
  15. package/dist/uidu-client.esm.js +373 -32
  16. package/package.json +1 -1
  17. package/src/calls.ts +37 -0
  18. package/src/candidates.ts +105 -0
  19. package/src/contracts.ts +44 -0
  20. package/src/field-values.ts +95 -0
  21. package/src/generated/index.ts +404 -332
  22. package/src/index.ts +53 -2
  23. package/src/meetings.ts +37 -0
  24. package/src/mutations.test.ts +40 -1
  25. package/src/mutations.ts +122 -60
  26. package/src/queries/calls/ListCallStatuses.graphql +26 -0
  27. package/src/queries/candidates/CandidateFields.graphql +28 -0
  28. package/src/queries/candidates/CandidateMutations.graphql +35 -0
  29. package/src/queries/candidates/CandidateQueries.graphql +94 -0
  30. package/src/queries/contacts/ContactMutations.graphql +0 -13
  31. package/src/queries/contracts/ContractQueries.graphql +67 -0
  32. package/src/queries/courses/CourseMutations.graphql +0 -13
  33. package/src/queries/discardable/DiscardableMutations.graphql +32 -0
  34. package/src/queries/field-values/FieldValueFields.graphql +18 -0
  35. package/src/queries/field-values/FieldValueQueries.graphql +43 -0
  36. package/src/queries/forms/FormMutations.graphql +0 -13
  37. package/src/queries/help-center/ChannelMutations.graphql +0 -13
  38. package/src/queries/kb/KbMutations.graphql +0 -26
  39. package/src/queries/meetings/MeetingQueries.graphql +48 -0
  40. package/src/queries/notes/NoteMutations.graphql +0 -13
  41. package/src/queries/people/PeopleMutations.graphql +0 -13
  42. package/src/queries/reviews/ReviewFields.graphql +35 -0
  43. package/src/queries/reviews/ReviewMutations.graphql +32 -0
  44. package/src/queries/reviews/ReviewQueries.graphql +86 -0
  45. package/src/queries/skills/SkillQueries.graphql +53 -0
  46. package/src/queries/spaces/SpaceMutations.graphql +0 -13
  47. package/src/queries/tasks/TaskMutations.graphql +0 -13
  48. package/src/queries/work-sites/ListWorkSites.graphql +32 -0
  49. package/src/recruiting.test.ts +196 -0
  50. package/src/reviews.ts +114 -0
  51. package/src/skills.ts +47 -0
  52. package/src/work-sites.ts +28 -0
package/src/index.ts CHANGED
@@ -17,6 +17,14 @@ export {
17
17
  ListCalendarsDocument,
18
18
  ListCalendarEventsDocument,
19
19
  ListCallsDocument,
20
+ ListCallStatusesDocument,
21
+ ListContractsDocument,
22
+ ListFieldValueHistoryDocument,
23
+ ListMeetingsDocument,
24
+ ListPoolsDocument,
25
+ ListReviewTemplatesDocument,
26
+ ListSkillsDocument,
27
+ ListWorkSitesDocument,
20
28
  ListCampaignsDocument,
21
29
  ListEmailCampaignsDocument,
22
30
  ListCoursesDocument,
@@ -153,8 +161,8 @@ export {
153
161
  } from './events';
154
162
  export type { Event } from './events';
155
163
 
156
- export { getCall, listCalls } from './calls';
157
- export type { Call } from './calls';
164
+ export { getCall, listCalls, listCallStatuses } from './calls';
165
+ export type { Call, CallStatus } from './calls';
158
166
 
159
167
  export { getJob, listJobs } from './jobs';
160
168
  export type { Job } from './jobs';
@@ -167,6 +175,49 @@ export {
167
175
  } from './applications';
168
176
  export type { Application } from './applications';
169
177
 
178
+ export {
179
+ findCandidates,
180
+ getCandidate,
181
+ updateCandidate,
182
+ listPools,
183
+ createPoolContact,
184
+ } from './candidates';
185
+ export type {
186
+ Candidate,
187
+ CandidateDetail,
188
+ CandidateSearch,
189
+ Pool,
190
+ } from './candidates';
191
+
192
+ export {
193
+ listReviews,
194
+ getReview,
195
+ createReview,
196
+ createReviews,
197
+ updateReview,
198
+ listReviewTemplates,
199
+ } from './reviews';
200
+ export type { Review, ReviewTemplate } from './reviews';
201
+
202
+ export { listMeetings, createMeeting } from './meetings';
203
+ export type { Meeting } from './meetings';
204
+
205
+ export { listSkills, createSkill } from './skills';
206
+ export type { WorkspaceSkill } from './skills';
207
+
208
+ export { listWorkSites } from './work-sites';
209
+ export type { WorkSite } from './work-sites';
210
+
211
+ export { listContracts, getContract } from './contracts';
212
+ export type { Contract, ContractDetail } from './contracts';
213
+
214
+ export {
215
+ getRecordFieldValues,
216
+ listFieldValueHistory,
217
+ fieldValueAsOf,
218
+ } from './field-values';
219
+ export type { RecordFieldValue, RecordFieldValues } from './field-values';
220
+
170
221
  export {
171
222
  getDonationCampaign,
172
223
  listDonationCampaigns,
@@ -0,0 +1,37 @@
1
+ import type { UiduClient } from './client';
2
+ import {
3
+ CreateMeetingDocument,
4
+ type CreateMeetingMutationVariables,
5
+ ListMeetingsDocument,
6
+ type ListMeetingsQueryVariables,
7
+ type MeetingSummaryFragment,
8
+ } from './generated';
9
+ import { nodes } from './utils/relay';
10
+
11
+ // Meetings: a scheduled or recorded conversation (an interview, a 1:1),
12
+ // optionally tied to records through `relatedAttributes`.
13
+ // Reads and writes need an account (Bearer / apiKey), server-side.
14
+
15
+ export type Meeting = MeetingSummaryFragment;
16
+
17
+ /** The workspace's meetings, filtered and sorted with `params`; page with `first`/`after`. */
18
+ export async function listMeetings(
19
+ client: UiduClient,
20
+ variables: ListMeetingsQueryVariables = {},
21
+ ): Promise<Meeting[]> {
22
+ const result = await client.query(ListMeetingsDocument, variables);
23
+ return nodes(result.currentWorkspace?.meetings);
24
+ }
25
+
26
+ /**
27
+ * Create a meeting (`name`, `startsAt`, `endsAt`, `timeZone`, and
28
+ * `relatedAttributes` to link it to an application or a contact). Returns the
29
+ * mutation payload as-is (including any `errors`).
30
+ */
31
+ export async function createMeeting(
32
+ client: UiduClient,
33
+ variables: CreateMeetingMutationVariables,
34
+ ) {
35
+ const result = await client.mutate(CreateMeetingDocument, variables);
36
+ return result.createMeeting ?? null;
37
+ }
@@ -1,6 +1,7 @@
1
1
  import { describe, expect, it, vi } from 'vitest';
2
2
  import type { UiduClient } from './client';
3
- import { terminateEmployment } from './mutations';
3
+ import { DeleteRecordDocument, DiscardRecordDocument } from './generated';
4
+ import { deleteContact, deleteKbArticle, terminateEmployment } from './mutations';
4
5
 
5
6
  describe('terminateEmployment', () => {
6
7
  it('closes an employment via updateEmployment with endDate + endReason', async () => {
@@ -41,3 +42,41 @@ describe('terminateEmployment', () => {
41
42
  });
42
43
  });
43
44
  });
45
+
46
+ describe('delete* on discardable records', () => {
47
+ it('moves the record to the trash and keeps the per-entity payload shape', async () => {
48
+ const mutate = vi.fn().mockResolvedValue({
49
+ discardableDiscard: { discardable: { __typename: 'Contact', id: 'c1' }, errors: [] },
50
+ });
51
+ const client = { mutate } as unknown as UiduClient;
52
+
53
+ const result = await deleteContact(client, { input: { id: 'c1' } });
54
+
55
+ expect(mutate).toHaveBeenCalledWith(DiscardRecordDocument, { input: { id: 'c1' } });
56
+ expect(result).toEqual({ contact: { id: 'c1' }, errors: [] });
57
+ });
58
+
59
+ it('deletes for good with permanent: true', async () => {
60
+ const mutate = vi.fn().mockResolvedValue({
61
+ discardableDelete: { discardable: { __typename: 'KbArticle', id: 'k1' }, errors: [] },
62
+ });
63
+ const client = { mutate } as unknown as UiduClient;
64
+
65
+ const result = await deleteKbArticle(client, { input: { id: 'k1' }, permanent: true });
66
+
67
+ expect(mutate).toHaveBeenCalledWith(DeleteRecordDocument, { input: { id: 'k1' } });
68
+ expect(result).toEqual({ kbArticle: { id: 'k1' }, errors: [] });
69
+ });
70
+
71
+ it('passes errors through with a null record, and null when there is no payload', async () => {
72
+ const errors = [{ key: 'base', name: "You don't have permission to do this", type: 'invalid' }];
73
+ const denied = { mutate: vi.fn().mockResolvedValue({ discardableDiscard: { discardable: null, errors } }) };
74
+ expect(await deleteContact(denied as unknown as UiduClient, { input: { id: 'c1' } })).toEqual({
75
+ contact: null,
76
+ errors,
77
+ });
78
+
79
+ const empty = { mutate: vi.fn().mockResolvedValue({}) } as unknown as UiduClient;
80
+ expect(await deleteContact(empty, { input: { id: 'c1' } })).toBeNull();
81
+ });
82
+ });
package/src/mutations.ts CHANGED
@@ -37,30 +37,15 @@ import {
37
37
  type CreateOrganizationMutationVariables,
38
38
  CreateTimeClockDocument,
39
39
  type CreateTimeClockMutationVariables,
40
- DeleteChannelDocument,
41
- type DeleteChannelMutationVariables,
42
- DeleteContactDocument,
43
- type DeleteContactMutationVariables,
44
- DeleteCourseDocument,
45
- type DeleteCourseMutationVariables,
46
40
  DeleteCompensationDocument,
47
41
  type DeleteCompensationMutationVariables,
48
42
  DeleteDonationCampaignDocument,
49
43
  type DeleteDonationCampaignMutationVariables,
50
- DeleteEmploymentDocument,
51
- type DeleteEmploymentMutationVariables,
52
- DeleteFormDocument,
53
- type DeleteFormMutationVariables,
54
- DeleteKbArticleDocument,
55
- type DeleteKbArticleMutationVariables,
56
- DeleteKbCollectionDocument,
57
- type DeleteKbCollectionMutationVariables,
58
- DeleteNoteDocument,
59
- type DeleteNoteMutationVariables,
60
- DeleteSpaceDocument,
61
- type DeleteSpaceMutationVariables,
62
- DeleteTaskDocument,
63
- type DeleteTaskMutationVariables,
44
+ DeleteRecordDocument,
45
+ type DeleteRecordMutation,
46
+ DiscardRecordDocument,
47
+ type DiscardRecordMutation,
48
+ type DiscardRecordMutationVariables,
64
49
  UpdateChannelDocument,
65
50
  type UpdateChannelMutationVariables,
66
51
  UpdateChannelKbCollectionDocument,
@@ -99,6 +84,30 @@ import {
99
84
  type UpdateTaskMutationVariables,
100
85
  } from './generated';
101
86
 
87
+ // --- Trash ---
88
+ // uidu's records are discardable: `discardableDiscard` moves one to the 30-day
89
+ // trash (restorable), `discardableDelete` destroys it for good. The delete*
90
+ // functions below trash by default and destroy with `permanent: true`, keeping
91
+ // the payload shape of the per-entity mutations they replace:
92
+ // `{ <entity>: { id } | null, errors }`.
93
+
94
+ /** `{ input: { id } }`, plus `permanent: true` to skip the trash. */
95
+ type DeleteRecordVariables = DiscardRecordMutationVariables & { permanent?: boolean };
96
+
97
+ type RemovePayload =
98
+ | DiscardRecordMutation['discardableDiscard']
99
+ | DeleteRecordMutation['discardableDelete'];
100
+
101
+ function removed<K extends string>(key: K, payload: RemovePayload) {
102
+ if (!payload) return null;
103
+ return {
104
+ [key]: payload.discardable ? { id: payload.discardable.id } : null,
105
+ errors: payload.errors,
106
+ } as { [P in K]: { id: string } | null } & {
107
+ errors: NonNullable<RemovePayload>['errors'];
108
+ };
109
+ }
110
+
102
111
  // --- Courses ---
103
112
  /**
104
113
  * Create a course from `{ input: { attributes } }`. Returns the payload (with
@@ -115,11 +124,16 @@ export async function updateCourse(c: UiduClient, v: UpdateCourseMutationVariabl
115
124
  return (await c.mutate(UpdateCourseDocument, v)).updateCourse ?? null;
116
125
  }
117
126
  /**
118
- * Delete a course by `{ input: { id } }`. Returns the payload (with `errors`)
119
- * or null.
127
+ * Move a course to the trash by `{ input: { id } }`, or delete it for good with
128
+ * `permanent: true`. Returns the payload (with `errors`) or null.
120
129
  */
121
- export async function deleteCourse(c: UiduClient, v: DeleteCourseMutationVariables) {
122
- return (await c.mutate(DeleteCourseDocument, v)).deleteCourse ?? null;
130
+ export async function deleteCourse(c: UiduClient, v: DeleteRecordVariables) {
131
+ return removed(
132
+ 'course',
133
+ v.permanent
134
+ ? (await c.mutate(DeleteRecordDocument, { input: v.input })).discardableDelete
135
+ : (await c.mutate(DiscardRecordDocument, { input: v.input })).discardableDiscard,
136
+ );
123
137
  }
124
138
 
125
139
  // --- Forms ---
@@ -138,11 +152,16 @@ export async function updateForm(c: UiduClient, v: UpdateFormMutationVariables)
138
152
  return (await c.mutate(UpdateFormDocument, v)).updateForm ?? null;
139
153
  }
140
154
  /**
141
- * Delete a form by `{ input: { id } }`. Returns the payload (with `errors`) or
142
- * null.
155
+ * Move a form to the trash by `{ input: { id } }`, or delete it for good with
156
+ * `permanent: true`. Returns the payload (with `errors`) or null.
143
157
  */
144
- export async function deleteForm(c: UiduClient, v: DeleteFormMutationVariables) {
145
- return (await c.mutate(DeleteFormDocument, v)).deleteForm ?? null;
158
+ export async function deleteForm(c: UiduClient, v: DeleteRecordVariables) {
159
+ return removed(
160
+ 'form',
161
+ v.permanent
162
+ ? (await c.mutate(DeleteRecordDocument, { input: v.input })).discardableDelete
163
+ : (await c.mutate(DiscardRecordDocument, { input: v.input })).discardableDiscard,
164
+ );
146
165
  }
147
166
 
148
167
  // --- Contacts & Deals ---
@@ -154,11 +173,16 @@ export async function createContact(c: UiduClient, v: CreateContactMutationVaria
154
173
  return (await c.mutate(CreateContactDocument, v)).createContact ?? null;
155
174
  }
156
175
  /**
157
- * Delete a contact by `{ input: { id } }`. Returns the payload (with `errors`)
158
- * or null.
176
+ * Move a contact to the trash by `{ input: { id } }`, or delete it for good
177
+ * with `permanent: true`. Returns the payload (with `errors`) or null.
159
178
  */
160
- export async function deleteContact(c: UiduClient, v: DeleteContactMutationVariables) {
161
- return (await c.mutate(DeleteContactDocument, v)).deleteContact ?? null;
179
+ export async function deleteContact(c: UiduClient, v: DeleteRecordVariables) {
180
+ return removed(
181
+ 'contact',
182
+ v.permanent
183
+ ? (await c.mutate(DeleteRecordDocument, { input: v.input })).discardableDelete
184
+ : (await c.mutate(DiscardRecordDocument, { input: v.input })).discardableDiscard,
185
+ );
162
186
  }
163
187
  /**
164
188
  * Create a deal in a pipeline (`attributes.pipelineId`, `statusId`). Returns
@@ -238,11 +262,17 @@ export async function updateEmployment(c: UiduClient, v: UpdateEmploymentMutatio
238
262
  return (await c.mutate(UpdateEmploymentDocument, v)).updateEmployment ?? null;
239
263
  }
240
264
  /**
241
- * Delete an employment by `{ input: { id } }` (to end a contract, use
242
- * `terminateEmployment` instead). Returns the payload (with `errors`) or null.
265
+ * Move an employment to the trash by `{ input: { id } }` (to end a contract,
266
+ * use `terminateEmployment` instead), or delete it for good with
267
+ * `permanent: true`. Returns the payload (with `errors`) or null.
243
268
  */
244
- export async function deleteEmployment(c: UiduClient, v: DeleteEmploymentMutationVariables) {
245
- return (await c.mutate(DeleteEmploymentDocument, v)).deleteEmployment ?? null;
269
+ export async function deleteEmployment(c: UiduClient, v: DeleteRecordVariables) {
270
+ return removed(
271
+ 'employment',
272
+ v.permanent
273
+ ? (await c.mutate(DeleteRecordDocument, { input: v.input })).discardableDelete
274
+ : (await c.mutate(DiscardRecordDocument, { input: v.input })).discardableDiscard,
275
+ );
246
276
  }
247
277
 
248
278
  /**
@@ -367,11 +397,17 @@ export async function updateKbCollection(c: UiduClient, v: UpdateKbCollectionMut
367
397
  return (await c.mutate(UpdateKbCollectionDocument, v)).updateKbCollection ?? null;
368
398
  }
369
399
  /**
370
- * Delete a knowledge-base collection by `{ input: { id } }`. Returns the
371
- * payload (with `errors`) or null.
400
+ * Move a knowledge-base collection to the trash by `{ input: { id } }`, or
401
+ * delete it for good with `permanent: true`. Returns the payload (with
402
+ * `errors`) or null.
372
403
  */
373
- export async function deleteKbCollection(c: UiduClient, v: DeleteKbCollectionMutationVariables) {
374
- return (await c.mutate(DeleteKbCollectionDocument, v)).deleteKbCollection ?? null;
404
+ export async function deleteKbCollection(c: UiduClient, v: DeleteRecordVariables) {
405
+ return removed(
406
+ 'kbCollection',
407
+ v.permanent
408
+ ? (await c.mutate(DeleteRecordDocument, { input: v.input })).discardableDelete
409
+ : (await c.mutate(DiscardRecordDocument, { input: v.input })).discardableDiscard,
410
+ );
375
411
  }
376
412
  /**
377
413
  * Create a knowledge-base article in `attributes.kbCollectionId`. Returns the
@@ -388,11 +424,17 @@ export async function updateKbArticle(c: UiduClient, v: UpdateKbArticleMutationV
388
424
  return (await c.mutate(UpdateKbArticleDocument, v)).updateKbArticle ?? null;
389
425
  }
390
426
  /**
391
- * Delete a knowledge-base article by `{ input: { id } }`. Returns the payload
392
- * (with `errors`) or null.
427
+ * Move a knowledge-base article to the trash by `{ input: { id } }`, or delete
428
+ * it for good with `permanent: true`. Returns the payload (with `errors`) or
429
+ * null.
393
430
  */
394
- export async function deleteKbArticle(c: UiduClient, v: DeleteKbArticleMutationVariables) {
395
- return (await c.mutate(DeleteKbArticleDocument, v)).deleteKbArticle ?? null;
431
+ export async function deleteKbArticle(c: UiduClient, v: DeleteRecordVariables) {
432
+ return removed(
433
+ 'kbArticle',
434
+ v.permanent
435
+ ? (await c.mutate(DeleteRecordDocument, { input: v.input })).discardableDelete
436
+ : (await c.mutate(DiscardRecordDocument, { input: v.input })).discardableDiscard,
437
+ );
396
438
  }
397
439
 
398
440
  // --- Help center channels ---
@@ -411,11 +453,16 @@ export async function updateChannel(c: UiduClient, v: UpdateChannelMutationVaria
411
453
  return (await c.mutate(UpdateChannelDocument, v)).updateChannel ?? null;
412
454
  }
413
455
  /**
414
- * Delete a help-center channel by `{ input: { id } }`. Returns the payload
415
- * (with `errors`) or null.
456
+ * Move a help-center channel to the trash by `{ input: { id } }`, or delete it
457
+ * for good with `permanent: true`. Returns the payload (with `errors`) or null.
416
458
  */
417
- export async function deleteChannel(c: UiduClient, v: DeleteChannelMutationVariables) {
418
- return (await c.mutate(DeleteChannelDocument, v)).deleteChannel ?? null;
459
+ export async function deleteChannel(c: UiduClient, v: DeleteRecordVariables) {
460
+ return removed(
461
+ 'channel',
462
+ v.permanent
463
+ ? (await c.mutate(DeleteRecordDocument, { input: v.input })).discardableDelete
464
+ : (await c.mutate(DiscardRecordDocument, { input: v.input })).discardableDiscard,
465
+ );
419
466
  }
420
467
 
421
468
  // --- Channel ↔ knowledge-base collection links ---
@@ -482,11 +529,16 @@ export async function updateTask(c: UiduClient, v: UpdateTaskMutationVariables)
482
529
  return (await c.mutate(UpdateTaskDocument, v)).updateTask ?? null;
483
530
  }
484
531
  /**
485
- * Delete a task by `{ input: { id } }`. Returns the payload (with `errors`) or
486
- * null.
532
+ * Move a task to the trash by `{ input: { id } }`, or delete it for good with
533
+ * `permanent: true`. Returns the payload (with `errors`) or null.
487
534
  */
488
- export async function deleteTask(c: UiduClient, v: DeleteTaskMutationVariables) {
489
- return (await c.mutate(DeleteTaskDocument, v)).deleteTask ?? null;
535
+ export async function deleteTask(c: UiduClient, v: DeleteRecordVariables) {
536
+ return removed(
537
+ 'task',
538
+ v.permanent
539
+ ? (await c.mutate(DeleteRecordDocument, { input: v.input })).discardableDelete
540
+ : (await c.mutate(DiscardRecordDocument, { input: v.input })).discardableDiscard,
541
+ );
490
542
  }
491
543
  /**
492
544
  * Update a note: `{ input: { id, attributes } }`. Returns the payload (with
@@ -496,11 +548,16 @@ export async function updateNote(c: UiduClient, v: UpdateNoteMutationVariables)
496
548
  return (await c.mutate(UpdateNoteDocument, v)).updateNote ?? null;
497
549
  }
498
550
  /**
499
- * Delete a note by `{ input: { id } }`. Returns the payload (with `errors`) or
500
- * null.
551
+ * Move a note to the trash by `{ input: { id } }`, or delete it for good with
552
+ * `permanent: true`. Returns the payload (with `errors`) or null.
501
553
  */
502
- export async function deleteNote(c: UiduClient, v: DeleteNoteMutationVariables) {
503
- return (await c.mutate(DeleteNoteDocument, v)).deleteNote ?? null;
554
+ export async function deleteNote(c: UiduClient, v: DeleteRecordVariables) {
555
+ return removed(
556
+ 'note',
557
+ v.permanent
558
+ ? (await c.mutate(DeleteRecordDocument, { input: v.input })).discardableDelete
559
+ : (await c.mutate(DiscardRecordDocument, { input: v.input })).discardableDiscard,
560
+ );
504
561
  }
505
562
  /**
506
563
  * Update a space: `{ input: { id, attributes } }`. Returns the payload (with
@@ -510,9 +567,14 @@ export async function updateSpace(c: UiduClient, v: UpdateSpaceMutationVariables
510
567
  return (await c.mutate(UpdateSpaceDocument, v)).updateSpace ?? null;
511
568
  }
512
569
  /**
513
- * Delete a space by `{ input: { id } }`. Returns the payload (with `errors`)
514
- * or null.
570
+ * Move a space to the trash by `{ input: { id } }`, or delete it for good with
571
+ * `permanent: true`. Returns the payload (with `errors`) or null.
515
572
  */
516
- export async function deleteSpace(c: UiduClient, v: DeleteSpaceMutationVariables) {
517
- return (await c.mutate(DeleteSpaceDocument, v)).deleteSpace ?? null;
573
+ export async function deleteSpace(c: UiduClient, v: DeleteRecordVariables) {
574
+ return removed(
575
+ 'space',
576
+ v.permanent
577
+ ? (await c.mutate(DeleteRecordDocument, { input: v.input })).discardableDelete
578
+ : (await c.mutate(DiscardRecordDocument, { input: v.input })).discardableDiscard,
579
+ );
518
580
  }
@@ -0,0 +1,26 @@
1
+ # The pipeline of a call: the statuses its applications move through
2
+ # (`Application.status`), in `position` order.
3
+ query ListCallStatuses($callId: ID!, $first: Int, $after: String) {
4
+ currentWorkspace {
5
+ call(id: $callId) {
6
+ id
7
+ statuses(first: $first, after: $after) {
8
+ pageInfo {
9
+ hasNextPage
10
+ endCursor
11
+ }
12
+ edges {
13
+ node {
14
+ id
15
+ name
16
+ color
17
+ description
18
+ kind
19
+ state
20
+ position
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,28 @@
1
+ fragment CandidateSummary on Candidate {
2
+ id
3
+ name
4
+ cvHeadline
5
+ cvSummary
6
+ source
7
+ poolConsent
8
+ poolConsentAt
9
+ retainUntil
10
+ retentionMonths
11
+ lastInteractionAt
12
+ createdAt
13
+ updatedAt
14
+ contact {
15
+ id
16
+ name
17
+ email
18
+ }
19
+ user {
20
+ id
21
+ name
22
+ email
23
+ }
24
+ pools {
25
+ id
26
+ name
27
+ }
28
+ }
@@ -0,0 +1,35 @@
1
+ mutation UpdateCandidate($input: UpdateCandidateInput!) {
2
+ updateCandidate(input: $input) {
3
+ candidate {
4
+ ...CandidateSummary
5
+ }
6
+ errors {
7
+ key
8
+ name
9
+ type
10
+ }
11
+ }
12
+ }
13
+
14
+ mutation CreatePoolContact($input: CreatePoolContactInput!) {
15
+ createPoolContact(input: $input) {
16
+ poolContact {
17
+ node {
18
+ id
19
+ pool {
20
+ id
21
+ name
22
+ }
23
+ contact {
24
+ id
25
+ name
26
+ }
27
+ }
28
+ }
29
+ errors {
30
+ key
31
+ name
32
+ type
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,94 @@
1
+ # The workspace has no plain `candidates` connection: the way to list them is
2
+ # `findCandidates`, which ranks talent-pool candidates (and, with `callId`,
3
+ # that call's applications) against a description.
4
+ query FindCandidates(
5
+ $term: String
6
+ $callId: ID
7
+ $near: String
8
+ $withinKm: Int
9
+ $eligibleFor: ContractEligibilityEnum
10
+ ) {
11
+ currentWorkspace {
12
+ findCandidates(
13
+ term: $term
14
+ callId: $callId
15
+ near: $near
16
+ withinKm: $withinKm
17
+ eligibleFor: $eligibleFor
18
+ ) {
19
+ id
20
+ term
21
+ originName
22
+ candidates {
23
+ ...CandidateSummary
24
+ }
25
+ applications {
26
+ id
27
+ aasmState
28
+ contact {
29
+ id
30
+ humanName
31
+ email
32
+ }
33
+ status {
34
+ id
35
+ name
36
+ }
37
+ }
38
+ evidence {
39
+ id
40
+ recordId
41
+ relevance
42
+ highlights
43
+ distanceKm
44
+ lastAppliedAt
45
+ }
46
+ }
47
+ }
48
+ }
49
+
50
+ query GetCandidate($id: ID!) {
51
+ node(id: $id) {
52
+ __typename
53
+ ... on Candidate {
54
+ ...CandidateSummary
55
+ applications {
56
+ id
57
+ aasmState
58
+ createdAt
59
+ status {
60
+ id
61
+ name
62
+ color
63
+ }
64
+ applicable {
65
+ __typename
66
+ ... on Call {
67
+ id
68
+ name
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
75
+
76
+ query ListPools($first: Int, $after: String, $params: SearchParams) {
77
+ currentWorkspace {
78
+ pools(first: $first, after: $after, params: $params) {
79
+ pageInfo {
80
+ hasNextPage
81
+ endCursor
82
+ }
83
+ edges {
84
+ node {
85
+ id
86
+ name
87
+ color
88
+ poolContactsCount
89
+ createdAt
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
@@ -11,19 +11,6 @@ mutation CreateContact($input: CreateContactInput!) {
11
11
  }
12
12
  }
13
13
 
14
- mutation DeleteContact($input: DeleteContactInput!) {
15
- deleteContact(input: $input) {
16
- contact {
17
- id
18
- }
19
- errors {
20
- key
21
- name
22
- type
23
- }
24
- }
25
- }
26
-
27
14
  mutation CreateDeal($input: CreateDealInput!) {
28
15
  createDeal(input: $input) {
29
16
  deal {