mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
Subscriptions now front view
This commit is contained in:
parent
4ec8a2b44c
commit
bb2f1ecd00
|
@ -48,6 +48,51 @@ export const streamFields = [
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* stream:create */
|
/* stream:create */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
{
|
||||||
|
displayName: 'Subscriptions',
|
||||||
|
name: 'subscriptions',
|
||||||
|
type: 'fixedCollection',
|
||||||
|
required: true,
|
||||||
|
default: '',
|
||||||
|
description: 'A list of dictionaries containing the the key name and value specifying the name of the stream to subscribe. If the stream does not exist a new stream is created.',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
resource: [
|
||||||
|
'stream',
|
||||||
|
],
|
||||||
|
operation: [
|
||||||
|
'create',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
typeOptions: {
|
||||||
|
multipleValues: true,
|
||||||
|
},
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
displayName: 'Subscription Properties',
|
||||||
|
name: 'properties',
|
||||||
|
values: [
|
||||||
|
{
|
||||||
|
displayName: 'Name',
|
||||||
|
name: 'name',
|
||||||
|
type: 'string',
|
||||||
|
required: true,
|
||||||
|
default: '',
|
||||||
|
description: 'Name of Subscription.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Description',
|
||||||
|
name: 'description',
|
||||||
|
type: 'string',
|
||||||
|
required: true,
|
||||||
|
default: '',
|
||||||
|
description: 'Description of Subscription.',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'JSON Parameters',
|
displayName: 'JSON Parameters',
|
||||||
name: 'jsonParameters',
|
name: 'jsonParameters',
|
||||||
|
@ -162,40 +207,6 @@ export const streamFields = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
displayName: 'Subscriptions',
|
|
||||||
name: 'subscriptions',
|
|
||||||
type: 'fixedCollection',
|
|
||||||
required: true,
|
|
||||||
description: '"A list of dictionaries containing the the key name and value specifying the name of the stream to subscribe. If the stream does not exist a new stream is created.',
|
|
||||||
typeOptions: {
|
|
||||||
multipleValues: true,
|
|
||||||
},
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
displayName: 'Subscription Properties',
|
|
||||||
name: 'properties',
|
|
||||||
values: [
|
|
||||||
{
|
|
||||||
displayName: 'Name',
|
|
||||||
name: 'name',
|
|
||||||
type: 'string',
|
|
||||||
required: true,
|
|
||||||
default: '',
|
|
||||||
description: 'Name of Subscription.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
displayName: 'Description',
|
|
||||||
name: 'description',
|
|
||||||
type: 'string',
|
|
||||||
required: true,
|
|
||||||
default: '',
|
|
||||||
description: 'Description of Subscription.',
|
|
||||||
}
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
displayName: 'Stream Post Policy',
|
displayName: 'Stream Post Policy',
|
||||||
name: 'streamPostPolicy',
|
name: 'streamPostPolicy',
|
||||||
|
|
|
@ -262,6 +262,10 @@ 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[];
|
||||||
|
|
||||||
|
//@ts-ignore
|
||||||
|
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;
|
||||||
|
@ -281,10 +285,6 @@ export class Zulip implements INodeType {
|
||||||
|
|
||||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||||
|
|
||||||
if (additionalFields.subscriptions) {
|
|
||||||
//@ts-ignore
|
|
||||||
body.subscriptions = JSON.stringify(additionalFields.subscriptions.properties);
|
|
||||||
}
|
|
||||||
if (additionalFields.inviteOnly) {
|
if (additionalFields.inviteOnly) {
|
||||||
body.invite_only = additionalFields.inviteOnly as boolean;
|
body.invite_only = additionalFields.inviteOnly as boolean;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue