Skip to content

Commit 55f9b02

Browse files
committed
wip
1 parent d0d8587 commit 55f9b02

File tree

12 files changed

+440
-181
lines changed

12 files changed

+440
-181
lines changed

components/zoom/actions/add-meeting-registrant/add-meeting-registrant.mjs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import app from "../../zoom.app.mjs";
2+
import utils from "../../common/utils.mjs";
23

34
export default {
45
key: "zoom-add-meeting-registrant",
56
name: "Add Meeting Registrant",
6-
description: "Registers a participant for a meeting. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#operation/meetingRegistrantCreate)",
7-
version: "0.3.3",
7+
description: "Registers a participant for a meeting. Requires a paid Zoom account. [See the documentation](https://developers.zoom.us/docs/api/meetings/#tag/meetings/POST/meetings/{meetingId}/registrants)",
8+
version: "0.3.4",
89
type: "action",
910
props: {
1011
app,
@@ -13,12 +14,7 @@ export default {
1314
app,
1415
"meetingId",
1516
],
16-
},
17-
occurrenceIds: {
18-
propDefinition: [
19-
app,
20-
"occurrenceIds",
21-
],
17+
description: "The Meeting ID to add the registrant to",
2218
},
2319
email: {
2420
propDefinition: [
@@ -38,6 +34,15 @@ export default {
3834
"lastName",
3935
],
4036
},
37+
occurrenceIds: {
38+
propDefinition: [
39+
app,
40+
"occurrenceIds",
41+
(c) => ({
42+
meetingId: c.meetingId,
43+
}),
44+
],
45+
},
4146
address: {
4247
propDefinition: [
4348
app,
@@ -160,7 +165,7 @@ export default {
160165
step,
161166
meetingId,
162167
params: {
163-
occurrence_ids: occurrenceIds,
168+
occurrence_ids: occurrenceIds && occurrenceIds.join(","),
164169
},
165170
data: {
166171
email,
@@ -179,9 +184,7 @@ export default {
179184
role_in_purchase_process: roleInPurchaseProcess,
180185
no_of_employees: noOfEmployees,
181186
comments,
182-
custom_questions: typeof(customQuestions) === "undefined"
183-
? customQuestions
184-
: JSON.parse(customQuestions),
187+
custom_questions: utils.parseObj(customQuestions),
185188
},
186189
});
187190

components/zoom/actions/add-webinar-registrant/add-webinar-registrant.mjs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import app from "../../zoom.app.mjs";
2+
import utils from "../../common/utils.mjs";
23

34
export default {
45
key: "zoom-add-webinar-registrant",
56
name: "Add Webinar Registrant",
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.3",
7+
description: "Registers a participant for a webinar. Requires a paid Zoom account.[See the documentation](https://developers.zoom.us/docs/api/meetings/#tag/webinars/POST/webinars/{webinarId}/registrants)",
8+
version: "0.3.4",
89
type: "action",
910
props: {
1011
app,
@@ -13,12 +14,7 @@ export default {
1314
app,
1415
"webinarId",
1516
],
16-
},
17-
occurrenceIds: {
18-
propDefinition: [
19-
app,
20-
"occurrenceIds",
21-
],
17+
description: "The Webinar ID to add the registrant to",
2218
},
2319
email: {
2420
propDefinition: [
@@ -38,6 +34,15 @@ export default {
3834
"lastName",
3935
],
4036
},
37+
occurrenceIds: {
38+
propDefinition: [
39+
app,
40+
"occurrenceIds",
41+
(c) => ({
42+
webinarId: c.webinarId,
43+
}),
44+
],
45+
},
4146
address: {
4247
propDefinition: [
4348
app,
@@ -50,10 +55,10 @@ export default {
5055
"city",
5156
],
5257
},
53-
country: {
58+
state: {
5459
propDefinition: [
5560
app,
56-
"country",
61+
"state",
5762
],
5863
},
5964
zip: {
@@ -62,10 +67,10 @@ export default {
6267
"zip",
6368
],
6469
},
65-
state: {
70+
country: {
6671
propDefinition: [
6772
app,
68-
"state",
73+
"country",
6974
],
7075
},
7176
phone: {
@@ -160,7 +165,7 @@ export default {
160165
step,
161166
webinarId,
162167
params: {
163-
occurrence_ids: occurrenceIds,
168+
occurrence_ids: occurrenceIds && occurrenceIds.join(","),
164169
},
165170
data: {
166171
email,
@@ -179,9 +184,7 @@ export default {
179184
role_in_purchase_process: roleInPurchaseProcess,
180185
no_of_employees: noOfEmployees,
181186
comments,
182-
custom_questions: typeof(customQuestions) === "undefined"
183-
? customQuestions
184-
: JSON.parse(customQuestions),
187+
custom_questions: utils.parseObj(customQuestions),
185188
},
186189
});
187190

Lines changed: 72 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,131 @@
1-
// legacy_hash_id: a_l0i2Mn
2-
import { axios } from "@pipedream/platform";
1+
import zoom from "../../zoom.app.mjs";
2+
import utils from "../../common/utils.mjs";
33

44
export default {
55
key: "zoom-create-meeting",
66
name: "Create Meeting",
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.4",
7+
description: "Creates a meeting for a user. [See the documentation](https://developers.zoom.us/docs/api/meetings/#tag/meetings/POST/users/{userId}/meetings)",
8+
version: "0.1.5",
99
type: "action",
1010
props: {
11-
zoom: {
12-
type: "app",
13-
app: "zoom",
11+
zoom,
12+
userId: {
13+
propDefinition: [
14+
zoom,
15+
"userId",
16+
],
1417
},
1518
topic: {
1619
type: "string",
17-
description: "Meeting topic",
20+
label: "Topic",
21+
description: "The meeting's topic",
1822
optional: true,
1923
},
2024
type: {
2125
type: "integer",
22-
description: "Meeting type:\n1 - Instant meeting.\n2 - Scheduled meeting.\n3 - Recurring meeting with no fixed time.\n8 - Recurring meeting with fixed time.",
26+
label: "Type",
27+
description: "The type of meeting",
28+
options: [
29+
{
30+
label: "An instant meeting",
31+
value: 1,
32+
},
33+
{
34+
label: "A scheduled meeting",
35+
value: 2,
36+
},
37+
{
38+
label: "A recurring meeting with no fixed time",
39+
value: 3,
40+
},
41+
{
42+
label: "A recurring meeting with fixed time",
43+
value: 8,
44+
},
45+
{
46+
label: "A screen share only meeting",
47+
value: 10,
48+
},
49+
],
2350
optional: true,
2451
},
25-
start_time: {
52+
startTime: {
2653
type: "string",
54+
label: "Start Time",
2755
description: "Meeting start time. We support two formats for start_time - local time and GMT.\nTo set time as GMT the format should be yyyy-MM-ddTHH:mm:ssZ.\nTo set time using a specific timezone, use yyyy-MM-ddTHH:mm:ss format and specify the timezone ID in the timezone field OR leave it blank and the timezone set on your Zoom account will be used. You can also set the time as UTC as the timezone field.\nThe start_time should only be used for scheduled and / or recurring webinars with fixed time.",
2856
optional: true,
2957
},
3058
duration: {
3159
type: "integer",
60+
label: "Duration",
3261
description: "Meeting duration (minutes). Used for scheduled meetings only.",
3362
optional: true,
3463
},
3564
timezone: {
3665
type: "string",
66+
label: "Timezone",
3767
description: "Time zone to format start_time. For example, “America/Los_Angeles”. For scheduled meetings only. Please reference our time [zone list](https://marketplace.zoom.us/docs/api-reference/other-references/abbreviation-lists#timezones) for supported time zones and their formats.",
3868
optional: true,
3969
},
4070
password: {
4171
type: "string",
72+
label: "Password",
4273
description: "Password to join the meeting. Password may only contain the following characters: [a-z A-Z 0-9 @ - _ *]. Max of 10 characters.",
4374
optional: true,
4475
},
4576
agenda: {
4677
type: "string",
47-
description: "Meeting description.",
78+
label: "Agenda",
79+
description: "The meeting's agenda",
4880
optional: true,
4981
},
50-
tracking_fields: {
51-
type: "any",
52-
description: "Tracking fields.",
82+
trackingFields: {
83+
type: "string",
84+
label: "Tracking Fields",
85+
description: "An array of objects containing the keys **field** and **value**. Example `[{ \"field\": \"field\", \"value\": \"value1`\" }]`",
5386
optional: true,
5487
},
5588
recurrence: {
5689
type: "object",
57-
description: "Recurrence object",
90+
label: "Recurrence",
91+
description: "Recurrence object. Use this object only for a meeting with type 8, a recurring meeting with a fixed time. [See the documentation](https://developers.zoom.us/docs/api/meetings/#tag/meetings/POST/users/{userId}/meetings) for more information. Example: `{ \"end_date_time\": \"2022-04-02T15:59:00Z\", \"end_times\": 7, \"monthly_day\": 1, \"monthly_week\": 1, \"monthly_week_day\": 1, \"repeat_interval\": 1, \"type\": 1, \"weekly_days\": \"1\" }`",
5892
optional: true,
5993
},
6094
settings: {
61-
type: "string",
62-
description: "Meeting settings.",
95+
type: "object",
96+
label: "Settings",
97+
description: "Information about the meeting's settings. [See the documentation](https://developers.zoom.us/docs/api/meetings/#tag/meetings/POST/users/{userId}/meetings) for more information. Example: `{ \"additional_data_center_regions\": [ \"TY\" ], \"allow_multiple_devices\": true, \"alternative_hosts\": \"[email protected];[email protected]\", \"alternative_hosts_email_notification\": true, \"approval_type\": 2, \"approved_or_denied_countries_or_regions\": { \"approved_list\": [ \"CX\" ], \"denied_list\": [ \"CA\" ], \"enable\": true, \"method\": \"approve\" }`",
6398
optional: true,
6499
},
65100
},
101+
methods: {
102+
createMeeting({
103+
userId, ...args
104+
}) {
105+
return this.zoom.create({
106+
path: `/users/${userId}/meetings`,
107+
...args,
108+
});
109+
},
110+
},
66111
async run({ $ }) {
67-
//See the API docs here: https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate
68-
const config = {
69-
method: "post",
70-
url: "https://api.zoom.us/v2/users/me/meetings",
112+
const response = await this.createMeeting({
113+
$,
114+
userId: this.userId,
71115
data: {
72116
topic: this.topic,
73117
type: this.type,
74-
start_time: this.start_time,
118+
start_time: this.startTime,
75119
duration: this.duration,
76120
timezone: this.timezone,
77121
password: this.password,
78122
agenda: this.agenda,
79-
tracking_fields: typeof this.tracking_fields == "undefined"
80-
? this.tracking_fields
81-
: JSON.parse(this.tracking_fields),
82-
recurrence: typeof this.recurrence == "undefined"
83-
? this.recurrence
84-
: JSON.parse(this.recurrence),
85-
settings: typeof this.settings == "undefined"
86-
? this.settings
87-
: JSON.parse(this.settings),
88-
},
89-
headers: {
90-
"Authorization": `Bearer ${this.zoom.$auth.oauth_access_token}`,
91-
"Content-Type": "application/json",
123+
tracking_fields: utils.parseObj(this.trackingFields),
124+
recurrence: utils.parseObj(this.recurrence),
125+
settings: utils.parseObj(this.settings),
92126
},
93-
};
94-
return await axios($, config);
127+
});
128+
$.export("$summary", `Successfully created meeting with ID \`${response.id}\``);
129+
return response;
95130
},
96131
};

0 commit comments

Comments
 (0)