n8n-3867-progressively-apply-prettier-to-all (#3873)
* 🔨 formatting nodes with prettier
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject,
|
||||
@@ -13,24 +11,13 @@ import {
|
||||
NodeOperationError,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
iterableApiRequest,
|
||||
} from './GenericFunctions';
|
||||
import { iterableApiRequest } from './GenericFunctions';
|
||||
|
||||
import {
|
||||
eventFields,
|
||||
eventOperations,
|
||||
} from './EventDescription';
|
||||
import { eventFields, eventOperations } from './EventDescription';
|
||||
|
||||
import {
|
||||
userFields,
|
||||
userOperations,
|
||||
} from './UserDescription';
|
||||
import { userFields, userOperations } from './UserDescription';
|
||||
|
||||
import {
|
||||
userListFields,
|
||||
userListOperations,
|
||||
} from './UserListDescription';
|
||||
import { userListFields, userListOperations } from './UserListDescription';
|
||||
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
@@ -119,13 +106,16 @@ export class Iterable implements INodeType {
|
||||
const events = [];
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
|
||||
const name = this.getNodeParameter('name', i) as string;
|
||||
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
|
||||
if (!additionalFields.email && !additionalFields.id) {
|
||||
throw new NodeOperationError(this.getNode(), 'Either email or userId must be passed in to identify the user. Please add one of both via "Additional Fields". If both are passed in, email takes precedence.', { itemIndex: i });
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
'Either email or userId must be passed in to identify the user. Please add one of both via "Additional Fields". If both are passed in, email takes precedence.',
|
||||
{ itemIndex: i },
|
||||
);
|
||||
}
|
||||
|
||||
const body: IDataObject = {
|
||||
@@ -161,7 +151,6 @@ export class Iterable implements INodeType {
|
||||
if (operation === 'upsert') {
|
||||
// https://api.iterable.com/api/docs#users_updateUser
|
||||
for (let i = 0; i < length; i++) {
|
||||
|
||||
const identifier = this.getNodeParameter('identifier', i) as string;
|
||||
|
||||
const value = this.getNodeParameter('value', i) as string;
|
||||
@@ -193,8 +182,10 @@ export class Iterable implements INodeType {
|
||||
|
||||
if (this.continueOnFail() === false) {
|
||||
if (responseData.code !== 'Success') {
|
||||
throw new NodeOperationError(this.getNode(),
|
||||
`Iterable error response [400]: ${responseData.msg}`, { itemIndex: i },
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
`Iterable error response [400]: ${responseData.msg}`,
|
||||
{ itemIndex: i },
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -235,7 +226,6 @@ export class Iterable implements INodeType {
|
||||
// https://api.iterable.com/api/docs#users_getUser
|
||||
// https://api.iterable.com/api/docs#users_getUserById
|
||||
for (let i = 0; i < length; i++) {
|
||||
|
||||
const by = this.getNodeParameter('by', i) as string;
|
||||
|
||||
let endpoint;
|
||||
@@ -253,9 +243,10 @@ export class Iterable implements INodeType {
|
||||
|
||||
if (this.continueOnFail() === false) {
|
||||
if (Object.keys(responseData).length === 0) {
|
||||
throw new NodeApiError(this.getNode(), responseData,
|
||||
{ message: `User not found`, httpCode: '404' },
|
||||
);
|
||||
throw new NodeApiError(this.getNode(), responseData, {
|
||||
message: `User not found`,
|
||||
httpCode: '404',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,7 +271,6 @@ export class Iterable implements INodeType {
|
||||
const subscribers: IDataObject[] = [];
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
|
||||
const value = this.getNodeParameter('value', i) as string;
|
||||
|
||||
if (identifier === 'email') {
|
||||
@@ -315,7 +305,6 @@ export class Iterable implements INodeType {
|
||||
const subscribers: IDataObject[] = [];
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
|
||||
const value = this.getNodeParameter('value', i) as string;
|
||||
|
||||
if (identifier === 'email') {
|
||||
|
||||
Reference in New Issue
Block a user