@studyportals/sp-r2d2
Version:
A framework that contains various components used when developing projects that will be deployed via AWS λ.
21 lines (20 loc) • 681 B
TypeScript
/**
* Offers the necessary functionality to pack a payload
* so that it can later be retrieved as part of a transfer.
*/
export interface ITransferMedium<TPayload> {
/**
* Packs the specified payload and provides a unique
* identifier that can be used as part of the retrieval.
*
* @param payload The payload that is to be packed.
*/
pack(payload: TPayload): Promise<string>;
/**
* Retrieves the payload associated with the specified identifier,
* removing it from the transfer medium.
*
* @param identifier The identifier associated with the desired payload.
*/
unpack(identifier: string): Promise<TPayload>;
}