@openbkn/bkn-sdk 0.1.1-alpha.4 → 0.1.1-alpha.5
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/cli.js
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
fetchAuthStatus,
|
|
19
19
|
formatError,
|
|
20
20
|
getUserSafe,
|
|
21
|
+
isHeadless,
|
|
21
22
|
listPlatforms,
|
|
22
23
|
logout,
|
|
23
24
|
openBrowser,
|
|
@@ -35,7 +36,7 @@ import {
|
|
|
35
36
|
use,
|
|
36
37
|
whoami,
|
|
37
38
|
writePlatformConfig
|
|
38
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-67GKXAWG.js";
|
|
39
40
|
|
|
40
41
|
// src/cli.ts
|
|
41
42
|
import { Command as Command16 } from "commander";
|
|
@@ -43,7 +44,7 @@ import { Command as Command16 } from "commander";
|
|
|
43
44
|
// package.json
|
|
44
45
|
var package_default = {
|
|
45
46
|
name: "@openbkn/bkn-sdk",
|
|
46
|
-
version: "0.1.1-alpha.
|
|
47
|
+
version: "0.1.1-alpha.5",
|
|
47
48
|
description: "Unified TypeScript SDK + CLI for the BKN (Business Knowledge Network) platform.",
|
|
48
49
|
type: "module",
|
|
49
50
|
license: "Apache-2.0",
|
|
@@ -449,7 +450,8 @@ function registerAuthLeaves(cmd) {
|
|
|
449
450
|
timeoutMs: opts.timeout * 1e3
|
|
450
451
|
});
|
|
451
452
|
} else {
|
|
452
|
-
const
|
|
453
|
+
const headless = isHeadless();
|
|
454
|
+
const openInBrowser = !opts.device && opts.browser !== false && !headless;
|
|
453
455
|
tokens = await deviceLogin(url, {
|
|
454
456
|
clientId: opts.clientId,
|
|
455
457
|
audience: opts.audience,
|
|
@@ -464,6 +466,8 @@ User code: ${userCode}
|
|
|
464
466
|
`
|
|
465
467
|
);
|
|
466
468
|
if (openInBrowser) openBrowser(target);
|
|
469
|
+
else if (headless && !opts.device && opts.browser !== false)
|
|
470
|
+
process.stderr.write("(headless \u2014 approve on any machine with a browser)\n");
|
|
467
471
|
process.stderr.write("Waiting for authorization\u2026\n");
|
|
468
472
|
}
|
|
469
473
|
});
|