rotacloud 1.0.25 → 1.0.27
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/rotacloud.d.ts +2 -1
- package/dist/cjs/rotacloud.js +1 -0
- package/dist/cjs/services/accounts.service.d.ts +3 -4
- package/dist/cjs/services/accounts.service.js +2 -2
- package/dist/cjs/services/attendance.service.d.ts +13 -18
- package/dist/cjs/services/attendance.service.js +6 -6
- package/dist/cjs/services/availability.service.d.ts +9 -16
- package/dist/cjs/services/availability.service.js +4 -4
- package/dist/cjs/services/daily-budgets.service.d.ts +8 -11
- package/dist/cjs/services/daily-budgets.service.js +9 -9
- package/dist/cjs/services/daily-revenue.service.d.ts +16 -0
- package/dist/cjs/services/daily-revenue.service.js +99 -0
- package/dist/cjs/services/days-off.service.d.ts +8 -12
- package/dist/cjs/services/days-off.service.js +6 -6
- package/dist/cjs/services/groups.service.d.ts +13 -18
- package/dist/cjs/services/groups.service.js +6 -6
- package/dist/cjs/services/index.d.ts +1 -0
- package/dist/cjs/services/index.js +1 -0
- package/dist/cjs/services/leave-embargoes.service.d.ts +13 -18
- package/dist/cjs/services/leave-embargoes.service.js +6 -6
- package/dist/cjs/services/leave-request.service.d.ts +12 -17
- package/dist/cjs/services/leave-request.service.js +4 -4
- package/dist/cjs/services/leave.service.d.ts +13 -18
- package/dist/cjs/services/leave.service.js +9 -9
- package/dist/cjs/services/locations.service.d.ts +13 -18
- package/dist/cjs/services/locations.service.js +6 -6
- package/dist/cjs/services/roles.service.d.ts +13 -18
- package/dist/cjs/services/roles.service.js +6 -6
- package/dist/cjs/services/service.d.ts +6 -4
- package/dist/cjs/services/service.js +2 -2
- package/dist/cjs/services/shifts.service.d.ts +19 -27
- package/dist/cjs/services/shifts.service.js +6 -6
- package/dist/cjs/services/users.service.d.ts +11 -16
- package/dist/cjs/services/users.service.js +6 -6
- package/dist/cjs/version.js +1 -1
- package/dist/mjs/rotacloud.d.ts +2 -1
- package/dist/mjs/rotacloud.js +2 -1
- package/dist/mjs/services/accounts.service.d.ts +3 -4
- package/dist/mjs/services/accounts.service.js +2 -2
- package/dist/mjs/services/attendance.service.d.ts +13 -18
- package/dist/mjs/services/attendance.service.js +7 -8
- package/dist/mjs/services/availability.service.d.ts +9 -16
- package/dist/mjs/services/availability.service.js +4 -4
- package/dist/mjs/services/daily-budgets.service.d.ts +8 -11
- package/dist/mjs/services/daily-budgets.service.js +10 -11
- package/dist/mjs/services/daily-revenue.service.d.ts +16 -0
- package/dist/mjs/services/daily-revenue.service.js +38 -0
- package/dist/mjs/services/days-off.service.d.ts +8 -12
- package/dist/mjs/services/days-off.service.js +7 -8
- package/dist/mjs/services/groups.service.d.ts +13 -18
- package/dist/mjs/services/groups.service.js +7 -8
- package/dist/mjs/services/index.d.ts +1 -0
- package/dist/mjs/services/index.js +1 -0
- package/dist/mjs/services/leave-embargoes.service.d.ts +13 -18
- package/dist/mjs/services/leave-embargoes.service.js +7 -8
- package/dist/mjs/services/leave-request.service.d.ts +12 -17
- package/dist/mjs/services/leave-request.service.js +5 -6
- package/dist/mjs/services/leave.service.d.ts +13 -18
- package/dist/mjs/services/leave.service.js +10 -11
- package/dist/mjs/services/locations.service.d.ts +13 -18
- package/dist/mjs/services/locations.service.js +7 -8
- package/dist/mjs/services/roles.service.d.ts +13 -18
- package/dist/mjs/services/roles.service.js +7 -8
- package/dist/mjs/services/service.d.ts +6 -4
- package/dist/mjs/services/service.js +7 -2
- package/dist/mjs/services/shifts.service.d.ts +19 -27
- package/dist/mjs/services/shifts.service.js +7 -8
- package/dist/mjs/services/users.service.d.ts +11 -16
- package/dist/mjs/services/users.service.js +6 -6
- package/dist/mjs/version.js +1 -1
- package/package.json +1 -1
- package/src/rotacloud.ts +2 -0
- package/src/services/accounts.service.ts +5 -6
- package/src/services/attendance.service.ts +20 -32
- package/src/services/availability.service.ts +14 -34
- package/src/services/daily-budgets.service.ts +15 -19
- package/src/services/daily-revenue.service.ts +53 -0
- package/src/services/days-off.service.ts +15 -21
- package/src/services/groups.service.ts +21 -23
- package/src/services/index.ts +1 -0
- package/src/services/leave-embargoes.service.ts +21 -30
- package/src/services/leave-request.service.ts +20 -31
- package/src/services/leave.service.ts +24 -29
- package/src/services/locations.service.ts +20 -26
- package/src/services/roles.service.ts +20 -24
- package/src/services/service.ts +18 -8
- package/src/services/shifts.service.ts +29 -41
- package/src/services/users.service.ts +19 -20
- package/src/version.ts +1 -1
package/dist/cjs/rotacloud.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountsService, AttendanceService, AvailabilityService, DailyBudgetsService, DaysOffService, GroupsService, LeaveEmbargoesService, LeaveRequestService, LeaveService, LocationsService, RolesService, ShiftsService, UsersService } from './services/index.js';
|
|
1
|
+
import { AccountsService, AttendanceService, AvailabilityService, DailyBudgetsService, DailyRevenueService, DaysOffService, GroupsService, LeaveEmbargoesService, LeaveRequestService, LeaveService, LocationsService, RolesService, ShiftsService, UsersService } from './services/index.js';
|
|
2
2
|
import { SDKConfig } from './interfaces/index.js';
|
|
3
3
|
export declare class RotaCloud {
|
|
4
4
|
static config: SDKConfig;
|
|
@@ -7,6 +7,7 @@ export declare class RotaCloud {
|
|
|
7
7
|
attendance: AttendanceService;
|
|
8
8
|
availability: AvailabilityService;
|
|
9
9
|
dailyBudgets: DailyBudgetsService;
|
|
10
|
+
dailyRevenue: DailyRevenueService;
|
|
10
11
|
daysOff: DaysOffService;
|
|
11
12
|
group: GroupsService;
|
|
12
13
|
leaveEmbargoes: LeaveEmbargoesService;
|
package/dist/cjs/rotacloud.js
CHANGED
|
@@ -19,6 +19,7 @@ class RotaCloud {
|
|
|
19
19
|
this.attendance = new index_js_1.AttendanceService();
|
|
20
20
|
this.availability = new index_js_1.AvailabilityService();
|
|
21
21
|
this.dailyBudgets = new index_js_1.DailyBudgetsService();
|
|
22
|
+
this.dailyRevenue = new index_js_1.DailyRevenueService();
|
|
22
23
|
this.daysOff = new index_js_1.DaysOffService();
|
|
23
24
|
this.group = new index_js_1.GroupsService();
|
|
24
25
|
this.leaveEmbargoes = new index_js_1.LeaveEmbargoesService();
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Account } from '../models/account.model.js';
|
|
2
2
|
import { Service, Options } from './index.js';
|
|
3
3
|
import { ApiAccount } from '../interfaces/index.js';
|
|
4
|
-
import { InternalQueryParams } from '../interfaces/query-params/internal-query-params.interface.js';
|
|
5
4
|
declare class AccountsService extends Service {
|
|
6
5
|
private apiPath;
|
|
7
|
-
list(options?: Options
|
|
8
|
-
listAll(): Promise<Account[]>;
|
|
9
|
-
listByPage(options?: Options
|
|
6
|
+
list(options?: Options): AsyncGenerator<Account, void, unknown>;
|
|
7
|
+
listAll(options?: Options): Promise<Account[]>;
|
|
8
|
+
listByPage(options?: Options): AsyncGenerator<import("axios").AxiosResponse<ApiAccount[], any>, any, unknown>;
|
|
10
9
|
}
|
|
11
10
|
export { AccountsService };
|
|
@@ -57,13 +57,13 @@ class AccountsService extends index_js_1.Service {
|
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
listAll() {
|
|
60
|
+
listAll(options) {
|
|
61
61
|
var e_2, _a;
|
|
62
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
63
|
try {
|
|
64
64
|
const accounts = [];
|
|
65
65
|
try {
|
|
66
|
-
for (var _b = __asyncValues(this.list()), _c; _c = yield _b.next(), !_c.done;) {
|
|
66
|
+
for (var _b = __asyncValues(this.list(options)), _c; _c = yield _b.next(), !_c.done;) {
|
|
67
67
|
const account = _c.value;
|
|
68
68
|
accounts.push(account);
|
|
69
69
|
}
|
|
@@ -3,36 +3,31 @@ import { ApiAttendance } from '../interfaces/index.js';
|
|
|
3
3
|
import { Service, Options, RequirementsOf } from './index.js';
|
|
4
4
|
import { Attendance } from '../models/attendance.model.js';
|
|
5
5
|
import { AttendanceQueryParams } from '../interfaces/query-params/attendance-query-params.interface.js';
|
|
6
|
-
import { InternalQueryParams } from '../interfaces/query-params/internal-query-params.interface.js';
|
|
7
6
|
declare type RequiredProps = 'user' | 'in_time';
|
|
8
|
-
declare class AttendanceService extends Service {
|
|
7
|
+
export declare class AttendanceService extends Service {
|
|
9
8
|
private apiPath;
|
|
10
9
|
create(data: RequirementsOf<ApiAttendance, RequiredProps>): Promise<Attendance>;
|
|
11
10
|
create(data: RequirementsOf<ApiAttendance, RequiredProps>, options: {
|
|
12
11
|
rawResponse: true;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
create(data: RequirementsOf<ApiAttendance, RequiredProps>, options: Options<InternalQueryParams>): Promise<ApiAttendance>;
|
|
12
|
+
} & Options): Promise<AxiosResponse<ApiAttendance, any>>;
|
|
13
|
+
create(data: RequirementsOf<ApiAttendance, RequiredProps>, options: Options): Promise<ApiAttendance>;
|
|
16
14
|
get(id: number): Promise<Attendance>;
|
|
17
15
|
get(id: number, options: {
|
|
18
16
|
rawResponse: true;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
listByPage(options?: Options<AttendanceQueryParams & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiAttendance[], any>, any, unknown>;
|
|
17
|
+
} & Options): Promise<AxiosResponse<ApiAttendance, any>>;
|
|
18
|
+
get(id: number, options: Options): Promise<Attendance>;
|
|
19
|
+
list(query: AttendanceQueryParams, options?: Options): AsyncGenerator<Attendance, void, unknown>;
|
|
20
|
+
listAll(query: AttendanceQueryParams, options?: Options): Promise<Attendance[]>;
|
|
21
|
+
listByPage(query: AttendanceQueryParams, options?: Options): AsyncGenerator<AxiosResponse<ApiAttendance[], any>, any, unknown>;
|
|
25
22
|
update(id: number, data: Partial<ApiAttendance>): Promise<Attendance>;
|
|
26
23
|
update(id: number, data: Partial<ApiAttendance>, options: {
|
|
27
24
|
rawResponse: true;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
update(id: number, data: Partial<ApiAttendance>, options: Options<InternalQueryParams>): Promise<Attendance>;
|
|
25
|
+
} & Options): Promise<AxiosResponse<ApiAttendance, any>>;
|
|
26
|
+
update(id: number, data: Partial<ApiAttendance>, options: Options): Promise<Attendance>;
|
|
31
27
|
delete(id: number): Promise<number>;
|
|
32
28
|
delete(id: number, options: {
|
|
33
29
|
rawResponse: true;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
delete(id: number, options: Options<InternalQueryParams>): Promise<number>;
|
|
30
|
+
} & Options): Promise<AxiosResponse<ApiAttendance, any>>;
|
|
31
|
+
delete(id: number, options: Options): Promise<number>;
|
|
37
32
|
}
|
|
38
|
-
export {
|
|
33
|
+
export {};
|
|
@@ -43,14 +43,14 @@ class AttendanceService extends index_js_1.Service {
|
|
|
43
43
|
get(id, options) {
|
|
44
44
|
return super.fetch({ url: `${this.apiPath}/${id}` }, options).then((res) => Promise.resolve((options === null || options === void 0 ? void 0 : options.rawResponse) ? res : new attendance_model_js_1.Attendance(res.data)), (err) => Promise.reject((options === null || options === void 0 ? void 0 : options.rawResponse) ? err : new error_response_model_js_1.ErrorResponse(err)));
|
|
45
45
|
}
|
|
46
|
-
list(options) {
|
|
46
|
+
list(query, options) {
|
|
47
47
|
const _super = Object.create(null, {
|
|
48
48
|
iterator: { get: () => super.iterator }
|
|
49
49
|
});
|
|
50
50
|
return __asyncGenerator(this, arguments, function* list_1() {
|
|
51
51
|
var e_1, _a;
|
|
52
52
|
try {
|
|
53
|
-
for (var _b = __asyncValues(_super.iterator.call(this, { url: this.apiPath }, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
|
|
53
|
+
for (var _b = __asyncValues(_super.iterator.call(this, { url: this.apiPath, params: query }, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
|
|
54
54
|
const res = _c.value;
|
|
55
55
|
yield yield __await(new attendance_model_js_1.Attendance(res));
|
|
56
56
|
}
|
|
@@ -64,13 +64,13 @@ class AttendanceService extends index_js_1.Service {
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
listAll() {
|
|
67
|
+
listAll(query, options) {
|
|
68
68
|
var e_2, _a;
|
|
69
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
70
|
try {
|
|
71
71
|
const attendance = [];
|
|
72
72
|
try {
|
|
73
|
-
for (var _b = __asyncValues(this.list()), _c; _c = yield _b.next(), !_c.done;) {
|
|
73
|
+
for (var _b = __asyncValues(this.list(query, options)), _c; _c = yield _b.next(), !_c.done;) {
|
|
74
74
|
const atten = _c.value;
|
|
75
75
|
attendance.push(atten);
|
|
76
76
|
}
|
|
@@ -89,8 +89,8 @@ class AttendanceService extends index_js_1.Service {
|
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
listByPage(options) {
|
|
93
|
-
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
92
|
+
listByPage(query, options) {
|
|
93
|
+
return super.iterator({ url: this.apiPath, params: query }, options).byPage();
|
|
94
94
|
}
|
|
95
95
|
update(id, data, options) {
|
|
96
96
|
return super
|
|
@@ -1,33 +1,26 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
|
-
import { Service, Options
|
|
3
|
-
import { InternalQueryParams } from '../interfaces/query-params/internal-query-params.interface.js';
|
|
2
|
+
import { Service, Options } from './index.js';
|
|
4
3
|
import { AvailabilityQueryParams } from '../interfaces/query-params/availability-query-params.interface.js';
|
|
5
4
|
import { Availability } from '../models/availability.model.js';
|
|
6
5
|
import { ApiAvailability } from '../interfaces/availability.interface.js';
|
|
7
|
-
declare type RequiredProps = 'start' | 'end';
|
|
8
|
-
declare type RequiredOptions<T> = RequirementsOf<Options<T>, 'params'>;
|
|
9
6
|
export declare class AvailabilityService extends Service {
|
|
10
7
|
private apiPath;
|
|
11
8
|
update(data: ApiAvailability): Promise<Availability>;
|
|
12
9
|
update(data: ApiAvailability, options: {
|
|
13
10
|
rawResponse: true;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
update(data: ApiAvailability, options?: Options<InternalQueryParams>): Promise<Availability | AxiosResponse<ApiAvailability>>;
|
|
11
|
+
} & Options): Promise<AxiosResponse<ApiAvailability>>;
|
|
12
|
+
update(data: ApiAvailability, options?: Options): Promise<Availability | AxiosResponse<ApiAvailability>>;
|
|
17
13
|
/** Alias of {@link AvailabilityService["update"]} */
|
|
18
14
|
create(data: ApiAvailability): Promise<Availability>;
|
|
19
15
|
create(data: ApiAvailability, options: {
|
|
20
16
|
rawResponse: true;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
create(data: ApiAvailability, options?: Options<InternalQueryParams>): Promise<Availability | AxiosResponse<ApiAvailability>>;
|
|
17
|
+
} & Options): Promise<AxiosResponse<ApiAvailability>>;
|
|
18
|
+
create(data: ApiAvailability, options?: Options): Promise<Availability | AxiosResponse<ApiAvailability>>;
|
|
24
19
|
delete(user: number, dates: string[]): Promise<Availability>;
|
|
25
20
|
delete(user: number, dates: string[], options: {
|
|
26
21
|
rawResponse: true;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
listByPage(options: RequiredOptions<RequirementsOf<AvailabilityQueryParams, RequiredProps> & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiAvailability[], any>, any, unknown>;
|
|
22
|
+
} & Options): Promise<AxiosResponse<ApiAvailability>>;
|
|
23
|
+
delete(user: number, dates: string[], options?: Options): Promise<Availability | AxiosResponse<ApiAvailability>>;
|
|
24
|
+
list(query: AvailabilityQueryParams, options?: Options): AsyncGenerator<Availability, void, unknown>;
|
|
25
|
+
listByPage(query: AvailabilityQueryParams, options?: Options): AsyncGenerator<AxiosResponse<ApiAvailability[], any>, any, unknown>;
|
|
32
26
|
}
|
|
33
|
-
export {};
|
|
@@ -52,14 +52,14 @@ class AvailabilityService extends index_js_1.Service {
|
|
|
52
52
|
}),
|
|
53
53
|
}, options);
|
|
54
54
|
}
|
|
55
|
-
list(options) {
|
|
55
|
+
list(query, options) {
|
|
56
56
|
const _super = Object.create(null, {
|
|
57
57
|
iterator: { get: () => super.iterator }
|
|
58
58
|
});
|
|
59
59
|
return __asyncGenerator(this, arguments, function* list_1() {
|
|
60
60
|
var e_1, _a;
|
|
61
61
|
try {
|
|
62
|
-
for (var _b = __asyncValues(_super.iterator.call(this, { url: this.apiPath }, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
|
|
62
|
+
for (var _b = __asyncValues(_super.iterator.call(this, { url: this.apiPath, params: query }, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
|
|
63
63
|
const res = _c.value;
|
|
64
64
|
yield yield __await(new availability_model_js_1.Availability(res));
|
|
65
65
|
}
|
|
@@ -73,8 +73,8 @@ class AvailabilityService extends index_js_1.Service {
|
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
listByPage(options) {
|
|
77
|
-
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
76
|
+
listByPage(query, options) {
|
|
77
|
+
return super.iterator({ url: this.apiPath, params: query }, options).byPage();
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
exports.AvailabilityService = AvailabilityService;
|
|
@@ -3,17 +3,14 @@ import { ApiDailyBudgets } from '../interfaces/daily-budgets.interface.js';
|
|
|
3
3
|
import { Service, Options } from './index.js';
|
|
4
4
|
import { DailyBudgets } from '../models/daily-budgets.model.js';
|
|
5
5
|
import { DailyBudgetsQueryParams } from '../interfaces/query-params/daily-budgets-query-params.interface.js';
|
|
6
|
-
|
|
7
|
-
declare class DailyBudgetsService extends Service {
|
|
6
|
+
export declare class DailyBudgetsService extends Service {
|
|
8
7
|
private apiPath;
|
|
9
|
-
list(options?: Options
|
|
10
|
-
listAll(): Promise<DailyBudgets[]>;
|
|
11
|
-
listByPage(options?: Options
|
|
12
|
-
update(
|
|
13
|
-
update(
|
|
8
|
+
list(query: DailyBudgetsQueryParams, options?: Options): AsyncGenerator<DailyBudgets, void, unknown>;
|
|
9
|
+
listAll(query: DailyBudgetsQueryParams, options?: Options): Promise<DailyBudgets[]>;
|
|
10
|
+
listByPage(query: DailyBudgetsQueryParams, options?: Options): AsyncGenerator<AxiosResponse<ApiDailyBudgets[], any>, any, unknown>;
|
|
11
|
+
update(data: Partial<ApiDailyBudgets>[]): Promise<number>;
|
|
12
|
+
update(data: Partial<ApiDailyBudgets>[], options: {
|
|
14
13
|
rawResponse: true;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
update(id: number, data: Partial<ApiDailyBudgets>, options: Options<InternalQueryParams>): Promise<ApiDailyBudgets>;
|
|
14
|
+
} & Options): Promise<AxiosResponse<ApiDailyBudgets, any>>;
|
|
15
|
+
update(data: Partial<ApiDailyBudgets>[], options: Options): Promise<number>;
|
|
18
16
|
}
|
|
19
|
-
export { DailyBudgetsService };
|
|
@@ -37,14 +37,14 @@ class DailyBudgetsService extends index_js_1.Service {
|
|
|
37
37
|
super(...arguments);
|
|
38
38
|
this.apiPath = '/daily_budgets';
|
|
39
39
|
}
|
|
40
|
-
list(options) {
|
|
40
|
+
list(query, options) {
|
|
41
41
|
const _super = Object.create(null, {
|
|
42
42
|
iterator: { get: () => super.iterator }
|
|
43
43
|
});
|
|
44
44
|
return __asyncGenerator(this, arguments, function* list_1() {
|
|
45
45
|
var e_1, _a;
|
|
46
46
|
try {
|
|
47
|
-
for (var _b = __asyncValues(_super.iterator.call(this, { url: this.apiPath }, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
|
|
47
|
+
for (var _b = __asyncValues(_super.iterator.call(this, { url: this.apiPath, params: query }, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
|
|
48
48
|
const res = _c.value;
|
|
49
49
|
yield yield __await(new daily_budgets_model_js_1.DailyBudgets(res));
|
|
50
50
|
}
|
|
@@ -58,13 +58,13 @@ class DailyBudgetsService extends index_js_1.Service {
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
listAll() {
|
|
61
|
+
listAll(query, options) {
|
|
62
62
|
var e_2, _a;
|
|
63
63
|
return __awaiter(this, void 0, void 0, function* () {
|
|
64
64
|
try {
|
|
65
65
|
const attendance = [];
|
|
66
66
|
try {
|
|
67
|
-
for (var _b = __asyncValues(this.list()), _c; _c = yield _b.next(), !_c.done;) {
|
|
67
|
+
for (var _b = __asyncValues(this.list(query, options)), _c; _c = yield _b.next(), !_c.done;) {
|
|
68
68
|
const atten = _c.value;
|
|
69
69
|
attendance.push(atten);
|
|
70
70
|
}
|
|
@@ -83,17 +83,17 @@ class DailyBudgetsService extends index_js_1.Service {
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
listByPage(options) {
|
|
87
|
-
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
86
|
+
listByPage(query, options) {
|
|
87
|
+
return super.iterator({ url: this.apiPath, params: query }, options).byPage();
|
|
88
88
|
}
|
|
89
|
-
update(
|
|
89
|
+
update(data, options) {
|
|
90
90
|
return super
|
|
91
91
|
.fetch({
|
|
92
|
-
url: `${this.apiPath}
|
|
92
|
+
url: `${this.apiPath}`,
|
|
93
93
|
data,
|
|
94
94
|
method: 'POST',
|
|
95
95
|
})
|
|
96
|
-
.then((res) => Promise.resolve((options === null || options === void 0 ? void 0 : options.rawResponse) ? res :
|
|
96
|
+
.then((res) => Promise.resolve((options === null || options === void 0 ? void 0 : options.rawResponse) ? res : res.status), (err) => Promise.reject((options === null || options === void 0 ? void 0 : options.rawResponse) ? err : new error_response_model_js_1.ErrorResponse(err)));
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
exports.DailyBudgetsService = DailyBudgetsService;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { ApiDailyRevenue } from '../interfaces/daily-revenue.interface.js';
|
|
3
|
+
import { Service, Options } from './index.js';
|
|
4
|
+
import { DailyRevenue } from '../models/daily-revenue.model.js';
|
|
5
|
+
import { DailyRevenueQueryParams } from '../interfaces/query-params/daily-revenue-query-params.interface.js';
|
|
6
|
+
export declare class DailyRevenueService extends Service {
|
|
7
|
+
private apiPath;
|
|
8
|
+
list(query: DailyRevenueQueryParams, options?: Options): AsyncGenerator<DailyRevenue, void, unknown>;
|
|
9
|
+
listAll(query: DailyRevenueQueryParams, options?: Options): Promise<DailyRevenue[]>;
|
|
10
|
+
listByPage(query: DailyRevenueQueryParams, options?: Options): AsyncGenerator<AxiosResponse<ApiDailyRevenue[], any>, any, unknown>;
|
|
11
|
+
update(data: Partial<ApiDailyRevenue>[]): Promise<number>;
|
|
12
|
+
update(data: Partial<ApiDailyRevenue>[], options: {
|
|
13
|
+
rawResponse: true;
|
|
14
|
+
} & Options): Promise<AxiosResponse<ApiDailyRevenue, any>>;
|
|
15
|
+
update(data: Partial<ApiDailyRevenue>[], options: Options): Promise<number>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
12
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
13
|
+
var m = o[Symbol.asyncIterator], i;
|
|
14
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
15
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
16
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
17
|
+
};
|
|
18
|
+
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
19
|
+
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
20
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
21
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
22
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
23
|
+
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
24
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
25
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
26
|
+
function fulfill(value) { resume("next", value); }
|
|
27
|
+
function reject(value) { resume("throw", value); }
|
|
28
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.DailyRevenueService = void 0;
|
|
32
|
+
const index_js_1 = require("./index.js");
|
|
33
|
+
const daily_revenue_model_js_1 = require("../models/daily-revenue.model.js");
|
|
34
|
+
const error_response_model_js_1 = require("../models/error-response.model.js");
|
|
35
|
+
class DailyRevenueService extends index_js_1.Service {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments);
|
|
38
|
+
this.apiPath = '/daily_revenue';
|
|
39
|
+
}
|
|
40
|
+
list(query, options) {
|
|
41
|
+
const _super = Object.create(null, {
|
|
42
|
+
iterator: { get: () => super.iterator }
|
|
43
|
+
});
|
|
44
|
+
return __asyncGenerator(this, arguments, function* list_1() {
|
|
45
|
+
var e_1, _a;
|
|
46
|
+
try {
|
|
47
|
+
for (var _b = __asyncValues(_super.iterator.call(this, { url: this.apiPath, params: query }, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
|
|
48
|
+
const res = _c.value;
|
|
49
|
+
yield yield __await(new daily_revenue_model_js_1.DailyRevenue(res));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
53
|
+
finally {
|
|
54
|
+
try {
|
|
55
|
+
if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));
|
|
56
|
+
}
|
|
57
|
+
finally { if (e_1) throw e_1.error; }
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
listAll(query, options) {
|
|
62
|
+
var e_2, _a;
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
try {
|
|
65
|
+
const attendance = [];
|
|
66
|
+
try {
|
|
67
|
+
for (var _b = __asyncValues(this.list(query, options)), _c; _c = yield _b.next(), !_c.done;) {
|
|
68
|
+
const atten = _c.value;
|
|
69
|
+
attendance.push(atten);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
73
|
+
finally {
|
|
74
|
+
try {
|
|
75
|
+
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
|
|
76
|
+
}
|
|
77
|
+
finally { if (e_2) throw e_2.error; }
|
|
78
|
+
}
|
|
79
|
+
return attendance;
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
return err;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
listByPage(query, options) {
|
|
87
|
+
return super.iterator({ url: this.apiPath, params: query }, options).byPage();
|
|
88
|
+
}
|
|
89
|
+
update(data, options) {
|
|
90
|
+
return super
|
|
91
|
+
.fetch({
|
|
92
|
+
url: `${this.apiPath}`,
|
|
93
|
+
data,
|
|
94
|
+
method: 'POST',
|
|
95
|
+
})
|
|
96
|
+
.then((res) => Promise.resolve((options === null || options === void 0 ? void 0 : options.rawResponse) ? res : res.status), (err) => Promise.reject((options === null || options === void 0 ? void 0 : options.rawResponse) ? err : new error_response_model_js_1.ErrorResponse(err)));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.DailyRevenueService = DailyRevenueService;
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { ApiDaysOff } from '../interfaces/index.js';
|
|
3
3
|
import { Service, Options } from './index.js';
|
|
4
|
-
import { InternalQueryParams } from '../interfaces/query-params/internal-query-params.interface.js';
|
|
5
4
|
import { DaysOff } from '../models/days-off.model.js';
|
|
6
5
|
import { DaysOffQueryParams } from '../interfaces/query-params/days-off-query-params.interface.js';
|
|
7
|
-
declare class DaysOffService extends Service<ApiDaysOff> {
|
|
6
|
+
export declare class DaysOffService extends Service<ApiDaysOff> {
|
|
8
7
|
private apiPath;
|
|
9
8
|
create(dates: string[], users: number[]): Promise<number>;
|
|
10
9
|
create(dates: string[], users: number[], options: {
|
|
11
10
|
rawResponse: true;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
listByPage(options?: Options<DaysOffQueryParams & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiDaysOff[], any>, any, unknown>;
|
|
11
|
+
} & Options): Promise<AxiosResponse<ApiDaysOff, any>>;
|
|
12
|
+
create(dates: string[], users: number[], options: Options): Promise<number>;
|
|
13
|
+
list(query: DaysOffQueryParams, options?: Options): AsyncGenerator<DaysOff, void, unknown>;
|
|
14
|
+
listAll(query: DaysOffQueryParams, options?: Options): Promise<DaysOff[]>;
|
|
15
|
+
listByPage(query: DaysOffQueryParams, options?: Options): AsyncGenerator<AxiosResponse<ApiDaysOff[], any>, any, unknown>;
|
|
18
16
|
delete(dates: string[], users: number[]): Promise<number>;
|
|
19
17
|
delete(dates: string[], users: number[], options: {
|
|
20
18
|
rawResponse: true;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
delete(dates: string[], users: number[], options: Options<InternalQueryParams>): Promise<number>;
|
|
19
|
+
} & Options): Promise<AxiosResponse<any, any>>;
|
|
20
|
+
delete(dates: string[], users: number[], options: Options): Promise<number>;
|
|
24
21
|
}
|
|
25
|
-
export { DaysOffService };
|
|
@@ -49,14 +49,14 @@ class DaysOffService extends index_js_1.Service {
|
|
|
49
49
|
})
|
|
50
50
|
.then((res) => Promise.resolve((options === null || options === void 0 ? void 0 : options.rawResponse) ? res : res.status), (err) => Promise.reject((options === null || options === void 0 ? void 0 : options.rawResponse) ? err : new error_response_model_js_1.ErrorResponse(err)));
|
|
51
51
|
}
|
|
52
|
-
list(options) {
|
|
52
|
+
list(query, options) {
|
|
53
53
|
const _super = Object.create(null, {
|
|
54
54
|
iterator: { get: () => super.iterator }
|
|
55
55
|
});
|
|
56
56
|
return __asyncGenerator(this, arguments, function* list_1() {
|
|
57
57
|
var e_1, _a;
|
|
58
58
|
try {
|
|
59
|
-
for (var _b = __asyncValues(_super.iterator.call(this, { url: this.apiPath }, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
|
|
59
|
+
for (var _b = __asyncValues(_super.iterator.call(this, { url: this.apiPath, params: query }, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
|
|
60
60
|
const res = _c.value;
|
|
61
61
|
yield yield __await(new days_off_model_js_1.DaysOff(res));
|
|
62
62
|
}
|
|
@@ -70,13 +70,13 @@ class DaysOffService extends index_js_1.Service {
|
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
listAll() {
|
|
73
|
+
listAll(query, options) {
|
|
74
74
|
var e_2, _a;
|
|
75
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
76
|
try {
|
|
77
77
|
const daysOff = [];
|
|
78
78
|
try {
|
|
79
|
-
for (var _b = __asyncValues(this.list()), _c; _c = yield _b.next(), !_c.done;) {
|
|
79
|
+
for (var _b = __asyncValues(this.list(query, options)), _c; _c = yield _b.next(), !_c.done;) {
|
|
80
80
|
const dayOff = _c.value;
|
|
81
81
|
daysOff.push(dayOff);
|
|
82
82
|
}
|
|
@@ -95,8 +95,8 @@ class DaysOffService extends index_js_1.Service {
|
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
listByPage(options) {
|
|
99
|
-
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
98
|
+
listByPage(query, options) {
|
|
99
|
+
return super.iterator({ url: this.apiPath, params: query }, options).byPage();
|
|
100
100
|
}
|
|
101
101
|
delete(dates, users, options) {
|
|
102
102
|
return super
|
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { ApiGroup } from '../interfaces/index.js';
|
|
3
3
|
import { Service, Options, RequirementsOf } from './index.js';
|
|
4
|
-
import { InternalQueryParams } from '../interfaces/query-params/internal-query-params.interface.js';
|
|
5
4
|
import { Group } from '../models/group.model.js';
|
|
6
5
|
import { GroupsQueryParams } from '../interfaces/query-params/groups-query-params.interface.js';
|
|
7
6
|
declare type RequiredProps = 'name';
|
|
8
|
-
declare class GroupsService extends Service {
|
|
7
|
+
export declare class GroupsService extends Service {
|
|
9
8
|
private apiPath;
|
|
10
9
|
create(data: RequirementsOf<ApiGroup, RequiredProps>): Promise<Group>;
|
|
11
10
|
create(data: RequirementsOf<ApiGroup, RequiredProps>, options: {
|
|
12
11
|
rawResponse: true;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
create(data: RequirementsOf<ApiGroup, RequiredProps>, options: Options<InternalQueryParams>): Promise<Group>;
|
|
12
|
+
} & Options): Promise<AxiosResponse<ApiGroup, any>>;
|
|
13
|
+
create(data: RequirementsOf<ApiGroup, RequiredProps>, options: Options): Promise<Group>;
|
|
16
14
|
get(id: number): Promise<Group>;
|
|
17
15
|
get(id: number, options: {
|
|
18
16
|
rawResponse: true;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
listByPage(options?: Options<GroupsQueryParams & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiGroup[], any>, any, unknown>;
|
|
17
|
+
} & Options): Promise<AxiosResponse<ApiGroup, any>>;
|
|
18
|
+
get(id: number, options: Options): Promise<Group>;
|
|
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>;
|
|
25
22
|
update(id: number, data: Partial<ApiGroup>): Promise<Group>;
|
|
26
23
|
update(id: number, data: Partial<ApiGroup>, options: {
|
|
27
24
|
rawResponse: true;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
update(id: number, data: Partial<ApiGroup>, options: Options<InternalQueryParams>): Promise<Group>;
|
|
25
|
+
} & Options): Promise<AxiosResponse<ApiGroup, any>>;
|
|
26
|
+
update(id: number, data: Partial<ApiGroup>, options: Options): Promise<Group>;
|
|
31
27
|
delete(id: number): Promise<number>;
|
|
32
28
|
delete(id: number, options: {
|
|
33
29
|
rawResponse: true;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
delete(id: number, options: Options<InternalQueryParams>): Promise<number>;
|
|
30
|
+
} & Options): Promise<AxiosResponse<any, any>>;
|
|
31
|
+
delete(id: number, options: Options): Promise<number>;
|
|
37
32
|
}
|
|
38
|
-
export {
|
|
33
|
+
export {};
|
|
@@ -43,14 +43,14 @@ class GroupsService extends index_js_1.Service {
|
|
|
43
43
|
get(id, options) {
|
|
44
44
|
return super.fetch({ url: `${this.apiPath}/${id}` }, options).then((res) => Promise.resolve((options === null || options === void 0 ? void 0 : options.rawResponse) ? res : new group_model_js_1.Group(res.data)), (err) => Promise.reject((options === null || options === void 0 ? void 0 : options.rawResponse) ? err : new error_response_model_js_1.ErrorResponse(err)));
|
|
45
45
|
}
|
|
46
|
-
list(options) {
|
|
46
|
+
list(query, options) {
|
|
47
47
|
const _super = Object.create(null, {
|
|
48
48
|
iterator: { get: () => super.iterator }
|
|
49
49
|
});
|
|
50
50
|
return __asyncGenerator(this, arguments, function* list_1() {
|
|
51
51
|
var e_1, _a;
|
|
52
52
|
try {
|
|
53
|
-
for (var _b = __asyncValues(_super.iterator.call(this, { url: this.apiPath }, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
|
|
53
|
+
for (var _b = __asyncValues(_super.iterator.call(this, { url: this.apiPath, params: query }, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
|
|
54
54
|
const res = _c.value;
|
|
55
55
|
yield yield __await(new group_model_js_1.Group(res));
|
|
56
56
|
}
|
|
@@ -64,13 +64,13 @@ class GroupsService extends index_js_1.Service {
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
listAll() {
|
|
67
|
+
listAll(query, options) {
|
|
68
68
|
var e_2, _a;
|
|
69
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
70
|
try {
|
|
71
71
|
const groups = [];
|
|
72
72
|
try {
|
|
73
|
-
for (var _b = __asyncValues(this.list()), _c; _c = yield _b.next(), !_c.done;) {
|
|
73
|
+
for (var _b = __asyncValues(this.list(query, options)), _c; _c = yield _b.next(), !_c.done;) {
|
|
74
74
|
const group = _c.value;
|
|
75
75
|
groups.push(group);
|
|
76
76
|
}
|
|
@@ -89,8 +89,8 @@ class GroupsService extends index_js_1.Service {
|
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
listByPage(options) {
|
|
93
|
-
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
92
|
+
listByPage(query, options) {
|
|
93
|
+
return super.iterator({ url: this.apiPath, params: query }, options).byPage();
|
|
94
94
|
}
|
|
95
95
|
update(id, data, options) {
|
|
96
96
|
return super
|
|
@@ -3,6 +3,7 @@ export * from './accounts.service.js';
|
|
|
3
3
|
export * from './attendance.service.js';
|
|
4
4
|
export * from './availability.service.js';
|
|
5
5
|
export * from './daily-budgets.service.js';
|
|
6
|
+
export * from './daily-revenue.service.js';
|
|
6
7
|
export * from './days-off.service.js';
|
|
7
8
|
export * from './groups.service.js';
|
|
8
9
|
export * from './leave-request.service.js';
|
|
@@ -15,6 +15,7 @@ __exportStar(require("./accounts.service.js"), exports);
|
|
|
15
15
|
__exportStar(require("./attendance.service.js"), exports);
|
|
16
16
|
__exportStar(require("./availability.service.js"), exports);
|
|
17
17
|
__exportStar(require("./daily-budgets.service.js"), exports);
|
|
18
|
+
__exportStar(require("./daily-revenue.service.js"), exports);
|
|
18
19
|
__exportStar(require("./days-off.service.js"), exports);
|
|
19
20
|
__exportStar(require("./groups.service.js"), exports);
|
|
20
21
|
__exportStar(require("./leave-request.service.js"), exports);
|