@prosopo/datasets-fs 0.1.17 → 0.1.18

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 (173) hide show
  1. package/package.json +10 -5
  2. package/dist/cli.d.ts +0 -2
  3. package/dist/cli.d.ts.map +0 -1
  4. package/dist/cli.js +0 -50
  5. package/dist/cli.js.map +0 -1
  6. package/dist/flatten/args.d.ts +0 -16
  7. package/dist/flatten/args.d.ts.map +0 -1
  8. package/dist/flatten/args.js +0 -8
  9. package/dist/flatten/args.js.map +0 -1
  10. package/dist/flatten/cli.d.ts +0 -18
  11. package/dist/flatten/cli.d.ts.map +0 -1
  12. package/dist/flatten/cli.js +0 -31
  13. package/dist/flatten/cli.js.map +0 -1
  14. package/dist/flatten/flatten.d.ts +0 -5
  15. package/dist/flatten/flatten.d.ts.map +0 -1
  16. package/dist/flatten/flatten.js +0 -66
  17. package/dist/flatten/flatten.js.map +0 -1
  18. package/dist/flatten/index.d.ts +0 -4
  19. package/dist/flatten/index.d.ts.map +0 -1
  20. package/dist/flatten/index.js +0 -4
  21. package/dist/flatten/index.js.map +0 -1
  22. package/dist/generate/args.d.ts +0 -37
  23. package/dist/generate/args.d.ts.map +0 -1
  24. package/dist/generate/args.js +0 -15
  25. package/dist/generate/args.js.map +0 -1
  26. package/dist/generate/cli.d.ts +0 -32
  27. package/dist/generate/cli.d.ts.map +0 -1
  28. package/dist/generate/cli.js +0 -63
  29. package/dist/generate/cli.js.map +0 -1
  30. package/dist/generate/distinct/args.d.ts +0 -49
  31. package/dist/generate/distinct/args.d.ts.map +0 -1
  32. package/dist/generate/distinct/args.js +0 -10
  33. package/dist/generate/distinct/args.js.map +0 -1
  34. package/dist/generate/distinct/cli.d.ts +0 -20
  35. package/dist/generate/distinct/cli.d.ts.map +0 -1
  36. package/dist/generate/distinct/cli.js +0 -32
  37. package/dist/generate/distinct/cli.js.map +0 -1
  38. package/dist/generate/distinct/dummy.d.ts +0 -2
  39. package/dist/generate/distinct/dummy.d.ts.map +0 -1
  40. package/dist/generate/distinct/dummy.js +0 -29
  41. package/dist/generate/distinct/dummy.js.map +0 -1
  42. package/dist/generate/distinct/generate.d.ts +0 -5
  43. package/dist/generate/distinct/generate.d.ts.map +0 -1
  44. package/dist/generate/distinct/generate.js +0 -186
  45. package/dist/generate/distinct/generate.js.map +0 -1
  46. package/dist/generate/distinct/index.d.ts +0 -4
  47. package/dist/generate/distinct/index.d.ts.map +0 -1
  48. package/dist/generate/distinct/index.js +0 -4
  49. package/dist/generate/distinct/index.js.map +0 -1
  50. package/dist/generate/index.d.ts +0 -5
  51. package/dist/generate/index.d.ts.map +0 -1
  52. package/dist/generate/index.js +0 -5
  53. package/dist/generate/index.js.map +0 -1
  54. package/dist/generate/union/args.d.ts +0 -52
  55. package/dist/generate/union/args.d.ts.map +0 -1
  56. package/dist/generate/union/args.js +0 -11
  57. package/dist/generate/union/args.js.map +0 -1
  58. package/dist/generate/union/cli.d.ts +0 -22
  59. package/dist/generate/union/cli.d.ts.map +0 -1
  60. package/dist/generate/union/cli.js +0 -36
  61. package/dist/generate/union/cli.js.map +0 -1
  62. package/dist/generate/union/generate.d.ts +0 -5
  63. package/dist/generate/union/generate.d.ts.map +0 -1
  64. package/dist/generate/union/generate.js +0 -168
  65. package/dist/generate/union/generate.js.map +0 -1
  66. package/dist/generate/union/index.d.ts +0 -4
  67. package/dist/generate/union/index.d.ts.map +0 -1
  68. package/dist/generate/union/index.js +0 -4
  69. package/dist/generate/union/index.js.map +0 -1
  70. package/dist/generate/util.d.ts +0 -12
  71. package/dist/generate/util.d.ts.map +0 -1
  72. package/dist/generate/util.js +0 -40
  73. package/dist/generate/util.js.map +0 -1
  74. package/dist/get/args.d.ts +0 -10
  75. package/dist/get/args.d.ts.map +0 -1
  76. package/dist/get/args.js +0 -6
  77. package/dist/get/args.js.map +0 -1
  78. package/dist/get/cli.d.ts +0 -14
  79. package/dist/get/cli.d.ts.map +0 -1
  80. package/dist/get/cli.js +0 -20
  81. package/dist/get/cli.js.map +0 -1
  82. package/dist/get/get.d.ts +0 -5
  83. package/dist/get/get.d.ts.map +0 -1
  84. package/dist/get/get.js +0 -58
  85. package/dist/get/get.js.map +0 -1
  86. package/dist/get/index.d.ts +0 -4
  87. package/dist/get/index.d.ts.map +0 -1
  88. package/dist/get/index.js +0 -4
  89. package/dist/get/index.js.map +0 -1
  90. package/dist/index.d.ts +0 -2
  91. package/dist/index.d.ts.map +0 -1
  92. package/dist/index.js +0 -15
  93. package/dist/index.js.map +0 -1
  94. package/dist/labels/args.d.ts +0 -10
  95. package/dist/labels/args.d.ts.map +0 -1
  96. package/dist/labels/args.js +0 -6
  97. package/dist/labels/args.js.map +0 -1
  98. package/dist/labels/cli.d.ts +0 -14
  99. package/dist/labels/cli.d.ts.map +0 -1
  100. package/dist/labels/cli.js +0 -20
  101. package/dist/labels/cli.js.map +0 -1
  102. package/dist/labels/index.d.ts +0 -4
  103. package/dist/labels/index.d.ts.map +0 -1
  104. package/dist/labels/index.js +0 -4
  105. package/dist/labels/index.js.map +0 -1
  106. package/dist/labels/labels.d.ts +0 -5
  107. package/dist/labels/labels.d.ts.map +0 -1
  108. package/dist/labels/labels.js +0 -23
  109. package/dist/labels/labels.js.map +0 -1
  110. package/dist/relocate/args.d.ts +0 -16
  111. package/dist/relocate/args.d.ts.map +0 -1
  112. package/dist/relocate/args.js +0 -8
  113. package/dist/relocate/args.js.map +0 -1
  114. package/dist/relocate/cli.d.ts +0 -18
  115. package/dist/relocate/cli.d.ts.map +0 -1
  116. package/dist/relocate/cli.js +0 -30
  117. package/dist/relocate/cli.js.map +0 -1
  118. package/dist/relocate/relocate.d.ts +0 -5
  119. package/dist/relocate/relocate.d.ts.map +0 -1
  120. package/dist/relocate/relocate.js +0 -38
  121. package/dist/relocate/relocate.js.map +0 -1
  122. package/dist/scale/args.d.ts +0 -22
  123. package/dist/scale/args.d.ts.map +0 -1
  124. package/dist/scale/args.js +0 -10
  125. package/dist/scale/args.js.map +0 -1
  126. package/dist/scale/cli.d.ts +0 -22
  127. package/dist/scale/cli.d.ts.map +0 -1
  128. package/dist/scale/cli.js +0 -39
  129. package/dist/scale/cli.js.map +0 -1
  130. package/dist/scale/index.d.ts +0 -4
  131. package/dist/scale/index.d.ts.map +0 -1
  132. package/dist/scale/index.js +0 -4
  133. package/dist/scale/index.js.map +0 -1
  134. package/dist/scale/scale.d.ts +0 -5
  135. package/dist/scale/scale.d.ts.map +0 -1
  136. package/dist/scale/scale.js +0 -65
  137. package/dist/scale/scale.js.map +0 -1
  138. package/src/cli.ts +0 -50
  139. package/src/flatten/args.ts +0 -11
  140. package/src/flatten/cli.ts +0 -33
  141. package/src/flatten/flatten.ts +0 -77
  142. package/src/flatten/index.ts +0 -3
  143. package/src/generate/args.ts +0 -18
  144. package/src/generate/cli.ts +0 -65
  145. package/src/generate/distinct/args.ts +0 -13
  146. package/src/generate/distinct/cli.ts +0 -34
  147. package/src/generate/distinct/dummy.ts +0 -35
  148. package/src/generate/distinct/generate.ts +0 -238
  149. package/src/generate/distinct/index.ts +0 -3
  150. package/src/generate/index.ts +0 -4
  151. package/src/generate/union/args.ts +0 -14
  152. package/src/generate/union/cli.ts +0 -38
  153. package/src/generate/union/generate.ts +0 -210
  154. package/src/generate/union/index.ts +0 -3
  155. package/src/generate/util.ts +0 -61
  156. package/src/get/args.ts +0 -9
  157. package/src/get/cli.ts +0 -21
  158. package/src/get/get.ts +0 -56
  159. package/src/get/index.ts +0 -3
  160. package/src/index.ts +0 -14
  161. package/src/labels/args.ts +0 -9
  162. package/src/labels/cli.ts +0 -21
  163. package/src/labels/index.ts +0 -3
  164. package/src/labels/labels.ts +0 -27
  165. package/src/relocate/args.ts +0 -11
  166. package/src/relocate/cli.ts +0 -32
  167. package/src/relocate/relocate.ts +0 -38
  168. package/src/scale/args.ts +0 -13
  169. package/src/scale/cli.ts +0 -43
  170. package/src/scale/index.ts +0 -3
  171. package/src/scale/scale.ts +0 -79
  172. package/tsconfig.json +0 -17
  173. package/tsconfig.tsbuildinfo +0 -1
@@ -1,29 +0,0 @@
1
- // generate some dummy data for testing the generate fns
2
- import { CaptchaItemTypes } from '@prosopo/types';
3
- import fs from 'fs';
4
- const nLabels = 4;
5
- const nLabelledImages = 100;
6
- const nUnlabelledImages = 100;
7
- const labelledImages = [];
8
- const unlabelledImages = [];
9
- for (let i = 0; i < nLabelledImages; i++) {
10
- const label = i % nLabels;
11
- labelledImages.push({
12
- label: label.toString(),
13
- data: `abc${i}`,
14
- type: CaptchaItemTypes.Image,
15
- hash: `abc${i}hash`,
16
- });
17
- }
18
- for (let i = 0; i < nUnlabelledImages; i++) {
19
- unlabelledImages.push({
20
- data: `def${i}`,
21
- type: CaptchaItemTypes.Image,
22
- hash: `def${i}hash`,
23
- });
24
- }
25
- fs.writeFileSync('labelled.json', JSON.stringify(labelledImages));
26
- fs.writeFileSync('unlabelled.json', JSON.stringify(unlabelledImages));
27
- fs.writeFileSync('labels.json', JSON.stringify(Array.from(Array(nLabels).keys()).map((x) => x.toString())));
28
- process.exit(0);
29
- //# sourceMappingURL=dummy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dummy.js","sourceRoot":"","sources":["../../../src/generate/distinct/dummy.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,OAAO,EAAE,gBAAgB,EAAsB,MAAM,gBAAgB,CAAA;AACrE,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,MAAM,OAAO,GAAG,CAAC,CAAA;AACjB,MAAM,eAAe,GAAG,GAAG,CAAA;AAC3B,MAAM,iBAAiB,GAAG,GAAG,CAAA;AAE7B,MAAM,cAAc,GAAmB,EAAE,CAAA;AACzC,MAAM,gBAAgB,GAAW,EAAE,CAAA;AAEnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC,EAAE,EAAE;IACtC,MAAM,KAAK,GAAG,CAAC,GAAG,OAAO,CAAA;IACzB,cAAc,CAAC,IAAI,CAAC;QAChB,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;QACvB,IAAI,EAAE,MAAM,CAAC,EAAE;QACf,IAAI,EAAE,gBAAgB,CAAC,KAAK;QAC5B,IAAI,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC,CAAA;CACL;AAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,EAAE,CAAC,EAAE,EAAE;IACxC,gBAAgB,CAAC,IAAI,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC,EAAE;QACf,IAAI,EAAE,gBAAgB,CAAC,KAAK;QAC5B,IAAI,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC,CAAA;CACL;AAED,EAAE,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAA;AACjE,EAAE,CAAC,aAAa,CAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAA;AACrE,EAAE,CAAC,aAAa,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAA;AAE3G,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA"}
@@ -1,5 +0,0 @@
1
- import { Args } from './args.js';
2
- import { Logger } from '@prosopo/common';
3
- declare const _default: (args: Args, logger?: Logger) => Promise<void>;
4
- export default _default;
5
- //# sourceMappingURL=generate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/generate/distinct/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAahC,OAAO,EAAE,MAAM,EAAqC,MAAM,iBAAiB,CAAA;+BAQ/C,IAAI,WAAW,MAAM;AAAjD,wBAwNC"}
@@ -1,186 +0,0 @@
1
- import { __awaiter } from "tslib";
2
- import { CaptchaTypes, CaptchasContainerSchema, DataSchema, LabelledDataSchema, LabelsContainerSchema, } from '@prosopo/types';
3
- import { ProsopoEnvError, getLoggerDefault } from '@prosopo/common';
4
- import { blake2AsHex } from '@polkadot/util-crypto';
5
- import { checkDuplicates } from '../util.js';
6
- import { lodash, setSeedGlobal } from '@prosopo/util';
7
- import bcrypt from 'bcrypt';
8
- import cliProgress from 'cli-progress';
9
- import fs from 'fs';
10
- export default (args, logger) => __awaiter(void 0, void 0, void 0, function* () {
11
- logger = logger || getLoggerDefault();
12
- logger.debug(args, 'generating...');
13
- const outFile = args.out;
14
- const overwrite = args.overwrite || false;
15
- if (!overwrite && fs.existsSync(outFile)) {
16
- throw new ProsopoEnvError(new Error(`output file already exists: ${outFile}`), 'FS.FILE_ALREADY_EXISTS');
17
- }
18
- const labelledMapFile = args.labelled;
19
- if (labelledMapFile && !fs.existsSync(labelledMapFile)) {
20
- throw new ProsopoEnvError(new Error(`labelled map file does not exist: ${labelledMapFile}`), 'FS.FILE_NOT_FOUND');
21
- }
22
- const unlabelledMapFile = args.unlabelled;
23
- if (unlabelledMapFile && !fs.existsSync(unlabelledMapFile)) {
24
- throw new ProsopoEnvError(new Error(`unlabelled map file does not exist: ${unlabelledMapFile}`), 'FS.FILE_NOT_FOUND');
25
- }
26
- const labelsFile = args.labels;
27
- const seed = args.seed || 0;
28
- const size = args.size || 9;
29
- const minCorrect = args.minCorrect || 1;
30
- const maxCorrect = args.maxCorrect || size - 1;
31
- const solved = args.solved || 0;
32
- const unsolved = args.unsolved || 0;
33
- const saltRounds = 10;
34
- const allowDuplicatesLabelled = args.allowDuplicatesLabelled || args.allowDuplicates || false;
35
- const allowDuplicatesUnlabelled = args.allowDuplicatesUnlabelled || args.allowDuplicates || false;
36
- // set the seed
37
- setSeedGlobal(seed);
38
- // get lodash (with seeded rng)
39
- const _ = lodash();
40
- // load the map to get the labelled and unlabelled data
41
- const labelled = labelledMapFile
42
- ? LabelledDataSchema.parse(JSON.parse(fs.readFileSync(labelledMapFile, 'utf8'))).items
43
- : [];
44
- const unlabelled = unlabelledMapFile
45
- ? DataSchema.parse(JSON.parse(fs.readFileSync(unlabelledMapFile, 'utf8'))).items
46
- : [];
47
- // check for duplicates
48
- checkDuplicates(labelled, unlabelled, {
49
- allowDuplicatesLabelled,
50
- allowDuplicatesUnlabelled,
51
- });
52
- // split the labelled data by label
53
- const labelToImages = {};
54
- for (const entry of labelled) {
55
- labelToImages[entry.label] = labelToImages[entry.label] || [];
56
- labelToImages[entry.label].push(entry);
57
- }
58
- const targets = Object.keys(labelToImages);
59
- // load the labels from file
60
- // these are the labels that unlabelled data will be assigned to
61
- // note that these can be different to the labels in the map file as the labelled data is independent of the unlabelled data in terms of labels
62
- const labels = [];
63
- if (labelsFile && fs.existsSync(labelsFile)) {
64
- labels.push(...[...LabelsContainerSchema.parse(JSON.parse(fs.readFileSync(labelsFile, 'utf8'))).labels]);
65
- }
66
- else {
67
- // else default to the labels in the labelled data
68
- labels.push(...[...targets]);
69
- }
70
- // generate n solved captchas
71
- const solvedCaptchas = [];
72
- // create a new progress bar instance and use shades_classic theme
73
- const barSolved = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);
74
- logger.info(`Generating ${solved} solved captchas...`);
75
- barSolved.start(solved, 0);
76
- for (let i = 0; i < solved; i++) {
77
- // update the current value in your application..
78
- barSolved.update(i + 1);
79
- if (targets.length <= 1) {
80
- throw new ProsopoEnvError(new Error(`not enough different labels in labelled data: ${labelledMapFile}`), 'DATASET.NOT_ENOUGH_LABELS');
81
- }
82
- // uniformly sample targets
83
- const target = targets[i % targets.length];
84
- const notTargets = targets.filter((t) => t !== target);
85
- // how many correct items should be in the captcha?
86
- const nCorrect = _.random(minCorrect, maxCorrect);
87
- // how many incorrect items should be in the captcha?
88
- const nIncorrect = size - nCorrect;
89
- const targetItems = labelToImages[target];
90
- const notTargetItems = notTargets.map((notTarget) => labelToImages[notTarget]).flat();
91
- if (targetItems.length < nCorrect) {
92
- throw new ProsopoEnvError(new Error(`not enough images for target (${target})`), 'DATASET.NOT_ENOUGH_IMAGES');
93
- }
94
- if (notTargetItems.length < nIncorrect) {
95
- throw new ProsopoEnvError(new Error(`not enough non-matching images for target (${target})`), 'DATASET.NOT_ENOUGH_IMAGES');
96
- }
97
- // get the correct items
98
- const correctItems = _.sampleSize(targetItems, nCorrect);
99
- // get the incorrect items
100
- const incorrectItems = _.sampleSize(notTargetItems, nIncorrect);
101
- let items = [...correctItems, ...incorrectItems];
102
- let indices = [...Array(items.length).keys()];
103
- indices = _.shuffle(indices);
104
- items = indices.map((i) => items[i]);
105
- items = items.map((item) => {
106
- return {
107
- data: item.data,
108
- hash: item.hash,
109
- type: item.type,
110
- };
111
- });
112
- // the first n indices are the correct items
113
- const solution = indices
114
- .map((index, i) => {
115
- return {
116
- pre: index,
117
- post: i, // the index of the item in the shuffled array
118
- };
119
- })
120
- .filter((item) => item.pre < correctItems.length) // keep all items that were in the first n slots of the original item array - these were the correct items
121
- .map((item) => {
122
- return item.post; // return the index in the shuffled array
123
- });
124
- const salt = blake2AsHex(bcrypt.genSaltSync(saltRounds));
125
- // create the captcha
126
- const captcha = {
127
- salt,
128
- target,
129
- items,
130
- solution,
131
- };
132
- solvedCaptchas.push(captcha);
133
- }
134
- barSolved.stop();
135
- logger.info(`Generating ${unsolved} unsolved captchas...`);
136
- // create a new progress bar instance and use shades_classic theme
137
- const barUnsolved = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);
138
- barUnsolved.start(unsolved, 0);
139
- // generate n unsolved captchas
140
- const unsolvedCaptchas = [];
141
- for (let i = 0; i < unsolved; i++) {
142
- barUnsolved.update(i + 1);
143
- if (unlabelled.length <= size) {
144
- throw new ProsopoEnvError(new Error(`unlabelled map file does not contain enough data: ${unlabelledMapFile}`), 'DATASET.NOT_ENOUGH_IMAGES');
145
- }
146
- // pick a random label to be the target
147
- // note that these are potentially different to the labelled data labels
148
- if (labels.length <= 0) {
149
- throw new ProsopoEnvError(new Error(`no labels found for unlabelled data: ${labelsFile}`), 'DATASET.NOT_ENOUGH_LABELS');
150
- }
151
- const index = _.random(0, labels.length - 1);
152
- const target = labels[index];
153
- // randomly pick images from the unlabelled data
154
- const itemSet = _.sampleSize(unlabelled, size);
155
- // shuffle the items
156
- let items = [...itemSet];
157
- let indices = [...Array(items.length).keys()];
158
- indices = _.shuffle(indices);
159
- items = indices.map((i) => items[i]);
160
- items = items.map((item) => {
161
- return {
162
- data: item.data,
163
- hash: item.hash,
164
- type: item.type,
165
- };
166
- });
167
- const salt = blake2AsHex(bcrypt.genSaltSync(saltRounds));
168
- // create the captcha
169
- const captcha = {
170
- salt,
171
- target,
172
- items,
173
- };
174
- unsolvedCaptchas.push(captcha);
175
- }
176
- barUnsolved.stop();
177
- // write to file
178
- const output = {
179
- captchas: [...solvedCaptchas, ...unsolvedCaptchas],
180
- format: CaptchaTypes.SelectAll,
181
- };
182
- // verify the output
183
- CaptchasContainerSchema.parse(output);
184
- fs.writeFileSync(outFile, JSON.stringify(output, null, 4));
185
- });
186
- //# sourceMappingURL=generate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/generate/distinct/generate.ts"],"names":[],"mappings":";AACA,OAAO,EACH,YAAY,EAGZ,uBAAuB,EACvB,UAAU,EAEV,kBAAkB,EAElB,qBAAqB,GAExB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAU,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,WA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AAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACvB,OAAO;gBACH,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;aAClB,CAAA;QACL,CAAC,CAAC,CAAA;QACF,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAA;QACxD,qBAAqB;QACrB,MAAM,OAAO,GAAqB;YAC9B,IAAI;YACJ,MAAM;YACN,KAAK;SACR,CAAA;QACD,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;KACjC;IACD,WAAW,CAAC,IAAI,EAAE,CAAA;IAClB,gBAAgB;IAChB,MAAM,MAAM,GAAa;QACrB,QAAQ,EAAE,CAAC,GAAG,cAAc,EAAE,GAAG,gBAAgB,CAAC;QAClD,MAAM,EAAE,YAAY,CAAC,SAAS;KACjC,CAAA;IAED,oBAAoB;IACpB,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAErC,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;AAC9D,CAAC,CAAA,CAAA"}
@@ -1,4 +0,0 @@
1
- export * from './generate.js';
2
- export * from './cli.js';
3
- export * from './args.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generate/distinct/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
@@ -1,4 +0,0 @@
1
- export * from './generate.js';
2
- export * from './cli.js';
3
- export * from './args.js';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generate/distinct/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
@@ -1,5 +0,0 @@
1
- export * as distinct from './distinct/index.js';
2
- export * as union from './union/index.js';
3
- export * from './cli.js';
4
- export * from './args.js';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generate/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA;AACzC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
@@ -1,5 +0,0 @@
1
- export * as distinct from './distinct/index.js';
2
- export * as union from './union/index.js';
3
- export * from './cli.js';
4
- export * from './args.js';
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generate/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA;AACzC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
@@ -1,52 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const argsSchema: z.ZodObject<{
3
- out: z.ZodString;
4
- overwrite: z.ZodOptional<z.ZodBoolean>;
5
- labels: z.ZodOptional<z.ZodString>;
6
- labelled: z.ZodOptional<z.ZodString>;
7
- unlabelled: z.ZodOptional<z.ZodString>;
8
- seed: z.ZodOptional<z.ZodNumber>;
9
- size: z.ZodOptional<z.ZodNumber>;
10
- allowDuplicates: z.ZodOptional<z.ZodBoolean>;
11
- allowDuplicatesLabelled: z.ZodOptional<z.ZodBoolean>;
12
- allowDuplicatesUnlabelled: z.ZodOptional<z.ZodBoolean>;
13
- minCorrect: z.ZodOptional<z.ZodNumber>;
14
- minIncorrect: z.ZodOptional<z.ZodNumber>;
15
- minLabelled: z.ZodOptional<z.ZodNumber>;
16
- maxLabelled: z.ZodOptional<z.ZodNumber>;
17
- count: z.ZodOptional<z.ZodNumber>;
18
- }, "strip", z.ZodTypeAny, {
19
- out: string;
20
- overwrite?: boolean | undefined;
21
- labels?: string | undefined;
22
- labelled?: string | undefined;
23
- unlabelled?: string | undefined;
24
- seed?: number | undefined;
25
- size?: number | undefined;
26
- allowDuplicates?: boolean | undefined;
27
- allowDuplicatesLabelled?: boolean | undefined;
28
- allowDuplicatesUnlabelled?: boolean | undefined;
29
- minCorrect?: number | undefined;
30
- minIncorrect?: number | undefined;
31
- minLabelled?: number | undefined;
32
- maxLabelled?: number | undefined;
33
- count?: number | undefined;
34
- }, {
35
- out: string;
36
- overwrite?: boolean | undefined;
37
- labels?: string | undefined;
38
- labelled?: string | undefined;
39
- unlabelled?: string | undefined;
40
- seed?: number | undefined;
41
- size?: number | undefined;
42
- allowDuplicates?: boolean | undefined;
43
- allowDuplicatesLabelled?: boolean | undefined;
44
- allowDuplicatesUnlabelled?: boolean | undefined;
45
- minCorrect?: number | undefined;
46
- minIncorrect?: number | undefined;
47
- minLabelled?: number | undefined;
48
- maxLabelled?: number | undefined;
49
- count?: number | undefined;
50
- }>;
51
- export type Args = z.infer<typeof argsSchema>;
52
- //# sourceMappingURL=args.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../../src/generate/union/args.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMrB,CAAA;AAEF,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA"}
@@ -1,11 +0,0 @@
1
- import { argsSchema as parentSchema } from '../args.js';
2
- // Args for generating a dataset
3
- import { z } from 'zod';
4
- export const argsSchema = parentSchema.extend({
5
- minCorrect: z.number().optional(),
6
- minIncorrect: z.number().optional(),
7
- minLabelled: z.number().optional(),
8
- maxLabelled: z.number().optional(),
9
- count: z.number().optional(),
10
- });
11
- //# sourceMappingURL=args.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"args.js","sourceRoot":"","sources":["../../../src/generate/union/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,YAAY,CAAA;AACvD,gCAAgC;AAEhC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,CAAC;IAC1C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAA"}
@@ -1,22 +0,0 @@
1
- import { ArgumentsCamelCase, Argv } from 'yargs';
2
- import { Logger } from '@prosopo/common';
3
- declare const _default: (cmdArgs?: {
4
- logger?: Logger;
5
- }) => {
6
- command: string;
7
- describe: string;
8
- builder: (yargs: Argv) => Argv<{
9
- count: number | undefined;
10
- } & {
11
- "min-correct": number | undefined;
12
- } & {
13
- "min-incorrect": number | undefined;
14
- } & {
15
- "min-labelled": number | undefined;
16
- } & {
17
- "max-labelled": number | undefined;
18
- }>;
19
- handler: (argv: ArgumentsCamelCase) => Promise<void>;
20
- };
21
- export default _default;
22
- //# sourceMappingURL=cli.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/generate/union/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;mCAId;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;;;qBAKpB,IAAI;;;;;;;;;;;oBAuBC,kBAAkB;;AA5BhD,wBAgCC"}
@@ -1,36 +0,0 @@
1
- import { __awaiter } from "tslib";
2
- import { argsSchema } from './args.js';
3
- import generate from './generate.js';
4
- export default (cmdArgs) => {
5
- return {
6
- command: 'union',
7
- describe: 'Generate distinct captchas producing captcha challenges comprising one or more rounds, mixing labelled and unlabelled data into a single round',
8
- builder: (yargs) => {
9
- return yargs
10
- .option('count', {
11
- type: 'number',
12
- description: 'Number of captchas to generate',
13
- })
14
- .option('min-correct', {
15
- type: 'number',
16
- description: 'Minimum number of target images in each captcha',
17
- })
18
- .option('min-incorrect', {
19
- type: 'number',
20
- description: 'Minimum number of incorrect images in each captcha',
21
- })
22
- .option('min-labelled', {
23
- type: 'number',
24
- description: 'Minimum number of labelled images in each captcha',
25
- })
26
- .option('max-labelled', {
27
- type: 'number',
28
- description: 'Maximum number of labelled images in each captcha',
29
- });
30
- },
31
- handler: (argv) => __awaiter(void 0, void 0, void 0, function* () {
32
- yield generate(argsSchema.parse(argv), cmdArgs === null || cmdArgs === void 0 ? void 0 : cmdArgs.logger);
33
- }),
34
- };
35
- };
36
- //# sourceMappingURL=cli.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/generate/union/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,QAAQ,MAAM,eAAe,CAAA;AAEpC,eAAe,CAAC,OAA6B,EAAE,EAAE;IAC7C,OAAO;QACH,OAAO,EAAE,OAAO;QAChB,QAAQ,EACJ,gJAAgJ;QACpJ,OAAO,EAAE,CAAC,KAAW,EAAE,EAAE;YACrB,OAAO,KAAK;iBACP,MAAM,CAAC,OAAO,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gCAAgC;aAChD,CAAC;iBACD,MAAM,CAAC,aAAa,EAAE;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iDAAiD;aACjE,CAAC;iBACD,MAAM,CAAC,eAAe,EAAE;gBACrB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oDAAoD;aACpE,CAAC;iBACD,MAAM,CAAC,cAAc,EAAE;gBACpB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mDAAmD;aACnE,CAAC;iBACD,MAAM,CAAC,cAAc,EAAE;gBACpB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mDAAmD;aACnE,CAAC,CAAA;QACV,CAAC;QACD,OAAO,EAAE,CAAO,IAAwB,EAAE,EAAE;YACxC,MAAM,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,CAAA;QAC3D,CAAC,CAAA;KACJ,CAAA;AACL,CAAC,CAAA"}
@@ -1,5 +0,0 @@
1
- import { Args } from './args.js';
2
- import { Logger } from '@prosopo/common';
3
- declare const _default: (args: Args, logger?: Logger) => Promise<void>;
4
- export default _default;
5
- //# sourceMappingURL=generate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/generate/union/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAahC,OAAO,EAAE,MAAM,EAAqC,MAAM,iBAAiB,CAAA;+BAO/C,IAAI,WAAW,MAAM;AAAjD,wBA6LC"}
@@ -1,168 +0,0 @@
1
- import { __awaiter } from "tslib";
2
- import { CaptchaTypes, CaptchasContainerSchema, DataSchema, LabelledDataSchema, LabelsContainerSchema, } from '@prosopo/types';
3
- import { ProsopoEnvError, getLoggerDefault } from '@prosopo/common';
4
- import { blake2AsHex } from '@polkadot/util-crypto';
5
- import { checkDuplicates } from '../util.js';
6
- import { lodash, setSeedGlobal } from '@prosopo/util';
7
- import bcrypt from 'bcrypt';
8
- import fs from 'fs';
9
- export default (args, logger) => __awaiter(void 0, void 0, void 0, function* () {
10
- logger = logger || getLoggerDefault();
11
- logger.debug(args, 'generating...');
12
- const outFile = args.out;
13
- const overwrite = args.overwrite || false;
14
- if (!overwrite && fs.existsSync(outFile)) {
15
- throw new ProsopoEnvError(new Error(`Output file already exists: ${outFile}`), 'FS.FILE_ALREADY_EXISTS');
16
- }
17
- const labelledMapFile = args.labelled;
18
- if (labelledMapFile && !fs.existsSync(labelledMapFile)) {
19
- throw new ProsopoEnvError(new Error(`Labelled map file does not exist: ${labelledMapFile}`), 'FS.FILE_NOT_FOUND');
20
- }
21
- const unlabelledMapFile = args.unlabelled;
22
- if (unlabelledMapFile && !fs.existsSync(unlabelledMapFile)) {
23
- throw new ProsopoEnvError(new Error(`Unlabelled map file does not exist: ${unlabelledMapFile}`), 'FS.FILE_NOT_FOUND');
24
- }
25
- const labelsFile = args.labels;
26
- const seed = args.seed || 0;
27
- const size = args.size || 9;
28
- const minCorrect = args.minCorrect || 1;
29
- const saltRounds = 10;
30
- const allowDuplicatesLabelled = args.allowDuplicatesLabelled || args.allowDuplicates || false;
31
- const allowDuplicatesUnlabelled = args.allowDuplicatesUnlabelled || args.allowDuplicates || false;
32
- const minIncorrect = Math.max(args.minIncorrect || 1, 1); // at least 1 incorrect image
33
- const minLabelled = minCorrect + minIncorrect; // min incorrect + correct
34
- const maxLabelled = Math.min(args.maxLabelled || size, size); // at least 1 labelled image
35
- const count = args.count || 0;
36
- // set the seed
37
- setSeedGlobal(seed);
38
- // get lodash (with seeded rng)
39
- const _ = lodash();
40
- // the captcha contains n images. Each of these images are either labelled, being correct or incorrect against the target, or unlabelled. To construct one of these captchas, we need to decide how many of the images should be labelled vs unlabelled, and then how many of the labelled images should be correct vs incorrect
41
- // in the traditional captcha, two rounds are produced, one with labelled images and the other with unlabelled images. This gives 18 images overall, 9 labels produced.
42
- // the parameters for generation can regulate how many labels are collected vs how much of a test the captcha posses. E.g. 18 images could have 16 unlabelled and 2 labelled, or 2 unlabelled and 16 labelled. The former is a better test of the user being human, but the latter is a better for maximising label collection.
43
- // if we focus on a single captcha round of 9 images, we must have at least 1 labelled correct image in the captcha for it to work, otherwise it's just a labelling phase, which normally isn't a problem but if we're treating these as tests for humanity too then we need some kind of test in there. (e.g. we abolish the labelled then unlabelled pattern of the challenge rounds in favour of mixing labelled and unlabelled data, but we then run a small chance of serving two completely unlabelled rounds if we don't set the min number of labelled images to 1 per captcha round)
44
- // load the map to get the labelled and unlabelled data
45
- const labelled = labelledMapFile
46
- ? LabelledDataSchema.parse(JSON.parse(fs.readFileSync(labelledMapFile, 'utf8'))).items
47
- : [];
48
- const unlabelled = unlabelledMapFile
49
- ? DataSchema.parse(JSON.parse(fs.readFileSync(unlabelledMapFile, 'utf8'))).items
50
- : [];
51
- // check for duplicates
52
- checkDuplicates(labelled, unlabelled, {
53
- allowDuplicatesLabelled,
54
- allowDuplicatesUnlabelled,
55
- });
56
- // split the labelled data by label
57
- const labelToImages = {};
58
- for (const entry of labelled) {
59
- labelToImages[entry.label] = labelToImages[entry.label] || [];
60
- labelToImages[entry.label].push(entry);
61
- }
62
- const targets = Object.keys(labelToImages);
63
- // load the labels from file
64
- // these are the labels that unlabelled data will be assigned to
65
- // note that these can be differen to the labels in the map file as the labelled data is independent of the unlabelled data in terms of labels
66
- const labels = [];
67
- if (labelsFile && fs.existsSync(labelsFile)) {
68
- labels.push(...[...LabelsContainerSchema.parse(JSON.parse(fs.readFileSync(labelsFile, 'utf8'))).labels]);
69
- }
70
- else {
71
- // else use the labels from the labelled data
72
- labels.push(...[...targets]);
73
- }
74
- // generate n captchas
75
- const captchas = [];
76
- for (let i = 0; i < count; i++) {
77
- logger.info(`generating captcha ${i + 1} of ${count}`);
78
- if (targets.length <= 1) {
79
- throw new ProsopoEnvError(new Error(`not enough different labels in labelled data: ${labelledMapFile}`), 'DATASET.NOT_ENOUGH_LABELS');
80
- }
81
- // uniformly sample targets
82
- const target = targets[i % targets.length];
83
- const notTargets = targets.filter((t) => t !== target);
84
- // how many labelled images should be in the captcha?
85
- const nLabelled = _.random(minLabelled, maxLabelled);
86
- // how many correct labelled images should be in the captcha?
87
- const maxCorrect = nLabelled - minCorrect;
88
- const nCorrect = _.random(minCorrect, maxCorrect);
89
- const nIncorrect = nLabelled - nCorrect;
90
- const nUnlabelled = size - nLabelled;
91
- const targetItems = labelToImages[target];
92
- const notTargetItems = notTargets.map((notTarget) => labelToImages[notTarget]).flat();
93
- if (nUnlabelled > unlabelled.length) {
94
- throw new ProsopoEnvError(new Error(`not enough unlabelled data`), 'DATASET.NOT_ENOUGH_IMAGES');
95
- }
96
- if (nCorrect > targetItems.length) {
97
- throw new ProsopoEnvError(new Error(`not enough images for target (${target})`), 'DATASET.NOT_ENOUGH_IMAGES');
98
- }
99
- if (nIncorrect > notTargetItems.length) {
100
- throw new ProsopoEnvError(new Error(`not enough non-matching images for target (${target})`), 'DATASET.NOT_ENOUGH_IMAGES');
101
- }
102
- // get the correct items
103
- const correctItems = _.sampleSize(targetItems, nCorrect);
104
- // get the incorrect items
105
- const incorrectItems = _.sampleSize(notTargetItems, nIncorrect);
106
- // get the unlabelled items
107
- const unlabelledItems = new Set();
108
- while (unlabelledItems.size < size - nLabelled) {
109
- // get a random image from the unlabelled data
110
- const image = unlabelled[_.random(0, unlabelled.length - 1)];
111
- unlabelledItems.add(image);
112
- }
113
- let items = [...correctItems, ...incorrectItems, ...unlabelledItems];
114
- let indices = [...Array(items.length).keys()];
115
- indices = _.shuffle(indices);
116
- items = indices.map((i) => items[i]);
117
- items = items.map((item) => {
118
- return {
119
- data: item.data,
120
- hash: item.hash,
121
- type: item.type,
122
- };
123
- });
124
- // the first n indices are the correct items
125
- const solution = indices
126
- .map((index, i) => {
127
- return {
128
- pre: index,
129
- post: i, // the index of the item in the shuffled array
130
- };
131
- })
132
- .filter((item) => item.pre < correctItems.length) // keep all items that were in the first n slots of the original item array - these were the correct items
133
- .map((item) => {
134
- return item.post; // return the index in the shuffled array
135
- });
136
- // the unlabelled indices were after the correct and incorrect
137
- const unlabelledIndices = indices
138
- .map((index, i) => {
139
- return {
140
- pre: index,
141
- post: i, // the index of the item in the shuffled array
142
- };
143
- })
144
- .filter((item) => item.pre >= correctItems.length + incorrectItems.length) // keep all items that were in the first n slots of the original item array - these were the correct items
145
- .map((item) => {
146
- return item.post; // return the index in the shuffled array
147
- });
148
- const salt = blake2AsHex(bcrypt.genSaltSync(saltRounds));
149
- // create the captcha
150
- const captcha = {
151
- salt,
152
- target,
153
- items,
154
- solution,
155
- unlabelled: unlabelledIndices,
156
- };
157
- captchas.push(captcha);
158
- }
159
- // write to file
160
- const output = {
161
- captchas,
162
- format: CaptchaTypes.SelectAll,
163
- };
164
- // verify the output
165
- CaptchasContainerSchema.parse(output);
166
- fs.writeFileSync(outFile, JSON.stringify(output, null, 4));
167
- });
168
- //# sourceMappingURL=generate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/generate/union/generate.ts"],"names":[],"mappings":";AACA,OAAO,EACH,YAAY,EAGZ,uBAAuB,EACvB,UAAU,EAEV,kBAAkB,EAElB,qBAAqB,GAExB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAU,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,eAAe,CAAO,IAAU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-1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generate/union/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
@@ -1,4 +0,0 @@
1
- export * from './generate.js';
2
- export * from './cli.js';
3
- export * from './args.js';
4
- //# sourceMappingURL=index.js.map