mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
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:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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`;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user