{"bugs":{"url":"https://github.com/trufflesuite/truffle/issues"},"dist":{"shasum":"b59e558ae7e6564823fccd06b1cb20aff42d6131","tarball":"https://registry.npmjs.org/@truffle/dashboard-message-bus-client/-/dashboard-message-bus-client-0.1.7-hardhat-error.0.tgz","fileCount":33,"integrity":"sha512-Ugzaa+kAc7Djf1xHa/tG7M/gyfSvqBdgUxlIAog7FnDyHnJjANK5HgUpNhDgg8XusgpgxoIost4NUuYKRABSjA==","signatures":[{"sig":"MEQCIGXfu+pxSc1SwnmEVKaRQTPvZBuCE8J802I48ZRub88CAiA4qmy1XaGrwsIP8ggPIBx4AKZXMFix42XmM9RaXlEKMw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":57338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBx8zACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmohkA/9EsK8Uo60xBBdTuebJeF611u912H41vfJ/IBOyAFMSP8Gzz0V\r\nB3DlX1KInk4A8akZqEiih7CdK/f4zXGgf/c865jOobvstV/mpdSPKkr80wlO\r\n8Ev1HY2tVF4wZeYXJW67WuXdMnO74kkqwx8n2ixd0/sq+Ym2GMANnCqTD0pn\r\nZA6o1gVL3i8T0VkpVzjDbQYg+85odYjVryOncnJe8nged78ZHATTGWSY8l5N\r\ng3sZCfF2o8Ot38WPf5ARld80G0ZPM1HhXRFRv68gN3JcfBI1PzchMSbeq1tF\r\nuRQMJdUEKHfLTqjLAbA6tuSk++IQq1QKrJ1k9U05wN6cz5f35F7Xt24dBJL/\r\nysKiynWUqiPwmicaNAcGSsuxh8a/72CKmo6grw7wmBtVqkQ++3qDyZupKdZd\r\np2Uv0M5Iy/c7VndavQnIjiKxJbR9N6uB8Qs/NtGNflnV89GHW6VHywaz7F3L\r\nKDWH8PCMNh9iASyjTnqS3UkqzmNUaaiu/lV5PCvLtuDsQ0OmRJyGOTtDtDez\r\no/GwLJsYAL+FHCd7oborbsIg0nl84gqu4xgkIRvvlE3S5PvMbWfzWFflcNLE\r\njwR9imFWeALZpS/ZBTDLDvm58LuKK3SFSKChGizRVAon5XqAg7F2ZH/8yBwh\r\n6Njdu0TZC7Bscp4q4RsK73Bshn93/FlB4ks=\r\n=i1/A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","name":"@truffle/dashboard-message-bus-client","types":"dist/index.d.ts","readme":"# `@truffle/dashboard-message-bus-client`\n\nThis library is used for connecting with the message bus that powers the\nTruffle dashboard.\n\n## Usage\n\n### Connecting to the message bus and producing a message\n\n```ts\nimport { DashboardMessageBusClient } from \"@truffle/dashboard-message-bus-client\";\n\nconst client = new DashboardMessageBusClient({ port, host });\n\nconst message = {\n  type: \"helloWorld\",\n  id: new DateTime().getTime(),\n  payload: {\n    hello: \"world\"\n  }\n};\n\nconst messageLifecycle = await client.publish(message);\n```\n\n#### The lifecycle of published messages\n\nPublishing a message creates a lifecycle for that message. The lifecycle is tracked by the publisher as an object of type `PublishedMessageLifecycle<MessageType, ResponseType>`.\n\nPublish message lifecycles terminate in one of three ways:\n\n1. Receipt of a corresponding response message\n2. Invalidation of the message\n3. Abandonment of the message\n\n##### Waiting for a response to a message\n\nTo enable request/response messaging (e.g. proxied JSON-RPC messages), publish\nlifecycles contain a promise that resolves when a response to the originally\npublished message is received.\n\n```ts\nconst response = await publishLifecycle.response;\n```\n\n##### Abandoning messages\n\nTo allow for fire-and-forget messages (e.g. event data), simply call the\n`abandon` method on the lifecycle object.\n\n**Important**: If the `abandon` method of the publish lifecycle is not called,\nthe process will hang forever on exit, as it will forever be waiting for a\nresponse that will never arive.\n\n```ts\nawait messageLifecycle.abandon();\n```\n\n##### Invalidating messages (aka message cancellation)\n\nThe consumer of a published message often will need to perform some longer\nrunning operation as a result of that message. To cancel that work, or to\ncommunicate to the consumer that the message is no longer valid, simply call\n`cancel` on the publish lifecycle.\n\n```ts\nawait messageLifecycle.invalidate();\n```\n\n### Consuming and responding to messages\n\nMessages can be consumed by calling the `subscribe` method of the client. The\n`subscribe` method returns a `DashboardMessageSubscription` object. This object\nemits `message` events whenever messages are received that match the\nsubscription's filter.\n\nReceived messages are wrapped up in a lifecycle object similar to the one used for publishing messages, however there's only a single `respond` method.\n\n```ts\nimport { DashboardMessageBusClient } from \"@truffle/dashboard-message-bus-client\";\n\nconst client = new DashboardMessageBusClient({ port, host });\n\n// omitting the type string in the options object will return a subscription\n// for all messages\nconst subscription = client.subscribe({\n  type: \"helloWorld\"\n});\n\nsubscription.on(\"message\", receivedMessageLifecycle => {\n  const helloTarget = receivedMessageLifecycle.message.payload.hello;\n\n  if (helloTarget.toLowerCase() === \"world\") {\n    // respond by passing your response payload directly to the response\n    await receivedMessageLifecycle.respond({\n      someArbitraryResponse:\n        \"Why hello there. Pleased to make your acquaintance\"\n    });\n  } else {\n    await receivedMessageLifecycle.respond({\n      error: `I'm sorry, you have the wrong number. This is world, not \"${helloTarget}\"`\n    });\n  }\n});\n```\n","gitHead":"f1970ca2361849a1a7d7569d7ddc4db9657c8558","license":"MIT","scripts":{"build":"tsc","prepare":"yarn build"},"_npmUser":{"name":"gnidan","email":"nick@gnidan.org"},"homepage":"https://github.com/trufflesuite/truffle/tree/master/packages/dashboard-message-bus-client#readme","keywords":["ethereum","etherscan","ipfs","solidity","verify-source","sourcify","compile"],"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git+https://github.com/trufflesuite/truffle.git","type":"git","directory":"packages/dashboard-message-bus-client"},"_npmVersion":"lerna/4.0.0/node@v14.20.0+arm64 (darwin)","description":"Client library for accessing the truffle dashboard's message bus","directories":{"lib":"lib"},"maintainers":[{"name":"sukanyaparashar","email":"sukanyaparashar111@gmail.com"},{"name":"cliffoo","email":"cliffzhang08@gmail.com"},{"name":"benjamincburns","email":"benjamin.c.burns@gmail.com"},{"name":"kevinbluer","email":"kevin@bluer.com"},{"name":"tenthirtyone","email":"ASherbuck@gmail.com"},{"name":"lsqproduction","email":"ll@trufflesuite.com"},{"name":"kevinweaver","email":"kevinweaver2@gmail.com"},{"name":"leeftk","email":"leandro.faria@consensys.net"},{"name":"gnidan","email":"nick@gnidan.org"},{"name":"haltman","email":"harry.j.altman@gmail.com"},{"name":"eggplantzzz","email":"pobol234@gmail.com"},{"name":"fainashalts","email":"fainashalts@gmail.com"},{"name":"rkalis","email":"roscokalis@gmail.com"},{"name":"cds-amal","email":"cds.sudama@gmail.com"}],"_nodeVersion":"14.20.0","dependencies":{"ws":"^7.2.0","axios":"0.27.2","debug":"^4.3.1","delay":"^5.0.0","isomorphic-ws":"^4.0.1","tiny-typed-emitter":"^2.1.0","node-abort-controller":"^3.0.1","@truffle/promise-tracker":"^0.1.3","@truffle/dashboard-message-bus-common":"^0.1.5-hardhat-error.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^4.7.4","@types/node":"~12.12.0","@types/debug":"^4.1.5"},"_npmOperationalInternal":{"tmp":"tmp/dashboard-message-bus-client_0.1.7-hardhat-error.0_1661411123597_0.021218969929424514","host":"s3://npm-registry-packages"},"_id":"@truffle/dashboard-message-bus-client@0.1.7-hardhat-error.0","version":"0.1.7-hardhat-error.0"}