@uidu/client 3.5.0 → 3.7.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 +19 -0
- package/codegen.ts +29 -7
- package/dist/declarations/src/bookings.d.ts +1 -1
- package/dist/declarations/src/cms.d.ts +8 -1
- package/dist/declarations/src/generated/index.d.ts +8912 -270
- package/dist/declarations/src/help-center.d.ts +12 -1
- package/dist/declarations/src/index.d.ts +2 -2
- package/dist/declarations/src/mutations.d.ts +15 -3
- package/dist/declarations/src/people.d.ts +16 -1
- package/dist/uidu-client.cjs.dev.js +24 -2
- package/dist/uidu-client.cjs.prod.js +24 -2
- package/dist/uidu-client.esm.js +23 -3
- package/package.json +1 -1
- package/src/cms.ts +11 -0
- package/src/generated/index.ts +10098 -304
- package/src/help-center.ts +16 -0
- package/src/index.ts +2 -1
- package/src/people.test.ts +3 -0
- package/src/people.ts +12 -1
- package/src/queries/cms/ListProjects.graphql +17 -0
- package/src/queries/help-center/ListChannels.graphql +17 -0
- package/src/queries/people/GetEmployee.graphql +4 -1
- package/src/queries/people/ListEmployees.graphql +4 -1
- package/src/queries/people/ListEmploymentHistory.graphql +4 -1
- package/src/queries/people/PeopleMutations.graphql +8 -2
package/src/help-center.ts
CHANGED
|
@@ -3,7 +3,10 @@ import {
|
|
|
3
3
|
GetChannelDocument,
|
|
4
4
|
type GetChannelQuery,
|
|
5
5
|
type GetChannelQueryVariables,
|
|
6
|
+
ListChannelsDocument,
|
|
7
|
+
type ListChannelsQueryVariables,
|
|
6
8
|
} from './generated';
|
|
9
|
+
import { nodes } from './utils/relay';
|
|
7
10
|
|
|
8
11
|
export type Channel = NonNullable<
|
|
9
12
|
NonNullable<GetChannelQuery['currentWorkspace']>['channel']
|
|
@@ -16,3 +19,16 @@ export async function getChannel(
|
|
|
16
19
|
const result = await client.query(GetChannelDocument, variables);
|
|
17
20
|
return result.currentWorkspace?.channel ?? null;
|
|
18
21
|
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The workspace's help center channels. `isDefault` marks the one the
|
|
25
|
+
* workspace treats as its main channel — a caller that has no channel id
|
|
26
|
+
* configured should prefer it over the first row.
|
|
27
|
+
*/
|
|
28
|
+
export async function listChannels(
|
|
29
|
+
client: UiduClient,
|
|
30
|
+
variables: ListChannelsQueryVariables = {},
|
|
31
|
+
) {
|
|
32
|
+
const result = await client.query(ListChannelsDocument, variables);
|
|
33
|
+
return nodes(result.currentWorkspace?.channels);
|
|
34
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ export {
|
|
|
40
40
|
createPage,
|
|
41
41
|
createPageBlock,
|
|
42
42
|
createFieldValue,
|
|
43
|
+
listProjects,
|
|
43
44
|
} from './cms';
|
|
44
45
|
export type { Page, Template } from './cms';
|
|
45
46
|
|
|
@@ -98,7 +99,7 @@ export {
|
|
|
98
99
|
} from './forms';
|
|
99
100
|
export type { Form } from './forms';
|
|
100
101
|
|
|
101
|
-
export { getChannel } from './help-center';
|
|
102
|
+
export { getChannel, listChannels } from './help-center';
|
|
102
103
|
export type { Channel } from './help-center';
|
|
103
104
|
|
|
104
105
|
export { search } from './search';
|
package/src/people.test.ts
CHANGED
|
@@ -81,6 +81,7 @@ describe('contractEvents', () => {
|
|
|
81
81
|
endDate: '2025-03-31',
|
|
82
82
|
endReason: 'contract_end',
|
|
83
83
|
jobTitle: 'Senior Dev',
|
|
84
|
+
employmentKind: { id: 'ek1', name: 'determinato' },
|
|
84
85
|
contractType: 'determinato',
|
|
85
86
|
ccnl: null,
|
|
86
87
|
compensations: [],
|
|
@@ -91,6 +92,7 @@ describe('contractEvents', () => {
|
|
|
91
92
|
endDate: null,
|
|
92
93
|
endReason: null,
|
|
93
94
|
jobTitle: 'Dev',
|
|
95
|
+
employmentKind: { id: 'ek2', name: 'indeterminato' },
|
|
94
96
|
contractType: 'indeterminato',
|
|
95
97
|
ccnl: null,
|
|
96
98
|
compensations: [],
|
|
@@ -107,6 +109,7 @@ describe('contractEvents', () => {
|
|
|
107
109
|
endDate: null,
|
|
108
110
|
endReason: null,
|
|
109
111
|
jobTitle: null,
|
|
112
|
+
employmentKind: null,
|
|
110
113
|
contractType: null,
|
|
111
114
|
ccnl: null,
|
|
112
115
|
compensations: [],
|
package/src/people.ts
CHANGED
|
@@ -158,6 +158,14 @@ export type EmploymentRecord = {
|
|
|
158
158
|
endDate: string | null;
|
|
159
159
|
endReason: string | null;
|
|
160
160
|
jobTitle: string | null;
|
|
161
|
+
/**
|
|
162
|
+
* The contract type, as a record. It used to be a free string on the
|
|
163
|
+
* employment (`contractType`); uidu promoted it to `EmploymentKind` so a
|
|
164
|
+
* workspace can configure its own, which is why writes take
|
|
165
|
+
* `employmentKindId`.
|
|
166
|
+
*/
|
|
167
|
+
employmentKind: { id: string; name: string | null } | null;
|
|
168
|
+
/** The contract type's name — `employmentKind.name`, kept flat for display. */
|
|
161
169
|
contractType: string | null;
|
|
162
170
|
/** The CCNL (national collective labor contract) that applies, if any. */
|
|
163
171
|
ccnl: { id: string; name: string | null } | null;
|
|
@@ -194,7 +202,10 @@ export async function listEmploymentHistory(
|
|
|
194
202
|
endDate: e.endDate ?? null,
|
|
195
203
|
endReason: e.endReason ?? null,
|
|
196
204
|
jobTitle: e.jobTitle ?? null,
|
|
197
|
-
|
|
205
|
+
employmentKind: e.employmentKind
|
|
206
|
+
? { id: e.employmentKind.id ?? '', name: e.employmentKind.name ?? null }
|
|
207
|
+
: null,
|
|
208
|
+
contractType: e.employmentKind?.name ?? null,
|
|
198
209
|
ccnl: e.ccnl ? { id: e.ccnl.id ?? '', name: e.ccnl.name ?? null } : null,
|
|
199
210
|
compensations: nodes(e.compensations)
|
|
200
211
|
.map((c) => ({
|
|
@@ -39,7 +39,10 @@ mutation CreateEmployment($input: CreateEmploymentInput!) {
|
|
|
39
39
|
node {
|
|
40
40
|
id
|
|
41
41
|
jobTitle
|
|
42
|
-
|
|
42
|
+
employmentKind {
|
|
43
|
+
id
|
|
44
|
+
name
|
|
45
|
+
}
|
|
43
46
|
classification
|
|
44
47
|
startDate
|
|
45
48
|
endDate
|
|
@@ -59,7 +62,10 @@ mutation UpdateEmployment($input: UpdateEmploymentInput!) {
|
|
|
59
62
|
employment {
|
|
60
63
|
id
|
|
61
64
|
jobTitle
|
|
62
|
-
|
|
65
|
+
employmentKind {
|
|
66
|
+
id
|
|
67
|
+
name
|
|
68
|
+
}
|
|
63
69
|
classification
|
|
64
70
|
startDate
|
|
65
71
|
endDate
|