@ps-aux/nodebup 0.1.0 → 0.2.2
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/README.md +0 -0
- package/lib/bup/AggregateBackupController.js +84 -0
- package/lib/cli/app.js +55 -0
- package/lib/cli/bin.js +2 -8
- package/lib/config/Config.js +58 -0
- package/lib/config/expandAndCreatePath.js +24 -0
- package/lib/config/validateConfigAgainstSchema.js +65 -0
- package/lib/config/validateConfigAgainstSchema.spec.js +29 -0
- package/lib/ctx/Context.js +23 -16
- package/lib/ctx/ContextSymbols.js +14 -0
- package/lib/fs/Fs.js +81 -0
- package/lib/fs/areDirsSame.js +20 -0
- package/lib/fs/areDirsSame.test.js +20 -0
- package/lib/fs/fssync/FsSync.spec.js +37 -0
- package/lib/fs/fssync/FsSyncer.js +54 -0
- package/lib/fs/path/Path.js +59 -0
- package/lib/fs/readYaml.js +20 -0
- package/lib/globald.d.js +3 -0
- package/lib/log/AppLogger.js +28 -0
- package/lib/log/MinimalLogger.js +10 -4
- package/lib/storage/StorageBackendProvider.js +53 -0
- package/lib/storage/local-file/LocalFileStorageBackend.js +22 -0
- package/lib/storage/restic/ResticClient.js +86 -0
- package/lib/storage/restic/ResticClient.spec.js +96 -0
- package/lib/storage/restic/ResticClientFactory.js +77 -0
- package/lib/storage/restic/ResticController.js +39 -0
- package/lib/storage/restic/ResticStorageBackend.js +23 -0
- package/lib/storage/types.d.js +5 -0
- package/lib/tools/gpg/Gpg.js +28 -0
- package/lib/tools/gpg/Gpg.spec.js +14 -0
- package/lib/tools/shell/Shell.js +52 -0
- package/lib/{shell → tools/shell}/shellCmd.js +4 -2
- package/lib/tools/ssh/SshKeyManager.js +36 -0
- package/lib/tools/ssh/SshKeyManager.spec.js +14 -0
- package/lib/types.js +5 -0
- package/package.json +53 -48
- package/lib/cli/entrypoint.js +0 -27
- package/lib/foo/foo.command.js +0 -16
- package/lib/shell/LocalShellCmdExecutor.js +0 -46
- package/lib/types.d.js +0 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ps-aux/nodebup",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.2.2",
|
4
4
|
"description": "",
|
5
5
|
"module": "lib/index.js",
|
6
6
|
"main": "lib/index.js",
|
@@ -8,11 +8,13 @@
|
|
8
8
|
"build": "rm -rf build && babel --extensions '.ts,.js' src -d lib src",
|
9
9
|
"pub": "npm publish --access public",
|
10
10
|
"test": "jest",
|
11
|
-
"
|
11
|
+
"tc": "tsc --noEmit",
|
12
12
|
"format": "prettier \"**/*.{js,ts,tsx}\" --write",
|
13
13
|
"build-n-run": "npm run build && ",
|
14
14
|
"lint": "eslint '**/*.{js,ts,tsx}' --fix",
|
15
|
-
"update-deps": "ncu --upgrade"
|
15
|
+
"update-deps": "ncu --upgrade",
|
16
|
+
"prepare": "husky install",
|
17
|
+
"pre-commit": "lint-staged"
|
16
18
|
},
|
17
19
|
"keywords": [],
|
18
20
|
"author": "",
|
@@ -25,58 +27,61 @@
|
|
25
27
|
},
|
26
28
|
"typings": "src/types.d.ts",
|
27
29
|
"devDependencies": {
|
28
|
-
"@babel/cli": "^7.
|
29
|
-
"@babel/core": "^7.
|
30
|
-
"@babel/
|
31
|
-
"@babel/
|
32
|
-
"@babel/plugin-proposal-
|
33
|
-
"@babel/plugin-proposal-
|
34
|
-
"@babel/
|
35
|
-
"@babel/
|
36
|
-
"@
|
37
|
-
"@
|
38
|
-
"@types/
|
39
|
-
"@types/
|
40
|
-
"@
|
41
|
-
"@
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"babel-plugin-module-resolver": "^4.
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"eslint
|
48
|
-
"eslint-
|
49
|
-
"eslint-plugin-
|
50
|
-
"eslint-plugin-
|
51
|
-
"eslint-plugin-
|
52
|
-
"
|
53
|
-
"
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"
|
57
|
-
"
|
58
|
-
"
|
59
|
-
|
60
|
-
|
61
|
-
"
|
62
|
-
|
63
|
-
}
|
30
|
+
"@babel/cli": "^7.16.0",
|
31
|
+
"@babel/core": "^7.16.5",
|
32
|
+
"@babel/eslint-parser": "^7.16.5",
|
33
|
+
"@babel/node": "^7.16.5",
|
34
|
+
"@babel/plugin-proposal-class-properties": "^7.16.5",
|
35
|
+
"@babel/plugin-proposal-decorators": "^7.16.5",
|
36
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.16.5",
|
37
|
+
"@babel/plugin-proposal-optional-chaining": "^7.16.5",
|
38
|
+
"@babel/preset-env": "^7.16.5",
|
39
|
+
"@babel/preset-typescript": "^7.16.5",
|
40
|
+
"@types/jest": "^27.0.3",
|
41
|
+
"@types/jest-when": "^2.7.4",
|
42
|
+
"@types/node": "^17.0.5",
|
43
|
+
"@types/ramda": "^0.27.62",
|
44
|
+
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
45
|
+
"@typescript-eslint/parser": "^5.8.1",
|
46
|
+
"babel-plugin-module-resolver": "^4.1.0",
|
47
|
+
"babel-plugin-transform-typescript-metadata": "^0.3.2",
|
48
|
+
"dir-compare": "^4.0.0",
|
49
|
+
"eslint": "^8.5.0",
|
50
|
+
"eslint-config-standard": "^16.0.3",
|
51
|
+
"eslint-plugin-import": "^2.25.3",
|
52
|
+
"eslint-plugin-node": "^11.1.0",
|
53
|
+
"eslint-plugin-prettier": "^4.0.0",
|
54
|
+
"eslint-plugin-promise": "^6.0.0",
|
55
|
+
"eslint-plugin-standard": "^5.0.0",
|
56
|
+
"husky": "^7.0.4",
|
57
|
+
"jest": "^27.4.5",
|
58
|
+
"jest-extended": "^1.2.0",
|
59
|
+
"jest-when": "^3.5.0",
|
60
|
+
"lint-staged": "^12.1.4",
|
61
|
+
"npm-check-updates": "^12.0.5",
|
62
|
+
"prettier": "^2.5.1",
|
63
|
+
"ts-jest": "^27.1.2",
|
64
|
+
"typescript": "^4.5.4"
|
64
65
|
},
|
65
66
|
"lint-staged": {
|
66
67
|
"./**/*.{js,ts,tsx}": [
|
67
68
|
"prettier --write",
|
68
|
-
"eslint --fix"
|
69
|
-
"git add"
|
69
|
+
"eslint --fix"
|
70
70
|
]
|
71
71
|
},
|
72
72
|
"dependencies": {
|
73
73
|
"@hapi/joi": "^17.1.1",
|
74
|
-
"@
|
75
|
-
"
|
76
|
-
"
|
77
|
-
"
|
78
|
-
"
|
79
|
-
"
|
80
|
-
"
|
74
|
+
"@ps-aux/nclif": "^0.0.6-alpha.2",
|
75
|
+
"@types/hapi__joi": "^17.1.8",
|
76
|
+
"axios": "^0.24.0",
|
77
|
+
"handlebars": "^4.7.7",
|
78
|
+
"inversify": "^6.0.1",
|
79
|
+
"js-yaml": "^4.1.0",
|
80
|
+
"pino": "^7.6.2",
|
81
|
+
"ramda": "^0.27.1",
|
82
|
+
"reflect-metadata": "^0.1.13",
|
83
|
+
"wait-on": "^6.0.0",
|
84
|
+
"yaml": "^1.10.2",
|
85
|
+
"yargs": "^17.3.1"
|
81
86
|
}
|
82
87
|
}
|
package/lib/cli/entrypoint.js
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
|
8
|
-
var _yargs = _interopRequireDefault(require("yargs"));
|
9
|
-
|
10
|
-
var _foo = require("../foo/foo.command");
|
11
|
-
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
-
|
14
|
-
const entrypoint = ctx => {
|
15
|
-
try {
|
16
|
-
// eslint-disable-next-line no-unused-expressions
|
17
|
-
_yargs.default.scriptName('bup').usage('$0 <cmd> [args]').command((0, _foo.fooCmd)()).alias('h', 'help').help() // https://github.com/yargs/yargs/issues/895#issuecomment-392893305
|
18
|
-
.demandCommand().recommendCommands().strict().argv;
|
19
|
-
} catch (err) {
|
20
|
-
console.log(err);
|
21
|
-
console.error('Error:', err.message);
|
22
|
-
process.exit(1);
|
23
|
-
}
|
24
|
-
};
|
25
|
-
|
26
|
-
var _default = entrypoint;
|
27
|
-
exports.default = _default;
|
package/lib/foo/foo.command.js
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.fooCmd = void 0;
|
7
|
-
|
8
|
-
const fooCmd = () => ({
|
9
|
-
command: 'foo',
|
10
|
-
describe: 'Do foo',
|
11
|
-
handler: args => {
|
12
|
-
console.log('haha'); // throw new Error('Assertion error')
|
13
|
-
}
|
14
|
-
});
|
15
|
-
|
16
|
-
exports.fooCmd = fooCmd;
|
@@ -1,46 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.LocalShellCmdExecutor = void 0;
|
7
|
-
|
8
|
-
var _MinimalLogger = require("../log/MinimalLogger");
|
9
|
-
|
10
|
-
var _shellCmd = require("./shellCmd");
|
11
|
-
|
12
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
13
|
-
|
14
|
-
class LocalShellCmdExecutor {
|
15
|
-
constructor(log) {
|
16
|
-
_defineProperty(this, "log", void 0);
|
17
|
-
|
18
|
-
_defineProperty(this, "exec", cmd => {
|
19
|
-
this.log.debug(cmd);
|
20
|
-
(0, _shellCmd.shellCmd)(cmd, {
|
21
|
-
returnStdout: false
|
22
|
-
});
|
23
|
-
});
|
24
|
-
|
25
|
-
_defineProperty(this, "execWithStdIn", (cmd, stdin) => {
|
26
|
-
this.log.debug(`"${stdin}" > ${cmd}`);
|
27
|
-
(0, _shellCmd.shellCmd)(cmd, {
|
28
|
-
stdin,
|
29
|
-
returnStdout: false
|
30
|
-
});
|
31
|
-
});
|
32
|
-
|
33
|
-
_defineProperty(this, "execAndReturnVal", (cmd, ops) => {
|
34
|
-
this.log.debug(cmd, '[stdout consumed]');
|
35
|
-
return (0, _shellCmd.shellCmd)(cmd, {
|
36
|
-
returnStdout: true,
|
37
|
-
...ops
|
38
|
-
});
|
39
|
-
});
|
40
|
-
|
41
|
-
this.log = log || (0, _MinimalLogger.minimalLogger)();
|
42
|
-
}
|
43
|
-
|
44
|
-
}
|
45
|
-
|
46
|
-
exports.LocalShellCmdExecutor = LocalShellCmdExecutor;
|
package/lib/types.d.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";
|