Implements

Constructors

Properties

client: DynamoDBClient
docClient: DynamoDBDocumentClient
lockVerificationProperty: string
maxLockTime: number
pollingFrequency: number
pollingMaxAttempts: number
tableName: string

Methods

  • Attempt to lock the row

    Parameters

    • id: string
    • lockVerificationValue: string

    Returns Promise<boolean>

    boolean - returns true if lock successful (unsuccessful lock throws LockError)

    Throws

    Error - a message declaring that the row is already locked, if that is the case

  • Polls DynamoDB until the table exists and its status is 'ACTIVE'.

    Returns Promise<void>

    Throws

    Error - Will throw an error if the table doesn't become active within the max attempts.

  • Adds or updates (if the fields already exist) data in the session

    Parameters

    • id: string

      the session id

    • sessionData: SessionStoreData

      the data to add or update

    Returns Promise<boolean>

  • unlock a session row so that other clients can modify its data

    Parameters

    • id: string

      the id of the session to unlock

    Returns Promise<boolean>

  • Removes the given properties from the session object No error will be thrown if any of the provided fields don't exist.

    Returns false if the id wasn't found. Otherwise, returns true.

    Parameters

    • id: string

      the session id

    • properties: string[]

      the names of the properties or indexes to remove

    Returns Promise<boolean>