bamboohr-cli 0.0.2 → 0.0.4
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.map +1 -1
- package/dist/commands/employee/get.d.ts.map +1 -1
- package/dist/commands/employee/goals.d.ts.map +1 -1
- package/dist/commands/employee/index.d.ts.map +1 -1
- package/dist/commands/employee/index.js +2 -0
- package/dist/commands/employee/index.js.map +1 -1
- package/dist/commands/employee/photo.d.ts.map +1 -1
- package/dist/commands/employee/search.d.ts +3 -0
- package/dist/commands/employee/search.d.ts.map +1 -0
- package/dist/commands/employee/search.js +24 -0
- package/dist/commands/employee/search.js.map +1 -0
- package/dist/commands/file/get.d.ts.map +1 -1
- package/dist/commands/file/index.d.ts.map +1 -1
- package/dist/commands/file/list.d.ts.map +1 -1
- package/dist/commands/meta/fields.d.ts.map +1 -1
- package/dist/commands/meta/index.d.ts.map +1 -1
- package/dist/commands/timeoff/balance.d.ts.map +1 -1
- package/dist/commands/timeoff/create.d.ts.map +1 -1
- package/dist/commands/timeoff/index.d.ts.map +1 -1
- package/dist/commands/timeoff/requests.d.ts.map +1 -1
- package/dist/commands/timeoff/requests.js +6 -2
- package/dist/commands/timeoff/requests.js.map +1 -1
- package/dist/commands/timeoff/types.d.ts.map +1 -1
- package/dist/commands/timeoff/update-status.d.ts.map +1 -1
- package/dist/commands/timeoff/whos-out.d.ts.map +1 -1
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +10 -1
- package/dist/utils/output.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +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,
|
|
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,GAAG,IAAI,CAc/C"}
|
|
@@ -1 +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,
|
|
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,CA4BzC"}
|
|
@@ -1 +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,
|
|
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,CA0B3C"}
|
|
@@ -1 +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;
|
|
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"}
|
|
@@ -2,6 +2,7 @@ import { directory } from './directory.js';
|
|
|
2
2
|
import { get } from './get.js';
|
|
3
3
|
import { goals } from './goals.js';
|
|
4
4
|
import { photo } from './photo.js';
|
|
5
|
+
import { search } from './search.js';
|
|
5
6
|
export function registerEmployeeCommands(program) {
|
|
6
7
|
const employee = program
|
|
7
8
|
.command('employee')
|
|
@@ -15,6 +16,7 @@ Examples:
|
|
|
15
16
|
$ bamboohr employee goals 123 --filter open
|
|
16
17
|
`);
|
|
17
18
|
get(employee);
|
|
19
|
+
search(employee);
|
|
18
20
|
directory(employee);
|
|
19
21
|
photo(employee);
|
|
20
22
|
goals(employee);
|
|
@@ -1 +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;
|
|
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 +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,
|
|
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,CA8B3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/commands/employee/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAoB5C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getClient } from '../../utils/client.js';
|
|
2
|
+
import { output, handleError } from '../../utils/output.js';
|
|
3
|
+
export function search(parent) {
|
|
4
|
+
parent
|
|
5
|
+
.command('search <query>')
|
|
6
|
+
.description('Search employees by name')
|
|
7
|
+
.addHelpText('after', '\nExamples:\n bamboohr employee search john\n bamboohr employee search "Jane Smith"')
|
|
8
|
+
.action(async (query) => {
|
|
9
|
+
try {
|
|
10
|
+
const client = getClient();
|
|
11
|
+
const dir = await client.employees.getDirectory();
|
|
12
|
+
const q = query.toLowerCase();
|
|
13
|
+
const matches = dir.employees.filter((e) => {
|
|
14
|
+
const name = `${e.firstName ?? ''} ${e.lastName ?? ''} ${e.preferredName ?? ''} ${e.displayName ?? ''}`.toLowerCase();
|
|
15
|
+
return name.includes(q);
|
|
16
|
+
});
|
|
17
|
+
output(matches);
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
handleError(err);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/employee/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAG5D,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,0BAA0B,CAAC;SACvC,WAAW,CAAC,OAAO,EAAE,uFAAuF,CAAC;SAC7G,MAAM,CAAC,KAAK,EAAE,KAAa,EAAE,EAAE;QAC9B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;YAClD,MAAM,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;YAC9B,MAAM,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAW,EAAE,EAAE;gBACnD,MAAM,IAAI,GACR,GAAG,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI,CAAC,CAAC,QAAQ,IAAI,EAAE,IAAI,CAAC,CAAC,aAAa,IAAI,EAAE,IAAI,CAAC,CAAC,WAAW,IAAI,EAAE,EAAE,CAAC,WAAW,EAAE,CAAC;gBAC3G,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC1B,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,OAAO,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +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,
|
|
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,GAAG,IAAI,CAqBzC"}
|
|
@@ -1 +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,
|
|
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 +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,
|
|
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,CAc1C"}
|
|
@@ -1 +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,
|
|
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,GAAG,IAAI,CAc5C"}
|
|
@@ -1 +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,
|
|
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,GAAG,IAAI,CAY3D"}
|
|
@@ -1 +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,
|
|
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,GAAG,IAAI,CAwB7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/timeoff/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/timeoff/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAoD5C"}
|
|
@@ -1 +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;AAQpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/timeoff/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsB9D"}
|
|
@@ -1 +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,
|
|
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,GAAG,IAAI,CA2D9C"}
|
|
@@ -25,13 +25,17 @@ Examples:
|
|
|
25
25
|
$ bamboohr timeoff requests --employee 123 --start 2026-01-01 --end 2026-03-31`)
|
|
26
26
|
.action(async (opts) => {
|
|
27
27
|
try {
|
|
28
|
+
// Default to current year if no dates specified
|
|
29
|
+
const year = new Date().getFullYear();
|
|
30
|
+
const start = opts.start ?? `${year}-01-01`;
|
|
31
|
+
const end = opts.end ?? `${year}-12-31`;
|
|
28
32
|
const client = getClient();
|
|
29
33
|
const result = await client.timeOff.getRequests({
|
|
30
34
|
id: opts.id,
|
|
31
35
|
action: opts.action,
|
|
32
36
|
employeeId: opts.employee,
|
|
33
|
-
start
|
|
34
|
-
end
|
|
37
|
+
start,
|
|
38
|
+
end,
|
|
35
39
|
status: opts.status,
|
|
36
40
|
type: opts.type,
|
|
37
41
|
});
|
|
@@ -1 +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,iBA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eoff/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/commands/timeoff/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAuB3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-status.d.ts","sourceRoot":"","sources":["../../../src/commands/timeoff/update-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"update-status.d.ts","sourceRoot":"","sources":["../../../src/commands/timeoff/update-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA6BlD"}
|
|
@@ -1 +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,
|
|
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,GAAG,IAAI,CAyB7C"}
|
|
@@ -1 +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,
|
|
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,CAiC9C"}
|
package/dist/utils/output.js
CHANGED
|
@@ -5,7 +5,16 @@ export function output(data) {
|
|
|
5
5
|
export function handleError(err) {
|
|
6
6
|
const message = err instanceof Error ? err.message : String(err);
|
|
7
7
|
const axiosStatus = err?.response?.status;
|
|
8
|
-
if (axiosStatus ===
|
|
8
|
+
if (axiosStatus === 400) {
|
|
9
|
+
const responseData = err?.response?.data;
|
|
10
|
+
const apiErrors = responseData && typeof responseData === 'object' ? responseData : undefined;
|
|
11
|
+
process.stderr.write(`${JSON.stringify({
|
|
12
|
+
error: 'Bad request (HTTP 400)',
|
|
13
|
+
detail: apiErrors ?? message,
|
|
14
|
+
hint: 'Check that all parameters are valid (employee IDs, field names, date formats, etc.).',
|
|
15
|
+
})}\n`);
|
|
16
|
+
}
|
|
17
|
+
else if (axiosStatus === 401 || axiosStatus === 403) {
|
|
9
18
|
process.stderr.write(`${JSON.stringify({
|
|
10
19
|
error: `Authentication failed (HTTP ${axiosStatus})`,
|
|
11
20
|
hint: 'Verify that BAMBOO_TOKEN and BAMBOO_COMPANY_DOMAIN are set correctly. The token may be expired or lack the required permissions.',
|
package/dist/utils/output.js.map
CHANGED
|
@@ -1 +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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