👕 Fix built issue by fixing lint issues

This commit is contained in:
Jan Oberhauser
2020-10-01 14:01:39 +02:00
parent 9b5731450f
commit fe802c8f76
165 changed files with 1930 additions and 1864 deletions

View File

@@ -1,6 +1,6 @@
import {
OptionsWithUri,
} from 'request';
} from 'request';
import {
IExecuteFunctions,
@@ -61,7 +61,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
}
}
export async function googleApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, propertyName: string ,method: string, endpoint: string, body: any = {}, query: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
export async function googleApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, propertyName: string, method: string, endpoint: string, body: any = {}, query: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
const returnData: IDataObject[] = [];
@@ -80,7 +80,7 @@ export async function googleApiRequestAllItems(this: IExecuteFunctions | ILoadOp
return returnData;
}
function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, credentials: IDataObject) : Promise<IDataObject> {
function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, credentials: IDataObject): Promise<IDataObject> {
//https://developers.google.com/identity/protocols/oauth2/service-account#httprest
const scopes = [
@@ -93,25 +93,25 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa
const signature = jwt.sign(
{
'iss': credentials.email as string,
'sub': credentials.email as string,
'scope': scopes.join(' '),
'aud': `https://oauth2.googleapis.com/token`,
'iat': now,
'exp': now + 3600,
'iss': credentials.email as string,
'sub': credentials.email as string,
'scope': scopes.join(' '),
'aud': `https://oauth2.googleapis.com/token`,
'iat': now,
'exp': now + 3600,
},
credentials.privateKey as string,
{
algorithm: 'RS256',
header: {
'kid': credentials.privateKey as string,
'typ': 'JWT',
'alg': 'RS256',
},
algorithm: 'RS256',
header: {
'kid': credentials.privateKey as string,
'typ': 'JWT',
'alg': 'RS256',
},
}
);
);
const options: OptionsWithUri = {
const options: OptionsWithUri = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},

View File

@@ -5,11 +5,11 @@ import {
import {
IExecuteFunctions,
ILoadOptionsFunctions,
} from 'n8n-core';
} from 'n8n-core';
import {
googleApiRequest,
} from './GenericFunctions';
} from './GenericFunctions';
import {
utils as xlsxUtils,
@@ -84,9 +84,9 @@ export class GoogleSheet {
return response;
}
/**
* Returns the cell values
*/
/**
* Returns the cell values
*/
async getData(range: string, valueRenderMode: ValueRenderOption): Promise<string[][] | undefined> {
const query = {
@@ -129,9 +129,9 @@ export class GoogleSheet {
}
/**
* Sets the cell values
*/
/**
* Sets the cell values
*/
async batchUpdate(updateData: ISheetUpdateData[], valueInputMode: ValueInputOption) {
const body = {
@@ -145,9 +145,9 @@ export class GoogleSheet {
}
/**
* Sets the cell values
*/
/**
* Sets the cell values
*/
async setData(range: string, data: string[][], valueInputMode: ValueInputOption) {
const body = {
@@ -161,9 +161,9 @@ export class GoogleSheet {
}
/**
* Appends the cell values
*/
/**
* Appends the cell values
*/
async appendData(range: string, data: string[][], valueInputMode: ValueInputOption) {
const body = {
@@ -180,9 +180,9 @@ export class GoogleSheet {
return response;
}
/**
* Returns the given sheet data in a structured way
*/
/**
* Returns the given sheet data in a structured way
*/
structureData(inputData: string[][], startRow: number, keys: string[], addEmpty?: boolean): IDataObject[] {
const returnData = [];
@@ -207,10 +207,10 @@ export class GoogleSheet {
}
/**
* Returns the given sheet data in a structured way using
* the startRow as the one with the name of the key
*/
/**
* Returns the given sheet data in a structured way using
* the startRow as the one with the name of the key
*/
structureArrayDataByColumn(inputData: string[][], keyRow: number, dataStartRow: number): IDataObject[] {
const keys: string[] = [];
@@ -235,7 +235,7 @@ export class GoogleSheet {
}
getColumnWithOffset (startColumn: string, offset: number): string {
getColumnWithOffset(startColumn: string, offset: number): string {
const columnIndex = xlsxUtils.decode_col(startColumn) + offset;
return xlsxUtils.encode_col(columnIndex);
}
@@ -303,7 +303,7 @@ export class GoogleSheet {
sheetDataKeyColumn.shift();
// Create an Array which all the key-values of the Google Sheet
const keyColumnIndexLookup = sheetDataKeyColumn.map((rowContent) => rowContent[0] );
const keyColumnIndexLookup = sheetDataKeyColumn.map((rowContent) => rowContent[0]);
const updateData: ISheetUpdateData[] = [];
let itemKey: string | number | undefined | null;

View File

@@ -1,7 +1,7 @@
import {
IExecuteFunctions,
} from 'n8n-core';
} from 'n8n-core';
import {
IDataObject,
@@ -613,7 +613,7 @@ export class GoogleSheets implements INodeType {
range = this.getNodeParameter('range', 0) as string;
if (range.includes('!')) {
const [sheet, ranges] = range.split('!');
range = `${encodeURIComponent(sheet)}!${ranges}`;
range = `${encodeURIComponent(sheet)}!${ranges}`;
}
}