bkper 4.7.0 → 4.7.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.
@@ -1,8 +1,11 @@
1
1
  /**
2
2
  * Prints the current OAuth access token to stdout.
3
3
  *
4
- * Designed for shell substitution: TOKEN=$(bkper auth token)
5
- * Outputs only the raw token string with no extra formatting.
4
+ * When piped or redirected, outputs only the raw token string
5
+ * for shell substitution: TOKEN=$(bkper auth token)
6
+ *
7
+ * When run interactively (TTY), adds a trailing newline so the
8
+ * token doesn't collide with the shell prompt.
6
9
  */
7
10
  export declare function token(): Promise<void>;
8
11
  //# sourceMappingURL=token.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/token.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAO3C"}
1
+ {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/token.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAW3C"}
@@ -11,8 +11,11 @@ import { isLoggedIn, getOAuthToken } from '../../auth/local-auth-service.js';
11
11
  /**
12
12
  * Prints the current OAuth access token to stdout.
13
13
  *
14
- * Designed for shell substitution: TOKEN=$(bkper auth token)
15
- * Outputs only the raw token string with no extra formatting.
14
+ * When piped or redirected, outputs only the raw token string
15
+ * for shell substitution: TOKEN=$(bkper auth token)
16
+ *
17
+ * When run interactively (TTY), adds a trailing newline so the
18
+ * token doesn't collide with the shell prompt.
16
19
  */
17
20
  export function token() {
18
21
  return __awaiter(this, void 0, void 0, function* () {
@@ -21,7 +24,12 @@ export function token() {
21
24
  process.exit(1);
22
25
  }
23
26
  const accessToken = yield getOAuthToken();
24
- process.stdout.write(accessToken);
27
+ if (process.stdout.isTTY) {
28
+ console.log(accessToken);
29
+ }
30
+ else {
31
+ process.stdout.write(accessToken);
32
+ }
25
33
  });
26
34
  }
27
35
  //# sourceMappingURL=token.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/commands/auth/token.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,UAAgB,KAAK;;QACvB,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QACD,MAAM,WAAW,GAAG,MAAM,aAAa,EAAE,CAAC;QAC1C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;CAAA"}
1
+ {"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/commands/auth/token.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAE7E;;;;;;;;GAQG;AACH,MAAM,UAAgB,KAAK;;QACvB,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QACD,MAAM,WAAW,GAAG,MAAM,aAAa,EAAE,CAAC;QAC1C,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC7B,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACtC,CAAC;IACL,CAAC;CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper",
3
- "version": "4.7.0",
3
+ "version": "4.7.1",
4
4
  "description": "Command line client for Bkper",
5
5
  "bin": {
6
6
  "bkper": "./lib/cli.js"