Build and executes a TransactWriteItems request

Constructors

Properties

#errorMessages: Record<number, string> = {}
#transactionItems: (Omit<TransactWriteItem, "ConditionCheck" | "Put" | "Delete" | "Update"> & {})[] = []

Methods

  • Add a conditional check to the transaction

    Parameters

    • item: Omit<ConditionCheck, "Key" | "ExpressionAttributeValues"> & {}
    • conditionFailedMsg: string

    Returns void

  • Add a delete operation to the transaction

    Parameters

    • item: Omit<Delete, "Key" | "ExpressionAttributeValues"> & {}
    • Optional conditionFailedMsg: string

    Returns void

  • Add a put operation to the transaction

    Parameters

    • item: Omit<Put, "Item" | "ExpressionAttributeValues"> & {}
    • Optional conditionFailedMsg: string

    Returns void

  • Add an update operation to the transaction

    Parameters

    • item: Omit<Update, "Key" | "ExpressionAttributeValues"> & {}
    • Optional conditionFailedMsg: string

    Returns void

  • Handle TransactionCanceledException, aggregating errors and applying friendly errors if provided.

    Parameters

    • error: TransactionCanceledException

    Returns AggregateError | TransactionCanceledException

  • Track error messages to return if there is a ConditionalCheckFailed exception

    IMPORTANT - Call this before adding the transaction to this.#transactionItems

    Parameters

    • Optional errMsg: string

      The custom error message to return if there is a ConditionalCheckFailed exception

    Returns void

Generated using TypeDoc