mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor: Format nodes-base package (A-F) (#3800)
* 🔨 prettier formated nodes - A * 🔨 prettier formated nodes - B * ⚡ prettier formated nodes - C * ⚡ prettier formated nodes - D * ⚡ prettier formated nodes - E-F * 🎨 Adjust nodes-base formatting command (#3805) * Format additional files in nodes A-F (#3811) * ⚡ fixes * 🎨 Add Mindee to ignored dirs Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import {
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const categoryOperations: INodeProperties[] = [
|
||||
{
|
||||
@@ -12,9 +10,7 @@ export const categoryOperations: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'category',
|
||||
],
|
||||
resource: ['category'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -52,12 +48,8 @@ export const categoryFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'category',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: ['category'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -70,12 +62,8 @@ export const categoryFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'category',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: ['category'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
default: '0000FF',
|
||||
@@ -88,12 +76,8 @@ export const categoryFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'category',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: ['category'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
default: '0000FF',
|
||||
@@ -109,12 +93,8 @@ export const categoryFields: INodeProperties[] = [
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'category',
|
||||
],
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
resource: ['category'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
@@ -126,15 +106,9 @@ export const categoryFields: INodeProperties[] = [
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'category',
|
||||
],
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
returnAll: [
|
||||
false,
|
||||
],
|
||||
resource: ['category'],
|
||||
operation: ['getAll'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
@@ -155,12 +129,8 @@ export const categoryFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'category',
|
||||
],
|
||||
operation: [
|
||||
'update',
|
||||
],
|
||||
resource: ['category'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -173,12 +143,8 @@ export const categoryFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'category',
|
||||
],
|
||||
operation: [
|
||||
'update',
|
||||
],
|
||||
resource: ['category'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -192,12 +158,8 @@ export const categoryFields: INodeProperties[] = [
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'category',
|
||||
],
|
||||
operation: [
|
||||
'update',
|
||||
],
|
||||
resource: ['category'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
ICredentialsDecrypted,
|
||||
@@ -15,39 +13,22 @@ import {
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
discourseApiRequest,
|
||||
} from './GenericFunctions';
|
||||
import { discourseApiRequest } from './GenericFunctions';
|
||||
|
||||
import {
|
||||
postFields,
|
||||
postOperations,
|
||||
} from './PostDescription';
|
||||
import { postFields, postOperations } from './PostDescription';
|
||||
|
||||
import {
|
||||
categoryFields,
|
||||
categoryOperations,
|
||||
} from './CategoryDescription';
|
||||
import { categoryFields, categoryOperations } from './CategoryDescription';
|
||||
|
||||
import {
|
||||
groupFields,
|
||||
groupOperations,
|
||||
} from './GroupDescription';
|
||||
import { groupFields, groupOperations } from './GroupDescription';
|
||||
|
||||
// import {
|
||||
// searchFields,
|
||||
// searchOperations,
|
||||
// } from './SearchDescription';
|
||||
|
||||
import {
|
||||
userFields,
|
||||
userOperations,
|
||||
} from './UserDescription';
|
||||
import { userFields, userOperations } from './UserDescription';
|
||||
|
||||
import {
|
||||
userGroupFields,
|
||||
userGroupOperations,
|
||||
} from './UserGroupDescription';
|
||||
import { userGroupFields, userGroupOperations } from './UserGroupDescription';
|
||||
import { OptionsWithUri } from 'request';
|
||||
|
||||
//import moment from 'moment';
|
||||
@@ -122,19 +103,12 @@ export class Discourse implements INodeType {
|
||||
};
|
||||
|
||||
methods = {
|
||||
|
||||
loadOptions: {
|
||||
// Get all the calendars to display them to user so that he can
|
||||
// select them easily
|
||||
async getCategories(
|
||||
this: ILoadOptionsFunctions,
|
||||
): Promise<INodePropertyOptions[]> {
|
||||
async getCategories(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const { category_list } = await discourseApiRequest.call(
|
||||
this,
|
||||
'GET',
|
||||
`/categories.json`,
|
||||
);
|
||||
const { category_list } = await discourseApiRequest.call(this, 'GET', `/categories.json`);
|
||||
for (const category of category_list.categories) {
|
||||
returnData.push({
|
||||
name: category.name,
|
||||
@@ -169,12 +143,7 @@ export class Discourse implements INodeType {
|
||||
text_color: textColor,
|
||||
};
|
||||
|
||||
responseData = await discourseApiRequest.call(
|
||||
this,
|
||||
'POST',
|
||||
`/categories.json`,
|
||||
body,
|
||||
);
|
||||
responseData = await discourseApiRequest.call(this, 'POST', `/categories.json`, body);
|
||||
|
||||
responseData = responseData.category;
|
||||
}
|
||||
@@ -182,13 +151,7 @@ export class Discourse implements INodeType {
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||
|
||||
responseData = await discourseApiRequest.call(
|
||||
this,
|
||||
'GET',
|
||||
`/categories.json`,
|
||||
{},
|
||||
qs,
|
||||
);
|
||||
responseData = await discourseApiRequest.call(this, 'GET', `/categories.json`, {}, qs);
|
||||
|
||||
responseData = responseData.category_list.categories;
|
||||
|
||||
@@ -230,12 +193,9 @@ export class Discourse implements INodeType {
|
||||
name,
|
||||
};
|
||||
|
||||
responseData = await discourseApiRequest.call(
|
||||
this,
|
||||
'POST',
|
||||
`/admin/groups.json`,
|
||||
{ group: body },
|
||||
);
|
||||
responseData = await discourseApiRequest.call(this, 'POST', `/admin/groups.json`, {
|
||||
group: body,
|
||||
});
|
||||
|
||||
responseData = responseData.basic_group;
|
||||
}
|
||||
@@ -243,28 +203,15 @@ export class Discourse implements INodeType {
|
||||
if (operation === 'get') {
|
||||
const name = this.getNodeParameter('name', i) as string;
|
||||
|
||||
responseData = await discourseApiRequest.call(
|
||||
this,
|
||||
'GET',
|
||||
`/groups/${name}`,
|
||||
{},
|
||||
qs,
|
||||
);
|
||||
responseData = await discourseApiRequest.call(this, 'GET', `/groups/${name}`, {}, qs);
|
||||
|
||||
responseData = responseData.group;
|
||||
|
||||
}
|
||||
//https://docs.discourse.org/#tag/Groups/paths/~1groups.json/get
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||
|
||||
responseData = await discourseApiRequest.call(
|
||||
this,
|
||||
'GET',
|
||||
`/groups.json`,
|
||||
{},
|
||||
qs,
|
||||
);
|
||||
responseData = await discourseApiRequest.call(this, 'GET', `/groups.json`, {}, qs);
|
||||
|
||||
responseData = responseData.groups;
|
||||
|
||||
@@ -283,12 +230,9 @@ export class Discourse implements INodeType {
|
||||
name,
|
||||
};
|
||||
|
||||
responseData = await discourseApiRequest.call(
|
||||
this,
|
||||
'PUT',
|
||||
`/groups/${groupId}.json`,
|
||||
{ group: body },
|
||||
);
|
||||
responseData = await discourseApiRequest.call(this, 'PUT', `/groups/${groupId}.json`, {
|
||||
group: body,
|
||||
});
|
||||
}
|
||||
}
|
||||
if (resource === 'post') {
|
||||
@@ -305,37 +249,20 @@ export class Discourse implements INodeType {
|
||||
|
||||
Object.assign(body, additionalFields);
|
||||
|
||||
responseData = await discourseApiRequest.call(
|
||||
this,
|
||||
'POST',
|
||||
`/posts.json`,
|
||||
body,
|
||||
);
|
||||
responseData = await discourseApiRequest.call(this, 'POST', `/posts.json`, body);
|
||||
}
|
||||
//https://docs.discourse.org/#tag/Posts/paths/~1posts~1{id}.json/get
|
||||
if (operation === 'get') {
|
||||
const postId = this.getNodeParameter('postId', i) as string;
|
||||
|
||||
responseData = await discourseApiRequest.call(
|
||||
this,
|
||||
'GET',
|
||||
`/posts/${postId}`,
|
||||
{},
|
||||
qs,
|
||||
);
|
||||
responseData = await discourseApiRequest.call(this, 'GET', `/posts/${postId}`, {}, qs);
|
||||
}
|
||||
//https://docs.discourse.org/#tag/Posts/paths/~1posts.json/get
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||
const limit = this.getNodeParameter('limit', i, 0) as number;
|
||||
|
||||
responseData = await discourseApiRequest.call(
|
||||
this,
|
||||
'GET',
|
||||
`/posts.json`,
|
||||
{},
|
||||
qs,
|
||||
);
|
||||
responseData = await discourseApiRequest.call(this, 'GET', `/posts.json`, {}, qs);
|
||||
responseData = responseData.latest_posts;
|
||||
|
||||
//Getting all posts relying on https://github.com/discourse/discourse_api/blob/main/spec/discourse_api/api/posts_spec.rb
|
||||
@@ -437,12 +364,7 @@ export class Discourse implements INodeType {
|
||||
|
||||
Object.assign(body, additionalFields);
|
||||
|
||||
responseData = await discourseApiRequest.call(
|
||||
this,
|
||||
'POST',
|
||||
`/users.json`,
|
||||
body,
|
||||
);
|
||||
responseData = await discourseApiRequest.call(this, 'POST', `/users.json`, body);
|
||||
}
|
||||
//https://docs.discourse.org/#tag/Users/paths/~1users~1{username}.json/get
|
||||
if (operation === 'get') {
|
||||
@@ -456,11 +378,7 @@ export class Discourse implements INodeType {
|
||||
endpoint = `/u/by-external/${externalId}.json`;
|
||||
}
|
||||
|
||||
responseData = await discourseApiRequest.call(
|
||||
this,
|
||||
'GET',
|
||||
endpoint,
|
||||
);
|
||||
responseData = await discourseApiRequest.call(this, 'GET', endpoint);
|
||||
}
|
||||
//https://docs.discourse.org/#tag/Users/paths/~1admin~1users~1{id}.json/delete
|
||||
if (operation === 'getAll') {
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import {
|
||||
OptionsWithUri,
|
||||
} from 'request';
|
||||
import { OptionsWithUri } from 'request';
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject, JsonObject, NodeApiError,
|
||||
} from 'n8n-workflow';
|
||||
import { IDataObject, JsonObject, NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function discourseApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, path: string, body: any = {}, qs: IDataObject = {}, option = {}): Promise<any> { // tslint:disable-line:no-any
|
||||
|
||||
const credentials = await this.getCredentials('discourseApi') as { url: string };
|
||||
export async function discourseApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
path: string,
|
||||
// tslint:disable-next-line:no-any
|
||||
body: any = {},
|
||||
qs: IDataObject = {},
|
||||
option = {},
|
||||
// tslint:disable-next-line:no-any
|
||||
): Promise<any> {
|
||||
const credentials = (await this.getCredentials('discourseApi')) as { url: string };
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
method,
|
||||
@@ -34,8 +34,15 @@ export async function discourseApiRequest(this: IExecuteFunctions | IExecuteSing
|
||||
}
|
||||
}
|
||||
|
||||
export async function discourseApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, method: string, endpoint: string, body: any = {}, query: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
||||
|
||||
export async function discourseApiRequestAllItems(
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
endpoint: string,
|
||||
// tslint:disable-next-line:no-any
|
||||
body: any = {},
|
||||
query: IDataObject = {},
|
||||
// tslint:disable-next-line:no-any
|
||||
): Promise<any> {
|
||||
const returnData: IDataObject[] = [];
|
||||
|
||||
let responseData;
|
||||
@@ -44,8 +51,6 @@ export async function discourseApiRequestAllItems(this: IExecuteFunctions | ILoa
|
||||
responseData = await discourseApiRequest.call(this, method, endpoint, body, query);
|
||||
returnData.push.apply(returnData, responseData);
|
||||
query.page++;
|
||||
} while (
|
||||
responseData.length !== 0
|
||||
);
|
||||
} while (responseData.length !== 0);
|
||||
return returnData;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import {
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const groupOperations: INodeProperties[] = [
|
||||
{
|
||||
@@ -12,9 +10,7 @@ export const groupOperations: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'group',
|
||||
],
|
||||
resource: ['group'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -58,13 +54,8 @@ export const groupFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'group',
|
||||
],
|
||||
operation: [
|
||||
'get',
|
||||
'create',
|
||||
],
|
||||
resource: ['group'],
|
||||
operation: ['get', 'create'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -80,12 +71,8 @@ export const groupFields: INodeProperties[] = [
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'group',
|
||||
],
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
resource: ['group'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
@@ -97,15 +84,9 @@ export const groupFields: INodeProperties[] = [
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'group',
|
||||
],
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
returnAll: [
|
||||
false,
|
||||
],
|
||||
resource: ['group'],
|
||||
operation: ['getAll'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
@@ -126,12 +107,8 @@ export const groupFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'group',
|
||||
],
|
||||
operation: [
|
||||
'update',
|
||||
],
|
||||
resource: ['group'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -144,12 +121,8 @@ export const groupFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'group',
|
||||
],
|
||||
operation: [
|
||||
'update',
|
||||
],
|
||||
resource: ['group'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import {
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const postOperations: INodeProperties[] = [
|
||||
{
|
||||
@@ -12,9 +10,7 @@ export const postOperations: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'post',
|
||||
],
|
||||
resource: ['post'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -57,12 +53,8 @@ export const postFields: INodeProperties[] = [
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'post',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: ['post'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -78,12 +70,8 @@ export const postFields: INodeProperties[] = [
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'post',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: ['post'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -96,12 +84,8 @@ export const postFields: INodeProperties[] = [
|
||||
placeholder: 'Add Field',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: [
|
||||
'post',
|
||||
],
|
||||
operation: ['create'],
|
||||
resource: ['post'],
|
||||
},
|
||||
},
|
||||
default: {},
|
||||
@@ -114,7 +98,8 @@ export const postFields: INodeProperties[] = [
|
||||
loadOptionsMethod: 'getCategories',
|
||||
},
|
||||
default: '',
|
||||
description: 'ID of the category. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
description:
|
||||
'ID of the category. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Reply To Post Number',
|
||||
@@ -143,12 +128,8 @@ export const postFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'post',
|
||||
],
|
||||
operation: [
|
||||
'get',
|
||||
],
|
||||
resource: ['post'],
|
||||
operation: ['get'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -164,12 +145,8 @@ export const postFields: INodeProperties[] = [
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'post',
|
||||
],
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
resource: ['post'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
@@ -181,15 +158,9 @@ export const postFields: INodeProperties[] = [
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'post',
|
||||
],
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
returnAll: [
|
||||
false,
|
||||
],
|
||||
resource: ['post'],
|
||||
operation: ['getAll'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
@@ -209,12 +180,8 @@ export const postFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'post',
|
||||
],
|
||||
operation: [
|
||||
'update',
|
||||
],
|
||||
resource: ['post'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -230,12 +197,8 @@ export const postFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'post',
|
||||
],
|
||||
operation: [
|
||||
'update',
|
||||
],
|
||||
resource: ['post'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -249,12 +212,8 @@ export const postFields: INodeProperties[] = [
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'post',
|
||||
],
|
||||
operation: [
|
||||
'update',
|
||||
],
|
||||
resource: ['post'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import {
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const searchOperations: INodeProperties[] = [
|
||||
{
|
||||
@@ -12,9 +10,7 @@ export const searchOperations: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'search',
|
||||
],
|
||||
resource: ['search'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -40,12 +36,8 @@ export const searchFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'search',
|
||||
],
|
||||
operation: [
|
||||
'query',
|
||||
],
|
||||
resource: ['search'],
|
||||
operation: ['query'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -57,12 +49,8 @@ export const searchFields: INodeProperties[] = [
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'search',
|
||||
],
|
||||
operation: [
|
||||
'query',
|
||||
],
|
||||
resource: ['search'],
|
||||
operation: ['query'],
|
||||
},
|
||||
},
|
||||
default: true,
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import {
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const userOperations: INodeProperties[] = [
|
||||
{
|
||||
@@ -12,9 +10,7 @@ export const userOperations: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'user',
|
||||
],
|
||||
resource: ['user'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -52,12 +48,8 @@ export const userFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'user',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: ['user'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -71,12 +63,8 @@ export const userFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'user',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: ['user'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -89,12 +77,8 @@ export const userFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'user',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: ['user'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -110,12 +94,8 @@ export const userFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'user',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: ['user'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -129,12 +109,8 @@ export const userFields: INodeProperties[] = [
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'user',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: ['user'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -173,12 +149,8 @@ export const userFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'user',
|
||||
],
|
||||
operation: [
|
||||
'get',
|
||||
],
|
||||
resource: ['user'],
|
||||
operation: ['get'],
|
||||
},
|
||||
},
|
||||
default: 'username',
|
||||
@@ -191,15 +163,9 @@ export const userFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'user',
|
||||
],
|
||||
operation: [
|
||||
'get',
|
||||
],
|
||||
by: [
|
||||
'username',
|
||||
],
|
||||
resource: ['user'],
|
||||
operation: ['get'],
|
||||
by: ['username'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -212,15 +178,9 @@ export const userFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'user',
|
||||
],
|
||||
operation: [
|
||||
'get',
|
||||
],
|
||||
by: [
|
||||
'externalId',
|
||||
],
|
||||
resource: ['user'],
|
||||
operation: ['get'],
|
||||
by: ['externalId'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -258,12 +218,8 @@ export const userFields: INodeProperties[] = [
|
||||
],
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'user',
|
||||
],
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
resource: ['user'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -275,12 +231,8 @@ export const userFields: INodeProperties[] = [
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'user',
|
||||
],
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
resource: ['user'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
@@ -292,15 +244,9 @@ export const userFields: INodeProperties[] = [
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'user',
|
||||
],
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
returnAll: [
|
||||
false,
|
||||
],
|
||||
resource: ['user'],
|
||||
operation: ['getAll'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import {
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const userGroupOperations: INodeProperties[] = [
|
||||
{
|
||||
@@ -12,9 +10,7 @@ export const userGroupOperations: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'userGroup',
|
||||
],
|
||||
resource: ['userGroup'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -46,12 +42,8 @@ export const userGroupFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'userGroup',
|
||||
],
|
||||
operation: [
|
||||
'add',
|
||||
],
|
||||
resource: ['userGroup'],
|
||||
operation: ['add'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -64,12 +56,8 @@ export const userGroupFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'userGroup',
|
||||
],
|
||||
operation: [
|
||||
'add',
|
||||
],
|
||||
resource: ['userGroup'],
|
||||
operation: ['add'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -86,12 +74,8 @@ export const userGroupFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'userGroup',
|
||||
],
|
||||
operation: [
|
||||
'remove',
|
||||
],
|
||||
resource: ['userGroup'],
|
||||
operation: ['remove'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -104,16 +88,11 @@ export const userGroupFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'userGroup',
|
||||
],
|
||||
operation: [
|
||||
'remove',
|
||||
],
|
||||
resource: ['userGroup'],
|
||||
operation: ['remove'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'ID of the group to remove',
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user