@almyty/credentials 1.5.0 → 1.5.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.
- package/dist/index.d.ts +7 -0
- package/dist/index.js +19 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -62,3 +62,10 @@ export declare function unscreenableInputMessage(): string;
|
|
|
62
62
|
* provider then rejected for a reason that had nothing to do with the key.
|
|
63
63
|
*/
|
|
64
64
|
export declare function requireTty(what: string, isTty?: boolean): void;
|
|
65
|
+
/**
|
|
66
|
+
* True when `argv1` is this module, directly or through the npm bin
|
|
67
|
+
* symlink. The old check matched the path against a regex and bailed out
|
|
68
|
+
* when VITEST was set, so a smoke test that spawned the built CLI from
|
|
69
|
+
* vitest inherited VITEST and got no output at all.
|
|
70
|
+
*/
|
|
71
|
+
export declare function isEntrypoint(argv1: string | undefined, moduleUrl: string): boolean;
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* `--input` stays for non-secret fields and is refused for secret ones.
|
|
16
16
|
*/
|
|
17
17
|
import { createInterface } from 'readline';
|
|
18
|
-
import { readFileSync } from 'fs';
|
|
18
|
+
import { readFileSync, realpathSync } from 'fs';
|
|
19
|
+
import { fileURLToPath } from 'url';
|
|
19
20
|
import { AlmytyClient, resolveCredentialsOrExit } from '@almyty/client';
|
|
20
21
|
import { EXIT, EXIT_CODE_HELP, UsageError, describeError, exitCodeFor } from './exit-codes.js';
|
|
21
22
|
import { VERSION } from './version.js';
|
|
@@ -580,8 +581,23 @@ async function main() {
|
|
|
580
581
|
process.exit(EXIT.USAGE);
|
|
581
582
|
}
|
|
582
583
|
}
|
|
583
|
-
|
|
584
|
-
|
|
584
|
+
/**
|
|
585
|
+
* True when `argv1` is this module, directly or through the npm bin
|
|
586
|
+
* symlink. The old check matched the path against a regex and bailed out
|
|
587
|
+
* when VITEST was set, so a smoke test that spawned the built CLI from
|
|
588
|
+
* vitest inherited VITEST and got no output at all.
|
|
589
|
+
*/
|
|
590
|
+
export function isEntrypoint(argv1, moduleUrl) {
|
|
591
|
+
if (!argv1)
|
|
592
|
+
return false;
|
|
593
|
+
try {
|
|
594
|
+
return realpathSync(argv1) === realpathSync(fileURLToPath(moduleUrl));
|
|
595
|
+
}
|
|
596
|
+
catch {
|
|
597
|
+
return false;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
if (isEntrypoint(process.argv[1], import.meta.url)) {
|
|
585
601
|
main().catch((err) => {
|
|
586
602
|
console.error(describeError(err, process.env.ALMYTY_URL));
|
|
587
603
|
process.exit(exitCodeFor(err));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almyty/credentials",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"author": "almyty",
|
|
29
29
|
"license": "Apache-2.0",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@almyty/client": "^1.
|
|
31
|
+
"@almyty/client": "^1.5.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "^25.4.0",
|