{"_id":"@aerogear/graphql-kafka-subscriptions","_rev":"2-7ac28c1d10a7c264b07bf73b563932bc","name":"@aerogear/graphql-kafka-subscriptions","dist-tags":{"latest":"0.4.1"},"versions":{"0.4.1":{"name":"@aerogear/graphql-kafka-subscriptions","version":"0.4.1","description":"Apollo graphql subscription over Kafka protocol","main":"dist/index.js","typings":"dist/index.d.ts","scripts":{"test":"jest --env node","build":"tsc","watch":"tsc -w","prepack":"tsc"},"repository":{"type":"git","url":"git+https://github.com/aerogear/graphql-kafka-subscriptions.git"},"keywords":["graphql","kafka","apollo","subscriptions"],"author":{"name":"Enda Phelan"},"license":"ISC","bugs":{"url":"https://github.com/aerogear/graphql-kafka-subscriptions/issues"},"homepage":"https://github.com/aerogear/graphql-kafka-subscriptions#readme","jest":{"roots":["<rootDir>/src/test"],"moduleFileExtensions":["ts","tsx","js"],"transform":{"\\.(ts|tsx)$":"ts-jest"},"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$"},"dependencies":{"@types/bunyan":"^1.8.6","@types/node":"^13.13.2","bunyan":"1.8.12","dotenv":"^8.2.0","graphql-subscriptions":"^1.1.0","iterall":"^1.2.2","node-rdkafka":"^2.8.1","uuid":"^7.0.3"},"devDependencies":{"@types/jest":"^25.2.1","jest":"^25.4.0","ts-jest":"^25.4.0","typescript":"^3.8.3"},"peerDependencies":{"graphql":"14.x || 15.x"},"gitHead":"616ac0a668a13933a3dc32580463a9d1ac049bce","_id":"@aerogear/graphql-kafka-subscriptions@0.4.1","_nodeVersion":"12.18.3","_npmVersion":"6.14.8","dist":{"integrity":"sha512-MunVafpqjBldR9bPQObwoT4EWAfw1z5ExcKYA+de+lJOrJxrLSHMJOMcVUZHPr9577YKWzOQ7Zbf7S6inMDLJA==","shasum":"c4267f46b1b55db1a2d281f5460fc64cba80d82b","tarball":"https://registry.npmjs.org/@aerogear/graphql-kafka-subscriptions/-/graphql-kafka-subscriptions-0.4.1.tgz","fileCount":12,"unpackedSize":27192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffzG3CRA9TVsSAnZWagAA9dcP/2V+ya8/U5o/RrxNZSvl\nMRequuAyyzN1opcdj2KL37D5LTQyC58sVegwnKXDDefimR17RIMBvT1l1Id6\nAbRbkMn/3JuO1TRxtJvHhI5RMPI3G+5OIcmdyfuVUSMbmLXU8VVGTDbgcENz\nSE1VnPJLEsVRL3qX1LuDfjLbP0BTHYSsvuhED9u+IQd4jTesf3Yi5G0YmAZ7\nhvME+ibpYFACsYXxhfMhhLE+Z37B5Ud7G1Y0TE0AiasfY4aE+MIVoL3FwXmi\nEOEe3Z6I+3T9eoWNYIomqbgjYC8KZcalekM/zGj2vwv8sDRvBiWNekrObkqA\ntQ/EVMDK+M7LLTfsv5OacktfToL1O3UX+l2NyS5eF1ncm7oiGu4GFcIuvjMf\nRunu0Z+gWQ/X4Bp2rW+AhjLIQEa2p+FzGPBn8/aWi9k3PrqzKVbFVMETo9pj\nFLjw7jlITp3yOgtLdBTOaQTk/DTNWmDxLx+5jHKNZgxjdTeK2d+aFPiJPmAZ\n048Y3aJ8lqwvX5QnvxFr5O8vPREzc6sW5/J/iE8X27a/V+G0/4VkVwl/e6H8\nzUoOwpn78np7GTyQQXOCYt0PBXcfMJYthkVm/2NGETxa+KzYQzcYMVr+tm/J\nMLRCmPdcxuvt4ooYh3Hv+v9Y3tGatY+VVJb/fFYyhcU+qCWRv2usCr6cYCww\nmwqk\r\n=mGb5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEoQcXr6cnFBwZwlWuuOFhkbbzS9QKIRacSBM61Cn/zRAiA/EOwmFDw+9WRLzsHKD1mnOU4g4bB2L4l4WSX2i+rLXg=="}]},"maintainers":[{"name":"ephelan","email":"ephelan@redhat.com"},{"name":"secondsun","email":"secondsun@gmail.com"},{"name":"ziccardi","email":"massimiliano.ziccardi@gmail.com"},{"name":"darahayes","email":"dara.s.hayes@gmail.com"},{"name":"aerogears","email":"aerogear@redhat.com"},{"name":"wtrocki","email":"wtrocki@redhat.com"},{"name":"matzew","email":"matzew@apache.org"},{"name":"aerogear-ci","email":"mziccard@redhat.com"}],"_npmUser":{"name":"ephelan","email":"ephelan@redhat.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-kafka-subscriptions_0.4.1_1602171318549_0.6672793096498817"},"_hasShrinkwrap":false}},"time":{"created":"2020-10-08T15:35:18.186Z","0.4.1":"2020-10-08T15:35:18.653Z","modified":"2022-06-15T15:07:35.519Z"},"maintainers":[{"email":"aerogear@redhat.com","name":"aerogears"},{"email":"wtrocki@redhat.com","name":"wtrocki"},{"email":"matzew@apache.org","name":"matzew"},{"email":"mziccard@redhat.com","name":"aerogear-ci"},{"email":"massimiliano.ziccardi@gmail.com","name":"ziccardi"},{"email":"ephelan@redhat.com","name":"ephelan"}],"description":"Apollo graphql subscription over Kafka protocol","homepage":"https://github.com/aerogear/graphql-kafka-subscriptions#readme","keywords":["graphql","kafka","apollo","subscriptions"],"repository":{"type":"git","url":"git+https://github.com/aerogear/graphql-kafka-subscriptions.git"},"author":{"name":"Enda Phelan"},"bugs":{"url":"https://github.com/aerogear/graphql-kafka-subscriptions/issues"},"license":"ISC","readme":"# graphql-kafka-subscriptions\n\nIt implements the PubSubEngine Interface from the graphql-subscriptions package and also the new AsyncIterator interface. It allows you to connect your subscriptions manager to a single Kafka topic used as Pub/Sub communication channel.\n\n## Installation\n\n`npm install graphql-kafka-subscriptions`\n\n### Mac OS High Sierra / Mojave\n\nOpenSSL has been upgraded in High Sierra and homebrew does not overwrite default system libraries. That means when building node-rdkafka, because you are using openssl, you need to tell the linker where to find it:\n\n```sh\nexport CPPFLAGS=-I/usr/local/opt/openssl/include\nexport LDFLAGS=-L/usr/local/opt/openssl/lib\n```\n\nThen you can run `npm install` on your application to get it to build correctly.\n\n## Usage\n\n\n### Initializing the kafka pubsub client\n\n```js\nimport { KafkaPubSub } from 'graphql-kafka-subscriptions'\n\nexport const pubsub = new KafkaPubSub({\n  topic: 'name-of-the-topic',\n  host: 'INSERT_KAFKA_IP',\n  port: 'INSERT_KAFKA_PORT',\n  globalConfig: {} // options passed directly to the consumer and producer\n})\n```\n\n### Publishing messages to the subcrition\n\n```js\npayload = {\n  firstName: \"John\",\n  lastName: \"Doe\"\n}\n\npubsub.publish('pubSubChannel', payload);\n```\n\n###  Subscribing to a channel\n\n```js\nconst onMessage = (payload) => {\n  console.log(payload);\n}\n\nconst subscription = await pubsub.subscribe('pubSubChannel', onMessage)\n```\n\n## Contributing\n\nContributions are welcome. Make sure to check the existing issues (including the closed ones) before requesting a feature, reporting a bug or opening a pull requests.\n\nFor sending a PR follow:\n\n1. Fork it (<https://github.com/ancashoria/graphql-kafka-subscriptions/fork>)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n\n**Horia Miron notes:**\n\nThanks to [davidyaha][1] for [graphql-redis-subscriptions][2] which was the main inspiration point for this project.\n\n[1]: https://github.com/davidyaha\n[2]: https://github.com/davidyaha/graphql-redis-subscriptions","readmeFilename":"README.md"}