@pipedream/microsoft_outlook 1.7.9 → 1.8.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/actions/add-label-to-email/add-label-to-email.mjs +1 -1
- package/actions/approve-workflow/approve-workflow.mjs +1 -1
- package/actions/create-contact/create-contact.mjs +1 -1
- package/actions/create-draft-email/create-draft-email.mjs +1 -1
- package/actions/download-attachment/download-attachment.mjs +3 -13
- package/actions/find-contacts/find-contacts.mjs +1 -1
- package/actions/find-email/find-email.mjs +1 -1
- package/actions/find-shared-folder-email/find-shared-folder-email.mjs +1 -1
- package/actions/list-contacts/list-contacts.mjs +1 -1
- package/actions/list-folders/list-folders.mjs +1 -1
- package/actions/list-labels/list-labels.mjs +1 -1
- package/actions/move-email-to-folder/move-email-to-folder.mjs +1 -1
- package/actions/remove-label-from-email/remove-label-from-email.mjs +1 -1
- package/actions/reply-to-email/reply-to-email.mjs +1 -1
- package/actions/send-email/send-email.mjs +1 -1
- package/actions/update-contact/update-contact.mjs +1 -1
- package/microsoft_outlook.app.mjs +125 -182
- package/package.json +2 -1
- package/sources/new-attachment-received/new-attachment-received.mjs +2 -4
- package/sources/new-contact/new-contact.mjs +1 -1
- package/sources/new-email/new-email.mjs +1 -1
- package/sources/new-email-in-shared-folder/new-email-in-shared-folder.mjs +1 -1
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "microsoft_outlook-add-label-to-email",
|
|
6
6
|
name: "Add Label to Email",
|
|
7
7
|
description: "Adds a label/category to an email in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/message-update)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.16",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: true,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "microsoft_outlook-approve-workflow",
|
|
5
5
|
name: "Approve Workflow",
|
|
6
6
|
description: "Suspend the workflow until approved by email. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.14",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
key: "microsoft_outlook-download-attachment",
|
|
14
14
|
name: "Download Attachment",
|
|
15
15
|
description: "Downloads an attachment to the /tmp directory. [See the documentation](https://learn.microsoft.com/en-us/graph/api/attachment-get?view=graph-rest-1.0&tabs=http)",
|
|
16
|
-
version: "0.0.
|
|
16
|
+
version: "0.0.12",
|
|
17
17
|
annotations: {
|
|
18
18
|
destructiveHint: false,
|
|
19
19
|
openWorldHint: true,
|
|
@@ -56,14 +56,6 @@ export default {
|
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
methods: {
|
|
59
|
-
getAttachmentInfo({
|
|
60
|
-
messageId, attachmentId, ...args
|
|
61
|
-
}) {
|
|
62
|
-
return this.microsoftOutlook._makeRequest({
|
|
63
|
-
path: `/me/messages/${messageId}/attachments/${attachmentId}`,
|
|
64
|
-
...args,
|
|
65
|
-
});
|
|
66
|
-
},
|
|
67
59
|
async imageToPdf(imageBuffer) {
|
|
68
60
|
return new Promise((resolve, reject) => {
|
|
69
61
|
const doc = new PDFDocument({
|
|
@@ -113,7 +105,6 @@ export default {
|
|
|
113
105
|
$,
|
|
114
106
|
messageId: this.messageId,
|
|
115
107
|
attachmentId: this.attachmentId,
|
|
116
|
-
responseType: "arraybuffer",
|
|
117
108
|
});
|
|
118
109
|
|
|
119
110
|
let filename = this.filename;
|
|
@@ -122,11 +113,10 @@ export default {
|
|
|
122
113
|
filename = `${name}.pdf`;
|
|
123
114
|
}
|
|
124
115
|
|
|
125
|
-
|
|
126
|
-
let buffer = Buffer.from(rawcontent, "base64");
|
|
116
|
+
let buffer = await this.microsoftOutlook.streamToBuffer(response);
|
|
127
117
|
|
|
128
118
|
if (this.convertToPdf) {
|
|
129
|
-
const { contentType: mimeType } = await this.getAttachmentInfo({
|
|
119
|
+
const { contentType: mimeType } = await this.microsoftOutlook.getAttachmentInfo({
|
|
130
120
|
$,
|
|
131
121
|
messageId: this.messageId,
|
|
132
122
|
attachmentId: this.attachmentId,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "microsoft_outlook-find-email",
|
|
6
6
|
name: "Find Email",
|
|
7
7
|
description: "Search for an email in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-messages)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.17",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "microsoft_outlook-find-shared-folder-email",
|
|
6
6
|
name: "Find Shared Folder Email",
|
|
7
7
|
description: "Search for an email in a shared folder in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-messages)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.8",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "microsoft_outlook-list-folders",
|
|
5
5
|
name: "List Folders",
|
|
6
6
|
description: "Retrieves a list of all folders in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-mailfolders)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.14",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "microsoft_outlook-list-labels",
|
|
5
5
|
name: "List Labels",
|
|
6
6
|
description: "Get all the labels/categories that have been defined for a user. [See the documentation](https://learn.microsoft.com/en-us/graph/api/outlookuser-list-mastercategories)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.16",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "microsoft_outlook-move-email-to-folder",
|
|
5
5
|
name: "Move Email to Folder",
|
|
6
6
|
description: "Moves an email to the specified folder in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/message-move)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.14",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "microsoft_outlook-remove-label-from-email",
|
|
5
5
|
name: "Remove Label from Email",
|
|
6
6
|
description: "Removes a label/category from an email in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/message-update)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.16",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "microsoft_outlook-reply-to-email",
|
|
5
5
|
name: "Reply to Email",
|
|
6
6
|
description: "Reply to an email in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/message-reply)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.13",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { getFileStreamAndMetadata } from "@pipedream/platform";
|
|
2
|
+
import { Client } from "@microsoft/microsoft-graph-client";
|
|
3
|
+
import "isomorphic-fetch";
|
|
4
4
|
const DEFAULT_LIMIT = 50;
|
|
5
5
|
|
|
6
6
|
export default {
|
|
@@ -266,64 +266,26 @@ export default {
|
|
|
266
266
|
},
|
|
267
267
|
},
|
|
268
268
|
methods: {
|
|
269
|
-
|
|
270
|
-
return
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
"Authorization": `Bearer ${this.$auth.oauth_access_token}`,
|
|
275
|
-
"accept": "application/json",
|
|
276
|
-
"Content-Type": "application/json",
|
|
277
|
-
...headers,
|
|
278
|
-
};
|
|
279
|
-
},
|
|
280
|
-
async _makeRequest({
|
|
281
|
-
$,
|
|
282
|
-
path,
|
|
283
|
-
headers,
|
|
284
|
-
...otherConfig
|
|
285
|
-
} = {}) {
|
|
286
|
-
const config = {
|
|
287
|
-
url: this._getUrl(path),
|
|
288
|
-
headers: this._getHeaders(headers),
|
|
289
|
-
...otherConfig,
|
|
290
|
-
};
|
|
291
|
-
try {
|
|
292
|
-
return await axios($ ?? this, config);
|
|
293
|
-
} catch (error) {
|
|
294
|
-
if (error?.response?.status === 403) {
|
|
295
|
-
throw new Error("Insufficient permissions. Please verify that your Microsoft account has the necessary permissions to perform this operation.");
|
|
296
|
-
}
|
|
297
|
-
throw error;
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
async createHook({ ...args } = {}) {
|
|
301
|
-
const response = await this._makeRequest({
|
|
302
|
-
method: "POST",
|
|
303
|
-
path: "/subscriptions",
|
|
304
|
-
...args,
|
|
269
|
+
client() {
|
|
270
|
+
return Client.init({
|
|
271
|
+
authProvider: (done) => {
|
|
272
|
+
done(null, this.$auth.oauth_access_token);
|
|
273
|
+
},
|
|
305
274
|
});
|
|
306
|
-
|
|
275
|
+
},
|
|
276
|
+
async createHook({ data = {} } = {}) {
|
|
277
|
+
return await this.client().api("/subscriptions")
|
|
278
|
+
.post(data);
|
|
307
279
|
},
|
|
308
280
|
async renewHook({
|
|
309
|
-
hookId,
|
|
310
|
-
...args
|
|
281
|
+
hookId, data = {},
|
|
311
282
|
} = {}) {
|
|
312
|
-
return await this.
|
|
313
|
-
|
|
314
|
-
path: `/subscriptions/${hookId}`,
|
|
315
|
-
...args,
|
|
316
|
-
});
|
|
283
|
+
return await this.client().api(`/subscriptions/${hookId}`)
|
|
284
|
+
.patch(data);
|
|
317
285
|
},
|
|
318
|
-
async deleteHook({
|
|
319
|
-
hookId
|
|
320
|
-
|
|
321
|
-
} = {}) {
|
|
322
|
-
return await this._makeRequest({
|
|
323
|
-
method: "DELETE",
|
|
324
|
-
path: `/subscriptions/${hookId}`,
|
|
325
|
-
...args,
|
|
326
|
-
});
|
|
286
|
+
async deleteHook({ hookId } = {}) {
|
|
287
|
+
return await this.client().api(`/subscriptions/${hookId}`)
|
|
288
|
+
.delete();
|
|
327
289
|
},
|
|
328
290
|
async streamToBase64(stream) {
|
|
329
291
|
return new Promise((resolve, reject) => {
|
|
@@ -337,6 +299,35 @@ export default {
|
|
|
337
299
|
stream.on("error", reject);
|
|
338
300
|
});
|
|
339
301
|
},
|
|
302
|
+
async streamToBuffer(stream) {
|
|
303
|
+
// Node.js Readable stream
|
|
304
|
+
if (typeof stream.on === "function") {
|
|
305
|
+
return new Promise((resolve, reject) => {
|
|
306
|
+
const chunks = [];
|
|
307
|
+
stream.on("data", (chunk) => chunks.push(chunk));
|
|
308
|
+
stream.on("end", () => resolve(Buffer.concat(chunks)));
|
|
309
|
+
stream.on("error", reject);
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Web ReadableStream (WHATWG)
|
|
314
|
+
if (typeof stream.getReader === "function") {
|
|
315
|
+
const reader = stream.getReader();
|
|
316
|
+
const chunks = [];
|
|
317
|
+
|
|
318
|
+
while (true) {
|
|
319
|
+
const {
|
|
320
|
+
done, value,
|
|
321
|
+
} = await reader.read();
|
|
322
|
+
if (done) break;
|
|
323
|
+
chunks.push(Buffer.from(value));
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
return Buffer.concat(chunks);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
throw new Error("Unknown stream type returned by Microsoft Graph client");
|
|
330
|
+
},
|
|
340
331
|
async prepareMessageBody(self) {
|
|
341
332
|
const toRecipients = [];
|
|
342
333
|
const ccRecipients = [];
|
|
@@ -397,159 +388,111 @@ export default {
|
|
|
397
388
|
|
|
398
389
|
return message;
|
|
399
390
|
},
|
|
400
|
-
async sendEmail({
|
|
401
|
-
return await this.
|
|
402
|
-
|
|
403
|
-
path: "/me/sendMail",
|
|
404
|
-
...args,
|
|
405
|
-
});
|
|
391
|
+
async sendEmail({ data = {} } = {}) {
|
|
392
|
+
return await this.client().api("/me/sendMail")
|
|
393
|
+
.post(data);
|
|
406
394
|
},
|
|
407
395
|
async replyToEmail({
|
|
408
|
-
messageId,
|
|
409
|
-
}) {
|
|
410
|
-
return await this.
|
|
411
|
-
|
|
412
|
-
path: `/me/messages/${messageId}/reply`,
|
|
413
|
-
...args,
|
|
414
|
-
});
|
|
396
|
+
messageId, data = {},
|
|
397
|
+
} = {}) {
|
|
398
|
+
return await this.client().api(`/me/messages/${messageId}/reply`)
|
|
399
|
+
.post(data);
|
|
415
400
|
},
|
|
416
|
-
async createDraft({
|
|
417
|
-
return await this.
|
|
418
|
-
|
|
419
|
-
path: "/me/messages",
|
|
420
|
-
...args,
|
|
421
|
-
});
|
|
401
|
+
async createDraft({ data = {} } = {}) {
|
|
402
|
+
return await this.client().api("/me/messages")
|
|
403
|
+
.post(data);
|
|
422
404
|
},
|
|
423
|
-
async createContact({
|
|
424
|
-
return await this.
|
|
425
|
-
|
|
426
|
-
path: "/me/contacts",
|
|
427
|
-
...args,
|
|
428
|
-
});
|
|
405
|
+
async createContact({ data = {} } = {}) {
|
|
406
|
+
return await this.client().api("/me/contacts")
|
|
407
|
+
.post(data);
|
|
429
408
|
},
|
|
430
409
|
async listContacts({
|
|
431
|
-
filterAddress,
|
|
432
|
-
...args
|
|
410
|
+
filterAddress, params = {},
|
|
433
411
|
} = {}) {
|
|
434
|
-
args.params = {
|
|
435
|
-
...args?.params,
|
|
436
|
-
};
|
|
437
412
|
if (filterAddress) {
|
|
438
|
-
|
|
413
|
+
params["$filter"] = `emailAddresses/any(a:a/address eq '${filterAddress}')`;
|
|
439
414
|
}
|
|
440
|
-
return await this.
|
|
441
|
-
|
|
442
|
-
path: "/me/contacts",
|
|
443
|
-
...args,
|
|
444
|
-
});
|
|
415
|
+
return await this.client().api("/me/contacts")
|
|
416
|
+
.get(params);
|
|
445
417
|
},
|
|
446
418
|
async updateContact({
|
|
447
|
-
contactId,
|
|
448
|
-
...args
|
|
419
|
+
contactId, data = {},
|
|
449
420
|
} = {}) {
|
|
450
|
-
return await this.
|
|
451
|
-
|
|
452
|
-
path: `/me/contacts/${contactId}`,
|
|
453
|
-
...args,
|
|
454
|
-
});
|
|
421
|
+
return await this.client().api(`/me/contacts/${contactId}`)
|
|
422
|
+
.patch(data);
|
|
455
423
|
},
|
|
456
424
|
async getMessage({
|
|
457
|
-
messageId,
|
|
458
|
-
...args
|
|
425
|
+
messageId, params = {},
|
|
459
426
|
} = {}) {
|
|
460
|
-
return await this.
|
|
461
|
-
|
|
462
|
-
path: `/me/messages/${messageId}`,
|
|
463
|
-
...args,
|
|
464
|
-
});
|
|
427
|
+
return await this.client().api(`/me/messages/${messageId}`)
|
|
428
|
+
.get(params);
|
|
465
429
|
},
|
|
466
|
-
async listMessages({
|
|
467
|
-
return await this.
|
|
468
|
-
|
|
469
|
-
path: "/me/messages",
|
|
470
|
-
...args,
|
|
471
|
-
});
|
|
430
|
+
async listMessages({ params = {} } = {}) {
|
|
431
|
+
return await this.client().api("/me/messages")
|
|
432
|
+
.get(params);
|
|
472
433
|
},
|
|
473
434
|
async listSharedFolderMessages({
|
|
474
|
-
userId, sharedFolderId,
|
|
435
|
+
userId, sharedFolderId, params = {},
|
|
475
436
|
} = {}) {
|
|
476
|
-
return await this.
|
|
477
|
-
|
|
478
|
-
path: `/users/${userId}/mailFolders/${sharedFolderId}/messages`,
|
|
479
|
-
...args,
|
|
480
|
-
});
|
|
437
|
+
return await this.client().api(`/users/${userId}/mailFolders/${sharedFolderId}/messages`)
|
|
438
|
+
.get(params);
|
|
481
439
|
},
|
|
482
440
|
async getContact({
|
|
483
|
-
contactId,
|
|
484
|
-
...args
|
|
441
|
+
contactId, params = {},
|
|
485
442
|
} = {}) {
|
|
486
|
-
return await this.
|
|
487
|
-
|
|
488
|
-
path: `/me/contacts/${contactId}`,
|
|
489
|
-
...args,
|
|
490
|
-
});
|
|
443
|
+
return await this.client().api(`/me/contacts/${contactId}`)
|
|
444
|
+
.get(params);
|
|
491
445
|
},
|
|
492
|
-
listLabels(
|
|
493
|
-
return this.
|
|
494
|
-
|
|
495
|
-
...args,
|
|
496
|
-
});
|
|
446
|
+
async listLabels({ params = {} } = {}) {
|
|
447
|
+
return await this.client().api("/me/outlook/masterCategories")
|
|
448
|
+
.get(params);
|
|
497
449
|
},
|
|
498
|
-
listFolders(
|
|
499
|
-
return this.
|
|
500
|
-
|
|
501
|
-
...args,
|
|
502
|
-
});
|
|
450
|
+
async listFolders({ params = {} } = {}) {
|
|
451
|
+
return await this.client().api("/me/mailFolders")
|
|
452
|
+
.get(params);
|
|
503
453
|
},
|
|
504
|
-
moveMessage({
|
|
505
|
-
messageId,
|
|
506
|
-
}) {
|
|
507
|
-
return this.
|
|
508
|
-
|
|
509
|
-
path: `/me/messages/${messageId}/move`,
|
|
510
|
-
...args,
|
|
511
|
-
});
|
|
454
|
+
async moveMessage({
|
|
455
|
+
messageId, data = {},
|
|
456
|
+
} = {}) {
|
|
457
|
+
return await this.client().api(`/me/messages/${messageId}/move`)
|
|
458
|
+
.post(data);
|
|
512
459
|
},
|
|
513
|
-
updateMessage({
|
|
514
|
-
messageId,
|
|
515
|
-
}) {
|
|
516
|
-
return this.
|
|
517
|
-
|
|
518
|
-
path: `/me/messages/${messageId}`,
|
|
519
|
-
...args,
|
|
520
|
-
});
|
|
460
|
+
async updateMessage({
|
|
461
|
+
messageId, data = {},
|
|
462
|
+
} = {}) {
|
|
463
|
+
return await this.client().api(`/me/messages/${messageId}`)
|
|
464
|
+
.patch(data);
|
|
521
465
|
},
|
|
522
|
-
getAttachment({
|
|
523
|
-
messageId, attachmentId,
|
|
524
|
-
}) {
|
|
525
|
-
return this.
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
});
|
|
466
|
+
async getAttachment({
|
|
467
|
+
messageId, attachmentId, params = {},
|
|
468
|
+
} = {}) {
|
|
469
|
+
return await this.client().api(`/me/messages/${messageId}/attachments/${attachmentId}/$value`)
|
|
470
|
+
.responseType("stream")
|
|
471
|
+
.get(params);
|
|
529
472
|
},
|
|
530
|
-
|
|
531
|
-
messageId,
|
|
532
|
-
}) {
|
|
533
|
-
return this.
|
|
534
|
-
|
|
535
|
-
...args,
|
|
536
|
-
});
|
|
473
|
+
async getAttachmentInfo({
|
|
474
|
+
messageId, attachmentId, params = {},
|
|
475
|
+
} = {}) {
|
|
476
|
+
return await this.client().api(`/me/messages/${messageId}/attachments/${attachmentId}`)
|
|
477
|
+
.get(params);
|
|
537
478
|
},
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
479
|
+
async listAttachments({
|
|
480
|
+
messageId, params = {},
|
|
481
|
+
} = {}) {
|
|
482
|
+
return await this.client().api(`/me/messages/${messageId}/attachments`)
|
|
483
|
+
.get(params);
|
|
484
|
+
},
|
|
485
|
+
async listUsers({ params = {} } = {}) {
|
|
486
|
+
return await this.client().api("/users")
|
|
487
|
+
.get(params);
|
|
543
488
|
},
|
|
544
489
|
async listSharedFolders({
|
|
545
|
-
userId, parentFolderId,
|
|
490
|
+
userId, parentFolderId, params = {},
|
|
546
491
|
} = {}) {
|
|
547
|
-
const { value } = await this.
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
...args,
|
|
552
|
-
});
|
|
492
|
+
const { value } = await this.client().api(`/users/${userId}/mailFolders${parentFolderId
|
|
493
|
+
? `/${parentFolderId}/childFolders`
|
|
494
|
+
: ""}`)
|
|
495
|
+
.get(params);
|
|
553
496
|
|
|
554
497
|
const foldersArray = [];
|
|
555
498
|
for (const folder of value) {
|
|
@@ -557,7 +500,6 @@ export default {
|
|
|
557
500
|
foldersArray.push(...await this.listSharedFolders({
|
|
558
501
|
userId,
|
|
559
502
|
parentFolderId: folder.id,
|
|
560
|
-
...args,
|
|
561
503
|
}));
|
|
562
504
|
}
|
|
563
505
|
|
|
@@ -575,18 +517,19 @@ export default {
|
|
|
575
517
|
$skip: 0,
|
|
576
518
|
},
|
|
577
519
|
};
|
|
578
|
-
let
|
|
520
|
+
let hasMore, count = 0;
|
|
579
521
|
do {
|
|
580
|
-
const
|
|
522
|
+
const response = await fn(args);
|
|
523
|
+
const { value } = response;
|
|
581
524
|
for (const item of value) {
|
|
582
525
|
yield item;
|
|
583
526
|
if (max && ++count >= max) {
|
|
584
527
|
return;
|
|
585
528
|
}
|
|
586
529
|
}
|
|
587
|
-
|
|
530
|
+
hasMore = response?.["@odata.nextLink"];
|
|
588
531
|
args.params["$skip"] += limit;
|
|
589
|
-
} while (
|
|
532
|
+
} while (hasMore);
|
|
590
533
|
},
|
|
591
534
|
},
|
|
592
535
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/microsoft_outlook",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Pipedream Microsoft Outlook Components",
|
|
5
5
|
"main": "microsoft_outlook.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"homepage": "https://pipedream.com/apps/microsoft_outlook",
|
|
13
13
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
14
14
|
"dependencies": {
|
|
15
|
+
"@microsoft/microsoft-graph-client": "^3.0.7",
|
|
15
16
|
"@pipedream/platform": "^3.1.1",
|
|
16
17
|
"@sparticuz/chromium": "^143.0.4",
|
|
17
18
|
"axios": "^0.30.2",
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "microsoft_outlook-new-attachment-received",
|
|
7
7
|
name: "New Attachment Received (Instant)",
|
|
8
8
|
description: "Emit new event when a new email containing one or more attachments arrives in a specified Microsoft Outlook folder.",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.7",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
props: {
|
|
@@ -56,10 +56,8 @@ export default {
|
|
|
56
56
|
const messageAttachment = await this.microsoftOutlook.getAttachment({
|
|
57
57
|
messageId: item.messageId,
|
|
58
58
|
attachmentId: item.id,
|
|
59
|
-
responseType: "arraybuffer",
|
|
60
59
|
});
|
|
61
|
-
const
|
|
62
|
-
const buffer = Buffer.from(rawcontent, "base64");
|
|
60
|
+
const buffer = await this.microsoftOutlook.streamToBuffer(messageAttachment);
|
|
63
61
|
const filepath = `${item.id}/${item.name}`;
|
|
64
62
|
// Upload the attachment to the configured directory (File Stash) so it
|
|
65
63
|
// can be accessed later.
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "microsoft_outlook-new-email",
|
|
8
8
|
name: "New Email Event (Instant)",
|
|
9
9
|
description: "Emit new event when an email is received in specified folders.",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.9",
|
|
11
11
|
type: "source",
|
|
12
12
|
dedupe: "unique",
|
|
13
13
|
methods: {
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "microsoft_outlook-new-email-in-shared-folder",
|
|
8
8
|
name: "New Email in Shared Folder Event",
|
|
9
9
|
description: "Emit new event when an email is received in specified shared folders.",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.9",
|
|
11
11
|
type: "source",
|
|
12
12
|
dedupe: "unique",
|
|
13
13
|
props: {
|