bamboohr-cli 1.0.7 → 1.0.9
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/index.js +601 -31
- package/package.json +6 -5
- package/dist/commands/employee/directory.d.ts +0 -3
- package/dist/commands/employee/directory.d.ts.map +0 -1
- package/dist/commands/employee/directory.js +0 -15
- package/dist/commands/employee/directory.js.map +0 -1
- package/dist/commands/employee/get.d.ts +0 -3
- package/dist/commands/employee/get.d.ts.map +0 -1
- package/dist/commands/employee/get.js +0 -25
- package/dist/commands/employee/get.js.map +0 -1
- package/dist/commands/employee/goals.d.ts +0 -3
- package/dist/commands/employee/goals.d.ts.map +0 -1
- package/dist/commands/employee/goals.js +0 -22
- package/dist/commands/employee/goals.js.map +0 -1
- package/dist/commands/employee/index.d.ts +0 -3
- package/dist/commands/employee/index.d.ts.map +0 -1
- package/dist/commands/employee/index.js +0 -24
- package/dist/commands/employee/index.js.map +0 -1
- package/dist/commands/employee/photo.d.ts +0 -3
- package/dist/commands/employee/photo.d.ts.map +0 -1
- package/dist/commands/employee/photo.js +0 -27
- package/dist/commands/employee/photo.js.map +0 -1
- package/dist/commands/employee/search.d.ts +0 -3
- package/dist/commands/employee/search.d.ts.map +0 -1
- package/dist/commands/employee/search.js +0 -59
- package/dist/commands/employee/search.js.map +0 -1
- package/dist/commands/file/get.d.ts +0 -3
- package/dist/commands/file/get.d.ts.map +0 -1
- package/dist/commands/file/get.js +0 -19
- package/dist/commands/file/get.js.map +0 -1
- package/dist/commands/file/index.d.ts +0 -3
- package/dist/commands/file/index.d.ts.map +0 -1
- package/dist/commands/file/index.js +0 -15
- package/dist/commands/file/index.js.map +0 -1
- package/dist/commands/file/list.d.ts +0 -3
- package/dist/commands/file/list.d.ts.map +0 -1
- package/dist/commands/file/list.js +0 -14
- package/dist/commands/file/list.js.map +0 -1
- package/dist/commands/meta/departments.d.ts +0 -3
- package/dist/commands/meta/departments.d.ts.map +0 -1
- package/dist/commands/meta/departments.js +0 -16
- package/dist/commands/meta/departments.js.map +0 -1
- package/dist/commands/meta/divisions.d.ts +0 -3
- package/dist/commands/meta/divisions.d.ts.map +0 -1
- package/dist/commands/meta/divisions.js +0 -16
- package/dist/commands/meta/divisions.js.map +0 -1
- package/dist/commands/meta/fields.d.ts +0 -3
- package/dist/commands/meta/fields.d.ts.map +0 -1
- package/dist/commands/meta/fields.js +0 -15
- package/dist/commands/meta/fields.js.map +0 -1
- package/dist/commands/meta/index.d.ts +0 -3
- package/dist/commands/meta/index.d.ts.map +0 -1
- package/dist/commands/meta/index.js +0 -21
- package/dist/commands/meta/index.js.map +0 -1
- package/dist/commands/meta/locations.d.ts +0 -3
- package/dist/commands/meta/locations.d.ts.map +0 -1
- package/dist/commands/meta/locations.js +0 -16
- package/dist/commands/meta/locations.js.map +0 -1
- package/dist/commands/timeoff/balance.d.ts +0 -3
- package/dist/commands/timeoff/balance.d.ts.map +0 -1
- package/dist/commands/timeoff/balance.js +0 -21
- package/dist/commands/timeoff/balance.js.map +0 -1
- package/dist/commands/timeoff/create.d.ts +0 -3
- package/dist/commands/timeoff/create.d.ts.map +0 -1
- package/dist/commands/timeoff/create.js +0 -36
- package/dist/commands/timeoff/create.js.map +0 -1
- package/dist/commands/timeoff/index.d.ts +0 -3
- package/dist/commands/timeoff/index.d.ts.map +0 -1
- package/dist/commands/timeoff/index.js +0 -27
- package/dist/commands/timeoff/index.js.map +0 -1
- package/dist/commands/timeoff/requests.d.ts +0 -3
- package/dist/commands/timeoff/requests.d.ts.map +0 -1
- package/dist/commands/timeoff/requests.js +0 -51
- package/dist/commands/timeoff/requests.js.map +0 -1
- package/dist/commands/timeoff/types.d.ts +0 -3
- package/dist/commands/timeoff/types.d.ts.map +0 -1
- package/dist/commands/timeoff/types.js +0 -21
- package/dist/commands/timeoff/types.js.map +0 -1
- package/dist/commands/timeoff/update-status.d.ts +0 -3
- package/dist/commands/timeoff/update-status.d.ts.map +0 -1
- package/dist/commands/timeoff/update-status.js +0 -25
- package/dist/commands/timeoff/update-status.js.map +0 -1
- package/dist/commands/timeoff/whos-out.d.ts +0 -3
- package/dist/commands/timeoff/whos-out.d.ts.map +0 -1
- package/dist/commands/timeoff/whos-out.js +0 -22
- package/dist/commands/timeoff/whos-out.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/utils/cached.d.ts +0 -8
- package/dist/utils/cached.d.ts.map +0 -1
- package/dist/utils/cached.js +0 -17
- package/dist/utils/cached.js.map +0 -1
- package/dist/utils/client.d.ts +0 -3
- package/dist/utils/client.d.ts.map +0 -1
- package/dist/utils/client.js +0 -19
- package/dist/utils/client.js.map +0 -1
- package/dist/utils/output.d.ts +0 -3
- package/dist/utils/output.d.ts.map +0 -1
- package/dist/utils/output.js +0 -49
- package/dist/utils/output.js.map +0 -1
- package/dist/utils/resolve-employee.d.ts +0 -6
- package/dist/utils/resolve-employee.d.ts.map +0 -1
- package/dist/utils/resolve-employee.js +0 -10
- package/dist/utils/resolve-employee.js.map +0 -1
- package/dist/utils/strip-response.d.ts +0 -6
- package/dist/utils/strip-response.d.ts.map +0 -1
- package/dist/utils/strip-response.js +0 -29
- package/dist/utils/strip-response.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../../../src/commands/employee/directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAU/C"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { getDirectory } from '../../utils/cached.js';
|
|
2
|
-
import { getClient } from '../../utils/client.js';
|
|
3
|
-
import { output } from '../../utils/output.js';
|
|
4
|
-
export function directory(parent) {
|
|
5
|
-
parent
|
|
6
|
-
.command('directory')
|
|
7
|
-
.description('Get the company employee directory')
|
|
8
|
-
.addHelpText('after', '\nExamples:\n $ bamboohr employee directory')
|
|
9
|
-
.action(async () => {
|
|
10
|
-
const client = getClient();
|
|
11
|
-
const result = await getDirectory(client);
|
|
12
|
-
output(result);
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=directory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"directory.js","sourceRoot":"","sources":["../../../src/commands/employee/directory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,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,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;QAC1C,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
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,GAAG,IAAI,CAwBzC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output } 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
|
-
const client = getClient();
|
|
17
|
-
const result = await client.employees.get({
|
|
18
|
-
id: id ?? '0',
|
|
19
|
-
fields: opts.fields,
|
|
20
|
-
onlyCurrent: !opts.includeFuture,
|
|
21
|
-
});
|
|
22
|
-
output(result);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=get.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,MAAM,uBAAuB,CAAC;AAE/C,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,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC;YACxC,EAAE,EAAE,EAAE,IAAI,GAAG;YACb,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,WAAW,EAAE,CAAC,IAAI,CAAC,aAAa;SACjC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
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,GAAG,IAAI,CAsB3C"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Option } from 'commander';
|
|
2
|
-
import { getClient } from '../../utils/client.js';
|
|
3
|
-
import { output } 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
|
-
const client = getClient();
|
|
15
|
-
const result = await client.goals.get({
|
|
16
|
-
employeeId: id,
|
|
17
|
-
filter: opts.filter === 'all' ? undefined : opts.filter,
|
|
18
|
-
});
|
|
19
|
-
output(result);
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=goals.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,MAAM,uBAAuB,CAAC;AAE/C,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,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;YACpC,UAAU,EAAE,EAAE;YACd,MAAM,EAAE,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,IAAI,CAAC,MAA4B;SAC/E,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/employee/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoB/D"}
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
import { search } from './search.js';
|
|
6
|
-
export function registerEmployeeCommands(program) {
|
|
7
|
-
const employee = program
|
|
8
|
-
.command('employee')
|
|
9
|
-
.description('Employee operations')
|
|
10
|
-
.addHelpText('after', `
|
|
11
|
-
Examples:
|
|
12
|
-
$ bamboohr employee get
|
|
13
|
-
$ bamboohr employee get 123 --fields "firstName,lastName,department"
|
|
14
|
-
$ bamboohr employee directory
|
|
15
|
-
$ bamboohr employee photo 123 --output ./photo.jpg
|
|
16
|
-
$ bamboohr employee goals 123 --filter open
|
|
17
|
-
`);
|
|
18
|
-
get(employee);
|
|
19
|
-
search(employee);
|
|
20
|
-
directory(employee);
|
|
21
|
-
photo(employee);
|
|
22
|
-
goals(employee);
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,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,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjB,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpB,KAAK,CAAC,QAAQ,CAAC,CAAC;IAChB,KAAK,CAAC,QAAQ,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
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,GAAG,IAAI,CA0B3C"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { writeFileSync } from 'node:fs';
|
|
2
|
-
import { Option } from 'commander';
|
|
3
|
-
import { getClient } from '../../utils/client.js';
|
|
4
|
-
import { output } 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
|
-
const client = getClient();
|
|
19
|
-
const buffer = await client.employees.getPhoto({
|
|
20
|
-
employeeId: id,
|
|
21
|
-
size: opts.size,
|
|
22
|
-
});
|
|
23
|
-
writeFileSync(opts.output, buffer);
|
|
24
|
-
output({ saved: true, path: opts.output, size: buffer.length });
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=photo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,MAAM,uBAAuB,CAAC;AAE/C,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,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;YAC7C,UAAU,EAAE,EAAE;YACd,IAAI,EAAE,IAAI,CAAC,IAAiE;SAC7E,CAAC,CAAC;QACH,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACnC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/commands/employee/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAoE5C"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { getDirectory } from '../../utils/cached.js';
|
|
2
|
-
import { getClient } from '../../utils/client.js';
|
|
3
|
-
import { output } from '../../utils/output.js';
|
|
4
|
-
import { resolveEmployeeId } from '../../utils/resolve-employee.js';
|
|
5
|
-
export function search(parent) {
|
|
6
|
-
parent
|
|
7
|
-
.command('search [query]')
|
|
8
|
-
.description('Search and filter employees')
|
|
9
|
-
.option('--supervisor <name>', 'Filter by supervisor name (use "me" for current user)')
|
|
10
|
-
.option('--department <name>', 'Filter by department')
|
|
11
|
-
.option('--location <name>', 'Filter by location')
|
|
12
|
-
.option('--division <name>', 'Filter by division')
|
|
13
|
-
.addHelpText('after', `\nExamples:
|
|
14
|
-
bamboohr employee search john
|
|
15
|
-
bamboohr employee search --supervisor me
|
|
16
|
-
bamboohr employee search --department "R&D" --location Sofia
|
|
17
|
-
bamboohr employee search --supervisor "Borislav Mihaylov"`)
|
|
18
|
-
.action(async (query, opts) => {
|
|
19
|
-
const client = getClient();
|
|
20
|
-
const dir = await getDirectory(client);
|
|
21
|
-
let matches = dir.employees;
|
|
22
|
-
// Name filter
|
|
23
|
-
if (query) {
|
|
24
|
-
const q = query.toLowerCase();
|
|
25
|
-
matches = matches.filter((e) => {
|
|
26
|
-
const name = `${e.firstName ?? ''} ${e.lastName ?? ''} ${e.preferredName ?? ''} ${e.displayName ?? ''}`.toLowerCase();
|
|
27
|
-
return name.includes(q);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
// Supervisor filter — resolve "me" to current user's display name
|
|
31
|
-
if (opts.supervisor) {
|
|
32
|
-
let supervisorName = opts.supervisor;
|
|
33
|
-
if (supervisorName.toLowerCase() === 'me') {
|
|
34
|
-
const myId = await resolveEmployeeId(client);
|
|
35
|
-
const me = dir.employees.find((e) => e.id === myId);
|
|
36
|
-
supervisorName = me?.displayName ?? `${me?.firstName ?? ''} ${me?.lastName ?? ''}`;
|
|
37
|
-
}
|
|
38
|
-
const s = supervisorName.toLowerCase();
|
|
39
|
-
matches = matches.filter((e) => (e.supervisor ?? '').toLowerCase().includes(s));
|
|
40
|
-
}
|
|
41
|
-
// Department filter
|
|
42
|
-
if (opts.department) {
|
|
43
|
-
const d = opts.department.toLowerCase();
|
|
44
|
-
matches = matches.filter((e) => (e.department ?? '').toLowerCase().includes(d));
|
|
45
|
-
}
|
|
46
|
-
// Location filter
|
|
47
|
-
if (opts.location) {
|
|
48
|
-
const l = opts.location.toLowerCase();
|
|
49
|
-
matches = matches.filter((e) => (e.location ?? '').toLowerCase().includes(l));
|
|
50
|
-
}
|
|
51
|
-
// Division filter
|
|
52
|
-
if (opts.division) {
|
|
53
|
-
const dv = opts.division.toLowerCase();
|
|
54
|
-
matches = matches.filter((e) => (e.division ?? '').toLowerCase().includes(dv));
|
|
55
|
-
}
|
|
56
|
-
output(matches);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=search.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/employee/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,6BAA6B,CAAC;SAC1C,MAAM,CAAC,qBAAqB,EAAE,uDAAuD,CAAC;SACtF,MAAM,CAAC,qBAAqB,EAAE,sBAAsB,CAAC;SACrD,MAAM,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;SACjD,MAAM,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;SACjD,WAAW,CACV,OAAO,EACP;;;;4DAIsD,CACvD;SACA,MAAM,CACL,KAAK,EACH,KAAyB,EACzB,IAAwF,EACxF,EAAE;QACF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,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EAAE,OAAO,GAAG,IAAI,CAiBzC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { writeFileSync } from 'node:fs';
|
|
2
|
-
import { getClient } from '../../utils/client.js';
|
|
3
|
-
import { output } 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
|
-
const client = getClient();
|
|
14
|
-
const buffer = await client.files.get({ fileId });
|
|
15
|
-
writeFileSync(opts.output, buffer);
|
|
16
|
-
output({ saved: true, path: opts.output, size: buffer.length });
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=get.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,MAAM,uBAAuB,CAAC;AAE/C,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,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAClD,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACnC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
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,GAAG,IAAI,CAc3D"}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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,GAAG,IAAI,CAU1C"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output } 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
|
-
const client = getClient();
|
|
10
|
-
const result = await client.files.list();
|
|
11
|
-
output(result);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,MAAM,uBAAuB,CAAC;AAE/C,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,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QACzC,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"departments.d.ts","sourceRoot":"","sources":["../../../src/commands/meta/departments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAWjD"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { getDirectory } from '../../utils/cached.js';
|
|
2
|
-
import { getClient } from '../../utils/client.js';
|
|
3
|
-
import { output } from '../../utils/output.js';
|
|
4
|
-
export function departments(parent) {
|
|
5
|
-
parent
|
|
6
|
-
.command('departments')
|
|
7
|
-
.description('List all departments')
|
|
8
|
-
.addHelpText('after', '\nExamples:\n bamboohr meta departments')
|
|
9
|
-
.action(async () => {
|
|
10
|
-
const client = getClient();
|
|
11
|
-
const dir = await getDirectory(client);
|
|
12
|
-
const unique = [...new Set(dir.employees.map((e) => e.department).filter(Boolean))].sort();
|
|
13
|
-
output(unique);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=departments.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"departments.js","sourceRoot":"","sources":["../../../src/commands/meta/departments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG/C,MAAM,UAAU,WAAW,CAAC,MAAe;IACzC,MAAM;SACH,OAAO,CAAC,aAAa,CAAC;SACtB,WAAW,CAAC,sBAAsB,CAAC;SACnC,WAAW,CAAC,OAAO,EAAE,0CAA0C,CAAC;SAChE,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAW,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACrG,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"divisions.d.ts","sourceRoot":"","sources":["../../../src/commands/meta/divisions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAW/C"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { getDirectory } from '../../utils/cached.js';
|
|
2
|
-
import { getClient } from '../../utils/client.js';
|
|
3
|
-
import { output } from '../../utils/output.js';
|
|
4
|
-
export function divisions(parent) {
|
|
5
|
-
parent
|
|
6
|
-
.command('divisions')
|
|
7
|
-
.description('List all divisions')
|
|
8
|
-
.addHelpText('after', '\nExamples:\n bamboohr meta divisions')
|
|
9
|
-
.action(async () => {
|
|
10
|
-
const client = getClient();
|
|
11
|
-
const dir = await getDirectory(client);
|
|
12
|
-
const unique = [...new Set(dir.employees.map((e) => e.division).filter(Boolean))].sort();
|
|
13
|
-
output(unique);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=divisions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"divisions.js","sourceRoot":"","sources":["../../../src/commands/meta/divisions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG/C,MAAM,UAAU,SAAS,CAAC,MAAe;IACvC,MAAM;SACH,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,oBAAoB,CAAC;SACjC,WAAW,CAAC,OAAO,EAAE,wCAAwC,CAAC;SAC9D,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAW,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACnG,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../../src/commands/meta/fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAU5C"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { getMetaFields } from '../../utils/cached.js';
|
|
2
|
-
import { getClient } from '../../utils/client.js';
|
|
3
|
-
import { output } from '../../utils/output.js';
|
|
4
|
-
export function fields(parent) {
|
|
5
|
-
parent
|
|
6
|
-
.command('fields')
|
|
7
|
-
.description('List all available BambooHR fields')
|
|
8
|
-
.addHelpText('after', '\nExamples:\n $ bamboohr meta fields')
|
|
9
|
-
.action(async () => {
|
|
10
|
-
const client = getClient();
|
|
11
|
-
const result = await getMetaFields(client);
|
|
12
|
-
output(result);
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=fields.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../src/commands/meta/fields.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,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,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC,CAAC;QAC3C,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/meta/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkB3D"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { departments } from './departments.js';
|
|
2
|
-
import { divisions } from './divisions.js';
|
|
3
|
-
import { fields } from './fields.js';
|
|
4
|
-
import { locations } from './locations.js';
|
|
5
|
-
export function registerMetaCommands(program) {
|
|
6
|
-
const meta = program
|
|
7
|
-
.command('meta')
|
|
8
|
-
.description('Metadata operations')
|
|
9
|
-
.addHelpText('after', `
|
|
10
|
-
Examples:
|
|
11
|
-
$ bamboohr meta fields
|
|
12
|
-
$ bamboohr meta departments
|
|
13
|
-
$ bamboohr meta locations
|
|
14
|
-
$ bamboohr meta divisions
|
|
15
|
-
`);
|
|
16
|
-
fields(meta);
|
|
17
|
-
departments(meta);
|
|
18
|
-
locations(meta);
|
|
19
|
-
divisions(meta);
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/meta/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,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;;;;;;CAML,CACI,CAAC;IACJ,MAAM,CAAC,IAAI,CAAC,CAAC;IACb,WAAW,CAAC,IAAI,CAAC,CAAC;IAClB,SAAS,CAAC,IAAI,CAAC,CAAC;IAChB,SAAS,CAAC,IAAI,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locations.d.ts","sourceRoot":"","sources":["../../../src/commands/meta/locations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAW/C"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { getDirectory } from '../../utils/cached.js';
|
|
2
|
-
import { getClient } from '../../utils/client.js';
|
|
3
|
-
import { output } from '../../utils/output.js';
|
|
4
|
-
export function locations(parent) {
|
|
5
|
-
parent
|
|
6
|
-
.command('locations')
|
|
7
|
-
.description('List all office locations')
|
|
8
|
-
.addHelpText('after', '\nExamples:\n bamboohr meta locations')
|
|
9
|
-
.action(async () => {
|
|
10
|
-
const client = getClient();
|
|
11
|
-
const dir = await getDirectory(client);
|
|
12
|
-
const unique = [...new Set(dir.employees.map((e) => e.location).filter(Boolean))].sort();
|
|
13
|
-
output(unique);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=locations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locations.js","sourceRoot":"","sources":["../../../src/commands/meta/locations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG/C,MAAM,UAAU,SAAS,CAAC,MAAe;IACvC,MAAM;SACH,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,2BAA2B,CAAC;SACxC,WAAW,CAAC,OAAO,EAAE,wCAAwC,CAAC;SAC9D,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAW,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACnG,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../../src/commands/timeoff/balance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAmB7C"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { getClient } from '../../utils/client.js';
|
|
2
|
-
import { output } from '../../utils/output.js';
|
|
3
|
-
import { resolveEmployeeId } from '../../utils/resolve-employee.js';
|
|
4
|
-
export function balance(parent) {
|
|
5
|
-
parent
|
|
6
|
-
.command('balance [employeeId]')
|
|
7
|
-
.description('Estimate time off balance (defaults to current user)')
|
|
8
|
-
.option('--date <date>', 'Future date to estimate balance for (YYYY-MM-DD)')
|
|
9
|
-
.addHelpText('after', `
|
|
10
|
-
Examples:
|
|
11
|
-
$ bamboohr timeoff balance
|
|
12
|
-
$ bamboohr timeoff balance 123
|
|
13
|
-
$ bamboohr timeoff balance --date 2026-06-30`)
|
|
14
|
-
.action(async (employeeId, opts) => {
|
|
15
|
-
const client = getClient();
|
|
16
|
-
const id = await resolveEmployeeId(client, employeeId);
|
|
17
|
-
const result = await client.timeOff.getBalance({ employeeId: id, date: opts.date });
|
|
18
|
-
output(result);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=balance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,MAAM,UAAU,OAAO,CAAC,MAAe;IACrC,MAAM;SACH,OAAO,CAAC,sBAAsB,CAAC;SAC/B,WAAW,CAAC,sDAAsD,CAAC;SACnE,MAAM,CAAC,eAAe,EAAE,kDAAkD,CAAC;SAC3E,WAAW,CACV,OAAO,EACP;;;;+CAIyC,CAC1C;SACA,MAAM,CAAC,KAAK,EAAE,UAA8B,EAAE,IAAuB,EAAE,EAAE;QACxE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,EAAE,GAAG,MAAM,iBAAiB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QACvD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACpF,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/timeoff/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAK5C,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAgD5C"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Option } from 'commander';
|
|
2
|
-
import { getClient } from '../../utils/client.js';
|
|
3
|
-
import { output } from '../../utils/output.js';
|
|
4
|
-
import { resolveEmployeeId } from '../../utils/resolve-employee.js';
|
|
5
|
-
export function create(parent) {
|
|
6
|
-
parent
|
|
7
|
-
.command('create [employeeId]')
|
|
8
|
-
.description('Create a time off request (defaults to current user)')
|
|
9
|
-
.requiredOption('--start <date>', 'Start date (YYYY-MM-DD)')
|
|
10
|
-
.requiredOption('--end <date>', 'End date (YYYY-MM-DD)')
|
|
11
|
-
.requiredOption('--type-id <id>', 'Time off type ID (use "timeoff types" to find IDs)', parseInt)
|
|
12
|
-
.requiredOption('--amount <amount>', 'Total amount of time off (in days or hours depending on type)', parseFloat)
|
|
13
|
-
.addOption(new Option('--status <status>', 'Request status').choices(['requested', 'approved']).default('requested'))
|
|
14
|
-
.option('--note <text>', 'Note to include with the request')
|
|
15
|
-
.option('--dates <json>', 'Per-day amounts as JSON array, e.g. \'[{"ymd":"2026-03-21","amount":4}]\' for half-day')
|
|
16
|
-
.addHelpText('after', `
|
|
17
|
-
Examples:
|
|
18
|
-
$ bamboohr timeoff create --start 2026-04-01 --end 2026-04-01 --type-id 83 --amount 1
|
|
19
|
-
$ bamboohr timeoff create 504 --start 2026-04-01 --end 2026-04-01 --type-id 83 --amount 1 --note "Doctor appointment"`)
|
|
20
|
-
.action(async (employeeId, opts) => {
|
|
21
|
-
const client = getClient();
|
|
22
|
-
const id = await resolveEmployeeId(client, employeeId);
|
|
23
|
-
const result = await client.timeOff.createRequest({
|
|
24
|
-
employeeId: id,
|
|
25
|
-
status: opts.status,
|
|
26
|
-
start: opts.start,
|
|
27
|
-
end: opts.end,
|
|
28
|
-
timeOffTypeId: opts.typeId,
|
|
29
|
-
amount: opts.amount,
|
|
30
|
-
notes: opts.note ? [{ from: 'employee', note: opts.note }] : undefined,
|
|
31
|
-
dates: opts.dates ? JSON.parse(opts.dates) : undefined,
|
|
32
|
-
});
|
|
33
|
-
output(result || { created: true, employeeId: id, start: opts.start, end: opts.end });
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/timeoff/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,qBAAqB,CAAC;SAC9B,WAAW,CAAC,sDAAsD,CAAC;SACnE,cAAc,CAAC,gBAAgB,EAAE,yBA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