bamboohr-cli 1.0.16 → 1.0.17
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/README.md +2 -2
- package/dist/index.js +21 -19
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -81,10 +81,10 @@ bamboohr employee photo 123 --output ./photo.jpg --size large
|
|
|
81
81
|
bamboohr timeoff whos-out
|
|
82
82
|
|
|
83
83
|
# Request a day off
|
|
84
|
-
bamboohr timeoff create --start 2026-04-20 --end 2026-04-20 --type-id 83 --amount 1
|
|
84
|
+
bamboohr timeoff create --start-date 2026-04-20 --end-date 2026-04-20 --type-id 83 --amount 1
|
|
85
85
|
|
|
86
86
|
# See pending requests for approval
|
|
87
|
-
bamboohr timeoff requests --status requested --start 2026-01-01 --end 2026-12-31
|
|
87
|
+
bamboohr timeoff requests --status requested --start-date 2026-01-01 --end-date 2026-12-31
|
|
88
88
|
|
|
89
89
|
# List available fields for custom queries
|
|
90
90
|
bamboohr meta fields
|
package/dist/index.js
CHANGED
|
@@ -586,14 +586,14 @@ function positiveInt(raw) {
|
|
|
586
586
|
|
|
587
587
|
// src/commands/timeoff/create.ts
|
|
588
588
|
function create(parent) {
|
|
589
|
-
parent.command("create [employeeId]").description("Create a time off request (defaults to current user)").requiredOption("--start <date>", "Start date (YYYY-MM-DD)").requiredOption("--end <date>", "End date (YYYY-MM-DD)").requiredOption("--type-id <id>", 'Time off type ID (use "timeoff types" to find IDs)', positiveInt).requiredOption("--amount <amount>", "Total amount of time off (in days or hours depending on type)", parseFloat).addOption(
|
|
589
|
+
parent.command("create [employeeId]").description("Create a time off request (defaults to current user)").requiredOption("--start-date <date>", "Start date (YYYY-MM-DD)").requiredOption("--end-date <date>", "End date (YYYY-MM-DD)").requiredOption("--type-id <id>", 'Time off type ID (use "timeoff types" to find IDs)', positiveInt).requiredOption("--amount <amount>", "Total amount of time off (in days or hours depending on type)", parseFloat).addOption(
|
|
590
590
|
new Option3("--status <status>", "Request status").choices(["requested", "approved"]).default("requested")
|
|
591
591
|
).option("--note <text>", "Note to include with the request").option("--dates <json>", `Per-day amounts as JSON array, e.g. '[{"ymd":"2026-03-21","amount":4}]' for half-day`).addHelpText(
|
|
592
592
|
"after",
|
|
593
593
|
`
|
|
594
594
|
Examples:
|
|
595
|
-
$ bamboohr timeoff create --start 2026-04-01 --end 2026-04-01 --type-id 83 --amount 1
|
|
596
|
-
$ bamboohr timeoff create 504 --start 2026-04-01 --end 2026-04-01 --type-id 83 --amount 1 --note "Doctor appointment"`
|
|
595
|
+
$ bamboohr timeoff create --start-date 2026-04-01 --end-date 2026-04-01 --type-id 83 --amount 1
|
|
596
|
+
$ bamboohr timeoff create 504 --start-date 2026-04-01 --end-date 2026-04-01 --type-id 83 --amount 1 --note "Doctor appointment"`
|
|
597
597
|
).action(
|
|
598
598
|
async (employeeId, opts) => {
|
|
599
599
|
const client = getClient();
|
|
@@ -601,14 +601,16 @@ Examples:
|
|
|
601
601
|
const result = await client.timeOff.createRequest({
|
|
602
602
|
employeeId: id,
|
|
603
603
|
status: opts.status,
|
|
604
|
-
start: opts.
|
|
605
|
-
end: opts.
|
|
604
|
+
start: opts.startDate,
|
|
605
|
+
end: opts.endDate,
|
|
606
606
|
timeOffTypeId: opts.typeId,
|
|
607
607
|
amount: opts.amount,
|
|
608
608
|
notes: opts.note ? [{ from: "employee", note: opts.note }] : void 0,
|
|
609
609
|
dates: opts.dates ? JSON.parse(opts.dates) : void 0
|
|
610
610
|
});
|
|
611
|
-
output(
|
|
611
|
+
output(
|
|
612
|
+
result ? stripNullish(result) : { created: true, employeeId: id, start: opts.startDate, end: opts.endDate }
|
|
613
|
+
);
|
|
612
614
|
}
|
|
613
615
|
);
|
|
614
616
|
}
|
|
@@ -616,7 +618,7 @@ Examples:
|
|
|
616
618
|
// src/commands/timeoff/requests.ts
|
|
617
619
|
import { Option as Option4 } from "commander";
|
|
618
620
|
function requests(parent) {
|
|
619
|
-
parent.command("requests").description("Get time off requests (defaults to current user)").option("--id <id>", "Specific request ID", positiveInt).addOption(new Option4("--action <action>", "Access level filter").choices(["view", "approve"])).option("--employee <id>", "Filter by employee ID").option("--all", "Show all visible requests instead of just current user").option("--start <date>", "Start date (YYYY-MM-DD)").option("--end <date>", "End date (YYYY-MM-DD)").addOption(
|
|
621
|
+
parent.command("requests").description("Get time off requests (defaults to current user)").option("--id <id>", "Specific request ID", positiveInt).addOption(new Option4("--action <action>", "Access level filter").choices(["view", "approve"])).option("--employee <id>", "Filter by employee ID").option("--all", "Show all visible requests instead of just current user").option("--start-date <date>", "Start date (YYYY-MM-DD)").option("--end-date <date>", "End date (YYYY-MM-DD)").addOption(
|
|
620
622
|
new Option4("--status <status>", "Filter by request status").choices([
|
|
621
623
|
"approved",
|
|
622
624
|
"denied",
|
|
@@ -631,12 +633,12 @@ Examples:
|
|
|
631
633
|
$ bamboohr timeoff requests
|
|
632
634
|
$ bamboohr timeoff requests --status requested
|
|
633
635
|
$ bamboohr timeoff requests --all --action approve --status requested
|
|
634
|
-
$ bamboohr timeoff requests --employee 123 --start 2026-01-01 --end 2026-03-31`
|
|
636
|
+
$ bamboohr timeoff requests --employee 123 --start-date 2026-01-01 --end-date 2026-03-31`
|
|
635
637
|
).action(
|
|
636
638
|
async (opts) => {
|
|
637
639
|
const year = (/* @__PURE__ */ new Date()).getFullYear();
|
|
638
|
-
const start = opts.
|
|
639
|
-
const end = opts.
|
|
640
|
+
const start = opts.startDate ?? `${year}-01-01`;
|
|
641
|
+
const end = opts.endDate ?? `${year}-12-31`;
|
|
640
642
|
const client = getClient();
|
|
641
643
|
let employeeId = opts.employee;
|
|
642
644
|
if (!employeeId && !opts.all) {
|
|
@@ -696,17 +698,17 @@ Examples:
|
|
|
696
698
|
|
|
697
699
|
// src/commands/timeoff/whos-out.ts
|
|
698
700
|
function whosOut(parent) {
|
|
699
|
-
parent.command("whos-out").description("View who's out \u2014 upcoming time off and holidays").option("--start <date>", "Start date (YYYY-MM-DD, defaults to today)").option("--end <date>", "End date (YYYY-MM-DD, defaults to today)").addHelpText(
|
|
701
|
+
parent.command("whos-out").description("View who's out \u2014 upcoming time off and holidays").option("--start-date <date>", "Start date (YYYY-MM-DD, defaults to today)").option("--end-date <date>", "End date (YYYY-MM-DD, defaults to today)").addHelpText(
|
|
700
702
|
"after",
|
|
701
703
|
`
|
|
702
704
|
Examples:
|
|
703
705
|
$ bamboohr timeoff whos-out
|
|
704
|
-
$ bamboohr timeoff whos-out --start 2026-03-20 --end 2026-04-03`
|
|
706
|
+
$ bamboohr timeoff whos-out --start-date 2026-03-20 --end-date 2026-04-03`
|
|
705
707
|
).action(async (opts) => {
|
|
706
708
|
const client = getClient();
|
|
707
709
|
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
708
|
-
const start = opts.
|
|
709
|
-
const end = opts.
|
|
710
|
+
const start = opts.startDate ?? today;
|
|
711
|
+
const end = opts.endDate ?? (opts.startDate ? void 0 : today);
|
|
710
712
|
const result = await client.timeOff.getWhosOut({ start, end });
|
|
711
713
|
output(transformWhosOut(result));
|
|
712
714
|
});
|
|
@@ -719,8 +721,8 @@ function registerTimeoffCommands(program2) {
|
|
|
719
721
|
`
|
|
720
722
|
Examples:
|
|
721
723
|
$ bamboohr timeoff types --requestable
|
|
722
|
-
$ bamboohr timeoff create 504 --start 2026-04-01 --end 2026-04-01 --type-id 83 --amount 1
|
|
723
|
-
$ bamboohr timeoff requests --status requested --start 2026-01-01 --end 2026-12-31
|
|
724
|
+
$ bamboohr timeoff create 504 --start-date 2026-04-01 --end-date 2026-04-01 --type-id 83 --amount 1
|
|
725
|
+
$ bamboohr timeoff requests --status requested --start-date 2026-01-01 --end-date 2026-12-31
|
|
724
726
|
$ bamboohr timeoff balance 504
|
|
725
727
|
$ bamboohr timeoff whos-out
|
|
726
728
|
$ bamboohr timeoff update-status 7890 --status approved
|
|
@@ -769,9 +771,9 @@ ${styleText("bold", "Examples:")}
|
|
|
769
771
|
${DIM}$${RESET} bamboohr employee directory
|
|
770
772
|
${DIM}$${RESET} bamboohr employee photo 123 --output ./photo.jpg
|
|
771
773
|
${DIM}$${RESET} bamboohr timeoff types --requestable
|
|
772
|
-
${DIM}$${RESET} bamboohr timeoff create 504 --start 2026-04-01 --end 2026-04-01 --type-id 83 --amount 1
|
|
773
|
-
${DIM}$${RESET} bamboohr timeoff create 504 --start 2026-04-01 --end 2026-04-01 --type-id 83 --amount 1 --note "Doctor appointment"
|
|
774
|
-
${DIM}$${RESET} bamboohr timeoff requests --status requested --start 2026-01-01 --end 2026-12-31
|
|
774
|
+
${DIM}$${RESET} bamboohr timeoff create 504 --start-date 2026-04-01 --end-date 2026-04-01 --type-id 83 --amount 1
|
|
775
|
+
${DIM}$${RESET} bamboohr timeoff create 504 --start-date 2026-04-01 --end-date 2026-04-01 --type-id 83 --amount 1 --note "Doctor appointment"
|
|
776
|
+
${DIM}$${RESET} bamboohr timeoff requests --status requested --start-date 2026-01-01 --end-date 2026-12-31
|
|
775
777
|
${DIM}$${RESET} bamboohr timeoff whos-out
|
|
776
778
|
${DIM}$${RESET} bamboohr timeoff update-status 7890 --status approved
|
|
777
779
|
${DIM}$${RESET} bamboohr file list
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bamboohr-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"publish": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"tsx": "^4.19.2",
|
|
23
23
|
"typescript": "^5.7.2",
|
|
24
24
|
"vitest": "^4.0.16",
|
|
25
|
-
"config-eslint": "0.0.0",
|
|
26
25
|
"cli-utils": "1.0.0",
|
|
26
|
+
"config-eslint": "0.0.0",
|
|
27
27
|
"config-typescript": "0.0.0"
|
|
28
28
|
},
|
|
29
29
|
"engines": {
|