diff --git a/components/zoom_admin/actions/list-user-cloud-recordings/list-user-cloud-recordings.mjs b/components/zoom_admin/actions/list-user-cloud-recordings/list-user-cloud-recordings.mjs new file mode 100644 index 0000000000000..af6f8f9342af2 --- /dev/null +++ b/components/zoom_admin/actions/list-user-cloud-recordings/list-user-cloud-recordings.mjs @@ -0,0 +1,70 @@ +import { paginate } from "../../common/pagination.mjs"; +import consts from "../../consts.mjs"; +import zoomAdmin from "../../zoom_admin.app.mjs"; + +export default { + name: "List User Cloud Recordings", + description: "Search cloud recordings from a user. [See the documentation](https://developers.zoom.us/docs/api/users/#tag/users/GET/users/{userId}/recordings)", + key: "zoom_admin-list-user-cloud-recordings", + version: "0.0.1", + type: "action", + props: { + zoomAdmin, + userId: { + type: "string", + label: "User ID", + description: "The user ID to get recordings for", + }, + mc: { + type: "string", + label: "MC", + description: "Query Metadata of Recording if an On-Premise Meeting Connector was used for the meeting.", + optional: true, + }, + trash: { + type: "boolean", + label: "Trash", + description: "If `true`, list recordings from trash", + optional: true, + }, + trashType: { + type: "string", + label: "Trash Type", + description: "Should be used together with `Trash`. The type of Cloud recording that you would like to retrieve from trash", + optional: true, + options: consts.CLOUD_RECORD_TRASH_TYPE_OPTIONS, + }, + from: { + type: "string", + label: "From", + 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.", + optional: true, + }, + to: { + type: "string", + label: "To", + description: "End date in `yyyy-mm-dd` UTC format.", + optional: true, + }, + }, + async run({ $ }) { + const params = { + mc: this.mc, + trash: this.trash, + trash_type: this.trashType, + from: this.from, + to: this.to, + }; + + const data = await paginate( + this.zoomAdmin.listUserCloudRecordings, + "meetings", + this.userId, + params, + ); + + $.export("$summary", `${data.length} Cloud record(s) successfully fetched`); + + return data; + }, +}; diff --git a/components/zoom_admin/actions/list-users/list-users.mjs b/components/zoom_admin/actions/list-users/list-users.mjs new file mode 100644 index 0000000000000..32919acd0aabe --- /dev/null +++ b/components/zoom_admin/actions/list-users/list-users.mjs @@ -0,0 +1,114 @@ +import { paginate } from "../../common/pagination.mjs"; +import zoomAdmin from "../../zoom_admin.app.mjs"; + +export default { + name: "List users", + description: "List all users. [See the documentation](https://developers.zoom.us/docs/api/users/#tag/users/GET/users)", + key: "zoom_admin-list-users", + version: "0.0.1", + type: "action", + props: { + zoomAdmin, + status: { + type: "string", + label: "Status", + description: "The user's status", + optional: true, + default: "active", + options: [ + { + label: "Active", + value: "active", + }, + { + label: "Inactive", + value: "inactive", + }, + { + label: "Pending", + value: "pending", + }, + ], + }, + pageSize: { + type: "integer", + label: "Page Size", + description: "The number of records returned within a single API call", + optional: true, + default: 30, + min: 1, + max: 2000, + }, + roleId: { + type: "string", + label: "Role ID", + description: "The role's unique ID to filter users by a specific role", + optional: true, + }, + pageNumber: { + type: "string", + label: "Page Number", + description: "The page number of the current page in the returned records", + optional: true, + }, + includeFields: { + type: "string", + label: "Include Fields", + description: "Additional fields to include in the response", + optional: true, + options: [ + { + label: "Custom Attributes", + value: "custom_attributes", + }, + { + label: "Host Key", + value: "host_key", + }, + ], + }, + nextPageToken: { + type: "string", + label: "Next Page Token", + description: "Token for paginating through large result sets (expires in 15 minutes)", + optional: true, + }, + license: { + type: "string", + label: "License", + description: "Filter users by specific license", + optional: true, + options: [ + { + label: "Zoom Workforce Management", + value: "zoom_workforce_management", + }, + { + label: "Zoom Compliance Management", + value: "zoom_compliance_management", + }, + ], + }, + }, + async run({ $ }) { + const params = { + status: this.status, + page_size: this.pageSize, + role_id: this.roleId, + page_number: this.pageNumber, + include_fields: this.includeFields, + next_page_token: this.nextPageToken, + license: this.license, + }; + + const data = await paginate( + this.zoomAdmin.listUsers, + "users", + params, + ); + + $.export("$summary", `Successfully fetched ${data.length} user(s)`); + + return data; + }, +}; diff --git a/components/zoom_admin/package.json b/components/zoom_admin/package.json index 39ea152ab9058..598b901d69f8e 100644 --- a/components/zoom_admin/package.json +++ b/components/zoom_admin/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/zoom_admin", - "version": "0.9.0", + "version": "0.10.0", "description": "Pipedream Zoom_admin Components", "main": "zoom_admin.app.mjs", "keywords": [ diff --git a/components/zoom_admin/zoom_admin.app.mjs b/components/zoom_admin/zoom_admin.app.mjs index e183d3c5a631b..dd25dc52a3c0b 100644 --- a/components/zoom_admin/zoom_admin.app.mjs +++ b/components/zoom_admin/zoom_admin.app.mjs @@ -358,6 +358,16 @@ export default { }); return data; }, + async listUserCloudRecordings(userId, params) { + const { data } = await this._makeRequest({ + path: `/users/${userId}/recordings`, + params: { + page_size: 100, + ...params, + }, + }); + return data; + }, async listMeetingRegistrants(meetingId, params, nextPageToken) { const { data } = await this._makeRequest({ path: `/meetings/${meetingId}/registrants`, @@ -391,6 +401,17 @@ export default { }); return data; }, + async listUsers(params, nextPageToken) { + const { data } = await this._makeRequest({ + path: "/users", + params: { + page_size: 100, + next_page_token: nextPageToken, + ...params, + }, + }); + return data; + }, async listPastMeetingParticipants(meetingId, nextPageToken) { const { data } = await this._makeRequest({ path: `/past_meetings/${meetingId}/participants`,