@uidu/client 3.16.0 → 3.18.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 +47 -0
- package/dist/declarations/src/contacts.d.ts +22 -1
- package/dist/declarations/src/courses.d.ts +37 -1
- package/dist/declarations/src/events.d.ts +58 -1
- package/dist/declarations/src/expenses.d.ts +169 -0
- package/dist/declarations/src/generated/index.d.ts +5039 -1610
- package/dist/declarations/src/index.d.ts +10 -8
- package/dist/declarations/src/mutations.d.ts +89 -1
- package/dist/declarations/src/people.d.ts +13 -1
- package/dist/uidu-client.cjs.dev.js +219 -1
- package/dist/uidu-client.cjs.prod.js +219 -1
- package/dist/uidu-client.esm.js +197 -2
- package/package.json +1 -1
- package/src/contacts.ts +33 -0
- package/src/courses.ts +28 -0
- package/src/events.ts +42 -0
- package/src/expenses.test.ts +155 -0
- package/src/expenses.ts +155 -0
- package/src/generated/index.ts +4119 -1868
- package/src/index.ts +41 -3
- package/src/mutations.ts +48 -0
- package/src/people.ts +33 -0
- package/src/queries/contacts/GetOrganization.graphql +17 -0
- package/src/queries/contacts/ListOrganizations.graphql +21 -0
- package/src/queries/contacts/OrganizationMutations.graphql +17 -0
- package/src/queries/courses/EnrollmentMutations.graphql +27 -0
- package/src/queries/events/EventInstanceMutations.graphql +29 -0
- package/src/queries/events/UpdateAttendance.graphql +14 -0
- package/src/queries/expenses/ExpenseFields.graphql +29 -0
- package/src/queries/expenses/ExpenseMutations.graphql +81 -0
- package/src/queries/expenses/GetExpenseReport.graphql +14 -0
- package/src/queries/expenses/ListAnalyticAccounts.graphql +20 -0
- package/src/queries/expenses/ListExpenseReports.graphql +22 -0
- package/src/queries/people/EmploymentVariationKindMutations.graphql +51 -0
- package/src/queries/people/ListEmploymentVariationKinds.graphql +23 -0
|
@@ -4,7 +4,7 @@ export type { UiduClientConfig, UiduErrorOptions } from "./types.js";
|
|
|
4
4
|
export { paginate } from "./utils/paginate.js";
|
|
5
5
|
export type { PaginateOptions } from "./utils/paginate.js";
|
|
6
6
|
export { normalizeFieldValueContent, normalizeFieldValuesAttributes, } from "./utils/fieldValues.js";
|
|
7
|
-
export { ListApplicationsDocument, ListBookingsDocument, ListCalendarsDocument, ListCalendarEventsDocument, ListCallsDocument, ListCampaignsDocument, ListEmailCampaignsDocument, ListCoursesDocument, ListDealsDocument, ListDonationCampaignsDocument, ListDonationsDocument, ListEmployeesDocument, ListEnrollmentsDocument, ListEventsDocument, ListFormsDocument, ListGoalsDocument, ListKbArticlesDocument, ListKbCollectionsDocument, ListLecturesDocument, ListPagesDocument, ListStoriesDocument, ListTimeframesDocument, } from "./generated/index.js";
|
|
7
|
+
export { ListAnalyticAccountsDocument, ListApplicationsDocument, ListBookingsDocument, ListCalendarsDocument, ListCalendarEventsDocument, ListCallsDocument, ListCampaignsDocument, ListEmailCampaignsDocument, ListCoursesDocument, ListDealsDocument, ListDonationCampaignsDocument, ListDonationsDocument, ListEmployeesDocument, ListEmploymentVariationKindsDocument, ListEnrollmentsDocument, ListEventsDocument, ListExpenseReportsDocument, ListFormsDocument, ListGoalsDocument, ListKbArticlesDocument, ListKbCollectionsDocument, ListLecturesDocument, ListOrganizationsDocument, ListPagesDocument, ListStoriesDocument, ListTimeframesDocument, } from "./generated/index.js";
|
|
8
8
|
export { getPage, listPages, getTemplate, createProject, createPage, createPageBlock, createFieldValue, listProjects, } from "./cms.js";
|
|
9
9
|
export type { Page, Template } from "./cms.js";
|
|
10
10
|
export { getSiteByDomain, getSite, getPageBySlug, listSitePages, getSingletonBlock, createSite, } from "./sites.js";
|
|
@@ -16,14 +16,14 @@ export { createNote } from "./notes.js";
|
|
|
16
16
|
export { executeAction } from "./actions.js";
|
|
17
17
|
export { createBenefit } from "./benefits.js";
|
|
18
18
|
export { createBenefitEnrollment } from "./benefit-enrollments.js";
|
|
19
|
-
export { createCourse, updateCourse, deleteCourse, createForm, updateForm, deleteForm, createContact, deleteContact, createDeal, updateDeal, createKbCollection, updateKbCollection, deleteKbCollection, createKbArticle, updateKbArticle, deleteKbArticle, createChannel, updateChannel, deleteChannel, createChannelKbCollection, updateChannelKbCollection, updateEvent, updateStory, updateDonationCampaign, deleteDonationCampaign, updateTask, deleteTask, updateNote, deleteNote, updateSpace, deleteSpace, createEmployee, updateEmployee, createEmployeeCertification, createEmployment, updateEmployment, deleteEmployment, terminateEmployment, createEmploymentTerm, updateEmploymentTerm, createCompensation, updateCompensation, deleteCompensation, createTimeClock, } from "./mutations.js";
|
|
19
|
+
export { createCourse, updateCourse, deleteCourse, createForm, updateForm, deleteForm, createContact, deleteContact, createDeal, updateDeal, createOrganization, createKbCollection, updateKbCollection, deleteKbCollection, createKbArticle, updateKbArticle, deleteKbArticle, createChannel, updateChannel, deleteChannel, createChannelKbCollection, updateChannelKbCollection, updateEvent, updateStory, updateDonationCampaign, deleteDonationCampaign, updateTask, deleteTask, updateNote, deleteNote, updateSpace, deleteSpace, createEmployee, updateEmployee, createEmployeeCertification, createEmployment, updateEmployment, deleteEmployment, terminateEmployment, createEmploymentTerm, updateEmploymentTerm, createEmploymentVariationKind, updateEmploymentVariationKind, createCompensation, updateCompensation, deleteCompensation, createTimeClock, } from "./mutations.js";
|
|
20
20
|
export { getForm, listForms, createFormResponse, updateFormResponse, } from "./forms.js";
|
|
21
21
|
export type { Form } from "./forms.js";
|
|
22
22
|
export { getChannel, listChannels } from "./help-center.js";
|
|
23
23
|
export type { Channel } from "./help-center.js";
|
|
24
24
|
export { search } from "./search.js";
|
|
25
25
|
export type { SearchResult } from "./search.js";
|
|
26
|
-
export { getEvent, listEvents, createAttendance, createEvent } from "./events.js";
|
|
26
|
+
export { getEvent, listEvents, createAttendance, updateAttendance, createEvent, createEventInstance, updateEventInstance, } from "./events.js";
|
|
27
27
|
export type { Event } from "./events.js";
|
|
28
28
|
export { getCall, listCalls } from "./calls.js";
|
|
29
29
|
export type { Call } from "./calls.js";
|
|
@@ -35,18 +35,20 @@ export { getDonationCampaign, listDonationCampaigns, listDonations, createDonati
|
|
|
35
35
|
export type { Donation, DonationCampaign } from "./donations.js";
|
|
36
36
|
export { getStory, listStories, createStory } from "./stories.js";
|
|
37
37
|
export type { Story } from "./stories.js";
|
|
38
|
-
export { listEmployees, getEmployee, weekStartFor, listOffices, listCircles, listRoles, listKinds, listCcnls, createCcnl, listEmploymentHistory, contractEvents, } from "./people.js";
|
|
39
|
-
export type { Employee, Office, Circle, Kind, EmploymentRecord, CompensationRecord, EmployeeContracts, ContractEvent, ContractEventType, } from "./people.js";
|
|
38
|
+
export { listEmployees, getEmployee, weekStartFor, listOffices, listCircles, listRoles, listKinds, listCcnls, createCcnl, listEmploymentHistory, contractEvents, listEmploymentVariationKinds, } from "./people.js";
|
|
39
|
+
export type { Employee, Office, Circle, Kind, EmploymentRecord, CompensationRecord, EmployeeContracts, ContractEvent, ContractEventType, EmploymentVariationKind, } from "./people.js";
|
|
40
40
|
export { getBooking, listBookings, getCalendar, listCalendars, getCalendarEvent, listCalendarEvents, } from "./bookings.js";
|
|
41
41
|
export type { Booking, Calendar, CalendarEvent } from "./bookings.js";
|
|
42
|
-
export { getCourse, listCourses, getEnrollment, listEnrollments, getLecture, listLectures, } from "./courses.js";
|
|
42
|
+
export { getCourse, listCourses, getEnrollment, listEnrollments, createEnrollment, updateEnrollment, getLecture, listLectures, } from "./courses.js";
|
|
43
43
|
export type { Course, Enrollment, Lecture } from "./courses.js";
|
|
44
44
|
export { getCampaign, listCampaigns, listEmailCampaigns } from "./campaigns.js";
|
|
45
45
|
export type { Campaign } from "./campaigns.js";
|
|
46
|
-
export { getContact, listContacts, getDeal, listDeals } from "./contacts.js";
|
|
47
|
-
export type { Contact, Deal } from "./contacts.js";
|
|
46
|
+
export { getContact, listContacts, getDeal, listDeals, getOrganization, listOrganizations, } from "./contacts.js";
|
|
47
|
+
export type { Contact, Deal, Organization } from "./contacts.js";
|
|
48
48
|
export { listGoals, getGoal, listTimeframes, updateGoal, goalValue, toGoalRaw, goalProgress, goalTimeElapsed, isGoalBehind, } from "./goals.js";
|
|
49
49
|
export type { Goal, Timeframe } from "./goals.js";
|
|
50
|
+
export { listExpenseReports, getExpenseReport, createExpenseReport, updateExpenseReport, createExpense, updateExpense, listAnalyticAccounts, allocateExpense, } from "./expenses.js";
|
|
51
|
+
export type { ExpenseReport, Expense, AnalyticAccount } from "./expenses.js";
|
|
50
52
|
export { getKbArticle, listKbArticles, getKbCollection, listKbCollections, } from "./kb.js";
|
|
51
53
|
export type { KbArticle, KbCollection } from "./kb.js";
|
|
52
54
|
export { listModels, getModel, listModelItems, getModelItem, createModel, updateModel, createField, updateField, deleteField, createFieldOption, updateFieldOption, deleteFieldOption, createModelItem, updateModelItem, deleteModelItem, updateFieldValue, deleteFieldValue, toFieldValuesAttributes, ensureModel, } from "./models.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UiduClient } from "./client.js";
|
|
2
|
-
import { type CreateChannelMutationVariables, type CreateChannelKbCollectionMutationVariables, type CreateContactMutationVariables, type CreateCourseMutationVariables, type CreateCompensationMutationVariables, type CreateDealMutationVariables, type CreateEmployeeMutationVariables, type CreateEmployeeCertificationMutationVariables, type CreateEmploymentMutationVariables, type CreateEmploymentTermMutationVariables, type CreateFormMutationVariables, type CreateKbArticleMutationVariables, type CreateKbCollectionMutationVariables, type CreateTimeClockMutationVariables, type DeleteChannelMutationVariables, type DeleteContactMutationVariables, type DeleteCourseMutationVariables, type DeleteCompensationMutationVariables, type DeleteDonationCampaignMutationVariables, type DeleteEmploymentMutationVariables, type DeleteFormMutationVariables, type DeleteKbArticleMutationVariables, type DeleteKbCollectionMutationVariables, type DeleteNoteMutationVariables, type DeleteSpaceMutationVariables, type DeleteTaskMutationVariables, type UpdateChannelMutationVariables, type UpdateChannelKbCollectionMutationVariables, type UpdateCompensationMutationVariables, type UpdateCourseMutationVariables, type UpdateDealMutationVariables, type UpdateDonationCampaignMutationVariables, type UpdateEmployeeMutationVariables, type UpdateEmploymentMutationVariables, type UpdateEmploymentTermMutationVariables, type UpdateEventMutationVariables, type UpdateFormMutationVariables, type UpdateKbArticleMutationVariables, type UpdateKbCollectionMutationVariables, type UpdateNoteMutationVariables, type UpdateSpaceMutationVariables, type UpdateStoryMutationVariables, type UpdateTaskMutationVariables } from "./generated/index.js";
|
|
2
|
+
import { type CreateChannelMutationVariables, type CreateChannelKbCollectionMutationVariables, type CreateContactMutationVariables, type CreateCourseMutationVariables, type CreateCompensationMutationVariables, type CreateDealMutationVariables, type CreateEmployeeMutationVariables, type CreateEmployeeCertificationMutationVariables, type CreateEmploymentMutationVariables, type CreateEmploymentTermMutationVariables, type CreateEmploymentVariationKindMutationVariables, type CreateFormMutationVariables, type CreateKbArticleMutationVariables, type CreateKbCollectionMutationVariables, type CreateOrganizationMutationVariables, type CreateTimeClockMutationVariables, type DeleteChannelMutationVariables, type DeleteContactMutationVariables, type DeleteCourseMutationVariables, type DeleteCompensationMutationVariables, type DeleteDonationCampaignMutationVariables, type DeleteEmploymentMutationVariables, type DeleteFormMutationVariables, type DeleteKbArticleMutationVariables, type DeleteKbCollectionMutationVariables, type DeleteNoteMutationVariables, type DeleteSpaceMutationVariables, type DeleteTaskMutationVariables, type UpdateChannelMutationVariables, type UpdateChannelKbCollectionMutationVariables, type UpdateCompensationMutationVariables, type UpdateCourseMutationVariables, type UpdateDealMutationVariables, type UpdateDonationCampaignMutationVariables, type UpdateEmployeeMutationVariables, type UpdateEmploymentMutationVariables, type UpdateEmploymentTermMutationVariables, type UpdateEmploymentVariationKindMutationVariables, type UpdateEventMutationVariables, type UpdateFormMutationVariables, type UpdateKbArticleMutationVariables, type UpdateKbCollectionMutationVariables, type UpdateNoteMutationVariables, type UpdateSpaceMutationVariables, type UpdateStoryMutationVariables, type UpdateTaskMutationVariables } from "./generated/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Create a course from `{ input: { attributes } }`. Returns the payload (with
|
|
5
5
|
* `errors`) or null.
|
|
@@ -176,6 +176,31 @@ export declare function updateDeal(c: UiduClient, v: UpdateDealMutationVariables
|
|
|
176
176
|
type: string;
|
|
177
177
|
}>;
|
|
178
178
|
} | null>;
|
|
179
|
+
/**
|
|
180
|
+
* Create an organization (company): `{ input: { attributes: { email,
|
|
181
|
+
* organizationAttributes: { name, … } } } }` — the CRM nests an organization's
|
|
182
|
+
* own fields under `attributes.organizationAttributes`, same as a person
|
|
183
|
+
* contact nests theirs under `attributes.userAttributes`. Returns the payload
|
|
184
|
+
* (with `errors`) or null.
|
|
185
|
+
*/
|
|
186
|
+
export declare function createOrganization(c: UiduClient, v: CreateOrganizationMutationVariables): Promise<{
|
|
187
|
+
__typename?: "CreateOrganizationPayload";
|
|
188
|
+
organization?: {
|
|
189
|
+
__typename?: "Organization";
|
|
190
|
+
id: string;
|
|
191
|
+
name?: string | null;
|
|
192
|
+
email?: string | null;
|
|
193
|
+
fiscalCode?: string | null;
|
|
194
|
+
vatCode?: string | null;
|
|
195
|
+
createdAt: any;
|
|
196
|
+
} | null;
|
|
197
|
+
errors: Array<{
|
|
198
|
+
__typename?: "Error";
|
|
199
|
+
key: string;
|
|
200
|
+
name: string;
|
|
201
|
+
type: string;
|
|
202
|
+
}>;
|
|
203
|
+
} | null>;
|
|
179
204
|
/**
|
|
180
205
|
* Create the HR record for a workspace user (`attributes.userId`). Returns the
|
|
181
206
|
* payload (with `errors`) or null. The new employee is at `employee.node`.
|
|
@@ -453,6 +478,69 @@ export declare function updateEmploymentTerm(c: UiduClient, v: UpdateEmploymentT
|
|
|
453
478
|
type: string;
|
|
454
479
|
}>;
|
|
455
480
|
} | null>;
|
|
481
|
+
/**
|
|
482
|
+
* Create an employment variation kind — a reusable reason for a contract
|
|
483
|
+
* change (`changesHours`, `changesPay`, `changesLevel`, …), picked by a
|
|
484
|
+
* contract variation's `employmentVariationKindId`. Returns the payload (with
|
|
485
|
+
* `errors`) or null. The new kind is at `employmentVariationKind.node`.
|
|
486
|
+
*/
|
|
487
|
+
export declare function createEmploymentVariationKind(c: UiduClient, v: CreateEmploymentVariationKindMutationVariables): Promise<{
|
|
488
|
+
__typename?: "CreateEmploymentVariationKindPayload";
|
|
489
|
+
employmentVariationKind?: {
|
|
490
|
+
__typename?: "EmploymentVariationKindEdge";
|
|
491
|
+
node?: {
|
|
492
|
+
__typename?: "EmploymentVariationKind";
|
|
493
|
+
id: string;
|
|
494
|
+
name?: string | null;
|
|
495
|
+
description?: string | null;
|
|
496
|
+
shortname?: string | null;
|
|
497
|
+
color?: string | null;
|
|
498
|
+
position?: number | null;
|
|
499
|
+
changesContract: boolean;
|
|
500
|
+
changesHours: boolean;
|
|
501
|
+
changesLevel: boolean;
|
|
502
|
+
changesPlace: boolean;
|
|
503
|
+
changesPay: boolean;
|
|
504
|
+
changesBenefits: boolean;
|
|
505
|
+
requiresUnilav: boolean;
|
|
506
|
+
} | null;
|
|
507
|
+
} | null;
|
|
508
|
+
errors: Array<{
|
|
509
|
+
__typename?: "Error";
|
|
510
|
+
key: string;
|
|
511
|
+
name: string;
|
|
512
|
+
type: string;
|
|
513
|
+
}>;
|
|
514
|
+
} | null>;
|
|
515
|
+
/**
|
|
516
|
+
* Update an employment variation kind: `{ input: { id, attributes } }`.
|
|
517
|
+
* Returns the payload (with `errors`) or null.
|
|
518
|
+
*/
|
|
519
|
+
export declare function updateEmploymentVariationKind(c: UiduClient, v: UpdateEmploymentVariationKindMutationVariables): Promise<{
|
|
520
|
+
__typename?: "UpdateEmploymentVariationKindPayload";
|
|
521
|
+
employmentVariationKind?: {
|
|
522
|
+
__typename?: "EmploymentVariationKind";
|
|
523
|
+
id: string;
|
|
524
|
+
name?: string | null;
|
|
525
|
+
description?: string | null;
|
|
526
|
+
shortname?: string | null;
|
|
527
|
+
color?: string | null;
|
|
528
|
+
position?: number | null;
|
|
529
|
+
changesContract: boolean;
|
|
530
|
+
changesHours: boolean;
|
|
531
|
+
changesLevel: boolean;
|
|
532
|
+
changesPlace: boolean;
|
|
533
|
+
changesPay: boolean;
|
|
534
|
+
changesBenefits: boolean;
|
|
535
|
+
requiresUnilav: boolean;
|
|
536
|
+
} | null;
|
|
537
|
+
errors: Array<{
|
|
538
|
+
__typename?: "Error";
|
|
539
|
+
key: string;
|
|
540
|
+
name: string;
|
|
541
|
+
type: string;
|
|
542
|
+
}>;
|
|
543
|
+
} | null>;
|
|
456
544
|
/**
|
|
457
545
|
* Record a time-clock punch (`beginsAt`, optional `finishesAt`, `resourceId`).
|
|
458
546
|
* Returns the payload (with `errors`) or null. The new punch is at
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { UiduClient } from "./client.js";
|
|
2
|
-
import { type CreateCcnlMutationVariables, type GetEmployeeQuery, type GetEmployeeQueryVariables, type ListCirclesQuery, type ListCirclesQueryVariables, type ListEmployeesQueryVariables, type ListEmploymentHistoryQueryVariables, type ListKindsQuery, type ListKindsQueryVariables, type ListOfficesQuery, type ListOfficesQueryVariables } from "./generated/index.js";
|
|
2
|
+
import { type CreateCcnlMutationVariables, type GetEmployeeQuery, type GetEmployeeQueryVariables, type ListCirclesQuery, type ListCirclesQueryVariables, type ListEmployeesQueryVariables, type ListEmploymentHistoryQueryVariables, type ListEmploymentVariationKindsQuery, type ListEmploymentVariationKindsQueryVariables, type ListKindsQuery, type ListKindsQueryVariables, type ListOfficesQuery, type ListOfficesQueryVariables } from "./generated/index.js";
|
|
3
3
|
export type Employee = NonNullable<NonNullable<GetEmployeeQuery['currentWorkspace']>['employee']>;
|
|
4
4
|
export type Circle = NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<ListCirclesQuery['currentWorkspace']>['circles']>['edges']>[number]>['node']>;
|
|
5
5
|
export type Office = NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<ListOfficesQuery['currentWorkspace']>['offices']>['edges']>[number]>['node']>;
|
|
6
|
+
/**
|
|
7
|
+
* A contract-variation reason (hours change, conversion to open-ended, a pay
|
|
8
|
+
* rise…) configured for the workspace — an employment's `varyAttributes` picks
|
|
9
|
+
* one by `employmentVariationKindId`.
|
|
10
|
+
*/
|
|
11
|
+
export type EmploymentVariationKind = NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<ListEmploymentVariationKindsQuery['currentWorkspace']>['employmentVariationKinds']>['edges']>[number]>['node']>;
|
|
6
12
|
/** A `Kind` record — CCNLs (national collective labor contracts) are Kinds. */
|
|
7
13
|
export type Kind = NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<ListKindsQuery['currentWorkspace']>['kinds']>['edges']>[number]>['node']>;
|
|
8
14
|
/**
|
|
@@ -56,6 +62,12 @@ export declare function listOffices(client: UiduClient, variables?: ListOfficesQ
|
|
|
56
62
|
export declare function listCircles(client: UiduClient, variables?: ListCirclesQueryVariables): Promise<Circle[]>;
|
|
57
63
|
/** List only the role-Circles (structured job titles) — an employment's `roleId`. */
|
|
58
64
|
export declare function listRoles(client: UiduClient, variables?: ListCirclesQueryVariables): Promise<Circle[]>;
|
|
65
|
+
/**
|
|
66
|
+
* List the workspace's employment variation kinds — the reasons a contract
|
|
67
|
+
* can change (hours, pay, level, place, benefits…), each flagging which
|
|
68
|
+
* aspects it touches. Used for a contract variation's `employmentVariationKindId`.
|
|
69
|
+
*/
|
|
70
|
+
export declare function listEmploymentVariationKinds(client: UiduClient, variables?: ListEmploymentVariationKindsQueryVariables): Promise<EmploymentVariationKind[]>;
|
|
59
71
|
/** List `Kind` records for the given polymorphic models. */
|
|
60
72
|
export declare function listKinds(client: UiduClient, variables: ListKindsQueryVariables): Promise<Kind[]>;
|
|
61
73
|
/**
|