{"_id":"@andrewda/nestjs-dynamoose","_rev":"5-99f2d0b133275f987edd429c7dac4526","name":"@andrewda/nestjs-dynamoose","dist-tags":{"latest":"0.4.0","next":"0.5.1"},"versions":{"0.4.0":{"name":"@andrewda/nestjs-dynamoose","version":"0.4.0","description":"Nest - modern, fast, powerful node.js web framework (@dynamoose)","author":{"name":"Hardys"},"repository":{"type":"git","url":"git+https://github.com/hardyscc/nestjs-dynamoose.git"},"license":"MIT","scripts":{"lint":"eslint \"lib/**/*.ts\" --max-warnings 0","format":"prettier \"lib/**/*.ts\" --write","build":"rm -rf dist && tsc -p tsconfig.json","precommit":"lint-staged","prepublish:npm":"npm run build","publish:npm":"npm publish --access public","prepublish:next":"npm run build","publish:next":"npm publish --access public --tag next","prerelease":"npm run build","release":"release-it"},"devDependencies":{"@commitlint/cli":"17.0.3","@commitlint/config-angular":"17.0.3","@nestjs/common":"9.0.8","@nestjs/core":"9.0.8","@types/node":"16.11.47","@typescript-eslint/eslint-plugin":"5.32.0","@typescript-eslint/parser":"5.32.0","dynamoose":"3.0.0-beta.9","eslint":"8.21.0","eslint-config-prettier":"8.5.0","eslint-plugin-import":"2.26.0","husky":"8.0.1","lint-staged":"13.0.3","prettier":"2.7.1","reflect-metadata":"0.1.13","release-it":"15.3.0","rxjs":"7.5.6","rxjs-compat":"6.6.7","ts-node":"10.9.1","typescript":"4.7.4"},"peerDependencies":{"@aws-sdk/client-dynamodb":"^3.0.0","@nestjs/common":"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0","@nestjs/core":"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0","dynamoose":"^3.0.0-beta.9","reflect-metadata":"^0.1.12","rxjs":"^6.0.0 || ^7.0.0"},"lint-staged":{"*.ts":["prettier --write"]},"husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -c .commitlintrc.json -E HUSKY_GIT_PARAMS"}},"types":"./index.d.ts","gitHead":"032ff631c684e95455368f4a243fe376e6a71edf","bugs":{"url":"https://github.com/hardyscc/nestjs-dynamoose/issues"},"homepage":"https://github.com/hardyscc/nestjs-dynamoose#readme","_id":"@andrewda/nestjs-dynamoose@0.4.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-K0aA2AtAN9n8+2pXvmLeEPoLtE/S3mXg0RnJWUUqAUR27IJPhqLW4jhAJ70PYPgn8sI6H3UDhVYXXtuKXs5eAw==","shasum":"1a7eecf84c2bd29dc94fce6e1abe044c22ed0b33","tarball":"https://registry.npmjs.org/@andrewda/nestjs-dynamoose/-/nestjs-dynamoose-0.4.0.tgz","fileCount":42,"unpackedSize":59334,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGwo4q2ArJ4MhniU4DiELcAJioAo+boqvSKksUcvW0EPAiBYTB/sH3z9GSecfyz818iMqa4+WKHSrpJZ/CVy8XYjeA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9qWiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqwJQ//TYE8KZZjQq4eqACt1nZ7/XoB/ia1HYs6oN2PNMQP0i3POYBm\r\nVTnNlkeF6tmlaICKt8yoWoopHO4nJC8p0dootGiwUxaWDsxW2FmZy7nS9lmH\r\nlRXb5MbE15xU57x+E2T2SwQUBe4Zh72l/CU2ogqH81z9o2SCOsp6mw6h5Ck7\r\nytxL0NQfcwU1zaNq4yR83Qobuwk2LfuXc/j9aopuaORtGLink7B+kft3g7f8\r\nTzhD6VDpeRboSUL1kw2L52GUB96z4yMJ12oQQXw5scnjRh4xzOmcYwOHMlQH\r\nFXf/E+Yxy/5n0qAVzOm8aU4gVOUYclWxXpuI1NJBGtF1+GyhDSpO8J7nLOkB\r\n4gGi+c7fqvSqXe9JQsn1RVBTMr5I0gUg68b07lAWNcQkw1VWXL0Z09c4yMxT\r\nTKIcR0VDK+ckCcVVT/NjNtq2F6i4AXVXeI7HYbWnfoocH/HM4DINaiibMY8e\r\nMDL4KDwFC3RKqP1B3WQCgC/t5l0qjRljSLJ9kr5gcOICveMM26hjaieE71d7\r\nJieTkQBG61QK63Fp7gQZ52GND+c8pu7i+5CkzWytA1cJxEn8jn62jtxt78hs\r\nCNUhUqnvjMmwrdK917YQogmLFMfswC+ldZGGHZgATjX2oSzb0GAijEqydxHk\r\nmjoWAnq3h7g6k+5oFct0N6/0KUx5qCXO5hs=\r\n=0zN8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"andrewda","email":"dassonville.andrew@gmail.com"},"directories":{},"maintainers":[{"name":"andrewda","email":"dassonville.andrew@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-dynamoose_0.4.0_1660331425868_0.4071562266194466"},"_hasShrinkwrap":false},"0.5.0-beta":{"name":"@andrewda/nestjs-dynamoose","version":"0.5.0-beta","description":"Nest - modern, fast, powerful node.js web framework (@dynamoose)","author":{"name":"Hardys"},"repository":{"type":"git","url":"git+https://github.com/hardyscc/nestjs-dynamoose.git"},"license":"MIT","scripts":{"lint":"eslint \"lib/**/*.ts\" --max-warnings 0","format":"prettier \"lib/**/*.ts\" --write","build":"rm -rf dist && tsc -p tsconfig.json","precommit":"lint-staged","prepublish:npm":"npm run build","publish:npm":"npm publish --access public","prepublish:next":"npm run build","publish:next":"npm publish --access public --tag next","prerelease":"npm run build","release":"release-it"},"devDependencies":{"@commitlint/cli":"17.0.3","@commitlint/config-angular":"17.0.3","@nestjs/common":"9.0.8","@nestjs/core":"9.0.8","@types/node":"16.11.47","@typescript-eslint/eslint-plugin":"5.32.0","@typescript-eslint/parser":"5.32.0","dynamoose":"3.0.0-beta.9","eslint":"8.21.0","eslint-config-prettier":"8.5.0","eslint-plugin-import":"2.26.0","husky":"8.0.1","lint-staged":"13.0.3","prettier":"2.7.1","reflect-metadata":"0.1.13","release-it":"15.3.0","rxjs":"7.5.6","rxjs-compat":"6.6.7","ts-node":"10.9.1","typescript":"4.7.4"},"peerDependencies":{"@aws-sdk/client-dynamodb":"^3.0.0","@nestjs/common":"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0","@nestjs/core":"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0","dynamoose":"^3.0.0-beta.9","reflect-metadata":"^0.1.12","rxjs":"^6.0.0 || ^7.0.0"},"lint-staged":{"*.ts":["prettier --write"]},"husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -c .commitlintrc.json -E HUSKY_GIT_PARAMS"}},"types":"./index.d.ts","readme":"<p align=\"center\">\n  <a href=\"http://nestjs.com/\" target=\"blank\"><img src=\"https://nestjs.com/img/logo_text.svg\" width=\"320\" alt=\"Nest Logo\" /></a>\n</p>\n\n<p align=\"center\">A progressive <a href=\"http://nodejs.org\" target=\"blank\">Node.js</a> framework for building efficient and scalable server-side applications.</p>\n\n<p align=\"center\">\n<a href=\"https://www.npmjs.com/package/nestjs-dynamoose\"><img src=\"https://img.shields.io/npm/v/nestjs-dynamoose\" alt=\"NPM Version\"></a>\n<a href=\"https://github.com/hardyscc/nestjs-dynamoose/blob/master/LICENSE\"><img src=\"https://img.shields.io/github/license/hardyscc/nestjs-dynamoose\" alt=\"Package License\"></a>\n<a href=\"https://www.npmjs.com/package/nestjs-dynamoose\"><img src=\"https://img.shields.io/npm/dm/nestjs-dynamoose.svg\" alt=\"NPM Downloads\" /></a>\n<a href=\"https://github.com/hardyscc/nestjs-dynamoose/actions\"><img src=\"https://github.com/hardyscc/nestjs-dynamoose/workflows/Node.js%20CI/badge.svg\" alt=\"CI\"></a>\n<a href=\"https://twitter.com/hardyscchk\"><img src=\"https://img.shields.io/twitter/follow/hardyscchk.svg?style=social&label=Follow\"></a>\n</p>\n\n## Description\n\n[Dynamoose](https://dynamoosejs.com/) module for [Nest](https://github.com/nestjs/nest).\n\n## Installation\n\n```bash\n$ npm install --save nestjs-dynamoose dynamoose\n```\n\n## Example Project\n\nA [AWS NestJS Starter](https://github.com/hardyscc/aws-nestjs-starter) project has been created to demo the usage of this library.\n\n## Quick Start\n\n**1. Add import into your app module**\n\n`src/app.module.ts`\n\n```ts\nimport { DynamooseModule } from 'nestjs-dynamoose';\nimport { UserModule } from './user/user.module';\n\n@Module({\n imports: [\n   DynamooseModule.forRoot(),\n   UserModule,\n ],\n})\nexport class AppModule {\n```\n\n`forRoot()` optionally accepts the following options defined by `DynamooseModuleOptions`:\n\n```ts\ninterface DynamooseModuleOptions {\n  aws?: {\n    accessKeyId?: string;\n    secretAccessKey?: string;\n    region?: string;\n  };\n  local?: boolean | string;\n  ddb?: DynamoDB;\n  model?: ModelOptionsOptional;\n  logger?: boolean | LoggerService;\n}\n```\n\nThere is also `forRootAsync(options: DynamooseModuleAsyncOptions)` if you want to use a factory with dependency injection.\n\n**2. Create a schema**\n\n`src/user/user.schema.ts`\n\n```ts\nimport { Schema } from 'dynamoose';\n\nexport const UserSchema = new Schema({\n  id: {\n    type: String,\n    hashKey: true,\n  },\n  name: {\n    type: String,\n  },\n  email: {\n    type: String,\n  },\n});\n```\n\n`src/user/user.interface.ts`\n\n```ts\nexport interface UserKey {\n  id: string;\n}\n\nexport interface User extends UserKey {\n  name: string;\n  email?: string;\n}\n```\n\n`UserKey` holds the hashKey/partition key and (optionally) the rangeKey/sort key. `User` holds all attributes of the document/item. When creating this two interfaces and using when injecting your model you will have typechecking when using operations like `Model.update()`.\n\n**3. Add the models you want to inject to your modules**\n\nThis can be a feature module (as shown below) or within the root AppModule next to `DynamooseModule.forRoot()`.\n\n`src/user/user.module.ts`\n\n```ts\nimport { DynamooseModule } from 'nestjs-dynamoose';\nimport { UserSchema } from './user.schema';\nimport { UserService } from './user.service';\n\n@Module({\n  imports: [\n    DynamooseModule.forFeature([{ name: 'User', schema: UserSchema }]),\n  ],\n  providers: [\n    UserService,\n    ...\n  ],\n})\nexport class UserModule {}\n```\n\nThere is also `forFeatureAsync(factories?: AsyncModelFactory[])` if you want to use a factory with dependency injection.\n\n**4. Inject and use your model**\n\n`src/user/user.service.ts`\n\n```ts\nimport { Injectable } from '@nestjs/common';\nimport { InjectModel, Model } from 'nestjs-dynamoose';\nimport { User, UserKey } from './user.interface';\n\n@Injectable()\nexport class UserService {\n  constructor(\n    @InjectModel('User')\n    private userModel: Model<User, UserKey>,\n  ) {}\n\n  create(user: User) {\n    return this.userModel.create(user);\n  }\n\n  update(key: UserKey, user: Partial<User>) {\n    return this.userModel.update(key, user);\n  }\n\n  findOne(key: UserKey) {\n    return this.userModel.get(key);\n  }\n\n  findAll() {\n    return this.userModel.scan().exec();\n  }\n}\n```\n\n## Additional Example\n\n**1. Transaction Support**\n\nBoth `User` and `Account` model objects will commit in same transaction.\n\n```ts\nimport { Injectable } from '@nestjs/common';\nimport { InjectModel, Model, TransactionSupport } from 'nestjs-dynamoose';\nimport { User, UserKey } from './user.interface';\nimport { Account, AccountKey } from './account.interface';\n\n@Injectable()\nexport class UserService extends TransactionSupport {\n  constructor(\n    @InjectModel('User')\n    private userModel: Model<User, UserKey>,\n    @InjectModel('Account')\n    private accountModel: Model<Account, AccountKey>,\n  ) {\n    super();\n  }\n\n  async create(user: User, account: Account) {\n    await this.transaction([\n      this.userModel.transaction.create(user),\n      this.accountModel.transaction.create(account),\n    ]);\n  }\n}\n```\n\n**2. Serializers Support**\n\nDefine the additional `serializers` under `DynamooseModule.forFeature()`.\n\n```ts\n@Module({\n  imports: [\n    DynamooseModule.forFeature([\n      {\n        name: 'User',\n        schema: UserSchema,\n        serializers: {\n          frontend: { exclude: ['status'] },\n        },\n      },\n    ]),\n  ],\n  ...\n})\nexport class UserModule {}\n```\n\nCall the `serialize` function to exclude the `status` field.\n\n```ts\n@Injectable()\nexport class UserService {\n  ...\n  async create(user: User) {\n    const createdUser = await this.userModel.create(user);\n    return createdUser.serialize('frontend');\n  }\n  ...\n}\n```\n\n## License\n\nDynamoose module for Nest is [MIT licensed](LICENSE).\n","readmeFilename":"README.md","gitHead":"032ff631c684e95455368f4a243fe376e6a71edf","bugs":{"url":"https://github.com/hardyscc/nestjs-dynamoose/issues"},"homepage":"https://github.com/hardyscc/nestjs-dynamoose#readme","_id":"@andrewda/nestjs-dynamoose@0.5.0-beta","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-FTsb2SbULJXlhOI+oyRn9EAliN73tG3QSDA+ysw9EsjrWkJm4FlGM+g2NfvjY0Wvwc+YcY0Z0AtXH7iaL6k/Lg==","shasum":"3e01ef80b67df4edaa779cd57fa490f0d9b601a7","tarball":"https://registry.npmjs.org/@andrewda/nestjs-dynamoose/-/nestjs-dynamoose-0.5.0-beta.tgz","fileCount":42,"unpackedSize":59339,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEZeGQJOAeVvuW5a5ZDH9b+XsLdSk+ZTFgH45pdpKpl2AiEAr/wJ4UHQ/1ALdo1RzvHtluBtWlnnSMVlsftPOPaLGCI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9qXdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqgSA/7BFvmHZua5YvcgEWYgrXyC5nepIJTeDXz7+dn6VuyH1501olb\r\nT8ZTRIv2u/T66+yw53L3FdX+FDI/gm7GAlhgOfqf6m5O9k7xlWBfF0ay5CrA\r\nElPLPjmk/qODR3O29z7LZehFceTBPDQIJoo2JnSSGKqiuwVrEhdT+5R9T0oy\r\npD+r0AZPlaUcBE5689XNVf+mb4jnDdMhLHTXlbINEUy5U1mRMSWFSlNCJSyc\r\nLBdiyBja/4UjjQbYlRM4JzwP2HoRWS2T7AfKvTAIdlgOa9/X5ryYU0eO7kq0\r\niqN9RaEJ2UUwkEBdTH8juDczna4PmqLeoVx+NvU7Qw9Dhw1IgukCkZ4tDvw6\r\ncY7WRjkdSFY70kfnEWhwaCuhWentHhK0EOG04WQW5Rtn4squLVSO8ubUlXpd\r\nxIdGED0R9zikUw8VYxfghPgKEHLNlyENj51akFGkvGRZng+y6epCr7gAksWm\r\nrCumNRkxj7JozrqQ0B/Z+LeEhqD4kvYW/ZvtigO3iB38grw9xtcVr1Ftj5lW\r\nLWa8bqDKZ3nnsxUvUQPYurupSAG0WoZ2RKL3k7f57mo9qbJzEqAdxAb0EGYR\r\ngsXwsVCZXbWoA5+wBbSfR3z6Mt0cedGtaa9g8ZNEv+FZFzGHikDnq2bCcvYw\r\nDiXL0Xcbx128BGhZ9camv8V693eX4glnpRY=\r\n=xMXb\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"andrewda","email":"dassonville.andrew@gmail.com"},"directories":{},"maintainers":[{"name":"andrewda","email":"dassonville.andrew@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-dynamoose_0.5.0-beta_1660331485062_0.9137882330959257"},"_hasShrinkwrap":false},"0.5.0-beta.1":{"name":"@andrewda/nestjs-dynamoose","version":"0.5.0-beta.1","description":"Nest - modern, fast, powerful node.js web framework (@dynamoose)","author":{"name":"Hardys"},"repository":{"type":"git","url":"git+https://github.com/hardyscc/nestjs-dynamoose.git"},"license":"MIT","scripts":{"lint":"eslint \"lib/**/*.ts\" --max-warnings 0","format":"prettier \"lib/**/*.ts\" --write","build":"rm -rf dist && tsc -p tsconfig.json","precommit":"lint-staged","prepublish:npm":"npm run build","publish:npm":"npm publish --access public","prepublish:next":"npm run build","publish:next":"npm publish --access public --tag next","prerelease":"npm run build","release":"release-it"},"devDependencies":{"@commitlint/cli":"17.0.3","@commitlint/config-angular":"17.0.3","@nestjs/common":"9.0.8","@nestjs/core":"9.0.8","@types/node":"16.11.47","@typescript-eslint/eslint-plugin":"5.32.0","@typescript-eslint/parser":"5.32.0","dynamoose":"3.0.0-beta.9","eslint":"8.21.0","eslint-config-prettier":"8.5.0","eslint-plugin-import":"2.26.0","husky":"8.0.1","lint-staged":"13.0.3","prettier":"2.7.1","reflect-metadata":"0.1.13","release-it":"15.3.0","rxjs":"7.5.6","rxjs-compat":"6.6.7","ts-node":"10.9.1","typescript":"4.7.4"},"peerDependencies":{"@aws-sdk/client-dynamodb":"^3.0.0","@nestjs/common":"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0","@nestjs/core":"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0","dynamoose":"^3.0.0-beta.9","reflect-metadata":"^0.1.12","rxjs":"^6.0.0 || ^7.0.0"},"lint-staged":{"*.ts":["prettier --write"]},"husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -c .commitlintrc.json -E HUSKY_GIT_PARAMS"}},"types":"./index.d.ts","readme":"<p align=\"center\">\n  <a href=\"http://nestjs.com/\" target=\"blank\"><img src=\"https://nestjs.com/img/logo_text.svg\" width=\"320\" alt=\"Nest Logo\" /></a>\n</p>\n\n<p align=\"center\">A progressive <a href=\"http://nodejs.org\" target=\"blank\">Node.js</a> framework for building efficient and scalable server-side applications.</p>\n\n<p align=\"center\">\n<a href=\"https://www.npmjs.com/package/nestjs-dynamoose\"><img src=\"https://img.shields.io/npm/v/nestjs-dynamoose\" alt=\"NPM Version\"></a>\n<a href=\"https://github.com/hardyscc/nestjs-dynamoose/blob/master/LICENSE\"><img src=\"https://img.shields.io/github/license/hardyscc/nestjs-dynamoose\" alt=\"Package License\"></a>\n<a href=\"https://www.npmjs.com/package/nestjs-dynamoose\"><img src=\"https://img.shields.io/npm/dm/nestjs-dynamoose.svg\" alt=\"NPM Downloads\" /></a>\n<a href=\"https://github.com/hardyscc/nestjs-dynamoose/actions\"><img src=\"https://github.com/hardyscc/nestjs-dynamoose/workflows/Node.js%20CI/badge.svg\" alt=\"CI\"></a>\n<a href=\"https://twitter.com/hardyscchk\"><img src=\"https://img.shields.io/twitter/follow/hardyscchk.svg?style=social&label=Follow\"></a>\n</p>\n\n## Description\n\n[Dynamoose](https://dynamoosejs.com/) module for [Nest](https://github.com/nestjs/nest).\n\n## Installation\n\n```bash\n$ npm install --save nestjs-dynamoose dynamoose\n```\n\n## Example Project\n\nA [AWS NestJS Starter](https://github.com/hardyscc/aws-nestjs-starter) project has been created to demo the usage of this library.\n\n## Quick Start\n\n**1. Add import into your app module**\n\n`src/app.module.ts`\n\n```ts\nimport { DynamooseModule } from 'nestjs-dynamoose';\nimport { UserModule } from './user/user.module';\n\n@Module({\n imports: [\n   DynamooseModule.forRoot(),\n   UserModule,\n ],\n})\nexport class AppModule {\n```\n\n`forRoot()` optionally accepts the following options defined by `DynamooseModuleOptions`:\n\n```ts\ninterface DynamooseModuleOptions {\n  aws?: {\n    accessKeyId?: string;\n    secretAccessKey?: string;\n    region?: string;\n  };\n  local?: boolean | string;\n  ddb?: DynamoDB;\n  model?: ModelOptionsOptional;\n  logger?: boolean | LoggerService;\n}\n```\n\nThere is also `forRootAsync(options: DynamooseModuleAsyncOptions)` if you want to use a factory with dependency injection.\n\n**2. Create a schema**\n\n`src/user/user.schema.ts`\n\n```ts\nimport { Schema } from 'dynamoose';\n\nexport const UserSchema = new Schema({\n  id: {\n    type: String,\n    hashKey: true,\n  },\n  name: {\n    type: String,\n  },\n  email: {\n    type: String,\n  },\n});\n```\n\n`src/user/user.interface.ts`\n\n```ts\nexport interface UserKey {\n  id: string;\n}\n\nexport interface User extends UserKey {\n  name: string;\n  email?: string;\n}\n```\n\n`UserKey` holds the hashKey/partition key and (optionally) the rangeKey/sort key. `User` holds all attributes of the document/item. When creating this two interfaces and using when injecting your model you will have typechecking when using operations like `Model.update()`.\n\n**3. Add the models you want to inject to your modules**\n\nThis can be a feature module (as shown below) or within the root AppModule next to `DynamooseModule.forRoot()`.\n\n`src/user/user.module.ts`\n\n```ts\nimport { DynamooseModule } from 'nestjs-dynamoose';\nimport { UserSchema } from './user.schema';\nimport { UserService } from './user.service';\n\n@Module({\n  imports: [\n    DynamooseModule.forFeature([{ name: 'User', schema: UserSchema }]),\n  ],\n  providers: [\n    UserService,\n    ...\n  ],\n})\nexport class UserModule {}\n```\n\nThere is also `forFeatureAsync(factories?: AsyncModelFactory[])` if you want to use a factory with dependency injection.\n\n**4. Inject and use your model**\n\n`src/user/user.service.ts`\n\n```ts\nimport { Injectable } from '@nestjs/common';\nimport { InjectModel, Model } from 'nestjs-dynamoose';\nimport { User, UserKey } from './user.interface';\n\n@Injectable()\nexport class UserService {\n  constructor(\n    @InjectModel('User')\n    private userModel: Model<User, UserKey>,\n  ) {}\n\n  create(user: User) {\n    return this.userModel.create(user);\n  }\n\n  update(key: UserKey, user: Partial<User>) {\n    return this.userModel.update(key, user);\n  }\n\n  findOne(key: UserKey) {\n    return this.userModel.get(key);\n  }\n\n  findAll() {\n    return this.userModel.scan().exec();\n  }\n}\n```\n\n## Additional Example\n\n**1. Transaction Support**\n\nBoth `User` and `Account` model objects will commit in same transaction.\n\n```ts\nimport { Injectable } from '@nestjs/common';\nimport { InjectModel, Model, TransactionSupport } from 'nestjs-dynamoose';\nimport { User, UserKey } from './user.interface';\nimport { Account, AccountKey } from './account.interface';\n\n@Injectable()\nexport class UserService extends TransactionSupport {\n  constructor(\n    @InjectModel('User')\n    private userModel: Model<User, UserKey>,\n    @InjectModel('Account')\n    private accountModel: Model<Account, AccountKey>,\n  ) {\n    super();\n  }\n\n  async create(user: User, account: Account) {\n    await this.transaction([\n      this.userModel.transaction.create(user),\n      this.accountModel.transaction.create(account),\n    ]);\n  }\n}\n```\n\n**2. Serializers Support**\n\nDefine the additional `serializers` under `DynamooseModule.forFeature()`.\n\n```ts\n@Module({\n  imports: [\n    DynamooseModule.forFeature([\n      {\n        name: 'User',\n        schema: UserSchema,\n        serializers: {\n          frontend: { exclude: ['status'] },\n        },\n      },\n    ]),\n  ],\n  ...\n})\nexport class UserModule {}\n```\n\nCall the `serialize` function to exclude the `status` field.\n\n```ts\n@Injectable()\nexport class UserService {\n  ...\n  async create(user: User) {\n    const createdUser = await this.userModel.create(user);\n    return createdUser.serialize('frontend');\n  }\n  ...\n}\n```\n\n## License\n\nDynamoose module for Nest is [MIT licensed](LICENSE).\n","readmeFilename":"README.md","gitHead":"032ff631c684e95455368f4a243fe376e6a71edf","bugs":{"url":"https://github.com/hardyscc/nestjs-dynamoose/issues"},"homepage":"https://github.com/hardyscc/nestjs-dynamoose#readme","_id":"@andrewda/nestjs-dynamoose@0.5.0-beta.1","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-tF/qLBrP9tbsQ1IZjOTYtAvtny6G6lg/+ZAMmvWnXYfFu0LnH0f3S/hD4cJBGQ1Wf2ZaiqBLARkbBoXpfhlGow==","shasum":"9564621ec6b3337a2b8281eee52f8d861635b55e","tarball":"https://registry.npmjs.org/@andrewda/nestjs-dynamoose/-/nestjs-dynamoose-0.5.0-beta.1.tgz","fileCount":42,"unpackedSize":59529,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEIusr358/w4m0Mg0buzWapImBz3asFlGtFOYjZdiETEAiBTKwdQG4brusjzGJN1CK1jGE+ocNTZKj9gn1C0Omiutw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9qboACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFcA/+Ifpp2/pXfVHyZ0aggwOMlRIBb7SR21UVFV/56/VEqSzBT1mm\r\n0aJPVhPxOhxoTb0JoNd5An1IZ5ryxnaurxb04FcrjCT+cu/P5ULOWqRCspT9\r\nYMRAEGQNj8kehTYVmgaybtsOG7D9Kl11La7YstcTW0oGYvvVFmReky8U8igL\r\nZrspuJ70FPvT/3xRDSS+rUHAMYutJUadaECv1MqbwkBugrTgRcLrTIgZQh6J\r\noX3HAMJSiJw19skFTRdH5Z5ZLc/eReDFKaZ4ZagJISpISSAPo3pORKlKftq3\r\nccmzODZp/aYUXTG3mkj8FL1RTsbF1atPMRmGVZfwEvJVCMCSRduXtA32eLsN\r\ni1lAA5YLshEUZpLORjNxRaMyb012o4aB39LwwWTV/zbQ7vE72fXCrM8k6ozx\r\npYKY1Mtrq59+sbqosLwZtOlNndjN28uT0aqI3/LdUWJeNd9DNNnUTiZEdJJq\r\nlu7BaHlwPh1rjnLULLEzW3EXNPDKLaxKH1+oA6DvsbVEleqG8oyvSgJk5Xbf\r\nDbEZ8UQSKbuos5ORnvweVfFu1Cfw7Vj2gzVBRYZqP+WgHtno+ZUn3XI6vhoq\r\nbgRRgVJhpppK2TRq+l0VqbLvhuBZy1ZKiaUNTPn7KaGkY+b5LSOzAjM+U9Gz\r\n4Krak8FZnxcKt25LH5Iuj+StcJGjS68Riyc=\r\n=MMgz\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"andrewda","email":"dassonville.andrew@gmail.com"},"directories":{},"maintainers":[{"name":"andrewda","email":"dassonville.andrew@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-dynamoose_0.5.0-beta.1_1660331751844_0.5176439608669741"},"_hasShrinkwrap":false},"0.5.0-beta.2":{"name":"@andrewda/nestjs-dynamoose","version":"0.5.0-beta.2","description":"Nest - modern, fast, powerful node.js web framework (@dynamoose)","author":{"name":"Hardys"},"repository":{"type":"git","url":"git+https://github.com/hardyscc/nestjs-dynamoose.git"},"license":"MIT","scripts":{"lint":"eslint \"lib/**/*.ts\" --max-warnings 0","format":"prettier \"lib/**/*.ts\" --write","build":"rm -rf dist && tsc -p tsconfig.json","precommit":"lint-staged","prepublish:npm":"npm run build","publish:npm":"npm publish --access public","prepublish:next":"npm run build","publish:next":"npm publish --access public --tag next","prerelease":"npm run build","release":"release-it"},"devDependencies":{"@commitlint/cli":"17.0.3","@commitlint/config-angular":"17.0.3","@nestjs/common":"9.0.9","@nestjs/core":"9.0.9","@types/node":"16.11.48","@typescript-eslint/eslint-plugin":"5.33.0","@typescript-eslint/parser":"5.33.0","dynamoose":"3.0.0-beta.12","eslint":"8.21.0","eslint-config-prettier":"8.5.0","eslint-plugin-import":"2.26.0","husky":"8.0.1","lint-staged":"13.0.3","prettier":"2.7.1","reflect-metadata":"0.1.13","release-it":"15.3.0","rxjs":"7.5.6","rxjs-compat":"6.6.7","ts-node":"10.9.1","typescript":"4.7.4"},"peerDependencies":{"@aws-sdk/client-dynamodb":"^3.0.0","@nestjs/common":"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0","@nestjs/core":"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0","dynamoose":"^3.0.0-beta.12","reflect-metadata":"^0.1.12","rxjs":"^6.0.0 || ^7.0.0"},"lint-staged":{"*.ts":["prettier --write"]},"husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -c .commitlintrc.json -E HUSKY_GIT_PARAMS"}},"types":"./index.d.ts","readme":"<p align=\"center\">\n  <a href=\"http://nestjs.com/\" target=\"blank\"><img src=\"https://nestjs.com/img/logo_text.svg\" width=\"320\" alt=\"Nest Logo\" /></a>\n</p>\n\n<p align=\"center\">A progressive <a href=\"http://nodejs.org\" target=\"blank\">Node.js</a> framework for building efficient and scalable server-side applications.</p>\n\n<p align=\"center\">\n<a href=\"https://www.npmjs.com/package/nestjs-dynamoose\"><img src=\"https://img.shields.io/npm/v/nestjs-dynamoose\" alt=\"NPM Version\"></a>\n<a href=\"https://github.com/hardyscc/nestjs-dynamoose/blob/master/LICENSE\"><img src=\"https://img.shields.io/github/license/hardyscc/nestjs-dynamoose\" alt=\"Package License\"></a>\n<a href=\"https://www.npmjs.com/package/nestjs-dynamoose\"><img src=\"https://img.shields.io/npm/dm/nestjs-dynamoose.svg\" alt=\"NPM Downloads\" /></a>\n<a href=\"https://github.com/hardyscc/nestjs-dynamoose/actions\"><img src=\"https://github.com/hardyscc/nestjs-dynamoose/workflows/Node.js%20CI/badge.svg\" alt=\"CI\"></a>\n<a href=\"https://twitter.com/hardyscchk\"><img src=\"https://img.shields.io/twitter/follow/hardyscchk.svg?style=social&label=Follow\"></a>\n</p>\n\n## Description\n\n[Dynamoose](https://dynamoosejs.com/) module for [Nest](https://github.com/nestjs/nest).\n\n## Installation\n\n```bash\n$ npm install --save nestjs-dynamoose dynamoose\n```\n\n## Example Project\n\nA [AWS NestJS Starter](https://github.com/hardyscc/aws-nestjs-starter) project has been created to demo the usage of this library.\n\n## Quick Start\n\n**1. Add import into your app module**\n\n`src/app.module.ts`\n\n```ts\nimport { DynamooseModule } from 'nestjs-dynamoose';\nimport { UserModule } from './user/user.module';\n\n@Module({\n imports: [\n   DynamooseModule.forRoot(),\n   UserModule,\n ],\n})\nexport class AppModule {\n```\n\n`forRoot()` optionally accepts the following options defined by `DynamooseModuleOptions`:\n\n```ts\ninterface DynamooseModuleOptions {\n  aws?: {\n    accessKeyId?: string;\n    secretAccessKey?: string;\n    region?: string;\n  };\n  local?: boolean | string;\n  ddb?: DynamoDB;\n  table?: TableOptionsOptional;\n  logger?: boolean | LoggerService;\n}\n```\n\nThere is also `forRootAsync(options: DynamooseModuleAsyncOptions)` if you want to use a factory with dependency injection.\n\n**2. Create a schema**\n\n`src/user/user.schema.ts`\n\n```ts\nimport { Schema } from 'dynamoose';\n\nexport const UserSchema = new Schema({\n  id: {\n    type: String,\n    hashKey: true,\n  },\n  name: {\n    type: String,\n  },\n  email: {\n    type: String,\n  },\n});\n```\n\n`src/user/user.interface.ts`\n\n```ts\nexport interface UserKey {\n  id: string;\n}\n\nexport interface User extends UserKey {\n  name: string;\n  email?: string;\n}\n```\n\n`UserKey` holds the hashKey/partition key and (optionally) the rangeKey/sort key. `User` holds all attributes of the document/item. When creating this two interfaces and using when injecting your model you will have typechecking when using operations like `Model.update()`.\n\n**3. Add the models you want to inject to your modules**\n\nThis can be a feature module (as shown below) or within the root AppModule next to `DynamooseModule.forRoot()`.\n\n`src/user/user.module.ts`\n\n```ts\nimport { DynamooseModule } from 'nestjs-dynamoose';\nimport { UserSchema } from './user.schema';\nimport { UserService } from './user.service';\n\n@Module({\n  imports: [\n    DynamooseModule.forFeature([{ name: 'User', schema: UserSchema }]),\n  ],\n  providers: [\n    UserService,\n    ...\n  ],\n})\nexport class UserModule {}\n```\n\nThere is also `forFeatureAsync(factories?: AsyncModelFactory[])` if you want to use a factory with dependency injection.\n\n**4. Inject and use your model**\n\n`src/user/user.service.ts`\n\n```ts\nimport { Injectable } from '@nestjs/common';\nimport { InjectModel, Model } from 'nestjs-dynamoose';\nimport { User, UserKey } from './user.interface';\n\n@Injectable()\nexport class UserService {\n  constructor(\n    @InjectModel('User')\n    private userModel: Model<User, UserKey>,\n  ) {}\n\n  create(user: User) {\n    return this.userModel.create(user);\n  }\n\n  update(key: UserKey, user: Partial<User>) {\n    return this.userModel.update(key, user);\n  }\n\n  findOne(key: UserKey) {\n    return this.userModel.get(key);\n  }\n\n  findAll() {\n    return this.userModel.scan().exec();\n  }\n}\n```\n\n## Additional Example\n\n**1. Transaction Support**\n\nBoth `User` and `Account` model objects will commit in same transaction.\n\n```ts\nimport { Injectable } from '@nestjs/common';\nimport { InjectModel, Model, TransactionSupport } from 'nestjs-dynamoose';\nimport { User, UserKey } from './user.interface';\nimport { Account, AccountKey } from './account.interface';\n\n@Injectable()\nexport class UserService extends TransactionSupport {\n  constructor(\n    @InjectModel('User')\n    private userModel: Model<User, UserKey>,\n    @InjectModel('Account')\n    private accountModel: Model<Account, AccountKey>,\n  ) {\n    super();\n  }\n\n  async create(user: User, account: Account) {\n    await this.transaction([\n      this.userModel.transaction.create(user),\n      this.accountModel.transaction.create(account),\n    ]);\n  }\n}\n```\n\n**2. Serializers Support**\n\nDefine the additional `serializers` under `DynamooseModule.forFeature()`.\n\n```ts\n@Module({\n  imports: [\n    DynamooseModule.forFeature([\n      {\n        name: 'User',\n        schema: UserSchema,\n        serializers: {\n          frontend: { exclude: ['status'] },\n        },\n      },\n    ]),\n  ],\n  ...\n})\nexport class UserModule {}\n```\n\nCall the `serialize` function to exclude the `status` field.\n\n```ts\n@Injectable()\nexport class UserService {\n  ...\n  async create(user: User) {\n    const createdUser = await this.userModel.create(user);\n    return createdUser.serialize('frontend');\n  }\n  ...\n}\n```\n\n## License\n\nDynamoose module for Nest is [MIT licensed](LICENSE).\n","readmeFilename":"README.md","gitHead":"8aea6b29103bbaf207ec891e16e584694951b2a2","bugs":{"url":"https://github.com/hardyscc/nestjs-dynamoose/issues"},"homepage":"https://github.com/hardyscc/nestjs-dynamoose#readme","_id":"@andrewda/nestjs-dynamoose@0.5.0-beta.2","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-nM01kDZn+7AnMBqmXWIupQFpOikYFTd3ESKOTFfWd8jw9SEldMLUZ+EhdVjlKhjuvvcywlFfPPuwXpXuxh4ZwQ==","shasum":"7a1eb76ec68b3eb2ec637e79f6d7f9931fb6c6ed","tarball":"https://registry.npmjs.org/@andrewda/nestjs-dynamoose/-/nestjs-dynamoose-0.5.0-beta.2.tgz","fileCount":42,"unpackedSize":59470,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCm4voMFwahKdQcbOqNtsKs7m+rpyRke9T7Ua4tnBJ8QgIhAKBaWxDPIQjS49TqOAW2rQcLmM1x5d7vy604msJjxwcw"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/BmvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp8mg//RudXLIY53/z859qPWdiVq1Ydd8fUhec8B8Mt2xwnwjmBjeSa\r\ng2DMOQcEr+kTU6zrr5dpfF/95/Am3zU/SxY6bx7NPeZTdxhDordJ6/0P+TpL\r\nDJWAhi7v4DFvdbTdsS0fqqNSfN05y/JF+5PMk1r9BYVcc5VSl0J1uzRZpgUR\r\nQzagl6d4xmie+Wf6T/zz1+skiHc1PWbpR+vUhWzrLIce2k1iTo+TPxY41o5B\r\n1jFGzBiONrbtFQO+9N9hzVvb0iAsr6ZkU/ouj7c4v9S174lplg78Rq7KH0Cn\r\nQTt/QI4CPVJErH4fSC9ERAx0r0lQZkp3TYg5mDMtVt6XHrxs+yLU2iqfwCj2\r\n6wh69SGJAyiKCG2YziNoLA3OiX7gAf9qVkE/DfFYJNoGtkqR4tOQ4JbLBch4\r\njy1CZ1sRzKoSVN4GSTDHYH0oUDvmVozpT+eLiYKP14vtl1KPoKDRbqo0IT1V\r\nVaB01hs7yzh8BxBss9EzRvwHKF9GAG+7lJbKEl57eI5SCnNIZFOPuk1H9iPm\r\nn/rzUlFAJhL5wrCX4Jm3/DIHuYia49zYO+0n8RGt7yfjPn+Dco6wZVFwm32j\r\nS2KmFaHCKVMLupT3kQzBj5AEHXcy3oLxxN9Kthz4UaZtAPXG836lknoB7CLt\r\nFXEI1Y0Ne3gisCsJUpczdnDeC2EN8lafPc4=\r\n=/2lv\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"andrewda","email":"dassonville.andrew@gmail.com"},"directories":{},"maintainers":[{"name":"andrewda","email":"dassonville.andrew@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-dynamoose_0.5.0-beta.2_1660688814789_0.35286682426564364"},"_hasShrinkwrap":false},"0.5.0":{"name":"@andrewda/nestjs-dynamoose","version":"0.5.0","description":"Nest - modern, fast, powerful node.js web framework (@dynamoose)","author":{"name":"Hardys"},"repository":{"type":"git","url":"git+https://github.com/hardyscc/nestjs-dynamoose.git"},"license":"MIT","scripts":{"lint":"eslint \"lib/**/*.ts\" --max-warnings 0","format":"prettier \"lib/**/*.ts\" --write","build":"rm -rf dist && tsc -p tsconfig.json","precommit":"lint-staged","prepublish:npm":"npm run build","publish:npm":"npm publish --access public","prepublish:next":"npm run build","publish:next":"npm publish --access public --tag next","prerelease":"npm run build","release":"release-it"},"devDependencies":{"@commitlint/cli":"17.0.3","@commitlint/config-angular":"17.0.3","@nestjs/common":"9.0.9","@nestjs/core":"9.0.9","@types/node":"16.11.48","@typescript-eslint/eslint-plugin":"5.33.0","@typescript-eslint/parser":"5.33.0","dynamoose":"3.0.0","eslint":"8.21.0","eslint-config-prettier":"8.5.0","eslint-plugin-import":"2.26.0","husky":"8.0.1","lint-staged":"13.0.3","prettier":"2.7.1","reflect-metadata":"0.1.13","release-it":"15.3.0","rxjs":"7.5.6","rxjs-compat":"6.6.7","ts-node":"10.9.1","typescript":"4.7.4"},"peerDependencies":{"@aws-sdk/client-dynamodb":"^3.0.0","@nestjs/common":"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0","@nestjs/core":"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0","dynamoose":"^3.0.0","reflect-metadata":"^0.1.12","rxjs":"^6.0.0 || ^7.0.0"},"lint-staged":{"*.ts":["prettier --write"]},"husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -c .commitlintrc.json -E HUSKY_GIT_PARAMS"}},"types":"./index.d.ts","readme":"<p align=\"center\">\n  <a href=\"http://nestjs.com/\" target=\"blank\"><img src=\"https://nestjs.com/img/logo_text.svg\" width=\"320\" alt=\"Nest Logo\" /></a>\n</p>\n\n<p align=\"center\">A progressive <a href=\"http://nodejs.org\" target=\"blank\">Node.js</a> framework for building efficient and scalable server-side applications.</p>\n\n<p align=\"center\">\n<a href=\"https://www.npmjs.com/package/nestjs-dynamoose\"><img src=\"https://img.shields.io/npm/v/nestjs-dynamoose\" alt=\"NPM Version\"></a>\n<a href=\"https://github.com/hardyscc/nestjs-dynamoose/blob/master/LICENSE\"><img src=\"https://img.shields.io/github/license/hardyscc/nestjs-dynamoose\" alt=\"Package License\"></a>\n<a href=\"https://www.npmjs.com/package/nestjs-dynamoose\"><img src=\"https://img.shields.io/npm/dm/nestjs-dynamoose.svg\" alt=\"NPM Downloads\" /></a>\n<a href=\"https://github.com/hardyscc/nestjs-dynamoose/actions\"><img src=\"https://github.com/hardyscc/nestjs-dynamoose/workflows/Node.js%20CI/badge.svg\" alt=\"CI\"></a>\n<a href=\"https://twitter.com/hardyscchk\"><img src=\"https://img.shields.io/twitter/follow/hardyscchk.svg?style=social&label=Follow\"></a>\n</p>\n\n## Description\n\n[Dynamoose](https://dynamoosejs.com/) module for [Nest](https://github.com/nestjs/nest).\n\n## Installation\n\n```bash\n$ npm install --save nestjs-dynamoose dynamoose\n```\n\n## Example Project\n\nA [AWS NestJS Starter](https://github.com/hardyscc/aws-nestjs-starter) project has been created to demo the usage of this library.\n\n## Quick Start\n\n**1. Add import into your app module**\n\n`src/app.module.ts`\n\n```ts\nimport { DynamooseModule } from 'nestjs-dynamoose';\nimport { UserModule } from './user/user.module';\n\n@Module({\n imports: [\n   DynamooseModule.forRoot(),\n   UserModule,\n ],\n})\nexport class AppModule {\n```\n\n`forRoot()` optionally accepts the following options defined by `DynamooseModuleOptions`:\n\n```ts\ninterface DynamooseModuleOptions {\n  aws?: {\n    accessKeyId?: string;\n    secretAccessKey?: string;\n    region?: string;\n  };\n  local?: boolean | string;\n  ddb?: DynamoDB;\n  table?: TableOptionsOptional;\n  logger?: boolean | LoggerService;\n}\n```\n\nThere is also `forRootAsync(options: DynamooseModuleAsyncOptions)` if you want to use a factory with dependency injection.\n\n**2. Create a schema**\n\n`src/user/user.schema.ts`\n\n```ts\nimport { Schema } from 'dynamoose';\n\nexport const UserSchema = new Schema({\n  id: {\n    type: String,\n    hashKey: true,\n  },\n  name: {\n    type: String,\n  },\n  email: {\n    type: String,\n  },\n});\n```\n\n`src/user/user.interface.ts`\n\n```ts\nexport interface UserKey {\n  id: string;\n}\n\nexport interface User extends UserKey {\n  name: string;\n  email?: string;\n}\n```\n\n`UserKey` holds the hashKey/partition key and (optionally) the rangeKey/sort key. `User` holds all attributes of the document/item. When creating this two interfaces and using when injecting your model you will have typechecking when using operations like `Model.update()`.\n\n**3. Add the models you want to inject to your modules**\n\nThis can be a feature module (as shown below) or within the root AppModule next to `DynamooseModule.forRoot()`.\n\n`src/user/user.module.ts`\n\n```ts\nimport { DynamooseModule } from 'nestjs-dynamoose';\nimport { UserSchema } from './user.schema';\nimport { UserService } from './user.service';\n\n@Module({\n  imports: [\n    DynamooseModule.forFeature([{ name: 'User', schema: UserSchema }]),\n  ],\n  providers: [\n    UserService,\n    ...\n  ],\n})\nexport class UserModule {}\n```\n\nThere is also `forFeatureAsync(factories?: AsyncModelFactory[])` if you want to use a factory with dependency injection.\n\n**4. Inject and use your model**\n\n`src/user/user.service.ts`\n\n```ts\nimport { Injectable } from '@nestjs/common';\nimport { InjectModel, Model } from 'nestjs-dynamoose';\nimport { User, UserKey } from './user.interface';\n\n@Injectable()\nexport class UserService {\n  constructor(\n    @InjectModel('User')\n    private userModel: Model<User, UserKey>,\n  ) {}\n\n  create(user: User) {\n    return this.userModel.create(user);\n  }\n\n  update(key: UserKey, user: Partial<User>) {\n    return this.userModel.update(key, user);\n  }\n\n  findOne(key: UserKey) {\n    return this.userModel.get(key);\n  }\n\n  findAll() {\n    return this.userModel.scan().exec();\n  }\n}\n```\n\n## Additional Example\n\n**1. Transaction Support**\n\nBoth `User` and `Account` model objects will commit in same transaction.\n\n```ts\nimport { Injectable } from '@nestjs/common';\nimport { InjectModel, Model, TransactionSupport } from 'nestjs-dynamoose';\nimport { User, UserKey } from './user.interface';\nimport { Account, AccountKey } from './account.interface';\n\n@Injectable()\nexport class UserService extends TransactionSupport {\n  constructor(\n    @InjectModel('User')\n    private userModel: Model<User, UserKey>,\n    @InjectModel('Account')\n    private accountModel: Model<Account, AccountKey>,\n  ) {\n    super();\n  }\n\n  async create(user: User, account: Account) {\n    await this.transaction([\n      this.userModel.transaction.create(user),\n      this.accountModel.transaction.create(account),\n    ]);\n  }\n}\n```\n\n**2. Serializers Support**\n\nDefine the additional `serializers` under `DynamooseModule.forFeature()`.\n\n```ts\n@Module({\n  imports: [\n    DynamooseModule.forFeature([\n      {\n        name: 'User',\n        schema: UserSchema,\n        serializers: {\n          frontend: { exclude: ['status'] },\n        },\n      },\n    ]),\n  ],\n  ...\n})\nexport class UserModule {}\n```\n\nCall the `serialize` function to exclude the `status` field.\n\n```ts\n@Injectable()\nexport class UserService {\n  ...\n  async create(user: User) {\n    const createdUser = await this.userModel.create(user);\n    return createdUser.serialize('frontend');\n  }\n  ...\n}\n```\n\n## License\n\nDynamoose module for Nest is [MIT licensed](LICENSE).\n","readmeFilename":"README.md","gitHead":"d178d90d8366224a763a51ebd178d4c802cc0708","bugs":{"url":"https://github.com/hardyscc/nestjs-dynamoose/issues"},"homepage":"https://github.com/hardyscc/nestjs-dynamoose#readme","_id":"@andrewda/nestjs-dynamoose@0.5.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-ysKRtwHSiCtnzSyL3mpE42KDHiJD0FkXJO0JlV1Zo9lYscndBVQWxIn5JmuS1c6CsIUYgMDLFgDcUlwYlQYe4g==","shasum":"03aeaaa56336827955f6e773c31176676a7743d7","tarball":"https://registry.npmjs.org/@andrewda/nestjs-dynamoose/-/nestjs-dynamoose-0.5.0.tgz","fileCount":42,"unpackedSize":59447,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCH/2QTN9HY8ZrFHQ8bQN7wyAeUiKlApFw8PyiPII2ZjwIhALlIBm1E1/+p7ybk/MAnudLt15hmFU9CGU4xOHemvF8G"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/UJNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdLg//ZGTLKvF6yXgaXIUt/2tARy90ZajwvqoHvlYfpE7Hf6nmWHmc\r\nLMtM2mDe6RAF7fAQqLuqv+zEiq5n7G6rvTkNFbv8+7cRLL6NvdMm3jl3WZw2\r\nDj0Mx8osj3GtVezxYwmI7RovXYfKYRCevREG/KOcn9EMY5moXKMvBQ1oi39x\r\nHeyVU6ScRYyDR2Wf+75cz1pHf6dydWW/+MnsN5qFaT8jRuC5/RjxMioKfwdT\r\n9MViSD3Nqy/dvHDnz/YyFOrbe2D3dK1tiV3hMZMZCttkmTWCtLKyjas1S3gG\r\n+wmne6VekUSnD/c173F9WY03vFRiC5LI05O625qmo97mN+1MTnRT50jnD/Yy\r\njTs7MKpPlQ6p/rBqvQX1kIxfRuWtiV5R1dBQJjPWhlW6kXF3gLnhxfzQ7W/L\r\nYuEiEemR3xqFsP8tPjAjbdKtNlt1KZvcKcbMG+CjnQQk5Kr+slxk+eCAuWXL\r\nDFvfhObgKp4WbDYy3tWugiM5DDZgYDsv0JyXTXx/QQFHnjeNTuU7zoJ2THkQ\r\ncJGAvJDozZbtiDf7qVFiGy5A7tiUR06d19os2WApadlNw7xPVthnm47qVD7r\r\nblrDHzbEMeawN9puvU8NBX+n8sJhY0I0YaUlH6+JyVlcKJurCQ2FgpYQ32e4\r\nmaW9SpxeVncmo934gl2qRYCSTAlB0yDYWvA=\r\n=0ulV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"andrewda","email":"dassonville.andrew@gmail.com"},"directories":{},"maintainers":[{"name":"andrewda","email":"dassonville.andrew@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-dynamoose_0.5.0_1660764748944_0.1620298384111758"},"_hasShrinkwrap":false},"0.5.1":{"name":"@andrewda/nestjs-dynamoose","version":"0.5.1","description":"Nest - modern, fast, powerful node.js web framework (@dynamoose)","author":{"name":"Hardys"},"repository":{"type":"git","url":"git+https://github.com/hardyscc/nestjs-dynamoose.git"},"license":"MIT","scripts":{"lint":"eslint \"lib/**/*.ts\" --max-warnings 0","format":"prettier \"lib/**/*.ts\" --write","build":"rm -rf dist && tsc -p tsconfig.json","precommit":"lint-staged","prepublish:npm":"npm run build","publish:npm":"npm publish --access public","prepublish:next":"npm run build","publish:next":"npm publish --access public --tag next","prerelease":"npm run build","release":"release-it"},"devDependencies":{"@commitlint/cli":"17.0.3","@commitlint/config-angular":"17.0.3","@nestjs/common":"9.0.9","@nestjs/core":"9.0.9","@types/node":"16.11.48","@typescript-eslint/eslint-plugin":"5.33.0","@typescript-eslint/parser":"5.33.0","dynamoose":"3.0.0","eslint":"8.21.0","eslint-config-prettier":"8.5.0","eslint-plugin-import":"2.26.0","husky":"8.0.1","lint-staged":"13.0.3","prettier":"2.7.1","reflect-metadata":"0.1.13","release-it":"15.3.0","rxjs":"7.5.6","rxjs-compat":"6.6.7","ts-node":"10.9.1","typescript":"4.7.4"},"peerDependencies":{"@aws-sdk/client-dynamodb":"^3.0.0","@nestjs/common":"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0","@nestjs/core":"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0","dynamoose":"^3.0.0","reflect-metadata":"^0.1.12","rxjs":"^6.0.0 || ^7.0.0"},"lint-staged":{"*.ts":["prettier --write"]},"husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -c .commitlintrc.json -E HUSKY_GIT_PARAMS"}},"types":"./index.d.ts","readme":"<p align=\"center\">\n  <a href=\"http://nestjs.com/\" target=\"blank\"><img src=\"https://nestjs.com/img/logo_text.svg\" width=\"320\" alt=\"Nest Logo\" /></a>\n</p>\n\n<p align=\"center\">A progressive <a href=\"http://nodejs.org\" target=\"blank\">Node.js</a> framework for building efficient and scalable server-side applications.</p>\n\n<p align=\"center\">\n<a href=\"https://www.npmjs.com/package/nestjs-dynamoose\"><img src=\"https://img.shields.io/npm/v/nestjs-dynamoose\" alt=\"NPM Version\"></a>\n<a href=\"https://github.com/hardyscc/nestjs-dynamoose/blob/master/LICENSE\"><img src=\"https://img.shields.io/github/license/hardyscc/nestjs-dynamoose\" alt=\"Package License\"></a>\n<a href=\"https://www.npmjs.com/package/nestjs-dynamoose\"><img src=\"https://img.shields.io/npm/dm/nestjs-dynamoose.svg\" alt=\"NPM Downloads\" /></a>\n<a href=\"https://github.com/hardyscc/nestjs-dynamoose/actions\"><img src=\"https://github.com/hardyscc/nestjs-dynamoose/workflows/Node.js%20CI/badge.svg\" alt=\"CI\"></a>\n<a href=\"https://twitter.com/hardyscchk\"><img src=\"https://img.shields.io/twitter/follow/hardyscchk.svg?style=social&label=Follow\"></a>\n</p>\n\n## Description\n\n[Dynamoose](https://dynamoosejs.com/) module for [Nest](https://github.com/nestjs/nest).\n\n## Installation\n\n```bash\n$ npm install --save nestjs-dynamoose dynamoose\n```\n\n## Example Project\n\nA [AWS NestJS Starter](https://github.com/hardyscc/aws-nestjs-starter) project has been created to demo the usage of this library.\n\n## Quick Start\n\n**1. Add import into your app module**\n\n`src/app.module.ts`\n\n```ts\nimport { DynamooseModule } from 'nestjs-dynamoose';\nimport { UserModule } from './user/user.module';\n\n@Module({\n imports: [\n   DynamooseModule.forRoot(),\n   UserModule,\n ],\n})\nexport class AppModule {\n```\n\n`forRoot()` optionally accepts the following options defined by `DynamooseModuleOptions`:\n\n```ts\ninterface DynamooseModuleOptions {\n  aws?: {\n    accessKeyId?: string;\n    secretAccessKey?: string;\n    region?: string;\n  };\n  local?: boolean | string;\n  ddb?: DynamoDB;\n  table?: TableOptionsOptional;\n  logger?: boolean | LoggerService;\n}\n```\n\nThere is also `forRootAsync(options: DynamooseModuleAsyncOptions)` if you want to use a factory with dependency injection.\n\n**2. Create a schema**\n\n`src/user/user.schema.ts`\n\n```ts\nimport { Schema } from 'dynamoose';\n\nexport const UserSchema = new Schema({\n  id: {\n    type: String,\n    hashKey: true,\n  },\n  name: {\n    type: String,\n  },\n  email: {\n    type: String,\n  },\n});\n```\n\n`src/user/user.interface.ts`\n\n```ts\nexport interface UserKey {\n  id: string;\n}\n\nexport interface User extends UserKey {\n  name: string;\n  email?: string;\n}\n```\n\n`UserKey` holds the hashKey/partition key and (optionally) the rangeKey/sort key. `User` holds all attributes of the document/item. When creating this two interfaces and using when injecting your model you will have typechecking when using operations like `Model.update()`.\n\n**3. Add the models you want to inject to your modules**\n\nThis can be a feature module (as shown below) or within the root AppModule next to `DynamooseModule.forRoot()`.\n\n`src/user/user.module.ts`\n\n```ts\nimport { DynamooseModule } from 'nestjs-dynamoose';\nimport { UserSchema } from './user.schema';\nimport { UserService } from './user.service';\n\n@Module({\n  imports: [\n    DynamooseModule.forFeature([{ name: 'User', schema: UserSchema }]),\n  ],\n  providers: [\n    UserService,\n    ...\n  ],\n})\nexport class UserModule {}\n```\n\nThere is also `forFeatureAsync(factories?: AsyncModelFactory[])` if you want to use a factory with dependency injection.\n\n**4. Inject and use your model**\n\n`src/user/user.service.ts`\n\n```ts\nimport { Injectable } from '@nestjs/common';\nimport { InjectModel, Model } from 'nestjs-dynamoose';\nimport { User, UserKey } from './user.interface';\n\n@Injectable()\nexport class UserService {\n  constructor(\n    @InjectModel('User')\n    private userModel: Model<User, UserKey>,\n  ) {}\n\n  create(user: User) {\n    return this.userModel.create(user);\n  }\n\n  update(key: UserKey, user: Partial<User>) {\n    return this.userModel.update(key, user);\n  }\n\n  findOne(key: UserKey) {\n    return this.userModel.get(key);\n  }\n\n  findAll() {\n    return this.userModel.scan().exec();\n  }\n}\n```\n\n## Additional Example\n\n**1. Transaction Support**\n\nBoth `User` and `Account` model objects will commit in same transaction.\n\n```ts\nimport { Injectable } from '@nestjs/common';\nimport { InjectModel, Model, TransactionSupport } from 'nestjs-dynamoose';\nimport { User, UserKey } from './user.interface';\nimport { Account, AccountKey } from './account.interface';\n\n@Injectable()\nexport class UserService extends TransactionSupport {\n  constructor(\n    @InjectModel('User')\n    private userModel: Model<User, UserKey>,\n    @InjectModel('Account')\n    private accountModel: Model<Account, AccountKey>,\n  ) {\n    super();\n  }\n\n  async create(user: User, account: Account) {\n    await this.transaction([\n      this.userModel.transaction.create(user),\n      this.accountModel.transaction.create(account),\n    ]);\n  }\n}\n```\n\n**2. Serializers Support**\n\nDefine the additional `serializers` under `DynamooseModule.forFeature()`.\n\n```ts\n@Module({\n  imports: [\n    DynamooseModule.forFeature([\n      {\n        name: 'User',\n        schema: UserSchema,\n        serializers: {\n          frontend: { exclude: ['status'] },\n        },\n      },\n    ]),\n  ],\n  ...\n})\nexport class UserModule {}\n```\n\nCall the `serialize` function to exclude the `status` field.\n\n```ts\n@Injectable()\nexport class UserService {\n  ...\n  async create(user: User) {\n    const createdUser = await this.userModel.create(user);\n    return createdUser.serialize('frontend');\n  }\n  ...\n}\n```\n\n## License\n\nDynamoose module for Nest is [MIT licensed](LICENSE).\n","readmeFilename":"README.md","gitHead":"e0e37787cf8f6d1137339c61f21b1ae5dbdc3a8b","bugs":{"url":"https://github.com/hardyscc/nestjs-dynamoose/issues"},"homepage":"https://github.com/hardyscc/nestjs-dynamoose#readme","_id":"@andrewda/nestjs-dynamoose@0.5.1","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-KiJu0mvmho8kSBkbWNeYDQjmXJNqnj17EPUkp+xlId7SJ2MkUwgkI7k+nDybg8GdrMn1Z6SAx8qpfA80YV9L4Q==","shasum":"4e6f0ab8b136ed814030bde76089a05cc875430d","tarball":"https://registry.npmjs.org/@andrewda/nestjs-dynamoose/-/nestjs-dynamoose-0.5.1.tgz","fileCount":42,"unpackedSize":59447,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAc3i3TqaFKm77owOIXt3oSkGl7lFOu7lsUBRx+zOR7cAiBdpSLcUEQtG5rlJxfWWSD1Ww9msWe2QTMzA00lz7OyqA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/ULBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPcg//c9TlIb3vPcZwOtzevn51jlG1xoWuM90jVyajfsqhGBjnC38m\r\nmcvsB4/xf5rWWeF2YDQhB2OHlNYnkJCzevrDyDRUOtJraxYFRXHxaeu2oQeb\r\nBaKFG38dX7xeClyiY7qBbFafpUEgOneMJUKanvD/aDW02kRMf2Y6Msmk9e2P\r\n6QlCvekfls3zRZKWGZd2e34nuonWrpl14uAgaxNPv6v8DyL6YBjRMn688bg5\r\nQrYsejwDly0qvYDq1RdcIDbNlGN2CbV+BMeHAhXuRbTux4gnkGW+Xp5Zpixd\r\nd0ovybAfF/h1rifM3XYdbpgQOKYvYamWQUfeaBB4Q1trQuySIdZeKaSYX+mw\r\nla3ildR+mXjeGQu1Y5y0i1i9d0yKHVAxACKVMnarjZi6OJ1wxk/4AH/TT5Sb\r\n/KH/pAaMvNMBF4aJFzJMuWBaweLx9hNl6ceDHexMje6+xiRZjwjIA5xk661H\r\ngkAac/lo1ZbNxOS+yS1ghY+MLZ+Jd8VnCTNNIsIUaMcA2Fpx97RvhNr6ypM/\r\npBweePk+7L9o54m/SJsUQKQAnq8nUy4si1B0Y7hUNOnVSi3xGq5aZbQI+3Bd\r\nLdmg/WBbXXyavpEr6srr0+LssSlnPuz2VBe5aFaJmOF8tZj4Ujhw/Ys8H50w\r\nvRGE7+Bab0SPaYH/0pWDA8RItrVpYJZO898=\r\n=kemH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"andrewda","email":"dassonville.andrew@gmail.com"},"directories":{},"maintainers":[{"name":"andrewda","email":"dassonville.andrew@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-dynamoose_0.5.1_1660764865494_0.7121121471669158"},"_hasShrinkwrap":false}},"time":{"created":"2022-08-12T19:10:25.797Z","0.4.0":"2022-08-12T19:10:26.068Z","modified":"2022-08-17T19:34:25.754Z","0.5.0-beta":"2022-08-12T19:11:25.247Z","0.5.0-beta.1":"2022-08-12T19:15:52.049Z","0.5.0-beta.2":"2022-08-16T22:26:55.067Z","0.5.0":"2022-08-17T19:32:29.392Z","0.5.1":"2022-08-17T19:34:25.647Z"},"maintainers":[{"name":"andrewda","email":"dassonville.andrew@gmail.com"}],"description":"Nest - modern, fast, powerful node.js web framework (@dynamoose)","homepage":"https://github.com/hardyscc/nestjs-dynamoose#readme","repository":{"type":"git","url":"git+https://github.com/hardyscc/nestjs-dynamoose.git"},"author":{"name":"Hardys"},"bugs":{"url":"https://github.com/hardyscc/nestjs-dynamoose/issues"},"license":"MIT","readme":"","readmeFilename":""}