Skip to content

Commit f445632

Browse files
authored
Added httpMethod to usage-tracker for APIs (#510)
1 parent f795f45 commit f445632

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@thirdweb-dev/auth": "^4.1.55",
4343
"@thirdweb-dev/chains": "^0.1.77",
4444
"@thirdweb-dev/sdk": "^4.0.59",
45-
"@thirdweb-dev/service-utils": "0.4.17",
45+
"@thirdweb-dev/service-utils": "^0.4.28",
4646
"@thirdweb-dev/wallets": "^2.4.36-nightly-6961e09a4cec4c276b233285e721dc0505792be5-20240408215531",
4747
"@types/base-64": "^1.0.2",
4848
"base-64": "^1.0.0",

src/utils/usage.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ export const withServerUsageReporting = (server: FastifyInstance) => {
106106
contractAddress: requestParams.contractAddress || undefined,
107107
httpStatusCode: reply.statusCode,
108108
msTotalDuration: Math.ceil(reply.getResponseTime()),
109+
httpMethod:
110+
request.method.toUpperCase() as UsageEventSchema["httpMethod"],
109111
};
110112

111113
fetch(env.CLIENT_ANALYTICS_URL, {

yarn.lock

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3647,13 +3647,13 @@
36473647
yaml "^2.4.1"
36483648
zod "^3.22.4"
36493649

3650-
"@thirdweb-dev/service-utils@0.4.17":
3651-
version "0.4.17"
3652-
resolved "https://registry.yarnpkg.com/@thirdweb-dev/service-utils/-/service-utils-0.4.17.tgz#d73371230a40bd3053dd0f66e9f6445e5fd47356"
3653-
integrity sha512-Hfj2Ewh93AnQl7AmBIhA1sz3wSM6XfU6K+BAgff0b36QaSvLzaVleK9M7n5/6SSR2U9RUUR+FzH72ZMyhaLSOw==
3650+
"@thirdweb-dev/service-utils@^0.4.28":
3651+
version "0.4.28"
3652+
resolved "https://registry.yarnpkg.com/@thirdweb-dev/service-utils/-/service-utils-0.4.28.tgz#8ffc6ddc800a2830597dee5a517ad210dd217efb"
3653+
integrity sha512-kUHOaL5CIyX09CjdXKkiyWiFAPb9nUWHFm1UwGxhTKrAT0UgHaTe5vABauDJvy6UJfLGK0xirSzdqMOYX2nsHA==
36543654
dependencies:
3655-
aws4fetch "^1.0.17"
3656-
zod "^3.22.3"
3655+
aws4fetch "1.0.18"
3656+
zod "3.22.4"
36573657

36583658
"@thirdweb-dev/storage@2.0.13":
36593659
version "2.0.13"
@@ -5019,10 +5019,10 @@ aws-sdk@^2.922.0:
50195019
uuid "8.0.0"
50205020
xml2js "0.6.2"
50215021

5022-
aws4fetch@^1.0.17:
5023-
version "1.0.17"
5024-
resolved "https://registry.yarnpkg.com/aws4fetch/-/aws4fetch-1.0.17.tgz#0e4f7170f5a7d85ef2981c80209136606eabfada"
5025-
integrity sha512-4IbOvsxqxeOSxI4oA+8xEO8SzBMVlzbSTgGy/EF83rHnQ/aKtP6Sc6YV/k0oiW0mqrcxuThlbDosnvetGOuO+g==
5022+
aws4fetch@1.0.18:
5023+
version "1.0.18"
5024+
resolved "https://registry.yarnpkg.com/aws4fetch/-/aws4fetch-1.0.18.tgz#417079ed66383cdd5875e04e9a1ff460917f3896"
5025+
integrity sha512-3Cf+YaUl07p24MoQ46rFwulAmiyCwH2+1zw1ZyPAX5OtJ34Hh185DwB8y/qRLb6cYYYtSFJ9pthyLc0MD4e8sQ==
50265026

50275027
axios@^0.21.0:
50285028
version "0.21.4"
@@ -11979,12 +11979,12 @@ zod-to-json-schema@^3.17.1:
1197911979
resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.22.4.tgz#f8cc691f6043e9084375e85fb1f76ebafe253d70"
1198011980
integrity sha512-2Ed5dJ+n/O3cU383xSY28cuVi0BCQhF8nYqWU5paEpl7fVdqdAmiLdqLyfblbNdfOFwFfi/mqU4O1pwc60iBhQ==
1198111981

11982+
zod@3.22.4, zod@^3.22.4:
11983+
version "3.22.4"
11984+
resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.4.tgz#f31c3a9386f61b1f228af56faa9255e845cf3fff"
11985+
integrity sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==
11986+
1198211987
zod@^3.21.4:
1198311988
version "3.21.4"
1198411989
resolved "https://registry.yarnpkg.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db"
1198511990
integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==
11986-
11987-
zod@^3.22.3, zod@^3.22.4:
11988-
version "3.22.4"
11989-
resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.4.tgz#f31c3a9386f61b1f228af56faa9255e845cf3fff"
11990-
integrity sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==

0 commit comments

Comments
 (0)