n8n/packages/nodes-base/credentials/BitwardenApi.credentials.ts
Iván Ovejero 4dce9e2cd1
Add Bitwarden node (#1401)
* Update package.json

* Add first implementation of credentials

* Add Bitwarden SVG file

* Add first implementation of generic functions

* Add scaffolding for resources and operations

* Fill in events, groups and members

* Fill in organizations and policies

* Add collection description

* Clean up credentials params

* Implement collection:update

* Add event description

* Add group description

* Add member description

* Complete all descriptions

* Remove OAuth2 from credentials name

* Prevent excessive access token retrievals

* Complete collection:update

* Refactor getAll operations

* Add group:getAll

* Add group:create

* Add group:update

* Add group:updateMembers

* Add user:create

* Add member:updateGroups

* Remove organization resource

* Remove policy resource

* Add member:update

* Reposition divider comments

* Refactor resource loaders

* Document generic functions

* Refactor returnAll and limit

* Introduce minor improvements

*  Improvements

*  Minor improvements

*  Remove not needed code

Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-02-20 18:55:57 +01:00

57 lines
1.1 KiB
TypeScript

import {
ICredentialType,
NodePropertyTypes,
} from 'n8n-workflow';
// https://bitwarden.com/help/article/public-api/#authentication
export class BitwardenApi implements ICredentialType {
name = 'bitwardenApi';
displayName = 'Bitwarden API';
documentationUrl = 'bitwarden';
properties = [
{
displayName: 'Client ID',
name: 'clientId',
type: 'string' as NodePropertyTypes,
default: '',
},
{
displayName: 'Client Secret',
name: 'clientSecret',
type: 'string' as NodePropertyTypes,
default: '',
},
{
displayName: 'Environment',
name: 'environment',
type: 'options' as NodePropertyTypes,
default: 'cloudHosted',
options: [
{
name: 'Cloud-hosted',
value: 'cloudHosted',
},
{
name: 'Self-hosted',
value: 'selfHosted',
},
],
},
{
displayName: 'Self-hosted domain',
name: 'domain',
type: 'string' as NodePropertyTypes,
default: '',
placeholder: 'https://www.mydomain.com',
displayOptions: {
show: {
environment: [
'selfHosted',
],
},
},
},
];
}