Options
All
  • Public
  • Public/Protected
  • All
Menu
description

This class defines the exact fields that are stored in the corresponding MongoDB documents. It should be used whenever database documents are being handled or read for the account_integrations collection.

Note that this class uses the generic Transferable trait to enable a toDTO() method on the model.

todo

Timestamp fields should be numbers to avoid timezone issues.

since

v0.3.0

Hierarchy

Index

Constructors

Properties

address: string

The account's address. An address typically refers to a human-readable series of 39 characters, starting either with a T, for TESTNET addresses, or with a N, for MAINNET addresses.

This field is required and indexed.

access

public

readonly
var

{string}

authorizationHash: string

This field is used in a verification step to make sure that only the owner of an OAuth integration can update this integration.

The authorization URL is built using the end-user's address and a possible referral code.

This field is required and indexed.

access

public

readonly
var

{string}

collectionName: string = "accountintegrations"

This field contains the mongo collection name for entries that are stored using AccountIntegrationDocument or the model AccountIntegrationModel.

Note that this field is not part of document properties and used only internally to perform queries that refer to an individual collection name, e.g. $unionWith.

access

public

var

{string}

createdAt?: Date

The document's creation timestamp. This field does not reflect the date of creation of an integration but rather the date of creation of the cached database entry.

access

public

readonly
var

{Date}

encAccessToken?: string

This field contains an encrypted access token which uses the seed in OAuthService.getEncryptionSeed.

This field is optional and not indexed.

access

public

readonly
var

{Date}

encRefreshToken?: string

This field contains an encrypted refresh token which uses the seed in OAuthService.getEncryptionSeed.

This field is optional and not indexed.

todo

Note this is not protected for number overflows (but there is a long way until block numbers do overflow..)

access

public

readonly
var

{number}

expiresAt?: number

The short-lived access token's expiration time. This is the number of milliseconds since the UTC epoch, representing the time at which the access token will expire.

Note that this field is explicitly converted to contain milliseconds rather than seconds, such that resulting timestamps can be used in TS.

access

public

readonly
var

{number}

name: string

The OAuth integration provider name. This is usually the name of the platform of which an account is being linked to the dApp.

This field is required and indexed.

access

public

readonly
var

{string}

remoteIdentifier?: string

This field contains the remote identifier. This is usually the identifier of the account on the third party platform, e.g. the athlete identifier in Strava.

This field is optional and indexed.

access

public

readonly
var

{string}

updatedAt?: Date

The document's update timestamp. This field does not reflect the date of update of an integration but rather the date of update of the cached database entry.

access

public

readonly
var

{Date}

Accessors

  • get toQuery(): Record<string, unknown>
  • This method implements a specialized query format to query items individually, as documents, in the collection: account_integrations.

    access

    public

    Returns Record<string, unknown>

    The individual document data that is used in a query.

Methods

Generated using TypeDoc