diff --git a/Cargo.lock b/Cargo.lock index 4bddd81..a6d1303 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -495,6 +495,12 @@ dependencies = [ "bytes", ] +[[package]] +name = "cargo-test" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "980e69396f61ebd8a2af764ca60d3a154761092d91f42e2f0498188f29b6b701" + [[package]] name = "cc" version = "1.0.83" @@ -536,6 +542,16 @@ dependencies = [ "cc", ] +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "convert_case" version = "0.4.0" @@ -712,6 +728,12 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + [[package]] name = "earcutr" version = "0.4.2" @@ -1387,6 +1409,23 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +[[package]] +name = "load_test" +version = "0.1.0" +dependencies = [ + "actix-web", + "cargo-test", + "chrono", + "dotenv", + "fred", + "rand", + "redis", + "reqwest", + "serde", + "serde_json", + "tokio", +] + [[package]] name = "local-channel" version = "0.1.3" @@ -1946,6 +1985,21 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "redis" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffd6543a7bc6428396845f6854ccf3d1ae8823816592e2cbe74f20f50f209d02" +dependencies = [ + "combine", + "itoa", + "percent-encoding", + "ryu", + "sha1_smol", + "socket2 0.4.9", + "url", +] + [[package]] name = "redis-protocol" version = "4.1.0" @@ -2243,6 +2297,12 @@ dependencies = [ "digest", ] +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + [[package]] name = "sha2" version = "0.10.7" diff --git a/crates/load_test/Cargo.toml b/crates/load_test/Cargo.toml new file mode 100644 index 0000000..423de9e --- /dev/null +++ b/crates/load_test/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "load_test" +version = "0.1.0" +edition = "2021" + +[lib] +path = "src/lib.rs" + +[[bin]] +path = "src/main.rs" +name = "load_test" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +tokio = {version = "1.28.2", features = ["macros", "rt-multi-thread"]} +dotenv = "0.15.0" +redis = {version = "0.23.0"} +cargo-test = "0.3.1" +actix-web = "4.3.1" +reqwest = {version = "0.11.18", features = ["json"]} +serde = {version ="1.0.171", features = ["derive"]} +fred = { version = "6.0.0", features = ["metrics", "partial-tracing"] } +serde_json = "1.0.100" +rand = "0.8.5" +chrono = {version = "0.4.26", features = ["serde"]} \ No newline at end of file diff --git a/crates/load_test/__pycache__/locustfile.cpython-311.pyc b/crates/load_test/__pycache__/locustfile.cpython-311.pyc new file mode 100644 index 0000000..f5358d8 Binary files /dev/null and b/crates/load_test/__pycache__/locustfile.cpython-311.pyc differ diff --git a/crates/load_test/generateconfig/generatetoken.js b/crates/load_test/generateconfig/generatetoken.js new file mode 100644 index 0000000..dbf2b6b --- /dev/null +++ b/crates/load_test/generateconfig/generatetoken.js @@ -0,0 +1,77 @@ +const axios = require("axios"); +const fs = require("fs"); + +const driverUrl = "http://localhost:8016/ui"; +const customerUrl = "https://api.sandbox.beckn.juspay.in/dev/app/v2"; + +const mobileNoUser = [ + "9999999955", + "9999999945" +]; + +const mobileNoDriver = [ + "7888888881", + "7777777771", + "7777777772", + "7777777774", + "6666666668", + "6666666662", + "7888888771", + "7888888772", + "7888888773", + "7888888774", + "7888888775", + "7888888776", + "7888887776" +] + +async function auth(BASE_URL, arr, fileName, merchantId) { + const allTokens = []; + for (let i = 0; i < arr.length; i++) { + const authData = { + mobileNumber: arr[i], + mobileCountryCode: "+91", + merchantId: merchantId, + }; + + + try { + const authRes = await axios.post(BASE_URL + "/auth", authData, { + headers: { "Content-Type": "application/json" }, + }); + + const authId = authRes.data.authId; + + const authVerifyData = { + otp: "7891", + deviceToken: authId, + }; + + const authVerifyRes = await axios.post( + BASE_URL + `/auth/${authId}/verify`, + authVerifyData, + { + headers: { "Content-Type": "application/json" }, + } + ); + + const token = authVerifyRes.data.token; + allTokens.push(token); + } catch (error) { + console.error("Error while fetching API ", error); + } + } + + console.log(allTokens, "token"); + fs.writeFileSync(`output/${fileName}`, JSON.stringify(allTokens, null, 2)); + + console.log("API response has been saved to the file:", fileName); +} + +auth(customerUrl, mobileNoUser, "rider_token.json", "NAMMA_YATRI"); +auth( + driverUrl, + mobileNoDriver, + "driver_token.json", + "7f7896dd-787e-4a0b-8675-e9e6fe93bb8f" +); \ No newline at end of file diff --git a/crates/load_test/generateconfig/output/driver_token.json b/crates/load_test/generateconfig/output/driver_token.json new file mode 100644 index 0000000..705befe --- /dev/null +++ b/crates/load_test/generateconfig/output/driver_token.json @@ -0,0 +1,15 @@ +[ + "89865ef5-da51-4c1b-b383-862e57504a0e", + "75ba0a82-f750-4539-b067-d5c79fba4dad", + "7c722062-95a7-40f2-8edd-01e71b1c4122", + "c5c668f9-f127-4a86-b115-594e52b6829a", + "acbcdde0-ec76-4593-bf25-86c58638ea8d", + "1d653a3b-bde3-4fdd-96ff-a748c9e210bd", + "f9270164-5e20-4c44-b563-d062a02c80df", + "7009c594-1c5c-4d22-8071-0fdea8fd2b75", + "7f160752-8070-4fca-adc1-4735069b6812", + "576d20d6-896f-4719-ac7f-8dd5fe1e606b", + "e583da16-d331-4bd3-b8d6-a6f3bc5bb8bf", + "122bf13f-e873-40fa-84d1-c0a4cac1f854", + "77f05c66-5712-4e06-9bce-56420ae69557" +] \ No newline at end of file diff --git a/crates/load_test/generateconfig/output/rider_token.json b/crates/load_test/generateconfig/output/rider_token.json new file mode 100644 index 0000000..4f41cbc --- /dev/null +++ b/crates/load_test/generateconfig/output/rider_token.json @@ -0,0 +1,4 @@ +[ + "4016b105-586d-48a3-bfa1-aa8ada87f64d", + "9850a25d-c17e-414c-b80a-a74023b055a8" +] \ No newline at end of file diff --git a/crates/load_test/generateconfig/package-lock.json b/crates/load_test/generateconfig/package-lock.json new file mode 100644 index 0000000..a1e3de2 --- /dev/null +++ b/crates/load_test/generateconfig/package-lock.json @@ -0,0 +1,780 @@ +{ + "name": "generate-config", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, + "accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "requires": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + } + }, + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "axios": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", + "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", + "requires": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" + }, + "body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "requires": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "requires": { + "safe-buffer": "5.2.1" + } + }, + "content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" + }, + "cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + }, + "destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" + }, + "express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "requires": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "requires": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + } + }, + "raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + } + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + } + }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" + }, + "fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "requires": { + "is-glob": "^4.0.1" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" + }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "requires": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" + }, + "nodemon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.0.1.tgz", + "integrity": "sha512-g9AZ7HmkhQkqXkRc20w+ZfQ73cHLbE8hnPbtaFbFtCumZsjyMhKk9LajQ07U5Ux28lvFjZ5X7HvWR1xzU8jHVw==", + "requires": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + }, + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "requires": { + "abbrev": "1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" + }, + "object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" + }, + "on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "requires": { + "ee-first": "1.1.1" + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "requires": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + } + }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + }, + "qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "requires": { + "side-channel": "^1.0.4" + } + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "requires": { + "picomatch": "^2.2.1" + } + }, + "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==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "requires": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "dependencies": { + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + }, + "serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + } + }, + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "requires": { + "semver": "^7.5.3" + } + }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" + }, + "touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "requires": { + "nopt": "~1.0.10" + } + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/crates/load_test/generateconfig/package.json b/crates/load_test/generateconfig/package.json new file mode 100644 index 0000000..0a7e235 --- /dev/null +++ b/crates/load_test/generateconfig/package.json @@ -0,0 +1,21 @@ +{ + "name": "generate-config", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "node index.js", + "start-dev": "nodemon index.js" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "axios": "^1.4.0", + "body-parser": "^1.20.2", + "cors": "^2.8.5", + "express": "^4.18.2", + "nodemon": "^3.0.1" + } +} diff --git a/crates/load_test/locustfile.py b/crates/load_test/locustfile.py new file mode 100644 index 0000000..28f2921 --- /dev/null +++ b/crates/load_test/locustfile.py @@ -0,0 +1,205 @@ +from locust import HttpUser, task, between +import random +import datetime +import random +import json + + +class LocationUpdate(HttpUser): + def on_start(self): + self.token = [ + "89865ef5-da51-4c1b-b383-862e57504a0e", + "75ba0a82-f750-4539-b067-d5c79fba4dad", + "7c722062-95a7-40f2-8edd-01e71b1c4122", + "c5c668f9-f127-4a86-b115-594e52b6829a", + "acbcdde0-ec76-4593-bf25-86c58638ea8d", + "1d653a3b-bde3-4fdd-96ff-a748c9e210bd", + "f9270164-5e20-4c44-b563-d062a02c80df", + "7009c594-1c5c-4d22-8071-0fdea8fd2b75", + "7f160752-8070-4fca-adc1-4735069b6812", + "576d20d6-896f-4719-ac7f-8dd5fe1e606b", + "e583da16-d331-4bd3-b8d6-a6f3bc5bb8bf", + "122bf13f-e873-40fa-84d1-c0a4cac1f854", + "77f05c66-5712-4e06-9bce-56420ae69557" + ] + self.mId = "favorit0-0000-0000-0000-00000favorit" + self.vt = "SUV" + @task + def location_updates(self): + + + current_utc_time = datetime.datetime.utcnow() + + formatted_utc_time = current_utc_time.strftime('%Y-%m-%dT%H:%M:%SZ') + + token = random.choice(self.token) + print(token) + + headers = { + "Content-Type": "application/json", + "token": token, + "mId": self.mId, + "vt": self.vt + } + + locationData =[{ + "pt": { + "lat": random.uniform(13.0, 16.5), + "lon": random.uniform(75.0, 76.5) + }, + "ts": "2023-08-29T08:34:27Z", + "acc": 1 + }] + + print(locationData, "location data") + + with self.client.post(url = "/driver/location", json=locationData, headers=headers) as response: + print(response.json(), "location results") + + +class RideSearch(HttpUser): + wait_time = between(1,2) + + def on_start(self): + self.token = "c892e9cb-0a02-4966-8f2b-8a27bcbd972f" + + @task + def ride_search(self): + ride_data = { + "fareProductType": "ONE_WAY", + "contents": { + "origin": { + "address": { + "area": "8th Block Koramangala", + "areaCode": "560047", + "building": "Juspay Buildings", + "city": "Bangalore", + "country": "India", + "door": "#444", + "street": "18th Main", + "state": "Karnataka" + }, + "gps": { + "lat": 16.479615647756166, + "lon": 75.39032459232 + } + }, + "destination": { + "address": { + "area": "6th Block Koramangala", + "areaCode": "560047", + "building": "Juspay Apartments", + "city": "Bangalore", + "country": "India", + "door": "#444", + "street": "18th Main", + "state": "Karnataka" + }, + "gps": { + "lat": 16.42990908333854, + "lon": 75.36080308508846 + } + } + } + } + + headers = { + "Content-Type": "application/json", + "token": self.token, + } + + with self.client.post(url = "/rideSearch", json=ride_data, headers=headers) as response: + print(response.json(), "ride search") + +class RideSearchResults(HttpUser): + wait_time = between(1,2) + + def on_start(self): + self.token = "00ade58d-c526-43f5-9ce4-1f538388b526" + self.searchId = "7d6c2b0a-d6f8-4913-86fb-7202c48e2a99" + + @task + def ride_search_results(self): + + headers = { + "Content-Type": "application/json", + "token": self.token, + } + + with self.client.get(url = "/rideSearch/{searchId}/results".format(searchId = self.searchId), headers=headers) as response: + + # search_id = response.json().get("searchId", None) + print(response.json(), "ride search results") + + +class EstimateSelect(HttpUser): + wait_time = between(1,2) + + def on_start(self): + self.token = "00ade58d-c526-43f5-9ce4-1f538388b526" + self.estimateId = "69f585bd-7f58-44a5-ac98-ae9301822e0d" + + @task + def estimate_select(self): + headers = { + "Content-Type": "application/json", + "token": self.token, + } + + estimateData = { + "customerExtraFee": None, + "autoAssignEnabledV2": True, + "autoAssignEnabled": True + } + + with self.client.post(url = "/estimate/{estimateId}/select2".format(estimateId = self.estimateId), json=estimateData, headers=headers) as response: + print(response.json(), "estimate select results") + +class QuoteConfirm(HttpUser): + wait_time = between(1,2) + + def on_start(self): + self.token = "00ade58d-c526-43f5-9ce4-1f538388b526" + self.searchReqId = "bee5eb3f-2be8-4936-ac82-ced05b2bfe55" + + @task + def quote_confirm(self): + headers = { + "Content-Type": "application/json", + "token": self.token, + } + + quoteData = { + "searchRequestId": self.searchReqId, + "offeredFare" : 10 + } + + with self.client.post(url = "/driver/searchRequest/quote/offer", json=quoteData, headers=headers) as response: + print(response.json(), "quote results") + + +class StartRide(HttpUser): + wait_time = between(1,2) + + def on_start(self): + self.token = "00ade58d-c526-43f5-9ce4-1f538388b526" + self.rideId = "bee5eb3f-2be8-4936-ac82-ced05b2bfe55" + self.rideOtp = "" + + @task + def start_ride(self): + headers = { + "Content-Type": "application/json", + "token": self.token, + } + + rideData = { + "rideOtp": self.rideOtp, + "point": { + "lat": "12.9783131063211", + "lon": "77.595122819161" + } + } + + with self.client.post(url = "/driver/ride/{rideId}/start".format(rideId = self.rideId), json=rideData, headers=headers) as response: + print(response.json(), "quote results") \ No newline at end of file diff --git a/crates/load_test/new.rs b/crates/load_test/new.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/crates/load_test/new.rs @@ -0,0 +1 @@ + diff --git a/crates/load_test/src/lib.rs b/crates/load_test/src/lib.rs new file mode 100644 index 0000000..f94d535 --- /dev/null +++ b/crates/load_test/src/lib.rs @@ -0,0 +1 @@ +//! src/lib.rs diff --git a/crates/load_test/src/main.rs b/crates/load_test/src/main.rs new file mode 100644 index 0000000..0331976 --- /dev/null +++ b/crates/load_test/src/main.rs @@ -0,0 +1,452 @@ +//! src/main.rs +// use actix_web::{HttpRequest, HttpResponse}; +// use fred::types::GeoRadiusInfo; +use chrono::{DateTime, Utc}; +use rand::{thread_rng, Rng}; +use reqwest::header::CONTENT_TYPE; +use serde::{Deserialize, Serialize}; +use std::{ + io::{stdin, stdout, Write}, + str::FromStr, + time::{Duration, Instant}, +}; +// use std::thread; +// use serde_json::Value; + +const HOST_URL: &str = "http://127.0.0.1:8081"; + +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct UpdateDriverLocationRequest { + pub pt: Point, + pub ts: DateTime, + pub acc: i32, +} + +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct Point { + pub lat: f64, + pub lon: f64, +} + +#[derive(Debug, Deserialize, Serialize)] +pub struct AuthResponseData { + pub driver_id: String, + pub token: String, +} + +#[derive(Serialize, Deserialize, Clone)] +pub struct GetNearbyDriversRequest { + pub lat: f64, + pub lon: f64, + pub vehicle_type: String, + pub radius: f64, + pub merchant_id: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct DriverLocs { + pub lon: f64, + pub lat: f64, + pub driver_id: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct RideStartRequest { + pub lat: f64, + pub lon: f64, + pub driver_id: String, + pub merchant_id: String, +} +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct RideEndRequest { + pub lat: f64, + pub lon: f64, + pub driver_id: String, + pub merchant_id: String, +} + +#[derive(Deserialize, Serialize, Debug)] +pub struct NearbyDriverResp { + pub resp: Vec<(f64, f64, String)>, +} + +#[derive(Deserialize, Serialize, Clone, Debug)] +pub struct RideId { + pub on_ride: bool, + pub ride_id: String, +} + +#[derive(Deserialize, Serialize, Clone, Debug)] +pub struct DriverRideData { + pub resp: Vec<(f64, f64)>, +} + +#[derive(Deserialize, Serialize, Clone, Debug)] +pub struct DriverData { + pub lon: f64, + pub lat: f64, + pub merchant_id: String, + pub vehicle_type: String, + pub driver_id: String, +} + +#[derive(Deserialize, Serialize, Clone, Debug)] +pub struct DurationStruct { + pub dur: Duration, +} + +#[tokio::main] +async fn main() { + let client = reqwest::Client::new(); + let mut rng = thread_rng(); + loop { + println!("1. get_drivers\n2. default send driver\n3. call actual endpoint\n4. Start ride enpoint\n5. End ride endpoint\n6. Default actual endpoints\n7. On Ride testing\n0. End"); + let mut inp = String::new(); + stdin().read_line(&mut inp).unwrap(); + match inp.trim().parse::() { + Ok(x) => { + if x == 1 { + let lon = get_inp::("lon"); + let lat = get_inp::("lat"); + let vehicle_type = get_inp::("vt"); + let radius = get_inp::("radius"); + let merchant_id = String::from("Namma Yatri"); + let data = GetNearbyDriversRequest { + lon, + lat, + vehicle_type, + radius, + merchant_id, + }; + let resp = get_drivers(data, client.clone()) + .await + .json::() + .await + .unwrap(); + println!("{:?}", resp); + } else if x == 2 { + let mut list: Vec = Vec::new(); + let num = get_inp::("num of points"); + for i in 0..num { + let lon = rng.gen_range(-180.0..180.0); + let lat = rng.gen_range(-85.05..85.05); + let driver_id = format!("loc{}", i); + let num = rng.gen_range(0..4); + let vehicle_type = match num { + 0 => "auto".to_string(), + 1 => "cab".to_string(), + 2 => "suv".to_string(), + _ => "sedan".to_string(), + }; + let merchant_id = if rng.gen_bool(0.5) { + "Namma Yatri".to_string() + } else { + "Uber".to_string() + }; + let data = DriverData { + lon, + lat, + driver_id, + vehicle_type, + merchant_id, + }; + list.push(data); + // println!("{:?}", data); + + // thread::sleep(Duration::from_millis(10)); + } + let batch_size = get_inp::("batch size"); + let mut dur = Duration::from_secs(0); + if num <= batch_size { + println!("single"); + let start = Instant::now(); + dur += send_loc(list, client.clone()).await; + let duration = start.elapsed(); + println!("Duration: {:?}", duration); + } else { + let num_new = num / batch_size; + let start = Instant::now(); + for i in 0..num_new { + let start = i * batch_size; + let mut end = (i + 1) * batch_size; + end = if end > num { num } else { end }; + dur += send_loc(list[start..end].to_vec(), client.clone()).await; + } + let duration = start.elapsed(); + println!("Duration: {:?}", duration); + } + println!("Time Taken: {:?}", dur); + } else if x == 3 { + let lon = rng.gen_range(-180.0..180.0); + let lat = rng.gen_range(-85.05..85.05); + let num = rng.gen_range(0..4); + let ts = Utc::now(); + let acc = 1; + let vt = match num { + 0 => "auto".to_string(), + 1 => "cab".to_string(), + 2 => "suv".to_string(), + _ => "sedan".to_string(), + }; + let token = "3ab7efd4-961e-432a-835d-4d36caa042cb"; + let m_id = "favorit0-0000-0000-0000-00000favorit".to_string(); + let data = UpdateDriverLocationRequest { + pt: Point { lat, lon }, + ts, + acc, + }; + send_actual_loc(vec![data], client.clone(), token, m_id, vt).await; + } else if x == 4 { + let lon = rng.gen_range(75.0..76.5); + let lat = rng.gen_range(13.0..16.5); + let driver_id = "favorit-suv-000000000000000000000000".to_string(); + let merchant_id = "favorit0-0000-0000-0000-00000favorit".to_string(); + let data = RideStartRequest { + lon, + lat, + driver_id, + merchant_id, + }; + let ride_id = "1234"; + send_start_req(data, client.clone(), ride_id).await; + } else if x == 5 { + let lon = rng.gen_range(75.0..76.5); + let lat = rng.gen_range(13.0..16.5); + let driver_id = "favorit-suv-000000000000000000000000".to_string(); + let merchant_id = "favorit0-0000-0000-0000-00000favorit".to_string(); + let data = RideEndRequest { + lon, + lat, + driver_id, + merchant_id, + }; + let ride_id = "1234"; + let resp = send_end_req(data, client.clone(), ride_id) + .await + .json::() + .await + .unwrap(); + println!("resp: {:?}", resp); + } else if x == 6 { + let mut list: Vec = Vec::new(); + let num = get_inp::("num of points"); + let batch_size = get_inp::("batch size"); + for _i in 0..num { + let mut lon: f64; + let mut lat: f64; + let region_num = rng.gen_range(0..2); + for _j in 0..batch_size { + if region_num == 1 { + lon = rng.gen_range(75.0..76.5); + lat = rng.gen_range(13.0..16.5); + } else { + lon = rng.gen_range(76.5..77.0); + lat = rng.gen_range(9.5..10.0); + } + let data = UpdateDriverLocationRequest { + pt: Point { lon, lat }, + acc: 1, + ts: Utc::now(), + }; + list.push(data); + } + // println!("{:?}", data); + + // thread::sleep(Duration::from_millis(10)); + } + + let merchant_id = "favorit0-0000-0000-0000-00000favorit".to_string(); + let mut dur = Duration::from_secs(0); + println!("starting"); + if num <= batch_size { + println!("single"); + let num_gen = rng.gen_range(0..6); + let token = match num_gen { + 0 => "favorit-admin-0000000000000000-token", + 1 => "favorit-auto1-0000000000000000-token", + 2 => "favorit-auto2-0000000000000000-token", + 3 => "favorit-hatchback-000000000000-token", + 4 => "favorit-sedan-0000000000000000-token", + _ => "favorit-suv-000000000000000000-token", + }; + let vehicle_type = match num_gen { + 0 => "admin".to_string(), + 1 => "auto1".to_string(), + 2 => "auto2".to_string(), + 3 => "hatchback".to_string(), + 4 => "sedan".to_string(), + _ => "suv".to_string(), + }; + let start = Instant::now(); + dur += + send_actual_loc(list, client.clone(), token, merchant_id, vehicle_type) + .await; + let duration = start.elapsed(); + println!("Duration: {:?}", duration); + } else { + let num_new = num / batch_size; + let start = Instant::now(); + for i in 0..num_new { + let num_gen = rng.gen_range(0..6); + let token = match num_gen { + 0 => "favorit-admin-0000000000000000-token", + 1 => "favorit-auto1-0000000000000000-token", + 2 => "favorit-auto2-0000000000000000-token", + 3 => "favorit-hatchback-000000000000-token", + 4 => "favorit-sedan-0000000000000000-token", + _ => "favorit-suv-000000000000000000-token", + }; + let vehicle_type = match num_gen { + 0 => "admin".to_string(), + 1 => "auto1".to_string(), + 2 => "auto2".to_string(), + 3 => "hatchback".to_string(), + 4 => "sedan".to_string(), + _ => "suv".to_string(), + }; + let start = i * batch_size; + let mut end = (i + 1) * batch_size; + end = if end > num { num } else { end }; + dur += send_actual_loc( + list[start..end].to_vec(), + client.clone(), + token, + merchant_id.clone(), + vehicle_type.clone(), + ) + .await; + } + let duration = start.elapsed(); + println!("Duration: {:?}", duration); + } + println!("Time Taken: {:?}", dur); + } else if x == 7 { + let lon = rng.gen_range(75.0..76.5); + let lat = rng.gen_range(13.0..16.5); + let token = "favorit-suv-000000000000000000-token"; + let vehicle_type = "suv".to_string(); + let merchant_id = "favorit0-0000-0000-0000-00000favorit".to_string(); + let data = UpdateDriverLocationRequest { + pt: Point { lon, lat }, + ts: Utc::now(), + acc: 1, + }; + let _ = send_actual_loc( + vec![data], + client.clone(), + token, + merchant_id, + vehicle_type, + ) + .await; + } else if x == 0 { + break; + } + } + _ => continue, + } + } +} + +fn get_inp(query: &str) -> K +where + K: FromStr, +{ + let mut inp = String::new(); + loop { + print!("{}: ", query); + stdout().flush().unwrap(); + stdin().read_line(&mut inp).unwrap(); + match inp.trim().parse::() { + Ok(x) => { + return x; + } + _ => continue, + } + } +} + +async fn send_start_req(data: RideStartRequest, client: reqwest::Client, ride_id: &str) { + let json = serde_json::to_string(&data).unwrap(); + let _body = client + .post(format!("{}/internal/ride/{}/start", HOST_URL, ride_id)) + .header(CONTENT_TYPE, "application/json") + .body(json) + .send() + .await; +} + +async fn send_end_req( + data: RideEndRequest, + client: reqwest::Client, + ride_id: &str, +) -> reqwest::Response { + let json = serde_json::to_string(&data).unwrap(); + // println!("{}", format_args!("{}/internal/ride/?rideId={}/end", HOST_URL, ride_id)); + client + .post(format!("{}/internal/ride/{}/end", HOST_URL, ride_id)) + .header(CONTENT_TYPE, "application/json") + .body(json) + .send() + .await + .unwrap() +} + +async fn send_loc(data: Vec, client: reqwest::Client) -> Duration { + let json = serde_json::to_string(&data).unwrap(); + let body = client + .post(format!("{}/location", HOST_URL)) + .header(CONTENT_TYPE, "application/json") + .body(json.clone()) + .send() + .await; + // println!("{json}"); + serde_json::from_str::(&body.unwrap().text().await.unwrap()) + .unwrap() + .dur +} + +async fn send_actual_loc( + data: Vec, + client: reqwest::Client, + token: &str, + m_id: String, + vt: String, +) -> Duration { + let json = serde_json::to_string(&data).unwrap(); + // println!("{}", json); + let body = client + .post(format!("{}/ui/driver/location", HOST_URL)) + .header(CONTENT_TYPE, "application/json") + .header("token", token) + .header("vt", vt) + .header("mId", m_id) + .body(json) + .send() + .await + .unwrap(); + let status = body.status(); + let response_body = body.text().await.unwrap(); + if status != 200 { + // println!("{response_body}"); + Duration::from_secs(0) + } else { + serde_json::from_str::(&response_body) + .unwrap() + .dur + } +} + +// driver-id: favorit-suv-000000000000000000000000 + +async fn get_drivers(data: GetNearbyDriversRequest, client: reqwest::Client) -> reqwest::Response { + let json = serde_json::to_string(&data).unwrap(); + // println!("{}", formatted.concat()); + client + .get(format!("{}/internal/drivers/nearby", HOST_URL)) + .header(CONTENT_TYPE, "application/json") + .body(json) + .send() + .await + .unwrap() +}