2020-07-01 19:54:51 -07:00
|
|
|
import {
|
|
|
|
ICredentialType,
|
2021-06-12 09:39:55 -07:00
|
|
|
INodeProperties,
|
2020-07-01 19:54:51 -07:00
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
//https://developers.google.com/youtube/v3/guides/auth/client-side-web-apps#identify-access-scopes
|
|
|
|
const scopes = [
|
|
|
|
'https://www.googleapis.com/auth/youtube',
|
|
|
|
'https://www.googleapis.com/auth/youtubepartner',
|
|
|
|
'https://www.googleapis.com/auth/youtube.force-ssl',
|
|
|
|
'https://www.googleapis.com/auth/youtube.upload',
|
2020-08-09 14:39:28 -07:00
|
|
|
'https://www.googleapis.com/auth/youtubepartner-channel-audit',
|
2020-07-01 19:54:51 -07:00
|
|
|
];
|
|
|
|
|
|
|
|
export class YouTubeOAuth2Api implements ICredentialType {
|
|
|
|
name = 'youTubeOAuth2Api';
|
|
|
|
extends = [
|
|
|
|
'googleOAuth2Api',
|
|
|
|
];
|
2020-08-19 00:59:19 -07:00
|
|
|
displayName = 'YouTube OAuth2 API';
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'google';
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2020-07-01 19:54:51 -07:00
|
|
|
{
|
|
|
|
displayName: 'Scope',
|
|
|
|
name: 'scope',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-07-01 19:54:51 -07:00
|
|
|
default: scopes.join(' '),
|
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|