{"_id":"@adorsys-gis/message-pickup","_rev":"3-25e5f564bf4f6193840fad406408571a","name":"@adorsys-gis/message-pickup","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@adorsys-gis/message-pickup","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"@adorsys-gis/message-pickup@1.0.0","maintainers":[{"name":"francis-pouatcha","email":"francis.pouatcha@adorsys.com"},{"name":"awambeng","email":"awambengrodrick@gmail.com"},{"name":"t.arthur","email":"tcheutchouaarthur38@gmail.com"}],"dist":{"shasum":"641416745dd488ef929981f4fc2463c028b104b6","tarball":"https://registry.npmjs.org/@adorsys-gis/message-pickup/-/message-pickup-1.0.0.tgz","fileCount":27,"integrity":"sha512-K9KyDhvY1KTI4kYrOb6qmxP6JcrGvRLr/hjxBEdddC2ESShnxyiUub05xR0S20L1pgkuLM8JwC4pOCShpwJd6w==","signatures":[{"sig":"MEYCIQDU6AKHROboJhPbnY4m1uLcecQ2kzHgttTYg25EthxZOAIhAOj+zYyNLrGEoMY8B9+U+PnRQPLnayaCqKefPX/2mCHm","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":73161},"main":"./dist/src/index.js","type":"commonjs","gitHead":"996ebddedb9fc15804b3dd03c212b300f85ea9e4","scripts":{"lint":"eslint . --no-error-on-unmatched-pattern","test":"vitest --run","build":"tsc -p tsconfig.lib.json","format":"prettier --write .","lint:fix":"eslint . --fix","test:watch":"vitest","format:check":"prettier --check ."},"typings":"./dist/src/index.d.ts","_npmUser":{"name":"awambeng","email":"awambengrodrick@gmail.com"},"_npmVersion":"10.9.2","description":"A library for implementing services to support the retrieval of messages from DIDComm agents via mediators.","directories":{},"_nodeVersion":"20.15.1","dependencies":{"didcomm":"^0.4.1","eventemitter3":"^5.0.1","@adorsys-gis/status-service":"^1.0.0","@adorsys-gis/message-service":"1.0.3","@adorsys-gis/contact-exchange":"^1.0.6","@adorsys-gis/message-exchange":"1.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.19.0","vitest":"^3.0.5","ts-jest":"^29.2.5","prettier":"^3.5.2","@eslint/js":"^9.21.0","typescript":"^5.7.3","@types/jest":"^29.5.14","@types/node":"^22.12.0","@eslint/eslintrc":"^3.3.0","vite-plugin-wasm":"^3.4.1"},"_npmOperationalInternal":{"tmp":"tmp/message-pickup_1.0.0_1742375125284_0.9171407345890417","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@adorsys-gis/message-pickup","version":"1.0.1","keywords":[],"author":"","license":"ISC","_id":"@adorsys-gis/message-pickup@1.0.1","maintainers":[{"name":"francis-pouatcha","email":"francis.pouatcha@adorsys.com"},{"name":"awambeng","email":"awambengrodrick@gmail.com"},{"name":"t.arthur","email":"tcheutchouaarthur38@gmail.com"}],"dist":{"shasum":"87d291d252d0ddb2cf121474ad5e39d44d49ed52","tarball":"https://registry.npmjs.org/@adorsys-gis/message-pickup/-/message-pickup-1.0.1.tgz","fileCount":27,"integrity":"sha512-7jWOr57q7s5m7XR6GTnEZZn6Pwsi+knAgLEMuwjzXADVtuLTBqT+aHMZqV1ISLJloYabXYcDEoIICbNv3gbRGg==","signatures":[{"sig":"MEUCIEq+daOJsf1Y/Gj2HI7WYlyeOga/aLCZ+O0TZT02Q7iYAiEArU/5KdK11+mDtzjff66Hhdpdwiq2ZY6fNkz8TE1FsPg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":76453},"main":"./dist/src/index.js","type":"commonjs","gitHead":"6693f1756bac834c33eb5f6c9b890a8b9c32e27b","scripts":{"lint":"eslint . --no-error-on-unmatched-pattern","test":"vitest --run","build":"tsc -p tsconfig.lib.json","format":"prettier --write .","lint:fix":"eslint . --fix","test:watch":"vitest","format:check":"prettier --check ."},"typings":"./dist/src/index.d.ts","_npmUser":{"name":"awambeng","email":"awambengrodrick@gmail.com"},"_npmVersion":"10.9.2","description":"A library for implementing services to support the retrieval of messages from DIDComm agents via mediators.","directories":{},"_nodeVersion":"20.15.1","dependencies":{"didcomm":"^0.4.1","eventemitter3":"^5.0.1","@adorsys-gis/status-service":"^1.0.0","@adorsys-gis/message-service":"1.0.3","@adorsys-gis/contact-exchange":"^1.0.6","@adorsys-gis/message-exchange":"1.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.19.0","vitest":"^3.0.5","ts-jest":"^29.2.5","prettier":"^3.5.2","@eslint/js":"^9.21.0","typescript":"^5.7.3","@types/jest":"^29.5.14","@types/node":"^22.12.0","@eslint/eslintrc":"^3.3.0","vite-plugin-wasm":"^3.4.1"},"_npmOperationalInternal":{"tmp":"tmp/message-pickup_1.0.1_1742550764447_0.6331541670173231","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@adorsys-gis/message-pickup","version":"1.0.2","type":"commonjs","main":"./dist/src/index.js","typings":"./dist/src/index.d.ts","scripts":{"test":"vitest --run","test:watch":"vitest","build":"tsc -p tsconfig.lib.json","lint":"eslint . --no-error-on-unmatched-pattern","lint:fix":"eslint . --fix","format":"prettier --write .","format:check":"prettier --check ."},"keywords":[],"author":"","license":"ISC","description":"A library for implementing services to support the retrieval of messages from DIDComm agents via mediators.","devDependencies":{"@eslint/eslintrc":"^3.3.0","@eslint/js":"^9.21.0","@types/jest":"^29.5.14","@types/node":"^22.12.0","eslint":"^9.19.0","jest":"^29.7.0","prettier":"^3.5.2","ts-jest":"^29.2.5","typescript":"^5.7.3","vite-plugin-wasm":"^3.4.1","vitest":"^3.0.5"},"dependencies":{"@adorsys-gis/contact-exchange":"^1.0.6","@adorsys-gis/message-exchange":"1.0.3","@adorsys-gis/message-service":"1.0.3","@adorsys-gis/status-service":"^1.0.0","didcomm":"^0.4.1","eventemitter3":"^5.0.1"},"_id":"@adorsys-gis/message-pickup@1.0.2","gitHead":"3c22c04e14253b4d9480c646750cada11f0ca7c1","_nodeVersion":"22.9.0","_npmVersion":"10.8.3","dist":{"integrity":"sha512-HOoWmsm4k6NoEkEDHawv/c6mDVc0V9ePUhfWIIc5F12IFyHZezOGmLMizK7sthZfplDlTO3bc7YTUziGRTA/sQ==","shasum":"6bf0bb9d37e8ac8036f408fd7f878ec8386ab776","tarball":"https://registry.npmjs.org/@adorsys-gis/message-pickup/-/message-pickup-1.0.2.tgz","fileCount":27,"unpackedSize":75975,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIF/t34StvZr47MSeKPBwJT5CPhkirWDsVKG2hJvMvENNAiAKD+dz9NyiaRPsdXi/+eei1g1Fc9pMq4sak6MqSTsoKw=="}]},"_npmUser":{"name":"t.arthur","email":"tcheutchouaarthur38@gmail.com"},"directories":{},"maintainers":[{"name":"francis-pouatcha","email":"francis.pouatcha@adorsys.com"},{"name":"awambeng","email":"awambengrodrick@gmail.com"},{"name":"t.arthur","email":"tcheutchouaarthur38@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/message-pickup_1.0.2_1743161828185_0.6269987606212546"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-19T09:05:25.213Z","modified":"2025-03-28T11:37:08.659Z","1.0.0":"2025-03-19T09:05:25.522Z","1.0.1":"2025-03-21T09:52:44.641Z","1.0.2":"2025-03-28T11:37:08.409Z"},"license":"ISC","keywords":[],"description":"A library for implementing services to support the retrieval of messages from DIDComm agents via mediators.","maintainers":[{"name":"francis-pouatcha","email":"francis.pouatcha@adorsys.com"},{"name":"awambeng","email":"awambengrodrick@gmail.com"},{"name":"t.arthur","email":"tcheutchouaarthur38@gmail.com"}],"readme":"# Message Pickup\n\nA library for implementing services to support the retrieval of messages from DIDComm agents via mediators.\n\n## Features\n\n| **Protocol**                                                    | **Description**                  | **Status**     |\n| --------------------------------------------------------------- | -------------------------------- | -------------- |\n| [DIDComm Message Pickup](https://didcomm.org/messagepickup/3.0) | Pick up messages from mediators. | ✅ Implemented |\n\n## Installation\n\nTo install the library, run the following command:\n\n```bash\nnpm install @adorsys-gis/message-pickup\n```\n\n## Usage\n\n### Prerequisites\n\nBefore using the library, you'll need a DID address for the sending party. This can be created using the `DIDIdentityService` from the peer library `@adorsys-gis/multiple-did-identities`. Here's an example of generating a DID using that library:\n\n```typescript\nexport const generateIdentity = async (secretPinNumber: number) => {\n  const createEvent = waitForEvent(DidEventChannel.CreateDidIdentity);\n\n  didIdentityService.createDidIdentity(\n    DIDMethodName.Peer,\n    secretPinNumber,\n    PeerGenerationMethod.Method2,\n  );\n\n  const data = (await createEvent) as ServiceResponse<{ did: string }>;\n  return data.payload.did;\n};\n```\n\n### Using the `MessagePickupService`\n\nThe `MessagePickupService` is designed to work seamlessly with an event bus architecture. Here's how to pick up messages from a mediator:\n\n```typescript\nimport { MessagePickupService } from '@adorsys-gis/message-pickup';\nimport { MessagePickupEvent } from '@adorsys-gis/message-pickup';\n\nconst messagePickupService = new MessagePickupService(\n  eventBus,\n  secretPinNumber,\n);\n\n// Listen on the MessagePickupEvent.MessagePickup event\nconst channel = waitForEvent(MessagePickupEvent.MessagePickup);\nawait messagePickupService.ReceiveMessages(mediatorDid, aliceDid);\n\n// Wait for an acknowledgement on MessagePickupEvent.MessagePickup\nconst eventData = await channel;\nconsole.log('Received event data:', eventData);\n```\n\n### Using the `MessagePickup` Class Directly\n\nIf your application does not use an event bus, you can interact directly with the `MessagePickup` class:\n\n```typescript\nimport { MessagePickup } from '@adorsys-gis/message-pickup';\n\nconst messagePickup = new MessagePickup(\n  didRepository,\n  secretPinNumber,\n  messageRepository,\n);\nconst messageCount = await messagePickup.processStatusRequest(\n  mediatorDid,\n  aliceDidForMediator,\n);\nconsole.log('Message count:', messageCount);\n```\n\n### Additional Help\n\nFor more examples and detailed scenarios, consider referring to the test cases in the project.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes. For contribution guidelines, please refer to the CONTRIBUTING.md file.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","readmeFilename":"README.md"}