betterddb 0.8.2 → 1.0.0

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.
Files changed (56) hide show
  1. package/API_REFERENCE.md +306 -122
  2. package/README.md +69 -16
  3. package/package.json +30 -6
  4. package/dist/src/betterddb.d.ts +0 -137
  5. package/dist/src/betterddb.d.ts.map +0 -1
  6. package/dist/src/betterddb.js +0 -165
  7. package/dist/src/betterddb.js.map +0 -1
  8. package/dist/src/builders/batch-get-builder.d.ts +0 -16
  9. package/dist/src/builders/batch-get-builder.d.ts.map +0 -1
  10. package/dist/src/builders/batch-get-builder.js +0 -54
  11. package/dist/src/builders/batch-get-builder.js.map +0 -1
  12. package/dist/src/builders/create-builder.d.ts +0 -12
  13. package/dist/src/builders/create-builder.d.ts.map +0 -1
  14. package/dist/src/builders/create-builder.js +0 -84
  15. package/dist/src/builders/create-builder.js.map +0 -1
  16. package/dist/src/builders/delete-builder.d.ts +0 -18
  17. package/dist/src/builders/delete-builder.d.ts.map +0 -1
  18. package/dist/src/builders/delete-builder.js +0 -75
  19. package/dist/src/builders/delete-builder.js.map +0 -1
  20. package/dist/src/builders/get-builder.d.ts +0 -18
  21. package/dist/src/builders/get-builder.d.ts.map +0 -1
  22. package/dist/src/builders/get-builder.js +0 -76
  23. package/dist/src/builders/get-builder.js.map +0 -1
  24. package/dist/src/builders/index.d.ts +0 -8
  25. package/dist/src/builders/index.d.ts.map +0 -1
  26. package/dist/src/builders/index.js +0 -8
  27. package/dist/src/builders/index.js.map +0 -1
  28. package/dist/src/builders/query-builder.d.ts +0 -29
  29. package/dist/src/builders/query-builder.d.ts.map +0 -1
  30. package/dist/src/builders/query-builder.js +0 -171
  31. package/dist/src/builders/query-builder.js.map +0 -1
  32. package/dist/src/builders/scan-builder.d.ts +0 -21
  33. package/dist/src/builders/scan-builder.d.ts.map +0 -1
  34. package/dist/src/builders/scan-builder.js +0 -76
  35. package/dist/src/builders/scan-builder.js.map +0 -1
  36. package/dist/src/builders/update-builder.d.ts +0 -37
  37. package/dist/src/builders/update-builder.d.ts.map +0 -1
  38. package/dist/src/builders/update-builder.js +0 -301
  39. package/dist/src/builders/update-builder.js.map +0 -1
  40. package/dist/src/index.d.ts +0 -5
  41. package/dist/src/index.d.ts.map +0 -1
  42. package/dist/src/index.js +0 -5
  43. package/dist/src/index.js.map +0 -1
  44. package/dist/src/operator.d.ts +0 -3
  45. package/dist/src/operator.d.ts.map +0 -1
  46. package/dist/src/operator.js +0 -28
  47. package/dist/src/operator.js.map +0 -1
  48. package/dist/src/types/index.d.ts +0 -2
  49. package/dist/src/types/index.d.ts.map +0 -1
  50. package/dist/src/types/index.js +0 -2
  51. package/dist/src/types/index.js.map +0 -1
  52. package/dist/src/types/paginated-result.d.ts +0 -6
  53. package/dist/src/types/paginated-result.d.ts.map +0 -1
  54. package/dist/src/types/paginated-result.js +0 -2
  55. package/dist/src/types/paginated-result.js.map +0 -1
  56. package/dist/tsconfig.tsbuildinfo +0 -1
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # BetterDDB
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/betterddb.svg)](https://badge.fury.io/js/betterddb)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![GitHub](https://img.shields.io/badge/GitHub-Repository-blue?logo=github)](https://github.com/ryanrawlingswang/betterddb)
5
5
 
6
6
  **BetterDDB** is a type-safe DynamoDB wrapper library that combines runtime validation with compile-time type checking. It provides a high-level, opinionated interface for DynamoDB operations with built-in schema validation using [Zod](https://github.com/colinhacks/zod).
7
7
 
@@ -12,7 +12,7 @@
12
12
  - 🎯 **Smart Key Management**: Automatic computation of partition keys, sort keys, and GSI keys
13
13
  - 🛠️ **Fluent Query API**: Intuitive builder pattern for all DynamoDB operations
14
14
  - ⚡ **Developer Experience**: Reduced boilerplate and improved code maintainability
15
- - 🔄 **Built-in Conveniences**: Automatic timestamp handling, versioning support
15
+ - 🔄 **Built-in Conveniences**: Automatic timestamp handling, counter support
16
16
 
17
17
  ## Installation
18
18
 
@@ -23,7 +23,7 @@ npm install betterddb
23
23
  ## Quick Start
24
24
 
25
25
  ```typescript
26
- import { BetterDDB } from "betterddb";
26
+ import { BetterDDB, Operator } from "betterddb";
27
27
  import { z } from "zod";
28
28
  import { DynamoDBDocumentClient, DynamoDB } from "@aws-sdk/lib-dynamodb";
29
29
 
@@ -89,17 +89,28 @@ async function example() {
89
89
 
90
90
  // Query with type-safe filters
91
91
  const results = await userDdb
92
+ .query({ id: "user-123" })
93
+ .filter("name", Operator.BEGINS_WITH, "A")
94
+ .limitResults(10)
95
+ .execute();
96
+
97
+ // Query using a Global Secondary Index (GSI)
98
+ const gsiResults = await userDdb
92
99
  .query({ email: "alice@example.com" })
93
100
  .usingIndex("EmailIndex")
94
- .filter("name", "begins_with", "A")
95
101
  .limitResults(10)
96
102
  .execute();
97
103
 
98
104
  // Update with automatic timestamp handling
99
105
  const updated = await userDdb
100
- .update({ id: "user-123" })
106
+ .update({ id: "user-123", email: "alice@example.com" })
101
107
  .set({ name: "Alice B." })
102
108
  .execute();
109
+
110
+ // Delete an item
111
+ await userDdb
112
+ .delete({ id: "user-123", email: "alice@example.com" })
113
+ .execute();
103
114
  }
104
115
  ```
105
116
 
@@ -107,34 +118,55 @@ async function example() {
107
118
 
108
119
  ### Schema Validation
109
120
 
110
- BetterDDB uses Zod for both runtime validation and TypeScript type inference:
121
+ BetterDDB uses Zod for both runtime validation and TypeScript type inference. Your schema should allow computed fields like DynamoDB keys and timestamps:
111
122
 
112
123
  ```typescript
113
- const Schema = z
124
+ import { z } from "zod";
125
+
126
+ const UserSchema = z
114
127
  .object({
115
128
  id: z.string(),
116
129
  name: z.string(),
117
130
  email: z.string().email(),
131
+ // Optional fields for automatic timestamps
132
+ createdAt: z.string().optional(),
133
+ updatedAt: z.string().optional(),
118
134
  })
119
- .passthrough(); // Allow computed fields
135
+ .passthrough(); // Allow computed fields like pk, sk, gsi keys
120
136
 
121
- type Entity = z.infer<typeof Schema>; // TypeScript type inference
137
+ type User = z.infer<typeof UserSchema>; // TypeScript type inference
122
138
  ```
123
139
 
124
140
  ### Key Management
125
141
 
126
- Define how your keys should be computed from your entity:
142
+ Define how your keys should be computed from your entity. Keys can be simple property references or computed using a build function:
127
143
 
128
144
  ```typescript
129
145
  const ddb = new BetterDDB<User>({
130
146
  keys: {
147
+ // Primary key configuration
131
148
  primary: {
132
149
  name: "pk",
133
150
  definition: { build: (raw) => `USER#${raw.id}` },
134
151
  },
152
+ // Sort key (optional)
135
153
  sort: {
136
154
  name: "sk",
137
- definition: { build: (raw) => `TYPE#${raw.type}` },
155
+ definition: { build: (raw) => `EMAIL#${raw.email}` },
156
+ },
157
+ // Global Secondary Indexes (optional)
158
+ gsis: {
159
+ EmailIndex: {
160
+ name: "EmailIndex",
161
+ primary: {
162
+ name: "gsi1pk",
163
+ definition: { build: (raw) => `USER#${raw.email}` },
164
+ },
165
+ sort: {
166
+ name: "gsi1sk",
167
+ definition: { build: (raw) => `USER#${raw.email}` },
168
+ },
169
+ },
138
170
  },
139
171
  },
140
172
  });
@@ -142,16 +174,37 @@ const ddb = new BetterDDB<User>({
142
174
 
143
175
  ### Query Building
144
176
 
145
- Fluent API for building type-safe queries:
177
+ Fluent API for building type-safe queries with support for filters, index usage, and pagination:
146
178
 
147
179
  ```typescript
180
+ import { Operator } from "betterddb";
181
+
182
+ // Query on primary key with filter
148
183
  const results = await ddb
149
184
  .query({ id: "user-123" })
150
- .usingIndex("EmailIndex")
151
- .where("begins_with", { email: "alice" })
152
- .filter("name", "contains", "Smith")
185
+ .filter("name", Operator.BEGINS_WITH, "Alice")
153
186
  .limitResults(10)
154
187
  .execute();
188
+
189
+ // Query using a Global Secondary Index
190
+ const gsiResults = await ddb
191
+ .query({ email: "alice@example.com" })
192
+ .usingIndex("EmailIndex")
193
+ .limitResults(5)
194
+ .execute();
195
+
196
+ // Query with sort key condition
197
+ const sortedResults = await ddb
198
+ .query({ id: "user-123" })
199
+ .where(Operator.BEGINS_WITH, { email: "alice" })
200
+ .execute();
201
+
202
+ // Scan with filters
203
+ const scanResults = await ddb
204
+ .scan()
205
+ .filter("name", Operator.CONTAINS, "Smith")
206
+ .limitResults(20)
207
+ .execute();
155
208
  ```
156
209
 
157
210
  ## API Reference
@@ -164,7 +217,7 @@ This documentation covers:
164
217
  - CRUD operations (Create, Read, Update, Delete)
165
218
  - Query and Scan operations with filtering
166
219
  - Batch and transaction operations
167
- - Advanced features like automatic timestamps and versioning
220
+ - Advanced features like automatic timestamps and counter support
168
221
  - Schema validation and key management
169
222
 
170
223
  ## Contributing
package/package.json CHANGED
@@ -1,10 +1,18 @@
1
1
  {
2
2
  "name": "betterddb",
3
- "version": "0.8.2",
3
+ "version": "1.0.0",
4
4
  "description": "A definition-based DynamoDB wrapper library that provides a schema-driven and fully typesafe DAL.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
7
8
  "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.js"
14
+ }
15
+ },
8
16
  "files": [
9
17
  "dist",
10
18
  "README.md",
@@ -13,15 +21,16 @@
13
21
  ],
14
22
  "scripts": {
15
23
  "build": "tsc",
16
- "docker:up": "docker-compose up -d",
24
+ "docker:up": "docker-compose up -d --wait",
17
25
  "docker:down": "docker-compose down",
18
- "test": "npm run docker:up && jest && npm run docker:down",
19
- "test:watch": "npm run docker:up && jest --watch",
20
- "test:coverage": "npm run docker:up && jest --coverage && npm run docker:down",
26
+ "test:watch": "bun test --watch",
27
+ "test:coverage": "bun test --coverage",
21
28
  "format": "prettier --write 'src/**/*.ts'",
22
29
  "lint": "eslint src/**/*.ts",
23
30
  "clean": "del-cli ./dist",
24
31
  "typecheck": "tsc --noEmit",
32
+ "release": "semantic-release --dry-run",
33
+ "release:ci": "semantic-release --ci",
25
34
  "prepublishOnly": "npm run clean && npm run build"
26
35
  },
27
36
  "keywords": [
@@ -38,6 +47,10 @@
38
47
  ],
39
48
  "author": "R.R. Wang",
40
49
  "license": "MIT",
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "https://github.com/ryanrawlingswang/betterddb.git"
53
+ },
41
54
  "dependencies": {
42
55
  "@aws-sdk/client-dynamodb": "^3.744.0",
43
56
  "@aws-sdk/lib-dynamodb": "^3.744.0",
@@ -48,6 +61,7 @@
48
61
  "@babel/preset-env": "^7.28.0",
49
62
  "@babel/preset-typescript": "^7.27.1",
50
63
  "@eslint/js": "^9.11.1",
64
+ "@types/bun": "^1.3.9",
51
65
  "@types/jest": "^29.5.14",
52
66
  "@types/node": "^22.13.5",
53
67
  "@typescript-eslint/eslint-plugin": "^8.24.1",
@@ -60,6 +74,16 @@
60
74
  "jest": "^29.7.0",
61
75
  "prettier": "^3.3.3",
62
76
  "ts-jest": "^29.2.5",
63
- "typescript": "latest"
77
+ "typescript": "latest",
78
+ "semantic-release": "^25.0.3",
79
+ "@semantic-release/npm": "^13.1.4",
80
+ "@semantic-release/github": "^12.0.6",
81
+ "@semantic-release/changelog": "^6.0.3",
82
+ "@semantic-release/commit-analyzer": "^13.0.1",
83
+ "@semantic-release/release-notes-generator": "^14.0.1",
84
+ "@semantic-release/git": "^10.0.1"
85
+ },
86
+ "peerDependencies": {
87
+ "typescript": ">=4.7.0"
64
88
  }
65
89
  }
@@ -1,137 +0,0 @@
1
- import { type z } from "zod";
2
- import { QueryBuilder } from "./builders/query-builder.js";
3
- import { ScanBuilder } from "./builders/scan-builder.js";
4
- import { UpdateBuilder } from "./builders/update-builder.js";
5
- import { CreateBuilder } from "./builders/create-builder.js";
6
- import { GetBuilder } from "./builders/get-builder.js";
7
- import { DeleteBuilder } from "./builders/delete-builder.js";
8
- import { type NativeAttributeValue, type DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";
9
- import { BatchGetBuilder } from "./builders/batch-get-builder.js";
10
- export type PrimaryKeyValue = string | number;
11
- /**
12
- * A key definition can be either a simple key (a property name)
13
- * or an object containing a build function that computes the value.
14
- * (In this design, the attribute name is provided separately.)
15
- */
16
- export type KeyDefinition<T> = keyof T | {
17
- build: (rawKey: Partial<T>) => string;
18
- };
19
- /**
20
- * Configuration for a primary (partition) key.
21
- */
22
- export interface PrimaryKeyConfig<T> {
23
- /** The attribute name for the primary key in DynamoDB */
24
- name: string;
25
- /** How to compute the key value; if a keyof T, then the raw value is used;
26
- * if an object, the build function is used.
27
- */
28
- definition: KeyDefinition<T>;
29
- }
30
- /**
31
- * Configuration for a sort key.
32
- */
33
- export interface SortKeyConfig<T> {
34
- /** The attribute name for the sort key in DynamoDB */
35
- name: string;
36
- /** How to compute the sort key value */
37
- definition: KeyDefinition<T>;
38
- }
39
- /**
40
- * Configuration for a Global Secondary Index (GSI).
41
- */
42
- export interface GSIConfig<T> {
43
- /** The name of the GSI in DynamoDB */
44
- name: string;
45
- /** The primary key configuration for the GSI */
46
- primary: PrimaryKeyConfig<T>;
47
- /** The sort key configuration for the GSI, if any */
48
- sort?: SortKeyConfig<T>;
49
- }
50
- /**
51
- * Keys configuration for the table.
52
- */
53
- export interface KeysConfig<T> {
54
- primary: PrimaryKeyConfig<T>;
55
- sort?: SortKeyConfig<T>;
56
- gsis?: Record<string, GSIConfig<T>>;
57
- }
58
- /**
59
- * Options for initializing BetterDDB.
60
- */
61
- export interface BetterDDBOptions<T> {
62
- schema: z.AnyZodObject;
63
- tableName: string;
64
- entityType?: string;
65
- keys: KeysConfig<T>;
66
- client: DynamoDBDocumentClient;
67
- counter?: boolean;
68
- /**
69
- * If true, automatically inject timestamp fields:
70
- * - On create, sets both `createdAt` and `updatedAt`
71
- * - On update, sets `updatedAt`
72
- *
73
- * (T should include these fields if enabled.)
74
- */
75
- timestamps?: boolean;
76
- }
77
- /**
78
- * BetterDDB is a definition-based DynamoDB wrapper library.
79
- */
80
- export declare class BetterDDB<T> {
81
- protected schema: z.AnyZodObject;
82
- protected tableName: string;
83
- protected entityType?: string;
84
- protected client: DynamoDBDocumentClient;
85
- protected keys: KeysConfig<T>;
86
- protected timestamps: boolean;
87
- protected counter: boolean;
88
- constructor(options: BetterDDBOptions<T>);
89
- getCounter(): boolean;
90
- getKeys(): KeysConfig<T>;
91
- getTableName(): string;
92
- getClient(): DynamoDBDocumentClient;
93
- getSchema(): z.AnyZodObject;
94
- getTimestamps(): boolean;
95
- getEntityType(): string | undefined;
96
- protected getKeyValue(def: KeyDefinition<T>, rawKey: Partial<T>): string;
97
- /**
98
- * Build the primary key from a raw key object.
99
- */
100
- buildKey(rawKey: Partial<T>): Record<string, NativeAttributeValue>;
101
- /**
102
- * Build index attributes for each defined GSI.
103
- */
104
- buildIndexes(rawItem: Partial<T>): Record<string, NativeAttributeValue>;
105
- /**
106
- * Create an item:
107
- * - Computes primary key and index attributes,
108
- * - Optionally injects timestamps,
109
- * - Validates the item and writes it to DynamoDB.
110
- */
111
- create(item: T): CreateBuilder<T>;
112
- /**
113
- * Get an item by its primary key.
114
- */
115
- get(rawKey: Partial<T>): GetBuilder<T>;
116
- /**
117
- * Get multiple items by their primary keys.
118
- */
119
- batchGet(rawKeys: Partial<T>[]): BatchGetBuilder<T>;
120
- /**
121
- * Update an item.
122
- */
123
- update(key: Partial<T>): UpdateBuilder<T>;
124
- /**
125
- * Delete an item.
126
- */
127
- delete(rawKey: Partial<T>): DeleteBuilder<T>;
128
- /**
129
- * Query items.
130
- */
131
- query(key: Partial<T>): QueryBuilder<T>;
132
- /**
133
- * Scan for items.
134
- */
135
- scan(): ScanBuilder<T>;
136
- }
137
- //# sourceMappingURL=betterddb.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"betterddb.d.ts","sourceRoot":"","sources":["../../src/betterddb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7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GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM;IAYxE;;OAEG;IACI,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAyBzE;;OAEG;IACI,YAAY,CACjB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC;IA+BvC;;;;;OAKG;IACI,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;IAIxC;;OAEG;IACI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;IAI7C;;OAEG;IACI,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC;IAI1D;;OAEG;IACI,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;IAIhD;;OAEG;IACI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;IAInD;;OAEG;IACI,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC;IAI9C;;OAEG;IACI,IAAI,IAAI,WAAW,CAAC,CAAC,CAAC;CAG9B"}
@@ -1,165 +0,0 @@
1
- import {} from "zod";
2
- import { QueryBuilder } from "./builders/query-builder.js";
3
- import { ScanBuilder } from "./builders/scan-builder.js";
4
- import { UpdateBuilder } from "./builders/update-builder.js";
5
- import { CreateBuilder } from "./builders/create-builder.js";
6
- import { GetBuilder } from "./builders/get-builder.js";
7
- import { DeleteBuilder } from "./builders/delete-builder.js";
8
- import {} from "@aws-sdk/lib-dynamodb";
9
- import { BatchGetBuilder } from "./builders/batch-get-builder.js";
10
- /**
11
- * BetterDDB is a definition-based DynamoDB wrapper library.
12
- */
13
- export class BetterDDB {
14
- schema;
15
- tableName;
16
- entityType;
17
- client;
18
- keys;
19
- timestamps;
20
- counter;
21
- constructor(options) {
22
- this.schema = options.schema;
23
- this.tableName = options.tableName;
24
- this.entityType = options.entityType?.toUpperCase();
25
- this.keys = options.keys;
26
- this.client = options.client;
27
- this.timestamps = options.timestamps ?? false;
28
- this.counter = options.counter ?? false;
29
- }
30
- getCounter() {
31
- return this.counter;
32
- }
33
- getKeys() {
34
- return this.keys;
35
- }
36
- getTableName() {
37
- return this.tableName;
38
- }
39
- getClient() {
40
- return this.client;
41
- }
42
- getSchema() {
43
- return this.schema;
44
- }
45
- getTimestamps() {
46
- return this.timestamps;
47
- }
48
- getEntityType() {
49
- return this.entityType;
50
- }
51
- // Helper: Retrieve the key value from a KeyDefinition.
52
- getKeyValue(def, rawKey) {
53
- if (typeof def === "string" ||
54
- typeof def === "number" ||
55
- typeof def === "symbol") {
56
- return String(rawKey[def]);
57
- }
58
- else {
59
- return def.build(rawKey);
60
- }
61
- }
62
- /**
63
- * Build the primary key from a raw key object.
64
- */
65
- buildKey(rawKey) {
66
- const keyObj = {};
67
- // For primary (partition) key:
68
- const pkConfig = this.keys.primary;
69
- keyObj[pkConfig.name] =
70
- typeof pkConfig.definition === "string" ||
71
- typeof pkConfig.definition === "number" ||
72
- typeof pkConfig.definition === "symbol"
73
- ? String(rawKey[pkConfig.definition])
74
- : pkConfig.definition.build(rawKey);
75
- // For sort key, if defined:
76
- if (this.keys.sort) {
77
- const skConfig = this.keys.sort;
78
- keyObj[skConfig.name] =
79
- typeof skConfig.definition === "string" ||
80
- typeof skConfig.definition === "number" ||
81
- typeof skConfig.definition === "symbol"
82
- ? String(rawKey[skConfig.definition])
83
- : skConfig.definition.build(rawKey);
84
- }
85
- return keyObj;
86
- }
87
- /**
88
- * Build index attributes for each defined GSI.
89
- */
90
- buildIndexes(rawItem) {
91
- const indexAttributes = {};
92
- if (this.keys.gsis) {
93
- for (const gsiName in this.keys.gsis) {
94
- const gsiConfig = this.keys.gsis[gsiName];
95
- if (!gsiConfig)
96
- continue;
97
- // Compute primary index attribute.
98
- const primaryConfig = gsiConfig.primary;
99
- indexAttributes[primaryConfig.name] =
100
- typeof primaryConfig.definition === "string" ||
101
- typeof primaryConfig.definition === "number" ||
102
- typeof primaryConfig.definition === "symbol"
103
- ? String(rawItem[primaryConfig.definition])
104
- : primaryConfig.definition.build(rawItem);
105
- // Compute sort index attribute if provided.
106
- if (gsiConfig?.sort) {
107
- const sortConfig = gsiConfig.sort;
108
- indexAttributes[sortConfig.name] =
109
- typeof sortConfig.definition === "string" ||
110
- typeof sortConfig.definition === "number" ||
111
- typeof sortConfig.definition === "symbol"
112
- ? String(rawItem[sortConfig.definition])
113
- : sortConfig.definition.build(rawItem);
114
- }
115
- }
116
- }
117
- return indexAttributes;
118
- }
119
- /**
120
- * Create an item:
121
- * - Computes primary key and index attributes,
122
- * - Optionally injects timestamps,
123
- * - Validates the item and writes it to DynamoDB.
124
- */
125
- create(item) {
126
- return new CreateBuilder(this, item);
127
- }
128
- /**
129
- * Get an item by its primary key.
130
- */
131
- get(rawKey) {
132
- return new GetBuilder(this, rawKey);
133
- }
134
- /**
135
- * Get multiple items by their primary keys.
136
- */
137
- batchGet(rawKeys) {
138
- return new BatchGetBuilder(this, rawKeys);
139
- }
140
- /**
141
- * Update an item.
142
- */
143
- update(key) {
144
- return new UpdateBuilder(this, key);
145
- }
146
- /**
147
- * Delete an item.
148
- */
149
- delete(rawKey) {
150
- return new DeleteBuilder(this, rawKey);
151
- }
152
- /**
153
- * Query items.
154
- */
155
- query(key) {
156
- return new QueryBuilder(this, key);
157
- }
158
- /**
159
- * Scan for items.
160
- */
161
- scan() {
162
- return new ScanBuilder(this);
163
- }
164
- }
165
- //# sourceMappingURL=betterddb.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"betterddb.js","sourceRo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CAAC;wBAC9B,OAAO,UAAU,CAAC,UAAU,KAAK,QAAQ;4BACzC,OAAO,UAAU,CAAC,UAAU,KAAK,QAAQ;4BACzC,OAAO,UAAU,CAAC,UAAU,KAAK,QAAQ;4BACvC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;4BACxC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC7C,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,eAAe,CAAC;IACzB,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,IAAO;QACnB,OAAO,IAAI,aAAa,CAAI,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,GAAG,CAAC,MAAkB;QAC3B,OAAO,IAAI,UAAU,CAAI,IAAI,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,OAAqB;QACnC,OAAO,IAAI,eAAe,CAAI,IAAI,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,GAAe;QAC3B,OAAO,IAAI,aAAa,CAAI,IAAI,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,MAAkB;QAC9B,OAAO,IAAI,aAAa,CAAI,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,GAAe;QAC1B,OAAO,IAAI,YAAY,CAAI,IAAI,EAAE,GAAG,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACI,IAAI;QACT,OAAO,IAAI,WAAW,CAAI,IAAI,CAAC,CAAC;IAClC,CAAC;CACF"}
@@ -1,16 +0,0 @@
1
- import { type BetterDDB } from "../betterddb.js";
2
- export declare class BatchGetBuilder<T> {
3
- private parent;
4
- private keys;
5
- /**
6
- * @param parent - The BetterDDB instance for the table.
7
- * @param keys - An array of partial keys for the items you wish to retrieve.
8
- */
9
- constructor(parent: BetterDDB<T>, keys: Partial<T>[]);
10
- /**
11
- * Executes the batch get operation.
12
- * Returns an array of parsed items of type T.
13
- */
14
- execute(): Promise<T[]>;
15
- }
16
- //# sourceMappingURL=batch-get-builder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"batch-get-builder.d.ts","sourceRoot":"","sources":["../../../src/builders/batch-get-builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD,qBAAa,eAAe,CAAC,CAAC;IAM1B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,IAAI;IANd;;;OAGG;gBAEO,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EACpB,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE;IAG5B;;;OAGG;IACU,OAAO,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC;CAqCrC"}
@@ -1,54 +0,0 @@
1
- /* eslint-disable no-unused-vars */
2
- import {} from "../betterddb.js";
3
- import { BatchGetCommand } from "@aws-sdk/lib-dynamodb";
4
- import {} from "@aws-sdk/client-dynamodb";
5
- export class BatchGetBuilder {
6
- parent;
7
- keys;
8
- /**
9
- * @param parent - The BetterDDB instance for the table.
10
- * @param keys - An array of partial keys for the items you wish to retrieve.
11
- */
12
- constructor(parent, keys) {
13
- this.parent = parent;
14
- this.keys = keys;
15
- }
16
- /**
17
- * Executes the batch get operation.
18
- * Returns an array of parsed items of type T.
19
- */
20
- async execute() {
21
- if (this.keys.length === 0) {
22
- return [];
23
- }
24
- const seen = new Set();
25
- const deduplicatedKeys = this.keys.filter((key) => {
26
- const keyString = JSON.stringify(key);
27
- if (seen.has(keyString)) {
28
- return false;
29
- }
30
- seen.add(keyString);
31
- return true;
32
- });
33
- const tableName = this.parent.getTableName();
34
- // Build an array of keys using the parent's key builder.
35
- const keysArray = deduplicatedKeys.map((key) => this.parent.buildKey(key));
36
- // Construct the BatchGet parameters.
37
- const params = {
38
- RequestItems: {
39
- [tableName]: {
40
- Keys: keysArray,
41
- },
42
- },
43
- };
44
- const result = await this.parent
45
- .getClient()
46
- .send(new BatchGetCommand(params));
47
- const responses = result.Responses ? result.Responses[tableName] : [];
48
- if (!responses) {
49
- return [];
50
- }
51
- return this.parent.getSchema().array().parse(responses);
52
- }
53
- }
54
- //# sourceMappingURL=batch-get-builder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"batch-get-builder.js","sourceRoot":"","sources":["../../../src/builders/batch-get-builder.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,EAAkB,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAA0B,MAAM,0BAA0B,CAAC;AAElE,MAAM,OAAO,eAAe;IAMhB;IACA;IANV;;;OAGG;IACH,YACU,MAAoB,EACpB,IAAkB;QADlB,WAAM,GAAN,MAAM,CAAc;QACpB,SAAI,GAAJ,IAAI,CAAc;IACzB,CAAC;IAEJ;;;OAGG;IACI,KAAK,CAAC,OAAO;QAClB,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;QACvB,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;YAChD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YACtC,IAAI,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;gBACxB,OAAO,KAAK,CAAC;YACf,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACpB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;QACH,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QAC7C,yDAAyD;QACzD,MAAM,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QAE3E,qCAAqC;QACrC,MAAM,MAAM,GAAsB;YAChC,YAAY,EAAE;gBACZ,CAAC,SAAS,CAAC,EAAE;oBACX,IAAI,EAAE,SAAS;iBAChB;aACF;SACF,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM;aAC7B,SAAS,EAAE;aACX,IAAI,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtE,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,SAAS,CAAQ,CAAC;IACjE,CAAC;CACF"}
@@ -1,12 +0,0 @@
1
- import { type TransactWriteItem } from "@aws-sdk/client-dynamodb";
2
- import { type BetterDDB } from "../betterddb.js";
3
- export declare class CreateBuilder<T> {
4
- private parent;
5
- private item;
6
- private extraTransactItems;
7
- constructor(parent: BetterDDB<T>, item: T);
8
- execute(): Promise<T>;
9
- transactWrite(ops: TransactWriteItem[] | TransactWriteItem): this;
10
- toTransactPut(): TransactWriteItem;
11
- }
12
- //# sourceMappingURL=create-builder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-builder.d.ts","sourceRoot":"","sources":["../../../src/builders/create-builder.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD,qBAAa,aAAa,CAAC,CAAC;IAIxB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,IAAI;IAJd,OAAO,CAAC,kBAAkB,CAA2B;gBAG3C,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EACpB,IAAI,EAAE,CAAC;IAGJ,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC;IA+C3B,aAAa,CAAC,GAAG,EAAE,iBAAiB,EAAE,GAAG,iBAAiB,GAAG,IAAI;IASjE,aAAa,IAAI,iBAAiB;CAwB1C"}