n8n-nodes-base
Version:
Base nodes of n8n
85 lines • 2.65 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DiscordOAuth2Api = void 0;
const defaultScopes = ['identify', 'guilds', 'guilds.join', 'bot'];
class DiscordOAuth2Api {
name = 'discordOAuth2Api';
extends = ['oAuth2Api'];
displayName = 'Discord OAuth2 API';
documentationUrl = 'discord';
properties = [
{
displayName: 'Bot Token',
name: 'botToken',
type: 'string',
default: '',
typeOptions: {
password: true,
},
},
{
displayName: 'Grant Type',
name: 'grantType',
type: 'hidden',
default: 'authorizationCode',
},
{
displayName: 'Authorization URL',
name: 'authUrl',
type: 'hidden',
default: 'https://discord.com/api/oauth2/authorize',
required: true,
},
{
displayName: 'Access Token URL',
name: 'accessTokenUrl',
type: 'hidden',
default: 'https://discord.com/api/oauth2/token',
required: true,
},
{
displayName: 'Auth URI Query Parameters',
name: 'authQueryParameters',
type: 'hidden',
default: 'permissions=1642758929655',
},
{
displayName: 'Custom Scopes',
name: 'customScopes',
type: 'boolean',
default: false,
description: 'Define custom scopes',
},
{
displayName: 'The default scopes needed for the node to work are already set, If you change these the node may not function correctly.',
name: 'customScopesNotice',
type: 'notice',
default: '',
displayOptions: {
show: {
customScopes: [true],
},
},
},
{
displayName: 'Enabled Scopes',
name: 'enabledScopes',
type: 'string',
displayOptions: {
show: {
customScopes: [true],
},
},
default: defaultScopes.join(' '),
description: 'Scopes that should be enabled',
},
{
displayName: 'Scope',
name: 'scope',
type: 'hidden',
default: '={{$self["customScopes"] ? $self["enabledScopes"] : "' + defaultScopes.join(' ') + '"}}',
},
];
}
exports.DiscordOAuth2Api = DiscordOAuth2Api;
//# sourceMappingURL=DiscordOAuth2Api.credentials.js.map