MCPcopy Index your code
hub / github.com/mailvelope/mailvelope / getMessage

Function getMessage

src/modules/gmail.js:24–37  ·  view source on GitHub ↗
({msgId, email, accessToken, format = 'full', metaHeaders = []})

Source from the content-addressed store, hash-verified

22export const MAIL_QUOTA = 25 * 1024 * 1024;
23
24export async function getMessage({msgId, email, accessToken, format = 'full', metaHeaders = []}) {
25 const options = {
26 method: 'GET',
27 headers: {
28 Authorization: `Bearer ${accessToken}`,
29 Accept: 'application/json'
30 },
31 contentType: 'json'
32 };
33 return fetchJSON(
34 `https://www.googleapis.com/gmail/v1/users/${email}/messages/${msgId}?format=${format}${metaHeaders.map(header => `&metadataHeaders=${header}`).join('')}`,
35 options
36 );
37}
38
39export async function getMessageMimeType({msgId, email, accessToken}) {
40 const {payload} = await getMessage({msgId, email, accessToken, format: 'metadata', metaHeaders: ['content-type']});

Callers 4

getMessageMimeTypeFunction · 0.70
getAttachmentFunction · 0.70
getPGPSignatureAttIdFunction · 0.70
getPGPEncryptedAttDataFunction · 0.70

Calls 1

fetchJSONFunction · 0.85

Tested by

no test coverage detected