{"_id":"@digikare/nestjs-azure-eventhub","_rev":"7-80c70744a95b010680605468c4a2f9f3","name":"@digikare/nestjs-azure-eventhub","dist-tags":{"next":"0.1.3","latest":"1.0.0"},"versions":{"0.1.1":{"name":"@digikare/nestjs-azure-eventhub","version":"0.1.1","description":"EventHub transport module for nestjs microservice","homepage":"https://github.com/digikare/monorepo-libs#readme","main":"dist/index.js","license":"MIT","author":{"name":"Tieu Philippe KHIM","email":"pkhim@digikare.com"},"contributors":[{"name":"Mathieu BUSOLIN","email":"mbusolin@digikare.com"}],"publishConfig":{"access":"public","tag":"next"},"scripts":{"prebuild":"rimraf dist","build":"tsc -p tsconfig.build.json","clean":"rimraf dist","dev":"tsc -p tsconfig.json --watch","format":"prettier --write \"lib/**/*.ts\" \"tests/**/*.ts\"","lint":"eslint -f codeframe --fix","test":"jest --config ./tests/jest.json --runInBand","test:watch":"jest --watch","test:cov":"jest --coverage","test:debug":"node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand","test:e2e":"jest --config ./test/jest-e2e.json","precommit":"lint-staged"},"dependencies":{"@azure/event-hubs":"^5.2.2","@nestjs/microservices":"^7.4.4","@nestjs/platform-express":"^7.1.1","debug":"^4.1.1","minimatch":"^3.0.4","reflect-metadata":"^0.1.13","rimraf":"^3.0.2","rxjs":"^6.5.5","supports-color":"^7.2.0","testing":"^2.0.1"},"devDependencies":{"@nestjs/cli":"^7.2.0","@nestjs/common":"^7.1.1","@nestjs/core":"^7.1.1","@nestjs/schematics":"^7.0.0","@nestjs/testing":"^7.1.1","@shared/eslint-config":"^0.0.0","@types/debug":"^4.1.5","@types/express":"^4.17.6","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/supertest":"^2.0.9","@typescript-eslint/eslint-plugin":"^3.0.2","@typescript-eslint/parser":"^4.6.0","eslint":"^7.1.0","eslint-config-prettier":"^6.11.0","eslint-plugin-import":"^2.20.2","jest":"^26.0.1","lint-staged":"^10.5.0","prettier":"^2.0.5","supertest":"^4.0.2","ts-jest":"^26.1.0","ts-loader":"^7.0.5","ts-node":"^8.10.2","tsconfig-paths":"^3.9.0","typescript":"^3.9.3"},"jest":{"moduleFileExtensions":["js","json","ts"],"rootDir":"src","testRegex":".spec.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["**/*.(t|j)s"],"coverageDirectory":"../coverage","testEnvironment":"node"},"repository":{"type":"git","url":"git+https://github.com/digikare/monorepo-libs.git"},"bugs":{"url":"https://github.com/digikare/monorepo-libs/issues"},"gitHead":"70368be02386a3fbd18fa4e0c180e4818807d779","_id":"@digikare/nestjs-azure-eventhub@0.1.1","_nodeVersion":"12.18.0","_npmVersion":"lerna/3.22.1/node@v12.18.0+x64 (darwin)","_npmUser":{"name":"spike008t","email":"khim.tieu.philippe@gmail.com"},"dist":{"integrity":"sha512-+mOtnDT26RLUmgXN6B6pWeFG8iATDRdOJ9R1cJ64Wz7SChy9gJixji6Dt1AmXfJSq9hUGC6lqGuX6lYLRCPsvQ==","shasum":"e02022ed3a03597f834730d27a54cd176394bf5b","tarball":"https://registry.npmjs.org/@digikare/nestjs-azure-eventhub/-/nestjs-azure-eventhub-0.1.1.tgz","fileCount":44,"unpackedSize":69505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn/bqCRA9TVsSAnZWagAAFGcP+wcc7TPDDDQjF7G9pIEY\nx6vuFROBdugFAst/f7pusSqcm1r7OO1QKKrbMeGlbwWP85eXwlSqNu4blIlM\nwZ/gDaLMJZlWZ/VJDvmUQ9Gn2Cnzr4HPtDCSzkSQoYmCyXD/SQv6v4ev6ulK\nom7+JxLIEVEwRX1Ip/+LW8SKDn288Wx4Xk5/I91mZr6EmOTtuWUwZKxVmpt3\n7+j9heXdqsoWdjb7doKWuhQ6e1d4XjNtkS2kgHxWRGSSERBbzf7ZmyQS5cEf\nZJZivxD3EPBkTWi7gvDPFtMUq8ax4pdegmG7vdNYCrJoHOFqeMZMXJ6VE8FD\n8PDBqlGKO657TwfSqQQyyzweXRCxpTm1VhFSsTKEfblZJlN8VvlCdJAN5DQi\nCO0ZjI/ay4UJTaJaxtOGSRrZzDRNRPwWnPmLH2xYZAniBNEuhonpZBFFWxgB\nS1gqlXHWx931INS0WvStd9AcHeEQI2eZo5nu9lbvOrkZ8OeH6vcfMSnJxqFW\nDYbbmxvA0QpRDADcFMFZuF71HANzrYZJBwenGYZ7rpskm3aBIZRCNFisy83t\nVanRjtF8wkkWoIdc5b+immIBNnwN1ekPmSwXnoo8Cv0/aV3+3IrnHPiJKekw\nBcsnUbKIW6jqsvvoKTfgHslBiJtBt7F3paSaupOGERChlxLF55Pm425XA2XU\n112N\r\n=ryuQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuq699uhJJVrhbm1GGF0FVSwGjBeNaIMnQH+pmdZnNfgIhAJB0+cbfagIjuYll8ezCddfIZrS5EKX4XDIkulOj8/p7"}]},"maintainers":[{"name":"workfel","email":"workfel@gmail.com"},{"name":"spike008t","email":"khim.tieu.philippe@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-azure-eventhub_0.1.1_1604318953894_0.7365260141173249"},"_hasShrinkwrap":false},"0.1.2":{"name":"@digikare/nestjs-azure-eventhub","version":"0.1.2","description":"EventHub transport module for nestjs microservice","homepage":"https://github.com/digikare/monorepo-libs#readme","main":"dist/index.js","license":"MIT","author":{"name":"Tieu Philippe KHIM","email":"pkhim@digikare.com"},"contributors":[{"name":"Mathieu BUSOLIN","email":"mbusolin@digikare.com"}],"publishConfig":{"access":"public","tag":"next"},"scripts":{"prebuild":"rimraf dist","build":"tsc -p tsconfig.build.json","clean":"rimraf dist","dev":"tsc -p tsconfig.json --watch","format":"prettier --write \"lib/**/*.ts\" \"tests/**/*.ts\"","lint":"eslint -f codeframe --fix","test":"jest --config ./tests/jest.json --runInBand","test:watch":"jest --watch","test:cov":"jest --coverage","test:debug":"node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand","test:e2e":"jest --config ./test/jest-e2e.json","precommit":"lint-staged"},"peerDependencies":{"@nestjs/microservices":"^7.1.1","@nestjs/platform-express":"^7.1.1"},"dependencies":{"@azure/event-hubs":"^5.2.2","@azure/eventhubs-checkpointstore-blob":"^1.0.1","@azure/storage-blob":"^12.2.1","debug":"^4.1.1","minimatch":"^3.0.4","reflect-metadata":"^0.1.13","rimraf":"^3.0.2","rxjs":"^6.5.5","supports-color":"^7.2.0","testing":"^2.0.1"},"devDependencies":{"@nestjs/cli":"^7.2.0","@nestjs/common":"^7.1.1","@nestjs/core":"^7.1.1","@nestjs/schematics":"^7.0.0","@nestjs/testing":"^7.1.1","@shared/eslint-config":"^0.0.0","@types/debug":"^4.1.5","@types/express":"^4.17.6","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/supertest":"^2.0.9","@typescript-eslint/eslint-plugin":"^3.0.2","@typescript-eslint/parser":"^4.6.0","eslint":"^7.1.0","eslint-config-prettier":"^6.11.0","eslint-plugin-import":"^2.20.2","jest":"^26.0.1","lint-staged":"^10.5.0","prettier":"^2.0.5","supertest":"^4.0.2","ts-jest":"^26.1.0","ts-loader":"^7.0.5","ts-node":"^8.10.2","tsconfig-paths":"^3.9.0","typescript":"^3.9.3"},"jest":{"moduleFileExtensions":["js","json","ts"],"rootDir":"src","testRegex":".spec.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["**/*.(t|j)s"],"coverageDirectory":"../coverage","testEnvironment":"node"},"repository":{"type":"git","url":"git+https://github.com/digikare/monorepo-libs.git"},"bugs":{"url":"https://github.com/digikare/monorepo-libs/issues"},"gitHead":"71ed9a095b4b53a52380c4670c05758d0d2eb72b","_id":"@digikare/nestjs-azure-eventhub@0.1.2","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (darwin)","_npmUser":{"name":"spike008t","email":"khim.tieu.philippe@gmail.com"},"dist":{"integrity":"sha512-KddauTr3vpS1M2mLzpGNEATH4I1g9dwkDShhBbFx+jZ3kf4hlrWLPCVYrbiQiV4mgUxcq9O52H5HVVe1xP/vPQ==","shasum":"16e8f0513138ffff9a1283e52ab692071ba1f05f","tarball":"https://registry.npmjs.org/@digikare/nestjs-azure-eventhub/-/nestjs-azure-eventhub-0.1.2.tgz","fileCount":40,"unpackedSize":67954,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpTTrCRA9TVsSAnZWagAANV8P/1Xo830bPHCIeac02H7u\n9eamsRMlVNwDGElm/N0x9e51mjtMdTDTsv/8UVLh9cRSrRE4ELwsNxN7e8A4\nXMwKgmrlTnsZpbWhugrDNe3e81oUB4ZDum+sWI+qpSXN0g3G5iTjrEHQfDq5\nXd8WmzOmYCgsbLXZUSDeZzwucU1c8PuGE+XpAylRa2opukpDM41jW3WWvH5B\naaKOngZG1Aj1234a/3aHWWtFTuKxZvPuO122ZyfJ6YKdN19lglohp1i8Tq2T\n8o5TqFBFW1CI1DK9cTRqKvrTYKgoQhMZTZYjwnqjeY6fZbcngbszM54Tymc0\n31mYjXwrR7KPiLgA+0VL8L0AhMuQAwaAvVfGNgZYheeplI6BbB9a1xQpjPXl\nb5ewOeVRK20kZIEAJGPMY8Nb4575Xwl8J43yNuASro28p8aXlxnlo8ciPUk+\nOeWJHiNCLKWR/KLaPnTFRwYuzLBEcpWDxCcn0uSfpQSFxkdrmZSQleQuItk7\n1MimJpzWtnuJkkDGg0vJs+m6A5YslkwCRcDsVDh3HW9wDCNyZW2qKZJ5V9AC\nnZ5SkvDi0TO0cjvzJD3jcTEfGZupgDTjoGgiK2KhlA7XHXnUYiQo6FPGSYUX\ndwFzU6sTDv1Up8L+ivPyk6LQzvluJpXFudBj6IoMMyVluSTkuVkhxAsIsYB+\nC/4s\r\n=LhoO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD347dNDoARK93DGzzRBGPq1uDxU2RyaPUxNoXlLr/yHgIgUA7eYbJvPiFcctFv3+Xt4agxsL4uK4JKamNRlix4dyk="}]},"directories":{},"maintainers":[{"name":"workfel","email":"workfel@gmail.com"},{"name":"spike008t","email":"khim.tieu.philippe@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-azure-eventhub_0.1.2_1604662506750_0.9854218652355318"},"_hasShrinkwrap":false},"0.1.3":{"name":"@digikare/nestjs-azure-eventhub","version":"0.1.3","description":"EventHub transport module for nestjs microservice","homepage":"https://github.com/digikare/monorepo-libs#readme","main":"dist/index.js","license":"MIT","author":{"name":"Tieu Philippe KHIM","email":"pkhim@digikare.com"},"contributors":[{"name":"Mathieu BUSOLIN","email":"mbusolin@digikare.com"}],"publishConfig":{"access":"public","tag":"next"},"scripts":{"prebuild":"rimraf dist","build":"tsc -p tsconfig.build.json","clean":"rimraf dist","dev":"tsc -p tsconfig.build.json --watch","format":"prettier --write \"lib/**/*.ts\" \"tests/**/*.ts\"","lint":"eslint -f codeframe --fix","test":"jest --config ./tests/jest.json --runInBand","test:watch":"jest --watch","test:cov":"jest --coverage","test:debug":"node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand","test:e2e":"jest --config ./test/jest-e2e.json","precommit":"lint-staged"},"peerDependencies":{"@nestjs/microservices":"^7.0.0","@nestjs/platform-express":"^7.0.0","rxjs":"^6.0.0"},"dependencies":{"@azure/event-hubs":"^5.2.2","@azure/eventhubs-checkpointstore-blob":"^1.0.1","@azure/storage-blob":"^12.2.1","debug":"^4.1.1","minimatch":"^3.0.4","reflect-metadata":"^0.1.13","rimraf":"^3.0.2","supports-color":"^7.2.0","testing":"^2.0.1"},"devDependencies":{"@nestjs/cli":"^7.2.0","@nestjs/common":"^7.1.1","@nestjs/core":"^7.1.1","@nestjs/schematics":"^7.0.0","@nestjs/testing":"^7.1.1","@shared/eslint-config":"^0.0.0","@types/debug":"^4.1.5","@types/express":"^4.17.6","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/supertest":"^2.0.9","@typescript-eslint/eslint-plugin":"^3.0.2","@typescript-eslint/parser":"^4.6.0","eslint":"^7.1.0","eslint-config-prettier":"^6.11.0","eslint-plugin-import":"^2.20.2","jest":"^26.0.1","lint-staged":"^10.5.0","prettier":"^2.0.5","rxjs":"^6.0.0","supertest":"^4.0.2","ts-jest":"^26.1.0","ts-loader":"^7.0.5","ts-node":"^8.10.2","tsconfig-paths":"^3.9.0","typescript":"^3.9.3"},"jest":{"moduleFileExtensions":["js","json","ts"],"rootDir":"src","testRegex":".spec.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["**/*.(t|j)s"],"coverageDirectory":"../coverage","testEnvironment":"node"},"repository":{"type":"git","url":"git+https://github.com/digikare/monorepo-libs.git"},"bugs":{"url":"https://github.com/digikare/monorepo-libs/issues"},"gitHead":"1748fc3951c9901193aee38b3b897899ea9d48ff","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<h1 align=\"center\">\n  Digikare nestjs-azure-eventhub\n</h1>\n<p align=\"center\">\n  Transport component for NestJS microservice\n</p>\n\n<p align=\"center\">\n  The librairies is used and maintained by <a href=\"https://www.digikare.com\">digikare</a> team. We are open for all contributions!\n</p>\n\n## Description\n\n`@digikare/nestjs-azure-eventhub` is a transport component provide [Event Hub](https://docs.microsoft.com/fr-fr/azure/event-hubs/event-hubs-about) into [Nest microservice](https://github.com/nestjs/nest)\n\n## Installation\n\n```bash\n$ npm install @digikare/nestjs-azure-eventhub\n\n# or yarn\n\n$ yarn add @digikare/nestjs-azure-eventhub\n```\n\n## How to use\n\n### Microservice\n\n```typescript\nimport { EventHubServer } from '@digikare/nestjs-azure-eventhub';\n// other imports {...}\n\nconst app = await NestFactory.createMicroservice(ApplicationModule, {\n  startegy: new EventHubServer(\n    '<connection_string>',        // the connection string\n    '<event_hub_name>',           // the event hub name\n    '<optional_consumer_group>',  // optionnal: The consumer group, the default value is $Default\n  ),\n});\n```\n\nYou can also define a specific partitionId to listen if needed (useful for dev/test env).\n\n```typescript\nimport { EventHubServer } from '@digikare/nestjs-azure-eventhub';\n// other imports {...}\n\nconst app = await NestFactory.createMicroservice(ApplicationModule, {\n  startegy: new EventHubServer(\n    '<connection_string>',          // the connection string\n    '<event_hub_name>',             // the event hub name\n    '<optional_consumer_group>',    // optionnal: The consumer group, the default value is $Default\n    {\n      partitionId: '<partition_id>' // optional: the partitionId to listen\n    }\n  ),\n});\n```\n\nAnd now you can use `@EventPattern()` and `@MessagePattern()` decorators!\n\n#### Checkpoint store\n\nSince 0.1.2, you can add a checkpoint store, that allow your app to treat pending message.\n\nYou will need an azure account storage in order to make it works.\n\n```typescript\nimport { EventHubServer } from '@digikare/nestjs-azure-eventhub';\n// other imports {...}\n\nconst app = await NestFactory.createMicroservice(ApplicationModule, {\n  startegy: new EventHubServer(\n    '<connection_string>',            // the connection string\n    '<event_hub_name>',               // the event hub name\n    '<optional_consumer_group>',      // optionnal: The consumer group, the default value is $Default\n    {\n      partitionId: '<partition_id>',  // optional: the partitionId to listen\n      checkpointStore: {\n        connectionString: '<checkpoint_account_storage_connection_string>',\n        containerName: '<checkpoint_container_name>',\n      }\n    }\n  ),\n});\n```\n\n#### Wildcard support on pattern\n\nWildcard support on pattern can be usefull. When you receive a message, the client will cut out the topic of the event\nin order to check if handlers are subscribed to these topics.\n\nThe restriction at the moment:\n\n- The wildcard char '*' must be at the end (eg: `audit.*`, 'my.scope.on.*`)\n- The split char is '.'\n\nTo enable, just set `wildcardSuppprt` option to `true`\n\n```typescript\nimport { EventHubServer } from '@digikare/nestjs-azure-eventhub';\n// other imports {...}\n\nconst app = await NestFactory.createMicroservice(ApplicationModule, {\n  startegy: new EventHubServer(\n    '<connection_string>',            // the connection string\n    '<event_hub_name>',               // the event hub name\n    '<optional_consumer_group>',      // optionnal: The consumer group, the default value is $Default\n    {\n      partitionId: '<partition_id>',  // optional: the partitionId to listen\n      wildcardSupport: true,          // <<== Support wildcard\n    }\n  ),\n});\n```\n\n__Examples__\n\nIf you send an event on the following topic : event.subevent.topic\nThe handlePatternMessage will test the following topics :\n- `*`\n- `event.*`\n- `event.subevent`\n- `event.subevent.*`\n- `event.subevent.topic`\n\n### Client\n\n```typescript\nimport { ConfigModule, ConfigService } from '@nestjs/config';\nimport { EventHubClient } from '@digikare/nestjs-azure-eventhub';\n\n@Module({\n  imports: [\n    ConfigModule,\n  ],\n  providers: {\n    {\n      provide: 'EVENT_HUB_CLIENT',\n      inject: [ConfigService],\n      useFactory: (configService: ConfigService) => {\n        const connectionString = configService.get<string>('EVENT_HUB_CONNECTION_STRING');\n        const eventHubName = configService.get<string>('EVENT_HUB_NAME');\n        const partitionId = configService.get<string>('EVENT_HUB_PARTITION_ID'); // optionnal\n\n        return new EventHubClient(\n          connectionString,\n          {\n            eventHubName: eventHubName,\n            partitionId: partitionId, // optional - define partitionId if you want sent to only\n          }\n        );\n      },\n    }\n  },\n})\n```\n\nHint: When you define a partitionId, the configuration will override every message/event to send. Even if you provide a partitionID or partitionKey.\n\n## Build\n\n```bash\n# To install dependencies, first go to root monorepo and run yarn\n$ cd ../../\n$ yarn\n\n# development\n$ cd packages/nestjs-azure-eventhub\n$ yarn build\n\n# watch mode\n$ cd packages/nestjs-azure-eventhub\n$ npm run dev\n```\n\n## License\n\n  This library is under [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).\n","readmeFilename":"README.md","_id":"@digikare/nestjs-azure-eventhub@0.1.3","_nodeVersion":"12.18.0","_npmVersion":"lerna/3.22.1/node@v12.18.0+x64 (darwin)","_npmUser":{"name":"spike008t","email":"khim.tieu.philippe@gmail.com"},"dist":{"integrity":"sha512-Nxr56Wk72ustsxsoPrGDIBNtPjKLDkipMB6ooN9SJg+BFzJphSvd1W/ckiwDunpDc8CRYxuMDSXoWnKvjKhSTA==","shasum":"0e8bf7d60093398900944b198f87af3077d717cc","tarball":"https://registry.npmjs.org/@digikare/nestjs-azure-eventhub/-/nestjs-azure-eventhub-0.1.3.tgz","fileCount":40,"unpackedSize":72049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqWP3CRA9TVsSAnZWagAAt+EQAJdEgK55SVtVORSR7Irf\n1eW1Q+6kB4fuLBWLMaQ7j5rK7Nf0jP9QnUL5FuNl5NKr4eoowf6GakKPJzKk\ntDn2zI5tQlzxRchCP4xLGeb6DzvLk6gsmT9RHCEJH3eiVLKCdoQjz1Iq4gG7\nzRggmlB/onEX/nNC4i1EaOXf4dEixs6DrPON0S2vX4xBubbczxwRTu//kL+P\nxF493MHwLPI+uCGeEU4L2dEg3aqeIJaju1DZKbWZeU6sWwT9QTUO7OMImRtg\nIcUIfVH0X7zclr5LwSoSgNXc8I3Yh2oPZGPDcJgN35kXQRzLvibQV6hDV0JA\nxOazDVr4s4SEsIkJG0R1jpgxIgSJibN9qaJ1cV9GpVREKpe0uGsT3LoSJHmh\nAJZBdDA1YFWGw9Xq6bpSSG8sQ4omWjWmgYUckEKkP6yvV3gPDIQCTKGScEJV\nrSOyyMFPVGt4qKdPLFAX9VFR3ol1BOQIh4tU0jhwXeVZ7J3o1owIOZRIu+fP\nr9iFKBhYuq3kEc7BYf9PDYqVdRou2x3MNjBA2TXd8AgqGeJDkeeKXkXGfXHd\n+VYTG8oatW4FpKsllYadymwCzXBf5XTEyqUII2xGBg6AFLnuTvCqBhXEtjFp\nfl6k18X1GNuv20PxNvxKfbP6pVujxgNyVGrgG/uDrW1hkOMSzvYZmKEmX3WI\nBHWl\r\n=SW5F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH/op/NIo3CCHIgYqAdSCgrna9UPvPeAVowXWWsD55v4AiBFekSGn+cNILi8BXq3XlwMirpLmnh0egmQr6IGy4Ft9Q=="}]},"directories":{},"maintainers":[{"name":"workfel","email":"workfel@gmail.com"},{"name":"spike008t","email":"khim.tieu.philippe@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-azure-eventhub_0.1.3_1604936687984_0.35009880214324607"},"_hasShrinkwrap":false},"1.0.0":{"name":"@digikare/nestjs-azure-eventhub","version":"1.0.0","main":"./src/index.js","typings":"./src/index.d.ts","dependencies":{},"peerDependencies":{"@azure/event-hubs":"^5.7.0","rxjs":"^7.0.0","debug":"^4.3.4","@nestjs/common":"^8.0.0","@nestjs/microservices":"^8.0.0","@azure/storage-blob":"^12.9.0","@azure/eventhubs-checkpointstore-blob":"^1.0.1","tslib":"^2.0.0"},"gitHead":"f6065609a7fd4cd01bbaaa0da44e953a79cb5627","description":"<p align=\"center\">   <a href=\"http://nestjs.com/\" target=\"blank\"><img src=\"https://nestjs.com/img/logo_text.svg\" width=\"320\" alt=\"Nest Logo\" /></a> </p>","_id":"@digikare/nestjs-azure-eventhub@1.0.0","_nodeVersion":"16.13.2","_npmVersion":"8.5.4","dist":{"integrity":"sha512-n/83jKVBJWJGPQqTlRgBMtCf+jtt8GT39w9JZtUjcZH0qCQn6I2Bm/7yO3za7i6OYd4kK9hghn/fHOazwBgLyQ==","shasum":"483e65bf627b341976817c33adda58ba324ad1e3","tarball":"https://registry.npmjs.org/@digikare/nestjs-azure-eventhub/-/nestjs-azure-eventhub-1.0.0.tgz","fileCount":26,"unpackedSize":56170,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6LMwf6Jz5jkwCKN4lfohYaWTAhSR9yL31VxFWxU+k9QIhAOA5a48w2MpxzijskKGZp4s3gqwmVQR3PbhBglHM/vg6"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWBwvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr7ahAAlSTRO6lAQspT1Il3+FYHCKHDvpLWbrj3Tw9582BT/QtwQ7wo\r\n8tr7PTUmSw/OSnSnTtg7XcJdhB10KYmg6h/R5QDNw3uxMInhdg5ena9qBe1/\r\nhVeIW/mIQktVpNzna7cN2R0CSMrlQJqEOKGa+Ss9NChue/qyj8TgpQx7/nFy\r\nB/DhDzJaNsgw1ZoJnIYSmQHxygY2pcGsFG2rOzTzEvaN+k6IFK071A6+u8sr\r\nWkvDVsuXb4ZAiiL5u8Zdp3z7M6Uu8IYoAZtDxO6+wycGW+4C7Q3NNyz1tSwC\r\ny229cR667xJPBbp4CMPHS9Zc9WMjgiKVOQdc4mEDSQ7615PWqMd1w86qi1St\r\n1A206R1azYRztv63K6YZ449T1tRPdO3+qvT2mRiZpYqKWtXQrJj1g4Us/j1r\r\n//zjiWaVwLWBxXt+3oOwyYdWBTWtfP1CPQbdBR3UXwXUbGaxxFNBzwjBLJsb\r\njIkNJ4eCZEthcGzjDjxwJQylMCF+r29dQVD1x1lI4euDNtmOq2ZIfsAqUuku\r\nazARZeSZXYOKjwwRXYy9Yajo4MZnz0U1WZp/hnUqys/tAhz6YDWj06DVktqd\r\nQnltppeEoS9VnvMyER8U/s16XNZtFsig/zZ9/JGlmb32IQ0ogd0u+oP+X+/a\r\nRN+PArNzZs4zsu39txxR/BOcPc9aImu9gXA=\r\n=+wHF\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"spike008t","email":"khim.tieu.philippe@gmail.com"},"directories":{},"maintainers":[{"name":"kakaruto","email":"kakaruto@gmail.com"},{"name":"spike008t","email":"khim.tieu.philippe@gmail.com"},{"name":"workfel","email":"workfel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-azure-eventhub_1.0.0_1649941551482_0.18730025648437887"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-02T12:09:13.734Z","0.1.1":"2020-11-02T12:09:14.020Z","modified":"2022-04-14T13:05:51.824Z","0.1.2":"2020-11-06T11:35:06.872Z","0.1.3":"2020-11-09T15:44:48.125Z","1.0.0":"2022-04-14T13:05:51.690Z"},"maintainers":[{"name":"kakaruto","email":"kakaruto@gmail.com"},{"name":"spike008t","email":"khim.tieu.philippe@gmail.com"},{"name":"workfel","email":"workfel@gmail.com"}],"description":"<p align=\"center\">   <a href=\"http://nestjs.com/\" target=\"blank\"><img src=\"https://nestjs.com/img/logo_text.svg\" width=\"320\" alt=\"Nest Logo\" /></a> </p>","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<h1 align=\"center\">\n  Digikare nestjs-azure-eventhub\n</h1>\n<p align=\"center\">\n  Transport component for NestJS microservice\n</p>\n\n<p align=\"center\">\n  The librairies is used and maintained by <a href=\"https://www.digikare.com\">digikare</a> team. We are open for all contributions!\n</p>\n\n## Description\n\n`@digikare/nestjs-azure-eventhub` is a transport component provide [Event Hub](https://docs.microsoft.com/fr-fr/azure/event-hubs/event-hubs-about) into [Nest microservice](https://github.com/nestjs/nest)\n\n## Installation\n\n```bash\n$ npm install @digikare/nestjs-azure-eventhub\n\n# or yarn\n\n$ yarn add @digikare/nestjs-azure-eventhub\n```\n\n## How to use\n\n### Microservice\n\n```typescript\nimport { EventHubServer } from '@digikare/nestjs-azure-eventhub';\n// other imports {...}\n\nconst app = await NestFactory.createMicroservice(ApplicationModule, {\n  startegy: new EventHubServer(\n    '<connection_string>',        // the connection string\n    '<event_hub_name>',           // the event hub name\n    '<optional_consumer_group>',  // optionnal: The consumer group, the default value is $Default\n  ),\n});\n```\n\nYou can also define a specific partitionId to listen if needed (useful for dev/test env).\n\n```typescript\nimport { EventHubServer } from '@digikare/nestjs-azure-eventhub';\n// other imports {...}\n\nconst app = await NestFactory.createMicroservice(ApplicationModule, {\n  startegy: new EventHubServer(\n    '<connection_string>',          // the connection string\n    '<event_hub_name>',             // the event hub name\n    '<optional_consumer_group>',    // optionnal: The consumer group, the default value is $Default\n    {\n      partitionId: '<partition_id>' // optional: the partitionId to listen\n    }\n  ),\n});\n```\n\nAnd now you can use `@EventPattern()` and `@MessagePattern()` decorators!\n\n#### Checkpoint store\n\nSince 0.1.2, you can add a checkpoint store, that allow your app to treat pending message.\n\nYou will need an azure account storage in order to make it works.\n\n```typescript\nimport { EventHubServer } from '@digikare/nestjs-azure-eventhub';\n// other imports {...}\n\nconst app = await NestFactory.createMicroservice(ApplicationModule, {\n  startegy: new EventHubServer(\n    '<connection_string>',            // the connection string\n    '<event_hub_name>',               // the event hub name\n    '<optional_consumer_group>',      // optionnal: The consumer group, the default value is $Default\n    {\n      partitionId: '<partition_id>',  // optional: the partitionId to listen\n      checkpointStore: {\n        connectionString: '<checkpoint_account_storage_connection_string>',\n        containerName: '<checkpoint_container_name>',\n      }\n    }\n  ),\n});\n```\n\n#### Wildcard support on pattern\n\nWildcard support on pattern can be usefull. When you receive a message, the client will cut out the topic of the event\nin order to check if handlers are subscribed to these topics.\n\nThe restriction at the moment:\n\n- The wildcard char '*' must be at the end (eg: `audit.*`, 'my.scope.on.*`)\n- The split char is '.'\n\nTo enable, just set `wildcardSuppprt` option to `true`\n\n```typescript\nimport { EventHubServer } from '@digikare/nestjs-azure-eventhub';\n// other imports {...}\n\nconst app = await NestFactory.createMicroservice(ApplicationModule, {\n  startegy: new EventHubServer(\n    '<connection_string>',            // the connection string\n    '<event_hub_name>',               // the event hub name\n    '<optional_consumer_group>',      // optionnal: The consumer group, the default value is $Default\n    {\n      partitionId: '<partition_id>',  // optional: the partitionId to listen\n      wildcardSupport: true,          // <<== Support wildcard\n    }\n  ),\n});\n```\n\n__Examples__\n\nIf you send an event on the following topic : event.subevent.topic\nThe handlePatternMessage will test the following topics :\n- `*`\n- `event.*`\n- `event.subevent`\n- `event.subevent.*`\n- `event.subevent.topic`\n\n### Client\n\n```typescript\nimport { ConfigModule, ConfigService } from '@nestjs/config';\nimport { EventHubClient } from '@digikare/nestjs-azure-eventhub';\n\n@Module({\n  imports: [\n    ConfigModule,\n  ],\n  providers: {\n    {\n      provide: 'EVENT_HUB_CLIENT',\n      inject: [ConfigService],\n      useFactory: (configService: ConfigService) => {\n        const connectionString = configService.get<string>('EVENT_HUB_CONNECTION_STRING');\n        const eventHubName = configService.get<string>('EVENT_HUB_NAME');\n        const partitionId = configService.get<string>('EVENT_HUB_PARTITION_ID'); // optionnal\n\n        return new EventHubClient(\n          connectionString,\n          {\n            eventHubName: eventHubName,\n            partitionId: partitionId, // optional - define partitionId if you want sent to only\n          }\n        );\n      },\n    }\n  },\n})\n```\n\nHint: When you define a partitionId, the configuration will override every message/event to send. Even if you provide a partitionID or partitionKey.\n\n## Build\n\n```bash\n# To install dependencies, first go to root monorepo and run yarn\n$ cd ../../\n$ yarn\n\n# development\n$ cd packages/nestjs-azure-eventhub\n$ yarn build\n\n# watch mode\n$ cd packages/nestjs-azure-eventhub\n$ npm run dev\n```\n\n## License\n\n  This library is under [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).\n","readmeFilename":"README.md"}