@prosopo/datasets-fs 0.2.11 → 0.2.13
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/dist/tests/data/flat/data.json +364 -0
- package/dist/tests/data/flat_resized/captchas_v1.json +5155 -0
- package/dist/tests/data/flat_resized/captchas_v2.json +5305 -0
- package/dist/tests/data/flat_resized/data.json +364 -0
- package/package.json +4 -4
- package/src/cli/cli.ts +61 -0
- package/src/cli/cliCommand.ts +52 -0
- package/src/cli/cliCommandComposite.ts +38 -0
- package/src/cli.ts +37 -0
- package/src/commands/flatten.ts +120 -0
- package/src/commands/generate.ts +177 -0
- package/src/commands/generateV1.ts +221 -0
- package/src/commands/generateV2.ts +235 -0
- package/src/commands/get.ts +84 -0
- package/src/commands/labels.ts +54 -0
- package/src/commands/relocate.ts +83 -0
- package/src/commands/resize.ts +137 -0
- package/src/dummy.ts +35 -0
- package/src/index.ts +14 -0
- package/src/tests/data/flat/data.json +364 -0
- package/src/tests/data/flat/images/0x1038adbe1bc5ffb5e1f180ce9fa5f727a02a43d950ba630d0a3003c95aa67609cbce9121428095180fb0442aa52b8eb4c9af3ab4497db072919e6fe65e70682b.png +0 -0
- package/src/tests/data/flat/images/0x1e72b814d54da74f13a5bdc56629dd0e9c6a33ac193870b3560194cff405c0c0dee3165ef4cd41cd6251df3024ac743ef8f1548a85861bc3ba680734f9ea3269.png +0 -0
- package/src/tests/data/flat/images/0x1f7c611483d586630dd7cc35b2114212b2a771e709dc3e05eaa400bf34c08f59e484e4cc63658c63cee63988ea1989896f1dcd2d9c5bbdfdab4b3710017bb5fd.png +0 -0
- package/src/tests/data/flat/images/0x20b2c989b9e8689d903490cc5cadafdf3a86a5d5e1445f42a8f77465ae659688a9cf2e3272f6c0d1945da26f1bcfcb6d21954c18c2bde806214e629d3b9d89a8.png +0 -0
- package/src/tests/data/flat/images/0x2a707f216df918ace936313a986faadf45141438f0d22953d1ccae7417a1a29b40bf5940a7355f035473dd5c75ef30127d8a057c1901d4f2d2950561b78b253d.png +0 -0
- package/src/tests/data/flat/images/0x2abca0559027978fdd6f4459745f13a4e2d10ac4f16e68dd1b4e236f19462b892d749cac2baf2d1a714b592593176e6309d192ce5363d7f4707c4e0aa6b18abb.png +0 -0
- package/src/tests/data/flat/images/0x2e72dcae73dcd9347896d7c32d9674b885a0beac8ae9acc24eb23e3244a169f2d4b17a2958d24dc87be1e3ae1bfe73fe1b0748a4653a191630fb86f3b58bb4a9.png +0 -0
- package/src/tests/data/flat/images/0x329e1e9223cc4747ff9c6306dc3affdbcceff0e629f19503ad548ca1a82da61d3781986cbd267b98f756f9bb2c8e7a879be5085028069eb3f380d5a32be81ed4.png +0 -0
- package/src/tests/data/flat/images/0x33a99c18c2794a36a0d524a76733a59d10743c04246263c8afe3ace1a96f73e40f964add43ec3d6d8efa9beeaa56eda6ece598fe1e3b520047b83886d6983a83.png +0 -0
- package/src/tests/data/flat/images/0x3992f2d799a25f4ce8e5177fa8df1d76f5afc33cc1738677d5f660ee11c963303926f6d9cd634755f0bb57a9bd0d15073a8fbe3543f569e26a34100b705ef161.png +0 -0
- package/src/tests/data/flat/images/0x42b08dc541114729b85ef41bb07755c8cc9fc635055bda4e8e6d80b6ee43c3d5f702bd76ba2e6abf45f4d9bba2a070c2d3dd76205f7189539b55a95f2e928ece.jpeg +0 -0
- package/src/tests/data/flat/images/0x4390534b3a60fbf35f456da7a0bd7c86652dbf33e2ba739b1610d5bbe008353113ceeedb68b0672fd74ad015812f02181c4e29ea9cd937a90f21e2514e79dbea.jpeg +0 -0
- package/src/tests/data/flat/images/0x46f2eb852f938dfd0b879a93c8098931186ecacae49a2821e4c43fade1660030bdf03938caa278a9acc78dd1751c467c857a7689c659508933010034be01be7d.png +0 -0
- package/src/tests/data/flat/images/0x48bb86605fcd86ad2f471746d200bdf4124dad0db82066e4624ec57921ad743b750de21504f3979e33c7261dc8f54a6c84eab6308e5752b74096b12b6dde629d.png +0 -0
- package/src/tests/data/flat/images/0x494bc81803193093ac9b6c0c4a5f91dc24e85641718cc0f4c9f8778f488fb14c80b10ad03d4982adbb74f2b6157bf02d30e0a6874e53780c5657d90029331601.png +0 -0
- package/src/tests/data/flat/images/0x4f6de6838022ac6d4c2cea1ab2f4471041c43d6bf765f249e96ddea235e96472041a8125daaadd728a7dc218535d92524f0c3335807807783034c27e3b743718.png +0 -0
- package/src/tests/data/flat/images/0x50c5e0685168371ad05ca4946ca1434b34769ad26dd9bb825ee504ab77260b3002ddf7a8d24474e94cdc18d5798bae7bac868336fb7c33193f9c86f77e949fba.png +0 -0
- package/src/tests/data/flat/images/0x53e69925b5e8dfb60c07e5dfc44742474f5004428e6f3cd8c8a3892ff86d2211cff97d6b0d4c50930786761117b17f579ca7c2d4379d7836c2435c657950b902.png +0 -0
- package/src/tests/data/flat/images/0x5442346936e3ce8d1b4e78f4c60e64e79b4e92b59877055557a01639643eb933f26b3e8d588361688a2f6a0c66558f06f2615028271af1eedfa66fd90b63a91b.jpeg +0 -0
- package/src/tests/data/flat/images/0x54ca27391394ad7b5c98c5d9a3875e4527d33dd0a1ba72401e39991e4093837a52d7f936c619722fd7ce602cda7cbe89c01b0c3b526a3dd61bcfb60b364951d7.png +0 -0
- package/src/tests/data/flat/images/0x5ebabefb53c4d07cd1ec002547f452ec6053840dcc28b2e507364c5307a28cbc3d9698a24f09ed01985aa290da3acd4d86aea2f9f53753f0bcca994953e474eb.png +0 -0
- package/src/tests/data/flat/images/0x615c5079cd4b29a062acbb916780720c0eeb91cd82d9c5f78c9a73ddda29d8842ff85a0d99e863405861d83fd275b78bcead4f61ca8edc3cb94e7093e0a134c7.png +0 -0
- package/src/tests/data/flat/images/0x647083b9336b47b04310e52dc5e370f64ba2bf2f78bd66196af880acd4ea1f8a132a1f8ed25be2a796d43dc40fd151548387ab4de6823758cf774cb619819be0.png +0 -0
- package/src/tests/data/flat/images/0x65341641633dd9baa7bb44fab08b9edd6610db285dcdc887c46221af8623711ce2b546a79743ce7240d783f2e9008751ab82cf2f8341e321b6b887b00a13ef85.png +0 -0
- package/src/tests/data/flat/images/0x686b4a49ecf931afd1b9c74e5a24c907b47f81d2a95579338e3949e8948da6ad3b79e8918d65b779e8bd306e7b7502463eabfc6fe94611c04a46030403d18102.png +0 -0
- package/src/tests/data/flat/images/0x68b2d1f5c248de0eef95f94d9d2dac3c97c8a67f5a2516b50128ae384c7674c7c88fd4e646e9ce3a2e5514cc4b0b36f2078abc57fd1cec605642f8c5ad04e160.png +0 -0
- package/src/tests/data/flat/images/0x69fe4e2faf45b992867f5fcc7be8aea91b332b4769affa4c081264d3a72ea180d9fbe4aac4048cab7413f8e8167565c694e0f9d9d602b24871103c932ecb326a.jpeg +0 -0
- package/src/tests/data/flat/images/0x6e63ab048e72fd41aa59b1434a5b95f1eb2099438ef0a171db1226cde3cda867b99e021d8628c70bedec891ce5bf0e88c302770808f069813a73d77b1771b433.png +0 -0
- package/src/tests/data/flat/images/0x75b79fc445b2bd17231b4f0dc170b646b14d2f732c0236b1bbef10876923ea02ecadd6aabb08ded4f70ba6a96d8789a3131e70a0d79b2644a266f1cfb5821a88.png +0 -0
- package/src/tests/data/flat/images/0x76521ba228624fe9522c8e2d83a1968346e9fab7228446b9f2971064e1992decaba658c11b4bad4767ddeb16e46689270a923b4cf42744d6e1130c86993cc285.png +0 -0
- package/src/tests/data/flat/images/0x7e9747cdd5678279cf005a57a65064080348ba230d63a3a134db327b83c05ace94338cda19002fcba60a18d6ad621477059417ae2e4518eb37655231823fc314.png +0 -0
- package/src/tests/data/flat/images/0x8384c8c5bce81541dd0fb19f2f573964cf318dab654f2792af5656073c1bc22bbe6e73e81e9f6cd9244bd1f7262160854c648683f6cfe3b14f751ba716f511fb.png +0 -0
- package/src/tests/data/flat/images/0x860e81897a1b0204fb5edf3e2355e97990b25badfba7f5bb5632b16dd6da13592fc918a8784f7f4efd0550334479b604cb0a239dc58d83739eadc84fb879996f.png +0 -0
- package/src/tests/data/flat/images/0x86df2da9d3e28bc5313bc1619e2127b538ef2bb08053c36e53a2ede6ba565d67aed2c65202fb180d578f7265d5b4d1c54a09f7e52b0afd12437699a9884642b7.png +0 -0
- package/src/tests/data/flat/images/0x90b87fdaff3e58d32f85d941cad8ac08bf84e0b4fc5c95249e1cc9099dc4aae8271eb701ffcd7617ba886db35357f40b6eda18356c5cbf3894dd3b78d1a24b97.png +0 -0
- package/src/tests/data/flat/images/0x93db31c0522148040443c135d25abc6e3deb37578e4a14d6dd8c7000e0ea6d69c78840e069784ee6e9f2d3524c78c33264a3f8e93eef343942ae7e15d1ba720c.png +0 -0
- package/src/tests/data/flat/images/0x9e682c515b2e8aade0ddfde284ee2cbc61153807602b78476738a2a4842ffe2cc34ff481ad521146a55615877bf9e62655164499dfce41aa75416c192d06ecf6.png +0 -0
- package/src/tests/data/flat/images/0xab7bd3f47ed451578ada004482674ded11a4fac2297552b0e214eb1fe24cdd3355763a7d983b8b8d34197266aa5c2cb1c32382699d8ba7b98a42358c67009649.png +0 -0
- package/src/tests/data/flat/images/0xacaa0f9c8d9bb6660c5047db2e09e2b35e567fa193db03ba32eb62ea4d27d736d61246f1949f64de111d222abc3f84ac400af013da1115140743ce7dce571dea.png +0 -0
- package/src/tests/data/flat/images/0xb1842196f070d2a608eac92ff489cd825f0d379ec0d02a4a736a58aea8035224e584b59dac99f7d27326791299989bbe3cdfbb9972c16d285afb6094639e7fee.png +0 -0
- package/src/tests/data/flat/images/0xb313323422cb06c93b37309d097869de24ff74146c2693bb5a0df5e7d26c5d8fa502bd98f0f4905ccfd00b66299f25d0ecf18b25b9b715a1bada9c3442b2ebc0.jpeg +0 -0
- package/src/tests/data/flat/images/0xbc0568a00d104800cc8732cda70e154cc71fe2a890d84a593071685f63b1af89ebb74736752750c0ad385ce0e2fd4acd808d2eeb18f4c5ad0d0f1eee1d57351a.png +0 -0
- package/src/tests/data/flat/images/0xc12ed6e8c7b674a8e6bdd0042b9a0debc8c16973195072f833b205ca7635b9d0f2da04a225347f7234f9d23ac4e579c00817a24657e06447158ed4420da47749.png +0 -0
- package/src/tests/data/flat/images/0xc2594429d72436068dfa5902593658843b3908eddfed9b83f5f0ecebce181278a07f35b443832d5f65ee31f9e4624155d3c729ebbc49c2f950e01348860c12c1.png +0 -0
- package/src/tests/data/flat/images/0xc5c2d1a2a27b758bba3551b96153c8e8fbf8122fd2b78584b23930ce885ff980ffb35cd23829ed3b3a4c3ec9472f3949bf9faeace92addcb9fa23bf87b105e0d.png +0 -0
- package/src/tests/data/flat/images/0xc6c918e59541d4013e41f40937290f10d6485b8c630e0ec3d0c903c85dc30dde523270df43a74bd75e966ee02bdafce588fae7a2f73c00545a27e84e1ce1b396.png +0 -0
- package/src/tests/data/flat/images/0xc8c98569e856f28f25783cc70ebfe249645107ed272b0ab0f83869c7686b255041d0b413755bf58cf1e0c3eaa0b89e5b55100eaeb715ed7a83c6ae289223535a.png +0 -0
- package/src/tests/data/flat/images/0xd76617a835930389357f28b5d7243bd25aeb45aaaf2257e249a8827bc12222a021b0cf46bb69d408fa7770f79aa0a1cbb28b0ca4438e7fc44b4f73d3b6260a38.jpeg +0 -0
- package/src/tests/data/flat/images/0xd9a3fba1abef24113643624d098e580808ec3952b9eda9dc5f8f1b63afa5401849c4457eb3fb1ddb17a7aa8d24e5cb54a2daafff84426177ecafccbb865770ef.jpeg +0 -0
- package/src/tests/data/flat/images/0xe6e6e36125ae28553d26600090be932511ae21fb6f0029485111dec2cd9c55ed1d568536e6125debb62481075c700e12cc6a3994d1846318a420cd616f82593d.png +0 -0
- package/src/tests/data/flat/images/0xe88a72fb70a000b24a73bc781ecc8b0ef0e66779346067f467722438266e0177a2bbc94be1ff3e0282c7484a13869e22ae8bc184590a4b59106ebc234806b243.jpeg +0 -0
- package/src/tests/data/flat/images/0xea764f65041a907eba37761807cd24ca38fa16517ca4bf25a114609bcc343e48da350efbca1f676337f8e251f8b3a35be8a28a4488db9280ec79de251ffb25c1.png +0 -0
- package/src/tests/data/flat/images/0xebdd539eceb3ba21f5ab2f541641dcb11b7c1c2429dfddd2d880d874bbdf643949b7e976c82c0a531e2bebc1f4dadcd602dcb4d706d54527bcfe30a410c0d115.png +0 -0
- package/src/tests/data/flat/images/0xebf84491d7b258e71d21e16b75f29163a2d5a20e6c5176d989c0ff3ff12ac3e9203193133ce222602c95cf574983fab2bb27b9e2f7b572c870f91a3bf17e5eb7.jpeg +0 -0
- package/src/tests/data/flat/images/0xefe4b1ba734f887e3ce2776110eab7a0d6ae7c6d74e08194be9374c1ff1a4cddd8993dc43e5cf4b6d256dc1156f3b26ceaec9182b98b8b11cfa3c8c3bb1dc8ca.png +0 -0
- package/src/tests/data/flat/images/0xf154d51d2999f623fc0f375a94d4d1e77d54ce4888d7af8e766b2ea5a02eed902bc56149bf348ee1a50bc2c9ab78d2c780f55b431db6ce4b23fe3b71a32ca641.png +0 -0
- package/src/tests/data/flat/images/0xf91877c76deba75bc5760238f61e77806a8486d1a6b09bab13e13c08de8b2cfd74a0f22057064cca459ee64be44be4301de887a72fc1c4c31acc9a02f14a345c.png +0 -0
- package/src/tests/data/flat/images/0xfa48acf1439c2537d1d3268796dfec0777e605c87b5092be55cbaeb1318782c6761de8d01951c99cd28a61ebc353ab6ab18de1dc6977dfc406ac1d8649a5bcfa.png +0 -0
- package/src/tests/data/flat/images/0xfec746312e0fcb2631eb0486a3ed88e35ba95737aadef55aa95cdcdec9fc1a3276eb2de555bbc4f467b8c900b53581a3375390064afd9c9634a45978ebb5bd3e.png +0 -0
- package/src/tests/data/flat/images/0xfeda2fa5da1b8b068baf09870cd4fd3a1ba01e14fc79e759c11e2c1a8ef7d75fc5cf49a86d06c94b371f30aec5c4afd1a4f583881fd62afc40cb012cd3d50b85.png +0 -0
- package/src/tests/data/flat_resized/captchas_v1.json +5155 -0
- package/src/tests/data/flat_resized/captchas_v2.json +5305 -0
- package/src/tests/data/flat_resized/data.json +364 -0
- package/src/tests/data/flat_resized/images/0x00db19a7c62a7ed3998c596215d455077cfa6ea6a9a0d9e5e9189cbde565cf1cc11e18046e01434a67937e9574c35ac3a1ed293dc2bb606e8d419aed61edf70e.png +0 -0
- package/src/tests/data/flat_resized/images/0x02606f6d654cc3780b67077783d8b1d0d482b224ccd0908f9e38e55a16cf6e5eb62b42559e48d881107d00fe2fe3d0d275879d700dcde504c855576548101503.png +0 -0
- package/src/tests/data/flat_resized/images/0x0398b3b46e8e5ffe4206919c2f0f30b94c8867097533128b12df6ff241e2e97764acf8d8fd2955875594b11c2a41f0d3e0071843f09f67a2dbad678072db4455.png +0 -0
- package/src/tests/data/flat_resized/images/0x0659321c2c380fab15f2405128e2439faac7cb8555e217bcafa5bc8a354d6cfce7015203e5e61101a31dfbc637a8d5c65d85b6ee48867499895957c4db5af16a.png +0 -0
- package/src/tests/data/flat_resized/images/0x077d377cd794017fffc8c70c12fc056d7f03f1e24c54b56bc6c13af8a75f033b0883b64502b9afa5329819ac429318ca42f4e2cb5b446ca7a3b5a169ca5354a2.png +0 -0
- package/src/tests/data/flat_resized/images/0x0e3aafb28186acb2b51acd0123c55650b5019c0854e1e478ef1e61aba0033cc3b9d651e314602929a077a67fde2bfbe68c99ec89823abb381a8994aa7098e63a.png +0 -0
- package/src/tests/data/flat_resized/images/0x1a1b08462b094f2def0d8e2659dd1bfe3dbf25fc5b06222b45471d6a84c19f6f69ed996190e05de668bd4afe6df30c6f2b942a3047503e70d95034b155695c45.png +0 -0
- package/src/tests/data/flat_resized/images/0x1e553d6c4afd65c3441aa00970ca9e5919c1c9efc19ee800e45d61eb26e442e7a7dd9a80b34882a18887856b14e9df9e6dd979427bbdbb9e8090df394b0844b7.png +0 -0
- package/src/tests/data/flat_resized/images/0x22938433d07d39fcfbb9538233f57b537d673b0c6022d2cb1b730e42a43b317a50313def95c6e651b0ca1154510ea462a4feee3a0e71bc8f42837bd0e1737c41.png +0 -0
- package/src/tests/data/flat_resized/images/0x25e0a29caac87e8258350c623bba6aebf0a427f0419bde1889d3b365de8f83ad5dfd4c5e8bf7952da3e8864a689b9f0ddc730d6184e85a7b420d349c3d7b8ecd.png +0 -0
- package/src/tests/data/flat_resized/images/0x2670edc73900aac804f21106694f1f1d46ce843abb622f5b638e7974f3dcec96ad031000205786f2745a72f8397e63a410058b16cca850418cda76c82629375c.png +0 -0
- package/src/tests/data/flat_resized/images/0x367af181b8fb20198197e3d7c0b52a36c2ff3ac4dc790056a7d055b0baee38c03a9038c79fc59510764de08bbb7c14307c2d21ebcb4313599782687cb40a0646.png +0 -0
- package/src/tests/data/flat_resized/images/0x3d02bf1afaea86d6cc0aea9e84c6745f845faa308ceac297166fd0850a944f808b10728c2f38f67ea87962ca4a1b4f4074bbaa630caf0d91998184a32e11a77d.png +0 -0
- package/src/tests/data/flat_resized/images/0x3e8e0f6276b6ab68722cc3e827c0a4a9d7d1575ace6527a3c76e103c0f3a4259530d3a6e626af0b19e35a5d13505013c67553fe498b0fe0e7a4060d4003324a8.png +0 -0
- package/src/tests/data/flat_resized/images/0x4190ae0531224be458e3a14e13af0751311ea350636a365f9144438555c56cea075a70d2c6d0c64fb8311ff674cd2b357b0c07de388a5014129e159b9f29d31b.png +0 -0
- package/src/tests/data/flat_resized/images/0x42c68ccc53bc41eb731952ea2adce62be61a7b81c167f6f0b2ba4ee1d2d449d45c44eddc48f9c169902cf35ba1c8739a09848faf8c632775ca257026e4a79f8f.png +0 -0
- package/src/tests/data/flat_resized/images/0x441aee1e0f3c90af8f5d96eece0d476a722fe93883aff615c3c966fac27e814c451eb6fb92ad18c20ae5c798fc23b55a180db9c4d416e8cb3ea0b85cec7565f7.png +0 -0
- package/src/tests/data/flat_resized/images/0x46640f912f03eb60cd4afbb8d6fc14b2f0c14ab93dee203681ab997cd7e43cb58d1782b31d549a158180c7a2f9b2c500c848a2047e740d8c4ac14a320d607320.png +0 -0
- package/src/tests/data/flat_resized/images/0x475b502023789ec81e8653253906a75d0e4e17857117b367999268a5b0b7a8638256eca95d8cc7280a275de8c884a442abb3dd3f7b9f28f2de79df39628ba8a6.png +0 -0
- package/src/tests/data/flat_resized/images/0x4ce6c8a8dd7b35afebf35ee25514694c947bcb082acd370fa5cee4b650548bcf0e21a864e1a99320dea5369f1b3a6b5240bcbca420972a8f1ec06a713b900b82.png +0 -0
- package/src/tests/data/flat_resized/images/0x4fb674a19e4db835814fffc3872df8a661694e0deec3af347cd19e199c5539e5988c72052e79f21e0035d328d522aec983ac2379209eebd56859bdd5f400a70c.png +0 -0
- package/src/tests/data/flat_resized/images/0x5068adcbae2342e7208e394f57b5921df657b1e53b2696cfcb885a9298597fd7645ee1f1a0ff423be46645ca3a30d929ca59a23139ecab0e6ffecd76f3bc6558.png +0 -0
- package/src/tests/data/flat_resized/images/0x511c1fb6c24e2db829767c0503ed3fb5d83d2fc512bd4f53879f2a639095a05b9a104f968dae26e8fa2385c9978c55fa0a646fa07694b6403e4497ad7ad10a59.png +0 -0
- package/src/tests/data/flat_resized/images/0x55709825a4883482be0d647137464f012f61009149ebe8d27b2ad8445064741592795a3d02da53fc9b42e049d0e8d764ba195541267baa2788cd6985197647f8.png +0 -0
- package/src/tests/data/flat_resized/images/0x5cafe30f3eed6c7e6f64e34a081e50317892ac7f235c5fe865e224d8363d65b1b2d9f1f6c8b5736c0f3a932740b9b31eefd7f0ec13a16e4dfca541012adc0b2d.png +0 -0
- package/src/tests/data/flat_resized/images/0x69926ed2721a19f01cf8829611399412e74e5780c64f00c1610aba0a832d9e440399f13471e8cc019fcc2ec372571d1b1a583a967f21fa1cd68607cadf2f7f8c.png +0 -0
- package/src/tests/data/flat_resized/images/0x72b1fdf0560059de27bc796fd0ac98e083277157b2ac2ee1f5812ab4e34a781aa15b7372961dc69c4f562df5143ce356b184acd9409803ce1d443ca39d257952.png +0 -0
- package/src/tests/data/flat_resized/images/0x760fa7f860a1e0925b827f6aa83e52d7e76a70f55e263da07c6997b6c641987f78dc208ce97cec2eb3d68a2e653acc7d308ce4e242891573b4d50281822f5485.png +0 -0
- package/src/tests/data/flat_resized/images/0x77fe0772ef80332ac3cb48d5c84be6fefec0ad90607ec45c509edda2a6b63e389895693821a9ee99a2d824cf71fa9bea4458ca3de8353ae60f489fa6e3961878.png +0 -0
- package/src/tests/data/flat_resized/images/0x7da2f1e8dd907863f6ffd9dd3a3d24d3ac28797a3429210c24be3c83e1cc6028e040250e7c765f99a85a3edd7d0a3978b46a8bfff134120b309c494d7484e24d.png +0 -0
- package/src/tests/data/flat_resized/images/0x7f45ee498813ebe3d314d9071d126341ab14887d8754d5571d4858f93a07c7a8d19687a76f3f2f42dc110f573626c32f52475bc6e0d8b714c2773a13cf08f8bd.png +0 -0
- package/src/tests/data/flat_resized/images/0x8343903b4ce3b63ffc4a66e805a18dc1cc136a91c8f67f15f261aec61c9ad58ad1856c84fe0ac97d1edc4b21f6b5b1842cc7b211328e460ed75bfad3dbb9ff16.png +0 -0
- package/src/tests/data/flat_resized/images/0x884c86c6b69bd29db658b3612f484bdf78e1420434082a68636f69e3d90e3cd76cf9718e099ff0ab16d7f27d8c5a3c09dcbd136d9ee01cd1d4ec72de672bea66.png +0 -0
- package/src/tests/data/flat_resized/images/0x88f06b2a1ce4f7e9b491a84919b59939a76baea88a48e88e95ebe48383cc15631d8524b7a9ec73cc4cba7568dcc1c7bddef4ff45c6992300e10111baf4a61971.png +0 -0
- package/src/tests/data/flat_resized/images/0x8ca8bc45e79bd59205fbd77b24e09e4c6ee437f27d02fc30b825037cfae6f2583f7b9d0b6a004c5a2ef9774ca1d3b45ffb94fdfabcffcdddfcd5838f2a489d3b.png +0 -0
- package/src/tests/data/flat_resized/images/0x8cf36665bbccaec073e346777f974edbbd7ec534e78426d6ae13dc39740271024527e945fef06d8dd78b1345c87e1b3f90f28385531910d3a0795f45a7030438.png +0 -0
- package/src/tests/data/flat_resized/images/0x9134327ca5ec7a5c6e1f6d8e8aa395c445d439dc32c1bbc84721b18d04fcee8394a559c362bcf6bb1e92e2d8edcf6d5dd73f1cf302a38dd646bbed2d27a6ce8f.png +0 -0
- package/src/tests/data/flat_resized/images/0x9401d4dde02ebdcdd64827653b90b3337485c8fb59796ee6dbefd3866404b47ca4663175b7acfad49eac177baeb8df7304bced6713f85d50767144dcb436c66c.png +0 -0
- package/src/tests/data/flat_resized/images/0x977448bb1fa3594a3d91b2a37acd6967ca42252f0062ed5253040f200230395e7924a4dcc392bf26ec6d2c7c1d3204db2c5fcedb4c9d21a2a90ee018df2e6ae6.png +0 -0
- package/src/tests/data/flat_resized/images/0x99da74b964a5dd03c619aa375ccf5dd69eb34fba3bf0e48f8e34ce2c9a1f4bf5fffcd1be4fcebebfdea61ab27bb8d36060950d6c19b7c8a89c7316a724db7a4c.png +0 -0
- package/src/tests/data/flat_resized/images/0x9b7dfbc8196a9d5b140f56b7eec0467c9d8a3e38ff7c017c33700040f6c98e2b79a0960f7a919d7f1ed7b435a49dce508b113ebda88331629ee8492ca29439af.png +0 -0
- package/src/tests/data/flat_resized/images/0xa6d77ccef52e07120c9295502b9dc972107f704abf6f4fd57dd2b8664db9fdc2c104e30e69e2c61cf1d88f8cdaeea204a2c332d49fd7ad1f61bbda7ea22bb77e.png +0 -0
- package/src/tests/data/flat_resized/images/0xa791e01f34c89768df8a82869d31e5ce813adb84a3cdc7be5ebe55503375fc89d49974a3a8987292b92423ded092e488130957f4725e93d21c14d0a91a2f81ed.png +0 -0
- package/src/tests/data/flat_resized/images/0xb31d7cab98df328d0f4a32b2969ec8e294cb4c2d1ab8bf46471a113b63c0d39c3ccb5cca55a8b46a2161c836a9fb1643e0d673e933cf21c8e4f4e46f0e1f0e96.png +0 -0
- package/src/tests/data/flat_resized/images/0xbc50b9d2fc9272318a3a51e555ab744a1205112d38e308caac67975ff367fabc636a6567072bdd3bda1368ccc78863c6ea115f91cb7e4a57349baca6d6d01e24.png +0 -0
- package/src/tests/data/flat_resized/images/0xc322ec6d7a03c9baade16ee7a71414edfe6839d7cbe5805f3632d158616d9b51f455d1daa39167359a189878905ec8d77f3e44022ec4481197f85a98d38ed345.png +0 -0
- package/src/tests/data/flat_resized/images/0xc5293e66e847653ca0361f1fd1460c573a66be57b769a8a41b8fb8b42da4417ff1a91c4ef037ca5b2a1f0b5797dc62db2090d88047a80a09e93eacc080e60bb2.png +0 -0
- package/src/tests/data/flat_resized/images/0xc8d934f2e7ac8429086669bb0788296844946834b5a3d2f3a44db276e06d7856c3782692d8bb9ba4122098d4027ca3642f32cdc7978f44493634b21b82c735c7.png +0 -0
- package/src/tests/data/flat_resized/images/0xc9473fa10f0aa11856eef9683cf99fa7f2bac77e5b0ab0f08a99c002289b0ca684bfbe7504dd3124dea9fb1f4be68caf09a4c3fa0bfa890a371ace855e649c16.png +0 -0
- package/src/tests/data/flat_resized/images/0xd3dd338481d82174ef911f76605f1c9ecf20660a65e23ab2130211c6533d018b021303d37423a641188cbe56a447beee86916cea9be935b1cbca88eb1c1c31fb.png +0 -0
- package/src/tests/data/flat_resized/images/0xd8df8225474e38f1034448afeee0bdcb2888f7ea09ef5f280317cf2c8a3be2f804b0e36fe5769c1f20de3de5b87e174b7bac19807cc5f181938344d53326df7f.png +0 -0
- package/src/tests/data/flat_resized/images/0xde8990cc77d25bdc35d4c258113dc8243af7dfb5ce3a1b00ac2e656ce84ea06c1d2a0d9740787eb1dbcc70226f18a3eaf0e16f627d828ad56d22ebc3ffa8ec49.png +0 -0
- package/src/tests/data/flat_resized/images/0xdf36bf20893c56da991a71f1244aaf032cf938334ce4645a856e96a2170508e5ba6b74948f43314eda7782e1169051e4ee1b276b9b8a048e08068f4d3af3e55a.png +0 -0
- package/src/tests/data/flat_resized/images/0xe8198b8b0e5c51c576f50853c448467a55e33005cc185225a57849c63e84267c340d2d142d391955053ebe14b0322550480341468cf5e9fcaedbf73873e9b245.png +0 -0
- package/src/tests/data/flat_resized/images/0xe94dcbd223afb4dfc9fb7f04095114ce611e6acb5b34384aef88728ab85dd30dcd8581bab1b66e0c6c370e75d03d7f8ac222eacb25d211f91a805ef63099fe3c.png +0 -0
- package/src/tests/data/flat_resized/images/0xeeeb9ef59478b2dada8acea00d7d3de0f163de5f8beea5128808fd43e616f89312476541912e0e1b29881bd58f28713bd3ebae0fbd29e0b3fb60ff310386b808.png +0 -0
- package/src/tests/data/flat_resized/images/0xef422469bc366be01145782e49c5b31a6c58f7d3945291c374a4e23196686121639c2fef9e7f967b37a958fda67cce10e92fc927f6c32b0f0f0ceeaea31ae0ad.png +0 -0
- package/src/tests/data/flat_resized/images/0xf17c8e32e5ab57f059d1c9478d2891d9354673608e8c0826d2e488807ae869a63721bf7be34855ba555f36fc9d722e4f1f78033a4996fe3562328f93c0bd88e4.png +0 -0
- package/src/tests/data/flat_resized/images/0xf5fe66c66f4b33e003096b4bb2c5d0ca52638b5ae4dab7b5e5925bb56c1393feb68f2552320883ba54debf91c400be7d9e6727c020bab1d07738d269f0793bcf.png +0 -0
- package/src/tests/data/flat_resized/images/0xf9ce625ee02e278eff475f7920b6fa7617c7078ed61e9ec50375fd47acb0c1aaeda231a779d0b76fb22a5a4e618779a70bff135bf02ebc8b68739d1fad67134c.png +0 -0
- package/src/tests/data/flat_resized/labels.json +3 -0
- package/src/tests/data/flat_resized/relocated_data.json +364 -0
- package/src/tests/data/hierarchical/bird/Screenshot from 2023-10-12 16-30-52.png +0 -0
- package/src/tests/data/hierarchical/bird/Screenshot from 2023-10-12 16-31-26.png +0 -0
- package/src/tests/data/hierarchical/bird/Screenshot from 2023-10-12 16-31-40.png +0 -0
- package/src/tests/data/hierarchical/bird/Screenshot from 2023-10-12 16-32-07.png +0 -0
- package/src/tests/data/hierarchical/bird/Screenshot from 2023-10-12 16-32-25.png +0 -0
- package/src/tests/data/hierarchical/bird/test_image_png_15.png +0 -0
- package/src/tests/data/hierarchical/bus/01.02.jpeg +0 -0
- package/src/tests/data/hierarchical/bus/01.03.jpeg +0 -0
- package/src/tests/data/hierarchical/bus/01.04.jpeg +0 -0
- package/src/tests/data/hierarchical/bus/Screenshot from 2023-10-12 16-33-02.png +0 -0
- package/src/tests/data/hierarchical/bus/Screenshot from 2023-10-12 16-33-21.png +0 -0
- package/src/tests/data/hierarchical/bus/Screenshot from 2023-10-12 16-33-32.png +0 -0
- package/src/tests/data/hierarchical/car/Screenshot from 2023-10-12 16-34-03.png +0 -0
- package/src/tests/data/hierarchical/car/Screenshot from 2023-10-12 16-34-14.png +0 -0
- package/src/tests/data/hierarchical/car/Screenshot from 2023-10-12 16-34-24.png +0 -0
- package/src/tests/data/hierarchical/car/test_image_png_25.png +0 -0
- package/src/tests/data/hierarchical/car/test_image_png_71.png +0 -0
- package/src/tests/data/hierarchical/car/test_image_png_89.png +0 -0
- package/src/tests/data/hierarchical/cat/test_image_png_22.png +0 -0
- package/src/tests/data/hierarchical/cat/test_image_png_24.png +0 -0
- package/src/tests/data/hierarchical/cat/test_image_png_33.png +0 -0
- package/src/tests/data/hierarchical/cat/test_image_png_5.png +0 -0
- package/src/tests/data/hierarchical/cat/test_image_png_78.png +0 -0
- package/src/tests/data/hierarchical/cat/test_image_png_93.png +0 -0
- package/src/tests/data/hierarchical/deer/Screenshot from 2023-10-12 16-34-51.png +0 -0
- package/src/tests/data/hierarchical/deer/Screenshot from 2023-10-12 16-34-57.png +0 -0
- package/src/tests/data/hierarchical/deer/Screenshot from 2023-10-12 16-35-03.png +0 -0
- package/src/tests/data/hierarchical/deer/test_image_png_17.png +0 -0
- package/src/tests/data/hierarchical/deer/test_image_png_52.png +0 -0
- package/src/tests/data/hierarchical/deer/test_image_png_70.png +0 -0
- package/src/tests/data/hierarchical/dog/test_image_png_16.png +0 -0
- package/src/tests/data/hierarchical/dog/test_image_png_27.png +0 -0
- package/src/tests/data/hierarchical/dog/test_image_png_28.png +0 -0
- package/src/tests/data/hierarchical/dog/test_image_png_40.png +0 -0
- package/src/tests/data/hierarchical/dog/test_image_png_51.png +0 -0
- package/src/tests/data/hierarchical/dog/test_image_png_79.png +0 -0
- package/src/tests/data/hierarchical/dog/test_image_png_90.png +0 -0
- package/src/tests/data/hierarchical/dog/test_image_png_95.png +0 -0
- package/src/tests/data/hierarchical/horse/Screenshot from 2023-10-12 16-35-31.png +0 -0
- package/src/tests/data/hierarchical/horse/Screenshot from 2023-10-12 16-35-37.png +0 -0
- package/src/tests/data/hierarchical/horse/Screenshot from 2023-10-12 16-35-48.png +0 -0
- package/src/tests/data/hierarchical/horse/test_image_png_20.png +0 -0
- package/src/tests/data/hierarchical/horse/test_image_png_26.png +0 -0
- package/src/tests/data/hierarchical/horse/test_image_png_32.png +0 -0
- package/src/tests/data/hierarchical/horse/test_image_png_44.png +0 -0
- package/src/tests/data/hierarchical/horse/test_image_png_94.png +0 -0
- package/src/tests/data/hierarchical/plane/01.05.jpeg +0 -0
- package/src/tests/data/hierarchical/plane/01.06.jpeg +0 -0
- package/src/tests/data/hierarchical/plane/01.07.jpeg +0 -0
- package/src/tests/data/hierarchical/plane/test_image_png_4.png +0 -0
- package/src/tests/data/hierarchical/plane/test_image_png_61.png +0 -0
- package/src/tests/data/hierarchical/plane/test_image_png_69.png +0 -0
- package/src/tests/data/hierarchical/plane/test_image_png_82.png +0 -0
- package/src/tests/data/hierarchical/plane/test_image_png_85.png +0 -0
- package/src/tests/data/hierarchical/train/01.01.jpeg +0 -0
- package/src/tests/data/hierarchical/train/01.08.jpeg +0 -0
- package/src/tests/data/hierarchical/train/01.09.jpeg +0 -0
- package/src/tests/data/hierarchical/train/Screenshot from 2023-10-12 16-36-19.png +0 -0
- package/src/tests/data/hierarchical/train/Screenshot from 2023-10-12 16-36-27.png +0 -0
- package/src/tests/data/hierarchical/train/Screenshot from 2023-10-12 16-36-43.png +0 -0
- package/src/tests/mocked.test.ts +289 -0
- package/src/tests/utils.ts +132 -0
- package/src/utils/input.ts +38 -0
- package/src/utils/inputOutput.ts +14 -0
- package/src/utils/output.ts +69 -0
- package/tsconfig.cjs.json +16 -0
- package/tsconfig.json +16 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { CaptchaTypes, CaptchaWithoutId, Captchas, CaptchasContainerSchema, Item, RawSolution } from '@prosopo/types'
|
|
2
|
+
import { Generate, ArgsSchema as GenerateArgsSchema } from './generate.js'
|
|
3
|
+
import { ProsopoEnvError } from '@prosopo/common'
|
|
4
|
+
import { at, get, lodash } from '@prosopo/util'
|
|
5
|
+
import { blake2AsHex } from '@polkadot/util-crypto'
|
|
6
|
+
import { z } from 'zod'
|
|
7
|
+
import bcrypt from 'bcrypt'
|
|
8
|
+
import cliProgress from 'cli-progress'
|
|
9
|
+
import fs from 'fs'
|
|
10
|
+
|
|
11
|
+
export const ArgsSchema = GenerateArgsSchema.extend({
|
|
12
|
+
minCorrect: z.number().optional(),
|
|
13
|
+
minIncorrect: z.number().optional(),
|
|
14
|
+
minLabelled: z.number().optional(),
|
|
15
|
+
maxLabelled: z.number().optional(),
|
|
16
|
+
count: z.number().optional(),
|
|
17
|
+
})
|
|
18
|
+
export type ArgsSchemaType = typeof ArgsSchema
|
|
19
|
+
export type Args = z.infer<ArgsSchemaType>
|
|
20
|
+
|
|
21
|
+
export class GenerateV2 extends Generate<ArgsSchemaType> {
|
|
22
|
+
#size = 0
|
|
23
|
+
#minCorrect = 0
|
|
24
|
+
#saltRounds = 10
|
|
25
|
+
#allowDuplicatesLabelled = false
|
|
26
|
+
#allowDuplicatesUnlabelled = false
|
|
27
|
+
#minIncorrect = 0
|
|
28
|
+
#minLabelled = 0
|
|
29
|
+
#maxLabelled = 0
|
|
30
|
+
#count = 0
|
|
31
|
+
#nCorrect = 0
|
|
32
|
+
#nIncorrect = 0
|
|
33
|
+
#nLabelled = 0
|
|
34
|
+
#nUnlabelled = 0
|
|
35
|
+
#target = ''
|
|
36
|
+
#targets: string[] = []
|
|
37
|
+
#targetItems: Item[] = []
|
|
38
|
+
#notTargetItems: Item[] = []
|
|
39
|
+
|
|
40
|
+
public override getArgSchema() {
|
|
41
|
+
return ArgsSchema
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public override getDescription(): string {
|
|
45
|
+
return 'Generate distinct captchas producing captcha challenges comprising one or more rounds, mixing labelled and unlabelled data into a single round'
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public override getOptions() {
|
|
49
|
+
return lodash().merge(super.getOptions(), {
|
|
50
|
+
count: {
|
|
51
|
+
number: true,
|
|
52
|
+
description: 'Number of captchas to generate',
|
|
53
|
+
},
|
|
54
|
+
minCorrect: {
|
|
55
|
+
number: true,
|
|
56
|
+
description: 'Minimum number of correct images in each captcha',
|
|
57
|
+
},
|
|
58
|
+
minIncorrect: {
|
|
59
|
+
number: true,
|
|
60
|
+
description: 'Minimum number of incorrect images in each captcha',
|
|
61
|
+
},
|
|
62
|
+
minLabelled: {
|
|
63
|
+
number: true,
|
|
64
|
+
description: 'Minimum number of labelled images in each captcha',
|
|
65
|
+
},
|
|
66
|
+
maxLabelled: {
|
|
67
|
+
number: true,
|
|
68
|
+
description: 'Maximum number of labelled images in each captcha',
|
|
69
|
+
},
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private setupTarget(i: number) {
|
|
74
|
+
const _ = lodash()
|
|
75
|
+
if (this.targets.length <= 1) {
|
|
76
|
+
throw new ProsopoEnvError(
|
|
77
|
+
new Error(`not enough different labels in labelled data`),
|
|
78
|
+
'DATASET.NOT_ENOUGH_LABELS'
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// uniformly sample targets
|
|
83
|
+
const target = at(this.targets, i % this.targets.length)
|
|
84
|
+
const notTargets = this.targets.filter((t) => t !== target)
|
|
85
|
+
// how many labelled images should be in the captcha?
|
|
86
|
+
const nLabelled = _.random(this.#minLabelled, this.#maxLabelled)
|
|
87
|
+
// how many correct labelled images should be in the captcha?
|
|
88
|
+
const maxCorrect = nLabelled - this.#minCorrect
|
|
89
|
+
const nCorrect = _.random(this.#minCorrect, maxCorrect)
|
|
90
|
+
const nIncorrect = nLabelled - nCorrect
|
|
91
|
+
const nUnlabelled = this.#size - nLabelled
|
|
92
|
+
|
|
93
|
+
const targetItems = get(this.labelToImages, target)
|
|
94
|
+
const notTargetItems: Item[] = notTargets.map((notTarget) => get(this.labelToImages, notTarget)).flat()
|
|
95
|
+
|
|
96
|
+
if (nUnlabelled > this.unlabelled.length) {
|
|
97
|
+
throw new ProsopoEnvError(new Error(`not enough unlabelled data`), 'DATASET.NOT_ENOUGH_IMAGES')
|
|
98
|
+
}
|
|
99
|
+
if (nCorrect > targetItems.length) {
|
|
100
|
+
throw new ProsopoEnvError(
|
|
101
|
+
new Error(`not enough images for target (${target})`),
|
|
102
|
+
'DATASET.NOT_ENOUGH_IMAGES'
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
if (nIncorrect > notTargetItems.length) {
|
|
106
|
+
throw new ProsopoEnvError(
|
|
107
|
+
new Error(`not enough non-matching images for target (${target})`),
|
|
108
|
+
'DATASET.NOT_ENOUGH_IMAGES'
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
this.#nCorrect = nCorrect
|
|
113
|
+
this.#nIncorrect = nIncorrect
|
|
114
|
+
this.#nLabelled = nLabelled
|
|
115
|
+
this.#nUnlabelled = nUnlabelled
|
|
116
|
+
this.#target = target
|
|
117
|
+
this.#targets = notTargets
|
|
118
|
+
this.#targetItems = targetItems
|
|
119
|
+
this.#notTargetItems = notTargetItems
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
public override async _run(args: Args) {
|
|
123
|
+
await super._run(args)
|
|
124
|
+
|
|
125
|
+
const outFile: string = args.output
|
|
126
|
+
|
|
127
|
+
// get lodash (with seeded rng)
|
|
128
|
+
const _ = lodash()
|
|
129
|
+
|
|
130
|
+
this.#size = args.size || 9
|
|
131
|
+
this.#minCorrect = args.minCorrect || 1
|
|
132
|
+
this.#saltRounds = 10
|
|
133
|
+
this.#allowDuplicatesLabelled = args.allowDuplicatesLabelled || args.allowDuplicates || false
|
|
134
|
+
this.#allowDuplicatesUnlabelled = args.allowDuplicatesUnlabelled || args.allowDuplicates || false
|
|
135
|
+
this.#minIncorrect = Math.max(args.minIncorrect || 1, 1) // at least 1 incorrect image
|
|
136
|
+
this.#minLabelled = this.#minCorrect + this.#minIncorrect // min incorrect + correct
|
|
137
|
+
this.#maxLabelled = Math.min(args.maxLabelled || this.#size, this.#size) // at least 1 labelled image
|
|
138
|
+
this.#count = args.count || 0
|
|
139
|
+
|
|
140
|
+
// 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
|
|
141
|
+
// 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.
|
|
142
|
+
// 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.
|
|
143
|
+
// 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)
|
|
144
|
+
|
|
145
|
+
const bar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic)
|
|
146
|
+
bar.start(this.#count, 0)
|
|
147
|
+
|
|
148
|
+
// generate n captchas
|
|
149
|
+
const captchas: CaptchaWithoutId[] = []
|
|
150
|
+
for (let i = 0; i < this.#count; i++) {
|
|
151
|
+
bar.increment()
|
|
152
|
+
// this.logger.info(`generating captcha ${i + 1} of ${count}`)
|
|
153
|
+
this.setupTarget(i)
|
|
154
|
+
|
|
155
|
+
// get the correct items
|
|
156
|
+
const correctItems: Item[] = _.sampleSize(this.#targetItems, this.#nCorrect)
|
|
157
|
+
|
|
158
|
+
// get the incorrect items
|
|
159
|
+
const incorrectItems: Item[] = _.sampleSize(this.#notTargetItems, this.#nIncorrect)
|
|
160
|
+
|
|
161
|
+
// get the unlabelled items
|
|
162
|
+
const unlabelledItems = new Set<Item>()
|
|
163
|
+
while (unlabelledItems.size < this.#size - this.#nLabelled) {
|
|
164
|
+
// get a random image from the unlabelled data
|
|
165
|
+
const image = at(this.unlabelled, _.random(0, this.unlabelled.length - 1))
|
|
166
|
+
unlabelledItems.add(image)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const itemsConcat: Item[] = [...correctItems, ...incorrectItems, ...unlabelledItems]
|
|
170
|
+
let indices: number[] = [...Array(itemsConcat.length).keys()]
|
|
171
|
+
indices = _.shuffle(indices)
|
|
172
|
+
const items = indices
|
|
173
|
+
.map((i) => at(itemsConcat, i))
|
|
174
|
+
.map((item) => {
|
|
175
|
+
return {
|
|
176
|
+
data: item.data,
|
|
177
|
+
hash: item.hash,
|
|
178
|
+
type: item.type,
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
// the first n indices are the correct items
|
|
183
|
+
const solution: RawSolution[] = indices
|
|
184
|
+
.map((index, i) => {
|
|
185
|
+
return {
|
|
186
|
+
pre: index, // the index of the item in the items array before shuffle
|
|
187
|
+
post: i, // the index of the item in the shuffled array
|
|
188
|
+
}
|
|
189
|
+
})
|
|
190
|
+
.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
|
|
191
|
+
.map((item) => {
|
|
192
|
+
return item.post // return the index in the shuffled array
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
// the unlabelled indices were after the correct and incorrect
|
|
196
|
+
const unlabelledIndices: RawSolution[] = indices
|
|
197
|
+
.map((index, i) => {
|
|
198
|
+
return {
|
|
199
|
+
pre: index, // the index of the item in the items array before shuffle
|
|
200
|
+
post: i, // the index of the item in the shuffled array
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
.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
|
|
204
|
+
.map((item) => {
|
|
205
|
+
return item.post // return the index in the shuffled array
|
|
206
|
+
})
|
|
207
|
+
|
|
208
|
+
const salt = blake2AsHex(bcrypt.genSaltSync(this.#saltRounds))
|
|
209
|
+
// create the captcha
|
|
210
|
+
const captcha: CaptchaWithoutId = {
|
|
211
|
+
salt,
|
|
212
|
+
target: this.#target,
|
|
213
|
+
items,
|
|
214
|
+
solution,
|
|
215
|
+
unlabelled: unlabelledIndices,
|
|
216
|
+
}
|
|
217
|
+
captchas.push(captcha)
|
|
218
|
+
}
|
|
219
|
+
bar.stop()
|
|
220
|
+
|
|
221
|
+
// write to file
|
|
222
|
+
const output: Captchas = {
|
|
223
|
+
captchas,
|
|
224
|
+
format: CaptchaTypes.SelectAll,
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// verify the output
|
|
228
|
+
this.logger.info('verifying data')
|
|
229
|
+
CaptchasContainerSchema.parse(output)
|
|
230
|
+
|
|
231
|
+
this.logger.info(`writing data`)
|
|
232
|
+
fs.mkdirSync(args.output.split('/').slice(0, -1).join('/'), { recursive: true })
|
|
233
|
+
fs.writeFileSync(outFile, JSON.stringify(output, null, 4))
|
|
234
|
+
}
|
|
235
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { InputArgsSchema, InputCliCommand } from '../utils/input.js'
|
|
2
|
+
import { get } from '@prosopo/util'
|
|
3
|
+
import { lodash } from '@prosopo/util'
|
|
4
|
+
import { z } from 'zod'
|
|
5
|
+
import cliProgress from 'cli-progress'
|
|
6
|
+
import fs from 'fs'
|
|
7
|
+
|
|
8
|
+
export const ArgsSchema = InputArgsSchema.extend({})
|
|
9
|
+
export type ArgsSchemaType = typeof ArgsSchema
|
|
10
|
+
export type Args = z.infer<ArgsSchemaType>
|
|
11
|
+
export class Get extends InputCliCommand<ArgsSchemaType> {
|
|
12
|
+
public override getArgSchema() {
|
|
13
|
+
return ArgsSchema
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public override getOptions() {
|
|
17
|
+
return lodash().merge(super.getOptions(), {
|
|
18
|
+
input: {
|
|
19
|
+
description: 'JSON file containing urls under a "data" key',
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public override async _run(args: Args) {
|
|
25
|
+
await super._run(args)
|
|
26
|
+
const bar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic)
|
|
27
|
+
|
|
28
|
+
const list: string[] = []
|
|
29
|
+
const traverse = async (data: any) => {
|
|
30
|
+
if (data instanceof Array) {
|
|
31
|
+
for (let i = 0; i < data.length; i++) {
|
|
32
|
+
data[i] = await traverse(data[i])
|
|
33
|
+
}
|
|
34
|
+
} else if (data instanceof Object) {
|
|
35
|
+
for (const key of Object.keys(data)) {
|
|
36
|
+
if (key == 'data') {
|
|
37
|
+
const value = get(data, key)
|
|
38
|
+
const url = z.string().parse(value)
|
|
39
|
+
list.push(url)
|
|
40
|
+
} else {
|
|
41
|
+
await traverse(get(data, key))
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return data
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const file = args.input
|
|
49
|
+
|
|
50
|
+
// read the map file
|
|
51
|
+
const data: any = JSON.parse(fs.readFileSync(file, 'utf8'))
|
|
52
|
+
await traverse(data)
|
|
53
|
+
|
|
54
|
+
bar.start(list.length, 0)
|
|
55
|
+
for (const url of list) {
|
|
56
|
+
bar.increment()
|
|
57
|
+
if (url.startsWith('http')) {
|
|
58
|
+
try {
|
|
59
|
+
const response = await fetch(url)
|
|
60
|
+
if (!response.ok) {
|
|
61
|
+
this.logger.error(`GET ${url} ${response.status} ${response.statusText}`)
|
|
62
|
+
} else {
|
|
63
|
+
this.logger.log(`GET ${url} OK`)
|
|
64
|
+
}
|
|
65
|
+
} catch (err) {
|
|
66
|
+
this.logger.error(err)
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
// resolve locally
|
|
70
|
+
try {
|
|
71
|
+
fs.readFileSync(url)
|
|
72
|
+
this.logger.log(`GET ${url} OK`)
|
|
73
|
+
} catch (err) {
|
|
74
|
+
this.logger.error(`GET ${url} ${err}`)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
bar.stop()
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public override getDescription(): string {
|
|
82
|
+
return 'Test a GET request at image URLs'
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { InputOutputArgsSchema as InputOutputArgsSchema, InputOutputCliCommand } from '../utils/inputOutput.js'
|
|
2
|
+
import { LabelledDataSchema, LabelledItem } from '@prosopo/types'
|
|
3
|
+
import { ProsopoEnvError } from '@prosopo/common'
|
|
4
|
+
import { lodash } from '@prosopo/util'
|
|
5
|
+
import { z } from 'zod'
|
|
6
|
+
import fs from 'fs'
|
|
7
|
+
|
|
8
|
+
export const ArgsSchema = InputOutputArgsSchema.extend({})
|
|
9
|
+
export type ArgsSchemaType = typeof ArgsSchema
|
|
10
|
+
export type Args = z.infer<ArgsSchemaType>
|
|
11
|
+
|
|
12
|
+
export class Labels extends InputOutputCliCommand<ArgsSchemaType> {
|
|
13
|
+
public override getArgSchema() {
|
|
14
|
+
return ArgsSchema
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public override getOptions() {
|
|
18
|
+
return lodash().merge(super.getOptions(), {
|
|
19
|
+
input: {
|
|
20
|
+
description: 'JSON file containing labelled data',
|
|
21
|
+
},
|
|
22
|
+
output: {
|
|
23
|
+
description: 'Where to put the JSON file containing labels',
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public override async _run(args: Args) {
|
|
29
|
+
await super._run(args)
|
|
30
|
+
|
|
31
|
+
const file = args.input
|
|
32
|
+
if (!fs.existsSync(file)) {
|
|
33
|
+
throw new ProsopoEnvError(new Error(`file does not exist: ${file}`), 'FS.FILE_NOT_FOUND')
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const labelled: LabelledItem[] = file
|
|
37
|
+
? LabelledDataSchema.parse(JSON.parse(fs.readFileSync(file, 'utf8'))).items
|
|
38
|
+
: []
|
|
39
|
+
|
|
40
|
+
const labels = new Set<string>()
|
|
41
|
+
for (const item of labelled) {
|
|
42
|
+
labels.add(item.label)
|
|
43
|
+
}
|
|
44
|
+
const labelArray = Array.from(labels)
|
|
45
|
+
labelArray.sort()
|
|
46
|
+
|
|
47
|
+
fs.mkdirSync(args.output.split('/').slice(0, -1).join('/'), { recursive: true })
|
|
48
|
+
fs.writeFileSync(args.output, JSON.stringify({ labels: labelArray }, null, 4))
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public override getDescription(): string {
|
|
52
|
+
return 'get all labels from some data'
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { InputOutputArgsSchema as InputOutputArgsSchema, InputOutputCliCommand } from '../utils/inputOutput.js'
|
|
2
|
+
import { get, lodash } from '@prosopo/util'
|
|
3
|
+
import { z } from 'zod'
|
|
4
|
+
import fs from 'fs'
|
|
5
|
+
|
|
6
|
+
export const ArgsSchema = InputOutputArgsSchema.extend({
|
|
7
|
+
from: z.string(),
|
|
8
|
+
to: z.string(),
|
|
9
|
+
})
|
|
10
|
+
export type ArgsSchemaType = typeof ArgsSchema
|
|
11
|
+
export type Args = z.infer<ArgsSchemaType>
|
|
12
|
+
|
|
13
|
+
export class Relocate extends InputOutputCliCommand<ArgsSchemaType> {
|
|
14
|
+
public override getArgSchema() {
|
|
15
|
+
return ArgsSchema
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public override getOptions() {
|
|
19
|
+
return lodash().merge(super.getOptions(), {
|
|
20
|
+
input: {
|
|
21
|
+
description: 'A json file containing a list of objects with (at least) a url',
|
|
22
|
+
},
|
|
23
|
+
output: {
|
|
24
|
+
description: 'Where to write the new json file containing the new urls',
|
|
25
|
+
},
|
|
26
|
+
from: {
|
|
27
|
+
string: true,
|
|
28
|
+
demand: true,
|
|
29
|
+
description: 'The string to replace in the urls',
|
|
30
|
+
},
|
|
31
|
+
to: {
|
|
32
|
+
description: 'The string to substitute in the urls',
|
|
33
|
+
string: true,
|
|
34
|
+
demand: true,
|
|
35
|
+
},
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public override async _run(args: Args) {
|
|
40
|
+
await super._run(args)
|
|
41
|
+
|
|
42
|
+
const replace = (data: unknown, from: string, to: string) => {
|
|
43
|
+
if (Array.isArray(data)) {
|
|
44
|
+
for (let i = 0; i < data.length; i++) {
|
|
45
|
+
data[i] = replace(data[i], from, to)
|
|
46
|
+
}
|
|
47
|
+
} else if (typeof data === 'object') {
|
|
48
|
+
const obj = data as {
|
|
49
|
+
[key: string]: unknown
|
|
50
|
+
}
|
|
51
|
+
for (const key of Object.keys(obj)) {
|
|
52
|
+
if (key === 'data') {
|
|
53
|
+
const value = get(obj, key)
|
|
54
|
+
if (typeof value === 'string') {
|
|
55
|
+
if (value.startsWith(from)) {
|
|
56
|
+
this.logger.debug('replacing', value)
|
|
57
|
+
obj[key] = to + value.slice(from.length)
|
|
58
|
+
this.logger.debug('replaced', obj[key])
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
obj[key] = replace(obj[key], from, to)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return data
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const file: string = args.input
|
|
70
|
+
this.logger.log(`relocating data in ${file} from ${args.from} to ${args.to}`)
|
|
71
|
+
// read the file
|
|
72
|
+
let data = JSON.parse(fs.readFileSync(file, 'utf8'))
|
|
73
|
+
// replace the urls by recursively traversing the data
|
|
74
|
+
data = replace(data, args.from, args.to)
|
|
75
|
+
// write the file
|
|
76
|
+
fs.mkdirSync(args.output.split('/').slice(0, -1).join('/'), { recursive: true })
|
|
77
|
+
fs.writeFileSync(args.output, JSON.stringify(data, null, 4))
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public override getDescription(): string {
|
|
81
|
+
return 'Relocate urls in a JSON file using string substitution'
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { Data, DataSchema, Item } from '@prosopo/types'
|
|
2
|
+
import { InputOutputArgsSchema as InputOutputArgsSchema, InputOutputCliCommand } from '../utils/inputOutput.js'
|
|
3
|
+
import { ProsopoEnvError } from '@prosopo/common'
|
|
4
|
+
import { blake2b } from '@noble/hashes/blake2b'
|
|
5
|
+
import { lodash } from '@prosopo/util'
|
|
6
|
+
import { u8aToHex } from '@polkadot/util'
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import cliProgress from 'cli-progress'
|
|
9
|
+
import fs from 'fs'
|
|
10
|
+
import sharp from 'sharp'
|
|
11
|
+
|
|
12
|
+
export const ArgsSchema = InputOutputArgsSchema.extend({
|
|
13
|
+
size: z.number(),
|
|
14
|
+
square: z.boolean().optional(),
|
|
15
|
+
})
|
|
16
|
+
export type ArgsSchemaType = typeof ArgsSchema
|
|
17
|
+
export type Args = z.infer<ArgsSchemaType>
|
|
18
|
+
|
|
19
|
+
export class Resize extends InputOutputCliCommand<ArgsSchemaType> {
|
|
20
|
+
public override getArgSchema() {
|
|
21
|
+
return ArgsSchema
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public override getOptions() {
|
|
25
|
+
return lodash().merge(super.getOptions(), {
|
|
26
|
+
input: {
|
|
27
|
+
description: 'JSON file containing a list of objects with (at least) a url',
|
|
28
|
+
},
|
|
29
|
+
output: {
|
|
30
|
+
description:
|
|
31
|
+
'Where to put the output directory containing the map file and single directory of images. The map file will contain the new urls of the scaled images, new hashes and pass through any other information, e.g. labels.',
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
number: true,
|
|
35
|
+
description:
|
|
36
|
+
'The dimension (height/width) of the scaled image. If the image is not square, the other dimension will be scaled to maintain the aspect ratio.',
|
|
37
|
+
},
|
|
38
|
+
square: {
|
|
39
|
+
boolean: true,
|
|
40
|
+
description:
|
|
41
|
+
'If true, the image will be cropped to a square before scaling. If false, the image will be scaled to the given size, maintaining the aspect ratio.',
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public override async _run(args: Args) {
|
|
47
|
+
await super._run(args)
|
|
48
|
+
|
|
49
|
+
const size = args.size
|
|
50
|
+
const square = args.square ?? false
|
|
51
|
+
|
|
52
|
+
const mapFile: string = args.input
|
|
53
|
+
if (!fs.existsSync(mapFile)) {
|
|
54
|
+
throw new ProsopoEnvError(new Error(`Map file does not exist: ${mapFile}`), 'FS.FILE_NOT_FOUND')
|
|
55
|
+
}
|
|
56
|
+
const outDir: string = args.output
|
|
57
|
+
const overwrite = args.overwrite || false
|
|
58
|
+
if (!overwrite && fs.existsSync(outDir)) {
|
|
59
|
+
throw new ProsopoEnvError(new Error(`Output directory already exists: ${outDir}`), 'FS.FILE_NOT_FOUND')
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// create the output directory
|
|
63
|
+
const imgDir = `${outDir}/images`
|
|
64
|
+
fs.mkdirSync(imgDir, { recursive: true })
|
|
65
|
+
|
|
66
|
+
// read the map file
|
|
67
|
+
const inputItems: Item[] = DataSchema.parse(JSON.parse(fs.readFileSync(mapFile, 'utf8'))).items
|
|
68
|
+
|
|
69
|
+
// for each item
|
|
70
|
+
const bar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic)
|
|
71
|
+
bar.start(inputItems.length, 0)
|
|
72
|
+
const outputItems: Item[] = []
|
|
73
|
+
for (const inputItem of inputItems) {
|
|
74
|
+
bar.increment()
|
|
75
|
+
// this.logger.log(`resizing ${inputItem.data}`)
|
|
76
|
+
// read the file
|
|
77
|
+
const img = fs.readFileSync(inputItem.data)
|
|
78
|
+
// resize the image
|
|
79
|
+
const resized = await sharp(img)
|
|
80
|
+
.resize({
|
|
81
|
+
width: size,
|
|
82
|
+
height: size,
|
|
83
|
+
fit: square ? 'cover' : 'inside',
|
|
84
|
+
})
|
|
85
|
+
.removeAlpha() // remove the alpha channel
|
|
86
|
+
.toColorspace('srgb') // 8-bits per channel
|
|
87
|
+
.jpeg({
|
|
88
|
+
quality: 75,
|
|
89
|
+
chromaSubsampling: '4:2:0',
|
|
90
|
+
optimiseCoding: true,
|
|
91
|
+
trellisQuantisation: true,
|
|
92
|
+
overshootDeringing: true,
|
|
93
|
+
optimizeScans: true,
|
|
94
|
+
quantisationTable: 3,
|
|
95
|
+
force: true,
|
|
96
|
+
})
|
|
97
|
+
const tmpFilePath = `${imgDir}/tmp.jpg`
|
|
98
|
+
await resized.toFile(tmpFilePath)
|
|
99
|
+
// read the resized image
|
|
100
|
+
const resizedImg = fs.readFileSync(tmpFilePath)
|
|
101
|
+
// hash the image
|
|
102
|
+
const hash = blake2b(resizedImg)
|
|
103
|
+
const hex = u8aToHex(hash)
|
|
104
|
+
// move the image
|
|
105
|
+
const finalFilePath = `${imgDir}/${hex}.jpg`
|
|
106
|
+
fs.renameSync(tmpFilePath, finalFilePath)
|
|
107
|
+
|
|
108
|
+
// add the item to the output
|
|
109
|
+
const outputItem: Item = {
|
|
110
|
+
...inputItem,
|
|
111
|
+
hash: hex,
|
|
112
|
+
data: fs.realpathSync(finalFilePath),
|
|
113
|
+
}
|
|
114
|
+
outputItems.push(outputItem)
|
|
115
|
+
}
|
|
116
|
+
bar.stop()
|
|
117
|
+
|
|
118
|
+
// write the map file
|
|
119
|
+
const outputMapFile = `${outDir}/data.json`
|
|
120
|
+
|
|
121
|
+
const data: Data = {
|
|
122
|
+
items: outputItems,
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// verify the output
|
|
126
|
+
this.logger.info('verifying data')
|
|
127
|
+
DataSchema.parse(data)
|
|
128
|
+
|
|
129
|
+
this.logger.info(`writing data`)
|
|
130
|
+
fs.mkdirSync(args.output.split('/').slice(0, -1).join('/'), { recursive: true })
|
|
131
|
+
fs.writeFileSync(outputMapFile, JSON.stringify(data, null, 4))
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
public override getDescription(): string {
|
|
135
|
+
return 'Resize images to a given size'
|
|
136
|
+
}
|
|
137
|
+
}
|
package/src/dummy.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// generate some dummy data for testing the generate fns
|
|
2
|
+
|
|
3
|
+
import { CaptchaItemTypes, Item, LabelledItem } from '@prosopo/types'
|
|
4
|
+
import fs from 'fs'
|
|
5
|
+
|
|
6
|
+
const nLabels = 4
|
|
7
|
+
const nLabelledImages = 100
|
|
8
|
+
const nUnlabelledImages = 100
|
|
9
|
+
|
|
10
|
+
const labelledImages: LabelledItem[] = []
|
|
11
|
+
const unlabelledImages: Item[] = []
|
|
12
|
+
|
|
13
|
+
for (let i = 0; i < nLabelledImages; i++) {
|
|
14
|
+
const label = i % nLabels
|
|
15
|
+
labelledImages.push({
|
|
16
|
+
label: label.toString(),
|
|
17
|
+
data: `abc${i}`,
|
|
18
|
+
type: CaptchaItemTypes.Image,
|
|
19
|
+
hash: `abc${i}hash`,
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
for (let i = 0; i < nUnlabelledImages; i++) {
|
|
24
|
+
unlabelledImages.push({
|
|
25
|
+
data: `def${i}`,
|
|
26
|
+
type: CaptchaItemTypes.Image,
|
|
27
|
+
hash: `def${i}hash`,
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
fs.writeFileSync('labelled.json', JSON.stringify(labelledImages))
|
|
32
|
+
fs.writeFileSync('unlabelled.json', JSON.stringify(unlabelledImages))
|
|
33
|
+
fs.writeFileSync('labels.json', JSON.stringify(Array.from(Array(nLabels).keys()).map((x) => x.toString())))
|
|
34
|
+
|
|
35
|
+
process.exit(0)
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2021-2023 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
|
+
export * from './cli/cli.js'
|