@uidu/client 3.13.1 → 3.16.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/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,
@@ -93,6 +94,8 @@ export {
93
94
  createChannel,
94
95
  updateChannel,
95
96
  deleteChannel,
97
+ createChannelKbCollection,
98
+ updateChannelKbCollection,
96
99
  updateEvent,
97
100
  updateStory,
98
101
  updateDonationCampaign,
@@ -105,10 +108,13 @@ export {
105
108
  deleteSpace,
106
109
  createEmployee,
107
110
  updateEmployee,
111
+ createEmployeeCertification,
108
112
  createEmployment,
109
113
  updateEmployment,
110
114
  deleteEmployment,
111
115
  terminateEmployment,
116
+ createEmploymentTerm,
117
+ updateEmploymentTerm,
112
118
  createCompensation,
113
119
  updateCompensation,
114
120
  deleteCompensation,
@@ -149,10 +155,11 @@ export type { Application } from './applications';
149
155
  export {
150
156
  getDonationCampaign,
151
157
  listDonationCampaigns,
158
+ listDonations,
152
159
  createDonation,
153
160
  createDonationCampaign,
154
161
  } from './donations';
155
- export type { DonationCampaign } from './donations';
162
+ export type { Donation, DonationCampaign } from './donations';
156
163
 
157
164
  export { getStory, listStories, createStory } from './stories';
158
165
  export type { Story } from './stories';
package/src/mutations.ts CHANGED
@@ -7,6 +7,8 @@ import type { UiduClient } from './client';
7
7
  import {
8
8
  CreateChannelDocument,
9
9
  type CreateChannelMutationVariables,
10
+ CreateChannelKbCollectionDocument,
11
+ type CreateChannelKbCollectionMutationVariables,
10
12
  CreateContactDocument,
11
13
  type CreateContactMutationVariables,
12
14
  CreateCourseDocument,
@@ -17,8 +19,12 @@ import {
17
19
  type CreateDealMutationVariables,
18
20
  CreateEmployeeDocument,
19
21
  type CreateEmployeeMutationVariables,
22
+ CreateEmployeeCertificationDocument,
23
+ type CreateEmployeeCertificationMutationVariables,
20
24
  CreateEmploymentDocument,
21
25
  type CreateEmploymentMutationVariables,
26
+ CreateEmploymentTermDocument,
27
+ type CreateEmploymentTermMutationVariables,
22
28
  CreateFormDocument,
23
29
  type CreateFormMutationVariables,
24
30
  CreateKbArticleDocument,
@@ -53,6 +59,8 @@ import {
53
59
  type DeleteTaskMutationVariables,
54
60
  UpdateChannelDocument,
55
61
  type UpdateChannelMutationVariables,
62
+ UpdateChannelKbCollectionDocument,
63
+ type UpdateChannelKbCollectionMutationVariables,
56
64
  UpdateCompensationDocument,
57
65
  type UpdateCompensationMutationVariables,
58
66
  UpdateCourseDocument,
@@ -65,6 +73,8 @@ import {
65
73
  type UpdateEmployeeMutationVariables,
66
74
  UpdateEmploymentDocument,
67
75
  type UpdateEmploymentMutationVariables,
76
+ UpdateEmploymentTermDocument,
77
+ type UpdateEmploymentTermMutationVariables,
68
78
  UpdateEventDocument,
69
79
  type UpdateEventMutationVariables,
70
80
  UpdateFormDocument,
@@ -179,6 +189,20 @@ export async function createEmployee(c: UiduClient, v: CreateEmployeeMutationVar
179
189
  export async function updateEmployee(c: UiduClient, v: UpdateEmployeeMutationVariables) {
180
190
  return (await c.mutate(UpdateEmployeeDocument, v)).updateEmployee ?? null;
181
191
  }
192
+ /**
193
+ * Issue a certification (`attributes.certificationId`) to an employee
194
+ * (`attributes.employeeId`), optionally with its issue date and a generated
195
+ * certificate (`documentId`/`blobId`). Returns the payload (with `errors`) or
196
+ * null. The new record is at `employeeCertification.node`.
197
+ */
198
+ export async function createEmployeeCertification(
199
+ c: UiduClient,
200
+ v: CreateEmployeeCertificationMutationVariables,
201
+ ) {
202
+ return (
203
+ (await c.mutate(CreateEmployeeCertificationDocument, v)).createEmployeeCertification ?? null
204
+ );
205
+ }
182
206
  /**
183
207
  * Hire: open a new employment (contract) for `attributes.employeeId` with its
184
208
  * start date, kind, role and hours. Returns the payload (with `errors`) or
@@ -205,7 +229,10 @@ export async function deleteEmployment(c: UiduClient, v: DeleteEmploymentMutatio
205
229
  /**
206
230
  * Terminate (cessazione) an employment by closing it with an end date and
207
231
  * reason. Thin semantic wrapper over {@link updateEmployment}.
208
- * `endReason` is one of: resignation, termination, contract_end, retirement, other.
232
+ * `endReason` is one of: resignation, termination, contract_end, retirement,
233
+ * other, resignation_just_cause, dismissal_just_cause,
234
+ * dismissal_subjective_reason, dismissal_objective_reason, collective_dismissal,
235
+ * mutual_agreement, probation_failed, death, business_closure.
209
236
  */
210
237
  export async function terminateEmployment(
211
238
  c: UiduClient,
@@ -219,6 +246,29 @@ export async function terminateEmployment(
219
246
  });
220
247
  }
221
248
 
249
+ /**
250
+ * Open a new employment term under `attributes.employmentId` — a variation of
251
+ * the hours, job title, CCNL or contract kind, effective from `effectiveFrom`
252
+ * (the term in force until then is closed on that date). Returns the payload
253
+ * (with `errors`) or null. The new term is at `employmentTerm.node`.
254
+ */
255
+ export async function createEmploymentTerm(
256
+ c: UiduClient,
257
+ v: CreateEmploymentTermMutationVariables,
258
+ ) {
259
+ return (await c.mutate(CreateEmploymentTermDocument, v)).createEmploymentTerm ?? null;
260
+ }
261
+ /**
262
+ * Update an employment term: `{ input: { id, attributes } }`. Returns the
263
+ * payload (with `errors`) or null.
264
+ */
265
+ export async function updateEmploymentTerm(
266
+ c: UiduClient,
267
+ v: UpdateEmploymentTermMutationVariables,
268
+ ) {
269
+ return (await c.mutate(UpdateEmploymentTermDocument, v)).updateEmploymentTerm ?? null;
270
+ }
271
+
222
272
  // --- Time clocks (punches) ---
223
273
  /**
224
274
  * Record a time-clock punch (`beginsAt`, optional `finishesAt`, `resourceId`).
@@ -320,6 +370,31 @@ export async function deleteChannel(c: UiduClient, v: DeleteChannelMutationVaria
320
370
  return (await c.mutate(DeleteChannelDocument, v)).deleteChannel ?? null;
321
371
  }
322
372
 
373
+ // --- Channel ↔ knowledge-base collection links ---
374
+ // Publishes a KB collection on a help-center channel (`attributes.channelId`,
375
+ // `kbCollectionId`, `position`) — distinct from the collection/article content
376
+ // itself, which lives in the `kb` domain.
377
+ /**
378
+ * Publish a knowledge-base collection on a help-center channel. Returns the
379
+ * payload (with `errors`) or null. The new link is at `channelKbCollection`.
380
+ */
381
+ export async function createChannelKbCollection(
382
+ c: UiduClient,
383
+ v: CreateChannelKbCollectionMutationVariables,
384
+ ) {
385
+ return (await c.mutate(CreateChannelKbCollectionDocument, v)).createChannelKbCollection ?? null;
386
+ }
387
+ /**
388
+ * Update a channel/collection link, e.g. its `position`: `{ input: { id,
389
+ * attributes } }`. Returns the payload (with `errors`) or null.
390
+ */
391
+ export async function updateChannelKbCollection(
392
+ c: UiduClient,
393
+ v: UpdateChannelKbCollectionMutationVariables,
394
+ ) {
395
+ return (await c.mutate(UpdateChannelKbCollectionDocument, v)).updateChannelKbCollection ?? null;
396
+ }
397
+
323
398
  // --- Content updates (create lives in the scope's domain file) ---
324
399
  /**
325
400
  * Update an event: `{ input: { id, attributes } }` (create it with
@@ -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
+ }
@@ -0,0 +1,41 @@
1
+ mutation CreateChannelKbCollection($input: CreateChannelKbCollectionInput!) {
2
+ createChannelKbCollection(input: $input) {
3
+ channelKbCollection {
4
+ id
5
+ position
6
+ channel {
7
+ id
8
+ }
9
+ kbCollection {
10
+ id
11
+ name
12
+ }
13
+ }
14
+ errors {
15
+ key
16
+ name
17
+ type
18
+ }
19
+ }
20
+ }
21
+
22
+ mutation UpdateChannelKbCollection($input: UpdateChannelKbCollectionInput!) {
23
+ updateChannelKbCollection(input: $input) {
24
+ channelKbCollection {
25
+ id
26
+ position
27
+ channel {
28
+ id
29
+ }
30
+ kbCollection {
31
+ id
32
+ name
33
+ }
34
+ }
35
+ errors {
36
+ key
37
+ name
38
+ type
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,25 @@
1
+ mutation CreateEmployeeCertification($input: CreateEmployeeCertificationInput!) {
2
+ createEmployeeCertification(input: $input) {
3
+ employeeCertification {
4
+ node {
5
+ id
6
+ issuedAt
7
+ expiresAt
8
+ validNow
9
+ metadata
10
+ employee {
11
+ id
12
+ }
13
+ certification {
14
+ id
15
+ name
16
+ }
17
+ }
18
+ }
19
+ errors {
20
+ key
21
+ name
22
+ type
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,67 @@
1
+ mutation CreateEmploymentTerm($input: CreateEmploymentTermInput!) {
2
+ createEmploymentTerm(input: $input) {
3
+ employmentTerm {
4
+ node {
5
+ id
6
+ effectiveFrom
7
+ effectiveTo
8
+ endDate
9
+ jobTitle
10
+ workingHours
11
+ workingFrequency
12
+ fteRatio
13
+ isInitial
14
+ state
15
+ employment {
16
+ id
17
+ }
18
+ employmentKind {
19
+ id
20
+ name
21
+ }
22
+ ccnl {
23
+ id
24
+ name
25
+ }
26
+ }
27
+ }
28
+ errors {
29
+ key
30
+ name
31
+ type
32
+ }
33
+ }
34
+ }
35
+
36
+ mutation UpdateEmploymentTerm($input: UpdateEmploymentTermInput!) {
37
+ updateEmploymentTerm(input: $input) {
38
+ employmentTerm {
39
+ id
40
+ effectiveFrom
41
+ effectiveTo
42
+ endDate
43
+ jobTitle
44
+ workingHours
45
+ workingFrequency
46
+ fteRatio
47
+ isInitial
48
+ state
49
+ employment {
50
+ id
51
+ }
52
+ employmentKind {
53
+ id
54
+ name
55
+ }
56
+ ccnl {
57
+ id
58
+ name
59
+ }
60
+ }
61
+ errors {
62
+ key
63
+ name
64
+ type
65
+ }
66
+ }
67
+ }