2022-08-17 08:50:24 -07:00
import { INodeProperties } from 'n8n-workflow' ;
2020-07-01 19:54:51 -07:00
2021-12-03 00:44:16 -08:00
export const channelOperations : INodeProperties [ ] = [
2020-07-01 19:54:51 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-07-01 19:54:51 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'channel' ] ,
2020-07-01 19:54:51 -07:00
} ,
} ,
options : [
2020-08-11 13:07:23 -07:00
{
name : 'Get' ,
value : 'get' ,
description : 'Retrieve a channel' ,
2022-07-10 13:50:51 -07:00
action : 'Get a channel' ,
2020-08-11 13:07:23 -07:00
} ,
2020-07-01 19:54:51 -07:00
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2020-07-01 19:54:51 -07:00
value : 'getAll' ,
2022-09-13 03:36:36 -07:00
description : 'Retrieve many channels' ,
2022-09-08 08:10:13 -07:00
action : 'Get many channels' ,
2020-07-01 19:54:51 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
description : 'Update a channel' ,
2022-07-10 13:50:51 -07:00
action : 'Update a channel' ,
2020-07-01 19:54:51 -07:00
} ,
{
name : 'Upload Banner' ,
value : 'uploadBanner' ,
description : 'Upload a channel banner' ,
2022-07-10 13:50:51 -07:00
action : 'Upload a channel banner' ,
2020-10-22 06:46:03 -07:00
} ,
2020-07-01 19:54:51 -07:00
] ,
default : 'getAll' ,
2020-10-22 06:46:03 -07:00
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-07-01 19:54:51 -07:00
2021-12-03 00:44:16 -08:00
export const channelFields : INodeProperties [ ] = [
2020-07-01 19:54:51 -07:00
/* -------------------------------------------------------------------------- */
/* channel:getAll */
/* -------------------------------------------------------------------------- */
{
2020-07-20 11:33:09 -07:00
displayName : 'Fields' ,
2020-07-01 19:54:51 -07:00
name : 'part' ,
type : 'multiOptions' ,
options : [
2020-08-14 15:36:47 -07:00
{
name : '*' ,
value : '*' ,
} ,
2020-07-01 19:54:51 -07:00
{
name : 'Branding Settings' ,
value : 'brandingSettings' ,
} ,
{
name : 'Content Details' ,
value : 'contentDetails' ,
} ,
{
name : 'Content Owner Details' ,
value : 'contentOwnerDetails' ,
} ,
{
name : 'ID' ,
value : 'id' ,
} ,
{
name : 'Localizations' ,
value : 'localizations' ,
} ,
{
name : 'Snippet' ,
value : 'snippet' ,
} ,
{
name : 'Statistics' ,
value : 'statistics' ,
} ,
{
name : 'Status' ,
value : 'status' ,
} ,
{
name : 'Topic Details' ,
value : 'topicDetails' ,
} ,
] ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'channel' ] ,
2020-07-01 19:54:51 -07:00
} ,
} ,
2022-08-17 08:50:24 -07:00
description :
'The fields parameter specifies a comma-separated list of one or more channel resource properties that the API response will include' ,
2020-08-15 19:36:11 -07:00
default : [ '*' ] ,
2020-07-01 19:54:51 -07:00
} ,
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'channel' ] ,
2020-07-01 19:54:51 -07:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-07-01 19:54:51 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'channel' ] ,
returnAll : [ false ] ,
2020-07-01 19:54:51 -07:00
} ,
} ,
typeOptions : {
minValue : 1 ,
2020-08-14 15:36:47 -07:00
maxValue : 50 ,
2020-07-01 19:54:51 -07:00
} ,
2020-08-14 15:36:47 -07:00
default : 25 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-07-01 19:54:51 -07:00
} ,
{
2020-08-09 14:39:28 -07:00
displayName : 'Filters' ,
name : 'filters' ,
2020-07-01 19:54:51 -07:00
type : 'collection' ,
placeholder : 'Add Option' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'channel' ] ,
2020-07-01 19:54:51 -07:00
} ,
} ,
options : [
{
displayName : 'Category ID' ,
name : 'categoryId' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The categoryId parameter specifies a YouTube guide category, thereby requesting YouTube channels associated with that category' ,
2020-07-01 19:54:51 -07:00
} ,
{
displayName : 'For Username' ,
name : 'forUsername' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The forUsername parameter specifies a YouTube username, thereby requesting the channel associated with that username' ,
2020-07-01 19:54:51 -07:00
} ,
{
displayName : 'ID' ,
name : 'id' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"The ID parameter specifies a comma-separated list of the YouTube channel ID(s) for the resource(s) that are being retrieved. In a channel resource, the ID property specifies the channel's YouTube channel ID." ,
2020-07-01 19:54:51 -07:00
} ,
{
displayName : 'Managed By Me' ,
name : 'managedByMe' ,
type : 'boolean' ,
default : false ,
2022-08-17 08:50:24 -07:00
description :
'Whether to instruct the API to only return channels managed by the content owner that the onBehalfOfContentOwner parameter specifies' ,
2020-07-01 19:54:51 -07:00
} ,
2020-08-09 14:39:28 -07:00
] ,
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
placeholder : 'Add Option' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'channel' ] ,
2020-08-09 14:39:28 -07:00
} ,
} ,
options : [
2020-07-01 19:54:51 -07:00
{
2022-06-03 10:23:49 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
2020-07-01 19:54:51 -07:00
displayName : 'Language Code' ,
name : 'h1' ,
type : 'options' ,
typeOptions : {
2020-10-22 06:46:03 -07:00
loadOptionsMethod : 'getLanguages' ,
2020-07-01 19:54:51 -07:00
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-07-01 19:54:51 -07:00
} ,
{
displayName : 'On Behalf Of Content Owner' ,
name : 'onBehalfOfContentOwner' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value" ,
2020-07-01 19:54:51 -07:00
} ,
] ,
} ,
/* -------------------------------------------------------------------------- */
2020-08-11 13:07:23 -07:00
/* channel:get */
/* -------------------------------------------------------------------------- */
{
displayName : 'Channel ID' ,
name : 'channelId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'get' ] ,
resource : [ 'channel' ] ,
2020-08-11 13:07:23 -07:00
} ,
} ,
2020-08-14 15:36:47 -07:00
description : 'ID of the video' ,
2020-08-11 13:07:23 -07:00
default : '' ,
} ,
{
displayName : 'Fields' ,
name : 'part' ,
type : 'multiOptions' ,
options : [
2020-08-14 15:36:47 -07:00
{
name : '*' ,
value : '*' ,
} ,
2020-08-11 13:07:23 -07:00
{
name : 'Branding Settings' ,
value : 'brandingSettings' ,
} ,
{
name : 'Content Details' ,
value : 'contentDetails' ,
} ,
{
name : 'Content Owner Details' ,
value : 'contentOwnerDetails' ,
} ,
{
name : 'ID' ,
value : 'id' ,
} ,
{
name : 'Localizations' ,
value : 'localizations' ,
} ,
{
name : 'Snippet' ,
value : 'snippet' ,
} ,
{
name : 'Statistics' ,
value : 'statistics' ,
} ,
{
name : 'Status' ,
value : 'status' ,
} ,
{
name : 'Topic Details' ,
value : 'topicDetails' ,
} ,
] ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'get' ] ,
resource : [ 'channel' ] ,
2020-08-11 13:07:23 -07:00
} ,
} ,
2022-08-17 08:50:24 -07:00
description :
'The fields parameter specifies a comma-separated list of one or more channel resource properties that the API response will include' ,
2020-08-15 19:36:11 -07:00
default : [ '*' ] ,
2020-08-11 13:07:23 -07:00
} ,
/* -------------------------------------------------------------------------- */
2020-07-01 19:54:51 -07:00
/* channel:update */
/* -------------------------------------------------------------------------- */
{
displayName : 'Channel ID' ,
name : 'channelId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'update' ] ,
resource : [ 'channel' ] ,
2020-07-01 19:54:51 -07:00
} ,
} ,
default : '' ,
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'update' ] ,
resource : [ 'channel' ] ,
2020-07-01 19:54:51 -07:00
} ,
} ,
options : [
{
displayName : 'Branding Settings' ,
name : 'brandingSettingsUi' ,
type : 'fixedCollection' ,
default : { } ,
2022-05-06 14:01:25 -07:00
description : 'Encapsulates information about the branding of the channel' ,
2020-07-01 19:54:51 -07:00
placeholder : 'Add Branding Settings' ,
typeOptions : {
multipleValues : false ,
} ,
options : [
{
name : 'channelSettingsValues' ,
displayName : 'Channel Settings' ,
values : [
{
displayName : 'Channel' ,
name : 'channel' ,
type : 'collection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-07-01 19:54:51 -07:00
placeholder : 'Add Channel Settings' ,
typeOptions : {
multipleValues : false ,
} ,
options : [
{
displayName : 'Country' ,
name : 'country' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The country with which the channel is associated. Update this property to set the value of the snippet.country property.' ,
2020-07-01 19:54:51 -07:00
} ,
{
displayName : 'Description' ,
name : 'description' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"The channel description, which appears in the channel information box on your channel page. The property's value has a maximum length of 1000 characters." ,
2020-07-01 19:54:51 -07:00
} ,
{
displayName : 'Default Language' ,
name : 'defaultLanguage' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The content tab that users should display by default when viewers arrive at your channel page' ,
2020-07-01 19:54:51 -07:00
} ,
{
displayName : 'Default Tab' ,
name : 'defaultTab' ,
type : 'string' ,
2022-08-17 08:50:24 -07:00
default :
'The content tab that users should display by default when viewers arrive at your channel page.' ,
2020-07-01 19:54:51 -07:00
} ,
{
displayName : 'Featured Channels Title' ,
name : 'featuredChannelsTitle' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The title that displays above the featured channels module. The title has a maximum length of 30 characters.' ,
2020-07-01 19:54:51 -07:00
} ,
{
displayName : 'Featured Channels Urls' ,
name : 'featuredChannelsUrls' ,
type : 'string' ,
typeOptions : {
multipleValues : true ,
} ,
2022-08-17 08:50:24 -07:00
description :
'A list of up to 100 channels that you would like to link to from the featured channels module. The property value is a list of YouTube channel ID values, each of which uniquely identifies a channel.' ,
2020-07-01 19:54:51 -07:00
default : [ ] ,
} ,
{
displayName : 'Keywords' ,
name : 'keywords' ,
type : 'string' ,
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
placeholder : 'tech,news' ,
2022-08-17 08:50:24 -07:00
description :
'Keywords associated with your channel. The value is a space-separated list of strings.' ,
2020-07-01 19:54:51 -07:00
default : '' ,
} ,
{
displayName : 'Moderate Comments' ,
name : 'moderateComments' ,
type : 'boolean' ,
2022-08-17 08:50:24 -07:00
description :
'Whether user-submitted comments left on the channel page need to be approved by the channel owner to be publicly visible' ,
2020-07-01 19:54:51 -07:00
default : false ,
} ,
{
displayName : 'Profile Color' ,
name : 'profileColor' ,
2022-07-04 02:12:08 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused
2020-07-01 19:54:51 -07:00
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "A prominent color that complements the channel's content" ,
2020-07-01 19:54:51 -07:00
} ,
{
displayName : 'Show Related Channels' ,
name : 'showRelatedChannels' ,
type : 'boolean' ,
2022-08-17 08:50:24 -07:00
description :
'Whether YouTube should show an algorithmically generated list of related channels on your channel page' ,
2020-07-01 19:54:51 -07:00
default : false ,
} ,
{
displayName : 'Show Browse View' ,
name : 'showBrowseView' ,
type : 'boolean' ,
2022-08-17 08:50:24 -07:00
description :
'Whether the channel page should display content in a browse or feed view' ,
2020-07-01 19:54:51 -07:00
default : false ,
} ,
{
displayName : 'Tracking Analytics AccountId' ,
name : 'trackingAnalyticsAccountId' ,
type : 'string' ,
2022-08-17 08:50:24 -07:00
description :
'The ID for a Google Analytics account that you want to use to track and measure traffic to your channel' ,
2020-07-01 19:54:51 -07:00
default : '' ,
} ,
{
displayName : 'Unsubscribed Trailer' ,
name : 'unsubscribedTrailer' ,
type : 'string' ,
2022-08-17 08:50:24 -07:00
description :
"The video that should play in the featured video module in the channel page's browse view for unsubscribed viewers" ,
2020-07-01 19:54:51 -07:00
default : '' ,
} ,
] ,
} ,
] ,
description : 'The channel object encapsulates branding properties of the channel page' ,
} ,
{
name : 'imageSettingsValues' ,
displayName : 'Image Settings' ,
values : [
{
displayName : 'Image' ,
name : 'image' ,
type : 'collection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-07-01 19:54:51 -07:00
placeholder : 'Add Channel Settings' ,
2022-08-17 08:50:24 -07:00
description :
"The image object encapsulates information about images that display on the channel's channel page or video watch pages" ,
2020-07-01 19:54:51 -07:00
typeOptions : {
multipleValues : false ,
} ,
options : [
{
displayName : 'Banner External Url' ,
name : 'bannerExternalUrl' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Tracking Image Url' ,
name : 'trackingImageUrl' ,
type : 'string' ,
default : '' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Watch Icon Image Url' ,
2020-07-01 19:54:51 -07:00
name : 'watchIconImageUrl' ,
type : 'string' ,
default : '' ,
} ,
] ,
} ,
] ,
} ,
{
name : 'statusValue' ,
displayName : 'Status' ,
values : [
{
displayName : 'Status' ,
name : 'status' ,
type : 'collection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-07-01 19:54:51 -07:00
placeholder : 'Add Status' ,
typeOptions : {
multipleValues : false ,
} ,
options : [
{
displayName : 'Self Declared Made For Kids' ,
name : 'selfDeclaredMadeForKids' ,
type : 'boolean' ,
default : false ,
} ,
] ,
} ,
] ,
} ,
] ,
} ,
{
displayName : 'On Behalf Of Content Owner' ,
name : 'onBehalfOfContentOwner' ,
type : 'string' ,
default : '' ,
} ,
] ,
} ,
/* -------------------------------------------------------------------------- */
/* channel:uploadBanner */
/* -------------------------------------------------------------------------- */
{
displayName : 'Channel ID' ,
name : 'channelId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'uploadBanner' ] ,
resource : [ 'channel' ] ,
2020-07-01 19:54:51 -07:00
} ,
} ,
2020-08-14 15:36:47 -07:00
description : 'ID of the channel' ,
2020-07-01 19:54:51 -07:00
default : '' ,
} ,
{
displayName : 'Binary Property' ,
name : 'binaryProperty' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'uploadBanner' ] ,
resource : [ 'channel' ] ,
2020-07-01 19:54:51 -07:00
} ,
} ,
default : 'data' ,
} ,
2021-12-03 00:44:16 -08:00
] ;