2022-07-24 08:36:17 -07:00
|
|
|
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
2020-06-03 07:24:17 -07:00
|
|
|
|
2022-07-24 08:36:17 -07:00
|
|
|
const scopes = ['files.content.write', 'files.content.read', 'sharing.read', 'account_info.read'];
|
2020-06-03 07:24:17 -07:00
|
|
|
|
|
|
|
export class DropboxOAuth2Api implements ICredentialType {
|
|
|
|
name = 'dropboxOAuth2Api';
|
2022-07-24 08:36:17 -07:00
|
|
|
extends = ['oAuth2Api'];
|
2020-06-03 07:24:17 -07:00
|
|
|
displayName = 'Dropbox OAuth2 API';
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'dropbox';
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2022-06-13 22:27:19 -07:00
|
|
|
{
|
|
|
|
displayName: 'Grant Type',
|
|
|
|
name: 'grantType',
|
|
|
|
type: 'hidden',
|
|
|
|
default: 'authorizationCode',
|
|
|
|
},
|
2020-06-03 07:24:17 -07:00
|
|
|
{
|
|
|
|
displayName: 'Authorization URL',
|
|
|
|
name: 'authUrl',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-06-03 07:24:17 -07:00
|
|
|
default: 'https://www.dropbox.com/oauth2/authorize',
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Access Token URL',
|
|
|
|
name: 'accessTokenUrl',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-06-03 07:24:17 -07:00
|
|
|
default: 'https://api.dropboxapi.com/oauth2/token',
|
|
|
|
required: true,
|
2020-10-01 05:01:39 -07:00
|
|
|
},
|
|
|
|
{
|
2020-06-03 07:24:17 -07:00
|
|
|
displayName: 'Scope',
|
|
|
|
name: 'scope',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-12-23 03:48:53 -08:00
|
|
|
default: scopes.join(' '),
|
2020-06-03 07:24:17 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Auth URI Query Parameters',
|
|
|
|
name: 'authQueryParameters',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2021-03-11 00:16:05 -08:00
|
|
|
default: 'token_access_type=offline&force_reapprove=true',
|
2020-06-03 07:24:17 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Authentication',
|
|
|
|
name: 'authentication',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-06-03 07:24:17 -07:00
|
|
|
default: 'header',
|
|
|
|
},
|
2021-03-25 15:25:05 -07:00
|
|
|
{
|
|
|
|
displayName: 'APP Access Type',
|
|
|
|
name: 'accessType',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'options',
|
2021-03-25 15:25:05 -07:00
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'App Folder',
|
|
|
|
value: 'folder',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Full Dropbox',
|
|
|
|
value: 'full',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'full',
|
|
|
|
},
|
2020-06-03 07:24:17 -07:00
|
|
|
];
|
|
|
|
}
|