ci: Fix linting issues on master (no-changelog) (#5030)

* make CI logs less noisy. suppress linting warning

* fix linting issues
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2022-12-23 19:09:52 +01:00 committed by GitHub
parent a8f4efaf3e
commit a229788d4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
131 changed files with 177 additions and 173 deletions

View file

@ -24,7 +24,7 @@
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && node scripts/build.mjs",
"dev": "concurrently -k -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold\" \"npm run watch\" \"nodemon\"",
"format": "prettier --write . --ignore-path ../../.prettierignore",
"lint": "eslint .",
"lint": "eslint --quiet .",
"lintfix": "eslint . --fix",
"postpack": "rm -f oclif.manifest.json",
"prepack": "oclif-dev manifest",

View file

@ -24,7 +24,7 @@
"build": "tsc -p tsconfig.build.json",
"dev": "pnpm watch",
"format": "prettier --write . --ignore-path ../../.prettierignore",
"lint": "eslint .",
"lint": "eslint --quiet .",
"lintfix": "eslint . --fix",
"watch": "tsc -p tsconfig.build.json --watch",
"test": "jest"

View file

@ -22,7 +22,7 @@
"build:storybook": "build-storybook",
"storybook": "start-storybook -p 6006",
"format": "prettier --write . --ignore-path ../../.prettierignore",
"lint": "eslint --ext .js,.ts,.vue src",
"lint": "eslint --quiet --ext .js,.ts,.vue src",
"lintfix": "eslint --ext .js,.ts,.vue src --fix"
},
"peerDependencies": {

View file

@ -18,7 +18,7 @@
"build": "cross-env VUE_APP_PUBLIC_PATH=\"/{{BASE_PATH}}/\" NODE_OPTIONS=\"--max-old-space-size=8192\" vite build",
"typecheck": "vue-tsc --emitDeclarationOnly",
"dev": "pnpm serve",
"lint": "eslint --ext .js,.ts,.vue src",
"lint": "eslint --quiet --ext .js,.ts,.vue src",
"lintfix": "eslint --ext .js,.ts,.vue src --fix",
"format": "prettier --write . --ignore-path ../../.prettierignore",
"serve": "cross-env VUE_APP_URL_BASE_API=http://localhost:5678/ vite --host 0.0.0.0 --port 8080 dev",

View file

@ -24,7 +24,7 @@
"build": "tsc --noEmit",
"build-node-dev": "tsc",
"format": "prettier --write . --ignore-path ../../.prettierignore",
"lint": "eslint .",
"lint": "eslint --quiet .",
"lintfix": "eslint . --fix",
"postpack": "rm -f oclif.manifest.json",
"prepack": "echo \"Building project...\" && rm -rf dist && tsc -b && oclif-dev manifest",

View file

@ -45,10 +45,10 @@ export async function acuitySchedulingApiRequest(
password: credentials.apiKey as string,
};
return await this.helpers.request!(options);
return await this.helpers.request(options);
} else {
delete options.auth;
return await this.helpers.requestOAuth2!.call(
return await this.helpers.requestOAuth2.call(
this,
'acuitySchedulingOAuth2Api',
options,

View file

@ -38,7 +38,7 @@ export async function affinityApiRequest(
}
options = Object.assign({}, options, option);
try {
return this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -48,7 +48,7 @@ export async function agileCrmApiRequest(
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}
@ -126,7 +126,7 @@ export async function agileCrmApiRequestUpdate(
if (payload.properties) {
options.body.properties = payload.properties;
options.uri = baseUri + 'api/contacts/edit-properties';
lastSuccesfulUpdateReturn = await this.helpers.request!(options);
lastSuccesfulUpdateReturn = await this.helpers.request(options);
// Iterate trough properties and show them as individial updates instead of only vague "properties"
payload.properties?.map((property: any) => {
@ -138,7 +138,7 @@ export async function agileCrmApiRequestUpdate(
if (payload.lead_score) {
options.body.lead_score = payload.lead_score;
options.uri = baseUri + 'api/contacts/edit/lead-score';
lastSuccesfulUpdateReturn = await this.helpers.request!(options);
lastSuccesfulUpdateReturn = await this.helpers.request(options);
successfulUpdates.push('lead_score');
@ -147,7 +147,7 @@ export async function agileCrmApiRequestUpdate(
if (body.tags) {
options.body.tags = payload.tags;
options.uri = baseUri + 'api/contacts/edit/tags';
lastSuccesfulUpdateReturn = await this.helpers.request!(options);
lastSuccesfulUpdateReturn = await this.helpers.request(options);
payload.tags?.map((tag: string) => {
successfulUpdates.push(`(Tag) ${tag}`);
@ -158,7 +158,7 @@ export async function agileCrmApiRequestUpdate(
if (body.star_value) {
options.body.star_value = payload.star_value;
options.uri = baseUri + 'api/contacts/edit/add-star';
lastSuccesfulUpdateReturn = await this.helpers.request!(options);
lastSuccesfulUpdateReturn = await this.helpers.request(options);
successfulUpdates.push('star_value');

View file

@ -39,7 +39,7 @@ export async function autopilotApiRequest(
}
try {
return this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -173,7 +173,7 @@ export async function validateCredentials(
body: signOpts.body,
};
const response = await this.helpers.request!(options);
const response = await this.helpers.request(options);
return new Promise((resolve, reject) => {
parseString(response, { explicitArray: false }, (err, data) => {

View file

@ -63,7 +63,7 @@ export async function awsApiRequest(
};
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error); // no XML parsing needed
}

View file

@ -37,7 +37,7 @@ export async function bannerbearApiRequest(
}
options.headers = Object.assign({}, options.headers, headers);
try {
return this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -39,7 +39,7 @@ export async function baserowApiRequest(
}
try {
return this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}
@ -97,7 +97,7 @@ export async function getJwtToken(
};
try {
const { token } = (await this.helpers.request!(options)) as { token: string };
const { token } = (await this.helpers.request(options)) as { token: string };
return token;
} catch (error) {
throw new NodeApiError(this.getNode(), error);

View file

@ -35,7 +35,7 @@ export async function bitbucketApiRequest(
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -38,9 +38,9 @@ export async function bitlyApiRequest(
const credentials = await this.getCredentials('bitlyApi');
options.headers = { Authorization: `Bearer ${credentials.accessToken}` };
return await this.helpers.request!(options);
return await this.helpers.request(options);
} else {
return await this.helpers.requestOAuth2!.call(this, 'bitlyOAuth2Api', options, {
return await this.helpers.requestOAuth2.call(this, 'bitlyOAuth2Api', options, {
tokenType: 'Bearer',
});
}

View file

@ -43,7 +43,7 @@ export async function bitwardenApiRequest(
}
try {
return this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}
@ -76,7 +76,7 @@ export async function getAccessToken(
};
try {
const { access_token } = await this.helpers.request!(options);
const { access_token } = await this.helpers.request(options);
return access_token;
} catch (error) {
throw new NodeApiError(this.getNode(), error);

View file

@ -45,7 +45,7 @@ export async function brandfetchApiRequest(
delete options.qs;
}
const response = await this.helpers.request!(options);
const response = await this.helpers.request(options);
if (response.statusCode && response.statusCode !== 200) {
throw new NodeApiError(this.getNode(), response);

View file

@ -48,7 +48,7 @@ export async function bubbleApiRequest(
}
try {
return this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -89,5 +89,5 @@ export async function validateCredentials(
uri: 'https://calendly.com/api/v1/users/me',
});
}
return this.helpers.request!(options);
return this.helpers.request(options);
}

View file

@ -36,7 +36,7 @@ export async function circleciApiRequest(
delete options.body;
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -42,7 +42,7 @@ export async function webexApiRequest(
delete options.qs;
}
//@ts-ignore
return this.helpers.requestOAuth2.call(this, 'ciscoWebexOAuth2Api', options, {
return await this.helpers.requestOAuth2.call(this, 'ciscoWebexOAuth2Api', options, {
tokenType: 'Bearer',
});
} catch (error) {

View file

@ -35,7 +35,7 @@ export async function citrixADCApiRequest(
options = Object.assign({}, options, option);
try {
return this.helpers.requestWithAuthentication.call(this, 'citrixAdcApi', options);
return await this.helpers.requestWithAuthentication.call(this, 'citrixAdcApi', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);
}

View file

@ -34,7 +34,7 @@ export async function clearbitApiRequest(
delete options.body;
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -47,7 +47,7 @@ export async function clickupApiRequest(
tokenType: 'Bearer',
};
// @ts-ignore
return await this.helpers.requestOAuth2!.call(
return await this.helpers.requestOAuth2.call(
this,
'clickUpOAuth2Api',
options,

View file

@ -33,7 +33,7 @@ export async function cockpitApiRequest(
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -28,7 +28,7 @@ export async function codaApiRequest(
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -33,7 +33,7 @@ export async function contentfulApiRequest(
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -45,7 +45,7 @@ export async function convertKitApiRequest(
}
try {
return this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -65,7 +65,7 @@ export async function copperApiRequest(
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -35,7 +35,7 @@ export async function demioApiRequest(
options = Object.assign({}, options, option);
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -42,7 +42,7 @@ export async function dhlApiRequest(
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}
@ -70,5 +70,5 @@ export async function validateCredentials(
json: true,
};
return this.helpers.request!(options);
return this.helpers.request(options);
}

View file

@ -42,7 +42,7 @@ export async function disqusApiRequest(
delete options.body;
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -39,9 +39,9 @@ export async function driftApiRequest(
options.headers!.Authorization = `Bearer ${credentials.accessToken}`;
return this.helpers.request!(options);
return await this.helpers.request(options);
} else {
return this.helpers.requestOAuth2!.call(this, 'driftOAuth2Api', options);
return await this.helpers.requestOAuth2.call(this, 'driftOAuth2Api', options);
}
} catch (error) {
throw new NodeApiError(this.getNode(), error);

View file

@ -39,7 +39,7 @@ export async function erpNextApiRequest(
delete options.qs;
}
try {
return this.helpers.requestWithAuthentication.call(this, 'erpNextApi', options);
return await this.helpers.requestWithAuthentication.call(this, 'erpNextApi', options);
} catch (error) {
if (error.statusCode === 403) {
throw new NodeApiError(this.getNode(), { message: 'DocType unavailable.' });

View file

@ -55,7 +55,7 @@ export async function egoiApiRequest(
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -44,7 +44,7 @@ export async function elasticSecurityApiRequest(
}
try {
return this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
if (error?.error?.error === 'Not Acceptable' && error?.error?.message) {
error.error.error = `${error.error.error}: ${error.error.message}`;

View file

@ -50,7 +50,7 @@ export async function emeliaApiRequest(
};
try {
return this.helpers.request!.call(this, options);
return await this.helpers.request.call(this, options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);
}
@ -129,7 +129,7 @@ export async function emeliaApiTest(
};
try {
await this.helpers.request!(options);
await this.helpers.request(options);
} catch (error) {
return {
status: 'Error',

View file

@ -45,9 +45,9 @@ export async function eventbriteApiRequest(
const credentials = await this.getCredentials('eventbriteApi');
options.headers!.Authorization = `Bearer ${credentials.apiKey}`;
return await this.helpers.request!(options);
return await this.helpers.request(options);
} else {
return await this.helpers.requestOAuth2!.call(this, 'eventbriteOAuth2Api', options);
return await this.helpers.requestOAuth2.call(this, 'eventbriteOAuth2Api', options);
}
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -50,7 +50,7 @@ export async function facebookApiRequest(
};
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -33,7 +33,7 @@ export async function figmaApiRequest(
delete options.body;
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -48,7 +48,7 @@ export async function layoutsApiRequest(
};
try {
const responseData = await this.helpers.request!(options);
const responseData = await this.helpers.request(options);
const items = parseLayouts(responseData.response.layouts);
items.sort((a, b) => (a.name > b.name ? 0 : 1));
return items;
@ -95,7 +95,7 @@ export async function getFields(this: ILoadOptionsFunctions): Promise<any> {
};
try {
const responseData = await this.helpers.request!(options);
const responseData = await this.helpers.request(options);
return responseData.response.fieldMetaData;
} catch (error) {
// If that data does not exist for some reason return the actual error
@ -126,7 +126,7 @@ export async function getPortals(this: ILoadOptionsFunctions): Promise<any> {
};
try {
const responseData = await this.helpers.request!(options);
const responseData = await this.helpers.request(options);
return responseData.response.portalMetaData;
} catch (error) {
// If that data does not exist for some reason return the actual error
@ -156,7 +156,7 @@ export async function getScripts(this: ILoadOptionsFunctions): Promise<any> {
};
try {
const responseData = await this.helpers.request!(options);
const responseData = await this.helpers.request(options);
const items = parseScriptsList(responseData.response.scripts);
items.sort((a, b) => (a.name > b.name ? 0 : 1));
return items;
@ -216,7 +216,7 @@ export async function getToken(
};
try {
const response = await this.helpers.request!(requestOptions);
const response = await this.helpers.request(requestOptions);
if (typeof response === 'string') {
throw new NodeOperationError(
@ -252,7 +252,7 @@ export async function logout(
};
try {
const response = await this.helpers.request!(requestOptions);
const response = await this.helpers.request(requestOptions);
if (typeof response === 'string') {
throw new NodeOperationError(

View file

@ -33,7 +33,7 @@ export async function flowApiRequest(
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -34,7 +34,7 @@ async function getToken(
};
try {
const responseObject = await this.helpers.request!(options);
const responseObject = await this.helpers.request(options);
return responseObject.headers['x-jwt-token'];
} catch (error) {
throw new Error(
@ -72,7 +72,7 @@ export async function formIoApiRequest(
};
try {
return this.helpers.request!.call(this, options);
return await this.helpers.request.call(this, options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -74,9 +74,9 @@ export async function apiRequest(
const credentials = (await this.getCredentials('formstackApi')) as IDataObject;
options.headers!.Authorization = `Bearer ${credentials.accessToken}`;
return await this.helpers.request!(options);
return await this.helpers.request(options);
} else {
return await this.helpers.requestOAuth2!.call(this, 'formstackOAuth2Api', options);
return await this.helpers.requestOAuth2.call(this, 'formstackOAuth2Api', options);
}
} catch (error) {
throw new NodeApiError(this.getNode(), error);

View file

@ -39,7 +39,7 @@ export async function freshdeskApiRequest(
}
options = Object.assign({}, options, option);
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -45,7 +45,7 @@ export async function freshserviceApiRequest(
}
try {
return this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
if (error.error.description === 'Validation failed') {
const numberOfErrors = error.error.errors.length;

View file

@ -57,7 +57,7 @@ export async function goToWebinarApiRequest(
}
try {
const response = await this.helpers.requestOAuth2!.call(this, 'goToWebinarOAuth2Api', options, {
const response = await this.helpers.requestOAuth2.call(this, 'goToWebinarOAuth2Api', options, {
tokenExpiredStatusCode: 403,
});

View file

@ -52,7 +52,7 @@ export async function googleApiRequest(
const { access_token } = await getAccessToken.call(this, credentials as IDataObject);
options.headers!.Authorization = `Bearer ${access_token}`;
return await this.helpers.request!(options);
return await this.helpers.request(options);
} else {
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'googleBigQueryOAuth2Api', options);
@ -134,7 +134,7 @@ async function getAccessToken(
json: true,
};
return this.helpers.request!(options);
return this.helpers.request(options);
}
export function simplify(rows: IDataObject[], fields: string[]) {

View file

@ -143,5 +143,5 @@ async function getAccessToken(
json: true,
};
return this.helpers.request!(options);
return this.helpers.request(options);
}

View file

@ -40,7 +40,7 @@ export async function googleApiRequest(
delete options.body;
}
//@ts-ignore
return this.helpers.requestOAuth2.call(this, 'googleCalendarOAuth2Api', options);
return await this.helpers.requestOAuth2.call(this, 'googleCalendarOAuth2Api', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -154,7 +154,7 @@ export async function getAccessToken(
json: true,
};
return this.helpers.request!(options);
return this.helpers.request(options);
}
export function validateJSON(json: string | undefined): any {

View file

@ -53,7 +53,7 @@ export async function googleApiRequest(
);
options.headers!.Authorization = `Bearer ${access_token}`;
return await this.helpers.request!(options);
return await this.helpers.request(options);
} else {
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'googleDocsOAuth2Api', options);
@ -138,7 +138,7 @@ async function getAccessToken(
json: true,
};
return this.helpers.request!(options);
return this.helpers.request(options);
}
export const hasKeys = (obj = {}) => Object.keys(obj).length > 0;

View file

@ -58,10 +58,10 @@ export async function googleApiRequest(
);
options.headers!.Authorization = `Bearer ${access_token}`;
return this.helpers.request!(options);
return await this.helpers.request(options);
} else {
//@ts-ignore
return this.helpers.requestOAuth2.call(this, 'googleDriveOAuth2Api', options);
return await this.helpers.requestOAuth2.call(this, 'googleDriveOAuth2Api', options);
}
} catch (error) {
if (error.code === 'ERR_OSSL_PEM_NO_START_LINE') {
@ -145,7 +145,7 @@ async function getAccessToken(
json: true,
};
return this.helpers.request!(options);
return this.helpers.request(options);
}
export function extractId(url: string): string {

View file

@ -38,7 +38,7 @@ export async function googleApiRequest(
delete options.body;
}
return await this.helpers.requestOAuth2!.call(
return await this.helpers.requestOAuth2.call(
this,
'googleFirebaseRealtimeDatabaseOAuth2Api',
options,

View file

@ -347,7 +347,7 @@ async function getAccessToken(
json: true,
};
return this.helpers.request!(options);
return this.helpers.request(options);
}
export function prepareQuery(

View file

@ -149,7 +149,7 @@ export async function getAccessToken(
json: true,
};
return this.helpers.request!(options);
return this.helpers.request(options);
}
// Hex to RGB

View file

@ -53,9 +53,9 @@ export async function apiRequest(
options.headers!.Authorization = `Bearer ${access_token}`;
return await this.helpers.request!(options);
return await this.helpers.request(options);
} else {
return await this.helpers.requestOAuth2!.call(this, 'googleSheetsOAuth2Api', options);
return await this.helpers.requestOAuth2.call(this, 'googleSheetsOAuth2Api', options);
}
} catch (error) {
if (error.code === 'ERR_OSSL_PEM_NO_START_LINE') {
@ -150,5 +150,5 @@ export async function getAccessToken(
json: true,
};
return this.helpers.request!(options);
return this.helpers.request(options);
}

View file

@ -55,9 +55,9 @@ export async function googleApiRequest(
credentials as unknown as IGoogleAuthCredentials,
);
options.headers.Authorization = `Bearer ${access_token}`;
return await this.helpers.request!(options);
return await this.helpers.request(options);
} else {
return await this.helpers.requestOAuth2!.call(this, 'googleSlidesOAuth2Api', options);
return await this.helpers.requestOAuth2.call(this, 'googleSlidesOAuth2Api', options);
}
} catch (error) {
if (error.code === 'ERR_OSSL_PEM_NO_START_LINE') {
@ -117,5 +117,5 @@ async function getAccessToken(
json: true,
};
return this.helpers.request!(options);
return this.helpers.request(options);
}

View file

@ -140,5 +140,5 @@ async function getAccessToken(
json: true,
};
return this.helpers.request!(options);
return this.helpers.request(options);
}

View file

@ -49,7 +49,7 @@ export async function gristApiRequest(
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -39,7 +39,7 @@ export async function gumroadApiRequest(
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -22,7 +22,7 @@ export async function hackerNewsApiRequest(
};
try {
return this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -46,7 +46,7 @@ export async function getAccessTokens(
};
try {
const tokens = await this.helpers.request!(options);
const tokens = await this.helpers.request(options);
return tokens;
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);
@ -89,7 +89,7 @@ export async function haloPSAApiRequest(
if (Object.keys(body).length === 0) {
delete options.body;
}
const result = await this.helpers.request!(options);
const result = await this.helpers.request(options);
if (method === 'DELETE' && result.id) {
return { success: true };
}
@ -246,5 +246,5 @@ export async function validateCredentials(
json: true,
};
return (await this.helpers.request!(options)) as IHaloPSATokens;
return (await this.helpers.request(options)) as IHaloPSATokens;
}

View file

@ -44,9 +44,9 @@ export async function harvestApiRequest(
//@ts-ignore
options.headers.Authorization = `Bearer ${credentials.accessToken}`;
return await this.helpers.request!(options);
return await this.helpers.request(options);
} else {
return await this.helpers.requestOAuth2!.call(this, 'harvestOAuth2Api', options);
return await this.helpers.requestOAuth2.call(this, 'harvestOAuth2Api', options);
}
} catch (error) {
throw new NodeApiError(this.getNode(), error);

View file

@ -50,15 +50,15 @@ export async function hubspotApiRequest(
if (endpoint.includes('webhooks')) {
const credentials = await this.getCredentials('hubspotDeveloperApi');
options.qs.hapikey = credentials.apiKey as string;
return await this.helpers.request!(options);
return await this.helpers.request(options);
} else {
return await this.helpers.requestOAuth2!.call(this, 'hubspotDeveloperApi', options, {
return await this.helpers.requestOAuth2.call(this, 'hubspotDeveloperApi', options, {
tokenType: 'Bearer',
includeCredentialsOnRefreshOnBody: true,
});
}
} else {
return await this.helpers.requestOAuth2!.call(this, 'hubspotOAuth2Api', options, {
return await this.helpers.requestOAuth2.call(this, 'hubspotOAuth2Api', options, {
tokenType: 'Bearer',
includeCredentialsOnRefreshOnBody: true,
});

View file

@ -38,7 +38,7 @@ export async function humanticAiApiRequest(
delete options.body;
}
const response = await this.helpers.request!(options);
const response = await this.helpers.request(options);
if (response.data && response.data.status === 'error') {
throw new NodeApiError(this.getNode(), response.data);

View file

@ -31,7 +31,7 @@ export async function hunterApiRequest(
delete options.body;
}
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -35,7 +35,7 @@ export async function intercomApiRequest(
};
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -35,7 +35,7 @@ export async function jenkinsApiRequest(
};
options = Object.assign({}, options, option);
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -41,7 +41,7 @@ export async function jotformApiRequest(
options = Object.assign({}, options, option);
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -20,7 +20,7 @@ export async function kitemakerRequest(
json: true,
};
const responseData = await this.helpers.request!.call(this, options);
const responseData = await this.helpers.request.call(this, options);
if (responseData.errors) {
throw new NodeApiError(this.getNode(), responseData);

View file

@ -38,7 +38,7 @@ export async function linearApiRequest(
};
options = Object.assign({}, options, option);
try {
return this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);
}
@ -90,7 +90,7 @@ export async function validateCredentials(
json: true,
};
return this.helpers.request!(options);
return this.helpers.request(options);
}
//@ts-ignore

View file

@ -34,7 +34,7 @@ export async function lingvaNexApiRequest(
options = Object.assign({}, options, option);
const response = await this.helpers.request!(options);
const response = await this.helpers.request(options);
if (response.err !== null) {
throw new NodeApiError(this.getNode(), response);

View file

@ -34,7 +34,7 @@ export async function linkedInApiRequest(
}
try {
return await this.helpers.requestOAuth2!.call(this, 'linkedInOAuth2Api', options, {
return await this.helpers.requestOAuth2.call(this, 'linkedInOAuth2Api', options, {
tokenType: 'Bearer',
});
} catch (error) {

View file

@ -41,7 +41,7 @@ export async function mailCheckApiRequest(
if (Object.keys(body).length === 0) {
delete options.body;
}
return await this.helpers.request!.call(this, options);
return await this.helpers.request.call(this, options);
} catch (error) {
if (error.response?.body?.message) {
// Try to return the error prettier

View file

@ -56,7 +56,7 @@ export async function mailchimpApiRequest(
options.url = `${api_endpoint}/3.0${endpoint}`;
//@ts-ignore
return await this.helpers.requestOAuth2!.call(this, 'mailchimpOAuth2Api', options, {
return await this.helpers.requestOAuth2.call(this, 'mailchimpOAuth2Api', options, {
tokenType: 'Bearer',
});
}
@ -114,7 +114,7 @@ async function getMetadata(
url: credentials.metadataUrl as string,
json: true,
};
return this.helpers.request!(options);
return this.helpers.request(options);
}
export const campaignFieldsMetadata = [

View file

@ -29,7 +29,7 @@ export async function mandrillApiRequest(
};
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -41,7 +41,7 @@ export async function matrixApiRequest(
option.overridePrefix || 'client'
}/r0${resource}`;
options.headers!.Authorization = `Bearer ${credentials.accessToken}`;
const response = await this.helpers.request!(options);
const response = await this.helpers.request(options);
// When working with images, the request cannot be JSON (it's raw binary data)
// But the output is JSON so we have to parse it manually.

View file

@ -39,9 +39,9 @@ export async function mediumApiRequest(
options.headers!.Authorization = `Bearer ${credentials.accessToken}`;
return await this.helpers.request!(options);
return await this.helpers.request(options);
} else {
return await this.helpers.requestOAuth2!.call(this, 'mediumOAuth2Api', options);
return await this.helpers.requestOAuth2.call(this, 'mediumOAuth2Api', options);
}
} catch (error) {
throw new NodeApiError(this.getNode(), error);

View file

@ -32,7 +32,7 @@ export async function microsoftApiRequest(
delete options.body;
}
//@ts-ignore
return this.helpers.requestOAuth2.call(this, 'microsoftToDoOAuth2Api', options);
return await this.helpers.requestOAuth2.call(this, 'microsoftToDoOAuth2Api', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -40,7 +40,7 @@ export async function mispApiRequest(
}
try {
return this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
// MISP API wrongly returns 403 for malformed requests
if (error.statusCode === 403) {

View file

@ -200,7 +200,7 @@ export class Mocean implements INodeType {
json: true,
};
try {
await this.helpers.request!(options);
await this.helpers.request(options);
} catch (error) {
return {
status: 'Error',

View file

@ -32,9 +32,9 @@ export async function mondayComApiRequest(
options.headers = { Authorization: `Bearer ${credentials.apiToken}` };
return this.helpers.request!(options);
return await this.helpers.request(options);
} else {
return this.helpers.requestOAuth2!.call(this, 'mondayComOAuth2Api', options);
return await this.helpers.requestOAuth2.call(this, 'mondayComOAuth2Api', options);
}
} catch (error) {
throw new NodeApiError(this.getNode(), error);

View file

@ -49,7 +49,7 @@ export async function monicaCrmApiRequest(
}
try {
return this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -44,7 +44,7 @@ export async function apiRequest(
};
try {
return this.helpers.requestWithAuthentication.call(this, 'n8nApi', options);
return await this.helpers.requestWithAuthentication.call(this, 'n8nApi', options);
} catch (error) {
if (error instanceof NodeApiError) {
throw error;

View file

@ -43,7 +43,7 @@ export async function netlifyApiRequest(
options.headers!.Authorization = `Bearer ${credentials.accessToken}`;
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -61,9 +61,9 @@ export async function notionApiRequest(
delete options.body;
}
if (!uri) {
return this.helpers.requestWithAuthentication.call(this, 'notionApi', options);
return await this.helpers.requestWithAuthentication.call(this, 'notionApi', options);
}
return this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -122,7 +122,7 @@ export async function odooJSONRPCRequest(
json: true,
};
const responce = await this.helpers.request!(options);
const responce = await this.helpers.request(options);
if (responce.error) {
throw new NodeApiError(this.getNode(), responce.error.data, {
message: responce.error.data.message,

View file

@ -269,7 +269,7 @@ export class Odoo implements INodeType {
uri: `${(credentials?.url as string).replace(/\/$/, '')}/jsonrpc`,
json: true,
};
const result = await this.helpers.request!(options);
const result = await this.helpers.request(options);
if (result.error || !result.result) {
return {
status: 'Error',

View file

@ -42,7 +42,7 @@ export async function onfleetApiRequest(
};
try {
//@ts-ignore
return this.helpers.request(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);
}

View file

@ -34,7 +34,7 @@ export async function openThesaurusApiRequest(
options = Object.assign({}, options, option);
options.qs.format = 'application/json';
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -36,7 +36,7 @@ export async function orbitApiRequest(
options = Object.assign({}, options, option);
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -41,7 +41,7 @@ export async function ouraApiRequest(
options = Object.assign({}, options, option);
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -43,7 +43,7 @@ export async function paddleApiRequest(
body.vendor_id = credentials.vendorId;
body.vendor_auth_code = credentials.vendorAuthCode;
try {
const response = await this.helpers.request!(options);
const response = await this.helpers.request(options);
if (!response.success) {
throw new NodeApiError(this.getNode(), response);

View file

@ -47,9 +47,9 @@ export async function pagerDutyApiRequest(
options.headers.Authorization = `Token token=${credentials.apiToken}`;
return this.helpers.request!(options);
return await this.helpers.request(options);
} else {
return this.helpers.requestOAuth2!.call(this, 'pagerDutyOAuth2Api', options);
return await this.helpers.requestOAuth2.call(this, 'pagerDutyOAuth2Api', options);
}
} catch (error) {
throw new NodeApiError(this.getNode(), error);

View file

@ -41,7 +41,7 @@ export async function payPalApiRequest(
json: true,
};
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}
@ -82,7 +82,7 @@ async function getAccessToken(
json: true,
};
try {
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeOperationError(this.getNode(), error);
}

View file

@ -113,7 +113,7 @@ export class PayPal implements INodeType {
};
try {
await this.helpers.request!(options);
await this.helpers.request(options);
return {
status: 'OK',
message: 'Authentication successful!',

View file

@ -34,7 +34,7 @@ export async function peekalinkApiRequest(
options = Object.assign({}, options, option);
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -34,7 +34,7 @@ export async function posthogApiRequest(
if (Object.keys(body).length === 0) {
delete options.body;
}
return await this.helpers.request!(options);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View file

@ -28,7 +28,7 @@ export async function postmarkApiRequest(
options = Object.assign({}, options, option);
try {
return this.helpers.requestWithAuthentication.call(this, 'postmarkApi', options);
return await this.helpers.requestWithAuthentication.call(this, 'postmarkApi', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

Some files were not shown because too many files have changed in this diff Show more