import type { IActivityHandler } from "@vertigis/workflow"; /** An interface that defines the inputs of the activity. */ interface GetSessionStorageItemActivityInputs { /** * @displayName keyName * @description A string containing the name of the key you want to retrieve from SessionStorage * @required */ keyName: string; } /** An interface that defines the outputs of the activity. */ interface GetSessionStorageItemActivityOutputs { /** * @description the returned keyValue from SessionStorage */ result: string; } /** * @displayName Get SessionStorage Item * @category EBTA Utilities * @description Get an item from browser SessionStorage object 1.1 */ export default class GetSessionStorageItemActivity implements IActivityHandler { /** Perform the execution logic of the activity. */ async execute(inputs: GetSessionStorageItemActivityInputs): Promise { const { keyName } = inputs; const keyValue = sessionStorage.getItem(keyName); return { result: `${keyValue}`, }; } }