rotacloud 1.0.10 → 1.0.13

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 (89) hide show
  1. package/dist/cjs/interfaces/availability.interface.d.ts +2 -2
  2. package/dist/cjs/interfaces/query-params/availability-query-params.interface.d.ts +7 -0
  3. package/dist/cjs/models/availability.model.d.ts +2 -2
  4. package/dist/cjs/models/user.model.d.ts +31 -1
  5. package/dist/cjs/models/user.model.js +31 -1
  6. package/dist/cjs/rotacloud.d.ts +2 -1
  7. package/dist/cjs/rotacloud.js +1 -0
  8. package/dist/cjs/services/accounts.service.d.ts +1 -0
  9. package/dist/cjs/services/accounts.service.js +34 -0
  10. package/dist/cjs/services/attendance.service.d.ts +1 -0
  11. package/dist/cjs/services/attendance.service.js +34 -0
  12. package/dist/cjs/services/availability.service.d.ts +13 -0
  13. package/dist/cjs/services/availability.service.js +55 -0
  14. package/dist/cjs/services/days-off.service.d.ts +1 -0
  15. package/dist/cjs/services/days-off.service.js +34 -0
  16. package/dist/cjs/services/groups.service.d.ts +1 -0
  17. package/dist/cjs/services/groups.service.js +34 -0
  18. package/dist/cjs/services/index.d.ts +1 -0
  19. package/dist/cjs/services/index.js +1 -0
  20. package/dist/cjs/services/leave-embargoes.service.d.ts +1 -0
  21. package/dist/cjs/services/leave-embargoes.service.js +34 -0
  22. package/dist/cjs/services/leave-request.service.d.ts +1 -0
  23. package/dist/cjs/services/leave-request.service.js +34 -0
  24. package/dist/cjs/services/leave.service.d.ts +1 -0
  25. package/dist/cjs/services/leave.service.js +37 -3
  26. package/dist/cjs/services/locations.service.d.ts +1 -0
  27. package/dist/cjs/services/locations.service.js +34 -0
  28. package/dist/cjs/services/roles.service.d.ts +1 -0
  29. package/dist/cjs/services/roles.service.js +34 -0
  30. package/dist/cjs/services/shifts.service.d.ts +1 -0
  31. package/dist/cjs/services/shifts.service.js +34 -0
  32. package/dist/cjs/services/users.service.d.ts +1 -0
  33. package/dist/cjs/services/users.service.js +34 -0
  34. package/dist/cjs/version.js +1 -1
  35. package/dist/mjs/interfaces/availability.interface.d.ts +2 -2
  36. package/dist/mjs/interfaces/query-params/availability-query-params.interface.d.ts +7 -0
  37. package/dist/mjs/models/availability.model.d.ts +2 -2
  38. package/dist/mjs/models/user.model.d.ts +31 -1
  39. package/dist/mjs/models/user.model.js +31 -1
  40. package/dist/mjs/rotacloud.d.ts +2 -1
  41. package/dist/mjs/rotacloud.js +2 -1
  42. package/dist/mjs/services/accounts.service.d.ts +1 -0
  43. package/dist/mjs/services/accounts.service.js +12 -0
  44. package/dist/mjs/services/attendance.service.d.ts +1 -0
  45. package/dist/mjs/services/attendance.service.js +12 -0
  46. package/dist/mjs/services/availability.service.d.ts +13 -0
  47. package/dist/mjs/services/availability.service.js +16 -0
  48. package/dist/mjs/services/days-off.service.d.ts +1 -0
  49. package/dist/mjs/services/days-off.service.js +12 -0
  50. package/dist/mjs/services/groups.service.d.ts +1 -0
  51. package/dist/mjs/services/groups.service.js +12 -0
  52. package/dist/mjs/services/index.d.ts +1 -0
  53. package/dist/mjs/services/index.js +1 -0
  54. package/dist/mjs/services/leave-embargoes.service.d.ts +1 -0
  55. package/dist/mjs/services/leave-embargoes.service.js +12 -0
  56. package/dist/mjs/services/leave-request.service.d.ts +1 -0
  57. package/dist/mjs/services/leave-request.service.js +12 -0
  58. package/dist/mjs/services/leave.service.d.ts +1 -0
  59. package/dist/mjs/services/leave.service.js +12 -0
  60. package/dist/mjs/services/locations.service.d.ts +1 -0
  61. package/dist/mjs/services/locations.service.js +12 -0
  62. package/dist/mjs/services/roles.service.d.ts +1 -0
  63. package/dist/mjs/services/roles.service.js +12 -0
  64. package/dist/mjs/services/shifts.service.d.ts +1 -0
  65. package/dist/mjs/services/shifts.service.js +12 -0
  66. package/dist/mjs/services/users.service.d.ts +1 -0
  67. package/dist/mjs/services/users.service.js +12 -0
  68. package/dist/mjs/version.js +1 -1
  69. package/fixup +1 -0
  70. package/package.json +1 -1
  71. package/src/interfaces/availability.interface.ts +2 -2
  72. package/src/interfaces/query-params/availability-query-params.interface.ts +7 -0
  73. package/src/models/availability.model.ts +2 -2
  74. package/src/models/user.model.ts +62 -2
  75. package/src/rotacloud.ts +2 -0
  76. package/src/services/accounts.service.ts +13 -0
  77. package/src/services/attendance.service.ts +13 -0
  78. package/src/services/availability.service.ts +23 -0
  79. package/src/services/days-off.service.ts +13 -0
  80. package/src/services/groups.service.ts +13 -0
  81. package/src/services/index.ts +1 -0
  82. package/src/services/leave-embargoes.service.ts +13 -0
  83. package/src/services/leave-request.service.ts +13 -0
  84. package/src/services/leave.service.ts +13 -0
  85. package/src/services/locations.service.ts +13 -0
  86. package/src/services/roles.service.ts +13 -0
  87. package/src/services/shifts.service.ts +13 -0
  88. package/src/services/users.service.ts +13 -0
  89. package/src/version.ts +1 -1
@@ -2,12 +2,12 @@ export interface ApiAvailabilityPeriod {
2
2
  start_time: string;
3
3
  end_time: string;
4
4
  }
5
- export interface ApiAvailabilityDates {
5
+ export interface ApiAvailabilityDate {
6
6
  date: string;
7
7
  available: ApiAvailabilityPeriod[];
8
8
  unavailable: ApiAvailabilityPeriod[];
9
9
  }
10
10
  export interface ApiAvailability {
11
11
  user: number;
12
- dates: ApiAvailabilityDates[];
12
+ dates: ApiAvailabilityDate[];
13
13
  }
@@ -1,5 +1,12 @@
1
1
  export interface AvailabilityQueryParams {
2
+ /** Start of date range for fetching availability (ISO date format `YYYY-MM-DD`) */
2
3
  start?: string;
4
+ /** End of date range for fetching availability (inclusive) (ISO date format `YYYY-MM-DD`) */
3
5
  end?: string;
6
+ /**
7
+ * List of user IDs to get availability for
8
+ *
9
+ * If undefined, all users on the account will be selected
10
+ */
4
11
  users?: number[];
5
12
  }
@@ -1,6 +1,6 @@
1
- import { ApiAvailability, ApiAvailabilityDates } from '../interfaces/index.js';
1
+ import { ApiAvailability, ApiAvailabilityDate } from '../interfaces/index.js';
2
2
  export declare class Availability {
3
3
  user: number;
4
- dates: ApiAvailabilityDates[];
4
+ dates: ApiAvailabilityDate[];
5
5
  constructor(availability: ApiAvailability);
6
6
  }
@@ -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
  }
@@ -5,10 +5,40 @@ exports.User = void 0;
5
5
  class User {
6
6
  constructor(user) {
7
7
  this.id = user.id;
8
+ this.created_at = user.created_at;
9
+ this.created_by = user.created_by;
10
+ this.deleted = user.deleted;
11
+ this.deleted_at = user.deleted_at;
12
+ this.deleted_by = user.deleted_by;
13
+ this.level = user.level;
8
14
  this.first_name = user.first_name;
15
+ this.middle_name = user.middle_name;
9
16
  this.last_name = user.last_name;
10
- this.photo = user.photo;
11
17
  this.preferred_name = user.preferred_name;
18
+ this.photo = user.photo;
19
+ this.two_factor_enabled = user.two_factor_enabled;
20
+ this.email = user.email;
21
+ this.has_account = user.has_account;
22
+ this.invite_sent = user.invite_sent;
23
+ this.group = user.group;
24
+ this.locations = user.locations;
25
+ this.roles = user.roles;
26
+ this.default_role = user.default_role;
27
+ this.dob = user.dob;
28
+ this.start_date = user.start_date;
29
+ this.final_working_date = user.final_working_date;
30
+ this.weekly_hours = user.weekly_hours;
31
+ this.holiday_allowance = user.holiday_allowance;
32
+ this.holiday_allowance_unit = user.holiday_allowance_unit;
33
+ this.payroll_id = user.payroll_id;
34
+ this.salary = user.salary;
35
+ this.salary_type = user.salary_type;
36
+ this.overtime_rate = user.overtime_rate;
37
+ this.role_rates = user.role_rates;
38
+ this.leave_rates = user.leave_rates;
39
+ this.leave_rates_unit = user.leave_rates_unit;
40
+ this.leave_rates_type = user.leave_rates_type;
41
+ this.notes = user.notes;
12
42
  }
13
43
  }
14
44
  exports.User = User;
@@ -1,10 +1,11 @@
1
- import { AccountsService, AttendanceService, DaysOffService, GroupsService, LeaveEmbargoesService, LeaveRequestService, LeaveService, LocationsService, RolesService, ShiftsService, UsersService } from './services/index.js';
1
+ import { AccountsService, AttendanceService, AvailabilityService, 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;
5
5
  defaultAPIURI: string;
6
6
  accounts: AccountsService;
7
7
  attendance: AttendanceService;
8
+ availability: AvailabilityService;
8
9
  daysOff: DaysOffService;
9
10
  group: GroupsService;
10
11
  leaveEmbargoes: LeaveEmbargoesService;
@@ -7,6 +7,7 @@ class RotaCloud {
7
7
  this.defaultAPIURI = 'https://api.rotacloud.com/v1';
8
8
  this.accounts = new index_js_1.AccountsService();
9
9
  this.attendance = new index_js_1.AttendanceService();
10
+ this.availability = new index_js_1.AvailabilityService();
10
11
  this.daysOff = new index_js_1.DaysOffService();
11
12
  this.group = new index_js_1.GroupsService();
12
13
  this.leaveEmbargoes = new index_js_1.LeaveEmbargoesService();
@@ -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 };
@@ -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;
@@ -48,6 +57,31 @@ class AccountsService extends index_js_1.Service {
48
57
  }
49
58
  });
50
59
  }
60
+ listAll() {
61
+ var e_2, _a;
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ try {
64
+ const accounts = [];
65
+ try {
66
+ for (var _b = __asyncValues(this.list()), _c; _c = yield _b.next(), !_c.done;) {
67
+ const account = _c.value;
68
+ accounts.push(account);
69
+ }
70
+ }
71
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
72
+ finally {
73
+ try {
74
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
75
+ }
76
+ finally { if (e_2) throw e_2.error; }
77
+ }
78
+ return accounts;
79
+ }
80
+ catch (err) {
81
+ return err;
82
+ }
83
+ });
84
+ }
51
85
  listByPage(options) {
52
86
  return super.iterator({ url: this.apiPath }, options).byPage();
53
87
  }
@@ -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: {
@@ -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 AttendanceService 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 attendance = [];
72
+ try {
73
+ for (var _b = __asyncValues(this.list()), _c; _c = yield _b.next(), !_c.done;) {
74
+ const atten = _c.value;
75
+ attendance.push(atten);
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 attendance;
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
  }
@@ -0,0 +1,13 @@
1
+ import { Service, Options, RequirementsOf } from './index.js';
2
+ import { InternalQueryParams } from '../interfaces/query-params/internal-query-params.inteface.js';
3
+ import { AvailabilityQueryParams } from '../interfaces/query-params/availability-query-params.interface.js';
4
+ import { Availability } from '../models/availability.model.js';
5
+ import { ApiAvailability } from '../interfaces/availability.interface.js';
6
+ declare type RequiredProps = 'start' | 'end';
7
+ declare type RequiredOptions<T> = RequirementsOf<Options<T>, 'params'>;
8
+ export declare class AvailabilityService extends Service {
9
+ private apiPath;
10
+ list(options: RequiredOptions<RequirementsOf<AvailabilityQueryParams, RequiredProps> & InternalQueryParams>): AsyncGenerator<Availability, void, unknown>;
11
+ listByPage(options: RequiredOptions<RequirementsOf<AvailabilityQueryParams, RequiredProps> & InternalQueryParams>): AsyncGenerator<import("axios").AxiosResponse<ApiAvailability[], any>, any, unknown>;
12
+ }
13
+ export {};
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __asyncValues = (this && this.__asyncValues) || function (o) {
3
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
4
+ var m = o[Symbol.asyncIterator], i;
5
+ 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);
6
+ 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); }); }; }
7
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
8
+ };
9
+ var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
10
+ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
11
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
12
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
13
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
14
+ 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); }); }; }
15
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
16
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
17
+ function fulfill(value) { resume("next", value); }
18
+ function reject(value) { resume("throw", value); }
19
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.AvailabilityService = void 0;
23
+ const index_js_1 = require("./index.js");
24
+ const availability_model_js_1 = require("../models/availability.model.js");
25
+ class AvailabilityService extends index_js_1.Service {
26
+ constructor() {
27
+ super(...arguments);
28
+ this.apiPath = '/availability';
29
+ }
30
+ list(options) {
31
+ const _super = Object.create(null, {
32
+ iterator: { get: () => super.iterator }
33
+ });
34
+ return __asyncGenerator(this, arguments, function* list_1() {
35
+ var e_1, _a;
36
+ try {
37
+ for (var _b = __asyncValues(_super.iterator.call(this, { url: this.apiPath }, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
38
+ const res = _c.value;
39
+ yield yield __await(new availability_model_js_1.Availability(res));
40
+ }
41
+ }
42
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
43
+ finally {
44
+ try {
45
+ if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));
46
+ }
47
+ finally { if (e_1) throw e_1.error; }
48
+ }
49
+ });
50
+ }
51
+ listByPage(options) {
52
+ return super.iterator({ url: this.apiPath }, options).byPage();
53
+ }
54
+ }
55
+ exports.AvailabilityService = AvailabilityService;
@@ -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: {
@@ -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;
@@ -61,6 +70,31 @@ class DaysOffService extends index_js_1.Service {
61
70
  }
62
71
  });
63
72
  }
73
+ listAll() {
74
+ var e_2, _a;
75
+ return __awaiter(this, void 0, void 0, function* () {
76
+ try {
77
+ const daysOff = [];
78
+ try {
79
+ for (var _b = __asyncValues(this.list()), _c; _c = yield _b.next(), !_c.done;) {
80
+ const dayOff = _c.value;
81
+ daysOff.push(dayOff);
82
+ }
83
+ }
84
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
85
+ finally {
86
+ try {
87
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
88
+ }
89
+ finally { if (e_2) throw e_2.error; }
90
+ }
91
+ return daysOff;
92
+ }
93
+ catch (err) {
94
+ return err;
95
+ }
96
+ });
97
+ }
64
98
  listByPage(options) {
65
99
  return super.iterator({ url: this.apiPath }, options).byPage();
66
100
  }
@@ -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: {
@@ -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 GroupsService 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 groups = [];
72
+ try {
73
+ for (var _b = __asyncValues(this.list()), _c; _c = yield _b.next(), !_c.done;) {
74
+ const group = _c.value;
75
+ groups.push(group);
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 groups;
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
  }
@@ -1,6 +1,7 @@
1
1
  export * from './service.js';
2
2
  export * from './accounts.service.js';
3
3
  export * from './attendance.service.js';
4
+ export * from './availability.service.js';
4
5
  export * from './days-off.service.js';
5
6
  export * from './groups.service.js';
6
7
  export * from './leave-request.service.js';
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./service.js"), exports);
14
14
  __exportStar(require("./accounts.service.js"), exports);
15
15
  __exportStar(require("./attendance.service.js"), exports);
16
+ __exportStar(require("./availability.service.js"), exports);
16
17
  __exportStar(require("./days-off.service.js"), exports);
17
18
  __exportStar(require("./groups.service.js"), exports);
18
19
  __exportStar(require("./leave-request.service.js"), exports);
@@ -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: {
@@ -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 LeaveEmbargoesService 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 leave = [];
72
+ try {
73
+ for (var _b = __asyncValues(this.list()), _c; _c = yield _b.next(), !_c.done;) {
74
+ const leaveEmbargoRecord = _c.value;
75
+ leave.push(leaveEmbargoRecord);
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 leave;
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 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: {
@@ -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 LeaveRequestService 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 leave = [];
72
+ try {
73
+ for (var _b = __asyncValues(this.list()), _c; _c = yield _b.next(), !_c.done;) {
74
+ const leaveRequestRecord = _c.value;
75
+ leave.push(leaveRequestRecord);
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 leave;
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
  }
@@ -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>;
@@ -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;
@@ -56,24 +65,49 @@ class LeaveService extends index_js_1.Service {
56
65
  }
57
66
  });
58
67
  }
68
+ listAll() {
69
+ var e_2, _a;
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ try {
72
+ const leave = [];
73
+ try {
74
+ for (var _b = __asyncValues(this.list()), _c; _c = yield _b.next(), !_c.done;) {
75
+ const leaveRecord = _c.value;
76
+ leave.push(leaveRecord);
77
+ }
78
+ }
79
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
80
+ finally {
81
+ try {
82
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
83
+ }
84
+ finally { if (e_2) throw e_2.error; }
85
+ }
86
+ return leave;
87
+ }
88
+ catch (err) {
89
+ return err;
90
+ }
91
+ });
92
+ }
59
93
  listLeaveTypes(options) {
60
94
  const _super = Object.create(null, {
61
95
  iterator: { get: () => super.iterator }
62
96
  });
63
97
  return __asyncGenerator(this, arguments, function* listLeaveTypes_1() {
64
- var e_2, _a;
98
+ var e_3, _a;
65
99
  try {
66
100
  for (var _b = __asyncValues(_super.iterator.call(this, { url: this.apiPath }, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
67
101
  const res = _c.value;
68
102
  yield yield __await(new leave_type_model_js_1.LeaveType(res));
69
103
  }
70
104
  }
71
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
105
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
72
106
  finally {
73
107
  try {
74
108
  if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));
75
109
  }
76
- finally { if (e_2) throw e_2.error; }
110
+ finally { if (e_3) throw e_3.error; }
77
111
  }
78
112
  });
79
113
  }
@@ -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: {