bamboohr-cli 0.0.1
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/dist/commands/employee/directory.d.ts +3 -0
- package/dist/commands/employee/directory.d.ts.map +1 -0
- package/dist/commands/employee/directory.js +19 -0
- package/dist/commands/employee/directory.js.map +1 -0
- package/dist/commands/employee/get.d.ts +3 -0
- package/dist/commands/employee/get.d.ts.map +1 -0
- package/dist/commands/employee/get.js +30 -0
- package/dist/commands/employee/get.js.map +1 -0
- package/dist/commands/employee/goals.d.ts +3 -0
- package/dist/commands/employee/goals.d.ts.map +1 -0
- package/dist/commands/employee/goals.js +27 -0
- package/dist/commands/employee/goals.js.map +1 -0
- package/dist/commands/employee/index.d.ts +3 -0
- package/dist/commands/employee/index.d.ts.map +1 -0
- package/dist/commands/employee/index.js +22 -0
- package/dist/commands/employee/index.js.map +1 -0
- package/dist/commands/employee/photo.d.ts +3 -0
- package/dist/commands/employee/photo.d.ts.map +1 -0
- package/dist/commands/employee/photo.js +32 -0
- package/dist/commands/employee/photo.js.map +1 -0
- package/dist/commands/file/get.d.ts +3 -0
- package/dist/commands/file/get.d.ts.map +1 -0
- package/dist/commands/file/get.js +24 -0
- package/dist/commands/file/get.js.map +1 -0
- package/dist/commands/file/index.d.ts +3 -0
- package/dist/commands/file/index.d.ts.map +1 -0
- package/dist/commands/file/index.js +15 -0
- package/dist/commands/file/index.js.map +1 -0
- package/dist/commands/file/list.d.ts +3 -0
- package/dist/commands/file/list.d.ts.map +1 -0
- package/dist/commands/file/list.js +19 -0
- package/dist/commands/file/list.js.map +1 -0
- package/dist/commands/meta/fields.d.ts +3 -0
- package/dist/commands/meta/fields.d.ts.map +1 -0
- package/dist/commands/meta/fields.js +19 -0
- package/dist/commands/meta/fields.js.map +1 -0
- package/dist/commands/meta/index.d.ts +3 -0
- package/dist/commands/meta/index.d.ts.map +1 -0
- package/dist/commands/meta/index.js +12 -0
- package/dist/commands/meta/index.js.map +1 -0
- package/dist/commands/timeoff/balance.d.ts +3 -0
- package/dist/commands/timeoff/balance.d.ts.map +1 -0
- package/dist/commands/timeoff/balance.js +26 -0
- package/dist/commands/timeoff/balance.js.map +1 -0
- package/dist/commands/timeoff/index.d.ts +3 -0
- package/dist/commands/timeoff/index.d.ts.map +1 -0
- package/dist/commands/timeoff/index.js +18 -0
- package/dist/commands/timeoff/index.js.map +1 -0
- package/dist/commands/timeoff/requests.d.ts +3 -0
- package/dist/commands/timeoff/requests.d.ts.map +1 -0
- package/dist/commands/timeoff/requests.js +45 -0
- package/dist/commands/timeoff/requests.js.map +1 -0
- package/dist/commands/timeoff/whos-out.d.ts +3 -0
- package/dist/commands/timeoff/whos-out.d.ts.map +1 -0
- package/dist/commands/timeoff/whos-out.js +27 -0
- package/dist/commands/timeoff/whos-out.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/client.d.ts +3 -0
- package/dist/utils/client.d.ts.map +1 -0
- package/dist/utils/client.js +19 -0
- package/dist/utils/client.js.map +1 -0
- package/dist/utils/output.d.ts +3 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +25 -0
- package/dist/utils/output.js.map +1 -0
- package/dist/utils/strip-response.d.ts +6 -0
- package/dist/utils/strip-response.d.ts.map +1 -0
- package/dist/utils/strip-response.js +29 -0
- package/dist/utils/strip-response.js.map +1 -0
- package/package.json +38 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../../../src/commands/employee/directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,QAcxC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getClient } from '../../utils/client.js';
|
|
2
|
+
import { output, handleError } from '../../utils/output.js';
|
|
3
|
+
export function directory(parent) {
|
|
4
|
+
parent
|
|
5
|
+
.command('directory')
|
|
6
|
+
.description('Get the company employee directory')
|
|
7
|
+
.addHelpText('after', '\nExamples:\n $ bamboohr employee directory')
|
|
8
|
+
.action(async () => {
|
|
9
|
+
try {
|
|
10
|
+
const client = getClient();
|
|
11
|
+
const result = await client.employees.getDirectory();
|
|
12
|
+
output(result);
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
handleError(err);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=directory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directory.js","sourceRoot":"","sources":["../../../src/commands/employee/directory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,SAAS,CAAC,MAAe;IACvC,MAAM;SACH,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,oCAAoC,CAAC;SACjD,WAAW,CAAC,OAAO,EAAE,8CAA8C,CAAC;SACpE,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;YACrD,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/commands/employee/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,QA4BlC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { getClient } from '../../utils/client.js';
|
|
2
|
+
import { output, handleError } from '../../utils/output.js';
|
|
3
|
+
export function get(parent) {
|
|
4
|
+
parent
|
|
5
|
+
.command('get [id]')
|
|
6
|
+
.description('Get employee data by ID (default: current user)')
|
|
7
|
+
.option('--fields <fields>', 'Comma-separated field names', 'firstName,lastName,email,jobTitle')
|
|
8
|
+
.option('--include-future', 'Include future-dated values from history fields')
|
|
9
|
+
.addHelpText('after', `
|
|
10
|
+
Examples:
|
|
11
|
+
$ bamboohr employee get
|
|
12
|
+
$ bamboohr employee get 123
|
|
13
|
+
$ bamboohr employee get 123 --fields "firstName,lastName,department,hireDate"
|
|
14
|
+
$ bamboohr employee get 123 --include-future`)
|
|
15
|
+
.action(async (id, opts) => {
|
|
16
|
+
try {
|
|
17
|
+
const client = getClient();
|
|
18
|
+
const result = await client.employees.get({
|
|
19
|
+
id: id ?? '0',
|
|
20
|
+
fields: opts.fields,
|
|
21
|
+
onlyCurrent: !opts.includeFuture,
|
|
22
|
+
});
|
|
23
|
+
output(result);
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
handleError(err);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/employee/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,GAAG,CAAC,MAAe;IACjC,MAAM;SACH,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,iDAAiD,CAAC;SAC9D,MAAM,CAAC,mBAAmB,EAAE,6BAA6B,EAAE,mCAAmC,CAAC;SAC/F,MAAM,CAAC,kBAAkB,EAAE,iDAAiD,CAAC;SAC7E,WAAW,CACV,OAAO,EACP;;;;;+CAKyC,CAC1C;SACA,MAAM,CAAC,KAAK,EAAE,EAAsB,EAAE,IAAiD,EAAE,EAAE;QAC1F,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC;gBACxC,EAAE,EAAE,EAAE,IAAI,GAAG;gBACb,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,WAAW,EAAE,CAAC,IAAI,CAAC,aAAa;aACjC,CAAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goals.d.ts","sourceRoot":"","sources":["../../../src/commands/employee/goals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,wBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,QA0BpC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Option } from 'commander';
|
|
2
|
+
import { getClient } from '../../utils/client.js';
|
|
3
|
+
import { output, handleError } from '../../utils/output.js';
|
|
4
|
+
export function goals(parent) {
|
|
5
|
+
parent
|
|
6
|
+
.command('goals <id>')
|
|
7
|
+
.description('Get employee performance goals')
|
|
8
|
+
.addOption(new Option('--filter <filter>', 'Filter goals by status').choices(['open', 'closed', 'all']).default('all'))
|
|
9
|
+
.addHelpText('after', `
|
|
10
|
+
Examples:
|
|
11
|
+
$ bamboohr employee goals 123
|
|
12
|
+
$ bamboohr employee goals 123 --filter open`)
|
|
13
|
+
.action(async (id, opts) => {
|
|
14
|
+
try {
|
|
15
|
+
const client = getClient();
|
|
16
|
+
const result = await client.goals.get({
|
|
17
|
+
employeeId: id,
|
|
18
|
+
filter: opts.filter === 'all' ? undefined : opts.filter,
|
|
19
|
+
});
|
|
20
|
+
output(result);
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
handleError(err);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=goals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goals.js","sourceRoot":"","sources":["../../../src/commands/employee/goals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,KAAK,CAAC,MAAe;IACnC,MAAM;SACH,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,gCAAgC,CAAC;SAC7C,SAAS,CACR,IAAI,MAAM,CAAC,mBAAmB,EAAE,wBAAwB,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAC5G;SACA,WAAW,CACV,OAAO,EACP;;;8CAGwC,CACzC;SACA,MAAM,CAAC,KAAK,EAAE,EAAU,EAAE,IAAwB,EAAE,EAAE;QACrD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;gBACpC,UAAU,EAAE,EAAE;gBACd,MAAM,EAAE,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,IAAI,CAAC,MAA4B;aAC/E,CAAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/employee/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,QAmBxD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { directory } from './directory.js';
|
|
2
|
+
import { get } from './get.js';
|
|
3
|
+
import { goals } from './goals.js';
|
|
4
|
+
import { photo } from './photo.js';
|
|
5
|
+
export function registerEmployeeCommands(program) {
|
|
6
|
+
const employee = program
|
|
7
|
+
.command('employee')
|
|
8
|
+
.description('Employee operations')
|
|
9
|
+
.addHelpText('after', `
|
|
10
|
+
Examples:
|
|
11
|
+
$ bamboohr employee get
|
|
12
|
+
$ bamboohr employee get 123 --fields "firstName,lastName,department"
|
|
13
|
+
$ bamboohr employee directory
|
|
14
|
+
$ bamboohr employee photo 123 --output ./photo.jpg
|
|
15
|
+
$ bamboohr employee goals 123 --filter open
|
|
16
|
+
`);
|
|
17
|
+
get(employee);
|
|
18
|
+
directory(employee);
|
|
19
|
+
photo(employee);
|
|
20
|
+
goals(employee);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/employee/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACvD,MAAM,QAAQ,GAAG,OAAO;SACrB,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,qBAAqB,CAAC;SAClC,WAAW,CACV,OAAO,EACP;;;;;;;CAOL,CACI,CAAC;IACJ,GAAG,CAAC,QAAQ,CAAC,CAAC;IACd,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpB,KAAK,CAAC,QAAQ,CAAC,CAAC;IAChB,KAAK,CAAC,QAAQ,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"photo.d.ts","sourceRoot":"","sources":["../../../src/commands/employee/photo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,wBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,QA8BpC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { writeFileSync } from 'node:fs';
|
|
2
|
+
import { Option } from 'commander';
|
|
3
|
+
import { getClient } from '../../utils/client.js';
|
|
4
|
+
import { output, handleError } from '../../utils/output.js';
|
|
5
|
+
export function photo(parent) {
|
|
6
|
+
parent
|
|
7
|
+
.command('photo <id>')
|
|
8
|
+
.description('Download employee photo')
|
|
9
|
+
.requiredOption('--output <path>', 'File path to save photo')
|
|
10
|
+
.addOption(new Option('--size <size>', 'Photo size')
|
|
11
|
+
.choices(['original', 'large', 'medium', 'small', 'xs', 'tiny'])
|
|
12
|
+
.default('medium'))
|
|
13
|
+
.addHelpText('after', `
|
|
14
|
+
Examples:
|
|
15
|
+
$ bamboohr employee photo 123 --output ./photo.jpg
|
|
16
|
+
$ bamboohr employee photo 123 --output ./photo.jpg --size large`)
|
|
17
|
+
.action(async (id, opts) => {
|
|
18
|
+
try {
|
|
19
|
+
const client = getClient();
|
|
20
|
+
const buffer = await client.employees.getPhoto({
|
|
21
|
+
employeeId: id,
|
|
22
|
+
size: opts.size,
|
|
23
|
+
});
|
|
24
|
+
writeFileSync(opts.output, buffer);
|
|
25
|
+
output({ saved: true, path: opts.output, size: buffer.length });
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
handleError(err);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=photo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"photo.js","sourceRoot":"","sources":["../../../src/commands/employee/photo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,KAAK,CAAC,MAAe;IACnC,MAAM;SACH,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,yBAAyB,CAAC;SACtC,cAAc,CAAC,iBAAiB,EAAE,yBAAyB,CAAC;SAC5D,SAAS,CACR,IAAI,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC;SACtC,OAAO,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;SAC/D,OAAO,CAAC,QAAQ,CAAC,CACrB;SACA,WAAW,CACV,OAAO,EACP;;;kEAG4D,CAC7D;SACA,MAAM,CAAC,KAAK,EAAE,EAAU,EAAE,IAAsC,EAAE,EAAE;QACnE,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;gBAC7C,UAAU,EAAE,EAAE;gBACd,IAAI,EAAE,IAAI,CAAC,IAAiE;aAC7E,CAAC,CAAC;YACH,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACnC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAClE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/commands/file/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,QAqBlC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { writeFileSync } from 'node:fs';
|
|
2
|
+
import { getClient } from '../../utils/client.js';
|
|
3
|
+
import { output, handleError } from '../../utils/output.js';
|
|
4
|
+
export function get(parent) {
|
|
5
|
+
parent
|
|
6
|
+
.command('get <fileId>')
|
|
7
|
+
.description('Download a company file')
|
|
8
|
+
.requiredOption('--output <path>', 'File path to save to')
|
|
9
|
+
.addHelpText('after', `
|
|
10
|
+
Examples:
|
|
11
|
+
$ bamboohr file get 42 --output ./handbook.pdf`)
|
|
12
|
+
.action(async (fileId, opts) => {
|
|
13
|
+
try {
|
|
14
|
+
const client = getClient();
|
|
15
|
+
const buffer = await client.files.get({ fileId });
|
|
16
|
+
writeFileSync(opts.output, buffer);
|
|
17
|
+
output({ saved: true, path: opts.output, size: buffer.length });
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
handleError(err);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/file/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,GAAG,CAAC,MAAe;IACjC,MAAM;SACH,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,yBAAyB,CAAC;SACtC,cAAc,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;SACzD,WAAW,CACV,OAAO,EACP;;iDAE2C,CAC5C;SACA,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,IAAwB,EAAE,EAAE;QACzD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;YAClD,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACnC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAClE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/file/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAcpD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { get } from './get.js';
|
|
2
|
+
import { list } from './list.js';
|
|
3
|
+
export function registerFileCommands(program) {
|
|
4
|
+
const file = program
|
|
5
|
+
.command('file')
|
|
6
|
+
.description('Company file operations')
|
|
7
|
+
.addHelpText('after', `
|
|
8
|
+
Examples:
|
|
9
|
+
$ bamboohr file list
|
|
10
|
+
$ bamboohr file get 42 --output ./handbook.pdf
|
|
11
|
+
`);
|
|
12
|
+
list(file);
|
|
13
|
+
get(file);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/file/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO;SACjB,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,yBAAyB,CAAC;SACtC,WAAW,CACV,OAAO,EACP;;;;CAIL,CACI,CAAC;IACJ,IAAI,CAAC,IAAI,CAAC,CAAC;IACX,GAAG,CAAC,IAAI,CAAC,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/file/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,QAcnC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getClient } from '../../utils/client.js';
|
|
2
|
+
import { output, handleError } from '../../utils/output.js';
|
|
3
|
+
export function list(parent) {
|
|
4
|
+
parent
|
|
5
|
+
.command('list')
|
|
6
|
+
.description('List all company files and categories')
|
|
7
|
+
.addHelpText('after', '\nExamples:\n $ bamboohr file list')
|
|
8
|
+
.action(async () => {
|
|
9
|
+
try {
|
|
10
|
+
const client = getClient();
|
|
11
|
+
const result = await client.files.list();
|
|
12
|
+
output(result);
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
handleError(err);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/file/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,IAAI,CAAC,MAAe;IAClC,MAAM;SACH,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,uCAAuC,CAAC;SACpD,WAAW,CAAC,OAAO,EAAE,qCAAqC,CAAC;SAC3D,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YACzC,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../../src/commands/meta/fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,QAcrC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getClient } from '../../utils/client.js';
|
|
2
|
+
import { output, handleError } from '../../utils/output.js';
|
|
3
|
+
export function fields(parent) {
|
|
4
|
+
parent
|
|
5
|
+
.command('fields')
|
|
6
|
+
.description('List all available BambooHR fields')
|
|
7
|
+
.addHelpText('after', '\nExamples:\n $ bamboohr meta fields')
|
|
8
|
+
.action(async () => {
|
|
9
|
+
try {
|
|
10
|
+
const client = getClient();
|
|
11
|
+
const result = await client.meta.getFields();
|
|
12
|
+
output(result);
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
handleError(err);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../src/commands/meta/fields.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,oCAAoC,CAAC;SACjD,WAAW,CAAC,OAAO,EAAE,uCAAuC,CAAC;SAC7D,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YAC7C,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/meta/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAYpD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { fields } from './fields.js';
|
|
2
|
+
export function registerMetaCommands(program) {
|
|
3
|
+
const meta = program
|
|
4
|
+
.command('meta')
|
|
5
|
+
.description('Metadata operations')
|
|
6
|
+
.addHelpText('after', `
|
|
7
|
+
Examples:
|
|
8
|
+
$ bamboohr meta fields
|
|
9
|
+
`);
|
|
10
|
+
fields(meta);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/meta/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO;SACjB,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,qBAAqB,CAAC;SAClC,WAAW,CACV,OAAO,EACP;;;CAGL,CACI,CAAC;IACJ,MAAM,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../../src/commands/timeoff/balance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,QAwBtC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getClient } from '../../utils/client.js';
|
|
2
|
+
import { output, handleError } from '../../utils/output.js';
|
|
3
|
+
export function balance(parent) {
|
|
4
|
+
parent
|
|
5
|
+
.command('balance <employeeId>')
|
|
6
|
+
.description('Estimate time off balance for an employee')
|
|
7
|
+
.option('--date <date>', 'Future date to estimate balance for (YYYY-MM-DD)')
|
|
8
|
+
.addHelpText('after', `
|
|
9
|
+
Examples:
|
|
10
|
+
$ bamboohr timeoff balance 123
|
|
11
|
+
$ bamboohr timeoff balance 123 --date 2026-06-30`)
|
|
12
|
+
.action(async (employeeId, opts) => {
|
|
13
|
+
try {
|
|
14
|
+
const client = getClient();
|
|
15
|
+
const result = await client.timeOff.getBalance({
|
|
16
|
+
employeeId,
|
|
17
|
+
date: opts.date,
|
|
18
|
+
});
|
|
19
|
+
output(result);
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
handleError(err);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=balance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balance.js","sourceRoot":"","sources":["../../../src/commands/timeoff/balance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,OAAO,CAAC,MAAe;IACrC,MAAM;SACH,OAAO,CAAC,sBAAsB,CAAC;SAC/B,WAAW,CAAC,2CAA2C,CAAC;SACxD,MAAM,CAAC,eAAe,EAAE,kDAAkD,CAAC;SAC3E,WAAW,CACV,OAAO,EACP;;;mDAG6C,CAC9C;SACA,MAAM,CAAC,KAAK,EAAE,UAAkB,EAAE,IAAuB,EAAE,EAAE;QAC5D,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;gBAC7C,UAAU;gBACV,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/timeoff/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,QAgBvD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { balance } from './balance.js';
|
|
2
|
+
import { requests } from './requests.js';
|
|
3
|
+
import { whosOut } from './whos-out.js';
|
|
4
|
+
export function registerTimeoffCommands(program) {
|
|
5
|
+
const timeoff = program
|
|
6
|
+
.command('timeoff')
|
|
7
|
+
.description('Time off operations')
|
|
8
|
+
.addHelpText('after', `
|
|
9
|
+
Examples:
|
|
10
|
+
$ bamboohr timeoff requests --status requested
|
|
11
|
+
$ bamboohr timeoff balance 123
|
|
12
|
+
$ bamboohr timeoff whos-out
|
|
13
|
+
`);
|
|
14
|
+
requests(timeoff);
|
|
15
|
+
balance(timeoff);
|
|
16
|
+
whosOut(timeoff);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/timeoff/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,qBAAqB,CAAC;SAClC,WAAW,CACV,OAAO,EACP;;;;;CAKL,CACI,CAAC;IACJ,QAAQ,CAAC,OAAO,CAAC,CAAC;IAClB,OAAO,CAAC,OAAO,CAAC,CAAC;IACjB,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../src/commands/timeoff/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,QAsDvC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Option } from 'commander';
|
|
2
|
+
import { getClient } from '../../utils/client.js';
|
|
3
|
+
import { output, handleError } from '../../utils/output.js';
|
|
4
|
+
export function requests(parent) {
|
|
5
|
+
parent
|
|
6
|
+
.command('requests')
|
|
7
|
+
.description('Get time off requests with filtering')
|
|
8
|
+
.option('--id <id>', 'Specific request ID', parseInt)
|
|
9
|
+
.addOption(new Option('--action <action>', 'Access level filter').choices(['view', 'approve']))
|
|
10
|
+
.option('--employee <id>', 'Filter by employee ID')
|
|
11
|
+
.option('--start <date>', 'Start date (YYYY-MM-DD)')
|
|
12
|
+
.option('--end <date>', 'End date (YYYY-MM-DD)')
|
|
13
|
+
.addOption(new Option('--status <status>', 'Filter by request status').choices([
|
|
14
|
+
'approved',
|
|
15
|
+
'denied',
|
|
16
|
+
'superceded',
|
|
17
|
+
'requested',
|
|
18
|
+
'canceled',
|
|
19
|
+
]))
|
|
20
|
+
.option('--type <typeId>', 'Filter by time off type ID')
|
|
21
|
+
.addHelpText('after', `
|
|
22
|
+
Examples:
|
|
23
|
+
$ bamboohr timeoff requests
|
|
24
|
+
$ bamboohr timeoff requests --status requested --action approve
|
|
25
|
+
$ bamboohr timeoff requests --employee 123 --start 2026-01-01 --end 2026-03-31`)
|
|
26
|
+
.action(async (opts) => {
|
|
27
|
+
try {
|
|
28
|
+
const client = getClient();
|
|
29
|
+
const result = await client.timeOff.getRequests({
|
|
30
|
+
id: opts.id,
|
|
31
|
+
action: opts.action,
|
|
32
|
+
employeeId: opts.employee,
|
|
33
|
+
start: opts.start,
|
|
34
|
+
end: opts.end,
|
|
35
|
+
status: opts.status,
|
|
36
|
+
type: opts.type,
|
|
37
|
+
});
|
|
38
|
+
output(result);
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
handleError(err);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=requests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../src/commands/timeoff/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,QAAQ,CAAC,MAAe;IACtC,MAAM;SACH,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,sCAAsC,CAAC;SACnD,MAAM,CAAC,WAAW,EAAE,qBAAqB,EAAE,QAAQ,CAAC;SACpD,SAAS,CAAC,IAAI,MAAM,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;SAC9F,MAAM,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;SAClD,MAAM,CAAC,gBAAgB,EAAE,yBAAyB,CAAC;SACnD,MAAM,CAAC,cAAc,EAAE,uBAAuB,CAAC;SAC/C,SAAS,CACR,IAAI,MAAM,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC,OAAO,CAAC;QAClE,UAAU;QACV,QAAQ;QACR,YAAY;QACZ,WAAW;QACX,UAAU;KACX,CAAC,CACH;SACA,MAAM,CAAC,iBAAiB,EAAE,4BAA4B,CAAC;SACvD,WAAW,CACV,OAAO,EACP;;;;iFAI2E,CAC5E;SACA,MAAM,CACL,KAAK,EAAE,IAQN,EAAE,EAAE;QACH,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC;gBAC9C,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,MAAM,EAAE,IAAI,CAAC,MAAwC;gBACrD,UAAU,EAAE,IAAI,CAAC,QAAQ;gBACzB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,MAAM,EAAE,IAAI,CAAC,MAAqF;gBAClG,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CACF,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whos-out.d.ts","sourceRoot":"","sources":["../../../src/commands/timeoff/whos-out.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,QAyBtC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getClient } from '../../utils/client.js';
|
|
2
|
+
import { output, handleError } from '../../utils/output.js';
|
|
3
|
+
export function whosOut(parent) {
|
|
4
|
+
parent
|
|
5
|
+
.command('whos-out')
|
|
6
|
+
.description("View who's out — upcoming time off and holidays")
|
|
7
|
+
.option('--start <date>', 'Start date (YYYY-MM-DD, defaults to today)')
|
|
8
|
+
.option('--end <date>', 'End date (YYYY-MM-DD, defaults to 14 days from start)')
|
|
9
|
+
.addHelpText('after', `
|
|
10
|
+
Examples:
|
|
11
|
+
$ bamboohr timeoff whos-out
|
|
12
|
+
$ bamboohr timeoff whos-out --start 2026-03-20 --end 2026-04-03`)
|
|
13
|
+
.action(async (opts) => {
|
|
14
|
+
try {
|
|
15
|
+
const client = getClient();
|
|
16
|
+
const result = await client.timeOff.getWhosOut({
|
|
17
|
+
start: opts.start,
|
|
18
|
+
end: opts.end,
|
|
19
|
+
});
|
|
20
|
+
output(result);
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
handleError(err);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=whos-out.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whos-out.js","sourceRoot":"","sources":["../../../src/commands/timeoff/whos-out.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,OAAO,CAAC,MAAe;IACrC,MAAM;SACH,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,iDAAiD,CAAC;SAC9D,MAAM,CAAC,gBAAgB,EAAE,4CAA4C,CAAC;SACtE,MAAM,CAAC,cAAc,EAAE,uDAAuD,CAAC;SAC/E,WAAW,CACV,OAAO,EACP;;;kEAG4D,CAC7D;SACA,MAAM,CAAC,KAAK,EAAE,IAAsC,EAAE,EAAE;QACvD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;gBAC7C,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,GAAG,EAAE,IAAI,CAAC,GAAG;aACd,CAAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import 'dotenv/config';
|
|
3
|
+
import { styleText } from 'node:util';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
import { registerEmployeeCommands } from './commands/employee/index.js';
|
|
6
|
+
import { registerFileCommands } from './commands/file/index.js';
|
|
7
|
+
import { registerMetaCommands } from './commands/meta/index.js';
|
|
8
|
+
import { registerTimeoffCommands } from './commands/timeoff/index.js';
|
|
9
|
+
const DIM = '\x1b[2m';
|
|
10
|
+
const RESET = '\x1b[0m';
|
|
11
|
+
const program = new Command();
|
|
12
|
+
program
|
|
13
|
+
.name('bamboohr')
|
|
14
|
+
.description('BambooHR CLI')
|
|
15
|
+
.version('1.0.0')
|
|
16
|
+
.configureHelp({
|
|
17
|
+
styleTitle: (str) => styleText('bold', str),
|
|
18
|
+
styleUsage: (str) => styleText('dim', str),
|
|
19
|
+
styleCommandDescription: (str) => styleText('dim', str),
|
|
20
|
+
styleOptionDescription: (str) => styleText('dim', str),
|
|
21
|
+
styleSubcommandDescription: (str) => styleText('dim', str),
|
|
22
|
+
})
|
|
23
|
+
.addHelpText('beforeAll', `\n${styleText('bold', 'bamboohr')} ${DIM}— BambooHR CLI${RESET}\n`)
|
|
24
|
+
.addHelpText('after', `
|
|
25
|
+
${styleText('bold', 'Environment:')}
|
|
26
|
+
BAMBOO_TOKEN BambooHR API token ${DIM}(generate in BambooHR > Settings > API Keys)${RESET}
|
|
27
|
+
BAMBOO_COMPANY_DOMAIN Company subdomain ${DIM}(e.g., "mycompany" for mycompany.bamboohr.com)${RESET}
|
|
28
|
+
|
|
29
|
+
${styleText('bold', 'Examples:')}
|
|
30
|
+
${DIM}$${RESET} bamboohr employee get
|
|
31
|
+
${DIM}$${RESET} bamboohr employee get 123 --fields "firstName,lastName,department"
|
|
32
|
+
${DIM}$${RESET} bamboohr employee directory
|
|
33
|
+
${DIM}$${RESET} bamboohr employee photo 123 --output ./photo.jpg
|
|
34
|
+
${DIM}$${RESET} bamboohr timeoff requests --status requested
|
|
35
|
+
${DIM}$${RESET} bamboohr timeoff whos-out
|
|
36
|
+
${DIM}$${RESET} bamboohr file list
|
|
37
|
+
${DIM}$${RESET} bamboohr meta fields
|
|
38
|
+
`);
|
|
39
|
+
registerEmployeeCommands(program);
|
|
40
|
+
registerTimeoffCommands(program);
|
|
41
|
+
registerFileCommands(program);
|
|
42
|
+
registerMetaCommands(program);
|
|
43
|
+
program.parse();
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,MAAM,GAAG,GAAG,SAAS,CAAC;AACtB,MAAM,KAAK,GAAG,SAAS,CAAC;AAExB,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAC9B,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,cAAc,CAAC;KAC3B,OAAO,CAAC,OAAO,CAAC;KAChB,aAAa,CAAC;IACb,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC;IAC3C,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;IAC1C,uBAAuB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;IACvD,sBAAsB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;IACtD,0BAA0B,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;CAC3D,CAAC;KACD,WAAW,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,GAAG,iBAAiB,KAAK,IAAI,CAAC;KAC7F,WAAW,CACV,OAAO,EACP;EACF,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC;+CACY,GAAG,+CAA+C,KAAK;8CACxD,GAAG,iDAAiD,KAAK;;EAErG,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC5B,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;IACZ,GAAG,IAAI,KAAK;CACf,CACE,CAAC;AAEJ,wBAAwB,CAAC,OAAO,CAAC,CAAC;AAClC,uBAAuB,CAAC,OAAO,CAAC,CAAC;AACjC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC9B,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAE9B,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/utils/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,wBAAgB,SAAS,IAAI,cAAc,CAoB1C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BambooHRClient } from 'bamboohr-client';
|
|
2
|
+
export function getClient() {
|
|
3
|
+
const apiToken = process.env.BAMBOO_TOKEN;
|
|
4
|
+
const companyDomain = process.env.BAMBOO_COMPANY_DOMAIN;
|
|
5
|
+
if (!apiToken || !companyDomain) {
|
|
6
|
+
const missing = [...(!apiToken ? ['BAMBOO_TOKEN'] : []), ...(!companyDomain ? ['BAMBOO_COMPANY_DOMAIN'] : [])];
|
|
7
|
+
process.stderr.write(`${JSON.stringify({
|
|
8
|
+
error: `Missing required environment variables: ${missing.join(', ')}`,
|
|
9
|
+
setup: {
|
|
10
|
+
BAMBOO_TOKEN: 'BambooHR API token — generate in BambooHR > Settings > API Keys',
|
|
11
|
+
BAMBOO_COMPANY_DOMAIN: 'Company subdomain (e.g., "mycompany" for mycompany.bamboohr.com)',
|
|
12
|
+
},
|
|
13
|
+
hint: 'Export these variables or add them to a .env file in the working directory.',
|
|
14
|
+
})}\n`);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
return new BambooHRClient({ apiToken, companyDomain });
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/utils/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,UAAU,SAAS;IACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IAC1C,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;IAExD,IAAI,CAAC,QAAQ,IAAI,CAAC,aAAa,EAAE,CAAC;QAChC,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/G,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,IAAI,CAAC,SAAS,CAAC;YAChB,KAAK,EAAE,2CAA2C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACtE,KAAK,EAAE;gBACL,YAAY,EAAE,iEAAiE;gBAC/E,qBAAqB,EAAE,kEAAkE;aAC1F;YACD,IAAI,EAAE,6EAA6E;SACpF,CAAC,IAAI,CACP,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,IAAI,cAAc,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAEA,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAE1C;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAuB9C"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { stripResponse } from './strip-response.js';
|
|
2
|
+
export function output(data) {
|
|
3
|
+
process.stdout.write(`${JSON.stringify(stripResponse(data), null, 2)}\n`);
|
|
4
|
+
}
|
|
5
|
+
export function handleError(err) {
|
|
6
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
7
|
+
const axiosStatus = err?.response?.status;
|
|
8
|
+
if (axiosStatus === 401 || axiosStatus === 403) {
|
|
9
|
+
process.stderr.write(`${JSON.stringify({
|
|
10
|
+
error: `Authentication failed (HTTP ${axiosStatus})`,
|
|
11
|
+
hint: 'Verify that BAMBOO_TOKEN and BAMBOO_COMPANY_DOMAIN are set correctly. The token may be expired or lack the required permissions.',
|
|
12
|
+
})}\n`);
|
|
13
|
+
}
|
|
14
|
+
else if (message.includes('ENOTFOUND') || message.includes('ECONNREFUSED') || message.includes('ECONNRESET')) {
|
|
15
|
+
process.stderr.write(`${JSON.stringify({
|
|
16
|
+
error: `Cannot connect to BambooHR API: ${message}`,
|
|
17
|
+
hint: 'Verify that BAMBOO_COMPANY_DOMAIN is correct and you have internet connectivity.',
|
|
18
|
+
})}\n`);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
process.stderr.write(`${JSON.stringify({ error: message })}\n`);
|
|
22
|
+
}
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,UAAU,MAAM,CAAC,IAAa;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAY;IACtC,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,MAAM,WAAW,GAAI,GAA0C,EAAE,QAAQ,EAAE,MAAM,CAAC;IAElF,IAAI,WAAW,KAAK,GAAG,IAAI,WAAW,KAAK,GAAG,EAAE,CAAC;QAC/C,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,IAAI,CAAC,SAAS,CAAC;YAChB,KAAK,EAAE,+BAA+B,WAAW,GAAG;YACpD,IAAI,EAAE,kIAAkI;SACzI,CAAC,IAAI,CACP,CAAC;IACJ,CAAC;SAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;QAC/G,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,IAAI,CAAC,SAAS,CAAC;YAChB,KAAK,EAAE,mCAAmC,OAAO,EAAE;YACnD,IAAI,EAAE,kFAAkF;SACzF,CAAC,IAAI,CACP,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively strip verbose fields from API responses to reduce token usage.
|
|
3
|
+
* Removes: self URLs, avatar URL dicts, _links, _expandable, expand metadata.
|
|
4
|
+
*/
|
|
5
|
+
export declare function stripResponse(obj: unknown): unknown;
|
|
6
|
+
//# sourceMappingURL=strip-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strip-response.d.ts","sourceRoot":"","sources":["../../src/utils/strip-response.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CA8BnD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively strip verbose fields from API responses to reduce token usage.
|
|
3
|
+
* Removes: self URLs, avatar URL dicts, _links, _expandable, expand metadata.
|
|
4
|
+
*/
|
|
5
|
+
export function stripResponse(obj) {
|
|
6
|
+
if (Array.isArray(obj)) {
|
|
7
|
+
return obj.map(stripResponse);
|
|
8
|
+
}
|
|
9
|
+
if (obj === null || typeof obj !== 'object') {
|
|
10
|
+
return obj;
|
|
11
|
+
}
|
|
12
|
+
const record = obj;
|
|
13
|
+
const result = {};
|
|
14
|
+
for (const [key, value] of Object.entries(record)) {
|
|
15
|
+
// Skip noisy fields
|
|
16
|
+
if (key === 'self' ||
|
|
17
|
+
key === '_links' ||
|
|
18
|
+
key === '_expandable' ||
|
|
19
|
+
key === 'expand' ||
|
|
20
|
+
key === 'avatarUrls' ||
|
|
21
|
+
key === 'avatarId' ||
|
|
22
|
+
key === 'iconUrl') {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
result[key] = stripResponse(value);
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=strip-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strip-response.js","sourceRoot":"","sources":["../../src/utils/strip-response.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,GAAY;IACxC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5C,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,MAAM,GAAG,GAA8B,CAAC;IAC9C,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,oBAAoB;QACpB,IACE,GAAG,KAAK,MAAM;YACd,GAAG,KAAK,QAAQ;YAChB,GAAG,KAAK,aAAa;YACrB,GAAG,KAAK,QAAQ;YAChB,GAAG,KAAK,YAAY;YACpB,GAAG,KAAK,UAAU;YAClB,GAAG,KAAK,SAAS,EACjB,CAAC;YACD,SAAS;QACX,CAAC;QAED,MAAM,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bamboohr-cli",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"publish": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"bamboohr": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"commander": "^13.1.0",
|
|
15
|
+
"dotenv": "17.2.3",
|
|
16
|
+
"bamboohr-client": "1.0.16"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/node": "24.10.4",
|
|
20
|
+
"eslint": "^9.39.0",
|
|
21
|
+
"tsx": "^4.19.2",
|
|
22
|
+
"typescript": "^5.7.2",
|
|
23
|
+
"vitest": "^4.0.16",
|
|
24
|
+
"config-eslint": "0.0.0",
|
|
25
|
+
"config-typescript": "0.0.0"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=22.0.0"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc",
|
|
32
|
+
"dev": "tsx src/index.ts",
|
|
33
|
+
"lint": "eslint src",
|
|
34
|
+
"lint:fix": "eslint src --fix",
|
|
35
|
+
"test": "vitest run",
|
|
36
|
+
"test:integration": "vitest run tests/integration"
|
|
37
|
+
}
|
|
38
|
+
}
|