@pipedream/microsoft_outlook 1.7.6 → 1.7.8

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.
@@ -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.12",
8
+ version: "0.0.14",
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.10",
7
+ version: "0.0.12",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
3
3
  export default {
4
4
  type: "action",
5
5
  key: "microsoft_outlook-create-contact",
6
- version: "0.0.19",
6
+ version: "0.0.21",
7
7
  annotations: {
8
8
  destructiveHint: false,
9
9
  openWorldHint: true,
@@ -4,7 +4,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
4
4
  export default {
5
5
  type: "action",
6
6
  key: "microsoft_outlook-create-draft-email",
7
- version: "0.0.19",
7
+ version: "0.0.21",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "microsoft_outlook-download-attachment",
7
7
  name: "Download Attachment",
8
8
  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)",
9
- version: "0.0.7",
9
+ version: "0.0.9",
10
10
  annotations: {
11
11
  destructiveHint: false,
12
12
  openWorldHint: true,
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
3
3
  export default {
4
4
  type: "action",
5
5
  key: "microsoft_outlook-find-contacts",
6
- version: "0.0.19",
6
+ version: "0.0.21",
7
7
  annotations: {
8
8
  destructiveHint: false,
9
9
  openWorldHint: true,
@@ -1,10 +1,11 @@
1
1
  import microsoftOutlook from "../../microsoft_outlook.app.mjs";
2
+ import { ConfigurationError } from "@pipedream/platform";
2
3
 
3
4
  export default {
4
5
  key: "microsoft_outlook-find-email",
5
6
  name: "Find Email",
6
7
  description: "Search for an email in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-messages)",
7
- version: "0.0.13",
8
+ version: "0.0.15",
8
9
  annotations: {
9
10
  destructiveHint: false,
10
11
  openWorldHint: true,
@@ -16,7 +17,7 @@ export default {
16
17
  info: {
17
18
  type: "alert",
18
19
  alertType: "info",
19
- content: "When you specify `$filter`, the service infers a sort order for the results. If you use both `$orderby` and `$filter` to get messages, because the server always infers a sort order for the results of a `$filter`, you must [specify properties in certain ways](https://learn.microsoft.com/en-us/graph/api/user-list-messages#using-filter-and-orderby-in-the-same-query).",
20
+ content: "**Note:** `$search` cannot be used together with `$filter` or `$orderby`. When you specify `$filter`, the service infers a sort order for the results. If you use both `$orderby` and `$filter` to get messages, because the server always infers a sort order for the results of a `$filter`, you must [specify properties in certain ways](https://learn.microsoft.com/en-us/graph/api/user-list-messages#using-filter-and-orderby-in-the-same-query).",
20
21
  },
21
22
  search: {
22
23
  propDefinition: [
@@ -51,6 +52,10 @@ export default {
51
52
  },
52
53
  },
53
54
  async run({ $ }) {
55
+ if (this.search && (this.filter || this.orderBy)) {
56
+ throw new ConfigurationError("`$search` not supported when using `$filter` or `$orderby`.");
57
+ }
58
+
54
59
  let emails = [];
55
60
 
56
61
  if (!this.search) {
@@ -73,8 +78,6 @@ export default {
73
78
  const { value } = await this.microsoftOutlook.listMessages({
74
79
  $,
75
80
  params: {
76
- "$filter": this.filter,
77
- "$orderby": this.orderBy,
78
81
  "$search": this.ensureQuotes(this.search),
79
82
  "$top": this.maxResults,
80
83
  },
@@ -1,10 +1,11 @@
1
1
  import microsoftOutlook from "../../microsoft_outlook.app.mjs";
2
+ import { ConfigurationError } from "@pipedream/platform";
2
3
 
3
4
  export default {
4
5
  key: "microsoft_outlook-find-shared-folder-email",
5
6
  name: "Find Shared Folder Email",
6
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)",
7
- version: "0.0.4",
8
+ version: "0.0.6",
8
9
  annotations: {
9
10
  destructiveHint: false,
10
11
  openWorldHint: true,
@@ -31,7 +32,7 @@ export default {
31
32
  info: {
32
33
  type: "alert",
33
34
  alertType: "info",
34
- content: "When you specify `$filter`, the service infers a sort order for the results. If you use both `$orderby` and `$filter` to get messages, because the server always infers a sort order for the results of a `$filter`, you must [specify properties in certain ways](https://learn.microsoft.com/en-us/graph/api/user-list-messages#using-filter-and-orderby-in-the-same-query).",
35
+ content: "**Note:** `$search` cannot be used together with `$filter` or `$orderby`. When you specify `$filter`, the service infers a sort order for the results. If you use both `$orderby` and `$filter` to get messages, because the server always infers a sort order for the results of a `$filter`, you must [specify properties in certain ways](https://learn.microsoft.com/en-us/graph/api/user-list-messages#using-filter-and-orderby-in-the-same-query).",
35
36
  },
36
37
  search: {
37
38
  propDefinition: [
@@ -59,6 +60,10 @@ export default {
59
60
  },
60
61
  },
61
62
  async run({ $ }) {
63
+ if (this.search && (this.filter || this.orderBy)) {
64
+ throw new ConfigurationError("`$search` not supported when using `$filter` or `$orderby`.");
65
+ }
66
+
62
67
  const items = this.microsoftOutlook.paginate({
63
68
  fn: this.microsoftOutlook.listSharedFolderMessages,
64
69
  args: {
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
3
3
  export default {
4
4
  type: "action",
5
5
  key: "microsoft_outlook-list-contacts",
6
- version: "0.0.19",
6
+ version: "0.0.21",
7
7
  annotations: {
8
8
  destructiveHint: false,
9
9
  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.10",
7
+ version: "0.0.12",
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.12",
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-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.10",
7
+ version: "0.0.12",
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.12",
7
+ version: "0.0.14",
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.9",
7
+ version: "0.0.11",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
4
4
  export default {
5
5
  type: "action",
6
6
  key: "microsoft_outlook-send-email",
7
- version: "0.0.20",
7
+ version: "0.0.22",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
3
3
  export default {
4
4
  type: "action",
5
5
  key: "microsoft_outlook-update-contact",
6
- version: "0.0.19",
6
+ version: "0.0.21",
7
7
  annotations: {
8
8
  destructiveHint: true,
9
9
  openWorldHint: true,
@@ -195,8 +195,19 @@ export default {
195
195
  type: "string",
196
196
  label: "User ID",
197
197
  description: "The ID of the user to get messages for",
198
- async options() {
199
- const { value: users } = await this.listUsers();
198
+ useQuery: true,
199
+ async options({ query }) {
200
+ const args = query
201
+ ? {
202
+ params: {
203
+ $search: `"${encodeURIComponent("displayName:" + query)}" OR "${encodeURIComponent("mail:" + query)}" OR "${encodeURIComponent("userPrincipalName:" + query)}"`,
204
+ },
205
+ headers: {
206
+ "ConsistencyLevel": "eventual",
207
+ },
208
+ }
209
+ : {};
210
+ const { value: users } = await this.listUsers(args);
200
211
  return users?.map(({
201
212
  id: value, displayName, mail,
202
213
  }) => ({
@@ -238,19 +249,19 @@ export default {
238
249
  search: {
239
250
  type: "string",
240
251
  label: "Search",
241
- description: "Search for an email in Microsoft Outlook. Can search for specific message properties such as `\"to:example@example.com\"` or `\"subject:example\"`. If the property is excluded, the search targets the default propertes `from`, `subject`, and `body`. For example, `\"pizza\"` will search for messages with the word `pizza` in the subject, body, or from address, but `\"to:example@example.com\"` will only search for messages to `example@example.com`.",
252
+ description: "Search for an email in Microsoft Outlook. Can search for specific message properties such as `\"to:example@example.com\"` or `\"subject:example\"`. If the property is excluded, the search targets the default propertes `from`, `subject`, and `body`. For example, `\"pizza\"` will search for messages with the word `pizza` in the subject, body, or from address, but `\"to:example@example.com\"` will only search for messages to `example@example.com`. Not for use with `$filter` or `$orderby`.",
242
253
  optional: true,
243
254
  },
244
255
  filter: {
245
256
  type: "string",
246
257
  label: "Filter",
247
- description: "Filters results. For example, `contains(subject, 'meet for lunch?')` will include messages whose subject contains ‘meet for lunch?’. [See documentation](https://learn.microsoft.com/en-us/graph/filter-query-parameter) for the full list of operations.",
258
+ description: "Filters results. For example, `contains(subject, 'meet for lunch?')` will include messages whose subject contains ‘meet for lunch?’. [See documentation](https://learn.microsoft.com/en-us/graph/filter-query-parameter) for the full list of operations. Not for use with `$search`.",
248
259
  optional: true,
249
260
  },
250
261
  orderBy: {
251
262
  type: "string",
252
263
  label: "Order By",
253
- description: "Order results by a property. For example, `receivedDateTime desc` will order messages by the received date in descending order.",
264
+ description: "Order results by a property. For example, `receivedDateTime desc` will order messages by the received date in descending order. Not for use with `$search`.",
254
265
  optional: true,
255
266
  },
256
267
  },
@@ -258,11 +269,12 @@ export default {
258
269
  _getUrl(path) {
259
270
  return `https://graph.microsoft.com/v1.0${path}`;
260
271
  },
261
- _getHeaders() {
272
+ _getHeaders(headers) {
262
273
  return {
263
274
  "Authorization": `Bearer ${this.$auth.oauth_access_token}`,
264
275
  "accept": "application/json",
265
276
  "Content-Type": "application/json",
277
+ ...headers,
266
278
  };
267
279
  },
268
280
  async _makeRequest({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/microsoft_outlook",
3
- "version": "1.7.6",
3
+ "version": "1.7.8",
4
4
  "description": "Pipedream Microsoft Outlook Components",
5
5
  "main": "microsoft_outlook.app.mjs",
6
6
  "keywords": [
@@ -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.3",
9
+ version: "0.1.5",
10
10
  type: "source",
11
11
  dedupe: "unique",
12
12
  props: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "microsoft_outlook-new-contact",
6
6
  name: "New Contact Event (Instant)",
7
7
  description: "Emit new event when a new Contact is created",
8
- version: "0.0.19",
8
+ version: "0.0.21",
9
9
  type: "source",
10
10
  hooks: {
11
11
  ...common.hooks,
@@ -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.5",
10
+ version: "0.1.7",
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.5",
10
+ version: "0.0.7",
11
11
  type: "source",
12
12
  dedupe: "unique",
13
13
  props: {