-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add NestJS adapter #1776
feat: Add NestJS adapter #1776
Conversation
😎 Merged successfully - details. |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@nestjs/common@10.4.2, npm/@nestjs/core@10.4.2, npm/@nestjs/platform-express@10.4.2, npm/@nestjs/testing@10.4.2, npm/@types/jest@29.5.13, npm/@types/supertest@6.0.2, npm/nest-js@0.0.1, npm/supertest@7.0.0, npm/ts-jest@29.2.5, npm/ts-loader@9.5.1, npm/ts-node@10.9.2 |
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring: Next stepsTake a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with |
examples/nestjs-fastify/src/sensitive-info/sensitive-info.controller.ts
Dismissed
Show dismissed
Hide dismissed
examples/nestjs-fastify/src/validate-email/validate-email.controller.ts
Dismissed
Show dismissed
Hide dismissed
examples/nestjs/src/sensitive-info/sensitive-info.controller.ts
Dismissed
Show dismissed
Hide dismissed
examples/nestjs/src/validate-email/validate-email.controller.ts
Dismissed
Show dismissed
Hide dismissed
All fastify packages. |
We should consider using https://docs.nestjs.com/fundamentals/execution-context#current-application-context to make sure we're in an http context but let's wait for user feedback. |
I've added an example that uses LaunchDarkly to configure the rules at NestJS application startup. This demonstrates that the ArcjetModule can be configured via async logic by using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see these examples!
Co-authored-by: David Mytton <david@arcjet.com>
…ed/nestjs-adapter
Automatically generated with [Release Please](https://github.com/googleapis/release-please). --- <details><summary>@arcjet/analyze: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/analyze-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **analyze:** Update well known bots ([#1784](#1784)) ([52f1ee3](52f1ee3)) * Update WebAssembly modules ([#1721](#1721)) ([2dbb9eb](2dbb9eb)) ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/protocol bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/body: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/body-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/body:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/bun: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/bun-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/bun:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/env bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/headers bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/ip bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/logger bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/protocol bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/transport bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * arcjet bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/decorate: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/decorate-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/decorate:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/protocol bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/sprintf bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/deno: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/deno-v1.0.0-alpha.27) (2024-10-01) ### 🚀 New Features * Add Deno adapter ([#1782](#1782)) ([fdfcaf3](fdfcaf3)), closes [#758](#758) ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/env bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/headers bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/ip bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/logger bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/protocol bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/transport bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * arcjet bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/duration: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/duration-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/duration:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/env: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/env-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/env:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/eslint-config: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/eslint-config-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/eslint-config:** Synchronize arcjet-js versions </details> <details><summary>@arcjet/headers: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/headers-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/headers:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/ip: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/ip-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/ip:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/logger: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/logger-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/logger:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/sprintf bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/nest: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/nest-v1.0.0-alpha.27) (2024-10-01) ### 🚀 New Features * Add NestJS adapter ([#1776](#1776)) ([4e52453](4e52453)), closes [#781](#781) ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/env bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/headers bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/ip bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/logger bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/protocol bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/transport bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/body bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * arcjet bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/next: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/next-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/next:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/env bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/headers bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/ip bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/logger bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/protocol bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/transport bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * arcjet bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/node: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/node-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/node:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/env bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/headers bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/ip bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/logger bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/protocol bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/transport bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/body bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * arcjet bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/protocol: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/protocol-v1.0.0-alpha.27) (2024-10-01) ### 🚀 New Features * Add Deno adapter ([#1782](#1782)) ([fdfcaf3](fdfcaf3)), closes [#758](#758) * Add NestJS adapter ([#1776](#1776)) ([4e52453](4e52453)), closes [#781](#781) ### 🪲 Bug Fixes * **protocol:** Ensure relative imports have extensions ([#1722](#1722)) ([73928c8](73928c8)), closes [#1720](#1720) ### 🧹 Miscellaneous Chores * **analyze:** Update well known bots ([#1784](#1784)) ([52f1ee3](52f1ee3)) ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/redact: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/redact-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/redact:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/redact-wasm bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/redact-wasm: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/redact-wasm-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * Update WebAssembly modules ([#1721](#1721)) ([2dbb9eb](2dbb9eb)) ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/rollup-config: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/rollup-config-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/rollup-config:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/runtime: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/runtime-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/runtime:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/sprintf: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/sprintf-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/sprintf:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/sveltekit: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/sveltekit-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/sveltekit:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/env bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/headers bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/ip bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/logger bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/protocol bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/transport bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * arcjet bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/transport: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/transport-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/transport:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>@arcjet/tsconfig: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.26...@arcjet/tsconfig-v1.0.0-alpha.27) (2024-10-01) ### 🧹 Miscellaneous Chores * **@arcjet/tsconfig:** Synchronize arcjet-js versions </details> <details><summary>arcjet: 1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](v1.0.0-alpha.26...arcjet-v1.0.0-alpha.27) (2024-10-01) ### ⚠ BREAKING CHANGES * Add options validation for all rules ([#1785](#1785)) * Only produce 1 rule per constructor ([#1783](#1783)) ### 🧹 Miscellaneous Chores * Add options validation for all rules ([#1785](#1785)) ([c3a248e](c3a248e)), closes [#992](#992) * Only produce 1 rule per constructor ([#1783](#1783)) ([8d79e63](8d79e63)), closes [#1397](#1397) ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/analyze bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/duration bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/headers bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/protocol bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/runtime bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/rollup-config bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 * @arcjet/tsconfig bumped from 1.0.0-alpha.26 to 1.0.0-alpha.27 </details> <details><summary>1.0.0-alpha.27</summary> ## [1.0.0-alpha.27](v1.0.0-alpha.26...v1.0.0-alpha.27) (2024-10-01) ### ⚠ BREAKING CHANGES * Add options validation for all rules ([#1785](#1785)) * Only produce 1 rule per constructor ([#1783](#1783)) ### 🚀 New Features * Add Deno adapter ([#1782](#1782)) ([fdfcaf3](fdfcaf3)), closes [#758](#758) * Add NestJS adapter ([#1776](#1776)) ([4e52453](4e52453)), closes [#781](#781) ### 🪲 Bug Fixes * **protocol:** Ensure relative imports have extensions ([#1722](#1722)) ([73928c8](73928c8)), closes [#1720](#1720) ### 🧹 Miscellaneous Chores * Add options validation for all rules ([#1785](#1785)) ([c3a248e](c3a248e)), closes [#992](#992) * **analyze:** Update well known bots ([#1784](#1784)) ([52f1ee3](52f1ee3)) * Only produce 1 rule per constructor ([#1783](#1783)) ([8d79e63](8d79e63)), closes [#1397](#1397) * Update WebAssembly modules ([#1721](#1721)) ([2dbb9eb](2dbb9eb)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This adds a NestJS adapter to our SDK. It is definitely just a first implementation while we wait for feedback from users.
NestJS is a very different framework than adapters for previous frameworks, but I tried to make it feel natural for users of NestJS. This includes the
ArcjetModule
export which they can import into their@Module
decorators, theArcjetGuard
export which can be used with@UseGuards(ArcjetGuard)
, and the@WithArcjetRules
decorator which can provide additional rules to the ArcjetGuard that is run before the handler.Unlike previous adapters, the design of NestJS doesn't allow us to leverage our type inference to help guide users, so we rely more heavily on runtime errors if things are misconfigured, such as trying to use a
validateEmail
rule withArcjetGuard
.One benefit of the adapter is that we support NestJS on top of both Express and Fastify!
I've revamped the NestJS example to highlight various ways the adapter can be used and even created a NestJS + Fastify example to ensure we work with both.
Closes #781