{"_id":"@blueeast/nestjs-event-store","_rev":"3-f4717642d58da964bef9d7be74b27573","name":"@blueeast/nestjs-event-store","dist-tags":{"latest":"4.0.0"},"versions":{"3.2.0":{"name":"@blueeast/nestjs-event-store","version":"3.2.0","description":"NestJS CQRS module for EventStore.org CQRS","author":{"name":"Rex Isaac Raphael","email":"rex.rahael@outlook.com","url":"https://xraph.com"},"main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/blueeastcode/nestjs-event-store.git"},"license":"MIT","keywords":[],"scripts":{"describe":"npm-scripts-info","build":"run-s clean && run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:tslint":"tslint --fix --project .","test:lint":"tslint --project . && prettier \"src/**/*.ts\" --list-different","test":"jest","test:watch":"jest --watch","test:cov":"jest --coverage && cat ./coverage/lcov.info | codacy-coverage --token a5ea7c309f7543a3b7cfc662c1c88d67 --language typescript","test:debug":"node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand","watch":"run-s clean build:main && run-p \"build:main -- -w\" \"test:unit -- --watch\"","doc":"run-s doc:html && open-cli build/docs/index.html","doc:html":"typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --out build/docs","doc:json":"typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --json build/docs/typedoc.json","doc:publish":"gh-pages -m \"[ci skip] Updates\" -d build/docs","version":"standard-version","reset":"git clean -dfx && git reset --hard && npm i","clean":"trash build test","prepare-release":"run-s reset test cov:check doc:html version doc:publish"},"scripts-info":{"info":"Display information about the package scripts","build":"Clean and rebuild the project","fix":"Try to automatically fix any linting problems","test":"Lint and unit test the project","watch":"Watch and rebuild the project on save, then rerun relevant tests","cov":"Rebuild, run tests, then create and open the coverage report","doc":"Generate HTML API documentation and open it in a browser","doc:json":"Generate API documentation in typedoc JSON format","version":"Bump package.json version, update CHANGELOG.md, tag release","reset":"Delete all untracked files and reset the repo to the last commit","prepare-release":"One-step: clean, build, test, publish docs, and prep a release"},"engines":{"node":">=8.9"},"dependencies":{"@nestjs/common":"^7.4.2","@nestjs/core":"^7.4.2","@nestjs/cqrs":"^7.0.0","axios":"^0.19.2","protobufjs":"^6.10.1","uuid":"^8.3.0"},"peerDependencies":{"node-eventstore-client":"^0.2.16","node-nats-streaming":"^0.3.2"},"devDependencies":{"@bitjson/npm-scripts-info":"^1.0.0","@bitjson/typedoc":"^0.15.0-0","@nestjs/cli":"^6.9.0","@nestjs/schematics":"^6.7.0","@nestjs/testing":"^6.7.1","@types/jest":"^24.0.18","@types/lodash":"^4.14.144","@types/node":"^12.7.5","@types/supertest":"^2.0.8","codecov":"^3.5.0","cz-conventional-changelog":"^2.1.0","gh-pages":"^2.0.1","jest":"^24.9.0","node-eventstore-client":"^0.2.18","node-nats-streaming":"^0.3.2","npm-run-all":"^4.1.5","nyc":"^14.1.1","open-cli":"^5.0.0","prettier":"^1.18.2","remark-cli":"^7.0.0","remark-lint-emphasis-marker":"^1.0.3","remark-lint-strong-marker":"^1.0.3","remark-preset-lint-recommended":"^3.0.3","standard-version":"^6.0.1","supertest":"^4.0.2","trash-cli":"^3.0.0","ts-jest":"^24.1.0","ts-loader":"^6.1.1","ts-node":"^8.4.1","tsconfig-paths":"^3.9.0","tslint":"^5.20.0","tslint-config-prettier":"^1.18.0","tslint-immutable":"^6.0.1","typescript":"^3.5.3"},"jest":{"globals":{"ts-jest":{"diagnostics":false}},"moduleFileExtensions":["js","json","ts"],"rootDir":".","testRegex":".spec.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"coverageDirectory":"./coverage","testEnvironment":"node"},"config":{"commitizen":{"path":"cz-conventional-changelog"}},"prettier":{"singleQuote":true},"nyc":{"extends":"@istanbuljs/nyc-config-typescript","exclude":["**/*.spec.js"]},"gitHead":"9be6ac8378e1f80c113bba23ba772cebdcb4c105","bugs":{"url":"https://github.com/blueeastcode/nestjs-event-store/issues"},"homepage":"https://github.com/blueeastcode/nestjs-event-store#readme","_id":"@blueeast/nestjs-event-store@3.2.0","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-kE7IuzhFpK9vwSRD2bufeRkhJ2iOEqWb4CNOvstIWJb/olLHGS1SX/Al3HJh78YaS8psEcbnkqehnk2D+6xPWw==","shasum":"3a1e046f6b944e2dc4bfd9a8300f9e4d9241963f","tarball":"https://registry.npmjs.org/@blueeast/nestjs-event-store/-/nestjs-event-store-3.2.0.tgz","fileCount":156,"unpackedSize":2000610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA5+eCRA9TVsSAnZWagAAqRgQAJY5q4i/kN9WKg2E22Ix\npR0a9fdw6b+PM1IJrZBHUwHmGlefWIZ6MS0ZIaT7SIbRE4blw0d8o6qgAxX9\nqiBSIU95qmV1izVNJcLpj3ykJzLEenFh0dpgmlFycCRGMrFiMRc6mK83mjEw\nQrTClmWRP2+7+J6BFowSoVYJ12QWZoYDSrVwySqJ1mqhmXLpiUXrgc1eIhd0\nTnFldxcTGWgbVwM7rey/9YzOY0tRr6PlFzNNt4fYiAuizhhJ169DnR9UjnXe\nxEToEwHYc+Z5r/IBwqNIY4PFoPF2tJTS8YcLcXBx02qkVIq9sLOtmhAzZa5k\nBcE7V4nyXX8QxTw8U4Irfaa7wvViIiljnTLF5OzJ4OtpQcZaXOoQrsPNbGyp\nU4HgXjU3/EPNkNFJDHCDnfzwKqBZp+A/aquCEuhw7GfVEQdXEUh+PbUN7wjN\nYo9YwV50CXeEq/TElcH5iVS0wtNoEUQ3lgRZU0p7iln/Jy1DE2yCGEIOqRb5\ndlffWWbgbbJSBk+HEMFHDf+R1XhIRJTKb8TKcg/q0/y7QBgmcYOQjY4yglM8\nMAZ2S2iofaSCJi0jCDJhE50rBwzkKarw5DsxwJ0XFRYy8gxmmJbbL2O/JvKt\nrxQCoofCo0tHAyah1sPaGHjG25eXk8KY9x99UedQ3q0TniCoJkIYzCj+31xd\nioXF\r\n=263E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEPvXyPHAc/RgM/vFPZiD9/P+TZaqe0bMSk098/efWYSAiEA5sNQ311kmGsIRuZTT2QFiVbKWoBSjPdbOaqlnVyLT4k="}]},"_npmUser":{"name":"artalat","email":"rehman.talat@gmail.com"},"directories":{},"maintainers":[{"name":"artalat","email":"rehman.talat@gmail.com"},{"name":"abubakarsaddique","email":"abubakar.mani1@gmail.com"},{"name":"bluebase-release-bot","email":"bluebase-release-bot@blueeast.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-event-store_3.2.0_1644404638465_0.3020054933423131"},"_hasShrinkwrap":false},"3.2.1":{"name":"@blueeast/nestjs-event-store","version":"3.2.1","description":"NestJS CQRS module for EventStore.org CQRS","author":{"name":"Rex Isaac Raphael","email":"rex.rahael@outlook.com","url":"https://xraph.com"},"main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/blueeastcode/nestjs-event-store.git"},"license":"MIT","keywords":[],"scripts":{"describe":"npm-scripts-info","build":"run-s clean && run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:tslint":"tslint --fix --project .","test:lint":"tslint --project . && prettier \"src/**/*.ts\" --list-different","test":"jest","test:watch":"jest --watch","test:cov":"jest --coverage && cat ./coverage/lcov.info | codacy-coverage --token a5ea7c309f7543a3b7cfc662c1c88d67 --language typescript","test:debug":"node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand","watch":"run-s clean build:main && run-p \"build:main -- -w\" \"test:unit -- --watch\"","doc":"run-s doc:html && open-cli build/docs/index.html","doc:html":"typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --out build/docs","doc:json":"typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --json build/docs/typedoc.json","doc:publish":"gh-pages -m \"[ci skip] Updates\" -d build/docs","version":"standard-version","reset":"git clean -dfx && git reset --hard && npm i","clean":"trash build test","prepare-release":"run-s reset test cov:check doc:html version doc:publish"},"scripts-info":{"info":"Display information about the package scripts","build":"Clean and rebuild the project","fix":"Try to automatically fix any linting problems","test":"Lint and unit test the project","watch":"Watch and rebuild the project on save, then rerun relevant tests","cov":"Rebuild, run tests, then create and open the coverage report","doc":"Generate HTML API documentation and open it in a browser","doc:json":"Generate API documentation in typedoc JSON format","version":"Bump package.json version, update CHANGELOG.md, tag release","reset":"Delete all untracked files and reset the repo to the last commit","prepare-release":"One-step: clean, build, test, publish docs, and prep a release"},"engines":{"node":">=8.9"},"dependencies":{"@nestjs/common":"^7.4.2","@nestjs/core":"^7.4.2","@nestjs/cqrs":"^7.0.0","axios":"^0.19.2","protobufjs":"^6.10.1","uuid":"^8.3.0"},"peerDependencies":{"node-eventstore-client":"^0.2.16","node-nats-streaming":"^0.3.2"},"devDependencies":{"@bitjson/npm-scripts-info":"^1.0.0","@bitjson/typedoc":"^0.15.0-0","@nestjs/cli":"^6.9.0","@nestjs/schematics":"^6.7.0","@nestjs/testing":"^6.7.1","@types/jest":"^24.0.18","@types/lodash":"^4.14.144","@types/node":"^12.7.5","@types/supertest":"^2.0.8","codecov":"^3.5.0","cz-conventional-changelog":"^2.1.0","gh-pages":"^2.0.1","jest":"^24.9.0","node-eventstore-client":"^0.2.18","node-nats-streaming":"^0.3.2","npm-run-all":"^4.1.5","nyc":"^14.1.1","open-cli":"^5.0.0","prettier":"^1.18.2","remark-cli":"^7.0.0","remark-lint-emphasis-marker":"^1.0.3","remark-lint-strong-marker":"^1.0.3","remark-preset-lint-recommended":"^3.0.3","standard-version":"^6.0.1","supertest":"^4.0.2","trash-cli":"^3.0.0","ts-jest":"^24.1.0","ts-loader":"^6.1.1","ts-node":"^8.4.1","tsconfig-paths":"^3.9.0","tslint":"^5.20.0","tslint-config-prettier":"^1.18.0","tslint-immutable":"^6.0.1","typescript":"^3.5.3"},"jest":{"globals":{"ts-jest":{"diagnostics":false}},"moduleFileExtensions":["js","json","ts"],"rootDir":".","testRegex":".spec.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"coverageDirectory":"./coverage","testEnvironment":"node"},"config":{"commitizen":{"path":"cz-conventional-changelog"}},"prettier":{"singleQuote":true},"nyc":{"extends":"@istanbuljs/nyc-config-typescript","exclude":["**/*.spec.js"]},"gitHead":"1aa7bf033a5cd0c891056e1fb24a6ac15375491a","bugs":{"url":"https://github.com/blueeastcode/nestjs-event-store/issues"},"homepage":"https://github.com/blueeastcode/nestjs-event-store#readme","_id":"@blueeast/nestjs-event-store@3.2.1","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-9BkbvIbmg99fcFoMLyrz1FTVK32LYOljpkoaf15sARa4i02qj/h2uWaiNiR7e8m8gv+VSRZwjK+bKBu2I7oxzA==","shasum":"2b5f0be936f8434fb0aec51689ffc8ba6853345f","tarball":"https://registry.npmjs.org/@blueeast/nestjs-event-store/-/nestjs-event-store-3.2.1.tgz","fileCount":156,"unpackedSize":2000688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA6HaCRA9TVsSAnZWagAA620QAIhVKOgVzyB4qoEyKAAo\nW+kiC2/oTCUnTOXXHF8ahV3zlReZeoOcfYrxIkBFkZvy/Kkcno3+8AktTwEP\nghCllk3b3nuh1aG47rklkBN8t1PQ3L64izLWqTo2mnrtzpitDC0pDk9NiVk2\nS757ulcJnm54nPsbuBfHF75dfqAwdWPF5yud0GikXxg+Te+vnz3oSdPYej10\nX++x4edNVCrsOAqX7tL+R3Jvgw+XKCTh1WB6iEH1nB3rhA/PBJeWwSGZlgmG\ns4Mc2ldiyWiF5rHMB3zMgGF1H8G8f75GCgPXdN5er6jzgLwQGJFFcVwg0j8j\npuXjjTqB7mz01fyHUshMjKSWFLIFI6HDp4tQW8stBW5PatLUp5vJYXTl6C+7\n62aaPOxQtw1aJGGMzJ/2e5ZTPIqv9udhKPPM83nJ10f0IW2a4ZhkdcRb78d/\nknYHASYi4jLrlvvOJybMOWkikNsBDXumamnCdtGIHlpvuvxtPWNMXUl/5lLZ\ngQYIrN77oonTXNRcOjjHsAQi4HtznobHr51PnsSZ453BbL3opgR9lAF+PzWQ\nMbO12nn4AqUZHoRjoufLm+mBc9Zu+B/gLGQgkXL7pYy5VaqOOq+Qm1aRZN/4\nKDhtoHygbgyqFakxBOuIFHRhZNh9uUhggud8M/Oeo/QJoOweCLQnnzqPYDsH\nzg8F\r\n=YzbJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCY1zcsE0ctfVfy5/SAJdBtwssPlrCgjxNvRf1jRuvJagIgPNHH3GNbxLATYJEYkx4IVCpGk330XbsLBVp0scQJESg="}]},"_npmUser":{"name":"artalat","email":"rehman.talat@gmail.com"},"directories":{},"maintainers":[{"name":"artalat","email":"rehman.talat@gmail.com"},{"name":"abubakarsaddique","email":"abubakar.mani1@gmail.com"},{"name":"bluebase-release-bot","email":"bluebase-release-bot@blueeast.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-event-store_3.2.1_1644405210663_0.5122510168561409"},"_hasShrinkwrap":false},"4.0.0":{"name":"@blueeast/nestjs-event-store","version":"4.0.0","description":"NestJS CQRS module for EventStore.org CQRS","author":{"name":"Rex Isaac Raphael","email":"rex.rahael@outlook.com","url":"https://xraph.com"},"main":"build/main/index.js","typings":"build/main/index.d.ts","module":"build/module/index.js","repository":{"type":"git","url":"git+https://github.com/blueeastcode/nestjs-event-store.git"},"license":"MIT","keywords":[],"scripts":{"describe":"npm-scripts-info","build":"run-s clean && run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","fix":"run-s fix:*","fix:prettier":"prettier \"src/**/*.ts\" --write","fix:tslint":"tslint --fix --project .","test:lint":"tslint --project . && prettier \"src/**/*.ts\" --list-different","test":"jest","test:watch":"jest --watch","test:cov":"jest --coverage && cat ./coverage/lcov.info | codacy-coverage --token a5ea7c309f7543a3b7cfc662c1c88d67 --language typescript","test:debug":"node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand","watch":"run-s clean build:main && run-p \"build:main -- -w\" \"test:unit -- --watch\"","doc":"run-s doc:html && open-cli build/docs/index.html","doc:html":"typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --out build/docs","doc:json":"typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --json build/docs/typedoc.json","doc:publish":"gh-pages -m \"[ci skip] Updates\" -d build/docs","version":"standard-version","reset":"git clean -dfx && git reset --hard && npm i","clean":"trash build test","prepare-release":"run-s reset test cov:check doc:html version doc:publish"},"scripts-info":{"info":"Display information about the package scripts","build":"Clean and rebuild the project","fix":"Try to automatically fix any linting problems","test":"Lint and unit test the project","watch":"Watch and rebuild the project on save, then rerun relevant tests","cov":"Rebuild, run tests, then create and open the coverage report","doc":"Generate HTML API documentation and open it in a browser","doc:json":"Generate API documentation in typedoc JSON format","version":"Bump package.json version, update CHANGELOG.md, tag release","reset":"Delete all untracked files and reset the repo to the last commit","prepare-release":"One-step: clean, build, test, publish docs, and prep a release"},"engines":{"node":">=14"},"dependencies":{"node-eventstore-client":"^0.2.16","node-nats-streaming":"^0.3.2","uuid":"^8.3.0"},"peerDependencies":{"@nestjs/common":"^9.0.0","@nestjs/core":"^9.0.0","@nestjs/cqrs":"^9.0.0","reflect-metadata":"^0.1.13","rxjs":"^7.1.0"},"devDependencies":{"@bitjson/npm-scripts-info":"^1.0.0","@bitjson/typedoc":"^0.15.0-0","@nestjs/common":"^9.0.0","@nestjs/core":"^9.0.0","@nestjs/cqrs":"^9.0.0","@nestjs/cli":"^9.0.0","@nestjs/testing":"^9.0.0","@types/jest":"^28.0.0","@types/lodash":"^4.14.144","@types/node":"^12.7.5","@types/supertest":"^2.0.8","codecov":"^3.5.0","cz-conventional-changelog":"^2.1.0","gh-pages":"^2.0.1","jest":"^28.1.2","npm-run-all":"^4.1.5","nyc":"^14.1.1","open-cli":"^5.0.0","prettier":"^1.18.2","remark-cli":"^7.0.0","remark-lint-emphasis-marker":"^1.0.3","remark-lint-strong-marker":"^1.0.3","remark-preset-lint-recommended":"^3.0.3","standard-version":"^6.0.1","supertest":"^4.0.2","trash-cli":"^3.0.0","ts-jest":"^28.0.0","ts-loader":"^6.1.1","ts-node":"^8.4.1","tsconfig-paths":"^3.9.0","tslint":"^5.20.0","tslint-config-prettier":"^1.18.0","tslint-immutable":"^6.0.1","typescript":"^4.7.4"},"jest":{"globals":{"ts-jest":{"diagnostics":false}},"moduleFileExtensions":["js","json","ts"],"rootDir":".","testRegex":".spec.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"coverageDirectory":"./coverage","testEnvironment":"node"},"config":{"commitizen":{"path":"cz-conventional-changelog"}},"prettier":{"singleQuote":true},"nyc":{"extends":"@istanbuljs/nyc-config-typescript","exclude":["**/*.spec.js"]},"gitHead":"f0f2a4b79f8d60e9d5fae89ce7180fb9ae4d1eef","bugs":{"url":"https://github.com/blueeastcode/nestjs-event-store/issues"},"homepage":"https://github.com/blueeastcode/nestjs-event-store#readme","_id":"@blueeast/nestjs-event-store@4.0.0","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-HtieWBTDrLMStyvO6XMJEoxCXXbGti7OutUntECFgrjw3RVRhybANEQ0zm62iHyaUGtz+5Ahk6C2xH3VPkTv/g==","shasum":"4f3648b8e15ea2c252ec5720dc2011b569c27671","tarball":"https://registry.npmjs.org/@blueeast/nestjs-event-store/-/nestjs-event-store-4.0.0.tgz","fileCount":116,"unpackedSize":340106,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNAQJIDNkYQemF+8h5hEmORJmrmNY6ksKGN/Xy2NHN2gIgC1rxYoGt8MBLmFyT41eL2PFjzuJ8yHiJ0PKpTtuBJDw="}]},"_npmUser":{"name":"artalat","email":"rehman.talat@gmail.com"},"directories":{},"maintainers":[{"name":"artalat","email":"rehman.talat@gmail.com"},{"name":"abubakarsaddique","email":"abubakar.mani1@gmail.com"},{"name":"bluebase-release-bot","email":"bluebase-release-bot@blueeast.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-event-store_4.0.0_1686648558838_0.2367441736071445"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-09T11:03:58.391Z","3.2.0":"2022-02-09T11:03:58.706Z","modified":"2023-06-13T09:29:19.255Z","3.2.1":"2022-02-09T11:13:30.876Z","4.0.0":"2023-06-13T09:29:19.131Z"},"maintainers":[{"name":"artalat","email":"rehman.talat@gmail.com"},{"name":"abubakarsaddique","email":"abubakar.mani1@gmail.com"},{"name":"bluebase-release-bot","email":"bluebase-release-bot@blueeast.com"}],"description":"NestJS CQRS module for EventStore.org CQRS","homepage":"https://github.com/blueeastcode/nestjs-event-store#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/blueeastcode/nestjs-event-store.git"},"author":{"name":"Rex Isaac Raphael","email":"rex.rahael@outlook.com","url":"https://xraph.com"},"bugs":{"url":"https://github.com/blueeastcode/nestjs-event-store/issues"},"license":"MIT","readme":"<h1 align=\"center\">\nNestJs Event Store\n</h1>\n  \n<p align=\"center\">\n  NestJS CQRS module with support EventStore.org and NATS Streaming. It requires @nestjs/cqrs.\n</p>\n    <p align=\"center\">\n</p>\n\n<p align=\"center\">\n<a href=\"https://www.npmjs.com/package/@juicycleff/nestjs-event-store\" target=\"_blank\"><img src=\"https://img.shields.io/npm/v/@juicycleff/nestjs-event-store?style=flat-square\" alt=\"NPM Version\"/></a>\n<a href=\"https://img.shields.io/npm/l/@juicycleff/nestjs-event-store?style=flat-square\" target=\"_blank\"><img src=\"https://img.shields.io/npm/l/@juicycleff/nestjs-event-store?style=flat-square\" alt=\"License\"/></a>\n<a href=\"https://img.shields.io/github/languages/code-size/juicycleff/nestjs-event-store?style=flat-square\" target=\"_blank\"><img src=\"https://img.shields.io/github/languages/code-size/juicycleff/nestjs-event-store?style=flat-square\" alt=\"Code Size\"/></a>\n<a href=\"https://img.shields.io/github/languages/top/juicycleff/nestjs-event-store?style=flat-square\" target=\"_blank\"><img src=\"https://img.shields.io/github/languages/top/juicycleff/nestjs-event-store?style=flat-square\" alt=\"Top Language\"/></a>\n<a href=\"https://img.shields.io/codacy/grade/0944a2f07aca403da4d4637606af7478?style=flat-square\" target=\"_blank\"><img src=\"https://img.shields.io/codacy/grade/dc460840375d4ac995f5647a5ed10179?style=flat-square\" alt=\"Top Language\"/></a>\n</p>\n\n## Installation\n\n```bash\n$ yarn add @juicycleff/nestjs-event-store\n$ yarn add node-nats-streaming node-eventstore-client\n```\n\n## Description\nThis module aims to bridge the gap between NestJs and popular event store brokers like [Event Store](https://eventstore.org) and [NATS Streaming](https://nats.io) with support for kafka coming.\n\n#### [Event Store](https://eventstore.org)\nIt supports all different subscription strategies in EventStore.Org,\nsuch as Volatile, CatchUp and Persistent subscriptions fairly easily. There is support for a storage adapter interface for storing catchup events type last checkpoint position, so\nthe checkpoint can be read on start up; The adapter interface is very slim and easy and can be assigned preferably using the `EventStoreModule.registerFeatureAsync` method.\nAdapter data store examples coming soon.\n\nNote: if your event broker type is Event Store then featureStreamName should look like `'$ce-user'`, then you should name your domain argument should be `user` without `$ce`, for example.\n\n```typescript\nexport class UserCreatedEvent implements IEvent {\n    constructor(\n        public readonly user: any // This what im talking about.\n    )  { }\n}\n```\nThe way this works is we group the event based the first argument in the constructor name and this argument name must be a substring of featureStreamName. I'm sorry you can't pass you your own unique name at the moment, but I will add support for it\n\n#### [NATS Streaming](https://nats.io)\nIt supports all both durable/persistent subscription with shared subscription and volatile. It does not have the limitations of [Event Store](https://eventstore.org) stated above.\n\nNote: if your event broker type is NATS then featureStreamName  should look like `'user'`.\n\n### Setup from versions from `v3.1.15`\n#### Setup NATS\n##### Setup root app module for NATS\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { EventStoreModule } from '@juicycleff/nestjs-event-store';\n\n@Module({\n  imports: [\n    EventStoreModule.register({\n      type: 'nats',\n      groupId: 'groupId',\n      clusterId: 'clusterId',\n      clientId: 'clientId', // Optional (Auto generated with uuid)\n      options: {\n        url: 'nats://localhost:4222',\n        reconnect: true,\n        maxReconnectAttempts: -1,\n      },\n    }),\n  ]\n})\nexport class AppModule {}\n```\n\n##### Setup async root app module\n```typescript\nimport { Module } from '@nestjs/common';\nimport { EventStoreModule } from '@juicycleff/nestjs-event-store';\nimport { EventStoreConfigService } from './eventstore-config.service';\n\n@Module({\n  imports: [\n    EventStoreModule.registerAsync({\n      type: 'nats',\n      useClass: EventStoreConfigService\n    }),\n  ]\n})\nexport class AppModule {}\n```\n\n##### Setup feature module\n```typescript\nimport { Module } from '@nestjs/common';\nimport { UsersController } from './users.controller';\nimport { AccountEventHandlers, UserLoggedInEvent } from '@ultimatebackend/core';\nimport { AccountSagas } from '../common';\nimport { EventStoreModule, EventStoreSubscriptionType } from '@juicycleff/nestjs-event-store';\n\n@Module({\n  imports: [\n    EventStoreModule.registerFeature({\n      featureStreamName: 'user',\n      type: 'nats',\n      subscriptions: [\n        {\n          type: EventStoreSubscriptionType.Persistent,\n          stream: 'account',\n          durableName: 'svc-user',\n        }\n      ],\n      eventHandlers: {\n        UserLoggedInEvent: (data) => new UserLoggedInEvent(data),\n      },\n    })\n  ],\n  providers: [...AccountEventHandlers, AccountSagas],\n  controllers: [UsersController],\n})\nexport class UsersModule {}\n```\n\n#### Setup EventStore\n##### Setup root app module for EventStore\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { EventStoreModule } from '@juicycleff/nestjs-event-store';\n\n@Module({\n  imports: [\n    EventStoreModule.register({\n      type: 'event-store',\n      tcpEndpoint: {\n        host: 'localhost',\n        port: 1113,\n      },\n      options: {\n        maxRetries: 1000, // Optional\n        maxReconnections: 1000,  // Optional\n        reconnectionDelay: 1000,  // Optional\n        heartbeatInterval: 1000,  // Optional\n        heartbeatTimeout: 1000,  // Optional\n        defaultUserCredentials: {\n          password: 'admin',\n          username: 'chnageit',\n        },\n      },\n    }),\n  ]\n})\nexport class AppModule {}\n```\n\n##### Setup async root app module\n```typescript\nimport { Module } from '@nestjs/common';\nimport { EventStoreModule } from '@juicycleff/nestjs-event-store';\nimport { EventStoreConfigService } from './eventstore-config.service';\n\n@Module({\n  imports: [\n    EventStoreModule.registerAsync({\n      type: 'event-store',\n      useClass: EventStoreConfigService\n    }),\n  ]\n})\nexport class AppModule {}\n```\n\n##### Setup feature module\n```typescript\nimport { Module } from '@nestjs/common';\nimport { CommandBus, CqrsModule, EventBus } from '@nestjs/cqrs';\nimport { EventStoreModule, EventStore, EventStoreSubscriptionType } from '@juicycleff/nestjs-event-store';\n\nimport {\n  UserCommandHandlers,\n  UserLoggedInEvent,\n  UserEventHandlers,\n  UserQueryHandlers,\n} from '../cqrs';\nimport { UserSagas } from './sagas';\nimport { MongoStore } from './mongo-eventstore-adapter';\n\n@Module({\n  imports: [\n    CqrsModule,\n    EventStoreModule.registerFeature({\n      featureStreamName: '$ce-user',\n      type: 'event-store',\n      store: MongoStore, // Optional mongo store for persisting catchup events position for microservices to mitigate failures. Must implement IAdapterStore\n      subscriptions: [\n        {\n          type: EventStoreSubscriptionType.CatchUp,\n          stream: '$ce-user',\n          resolveLinkTos: true, // Default is true (Optional)\n          lastCheckpoint: 13, // Default is 0 (Optional)\n        },\n      ],\n      eventHandlers: {\n        UserLoggedInEvent: (data) => new UserLoggedInEvent(data),\n      },\n    }),\n  ],\n  \n  providers: [\n    UserSagas,\n    ...UserQueryHandlers,\n    ...UserCommandHandlers,\n    ...UserEventHandlers,\n  ],\n})\nexport class UserModule {}\n```\n\n### Setup from versions from `v3.0.0 to 3.0.5`\n##### Setup root app module\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { EventStoreModule } from '@juicycleff/nestjs-event-store';\n\n@Module({\n  imports: [\n    EventStoreModule.register({\n      tcpEndpoint: {\n        host: process.env.ES_TCP_HOSTNAME || AppConfig.eventstore?.hostname,\n        port: parseInt(process.env.ES_TCP_PORT, 10) || AppConfig.eventstore?.tcpPort,\n      },\n      options: {\n        maxRetries: 1000, // Optional\n        maxReconnections: 1000,  // Optional\n        reconnectionDelay: 1000,  // Optional\n        heartbeatInterval: 1000,  // Optional\n        heartbeatTimeout: 1000,  // Optional\n        defaultUserCredentials: {\n          password: AppConfig.eventstore?.tcpPassword,\n          username: AppConfig.eventstore?.tcpUsername,\n        },\n      },\n    }),\n  ]\n})\nexport class AppModule {}\n```\n\n##### Setup async root app module\n```typescript\nimport { Module } from '@nestjs/common';\nimport { EventStoreModule } from '@juicycleff/nestjs-event-store';\nimport { EventStoreConfigService } from './eventstore-config.service';\n\n@Module({\n  imports: [\n    EventStoreModule.registerAsync({\n      useClass: EventStoreConfigService\n    }),\n  ]\n})\nexport class AppModule {}\n```\n\n## Setup module\n*Note* `featureStreamName` field is not important if you're subscription type is persistent'\n\n##### Setup feature module\n```typescript\nimport { Module } from '@nestjs/common';\nimport { CommandBus, CqrsModule, EventBus } from '@nestjs/cqrs';\nimport { EventStoreModule, EventStore, EventStoreSubscriptionType } from '@juicycleff/nestjs-event-store';\n\nimport {\n  UserCommandHandlers,\n  UserCreatedEvent,\n  UserEventHandlers,\n  UserQueryHandlers,\n} from '../cqrs';\nimport { UserSagas } from './sagas';\nimport { MongoStore } from './mongo-eventstore-adapter';\n\n@Module({\n  imports: [\n    CqrsModule,\n    EventStoreModule.registerFeature({\n      featureStreamName: '$ce-user',\n      store: MongoStore, // Optional mongo store for persisting catchup events position for microservices to mitigate failures. Must implement IAdapterStore\n      subscriptions: [\n        {\n          type: EventStoreSubscriptionType.CatchUp,\n          stream: '$ce-user',\n          resolveLinkTos: true, // Default is true (Optional)\n          lastCheckpoint: 13, // Default is 0 (Optional)\n        },\n        {\n          type: EventStoreSubscriptionType.Volatile,\n          stream: '$ce-user',\n        },\n        {\n          type: EventStoreSubscriptionType.Persistent,\n          stream: '$ce-user',\n          persistentSubscriptionName: 'steamName',\n          resolveLinkTos: true,  // Default is true (Optional)\n        },\n      ],\n      eventHandlers: {\n        UserLoggedInEvent: (data) => new UserLoggedInEvent(data),\n        UserRegisteredEvent: (data) => new UserRegisteredEvent(data),\n        EmailVerifiedEvent: (data) => new EmailVerifiedEvent(data),\n      },\n    }),\n  ],\n  \n  providers: [\n    UserSagas,\n    ...UserQueryHandlers,\n    ...UserCommandHandlers,\n    ...UserEventHandlers,\n  ],\n})\nexport class UserModule {}\n```\n\n##### Setup async feature module\n```typescript\nimport { Module } from '@nestjs/common';\nimport { EventStoreModule } from '@juicycleff/nestjs-event-store';\nimport { EventStoreFeatureService } from './user-eventstore-feature.service';\n\n@Module({\n  imports: [\n    EventStoreModule.registerFeatureAsync({\n      useClass: EventStoreFeatureService\n    }),\n  ]\n})\nexport class AppModule {}\n```\n\n### Setup from versions below `v2.0.0`\n#### Setup root app module\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { NestjsEventStoreModule } from '@juicycleff/nestjs-event-store';\n\n@Module({\n  imports: [\n    NestjsEventStoreModule.forRoot({\n      http: {\n        port: parseInt(process.env.ES_HTTP_PORT, 10),\n        protocol: process.env.ES_HTTP_PROTOCOL,\n      },\n      tcp: {\n        credentials: {\n          password: process.env.ES_TCP_PASSWORD,\n          username: process.env.ES_TCP_USERNAME,\n        },\n        hostname: process.env.ES_TCP_HOSTNAME,\n        port: parseInt(process.env.ES_TCP_PORT, 10),\n        protocol: process.env.ES_TCP_PROTOCOL,\n      },\n    }),\n  ]\n})\nexport class AppModule {}\n```\n\n#### Setup module\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { CommandBus, CqrsModule, EventBus } from '@nestjs/cqrs';\nimport { NestjsEventStoreModule, EventStore } from '@juicycleff/nestjs-event-store';\n\nimport {\n  UserCommandHandlers,\n  UserCreatedEvent,\n  UserEventHandlers,\n  UserQueryHandlers,\n} from '../cqrs';\nimport { UserSagas } from './sagas';\n\n@Module({\n  imports: [\n    CqrsModule,\n    NestjsEventStoreModule.forFeature({\n      name: 'user',\n      resolveLinkTos: false,\n    }),\n  ],\n  \n  providers: [\n    UserSagas,\n    ...UserQueryHandlers,\n    ...UserCommandHandlers,\n    ...UserEventHandlers,\n  ],\n})\nexport class UserModule {\n  constructor(\n    private readonly command$: CommandBus,\n    private readonly event$: EventBus,\n    private readonly eventStore: EventStore,\n  ) {}\n\n  onModuleInit(): any {\n    this.eventStore.setEventHandlers(this.eventHandlers);\n    this.eventStore.bridgeEventsTo((this.event$ as any).subject$);\n    this.event$.publisher = this.eventStore;\n  }\n\n  eventHandlers = {\n    UserCreatedEvent: (data) => new UserCreatedEvent(data),\n  };\n}\n```\n\n\n## Notice\n `2.0.0` release inspired by [nestjs-eventstore](https://github.com/daypaio/nestjs-eventstore)\n\n## License\n\n  This project is [MIT licensed](LICENSE).\n","readmeFilename":"README.md"}