{"id":50557374,"url":"https://github.com/cityssm/node-ms-graph-mail","last_synced_at":"2026-06-04T08:30:31.784Z","repository":{"id":354708019,"uuid":"1216235091","full_name":"cityssm/node-ms-graph-mail","owner":"cityssm","description":"Wrappers around the Microsoft Graph API to add response types to the Mail-related queries.","archived":false,"fork":false,"pushed_at":"2026-04-29T17:20:54.000Z","size":177,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-29T19:17:53.653Z","etag":null,"topics":["microsoft-exchange","microsoft-graph","microsoft-graph-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cityssm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-20T17:49:16.000Z","updated_at":"2026-04-29T17:17:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cityssm/node-ms-graph-mail","commit_stats":null,"previous_names":["cityssm/node-ms-graph-mail"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/cityssm/node-ms-graph-mail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cityssm%2Fnode-ms-graph-mail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cityssm%2Fnode-ms-graph-mail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cityssm%2Fnode-ms-graph-mail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cityssm%2Fnode-ms-graph-mail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cityssm","download_url":"https://codeload.github.com/cityssm/node-ms-graph-mail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cityssm%2Fnode-ms-graph-mail/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33897568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["microsoft-exchange","microsoft-graph","microsoft-graph-api"],"created_at":"2026-06-04T08:30:30.880Z","updated_at":"2026-06-04T08:30:31.776Z","avatar_url":"https://github.com/cityssm.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microsoft Graph Mail API\n\n[![DeepSource](https://app.deepsource.com/gh/cityssm/node-ms-graph-mail.svg/?label=active+issues\u0026show_trend=true\u0026token=KkSuPUghHqeLWICUprgijw-o)](https://app.deepsource.com/gh/cityssm/node-ms-graph-mail/)\n\nWrappers around the Microsoft Graph API\nto add response types to the Mail-related queries.\n\n## Installation\n\n```sh\nnpm install @cityssm/ms-graph-mail\n```\n\n## Usage\n\n```javascript\nimport MsGraphMail, {\n  MsGraphMailMessageBuilder,\n  wellKnownFolderNames\n} from '@cityssm/ms-graph-mail'\n\nconst api = new MsGraphMail({\n  tenantId: '00000000-0000-0000-0000-00000000000a',\n  clientId: '00000000-0000-0000-0000-00000000000b',\n  clientSecret: 'abcd...xyz',\n  targetUser: 'helpdesk@example.com'\n})\n\nconst inboxMessages = await api.listMessages(wellKnownFolderNames.Inbox, {\n  top: 5,\n  select: ['id', 'subject', 'receivedDateTime', 'from', 'body'],\n  orderBy: ['receivedDateTime desc']\n})\n\nconst messageToSend = new MsGraphMailMessageBuilder()\n  .withSubject('Ticket #000001')\n  .withBody('\u003cp\u003e\u003cb\u003eTicket Received\u003c/b\u003e\u003c/p\u003e', 'html')\n  .appendToBody('\u003cp\u003eYour ticket should be worked on shortly.\u003c/p\u003e', 'html')\n  .addToRecipient('requestor@example.com')\n  .build()\n\nawait api.sendMessage(messageToSend)\n```\n\n## Functions\n\n👍 It is recommended to use this package with Typescript to get usage hints.\n\n### Folder Functions\n\n```typescript\nasync function listMailFolders(\n  options?: MsGraphMailApiOptions\u003cMsGraphMailFolder\u003e\n): Promise\u003cMsGraphMailFolder[]\u003e {}\n\nasync function getMailFolderByDisplayName(\n  displayName: string,\n  options?: Pick\u003cMsGraphMailApiOptions\u003cMsGraphMailFolder\u003e, 'select'\u003e\n): Promise\u003cMsGraphMailFolder | undefined\u003e {}\n\nasync function getArchiveFolder(\n  options?: Pick\u003cMsGraphMailApiOptions\u003cMsGraphMailFolder\u003e, 'select'\u003e\n): Promise\u003cMsGraphMailFolder\u003e {}\n\nasync function getInboxFolder(\n  options?: Pick\u003cMsGraphMailApiOptions\u003cMsGraphMailFolder\u003e, 'select'\u003e\n): Promise\u003cMsGraphMailFolder\u003e {}\n\nasync function getOutboxFolder(\n  options?: Pick\u003cMsGraphMailApiOptions\u003cMsGraphMailFolder\u003e, 'select'\u003e\n): Promise\u003cMsGraphMailFolder\u003e {}\n\nasync function getSentItemsFolder(\n  options?: Pick\u003cMsGraphMailApiOptions\u003cMsGraphMailFolder\u003e, 'select'\u003e\n): Promise\u003cMsGraphMailFolder\u003e {}\n```\n\n### Message Functions\n\n```typescript\nasync function listMessages(\n  folderIdOrWellKnownFolderName: string,\n  options?: MsGraphMailApiOptions\u003cMsGraphMailMessage\u003e\n): Promise\u003cMsGraphMailMessage[]\u003e {}\n\nasync function listMessageAttachments(\n  messageId: string,\n  options?: MsGraphMailApiOptions\u003cMsGraphMailAttachment\u003e\n): Promise\u003cMsGraphMailAttachment[]\u003e {}\n```\n\n### Message Move Functions\n\n```typescript\nasync function archiveMessage(messageId: string): Promise\u003cMsGraphMailMessage\u003e {}\n\nasync function moveMessage(\n  messageId: string,\n  destinationFolderIdOrWellKnownFolderName: string\n): Promise\u003cMsGraphMailMessage\u003e {}\n```\n\n### Message Send Functions\n\n```typescript\nasync function sendMessage(\n  message: MsGraphMailSendableMessage\n): Promise\u003cvoid\u003e {}\n```\n\n### Message Update Functions\n\n```typescript\nasync function markMessageAsRead(messageId: string): Promise\u003cvoid\u003e {}\n```\n\n## Related Projects\n\n[**ShiftLog**](https://github.com/cityssm/shiftLog/)\u003cbr /\u003e\nA work management system with work order recording, shift activity logging,\nand timesheet tracking.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcityssm%2Fnode-ms-graph-mail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcityssm%2Fnode-ms-graph-mail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcityssm%2Fnode-ms-graph-mail/lists"}