rotacloud 1.0.9 → 1.0.12
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/README.md +1 -1
- package/dist/cjs/models/user.model.d.ts +31 -1
- package/dist/cjs/models/user.model.js +31 -1
- package/dist/cjs/services/accounts.service.d.ts +1 -0
- package/dist/cjs/services/accounts.service.js +34 -0
- package/dist/cjs/services/attendance.service.d.ts +1 -0
- package/dist/cjs/services/attendance.service.js +34 -0
- package/dist/cjs/services/days-off.service.d.ts +1 -0
- package/dist/cjs/services/days-off.service.js +34 -0
- package/dist/cjs/services/groups.service.d.ts +1 -0
- package/dist/cjs/services/groups.service.js +34 -0
- package/dist/cjs/services/leave-embargoes.service.d.ts +1 -0
- package/dist/cjs/services/leave-embargoes.service.js +34 -0
- package/dist/cjs/services/leave-request.service.d.ts +1 -0
- package/dist/cjs/services/leave-request.service.js +34 -0
- package/dist/cjs/services/leave.service.d.ts +1 -0
- package/dist/cjs/services/leave.service.js +37 -3
- package/dist/cjs/services/locations.service.d.ts +1 -0
- package/dist/cjs/services/locations.service.js +34 -0
- package/dist/cjs/services/roles.service.d.ts +1 -0
- package/dist/cjs/services/roles.service.js +34 -0
- package/dist/cjs/services/shifts.service.d.ts +1 -0
- package/dist/cjs/services/shifts.service.js +34 -0
- package/dist/cjs/services/users.service.d.ts +1 -0
- package/dist/cjs/services/users.service.js +34 -0
- package/dist/cjs/version.js +1 -1
- package/dist/mjs/models/user.model.d.ts +31 -1
- package/dist/mjs/models/user.model.js +31 -1
- package/dist/mjs/services/accounts.service.d.ts +1 -0
- package/dist/mjs/services/accounts.service.js +12 -0
- package/dist/mjs/services/attendance.service.d.ts +1 -0
- package/dist/mjs/services/attendance.service.js +12 -0
- package/dist/mjs/services/days-off.service.d.ts +1 -0
- package/dist/mjs/services/days-off.service.js +12 -0
- package/dist/mjs/services/groups.service.d.ts +1 -0
- package/dist/mjs/services/groups.service.js +12 -0
- package/dist/mjs/services/leave-embargoes.service.d.ts +1 -0
- package/dist/mjs/services/leave-embargoes.service.js +12 -0
- package/dist/mjs/services/leave-request.service.d.ts +1 -0
- package/dist/mjs/services/leave-request.service.js +12 -0
- package/dist/mjs/services/leave.service.d.ts +1 -0
- package/dist/mjs/services/leave.service.js +12 -0
- package/dist/mjs/services/locations.service.d.ts +1 -0
- package/dist/mjs/services/locations.service.js +12 -0
- package/dist/mjs/services/roles.service.d.ts +1 -0
- package/dist/mjs/services/roles.service.js +12 -0
- package/dist/mjs/services/shifts.service.d.ts +1 -0
- package/dist/mjs/services/shifts.service.js +12 -0
- package/dist/mjs/services/users.service.d.ts +1 -0
- package/dist/mjs/services/users.service.js +12 -0
- package/dist/mjs/version.js +1 -1
- package/package.json +1 -1
- package/src/models/user.model.ts +62 -2
- package/src/services/accounts.service.ts +13 -0
- package/src/services/attendance.service.ts +13 -0
- package/src/services/days-off.service.ts +13 -0
- package/src/services/groups.service.ts +13 -0
- package/src/services/leave-embargoes.service.ts +13 -0
- package/src/services/leave-request.service.ts +13 -0
- package/src/services/leave.service.ts +13 -0
- package/src/services/locations.service.ts +13 -0
- package/src/services/roles.service.ts +13 -0
- package/src/services/shifts.service.ts +13 -0
- package/src/services/users.service.ts +13 -0
- package/src/version.ts +1 -1
|
@@ -1,4 +1,13 @@
|
|
|
1
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
|
+
};
|
|
2
11
|
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
3
12
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
4
13
|
var m = o[Symbol.asyncIterator], i;
|
|
@@ -55,6 +64,31 @@ class ShiftsService extends index_js_1.Service {
|
|
|
55
64
|
}
|
|
56
65
|
});
|
|
57
66
|
}
|
|
67
|
+
listAll() {
|
|
68
|
+
var e_2, _a;
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
try {
|
|
71
|
+
const shifts = [];
|
|
72
|
+
try {
|
|
73
|
+
for (var _b = __asyncValues(this.list()), _c; _c = yield _b.next(), !_c.done;) {
|
|
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; }
|
|
84
|
+
}
|
|
85
|
+
return shifts;
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
return err;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
58
92
|
listByPage(options) {
|
|
59
93
|
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
60
94
|
}
|
|
@@ -20,6 +20,7 @@ declare class UsersService extends Service {
|
|
|
20
20
|
}): Promise<AxiosResponse<ApiUser, any>>;
|
|
21
21
|
get(id: number, options: Options<InternalQueryParams>): Promise<User>;
|
|
22
22
|
list(options?: Options<UsersQueryParams & InternalQueryParams>): AsyncGenerator<User, void, unknown>;
|
|
23
|
+
listAll(): Promise<User[]>;
|
|
23
24
|
listByPage(options?: Options<UsersQueryParams & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiUser[], any>, any, unknown>;
|
|
24
25
|
update(id: number, data: Partial<ApiUser>): Promise<User>;
|
|
25
26
|
update(id: number, data: Partial<ApiUser>, options: {
|
|
@@ -1,4 +1,13 @@
|
|
|
1
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
|
+
};
|
|
2
11
|
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
3
12
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
4
13
|
var m = o[Symbol.asyncIterator], i;
|
|
@@ -55,6 +64,31 @@ class UsersService extends index_js_1.Service {
|
|
|
55
64
|
}
|
|
56
65
|
});
|
|
57
66
|
}
|
|
67
|
+
listAll() {
|
|
68
|
+
var e_2, _a;
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
try {
|
|
71
|
+
const users = [];
|
|
72
|
+
try {
|
|
73
|
+
for (var _b = __asyncValues(this.list()), _c; _c = yield _b.next(), !_c.done;) {
|
|
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; }
|
|
84
|
+
}
|
|
85
|
+
return users;
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
return err;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
58
92
|
listByPage(options) {
|
|
59
93
|
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
60
94
|
}
|
package/dist/cjs/version.js
CHANGED
|
@@ -25,9 +25,39 @@ export interface TeamProperties {
|
|
|
25
25
|
}
|
|
26
26
|
export declare class User {
|
|
27
27
|
id: number;
|
|
28
|
+
created_at: number;
|
|
29
|
+
created_by: number;
|
|
30
|
+
deleted: boolean;
|
|
31
|
+
deleted_at: number | null;
|
|
32
|
+
deleted_by: number | null;
|
|
33
|
+
level: string;
|
|
28
34
|
first_name: string;
|
|
35
|
+
middle_name: string | null;
|
|
29
36
|
last_name: string;
|
|
30
|
-
photo: string | null;
|
|
31
37
|
preferred_name: string | null;
|
|
38
|
+
photo: string | null;
|
|
39
|
+
two_factor_enabled: boolean;
|
|
40
|
+
email: string;
|
|
41
|
+
has_account: boolean;
|
|
42
|
+
invite_sent: boolean;
|
|
43
|
+
group: number | null;
|
|
44
|
+
locations: number[];
|
|
45
|
+
roles: number[];
|
|
46
|
+
default_role: number | null;
|
|
47
|
+
dob: string | null;
|
|
48
|
+
start_date: string | null;
|
|
49
|
+
final_working_date: string | null;
|
|
50
|
+
weekly_hours: number | null;
|
|
51
|
+
holiday_allowance: number;
|
|
52
|
+
holiday_allowance_unit: string;
|
|
53
|
+
payroll_id: string | null;
|
|
54
|
+
salary: number;
|
|
55
|
+
salary_type: string;
|
|
56
|
+
overtime_rate: number;
|
|
57
|
+
role_rates: LeaveRates;
|
|
58
|
+
leave_rates: RoleRates;
|
|
59
|
+
leave_rates_unit: string;
|
|
60
|
+
leave_rates_type: string;
|
|
61
|
+
notes: string | null;
|
|
32
62
|
constructor(user: ApiUser);
|
|
33
63
|
}
|
|
@@ -2,9 +2,39 @@
|
|
|
2
2
|
export class User {
|
|
3
3
|
constructor(user) {
|
|
4
4
|
this.id = user.id;
|
|
5
|
+
this.created_at = user.created_at;
|
|
6
|
+
this.created_by = user.created_by;
|
|
7
|
+
this.deleted = user.deleted;
|
|
8
|
+
this.deleted_at = user.deleted_at;
|
|
9
|
+
this.deleted_by = user.deleted_by;
|
|
10
|
+
this.level = user.level;
|
|
5
11
|
this.first_name = user.first_name;
|
|
12
|
+
this.middle_name = user.middle_name;
|
|
6
13
|
this.last_name = user.last_name;
|
|
7
|
-
this.photo = user.photo;
|
|
8
14
|
this.preferred_name = user.preferred_name;
|
|
15
|
+
this.photo = user.photo;
|
|
16
|
+
this.two_factor_enabled = user.two_factor_enabled;
|
|
17
|
+
this.email = user.email;
|
|
18
|
+
this.has_account = user.has_account;
|
|
19
|
+
this.invite_sent = user.invite_sent;
|
|
20
|
+
this.group = user.group;
|
|
21
|
+
this.locations = user.locations;
|
|
22
|
+
this.roles = user.roles;
|
|
23
|
+
this.default_role = user.default_role;
|
|
24
|
+
this.dob = user.dob;
|
|
25
|
+
this.start_date = user.start_date;
|
|
26
|
+
this.final_working_date = user.final_working_date;
|
|
27
|
+
this.weekly_hours = user.weekly_hours;
|
|
28
|
+
this.holiday_allowance = user.holiday_allowance;
|
|
29
|
+
this.holiday_allowance_unit = user.holiday_allowance_unit;
|
|
30
|
+
this.payroll_id = user.payroll_id;
|
|
31
|
+
this.salary = user.salary;
|
|
32
|
+
this.salary_type = user.salary_type;
|
|
33
|
+
this.overtime_rate = user.overtime_rate;
|
|
34
|
+
this.role_rates = user.role_rates;
|
|
35
|
+
this.leave_rates = user.leave_rates;
|
|
36
|
+
this.leave_rates_unit = user.leave_rates_unit;
|
|
37
|
+
this.leave_rates_type = user.leave_rates_type;
|
|
38
|
+
this.notes = user.notes;
|
|
9
39
|
}
|
|
10
40
|
}
|
|
@@ -5,6 +5,7 @@ import { InternalQueryParams } from '../interfaces/query-params/internal-query-p
|
|
|
5
5
|
declare class AccountsService extends Service {
|
|
6
6
|
private apiPath;
|
|
7
7
|
list(options?: Options<InternalQueryParams>): AsyncGenerator<Account, void, unknown>;
|
|
8
|
+
listAll(): Promise<Account[]>;
|
|
8
9
|
listByPage(options?: Options<InternalQueryParams>): AsyncGenerator<import("axios").AxiosResponse<ApiAccount[], any>, any, unknown>;
|
|
9
10
|
}
|
|
10
11
|
export { AccountsService };
|
|
@@ -10,6 +10,18 @@ class AccountsService extends Service {
|
|
|
10
10
|
yield new Account(res);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
+
async listAll() {
|
|
14
|
+
try {
|
|
15
|
+
const accounts = [];
|
|
16
|
+
for await (const account of this.list()) {
|
|
17
|
+
accounts.push(account);
|
|
18
|
+
}
|
|
19
|
+
return accounts;
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
return err;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
13
25
|
listByPage(options) {
|
|
14
26
|
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
15
27
|
}
|
|
@@ -20,6 +20,7 @@ declare class AttendanceService extends Service {
|
|
|
20
20
|
}): Promise<AxiosResponse<ApiAttendance, any>>;
|
|
21
21
|
get(id: number, options: Options<InternalQueryParams>): Promise<ApiAttendance>;
|
|
22
22
|
list(options?: Options<AttendanceQueryParams & InternalQueryParams>): AsyncGenerator<Attendance, void, unknown>;
|
|
23
|
+
listAll(): Promise<Attendance[]>;
|
|
23
24
|
listByPage(options?: Options<AttendanceQueryParams & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiAttendance[], any>, any, unknown>;
|
|
24
25
|
update(id: number, data: Partial<ApiAttendance>): Promise<Attendance>;
|
|
25
26
|
update(id: number, data: Partial<ApiAttendance>, options: {
|
|
@@ -17,6 +17,18 @@ class AttendanceService extends Service {
|
|
|
17
17
|
yield new Attendance(res);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
async listAll() {
|
|
21
|
+
try {
|
|
22
|
+
const attendance = [];
|
|
23
|
+
for await (const atten of this.list()) {
|
|
24
|
+
attendance.push(atten);
|
|
25
|
+
}
|
|
26
|
+
return attendance;
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
return err;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
20
32
|
listByPage(options) {
|
|
21
33
|
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
22
34
|
}
|
|
@@ -13,6 +13,7 @@ declare class DaysOffService extends Service<ApiDaysOff> {
|
|
|
13
13
|
}): Promise<AxiosResponse<ApiDaysOff, any>>;
|
|
14
14
|
create(dates: string[], users: number[], options: Options<InternalQueryParams>): Promise<number>;
|
|
15
15
|
list(options?: Options<DaysOffQueryParams & InternalQueryParams>): AsyncGenerator<DaysOff, void, unknown>;
|
|
16
|
+
listAll(): Promise<DaysOff[]>;
|
|
16
17
|
listByPage(options?: Options<DaysOffQueryParams & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiDaysOff[], any>, any, unknown>;
|
|
17
18
|
delete(dates: string[], users: number[]): Promise<number>;
|
|
18
19
|
delete(dates: string[], users: number[], options: {
|
|
@@ -23,6 +23,18 @@ class DaysOffService extends Service {
|
|
|
23
23
|
yield new DaysOff(res);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
+
async listAll() {
|
|
27
|
+
try {
|
|
28
|
+
const daysOff = [];
|
|
29
|
+
for await (const dayOff of this.list()) {
|
|
30
|
+
daysOff.push(dayOff);
|
|
31
|
+
}
|
|
32
|
+
return daysOff;
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
return err;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
26
38
|
listByPage(options) {
|
|
27
39
|
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
28
40
|
}
|
|
@@ -20,6 +20,7 @@ declare class GroupsService extends Service {
|
|
|
20
20
|
}): Promise<AxiosResponse<ApiGroup, any>>;
|
|
21
21
|
get(id: number, options: Options<InternalQueryParams>): Promise<Group>;
|
|
22
22
|
list(options?: Options<GroupsQueryParams & InternalQueryParams>): AsyncGenerator<Group, void, unknown>;
|
|
23
|
+
listAll(): Promise<Group[]>;
|
|
23
24
|
listByPage(options?: Options<GroupsQueryParams & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiGroup[], any>, any, unknown>;
|
|
24
25
|
update(id: number, data: Partial<ApiGroup>): Promise<Group>;
|
|
25
26
|
update(id: number, data: Partial<ApiGroup>, options: {
|
|
@@ -17,6 +17,18 @@ class GroupsService extends Service {
|
|
|
17
17
|
yield new Group(res);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
async listAll() {
|
|
21
|
+
try {
|
|
22
|
+
const groups = [];
|
|
23
|
+
for await (const group of this.list()) {
|
|
24
|
+
groups.push(group);
|
|
25
|
+
}
|
|
26
|
+
return groups;
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
return err;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
20
32
|
listByPage(options) {
|
|
21
33
|
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
22
34
|
}
|
|
@@ -20,6 +20,7 @@ declare class LeaveEmbargoesService extends Service {
|
|
|
20
20
|
}): Promise<AxiosResponse<ApiLeaveEmbargo, any>>;
|
|
21
21
|
get(id: number, options: Options<InternalQueryParams>): Promise<LeaveEmbargo>;
|
|
22
22
|
list(options?: Options<UsersQueryParams & InternalQueryParams>): AsyncGenerator<LeaveEmbargo, void, unknown>;
|
|
23
|
+
listAll(): Promise<LeaveEmbargo[]>;
|
|
23
24
|
listByPage(options?: Options<UsersQueryParams & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiLeaveEmbargo[], any>, any, unknown>;
|
|
24
25
|
update(id: number, data: Partial<ApiLeaveEmbargo>): Promise<LeaveEmbargo>;
|
|
25
26
|
update(id: number, data: Partial<ApiLeaveEmbargo>, options: {
|
|
@@ -17,6 +17,18 @@ class LeaveEmbargoesService extends Service {
|
|
|
17
17
|
yield new LeaveEmbargo(res);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
async listAll() {
|
|
21
|
+
try {
|
|
22
|
+
const leave = [];
|
|
23
|
+
for await (const leaveEmbargoRecord of this.list()) {
|
|
24
|
+
leave.push(leaveEmbargoRecord);
|
|
25
|
+
}
|
|
26
|
+
return leave;
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
return err;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
20
32
|
listByPage(options) {
|
|
21
33
|
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
22
34
|
}
|
|
@@ -20,6 +20,7 @@ declare class LeaveRequestService extends Service {
|
|
|
20
20
|
}): Promise<AxiosResponse<ApiLeaveRequest, any>>;
|
|
21
21
|
get(id: number, options: Options<InternalQueryParams>): Promise<LeaveRequest>;
|
|
22
22
|
list(options?: Options<LeaveQueryParams & InternalQueryParams>): AsyncGenerator<LeaveRequest, void, unknown>;
|
|
23
|
+
listAll(): Promise<LeaveRequest[]>;
|
|
23
24
|
listByPage(options?: Options<LeaveQueryParams & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiLeaveRequest[], any>, any, unknown>;
|
|
24
25
|
update(id: number, data: Partial<ApiLeaveRequest>): Promise<LeaveRequest>;
|
|
25
26
|
update(id: number, data: Partial<ApiLeaveRequest>, options: {
|
|
@@ -17,6 +17,18 @@ class LeaveRequestService extends Service {
|
|
|
17
17
|
yield new LeaveRequest(res);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
async listAll() {
|
|
21
|
+
try {
|
|
22
|
+
const leave = [];
|
|
23
|
+
for await (const leaveRequestRecord of this.list()) {
|
|
24
|
+
leave.push(leaveRequestRecord);
|
|
25
|
+
}
|
|
26
|
+
return leave;
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
return err;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
20
32
|
listByPage(options) {
|
|
21
33
|
return super.iterator({ url: `${this.apiPath}` }, options).byPage();
|
|
22
34
|
}
|
|
@@ -21,6 +21,7 @@ declare class LeaveService extends Service {
|
|
|
21
21
|
}): Promise<AxiosResponse<ApiLeave, any>>;
|
|
22
22
|
get(id: number, options: Options<InternalQueryParams>): Promise<Leave>;
|
|
23
23
|
list(options?: Options<LeaveQueryParams & InternalQueryParams>): AsyncGenerator<Leave, void, unknown>;
|
|
24
|
+
listAll(): Promise<Leave[]>;
|
|
24
25
|
listLeaveTypes(options?: Options<InternalQueryParams>): AsyncGenerator<LeaveType, void, unknown>;
|
|
25
26
|
listByPage(options?: Options<LeaveQueryParams & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiLeave[], any>, any, unknown>;
|
|
26
27
|
update(id: number, data: Partial<ApiLeave>): Promise<Leave>;
|
|
@@ -18,6 +18,18 @@ class LeaveService extends Service {
|
|
|
18
18
|
yield new Leave(res);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
async listAll() {
|
|
22
|
+
try {
|
|
23
|
+
const leave = [];
|
|
24
|
+
for await (const leaveRecord of this.list()) {
|
|
25
|
+
leave.push(leaveRecord);
|
|
26
|
+
}
|
|
27
|
+
return leave;
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
return err;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
21
33
|
async *listLeaveTypes(options) {
|
|
22
34
|
for await (const res of super.iterator({ url: this.apiPath }, options)) {
|
|
23
35
|
yield new LeaveType(res);
|
|
@@ -20,6 +20,7 @@ declare class LocationsService extends Service {
|
|
|
20
20
|
}): Promise<AxiosResponse<ApiLocation, any>>;
|
|
21
21
|
get(id: number, options: Options<InternalQueryParams>): Promise<ApiLocation>;
|
|
22
22
|
list(options?: Options<LocationsQueryParams & InternalQueryParams>): AsyncGenerator<Location, void, unknown>;
|
|
23
|
+
listAll(): Promise<Location[]>;
|
|
23
24
|
listByPage(options?: Options<LocationsQueryParams & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiLocation[], any>, any, unknown>;
|
|
24
25
|
update(id: number, data: Partial<ApiLocation>): Promise<Location>;
|
|
25
26
|
update(id: number, data: Partial<ApiLocation>, options: {
|
|
@@ -17,6 +17,18 @@ class LocationsService extends Service {
|
|
|
17
17
|
yield new Location(res);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
async listAll() {
|
|
21
|
+
try {
|
|
22
|
+
const locations = [];
|
|
23
|
+
for await (const location of this.list()) {
|
|
24
|
+
locations.push(location);
|
|
25
|
+
}
|
|
26
|
+
return locations;
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
return err;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
20
32
|
listByPage(options) {
|
|
21
33
|
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
22
34
|
}
|
|
@@ -20,6 +20,7 @@ declare class RolesService extends Service {
|
|
|
20
20
|
}): Promise<AxiosResponse<ApiRole, any>>;
|
|
21
21
|
get(id: number, options: Options<InternalQueryParams>): Promise<Role>;
|
|
22
22
|
list(options?: Options<RolesQueryParams & InternalQueryParams>): AsyncGenerator<Role, void, unknown>;
|
|
23
|
+
listAll(): Promise<Role[]>;
|
|
23
24
|
listByPage(options?: Options<RolesQueryParams & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiRole[], any>, any, unknown>;
|
|
24
25
|
update(id: number, data: Partial<ApiRole>): Promise<Role>;
|
|
25
26
|
update(id: number, data: Partial<ApiRole>, options: {
|
|
@@ -17,6 +17,18 @@ class RolesService extends Service {
|
|
|
17
17
|
yield new Role(res);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
async listAll() {
|
|
21
|
+
try {
|
|
22
|
+
const roles = [];
|
|
23
|
+
for await (const role of this.list()) {
|
|
24
|
+
roles.push(role);
|
|
25
|
+
}
|
|
26
|
+
return roles;
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
return err;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
20
32
|
listByPage(options) {
|
|
21
33
|
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
22
34
|
}
|
|
@@ -20,6 +20,7 @@ declare class ShiftsService extends Service {
|
|
|
20
20
|
}): Promise<AxiosResponse<ApiShift, any>>;
|
|
21
21
|
get(id: number, options: Options<InternalQueryParams>): Promise<Shift>;
|
|
22
22
|
list(options?: Options<ShiftsQueryParams & InternalQueryParams>): AsyncGenerator<Shift, void, unknown>;
|
|
23
|
+
listAll(): Promise<Shift[]>;
|
|
23
24
|
listByPage(options?: Options<ShiftsQueryParams & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiShift[], any>, any, unknown>;
|
|
24
25
|
update(id: number, data: Partial<ApiShift>): Promise<Shift>;
|
|
25
26
|
update(id: number, data: Partial<ApiShift>, options: {
|
|
@@ -17,6 +17,18 @@ class ShiftsService extends Service {
|
|
|
17
17
|
yield new Shift(res);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
async listAll() {
|
|
21
|
+
try {
|
|
22
|
+
const shifts = [];
|
|
23
|
+
for await (const shift of this.list()) {
|
|
24
|
+
shifts.push(shift);
|
|
25
|
+
}
|
|
26
|
+
return shifts;
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
return err;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
20
32
|
listByPage(options) {
|
|
21
33
|
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
22
34
|
}
|
|
@@ -20,6 +20,7 @@ declare class UsersService extends Service {
|
|
|
20
20
|
}): Promise<AxiosResponse<ApiUser, any>>;
|
|
21
21
|
get(id: number, options: Options<InternalQueryParams>): Promise<User>;
|
|
22
22
|
list(options?: Options<UsersQueryParams & InternalQueryParams>): AsyncGenerator<User, void, unknown>;
|
|
23
|
+
listAll(): Promise<User[]>;
|
|
23
24
|
listByPage(options?: Options<UsersQueryParams & InternalQueryParams>): AsyncGenerator<AxiosResponse<ApiUser[], any>, any, unknown>;
|
|
24
25
|
update(id: number, data: Partial<ApiUser>): Promise<User>;
|
|
25
26
|
update(id: number, data: Partial<ApiUser>, options: {
|
|
@@ -17,6 +17,18 @@ class UsersService extends Service {
|
|
|
17
17
|
yield new User(res);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
async listAll() {
|
|
21
|
+
try {
|
|
22
|
+
const users = [];
|
|
23
|
+
for await (const user of this.list()) {
|
|
24
|
+
users.push(user);
|
|
25
|
+
}
|
|
26
|
+
return users;
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
return err;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
20
32
|
listByPage(options) {
|
|
21
33
|
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
22
34
|
}
|
package/dist/mjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const Version = { version: "1.0.
|
|
1
|
+
export const Version = { version: "1.0.12" };
|
package/package.json
CHANGED
package/src/models/user.model.ts
CHANGED
|
@@ -32,16 +32,76 @@ export interface TeamProperties {
|
|
|
32
32
|
// Models should be an abstraction over Api Models/Responses
|
|
33
33
|
export class User {
|
|
34
34
|
public id: number;
|
|
35
|
+
public created_at: number;
|
|
36
|
+
public created_by: number;
|
|
37
|
+
public deleted: boolean;
|
|
38
|
+
public deleted_at: number | null;
|
|
39
|
+
public deleted_by: number | null;
|
|
40
|
+
public level: string;
|
|
35
41
|
public first_name: string;
|
|
42
|
+
public middle_name: string | null;
|
|
36
43
|
public last_name: string;
|
|
37
|
-
public photo: string | null;
|
|
38
44
|
public preferred_name: string | null;
|
|
45
|
+
public photo: string | null;
|
|
46
|
+
public two_factor_enabled: boolean;
|
|
47
|
+
public email: string;
|
|
48
|
+
public has_account: boolean;
|
|
49
|
+
public invite_sent: boolean;
|
|
50
|
+
public group: number | null;
|
|
51
|
+
public locations: number[];
|
|
52
|
+
public roles: number[];
|
|
53
|
+
public default_role: number | null;
|
|
54
|
+
public dob: string | null;
|
|
55
|
+
public start_date: string | null;
|
|
56
|
+
public final_working_date: string | null;
|
|
57
|
+
public weekly_hours: number | null;
|
|
58
|
+
public holiday_allowance: number;
|
|
59
|
+
public holiday_allowance_unit: string;
|
|
60
|
+
public payroll_id: string | null;
|
|
61
|
+
public salary: number;
|
|
62
|
+
public salary_type: string;
|
|
63
|
+
public overtime_rate: number;
|
|
64
|
+
public role_rates: LeaveRates;
|
|
65
|
+
public leave_rates: RoleRates;
|
|
66
|
+
public leave_rates_unit: string;
|
|
67
|
+
public leave_rates_type: string;
|
|
68
|
+
public notes: string | null;
|
|
39
69
|
|
|
40
70
|
constructor(user: ApiUser) {
|
|
41
71
|
this.id = user.id;
|
|
72
|
+
this.created_at = user.created_at;
|
|
73
|
+
this.created_by = user.created_by;
|
|
74
|
+
this.deleted = user.deleted;
|
|
75
|
+
this.deleted_at = user.deleted_at;
|
|
76
|
+
this.deleted_by = user.deleted_by;
|
|
77
|
+
this.level = user.level;
|
|
42
78
|
this.first_name = user.first_name;
|
|
79
|
+
this.middle_name = user.middle_name;
|
|
43
80
|
this.last_name = user.last_name;
|
|
44
|
-
this.photo = user.photo;
|
|
45
81
|
this.preferred_name = user.preferred_name;
|
|
82
|
+
this.photo = user.photo;
|
|
83
|
+
this.two_factor_enabled = user.two_factor_enabled;
|
|
84
|
+
this.email = user.email;
|
|
85
|
+
this.has_account = user.has_account;
|
|
86
|
+
this.invite_sent = user.invite_sent;
|
|
87
|
+
this.group = user.group;
|
|
88
|
+
this.locations = user.locations;
|
|
89
|
+
this.roles = user.roles;
|
|
90
|
+
this.default_role = user.default_role;
|
|
91
|
+
this.dob = user.dob;
|
|
92
|
+
this.start_date = user.start_date;
|
|
93
|
+
this.final_working_date = user.final_working_date;
|
|
94
|
+
this.weekly_hours = user.weekly_hours;
|
|
95
|
+
this.holiday_allowance = user.holiday_allowance;
|
|
96
|
+
this.holiday_allowance_unit = user.holiday_allowance_unit;
|
|
97
|
+
this.payroll_id = user.payroll_id;
|
|
98
|
+
this.salary = user.salary;
|
|
99
|
+
this.salary_type = user.salary_type;
|
|
100
|
+
this.overtime_rate = user.overtime_rate;
|
|
101
|
+
this.role_rates = user.role_rates;
|
|
102
|
+
this.leave_rates = user.leave_rates;
|
|
103
|
+
this.leave_rates_unit = user.leave_rates_unit;
|
|
104
|
+
this.leave_rates_type = user.leave_rates_type;
|
|
105
|
+
this.notes = user.notes;
|
|
46
106
|
}
|
|
47
107
|
}
|
|
@@ -13,6 +13,19 @@ class AccountsService extends Service {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
listAll(): Promise<Account[]>;
|
|
17
|
+
async listAll() {
|
|
18
|
+
try {
|
|
19
|
+
const accounts = [] as Account[];
|
|
20
|
+
for await (const account of this.list()) {
|
|
21
|
+
accounts.push(account);
|
|
22
|
+
}
|
|
23
|
+
return accounts;
|
|
24
|
+
} catch (err) {
|
|
25
|
+
return err;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
16
29
|
listByPage(options?: Options<InternalQueryParams>) {
|
|
17
30
|
return super.iterator<ApiAccount>({ url: this.apiPath }, options).byPage();
|
|
18
31
|
}
|
|
@@ -47,6 +47,19 @@ class AttendanceService extends Service {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
listAll(): Promise<Attendance[]>;
|
|
51
|
+
async listAll() {
|
|
52
|
+
try {
|
|
53
|
+
const attendance = [] as Attendance[];
|
|
54
|
+
for await (const atten of this.list()) {
|
|
55
|
+
attendance.push(atten);
|
|
56
|
+
}
|
|
57
|
+
return attendance;
|
|
58
|
+
} catch (err) {
|
|
59
|
+
return err;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
50
63
|
listByPage(options?: Options<AttendanceQueryParams & InternalQueryParams>) {
|
|
51
64
|
return super.iterator<ApiAttendance>({ url: this.apiPath }, options).byPage();
|
|
52
65
|
}
|
|
@@ -39,6 +39,19 @@ class DaysOffService extends Service<ApiDaysOff> {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
listAll(): Promise<DaysOff[]>;
|
|
43
|
+
async listAll() {
|
|
44
|
+
try {
|
|
45
|
+
const daysOff = [] as DaysOff[];
|
|
46
|
+
for await (const dayOff of this.list()) {
|
|
47
|
+
daysOff.push(dayOff);
|
|
48
|
+
}
|
|
49
|
+
return daysOff;
|
|
50
|
+
} catch (err) {
|
|
51
|
+
return err;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
42
55
|
listByPage(options?: Options<DaysOffQueryParams & InternalQueryParams>) {
|
|
43
56
|
return super.iterator({ url: this.apiPath }, options).byPage();
|
|
44
57
|
}
|