👕 Fix lint issue

This commit is contained in:
Jan Oberhauser 2019-11-10 23:14:36 +01:00
parent 3623828283
commit 883d0936cb
2 changed files with 12 additions and 12 deletions

View file

@ -39,7 +39,7 @@ enum Source {
OutboundEmail = 10 OutboundEmail = 10
} }
interface ICreateTicketBody { interface ICreateTicketBody {
name?: string; name?: string;
requester_id?: number; requester_id?: number;
email?: string; email?: string;
@ -86,7 +86,7 @@ export class Freshdesk implements INodeType {
name: 'freshdeskApi', name: 'freshdeskApi',
required: true, required: true,
} }
], ],
properties: [ properties: [
{ {
displayName: 'Resource', displayName: 'Resource',
@ -565,7 +565,7 @@ export class Freshdesk implements INodeType {
// }`, // }`,
// description: 'Key value pairs containing the names and values of custom fields.', // description: 'Key value pairs containing the names and values of custom fields.',
// }, // },
] ]
}; };
methods = { methods = {
@ -689,15 +689,15 @@ export class Freshdesk implements INodeType {
throw new Error('Requester Id must be a number'); throw new Error('Requester Id must be a number');
} }
body.requester_id = parseInt(value, 10); body.requester_id = parseInt(value, 10);
} else if (requester === 'email'){ } else if (requester === 'email') {
body.email = value; body.email = value;
} else if (requester === 'facebookId'){ } else if (requester === 'facebookId') {
body.facebook_id = value; body.facebook_id = value;
} else if (requester === 'phone'){ } else if (requester === 'phone') {
body.phone = value; body.phone = value;
} else if (requester === 'twitterId'){ } else if (requester === 'twitterId') {
body.twitter_id = value; body.twitter_id = value;
} else if (requester === 'uniqueExternalId'){ } else if (requester === 'uniqueExternalId') {
body.unique_external_id = value; body.unique_external_id = value;
} }
@ -782,5 +782,5 @@ export class Freshdesk implements INodeType {
return { return {
json: response json: response
}; };
} }
} }

View file

@ -11,14 +11,14 @@ import {
import * as _ from 'lodash'; import * as _ from 'lodash';
export async function freshdeskApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, resource: string, method: string, body: any = {}, headers?: object): Promise<any> { // tslint:disable-line:no-any export async function freshdeskApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, resource: string, method: string, body: any = {}, headers?: object): Promise<any> { // tslint:disable-line:no-any
const credentials = this.getCredentials('freshdeskApi'); const credentials = this.getCredentials('freshdeskApi');
if (credentials === undefined) { if (credentials === undefined) {
throw new Error('No credentials got returned!'); throw new Error('No credentials got returned!');
} }
const apiKey = `${credentials.apiKey}:X`; const apiKey = `${credentials.apiKey}:X`;
const headerWithAuthentication = Object.assign({}, headers, { Authorization: `${Buffer.from(apiKey).toString(BINARY_ENCODING)}` }); const headerWithAuthentication = Object.assign({}, headers, { Authorization: `${Buffer.from(apiKey).toString(BINARY_ENCODING)}` });
@ -60,7 +60,7 @@ export function validateJSON(json: string | undefined): any { // tslint:disable-
return result; return result;
} }
export function capitalize (s: string) : string { export function capitalize(s: string): string {
if (typeof s !== 'string') return ''; if (typeof s !== 'string') return '';
return s.charAt(0).toUpperCase() + s.slice(1); return s.charAt(0).toUpperCase() + s.slice(1);
} }