@larisarozin/dodone-shared 1.1.0 → 1.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/dist/utils/ApiClient.d.ts +29 -49
- package/dist/utils/ApiClient.js +62 -152
- package/package.json +1 -1
|
@@ -15,45 +15,25 @@ export declare class ApiClient {
|
|
|
15
15
|
private config;
|
|
16
16
|
constructor(config: ApiClientConfig);
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
* @param response - The fetch response
|
|
20
|
-
* @param route - API route for error messaging
|
|
21
|
-
* @returns Promise with the parsed ResponseBase
|
|
22
|
-
*/
|
|
23
|
-
private processNoDataResponse;
|
|
24
|
-
/**
|
|
25
|
-
* Private helper to process DataResponse for endpoints that return data
|
|
26
|
-
* @param response - The fetch response
|
|
27
|
-
* @param route - API route for error messaging
|
|
28
|
-
* @returns Promise with the unpacked data
|
|
29
|
-
*/
|
|
30
|
-
private processDataResponse;
|
|
31
|
-
/**
|
|
32
|
-
* Makes an authenticated GET request with standardized error handling
|
|
33
|
-
* Always processes DataResponse wrapper
|
|
18
|
+
* Makes an authenticated GET request
|
|
34
19
|
* @param route - API route (will be concatenated with baseUrl)
|
|
35
20
|
* @param options - Additional fetch options
|
|
36
21
|
* @returns Promise with the response data
|
|
37
22
|
*/
|
|
38
|
-
get<T>(route: string, options?: RequestInit
|
|
23
|
+
get<T>(route: string, options?: RequestInit): Promise<T>;
|
|
39
24
|
/**
|
|
40
|
-
* Makes an authenticated POST request
|
|
41
|
-
* Always processes DataResponse wrapper
|
|
25
|
+
* Makes an authenticated POST request
|
|
42
26
|
*/
|
|
43
|
-
post<T>(route: string, body?: any, options?: RequestInit
|
|
27
|
+
post<T>(route: string, body?: any, options?: RequestInit): Promise<T>;
|
|
44
28
|
postMultimedia<T>(route: string, body?: any, options?: RequestInit): Promise<T>;
|
|
45
|
-
postNoData(route: string, body?: any, options?: RequestInit): Promise<boolean>;
|
|
46
|
-
postDontProcess<T>(route: string, body?: any, options?: RequestInit): Promise<T>;
|
|
47
29
|
/**
|
|
48
|
-
* Makes an authenticated PUT request
|
|
49
|
-
* Always processes DataResponse wrapper
|
|
30
|
+
* Makes an authenticated PUT request
|
|
50
31
|
*/
|
|
51
|
-
put<T>(route: string, body?: any, options?: RequestInit
|
|
32
|
+
put<T>(route: string, body?: any, options?: RequestInit): Promise<T>;
|
|
52
33
|
/**
|
|
53
|
-
* Makes an authenticated DELETE request with
|
|
54
|
-
* Always processes ResponseBase (no data returned)
|
|
34
|
+
* Makes an authenticated DELETE request with
|
|
55
35
|
*/
|
|
56
|
-
delete(route: string, options?: RequestInit
|
|
36
|
+
delete(route: string, options?: RequestInit): Promise<ResponseBase>;
|
|
57
37
|
/**
|
|
58
38
|
* Generic paged list request
|
|
59
39
|
*/
|
|
@@ -110,7 +90,7 @@ declare class Teams {
|
|
|
110
90
|
getTeamAllowanceInterval(id: number): Promise<TeamAllowanceIntervalResponse>;
|
|
111
91
|
createTeamAllowanceInterval(request: TeamAllowanceIntervalCreateRequest): Promise<TeamAllowanceIntervalResponse>;
|
|
112
92
|
updateTeamAllowanceInterval(request: TeamAllowanceIntervalUpdateRequest): Promise<TeamAllowanceIntervalResponse>;
|
|
113
|
-
deleteTeamAllowanceInterval(id: number): Promise<
|
|
93
|
+
deleteTeamAllowanceInterval(id: number): Promise<ResponseBase>;
|
|
114
94
|
}
|
|
115
95
|
/**
|
|
116
96
|
* User API operations class
|
|
@@ -121,7 +101,7 @@ declare class Users {
|
|
|
121
101
|
getDetails(id: number): Promise<DataResponse<User>>;
|
|
122
102
|
create(request: UserCreateRequest): Promise<DataResponse<User>>;
|
|
123
103
|
update(request: UserUpdateRequest): Promise<DataResponse<User>>;
|
|
124
|
-
delete(id: number): Promise<
|
|
104
|
+
delete(id: number): Promise<ResponseBase>;
|
|
125
105
|
isLastTeamAdmin(): Promise<boolean>;
|
|
126
106
|
}
|
|
127
107
|
/**
|
|
@@ -130,8 +110,8 @@ declare class Users {
|
|
|
130
110
|
declare class Notifications {
|
|
131
111
|
private client;
|
|
132
112
|
constructor(client: ApiClient);
|
|
133
|
-
registerDevice(request: DeviceRegistrationRequest): Promise<
|
|
134
|
-
unregisterDevice(fcmToken: string): Promise<
|
|
113
|
+
registerDevice(request: DeviceRegistrationRequest): Promise<ResponseBase>;
|
|
114
|
+
unregisterDevice(fcmToken: string): Promise<ResponseBase>;
|
|
135
115
|
updateUserNotificationPreferences(request: BulkNotificationPreferenceUpdateRequest): Promise<ResponseBase>;
|
|
136
116
|
createUserNotificationPreferences(request: BulkNotificationPreferenceCreateRequest): Promise<DataResponse<UserNotificationPreferenceResponse[]>>;
|
|
137
117
|
getUserNotificationPreferences(): Promise<DataResponse<UserNotificationPreferenceResponse[]>>;
|
|
@@ -146,7 +126,7 @@ declare class Avatar {
|
|
|
146
126
|
success: boolean;
|
|
147
127
|
fileName?: string;
|
|
148
128
|
}>;
|
|
149
|
-
deleteAvatar(): Promise<
|
|
129
|
+
deleteAvatar(): Promise<ResponseBase>;
|
|
150
130
|
getAvatarUrl(fileName: string): string;
|
|
151
131
|
getAvatar(fileName: string): Promise<File | null>;
|
|
152
132
|
}
|
|
@@ -158,7 +138,7 @@ declare class TaskComments {
|
|
|
158
138
|
constructor(client: ApiClient);
|
|
159
139
|
create(request: TaskCommentCreateRequest): Promise<any>;
|
|
160
140
|
update(request: TaskCommentUpdateRequest): Promise<any>;
|
|
161
|
-
delete(id: number): Promise<
|
|
141
|
+
delete(id: number): Promise<ResponseBase>;
|
|
162
142
|
getList(request: PagedTaskCommentListRequest): Promise<PagedTaskCommentListResponse<any>>;
|
|
163
143
|
}
|
|
164
144
|
/**
|
|
@@ -180,21 +160,21 @@ declare class Tasks {
|
|
|
180
160
|
constructor(client: ApiClient);
|
|
181
161
|
create(data: any): Promise<any>;
|
|
182
162
|
update(id: number, data: any): Promise<any>;
|
|
183
|
-
copy(id: number): Promise<
|
|
184
|
-
copyList(body: any): Promise<
|
|
185
|
-
delete(id: number): Promise<
|
|
186
|
-
deleteList(body: any): Promise<
|
|
187
|
-
pin(id: number, pinning: boolean): Promise<
|
|
188
|
-
pinList(pinning: boolean, body: any): Promise<
|
|
189
|
-
setActive(id: number, active: boolean): Promise<
|
|
190
|
-
setActiveList(activating: boolean, body: any): Promise<
|
|
191
|
-
setComplete(id: number, completing: boolean): Promise<
|
|
192
|
-
setCompleteList(completing: boolean, body: any): Promise<
|
|
193
|
-
archive(id: number, archiving: boolean): Promise<
|
|
194
|
-
archiveList(archiving: boolean, body: any): Promise<
|
|
195
|
-
approveBonus(request: BonusApprovalRequest): Promise<
|
|
196
|
-
approveTaskItemAllowance(request: TaskItemAllowanceApprovalRequest): Promise<
|
|
197
|
-
claimBonus(id: number): Promise<
|
|
163
|
+
copy(id: number): Promise<ResponseBase>;
|
|
164
|
+
copyList(body: any): Promise<ResponseBase>;
|
|
165
|
+
delete(id: number): Promise<ResponseBase>;
|
|
166
|
+
deleteList(body: any): Promise<ResponseBase>;
|
|
167
|
+
pin(id: number, pinning: boolean): Promise<ResponseBase>;
|
|
168
|
+
pinList(pinning: boolean, body: any): Promise<ResponseBase>;
|
|
169
|
+
setActive(id: number, active: boolean): Promise<ResponseBase>;
|
|
170
|
+
setActiveList(activating: boolean, body: any): Promise<ResponseBase>;
|
|
171
|
+
setComplete(id: number, completing: boolean): Promise<ResponseBase>;
|
|
172
|
+
setCompleteList(completing: boolean, body: any): Promise<ResponseBase>;
|
|
173
|
+
archive(id: number, archiving: boolean): Promise<ResponseBase>;
|
|
174
|
+
archiveList(archiving: boolean, body: any): Promise<ResponseBase>;
|
|
175
|
+
approveBonus(request: BonusApprovalRequest): Promise<ResponseBase>;
|
|
176
|
+
approveTaskItemAllowance(request: TaskItemAllowanceApprovalRequest): Promise<ResponseBase>;
|
|
177
|
+
claimBonus(id: number): Promise<ResponseBase>;
|
|
198
178
|
get(id: number): Promise<any>;
|
|
199
179
|
getDetails(id: number): Promise<any>;
|
|
200
180
|
getTaskDetails(id: number): Promise<any>;
|
package/dist/utils/ApiClient.js
CHANGED
|
@@ -22,138 +22,48 @@ class ApiClient {
|
|
|
22
22
|
this.config = config;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
* @param response - The fetch response
|
|
27
|
-
* @param route - API route for error messaging
|
|
28
|
-
* @returns Promise with the parsed ResponseBase
|
|
29
|
-
*/
|
|
30
|
-
processNoDataResponse(response, route) {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const baseResponse = yield response.json();
|
|
33
|
-
if (!baseResponse.success) {
|
|
34
|
-
console.error(`Error with ${route}:`, baseResponse.message);
|
|
35
|
-
throw new Error(baseResponse.message || `Failed to process ${route}`);
|
|
36
|
-
}
|
|
37
|
-
return baseResponse.success;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Private helper to process DataResponse for endpoints that return data
|
|
42
|
-
* @param response - The fetch response
|
|
43
|
-
* @param route - API route for error messaging
|
|
44
|
-
* @returns Promise with the unpacked data
|
|
45
|
-
*/
|
|
46
|
-
processDataResponse(response, route) {
|
|
47
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
const dataResponse = yield response.json();
|
|
49
|
-
if (!dataResponse.success) {
|
|
50
|
-
console.error(`Error with ${route}:`, dataResponse.message);
|
|
51
|
-
throw new Error(dataResponse.message || `Failed to process ${route}`);
|
|
52
|
-
}
|
|
53
|
-
return dataResponse.data;
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Makes an authenticated GET request with standardized error handling
|
|
58
|
-
* Always processes DataResponse wrapper
|
|
25
|
+
* Makes an authenticated GET request
|
|
59
26
|
* @param route - API route (will be concatenated with baseUrl)
|
|
60
27
|
* @param options - Additional fetch options
|
|
61
28
|
* @returns Promise with the response data
|
|
62
29
|
*/
|
|
63
30
|
get(route_1) {
|
|
64
|
-
return __awaiter(this, arguments, void 0, function* (route, options = {}
|
|
31
|
+
return __awaiter(this, arguments, void 0, function* (route, options = {}) {
|
|
65
32
|
const response = yield fetch(this.config.baseUrl + route, Object.assign(Object.assign({}, options), { headers: Object.assign({ Authorization: `Bearer ${this.config.token}` }, options.headers) }));
|
|
66
|
-
|
|
67
|
-
console.error(`Error fetching ${route}:`, response.statusText);
|
|
68
|
-
throw new Error(`Failed to fetch ${route}`);
|
|
69
|
-
}
|
|
70
|
-
if (processDataResponse)
|
|
71
|
-
return this.processDataResponse(response, route);
|
|
72
|
-
else
|
|
73
|
-
return response.json(); // Skip DataResponse processing if specified
|
|
33
|
+
return response.json();
|
|
74
34
|
});
|
|
75
35
|
}
|
|
76
36
|
/**
|
|
77
|
-
* Makes an authenticated POST request
|
|
78
|
-
* Always processes DataResponse wrapper
|
|
37
|
+
* Makes an authenticated POST request
|
|
79
38
|
*/
|
|
80
39
|
post(route_1, body_1) {
|
|
81
|
-
return __awaiter(this, arguments, void 0, function* (route, body, options = {}
|
|
40
|
+
return __awaiter(this, arguments, void 0, function* (route, body, options = {}) {
|
|
82
41
|
const response = yield fetch(this.config.baseUrl + route, Object.assign(Object.assign({ method: 'POST' }, options), { headers: Object.assign({ 'Content-Type': 'application/json', Authorization: `Bearer ${this.config.token}` }, options.headers), body: body ? JSON.stringify(body) : undefined }));
|
|
83
|
-
|
|
84
|
-
console.error(`Error posting to ${route}:`, response.statusText);
|
|
85
|
-
throw new Error(`Failed to post to ${route}`);
|
|
86
|
-
}
|
|
87
|
-
if (processDataResponse)
|
|
88
|
-
return this.processDataResponse(response, route);
|
|
89
|
-
else
|
|
90
|
-
return response.json(); // Skip DataResponse processing if specified
|
|
42
|
+
return response.json();
|
|
91
43
|
});
|
|
92
44
|
}
|
|
93
45
|
postMultimedia(route_1, body_1) {
|
|
94
46
|
return __awaiter(this, arguments, void 0, function* (route, body, options = {}) {
|
|
95
47
|
const response = yield fetch(this.config.baseUrl + route, Object.assign(Object.assign({ method: 'POST' }, options), { headers: Object.assign({ Authorization: `Bearer ${this.config.token}` }, options.headers), body: body }));
|
|
96
|
-
if (!response.ok) {
|
|
97
|
-
console.error(`Error posting to ${route}:`, response.statusText);
|
|
98
|
-
throw new Error(`Failed to post to ${route}`);
|
|
99
|
-
}
|
|
100
|
-
return response.json();
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
postNoData(route_1, body_1) {
|
|
104
|
-
return __awaiter(this, arguments, void 0, function* (route, body, options = {}) {
|
|
105
|
-
const response = yield fetch(this.config.baseUrl + route, Object.assign(Object.assign({ method: 'POST' }, options), { headers: Object.assign({ 'Content-Type': 'application/json', Authorization: `Bearer ${this.config.token}` }, options.headers), body: body ? JSON.stringify(body) : undefined }));
|
|
106
|
-
if (!response.ok) {
|
|
107
|
-
console.error(`Error posting to ${route}:`, response.statusText);
|
|
108
|
-
throw new Error(`Failed to post to ${route}`);
|
|
109
|
-
}
|
|
110
|
-
return this.processNoDataResponse(response, route);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
postDontProcess(route_1, body_1) {
|
|
114
|
-
return __awaiter(this, arguments, void 0, function* (route, body, options = {}) {
|
|
115
|
-
const response = yield fetch(this.config.baseUrl + route, Object.assign(Object.assign({ method: 'POST' }, options), { headers: Object.assign({ 'Content-Type': 'application/json', Authorization: `Bearer ${this.config.token}` }, options.headers), body: body ? JSON.stringify(body) : undefined }));
|
|
116
|
-
if (!response.ok) {
|
|
117
|
-
console.error(`Error posting to ${route}:`, response.statusText);
|
|
118
|
-
throw new Error(`Failed to post to ${route}`);
|
|
119
|
-
}
|
|
120
48
|
return response.json();
|
|
121
49
|
});
|
|
122
50
|
}
|
|
123
51
|
/**
|
|
124
|
-
* Makes an authenticated PUT request
|
|
125
|
-
* Always processes DataResponse wrapper
|
|
52
|
+
* Makes an authenticated PUT request
|
|
126
53
|
*/
|
|
127
54
|
put(route_1, body_1) {
|
|
128
|
-
return __awaiter(this, arguments, void 0, function* (route, body, options = {}
|
|
55
|
+
return __awaiter(this, arguments, void 0, function* (route, body, options = {}) {
|
|
129
56
|
const response = yield fetch(this.config.baseUrl + route, Object.assign(Object.assign({ method: 'PUT' }, options), { headers: Object.assign({ 'Content-Type': 'application/json', Authorization: `Bearer ${this.config.token}` }, options.headers), body: body ? JSON.stringify(body) : undefined }));
|
|
130
|
-
|
|
131
|
-
console.error(`Error updating ${route}:`, response.statusText);
|
|
132
|
-
throw new Error(`Failed to update ${route}`);
|
|
133
|
-
}
|
|
134
|
-
if (processDataResponse)
|
|
135
|
-
return this.processDataResponse(response, route);
|
|
136
|
-
else
|
|
137
|
-
return response.json(); // Skip DataResponse processing if specified
|
|
57
|
+
return response.json();
|
|
138
58
|
});
|
|
139
59
|
}
|
|
140
60
|
/**
|
|
141
|
-
* Makes an authenticated DELETE request with
|
|
142
|
-
* Always processes ResponseBase (no data returned)
|
|
61
|
+
* Makes an authenticated DELETE request with
|
|
143
62
|
*/
|
|
144
63
|
delete(route_1) {
|
|
145
|
-
return __awaiter(this, arguments, void 0, function* (route, options = {}
|
|
64
|
+
return __awaiter(this, arguments, void 0, function* (route, options = {}) {
|
|
146
65
|
const response = yield fetch(this.config.baseUrl + route, Object.assign(Object.assign({ method: 'DELETE' }, options), { headers: Object.assign({ Authorization: `Bearer ${this.config.token}` }, options.headers) }));
|
|
147
|
-
|
|
148
|
-
console.error(`Error deleting ${route}:`, response.statusText);
|
|
149
|
-
throw new Error(`Failed to delete ${route}`);
|
|
150
|
-
}
|
|
151
|
-
if (processResponse) {
|
|
152
|
-
return this.processNoDataResponse(response, route);
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
return response.json();
|
|
156
|
-
}
|
|
66
|
+
return response.json();
|
|
157
67
|
});
|
|
158
68
|
}
|
|
159
69
|
/**
|
|
@@ -161,37 +71,37 @@ class ApiClient {
|
|
|
161
71
|
*/
|
|
162
72
|
getPagedList(endpoint, request) {
|
|
163
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
164
|
-
return this.post(endpoint, request, {}
|
|
74
|
+
return this.post(endpoint, request, {});
|
|
165
75
|
});
|
|
166
76
|
}
|
|
167
77
|
getPagedListDetails(endpoint, request) {
|
|
168
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
169
|
-
return this.post(endpoint, request, {}
|
|
79
|
+
return this.post(endpoint, request, {});
|
|
170
80
|
});
|
|
171
81
|
}
|
|
172
82
|
getPagedTaskItemList(endpoint, request) {
|
|
173
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
174
|
-
return this.post(endpoint, request, {}
|
|
84
|
+
return this.post(endpoint, request, {});
|
|
175
85
|
});
|
|
176
86
|
}
|
|
177
87
|
getPagedTaskItemListDetails(endpoint, request) {
|
|
178
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
-
return this.post(endpoint, request, {}
|
|
89
|
+
return this.post(endpoint, request, {});
|
|
180
90
|
});
|
|
181
91
|
}
|
|
182
92
|
getPagedTaskCommentList(endpoint, request) {
|
|
183
93
|
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
-
return this.post(endpoint, request, {}
|
|
94
|
+
return this.post(endpoint, request, {});
|
|
185
95
|
});
|
|
186
96
|
}
|
|
187
97
|
getPagedAllowanceHistoriesList(endpoint, request) {
|
|
188
98
|
return __awaiter(this, void 0, void 0, function* () {
|
|
189
|
-
return this.post(endpoint, request, {}
|
|
99
|
+
return this.post(endpoint, request, {});
|
|
190
100
|
});
|
|
191
101
|
}
|
|
192
102
|
getPagedAllowanceHistoryTaskItemsList(endpoint, request) {
|
|
193
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
194
|
-
return this.post(endpoint, request, {}
|
|
104
|
+
return this.post(endpoint, request, {});
|
|
195
105
|
});
|
|
196
106
|
}
|
|
197
107
|
get clientConfig() {
|
|
@@ -273,25 +183,25 @@ class Auth {
|
|
|
273
183
|
}
|
|
274
184
|
register(registerRequest) {
|
|
275
185
|
return __awaiter(this, void 0, void 0, function* () {
|
|
276
|
-
const response = yield this.client.post('/api/auth/register', registerRequest, {}
|
|
186
|
+
const response = yield this.client.post('/api/auth/register', registerRequest, {});
|
|
277
187
|
return response;
|
|
278
188
|
});
|
|
279
189
|
}
|
|
280
190
|
forgotPassword(forgotPasswordRequest) {
|
|
281
191
|
return __awaiter(this, void 0, void 0, function* () {
|
|
282
|
-
const response = yield this.client.
|
|
192
|
+
const response = yield this.client.post('/api/auth/forgot-password', forgotPasswordRequest, {});
|
|
283
193
|
return response;
|
|
284
194
|
});
|
|
285
195
|
}
|
|
286
196
|
resetPassword(resetPasswordRequest) {
|
|
287
197
|
return __awaiter(this, void 0, void 0, function* () {
|
|
288
|
-
const response = yield this.client.
|
|
198
|
+
const response = yield this.client.post('/api/auth/reset-password', resetPasswordRequest, {});
|
|
289
199
|
return response;
|
|
290
200
|
});
|
|
291
201
|
}
|
|
292
202
|
sendPasswordResetEmail(sendPasswordResetEmailRequest) {
|
|
293
203
|
return __awaiter(this, void 0, void 0, function* () {
|
|
294
|
-
const response = yield this.client.
|
|
204
|
+
const response = yield this.client.post('/api/auth/send-password-reset-email', sendPasswordResetEmailRequest, {});
|
|
295
205
|
return response;
|
|
296
206
|
});
|
|
297
207
|
}
|
|
@@ -305,12 +215,12 @@ class Teams {
|
|
|
305
215
|
}
|
|
306
216
|
getTeamDetails() {
|
|
307
217
|
return __awaiter(this, void 0, void 0, function* () {
|
|
308
|
-
return this.client.get('/api/team/', {}
|
|
218
|
+
return this.client.get('/api/team/', {});
|
|
309
219
|
});
|
|
310
220
|
}
|
|
311
221
|
updateTeamDetails(teamUpdateRequest) {
|
|
312
222
|
return __awaiter(this, void 0, void 0, function* () {
|
|
313
|
-
return this.client.put(`/api/team/`, teamUpdateRequest, {}
|
|
223
|
+
return this.client.put(`/api/team/`, teamUpdateRequest, {});
|
|
314
224
|
});
|
|
315
225
|
}
|
|
316
226
|
getTeamMembers(request) {
|
|
@@ -320,27 +230,27 @@ class Teams {
|
|
|
320
230
|
}
|
|
321
231
|
getTeamAllowanceIntervals() {
|
|
322
232
|
return __awaiter(this, void 0, void 0, function* () {
|
|
323
|
-
return this.client.get('/api/team/allowance-intervals', {}
|
|
233
|
+
return this.client.get('/api/team/allowance-intervals', {});
|
|
324
234
|
});
|
|
325
235
|
}
|
|
326
236
|
getTeamAllowanceInterval(id) {
|
|
327
237
|
return __awaiter(this, void 0, void 0, function* () {
|
|
328
|
-
return this.client.get(`/api/team/allowance-intervals/${id}`, {}
|
|
238
|
+
return this.client.get(`/api/team/allowance-intervals/${id}`, {});
|
|
329
239
|
});
|
|
330
240
|
}
|
|
331
241
|
createTeamAllowanceInterval(request) {
|
|
332
242
|
return __awaiter(this, void 0, void 0, function* () {
|
|
333
|
-
return this.client.post('/api/team/allowance-intervals', request, {}
|
|
243
|
+
return this.client.post('/api/team/allowance-intervals', request, {});
|
|
334
244
|
});
|
|
335
245
|
}
|
|
336
246
|
updateTeamAllowanceInterval(request) {
|
|
337
247
|
return __awaiter(this, void 0, void 0, function* () {
|
|
338
|
-
return this.client.put(`/api/team/allowance-intervals/`, request, {}
|
|
248
|
+
return this.client.put(`/api/team/allowance-intervals/`, request, {});
|
|
339
249
|
});
|
|
340
250
|
}
|
|
341
251
|
deleteTeamAllowanceInterval(id) {
|
|
342
252
|
return __awaiter(this, void 0, void 0, function* () {
|
|
343
|
-
return this.client.delete(`/api/team/allowance-intervals/${id}`, {}
|
|
253
|
+
return this.client.delete(`/api/team/allowance-intervals/${id}`, {});
|
|
344
254
|
});
|
|
345
255
|
}
|
|
346
256
|
}
|
|
@@ -353,27 +263,27 @@ class Users {
|
|
|
353
263
|
}
|
|
354
264
|
getDetails(id) {
|
|
355
265
|
return __awaiter(this, void 0, void 0, function* () {
|
|
356
|
-
return this.client.get(`/api/user/${id}`, {}
|
|
266
|
+
return this.client.get(`/api/user/${id}`, {});
|
|
357
267
|
});
|
|
358
268
|
}
|
|
359
269
|
create(request) {
|
|
360
270
|
return __awaiter(this, void 0, void 0, function* () {
|
|
361
|
-
return this.client.post('/api/user/', request, {}
|
|
271
|
+
return this.client.post('/api/user/', request, {});
|
|
362
272
|
});
|
|
363
273
|
}
|
|
364
274
|
update(request) {
|
|
365
275
|
return __awaiter(this, void 0, void 0, function* () {
|
|
366
|
-
return this.client.put(`/api/user/`, request, {}
|
|
276
|
+
return this.client.put(`/api/user/`, request, {});
|
|
367
277
|
});
|
|
368
278
|
}
|
|
369
279
|
delete(id) {
|
|
370
280
|
return __awaiter(this, void 0, void 0, function* () {
|
|
371
|
-
return this.client.delete(`/api/user/${id}`, {}
|
|
281
|
+
return this.client.delete(`/api/user/${id}`, {});
|
|
372
282
|
});
|
|
373
283
|
}
|
|
374
284
|
isLastTeamAdmin() {
|
|
375
285
|
return __awaiter(this, void 0, void 0, function* () {
|
|
376
|
-
return this.client.get(`/api/user/is-last-team-admin`, {}
|
|
286
|
+
return this.client.get(`/api/user/is-last-team-admin`, {});
|
|
377
287
|
});
|
|
378
288
|
}
|
|
379
289
|
}
|
|
@@ -386,27 +296,27 @@ class Notifications {
|
|
|
386
296
|
}
|
|
387
297
|
registerDevice(request) {
|
|
388
298
|
return __awaiter(this, void 0, void 0, function* () {
|
|
389
|
-
return this.client.
|
|
299
|
+
return this.client.post('/api/userdeviceregistration/register-device', request, {});
|
|
390
300
|
});
|
|
391
301
|
}
|
|
392
302
|
unregisterDevice(fcmToken) {
|
|
393
303
|
return __awaiter(this, void 0, void 0, function* () {
|
|
394
|
-
return this.client.
|
|
304
|
+
return this.client.post('/api/userdeviceregistration/unregister-device', { fcmToken }, {});
|
|
395
305
|
});
|
|
396
306
|
}
|
|
397
307
|
updateUserNotificationPreferences(request) {
|
|
398
308
|
return __awaiter(this, void 0, void 0, function* () {
|
|
399
|
-
return this.client.put('/api/user/update-notification-preferences/bulk', request, {}
|
|
309
|
+
return this.client.put('/api/user/update-notification-preferences/bulk', request, {});
|
|
400
310
|
});
|
|
401
311
|
}
|
|
402
312
|
createUserNotificationPreferences(request) {
|
|
403
313
|
return __awaiter(this, void 0, void 0, function* () {
|
|
404
|
-
return this.client.
|
|
314
|
+
return this.client.post('/api/user/create-notification-preferences/bulk', request, {});
|
|
405
315
|
});
|
|
406
316
|
}
|
|
407
317
|
getUserNotificationPreferences() {
|
|
408
318
|
return __awaiter(this, void 0, void 0, function* () {
|
|
409
|
-
return this.client.get(`/api/user/notification-preferences/`, {}
|
|
319
|
+
return this.client.get(`/api/user/notification-preferences/`, {});
|
|
410
320
|
});
|
|
411
321
|
}
|
|
412
322
|
}
|
|
@@ -458,17 +368,17 @@ class TaskComments {
|
|
|
458
368
|
}
|
|
459
369
|
create(request) {
|
|
460
370
|
return __awaiter(this, void 0, void 0, function* () {
|
|
461
|
-
return this.client.post('/api/taskcomment/add', request, {}
|
|
371
|
+
return this.client.post('/api/taskcomment/add', request, {});
|
|
462
372
|
});
|
|
463
373
|
}
|
|
464
374
|
update(request) {
|
|
465
375
|
return __awaiter(this, void 0, void 0, function* () {
|
|
466
|
-
return this.client.put(`/api/taskcomment/update`, request, {}
|
|
376
|
+
return this.client.put(`/api/taskcomment/update`, request, {});
|
|
467
377
|
});
|
|
468
378
|
}
|
|
469
379
|
delete(id) {
|
|
470
380
|
return __awaiter(this, void 0, void 0, function* () {
|
|
471
|
-
return this.client.delete(`/api/taskcomment/delete/${id}`, {}
|
|
381
|
+
return this.client.delete(`/api/taskcomment/delete/${id}`, {});
|
|
472
382
|
});
|
|
473
383
|
}
|
|
474
384
|
getList(request) {
|
|
@@ -496,12 +406,12 @@ class AllowanceHistories {
|
|
|
496
406
|
}
|
|
497
407
|
approveAllowance(request) {
|
|
498
408
|
return __awaiter(this, void 0, void 0, function* () {
|
|
499
|
-
return this.client.
|
|
409
|
+
return this.client.post('/api/allowancehistory/approve', request, {});
|
|
500
410
|
});
|
|
501
411
|
}
|
|
502
412
|
claimAllowance(request) {
|
|
503
413
|
return __awaiter(this, void 0, void 0, function* () {
|
|
504
|
-
return this.client.
|
|
414
|
+
return this.client.post('/api/allowancehistory/claim', request, {});
|
|
505
415
|
});
|
|
506
416
|
}
|
|
507
417
|
}
|
|
@@ -514,22 +424,22 @@ class Tasks {
|
|
|
514
424
|
}
|
|
515
425
|
create(data) {
|
|
516
426
|
return __awaiter(this, void 0, void 0, function* () {
|
|
517
|
-
return this.client.post('/api/taskitem', data);
|
|
427
|
+
return this.client.post('/api/taskitem', data, {});
|
|
518
428
|
});
|
|
519
429
|
}
|
|
520
430
|
update(id, data) {
|
|
521
431
|
return __awaiter(this, void 0, void 0, function* () {
|
|
522
|
-
return this.client.put(`/api/taskitem/${id}`, data);
|
|
432
|
+
return this.client.put(`/api/taskitem/${id}`, data, {});
|
|
523
433
|
});
|
|
524
434
|
}
|
|
525
435
|
copy(id) {
|
|
526
436
|
return __awaiter(this, void 0, void 0, function* () {
|
|
527
|
-
return this.client.post(`/api/taskitem/copy/${id}
|
|
437
|
+
return this.client.post(`/api/taskitem/copy/${id}`, {}, {});
|
|
528
438
|
});
|
|
529
439
|
}
|
|
530
440
|
copyList(body) {
|
|
531
441
|
return __awaiter(this, void 0, void 0, function* () {
|
|
532
|
-
return this.client.
|
|
442
|
+
return this.client.post(`/api/taskitem/copy-list`, body, {});
|
|
533
443
|
});
|
|
534
444
|
}
|
|
535
445
|
delete(id) {
|
|
@@ -539,7 +449,7 @@ class Tasks {
|
|
|
539
449
|
}
|
|
540
450
|
deleteList(body) {
|
|
541
451
|
return __awaiter(this, void 0, void 0, function* () {
|
|
542
|
-
return this.client.
|
|
452
|
+
return this.client.post(`/api/taskitem/delete-list`, body, {});
|
|
543
453
|
});
|
|
544
454
|
}
|
|
545
455
|
pin(id, pinning) {
|
|
@@ -579,22 +489,22 @@ class Tasks {
|
|
|
579
489
|
}
|
|
580
490
|
archiveList(archiving, body) {
|
|
581
491
|
return __awaiter(this, void 0, void 0, function* () {
|
|
582
|
-
return this.client.
|
|
492
|
+
return this.client.post(`/api/taskitem/archive-list/${archiving}`, body, {});
|
|
583
493
|
});
|
|
584
494
|
}
|
|
585
495
|
approveBonus(request) {
|
|
586
496
|
return __awaiter(this, void 0, void 0, function* () {
|
|
587
|
-
return this.client.
|
|
497
|
+
return this.client.post('/api/taskitem/approve-bonus', request, {});
|
|
588
498
|
});
|
|
589
499
|
}
|
|
590
500
|
approveTaskItemAllowance(request) {
|
|
591
501
|
return __awaiter(this, void 0, void 0, function* () {
|
|
592
|
-
return this.client.
|
|
502
|
+
return this.client.post('/api/taskitem/approve-allowance', request, {});
|
|
593
503
|
});
|
|
594
504
|
}
|
|
595
505
|
claimBonus(id) {
|
|
596
506
|
return __awaiter(this, void 0, void 0, function* () {
|
|
597
|
-
return this.client.
|
|
507
|
+
return this.client.post(`/api/taskitem/claim-bonus/${id}`, {}, {});
|
|
598
508
|
});
|
|
599
509
|
}
|
|
600
510
|
get(id) {
|
|
@@ -609,12 +519,12 @@ class Tasks {
|
|
|
609
519
|
}
|
|
610
520
|
getTaskDetails(id) {
|
|
611
521
|
return __awaiter(this, void 0, void 0, function* () {
|
|
612
|
-
return this.client.get(`/api/taskitem/get-task-details/${id}`, {}
|
|
522
|
+
return this.client.get(`/api/taskitem/get-task-details/${id}`, {});
|
|
613
523
|
});
|
|
614
524
|
}
|
|
615
525
|
updateTaskDetails(request) {
|
|
616
526
|
return __awaiter(this, void 0, void 0, function* () {
|
|
617
|
-
return this.client.post(`/api/taskitem/update-task-details`, request, {}
|
|
527
|
+
return this.client.post(`/api/taskitem/update-task-details`, request, {});
|
|
618
528
|
});
|
|
619
529
|
}
|
|
620
530
|
getPagedList(request) {
|
|
@@ -637,32 +547,32 @@ class Subscriptions {
|
|
|
637
547
|
}
|
|
638
548
|
getLimits() {
|
|
639
549
|
return __awaiter(this, void 0, void 0, function* () {
|
|
640
|
-
return this.client.get('/api/subscription/limits', {}
|
|
550
|
+
return this.client.get('/api/subscription/limits', {});
|
|
641
551
|
});
|
|
642
552
|
}
|
|
643
553
|
validateAction(request) {
|
|
644
554
|
return __awaiter(this, void 0, void 0, function* () {
|
|
645
|
-
return this.client.
|
|
555
|
+
return this.client.post('/api/subscription/validate-action', request, {});
|
|
646
556
|
});
|
|
647
557
|
}
|
|
648
558
|
getStatus() {
|
|
649
559
|
return __awaiter(this, void 0, void 0, function* () {
|
|
650
|
-
return this.client.get('/api/subscription/status', {}
|
|
560
|
+
return this.client.get('/api/subscription/status', {});
|
|
651
561
|
});
|
|
652
562
|
}
|
|
653
563
|
verifyPurchase(request) {
|
|
654
564
|
return __awaiter(this, void 0, void 0, function* () {
|
|
655
|
-
return this.client.
|
|
565
|
+
return this.client.post('/api/subscription/verify', request, {});
|
|
656
566
|
});
|
|
657
567
|
}
|
|
658
568
|
cancelSubscription(request) {
|
|
659
569
|
return __awaiter(this, void 0, void 0, function* () {
|
|
660
|
-
return this.client.
|
|
570
|
+
return this.client.post('/api/subscription/cancel', request, {});
|
|
661
571
|
});
|
|
662
572
|
}
|
|
663
573
|
getPurchaseReceipt() {
|
|
664
574
|
return __awaiter(this, void 0, void 0, function* () {
|
|
665
|
-
return this.client.get('/api/subscription/receipt', {}
|
|
575
|
+
return this.client.get('/api/subscription/receipt', {});
|
|
666
576
|
});
|
|
667
577
|
}
|
|
668
578
|
}
|