/** * @adonisjs/session * * (c) AdonisJS * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ import { type DynamoDBClient } from '@aws-sdk/client-dynamodb'; import type { SessionStoreContract, SessionData } from '../types.ts'; /** * DynamoDB store to read/write session data to AWS DynamoDB. * Provides highly scalable, managed session storage with automatic expiry. * * @example * const dynamoStore = new DynamoDBStore(dynamoClient, '2 hours', { * tableName: 'Sessions', * keyAttribute: 'sessionId' * }) */ export declare class DynamoDBStore implements SessionStoreContract { #private; /** * Creates a new DynamoDB store instance * * @param client - DynamoDB client instance * @param age - Session age in seconds or time expression (e.g. '2 hours') * @param options - Configuration options * @param options.tableName - DynamoDB table name (defaults to "Session") * @param options.keyAttribute - Key attribute name (defaults to "key") */ constructor(client: DynamoDBClient, age: string | number, options?: { /** * Defaults to "Session" */ tableName?: string; /** * Defaults to "key" */ keyAttribute?: string; }); /** * Reads session data from DynamoDB * * @param sessionId - Session identifier * * @example * const data = await store.read('sess_abc123') */ read(sessionId: string): Promise; /** * Writes session values to DynamoDB with expiry * * @param sessionId - Session identifier * @param values - Session data to store * * @example * await store.write('sess_abc123', { userId: 123 }) */ write(sessionId: string, values: Object): Promise; /** * Removes session data from DynamoDB * * @param sessionId - Session identifier to remove * * @example * await store.destroy('sess_abc123') */ destroy(sessionId: string): Promise; /** * Updates the session expiry time in DynamoDB * * @param sessionId - Session identifier * * @example * await store.touch('sess_abc123') */ touch(sessionId: string): Promise; }