{"id":23421153,"url":"https://github.com/nhsdigital/javascript-mesh-client","last_synced_at":"2025-10-19T08:16:56.216Z","repository":{"id":209889740,"uuid":"717061169","full_name":"NHSDigital/Javascript-mesh-client","owner":"NHSDigital","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-25T14:20:27.000Z","size":8322,"stargazers_count":1,"open_issues_count":6,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-25T15:26:44.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NHSDigital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-10T13:21:00.000Z","updated_at":"2024-06-27T12:55:38.000Z","dependencies_parsed_at":"2024-05-06T08:27:35.032Z","dependency_job_id":"3c7b7c1a-73f7-49ca-8177-851cc6cf8527","html_url":"https://github.com/NHSDigital/Javascript-mesh-client","commit_stats":null,"previous_names":["nhsdigital/galleri-mesh-client","nhsdigital/javascript-mesh-client"],"tags_count":7,"template":false,"template_full_name":"NHSDigital/repository-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHSDigital%2FJavascript-mesh-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHSDigital%2FJavascript-mesh-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHSDigital%2FJavascript-mesh-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHSDigital%2FJavascript-mesh-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NHSDigital","download_url":"https://codeload.github.com/NHSDigital/Javascript-mesh-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230903878,"owners_count":18297817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-23T02:14:12.393Z","updated_at":"2025-10-19T08:16:56.120Z","avatar_url":"https://github.com/NHSDigital.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Repository Template\n\n[![CI/CD Pull Request](https://github.com/nhs-england-tools/repository-template/actions/workflows/cicd-1-pull-request.yaml/badge.svg)](https://github.com/nhs-england-tools/repository-template/actions/workflows/cicd-1-pull-request.yaml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=repository-template\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=repository-template)\n\nWelcome to the Javascript MESH client repo. This repository houses a Javascript MESH client which can be used by any nodejs application to communicate with [MESH](https://digital.nhs.uk/services/message-exchange-for-social-care-and-health-mesh)\n\n## Table of Contents\n\n- [Repository Template](#repository-template)\n  - [Table of Contents](#table-of-contents)\n  - [Installation](#installation)\n  - [Setup](#setup)\n  - [Functions](#functions)\n    - [Handshake](#handshake)\n    - [Message Retrieval](#message-retrieval)\n    - [Message Management](#message-management)\n    - [Message Creation and Sending](#message-creation-and-sending)\n    - [Configuration and Examples](#configuration-and-examples)\n  - [Usage](#usage)\n  - [Contributing](#contributing)\n  - [Testing](#testing)\n  - [Contacts](#contacts)\n  - [Licence](#licence)\n\n## Installation\n\nThis library does not require any external dependencies beyond those used in the src directory files. However, ensure you have a modern version of Node.js installed that supports ES Modules.\n\nyou can install the module with `npm i nhs-mesh-client`\n\njsdocs can be accessed [here](https://nhsdigital.github.io/Javascript-mesh-client/)\n\n## Setup\n\nThis client is compatible with the sandbox, integration and production MESH systems.\n\nThe repository is structured into several directories, each containing specific types of operations:\n\n- `get/`: Contains functions for retrieving information from the message exchange system.\n- `put/`: Contains functions for updating the status of messages.\n- `post/`: Contains functions for creating or sending messages.\n- `examples/`: Contains examples on how to use the functions in practical scenarios.\n\n## Functions\n\n### Handshake\n\n- `handShake`: Establishes a connection with the message exchange system, ensuring that communication is possible.\n\n### Message Retrieval\n\n- `getMessageCount`: Retrieves the count of messages currently stored in the mailbox.\n- `readMessage`: Reads the content of a specific message.\n\n### Message Management\n\n- `markAsRead`: Marks a message as read or acknowledged, updating its status within the system.\n\n### Message Creation and Sending\n\n- `sendMessage`: Sends a new message to the specified recipient.\n- `sendChunkedMessage`: Sends a large message in chunks, suitable for handling large datasets or files.\n\n### Configuration and Examples\n\n- `loadConfig`: Loads and returns configuration settings for the message exchange system, preparing it for operation.\n- `createMessages`: Demonstrates how to create and send a message using the system.\n- `createMessageChunks`: Demonstrates how to send a large message in chunks.\n- `receiveMessage`: Demonstrates how to retrieve and process messages from the mailbox.\n\n## Usage\n\nTo use any of the provided functions, first ensure you have the necessary configuration. This typically involves setting up authentication details, specifying the target mailbox IDs, and other relevant settings. Here's a basic example\n\n```javascript\nimport { loadConfig, createMessages } from \"./src/index.js\";\n\nasync function main() {\n  const config = await loadConfig({\n    logLevel: \"DEBUG\",\n    url: \"https://example.com/messaging\",\n    // additional configuration options...\n  });\n\n  await createMessages(config);\n}\n\nmain();\n```\n\n## Contributing\n\nContributions to improve or extend the functionality of this message exchange system are welcome. Please follow the existing code structure and document any new functions or changes thoroughly.\n\n## Testing\n\n`npm test` will execute meshService.test.js.\n\n## Contacts\n\nMaintainers: [andrew cleveland](mainto:andrew.cleveland1@nhs.net)\n\n## Licence\n\nUnless stated otherwise, the codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation.\n\nAny HTML or Markdown documentation is [© Crown Copyright](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/) and available under the terms of the [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhsdigital%2Fjavascript-mesh-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnhsdigital%2Fjavascript-mesh-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhsdigital%2Fjavascript-mesh-client/lists"}