dyno-table 2.3.2 → 2.4.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.
@@ -1,7 +1,220 @@
1
- import { c as PrimaryKeyWithoutExpression, s as Path, a as Condition, b as ConditionOperator, t as PathType } from './conditions-CcZL0sR2.cjs';
1
+ import { P as PrimaryKeyWithoutExpression, s as Path, b as Condition, c as ConditionOperator, t as PathType } from './conditions-C8bM__Pn.cjs';
2
2
  import { DynamoItem, TableConfig, GSINames } from './types.cjs';
3
3
  import { TransactWriteCommandInput } from '@aws-sdk/lib-dynamodb';
4
4
 
5
+ /**
6
+ * Base error class for all dyno-table errors
7
+ *
8
+ * All custom errors in the library extend this class, allowing consumers
9
+ * to catch all library errors with a single catch block if needed.
10
+ */
11
+ declare class DynoTableError extends Error {
12
+ /**
13
+ * Machine-readable error code for programmatic error handling
14
+ * @example "KEY_GENERATION_FAILED", "VALIDATION_ERROR", etc.
15
+ */
16
+ readonly code: string;
17
+ /**
18
+ * Additional context about the error
19
+ * Contains operation-specific details like entity names, table names,
20
+ * expressions, conditions, and other relevant debugging information
21
+ */
22
+ readonly context: Record<string, unknown>;
23
+ /**
24
+ * The original error that caused this error (if wrapping another error)
25
+ * Useful for preserving AWS SDK errors or other underlying errors
26
+ */
27
+ readonly cause?: Error;
28
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
29
+ }
30
+ /**
31
+ * Error for schema validation and input validation failures
32
+ *
33
+ * Thrown when user-provided data doesn't match the expected schema
34
+ * or when required fields are missing.
35
+ */
36
+ declare class ValidationError extends DynoTableError {
37
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
38
+ }
39
+ /**
40
+ * Error for DynamoDB operation failures
41
+ *
42
+ * Wraps AWS SDK errors and adds library-specific context like
43
+ * the operation type, table name, and generated expressions.
44
+ */
45
+ declare class OperationError extends DynoTableError {
46
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
47
+ }
48
+ /**
49
+ * Error for transaction-specific failures
50
+ *
51
+ * Thrown when transaction operations fail, including duplicate item
52
+ * detection, transaction cancellation, and other transaction-related issues.
53
+ */
54
+ declare class TransactionError extends DynoTableError {
55
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
56
+ }
57
+ /**
58
+ * Error for batch operation failures
59
+ *
60
+ * Thrown when batch operations fail or when batch limits are exceeded.
61
+ * Includes information about unprocessed items and operation details.
62
+ */
63
+ declare class BatchError extends DynoTableError {
64
+ /**
65
+ * The type of batch operation that failed
66
+ */
67
+ readonly operation: "write" | "read";
68
+ /**
69
+ * The items that were not processed during the batch operation
70
+ */
71
+ readonly unprocessedItems: unknown[];
72
+ constructor(message: string, code: string, operation: "write" | "read", unprocessedItems?: unknown[], context?: Record<string, unknown>, cause?: Error);
73
+ }
74
+ /**
75
+ * Error for expression building failures
76
+ *
77
+ * Thrown when building DynamoDB expressions (condition, filter, update, etc.)
78
+ * fails due to invalid conditions or missing required fields.
79
+ */
80
+ declare class ExpressionError extends DynoTableError {
81
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
82
+ }
83
+ /**
84
+ * Error for table/index configuration issues
85
+ *
86
+ * Thrown when there are problems with table configuration,
87
+ * such as missing GSIs or invalid index references.
88
+ */
89
+ declare class ConfigurationError extends DynoTableError {
90
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
91
+ }
92
+ /**
93
+ * Base error for all entity-related errors
94
+ *
95
+ * Parent class for entity-specific errors like key generation
96
+ * and index generation failures.
97
+ */
98
+ declare class EntityError extends DynoTableError {
99
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
100
+ }
101
+ /**
102
+ * Error for primary key generation failures
103
+ *
104
+ * Thrown when generating entity primary keys fails due to missing
105
+ * attributes or invalid key formats.
106
+ *
107
+ * @example
108
+ * ```typescript
109
+ * try {
110
+ * await userRepo.create({ name: "John" }).execute();
111
+ * } catch (error) {
112
+ * if (error instanceof KeyGenerationError) {
113
+ * console.error("Failed to generate key");
114
+ * console.error("Entity:", error.context.entityName);
115
+ * console.error("Required attributes:", error.context.requiredAttributes);
116
+ * }
117
+ * }
118
+ * ```
119
+ */
120
+ declare class KeyGenerationError extends EntityError {
121
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
122
+ }
123
+ /**
124
+ * Error for index key generation failures
125
+ *
126
+ * Thrown when generating secondary index keys fails due to missing
127
+ * attributes or when trying to update readonly indexes without forcing.
128
+ *
129
+ * @example
130
+ * ```typescript
131
+ * try {
132
+ * await orderRepo.update({ id: "123" }, { status: "shipped" }).execute();
133
+ * } catch (error) {
134
+ * if (error instanceof IndexGenerationError) {
135
+ * console.error("Index failed:", error.context.indexName);
136
+ * console.error("Suggestion:", error.context.suggestion);
137
+ * }
138
+ * }
139
+ * ```
140
+ */
141
+ declare class IndexGenerationError extends EntityError {
142
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
143
+ }
144
+ /**
145
+ * Error for entity schema validation failures
146
+ *
147
+ * Thrown when entity data doesn't pass schema validation.
148
+ * Includes validation issues and the entity context.
149
+ */
150
+ declare class EntityValidationError extends ValidationError {
151
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
152
+ }
153
+ /**
154
+ * Error codes used throughout the library
155
+ *
156
+ * These codes allow for programmatic error handling and can be used
157
+ * to implement retry logic, user-friendly error messages, etc.
158
+ */
159
+ declare const ErrorCodes: {
160
+ readonly KEY_GENERATION_FAILED: "KEY_GENERATION_FAILED";
161
+ readonly KEY_MISSING_ATTRIBUTES: "KEY_MISSING_ATTRIBUTES";
162
+ readonly KEY_INVALID_FORMAT: "KEY_INVALID_FORMAT";
163
+ readonly INDEX_GENERATION_FAILED: "INDEX_GENERATION_FAILED";
164
+ readonly INDEX_MISSING_ATTRIBUTES: "INDEX_MISSING_ATTRIBUTES";
165
+ readonly INDEX_NOT_FOUND: "INDEX_NOT_FOUND";
166
+ readonly INDEX_READONLY_UPDATE_FAILED: "INDEX_READONLY_UPDATE_FAILED";
167
+ readonly INDEX_UNDEFINED_VALUES: "INDEX_UNDEFINED_VALUES";
168
+ readonly ENTITY_VALIDATION_FAILED: "ENTITY_VALIDATION_FAILED";
169
+ readonly ASYNC_VALIDATION_NOT_SUPPORTED: "ASYNC_VALIDATION_NOT_SUPPORTED";
170
+ readonly QUERY_INPUT_VALIDATION_FAILED: "QUERY_INPUT_VALIDATION_FAILED";
171
+ readonly VALIDATION_ERROR: "VALIDATION_ERROR";
172
+ readonly VALIDATION_FAILED: "VALIDATION_FAILED";
173
+ readonly SCHEMA_VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED";
174
+ readonly INVALID_PARAMETER: "INVALID_PARAMETER";
175
+ readonly MISSING_REQUIRED_FIELD: "MISSING_REQUIRED_FIELD";
176
+ readonly UNDEFINED_VALUE: "UNDEFINED_VALUE";
177
+ readonly EXPRESSION_MISSING_ATTRIBUTE: "EXPRESSION_MISSING_ATTRIBUTE";
178
+ readonly EXPRESSION_MISSING_VALUE: "EXPRESSION_MISSING_VALUE";
179
+ readonly EXPRESSION_INVALID_CONDITION: "EXPRESSION_INVALID_CONDITION";
180
+ readonly EXPRESSION_EMPTY_ARRAY: "EXPRESSION_EMPTY_ARRAY";
181
+ readonly EXPRESSION_UNKNOWN_TYPE: "EXPRESSION_UNKNOWN_TYPE";
182
+ readonly EXPRESSION_INVALID: "EXPRESSION_INVALID";
183
+ readonly EXPRESSION_INVALID_OPERATOR: "EXPRESSION_INVALID_OPERATOR";
184
+ readonly QUERY_FAILED: "QUERY_FAILED";
185
+ readonly SCAN_FAILED: "SCAN_FAILED";
186
+ readonly GET_FAILED: "GET_FAILED";
187
+ readonly PUT_FAILED: "PUT_FAILED";
188
+ readonly DELETE_FAILED: "DELETE_FAILED";
189
+ readonly UPDATE_FAILED: "UPDATE_FAILED";
190
+ readonly BATCH_GET_FAILED: "BATCH_GET_FAILED";
191
+ readonly BATCH_WRITE_FAILED: "BATCH_WRITE_FAILED";
192
+ readonly NO_UPDATE_ACTIONS: "NO_UPDATE_ACTIONS";
193
+ readonly CONDITIONAL_CHECK_FAILED: "CONDITIONAL_CHECK_FAILED";
194
+ readonly TRANSACTION_FAILED: "TRANSACTION_FAILED";
195
+ readonly TRANSACTION_DUPLICATE_ITEM: "TRANSACTION_DUPLICATE_ITEM";
196
+ readonly TRANSACTION_EMPTY: "TRANSACTION_EMPTY";
197
+ readonly TRANSACTION_UNSUPPORTED_TYPE: "TRANSACTION_UNSUPPORTED_TYPE";
198
+ readonly TRANSACTION_ITEM_LIMIT: "TRANSACTION_ITEM_LIMIT";
199
+ readonly TRANSACTION_CANCELLED: "TRANSACTION_CANCELLED";
200
+ readonly BATCH_EMPTY: "BATCH_EMPTY";
201
+ readonly BATCH_UNSUPPORTED_TYPE: "BATCH_UNSUPPORTED_TYPE";
202
+ readonly BATCH_UNPROCESSED_ITEMS: "BATCH_UNPROCESSED_ITEMS";
203
+ readonly BATCH_SIZE_EXCEEDED: "BATCH_SIZE_EXCEEDED";
204
+ readonly GSI_NOT_FOUND: "GSI_NOT_FOUND";
205
+ readonly SORT_KEY_REQUIRED: "SORT_KEY_REQUIRED";
206
+ readonly SORT_KEY_NOT_DEFINED: "SORT_KEY_NOT_DEFINED";
207
+ readonly PRIMARY_KEY_MISSING: "PRIMARY_KEY_MISSING";
208
+ readonly INVALID_CHUNK_SIZE: "INVALID_CHUNK_SIZE";
209
+ readonly CONDITION_REQUIRED: "CONDITION_REQUIRED";
210
+ readonly CONDITION_GENERATION_FAILED: "CONDITION_GENERATION_FAILED";
211
+ readonly PK_EXTRACTION_FAILED: "PK_EXTRACTION_FAILED";
212
+ readonly CONFIGURATION_INVALID: "CONFIGURATION_INVALID";
213
+ readonly CONFIGURATION_MISSING_SORT_KEY: "CONFIGURATION_MISSING_SORT_KEY";
214
+ readonly CONFIGURATION_INVALID_GSI: "CONFIGURATION_INVALID_GSI";
215
+ };
216
+ type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
217
+
5
218
  type BatchWriteOperation<T extends Record<string, unknown>> = {
6
219
  type: "put";
7
220
  item: T;
@@ -386,14 +599,6 @@ type BatchGetExecutor = (keys: Array<PrimaryKeyWithoutExpression>) => Promise<{
386
599
  items: DynamoItem[];
387
600
  unprocessedKeys: PrimaryKeyWithoutExpression[];
388
601
  }>;
389
- /**
390
- * Error class for batch operation failures
391
- */
392
- declare class BatchError extends Error {
393
- readonly operation: "write" | "read";
394
- readonly cause?: Error;
395
- constructor(message: string, operation: "write" | "read", cause?: Error);
396
- }
397
602
  /**
398
603
  * Result structure for batch operations
399
604
  */
@@ -848,7 +1053,7 @@ declare class TransactionBuilder {
848
1053
  * @returns The transaction builder for method chaining
849
1054
  * @throws {Error} If a duplicate item is detected in the transaction
850
1055
  */
851
- update<T extends DynamoItem>(tableName: string, key: PrimaryKeyWithoutExpression, updateExpression: string, expressionAttributeNames?: Record<string, string>, expressionAttributeValues?: Record<string, unknown>, condition?: Condition): this;
1056
+ update<_T extends DynamoItem>(tableName: string, key: PrimaryKeyWithoutExpression, updateExpression: string, expressionAttributeNames?: Record<string, string>, expressionAttributeValues?: Record<string, unknown>, condition?: Condition): this;
852
1057
  /**
853
1058
  * Adds a pre-configured update operation to the transaction.
854
1059
  *
@@ -2794,4 +2999,4 @@ declare class ScanBuilder<T extends DynamoItem, TConfig extends TableConfig = Ta
2794
2999
  execute(): Promise<ResultIterator<T, TConfig>>;
2795
3000
  }
2796
3001
 
2797
- export { BatchBuilder as B, ConditionCheckBuilder as C, DeleteBuilder as D, FilterBuilder as F, GetBuilder as G, PutBuilder as P, QueryBuilder as Q, ResultIterator as R, ScanBuilder as S, TransactionBuilder as T, UpdateBuilder as U, BatchError as a, type BatchResult as b, type DeleteOptions as c, type PutOptions as d, type QueryOptions as e, type TransactionOptions as f, type UpdateOptions as g, type BatchWriteOperation as h, type UpdateCommandParams as i, Paginator as j, type DeleteCommandParams as k, type PutCommandParams as l, type ConditionCheckCommandParams as m, type BaseBuilderInterface as n, type QueryBuilderInterface as o, type ScanBuilderInterface as p, type FilterBuilderInterface as q, type PaginationResult as r, type TransactionItem as s };
3002
+ export { BatchBuilder as B, ConditionCheckBuilder as C, DeleteBuilder as D, ExpressionError as E, FilterBuilder as F, GetBuilder as G, IndexGenerationError as I, KeyGenerationError as K, OperationError as O, PutBuilder as P, QueryBuilder as Q, ResultIterator as R, ScanBuilder as S, TransactionBuilder as T, UpdateBuilder as U, ValidationError as V, type TransactionOptions as a, type BatchWriteOperation as b, BatchError as c, ConfigurationError as d, EntityValidationError as e, TransactionError as f, DynoTableError as g, EntityError as h, type BatchResult as i, type DeleteOptions as j, type PutOptions as k, type QueryOptions as l, type UpdateOptions as m, ErrorCodes as n, type ErrorCode as o, type UpdateCommandParams as p, Paginator as q, type DeleteCommandParams as r, type PutCommandParams as s, type ConditionCheckCommandParams as t, type BaseBuilderInterface as u, type QueryBuilderInterface as v, type ScanBuilderInterface as w, type FilterBuilderInterface as x, type PaginationResult as y, type TransactionItem as z };
@@ -1,7 +1,220 @@
1
- import { c as PrimaryKeyWithoutExpression, s as Path, a as Condition, b as ConditionOperator, t as PathType } from './conditions-D_w7vVYG.js';
1
+ import { P as PrimaryKeyWithoutExpression, s as Path, b as Condition, c as ConditionOperator, t as PathType } from './conditions-BSAcZswY.js';
2
2
  import { DynamoItem, TableConfig, GSINames } from './types.js';
3
3
  import { TransactWriteCommandInput } from '@aws-sdk/lib-dynamodb';
4
4
 
5
+ /**
6
+ * Base error class for all dyno-table errors
7
+ *
8
+ * All custom errors in the library extend this class, allowing consumers
9
+ * to catch all library errors with a single catch block if needed.
10
+ */
11
+ declare class DynoTableError extends Error {
12
+ /**
13
+ * Machine-readable error code for programmatic error handling
14
+ * @example "KEY_GENERATION_FAILED", "VALIDATION_ERROR", etc.
15
+ */
16
+ readonly code: string;
17
+ /**
18
+ * Additional context about the error
19
+ * Contains operation-specific details like entity names, table names,
20
+ * expressions, conditions, and other relevant debugging information
21
+ */
22
+ readonly context: Record<string, unknown>;
23
+ /**
24
+ * The original error that caused this error (if wrapping another error)
25
+ * Useful for preserving AWS SDK errors or other underlying errors
26
+ */
27
+ readonly cause?: Error;
28
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
29
+ }
30
+ /**
31
+ * Error for schema validation and input validation failures
32
+ *
33
+ * Thrown when user-provided data doesn't match the expected schema
34
+ * or when required fields are missing.
35
+ */
36
+ declare class ValidationError extends DynoTableError {
37
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
38
+ }
39
+ /**
40
+ * Error for DynamoDB operation failures
41
+ *
42
+ * Wraps AWS SDK errors and adds library-specific context like
43
+ * the operation type, table name, and generated expressions.
44
+ */
45
+ declare class OperationError extends DynoTableError {
46
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
47
+ }
48
+ /**
49
+ * Error for transaction-specific failures
50
+ *
51
+ * Thrown when transaction operations fail, including duplicate item
52
+ * detection, transaction cancellation, and other transaction-related issues.
53
+ */
54
+ declare class TransactionError extends DynoTableError {
55
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
56
+ }
57
+ /**
58
+ * Error for batch operation failures
59
+ *
60
+ * Thrown when batch operations fail or when batch limits are exceeded.
61
+ * Includes information about unprocessed items and operation details.
62
+ */
63
+ declare class BatchError extends DynoTableError {
64
+ /**
65
+ * The type of batch operation that failed
66
+ */
67
+ readonly operation: "write" | "read";
68
+ /**
69
+ * The items that were not processed during the batch operation
70
+ */
71
+ readonly unprocessedItems: unknown[];
72
+ constructor(message: string, code: string, operation: "write" | "read", unprocessedItems?: unknown[], context?: Record<string, unknown>, cause?: Error);
73
+ }
74
+ /**
75
+ * Error for expression building failures
76
+ *
77
+ * Thrown when building DynamoDB expressions (condition, filter, update, etc.)
78
+ * fails due to invalid conditions or missing required fields.
79
+ */
80
+ declare class ExpressionError extends DynoTableError {
81
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
82
+ }
83
+ /**
84
+ * Error for table/index configuration issues
85
+ *
86
+ * Thrown when there are problems with table configuration,
87
+ * such as missing GSIs or invalid index references.
88
+ */
89
+ declare class ConfigurationError extends DynoTableError {
90
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
91
+ }
92
+ /**
93
+ * Base error for all entity-related errors
94
+ *
95
+ * Parent class for entity-specific errors like key generation
96
+ * and index generation failures.
97
+ */
98
+ declare class EntityError extends DynoTableError {
99
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
100
+ }
101
+ /**
102
+ * Error for primary key generation failures
103
+ *
104
+ * Thrown when generating entity primary keys fails due to missing
105
+ * attributes or invalid key formats.
106
+ *
107
+ * @example
108
+ * ```typescript
109
+ * try {
110
+ * await userRepo.create({ name: "John" }).execute();
111
+ * } catch (error) {
112
+ * if (error instanceof KeyGenerationError) {
113
+ * console.error("Failed to generate key");
114
+ * console.error("Entity:", error.context.entityName);
115
+ * console.error("Required attributes:", error.context.requiredAttributes);
116
+ * }
117
+ * }
118
+ * ```
119
+ */
120
+ declare class KeyGenerationError extends EntityError {
121
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
122
+ }
123
+ /**
124
+ * Error for index key generation failures
125
+ *
126
+ * Thrown when generating secondary index keys fails due to missing
127
+ * attributes or when trying to update readonly indexes without forcing.
128
+ *
129
+ * @example
130
+ * ```typescript
131
+ * try {
132
+ * await orderRepo.update({ id: "123" }, { status: "shipped" }).execute();
133
+ * } catch (error) {
134
+ * if (error instanceof IndexGenerationError) {
135
+ * console.error("Index failed:", error.context.indexName);
136
+ * console.error("Suggestion:", error.context.suggestion);
137
+ * }
138
+ * }
139
+ * ```
140
+ */
141
+ declare class IndexGenerationError extends EntityError {
142
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
143
+ }
144
+ /**
145
+ * Error for entity schema validation failures
146
+ *
147
+ * Thrown when entity data doesn't pass schema validation.
148
+ * Includes validation issues and the entity context.
149
+ */
150
+ declare class EntityValidationError extends ValidationError {
151
+ constructor(message: string, code: string, context?: Record<string, unknown>, cause?: Error);
152
+ }
153
+ /**
154
+ * Error codes used throughout the library
155
+ *
156
+ * These codes allow for programmatic error handling and can be used
157
+ * to implement retry logic, user-friendly error messages, etc.
158
+ */
159
+ declare const ErrorCodes: {
160
+ readonly KEY_GENERATION_FAILED: "KEY_GENERATION_FAILED";
161
+ readonly KEY_MISSING_ATTRIBUTES: "KEY_MISSING_ATTRIBUTES";
162
+ readonly KEY_INVALID_FORMAT: "KEY_INVALID_FORMAT";
163
+ readonly INDEX_GENERATION_FAILED: "INDEX_GENERATION_FAILED";
164
+ readonly INDEX_MISSING_ATTRIBUTES: "INDEX_MISSING_ATTRIBUTES";
165
+ readonly INDEX_NOT_FOUND: "INDEX_NOT_FOUND";
166
+ readonly INDEX_READONLY_UPDATE_FAILED: "INDEX_READONLY_UPDATE_FAILED";
167
+ readonly INDEX_UNDEFINED_VALUES: "INDEX_UNDEFINED_VALUES";
168
+ readonly ENTITY_VALIDATION_FAILED: "ENTITY_VALIDATION_FAILED";
169
+ readonly ASYNC_VALIDATION_NOT_SUPPORTED: "ASYNC_VALIDATION_NOT_SUPPORTED";
170
+ readonly QUERY_INPUT_VALIDATION_FAILED: "QUERY_INPUT_VALIDATION_FAILED";
171
+ readonly VALIDATION_ERROR: "VALIDATION_ERROR";
172
+ readonly VALIDATION_FAILED: "VALIDATION_FAILED";
173
+ readonly SCHEMA_VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED";
174
+ readonly INVALID_PARAMETER: "INVALID_PARAMETER";
175
+ readonly MISSING_REQUIRED_FIELD: "MISSING_REQUIRED_FIELD";
176
+ readonly UNDEFINED_VALUE: "UNDEFINED_VALUE";
177
+ readonly EXPRESSION_MISSING_ATTRIBUTE: "EXPRESSION_MISSING_ATTRIBUTE";
178
+ readonly EXPRESSION_MISSING_VALUE: "EXPRESSION_MISSING_VALUE";
179
+ readonly EXPRESSION_INVALID_CONDITION: "EXPRESSION_INVALID_CONDITION";
180
+ readonly EXPRESSION_EMPTY_ARRAY: "EXPRESSION_EMPTY_ARRAY";
181
+ readonly EXPRESSION_UNKNOWN_TYPE: "EXPRESSION_UNKNOWN_TYPE";
182
+ readonly EXPRESSION_INVALID: "EXPRESSION_INVALID";
183
+ readonly EXPRESSION_INVALID_OPERATOR: "EXPRESSION_INVALID_OPERATOR";
184
+ readonly QUERY_FAILED: "QUERY_FAILED";
185
+ readonly SCAN_FAILED: "SCAN_FAILED";
186
+ readonly GET_FAILED: "GET_FAILED";
187
+ readonly PUT_FAILED: "PUT_FAILED";
188
+ readonly DELETE_FAILED: "DELETE_FAILED";
189
+ readonly UPDATE_FAILED: "UPDATE_FAILED";
190
+ readonly BATCH_GET_FAILED: "BATCH_GET_FAILED";
191
+ readonly BATCH_WRITE_FAILED: "BATCH_WRITE_FAILED";
192
+ readonly NO_UPDATE_ACTIONS: "NO_UPDATE_ACTIONS";
193
+ readonly CONDITIONAL_CHECK_FAILED: "CONDITIONAL_CHECK_FAILED";
194
+ readonly TRANSACTION_FAILED: "TRANSACTION_FAILED";
195
+ readonly TRANSACTION_DUPLICATE_ITEM: "TRANSACTION_DUPLICATE_ITEM";
196
+ readonly TRANSACTION_EMPTY: "TRANSACTION_EMPTY";
197
+ readonly TRANSACTION_UNSUPPORTED_TYPE: "TRANSACTION_UNSUPPORTED_TYPE";
198
+ readonly TRANSACTION_ITEM_LIMIT: "TRANSACTION_ITEM_LIMIT";
199
+ readonly TRANSACTION_CANCELLED: "TRANSACTION_CANCELLED";
200
+ readonly BATCH_EMPTY: "BATCH_EMPTY";
201
+ readonly BATCH_UNSUPPORTED_TYPE: "BATCH_UNSUPPORTED_TYPE";
202
+ readonly BATCH_UNPROCESSED_ITEMS: "BATCH_UNPROCESSED_ITEMS";
203
+ readonly BATCH_SIZE_EXCEEDED: "BATCH_SIZE_EXCEEDED";
204
+ readonly GSI_NOT_FOUND: "GSI_NOT_FOUND";
205
+ readonly SORT_KEY_REQUIRED: "SORT_KEY_REQUIRED";
206
+ readonly SORT_KEY_NOT_DEFINED: "SORT_KEY_NOT_DEFINED";
207
+ readonly PRIMARY_KEY_MISSING: "PRIMARY_KEY_MISSING";
208
+ readonly INVALID_CHUNK_SIZE: "INVALID_CHUNK_SIZE";
209
+ readonly CONDITION_REQUIRED: "CONDITION_REQUIRED";
210
+ readonly CONDITION_GENERATION_FAILED: "CONDITION_GENERATION_FAILED";
211
+ readonly PK_EXTRACTION_FAILED: "PK_EXTRACTION_FAILED";
212
+ readonly CONFIGURATION_INVALID: "CONFIGURATION_INVALID";
213
+ readonly CONFIGURATION_MISSING_SORT_KEY: "CONFIGURATION_MISSING_SORT_KEY";
214
+ readonly CONFIGURATION_INVALID_GSI: "CONFIGURATION_INVALID_GSI";
215
+ };
216
+ type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
217
+
5
218
  type BatchWriteOperation<T extends Record<string, unknown>> = {
6
219
  type: "put";
7
220
  item: T;
@@ -386,14 +599,6 @@ type BatchGetExecutor = (keys: Array<PrimaryKeyWithoutExpression>) => Promise<{
386
599
  items: DynamoItem[];
387
600
  unprocessedKeys: PrimaryKeyWithoutExpression[];
388
601
  }>;
389
- /**
390
- * Error class for batch operation failures
391
- */
392
- declare class BatchError extends Error {
393
- readonly operation: "write" | "read";
394
- readonly cause?: Error;
395
- constructor(message: string, operation: "write" | "read", cause?: Error);
396
- }
397
602
  /**
398
603
  * Result structure for batch operations
399
604
  */
@@ -848,7 +1053,7 @@ declare class TransactionBuilder {
848
1053
  * @returns The transaction builder for method chaining
849
1054
  * @throws {Error} If a duplicate item is detected in the transaction
850
1055
  */
851
- update<T extends DynamoItem>(tableName: string, key: PrimaryKeyWithoutExpression, updateExpression: string, expressionAttributeNames?: Record<string, string>, expressionAttributeValues?: Record<string, unknown>, condition?: Condition): this;
1056
+ update<_T extends DynamoItem>(tableName: string, key: PrimaryKeyWithoutExpression, updateExpression: string, expressionAttributeNames?: Record<string, string>, expressionAttributeValues?: Record<string, unknown>, condition?: Condition): this;
852
1057
  /**
853
1058
  * Adds a pre-configured update operation to the transaction.
854
1059
  *
@@ -2794,4 +2999,4 @@ declare class ScanBuilder<T extends DynamoItem, TConfig extends TableConfig = Ta
2794
2999
  execute(): Promise<ResultIterator<T, TConfig>>;
2795
3000
  }
2796
3001
 
2797
- export { BatchBuilder as B, ConditionCheckBuilder as C, DeleteBuilder as D, FilterBuilder as F, GetBuilder as G, PutBuilder as P, QueryBuilder as Q, ResultIterator as R, ScanBuilder as S, TransactionBuilder as T, UpdateBuilder as U, BatchError as a, type BatchResult as b, type DeleteOptions as c, type PutOptions as d, type QueryOptions as e, type TransactionOptions as f, type UpdateOptions as g, type BatchWriteOperation as h, type UpdateCommandParams as i, Paginator as j, type DeleteCommandParams as k, type PutCommandParams as l, type ConditionCheckCommandParams as m, type BaseBuilderInterface as n, type QueryBuilderInterface as o, type ScanBuilderInterface as p, type FilterBuilderInterface as q, type PaginationResult as r, type TransactionItem as s };
3002
+ export { BatchBuilder as B, ConditionCheckBuilder as C, DeleteBuilder as D, ExpressionError as E, FilterBuilder as F, GetBuilder as G, IndexGenerationError as I, KeyGenerationError as K, OperationError as O, PutBuilder as P, QueryBuilder as Q, ResultIterator as R, ScanBuilder as S, TransactionBuilder as T, UpdateBuilder as U, ValidationError as V, type TransactionOptions as a, type BatchWriteOperation as b, BatchError as c, ConfigurationError as d, EntityValidationError as e, TransactionError as f, DynoTableError as g, EntityError as h, type BatchResult as i, type DeleteOptions as j, type PutOptions as k, type QueryOptions as l, type UpdateOptions as m, ErrorCodes as n, type ErrorCode as o, type UpdateCommandParams as p, Paginator as q, type DeleteCommandParams as r, type PutCommandParams as s, type ConditionCheckCommandParams as t, type BaseBuilderInterface as u, type QueryBuilderInterface as v, type ScanBuilderInterface as w, type FilterBuilderInterface as x, type PaginationResult as y, type TransactionItem as z };