1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-10-26 21:46:07 +03:00

Some minior improvements on Zoom-Node

This commit is contained in:
Jan Oberhauser 2020-07-06 15:05:05 +02:00
parent fcfef158cb
commit af4333f268
3 changed files with 86 additions and 82 deletions

View File

@ -5,7 +5,7 @@ export class ZoomApi implements ICredentialType {
displayName = 'Zoom API'; displayName = 'Zoom API';
properties = [ properties = [
{ {
displayName: 'Access Token', displayName: 'JTW Token',
name: 'accessToken', name: 'accessToken',
type: 'string' as NodePropertyTypes, type: 'string' as NodePropertyTypes,
default: '' default: ''

View File

@ -50,6 +50,27 @@ export const meetingFields = [
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* meeting:create */ /* meeting:create */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
{
displayName: 'Topic',
name: 'topic',
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
},
default: '',
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'meeting',
],
},
},
description: `Topic of the meeting.`,
},
{ {
displayName: 'Additional Fields', displayName: 'Additional Fields',
name: 'additionalFields', name: 'additionalFields',
@ -88,42 +109,6 @@ export const meetingFields = [
default: 0, default: 0,
description: 'Meeting duration (minutes).', description: 'Meeting duration (minutes).',
}, },
{
displayName: 'Meeting Topic',
name: 'topic',
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
},
default: '',
description: `Meeting topic.`,
},
{
displayName: 'Meeting Type',
name: 'type',
type: 'options',
options: [
{
name: 'Instant Meeting',
value: 1,
},
{
name: 'Scheduled Meeting',
value: 2,
},
{
name: 'Recurring Meeting with no fixed time',
value: 3,
},
{
name: 'Recurring Meeting with fixed time',
value: 8,
},
],
default: 2,
description: 'Meeting type.',
},
{ {
displayName: 'Password', displayName: 'Password',
name: 'password', name: 'password',
@ -284,13 +269,39 @@ export const meetingFields = [
default: '', default: '',
description: `Time zone used in the response. The default is the time zone of the calendar.`, description: `Time zone used in the response. The default is the time zone of the calendar.`,
}, },
{
displayName: 'Type',
name: 'type',
type: 'options',
options: [
{
name: 'Instant Meeting',
value: 1,
},
{
name: 'Scheduled Meeting',
value: 2,
},
{
name: 'Recurring Meeting with no fixed time',
value: 3,
},
{
name: 'Recurring Meeting with fixed time',
value: 8,
},
],
default: 2,
description: 'Meeting type.',
},
], ],
}, },
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* meeting:get */ /* meeting:get */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
{ {
displayName: 'Meeting ID', displayName: 'ID',
name: 'meetingId', name: 'meetingId',
type: 'string', type: 'string',
default: '', default: '',
@ -433,7 +444,7 @@ export const meetingFields = [
/* meeting:delete */ /* meeting:delete */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
{ {
displayName: 'Meeting ID', displayName: 'ID',
name: 'meetingId', name: 'meetingId',
type: 'string', type: 'string',
default: '', default: '',
@ -488,7 +499,7 @@ export const meetingFields = [
/* meeting:update */ /* meeting:update */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
{ {
displayName: 'Meeting ID', displayName: 'ID',
name: 'meetingId', name: 'meetingId',
type: 'string', type: 'string',
default: '', default: '',
@ -542,39 +553,6 @@ export const meetingFields = [
default: 0, default: 0,
description: 'Meeting duration (minutes).', description: 'Meeting duration (minutes).',
}, },
{
displayName: 'Meeting Topic',
name: 'topic',
type: 'string',
default: '',
description: `Meeting topic.`,
},
{
displayName: 'Meeting Type',
name: 'type',
type: 'options',
options: [
{
name: 'Instant Meeting',
value: 1,
},
{
name: 'Scheduled Meeting',
value: 2,
},
{
name: 'Recurring Meeting with no fixed time',
value: 3,
},
{
name: 'Recurring Meeting with fixed time',
value: 8,
},
],
default: 2,
description: 'Meeting type.',
},
{ {
displayName: 'Password', displayName: 'Password',
name: 'password', name: 'password',
@ -735,6 +713,39 @@ export const meetingFields = [
default: '', default: '',
description: `Time zone used in the response. The default is the time zone of the calendar.`, description: `Time zone used in the response. The default is the time zone of the calendar.`,
}, },
{
displayName: 'Topic',
name: 'topic',
type: 'string',
default: '',
description: `Meeting topic.`,
},
{
displayName: 'Type',
name: 'type',
type: 'options',
options: [
{
name: 'Instant Meeting',
value: 1,
},
{
name: 'Scheduled Meeting',
value: 2,
},
{
name: 'Recurring Meeting with no fixed time',
value: 3,
},
{
name: 'Recurring Meeting with fixed time',
value: 8,
},
],
default: 2,
description: 'Meeting type.',
},
], ],
}, },
] as INodeProperties[]; ] as INodeProperties[];

View File

@ -252,10 +252,7 @@ export class Zoom implements INodeType {
} }
if (operation === 'create') { if (operation === 'create') {
//https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate
const additionalFields = this.getNodeParameter( const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
'additionalFields',
i
) as IDataObject;
const body: IDataObject = {}; const body: IDataObject = {};
@ -310,9 +307,7 @@ export class Zoom implements INodeType {
body.settings = settingValues; body.settings = settingValues;
} }
if (additionalFields.topic) { body.topic = this.getNodeParameter('topic', i) as string;
body.topic = additionalFields.topic as string;
}
if (additionalFields.type) { if (additionalFields.type) {
body.type = additionalFields.type as string; body.type = additionalFields.type as string;
@ -347,8 +342,6 @@ export class Zoom implements INodeType {
body.agenda = additionalFields.agenda as string; body.agenda = additionalFields.agenda as string;
} }
console.log(body);
responseData = await zoomApiRequest.call( responseData = await zoomApiRequest.call(
this, this,
'POST', 'POST',