Skip to content

Connection

This class defines a Connection from an [[User]] to an external service.

Extends

  • ResourceProperty<bkper.Connection>

Constructors

Constructor

new Connection(payload?, config?): Connection;

Parameters

ParameterType
payload?Connection
config?Config

Returns

Connection

Overrides

ResourceProperty<bkper.Connection>.constructor

Properties

payload

payload: Connection;

The underlying payload data for this resource

Inherited from

ResourceProperty.payload

Methods

clearTokenProperties()

clearTokenProperties(): void;

Cleans any token property stored in the Connection.

Returns

void


create()

create(): Promise<Connection>;

Performs create new Connection.

Returns

Promise<Connection>

The created Connection, for chaining


deleteProperty()

deleteProperty(key): this;

Deletes a custom property.

Parameters

ParameterTypeDescription
keystringThe property key

Returns

this

This resource, for chaining

Inherited from

ResourceProperty.deleteProperty

getAgentId()

getAgentId(): string | undefined;

Gets the agentId of the Connection.

Returns

string | undefined

The Connection’s agentId


getDateAddedMs()

getDateAddedMs(): string | undefined;

Gets the date when the Connection was added.

Returns

string | undefined

The Connection add date in milliseconds


getEmail()

getEmail(): string | undefined;

Gets the email of the owner of the Connection.

Returns

string | undefined

The Connection owner’s email


getId()

getId(): string | undefined;

Gets the id of the Connection.

Returns

string | undefined

The Connection’s id


getIntegrations()

getIntegrations(): Promise<Integration[]>;

Gets the existing [[Integrations]] on the Connection.

Returns

Promise<Integration[]>

The existing Integration objects


getLogo(): string | undefined;

Gets the logo of the Connection.

Returns

string | undefined

The Connection logo


getName()

getName(): string | undefined;

Gets the name of the Connection.

Returns

string | undefined

The Connection name


getProperties()

getProperties(): object;

Gets the custom properties stored in this resource.

Returns

object

Object with key/value pair properties

Inherited from

ResourceProperty.getProperties

getProperty()

getProperty(...keys): string | undefined;

Gets the property value for given keys. First property found will be retrieved.

Parameters

ParameterTypeDescription
keysstring[]The property keys to search for

Returns

string | undefined

The property value or undefined if not found

Inherited from

ResourceProperty.getProperty

getPropertyKeys()

getPropertyKeys(): string[];

Gets the custom properties keys stored in this resource.

Returns

string[]

Array of property keys sorted alphabetically

Inherited from

ResourceProperty.getPropertyKeys

getType()

getType(): "APP" | "BANK" | undefined;

Gets the type of the Connection.

Returns

"APP" | "BANK" | undefined

The Connection type


getUUID()

getUUID(): string | undefined;

Gets the universal unique identifier of this Connection.

Returns

string | undefined

The Connection’s universal unique identifier name


getVisibleProperties()

getVisibleProperties(): object;

Gets the visible custom properties stored in this resource. Hidden properties (those ending with ”_”) are excluded from the result.

Returns

object

Object with key/value pair properties, excluding hidden properties

Inherited from

ResourceProperty.getVisibleProperties

json()

json(): Connection;

Gets an immutable copy of the JSON payload for this resource.

Returns

Connection

An immutable copy of the json payload

Inherited from

ResourceProperty.json

remove()

remove(): Promise<Connection>;

Performs remove Connection.

Returns

Promise<Connection>

The removed Connection object


setAgentId()

setAgentId(agentId): Connection;

Sets the Connection agentId.

Parameters

ParameterTypeDescription
agentIdstringThe Connection agentId

Returns

Connection

The Connection, for chaining


setName()

setName(name): Connection;

Sets the name of the Connection.

Parameters

ParameterTypeDescription
namestringThe name of the Connection

Returns

Connection

The Connection, for chaining


setProperties()

setProperties(properties): this;

Sets the custom properties of this resource.

Parameters

ParameterTypeDescription
properties{ [key: string]: string; }Object with key/value pair properties

Returns

this

This resource, for chaining

Inherited from

ResourceProperty.setProperties

setProperty()

setProperty(key, value): this;

Sets a custom property in this resource.

Parameters

ParameterTypeDescription
keystringThe property key
valuestring | null | undefinedThe property value, or null/undefined to clean it

Returns

this

This resource, for chaining

Inherited from

ResourceProperty.setProperty

setType()

setType(type): Connection;

Sets the Connection type.

Parameters

ParameterTypeDescription
type"APP" | "BANK"The Connection type

Returns

Connection

The Connection, for chaining


setUUID()

setUUID(uuid): Connection;

Sets the universal unique identifier of the Connection.

Parameters

ParameterTypeDescription
uuidstringThe universal unique identifier of the Connection

Returns

Connection

The Connection, for chaining


setVisibleProperties()

setVisibleProperties(properties): this;

Sets the custom properties of this resource, filtering out hidden properties. Hidden properties are those whose keys end with an underscore ”_”.

Parameters

ParameterTypeDescription
properties{ [key: string]: string; }Object with key/value pair properties

Returns

this

This resource, for chaining

Inherited from

ResourceProperty.setVisibleProperties

setVisibleProperty()

setVisibleProperty(key, value): this;

Sets a custom property in this resource, filtering out hidden properties. Hidden properties are those whose keys end with an underscore ”_”.

Parameters

ParameterTypeDescription
keystringThe property key
valuestring | null | undefinedThe property value, or null/undefined to clean it

Returns

this

This resource, for chaining

Inherited from

ResourceProperty.setVisibleProperty