@uidu/client 3.1.1 → 3.3.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 CHANGED
@@ -1,5 +1,37 @@
1
1
  # @uidu/client
2
2
 
3
+ ## 3.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ccd1038: Add employment history reads for building contract timelines.
8
+
9
+ `listEmploymentHistory` returns every employee with their full list of
10
+ contracts (not just the current one), and `contractEvents` flattens that into a
11
+ dated, most-recent-first list of events: the earliest contract is a `hire`,
12
+ later contracts are `variation`s, and any contract with an end date yields a
13
+ `termination` — each tagged with a `month` bucket for grouping. Exports the
14
+ `EmploymentRecord`, `EmployeeContracts`, `ContractEvent` and `ContractEventType`
15
+ types.
16
+
17
+ ## 3.2.0
18
+
19
+ ### Minor Changes
20
+
21
+ - 5d1f0a9: Add the People/HR authoring domain.
22
+
23
+ `@uidu/client` now exposes employee & employment writes — `createEmployee`,
24
+ `updateEmployee`, `createEmployment`, `updateEmployment`, `deleteEmployment`
25
+ and the semantic helper `terminateEmployment({ id, endDate, endReason })` — plus
26
+ reference-data reads for populating employment forms: `listOffices`,
27
+ `listCircles`, `listRoles` (role-Circles only), `listKinds` and `listCcnls`,
28
+ with exported `Office`, `Circle` and `Kind` types.
29
+
30
+ This makes hires, terminations and contract variations first-class SDK
31
+ operations instead of hand-written GraphQL. The `uidu` CLI gains matching nouns:
32
+ `employees create|update`, `employment create|update|delete`, and
33
+ `offices|roles|ccnls list`.
34
+
3
35
  ## 3.1.1
4
36
 
5
37
  ### Patch Changes
@@ -44624,6 +44624,33 @@ export type GetEmployeeQuery = {
44624
44624
  } | null;
44625
44625
  } | null;
44626
44626
  };
44627
+ export type ListCirclesQueryVariables = Exact<{
44628
+ first?: InputMaybe<Scalars['Int']['input']>;
44629
+ after?: InputMaybe<Scalars['String']['input']>;
44630
+ }>;
44631
+ export type ListCirclesQuery = {
44632
+ __typename?: 'Query';
44633
+ currentWorkspace?: {
44634
+ __typename?: 'Workspace';
44635
+ circles: {
44636
+ __typename?: 'CircleConnection';
44637
+ pageInfo: {
44638
+ __typename?: 'PageInfo';
44639
+ hasNextPage: boolean;
44640
+ endCursor?: string | null;
44641
+ };
44642
+ edges?: Array<{
44643
+ __typename?: 'CircleEdge';
44644
+ node?: {
44645
+ __typename?: 'Circle';
44646
+ id: string;
44647
+ name?: string | null;
44648
+ kind?: string | null;
44649
+ } | null;
44650
+ } | null> | null;
44651
+ };
44652
+ } | null;
44653
+ };
44627
44654
  export type ListEmployeesQueryVariables = Exact<{
44628
44655
  first?: InputMaybe<Scalars['Int']['input']>;
44629
44656
  after?: InputMaybe<Scalars['String']['input']>;
@@ -44666,6 +44693,230 @@ export type ListEmployeesQuery = {
44666
44693
  };
44667
44694
  } | null;
44668
44695
  };
44696
+ export type ListEmploymentHistoryQueryVariables = Exact<{
44697
+ first?: InputMaybe<Scalars['Int']['input']>;
44698
+ after?: InputMaybe<Scalars['String']['input']>;
44699
+ employmentsFirst?: InputMaybe<Scalars['Int']['input']>;
44700
+ }>;
44701
+ export type ListEmploymentHistoryQuery = {
44702
+ __typename?: 'Query';
44703
+ currentWorkspace?: {
44704
+ __typename?: 'Workspace';
44705
+ employees: {
44706
+ __typename?: 'EmployeeConnection';
44707
+ pageInfo: {
44708
+ __typename?: 'PageInfo';
44709
+ hasNextPage: boolean;
44710
+ endCursor?: string | null;
44711
+ };
44712
+ edges?: Array<{
44713
+ __typename?: 'EmployeeEdge';
44714
+ node?: {
44715
+ __typename?: 'Employee';
44716
+ id: string;
44717
+ user?: {
44718
+ __typename?: 'User';
44719
+ id: string;
44720
+ name?: string | null;
44721
+ email?: string | null;
44722
+ } | null;
44723
+ employments: {
44724
+ __typename?: 'EmploymentConnection';
44725
+ edges?: Array<{
44726
+ __typename?: 'EmploymentEdge';
44727
+ node?: {
44728
+ __typename?: 'Employment';
44729
+ id: string;
44730
+ startDate: any;
44731
+ endDate?: any | null;
44732
+ endReason?: string | null;
44733
+ jobTitle?: string | null;
44734
+ contractType?: string | null;
44735
+ } | null;
44736
+ } | null> | null;
44737
+ };
44738
+ } | null;
44739
+ } | null> | null;
44740
+ };
44741
+ } | null;
44742
+ };
44743
+ export type ListKindsQueryVariables = Exact<{
44744
+ models: Array<Scalars['String']['input']> | Scalars['String']['input'];
44745
+ first?: InputMaybe<Scalars['Int']['input']>;
44746
+ after?: InputMaybe<Scalars['String']['input']>;
44747
+ }>;
44748
+ export type ListKindsQuery = {
44749
+ __typename?: 'Query';
44750
+ currentWorkspace?: {
44751
+ __typename?: 'Workspace';
44752
+ kinds?: {
44753
+ __typename?: 'KindConnection';
44754
+ pageInfo: {
44755
+ __typename?: 'PageInfo';
44756
+ hasNextPage: boolean;
44757
+ endCursor?: string | null;
44758
+ };
44759
+ edges?: Array<{
44760
+ __typename?: 'KindEdge';
44761
+ node?: {
44762
+ __typename?: 'Kind';
44763
+ id: string;
44764
+ name?: string | null;
44765
+ code?: string | null;
44766
+ model?: string | null;
44767
+ } | null;
44768
+ } | null> | null;
44769
+ } | null;
44770
+ } | null;
44771
+ };
44772
+ export type ListOfficesQueryVariables = Exact<{
44773
+ first?: InputMaybe<Scalars['Int']['input']>;
44774
+ after?: InputMaybe<Scalars['String']['input']>;
44775
+ }>;
44776
+ export type ListOfficesQuery = {
44777
+ __typename?: 'Query';
44778
+ currentWorkspace?: {
44779
+ __typename?: 'Workspace';
44780
+ offices?: {
44781
+ __typename?: 'OfficeConnection';
44782
+ pageInfo: {
44783
+ __typename?: 'PageInfo';
44784
+ hasNextPage: boolean;
44785
+ endCursor?: string | null;
44786
+ };
44787
+ edges?: Array<{
44788
+ __typename?: 'OfficeEdge';
44789
+ node?: {
44790
+ __typename?: 'Office';
44791
+ id: string;
44792
+ name?: string | null;
44793
+ } | null;
44794
+ } | null> | null;
44795
+ } | null;
44796
+ } | null;
44797
+ };
44798
+ export type CreateEmployeeMutationVariables = Exact<{
44799
+ input: CreateEmployeeInput;
44800
+ }>;
44801
+ export type CreateEmployeeMutation = {
44802
+ __typename?: 'Mutation';
44803
+ createEmployee?: {
44804
+ __typename?: 'CreateEmployeePayload';
44805
+ employee?: {
44806
+ __typename?: 'EmployeeEdge';
44807
+ node?: {
44808
+ __typename?: 'Employee';
44809
+ id: string;
44810
+ employeeCode?: string | null;
44811
+ user?: {
44812
+ __typename?: 'User';
44813
+ id: string;
44814
+ name?: string | null;
44815
+ email?: string | null;
44816
+ } | null;
44817
+ } | null;
44818
+ } | null;
44819
+ errors: Array<{
44820
+ __typename?: 'Error';
44821
+ key: string;
44822
+ name: string;
44823
+ type: string;
44824
+ }>;
44825
+ } | null;
44826
+ };
44827
+ export type UpdateEmployeeMutationVariables = Exact<{
44828
+ input: UpdateEmployeeInput;
44829
+ }>;
44830
+ export type UpdateEmployeeMutation = {
44831
+ __typename?: 'Mutation';
44832
+ updateEmployee?: {
44833
+ __typename?: 'UpdateEmployeePayload';
44834
+ employee?: {
44835
+ __typename?: 'Employee';
44836
+ id: string;
44837
+ employeeCode?: string | null;
44838
+ } | null;
44839
+ errors: Array<{
44840
+ __typename?: 'Error';
44841
+ key: string;
44842
+ name: string;
44843
+ type: string;
44844
+ }>;
44845
+ } | null;
44846
+ };
44847
+ export type CreateEmploymentMutationVariables = Exact<{
44848
+ input: CreateEmploymentInput;
44849
+ }>;
44850
+ export type CreateEmploymentMutation = {
44851
+ __typename?: 'Mutation';
44852
+ createEmployment?: {
44853
+ __typename?: 'CreateEmploymentPayload';
44854
+ employment?: {
44855
+ __typename?: 'EmploymentEdge';
44856
+ node?: {
44857
+ __typename?: 'Employment';
44858
+ id: string;
44859
+ jobTitle?: string | null;
44860
+ contractType?: string | null;
44861
+ classification?: string | null;
44862
+ startDate: any;
44863
+ endDate?: any | null;
44864
+ isActive: boolean;
44865
+ } | null;
44866
+ } | null;
44867
+ errors: Array<{
44868
+ __typename?: 'Error';
44869
+ key: string;
44870
+ name: string;
44871
+ type: string;
44872
+ }>;
44873
+ } | null;
44874
+ };
44875
+ export type UpdateEmploymentMutationVariables = Exact<{
44876
+ input: UpdateEmploymentInput;
44877
+ }>;
44878
+ export type UpdateEmploymentMutation = {
44879
+ __typename?: 'Mutation';
44880
+ updateEmployment?: {
44881
+ __typename?: 'UpdateEmploymentPayload';
44882
+ employment?: {
44883
+ __typename?: 'Employment';
44884
+ id: string;
44885
+ jobTitle?: string | null;
44886
+ contractType?: string | null;
44887
+ classification?: string | null;
44888
+ startDate: any;
44889
+ endDate?: any | null;
44890
+ endReason?: string | null;
44891
+ isActive: boolean;
44892
+ } | null;
44893
+ errors: Array<{
44894
+ __typename?: 'Error';
44895
+ key: string;
44896
+ name: string;
44897
+ type: string;
44898
+ }>;
44899
+ } | null;
44900
+ };
44901
+ export type DeleteEmploymentMutationVariables = Exact<{
44902
+ input: DeleteEmploymentInput;
44903
+ }>;
44904
+ export type DeleteEmploymentMutation = {
44905
+ __typename?: 'Mutation';
44906
+ deleteEmployment?: {
44907
+ __typename?: 'DeleteEmploymentPayload';
44908
+ employment?: {
44909
+ __typename?: 'Employment';
44910
+ id: string;
44911
+ } | null;
44912
+ errors: Array<{
44913
+ __typename?: 'Error';
44914
+ key: string;
44915
+ name: string;
44916
+ type: string;
44917
+ }>;
44918
+ } | null;
44919
+ };
44669
44920
  export type SearchQueryVariables = Exact<{
44670
44921
  models?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
44671
44922
  params?: InputMaybe<SearchParams>;
@@ -45125,7 +45376,16 @@ export declare const CreateNoteDocument: DocumentNode<CreateNoteMutation, Create
45125
45376
  export declare const UpdateNoteDocument: DocumentNode<UpdateNoteMutation, UpdateNoteMutationVariables>;
45126
45377
  export declare const DeleteNoteDocument: DocumentNode<DeleteNoteMutation, DeleteNoteMutationVariables>;
45127
45378
  export declare const GetEmployeeDocument: DocumentNode<GetEmployeeQuery, GetEmployeeQueryVariables>;
45379
+ export declare const ListCirclesDocument: DocumentNode<ListCirclesQuery, ListCirclesQueryVariables>;
45128
45380
  export declare const ListEmployeesDocument: DocumentNode<ListEmployeesQuery, ListEmployeesQueryVariables>;
45381
+ export declare const ListEmploymentHistoryDocument: DocumentNode<ListEmploymentHistoryQuery, ListEmploymentHistoryQueryVariables>;
45382
+ export declare const ListKindsDocument: DocumentNode<ListKindsQuery, ListKindsQueryVariables>;
45383
+ export declare const ListOfficesDocument: DocumentNode<ListOfficesQuery, ListOfficesQueryVariables>;
45384
+ export declare const CreateEmployeeDocument: DocumentNode<CreateEmployeeMutation, CreateEmployeeMutationVariables>;
45385
+ export declare const UpdateEmployeeDocument: DocumentNode<UpdateEmployeeMutation, UpdateEmployeeMutationVariables>;
45386
+ export declare const CreateEmploymentDocument: DocumentNode<CreateEmploymentMutation, CreateEmploymentMutationVariables>;
45387
+ export declare const UpdateEmploymentDocument: DocumentNode<UpdateEmploymentMutation, UpdateEmploymentMutationVariables>;
45388
+ export declare const DeleteEmploymentDocument: DocumentNode<DeleteEmploymentMutation, DeleteEmploymentMutationVariables>;
45129
45389
  export declare const SearchDocument: DocumentNode<SearchQuery, SearchQueryVariables>;
45130
45390
  export declare const CreateSpaceDocument: DocumentNode<CreateSpaceMutation, CreateSpaceMutationVariables>;
45131
45391
  export declare const UpdateSpaceDocument: DocumentNode<UpdateSpaceMutation, UpdateSpaceMutationVariables>;
@@ -10,7 +10,7 @@ export { createWorkspace, generateWorkspaceApiCredentials, } from "./system.js";
10
10
  export { createSpace } from "./spaces.js";
11
11
  export { createTask } from "./tasks.js";
12
12
  export { createNote } from "./notes.js";
13
- export { createCourse, updateCourse, deleteCourse, createForm, updateForm, deleteForm, createContact, deleteContact, createDeal, updateDeal, createKbCollection, updateKbCollection, deleteKbCollection, createKbArticle, updateKbArticle, deleteKbArticle, createChannel, updateChannel, deleteChannel, updateEvent, updateStory, updateDonationCampaign, deleteDonationCampaign, updateTask, deleteTask, updateNote, deleteNote, updateSpace, deleteSpace, } from "./mutations.js";
13
+ export { createCourse, updateCourse, deleteCourse, createForm, updateForm, deleteForm, createContact, deleteContact, createDeal, updateDeal, createKbCollection, updateKbCollection, deleteKbCollection, createKbArticle, updateKbArticle, deleteKbArticle, createChannel, updateChannel, deleteChannel, updateEvent, updateStory, updateDonationCampaign, deleteDonationCampaign, updateTask, deleteTask, updateNote, deleteNote, updateSpace, deleteSpace, createEmployee, updateEmployee, createEmployment, updateEmployment, deleteEmployment, terminateEmployment, } from "./mutations.js";
14
14
  export { getForm, listForms, createFormResponse, updateFormResponse, } from "./forms.js";
15
15
  export type { Form } from "./forms.js";
16
16
  export { getChannel } from "./help-center.js";
@@ -25,8 +25,8 @@ export { getDonationCampaign, listDonationCampaigns, createDonation, createDonat
25
25
  export type { DonationCampaign } from "./donations.js";
26
26
  export { getStory, listStories, createStory } from "./stories.js";
27
27
  export type { Story } from "./stories.js";
28
- export { listEmployees, getEmployee, weekStartFor } from "./people.js";
29
- export type { Employee } from "./people.js";
28
+ export { listEmployees, getEmployee, weekStartFor, listOffices, listCircles, listRoles, listKinds, listCcnls, listEmploymentHistory, contractEvents, } from "./people.js";
29
+ export type { Employee, Office, Circle, Kind, EmploymentRecord, EmployeeContracts, ContractEvent, ContractEventType, } from "./people.js";
30
30
  export { getBooking, listBookings, getCalendar, listCalendars, getCalendarEvent, listCalendarEvents, } from "./bookings.js";
31
31
  export type { Booking, Calendar, CalendarEvent } from "./bookings.js";
32
32
  export { getCourse, listCourses, getEnrollment, listEnrollments, getLecture, listLectures, } from "./courses.js";
@@ -1,5 +1,5 @@
1
1
  import type { UiduClient } from "./client.js";
2
- import { type CreateChannelMutationVariables, type CreateContactMutationVariables, type CreateCourseMutationVariables, type CreateDealMutationVariables, type CreateFormMutationVariables, type CreateKbArticleMutationVariables, type CreateKbCollectionMutationVariables, type DeleteChannelMutationVariables, type DeleteContactMutationVariables, type DeleteCourseMutationVariables, type DeleteDonationCampaignMutationVariables, type DeleteFormMutationVariables, type DeleteKbArticleMutationVariables, type DeleteKbCollectionMutationVariables, type DeleteNoteMutationVariables, type DeleteSpaceMutationVariables, type DeleteTaskMutationVariables, type UpdateChannelMutationVariables, type UpdateCourseMutationVariables, type UpdateDealMutationVariables, type UpdateDonationCampaignMutationVariables, 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 CreateContactMutationVariables, type CreateCourseMutationVariables, type CreateDealMutationVariables, type CreateEmployeeMutationVariables, type CreateEmploymentMutationVariables, type CreateFormMutationVariables, type CreateKbArticleMutationVariables, type CreateKbCollectionMutationVariables, type DeleteChannelMutationVariables, type DeleteContactMutationVariables, type DeleteCourseMutationVariables, type DeleteDonationCampaignMutationVariables, type DeleteEmploymentMutationVariables, type DeleteFormMutationVariables, type DeleteKbArticleMutationVariables, type DeleteKbCollectionMutationVariables, type DeleteNoteMutationVariables, type DeleteSpaceMutationVariables, type DeleteTaskMutationVariables, type UpdateChannelMutationVariables, type UpdateCourseMutationVariables, type UpdateDealMutationVariables, type UpdateDonationCampaignMutationVariables, type UpdateEmployeeMutationVariables, type UpdateEmploymentMutationVariables, type UpdateEventMutationVariables, type UpdateFormMutationVariables, type UpdateKbArticleMutationVariables, type UpdateKbCollectionMutationVariables, type UpdateNoteMutationVariables, type UpdateSpaceMutationVariables, type UpdateStoryMutationVariables, type UpdateTaskMutationVariables } from "./generated/index.js";
3
3
  export declare function createCourse(c: UiduClient, v: CreateCourseMutationVariables): Promise<{
4
4
  __typename?: "CreateCoursePayload";
5
5
  course?: {
@@ -136,6 +136,127 @@ export declare function updateDeal(c: UiduClient, v: UpdateDealMutationVariables
136
136
  type: string;
137
137
  }>;
138
138
  } | null>;
139
+ export declare function createEmployee(c: UiduClient, v: CreateEmployeeMutationVariables): Promise<{
140
+ __typename?: "CreateEmployeePayload";
141
+ employee?: {
142
+ __typename?: "EmployeeEdge";
143
+ node?: {
144
+ __typename?: "Employee";
145
+ id: string;
146
+ employeeCode?: string | null;
147
+ user?: {
148
+ __typename?: "User";
149
+ id: string;
150
+ name?: string | null;
151
+ email?: string | null;
152
+ } | null;
153
+ } | null;
154
+ } | null;
155
+ errors: Array<{
156
+ __typename?: "Error";
157
+ key: string;
158
+ name: string;
159
+ type: string;
160
+ }>;
161
+ } | null>;
162
+ export declare function updateEmployee(c: UiduClient, v: UpdateEmployeeMutationVariables): Promise<{
163
+ __typename?: "UpdateEmployeePayload";
164
+ employee?: {
165
+ __typename?: "Employee";
166
+ id: string;
167
+ employeeCode?: string | null;
168
+ } | null;
169
+ errors: Array<{
170
+ __typename?: "Error";
171
+ key: string;
172
+ name: string;
173
+ type: string;
174
+ }>;
175
+ } | null>;
176
+ export declare function createEmployment(c: UiduClient, v: CreateEmploymentMutationVariables): Promise<{
177
+ __typename?: "CreateEmploymentPayload";
178
+ employment?: {
179
+ __typename?: "EmploymentEdge";
180
+ node?: {
181
+ __typename?: "Employment";
182
+ id: string;
183
+ jobTitle?: string | null;
184
+ contractType?: string | null;
185
+ classification?: string | null;
186
+ startDate: any;
187
+ endDate?: any | null;
188
+ isActive: boolean;
189
+ } | null;
190
+ } | null;
191
+ errors: Array<{
192
+ __typename?: "Error";
193
+ key: string;
194
+ name: string;
195
+ type: string;
196
+ }>;
197
+ } | null>;
198
+ export declare function updateEmployment(c: UiduClient, v: UpdateEmploymentMutationVariables): Promise<{
199
+ __typename?: "UpdateEmploymentPayload";
200
+ employment?: {
201
+ __typename?: "Employment";
202
+ id: string;
203
+ jobTitle?: string | null;
204
+ contractType?: string | null;
205
+ classification?: string | null;
206
+ startDate: any;
207
+ endDate?: any | null;
208
+ endReason?: string | null;
209
+ isActive: boolean;
210
+ } | null;
211
+ errors: Array<{
212
+ __typename?: "Error";
213
+ key: string;
214
+ name: string;
215
+ type: string;
216
+ }>;
217
+ } | null>;
218
+ export declare function deleteEmployment(c: UiduClient, v: DeleteEmploymentMutationVariables): Promise<{
219
+ __typename?: "DeleteEmploymentPayload";
220
+ employment?: {
221
+ __typename?: "Employment";
222
+ id: string;
223
+ } | null;
224
+ errors: Array<{
225
+ __typename?: "Error";
226
+ key: string;
227
+ name: string;
228
+ type: string;
229
+ }>;
230
+ } | null>;
231
+ /**
232
+ * Terminate (cessazione) an employment by closing it with an end date and
233
+ * reason. Thin semantic wrapper over {@link updateEmployment}.
234
+ * `endReason` is one of: resignation, termination, contract_end, retirement, other.
235
+ */
236
+ export declare function terminateEmployment(c: UiduClient, args: {
237
+ id: string;
238
+ endDate: string;
239
+ endReason?: string;
240
+ }): Promise<{
241
+ __typename?: "UpdateEmploymentPayload";
242
+ employment?: {
243
+ __typename?: "Employment";
244
+ id: string;
245
+ jobTitle?: string | null;
246
+ contractType?: string | null;
247
+ classification?: string | null;
248
+ startDate: any;
249
+ endDate?: any | null;
250
+ endReason?: string | null;
251
+ isActive: boolean;
252
+ } | null;
253
+ errors: Array<{
254
+ __typename?: "Error";
255
+ key: string;
256
+ name: string;
257
+ type: string;
258
+ }>;
259
+ } | null>;
139
260
  export declare function createKbCollection(c: UiduClient, v: CreateKbCollectionMutationVariables): Promise<{
140
261
  __typename?: "CreateKbCollectionPayload";
141
262
  kbCollection?: {
@@ -1,6 +1,10 @@
1
1
  import type { UiduClient } from "./client.js";
2
- import { type GetEmployeeQuery, type GetEmployeeQueryVariables, type ListEmployeesQueryVariables } from "./generated/index.js";
2
+ import { type GetEmployeeQuery, type GetEmployeeQueryVariables, type ListCirclesQuery, type ListCirclesQueryVariables, type ListEmployeesQueryVariables, type ListEmploymentHistoryQueryVariables, type ListKindsQuery, type ListKindsQueryVariables, type ListOfficesQuery, type ListOfficesQueryVariables } from "./generated/index.js";
3
3
  export type Employee = NonNullable<NonNullable<GetEmployeeQuery['currentWorkspace']>['employee']>;
4
+ export type Circle = NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<ListCirclesQuery['currentWorkspace']>['circles']>['edges']>[number]>['node']>;
5
+ export type Office = NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<ListOfficesQuery['currentWorkspace']>['offices']>['edges']>[number]>['node']>;
6
+ /** A `Kind` record — CCNLs (national collective labor contracts) are Kinds. */
7
+ export type Kind = NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<ListKindsQuery['currentWorkspace']>['kinds']>['edges']>[number]>['node']>;
4
8
  export declare function listEmployees(client: UiduClient, variables?: ListEmployeesQueryVariables): Promise<{
5
9
  __typename?: "Employee";
6
10
  id: string;
@@ -29,3 +33,67 @@ export declare function getEmployee(client: UiduClient, variables: GetEmployeeQu
29
33
  * other weekly-aggregated employee fields).
30
34
  */
31
35
  export declare function weekStartFor(date?: Date): string;
36
+ /** List the workspace offices — used for an employment's `employmentOfficesAttributes`. */
37
+ export declare function listOffices(client: UiduClient, variables?: ListOfficesQueryVariables): Promise<Office[]>;
38
+ /**
39
+ * List the workspace circles. Circles come in two flavours distinguished by
40
+ * `kind`: org units (e.g. departments — used as an employment's `circleId`) and
41
+ * roles (`kind === 'role'` — used as an employment's `roleId`). Use
42
+ * {@link listRoles} when you only want the role-Circles.
43
+ */
44
+ export declare function listCircles(client: UiduClient, variables?: ListCirclesQueryVariables): Promise<Circle[]>;
45
+ /** List only the role-Circles (structured job titles) — an employment's `roleId`. */
46
+ export declare function listRoles(client: UiduClient, variables?: ListCirclesQueryVariables): Promise<Circle[]>;
47
+ /** List `Kind` records for the given polymorphic models. */
48
+ export declare function listKinds(client: UiduClient, variables: ListKindsQueryVariables): Promise<Kind[]>;
49
+ /**
50
+ * List the CCNLs (national collective labor contracts) configured for the
51
+ * workspace — used for an employment's `ccnlId`.
52
+ */
53
+ export declare function listCcnls(client: UiduClient, variables?: Omit<ListKindsQueryVariables, 'models'>): Promise<Kind[]>;
54
+ /** A single contract (employment) reduced to the fields that describe its span. */
55
+ export type EmploymentRecord = {
56
+ id: string;
57
+ startDate: string | null;
58
+ endDate: string | null;
59
+ endReason: string | null;
60
+ jobTitle: string | null;
61
+ contractType: string | null;
62
+ };
63
+ /** An employee together with their full list of contracts. */
64
+ export type EmployeeContracts = {
65
+ id: string;
66
+ name: string;
67
+ employments: EmploymentRecord[];
68
+ };
69
+ /**
70
+ * List every employee with their full employment (contract) history — not just
71
+ * the current one. Use {@link contractEvents} to turn this into a flat, dated
72
+ * list of hires, terminations and contract variations.
73
+ */
74
+ export declare function listEmploymentHistory(client: UiduClient, variables?: ListEmploymentHistoryQueryVariables): Promise<EmployeeContracts[]>;
75
+ export type ContractEventType = 'hire' | 'variation' | 'termination';
76
+ /** A dated contract event derived from employment history. */
77
+ export type ContractEvent = {
78
+ type: ContractEventType;
79
+ /** ISO8601 date (YYYY-MM-DD) the event happened on. */
80
+ date: string;
81
+ /** Year-month bucket (YYYY-MM), convenient for grouping. */
82
+ month: string;
83
+ employeeId: string;
84
+ employeeName: string;
85
+ employmentId: string;
86
+ jobTitle: string | null;
87
+ contractType: string | null;
88
+ /** Only set on `termination` events. */
89
+ endReason: string | null;
90
+ };
91
+ /**
92
+ * Flatten employment history into dated contract events, most recent first:
93
+ * - the employee's earliest contract is a `hire` (assunzione) on its start date;
94
+ * - every later contract is a `variation` (variazione) on its start date;
95
+ * - any contract with an end date yields a `termination` (cessazione) on it.
96
+ *
97
+ * Contracts without a start date are ignored.
98
+ */
99
+ export declare function contractEvents(employees: EmployeeContracts[]): ContractEvent[];