From 4555d6bfc9a18df485990968fb34c70de5b2242a Mon Sep 17 00:00:00 2001 From: ricardo Date: Wed, 24 Jun 2020 19:28:08 -0400 Subject: [PATCH] :zap: Improvements to Zoom-Node --- .../nodes-base/nodes/Zoom/GenericFunctions.ts | 1 + .../nodes/Zoom/MeetingDescription.ts | 592 +++++---- .../Zoom/MeetingRegistrantDescription.ts | 31 +- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 1060 ++++++++--------- 4 files changed, 821 insertions(+), 863 deletions(-) diff --git a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts index 6a8593e3ab..95e07f09b9 100644 --- a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts @@ -33,6 +33,7 @@ export async function zoomApiRequest(this: IExecuteFunctions | IExecuteSingleFun if (Object.keys(query).length === 0) { delete options.qs; } + try { if (authenticationMethod === 'accessToken') { const credentials = this.getCredentials('zoomApi'); diff --git a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts index 3efcc2a2bc..130830b9fe 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts @@ -43,31 +43,13 @@ export const meetingOperations = [ ], default: 'create', description: 'The operation to perform.', - } + }, ] as INodeProperties[]; export const meetingFields = [ /* -------------------------------------------------------------------------- */ - /* meeting:create */ + /* meeting:create */ /* -------------------------------------------------------------------------- */ - { - displayName: 'User ID', - name: 'userId', - type: 'string', - default: '', - required: true, - displayOptions: { - show: { - operation: [ - 'create', - ], - resource: [ - 'meeting', - ], - }, - }, - description: 'User ID or Email Address.', - }, { displayName: 'Additional Fields', name: 'additionalFields', @@ -90,98 +72,29 @@ export const meetingFields = [ displayName: 'Agenda', name: 'agenda', type: 'string', + typeOptions: { + alwaysOpenEditWindow: true, + }, default: '', description: 'Meeting agenda.', }, - { - displayName: 'Alternative Hosts', - name: 'alternativeHosts', - type: 'string', - default: '', - description: 'Alternative hosts email IDs.', - }, - { - displayName: 'Auto Recording', - name: 'autoRecording', - type: 'options', - options: [ - { - name: 'Record on Local', - value: 'local', - }, - { - name: 'Record on Cloud', - value: 'cloud', - }, - { - name: 'Disabled', - value: 'none', - }, - ], - default: 'none', - description: 'Auto recording.', - }, - { - displayName: 'Audio', - name: 'audio', - type: 'options', - options: [ - { - name: 'Both Telephony and VoiP', - value: 'both', - }, - { - name: 'Telephony', - value: 'telephony', - }, - { - name: 'VOIP', - value: 'voip', - }, - - ], - default: 'both', - description: 'Determine how participants can join audio portion of the meeting.', - }, { displayName: 'Duration', name: 'duration', type: 'number', - default: '', - description: 'Duration.', - }, - { - displayName: 'Host Meeting in China', - name: 'cnMeeting', - type: 'boolean', - default: false, - description: 'Host Meeting in China.', - }, - { - displayName: 'Host Meeting in India', - name: 'inMeeting', - type: 'boolean', - default: false, - description: 'Host Meeting in India.', - }, - { - displayName: 'Host Video', - name: 'hostVideo', - type: 'boolean', - default: false, - description: 'Start video when host joins the meeting.', - }, - { - displayName: 'Join Before Host', - name: 'joinBeforeHost', - type: 'boolean', - default: false, - description: 'Allow participants to join the meeting before host starts it.', + typeOptions: { + minValue: 0, + }, + default: 0, + description: 'Meeting duration (minutes).', }, { displayName: 'Meeting Topic', name: 'topic', type: 'string', + typeOptions: { + alwaysOpenEditWindow: true, + }, default: '', description: `Meeting topic.`, }, @@ -211,20 +124,6 @@ export const meetingFields = [ default: 2, description: 'Meeting type.', }, - { - displayName: 'Muting before entry', - name: 'muteUponEntry', - type: 'boolean', - default: false, - description: 'Mute participants upon entry.', - }, - { - displayName: 'Participant Video', - name: 'participantVideo', - type: 'boolean', - default: false, - description: 'Start video when participant joins the meeting.', - }, { displayName: 'Password', name: 'password', @@ -232,27 +131,6 @@ export const meetingFields = [ default: '', description: 'Password to join the meeting with maximum 10 characters.', }, - { - displayName: 'Registration Type', - name: 'registrationType', - type: 'options', - options: [ - { - name: 'Attendees register once and can attend any of the occurences', - value: 1, - }, - { - name: 'Attendees need to register for every occurrence', - value: 2, - }, - { - name: 'Attendees register once and can choose one or more occurrences to attend', - value: 3, - }, - ], - default: 1, - description: 'Registration type. Used for recurring meetings with fixed time only', - }, { displayName: 'Schedule For', name: 'scheduleFor', @@ -260,6 +138,135 @@ export const meetingFields = [ default: '', description: 'Schedule meeting for someone else from your account, provide their email ID.', }, + { + displayName: 'Settings', + name: 'settings', + type: 'collection', + placeholder: 'Add Setting', + default: {}, + options: [ + { + displayName: 'Audio', + name: 'audio', + type: 'options', + options: [ + { + name: 'Both Telephony and VoiP', + value: 'both', + }, + { + name: 'Telephony', + value: 'telephony', + }, + { + name: 'VOIP', + value: 'voip', + }, + + ], + default: 'both', + description: 'Determine how participants can join audio portion of the meeting.', + }, + { + displayName: 'Alternative Hosts', + name: 'alternativeHosts', + type: 'string', + default: '', + description: 'Alternative hosts email IDs.', + }, + { + displayName: 'Auto Recording', + name: 'autoRecording', + type: 'options', + options: [ + { + name: 'Record on Local', + value: 'local', + }, + { + name: 'Record on Cloud', + value: 'cloud', + }, + { + name: 'Disabled', + value: 'none', + }, + ], + default: 'none', + description: 'Auto recording.', + }, + { + displayName: 'Host Meeting in China', + name: 'cnMeeting', + type: 'boolean', + default: false, + description: 'Host Meeting in China.', + }, + { + displayName: 'Host Meeting in India', + name: 'inMeeting', + type: 'boolean', + default: false, + description: 'Host Meeting in India.', + }, + { + displayName: 'Host Video', + name: 'hostVideo', + type: 'boolean', + default: false, + description: 'Start video when host joins the meeting.', + }, + { + displayName: 'Join Before Host', + name: 'joinBeforeHost', + type: 'boolean', + default: false, + description: 'Allow participants to join the meeting before host starts it.', + }, + { + displayName: 'Muting Upon Entry', + name: 'muteUponEntry', + type: 'boolean', + default: false, + description: 'Mute participants upon entry.', + }, + { + displayName: 'Participant Video', + name: 'participantVideo', + type: 'boolean', + default: false, + description: 'Start video when participant joins the meeting.', + }, + { + displayName: 'Registration Type', + name: 'registrationType', + type: 'options', + options: [ + { + name: 'Attendees register once and can attend any of the occurences', + value: 1, + }, + { + name: 'Attendees need to register for every occurrence', + value: 2, + }, + { + name: 'Attendees register once and can choose one or more occurrences to attend', + value: 3, + }, + ], + default: 1, + description: 'Registration type. Used for recurring meetings with fixed time only', + }, + { + displayName: 'Watermark', + name: 'watermark', + type: 'boolean', + default: false, + description: 'Adds watermark when viewing a shared screen.', + }, + ], + }, { displayName: 'Start Time', name: 'startTime', @@ -277,13 +284,6 @@ export const meetingFields = [ default: '', description: `Time zone used in the response. The default is the time zone of the calendar.`, }, - { - displayName: 'Watermark', - name: 'watermark', - type: 'boolean', - default: false, - description: 'Adds watermark when viewing a shared screen.', - }, ], }, /* -------------------------------------------------------------------------- */ @@ -342,26 +342,8 @@ export const meetingFields = [ ], }, /* -------------------------------------------------------------------------- */ - /* meeting:getAll */ + /* meeting:getAll */ /* -------------------------------------------------------------------------- */ - { - displayName: 'User ID', - name: 'userId', - type: 'string', - default: '', - required: true, - displayOptions: { - show: { - operation: [ - 'getAll', - ], - resource: [ - 'meeting', - ], - }, - }, - description: 'User ID or email-ID.', - }, { displayName: 'Return All', name: 'returnAll', @@ -404,10 +386,10 @@ export const meetingFields = [ description: 'How many results to return.', }, { - displayName: 'Additional Fields', - name: 'additionalFields', + displayName: 'Filters', + name: 'filters', type: 'collection', - placeholder: 'Add Field', + placeholder: 'Add Filter', default: {}, displayOptions: { show: { @@ -429,23 +411,26 @@ export const meetingFields = [ { name: 'Scheduled', value: 'scheduled', + description: 'This includes all valid past meetings, live meetings and upcoming scheduled meetings' }, { name: 'Live', value: 'live', + description: 'All ongoing meetings', }, { name: 'Upcoming', value: 'upcoming', + description: 'All upcoming meetings including live meetings', }, ], default: 'live', description: `Meeting type.`, }, - ] + ], }, /* -------------------------------------------------------------------------- */ - /* meeting:delete */ + /* meeting:delete */ /* -------------------------------------------------------------------------- */ { displayName: 'Meeting ID', @@ -500,7 +485,7 @@ export const meetingFields = [ }, /* -------------------------------------------------------------------------- */ - /* meeting:update */ + /* meeting:update */ /* -------------------------------------------------------------------------- */ { displayName: 'Meeting ID', @@ -521,8 +506,8 @@ export const meetingFields = [ description: 'Meeting ID.', }, { - displayName: 'Additional Fields', - name: 'additionalFields', + displayName: 'Update Fields', + name: 'updateFields', type: 'collection', placeholder: 'Add Field', default: {}, @@ -541,100 +526,21 @@ export const meetingFields = [ displayName: 'Agenda', name: 'agenda', type: 'string', + typeOptions: { + alwaysOpenEditWindow: true, + }, default: '', description: 'Meeting agenda.', }, - { - displayName: 'Alternative Hosts', - name: 'alternativeHosts', - type: 'string', - default: '', - description: 'Alternative hosts email IDs.', - }, - { - displayName: 'Audio', - name: 'audio', - type: 'options', - options: [ - { - name: 'Both Telephony and VoiP', - value: 'both', - }, - { - name: 'Telephony', - value: 'telephony', - }, - { - name: 'VOIP', - value: 'voip', - }, - ], - default: 'both', - description: 'Determine how participants can join audio portion of the meeting.', - }, - { - displayName: 'Auto Recording', - name: 'autoRecording', - type: 'options', - options: [ - { - name: 'Record on Local', - value: 'local', - }, - { - name: 'Record on Cloud', - value: 'cloud', - }, - { - name: 'Disabled', - value: 'none', - }, - ], - default: 'none', - description: 'Auto recording.', - }, - { displayName: 'Duration', name: 'duration', type: 'number', - default: '', - description: 'Duration.', - }, - { - displayName: 'Join Before Host', - name: 'joinBeforeHost', - type: 'boolean', - default: false, - description: 'Allow participants to join the meeting before host starts it.', - }, - { - displayName: 'Host Meeting in China', - name: 'cnMeeting', - type: 'boolean', - default: false, - description: 'Host Meeting in China.', - }, - { - displayName: 'Host Meeting in India', - name: 'inMeeting', - type: 'boolean', - default: false, - description: 'Host Meeting in India.', - }, - { - displayName: 'Host Video', - name: 'hostVideo', - type: 'boolean', - default: false, - description: 'Start video when host joins the meeting.', - }, - { - displayName: 'Occurrence ID', - name: 'occurrenceId', - type: 'string', - default: '', - description: 'Occurrence ID.', + typeOptions: { + minValue: 0, + }, + default: 0, + description: 'Meeting duration (minutes).', }, { displayName: 'Meeting Topic', @@ -669,13 +575,6 @@ export const meetingFields = [ default: 2, description: 'Meeting type.', }, - { - displayName: 'Muting Before Entry', - name: 'muteUponEntry', - type: 'boolean', - default: false, - description: 'Mute participants upon entry.', - }, { displayName: 'Password', name: 'password', @@ -683,34 +582,6 @@ export const meetingFields = [ default: '', description: 'Password to join the meeting with maximum 10 characters.', }, - { - displayName: 'Participant Video', - name: 'participantVideo', - type: 'boolean', - default: false, - description: 'Start video when participant joins the meeting.', - }, - { - displayName: 'Registration Type', - name: 'registrationType', - type: 'options', - options: [ - { - name: 'Attendees register once and can attend any of the occurrences', - value: 1, - }, - { - name: 'Attendees need to register for every occurrence', - value: 2, - }, - { - name: 'Attendees register once and can choose one or more occurrences to attend', - value: 3, - }, - ], - default: 1, - description: 'Registration type. Used for recurring meetings with fixed time only', - }, { displayName: 'Schedule For', name: 'scheduleFor', @@ -718,6 +589,135 @@ export const meetingFields = [ default: '', description: 'Schedule meeting for someone else from your account, provide their email ID.', }, + { + displayName: 'Settings', + name: 'settings', + type: 'collection', + placeholder: 'Add Setting', + default: {}, + options: [ + { + displayName: 'Audio', + name: 'audio', + type: 'options', + options: [ + { + name: 'Both Telephony and VoiP', + value: 'both', + }, + { + name: 'Telephony', + value: 'telephony', + }, + { + name: 'VOIP', + value: 'voip', + }, + + ], + default: 'both', + description: 'Determine how participants can join audio portion of the meeting.', + }, + { + displayName: 'Alternative Hosts', + name: 'alternativeHosts', + type: 'string', + default: '', + description: 'Alternative hosts email IDs.', + }, + { + displayName: 'Auto Recording', + name: 'autoRecording', + type: 'options', + options: [ + { + name: 'Record on Local', + value: 'local', + }, + { + name: 'Record on Cloud', + value: 'cloud', + }, + { + name: 'Disabled', + value: 'none', + }, + ], + default: 'none', + description: 'Auto recording.', + }, + { + displayName: 'Host Meeting in China', + name: 'cnMeeting', + type: 'boolean', + default: false, + description: 'Host Meeting in China.', + }, + { + displayName: 'Host Meeting in India', + name: 'inMeeting', + type: 'boolean', + default: false, + description: 'Host Meeting in India.', + }, + { + displayName: 'Host Video', + name: 'hostVideo', + type: 'boolean', + default: false, + description: 'Start video when host joins the meeting.', + }, + { + displayName: 'Join Before Host', + name: 'joinBeforeHost', + type: 'boolean', + default: false, + description: 'Allow participants to join the meeting before host starts it.', + }, + { + displayName: 'Muting Upon Entry', + name: 'muteUponEntry', + type: 'boolean', + default: false, + description: 'Mute participants upon entry.', + }, + { + displayName: 'Participant Video', + name: 'participantVideo', + type: 'boolean', + default: false, + description: 'Start video when participant joins the meeting.', + }, + { + displayName: 'Registration Type', + name: 'registrationType', + type: 'options', + options: [ + { + name: 'Attendees register once and can attend any of the occurences', + value: 1, + }, + { + name: 'Attendees need to register for every occurrence', + value: 2, + }, + { + name: 'Attendees register once and can choose one or more occurrences to attend', + value: 3, + }, + ], + default: 1, + description: 'Registration type. Used for recurring meetings with fixed time only', + }, + { + displayName: 'Watermark', + name: 'watermark', + type: 'boolean', + default: false, + description: 'Adds watermark when viewing a shared screen.', + }, + ], + }, { displayName: 'Start Time', name: 'startTime', @@ -735,16 +735,6 @@ export const meetingFields = [ default: '', description: `Time zone used in the response. The default is the time zone of the calendar.`, }, - { - displayName: 'Watermark', - name: 'watermark', - type: 'boolean', - default: false, - description: 'Adds watermark when viewing a shared screen.', - }, - - ], }, - ] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts index 5d40aae014..5438f18fa3 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts @@ -1,6 +1,7 @@ import { INodeProperties, } from 'n8n-workflow'; + export const meetingRegistrantOperations = [ { displayName: 'Operation', @@ -9,7 +10,7 @@ export const meetingRegistrantOperations = [ displayOptions: { show: { resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -38,7 +39,7 @@ export const meetingRegistrantOperations = [ export const meetingRegistrantFields = [ /* -------------------------------------------------------------------------- */ - /* meetingRegistrants:create */ + /* meetingRegistrant:create */ /* -------------------------------------------------------------------------- */ { displayName: 'Meeting Id', @@ -52,7 +53,7 @@ export const meetingRegistrantFields = [ 'create', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -70,7 +71,7 @@ export const meetingRegistrantFields = [ 'create', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -88,7 +89,7 @@ export const meetingRegistrantFields = [ 'create', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -107,7 +108,7 @@ export const meetingRegistrantFields = [ ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -248,7 +249,7 @@ export const meetingRegistrantFields = [ ], }, /* -------------------------------------------------------------------------- */ - /* meetingRegistrants:getAll */ + /* meetingRegistrant:getAll */ /* -------------------------------------------------------------------------- */ { displayName: 'Meeting ID', @@ -262,7 +263,7 @@ export const meetingRegistrantFields = [ 'getAll', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -278,7 +279,7 @@ export const meetingRegistrantFields = [ 'getAll', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -295,7 +296,7 @@ export const meetingRegistrantFields = [ 'getAll', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], returnAll: [ false, @@ -322,7 +323,7 @@ export const meetingRegistrantFields = [ ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -359,7 +360,7 @@ export const meetingRegistrantFields = [ ] }, /* -------------------------------------------------------------------------- */ - /* meetingRegistrants:update */ + /* meetingRegistrant:update */ /* -------------------------------------------------------------------------- */ { displayName: 'Meeting ID', @@ -373,7 +374,7 @@ export const meetingRegistrantFields = [ 'update', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -390,7 +391,7 @@ export const meetingRegistrantFields = [ 'update', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -423,7 +424,7 @@ export const meetingRegistrantFields = [ 'update', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index e6e6a78600..e3c9a083a5 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -1,14 +1,16 @@ import { IExecuteFunctions, } from 'n8n-core'; + import { IDataObject, - INodeExecutionData, - INodeType, ILoadOptionsFunctions, - INodeTypeDescription, + INodeExecutionData, INodePropertyOptions, + INodeType, + INodeTypeDescription, } from 'n8n-workflow'; + import { zoomApiRequest, zoomApiRequestAllItems, @@ -19,16 +21,15 @@ import { meetingFields, } from './MeetingDescription'; -import { - meetingRegistrantOperations, - meetingRegistrantFields, +// import { +// meetingRegistrantOperations, +// meetingRegistrantFields, +// } from './MeetingRegistrantDescription'; -} from './MeetingRegistrantDescription'; - -import { - webinarOperations, - webinarFields, -} from './WebinarDescription'; +// import { +// webinarOperations, +// webinarFields, +// } from './WebinarDescription'; import * as moment from 'moment-timezone'; @@ -48,6 +49,7 @@ interface Settings { approval_type?: number; practice_session?: boolean; } + export class Zoom implements INodeType { description: INodeTypeDescription = { displayName: 'Zoom', @@ -119,14 +121,14 @@ export class Zoom implements INodeType { name: 'Meeting', value: 'meeting' }, - { - name: 'Meeting Registrant', - value: 'meetingRegistrants' - }, - { - name: 'Webinar', - value: 'webinar' - } + // { + // name: 'Meeting Registrant', + // value: 'meetingRegistrant' + // }, + // { + // name: 'Webinar', + // value: 'webinar' + // } ], default: 'meeting', description: 'The resource to operate on.' @@ -135,13 +137,13 @@ export class Zoom implements INodeType { ...meetingOperations, ...meetingFields, - //MEETING REGISTRANTS - ...meetingRegistrantOperations, - ...meetingRegistrantFields, + // //MEETING REGISTRANTS + // ...meetingRegistrantOperations, + // ...meetingRegistrantFields, - //WEBINARS - ...webinarOperations, - ...webinarFields, + // //WEBINARS + // ...webinarOperations, + // ...webinarFields, ] }; @@ -169,7 +171,6 @@ export class Zoom implements INodeType { const items = this.getInputData(); const returnData: IDataObject[] = []; let qs: IDataObject = {}; - let body: IDataObject = {}; let responseData; const resource = this.getNodeParameter('resource', 0) as string; const operation = this.getNodeParameter('operation', 0) as string; @@ -186,14 +187,13 @@ export class Zoom implements INodeType { 'additionalFields', i ) as IDataObject; + if (additionalFields.showPreviousOccurrences) { qs.show_previous_occurrences = additionalFields.showPreviousOccurrences as boolean; - } if (additionalFields.occurrenceId) { qs.occurrence_id = additionalFields.occurrenceId as string; - } responseData = await zoomApiRequest.call( @@ -206,23 +206,22 @@ export class Zoom implements INodeType { } if (operation === 'getAll') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetings - const userId = this.getNodeParameter('userId', i) as string; const returnAll = this.getNodeParameter('returnAll', i) as boolean; - const additionalFields = this.getNodeParameter( - 'additionalFields', + const filters = this.getNodeParameter( + 'filters', i ) as IDataObject; - if (additionalFields.type) { - qs.type = additionalFields.type as string; - + if (filters.type) { + qs.type = filters.type as string; } + if (returnAll) { - responseData = await zoomApiRequestAllItems.call(this, 'meetings', 'GET', `/users/${userId}/meetings`, {}, qs); + responseData = await zoomApiRequestAllItems.call(this, 'meetings', 'GET', '/users/me/meetings', {}, qs); } else { qs.page_size = this.getNodeParameter('limit', i) as number; - responseData = await zoomApiRequest.call(this, 'GET', `/users/${userId}/meetings`, {}, qs); - + responseData = await zoomApiRequest.call(this, 'GET', '/users/me/meetings', {}, qs); + responseData = responseData.meetings; } } @@ -235,12 +234,10 @@ export class Zoom implements INodeType { ) as IDataObject; if (additionalFields.scheduleForReminder) { qs.schedule_for_reminder = additionalFields.scheduleForReminder as boolean; - } if (additionalFields.occurrenceId) { qs.occurrence_id = additionalFields.occurrenceId; - } responseData = await zoomApiRequest.call( @@ -254,114 +251,100 @@ export class Zoom implements INodeType { } if (operation === 'create') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate - const userId = this.getNodeParameter('userId', i) as string; const additionalFields = this.getNodeParameter( 'additionalFields', i ) as IDataObject; - const settings: Settings = {}; - if (additionalFields.cnMeeting) { - settings.cn_meeting = additionalFields.cnMeeting as boolean; + const body: IDataObject = {}; + + if (additionalFields.settings) { + const settingValues: Settings = {}; + const settings = additionalFields.settings as IDataObject; + + if (settings.cnMeeting) { + settingValues.cn_meeting = settings.cnMeeting as boolean; + } + + if (settings.inMeeting) { + settingValues.in_meeting = settings.inMeeting as boolean; + } + + if (settings.joinBeforeHost) { + settingValues.join_before_host = settings.joinBeforeHost as boolean; + } + + if (settings.muteUponEntry) { + settingValues.mute_upon_entry = settings.muteUponEntry as boolean; + } + + if (settings.watermark) { + settingValues.watermark = settings.watermark as boolean; + } + + if (settings.audio) { + settingValues.audio = settings.audio as string; + } + + if (settings.alternativeHosts) { + settingValues.alternative_hosts = settings.alternativeHosts as string; + } + + if (settings.participantVideo) { + settingValues.participant_video = settings.participantVideo as boolean; + } + + if (settings.hostVideo) { + settingValues.host_video = settings.hostVideo as boolean; + } + + if (settings.autoRecording) { + settingValues.auto_recording = settings.autoRecording as string; + } + + if (settings.registrationType) { + settingValues.registration_type = settings.registrationType as number; + } + + body.settings = settingValues; } - if (additionalFields.inMeeting) { - settings.in_meeting = additionalFields.inMeeting as boolean; - - } - - if (additionalFields.joinBeforeHost) { - settings.join_before_host = additionalFields.joinBeforeHost as boolean; - - } - - if (additionalFields.muteUponEntry) { - settings.mute_upon_entry = additionalFields.muteUponEntry as boolean; - - } - - if (additionalFields.watermark) { - settings.watermark = additionalFields.watermark as boolean; - - } - - if (additionalFields.audio) { - settings.audio = additionalFields.audio as string; - - } - - if (additionalFields.alternativeHosts) { - settings.alternative_hosts = additionalFields.alternativeHosts as string; - - } - - if (additionalFields.participantVideo) { - settings.participant_video = additionalFields.participantVideo as boolean; - - } - - if (additionalFields.hostVideo) { - settings.host_video = additionalFields.hostVideo as boolean; - - } - - if (additionalFields.autoRecording) { - settings.auto_recording = additionalFields.autoRecording as string; - - } - - if (additionalFields.registrationType) { - settings.registration_type = additionalFields.registrationType as number; - - } - - body = { - settings, - }; - if (additionalFields.topic) { body.topic = additionalFields.topic as string; - } if (additionalFields.type) { body.type = additionalFields.type as string; - } if (additionalFields.startTime) { body.start_time = additionalFields.startTime as string; - } if (additionalFields.duration) { body.duration = additionalFields.duration as number; - } if (additionalFields.scheduleFor) { body.schedule_for = additionalFields.scheduleFor as string; - } if (additionalFields.timeZone) { body.timezone = additionalFields.timeZone as string; - } if (additionalFields.password) { body.password = additionalFields.password as string; - } if (additionalFields.agenda) { body.agenda = additionalFields.agenda as string; - } + responseData = await zoomApiRequest.call( this, 'POST', - `/users/${userId}/meetings`, + `/users/me/meetings`, body, qs ); @@ -369,112 +352,94 @@ export class Zoom implements INodeType { if (operation === 'update') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingupdate const meetingId = this.getNodeParameter('meetingId', i) as string; - const settings: Settings = {}; - const additionalFields = this.getNodeParameter( - 'additionalFields', + const updateFields = this.getNodeParameter( + 'updateFields', i ) as IDataObject; - if (additionalFields.occurrenceId) { - qs.occurrence_id = additionalFields.occurrenceId as string; + const body: IDataObject = {}; + + if (updateFields.settings) { + const settingValues: Settings = {}; + const settings = updateFields.settings as IDataObject; + + if (settings.cnMeeting) { + settingValues.cn_meeting = settings.cnMeeting as boolean; + } + + if (settings.inMeeting) { + settingValues.in_meeting = settings.inMeeting as boolean; + } + + if (settings.joinBeforeHost) { + settingValues.join_before_host = settings.joinBeforeHost as boolean; + } + + if (settings.muteUponEntry) { + settingValues.mute_upon_entry = settings.muteUponEntry as boolean; + } + + if (settings.watermark) { + settingValues.watermark = settings.watermark as boolean; + } + + if (settings.audio) { + settingValues.audio = settings.audio as string; + } + + if (settings.alternativeHosts) { + settingValues.alternative_hosts = settings.alternativeHosts as string; + } + + if (settings.participantVideo) { + settingValues.participant_video = settings.participantVideo as boolean; + } + + if (settings.hostVideo) { + settingValues.host_video = settings.hostVideo as boolean; + } + + if (settings.autoRecording) { + settingValues.auto_recording = settings.autoRecording as string; + } + + if (settings.registrationType) { + settingValues.registration_type = settings.registrationType as number; + } + + body.settings = settingValues; } - if (additionalFields.cnMeeting) { - settings.cn_meeting = additionalFields.cnMeeting as boolean; - + if (updateFields.topic) { + body.topic = updateFields.topic as string; } - if (additionalFields.inMeeting) { - settings.in_meeting = additionalFields.inMeeting as boolean; - + if (updateFields.type) { + body.type = updateFields.type as string; } - if (additionalFields.joinBeforeHost) { - settings.join_before_host = additionalFields.joinBeforeHost as boolean; - + if (updateFields.startTime) { + body.start_time = updateFields.startTime as string; } - if (additionalFields.muteUponEntry) { - settings.mute_upon_entry = additionalFields.muteUponEntry as boolean; - + if (updateFields.duration) { + body.duration = updateFields.duration as number; } - if (additionalFields.watermark) { - settings.watermark = additionalFields.watermark as boolean; - + if (updateFields.scheduleFor) { + body.schedule_for = updateFields.scheduleFor as string; } - if (additionalFields.audio) { - settings.audio = additionalFields.audio as string; - + if (updateFields.timeZone) { + body.timezone = updateFields.timeZone as string; } - if (additionalFields.alternativeHosts) { - settings.alternative_hosts = additionalFields.alternativeHosts as string; - + if (updateFields.password) { + body.password = updateFields.password as string; } - if (additionalFields.participantVideo) { - settings.participant_video = additionalFields.participantVideo as boolean; - - } - - if (additionalFields.hostVideo) { - settings.host_video = additionalFields.hostVideo as boolean; - - } - - if (additionalFields.autoRecording) { - settings.auto_recording = additionalFields.autoRecording as string; - - } - - if (additionalFields.registrationType) { - settings.registration_type = additionalFields.registrationType as number; - - } - - body = { - settings, - }; - if (additionalFields.topic) { - body.topic = additionalFields.topic as string; - - } - - if (additionalFields.type) { - body.type = additionalFields.type as string; - - } - - if (additionalFields.startTime) { - body.start_time = additionalFields.startTime as string; - - } - - if (additionalFields.duration) { - body.duration = additionalFields.duration as number; - - } - - if (additionalFields.scheduleFor) { - body.schedule_for = additionalFields.scheduleFor as string; - - } - - if (additionalFields.timeZone) { - body.timezone = additionalFields.timeZone as string; - - } - - if (additionalFields.password) { - body.password = additionalFields.password as string; - - } - - if (additionalFields.agenda) { - body.agenda = additionalFields.agenda as string; - + if (updateFields.agenda) { + body.agenda = updateFields.agenda as string; } responseData = await zoomApiRequest.call( @@ -484,364 +449,365 @@ export class Zoom implements INodeType { body, qs ); - responseData = { updated: true }; - } - } - if (resource === 'meetingRegistrants') { - if (operation === 'create') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantcreate - const meetingId = this.getNodeParameter('meetingId', i) as string; - const emailId = this.getNodeParameter('email', i) as string; - body.email = emailId; - const firstName = this.getNodeParameter('firstName', i) as string; - body.first_name = firstName; - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; - if (additionalFields.occurrenceId) { - qs.occurrence_ids = additionalFields.occurrenceId as string; - } - if (additionalFields.lastName) { - body.last_name = additionalFields.lastName as string; - } - if (additionalFields.address) { - body.address = additionalFields.address as string; - } - if (additionalFields.city) { - body.city = additionalFields.city as string; - } - if (additionalFields.state) { - body.state = additionalFields.state as string; - } - if (additionalFields.country) { - body.country = additionalFields.country as string; - } - if (additionalFields.zip) { - body.zip = additionalFields.zip as string; - } - if (additionalFields.phone) { - body.phone = additionalFields.phone as string; - } - if (additionalFields.comments) { - body.comments = additionalFields.comments as string; - } - if (additionalFields.org) { - body.org = additionalFields.org as string; - } - if (additionalFields.jobTitle) { - body.job_title = additionalFields.jobTitle as string; - } - if (additionalFields.purchasingTimeFrame) { - body.purchasing_time_frame = additionalFields.purchasingTimeFrame as string; - } - if (additionalFields.roleInPurchaseProcess) { - body.role_in_purchase_process = additionalFields.roleInPurchaseProcess as string; - } - responseData = await zoomApiRequest.call( - this, - 'POST', - `/meetings/${meetingId}/registrants`, - body, - qs - ); - } - if (operation === 'getAll') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrants - const meetingId = this.getNodeParameter('meetingId', i) as string; - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; - if (additionalFields.occurrenceId) { - qs.occurrence_id = additionalFields.occurrenceId as string; - } - if (additionalFields.status) { - qs.status = additionalFields.status as string; - } - const returnAll = this.getNodeParameter('returnAll', i) as boolean; - if (returnAll) { - responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/meetings/${meetingId}/registrants`, {}, qs); - } else { - qs.page_size = this.getNodeParameter('limit', i) as number; - responseData = await zoomApiRequest.call(this, 'GET', `/meetings/${meetingId}/registrants`, {}, qs); - - } - - } - if (operation === 'update') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantstatus - const meetingId = this.getNodeParameter('meetingId', i) as string; - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; - if (additionalFields.occurenceId) { - qs.occurrence_id = additionalFields.occurrenceId as string; - } - if (additionalFields.action) { - body.action = additionalFields.action as string; - } - responseData = await zoomApiRequest.call( - this, - 'PUT', - `/meetings/${meetingId}/registrants/status`, - body, - qs - ); - } - } - if (resource === 'webinar') { - if (operation === 'create') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarcreate - const userId = this.getNodeParameter('userId', i) as string; - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; - const settings: Settings = {}; - - - if (additionalFields.audio) { - settings.audio = additionalFields.audio as string; - - } - - if (additionalFields.alternativeHosts) { - settings.alternative_hosts = additionalFields.alternativeHosts as string; - - } - - if (additionalFields.panelistsVideo) { - settings.panelists_video = additionalFields.panelistsVideo as boolean; - - } - if (additionalFields.hostVideo) { - settings.host_video = additionalFields.hostVideo as boolean; - - } - if (additionalFields.practiceSession) { - settings.practice_session = additionalFields.practiceSession as boolean; - - } - if (additionalFields.autoRecording) { - settings.auto_recording = additionalFields.autoRecording as string; - - } - - if (additionalFields.registrationType) { - settings.registration_type = additionalFields.registrationType as number; - - } - if (additionalFields.approvalType) { - settings.approval_type = additionalFields.approvalType as number; - - } - - body = { - settings, - }; - - if (additionalFields.topic) { - body.topic = additionalFields.topic as string; - - } - - if (additionalFields.type) { - body.type = additionalFields.type as string; - - } - - if (additionalFields.startTime) { - body.start_time = additionalFields.startTime as string; - - } - - if (additionalFields.duration) { - body.duration = additionalFields.duration as number; - - } - - - if (additionalFields.timeZone) { - body.timezone = additionalFields.timeZone as string; - - } - - if (additionalFields.password) { - body.password = additionalFields.password as string; - - } - - if (additionalFields.agenda) { - body.agenda = additionalFields.agenda as string; - - } - responseData = await zoomApiRequest.call( - this, - 'POST', - `/users/${userId}/webinars`, - body, - qs - ); - } - if (operation === 'get') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinar - const webinarId = this.getNodeParameter('webinarId', i) as string; - - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; - if (additionalFields.showPreviousOccurrences) { - qs.show_previous_occurrences = additionalFields.showPreviousOccurrences as boolean; - - } - - if (additionalFields.occurrenceId) { - qs.occurrence_id = additionalFields.occurrenceId as string; - - } - - responseData = await zoomApiRequest.call( - this, - 'GET', - `/webinars/${webinarId}`, - {}, - qs - ); - } - if (operation === 'getAll') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinars - const userId = this.getNodeParameter('userId', i) as string; - const returnAll = this.getNodeParameter('returnAll', i) as boolean; - if (returnAll) { - responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/users/${userId}/webinars`, {}, qs); - } else { - qs.page_size = this.getNodeParameter('limit', i) as number; - responseData = await zoomApiRequest.call(this, 'GET', `/users/${userId}/webinars`, {}, qs); - - } - } - if (operation === 'delete') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinardelete - const webinarId = this.getNodeParameter('webinarId', i) as string; - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; - - - if (additionalFields.occurrenceId) { - qs.occurrence_id = additionalFields.occurrenceId; - - } - - responseData = await zoomApiRequest.call( - this, - 'DELETE', - `/webinars/${webinarId}`, - {}, - qs - ); responseData = { success: true }; - } - if (operation === 'update') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarupdate - const webinarId = this.getNodeParameter('webinarId', i) as string; - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; - if (additionalFields.occurrenceId) { - qs.occurrence_id = additionalFields.occurrenceId as string; - } - const settings: Settings = {}; - if (additionalFields.audio) { - settings.audio = additionalFields.audio as string; - - } - if (additionalFields.alternativeHosts) { - settings.alternative_hosts = additionalFields.alternativeHosts as string; - - } - - if (additionalFields.panelistsVideo) { - settings.panelists_video = additionalFields.panelistsVideo as boolean; - - } - if (additionalFields.hostVideo) { - settings.host_video = additionalFields.hostVideo as boolean; - - } - if (additionalFields.practiceSession) { - settings.practice_session = additionalFields.practiceSession as boolean; - - } - if (additionalFields.autoRecording) { - settings.auto_recording = additionalFields.autoRecording as string; - - } - - if (additionalFields.registrationType) { - settings.registration_type = additionalFields.registrationType as number; - - } - if (additionalFields.approvalType) { - settings.approval_type = additionalFields.approvalType as number; - - } - - body = { - settings, - }; - - if (additionalFields.topic) { - body.topic = additionalFields.topic as string; - - } - - if (additionalFields.type) { - body.type = additionalFields.type as string; - - } - - if (additionalFields.startTime) { - body.start_time = additionalFields.startTime as string; - - } - - if (additionalFields.duration) { - body.duration = additionalFields.duration as number; - - } - - - if (additionalFields.timeZone) { - body.timezone = additionalFields.timeZone as string; - - } - - if (additionalFields.password) { - body.password = additionalFields.password as string; - - } - - if (additionalFields.agenda) { - body.agenda = additionalFields.agenda as string; - - } - responseData = await zoomApiRequest.call( - this, - 'PATCH', - `webinars/${webinarId}`, - body, - qs - ); } } + // if (resource === 'meetingRegistrant') { + // if (operation === 'create') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantcreate + // const meetingId = this.getNodeParameter('meetingId', i) as string; + // const emailId = this.getNodeParameter('email', i) as string; + // body.email = emailId; + // const firstName = this.getNodeParameter('firstName', i) as string; + // body.first_name = firstName; + // const additionalFields = this.getNodeParameter( + // 'additionalFields', + // i + // ) as IDataObject; + // if (additionalFields.occurrenceId) { + // qs.occurrence_ids = additionalFields.occurrenceId as string; + // } + // if (additionalFields.lastName) { + // body.last_name = additionalFields.lastName as string; + // } + // if (additionalFields.address) { + // body.address = additionalFields.address as string; + // } + // if (additionalFields.city) { + // body.city = additionalFields.city as string; + // } + // if (additionalFields.state) { + // body.state = additionalFields.state as string; + // } + // if (additionalFields.country) { + // body.country = additionalFields.country as string; + // } + // if (additionalFields.zip) { + // body.zip = additionalFields.zip as string; + // } + // if (additionalFields.phone) { + // body.phone = additionalFields.phone as string; + // } + // if (additionalFields.comments) { + // body.comments = additionalFields.comments as string; + // } + // if (additionalFields.org) { + // body.org = additionalFields.org as string; + // } + // if (additionalFields.jobTitle) { + // body.job_title = additionalFields.jobTitle as string; + // } + // if (additionalFields.purchasingTimeFrame) { + // body.purchasing_time_frame = additionalFields.purchasingTimeFrame as string; + // } + // if (additionalFields.roleInPurchaseProcess) { + // body.role_in_purchase_process = additionalFields.roleInPurchaseProcess as string; + // } + // responseData = await zoomApiRequest.call( + // this, + // 'POST', + // `/meetings/${meetingId}/registrants`, + // body, + // qs + // ); + // } + // if (operation === 'getAll') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrants + // const meetingId = this.getNodeParameter('meetingId', i) as string; + // const additionalFields = this.getNodeParameter( + // 'additionalFields', + // i + // ) as IDataObject; + // if (additionalFields.occurrenceId) { + // qs.occurrence_id = additionalFields.occurrenceId as string; + // } + // if (additionalFields.status) { + // qs.status = additionalFields.status as string; + // } + // const returnAll = this.getNodeParameter('returnAll', i) as boolean; + // if (returnAll) { + // responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/meetings/${meetingId}/registrants`, {}, qs); + // } else { + // qs.page_size = this.getNodeParameter('limit', i) as number; + // responseData = await zoomApiRequest.call(this, 'GET', `/meetings/${meetingId}/registrants`, {}, qs); + + // } + + // } + // if (operation === 'update') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantstatus + // const meetingId = this.getNodeParameter('meetingId', i) as string; + // const additionalFields = this.getNodeParameter( + // 'additionalFields', + // i + // ) as IDataObject; + // if (additionalFields.occurenceId) { + // qs.occurrence_id = additionalFields.occurrenceId as string; + // } + // if (additionalFields.action) { + // body.action = additionalFields.action as string; + // } + // responseData = await zoomApiRequest.call( + // this, + // 'PUT', + // `/meetings/${meetingId}/registrants/status`, + // body, + // qs + // ); + // } + // } + // if (resource === 'webinar') { + // if (operation === 'create') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarcreate + // const userId = this.getNodeParameter('userId', i) as string; + // const additionalFields = this.getNodeParameter( + // 'additionalFields', + // i + // ) as IDataObject; + // const settings: Settings = {}; + + + // if (additionalFields.audio) { + // settings.audio = additionalFields.audio as string; + + // } + + // if (additionalFields.alternativeHosts) { + // settings.alternative_hosts = additionalFields.alternativeHosts as string; + + // } + + // if (additionalFields.panelistsVideo) { + // settings.panelists_video = additionalFields.panelistsVideo as boolean; + + // } + // if (additionalFields.hostVideo) { + // settings.host_video = additionalFields.hostVideo as boolean; + + // } + // if (additionalFields.practiceSession) { + // settings.practice_session = additionalFields.practiceSession as boolean; + + // } + // if (additionalFields.autoRecording) { + // settings.auto_recording = additionalFields.autoRecording as string; + + // } + + // if (additionalFields.registrationType) { + // settings.registration_type = additionalFields.registrationType as number; + + // } + // if (additionalFields.approvalType) { + // settings.approval_type = additionalFields.approvalType as number; + + // } + + // body = { + // settings, + // }; + + // if (additionalFields.topic) { + // body.topic = additionalFields.topic as string; + + // } + + // if (additionalFields.type) { + // body.type = additionalFields.type as string; + + // } + + // if (additionalFields.startTime) { + // body.start_time = additionalFields.startTime as string; + + // } + + // if (additionalFields.duration) { + // body.duration = additionalFields.duration as number; + + // } + + + // if (additionalFields.timeZone) { + // body.timezone = additionalFields.timeZone as string; + + // } + + // if (additionalFields.password) { + // body.password = additionalFields.password as string; + + // } + + // if (additionalFields.agenda) { + // body.agenda = additionalFields.agenda as string; + + // } + // responseData = await zoomApiRequest.call( + // this, + // 'POST', + // `/users/${userId}/webinars`, + // body, + // qs + // ); + // } + // if (operation === 'get') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinar + // const webinarId = this.getNodeParameter('webinarId', i) as string; + + // const additionalFields = this.getNodeParameter( + // 'additionalFields', + // i + // ) as IDataObject; + // if (additionalFields.showPreviousOccurrences) { + // qs.show_previous_occurrences = additionalFields.showPreviousOccurrences as boolean; + + // } + + // if (additionalFields.occurrenceId) { + // qs.occurrence_id = additionalFields.occurrenceId as string; + + // } + + // responseData = await zoomApiRequest.call( + // this, + // 'GET', + // `/webinars/${webinarId}`, + // {}, + // qs + // ); + // } + // if (operation === 'getAll') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinars + // const userId = this.getNodeParameter('userId', i) as string; + // const returnAll = this.getNodeParameter('returnAll', i) as boolean; + // if (returnAll) { + // responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/users/${userId}/webinars`, {}, qs); + // } else { + // qs.page_size = this.getNodeParameter('limit', i) as number; + // responseData = await zoomApiRequest.call(this, 'GET', `/users/${userId}/webinars`, {}, qs); + + // } + // } + // if (operation === 'delete') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinardelete + // const webinarId = this.getNodeParameter('webinarId', i) as string; + // const additionalFields = this.getNodeParameter( + // 'additionalFields', + // i + // ) as IDataObject; + + + // if (additionalFields.occurrenceId) { + // qs.occurrence_id = additionalFields.occurrenceId; + + // } + + // responseData = await zoomApiRequest.call( + // this, + // 'DELETE', + // `/webinars/${webinarId}`, + // {}, + // qs + // ); + // responseData = { success: true }; + // } + // if (operation === 'update') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarupdate + // const webinarId = this.getNodeParameter('webinarId', i) as string; + // const additionalFields = this.getNodeParameter( + // 'additionalFields', + // i + // ) as IDataObject; + // if (additionalFields.occurrenceId) { + // qs.occurrence_id = additionalFields.occurrenceId as string; + + // } + // const settings: Settings = {}; + // if (additionalFields.audio) { + // settings.audio = additionalFields.audio as string; + + // } + // if (additionalFields.alternativeHosts) { + // settings.alternative_hosts = additionalFields.alternativeHosts as string; + + // } + + // if (additionalFields.panelistsVideo) { + // settings.panelists_video = additionalFields.panelistsVideo as boolean; + + // } + // if (additionalFields.hostVideo) { + // settings.host_video = additionalFields.hostVideo as boolean; + + // } + // if (additionalFields.practiceSession) { + // settings.practice_session = additionalFields.practiceSession as boolean; + + // } + // if (additionalFields.autoRecording) { + // settings.auto_recording = additionalFields.autoRecording as string; + + // } + + // if (additionalFields.registrationType) { + // settings.registration_type = additionalFields.registrationType as number; + + // } + // if (additionalFields.approvalType) { + // settings.approval_type = additionalFields.approvalType as number; + + // } + + // body = { + // settings, + // }; + + // if (additionalFields.topic) { + // body.topic = additionalFields.topic as string; + + // } + + // if (additionalFields.type) { + // body.type = additionalFields.type as string; + + // } + + // if (additionalFields.startTime) { + // body.start_time = additionalFields.startTime as string; + + // } + + // if (additionalFields.duration) { + // body.duration = additionalFields.duration as number; + + // } + + + // if (additionalFields.timeZone) { + // body.timezone = additionalFields.timeZone as string; + + // } + + // if (additionalFields.password) { + // body.password = additionalFields.password as string; + + // } + + // if (additionalFields.agenda) { + // body.agenda = additionalFields.agenda as string; + + // } + // responseData = await zoomApiRequest.call( + // this, + // 'PATCH', + // `webinars/${webinarId}`, + // body, + // qs + // ); + // } + // } } if (Array.isArray(responseData)) { returnData.push.apply(returnData, responseData as IDataObject[]);