@prosopo/datasets-fs 3.0.5 → 3.0.7

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/cli/cli.js +51 -51
  3. package/dist/index.js +4 -2
  4. package/dist/tests/data/flat_resized/labels.json +11 -11
  5. package/dist/tests/data/flat_resized/relocated_data.json +362 -362
  6. package/package.json +15 -12
  7. package/vite.cjs.config.ts +4 -1
  8. package/vite.esm.config.ts +20 -0
  9. package/dist/cli/cli.d.ts +0 -9
  10. package/dist/cli/cli.d.ts.map +0 -1
  11. package/dist/cli/cli.js.map +0 -1
  12. package/dist/cli/cliCommand.d.ts +0 -17
  13. package/dist/cli/cliCommand.d.ts.map +0 -1
  14. package/dist/cli/cliCommand.js +0 -31
  15. package/dist/cli/cliCommand.js.map +0 -1
  16. package/dist/cli/cliCommandComposite.d.ts +0 -14
  17. package/dist/cli/cliCommandComposite.d.ts.map +0 -1
  18. package/dist/cli/cliCommandComposite.js +0 -32
  19. package/dist/cli/cliCommandComposite.js.map +0 -1
  20. package/dist/cli.d.ts +0 -2
  21. package/dist/cli.d.ts.map +0 -1
  22. package/dist/cli.js +0 -34
  23. package/dist/cli.js.map +0 -1
  24. package/dist/commands/flatten.d.ts +0 -59
  25. package/dist/commands/flatten.d.ts.map +0 -1
  26. package/dist/commands/flatten.js +0 -97
  27. package/dist/commands/flatten.js.map +0 -1
  28. package/dist/commands/generate.d.ts +0 -115
  29. package/dist/commands/generate.d.ts.map +0 -1
  30. package/dist/commands/generate.js +0 -150
  31. package/dist/commands/generate.js.map +0 -1
  32. package/dist/commands/generateV1.d.ts +0 -179
  33. package/dist/commands/generateV1.d.ts.map +0 -1
  34. package/dist/commands/generateV1.js +0 -169
  35. package/dist/commands/generateV1.js.map +0 -1
  36. package/dist/commands/generateV2.d.ts +0 -189
  37. package/dist/commands/generateV2.d.ts.map +0 -1
  38. package/dist/commands/generateV2.js +0 -200
  39. package/dist/commands/generateV2.js.map +0 -1
  40. package/dist/commands/get.d.ts +0 -35
  41. package/dist/commands/get.d.ts.map +0 -1
  42. package/dist/commands/get.js +0 -92
  43. package/dist/commands/get.js.map +0 -1
  44. package/dist/commands/labels.d.ts +0 -47
  45. package/dist/commands/labels.d.ts.map +0 -1
  46. package/dist/commands/labels.js +0 -48
  47. package/dist/commands/labels.js.map +0 -1
  48. package/dist/commands/relocate.d.ts +0 -71
  49. package/dist/commands/relocate.d.ts.map +0 -1
  50. package/dist/commands/relocate.js +0 -81
  51. package/dist/commands/relocate.js.map +0 -1
  52. package/dist/commands/resize.d.ts +0 -69
  53. package/dist/commands/resize.d.ts.map +0 -1
  54. package/dist/commands/resize.js +0 -112
  55. package/dist/commands/resize.js.map +0 -1
  56. package/dist/dummy.d.ts +0 -2
  57. package/dist/dummy.d.ts.map +0 -1
  58. package/dist/dummy.js +0 -28
  59. package/dist/dummy.js.map +0 -1
  60. package/dist/index.d.ts +0 -2
  61. package/dist/index.d.ts.map +0 -1
  62. package/dist/index.js.map +0 -1
  63. package/dist/tests/lodash.unit.test.d.ts +0 -2
  64. package/dist/tests/lodash.unit.test.d.ts.map +0 -1
  65. package/dist/tests/lodash.unit.test.js +0 -29
  66. package/dist/tests/lodash.unit.test.js.map +0 -1
  67. package/dist/tests/mocked.unit.test.d.ts +0 -2
  68. package/dist/tests/mocked.unit.test.d.ts.map +0 -1
  69. package/dist/tests/mocked.unit.test.js +0 -253
  70. package/dist/tests/mocked.unit.test.js.map +0 -1
  71. package/dist/tests/utils.d.ts +0 -35
  72. package/dist/tests/utils.d.ts.map +0 -1
  73. package/dist/tests/utils.js +0 -101
  74. package/dist/tests/utils.js.map +0 -1
  75. package/dist/utils/input.d.ts +0 -24
  76. package/dist/utils/input.d.ts.map +0 -1
  77. package/dist/utils/input.js +0 -35
  78. package/dist/utils/input.js.map +0 -1
  79. package/dist/utils/inputOutput.d.ts +0 -21
  80. package/dist/utils/inputOutput.d.ts.map +0 -1
  81. package/dist/utils/inputOutput.js +0 -10
  82. package/dist/utils/inputOutput.js.map +0 -1
  83. package/dist/utils/output.d.ts +0 -36
  84. package/dist/utils/output.d.ts.map +0 -1
  85. package/dist/utils/output.js +0 -62
  86. package/dist/utils/output.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/datasets-fs",
3
- "version": "3.0.5",
3
+ "version": "3.0.7",
4
4
  "author": "PROSOPO LIMITED <info@prosopo.io>",
5
5
  "license": "Apache-2.0",
6
6
  "private": false,
@@ -9,27 +9,30 @@
9
9
  "npm": "10.8.2"
10
10
  },
11
11
  "scripts": {
12
- "clean": "tsc --build --clean",
13
- "build": "tsc --build --verbose",
14
- "build:cjs": "npx vite --config vite.cjs.config.ts build",
12
+ "clean": "del-cli --verbose dist tsconfig.tsbuildinfo",
13
+ "build": "NODE_ENV=${NODE_ENV:-production}; vite build --config vite.esm.config.ts --mode $NODE_ENV",
14
+ "build:tsc": "tsc --build --verbose",
15
+ "build:cjs": "NODE_ENV=${NODE_ENV:-production}; vite build --config vite.cjs.config.ts --mode $NODE_ENV",
16
+ "typecheck": "tsc --build --declaration --emitDeclarationOnly --force",
15
17
  "test": "NODE_ENV=${NODE_ENV:-test}; npx vitest run --config ./vite.test.config.ts",
16
18
  "cli": "node ./dist/cli.js"
17
19
  },
18
- "main": "./dist/index.js",
20
+ "main": "dist/index.js",
21
+ "types": "dist/index.d.ts",
19
22
  "type": "module",
20
23
  "exports": {
21
24
  ".": {
25
+ "types": "./dist/index.d.ts",
22
26
  "import": "./dist/index.js",
23
27
  "require": "./dist/cjs/index.cjs"
24
28
  }
25
29
  },
26
- "types": "./dist/index.d.ts",
27
30
  "dependencies": {
28
- "@noble/hashes": "1.5.0",
31
+ "@noble/hashes": "1.8.0",
29
32
  "@polkadot/util": "12.6.2",
30
- "@prosopo/common": "3.0.2",
31
- "@prosopo/types": "3.0.3",
32
- "@prosopo/util": "3.0.2",
33
+ "@prosopo/common": "3.1.1",
34
+ "@prosopo/types": "3.0.5",
35
+ "@prosopo/util": "3.0.4",
33
36
  "@typegoose/auto-increment": "4.13.0",
34
37
  "axios": "1.10.0",
35
38
  "bcrypt": "5.1.1",
@@ -40,10 +43,10 @@
40
43
  "sharp": "0.33.5",
41
44
  "webpack-dev-server": "5.2.2",
42
45
  "yargs": "17.7.2",
43
- "zod": "3.23.8"
46
+ "zod": "3.23.8",
47
+ "@prosopo/config": "3.1.2"
44
48
  },
45
49
  "devDependencies": {
46
- "@prosopo/config": "3.1.0",
47
50
  "@types/bcrypt": "5.0.2",
48
51
  "@types/cli-progress": "3.11.6",
49
52
  "@vitest/coverage-v8": "3.0.9",
@@ -15,5 +15,8 @@ import path from "node:path";
15
15
  import { ViteCommonJSConfig } from "@prosopo/config";
16
16
 
17
17
  export default function () {
18
- return ViteCommonJSConfig("datasets-fs", path.resolve("./tsconfig.cjs.json"));
18
+ return ViteCommonJSConfig(
19
+ path.basename("."),
20
+ path.resolve("./tsconfig.json"),
21
+ );
19
22
  }
@@ -0,0 +1,20 @@
1
+ // Copyright 2021-2025 Prosopo (UK) Ltd.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ import path from "node:path";
16
+ import { ViteEsmConfig } from "@prosopo/config";
17
+
18
+ export default function () {
19
+ return ViteEsmConfig(path.basename("."), path.resolve("./tsconfig.json"));
20
+ }
package/dist/cli/cli.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import type { CliCommandAny } from "./cliCommand.js";
2
- export declare class Cli {
3
- #private;
4
- logger: import("@prosopo/common").Logger;
5
- constructor(commands: CliCommandAny[]);
6
- private config;
7
- exec(args?: string[]): Promise<void>;
8
- }
9
- //# sourceMappingURL=cli.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrD,qBAAa,GAAG;;IAEf,MAAM,mCAAsC;gBAEhC,QAAQ,EAAE,aAAa,EAAE;IAIrC,OAAO,CAAC,MAAM;IAiDD,IAAI,CAAC,IAAI,GAAE,MAAM,EAA0B;CAKxD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAgBxC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAE9B,MAAM,OAAO,GAAG;IAIf,YAAY,QAAyB;QAHrC,gCAA2B;QAC3B,WAAM,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAG3C,uBAAA,IAAI,iBAAa,QAAQ,MAAA,CAAC;IAC3B,CAAC;IAEO,MAAM;QACb,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;aAClC,MAAM,CAAC,WAAW,EAAE;YACpB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;YACxC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI;YAC3B,WAAW,EAAE,eAAe;SAC5B,CAAC;aAED,UAAU,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C,KAAK,EAAE,sCAAsC,CAAC,CAAC;QAChE,OAAO,CAAC,CAAC;IACV,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,OAAiB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACvD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;QAC9D,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACD"}
@@ -1,17 +0,0 @@
1
- import type { Options } from "yargs";
2
- import type * as z from "zod";
3
- export declare abstract class CliCommand<T extends z.ZodTypeAny> {
4
- logger: import("@prosopo/common").Logger;
5
- getOptions(): {
6
- [key: string]: Options;
7
- };
8
- abstract getArgSchema(): T;
9
- parse(args: unknown): Promise<z.infer<T>>;
10
- _check(args: z.infer<T>): Promise<void>;
11
- _run(args: z.infer<T>): Promise<void>;
12
- exec(args: z.infer<T>): Promise<void>;
13
- getCommandName(): string;
14
- abstract getDescription(): string;
15
- }
16
- export type CliCommandAny = CliCommand<z.ZodTypeAny>;
17
- //# sourceMappingURL=cliCommand.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cliCommand.d.ts","sourceRoot":"","sources":["../../src/cli/cliCommand.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,KAAK,CAAC,MAAM,KAAK,CAAC;AAE9B,8BAAsB,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU;IACtD,MAAM,mCAAsC;IAGrC,UAAU,IAAI;QACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACvB;aAKe,YAAY,IAAI,CAAC;IAIpB,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAQzC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAKvB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAKrB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAQ3B,cAAc;aAIL,cAAc,IAAI,MAAM;CACxC;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC"}
@@ -1,31 +0,0 @@
1
- import { getLogger } from "@prosopo/common";
2
- import { kebabCase } from "@prosopo/util";
3
- export class CliCommand {
4
- constructor() {
5
- this.logger = getLogger("info", import.meta.url);
6
- }
7
- getOptions() {
8
- return {};
9
- }
10
- async parse(args) {
11
- const argsSchema = this.getArgSchema();
12
- const parsed = await argsSchema.parse(args);
13
- this.logger.debug(() => ({ data: { parsed }, msg: "parsed args:" }));
14
- return parsed;
15
- }
16
- async _check(args) {
17
- this.logger.debug(() => ({ msg: "runChecks", args }));
18
- }
19
- async _run(args) {
20
- this.logger.debug(() => ({ msg: "run", args }));
21
- }
22
- async exec(args) {
23
- this.logger.debug(() => ({ msg: "exec", args }));
24
- await this._check(args);
25
- await this._run(args);
26
- }
27
- getCommandName() {
28
- return kebabCase(this.constructor.name);
29
- }
30
- }
31
- //# sourceMappingURL=cliCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cliCommand.js","sourceRoot":"","sources":["../../src/cli/cliCommand.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C,MAAM,OAAgB,UAAU;IAAhC;QACC,WAAM,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,GA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, type CliCommandAny } from "./cliCommand.js";
4
- export declare abstract class CliCommandComposite<T extends z.ZodTypeAny> extends CliCommand<T> {
5
- #private;
6
- getCommands(): CliCommandAny[];
7
- constructor(commands: CliCommandAny[]);
8
- getOptions(): {
9
- [key: string]: Options;
10
- };
11
- _run(args: z.TypeOf<T>): Promise<void>;
12
- _check(args: z.TypeOf<T>): Promise<void>;
13
- }
14
- //# sourceMappingURL=cliCommandComposite.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cliCommandComposite.d.ts","sourceRoot":"","sources":["../../src/cli/cliCommandComposite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAcrC,OAAO,KAAK,KAAK,CAAC,MAAM,KAAK,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEjE,8BAAsB,mBAAmB,CACxC,CAAC,SAAS,CAAC,CAAC,UAAU,CACrB,SAAQ,UAAU,CAAC,CAAC,CAAC;;IAGf,WAAW;gBAIN,QAAQ,EAAE,aAAa,EAAE;IAMrB,UAAU,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE;IAQxC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAOtC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAMxD"}
@@ -1,32 +0,0 @@
1
- var _CliCommandComposite_commands;
2
- import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
3
- import { CliCommand } from "./cliCommand.js";
4
- export class CliCommandComposite extends CliCommand {
5
- getCommands() {
6
- return __classPrivateFieldGet(this, _CliCommandComposite_commands, "f");
7
- }
8
- constructor(commands) {
9
- super();
10
- _CliCommandComposite_commands.set(this, []);
11
- __classPrivateFieldSet(this, _CliCommandComposite_commands, [...commands], "f");
12
- }
13
- getOptions() {
14
- return __classPrivateFieldGet(this, _CliCommandComposite_commands, "f").reduce((prev, command) => {
15
- return { ...prev, ...command.getOptions() };
16
- }, {});
17
- }
18
- _run(args) {
19
- return __classPrivateFieldGet(this, _CliCommandComposite_commands, "f").reduce(async (prev, command) => {
20
- await prev;
21
- await command._run(args);
22
- }, Promise.resolve());
23
- }
24
- _check(args) {
25
- return __classPrivateFieldGet(this, _CliCommandComposite_commands, "f").reduce(async (prev, command) => {
26
- await prev;
27
- await command._check(args);
28
- }, Promise.resolve());
29
- }
30
- }
31
- _CliCommandComposite_commands = new WeakMap();
32
- //# sourceMappingURL=cliCommandComposite.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cliCommandComposite.js","sourceRoot":"","sources":["../../src/cli/cliCommandComposite.ts"],"names":[],"mappings":";;AAeA,OAAO,EAAE,UAAU,EAAsB,MAAM,iBAAiB,CAAC;AAEjE,MAAM,OAAgB,mBAEpB,SAAQ,UAAa;IAGf,WAAW;QACjB,OAAO,uBAAA,IAAI,qCAAU,CAAC;IACvB,CAAC;IAED,YAAY,QAAyB;QACpC,KAAK,EAAE,CAAC;QAPT,wCAA6B,EAAE,EAAC;QAS/B,uBAAA,IAAI,iCAAa,CAAC,GAAG,QAAQ,CAAC,MAAA,CAAC;IAChC,CAAC;IAEe,UAAU;QAEzB,OAAO,uBAAA,IAAI,qCAAU,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;YAE9C,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;QAC7C,CAAC,EAAE,EAAE,CAAC,CAAC;IACR,CAAC;IAEe,IAAI,CAAC,IAAiB;QACrC,OAAO,uBAAA,IAAI,qCAAU,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;YACpD,MAAM,IAAI,CAAC;YACX,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACvB,CAAC;IAEe,MAAM,CAAC,IAAiB;QACvC,OAAO,uBAAA,IAAI,qCAAU,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;YACpD,MAAM,IAAI,CAAC;YACX,MAAM,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACvB,CAAC;CACD"}
package/dist/cli.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js DELETED
@@ -1,34 +0,0 @@
1
- import { isMain } from "@prosopo/util";
2
- import { Flatten } from "./commands/flatten.js";
3
- import { GenerateV1 } from "./commands/generateV1.js";
4
- import { GenerateV2 } from "./commands/generateV2.js";
5
- import { Get } from "./commands/get.js";
6
- import { Labels } from "./commands/labels.js";
7
- import { Relocate } from "./commands/relocate.js";
8
- import { Resize } from "./commands/resize.js";
9
- import { Cli } from "./index.js";
10
- const main = async () => {
11
- const commands = [
12
- new Flatten(),
13
- new GenerateV1(),
14
- new GenerateV2(),
15
- new Get(),
16
- new Labels(),
17
- new Relocate(),
18
- new Resize(),
19
- ];
20
- const cli = new Cli(commands);
21
- cli.logger.setLogLevel("debug");
22
- await cli.exec();
23
- };
24
- if (isMain(import.meta.url)) {
25
- main()
26
- .then(() => {
27
- process.exit(0);
28
- })
29
- .catch((err) => {
30
- console.log("error", err);
31
- process.exit(1);
32
- });
33
- }
34
- //# sourceMappingURL=cli.js.map
package/dist/cli.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.js","sourceRoot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AC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,59 +0,0 @@
1
- import * as z from "zod";
2
- import { InputOutputCliCommand } from "../utils/inputOutput.js";
3
- export declare const ArgsSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
4
- input: z.ZodString;
5
- }, {
6
- output: z.ZodString;
7
- overwrite: z.ZodOptional<z.ZodBoolean>;
8
- }>, {
9
- allowDuplicates: z.ZodOptional<z.ZodBoolean>;
10
- }>, "strip", z.ZodTypeAny, {
11
- input: string;
12
- output: string;
13
- overwrite?: boolean | undefined;
14
- allowDuplicates?: boolean | undefined;
15
- }, {
16
- input: string;
17
- output: string;
18
- overwrite?: boolean | undefined;
19
- allowDuplicates?: boolean | undefined;
20
- }>;
21
- export type ArgsSchemaType = typeof ArgsSchema;
22
- export type Args = z.infer<ArgsSchemaType>;
23
- export declare class Flatten extends InputOutputCliCommand<ArgsSchemaType> {
24
- getArgSchema(): z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
25
- input: z.ZodString;
26
- }, {
27
- output: z.ZodString;
28
- overwrite: z.ZodOptional<z.ZodBoolean>;
29
- }>, {
30
- allowDuplicates: z.ZodOptional<z.ZodBoolean>;
31
- }>, "strip", z.ZodTypeAny, {
32
- input: string;
33
- output: string;
34
- overwrite?: boolean | undefined;
35
- allowDuplicates?: boolean | undefined;
36
- }, {
37
- input: string;
38
- output: string;
39
- overwrite?: boolean | undefined;
40
- allowDuplicates?: boolean | undefined;
41
- }>;
42
- getDescription(): string;
43
- getOptions(): {
44
- [key: string]: import("yargs").Options;
45
- } & {
46
- input: {
47
- description: string;
48
- };
49
- output: {
50
- description: string;
51
- };
52
- allowDuplicates: {
53
- boolean: boolean;
54
- description: string;
55
- };
56
- };
57
- _run(args: Args): Promise<void>;
58
- }
59
- //# sourceMappingURL=flatten.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../src/commands/flatten.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAEN,qBAAqB,EACrB,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;EAErB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,UAAU,CAAC;AAC/C,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AAE3C,qBAAa,OAAQ,SAAQ,qBAAqB,CAAC,cAAc,CAAC;IACjD,YAAY;;;;;;;;;;;;;;;;;;IAIZ,cAAc,IAAI,MAAM;IAIxB,UAAU;;;;;;;;;;;;;;IAiBJ,IAAI,CAAC,IAAI,EAAE,IAAI;CAwFrC"}
@@ -1,97 +0,0 @@
1
- import fs from "node:fs";
2
- import { blake2b } from "@noble/hashes/blake2b";
3
- import { ProsopoDatasetError } from "@prosopo/common";
4
- import { CaptchaItemTypes, DataSchema, } from "@prosopo/types";
5
- import { u8aToHex } from "@prosopo/util";
6
- import { at } from "@prosopo/util";
7
- import { lodash } from "@prosopo/util/lodash";
8
- import cliProgress from "cli-progress";
9
- import * as z from "zod";
10
- import { InputOutputArgsSchema, InputOutputCliCommand, } from "../utils/inputOutput.js";
11
- export const ArgsSchema = InputOutputArgsSchema.extend({
12
- allowDuplicates: z.boolean().optional(),
13
- });
14
- export class Flatten extends InputOutputCliCommand {
15
- getArgSchema() {
16
- return ArgsSchema;
17
- }
18
- getDescription() {
19
- return "Restructure a directory containing directories for each image classification into a single directory with a file containing the labels";
20
- }
21
- getOptions() {
22
- return lodash().merge(super.getOptions(), {
23
- input: {
24
- description: "Path to the data directory containing subdirectories for each image classification",
25
- },
26
- output: {
27
- description: "Where to put the output file containing the labels and single directory of images",
28
- },
29
- allowDuplicates: {
30
- boolean: true,
31
- description: "If true, allow duplicates in the data",
32
- },
33
- });
34
- }
35
- async _run(args) {
36
- this.logger.debug(() => ({ msg: "flatten run" }));
37
- await super._run(args);
38
- const dataDir = args.input;
39
- const outDir = args.output;
40
- this.logger.info(() => ({ msg: "reading data" }));
41
- const labels = fs
42
- .readdirSync(dataDir, { withFileTypes: true })
43
- .filter((dirent) => dirent.isDirectory())
44
- .map((dirent) => dirent.name)
45
- .sort();
46
- const imagesByLabel = labels.map((label) => fs.readdirSync(`${dataDir}/${label}`));
47
- const imageDir = `${outDir}/images`;
48
- fs.mkdirSync(imageDir, { recursive: true });
49
- const bar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);
50
- const items = [];
51
- bar.start(imagesByLabel.reduce((acc, images) => acc + images.length, 0), 0);
52
- labels.forEach((label, i) => {
53
- const images = at(imagesByLabel, i);
54
- for (const image of images) {
55
- bar.increment();
56
- const extension = image.split(".").pop();
57
- const content = fs.readFileSync(`${dataDir}/${label}/${image}`);
58
- const hash = blake2b(content);
59
- const hex = u8aToHex(hash);
60
- const name = `${hex}.${extension}`;
61
- if (fs.existsSync(`${imageDir}/${name}`)) {
62
- for (const item of items) {
63
- if (item.hash === hex) {
64
- this.logger.info(() => ({
65
- msg: `\ndupe: ${label}/${image}`,
66
- data: { item },
67
- }));
68
- }
69
- }
70
- if (!args.allowDuplicates) {
71
- throw new ProsopoDatasetError("DATASET.DUPLICATE_IMAGE", {
72
- context: { image: `${label}/${image}` },
73
- });
74
- }
75
- }
76
- fs.copyFileSync(`${dataDir}/${label}/${image}`, `${imageDir}/${name}`);
77
- const filePath = fs.realpathSync(`${imageDir}/${name}`);
78
- const entry = {
79
- data: filePath,
80
- type: CaptchaItemTypes.Image,
81
- label,
82
- hash: hex,
83
- };
84
- items.push(entry);
85
- }
86
- });
87
- bar.stop();
88
- const data = {
89
- items,
90
- };
91
- this.logger.info(() => ({ msg: "verifying data", data: { ...data } }));
92
- DataSchema.parse(data);
93
- this.logger.info(() => ({ msg: "writing data" }));
94
- fs.writeFileSync(`${outDir}/data.json`, JSON.stringify(data, null, 4));
95
- }
96
- }
97
- //# source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,OAAO,IAAI,KAAK,IAAI,KAAK,EAAE,EAAE,GAAG,QAAQ,IAAI,IAAI,EAAE,CAAC,CAAC;gBACvE,MAAM,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,QAAQ,IAAI,IAAI,EAAE,CAAC,CAAC;gBAExD,MAAM,KAAK,GAAiB;oBAC3B,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,gBAAgB,CAAC,KAAK;oBAC5B,KAAK;oBACL,IAAI,EAAE,GAAG;iBACT,CAAC;gBACF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnB,CAAC;QACF,CAAC,CAAC,CAAC;QACH,GAAG,CAAC,IAAI,EAAE,CAAC;QAEX,MAAM,IAAI,GAAS;YAClB,KAAK;SACL,CAAC;QAGF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;QACvE,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAGvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;QAClD,EAAE,CAAC,aAAa,CAAC,GAAG,MAAM,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC;CACD"}
@@ -1,115 +0,0 @@
1
- import { type Item, type LabelledItem } from "@prosopo/types";
2
- import * as z from "zod";
3
- import { OutputCliCommand } from "../utils/output.js";
4
- export declare const ArgsSchema: z.ZodObject<z.objectUtil.extendShape<{
5
- output: z.ZodString;
6
- overwrite: z.ZodOptional<z.ZodBoolean>;
7
- }, {
8
- labels: z.ZodOptional<z.ZodString>;
9
- labelled: z.ZodOptional<z.ZodString>;
10
- unlabelled: z.ZodOptional<z.ZodString>;
11
- seed: z.ZodNumber;
12
- size: z.ZodOptional<z.ZodNumber>;
13
- overwrite: z.ZodOptional<z.ZodBoolean>;
14
- allowDuplicates: z.ZodOptional<z.ZodBoolean>;
15
- allowDuplicatesLabelled: z.ZodOptional<z.ZodBoolean>;
16
- allowDuplicatesUnlabelled: z.ZodOptional<z.ZodBoolean>;
17
- }>, "strip", z.ZodTypeAny, {
18
- output: string;
19
- seed: number;
20
- overwrite?: boolean | undefined;
21
- allowDuplicates?: boolean | undefined;
22
- labels?: string | undefined;
23
- labelled?: string | undefined;
24
- unlabelled?: string | undefined;
25
- size?: number | undefined;
26
- allowDuplicatesLabelled?: boolean | undefined;
27
- allowDuplicatesUnlabelled?: boolean | undefined;
28
- }, {
29
- output: string;
30
- seed: number;
31
- overwrite?: boolean | undefined;
32
- allowDuplicates?: boolean | undefined;
33
- labels?: string | undefined;
34
- labelled?: string | undefined;
35
- unlabelled?: string | undefined;
36
- size?: number | undefined;
37
- allowDuplicatesLabelled?: boolean | undefined;
38
- allowDuplicatesUnlabelled?: boolean | undefined;
39
- }>;
40
- export type ArgsSchemaType = typeof ArgsSchema;
41
- export type Args = z.infer<ArgsSchemaType>;
42
- export declare abstract class Generate<T extends ArgsSchemaType> extends OutputCliCommand<T> {
43
- getOptions(): {
44
- [key: string]: import("yargs").Options;
45
- } & {
46
- output: {
47
- alias: string;
48
- string: boolean;
49
- demand: boolean;
50
- description: string;
51
- };
52
- overwrite: {
53
- boolean: boolean;
54
- description: string;
55
- };
56
- } & {
57
- output: {
58
- description: string;
59
- };
60
- labelled: {
61
- string: boolean;
62
- demand: boolean;
63
- description: string;
64
- };
65
- unlabelled: {
66
- string: boolean;
67
- demand: boolean;
68
- description: string;
69
- };
70
- seed: {
71
- number: boolean;
72
- demand: boolean;
73
- description: string;
74
- };
75
- size: {
76
- number: boolean;
77
- description: string;
78
- };
79
- labels: {
80
- string: boolean;
81
- description: string;
82
- };
83
- allowDuplicates: {
84
- boolean: boolean;
85
- description: string;
86
- };
87
- allowDuplicatesLabelled: {
88
- boolean: boolean;
89
- description: string;
90
- };
91
- allowDuplicatesUnlabelled: {
92
- boolean: boolean;
93
- description: string;
94
- };
95
- };
96
- _check(args: Args): Promise<void>;
97
- labelled: LabelledItem[];
98
- unlabelled: Item[];
99
- labels: string[];
100
- labelledMapFile: string;
101
- unlabelledMapFile: string;
102
- labelToImages: {
103
- [label: string]: Item[];
104
- };
105
- targets: string[];
106
- saltRounds: number;
107
- private loadData;
108
- private loadLabels;
109
- _run(args: Args): Promise<void>;
110
- }
111
- export declare const checkDuplicates: (labelled: LabelledItem[], unlabelled: Item[], options: {
112
- allowDuplicatesLabelled?: boolean;
113
- allowDuplicatesUnlabelled?: boolean;
114
- }) => void;
115
- //# sourceMappingURL=generate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAEA,OAAO,EAEN,KAAK,IAAI,EAET,KAAK,YAAY,EAEjB,MAAM,gBAAgB,CAAC;AAexB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAoB,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAExE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUrB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,UAAU,CAAC;AAC/C,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AAE3C,8BAAsB,QAAQ,CAC7B,CAAC,SAAS,cAAc,CACvB,SAAQ,gBAAgB,CAAC,CAAC,CAAC;IACZ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6CJ,MAAM,CAAC,IAAI,EAAE,IAAI;IAwBvC,QAAQ,EAAE,YAAY,EAAE,CAAM;IAC9B,UAAU,EAAE,IAAI,EAAE,CA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