@pipedream/zoom 0.3.6 → 0.5.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.
Files changed (36) hide show
  1. package/README.md +21 -64
  2. package/actions/add-meeting-registrant/add-meeting-registrant.mjs +157 -108
  3. package/actions/add-webinar-registrant/add-webinar-registrant.mjs +157 -108
  4. package/actions/create-meeting/create-meeting.mjs +1 -1
  5. package/actions/create-user/create-user.mjs +1 -1
  6. package/actions/delete-user/delete-user.mjs +1 -1
  7. package/actions/get-meeting-details/get-meeting-details.mjs +1 -1
  8. package/actions/get-webinar-details/get-webinar-details.mjs +36 -22
  9. package/actions/list-channels/list-channels.mjs +1 -1
  10. package/actions/list-past-meeting-participants/list-past-meeting-participants.mjs +25 -23
  11. package/actions/list-past-webinar-qa/list-past-webinar-qa.mjs +1 -1
  12. package/actions/list-user-call-logs/list-user-call-logs.mjs +31 -0
  13. package/actions/list-webinar-participants-report/list-webinar-participants-report.mjs +68 -0
  14. package/actions/send-chat-message/send-chat-message.mjs +1 -1
  15. package/actions/update-meeting/update-meeting.mjs +1 -1
  16. package/actions/update-webinar/update-webinar.mjs +1 -1
  17. package/actions/view-user/view-user.mjs +1 -1
  18. package/common/constants.mjs +9 -0
  19. package/common/utils.mjs +20 -0
  20. package/package.json +3 -3
  21. package/sources/common/common.mjs +2 -2
  22. package/sources/common/constants.mjs +106 -104
  23. package/sources/custom-event/custom-event.mjs +13 -10
  24. package/sources/meeting-created/meeting-created.mjs +16 -10
  25. package/sources/meeting-deleted/meeting-deleted.mjs +13 -8
  26. package/sources/meeting-ended/meeting-ended.mjs +20 -12
  27. package/sources/meeting-started/meeting-started.mjs +17 -11
  28. package/sources/meeting-updated/meeting-updated.mjs +16 -10
  29. package/sources/phone-event/phone-event.mjs +12 -10
  30. package/sources/recording-completed/recording-completed.mjs +28 -19
  31. package/sources/webinar-created/webinar-created.mjs +16 -10
  32. package/sources/webinar-deleted/webinar-deleted.mjs +14 -9
  33. package/sources/webinar-ended/webinar-ended.mjs +19 -13
  34. package/sources/webinar-started/webinar-started.mjs +16 -10
  35. package/sources/webinar-updated/webinar-updated.mjs +16 -10
  36. package/zoom.app.mjs +277 -42
@@ -1,143 +1,192 @@
1
- // legacy_hash_id: a_YEiPgP
2
- import { axios } from "@pipedream/platform";
1
+ import app from "../../zoom.app.mjs";
3
2
 
4
3
  export default {
5
4
  key: "zoom-add-webinar-registrant",
6
5
  name: "Add Webinar Registrant",
7
- description: "Registers a participant for a webinar.",
8
- version: "0.2.1",
6
+ description: "Registers a participant for a webinar. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarregistrantcreate).",
7
+ version: "0.3.1",
9
8
  type: "action",
10
9
  props: {
11
- zoom: {
12
- type: "app",
13
- app: "zoom",
14
- },
15
- webinar_id: {
16
- type: "string",
17
- description: "The webinar ID.",
18
- },
19
- occurrence_ids: {
20
- type: "string",
21
- description: "Occurrence IDs. You can find these with the meeting get API. Multiple values separated by comma.",
22
- optional: true,
10
+ app,
11
+ webinarId: {
12
+ propDefinition: [
13
+ app,
14
+ "webinarId",
15
+ ],
16
+ },
17
+ occurrenceIds: {
18
+ propDefinition: [
19
+ app,
20
+ "occurrenceIds",
21
+ ],
23
22
  },
24
23
  email: {
25
- type: "string",
26
- description: "A valid email address of the registrant.",
27
- },
28
- first_name: {
29
- type: "string",
30
- description: "Registrant's first name.",
31
- },
32
- last_name: {
33
- type: "string",
34
- description: "Registrant's last name.",
24
+ propDefinition: [
25
+ app,
26
+ "email",
27
+ ],
28
+ },
29
+ firstName: {
30
+ propDefinition: [
31
+ app,
32
+ "firstName",
33
+ ],
34
+ },
35
+ lastName: {
36
+ propDefinition: [
37
+ app,
38
+ "lastName",
39
+ ],
35
40
  },
36
41
  address: {
37
- type: "string",
38
- description: "Registrant's address.",
39
- optional: true,
42
+ propDefinition: [
43
+ app,
44
+ "address",
45
+ ],
40
46
  },
41
47
  city: {
42
- type: "string",
43
- description: "Registrant's city.",
44
- optional: true,
48
+ propDefinition: [
49
+ app,
50
+ "city",
51
+ ],
45
52
  },
46
53
  country: {
47
- type: "string",
48
- description: "Registrant's country.",
49
- optional: true,
54
+ propDefinition: [
55
+ app,
56
+ "country",
57
+ ],
50
58
  },
51
59
  zip: {
52
- type: "string",
53
- description: "Registrant's Zip/Postal code.",
54
- optional: true,
60
+ propDefinition: [
61
+ app,
62
+ "zip",
63
+ ],
55
64
  },
56
65
  state: {
57
- type: "string",
58
- description: "Registrant's State/Province.",
59
- optional: true,
66
+ propDefinition: [
67
+ app,
68
+ "state",
69
+ ],
60
70
  },
61
71
  phone: {
62
- type: "string",
63
- description: "Registrant's Phone number.",
64
- optional: true,
72
+ propDefinition: [
73
+ app,
74
+ "phone",
75
+ ],
65
76
  },
66
77
  industry: {
67
- type: "string",
68
- description: "Registrant's industry.",
69
- optional: true,
78
+ propDefinition: [
79
+ app,
80
+ "industry",
81
+ ],
70
82
  },
71
83
  org: {
72
- type: "string",
73
- description: "Registrant's Organization.",
74
- optional: true,
75
- },
76
- job_title: {
77
- type: "string",
78
- description: "Registrant's job title.",
79
- optional: true,
80
- },
81
- purchasing_time_frame: {
82
- type: "string",
83
- description: "This field can be included to gauge interest of webinar attendees towards buying your product or service.",
84
- optional: true,
85
- },
86
- role_in_purchase_process: {
87
- type: "string",
88
- description: "Role in Purchase Process.",
89
- optional: true,
90
- },
91
- no_of_employees: {
92
- type: "string",
93
- description: "Number of Employees.",
94
- optional: true,
84
+ propDefinition: [
85
+ app,
86
+ "org",
87
+ ],
88
+ },
89
+ jobTitle: {
90
+ propDefinition: [
91
+ app,
92
+ "jobTitle",
93
+ ],
94
+ },
95
+ purchasingTimeFrame: {
96
+ propDefinition: [
97
+ app,
98
+ "purchasingTimeFrame",
99
+ ],
100
+ },
101
+ roleInPurchaseProcess: {
102
+ propDefinition: [
103
+ app,
104
+ "roleInPurchaseProcess",
105
+ ],
106
+ },
107
+ noOfEmployees: {
108
+ propDefinition: [
109
+ app,
110
+ "noOfEmployees",
111
+ ],
95
112
  },
96
113
  comments: {
97
- type: "string",
98
- description: "A field that allows registrants to provide any questions or comments that they might have.",
99
- optional: true,
114
+ propDefinition: [
115
+ app,
116
+ "comments",
117
+ ],
118
+ },
119
+ customQuestions: {
120
+ propDefinition: [
121
+ app,
122
+ "customQuestions",
123
+ ],
100
124
  },
101
- custom_questions: {
102
- type: "any",
103
- description: "Custom questions.",
104
- optional: true,
125
+ },
126
+ methods: {
127
+ addWebinarRegistrant({
128
+ webinarId, ...args
129
+ } = {}) {
130
+ return this.app.create({
131
+ path: `/webinars/${webinarId}/registrants`,
132
+ ...args,
133
+ });
105
134
  },
106
135
  },
107
- async run({ $ }) {
108
- //See the API docs here: https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarregistrantcreate
109
- const config = {
110
- method: "post",
111
- url: `https://api.zoom.us/v2/webinars/${this.webinar_id}/registrants`,
136
+ async run({ $: step }) {
137
+ const {
138
+ webinarId,
139
+ occurrenceIds,
140
+ email,
141
+ firstName,
142
+ lastName,
143
+ address,
144
+ city,
145
+ country,
146
+ zip,
147
+ state,
148
+ phone,
149
+ industry,
150
+ org,
151
+ jobTitle,
152
+ purchasingTimeFrame,
153
+ roleInPurchaseProcess,
154
+ noOfEmployees,
155
+ comments,
156
+ customQuestions,
157
+ } = this;
158
+
159
+ const response = await this.addWebinarRegistrant({
160
+ step,
161
+ webinarId,
112
162
  params: {
113
- occurrence_ids: this.occurrence_ids,
163
+ occurrence_ids: occurrenceIds,
114
164
  },
115
165
  data: {
116
- email: this.email,
117
- first_name: this.first_name,
118
- last_name: this.last_name,
119
- address: this.address,
120
- city: this.city,
121
- country: this.country,
122
- zip: this.zip,
123
- state: this.state,
124
- phone: this.phone,
125
- industry: this.industry,
126
- org: this.org,
127
- job_title: this.job_title,
128
- purchasing_time_frame: this.purchasing_time_frame,
129
- role_in_purchase_process: this.role_in_purchase_process,
130
- no_of_employees: this.no_of_employees,
131
- comments: this.comments,
132
- custom_questions: typeof this.custom_questions == "undefined"
133
- ? this.custom_questions
134
- : JSON.parse(this.custom_questions),
135
- },
136
- headers: {
137
- "Authorization": `Bearer ${this.zoom.$auth.oauth_access_token}`,
138
- "Content-Type": "application/json",
166
+ email,
167
+ first_name: firstName,
168
+ last_name: lastName,
169
+ address,
170
+ city,
171
+ country,
172
+ zip,
173
+ state,
174
+ phone,
175
+ industry,
176
+ org,
177
+ job_title: jobTitle,
178
+ purchasing_time_frame: purchasingTimeFrame,
179
+ role_in_purchase_process: roleInPurchaseProcess,
180
+ no_of_employees: noOfEmployees,
181
+ comments,
182
+ custom_questions: typeof(customQuestions) === "undefined"
183
+ ? customQuestions
184
+ : JSON.parse(customQuestions),
139
185
  },
140
- };
141
- return await axios($, config);
186
+ });
187
+
188
+ step.export("$summary", `Successfully added registrant to webinar with ID \`${response.id}\``);
189
+
190
+ return response;
142
191
  },
143
192
  };
@@ -5,7 +5,7 @@ export default {
5
5
  key: "zoom-create-meeting",
6
6
  name: "Create Meeting",
7
7
  description: "Creates a meeting for a user. A maximum of 100 meetings can be created for a user in a day.",
8
- version: "0.1.1",
8
+ version: "0.1.2",
9
9
  type: "action",
10
10
  props: {
11
11
  zoom: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "zoom-create-user",
6
6
  name: "Create User",
7
7
  description: "Creates a new user in your account.",
8
- version: "0.2.1",
8
+ version: "0.2.2",
9
9
  type: "action",
10
10
  props: {
11
11
  zoom: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "zoom-delete-user",
6
6
  name: "Delete User",
7
7
  description: "Disassociates (unlinks) a user from the associated account or permanently deletes a user.",
8
- version: "0.2.1",
8
+ version: "0.2.2",
9
9
  type: "action",
10
10
  props: {
11
11
  zoom: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "zoom-get-meeting-details",
6
6
  name: "Get Meeting Details",
7
7
  description: "Retrieves the details of a meeting.",
8
- version: "0.3.1",
8
+ version: "0.3.2",
9
9
  type: "action",
10
10
  props: {
11
11
  zoom: {
@@ -1,38 +1,52 @@
1
- // legacy_hash_id: a_WYie0m
2
- import { axios } from "@pipedream/platform";
1
+ import app from "../../zoom.app.mjs";
3
2
 
4
3
  export default {
5
4
  key: "zoom-get-webinar-details",
6
5
  name: "Get Webinar Details",
7
- description: "Gets details of a scheduled webinar.",
8
- version: "0.2.1",
6
+ description: "Gets details of a scheduled webinar. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#operation/webinar).",
7
+ version: "0.3.1",
9
8
  type: "action",
10
9
  props: {
11
- zoom: {
12
- type: "app",
13
- app: "zoom",
10
+ app,
11
+ webinarId: {
12
+ propDefinition: [
13
+ app,
14
+ "webinarId",
15
+ ],
14
16
  },
15
- webinar_id: {
16
- type: "integer",
17
- description: "The webinar ID.",
18
- },
19
- occurrence_id: {
17
+ occurrenceId: {
20
18
  type: "string",
19
+ label: "Occurrence ID",
21
20
  description: "Unique Identifier that identifies an occurrence of a recurring webinar. Recurring webinars can have a maximum of 50 occurrences.",
22
21
  optional: true,
23
22
  },
24
23
  },
25
- async run({ $ }) {
26
- //See the API docs here: https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinar
27
- const config = {
28
- url: `https://api.zoom.us/v2/webinars/${this.webinar_id}`,
24
+ methods: {
25
+ getWebinarDetails({
26
+ webinarId, ...args
27
+ } = {}) {
28
+ return this.app._makeRequest({
29
+ path: `/webinars/${webinarId}`,
30
+ ...args,
31
+ });
32
+ },
33
+ },
34
+ async run({ $: step }) {
35
+ const {
36
+ webinarId,
37
+ occurrenceId,
38
+ } = this;
39
+
40
+ const response = await this.getWebinarDetails({
41
+ step,
42
+ webinarId,
29
43
  params: {
30
- occurrence_id: this.occurrence_id,
44
+ occurrence_id: occurrenceId,
31
45
  },
32
- headers: {
33
- Authorization: `Bearer ${this.zoom.$auth.oauth_access_token}`,
34
- },
35
- };
36
- return await axios($, config);
46
+ });
47
+
48
+ step.export("$summary", `Successfully retrieved webinar details with ID \`${response.id}\``);
49
+
50
+ return response;
37
51
  },
38
52
  };
@@ -5,7 +5,7 @@ export default {
5
5
  key: "zoom-list-channels",
6
6
  name: "List Channels",
7
7
  description: "List a user's chat channels.",
8
- version: "0.1.1",
8
+ version: "0.1.2",
9
9
  type: "action",
10
10
  props: {
11
11
  zoom: {
@@ -1,36 +1,38 @@
1
- // legacy_hash_id: a_YEik5g
2
- import { axios } from "@pipedream/platform";
1
+ import app from "../../zoom.app.mjs";
3
2
 
4
3
  export default {
5
4
  key: "zoom-list-past-meeting-participants",
6
5
  name: "List Past Meeting Participants",
7
- description: "Retrieve information on participants from a past meeting.",
8
- version: "0.1.1",
6
+ description: "Retrieve information on participants from a past meeting. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#operation/pastMeetingParticipants).",
7
+ version: "0.2.1",
9
8
  type: "action",
10
9
  props: {
11
- zoom: {
12
- type: "app",
13
- app: "zoom",
10
+ app,
11
+ meetingId: {
12
+ propDefinition: [
13
+ app,
14
+ "meetingId",
15
+ ],
14
16
  },
15
- meeting_id: {
16
- type: "string",
17
+ },
18
+ methods: {
19
+ listPastMeetingParticipants({
20
+ meetingId, ...args
21
+ } = {}) {
22
+ return this.app._makeRequest({
23
+ path: `/past_meetings/${meetingId}/participants`,
24
+ ...args,
25
+ });
17
26
  },
18
27
  },
19
- async run({ $ }) {
20
- const config = {
21
- url: `https://api.zoom.us/v2/past_meetings/${this.meeting_id}/participants`,
22
- headers: {
23
- Authorization: `Bearer ${this.zoom.$auth.oauth_access_token}`,
24
- },
25
- };
28
+ async run({ $: step }) {
29
+ const { participants } = await this.listPastMeetingParticipants({
30
+ step,
31
+ meetingId: this.meetingId,
32
+ });
26
33
 
27
- const results = await axios($, config);
34
+ step.export("$summary", `Successfully retrieved ${participants.length} past meeting participants`);
28
35
 
29
- return results.participants.filter((element, index) => {
30
- const _element = JSON.stringify(element);
31
- return index === results.participants.findIndex((obj) => {
32
- return JSON.stringify(obj) === _element;
33
- });
34
- });
36
+ return participants;
35
37
  },
36
38
  };
@@ -5,7 +5,7 @@ export default {
5
5
  key: "zoom-list-past-webinar-qa",
6
6
  name: "List Past Webinar Q&A",
7
7
  description: "The feature for Webinars allows attendees to ask questions during the Webinar and for the panelists, co-hosts and host to answer their questions. Use this API to list Q&A of a specific Webinar.",
8
- version: "0.1.1",
8
+ version: "0.1.2",
9
9
  type: "action",
10
10
  props: {
11
11
  zoom: {
@@ -0,0 +1,31 @@
1
+ import zoom from "../../zoom.app.mjs";
2
+
3
+ export default {
4
+ name: "List User's Call Logs",
5
+ description: "Gets a user's Zoom phone call logs. [See the documentation](https://developers.zoom.us/docs/zoom-phone/apis/#operation/phoneUserCallLogs)",
6
+ key: "zoom-list-user-call-logs",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ zoom,
11
+ userId: {
12
+ propDefinition: [
13
+ zoom,
14
+ "userId",
15
+ ],
16
+ },
17
+ },
18
+ async run ({ $ }) {
19
+ const data = await this.zoom.getResourcesStream({
20
+ resourceFn: this.zoom.listCallLogs,
21
+ resourceFnArgs: {
22
+ userId: this.userId,
23
+ },
24
+ resourceName: "call_logs",
25
+ });
26
+
27
+ $.export("$summary", `Successfully fetched ${data.length} call log(s)`);
28
+
29
+ return data;
30
+ },
31
+ };
@@ -0,0 +1,68 @@
1
+ import utils from "../../common/utils.mjs";
2
+ import app from "../../zoom.app.mjs";
3
+
4
+ export default {
5
+ key: "zoom-list-webinar-participants-report",
6
+ name: "List Webinar Participants Report",
7
+ description: "Retrieves detailed report on each webinar attendee. You can get webinar participant reports for the last 6 months. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#operation/reportWebinarParticipants).",
8
+ version: "0.0.2",
9
+ type: "action",
10
+ props: {
11
+ app,
12
+ webinarId: {
13
+ propDefinition: [
14
+ app,
15
+ "webinarId",
16
+ ],
17
+ },
18
+ nextPageToken: {
19
+ propDefinition: [
20
+ app,
21
+ "nextPageToken",
22
+ ],
23
+ },
24
+ max: {
25
+ propDefinition: [
26
+ app,
27
+ "max",
28
+ ],
29
+ },
30
+ },
31
+ methods: {
32
+ async listWebinarParticipantsReport({
33
+ webinarId, ...args
34
+ } = {}) {
35
+ return this.app._makeRequest({
36
+ path: `/report/webinars/${webinarId}/participants`,
37
+ ...args,
38
+ });
39
+ },
40
+ },
41
+ async run({ $: step }) {
42
+ const {
43
+ webinarId,
44
+ nextPageToken,
45
+ max,
46
+ } = this;
47
+
48
+ const stream = await this.app.getResourcesStream({
49
+ resourceFn: this.listWebinarParticipantsReport,
50
+ resourceFnArgs: {
51
+ step,
52
+ webinarId,
53
+ params: {
54
+ page_size: 300,
55
+ next_page_token: nextPageToken,
56
+ },
57
+ },
58
+ resourceName: "participants",
59
+ max,
60
+ });
61
+
62
+ const participants = await utils.streamIterator(stream);
63
+
64
+ step.export("$summary", `Successfully retrieved ${utils.summaryEnd(participants.length, "participant")}.`);
65
+
66
+ return participants;
67
+ },
68
+ };
@@ -5,7 +5,7 @@ export default {
5
5
  key: "zoom-send-chat-message",
6
6
  name: "Send Chat Message",
7
7
  description: "Send chat messages on Zoom to either an individual user who is in your contact list or to a of which you are a member.",
8
- version: "0.1.1",
8
+ version: "0.1.2",
9
9
  type: "action",
10
10
  props: {
11
11
  zoom: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "zoom-update-meeting",
6
6
  name: "Update Meeting",
7
7
  description: "Updates an existing Zoom meeting",
8
- version: "0.1.1",
8
+ version: "0.1.2",
9
9
  type: "action",
10
10
  props: {
11
11
  zoom: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "zoom-update-webinar",
6
6
  name: "Update Webinar",
7
7
  description: "Update a webinar's topic, start time, or other settings",
8
- version: "0.1.1",
8
+ version: "0.1.2",
9
9
  type: "action",
10
10
  props: {
11
11
  zoom: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "zoom-view-user",
6
6
  name: "View User",
7
7
  description: "View your user information",
8
- version: "0.1.1",
8
+ version: "0.1.2",
9
9
  type: "action",
10
10
  props: {
11
11
  zoom: {
@@ -0,0 +1,9 @@
1
+ const BASE_URL = "https://api.zoom.us";
2
+ const VERSION_PATH = "/v2";
3
+ const MAX_RESOURCES = 300;
4
+
5
+ export default {
6
+ BASE_URL,
7
+ VERSION_PATH,
8
+ MAX_RESOURCES,
9
+ };
@@ -0,0 +1,20 @@
1
+ async function streamIterator(stream) {
2
+ const resources = [];
3
+ for await (const resource of stream) {
4
+ resources.push(resource);
5
+ }
6
+ return resources;
7
+ }
8
+
9
+ function summaryEnd(count, singular, plural) {
10
+ if (!plural) {
11
+ plural = singular + "s";
12
+ }
13
+ const noun = count === 1 && singular || plural;
14
+ return `${count} ${noun}`;
15
+ }
16
+
17
+ export default {
18
+ streamIterator,
19
+ summaryEnd,
20
+ };