@uidu/client 3.11.0 → 3.13.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 +24 -0
- package/dist/declarations/src/applications.d.ts +56 -3
- package/dist/declarations/src/generated/index.d.ts +3147 -169
- package/dist/declarations/src/goals.d.ts +127 -0
- package/dist/declarations/src/index.d.ts +6 -4
- package/dist/declarations/src/mutations.d.ts +20 -1
- package/dist/declarations/src/sites.d.ts +23 -1
- package/dist/uidu-client.cjs.dev.js +154 -3
- package/dist/uidu-client.cjs.prod.js +154 -3
- package/dist/uidu-client.esm.js +140 -4
- package/package.json +1 -1
- package/src/applications.test.ts +42 -0
- package/src/applications.ts +31 -2
- package/src/generated/index.ts +2613 -173
- package/src/goals.test.ts +90 -0
- package/src/goals.ts +144 -0
- package/src/index.ts +22 -1
- package/src/mutations.ts +7 -0
- package/src/queries/applications/UpdateApplication.graphql +17 -0
- package/src/queries/goals/GetGoal.graphql +14 -0
- package/src/queries/goals/GoalFields.graphql +28 -0
- package/src/queries/goals/GoalMutations.graphql +12 -0
- package/src/queries/goals/ListGoals.graphql +15 -0
- package/src/queries/goals/ListTimeframes.graphql +20 -0
- package/src/queries/people/TimeClockMutations.graphql +17 -0
- package/src/queries/sites/CreateSite.graphql +15 -0
- package/src/sites.test.ts +26 -0
- package/src/sites.ts +17 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { UiduClient } from "./client.js";
|
|
2
|
+
import { type GetGoalQuery, type GetGoalQueryVariables, type ListGoalsQueryVariables, type ListTimeframesQuery, type ListTimeframesQueryVariables, type UpdateGoalMutationVariables } from "./generated/index.js";
|
|
3
|
+
export type Goal = NonNullable<NonNullable<GetGoalQuery['currentWorkspace']>['goal']>;
|
|
4
|
+
export type Timeframe = NonNullable<NonNullable<NonNullable<NonNullable<ListTimeframesQuery['currentWorkspace']>['timeframes']>['edges']>[number]>['node'];
|
|
5
|
+
/** Every goal of the workspace (objectives and key results alike), newest first. Without `first`, all of them. */
|
|
6
|
+
export declare function listGoals(client: UiduClient, variables?: ListGoalsQueryVariables): Promise<{
|
|
7
|
+
__typename?: "Goal";
|
|
8
|
+
id: string;
|
|
9
|
+
name?: string | null;
|
|
10
|
+
description?: any | null;
|
|
11
|
+
kind?: import("./generated/index.js").GoalKind | null;
|
|
12
|
+
metricKind?: string | null;
|
|
13
|
+
status?: string | null;
|
|
14
|
+
currency?: string | null;
|
|
15
|
+
initialValue?: number | null;
|
|
16
|
+
currentValue?: number | null;
|
|
17
|
+
targetValue?: number | null;
|
|
18
|
+
progress?: number | null;
|
|
19
|
+
weight?: number | null;
|
|
20
|
+
updateFrequency?: string | null;
|
|
21
|
+
parentId?: string | null;
|
|
22
|
+
subgoalsCount?: number | null;
|
|
23
|
+
createdAt: any;
|
|
24
|
+
updatedAt: any;
|
|
25
|
+
timeframe?: {
|
|
26
|
+
__typename?: "Timeframe";
|
|
27
|
+
id: string;
|
|
28
|
+
name?: string | null;
|
|
29
|
+
startDate?: any | null;
|
|
30
|
+
endDate?: any | null;
|
|
31
|
+
} | null;
|
|
32
|
+
}[]>;
|
|
33
|
+
/** One goal with its key results (`subgoals`). */
|
|
34
|
+
export declare function getGoal(client: UiduClient, variables: GetGoalQueryVariables): Promise<Goal | null>;
|
|
35
|
+
export declare function listTimeframes(client: UiduClient, variables?: ListTimeframesQueryVariables): Promise<{
|
|
36
|
+
__typename?: "Timeframe";
|
|
37
|
+
id: string;
|
|
38
|
+
name?: string | null;
|
|
39
|
+
startDate?: any | null;
|
|
40
|
+
endDate?: any | null;
|
|
41
|
+
year?: number | null;
|
|
42
|
+
active?: boolean | null;
|
|
43
|
+
}[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Authoring (Bearer / apiKey). Returns the payload, incl. `errors`.
|
|
46
|
+
* `initialValue` / `currentValue` / `targetValue` are stored x100: pass
|
|
47
|
+
* `toGoalRaw(value)`, never the number a person typed.
|
|
48
|
+
*/
|
|
49
|
+
export declare function updateGoal(client: UiduClient, variables: UpdateGoalMutationVariables): Promise<{
|
|
50
|
+
__typename?: "UpdateGoalPayload";
|
|
51
|
+
goal?: {
|
|
52
|
+
__typename?: "Goal";
|
|
53
|
+
id: string;
|
|
54
|
+
name?: string | null;
|
|
55
|
+
description?: any | null;
|
|
56
|
+
kind?: import("./generated/index.js").GoalKind | null;
|
|
57
|
+
metricKind?: string | null;
|
|
58
|
+
status?: string | null;
|
|
59
|
+
currency?: string | null;
|
|
60
|
+
initialValue?: number | null;
|
|
61
|
+
currentValue?: number | null;
|
|
62
|
+
targetValue?: number | null;
|
|
63
|
+
progress?: number | null;
|
|
64
|
+
weight?: number | null;
|
|
65
|
+
updateFrequency?: string | null;
|
|
66
|
+
parentId?: string | null;
|
|
67
|
+
subgoalsCount?: number | null;
|
|
68
|
+
createdAt: any;
|
|
69
|
+
updatedAt: any;
|
|
70
|
+
timeframe?: {
|
|
71
|
+
__typename?: "Timeframe";
|
|
72
|
+
id: string;
|
|
73
|
+
name?: string | null;
|
|
74
|
+
startDate?: any | null;
|
|
75
|
+
endDate?: any | null;
|
|
76
|
+
} | null;
|
|
77
|
+
} | null;
|
|
78
|
+
errors: Array<{
|
|
79
|
+
__typename?: "Error";
|
|
80
|
+
key: string;
|
|
81
|
+
name: string;
|
|
82
|
+
type: string;
|
|
83
|
+
}>;
|
|
84
|
+
} | null>;
|
|
85
|
+
type GoalMetric = {
|
|
86
|
+
metricKind?: string | null;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* A stored goal value (`initialValue`, `currentValue`, `targetValue`) in the
|
|
90
|
+
* unit a person typed: uidu keeps every one of them x100. For `percentage`
|
|
91
|
+
* that is percent points (45 = 45%), for `currency` whole units of
|
|
92
|
+
* `goal.currency`, for `checkbox` 1 or 0. `null` stays `null`.
|
|
93
|
+
*/
|
|
94
|
+
export declare function goalValue(goal: GoalMetric, raw: number | null | undefined): number | null;
|
|
95
|
+
/** The inverse of `goalValue`, for `updateGoal`. */
|
|
96
|
+
export declare function toGoalRaw(value: number): number;
|
|
97
|
+
/**
|
|
98
|
+
* How far the goal is, 0 to 1 (above 1 when it overshoots). `goal.progress`
|
|
99
|
+
* itself is percent x100: 10000 is done.
|
|
100
|
+
*/
|
|
101
|
+
export declare function goalProgress(goal: {
|
|
102
|
+
progress?: number | null;
|
|
103
|
+
}): number;
|
|
104
|
+
/**
|
|
105
|
+
* How much of the goal's timeframe has passed, 0 to 1, or `null` when it has
|
|
106
|
+
* none. A goal whose `goalProgress` is below this is behind schedule.
|
|
107
|
+
*/
|
|
108
|
+
export declare function goalTimeElapsed(goal: {
|
|
109
|
+
timeframe?: {
|
|
110
|
+
startDate?: string | null;
|
|
111
|
+
endDate?: string | null;
|
|
112
|
+
} | null;
|
|
113
|
+
}, now?: Date): number | null;
|
|
114
|
+
/**
|
|
115
|
+
* Behind schedule: less done than time elapsed, by more than `tolerance`
|
|
116
|
+
* (0.1 = ten points). `false` for a goal with no timeframe or one already
|
|
117
|
+
* accomplished. The goal's own `status` (`off_track`, `needs_attention`) is
|
|
118
|
+
* its owner's judgement — show it next to this, don't replace one with the other.
|
|
119
|
+
*/
|
|
120
|
+
export declare function isGoalBehind(goal: Parameters<typeof goalTimeElapsed>[0] & {
|
|
121
|
+
progress?: number | null;
|
|
122
|
+
status?: string | null;
|
|
123
|
+
}, { now, tolerance }?: {
|
|
124
|
+
now?: Date;
|
|
125
|
+
tolerance?: number;
|
|
126
|
+
}): boolean;
|
|
127
|
+
export {};
|
|
@@ -4,10 +4,10 @@ export type { UiduClientConfig, UiduErrorOptions } from "./types.js";
|
|
|
4
4
|
export { paginate } from "./utils/paginate.js";
|
|
5
5
|
export type { PaginateOptions } from "./utils/paginate.js";
|
|
6
6
|
export { normalizeFieldValueContent, normalizeFieldValuesAttributes, } from "./utils/fieldValues.js";
|
|
7
|
-
export { ListApplicationsDocument, ListBookingsDocument, ListCalendarsDocument, ListCalendarEventsDocument, ListCallsDocument, ListCampaignsDocument, ListEmailCampaignsDocument, ListCoursesDocument, ListDealsDocument, ListDonationCampaignsDocument, ListEmployeesDocument, ListEnrollmentsDocument, ListEventsDocument, ListFormsDocument, ListKbArticlesDocument, ListKbCollectionsDocument, ListLecturesDocument, ListPagesDocument, ListStoriesDocument, } from "./generated/index.js";
|
|
7
|
+
export { ListApplicationsDocument, ListBookingsDocument, ListCalendarsDocument, ListCalendarEventsDocument, ListCallsDocument, ListCampaignsDocument, ListEmailCampaignsDocument, ListCoursesDocument, ListDealsDocument, ListDonationCampaignsDocument, ListEmployeesDocument, ListEnrollmentsDocument, ListEventsDocument, ListFormsDocument, ListGoalsDocument, ListKbArticlesDocument, ListKbCollectionsDocument, ListLecturesDocument, ListPagesDocument, ListStoriesDocument, ListTimeframesDocument, } from "./generated/index.js";
|
|
8
8
|
export { getPage, listPages, getTemplate, createProject, createPage, createPageBlock, createFieldValue, listProjects, } from "./cms.js";
|
|
9
9
|
export type { Page, Template } from "./cms.js";
|
|
10
|
-
export { getSiteByDomain, getSite, getPageBySlug, listSitePages, getSingletonBlock, } from "./sites.js";
|
|
10
|
+
export { getSiteByDomain, getSite, getPageBySlug, listSitePages, getSingletonBlock, createSite, } from "./sites.js";
|
|
11
11
|
export type { Site, SiteModel, SiteFields, SiteBlock, SitePage, SitePageSummary, } from "./sites.js";
|
|
12
12
|
export { createWorkspace, generateWorkspaceApiCredentials } from "./system.js";
|
|
13
13
|
export { createSpace } from "./spaces.js";
|
|
@@ -16,7 +16,7 @@ export { createNote } from "./notes.js";
|
|
|
16
16
|
export { executeAction } from "./actions.js";
|
|
17
17
|
export { createBenefit } from "./benefits.js";
|
|
18
18
|
export { createBenefitEnrollment } from "./benefit-enrollments.js";
|
|
19
|
-
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, createCompensation, updateCompensation, deleteCompensation, } from "./mutations.js";
|
|
19
|
+
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, createCompensation, updateCompensation, deleteCompensation, createTimeClock, } from "./mutations.js";
|
|
20
20
|
export { getForm, listForms, createFormResponse, updateFormResponse, } from "./forms.js";
|
|
21
21
|
export type { Form } from "./forms.js";
|
|
22
22
|
export { getChannel, listChannels } from "./help-center.js";
|
|
@@ -29,7 +29,7 @@ export { getCall, listCalls } from "./calls.js";
|
|
|
29
29
|
export type { Call } from "./calls.js";
|
|
30
30
|
export { getJob, listJobs } from "./jobs.js";
|
|
31
31
|
export type { Job } from "./jobs.js";
|
|
32
|
-
export { listApplications, createApplication } from "./applications.js";
|
|
32
|
+
export { listApplications, createApplication, updateApplication, completeApplication, } from "./applications.js";
|
|
33
33
|
export type { Application } from "./applications.js";
|
|
34
34
|
export { getDonationCampaign, listDonationCampaigns, createDonation, createDonationCampaign, } from "./donations.js";
|
|
35
35
|
export type { DonationCampaign } from "./donations.js";
|
|
@@ -45,6 +45,8 @@ export { getCampaign, listCampaigns, listEmailCampaigns } from "./campaigns.js";
|
|
|
45
45
|
export type { Campaign } from "./campaigns.js";
|
|
46
46
|
export { getContact, listContacts, getDeal, listDeals } from "./contacts.js";
|
|
47
47
|
export type { Contact, Deal } from "./contacts.js";
|
|
48
|
+
export { listGoals, getGoal, listTimeframes, updateGoal, goalValue, toGoalRaw, goalProgress, goalTimeElapsed, isGoalBehind, } from "./goals.js";
|
|
49
|
+
export type { Goal, Timeframe } from "./goals.js";
|
|
48
50
|
export { getKbArticle, listKbArticles, getKbCollection, listKbCollections, } from "./kb.js";
|
|
49
51
|
export type { KbArticle, KbCollection } from "./kb.js";
|
|
50
52
|
export { listModels, getModel, listModelItems, getModelItem, createModel, updateModel, createField, updateField, deleteField, createFieldOption, updateFieldOption, deleteFieldOption, createModelItem, updateModelItem, deleteModelItem, updateFieldValue, deleteFieldValue, toFieldValuesAttributes, ensureModel, } from "./models.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UiduClient } from "./client.js";
|
|
2
|
-
import { type CreateChannelMutationVariables, type CreateContactMutationVariables, type CreateCourseMutationVariables, type CreateCompensationMutationVariables, type CreateDealMutationVariables, type CreateEmployeeMutationVariables, type CreateEmploymentMutationVariables, type CreateFormMutationVariables, type CreateKbArticleMutationVariables, type CreateKbCollectionMutationVariables, type DeleteChannelMutationVariables, type DeleteContactMutationVariables, type DeleteCourseMutationVariables, type DeleteCompensationMutationVariables, type DeleteDonationCampaignMutationVariables, type DeleteEmploymentMutationVariables, type DeleteFormMutationVariables, type DeleteKbArticleMutationVariables, type DeleteKbCollectionMutationVariables, type DeleteNoteMutationVariables, type DeleteSpaceMutationVariables, type DeleteTaskMutationVariables, type UpdateChannelMutationVariables, type UpdateCompensationMutationVariables, 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";
|
|
2
|
+
import { type CreateChannelMutationVariables, type CreateContactMutationVariables, type CreateCourseMutationVariables, type CreateCompensationMutationVariables, type CreateDealMutationVariables, type CreateEmployeeMutationVariables, type CreateEmploymentMutationVariables, type CreateFormMutationVariables, type CreateKbArticleMutationVariables, type CreateKbCollectionMutationVariables, type CreateTimeClockMutationVariables, type DeleteChannelMutationVariables, type DeleteContactMutationVariables, type DeleteCourseMutationVariables, type DeleteCompensationMutationVariables, type DeleteDonationCampaignMutationVariables, type DeleteEmploymentMutationVariables, type DeleteFormMutationVariables, type DeleteKbArticleMutationVariables, type DeleteKbCollectionMutationVariables, type DeleteNoteMutationVariables, type DeleteSpaceMutationVariables, type DeleteTaskMutationVariables, type UpdateChannelMutationVariables, type UpdateCompensationMutationVariables, 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?: {
|
|
@@ -269,6 +269,25 @@ export declare function terminateEmployment(c: UiduClient, args: {
|
|
|
269
269
|
type: string;
|
|
270
270
|
}>;
|
|
271
271
|
} | null>;
|
|
272
|
+
export declare function createTimeClock(c: UiduClient, v: CreateTimeClockMutationVariables): Promise<{
|
|
273
|
+
__typename?: "CreateTimeClockPayload";
|
|
274
|
+
timeClock?: {
|
|
275
|
+
__typename?: "TimeClockEdge";
|
|
276
|
+
node?: {
|
|
277
|
+
__typename?: "TimeClock";
|
|
278
|
+
id: string;
|
|
279
|
+
beginsAt?: any | null;
|
|
280
|
+
finishesAt?: any | null;
|
|
281
|
+
kind?: number | null;
|
|
282
|
+
} | null;
|
|
283
|
+
} | null;
|
|
284
|
+
errors: Array<{
|
|
285
|
+
__typename?: "Error";
|
|
286
|
+
key: string;
|
|
287
|
+
name: string;
|
|
288
|
+
type: string;
|
|
289
|
+
}>;
|
|
290
|
+
} | null>;
|
|
272
291
|
export declare function createCompensation(c: UiduClient, v: CreateCompensationMutationVariables): Promise<{
|
|
273
292
|
__typename?: "CreateCompensationPayload";
|
|
274
293
|
compensation?: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UiduClient } from "./client.js";
|
|
2
|
-
import { type PublishableStatus, type SiteFieldsFragment, type SiteModelFieldsFragment } from "./generated/index.js";
|
|
2
|
+
import { type CreateSiteMutationVariables, type PublishableStatus, type SiteFieldsFragment, type SiteModelFieldsFragment } from "./generated/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* The new CMS: a Site, its page types (page-kind Models), its pages
|
|
5
5
|
* (ModelItems of those Models) and the blocks placed on each page (block-kind
|
|
@@ -79,3 +79,25 @@ export declare function getSingletonBlock(client: UiduClient, variables: {
|
|
|
79
79
|
siteId: string;
|
|
80
80
|
shortname: string;
|
|
81
81
|
}): Promise<SitePage | null>;
|
|
82
|
+
/**
|
|
83
|
+
* Provisions a new Site in the workspace/account (`tenantId`). Bearer token
|
|
84
|
+
* (`apiKey`) — this is workspace admin territory, never a public write.
|
|
85
|
+
* Returns the mutation payload as-is, including `errors`.
|
|
86
|
+
*/
|
|
87
|
+
export declare function createSite(client: UiduClient, variables: CreateSiteMutationVariables): Promise<{
|
|
88
|
+
__typename?: "CreateSitePayload";
|
|
89
|
+
site?: {
|
|
90
|
+
__typename?: "SiteEdge";
|
|
91
|
+
node?: {
|
|
92
|
+
__typename?: "Site";
|
|
93
|
+
id: string;
|
|
94
|
+
name?: string | null;
|
|
95
|
+
} | null;
|
|
96
|
+
} | null;
|
|
97
|
+
errors: Array<{
|
|
98
|
+
__typename?: "Error";
|
|
99
|
+
key: string;
|
|
100
|
+
name: string;
|
|
101
|
+
type: string;
|
|
102
|
+
}>;
|
|
103
|
+
} | null>;
|