diff --git a/package-lock.json b/package-lock.json index 9db67a3..3a150c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,27 +9,79 @@ "version": "1.0.0", "license": "MIT", "dependencies": { + "archiver": "^7.0.1", "hypercore-crypto": "^3.4.2", "multifeed": "^6.0.0", - "yazl": "^2.5.1" + "p-event": "^6.0.1" }, "devDependencies": { "@eslint/js": "^9.15.0", + "@types/archiver": "^6.0.3", "@types/node": "^22.9.1", + "@types/yauzl-promise": "^4.0.1", "@types/yazl": "^2.4.5", "eslint": "^9.15.0", "globals": "^15.12.0", "npm-run-all": "^4.1.5", "patch-package": "^8.0.0", "prettier": "^3.3.3", + "tempy": "^3.1.0", "typescript": "^5.6.3", - "typescript-eslint": "^8.15.0" + "typescript-eslint": "^8.15.0", + "yauzl-promise": "^4.0.0" }, "engines": { "engineStrict": true, "node": "^22.11.0" } }, + "node_modules/@babel/runtime": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", + "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@emnapi/core": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.3.1.tgz", + "integrity": "sha512-pVGjBIt1Y6gg3EJN8jTcfpP/+uuRksIo055oE/OBkDNcjZqVbfkWCksG1Jp4yZnj3iKWyWX8fdG/j6UDYPbFog==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.0.1", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.3.1.tgz", + "integrity": "sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.0.1.tgz", + "integrity": "sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", @@ -233,6 +285,304 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.5.tgz", + "integrity": "sha512-kwUxR7J9WLutBbulqg1dfOrMTwhMdXLdcGUhcbCcGwnPLt3gz19uHVdwH1syKVDbE022ZS2vZxOWflFLS0YTjw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.1.0", + "@emnapi/runtime": "^1.1.0", + "@tybys/wasm-util": "^0.9.0" + } + }, + "node_modules/@node-rs/crc32": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32/-/crc32-1.10.4.tgz", + "integrity": "sha512-R1kX9t4Bz1gkNZUcI967bp91+HIoCJa7p11xvBAU9INUvTC1XsOs5mnGq+LE+UOHKUKmE3pOLHLVuoRo4pM3Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "optionalDependencies": { + "@node-rs/crc32-android-arm-eabi": "1.10.4", + "@node-rs/crc32-android-arm64": "1.10.4", + "@node-rs/crc32-darwin-arm64": "1.10.4", + "@node-rs/crc32-darwin-x64": "1.10.4", + "@node-rs/crc32-freebsd-x64": "1.10.4", + "@node-rs/crc32-linux-arm-gnueabihf": "1.10.4", + "@node-rs/crc32-linux-arm64-gnu": "1.10.4", + "@node-rs/crc32-linux-arm64-musl": "1.10.4", + "@node-rs/crc32-linux-x64-gnu": "1.10.4", + "@node-rs/crc32-linux-x64-musl": "1.10.4", + "@node-rs/crc32-wasm32-wasi": "1.10.4", + "@node-rs/crc32-win32-arm64-msvc": "1.10.4", + "@node-rs/crc32-win32-ia32-msvc": "1.10.4", + "@node-rs/crc32-win32-x64-msvc": "1.10.4" + } + }, + "node_modules/@node-rs/crc32-android-arm-eabi": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32-android-arm-eabi/-/crc32-android-arm-eabi-1.10.4.tgz", + "integrity": "sha512-xnfEDpxPU/tVFEOTwKF8N3F7NreAk0J/o+JhRiaeS5IYQD7rFsdmgzcWi7MpggzFq5ETNM1z/f+YD9OPump8yg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/crc32-android-arm64": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32-android-arm64/-/crc32-android-arm64-1.10.4.tgz", + "integrity": "sha512-4myv2lydjPgw1Vn1AzyTPWwJlU7k7hoP7nsXn0ibQxjIknD/r05G7GJziTFL4T9sAfM3b4MephfgnRDA66gPjA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/crc32-darwin-arm64": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32-darwin-arm64/-/crc32-darwin-arm64-1.10.4.tgz", + "integrity": "sha512-x1ggDiiojMpaY4Xf9A5JRLxA3L6ezDiVqtItsXrf8edG/SvlLEmSYPWHpswgKjd4LcGuL3AZrKNcvAi59bCTsQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/crc32-darwin-x64": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32-darwin-x64/-/crc32-darwin-x64-1.10.4.tgz", + "integrity": "sha512-PCFt905HFFJvQE68Sc9eE/9LYxoC7hen29+WC0StIK21B2P+NorW7AgUW8kCv28NKDL3sPmIQHxXMWP7rDdRHw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/crc32-freebsd-x64": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32-freebsd-x64/-/crc32-freebsd-x64-1.10.4.tgz", + "integrity": "sha512-C3KJgyKiWLkFlcrWX04wkVIkSUiD+KCVG+yyLOVXUbQFdCjSbbEQx2MUpM7qcy5ZOAFj4/MZCYdMLgQ6qIgaAw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/crc32-linux-arm-gnueabihf": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32-linux-arm-gnueabihf/-/crc32-linux-arm-gnueabihf-1.10.4.tgz", + "integrity": "sha512-YlP3IozMBJmZbytr3/J6fEF5GjWql3p+r3MzY0RctgPf9UdRwG7pjz81SUu6X6kNuDE2eoeKblG0hIPKCd1/Hw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/crc32-linux-arm64-gnu": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32-linux-arm64-gnu/-/crc32-linux-arm64-gnu-1.10.4.tgz", + "integrity": "sha512-GETfDmFEmWQaULn+jjs6UJB/IS2olWToqt/PaMKfQwohMFuFEAMiWLue/aXM2Q78hgbTooc4m8iY0djevwXjBA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/crc32-linux-arm64-musl": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32-linux-arm64-musl/-/crc32-linux-arm64-musl-1.10.4.tgz", + "integrity": "sha512-629LGgGC2/h9HSM0m0sdhCNBap3QWyTQy85RB8AnywsA2R1XqeO7UH4VI5W5y5jFPeVusAkPZhYZJTGmlukZvA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/crc32-linux-x64-gnu": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32-linux-x64-gnu/-/crc32-linux-x64-gnu-1.10.4.tgz", + "integrity": "sha512-ifpmD7lpkhrgwnn8BMxoH/sgeCG+tAUSBvaQkSHLsKJfg+yZ2X/+Y9JvWA79/WaR8ksD01E0yr/tZ8t+Dp0p0w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/crc32-linux-x64-musl": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32-linux-x64-musl/-/crc32-linux-x64-musl-1.10.4.tgz", + "integrity": "sha512-grAfrxC/bIENFnJx2w55NIMg5x8DrMQbumSrturVBmbraozgFO6DaBg/g/pnzQvJbkuhXk920pLFwz5OeuxqzA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/crc32-wasm32-wasi": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32-wasm32-wasi/-/crc32-wasm32-wasi-1.10.4.tgz", + "integrity": "sha512-nlhG9PlPDsISBC8m2lp5DTRe2uV3Y1UEnFU1lweu/llF9xb8alxQbRE2Vp2rsWJP0s+cwmGx7k3UUOUbnVkbqw==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^0.2.3" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@node-rs/crc32-win32-arm64-msvc": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32-win32-arm64-msvc/-/crc32-win32-arm64-msvc-1.10.4.tgz", + "integrity": "sha512-btYP7Xv2NmCkrXDE3dLqgh+2fTgvByu6NRfWV3++md4tCO8C88dCu9uLxW7cr0dt88cpC0f5Yx9pWFbURKA23Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/crc32-win32-ia32-msvc": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32-win32-ia32-msvc/-/crc32-win32-ia32-msvc-1.10.4.tgz", + "integrity": "sha512-o+7Zq9seSWAmoiOmUlXMi44FFwiGkfGihnKIIMKN9DAmQEifHb7Y4RuNnjYpEwjwlOa3HQ8wjQazEhxFFdrbSw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/crc32-win32-x64-msvc": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@node-rs/crc32-win32-x64-msvc/-/crc32-win32-x64-msvc-1.10.4.tgz", + "integrity": "sha512-vnqwu4p7o9jvpjq8Xc1zuhw3jSaSkdVSSIFUralgOXKP6m+cbBbuOTeJZpsuf6C/diVNv6YocTBOlkhJqq0oGw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -271,6 +621,37 @@ "node": ">= 8" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@tybys/wasm-util": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.9.0.tgz", + "integrity": "sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/archiver": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@types/archiver/-/archiver-6.0.3.tgz", + "integrity": "sha512-a6wUll6k3zX6qs5KlxIggs1P1JcYJaTCx2gnlr+f0S1yd2DoaEwoIK10HmBaLnZwWneBz+JBm0dwcZu0zECBcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/readdir-glob": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -295,6 +676,26 @@ "undici-types": "~6.19.8" } }, + "node_modules/@types/readdir-glob": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@types/readdir-glob/-/readdir-glob-1.1.5.tgz", + "integrity": "sha512-raiuEPUYqXu+nvtY2Pe8s8FEmZ3x5yAH4VkLdihcPdalvsHltomrRC9BzuStrJ9yk06470hS0Crw0f1pXqD+Hg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/yauzl-promise": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/yauzl-promise/-/yauzl-promise-4.0.1.tgz", + "integrity": "sha512-qYEC3rJwqiJpdQ9b+bPNeuSY0c3JUM8vIuDy08qfuVN7xHm3ZDsHn2kGphUIB0ruEXrPGNXZ64nMUcu4fDjViQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/yazl": { "version": "2.4.5", "resolved": "https://registry.npmjs.org/@types/yazl/-/yazl-2.4.5.tgz", @@ -534,6 +935,18 @@ "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", "dev": true }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, "node_modules/abstract-extension": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/abstract-extension/-/abstract-extension-3.1.1.tgz", @@ -582,11 +995,22 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -597,6 +1021,188 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/archiver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-7.0.1.tgz", + "integrity": "sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ==", + "license": "MIT", + "dependencies": { + "archiver-utils": "^5.0.2", + "async": "^3.2.4", + "buffer-crc32": "^1.0.0", + "readable-stream": "^4.0.0", + "readdir-glob": "^1.1.2", + "tar-stream": "^3.0.0", + "zip-stream": "^6.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/archiver-utils": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-5.0.2.tgz", + "integrity": "sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA==", + "license": "MIT", + "dependencies": { + "glob": "^10.0.0", + "graceful-fs": "^4.2.0", + "is-stream": "^2.0.1", + "lazystream": "^1.0.0", + "lodash": "^4.17.15", + "normalize-path": "^3.0.0", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/archiver-utils/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/archiver-utils/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/archiver-utils/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/archiver-utils/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/archiver-utils/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/archiver-utils/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/archiver-utils/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/archiver/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/archiver/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/archiver/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -644,6 +1250,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "license": "MIT" + }, "node_modules/at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", @@ -682,8 +1294,7 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/bare-events": { "version": "2.4.2", @@ -691,6 +1302,26 @@ "integrity": "sha512-qMKFd2qG/36aA4GwvKq8MxnPgCQAmBWmSyLWsJcbn8v03wvIPQ/hG1Ms8bPzndZxMDoHpxez5VOS+gC9Yi24/Q==", "optional": true }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/bitfield-rle": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/bitfield-rle/-/bitfield-rle-2.2.1.tgz", @@ -740,6 +1371,30 @@ "node": ">=8" } }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/buffer-alloc": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", @@ -755,11 +1410,12 @@ "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" }, "node_modules/buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-1.0.0.tgz", + "integrity": "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==", + "license": "MIT", "engines": { - "node": "*" + "node": ">=8.0.0" } }, "node_modules/buffer-fill": { @@ -852,7 +1508,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -863,8 +1518,7 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/compact-encoding": { "version": "2.15.0", @@ -874,6 +1528,79 @@ "b4a": "^1.3.0" } }, + "node_modules/compress-commons": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-6.0.2.tgz", + "integrity": "sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==", + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "crc32-stream": "^6.0.0", + "is-stream": "^2.0.1", + "normalize-path": "^3.0.0", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/compress-commons/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/compress-commons/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/compress-commons/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/compress-commons/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -890,11 +1617,80 @@ "resolved": "https://registry.npmjs.org/count-trailing-zeros/-/count-trailing-zeros-1.0.1.tgz", "integrity": "sha512-ZnX7MMZDpu7R1aMwQRe0P1RGvfnXHibhTE+Oe/BHOCAZ/Mrp0Nv8VwaZ3G5cfFHMl5RrZ9s3HxnYoaVNB2gzgA==" }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "license": "Apache-2.0", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/crc32-stream": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-6.0.0.tgz", + "integrity": "sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g==", + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/crc32-stream/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/crc32-stream/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/crc32-stream/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -905,6 +1701,35 @@ "node": ">= 8" } }, + "node_modules/crypto-random-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/crypto-random-string/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/data-view-buffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", @@ -1017,6 +1842,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "license": "MIT" + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -1322,6 +2159,15 @@ "node": ">=0.10.0" } }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -1491,6 +2337,22 @@ "is-callable": "^1.1.3" } }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", @@ -1676,8 +2538,7 @@ "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "node_modules/graphemer": { "version": "1.4.0", @@ -1927,6 +2788,26 @@ "xsalsa20": "^1.0.0" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -2138,6 +3019,15 @@ "node": ">=0.10.0" } }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -2151,6 +3041,20 @@ "node": ">=0.10.0" } }, + "node_modules/is-it-type": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/is-it-type/-/is-it-type-5.1.2.tgz", + "integrity": "sha512-q/gOZQTNYABAxaXWnBKZjTFH4yACvWEFtgVOj+LbgxYIgAJG1xVmUZOsECSrZPIemYUQvaQWVilSFVbh4Eyt8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.16.7", + "globalthis": "^1.0.2" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/is-negative-zero": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", @@ -2230,6 +3134,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-string": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", @@ -2311,8 +3228,22 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } }, "node_modules/js-yaml": { "version": "4.1.0", @@ -2424,6 +3355,18 @@ "resolved": "https://registry.npmjs.org/last-one-wins/-/last-one-wins-1.0.4.tgz", "integrity": "sha512-t+KLJFkHPQk8lfN6WBOiGkiUXoub+gnb2XTYI2P3aiISL+94xgZ1vgz1SXN/N4hthuOoLXarXfBZPUruyjQtfA==" }, + "node_modules/lazystream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "license": "MIT", + "dependencies": { + "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" + } + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -2470,6 +3413,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -2477,6 +3426,12 @@ "dev": true, "license": "MIT" }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, "node_modules/memory-pager": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", @@ -2544,6 +3499,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mkdirp-classic": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", @@ -2670,6 +3634,15 @@ "semver": "bin/semver" } }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/npm-run-all": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", @@ -2936,7 +3909,22 @@ "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.10.0" + } + }, + "node_modules/p-event": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-6.0.1.tgz", + "integrity": "sha512-Q6Bekk5wpzW5qIyUP4gdMEujObYstZl6DMMOSenwBvV0BlE5LkDwkjs5yHbZmdCEq2o4RJx4tE1vwxFVf2FG1w==", + "license": "MIT", + "dependencies": { + "p-timeout": "^6.1.2" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-limit": { @@ -2971,6 +3959,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-timeout": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.3.tgz", + "integrity": "sha512-UJUyfKbwvr/uZSV6btANfb+0t/mOhKV/KXcCUTp8FcQI+v/0d+wXqH4htrW0E4rR6WiEO/EPvUFiV9D5OI4vlw==", + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "license": "BlueOak-1.0.0" + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -3051,7 +4057,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "engines": { "node": ">=8" } @@ -3061,6 +4066,22 @@ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/path-type": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", @@ -3150,6 +4171,15 @@ "resolved": "https://registry.npmjs.org/pretty-hash/-/pretty-hash-1.0.1.tgz", "integrity": "sha512-2jybsj3Vz6wLSyOtlRWgbUmQ/K4ROta4iR4voYeC3tgJekeWTn9NcwTVFlhqVVPB2qvVOtLTvUF6yMtG3SUIZA==" }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -3254,6 +4284,43 @@ "util-deprecate": "~1.0.1" } }, + "node_modules/readdir-glob": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz", + "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==", + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.1.0" + } + }, + "node_modules/readdir-glob/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/readdir-glob/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true, + "license": "MIT" + }, "node_modules/regexp.prototype.flags": { "version": "1.5.3", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz", @@ -3481,7 +4548,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -3493,7 +4559,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "engines": { "node": ">=8" } @@ -3527,6 +4592,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/signed-varint": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/signed-varint/-/signed-varint-2.0.1.tgz", @@ -3599,6 +4676,16 @@ "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" }, + "node_modules/simple-invariant": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/simple-invariant/-/simple-invariant-2.0.1.tgz", + "integrity": "sha512-1sbhsxqI+I2tqlmjbz99GXNmZtr6tKIyEgGGnJw/MKGblalqk/XoOYYFJlBzTKZCxx8kLaD3FD5s9BEEjx5Pyg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/simple-message-channels": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/simple-message-channels/-/simple-message-channels-1.2.1.tgz", @@ -3742,6 +4829,65 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/string.prototype.padend": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", @@ -3813,6 +4959,43 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -3859,6 +5042,46 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "license": "MIT", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/temp-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz", + "integrity": "sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + } + }, + "node_modules/tempy": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.1.0.tgz", + "integrity": "sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-stream": "^3.0.0", + "temp-dir": "^3.0.0", + "type-fest": "^2.12.2", + "unique-string": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/text-decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.1.1.tgz", @@ -3918,6 +5141,14 @@ "typescript": ">=4.2.0" } }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -3931,6 +5162,19 @@ "node": ">= 0.8.0" } }, + "node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/typed-array-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", @@ -4079,6 +5323,22 @@ "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "dev": true }, + "node_modules/unique-string": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", + "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "crypto-random-string": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", @@ -4133,7 +5393,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -4191,6 +5450,94 @@ "node": ">=0.10.0" } }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -4222,12 +5569,19 @@ "node": ">= 14" } }, - "node_modules/yazl": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.5.1.tgz", - "integrity": "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==", + "node_modules/yauzl-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yauzl-promise/-/yauzl-promise-4.0.0.tgz", + "integrity": "sha512-/HCXpyHXJQQHvFq9noqrjfa/WpQC2XYs3vI7tBiAi4QiIU1knvYhZGaO1QPjwIVMdqflxbmwgMXtYeaRiAE0CA==", + "dev": true, + "license": "MIT", "dependencies": { - "buffer-crc32": "~0.2.3" + "@node-rs/crc32": "^1.7.0", + "is-it-type": "^5.1.2", + "simple-invariant": "^2.0.1" + }, + "engines": { + "node": ">=16" } }, "node_modules/yocto-queue": { @@ -4242,6 +5596,65 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zip-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-6.0.1.tgz", + "integrity": "sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==", + "license": "MIT", + "dependencies": { + "archiver-utils": "^5.0.0", + "compress-commons": "^6.0.2", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/zip-stream/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/zip-stream/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/zip-stream/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } } } } diff --git a/package.json b/package.json index 6e3acf9..5a9a540 100644 --- a/package.json +++ b/package.json @@ -5,33 +5,38 @@ "version": "1.0.0", "main": "index.js", "scripts": { - "patch": "patch-package simple-hypercore-protocol", + "postinstall": "patch-package", "format": "prettier --write .", "test:prettier": "prettier --check .", "test:eslint": "eslint --cache .", "test:typescript": "tsc", "test:node": "node --test", "test": "npm-run-all --aggregate-output --print-label --parallel test:*", - "watch:test:typescript": "tsc --watch --project ./tsconfig.dev.json", + "watch:test:typescript": "npm run test:typescript -- --watch", "watch:test:node": "npm run test:node -- --watch" }, "license": "MIT", "dependencies": { + "archiver": "^7.0.1", "hypercore-crypto": "^3.4.2", "multifeed": "^6.0.0", - "yazl": "^2.5.1" + "p-event": "^6.0.1" }, "devDependencies": { "@eslint/js": "^9.15.0", + "@types/archiver": "^6.0.3", "@types/node": "^22.9.1", + "@types/yauzl-promise": "^4.0.1", "@types/yazl": "^2.4.5", "eslint": "^9.15.0", "globals": "^15.12.0", "npm-run-all": "^4.1.5", "patch-package": "^8.0.0", "prettier": "^3.3.3", + "tempy": "^3.1.0", "typescript": "^5.6.3", - "typescript-eslint": "^8.15.0" + "typescript-eslint": "^8.15.0", + "yauzl-promise": "^4.0.0" }, "engines": { "node": "^22.11.0", diff --git a/src/index.js b/src/index.js index 3ce50cf..45668f1 100644 --- a/src/index.js +++ b/src/index.js @@ -1 +1 @@ -export { default as MLEFWriter } from './writer.js' +export { write } from './writer.js' diff --git a/src/lib/hypercoreUtil.js b/src/lib/hypercoreUtil.js new file mode 100644 index 0000000..ced78b6 --- /dev/null +++ b/src/lib/hypercoreUtil.js @@ -0,0 +1,58 @@ +/** @import { Hypercore } from 'hypercore' */ + +/** + * Wraps `Hypercore.prototype.ready` in a promise. + * + * @param {Hypercore} hypercore + * @returns {Promise} + */ +export const ready = (hypercore) => + new Promise((resolve, reject) => { + hypercore.ready((err) => { + if (err) { + reject(err) + } else { + resolve() + } + }) + }) + +/** + * Wraps `Hypercore.prototype.rootHashes` in a promise. + * + * @param {Hypercore} hypercore + * @param {number} index + * @returns {Promise>} + */ +export const rootHashes = (hypercore, index) => + new Promise((resolve, reject) => { + hypercore.rootHashes(index, (err, roots) => { + if (err) { + return reject(err) + } else { + resolve(roots) + } + }) + }) + +/** + * Wraps `Hypercore.prototype.signature` in a promise. + * + * @param {Hypercore} hypercore + * @param {number} index + * @returns {Promise<{ index: number, signature: Buffer }>} + */ +export const signature = (hypercore, index) => + new Promise((resolve, reject) => { + hypercore.signature(index, (err, signature) => { + if (err) { + reject(err) + } else { + resolve(signature) + } + }) + }) diff --git a/src/lib/multifeedUtil.js b/src/lib/multifeedUtil.js new file mode 100644 index 0000000..ec327c3 --- /dev/null +++ b/src/lib/multifeedUtil.js @@ -0,0 +1,15 @@ +/** @import { Multifeed } from 'multifeed' */ + +/** + * @param {Multifeed} multifeed + * @returns {Promise} + */ +export const ready = (multifeed) => + new Promise((resolve, reject) => { + multifeed.once('error', reject) + + multifeed.ready(() => { + multifeed.off('error', reject) + resolve() + }) + }) diff --git a/src/lib/noop.js b/src/lib/noop.js new file mode 100644 index 0000000..9f9f125 --- /dev/null +++ b/src/lib/noop.js @@ -0,0 +1 @@ +export const noop = () => {} diff --git a/src/writer.js b/src/writer.js index 454fb56..7632150 100644 --- a/src/writer.js +++ b/src/writer.js @@ -1 +1,167 @@ -export default async function MLEFWriter() {} +import archiver from 'archiver' +import * as hypercoreCrypto from 'hypercore-crypto' +import multifeed from 'multifeed' +import fs from 'node:fs' +import { readdir } from 'node:fs/promises' +import * as path from 'node:path' +import { pEvent } from 'p-event' +import * as hypercoreUtil from './lib/hypercoreUtil.js' +import * as multifeedUtil from './lib/multifeedUtil.js' +import { noop } from './lib/noop.js' +/** @import { Hypercore } from 'hypercore' */ + +/** + * @param {string} inputPath path to `kappa.db` folder + * @param {string} outputPath path of file to save + * @returns {Promise} + */ +export async function write(inputPath, outputPath) { + const output = fs.createWriteStream(outputPath) + const archive = archiver('zip', { zlib: { level: 9 } }) + + let throwArchiveErrorIfExists = noop + /** @param {Error} err */ + const onArchiveError = (err) => { + throwArchiveErrorIfExists = () => { + throw err + } + archive.off('warning', onArchiveError) + archive.off('error', onArchiveError) + } + archive.once('warning', onArchiveError) + archive.once('error', onArchiveError) + + archive.pipe(output) + + throwArchiveErrorIfExists() + + for await (const document of getInputDocuments(inputPath)) { + throwArchiveErrorIfExists() + + const dirname = `docs/${document.id.slice(0, 2)}/${document.id}` + const basename = `${document.version || '_'}.json` + archive.append(JSON.stringify(document), { + name: `${dirname}/${basename}`, + }) + } + + const inputMediaPaths = await getInputMediaPaths(inputPath) + throwArchiveErrorIfExists() + for (const inputMediaPath of inputMediaPaths) { + archive.file(inputMediaPath, { + name: path.relative(inputPath, inputMediaPath), + }) + } + + const onOutputClosePromise = pEvent(output, 'close') + archive.finalize() + throwArchiveErrorIfExists() + await onOutputClosePromise +} + +/** + * @typedef {object} HypercoreMetadata + * @prop {string} rootHashChecksum + * @prop {string} signature + * @prop {string} coreKey + * @prop {number} blockIndex + */ + +/** + * @typedef {object} InputDocument + * @prop {string} id + * @prop {null | string} version + * @prop {unknown} document + * @prop {HypercoreMetadata} hypercoreMetadata + */ + +/** + * @param {string} inputPath + * @returns {AsyncGenerator} + */ +async function* getInputDocuments(inputPath) { + const multi = multifeed(inputPath, { + createIfMissing: false, + valueEncoding: 'json', + stats: false, + }) + await multifeedUtil.ready(multi) + + for (const hypercore of multi.feeds()) { + await hypercoreUtil.ready(hypercore) + if (hypercore.length === 0) continue + + const stream = hypercore.createReadStream() + + const hypercoreMetadata = await getHypercoreMetadata(hypercore) + + for await (const document of stream) { + const { id, version } = parseDocument(document) + yield { id, version, document, hypercoreMetadata } + } + } +} + +/** + * @param {Hypercore} hypercore + * @returns {Promise} + */ +async function getHypercoreMetadata(hypercore) { + const rootHashesPromise = hypercoreUtil.rootHashes(hypercore, 0) + const signaturePromise = hypercoreUtil.signature( + hypercore, + Math.max(0, hypercore.length - 1) + ) + return { + rootHashChecksum: hypercoreCrypto + .tree(await rootHashesPromise) + .toString('hex'), + signature: (await signaturePromise).signature.toString('hex'), + coreKey: hypercore.key.toString('hex'), + blockIndex: hypercore.length, + } +} + +/** + * @param {unknown} document + * @returns {{ id: string, version: null | string }} + */ +function parseDocument(document) { + if (typeof document !== 'object' || document === null) { + throw new Error('document is not an object') + } + + if (!('id' in document) || typeof document.id !== 'string') { + throw new Error('document.id is not a string') + } + + /** @type {null | string} */ let version = null + if ( + 'version' in document && + document.version && + typeof document.version === 'string' + ) { + version = document.version + } + + return { + id: document.id, + version, + } +} + +/** + * @param {string} inputPath + * @returns {Promise>} + */ +async function getInputMediaPaths(inputPath) { + const inputMediaRootPath = path.join(inputPath, 'media') + const inputMediaAllFiles = await readdir(inputMediaRootPath, { + recursive: true, + withFileTypes: true, + }) + const inputMediaFiles = inputMediaAllFiles.filter((dirent) => dirent.isFile()) + return inputMediaFiles.map((dirent) => + path.join(dirent.parentPath, dirent.name) + ) +} diff --git a/test/fixture/db1/0/bitfield b/test/fixture/db1/0/bitfield new file mode 100644 index 0000000..69359e2 Binary files /dev/null and b/test/fixture/db1/0/bitfield differ diff --git a/test/fixture/db1/0/key b/test/fixture/db1/0/key new file mode 100644 index 0000000..add95e3 --- /dev/null +++ b/test/fixture/db1/0/key @@ -0,0 +1 @@ +w䕗ٰɜaT5_p \ No newline at end of file diff --git a/test/fixture/db1/0/localname b/test/fixture/db1/0/localname new file mode 100644 index 0000000..331d858 --- /dev/null +++ b/test/fixture/db1/0/localname @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/test/fixture/db1/0/secret_key b/test/fixture/db1/0/secret_key new file mode 100644 index 0000000..ba6d24b --- /dev/null +++ b/test/fixture/db1/0/secret_key @@ -0,0 +1 @@ +EJU:*@diF^N]}ƽ`2w䕗ٰɜaT5_p \ No newline at end of file diff --git a/test/fixture/db1/0/signatures b/test/fixture/db1/0/signatures new file mode 100644 index 0000000..8131d61 Binary files /dev/null and b/test/fixture/db1/0/signatures differ diff --git a/test/fixture/db1/0/tree b/test/fixture/db1/0/tree new file mode 100644 index 0000000..4ff6ec0 Binary files /dev/null and b/test/fixture/db1/0/tree differ diff --git a/test/fixture/db1/1/bitfield b/test/fixture/db1/1/bitfield new file mode 100644 index 0000000..e3986f0 Binary files /dev/null and b/test/fixture/db1/1/bitfield differ diff --git a/test/fixture/db1/1/data b/test/fixture/db1/1/data new file mode 100644 index 0000000..7417ea9 --- /dev/null +++ b/test/fixture/db1/1/data @@ -0,0 +1,6 @@ +{"lon":-58.5067235,"lat":-34.5819385,"attachments":[],"tags":{"type":"craft","craft":"clay","categoryId":"clay","notes":"Nada"},"metadata":{"location":{"error":false,"permission":"granted","position":{"timestamp":1718822620160,"mocked":false,"coords":{"altitude":42.80000305175781,"heading":220.94805908203125,"altitudeAccuracy":2.857691764831543,"latitude":-34.5819385,"speed":0.4037386178970337,"longitude":-58.5067235,"accuracy":5.980000019073486}},"provider":{"backgroundModeEnabled":true,"gpsAvailable":true,"passiveAvailable":true,"locationServicesEnabled":true,"networkAvailable":true}}},"schemaVersion":3,"type":"observation","timestamp":"2024-06-19T18:43:40.490Z","created_at":"2024-06-19T18:43:40.487Z","id":"74cb70988a17b6e4","links":[]} +{"lon":-58.5067677,"lat":-34.5819589,"attachments":[{"id":"4b04270213860542d3fb2d56275fe12f.jpg","type":"image/jpeg"}],"tags":{"type":"animal","categoryId":"animal","notes":"Un animal"},"metadata":{"location":{"error":false,"permission":"granted","position":{"timestamp":1718822970076,"mocked":false,"coords":{"altitude":42.400001525878906,"heading":0,"altitudeAccuracy":2.6408803462982178,"latitude":-34.5819589,"speed":0.00892753154039383,"longitude":-58.5067677,"accuracy":3.9000000953674316}},"provider":{"backgroundModeEnabled":true,"gpsAvailable":true,"passiveAvailable":true,"locationServicesEnabled":true,"networkAvailable":true}}},"schemaVersion":3,"type":"observation","timestamp":"2024-06-19T18:49:43.200Z","created_at":"2024-06-19T18:49:43.199Z","id":"e670d3ce4a611413","links":[]} +{"lon":-58.5067985,"lat":-34.5819491,"attachments":[],"tags":{"type":"activity","activity":"gathering","categoryId":"gathering-site","notes":"Esto ea otro"},"metadata":{"location":{"error":false,"permission":"granted","position":{"timestamp":1718823160077,"mocked":false,"coords":{"altitude":27.4,"heading":0,"altitudeAccuracy":26.200000762939453,"latitude":-34.5819491,"speed":0.0067694177851080894,"longitude":-58.5067985,"accuracy":3.9000000953674316}},"provider":{"backgroundModeEnabled":true,"gpsAvailable":true,"passiveAvailable":true,"locationServicesEnabled":true,"networkAvailable":true}}},"schemaVersion":3,"type":"observation","timestamp":"2024-06-19T18:52:48.317Z","created_at":"2024-06-19T18:52:48.317Z","id":"f40be305d4d190f1","links":[]} +{"lon":-58.5067392,"lat":-34.5819587,"attachments":[{"id":"9e657b791646d5c8e1214c4b020a9dd3.jpg","type":"image/jpeg"}],"tags":{"place":"village","categoryId":"community"},"metadata":{"location":{"error":false,"permission":"granted","position":{"timestamp":1718823274077,"mocked":false,"coords":{"altitude":34.4,"heading":0,"altitudeAccuracy":20.899999618530273,"latitude":-34.5819587,"speed":0.001650038524530828,"longitude":-58.5067392,"accuracy":3.9000000953674316}},"provider":{"backgroundModeEnabled":true,"gpsAvailable":true,"passiveAvailable":true,"locationServicesEnabled":true,"networkAvailable":true}}},"schemaVersion":3,"type":"observation","timestamp":"2024-06-19T18:54:43.039Z","created_at":"2024-06-19T18:54:43.038Z","id":"d2b6e3d72200c082","links":[]} +{"lon":-58.5067235,"lat":-34.5819385,"attachments":[],"tags":{"type":"craft","craft":"clay","categoryId":"clay","notes":"Nada de verdas posta"},"metadata":{"location":{"error":false,"permission":"granted","position":{"timestamp":1718822620160,"mocked":false,"coords":{"altitude":42.80000305175781,"heading":220.94805908203125,"altitudeAccuracy":2.857691764831543,"latitude":-34.5819385,"speed":0.4037386178970337,"longitude":-58.5067235,"accuracy":5.980000019073486}},"provider":{"backgroundModeEnabled":true,"gpsAvailable":true,"passiveAvailable":true,"locationServicesEnabled":true,"networkAvailable":true}}},"schemaVersion":3,"type":"observation","timestamp":"2024-06-19T19:02:44.829Z","created_at":"2024-06-19T18:43:40.487Z","id":"74cb70988a17b6e4","links":["54aef99c451b09d15f9a3e8f0059fe8d5a97ee2b2f0cb605e3f04153c5723012@0"],"version":"54aef99c451b09d15f9a3e8f0059fe8d5a97ee2b2f0cb605e3f04153c5723012@0","deviceId":"54aef99c451b09d15f9a3e8f0059fe8d5a97ee2b2f0cb605e3f04153c5723012"} +{"lon":-58.5067235,"lat":-34.5819385,"attachments":[],"tags":{"type":"craft","craft":"clay","categoryId":"clay","notes":"Nada de verdas posta, pero esta vez de verdas"},"metadata":{"location":{"error":false,"permission":"granted","position":{"timestamp":1718822620160,"mocked":false,"coords":{"altitude":42.80000305175781,"heading":220.94805908203125,"altitudeAccuracy":2.857691764831543,"latitude":-34.5819385,"speed":0.4037386178970337,"longitude":-58.5067235,"accuracy":5.980000019073486}},"provider":{"backgroundModeEnabled":true,"gpsAvailable":true,"passiveAvailable":true,"locationServicesEnabled":true,"networkAvailable":true}}},"schemaVersion":3,"type":"observation","timestamp":"2024-06-19T19:24:05.792Z","created_at":"2024-06-19T18:43:40.487Z","id":"74cb70988a17b6e4","links":["54aef99c451b09d15f9a3e8f0059fe8d5a97ee2b2f0cb605e3f04153c5723012@4"],"version":"54aef99c451b09d15f9a3e8f0059fe8d5a97ee2b2f0cb605e3f04153c5723012@4","deviceId":"54aef99c451b09d15f9a3e8f0059fe8d5a97ee2b2f0cb605e3f04153c5723012"} diff --git a/test/fixture/db1/1/key b/test/fixture/db1/1/key new file mode 100644 index 0000000..73aa662 Binary files /dev/null and b/test/fixture/db1/1/key differ diff --git a/test/fixture/db1/1/signatures b/test/fixture/db1/1/signatures new file mode 100644 index 0000000..493685e Binary files /dev/null and b/test/fixture/db1/1/signatures differ diff --git a/test/fixture/db1/1/tree b/test/fixture/db1/1/tree new file mode 100644 index 0000000..5070f8b Binary files /dev/null and b/test/fixture/db1/1/tree differ diff --git a/test/fixture/db1/bee80ff3a4ee5e727dc44197cb9d25bf8f19d50b0f3ad2984cfe5b7d14e75de7/bitfield b/test/fixture/db1/bee80ff3a4ee5e727dc44197cb9d25bf8f19d50b0f3ad2984cfe5b7d14e75de7/bitfield new file mode 100644 index 0000000..69359e2 Binary files /dev/null and b/test/fixture/db1/bee80ff3a4ee5e727dc44197cb9d25bf8f19d50b0f3ad2984cfe5b7d14e75de7/bitfield differ diff --git a/test/fixture/db1/bee80ff3a4ee5e727dc44197cb9d25bf8f19d50b0f3ad2984cfe5b7d14e75de7/key b/test/fixture/db1/bee80ff3a4ee5e727dc44197cb9d25bf8f19d50b0f3ad2984cfe5b7d14e75de7/key new file mode 100644 index 0000000..6bb4681 --- /dev/null +++ b/test/fixture/db1/bee80ff3a4ee5e727dc44197cb9d25bf8f19d50b0f3ad2984cfe5b7d14e75de7/key @@ -0,0 +1 @@ +^r}A˝% :ҘL[}] \ No newline at end of file diff --git a/test/fixture/db1/bee80ff3a4ee5e727dc44197cb9d25bf8f19d50b0f3ad2984cfe5b7d14e75de7/signatures b/test/fixture/db1/bee80ff3a4ee5e727dc44197cb9d25bf8f19d50b0f3ad2984cfe5b7d14e75de7/signatures new file mode 100644 index 0000000..8131d61 Binary files /dev/null and b/test/fixture/db1/bee80ff3a4ee5e727dc44197cb9d25bf8f19d50b0f3ad2984cfe5b7d14e75de7/signatures differ diff --git a/test/fixture/db1/bee80ff3a4ee5e727dc44197cb9d25bf8f19d50b0f3ad2984cfe5b7d14e75de7/tree b/test/fixture/db1/bee80ff3a4ee5e727dc44197cb9d25bf8f19d50b0f3ad2984cfe5b7d14e75de7/tree new file mode 100644 index 0000000..4ff6ec0 Binary files /dev/null and b/test/fixture/db1/bee80ff3a4ee5e727dc44197cb9d25bf8f19d50b0f3ad2984cfe5b7d14e75de7/tree differ diff --git a/test/fixture/db1/index/000003.log b/test/fixture/db1/index/000003.log new file mode 100644 index 0000000..fbfd47c Binary files /dev/null and b/test/fixture/db1/index/000003.log differ diff --git a/test/fixture/db1/index/CURRENT b/test/fixture/db1/index/CURRENT new file mode 100644 index 0000000..1a84852 --- /dev/null +++ b/test/fixture/db1/index/CURRENT @@ -0,0 +1 @@ +MANIFEST-000002 diff --git a/test/fixture/db1/index/LOCK b/test/fixture/db1/index/LOCK new file mode 100644 index 0000000..e69de29 diff --git a/test/fixture/db1/index/LOG b/test/fixture/db1/index/LOG new file mode 100644 index 0000000..acc7926 --- /dev/null +++ b/test/fixture/db1/index/LOG @@ -0,0 +1 @@ +2024/06/19-15:41:09.762836 7b640e5496c0 Delete type=3 #1 diff --git a/test/fixture/db1/index/MANIFEST-000002 b/test/fixture/db1/index/MANIFEST-000002 new file mode 100644 index 0000000..bbbc585 Binary files /dev/null and b/test/fixture/db1/index/MANIFEST-000002 differ diff --git a/test/fixture/db1/media/original/4b/4b04270213860542d3fb2d56275fe12f.jpg b/test/fixture/db1/media/original/4b/4b04270213860542d3fb2d56275fe12f.jpg new file mode 100644 index 0000000..91c296f Binary files /dev/null and b/test/fixture/db1/media/original/4b/4b04270213860542d3fb2d56275fe12f.jpg differ diff --git a/test/fixture/db1/media/original/9e/9e657b791646d5c8e1214c4b020a9dd3.jpg b/test/fixture/db1/media/original/9e/9e657b791646d5c8e1214c4b020a9dd3.jpg new file mode 100644 index 0000000..65fe5c5 Binary files /dev/null and b/test/fixture/db1/media/original/9e/9e657b791646d5c8e1214c4b020a9dd3.jpg differ diff --git a/test/fixture/db1/media/preview/4b/4b04270213860542d3fb2d56275fe12f.jpg b/test/fixture/db1/media/preview/4b/4b04270213860542d3fb2d56275fe12f.jpg new file mode 100644 index 0000000..213eb1e Binary files /dev/null and b/test/fixture/db1/media/preview/4b/4b04270213860542d3fb2d56275fe12f.jpg differ diff --git a/test/fixture/db1/media/preview/9e/9e657b791646d5c8e1214c4b020a9dd3.jpg b/test/fixture/db1/media/preview/9e/9e657b791646d5c8e1214c4b020a9dd3.jpg new file mode 100644 index 0000000..318be16 Binary files /dev/null and b/test/fixture/db1/media/preview/9e/9e657b791646d5c8e1214c4b020a9dd3.jpg differ diff --git a/test/fixture/db1/media/thumbnail/4b/4b04270213860542d3fb2d56275fe12f.jpg b/test/fixture/db1/media/thumbnail/4b/4b04270213860542d3fb2d56275fe12f.jpg new file mode 100644 index 0000000..e439d4c Binary files /dev/null and b/test/fixture/db1/media/thumbnail/4b/4b04270213860542d3fb2d56275fe12f.jpg differ diff --git a/test/fixture/db1/media/thumbnail/9e/9e657b791646d5c8e1214c4b020a9dd3.jpg b/test/fixture/db1/media/thumbnail/9e/9e657b791646d5c8e1214c4b020a9dd3.jpg new file mode 100644 index 0000000..ae2f504 Binary files /dev/null and b/test/fixture/db1/media/thumbnail/9e/9e657b791646d5c8e1214c4b020a9dd3.jpg differ diff --git a/test/fixture/db1/storage/meta b/test/fixture/db1/storage/meta new file mode 100644 index 0000000..d96da77 --- /dev/null +++ b/test/fixture/db1/storage/meta @@ -0,0 +1 @@ +{"bitfield":[],"branchFactor":4} \ No newline at end of file diff --git a/test/fixture/db1/storage/staging b/test/fixture/db1/storage/staging new file mode 100644 index 0000000..37b15b2 Binary files /dev/null and b/test/fixture/db1/storage/staging differ diff --git a/test/lib/noop.js b/test/lib/noop.js new file mode 100644 index 0000000..66bc651 --- /dev/null +++ b/test/lib/noop.js @@ -0,0 +1,7 @@ +import assert from 'node:assert/strict' +import test from 'node:test' +import { noop } from '../../src/lib/noop.js' + +test('returns undefined', () => { + assert.equal(noop(), undefined) +}) diff --git a/test/writer.js b/test/writer.js index ad911bf..a8ba75a 100644 --- a/test/writer.js +++ b/test/writer.js @@ -1,6 +1,126 @@ -//import test from 'node:test' -//import assert from 'node:assert/strict' -import MLEFWriter from '../src/writer.js' +import assert from 'node:assert/strict' +import * as fs from 'node:fs/promises' +import * as path from 'node:path' +import { buffer } from 'node:stream/consumers' +import test from 'node:test' +import { temporaryFile } from 'tempy' +import yauzl from 'yauzl-promise' +import { write } from '../src/index.js' -const dbPath = new URL('./fixture/db1/', import.meta.url).pathname -await MLEFWriter(dbPath) +// add testing of links of docs to attachments +// 1. if there's a ref, check that file exists (on the three folders?) +// 2. check that there is no image unreferenced? (not that important) + +const FIXTURE_PATH = new URL('./fixture/db1', import.meta.url).pathname +const FIXTURE_DOC_ID = '74cb70988a17b6e4' +const FIXTURE_MEDIA_PATHS = [ + path.join( + FIXTURE_PATH, + 'media', + 'original', + '4b', + '4b04270213860542d3fb2d56275fe12f.jpg' + ), + path.join( + FIXTURE_PATH, + 'media', + 'original', + '9e', + '9e657b791646d5c8e1214c4b020a9dd3.jpg' + ), +] + +test("doesn't include any duplicate files", async (t) => { + const outputPath = temporaryFile({ extension: 'mlef' }) + t.after(() => fs.rm(outputPath, { force: true })) + + await write(FIXTURE_PATH, outputPath) + + const zip = await yauzl.open(outputPath) + t.after(() => zip.close()) + + /** @type {Array} */ const filenames = [] + for await (const entry of zip) filenames.push(entry.filename) + + assert.equal(filenames.length, new Set(filenames).size) +}) + +test('includes all versions of documents', async (t) => { + const outputPath = temporaryFile({ extension: 'mlef' }) + t.after(() => fs.rm(outputPath, { force: true })) + + await write(FIXTURE_PATH, outputPath) + + const zip = await yauzl.open(outputPath) + t.after(() => zip.close()) + + const docsMatchingFixture = [] + + for await (const entry of zip) { + if (!entry.filename.startsWith('docs/')) continue + const data = await readYauzlEntry(entry) + const doc = JSON.parse(data) + if (doc.id === FIXTURE_DOC_ID) docsMatchingFixture.push(doc) + } + + assert.equal(docsMatchingFixture.length, 3) + + docsMatchingFixture.sort(versionIdSort) + + assert.equal(docsMatchingFixture[0].document.tags.notes, 'Nada') + assert.equal( + docsMatchingFixture[1].document.tags.notes, + 'Nada de verdas posta' + ) + assert.equal( + docsMatchingFixture[2].document.tags.notes, + 'Nada de verdas posta, pero esta vez de verdas' + ) +}) + +test('includes all original media', async (t) => { + const outputPath = temporaryFile({ extension: 'mlef' }) + t.after(() => fs.rm(outputPath, { force: true })) + + const fixtureMediaPromises = Promise.all( + FIXTURE_MEDIA_PATHS.map((path) => fs.readFile(path)) + ) + + await write(FIXTURE_PATH, outputPath) + + const zip = await yauzl.open(outputPath) + t.after(() => zip.close()) + + let fixtureMediaNotYetFound = await fixtureMediaPromises + + for await (const entry of zip) { + if (!entry.filename.startsWith('media/')) continue + const data = await readYauzlEntry(entry) + fixtureMediaNotYetFound = fixtureMediaNotYetFound.filter( + (fixtureData) => !fixtureData.equals(data) + ) + } + + assert.deepEqual( + fixtureMediaNotYetFound, + [], + 'all original media should be found in result file' + ) +}) + +/** + * @param {yauzl.Entry} entry + * @returns {Promise} + */ +const readYauzlEntry = async (entry) => buffer(await entry.openReadStream()) + +/** + * @param {{ version: null | string }} a + * @param {{ version: null | string }} b + * @returns {-1 | 1} + */ +const versionIdSort = (a, b) => { + if (a.version === null) return -1 + if (b.version === null) return 1 + return a.version.localeCompare(b.version) +} diff --git a/types/hypercore-crypto.d.ts b/types/hypercore-crypto.d.ts index 6c4d65b..f20cfcc 100644 --- a/types/hypercore-crypto.d.ts +++ b/types/hypercore-crypto.d.ts @@ -1,4 +1,15 @@ +/** + * This is a subset of the types we actually use, so lots of things are missing. + */ declare module 'hypercore-crypto' { - export function discoveryKey(publicKey: Buffer | Uint8Array): Buffer - export function tree(Buffer) + export function discoveryKey(publicKey: Buffer): Buffer + + export function tree( + roots: ArrayLike<{ + hash: Buffer + index: number + size: number + }>, + out?: Buffer + ): Buffer } diff --git a/types/hypercore.d.ts b/types/hypercore.d.ts new file mode 100644 index 0000000..aabf440 --- /dev/null +++ b/types/hypercore.d.ts @@ -0,0 +1,29 @@ +/** + * This is a subset of the types we actually use, so lots of things are missing. + */ +declare module 'hypercore' { + export class Hypercore { + get key(): Buffer + get length(): number + + ready(cb: (err: null | Error) => unknown): void + + createReadStream(): AsyncIterable + + signature( + index: number, + cb: ( + err: null | Error, + signature: { index: number; signature: Buffer } + ) => unknown + ): void + + rootHashes( + index: number, + cb: ( + err: null | Error, + roots: Array<{ hash: Buffer; index: number; size: number }> + ) => unknown + ): void + } +} diff --git a/types/multifeed.d.ts b/types/multifeed.d.ts index 33996d0..2c9d4a9 100644 --- a/types/multifeed.d.ts +++ b/types/multifeed.d.ts @@ -1,3 +1,15 @@ +/** + * This is a subset of the types we actually use, so lots of things are missing. + */ declare module 'multifeed' { - export function ready(Function) + import { Hypercore } from 'hypercore' + import { EventEmitter } from 'node:events' + + export class Multifeed extends EventEmitter { + ready(cb: () => unknown): void + close(cb?: (err: unknown) => unknown): void + feeds(): Hypercore[] + } + + export default function multifeed(storage: string, opts?: unknown): Multifeed }