import { ICredentialType , ICredentialTypes as ICredentialTypesInterface } from 'n8n-workflow' ; import { ICredentialsTypeData } from '.' ; class CredentialTypesClass implements ICredentialTypesInterface { credentialTypes : ICredentialsTypeData = { } ; async init ( credentialTypes ) { this . credentialTypes = credentialTypes ; } getAll ( ) { return Object . values ( this . credentialTypes ) ; } getByName ( credentialType ) { return this . credentialTypes [ credentialType ] ; } } let credentialTypesInstance ; export function CredentialTypes ( ) { if ( credentialTypesInstance === undefined ) { credentialTypesInstance = new CredentialTypesClass ( ) ; } return credentialTypesInstance ; }