@prosopo/datasets-fs 2.5.5 → 2.6.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/CHANGELOG.md +28 -0
- package/dist/cjs/cli/cli.cjs +58 -0
- package/dist/cjs/index.cjs +4 -0
- package/package.json +7 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @prosopo/datasets-fs
|
|
2
|
+
|
|
3
|
+
## 2.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [6ff193a]
|
|
8
|
+
- @prosopo/types@2.6.2
|
|
9
|
+
|
|
10
|
+
## 2.6.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [52feffc]
|
|
15
|
+
- @prosopo/types@2.6.1
|
|
16
|
+
|
|
17
|
+
## 2.6.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- a0bfc8a: bump all pkg versions since independent versioning applied
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [a0bfc8a]
|
|
26
|
+
- @prosopo/common@2.6.0
|
|
27
|
+
- @prosopo/types@2.6.0
|
|
28
|
+
- @prosopo/util@2.6.0
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const common = require("@prosopo/common");
|
|
4
|
+
const yargs = require("yargs");
|
|
5
|
+
const helpers = require("yargs/helpers");
|
|
6
|
+
const dirname = process.cwd();
|
|
7
|
+
const logger = common.getLogger(common.LogLevel.enum.info, `${dirname}`);
|
|
8
|
+
class Cli extends common.Loggable {
|
|
9
|
+
#commands;
|
|
10
|
+
constructor(commands) {
|
|
11
|
+
super();
|
|
12
|
+
this.#commands = commands;
|
|
13
|
+
this.logger = logger;
|
|
14
|
+
}
|
|
15
|
+
config() {
|
|
16
|
+
let y = yargs(helpers.hideBin(process.argv)).option("log-level", {
|
|
17
|
+
type: "string",
|
|
18
|
+
choices: Object.values(common.LogLevel.options),
|
|
19
|
+
default: common.LogLevel.enum.info,
|
|
20
|
+
description: "The log level"
|
|
21
|
+
}).middleware((argv) => {
|
|
22
|
+
this.logger.setLogLevel(argv.logLevel);
|
|
23
|
+
}, true);
|
|
24
|
+
for (const command of this.#commands) {
|
|
25
|
+
y = y.command({
|
|
26
|
+
command: command.getCommandName(),
|
|
27
|
+
describe: command.getDescription(),
|
|
28
|
+
builder: command.getOptions(),
|
|
29
|
+
// biome-ignore lint/suspicious/noExplicitAny: TODO fix
|
|
30
|
+
handler: async (argv) => {
|
|
31
|
+
this.logger.debug(`running ${command.getCommandName()}}`);
|
|
32
|
+
const args = await command.parse(argv);
|
|
33
|
+
await command.exec(args);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (!this.#commands.find((c) => c.getCommandName() === "$0")) {
|
|
38
|
+
y = y.command(
|
|
39
|
+
"$0",
|
|
40
|
+
"default command",
|
|
41
|
+
(y2) => y2,
|
|
42
|
+
() => {
|
|
43
|
+
throw new common.ProsopoCliError("CLI.PARAMETER_ERROR", {
|
|
44
|
+
context: { error: "no command specified" }
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
y = y.demandCommand().strict().showHelpOnFail(false, "Specify --help for available options");
|
|
50
|
+
return y;
|
|
51
|
+
}
|
|
52
|
+
async exec(args = process.argv.slice(2)) {
|
|
53
|
+
const config = this.config();
|
|
54
|
+
this.logger.debug("parsing", args);
|
|
55
|
+
await config.parse(args);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.Cli = Cli;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/datasets-fs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"author": "PROSOPO LIMITED <info@prosopo.io>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"private": false,
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"@noble/hashes": "1.5.0",
|
|
29
29
|
"@polkadot/util": "12.6.2",
|
|
30
30
|
"@polkadot/util-crypto": "12.6.2",
|
|
31
|
-
"@prosopo/common": "2.
|
|
32
|
-
"@prosopo/types": "2.
|
|
33
|
-
"@prosopo/util": "2.
|
|
31
|
+
"@prosopo/common": "2.6.0",
|
|
32
|
+
"@prosopo/types": "2.6.2",
|
|
33
|
+
"@prosopo/util": "2.6.0",
|
|
34
34
|
"bcrypt": "5.1.1",
|
|
35
35
|
"cli-progress": "3.12.0",
|
|
36
36
|
"express": "4.21.2",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"zod": "3.23.8"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@prosopo/config": "2.
|
|
42
|
+
"@prosopo/config": "2.6.0",
|
|
43
43
|
"@types/bcrypt": "5.0.2",
|
|
44
44
|
"@types/cli-progress": "3.11.6",
|
|
45
45
|
"@vitest/coverage-v8": "3.0.9",
|
|
@@ -55,7 +55,8 @@
|
|
|
55
55
|
},
|
|
56
56
|
"repository": {
|
|
57
57
|
"type": "git",
|
|
58
|
-
"url": "git+https://github.com/prosopo/captcha.git"
|
|
58
|
+
"url": "git+https://github.com/prosopo/captcha.git",
|
|
59
|
+
"directory": "packages/datasets-fs"
|
|
59
60
|
},
|
|
60
61
|
"bugs": {
|
|
61
62
|
"url": "https://github.com/prosopo/captcha/issues"
|