diff --git a/package-lock.json b/package-lock.json index c4a9eaa..19a6b01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,9 @@ "luxon": "^3.7.2", "multiaddr": "^10.0.1", "multiformats": "^14.0.5", + "nestjs-pino": "^5.3.2", "pg": "^8.23.1", + "pino-http": "^11.0.0", "prom-client": "^15.1.3", "reflect-metadata": "^0.2.2", "rxjs": "^7.8.2", @@ -55,6 +57,7 @@ "eslint": "^8.57.1", "eslint-config-prettier": "^10.1.8", "eslint-plugin-prettier": "^5.5.7", + "pino-pretty": "^13.2.0", "prettier": "^3.10.1", "prisma": "7.10.0", "prisma-kysely": "^3.2.1", @@ -306,8 +309,7 @@ "resolved": "https://registry.npmjs.org/@electric-sql/pglite/-/pglite-0.4.3.tgz", "integrity": "sha512-ichuWTgtd4mOM1G4SpyGJa5trT03lWbMypDV0fUXUCXg5hiHqVAz/bZyV68NqmkLB7WcYmj1RMJVSp8HV/v/ZQ==", "devOptional": true, - "license": "Apache-2.0", - "peer": true + "license": "Apache-2.0" }, "node_modules/@electric-sql/pglite-socket": { "version": "0.1.3", @@ -906,6 +908,7 @@ "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "license": "ISC", + "peer": true, "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", @@ -923,6 +926,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -935,6 +939,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -946,13 +951,15 @@ "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "license": "MIT", + "peer": true, "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -970,6 +977,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", "license": "MIT", + "peer": true, "dependencies": { "ansi-regex": "^6.0.1" }, @@ -985,6 +993,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "license": "MIT", + "peer": true, "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -1105,7 +1114,6 @@ "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-4.0.1.tgz", "integrity": "sha512-68pFJgu+/AZbWkGu65Z3r55bTsCPlgyKaV4BSG8yUAD72q1PPuyVRgUwFv6BxdnibTUHlyxm06FmYWNC+bjN7A==", "license": "MIT", - "peer": true, "peerDependencies": { "@nestjs/common": "^10.0.0 || ^11.0.0", "axios": "^1.3.1", @@ -1175,7 +1183,6 @@ "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.9.tgz", "integrity": "sha512-zDntUTReRbAThIfSp3dQZ9kKqI+LjgLp5YZN5c1bgNRDuoeLySAoZg46Bg1a+uV8TMgIRziHocglKGNzr6l+bQ==", "license": "MIT", - "peer": true, "dependencies": { "file-type": "21.1.0", "iterare": "1.2.1", @@ -1241,7 +1248,6 @@ "integrity": "sha512-a00B0BM4X+9z+t3UxJqIZlemIwCQdYoPKrMcM+ky4z3pkqqG1eTWexjs+YXpGObnLnjtMPVKWlcZHp3adDYvUw==", "hasInstallScript": true, "license": "MIT", - "peer": true, "dependencies": { "@nuxt/opencollective": "0.4.1", "fast-safe-stringify": "2.1.1", @@ -1282,7 +1288,6 @@ "resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-11.1.9.tgz", "integrity": "sha512-GVd3+0lO0mJq2m1kl9hDDnVrX3Nd4oH3oDfklz0pZEVEVS0KVSp63ufHq2Lu9cyPdSBuelJr9iPm2QQ1yX+Kmw==", "license": "MIT", - "peer": true, "dependencies": { "cors": "2.8.5", "express": "5.1.0", @@ -1520,7 +1525,6 @@ "resolved": "https://registry.npmjs.org/@nestjs/typeorm/-/typeorm-11.0.0.tgz", "integrity": "sha512-SOeUQl70Lb2OfhGkvnh4KXWlsd+zA08RuuQgT7kKbzivngxzSo1Oc7Usu5VxCxACQC9wc2l9esOHILSJeK7rJA==", "license": "MIT", - "peer": true, "peerDependencies": { "@nestjs/common": "^10.0.0 || ^11.0.0", "@nestjs/core": "^10.0.0 || ^11.0.0", @@ -1616,12 +1620,19 @@ "node": ">=8.0.0" } }, + "node_modules/@pinojs/redact": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@pinojs/redact/-/redact-0.4.0.tgz", + "integrity": "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==", + "license": "MIT" + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "license": "MIT", "optional": true, + "peer": true, "engines": { "node": ">=14" } @@ -1665,7 +1676,6 @@ "resolved": "https://registry.npmjs.org/@prisma/client/-/client-7.10.0.tgz", "integrity": "sha512-Ubw/QS9JGIBSBUsyxAUQuK/Jcu0Tsva7le7QbLd91Kix9yJvYDdj5QkwgEbbZniH80dd+sziQcALPc+HnvQC8Q==", "license": "Apache-2.0", - "peer": true, "dependencies": { "@prisma/client-runtime-utils": "7.10.0" }, @@ -2339,7 +2349,8 @@ "version": "1.2.5", "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@standard-schema/spec": { "version": "1.0.0", @@ -2582,7 +2593,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -2618,7 +2628,6 @@ "integrity": "sha512-AnzbBERsrLKtk2XSfTbYRLjQPdy116Sty4q+T+Bp3IC4l6jNBvreVPAHmpq9qhXQM7CXZPjLVmGMw9sy+hxQ3w==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "csstype": "^3.2.2" } @@ -2685,7 +2694,6 @@ "integrity": "sha512-AuL45bVcmssHfZ3Di3cs9Q0l4gBm4ZFVrJOQEE7VpqW+PVgQaEwSwazz4TVIiFabXkk6U51EprYDwqw+HR8ePw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.73.0", "@typescript-eslint/types": "8.73.0", @@ -3322,7 +3330,6 @@ "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -3377,7 +3384,6 @@ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -3477,6 +3483,7 @@ "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==", "license": "MIT", + "peer": true, "engines": { "node": ">= 6.0.0" } @@ -3515,11 +3522,21 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "license": "MIT" }, + "node_modules/atomic-sleep": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", + "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "license": "MIT", + "peer": true, "dependencies": { "possible-typed-array-names": "^1.0.0" }, @@ -3545,7 +3562,6 @@ "resolved": "https://registry.npmjs.org/axios/-/axios-1.21.1.tgz", "integrity": "sha512-6eI5Q/Y4u/Um9dDlsRoq5pY2rxnUTv+L4PpLitnbk/i4jb3MxLZ5CsN5Ih3IysbeRYK4pR+P7qfMsOQl9fwwFQ==", "license": "MIT", - "peer": true, "dependencies": { "follow-redirects": "^1.16.2", "form-data": "^4.0.6", @@ -3767,6 +3783,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "license": "MIT", + "peer": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -3791,7 +3808,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -3879,7 +3895,6 @@ "resolved": "https://registry.npmjs.org/cache-manager/-/cache-manager-7.2.9.tgz", "integrity": "sha512-d4vceEyYe95gPxEyQchlEOH9vJlkNRW8G6gzFzzMTxJK9PahYMhC9chrEqgZN0HulROjgw3IzmWVNk7Q7ytiGw==", "license": "MIT", - "peer": true, "dependencies": { "@cacheable/utils": "^2.5.0", "keyv": "^5.6.0" @@ -3890,6 +3905,7 @@ "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "license": "MIT", + "peer": true, "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", @@ -4040,7 +4056,6 @@ "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "readdirp": "^4.0.1" }, @@ -4065,15 +4080,13 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.5.1.tgz", "integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/class-validator": { "version": "0.15.1", "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.15.1.tgz", "integrity": "sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==", "license": "MIT", - "peer": true, "dependencies": { "@types/validator": "^13.15.3", "libphonenumber-js": "^1.11.1", @@ -4156,6 +4169,7 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "license": "ISC", + "peer": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -4170,6 +4184,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "license": "MIT", + "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -4210,6 +4225,13 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "license": "MIT" }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true, + "license": "MIT" + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -4549,15 +4571,27 @@ "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", "license": "MIT", + "peer": true, "engines": { "node": ">= 12" } }, + "node_modules/dateformat": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", + "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/dayjs": { "version": "1.11.19", "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz", "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/debug": { "version": "4.4.3", @@ -4581,6 +4615,7 @@ "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.0.tgz", "integrity": "sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==", "license": "MIT", + "peer": true, "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, @@ -4635,6 +4670,7 @@ "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "license": "MIT", + "peer": true, "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -4780,7 +4816,8 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/ee-first": { "version": "1.1.1", @@ -4838,6 +4875,16 @@ "node": ">= 0.8" } }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/enhanced-resolve": { "version": "5.18.3", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz", @@ -4968,7 +5015,6 @@ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -5025,7 +5071,6 @@ "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, "license": "MIT", - "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -5370,6 +5415,13 @@ "node": ">=8.0.0" } }, + "node_modules/fast-copy": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/fast-copy/-/fast-copy-4.3.4.tgz", + "integrity": "sha512-o+7Dj5GG97OeQdPAVAo9EQE3O8YmRqUjCg0iqk9P2xH3IXI7rQPRyanWdoqK1QIzGje1oKF+kQudEStF93atyw==", + "dev": true, + "license": "MIT" + }, "node_modules/fast-decode-uri-component": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz", @@ -5481,6 +5533,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "node-domexception": "^1.0.0", "web-streams-polyfill": "^3.0.3" @@ -5636,6 +5689,7 @@ "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", "license": "MIT", + "peer": true, "dependencies": { "is-callable": "^1.2.7" }, @@ -5756,6 +5810,7 @@ "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", "license": "MIT", + "peer": true, "dependencies": { "fetch-blob": "^3.1.2" }, @@ -6006,6 +6061,7 @@ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "license": "MIT", + "peer": true, "dependencies": { "es-define-property": "^1.0.0" }, @@ -6064,6 +6120,13 @@ "node": ">= 0.4" } }, + "node_modules/help-me": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/help-me/-/help-me-5.0.0.tgz", + "integrity": "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==", + "dev": true, + "license": "MIT" + }, "node_modules/hookified": { "version": "1.15.1", "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.15.1.tgz", @@ -6234,6 +6297,7 @@ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.4" }, @@ -6323,6 +6387,7 @@ "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", "license": "MIT", + "peer": true, "dependencies": { "which-typed-array": "^1.1.16" }, @@ -6350,7 +6415,8 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/isexe": { "version": "2.0.0", @@ -6396,6 +6462,7 @@ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "license": "BlueOak-1.0.0", + "peer": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -6447,6 +6514,16 @@ "jiti": "lib/jiti-cli.mjs" } }, + "node_modules/joycon": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", + "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -6544,7 +6621,6 @@ "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.6.0.tgz", "integrity": "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==", "license": "MIT", - "peer": true, "dependencies": { "@keyv/serialize": "^1.1.1" } @@ -6833,6 +6909,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "license": "ISC", + "peer": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -6983,7 +7060,6 @@ "integrity": "sha512-FBrGau0IXmuqg4haEZRBfHNWB5mUARw6hNwPDXXGg0XzVJ50mr/9hb267lvpVMnhZ1FON3qNd4Xfcez1rbFwSg==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "aws-ssl-profiles": "^1.1.1", "denque": "^2.1.0", @@ -7035,6 +7111,22 @@ "dev": true, "license": "MIT" }, + "node_modules/nestjs-pino": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/nestjs-pino/-/nestjs-pino-5.3.2.tgz", + "integrity": "sha512-Exc8ZVbubM+OVRJJRvXfxhLY4KCxrjLk/7tARYm/9uvpoes4tWWMjUMd1ayD/ZwxZWpYyZmUkxJJ4YSLOqpqMg==", + "license": "MIT", + "engines": { + "node": ">=22.12.0" + }, + "peerDependencies": { + "@nestjs/common": "^11.0.8 || ^12.0.2", + "@nestjs/core": "^11.0.8 || ^12.0.2", + "pino": "^10.0.0", + "pino-http": "^11.0.0", + "rxjs": "^7.1.0" + } + }, "node_modules/node-abort-controller": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", @@ -7058,6 +7150,7 @@ } ], "license": "MIT", + "peer": true, "engines": { "node": ">=10.5.0" } @@ -7135,6 +7228,15 @@ "devOptional": true, "license": "MIT" }, + "node_modules/on-exit-leak-free": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", + "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -7306,7 +7408,8 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "license": "BlueOak-1.0.0" + "license": "BlueOak-1.0.0", + "peer": true }, "node_modules/parent-module": { "version": "1.0.1", @@ -7437,7 +7540,6 @@ "resolved": "https://registry.npmjs.org/pg/-/pg-8.23.1.tgz", "integrity": "sha512-aL96AHANtWjPLDOLqnhx+ngp9+UK7ETEU8VJrDCGvsSSi/mGLcWYsS6Herg7lmaBJe4uwrfqsa7gTEFaSizDoQ==", "license": "MIT", - "peer": true, "dependencies": { "pg-connection-string": "^2.14.1", "pg-pool": "^3.14.0", @@ -7542,6 +7644,103 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pino": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/pino/-/pino-10.4.0.tgz", + "integrity": "sha512-bk1ZMTwG/Vymx+zPoa28MhNzucFvXJWp3csrSuxuHPSMeUettaCoQ5Jvg07mtC4JGNpcfTwz41oVCnNgBK9+vA==", + "license": "MIT", + "dependencies": { + "@pinojs/redact": "^0.4.0", + "atomic-sleep": "^1.0.0", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "^3.0.0", + "pino-std-serializers": "^7.0.0", + "process-warning": "^5.0.0", + "quick-format-unescaped": "^4.0.3", + "real-require": "^1.0.0", + "safe-stable-stringify": "^2.3.1", + "sonic-boom": "^4.0.1", + "thread-stream": "^4.0.0" + }, + "bin": { + "pino": "bin.js" + } + }, + "node_modules/pino-abstract-transport": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-3.0.0.tgz", + "integrity": "sha512-wlfUczU+n7Hy/Ha5j9a/gZNy7We5+cXp8YL+X+PG8S0KXxw7n/JXA3c46Y0zQznIJ83URJiwy7Lh56WLokNuxg==", + "license": "MIT", + "dependencies": { + "split2": "^4.0.0" + } + }, + "node_modules/pino-http": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/pino-http/-/pino-http-11.0.0.tgz", + "integrity": "sha512-wqg5XIAGRRIWtTk8qPGxkbrfiwEWz1lgedVLvhLALudKXvg1/L2lTFgTGPJ4Z2e3qcRmxoFxDuSdMdMGNM6I1g==", + "license": "MIT", + "dependencies": { + "get-caller-file": "^2.0.5", + "pino": "^10.0.0", + "pino-std-serializers": "^7.0.0", + "process-warning": "^5.0.0" + } + }, + "node_modules/pino-pretty": { + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-13.2.0.tgz", + "integrity": "sha512-jjghD1ML+Di/WxjJDz6j6Y4FT7hIXOlb8h27AyJ+ohtAXJXH4PS/xkv7si+RCCIW59HMgZsMKTDgzdr0RhuRrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "colorette": "^2.0.7", + "dateformat": "^4.6.3", + "fast-copy": "^4.0.0", + "fast-safe-stringify": "^2.1.1", + "help-me": "^5.0.0", + "joycon": "^3.1.1", + "minimist": "^1.2.6", + "on-exit-leak-free": "^2.1.2", + "pino-abstract-transport": "^3.0.0", + "pump": "^3.0.3", + "secure-json-parse": "^4.1.0", + "sonic-boom": "^5.0.0", + "strip-json-comments": "^5.0.3" + }, + "bin": { + "pino-pretty": "bin.js" + } + }, + "node_modules/pino-pretty/node_modules/sonic-boom": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-5.0.2.tgz", + "integrity": "sha512-/JEruzo6yhNVhsLblTRchgTQHIt7SsdJP0YyrfWaNKjIOQDfrdZv9gwYraYCAsmKV39/LAdV31FLL5NCDpoL/A==", + "dev": true, + "license": "MIT", + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, + "node_modules/pino-pretty/node_modules/strip-json-comments": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.1.0.tgz", + "integrity": "sha512-ErcwpJBYr8EfX/Br7JauOIGXoRE92w0hVtuS9j92UFgbATxA+WRSIZksSUDzEeItfWB/0QCEprTZT55RSINUHQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pino-std-serializers": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.1.0.tgz", + "integrity": "sha512-BndPH67/JxGExRgiX1dX0w1FvZck5Wa4aal9198SrRhZjH3GxKQUKIBnYJTdj2HDN3UQAS06HlfcSbQj2OHmaw==", + "license": "MIT" + }, "node_modules/pkg-types": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.0.tgz", @@ -7569,6 +7768,7 @@ "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.4" } @@ -7642,7 +7842,6 @@ "integrity": "sha512-70vp3ZUYoPlFbF9uiTdXHUUCGEIp7d4+6p+8DYbkm2jP7x/3i/paXVF6dopSI3zd/CEitrZN1rc4i85xWmmXlg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -7673,7 +7872,6 @@ "devOptional": true, "hasInstallScript": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@prisma/config": "7.10.0", "@prisma/dev": "0.24.17", @@ -7721,6 +7919,22 @@ "prisma": ">=7.0.0" } }, + "node_modules/process-warning": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-5.1.1.tgz", + "integrity": "sha512-oCkNVj4OKnKEcocVBcDfiIugN1/cE6rgfT3nCtzeqZPA8+rIxMaQ0xXzIkGP8Gj2qUaP1UR7uhJ1VD8lUCpzCg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, "node_modules/prom-client": { "version": "15.1.3", "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-15.1.3.tgz", @@ -7793,6 +8007,17 @@ "node": ">=10" } }, + "node_modules/pump": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz", + "integrity": "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -7856,6 +8081,12 @@ ], "license": "MIT" }, + "node_modules/quick-format-unescaped": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", + "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==", + "license": "MIT" + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -7943,6 +8174,12 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/real-require": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/real-require/-/real-require-1.0.0.tgz", + "integrity": "sha512-P4nbQYQfePJxRSmY+v/KINxVucm4NF3p3s7pJveMTtom52FR4YGltUQLB8idDXwDDWW+eYrWDFbuzUnjoWHF7g==", + "license": "MIT" + }, "node_modules/receptacle": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/receptacle/-/receptacle-1.3.2.tgz", @@ -7956,8 +8193,7 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", - "license": "Apache-2.0", - "peer": true + "license": "Apache-2.0" }, "node_modules/remeda": { "version": "2.33.4", @@ -7974,6 +8210,7 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -8165,7 +8402,6 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", - "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -8213,6 +8449,15 @@ "safe-regex2": "bin/safe-regex2.js" } }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -8224,7 +8469,8 @@ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", "devOptional": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/schema-utils": { "version": "3.3.0", @@ -8251,7 +8497,6 @@ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -8280,6 +8525,23 @@ "dev": true, "license": "MIT" }, + "node_modules/secure-json-parse": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-4.1.1.tgz", + "integrity": "sha512-lnd81MQEZKjhW/Gd2TQqdd4XP6QYNdDW/EP+I7nTrFHP9y2LmaGPIHk9xsnzcOiEr1c39c/e84xFgGviQKBTRw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/semver": { "version": "7.8.6", "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", @@ -8351,6 +8613,7 @@ "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "license": "MIT", + "peer": true, "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -8374,6 +8637,7 @@ "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.12.tgz", "integrity": "sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==", "license": "(MIT AND BSD-3-Clause)", + "peer": true, "dependencies": { "inherits": "^2.0.4", "safe-buffer": "^5.2.1", @@ -8501,6 +8765,15 @@ "dev": true, "license": "MIT" }, + "node_modules/sonic-boom": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.1.tgz", + "integrity": "sha512-w6AxtubXa2wTXAUsZMMWERrsIRAdrK0Sc+FUytWvYAhBJLyuI4llrMIC1DtlNSdI99EI86KZum2MMq3EAZlF9Q==", + "license": "MIT", + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, "node_modules/source-map": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", @@ -8553,6 +8826,7 @@ } ], "license": "MIT", + "peer": true, "engines": { "node": ">=14" } @@ -8620,6 +8894,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "license": "MIT", + "peer": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -8647,6 +8922,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", + "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -8881,6 +9157,18 @@ "dev": true, "license": "MIT" }, + "node_modules/thread-stream": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-4.2.1.tgz", + "integrity": "sha512-Stg6edJXC/6/xqGwSXwFokrUhChJ18amEjpKH89WrQQ0oVFDF+pUUcTpiwWhFUrE89Vf16FBOlwhaw+lescxMQ==", + "license": "MIT", + "dependencies": { + "real-require": "^1.0.0" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", @@ -8916,6 +9204,7 @@ "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.2.tgz", "integrity": "sha512-db0E3UJjcFhpDhAF4tLo03oli3pwl3dbnzXOUIlRKrp+ldk/VUxzpWYZENsw2SZiuBjHAk7DfB0VU7NKdpb6sw==", "license": "MIT", + "peer": true, "dependencies": { "isarray": "^2.0.5", "safe-buffer": "^5.2.1", @@ -9046,6 +9335,7 @@ "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", "license": "MIT", + "peer": true, "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", @@ -9169,6 +9459,7 @@ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", "license": "BSD-2-Clause", + "peer": true, "engines": { "node": ">=12" }, @@ -9181,6 +9472,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", "license": "ISC", + "peer": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", @@ -9200,13 +9492,15 @@ "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/typeorm/node_modules/path-scurry": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "license": "BlueOak-1.0.0", + "peer": true, "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -9224,7 +9518,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9353,6 +9646,7 @@ "https://github.com/sponsors/ctavan" ], "license": "MIT", + "peer": true, "bin": { "uuid": "dist/esm/bin/uuid" } @@ -9524,6 +9818,7 @@ "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", "license": "MIT", + "peer": true, "engines": { "node": ">= 8" } @@ -9534,7 +9829,6 @@ "integrity": "sha512-HU1JOuV1OavsZ+mfigY0j8d1TgQgbZ6M+J75zDkpEAwYeXjWSqrGJtgnPblJjd/mAyTNQ7ygw0MiKOn6etz8yw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.8", @@ -9703,6 +9997,7 @@ "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", "license": "MIT", + "peer": true, "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", @@ -9762,6 +10057,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "license": "MIT", + "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -9785,7 +10081,6 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "license": "MIT", - "peer": true, "engines": { "node": ">=10.0.0" }, @@ -9816,6 +10111,7 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "license": "ISC", + "peer": true, "engines": { "node": ">=10" } @@ -9825,6 +10121,7 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "license": "MIT", + "peer": true, "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -9889,7 +10186,6 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index df0cfd6..897b3ed 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,9 @@ "scripts": { "build": "nest build", "format": "prettier --write \"src/**/*.ts\"", - "start": "nest start", - "start:dev": "nest start --watch", - "start:debug": "nest start --debug --watch", + "start": "nest start | pino-pretty", + "start:dev": "nest start --watch | pino-pretty", + "start:debug": "nest start --debug --watch | pino-pretty", "start:prod": "node dist/main", "migration:deploy": "prisma migrate deploy", "migration:generate": "prisma generate --sql", @@ -49,7 +49,9 @@ "luxon": "^3.7.2", "multiaddr": "^10.0.1", "multiformats": "^14.0.5", + "nestjs-pino": "^5.3.2", "pg": "^8.23.1", + "pino-http": "^11.0.0", "prom-client": "^15.1.3", "reflect-metadata": "^0.2.2", "rxjs": "^7.8.2", @@ -67,6 +69,7 @@ "eslint": "^8.57.1", "eslint-config-prettier": "^10.1.8", "eslint-plugin-prettier": "^5.5.7", + "pino-pretty": "^13.2.0", "prettier": "^3.10.1", "prisma": "7.10.0", "prisma-kysely": "^3.2.1", diff --git a/src/app.module.ts b/src/app.module.ts index 7994167..7f397f8 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -1,12 +1,13 @@ import { HttpModule, HttpService } from '@nestjs/axios'; import { CacheInterceptor, CacheModule } from '@nestjs/cache-manager'; -import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'; +import { Module } from '@nestjs/common'; import { ConfigModule } from '@nestjs/config'; import { APP_FILTER, APP_INTERCEPTOR } from '@nestjs/core'; import { ScheduleModule } from '@nestjs/schedule'; import { TerminusModule } from '@nestjs/terminus'; import axios from 'axios'; import axiosBetterStacktrace from 'axios-better-stacktrace'; +import { LoggerModule } from 'nestjs-pino'; import { AppController } from './controller/app/app.controller'; import { ClientsController } from './controller/clients/clients.controller'; import { FilecoinPayController } from './controller/filecoin-pay/filecoin-pay.controller'; @@ -16,7 +17,6 @@ import { DbModule } from './db/db.module'; import { PrismaService } from './db/prisma.service'; import { IpniAdvertisementFetcherJobService } from './jobs/ipni-advertisement-fetcher-job/ipni-advertisement-fetcher-job.service'; import { ErrorHandlerMiddleware } from './middleware/error-handler.middleware'; -import { RequestLoggerMiddleware } from './middleware/request-logger.middleware'; import { PoRepIndexerModule } from './po-rep-indexer'; import { PrometheusMetricModule } from './prometheus'; import { CidContactService } from './service/cid-contact/cid-contact.service'; @@ -32,6 +32,16 @@ import { IPNIController } from 'src/controller/ipni/ipni.controller'; @Module({ imports: [ + LoggerModule.forRoot({ + pinoHttp: { + level: process.env.NODE_ENV === 'test' ? 'silent' : 'debug', + formatters: { + level(label) { + return { level: label }; + }, + }, + }, + }), ConfigModule.forRoot(), ScheduleModule.forRoot(), HttpModule.register({ timeout: 5000 }), // 5 seconds @@ -73,12 +83,8 @@ import { IPNIController } from 'src/controller/ipni/ipni.controller'; }, ], }) -export class AppModule implements NestModule { +export class AppModule { constructor(private readonly httpService: HttpService) { axiosBetterStacktrace(this.httpService.axiosRef); } - - configure(consumer: MiddlewareConsumer) { - consumer.apply(RequestLoggerMiddleware).forRoutes('*'); - } } diff --git a/src/main.ts b/src/main.ts index 7c5e67a..5d93378 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,7 @@ import { ConsoleLogger, ValidationPipe } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; +import { Logger } from 'nestjs-pino'; import * as packageJson from '../package.json'; import { AppModule } from './app.module'; @@ -32,6 +33,7 @@ process.on('unhandledRejection', exitOnFatalError('Unhandled rejection')); async function bootstrap() { const app = await NestFactory.create(AppModule, { logger: logger }); + app.useLogger(app.get(Logger)); app.enableShutdownHooks(); app.enableCors(); app.useGlobalPipes( diff --git a/src/middleware/request-logger.middleware.ts b/src/middleware/request-logger.middleware.ts deleted file mode 100644 index d67cb47..0000000 --- a/src/middleware/request-logger.middleware.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Injectable, NestMiddleware, Logger } from '@nestjs/common'; -import { Request, Response, NextFunction } from 'express'; - -@Injectable() -export class RequestLoggerMiddleware implements NestMiddleware { - private logger = new Logger('HTTP'); - - use(request: Request, response: Response, next: NextFunction) { - // const userAgent = request.get('user-agent') || ''; - // this.logger.verbose( - // `${request.method} ${request.originalUrl} from ${userAgent}`, - // ); - - const requestStartAt = process.hrtime(); - const send = response.send; - - response.send = (data) => { - const requestEndAt = process.hrtime(requestStartAt); - const responseTime = requestEndAt[0] * 1e3 + requestEndAt[1] * 1e-6; - const cacheHit = response.get('X-Cache') === 'HIT' ? '(X-Cache HIT)' : ''; - - this.logger.debug( - `${request.method} ${request.originalUrl}: ${response.statusCode} +${responseTime.toFixed(0)}ms ${cacheHit}`, - ); - - response.send = send; - return response.send(data); - }; - - next(); - } -} diff --git a/src/po-rep-indexer/po-rep-indexer.module.ts b/src/po-rep-indexer/po-rep-indexer.module.ts index 12e98f3..56cb66c 100644 --- a/src/po-rep-indexer/po-rep-indexer.module.ts +++ b/src/po-rep-indexer/po-rep-indexer.module.ts @@ -16,32 +16,41 @@ import { createClientForChainOrThrow, validatePoRepConfig, } from './po-rep-indexer.utils'; +import { RpcMetricsContext } from './rpc-metrics-context.service'; import { AbstractPoRepIndexerRunner } from './runners/abstract-po-rep-indexer.runner'; import { FilecoinPayIndexerRunner } from './runners/filecoin-pay-indexer.runner'; import { PoRepProvidersAndDealsIndexerRunner } from './runners/po-rep-providers-and-deals.runner'; const recentNodeClient: FactoryProvider = { provide: RECENT_NODE_CLIENT, - useFactory: (configService: ConfigService) => { + useFactory: ( + configService: ConfigService, + rpcMetricsContext: RpcMetricsContext, + ) => { return createClientForChainOrThrow({ chainId: configService.get('PO_REP_CHAIN_ID'), rpcUrl: configService.get('PO_REP_RECENT_RPC_URL'), authToken: configService.get('PO_REP_RECENT_RPC_AUTH_TOKEN'), + rpcMetricsContext, }); }, - inject: [ConfigService], + inject: [ConfigService, RpcMetricsContext], }; const archiveNodeClient: FactoryProvider = { provide: ARCHIVE_NODE_CLIENT, - useFactory: (configService: ConfigService) => { + useFactory: ( + configService: ConfigService, + rpcMetricsContext: RpcMetricsContext, + ) => { return createClientForChainOrThrow({ chainId: configService.get('PO_REP_CHAIN_ID'), rpcUrl: configService.get('PO_REP_ARCHIVE_RPC_URL'), authToken: configService.get('PO_REP_ARCHIVE_RPC_AUTH_TOKEN'), + rpcMetricsContext, }); }, - inject: [ConfigService], + inject: [ConfigService, RpcMetricsContext], }; @Module({ @@ -56,6 +65,7 @@ const archiveNodeClient: FactoryProvider = { PrismaService, PoRepProvidersAndDealsIndexerRunner, FilecoinPayIndexerRunner, + RpcMetricsContext, recentNodeClient, archiveNodeClient, DealManifestService, diff --git a/src/po-rep-indexer/po-rep-indexer.types.ts b/src/po-rep-indexer/po-rep-indexer.types.ts index f503cb8..f674808 100644 --- a/src/po-rep-indexer/po-rep-indexer.types.ts +++ b/src/po-rep-indexer/po-rep-indexer.types.ts @@ -41,6 +41,48 @@ export type PoRepPublicClient = PublicClient< > & FilecoinActions; +export interface RpcMetrics { + totalCallsCount: number; + totalCallsDurationMs: number; + averageCallDurationMs: number; + rpcCallsByMethod: Record< + string, + { + count: number; + totalDurationMs: number; + averageDurationMs: number; + } + >; +} + +export interface IndexerBatchMetrics { + fromBlock?: bigint; + toBlock?: bigint; + batchBlockSize?: bigint; + nodeType?: 'archive' | 'recent'; + changesReadDurationMs?: number; + changesWriteDurationMs?: number; +} + +export interface IndexerBatchResultContext { + event: 'indexer.batch.result'; + indexer: string; + batchStartEpoch?: string; + batchEndEpoch?: string; + batchBlockSize?: string; + nodeType?: 'archive' | 'recent'; + timeoutCount: number; + error: boolean; + keepRunning: boolean; + totalDurationMs: number; + changesReadDurationMs?: number; + changesWriteDurationMs?: number; + rpcCalls: number; + rpcTotalDurationMs: number; + rpcCallAverageDurationMs: number; + rpcByMethod: RpcMetrics['rpcCallsByMethod']; +} + export type PoRepConfig = z.infer; export type DealManifest = z.infer; diff --git a/src/po-rep-indexer/po-rep-indexer.utils.ts b/src/po-rep-indexer/po-rep-indexer.utils.ts index c70e584..7d929f7 100644 --- a/src/po-rep-indexer/po-rep-indexer.utils.ts +++ b/src/po-rep-indexer/po-rep-indexer.utils.ts @@ -1,4 +1,11 @@ -import { createPublicClient, extractChain, http, rpcSchema } from 'viem'; +import { Logger } from '@nestjs/common'; +import { + createPublicClient, + extractChain, + http, + HttpTransport, + rpcSchema, +} from 'viem'; import z from 'zod'; import { PO_REP_CONFIG_SCHEMA, @@ -9,13 +16,17 @@ import { PoRepConfig, PoRepPublicClient, } from './po-rep-indexer.types'; +import { RpcMetricsContext } from './rpc-metrics-context.service'; type SupportedChainId = (typeof PO_REP_SUPPORTED_CHAINS)[number]['id']; +const rpcLogger = new Logger('RpcRequest'); + export interface GetClientForChainOptions { chainId: number; rpcUrl?: string | null; authToken?: string | null; + rpcMetricsContext: RpcMetricsContext; } const filecoinRpcSchema = rpcSchema(); @@ -32,15 +43,71 @@ function assertIsSupportedChainId( } } +function withRpcMetrics( + transport: HttpTransport, + rpcMetricsContext: RpcMetricsContext, +): HttpTransport { + return (parameters) => { + const instance = transport(parameters); + const request: typeof instance.request = async (args, options) => { + const metrics = rpcMetricsContext.current(); + const startTime = performance.now(); + + try { + return await instance.request(args, options); + } finally { + if (metrics) { + const requestDurationMs = performance.now() - startTime; + metrics.totalCallsCount++; + metrics.totalCallsDurationMs += requestDurationMs; + metrics.averageCallDurationMs = + metrics.totalCallsDurationMs / metrics.totalCallsCount; + + const methodMetrics = (metrics.rpcCallsByMethod[args.method] ??= { + count: 0, + totalDurationMs: 0, + averageDurationMs: 0, + }); + + methodMetrics.count++; + methodMetrics.totalDurationMs += requestDurationMs; + methodMetrics.averageDurationMs = + methodMetrics.totalDurationMs / methodMetrics.count; + } + } + }; + + return { ...instance, request }; + }; +} + +function withGetLogsRetryCount( + transport: HttpTransport, + retryCount: number, +): HttpTransport { + return (parameters) => { + const instance = transport(parameters); + const request: typeof instance.request = (args, options) => { + return instance.request( + args, + args.method === 'eth_getLogs' ? { ...options, retryCount } : options, + ); + }; + + return { ...instance, request }; + }; +} + export function createClientForChainOrThrow({ chainId, rpcUrl, authToken, + rpcMetricsContext, }: GetClientForChainOptions): PoRepPublicClient { assertIsSupportedChainId(chainId); const chain = extractChain({ chains: PO_REP_SUPPORTED_CHAINS, id: chainId }); - const transport = http(rpcUrl ?? undefined, { + const httpTransport = http(rpcUrl ?? undefined, { fetchOptions: typeof authToken === 'string' && authToken !== '' ? { @@ -49,8 +116,15 @@ export function createClientForChainOrThrow({ }, } : undefined, + onFetchRequest: (request, init) => { + rpcLogger.debug({ url: request.url, body: init.body }, 'RPC request'); + }, timeout: 60_000, }); + const transport = withRpcMetrics( + withGetLogsRetryCount(httpTransport, 1), + rpcMetricsContext, + ); const client = createPublicClient({ chain: chain, diff --git a/src/po-rep-indexer/rpc-metrics-context.service.ts b/src/po-rep-indexer/rpc-metrics-context.service.ts new file mode 100644 index 0000000..b261b64 --- /dev/null +++ b/src/po-rep-indexer/rpc-metrics-context.service.ts @@ -0,0 +1,25 @@ +import { Injectable } from '@nestjs/common'; +import { AsyncLocalStorage } from 'node:async_hooks'; +import { RpcMetrics } from './po-rep-indexer.types'; + +@Injectable() +export class RpcMetricsContext { + private readonly storage = new AsyncLocalStorage(); + + public run(metrics: RpcMetrics, callback: () => Promise): Promise { + return this.storage.run(metrics, callback); + } + + public current(): RpcMetrics | undefined { + return this.storage.getStore(); + } + + public empty(): RpcMetrics { + return { + totalCallsCount: 0, + totalCallsDurationMs: 0, + averageCallDurationMs: 0, + rpcCallsByMethod: {}, + }; + } +} diff --git a/src/po-rep-indexer/runners/abstract-po-rep-indexer.runner.ts b/src/po-rep-indexer/runners/abstract-po-rep-indexer.runner.ts index 1e0445d..54584b4 100644 --- a/src/po-rep-indexer/runners/abstract-po-rep-indexer.runner.ts +++ b/src/po-rep-indexer/runners/abstract-po-rep-indexer.runner.ts @@ -19,7 +19,13 @@ import { ARCHIVE_NODE_CLIENT, RECENT_NODE_CLIENT, } from '../po-rep-indexer.constants'; -import { PoRepConfig, PoRepPublicClient } from '../po-rep-indexer.types'; +import { + IndexerBatchMetrics, + IndexerBatchResultContext, + PoRepConfig, + PoRepPublicClient, +} from '../po-rep-indexer.types'; +import { RpcMetricsContext } from '../rpc-metrics-context.service'; export type LogsForEvents = GetLogsReturnType< undefined, @@ -80,6 +86,7 @@ export abstract class AbstractPoRepIndexerRunner< @Inject(ARCHIVE_NODE_CLIENT) protected readonly archiveNodeClient: PoRepPublicClient, protected readonly dealManifestService: DealManifestService, + protected readonly rpcMetricsContext: RpcMetricsContext, ) { this.logger = new Logger(this.getName()); } @@ -141,7 +148,7 @@ export abstract class AbstractPoRepIndexerRunner< timeoutCount: number, ): Promise { try { - return await this.executeBatch(timeoutCount); + return await this.executeBatchWithMetrics(timeoutCount); } catch (error) { if (!(error instanceof TimeoutError)) { throw error; @@ -163,7 +170,56 @@ export abstract class AbstractPoRepIndexerRunner< } } - private async executeBatch(timeoutCount: number): Promise { + private async executeBatchWithMetrics( + timeoutCount: number, + ): Promise { + const rpcMetrics = this.rpcMetricsContext.empty(); + const batchMetrics: IndexerBatchMetrics = {}; + const startTime = performance.now(); + let error: unknown; + let keepRunning = false; + + try { + keepRunning = await this.rpcMetricsContext.run(rpcMetrics, () => + this.executeBatch(timeoutCount, batchMetrics), + ); + + return keepRunning; + } catch (caught) { + error = caught; + throw caught; + } finally { + const context = { + event: 'indexer.batch.result', + indexer: this.getName(), + batchStartEpoch: batchMetrics.fromBlock?.toString(), + batchEndEpoch: batchMetrics.toBlock?.toString(), + batchBlockSize: batchMetrics.batchBlockSize?.toString(), + nodeType: batchMetrics.nodeType, + timeoutCount, + error: !!error, + keepRunning, + totalDurationMs: performance.now() - startTime, + changesReadDurationMs: batchMetrics.changesReadDurationMs, + changesWriteDurationMs: batchMetrics.changesWriteDurationMs, + rpcCalls: rpcMetrics.totalCallsCount, + rpcTotalDurationMs: rpcMetrics.totalCallsDurationMs, + rpcCallAverageDurationMs: rpcMetrics.averageCallDurationMs, + rpcByMethod: rpcMetrics.rpcCallsByMethod, + } satisfies IndexerBatchResultContext; + + if (error) { + this.logger.error(context, 'Indexer batch attempt failed'); + } else { + this.logger.log(context, 'Indexer batch completed'); + } + } + } + + private async executeBatch( + timeoutCount: number, + batchMetrics: IndexerBatchMetrics, + ): Promise { const startDate = DateTime.now().toUTC(); const chainId = BigInt(this.configService.get('PO_REP_CHAIN_ID')); const runner = this.getName(); @@ -185,6 +241,7 @@ export abstract class AbstractPoRepIndexerRunner< const fromBlock = versionChanged ? this.getOriginBlock() : BigInt(lastRun.blockEnd) + 1n; + batchMetrics.fromBlock = fromBlock; // Node selection const shouldUseArchiveNode = @@ -192,6 +249,7 @@ export abstract class AbstractPoRepIndexerRunner< const selectedNode = shouldUseArchiveNode ? this.archiveNodeClient : this.recentNodeClient; + batchMetrics.nodeType = shouldUseArchiveNode ? 'archive' : 'recent'; // Block finality check const finalizedHeightMaxDifference = this.configService.get( @@ -231,17 +289,20 @@ export abstract class AbstractPoRepIndexerRunner< 1n, initialBatchBlockSize / 2n ** BigInt(timeoutCount), ); + batchMetrics.batchBlockSize = batchBlockSize; const blockDifference = maxToBlock - fromBlock; const toBlock = blockDifference >= batchBlockSize ? fromBlock + batchBlockSize - 1n : maxToBlock; + batchMetrics.toBlock = toBlock; // Logs retrieval this.logger.log( `Fetching logs in block range [${fromBlock.toString()}-${toBlock.toString()}] using ${shouldUseArchiveNode ? '"Archive Node"' : '"Recent Node"'}`, ); + const readStart = performance.now(); const logs = await selectedNode.getLogs({ address: this.getOriginAddresses(), events: this.getEventTypes(), @@ -255,7 +316,9 @@ export abstract class AbstractPoRepIndexerRunner< // DB Updates const changes = await this.getChanges(logsSorted); + batchMetrics.changesReadDurationMs = performance.now() - readStart; + const writeStart = performance.now(); await this.queryBuilder.transaction().execute(async (tx) => { if (versionChanged) { await this.cleanup(tx); @@ -276,6 +339,7 @@ export abstract class AbstractPoRepIndexerRunner< }) .execute(); }); + batchMetrics.changesWriteDurationMs = performance.now() - writeStart; // Sync exhaustion const keepRunning = recentHead !== toBlock; diff --git a/src/po-rep-indexer/runners/po-rep-providers-and-deals.runner.ts b/src/po-rep-indexer/runners/po-rep-providers-and-deals.runner.ts index cc6e7e4..656a125 100644 --- a/src/po-rep-indexer/runners/po-rep-providers-and-deals.runner.ts +++ b/src/po-rep-indexer/runners/po-rep-providers-and-deals.runner.ts @@ -188,7 +188,7 @@ export class PoRepProvidersAndDealsIndexerRunner extends AbstractPoRepIndexerRun } protected getBatchBlockSize(): bigint { - return 2n * 60n * 24n; // 1 day worth of logs + return 2n * 60n * 12n; // 12h worth of logs } protected getEventTypes() {