Unkey and Drizzle improvements
This commit is contained in:
parent
e7f8791814
commit
d5819d8f0d
7 changed files with 56 additions and 64 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "sprintpadawan",
|
"name": "sprintpadawan",
|
||||||
"version": "2.0.3",
|
"version": "2.0.4",
|
||||||
"description": "Plan. Sprint. Repeat.",
|
"description": "Plan. Sprint. Repeat.",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -23,13 +23,13 @@
|
||||||
"@trpc/next": "10.37.1",
|
"@trpc/next": "10.37.1",
|
||||||
"@trpc/react-query": "10.37.1",
|
"@trpc/react-query": "10.37.1",
|
||||||
"@trpc/server": "10.37.1",
|
"@trpc/server": "10.37.1",
|
||||||
"@unkey/api": "^0.6.14",
|
"@unkey/api": "^0.6.16",
|
||||||
"@upstash/ratelimit": "^0.4.3",
|
"@upstash/ratelimit": "^0.4.3",
|
||||||
"@upstash/redis": "^1.22.0",
|
"@upstash/redis": "^1.22.0",
|
||||||
"ably": "^1.2.43",
|
"ably": "^1.2.43",
|
||||||
"autoprefixer": "^10.4.15",
|
"autoprefixer": "^10.4.15",
|
||||||
"dotenv": "^16.3.1",
|
"dotenv": "^16.3.1",
|
||||||
"drizzle-orm": "^0.28.3",
|
"drizzle-orm": "^0.28.4",
|
||||||
"json2csv": "6.0.0-alpha.2",
|
"json2csv": "6.0.0-alpha.2",
|
||||||
"next": "^13.4.19",
|
"next": "^13.4.19",
|
||||||
"nextjs-cors": "^2.1.2",
|
"nextjs-cors": "^2.1.2",
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/eslint": "^8.44.2",
|
"@types/eslint": "^8.44.2",
|
||||||
"@types/json2csv": "^5.0.3",
|
"@types/json2csv": "^5.0.3",
|
||||||
"@types/node": "^20.5.3",
|
"@types/node": "^20.5.4",
|
||||||
"@types/react": "^18.2.21",
|
"@types/react": "^18.2.21",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.4.1",
|
"@typescript-eslint/eslint-plugin": "^6.4.1",
|
||||||
"@typescript-eslint/parser": "^6.4.1",
|
"@typescript-eslint/parser": "^6.4.1",
|
||||||
|
|
68
pnpm-lock.yaml
generated
68
pnpm-lock.yaml
generated
|
@ -36,8 +36,8 @@ dependencies:
|
||||||
specifier: 10.37.1
|
specifier: 10.37.1
|
||||||
version: 10.37.1
|
version: 10.37.1
|
||||||
'@unkey/api':
|
'@unkey/api':
|
||||||
specifier: ^0.6.14
|
specifier: ^0.6.16
|
||||||
version: 0.6.14
|
version: 0.6.16
|
||||||
'@upstash/ratelimit':
|
'@upstash/ratelimit':
|
||||||
specifier: ^0.4.3
|
specifier: ^0.4.3
|
||||||
version: 0.4.3
|
version: 0.4.3
|
||||||
|
@ -54,8 +54,8 @@ dependencies:
|
||||||
specifier: ^16.3.1
|
specifier: ^16.3.1
|
||||||
version: 16.3.1
|
version: 16.3.1
|
||||||
drizzle-orm:
|
drizzle-orm:
|
||||||
specifier: ^0.28.3
|
specifier: ^0.28.4
|
||||||
version: 0.28.3(@neondatabase/serverless@0.6.0)(pg@8.11.3)
|
version: 0.28.4(@neondatabase/serverless@0.6.0)(pg@8.11.3)
|
||||||
json2csv:
|
json2csv:
|
||||||
specifier: 6.0.0-alpha.2
|
specifier: 6.0.0-alpha.2
|
||||||
version: 6.0.0-alpha.2
|
version: 6.0.0-alpha.2
|
||||||
|
@ -101,8 +101,8 @@ devDependencies:
|
||||||
specifier: ^5.0.3
|
specifier: ^5.0.3
|
||||||
version: 5.0.3
|
version: 5.0.3
|
||||||
'@types/node':
|
'@types/node':
|
||||||
specifier: ^20.5.3
|
specifier: ^20.5.4
|
||||||
version: 20.5.3
|
version: 20.5.4
|
||||||
'@types/react':
|
'@types/react':
|
||||||
specifier: ^18.2.21
|
specifier: ^18.2.21
|
||||||
version: 18.2.21
|
version: 18.2.21
|
||||||
|
@ -1095,8 +1095,8 @@ packages:
|
||||||
dev: false
|
dev: false
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@noble/hashes@1.3.1:
|
/@noble/hashes@1.3.2:
|
||||||
resolution: {integrity: sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==}
|
resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==}
|
||||||
engines: {node: '>= 16'}
|
engines: {node: '>= 16'}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
@ -1208,7 +1208,7 @@ packages:
|
||||||
'@octokit/request-error': 3.0.3
|
'@octokit/request-error': 3.0.3
|
||||||
'@octokit/types': 9.3.2
|
'@octokit/types': 9.3.2
|
||||||
is-plain-object: 5.0.0
|
is-plain-object: 5.0.0
|
||||||
node-fetch: 2.6.13
|
node-fetch: 2.7.0
|
||||||
universal-user-agent: 6.0.0
|
universal-user-agent: 6.0.0
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- encoding
|
- encoding
|
||||||
|
@ -1249,7 +1249,7 @@ packages:
|
||||||
/@paralleldrive/cuid2@2.2.2:
|
/@paralleldrive/cuid2@2.2.2:
|
||||||
resolution: {integrity: sha512-ZOBkgDwEdoYVlSeRbYYXs0S9MejQofiVYoTbKzy/6GQa39/q5tQU2IX46+shYnUkpEl3wc+J6wRlar7r2EK2xA==}
|
resolution: {integrity: sha512-ZOBkgDwEdoYVlSeRbYYXs0S9MejQofiVYoTbKzy/6GQa39/q5tQU2IX46+shYnUkpEl3wc+J6wRlar7r2EK2xA==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@noble/hashes': 1.3.1
|
'@noble/hashes': 1.3.2
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@peculiar/asn1-schema@2.3.6:
|
/@peculiar/asn1-schema@2.3.6:
|
||||||
|
@ -1563,7 +1563,7 @@ packages:
|
||||||
resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==}
|
resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/connect': 3.4.35
|
'@types/connect': 3.4.35
|
||||||
'@types/node': 20.5.3
|
'@types/node': 20.5.4
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@types/cacheable-request@6.0.3:
|
/@types/cacheable-request@6.0.3:
|
||||||
|
@ -1571,14 +1571,14 @@ packages:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/http-cache-semantics': 4.0.1
|
'@types/http-cache-semantics': 4.0.1
|
||||||
'@types/keyv': 3.1.4
|
'@types/keyv': 3.1.4
|
||||||
'@types/node': 20.5.3
|
'@types/node': 20.5.4
|
||||||
'@types/responselike': 1.0.0
|
'@types/responselike': 1.0.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@types/connect@3.4.35:
|
/@types/connect@3.4.35:
|
||||||
resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==}
|
resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 20.5.3
|
'@types/node': 20.5.4
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@types/cookies@0.7.7:
|
/@types/cookies@0.7.7:
|
||||||
|
@ -1587,7 +1587,7 @@ packages:
|
||||||
'@types/connect': 3.4.35
|
'@types/connect': 3.4.35
|
||||||
'@types/express': 4.17.14
|
'@types/express': 4.17.14
|
||||||
'@types/keygrip': 1.0.2
|
'@types/keygrip': 1.0.2
|
||||||
'@types/node': 20.5.3
|
'@types/node': 20.5.4
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@types/eslint@8.44.2:
|
/@types/eslint@8.44.2:
|
||||||
|
@ -1604,7 +1604,7 @@ packages:
|
||||||
/@types/express-serve-static-core@4.17.36:
|
/@types/express-serve-static-core@4.17.36:
|
||||||
resolution: {integrity: sha512-zbivROJ0ZqLAtMzgzIUC4oNqDG9iF0lSsAqpOD9kbs5xcIM3dTiyuHvBc7R8MtWBp3AAWGaovJa+wzWPjLYW7Q==}
|
resolution: {integrity: sha512-zbivROJ0ZqLAtMzgzIUC4oNqDG9iF0lSsAqpOD9kbs5xcIM3dTiyuHvBc7R8MtWBp3AAWGaovJa+wzWPjLYW7Q==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 20.5.3
|
'@types/node': 20.5.4
|
||||||
'@types/qs': 6.9.7
|
'@types/qs': 6.9.7
|
||||||
'@types/range-parser': 1.2.4
|
'@types/range-parser': 1.2.4
|
||||||
'@types/send': 0.17.1
|
'@types/send': 0.17.1
|
||||||
|
@ -1634,7 +1634,7 @@ packages:
|
||||||
/@types/json2csv@5.0.3:
|
/@types/json2csv@5.0.3:
|
||||||
resolution: {integrity: sha512-ZJEv6SzhPhgpBpxZU4n/TZekbZqI4EcyXXRwms1lAITG2kIAtj85PfNYafUOY1zy8bWs5ujaub0GU4copaA0sw==}
|
resolution: {integrity: sha512-ZJEv6SzhPhgpBpxZU4n/TZekbZqI4EcyXXRwms1lAITG2kIAtj85PfNYafUOY1zy8bWs5ujaub0GU4copaA0sw==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 20.5.3
|
'@types/node': 20.5.4
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/json5@0.0.29:
|
/@types/json5@0.0.29:
|
||||||
|
@ -1648,7 +1648,7 @@ packages:
|
||||||
/@types/keyv@3.1.4:
|
/@types/keyv@3.1.4:
|
||||||
resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==}
|
resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 20.5.3
|
'@types/node': 20.5.4
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@types/mime@1.3.2:
|
/@types/mime@1.3.2:
|
||||||
|
@ -1662,7 +1662,7 @@ packages:
|
||||||
/@types/node-fetch@2.6.2:
|
/@types/node-fetch@2.6.2:
|
||||||
resolution: {integrity: sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==}
|
resolution: {integrity: sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 20.5.3
|
'@types/node': 20.5.4
|
||||||
form-data: 3.0.1
|
form-data: 3.0.1
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
@ -1674,8 +1674,8 @@ packages:
|
||||||
resolution: {integrity: sha512-vmYJF0REqDyyU0gviezF/KHq/fYaUbFhkcNbQCuPGFQj6VTbXuHZoxs/Y7mutWe73C8AC6l9fFu8mSYiBAqkGA==}
|
resolution: {integrity: sha512-vmYJF0REqDyyU0gviezF/KHq/fYaUbFhkcNbQCuPGFQj6VTbXuHZoxs/Y7mutWe73C8AC6l9fFu8mSYiBAqkGA==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@types/node@20.5.3:
|
/@types/node@20.5.4:
|
||||||
resolution: {integrity: sha512-ITI7rbWczR8a/S6qjAW7DMqxqFMjjTo61qZVWJ1ubPvbIQsL5D/TvwjYEalM8Kthpe3hTzOGrF2TGbAu2uyqeA==}
|
resolution: {integrity: sha512-Y9vbIAoM31djQZrPYjpTLo0XlaSwOIsrlfE3LpulZeRblttsLQRFRlBAppW0LOxyT3ALj2M5vU1ucQQayQH3jA==}
|
||||||
|
|
||||||
/@types/normalize-package-data@2.4.1:
|
/@types/normalize-package-data@2.4.1:
|
||||||
resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==}
|
resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==}
|
||||||
|
@ -1684,7 +1684,7 @@ packages:
|
||||||
/@types/pg@8.6.6:
|
/@types/pg@8.6.6:
|
||||||
resolution: {integrity: sha512-O2xNmXebtwVekJDD+02udOncjVcMZQuTEQEMpKJ0ZRf5E7/9JJX3izhKUcUifBkyKpljyUM6BTgy2trmviKlpw==}
|
resolution: {integrity: sha512-O2xNmXebtwVekJDD+02udOncjVcMZQuTEQEMpKJ0ZRf5E7/9JJX3izhKUcUifBkyKpljyUM6BTgy2trmviKlpw==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 20.5.3
|
'@types/node': 20.5.4
|
||||||
pg-protocol: 1.6.0
|
pg-protocol: 1.6.0
|
||||||
pg-types: 2.2.0
|
pg-types: 2.2.0
|
||||||
dev: false
|
dev: false
|
||||||
|
@ -1712,7 +1712,7 @@ packages:
|
||||||
/@types/responselike@1.0.0:
|
/@types/responselike@1.0.0:
|
||||||
resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==}
|
resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 20.5.3
|
'@types/node': 20.5.4
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@types/scheduler@0.16.3:
|
/@types/scheduler@0.16.3:
|
||||||
|
@ -1727,7 +1727,7 @@ packages:
|
||||||
resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==}
|
resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/mime': 1.3.2
|
'@types/mime': 1.3.2
|
||||||
'@types/node': 20.5.3
|
'@types/node': 20.5.4
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@types/serve-static@1.15.2:
|
/@types/serve-static@1.15.2:
|
||||||
|
@ -1735,7 +1735,7 @@ packages:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/http-errors': 2.0.1
|
'@types/http-errors': 2.0.1
|
||||||
'@types/mime': 3.0.1
|
'@types/mime': 3.0.1
|
||||||
'@types/node': 20.5.3
|
'@types/node': 20.5.4
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@typescript-eslint/eslint-plugin@6.4.1(@typescript-eslint/parser@6.4.1)(eslint@8.47.0)(typescript@5.1.6):
|
/@typescript-eslint/eslint-plugin@6.4.1(@typescript-eslint/parser@6.4.1)(eslint@8.47.0)(typescript@5.1.6):
|
||||||
|
@ -1869,8 +1869,8 @@ packages:
|
||||||
eslint-visitor-keys: 3.4.3
|
eslint-visitor-keys: 3.4.3
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@unkey/api@0.6.14:
|
/@unkey/api@0.6.16:
|
||||||
resolution: {integrity: sha512-d2tssSRf4Y4kCF44mloFcqphBenfWN5G2D1Iyz8EMmAoNi+ytvmHmmc1zZf4k3GhK68xLDA7uEO/b/1vtgD5qg==}
|
resolution: {integrity: sha512-NaJDb9t5YwM9K/yaelMlrdIOuPbiUEkIbEoBGp4WidkHhagMpVWg1eAtWpuSHe3QWjd4+LzMLpnNjS4he6jYow==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@upstash/core-analytics@0.0.6:
|
/@upstash/core-analytics@0.0.6:
|
||||||
|
@ -2215,7 +2215,7 @@ packages:
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dependencies:
|
dependencies:
|
||||||
caniuse-lite: 1.0.30001522
|
caniuse-lite: 1.0.30001522
|
||||||
electron-to-chromium: 1.4.499
|
electron-to-chromium: 1.4.500
|
||||||
node-releases: 2.0.13
|
node-releases: 2.0.13
|
||||||
update-browserslist-db: 1.0.11(browserslist@4.21.10)
|
update-browserslist-db: 1.0.11(browserslist@4.21.10)
|
||||||
dev: false
|
dev: false
|
||||||
|
@ -2768,8 +2768,8 @@ packages:
|
||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/drizzle-orm@0.28.3(@neondatabase/serverless@0.6.0)(pg@8.11.3):
|
/drizzle-orm@0.28.4(@neondatabase/serverless@0.6.0)(pg@8.11.3):
|
||||||
resolution: {integrity: sha512-7LwNEBJH5EFvkD0vm7RdKWDZsFP9CYR4AWN2fMwns/ezexoX3+UNoVOWGRPJf1qsj357SESldrNEueFvUDfZxA==}
|
resolution: {integrity: sha512-BEATAB0g0Y8PKbJHkHLLENlX2DXktO5XyeNyrXB6ktcNkg3dlMfePwB3LodBJkPY6d7GixFF+jvtdZsWjakJBQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@aws-sdk/client-rds-data': '>=3'
|
'@aws-sdk/client-rds-data': '>=3'
|
||||||
'@cloudflare/workers-types': '>=3'
|
'@cloudflare/workers-types': '>=3'
|
||||||
|
@ -2851,8 +2851,8 @@ packages:
|
||||||
semver: 7.5.4
|
semver: 7.5.4
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/electron-to-chromium@1.4.499:
|
/electron-to-chromium@1.4.500:
|
||||||
resolution: {integrity: sha512-0NmjlYBLKVHva4GABWAaHuPJolnDuL0AhV3h1hES6rcLCWEIbRL6/8TghfsVwkx6TEroQVdliX7+aLysUpKvjw==}
|
resolution: {integrity: sha512-P38NO8eOuWOKY1sQk5yE0crNtrjgjJj6r3NrbIKtG18KzCHmHE2Bt+aQA7/y0w3uYsHWxDa6icOohzjLJ4vJ4A==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/emoji-regex@9.2.2:
|
/emoji-regex@9.2.2:
|
||||||
|
@ -4166,7 +4166,7 @@ packages:
|
||||||
/isomorphic-fetch@3.0.0:
|
/isomorphic-fetch@3.0.0:
|
||||||
resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==}
|
resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==}
|
||||||
dependencies:
|
dependencies:
|
||||||
node-fetch: 2.6.13
|
node-fetch: 2.7.0
|
||||||
whatwg-fetch: 3.6.17
|
whatwg-fetch: 3.6.17
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- encoding
|
- encoding
|
||||||
|
@ -4615,8 +4615,8 @@ packages:
|
||||||
whatwg-url: 5.0.0
|
whatwg-url: 5.0.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/node-fetch@2.6.13:
|
/node-fetch@2.7.0:
|
||||||
resolution: {integrity: sha512-StxNAxh15zr77QvvkmveSQ8uCQ4+v5FkvNTj0OESmiHu+VRi/gXArXtkWMElOsOUNLtUEvI4yS+rdtOHZTwlQA==}
|
resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
|
||||||
engines: {node: 4.x || >=6.0.0}
|
engines: {node: 4.x || >=6.0.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
encoding: ^0.1.0
|
encoding: ^0.1.0
|
||||||
|
|
|
@ -24,8 +24,8 @@ export default async function handler(req: NextRequest) {
|
||||||
case WebhookEvents.USER_CREATED:
|
case WebhookEvents.USER_CREATED:
|
||||||
success = await onUserCreatedHandler(
|
success = await onUserCreatedHandler(
|
||||||
data.id,
|
data.id,
|
||||||
`${data.first_name} ${data.last_name}`,
|
data.email_addresses?.map((email) => email.email_address) || [],
|
||||||
data.email_addresses?.map((email) => email.email_address) || []
|
`${data.first_name} ${data.last_name}`
|
||||||
);
|
);
|
||||||
if (success) {
|
if (success) {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
|
|
|
@ -1,31 +1,24 @@
|
||||||
import { Unkey } from "@unkey/api";
|
// import { Unkey, verifyKey } from "@unkey/api";
|
||||||
|
import { verifyKey } from "@unkey/api";
|
||||||
import type { NextRequest } from "next/server";
|
import type { NextRequest } from "next/server";
|
||||||
import { env } from "~/env.mjs";
|
// import { env } from "~/env.mjs";
|
||||||
|
|
||||||
export const unkey = new Unkey({ token: env.UNKEY_ROOT_KEY });
|
// const unkey = new Unkey({token: env.UNKEY_ROOT_KEY})
|
||||||
|
|
||||||
export const validateApiKey = async (key: string) => {
|
|
||||||
try {
|
|
||||||
const res = await unkey.keys.verify({
|
|
||||||
key,
|
|
||||||
});
|
|
||||||
return res.result?.valid || false;
|
|
||||||
} catch {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const validateRequest = async (req: NextRequest) => {
|
export const validateRequest = async (req: NextRequest) => {
|
||||||
let isValidKey: boolean = false;
|
|
||||||
|
|
||||||
const authorization = req.headers.get("authorization");
|
const authorization = req.headers.get("authorization");
|
||||||
// Get the auth bearer token if it exists
|
// Get the auth bearer token if it exists
|
||||||
if (authorization) {
|
if (authorization) {
|
||||||
const key = authorization.split("Bearer ").at(1);
|
const key = authorization.split("Bearer ").at(1);
|
||||||
if (key) {
|
if (key) {
|
||||||
isValidKey = await validateApiKey(key);
|
const { error, result } = await verifyKey(key);
|
||||||
|
|
||||||
|
if (!error) {
|
||||||
|
console.log(result);
|
||||||
|
return result.valid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return isValidKey;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,8 +19,8 @@ export const onUserDeletedHandler = async (userId: string) => {
|
||||||
|
|
||||||
export const onUserCreatedHandler = async (
|
export const onUserCreatedHandler = async (
|
||||||
userId: string,
|
userId: string,
|
||||||
userName: string,
|
userEmails: string[],
|
||||||
userEmails: string[]
|
userName?: string
|
||||||
) => {
|
) => {
|
||||||
const userUpdateResponse = await fetch(
|
const userUpdateResponse = await fetch(
|
||||||
`https://api.clerk.com/v1/users/${userId}/metadata`,
|
`https://api.clerk.com/v1/users/${userId}/metadata`,
|
||||||
|
@ -47,7 +47,7 @@ export const onUserCreatedHandler = async (
|
||||||
from: "no-reply@sprintpadawan.dev",
|
from: "no-reply@sprintpadawan.dev",
|
||||||
to: userEmail,
|
to: userEmail,
|
||||||
subject: "🎉 Welcome to Sprint Padawan! 🎉",
|
subject: "🎉 Welcome to Sprint Padawan! 🎉",
|
||||||
react: Welcome({ name: userName }),
|
react: Welcome({ name: userName ? userEmail : userEmail }),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,8 @@ export const WebhookEventBodySchema = z.object({
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.optional(),
|
.optional(),
|
||||||
first_name: z.string().optional(),
|
first_name: z.string().nullable().optional(),
|
||||||
last_name: z.string().optional(),
|
last_name: z.string().nullable().optional(),
|
||||||
}),
|
}),
|
||||||
type: z.string(),
|
type: z.string(),
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"strictFunctionTypes": false,
|
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
|
|
Loading…
Add table
Reference in a new issue