diff --git a/packages/nodes-base/credentials/TwitterOAuth2Api.credentials.ts b/packages/nodes-base/credentials/TwitterOAuth2Api.credentials.ts new file mode 100644 index 0000000000..93283fd3a2 --- /dev/null +++ b/packages/nodes-base/credentials/TwitterOAuth2Api.credentials.ts @@ -0,0 +1,54 @@ +import type { ICredentialType, INodeProperties } from 'n8n-workflow'; + +export class TwitterOAuth2Api implements ICredentialType { + name = 'twitterOAuth2Api'; + + extends = ['oAuth2Api']; + + displayName = 'Twitter OAuth2 API'; + + documentationUrl = 'twitter'; + + properties: INodeProperties[] = [ + { + displayName: 'Request Token URL', + name: 'requestTokenUrl', + type: 'hidden', + default: 'https://api.twitter.com/oauth/request_token', + }, + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'hidden', + default: 'https://api.twitter.com/oauth/authorize', + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'hidden', + default: 'https://api.twitter.com/oauth/access_token', + }, + { + displayName: 'Signature Method', + name: 'signatureMethod', + type: 'hidden', + default: 'HMAC-SHA1', + }, + { + displayName: 'Grant Type', + name: 'grantType', + type: 'hidden', + options: [ + { + name: 'Authorization Code', + value: 'authorizationCode', + }, + { + name: 'Authorization Code with PKCE', + value: 'pkce', + }, + ], + default: 'authorizationCode', + }, + ]; +} diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 358c05fb54..44039ef38f 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -315,6 +315,7 @@ "dist/credentials/TwilioApi.credentials.js", "dist/credentials/TwistOAuth2Api.credentials.js", "dist/credentials/TwitterOAuth1Api.credentials.js", + "dist/credentials/TwitterOAuth2Api.credentials.js", "dist/credentials/TypeformApi.credentials.js", "dist/credentials/TypeformOAuth2Api.credentials.js", "dist/credentials/UnleashedSoftwareApi.credentials.js",