qstd 0.2.27 → 0.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,6 +20,58 @@ A single npm package providing:
20
20
  pnpm add qstd
21
21
  ```
22
22
 
23
+ ## Prerequisites
24
+
25
+ ### TypeScript Configuration (Required)
26
+
27
+ To use subpath imports like `qstd/server`, `qstd/client`, or `qstd/react`, your `tsconfig.json` **must** use a modern module resolution strategy:
28
+
29
+ ```json
30
+ {
31
+ "compilerOptions": {
32
+ "moduleResolution": "bundler"
33
+ }
34
+ }
35
+ ```
36
+
37
+ **Valid options:** `"bundler"`, `"node16"`, or `"nodenext"`
38
+
39
+ #### Why is this required?
40
+
41
+ This package uses the **`exports`** field in `package.json` to define subpath exports:
42
+
43
+ ```json
44
+ {
45
+ "exports": {
46
+ "./react": { "types": "...", "import": "..." },
47
+ "./client": { "types": "...", "import": "..." },
48
+ "./server": { "types": "...", "import": "..." },
49
+ "./preset": { "types": "...", "import": "..." }
50
+ }
51
+ }
52
+ ```
53
+
54
+ The `exports` field is the modern Node.js way to define multiple entry points for a package. It allows a single package to expose different modules at different paths (e.g., `qstd/server` vs `qstd/client`) with proper type definitions for each.
55
+
56
+ **The problem:** The older `"moduleResolution": "node"` (also called "node10") setting predates the `exports` field and does not understand it. TypeScript will fail to resolve the types:
57
+
58
+ ```
59
+ Cannot find module 'qstd/server' or its corresponding type declarations.
60
+ There are types at '.../node_modules/qstd/dist/server/index.d.ts', but this result
61
+ could not be resolved under your current 'moduleResolution' setting.
62
+ ```
63
+
64
+ **The fix:** Use `"moduleResolution": "bundler"` which understands the `exports` field. This is the recommended setting for projects using modern bundlers like Vite, esbuild, or webpack 5+.
65
+
66
+ #### Quick Reference
67
+
68
+ | moduleResolution | Supports `exports` | Use Case |
69
+ |-----------------|-------------------|----------|
70
+ | `"node"` / `"node10"` | ❌ No | Legacy projects |
71
+ | `"node16"` | ✅ Yes | Node.js 16+ with ESM |
72
+ | `"nodenext"` | ✅ Yes | Latest Node.js features |
73
+ | `"bundler"` | ✅ Yes | **Recommended** for bundled apps |
74
+
23
75
  ## Usage
24
76
 
25
77
  ### React (Block + Hooks)
@@ -0,0 +1,257 @@
1
+ import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";
2
+ import * as _t from "./types";
3
+ export type Client = ReturnType<typeof create>;
4
+ export declare const create: (props?: {
5
+ credentials?: _t.Credentials;
6
+ tableName: string;
7
+ }) => {
8
+ client: DynamoDBDocumentClient;
9
+ tableName: string | undefined;
10
+ };
11
+ /**
12
+ * Query or Scan DynamoDB with type-safe filters and modern API
13
+ * @param ddb - DynamoDB client
14
+ * @param props - Query/Scan properties
15
+ * @returns Items array by default; use `first` and `raw` flags to customize
16
+ *
17
+ * @example
18
+ * // Get items array (default)
19
+ * const items = await find<User>(doc, {
20
+ * tableName: 'users',
21
+ * pk: { value: 'user#123' }
22
+ * });
23
+ * // items: User[]
24
+ *
25
+ * @example
26
+ * // Get first item
27
+ * const user = await find<User>(doc, {
28
+ * tableName: 'users',
29
+ * pk: { value: 'user#123' },
30
+ * first: true,
31
+ * }); // user: User | undefined
32
+ *
33
+ * @example
34
+ * // Get full response with metadata
35
+ * const result = await find<User>(doc, {
36
+ * tableName: 'users',
37
+ * pk: { value: 'user#123' },
38
+ * raw: true,
39
+ * }); // result: RawResponse<User>
40
+ *
41
+ * @example
42
+ * // Type-safe filters with modern API
43
+ * const active = await find<User>(doc, {
44
+ * tableName: 'users',
45
+ * pk: { value: 'org#456' },
46
+ * sk: { op: 'begins_with', value: 'user#' },
47
+ * filters: [
48
+ * { key: 'status', op: '=', value: 'active' },
49
+ * { key: 'score', op: '>', value: 80 },
50
+ * { key: 'email', op: 'attribute_exists' }
51
+ * ],
52
+ * sort: 'desc',
53
+ * strong: true,
54
+ * }); // active: User[]
55
+ *
56
+ * @example
57
+ * // Scan mode - no pk/sk required, can filter on any attribute
58
+ * const allActive = await find<User>(doc, {
59
+ * tableName: 'users',
60
+ * scan: true,
61
+ * filters: [
62
+ * { key: 'pk', op: 'begins_with', value: 'user#' },
63
+ * { key: 'status', op: '=', value: 'active' },
64
+ * ],
65
+ * recursive: true,
66
+ * maxItems: 1000,
67
+ * }); // allActive: User[]
68
+ */
69
+ export declare function find<T extends object = Record<string, unknown>>(ddb: Client, props: _t.FindProps<T> & {
70
+ first: true;
71
+ raw: true;
72
+ }): Promise<{
73
+ item: T | undefined;
74
+ count: number;
75
+ scannedCount: number;
76
+ }>;
77
+ export declare function find<T extends object = Record<string, unknown>>(ddb: Client, props: _t.FindProps<T> & {
78
+ raw: true;
79
+ }): Promise<_t.RawResponse<T>>;
80
+ export declare function find<T extends object = Record<string, unknown>>(ddb: Client, props: _t.FindProps<T> & {
81
+ /** Return the first item from the items array */ first: true;
82
+ }): Promise<T | undefined>;
83
+ export declare function find<T extends object = Record<string, unknown>>(ddb: Client, props: _t.FindProps<T>): Promise<T[]>;
84
+ export declare const remove: (ddb: Client, props: {
85
+ key: _t.Key;
86
+ tableName?: string;
87
+ }) => Promise<import("@aws-sdk/lib-dynamodb").DeleteCommandOutput>;
88
+ /** * Create or overwrite an item
89
+ * @param ddb
90
+ * @param item
91
+ * @param opts
92
+ * @returns
93
+ */
94
+ export declare const save: <T extends object>(ddb: Client, props: {
95
+ tableName?: string;
96
+ item: T;
97
+ }) => Promise<import("@aws-sdk/lib-dynamodb").PutCommandOutput>;
98
+ /**
99
+ * Batch get multiple items from DynamoDB
100
+ *
101
+ * ## Limits
102
+ * - Max items per request: 100
103
+ * - Max request size: 16MB
104
+ * - Read capacity: 0.5 RCU per item (eventually consistent), 1 RCU (strongly consistent)
105
+ *
106
+ * @example
107
+ * const result = await batchGet(ddb, {
108
+ * tableName: 'users',
109
+ * keys: [{ pk: 'user#1', sk: 'profile' }, { pk: 'user#2', sk: 'profile' }]
110
+ * });
111
+ * console.log(`Retrieved: ${result.count}, Missing: ${result.missing}`);
112
+ * const users = result.items;
113
+ */
114
+ export declare function batchGet<T extends Record<string, unknown>>(ddb: Client, props: {
115
+ tableName: string;
116
+ keys: {
117
+ pk: string;
118
+ sk?: string;
119
+ }[];
120
+ maxRetries?: number;
121
+ strong?: boolean;
122
+ }): Promise<_t.BatchGetResult<T>>;
123
+ /**
124
+ * Batch write (put) multiple items to DynamoDB
125
+ *
126
+ * ## Operation Mode
127
+ * - **Without conditions**: Uses BatchWriteCommand (cheaper, faster)
128
+ * - Max items: 25 per request
129
+ * - Max size: 16MB per request
130
+ * - Cost: 1 WCU per item
131
+ * - Not atomic
132
+ *
133
+ * - **With conditions**: Auto-switches to TransactWriteCommand (atomic, safer)
134
+ * - Max items: 100 per request (4x better!)
135
+ * - Max size: 4MB per request
136
+ * - Cost: 2 WCU per item (2x more expensive)
137
+ * - Atomic: all succeed or all fail
138
+ *
139
+ * @example
140
+ * // Simple usage
141
+ * const result = await batchWrite(ddb, {
142
+ * tableName: 'users',
143
+ * items: [
144
+ * { item: { pk: 'user#1', sk: 'profile', name: 'Alice' } },
145
+ * { item: { pk: 'user#2', sk: 'profile', name: 'Bob' } }
146
+ * ]
147
+ * });
148
+ * console.log(`Processed: ${result.processed}, Failed: ${result.failed}`);
149
+ *
150
+ * @example
151
+ * // With transform - avoid manual mapping
152
+ * const result = await batchWrite(ddb, {
153
+ * tableName: 'users',
154
+ * items: users,
155
+ * transform: (user) => ({ item: user })
156
+ * });
157
+ *
158
+ * @example
159
+ * // With conditions (auto-switches to transact)
160
+ * const result = await batchWrite(ddb, {
161
+ * tableName: 'users',
162
+ * items: [
163
+ * { item: user1, cond: 'attribute_not_exists(pk)' },
164
+ * { item: user2, cond: 'version = :v1' }
165
+ * ]
166
+ * });
167
+ */
168
+ export declare function batchWrite<T extends Record<string, unknown>>(ddb: Client, props: {
169
+ tableName: string;
170
+ items: {
171
+ item: T;
172
+ cond?: string;
173
+ }[];
174
+ maxRetries?: number;
175
+ }): Promise<_t.BatchWriteResult>;
176
+ export declare function batchWrite<T extends Record<string, unknown>, I>(ddb: Client, props: {
177
+ tableName: string;
178
+ items: I[];
179
+ transform: (item: I) => {
180
+ item: T;
181
+ cond?: string;
182
+ };
183
+ maxRetries?: number;
184
+ }): Promise<_t.BatchWriteResult>;
185
+ /**
186
+ * Batch delete multiple items from DynamoDB
187
+ *
188
+ * ## Operation Mode
189
+ * - **Without conditions**: Uses BatchWriteCommand (cheaper, faster)
190
+ * - Max items: 25 per request
191
+ * - Max size: 16MB per request
192
+ * - Cost: 1 WCU per item
193
+ * - Not atomic
194
+ *
195
+ * - **With conditions**: Auto-switches to TransactWriteCommand (atomic, safer)
196
+ * - Max items: 100 per request (4x better!)
197
+ * - Max size: 4MB per request
198
+ * - Cost: 2 WCU per item (2x more expensive)
199
+ * - Atomic: all succeed or all fail
200
+ *
201
+ * @example
202
+ * const result = await batchDelete(ddb, {
203
+ * tableName: 'users',
204
+ * keys: [
205
+ * { key: { pk: 'user#1', sk: 'profile' } },
206
+ * { key: { pk: 'user#2', sk: 'profile' } }
207
+ * ]
208
+ * });
209
+ *
210
+ * console.log(`Deleted: ${result.processed}, Failed: ${result.failed}`);
211
+ *
212
+ * @example
213
+ * // With transform - avoid manual mapping
214
+ * const result = await batchDelete(ddb, {
215
+ * tableName: 'users',
216
+ * keys: [{ pk: 'user#1', sk: 'profile' }, { pk: 'user#2', sk: 'profile' }],
217
+ * transform: (key) => ({ key })
218
+ * });
219
+ *
220
+ * @example
221
+ * // With conditions (auto-switches to transact)
222
+ * const result = await batchDelete(ddb, {
223
+ * tableName: 'users',
224
+ * keys: [
225
+ * { key: { pk: 'user#1', sk: 'profile' }, cond: 'attribute_exists(pk)' },
226
+ * { key: { pk: 'user#2', sk: 'profile' }, cond: 'version = :v1' }
227
+ * ]
228
+ * });
229
+ */
230
+ export declare function batchDelete(ddb: Client, props: {
231
+ tableName: string;
232
+ keys: Array<{
233
+ key: _t.Key;
234
+ cond?: string;
235
+ }>;
236
+ maxRetries?: number;
237
+ }): Promise<_t.BatchDeleteResult>;
238
+ export declare function batchDelete<I>(ddb: Client, props: {
239
+ tableName: string;
240
+ keys: I[];
241
+ transform: (item: I) => {
242
+ key: _t.Key;
243
+ cond?: string;
244
+ };
245
+ maxRetries?: number;
246
+ }): Promise<_t.BatchDeleteResult>;
247
+ export declare const deleteTable: (ddb: Client, tableName: string) => Promise<import("@aws-sdk/client-dynamodb").DeleteTableCommandOutput>;
248
+ /**
249
+ * Check if a dynamodb table exists.
250
+ * @param doc
251
+ * @param TableName
252
+ * @returns
253
+ */
254
+ export declare const tableExists: (ddb: Client, props: {
255
+ tableName: string;
256
+ }) => Promise<boolean>;
257
+ //# sourceMappingURL=domain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../../../src/server/aws/ddb/domain.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,sBAAsB,EAEvB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAG9B,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AAE/C,eAAO,MAAM,MAAM,GAAI,QAAQ;IAC7B,WAAW,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;;;CAwBA,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7D,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,GAAG,EAAE,IAAI,CAAA;CAAE,GAClD,OAAO,CAAC;IAAE,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAA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AAK,EAAE;IACL,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GACA,OAAO,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;AACjC,wBAAgB,WAAW,CAAC,CAAC,EAC3B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE;IACL,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK;QAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GACA,OAAO,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;AAkHjC,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,WAAW,MAAM,yEAIzD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GACtB,KAAK,MAAM,EACX,OAAO;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,qBAkB7B,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { NativeAttributeValue } from "@aws-sdk/lib-dynamodb";
2
+ import * as _t from "./types";
3
+ export declare const validateFindProps: <T extends object = Record<string, unknown>>(props: _t.FindProps<T> & {
4
+ first?: boolean;
5
+ raw?: boolean;
6
+ }) => void;
7
+ export declare const buildKeyConditionExpression: (pk: {
8
+ key?: string;
9
+ value: string;
10
+ }, sk: _t.SkCond | undefined, names: Record<string, string>, values: Record<string, NativeAttributeValue>) => string;
11
+ export declare const buildFilterExpression: <T extends object>(filters: ReadonlyArray<_t.FilterClause<T>>, names: Record<string, string>, values: Record<string, NativeAttributeValue>) => string | undefined;
12
+ export declare const buildProjectionExpression: <T>(projection: (keyof T)[], names: Record<string, string>) => string;
13
+ /**
14
+ * Sleep for exponential backoff
15
+ */
16
+ export declare const sleep: (ms: number) => Promise<unknown>;
17
+ /**
18
+ * Calculate backoff delay for retries
19
+ */
20
+ export declare const backoffDelay: (attempt: number) => number;
21
+ /**
22
+ * Chunk an array into smaller arrays of specified size
23
+ */
24
+ export declare const chunk: <T>(arr: T[], size: number) => T[][];
25
+ //# sourceMappingURL=fns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fns.d.ts","sourceRoot":"","sources":["../../../../src/server/aws/ddb/fns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1E,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,SA6B5D,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,IAAI;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACnC,IAAI,EAAE,CAAC,MAAM,GAAG,SAAS,EACzB,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,QAAQ,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,WAoD7C,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,MAAM,EACpD,SAAS,aAAa,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAC1C,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,QAAQ,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,uBAoE7C,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,CAAC,EACzC,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,EACvB,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,WAQ9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,IAAI,MAAM,qBACmB,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,KAAG,MAE9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,MAAM,MAAM,KAAG,CAAC,EAAE,EAIpD,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./domain";
2
+ export * from "./literals";
3
+ export type { Key } from "./types";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/server/aws/ddb/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,YAAY,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * these 2 lsis should solve all future lsis. Lsi can be a
3
+ * generic type that has different sk based on the pk.
4
+ * E.g. pkUser can store username in lsi and pkDocument
5
+ * can store id. By lsi being a generic field, can serve
6
+ * the role of multiple lsis.
7
+ */
8
+ export declare const lsi: {
9
+ readonly name: "lsi";
10
+ readonly sk: "lsi";
11
+ };
12
+ export declare const lsi2: {
13
+ readonly name: "lsi2";
14
+ readonly sk: "lsi2";
15
+ };
16
+ export declare const lsiUsername: {
17
+ readonly name: "username-lsi";
18
+ readonly sk: "username";
19
+ };
20
+ export declare const lsiNormalized: {
21
+ /** use in index_name */
22
+ readonly name: "normalized-lsi";
23
+ readonly sk: "normalized";
24
+ };
25
+ export declare const lsiPhash: {
26
+ /** use in index_name */
27
+ readonly name: "phash-lsi";
28
+ readonly sk: "phash";
29
+ };
30
+ //# sourceMappingURL=literals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"literals.d.ts","sourceRoot":"","sources":["../../../../src/server/aws/ddb/literals.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,GAAG;;;CAAsC,CAAC;AACvD,eAAO,MAAM,IAAI;;;CAAwC,CAAC;AAE1D,eAAO,MAAM,WAAW;;;CAGd,CAAC;AAGX,eAAO,MAAM,aAAa;IACxB,wBAAwB;;;CAGhB,CAAC;AAGX,eAAO,MAAM,QAAQ;IACnB,wBAAwB;;;CAGhB,CAAC"}
@@ -0,0 +1,216 @@
1
+ import type { NativeAttributeValue } from "@aws-sdk/lib-dynamodb";
2
+ import type { DynamoDBClient, DynamoDBClientConfig } from "@aws-sdk/client-dynamodb";
3
+ export type TableClient = DynamoDBClient;
4
+ export type Credentials = DynamoDBClientConfig["credentials"];
5
+ export type Key = {
6
+ pk: Pk;
7
+ sk: Sk;
8
+ };
9
+ export type StrWithAutocomplete<T> = T | (string & Record<never, never>);
10
+ export type Pk = StrWithAutocomplete<"pk" | "gsi-pk" | "gsi2-pk" | "gsi-2-pk">;
11
+ export type Sk = StrWithAutocomplete<"sk" | "gsi-sk" | "gsi2-sk" | "gsi-2-sk">;
12
+ export type RawResponse<T> = {
13
+ lastEvaluatedKey?: Record<string, unknown> | undefined;
14
+ scannedCount: number;
15
+ count: number;
16
+ items: T[];
17
+ };
18
+ type RecursiveFn<T> = (page: RawResponse<T>, pageCount: number, totalItems: number) => boolean;
19
+ export type SkCond = {
20
+ key?: Sk;
21
+ op: "=" | ">=" | ">" | "<=" | "<";
22
+ value: string;
23
+ } | {
24
+ key?: Sk;
25
+ op: "begins_with";
26
+ value: string;
27
+ } | {
28
+ key?: Sk;
29
+ op: "between";
30
+ value: [string, string];
31
+ } | {
32
+ key?: Sk;
33
+ value: string;
34
+ valueBeginsWith?: never;
35
+ } | {
36
+ key?: Sk;
37
+ valueBeginsWith: string;
38
+ value?: never;
39
+ };
40
+ type StrKey<T> = Extract<keyof T, string>;
41
+ type Comparable = string | number | bigint;
42
+ type AllowsOrder<V> = V extends Comparable ? true : false;
43
+ type AllowsBeginsWith<V> = V extends string ? true : false;
44
+ type AllowsContains<V> = V extends string ? true : V extends ReadonlyArray<unknown> | Array<unknown> | ReadonlySet<unknown> | Set<unknown> ? true : false;
45
+ type AllowsBetween<V> = V extends Comparable ? true : false;
46
+ type AllowsIn<V> = V extends Comparable ? true : false;
47
+ type EqNeClause<T, K extends StrKey<T>> = {
48
+ key: K;
49
+ op: "=" | "<>";
50
+ value: T[K];
51
+ };
52
+ type OrdClause<T, K extends StrKey<T>> = AllowsOrder<T[K]> extends true ? {
53
+ key: K;
54
+ op: ">" | ">=" | "<" | "<=";
55
+ value: Extract<T[K], Comparable>;
56
+ } : never;
57
+ type BeginsWithClause<T, K extends StrKey<T>> = AllowsBeginsWith<T[K]> extends true ? {
58
+ key: K;
59
+ op: "begins_with";
60
+ value: Extract<T[K], string>;
61
+ } : never;
62
+ type ContainsClause<T, K extends StrKey<T>> = AllowsContains<T[K]> extends true ? T[K] extends string ? {
63
+ key: K;
64
+ op: "contains";
65
+ value: string;
66
+ } : T[K] extends ReadonlyArray<infer U> | Array<infer U> | ReadonlySet<infer U> | Set<infer U> ? {
67
+ key: K;
68
+ op: "contains";
69
+ value: U;
70
+ } : never : never;
71
+ type BetweenClause<T, K extends StrKey<T>> = AllowsBetween<T[K]> extends true ? {
72
+ key: K;
73
+ op: "between";
74
+ value: readonly [Extract<T[K], Comparable>, Extract<T[K], Comparable>];
75
+ } : never;
76
+ type InClause<T, K extends StrKey<T>> = AllowsIn<T[K]> extends true ? {
77
+ key: K;
78
+ op: "in";
79
+ value: ReadonlyArray<Extract<T[K], Comparable>>;
80
+ } : never;
81
+ type ExistsClause<T, K extends StrKey<T>> = {
82
+ key: K;
83
+ op: "attribute_exists" | "attribute_not_exists";
84
+ };
85
+ type FilterClauseForKey<T, K extends StrKey<T>> = EqNeClause<T, K> | OrdClause<T, K> | BeginsWithClause<T, K> | ContainsClause<T, K> | BetweenClause<T, K> | InClause<T, K> | ExistsClause<T, K>;
86
+ /** One clause type that's keyed & value-typed from T */
87
+ export type FilterClause<T extends object> = {
88
+ [K in StrKey<T>]: FilterClauseForKey<T, K>;
89
+ }[StrKey<T>];
90
+ /** Shared props between Query and Scan operations */
91
+ type BaseFindProps<T extends object = Record<string, unknown>> = {
92
+ /** Table name override (optional, defaults to main table) */
93
+ tableName?: string;
94
+ /**
95
+ * Type-safe filter clauses for post-query/scan filtering (optional)
96
+ * Array of filter clauses, all combined with AND logic
97
+ *
98
+ * Examples:
99
+ * ```ts
100
+ * // Equality check
101
+ * filters: [{ key: 'status', op: '=', value: 'active' }]
102
+ *
103
+ * // Multiple filters (AND logic)
104
+ * filters: [
105
+ * { key: 'status', op: '=', value: 'active' },
106
+ * { key: 'age', op: '>=', value: 18 },
107
+ * { key: 'score', op: '>', value: 80 }
108
+ * ]
109
+ *
110
+ * // Existence checks
111
+ * filters: [
112
+ * { key: 'email', op: 'attribute_exists' },
113
+ * { key: 'deletedAt', op: 'attribute_not_exists' }
114
+ * ]
115
+ *
116
+ * // String operations
117
+ * filters: [
118
+ * { key: 'name', op: 'begins_with', value: 'John' },
119
+ * { key: 'description', op: 'contains', value: 'urgent' }
120
+ * ]
121
+ *
122
+ * // Range and list operations
123
+ * filters: [
124
+ * { key: 'age', op: 'between', value: [18, 65] },
125
+ * { key: 'status', op: 'in', value: ['active', 'pending', 'approved'] }
126
+ * ]
127
+ * ```
128
+ */
129
+ filters?: ReadonlyArray<FilterClause<T>>;
130
+ /** Limit number of items returned per page (optional) */
131
+ limit?: number;
132
+ /** Pagination token from previous query/scan (optional) */
133
+ startKey?: Record<string, NativeAttributeValue>;
134
+ /** Fetch all pages recursively; pass function to control continuation (optional) */
135
+ recursive?: boolean | RecursiveFn<T>;
136
+ /** Maximum items to fetch when using recursive (optional) */
137
+ maxItems?: number;
138
+ /** Maximum pages to fetch when using recursive (optional) */
139
+ maxPages?: number;
140
+ /** Use consistent reads (slower but guaranteed up-to-date, only works on tables not indexes) */
141
+ strong?: boolean;
142
+ /** Projection: specific attributes to retrieve (reduces data transfer) */
143
+ projection?: (keyof T)[];
144
+ debug?: boolean;
145
+ };
146
+ /** Query-specific props (default, scan is undefined or false) */
147
+ type QueryFindProps<T extends object = Record<string, unknown>> = BaseFindProps<T> & {
148
+ /** Use Scan instead of Query (default: false) */
149
+ scan?: false | undefined;
150
+ /** Primary key condition (required for Query) */
151
+ pk: {
152
+ key?: string;
153
+ value: string;
154
+ };
155
+ /** Sort key condition (optional) */
156
+ sk?: SkCond;
157
+ /** Global secondary index name (optional) */
158
+ indexName?: string;
159
+ /** Sort order: ascending or descending (default: asc). Only available for Query. */
160
+ sort?: "asc" | "desc";
161
+ };
162
+ /** Scan-specific props (scan: true) */
163
+ type ScanFindProps<T extends object = Record<string, unknown>> = BaseFindProps<T> & {
164
+ /** Use Scan instead of Query - scans entire table with optional filters */
165
+ scan: true;
166
+ /** pk is not allowed in scan mode - use filters instead */
167
+ pk?: never;
168
+ /** sk is not allowed in scan mode - use filters instead */
169
+ sk?: never;
170
+ /** Index to scan (optional, rarely needed for scans) */
171
+ indexName?: string;
172
+ /** sort is not available for Scan - DynamoDB returns items in storage order */
173
+ sort?: never;
174
+ };
175
+ /**
176
+ * Find props - discriminated union between Query and Scan modes
177
+ *
178
+ * @example
179
+ * // Query mode (default) - pk required
180
+ * const items = await find<User>(doc, {
181
+ * tableName: 'users',
182
+ * pk: { value: 'user#123' },
183
+ * sk: { op: 'begins_with', value: 'profile#' },
184
+ * sort: 'desc',
185
+ * });
186
+ *
187
+ * @example
188
+ * // Scan mode - no pk/sk, can filter on any attribute
189
+ * const items = await find<User>(doc, {
190
+ * tableName: 'users',
191
+ * scan: true,
192
+ * filters: [
193
+ * { key: 'pk', op: 'begins_with', value: 'user#' },
194
+ * { key: 'status', op: '=', value: 'active' },
195
+ * ],
196
+ * });
197
+ */
198
+ export type FindProps<T extends object = Record<string, unknown>> = QueryFindProps<T> | ScanFindProps<T>;
199
+ export type BatchGetResult<T> = {
200
+ items: T[];
201
+ count: number;
202
+ missing: number;
203
+ consumedCapacity?: number | undefined;
204
+ };
205
+ export type BatchWriteResult = {
206
+ processed: number;
207
+ failed: number;
208
+ consumedCapacity?: number | undefined;
209
+ };
210
+ export type BatchDeleteResult = {
211
+ processed: number;
212
+ failed: number;
213
+ consumedCapacity?: number | undefined;
214
+ };
215
+ export {};
216
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/server/aws/ddb/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC;AACzC,MAAM,MAAM,WAAW,GAAG,oBAAoB,CAAC,aAAa,CAAC,CAAC;AAE9D,MAAM,MAAM,GAAG,GAAG;IAAE,EAAE,EAAE,EAAE,CAAC;IAAC,EAAE,EAAE,EAAE,CAAA;CAAE,CAAC;AAIrC,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AACzE,MAAM,MAAM,EAAE,GAAG,mBAAmB,CAAC,IAAI,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAC/E,MAAM,MAAM,EAAE,GAAG,mBAAmB,CAAC,IAAI,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAE/E,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CA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