absence.io 2.4.5 → 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.
- package/package.json +5 -6
- package/dist/AbsenceIO.d.ts +0 -17
- package/dist/AbsenceIO.js +0 -82
- package/dist/Endpoints.d.ts +0 -39
- package/dist/Endpoints.js +0 -64
- package/dist/api/APIBase.d.ts +0 -18
- package/dist/api/APIBase.js +0 -31
- package/dist/api/AbsenceAPI.d.ts +0 -26
- package/dist/api/AbsenceAPI.js +0 -68
- package/dist/api/AllowanceTypeAPI.d.ts +0 -16
- package/dist/api/AllowanceTypeAPI.js +0 -44
- package/dist/api/DepartmentAPI.d.ts +0 -16
- package/dist/api/DepartmentAPI.js +0 -44
- package/dist/api/LocationAPI.d.ts +0 -16
- package/dist/api/LocationAPI.js +0 -44
- package/dist/api/ReasonAPI.d.ts +0 -17
- package/dist/api/ReasonAPI.js +0 -44
- package/dist/api/TeamAPI.d.ts +0 -16
- package/dist/api/TeamAPI.js +0 -44
- package/dist/api/TimespanAPI.d.ts +0 -36
- package/dist/api/TimespanAPI.js +0 -84
- package/dist/api/UserAPI.d.ts +0 -48
- package/dist/api/UserAPI.js +0 -97
- package/dist/api/index.d.ts +0 -8
- package/dist/api/index.js +0 -24
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -18
- package/dist/interfaces/API.d.ts +0 -11
- package/dist/interfaces/API.js +0 -2
- package/dist/interfaces/Absence.d.ts +0 -75
- package/dist/interfaces/Absence.js +0 -2
- package/dist/interfaces/Allowance.d.ts +0 -14
- package/dist/interfaces/Allowance.js +0 -2
- package/dist/interfaces/ClientOptions.d.ts +0 -7
- package/dist/interfaces/ClientOptions.js +0 -2
- package/dist/interfaces/Department.d.ts +0 -19
- package/dist/interfaces/Department.js +0 -2
- package/dist/interfaces/EmailList.d.ts +0 -6
- package/dist/interfaces/EmailList.js +0 -2
- package/dist/interfaces/Location.d.ts +0 -24
- package/dist/interfaces/Location.js +0 -2
- package/dist/interfaces/Options.d.ts +0 -17
- package/dist/interfaces/Options.js +0 -2
- package/dist/interfaces/Reason.d.ts +0 -28
- package/dist/interfaces/Reason.js +0 -2
- package/dist/interfaces/Result.d.ts +0 -7
- package/dist/interfaces/Result.js +0 -2
- package/dist/interfaces/Team.d.ts +0 -10
- package/dist/interfaces/Team.js +0 -2
- package/dist/interfaces/Timespan.d.ts +0 -24
- package/dist/interfaces/Timespan.js +0 -2
- package/dist/interfaces/User.d.ts +0 -65
- package/dist/interfaces/User.js +0 -16
- package/dist/interfaces/WorkingDay.d.ts +0 -10
- package/dist/interfaces/WorkingDay.js +0 -13
- package/dist/interfaces/index.d.ts +0 -13
- package/dist/interfaces/index.js +0 -29
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Florian Imdahl <git@ffflorian.de>",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@ffflorian/api-client": "2.
|
|
4
|
+
"@ffflorian/api-client": "2.5.0",
|
|
5
5
|
"@hapi/hawk": "8.0.0"
|
|
6
6
|
},
|
|
7
7
|
"description": "An absence.io API client",
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"@types/hapi__hawk": "8.0.7",
|
|
10
10
|
"@types/node": "~24",
|
|
11
|
-
"rimraf": "6.1.
|
|
12
|
-
"typedoc": "0.28.
|
|
13
|
-
"typescript": "
|
|
11
|
+
"rimraf": "6.1.3",
|
|
12
|
+
"typedoc": "0.28.18",
|
|
13
|
+
"typescript": "6.0.2"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">= 21"
|
|
@@ -37,6 +37,5 @@
|
|
|
37
37
|
"dist": "yarn clean && yarn build:ts",
|
|
38
38
|
"test": "exit 0"
|
|
39
39
|
},
|
|
40
|
-
"version": "2.4.
|
|
41
|
-
"gitHead": "8d7471cbe490305b3e441c27acbc81e36a4bd9df"
|
|
40
|
+
"version": "2.4.6"
|
|
42
41
|
}
|
package/dist/AbsenceIO.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { API, Authorization, ClientOptions } from './interfaces';
|
|
2
|
-
export declare class AbsenceIO {
|
|
3
|
-
readonly api: API;
|
|
4
|
-
private readonly apiClient;
|
|
5
|
-
private readonly options;
|
|
6
|
-
constructor(options: ClientOptions);
|
|
7
|
-
/**
|
|
8
|
-
* Set a new API key.
|
|
9
|
-
* @param authorization The API authorization data
|
|
10
|
-
*/
|
|
11
|
-
setApiAuthorization(authorization: Authorization): void;
|
|
12
|
-
/**
|
|
13
|
-
* Set a new API URL.
|
|
14
|
-
* @param newURL The new API URL
|
|
15
|
-
*/
|
|
16
|
-
setApiUrl(newURL: string): void;
|
|
17
|
-
}
|
package/dist/AbsenceIO.js
DELETED
|
@@ -1,82 +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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.AbsenceIO = void 0;
|
|
37
|
-
const hawk = __importStar(require("@hapi/hawk"));
|
|
38
|
-
const api_client_1 = require("@ffflorian/api-client");
|
|
39
|
-
const api_1 = require("./api");
|
|
40
|
-
class AbsenceIO {
|
|
41
|
-
constructor(options) {
|
|
42
|
-
this.options = options;
|
|
43
|
-
const baseURL = options.apiUrl || 'https://app.absence.io/api/v2';
|
|
44
|
-
const credentials = {
|
|
45
|
-
algorithm: 'sha256',
|
|
46
|
-
id: this.options.apiKeyId,
|
|
47
|
-
key: this.options.apiKey,
|
|
48
|
-
};
|
|
49
|
-
this.apiClient = new api_client_1.APIClient(baseURL);
|
|
50
|
-
this.apiClient.interceptors.request.push((config) => {
|
|
51
|
-
const hawkHeader = hawk.client.header(config.url.toString(), config.method, { credentials });
|
|
52
|
-
config.headers = Object.assign(Object.assign({}, config.headers), { Authorization: hawkHeader.header });
|
|
53
|
-
return config;
|
|
54
|
-
});
|
|
55
|
-
this.api = {
|
|
56
|
-
absence: new api_1.AbsenceAPI(this.apiClient, options),
|
|
57
|
-
allowanceType: new api_1.AllowanceTypeAPI(this.apiClient, options),
|
|
58
|
-
department: new api_1.DepartmentAPI(this.apiClient, options),
|
|
59
|
-
location: new api_1.LocationAPI(this.apiClient, options),
|
|
60
|
-
reason: new api_1.ReasonAPI(this.apiClient, options),
|
|
61
|
-
team: new api_1.TeamAPI(this.apiClient, options),
|
|
62
|
-
timespan: new api_1.TimespanAPI(this.apiClient, options),
|
|
63
|
-
user: new api_1.UserAPI(this.apiClient, options),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Set a new API key.
|
|
68
|
-
* @param authorization The API authorization data
|
|
69
|
-
*/
|
|
70
|
-
setApiAuthorization(authorization) {
|
|
71
|
-
this.options.apiKey = authorization.apiKey;
|
|
72
|
-
this.options.apiKeyId = authorization.apiKeyId;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Set a new API URL.
|
|
76
|
-
* @param newURL The new API URL
|
|
77
|
-
*/
|
|
78
|
-
setApiUrl(newURL) {
|
|
79
|
-
this.apiClient.setBaseURL(newURL);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
exports.AbsenceIO = AbsenceIO;
|
package/dist/Endpoints.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export declare const Endpoint: {
|
|
2
|
-
ABSENCES: string;
|
|
3
|
-
CREATE: string;
|
|
4
|
-
ALLOWANCE_TYPES: string;
|
|
5
|
-
DEPARTMENTS: string;
|
|
6
|
-
INVITE: string;
|
|
7
|
-
LOCATIONS: string;
|
|
8
|
-
REASONS: string;
|
|
9
|
-
TEAMS: string;
|
|
10
|
-
USERS: string;
|
|
11
|
-
TIMESPANS: string;
|
|
12
|
-
Absence: {
|
|
13
|
-
absences(id?: string): string;
|
|
14
|
-
create(): string;
|
|
15
|
-
};
|
|
16
|
-
AllowanceType: {
|
|
17
|
-
allowanceTypes(id?: string): string;
|
|
18
|
-
};
|
|
19
|
-
Department: {
|
|
20
|
-
departments(id?: string): string;
|
|
21
|
-
};
|
|
22
|
-
Location: {
|
|
23
|
-
locations(id?: string): string;
|
|
24
|
-
};
|
|
25
|
-
Reason: {
|
|
26
|
-
reasons(id?: string): string;
|
|
27
|
-
};
|
|
28
|
-
Team: {
|
|
29
|
-
teams(id?: string): string;
|
|
30
|
-
};
|
|
31
|
-
Timespan: {
|
|
32
|
-
create(): string;
|
|
33
|
-
timespans(id?: string): string;
|
|
34
|
-
};
|
|
35
|
-
User: {
|
|
36
|
-
invite(): string;
|
|
37
|
-
users(id?: string): string;
|
|
38
|
-
};
|
|
39
|
-
};
|
package/dist/Endpoints.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Endpoint = void 0;
|
|
4
|
-
exports.Endpoint = {
|
|
5
|
-
ABSENCES: 'absences',
|
|
6
|
-
CREATE: 'create',
|
|
7
|
-
ALLOWANCE_TYPES: 'allowancetypes',
|
|
8
|
-
DEPARTMENTS: 'departments',
|
|
9
|
-
INVITE: 'invite',
|
|
10
|
-
LOCATIONS: 'locations',
|
|
11
|
-
REASONS: 'reasons',
|
|
12
|
-
TEAMS: 'teams',
|
|
13
|
-
USERS: 'users',
|
|
14
|
-
TIMESPANS: 'timespans',
|
|
15
|
-
Absence: {
|
|
16
|
-
absences(id) {
|
|
17
|
-
return `/${exports.Endpoint.ABSENCES}/${id ? `${id}/` : ''}`;
|
|
18
|
-
},
|
|
19
|
-
create() {
|
|
20
|
-
return `/${exports.Endpoint.ABSENCES}/${exports.Endpoint.CREATE}/`;
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
AllowanceType: {
|
|
24
|
-
allowanceTypes(id) {
|
|
25
|
-
return `/${exports.Endpoint.ALLOWANCE_TYPES}/${id ? `${id}/` : ''}`;
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
Department: {
|
|
29
|
-
departments(id) {
|
|
30
|
-
return `/${exports.Endpoint.DEPARTMENTS}/${id ? `${id}/` : ''}`;
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
Location: {
|
|
34
|
-
locations(id) {
|
|
35
|
-
return `/${exports.Endpoint.LOCATIONS}/${id ? `${id}/` : ''}`;
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
Reason: {
|
|
39
|
-
reasons(id) {
|
|
40
|
-
return `/${exports.Endpoint.REASONS}/${id ? `${id}/` : ''}`;
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
Team: {
|
|
44
|
-
teams(id) {
|
|
45
|
-
return `/${exports.Endpoint.TEAMS}/${id ? `${id}/` : ''}`;
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
Timespan: {
|
|
49
|
-
create() {
|
|
50
|
-
return `/${exports.Endpoint.TIMESPANS}/${exports.Endpoint.CREATE}/`;
|
|
51
|
-
},
|
|
52
|
-
timespans(id) {
|
|
53
|
-
return `/${exports.Endpoint.TIMESPANS}/${id ? `${id}/` : ''}`;
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
User: {
|
|
57
|
-
invite() {
|
|
58
|
-
return `/${exports.Endpoint.USERS}/${exports.Endpoint.INVITE}/`;
|
|
59
|
-
},
|
|
60
|
-
users(id) {
|
|
61
|
-
return `/${exports.Endpoint.USERS}/${id ? `${id}/` : ''}`;
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
};
|
package/dist/api/APIBase.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
-
import type { Authorization, ClientOptions } from '../interfaces';
|
|
3
|
-
export declare class APIBase {
|
|
4
|
-
protected readonly apiClient: APIClient;
|
|
5
|
-
protected readonly options: ClientOptions;
|
|
6
|
-
constructor(apiClient: APIClient, options: ClientOptions);
|
|
7
|
-
/**
|
|
8
|
-
* Set a new API key.
|
|
9
|
-
* @param authorization The API authorization data
|
|
10
|
-
*/
|
|
11
|
-
setApiAuthorization(authorization: Authorization): void;
|
|
12
|
-
/**
|
|
13
|
-
* Set a new API URL.
|
|
14
|
-
* @param newURL The new API url
|
|
15
|
-
*/
|
|
16
|
-
setApiUrl(newURL: string): void;
|
|
17
|
-
protected checkApiKey(apiName?: string): void;
|
|
18
|
-
}
|
package/dist/api/APIBase.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.APIBase = void 0;
|
|
4
|
-
class APIBase {
|
|
5
|
-
constructor(apiClient, options) {
|
|
6
|
-
this.apiClient = apiClient;
|
|
7
|
-
this.options = options;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Set a new API key.
|
|
11
|
-
* @param authorization The API authorization data
|
|
12
|
-
*/
|
|
13
|
-
setApiAuthorization(authorization) {
|
|
14
|
-
this.options.apiKey = authorization.apiKey;
|
|
15
|
-
this.options.apiKeyId = authorization.apiKeyId;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Set a new API URL.
|
|
19
|
-
* @param newURL The new API url
|
|
20
|
-
*/
|
|
21
|
-
setApiUrl(newURL) {
|
|
22
|
-
this.apiClient.setBaseURL(newURL);
|
|
23
|
-
}
|
|
24
|
-
checkApiKey(apiName) {
|
|
25
|
-
const name = apiName ? `the "${apiName}"` : 'this';
|
|
26
|
-
if (!this.options.apiKey || !this.options.apiKeyId) {
|
|
27
|
-
throw new Error(`An API key needs to be set in order to use ${name} API`);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.APIBase = APIBase;
|
package/dist/api/AbsenceAPI.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
-
import type { Absence, ClientOptions, NewAbsence, Paginated, PaginationOptions } from '../interfaces/';
|
|
3
|
-
import { APIBase } from './APIBase';
|
|
4
|
-
export declare class AbsenceAPI extends APIBase {
|
|
5
|
-
constructor(apiClient: APIClient, options: ClientOptions);
|
|
6
|
-
/**
|
|
7
|
-
* Create absences
|
|
8
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#f7548ccc-b114-46f8-493c-dc86b659dbbc
|
|
9
|
-
*/
|
|
10
|
-
createAbsence(absenceData: NewAbsence): Promise<Absence>;
|
|
11
|
-
/**
|
|
12
|
-
* Retrieve an absence
|
|
13
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#191890ad-7f0d-3c2d-11d8-ed91e6193944
|
|
14
|
-
*/
|
|
15
|
-
retrieveAbsence(id: string): Promise<Absence>;
|
|
16
|
-
/**
|
|
17
|
-
* Retrieve absences
|
|
18
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#72b55ac7-c4bc-30dc-8cd8-6ac1e15f2639
|
|
19
|
-
*/
|
|
20
|
-
retrieveAbsences(options?: PaginationOptions): Promise<Paginated<Absence[]>>;
|
|
21
|
-
/**
|
|
22
|
-
* Update an existing absence
|
|
23
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#f6f7f6a0-4520-f550-6132-610076d58a91
|
|
24
|
-
*/
|
|
25
|
-
updateAbsence(id: string, absenceData: Partial<Absence>): Promise<Absence>;
|
|
26
|
-
}
|
package/dist/api/AbsenceAPI.js
DELETED
|
@@ -1,68 +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.AbsenceAPI = void 0;
|
|
13
|
-
const Endpoints_1 = require("../Endpoints");
|
|
14
|
-
const APIBase_1 = require("./APIBase");
|
|
15
|
-
class AbsenceAPI extends APIBase_1.APIBase {
|
|
16
|
-
constructor(apiClient, options) {
|
|
17
|
-
super(apiClient, options);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Create absences
|
|
21
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#f7548ccc-b114-46f8-493c-dc86b659dbbc
|
|
22
|
-
*/
|
|
23
|
-
createAbsence(absenceData) {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
this.checkApiKey('Absence');
|
|
26
|
-
const endpoint = Endpoints_1.Endpoint.Absence.create();
|
|
27
|
-
const { data: absence } = yield this.apiClient.post(endpoint, absenceData);
|
|
28
|
-
return absence;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Retrieve an absence
|
|
33
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#191890ad-7f0d-3c2d-11d8-ed91e6193944
|
|
34
|
-
*/
|
|
35
|
-
retrieveAbsence(id) {
|
|
36
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
this.checkApiKey('Absence');
|
|
38
|
-
const endpoint = Endpoints_1.Endpoint.Absence.absences(id);
|
|
39
|
-
const { data: absence } = yield this.apiClient.get(endpoint);
|
|
40
|
-
return absence;
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Retrieve absences
|
|
45
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#72b55ac7-c4bc-30dc-8cd8-6ac1e15f2639
|
|
46
|
-
*/
|
|
47
|
-
retrieveAbsences(options) {
|
|
48
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
this.checkApiKey('Absence');
|
|
50
|
-
const endpoint = Endpoints_1.Endpoint.Absence.absences();
|
|
51
|
-
const { data: absences } = yield this.apiClient.post(endpoint, options);
|
|
52
|
-
return absences;
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Update an existing absence
|
|
57
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#f6f7f6a0-4520-f550-6132-610076d58a91
|
|
58
|
-
*/
|
|
59
|
-
updateAbsence(id, absenceData) {
|
|
60
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
this.checkApiKey('Absence');
|
|
62
|
-
const endpoint = Endpoints_1.Endpoint.Absence.absences(id);
|
|
63
|
-
const { data } = yield this.apiClient.put(endpoint, absenceData);
|
|
64
|
-
return data;
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
exports.AbsenceAPI = AbsenceAPI;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
-
import type { Allowance, ClientOptions, Paginated, PaginationOptions } from '../interfaces/';
|
|
3
|
-
import { APIBase } from './APIBase';
|
|
4
|
-
export declare class AllowanceTypeAPI extends APIBase {
|
|
5
|
-
constructor(apiClient: APIClient, options: ClientOptions);
|
|
6
|
-
/**
|
|
7
|
-
* Retrieve a single allowance type
|
|
8
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#ae42d612-c1ae-52da-0804-3fe77ba1a6fe
|
|
9
|
-
*/
|
|
10
|
-
retrieveAllowanceType(id: string): Promise<Allowance>;
|
|
11
|
-
/**
|
|
12
|
-
* Retrieve allowance types
|
|
13
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#ddea0e36-bd15-1ed0-0b56-bd4c480d7cce
|
|
14
|
-
*/
|
|
15
|
-
retrieveAllowanceTypes(options?: PaginationOptions): Promise<Paginated<Allowance[]>>;
|
|
16
|
-
}
|
|
@@ -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.AllowanceTypeAPI = void 0;
|
|
13
|
-
const Endpoints_1 = require("../Endpoints");
|
|
14
|
-
const APIBase_1 = require("./APIBase");
|
|
15
|
-
class AllowanceTypeAPI extends APIBase_1.APIBase {
|
|
16
|
-
constructor(apiClient, options) {
|
|
17
|
-
super(apiClient, options);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Retrieve a single allowance type
|
|
21
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#ae42d612-c1ae-52da-0804-3fe77ba1a6fe
|
|
22
|
-
*/
|
|
23
|
-
retrieveAllowanceType(id) {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
this.checkApiKey('AllowanceType');
|
|
26
|
-
const endpoint = Endpoints_1.Endpoint.AllowanceType.allowanceTypes(id);
|
|
27
|
-
const { data: allowance } = yield this.apiClient.get(endpoint);
|
|
28
|
-
return allowance;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Retrieve allowance types
|
|
33
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#ddea0e36-bd15-1ed0-0b56-bd4c480d7cce
|
|
34
|
-
*/
|
|
35
|
-
retrieveAllowanceTypes(options) {
|
|
36
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
this.checkApiKey('AllowanceType');
|
|
38
|
-
const endpoint = Endpoints_1.Endpoint.AllowanceType.allowanceTypes();
|
|
39
|
-
const { data: allowances } = yield this.apiClient.post(endpoint, options);
|
|
40
|
-
return allowances;
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.AllowanceTypeAPI = AllowanceTypeAPI;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
-
import type { ClientOptions, Department, Paginated, PaginationOptions } from '../interfaces/';
|
|
3
|
-
import { APIBase } from './APIBase';
|
|
4
|
-
export declare class DepartmentAPI extends APIBase {
|
|
5
|
-
constructor(apiClient: APIClient, options: ClientOptions);
|
|
6
|
-
/**
|
|
7
|
-
* Retrieve a single department
|
|
8
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#a9c45164-59e5-3daf-93f2-4c64f6cc52f0
|
|
9
|
-
*/
|
|
10
|
-
retrieveDepartment(id: string): Promise<Department>;
|
|
11
|
-
/**
|
|
12
|
-
* Retrieve departments
|
|
13
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#d596a243-9bc4-cb5f-dbc5-456c46437d09
|
|
14
|
-
*/
|
|
15
|
-
retrieveDepartments(options?: PaginationOptions): Promise<Paginated<Department[]>>;
|
|
16
|
-
}
|
|
@@ -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.DepartmentAPI = void 0;
|
|
13
|
-
const Endpoints_1 = require("../Endpoints");
|
|
14
|
-
const APIBase_1 = require("./APIBase");
|
|
15
|
-
class DepartmentAPI extends APIBase_1.APIBase {
|
|
16
|
-
constructor(apiClient, options) {
|
|
17
|
-
super(apiClient, options);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Retrieve a single department
|
|
21
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#a9c45164-59e5-3daf-93f2-4c64f6cc52f0
|
|
22
|
-
*/
|
|
23
|
-
retrieveDepartment(id) {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
this.checkApiKey('Department');
|
|
26
|
-
const endpoint = Endpoints_1.Endpoint.Department.departments(id);
|
|
27
|
-
const { data: department } = yield this.apiClient.get(endpoint);
|
|
28
|
-
return department;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Retrieve departments
|
|
33
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#d596a243-9bc4-cb5f-dbc5-456c46437d09
|
|
34
|
-
*/
|
|
35
|
-
retrieveDepartments(options) {
|
|
36
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
this.checkApiKey('Department');
|
|
38
|
-
const endpoint = Endpoints_1.Endpoint.Department.departments();
|
|
39
|
-
const { data: departments } = yield this.apiClient.post(endpoint, options);
|
|
40
|
-
return departments;
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.DepartmentAPI = DepartmentAPI;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
-
import type { ClientOptions, Location, Paginated, PaginationOptions } from '../interfaces/';
|
|
3
|
-
import { APIBase } from './APIBase';
|
|
4
|
-
export declare class LocationAPI extends APIBase {
|
|
5
|
-
constructor(apiClient: APIClient, options: ClientOptions);
|
|
6
|
-
/**
|
|
7
|
-
* Retrieve a single location
|
|
8
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#11905bb3-ce8d-80b4-656b-4b9097e35825
|
|
9
|
-
*/
|
|
10
|
-
retrieveLocation(id: string): Promise<Location>;
|
|
11
|
-
/**
|
|
12
|
-
* Retrieve locations
|
|
13
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#641bf728-23a1-538d-511f-5d1f69f15ba9
|
|
14
|
-
*/
|
|
15
|
-
retrieveLocations(options?: PaginationOptions): Promise<Paginated<Location>>;
|
|
16
|
-
}
|
package/dist/api/LocationAPI.js
DELETED
|
@@ -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.LocationAPI = void 0;
|
|
13
|
-
const Endpoints_1 = require("../Endpoints");
|
|
14
|
-
const APIBase_1 = require("./APIBase");
|
|
15
|
-
class LocationAPI extends APIBase_1.APIBase {
|
|
16
|
-
constructor(apiClient, options) {
|
|
17
|
-
super(apiClient, options);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Retrieve a single location
|
|
21
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#11905bb3-ce8d-80b4-656b-4b9097e35825
|
|
22
|
-
*/
|
|
23
|
-
retrieveLocation(id) {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
this.checkApiKey('Location');
|
|
26
|
-
const endpoint = Endpoints_1.Endpoint.Location.locations(id);
|
|
27
|
-
const { data: location } = yield this.apiClient.get(endpoint);
|
|
28
|
-
return location;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Retrieve locations
|
|
33
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#641bf728-23a1-538d-511f-5d1f69f15ba9
|
|
34
|
-
*/
|
|
35
|
-
retrieveLocations(options) {
|
|
36
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
this.checkApiKey('Location');
|
|
38
|
-
const endpoint = Endpoints_1.Endpoint.Location.locations();
|
|
39
|
-
const { data: locations } = yield this.apiClient.post(endpoint, options);
|
|
40
|
-
return locations;
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.LocationAPI = LocationAPI;
|
package/dist/api/ReasonAPI.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
-
import type { ClientOptions, Paginated } from '../interfaces/';
|
|
3
|
-
import type { Reason } from '../interfaces/Reason';
|
|
4
|
-
import { APIBase } from './APIBase';
|
|
5
|
-
export declare class ReasonAPI extends APIBase {
|
|
6
|
-
constructor(apiClient: APIClient, options: ClientOptions);
|
|
7
|
-
/**
|
|
8
|
-
* Retrieve a single reason
|
|
9
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#2829e308-b906-3b27-10f7-52827f34dfdd
|
|
10
|
-
*/
|
|
11
|
-
retrieveReason(id: string): Promise<Reason>;
|
|
12
|
-
/**
|
|
13
|
-
* Retrieve reasons
|
|
14
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#cd901260-489c-7437-aaff-65c14cb8e91e
|
|
15
|
-
*/
|
|
16
|
-
retrieveReasons(): Promise<Paginated<Reason[]>>;
|
|
17
|
-
}
|
package/dist/api/ReasonAPI.js
DELETED
|
@@ -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.ReasonAPI = void 0;
|
|
13
|
-
const Endpoints_1 = require("../Endpoints");
|
|
14
|
-
const APIBase_1 = require("./APIBase");
|
|
15
|
-
class ReasonAPI extends APIBase_1.APIBase {
|
|
16
|
-
constructor(apiClient, options) {
|
|
17
|
-
super(apiClient, options);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Retrieve a single reason
|
|
21
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#2829e308-b906-3b27-10f7-52827f34dfdd
|
|
22
|
-
*/
|
|
23
|
-
retrieveReason(id) {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
this.checkApiKey('Reason');
|
|
26
|
-
const endpoint = Endpoints_1.Endpoint.Reason.reasons(id);
|
|
27
|
-
const { data: reason } = yield this.apiClient.get(endpoint);
|
|
28
|
-
return reason;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Retrieve reasons
|
|
33
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#cd901260-489c-7437-aaff-65c14cb8e91e
|
|
34
|
-
*/
|
|
35
|
-
retrieveReasons() {
|
|
36
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
this.checkApiKey('Reason');
|
|
38
|
-
const endpoint = Endpoints_1.Endpoint.Reason.reasons();
|
|
39
|
-
const { data: reasons } = yield this.apiClient.post(endpoint, null);
|
|
40
|
-
return reasons;
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.ReasonAPI = ReasonAPI;
|
package/dist/api/TeamAPI.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
-
import type { ClientOptions, Paginated, PaginationOptions, Team } from '../interfaces/';
|
|
3
|
-
import { APIBase } from './APIBase';
|
|
4
|
-
export declare class TeamAPI extends APIBase {
|
|
5
|
-
constructor(apiClient: APIClient, options: ClientOptions);
|
|
6
|
-
/**
|
|
7
|
-
* Retrieve a single team
|
|
8
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#08486bf6-c138-5808-7c1d-7ead5c8b1aee
|
|
9
|
-
*/
|
|
10
|
-
retrieveTeam(id: string): Promise<Team>;
|
|
11
|
-
/**
|
|
12
|
-
* Retrieve teams
|
|
13
|
-
* @see https://documenter.getpostman.com/view/799228/absenceio-api-documentation/2Fwbis#ec24e740-47e6-3daa-5698-040f99ac9dfd
|
|
14
|
-
*/
|
|
15
|
-
retrieveTeams(options?: PaginationOptions): Promise<Paginated<Team[]>>;
|
|
16
|
-
}
|