refactor: Remove unnecessary console.log in nodes (no-changelog) (#11915)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-11-27 15:53:07 +01:00
committed by GitHub
parent 683ee42d3b
commit ddda0bde0b
7 changed files with 15 additions and 21 deletions

View File

@@ -94,7 +94,7 @@ export class DocumentGithubLoader implements INodeType {
}; };
async supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> { async supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {
console.log('Supplying data for Github Document Loader'); this.logger.debug('Supplying data for Github Document Loader');
const repository = this.getNodeParameter('repository', itemIndex) as string; const repository = this.getNodeParameter('repository', itemIndex) as string;
const branch = this.getNodeParameter('branch', itemIndex) as string; const branch = this.getNodeParameter('branch', itemIndex) as string;

View File

@@ -330,7 +330,7 @@ export class Aws implements ICredentialType {
endpoint.searchParams.set('Version', '2011-06-15'); endpoint.searchParams.set('Version', '2011-06-15');
} }
} catch (err) { } catch (err) {
console.log(err); console.error(err);
} }
} }
const parsed = parseAwsUrl(endpoint); const parsed = parseAwsUrl(endpoint);
@@ -372,7 +372,7 @@ export class Aws implements ICredentialType {
customUrl.searchParams.set('Action', 'GetCallerIdentity'); customUrl.searchParams.set('Action', 'GetCallerIdentity');
customUrl.searchParams.set('Version', '2011-06-15'); customUrl.searchParams.set('Version', '2011-06-15');
} catch (err) { } catch (err) {
console.log(err); console.error(err);
} }
} }
endpoint = customUrl; endpoint = customUrl;
@@ -411,7 +411,7 @@ export class Aws implements ICredentialType {
try { try {
sign(signOpts, securityHeaders); sign(signOpts, securityHeaders);
} catch (err) { } catch (err) {
console.log(err); console.error(err);
} }
const options: IHttpRequestOptions = { const options: IHttpRequestOptions = {
...requestOptions, ...requestOptions,

View File

@@ -7,7 +7,7 @@ export const runGarbageCollector = () => {
const gc = runInNewContext('gc'); // nocommit const gc = runInNewContext('gc'); // nocommit
gc(); gc();
} catch (error) { } catch (error) {
console.log(error); console.error(error);
} }
}; };
@@ -23,8 +23,5 @@ export const generateGarbageMemory = (sizeInMB: number, onHeap = true) => {
const array = new Uint8Array(size); const array = new Uint8Array(size);
array.fill(0); array.fill(0);
} }
// const used = process.memoryUsage().heapUsed / 1024 / 1024;
// const external = process.memoryUsage().external / 1024 / 1024;
// console.log(`heap: ${used} MB / external: ${external} MB`);
return { ...process.memoryUsage() }; return { ...process.memoryUsage() };
}; };

View File

@@ -99,7 +99,7 @@ export async function haloPSAApiRequest(
if (method === 'DELETE' || method === 'GET' || (method === 'POST' && message)) { if (method === 'DELETE' || method === 'GET' || (method === 'POST' && message)) {
let newErrorMessage; let newErrorMessage;
if (message.includes('400')) { if (message.includes('400')) {
console.log(message); this.logger.debug(message);
newErrorMessage = JSON.parse(message.split(' - ')[1]); newErrorMessage = JSON.parse(message.split(' - ')[1]);
(error as JsonObject).message = `For field ID, ${ (error as JsonObject).message = `For field ID, ${
newErrorMessage.id || newErrorMessage['[0].id'] newErrorMessage.id || newErrorMessage['[0].id']
@@ -136,14 +136,14 @@ export async function haloPSAApiRequest(
// )) as IDataObject; // )) as IDataObject;
// const { tickets } = response; // const { tickets } = response;
// console.log((tickets as IDataObject[]).map(t => t.id)); // this.logger.debug((tickets as IDataObject[]).map(t => t.id));
// const body: IDataObject = { // const body: IDataObject = {
// id: clientId, // id: clientId,
// client_id: reasigmentCliendId, // client_id: reasigmentCliendId,
// }; // };
// for (const ticket of (tickets as IDataObject[])) { // for (const ticket of (tickets as IDataObject[])) {
// console.log(ticket.id); // this.logger.debug(ticket.id);
// await haloPSAApiRequest.call(this, 'DELETE', `/tickets/${ticket.id}`, accessToken); // await haloPSAApiRequest.call(this, 'DELETE', `/tickets/${ticket.id}`, accessToken);
// } // }
// } // }

View File

@@ -129,7 +129,7 @@ export class Ldap implements INodeType {
await client.bind(credentials.bindDN as string, credentials.bindPassword as string); await client.bind(credentials.bindDN as string, credentials.bindPassword as string);
} catch (error) { } catch (error) {
await client.unbind(); await client.unbind();
console.log(error); this.logger.error(error);
return []; return [];
} }
@@ -138,7 +138,7 @@ export class Ldap implements INodeType {
try { try {
results = await client.search(baseDN, { sizeLimit: 200, paged: false }); // should this size limit be set in credentials? results = await client.search(baseDN, { sizeLimit: 200, paged: false }); // should this size limit be set in credentials?
} catch (error) { } catch (error) {
console.log(error); this.logger.error(error);
return []; return [];
} finally { } finally {
await client.unbind(); await client.unbind();
@@ -158,7 +158,7 @@ export class Ldap implements INodeType {
await client.bind(credentials.bindDN as string, credentials.bindPassword as string); await client.bind(credentials.bindDN as string, credentials.bindPassword as string);
} catch (error) { } catch (error) {
await client.unbind(); await client.unbind();
console.log(error); this.logger.error(error);
return []; return [];
} }
@@ -168,7 +168,7 @@ export class Ldap implements INodeType {
try { try {
results = await client.search(baseDN, { sizeLimit: 10, paged: false }); // should this size limit be set in credentials? results = await client.search(baseDN, { sizeLimit: 10, paged: false }); // should this size limit be set in credentials?
} catch (error) { } catch (error) {
console.log(error); this.logger.error(error);
return []; return [];
} finally { } finally {
await client.unbind(); await client.unbind();
@@ -202,7 +202,7 @@ export class Ldap implements INodeType {
await client.bind(credentials.bindDN as string, credentials.bindPassword as string); await client.bind(credentials.bindDN as string, credentials.bindPassword as string);
} catch (error) { } catch (error) {
await client.unbind(); await client.unbind();
console.log(error); this.logger.error(error);
return []; return [];
} }
@@ -211,7 +211,7 @@ export class Ldap implements INodeType {
try { try {
results = await client.search(baseDN, { sizeLimit: 1, paged: false }); results = await client.search(baseDN, { sizeLimit: 1, paged: false });
} catch (error) { } catch (error) {
console.log(error); this.logger.error(error);
return []; return [];
} finally { } finally {
await client.unbind(); await client.unbind();

View File

@@ -1039,7 +1039,7 @@ export class Salesforce implements INodeType {
// async getFolders(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> { // async getFolders(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
// const returnData: INodePropertyOptions[] = []; // const returnData: INodePropertyOptions[] = [];
// const fields = await salesforceApiRequestAllItems.call(this, 'records', 'GET', '/sobjects/folder/describe'); // const fields = await salesforceApiRequestAllItems.call(this, 'records', 'GET', '/sobjects/folder/describe');
// console.log(JSON.stringify(fields, undefined, 2)) // this.logger.debug(JSON.stringify(fields, undefined, 2))
// const qs = { // const qs = {
// //ContentFolderItem ContentWorkspace ContentFolder // //ContentFolderItem ContentWorkspace ContentFolder
// q: `SELECT Id, Title FROM ContentVersion`, // q: `SELECT Id, Title FROM ContentVersion`,

View File

@@ -31,7 +31,6 @@ export async function webflowApiRequest(
// Keep support for v1 node // Keep support for v1 node
if (this.getNode().typeVersion === 1) { if (this.getNode().typeVersion === 1) {
console.log('v1');
const authenticationMethod = this.getNodeParameter('authentication', 0, 'accessToken'); const authenticationMethod = this.getNodeParameter('authentication', 0, 'accessToken');
if (authenticationMethod === 'accessToken') { if (authenticationMethod === 'accessToken') {
credentialsType = 'webflowApi'; credentialsType = 'webflowApi';
@@ -81,8 +80,6 @@ export async function getSites(this: ILoadOptionsFunctions): Promise<INodeProper
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const response = await webflowApiRequest.call(this, 'GET', '/sites'); const response = await webflowApiRequest.call(this, 'GET', '/sites');
console.log(response);
const sites = response.body?.sites || response; const sites = response.body?.sites || response;
for (const site of sites) { for (const site of sites) {