@openfn/language-gmail 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/LICENSE.LESSER +165 -0
- package/README.md +169 -0
- package/ast.json +734 -0
- package/configuration-schema.json +19 -0
- package/dist/index.cjs +369 -0
- package/dist/index.js +349 -0
- package/package.json +50 -0
- package/types/Adaptor.d.ts +56 -0
- package/types/Utils.d.ts +14 -0
- package/types/index.d.ts +3 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// src/Adaptor.js
|
|
8
|
+
var Adaptor_exports = {};
|
|
9
|
+
__export(Adaptor_exports, {
|
|
10
|
+
alterState: () => alterState,
|
|
11
|
+
combine: () => combine,
|
|
12
|
+
cursor: () => cursor,
|
|
13
|
+
dataPath: () => dataPath,
|
|
14
|
+
dataValue: () => dataValue,
|
|
15
|
+
each: () => each,
|
|
16
|
+
execute: () => execute,
|
|
17
|
+
field: () => field,
|
|
18
|
+
fields: () => fields,
|
|
19
|
+
fn: () => fn,
|
|
20
|
+
fnIf: () => fnIf,
|
|
21
|
+
getContentsFromMessages: () => getContentsFromMessages,
|
|
22
|
+
http: () => http,
|
|
23
|
+
lastReferenceValue: () => lastReferenceValue,
|
|
24
|
+
merge: () => merge,
|
|
25
|
+
sourceValue: () => sourceValue
|
|
26
|
+
});
|
|
27
|
+
import {
|
|
28
|
+
execute as commonExecute,
|
|
29
|
+
composeNextState
|
|
30
|
+
} from "@openfn/language-common";
|
|
31
|
+
import {
|
|
32
|
+
normalizeOauthConfig,
|
|
33
|
+
expandReferences
|
|
34
|
+
} from "@openfn/language-common/util";
|
|
35
|
+
|
|
36
|
+
// src/Utils.js
|
|
37
|
+
import unzipper from "unzipper";
|
|
38
|
+
import { google } from "googleapis";
|
|
39
|
+
var gmail;
|
|
40
|
+
async function getMessagesResult(userId, query, lastPageToken) {
|
|
41
|
+
try {
|
|
42
|
+
const { data } = await gmail.users.messages.list({
|
|
43
|
+
userId,
|
|
44
|
+
q: query,
|
|
45
|
+
maxResults: 3,
|
|
46
|
+
pageToken: lastPageToken
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
messages: data.messages,
|
|
50
|
+
nextPageToken: data.nextPageToken
|
|
51
|
+
};
|
|
52
|
+
} catch (error) {
|
|
53
|
+
throw new Error("Error fetching messages: " + error.message);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async function getMessageResult(userId, messageId) {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
const { data } = await gmail.users.messages.get({
|
|
59
|
+
userId,
|
|
60
|
+
id: messageId,
|
|
61
|
+
format: "full"
|
|
62
|
+
});
|
|
63
|
+
return {
|
|
64
|
+
userId,
|
|
65
|
+
messageId,
|
|
66
|
+
parts: (_a = data == null ? void 0 : data.payload) == null ? void 0 : _a.parts,
|
|
67
|
+
headers: (_b = data == null ? void 0 : data.payload) == null ? void 0 : _b.headers
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function getDesiredContent(hint) {
|
|
71
|
+
const desiredContent = typeof hint === "string" ? { type: hint } : hint;
|
|
72
|
+
if (!desiredContent.type) {
|
|
73
|
+
if (desiredContent.archive) {
|
|
74
|
+
desiredContent.type = "archive";
|
|
75
|
+
} else if (desiredContent.file) {
|
|
76
|
+
desiredContent.type = "file";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (!desiredContent.type) {
|
|
80
|
+
console.error(`Unable to determine desired content type: ${hint}`);
|
|
81
|
+
throw new Error("No desired content type provided.");
|
|
82
|
+
}
|
|
83
|
+
if (!desiredContent.name) {
|
|
84
|
+
desiredContent.name = desiredContent.type;
|
|
85
|
+
}
|
|
86
|
+
return desiredContent;
|
|
87
|
+
}
|
|
88
|
+
async function getMessageContent(message, desiredContent) {
|
|
89
|
+
switch (desiredContent.type) {
|
|
90
|
+
case "archive":
|
|
91
|
+
return await getFileFromArchiveFromAttachment(message, desiredContent);
|
|
92
|
+
case "file":
|
|
93
|
+
return await getFileFromAttachment(message, desiredContent);
|
|
94
|
+
case "body":
|
|
95
|
+
return getBodyFromMessage(message, desiredContent);
|
|
96
|
+
case "subject":
|
|
97
|
+
case "from":
|
|
98
|
+
case "date":
|
|
99
|
+
return getValueFromMessageHeader(message, desiredContent);
|
|
100
|
+
default:
|
|
101
|
+
return `Unsupported content type: ${desiredContent.type}`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function createConnection(state) {
|
|
105
|
+
const { access_token } = state.configuration;
|
|
106
|
+
const auth = new google.auth.OAuth2();
|
|
107
|
+
auth.credentials = { access_token };
|
|
108
|
+
gmail = google.gmail({ version: "v1", auth });
|
|
109
|
+
return state;
|
|
110
|
+
}
|
|
111
|
+
function removeConnection(state) {
|
|
112
|
+
gmail = void 0;
|
|
113
|
+
return state;
|
|
114
|
+
}
|
|
115
|
+
async function getFileFromArchiveFromAttachment(message, desiredContent) {
|
|
116
|
+
const attachmentResult = await getAttachmentResult(
|
|
117
|
+
message,
|
|
118
|
+
desiredContent.archive
|
|
119
|
+
);
|
|
120
|
+
return await extractFileFromArchiveAttachment(
|
|
121
|
+
attachmentResult,
|
|
122
|
+
desiredContent
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
async function getFileFromAttachment(message, desiredContent) {
|
|
126
|
+
const attachmentResult = await getAttachmentResult(
|
|
127
|
+
message,
|
|
128
|
+
desiredContent.file
|
|
129
|
+
);
|
|
130
|
+
return await extractFileFromAttachment(attachmentResult, desiredContent);
|
|
131
|
+
}
|
|
132
|
+
async function getAttachmentResult(message, expression) {
|
|
133
|
+
var _a;
|
|
134
|
+
const part = (_a = message.parts) == null ? void 0 : _a.find((p) => {
|
|
135
|
+
return isExpressionMatch(p.filename, expression);
|
|
136
|
+
});
|
|
137
|
+
if (!part) {
|
|
138
|
+
console.info(`Attachment not found for: ${expression}`);
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
const { data } = await gmail.users.messages.attachments.get({
|
|
142
|
+
userId: message.userId,
|
|
143
|
+
messageId: message.messageId,
|
|
144
|
+
id: part.body.attachmentId
|
|
145
|
+
});
|
|
146
|
+
return {
|
|
147
|
+
data: data == null ? void 0 : data.data,
|
|
148
|
+
filename: part.filename,
|
|
149
|
+
expression
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
async function extractFileFromArchiveAttachment(attachment, desiredContent) {
|
|
153
|
+
if (!attachment) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
if (!attachment.data) {
|
|
157
|
+
console.error(
|
|
158
|
+
`Data not found in the archive attachment for: ${attachment.expression}`
|
|
159
|
+
);
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
const compressedBuffer = Buffer.from(attachment.data, "base64");
|
|
163
|
+
const directory = await unzipper.Open.buffer(compressedBuffer);
|
|
164
|
+
const file = directory == null ? void 0 : directory.files.find(
|
|
165
|
+
(f) => isExpressionMatch(f.path, desiredContent.file)
|
|
166
|
+
);
|
|
167
|
+
if (!file) {
|
|
168
|
+
console.info(`File not found in the archive for: ${desiredContent.file}`);
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
const fileBuffer = await file.buffer();
|
|
172
|
+
const fileString = fileBuffer.toString("base64");
|
|
173
|
+
const fileContent = Buffer.from(fileString, "base64").toString("utf-8");
|
|
174
|
+
return {
|
|
175
|
+
archiveFilename: attachment.filename,
|
|
176
|
+
filename: file.path,
|
|
177
|
+
content: desiredContent.maxLength ? fileContent.substring(0, desiredContent.maxLength) : fileContent
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
async function extractFileFromAttachment(attachment, desiredContent) {
|
|
181
|
+
if (!attachment) {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
if (!attachment.data) {
|
|
185
|
+
console.error(
|
|
186
|
+
`Data not found in the file attachment for: ${attachment.expression}`
|
|
187
|
+
);
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
const fileContent = Buffer.from(attachment.data, "base64").toString("utf-8");
|
|
191
|
+
return {
|
|
192
|
+
filename: attachment.filename,
|
|
193
|
+
content: desiredContent.maxLength ? fileContent.substring(0, desiredContent.maxLength) : fileContent
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function getBodyFromMessage(message, desiredContent) {
|
|
197
|
+
var _a, _b;
|
|
198
|
+
const bodyPart = (_a = message.parts) == null ? void 0 : _a.find(
|
|
199
|
+
(part) => part.mimeType === "multipart/alternative"
|
|
200
|
+
);
|
|
201
|
+
const textBodyPart = bodyPart == null ? void 0 : bodyPart.parts.find(
|
|
202
|
+
(part) => part.mimeType === "text/plain"
|
|
203
|
+
);
|
|
204
|
+
const textBody = (_b = textBodyPart == null ? void 0 : textBodyPart.body) == null ? void 0 : _b.data;
|
|
205
|
+
if (textBody) {
|
|
206
|
+
const body = Buffer.from(textBody, "base64").toString("utf-8");
|
|
207
|
+
return desiredContent.maxLength ? body.substring(0, desiredContent.maxLength) : body;
|
|
208
|
+
}
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
function getValueFromMessageHeader(message, desiredContent) {
|
|
212
|
+
var _a;
|
|
213
|
+
const header = (_a = message.headers) == null ? void 0 : _a.find(
|
|
214
|
+
(h) => h.name.toLowerCase() === desiredContent.type
|
|
215
|
+
);
|
|
216
|
+
if (!header) {
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
const value = header.value;
|
|
220
|
+
if (desiredContent.type === "date") {
|
|
221
|
+
return new Date(value);
|
|
222
|
+
}
|
|
223
|
+
return desiredContent.maxLength ? value.substring(0, desiredContent.maxLength) : value;
|
|
224
|
+
}
|
|
225
|
+
function isExpressionMatch(text, expression) {
|
|
226
|
+
var _a;
|
|
227
|
+
try {
|
|
228
|
+
return ((_a = expression == null ? void 0 : expression.constructor) == null ? void 0 : _a.name) === "RegExp" ? expression.test(text) : text.includes(expression);
|
|
229
|
+
} catch (e) {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// src/Adaptor.js
|
|
235
|
+
import {
|
|
236
|
+
alterState,
|
|
237
|
+
combine,
|
|
238
|
+
cursor,
|
|
239
|
+
dataPath,
|
|
240
|
+
dataValue,
|
|
241
|
+
each,
|
|
242
|
+
field,
|
|
243
|
+
fields,
|
|
244
|
+
fn,
|
|
245
|
+
fnIf,
|
|
246
|
+
http,
|
|
247
|
+
lastReferenceValue,
|
|
248
|
+
merge,
|
|
249
|
+
sourceValue
|
|
250
|
+
} from "@openfn/language-common";
|
|
251
|
+
function getContentsFromMessages(userId, userOptions) {
|
|
252
|
+
return async (state) => {
|
|
253
|
+
var _a, _b;
|
|
254
|
+
const [resolvedUserId, resolvedUserOptions] = expandReferences(
|
|
255
|
+
state,
|
|
256
|
+
userId,
|
|
257
|
+
userOptions
|
|
258
|
+
);
|
|
259
|
+
const defaultOptions = {
|
|
260
|
+
desiredContents: ["from", "date", "subject", "body"]
|
|
261
|
+
};
|
|
262
|
+
const options = { ...defaultOptions, ...resolvedUserOptions || {} };
|
|
263
|
+
const contents = [];
|
|
264
|
+
const currentIds = [];
|
|
265
|
+
const previousIds = Array.isArray(options.processedIds) ? options.processedIds : [];
|
|
266
|
+
let nextPageToken = null;
|
|
267
|
+
do {
|
|
268
|
+
const messagesResult = await getMessagesResult(
|
|
269
|
+
resolvedUserId,
|
|
270
|
+
options.query,
|
|
271
|
+
nextPageToken
|
|
272
|
+
);
|
|
273
|
+
if (!((_a = messagesResult.messages) == null ? void 0 : _a.length)) {
|
|
274
|
+
console.log("No messages found.");
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
nextPageToken = messagesResult.nextPageToken;
|
|
278
|
+
const currentPageIds = messagesResult.messages.map((message) => message.id);
|
|
279
|
+
const unprocessedIds = currentPageIds.filter(
|
|
280
|
+
(id) => !previousIds.includes(id)
|
|
281
|
+
);
|
|
282
|
+
for (const messageId of unprocessedIds) {
|
|
283
|
+
const content = {
|
|
284
|
+
messageId
|
|
285
|
+
};
|
|
286
|
+
const messageResult = await getMessageResult(userId, messageId);
|
|
287
|
+
for (const desiredContentHint of options.desiredContents) {
|
|
288
|
+
const desiredContent = getDesiredContent(desiredContentHint);
|
|
289
|
+
const messageContent = await getMessageContent(
|
|
290
|
+
messageResult,
|
|
291
|
+
desiredContent
|
|
292
|
+
);
|
|
293
|
+
if (messageContent && content[desiredContent.name]) {
|
|
294
|
+
throw new Error(
|
|
295
|
+
`Duplicate content name detected: ${desiredContent.name}`
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
content[_b = desiredContent.name] ?? (content[_b] = messageContent);
|
|
299
|
+
}
|
|
300
|
+
contents.push(content);
|
|
301
|
+
}
|
|
302
|
+
currentIds.push(...currentPageIds);
|
|
303
|
+
} while (nextPageToken);
|
|
304
|
+
const nextState = {
|
|
305
|
+
...composeNextState(state, contents),
|
|
306
|
+
processedIds: currentIds
|
|
307
|
+
};
|
|
308
|
+
return nextState;
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
function execute(...operations) {
|
|
312
|
+
const initialState = {
|
|
313
|
+
references: [],
|
|
314
|
+
data: null
|
|
315
|
+
};
|
|
316
|
+
return (state) => {
|
|
317
|
+
return commonExecute(
|
|
318
|
+
createConnection,
|
|
319
|
+
...operations,
|
|
320
|
+
removeConnection
|
|
321
|
+
)({
|
|
322
|
+
...initialState,
|
|
323
|
+
...state,
|
|
324
|
+
configuration: normalizeOauthConfig(state.configuration)
|
|
325
|
+
});
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// src/index.js
|
|
330
|
+
var src_default = Adaptor_exports;
|
|
331
|
+
export {
|
|
332
|
+
alterState,
|
|
333
|
+
combine,
|
|
334
|
+
cursor,
|
|
335
|
+
dataPath,
|
|
336
|
+
dataValue,
|
|
337
|
+
src_default as default,
|
|
338
|
+
each,
|
|
339
|
+
execute,
|
|
340
|
+
field,
|
|
341
|
+
fields,
|
|
342
|
+
fn,
|
|
343
|
+
fnIf,
|
|
344
|
+
getContentsFromMessages,
|
|
345
|
+
http,
|
|
346
|
+
lastReferenceValue,
|
|
347
|
+
merge,
|
|
348
|
+
sourceValue
|
|
349
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openfn/language-gmail",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "OpenFn gmail adaptor",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./dist/index.js",
|
|
9
|
+
"types": "./types/index.d.ts",
|
|
10
|
+
"require": "./dist/index.cjs"
|
|
11
|
+
},
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"author": "Open Function Group",
|
|
15
|
+
"license": "LGPLv3",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/",
|
|
18
|
+
"types/",
|
|
19
|
+
"ast.json",
|
|
20
|
+
"configuration-schema.json"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"googleapis": "100.0.0",
|
|
24
|
+
"unzipper": "^0.10.11",
|
|
25
|
+
"@openfn/language-common": "2.3.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"assertion-error": "2.0.0",
|
|
29
|
+
"chai": "4.3.6",
|
|
30
|
+
"deep-eql": "4.1.1",
|
|
31
|
+
"esno": "^0.16.3",
|
|
32
|
+
"mocha": "^10.7.3",
|
|
33
|
+
"rimraf": "3.0.2",
|
|
34
|
+
"undici": "^5.22.1"
|
|
35
|
+
},
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/openfn/adaptors.git"
|
|
39
|
+
},
|
|
40
|
+
"types": "types/index.d.ts",
|
|
41
|
+
"main": "dist/index.cjs",
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "pnpm clean && build-adaptor gmail",
|
|
44
|
+
"test": "mocha --experimental-specifier-resolution=node --no-warnings",
|
|
45
|
+
"test:watch": "mocha -w --experimental-specifier-resolution=node --no-warnings",
|
|
46
|
+
"clean": "rimraf dist types docs",
|
|
47
|
+
"pack": "pnpm pack --pack-destination ../../dist",
|
|
48
|
+
"lint": "eslint src"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used to isolate the type of content to retrieve from the message.
|
|
3
|
+
* @typedef {Object} DesiredContent
|
|
4
|
+
* @public
|
|
5
|
+
* @property {string} type - Message content type. Valid types: from, date, subject, body, archive, file.
|
|
6
|
+
* @property {string?} [name=null] - A custom description for the content type. Optional.
|
|
7
|
+
* @property {RegExp|string} [archive] - Identifier to isolate the desired attachment when type is 'archive'.
|
|
8
|
+
* Use a regular expression for pattern matching or a string for a literal match. Required if type is 'archive'.
|
|
9
|
+
* @property {RegExp|string} [file] - Identifier to isolate the desired attachment when type is 'file' or 'archive'.
|
|
10
|
+
* Use a regular expression for pattern matching or a string for a literal match. Required if type is 'file' or 'archive'.
|
|
11
|
+
* @property {number?} [maxLength=null] - Maximum number of characters to retrieve from the content. Optional.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Configurable options provided to the Gmail adaptor.
|
|
15
|
+
* @typedef {Object} Options
|
|
16
|
+
* @public
|
|
17
|
+
* @property {string} userId - The email address of the Gmail account.
|
|
18
|
+
* @property {string?} [query=null] - Custom query to limit the messages result. Adheres to the Gmail search syntax. Optional.
|
|
19
|
+
* @property {Array<string|DesiredContent>?} [desiredContents=['from', 'date', 'subject', 'body']]
|
|
20
|
+
* An array of strings or DesiredContent objects used to specify which parts of the message to retrieve. Optional, default is `['from', 'date', 'subject', 'body']`.
|
|
21
|
+
* @property {Array<string>?} [processedIds=null] - Ignore message ids which have already been processed. Optional.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Requests contents from messages of a Gmail account.
|
|
25
|
+
* @public
|
|
26
|
+
* @function
|
|
27
|
+
* @param {string} userId - The email address of the account to retrieve messages from.
|
|
28
|
+
* @param {Options} userOptions - Customized options including desired contents and query.
|
|
29
|
+
* @returns {Function} A function that processes the state.
|
|
30
|
+
* @example
|
|
31
|
+
* getContentsFromMessages(
|
|
32
|
+
* 'test@tester.com',
|
|
33
|
+
* {
|
|
34
|
+
* query: 'in:inbox subject:my+test+message',
|
|
35
|
+
* desiredContents: ['date', 'from', 'subject', { type: 'body', maxLength: 50 }]
|
|
36
|
+
* }
|
|
37
|
+
* )
|
|
38
|
+
*/
|
|
39
|
+
export function getContentsFromMessages(userId: string, userOptions: Options): Function;
|
|
40
|
+
/**
|
|
41
|
+
* Execute a sequence of operations.
|
|
42
|
+
* Wraps `language-common/execute`, and prepends initial state for http.
|
|
43
|
+
* @private
|
|
44
|
+
* @param {Operations} operations - Operations to be performed.
|
|
45
|
+
* @returns {Operation}
|
|
46
|
+
*/
|
|
47
|
+
export function execute(...operations: Operations): Operation;
|
|
48
|
+
/**
|
|
49
|
+
* Used to isolate the type of content to retrieve from the message.
|
|
50
|
+
*/
|
|
51
|
+
export type DesiredContent = any;
|
|
52
|
+
/**
|
|
53
|
+
* Configurable options provided to the Gmail adaptor.
|
|
54
|
+
*/
|
|
55
|
+
export type Options = any;
|
|
56
|
+
export { alterState, combine, cursor, dataPath, dataValue, each, field, fields, fn, fnIf, http, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
|
package/types/Utils.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function getMessagesResult(userId: any, query: any, lastPageToken: any): Promise<{
|
|
2
|
+
messages: any;
|
|
3
|
+
nextPageToken: any;
|
|
4
|
+
}>;
|
|
5
|
+
export function getMessageResult(userId: any, messageId: any): Promise<{
|
|
6
|
+
userId: any;
|
|
7
|
+
messageId: any;
|
|
8
|
+
parts: any;
|
|
9
|
+
headers: any;
|
|
10
|
+
}>;
|
|
11
|
+
export function getDesiredContent(hint: any): any;
|
|
12
|
+
export function getMessageContent(message: any, desiredContent: any): Promise<any>;
|
|
13
|
+
export function createConnection(state: any): any;
|
|
14
|
+
export function removeConnection(state: any): any;
|
package/types/index.d.ts
ADDED