diff --git a/package-lock.json b/package-lock.json index 9853412e..1d861cf1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2482,9 +2482,9 @@ } }, "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz", - "integrity": "sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -2501,9 +2501,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.1.tgz", - "integrity": "sha512-9t7ZA7NGGK8ckelF0PQCfcxIUzs1Md5rrO6U/c+FIQNanea5UZC0wqKXH4vHBccmu4ZJgZ2idtPeW7+Q2npOEA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -2523,9 +2523,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", "dependencies": { "type-fest": "^0.20.2" }, @@ -2548,9 +2548,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.46.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.46.0.tgz", - "integrity": "sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", + "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } @@ -3340,9 +3340,9 @@ } }, "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz", - "integrity": "sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -3351,9 +3351,9 @@ } }, "node_modules/@universalweb/acid": { - "version": "3.0.53", - "resolved": "https://registry.npmjs.org/@universalweb/acid/-/acid-3.0.53.tgz", - "integrity": "sha512-R8EfsicyK6jz6gOWaSsQ9EpAdW2lCLQh+FqcpmqIrUyaLMARjM5GEGplOw6cPouQHpi0MyDyNRryQ30SO2Edog==", + "version": "3.0.55", + "resolved": "https://registry.npmjs.org/@universalweb/acid/-/acid-3.0.55.tgz", + "integrity": "sha512-3Dmz7ZnCDSLCotSFbnNuGzKnC99wI2NsY22sDTgJik9pgxE/9lcR70DNAE2AtMk7c42SA6kalBzDqgv/syyhgw==", "bin": { "Acid": "index.js" } @@ -3738,11 +3738,11 @@ ] }, "node_modules/bencode": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/bencode/-/bencode-3.1.1.tgz", - "integrity": "sha512-btsxX9201yoWh45TdqYg6+OZ5O1xTYKTYSGvJndICDFtznE/9zXgow8yjMvvhOqKKuzuL7h+iiCMpfkG8+QuBA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/bencode/-/bencode-4.0.0.tgz", + "integrity": "sha512-AERXw18df0pF3ziGOCyUjqKZBVNH8HV3lBxnx5w0qtgMIk4a1wb9BkcCQbkp9Zstfrn/dzRwl7MmUHHocX3sRQ==", "dependencies": { - "uint8-util": "^2.1.6" + "uint8-util": "^2.2.2" }, "engines": { "node": ">=12.20.0" @@ -3776,9 +3776,9 @@ } }, "node_modules/bittorrent-dht": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/bittorrent-dht/-/bittorrent-dht-11.0.4.tgz", - "integrity": "sha512-pTQKeGAJBBGkNnHpnJcBrgGYoKVhM6Y58UOgNwx7Yto9zrkdjJlyo26XpTLYMCHQBjdDBg0PGuW1nkA8cJkoIQ==", + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/bittorrent-dht/-/bittorrent-dht-11.0.5.tgz", + "integrity": "sha512-R09D6uNaziRqsc+B/j5QzkjceTak+wH9vcNLnkmt8A52EWF9lQwBP0vvCKgSA3AJOYYl+41n3osA2KYYn/z5uQ==", "funding": [ { "type": "github", @@ -3794,7 +3794,7 @@ } ], "dependencies": { - "bencode": "^3.0.3", + "bencode": "^4.0.0", "debug": "^4.3.4", "k-bucket": "^5.1.0", "k-rpc": "^5.1.0", @@ -3853,9 +3853,9 @@ ] }, "node_modules/bittorrent-protocol": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/bittorrent-protocol/-/bittorrent-protocol-4.1.9.tgz", - "integrity": "sha512-+LIl+SaWsw9X1C4xsA51PfK8k7XM0pIpVyXimrtSRdfRqmcS27jGB1KXt93+zFn4t4ljEnF/+/ODDS6hTYepjQ==", + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/bittorrent-protocol/-/bittorrent-protocol-4.1.11.tgz", + "integrity": "sha512-8ehCNnnRpxB6wrqDzYdLY6Bx0k1ZcXwHmxfVsU9xljolgfd4jhUq9gKcbnnUj4yR8I5/qHJ5fYVoGIfrmUlAAQ==", "funding": [ { "type": "github", @@ -3871,13 +3871,13 @@ } ], "dependencies": { - "bencode": "^3.1.1", + "bencode": "^4.0.0", "bitfield": "^4.1.0", "debug": "^4.3.4", "rc4": "^0.1.5", - "streamx": "^2.15.0", + "streamx": "^2.15.1", "throughput": "^1.0.1", - "uint8-util": "^2.1.9", + "uint8-util": "^2.2.2", "unordered-array-remove": "^1.0.2" }, "engines": { @@ -3885,9 +3885,9 @@ } }, "node_modules/bittorrent-tracker": { - "version": "10.0.11", - "resolved": "https://registry.npmjs.org/bittorrent-tracker/-/bittorrent-tracker-10.0.11.tgz", - "integrity": "sha512-ytTSkkjHrjpdk5Z6++7e/6tvr0X3VFV2fjCXPPTNtzrsAMvuL7OD1EReTvCY0AxyA7E/2dJpjI3z8dzH9FMHHQ==", + "version": "10.0.12", + "resolved": "https://registry.npmjs.org/bittorrent-tracker/-/bittorrent-tracker-10.0.12.tgz", + "integrity": "sha512-EYQEwhOYkrRiiwkCFcM9pbzJInsAe7UVmUgevW133duwlZzjwf5ABwDE7pkkmNRS6iwN0b8LbI/94q16dYqiow==", "funding": [ { "type": "github", @@ -3905,7 +3905,7 @@ "dependencies": { "@thaunknown/simple-peer": "^9.12.1", "@thaunknown/simple-websocket": "^9.1.0", - "bencode": "^3.0.3", + "bencode": "^4.0.0", "bittorrent-peerid": "^1.3.3", "chrome-dgram": "^3.0.6", "clone": "^2.0.0", @@ -4127,16 +4127,16 @@ } }, "node_modules/cacache": { - "version": "17.1.3", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.1.3.tgz", - "integrity": "sha512-jAdjGxmPxZh0IipMdR7fK/4sDSrHMLUV0+GvVUsjwyGNKHsh79kW/otg+GkbXwl6Uzvy9wsvHOX4nUoWldeZMg==", + "version": "17.1.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.1.4.tgz", + "integrity": "sha512-/aJwG2l3ZMJ1xNAnqbMpA40of9dj/pIH3QfiuQSqjfPJF747VR0J/bHn+/KdNnHKc6XQcWt/AfRSBft82W1d2A==", "dev": true, "dependencies": { "@npmcli/fs": "^3.1.0", "fs-minipass": "^3.0.0", "glob": "^10.2.2", "lru-cache": "^7.7.1", - "minipass": "^5.0.0", + "minipass": "^7.0.3", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", @@ -4204,6 +4204,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/cacache/node_modules/minipass": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz", + "integrity": "sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/cache-chunk-store": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/cache-chunk-store/-/cache-chunk-store-3.2.2.tgz", @@ -4269,9 +4278,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001519", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001519.tgz", - "integrity": "sha512-0QHgqR+Jv4bxHMp8kZ1Kn8CH55OikjKJ6JmKkZYP1F3D7w+lnFXF70nG5eNfsZS89jadi5Ywy5UCSKLAglIRkg==", + "version": "1.0.30001520", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001520.tgz", + "integrity": "sha512-tahF5O9EiiTzwTUqAeFjIZbn4Dnqxzz7ktrgGlMYNLH43Ul26IgTMH/zvL3DG0lZxBYnlT04axvInszUsZULdA==", "funding": [ { "type": "opencollective", @@ -4675,9 +4684,9 @@ ] }, "node_modules/create-torrent": { - "version": "6.0.13", - "resolved": "https://registry.npmjs.org/create-torrent/-/create-torrent-6.0.13.tgz", - "integrity": "sha512-z+F8mv5P25h8OVdh6WdZnh76e9KeZ8qXf8OySbVoZcGS27M/Mq9R56TPz4LyNbtsHlGhkCXiUvowzR/Snid/zQ==", + "version": "6.0.15", + "resolved": "https://registry.npmjs.org/create-torrent/-/create-torrent-6.0.15.tgz", + "integrity": "sha512-+FPYgumN6OEFTjxzSF7S7306DXu74fNF5m7CGiu+n2U+yXThnIAy9gelWjhqcndxVN2a7DKlLHqrRlr25HOQ8A==", "funding": [ { "type": "github", @@ -4693,7 +4702,7 @@ } ], "dependencies": { - "bencode": "^3.1.1", + "bencode": "^4.0.0", "block-iterator": "^1.1.1", "fast-readable-async-iterator": "^1.1.1", "is-file": "^1.0.0", @@ -4704,7 +4713,7 @@ "piece-length": "^2.0.1", "queue-microtask": "^1.2.3", "run-parallel": "^1.2.0", - "uint8-util": "^2.1.9" + "uint8-util": "^2.2.2" }, "bin": { "create-torrent": "bin/cmd.js" @@ -5129,9 +5138,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.488", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.488.tgz", - "integrity": "sha512-Dv4sTjiW7t/UWGL+H8ZkgIjtUAVZDgb/PwGWvMsCT7jipzUV/u5skbLXPFKb6iV0tiddVi/bcS2/kUrczeWgIQ==" + "version": "1.4.491", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.491.tgz", + "integrity": "sha512-ZzPqGKghdVzlQJ+qpfE+r6EB321zed7e5JsvHIlMM4zPFF8okXUkF5Of7h7F3l3cltPL0rG7YVmlp5Qro7RQLA==" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -5211,14 +5220,14 @@ } }, "node_modules/eslint": { - "version": "8.46.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.46.0.tgz", - "integrity": "sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.1", - "@eslint/js": "^8.46.0", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "^8.47.0", "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -5229,7 +5238,7 @@ "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.2", + "eslint-visitor-keys": "^3.4.3", "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", @@ -5480,9 +5489,9 @@ } }, "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz", - "integrity": "sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -5499,9 +5508,9 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", "dependencies": { "type-fest": "^0.20.2" }, @@ -5567,9 +5576,9 @@ } }, "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz", - "integrity": "sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -6147,17 +6156,26 @@ } }, "node_modules/fs-minipass": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.2.tgz", - "integrity": "sha512-2GAfyfoaCDRrM6jaOS3UsBts8yJ55VioXdWcOL7dK9zdAuKT71+WBA4ifnNYqVjYv+4SsPxjK0JT4yIIn4cA/g==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", + "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", "dev": true, "dependencies": { - "minipass": "^5.0.0" + "minipass": "^7.0.3" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz", + "integrity": "sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/fs-native-extensions": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/fs-native-extensions/-/fs-native-extensions-1.2.3.tgz", @@ -7254,9 +7272,9 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/jackspeak": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.2.tgz", - "integrity": "sha512-mgNtVv4vUuaKA97yxUHoA3+FkuhtxkjdXEWOyB/N76fjy0FjezEt34oy3epBtvCvS+7DyKwqCFWx/oJLV5+kCg==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.3.tgz", + "integrity": "sha512-pF0kfjmg8DJLxDrizHoCZGUFz4P4czQ3HyfW4BU0ffebYkzAVlBywp5zaxW/TM+r0sGbmrQdi8EQQVTJFxnGsQ==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" @@ -8119,12 +8137,12 @@ "dev": true }, "node_modules/minipass-fetch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.3.tgz", - "integrity": "sha512-n5ITsTkDqYkYJZjcRWzZt9qnZKCT7nKCosJhHoj7S7zD+BP4jVbWs+odsniw5TA3E0sLomhTKOKjF86wf11PuQ==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.4.tgz", + "integrity": "sha512-jHAqnA728uUpIaFm7NWsCnqKT6UqZz7GcI/bDpPATuwYyKwJwW0remxSCxUlKiEty+eopHGa3oc8WxgQ1FFJqg==", "dev": true, "dependencies": { - "minipass": "^5.0.0", + "minipass": "^7.0.3", "minipass-sized": "^1.0.3", "minizlib": "^2.1.2" }, @@ -8135,6 +8153,15 @@ "encoding": "^0.1.13" } }, + "node_modules/minipass-fetch/node_modules/minipass": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz", + "integrity": "sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/minipass-flush": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", @@ -8318,9 +8345,9 @@ } }, "node_modules/mongoose": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-7.4.2.tgz", - "integrity": "sha512-sNolW2hyncwvWmZjIEIwAckjaSKtC1SE86zE1v2TKm3vPTRogZfBQf+3zLYYdrgrVTzoaoICieVpct9hjcn3EQ==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-7.4.3.tgz", + "integrity": "sha512-eok0lW6mZJHK2vVSWyJb9tUfPMUuRF3h7YC4pU2K2/YSZBlNDUwvKsHgftMOANbokP2Ry+4ylvzAdW4KjkRFjw==", "dependencies": { "bson": "^5.4.0", "kareem": "2.5.1", @@ -8368,9 +8395,9 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/msgpackr": { - "version": "1.9.6", - "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.9.6.tgz", - "integrity": "sha512-50rmb6+ZWvEm0vJn8R8CwI1Eavss3h5rgtKrcdUal3EkZcpqw82+xsmc7RoHb8fYB5V4EOU2NDaOitDAdO0t+w==", + "version": "1.9.7", + "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.9.7.tgz", + "integrity": "sha512-baUNaLvKQvVhzfWTNO07njwbZK1Lxjtb0P1JL6/EhXdLTHzR57/mZqqJC39TtQKvOmkJA4pcejS4dbk7BDgLLA==", "optionalDependencies": { "msgpackr-extract": "^3.0.2" } @@ -8439,9 +8466,9 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "node_modules/node-abi": { - "version": "3.45.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.45.0.tgz", - "integrity": "sha512-iwXuFrMAcFVi/ZoZiqq8BzAdsLw9kxDfTC0HMyjXfSL/6CSDAGD5UmR7azrAgWV1zKYq7dUUMj4owusBWKLsiQ==", + "version": "3.46.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.46.0.tgz", + "integrity": "sha512-LXvP3AqTIrtvH/jllXjkNVbYifpRbt9ThTtymSMSuHmhugQLAWr99QQFTm+ZRht9ziUvdGOgB+esme1C6iE6Lg==", "dev": true, "dependencies": { "semver": "^7.3.5" @@ -9105,9 +9132,9 @@ } }, "node_modules/parse-torrent": { - "version": "11.0.12", - "resolved": "https://registry.npmjs.org/parse-torrent/-/parse-torrent-11.0.12.tgz", - "integrity": "sha512-eraUrzTwBciRSkDSQhcjp/EVoc1Z0KVO85bQlI6LCGplByXloaul5SnL0qvRO0wK+YSoNjOfJUxTS9xpgjIkdA==", + "version": "11.0.14", + "resolved": "https://registry.npmjs.org/parse-torrent/-/parse-torrent-11.0.14.tgz", + "integrity": "sha512-/9Yp1FAx5Qd7JX4/0LPiJ73bxVoUgymRDlyB2xAkJ1r9tKrtc1L4Dr024TZDwp1qzDa+oITsYn0i/SbR+fWm4w==", "funding": [ { "type": "github", @@ -9123,12 +9150,12 @@ } ], "dependencies": { - "bencode": "^3.0.3", + "bencode": "^4.0.0", "cross-fetch-ponyfill": "^1.0.3", "get-stdin": "^9.0.0", "magnet-uri": "^7.0.5", "queue-microtask": "^1.2.3", - "uint8-util": "^2.1.9" + "uint8-util": "^2.2.2" }, "bin": { "parse-torrent": "bin/cmd.js" @@ -9188,9 +9215,9 @@ } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.0.tgz", - "integrity": "sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", "dev": true, "engines": { "node": "14 || >=16.14" @@ -10062,9 +10089,9 @@ } }, "node_modules/rollup": { - "version": "3.27.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.27.2.tgz", - "integrity": "sha512-YGwmHf7h2oUHkVBT248x0yt6vZkYQ3/rvE5iQuVBh3WO8GcJ6BNeOkpoX1yMHIiBm18EMLjBPIoUDkhgnyxGOQ==", + "version": "3.28.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.0.tgz", + "integrity": "sha512-d7zhvo1OUY2SXSM6pfNjgD5+d0Nz87CUp4mt8l/GgVP3oBsPwzNvSzyu1me6BSG9JIgWNTVcafIXBIyM8yQ3yw==", "bin": { "rollup": "dist/bin/rollup" }, @@ -10515,17 +10542,26 @@ "optional": true }, "node_modules/ssri": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.4.tgz", - "integrity": "sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==", + "version": "10.0.5", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.5.tgz", + "integrity": "sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==", "dev": true, "dependencies": { - "minipass": "^5.0.0" + "minipass": "^7.0.3" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/ssri/node_modules/minipass": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz", + "integrity": "sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/streamx": { "version": "2.15.1", "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.1.tgz", @@ -11425,9 +11461,9 @@ } }, "node_modules/torrent-discovery": { - "version": "10.0.14", - "resolved": "https://registry.npmjs.org/torrent-discovery/-/torrent-discovery-10.0.14.tgz", - "integrity": "sha512-Q1qJ9cUgz+Vr9ay56KWRaygMmsUL2x+gq4PGn/9qSOkGGmowK8lOYO6Q3gTTUuw3vadMg68GiNt9WNJHS0UFig==", + "version": "10.0.16", + "resolved": "https://registry.npmjs.org/torrent-discovery/-/torrent-discovery-10.0.16.tgz", + "integrity": "sha512-HUvCgL3JAyk9VKUfFBOD7Fx/MWVNmjiCjaEOEc6P7ijm2BpPWpdjlXydP+/12f/NB3T4ItuyMjcGdPseGGjNTw==", "funding": [ { "type": "github", @@ -11443,9 +11479,9 @@ } ], "dependencies": { - "bittorrent-dht": "^11.0.4", + "bittorrent-dht": "^11.0.5", "bittorrent-lsd": "^2.0.0", - "bittorrent-tracker": "^10.0.11", + "bittorrent-tracker": "^10.0.12", "debug": "^4.3.4", "run-parallel": "^1.2.0" }, @@ -11742,9 +11778,9 @@ } }, "node_modules/ut_metadata": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/ut_metadata/-/ut_metadata-4.0.2.tgz", - "integrity": "sha512-eRGDIdvgjySf2LQMOIjn+RDMVm9qTrer3xSCKhdboMFo2ugihV3hBGOzZQFbqF7QRRtrNJsHaPKfG2CUApJA9Q==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/ut_metadata/-/ut_metadata-4.0.3.tgz", + "integrity": "sha512-2tovup0VDYpT8t8+EhhhKBmbgIyiYyJQZ+Hf+/61+SvjuRS2MEeA5CiSARP4q+9/83Wu09OsGrUre/Zv6OI5NA==", "funding": [ { "type": "github", @@ -11760,7 +11796,7 @@ } ], "dependencies": { - "bencode": "^3.0.0", + "bencode": "^4.0.0", "bitfield": "^4.0.0", "debug": "^4.2.0", "uint8-util": "^2.1.3" @@ -11770,9 +11806,9 @@ } }, "node_modules/ut_pex": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/ut_pex/-/ut_pex-4.0.3.tgz", - "integrity": "sha512-u/2pLfKMyBuZ5qMFbyjP8dGw3+zw8NI0r4yR09oJe3LIvSo9lTPmHim47449Wh2Wn0yRO6PAf94OxJV3okRU7w==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/ut_pex/-/ut_pex-4.0.4.tgz", + "integrity": "sha512-isVTbp2TKGoMOu+4Zh/i6ijpYr0VG83xjRPgCXaUjKzgXXndjCMWg32/9kZjubD+kxEXcmXMkoS8IttS9FZE8g==", "funding": [ { "type": "github", @@ -11788,7 +11824,7 @@ } ], "dependencies": { - "bencode": "^3.0.0", + "bencode": "^4.0.0", "compact2string": "^1.4.1", "string2compact": "^2.0.1" }, @@ -11929,9 +11965,9 @@ } }, "node_modules/vue-eslint-parser/node_modules/eslint-visitor-keys": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz", - "integrity": "sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -12003,9 +12039,9 @@ } }, "node_modules/webtorrent": { - "version": "2.1.17", - "resolved": "https://registry.npmjs.org/webtorrent/-/webtorrent-2.1.17.tgz", - "integrity": "sha512-j9zd9hZeAQeWeJPJy20cO1GX6GUc/mrtt136IQzFQy42u8v1NeXBwdqdyrtqrxorZvBC9rBw1/o9AiC+/pI+nA==", + "version": "2.1.25", + "resolved": "https://registry.npmjs.org/webtorrent/-/webtorrent-2.1.25.tgz", + "integrity": "sha512-mk+drIsQTktgNSygYj7fqT6FIWBjZbb2oWulZHumgVGp5tqTKay28ejNpxPKC4zr7nJZDI2F80PSC/i/fYa7aw==", "funding": [ { "type": "github", @@ -12026,12 +12062,12 @@ "@webtorrent/http-node": "^1.3.0", "addr-to-ip-port": "^2.0.0", "bitfield": "^4.1.0", - "bittorrent-dht": "^11.0.4", - "bittorrent-protocol": "^4.1.9", + "bittorrent-dht": "^11.0.5", + "bittorrent-protocol": "^4.1.11", "cache-chunk-store": "^3.2.2", "chunk-store-iterator": "^1.0.3", "cpus": "^1.0.3", - "create-torrent": "^6.0.13", + "create-torrent": "^6.0.15", "cross-fetch-ponyfill": "^1.0.3", "debug": "^4.3.4", "escape-html": "^1.0.3", @@ -12044,7 +12080,7 @@ "memory-chunk-store": "^1.3.5", "mime": "^3.0.0", "once": "^1.4.0", - "parse-torrent": "^11.0.12", + "parse-torrent": "^11.0.14", "pump": "^3.0.0", "queue-microtask": "^1.2.3", "random-iterate": "^1.0.1", @@ -12052,14 +12088,14 @@ "run-parallel": "^1.2.0", "run-parallel-limit": "^1.1.0", "speed-limiter": "^1.0.2", - "streamx": "^2.14.3", + "streamx": "^2.15.1", "throughput": "^1.0.1", - "torrent-discovery": "^10.0.14", + "torrent-discovery": "^10.0.16", "torrent-piece": "^3.0.0", "uint8-util": "^2.2.2", "unordered-array-remove": "^1.0.2", - "ut_metadata": "^4.0.2", - "ut_pex": "^4.0.3" + "ut_metadata": "^4.0.3", + "ut_pex": "^4.0.4" }, "engines": { "node": ">=14" diff --git a/scripts/certificates.js b/scripts/certificates.js index 68d9fdd1..6275f40e 100644 --- a/scripts/certificates.js +++ b/scripts/certificates.js @@ -88,6 +88,8 @@ const domainProfile = await createProfile({ // packetCompression: true, // headerCompression: true, // footerCompression: true, + // pathCompression: true, + // parameter Compression: true, autoLogin: true, // The cryptographic algo used, intended, and or generated with the provided public key keypairType: 'ed25519', diff --git a/udsp/base.js b/udsp/base.js index b655ff74..f49a99eb 100644 --- a/udsp/base.js +++ b/udsp/base.js @@ -9,7 +9,9 @@ export class UDSP { connectionIdSize, maxPayloadSize, maxDataSize, - maxHeadSize + maxHeadSize, + maxPathSize, + maxParamsSize } = this; if (maxPayloadSize) { if (!maxDataSize) { @@ -18,6 +20,12 @@ export class UDSP { if (!maxHeadSize) { this.maxHeadSize = maxPayloadSize; } + if (!maxParamsSize) { + this.maxParamsSize = maxPayloadSize; + } + if (!maxPathSize) { + this.maxPathSize = maxPayloadSize; + } } else { const packetInitialOverhead = 2; this.encryptPacketOverhead = this.cryptography.encryptOverhead; @@ -31,6 +39,12 @@ export class UDSP { if (!maxHeadSize) { this.maxHeadSize = this.maxPayloadSize - this.emptyPayloadOverHeadSize; } + if (!maxParamsSize) { + this.maxParamsSize = this.maxPayloadSize - this.emptyPayloadOverParamsSize; + } + if (!maxPathSize) { + this.maxPathSize = this.maxPayloadSize - this.emptyPayloadOverPathSize; + } console.log(`packetInitialOverhead: ${packetInitialOverhead} bytes`); } console.log(`encryptPacketOverhead: ${this.encryptPacketOverhead} bytes`); diff --git a/udsp/encodePacket.js b/udsp/encodePacket.js index 512f2cd5..7e07b9e3 100644 --- a/udsp/encodePacket.js +++ b/udsp/encodePacket.js @@ -58,6 +58,9 @@ export async function encodePacket(message, source, destination, headers, footer } if (message) { console.log(message); + if (message?.frame?.length === 1) { + message.frame = message.frame[0]; + } } if (headers) { console.log(headers); diff --git a/udsp/request/ask.js b/udsp/request/ask.js index 99470000..52105438 100644 --- a/udsp/request/ask.js +++ b/udsp/request/ask.js @@ -8,7 +8,7 @@ import { import { Base } from './base.js'; import { request } from '#udsp/requestTypes/request'; export class Ask extends Base { - constructor(method = 'get', path, data, head, options = {}, source) { + constructor(method = 'get', path, params, data, head, options = {}, source) { super(options, source); const { requestQueue, @@ -26,6 +26,10 @@ export class Ask extends Base { this.path = path; this.pathSize = path.length; } + if (params) { + this.request.params = params; + this.params = params; + } if (data) { this.request.data = data; } diff --git a/udsp/request/base.js b/udsp/request/base.js index dac66279..c28c2d5c 100644 --- a/udsp/request/base.js +++ b/udsp/request/base.js @@ -26,6 +26,8 @@ export class Base { maxPacketSize, maxDataSize, maxHeadSize, + maxPathSize, + maxParamsSize, packetMaxPayloadSafeEstimate } = source; if (events) { @@ -40,6 +42,12 @@ export class Base { if (maxHeadSize) { this.maxHeadSize = maxHeadSize; } + if (maxPathSize) { + this.maxPathSize = maxPathSize; + } + if (maxParamsSize) { + this.maxParamsSize = maxParamsSize; + } if (packetMaxPayloadSafeEstimate) { this.packetMaxPayloadSafeEstimate = packetMaxPayloadSafeEstimate; } @@ -78,6 +86,34 @@ export class Base { this.readyState = 2; this.headAssembled = true; } + setParams() { + clear(this.incomingParamsPackets); + if (this.incomingParams?.length) { + const paramsCompiled = Buffer.concat(this.incomingParams); + clearBuffer(this.incomingParams); + this.params = decode(paramsCompiled); + paramsCompiled.fill(0); + console.log('HEAD SET', this.params); + } else { + this.params = {}; + } + this.readyState = 2; + this.paramsAssembled = true; + } + setPath() { + clear(this.incomingPathPackets); + if (this.incomingPath?.length) { + const pathCompiled = Buffer.concat(this.incomingPath); + clearBuffer(this.incomingPath); + this.path = decode(pathCompiled); + pathCompiled.fill(0); + console.log('HEAD SET', this.path); + } else { + this.path = {}; + } + this.readyState = 2; + this.pathAssembled = true; + } async assembleHead() { if (this.headAssembled) { return console.log('Head already assembled'); @@ -259,7 +295,6 @@ export class Base { outgoingHeadPackets[packetId] = message; // message.offset = safeEndIndex; if (safeEndIndex === headSize) { - message.last = true; break; } packetId++; @@ -267,6 +302,37 @@ export class Base { } console.log('outgoingHeadSize', source.outgoingHeadSize); } + async pathPacketization() { + const { + maxPathSize, + isAsk, + outgoingPathPackets + } = this; + const source = (this.isAsk) ? this.request : this.response; + console.log('pathPacketization', source.path); + this.outgoingPath = encode(source.path); + this.outgoingPathSize = this.outgoingPath.length; + console.log('outgoingPathSize', source.outgoingPathSize); + let currentBytePosition = 0; + let packetId = 0; + const pathSize = this.outgoingPathSize; + console.log('maxPathSize', maxPathSize); + while (currentBytePosition < pathSize) { + const message = this.getPacketTemplate(); + message.frame.push(packetId); + const endIndex = currentBytePosition + maxPathSize; + const safeEndIndex = endIndex > pathSize ? pathSize : endIndex; + message.path = this.outgoingPath.subarray(currentBytePosition, safeEndIndex); + outgoingPathPackets[packetId] = message; + // message.offset = safeEndIndex; + if (safeEndIndex === pathSize) { + break; + } + packetId++; + currentBytePosition += maxPathSize; + } + console.log('outgoingPathSize', source.outgoingPathSize); + } async dataPacketization() { const { isAsk, @@ -404,8 +470,14 @@ export class Base { }; outgoingDataPackets = []; outgoingHeadPackets = []; + outgoingPathPackets = []; + outgoingParamsPackets = []; incomingHeadPackets = []; + incomingPathPackets = []; + incomingParamsPackets = []; incomingHead = []; + incomingPath = []; + incomingParams = []; incomingDataPackets = []; incomingData = []; incomingAks = []; diff --git a/udsp/request/onData.js b/udsp/request/onData.js index 62ea9158..22a7cf2f 100644 --- a/udsp/request/onData.js +++ b/udsp/request/onData.js @@ -1,8 +1,9 @@ +import { progress } from '@universalweb/acid'; export async function onData(message) { console.log('On Data event'); if (this.totalIncomingDataSize) { if (this.currentIncomingDataSize > 0) { - this.incomingProgress = (this.currentIncomingDataSize / this.totalIncomingDataSize) * 100; + this.incomingProgress = progress(this.totalIncomingDataSize, this.currentIncomingDataSize); } console.log('Incoming Progress', this.incomingProgress); } diff --git a/udsp/request/onHead.js b/udsp/request/onHead.js new file mode 100644 index 00000000..b664841c --- /dev/null +++ b/udsp/request/onHead.js @@ -0,0 +1,13 @@ +import { progress } from '@universalweb/acid'; +export async function onHead(message) { + console.log('On Head event'); + if (this.totalIncomingHeadSize) { + if (this.currentIncomingHeadSize > 0) { + this.incomingProgress = progress(this.totalIncomingHeadSize, this.currentIncomingHeadSize); + } + console.log('Incoming Progress', this.incomingProgress); + } + if (this.events.head) { + this.events.head(message.head, message.pid); + } +} diff --git a/udsp/request/onPacket.js b/udsp/request/onPacket.js index 0a5463f8..ba46415d 100644 --- a/udsp/request/onPacket.js +++ b/udsp/request/onPacket.js @@ -11,11 +11,15 @@ export async function onPacket(packet) { console.log('On Packet event', message); // console.log(packet); const { - // main data payload - data, + // URL or Path Endpoint for API or dynamic path related usage + path, + // Path parameters + params, // header payload head, frame, + // main data payload + data, // Packet total hpt: totalIncomingUniqueHeadPackets, dpt: totalIncomingUniqueDataPackets, @@ -59,6 +63,40 @@ export async function onPacket(packet) { this.assembleHead(); } } + if (path && !this.incomingPathPackets[packetId]) { + this.totalReceivedUniquePackets++; + this.incomingPathPackets[packetId] = message; + this.incomingPath[packetId] = message.path; + this.totalReceivedUniquePathPackets++; + this.currentIncomingPathSize += path.length; + if (this.missingPathPackets.has(packetId)) { + this.missingPathPackets.delete(packetId); + } + if (this.onPath) { + await this.onPath(message); + } + console.log(this, this.currentIncomingPathSize); + if (this.totalIncomingPathSize === this.currentIncomingPathSize) { + this.assemblePath(); + } + } + if (params && !this.incomingParamsPackets[packetId]) { + this.totalReceivedUniquePackets++; + this.incomingParamsPackets[packetId] = message; + this.incomingParams[packetId] = message.params; + this.totalReceivedUniqueParamsPackets++; + this.currentIncomingParamsSize += params.length; + if (this.missingParamsPackets.has(packetId)) { + this.missingParamsPackets.delete(packetId); + } + if (this.onParams) { + await this.onParams(message); + } + console.log(this, this.currentIncomingParamsSize); + if (this.totalIncomingParamsSize === this.currentIncomingParamsSize) { + this.assembleParams(); + } + } if (data && !this.incomingDataPackets[packetId]) { this.totalReceivedUniquePackets++; this.incomingDataPackets[packetId] = message; diff --git a/udsp/request/onParams.js b/udsp/request/onParams.js new file mode 100644 index 00000000..9be043bc --- /dev/null +++ b/udsp/request/onParams.js @@ -0,0 +1,13 @@ +import { progress } from '@universalweb/acid'; +export async function onParams(message) { + console.log('On Params event'); + if (this.totalIncomingParamsSize) { + if (this.currentIncomingParamsSize > 0) { + this.incomingProgress = progress(this.totalIncomingParamsSize, this.currentIncomingParamsSize); + } + console.log('Incoming Progress', this.incomingProgress); + } + if (this.events.params) { + this.events.params(message.params, message.pid); + } +} diff --git a/udsp/request/onPath.js b/udsp/request/onPath.js new file mode 100644 index 00000000..00dd2265 --- /dev/null +++ b/udsp/request/onPath.js @@ -0,0 +1,13 @@ +import { progress } from '@universalweb/acid'; +export async function onPath(message) { + console.log('On Path event'); + if (this.totalIncomingPathSize) { + if (this.currentIncomingPathSize > 0) { + this.incomingProgress = progress(this.totalIncomingPathSize, this.currentIncomingPathSize); + } + console.log('Incoming Progress', this.incomingProgress); + } + if (this.events.path) { + this.events.path(message.path, message.pid); + } +} diff --git a/udsp/request/reply.js b/udsp/request/reply.js index 05726ea4..56ee1380 100644 --- a/udsp/request/reply.js +++ b/udsp/request/reply.js @@ -1,5 +1,5 @@ import { - isEmpty, isBuffer, promise, eachArray, assign, construct, stringify, hasValue, get, objectSize + isEmpty, isBuffer, promise, eachArray, assign, construct, stringify, hasValue, get, objectSize, isArray } from '@universalweb/acid'; import { decode, encode } from 'msgpackr'; import { @@ -16,7 +16,10 @@ export class Reply extends Base { console.log('Setting up new reply'); const thisReply = this; const { message } = request; - const id = message?.frame[0]; + if (!message.frame) { + return this.destroy('No frame in message'); + } + const id = (isArray(message?.frame)) ? message.frame[0] : message.frame; this.id = id; const { replyQueue, } = source; this.events = source.events; diff --git a/udsp/requestTypes/fetch.js b/udsp/requestTypes/fetch.js index 731dc50a..c5518378 100644 --- a/udsp/requestTypes/fetch.js +++ b/udsp/requestTypes/fetch.js @@ -2,8 +2,11 @@ import { success, failed, imported, msgSent, info } from '#logs'; import { promise, construct, isString } from '@universalweb/acid'; +// If path arg has params in it then paramArg becomes dataArg +// params support both Complex Data Binary Supported Params and simple traditional URL percent encoded params export async function fetchRequest(path, config = {}) { info(`FETCH => ${path}`); - const request = await this.request(config.method, path, config.data || config.body, config.head || config.headers, config.options); + const request = await this.request(config.method, path, config.params || config.param, + config.data || config.body, config.head || config.headers, config.options); return request.send(); } diff --git a/udsp/requestTypes/request.js b/udsp/requestTypes/request.js index 83459938..b39348f0 100644 --- a/udsp/requestTypes/request.js +++ b/udsp/requestTypes/request.js @@ -4,9 +4,12 @@ import { import { promise, construct, isString, isPlainObject } from '@universalweb/acid'; -export async function request(methodArg, pathArg, dataArg, headersArg, optionsArg) { +// If path arg has params in it then paramArg becomes dataArg +// params support both Complex Data Binary Supported Params and simple traditional URL percent encoded params +export async function request(methodArg, pathArg, paramArg, dataArg, headersArg, optionsArg) { let method = methodArg; let path = pathArg; + let params = paramArg; let data = dataArg; let options = optionsArg; let head = headersArg; @@ -16,9 +19,10 @@ export async function request(methodArg, pathArg, dataArg, headersArg, optionsAr path = methodArg.path; method = methodArg.method; head = methodArg.head || methodArg.headers; + params = methodArg.param || methodArg.params; } info(`Request Function: ${method || 'get'} ${path}`); - const ask = this.ask(method, path, data, head, options); + const ask = this.ask(method, path, params, data, head, options); console.log(data, ask); return ask; } diff --git a/udsp/server/clients/index.js b/udsp/server/clients/index.js index 563de036..dd6a9e0f 100644 --- a/udsp/server/clients/index.js +++ b/udsp/server/clients/index.js @@ -44,6 +44,8 @@ export class Client { maxPacketSize, maxDataSize, maxHeadSize, + maxPathSize, + maxParamsSize, packetMaxPayloadSafeEstimate } = server; if (maxPacketSize) { @@ -55,6 +57,12 @@ export class Client { if (maxHeadSize) { this.maxHeadSize = maxHeadSize; } + if (maxPathSize) { + this.maxPathSize = maxPathSize; + } + if (maxParamsSize) { + this.maxHeadSize = maxParamsSize; + } if (packetMaxPayloadSafeEstimate) { this.packetMaxPayloadSafeEstimate = packetMaxPayloadSafeEstimate; }