bamboohr-cli 1.0.9 → 1.0.10

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.
Files changed (2) hide show
  1. package/dist/index.js +24 -6
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -64,6 +64,28 @@ function getMetaFields(client) {
64
64
 
65
65
  // src/utils/client.ts
66
66
  import { BambooHRClient } from "bamboohr-client";
67
+
68
+ // src/utils/credentials.ts
69
+ function getCredentialInfo() {
70
+ const companyDomain = process.env.BAMBOO_COMPANY_DOMAIN;
71
+ const token = process.env.BAMBOO_TOKEN;
72
+ return {
73
+ environment: {
74
+ BAMBOO_COMPANY_DOMAIN: {
75
+ value: companyDomain ?? null,
76
+ description: 'Company subdomain (e.g., "mycompany" for mycompany.bamboohr.com)'
77
+ },
78
+ BAMBOO_TOKEN: {
79
+ value: token ? "<set>" : null,
80
+ description: "BambooHR API token"
81
+ }
82
+ },
83
+ tokenUrl: `https://${companyDomain ?? "<companyDomain>"}.bamboohr.com/app/settings/permissions/api_keys`,
84
+ hint: "Export environment variables in your shell profile (e.g., ~/.zshrc)."
85
+ };
86
+ }
87
+
88
+ // src/utils/client.ts
67
89
  function getClient() {
68
90
  const apiToken = process.env.BAMBOO_TOKEN;
69
91
  const companyDomain = process.env.BAMBOO_COMPANY_DOMAIN;
@@ -72,11 +94,7 @@ function getClient() {
72
94
  process.stderr.write(
73
95
  `${JSON.stringify({
74
96
  error: `Missing required environment variables: ${missing.join(", ")}`,
75
- setup: {
76
- BAMBOO_TOKEN: "BambooHR API token \u2014 generate in BambooHR > Settings > API Keys",
77
- BAMBOO_COMPANY_DOMAIN: 'Company subdomain (e.g., "mycompany" for mycompany.bamboohr.com)'
78
- },
79
- hint: "Export these in your shell profile (e.g., ~/.zshrc)."
97
+ ...getCredentialInfo()
80
98
  })}
81
99
  `
82
100
  );
@@ -127,7 +145,7 @@ function handleError(err) {
127
145
  process.stderr.write(
128
146
  `${JSON.stringify({
129
147
  error: "Authentication failed (HTTP 401)",
130
- hint: "Verify that BAMBOO_TOKEN and BAMBOO_COMPANY_DOMAIN are set correctly. The token may be expired or invalid."
148
+ ...getCredentialInfo()
131
149
  })}
132
150
  `
133
151
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bamboohr-cli",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "publish": true,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,9 +22,9 @@
22
22
  "tsx": "^4.19.2",
23
23
  "typescript": "^5.7.2",
24
24
  "vitest": "^4.0.16",
25
+ "cli-utils": "1.0.0",
25
26
  "config-eslint": "0.0.0",
26
- "config-typescript": "0.0.0",
27
- "cli-utils": "1.0.0"
27
+ "config-typescript": "0.0.0"
28
28
  },
29
29
  "engines": {
30
30
  "node": ">=22.0.0"