@uidu/client 3.17.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 (69) hide show
  1. package/CHANGELOG.md +46 -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/contacts.d.ts +22 -1
  5. package/dist/declarations/src/contracts.d.ts +8 -0
  6. package/dist/declarations/src/expenses.d.ts +169 -0
  7. package/dist/declarations/src/field-values.d.ts +34 -0
  8. package/dist/declarations/src/generated/index.d.ts +13283 -4414
  9. package/dist/declarations/src/index.d.ts +24 -8
  10. package/dist/declarations/src/meetings.d.ts +41 -0
  11. package/dist/declarations/src/mutations.d.ts +168 -131
  12. package/dist/declarations/src/people.d.ts +13 -1
  13. package/dist/declarations/src/reviews.d.ts +195 -0
  14. package/dist/declarations/src/skills.d.ts +34 -0
  15. package/dist/declarations/src/work-sites.d.ts +9 -0
  16. package/dist/uidu-client.cjs.dev.js +570 -31
  17. package/dist/uidu-client.cjs.prod.js +570 -31
  18. package/dist/uidu-client.esm.js +523 -32
  19. package/package.json +1 -1
  20. package/src/calls.ts +37 -0
  21. package/src/candidates.ts +105 -0
  22. package/src/contacts.ts +33 -0
  23. package/src/contracts.ts +44 -0
  24. package/src/expenses.test.ts +155 -0
  25. package/src/expenses.ts +155 -0
  26. package/src/field-values.ts +95 -0
  27. package/src/generated/index.ts +3461 -2268
  28. package/src/index.ts +83 -4
  29. package/src/meetings.ts +37 -0
  30. package/src/mutations.test.ts +40 -1
  31. package/src/mutations.ts +170 -60
  32. package/src/people.ts +33 -0
  33. package/src/queries/calls/ListCallStatuses.graphql +26 -0
  34. package/src/queries/candidates/CandidateFields.graphql +28 -0
  35. package/src/queries/candidates/CandidateMutations.graphql +35 -0
  36. package/src/queries/candidates/CandidateQueries.graphql +94 -0
  37. package/src/queries/contacts/ContactMutations.graphql +0 -13
  38. package/src/queries/contacts/GetOrganization.graphql +17 -0
  39. package/src/queries/contacts/ListOrganizations.graphql +21 -0
  40. package/src/queries/contacts/OrganizationMutations.graphql +17 -0
  41. package/src/queries/contracts/ContractQueries.graphql +67 -0
  42. package/src/queries/courses/CourseMutations.graphql +0 -13
  43. package/src/queries/discardable/DiscardableMutations.graphql +32 -0
  44. package/src/queries/expenses/ExpenseFields.graphql +29 -0
  45. package/src/queries/expenses/ExpenseMutations.graphql +81 -0
  46. package/src/queries/expenses/GetExpenseReport.graphql +14 -0
  47. package/src/queries/expenses/ListAnalyticAccounts.graphql +20 -0
  48. package/src/queries/expenses/ListExpenseReports.graphql +22 -0
  49. package/src/queries/field-values/FieldValueFields.graphql +18 -0
  50. package/src/queries/field-values/FieldValueQueries.graphql +43 -0
  51. package/src/queries/forms/FormMutations.graphql +0 -13
  52. package/src/queries/help-center/ChannelMutations.graphql +0 -13
  53. package/src/queries/kb/KbMutations.graphql +0 -26
  54. package/src/queries/meetings/MeetingQueries.graphql +48 -0
  55. package/src/queries/notes/NoteMutations.graphql +0 -13
  56. package/src/queries/people/EmploymentVariationKindMutations.graphql +51 -0
  57. package/src/queries/people/ListEmploymentVariationKinds.graphql +23 -0
  58. package/src/queries/people/PeopleMutations.graphql +0 -13
  59. package/src/queries/reviews/ReviewFields.graphql +35 -0
  60. package/src/queries/reviews/ReviewMutations.graphql +32 -0
  61. package/src/queries/reviews/ReviewQueries.graphql +86 -0
  62. package/src/queries/skills/SkillQueries.graphql +53 -0
  63. package/src/queries/spaces/SpaceMutations.graphql +0 -13
  64. package/src/queries/tasks/TaskMutations.graphql +0 -13
  65. package/src/queries/work-sites/ListWorkSites.graphql +32 -0
  66. package/src/recruiting.test.ts +196 -0
  67. package/src/reviews.ts +114 -0
  68. package/src/skills.ts +47 -0
  69. package/src/work-sites.ts +28 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @uidu/client
2
2
 
3
+ ## 3.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8d0a68e: Move the delete functions of discardable records onto uidu's polymorphic trash.
8
+
9
+ uidu removed the per-entity `deleteX` mutations of discardable records, so
10
+ `deleteContact`, `deleteCourse`, `deleteForm`, `deleteChannel`,
11
+ `deleteKbCollection`, `deleteKbArticle`, `deleteNote`, `deleteEmployment`,
12
+ `deleteSpace` and `deleteTask` failed against the API. They now call
13
+ `discardableDiscard` and move the record to the trash (restorable from uidu for
14
+ 30 days); pass `permanent: true` to call `discardableDelete` and delete it for
15
+ good. Names, the `{ input: { id } }` argument and the
16
+ `{ <entity>: { id } | null, errors }` payload are unchanged.
17
+
18
+ The CLI's `<entity> delete <id>` trashes the same way and takes `--permanent`
19
+ to delete for good.
20
+
21
+ - 6665508: Add the reads and writes a recruiting app needs: `findCandidates`, `getCandidate`, `updateCandidate`, `listPools`, `createPoolContact`; `listReviews`, `getReview`, `createReview` (with or without a cycle: `reviewTemplateId`, `dueOn`), `createReviews`, `updateReview`, `listReviewTemplates`; `listMeetings`, `createMeeting`; `listSkills`, `createSkill`; `listWorkSites`; `listCallStatuses` (a call's application pipeline); `listContracts`, `getContract` with their field values; `getRecordFieldValues`, `listFieldValueHistory` and `fieldValueAsOf` for field values over time (`validFrom`). The uidu skill documents them.
22
+
23
+ ## 3.18.0
24
+
25
+ ### Minor Changes
26
+
27
+ - 461a151: Expense reports. `@uidu/client` adds `listExpenseReports` and
28
+ `getExpenseReport` (each report with its person — `user { id name }` —,
29
+ `paidAt`, custom fields as `fieldValuesByShortname`, and its `expenses` as a
30
+ flat array), `createExpenseReport` / `updateExpenseReport` (addressed by
31
+ `userId`) and `createExpense` / `updateExpense`, both taking custom fields as
32
+ `fieldValues`, a map of the Field's GlobalID to the value. `listAnalyticAccounts`
33
+ and `allocateExpense` book an expense on an analytic account (commessa). Reads
34
+ and writes need an account Bearer token.
35
+ - b26a635: CRM organizations (companies). `@uidu/client` adds `getOrganization`,
36
+ `listOrganizations` and `createOrganization` — an organization is the
37
+ contactable a `Contact` wraps, so its own fields (`name`, `vatCode`,
38
+ `fiscalCode`…) nest under `attributes.organizationAttributes`, same shape as a
39
+ person contact's `userAttributes`. The CLI gets an `organizations` resource
40
+ (`list` / `get` / `create` — no `update`/`delete` yet, the backend doesn't
41
+ flag them as tool keys).
42
+ - a65aac7: Employment variation kinds — the reusable reasons a contract can change
43
+ (hours, pay, level, place, contract, benefits…), picked by a variation's
44
+ `employmentVariationKindId`. `@uidu/client` adds
45
+ `listEmploymentVariationKinds`, `createEmploymentVariationKind` and
46
+ `updateEmploymentVariationKind`. The CLI gets an `employment-variation-kinds`
47
+ resource (`list` / `create` / `update`).
48
+
3
49
  ## 3.17.0
4
50
 
5
51
  ### Minor Changes
@@ -1,6 +1,8 @@
1
1
  import type { UiduClient } from "./client.js";
2
- import { type GetCallQuery, type GetCallQueryVariables, type ListCallsQueryVariables } from "./generated/index.js";
2
+ import { type GetCallQuery, type GetCallQueryVariables, type ListCallStatusesQuery, type ListCallStatusesQueryVariables, type ListCallsQueryVariables } from "./generated/index.js";
3
3
  export type Call = NonNullable<NonNullable<GetCallQuery['currentWorkspace']>['call']>;
4
+ /** One stage of a call's pipeline — what `Application.status` points at. */
5
+ export type CallStatus = NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<ListCallStatusesQuery['currentWorkspace']>['call']>['statuses']>['edges']>[number]>['node']>;
4
6
  /**
5
7
  * One call (a job opening or open call) with its application `form`, same
6
8
  * shape as `getForm`, or null.
@@ -33,3 +35,9 @@ export declare function listCalls(client: UiduClient, variables?: ListCallsQuery
33
35
  city?: string | null;
34
36
  } | null;
35
37
  }[]>;
38
+ /**
39
+ * The pipeline of a call: the statuses its applications move through, sorted
40
+ * by `position`, walking all pages. Move an application along it with
41
+ * `updateApplication` (`attributes.statusId`). Requires a Bearer token.
42
+ */
43
+ export declare function listCallStatuses(client: UiduClient, variables: Omit<ListCallStatusesQueryVariables, 'after'>): Promise<CallStatus[]>;
@@ -0,0 +1,102 @@
1
+ import type { UiduClient } from "./client.js";
2
+ import { type CreatePoolContactMutationVariables, type FindCandidatesQuery, type FindCandidatesQueryVariables, type GetCandidateQuery, type GetCandidateQueryVariables, type ListPoolsQuery, type ListPoolsQueryVariables, type UpdateCandidateMutationVariables } from "./generated/index.js";
3
+ export type CandidateSearch = NonNullable<NonNullable<FindCandidatesQuery['currentWorkspace']>['findCandidates']>;
4
+ export type Candidate = CandidateSearch['candidates'][number];
5
+ export type CandidateDetail = Extract<NonNullable<GetCandidateQuery['node']>, {
6
+ __typename: 'Candidate';
7
+ }>;
8
+ export type Pool = NonNullable<NonNullable<NonNullable<NonNullable<ListPoolsQuery['currentWorkspace']>['pools']['edges']>[number]>['node']>;
9
+ /**
10
+ * Rank the talent pool against a description (`term`) — and, with `callId`,
11
+ * that call's applications too — and return the `candidates`, `applications`
12
+ * and per-record `evidence`, or null when the viewer may not search.
13
+ *
14
+ * This is the only way to list candidates: the workspace has no plain
15
+ * `candidates` connection. A blank `term` with a `callId` uses the call's own
16
+ * words; `near` + `withinKm` keep only those living close enough, and
17
+ * `eligibleFor` only those of an age the contract allows.
18
+ */
19
+ export declare function findCandidates(client: UiduClient, variables?: FindCandidatesQueryVariables): Promise<CandidateSearch | null>;
20
+ /**
21
+ * One candidate by GlobalID, with their applications and the pools they are
22
+ * in, or null.
23
+ */
24
+ export declare function getCandidate(client: UiduClient, variables: GetCandidateQueryVariables): Promise<CandidateDetail | null>;
25
+ /**
26
+ * Update a candidate: pool consent (`poolConsentAt`), `source`, or
27
+ * `extendRetention: true` to push `retainUntil` out by another retention
28
+ * period. Returns the mutation payload as-is (including any `errors`).
29
+ */
30
+ export declare function updateCandidate(client: UiduClient, variables: UpdateCandidateMutationVariables): Promise<{
31
+ __typename?: "UpdateCandidatePayload";
32
+ candidate?: {
33
+ __typename?: "Candidate";
34
+ id: string;
35
+ name?: string | null;
36
+ cvHeadline?: string | null;
37
+ cvSummary?: string | null;
38
+ source: import("./generated/index.js").CandidateSourceEnum;
39
+ poolConsent: boolean;
40
+ poolConsentAt?: any | null;
41
+ retainUntil?: any | null;
42
+ retentionMonths: number;
43
+ lastInteractionAt?: any | null;
44
+ createdAt: any;
45
+ updatedAt: any;
46
+ contact?: {
47
+ __typename?: "Contact";
48
+ id: string;
49
+ name?: string | null;
50
+ email?: string | null;
51
+ } | null;
52
+ user: {
53
+ __typename?: "User";
54
+ id: string;
55
+ name?: string | null;
56
+ email?: string | null;
57
+ };
58
+ pools: Array<{
59
+ __typename?: "Pool";
60
+ id: string;
61
+ name?: string | null;
62
+ }>;
63
+ } | null;
64
+ errors: Array<{
65
+ __typename?: "Error";
66
+ key: string;
67
+ name: string;
68
+ type: string;
69
+ }>;
70
+ } | null>;
71
+ /** The workspace's talent pools with how many contacts each holds; page with `first`/`after`. */
72
+ export declare function listPools(client: UiduClient, variables?: ListPoolsQueryVariables): Promise<Pool[]>;
73
+ /**
74
+ * Add a contact to a pool (`attributes: { poolId, contactId }`). Returns the
75
+ * mutation payload as-is (including any `errors`).
76
+ */
77
+ export declare function createPoolContact(client: UiduClient, variables: CreatePoolContactMutationVariables): Promise<{
78
+ __typename?: "CreatePoolContactPayload";
79
+ poolContact?: {
80
+ __typename?: "PoolContactEdge";
81
+ node?: {
82
+ __typename?: "PoolContact";
83
+ id: string;
84
+ pool: {
85
+ __typename?: "Pool";
86
+ id: string;
87
+ name?: string | null;
88
+ };
89
+ contact: {
90
+ __typename?: "Contact";
91
+ id: string;
92
+ name?: string | null;
93
+ };
94
+ } | null;
95
+ } | null;
96
+ errors: Array<{
97
+ __typename?: "Error";
98
+ key: string;
99
+ name: string;
100
+ type: string;
101
+ }>;
102
+ } | null>;
@@ -1,7 +1,9 @@
1
1
  import type { UiduClient } from "./client.js";
2
- import { type GetContactQuery, type GetContactQueryVariables, type GetDealQuery, type GetDealQueryVariables, type ListDealsQueryVariables } from "./generated/index.js";
2
+ import { type GetContactQuery, type GetContactQueryVariables, type GetDealQuery, type GetDealQueryVariables, type GetOrganizationQuery, type GetOrganizationQueryVariables, type ListDealsQueryVariables, type ListOrganizationsQueryVariables } from "./generated/index.js";
3
3
  export type Contact = NonNullable<NonNullable<GetContactQuery['currentWorkspace']>['contact']>;
4
4
  export type Deal = NonNullable<NonNullable<GetDealQuery['currentWorkspace']>['deal']>;
5
+ /** A CRM organization (company) — the contactable a `Contact` wraps. */
6
+ export type Organization = NonNullable<NonNullable<GetOrganizationQuery['currentWorkspace']>['organization']>;
5
7
  /**
6
8
  * One contact with its address and custom fields (`fieldValuesByShortname`),
7
9
  * or null; a public token sees none.
@@ -50,3 +52,22 @@ export declare function listDeals(client: UiduClient, variables?: ListDealsQuery
50
52
  name?: string | null;
51
53
  } | null;
52
54
  }[]>;
55
+ /**
56
+ * One organization (company) with its fiscal/VAT codes and custom fields, or
57
+ * null.
58
+ */
59
+ export declare function getOrganization(client: UiduClient, variables: GetOrganizationQueryVariables): Promise<Organization | null>;
60
+ /**
61
+ * The workspace's organizations as a flat array, optionally filtered with
62
+ * search `params`; page with `first`/`after`.
63
+ */
64
+ export declare function listOrganizations(client: UiduClient, variables?: ListOrganizationsQueryVariables): Promise<{
65
+ __typename?: "Organization";
66
+ id: string;
67
+ name?: string | null;
68
+ email?: string | null;
69
+ avatar?: string | null;
70
+ fiscalCode?: string | null;
71
+ vatCode?: string | null;
72
+ createdAt: any;
73
+ }[]>;
@@ -0,0 +1,8 @@
1
+ import type { UiduClient } from "./client.js";
2
+ import { type GetContractQuery, type GetContractQueryVariables, type ListContractsQuery, type ListContractsQueryVariables } from "./generated/index.js";
3
+ export type Contract = NonNullable<NonNullable<NonNullable<NonNullable<ListContractsQuery['currentWorkspace']>['contracts']['edges']>[number]>['node']>;
4
+ export type ContractDetail = NonNullable<NonNullable<GetContractQuery['currentWorkspace']>['contract']>;
5
+ /** The workspace's contracts with their custom fields, filtered with `params`; page with `first`/`after`. */
6
+ export declare function listContracts(client: UiduClient, variables?: ListContractsQueryVariables): Promise<Contract[]>;
7
+ /** One contract with its field values and the fields that apply to it, or null. */
8
+ export declare function getContract(client: UiduClient, variables: GetContractQueryVariables): Promise<ContractDetail | null>;
@@ -0,0 +1,169 @@
1
+ import type { UiduClient } from "./client.js";
2
+ import { type CreateAnalyticAccountAllocationMutationVariables, type CreateExpenseMutationVariables, type CreateExpenseReportMutationVariables, type GetExpenseReportQuery, type GetExpenseReportQueryVariables, type ListAnalyticAccountsQuery, type ListAnalyticAccountsQueryVariables, type ListExpenseReportsQueryVariables, type UpdateExpenseMutationVariables, type UpdateExpenseReportMutationVariables } from "./generated/index.js";
3
+ type ExpenseReportRecord = NonNullable<NonNullable<GetExpenseReportQuery['currentWorkspace']>['expenseReport']>;
4
+ export type ExpenseReport = Omit<ExpenseReportRecord, 'expenses'> & {
5
+ expenses: Expense[];
6
+ };
7
+ export type Expense = NonNullable<NonNullable<NonNullable<NonNullable<ExpenseReportRecord['expenses']>['edges']>[number]>['node']>;
8
+ export type AnalyticAccount = NonNullable<NonNullable<NonNullable<NonNullable<ListAnalyticAccountsQuery['currentWorkspace']>['analyticAccounts']>['edges']>[number]>['node'];
9
+ /**
10
+ * The workspace's expense reports, newest first, each with its `expenses` as a
11
+ * flat array; page with `first`/`after`.
12
+ */
13
+ export declare function listExpenseReports(client: UiduClient, variables?: ListExpenseReportsQueryVariables): Promise<ExpenseReport[]>;
14
+ /** One expense report with its `expenses` as a flat array, or null. */
15
+ export declare function getExpenseReport(client: UiduClient, variables: GetExpenseReportQueryVariables): Promise<ExpenseReport | null>;
16
+ /**
17
+ * Create an expense report for a person: `{ input: { attributes: { userId,
18
+ * name, fieldValues } } }`. Returns the payload (with `errors`) or null.
19
+ */
20
+ export declare function createExpenseReport(client: UiduClient, variables: CreateExpenseReportMutationVariables): Promise<{
21
+ __typename?: "CreateExpenseReportPayload";
22
+ expenseReport?: {
23
+ __typename?: "ExpenseReportEdge";
24
+ node?: {
25
+ __typename?: "ExpenseReport";
26
+ id: string;
27
+ name?: string | null;
28
+ paidAt?: any | null;
29
+ fieldValuesByShortname?: any | null;
30
+ createdAt: any;
31
+ updatedAt: any;
32
+ user?: {
33
+ __typename?: "User";
34
+ id: string;
35
+ name?: string | null;
36
+ } | null;
37
+ } | null;
38
+ } | null;
39
+ errors: Array<{
40
+ __typename?: "Error";
41
+ key: string;
42
+ name: string;
43
+ type: string;
44
+ }>;
45
+ } | null>;
46
+ /**
47
+ * Update an expense report — rename it, set `paidAt`, change its custom
48
+ * `fieldValues`. Returns the payload (with `errors`) or null.
49
+ */
50
+ export declare function updateExpenseReport(client: UiduClient, variables: UpdateExpenseReportMutationVariables): Promise<{
51
+ __typename?: "UpdateExpenseReportPayload";
52
+ expenseReport?: {
53
+ __typename?: "ExpenseReport";
54
+ id: string;
55
+ name?: string | null;
56
+ paidAt?: any | null;
57
+ fieldValuesByShortname?: any | null;
58
+ createdAt: any;
59
+ updatedAt: any;
60
+ user?: {
61
+ __typename?: "User";
62
+ id: string;
63
+ name?: string | null;
64
+ } | null;
65
+ } | null;
66
+ errors: Array<{
67
+ __typename?: "Error";
68
+ key: string;
69
+ name: string;
70
+ type: string;
71
+ }>;
72
+ } | null>;
73
+ /**
74
+ * Add an expense to a report: `{ input: { attributes: { expenseReportId,
75
+ * amount, currency, spentAt, category, paymentMethod, fieldValues } } }`, with
76
+ * `amount` in cents. Returns the payload (with `errors`) or null.
77
+ */
78
+ export declare function createExpense(client: UiduClient, variables: CreateExpenseMutationVariables): Promise<{
79
+ __typename?: "CreateExpensePayload";
80
+ expense?: {
81
+ __typename?: "ExpenseEdge";
82
+ node?: {
83
+ __typename?: "Expense";
84
+ id: string;
85
+ amount?: any | null;
86
+ currency?: string | null;
87
+ spentAt?: any | null;
88
+ category?: number | null;
89
+ paymentMethod?: string | null;
90
+ fieldValuesByShortname?: any | null;
91
+ createdAt: any;
92
+ updatedAt: any;
93
+ } | null;
94
+ } | null;
95
+ errors: Array<{
96
+ __typename?: "Error";
97
+ key: string;
98
+ name: string;
99
+ type: string;
100
+ }>;
101
+ } | null>;
102
+ /** Update an expense. Returns the payload (with `errors`) or null. */
103
+ export declare function updateExpense(client: UiduClient, variables: UpdateExpenseMutationVariables): Promise<{
104
+ __typename?: "UpdateExpensePayload";
105
+ expense?: {
106
+ __typename?: "Expense";
107
+ id: string;
108
+ amount?: any | null;
109
+ currency?: string | null;
110
+ spentAt?: any | null;
111
+ category?: number | null;
112
+ paymentMethod?: string | null;
113
+ fieldValuesByShortname?: any | null;
114
+ createdAt: any;
115
+ updatedAt: any;
116
+ } | null;
117
+ errors: Array<{
118
+ __typename?: "Error";
119
+ key: string;
120
+ name: string;
121
+ type: string;
122
+ }>;
123
+ } | null>;
124
+ /**
125
+ * The workspace's analytic accounts (commesse, cost centres) as a flat array —
126
+ * what `allocateExpense` books an expense on. `parentId` narrows to the
127
+ * children of one account; page with `first`/`after`.
128
+ */
129
+ export declare function listAnalyticAccounts(client: UiduClient, variables?: ListAnalyticAccountsQueryVariables): Promise<{
130
+ __typename?: "AnalyticAccount";
131
+ id: string;
132
+ code: string;
133
+ name: string;
134
+ status: import("./generated/index.js").AnalyticAccountStatusEnum;
135
+ currency: string;
136
+ }[]>;
137
+ /**
138
+ * Book an expense (or part of it) on an analytic account: `{ input: {
139
+ * attributes: { allocatableId: expense.id, analyticAccountId, amount } } }`,
140
+ * `amount` in cents, `currency` defaulting to the expense's. Call it once per
141
+ * account to split an expense. Returns the payload (with `errors`) or null.
142
+ */
143
+ export declare function allocateExpense(client: UiduClient, variables: CreateAnalyticAccountAllocationMutationVariables): Promise<{
144
+ __typename?: "CreateAnalyticAccountAllocationPayload";
145
+ analyticAccountAllocation?: {
146
+ __typename?: "AnalyticAccountAllocationEdge";
147
+ node?: {
148
+ __typename?: "AnalyticAccountAllocation";
149
+ id: string;
150
+ amount: number;
151
+ currency: string;
152
+ kind: import("./generated/index.js").AnalyticAccountAllocationKindEnum;
153
+ note?: string | null;
154
+ analyticAccount: {
155
+ __typename?: "AnalyticAccount";
156
+ id: string;
157
+ code: string;
158
+ name: string;
159
+ };
160
+ } | null;
161
+ } | null;
162
+ errors: Array<{
163
+ __typename?: "Error";
164
+ key: string;
165
+ name: string;
166
+ type: string;
167
+ }>;
168
+ } | null>;
169
+ export {};
@@ -0,0 +1,34 @@
1
+ import type { UiduClient } from "./client.js";
2
+ import { type GetRecordFieldValuesQueryVariables, type ListFieldValueHistoryQueryVariables, type RecordFieldValueFragment } from "./generated/index.js";
3
+ export type RecordFieldValue = RecordFieldValueFragment;
4
+ export type RecordFieldValues = {
5
+ /** The record's GraphQL type, e.g. `Contact`, `Contract`, `Employee`. */
6
+ typename: string;
7
+ id: string;
8
+ /** Current values keyed by field shortname. */
9
+ byShortname: Record<string, unknown>;
10
+ /** Current values with their field and dates. */
11
+ fieldValues: RecordFieldValue[];
12
+ };
13
+ /**
14
+ * The current field values of any record that carries custom fields (contact,
15
+ * employee, contract, work site, application…), by GlobalID; null when the id
16
+ * resolves to nothing or to a type without fields.
17
+ */
18
+ export declare function getRecordFieldValues(client: UiduClient, variables: GetRecordFieldValuesQueryVariables): Promise<RecordFieldValues | null>;
19
+ /**
20
+ * Every value `fieldId` has held on the record `modelId`, oldest first, walking
21
+ * all pages. Pair it with {@link fieldValueAsOf} to answer "what did it say on
22
+ * a given day?".
23
+ */
24
+ export declare function listFieldValueHistory(client: UiduClient, variables: Omit<ListFieldValueHistoryQueryVariables, 'after'>): Promise<RecordFieldValue[]>;
25
+ /**
26
+ * The value that held on `date` (an ISO8601 date, default today) among a
27
+ * field's history: the latest `validFrom` not after the date, ties going to
28
+ * the row written last. Null when nothing held yet.
29
+ *
30
+ * The same rule uidu applies server-side for a record's current value; the
31
+ * GraphQL API takes no as-of argument, so reports read the history with
32
+ * {@link listFieldValueHistory} and pick here.
33
+ */
34
+ export declare function fieldValueAsOf(history: readonly RecordFieldValue[], date?: string): RecordFieldValue | null;