{"_id":"@ambiten/adapter-nestjs","_rev":"3-bfd813577e6137ff762a3713a12e0577","name":"@ambiten/adapter-nestjs","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@ambiten/adapter-nestjs","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"@ambiten/adapter-nestjs@1.0.0","maintainers":[{"name":"abimongo","email":"padave805@gmail.com"}],"homepage":"https://ambiten.dev","bugs":{"url":"https://github.com/AmbitenHQ/ambiten/issues"},"dist":{"shasum":"17044b9e29184701fb75b850c2ad89fc39afbdfe","tarball":"https://registry.npmjs.org/@ambiten/adapter-nestjs/-/adapter-nestjs-1.0.0.tgz","fileCount":23,"integrity":"sha512-LIHBH2S6Ncgz09epGFTce+8X9su1pzh/uzEjrg6Fhf4A/kWlCJscAXqpSoVFLvlAKAq9pG+xRCw/la0RBH2FLA==","signatures":[{"sig":"MEUCIQDfISNvlOrt8cEgjvw9OIJJr3XOEUa54yKDj0LL1/jEXQIgYxiyb4YhQQkKg3Z5X3uNELsx9P4E5l3jEYlbqwWJbDY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19164},"main":"./dist/index.js","_from":"file:ambiten-adapter-nestjs-1.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.11.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"scripts":{"test":"jest --detectOpenHandles --coverage","build":"pnpm -r run build:nestjs","clean":"rimraf dist","release":"pnpm changeset version","changeset":"pnpm run changeset","build:nestjs":"tsc -p tsconfig.json"},"_npmUser":{"name":"abimongo","email":"padave805@gmail.com"},"_resolved":"/tmp/8c3e0454f47b5e088c0382bc795fe851/ambiten-adapter-nestjs-1.0.0.tgz","_integrity":"sha512-LIHBH2S6Ncgz09epGFTce+8X9su1pzh/uzEjrg6Fhf4A/kWlCJscAXqpSoVFLvlAKAq9pG+xRCw/la0RBH2FLA==","repository":{"url":"git+https://github.com/AmbitenHQ/ambiten.git","type":"git","directory":"packages/adapter-nestjs"},"_npmVersion":"11.17.0","description":"Ambiten Nestjs adapter","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"@ambiten/adapter-types":"1.0.0","@ambiten/adapter-runtime":"1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.9","typescript":"^5.9.3","@types/jest":"^29.5.14","@testing-library/jest-dom":"^6.9.1"},"peerDependencies":{"rxjs":"^7.8.0","@nestjs/core":"^10.0.0 || ^11.0.0","@nestjs/common":"^10.0.0 || ^11.0.0"},"_npmOperationalInternal":{"tmp":"tmp/adapter-nestjs_1.0.0_1781347258170_0.7291445530807967","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@ambiten/adapter-nestjs","version":"1.0.1","keywords":[],"author":"","license":"ISC","_id":"@ambiten/adapter-nestjs@1.0.1","maintainers":[{"name":"abimongo","email":"padave805@gmail.com"}],"homepage":"https://docs.ambiten.dev","bugs":{"url":"https://github.com/AmbitenHQ/ambiten/issues"},"dist":{"shasum":"a4aeb49d673d352e3aeef1ed6a9652040db76cf9","tarball":"https://registry.npmjs.org/@ambiten/adapter-nestjs/-/adapter-nestjs-1.0.1.tgz","fileCount":23,"integrity":"sha512-4inF3N6CLt3U60X8bvPaQcghzWsl6vqC3eYodNgtFD+6Aq+lboZEtvdF9cAk/GXIVKnKyQZXTcjSYYd6WnhMuA==","signatures":[{"sig":"MEYCIQCLtbXK5uBTTh4O8eersNV1NFYRgjvGtlAWyHjzyNa8bQIhAKXfhSHmyCpbncNrQ1TFpxvv60N/XxhvL4D+bacdJ82h","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19176},"main":"./dist/index.js","_from":"file:ambiten-adapter-nestjs-1.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.11.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"scripts":{"test":"jest --detectOpenHandles --coverage","build":"pnpm -r run build:nestjs","clean":"rimraf dist","release":"pnpm changeset version","changeset":"pnpm run changeset","build:nestjs":"tsc -p tsconfig.json"},"_npmUser":{"name":"abimongo","email":"padave805@gmail.com"},"_resolved":"/tmp/a5257fd8a65b314ae7b91af2717a3054/ambiten-adapter-nestjs-1.0.1.tgz","_integrity":"sha512-4inF3N6CLt3U60X8bvPaQcghzWsl6vqC3eYodNgtFD+6Aq+lboZEtvdF9cAk/GXIVKnKyQZXTcjSYYd6WnhMuA==","repository":{"url":"git+https://github.com/AmbitenHQ/ambiten.git","type":"git","directory":"packages/adapter-nestjs"},"_npmVersion":"12.0.2","description":"Ambiten Nestjs adapter","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","dependencies":{"@ambiten/adapter-types":"^1.0.0","@ambiten/adapter-runtime":"^1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.9","typescript":"^5.9.3","@types/jest":"^29.5.14","@testing-library/jest-dom":"^6.9.1"},"peerDependencies":{"rxjs":"^7.8.0","@nestjs/core":"^10.0.0 || ^11.0.0","@nestjs/common":"^10.0.0 || ^11.0.0"},"_npmOperationalInternal":{"tmp":"tmp/adapter-nestjs_1.0.1_1789148266433_0.057631636356721305","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@ambiten/adapter-nestjs","version":"1.0.2","description":"Ambiten Nestjs adapter","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","publishConfig":{"access":"public"},"sideEffects":false,"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"keywords":[],"author":"","license":"ISC","repository":{"type":"git","url":"git+https://github.com/AmbitenHQ/ambiten.git","directory":"packages/adapter-nestjs"},"bugs":{"url":"https://github.com/AmbitenHQ/ambiten/issues"},"homepage":"https://docs.ambiten.dev","peerDependencies":{"@nestjs/common":"^10.0.0 || ^11.0.0","@nestjs/core":"^10.0.0 || ^11.0.0","rxjs":"^7.8.0"},"devDependencies":{"@testing-library/jest-dom":"^6.9.1","@types/jest":"^29.5.14","jest":"^29.7.0","ts-jest":"^29.4.9","typescript":"^5.9.3"},"dependencies":{"@ambiten/adapter-runtime":"^1.0.2","@ambiten/adapter-types":"^1.0.1"},"engines":{"node":">=20.11.0"},"scripts":{"build:esm":"tsc -b tsconfig.esm.json -force","build:cjs":"tsc -b tsconfig.json -force && node scripts/fix-esm-extensions.mjs","build":"pnpm run clean && pnpm run build:esm && pnpm run build:cjs","test":"jest --detectOpenHandles --coverage","changeset":"pnpm run changeset","clean":"rimraf dist && rimraf ../../.cache/tsbuildinfo/adapter-nestjs","release":"pnpm changeset version","postbuild:esm":"node scripts/add-esm-type.js"},"_id":"@ambiten/adapter-nestjs@1.0.2","_integrity":"sha512-PMMs6oNdwfnTZpK4WpY6FBkglmTaoka+ul4VnCS5Fsy+jdB5uKFyzxqrlDxCYmBGt3Ik39yWVvAH+kjamA5PPw==","_resolved":"/tmp/44538e4f75fc505e8011162ca34507cf/ambiten-adapter-nestjs-1.0.2.tgz","_from":"file:ambiten-adapter-nestjs-1.0.2.tgz","_nodeVersion":"22.23.2","_npmVersion":"12.0.2","dist":{"integrity":"sha512-PMMs6oNdwfnTZpK4WpY6FBkglmTaoka+ul4VnCS5Fsy+jdB5uKFyzxqrlDxCYmBGt3Ik39yWVvAH+kjamA5PPw==","shasum":"c37cbdb049dc1c6939694cf9e3cd0dfcc00a49c7","tarball":"https://registry.npmjs.org/@ambiten/adapter-nestjs/-/adapter-nestjs-1.0.2.tgz","fileCount":44,"unpackedSize":33891,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHQZlC9s0x2hYejK07dFwx45KlutA/RyKSOmSCcjnMX5AiAlbScvkR1rBXffUun2sICEpaz3ZT/AxCkYK03R/M93xw=="}]},"_npmUser":{"name":"abimongo","email":"padave805@gmail.com"},"directories":{},"maintainers":[{"name":"abimongo","email":"padave805@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/adapter-nestjs_1.0.2_1789381802851_0.6562090807596148"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-13T10:40:57.977Z","modified":"2026-09-14T10:30:03.185Z","1.0.0":"2026-06-13T10:40:58.298Z","1.0.1":"2026-09-11T17:37:46.570Z","1.0.2":"2026-09-14T10:30:02.977Z"},"bugs":{"url":"https://github.com/AmbitenHQ/ambiten/issues"},"license":"ISC","homepage":"https://docs.ambiten.dev","keywords":[],"repository":{"type":"git","url":"git+https://github.com/AmbitenHQ/ambiten.git","directory":"packages/adapter-nestjs"},"description":"Ambiten Nestjs adapter","maintainers":[{"name":"abimongo","email":"padave805@gmail.com"}],"readme":"<div style=\"display: flex; align-items: center;\">\n<p >\n  <img\n    src=\"https://raw.githubusercontent.com/AmbitenHQ/ambiten/main/assets/ambiten-mark-192x192.png\"\n    width=\"56\"\n    alt=\"Ambiten\"\n  />  \n</p> <h2> @ambiten/adapter-nestjs</h2>\n</div>   \n\n<p align=\"center\">\n  <strong>NestJS integration for the Ambiten runtime.</strong>\n</p>\n\n<p align=\"center\">\n  Establish request-scoped execution boundaries, context propagation, multi-tenancy, and transaction-aware runtime behavior throughout NestJS applications.\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/@ambiten/adapter-nestjs\">\n    <img src=\"https://img.shields.io/npm/v/@ambiten/adapter-nestjs?style=flat-square\" alt=\"npm version\" />\n  </a>\n  <!-- <a href=\"https://ambiten.dev\">\n    <img src=\"https://img.shields.io/badge/docs-ambiten.dev-22c55e?style=flat-square\" alt=\"documentation\" />\n  </a> -->\n    </a>\n    <a href=\"https://github.com/AmbitenHQ/ambiten/stargazers\">\n    <img src=\"https://img.shields.io/github/stars/AmbitenHQ/ambiten?style=flat-square&color=1E88E5\" alt=\"GitHub stars\" />\n  </a>\n</p>\n\n---\n\n## Overview\n\n`@ambiten/adapter-nestjs` connects NestJS applications to the Ambiten runtime.\n\nThe adapter establishes execution boundaries using NestJS lifecycle mechanisms such as middleware, guards, interceptors, and request pipelines so runtime context remains available throughout the lifecycle of a request. Tenant information, request metadata, transactions, logging, instrumentation, and runtime services can then participate consistently across controllers, providers, services, and model operations.\n\nThe adapter does not replace NestJS. It allows NestJS to operate as an execution entry point for the Ambiten runtime.\n\n## Installation\n\n```bash\nnpm install @ambiten/core @ambiten/adapter-nestjs\n```\n\n## Quick Start\n\n```ts\nimport { Module } from '@nestjs/common';\nimport { AmbitenBootstrapFactory } from '@ambiten/core';\nimport { createNestJSAdapter } from '@ambiten/adapter-nestjs';\n\nconst adapter = createNestJSAdapter();\n\nawait AmbitenBootstrapFactory.create({\n  adapter\n});\n\n@Module({})\nexport class AppModule {}\n```\n\nOnce installed, incoming requests automatically participate in the Ambiten execution model.\n\n## What the Adapter Provides\n\nThe adapter acts as the bridge between NestJS and the runtime.\n\nIt can establish request-scoped context, initialize tenant boundaries, propagate request metadata, participate in transaction-aware execution flows, and expose runtime state to controllers, providers, services, and models.\n\nThis allows application code to remain focused on business logic while execution concerns remain coordinated by the runtime.\n\n## Runtime Flow\n\n```text\nIncoming Request\n        ↓\nNestJS\n        ↓\nAmbiten Adapter\n        ↓\nAmbitenContext\n        ↓\nControllers\n        ↓\nServices\n        ↓\nModels\n        ↓\nMongoDB\n```\n\nThe adapter creates the execution boundary. The runtime then carries execution state throughout the remainder of the request lifecycle.\n\n## NestJS Integration\n\nThe adapter integrates naturally with NestJS architecture.\n\nRuntime context remains available throughout controllers, providers, guards, interceptors, middleware, pipes, and services without requiring request metadata to be manually passed through every layer.\n\n```text\nRequest\n   ↓\nGuard\n   ↓\nInterceptor\n   ↓\nController\n   ↓\nService\n   ↓\nModel\n```\n\nExecution context remains attached throughout the entire flow.\n\n## Multi-Tenancy\n\nWhen multi-tenancy is enabled, tenant information can be resolved from incoming requests and made available throughout the active runtime context.\n\n```text\nRequest\n   ↓\nTenant Resolution\n   ↓\nAmbitenContext\n   ↓\nTenant-Aware Execution\n```\n\nThis allows services and models to operate against the correct tenant boundary without manually propagating tenant identifiers throughout the application.\n\n## Transaction-Aware Execution\n\nNestJS applications often involve multiple service layers participating in a single business workflow.\n\nThe adapter allows transaction state to remain available throughout the active runtime context so model operations can participate in the same transaction boundary without manually passing sessions between services.\n\nThis helps maintain consistent execution behavior across complex application architectures.\n\n## Observability\n\nLogs, instrumentation events, runtime metrics, and execution metadata generated throughout the request lifecycle remain correlated through the active runtime context.\n\nThis provides a consistent operational view across controllers, services, repositories, middleware, and model operations.\n\n## Documentation\n\nComplete documentation is available at:\n\nhttps://docs.ambiten.dev\n\n## Related Packages\n\n* `@ambiten/core`\n* `@ambiten/logger`\n* `@ambiten/create`\n\n## License\n\nMIT\n","readmeFilename":"README.md"}