AbstractProtectedexpiresProtected Abstract_Protected Abstract_Protected Abstract_Protected Abstract_Initialize the base persistence layer from the configuration settings
configuration object for the persistence layer
Deletes a record from the persistence store for the persistence key generated from the data passed in.
the data payload that will be hashed to create the hash portion of the idempotency key
Optionaloptions: PersistenceOperationOptions
operation options; when options.identity is provided its key is used instead of hashing data again, so the record is deleted even if data was mutated after the identity was resolved by getRecordIdentity()
Retrieve the number of seconds that records will be kept in the persistence store
ProtectedgetGenerates the idempotency key used to identify records in the persistence store.
the data payload that will be hashed to create the hash portion of the idempotency key
the idempotency key
Retrieves idempotency key for the provided data and fetches data for that key from the persistence store
the data payload that will be hashed to create the hash portion of the idempotency key
Resolves the idempotency key and payload hash that identify the record for the provided data.
Call it before the operation starts and pass the result to saveInProgress(),
saveSuccess(), and deleteRecord(),
so they all target the same record even if data is mutated while the operation runs.
the data payload that will be hashed to create the hash portion of the idempotency key
Check whether payload validation is enabled or not
Validates an existing record against the data payload being processed.
If the payload does not match the stored record, an IdempotencyValidationError error is thrown.
Whenever a record is retrieved from the persistence layer, it should be validated against the data payload being processed. This is to ensure that the data payload being processed is the same as the one that was used to create the record in the first place.
The record is also saved to the local cache if local caching is enabled.
the stored record to validate against
the data payload being processed and to be validated against the stored record
Saves a record indicating that the function's execution is currently in progress
the data payload that will be hashed to create the hash portion of the idempotency key
OptionalremainingTimeInMillis: number
the remaining time left in the lambda execution context
Optionaloptions: PersistenceOperationOptions
operation options; when options.identity is provided it is used instead of hashing data again, see getRecordIdentity()
Saves a record of the function completing successfully. This will create a record with a COMPLETED status and will save the result of the completed function in the idempotency record.
the data payload that will be hashed to create the hash portion of the idempotency key
the result of the successfully completed function
Optionaloptions: PersistenceOperationOptions
operation options; when options.identity is provided its key and payload hash are used instead of hashing data again, so the in-progress record is completed even if data was mutated after the identity was resolved by getRecordIdentity()
Base class for all persistence layers. This class provides the basic functionality for saving, retrieving, and deleting idempotency records. It also provides the ability to configure the persistence layer from the idempotency config.