autho 0.0.10 → 0.0.12
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/build/bin.js +26 -8
- package/package.json +14 -14
package/build/bin.js
CHANGED
|
@@ -23161,7 +23161,7 @@ var require_bl = __commonJS({
|
|
|
23161
23161
|
var require_ora = __commonJS({
|
|
23162
23162
|
"node_modules/.pnpm/ora@5.4.1/node_modules/ora/index.js"(exports2, module2) {
|
|
23163
23163
|
"use strict";
|
|
23164
|
-
var
|
|
23164
|
+
var readline3 = require("readline");
|
|
23165
23165
|
var chalk2 = require_source();
|
|
23166
23166
|
var cliCursor3 = require_cli_cursor();
|
|
23167
23167
|
var cliSpinners = require_cli_spinners();
|
|
@@ -23214,7 +23214,7 @@ var require_ora = __commonJS({
|
|
|
23214
23214
|
if (process.platform === "win32") {
|
|
23215
23215
|
return;
|
|
23216
23216
|
}
|
|
23217
|
-
this.rl =
|
|
23217
|
+
this.rl = readline3.createInterface({
|
|
23218
23218
|
input: process.stdin,
|
|
23219
23219
|
output: this.mutedStream
|
|
23220
23220
|
});
|
|
@@ -58790,7 +58790,7 @@ var App = class {
|
|
|
58790
58790
|
constructor(options = {}) {
|
|
58791
58791
|
this.encryptionKey = options.encryptionKey || config_default.masterPasswordHash;
|
|
58792
58792
|
this.dataFolder = options.dataFolder || config_default.dataFolder;
|
|
58793
|
-
this.name = options.name ||
|
|
58793
|
+
this.name = options.name || config_default.name;
|
|
58794
58794
|
this.db = new DB({
|
|
58795
58795
|
encryptionKey: this.encryptionKey,
|
|
58796
58796
|
dataFolder: this.dataFolder,
|
|
@@ -58800,6 +58800,7 @@ var App = class {
|
|
|
58800
58800
|
}
|
|
58801
58801
|
static async masterKey(masterPassword, masterPasswordHash) {
|
|
58802
58802
|
masterPassword = masterPassword || config_default.masterPassword;
|
|
58803
|
+
masterPasswordHash = masterPasswordHash || config_default.masterPasswordHash;
|
|
58803
58804
|
if (masterPasswordHash) {
|
|
58804
58805
|
return masterPasswordHash;
|
|
58805
58806
|
} else if (!masterPassword) {
|
|
@@ -59600,6 +59601,7 @@ var logger = new import_baloga.Logger();
|
|
|
59600
59601
|
var Logger = import_baloga.Logger;
|
|
59601
59602
|
|
|
59602
59603
|
// packages/cli/bin.js
|
|
59604
|
+
var import_readline = __toESM(require("readline"), 1);
|
|
59603
59605
|
var logger2 = new Logger();
|
|
59604
59606
|
var program2 = new Command();
|
|
59605
59607
|
var getAuthoAbsolutePath = (path5) => {
|
|
@@ -59620,7 +59622,25 @@ var basename = (filePath) => {
|
|
|
59620
59622
|
const folderName = import_path2.default.basename(normalizedPath);
|
|
59621
59623
|
return folderName;
|
|
59622
59624
|
};
|
|
59623
|
-
|
|
59625
|
+
function printLine(text, cursorTo = 0, moveCursor = 0) {
|
|
59626
|
+
import_readline.default.cursorTo(process.stdout, cursorTo);
|
|
59627
|
+
process.stdout.write(text + " ");
|
|
59628
|
+
import_readline.default.moveCursor(process.stdout, cursorTo, moveCursor);
|
|
59629
|
+
}
|
|
59630
|
+
var countDown = async (textStart, textEnd, seconds) => {
|
|
59631
|
+
return new Promise((resolve) => {
|
|
59632
|
+
const interval = setInterval(() => {
|
|
59633
|
+
printLine(textStart + seconds + "s");
|
|
59634
|
+
seconds--;
|
|
59635
|
+
if (seconds < 0) {
|
|
59636
|
+
printLine(textEnd);
|
|
59637
|
+
clearInterval(interval);
|
|
59638
|
+
resolve();
|
|
59639
|
+
}
|
|
59640
|
+
}, 1e3);
|
|
59641
|
+
});
|
|
59642
|
+
};
|
|
59643
|
+
program2.name("autho").description("Secrets manager").version("0.0.10").option("-p, --password <password>", "Master password").option("-ph, --passwordHash <passwordHash>", "Master password hash").option("-n, --name <name>", "Collection name").option(
|
|
59624
59644
|
"-data, --dataFolder <folderPath>",
|
|
59625
59645
|
"Folder path to store secrets db",
|
|
59626
59646
|
getAuthoAbsolutePath
|
|
@@ -59668,10 +59688,8 @@ program2.name("autho").description("Secrets manager").version("0.0.1").option("-
|
|
|
59668
59688
|
{
|
|
59669
59689
|
const otp = new OTP(readSecret);
|
|
59670
59690
|
console.log("OTP code:", otp.generate());
|
|
59671
|
-
|
|
59672
|
-
|
|
59673
|
-
process.exit(0);
|
|
59674
|
-
}, 3e4);
|
|
59691
|
+
await countDown("Expired at: ", "The code is not longer valid, please generate new code.", 30);
|
|
59692
|
+
process.exit(0);
|
|
59675
59693
|
}
|
|
59676
59694
|
break;
|
|
59677
59695
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autho",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"main": "build/bin.js",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
7
7
|
"autho": "build/bin.js"
|
|
8
8
|
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"format": "prettier --check .",
|
|
11
|
+
"format:write": "prettier --write .",
|
|
12
|
+
"lint": "eslint .",
|
|
13
|
+
"lint:fix": "eslint --fix .",
|
|
14
|
+
"build": "esbuild packages/cli/bin.js --bundle --platform=node --target=node18 --outdir=build",
|
|
15
|
+
"pkg": "npm run pkg:linux && npm run pkg:macos && npm run pkg:win",
|
|
16
|
+
"pkg:macos-arm64": "pkg build/bin.js --output dist/autho --target node18-macos-arm64",
|
|
17
|
+
"pkg:macos": "pkg build/bin.js --output dist/autho-macos --target node18-macos-x64",
|
|
18
|
+
"pkg:linux": "pkg build/bin.js --output dist/autho-linux --target node18-linux-x64",
|
|
19
|
+
"pkg:win": "pkg build/bin.js --output dist/autho-win --target node18-win-x64 --win portable",
|
|
20
|
+
"release": "gh release create v0.0.10 './dist/autho*' --title 'v0.0.10' --generate-notes --prerelease"
|
|
21
|
+
},
|
|
9
22
|
"keywords": [
|
|
10
23
|
"secrets",
|
|
11
24
|
"otp"
|
|
@@ -36,18 +49,5 @@
|
|
|
36
49
|
"node18-macos-x64"
|
|
37
50
|
],
|
|
38
51
|
"outputPath": "dist"
|
|
39
|
-
},
|
|
40
|
-
"scripts": {
|
|
41
|
-
"format": "prettier --check .",
|
|
42
|
-
"format:write": "prettier --write .",
|
|
43
|
-
"lint": "eslint .",
|
|
44
|
-
"lint:fix": "eslint --fix .",
|
|
45
|
-
"build": "esbuild packages/cli/bin.js --bundle --platform=node --target=node18 --outdir=build",
|
|
46
|
-
"pkg": "npm run pkg:linux && npm run pkg:macos && npm run pkg:win",
|
|
47
|
-
"pkg:macos-arm64": "pkg build/bin.js --output dist/autho --target node18-macos-arm64",
|
|
48
|
-
"pkg:macos": "pkg build/bin.js --output dist/autho-macos --target node18-macos-x64",
|
|
49
|
-
"pkg:linux": "pkg build/bin.js --output dist/autho-linux --target node18-linux-x64",
|
|
50
|
-
"pkg:win": "pkg build/bin.js --output dist/autho-win --target node18-win-x64",
|
|
51
|
-
"release": "gh release create v0.0.8 ./dist/* --title 'v0.0.8' --generate-notes --prerelease"
|
|
52
52
|
}
|
|
53
53
|
}
|