refactor(core): Introduce overload for record-type node parameter (no-changelog) (#4648)

* 📘 Set up overload

* 🔥 Remove inferrable record assertions

* 👕 Fix semicolon

* 👕 Fix another semicolon
This commit is contained in:
Iván Ovejero
2022-11-18 16:29:44 +01:00
committed by GitHub
parent 0565194473
commit 0d9eeea024
202 changed files with 1003 additions and 985 deletions

View File

@@ -225,8 +225,8 @@ export class YouTube implements INodeType {
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i);
let part = this.getNodeParameter('part', i) as string[];
const options = this.getNodeParameter('options', i) as IDataObject;
const filters = this.getNodeParameter('filters', i) as IDataObject;
const options = this.getNodeParameter('options', i);
const filters = this.getNodeParameter('filters', i);
if (part.includes('*')) {
part = [
@@ -276,7 +276,7 @@ export class YouTube implements INodeType {
//https://developers.google.com/youtube/v3/docs/channels/update
if (operation === 'update') {
const channelId = this.getNodeParameter('channelId', i) as string;
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
const updateFields = this.getNodeParameter('updateFields', i);
const body: IDataObject = {
id: channelId,
@@ -452,7 +452,7 @@ export class YouTube implements INodeType {
if (operation === 'get') {
let part = this.getNodeParameter('part', i) as string[];
const playlistId = this.getNodeParameter('playlistId', i) as string;
const options = this.getNodeParameter('options', i) as IDataObject;
const options = this.getNodeParameter('options', i);
if (part.includes('*')) {
part = ['contentDetails', 'id', 'localizations', 'player', 'snippet', 'status'];
@@ -478,8 +478,8 @@ export class YouTube implements INodeType {
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i);
let part = this.getNodeParameter('part', i) as string[];
const options = this.getNodeParameter('options', i) as IDataObject;
const filters = this.getNodeParameter('filters', i) as IDataObject;
const options = this.getNodeParameter('options', i);
const filters = this.getNodeParameter('filters', i);
if (part.includes('*')) {
part = ['contentDetails', 'id', 'localizations', 'player', 'snippet', 'status'];
@@ -519,7 +519,7 @@ export class YouTube implements INodeType {
//https://developers.google.com/youtube/v3/docs/playlists/insert
if (operation === 'create') {
const title = this.getNodeParameter('title', i) as string;
const options = this.getNodeParameter('options', i) as IDataObject;
const options = this.getNodeParameter('options', i);
qs.part = 'snippet';
@@ -564,7 +564,7 @@ export class YouTube implements INodeType {
if (operation === 'update') {
const playlistId = this.getNodeParameter('playlistId', i) as string;
const title = this.getNodeParameter('title', i) as string;
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
const updateFields = this.getNodeParameter('updateFields', i);
qs.part = 'snippet, status';
@@ -611,7 +611,7 @@ export class YouTube implements INodeType {
//https://developers.google.com/youtube/v3/docs/playlists/delete
if (operation === 'delete') {
const playlistId = this.getNodeParameter('playlistId', i) as string;
const options = this.getNodeParameter('options', i) as IDataObject;
const options = this.getNodeParameter('options', i);
const body: IDataObject = {
id: playlistId,
@@ -636,7 +636,7 @@ export class YouTube implements INodeType {
if (operation === 'get') {
let part = this.getNodeParameter('part', i) as string[];
const playlistItemId = this.getNodeParameter('playlistItemId', i) as string;
const options = this.getNodeParameter('options', i) as IDataObject;
const options = this.getNodeParameter('options', i);
if (part.includes('*')) {
part = ['contentDetails', 'id', 'snippet', 'status'];
@@ -662,9 +662,9 @@ export class YouTube implements INodeType {
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i);
let part = this.getNodeParameter('part', i) as string[];
const options = this.getNodeParameter('options', i) as IDataObject;
const options = this.getNodeParameter('options', i);
const playlistId = this.getNodeParameter('playlistId', i) as string;
//const filters = this.getNodeParameter('filters', i) as IDataObject;
//const filters = this.getNodeParameter('filters', i);
if (part.includes('*')) {
part = ['contentDetails', 'id', 'snippet', 'status'];
@@ -701,7 +701,7 @@ export class YouTube implements INodeType {
if (operation === 'add') {
const playlistId = this.getNodeParameter('playlistId', i) as string;
const videoId = this.getNodeParameter('videoId', i) as string;
const options = this.getNodeParameter('options', i) as IDataObject;
const options = this.getNodeParameter('options', i);
qs.part = 'snippet, contentDetails';
@@ -751,7 +751,7 @@ export class YouTube implements INodeType {
//https://developers.google.com/youtube/v3/docs/playlistItems/delete
if (operation === 'delete') {
const playlistItemId = this.getNodeParameter('playlistItemId', i) as string;
const options = this.getNodeParameter('options', i) as IDataObject;
const options = this.getNodeParameter('options', i);
const body: IDataObject = {
id: playlistItemId,
@@ -775,8 +775,8 @@ export class YouTube implements INodeType {
//https://developers.google.com/youtube/v3/docs/search/list
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i);
const options = this.getNodeParameter('options', i) as IDataObject;
const filters = this.getNodeParameter('filters', i) as IDataObject;
const options = this.getNodeParameter('options', i);
const filters = this.getNodeParameter('filters', i);
qs.part = 'snippet';
@@ -817,7 +817,7 @@ export class YouTube implements INodeType {
if (operation === 'get') {
let part = this.getNodeParameter('part', i) as string[];
const videoId = this.getNodeParameter('videoId', i) as string;
const options = this.getNodeParameter('options', i) as IDataObject;
const options = this.getNodeParameter('options', i);
if (part.includes('*')) {
part = [
@@ -848,7 +848,7 @@ export class YouTube implements INodeType {
if (operation === 'upload') {
const title = this.getNodeParameter('title', i) as string;
const categoryId = this.getNodeParameter('categoryId', i) as string;
const options = this.getNodeParameter('options', i) as IDataObject;
const options = this.getNodeParameter('options', i);
const binaryProperty = this.getNodeParameter('binaryProperty', i) as string;
let mimeType;
@@ -969,7 +969,7 @@ export class YouTube implements INodeType {
const id = this.getNodeParameter('videoId', i) as string;
const title = this.getNodeParameter('title', i) as string;
const categoryId = this.getNodeParameter('categoryId', i) as string;
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
const updateFields = this.getNodeParameter('updateFields', i);
qs.part = 'snippet, status, recordingDetails';
@@ -1038,7 +1038,7 @@ export class YouTube implements INodeType {
//https://developers.google.com/youtube/v3/docs/videos/delete?hl=en
if (operation === 'delete') {
const videoId = this.getNodeParameter('videoId', i) as string;
const options = this.getNodeParameter('options', i) as IDataObject;
const options = this.getNodeParameter('options', i);
const body: IDataObject = {
id: videoId,