@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @uidu/client
|
|
2
2
|
|
|
3
|
+
## 3.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7756c71: Add `listProjects` and `listChannels`, and expose them as the `projects` and
|
|
8
|
+
`channel` CLI resources' `list` verb. A caller that needs a project id for
|
|
9
|
+
`getPage`, or a help-center channel id, can now find one instead of being told
|
|
10
|
+
it — the demo used to carry a production workspace's GlobalIDs for both.
|
|
11
|
+
|
|
12
|
+
## 3.6.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- 526792f: `Employment.contractType` is gone from the API — uidu promoted the contract
|
|
17
|
+
type to a configurable `EmploymentKind` record. The people documents now select
|
|
18
|
+
`employmentKind { id name }`, `EmploymentRecord` carries it, and
|
|
19
|
+
`contractType` stays as its name so existing readers keep working. Writes take
|
|
20
|
+
`employmentKindId`.
|
|
21
|
+
|
|
3
22
|
## 3.5.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
package/codegen.ts
CHANGED
|
@@ -22,14 +22,36 @@ const publicToken = process.env.UIDU_PUBLIC_TOKEN ?? '';
|
|
|
22
22
|
const endpoint =
|
|
23
23
|
process.env.UIDU_GRAPHQL_ENDPOINT ?? `https://${workspace}.uidu.org/graphql`;
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* The SDL from a `uidu` checkout beside this one, when there is one.
|
|
27
|
+
*
|
|
28
|
+
* Reading the schema over HTTPS is not available everywhere this runs: the
|
|
29
|
+
* cloud sandbox the SDK sync routine lives in is denied at the proxy (403 on
|
|
30
|
+
* CONNECT to uidu.uidu.org), and no token fixes that — it never reaches the
|
|
31
|
+
* TLS handshake. It clones the organisation's repos instead, and
|
|
32
|
+
* `app/graphql/schema.graphql` is committed there, regenerated by
|
|
33
|
+
* `rake schema:dump`. Same source the live endpoint would serve, one deploy
|
|
34
|
+
* earlier at worst.
|
|
35
|
+
*
|
|
36
|
+
* `UIDU_SCHEMA` overrides the path; delete or move the checkout to force the
|
|
37
|
+
* endpoint.
|
|
38
|
+
*/
|
|
39
|
+
const localSchema = [
|
|
40
|
+
process.env.UIDU_SCHEMA,
|
|
41
|
+
resolve(process.cwd(), '../../../uidu/app/graphql/schema.graphql'),
|
|
42
|
+
resolve(process.cwd(), '../../uidu/app/graphql/schema.graphql'),
|
|
43
|
+
].find((path) => path && existsSync(path));
|
|
44
|
+
|
|
25
45
|
const config: CodegenConfig = {
|
|
26
|
-
schema:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
46
|
+
schema: localSchema
|
|
47
|
+
? [localSchema]
|
|
48
|
+
: [
|
|
49
|
+
{
|
|
50
|
+
[endpoint]: {
|
|
51
|
+
headers: publicToken ? { 'X-Uidu-Public-Token': publicToken } : {},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
33
55
|
documents: ['src/**/*.graphql'],
|
|
34
56
|
generates: {
|
|
35
57
|
'src/generated/index.ts': {
|
|
@@ -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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UiduClient } from "./client.js";
|
|
2
|
-
import { type CreateFieldValueMutationVariables, type CreatePageBlockMutationVariables, type CreatePageMutationVariables, type CreateProjectMutationVariables, type GetPageQuery, type GetPageQueryVariables, type GetTemplateQuery, type GetTemplateQueryVariables, type ListPagesQueryVariables } from "./generated/index.js";
|
|
2
|
+
import { type CreateFieldValueMutationVariables, type CreatePageBlockMutationVariables, type CreatePageMutationVariables, type CreateProjectMutationVariables, type GetPageQuery, type GetPageQueryVariables, type GetTemplateQuery, type GetTemplateQueryVariables, type ListProjectsQueryVariables, type ListPagesQueryVariables } from "./generated/index.js";
|
|
3
3
|
export type Page = NonNullable<NonNullable<NonNullable<GetPageQuery['currentWorkspace']>['project']>['page']>;
|
|
4
4
|
export type Template = NonNullable<NonNullable<NonNullable<GetTemplateQuery['currentWorkspace']>['project']>['template']>;
|
|
5
5
|
export declare function getPage(client: UiduClient, variables: GetPageQueryVariables): Promise<Page | null>;
|
|
@@ -73,3 +73,10 @@ export declare function createFieldValue(client: UiduClient, variables: CreateFi
|
|
|
73
73
|
type: string;
|
|
74
74
|
}>;
|
|
75
75
|
} | null>;
|
|
76
|
+
/** The workspace's CMS projects. A page lives in one, and `getPage` needs its id. */
|
|
77
|
+
export declare function listProjects(client: UiduClient, variables?: ListProjectsQueryVariables): Promise<{
|
|
78
|
+
__typename?: "Project";
|
|
79
|
+
id: string;
|
|
80
|
+
name?: string | null;
|
|
81
|
+
slug?: string | null;
|
|
82
|
+
}[]>;
|