bamboohr.com 1.1.2 → 1.3.0
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/CHANGELOG.md +33 -0
- package/dist/BambooHR.js +4 -0
- package/dist/BambooHR.js.map +1 -1
- package/dist/Endpoints.d.ts +4 -1
- package/dist/Endpoints.js +19 -7
- package/dist/Endpoints.js.map +1 -1
- package/dist/api/EmployeesAPI.js +8 -8
- package/dist/api/EmployeesAPI.js.map +1 -1
- package/dist/api/TimeOffAPI.d.ts +28 -1
- package/dist/api/TimeOffAPI.js +48 -3
- package/dist/api/TimeOffAPI.js.map +1 -1
- package/dist/api/index.js +5 -1
- package/dist/api/index.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces/DefaultHour.d.ts +4 -0
- package/dist/interfaces/DefaultHour.js +3 -0
- package/dist/interfaces/DefaultHour.js.map +1 -0
- package/dist/interfaces/TimeOffPolicy.d.ts +7 -0
- package/dist/interfaces/TimeOffPolicy.js +3 -0
- package/dist/interfaces/TimeOffPolicy.js.map +1 -0
- package/dist/interfaces/TimeOffRequest.d.ts +33 -0
- package/dist/interfaces/TimeOffRequest.js +3 -0
- package/dist/interfaces/TimeOffRequest.js.map +1 -0
- package/dist/interfaces/TimeOffRequestsOptions.d.ts +16 -0
- package/dist/interfaces/TimeOffRequestsOptions.js +3 -0
- package/dist/interfaces/TimeOffRequestsOptions.js.map +1 -0
- package/dist/interfaces/TimeOffType.d.ts +7 -0
- package/dist/interfaces/TimeOffType.js +3 -0
- package/dist/interfaces/TimeOffType.js.map +1 -0
- package/dist/interfaces/TimeOffTypes.d.ts +5 -0
- package/dist/interfaces/TimeOffTypes.js +3 -0
- package/dist/interfaces/TimeOffTypes.js.map +1 -0
- package/dist/interfaces/index.d.ts +6 -0
- package/dist/interfaces/index.js +11 -1
- package/dist/interfaces/index.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,39 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 1.3.0 (2022-03-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **absence.io:** Update UserAPI.ts with retrieveUserByOption ([#937](https://github.com/ffflorian/api-clients/tree/main/packages/bamboohr.com/issues/937)) ([72b2161](https://github.com/ffflorian/api-clients/tree/main/packages/bamboohr.com/commit/72b216144d7d579d77150c6342364a0989ef1b6f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 1.2.1 (2021-12-22)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* Upgrade yarn lock file ([91511d0](https://github.com/ffflorian/api-clients/tree/main/packages/bamboohr.com/commit/91511d0f17882c1faedf55296ab11d9516a3d425))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# 1.2.0 (2021-07-30)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* **bamboohr.com:** Handle errors, add more TimeOff endpoints ([f9fd458](https://github.com/ffflorian/api-clients/tree/main/packages/bamboohr.com/commit/f9fd458bf04253e01371e128d9ef06378700329c))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
## [1.1.2](https://github.com/ffflorian/api-clients/tree/main/packages/bamboohr.com/compare/bamboohr.com@1.1.1...bamboohr.com@1.1.2) (2021-05-17)
|
|
7
40
|
|
|
8
41
|
**Note:** Version bump only for package bamboohr.com
|
package/dist/BambooHR.js
CHANGED
|
@@ -17,6 +17,10 @@ class BambooHR {
|
|
|
17
17
|
Accept: 'application/json',
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
|
+
this.apiClient.interceptors.response.use(undefined, ({ response }) => {
|
|
21
|
+
const errorMessage = response.headers['x-bamboohr-error-message'] || response.statusText;
|
|
22
|
+
throw new Error(`HTTP error ${response.status}: ${errorMessage}`);
|
|
23
|
+
});
|
|
20
24
|
this.api = {
|
|
21
25
|
employees: new api_1.EmployeesAPI(this.apiClient),
|
|
22
26
|
timeOff: new api_1.TimeOffAPI(this.apiClient),
|
package/dist/BambooHR.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BambooHR.js","sourceRoot":"","sources":["../src/BambooHR.ts"],"names":[],"mappings":";;;AAAA,iCAA2C;AAE3C,+BAA+C;AAG/C,MAAa,QAAQ;IAKnB,YAAY,OAAsB;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,SAAS,GAAG,eAAK,CAAC,MAAM,CAAC;YAC5B,IAAI,EAAE;gBACJ,4CAA4C;gBAC5C,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"BambooHR.js","sourceRoot":"","sources":["../src/BambooHR.ts"],"names":[],"mappings":";;;AAAA,iCAA2C;AAE3C,+BAA+C;AAG/C,MAAa,QAAQ;IAKnB,YAAY,OAAsB;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,SAAS,GAAG,eAAK,CAAC,MAAM,CAAC;YAC5B,IAAI,EAAE;gBACJ,4CAA4C;gBAC5C,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;gBACjD,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;aAC9B;YACD,OAAO,EAAE,4CAA4C,OAAO,CAAC,aAAa,MAAM;YAChF,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;aAC3B;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,EAAC,QAAQ,EAAC,EAAE,EAAE;YACjE,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,0BAA0B,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC;YACzF,MAAM,IAAI,KAAK,CAAC,cAAc,QAAQ,CAAC,MAAM,KAAK,YAAY,EAAE,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,GAAG;YACT,SAAS,EAAE,IAAI,kBAAY,CAAC,IAAI,CAAC,SAAS,CAAC;YAC3C,OAAO,EAAE,IAAI,gBAAU,CAAC,IAAI,CAAC,SAAS,CAAC;SACxC,CAAC;IACJ,CAAC;CACF;AA9BD,4BA8BC"}
|
package/dist/Endpoints.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ export declare namespace Endpoint {
|
|
|
5
5
|
function employeeDirectory(): string;
|
|
6
6
|
}
|
|
7
7
|
namespace TimeOff {
|
|
8
|
-
function whosOut(
|
|
8
|
+
function whosOut(): string;
|
|
9
|
+
function timeOffTypes(): string;
|
|
10
|
+
function timeOffPolicies(): string;
|
|
11
|
+
function timeOffRequests(): string;
|
|
9
12
|
}
|
|
10
13
|
}
|
package/dist/Endpoints.js
CHANGED
|
@@ -4,9 +4,13 @@ exports.Endpoint = void 0;
|
|
|
4
4
|
const qs = require("qs");
|
|
5
5
|
var Endpoint;
|
|
6
6
|
(function (Endpoint) {
|
|
7
|
-
const EMPLOYEES = 'employees';
|
|
8
7
|
const DIRECTORY = 'directory';
|
|
8
|
+
const EMPLOYEES = 'employees';
|
|
9
|
+
const META = 'meta';
|
|
10
|
+
const POLICIES = 'policies';
|
|
11
|
+
const REQUESTS = 'requests';
|
|
9
12
|
const TIME_OFF = 'time_off';
|
|
13
|
+
const TYPES = 'types';
|
|
10
14
|
const WHOS_OUT = 'whos_out';
|
|
11
15
|
let Employees;
|
|
12
16
|
(function (Employees) {
|
|
@@ -28,14 +32,22 @@ var Endpoint;
|
|
|
28
32
|
})(Employees = Endpoint.Employees || (Endpoint.Employees = {}));
|
|
29
33
|
let TimeOff;
|
|
30
34
|
(function (TimeOff) {
|
|
31
|
-
function whosOut(
|
|
32
|
-
|
|
33
|
-
if (start || end) {
|
|
34
|
-
path += `?${qs.stringify({ end, start })}`;
|
|
35
|
-
}
|
|
36
|
-
return path;
|
|
35
|
+
function whosOut() {
|
|
36
|
+
return `/${TIME_OFF}/${WHOS_OUT}/`;
|
|
37
37
|
}
|
|
38
38
|
TimeOff.whosOut = whosOut;
|
|
39
|
+
function timeOffTypes() {
|
|
40
|
+
return `/${META}/${TIME_OFF}/${TYPES}/`;
|
|
41
|
+
}
|
|
42
|
+
TimeOff.timeOffTypes = timeOffTypes;
|
|
43
|
+
function timeOffPolicies() {
|
|
44
|
+
return `/${META}/${TIME_OFF}/${POLICIES}/`;
|
|
45
|
+
}
|
|
46
|
+
TimeOff.timeOffPolicies = timeOffPolicies;
|
|
47
|
+
function timeOffRequests() {
|
|
48
|
+
return `/${TIME_OFF}/${REQUESTS}/`;
|
|
49
|
+
}
|
|
50
|
+
TimeOff.timeOffRequests = timeOffRequests;
|
|
39
51
|
})(TimeOff = Endpoint.TimeOff || (Endpoint.TimeOff = {}));
|
|
40
52
|
})(Endpoint = exports.Endpoint || (exports.Endpoint = {}));
|
|
41
53
|
//# sourceMappingURL=Endpoints.js.map
|
package/dist/Endpoints.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Endpoints.js","sourceRoot":"","sources":["../src/Endpoints.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AAGzB,IAAiB,QAAQ,
|
|
1
|
+
{"version":3,"file":"Endpoints.js","sourceRoot":"","sources":["../src/Endpoints.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AAGzB,IAAiB,QAAQ,CA8CxB;AA9CD,WAAiB,QAAQ;IACvB,MAAM,SAAS,GAAG,WAAW,CAAC;IAC9B,MAAM,SAAS,GAAG,WAAW,CAAC;IAC9B,MAAM,IAAI,GAAG,MAAM,CAAC;IACpB,MAAM,QAAQ,GAAG,UAAU,CAAC;IAC5B,MAAM,QAAQ,GAAG,UAAU,CAAC;IAC5B,MAAM,QAAQ,GAAG,UAAU,CAAC;IAC5B,MAAM,KAAK,GAAG,OAAO,CAAC;IACtB,MAAM,QAAQ,GAAG,UAAU,CAAC;IAE5B,IAAiB,SAAS,CAiBzB;IAjBD,WAAiB,SAAS;QACxB,SAAgB,SAAS,CAAC,EAAW,EAAE,MAA4B;YACjE,IAAI,IAAI,GAAG,IAAI,SAAS,GAAG,CAAC;YAC5B,IAAI,EAAE,EAAE;gBACN,IAAI,IAAI,GAAG,EAAE,GAAG,CAAC;aAClB;YAED,IAAI,MAAM,EAAE;gBACV,IAAI,IAAI,IAAI,EAAE,CAAC,SAAS,CAAC,EAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAC,CAAC,EAAE,CAAC;aACxD;YAED,OAAO,IAAI,CAAC;QACd,CAAC;QAXe,mBAAS,YAWxB,CAAA;QAED,SAAgB,iBAAiB;YAC/B,OAAO,IAAI,SAAS,IAAI,SAAS,GAAG,CAAC;QACvC,CAAC;QAFe,2BAAiB,oBAEhC,CAAA;IACH,CAAC,EAjBgB,SAAS,GAAT,kBAAS,KAAT,kBAAS,QAiBzB;IAED,IAAiB,OAAO,CAgBvB;IAhBD,WAAiB,OAAO;QACtB,SAAgB,OAAO;YACrB,OAAO,IAAI,QAAQ,IAAI,QAAQ,GAAG,CAAC;QACrC,CAAC;QAFe,eAAO,UAEtB,CAAA;QAED,SAAgB,YAAY;YAC1B,OAAO,IAAI,IAAI,IAAI,QAAQ,IAAI,KAAK,GAAG,CAAC;QAC1C,CAAC;QAFe,oBAAY,eAE3B,CAAA;QAED,SAAgB,eAAe;YAC7B,OAAO,IAAI,IAAI,IAAI,QAAQ,IAAI,QAAQ,GAAG,CAAC;QAC7C,CAAC;QAFe,uBAAe,kBAE9B,CAAA;QAED,SAAgB,eAAe;YAC7B,OAAO,IAAI,QAAQ,IAAI,QAAQ,GAAG,CAAC;QACrC,CAAC;QAFe,uBAAe,kBAE9B,CAAA;IACH,CAAC,EAhBgB,OAAO,GAAP,gBAAO,KAAP,gBAAO,QAgBvB;AACH,CAAC,EA9CgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QA8CxB"}
|
package/dist/api/EmployeesAPI.js
CHANGED
|
@@ -22,8 +22,8 @@ class EmployeesAPI {
|
|
|
22
22
|
addEmployee(fields) {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
24
|
const endpoint = Endpoints_1.Endpoint.Employees.employees();
|
|
25
|
-
const { data
|
|
26
|
-
return
|
|
25
|
+
const { data } = yield this.apiClient.post(endpoint, { data: fields });
|
|
26
|
+
return data;
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
@@ -33,8 +33,8 @@ class EmployeesAPI {
|
|
|
33
33
|
getEmployee(id, fields) {
|
|
34
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
35
|
const endpoint = Endpoints_1.Endpoint.Employees.employees(id, fields);
|
|
36
|
-
const { data
|
|
37
|
-
return
|
|
36
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
37
|
+
return data;
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
@@ -44,8 +44,8 @@ class EmployeesAPI {
|
|
|
44
44
|
getEmployeeDirectory() {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
const endpoint = Endpoints_1.Endpoint.Employees.employeeDirectory();
|
|
47
|
-
const { data
|
|
48
|
-
return
|
|
47
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
48
|
+
return data;
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
@@ -55,8 +55,8 @@ class EmployeesAPI {
|
|
|
55
55
|
updateEmployee(id, fields) {
|
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
57
|
const endpoint = Endpoints_1.Endpoint.Employees.employees(id);
|
|
58
|
-
const { data
|
|
59
|
-
return
|
|
58
|
+
const { data } = yield this.apiClient.post(endpoint, { data: fields });
|
|
59
|
+
return data;
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmployeesAPI.js","sourceRoot":"","sources":["../../src/api/EmployeesAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,4CAAsC;AAGtC,MAAa,YAAY;IACvB,YAA6B,SAAwB;QAAxB,cAAS,GAAT,SAAS,CAAe;IAAG,CAAC;IAEzD;;;OAGG;IACU,WAAW,CAAC,MAA8C;;YACrE,MAAM,QAAQ,GAAG,oBAAQ,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;YAChD,MAAM,EAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"EmployeesAPI.js","sourceRoot":"","sources":["../../src/api/EmployeesAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,4CAAsC;AAGtC,MAAa,YAAY;IACvB,YAA6B,SAAwB;QAAxB,cAAS,GAAT,SAAS,CAAe;IAAG,CAAC;IAEzD;;;OAGG;IACU,WAAW,CAAC,MAA8C;;YACrE,MAAM,QAAQ,GAAG,oBAAQ,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;YAChD,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAW,QAAQ,EAAE,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC,CAAC;YAC7E,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;IAED;;;OAGG;IACU,WAAW,CAAC,EAAU,EAAE,MAA4B;;YAC/D,MAAM,QAAQ,GAAG,oBAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;YAC1D,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAW,QAAQ,CAAC,CAAC;YAC5D,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;IAED;;;OAGG;IACU,oBAAoB;;YAC/B,MAAM,QAAQ,GAAG,oBAAQ,CAAC,SAAS,CAAC,iBAAiB,EAAE,CAAC;YACxD,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAoB,QAAQ,CAAC,CAAC;YACrE,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;IAED;;;OAGG;IACU,cAAc,CAAC,EAAU,EAAE,MAAsB;;YAC5D,MAAM,QAAQ,GAAG,oBAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;YAClD,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAW,QAAQ,EAAE,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC,CAAC;YAC7E,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;CACF;AA1CD,oCA0CC"}
|
package/dist/api/TimeOffAPI.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AxiosInstance } from 'axios';
|
|
2
|
-
import { OffEmployee } from '../interfaces';
|
|
2
|
+
import { OffEmployee, TimeOffPolicy, TimeOffTypes, TimeOffRequestsOptions, TimeOffRequest } from '../interfaces';
|
|
3
3
|
export declare class TimeOffAPI {
|
|
4
4
|
private readonly apiClient;
|
|
5
5
|
constructor(apiClient: AxiosInstance);
|
|
@@ -8,4 +8,31 @@ export declare class TimeOffAPI {
|
|
|
8
8
|
* @see https://documentation.bamboohr.com/reference#get-a-list-of-whos-out-1
|
|
9
9
|
*/
|
|
10
10
|
whosOut(start?: string, end?: string): Promise<OffEmployee[]>;
|
|
11
|
+
/**
|
|
12
|
+
* This endpoint gets a list of time off types.
|
|
13
|
+
* @param mode set to 'request' to get a list of all time off types with which this user can create a time off
|
|
14
|
+
* request. The default is to return the list of time off types the user has permissions on. This distinction is
|
|
15
|
+
* important, as employees can request time off for types that they don't have permission to view balances and
|
|
16
|
+
* requests for.
|
|
17
|
+
* @see https://documentation.bamboohr.com/reference#get-time-off-types
|
|
18
|
+
*/
|
|
19
|
+
timeOffTypes(mode?: 'request'): Promise<TimeOffTypes>;
|
|
20
|
+
/**
|
|
21
|
+
* This endpoint gets a list of time off policies.
|
|
22
|
+
* @see https://documentation.bamboohr.com/reference#get-time-off-policies
|
|
23
|
+
*/
|
|
24
|
+
timeOffPolicies(): Promise<TimeOffPolicy[]>;
|
|
25
|
+
/**
|
|
26
|
+
* The response will be limited to those employees and time off types that the owner of the API key used to make the request has view access to.
|
|
27
|
+
*
|
|
28
|
+
* The start and end date parameters will show time off if any day in the time off request falls within the dates specified, even if part of the time off falls outside of the time specified.
|
|
29
|
+
*
|
|
30
|
+
* Clients should be ready for any number of "note" elements.
|
|
31
|
+
*
|
|
32
|
+
* If there are zero notes for a request then the "notes" tag will be still included as an empty array.
|
|
33
|
+
*
|
|
34
|
+
* Newer time off requests may also include details for each day of the request in a element.
|
|
35
|
+
* @see https://documentation.bamboohr.com/reference#time-off-get-time-off-requests-1
|
|
36
|
+
*/
|
|
37
|
+
timeOffRequests(options: TimeOffRequestsOptions): Promise<TimeOffRequest[]>;
|
|
11
38
|
}
|
package/dist/api/TimeOffAPI.js
CHANGED
|
@@ -21,9 +21,54 @@ class TimeOffAPI {
|
|
|
21
21
|
*/
|
|
22
22
|
whosOut(start, end) {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const endpoint = Endpoints_1.Endpoint.TimeOff.whosOut(
|
|
25
|
-
const { data
|
|
26
|
-
return
|
|
24
|
+
const endpoint = Endpoints_1.Endpoint.TimeOff.whosOut();
|
|
25
|
+
const { data } = yield this.apiClient.get(endpoint, { params: { end, start } });
|
|
26
|
+
return data;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* This endpoint gets a list of time off types.
|
|
31
|
+
* @param mode set to 'request' to get a list of all time off types with which this user can create a time off
|
|
32
|
+
* request. The default is to return the list of time off types the user has permissions on. This distinction is
|
|
33
|
+
* important, as employees can request time off for types that they don't have permission to view balances and
|
|
34
|
+
* requests for.
|
|
35
|
+
* @see https://documentation.bamboohr.com/reference#get-time-off-types
|
|
36
|
+
*/
|
|
37
|
+
timeOffTypes(mode) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const endpoint = Endpoints_1.Endpoint.TimeOff.timeOffTypes();
|
|
40
|
+
const { data } = yield this.apiClient.get(endpoint, { params: { mode } });
|
|
41
|
+
return data;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* This endpoint gets a list of time off policies.
|
|
46
|
+
* @see https://documentation.bamboohr.com/reference#get-time-off-policies
|
|
47
|
+
*/
|
|
48
|
+
timeOffPolicies() {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const endpoint = Endpoints_1.Endpoint.TimeOff.timeOffPolicies();
|
|
51
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
52
|
+
return data;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The response will be limited to those employees and time off types that the owner of the API key used to make the request has view access to.
|
|
57
|
+
*
|
|
58
|
+
* The start and end date parameters will show time off if any day in the time off request falls within the dates specified, even if part of the time off falls outside of the time specified.
|
|
59
|
+
*
|
|
60
|
+
* Clients should be ready for any number of "note" elements.
|
|
61
|
+
*
|
|
62
|
+
* If there are zero notes for a request then the "notes" tag will be still included as an empty array.
|
|
63
|
+
*
|
|
64
|
+
* Newer time off requests may also include details for each day of the request in a element.
|
|
65
|
+
* @see https://documentation.bamboohr.com/reference#time-off-get-time-off-requests-1
|
|
66
|
+
*/
|
|
67
|
+
timeOffRequests(options) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const endpoint = Endpoints_1.Endpoint.TimeOff.timeOffRequests();
|
|
70
|
+
const { data } = yield this.apiClient.get(endpoint, { params: options });
|
|
71
|
+
return data;
|
|
27
72
|
});
|
|
28
73
|
}
|
|
29
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeOffAPI.js","sourceRoot":"","sources":["../../src/api/TimeOffAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,4CAAsC;AAGtC,MAAa,UAAU;IACrB,YAA6B,SAAwB;QAAxB,cAAS,GAAT,SAAS,CAAe;IAAG,CAAC;IAEzD;;;OAGG;IACU,OAAO,CAAC,KAAc,EAAE,GAAY;;YAC/C,MAAM,QAAQ,GAAG,oBAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"TimeOffAPI.js","sourceRoot":"","sources":["../../src/api/TimeOffAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,4CAAsC;AAGtC,MAAa,UAAU;IACrB,YAA6B,SAAwB;QAAxB,cAAS,GAAT,SAAS,CAAe;IAAG,CAAC;IAEzD;;;OAGG;IACU,OAAO,CAAC,KAAc,EAAE,GAAY;;YAC/C,MAAM,QAAQ,GAAG,oBAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YAC5C,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAgB,QAAQ,EAAE,EAAC,MAAM,EAAE,EAAC,GAAG,EAAE,KAAK,EAAC,EAAC,CAAC,CAAC;YACzF,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;IAED;;;;;;;OAOG;IACU,YAAY,CAAC,IAAgB;;YACxC,MAAM,QAAQ,GAAG,oBAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;YACjD,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAe,QAAQ,EAAE,EAAC,MAAM,EAAE,EAAC,IAAI,EAAC,EAAC,CAAC,CAAC;YAClF,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;IAED;;;OAGG;IACU,eAAe;;YAC1B,MAAM,QAAQ,GAAG,oBAAQ,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC;YACpD,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAkB,QAAQ,CAAC,CAAC;YACnE,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;IAED;;;;;;;;;;;OAWG;IACU,eAAe,CAAC,OAA+B;;YAC1D,MAAM,QAAQ,GAAG,oBAAQ,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC;YACpD,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAmB,QAAQ,EAAE,EAAC,MAAM,EAAE,OAAO,EAAC,CAAC,CAAC;YACvF,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;CACF;AAtDD,gCAsDC"}
|
package/dist/api/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,+CAA6B"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,gDAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultHour.js","sourceRoot":"","sources":["../../src/interfaces/DefaultHour.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeOffPolicy.js","sourceRoot":"","sources":["../../src/interfaces/TimeOffPolicy.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TimeOffType } from './TimeOffType';
|
|
2
|
+
interface TimeOffRequestActions {
|
|
3
|
+
approve: boolean;
|
|
4
|
+
bypass: boolean;
|
|
5
|
+
cancel: boolean;
|
|
6
|
+
deny: boolean;
|
|
7
|
+
edit: boolean;
|
|
8
|
+
view: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface TimeOffRequestAmount {
|
|
11
|
+
amount: string;
|
|
12
|
+
unit: string;
|
|
13
|
+
}
|
|
14
|
+
interface TimeOffRequestStatus {
|
|
15
|
+
lastChanged: string;
|
|
16
|
+
lastChangedByUserId: string;
|
|
17
|
+
status: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TimeOffRequest {
|
|
20
|
+
actions: TimeOffRequestActions;
|
|
21
|
+
amount: TimeOffRequestAmount;
|
|
22
|
+
created: string;
|
|
23
|
+
dates: Record<string, string>;
|
|
24
|
+
employeeId: string;
|
|
25
|
+
end: string;
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
notes: [];
|
|
29
|
+
start: string;
|
|
30
|
+
status: TimeOffRequestStatus;
|
|
31
|
+
type: TimeOffType;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeOffRequest.js","sourceRoot":"","sources":["../../src/interfaces/TimeOffRequest.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface TimeOffRequestsOptions {
|
|
2
|
+
/** Limit to requests that the user has a particular level of access to. Legal values are: "view" or "approve". Defaults to view. */
|
|
3
|
+
action?: string;
|
|
4
|
+
/** A particular employee ID to limit the response to. */
|
|
5
|
+
employeeId?: string;
|
|
6
|
+
/** YYYY-MM-DD. Only show time off that occurs on/before the specified end date. */
|
|
7
|
+
end: string;
|
|
8
|
+
/** A particular request ID to limit the response to. */
|
|
9
|
+
id?: number;
|
|
10
|
+
/** YYYY-MM-DD. Only show time off that occurs on/after the specified start date. */
|
|
11
|
+
start: string;
|
|
12
|
+
/** A comma separated list of request status values to include. If omitted, requests of all status values are included. Legal values are "approved", "denied", "superceded", "requested", "canceled". */
|
|
13
|
+
status?: string;
|
|
14
|
+
/** A comma separated list of time off types IDs to include limit the response to. If omitted, requests of all types are included. */
|
|
15
|
+
type?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeOffRequestsOptions.js","sourceRoot":"","sources":["../../src/interfaces/TimeOffRequestsOptions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeOffType.js","sourceRoot":"","sources":["../../src/interfaces/TimeOffType.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeOffTypes.js","sourceRoot":"","sources":["../../src/interfaces/TimeOffTypes.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export * from './API';
|
|
2
2
|
export * from './ClientOptions';
|
|
3
|
+
export * from './DefaultHour';
|
|
3
4
|
export * from './Employee';
|
|
4
5
|
export * from './Fields';
|
|
6
|
+
export * from './TimeOffPolicy';
|
|
7
|
+
export * from './TimeOffRequest';
|
|
8
|
+
export * from './TimeOffRequestsOptions';
|
|
9
|
+
export * from './TimeOffType';
|
|
10
|
+
export * from './TimeOffTypes';
|
package/dist/interfaces/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -12,6 +16,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./API"), exports);
|
|
14
18
|
__exportStar(require("./ClientOptions"), exports);
|
|
19
|
+
__exportStar(require("./DefaultHour"), exports);
|
|
15
20
|
__exportStar(require("./Employee"), exports);
|
|
16
21
|
__exportStar(require("./Fields"), exports);
|
|
22
|
+
__exportStar(require("./TimeOffPolicy"), exports);
|
|
23
|
+
__exportStar(require("./TimeOffRequest"), exports);
|
|
24
|
+
__exportStar(require("./TimeOffRequestsOptions"), exports);
|
|
25
|
+
__exportStar(require("./TimeOffType"), exports);
|
|
26
|
+
__exportStar(require("./TimeOffTypes"), exports);
|
|
17
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,kDAAgC;AAChC,gDAA8B;AAC9B,6CAA2B;AAC3B,2CAAyB;AACzB,kDAAgC;AAChC,mDAAiC;AACjC,2DAAyC;AACzC,gDAA8B;AAC9B,iDAA+B"}
|
package/package.json
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
"author": "Florian Imdahl <git@ffflorian.de>",
|
|
3
3
|
"dependencies": {
|
|
4
4
|
"@hapi/hawk": "8.0.0",
|
|
5
|
-
"axios": "0.
|
|
6
|
-
"qs": "6.10.
|
|
5
|
+
"axios": "0.26.1",
|
|
6
|
+
"qs": "6.10.3"
|
|
7
7
|
},
|
|
8
8
|
"description": "An bamboohr.com API client",
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@types/hapi__hawk": "8.0.
|
|
11
|
-
"@types/node": "~
|
|
10
|
+
"@types/hapi__hawk": "8.0.2",
|
|
11
|
+
"@types/node": "~16",
|
|
12
12
|
"rimraf": "3.0.2",
|
|
13
|
-
"typedoc": "0.
|
|
14
|
-
"typescript": "4.2
|
|
13
|
+
"typedoc": "0.22.13",
|
|
14
|
+
"typescript": "4.6.2"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
17
|
"node": ">= 10.9"
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
"dist": "yarn clean && yarn build:ts",
|
|
36
36
|
"test": "exit 0"
|
|
37
37
|
},
|
|
38
|
-
"version": "1.
|
|
39
|
-
"gitHead": "
|
|
38
|
+
"version": "1.3.0",
|
|
39
|
+
"gitHead": "4f552a3933dc19d22644a55b17cf16293ccdb40a"
|
|
40
40
|
}
|