Skip to content

Commit 32919ca

Browse files
jocarinojoaojoaocoformGTFalcao
authored
[Components] zoom_admin - new components (#16967)
* feat: list recordings w/ userid and users * fix: eslint and update version --------- Co-authored-by: joao <[email protected]> Co-authored-by: joaocoform <[email protected]> Co-authored-by: Guilherme Falcão <[email protected]>
1 parent f074e50 commit 32919ca

File tree

4 files changed

+206
-1
lines changed

4 files changed

+206
-1
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import { paginate } from "../../common/pagination.mjs";
2+
import consts from "../../consts.mjs";
3+
import zoomAdmin from "../../zoom_admin.app.mjs";
4+
5+
export default {
6+
name: "List User Cloud Recordings",
7+
description: "Search cloud recordings from a user. [See the documentation](https://developers.zoom.us/docs/api/users/#tag/users/GET/users/{userId}/recordings)",
8+
key: "zoom_admin-list-user-cloud-recordings",
9+
version: "0.0.1",
10+
type: "action",
11+
props: {
12+
zoomAdmin,
13+
userId: {
14+
type: "string",
15+
label: "User ID",
16+
description: "The user ID to get recordings for",
17+
},
18+
mc: {
19+
type: "string",
20+
label: "MC",
21+
description: "Query Metadata of Recording if an On-Premise Meeting Connector was used for the meeting.",
22+
optional: true,
23+
},
24+
trash: {
25+
type: "boolean",
26+
label: "Trash",
27+
description: "If `true`, list recordings from trash",
28+
optional: true,
29+
},
30+
trashType: {
31+
type: "string",
32+
label: "Trash Type",
33+
description: "Should be used together with `Trash`. The type of Cloud recording that you would like to retrieve from trash",
34+
optional: true,
35+
options: consts.CLOUD_RECORD_TRASH_TYPE_OPTIONS,
36+
},
37+
from: {
38+
type: "string",
39+
label: "From",
40+
description: "The start date in `yyyy-mm-dd` UTC format for the date range for which you would like to retrieve recordings. The maximum range can be a month. If no value is provided for this field, the default will be current date.",
41+
optional: true,
42+
},
43+
to: {
44+
type: "string",
45+
label: "To",
46+
description: "End date in `yyyy-mm-dd` UTC format.",
47+
optional: true,
48+
},
49+
},
50+
async run({ $ }) {
51+
const params = {
52+
mc: this.mc,
53+
trash: this.trash,
54+
trash_type: this.trashType,
55+
from: this.from,
56+
to: this.to,
57+
};
58+
59+
const data = await paginate(
60+
this.zoomAdmin.listUserCloudRecordings,
61+
"meetings",
62+
this.userId,
63+
params,
64+
);
65+
66+
$.export("$summary", `${data.length} Cloud record(s) successfully fetched`);
67+
68+
return data;
69+
},
70+
};
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
import { paginate } from "../../common/pagination.mjs";
2+
import zoomAdmin from "../../zoom_admin.app.mjs";
3+
4+
export default {
5+
name: "List users",
6+
description: "List all users. [See the documentation](https://developers.zoom.us/docs/api/users/#tag/users/GET/users)",
7+
key: "zoom_admin-list-users",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
zoomAdmin,
12+
status: {
13+
type: "string",
14+
label: "Status",
15+
description: "The user's status",
16+
optional: true,
17+
default: "active",
18+
options: [
19+
{
20+
label: "Active",
21+
value: "active",
22+
},
23+
{
24+
label: "Inactive",
25+
value: "inactive",
26+
},
27+
{
28+
label: "Pending",
29+
value: "pending",
30+
},
31+
],
32+
},
33+
pageSize: {
34+
type: "integer",
35+
label: "Page Size",
36+
description: "The number of records returned within a single API call",
37+
optional: true,
38+
default: 30,
39+
min: 1,
40+
max: 2000,
41+
},
42+
roleId: {
43+
type: "string",
44+
label: "Role ID",
45+
description: "The role's unique ID to filter users by a specific role",
46+
optional: true,
47+
},
48+
pageNumber: {
49+
type: "string",
50+
label: "Page Number",
51+
description: "The page number of the current page in the returned records",
52+
optional: true,
53+
},
54+
includeFields: {
55+
type: "string",
56+
label: "Include Fields",
57+
description: "Additional fields to include in the response",
58+
optional: true,
59+
options: [
60+
{
61+
label: "Custom Attributes",
62+
value: "custom_attributes",
63+
},
64+
{
65+
label: "Host Key",
66+
value: "host_key",
67+
},
68+
],
69+
},
70+
nextPageToken: {
71+
type: "string",
72+
label: "Next Page Token",
73+
description: "Token for paginating through large result sets (expires in 15 minutes)",
74+
optional: true,
75+
},
76+
license: {
77+
type: "string",
78+
label: "License",
79+
description: "Filter users by specific license",
80+
optional: true,
81+
options: [
82+
{
83+
label: "Zoom Workforce Management",
84+
value: "zoom_workforce_management",
85+
},
86+
{
87+
label: "Zoom Compliance Management",
88+
value: "zoom_compliance_management",
89+
},
90+
],
91+
},
92+
},
93+
async run({ $ }) {
94+
const params = {
95+
status: this.status,
96+
page_size: this.pageSize,
97+
role_id: this.roleId,
98+
page_number: this.pageNumber,
99+
include_fields: this.includeFields,
100+
next_page_token: this.nextPageToken,
101+
license: this.license,
102+
};
103+
104+
const data = await paginate(
105+
this.zoomAdmin.listUsers,
106+
"users",
107+
params,
108+
);
109+
110+
$.export("$summary", `Successfully fetched ${data.length} user(s)`);
111+
112+
return data;
113+
},
114+
};

components/zoom_admin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/zoom_admin",
3-
"version": "0.9.0",
3+
"version": "0.10.0",
44
"description": "Pipedream Zoom_admin Components",
55
"main": "zoom_admin.app.mjs",
66
"keywords": [

components/zoom_admin/zoom_admin.app.mjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,16 @@ export default {
358358
});
359359
return data;
360360
},
361+
async listUserCloudRecordings(userId, params) {
362+
const { data } = await this._makeRequest({
363+
path: `/users/${userId}/recordings`,
364+
params: {
365+
page_size: 100,
366+
...params,
367+
},
368+
});
369+
return data;
370+
},
361371
async listMeetingRegistrants(meetingId, params, nextPageToken) {
362372
const { data } = await this._makeRequest({
363373
path: `/meetings/${meetingId}/registrants`,
@@ -391,6 +401,17 @@ export default {
391401
});
392402
return data;
393403
},
404+
async listUsers(params, nextPageToken) {
405+
const { data } = await this._makeRequest({
406+
path: "/users",
407+
params: {
408+
page_size: 100,
409+
next_page_token: nextPageToken,
410+
...params,
411+
},
412+
});
413+
return data;
414+
},
394415
async listPastMeetingParticipants(meetingId, nextPageToken) {
395416
const { data } = await this._makeRequest({
396417
path: `/past_meetings/${meetingId}/participants`,

0 commit comments

Comments
 (0)