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.
Files changed (85) hide show
  1. package/dist/cjs/interfaces/{day-notes.interface.d.ts → day-note.interface.d.ts} +1 -1
  2. package/dist/cjs/interfaces/{day-notes.interface.js → day-note.interface.js} +0 -0
  3. package/dist/cjs/interfaces/index.d.ts +1 -1
  4. package/dist/cjs/interfaces/index.js +1 -1
  5. package/dist/cjs/interfaces/query-params/day-notes-query-params.interface.d.ts +2 -2
  6. package/dist/cjs/interfaces/query-params/shifts-query-params.interface.d.ts +2 -2
  7. package/dist/cjs/models/{day-notes.model.d.ts → day-note.model.d.ts} +3 -3
  8. package/dist/cjs/models/day-note.model.js +14 -0
  9. package/dist/cjs/rotacloud.d.ts +2 -0
  10. package/dist/cjs/rotacloud.js +2 -0
  11. package/dist/cjs/services/accounts.service.js +11 -16
  12. package/dist/cjs/services/attendance.service.js +11 -16
  13. package/dist/cjs/services/daily-budgets.service.js +11 -16
  14. package/dist/cjs/services/daily-revenue.service.js +11 -16
  15. package/dist/cjs/services/day-notes.service.d.ts +31 -0
  16. package/dist/cjs/services/day-notes.service.js +103 -0
  17. package/dist/cjs/services/days-off.service.js +11 -16
  18. package/dist/cjs/services/groups.service.d.ts +3 -3
  19. package/dist/cjs/services/groups.service.js +11 -16
  20. package/dist/cjs/services/leave-embargoes.service.js +11 -16
  21. package/dist/cjs/services/leave-request.service.d.ts +3 -3
  22. package/dist/cjs/services/leave-request.service.js +13 -18
  23. package/dist/cjs/services/leave.service.js +11 -16
  24. package/dist/cjs/services/locations.service.d.ts +3 -3
  25. package/dist/cjs/services/locations.service.js +11 -16
  26. package/dist/cjs/services/roles.service.d.ts +3 -3
  27. package/dist/cjs/services/roles.service.js +11 -16
  28. package/dist/cjs/services/shifts.service.js +11 -16
  29. package/dist/cjs/services/users.service.js +11 -16
  30. package/dist/cjs/version.js +1 -1
  31. package/dist/mjs/interfaces/{day-notes.interface.d.ts → day-note.interface.d.ts} +1 -1
  32. package/dist/mjs/interfaces/{day-notes.interface.js → day-note.interface.js} +0 -0
  33. package/dist/mjs/interfaces/index.d.ts +1 -1
  34. package/dist/mjs/interfaces/index.js +1 -1
  35. package/dist/mjs/interfaces/query-params/day-notes-query-params.interface.d.ts +2 -2
  36. package/dist/mjs/interfaces/query-params/shifts-query-params.interface.d.ts +2 -2
  37. package/dist/mjs/models/{day-notes.model.d.ts → day-note.model.d.ts} +3 -3
  38. package/dist/mjs/models/day-note.model.js +10 -0
  39. package/dist/mjs/rotacloud.d.ts +2 -0
  40. package/dist/mjs/rotacloud.js +2 -0
  41. package/dist/mjs/services/accounts.service.js +4 -9
  42. package/dist/mjs/services/attendance.service.js +4 -9
  43. package/dist/mjs/services/daily-budgets.service.js +4 -9
  44. package/dist/mjs/services/daily-revenue.service.js +4 -9
  45. package/dist/mjs/services/day-notes.service.d.ts +31 -0
  46. package/dist/mjs/services/day-notes.service.js +42 -0
  47. package/dist/mjs/services/days-off.service.js +4 -9
  48. package/dist/mjs/services/groups.service.d.ts +3 -3
  49. package/dist/mjs/services/groups.service.js +4 -9
  50. package/dist/mjs/services/leave-embargoes.service.js +4 -9
  51. package/dist/mjs/services/leave-request.service.d.ts +3 -3
  52. package/dist/mjs/services/leave-request.service.js +6 -11
  53. package/dist/mjs/services/leave.service.js +4 -9
  54. package/dist/mjs/services/locations.service.d.ts +3 -3
  55. package/dist/mjs/services/locations.service.js +4 -9
  56. package/dist/mjs/services/roles.service.d.ts +3 -3
  57. package/dist/mjs/services/roles.service.js +4 -9
  58. package/dist/mjs/services/shifts.service.js +4 -9
  59. package/dist/mjs/services/users.service.js +4 -9
  60. package/dist/mjs/version.js +1 -1
  61. package/package.json +1 -1
  62. package/src/interfaces/{day-notes.interface.ts → day-note.interface.ts} +1 -1
  63. package/src/interfaces/index.ts +1 -1
  64. package/src/interfaces/query-params/day-notes-query-params.interface.ts +2 -2
  65. package/src/interfaces/query-params/shifts-query-params.interface.ts +2 -2
  66. package/src/models/day-note.model.ts +19 -0
  67. package/src/rotacloud.ts +2 -0
  68. package/src/services/accounts.service.ts +4 -8
  69. package/src/services/attendance.service.ts +4 -8
  70. package/src/services/daily-budgets.service.ts +4 -8
  71. package/src/services/daily-revenue.service.ts +4 -8
  72. package/src/services/day-notes.service.ts +81 -0
  73. package/src/services/days-off.service.ts +4 -8
  74. package/src/services/groups.service.ts +7 -11
  75. package/src/services/leave-embargoes.service.ts +4 -8
  76. package/src/services/leave-request.service.ts +8 -12
  77. package/src/services/leave.service.ts +4 -8
  78. package/src/services/locations.service.ts +7 -11
  79. package/src/services/roles.service.ts +7 -11
  80. package/src/services/shifts.service.ts +4 -8
  81. package/src/services/users.service.ts +4 -8
  82. package/src/version.ts +1 -1
  83. package/dist/cjs/models/day-notes.model.js +0 -9
  84. package/dist/mjs/models/day-notes.model.js +0 -5
  85. 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
- const locations = [];
72
- try {
73
- for (var _b = __asyncValues(this.list(query, options)), _c; _c = yield _b.next(), !_c.done;) {
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 (err) {
88
- return err;
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: 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>;
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
- const roles = [];
72
- try {
73
- for (var _b = __asyncValues(this.list(query, options)), _c; _c = yield _b.next(), !_c.done;) {
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 (err) {
88
- return err;
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
- const shifts = [];
72
- try {
73
- for (var _b = __asyncValues(this.list(query, options)), _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; }
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 (err) {
88
- return err;
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
- const users = [];
72
- try {
73
- for (var _b = __asyncValues(this.list(query, options)), _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; }
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 (err) {
88
- return err;
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) {
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Version = void 0;
4
- exports.Version = { version: '1.0.31' };
4
+ exports.Version = { version: '1.0.32' };
@@ -1,4 +1,4 @@
1
- export interface ApiDayNotes {
1
+ export interface ApiDayNote {
2
2
  id: number;
3
3
  start_date: string;
4
4
  end_date: string;
@@ -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-notes.interface.js';
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-notes.interface.js';
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,5 +1,5 @@
1
1
  export interface DayNotesQueryParams {
2
- start?: string;
3
- end?: string;
2
+ start: string;
3
+ end: string;
4
4
  locations?: number[];
5
5
  }
@@ -1,6 +1,6 @@
1
1
  export interface ShiftsQueryParams {
2
- start?: number;
3
- end?: number;
2
+ start: number;
3
+ end: number;
4
4
  ids?: number[];
5
5
  users?: number[];
6
6
  locations?: number[];
@@ -1,10 +1,10 @@
1
- import { ApiDayNotes } from '../interfaces/index.js';
2
- export declare class DayNotes {
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(dayNotes: ApiDayNotes);
9
+ constructor(dayNote: ApiDayNote);
10
10
  }
@@ -0,0 +1,10 @@
1
+ export class DayNote {
2
+ constructor(dayNote) {
3
+ this.id = dayNote.id;
4
+ this.start_date = dayNote.start_date;
5
+ this.end_date = dayNote.end_date;
6
+ this.locations = dayNote.locations;
7
+ this.title = dayNote.title;
8
+ this.message = dayNote.message;
9
+ }
10
+ }
@@ -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;
@@ -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
- try {
19
- const accounts = [];
20
- for await (const account of this.list(options)) {
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
- try {
22
- const attendance = [];
23
- for await (const atten of this.list(query, options)) {
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
- try {
16
- const attendance = [];
17
- for await (const atten of this.list(query, options)) {
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
- try {
16
- const attendance = [];
17
- for await (const atten of this.list(query, options)) {
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
- try {
28
- const daysOff = [];
29
- for await (const dayOff of this.list(query, options)) {
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: 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>;
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
- try {
22
- const groups = [];
23
- for await (const group of this.list(query, options)) {
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
- try {
22
- const leave = [];
23
- for await (const leaveEmbargoRecord of this.list(query, options)) {
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: LeaveQueryParams, options?: Options): AsyncGenerator<LeaveRequest, void, unknown>;
20
- listAll(query: LeaveQueryParams, options?: Options): Promise<LeaveRequest[]>;
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
- try {
22
- const leave = [];
23
- for await (const leaveRequestRecord of this.list(query, options)) {
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}` }, options).byPage();
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
- try {
23
- const leave = [];
24
- for await (const leaveRecord of this.list(query, options)) {
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: 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>;
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
- try {
22
- const locations = [];
23
- for await (const location of this.list(query, options)) {
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: 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>;
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;