mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
n8n-3867-progressively-apply-prettier-to-all (#3873)
* 🔨 formatting nodes with prettier
This commit is contained in:
@@ -1,12 +1,6 @@
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
IHookFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
OptionsWithUri,
|
||||
} from 'request';
|
||||
import { OptionsWithUri } from 'request';
|
||||
|
||||
import {
|
||||
IBinaryKeyData,
|
||||
@@ -17,7 +11,6 @@ import {
|
||||
NodeOperationError,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
|
||||
interface IAttachment {
|
||||
url: string;
|
||||
title: string;
|
||||
@@ -34,7 +27,16 @@ interface IAttachment {
|
||||
* @param {object} body
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
export async function apiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions, method: string, endpoint: string, body: object, query?: IDataObject, uri?: string, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
||||
export async function apiRequest(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions,
|
||||
method: string,
|
||||
endpoint: string,
|
||||
body: object,
|
||||
query?: IDataObject,
|
||||
uri?: string,
|
||||
option: IDataObject = {},
|
||||
// tslint:disable-next-line:no-any
|
||||
): Promise<any> {
|
||||
const authenticationMethod = this.getNodeParameter('authentication', 0) as string;
|
||||
const credentials = await this.getCredentials(authenticationMethod);
|
||||
|
||||
@@ -50,9 +52,9 @@ export async function apiRequest(this: IHookFunctions | IExecuteFunctions | ILoa
|
||||
method,
|
||||
body,
|
||||
qs: query,
|
||||
uri: uri || baseUrl.endsWith('/') ? `${baseUrl.slice(0, -1)}${endpoint}` : `${baseUrl}${endpoint}`,
|
||||
uri:
|
||||
uri || baseUrl.endsWith('/') ? `${baseUrl.slice(0, -1)}${endpoint}` : `${baseUrl}${endpoint}`,
|
||||
json: true,
|
||||
|
||||
};
|
||||
|
||||
if (Object.keys(option).length !== 0) {
|
||||
@@ -70,7 +72,6 @@ export async function apiRequest(this: IHookFunctions | IExecuteFunctions | ILoa
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make an API request to paginated NocoDB endpoint
|
||||
* and return all results
|
||||
@@ -83,14 +84,21 @@ export async function apiRequest(this: IHookFunctions | IExecuteFunctions | ILoa
|
||||
* @param {IDataObject} [query]
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
export async function apiRequestAllItems(this: IHookFunctions | IExecuteFunctions | IPollFunctions, method: string, endpoint: string, body: IDataObject, query?: IDataObject): Promise<any> { // tslint:disable-line:no-any
|
||||
export async function apiRequestAllItems(
|
||||
this: IHookFunctions | IExecuteFunctions | IPollFunctions,
|
||||
method: string,
|
||||
endpoint: string,
|
||||
body: IDataObject,
|
||||
query?: IDataObject,
|
||||
// tslint:disable-next-line:no-any
|
||||
): Promise<any> {
|
||||
const version = this.getNode().typeVersion as number;
|
||||
|
||||
if (query === undefined) {
|
||||
query = {};
|
||||
}
|
||||
query.limit = 100;
|
||||
query.offset = query?.offset ? query.offset as number : 0;
|
||||
query.offset = query?.offset ? (query.offset as number) : 0;
|
||||
const returnData: IDataObject[] = [];
|
||||
|
||||
let responseData;
|
||||
@@ -100,15 +108,16 @@ export async function apiRequestAllItems(this: IHookFunctions | IExecuteFunction
|
||||
version === 1 ? returnData.push(...responseData) : returnData.push(...responseData.list);
|
||||
|
||||
query.offset += query.limit;
|
||||
|
||||
} while (
|
||||
version === 1 ? responseData.length !== 0 : responseData.pageInfo.isLastPage !== true
|
||||
);
|
||||
} while (version === 1 ? responseData.length !== 0 : responseData.pageInfo.isLastPage !== true);
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
||||
export async function downloadRecordAttachments(this: IExecuteFunctions | IPollFunctions, records: IDataObject[], fieldNames: string[]): Promise<INodeExecutionData[]> {
|
||||
export async function downloadRecordAttachments(
|
||||
this: IExecuteFunctions | IPollFunctions,
|
||||
records: IDataObject[],
|
||||
fieldNames: string[],
|
||||
): Promise<INodeExecutionData[]> {
|
||||
const elements: INodeExecutionData[] = [];
|
||||
|
||||
for (const record of records) {
|
||||
@@ -116,9 +125,18 @@ export async function downloadRecordAttachments(this: IExecuteFunctions | IPollF
|
||||
element.json = record as unknown as IDataObject;
|
||||
for (const fieldName of fieldNames) {
|
||||
if (record[fieldName]) {
|
||||
for (const [index, attachment] of (JSON.parse(record[fieldName] as string) as IAttachment[]).entries()) {
|
||||
const file = await apiRequest.call(this, 'GET', '', {}, {}, attachment.url, { json: false, encoding: null });
|
||||
element.binary![`${fieldName}_${index}`] = await this.helpers.prepareBinaryData(Buffer.from(file), attachment.title, attachment.mimetype);
|
||||
for (const [index, attachment] of (
|
||||
JSON.parse(record[fieldName] as string) as IAttachment[]
|
||||
).entries()) {
|
||||
const file = await apiRequest.call(this, 'GET', '', {}, {}, attachment.url, {
|
||||
json: false,
|
||||
encoding: null,
|
||||
});
|
||||
element.binary![`${fieldName}_${index}`] = await this.helpers.prepareBinaryData(
|
||||
Buffer.from(file),
|
||||
attachment.title,
|
||||
attachment.mimetype,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
IBinaryData,
|
||||
@@ -14,15 +12,9 @@ import {
|
||||
NodeOperationError,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
apiRequest,
|
||||
apiRequestAllItems,
|
||||
downloadRecordAttachments,
|
||||
} from './GenericFunctions';
|
||||
import { apiRequest, apiRequestAllItems, downloadRecordAttachments } from './GenericFunctions';
|
||||
|
||||
import {
|
||||
operationFields
|
||||
} from './OperationDescription';
|
||||
import { operationFields } from './OperationDescription';
|
||||
|
||||
export class NocoDB implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
@@ -44,9 +36,7 @@ export class NocoDB implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
authentication: [
|
||||
'nocoDb',
|
||||
],
|
||||
authentication: ['nocoDb'],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -55,9 +45,7 @@ export class NocoDB implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
authentication: [
|
||||
'nocoDbApiToken',
|
||||
],
|
||||
authentication: ['nocoDbApiToken'],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -85,9 +73,7 @@ export class NocoDB implements INodeType {
|
||||
type: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'@version': [
|
||||
1,
|
||||
],
|
||||
'@version': [1],
|
||||
},
|
||||
},
|
||||
isNodeSetting: true,
|
||||
@@ -109,9 +95,7 @@ export class NocoDB implements INodeType {
|
||||
type: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'@version': [
|
||||
2,
|
||||
],
|
||||
'@version': [2],
|
||||
},
|
||||
},
|
||||
isNodeSetting: true,
|
||||
@@ -147,9 +131,7 @@ export class NocoDB implements INodeType {
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'row',
|
||||
],
|
||||
resource: ['row'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -201,7 +183,6 @@ export class NocoDB implements INodeType {
|
||||
} catch (e) {
|
||||
throw new NodeOperationError(this.getNode(), `Error while fetching projects! (${e})`);
|
||||
}
|
||||
|
||||
},
|
||||
// This only supports using the Project ID
|
||||
async getTables(this: ILoadOptionsFunctions) {
|
||||
@@ -248,19 +229,21 @@ export class NocoDB implements INodeType {
|
||||
if (version === 1) {
|
||||
endPoint = `/nc/${projectId}/api/v1/${table}/bulk`;
|
||||
} else if (version === 2) {
|
||||
endPoint = `/api/v1/db/data/bulk/noco/${projectId}/${table}`;
|
||||
endPoint = `/api/v1/db/data/bulk/noco/${projectId}/${table}`;
|
||||
}
|
||||
|
||||
const body: IDataObject[] = [];
|
||||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
const newItem: IDataObject = {};
|
||||
const dataToSend = this.getNodeParameter('dataToSend', i) as 'defineBelow' | 'autoMapInputData';
|
||||
const dataToSend = this.getNodeParameter('dataToSend', i) as
|
||||
| 'defineBelow'
|
||||
| 'autoMapInputData';
|
||||
|
||||
if (dataToSend === 'autoMapInputData') {
|
||||
const incomingKeys = Object.keys(items[i].json);
|
||||
const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i) as string;
|
||||
const inputDataToIgnore = rawInputsToIgnore.split(',').map(c => c.trim());
|
||||
const inputDataToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim());
|
||||
for (const key of incomingKeys) {
|
||||
if (inputDataToIgnore.includes(key)) continue;
|
||||
newItem[key] = items[i].json[key];
|
||||
@@ -278,11 +261,17 @@ export class NocoDB implements INodeType {
|
||||
newItem[field.fieldName] = field.fieldValue;
|
||||
} else if (field.binaryProperty) {
|
||||
if (!items[i].binary) {
|
||||
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { itemIndex: i });
|
||||
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', {
|
||||
itemIndex: i,
|
||||
});
|
||||
}
|
||||
const binaryPropertyName = field.binaryProperty;
|
||||
if (binaryPropertyName && !items[i].binary![binaryPropertyName]) {
|
||||
throw new NodeOperationError(this.getNode(), `Binary property ${binaryPropertyName} does not exist on item!`, { itemIndex: i });
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
`Binary property ${binaryPropertyName} does not exist on item!`,
|
||||
{ itemIndex: i },
|
||||
);
|
||||
}
|
||||
const binaryData = items[i].binary![binaryPropertyName] as IBinaryData;
|
||||
const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
||||
@@ -311,7 +300,9 @@ export class NocoDB implements INodeType {
|
||||
postUrl = '/api/v1/db/storage/upload';
|
||||
}
|
||||
|
||||
responseData = await apiRequest.call(this, 'POST', postUrl, {}, qs, undefined, { formData });
|
||||
responseData = await apiRequest.call(this, 'POST', postUrl, {}, qs, undefined, {
|
||||
formData,
|
||||
});
|
||||
newItem[field.fieldName] = JSON.stringify([responseData]);
|
||||
}
|
||||
}
|
||||
@@ -354,21 +345,26 @@ export class NocoDB implements INodeType {
|
||||
try {
|
||||
responseData = await apiRequest.call(this, requestMethod, endPoint, body, qs);
|
||||
if (version === 1) {
|
||||
returnData.push(...items.map(item => item.json));
|
||||
} else if (version === 2 ) {
|
||||
|
||||
returnData.push(...responseData.map((result: number, index: number) => {
|
||||
if (result === 0) {
|
||||
const errorMessage = `The row with the ID "${body[index].id}" could not be deleted. It probably doesn't exist.`;
|
||||
if (this.continueOnFail()) {
|
||||
return { error: errorMessage };
|
||||
returnData.push(...items.map((item) => item.json));
|
||||
} else if (version === 2) {
|
||||
returnData.push(
|
||||
...responseData.map((result: number, index: number) => {
|
||||
if (result === 0) {
|
||||
const errorMessage = `The row with the ID "${body[index].id}" could not be deleted. It probably doesn't exist.`;
|
||||
if (this.continueOnFail()) {
|
||||
return { error: errorMessage };
|
||||
}
|
||||
throw new NodeApiError(
|
||||
this.getNode(),
|
||||
{ message: errorMessage },
|
||||
{ message: errorMessage, itemIndex: index },
|
||||
);
|
||||
}
|
||||
throw new NodeApiError(this.getNode(), { message: errorMessage }, { message: errorMessage, itemIndex: index });
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
};
|
||||
}));
|
||||
return {
|
||||
success: true,
|
||||
};
|
||||
}),
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
@@ -387,7 +383,7 @@ export class NocoDB implements INodeType {
|
||||
|
||||
if (version === 1) {
|
||||
endPoint = `/nc/${projectId}/api/v1/${table}`;
|
||||
} else if (version === 2 ) {
|
||||
} else if (version === 2) {
|
||||
endPoint = `/api/v1/db/data/noco/${projectId}/${table}`;
|
||||
}
|
||||
|
||||
@@ -395,8 +391,13 @@ export class NocoDB implements INodeType {
|
||||
qs = this.getNodeParameter('options', i, {}) as IDataObject;
|
||||
|
||||
if (qs.sort) {
|
||||
const properties = (qs.sort as IDataObject).property as Array<{ field: string, direction: string }>;
|
||||
qs.sort = properties.map(prop => `${prop.direction === 'asc' ? '' : '-'}${prop.field}`).join(',');
|
||||
const properties = (qs.sort as IDataObject).property as Array<{
|
||||
field: string;
|
||||
direction: string;
|
||||
}>;
|
||||
qs.sort = properties
|
||||
.map((prop) => `${prop.direction === 'asc' ? '' : '-'}${prop.field}`)
|
||||
.join(',');
|
||||
}
|
||||
|
||||
if (qs.fields) {
|
||||
@@ -416,8 +417,14 @@ export class NocoDB implements INodeType {
|
||||
returnData.push.apply(returnData, responseData);
|
||||
|
||||
if (downloadAttachments === true) {
|
||||
const downloadFieldNames = (this.getNodeParameter('downloadFieldNames', 0) as string).split(',');
|
||||
const response = await downloadRecordAttachments.call(this, responseData, downloadFieldNames);
|
||||
const downloadFieldNames = (
|
||||
this.getNodeParameter('downloadFieldNames', 0) as string
|
||||
).split(',');
|
||||
const response = await downloadRecordAttachments.call(
|
||||
this,
|
||||
responseData,
|
||||
downloadFieldNames,
|
||||
);
|
||||
data.push(...response);
|
||||
}
|
||||
}
|
||||
@@ -425,8 +432,7 @@ export class NocoDB implements INodeType {
|
||||
if (downloadAttachments) {
|
||||
return [data];
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
returnData.push({ error: error.toString() });
|
||||
}
|
||||
@@ -444,7 +450,7 @@ export class NocoDB implements INodeType {
|
||||
|
||||
if (version === 1) {
|
||||
endPoint = `/nc/${projectId}/api/v1/${table}/${id}`;
|
||||
} else if (version === 2) {
|
||||
} else if (version === 2) {
|
||||
endPoint = `/api/v1/db/data/noco/${projectId}/${table}/${id}`;
|
||||
}
|
||||
|
||||
@@ -454,7 +460,7 @@ export class NocoDB implements INodeType {
|
||||
|
||||
if (version === 1) {
|
||||
newItem = { json: responseData };
|
||||
} else if (version === 2 ) {
|
||||
} else if (version === 2) {
|
||||
if (Object.keys(responseData).length === 0) {
|
||||
// Get did fail
|
||||
const errorMessage = `The row with the ID "${id}" could not be queried. It probably doesn't exist.`;
|
||||
@@ -463,7 +469,11 @@ export class NocoDB implements INodeType {
|
||||
json: { error: errorMessage },
|
||||
};
|
||||
}
|
||||
throw new NodeApiError(this.getNode(), { message: errorMessage }, { message: errorMessage, itemIndex: i });
|
||||
throw new NodeApiError(
|
||||
this.getNode(),
|
||||
{ message: errorMessage },
|
||||
{ message: errorMessage, itemIndex: i },
|
||||
);
|
||||
} else {
|
||||
// Get did work
|
||||
newItem = { json: responseData };
|
||||
@@ -474,8 +484,14 @@ export class NocoDB implements INodeType {
|
||||
const downloadAttachments = this.getNodeParameter('downloadAttachments', i) as boolean;
|
||||
|
||||
if (downloadAttachments === true) {
|
||||
const downloadFieldNames = (this.getNodeParameter('downloadFieldNames', i) as string).split(',');
|
||||
const data = await downloadRecordAttachments.call(this, [responseData], downloadFieldNames);
|
||||
const downloadFieldNames = (
|
||||
this.getNodeParameter('downloadFieldNames', i) as string
|
||||
).split(',');
|
||||
const data = await downloadRecordAttachments.call(
|
||||
this,
|
||||
[responseData],
|
||||
downloadFieldNames,
|
||||
);
|
||||
newItem.binary = data[0].binary;
|
||||
}
|
||||
|
||||
@@ -492,7 +508,6 @@ export class NocoDB implements INodeType {
|
||||
}
|
||||
|
||||
if (operation === 'update') {
|
||||
|
||||
let requestMethod = 'PATCH';
|
||||
|
||||
if (version === 1) {
|
||||
@@ -504,15 +519,16 @@ export class NocoDB implements INodeType {
|
||||
const body: IDataObject[] = [];
|
||||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
|
||||
const id = this.getNodeParameter('id', i) as string;
|
||||
const newItem: IDataObject = { id };
|
||||
const dataToSend = this.getNodeParameter('dataToSend', i) as 'defineBelow' | 'autoMapInputData';
|
||||
const dataToSend = this.getNodeParameter('dataToSend', i) as
|
||||
| 'defineBelow'
|
||||
| 'autoMapInputData';
|
||||
|
||||
if (dataToSend === 'autoMapInputData') {
|
||||
const incomingKeys = Object.keys(items[i].json);
|
||||
const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i) as string;
|
||||
const inputDataToIgnore = rawInputsToIgnore.split(',').map(c => c.trim());
|
||||
const inputDataToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim());
|
||||
for (const key of incomingKeys) {
|
||||
if (inputDataToIgnore.includes(key)) continue;
|
||||
newItem[key] = items[i].json[key];
|
||||
@@ -530,11 +546,17 @@ export class NocoDB implements INodeType {
|
||||
newItem[field.fieldName] = field.fieldValue;
|
||||
} else if (field.binaryProperty) {
|
||||
if (!items[i].binary) {
|
||||
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { itemIndex: i });
|
||||
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', {
|
||||
itemIndex: i,
|
||||
});
|
||||
}
|
||||
const binaryPropertyName = field.binaryProperty;
|
||||
if (binaryPropertyName && !items[i].binary![binaryPropertyName]) {
|
||||
throw new NodeOperationError(this.getNode(), `Binary property ${binaryPropertyName} does not exist on item!`, { itemIndex: i });
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
`Binary property ${binaryPropertyName} does not exist on item!`,
|
||||
{ itemIndex: i },
|
||||
);
|
||||
}
|
||||
const binaryData = items[i].binary![binaryPropertyName] as IBinaryData;
|
||||
const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
||||
@@ -561,7 +583,9 @@ export class NocoDB implements INodeType {
|
||||
} else if (version === 2) {
|
||||
postUrl = '/api/v1/db/storage/upload';
|
||||
}
|
||||
responseData = await apiRequest.call(this, 'POST', postUrl, {}, qs, undefined, { formData });
|
||||
responseData = await apiRequest.call(this, 'POST', postUrl, {}, qs, undefined, {
|
||||
formData,
|
||||
});
|
||||
newItem[field.fieldName] = JSON.stringify([responseData]);
|
||||
}
|
||||
}
|
||||
@@ -574,19 +598,25 @@ export class NocoDB implements INodeType {
|
||||
|
||||
if (version === 1) {
|
||||
returnData.push(...body);
|
||||
} else if (version === 2 ) {
|
||||
returnData.push(...responseData.map((result: number, index: number) => {
|
||||
if (result === 0) {
|
||||
const errorMessage = `The row with the ID "${body[index].id}" could not be updated. It probably doesn't exist.`;
|
||||
if (this.continueOnFail()) {
|
||||
return { error: errorMessage };
|
||||
} else if (version === 2) {
|
||||
returnData.push(
|
||||
...responseData.map((result: number, index: number) => {
|
||||
if (result === 0) {
|
||||
const errorMessage = `The row with the ID "${body[index].id}" could not be updated. It probably doesn't exist.`;
|
||||
if (this.continueOnFail()) {
|
||||
return { error: errorMessage };
|
||||
}
|
||||
throw new NodeApiError(
|
||||
this.getNode(),
|
||||
{ message: errorMessage },
|
||||
{ message: errorMessage, itemIndex: index },
|
||||
);
|
||||
}
|
||||
throw new NodeApiError(this.getNode(), { message: errorMessage }, { message: errorMessage, itemIndex: index });
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
};
|
||||
}));
|
||||
return {
|
||||
success: true,
|
||||
};
|
||||
}),
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import {
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const operationFields: INodeProperties[] = [
|
||||
// ----------------------------------
|
||||
@@ -13,9 +11,7 @@ export const operationFields: INodeProperties[] = [
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
version: [
|
||||
1,
|
||||
],
|
||||
version: [1],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
@@ -28,13 +24,12 @@ export const operationFields: INodeProperties[] = [
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
version: [
|
||||
2,
|
||||
],
|
||||
version: [2],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getProjects',
|
||||
},
|
||||
@@ -46,17 +41,14 @@ export const operationFields: INodeProperties[] = [
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
version: [
|
||||
2,
|
||||
],
|
||||
version: [2],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
description: 'The table to operate on. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
description:
|
||||
'The table to operate on. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: [
|
||||
'projectId',
|
||||
],
|
||||
loadOptionsDependsOn: ['projectId'],
|
||||
loadOptionsMethod: 'getTables',
|
||||
},
|
||||
},
|
||||
@@ -67,9 +59,7 @@ export const operationFields: INodeProperties[] = [
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
version: [
|
||||
1,
|
||||
],
|
||||
version: [1],
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
@@ -84,9 +74,7 @@ export const operationFields: INodeProperties[] = [
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'delete',
|
||||
],
|
||||
operation: ['delete'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -102,9 +90,7 @@ export const operationFields: INodeProperties[] = [
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
@@ -116,12 +102,8 @@ export const operationFields: INodeProperties[] = [
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
returnAll: [
|
||||
false,
|
||||
],
|
||||
operation: ['getAll'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
@@ -137,13 +119,11 @@ export const operationFields: INodeProperties[] = [
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether the attachment fields define in \'Download Fields\' will be downloaded',
|
||||
description: "Whether the attachment fields define in 'Download Fields' will be downloaded",
|
||||
},
|
||||
{
|
||||
displayName: 'Download Fields',
|
||||
@@ -152,16 +132,13 @@ export const operationFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
downloadAttachments: [
|
||||
true,
|
||||
],
|
||||
operation: ['getAll'],
|
||||
downloadAttachments: [true],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Name of the fields of type \'attachment\' that should be downloaded. Multiple ones can be defined separated by comma. Case sensitive.',
|
||||
description:
|
||||
"Name of the fields of type 'attachment' that should be downloaded. Multiple ones can be defined separated by comma. Case sensitive.",
|
||||
},
|
||||
{
|
||||
displayName: 'Options',
|
||||
@@ -169,9 +146,7 @@ export const operationFields: INodeProperties[] = [
|
||||
type: 'collection',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
default: {},
|
||||
@@ -242,7 +217,6 @@ export const operationFields: INodeProperties[] = [
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
// ----------------------------------
|
||||
@@ -254,9 +228,7 @@ export const operationFields: INodeProperties[] = [
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'get',
|
||||
],
|
||||
operation: ['get'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -269,13 +241,11 @@ export const operationFields: INodeProperties[] = [
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'get',
|
||||
],
|
||||
operation: ['get'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether the attachment fields define in \'Download Fields\' will be downloaded',
|
||||
description: "Whether the attachment fields define in 'Download Fields' will be downloaded",
|
||||
},
|
||||
{
|
||||
displayName: 'Download Fields',
|
||||
@@ -284,16 +254,13 @@ export const operationFields: INodeProperties[] = [
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'get',
|
||||
],
|
||||
downloadAttachments: [
|
||||
true,
|
||||
],
|
||||
operation: ['get'],
|
||||
downloadAttachments: [true],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Name of the fields of type \'attachment\' that should be downloaded. Multiple ones can be defined separated by comma. Case sensitive.',
|
||||
description:
|
||||
"Name of the fields of type 'attachment' that should be downloaded. Multiple ones can be defined separated by comma. Case sensitive.",
|
||||
},
|
||||
// ----------------------------------
|
||||
// update
|
||||
@@ -304,9 +271,7 @@ export const operationFields: INodeProperties[] = [
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'update',
|
||||
],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -334,10 +299,7 @@ export const operationFields: INodeProperties[] = [
|
||||
],
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'create',
|
||||
'update',
|
||||
],
|
||||
operation: ['create', 'update'],
|
||||
},
|
||||
},
|
||||
default: 'defineBelow',
|
||||
@@ -349,17 +311,13 @@ export const operationFields: INodeProperties[] = [
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'create',
|
||||
'update',
|
||||
],
|
||||
dataToSend: [
|
||||
'autoMapInputData',
|
||||
],
|
||||
operation: ['create', 'update'],
|
||||
dataToSend: ['autoMapInputData'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'List of input properties to avoid sending, separated by commas. Leave empty to send all properties.',
|
||||
description:
|
||||
'List of input properties to avoid sending, separated by commas. Leave empty to send all properties.',
|
||||
placeholder: 'Enter properties...',
|
||||
},
|
||||
{
|
||||
@@ -373,13 +331,8 @@ export const operationFields: INodeProperties[] = [
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'create',
|
||||
'update',
|
||||
],
|
||||
dataToSend: [
|
||||
'defineBelow',
|
||||
],
|
||||
operation: ['create', 'update'],
|
||||
dataToSend: ['defineBelow'],
|
||||
},
|
||||
},
|
||||
default: {},
|
||||
@@ -399,7 +352,8 @@ export const operationFields: INodeProperties[] = [
|
||||
name: 'binaryData',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether the field data to set is binary and should be taken from a binary property',
|
||||
description:
|
||||
'Whether the field data to set is binary and should be taken from a binary property',
|
||||
},
|
||||
{
|
||||
displayName: 'Field Value',
|
||||
@@ -408,9 +362,7 @@ export const operationFields: INodeProperties[] = [
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
binaryData: [
|
||||
false,
|
||||
],
|
||||
binaryData: [false],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -422,9 +374,7 @@ export const operationFields: INodeProperties[] = [
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
binaryData: [
|
||||
true,
|
||||
],
|
||||
binaryData: [true],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user