{"_id":"@bryopsida/nest-couchdb","_rev":"6-eae7bcbd4989088b4a370d71920e7cbe","time":{"created":"2023-06-13T02:22:39.563Z","0.2.0":"2023-06-13T02:07:32.437Z","modified":"2024-04-07T16:41:40.439Z","0.2.1":"2023-06-13T02:22:39.781Z","0.2.2":"2023-06-16T01:33:36.325Z","0.3.0":"2023-06-17T12:46:41.094Z","0.4.0":"2023-07-04T00:52:06.443Z"},"name":"@bryopsida/nest-couchdb","dist-tags":{"latest":"0.4.0"},"versions":{"0.2.1":{"name":"@bryopsida/nest-couchdb","description":"CouchDB module for Nest framework","version":"0.2.1","license":"MIT","private":false,"main":"dist/index.js","keywords":["nestjs","nest","couchdb"],"scripts":{"prepack":"npm run build","start:services":"docker-compose up -d","stop:services":"docker-compose down","build":"node_modules/typescript/bin/tsc --project ./","build:docs":"npx @compodoc/compodoc -p tsconfig.json","test":"jest --coverage --testPathPattern='test/.*\\.spec\\.ts'","lint":"eslint --ext .ts src/ && prettier --check .","lint:fix":"eslint --ext .ts src/ --fix && prettier --write ."},"devDependencies":{"@compodoc/compodoc":"^1.1.21","@jest/globals":"^29.5.0","@nestjs/microservices":"9.x.x","@nestjs/platform-express":"^9.4.2","@nestjs/testing":"9.x.x","@types/jest":"^29.5.2","@types/node":"18.x.x","@typescript-eslint/eslint-plugin":"^5.15.0","@typescript-eslint/parser":"^5.15.0","eslint":"^8.30.0","eslint-config-prettier":"^8.8.0","eslint-config-standard":"^17.1.0","jest":"29.x.x","prettier":"^2.8.8","testcontainers":"^9.8.0","ts-jest":"29.x.x","typescript":"4.x.x"},"dependencies":{"@nestjs/common":"9.4.2","@nestjs/core":"9.4.2","nano":"^10.1.2"},"jest":{"preset":"ts-jest","testEnvironment":"node","testTimeout":240000,"verbose":true,"moduleNameMapper":{"(.+)\\.js":"$1"},"transform":{"\\.[jt]sx?$":["ts-jest"]}},"gitHead":"9ff9acadb6a5c7843319d98fdb06c25b1e6d13e9","_id":"@bryopsida/nest-couchdb@0.2.1","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-ORlVZ1x7kBHsPZ4L0+TfWm9b9M3nl6Ex+8u/Jds1RZHBpBdkFakdQddm4BCupYM1bIiHfUT/0CJv4oDny2Hd3A==","shasum":"694d3566e30841713b3ebc3a133e02af0eecd2da","tarball":"https://registry.npmjs.org/@bryopsida/nest-couchdb/-/nest-couchdb-0.2.1.tgz","fileCount":73,"unpackedSize":32716,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBesVKqMXm8HBikHgpdsV3x42h0lPt4pXdkPRw2jdN1+AiEA46qX6wD7ng+vtEOyxl6Vd6Yn0auaMacnFnDpQZQBfx4="}]},"_npmUser":{"name":"akboyd88","email":"akboyd88@gmail.com"},"directories":{},"maintainers":[{"name":"akboyd88","email":"akboyd88@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nest-couchdb_0.2.1_1686622959638_0.1073940986961508"},"_hasShrinkwrap":false},"0.2.2":{"name":"@bryopsida/nest-couchdb","description":"CouchDB module for Nest framework","version":"0.2.2","license":"MIT","private":false,"main":"dist/index.js","keywords":["nestjs","nest","couchdb"],"bugs":{"url":"https://github.com/bryopsida/nest-couchdb/issues"},"homepage":"https://github.com/bryopsida/nest-couchdb#readme","scripts":{"prepack":"npm run build","start:services":"docker-compose up -d","stop:services":"docker-compose down","build":"node_modules/typescript/bin/tsc --project ./","build:docs":"npx @compodoc/compodoc -p tsconfig.json","test":"jest --coverage --testPathPattern='test/.*\\.spec\\.ts'","lint":"eslint --ext .ts src/ && prettier --check .","lint:fix":"eslint --ext .ts src/ --fix && prettier --write ."},"devDependencies":{"@compodoc/compodoc":"^1.1.21","@jest/globals":"^29.5.0","@nestjs/microservices":"9.x.x","@nestjs/platform-express":"^9.4.2","@nestjs/testing":"9.x.x","@types/jest":"^29.5.2","@types/node":"18.x.x","@typescript-eslint/eslint-plugin":"^5.15.0","@typescript-eslint/parser":"^5.15.0","eslint":"^8.30.0","eslint-config-prettier":"^8.8.0","eslint-config-standard":"^17.1.0","jest":"29.x.x","prettier":"^2.8.8","testcontainers":"^9.8.0","ts-jest":"29.x.x","typescript":"4.x.x"},"dependencies":{"@nestjs/common":"9.4.2","@nestjs/core":"9.4.2","nano":"^10.1.2"},"jest":{"preset":"ts-jest","testEnvironment":"node","testTimeout":240000,"verbose":true,"moduleNameMapper":{"(.+)\\.js":"$1"},"transform":{"\\.[jt]sx?$":["ts-jest"]}},"gitHead":"ee0e0a8c3939ee22cd1301bce7cfef64077a36f8","_id":"@bryopsida/nest-couchdb@0.2.2","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-137yDiOhOVYN7uRm8xNG14ImfAXwiu7Qm/F/p94jItGnBPrGsZ4dP+TkPut4e5SPFTRiEUURsCjmjjOkCZBNHQ==","shasum":"6ce510930a53216b9735ff236cb530ce05fd09d9","tarball":"https://registry.npmjs.org/@bryopsida/nest-couchdb/-/nest-couchdb-0.2.2.tgz","fileCount":74,"unpackedSize":34071,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdD8/9eDmi8I3EdaQAWN7P0x2JbgTSA9aypcD8vQp1owIhAK30ZiOtnGY7fBrs02qQ4R5HvDQjP9CpxJhGkBgIagzJ"}]},"_npmUser":{"name":"akboyd88","email":"akboyd88@gmail.com"},"directories":{},"maintainers":[{"name":"akboyd88","email":"akboyd88@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nest-couchdb_0.2.2_1686879216155_0.122594485551345"},"_hasShrinkwrap":false},"0.3.0":{"name":"@bryopsida/nest-couchdb","description":"CouchDB module for Nest framework","version":"0.3.0","license":"MIT","private":false,"main":"dist/index.js","keywords":["nestjs","nest","couchdb"],"bugs":{"url":"https://github.com/bryopsida/nest-couchdb/issues"},"homepage":"https://github.com/bryopsida/nest-couchdb#readme","scripts":{"prepack":"npm run build","start:services":"docker-compose up -d","stop:services":"docker-compose down","build":"node_modules/typescript/bin/tsc --project ./","build:docs":"npx @compodoc/compodoc -p tsconfig.json","test":"jest --coverage --testPathPattern='test/.*\\.spec\\.ts'","lint":"eslint --ext .ts src/ && prettier --check .","lint:fix":"eslint --ext .ts src/ --fix && prettier --write ."},"devDependencies":{"@compodoc/compodoc":"^1.1.21","@jest/globals":"^29.5.0","@nestjs/microservices":"10.x","@nestjs/platform-express":"^10.0.0","@nestjs/testing":"10.x","@types/jest":"^29.5.2","@types/node":"18.x.x","@typescript-eslint/eslint-plugin":"^5.15.0","@typescript-eslint/parser":"^5.15.0","eslint":"^8.30.0","eslint-config-prettier":"^8.8.0","eslint-config-standard":"^17.1.0","jest":"29.x.x","prettier":"^2.8.8","testcontainers":"^9.8.0","ts-jest":"29.x.x","typescript":"4.x.x"},"dependencies":{"@nestjs/common":"10.0.1","@nestjs/core":"10.0.1","nano":"^10.1.2"},"jest":{"preset":"ts-jest","testEnvironment":"node","testTimeout":240000,"verbose":true,"moduleNameMapper":{"(.+)\\.js":"$1"},"transform":{"\\.[jt]sx?$":["ts-jest"]}},"gitHead":"77f440d4e3a857467b851471b2ca697abb5852f0","_id":"@bryopsida/nest-couchdb@0.3.0","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-f6MLa6tOW8Xw6xw3BoDJVdAi55E0xXYLHrVsskg9+vxllA2clBUKSB5BBp15XjPy78FA57bDipmpTlidAAqReQ==","shasum":"8adbcab85c85fd277f2db0a10196e128dc06b39f","tarball":"https://registry.npmjs.org/@bryopsida/nest-couchdb/-/nest-couchdb-0.3.0.tgz","fileCount":74,"unpackedSize":34072,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlx40FP6Z2ZKboeOWRsa8wFrlZg/VMEj4ysZ8dpHHCeQIhAJ0l9bimX2OpupKD8k8M2Ia5eWggxT2aAFBYQBf+G1TZ"}]},"_npmUser":{"name":"akboyd88","email":"akboyd88@gmail.com"},"directories":{},"maintainers":[{"name":"akboyd88","email":"akboyd88@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nest-couchdb_0.3.0_1687006000845_0.9731855378007657"},"_hasShrinkwrap":false},"0.4.0":{"name":"@bryopsida/nest-couchdb","description":"CouchDB module for Nest framework","version":"0.4.0","license":"MIT","private":false,"main":"dist/index.js","keywords":["nestjs","nest","couchdb"],"bugs":{"url":"https://github.com/bryopsida/nest-couchdb/issues"},"homepage":"https://github.com/bryopsida/nest-couchdb#readme","scripts":{"prepack":"npm run build","start:services":"docker-compose up -d","stop:services":"docker-compose down","build":"node_modules/typescript/bin/tsc --project ./","build:docs":"npx @compodoc/compodoc -p tsconfig.json","test":"jest --coverage --testPathPattern='test/.*\\.spec\\.ts'","lint":"eslint --ext .ts src/ && prettier --check .","lint:fix":"eslint --ext .ts src/ --fix && prettier --write ."},"devDependencies":{"@compodoc/compodoc":"^1.1.21","@jest/globals":"^29.5.0","@nestjs/microservices":"10.x","@nestjs/platform-express":"^10.0.0","@nestjs/testing":"10.x","@types/jest":"^29.5.2","@types/node":"18.x.x","@typescript-eslint/eslint-plugin":"^5.15.0","@typescript-eslint/parser":"^5.15.0","eslint":"^8.30.0","eslint-config-prettier":"^8.8.0","eslint-config-standard":"^17.1.0","jest":"29.x.x","prettier":"^2.8.8","testcontainers":"^9.8.0","ts-jest":"29.x.x","typescript":"4.x.x"},"dependencies":{"@nestjs/common":"10.0.5","@nestjs/core":"10.0.5","nano":"^10.1.2"},"jest":{"preset":"ts-jest","testEnvironment":"node","testTimeout":240000,"verbose":true,"moduleNameMapper":{"(.+)\\.js":"$1"},"transform":{"\\.[jt]sx?$":["ts-jest"]}},"gitHead":"24a23c1d4d8c22379be799fdb4b0f46eca2bf936","_id":"@bryopsida/nest-couchdb@0.4.0","_nodeVersion":"20.3.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-zFq9rQnwsWBM6KfQhL4DB9iThKD2KDXbfO21QP5DMAMhzlWDKnoLHsGFfy3Ly8Wb9kWgUfone+QG0aDMhz0kNw==","shasum":"cac9c7585d8ddc2582c805d482cb1f3959482a4d","tarball":"https://registry.npmjs.org/@bryopsida/nest-couchdb/-/nest-couchdb-0.4.0.tgz","fileCount":74,"unpackedSize":34072,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4z9S4lkaCvKvTbXChKF+FwMUxEGqg2WnENTRB4zCaxAIgZVNKEBtjxSquUer8B4L8DvWfkCU6/F3ofjG8eFpBkwM="}]},"_npmUser":{"name":"akboyd88","email":"akboyd88@gmail.com"},"directories":{},"maintainers":[{"name":"akboyd88","email":"akboyd88@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nest-couchdb_0.4.0_1688431926237_0.6128581309992547"},"_hasShrinkwrap":false}},"maintainers":[{"email":"noreply@curium.rocks","name":"curium-deployer"},{"email":"npm.feel170@passinbox.com","name":"akboyd88"}],"description":"CouchDB module for Nest framework","keywords":["nestjs","nest","couchdb"],"license":"MIT","readme":"# NestJS CouchDB\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=bryopsida_nest-couchdb&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=bryopsida_nest-couchdb) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=bryopsida_nest-couchdb&metric=coverage)](https://sonarcloud.io/summary/new_code?id=bryopsida_nest-couchdb) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=bryopsida_nest-couchdb&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=bryopsida_nest-couchdb) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=bryopsida_nest-couchdb&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=bryopsida_nest-couchdb) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=bryopsida_nest-couchdb&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=bryopsida_nest-couchdb) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=bryopsida_nest-couchdb&metric=bugs)](https://sonarcloud.io/summary/new_code?id=bryopsida_nest-couchdb)\n\nA <a href=\"http://couchdb.apache.org/\">CouchDB</a> module for <a href=\"https://nestjs.com/\">NestJS</a>\n\n## Installation\n\n```bash\n$ npm i @bryopsida/nest-couchdb nano\n```\n\n## Usage\n\n`@bryopsida/nest-couchdb` uses [nano](https://www.npmjs.com/package/nano) as a data provider for CouchDB and the `Repository` pattern to handle all documents related operations.\n\nFirst, let's create an `Entity`:\n\n```typescript\nimport { Entity, CouchDbEntity } from '@bryopsida/nest-couchdb'\n\n@Entity('cats')\nexport class Cat extends CouchDbEntity {\n  name: string\n}\n```\n\nWhere `cats` is the CouchDB database name.\n\nThe `CouchDbEntity` is a base class which has some common properties:\n\n```typescript\nclass CouchDbEntity {\n  _id: string\n  _rev: string\n}\n```\n\nThen, we need to import `CouchDbModule` in our `ApplicationModule`:\n\n```typescript\nimport { Module } from '@nestjs/common'\nimport { CouchDbModule } from '@bryopsida/nest-couchdb'\n\n@Module({\n  imports: [\n    CouchDbModule.forRoot({\n      url: 'http://localhost:5984',\n      username: 'couchdb',\n      userpass: 'password',\n      requestDefaults: { jar: true },\n    }),\n  ],\n})\nexport class ApplicationModule {}\n```\n\nIn our `CatsModule` we need to initiate repository for our `Cat` entity:\n\n```typescript\nimport { Module } from '@nestjs/common'\nimport { CouchDbModule } from '@bryopsida/nest-couchdb'\nimport { CatsService } from './cats.service'\nimport { CatsController } from './cats.controller'\nimport { Cat } from './cat.entity'\n\n@Module({\n  imports: [CouchDbModule.forFeature([Cat])],\n  providers: [CatsService],\n  controllers: [CatsController],\n})\nexport class CatsModule {}\n```\n\nAnd here is the usage of the repository in the service:\n\n```typescript\nimport { DocumentListResponse } from 'nano';\nimport { Injectable } from '@nestjs/common';\nimport { InjectRepository, Repository } from '@bryopsida/nest-couchdb';\nimport { Cat } from './cat.entity';\n\n@Injectable()\nexport class CatsService {\n  constructor(\n    @InjectRepository(Cat)\n    private readonly catsRepository: Repository<Cat>,\n  ) {}\n\n  findAll(): Promise<DocumentListResponse<Cat> {\n    return this.catsRepository.list();\n  }\n}\n```\n\n## Test\n\n```bash\n$ docker-compose up -d\n$ npm test\n```\n\n## License\n\n[MIT](LICENSE)\n\n## Credits\n\nCreated by [@zMotivat0r](https://github.com/zMotivat0r) @ [Scalio](https://scal.io/)\n","readmeFilename":"README.md","homepage":"https://github.com/bryopsida/nest-couchdb#readme","bugs":{"url":"https://github.com/bryopsida/nest-couchdb/issues"}}