@uidu/client 3.4.1 → 3.6.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 +36 -0
- package/dist/declarations/src/bookings.d.ts +1 -1
- package/dist/declarations/src/generated/index.d.ts +8635 -263
- package/dist/declarations/src/index.d.ts +4 -3
- package/dist/declarations/src/mutations.d.ts +15 -3
- package/dist/declarations/src/people.d.ts +16 -1
- package/dist/declarations/src/utils/fieldValues.d.ts +37 -0
- package/dist/uidu-client.cjs.dev.js +137 -3
- package/dist/uidu-client.cjs.prod.js +137 -3
- package/dist/uidu-client.esm.js +136 -4
- package/package.json +1 -1
- package/src/client.test.ts +165 -0
- package/src/client.ts +5 -1
- package/src/generated/index.ts +9837 -297
- package/src/index.ts +8 -15
- package/src/people.test.ts +3 -0
- package/src/people.ts +12 -1
- 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/utils/fieldValues.test.ts +268 -0
- package/src/utils/fieldValues.ts +164 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @uidu/client
|
|
2
2
|
|
|
3
|
+
## 3.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 526792f: `Employment.contractType` is gone from the API — uidu promoted the contract
|
|
8
|
+
type to a configurable `EmploymentKind` record. The people documents now select
|
|
9
|
+
`employmentKind { id name }`, `EmploymentRecord` carries it, and
|
|
10
|
+
`contractType` stays as its name so existing readers keep working. Writes take
|
|
11
|
+
`employmentKindId`.
|
|
12
|
+
|
|
13
|
+
## 3.5.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- 45e1997: Normalize `fieldValuesAttributes[].content` on every mutation.
|
|
18
|
+
|
|
19
|
+
The API stores each field value as JSON and reads it back as `content['value']`,
|
|
20
|
+
so `content` must always be `{ value: … }`. A bare scalar wasn't rejected at the
|
|
21
|
+
mutation boundary — the record saved, the server-side typed columns stayed
|
|
22
|
+
empty, and later reads of that field errored out. Code-generating agents hit
|
|
23
|
+
this constantly, since `FieldValueAttributes.content` is typed as an untyped
|
|
24
|
+
`JSON` scalar.
|
|
25
|
+
|
|
26
|
+
`UiduClient.mutate` now wraps a bare `content` in `{ value }` before sending,
|
|
27
|
+
and warns once per mutation outside production so the call site gets fixed.
|
|
28
|
+
Doing it in `mutate` rather than per function covers all ~50 authoring
|
|
29
|
+
mutations and reaches `fieldValuesAttributes` wherever it nests — under
|
|
30
|
+
`contactAttributes.contactableAttributes`, inside `pageBlocksAttributes[]`, and
|
|
31
|
+
on the 15 other `*Attributes` types that carry it. Already-wrapped payloads,
|
|
32
|
+
`content` payloads themselves, the caller's object, and every untouched subtree
|
|
33
|
+
are left alone by reference. Reads (`query`) are unaffected.
|
|
34
|
+
|
|
35
|
+
The helpers are exported as `normalizeFieldValueContent` and
|
|
36
|
+
`normalizeFieldValuesAttributes` for callers that assemble
|
|
37
|
+
`fieldValuesAttributes` outside the SDK.
|
|
38
|
+
|
|
3
39
|
## 3.4.1
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
|
@@ -8,7 +8,7 @@ export declare function listBookings(client: UiduClient, variables?: ListBooking
|
|
|
8
8
|
__typename?: "Booking";
|
|
9
9
|
id: string;
|
|
10
10
|
kind?: string | null;
|
|
11
|
-
status?:
|
|
11
|
+
status?: string | null;
|
|
12
12
|
number?: string | null;
|
|
13
13
|
currency?: string | null;
|
|
14
14
|
itemsCount?: number | null;
|