perf(tooling): Upgrade to TypeScript 4.8 (#4207)

* ⬆️ Upgrade to TypeScript 4.8

* 🔥 Remove unneeded setting

* 📦 Update `package-lock.json`

*  Restore `skipLibCheck`

* 📦 Re-update `package-lock.json`

* ♻️ Apply feedback

* ♻️ Add check to new WhatsApp node

* 📦 Update `package-lock.json`

* Update package-lock.json

* ran `npm run lintfix`

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Iván Ovejero
2022-10-05 13:36:09 +02:00
committed by GitHub
parent cc2a2e438b
commit 9089dbe942
39 changed files with 21217 additions and 11086 deletions

View File

@@ -235,7 +235,7 @@ export class ActionNetwork implements INodeType {
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
if (Object.keys(additionalFields).length) {
if (Object.keys(additionalFields).length && body.person) {
Object.assign(body.person, adjustPersonPayload(additionalFields));
}

View File

@@ -599,7 +599,7 @@ export class AwsS3 implements INodeType {
binary: {},
};
if (items[i].binary !== undefined) {
if (items[i].binary !== undefined && newItem.binary) {
// Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind
// but the incoming data does not get changed.

View File

@@ -382,42 +382,44 @@ export class AwsTranscribe implements INodeType {
body.LanguageCode = this.getNodeParameter('languageCode', i) as string;
}
if (options.channelIdentification) {
Object.assign(body.Settings, {
ChannelIdentification: options.channelIdentification,
});
}
if (body.Settings) {
if (options.channelIdentification) {
Object.assign(body.Settings, {
ChannelIdentification: options.channelIdentification,
});
}
if (options.maxAlternatives) {
Object.assign(body.Settings, {
ShowAlternatives: true,
MaxAlternatives: options.maxAlternatives,
});
}
if (options.maxAlternatives) {
Object.assign(body.Settings, {
ShowAlternatives: true,
MaxAlternatives: options.maxAlternatives,
});
}
if (options.maxSpeakerLabels) {
Object.assign(body.Settings, {
ShowSpeakerLabels: true,
MaxSpeakerLabels: options.maxSpeakerLabels,
});
}
if (options.maxSpeakerLabels) {
Object.assign(body.Settings, {
ShowSpeakerLabels: true,
MaxSpeakerLabels: options.maxSpeakerLabels,
});
}
if (options.vocabularyName) {
Object.assign(body.Settings, {
VocabularyName: options.vocabularyName,
});
}
if (options.vocabularyName) {
Object.assign(body.Settings, {
VocabularyName: options.vocabularyName,
});
}
if (options.vocabularyFilterName) {
Object.assign(body.Settings, {
VocabularyFilterName: options.vocabularyFilterName,
});
}
if (options.vocabularyFilterName) {
Object.assign(body.Settings, {
VocabularyFilterName: options.vocabularyFilterName,
});
}
if (options.vocabularyFilterMethod) {
Object.assign(body.Settings, {
VocabularyFilterMethod: options.vocabularyFilterMethod,
});
if (options.vocabularyFilterMethod) {
Object.assign(body.Settings, {
VocabularyFilterMethod: options.vocabularyFilterMethod,
});
}
}
const action = 'Transcribe.StartTranscriptionJob';

View File

@@ -53,7 +53,7 @@ export async function get(this: IExecuteFunctions, index: number) {
binary: {},
};
if (items[index].binary !== undefined) {
if (items[index].binary !== undefined && newItem.binary) {
// Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind
// but the incoming data does not get changed.

View File

@@ -40,7 +40,7 @@ export async function download(this: IExecuteFunctions, index: number) {
binary: {},
};
if (items[index].binary !== undefined) {
if (items[index].binary !== undefined && newItem.binary) {
// Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind
// but the incoming data does not get changed.

View File

@@ -53,7 +53,7 @@ export async function upload(this: IExecuteFunctions, index: number) {
resolveWithFullResponse: true,
};
if (options.hasOwnProperty('share')) {
if (options.hasOwnProperty('share') && body.formData) {
Object.assign(body.formData, options.share ? { share: 'yes' } : { share: 'no' });
}
//endpoint

View File

@@ -40,7 +40,7 @@ export async function download(this: IExecuteFunctions, index: number) {
binary: {},
};
if (items[index].binary !== undefined) {
if (items[index].binary !== undefined && newItem.binary) {
// Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind
// but the incoming data does not get changed.

View File

@@ -51,7 +51,9 @@ export async function upload(this: IExecuteFunctions, index: number) {
resolveWithFullResponse: true,
};
Object.assign(body.formData, share ? { share: 'yes' } : { share: 'no' });
if (body.formData) {
Object.assign(body.formData, share ? { share: 'yes' } : { share: 'no' });
}
//endpoint
const endpoint = `files`;

View File

@@ -1262,7 +1262,7 @@ export class EditImage implements INodeType {
}
}
if (item.binary !== undefined) {
if (item.binary !== undefined && newItem.binary) {
// Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind
// but the incoming data does not get changed.

View File

@@ -456,7 +456,7 @@ export class Ftp implements INodeType {
binary: {},
};
if (items[i].binary !== undefined) {
if (items[i].binary !== undefined && newItem.binary) {
// Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind
// but the incoming data does not get changed.

View File

@@ -422,7 +422,7 @@ export class HomeAssistant implements INodeType {
mimeType = responseData.headers['content-type'];
}
if (items[i].binary !== undefined) {
if (items[i].binary !== undefined && newItem.binary) {
// Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind
// but the incoming data does not get changed.

View File

@@ -69,7 +69,7 @@ export const questionsOperations: INodeProperties[] = [
binary: {},
};
if (items[i].binary !== undefined) {
if (items[i].binary !== undefined && newItem.binary) {
Object.assign(newItem.binary, items[i].binary);
}
items[i] = newItem;

View File

@@ -32,7 +32,7 @@ export async function postmarkApiRequest(
uri: 'https://api.postmarkapp.com' + endpoint,
json: true,
};
if (body === {}) {
if (Object.keys(body).length === 0) {
delete options.body;
}
options = Object.assign({}, options, option);

View File

@@ -78,7 +78,7 @@ export class ReadBinaryFile implements INodeType {
},
};
if (item.binary !== undefined) {
if (item.binary !== undefined && newItem.binary) {
// Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind
// but the incoming data does not get changed.

View File

@@ -233,7 +233,7 @@ export class SecurityScorecard implements INodeType {
binary: {},
};
if (items[i].binary !== undefined) {
if (items[i].binary !== undefined && newItem.binary) {
// Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind
// but the incoming data does not get changed.

View File

@@ -323,7 +323,7 @@ export class Ssh implements INodeType {
},
};
if (items[i].binary !== undefined) {
if (items[i].binary !== undefined && newItem.binary) {
// Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind
// but the incoming data does not get changed.

View File

@@ -49,7 +49,9 @@ export async function storyblokApiRequest(
options.uri = `https://mapi.storyblok.com${resource}`;
Object.assign(options.headers, { Authorization: credentials.accessToken });
if (options.headers) {
Object.assign(options.headers, { Authorization: credentials.accessToken });
}
}
try {

View File

@@ -52,7 +52,9 @@ export async function setType(this: IExecuteSingleFunctions, requestOptions: IHt
actualType = 'template';
}
Object.assign(requestOptions.body, { type: actualType });
if (requestOptions.body) {
Object.assign(requestOptions.body, { type: actualType });
}
return requestOptions;
}