fix: Expand nodes-base formatting validation (no-changelog) (#4689)

*  Simplify `format` command

* 🎨 Format more deeply nested files
This commit is contained in:
Iván Ovejero 2022-11-22 13:43:28 +01:00 committed by GitHub
parent ad6c6f60a1
commit eafef019d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 8225 additions and 374 deletions

View file

@ -1,6 +1,4 @@
import {
INodeProperties,
} from 'n8n-workflow';
import { INodeProperties } from 'n8n-workflow';
export const listenerCertificateOperations: INodeProperties[] = [
{
@ -10,16 +8,15 @@ export const listenerCertificateOperations: INodeProperties[] = [
noDataExpression: true,
displayOptions: {
show: {
resource: [
'listenerCertificate',
],
resource: ['listenerCertificate'],
},
},
options: [
{
name: 'Add',
value: 'add',
description: 'Add the specified SSL server certificate to the certificate list for the specified HTTPS or TLS listener',
description:
'Add the specified SSL server certificate to the certificate list for the specified HTTPS or TLS listener',
action: 'Add a listener certificate',
},
{
@ -31,7 +28,8 @@ export const listenerCertificateOperations: INodeProperties[] = [
{
name: 'Remove',
value: 'remove',
description: 'Remove the specified certificate from the certificate list for the specified HTTPS or TLS listener',
description:
'Remove the specified certificate from the certificate list for the specified HTTPS or TLS listener',
action: 'Remove a listener certificate',
},
],
@ -40,7 +38,6 @@ export const listenerCertificateOperations: INodeProperties[] = [
];
export const listenerCertificateFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* listenerCertificate:add */
/* -------------------------------------------------------------------------- */
@ -54,16 +51,13 @@ export const listenerCertificateFields: INodeProperties[] = [
required: true,
displayOptions: {
show: {
resource: [
'listenerCertificate',
],
operation: [
'add',
],
resource: ['listenerCertificate'],
operation: ['add'],
},
},
default: '',
description: 'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
description:
'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
{
displayName: 'Listener ARN Name or ID',
@ -72,22 +66,17 @@ export const listenerCertificateFields: INodeProperties[] = [
required: true,
typeOptions: {
loadOptionsMethod: 'getLoadBalancerListeners',
loadOptionsDependsOn: [
'loadBalancerId',
],
loadOptionsDependsOn: ['loadBalancerId'],
},
displayOptions: {
show: {
resource: [
'listenerCertificate',
],
operation: [
'add',
],
resource: ['listenerCertificate'],
operation: ['add'],
},
},
default: '',
description: 'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
description:
'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
{
displayName: 'Certificate ARN',
@ -96,12 +85,8 @@ export const listenerCertificateFields: INodeProperties[] = [
required: true,
displayOptions: {
show: {
resource: [
'listenerCertificate',
],
operation: [
'add',
],
resource: ['listenerCertificate'],
operation: ['add'],
},
},
default: '',
@ -122,16 +107,13 @@ export const listenerCertificateFields: INodeProperties[] = [
required: true,
displayOptions: {
show: {
resource: [
'listenerCertificate',
],
operation: [
'getMany',
],
resource: ['listenerCertificate'],
operation: ['getMany'],
},
},
default: '',
description: 'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
description:
'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
{
displayName: 'Listener ARN Name or ID',
@ -140,22 +122,17 @@ export const listenerCertificateFields: INodeProperties[] = [
required: true,
typeOptions: {
loadOptionsMethod: 'getLoadBalancerListeners',
loadOptionsDependsOn: [
'loadBalancerId',
],
loadOptionsDependsOn: ['loadBalancerId'],
},
displayOptions: {
show: {
resource: [
'listenerCertificate',
],
operation: [
'getMany',
],
resource: ['listenerCertificate'],
operation: ['getMany'],
},
},
default: '',
description: 'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
description:
'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
{
displayName: 'Return All',
@ -163,12 +140,8 @@ export const listenerCertificateFields: INodeProperties[] = [
type: 'boolean',
displayOptions: {
show: {
resource: [
'listenerCertificate',
],
operation: [
'getMany',
],
resource: ['listenerCertificate'],
operation: ['getMany'],
},
},
default: false,
@ -186,15 +159,9 @@ export const listenerCertificateFields: INodeProperties[] = [
},
displayOptions: {
show: {
resource: [
'listenerCertificate',
],
operation: [
'getMany',
],
returnAll: [
false,
],
resource: ['listenerCertificate'],
operation: ['getMany'],
returnAll: [false],
},
},
},
@ -212,16 +179,13 @@ export const listenerCertificateFields: INodeProperties[] = [
required: true,
displayOptions: {
show: {
resource: [
'listenerCertificate',
],
operation: [
'remove',
],
resource: ['listenerCertificate'],
operation: ['remove'],
},
},
default: '',
description: 'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
description:
'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
{
displayName: 'Listener ARN Name or ID',
@ -230,22 +194,17 @@ export const listenerCertificateFields: INodeProperties[] = [
required: true,
typeOptions: {
loadOptionsMethod: 'getLoadBalancerListeners',
loadOptionsDependsOn: [
'loadBalancerId',
],
loadOptionsDependsOn: ['loadBalancerId'],
},
displayOptions: {
show: {
resource: [
'listenerCertificate',
],
operation: [
'remove',
],
resource: ['listenerCertificate'],
operation: ['remove'],
},
},
default: '',
description: 'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
description:
'Unique identifier for a particular loadBalancer. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
{
displayName: 'Certificate ARN',
@ -254,16 +213,11 @@ export const listenerCertificateFields: INodeProperties[] = [
required: true,
displayOptions: {
show: {
resource: [
'listenerCertificate',
],
operation: [
'remove',
],
resource: ['listenerCertificate'],
operation: ['remove'],
},
},
default: '',
description: 'Unique identifier for a particular loadBalancer',
},
];

View file

@ -1,6 +1,4 @@
import {
INodeProperties,
} from 'n8n-workflow';
import { INodeProperties } from 'n8n-workflow';
export const loadBalancerOperations: INodeProperties[] = [
{
@ -10,9 +8,7 @@ export const loadBalancerOperations: INodeProperties[] = [
noDataExpression: true,
displayOptions: {
show: {
resource: [
'loadBalancer',
],
resource: ['loadBalancer'],
},
},
options: [
@ -46,7 +42,6 @@ export const loadBalancerOperations: INodeProperties[] = [
];
export const loadBalancerFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* loadBalancer:create */
/* -------------------------------------------------------------------------- */
@ -57,12 +52,8 @@ export const loadBalancerFields: INodeProperties[] = [
required: true,
displayOptions: {
show: {
resource: [
'loadBalancer',
],
operation: [
'create',
],
resource: ['loadBalancer'],
operation: ['create'],
},
},
options: [
@ -85,16 +76,13 @@ export const loadBalancerFields: INodeProperties[] = [
required: true,
displayOptions: {
show: {
resource: [
'loadBalancer',
],
operation: [
'create',
],
resource: ['loadBalancer'],
operation: ['create'],
},
},
default: '',
description: 'This name must be unique per region per account, can have a maximum of 32 characters',
description:
'This name must be unique per region per account, can have a maximum of 32 characters',
},
{
displayName: 'Schema',
@ -103,12 +91,8 @@ export const loadBalancerFields: INodeProperties[] = [
required: true,
displayOptions: {
show: {
resource: [
'loadBalancer',
],
operation: [
'create',
],
resource: ['loadBalancer'],
operation: ['create'],
},
},
options: [
@ -130,12 +114,8 @@ export const loadBalancerFields: INodeProperties[] = [
required: true,
displayOptions: {
show: {
resource: [
'loadBalancer',
],
operation: [
'create',
],
resource: ['loadBalancer'],
operation: ['create'],
},
},
options: [
@ -154,15 +134,12 @@ export const loadBalancerFields: INodeProperties[] = [
displayName: 'Subnet ID Names or IDs',
name: 'subnets',
type: 'multiOptions',
description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
description:
'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
displayOptions: {
show: {
resource: [
'loadBalancer',
],
operation: [
'create',
],
resource: ['loadBalancer'],
operation: ['create'],
},
},
typeOptions: {
@ -178,12 +155,8 @@ export const loadBalancerFields: INodeProperties[] = [
placeholder: 'Add Field',
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'loadBalancer',
],
operation: ['create'],
resource: ['loadBalancer'],
},
},
default: {},
@ -192,7 +165,8 @@ export const loadBalancerFields: INodeProperties[] = [
displayName: 'Security Group IDs',
name: 'securityGroups',
type: 'multiOptions',
description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
description:
'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getSecurityGroups',
},
@ -243,12 +217,8 @@ export const loadBalancerFields: INodeProperties[] = [
required: true,
displayOptions: {
show: {
resource: [
'loadBalancer',
],
operation: [
'get',
],
resource: ['loadBalancer'],
operation: ['get'],
},
},
default: '',
@ -264,12 +234,8 @@ export const loadBalancerFields: INodeProperties[] = [
type: 'boolean',
displayOptions: {
show: {
resource: [
'loadBalancer',
],
operation: [
'getMany',
],
resource: ['loadBalancer'],
operation: ['getMany'],
},
},
default: false,
@ -287,15 +253,9 @@ export const loadBalancerFields: INodeProperties[] = [
},
displayOptions: {
show: {
resource: [
'loadBalancer',
],
operation: [
'getMany',
],
returnAll: [
false,
],
resource: ['loadBalancer'],
operation: ['getMany'],
returnAll: [false],
},
},
},
@ -306,15 +266,9 @@ export const loadBalancerFields: INodeProperties[] = [
placeholder: 'Add Filter',
displayOptions: {
show: {
operation: [
'getMany',
],
resource: [
'loadBalancer',
],
returnAll: [
true,
],
operation: ['getMany'],
resource: ['loadBalancer'],
returnAll: [true],
},
},
default: {},
@ -324,7 +278,8 @@ export const loadBalancerFields: INodeProperties[] = [
name: 'names',
type: 'string',
default: '',
description: 'The names of the load balancers. Multiples can be defined separated by comma.',
description:
'The names of the load balancers. Multiples can be defined separated by comma.',
},
],
},
@ -339,12 +294,8 @@ export const loadBalancerFields: INodeProperties[] = [
required: true,
displayOptions: {
show: {
resource: [
'loadBalancer',
],
operation: [
'delete',
],
resource: ['loadBalancer'],
operation: ['delete'],
},
},
default: '',

View file

@ -343,7 +343,8 @@ export const certificateDescription: INodeProperties[] = [
},
},
default: '',
description: 'Name of and, optionally, path to the X509 certificate file that is used to form the certificate-key pair. /nsconfig/ssl/ is the default path.',
description:
'Name of and, optionally, path to the X509 certificate file that is used to form the certificate-key pair. /nsconfig/ssl/ is the default path.',
},
{
displayName: 'Private Key File Name',
@ -357,7 +358,8 @@ export const certificateDescription: INodeProperties[] = [
operation: ['install'],
},
},
description: 'Name of and, optionally, path to the X509 certificate file that is used to form the certificate-key pair. /nsconfig/ssl/ is the default path.',
description:
'Name of and, optionally, path to the X509 certificate file that is used to form the certificate-key pair. /nsconfig/ssl/ is the default path.',
},
{
displayName: 'Certificate Format',

View file

@ -26,9 +26,7 @@ export const fileDescription: INodeProperties[] = [
default: 'upload',
displayOptions: {
show: {
resource: [
'file',
],
resource: ['file'],
},
},
},
@ -90,7 +88,7 @@ export const fileDescription: INodeProperties[] = [
required: true,
displayOptions: {
show: {
operation: ['delete', 'download' ],
operation: ['delete', 'download'],
resource: ['file'],
},
},
@ -105,7 +103,7 @@ export const fileDescription: INodeProperties[] = [
description: 'Name of the file. It should not include filepath.',
displayOptions: {
show: {
operation: ['delete', 'download' ],
operation: ['delete', 'download'],
resource: ['file'],
},
},
@ -116,11 +114,10 @@ export const fileDescription: INodeProperties[] = [
type: 'string',
required: true,
default: 'data',
description:
'The name of the output field to put the binary file data in',
description: 'The name of the output field to put the binary file data in',
displayOptions: {
show: {
operation: ['download' ],
operation: ['download'],
resource: ['file'],
},
},

View file

@ -19,8 +19,7 @@ export async function citrixADCApiRequest(
uri?: string,
option: IDataObject = {},
// tslint:disable-next-line:no-any
): Promise<any> {
): Promise<any> {
const { url } = (await this.getCredentials('citrixAdcApi')) as { url: string };
let options: OptionsWithUri = {

View file

@ -1,6 +1,4 @@
import {
OptionsWithUri,
} from 'request';
import { OptionsWithUri } from 'request';
import {
IExecuteFunctions,
@ -9,12 +7,18 @@ import {
IPollFunctions,
} from 'n8n-core';
import {
IDataObject, NodeApiError,
} from 'n8n-workflow';
export async function cloudflareApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IPollFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, headers: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
import { IDataObject, NodeApiError } from 'n8n-workflow';
export async function cloudflareApiRequest(
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IPollFunctions,
method: string,
resource: string,
body = {},
qs: IDataObject = {},
uri?: string,
headers: IDataObject = {},
// tslint:disable-next-line:no-any
): Promise<any> {
const options: OptionsWithUri = {
method,
body,
@ -51,13 +55,7 @@ export async function cloudflareApiRequestAllItems(
query.page = 1;
do {
responseData = await cloudflareApiRequest.call(
this,
method,
endpoint,
body,
query,
);
responseData = await cloudflareApiRequest.call(this, method, endpoint, body, query);
query.page++;
returnData.push.apply(returnData, responseData[propertyName]);
} while (responseData.result_info.total_pages !== responseData.result_info.page);

View file

@ -1,6 +1,4 @@
import {
INodeProperties,
} from 'n8n-workflow';
import { INodeProperties } from 'n8n-workflow';
export const zoneCertificateOperations: INodeProperties[] = [
{
@ -10,9 +8,7 @@ export const zoneCertificateOperations: INodeProperties[] = [
noDataExpression: true,
displayOptions: {
show: {
resource: [
'zoneCertificate',
],
resource: ['zoneCertificate'],
},
},
options: [
@ -53,22 +49,16 @@ export const zoneCertificateFields: INodeProperties[] = [
displayName: 'Zone Name or ID',
name: 'zoneId',
type: 'options',
description: '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>',
typeOptions: {
loadOptionsMethod: 'getZones',
},
required: true,
displayOptions: {
show: {
resource: [
'zoneCertificate',
],
operation: [
'upload',
'getMany',
'get',
'delete',
],
resource: ['zoneCertificate'],
operation: ['upload', 'getMany', 'get', 'delete'],
},
},
default: '',
@ -80,16 +70,12 @@ export const zoneCertificateFields: INodeProperties[] = [
required: true,
displayOptions: {
show: {
resource: [
'zoneCertificate',
],
operation: [
'upload',
],
resource: ['zoneCertificate'],
operation: ['upload'],
},
},
default: '',
description: 'The zone\'s leaf certificate',
description: "The zone's leaf certificate",
},
{
displayName: 'Private Key',
@ -98,12 +84,8 @@ export const zoneCertificateFields: INodeProperties[] = [
required: true,
displayOptions: {
show: {
resource: [
'zoneCertificate',
],
operation: [
'upload',
],
resource: ['zoneCertificate'],
operation: ['upload'],
},
},
default: '',
@ -119,12 +101,8 @@ export const zoneCertificateFields: INodeProperties[] = [
default: false,
displayOptions: {
show: {
resource: [
'zoneCertificate',
],
operation: [
'getMany',
],
resource: ['zoneCertificate'],
operation: ['getMany'],
},
},
},
@ -139,15 +117,9 @@ export const zoneCertificateFields: INodeProperties[] = [
},
displayOptions: {
show: {
resource: [
'zoneCertificate',
],
operation: [
'getMany',
],
returnAll: [
false,
],
resource: ['zoneCertificate'],
operation: ['getMany'],
returnAll: [false],
},
},
description: 'Max number of results to return',
@ -160,12 +132,8 @@ export const zoneCertificateFields: INodeProperties[] = [
default: {},
displayOptions: {
show: {
resource: [
'zoneCertificate',
],
operation: [
'getMany',
],
resource: ['zoneCertificate'],
operation: ['getMany'],
},
},
options: [
@ -192,7 +160,7 @@ export const zoneCertificateFields: INodeProperties[] = [
},
],
default: '',
description: 'Status of the zone\'s custom SSL',
description: "Status of the zone's custom SSL",
},
],
},
@ -206,13 +174,8 @@ export const zoneCertificateFields: INodeProperties[] = [
required: true,
displayOptions: {
show: {
resource: [
'zoneCertificate',
],
operation: [
'get',
'delete',
],
resource: ['zoneCertificate'],
operation: ['get', 'delete'],
},
},
default: '',

View file

@ -46,7 +46,8 @@ export async function elasticsearchApiRequestAllItems(
indexId: string,
body: IDataObject = {},
qs: IDataObject = {},
): Promise<any> { //tslint:disable-line:no-any
// tslint:disable-next-line:no-any
): Promise<any> {
//https://www.elastic.co/guide/en/elasticsearch/reference/7.16/paginate-search-results.html#search-after
try {
//create a point in time (PIT) to preserve the current index state over your searches

View file

@ -195,21 +195,16 @@ export const documentFields: INodeProperties[] = [
},
},
{
displayName: 'By default, you cannot page through more than 10,000 hits. To page through more hits, add "Sort" from options.',
displayName:
'By default, you cannot page through more than 10,000 hits. To page through more hits, add "Sort" from options.',
name: 'paginateNotice',
type: 'notice',
default: '',
displayOptions: {
show: {
resource: [
'document',
],
operation: [
'getAll',
],
returnAll: [
true,
],
resource: ['document'],
operation: ['getAll'],
returnAll: [true],
},
},
},

View file

@ -20,7 +20,7 @@ export class ExecuteWorkflowTrigger implements INodeType {
properties: [
{
displayName:
'When an execute workflow node calls this workflow, the execution starts here. Any data passed into the \'execute workflow\' node will be output by this node.',
"When an execute workflow node calls this workflow, the execution starts here. Any data passed into the 'execute workflow' node will be output by this node.",
name: 'notice',
type: 'notice',
default: '',

View file

@ -10,4 +10,4 @@ export type IUpdateFields = IDataObject & {
control: string;
value: string;
};
}
};

View file

@ -1,6 +1,10 @@
import { INodeProperties } from 'n8n-workflow';
import { dueDatePreSendAction, taskPostReceiceAction, taskUpdatePreSendAction } from '../GenericFunctions';
import {
dueDatePreSendAction,
taskPostReceiceAction,
taskUpdatePreSendAction,
} from '../GenericFunctions';
export const taskOperations: INodeProperties[] = [
{

View file

@ -315,7 +315,8 @@ export class If implements INodeType {
let item: INodeExecutionData;
let combineOperation: string;
const isDateObject = (value: NodeParameterValue) => Object.prototype.toString.call(value) === '[object Date]';
const isDateObject = (value: NodeParameterValue) =>
Object.prototype.toString.call(value) === '[object Date]';
const isDateInvalid = (value: NodeParameterValue) => value?.toString() === 'Invalid Date';
// The compare operations

View file

@ -27,7 +27,7 @@ export const contactTagOperations: INodeProperties[] = [
{
name: 'Get Many',
value: 'getAll',
description: 'Retrieve many contact\'s tags',
description: "Retrieve many contact's tags",
action: 'Get many contact tags',
},
],

View file

@ -1,9 +1,6 @@
import { IExecuteFunctions } from 'n8n-core';
import {
IDataObject,
INodeExecutionData,
} from 'n8n-workflow';
import { IDataObject, INodeExecutionData } from 'n8n-workflow';
import * as channel from './channel';
import * as message from './message';

View file

@ -30,7 +30,8 @@ export const descriptions: INodeProperties[] = [
{
name: 'Deactive',
value: 'deactive',
description: 'Deactivates the user and revokes all its sessions by archiving its user object',
description:
'Deactivates the user and revokes all its sessions by archiving its user object',
action: 'Deactivate a user',
},
{

View file

@ -15,7 +15,7 @@ export const folderOperations: INodeProperties[] = [
{
name: 'Create',
value: 'create',
description: 'Create a new mail folder in the root folder of the user\'s mailbox',
description: "Create a new mail folder in the root folder of the user's mailbox",
action: 'Create a folder',
},
{

View file

@ -27,7 +27,7 @@ export const messageOperations: INodeProperties[] = [
{
name: 'Get Many',
value: 'getAll',
description: 'Get many messages in the signed-in user\'s mailbox',
description: "Get many messages in the signed-in user's mailbox",
action: 'Get many messages',
},
{

View file

@ -108,7 +108,7 @@ export class MicrosoftToDo implements INodeType {
const body: IDataObject = {
applicationName: this.getNodeParameter('applicationName', i) as string,
displayName: this.getNodeParameter('displayName', i) as string,
...(this.getNodeParameter('additionalFields', i)),
...this.getNodeParameter('additionalFields', i),
};
responseData = await microsoftApiRequest.call(

View file

@ -33,8 +33,8 @@ export const boardItemOperations: INodeProperties[] = [
{
name: 'Create',
value: 'create',
description: 'Create an item in a board\'s group',
action: 'Create an item in a board\'s group',
description: "Create an item in a board's group",
action: "Create an item in a board's group",
},
{
name: 'Delete',

View file

@ -16,7 +16,13 @@ import { nodeDescription } from './MongoDbDescription';
import { buildParameterizedConnString, prepareFields, prepareItems } from './GenericFunctions';
import { FindOneAndReplaceOptions, FindOneAndUpdateOptions, MongoClient, ObjectId, UpdateOptions } from 'mongodb';
import {
FindOneAndReplaceOptions,
FindOneAndUpdateOptions,
MongoClient,
ObjectId,
UpdateOptions,
} from 'mongodb';
import { validateAndResolveMongoCredentials } from './GenericFunctions';

View file

@ -28,7 +28,8 @@ export const operationFields: INodeProperties[] = [
},
},
required: true,
description: '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>',
typeOptions: {
loadOptionsMethod: 'getProjects',
},

View file

@ -47,21 +47,21 @@ export const blockFields: INodeProperties[] = [
displayName: 'Link',
name: 'url',
type: 'string',
placeholder:
'https://www.notion.so/My-Page-b4eeb113e118403ba450af65ac25f0b9',
placeholder: 'https://www.notion.so/My-Page-b4eeb113e118403ba450af65ac25f0b9',
validation: [
{
type: 'regex',
properties: {
regex:
'(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?(?:[a-zA-Z0-9\-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?(?:[a-zA-Z0-9-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
errorMessage: 'Not a valid Notion Block URL',
},
},
],
extractValue: {
type: 'regex',
regex: '(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?(?:[a-zA-Z0-9\-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
regex:
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?(?:[a-zA-Z0-9-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
},
},
{
@ -73,7 +73,8 @@ export const blockFields: INodeProperties[] = [
{
type: 'regex',
properties: {
regex: '^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
regex:
'^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
errorMessage: 'Not a valid Notion Block ID',
},
},
@ -91,7 +92,7 @@ export const blockFields: INodeProperties[] = [
operation: ['append'],
},
},
description: "The Notion Block to append blocks to",
description: 'The Notion Block to append blocks to',
},
...blocks('block', 'append'),
/* -------------------------------------------------------------------------- */
@ -108,21 +109,21 @@ export const blockFields: INodeProperties[] = [
displayName: 'Link',
name: 'url',
type: 'string',
placeholder:
'https://www.notion.so/My-Page-b4eeb113e118403ba450af65ac25f0b9',
placeholder: 'https://www.notion.so/My-Page-b4eeb113e118403ba450af65ac25f0b9',
validation: [
{
type: 'regex',
properties: {
regex:
'(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?(?:[a-zA-Z0-9\-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?(?:[a-zA-Z0-9-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
errorMessage: 'Not a valid Notion Block URL',
},
},
],
extractValue: {
type: 'regex',
regex: '(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?(?:[a-zA-Z0-9\-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
regex:
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?(?:[a-zA-Z0-9-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
},
},
{
@ -134,7 +135,8 @@ export const blockFields: INodeProperties[] = [
{
type: 'regex',
properties: {
regex: '^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
regex:
'^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
errorMessage: 'Not a valid Notion Block ID',
},
},
@ -152,7 +154,7 @@ export const blockFields: INodeProperties[] = [
operation: ['getAll'],
},
},
description: "The Notion Block to get all children from",
description: 'The Notion Block to get all children from',
},
{
displayName: 'Return All',

View file

@ -222,14 +222,15 @@ const typeMention: INodeProperties[] = [
type: 'regex',
properties: {
regex:
'(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
errorMessage: 'Not a valid Notion Database URL',
},
},
],
extractValue: {
type: 'regex',
regex: '(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
regex:
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
},
},
{
@ -241,7 +242,8 @@ const typeMention: INodeProperties[] = [
{
type: 'regex',
properties: {
regex: '^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
regex:
'^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
errorMessage: 'Not a valid Notion Database ID',
},
},
@ -258,7 +260,7 @@ const typeMention: INodeProperties[] = [
mentionType: ['database'],
},
},
description: "The Notion Database being mentioned",
description: 'The Notion Database being mentioned',
},
{
displayName: 'Range',

View file

@ -96,14 +96,16 @@ export const databaseFields: INodeProperties[] = [
type: 'regex',
properties: {
regex:
'(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
errorMessage: 'Not a valid Notion Database URL. Hint: use the URL of the database itself, not a page containing it.',
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
errorMessage:
'Not a valid Notion Database URL. Hint: use the URL of the database itself, not a page containing it.',
},
},
],
extractValue: {
type: 'regex',
regex: '(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
regex:
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
},
},
{
@ -115,7 +117,8 @@ export const databaseFields: INodeProperties[] = [
{
type: 'regex',
properties: {
regex: '^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
regex:
'^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
errorMessage: 'Not a valid Notion Database ID',
},
},
@ -133,7 +136,7 @@ export const databaseFields: INodeProperties[] = [
operation: ['get'],
},
},
description: "The Notion Database to get",
description: 'The Notion Database to get',
},
/* -------------------------------------------------------------------------- */
/* database:getAll */

View file

@ -113,14 +113,15 @@ export const databasePageFields: INodeProperties[] = [
type: 'regex',
properties: {
regex:
'(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
errorMessage: 'Not a valid Notion Database URL',
},
},
],
extractValue: {
type: 'regex',
regex: '(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
regex:
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
},
},
{
@ -132,7 +133,8 @@ export const databasePageFields: INodeProperties[] = [
{
type: 'regex',
properties: {
regex: '^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
regex:
'^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
errorMessage: 'Not a valid Notion Database ID',
},
},
@ -150,7 +152,7 @@ export const databasePageFields: INodeProperties[] = [
operation: ['create'],
},
},
description: "The Notion Database to operate on",
description: 'The Notion Database to operate on',
},
{
displayName: 'Title',
@ -546,21 +548,21 @@ export const databasePageFields: INodeProperties[] = [
displayName: 'Link',
name: 'url',
type: 'string',
placeholder:
'https://www.notion.so/My-Database-Page-b4eeb113e118403ba450af65ac25f0b9',
placeholder: 'https://www.notion.so/My-Database-Page-b4eeb113e118403ba450af65ac25f0b9',
validation: [
{
type: 'regex',
properties: {
regex:
'(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?(?:[a-zA-Z0-9\-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?(?:[a-zA-Z0-9-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
errorMessage: 'Not a valid Notion Database Page URL',
},
},
],
extractValue: {
type: 'regex',
regex: '(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?(?:[a-zA-Z0-9\-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
regex:
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?(?:[a-zA-Z0-9-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
},
},
{
@ -572,7 +574,8 @@ export const databasePageFields: INodeProperties[] = [
{
type: 'regex',
properties: {
regex: '^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
regex:
'^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
errorMessage: 'Not a valid Notion Database Page ID',
},
},
@ -590,7 +593,7 @@ export const databasePageFields: INodeProperties[] = [
operation: ['update'],
},
},
description: "The Notion Database Page to update",
description: 'The Notion Database Page to update',
},
{
displayName: 'Simplify',
@ -970,21 +973,21 @@ export const databasePageFields: INodeProperties[] = [
displayName: 'Link',
name: 'url',
type: 'string',
placeholder:
'https://www.notion.so/My-Database-Page-b4eeb113e118403ba450af65ac25f0b9',
placeholder: 'https://www.notion.so/My-Database-Page-b4eeb113e118403ba450af65ac25f0b9',
validation: [
{
type: 'regex',
properties: {
regex:
'(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?(?:[a-zA-Z0-9\-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?(?:[a-zA-Z0-9-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
errorMessage: 'Not a valid Notion Database Page URL',
},
},
],
extractValue: {
type: 'regex',
regex: '(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?(?:[a-zA-Z0-9\-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
regex:
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?(?:[a-zA-Z0-9-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
},
},
{
@ -996,7 +999,8 @@ export const databasePageFields: INodeProperties[] = [
{
type: 'regex',
properties: {
regex: '^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
regex:
'^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
errorMessage: 'Not a valid Notion Database Page ID',
},
},
@ -1015,7 +1019,7 @@ export const databasePageFields: INodeProperties[] = [
operation: ['get'],
},
},
description: "The Notion Database Page to get",
description: 'The Notion Database Page to get',
},
{
displayName: 'Simplify',
@ -1062,14 +1066,15 @@ export const databasePageFields: INodeProperties[] = [
type: 'regex',
properties: {
regex:
'(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
errorMessage: 'Not a valid Notion Database URL',
},
},
],
extractValue: {
type: 'regex',
regex: '(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
regex:
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
},
},
{
@ -1081,7 +1086,8 @@ export const databasePageFields: INodeProperties[] = [
{
type: 'regex',
properties: {
regex: '^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
regex:
'^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
errorMessage: 'Not a valid Notion Database ID',
},
},
@ -1099,7 +1105,7 @@ export const databasePageFields: INodeProperties[] = [
operation: ['getAll'],
},
},
description: "The Notion Database to operate on",
description: 'The Notion Database to operate on',
},
{
displayName: 'Return All',

View file

@ -950,10 +950,20 @@ export function validateJSON(json: string | undefined): any {
* @param blockValues the blockUi.blockValues node parameter.
*/
export function extractDatabaseMentionRLC(blockValues: IDataObject[]) {
blockValues.forEach(bv => {
blockValues.forEach((bv) => {
if (bv.richText && bv.text) {
const texts = (bv.text as { text: [{ textType: string, mentionType: string, database: string | { value: string, mode: string, __rl: boolean, __regex: string } }] }).text;
texts.forEach(txt => {
const texts = (
bv.text as {
text: [
{
textType: string;
mentionType: string;
database: string | { value: string; mode: string; __rl: boolean; __regex: string };
},
];
}
).text;
texts.forEach((txt) => {
if (txt.textType === 'mention' && txt.mentionType === 'database') {
if (typeof txt.database === 'object' && txt.database.__rl) {
if (txt.database.__regex) {

View file

@ -86,21 +86,21 @@ export const pageFields: INodeProperties[] = [
displayName: 'Link',
name: 'url',
type: 'string',
placeholder:
'https://www.notion.so/My-Page-b4eeb113e118403aa450af65ac25f0b9',
placeholder: 'https://www.notion.so/My-Page-b4eeb113e118403aa450af65ac25f0b9',
validation: [
{
type: 'regex',
properties: {
regex:
'(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?(?:[a-zA-Z0-9\-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?(?:[a-zA-Z0-9-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
errorMessage: 'Not a valid Notion Page URL',
},
},
],
extractValue: {
type: 'regex',
regex: '(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?(?:[a-zA-Z0-9\-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
regex:
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?(?:[a-zA-Z0-9-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
},
},
{
@ -112,7 +112,8 @@ export const pageFields: INodeProperties[] = [
{
type: 'regex',
properties: {
regex: '^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
regex:
'^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
errorMessage: 'Not a valid Notion Page ID',
},
},
@ -131,7 +132,7 @@ export const pageFields: INodeProperties[] = [
operation: ['archive'],
},
},
description: "The Notion Page to archive",
description: 'The Notion Page to archive',
},
{
displayName: 'Simplify',
@ -161,21 +162,21 @@ export const pageFields: INodeProperties[] = [
displayName: 'Link',
name: 'url',
type: 'string',
placeholder:
'https://www.notion.so/My-Page-b4eeb113e118403aa450af65ac25f0b9',
placeholder: 'https://www.notion.so/My-Page-b4eeb113e118403aa450af65ac25f0b9',
validation: [
{
type: 'regex',
properties: {
regex:
'(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?(?:[a-zA-Z0-9\-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?(?:[a-zA-Z0-9-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
errorMessage: 'Not a valid Notion Page URL',
},
},
],
extractValue: {
type: 'regex',
regex: '(?:https|http):\/\/www.notion.so\/(?:[a-z0-9\-]{2,}\/)?(?:[a-zA-Z0-9\-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
regex:
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?(?:[a-zA-Z0-9-]{2,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
},
},
{
@ -187,7 +188,8 @@ export const pageFields: INodeProperties[] = [
{
type: 'regex',
properties: {
regex: '^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
regex:
'^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
errorMessage: 'Not a valid Notion Page ID',
},
},
@ -205,7 +207,7 @@ export const pageFields: INodeProperties[] = [
operation: ['create'],
},
},
description: "The Notion Database Page to create a child page for",
description: 'The Notion Database Page to create a child page for',
},
{
displayName: 'Title',

View file

@ -1,5 +1,10 @@
import { IDataObject, ILoadOptionsFunctions, INodeListSearchItems, INodeListSearchResult } from "n8n-workflow";
import { notionApiRequestAllItems } from "./GenericFunctions";
import {
IDataObject,
ILoadOptionsFunctions,
INodeListSearchItems,
INodeListSearchResult,
} from 'n8n-workflow';
import { notionApiRequestAllItems } from './GenericFunctions';
export async function getDatabases(
this: ILoadOptionsFunctions,
@ -11,13 +16,7 @@ export async function getDatabases(
query: filter,
filter: { property: 'object', value: 'database' },
};
const databases = await notionApiRequestAllItems.call(
this,
'results',
'POST',
`/search`,
body,
);
const databases = await notionApiRequestAllItems.call(this, 'results', 'POST', `/search`, body);
for (const database of databases) {
returnData.push({
name: database.title[0]?.plain_text || database.id,

View file

@ -21,7 +21,7 @@ export const incidentNoteOperations: INodeProperties[] = [
{
name: 'Get Many',
value: 'getAll',
description: 'Get many incident\'s notes',
description: "Get many incident's notes",
action: 'Get many incident notes',
},
],

View file

@ -27,7 +27,7 @@ export const agentOperations: INodeProperties[] = [
{
name: 'Get Many',
value: 'getAll',
description: 'Get many agents of the current user\'s organization',
description: "Get many agents of the current user's organization",
action: 'Get many agents',
},
{

View file

@ -40,7 +40,9 @@ export async function raindropApiRequest(
}
try {
return await this.helpers.requestOAuth2!.call(this, 'raindropOAuth2Api', options, { includeCredentialsOnRefreshOnBody: true });
return await this.helpers.requestOAuth2!.call(this, 'raindropOAuth2Api', options, {
includeCredentialsOnRefreshOnBody: true,
});
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -767,12 +767,8 @@ export const alertFields: INodeProperties[] = [
name: 'options',
displayOptions: {
show: {
operation: [
'get',
],
resource: [
'alert',
],
operation: ['get'],
resource: ['alert'],
},
},
type: 'collection',

File diff suppressed because one or more lines are too long

View file

@ -623,8 +623,7 @@ export const certificateFields: INodeProperties[] = [
resource: ['certificate'],
},
},
description:
'The name of the input field containing the binary file data to be uploaded',
description: 'The name of the input field containing the binary file data to be uploaded',
},
{
displayName: 'Additional Fields',

View file

@ -168,8 +168,7 @@ export const certificateFields: INodeProperties[] = [
},
},
required: true,
description:
'The name of the input field containing the binary file data to be uploaded',
description: 'The name of the input field containing the binary file data to be uploaded',
},
{
displayName: 'Options',

View file

@ -64,9 +64,7 @@ export const certificateRequestFields: INodeProperties[] = [
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getCertificateIssuingTemplates',
loadOptionsDependsOn: [
'applicationId',
],
loadOptionsDependsOn: ['applicationId'],
},
displayOptions: {
show: {
@ -155,7 +153,7 @@ export const certificateRequestFields: INodeProperties[] = [
default: 'RSA',
description: 'The encryption algorithm for the public key',
},
{
{
displayName: 'Key Curve',
name: 'keyCurve',
type: 'options',
@ -323,7 +321,8 @@ export const certificateRequestFields: INodeProperties[] = [
type: 'string',
placeholder: 'P1Y',
default: 'P1Y',
description: 'Specify how long the issued certificate should be valid for. Use ISO8601 format.',
description:
'Specify how long the issued certificate should be valid for. Use ISO8601 format.',
hint: 'e.g. 1 year -> P1Y',
},
],

View file

@ -1,10 +1,6 @@
import { OptionsWithUri } from 'request';
import {
IExecuteFunctions,
IExecuteSingleFunctions,
ILoadOptionsFunctions,
} from 'n8n-core';
import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { IDataObject, IHookFunctions, JsonObject, NodeApiError } from 'n8n-workflow';

View file

@ -17,7 +17,7 @@
"dev": "pnpm watch",
"build": "tsc && gulp build:icons && gulp build:translations",
"build:translations": "gulp build:translations",
"format": "prettier --write **/*.{ts,js,json,md} --ignore-path ../../.prettierignore",
"format": "prettier --write . --ignore-path ../../.prettierignore",
"lint": "tslint -p tsconfig.json -c tslint.json && eslint nodes credentials",
"lintfix": "tslint --fix -p tsconfig.json -c tslint.json && eslint nodes credentials --fix",
"watch": "tsc --watch",