@uidu/client 3.0.0 → 3.1.1
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 +17 -0
- package/README.md +56 -0
- package/dist/declarations/src/bookings.d.ts +58 -0
- package/dist/declarations/src/calls.d.ts +26 -0
- package/dist/declarations/src/campaigns.d.ts +39 -0
- package/dist/declarations/src/client.d.ts +10 -0
- package/dist/declarations/src/cms.d.ts +75 -0
- package/dist/declarations/src/contacts.d.ts +36 -0
- package/dist/declarations/src/courses.d.ts +68 -0
- package/dist/declarations/src/donations.d.ts +51 -0
- package/dist/declarations/src/events.d.ts +59 -0
- package/dist/declarations/src/forms.d.ts +69 -0
- package/dist/declarations/src/generated/index.d.ts +45142 -0
- package/dist/declarations/src/help-center.d.ts +4 -0
- package/dist/declarations/src/index.d.ts +39 -0
- package/dist/declarations/src/kb.d.ts +30 -0
- package/dist/declarations/src/mutations.d.ts +394 -0
- package/dist/declarations/src/notes.d.ts +18 -0
- package/dist/declarations/src/people.d.ts +31 -0
- package/dist/declarations/src/search.d.ts +4 -0
- package/dist/declarations/src/spaces.d.ts +19 -0
- package/dist/declarations/src/stories.d.ts +28 -0
- package/dist/declarations/src/system.d.ts +36 -0
- package/dist/declarations/src/tasks.d.ts +16 -0
- package/dist/declarations/src/types.d.ts +19 -0
- package/dist/declarations/src/utils/paginate.d.ts +34 -0
- package/dist/uidu-client.cjs.d.ts +2 -2
- package/dist/uidu-client.cjs.dev.js +588 -0
- package/dist/uidu-client.cjs.js +6 -15
- package/dist/uidu-client.cjs.prod.js +588 -0
- package/dist/uidu-client.esm.js +477 -0
- package/package.json +8 -3
- package/src/cms.ts +43 -0
- package/src/donations.ts +10 -0
- package/src/events.ts +10 -0
- package/src/generated/index.ts +2899 -84
- package/src/index.ts +53 -3
- package/src/mutations.ts +167 -0
- package/src/notes.ts +15 -0
- package/src/people.test.ts +28 -0
- package/src/queries/cms/CreateFieldValue.graphql +16 -0
- package/src/queries/cms/CreatePage.graphql +15 -0
- package/src/queries/cms/CreatePageBlock.graphql +14 -0
- package/src/queries/cms/CreateProject.graphql +16 -0
- package/src/queries/contacts/ContactMutations.graphql +53 -0
- package/src/queries/courses/CourseMutations.graphql +38 -0
- package/src/queries/donations/CreateDonationCampaign.graphql +13 -0
- package/src/queries/donations/DonationCampaignMutations.graphql +25 -0
- package/src/queries/events/CreateEvent.graphql +13 -0
- package/src/queries/events/UpdateEvent.graphql +12 -0
- package/src/queries/forms/FormMutations.graphql +40 -0
- package/src/queries/help-center/ChannelMutations.graphql +40 -0
- package/src/queries/kb/KbMutations.graphql +81 -0
- package/src/queries/notes/CreateNote.graphql +14 -0
- package/src/queries/notes/NoteMutations.graphql +25 -0
- package/src/queries/spaces/CreateSpace.graphql +15 -0
- package/src/queries/spaces/SpaceMutations.graphql +25 -0
- package/src/queries/stories/CreateStory.graphql +13 -0
- package/src/queries/stories/UpdateStory.graphql +12 -0
- package/src/queries/system/CreateWorkspace.graphql +15 -0
- package/src/queries/system/GenerateWorkspaceApiCredentials.graphql +18 -0
- package/src/queries/tasks/CreateTask.graphql +13 -0
- package/src/queries/tasks/TaskMutations.graphql +25 -0
- package/src/spaces.ts +15 -0
- package/src/stories.ts +10 -0
- package/src/system.ts +33 -0
- package/src/tasks.ts +15 -0
- package/src/utils/paginate.test.ts +116 -0
- package/src/utils/relay.test.ts +35 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { UiduClient } from "./client.js";
|
|
2
|
+
import { type GetChannelQuery, type GetChannelQueryVariables } from "./generated/index.js";
|
|
3
|
+
export type Channel = NonNullable<NonNullable<GetChannelQuery['currentWorkspace']>['channel']>;
|
|
4
|
+
export declare function getChannel(client: UiduClient, variables: GetChannelQueryVariables): Promise<Channel | null>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export { UiduClient, createClient } from "./client.js";
|
|
2
|
+
export { UiduError } from "./types.js";
|
|
3
|
+
export type { UiduClientConfig, UiduErrorOptions } from "./types.js";
|
|
4
|
+
export { paginate } from "./utils/paginate.js";
|
|
5
|
+
export type { PaginateOptions } from "./utils/paginate.js";
|
|
6
|
+
export { ListBookingsDocument, ListCalendarsDocument, ListCalendarEventsDocument, ListCallsDocument, ListCampaignsDocument, ListEmailCampaignsDocument, ListCoursesDocument, ListDealsDocument, ListDonationCampaignsDocument, ListEmployeesDocument, ListEnrollmentsDocument, ListEventsDocument, ListFormsDocument, ListKbArticlesDocument, ListKbCollectionsDocument, ListLecturesDocument, ListPagesDocument, ListStoriesDocument, } from "./generated/index.js";
|
|
7
|
+
export { getPage, listPages, getTemplate, createProject, createPage, createPageBlock, createFieldValue, } from "./cms.js";
|
|
8
|
+
export type { Page, Template } from "./cms.js";
|
|
9
|
+
export { createWorkspace, generateWorkspaceApiCredentials, } from "./system.js";
|
|
10
|
+
export { createSpace } from "./spaces.js";
|
|
11
|
+
export { createTask } from "./tasks.js";
|
|
12
|
+
export { createNote } from "./notes.js";
|
|
13
|
+
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, } from "./mutations.js";
|
|
14
|
+
export { getForm, listForms, createFormResponse, updateFormResponse, } from "./forms.js";
|
|
15
|
+
export type { Form } from "./forms.js";
|
|
16
|
+
export { getChannel } from "./help-center.js";
|
|
17
|
+
export type { Channel } from "./help-center.js";
|
|
18
|
+
export { search } from "./search.js";
|
|
19
|
+
export type { SearchResult } from "./search.js";
|
|
20
|
+
export { getEvent, listEvents, createAttendance, createEvent } from "./events.js";
|
|
21
|
+
export type { Event } from "./events.js";
|
|
22
|
+
export { getCall, listCalls } from "./calls.js";
|
|
23
|
+
export type { Call } from "./calls.js";
|
|
24
|
+
export { getDonationCampaign, listDonationCampaigns, createDonation, createDonationCampaign, } from "./donations.js";
|
|
25
|
+
export type { DonationCampaign } from "./donations.js";
|
|
26
|
+
export { getStory, listStories, createStory } from "./stories.js";
|
|
27
|
+
export type { Story } from "./stories.js";
|
|
28
|
+
export { listEmployees, getEmployee, weekStartFor } from "./people.js";
|
|
29
|
+
export type { Employee } from "./people.js";
|
|
30
|
+
export { getBooking, listBookings, getCalendar, listCalendars, getCalendarEvent, listCalendarEvents, } from "./bookings.js";
|
|
31
|
+
export type { Booking, Calendar, CalendarEvent } from "./bookings.js";
|
|
32
|
+
export { getCourse, listCourses, getEnrollment, listEnrollments, getLecture, listLectures, } from "./courses.js";
|
|
33
|
+
export type { Course, Enrollment, Lecture } from "./courses.js";
|
|
34
|
+
export { getCampaign, listCampaigns, listEmailCampaigns, } from "./campaigns.js";
|
|
35
|
+
export type { Campaign } from "./campaigns.js";
|
|
36
|
+
export { getContact, listContacts, getDeal, listDeals, } from "./contacts.js";
|
|
37
|
+
export type { Contact, Deal } from "./contacts.js";
|
|
38
|
+
export { getKbArticle, listKbArticles, getKbCollection, listKbCollections, } from "./kb.js";
|
|
39
|
+
export type { KbArticle, KbCollection } from "./kb.js";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { UiduClient } from "./client.js";
|
|
2
|
+
import { type GetKbArticleQuery, type GetKbArticleQueryVariables, type GetKbCollectionQuery, type GetKbCollectionQueryVariables, type ListKbArticlesQueryVariables, type ListKbCollectionsQueryVariables } from "./generated/index.js";
|
|
3
|
+
export type KbArticle = NonNullable<NonNullable<GetKbArticleQuery['currentWorkspace']>['kbArticle']>;
|
|
4
|
+
export type KbCollection = NonNullable<NonNullable<GetKbCollectionQuery['currentWorkspace']>['kbCollection']>;
|
|
5
|
+
export declare function getKbArticle(client: UiduClient, variables: GetKbArticleQueryVariables): Promise<KbArticle | null>;
|
|
6
|
+
export declare function listKbArticles(client: UiduClient, variables?: ListKbArticlesQueryVariables): Promise<{
|
|
7
|
+
__typename?: "KbArticle";
|
|
8
|
+
id: string;
|
|
9
|
+
name?: string | null;
|
|
10
|
+
position: number;
|
|
11
|
+
isDraft?: boolean | null;
|
|
12
|
+
createdAt: any;
|
|
13
|
+
updatedAt: any;
|
|
14
|
+
kbCollection?: {
|
|
15
|
+
__typename?: "KbCollection";
|
|
16
|
+
id: string;
|
|
17
|
+
name?: any | null;
|
|
18
|
+
} | null;
|
|
19
|
+
}[]>;
|
|
20
|
+
export declare function getKbCollection(client: UiduClient, variables: GetKbCollectionQueryVariables): Promise<KbCollection | null>;
|
|
21
|
+
export declare function listKbCollections(client: UiduClient, variables?: ListKbCollectionsQueryVariables): Promise<{
|
|
22
|
+
__typename?: "KbCollection";
|
|
23
|
+
id: string;
|
|
24
|
+
name?: any | null;
|
|
25
|
+
description?: any | null;
|
|
26
|
+
iconData?: any | null;
|
|
27
|
+
position: number;
|
|
28
|
+
createdAt: any;
|
|
29
|
+
updatedAt: any;
|
|
30
|
+
}[]>;
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import type { UiduClient } from "./client.js";
|
|
2
|
+
import { type CreateChannelMutationVariables, type CreateContactMutationVariables, type CreateCourseMutationVariables, type CreateDealMutationVariables, type CreateFormMutationVariables, type CreateKbArticleMutationVariables, type CreateKbCollectionMutationVariables, type DeleteChannelMutationVariables, type DeleteContactMutationVariables, type DeleteCourseMutationVariables, type DeleteDonationCampaignMutationVariables, type DeleteFormMutationVariables, type DeleteKbArticleMutationVariables, type DeleteKbCollectionMutationVariables, type DeleteNoteMutationVariables, type DeleteSpaceMutationVariables, type DeleteTaskMutationVariables, type UpdateChannelMutationVariables, type UpdateCourseMutationVariables, type UpdateDealMutationVariables, type UpdateDonationCampaignMutationVariables, type UpdateEventMutationVariables, type UpdateFormMutationVariables, type UpdateKbArticleMutationVariables, type UpdateKbCollectionMutationVariables, type UpdateNoteMutationVariables, type UpdateSpaceMutationVariables, type UpdateStoryMutationVariables, type UpdateTaskMutationVariables } from "./generated/index.js";
|
|
3
|
+
export declare function createCourse(c: UiduClient, v: CreateCourseMutationVariables): Promise<{
|
|
4
|
+
__typename?: "CreateCoursePayload";
|
|
5
|
+
course?: {
|
|
6
|
+
__typename?: "Course";
|
|
7
|
+
id: string;
|
|
8
|
+
} | null;
|
|
9
|
+
errors: Array<{
|
|
10
|
+
__typename?: "Error";
|
|
11
|
+
key: string;
|
|
12
|
+
name: string;
|
|
13
|
+
type: string;
|
|
14
|
+
}>;
|
|
15
|
+
} | null>;
|
|
16
|
+
export declare function updateCourse(c: UiduClient, v: UpdateCourseMutationVariables): Promise<{
|
|
17
|
+
__typename?: "UpdateCoursePayload";
|
|
18
|
+
course?: {
|
|
19
|
+
__typename?: "Course";
|
|
20
|
+
id: string;
|
|
21
|
+
} | null;
|
|
22
|
+
errors: Array<{
|
|
23
|
+
__typename?: "Error";
|
|
24
|
+
key: string;
|
|
25
|
+
name: string;
|
|
26
|
+
type: string;
|
|
27
|
+
}>;
|
|
28
|
+
} | null>;
|
|
29
|
+
export declare function deleteCourse(c: UiduClient, v: DeleteCourseMutationVariables): Promise<{
|
|
30
|
+
__typename?: "DeleteCoursePayload";
|
|
31
|
+
course?: {
|
|
32
|
+
__typename?: "Course";
|
|
33
|
+
id: string;
|
|
34
|
+
} | null;
|
|
35
|
+
errors: Array<{
|
|
36
|
+
__typename?: "Error";
|
|
37
|
+
key: string;
|
|
38
|
+
name: string;
|
|
39
|
+
type: string;
|
|
40
|
+
}>;
|
|
41
|
+
} | null>;
|
|
42
|
+
export declare function createForm(c: UiduClient, v: CreateFormMutationVariables): Promise<{
|
|
43
|
+
__typename?: "CreateFormPayload";
|
|
44
|
+
form?: {
|
|
45
|
+
__typename?: "FormEdge";
|
|
46
|
+
node?: {
|
|
47
|
+
__typename?: "Form";
|
|
48
|
+
id: string;
|
|
49
|
+
} | null;
|
|
50
|
+
} | null;
|
|
51
|
+
errors: Array<{
|
|
52
|
+
__typename?: "Error";
|
|
53
|
+
key: string;
|
|
54
|
+
name: string;
|
|
55
|
+
type: string;
|
|
56
|
+
}>;
|
|
57
|
+
} | null>;
|
|
58
|
+
export declare function updateForm(c: UiduClient, v: UpdateFormMutationVariables): Promise<{
|
|
59
|
+
__typename?: "UpdateFormPayload";
|
|
60
|
+
form?: {
|
|
61
|
+
__typename?: "Form";
|
|
62
|
+
id: string;
|
|
63
|
+
} | null;
|
|
64
|
+
errors: Array<{
|
|
65
|
+
__typename?: "Error";
|
|
66
|
+
key: string;
|
|
67
|
+
name: string;
|
|
68
|
+
type: string;
|
|
69
|
+
}>;
|
|
70
|
+
} | null>;
|
|
71
|
+
export declare function deleteForm(c: UiduClient, v: DeleteFormMutationVariables): Promise<{
|
|
72
|
+
__typename?: "DeleteFormPayload";
|
|
73
|
+
form?: {
|
|
74
|
+
__typename?: "Form";
|
|
75
|
+
id: string;
|
|
76
|
+
} | null;
|
|
77
|
+
errors: Array<{
|
|
78
|
+
__typename?: "Error";
|
|
79
|
+
key: string;
|
|
80
|
+
name: string;
|
|
81
|
+
type: string;
|
|
82
|
+
}>;
|
|
83
|
+
} | null>;
|
|
84
|
+
export declare function createContact(c: UiduClient, v: CreateContactMutationVariables): Promise<{
|
|
85
|
+
__typename?: "CreateContactPayload";
|
|
86
|
+
contact?: {
|
|
87
|
+
__typename?: "Contact";
|
|
88
|
+
id: string;
|
|
89
|
+
} | null;
|
|
90
|
+
errors: Array<{
|
|
91
|
+
__typename?: "Error";
|
|
92
|
+
key: string;
|
|
93
|
+
name: string;
|
|
94
|
+
type: string;
|
|
95
|
+
}>;
|
|
96
|
+
} | null>;
|
|
97
|
+
export declare function deleteContact(c: UiduClient, v: DeleteContactMutationVariables): Promise<{
|
|
98
|
+
__typename?: "DeleteContactPayload";
|
|
99
|
+
contact?: {
|
|
100
|
+
__typename?: "Contact";
|
|
101
|
+
id: string;
|
|
102
|
+
} | null;
|
|
103
|
+
errors: Array<{
|
|
104
|
+
__typename?: "Error";
|
|
105
|
+
key: string;
|
|
106
|
+
name: string;
|
|
107
|
+
type: string;
|
|
108
|
+
}>;
|
|
109
|
+
} | null>;
|
|
110
|
+
export declare function createDeal(c: UiduClient, v: CreateDealMutationVariables): Promise<{
|
|
111
|
+
__typename?: "CreateDealPayload";
|
|
112
|
+
deal?: {
|
|
113
|
+
__typename?: "DealEdge";
|
|
114
|
+
node?: {
|
|
115
|
+
__typename?: "Deal";
|
|
116
|
+
id: string;
|
|
117
|
+
} | null;
|
|
118
|
+
} | null;
|
|
119
|
+
errors: Array<{
|
|
120
|
+
__typename?: "Error";
|
|
121
|
+
key: string;
|
|
122
|
+
name: string;
|
|
123
|
+
type: string;
|
|
124
|
+
}>;
|
|
125
|
+
} | null>;
|
|
126
|
+
export declare function updateDeal(c: UiduClient, v: UpdateDealMutationVariables): Promise<{
|
|
127
|
+
__typename?: "UpdateDealPayload";
|
|
128
|
+
deal?: {
|
|
129
|
+
__typename?: "Deal";
|
|
130
|
+
id: string;
|
|
131
|
+
} | null;
|
|
132
|
+
errors: Array<{
|
|
133
|
+
__typename?: "Error";
|
|
134
|
+
key: string;
|
|
135
|
+
name: string;
|
|
136
|
+
type: string;
|
|
137
|
+
}>;
|
|
138
|
+
} | null>;
|
|
139
|
+
export declare function createKbCollection(c: UiduClient, v: CreateKbCollectionMutationVariables): Promise<{
|
|
140
|
+
__typename?: "CreateKbCollectionPayload";
|
|
141
|
+
kbCollection?: {
|
|
142
|
+
__typename?: "KbCollectionEdge";
|
|
143
|
+
node?: {
|
|
144
|
+
__typename?: "KbCollection";
|
|
145
|
+
id: string;
|
|
146
|
+
} | null;
|
|
147
|
+
} | null;
|
|
148
|
+
errors: Array<{
|
|
149
|
+
__typename?: "Error";
|
|
150
|
+
key: string;
|
|
151
|
+
name: string;
|
|
152
|
+
type: string;
|
|
153
|
+
}>;
|
|
154
|
+
} | null>;
|
|
155
|
+
export declare function updateKbCollection(c: UiduClient, v: UpdateKbCollectionMutationVariables): Promise<{
|
|
156
|
+
__typename?: "UpdateKbCollectionPayload";
|
|
157
|
+
kbCollection?: {
|
|
158
|
+
__typename?: "KbCollection";
|
|
159
|
+
id: string;
|
|
160
|
+
} | null;
|
|
161
|
+
errors: Array<{
|
|
162
|
+
__typename?: "Error";
|
|
163
|
+
key: string;
|
|
164
|
+
name: string;
|
|
165
|
+
type: string;
|
|
166
|
+
}>;
|
|
167
|
+
} | null>;
|
|
168
|
+
export declare function deleteKbCollection(c: UiduClient, v: DeleteKbCollectionMutationVariables): Promise<{
|
|
169
|
+
__typename?: "DeleteKbCollectionPayload";
|
|
170
|
+
kbCollection?: {
|
|
171
|
+
__typename?: "KbCollection";
|
|
172
|
+
id: string;
|
|
173
|
+
} | null;
|
|
174
|
+
errors: Array<{
|
|
175
|
+
__typename?: "Error";
|
|
176
|
+
key: string;
|
|
177
|
+
name: string;
|
|
178
|
+
type: string;
|
|
179
|
+
}>;
|
|
180
|
+
} | null>;
|
|
181
|
+
export declare function createKbArticle(c: UiduClient, v: CreateKbArticleMutationVariables): Promise<{
|
|
182
|
+
__typename?: "CreateKbArticlePayload";
|
|
183
|
+
kbArticle?: {
|
|
184
|
+
__typename?: "KbArticleEdge";
|
|
185
|
+
node?: {
|
|
186
|
+
__typename?: "KbArticle";
|
|
187
|
+
id: string;
|
|
188
|
+
} | null;
|
|
189
|
+
} | null;
|
|
190
|
+
errors: Array<{
|
|
191
|
+
__typename?: "Error";
|
|
192
|
+
key: string;
|
|
193
|
+
name: string;
|
|
194
|
+
type: string;
|
|
195
|
+
}>;
|
|
196
|
+
} | null>;
|
|
197
|
+
export declare function updateKbArticle(c: UiduClient, v: UpdateKbArticleMutationVariables): Promise<{
|
|
198
|
+
__typename?: "UpdateKbArticlePayload";
|
|
199
|
+
kbArticle?: {
|
|
200
|
+
__typename?: "KbArticle";
|
|
201
|
+
id: string;
|
|
202
|
+
} | null;
|
|
203
|
+
errors: Array<{
|
|
204
|
+
__typename?: "Error";
|
|
205
|
+
key: string;
|
|
206
|
+
name: string;
|
|
207
|
+
type: string;
|
|
208
|
+
}>;
|
|
209
|
+
} | null>;
|
|
210
|
+
export declare function deleteKbArticle(c: UiduClient, v: DeleteKbArticleMutationVariables): Promise<{
|
|
211
|
+
__typename?: "DeleteKbArticlePayload";
|
|
212
|
+
kbArticle?: {
|
|
213
|
+
__typename?: "KbArticle";
|
|
214
|
+
id: string;
|
|
215
|
+
} | null;
|
|
216
|
+
errors: Array<{
|
|
217
|
+
__typename?: "Error";
|
|
218
|
+
key: string;
|
|
219
|
+
name: string;
|
|
220
|
+
type: string;
|
|
221
|
+
}>;
|
|
222
|
+
} | null>;
|
|
223
|
+
export declare function createChannel(c: UiduClient, v: CreateChannelMutationVariables): Promise<{
|
|
224
|
+
__typename?: "CreateChannelPayload";
|
|
225
|
+
channel?: {
|
|
226
|
+
__typename?: "ChannelEdge";
|
|
227
|
+
node?: {
|
|
228
|
+
__typename?: "Channel";
|
|
229
|
+
id: string;
|
|
230
|
+
} | null;
|
|
231
|
+
} | null;
|
|
232
|
+
errors: Array<{
|
|
233
|
+
__typename?: "Error";
|
|
234
|
+
key: string;
|
|
235
|
+
name: string;
|
|
236
|
+
type: string;
|
|
237
|
+
}>;
|
|
238
|
+
} | null>;
|
|
239
|
+
export declare function updateChannel(c: UiduClient, v: UpdateChannelMutationVariables): Promise<{
|
|
240
|
+
__typename?: "UpdateChannelPayload";
|
|
241
|
+
channel?: {
|
|
242
|
+
__typename?: "Channel";
|
|
243
|
+
id: string;
|
|
244
|
+
} | null;
|
|
245
|
+
errors: Array<{
|
|
246
|
+
__typename?: "Error";
|
|
247
|
+
key: string;
|
|
248
|
+
name: string;
|
|
249
|
+
type: string;
|
|
250
|
+
}>;
|
|
251
|
+
} | null>;
|
|
252
|
+
export declare function deleteChannel(c: UiduClient, v: DeleteChannelMutationVariables): Promise<{
|
|
253
|
+
__typename?: "DeleteChannelPayload";
|
|
254
|
+
channel?: {
|
|
255
|
+
__typename?: "Channel";
|
|
256
|
+
id: string;
|
|
257
|
+
} | null;
|
|
258
|
+
errors: Array<{
|
|
259
|
+
__typename?: "Error";
|
|
260
|
+
key: string;
|
|
261
|
+
name: string;
|
|
262
|
+
type: string;
|
|
263
|
+
}>;
|
|
264
|
+
} | null>;
|
|
265
|
+
export declare function updateEvent(c: UiduClient, v: UpdateEventMutationVariables): Promise<{
|
|
266
|
+
__typename?: "UpdateEventPayload";
|
|
267
|
+
event?: {
|
|
268
|
+
__typename?: "Event";
|
|
269
|
+
id: string;
|
|
270
|
+
} | null;
|
|
271
|
+
errors: Array<{
|
|
272
|
+
__typename?: "Error";
|
|
273
|
+
key: string;
|
|
274
|
+
name: string;
|
|
275
|
+
type: string;
|
|
276
|
+
}>;
|
|
277
|
+
} | null>;
|
|
278
|
+
export declare function updateStory(c: UiduClient, v: UpdateStoryMutationVariables): Promise<{
|
|
279
|
+
__typename?: "UpdateStoryPayload";
|
|
280
|
+
story?: {
|
|
281
|
+
__typename?: "Story";
|
|
282
|
+
id: string;
|
|
283
|
+
} | null;
|
|
284
|
+
errors: Array<{
|
|
285
|
+
__typename?: "Error";
|
|
286
|
+
key: string;
|
|
287
|
+
name: string;
|
|
288
|
+
type: string;
|
|
289
|
+
}>;
|
|
290
|
+
} | null>;
|
|
291
|
+
export declare function updateDonationCampaign(c: UiduClient, v: UpdateDonationCampaignMutationVariables): Promise<{
|
|
292
|
+
__typename?: "UpdateDonationCampaignPayload";
|
|
293
|
+
donationCampaign?: {
|
|
294
|
+
__typename?: "DonationCampaign";
|
|
295
|
+
id: string;
|
|
296
|
+
} | null;
|
|
297
|
+
errors: Array<{
|
|
298
|
+
__typename?: "Error";
|
|
299
|
+
key: string;
|
|
300
|
+
name: string;
|
|
301
|
+
type: string;
|
|
302
|
+
}>;
|
|
303
|
+
} | null>;
|
|
304
|
+
export declare function deleteDonationCampaign(c: UiduClient, v: DeleteDonationCampaignMutationVariables): Promise<{
|
|
305
|
+
__typename?: "DeleteDonationCampaignPayload";
|
|
306
|
+
donationCampaign?: {
|
|
307
|
+
__typename?: "DonationCampaign";
|
|
308
|
+
id: string;
|
|
309
|
+
} | null;
|
|
310
|
+
errors: Array<{
|
|
311
|
+
__typename?: "Error";
|
|
312
|
+
key: string;
|
|
313
|
+
name: string;
|
|
314
|
+
type: string;
|
|
315
|
+
}>;
|
|
316
|
+
} | null>;
|
|
317
|
+
export declare function updateTask(c: UiduClient, v: UpdateTaskMutationVariables): Promise<{
|
|
318
|
+
__typename?: "UpdateTaskPayload";
|
|
319
|
+
task?: {
|
|
320
|
+
__typename?: "Task";
|
|
321
|
+
id: string;
|
|
322
|
+
} | null;
|
|
323
|
+
errors: Array<{
|
|
324
|
+
__typename?: "Error";
|
|
325
|
+
key: string;
|
|
326
|
+
name: string;
|
|
327
|
+
type: string;
|
|
328
|
+
}>;
|
|
329
|
+
} | null>;
|
|
330
|
+
export declare function deleteTask(c: UiduClient, v: DeleteTaskMutationVariables): Promise<{
|
|
331
|
+
__typename?: "DeleteTaskPayload";
|
|
332
|
+
task?: {
|
|
333
|
+
__typename?: "Task";
|
|
334
|
+
id: string;
|
|
335
|
+
} | null;
|
|
336
|
+
errors: Array<{
|
|
337
|
+
__typename?: "Error";
|
|
338
|
+
key: string;
|
|
339
|
+
name: string;
|
|
340
|
+
type: string;
|
|
341
|
+
}>;
|
|
342
|
+
} | null>;
|
|
343
|
+
export declare function updateNote(c: UiduClient, v: UpdateNoteMutationVariables): Promise<{
|
|
344
|
+
__typename?: "UpdateNotePayload";
|
|
345
|
+
note?: {
|
|
346
|
+
__typename?: "Note";
|
|
347
|
+
id: string;
|
|
348
|
+
} | null;
|
|
349
|
+
errors: Array<{
|
|
350
|
+
__typename?: "Error";
|
|
351
|
+
key: string;
|
|
352
|
+
name: string;
|
|
353
|
+
type: string;
|
|
354
|
+
}>;
|
|
355
|
+
} | null>;
|
|
356
|
+
export declare function deleteNote(c: UiduClient, v: DeleteNoteMutationVariables): Promise<{
|
|
357
|
+
__typename?: "DeleteNotePayload";
|
|
358
|
+
note?: {
|
|
359
|
+
__typename?: "Note";
|
|
360
|
+
id: string;
|
|
361
|
+
} | null;
|
|
362
|
+
errors: Array<{
|
|
363
|
+
__typename?: "Error";
|
|
364
|
+
key: string;
|
|
365
|
+
name: string;
|
|
366
|
+
type: string;
|
|
367
|
+
}>;
|
|
368
|
+
} | null>;
|
|
369
|
+
export declare function updateSpace(c: UiduClient, v: UpdateSpaceMutationVariables): Promise<{
|
|
370
|
+
__typename?: "UpdateSpacePayload";
|
|
371
|
+
space?: {
|
|
372
|
+
__typename?: "Space";
|
|
373
|
+
id: string;
|
|
374
|
+
} | null;
|
|
375
|
+
errors: Array<{
|
|
376
|
+
__typename?: "Error";
|
|
377
|
+
key: string;
|
|
378
|
+
name: string;
|
|
379
|
+
type: string;
|
|
380
|
+
}>;
|
|
381
|
+
} | null>;
|
|
382
|
+
export declare function deleteSpace(c: UiduClient, v: DeleteSpaceMutationVariables): Promise<{
|
|
383
|
+
__typename?: "DeleteSpacePayload";
|
|
384
|
+
space?: {
|
|
385
|
+
__typename?: "Space";
|
|
386
|
+
id: string;
|
|
387
|
+
} | null;
|
|
388
|
+
errors: Array<{
|
|
389
|
+
__typename?: "Error";
|
|
390
|
+
key: string;
|
|
391
|
+
name: string;
|
|
392
|
+
type: string;
|
|
393
|
+
}>;
|
|
394
|
+
} | null>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { UiduClient } from "./client.js";
|
|
2
|
+
import { type CreateNoteMutationVariables } from "./generated/index.js";
|
|
3
|
+
export declare function createNote(client: UiduClient, variables: CreateNoteMutationVariables): Promise<{
|
|
4
|
+
__typename?: "CreateNotePayload";
|
|
5
|
+
note?: {
|
|
6
|
+
__typename?: "NoteEdge";
|
|
7
|
+
node?: {
|
|
8
|
+
__typename?: "Note";
|
|
9
|
+
id: string;
|
|
10
|
+
} | null;
|
|
11
|
+
} | null;
|
|
12
|
+
errors: Array<{
|
|
13
|
+
__typename?: "Error";
|
|
14
|
+
key: string;
|
|
15
|
+
name: string;
|
|
16
|
+
type: string;
|
|
17
|
+
}>;
|
|
18
|
+
} | null>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { UiduClient } from "./client.js";
|
|
2
|
+
import { type GetEmployeeQuery, type GetEmployeeQueryVariables, type ListEmployeesQueryVariables } from "./generated/index.js";
|
|
3
|
+
export type Employee = NonNullable<NonNullable<GetEmployeeQuery['currentWorkspace']>['employee']>;
|
|
4
|
+
export declare function listEmployees(client: UiduClient, variables?: ListEmployeesQueryVariables): Promise<{
|
|
5
|
+
__typename?: "Employee";
|
|
6
|
+
id: string;
|
|
7
|
+
employeeCode?: string | null;
|
|
8
|
+
user?: {
|
|
9
|
+
__typename?: "User";
|
|
10
|
+
id: string;
|
|
11
|
+
name?: string | null;
|
|
12
|
+
firstName?: string | null;
|
|
13
|
+
lastName?: string | null;
|
|
14
|
+
email?: string | null;
|
|
15
|
+
} | null;
|
|
16
|
+
currentEmployment?: {
|
|
17
|
+
__typename?: "Employment";
|
|
18
|
+
id: string;
|
|
19
|
+
jobTitle?: string | null;
|
|
20
|
+
contractType?: string | null;
|
|
21
|
+
isActive: boolean;
|
|
22
|
+
startDate: any;
|
|
23
|
+
} | null;
|
|
24
|
+
}[]>;
|
|
25
|
+
export declare function getEmployee(client: UiduClient, variables: GetEmployeeQueryVariables): Promise<Employee | null>;
|
|
26
|
+
/**
|
|
27
|
+
* Compute the Monday of the week containing `date` as an ISO8601 date string.
|
|
28
|
+
* Useful for the `weekStartingAt` argument required by `getEmployee` (and any
|
|
29
|
+
* other weekly-aggregated employee fields).
|
|
30
|
+
*/
|
|
31
|
+
export declare function weekStartFor(date?: Date): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { UiduClient } from "./client.js";
|
|
2
|
+
import { type SearchQuery, type SearchQueryVariables } from "./generated/index.js";
|
|
3
|
+
export type SearchResult = NonNullable<NonNullable<SearchQuery['currentWorkspace']>['search']>;
|
|
4
|
+
export declare function search(client: UiduClient, variables: SearchQueryVariables): Promise<SearchResult | null>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { UiduClient } from "./client.js";
|
|
2
|
+
import { type CreateSpaceMutationVariables } from "./generated/index.js";
|
|
3
|
+
export declare function createSpace(client: UiduClient, variables: CreateSpaceMutationVariables): Promise<{
|
|
4
|
+
__typename?: "CreateSpacePayload";
|
|
5
|
+
space?: {
|
|
6
|
+
__typename?: "SpaceEdge";
|
|
7
|
+
node?: {
|
|
8
|
+
__typename?: "Space";
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
} | null;
|
|
12
|
+
} | null;
|
|
13
|
+
errors: Array<{
|
|
14
|
+
__typename?: "Error";
|
|
15
|
+
key: string;
|
|
16
|
+
name: string;
|
|
17
|
+
type: string;
|
|
18
|
+
}>;
|
|
19
|
+
} | null>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { UiduClient } from "./client.js";
|
|
2
|
+
import { type CreateStoryMutationVariables, type GetStoryQuery, type GetStoryQueryVariables, type ListStoriesQueryVariables } from "./generated/index.js";
|
|
3
|
+
export type Story = NonNullable<NonNullable<GetStoryQuery['currentWorkspace']>['story']>;
|
|
4
|
+
export declare function getStory(client: UiduClient, variables: GetStoryQueryVariables): Promise<Story | null>;
|
|
5
|
+
export declare function listStories(client: UiduClient, variables?: ListStoriesQueryVariables): Promise<{
|
|
6
|
+
__typename?: "Story";
|
|
7
|
+
id: string;
|
|
8
|
+
name?: string | null;
|
|
9
|
+
cover?: string | null;
|
|
10
|
+
coverData?: any | null;
|
|
11
|
+
published?: boolean | null;
|
|
12
|
+
publishedAt?: any | null;
|
|
13
|
+
publicPath?: string | null;
|
|
14
|
+
}[]>;
|
|
15
|
+
export declare function createStory(client: UiduClient, variables: CreateStoryMutationVariables): Promise<{
|
|
16
|
+
__typename?: "CreateStoryPayload";
|
|
17
|
+
story?: {
|
|
18
|
+
__typename?: "Story";
|
|
19
|
+
id: string;
|
|
20
|
+
name?: string | null;
|
|
21
|
+
} | null;
|
|
22
|
+
errors: Array<{
|
|
23
|
+
__typename?: "Error";
|
|
24
|
+
key: string;
|
|
25
|
+
name: string;
|
|
26
|
+
type: string;
|
|
27
|
+
}>;
|
|
28
|
+
} | null>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { UiduClient } from "./client.js";
|
|
2
|
+
import { type CreateWorkspaceMutationVariables, type GenerateWorkspaceApiCredentialsMutationVariables } from "./generated/index.js";
|
|
3
|
+
export declare function createWorkspace(client: UiduClient, variables: CreateWorkspaceMutationVariables): Promise<{
|
|
4
|
+
__typename?: "CreateWorkspacePayload";
|
|
5
|
+
workspace?: {
|
|
6
|
+
__typename?: "Workspace";
|
|
7
|
+
id: string;
|
|
8
|
+
name?: string | null;
|
|
9
|
+
} | null;
|
|
10
|
+
errors: Array<{
|
|
11
|
+
__typename?: "Error";
|
|
12
|
+
key: string;
|
|
13
|
+
name: string;
|
|
14
|
+
type: string;
|
|
15
|
+
}>;
|
|
16
|
+
} | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Rotate + return a workspace's API credentials (apiKey/apiSecret). Operates on
|
|
19
|
+
* the current workspace. Use the returned credentials to wire a scaffolded app.
|
|
20
|
+
*/
|
|
21
|
+
export declare function generateWorkspaceApiCredentials(client: UiduClient, variables: GenerateWorkspaceApiCredentialsMutationVariables): Promise<{
|
|
22
|
+
__typename?: "GenerateWorkspaceApiCredentialsPayload";
|
|
23
|
+
apiKey?: string | null;
|
|
24
|
+
apiSecret?: string | null;
|
|
25
|
+
workspace?: {
|
|
26
|
+
__typename?: "Workspace";
|
|
27
|
+
id: string;
|
|
28
|
+
name?: string | null;
|
|
29
|
+
} | null;
|
|
30
|
+
errors: Array<{
|
|
31
|
+
__typename?: "Error";
|
|
32
|
+
key: string;
|
|
33
|
+
name: string;
|
|
34
|
+
type: string;
|
|
35
|
+
}>;
|
|
36
|
+
} | null>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { UiduClient } from "./client.js";
|
|
2
|
+
import { type CreateTaskMutationVariables } from "./generated/index.js";
|
|
3
|
+
export declare function createTask(client: UiduClient, variables: CreateTaskMutationVariables): Promise<{
|
|
4
|
+
__typename?: "CreateTaskPayload";
|
|
5
|
+
task?: {
|
|
6
|
+
__typename?: "Task";
|
|
7
|
+
id: string;
|
|
8
|
+
name?: string | null;
|
|
9
|
+
} | null;
|
|
10
|
+
errors: Array<{
|
|
11
|
+
__typename?: "Error";
|
|
12
|
+
key: string;
|
|
13
|
+
name: string;
|
|
14
|
+
type: string;
|
|
15
|
+
}>;
|
|
16
|
+
} | null>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface UiduClientConfig {
|
|
2
|
+
workspace: string;
|
|
3
|
+
publicToken?: string;
|
|
4
|
+
apiKey?: string;
|
|
5
|
+
endpoint?: string;
|
|
6
|
+
headers?: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
export interface UiduErrorOptions {
|
|
9
|
+
code: string;
|
|
10
|
+
message: string;
|
|
11
|
+
graphQLErrors?: ReadonlyArray<unknown>;
|
|
12
|
+
cause?: unknown;
|
|
13
|
+
}
|
|
14
|
+
export declare class UiduError extends Error {
|
|
15
|
+
readonly code: string;
|
|
16
|
+
readonly graphQLErrors: ReadonlyArray<unknown>;
|
|
17
|
+
readonly cause?: unknown;
|
|
18
|
+
constructor(opts: UiduErrorOptions);
|
|
19
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
2
|
+
import type { UiduClient } from "../client.js";
|
|
3
|
+
type RelayPageInfo = {
|
|
4
|
+
endCursor?: string | null;
|
|
5
|
+
hasNextPage: boolean;
|
|
6
|
+
};
|
|
7
|
+
type RelayConnection<TNode> = {
|
|
8
|
+
edges?: ReadonlyArray<{
|
|
9
|
+
node?: TNode | null;
|
|
10
|
+
} | null> | null;
|
|
11
|
+
pageInfo?: RelayPageInfo | null;
|
|
12
|
+
};
|
|
13
|
+
export type PaginateOptions<TResult, TVars, TNode> = {
|
|
14
|
+
/** Variables for the first page. `after` is set by paginate itself. */
|
|
15
|
+
variables?: Omit<TVars, 'after'>;
|
|
16
|
+
/** Pluck the Relay connection out of the query result. */
|
|
17
|
+
extract: (data: TResult) => RelayConnection<TNode> | null | undefined;
|
|
18
|
+
/** Safety bound on iterations. Defaults to 1000. */
|
|
19
|
+
maxPages?: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Walks every page of a Relay-style connection and returns a flat array of nodes.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* import { paginate, ListEventsDocument } from '@uidu/client';
|
|
26
|
+
* const all = await paginate(client, ListEventsDocument, {
|
|
27
|
+
* variables: { first: 100 },
|
|
28
|
+
* extract: (d) => d.currentWorkspace?.events,
|
|
29
|
+
* });
|
|
30
|
+
*/
|
|
31
|
+
export declare function paginate<TResult, TVars extends {
|
|
32
|
+
after?: string | null;
|
|
33
|
+
}, TNode>(client: UiduClient, document: TypedDocumentNode<TResult, TVars>, options: PaginateOptions<TResult, TVars, TNode>): Promise<TNode[]>;
|
|
34
|
+
export {};
|