/** * An interface handling three level attributes: request, session and persistence. */ export interface AttributesManager { /** * Provides request attributes for the request life cycle. * @returns {Object.} */ getRequestAttributes(): { [key: string]: any; }; /** * Provides session attributes extracted from request envelope. * @returns {Object.} */ getSessionAttributes(): T; /** * Provides persistent attributes retrieved and cached from persistence adapter, provide false to useSessionCache to ignore values cached from previous invocations. * @param {boolean} [useSessionCache=true] * @returns {Promise>} */ getPersistentAttributes(useSessionCache?: boolean, defaultAttributes?: { [key: string]: any; }): Promise<{ [key: string]: any; }>; /** * Overwrites the request attributes value. * @param {Object.} requestAttributes * @returns {void} */ setRequestAttributes(requestAttributes: { [key: string]: any; }): void; /** * Overwrites the session attributes value. * @param {Object.} sessionAttributes * @returns {void} */ setSessionAttributes(sessionAttributes: { [key: string]: any; }): void; /** * Overwrites and caches the persistent attributes value. Note no persistence layer calls are being made in this function. * @param {Object.} persistentAttributes * @returns {void} */ setPersistentAttributes(persistentAttributes: { [key: string]: any; }): void; /** * Save persistent attributes to the persistence layer if a persistence adapter is provided. * @return {Promise} */ savePersistentAttributes(): Promise; /** * Delete persistent attributes from the persistent layer if a persistence adapter is provided. * @return {Promise} */ deletePersistentAttributes?(): Promise; }