/************************************************************************* * Copyright 2021 Adobe * All Rights Reserved. * * NOTICE: Adobe permits you to use, modify, and distribute this file in * accordance with the terms of the Adobe license agreement accompanying * it. If you have received this file from a source other than Adobe, * then your use, modification, or distribution of it requires the prior * written permission of Adobe. **************************************************************************/ /** * Sets the scope validity. Ensuring a session can not be used outside of its context. */ export declare enum SessionScope { /** * User - Session is valid for the current user only. */ USER = "user", /** * Organization - Session is valid for the current user and organization only. */ ORG = "org", /** * Context - Session is valid for the current user, organization and context only. * Context depends on the solution - Could be Sandboxes or Sub orgs. */ CONTEXT = "context" } /** * The session object. */ export interface Session { /** * Timestamp indicating session expiration time. * 0 will use default TTL configured for the application. */ expires: number; /** * Session identifier */ id: string; } /** * APIs to get, set or invalidate session data. These APIs are meant for applications using their * own session management in addition Adobe IMS. These APIs are not meant to manage session but * rather cache and recycle them whenever possible. */ export interface SessionApi { /** * Gets a stored session if one is available. * @returns Session object */ get(): Promise; /** * Stores the current session * @param session Session object */ set(session: Session): Promise; /** * Invalidates a session if its current. * @param session Session object */ invalidate(session: Session): Promise; } declare const session: SessionApi; export default session;