thirdweb-dev / engine

The most powerful backend engine for web3 apps.
https://thirdweb.com/engine
Apache License 2.0
152 stars 59 forks source link

feat: Add webhooks to contract subscriptions Redis workers #521

Closed arcoraven closed 5 months ago

arcoraven commented 6 months ago

NOTE: This relies on a minor version bump dev branch of Prisma that adds createManyAndReturn in order to retrieve inserted rows. This is newly added feature (< 1 week): https://github.com/prisma/prisma/pull/24064#issuecomment-2093331715


PR-Codex overview

This PR updates webhooks functionality, adds Redis integration, and refactors schemas and database operations.

Detailed summary

The following files were skipped due to too many changes: src/server/schemas/sharedApiSchemas.ts, src/db/contractSubscriptions/getContractSubscriptions.ts, src/server/routes/webhooks/revoke.ts, src/server/schemas/contractSubscription.ts, src/server/routes/webhooks/getAll.ts, src/server/routes/system/health.ts, src/db/contractEventLogs/createContractEventLogs.ts, src/utils/cache/getWebhook.ts, src/worker/queues/queues.ts, src/server/schemas/eventLog.ts, src/db/contractTransactionReceipts/createContractTransactionReceipts.ts, src/server/middleware/auth.ts, src/worker/queues/processEventLogsQueue.ts, src/server/schemas/transactionReceipt.ts, src/server/routes/configuration/events/get.ts, src/worker/queues/processTransactionReceiptsQueue.ts, src/server/routes/index.ts, src/worker/tasks/sendWebhookWorker.ts, src/server/routes/contract/transactions/paginateTransactionReceipts.ts, src/server/routes/contract/subscriptions/getLatestBlock.ts, src/prisma/schema.prisma, src/server/routes/contract/events/paginateEventLogs.ts, src/server/routes/contract/subscriptions/getContractSubscriptions.ts, src/server/routes/webhooks/create.ts, src/server/routes/configuration/contract-subscriptions/update.ts, src/worker/queues/sendWebhookQueue.ts, src/server/routes/contract/subscriptions/removeContractSubscription.ts, src/utils/webhook.ts, src/worker/tasks/processTransactionReceiptsWorker.ts, src/server/routes/contract/subscriptions/addContractSubscription.ts, src/worker/tasks/processEventLogsWorker.ts, src/worker/tasks/chainIndexer.ts, yarn.lock

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

zeet-co[bot] commented 6 months ago

We're building your pull request over on Zeet. Click me for more info about your build and deployment. Once built, this branch can be tested at: https://web3-api-akbv-ph-contractsubwebho-d434fc.chainsaw-dev.zeet.app before merging :wink:

socket-security[bot] commented 5 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@prisma/client@5.14.0-dev.65 environment, filesystem, shell 0 9 MB prismabot
npm/bullmq@5.7.8 environment, filesystem, network, shell Transitive: eval, unsafe +10 4.05 MB manast
npm/ioredis@5.4.1 network +7 859 kB ioredis-robot
npm/prisma@5.14.0-dev.61 environment Transitive: eval, filesystem, network, shell +5 13 MB prismabot
npm/redis-errors@1.2.0 None 0 8.85 kB bridgear
npm/superjson@2.2.1 None +2 147 kB skn0tt
npm/thirdweb@5.18.1 Transitive: environment, eval, filesystem, network, shell, unsafe +268 128 MB

🚮 Removed packages: npm/@prisma/client@5.2.0, npm/prisma@5.2.0, npm/thirdweb@5.1.0

View full report↗︎