@uidu/client 3.13.0 → 3.14.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 (68) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/declarations/src/actions.d.ts +10 -0
  3. package/dist/declarations/src/applications.d.ts +3 -2
  4. package/dist/declarations/src/benefit-enrollments.d.ts +5 -0
  5. package/dist/declarations/src/benefits.d.ts +5 -0
  6. package/dist/declarations/src/bookings.d.ts +22 -0
  7. package/dist/declarations/src/calls.d.ts +8 -0
  8. package/dist/declarations/src/campaigns.d.ts +12 -0
  9. package/dist/declarations/src/client.d.ts +13 -1
  10. package/dist/declarations/src/cms.d.ts +32 -0
  11. package/dist/declarations/src/contacts.d.ts +16 -0
  12. package/dist/declarations/src/courses.d.ts +23 -0
  13. package/dist/declarations/src/donations.d.ts +34 -1
  14. package/dist/declarations/src/events.d.ts +19 -0
  15. package/dist/declarations/src/forms.d.ts +19 -0
  16. package/dist/declarations/src/generated/index.d.ts +2612 -234
  17. package/dist/declarations/src/goals.d.ts +4 -0
  18. package/dist/declarations/src/help-center.d.ts +4 -0
  19. package/dist/declarations/src/index.d.ts +3 -3
  20. package/dist/declarations/src/kb.d.ts +15 -0
  21. package/dist/declarations/src/models.d.ts +54 -0
  22. package/dist/declarations/src/mutations.d.ts +159 -1
  23. package/dist/declarations/src/notes.d.ts +4 -0
  24. package/dist/declarations/src/people.d.ts +8 -0
  25. package/dist/declarations/src/search.d.ts +7 -0
  26. package/dist/declarations/src/spaces.d.ts +4 -0
  27. package/dist/declarations/src/stories.d.ts +11 -0
  28. package/dist/declarations/src/system.d.ts +4 -0
  29. package/dist/declarations/src/tasks.d.ts +4 -0
  30. package/dist/declarations/src/types.d.ts +4 -0
  31. package/dist/uidu-client.cjs.dev.js +552 -11
  32. package/dist/uidu-client.cjs.prod.js +552 -11
  33. package/dist/uidu-client.esm.js +551 -12
  34. package/package.json +2 -2
  35. package/src/actions.ts +10 -6
  36. package/src/applications.ts +3 -2
  37. package/src/benefit-enrollments.ts +5 -0
  38. package/src/benefits.ts +5 -0
  39. package/src/bookings.ts +22 -0
  40. package/src/calls.ts +8 -0
  41. package/src/campaigns.ts +12 -0
  42. package/src/client.ts +13 -1
  43. package/src/cms.ts +32 -0
  44. package/src/contacts.ts +16 -0
  45. package/src/courses.ts +23 -0
  46. package/src/donations.test.ts +57 -0
  47. package/src/donations.ts +47 -0
  48. package/src/events.ts +19 -0
  49. package/src/forms.ts +19 -0
  50. package/src/generated/index.ts +2289 -282
  51. package/src/goals.ts +4 -0
  52. package/src/help-center.ts +4 -0
  53. package/src/index.ts +3 -1
  54. package/src/kb.ts +15 -0
  55. package/src/models.ts +54 -0
  56. package/src/mutations.ts +159 -1
  57. package/src/notes.ts +4 -0
  58. package/src/people.ts +8 -0
  59. package/src/queries/cms/GetPage.graphql +1 -0
  60. package/src/queries/donations/GetDonationCampaign.graphql +19 -0
  61. package/src/queries/donations/ListDonationCampaigns.graphql +5 -0
  62. package/src/queries/donations/ListDonations.graphql +29 -0
  63. package/src/search.ts +7 -0
  64. package/src/spaces.ts +4 -0
  65. package/src/stories.ts +11 -0
  66. package/src/system.ts +4 -0
  67. package/src/tasks.ts +4 -0
  68. package/src/types.ts +4 -0
package/src/goals.ts CHANGED
@@ -50,6 +50,10 @@ export async function getGoal(
50
50
  return result.currentWorkspace?.goal ?? null;
51
51
  }
52
52
 
53
+ /**
54
+ * The workspace's timeframes (the periods goals run over, `active` marks the
55
+ * current ones) as a flat array; page with `first`/`after`.
56
+ */
53
57
  export async function listTimeframes(
54
58
  client: UiduClient,
55
59
  variables: ListTimeframesQueryVariables = {},
@@ -12,6 +12,10 @@ export type Channel = NonNullable<
12
12
  NonNullable<GetChannelQuery['currentWorkspace']>['channel']
13
13
  >;
14
14
 
15
+ /**
16
+ * One help center channel with its collections and their articles in a single
17
+ * request (the last 100 of each), or null.
18
+ */
15
19
  export async function getChannel(
16
20
  client: UiduClient,
17
21
  variables: GetChannelQueryVariables,
package/src/index.ts CHANGED
@@ -21,6 +21,7 @@ export {
21
21
  ListCoursesDocument,
22
22
  ListDealsDocument,
23
23
  ListDonationCampaignsDocument,
24
+ ListDonationsDocument,
24
25
  ListEmployeesDocument,
25
26
  ListEnrollmentsDocument,
26
27
  ListEventsDocument,
@@ -149,10 +150,11 @@ export type { Application } from './applications';
149
150
  export {
150
151
  getDonationCampaign,
151
152
  listDonationCampaigns,
153
+ listDonations,
152
154
  createDonation,
153
155
  createDonationCampaign,
154
156
  } from './donations';
155
- export type { DonationCampaign } from './donations';
157
+ export type { Donation, DonationCampaign } from './donations';
156
158
 
157
159
  export { getStory, listStories, createStory } from './stories';
158
160
  export type { Story } from './stories';
package/src/kb.ts CHANGED
@@ -20,6 +20,10 @@ export type KbCollection = NonNullable<
20
20
  NonNullable<GetKbCollectionQuery['currentWorkspace']>['kbCollection']
21
21
  >;
22
22
 
23
+ /**
24
+ * One knowledge-base article with its rich-text `body` and its collection, or
25
+ * null.
26
+ */
23
27
  export async function getKbArticle(
24
28
  client: UiduClient,
25
29
  variables: GetKbArticleQueryVariables,
@@ -28,6 +32,10 @@ export async function getKbArticle(
28
32
  return result.currentWorkspace?.kbArticle ?? null;
29
33
  }
30
34
 
35
+ /**
36
+ * Knowledge-base articles across every collection, as a flat array; page with
37
+ * `first`/`after` (or `last`/`before`).
38
+ */
31
39
  export async function listKbArticles(
32
40
  client: UiduClient,
33
41
  variables: ListKbArticlesQueryVariables = {},
@@ -36,6 +44,9 @@ export async function listKbArticles(
36
44
  return nodes(result.currentWorkspace?.kbArticles);
37
45
  }
38
46
 
47
+ /**
48
+ * One knowledge-base collection with its first 50 articles, or null.
49
+ */
39
50
  export async function getKbCollection(
40
51
  client: UiduClient,
41
52
  variables: GetKbCollectionQueryVariables,
@@ -44,6 +55,10 @@ export async function getKbCollection(
44
55
  return result.currentWorkspace?.kbCollection ?? null;
45
56
  }
46
57
 
58
+ /**
59
+ * The workspace's knowledge-base collections as a flat array; page with
60
+ * `first`/`after` (or `last`/`before`).
61
+ */
47
62
  export async function listKbCollections(
48
63
  client: UiduClient,
49
64
  variables: ListKbCollectionsQueryVariables = {},
package/src/models.ts CHANGED
@@ -72,6 +72,9 @@ export async function listModels(
72
72
  return node?.__typename === 'WorkspaceApp' ? (node.modelList ?? []) : [];
73
73
  }
74
74
 
75
+ /**
76
+ * One model with its fields, or null when the id is not a Model.
77
+ */
75
78
  export async function getModel(
76
79
  client: UiduClient,
77
80
  variables: { id: string },
@@ -92,6 +95,10 @@ export async function listModelItems(
92
95
  return node?.__typename === 'Model' ? node.modelItemList : [];
93
96
  }
94
97
 
98
+ /**
99
+ * One model item with its values and its `model.id`, or null when the id is
100
+ * not a ModelItem.
101
+ */
95
102
  export async function getModelItem(
96
103
  client: UiduClient,
97
104
  variables: { id: string },
@@ -102,6 +109,12 @@ export async function getModelItem(
102
109
 
103
110
  // --- writes -----------------------------------------------------------------
104
111
 
112
+ /**
113
+ * Create a model in a WorkspaceApp (`attributes.modelableId`, `name`,
114
+ * `namePlural`). Returns the payload (with `errors`) or null.
115
+ *
116
+ * To find-or-create a model and its fields in one call, use `ensureModel`.
117
+ */
105
118
  export async function createModel(
106
119
  client: UiduClient,
107
120
  variables: CreateModelMutationVariables,
@@ -110,6 +123,10 @@ export async function createModel(
110
123
  return result.createModel ?? null;
111
124
  }
112
125
 
126
+ /**
127
+ * Rename or reconfigure a model: `{ input: { id, attributes } }`. Returns the
128
+ * payload (with `errors`) or null.
129
+ */
113
130
  export async function updateModel(
114
131
  client: UiduClient,
115
132
  variables: UpdateModelMutationVariables,
@@ -130,6 +147,10 @@ export async function createField(
130
147
  return result.createField ?? null;
131
148
  }
132
149
 
150
+ /**
151
+ * Update a field (name, `required`, preferences…): `{ input: { id, attributes
152
+ * } }`. Returns the payload (with `errors`) or null.
153
+ */
133
154
  export async function updateField(
134
155
  client: UiduClient,
135
156
  variables: UpdateFieldMutationVariables,
@@ -138,6 +159,10 @@ export async function updateField(
138
159
  return result.updateField ?? null;
139
160
  }
140
161
 
162
+ /**
163
+ * Delete a field from its model by `{ input: { id } }`. Returns the payload
164
+ * (with `errors`) or null.
165
+ */
141
166
  export async function deleteField(
142
167
  client: UiduClient,
143
168
  variables: DeleteFieldMutationVariables,
@@ -146,6 +171,10 @@ export async function deleteField(
146
171
  return result.deleteField ?? null;
147
172
  }
148
173
 
174
+ /**
175
+ * Add an option to a select-kind field (`attributes.fieldId`, `name`,
176
+ * `color`). Returns the payload (with `errors`) or null.
177
+ */
149
178
  export async function createFieldOption(
150
179
  client: UiduClient,
151
180
  variables: CreateFieldOptionMutationVariables,
@@ -154,6 +183,10 @@ export async function createFieldOption(
154
183
  return result.createFieldOption ?? null;
155
184
  }
156
185
 
186
+ /**
187
+ * Update a select option: `{ input: { id, attributes } }`. Returns the payload
188
+ * (with `errors`) or null.
189
+ */
157
190
  export async function updateFieldOption(
158
191
  client: UiduClient,
159
192
  variables: UpdateFieldOptionMutationVariables,
@@ -162,6 +195,10 @@ export async function updateFieldOption(
162
195
  return result.updateFieldOption ?? null;
163
196
  }
164
197
 
198
+ /**
199
+ * Delete a select option by `{ input: { id } }`. Returns the payload (with
200
+ * `errors`) or null.
201
+ */
165
202
  export async function deleteFieldOption(
166
203
  client: UiduClient,
167
204
  variables: DeleteFieldOptionMutationVariables,
@@ -182,6 +219,11 @@ export async function createModelItem(
182
219
  return result.createModelItem ?? null;
183
220
  }
184
221
 
222
+ /**
223
+ * Update an item: `{ input: { id, attributes: { fieldValuesAttributes } } }`,
224
+ * built with `toFieldValuesAttributes`. Returns the payload (with `errors`) or
225
+ * null.
226
+ */
185
227
  export async function updateModelItem(
186
228
  client: UiduClient,
187
229
  variables: UpdateModelItemMutationVariables,
@@ -190,6 +232,10 @@ export async function updateModelItem(
190
232
  return result.updateModelItem ?? null;
191
233
  }
192
234
 
235
+ /**
236
+ * Delete an item by `{ input: { id } }`. Returns the payload (with `errors`)
237
+ * or null.
238
+ */
193
239
  export async function deleteModelItem(
194
240
  client: UiduClient,
195
241
  variables: DeleteModelItemMutationVariables,
@@ -198,6 +244,10 @@ export async function deleteModelItem(
198
244
  return result.deleteModelItem ?? null;
199
245
  }
200
246
 
247
+ /**
248
+ * Set a single value by its FieldValue id: `{ input: { id, attributes: {
249
+ * content: { value } } } }`. Returns the payload (with `errors`) or null.
250
+ */
201
251
  export async function updateFieldValue(
202
252
  client: UiduClient,
203
253
  variables: UpdateFieldValueMutationVariables,
@@ -206,6 +256,10 @@ export async function updateFieldValue(
206
256
  return result.updateFieldValue ?? null;
207
257
  }
208
258
 
259
+ /**
260
+ * Clear a single value by its FieldValue id; `deleteLinkedRecord: true` also
261
+ * deletes the record it links to. Returns the payload (with `errors`) or null.
262
+ */
209
263
  export async function deleteFieldValue(
210
264
  client: UiduClient,
211
265
  variables: DeleteFieldValueMutationVariables,
package/src/mutations.ts CHANGED
@@ -84,37 +84,77 @@ import {
84
84
  } from './generated';
85
85
 
86
86
  // --- Courses ---
87
+ /**
88
+ * Create a course from `{ input: { attributes } }`. Returns the payload (with
89
+ * `errors`) or null.
90
+ */
87
91
  export async function createCourse(c: UiduClient, v: CreateCourseMutationVariables) {
88
92
  return (await c.mutate(CreateCourseDocument, v)).createCourse ?? null;
89
93
  }
94
+ /**
95
+ * Update a course: `{ input: { id, attributes } }`. Returns the payload (with
96
+ * `errors`) or null.
97
+ */
90
98
  export async function updateCourse(c: UiduClient, v: UpdateCourseMutationVariables) {
91
99
  return (await c.mutate(UpdateCourseDocument, v)).updateCourse ?? null;
92
100
  }
101
+ /**
102
+ * Delete a course by `{ input: { id } }`. Returns the payload (with `errors`)
103
+ * or null.
104
+ */
93
105
  export async function deleteCourse(c: UiduClient, v: DeleteCourseMutationVariables) {
94
106
  return (await c.mutate(DeleteCourseDocument, v)).deleteCourse ?? null;
95
107
  }
96
108
 
97
109
  // --- Forms ---
110
+ /**
111
+ * Create a form, questions included via `attributes.formQuestionsAttributes`.
112
+ * Returns the payload (with `errors`) or null. The new form is at `form.node`.
113
+ */
98
114
  export async function createForm(c: UiduClient, v: CreateFormMutationVariables) {
99
115
  return (await c.mutate(CreateFormDocument, v)).createForm ?? null;
100
116
  }
117
+ /**
118
+ * Update a form: `{ input: { id, attributes } }`. Returns the payload (with
119
+ * `errors`) or null.
120
+ */
101
121
  export async function updateForm(c: UiduClient, v: UpdateFormMutationVariables) {
102
122
  return (await c.mutate(UpdateFormDocument, v)).updateForm ?? null;
103
123
  }
124
+ /**
125
+ * Delete a form by `{ input: { id } }`. Returns the payload (with `errors`) or
126
+ * null.
127
+ */
104
128
  export async function deleteForm(c: UiduClient, v: DeleteFormMutationVariables) {
105
129
  return (await c.mutate(DeleteFormDocument, v)).deleteForm ?? null;
106
130
  }
107
131
 
108
132
  // --- Contacts & Deals ---
133
+ /**
134
+ * Create a CRM contact from `{ input: { attributes } }`. Returns the payload
135
+ * (with `errors`) or null.
136
+ */
109
137
  export async function createContact(c: UiduClient, v: CreateContactMutationVariables) {
110
138
  return (await c.mutate(CreateContactDocument, v)).createContact ?? null;
111
139
  }
140
+ /**
141
+ * Delete a contact by `{ input: { id } }`. Returns the payload (with `errors`)
142
+ * or null.
143
+ */
112
144
  export async function deleteContact(c: UiduClient, v: DeleteContactMutationVariables) {
113
145
  return (await c.mutate(DeleteContactDocument, v)).deleteContact ?? null;
114
146
  }
147
+ /**
148
+ * Create a deal in a pipeline (`attributes.pipelineId`, `statusId`). Returns
149
+ * the payload (with `errors`) or null. The new deal is at `deal.node`.
150
+ */
115
151
  export async function createDeal(c: UiduClient, v: CreateDealMutationVariables) {
116
152
  return (await c.mutate(CreateDealDocument, v)).createDeal ?? null;
117
153
  }
154
+ /**
155
+ * Update a deal, e.g. move it to another `statusId`: `{ input: { id,
156
+ * attributes } }`. Returns the payload (with `errors`) or null.
157
+ */
118
158
  export async function updateDeal(c: UiduClient, v: UpdateDealMutationVariables) {
119
159
  return (await c.mutate(UpdateDealDocument, v)).updateDeal ?? null;
120
160
  }
@@ -125,18 +165,39 @@ export async function updateDeal(c: UiduClient, v: UpdateDealMutationVariables)
125
165
  // offices, FTE…). A hire = createEmployment; a termination = updateEmployment
126
166
  // with an `endDate` + `endReason` (see `terminateEmployment`); a contract
127
167
  // variation = a new createEmployment (or updateEmployment on the current one).
168
+ /**
169
+ * Create the HR record for a workspace user (`attributes.userId`). Returns the
170
+ * payload (with `errors`) or null. The new employee is at `employee.node`.
171
+ */
128
172
  export async function createEmployee(c: UiduClient, v: CreateEmployeeMutationVariables) {
129
173
  return (await c.mutate(CreateEmployeeDocument, v)).createEmployee ?? null;
130
174
  }
175
+ /**
176
+ * Update an employee's HR record (code, kiosk PIN, time-clock flags): `{
177
+ * input: { id, attributes } }`. Returns the payload (with `errors`) or null.
178
+ */
131
179
  export async function updateEmployee(c: UiduClient, v: UpdateEmployeeMutationVariables) {
132
180
  return (await c.mutate(UpdateEmployeeDocument, v)).updateEmployee ?? null;
133
181
  }
182
+ /**
183
+ * Hire: open a new employment (contract) for `attributes.employeeId` with its
184
+ * start date, kind, role and hours. Returns the payload (with `errors`) or
185
+ * null. The new employment is at `employment.node`.
186
+ */
134
187
  export async function createEmployment(c: UiduClient, v: CreateEmploymentMutationVariables) {
135
188
  return (await c.mutate(CreateEmploymentDocument, v)).createEmployment ?? null;
136
189
  }
190
+ /**
191
+ * Update an employment: `{ input: { id, attributes } }`; to end one, prefer
192
+ * `terminateEmployment`. Returns the payload (with `errors`) or null.
193
+ */
137
194
  export async function updateEmployment(c: UiduClient, v: UpdateEmploymentMutationVariables) {
138
195
  return (await c.mutate(UpdateEmploymentDocument, v)).updateEmployment ?? null;
139
196
  }
197
+ /**
198
+ * Delete an employment by `{ input: { id } }` (to end a contract, use
199
+ * `terminateEmployment` instead). Returns the payload (with `errors`) or null.
200
+ */
140
201
  export async function deleteEmployment(c: UiduClient, v: DeleteEmploymentMutationVariables) {
141
202
  return (await c.mutate(DeleteEmploymentDocument, v)).deleteEmployment ?? null;
142
203
  }
@@ -144,7 +205,10 @@ export async function deleteEmployment(c: UiduClient, v: DeleteEmploymentMutatio
144
205
  /**
145
206
  * Terminate (cessazione) an employment by closing it with an end date and
146
207
  * reason. Thin semantic wrapper over {@link updateEmployment}.
147
- * `endReason` is one of: resignation, termination, contract_end, retirement, other.
208
+ * `endReason` is one of: resignation, termination, contract_end, retirement,
209
+ * other, resignation_just_cause, dismissal_just_cause,
210
+ * dismissal_subjective_reason, dismissal_objective_reason, collective_dismissal,
211
+ * mutual_agreement, probation_failed, death, business_closure.
148
212
  */
149
213
  export async function terminateEmployment(
150
214
  c: UiduClient,
@@ -159,82 +223,176 @@ export async function terminateEmployment(
159
223
  }
160
224
 
161
225
  // --- Time clocks (punches) ---
226
+ /**
227
+ * Record a time-clock punch (`beginsAt`, optional `finishesAt`, `resourceId`).
228
+ * Returns the payload (with `errors`) or null. The new punch is at
229
+ * `timeClock.node`.
230
+ */
162
231
  export async function createTimeClock(c: UiduClient, v: CreateTimeClockMutationVariables) {
163
232
  return (await c.mutate(CreateTimeClockDocument, v)).createTimeClock ?? null;
164
233
  }
165
234
 
166
235
  // --- Compensation (pay items on an employment) ---
236
+ /**
237
+ * Add a pay item to an employment (`attributes.employmentId`, `amount`,
238
+ * `currency`, `frequency`, `effectiveFrom`). Returns the payload (with
239
+ * `errors`) or null. The new item is at `compensation.node`.
240
+ */
167
241
  export async function createCompensation(c: UiduClient, v: CreateCompensationMutationVariables) {
168
242
  return (await c.mutate(CreateCompensationDocument, v)).createCompensation ?? null;
169
243
  }
244
+ /**
245
+ * Update a pay item: `{ input: { id, attributes } }`. Returns the payload
246
+ * (with `errors`) or null.
247
+ */
170
248
  export async function updateCompensation(c: UiduClient, v: UpdateCompensationMutationVariables) {
171
249
  return (await c.mutate(UpdateCompensationDocument, v)).updateCompensation ?? null;
172
250
  }
251
+ /**
252
+ * Delete a pay item by `{ input: { id } }`. Returns the payload (with
253
+ * `errors`) or null.
254
+ */
173
255
  export async function deleteCompensation(c: UiduClient, v: DeleteCompensationMutationVariables) {
174
256
  return (await c.mutate(DeleteCompensationDocument, v)).deleteCompensation ?? null;
175
257
  }
176
258
 
177
259
  // --- Knowledge base ---
260
+ /**
261
+ * Create a knowledge-base collection. Returns the payload (with `errors`) or
262
+ * null. The new collection is at `kbCollection.node`.
263
+ */
178
264
  export async function createKbCollection(c: UiduClient, v: CreateKbCollectionMutationVariables) {
179
265
  return (await c.mutate(CreateKbCollectionDocument, v)).createKbCollection ?? null;
180
266
  }
267
+ /**
268
+ * Update a knowledge-base collection: `{ input: { id, attributes } }`. Returns
269
+ * the payload (with `errors`) or null.
270
+ */
181
271
  export async function updateKbCollection(c: UiduClient, v: UpdateKbCollectionMutationVariables) {
182
272
  return (await c.mutate(UpdateKbCollectionDocument, v)).updateKbCollection ?? null;
183
273
  }
274
+ /**
275
+ * Delete a knowledge-base collection by `{ input: { id } }`. Returns the
276
+ * payload (with `errors`) or null.
277
+ */
184
278
  export async function deleteKbCollection(c: UiduClient, v: DeleteKbCollectionMutationVariables) {
185
279
  return (await c.mutate(DeleteKbCollectionDocument, v)).deleteKbCollection ?? null;
186
280
  }
281
+ /**
282
+ * Create a knowledge-base article in `attributes.kbCollectionId`. Returns the
283
+ * payload (with `errors`) or null. The new article is at `kbArticle.node`.
284
+ */
187
285
  export async function createKbArticle(c: UiduClient, v: CreateKbArticleMutationVariables) {
188
286
  return (await c.mutate(CreateKbArticleDocument, v)).createKbArticle ?? null;
189
287
  }
288
+ /**
289
+ * Update a knowledge-base article: `{ input: { id, attributes } }`. Returns
290
+ * the payload (with `errors`) or null.
291
+ */
190
292
  export async function updateKbArticle(c: UiduClient, v: UpdateKbArticleMutationVariables) {
191
293
  return (await c.mutate(UpdateKbArticleDocument, v)).updateKbArticle ?? null;
192
294
  }
295
+ /**
296
+ * Delete a knowledge-base article by `{ input: { id } }`. Returns the payload
297
+ * (with `errors`) or null.
298
+ */
193
299
  export async function deleteKbArticle(c: UiduClient, v: DeleteKbArticleMutationVariables) {
194
300
  return (await c.mutate(DeleteKbArticleDocument, v)).deleteKbArticle ?? null;
195
301
  }
196
302
 
197
303
  // --- Help center channels ---
304
+ /**
305
+ * Create a help-center channel. Returns the payload (with `errors`) or null.
306
+ * The new channel is at `channel.node`.
307
+ */
198
308
  export async function createChannel(c: UiduClient, v: CreateChannelMutationVariables) {
199
309
  return (await c.mutate(CreateChannelDocument, v)).createChannel ?? null;
200
310
  }
311
+ /**
312
+ * Update a help-center channel: `{ input: { id, attributes } }`. Returns the
313
+ * payload (with `errors`) or null.
314
+ */
201
315
  export async function updateChannel(c: UiduClient, v: UpdateChannelMutationVariables) {
202
316
  return (await c.mutate(UpdateChannelDocument, v)).updateChannel ?? null;
203
317
  }
318
+ /**
319
+ * Delete a help-center channel by `{ input: { id } }`. Returns the payload
320
+ * (with `errors`) or null.
321
+ */
204
322
  export async function deleteChannel(c: UiduClient, v: DeleteChannelMutationVariables) {
205
323
  return (await c.mutate(DeleteChannelDocument, v)).deleteChannel ?? null;
206
324
  }
207
325
 
208
326
  // --- Content updates (create lives in the scope's domain file) ---
327
+ /**
328
+ * Update an event: `{ input: { id, attributes } }` (create it with
329
+ * `createEvent`). Returns the payload (with `errors`) or null.
330
+ */
209
331
  export async function updateEvent(c: UiduClient, v: UpdateEventMutationVariables) {
210
332
  return (await c.mutate(UpdateEventDocument, v)).updateEvent ?? null;
211
333
  }
334
+ /**
335
+ * Update a story: `{ input: { id, attributes } }` (create it with
336
+ * `createStory`). Returns the payload (with `errors`) or null.
337
+ */
212
338
  export async function updateStory(c: UiduClient, v: UpdateStoryMutationVariables) {
213
339
  return (await c.mutate(UpdateStoryDocument, v)).updateStory ?? null;
214
340
  }
341
+ /**
342
+ * Update a donation campaign: `{ input: { id, attributes } }`. Returns the
343
+ * payload (with `errors`) or null.
344
+ */
215
345
  export async function updateDonationCampaign(c: UiduClient, v: UpdateDonationCampaignMutationVariables) {
216
346
  return (await c.mutate(UpdateDonationCampaignDocument, v)).updateDonationCampaign ?? null;
217
347
  }
348
+ /**
349
+ * Delete a donation campaign by `{ input: { id } }`. Returns the payload (with
350
+ * `errors`) or null.
351
+ */
218
352
  export async function deleteDonationCampaign(c: UiduClient, v: DeleteDonationCampaignMutationVariables) {
219
353
  return (await c.mutate(DeleteDonationCampaignDocument, v)).deleteDonationCampaign ?? null;
220
354
  }
221
355
 
222
356
  // --- Tasks / Notes / Spaces (create lives in their domain files) ---
357
+ /**
358
+ * Update a task, e.g. its `statusId` or dates: `{ input: { id, attributes }
359
+ * }`. Returns the payload (with `errors`) or null.
360
+ */
223
361
  export async function updateTask(c: UiduClient, v: UpdateTaskMutationVariables) {
224
362
  return (await c.mutate(UpdateTaskDocument, v)).updateTask ?? null;
225
363
  }
364
+ /**
365
+ * Delete a task by `{ input: { id } }`. Returns the payload (with `errors`) or
366
+ * null.
367
+ */
226
368
  export async function deleteTask(c: UiduClient, v: DeleteTaskMutationVariables) {
227
369
  return (await c.mutate(DeleteTaskDocument, v)).deleteTask ?? null;
228
370
  }
371
+ /**
372
+ * Update a note: `{ input: { id, attributes } }`. Returns the payload (with
373
+ * `errors`) or null.
374
+ */
229
375
  export async function updateNote(c: UiduClient, v: UpdateNoteMutationVariables) {
230
376
  return (await c.mutate(UpdateNoteDocument, v)).updateNote ?? null;
231
377
  }
378
+ /**
379
+ * Delete a note by `{ input: { id } }`. Returns the payload (with `errors`) or
380
+ * null.
381
+ */
232
382
  export async function deleteNote(c: UiduClient, v: DeleteNoteMutationVariables) {
233
383
  return (await c.mutate(DeleteNoteDocument, v)).deleteNote ?? null;
234
384
  }
385
+ /**
386
+ * Update a space: `{ input: { id, attributes } }`. Returns the payload (with
387
+ * `errors`) or null.
388
+ */
235
389
  export async function updateSpace(c: UiduClient, v: UpdateSpaceMutationVariables) {
236
390
  return (await c.mutate(UpdateSpaceDocument, v)).updateSpace ?? null;
237
391
  }
392
+ /**
393
+ * Delete a space by `{ input: { id } }`. Returns the payload (with `errors`)
394
+ * or null.
395
+ */
238
396
  export async function deleteSpace(c: UiduClient, v: DeleteSpaceMutationVariables) {
239
397
  return (await c.mutate(DeleteSpaceDocument, v)).deleteSpace ?? null;
240
398
  }
package/src/notes.ts CHANGED
@@ -6,6 +6,10 @@ import {
6
6
 
7
7
  // Authoring (Bearer / doorkeeper token). Returns the payload, incl. `errors`.
8
8
 
9
+ /**
10
+ * Create a note. Returns the payload (with `errors`) or null; the new note is
11
+ * at `note.node`.
12
+ */
9
13
  export async function createNote(
10
14
  client: UiduClient,
11
15
  variables: CreateNoteMutationVariables,
package/src/people.ts CHANGED
@@ -55,6 +55,10 @@ export type Kind = NonNullable<
55
55
  >['node']
56
56
  >;
57
57
 
58
+ /**
59
+ * The workspace's employees with their current employment, as a flat array;
60
+ * page with `first`/`after`.
61
+ */
58
62
  export async function listEmployees(
59
63
  client: UiduClient,
60
64
  variables: ListEmployeesQueryVariables = {},
@@ -63,6 +67,10 @@ export async function listEmployees(
63
67
  return nodes(result.currentWorkspace?.employees);
64
68
  }
65
69
 
70
+ /**
71
+ * One employee with current employment, today's time clocks and the shifts of
72
+ * the week starting `weekStartingAt` (see `weekStartFor`), or null.
73
+ */
66
74
  export async function getEmployee(
67
75
  client: UiduClient,
68
76
  variables: GetEmployeeQueryVariables,
@@ -37,6 +37,7 @@ query GetPage($projectId: ID!, $slug: String!) {
37
37
  kind
38
38
  }
39
39
  linkedRecord {
40
+ __typename
40
41
  ... on Form {
41
42
  id
42
43
  inputs: formQuestions {
@@ -3,6 +3,9 @@ query GetDonationCampaign($id: ID!) {
3
3
  donationCampaign(id: $id) {
4
4
  id
5
5
  name
6
+ abstract
7
+ category
8
+ donationCampaignTagList
6
9
  body
7
10
  cover
8
11
  coverData
@@ -12,6 +15,8 @@ query GetDonationCampaign($id: ID!) {
12
15
  donationsCount
13
16
  donationsAverage
14
17
  startsAt
18
+ finishesAt
19
+ daysToExpiration
15
20
  publishedAt
16
21
  publicUrl
17
22
  publicPath
@@ -20,6 +25,20 @@ query GetDonationCampaign($id: ID!) {
20
25
  formattedAddress
21
26
  city
22
27
  }
28
+ impact
29
+ owner {
30
+ __typename
31
+ ... on Workspace {
32
+ id
33
+ name
34
+ logo
35
+ }
36
+ ... on Contact {
37
+ id
38
+ name
39
+ avatar
40
+ }
41
+ }
23
42
  form {
24
43
  ...FormFields
25
44
  }
@@ -9,12 +9,17 @@ query ListDonationCampaigns($first: Int, $after: String) {
9
9
  node {
10
10
  id
11
11
  name
12
+ abstract
13
+ category
12
14
  cover
13
15
  coverData
14
16
  goal
15
17
  donationsAmount
16
18
  donationsCount
19
+ donationsAverage
17
20
  startsAt
21
+ finishesAt
22
+ daysToExpiration
18
23
  publishedAt
19
24
  publicPath
20
25
  }
@@ -0,0 +1,29 @@
1
+ query ListDonations($campaignId: ID!, $first: Int, $after: String) {
2
+ currentWorkspace {
3
+ donationCampaign(id: $campaignId) {
4
+ donations(first: $first, after: $after) {
5
+ pageInfo {
6
+ hasNextPage
7
+ endCursor
8
+ }
9
+ edges {
10
+ node {
11
+ id
12
+ amount
13
+ currency
14
+ status
15
+ createdAt
16
+ body
17
+ dedication
18
+ preferences
19
+ contact {
20
+ id
21
+ name
22
+ avatar
23
+ }
24
+ }
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
package/src/search.ts CHANGED
@@ -9,6 +9,13 @@ export type SearchResult = NonNullable<
9
9
  NonNullable<SearchQuery['currentWorkspace']>['search']
10
10
  >;
11
11
 
12
+ /**
13
+ * Search the workspace index, optionally limited to `models`, with filters and
14
+ * sorting in `params`; page with `first`/`after`.
15
+ *
16
+ * Returns the connection itself, not a flat array: `edges`, `pageInfo`,
17
+ * `totalCount`, `term`, `took`. Each node only carries `__typename` and `id`.
18
+ */
12
19
  export async function search(
13
20
  client: UiduClient,
14
21
  variables: SearchQueryVariables,
package/src/spaces.ts CHANGED
@@ -6,6 +6,10 @@ import {
6
6
 
7
7
  // Authoring (Bearer / doorkeeper token). Returns the payload, incl. `errors`.
8
8
 
9
+ /**
10
+ * Create a space, the container tasks live in. Returns the payload (with
11
+ * `errors`) or null; the new space is at `space.node`.
12
+ */
9
13
  export async function createSpace(
10
14
  client: UiduClient,
11
15
  variables: CreateSpaceMutationVariables,