bamboohr.com 1.5.6 → 1.5.7

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.
@@ -0,0 +1,7 @@
1
+ import type { API, ClientOptions } from './interfaces';
2
+ export declare class BambooHR {
3
+ readonly api: API;
4
+ private readonly apiClient;
5
+ private readonly options;
6
+ constructor(options: ClientOptions);
7
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.BambooHR = void 0;
7
+ const api_client_1 = require("@ffflorian/api-client");
8
+ const node_crypto_1 = __importDefault(require("node:crypto"));
9
+ const api_1 = require("./api");
10
+ class BambooHR {
11
+ constructor(options) {
12
+ this.options = options;
13
+ const baseURL = `https://api.bamboohr.com/api/gateway.php/${options.companyDomain}/v1/`;
14
+ this.apiClient = new api_client_1.APIClient(baseURL, {
15
+ auth: {
16
+ // eslint-disable-next-line no-magic-numbers
17
+ password: node_crypto_1.default.randomBytes(16).toString('base64').substring(0, 7),
18
+ username: this.options.apiKey,
19
+ },
20
+ headers: {
21
+ Accept: 'application/json',
22
+ },
23
+ });
24
+ this.apiClient.interceptors.response.push(response => {
25
+ const errorMessage = response.headers.get('x-bamboohr-error-message') || response.statusText;
26
+ throw new Error(`HTTP error ${response.status}: ${errorMessage}`);
27
+ });
28
+ this.api = {
29
+ employees: new api_1.EmployeesAPI(this.apiClient),
30
+ timeOff: new api_1.TimeOffAPI(this.apiClient),
31
+ };
32
+ }
33
+ }
34
+ exports.BambooHR = BambooHR;
@@ -0,0 +1,21 @@
1
+ import type { Fields } from './interfaces/Fields';
2
+ export declare const Endpoint: {
3
+ DIRECTORY: string;
4
+ EMPLOYEES: string;
5
+ Employees: {
6
+ employeeDirectory(): string;
7
+ employees(id?: number, fields?: Array<keyof Fields>): string;
8
+ };
9
+ META: string;
10
+ POLICIES: string;
11
+ REQUESTS: string;
12
+ TIME_OFF: string;
13
+ TimeOff: {
14
+ timeOffPolicies(): string;
15
+ timeOffRequests(): string;
16
+ timeOffTypes(): string;
17
+ whosOut(): string;
18
+ };
19
+ TYPES: string;
20
+ WHOS_OUT: string;
21
+ };
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Endpoint = void 0;
4
+ exports.Endpoint = {
5
+ DIRECTORY: 'directory',
6
+ EMPLOYEES: 'employees',
7
+ Employees: {
8
+ employeeDirectory() {
9
+ return `/${exports.Endpoint.EMPLOYEES}/${exports.Endpoint.DIRECTORY}/`;
10
+ },
11
+ employees(id, fields) {
12
+ const url = new URL(`/${exports.Endpoint.EMPLOYEES}/`, 'https://example.com');
13
+ if (id) {
14
+ url.pathname += `${id}/`;
15
+ }
16
+ if (fields) {
17
+ const params = new URLSearchParams();
18
+ params.append('fields', fields.join(','));
19
+ url.search = params.toString();
20
+ }
21
+ return `${url.pathname}${url.search}`;
22
+ },
23
+ },
24
+ META: 'meta',
25
+ POLICIES: 'policies',
26
+ REQUESTS: 'requests',
27
+ TIME_OFF: 'time_off',
28
+ TimeOff: {
29
+ timeOffPolicies() {
30
+ return `/${exports.Endpoint.META}/${exports.Endpoint.TIME_OFF}/${exports.Endpoint.POLICIES}/`;
31
+ },
32
+ timeOffRequests() {
33
+ return `/${exports.Endpoint.TIME_OFF}/${exports.Endpoint.REQUESTS}/`;
34
+ },
35
+ timeOffTypes() {
36
+ return `/${exports.Endpoint.META}/${exports.Endpoint.TIME_OFF}/${exports.Endpoint.TYPES}/`;
37
+ },
38
+ whosOut() {
39
+ return `/${exports.Endpoint.TIME_OFF}/${exports.Endpoint.WHOS_OUT}/`;
40
+ },
41
+ },
42
+ TYPES: 'types',
43
+ WHOS_OUT: 'whos_out',
44
+ };
@@ -0,0 +1,26 @@
1
+ import type { APIClient } from '@ffflorian/api-client';
2
+ import type { Employee, EmployeeDirectory, Fields, WritableFields } from '../interfaces';
3
+ export declare class EmployeesAPI {
4
+ private readonly apiClient;
5
+ constructor(apiClient: APIClient);
6
+ /**
7
+ * Update an employee, based on employee id.
8
+ * @see https://documentation.bamboohr.com/reference#add-employee-1
9
+ */
10
+ addEmployee(fields: Pick<Fields, 'firstName' | 'lastName'>): Promise<Employee>;
11
+ /**
12
+ * Get employee data by specifying a set of fields. This is suitable for getting basic employee information, including current values for fields that are part of a historical table, like job title, or compensation information.
13
+ * @see https://documentation.bamboohr.com/reference#get-employee
14
+ */
15
+ getEmployee(id: number, fields?: Array<keyof Fields>): Promise<Employee>;
16
+ /**
17
+ * Gets employee directory.
18
+ * @see https://documentation.bamboohr.com/reference#get-employees-directory-1
19
+ */
20
+ getEmployeeDirectory(): Promise<EmployeeDirectory>;
21
+ /**
22
+ * Update an employee, based on employee id.
23
+ * @see https://documentation.bamboohr.com/reference#update-employee
24
+ */
25
+ updateEmployee(id: number, fields: WritableFields): Promise<Employee>;
26
+ }
@@ -0,0 +1,63 @@
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.EmployeesAPI = void 0;
13
+ const Endpoints_1 = require("../Endpoints");
14
+ class EmployeesAPI {
15
+ constructor(apiClient) {
16
+ this.apiClient = apiClient;
17
+ }
18
+ /**
19
+ * Update an employee, based on employee id.
20
+ * @see https://documentation.bamboohr.com/reference#add-employee-1
21
+ */
22
+ addEmployee(fields) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const endpoint = Endpoints_1.Endpoint.Employees.employees();
25
+ const { data } = yield this.apiClient.post(endpoint, fields);
26
+ return data;
27
+ });
28
+ }
29
+ /**
30
+ * Get employee data by specifying a set of fields. This is suitable for getting basic employee information, including current values for fields that are part of a historical table, like job title, or compensation information.
31
+ * @see https://documentation.bamboohr.com/reference#get-employee
32
+ */
33
+ getEmployee(id, fields) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ const endpoint = Endpoints_1.Endpoint.Employees.employees(id, fields);
36
+ const { data } = yield this.apiClient.get(endpoint);
37
+ return data;
38
+ });
39
+ }
40
+ /**
41
+ * Gets employee directory.
42
+ * @see https://documentation.bamboohr.com/reference#get-employees-directory-1
43
+ */
44
+ getEmployeeDirectory() {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ const endpoint = Endpoints_1.Endpoint.Employees.employeeDirectory();
47
+ const { data } = yield this.apiClient.get(endpoint);
48
+ return data;
49
+ });
50
+ }
51
+ /**
52
+ * Update an employee, based on employee id.
53
+ * @see https://documentation.bamboohr.com/reference#update-employee
54
+ */
55
+ updateEmployee(id, fields) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ const endpoint = Endpoints_1.Endpoint.Employees.employees(id);
58
+ const { data } = yield this.apiClient.post(endpoint, fields);
59
+ return data;
60
+ });
61
+ }
62
+ }
63
+ exports.EmployeesAPI = EmployeesAPI;
@@ -0,0 +1,38 @@
1
+ import type { APIClient } from '@ffflorian/api-client';
2
+ import type { OffEmployee, TimeOffPolicy, TimeOffRequest, TimeOffRequestsOptions, TimeOffTypes } from '../interfaces';
3
+ export declare class TimeOffAPI {
4
+ private readonly apiClient;
5
+ constructor(apiClient: APIClient);
6
+ /**
7
+ * This endpoint gets a list of time off policies.
8
+ * @see https://documentation.bamboohr.com/reference#get-time-off-policies
9
+ */
10
+ timeOffPolicies(): Promise<TimeOffPolicy[]>;
11
+ /**
12
+ * 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.
13
+ *
14
+ * 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.
15
+ *
16
+ * Clients should be ready for any number of "note" elements.
17
+ *
18
+ * If there are zero notes for a request then the "notes" tag will be still included as an empty array.
19
+ *
20
+ * Newer time off requests may also include details for each day of the request in a element.
21
+ * @see https://documentation.bamboohr.com/reference#time-off-get-time-off-requests-1
22
+ */
23
+ timeOffRequests(options: TimeOffRequestsOptions): Promise<TimeOffRequest[]>;
24
+ /**
25
+ * This endpoint gets a list of time off types.
26
+ * @param mode set to 'request' to get a list of all time off types with which this user can create a time off
27
+ * request. The default is to return the list of time off types the user has permissions on. This distinction is
28
+ * important, as employees can request time off for types that they don't have permission to view balances and
29
+ * requests for.
30
+ * @see https://documentation.bamboohr.com/reference#get-time-off-types
31
+ */
32
+ timeOffTypes(mode?: 'request'): Promise<TimeOffTypes>;
33
+ /**
34
+ * This endpoint will return a list, sorted by date, of employees who will be out, and company holidays, for a period of time.
35
+ * @see https://documentation.bamboohr.com/reference#get-a-list-of-whos-out-1
36
+ */
37
+ whosOut(start?: string, end?: string): Promise<OffEmployee[]>;
38
+ }
@@ -0,0 +1,75 @@
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.TimeOffAPI = void 0;
13
+ const Endpoints_1 = require("../Endpoints");
14
+ class TimeOffAPI {
15
+ constructor(apiClient) {
16
+ this.apiClient = apiClient;
17
+ }
18
+ /**
19
+ * This endpoint gets a list of time off policies.
20
+ * @see https://documentation.bamboohr.com/reference#get-time-off-policies
21
+ */
22
+ timeOffPolicies() {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const endpoint = Endpoints_1.Endpoint.TimeOff.timeOffPolicies();
25
+ const { data } = yield this.apiClient.get(endpoint);
26
+ return data;
27
+ });
28
+ }
29
+ /**
30
+ * 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.
31
+ *
32
+ * 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.
33
+ *
34
+ * Clients should be ready for any number of "note" elements.
35
+ *
36
+ * If there are zero notes for a request then the "notes" tag will be still included as an empty array.
37
+ *
38
+ * Newer time off requests may also include details for each day of the request in a element.
39
+ * @see https://documentation.bamboohr.com/reference#time-off-get-time-off-requests-1
40
+ */
41
+ timeOffRequests(options) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const endpoint = Endpoints_1.Endpoint.TimeOff.timeOffRequests();
44
+ const { data } = yield this.apiClient.get(endpoint, { params: options });
45
+ return data;
46
+ });
47
+ }
48
+ /**
49
+ * This endpoint gets a list of time off types.
50
+ * @param mode set to 'request' to get a list of all time off types with which this user can create a time off
51
+ * request. The default is to return the list of time off types the user has permissions on. This distinction is
52
+ * important, as employees can request time off for types that they don't have permission to view balances and
53
+ * requests for.
54
+ * @see https://documentation.bamboohr.com/reference#get-time-off-types
55
+ */
56
+ timeOffTypes(mode) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ const endpoint = Endpoints_1.Endpoint.TimeOff.timeOffTypes();
59
+ const { data } = yield this.apiClient.get(endpoint, { params: { mode } });
60
+ return data;
61
+ });
62
+ }
63
+ /**
64
+ * This endpoint will return a list, sorted by date, of employees who will be out, and company holidays, for a period of time.
65
+ * @see https://documentation.bamboohr.com/reference#get-a-list-of-whos-out-1
66
+ */
67
+ whosOut(start, end) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ const endpoint = Endpoints_1.Endpoint.TimeOff.whosOut();
70
+ const { data } = yield this.apiClient.get(endpoint, { params: { end, start } });
71
+ return data;
72
+ });
73
+ }
74
+ }
75
+ exports.TimeOffAPI = TimeOffAPI;
@@ -0,0 +1,2 @@
1
+ export * from './EmployeesAPI';
2
+ export * from './TimeOffAPI';
@@ -0,0 +1,18 @@
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("./EmployeesAPI"), exports);
18
+ __exportStar(require("./TimeOffAPI"), exports);
@@ -0,0 +1,3 @@
1
+ export * from './api/';
2
+ export * from './BambooHR';
3
+ export * from './interfaces/';
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
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("./api/"), exports);
18
+ __exportStar(require("./BambooHR"), exports);
19
+ __exportStar(require("./interfaces/"), exports);
@@ -0,0 +1,5 @@
1
+ import type { EmployeesAPI, TimeOffAPI } from '../api/';
2
+ export interface API {
3
+ employees: EmployeesAPI;
4
+ timeOff: TimeOffAPI;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export interface ClientOptions {
2
+ apiKey: string;
3
+ /** The subdomain used to access your account (If you access BambooHR at https://mycompany.bamboohr.com, then the subdomain is "mycompany") */
4
+ companyDomain: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface DefaultHour {
2
+ amount: string;
3
+ name: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,26 @@
1
+ import { Fields } from './Fields';
2
+ export interface BaseEmployee {
3
+ firstName: string;
4
+ id: string;
5
+ lastName: string;
6
+ }
7
+ export type Employee = BaseEmployee & PartialNull<Fields>;
8
+ export interface EmployeeDirectory {
9
+ employees: Employee[];
10
+ fields: {
11
+ id: keyof Fields;
12
+ name: string;
13
+ type: string;
14
+ };
15
+ }
16
+ export interface OffEmployee {
17
+ employeeId: number;
18
+ end: string;
19
+ id: number;
20
+ name: string;
21
+ start: string;
22
+ type: string;
23
+ }
24
+ export type PartialNull<T> = {
25
+ [P in keyof T]?: null | T[P];
26
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,270 @@
1
+ /**
2
+ * "yes" or "checkbox" will mark the checkbox checked and everything else will default to unchecked
3
+ *
4
+ * Example: "yes", "checkbox", "no"
5
+ */
6
+ export type CheckboxField = 'checkbox' | 'no' | 'yes';
7
+ /**
8
+ * The name of the country. Must exist in the BambooHR country list.
9
+ *
10
+ * Example: "Australia", "United States", etc.
11
+ */
12
+ export type CountryField = string;
13
+ /**
14
+ * A simple quantity value without thousands separators or currency signs using a period as a decimal point.
15
+ * Example: "27000.00"
16
+ *
17
+ * To add a currency code that is different from the company default, specify the code using the currency tag.
18
+ *
19
+ * Example: `“payRate”: { “value”: “27000.00”, “currency”: “EUR”}`
20
+ */
21
+ export type CurrencyField = {
22
+ currency: string;
23
+ value: string;
24
+ } | string;
25
+ /**
26
+ * A complete date with a four-digit year.
27
+ *
28
+ * Format: yyyy-mm-dd
29
+ *
30
+ * Example: "2010-03-19"
31
+ */
32
+ export type DateField = string;
33
+ /**
34
+ * An email address.
35
+ *
36
+ * Example: "support@bamboohr.com"
37
+ */
38
+ export type EmailField = string;
39
+ /**
40
+ * A reference to another employee expressed as preferred name-space-last name.
41
+ *
42
+ * Example: "Robert Smith"
43
+ */
44
+ export type EmployeeField = string;
45
+ export interface Fields {
46
+ /** @deprecated please use ‘acaStatusCategory’ */
47
+ acaStatus: string;
48
+ /** The employee's ACA (Affordable Care Act) status. This field can not be updated directly but is calculated based on mappings for employment statuses found on the employmentStatus table. Options are: contractor, full-time, intern-eligible, intern-ineligible, part-time-eligible, part-time-ineligible, and seasonal. */
49
+ acaStatusCategory: string;
50
+ /** The employee's first address line. */
51
+ address1: string;
52
+ /** The employee's second address line. */
53
+ address2: string;
54
+ /** The employee's age. To change age, update dateOfBirth field. */
55
+ age: number;
56
+ /** The employee's work email if set, otherwise their home email. */
57
+ bestEmail: EmailField;
58
+ /** The employee's month and day of birth. To change birthday, update dateOfBirth field. */
59
+ birthday: string;
60
+ /** The amount of the most recent bonus. */
61
+ bonusAmount: CurrencyField;
62
+ /** Comment about the most recent bonus. */
63
+ bonusComment: string;
64
+ /** The date of the last bonus. */
65
+ bonusDate: DateField;
66
+ /** The reason for the most recent bonus. */
67
+ bonusReason: ListField;
68
+ /** The employee's city. */
69
+ city: string;
70
+ /** This field name contains a typo, and exists for backwards compatibility. */
71
+ commisionDate: DateField;
72
+ /** The amount of the most recent commission. */
73
+ commissionAmount: CurrencyField;
74
+ /** Comment about the most recent commission. */
75
+ commissionComment: string;
76
+ /** The date of the last commission. */
77
+ commissionDate: DateField;
78
+ /** The employee's country. */
79
+ country: CountryField;
80
+ /** The id of the user who created the employee. Read only. May be null if employee was created before the release of this field. */
81
+ readonly createdByUserId: number;
82
+ /** The date the employee was born. */
83
+ dateOfBirth: DateField;
84
+ /** The employee's **current* department. */
85
+ department: ListField;
86
+ /** The employee's name displayed in a format configured by the user. Read only. */
87
+ readonly displayName: string;
88
+ /** The employee's **current* division. */
89
+ division: ListField;
90
+ /** The employee's EEO job category. These are defined by the U.S. Equal Employment Opportunity Commission. */
91
+ eeo: ListField;
92
+ /** Employee number (assigned by your company). */
93
+ employeeNumber: string;
94
+ /** The employee's **current* employment status. Options are customized by account. Read-only starting with version 1.1; update using the `employmentStatus` table. */
95
+ readonly employmentHistoryStatus: ListField;
96
+ /** The employee's ethnicity. */
97
+ ethnicity: ListField;
98
+ /** The FLSA Overtime Status (Exempt or Non-exempt). */
99
+ exempt: ListField;
100
+ /** The employee's first name. */
101
+ firstName: string;
102
+ /** Deprecated please use 'exempt' */
103
+ flsaCode: ListField;
104
+ /** The employee's first and last name. (e.g., John Doe). Read only. */
105
+ readonly fullName1: string;
106
+ /** The employee's last and first name. (e.g., Doe, John). Read only. */
107
+ readonly fullName2: string;
108
+ /** The employee's full name and their preferred name. (e.g., Doe, John Quentin (JDog)). Read only. */
109
+ readonly fullName3: string;
110
+ /** The employee's full name without their preferred name, last name first. (e.g., Doe, John Quentin). Read only. */
111
+ readonly fullName4: string;
112
+ /** The employee's full name without their preferred name, first name first. (e.g., John Quentin Doe). Read only. */
113
+ readonly fullName5: string;
114
+ /** The employee's gender (Male or Female). */
115
+ gender: GenderField;
116
+ /** The date the employee was hired. */
117
+ hireDate: DateField;
118
+ /** The employee's home email address. */
119
+ homeEmail: EmailField;
120
+ /** The employee's home phone number. */
121
+ homePhone: PhoneField;
122
+ /** The employee ID automatically assigned by BambooHR. Read only. */
123
+ readonly id: number;
124
+ /** Should employee be included in payroll (Yes or No) */
125
+ includeInPayroll: boolean;
126
+ /** Whether a photo has been uploaded for the employee. Read only. */
127
+ readonly isPhotoUploaded: boolean;
128
+ /** The **current** value of the employee's job title, updating this field will create a new row in position history. */
129
+ jobTitle: ListField;
130
+ /** The date and time that the employee record was last changed. */
131
+ lastChanged: TimestampField;
132
+ /** The employee's last name. */
133
+ lastName: string;
134
+ /** The employee's **current** location. */
135
+ location: ListField;
136
+ /** The employee's marital status (Single, Married, or Domestic Partnership). */
137
+ maritalStatus: ListField;
138
+ /** The employee's middle name. */
139
+ middleName: string;
140
+ /** The employee's mobile phone number. */
141
+ mobilePhone: PhoneField;
142
+ /** The employee's National ID number */
143
+ nationalId: string;
144
+ /** The employee's nationality */
145
+ nationality: ListField;
146
+ /** The employee's NIN number */
147
+ nin: string;
148
+ /** The date the employee was originally hired. Available starting with version 1.1. */
149
+ originalHireDate: DateField;
150
+ /** The employee's **current** pay per. ie: "Hour", "Day", "Week", "Month", "Quarter", "Year". */
151
+ paidPer: string;
152
+ /** The reason for the employee's last pay rate change. */
153
+ payChangeReason: ListField;
154
+ /** The employee's **current** pay frequency. ie: "Weekly", "Every other week", "Twice a month", "Monthly", "Quarterly", "Twice a year", or "Yearly" */
155
+ payFrequency: ListField;
156
+ /** The custom pay group that the employee belongs to. */
157
+ payGroup: ListField;
158
+ /** The ID value corresponding to the pay group that an employee belongs to. */
159
+ payGroupId: number;
160
+ /** The employee's **current** pay rate (e.g., $8.25). */
161
+ payRate: CurrencyField;
162
+ /** The day the most recent change was made. */
163
+ payRateEffectiveDate: DateField;
164
+ /** The employee's **current** pay schedule. */
165
+ paySchedule: ListField;
166
+ /** The ID value corresponding to the pay schedule that an employee belongs to. */
167
+ payScheduleId: number;
168
+ /** The employee's **current** pay type. ie: "hourly","salary","commission","exception hourly","monthly","weekly","piece rate","contract","daily","pro rata". */
169
+ payType: PayTypeField;
170
+ /** The employee's preferred name. */
171
+ preferredName: string;
172
+ /** The employee's Canadian Social Insurance Number. */
173
+ sin: string;
174
+ /** The employee's Social Security number. */
175
+ ssn: SSNField;
176
+ /** The number of hours the employee works in a standard week. */
177
+ standardHoursPerWeek: number;
178
+ /** The employee's state/province. */
179
+ state: StateField;
180
+ /** The 2 character abbreviation for the employee's state (US only). Read only. */
181
+ readonly stateCode: string;
182
+ /** The employee's employee status (Active or Inactive). */
183
+ status: StatusField;
184
+ /** The employee’s **current** supervisor. Read only. */
185
+ readonly supervisor: EmployeeField;
186
+ /** The ID of the employee's **current** supervisor. Read only. */
187
+ readonly supervisorEId: number;
188
+ /** The email of the employee's **current** supervisor. Read only. */
189
+ readonly supervisorEmail: string;
190
+ /** The 'employeeNumber' of the employee's **current** supervisor. Read only. */
191
+ readonly supervisorId: number;
192
+ /** The date the employee was terminated. Read-only starting with version 1.1; update using the employmentStatus table. */
193
+ readonly terminationDate: DateField;
194
+ /** Should time tracking be enabled for the employee (Yes or No) */
195
+ timeTrackingEnabled: boolean;
196
+ /** The employee's work email address. */
197
+ workEmail: EmailField;
198
+ /** The employee's work phone number, without extension. */
199
+ workPhone: PhoneField;
200
+ /** The employee's work phone extension (if any). */
201
+ workPhoneExtension: string;
202
+ /** The employee's work phone and extension. Read only */
203
+ readonly workPhonePlusExtension: string;
204
+ /** The employee's ZIP code. */
205
+ zipcode: string;
206
+ }
207
+ /**
208
+ * The plain text name of the gender.
209
+ *
210
+ * Example: "Male" or "Female"
211
+ */
212
+ export type GenderField = string;
213
+ /**
214
+ * The exact text for an option from a list.
215
+ *
216
+ * Example: "Marketing"
217
+ */
218
+ export type ListField = string;
219
+ /**
220
+ * Plain text status of marriage.
221
+ *
222
+ * Example: "Single" or "Married"
223
+ */
224
+ export type MaritalStatusField = string;
225
+ /**
226
+ * One of several predefined options for the unit of pay.
227
+ *
228
+ * Example: "Hourly", "Salary", "Commission", "Exception Hourly", "Monthly", "Piece Rate", "Contract" or "Daily"
229
+ */
230
+ export type PayTypeField = string;
231
+ /**
232
+ * A plain text string with a phone number, no formatting is enforced.
233
+ *
234
+ * Example: "1-866-387-9595"
235
+ */
236
+ export type PhoneField = string;
237
+ /**
238
+ * A standard United States Social Security number, with dashes.
239
+ *
240
+ * Example: "123-45-6789"
241
+ */
242
+ export type SSNField = string;
243
+ /**
244
+ * The full name of the state/province.
245
+ *
246
+ * Example: "Florida"
247
+ */
248
+ export type StateField = string;
249
+ /**
250
+ * The employee's employment status as used to filter employees in BambooHR.
251
+ *
252
+ * Example: "Active" or "Inactive"
253
+ */
254
+ export type StatusField = 'Active' | 'Inactive';
255
+ /**
256
+ * A larger section of text that can include line feed characters.
257
+ */
258
+ export type TextareaField = string;
259
+ /**
260
+ * The UTC time that an event occurred.
261
+ *
262
+ * Format: ####-##-##T##:##:##+##:##
263
+ *
264
+ * Example: "2012-10-17T20:27:17+00:00"
265
+ */
266
+ export type TimestampField = string;
267
+ export type WritableFields = Partial<Writeable<Fields>>;
268
+ export type Writeable<T> = {
269
+ -readonly [P in keyof T]: T[P];
270
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export interface TimeOffPolicy {
2
+ effectiveDate: string;
3
+ id: number;
4
+ name: string;
5
+ timeOffTypeId: number;
6
+ type: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,32 @@
1
+ import { TimeOffType } from './TimeOffType';
2
+ export interface TimeOffRequest {
3
+ actions: TimeOffRequestActions;
4
+ amount: TimeOffRequestAmount;
5
+ created: string;
6
+ dates: Record<string, string>;
7
+ employeeId: string;
8
+ end: string;
9
+ id: string;
10
+ name: string;
11
+ notes: [];
12
+ start: string;
13
+ status: TimeOffRequestStatus;
14
+ type: TimeOffType;
15
+ }
16
+ export interface TimeOffRequestActions {
17
+ approve: boolean;
18
+ bypass: boolean;
19
+ cancel: boolean;
20
+ deny: boolean;
21
+ edit: boolean;
22
+ view: boolean;
23
+ }
24
+ export interface TimeOffRequestAmount {
25
+ amount: string;
26
+ unit: string;
27
+ }
28
+ export interface TimeOffRequestStatus {
29
+ lastChanged: string;
30
+ lastChangedByUserId: string;
31
+ status: string;
32
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export interface TimeOffType {
2
+ color: null | string;
3
+ icon: string;
4
+ id: string;
5
+ name: string;
6
+ units: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { DefaultHour, TimeOffType } from './';
2
+ export interface TimeOffTypes {
3
+ defaultHours: DefaultHour[];
4
+ timeOffTypes: TimeOffType[];
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ export * from './API';
2
+ export * from './ClientOptions';
3
+ export * from './DefaultHour';
4
+ export * from './Employee';
5
+ export * from './Fields';
6
+ export * from './TimeOffPolicy';
7
+ export * from './TimeOffRequest';
8
+ export * from './TimeOffRequestsOptions';
9
+ export * from './TimeOffType';
10
+ export * from './TimeOffTypes';
@@ -0,0 +1,26 @@
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("./API"), exports);
18
+ __exportStar(require("./ClientOptions"), exports);
19
+ __exportStar(require("./DefaultHour"), exports);
20
+ __exportStar(require("./Employee"), exports);
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);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Florian Imdahl <git@ffflorian.de>",
3
3
  "dependencies": {
4
- "@ffflorian/api-client": "2.5.0",
4
+ "@ffflorian/api-client": "2.5.1",
5
5
  "@hapi/hawk": "8.0.0"
6
6
  },
7
7
  "description": "An bamboohr.com API client",
@@ -30,11 +30,12 @@
30
30
  "readme": "https://github.com/ffflorian/api-clients#readme",
31
31
  "repository": "https://github.com/ffflorian/api-clients.git",
32
32
  "scripts": {
33
+ "build": "yarn build:ts",
33
34
  "build:ts": "tsc -p tsconfig.build.json",
34
35
  "build:docs": "typedoc --tsconfig tsconfig.build.json --options ../../typedoc.json --out ../../docs/packages/bamboohr.com src/index.ts",
35
36
  "clean": "rimraf dist",
36
- "dist": "yarn clean && yarn build:ts",
37
+ "dist": "yarn clean && yarn build",
37
38
  "test": "exit 0"
38
39
  },
39
- "version": "1.5.6"
40
+ "version": "1.5.7"
40
41
  }