{"_id":"@ayerin/nest-seneca-transport","_rev":"1-2bfba6e7cc663d68d16df29148f8d0a9","name":"@ayerin/nest-seneca-transport","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@ayerin/nest-seneca-transport","version":"0.2.0","description":"Custom transporter for NestJS to use SenecaJS","main":"dist/index.js","module":"dist/esm/index.js","types":"dist/index.d.ts","scripts":{"build":"npm run lint && npm run test && rm -rf dist && rollup -c","lint":"eslint src --quiet --fix","prepublish":"npm run build","test":"jest"},"repository":{"type":"git","url":"git@gitlab.com:rentspree/module/nest-seneca-transport.git"},"license":"ISC","devDependencies":{"@babel/core":"^7.14.3","@babel/preset-env":"^7.14.2","@babel/preset-typescript":"^7.13.0","@nestjs/common":"^7.6.17","@nestjs/core":"^7.6.17","@types/jest":"^26.0.23","@types/node":"^15.6.1","@types/seneca":"^2.1.10","@typescript-eslint/eslint-plugin":"^4.25.0","@typescript-eslint/parser":"^4.25.0","eslint":"^7.27.0","eslint-config-prettier":"^8.3.0","eslint-plugin-filenames":"^1.3.2","eslint-plugin-import":"^2.23.3","eslint-plugin-prettier":"^3.4.0","jest":"^26.6.3","prettier":"^2.3.0","reflect-metadata":"^0.1.13","rollup":"^2.49.0","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.30.0","rxjs":"^7.1.0","ts-node":"^10.0.0","typescript":"^4.2.4"},"dependencies":{"@nestjs/microservices":"^7.6.17","seneca":"^3.23.3"},"gitHead":"5d5b0c0027119f82df39c0ea5ca59bc217c77388","_id":"@ayerin/nest-seneca-transport@0.2.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-fqq7oSzaWtH0sdLtZAG+H9Lys9ZcpI/SjlODxj2OQ+Ut2JrpmcLsvP4XkBMKNSP5FSumMuuGPumEr56LkbPaZw==","shasum":"946bab26323558494e0499f390ee757ac45c4a51","tarball":"https://registry.npmjs.org/@ayerin/nest-seneca-transport/-/nest-seneca-transport-0.2.0.tgz","fileCount":8,"unpackedSize":5903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtdO7CRA9TVsSAnZWagAAm3gP/RV6pLL1rRYagqbZ913B\n+MkZCEBHDqVxku/7BJKWffFwZlJ7qkKdfnP5QM9ISUYB7tO7HY+vfglj3Os0\nPsDz3qeWn8oiEHKL2UDhhahibMsr0PGsrhJb0EvnczKYZJXlfoOB30C9pr1M\nK/gs4oMVO454Y42pdxlHSBPevX1l5+6DFqJrzWm/YaN0ZM+C/SFkGen5fwzb\n/lIEy6JoJEz1qfUFmFCIpmQactio8cFNLuSc+YT/npN8NiosBfi94hnFx9a/\nfWX+PCZnC3pLC1wmHI7f+F0y+mFt6ky2dsj01P1rR1e9Yh6NjKo4LVmgsNrz\naJodDkHNvjDTxb8qkp48PDIMxaDIC8RUw/uNqDg5VQKtowzpdeheL+9Hgnrh\n9qVBqDEh7wNSZx2axbrVdZQcv/VCZFTVlvDjD+j+qKY3/VO70KmMrqaLIpiQ\nHPuBEvBemETY5KRP66mP4gz1UjcMSDDqeaE/Y462mhL4O3LE4oBMavnxNboG\nmR3Mu0EU1jNcuvRa4m+Q7SMaLO88cT/B18JNdvx6/DjJAAg/pfA9hxhQw2N7\nnEmaN+qI7BPFeJH5//KIEVzpRjlib6h5/R+YG1RuqMeajFG/vEABN3uTfYZl\npdLneXrnN4zA4cFfoXRI1p5vq8p9Aho9HPvur9SA/n/hDytQUQ5q8K5fakVQ\nkGKm\r\n=UG6p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnfTkyRH7JBKDvM7RvQLpRJuo+M19IQGIPp3dMpSo2kAIhAIBG26iH692KfWHTJT29wab9jsuCy4p19LDLqMkv2ma7"}]},"_npmUser":{"name":"ayerin","email":"yerin.adler@gmail.com"},"directories":{},"maintainers":[{"name":"ayerin","email":"yerin.adler@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nest-seneca-transport_0.2.0_1622528955453_0.5418730559138927"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-01T06:29:15.399Z","0.2.0":"2021-06-01T06:29:15.567Z","modified":"2022-04-04T17:14:22.025Z"},"maintainers":[{"name":"ayerin","email":"yerin.adler@gmail.com"}],"description":"Custom transporter for NestJS to use SenecaJS","repository":{"type":"git","url":"git@gitlab.com:rentspree/module/nest-seneca-transport.git"},"license":"ISC","readme":"# @rentspree/nest-seneca-transport\r\n\r\n## Table of Contents\r\n\r\n- [About](#about)\r\n- [Getting Started](#getting_started)\r\n- [Usage](#usage)\r\n\r\n## About <a name = \"about\"></a>\r\n\r\nWrite about 1-2 paragraphs describing the purpose of your project.\r\n\r\n## Getting Started <a name = \"getting_started\"></a>\r\n\r\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes.\r\n\r\n### Prerequisites\r\n\r\nThis library is hosted on Gemfury as a private repository.\r\n\r\nTo install, you must grant RentSpree gemfury an access to your npm.\r\n\r\nFirst, you need to config npm to use gemfury proxy for @rentspree package namespace.\r\n\r\n```bash\r\nnpm config set @rentspree:registry https://npm-proxy.fury.io/rentspree/\r\n```\r\n\r\nThen, login your gemfury account.\r\n\r\n```bash\r\nnpm login --registry https://npm-proxy.fury.io/rentspree/\r\n```\r\n\r\nYou'll be prompted to input your credentials.\r\n\r\n### Installing\r\n\r\nJust run npm install command.\r\n\r\n```bash\r\nnpm i @rentspree/nest-seneca-transport\r\n```\r\n\r\n## Usage <a name = \"usage\"></a>\r\n\r\nInitialize `ServerSeneca` into the Microservice strategy\r\n\r\n```js\r\nasync function bootstrap() {\r\n  const app = await NestFactory.createMicroservice(AppModule, {\r\n    strategy: new ServerSeneca({\r\n      serializer: new OutboundResponseIdentitySerializer(),\r\n      deserializer: new InboundResponseIdentityDeserializer(),\r\n      senecaInstance: new Seneca(),\r\n    })\r\n  app.listen(() => console.log('Microservice is listening'));\r\n}\r\nbootstrap();\r\n```\r\n\r\nThen, use `MessagePattern` decorator on any controller you want.\r\n\r\n```js\r\n@MessagePattern({\r\n  role: 'Property',\r\n  version: '2.1',\r\n  cmd: 'getByRenter',\r\n})      // Annotation for Seneca transport layer\r\n@Get()  // Annotation for running normal REST-API\r\ngetByRenter(data: any): Promise<[Property]> {\r\n  const { renter } = data;\r\n  const properties = await this.propertyService.getByRenter(renter)\r\n  return properties;\r\n}\r\n```\r\n","readmeFilename":"README.md"}