rotacloud 1.0.31 → 1.0.32
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/cjs/interfaces/{day-notes.interface.d.ts → day-note.interface.d.ts} +1 -1
- package/dist/cjs/interfaces/{day-notes.interface.js → day-note.interface.js} +0 -0
- package/dist/cjs/interfaces/index.d.ts +1 -1
- package/dist/cjs/interfaces/index.js +1 -1
- package/dist/cjs/interfaces/query-params/day-notes-query-params.interface.d.ts +2 -2
- package/dist/cjs/interfaces/query-params/shifts-query-params.interface.d.ts +2 -2
- package/dist/cjs/models/{day-notes.model.d.ts → day-note.model.d.ts} +3 -3
- package/dist/cjs/models/day-note.model.js +14 -0
- package/dist/cjs/rotacloud.d.ts +2 -0
- package/dist/cjs/rotacloud.js +2 -0
- package/dist/cjs/services/accounts.service.js +11 -16
- package/dist/cjs/services/attendance.service.js +11 -16
- package/dist/cjs/services/daily-budgets.service.js +11 -16
- package/dist/cjs/services/daily-revenue.service.js +11 -16
- package/dist/cjs/services/day-notes.service.d.ts +31 -0
- package/dist/cjs/services/day-notes.service.js +103 -0
- package/dist/cjs/services/days-off.service.js +11 -16
- package/dist/cjs/services/groups.service.d.ts +3 -3
- package/dist/cjs/services/groups.service.js +11 -16
- package/dist/cjs/services/leave-embargoes.service.js +11 -16
- package/dist/cjs/services/leave-request.service.d.ts +3 -3
- package/dist/cjs/services/leave-request.service.js +13 -18
- package/dist/cjs/services/leave.service.js +11 -16
- package/dist/cjs/services/locations.service.d.ts +3 -3
- package/dist/cjs/services/locations.service.js +11 -16
- package/dist/cjs/services/roles.service.d.ts +3 -3
- package/dist/cjs/services/roles.service.js +11 -16
- package/dist/cjs/services/shifts.service.js +11 -16
- package/dist/cjs/services/users.service.js +11 -16
- package/dist/cjs/version.js +1 -1
- package/dist/mjs/interfaces/{day-notes.interface.d.ts → day-note.interface.d.ts} +1 -1
- package/dist/mjs/interfaces/{day-notes.interface.js → day-note.interface.js} +0 -0
- package/dist/mjs/interfaces/index.d.ts +1 -1
- package/dist/mjs/interfaces/index.js +1 -1
- package/dist/mjs/interfaces/query-params/day-notes-query-params.interface.d.ts +2 -2
- package/dist/mjs/interfaces/query-params/shifts-query-params.interface.d.ts +2 -2
- package/dist/mjs/models/{day-notes.model.d.ts → day-note.model.d.ts} +3 -3
- package/dist/mjs/models/day-note.model.js +10 -0
- package/dist/mjs/rotacloud.d.ts +2 -0
- package/dist/mjs/rotacloud.js +2 -0
- package/dist/mjs/services/accounts.service.js +4 -9
- package/dist/mjs/services/attendance.service.js +4 -9
- package/dist/mjs/services/daily-budgets.service.js +4 -9
- package/dist/mjs/services/daily-revenue.service.js +4 -9
- package/dist/mjs/services/day-notes.service.d.ts +31 -0
- package/dist/mjs/services/day-notes.service.js +42 -0
- package/dist/mjs/services/days-off.service.js +4 -9
- package/dist/mjs/services/groups.service.d.ts +3 -3
- package/dist/mjs/services/groups.service.js +4 -9
- package/dist/mjs/services/leave-embargoes.service.js +4 -9
- package/dist/mjs/services/leave-request.service.d.ts +3 -3
- package/dist/mjs/services/leave-request.service.js +6 -11
- package/dist/mjs/services/leave.service.js +4 -9
- package/dist/mjs/services/locations.service.d.ts +3 -3
- package/dist/mjs/services/locations.service.js +4 -9
- package/dist/mjs/services/roles.service.d.ts +3 -3
- package/dist/mjs/services/roles.service.js +4 -9
- package/dist/mjs/services/shifts.service.js +4 -9
- package/dist/mjs/services/users.service.js +4 -9
- package/dist/mjs/version.js +1 -1
- package/package.json +1 -1
- package/src/interfaces/{day-notes.interface.ts → day-note.interface.ts} +1 -1
- package/src/interfaces/index.ts +1 -1
- package/src/interfaces/query-params/day-notes-query-params.interface.ts +2 -2
- package/src/interfaces/query-params/shifts-query-params.interface.ts +2 -2
- package/src/models/day-note.model.ts +19 -0
- package/src/rotacloud.ts +2 -0
- package/src/services/accounts.service.ts +4 -8
- package/src/services/attendance.service.ts +4 -8
- package/src/services/daily-budgets.service.ts +4 -8
- package/src/services/daily-revenue.service.ts +4 -8
- package/src/services/day-notes.service.ts +81 -0
- package/src/services/days-off.service.ts +4 -8
- package/src/services/groups.service.ts +7 -11
- package/src/services/leave-embargoes.service.ts +4 -8
- package/src/services/leave-request.service.ts +8 -12
- package/src/services/leave.service.ts +4 -8
- package/src/services/locations.service.ts +7 -11
- package/src/services/roles.service.ts +7 -11
- package/src/services/shifts.service.ts +4 -8
- package/src/services/users.service.ts +4 -8
- package/src/version.ts +1 -1
- package/dist/cjs/models/day-notes.model.js +0 -9
- package/dist/mjs/models/day-notes.model.js +0 -5
- package/src/models/day-notes.model.ts +0 -14
|
@@ -67,26 +67,21 @@ class LocationsService extends index_js_1.Service {
|
|
|
67
67
|
listAll(query, options) {
|
|
68
68
|
var e_2, _a;
|
|
69
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const locations = [];
|
|
70
71
|
try {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const location = _c.value;
|
|
75
|
-
locations.push(location);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
79
|
-
finally {
|
|
80
|
-
try {
|
|
81
|
-
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
|
|
82
|
-
}
|
|
83
|
-
finally { if (e_2) throw e_2.error; }
|
|
72
|
+
for (var _b = __asyncValues(this.list(query, options)), _c; _c = yield _b.next(), !_c.done;) {
|
|
73
|
+
const location = _c.value;
|
|
74
|
+
locations.push(location);
|
|
84
75
|
}
|
|
85
|
-
return locations;
|
|
86
76
|
}
|
|
87
|
-
catch (
|
|
88
|
-
|
|
77
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
78
|
+
finally {
|
|
79
|
+
try {
|
|
80
|
+
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
|
|
81
|
+
}
|
|
82
|
+
finally { if (e_2) throw e_2.error; }
|
|
89
83
|
}
|
|
84
|
+
return locations;
|
|
90
85
|
});
|
|
91
86
|
}
|
|
92
87
|
listByPage(query, options) {
|
|
@@ -16,9 +16,9 @@ export declare class RolesService extends Service {
|
|
|
16
16
|
rawResponse: true;
|
|
17
17
|
} & Options): Promise<AxiosResponse<ApiRole, any>>;
|
|
18
18
|
get(id: number, options: Options): Promise<Role>;
|
|
19
|
-
list(query
|
|
20
|
-
listAll(query
|
|
21
|
-
listByPage(query
|
|
19
|
+
list(query?: RolesQueryParams, options?: Options): AsyncGenerator<Role, void, unknown>;
|
|
20
|
+
listAll(query?: RolesQueryParams, options?: Options): Promise<Role[]>;
|
|
21
|
+
listByPage(query?: RolesQueryParams, options?: Options): AsyncGenerator<AxiosResponse<ApiRole[], any>, any, unknown>;
|
|
22
22
|
update(id: number, data: Partial<ApiRole>): Promise<Role>;
|
|
23
23
|
update(id: number, data: Partial<ApiRole>, options: {
|
|
24
24
|
rawResponse: true;
|
|
@@ -67,26 +67,21 @@ class RolesService extends index_js_1.Service {
|
|
|
67
67
|
listAll(query, options) {
|
|
68
68
|
var e_2, _a;
|
|
69
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const roles = [];
|
|
70
71
|
try {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const role = _c.value;
|
|
75
|
-
roles.push(role);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
79
|
-
finally {
|
|
80
|
-
try {
|
|
81
|
-
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
|
|
82
|
-
}
|
|
83
|
-
finally { if (e_2) throw e_2.error; }
|
|
72
|
+
for (var _b = __asyncValues(this.list(query, options)), _c; _c = yield _b.next(), !_c.done;) {
|
|
73
|
+
const role = _c.value;
|
|
74
|
+
roles.push(role);
|
|
84
75
|
}
|
|
85
|
-
return roles;
|
|
86
76
|
}
|
|
87
|
-
catch (
|
|
88
|
-
|
|
77
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
78
|
+
finally {
|
|
79
|
+
try {
|
|
80
|
+
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
|
|
81
|
+
}
|
|
82
|
+
finally { if (e_2) throw e_2.error; }
|
|
89
83
|
}
|
|
84
|
+
return roles;
|
|
90
85
|
});
|
|
91
86
|
}
|
|
92
87
|
listByPage(query, options) {
|
|
@@ -67,26 +67,21 @@ class ShiftsService extends index_js_1.Service {
|
|
|
67
67
|
listAll(query, options) {
|
|
68
68
|
var e_2, _a;
|
|
69
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const shifts = [];
|
|
70
71
|
try {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const shift = _c.value;
|
|
75
|
-
shifts.push(shift);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
79
|
-
finally {
|
|
80
|
-
try {
|
|
81
|
-
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
|
|
82
|
-
}
|
|
83
|
-
finally { if (e_2) throw e_2.error; }
|
|
72
|
+
for (var _b = __asyncValues(this.list(query, options)), _c; _c = yield _b.next(), !_c.done;) {
|
|
73
|
+
const shift = _c.value;
|
|
74
|
+
shifts.push(shift);
|
|
84
75
|
}
|
|
85
|
-
return shifts;
|
|
86
76
|
}
|
|
87
|
-
catch (
|
|
88
|
-
|
|
77
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
78
|
+
finally {
|
|
79
|
+
try {
|
|
80
|
+
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
|
|
81
|
+
}
|
|
82
|
+
finally { if (e_2) throw e_2.error; }
|
|
89
83
|
}
|
|
84
|
+
return shifts;
|
|
90
85
|
});
|
|
91
86
|
}
|
|
92
87
|
listByPage(query, options) {
|
|
@@ -67,26 +67,21 @@ class UsersService extends index_js_1.Service {
|
|
|
67
67
|
listAll(query, options) {
|
|
68
68
|
var e_2, _a;
|
|
69
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const users = [];
|
|
70
71
|
try {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const user = _c.value;
|
|
75
|
-
users.push(user);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
79
|
-
finally {
|
|
80
|
-
try {
|
|
81
|
-
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
|
|
82
|
-
}
|
|
83
|
-
finally { if (e_2) throw e_2.error; }
|
|
72
|
+
for (var _b = __asyncValues(this.list(query, options)), _c; _c = yield _b.next(), !_c.done;) {
|
|
73
|
+
const user = _c.value;
|
|
74
|
+
users.push(user);
|
|
84
75
|
}
|
|
85
|
-
return users;
|
|
86
76
|
}
|
|
87
|
-
catch (
|
|
88
|
-
|
|
77
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
78
|
+
finally {
|
|
79
|
+
try {
|
|
80
|
+
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
|
|
81
|
+
}
|
|
82
|
+
finally { if (e_2) throw e_2.error; }
|
|
89
83
|
}
|
|
84
|
+
return users;
|
|
90
85
|
});
|
|
91
86
|
}
|
|
92
87
|
listByPage(query, options) {
|
package/dist/cjs/version.js
CHANGED
|
File without changes
|
|
@@ -9,7 +9,7 @@ export * from './daily-budgets.interface.js';
|
|
|
9
9
|
export * from './daily-revenue.interface.js';
|
|
10
10
|
export * from './days-off.interface.js';
|
|
11
11
|
export * from './days-off-pattern.interface.js';
|
|
12
|
-
export * from './day-
|
|
12
|
+
export * from './day-note.interface.js';
|
|
13
13
|
export * from './group.interface.js';
|
|
14
14
|
export * from './holiday_allowance.interface.js';
|
|
15
15
|
export * from './leave-date.interface.js';
|
|
@@ -9,7 +9,7 @@ export * from './daily-budgets.interface.js';
|
|
|
9
9
|
export * from './daily-revenue.interface.js';
|
|
10
10
|
export * from './days-off.interface.js';
|
|
11
11
|
export * from './days-off-pattern.interface.js';
|
|
12
|
-
export * from './day-
|
|
12
|
+
export * from './day-note.interface.js';
|
|
13
13
|
export * from './group.interface.js';
|
|
14
14
|
export * from './holiday_allowance.interface.js';
|
|
15
15
|
export * from './leave-date.interface.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class
|
|
1
|
+
import { ApiDayNote } from '../interfaces/index.js';
|
|
2
|
+
export declare class DayNote {
|
|
3
3
|
id: number;
|
|
4
4
|
start_date: string;
|
|
5
5
|
end_date: string;
|
|
6
6
|
locations: number[];
|
|
7
7
|
title: string;
|
|
8
8
|
message: string;
|
|
9
|
-
constructor(
|
|
9
|
+
constructor(dayNote: ApiDayNote);
|
|
10
10
|
}
|
package/dist/mjs/rotacloud.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AccountsService, AttendanceService, AuthService, AvailabilityService, DailyBudgetsService, DailyRevenueService, DaysOffService, GroupsService, LeaveEmbargoesService, LeaveRequestService, LeaveService, LocationsService, RolesService, SettingsService, ShiftsService, UsersService } from './services/index.js';
|
|
2
2
|
import { SDKConfig } from './interfaces/index.js';
|
|
3
|
+
import { DayNotesService } from './services/day-notes.service.js';
|
|
3
4
|
export declare class RotaCloud {
|
|
4
5
|
static config: SDKConfig;
|
|
5
6
|
defaultAPIURI: string | undefined;
|
|
@@ -9,6 +10,7 @@ export declare class RotaCloud {
|
|
|
9
10
|
availability: AvailabilityService;
|
|
10
11
|
dailyBudgets: DailyBudgetsService;
|
|
11
12
|
dailyRevenue: DailyRevenueService;
|
|
13
|
+
dayNotes: DayNotesService;
|
|
12
14
|
daysOff: DaysOffService;
|
|
13
15
|
group: GroupsService;
|
|
14
16
|
leaveEmbargoes: LeaveEmbargoesService;
|
package/dist/mjs/rotacloud.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AccountsService, AttendanceService, AuthService, AvailabilityService, DailyBudgetsService, DailyRevenueService, DaysOffService, GroupsService, LeaveEmbargoesService, LeaveRequestService, LeaveService, LocationsService, RetryStrategy, RolesService, SettingsService, ShiftsService, UsersService, } from './services/index.js';
|
|
2
|
+
import { DayNotesService } from './services/day-notes.service.js';
|
|
2
3
|
const DEFAULT_CONFIG = {
|
|
3
4
|
baseUri: 'https://api.rotacloud.com/v1',
|
|
4
5
|
retry: RetryStrategy.Exponential,
|
|
@@ -12,6 +13,7 @@ export class RotaCloud {
|
|
|
12
13
|
this.availability = new AvailabilityService();
|
|
13
14
|
this.dailyBudgets = new DailyBudgetsService();
|
|
14
15
|
this.dailyRevenue = new DailyRevenueService();
|
|
16
|
+
this.dayNotes = new DayNotesService();
|
|
15
17
|
this.daysOff = new DaysOffService();
|
|
16
18
|
this.group = new GroupsService();
|
|
17
19
|
this.leaveEmbargoes = new LeaveEmbargoesService();
|
|
@@ -15,16 +15,11 @@ class AccountsService extends Service {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
async listAll(options) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
accounts.push(account);
|
|
22
|
-
}
|
|
23
|
-
return accounts;
|
|
24
|
-
}
|
|
25
|
-
catch (err) {
|
|
26
|
-
return err;
|
|
18
|
+
const accounts = [];
|
|
19
|
+
for await (const account of this.list(options)) {
|
|
20
|
+
accounts.push(account);
|
|
27
21
|
}
|
|
22
|
+
return accounts;
|
|
28
23
|
}
|
|
29
24
|
listByPage(options) {
|
|
30
25
|
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
@@ -18,16 +18,11 @@ export class AttendanceService extends Service {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
async listAll(query, options) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
attendance.push(atten);
|
|
25
|
-
}
|
|
26
|
-
return attendance;
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
return err;
|
|
21
|
+
const attendance = [];
|
|
22
|
+
for await (const atten of this.list(query, options)) {
|
|
23
|
+
attendance.push(atten);
|
|
30
24
|
}
|
|
25
|
+
return attendance;
|
|
31
26
|
}
|
|
32
27
|
listByPage(query, options) {
|
|
33
28
|
return super.iterator({ url: this.apiPath, params: query }, options).byPage();
|
|
@@ -12,16 +12,11 @@ export class DailyBudgetsService extends Service {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
async listAll(query, options) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
attendance.push(atten);
|
|
19
|
-
}
|
|
20
|
-
return attendance;
|
|
21
|
-
}
|
|
22
|
-
catch (err) {
|
|
23
|
-
return err;
|
|
15
|
+
const attendance = [];
|
|
16
|
+
for await (const atten of this.list(query, options)) {
|
|
17
|
+
attendance.push(atten);
|
|
24
18
|
}
|
|
19
|
+
return attendance;
|
|
25
20
|
}
|
|
26
21
|
listByPage(query, options) {
|
|
27
22
|
return super.iterator({ url: this.apiPath, params: query }, options).byPage();
|
|
@@ -12,16 +12,11 @@ export class DailyRevenueService extends Service {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
async listAll(query, options) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
attendance.push(atten);
|
|
19
|
-
}
|
|
20
|
-
return attendance;
|
|
21
|
-
}
|
|
22
|
-
catch (err) {
|
|
23
|
-
return err;
|
|
15
|
+
const attendance = [];
|
|
16
|
+
for await (const atten of this.list(query, options)) {
|
|
17
|
+
attendance.push(atten);
|
|
24
18
|
}
|
|
19
|
+
return attendance;
|
|
25
20
|
}
|
|
26
21
|
listByPage(query, options) {
|
|
27
22
|
return super.iterator({ url: this.apiPath, params: query }, options).byPage();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { ApiDayNote } from '../interfaces/index.js';
|
|
3
|
+
import { Service, Options } from './index.js';
|
|
4
|
+
import { DayNote } from '../models/day-note.model.js';
|
|
5
|
+
import { DayNotesQueryParams } from '../interfaces/query-params/day-notes-query-params.interface';
|
|
6
|
+
export declare class DayNotesService extends Service {
|
|
7
|
+
private apiPath;
|
|
8
|
+
create(data: ApiDayNote): Promise<DayNote>;
|
|
9
|
+
create(data: ApiDayNote, options: {
|
|
10
|
+
rawResponse: true;
|
|
11
|
+
} & Options): Promise<AxiosResponse<ApiDayNote, any>>;
|
|
12
|
+
create(data: ApiDayNote, options: Options): Promise<DayNote>;
|
|
13
|
+
get(id: number): Promise<DayNote>;
|
|
14
|
+
get(id: number, options: {
|
|
15
|
+
rawResponse: true;
|
|
16
|
+
} & Options): Promise<AxiosResponse<ApiDayNote, any>>;
|
|
17
|
+
get(id: number, options: Options): Promise<DayNote>;
|
|
18
|
+
list(query: DayNotesQueryParams, options?: Options): AsyncGenerator<DayNote, void, unknown>;
|
|
19
|
+
listAll(query: DayNotesQueryParams, options?: Options): Promise<DayNote[]>;
|
|
20
|
+
listByPage(query: DayNotesQueryParams, options?: Options): AsyncGenerator<AxiosResponse<ApiDayNote[], any>, any, unknown>;
|
|
21
|
+
update(id: number, data: Partial<ApiDayNote>): Promise<DayNote>;
|
|
22
|
+
update(id: number, data: Partial<ApiDayNote>, options: {
|
|
23
|
+
rawResponse: true;
|
|
24
|
+
} & Options): Promise<AxiosResponse<ApiDayNote, any>>;
|
|
25
|
+
update(id: number, data: Partial<ApiDayNote>, options: Options): Promise<DayNote>;
|
|
26
|
+
delete(id: number): Promise<number>;
|
|
27
|
+
delete(id: number, options: {
|
|
28
|
+
rawResponse: true;
|
|
29
|
+
} & Options): Promise<AxiosResponse<any, any>>;
|
|
30
|
+
delete(id: number, options: Options): Promise<number>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Service } from './index.js';
|
|
2
|
+
import { ErrorResponse } from '../models/error-response.model.js';
|
|
3
|
+
import { DayNote } from '../models/day-note.model.js';
|
|
4
|
+
export class DayNotesService extends Service {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.apiPath = '/day_notes';
|
|
8
|
+
}
|
|
9
|
+
create(data, options) {
|
|
10
|
+
return super.fetch({ url: this.apiPath, data, method: 'POST' }).then((res) => Promise.resolve(options?.rawResponse ? res : new DayNote(res.data)), (err) => Promise.reject(options?.rawResponse ? err : new ErrorResponse(err)));
|
|
11
|
+
}
|
|
12
|
+
get(id, options) {
|
|
13
|
+
return super.fetch({ url: `${this.apiPath}/${id}` }, options).then((res) => Promise.resolve(options?.rawResponse ? res : new DayNote(res.data)), (err) => Promise.reject(options?.rawResponse ? err : new ErrorResponse(err)));
|
|
14
|
+
}
|
|
15
|
+
async *list(query, options) {
|
|
16
|
+
for await (const res of super.iterator({ url: this.apiPath, params: query }, options)) {
|
|
17
|
+
yield new DayNote(res);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async listAll(query, options) {
|
|
21
|
+
const dayNotes = [];
|
|
22
|
+
for await (const dayNote of this.list(query, options)) {
|
|
23
|
+
dayNotes.push(dayNote);
|
|
24
|
+
}
|
|
25
|
+
return dayNotes;
|
|
26
|
+
}
|
|
27
|
+
listByPage(query, options) {
|
|
28
|
+
return super.iterator({ url: this.apiPath, params: query }, options).byPage();
|
|
29
|
+
}
|
|
30
|
+
update(id, data, options) {
|
|
31
|
+
return super
|
|
32
|
+
.fetch({
|
|
33
|
+
url: `${this.apiPath}/${id}`,
|
|
34
|
+
data,
|
|
35
|
+
method: 'POST',
|
|
36
|
+
})
|
|
37
|
+
.then((res) => Promise.resolve(options?.rawResponse ? res : new DayNote(res.data)), (err) => Promise.reject(options?.rawResponse ? err : new ErrorResponse(err)));
|
|
38
|
+
}
|
|
39
|
+
delete(id, options) {
|
|
40
|
+
return super.fetch({ url: `${this.apiPath}/${id}`, method: 'DELETE' }).then((res) => Promise.resolve(options?.rawResponse ? res : res.status), (err) => Promise.reject(options?.rawResponse ? err : new ErrorResponse(err)));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -24,16 +24,11 @@ export class DaysOffService extends Service {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
async listAll(query, options) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
daysOff.push(dayOff);
|
|
31
|
-
}
|
|
32
|
-
return daysOff;
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
return err;
|
|
27
|
+
const daysOff = [];
|
|
28
|
+
for await (const dayOff of this.list(query, options)) {
|
|
29
|
+
daysOff.push(dayOff);
|
|
36
30
|
}
|
|
31
|
+
return daysOff;
|
|
37
32
|
}
|
|
38
33
|
listByPage(query, options) {
|
|
39
34
|
return super.iterator({ url: this.apiPath, params: query }, options).byPage();
|
|
@@ -16,9 +16,9 @@ export declare class GroupsService extends Service {
|
|
|
16
16
|
rawResponse: true;
|
|
17
17
|
} & Options): Promise<AxiosResponse<ApiGroup, any>>;
|
|
18
18
|
get(id: number, options: Options): Promise<Group>;
|
|
19
|
-
list(query
|
|
20
|
-
listAll(query
|
|
21
|
-
listByPage(query
|
|
19
|
+
list(query?: GroupsQueryParams, options?: Options): AsyncGenerator<Group, void, unknown>;
|
|
20
|
+
listAll(query?: GroupsQueryParams, options?: Options): Promise<Group[]>;
|
|
21
|
+
listByPage(query?: GroupsQueryParams, options?: Options): AsyncGenerator<AxiosResponse<ApiGroup[], any>, any, unknown>;
|
|
22
22
|
update(id: number, data: Partial<ApiGroup>): Promise<Group>;
|
|
23
23
|
update(id: number, data: Partial<ApiGroup>, options: {
|
|
24
24
|
rawResponse: true;
|
|
@@ -18,16 +18,11 @@ export class GroupsService extends Service {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
async listAll(query, options) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
groups.push(group);
|
|
25
|
-
}
|
|
26
|
-
return groups;
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
return err;
|
|
21
|
+
const groups = [];
|
|
22
|
+
for await (const group of this.list(query, options)) {
|
|
23
|
+
groups.push(group);
|
|
30
24
|
}
|
|
25
|
+
return groups;
|
|
31
26
|
}
|
|
32
27
|
listByPage(query, options) {
|
|
33
28
|
return super.iterator({ url: this.apiPath, params: query }, options).byPage();
|
|
@@ -18,16 +18,11 @@ export class LeaveEmbargoesService extends Service {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
async listAll(query, options) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
leave.push(leaveEmbargoRecord);
|
|
25
|
-
}
|
|
26
|
-
return leave;
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
return err;
|
|
21
|
+
const leave = [];
|
|
22
|
+
for await (const leaveEmbargoRecord of this.list(query, options)) {
|
|
23
|
+
leave.push(leaveEmbargoRecord);
|
|
30
24
|
}
|
|
25
|
+
return leave;
|
|
31
26
|
}
|
|
32
27
|
listByPage(query, options) {
|
|
33
28
|
return super.iterator({ url: this.apiPath, params: query }, options).byPage();
|
|
@@ -16,9 +16,9 @@ export declare class LeaveRequestService extends Service {
|
|
|
16
16
|
rawResponse: true;
|
|
17
17
|
}): Promise<AxiosResponse<ApiLeaveRequest, any>>;
|
|
18
18
|
get(id: number, options: Options): Promise<LeaveRequest>;
|
|
19
|
-
list(query
|
|
20
|
-
listAll(query
|
|
21
|
-
listByPage(options?: Options): AsyncGenerator<AxiosResponse<ApiLeaveRequest[], any>, any, unknown>;
|
|
19
|
+
list(query?: LeaveQueryParams, options?: Options): AsyncGenerator<LeaveRequest, void, unknown>;
|
|
20
|
+
listAll(query?: LeaveQueryParams, options?: Options): Promise<LeaveRequest[]>;
|
|
21
|
+
listByPage(query?: LeaveQueryParams, options?: Options): AsyncGenerator<AxiosResponse<ApiLeaveRequest[], any>, any, unknown>;
|
|
22
22
|
update(id: number, data: Partial<ApiLeaveRequest>): Promise<LeaveRequest>;
|
|
23
23
|
update(id: number, data: Partial<ApiLeaveRequest>, options: {
|
|
24
24
|
rawResponse: true;
|
|
@@ -18,19 +18,14 @@ export class LeaveRequestService extends Service {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
async listAll(query, options) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
leave.push(leaveRequestRecord);
|
|
25
|
-
}
|
|
26
|
-
return leave;
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
return err;
|
|
21
|
+
const leave = [];
|
|
22
|
+
for await (const leaveRequestRecord of this.list(query, options)) {
|
|
23
|
+
leave.push(leaveRequestRecord);
|
|
30
24
|
}
|
|
25
|
+
return leave;
|
|
31
26
|
}
|
|
32
|
-
listByPage(options) {
|
|
33
|
-
return super.iterator({ url: `${this.apiPath}
|
|
27
|
+
listByPage(query, options) {
|
|
28
|
+
return super.iterator({ url: `${this.apiPath}`, params: query }, options).byPage();
|
|
34
29
|
}
|
|
35
30
|
update(id, data, options) {
|
|
36
31
|
return super
|
|
@@ -19,16 +19,11 @@ export class LeaveService extends Service {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
async listAll(query, options) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
leave.push(leaveRecord);
|
|
26
|
-
}
|
|
27
|
-
return leave;
|
|
28
|
-
}
|
|
29
|
-
catch (err) {
|
|
30
|
-
return err;
|
|
22
|
+
const leave = [];
|
|
23
|
+
for await (const leaveRecord of this.list(query, options)) {
|
|
24
|
+
leave.push(leaveRecord);
|
|
31
25
|
}
|
|
26
|
+
return leave;
|
|
32
27
|
}
|
|
33
28
|
async *listLeaveTypes(query, options) {
|
|
34
29
|
for await (const res of super.iterator({ url: this.apiPath, params: query }, options)) {
|
|
@@ -16,9 +16,9 @@ export declare class LocationsService extends Service {
|
|
|
16
16
|
rawResponse: true;
|
|
17
17
|
} & Options): Promise<AxiosResponse<ApiLocation, any>>;
|
|
18
18
|
get(id: number, options: Options): Promise<Location>;
|
|
19
|
-
list(query
|
|
20
|
-
listAll(query
|
|
21
|
-
listByPage(query
|
|
19
|
+
list(query?: LocationsQueryParams, options?: Options): AsyncGenerator<Location, void, unknown>;
|
|
20
|
+
listAll(query?: LocationsQueryParams, options?: Options): Promise<Location[]>;
|
|
21
|
+
listByPage(query?: LocationsQueryParams, options?: Options): AsyncGenerator<AxiosResponse<ApiLocation[], any>, any, unknown>;
|
|
22
22
|
update(id: number, data: Partial<ApiLocation>): Promise<Location>;
|
|
23
23
|
update(id: number, data: Partial<ApiLocation>, options: {
|
|
24
24
|
rawResponse: true;
|
|
@@ -18,16 +18,11 @@ export class LocationsService extends Service {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
async listAll(query, options) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
locations.push(location);
|
|
25
|
-
}
|
|
26
|
-
return locations;
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
return err;
|
|
21
|
+
const locations = [];
|
|
22
|
+
for await (const location of this.list(query, options)) {
|
|
23
|
+
locations.push(location);
|
|
30
24
|
}
|
|
25
|
+
return locations;
|
|
31
26
|
}
|
|
32
27
|
listByPage(query, options) {
|
|
33
28
|
return super.iterator({ url: this.apiPath, params: query }, options).byPage();
|
|
@@ -16,9 +16,9 @@ export declare class RolesService extends Service {
|
|
|
16
16
|
rawResponse: true;
|
|
17
17
|
} & Options): Promise<AxiosResponse<ApiRole, any>>;
|
|
18
18
|
get(id: number, options: Options): Promise<Role>;
|
|
19
|
-
list(query
|
|
20
|
-
listAll(query
|
|
21
|
-
listByPage(query
|
|
19
|
+
list(query?: RolesQueryParams, options?: Options): AsyncGenerator<Role, void, unknown>;
|
|
20
|
+
listAll(query?: RolesQueryParams, options?: Options): Promise<Role[]>;
|
|
21
|
+
listByPage(query?: RolesQueryParams, options?: Options): AsyncGenerator<AxiosResponse<ApiRole[], any>, any, unknown>;
|
|
22
22
|
update(id: number, data: Partial<ApiRole>): Promise<Role>;
|
|
23
23
|
update(id: number, data: Partial<ApiRole>, options: {
|
|
24
24
|
rawResponse: true;
|