import { DynamoDBContext, DynamoDBBaseItem } from "./types"; import { ListParams } from "@authhero/adapter-interfaces"; /** * Transactional write operation for DynamoDB * Allows multiple put/delete operations to be atomic */ export declare function transactWriteItems(ctx: DynamoDBContext, items: Array<{ type: "put" | "delete"; item?: DynamoDBBaseItem; pk?: string; sk?: string; conditionExpression?: string; }>): Promise; /** * Generic get operation for DynamoDB */ export declare function getItem(ctx: DynamoDBContext, pk: string, sk: string): Promise; /** * Generic put operation for DynamoDB * @param dynamoItem - The DynamoDB item with PK, SK, etc. * @param options - Optional settings including condition expression */ export declare function putItem(ctx: DynamoDBContext, dynamoItem: DynamoDBBaseItem, options?: { conditionExpression?: string; }): Promise; /** * Generic delete operation for DynamoDB */ export declare function deleteItem(ctx: DynamoDBContext, pk: string, sk: string): Promise; /** * Generic query operation for DynamoDB */ export declare function queryItems(ctx: DynamoDBContext, pk: string, options?: { skPrefix?: string; skValue?: string; indexName?: string; limit?: number; startKey?: Record; scanIndexForward?: boolean; }): Promise<{ items: T[]; lastKey?: Record; }>; /** True when the caller asked for keyset (checkpoint) pagination. */ export declare function isKeysetRequest(params?: ListParams): boolean; /** * Query with pagination support. * * Two modes, picked by which parameters the caller supplied: * * - **Keyset (checkpoint)** — `from`/`take`. `from` is an OPAQUE cursor (see * `encodeDynamoCursor`) wrapping DynamoDB's own `LastEvaluatedKey`, so a page * resumes natively via `ExclusiveStartKey` with no scanning of skipped rows. * Returns `next` when a further page may exist, and no `total` — matching * Auth0's checkpoint responses and the SQL adapters. * - **Offset** — `page`/`per_page`. Unchanged, including the read-and-discard * loop DynamoDB forces on us (it has no native offset). The admin UI uses * this, and it is what `include_totals` is for. */ export declare function queryWithPagination(ctx: DynamoDBContext, pk: string, params?: ListParams, options?: { skPrefix?: string; indexName?: string; scanIndexForward?: boolean; }): Promise<{ items: T[]; start: number; limit: number; length: number; total?: number; /** Opaque cursor for the next page; keyset mode only, absent on the last. */ next?: string; }>; /** * Generic update operation for DynamoDB */ export declare function updateItem(ctx: DynamoDBContext, pk: string, sk: string, updates: Record): Promise; /** * Remove DynamoDB metadata fields from an item */ export declare function stripDynamoDBFields(item: T): Omit; /** * Remove null/undefined properties from an object */ export declare function removeNullProperties(obj: T): T;