diff --git a/packages/nodes-base/.eslintrc.js b/packages/nodes-base/.eslintrc.js index 7934e2fc3818a..2edf1d7439730 100644 --- a/packages/nodes-base/.eslintrc.js +++ b/packages/nodes-base/.eslintrc.js @@ -29,6 +29,7 @@ module.exports = { '@typescript-eslint/restrict-template-expressions': 'off', //1152 errors, better to fix in separate PR '@typescript-eslint/unbound-method': 'off', '@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }], + '@typescript-eslint/prefer-nullish-coalescing': 'off', }, overrides: [ diff --git a/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts b/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts index 10229a2205f34..51e3981ed70d9 100644 --- a/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts +++ b/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts @@ -32,7 +32,7 @@ export async function acuitySchedulingApiRequest( method, qs, body, - uri: uri ?? `https://acuityscheduling.com/api/v1${resource}`, + uri: uri || `https://acuityscheduling.com/api/v1${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Affinity/GenericFunctions.ts b/packages/nodes-base/nodes/Affinity/GenericFunctions.ts index 60af6bfcbd0d7..8ebeac607b889 100644 --- a/packages/nodes-base/nodes/Affinity/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Affinity/GenericFunctions.ts @@ -27,7 +27,7 @@ export async function affinityApiRequest( method, body, qs: query, - uri: uri ?? `${endpoint}${resource}`, + uri: uri || `${endpoint}${resource}`, json: true, }; if (!Object.keys(body).length) { diff --git a/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts b/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts index 978ee238e98b9..576e5b696041c 100644 --- a/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts @@ -33,7 +33,7 @@ export async function agileCrmApiRequest( password: credentials.apiKey as string, }, qs: query, - uri: uri ?? `https://${credentials.subdomain}.agilecrm.com/dev/${endpoint}`, + uri: uri || `https://${credentials.subdomain}.agilecrm.com/dev/${endpoint}`, json: true, }; @@ -113,7 +113,7 @@ export async function agileCrmApiRequestUpdate( username: credentials.email as string, password: credentials.apiKey as string, }, - uri: uri ?? baseUri, + uri: uri || baseUri, json: true, }; diff --git a/packages/nodes-base/nodes/Airtable/GenericFunctions.ts b/packages/nodes-base/nodes/Airtable/GenericFunctions.ts index b71021970ccfa..3f24a79162a12 100644 --- a/packages/nodes-base/nodes/Airtable/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Airtable/GenericFunctions.ts @@ -34,7 +34,7 @@ export async function apiRequest( uri?: string, option: IDataObject = {}, ): Promise { - query = query ?? {}; + query = query || {}; // For some reason for some endpoints the bearer auth does not work // and it returns 404 like for the /meta request. So we always send @@ -46,7 +46,7 @@ export async function apiRequest( method, body, qs: query, - uri: uri ?? `https://api.airtable.com/v0/${endpoint}`, + uri: uri || `https://api.airtable.com/v0/${endpoint}`, useQuerystring: false, json: true, }; diff --git a/packages/nodes-base/nodes/ApiTemplateIo/ApiTemplateIo.node.ts b/packages/nodes-base/nodes/ApiTemplateIo/ApiTemplateIo.node.ts index c49917b183f2d..bbc583d339ae8 100644 --- a/packages/nodes-base/nodes/ApiTemplateIo/ApiTemplateIo.node.ts +++ b/packages/nodes-base/nodes/ApiTemplateIo/ApiTemplateIo.node.ts @@ -441,7 +441,7 @@ export class ApiTemplateIo implements INodeType { const fileName = responseData.download_url.split('/').pop(); const binaryData = await this.helpers.prepareBinaryData( data, - options.fileName ?? fileName, + options.fileName || fileName, ); responseData = { json: responseData, @@ -525,7 +525,7 @@ export class ApiTemplateIo implements INodeType { const fileName = responseData.download_url.split('/').pop(); const binaryData = await this.helpers.prepareBinaryData( imageData, - options.fileName ?? fileName, + options.fileName || fileName, ); responseData = { json: responseData, diff --git a/packages/nodes-base/nodes/Asana/GenericFunctions.ts b/packages/nodes-base/nodes/Asana/GenericFunctions.ts index cdb32e7faa55f..c120e64bfbf0d 100644 --- a/packages/nodes-base/nodes/Asana/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Asana/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function asanaApiRequest( method, body: { data: body }, qs: query, - url: uri ?? `https://app.asana.com/api/1.0${endpoint}`, + url: uri || `https://app.asana.com/api/1.0${endpoint}`, json: true, }; diff --git a/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts b/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts index 03a83feb27d22..a7b322c784c6a 100644 --- a/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function autopilotApiRequest( method, body, qs: query, - uri: uri ?? `${endpoint}${resource}`, + uri: uri || `${endpoint}${resource}`, json: true, }; if (!Object.keys(body).length) { diff --git a/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts index 782119747e148..f383c9de14e6c 100644 --- a/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts @@ -44,7 +44,7 @@ export async function awsApiRequest( const endpoint = new URL(getEndpointForService(service, credentials) + path); // Sign AWS API request with the user credentials - const signOpts = { headers: headers ?? {}, host: endpoint.host, method, path, body } as Request; + const signOpts = { headers: headers || {}, host: endpoint.host, method, path, body } as Request; const securityHeaders = { accessKeyId: `${credentials.accessKeyId}`.trim(), secretAccessKey: `${credentials.secretAccessKey}`.trim(), diff --git a/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts b/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts index a6e40f6750e1c..a9f3916305d44 100644 --- a/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts @@ -26,7 +26,7 @@ export async function bannerbearApiRequest( method, body, qs: query, - uri: uri ?? `https://api.bannerbear.com/v2${resource}`, + uri: uri || `https://api.bannerbear.com/v2${resource}`, json: true, }; if (!Object.keys(body).length) { diff --git a/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts b/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts index 23f06c90fd4a0..f55259febeb72 100644 --- a/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts @@ -26,7 +26,7 @@ export async function bitbucketApiRequest( }, qs, body, - uri: uri ?? `https://api.bitbucket.org/2.0${resource}`, + uri: uri || `https://api.bitbucket.org/2.0${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/Bitly/GenericFunctions.ts b/packages/nodes-base/nodes/Bitly/GenericFunctions.ts index 75d3a2b14a172..f29517a88c3ce 100644 --- a/packages/nodes-base/nodes/Bitly/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bitly/GenericFunctions.ts @@ -25,7 +25,7 @@ export async function bitlyApiRequest( method, qs, body, - uri: uri ?? `https://api-ssl.bitly.com/v4${resource}`, + uri: uri || `https://api-ssl.bitly.com/v4${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts b/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts index 4c8c3e0343d4a..fbb72d1dd3e77 100644 --- a/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts @@ -138,7 +138,7 @@ export async function loadResource(this: ILoadOptionsFunctions, resource: string data.forEach(({ id, name, externalId }: { id: string; name: string; externalId?: string }) => { returnData.push({ - name: externalId ?? name ?? id, + name: externalId || name || id, value: id, }); }); diff --git a/packages/nodes-base/nodes/Box/GenericFunctions.ts b/packages/nodes-base/nodes/Box/GenericFunctions.ts index bf777aae48625..bab2d59e767aa 100644 --- a/packages/nodes-base/nodes/Box/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Box/GenericFunctions.ts @@ -26,7 +26,7 @@ export async function boxApiRequest( method, body, qs, - uri: uri ?? `https://api.box.com/2.0${resource}`, + uri: uri || `https://api.box.com/2.0${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts b/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts index dbcd28c25515b..dafeb2e9ccb84 100644 --- a/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function brandfetchApiRequest( method, qs, body, - uri: uri ?? `https://api.brandfetch.io/v1${resource}`, + uri: uri || `https://api.brandfetch.io/v1${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Calendly/GenericFunctions.ts b/packages/nodes-base/nodes/Calendly/GenericFunctions.ts index 60afd61d109fb..98b29df8a4b88 100644 --- a/packages/nodes-base/nodes/Calendly/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Calendly/GenericFunctions.ts @@ -46,7 +46,7 @@ export async function calendlyApiRequest( method, body, qs: query, - uri: uri ?? `${endpoint}${resource}`, + uri: uri || `${endpoint}${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts b/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts index 718800ea72099..94743117cef71 100644 --- a/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function circleciApiRequest( method, qs, body, - uri: uri ?? `https://circleci.com/api/v2${resource}`, + uri: uri || `https://circleci.com/api/v2${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts b/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts index 82290bc557781..666fd57b5225c 100644 --- a/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function webexApiRequest( method, body, qs, - uri: uri ?? `https://webexapis.com/v1${resource}`, + uri: uri || `https://webexapis.com/v1${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts b/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts index ee91d8aecd7dc..0e5c6c1e16d7f 100644 --- a/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function citrixADCApiRequest( method, body, qs, - uri: uri ?? `${url.replace(new RegExp('/$'), '')}/nitro/v1${resource}`, + uri: uri || `${url.replace(new RegExp('/$'), '')}/nitro/v1${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts b/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts index 116e4d46daa5e..8994b94966798 100644 --- a/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts @@ -26,7 +26,7 @@ export async function clearbitApiRequest( method, qs, body, - uri: uri ?? `https://${api}.clearbit.com${resource}`, + uri: uri || `https://${api}.clearbit.com${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts b/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts index 983685a20c4e9..75248a2b72be4 100644 --- a/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts @@ -32,7 +32,7 @@ export async function clickupApiRequest( method, qs, body, - uri: uri ?? `https://api.clickup.com/api/v2${resource}`, + uri: uri || `https://api.clickup.com/api/v2${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts b/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts index 2f8c70425a6fb..3704d2cd6c42f 100644 --- a/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts @@ -22,7 +22,7 @@ export async function cockpitApiRequest( token: credentials.accessToken, }, body, - uri: uri ?? `${credentials.url}/api${resource}`, + uri: uri || `${credentials.url}/api${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Coda/GenericFunctions.ts b/packages/nodes-base/nodes/Coda/GenericFunctions.ts index 7230cf48383db..06355708cf8c6 100644 --- a/packages/nodes-base/nodes/Coda/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Coda/GenericFunctions.ts @@ -19,7 +19,7 @@ export async function codaApiRequest( method, qs, body, - uri: uri ?? `https://coda.io/apis/v1${resource}`, + uri: uri || `https://coda.io/apis/v1${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/CoinGecko/GenericFunctions.ts b/packages/nodes-base/nodes/CoinGecko/GenericFunctions.ts index fe34ecd126e15..45ed9ee3355b1 100644 --- a/packages/nodes-base/nodes/CoinGecko/GenericFunctions.ts +++ b/packages/nodes-base/nodes/CoinGecko/GenericFunctions.ts @@ -22,7 +22,7 @@ export async function coinGeckoApiRequest( method, body, qs, - uri: uri ?? `https://api.coingecko.com/api/v3${endpoint}`, + uri: uri || `https://api.coingecko.com/api/v3${endpoint}`, json: true, }; diff --git a/packages/nodes-base/nodes/CompareDatasets/GenericFunctions.ts b/packages/nodes-base/nodes/CompareDatasets/GenericFunctions.ts index 7c3f44b169087..5def47282f355 100644 --- a/packages/nodes-base/nodes/CompareDatasets/GenericFunctions.ts +++ b/packages/nodes-base/nodes/CompareDatasets/GenericFunctions.ts @@ -47,14 +47,14 @@ function compareItems( differentKeys.forEach((key) => { switch (resolve) { case 'preferInput1': - different[key] = item1.json[key] ?? null; + different[key] = item1.json[key] || null; break; case 'preferInput2': - different[key] = item2.json[key] ?? null; + different[key] = item2.json[key] || null; break; default: - const input1 = item1.json[key] ?? null; - const input2 = item2.json[key] ?? null; + const input1 = item1.json[key] || null; + const input2 = item2.json[key] || null; if (skipFields.includes(key)) { skipped[key] = { input1, input2 }; } else { @@ -89,7 +89,7 @@ function combineItems( if (disableDotNotation) { entry.json[field] = match.json[field]; } else { - const value = get(match.json, field) ?? null; + const value = get(match.json, field) || null; set(entry, `json.${field}`, value); } }); diff --git a/packages/nodes-base/nodes/Contentful/GenericFunctions.ts b/packages/nodes-base/nodes/Contentful/GenericFunctions.ts index de2d843b5b6ea..01bd993bf203a 100644 --- a/packages/nodes-base/nodes/Contentful/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Contentful/GenericFunctions.ts @@ -22,7 +22,7 @@ export async function contentfulApiRequest( method, qs, body, - uri: uri ?? `https://${isPreview ? 'preview' : 'cdn'}.contentful.com${resource}`, + uri: uri || `https://${isPreview ? 'preview' : 'cdn'}.contentful.com${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts b/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts index 6690da0702c85..830798b79db04 100644 --- a/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts @@ -23,7 +23,7 @@ export async function convertKitApiRequest( method, qs, body, - uri: uri ?? `https://api.convertkit.com/v3${endpoint}`, + uri: uri || `https://api.convertkit.com/v3${endpoint}`, json: true, }; diff --git a/packages/nodes-base/nodes/Cortex/GenericFunctions.ts b/packages/nodes-base/nodes/Cortex/GenericFunctions.ts index f99e316752daf..68829e8bd6333 100644 --- a/packages/nodes-base/nodes/Cortex/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cortex/GenericFunctions.ts @@ -27,7 +27,7 @@ export async function cortexApiRequest( headers: {}, method, qs: query, - uri: uri ?? `${credentials.host}/api${resource}`, + uri: uri || `${credentials.host}/api${resource}`, body, json: true, }; diff --git a/packages/nodes-base/nodes/DateTime/DateTime.node.ts b/packages/nodes-base/nodes/DateTime/DateTime.node.ts index e143dc0130ca1..6e8fc1b8bd19f 100644 --- a/packages/nodes-base/nodes/DateTime/DateTime.node.ts +++ b/packages/nodes-base/nodes/DateTime/DateTime.node.ts @@ -430,7 +430,7 @@ export class DateTime implements INodeType { newDate = moment.unix(currentDate as unknown as number); } else { if (options.fromTimezone || options.toTimezone) { - const fromTimezone = options.fromTimezone ?? workflowTimezone; + const fromTimezone = options.fromTimezone || workflowTimezone; if (options.fromFormat) { newDate = moment.tz( currentDate, diff --git a/packages/nodes-base/nodes/DeepL/GenericFunctions.ts b/packages/nodes-base/nodes/DeepL/GenericFunctions.ts index a23fae97f33c1..87cc1642ca83b 100644 --- a/packages/nodes-base/nodes/DeepL/GenericFunctions.ts +++ b/packages/nodes-base/nodes/DeepL/GenericFunctions.ts @@ -25,7 +25,7 @@ export async function deepLApiRequest( method, form: body, qs, - uri: uri ?? `${credentials.apiPlan === 'pro' ? proApiEndpoint : freeApiEndpoint}${resource}`, + uri: uri || `${credentials.apiPlan === 'pro' ? proApiEndpoint : freeApiEndpoint}${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Demio/GenericFunctions.ts b/packages/nodes-base/nodes/Demio/GenericFunctions.ts index 7494afc7cc057..b4227f8dabcab 100644 --- a/packages/nodes-base/nodes/Demio/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Demio/GenericFunctions.ts @@ -29,7 +29,7 @@ export async function demioApiRequest( method, qs, body, - uri: uri ?? `https://my.demio.com/api/v1${resource}`, + uri: uri || `https://my.demio.com/api/v1${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Dhl/GenericFunctions.ts b/packages/nodes-base/nodes/Dhl/GenericFunctions.ts index 11e74f2b03bd6..c76e268d28fdc 100644 --- a/packages/nodes-base/nodes/Dhl/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Dhl/GenericFunctions.ts @@ -33,7 +33,7 @@ export async function dhlApiRequest( method, qs, body, - uri: uri ?? `https://api-eu.dhl.com${path}`, + uri: uri || `https://api-eu.dhl.com${path}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/Drift/GenericFunctions.ts b/packages/nodes-base/nodes/Drift/GenericFunctions.ts index 66fc96bc49cb6..30e9ea8d84ee7 100644 --- a/packages/nodes-base/nodes/Drift/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Drift/GenericFunctions.ts @@ -19,7 +19,7 @@ export async function driftApiRequest( method, body, qs: query, - uri: uri ?? `https://driftapi.com${resource}`, + uri: uri || `https://driftapi.com${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/ERPNext/GenericFunctions.ts b/packages/nodes-base/nodes/ERPNext/GenericFunctions.ts index 80359a68c9ed7..83d9c53f3d2e9 100644 --- a/packages/nodes-base/nodes/ERPNext/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ERPNext/GenericFunctions.ts @@ -30,7 +30,7 @@ export async function erpNextApiRequest( method, body, qs: query, - uri: uri ?? `${baseUrl}${resource}`, + uri: uri || `${baseUrl}${resource}`, json: true, rejectUnauthorized: !credentials.allowUnauthorizedCerts, }; diff --git a/packages/nodes-base/nodes/EditImage/EditImage.node.ts b/packages/nodes-base/nodes/EditImage/EditImage.node.ts index ab6d5b0b1f605..01cc6d96b01d1 100644 --- a/packages/nodes-base/nodes/EditImage/EditImage.node.ts +++ b/packages/nodes-base/nodes/EditImage/EditImage.node.ts @@ -1239,7 +1239,7 @@ export class EditImage implements INodeType { // Combine the lines to a single string const renderText = lines.join('\n'); - const font = options.font ?? operationData.font; + const font = options.font || operationData.font; if (font && font !== 'default') { gmInstance = gmInstance!.font(font as string); diff --git a/packages/nodes-base/nodes/Elastic/ElasticSecurity/ElasticSecurity.node.ts b/packages/nodes-base/nodes/Elastic/ElasticSecurity/ElasticSecurity.node.ts index f044b78537bca..d78c9e2fb0d7a 100644 --- a/packages/nodes-base/nodes/Elastic/ElasticSecurity/ElasticSecurity.node.ts +++ b/packages/nodes-base/nodes/Elastic/ElasticSecurity/ElasticSecurity.node.ts @@ -447,7 +447,7 @@ export class ElasticSecurity implements INodeType { const body = { comment: this.getNodeParameter('comment', i), type: 'user', - owner: additionalFields.owner ?? 'securitySolution', + owner: additionalFields.owner || 'securitySolution', } as IDataObject; const caseId = this.getNodeParameter('caseId', i); diff --git a/packages/nodes-base/nodes/EmailSend/EmailSend.node.ts b/packages/nodes-base/nodes/EmailSend/EmailSend.node.ts index a6fdcc8d54f34..f6bbaf5eca1a9 100644 --- a/packages/nodes-base/nodes/EmailSend/EmailSend.node.ts +++ b/packages/nodes-base/nodes/EmailSend/EmailSend.node.ts @@ -193,7 +193,7 @@ export class EmailSend implements INodeType { continue; } attachments.push({ - filename: item.binary[propertyName].fileName ?? 'unknown', + filename: item.binary[propertyName].fileName || 'unknown', content: await this.helpers.getBinaryDataBuffer(itemIndex, propertyName), }); } diff --git a/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts b/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts index 827f0eef678c6..ddaec221b08ff 100644 --- a/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts @@ -30,7 +30,7 @@ export async function eventbriteApiRequest( method, qs, body, - uri: uri ?? `https://www.eventbriteapi.com/v3${resource}`, + uri: uri || `https://www.eventbriteapi.com/v3${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/ExecuteCommand/ExecuteCommand.node.ts b/packages/nodes-base/nodes/ExecuteCommand/ExecuteCommand.node.ts index 95c1dd9ed5269..eef2d8b94c1d4 100644 --- a/packages/nodes-base/nodes/ExecuteCommand/ExecuteCommand.node.ts +++ b/packages/nodes-base/nodes/ExecuteCommand/ExecuteCommand.node.ts @@ -38,7 +38,7 @@ async function execPromise(command: string): Promise { resolve(returnData); }).on('exit', (code) => { - returnData.exitCode = code ?? 0; + returnData.exitCode = code || 0; }); }); } diff --git a/packages/nodes-base/nodes/Facebook/GenericFunctions.ts b/packages/nodes-base/nodes/Facebook/GenericFunctions.ts index c09cee01450b9..f6b47a4e3a616 100644 --- a/packages/nodes-base/nodes/Facebook/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Facebook/GenericFunctions.ts @@ -45,7 +45,7 @@ export async function facebookApiRequest( qs, body, gzip: true, - uri: uri ?? `https://graph.facebook.com/v8.0${resource}`, + uri: uri || `https://graph.facebook.com/v8.0${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Figma/GenericFunctions.ts b/packages/nodes-base/nodes/Figma/GenericFunctions.ts index b6556a464df06..7aa17fd22f447 100644 --- a/packages/nodes-base/nodes/Figma/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Figma/GenericFunctions.ts @@ -25,7 +25,7 @@ export async function figmaApiRequest( headers: { 'X-FIGMA-TOKEN': credentials.accessToken }, method, body, - uri: uri ?? `https://api.figma.com${resource}`, + uri: uri || `https://api.figma.com${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/Flow/GenericFunctions.ts b/packages/nodes-base/nodes/Flow/GenericFunctions.ts index 34f18a87a4ed7..a784cb926be8b 100644 --- a/packages/nodes-base/nodes/Flow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Flow/GenericFunctions.ts @@ -24,7 +24,7 @@ export async function flowApiRequest( method, qs, body, - uri: uri ?? `https://api.getflow.com/v2${resource}`, + uri: uri || `https://api.getflow.com/v2${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/FormIo/GenericFunctions.ts b/packages/nodes-base/nodes/FormIo/GenericFunctions.ts index 14ff66d04a193..cf4aefac96cc7 100644 --- a/packages/nodes-base/nodes/FormIo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/FormIo/GenericFunctions.ts @@ -16,7 +16,7 @@ async function getToken( this: IExecuteFunctions | IWebhookFunctions | IHookFunctions | ILoadOptionsFunctions, credentials: IFormIoCredentials, ) { - const base = credentials.domain ?? 'https://formio.form.io'; + const base = credentials.domain || 'https://formio.form.io'; const options = { headers: { 'Content-Type': 'application/json', @@ -57,7 +57,7 @@ export async function formIoApiRequest( const token = await getToken.call(this, credentials); - const base = credentials.domain ?? 'https://api.form.io'; + const base = credentials.domain || 'https://api.form.io'; const options = { headers: { diff --git a/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts b/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts index 69b3975485acb..02c2c79e0c87e 100644 --- a/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function freshdeskApiRequest( method, body, qs: query, - uri: uri ?? `https://${credentials.domain}.${endpoint}${resource}`, + uri: uri || `https://${credentials.domain}.${endpoint}${resource}`, json: true, }; if (!Object.keys(body).length) { diff --git a/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts b/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts index 960277615d80b..4f7e3094856d2 100644 --- a/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts +++ b/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function getresponseApiRequest( method, body, qs, - uri: uri ?? `https://api.getresponse.com/v3${resource}`, + uri: uri || `https://api.getresponse.com/v3${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/GetResponse/GetResponse.node.ts b/packages/nodes-base/nodes/GetResponse/GetResponse.node.ts index d2ebbbca8fcb9..763e09fc7cd94 100644 --- a/packages/nodes-base/nodes/GetResponse/GetResponse.node.ts +++ b/packages/nodes-base/nodes/GetResponse/GetResponse.node.ts @@ -244,7 +244,7 @@ export class GetResponse implements INodeType { } if (qs.sortBy) { - qs[`sort[${qs.sortBy}]`] = qs.sortOrder ?? 'ASC'; + qs[`sort[${qs.sortBy}]`] = qs.sortOrder || 'ASC'; } if (qs.exactMatch === true) { diff --git a/packages/nodes-base/nodes/Ghost/GenericFunctions.ts b/packages/nodes-base/nodes/Ghost/GenericFunctions.ts index f943d1458c48a..e46442ac1a1d3 100644 --- a/packages/nodes-base/nodes/Ghost/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Ghost/GenericFunctions.ts @@ -37,7 +37,7 @@ export async function ghostApiRequest( const options: OptionsWithUri = { method, qs: query, - uri: uri ?? `${credentials.url}/ghost/api/${version}${endpoint}`, + uri: uri || `${credentials.url}/ghost/api/${version}${endpoint}`, body, json: true, }; diff --git a/packages/nodes-base/nodes/Ghost/Ghost.node.ts b/packages/nodes-base/nodes/Ghost/Ghost.node.ts index 0ba954b83a679..b4c22b5fbf991 100644 --- a/packages/nodes-base/nodes/Ghost/Ghost.node.ts +++ b/packages/nodes-base/nodes/Ghost/Ghost.node.ts @@ -291,7 +291,7 @@ export class Ghost implements INodeType { const post: IDataObject = {}; if (contentFormat === 'html') { - post.html = updateFields.content ?? ''; + post.html = updateFields.content || ''; qs.source = 'html'; delete updateFields.content; } else { diff --git a/packages/nodes-base/nodes/Google/Analytics/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Analytics/GenericFunctions.ts index 42107df6d7183..04a73fe63e6a2 100644 --- a/packages/nodes-base/nodes/Google/Analytics/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Analytics/GenericFunctions.ts @@ -22,7 +22,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://analyticsreporting.googleapis.com${endpoint}`, + uri: uri || `https://analyticsreporting.googleapis.com${endpoint}`, json: true, }; diff --git a/packages/nodes-base/nodes/Google/BigQuery/GenericFunctions.ts b/packages/nodes-base/nodes/Google/BigQuery/GenericFunctions.ts index 0f7f557cf8358..7763a8a912214 100644 --- a/packages/nodes-base/nodes/Google/BigQuery/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/BigQuery/GenericFunctions.ts @@ -23,7 +23,7 @@ async function getAccessToken( const signature = jwt.sign( { iss: credentials.email as string, - sub: credentials.delegatedEmail ?? (credentials.email as string), + sub: credentials.delegatedEmail || (credentials.email as string), scope: scopes.join(' '), aud: 'https://oauth2.googleapis.com/token', iat: now, @@ -79,7 +79,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://bigquery.googleapis.com/bigquery${resource}`, + uri: uri || `https://bigquery.googleapis.com/bigquery${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts index 3236564fb7151..928c3522e1330 100644 --- a/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts @@ -31,7 +31,7 @@ async function getAccessToken( const signature = jwt.sign( { iss: credentials.email, - sub: credentials.delegatedEmail ?? credentials.email, + sub: credentials.delegatedEmail || credentials.email, scope: scopes.join(' '), aud: 'https://oauth2.googleapis.com/token', iat: now, @@ -86,7 +86,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://www.googleapis.com/books/${resource}`, + uri: uri || `https://www.googleapis.com/books/${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts index 69cd2f91f1bdb..001c2653e1658 100644 --- a/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts @@ -29,7 +29,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://www.googleapis.com${resource}`, + uri: uri || `https://www.googleapis.com${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts b/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts index f94b2d7768899..824918654c90d 100644 --- a/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts +++ b/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts @@ -144,7 +144,7 @@ export class GoogleCalendar implements INodeType { const timeMin = this.getNodeParameter('timeMin', i) as string; const timeMax = this.getNodeParameter('timeMax', i) as string; const options = this.getNodeParameter('options', i); - const outputFormat = options.outputFormat ?? 'availability'; + const outputFormat = options.outputFormat || 'availability'; const tz = this.getNodeParameter('options.timezone', i, '', { extractValue: true, }) as string; diff --git a/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts index 5631e1e8555bd..edd79df37507d 100644 --- a/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts @@ -41,7 +41,7 @@ export async function getAccessToken( const signature = jwt.sign( { iss: credentials.email, - sub: credentials.delegatedEmail ?? credentials.email, + sub: credentials.delegatedEmail || credentials.email, scope: scopes.join(' '), aud: 'https://oauth2.googleapis.com/token', iat: now, @@ -92,7 +92,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://chat.googleapis.com${resource}`, + uri: uri || `https://chat.googleapis.com${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GenericFunctions.ts b/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GenericFunctions.ts index 6c9896acee4f8..8b67ddf83c20c 100644 --- a/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GenericFunctions.ts @@ -22,7 +22,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://language.googleapis.com${endpoint}`, + uri: uri || `https://language.googleapis.com${endpoint}`, json: true, }; diff --git a/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GoogleCloudNaturalLanguage.node.ts b/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GoogleCloudNaturalLanguage.node.ts index 118b57350ceae..e0b3e41c528f8 100644 --- a/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GoogleCloudNaturalLanguage.node.ts +++ b/packages/nodes-base/nodes/Google/CloudNaturalLanguage/GoogleCloudNaturalLanguage.node.ts @@ -262,8 +262,8 @@ export class GoogleCloudNaturalLanguage implements INodeType { if (operation === 'analyzeSentiment') { const source = this.getNodeParameter('source', i) as string; const options = this.getNodeParameter('options', i); - const encodingType = (options.encodingType as string | undefined) ?? 'UTF16'; - const documentType = (options.documentType as string | undefined) ?? 'PLAIN_TEXT'; + const encodingType = (options.encodingType as string | undefined) || 'UTF16'; + const documentType = (options.documentType as string | undefined) || 'PLAIN_TEXT'; const body: IData = { document: { diff --git a/packages/nodes-base/nodes/Google/Contacts/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Contacts/GenericFunctions.ts index 96a8e0ad61e19..a269b0282df82 100644 --- a/packages/nodes-base/nodes/Google/Contacts/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Contacts/GenericFunctions.ts @@ -21,7 +21,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://people.googleapis.com/v1${resource}`, + uri: uri || `https://people.googleapis.com/v1${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts index a4023cb3a2487..9041049f82a19 100644 --- a/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts @@ -35,7 +35,7 @@ async function getAccessToken( const signature = jwt.sign( { iss: credentials.email, - sub: credentials.delegatedEmail ?? credentials.email, + sub: credentials.delegatedEmail || credentials.email, scope: scopes.join(' '), aud: 'https://oauth2.googleapis.com/token', iat: now, @@ -89,7 +89,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://docs.googleapis.com/v1${endpoint}`, + uri: uri || `https://docs.googleapis.com/v1${endpoint}`, json: true, }; diff --git a/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts index 02f0948a72c8b..db8091a8a1287 100644 --- a/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts @@ -35,7 +35,7 @@ async function getAccessToken( const signature = jwt.sign( { iss: credentials.email, - sub: credentials.delegatedEmail ?? credentials.email, + sub: credentials.delegatedEmail || credentials.email, scope: scopes.join(' '), aud: 'https://oauth2.googleapis.com/token', iat: now, @@ -91,7 +91,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://www.googleapis.com${resource}`, + uri: uri || `https://www.googleapis.com${resource}`, json: true, }; @@ -136,8 +136,8 @@ export async function googleApiRequestAllItems( const returnData: IDataObject[] = []; let responseData; - query.maxResults = query.maxResults ?? 100; - query.pageSize = query.pageSize ?? 100; + query.maxResults = query.maxResults || 100; + query.pageSize = query.pageSize || 100; do { responseData = await googleApiRequest.call(this, method, endpoint, body, query); diff --git a/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts b/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts index c99f30b5692f1..3cfb6b0e41236 100644 --- a/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts +++ b/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts @@ -2652,7 +2652,7 @@ export class GoogleDrive implements INodeType { const body = { name, mimeType: 'application/vnd.google-apps.folder', - parents: options.parents ?? [], + parents: options.parents || [], }; const qs = { diff --git a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts index 509becba328b7..7559819fdb6dd 100644 --- a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts @@ -25,7 +25,7 @@ export async function googleApiRequest( qsStringifyOptions: { arrayFormat: 'repeat', }, - uri: uri ?? `https://firestore.googleapis.com/v1/projects${resource}`, + uri: uri || `https://firestore.googleapis.com/v1/projects${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts index f1ed51a2d215f..80b4957843b09 100644 --- a/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts @@ -26,7 +26,7 @@ export async function googleApiRequest( method, body, qs, - url: uri ?? `https://${projectId}.${region}/${resource}.json`, + url: uri || `https://${projectId}.${region}/${resource}.json`, json: true, }; diff --git a/packages/nodes-base/nodes/Google/GSuiteAdmin/GenericFunctions.ts b/packages/nodes-base/nodes/Google/GSuiteAdmin/GenericFunctions.ts index e59a3c991aad9..d3ab4f047581a 100644 --- a/packages/nodes-base/nodes/Google/GSuiteAdmin/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/GSuiteAdmin/GenericFunctions.ts @@ -21,7 +21,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://www.googleapis.com/admin${resource}`, + uri: uri || `https://www.googleapis.com/admin${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts index 0b8a93121ddf3..e60884a41146a 100644 --- a/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts @@ -116,7 +116,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://www.googleapis.com${endpoint}`, + uri: uri || `https://www.googleapis.com${endpoint}`, qsStringifyOptions: { arrayFormat: 'repeat', }, @@ -528,7 +528,7 @@ export async function prepareEmailAttachments( } attachmentsList.push({ - name: binaryData.fileName ?? 'unknown', + name: binaryData.fileName || 'unknown', content: binaryDataBuffer, type: binaryData.mimeType, }); diff --git a/packages/nodes-base/nodes/Google/Gmail/v1/GmailV1.node.ts b/packages/nodes-base/nodes/Google/Gmail/v1/GmailV1.node.ts index 356ca646fe729..8ef63b1e241a3 100644 --- a/packages/nodes-base/nodes/Google/Gmail/v1/GmailV1.node.ts +++ b/packages/nodes-base/nodes/Google/Gmail/v1/GmailV1.node.ts @@ -324,7 +324,7 @@ export class GmailV1 implements INodeType { binaryProperty, ); attachmentsBinary.push({ - name: binaryData.fileName ?? 'unknown', + name: binaryData.fileName || 'unknown', content: binaryDataBuffer, type: binaryData.mimeType, }); @@ -414,7 +414,7 @@ export class GmailV1 implements INodeType { binaryProperty, ); attachmentsBinary.push({ - name: binaryData.fileName ?? 'unknown', + name: binaryData.fileName || 'unknown', content: binaryDataBuffer, type: binaryData.mimeType, }); @@ -489,7 +489,7 @@ export class GmailV1 implements INodeType { const id = this.getNodeParameter('messageId', i); const additionalFields = this.getNodeParameter('additionalFields', i); - const format = additionalFields.format ?? 'resolved'; + const format = additionalFields.format || 'resolved'; if (format === 'resolved') { qs.format = 'raw'; @@ -557,7 +557,7 @@ export class GmailV1 implements INodeType { responseData = []; } - const format = additionalFields.format ?? 'resolved'; + const format = additionalFields.format || 'resolved'; if (format !== 'ids') { if (format === 'resolved') { @@ -658,7 +658,7 @@ export class GmailV1 implements INodeType { binaryProperty, ); attachmentsBinary.push({ - name: binaryData.fileName ?? 'unknown', + name: binaryData.fileName || 'unknown', content: binaryDataBuffer, type: binaryData.mimeType, }); @@ -707,7 +707,7 @@ export class GmailV1 implements INodeType { const id = this.getNodeParameter('messageId', i); const additionalFields = this.getNodeParameter('additionalFields', i); - const format = additionalFields.format ?? 'resolved'; + const format = additionalFields.format || 'resolved'; if (format === 'resolved') { qs.format = 'raw'; @@ -785,7 +785,7 @@ export class GmailV1 implements INodeType { responseData = []; } - const format = additionalFields.format ?? 'resolved'; + const format = additionalFields.format || 'resolved'; if (format !== 'ids') { if (format === 'resolved') { diff --git a/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts b/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts index 846f2b34e32a7..dbf135e1d4811 100644 --- a/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts +++ b/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts @@ -678,7 +678,7 @@ export class GmailV2 implements INodeType { const endpoint = `/gmail/v1/users/me/threads/${id}`; const options = this.getNodeParameter('options', i); - const onlyMessages = options.returnOnlyMessages ?? false; + const onlyMessages = options.returnOnlyMessages || false; const qs: IDataObject = {}; const simple = this.getNodeParameter('simple', i) as boolean; diff --git a/packages/nodes-base/nodes/Google/Sheet/GoogleSheetsTrigger.node.ts b/packages/nodes-base/nodes/Google/Sheet/GoogleSheetsTrigger.node.ts index aa72450d8611a..516a43ec740e0 100644 --- a/packages/nodes-base/nodes/Google/Sheet/GoogleSheetsTrigger.node.ts +++ b/packages/nodes-base/nodes/Google/Sheet/GoogleSheetsTrigger.node.ts @@ -490,8 +490,8 @@ export class GoogleSheetsTrigger implements INodeType { } const [rangeFrom, rangeTo] = range.split(':'); - const cellDataFrom = rangeFrom.match(/([a-zA-Z]{1,10})([0-9]{0,10})/) ?? []; - const cellDataTo = rangeTo.match(/([a-zA-Z]{1,10})([0-9]{0,10})/) ?? []; + const cellDataFrom = rangeFrom.match(/([a-zA-Z]{1,10})([0-9]{0,10})/) || []; + const cellDataTo = rangeTo.match(/([a-zA-Z]{1,10})([0-9]{0,10})/) || []; if (rangeDefinition === 'specifyRangeA1' && cellDataFrom[2] !== undefined) { keyRange = `${cellDataFrom[1]}${+cellDataFrom[2]}:${cellDataTo[1]}${+cellDataFrom[2]}`; @@ -544,7 +544,7 @@ export class GoogleSheetsTrigger implements INodeType { return null; } - const addedRows = sheetData?.slice(workflowStaticData.lastIndexChecked as number) ?? []; + const addedRows = sheetData?.slice(workflowStaticData.lastIndexChecked as number) || []; const returnData = arrayOfArraysToJson(addedRows, columns); workflowStaticData.lastIndexChecked = sheetData.length; diff --git a/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts index ffd56ed5cfc44..c5426b5cabe11 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts @@ -39,7 +39,7 @@ export async function getAccessToken( const signature = jwt.sign( { iss: credentials.email, - sub: credentials.delegatedEmail ?? credentials.email, + sub: credentials.delegatedEmail || credentials.email, scope: scopes.join(' '), aud: 'https://oauth2.googleapis.com/token', iat: now, @@ -94,7 +94,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://sheets.googleapis.com${resource}`, + uri: uri || `https://sheets.googleapis.com${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Google/Sheet/v1/GoogleSheetsV1.node.ts b/packages/nodes-base/nodes/Google/Sheet/v1/GoogleSheetsV1.node.ts index 1a3e9aec095cd..811982afeebd4 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v1/GoogleSheetsV1.node.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v1/GoogleSheetsV1.node.ts @@ -117,8 +117,8 @@ export class GoogleSheetsV1 implements INodeType { const options = this.getNodeParameter('options', 0, {}); - const valueInputMode = (options.valueInputMode ?? 'RAW') as ValueInputOption; - const valueRenderMode = (options.valueRenderMode ?? 'UNFORMATTED_VALUE') as ValueRenderOption; + const valueInputMode = (options.valueInputMode || 'RAW') as ValueInputOption; + const valueRenderMode = (options.valueRenderMode || 'UNFORMATTED_VALUE') as ValueRenderOption; if (operation === 'append') { // ---------------------------------- @@ -134,7 +134,7 @@ export class GoogleSheetsV1 implements INodeType { setData.push(item.json); }); - const usePathForKeyRow = (options.usePathForKeyRow ?? false) as boolean; + const usePathForKeyRow = (options.usePathForKeyRow || false) as boolean; // Convert data into array format const _data = await sheet.appendSheetData( diff --git a/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/appendOrUpdate.operation.ts b/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/appendOrUpdate.operation.ts index 6ad153d6c16d9..04620109d62a5 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/appendOrUpdate.operation.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/appendOrUpdate.operation.ts @@ -172,7 +172,7 @@ export async function execute( const options = this.getNodeParameter('options', 0, {}); - const valueRenderMode = (options.valueRenderMode ?? 'UNFORMATTED_VALUE') as ValueRenderOption; + const valueRenderMode = (options.valueRenderMode || 'UNFORMATTED_VALUE') as ValueRenderOption; const locationDefineOption = (options.locationDefine as IDataObject)?.values as IDataObject; diff --git a/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/read.operation.ts b/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/read.operation.ts index 5e4b5fe73cee8..14731532b5a00 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/read.operation.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/read.operation.ts @@ -124,9 +124,9 @@ export async function execute( const range = getRangeString(sheetName, dataLocationOnSheetOptions); - const valueRenderMode = (outputFormattingOption.general ?? + const valueRenderMode = (outputFormattingOption.general || 'UNFORMATTED_VALUE') as ValueRenderOption; - const dateTimeRenderOption = (outputFormattingOption.date ?? 'FORMATTED_STRING') as string; + const dateTimeRenderOption = (outputFormattingOption.date || 'FORMATTED_STRING') as string; const sheetData = (await sheet.getData( range, diff --git a/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/update.operation.ts b/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/update.operation.ts index 2a498023bcd0e..17a1cbe225b7c 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/update.operation.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/update.operation.ts @@ -171,7 +171,7 @@ export async function execute( const options = this.getNodeParameter('options', 0, {}); - const valueRenderMode = (options.valueRenderMode ?? 'UNFORMATTED_VALUE') as ValueRenderOption; + const valueRenderMode = (options.valueRenderMode || 'UNFORMATTED_VALUE') as ValueRenderOption; const locationDefineOptions = (options.locationDefine as IDataObject)?.values as IDataObject; diff --git a/packages/nodes-base/nodes/Google/Sheet/v2/helpers/GoogleSheet.ts b/packages/nodes-base/nodes/Google/Sheet/v2/helpers/GoogleSheet.ts index 4fc8851006404..dff6f56824286 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v2/helpers/GoogleSheet.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v2/helpers/GoogleSheet.ts @@ -255,7 +255,7 @@ export class GoogleSheet { // ); const lastRowWithData = - lastRow ?? + lastRow || (((await this.getData(range, 'UNFORMATTED_VALUE')) as string[][]) || []).length + 1; const response = await this.updateRows( @@ -403,10 +403,10 @@ export class GoogleSheet { columnValuesList = sheetData.slice(dataStartRowIndex - 1).map((row) => row[keyIndex]); } else { const decodedRange = this.getDecodedSheetRange(range); - const startRowIndex = decodedRange.start?.row ?? dataStartRowIndex; - const endRowIndex = decodedRange.end?.row ?? ''; + const startRowIndex = decodedRange.start?.row || dataStartRowIndex; + const endRowIndex = decodedRange.end?.row || ''; - const keyColumn = this.getColumnWithOffset(decodedRange.start?.column ?? 'A', keyIndex); + const keyColumn = this.getColumnWithOffset(decodedRange.start?.column || 'A', keyIndex); const keyColumnRange = `${decodedRange.name}!${keyColumn}${startRowIndex}:${keyColumn}${endRowIndex}`; columnValuesList = await this.getData(keyColumnRange, valueRenderMode); } @@ -446,9 +446,9 @@ export class GoogleSheet { ) { const decodedRange = this.getDecodedSheetRange(range); // prettier-ignore - const keyRowRange = `${decodedRange.name}!${decodedRange.start?.column ?? ''}${keyRowIndex + 1}:${decodedRange.end?.column ?? ''}${keyRowIndex + 1}`; + const keyRowRange = `${decodedRange.name}!${decodedRange.start?.column || ''}${keyRowIndex + 1}:${decodedRange.end?.column || ''}${keyRowIndex + 1}`; - const sheetDatakeyRow = columnNamesList ?? (await this.getData(keyRowRange, valueRenderMode)); + const sheetDatakeyRow = columnNamesList || (await this.getData(keyRowRange, valueRenderMode)); if (sheetDatakeyRow === undefined) { throw new NodeOperationError( @@ -469,7 +469,7 @@ export class GoogleSheet { } const columnValues: Array = - columnValuesList ?? + columnValuesList || (await this.getColumnValues(range, keyIndex, dataStartRowIndex, valueRenderMode)); const updateData: ISheetUpdateData[] = []; @@ -527,7 +527,7 @@ export class GoogleSheet { // Property exists so add it to the data to update // Get the column name in which the property data can be found const columnToUpdate = this.getColumnWithOffset( - decodedRange.start?.column ?? 'A', + decodedRange.start?.column || 'A', columnNames.indexOf(name), ); @@ -640,7 +640,7 @@ export class GoogleSheet { const decodedRange = this.getDecodedSheetRange(range); const columnNamesRow = - columnNamesList ?? + columnNamesList || (await this.getData( `${decodedRange.name}!${keyRowIndex}:${keyRowIndex}`, 'UNFORMATTED_VALUE', @@ -704,7 +704,7 @@ export class GoogleSheet { } private splitCellRange(cell: string, range: string): SheetCellDecoded { - const cellData = cell.match(/([a-zA-Z]{1,10})([0-9]{0,10})/) ?? []; + const cellData = cell.match(/([a-zA-Z]{1,10})([0-9]{0,10})/) || []; if (cellData === null || cellData.length !== 3) { throw new NodeOperationError( diff --git a/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts b/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts index 0f84a9a616ce4..45defe3ff315b 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts @@ -36,7 +36,7 @@ export async function getAccessToken( const signature = jwt.sign( { iss: credentials.email, - sub: credentials.delegatedEmail ?? credentials.email, + sub: credentials.delegatedEmail || credentials.email, scope: scopes.join(' '), aud: 'https://oauth2.googleapis.com/token', iat: now, @@ -91,7 +91,7 @@ export async function apiRequest( method, body, qs, - uri: uri ?? `https://sheets.googleapis.com${resource}`, + uri: uri || `https://sheets.googleapis.com${resource}`, json: true, ...option, }; diff --git a/packages/nodes-base/nodes/Google/Slides/GoogleSlides.node.ts b/packages/nodes-base/nodes/Google/Slides/GoogleSlides.node.ts index 2fd12a9804283..455c5b845119a 100644 --- a/packages/nodes-base/nodes/Google/Slides/GoogleSlides.node.ts +++ b/packages/nodes-base/nodes/Google/Slides/GoogleSlides.node.ts @@ -542,7 +542,7 @@ export class GoogleSlides implements INodeType { return { replaceAllText: { replaceText: text.replaceText, - pageObjectIds: text.pageObjectIds ?? [], + pageObjectIds: text.pageObjectIds || [], containsText: { text: text.text, matchCase: text.matchCase, diff --git a/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts index c4c10e0450e10..a08658f9fa737 100644 --- a/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts @@ -20,7 +20,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://www.googleapis.com${resource}`, + uri: uri || `https://www.googleapis.com${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts index 8667976d7b165..3b7ee46ce37a0 100644 --- a/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts @@ -89,7 +89,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://translation.googleapis.com${resource}`, + uri: uri || `https://translation.googleapis.com${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Google/YouTube/GenericFunctions.ts b/packages/nodes-base/nodes/Google/YouTube/GenericFunctions.ts index 0d7526f205b21..a7e1a31e3709b 100644 --- a/packages/nodes-base/nodes/Google/YouTube/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/YouTube/GenericFunctions.ts @@ -21,7 +21,7 @@ export async function googleApiRequest( method, body, qs, - uri: uri ?? `https://www.googleapis.com${resource}`, + uri: uri || `https://www.googleapis.com${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Gotify/GenericFunctions.ts b/packages/nodes-base/nodes/Gotify/GenericFunctions.ts index 6169dd161bade..6e3c521144780 100644 --- a/packages/nodes-base/nodes/Gotify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Gotify/GenericFunctions.ts @@ -24,7 +24,7 @@ export async function gotifyApiRequest( }, body, qs, - uri: uri ?? `${credentials.url}${path}`, + uri: uri || `${credentials.url}${path}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/GraphQL/GraphQL.node.ts b/packages/nodes-base/nodes/GraphQL/GraphQL.node.ts index 9f8cee069a99b..28a732505660c 100644 --- a/packages/nodes-base/nodes/GraphQL/GraphQL.node.ts +++ b/packages/nodes-base/nodes/GraphQL/GraphQL.node.ts @@ -335,7 +335,7 @@ export class GraphQL implements INodeType { const responseFormat = this.getNodeParameter('responseFormat', 0) as string; const { parameter }: { parameter?: Array<{ name: string; value: string }> } = this.getNodeParameter('headerParametersUi', itemIndex, {}) as IDataObject; - const headerParameters = (parameter ?? []).reduce( + const headerParameters = (parameter || []).reduce( (result, item) => ({ ...result, [item.name]: item.value, diff --git a/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts b/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts index 77838c844c507..a22c9877e7be0 100644 --- a/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts @@ -30,7 +30,7 @@ export async function gumroadApiRequest( method, qs, body, - uri: uri ?? `https://api.gumroad.com/v2${resource}`, + uri: uri || `https://api.gumroad.com/v2${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/Harvest/GenericFunctions.ts b/packages/nodes-base/nodes/Harvest/GenericFunctions.ts index f7b66b72dc9f3..f9c149c9cd1a4 100644 --- a/packages/nodes-base/nodes/Harvest/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Harvest/GenericFunctions.ts @@ -26,7 +26,7 @@ export async function harvestApiRequest( }, method, body, - uri: uri ?? `https://api.harvestapp.com/v2/${path}`, + uri: uri || `https://api.harvestapp.com/v2/${path}`, qs, json: true, }; diff --git a/packages/nodes-base/nodes/HelpScout/GenericFunctions.ts b/packages/nodes-base/nodes/HelpScout/GenericFunctions.ts index 9713582036242..1e777057ecaf9 100644 --- a/packages/nodes-base/nodes/HelpScout/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HelpScout/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function helpscoutApiRequest( method, body, qs, - uri: uri ?? `https://api.helpscout.net${resource}`, + uri: uri || `https://api.helpscout.net${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/HelpScout/HelpScout.node.ts b/packages/nodes-base/nodes/HelpScout/HelpScout.node.ts index 4b8017c57b07e..881f9b8898037 100644 --- a/packages/nodes-base/nodes/HelpScout/HelpScout.node.ts +++ b/packages/nodes-base/nodes/HelpScout/HelpScout.node.ts @@ -504,7 +504,7 @@ export class HelpScout implements INodeType { ]; if (binaryProperty) { return { - fileName: binaryProperty.fileName ?? 'unknown', + fileName: binaryProperty.fileName || 'unknown', data: binaryProperty.data, mimeType: binaryProperty.mimeType, }; diff --git a/packages/nodes-base/nodes/HighLevel/GenericFunctions.ts b/packages/nodes-base/nodes/HighLevel/GenericFunctions.ts index b784ae2425fcc..ba0bce429fac0 100644 --- a/packages/nodes-base/nodes/HighLevel/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HighLevel/GenericFunctions.ts @@ -64,7 +64,7 @@ export async function dueDatePreSendAction( ); } const dueDate = dateToIsoSupressMillis(dueDateParam); - requestOptions.body = (requestOptions.body ?? {}) as object; + requestOptions.body = (requestOptions.body || {}) as object; Object.assign(requestOptions.body, { dueDate }); return requestOptions; } @@ -73,7 +73,7 @@ export async function contactIdentifierPreSendAction( this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions, ): Promise { - requestOptions.body = (requestOptions.body ?? {}) as object; + requestOptions.body = (requestOptions.body || {}) as object; let identifier = this.getNodeParameter('contactIdentifier', null) as string; if (!identifier) { const fields = this.getNodeParameter('updateFields') as { contactIdentifier: string }; @@ -93,7 +93,7 @@ export async function validEmailAndPhonePreSendAction( this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions, ): Promise { - const body = (requestOptions.body ?? {}) as { email?: string; phone?: string }; + const body = (requestOptions.body || {}) as { email?: string; phone?: string }; if (body.email && !isEmailValid(body.email)) { const message = `email "${body.email}" has invalid format`; @@ -112,7 +112,7 @@ export async function dateTimeToEpochPreSendAction( this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions, ): Promise { - const qs = (requestOptions.qs ?? {}) as { + const qs = (requestOptions.qs || {}) as { startDate?: string | number; endDate?: string | number; }; @@ -141,7 +141,7 @@ export async function highLevelApiRequest( method, body, qs, - uri: uri ?? `https://rest.gohighlevel.com/v1${resource}`, + uri: uri || `https://rest.gohighlevel.com/v1${resource}`, json: true, }; if (!Object.keys(body).length) { @@ -158,14 +158,14 @@ export async function opportunityUpdatePreSendAction( this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions, ): Promise { - const body = (requestOptions.body ?? {}) as { title?: string; status?: string }; + const body = (requestOptions.body || {}) as { title?: string; status?: string }; if (!body.status || !body.title) { const pipelineId = this.getNodeParameter('pipelineId'); const opportunityId = this.getNodeParameter('opportunityId'); const resource = `/pipelines/${pipelineId}/opportunities/${opportunityId}`; const responseData = await highLevelApiRequest.call(this, 'GET', resource); - body.status = body.status ?? responseData.status; - body.title = body.title ?? responseData.name; + body.status = body.status || responseData.status; + body.title = body.title || responseData.name; requestOptions.body = body; } return requestOptions; @@ -175,15 +175,15 @@ export async function taskUpdatePreSendAction( this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions, ): Promise { - const body = (requestOptions.body ?? {}) as { title?: string; dueDate?: string }; + const body = (requestOptions.body || {}) as { title?: string; dueDate?: string }; if (!body.title || !body.dueDate) { const contactId = this.getNodeParameter('contactId'); const taskId = this.getNodeParameter('taskId'); const resource = `/contacts/${contactId}/tasks/${taskId}`; const responseData = await highLevelApiRequest.call(this, 'GET', resource); - body.title = body.title ?? responseData.title; + body.title = body.title || responseData.title; // the api response dueDate has to be formatted or it will error on update - body.dueDate = body.dueDate ?? dateToIsoSupressMillis(responseData.dueDate); + body.dueDate = body.dueDate || dateToIsoSupressMillis(responseData.dueDate); requestOptions.body = body; } return requestOptions; @@ -193,7 +193,7 @@ export async function splitTagsPreSendAction( this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions, ): Promise { - const body = (requestOptions.body ?? {}) as IDataObject; + const body = (requestOptions.body || {}) as IDataObject; if (body.tags) { if (Array.isArray(body.tags)) return requestOptions; body.tags = (body.tags as string).split(',').map((tag) => tag.trim()); @@ -215,7 +215,7 @@ export async function highLevelApiPagination( }; const rootProperty = resourceMapping[resource]; - requestData.options.qs = requestData.options.qs ?? {}; + requestData.options.qs = requestData.options.qs || {}; if (returnAll) requestData.options.qs.limit = 100; let responseTotal = 0; diff --git a/packages/nodes-base/nodes/HomeAssistant/GenericFunctions.ts b/packages/nodes-base/nodes/HomeAssistant/GenericFunctions.ts index f8b904ad480c4..e24a8524467cc 100644 --- a/packages/nodes-base/nodes/HomeAssistant/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HomeAssistant/GenericFunctions.ts @@ -79,7 +79,7 @@ export async function getHomeAssistantServices( for (const domainService of domainServices) { for (const [serviceID, value] of Object.entries(domainService.services)) { const serviceProperties = value as IDataObject; - const serviceName = serviceProperties.description ?? serviceID; + const serviceName = serviceProperties.description || serviceID; returnData.push({ name: serviceName as string, value: serviceID, diff --git a/packages/nodes-base/nodes/HtmlExtract/HtmlExtract.node.ts b/packages/nodes-base/nodes/HtmlExtract/HtmlExtract.node.ts index b1f42e8a294af..cf731ad498821 100644 --- a/packages/nodes-base/nodes/HtmlExtract/HtmlExtract.node.ts +++ b/packages/nodes-base/nodes/HtmlExtract/HtmlExtract.node.ts @@ -24,7 +24,7 @@ const extractFunctions: { } = { attribute: ($: Cheerio, valueData: IValueData): string | undefined => $.attr(valueData.attribute!), - html: ($: Cheerio, _valueData: IValueData): string | undefined => $.html() ?? undefined, + html: ($: Cheerio, _valueData: IValueData): string | undefined => $.html() || undefined, text: ($: Cheerio, _valueData: IValueData): string | undefined => $.text(), value: ($: Cheerio, _valueData: IValueData): string | undefined => $.val(), }; diff --git a/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts b/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts index 1726d01816bb2..9f89dcb10c994 100644 --- a/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts @@ -36,7 +36,7 @@ export async function hubspotApiRequest( method, qs: query, headers: {}, - uri: uri ?? `https://api.hubapi.com${endpoint}`, + uri: uri || `https://api.hubapi.com${endpoint}`, body, json: true, useQuerystring: true, @@ -85,7 +85,7 @@ export async function hubspotApiRequestAllItems( let responseData; - query.limit = query.limit ?? 250; + query.limit = query.limit || 250; query.count = 100; body.limit = body.limit || 100; diff --git a/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts b/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts index c13df80e35324..f2cfa451283cb 100644 --- a/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts +++ b/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts @@ -1412,8 +1412,8 @@ export class Hubspot implements INodeType { const additionalFields = this.getNodeParameter('additionalFields', i); const returnAll = this.getNodeParameter('returnAll', 0); const filtersGroupsUi = this.getNodeParameter('filterGroupsUi', i) as IDataObject; - const sortBy = additionalFields.sortBy ?? 'createdate'; - const direction = additionalFields.direction ?? 'DESCENDING'; + const sortBy = additionalFields.sortBy || 'createdate'; + const direction = additionalFields.direction || 'DESCENDING'; const body: IDataObject = { sorts: [ @@ -2232,8 +2232,8 @@ export class Hubspot implements INodeType { const additionalFields = this.getNodeParameter('additionalFields', i); const returnAll = this.getNodeParameter('returnAll', 0); const filtersGroupsUi = this.getNodeParameter('filterGroupsUi', i) as IDataObject; - const sortBy = additionalFields.sortBy ?? 'createdate'; - const direction = additionalFields.direction ?? 'DESCENDING'; + const sortBy = additionalFields.sortBy || 'createdate'; + const direction = additionalFields.direction || 'DESCENDING'; const body: IDataObject = { sorts: [ diff --git a/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts b/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts index f2620854a45c3..11009302d1322 100644 --- a/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts +++ b/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts @@ -320,7 +320,7 @@ export class HubspotTrigger implements INodeType { let endpoint = `/webhooks/v3/${appId}/settings`; let body: IDataObject = { targetUrl: webhookUrl, - maxConcurrentRequests: additionalFields.maxConcurrentRequests ?? 5, + maxConcurrentRequests: additionalFields.maxConcurrentRequests || 5, }; await hubspotApiRequest.call(this, 'PUT', endpoint, body); diff --git a/packages/nodes-base/nodes/Hunter/GenericFunctions.ts b/packages/nodes-base/nodes/Hunter/GenericFunctions.ts index d418d623d475f..224ee6ecb3e36 100644 --- a/packages/nodes-base/nodes/Hunter/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Hunter/GenericFunctions.ts @@ -23,7 +23,7 @@ export async function hunterApiRequest( method, qs, body, - uri: uri ?? `https://api.hunter.io/v2${resource}`, + uri: uri || `https://api.hunter.io/v2${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/If/If.node.ts b/packages/nodes-base/nodes/If/If.node.ts index ef62ad4ec8462..03c0ee0c7a85f 100644 --- a/packages/nodes-base/nodes/If/If.node.ts +++ b/packages/nodes-base/nodes/If/If.node.ts @@ -324,13 +324,13 @@ export class If implements INodeType { [key: string]: (value1: NodeParameterValue, value2: NodeParameterValue) => boolean; } = { after: (value1: NodeParameterValue, value2: NodeParameterValue) => - (value1 ?? 0) > (value2 ?? 0), + (value1 || 0) > (value2 || 0), before: (value1: NodeParameterValue, value2: NodeParameterValue) => - (value1 ?? 0) < (value2 ?? 0), + (value1 || 0) < (value2 || 0), contains: (value1: NodeParameterValue, value2: NodeParameterValue) => - (value1 ?? '').toString().includes((value2 ?? '').toString()), + (value1 || '').toString().includes((value2 || '').toString()), notContains: (value1: NodeParameterValue, value2: NodeParameterValue) => - !(value1 ?? '').toString().includes((value2 ?? '').toString()), + !(value1 || '').toString().includes((value2 || '').toString()), endsWith: (value1: NodeParameterValue, value2: NodeParameterValue) => (value1 as string).endsWith(value2 as string), notEndsWith: (value1: NodeParameterValue, value2: NodeParameterValue) => @@ -338,13 +338,13 @@ export class If implements INodeType { equal: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 === value2, notEqual: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 !== value2, larger: (value1: NodeParameterValue, value2: NodeParameterValue) => - (value1 ?? 0) > (value2 ?? 0), + (value1 || 0) > (value2 || 0), largerEqual: (value1: NodeParameterValue, value2: NodeParameterValue) => - (value1 ?? 0) >= (value2 ?? 0), + (value1 || 0) >= (value2 || 0), smaller: (value1: NodeParameterValue, value2: NodeParameterValue) => - (value1 ?? 0) < (value2 ?? 0), + (value1 || 0) < (value2 || 0), smallerEqual: (value1: NodeParameterValue, value2: NodeParameterValue) => - (value1 ?? 0) <= (value2 ?? 0), + (value1 || 0) <= (value2 || 0), startsWith: (value1: NodeParameterValue, value2: NodeParameterValue) => (value1 as string).startsWith(value2 as string), notStartsWith: (value1: NodeParameterValue, value2: NodeParameterValue) => @@ -364,32 +364,32 @@ export class If implements INodeType { (isDateObject(value1) && isDateInvalid(value1)) ), regex: (value1: NodeParameterValue, value2: NodeParameterValue) => { - const regexMatch = (value2 ?? '').toString().match(new RegExp('^/(.*?)/([gimusy]*)$')); + const regexMatch = (value2 || '').toString().match(new RegExp('^/(.*?)/([gimusy]*)$')); let regex: RegExp; if (!regexMatch) { - regex = new RegExp((value2 ?? '').toString()); + regex = new RegExp((value2 || '').toString()); } else if (regexMatch.length === 1) { regex = new RegExp(regexMatch[1]); } else { regex = new RegExp(regexMatch[1], regexMatch[2]); } - return !!(value1 ?? '').toString().match(regex); + return !!(value1 || '').toString().match(regex); }, notRegex: (value1: NodeParameterValue, value2: NodeParameterValue) => { - const regexMatch = (value2 ?? '').toString().match(new RegExp('^/(.*?)/([gimusy]*)$')); + const regexMatch = (value2 || '').toString().match(new RegExp('^/(.*?)/([gimusy]*)$')); let regex: RegExp; if (!regexMatch) { - regex = new RegExp((value2 ?? '').toString()); + regex = new RegExp((value2 || '').toString()); } else if (regexMatch.length === 1) { regex = new RegExp(regexMatch[1]); } else { regex = new RegExp(regexMatch[1], regexMatch[2]); } - return !(value1 ?? '').toString().match(regex); + return !(value1 || '').toString().match(regex); }, }; diff --git a/packages/nodes-base/nodes/Intercom/GenericFunctions.ts b/packages/nodes-base/nodes/Intercom/GenericFunctions.ts index d848c58bee75c..bfeaf71f46207 100644 --- a/packages/nodes-base/nodes/Intercom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Intercom/GenericFunctions.ts @@ -29,7 +29,7 @@ export async function intercomApiRequest( headers: headerWithAuthentication, method, qs: query, - uri: uri ?? `https://api.intercom.io${endpoint}`, + uri: uri || `https://api.intercom.io${endpoint}`, body, json: true, }; diff --git a/packages/nodes-base/nodes/InvoiceNinja/GenericFunctions.ts b/packages/nodes-base/nodes/InvoiceNinja/GenericFunctions.ts index 277cbb6181a5b..3f8efa2e1312e 100644 --- a/packages/nodes-base/nodes/InvoiceNinja/GenericFunctions.ts +++ b/packages/nodes-base/nodes/InvoiceNinja/GenericFunctions.ts @@ -41,7 +41,7 @@ export async function invoiceNinjaApiRequest( const options: OptionsWithUri = { method, qs: query, - uri: uri ?? `${baseUrl}/api/v1${endpoint}`, + uri: uri || `${baseUrl}/api/v1${endpoint}`, body, json: true, }; diff --git a/packages/nodes-base/nodes/InvoiceNinja/InvoiceNinja.node.ts b/packages/nodes-base/nodes/InvoiceNinja/InvoiceNinja.node.ts index 5d3c83305a8bd..7ecea8baceaaa 100644 --- a/packages/nodes-base/nodes/InvoiceNinja/InvoiceNinja.node.ts +++ b/packages/nodes-base/nodes/InvoiceNinja/InvoiceNinja.node.ts @@ -198,7 +198,7 @@ export class InvoiceNinja implements INodeType { '/invoices', ); for (const invoice of invoices) { - const invoiceName = (invoice.invoice_number ?? invoice.number) as string; + const invoiceName = (invoice.invoice_number || invoice.number) as string; const invoiceId = invoice.id as string; returnData.push({ name: invoiceName, diff --git a/packages/nodes-base/nodes/Iterable/GenericFunctions.ts b/packages/nodes-base/nodes/Iterable/GenericFunctions.ts index 2130d25691c47..ba327f37c61ce 100644 --- a/packages/nodes-base/nodes/Iterable/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Iterable/GenericFunctions.ts @@ -24,7 +24,7 @@ export async function iterableApiRequest( method, body, qs, - uri: uri ?? `https://api.iterable.com/api${resource}`, + uri: uri || `https://api.iterable.com/api${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Jira/GenericFunctions.ts b/packages/nodes-base/nodes/Jira/GenericFunctions.ts index d90bf6ae96946..c869e61f6dd92 100644 --- a/packages/nodes-base/nodes/Jira/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Jira/GenericFunctions.ts @@ -40,7 +40,7 @@ export async function jiraSoftwareCloudApiRequest( }, method, qs: query, - uri: uri ?? `${domain}/rest${endpoint}`, + uri: uri || `${domain}/rest${endpoint}`, body, json: true, }; diff --git a/packages/nodes-base/nodes/Jira/Jira.node.ts b/packages/nodes-base/nodes/Jira/Jira.node.ts index 85f09f45763e5..ace29863c9ef9 100644 --- a/packages/nodes-base/nodes/Jira/Jira.node.ts +++ b/packages/nodes-base/nodes/Jira/Jira.node.ts @@ -286,7 +286,7 @@ export class Jira implements INodeType { if (user.active) { activeUsers.push({ name: user.displayName as string, - value: (user.accountId ?? user.name) as string, + value: (user.accountId || user.name) as string, }); } return activeUsers; @@ -684,7 +684,7 @@ export class Jira implements INodeType { qs.expand = additionalFields.expand as string; } if (simplifyOutput) { - qs.expand = `${qs.expand ?? ''},names`; + qs.expand = `${qs.expand || ''},names`; } if (additionalFields.properties) { qs.properties = additionalFields.properties as string; @@ -702,7 +702,7 @@ export class Jira implements INodeType { if (simplifyOutput) { // Use rendered fields if requested and available - qs.expand = qs.expand ?? ''; + qs.expand = qs.expand || ''; if ( (qs.expand as string).toLowerCase().indexOf('renderedfields') !== -1 && responseData.renderedFields && diff --git a/packages/nodes-base/nodes/JotForm/GenericFunctions.ts b/packages/nodes-base/nodes/JotForm/GenericFunctions.ts index 823df81d5b77c..04cfe5a9f8286 100644 --- a/packages/nodes-base/nodes/JotForm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/JotForm/GenericFunctions.ts @@ -32,7 +32,7 @@ export async function jotformApiRequest( method, qs, form: body, - uri: uri ?? `https://${credentials.apiDomain || 'api.jotform.com'}${resource}`, + uri: uri || `https://${credentials.apiDomain || 'api.jotform.com'}${resource}`, json: true, }; if (!Object.keys(body).length) { diff --git a/packages/nodes-base/nodes/Kafka/KafkaTrigger.node.ts b/packages/nodes-base/nodes/Kafka/KafkaTrigger.node.ts index 9a0fd50e7cecf..e35ba9b95fa41 100644 --- a/packages/nodes-base/nodes/Kafka/KafkaTrigger.node.ts +++ b/packages/nodes-base/nodes/Kafka/KafkaTrigger.node.ts @@ -248,7 +248,7 @@ export class KafkaTrigger implements INodeType { const headers: { [key: string]: string } = {}; for (const key of Object.keys(message.headers)) { const header = message.headers[key]; - headers[key] = header?.toString('utf8') ?? ''; + headers[key] = header?.toString('utf8') || ''; } data.headers = headers; diff --git a/packages/nodes-base/nodes/Keap/GenericFunctions.ts b/packages/nodes-base/nodes/Keap/GenericFunctions.ts index 7687941359c8c..d1142f3e786e7 100644 --- a/packages/nodes-base/nodes/Keap/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Keap/GenericFunctions.ts @@ -29,7 +29,7 @@ export async function keapApiRequest( method, body, qs, - uri: uri ?? `https://api.infusionsoft.com/crm/rest/v1${resource}`, + uri: uri || `https://api.infusionsoft.com/crm/rest/v1${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/KoBoToolbox/GenericFunctions.ts b/packages/nodes-base/nodes/KoBoToolbox/GenericFunctions.ts index 35fcb6b0fc8ad..2c611d39206fe 100644 --- a/packages/nodes-base/nodes/KoBoToolbox/GenericFunctions.ts +++ b/packages/nodes-base/nodes/KoBoToolbox/GenericFunctions.ts @@ -158,7 +158,7 @@ export function formatSubmission( .split('/') .map((k) => _.trim(k, ' _')) .join('.'); - const leafKey = sanitizedKey.split('.').pop() ?? ''; + const leafKey = sanitizedKey.split('.').pop() || ''; let format = 'string'; if (_.some(numberMasks, (mask) => matchWildcard(leafKey, mask))) { format = 'number'; @@ -204,7 +204,7 @@ export async function downloadAttachments( const credentials = await this.getCredentials('koBoToolboxApi'); // Look for attachment links - there can be more than one - const attachmentList = (submission._attachments ?? submission.attachments) as any[]; + const attachmentList = (submission._attachments || submission.attachments) as any[]; if (attachmentList?.length) { for (const [index, attachment] of attachmentList.entries()) { @@ -266,7 +266,7 @@ export async function downloadAttachments( if ('question' === options.binaryNamingScheme && relatedQuestion) { binaryName = relatedQuestion; } else { - binaryName = `${options.dataPropertyAttachmentsPrefixName ?? 'attachment_'}${index}`; + binaryName = `${options.dataPropertyAttachmentsPrefixName || 'attachment_'}${index}`; } binaryItem.binary![binaryName] = await this.helpers.prepareBinaryData( diff --git a/packages/nodes-base/nodes/Line/GenericFunctions.ts b/packages/nodes-base/nodes/Line/GenericFunctions.ts index 6c648e07de8a9..b555cf1a54503 100644 --- a/packages/nodes-base/nodes/Line/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Line/GenericFunctions.ts @@ -26,7 +26,7 @@ export async function lineApiRequest( method, body, qs, - uri: uri ?? '', + uri: uri || '', json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts b/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts index 5e622d41bc902..43ccba7b8a9e2 100644 --- a/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts +++ b/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function lingvaNexApiRequest( method, qs, body, - uri: uri ?? `https://api-b2b.backenster.com/b1/api/v3${resource}`, + uri: uri || `https://api-b2b.backenster.com/b1/api/v3${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Magento/GenericFunctions.ts b/packages/nodes-base/nodes/Magento/GenericFunctions.ts index 38626f44355d1..e1aa52fd3cbef 100644 --- a/packages/nodes-base/nodes/Magento/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Magento/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function magentoApiRequest( method, body, qs, - uri: uri ?? `${credentials.host}${resource}`, + uri: uri || `${credentials.host}${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Mailcheck/GenericFunctions.ts b/packages/nodes-base/nodes/Mailcheck/GenericFunctions.ts index b7779cbc73f0d..cd795dc1e1e0d 100644 --- a/packages/nodes-base/nodes/Mailcheck/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mailcheck/GenericFunctions.ts @@ -30,7 +30,7 @@ export async function mailCheckApiRequest( method, body, qs, - uri: uri ?? `https://api.mailcheck.co/v1${resource}`, + uri: uri || `https://api.mailcheck.co/v1${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Mailgun/Mailgun.node.ts b/packages/nodes-base/nodes/Mailgun/Mailgun.node.ts index 973b0d33a85e2..cfc3cced20486 100644 --- a/packages/nodes-base/nodes/Mailgun/Mailgun.node.ts +++ b/packages/nodes-base/nodes/Mailgun/Mailgun.node.ts @@ -156,7 +156,7 @@ export class Mailgun implements INodeType { attachments.push({ value: binaryDataBuffer, options: { - filename: item.binary[propertyName].fileName ?? 'unknown', + filename: item.binary[propertyName].fileName || 'unknown', }, }); } diff --git a/packages/nodes-base/nodes/Mailjet/GenericFunctions.ts b/packages/nodes-base/nodes/Mailjet/GenericFunctions.ts index 217164a5c3294..2c0982eeaf70d 100644 --- a/packages/nodes-base/nodes/Mailjet/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mailjet/GenericFunctions.ts @@ -39,7 +39,7 @@ export async function mailjetApiRequest( method, qs, body, - uri: uri ?? `https://api.mailjet.com${path}`, + uri: uri || `https://api.mailjet.com${path}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/Mandrill/Mandrill.node.ts b/packages/nodes-base/nodes/Mandrill/Mandrill.node.ts index 21c7bb5354d52..117e09916d991 100644 --- a/packages/nodes-base/nodes/Mandrill/Mandrill.node.ts +++ b/packages/nodes-base/nodes/Mandrill/Mandrill.node.ts @@ -855,7 +855,7 @@ export class Mandrill implements INodeType { attachmentsBinary = _.map(attachmentsUi.attachmentsBinary, (o: IDataObject) => { if (items[i].binary!.hasOwnProperty(o.property as string)) { const aux: IDataObject = {}; - aux.name = items[i].binary![o.property as string].fileName ?? 'unknown'; + aux.name = items[i].binary![o.property as string].fileName || 'unknown'; aux.content = items[i].binary![o.property as string].data; aux.type = items[i].binary![o.property as string].mimeType; return aux; diff --git a/packages/nodes-base/nodes/Matrix/GenericFunctions.ts b/packages/nodes-base/nodes/Matrix/GenericFunctions.ts index 2d1dc762af7b9..261b539ec7b2b 100644 --- a/packages/nodes-base/nodes/Matrix/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Matrix/GenericFunctions.ts @@ -18,7 +18,7 @@ export async function matrixApiRequest( ) { let options: OptionsWithUri = { method, - headers: headers ?? { + headers: headers || { 'Content-Type': 'application/json; charset=utf-8', }, body, @@ -38,7 +38,7 @@ export async function matrixApiRequest( options.uri = `${credentials.homeserverUrl}/_matrix/${ //@ts-ignore - option.overridePrefix ?? 'client' + option.overridePrefix || 'client' }/r0${resource}`; options.headers!.Authorization = `Bearer ${credentials.accessToken}`; const response = await this.helpers.request(options); diff --git a/packages/nodes-base/nodes/Mautic/GenericFunctions.ts b/packages/nodes-base/nodes/Mautic/GenericFunctions.ts index b620c59bed3ac..62baf83dc0275 100644 --- a/packages/nodes-base/nodes/Mautic/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mautic/GenericFunctions.ts @@ -23,7 +23,7 @@ export async function mauticApiRequest( headers: {}, method, qs: query, - uri: uri ?? `/api${endpoint}`, + uri: uri || `/api${endpoint}`, body, json: true, }; diff --git a/packages/nodes-base/nodes/Medium/GenericFunctions.ts b/packages/nodes-base/nodes/Medium/GenericFunctions.ts index ea10e1050c97a..9c3a1d9616646 100644 --- a/packages/nodes-base/nodes/Medium/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Medium/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function mediumApiRequest( 'Accept-Charset': 'utf-8', }, qs: query, - uri: uri ?? `https://api.medium.com/v1${endpoint}`, + uri: uri || `https://api.medium.com/v1${endpoint}`, body, json: true, }; diff --git a/packages/nodes-base/nodes/Microsoft/Dynamics/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Dynamics/GenericFunctions.ts index 1e1d248f1a0ec..badd71769169c 100644 --- a/packages/nodes-base/nodes/Microsoft/Dynamics/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Dynamics/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function microsoftApiRequest( method, body, qs, - uri: uri ?? `https://${credentials.subdomain}.${credentials.region}/api/data/v9.2${resource}`, + uri: uri || `https://${credentials.subdomain}.${credentials.region}/api/data/v9.2${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Microsoft/Excel/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Excel/GenericFunctions.ts index 26aff346aa73e..aacb40c23deaf 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/GenericFunctions.ts @@ -19,7 +19,7 @@ export async function microsoftApiRequest( method, body, qs, - uri: uri ?? `https://graph.microsoft.com/v1.0/me${resource}`, + uri: uri || `https://graph.microsoft.com/v1.0/me${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Microsoft/OneDrive/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/OneDrive/GenericFunctions.ts index eb85f887bed73..d4d65094696fa 100644 --- a/packages/nodes-base/nodes/Microsoft/OneDrive/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/OneDrive/GenericFunctions.ts @@ -22,7 +22,7 @@ export async function microsoftApiRequest( method, body, qs, - uri: uri ?? `https://graph.microsoft.com/v1.0/me${resource}`, + uri: uri || `https://graph.microsoft.com/v1.0/me${resource}`, }; try { Object.assign(options, option); diff --git a/packages/nodes-base/nodes/Microsoft/Outlook/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Outlook/GenericFunctions.ts index 7381a21641fd8..71285ed85278e 100644 --- a/packages/nodes-base/nodes/Microsoft/Outlook/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Outlook/GenericFunctions.ts @@ -35,7 +35,7 @@ export async function microsoftApiRequest( method, body, qs, - uri: uri ?? apiUrl, + uri: uri || apiUrl, }; try { Object.assign(options, option); diff --git a/packages/nodes-base/nodes/Microsoft/Teams/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Teams/GenericFunctions.ts index b734b52087553..7c53d59bcb1d7 100644 --- a/packages/nodes-base/nodes/Microsoft/Teams/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Teams/GenericFunctions.ts @@ -21,7 +21,7 @@ export async function microsoftApiRequest( method, body, qs, - uri: uri ?? `https://graph.microsoft.com${resource}`, + uri: uri || `https://graph.microsoft.com${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts index 6bb66ad2ae053..a8e1dbdf00677 100644 --- a/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts @@ -21,7 +21,7 @@ export async function microsoftApiRequest( method, body, qs, - uri: uri ?? `https://graph.microsoft.com/v1.0/me${resource}`, + uri: uri || `https://graph.microsoft.com/v1.0/me${resource}`, }; try { Object.assign(options, option); diff --git a/packages/nodes-base/nodes/MySql/GenericFunctions.ts b/packages/nodes-base/nodes/MySql/GenericFunctions.ts index 376d0cfb22383..bf9b4aa634353 100644 --- a/packages/nodes-base/nodes/MySql/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MySql/GenericFunctions.ts @@ -62,7 +62,7 @@ export async function searchTables( const sql = ` SELECT table_name FROM information_schema.tables WHERE table_schema = '${credentials.database}' - and table_name like '%${query ?? ''}%' + and table_name like '%${query || ''}%' ORDER BY table_name `; const [rows] = await connection.query(sql); diff --git a/packages/nodes-base/nodes/N8n/GenericFunctions.ts b/packages/nodes-base/nodes/N8n/GenericFunctions.ts index 1712d0e69361a..b069ef0e1543e 100644 --- a/packages/nodes-base/nodes/N8n/GenericFunctions.ts +++ b/packages/nodes-base/nodes/N8n/GenericFunctions.ts @@ -25,7 +25,7 @@ export async function apiRequest( body: object, query?: IDataObject, ): Promise { - query = query ?? {}; + query = query || {}; type N8nApiCredentials = { apiKey: string; @@ -60,7 +60,7 @@ export async function apiRequestAllItems( body: object, query?: IDataObject, ): Promise { - query = query ?? {}; + query = query || {}; const returnData: IDataObject[] = []; let nextCursor: string | undefined = undefined; @@ -190,11 +190,11 @@ export const prepareWorkflowCreateBody: PreSendAction = async function ( const body = requestOptions.body as IDataObject; const newBody: IDataObject = {}; - newBody.name = body.name ?? 'My workflow'; - newBody.nodes = body.nodes ?? []; - newBody.settings = body.settings ?? {}; - newBody.connections = body.connections ?? {}; - newBody.staticData = body.staticData ?? null; + newBody.name = body.name || 'My workflow'; + newBody.nodes = body.nodes || []; + newBody.settings = body.settings || {}; + newBody.connections = body.connections || {}; + newBody.staticData = body.staticData || null; requestOptions.body = newBody; diff --git a/packages/nodes-base/nodes/Nasa/GenericFunctions.ts b/packages/nodes-base/nodes/Nasa/GenericFunctions.ts index 2b168b133ca24..eee6487f71c26 100644 --- a/packages/nodes-base/nodes/Nasa/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Nasa/GenericFunctions.ts @@ -19,7 +19,7 @@ export async function nasaApiRequest( const options: OptionsWithUri = { method, qs, - uri: uri ?? `https://api.nasa.gov${endpoint}`, + uri: uri || `https://api.nasa.gov${endpoint}`, json: true, }; diff --git a/packages/nodes-base/nodes/Netlify/GenericFunctions.ts b/packages/nodes-base/nodes/Netlify/GenericFunctions.ts index 2bbc82035c148..e1d9a3081a1cc 100644 --- a/packages/nodes-base/nodes/Netlify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Netlify/GenericFunctions.ts @@ -26,7 +26,7 @@ export async function netlifyApiRequest( }, qs: query, body, - uri: uri ?? `https://api.netlify.com/api/v1${endpoint}`, + uri: uri || `https://api.netlify.com/api/v1${endpoint}`, json: true, }; diff --git a/packages/nodes-base/nodes/NocoDB/GenericFunctions.ts b/packages/nodes-base/nodes/NocoDB/GenericFunctions.ts index b164d62043d1f..30656a7f86faf 100644 --- a/packages/nodes-base/nodes/NocoDB/GenericFunctions.ts +++ b/packages/nodes-base/nodes/NocoDB/GenericFunctions.ts @@ -40,7 +40,7 @@ export async function apiRequest( const baseUrl = credentials.host as string; - query = query ?? {}; + query = query || {}; const options: OptionsWithUri = { method, diff --git a/packages/nodes-base/nodes/Notion/GenericFunctions.ts b/packages/nodes-base/nodes/Notion/GenericFunctions.ts index 53c00cf725d04..1fc6871087261 100644 --- a/packages/nodes-base/nodes/Notion/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Notion/GenericFunctions.ts @@ -53,7 +53,7 @@ export async function notionApiRequest( method, qs, body, - uri: uri ?? `https://api.notion.com/v1${resource}`, + uri: uri || `https://api.notion.com/v1${resource}`, json: true, }; options = Object.assign({}, options, option); @@ -505,13 +505,13 @@ function simplifyProperty(property: any) { } } else if (['multi_select'].includes(property.type)) { if (Array.isArray(property[type])) { - result = property[type].map((e: IDataObject) => e.name ?? {}); + result = property[type].map((e: IDataObject) => e.name || {}); } else { - result = property[type].options.map((e: IDataObject) => e.name ?? {}); + result = property[type].options.map((e: IDataObject) => e.name || {}); } } else if (['relation'].includes(property.type)) { if (Array.isArray(property[type])) { - result = property[type].map((e: IDataObject) => e.id ?? {}); + result = property[type].map((e: IDataObject) => e.id || {}); } else { result = property[type].database_id; } diff --git a/packages/nodes-base/nodes/Odoo/GenericFunctions.ts b/packages/nodes-base/nodes/Odoo/GenericFunctions.ts index 4153502a42d6b..0d649d29dcb5b 100644 --- a/packages/nodes-base/nodes/Odoo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Odoo/GenericFunctions.ts @@ -236,7 +236,7 @@ export async function odooGet( mapOdooResources[resource] || resource, mapOperationToJSONRPC[operation], [+itemsID] || [], - fieldsToReturn ?? [], + fieldsToReturn || [], ], }, id: Math.floor(Math.random() * 100), @@ -275,7 +275,7 @@ export async function odooGetAll( mapOdooResources[resource] || resource, mapOperationToJSONRPC[operation], (filters && processFilters(filters)) || [], - fieldsToReturn ?? [], + fieldsToReturn || [], 0, // offset limit, ], diff --git a/packages/nodes-base/nodes/OneSimpleApi/GenericFunctions.ts b/packages/nodes-base/nodes/OneSimpleApi/GenericFunctions.ts index 479b1a58d2653..42bf45f14e7a3 100644 --- a/packages/nodes-base/nodes/OneSimpleApi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/OneSimpleApi/GenericFunctions.ts @@ -21,7 +21,7 @@ export async function oneSimpleApiRequest( body, qs, uri: - uri ?? + uri || `https://onesimpleapi.com/api${resource}?token=${credentials.apiToken}&output=${outputFormat}`, json: true, }; diff --git a/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts b/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts index 4b018e842bd47..f276b5b5e0c12 100644 --- a/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts @@ -37,7 +37,7 @@ export async function onfleetApiRequest( method, body, qs, - uri: uri ?? `https://onfleet.com/api/v2/${resource}`, + uri: uri || `https://onfleet.com/api/v2/${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts b/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts index 87fac2c57cf04..7b4c69c193401 100644 --- a/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts +++ b/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts @@ -27,7 +27,7 @@ export async function openThesaurusApiRequest( method, qs, body, - uri: uri ?? `https://www.openthesaurus.de${resource}`, + uri: uri || `https://www.openthesaurus.de${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Orbit/GenericFunctions.ts b/packages/nodes-base/nodes/Orbit/GenericFunctions.ts index fc102df60f41d..83cbb27eb43eb 100644 --- a/packages/nodes-base/nodes/Orbit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Orbit/GenericFunctions.ts @@ -30,7 +30,7 @@ export async function orbitApiRequest( method, qs, body, - uri: uri ?? `https://app.orbit.love/api/v1${resource}`, + uri: uri || `https://app.orbit.love/api/v1${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Oura/GenericFunctions.ts b/packages/nodes-base/nodes/Oura/GenericFunctions.ts index 3c8bf14e48f88..4f3655c5e805c 100644 --- a/packages/nodes-base/nodes/Oura/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Oura/GenericFunctions.ts @@ -26,7 +26,7 @@ export async function ouraApiRequest( method, qs, body, - uri: uri ?? `https://api.ouraring.com/v1${resource}`, + uri: uri || `https://api.ouraring.com/v1${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts b/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts index 5fc2299498306..3a2cb7ee735ad 100644 --- a/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts @@ -25,7 +25,7 @@ export async function pagerDutyApiRequest( method, body, qs: query, - uri: uri ?? `https://api.pagerduty.com${resource}`, + uri: uri || `https://api.pagerduty.com${resource}`, json: true, qsStringifyOptions: { arrayFormat: 'brackets', diff --git a/packages/nodes-base/nodes/PayPal/GenericFunctions.ts b/packages/nodes-base/nodes/PayPal/GenericFunctions.ts index 1d7c2fc3d792e..76e806b4c316e 100644 --- a/packages/nodes-base/nodes/PayPal/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PayPal/GenericFunctions.ts @@ -75,8 +75,8 @@ export async function payPalApiRequest( const options = { headers: headerWithAuthentication, method, - qs: query ?? {}, - uri: uri ?? `${env}/v1${endpoint}`, + qs: query || {}, + uri: uri || `${env}/v1${endpoint}`, body, json: true, }; diff --git a/packages/nodes-base/nodes/Peekalink/GenericFunctions.ts b/packages/nodes-base/nodes/Peekalink/GenericFunctions.ts index 86f19db6ca9ff..5a5a4ce3ee0e9 100644 --- a/packages/nodes-base/nodes/Peekalink/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Peekalink/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function peekalinkApiRequest( method, qs, body, - uri: uri ?? `https://api.peekalink.io${resource}`, + uri: uri || `https://api.peekalink.io${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/PhilipsHue/GenericFunctions.ts b/packages/nodes-base/nodes/PhilipsHue/GenericFunctions.ts index 88bdd0fa64d48..f1f5cbe891393 100644 --- a/packages/nodes-base/nodes/PhilipsHue/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PhilipsHue/GenericFunctions.ts @@ -21,7 +21,7 @@ export async function philipsHueApiRequest( method, body, qs, - uri: uri ?? `https://api.meethue.com/route${resource}`, + uri: uri || `https://api.meethue.com/route${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts b/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts index 73ce29f581f66..64d338ea9f35d 100644 --- a/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function profitWellApiRequest( method, qs, body, - uri: uri ?? `https://api.profitwell.com/v2${resource}`, + uri: uri || `https://api.profitwell.com/v2${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Pushbullet/GenericFunctions.ts b/packages/nodes-base/nodes/Pushbullet/GenericFunctions.ts index 120243966c357..5dc7a7dcc4ef6 100644 --- a/packages/nodes-base/nodes/Pushbullet/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Pushbullet/GenericFunctions.ts @@ -18,7 +18,7 @@ export async function pushbulletApiRequest( method, body, qs, - uri: uri ?? `https://api.pushbullet.com/v2${path}`, + uri: uri || `https://api.pushbullet.com/v2${path}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts b/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts index 0612d38cc21f6..b29003d7e7e65 100644 --- a/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts @@ -23,7 +23,7 @@ export async function pushcutApiRequest( method, body, qs, - uri: uri ?? `https://api.pushcut.io/v1${path}`, + uri: uri || `https://api.pushcut.io/v1${path}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/QuestDb/QuestDb.node.ts b/packages/nodes-base/nodes/QuestDb/QuestDb.node.ts index 6a612608397b6..b041a2b1666f0 100644 --- a/packages/nodes-base/nodes/QuestDb/QuestDb.node.ts +++ b/packages/nodes-base/nodes/QuestDb/QuestDb.node.ts @@ -219,7 +219,7 @@ export class QuestDb implements INodeType { // ---------------------------------- const additionalFields = this.getNodeParameter('additionalFields', 0); - const mode = (additionalFields.mode ?? 'independently') as string; + const mode = (additionalFields.mode || 'independently') as string; const queryResult = await pgQuery( this.getNodeParameter, diff --git a/packages/nodes-base/nodes/Redis/Redis.node.ts b/packages/nodes-base/nodes/Redis/Redis.node.ts index 2038926ba5c95..51efea49b4be8 100644 --- a/packages/nodes-base/nodes/Redis/Redis.node.ts +++ b/packages/nodes-base/nodes/Redis/Redis.node.ts @@ -702,7 +702,7 @@ export class Redis implements INodeType { const keyGet = this.getNodeParameter('key', itemIndex) as string; const keyType = this.getNodeParameter('keyType', itemIndex) as string; - const value = (await getValue(client, keyGet, keyType)) ?? null; + const value = (await getValue(client, keyGet, keyType)) || null; const options = this.getNodeParameter('options', itemIndex, {}); diff --git a/packages/nodes-base/nodes/S3/GenericFunctions.ts b/packages/nodes-base/nodes/S3/GenericFunctions.ts index dfca7eb62b885..554a9c2ae9bce 100644 --- a/packages/nodes-base/nodes/S3/GenericFunctions.ts +++ b/packages/nodes-base/nodes/S3/GenericFunctions.ts @@ -57,8 +57,8 @@ export async function s3ApiRequest( // Sign AWS API request with the user credentials const signOpts = { - headers: headers ?? {}, - region: region ?? credentials.region, + headers: headers || {}, + region: region || credentials.region, host: endpoint.host, method, path: `${path}?${queryToString(query).replace(/\+/g, '%2B')}`, diff --git a/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts b/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts index 3ed5870f1ae94..839e8058414fd 100644 --- a/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts @@ -104,7 +104,7 @@ export async function salesforceApiRequest( const options = getOptions.call( this, method, - uri ?? endpoint, + uri || endpoint, body, qs, instance_url as string, @@ -125,7 +125,7 @@ export async function salesforceApiRequest( const options = getOptions.call( this, method, - uri ?? endpoint, + uri || endpoint, body, qs, credentials.oauthTokenData.instance_url, diff --git a/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts b/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts index 3c5e081da8f0d..5a126745735ab 100644 --- a/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts +++ b/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts @@ -1854,7 +1854,7 @@ export class Salesforce implements INodeType { const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName); body.entity_content.PathOnClient = `${title}.${ - additionalFields.fileExtension ?? binaryData.fileExtension + additionalFields.fileExtension || binaryData.fileExtension }`; data = { entity_content: { diff --git a/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts b/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts index f955040bc059a..fcfad002d9216 100644 --- a/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts @@ -34,7 +34,7 @@ export async function salesmateApiRequest( method, qs, body, - uri: uri ?? `https://apis.salesmate.io${resource}`, + uri: uri || `https://apis.salesmate.io${resource}`, json: true, }; if (!Object.keys(body).length) { diff --git a/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts b/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts index 1723af341a99e..9c5c0a8639e9b 100644 --- a/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts @@ -65,7 +65,7 @@ function endpointCtxExpr(ctx: ICtx, endpoint: string): string { return endpoint.replace( /({{ *(access_token|dtable_uuid|server) *}})/g, (match: string, expr: string, name: TEndpointVariableName) => { - return endpointVariables[name] ?? match; + return endpointVariables[name] || match; }, ); } @@ -94,7 +94,7 @@ export async function seaTableApiRequest( method, qs, body, - uri: url ?? `${resolveBaseUri(ctx)}${endpointCtxExpr(ctx, endpoint)}`, + uri: url || `${resolveBaseUri(ctx)}${endpointCtxExpr(ctx, endpoint)}`, json: true, }; diff --git a/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts b/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts index 057aae770c145..20d5909f5986b 100644 --- a/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts @@ -22,7 +22,7 @@ export async function scorecardApiRequest( headers: headerWithAuthentication, method, qs: query, - uri: uri ?? `https://api.securityscorecard.io/${resource}`, + uri: uri || `https://api.securityscorecard.io/${resource}`, body, json: true, }; diff --git a/packages/nodes-base/nodes/SecurityScorecard/SecurityScorecard.node.ts b/packages/nodes-base/nodes/SecurityScorecard/SecurityScorecard.node.ts index dc1e5ff7a6fed..ab2a5c8fa3d80 100644 --- a/packages/nodes-base/nodes/SecurityScorecard/SecurityScorecard.node.ts +++ b/packages/nodes-base/nodes/SecurityScorecard/SecurityScorecard.node.ts @@ -267,7 +267,7 @@ export class SecurityScorecard implements INodeType { body.date = this.getNodeParameter('date', i); } if (['issues', 'portfolio'].indexOf(reportType) > -1) { - body.format = this.getNodeParameter('options.format', i) ?? 'pdf'; + body.format = this.getNodeParameter('options.format', i) || 'pdf'; } if (['detailed', 'summary'].indexOf(reportType) > -1) { body.branding = this.getNodeParameter('branding', i); diff --git a/packages/nodes-base/nodes/Segment/GenericFunctions.ts b/packages/nodes-base/nodes/Segment/GenericFunctions.ts index a854e2093b229..1ef2b7600c8b3 100644 --- a/packages/nodes-base/nodes/Segment/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Segment/GenericFunctions.ts @@ -29,7 +29,7 @@ export async function segmentApiRequest( method, qs, body, - uri: uri ?? `https://api.segment.io/v1${resource}`, + uri: uri || `https://api.segment.io/v1${resource}`, json: true, }; if (!Object.keys(body).length) { diff --git a/packages/nodes-base/nodes/SendGrid/SendGrid.node.ts b/packages/nodes-base/nodes/SendGrid/SendGrid.node.ts index f2f50cc46b60a..3b15f105a27e3 100644 --- a/packages/nodes-base/nodes/SendGrid/SendGrid.node.ts +++ b/packages/nodes-base/nodes/SendGrid/SendGrid.node.ts @@ -601,7 +601,7 @@ export class SendGrid implements INodeType { attachmentsToSend.push({ content: dataBuffer.toString('base64'), - filename: binaryProperty.fileName ?? 'unknown', + filename: binaryProperty.fileName || 'unknown', type: binaryProperty.mimeType, }); } diff --git a/packages/nodes-base/nodes/SendInBlue/GenericFunctions.ts b/packages/nodes-base/nodes/SendInBlue/GenericFunctions.ts index 187832b6636b2..b3c8d67ad1555 100644 --- a/packages/nodes-base/nodes/SendInBlue/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SendInBlue/GenericFunctions.ts @@ -112,7 +112,7 @@ export namespace SendInBlueNode { itemIndex, mimeType, fileExtension!, - fileName ?? item.binary!.data.fileName!, + fileName || item.binary!.data.fileName!, ); attachment.push({ content, name }); diff --git a/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts b/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts index 7eb309282f6fd..e900a2ce1d4f9 100644 --- a/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts @@ -34,7 +34,7 @@ export async function sentryIoApiRequest( method, qs, body, - uri: uri ?? `https://sentry.io${resource}`, + uri: uri || `https://sentry.io${resource}`, json: true, }; if (!Object.keys(body).length) { diff --git a/packages/nodes-base/nodes/ServiceNow/GenericFunctions.ts b/packages/nodes-base/nodes/ServiceNow/GenericFunctions.ts index dea8501becaf0..12329a7878faa 100644 --- a/packages/nodes-base/nodes/ServiceNow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ServiceNow/GenericFunctions.ts @@ -30,7 +30,7 @@ export async function serviceNowApiRequest( method, qs, body, - uri: uri ?? `https://${credentials.subdomain}.service-now.com/api${resource}`, + uri: uri || `https://${credentials.subdomain}.service-now.com/api${resource}`, json: true, }; if (!Object.keys(body).length) { diff --git a/packages/nodes-base/nodes/Shopify/GenericFunctions.ts b/packages/nodes-base/nodes/Shopify/GenericFunctions.ts index ea7f25bb3c311..3d035fef9730f 100644 --- a/packages/nodes-base/nodes/Shopify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Shopify/GenericFunctions.ts @@ -39,7 +39,7 @@ export async function shopifyApiRequest( const options: OptionsWithUri = { method, qs: query, - uri: uri ?? `https://${credentials.shopSubdomain}.myshopify.com/admin/api/2019-10${resource}`, + uri: uri || `https://${credentials.shopSubdomain}.myshopify.com/admin/api/2019-10${resource}`, body, json: true, }; diff --git a/packages/nodes-base/nodes/Slack/GenericFunctions.ts b/packages/nodes-base/nodes/Slack/GenericFunctions.ts index 931136884736b..b6d4a136c1029 100644 --- a/packages/nodes-base/nodes/Slack/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Slack/GenericFunctions.ts @@ -24,7 +24,7 @@ export async function slackApiRequest( const authenticationMethod = this.getNodeParameter('authentication', 0, 'accessToken') as string; let options: OptionsWithUri = { method, - headers: headers ?? { + headers: headers || { 'Content-Type': 'application/json; charset=utf-8', }, body, diff --git a/packages/nodes-base/nodes/Spotify/GenericFunctions.ts b/packages/nodes-base/nodes/Spotify/GenericFunctions.ts index 34af2ce7fc8d9..97e8496696d98 100644 --- a/packages/nodes-base/nodes/Spotify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Spotify/GenericFunctions.ts @@ -26,7 +26,7 @@ export async function spotifyApiRequest( Accept: ' application/json', }, qs: query, - uri: uri ?? `https://api.spotify.com/v1${endpoint}`, + uri: uri || `https://api.spotify.com/v1${endpoint}`, json: true, }; diff --git a/packages/nodes-base/nodes/Stackby/GenericFunction.ts b/packages/nodes-base/nodes/Stackby/GenericFunction.ts index fcdf29fd32f7b..ebfa42636eac4 100644 --- a/packages/nodes-base/nodes/Stackby/GenericFunction.ts +++ b/packages/nodes-base/nodes/Stackby/GenericFunction.ts @@ -27,7 +27,7 @@ export async function apiRequest( method, body, qs: query, - uri: uri ?? `https://stackby.com/api/betav1${endpoint}`, + uri: uri || `https://stackby.com/api/betav1${endpoint}`, json: true, }; diff --git a/packages/nodes-base/nodes/Strava/GenericFunctions.ts b/packages/nodes-base/nodes/Strava/GenericFunctions.ts index 4c213202e7d71..f43ceb272e14b 100644 --- a/packages/nodes-base/nodes/Strava/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Strava/GenericFunctions.ts @@ -29,7 +29,7 @@ export async function stravaApiRequest( method, form: body, qs, - uri: uri ?? `https://www.strava.com/api/v3${resource}`, + uri: uri || `https://www.strava.com/api/v3${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Supabase/GenericFunctions.ts b/packages/nodes-base/nodes/Supabase/GenericFunctions.ts index 64f4c2f99cdd2..c7744d28438c1 100644 --- a/packages/nodes-base/nodes/Supabase/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Supabase/GenericFunctions.ts @@ -43,7 +43,7 @@ export async function supabaseApiRequest( method, qs, body, - uri: uri ?? `${credentials.host}/rest/v1${resource}`, + uri: uri || `${credentials.host}/rest/v1${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts b/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts index 095d75b90f4f3..6c9cea0cc04bc 100644 --- a/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts @@ -25,7 +25,7 @@ export async function surveyMonkeyApiRequest( method, body, qs: query, - uri: uri ?? `${endpoint}${resource}`, + uri: uri || `${endpoint}${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/SurveyMonkey/SurveyMonkeyTrigger.node.ts b/packages/nodes-base/nodes/SurveyMonkey/SurveyMonkeyTrigger.node.ts index d8843377d2dc6..5d3ca8cd7a146 100644 --- a/packages/nodes-base/nodes/SurveyMonkey/SurveyMonkeyTrigger.node.ts +++ b/packages/nodes-base/nodes/SurveyMonkey/SurveyMonkeyTrigger.node.ts @@ -691,7 +691,7 @@ export class SurveyMonkeyTrigger implements INodeType { } const addressInfo: IDataObject = {}; for (const answer of question.answers.rows as IDataObject[]) { - addressInfo[answer.type as string] = rows[answer.id as string] ?? ''; + addressInfo[answer.type as string] = rows[answer.id as string] || ''; } responseQuestions.set(heading, addressInfo); } diff --git a/packages/nodes-base/nodes/Switch/Switch.node.ts b/packages/nodes-base/nodes/Switch/Switch.node.ts index 65e55ae16f8c4..9d29647adcb99 100644 --- a/packages/nodes-base/nodes/Switch/Switch.node.ts +++ b/packages/nodes-base/nodes/Switch/Switch.node.ts @@ -532,13 +532,13 @@ export class Switch implements INodeType { [key: string]: (value1: NodeParameterValue, value2: NodeParameterValue) => boolean; } = { after: (value1: NodeParameterValue, value2: NodeParameterValue) => - (value1 ?? 0) > (value2 ?? 0), + (value1 || 0) > (value2 || 0), before: (value1: NodeParameterValue, value2: NodeParameterValue) => - (value1 ?? 0) < (value2 ?? 0), + (value1 || 0) < (value2 || 0), contains: (value1: NodeParameterValue, value2: NodeParameterValue) => - (value1 ?? '').toString().includes((value2 ?? '').toString()), + (value1 || '').toString().includes((value2 || '').toString()), notContains: (value1: NodeParameterValue, value2: NodeParameterValue) => - !(value1 ?? '').toString().includes((value2 ?? '').toString()), + !(value1 || '').toString().includes((value2 || '').toString()), endsWith: (value1: NodeParameterValue, value2: NodeParameterValue) => (value1 as string).endsWith(value2 as string), notEndsWith: (value1: NodeParameterValue, value2: NodeParameterValue) => @@ -546,44 +546,44 @@ export class Switch implements INodeType { equal: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 === value2, notEqual: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 !== value2, larger: (value1: NodeParameterValue, value2: NodeParameterValue) => - (value1 ?? 0) > (value2 ?? 0), + (value1 || 0) > (value2 || 0), largerEqual: (value1: NodeParameterValue, value2: NodeParameterValue) => - (value1 ?? 0) >= (value2 ?? 0), + (value1 || 0) >= (value2 || 0), smaller: (value1: NodeParameterValue, value2: NodeParameterValue) => - (value1 ?? 0) < (value2 ?? 0), + (value1 || 0) < (value2 || 0), smallerEqual: (value1: NodeParameterValue, value2: NodeParameterValue) => - (value1 ?? 0) <= (value2 ?? 0), + (value1 || 0) <= (value2 || 0), startsWith: (value1: NodeParameterValue, value2: NodeParameterValue) => (value1 as string).startsWith(value2 as string), notStartsWith: (value1: NodeParameterValue, value2: NodeParameterValue) => !(value1 as string).startsWith(value2 as string), regex: (value1: NodeParameterValue, value2: NodeParameterValue) => { - const regexMatch = (value2 ?? '').toString().match(new RegExp('^/(.*?)/([gimusy]*)$')); + const regexMatch = (value2 || '').toString().match(new RegExp('^/(.*?)/([gimusy]*)$')); let regex: RegExp; if (!regexMatch) { - regex = new RegExp((value2 ?? '').toString()); + regex = new RegExp((value2 || '').toString()); } else if (regexMatch.length === 1) { regex = new RegExp(regexMatch[1]); } else { regex = new RegExp(regexMatch[1], regexMatch[2]); } - return !!(value1 ?? '').toString().match(regex); + return !!(value1 || '').toString().match(regex); }, notRegex: (value1: NodeParameterValue, value2: NodeParameterValue) => { - const regexMatch = (value2 ?? '').toString().match(new RegExp('^/(.*?)/([gimusy]*)$')); + const regexMatch = (value2 || '').toString().match(new RegExp('^/(.*?)/([gimusy]*)$')); let regex: RegExp; if (!regexMatch) { - regex = new RegExp((value2 ?? '').toString()); + regex = new RegExp((value2 || '').toString()); } else if (regexMatch.length === 1) { regex = new RegExp(regexMatch[1]); } else { regex = new RegExp(regexMatch[1], regexMatch[2]); } - return !(value1 ?? '').toString().match(regex); + return !(value1 || '').toString().match(regex); }, }; diff --git a/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts b/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts index 446286d34b80d..c22ca307af21a 100644 --- a/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function tapfiliateApiRequest( method, qs, body, - uri: uri ?? `https://api.tapfiliate.com/1.6${endpoint}`, + uri: uri || `https://api.tapfiliate.com/1.6${endpoint}`, json: true, }; diff --git a/packages/nodes-base/nodes/Telegram/GenericFunctions.ts b/packages/nodes-base/nodes/Telegram/GenericFunctions.ts index fb77d3f500807..10f81f2feead6 100644 --- a/packages/nodes-base/nodes/Telegram/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Telegram/GenericFunctions.ts @@ -149,7 +149,7 @@ export async function apiRequest( ): Promise { const credentials = await this.getCredentials('telegramApi'); - query = query ?? {}; + query = query || {}; const options: OptionsWithUri = { headers: {}, diff --git a/packages/nodes-base/nodes/Telegram/Telegram.node.ts b/packages/nodes-base/nodes/Telegram/Telegram.node.ts index cc3ed94e2837e..fb920749dd455 100644 --- a/packages/nodes-base/nodes/Telegram/Telegram.node.ts +++ b/packages/nodes-base/nodes/Telegram/Telegram.node.ts @@ -1977,7 +1977,7 @@ export class Telegram implements INodeType { ); } - body.disable_notification = body.disable_notification?.toString() ?? 'false'; + body.disable_notification = body.disable_notification?.toString() || 'false'; const formData = { ...body, diff --git a/packages/nodes-base/nodes/TheHive/GenericFunctions.ts b/packages/nodes-base/nodes/TheHive/GenericFunctions.ts index a5039d7bc23d3..ea7e78ab7d2c8 100644 --- a/packages/nodes-base/nodes/TheHive/GenericFunctions.ts +++ b/packages/nodes-base/nodes/TheHive/GenericFunctions.ts @@ -22,7 +22,7 @@ export async function theHiveApiRequest( let options: OptionsWithUri = { method, qs: query, - uri: uri ?? `${credentials.url}/api${resource}`, + uri: uri || `${credentials.url}/api${resource}`, body, rejectUnauthorized: !credentials.allowUnauthorizedCerts, json: true, diff --git a/packages/nodes-base/nodes/Toggl/GenericFunctions.ts b/packages/nodes-base/nodes/Toggl/GenericFunctions.ts index f31f49d67a130..20dd6800ab8dd 100644 --- a/packages/nodes-base/nodes/Toggl/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Toggl/GenericFunctions.ts @@ -40,7 +40,7 @@ export async function togglApiRequest( headers: headerWithAuthentication, method, qs: query, - uri: uri ?? `https://api.track.toggl.com/api/v8${resource}`, + uri: uri || `https://api.track.toggl.com/api/v8${resource}`, body, json: true, }; diff --git a/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts b/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts index 9df57aec04b82..64559d1293354 100644 --- a/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts @@ -32,7 +32,7 @@ export async function travisciApiRequest( method, qs, body, - uri: uri ?? `https://api.travis-ci.com${resource}`, + uri: uri || `https://api.travis-ci.com${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/Trello/GenericFunctions.ts b/packages/nodes-base/nodes/Trello/GenericFunctions.ts index 5dfda99a9fc9a..01604c3457274 100644 --- a/packages/nodes-base/nodes/Trello/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Trello/GenericFunctions.ts @@ -15,7 +15,7 @@ export async function apiRequest( body: object, query?: IDataObject, ): Promise { - query = query ?? {}; + query = query || {}; const options: OptionsWithUri = { method, diff --git a/packages/nodes-base/nodes/Twake/GenericFunctions.ts b/packages/nodes-base/nodes/Twake/GenericFunctions.ts index a98aaf46ffc48..966abe5234e3b 100644 --- a/packages/nodes-base/nodes/Twake/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Twake/GenericFunctions.ts @@ -19,7 +19,7 @@ export async function twakeApiRequest( method, body, qs: query, - uri: uri ?? `https://plugins.twake.app/plugins/n8n${resource}`, + uri: uri || `https://plugins.twake.app/plugins/n8n${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Twitter/GenericFunctions.ts b/packages/nodes-base/nodes/Twitter/GenericFunctions.ts index 9aabeebee6a87..6efa943dd89b1 100644 --- a/packages/nodes-base/nodes/Twitter/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Twitter/GenericFunctions.ts @@ -30,7 +30,7 @@ export async function twitterApiRequest( method, body, qs, - url: uri ?? `https://api.twitter.com/1.1${resource}`, + url: uri || `https://api.twitter.com/1.1${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Twitter/Twitter.node.ts b/packages/nodes-base/nodes/Twitter/Twitter.node.ts index 50f4e998f9030..c2b7298b0e771 100644 --- a/packages/nodes-base/nodes/Twitter/Twitter.node.ts +++ b/packages/nodes-base/nodes/Twitter/Twitter.node.ts @@ -247,7 +247,7 @@ export class Twitter implements INodeType { } } - qs.tweet_mode = additionalFields.tweetMode ?? 'compat'; + qs.tweet_mode = additionalFields.tweetMode || 'compat'; if (returnAll) { responseData = await twitterApiRequestAllItems.call( diff --git a/packages/nodes-base/nodes/Typeform/GenericFunctions.ts b/packages/nodes-base/nodes/Typeform/GenericFunctions.ts index c18cc5145f17d..eed52bcb6818c 100644 --- a/packages/nodes-base/nodes/Typeform/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Typeform/GenericFunctions.ts @@ -49,7 +49,7 @@ export async function apiRequest( json: true, }; - query = query ?? {}; + query = query || {}; try { if (authenticationMethod === 'accessToken') { diff --git a/packages/nodes-base/nodes/Uplead/GenericFunctions.ts b/packages/nodes-base/nodes/Uplead/GenericFunctions.ts index 115015094b452..073bdaec2e482 100644 --- a/packages/nodes-base/nodes/Uplead/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Uplead/GenericFunctions.ts @@ -23,7 +23,7 @@ export async function upleadApiRequest( method, qs, body, - uri: uri ?? `https://api.uplead.com/v2${resource}`, + uri: uri || `https://api.uplead.com/v2${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts b/packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts index 0979c0fcefdfe..dfc97e096a39a 100644 --- a/packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts +++ b/packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts @@ -22,7 +22,7 @@ export async function uptimeRobotApiRequest( api_key: credentials.apiKey, ...body, }, - uri: uri ?? `https://api.uptimerobot.com/v2${resource}`, + uri: uri || `https://api.uptimerobot.com/v2${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/Venafi/Datacenter/GenericFunctions.ts b/packages/nodes-base/nodes/Venafi/Datacenter/GenericFunctions.ts index 04d7838f3a908..fbc6e18439d6a 100644 --- a/packages/nodes-base/nodes/Venafi/Datacenter/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Venafi/Datacenter/GenericFunctions.ts @@ -30,7 +30,7 @@ export async function venafiApiRequest( body, qs, rejectUnauthorized: !credentials.allowUnauthorizedCerts, - uri: uri ?? `${credentials.domain}${resource}`, + uri: uri || `${credentials.domain}${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Venafi/Datacenter/VenafiTlsProtectDatacenterTrigger.node.ts b/packages/nodes-base/nodes/Venafi/Datacenter/VenafiTlsProtectDatacenterTrigger.node.ts index 24320a6914c5e..0f66636db7cff 100644 --- a/packages/nodes-base/nodes/Venafi/Datacenter/VenafiTlsProtectDatacenterTrigger.node.ts +++ b/packages/nodes-base/nodes/Venafi/Datacenter/VenafiTlsProtectDatacenterTrigger.node.ts @@ -51,7 +51,7 @@ export class VenafiTlsProtectDatacenterTrigger implements INodeType { const now = moment().format(); - qs.ValidToGreater = webhookData.lastTimeChecked ?? now; + qs.ValidToGreater = webhookData.lastTimeChecked || now; qs.ValidToLess = now; diff --git a/packages/nodes-base/nodes/Vero/GenericFunctions.ts b/packages/nodes-base/nodes/Vero/GenericFunctions.ts index 83617d6b09227..2bf80d7b93626 100644 --- a/packages/nodes-base/nodes/Vero/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Vero/GenericFunctions.ts @@ -22,7 +22,7 @@ export async function veroApiRequest( auth_token: credentials.authToken, ...body, }, - uri: uri ?? `https://api.getvero.com/api/v2${resource}`, + uri: uri || `https://api.getvero.com/api/v2${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/Wait/Wait.node.ts b/packages/nodes-base/nodes/Wait/Wait.node.ts index 4efa81643ad1d..b164ff9b0e285 100644 --- a/packages/nodes-base/nodes/Wait/Wait.node.ts +++ b/packages/nodes-base/nodes/Wait/Wait.node.ts @@ -717,7 +717,7 @@ export class Wait implements INodeType { const fileJson = file.toJSON(); returnItem.binary![binaryPropertyName] = await this.helpers.copyBinaryFile( file.path, - fileJson.name ?? fileJson.filename, + fileJson.name || fileJson.filename, fileJson.type as string, ); @@ -747,7 +747,7 @@ export class Wait implements INodeType { }, }; - const binaryPropertyName = (options.binaryPropertyName ?? 'data') as string; + const binaryPropertyName = (options.binaryPropertyName || 'data') as string; returnItem.binary![binaryPropertyName] = await this.helpers.copyBinaryFile( binaryFile.path, mimeType, diff --git a/packages/nodes-base/nodes/Webflow/GenericFunctions.ts b/packages/nodes-base/nodes/Webflow/GenericFunctions.ts index 72c5e15ae1e43..e0699f4a6ebaa 100644 --- a/packages/nodes-base/nodes/Webflow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Webflow/GenericFunctions.ts @@ -36,7 +36,7 @@ export async function webflowApiRequest( method, qs, body, - uri: uri ?? `https://api.webflow.com${resource}`, + uri: uri || `https://api.webflow.com${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/Webhook/Webhook.node.ts b/packages/nodes-base/nodes/Webhook/Webhook.node.ts index 1975a7c4c43b8..2e9d4d2134e07 100644 --- a/packages/nodes-base/nodes/Webhook/Webhook.node.ts +++ b/packages/nodes-base/nodes/Webhook/Webhook.node.ts @@ -529,7 +529,7 @@ export class Webhook implements INodeType { const fileJson = file.toJSON(); returnItem.binary![binaryPropertyName] = await this.helpers.copyBinaryFile( file.path, - fileJson.name ?? fileJson.filename, + fileJson.name || fileJson.filename, fileJson.type as string, ); @@ -559,7 +559,7 @@ export class Webhook implements INodeType { }, }; - const binaryPropertyName = (options.binaryPropertyName ?? 'data') as string; + const binaryPropertyName = (options.binaryPropertyName || 'data') as string; returnItem.binary![binaryPropertyName] = await this.helpers.copyBinaryFile( binaryFile.path, mimeType, diff --git a/packages/nodes-base/nodes/Wekan/GenericFunctions.ts b/packages/nodes-base/nodes/Wekan/GenericFunctions.ts index cea58a39302c2..a96bc9915347c 100644 --- a/packages/nodes-base/nodes/Wekan/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Wekan/GenericFunctions.ts @@ -13,7 +13,7 @@ export async function apiRequest( ): Promise { const credentials = await this.getCredentials('wekanApi'); - query = query ?? {}; + query = query || {}; const options: OptionsWithUri = { headers: { diff --git a/packages/nodes-base/nodes/WhatsApp/MediaFunctions.ts b/packages/nodes-base/nodes/WhatsApp/MediaFunctions.ts index 6742da52e84bb..1e3d8a32acab7 100644 --- a/packages/nodes-base/nodes/WhatsApp/MediaFunctions.ts +++ b/packages/nodes-base/nodes/WhatsApp/MediaFunctions.ts @@ -35,7 +35,7 @@ export async function setupUpload( const data = new FormData(); data.append('file', buffer, { contentType: mimeType, - filename: mediaFileName ?? binaryFileName, + filename: mediaFileName || binaryFileName, }); data.append('messaging_product', 'whatsapp'); diff --git a/packages/nodes-base/nodes/WhatsApp/MessageFunctions.ts b/packages/nodes-base/nodes/WhatsApp/MessageFunctions.ts index fa2cdb4b6d2b7..98508b8772419 100644 --- a/packages/nodes-base/nodes/WhatsApp/MessageFunctions.ts +++ b/packages/nodes-base/nodes/WhatsApp/MessageFunctions.ts @@ -83,7 +83,7 @@ export async function mediaUploadFromItem( const data = new FormData(); data.append('file', await BinaryDataManager.getInstance().retrieveBinaryData(binaryFile), { contentType: mimeType, - filename: mediaFileName ?? binaryFileName, + filename: mediaFileName || binaryFileName, }); data.append('messaging_product', 'whatsapp'); @@ -105,7 +105,7 @@ export async function mediaUploadFromItem( set( requestOptions.body as IDataObject, `${operation}.filename`, - mediaFileName ?? binaryFileName, + mediaFileName || binaryFileName, ); } diff --git a/packages/nodes-base/nodes/WooCommerce/GenericFunctions.ts b/packages/nodes-base/nodes/WooCommerce/GenericFunctions.ts index bd274dfad39b9..fa4b499bded4f 100644 --- a/packages/nodes-base/nodes/WooCommerce/GenericFunctions.ts +++ b/packages/nodes-base/nodes/WooCommerce/GenericFunctions.ts @@ -39,7 +39,7 @@ export async function woocommerceApiRequest( method, qs, body, - uri: uri ?? `${credentials.url}/wp-json/wc/v3${resource}`, + uri: uri || `${credentials.url}/wp-json/wc/v3${resource}`, json: true, }; diff --git a/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts b/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts index 801421ff4793c..bfcf68b0da653 100644 --- a/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Wordpress/GenericFunctions.ts @@ -25,7 +25,7 @@ export async function wordpressApiRequest( method, qs, body, - uri: uri ?? `${credentials.url}/wp-json/wp/v2${resource}`, + uri: uri || `${credentials.url}/wp-json/wp/v2${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/Workable/GenericFunctions.ts b/packages/nodes-base/nodes/Workable/GenericFunctions.ts index 289b7e2b855c8..baa63e27eb196 100644 --- a/packages/nodes-base/nodes/Workable/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Workable/GenericFunctions.ts @@ -29,7 +29,7 @@ export async function workableApiRequest( method, qs, body, - uri: uri ?? `https://${credentials.subdomain}.workable.com/spi/v3${resource}`, + uri: uri || `https://${credentials.subdomain}.workable.com/spi/v3${resource}`, json: true, }; options = Object.assign({}, options, option); diff --git a/packages/nodes-base/nodes/Xero/GenericFunctions.ts b/packages/nodes-base/nodes/Xero/GenericFunctions.ts index dfe634aab5589..cb99717f43b18 100644 --- a/packages/nodes-base/nodes/Xero/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Xero/GenericFunctions.ts @@ -21,7 +21,7 @@ export async function xeroApiRequest( method, body, qs, - uri: uri ?? `https://api.xero.com/api.xro/2.0${resource}`, + uri: uri || `https://api.xero.com/api.xro/2.0${resource}`, json: true, }; try { diff --git a/packages/nodes-base/nodes/Zendesk/GenericFunctions.ts b/packages/nodes-base/nodes/Zendesk/GenericFunctions.ts index 44bdc423b49b0..a8a383b6d000a 100644 --- a/packages/nodes-base/nodes/Zendesk/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zendesk/GenericFunctions.ts @@ -41,7 +41,7 @@ export async function zendeskApiRequest( method, qs, body, - uri: uri ?? getUri(resource, credentials.subdomain), + uri: uri || getUri(resource, credentials.subdomain), json: true, qsStringifyOptions: { arrayFormat: 'brackets', diff --git a/packages/nodes-base/nodes/Zoho/GenericFunctions.ts b/packages/nodes-base/nodes/Zoho/GenericFunctions.ts index 98d187b70c00b..9506f99069317 100644 --- a/packages/nodes-base/nodes/Zoho/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoho/GenericFunctions.ts @@ -49,7 +49,7 @@ export async function zohoApiRequest( }, method, qs, - uri: uri ?? `${oauthTokenData.api_domain}/crm/v2${endpoint}`, + uri: uri || `${oauthTokenData.api_domain}/crm/v2${endpoint}`, json: true, }; diff --git a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts index f253cb2b9b76d..d1524c176c7bc 100644 --- a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts @@ -17,7 +17,7 @@ export async function zoomApiRequest( let options: OptionsWithUri = { method, - headers: headers ?? { + headers: headers || { 'Content-Type': 'application/json', }, body, diff --git a/packages/nodes-base/nodes/Zulip/GenericFunctions.ts b/packages/nodes-base/nodes/Zulip/GenericFunctions.ts index 355df5b889c61..7c7735d716633 100644 --- a/packages/nodes-base/nodes/Zulip/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zulip/GenericFunctions.ts @@ -29,7 +29,7 @@ export async function zulipApiRequest( method, form: body, qs: query, - uri: uri ?? `${endpoint}${resource}`, + uri: uri || `${endpoint}${resource}`, json: true, }; if (!Object.keys(body).length) {