Contains methods relating to Session entities.
() => (ctx: RequestContext, user: User, authenticationStrategyName: string, sessionToken?: string) => Promise<AuthenticatedSession>Creates a new AuthenticatedSession. To be used after successful authentication.
() => Promise<CachedSession>Create an AnonymousSession and caches it using the configured SessionCacheStrategy, and returns the cached session object.
(sessionToken: string) => Promise<CachedSession | undefined>Returns the cached session object matching the given session token.
(session: AuthenticatedSession | AnonymousSession) => CachedSessionSerializes a Session instance into a simplified plain object suitable for caching.
(ctx: RequestContext, serializedSession: CachedSession, order: Order) => Promise<CachedSession>Sets the activeOrder on the given cached session object and updates the cache.
(ctx: RequestContext, serializedSession: CachedSession) => Promise<CachedSession>Clears the activeOrder on the given cached session object and updates the cache.
(serializedSession: CachedSession, channel: Channel) => Promise<CachedSession>Sets the activeChannel on the given cached session object and updates the cache.
(ctx: RequestContext, user: User) => Promise<void>Deletes all existing sessions for the given user.
(ctx: RequestContext, apiKey: ApiKey) => Promise<void>Deletes session related to API-Key
(ctx: RequestContext, activeOrderId: ID) => Promise<void>Deletes all existing sessions with the given activeOrder.
(batchSize: number) => Triggers the clean sessions job.
(ctx: RequestContext, batchSize: number) => Cleans expired sessions from the database & the session cache.