absence.io 2.4.4 → 2.4.6

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 (57) hide show
  1. package/package.json +5 -6
  2. package/dist/AbsenceIO.d.ts +0 -17
  3. package/dist/AbsenceIO.js +0 -82
  4. package/dist/Endpoints.d.ts +0 -39
  5. package/dist/Endpoints.js +0 -64
  6. package/dist/api/APIBase.d.ts +0 -18
  7. package/dist/api/APIBase.js +0 -31
  8. package/dist/api/AbsenceAPI.d.ts +0 -26
  9. package/dist/api/AbsenceAPI.js +0 -68
  10. package/dist/api/AllowanceTypeAPI.d.ts +0 -16
  11. package/dist/api/AllowanceTypeAPI.js +0 -44
  12. package/dist/api/DepartmentAPI.d.ts +0 -16
  13. package/dist/api/DepartmentAPI.js +0 -44
  14. package/dist/api/LocationAPI.d.ts +0 -16
  15. package/dist/api/LocationAPI.js +0 -44
  16. package/dist/api/ReasonAPI.d.ts +0 -17
  17. package/dist/api/ReasonAPI.js +0 -44
  18. package/dist/api/TeamAPI.d.ts +0 -16
  19. package/dist/api/TeamAPI.js +0 -44
  20. package/dist/api/TimespanAPI.d.ts +0 -36
  21. package/dist/api/TimespanAPI.js +0 -84
  22. package/dist/api/UserAPI.d.ts +0 -48
  23. package/dist/api/UserAPI.js +0 -97
  24. package/dist/api/index.d.ts +0 -8
  25. package/dist/api/index.js +0 -24
  26. package/dist/index.d.ts +0 -2
  27. package/dist/index.js +0 -18
  28. package/dist/interfaces/API.d.ts +0 -11
  29. package/dist/interfaces/API.js +0 -2
  30. package/dist/interfaces/Absence.d.ts +0 -75
  31. package/dist/interfaces/Absence.js +0 -2
  32. package/dist/interfaces/Allowance.d.ts +0 -14
  33. package/dist/interfaces/Allowance.js +0 -2
  34. package/dist/interfaces/ClientOptions.d.ts +0 -7
  35. package/dist/interfaces/ClientOptions.js +0 -2
  36. package/dist/interfaces/Department.d.ts +0 -19
  37. package/dist/interfaces/Department.js +0 -2
  38. package/dist/interfaces/EmailList.d.ts +0 -6
  39. package/dist/interfaces/EmailList.js +0 -2
  40. package/dist/interfaces/Location.d.ts +0 -24
  41. package/dist/interfaces/Location.js +0 -2
  42. package/dist/interfaces/Options.d.ts +0 -17
  43. package/dist/interfaces/Options.js +0 -2
  44. package/dist/interfaces/Reason.d.ts +0 -28
  45. package/dist/interfaces/Reason.js +0 -2
  46. package/dist/interfaces/Result.d.ts +0 -7
  47. package/dist/interfaces/Result.js +0 -2
  48. package/dist/interfaces/Team.d.ts +0 -10
  49. package/dist/interfaces/Team.js +0 -2
  50. package/dist/interfaces/Timespan.d.ts +0 -24
  51. package/dist/interfaces/Timespan.js +0 -2
  52. package/dist/interfaces/User.d.ts +0 -65
  53. package/dist/interfaces/User.js +0 -16
  54. package/dist/interfaces/WorkingDay.d.ts +0 -10
  55. package/dist/interfaces/WorkingDay.js +0 -13
  56. package/dist/interfaces/index.d.ts +0 -13
  57. package/dist/interfaces/index.js +0 -29
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.TeamAPI = void 0;
13
- const Endpoints_1 = require("../Endpoints");
14
- const APIBase_1 = require("./APIBase");
15
- class TeamAPI extends APIBase_1.APIBase {
16
- constructor(apiClient, options) {
17
- super(apiClient, options);
18
- }
19
- /**
20
- * Retrieve a single team
21
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#08486bf6-c138-5808-7c1d-7ead5c8b1aee
22
- */
23
- retrieveTeam(id) {
24
- return __awaiter(this, void 0, void 0, function* () {
25
- this.checkApiKey('Team');
26
- const endpoint = Endpoints_1.Endpoint.Team.teams(id);
27
- const { data: team } = yield this.apiClient.get(endpoint);
28
- return team;
29
- });
30
- }
31
- /**
32
- * Retrieve teams
33
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#ec24e740-47e6-3daa-5698-040f99ac9dfd
34
- */
35
- retrieveTeams(options) {
36
- return __awaiter(this, void 0, void 0, function* () {
37
- this.checkApiKey('Team');
38
- const endpoint = Endpoints_1.Endpoint.Team.teams();
39
- const { data: teams } = yield this.apiClient.post(endpoint, options);
40
- return teams;
41
- });
42
- }
43
- }
44
- exports.TeamAPI = TeamAPI;
@@ -1,36 +0,0 @@
1
- import type { APIClient } from '@ffflorian/api-client';
2
- import type { ClientOptions, NewTimespan, Paginated, PaginationOptions, Timespan } from '../interfaces/';
3
- import { APIBase } from './APIBase';
4
- export declare class TimespanAPI extends APIBase {
5
- constructor(apiClient: APIClient, options: ClientOptions);
6
- /**
7
- * Creates a new time entry
8
- * @param timestampData The time entry data
9
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#eb82f188-4af9-462a-80f6-0536c40a77d9
10
- */
11
- createTimespan(timestampData: NewTimespan): Promise<Timespan>;
12
- /**
13
- * Deletes one time entry
14
- * @param id The time entry id
15
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#030e6fd3-051f-4c14-ae14-b5290a9335d8
16
- */
17
- deleteTimespan(id: string): Promise<void>;
18
- /**
19
- * Retrieve a single time entry
20
- * @param id The time entry id
21
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#c9e5f2fc-e478-419b-ac34-071c8e68765f
22
- */
23
- retrieveTimespan(id: string): Promise<Timespan>;
24
- /**
25
- * Query a list of time entries
26
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#951d4608-15e7-47b6-90c9-058fa32a64d0
27
- */
28
- retrieveTimespans(options?: PaginationOptions): Promise<Paginated<Timespan[]>>;
29
- /**
30
- * Creates a new time entry
31
- * @param id The time entry id
32
- * @param newTimespanData The time entry data
33
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#0b409cc6-37a7-4f24-b1a1-e7bacc5b2555
34
- */
35
- updateTimespan(id: string, newTimespanData: Partial<NewTimespan>): Promise<Timespan>;
36
- }
@@ -1,84 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.TimespanAPI = void 0;
13
- const Endpoints_1 = require("../Endpoints");
14
- const APIBase_1 = require("./APIBase");
15
- class TimespanAPI extends APIBase_1.APIBase {
16
- constructor(apiClient, options) {
17
- super(apiClient, options);
18
- }
19
- /**
20
- * Creates a new time entry
21
- * @param timestampData The time entry data
22
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#eb82f188-4af9-462a-80f6-0536c40a77d9
23
- */
24
- createTimespan(timestampData) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- this.checkApiKey('Timespan');
27
- const endpoint = Endpoints_1.Endpoint.Timespan.create();
28
- const { data: timespan } = yield this.apiClient.post(endpoint, timestampData);
29
- return timespan;
30
- });
31
- }
32
- /**
33
- * Deletes one time entry
34
- * @param id The time entry id
35
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#030e6fd3-051f-4c14-ae14-b5290a9335d8
36
- */
37
- deleteTimespan(id) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- this.checkApiKey('Timespan');
40
- const endpoint = Endpoints_1.Endpoint.Timespan.timespans(id);
41
- yield this.apiClient.delete(endpoint);
42
- });
43
- }
44
- /**
45
- * Retrieve a single time entry
46
- * @param id The time entry id
47
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#c9e5f2fc-e478-419b-ac34-071c8e68765f
48
- */
49
- retrieveTimespan(id) {
50
- return __awaiter(this, void 0, void 0, function* () {
51
- this.checkApiKey('Timespan');
52
- const endpoint = Endpoints_1.Endpoint.Timespan.timespans(id);
53
- const { data: timespan } = yield this.apiClient.get(endpoint);
54
- return timespan;
55
- });
56
- }
57
- /**
58
- * Query a list of time entries
59
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#951d4608-15e7-47b6-90c9-058fa32a64d0
60
- */
61
- retrieveTimespans(options) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- this.checkApiKey('Timespan');
64
- const endpoint = Endpoints_1.Endpoint.Timespan.timespans();
65
- const { data } = yield this.apiClient.post(endpoint, options);
66
- return data;
67
- });
68
- }
69
- /**
70
- * Creates a new time entry
71
- * @param id The time entry id
72
- * @param newTimespanData The time entry data
73
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#0b409cc6-37a7-4f24-b1a1-e7bacc5b2555
74
- */
75
- updateTimespan(id, newTimespanData) {
76
- return __awaiter(this, void 0, void 0, function* () {
77
- this.checkApiKey('Timespan');
78
- const endpoint = Endpoints_1.Endpoint.Timespan.timespans(id);
79
- const { data: timespan } = yield this.apiClient.put(endpoint, newTimespanData);
80
- return timespan;
81
- });
82
- }
83
- }
84
- exports.TimespanAPI = TimespanAPI;
@@ -1,48 +0,0 @@
1
- import type { APIClient } from '@ffflorian/api-client';
2
- import type { ClientOptions, NewUser, Paginated, PaginationOptions, User } from '../interfaces/';
3
- import { APIBase } from './APIBase';
4
- export declare class UserAPI extends APIBase {
5
- constructor(apiClient: APIClient, options: ClientOptions);
6
- /**
7
- * Register a new user for your company.
8
- * The newly created user will receive an invitation email.
9
- * @param userData The user data
10
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#5e2ae60d-7392-859d-626a-c55b8d925c8c
11
- */
12
- invite(userData: NewUser): Promise<User>;
13
- /**
14
- * Retrieve a user
15
- * @param id The user id
16
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#3e128ded-9395-246f-6057-6c9cc6534a35
17
- */
18
- retrieveUser(id: string): Promise<User>;
19
- /**
20
- * Retrieve a user by several options: e.g his lastname, or his firstname, or both
21
- * e.g.
22
- * const options = {
23
- * skip: 0,
24
- * limit: 50,
25
- * filter: {
26
- * firstName,
27
- * lastName,
28
- * }
29
- * }
30
- * @param {PaginationOptions} [options] The pagination options
31
- * @returns {Promise<User>}
32
- * @see: https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#310af8b0-d46f-d70d-f9ea-77cfd0f7aee4
33
- */
34
- retrieveUserByOption(options?: PaginationOptions): Promise<User>;
35
- /**
36
- * Retrieve users
37
- * @param options The pagination options
38
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#de1af2e7-9508-1492-d698-7079d93cf60a
39
- */
40
- retrieveUsers(options?: PaginationOptions): Promise<Paginated<User[]>>;
41
- /**
42
- * Update an existing user
43
- * @param id The user id
44
- * @param userData The updated user data
45
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#9bfdfa67-5391-d0ee-04e7-20b5c1b7a04d
46
- */
47
- updateUser(id: string, userData?: Partial<NewUser>): Promise<Paginated<User[]>>;
48
- }
@@ -1,97 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.UserAPI = void 0;
13
- const Endpoints_1 = require("../Endpoints");
14
- const APIBase_1 = require("./APIBase");
15
- class UserAPI extends APIBase_1.APIBase {
16
- constructor(apiClient, options) {
17
- super(apiClient, options);
18
- }
19
- /**
20
- * Register a new user for your company.
21
- * The newly created user will receive an invitation email.
22
- * @param userData The user data
23
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#5e2ae60d-7392-859d-626a-c55b8d925c8c
24
- */
25
- invite(userData) {
26
- return __awaiter(this, void 0, void 0, function* () {
27
- this.checkApiKey('User');
28
- const endpoint = Endpoints_1.Endpoint.User.invite();
29
- const { data: user } = yield this.apiClient.post(endpoint, userData);
30
- return user;
31
- });
32
- }
33
- /**
34
- * Retrieve a user
35
- * @param id The user id
36
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#3e128ded-9395-246f-6057-6c9cc6534a35
37
- */
38
- retrieveUser(id) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- this.checkApiKey('User');
41
- const endpoint = Endpoints_1.Endpoint.User.users(id);
42
- const { data: user } = yield this.apiClient.get(endpoint);
43
- return user;
44
- });
45
- }
46
- /**
47
- * Retrieve a user by several options: e.g his lastname, or his firstname, or both
48
- * e.g.
49
- * const options = {
50
- * skip: 0,
51
- * limit: 50,
52
- * filter: {
53
- * firstName,
54
- * lastName,
55
- * }
56
- * }
57
- * @param {PaginationOptions} [options] The pagination options
58
- * @returns {Promise<User>}
59
- * @see: https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#310af8b0-d46f-d70d-f9ea-77cfd0f7aee4
60
- */
61
- retrieveUserByOption(options) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- this.checkApiKey('User');
64
- const endpoint = Endpoints_1.Endpoint.User.users();
65
- const { data: user } = yield this.apiClient.post(endpoint, options);
66
- return user;
67
- });
68
- }
69
- /**
70
- * Retrieve users
71
- * @param options The pagination options
72
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#de1af2e7-9508-1492-d698-7079d93cf60a
73
- */
74
- retrieveUsers(options) {
75
- return __awaiter(this, void 0, void 0, function* () {
76
- this.checkApiKey('User');
77
- const endpoint = Endpoints_1.Endpoint.User.users();
78
- const { data: users } = yield this.apiClient.post(endpoint, options);
79
- return users;
80
- });
81
- }
82
- /**
83
- * Update an existing user
84
- * @param id The user id
85
- * @param userData The updated user data
86
- * @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#9bfdfa67-5391-d0ee-04e7-20b5c1b7a04d
87
- */
88
- updateUser(id, userData) {
89
- return __awaiter(this, void 0, void 0, function* () {
90
- this.checkApiKey('User');
91
- const endpoint = Endpoints_1.Endpoint.User.users(id);
92
- const { data: users } = yield this.apiClient.post(endpoint, userData);
93
- return users;
94
- });
95
- }
96
- }
97
- exports.UserAPI = UserAPI;
@@ -1,8 +0,0 @@
1
- export * from './AbsenceAPI';
2
- export * from './AllowanceTypeAPI';
3
- export * from './DepartmentAPI';
4
- export * from './LocationAPI';
5
- export * from './ReasonAPI';
6
- export * from './TeamAPI';
7
- export * from './TimespanAPI';
8
- export * from './UserAPI';
package/dist/api/index.js DELETED
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./AbsenceAPI"), exports);
18
- __exportStar(require("./AllowanceTypeAPI"), exports);
19
- __exportStar(require("./DepartmentAPI"), exports);
20
- __exportStar(require("./LocationAPI"), exports);
21
- __exportStar(require("./ReasonAPI"), exports);
22
- __exportStar(require("./TeamAPI"), exports);
23
- __exportStar(require("./TimespanAPI"), exports);
24
- __exportStar(require("./UserAPI"), exports);
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './AbsenceIO';
2
- export * from './interfaces/';
package/dist/index.js DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./AbsenceIO"), exports);
18
- __exportStar(require("./interfaces/"), exports);
@@ -1,11 +0,0 @@
1
- import type { AbsenceAPI, AllowanceTypeAPI, DepartmentAPI, LocationAPI, ReasonAPI, TeamAPI, TimespanAPI, UserAPI } from '../api/';
2
- export interface API {
3
- absence: AbsenceAPI;
4
- allowanceType: AllowanceTypeAPI;
5
- department: DepartmentAPI;
6
- location: LocationAPI;
7
- reason: ReasonAPI;
8
- team: TeamAPI;
9
- timespan: TimespanAPI;
10
- user: UserAPI;
11
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,75 +0,0 @@
1
- import type { Reason } from './Reason';
2
- import type { User } from './User';
3
- import type { WorkingDay } from './WorkingDay';
4
- export interface AbsenceDay {
5
- date: string;
6
- duration: number;
7
- endTime: string;
8
- halfHoliday: boolean;
9
- holiday: boolean;
10
- holidayDayType: WorkingDay | null;
11
- mandatoryLeave: false;
12
- startTime: string;
13
- value: number;
14
- weekend: boolean;
15
- }
16
- export interface DoctorsNote {
17
- reminders: any[];
18
- status: number;
19
- }
20
- export interface ForwardHistory {
21
- action: string;
22
- admin: string;
23
- date: string;
24
- }
25
- export interface Absence extends Required<NewAbsence> {
26
- /** unique identifier */
27
- readonly _id: string;
28
- /** assigned approver (only available if requested via `relations`) */
29
- readonly approver?: User;
30
- /** assigned user (only available if requested via `relations`) */
31
- readonly assignedTo?: User;
32
- /** date the absence was created */
33
- readonly created: string;
34
- /** array detailing each day inside the absence date range */
35
- readonly days: AbsenceDay[];
36
- /** the number of working days this absence counts as */
37
- readonly daysCount: number;
38
- /** date the absence was updated */
39
- readonly modified: string;
40
- /** assigned reason (only available if requested via `relations`) */
41
- readonly reason?: Reason;
42
- }
43
- export interface NewAbsence {
44
- /** id of the user who will/has approved this absence. If the creator has sufficient permissions it will be the same as `assignedToId` */
45
- approverId: string;
46
- /** id of the user who is assigned to this absence */
47
- assignedToId: string;
48
- canApproveAbsence?: boolean;
49
- canBeDeleted?: boolean;
50
- canBeEdited?: boolean;
51
- /** optional comment */
52
- commentary?: string;
53
- company?: string;
54
- /** an optional comment for a denied absence request */
55
- denyReason?: string;
56
- /** object with boolean value to determine if a note is required for an absence and if it was submitted */
57
- doctorsNote?: boolean;
58
- documentIds?: string[];
59
- /** the end date and time of the absence */
60
- end: string;
61
- endDateTime?: string;
62
- forwardHistory?: ForwardHistory[];
63
- historical?: false;
64
- isHourly?: boolean;
65
- /** id of the associated absence type */
66
- reasonId: string;
67
- /** the start date and time of the absence */
68
- start: string;
69
- startDateTime?: string;
70
- /** the status of the absence */
71
- status?: number;
72
- /** id of the user who will act as a substitute during this absence */
73
- substituteId?: string;
74
- userNotificationIds?: string[];
75
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,14 +0,0 @@
1
- export interface NewAllowance {
2
- /** indicates if it can be used currently. */
3
- active: boolean;
4
- /** the intial amount of days a user will have per year */
5
- initialAllowance: number;
6
- /** the display name of the allowance */
7
- name: string;
8
- /** indicates if unu */
9
- residualLeaveAvailable: boolean;
10
- }
11
- export interface Allowance extends Required<NewAllowance> {
12
- /** the unique id of the allowance */
13
- readonly _id: string;
14
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +0,0 @@
1
- export interface Authorization {
2
- apiKey: string;
3
- apiKeyId: string;
4
- }
5
- export interface ClientOptions extends Authorization {
6
- apiUrl?: string;
7
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,19 +0,0 @@
1
- import type { EmailList } from './EmailList';
2
- export interface NewDepartment {
3
- /** list of users who are approvers for the department */
4
- approverIds?: string[];
5
- /** defintion of subscribers */
6
- emailList?: EmailList[];
7
- /** list of users who are members of the department */
8
- memberIds?: string[];
9
- /** the name of the department */
10
- name: string;
11
- }
12
- export interface Department extends Required<NewDepartment> {
13
- /** unique identifier */
14
- readonly _id: string;
15
- /** ics link for viewing absences in external applications, prefix: https://app.absence.io/ */
16
- readonly icsLink: string;
17
- /** count of users who are members of the department */
18
- readonly memberCount: number;
19
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- export interface EmailList {
2
- /** comma seperated emails. Emails do not need to be registered with absence.. */
3
- email: string;
4
- /** reason ids for which notifications will be sent to the attached email if an absence is createed, deleted, or an update is approved */
5
- leaveTypes?: string[];
6
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,24 +0,0 @@
1
- export interface NewLocation {
2
- /** the region used to determine the translated names of the holidays. Seperation to region needed when setting to custom. */
3
- holidayCountryLanguage: string;
4
- /** list of holidays assigned to the location */
5
- holidayIds: string;
6
- /** the region used to rectrieve the holidays for this user. eg. "de-by" */
7
- holidaySubregion: string;
8
- /** indicates if holidays are to be inherited from the main location */
9
- inheritHolidays: boolean;
10
- /** list of users who are members of the location */
11
- memberIds?: string[];
12
- /** the name of the location */
13
- name: string;
14
- }
15
- export interface Location extends Required<NewLocation> {
16
- /** unique identifier */
17
- readonly _id: string;
18
- /** ics link for viewing absences in external applications, prefix: https://app.absence.io/ */
19
- readonly icsLink: string;
20
- /** bool to display if the location is the main one or not */
21
- readonly mainLocation: boolean;
22
- /** count of users who are members of the location */
23
- readonly memberCount: number;
24
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,17 +0,0 @@
1
- import type { NewAbsence } from './Absence';
2
- import type { NewAllowance } from './Allowance';
3
- import type { NewDepartment } from './Department';
4
- import type { NewLocation } from './Location';
5
- import type { NewReason } from './Reason';
6
- import type { NewTimespan } from './Timespan';
7
- import type { NewUser } from './User';
8
- export type Filter = Record<string, string | Record<string, string>>;
9
- export type Sorting = Record<string, 1 | -1>;
10
- export interface PaginationOptions {
11
- filter?: Filter;
12
- limit: number;
13
- relations?: string[];
14
- skip: number;
15
- sortBy?: Sorting;
16
- }
17
- export type RequestOptions = PaginationOptions | Partial<NewAbsence | NewAllowance | NewDepartment | NewLocation | NewReason | NewTimespan | NewUser>;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,28 +0,0 @@
1
- import type { DoctorsNote } from './Absence';
2
- import type { Allowance } from './Allowance';
3
- export interface NewReason {
4
- /** the allowance type of which this reason deducts. If no allowance is defined then the reason won't deduct from any allowance */
5
- allowanceTypeId: string;
6
- /** the color and icon associated with this reason */
7
- colorId: string;
8
- /** defines if and when a doctorsNote is required for this reason */
9
- doctorsNote?: DoctorsNote;
10
- /** defines email addresses subscribed to this type of absence reason */
11
- emailList?: string[];
12
- /** defines if other basic users can view details for absences of this reason type */
13
- isPublic?: boolean;
14
- /** the display name of this reason */
15
- name: string;
16
- /** if true, an allowance type must be assigned, if false, the allowance type will be `null` */
17
- reducesDays?: boolean;
18
- /** defines if this reason requires approval */
19
- requiresApproval?: boolean;
20
- /** defines the sort index of this reason on the ui */
21
- sortIndex?: number;
22
- }
23
- export interface Reason extends Required<NewReason> {
24
- /** unique identifier */
25
- readonly _id: string;
26
- /** shows the changes of allowance types on this object and the date they occured */
27
- readonly allowanceHistory: Allowance[];
28
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +0,0 @@
1
- export interface Paginated<T> {
2
- count: number;
3
- data: T;
4
- limit: number;
5
- skip: number;
6
- totalCount: number;
7
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +0,0 @@
1
- export interface NewTeam {
2
- /** definition of subscribers */
3
- emailList?: string[];
4
- /** the name of the department */
5
- name: string;
6
- }
7
- export interface Team extends Required<NewTeam> {
8
- /** unique identifier */
9
- readonly _id: string;
10
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });