refactor(core): Introduce overload for string-type node parameter (no-changelog) (#4797)

* 📘 Set up overload

* 🔥 Remove inferrable assertions
This commit is contained in:
Iván Ovejero
2022-12-02 12:53:59 +01:00
committed by GitHub
parent 8ef675332d
commit 632f573021
233 changed files with 461 additions and 450 deletions

View File

@@ -140,7 +140,7 @@ export class MicrosoftTeams implements INodeType {
async getPlans(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
let groupId = this.getCurrentNodeParameter('groupId') as string;
const operation = this.getNodeParameter('operation', 0) as string;
const operation = this.getNodeParameter('operation', 0);
if (operation === 'update' && (groupId === undefined || groupId === null)) {
// groupId not found at base, check updateFields for the groupId
groupId = this.getCurrentNodeParameter('updateFields.groupId') as string;
@@ -163,7 +163,7 @@ export class MicrosoftTeams implements INodeType {
async getBuckets(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
let planId = this.getCurrentNodeParameter('planId') as string;
const operation = this.getNodeParameter('operation', 0) as string;
const operation = this.getNodeParameter('operation', 0);
if (operation === 'update' && (planId === undefined || planId === null)) {
// planId not found at base, check updateFields for the planId
planId = this.getCurrentNodeParameter('updateFields.planId') as string;
@@ -186,7 +186,7 @@ export class MicrosoftTeams implements INodeType {
async getMembers(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
let groupId = this.getCurrentNodeParameter('groupId') as string;
const operation = this.getNodeParameter('operation', 0) as string;
const operation = this.getNodeParameter('operation', 0);
if (operation === 'update' && (groupId === undefined || groupId === null)) {
// groupId not found at base, check updateFields for the groupId
groupId = this.getCurrentNodeParameter('updateFields.groupId') as string;
@@ -210,7 +210,7 @@ export class MicrosoftTeams implements INodeType {
const returnData: INodePropertyOptions[] = [];
let planId = this.getCurrentNodeParameter('planId') as string;
const operation = this.getNodeParameter('operation', 0) as string;
const operation = this.getNodeParameter('operation', 0);
if (operation === 'update' && (planId === undefined || planId === null)) {
// planId not found at base, check updateFields for the planId
planId = this.getCurrentNodeParameter('updateFields.planId') as string;
@@ -263,8 +263,8 @@ export class MicrosoftTeams implements INodeType {
const length = items.length;
const qs: IDataObject = {};
let responseData;
const resource = this.getNodeParameter('resource', 0) as string;
const operation = this.getNodeParameter('operation', 0) as string;
const resource = this.getNodeParameter('resource', 0);
const operation = this.getNodeParameter('operation', 0);
for (let i = 0; i < length; i++) {
try {
if (resource === 'channel') {