2023-01-27 14:22:44 +03:00
|
|
|
import type { ICredentialType, INodeProperties } from 'n8n-workflow';
|
2020-06-17 20:38:30 +03:00
|
|
|
|
|
|
|
export class NextCloudOAuth2Api implements ICredentialType {
|
|
|
|
name = 'nextCloudOAuth2Api';
|
2022-12-02 23:54:28 +03:00
|
|
|
|
2022-07-24 18:36:17 +03:00
|
|
|
extends = ['oAuth2Api'];
|
2022-12-02 23:54:28 +03:00
|
|
|
|
2020-06-17 20:38:30 +03:00
|
|
|
displayName = 'NextCloud OAuth2 API';
|
2022-12-02 23:54:28 +03:00
|
|
|
|
2020-08-17 15:42:09 +03:00
|
|
|
documentationUrl = 'nextCloud';
|
2022-12-02 23:54:28 +03:00
|
|
|
|
2021-06-12 19:39:55 +03:00
|
|
|
properties: INodeProperties[] = [
|
2022-06-14 08:27:19 +03:00
|
|
|
{
|
|
|
|
displayName: 'Grant Type',
|
|
|
|
name: 'grantType',
|
|
|
|
type: 'hidden',
|
|
|
|
default: 'authorizationCode',
|
|
|
|
},
|
2020-06-17 20:38:30 +03:00
|
|
|
{
|
|
|
|
displayName: 'Web DAV URL',
|
|
|
|
name: 'webDavUrl',
|
2021-06-12 19:39:55 +03:00
|
|
|
type: 'string',
|
2020-07-23 00:52:40 +03:00
|
|
|
placeholder: 'https://nextcloud.example.com/remote.php/webdav',
|
2020-06-17 20:38:30 +03:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Authorization URL',
|
|
|
|
name: 'authUrl',
|
2021-06-12 19:39:55 +03:00
|
|
|
type: 'string',
|
2020-06-17 20:38:30 +03:00
|
|
|
default: 'https://nextcloud.example.com/apps/oauth2/authorize',
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Access Token URL',
|
|
|
|
name: 'accessTokenUrl',
|
2021-06-12 19:39:55 +03:00
|
|
|
type: 'string',
|
2020-06-17 20:38:30 +03:00
|
|
|
default: 'https://nextcloud.example.com/apps/oauth2/api/v1/token',
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Scope',
|
|
|
|
name: 'scope',
|
2021-06-12 19:39:55 +03:00
|
|
|
type: 'hidden',
|
2020-06-17 20:38:30 +03:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Auth URI Query Parameters',
|
|
|
|
name: 'authQueryParameters',
|
2021-06-12 19:39:55 +03:00
|
|
|
type: 'hidden',
|
2020-06-17 20:38:30 +03:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Authentication',
|
|
|
|
name: 'authentication',
|
2021-06-12 19:39:55 +03:00
|
|
|
type: 'hidden',
|
2020-06-17 20:38:30 +03:00
|
|
|
default: 'body',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|