@pipedream/microsoft_outlook_calendar 0.7.0 → 0.7.2
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.
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
1
2
|
import microsoftOutlook from "../../microsoft_outlook_calendar.app.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
key: "microsoft_outlook_calendar-list-events",
|
|
5
6
|
name: "List Events",
|
|
6
7
|
description: "Get a list of event objects in the user's mailbox. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-events)",
|
|
7
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.10",
|
|
8
9
|
annotations: {
|
|
9
10
|
destructiveHint: false,
|
|
10
11
|
openWorldHint: true,
|
|
@@ -35,27 +36,21 @@ export default {
|
|
|
35
36
|
includeRecurring: {
|
|
36
37
|
type: "boolean",
|
|
37
38
|
label: "Include Recurring",
|
|
38
|
-
description: "
|
|
39
|
+
description: "Must set to true to include recurring events in results. When true, you must also provide `Start Date Time` and `End Date Time`. Set to false to return only non-recurring events.",
|
|
40
|
+
optional: true,
|
|
41
|
+
},
|
|
42
|
+
startDateTime: {
|
|
43
|
+
type: "string",
|
|
44
|
+
label: "Start Date Time",
|
|
45
|
+
description: "Required when `Include Recurring` is true. The start date and time of the time range in ISO 8601 format (e.g. `2019-11-08T19:00:00-08:00`).",
|
|
46
|
+
optional: true,
|
|
47
|
+
},
|
|
48
|
+
endDateTime: {
|
|
49
|
+
type: "string",
|
|
50
|
+
label: "End Date Time",
|
|
51
|
+
description: "Required when `Include Recurring` is true. The end date and time of the time range in ISO 8601 format (e.g. `2019-11-08T20:00:00-08:00`).",
|
|
39
52
|
optional: true,
|
|
40
|
-
reloadProps: true,
|
|
41
53
|
},
|
|
42
|
-
},
|
|
43
|
-
additionalProps() {
|
|
44
|
-
if (!this.includeRecurring) {
|
|
45
|
-
return {};
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
startDateTime: {
|
|
49
|
-
type: "string",
|
|
50
|
-
label: "Start Date Time",
|
|
51
|
-
description: "The start date and time of the time range, represented in ISO 8601 format. For example, `2019-11-08T19:00:00-08:00`",
|
|
52
|
-
},
|
|
53
|
-
endDateTime: {
|
|
54
|
-
type: "string",
|
|
55
|
-
label: "End Date Time",
|
|
56
|
-
description: "The end date and time of the time range, represented in ISO 8601 format. For example, `2019-11-08T20:00:00-08:00`",
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
54
|
},
|
|
60
55
|
async run({ $ }) {
|
|
61
56
|
const params = {
|
|
@@ -64,7 +59,12 @@ export default {
|
|
|
64
59
|
"$top": this.maxResults,
|
|
65
60
|
};
|
|
66
61
|
|
|
67
|
-
const {
|
|
62
|
+
const { includeRecurring } = this;
|
|
63
|
+
if (includeRecurring && (!this.startDateTime || !this.endDateTime)) {
|
|
64
|
+
throw new ConfigurationError("`Start Date Time` and `End Date Time` are required when `Include Recurring` is true");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const { value = [] } = !includeRecurring
|
|
68
68
|
? await this.microsoftOutlook.listCalendarEvents({
|
|
69
69
|
$,
|
|
70
70
|
params,
|
|
@@ -78,7 +78,7 @@ export default {
|
|
|
78
78
|
},
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
-
const events = !
|
|
81
|
+
const events = !includeRecurring
|
|
82
82
|
? value.filter((event) => !event.recurrence)
|
|
83
83
|
: value;
|
|
84
84
|
|