mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
👕 Fix lint issue
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
"start:default": "cd packages/cli/bin && ./n8n",
|
"start:default": "cd packages/cli/bin && ./n8n",
|
||||||
"start:windows": "cd packages/cli/bin && n8n",
|
"start:windows": "cd packages/cli/bin && n8n",
|
||||||
"test": "lerna run test",
|
"test": "lerna run test",
|
||||||
|
"tslint": "lerna exec npm run tslint",
|
||||||
"watch": "lerna run --parallel watch"
|
"watch": "lerna run --parallel watch"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ export async function googleApiRequest(
|
|||||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||||
method: string,
|
method: string,
|
||||||
resource: string,
|
resource: string,
|
||||||
body: any = {},
|
body: IDataObject = {},
|
||||||
qs: IDataObject = {},
|
qs: IDataObject = {},
|
||||||
uri?: string,
|
uri?: string,
|
||||||
headers: IDataObject = {}
|
headers: IDataObject = {}
|
||||||
): Promise<any> {
|
): Promise<any> { // tslint:disable-line:no-any
|
||||||
const options: OptionsWithUri = {
|
const options: OptionsWithUri = {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@@ -65,9 +65,9 @@ export async function googleApiRequestAllItems(
|
|||||||
propertyName: string,
|
propertyName: string,
|
||||||
method: string,
|
method: string,
|
||||||
endpoint: string,
|
endpoint: string,
|
||||||
body: any = {},
|
body: IDataObject = {},
|
||||||
query: IDataObject = {}
|
query: IDataObject = {}
|
||||||
): Promise<any> {
|
): Promise<any> { // tslint:disable-line:no-any
|
||||||
const returnData: IDataObject[] = [];
|
const returnData: IDataObject[] = [];
|
||||||
|
|
||||||
let responseData;
|
let responseData;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export function copyInputItem(
|
|||||||
properties: string[],
|
properties: string[],
|
||||||
): IDataObject {
|
): IDataObject {
|
||||||
// Prepare the data to insert and copy it to be returned
|
// Prepare the data to insert and copy it to be returned
|
||||||
let newItem: IDataObject = {};
|
const newItem: IDataObject = {};
|
||||||
for (const property of properties) {
|
for (const property of properties) {
|
||||||
if (item.json[property] === undefined) {
|
if (item.json[property] === undefined) {
|
||||||
newItem[property] = null;
|
newItem[property] = null;
|
||||||
@@ -70,14 +70,14 @@ export function createTableStruct(
|
|||||||
export function executeQueryQueue(
|
export function executeQueryQueue(
|
||||||
tables: ITables,
|
tables: ITables,
|
||||||
buildQueryQueue: Function,
|
buildQueryQueue: Function,
|
||||||
): Promise<any[]> {
|
): Promise<any[]> { // tslint:disable-line:no-any
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
Object.keys(tables).map(table => {
|
Object.keys(tables).map(table => {
|
||||||
const columnsResults = Object.keys(tables[table]).map(columnString => {
|
const columnsResults = Object.keys(tables[table]).map(columnString => {
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
buildQueryQueue({
|
buildQueryQueue({
|
||||||
table: table,
|
table,
|
||||||
columnString: columnString,
|
columnString,
|
||||||
items: tables[table][columnString],
|
items: tables[table][columnString],
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@@ -94,7 +94,7 @@ export function executeQueryQueue(
|
|||||||
* @returns {string} (Val1, Val2, ...)
|
* @returns {string} (Val1, Val2, ...)
|
||||||
*/
|
*/
|
||||||
export function extractValues(item: IDataObject): string {
|
export function extractValues(item: IDataObject): string {
|
||||||
return `(${Object.values(item as any)
|
return `(${Object.values(item as any) // tslint:disable-line:no-any
|
||||||
.map(val => (typeof val === 'string' ? `'${val}'` : val)) // maybe other types such as dates have to be handled as well
|
.map(val => (typeof val === 'string' ? `'${val}'` : val)) // maybe other types such as dates have to be handled as well
|
||||||
.join(',')})`;
|
.join(',')})`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ import { IDataObject } from 'n8n-workflow';
|
|||||||
|
|
||||||
export interface ITables {
|
export interface ITables {
|
||||||
[key: string]: {
|
[key: string]: {
|
||||||
[key: string]: Array<IDataObject>;
|
[key: string]: IDataObject[];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export function pgQuery(
|
|||||||
pgp: pgPromise.IMain<{}, pg.IClient>,
|
pgp: pgPromise.IMain<{}, pg.IClient>,
|
||||||
db: pgPromise.IDatabase<{}, pg.IClient>,
|
db: pgPromise.IDatabase<{}, pg.IClient>,
|
||||||
input: INodeExecutionData[],
|
input: INodeExecutionData[],
|
||||||
): Promise<Array<object>> {
|
): Promise<object[]> {
|
||||||
const queries: string[] = [];
|
const queries: string[] = [];
|
||||||
for (let i = 0; i < input.length; i++) {
|
for (let i = 0; i < input.length; i++) {
|
||||||
queries.push(getNodeParam('query', i) as string);
|
queries.push(getNodeParam('query', i) as string);
|
||||||
@@ -63,7 +63,7 @@ export async function pgInsert(
|
|||||||
pgp: pgPromise.IMain<{}, pg.IClient>,
|
pgp: pgPromise.IMain<{}, pg.IClient>,
|
||||||
db: pgPromise.IDatabase<{}, pg.IClient>,
|
db: pgPromise.IDatabase<{}, pg.IClient>,
|
||||||
items: INodeExecutionData[],
|
items: INodeExecutionData[],
|
||||||
): Promise<Array<IDataObject[]>> {
|
): Promise<IDataObject[][]> {
|
||||||
const table = getNodeParam('table', 0) as string;
|
const table = getNodeParam('table', 0) as string;
|
||||||
const schema = getNodeParam('schema', 0) as string;
|
const schema = getNodeParam('schema', 0) as string;
|
||||||
let returnFields = (getNodeParam('returnFields', 0) as string).split(',') as string[];
|
let returnFields = (getNodeParam('returnFields', 0) as string).split(',') as string[];
|
||||||
@@ -103,7 +103,7 @@ export async function pgUpdate(
|
|||||||
pgp: pgPromise.IMain<{}, pg.IClient>,
|
pgp: pgPromise.IMain<{}, pg.IClient>,
|
||||||
db: pgPromise.IDatabase<{}, pg.IClient>,
|
db: pgPromise.IDatabase<{}, pg.IClient>,
|
||||||
items: INodeExecutionData[],
|
items: INodeExecutionData[],
|
||||||
): Promise<Array<IDataObject>> {
|
): Promise<IDataObject[]> {
|
||||||
const table = getNodeParam('table', 0) as string;
|
const table = getNodeParam('table', 0) as string;
|
||||||
const updateKey = getNodeParam('updateKey', 0) as string;
|
const updateKey = getNodeParam('updateKey', 0) as string;
|
||||||
const columnString = getNodeParam('columns', 0) as string;
|
const columnString = getNodeParam('columns', 0) as string;
|
||||||
|
|||||||
@@ -70,10 +70,9 @@ export async function zoomApiRequestAllItems(
|
|||||||
propertyName: string,
|
propertyName: string,
|
||||||
method: string,
|
method: string,
|
||||||
endpoint: string,
|
endpoint: string,
|
||||||
body: any = {},
|
body: IDataObject = {},
|
||||||
query: IDataObject = {}
|
query: IDataObject = {}
|
||||||
): Promise<any> {
|
): Promise<any> { // tslint:disable-line:no-any
|
||||||
// tslint:disable-line:no-any
|
|
||||||
const returnData: IDataObject[] = [];
|
const returnData: IDataObject[] = [];
|
||||||
let responseData;
|
let responseData;
|
||||||
query.page_number = 0;
|
query.page_number = 0;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
* chunk(['a', 'b', 'c', 'd'], 3)
|
* chunk(['a', 'b', 'c', 'd'], 3)
|
||||||
* // => [['a', 'b', 'c'], ['d']]
|
* // => [['a', 'b', 'c'], ['d']]
|
||||||
*/
|
*/
|
||||||
export function chunk(array: any[], size: number = 1) {
|
export function chunk(array: any[], size = 1) { // tslint:disable-line:no-any
|
||||||
const length = array == null ? 0 : array.length;
|
const length = array == null ? 0 : array.length;
|
||||||
if (!length || size < 1) {
|
if (!length || size < 1) {
|
||||||
return [];
|
return [];
|
||||||
@@ -40,11 +40,11 @@ export function chunk(array: any[], size: number = 1) {
|
|||||||
* // => ['a', 'b', 'c', 'd']
|
* // => ['a', 'b', 'c', 'd']
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export function flatten(nestedArray: any[][]) {
|
export function flatten(nestedArray: any[][]) { // tslint:disable-line:no-any
|
||||||
const result = [];
|
const result = [];
|
||||||
|
|
||||||
(function loop(array: any[]) {
|
(function loop(array: any[]) { // tslint:disable-line:no-any
|
||||||
for (var i = 0; i < array.length; i++) {
|
for (let i = 0; i < array.length; i++) {
|
||||||
if (Array.isArray(array[i])) {
|
if (Array.isArray(array[i])) {
|
||||||
loop(array[i]);
|
loop(array[i]);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user