2021-02-20 09:55:57 -08:00
|
|
|
import {
|
|
|
|
ICredentialType,
|
2021-06-12 09:39:55 -07:00
|
|
|
INodeProperties,
|
2021-02-20 09:55:57 -08:00
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
// https://bitwarden.com/help/article/public-api/#authentication
|
|
|
|
|
|
|
|
export class BitwardenApi implements ICredentialType {
|
|
|
|
name = 'bitwardenApi';
|
|
|
|
displayName = 'Bitwarden API';
|
|
|
|
documentationUrl = 'bitwarden';
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2021-02-20 09:55:57 -08:00
|
|
|
{
|
|
|
|
displayName: 'Client ID',
|
|
|
|
name: 'clientId',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2021-02-20 09:55:57 -08:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Client Secret',
|
|
|
|
name: 'clientSecret',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2021-02-20 09:55:57 -08:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Environment',
|
|
|
|
name: 'environment',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'options',
|
2021-02-20 09:55:57 -08:00
|
|
|
default: 'cloudHosted',
|
|
|
|
options: [
|
|
|
|
{
|
2022-04-13 23:32:27 -07:00
|
|
|
name: 'Cloud-Hosted',
|
2021-02-20 09:55:57 -08:00
|
|
|
value: 'cloudHosted',
|
|
|
|
},
|
|
|
|
{
|
2022-04-13 23:32:27 -07:00
|
|
|
name: 'Self-Hosted',
|
2021-02-20 09:55:57 -08:00
|
|
|
value: 'selfHosted',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2022-04-13 23:32:27 -07:00
|
|
|
displayName: 'Self-Hosted Domain',
|
2021-02-20 09:55:57 -08:00
|
|
|
name: 'domain',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2021-02-20 09:55:57 -08:00
|
|
|
default: '',
|
|
|
|
placeholder: 'https://www.mydomain.com',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
environment: [
|
|
|
|
'selfHosted',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|