legispro-cli 1.0.7 → 1.0.9
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 +43 -17
- package/bin/dev.cmd +1 -1
- package/bin/dev.js +5 -0
- package/bin/run.js +5 -0
- package/dist/commands/backup/create.js +13 -16
- package/dist/commands/backup/list.js +15 -18
- package/dist/commands/collection/add.d.ts +3 -3
- package/dist/commands/collection/add.js +31 -34
- package/dist/commands/collection/create.d.ts +5 -5
- package/dist/commands/collection/create.js +40 -43
- package/dist/commands/collection/delete.d.ts +1 -1
- package/dist/commands/collection/delete.js +20 -23
- package/dist/commands/collection/download.d.ts +2 -2
- package/dist/commands/collection/download.js +28 -31
- package/dist/commands/collection/get.d.ts +1 -1
- package/dist/commands/collection/get.js +21 -24
- package/dist/commands/collection/list.js +13 -16
- package/dist/commands/collection/perms.d.ts +3 -3
- package/dist/commands/collection/perms.js +29 -32
- package/dist/commands/collection/update.d.ts +7 -7
- package/dist/commands/collection/update.js +50 -54
- package/dist/commands/collection/upload.d.ts +3 -3
- package/dist/commands/collection/upload.js +39 -42
- package/dist/commands/config/get.d.ts +5 -1
- package/dist/commands/config/get.js +7 -10
- package/dist/commands/config/set.d.ts +5 -1
- package/dist/commands/config/set.js +41 -24
- package/dist/commands/db/init.js +18 -21
- package/dist/commands/db/memory.js +10 -12
- package/dist/commands/db/uptime.js +8 -10
- package/dist/commands/db/version.js +8 -10
- package/dist/commands/deploy/index.d.ts +10 -0
- package/dist/commands/deploy/index.js +130 -0
- package/dist/commands/document/copy.js +15 -18
- package/dist/commands/document/list.js +15 -18
- package/dist/commands/group/create.d.ts +5 -5
- package/dist/commands/group/create.js +36 -39
- package/dist/commands/group/delete.d.ts +1 -1
- package/dist/commands/group/delete.js +19 -22
- package/dist/commands/group/get.d.ts +1 -1
- package/dist/commands/group/get.js +20 -23
- package/dist/commands/group/list.js +8 -10
- package/dist/commands/group/update.d.ts +5 -5
- package/dist/commands/group/update.js +36 -39
- package/dist/commands/locks/add.js +16 -18
- package/dist/commands/locks/clear.js +11 -13
- package/dist/commands/services/health.js +11 -14
- package/dist/commands/user/create.d.ts +17 -17
- package/dist/commands/user/create.js +104 -107
- package/dist/commands/user/delete.d.ts +1 -1
- package/dist/commands/user/delete.js +24 -27
- package/dist/commands/user/get.d.ts +1 -1
- package/dist/commands/user/get.js +20 -23
- package/dist/commands/user/list.js +10 -13
- package/dist/commands/user/login.d.ts +2 -2
- package/dist/commands/user/login.js +30 -33
- package/dist/commands/user/update.d.ts +16 -16
- package/dist/commands/user/update.js +108 -111
- package/dist/index.js +1 -5
- package/dist/lib/fusiondb-client.d.ts +2 -1
- package/dist/lib/fusiondb-client.js +19 -18
- package/dist/lib/gh.d.ts +26 -0
- package/dist/lib/gh.js +37 -0
- package/dist/lib/rclone-client.js +12 -15
- package/dist/lib/shell.d.ts +24 -0
- package/dist/lib/shell.js +76 -0
- package/dist/lib/types.js +1 -2
- package/dist/lib/utils.d.ts +2 -2
- package/dist/lib/utils.js +4 -7
- package/dist/lib/xml-templates.js +6 -10
- package/oclif.manifest.json +972 -533
- package/package.json +51 -47
- package/bin/dev +0 -17
- package/bin/run +0 -5
- package/dist/commands/locks/list.d.ts +0 -7
- package/dist/commands/locks/list.js +0 -86
package/package.json
CHANGED
|
@@ -1,94 +1,98 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "legispro-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "LegisPro CLI",
|
|
5
5
|
"author": "bmckinney",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"bin": {
|
|
7
|
-
"legispro": "./bin/run"
|
|
8
|
+
"legispro": "./bin/run.js"
|
|
8
9
|
},
|
|
9
10
|
"homepage": "https://github.com/Xcential-Corporation/legispro-cli",
|
|
10
11
|
"license": "MIT",
|
|
11
12
|
"main": "dist/index.js",
|
|
12
13
|
"files": [
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"/oclif.manifest.json"
|
|
14
|
+
"./bin",
|
|
15
|
+
"./dist",
|
|
16
|
+
"./oclif.manifest.json"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@oclif/core": "^
|
|
20
|
-
"@oclif/plugin-help": "^
|
|
21
|
-
"@oclif/plugin-plugins": "^
|
|
19
|
+
"@oclif/core": "^4",
|
|
20
|
+
"@oclif/plugin-help": "^6",
|
|
21
|
+
"@oclif/plugin-plugins": "^5",
|
|
22
|
+
"@octokit/core": "^6.1.4",
|
|
23
|
+
"@octokit/plugin-rest-endpoint-methods": "^13.3.1",
|
|
22
24
|
"ascii-table": "^0.0.9",
|
|
23
|
-
"axios": "^1.
|
|
24
|
-
"chalk": "^
|
|
25
|
-
"enquirer": "^2.
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"makensis": "^2.0.7",
|
|
29
|
-
"node-emoji": "^2.1.0",
|
|
30
|
-
"node-fetch": "^3.3.1",
|
|
25
|
+
"axios": "^1.8.1",
|
|
26
|
+
"chalk": "^5.4.1",
|
|
27
|
+
"enquirer": "^2.4.1",
|
|
28
|
+
"fs-extra": "^11.3.0",
|
|
29
|
+
"node-ssh": "^13.2.0",
|
|
31
30
|
"ora": "^3.4.0",
|
|
32
|
-
"path": "^0.12.7",
|
|
33
31
|
"rclone.js": "^0.6.6",
|
|
34
|
-
"
|
|
32
|
+
"ssh2": "^1.16.0",
|
|
35
33
|
"treeify": "^1.1.0",
|
|
34
|
+
"unzipper": "^0.12.3",
|
|
36
35
|
"xml2js": "^0.6.0",
|
|
37
36
|
"xmldom": "^0.6.0",
|
|
38
37
|
"xpath": "^0.0.32"
|
|
39
38
|
},
|
|
40
39
|
"devDependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@types/
|
|
45
|
-
"@types/
|
|
46
|
-
"@types/
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
40
|
+
"@eslint/compat": "^1",
|
|
41
|
+
"@oclif/prettier-config": "^0.2.1",
|
|
42
|
+
"@oclif/test": "^4",
|
|
43
|
+
"@types/chai": "^4",
|
|
44
|
+
"@types/fs-extra": "^11.0.4",
|
|
45
|
+
"@types/mocha": "^10",
|
|
46
|
+
"@types/node": "^18",
|
|
47
|
+
"@types/rclone.js": "^0.6.3",
|
|
48
|
+
"@types/ssh2": "^1.15.4",
|
|
49
|
+
"@types/treeify": "^1.0.3",
|
|
50
|
+
"@types/unzipper": "^0.10.10",
|
|
51
|
+
"@types/xml2js": "^0.4.14",
|
|
52
|
+
"@types/xmldom": "^0.1.34",
|
|
53
|
+
"chai": "^4",
|
|
54
|
+
"eslint": "^9",
|
|
55
|
+
"eslint-config-oclif": "^6",
|
|
56
|
+
"eslint-config-prettier": "^10",
|
|
57
|
+
"mocha": "^10",
|
|
58
|
+
"oclif": "^4",
|
|
59
|
+
"rimraf": "^6.0.1",
|
|
60
|
+
"shx": "^0.3.3",
|
|
61
|
+
"ts-node": "^10",
|
|
62
|
+
"typescript": "^5"
|
|
59
63
|
},
|
|
60
64
|
"oclif": {
|
|
61
65
|
"bin": "lp",
|
|
62
66
|
"dirname": "legispro-cli",
|
|
63
67
|
"commands": "./dist/commands",
|
|
68
|
+
"plugins": [
|
|
69
|
+
"@oclif/plugin-help",
|
|
70
|
+
"@oclif/plugin-not-found"
|
|
71
|
+
],
|
|
64
72
|
"topicSeparator": " ",
|
|
65
73
|
"topics": {
|
|
66
74
|
"hello": {
|
|
67
75
|
"description": "Say hello to the world and others"
|
|
68
|
-
}
|
|
69
|
-
"plugins": [
|
|
70
|
-
"@oclif/plugin-help",
|
|
71
|
-
"@oclif/plugin-not-found"
|
|
72
|
-
]
|
|
76
|
+
}
|
|
73
77
|
},
|
|
74
78
|
"macos": {
|
|
75
79
|
"identifier": "com.legispro.cli"
|
|
76
80
|
}
|
|
77
81
|
},
|
|
78
82
|
"scripts": {
|
|
79
|
-
"build": "
|
|
83
|
+
"build": "shx rm -rf dist && tsc -b",
|
|
80
84
|
"build-win": "rimraf tmp && oclif pack win",
|
|
81
85
|
"build-mac": "rimraf tmp && oclif pack macos",
|
|
82
86
|
"build-deb": "rimraf tmp && oclif pack deb",
|
|
83
|
-
"lint": "eslint
|
|
87
|
+
"lint": "eslint",
|
|
84
88
|
"postpack": "shx rm -f oclif.manifest.json",
|
|
85
|
-
"posttest": "
|
|
86
|
-
"prepack": "
|
|
89
|
+
"posttest": "npm run lint",
|
|
90
|
+
"prepack": "oclif manifest && oclif readme",
|
|
87
91
|
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
88
92
|
"version": "oclif readme && git add README.md"
|
|
89
93
|
},
|
|
90
94
|
"engines": {
|
|
91
|
-
"node": ">=
|
|
95
|
+
"node": ">=18.0.0"
|
|
92
96
|
},
|
|
93
97
|
"bugs": "https://github.com/Xcential-Corporation/legispro-cli/issues",
|
|
94
98
|
"keywords": [
|
package/bin/dev
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const oclif = require('@oclif/core')
|
|
4
|
-
|
|
5
|
-
const path = require('path')
|
|
6
|
-
const project = path.join(__dirname, '..', 'tsconfig.json')
|
|
7
|
-
|
|
8
|
-
// In dev mode -> use ts-node and dev plugins
|
|
9
|
-
process.env.NODE_ENV = 'development'
|
|
10
|
-
|
|
11
|
-
require('ts-node').register({project})
|
|
12
|
-
|
|
13
|
-
// In dev mode, always show stack traces
|
|
14
|
-
oclif.settings.debug = true;
|
|
15
|
-
|
|
16
|
-
// Start the CLI
|
|
17
|
-
oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
|
package/bin/run
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const core_1 = require("@oclif/core");
|
|
4
|
-
const utils_1 = require("../../lib/utils");
|
|
5
|
-
const AsciiTable = require('ascii-table');
|
|
6
|
-
const xpath = require('xpath');
|
|
7
|
-
const dom = require('xmldom').DOMParser;
|
|
8
|
-
class LocksList extends core_1.Command {
|
|
9
|
-
async run() {
|
|
10
|
-
utils_1.client.setConfig(this);
|
|
11
|
-
// [1] EXPIRED LOCKS
|
|
12
|
-
let response_expired = await utils_1.client.listExpiredLocks();
|
|
13
|
-
if (response_expired.status == 200) {
|
|
14
|
-
// this.log(response_expired.data);
|
|
15
|
-
let doc = new dom().parseFromString(response_expired.data, "application/xml");
|
|
16
|
-
let select = xpath.useNamespaces({
|
|
17
|
-
exist: "http://exist.sourceforge.net/NS/exist",
|
|
18
|
-
d: "DAV:",
|
|
19
|
-
locks: "http://www.xcential.com/schemas/locks/1.0"
|
|
20
|
-
});
|
|
21
|
-
let locks = [];
|
|
22
|
-
let table = new AsciiTable();
|
|
23
|
-
table.setHeading('URI', 'OWNER', 'EXPIRES');
|
|
24
|
-
let expired_count = 0;
|
|
25
|
-
for (let i = 0; i < doc.documentElement.childNodes.length; i++) {
|
|
26
|
-
let owner = select("string(/exist:result/locks:context[" + i + "]/d:activelock/d:owner/text())", doc)[0].toString();
|
|
27
|
-
let expires = select("string(/exist:result/locks:context[" + i + "]/@lockExpires)", doc)[0].toString();
|
|
28
|
-
let uri = select("string(/exist:result/locks:context[" + i + "]/@uri)", doc)[0].toString();
|
|
29
|
-
if (owner.length > 0) {
|
|
30
|
-
expired_count++;
|
|
31
|
-
let lock = {
|
|
32
|
-
uri: uri,
|
|
33
|
-
owner: owner,
|
|
34
|
-
expires: expires
|
|
35
|
-
};
|
|
36
|
-
locks.push(lock);
|
|
37
|
-
table.addRow(uri, owner, expires);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (expired_count == 0) {
|
|
41
|
-
table.addRow("", "", "");
|
|
42
|
-
}
|
|
43
|
-
table.setTitle('Expired Locks (' + expired_count + ')');
|
|
44
|
-
this.log(table.toString());
|
|
45
|
-
}
|
|
46
|
-
// [2] ACTIVE LOCKS
|
|
47
|
-
let response_active = await utils_1.client.listActiveLocks();
|
|
48
|
-
if (response_active.status == 200) {
|
|
49
|
-
let doc = new dom().parseFromString(response_active.data, "application/xml");
|
|
50
|
-
let select = xpath.useNamespaces({
|
|
51
|
-
exist: "http://exist.sourceforge.net/NS/exist",
|
|
52
|
-
d: "DAV:",
|
|
53
|
-
locks: "http://www.xcential.com/schemas/locks/1.0"
|
|
54
|
-
});
|
|
55
|
-
let locks = [];
|
|
56
|
-
let table = new AsciiTable();
|
|
57
|
-
table.setHeading('URI', 'OWNER', 'EXPIRES');
|
|
58
|
-
let active_count = 0;
|
|
59
|
-
for (let i = 0; i < doc.documentElement.childNodes.length; i++) {
|
|
60
|
-
let owner = select("string(/exist:result/locks:context[" + i + "]/d:activelock/d:owner/text())", doc)[0].toString();
|
|
61
|
-
let expires = select("string(/exist:result/locks:context[" + i + "]/@lockExpires)", doc)[0].toString();
|
|
62
|
-
let uri = select("string(/exist:result/locks:context[" + i + "]/@uri)", doc)[0].toString();
|
|
63
|
-
if (owner.length > 0) {
|
|
64
|
-
active_count++;
|
|
65
|
-
let lock = {
|
|
66
|
-
uri: uri,
|
|
67
|
-
owner: owner,
|
|
68
|
-
expires: expires
|
|
69
|
-
};
|
|
70
|
-
locks.push(lock);
|
|
71
|
-
table.addRow(uri, owner, expires);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// empty table
|
|
75
|
-
if (active_count == 0) {
|
|
76
|
-
table.addRow("", "", "");
|
|
77
|
-
}
|
|
78
|
-
table.setTitle('Active Locks (' + active_count + ')');
|
|
79
|
-
this.log(table.toString());
|
|
80
|
-
}
|
|
81
|
-
this.exit();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
LocksList.description = "List active and expired locks";
|
|
85
|
-
LocksList.examples = [`$ legispro locks:list`,];
|
|
86
|
-
exports.default = LocksList;
|