refactor(core): Introduce overload for boolean-type node parameter (no-changelog) (#4647)

* 📘 Set up overloads

* 📘 Add temporary assertion

* 🔥 Remove inferrable boolean assertions

*  Undo autoformatting
This commit is contained in:
Iván Ovejero
2022-11-18 14:31:38 +01:00
committed by GitHub
parent 919cb9180d
commit 6757c9a2ea
163 changed files with 559 additions and 529 deletions

View File

@@ -297,7 +297,7 @@ export class SentryIo implements INodeType {
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
const projectSlug = this.getNodeParameter('projectSlug', i) as string;
const full = this.getNodeParameter('full', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i);
const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/events/`;
@@ -329,7 +329,7 @@ export class SentryIo implements INodeType {
if (operation === 'getAll') {
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
const projectSlug = this.getNodeParameter('projectSlug', i) as string;
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i);
const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/issues/`;
@@ -406,7 +406,7 @@ export class SentryIo implements INodeType {
responseData = await sentryIoApiRequest.call(this, 'GET', endpoint, qs);
}
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i);
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
const endpoint = `/api/0/organizations/`;
@@ -480,7 +480,7 @@ export class SentryIo implements INodeType {
responseData = await sentryIoApiRequest.call(this, 'GET', endpoint, qs);
}
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i);
const endpoint = `/api/0/projects/`;
if (returnAll === false) {
@@ -524,7 +524,7 @@ export class SentryIo implements INodeType {
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
const endpoint = `/api/0/organizations/${organizationSlug}/releases/`;
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i);
if (additionalFields.query) {
qs.query = additionalFields.query as string;
@@ -677,7 +677,7 @@ export class SentryIo implements INodeType {
if (operation === 'getAll') {
const organizationSlug = this.getNodeParameter('organizationSlug', i) as string;
const endpoint = `/api/0/organizations/${organizationSlug}/teams/`;
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i);
if (returnAll === false) {
const limit = this.getNodeParameter('limit', i) as number;