mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
🔀 Merge branch 'Improve-Zulip-Node'
This commit is contained in:
commit
ce7bc08963
|
@ -33,11 +33,11 @@ export const streamOperations = [
|
||||||
value: 'getSubscribed',
|
value: 'getSubscribed',
|
||||||
description: 'Get subscribed streams.',
|
description: 'Get subscribed streams.',
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// name: 'Update',
|
name: 'Update',
|
||||||
// value: 'update',
|
value: 'update',
|
||||||
// description: 'Update a stream.',
|
description: 'Update a stream.',
|
||||||
// },
|
},
|
||||||
],
|
],
|
||||||
default: 'create',
|
default: 'create',
|
||||||
description: 'The operation to perform.',
|
description: 'The operation to perform.',
|
||||||
|
|
|
@ -33,11 +33,11 @@ export const userOperations = [
|
||||||
value: 'getAll',
|
value: 'getAll',
|
||||||
description: 'Get all users.',
|
description: 'Get all users.',
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// name: 'Update',
|
name: 'Update',
|
||||||
// value: 'update',
|
value: 'update',
|
||||||
// description: 'Update a user.',
|
description: 'Update a user.',
|
||||||
// },
|
},
|
||||||
],
|
],
|
||||||
default: 'create',
|
default: 'create',
|
||||||
description: 'The operation to perform.',
|
description: 'The operation to perform.',
|
||||||
|
|
|
@ -263,16 +263,16 @@ export class Zulip implements INodeType {
|
||||||
|
|
||||||
if (operation === 'create') {
|
if (operation === 'create') {
|
||||||
const jsonParameters = this.getNodeParameter('jsonParameters', i) as boolean;
|
const jsonParameters = this.getNodeParameter('jsonParameters', i) as boolean;
|
||||||
|
const subscriptions = this.getNodeParameter('subscriptions', i) as IDataObject;
|
||||||
|
|
||||||
|
body.subscriptions = JSON.stringify(subscriptions.properties);
|
||||||
|
|
||||||
if (jsonParameters) {
|
if (jsonParameters) {
|
||||||
const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i) as string;
|
const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i) as string;
|
||||||
|
|
||||||
if (additionalFieldsJson !== '') {
|
if (additionalFieldsJson !== '') {
|
||||||
|
|
||||||
if (validateJSON(additionalFieldsJson) !== undefined) {
|
if (validateJSON(additionalFieldsJson) !== undefined) {
|
||||||
|
|
||||||
Object.assign(body, JSON.parse(additionalFieldsJson));
|
Object.assign(body, JSON.parse(additionalFieldsJson));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Additional fields must be a valid JSON');
|
throw new Error('Additional fields must be a valid JSON');
|
||||||
}
|
}
|
||||||
|
@ -342,10 +342,10 @@ export class Zulip implements INodeType {
|
||||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||||
|
|
||||||
if (additionalFields.description) {
|
if (additionalFields.description) {
|
||||||
body.description = additionalFields.description as string;
|
body.description = JSON.stringify(additionalFields.description as string);
|
||||||
}
|
}
|
||||||
if (additionalFields.newName) {
|
if (additionalFields.newName) {
|
||||||
body.new_name = additionalFields.newName as string;
|
body.new_name = JSON.stringify(additionalFields.newName as string);
|
||||||
}
|
}
|
||||||
if (additionalFields.isPrivate) {
|
if (additionalFields.isPrivate) {
|
||||||
body.is_private = additionalFields.isPrivate as boolean;
|
body.is_private = additionalFields.isPrivate as boolean;
|
||||||
|
@ -412,7 +412,7 @@ export class Zulip implements INodeType {
|
||||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||||
|
|
||||||
if (additionalFields.fullName) {
|
if (additionalFields.fullName) {
|
||||||
body.full_name = additionalFields.fullName as string;
|
body.full_name = JSON.stringify(additionalFields.fullName as string);
|
||||||
}
|
}
|
||||||
if (additionalFields.isAdmin) {
|
if (additionalFields.isAdmin) {
|
||||||
body.is_admin = additionalFields.isAdmin as boolean;
|
body.is_admin = additionalFields.isAdmin as boolean;
|
||||||
|
|
Loading…
Reference in a new issue