dyno-table 2.3.3 → 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.
- package/dist/builders.cjs +14 -13
- package/dist/builders.d.cts +2 -2
- package/dist/builders.d.ts +2 -2
- package/dist/builders.js +2 -1
- package/dist/{chunk-EODPMYPE.js → chunk-64DG2EEI.js} +31 -24
- package/dist/{chunk-XYL43FDX.cjs → chunk-AHF4H42Q.cjs} +109 -96
- package/dist/chunk-ELULXDSB.cjs +564 -0
- package/dist/chunk-FF7FYGDH.js +543 -0
- package/dist/{chunk-DTFJJASK.js → chunk-GWHGUKAL.js} +106 -91
- package/dist/{chunk-KA3VPIPS.cjs → chunk-OLURZQ7R.cjs} +46 -39
- package/dist/{chunk-M5Y6JQJN.js → chunk-U6MQGB6Y.js} +239 -39
- package/dist/{chunk-3J5DY7KG.cjs → chunk-ZXM6LPRV.cjs} +259 -38
- package/dist/{conditions-D_w7vVYG.d.ts → conditions-BSAcZswY.d.ts} +1 -1
- package/dist/{conditions-CcZL0sR2.d.cts → conditions-C8bM__Pn.d.cts} +1 -1
- package/dist/conditions.d.cts +1 -1
- package/dist/conditions.d.ts +1 -1
- package/dist/entity.cjs +5 -4
- package/dist/entity.d.cts +2 -2
- package/dist/entity.d.ts +2 -2
- package/dist/entity.js +2 -1
- package/dist/{index-DlN8G9hd.d.cts → index-BX-MSZHj.d.cts} +216 -11
- package/dist/{index-2cbm07Bi.d.ts → index-DdTolMJW.d.ts} +216 -11
- package/dist/index.cjs +178 -17
- package/dist/index.d.cts +267 -2
- package/dist/index.d.ts +267 -2
- package/dist/index.js +4 -3
- package/dist/table.cjs +4 -3
- package/dist/table.d.cts +2 -2
- package/dist/table.d.ts +2 -2
- package/dist/table.js +3 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,28 +1,113 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkOLURZQ7R_cjs = require('./chunk-OLURZQ7R.cjs');
|
|
4
|
+
var chunkZXM6LPRV_cjs = require('./chunk-ZXM6LPRV.cjs');
|
|
5
5
|
var chunkPB7BBCZO_cjs = require('./chunk-PB7BBCZO.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkAHF4H42Q_cjs = require('./chunk-AHF4H42Q.cjs');
|
|
7
|
+
var chunkELULXDSB_cjs = require('./chunk-ELULXDSB.cjs');
|
|
7
8
|
var chunk7UJJ7JXM_cjs = require('./chunk-7UJJ7JXM.cjs');
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
Object.defineProperty(exports, "Table", {
|
|
12
13
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkOLURZQ7R_cjs.Table; }
|
|
14
15
|
});
|
|
15
16
|
Object.defineProperty(exports, "createIndex", {
|
|
16
17
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkZXM6LPRV_cjs.createIndex; }
|
|
18
19
|
});
|
|
19
20
|
Object.defineProperty(exports, "createQueries", {
|
|
20
21
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkZXM6LPRV_cjs.createQueries; }
|
|
22
23
|
});
|
|
23
24
|
Object.defineProperty(exports, "defineEntity", {
|
|
24
25
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkZXM6LPRV_cjs.defineEntity; }
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "extractRequiredAttributes", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return chunkZXM6LPRV_cjs.extractRequiredAttributes; }
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "formatErrorContext", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () { return chunkZXM6LPRV_cjs.formatErrorContext; }
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "getAwsErrorCode", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () { return chunkZXM6LPRV_cjs.getAwsErrorCode; }
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, "getAwsErrorMessage", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () { return chunkZXM6LPRV_cjs.getAwsErrorMessage; }
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, "getErrorSummary", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () { return chunkZXM6LPRV_cjs.getErrorSummary; }
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "isBatchError", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () { return chunkZXM6LPRV_cjs.isBatchError; }
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports, "isConditionalCheckFailed", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () { return chunkZXM6LPRV_cjs.isConditionalCheckFailed; }
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, "isConfigurationError", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function () { return chunkZXM6LPRV_cjs.isConfigurationError; }
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "isDynoTableError", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () { return chunkZXM6LPRV_cjs.isDynoTableError; }
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(exports, "isEntityError", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () { return chunkZXM6LPRV_cjs.isEntityError; }
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(exports, "isEntityValidationError", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () { return chunkZXM6LPRV_cjs.isEntityValidationError; }
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "isExpressionError", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () { return chunkZXM6LPRV_cjs.isExpressionError; }
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(exports, "isIndexGenerationError", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () { return chunkZXM6LPRV_cjs.isIndexGenerationError; }
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(exports, "isKeyGenerationError", {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function () { return chunkZXM6LPRV_cjs.isKeyGenerationError; }
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "isOperationError", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () { return chunkZXM6LPRV_cjs.isOperationError; }
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(exports, "isProvisionedThroughputExceeded", {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: function () { return chunkZXM6LPRV_cjs.isProvisionedThroughputExceeded; }
|
|
91
|
+
});
|
|
92
|
+
Object.defineProperty(exports, "isRetryableError", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function () { return chunkZXM6LPRV_cjs.isRetryableError; }
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "isTransactionCanceled", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () { return chunkZXM6LPRV_cjs.isTransactionCanceled; }
|
|
99
|
+
});
|
|
100
|
+
Object.defineProperty(exports, "isTransactionError", {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
get: function () { return chunkZXM6LPRV_cjs.isTransactionError; }
|
|
103
|
+
});
|
|
104
|
+
Object.defineProperty(exports, "isValidationError", {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
get: function () { return chunkZXM6LPRV_cjs.isValidationError; }
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "isValidationException", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () { return chunkZXM6LPRV_cjs.isValidationException; }
|
|
26
111
|
});
|
|
27
112
|
Object.defineProperty(exports, "partitionKey", {
|
|
28
113
|
enumerable: true,
|
|
@@ -34,31 +119,107 @@ Object.defineProperty(exports, "sortKey", {
|
|
|
34
119
|
});
|
|
35
120
|
Object.defineProperty(exports, "BatchBuilder", {
|
|
36
121
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
38
|
-
});
|
|
39
|
-
Object.defineProperty(exports, "BatchError", {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
get: function () { return chunkXYL43FDX_cjs.BatchError; }
|
|
122
|
+
get: function () { return chunkAHF4H42Q_cjs.BatchBuilder; }
|
|
42
123
|
});
|
|
43
124
|
Object.defineProperty(exports, "DeleteBuilder", {
|
|
44
125
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunkAHF4H42Q_cjs.DeleteBuilder; }
|
|
46
127
|
});
|
|
47
128
|
Object.defineProperty(exports, "PutBuilder", {
|
|
48
129
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunkAHF4H42Q_cjs.PutBuilder; }
|
|
50
131
|
});
|
|
51
132
|
Object.defineProperty(exports, "QueryBuilder", {
|
|
52
133
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunkAHF4H42Q_cjs.QueryBuilder; }
|
|
54
135
|
});
|
|
55
136
|
Object.defineProperty(exports, "TransactionBuilder", {
|
|
56
137
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunkAHF4H42Q_cjs.TransactionBuilder; }
|
|
58
139
|
});
|
|
59
140
|
Object.defineProperty(exports, "UpdateBuilder", {
|
|
60
141
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunkAHF4H42Q_cjs.UpdateBuilder; }
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "BatchError", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () { return chunkELULXDSB_cjs.BatchError; }
|
|
147
|
+
});
|
|
148
|
+
Object.defineProperty(exports, "BatchErrors", {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get: function () { return chunkELULXDSB_cjs.BatchErrors; }
|
|
151
|
+
});
|
|
152
|
+
Object.defineProperty(exports, "ConfigurationError", {
|
|
153
|
+
enumerable: true,
|
|
154
|
+
get: function () { return chunkELULXDSB_cjs.ConfigurationError; }
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "ConfigurationErrors", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function () { return chunkELULXDSB_cjs.ConfigurationErrors; }
|
|
159
|
+
});
|
|
160
|
+
Object.defineProperty(exports, "DynoTableError", {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: function () { return chunkELULXDSB_cjs.DynoTableError; }
|
|
163
|
+
});
|
|
164
|
+
Object.defineProperty(exports, "EntityError", {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
get: function () { return chunkELULXDSB_cjs.EntityError; }
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(exports, "EntityErrors", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () { return chunkELULXDSB_cjs.EntityErrors; }
|
|
171
|
+
});
|
|
172
|
+
Object.defineProperty(exports, "EntityValidationError", {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
get: function () { return chunkELULXDSB_cjs.EntityValidationError; }
|
|
175
|
+
});
|
|
176
|
+
Object.defineProperty(exports, "ErrorCodes", {
|
|
177
|
+
enumerable: true,
|
|
178
|
+
get: function () { return chunkELULXDSB_cjs.ErrorCodes; }
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "ExpressionError", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () { return chunkELULXDSB_cjs.ExpressionError; }
|
|
183
|
+
});
|
|
184
|
+
Object.defineProperty(exports, "ExpressionErrors", {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
get: function () { return chunkELULXDSB_cjs.ExpressionErrors; }
|
|
187
|
+
});
|
|
188
|
+
Object.defineProperty(exports, "IndexErrors", {
|
|
189
|
+
enumerable: true,
|
|
190
|
+
get: function () { return chunkELULXDSB_cjs.IndexErrors; }
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "IndexGenerationError", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function () { return chunkELULXDSB_cjs.IndexGenerationError; }
|
|
195
|
+
});
|
|
196
|
+
Object.defineProperty(exports, "KeyGenerationError", {
|
|
197
|
+
enumerable: true,
|
|
198
|
+
get: function () { return chunkELULXDSB_cjs.KeyGenerationError; }
|
|
199
|
+
});
|
|
200
|
+
Object.defineProperty(exports, "OperationError", {
|
|
201
|
+
enumerable: true,
|
|
202
|
+
get: function () { return chunkELULXDSB_cjs.OperationError; }
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(exports, "OperationErrors", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function () { return chunkELULXDSB_cjs.OperationErrors; }
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(exports, "TransactionError", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function () { return chunkELULXDSB_cjs.TransactionError; }
|
|
211
|
+
});
|
|
212
|
+
Object.defineProperty(exports, "TransactionErrors", {
|
|
213
|
+
enumerable: true,
|
|
214
|
+
get: function () { return chunkELULXDSB_cjs.TransactionErrors; }
|
|
215
|
+
});
|
|
216
|
+
Object.defineProperty(exports, "ValidationError", {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function () { return chunkELULXDSB_cjs.ValidationError; }
|
|
219
|
+
});
|
|
220
|
+
Object.defineProperty(exports, "ValidationErrors", {
|
|
221
|
+
enumerable: true,
|
|
222
|
+
get: function () { return chunkELULXDSB_cjs.ValidationErrors; }
|
|
62
223
|
});
|
|
63
224
|
Object.defineProperty(exports, "and", {
|
|
64
225
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,273 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
1
|
+
import { c as BatchError, d as ConfigurationError, E as ExpressionError, e as EntityValidationError, K as KeyGenerationError, I as IndexGenerationError, O as OperationError, f as TransactionError, V as ValidationError, g as DynoTableError, h as EntityError } from './index-BX-MSZHj.cjs';
|
|
2
|
+
export { B as BatchBuilder, i as BatchResult, D as DeleteBuilder, j as DeleteOptions, o as ErrorCode, n as ErrorCodes, P as PutBuilder, k as PutOptions, Q as QueryBuilder, l as QueryOptions, T as TransactionBuilder, a as TransactionOptions, U as UpdateBuilder, m as UpdateOptions } from './index-BX-MSZHj.cjs';
|
|
3
|
+
export { C as ComparisonOperator, b as Condition, c as ConditionOperator, E as ExpressionParams, K as KeyConditionOperator, L as LogicalOperator, a as PrimaryKey, P as PrimaryKeyWithoutExpression, d as and, e as attributeExists, f as attributeNotExists, g as beginsWith, h as between, i as contains, j as eq, k as gt, l as gte, m as inArray, n as lt, o as lte, p as ne, q as not, r as or } from './conditions-C8bM__Pn.cjs';
|
|
3
4
|
export { EntityConfig, EntityRepository, IndexDefinition, QueryEntity, QueryRecord, createIndex, createQueries, defineEntity } from './entity.cjs';
|
|
4
5
|
export { Table } from './table.cjs';
|
|
5
6
|
export { partitionKey, sortKey } from './utils.cjs';
|
|
6
7
|
import './types.cjs';
|
|
7
8
|
import '@aws-sdk/lib-dynamodb';
|
|
8
9
|
import './standard-schema.cjs';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Factory functions for Expression errors
|
|
13
|
+
*/
|
|
14
|
+
declare const ExpressionErrors: {
|
|
15
|
+
missingAttribute: (conditionType: string, condition: unknown) => ExpressionError;
|
|
16
|
+
missingValue: (conditionType: string, condition: unknown) => ExpressionError;
|
|
17
|
+
invalidCondition: (conditionType: string, condition: unknown, suggestion?: string) => ExpressionError;
|
|
18
|
+
emptyArray: (conditionType: string, providedValue: unknown) => ExpressionError;
|
|
19
|
+
unknownType: (conditionType: string, condition: unknown) => ExpressionError;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Factory functions for Validation errors
|
|
23
|
+
*/
|
|
24
|
+
declare const ValidationErrors: {
|
|
25
|
+
indexSchemaValidationFailed: (validationIssues: unknown, keyType: "partition" | "sort" | "both") => ValidationError;
|
|
26
|
+
noUpdateActions: (tableName: string, key: Record<string, unknown>) => ValidationError;
|
|
27
|
+
conditionRequired: (tableName: string, key: Record<string, unknown>) => ValidationError;
|
|
28
|
+
queryInputValidationFailed: (entityName: string, queryName: string, validationIssues: unknown, providedInput: unknown) => ValidationError;
|
|
29
|
+
undefinedValue: (path: string, tableName: string, key: Record<string, unknown>) => ValidationError;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Factory functions for Configuration errors
|
|
33
|
+
*/
|
|
34
|
+
declare const ConfigurationErrors: {
|
|
35
|
+
invalidChunkSize: (size: number) => ConfigurationError;
|
|
36
|
+
sortKeyRequired: (tableName: string, partitionKey: string, sortKey?: string) => ConfigurationError;
|
|
37
|
+
sortKeyNotDefined: (tableName: string, partitionKey: string, indexName?: string) => ConfigurationError;
|
|
38
|
+
gsiNotFound: (indexName: string, tableName: string, availableIndexes: string[]) => ConfigurationError;
|
|
39
|
+
primaryKeyMissing: (tableName: string, partitionKeyName: string, providedItem: unknown) => ConfigurationError;
|
|
40
|
+
pkExtractionFailed: (tableName: string, indexName: string, item: unknown, cause?: Error) => ConfigurationError;
|
|
41
|
+
conditionGenerationFailed: (condition: unknown, suggestion?: string) => ExpressionError;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Factory functions for Operation errors
|
|
45
|
+
*/
|
|
46
|
+
declare const OperationErrors: {
|
|
47
|
+
queryFailed: (tableName: string, context: Record<string, unknown>, cause?: Error) => OperationError;
|
|
48
|
+
scanFailed: (tableName: string, context: Record<string, unknown>, cause?: Error) => OperationError;
|
|
49
|
+
getFailed: (tableName: string, key: Record<string, unknown>, cause?: Error) => OperationError;
|
|
50
|
+
putFailed: (tableName: string, item: unknown, cause?: Error) => OperationError;
|
|
51
|
+
updateFailed: (tableName: string, key: Record<string, unknown>, cause?: Error) => OperationError;
|
|
52
|
+
deleteFailed: (tableName: string, key: Record<string, unknown>, cause?: Error) => OperationError;
|
|
53
|
+
batchGetFailed: (tableName: string, context: Record<string, unknown>, cause?: Error) => OperationError;
|
|
54
|
+
batchWriteFailed: (tableName: string, context: Record<string, unknown>, cause?: Error) => OperationError;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Factory functions for Transaction errors
|
|
58
|
+
*/
|
|
59
|
+
declare const TransactionErrors: {
|
|
60
|
+
transactionFailed: (itemCount: number, context: Record<string, unknown>, cause?: Error) => TransactionError;
|
|
61
|
+
duplicateItem: (tableName: string, partitionKey: {
|
|
62
|
+
name: string;
|
|
63
|
+
value: unknown;
|
|
64
|
+
}, sortKey?: {
|
|
65
|
+
name: string;
|
|
66
|
+
value: unknown;
|
|
67
|
+
}) => TransactionError;
|
|
68
|
+
transactionEmpty: () => TransactionError;
|
|
69
|
+
unsupportedType: (item: unknown) => TransactionError;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Factory functions for Batch errors
|
|
73
|
+
*/
|
|
74
|
+
declare const BatchErrors: {
|
|
75
|
+
batchEmpty: (operation: "write" | "read") => BatchError;
|
|
76
|
+
unsupportedType: (operation: "write" | "read", item: unknown) => BatchError;
|
|
77
|
+
batchWriteFailed: (unprocessedItems: unknown[], context: Record<string, unknown>, cause?: Error) => BatchError;
|
|
78
|
+
batchGetFailed: (unprocessedItems: unknown[], context: Record<string, unknown>, cause?: Error) => BatchError;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Factory functions for Entity errors
|
|
82
|
+
*/
|
|
83
|
+
declare const EntityErrors: {
|
|
84
|
+
validationFailed: (entityName: string, operation: string, validationIssues: unknown, providedData: unknown) => EntityValidationError;
|
|
85
|
+
queryInputValidationFailed: (entityName: string, queryName: string, validationIssues: unknown, providedInput: unknown) => EntityValidationError;
|
|
86
|
+
asyncValidationNotSupported: (entityName: string, operation: string) => EntityValidationError;
|
|
87
|
+
keyGenerationFailed: (entityName: string, operation: string, providedData: unknown, requiredAttributes?: string[], cause?: Error) => KeyGenerationError;
|
|
88
|
+
keyInvalidFormat: (entityName: string, operation: string, providedData: unknown, generatedKey: unknown) => KeyGenerationError;
|
|
89
|
+
keyMissingAttributes: (entityName: string, operation: string, missingAttributes: string[], providedData: unknown) => KeyGenerationError;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Factory functions for Index errors
|
|
93
|
+
*/
|
|
94
|
+
declare const IndexErrors: {
|
|
95
|
+
generationFailed: (indexName: string, operation: string, providedItem: unknown, partitionKeyAttribute?: string, sortKeyAttribute?: string, cause?: Error) => IndexGenerationError;
|
|
96
|
+
missingAttributes: (indexName: string, operation: string, missingAttributes: string[], providedData: unknown, isReadOnly: boolean) => IndexGenerationError;
|
|
97
|
+
undefinedValues: (indexName: string, operation: string, generatedKey: unknown, providedItem: unknown) => IndexGenerationError;
|
|
98
|
+
notFound: (requestedIndexes: string[], availableIndexes: string[], entityName?: string, tableName?: string) => IndexGenerationError;
|
|
99
|
+
readonlyUpdateFailed: (indexName: string, operation: string, providedData: unknown) => IndexGenerationError;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Utility functions for error handling
|
|
104
|
+
*
|
|
105
|
+
* This module provides helper functions for wrapping AWS SDK errors,
|
|
106
|
+
* extracting information from errors, and formatting error context.
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Checks if an error is a DynamoDB conditional check failure
|
|
111
|
+
*
|
|
112
|
+
* @param error - The error to check
|
|
113
|
+
* @returns true if the error is a conditional check failure
|
|
114
|
+
*/
|
|
115
|
+
declare function isConditionalCheckFailed(error: unknown): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Checks if an error is a DynamoDB transaction cancellation
|
|
118
|
+
*
|
|
119
|
+
* @param error - The error to check
|
|
120
|
+
* @returns true if the error is a transaction cancellation
|
|
121
|
+
*/
|
|
122
|
+
declare function isTransactionCanceled(error: unknown): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Checks if an error is a DynamoDB validation exception
|
|
125
|
+
*
|
|
126
|
+
* @param error - The error to check
|
|
127
|
+
* @returns true if the error is a validation exception
|
|
128
|
+
*/
|
|
129
|
+
declare function isValidationException(error: unknown): boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Checks if an error is a DynamoDB provisioned throughput exceeded exception
|
|
132
|
+
*
|
|
133
|
+
* @param error - The error to check
|
|
134
|
+
* @returns true if the error is a throughput exceeded exception
|
|
135
|
+
*/
|
|
136
|
+
declare function isProvisionedThroughputExceeded(error: unknown): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Checks if an error is a retryable error
|
|
139
|
+
*
|
|
140
|
+
* Retryable errors include:
|
|
141
|
+
* - ProvisionedThroughputExceededException
|
|
142
|
+
* - ThrottlingException
|
|
143
|
+
* - RequestLimitExceeded
|
|
144
|
+
* - InternalServerError
|
|
145
|
+
* - ServiceUnavailable
|
|
146
|
+
*
|
|
147
|
+
* @param error - The error to check
|
|
148
|
+
* @returns true if the error is retryable
|
|
149
|
+
*/
|
|
150
|
+
declare function isRetryableError(error: unknown): boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Extracts the AWS error code from an error
|
|
153
|
+
*
|
|
154
|
+
* @param error - The error to extract the code from
|
|
155
|
+
* @returns The error code, or undefined if not found
|
|
156
|
+
*/
|
|
157
|
+
declare function getAwsErrorCode(error: unknown): string | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* Extracts the AWS error message from an error
|
|
160
|
+
*
|
|
161
|
+
* @param error - The error to extract the message from
|
|
162
|
+
* @returns The error message, or undefined if not found
|
|
163
|
+
*/
|
|
164
|
+
declare function getAwsErrorMessage(error: unknown): string | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Attempts to extract required attribute names from an error message
|
|
167
|
+
*
|
|
168
|
+
* This is a best-effort function that looks for common patterns in error
|
|
169
|
+
* messages to identify which attributes are missing or required.
|
|
170
|
+
*
|
|
171
|
+
* @param error - The error to extract attributes from
|
|
172
|
+
* @returns Array of attribute names, or undefined if none found
|
|
173
|
+
*/
|
|
174
|
+
declare function extractRequiredAttributes(error: unknown): string[] | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* Formats error context for logging
|
|
177
|
+
*
|
|
178
|
+
* Converts the error context object to a readable string format,
|
|
179
|
+
* handling special types like arrays and nested objects.
|
|
180
|
+
*
|
|
181
|
+
* @param context - The error context to format
|
|
182
|
+
* @param indent - The indentation level (for nested objects)
|
|
183
|
+
* @returns Formatted context string
|
|
184
|
+
*/
|
|
185
|
+
declare function formatErrorContext(context: Record<string, unknown>, indent?: number): string;
|
|
186
|
+
/**
|
|
187
|
+
* Creates a detailed error summary including context
|
|
188
|
+
*
|
|
189
|
+
* Useful for logging or displaying error information to developers.
|
|
190
|
+
*
|
|
191
|
+
* @param error - The DynoTableError to summarize
|
|
192
|
+
* @returns Formatted error summary
|
|
193
|
+
*/
|
|
194
|
+
declare function getErrorSummary(error: DynoTableError): string;
|
|
195
|
+
/**
|
|
196
|
+
* Type guard to check if an error is a DynoTableError
|
|
197
|
+
*
|
|
198
|
+
* @param error - The error to check
|
|
199
|
+
* @returns true if the error is a DynoTableError
|
|
200
|
+
*/
|
|
201
|
+
declare function isDynoTableError(error: unknown): error is DynoTableError;
|
|
202
|
+
/**
|
|
203
|
+
* Type guard to check if an error is a ValidationError
|
|
204
|
+
*
|
|
205
|
+
* @param error - The error to check
|
|
206
|
+
* @returns true if the error is a ValidationError
|
|
207
|
+
*/
|
|
208
|
+
declare function isValidationError(error: unknown): error is ValidationError;
|
|
209
|
+
/**
|
|
210
|
+
* Type guard to check if an error is an OperationError
|
|
211
|
+
*
|
|
212
|
+
* @param error - The error to check
|
|
213
|
+
* @returns true if the error is an OperationError
|
|
214
|
+
*/
|
|
215
|
+
declare function isOperationError(error: unknown): error is OperationError;
|
|
216
|
+
/**
|
|
217
|
+
* Type guard to check if an error is a TransactionError
|
|
218
|
+
*
|
|
219
|
+
* @param error - The error to check
|
|
220
|
+
* @returns true if the error is a TransactionError
|
|
221
|
+
*/
|
|
222
|
+
declare function isTransactionError(error: unknown): error is TransactionError;
|
|
223
|
+
/**
|
|
224
|
+
* Type guard to check if an error is a BatchError
|
|
225
|
+
*
|
|
226
|
+
* @param error - The error to check
|
|
227
|
+
* @returns true if the error is a BatchError
|
|
228
|
+
*/
|
|
229
|
+
declare function isBatchError(error: unknown): error is BatchError;
|
|
230
|
+
/**
|
|
231
|
+
* Type guard to check if an error is an ExpressionError
|
|
232
|
+
*
|
|
233
|
+
* @param error - The error to check
|
|
234
|
+
* @returns true if the error is an ExpressionError
|
|
235
|
+
*/
|
|
236
|
+
declare function isExpressionError(error: unknown): error is ExpressionError;
|
|
237
|
+
/**
|
|
238
|
+
* Type guard to check if an error is a ConfigurationError
|
|
239
|
+
*
|
|
240
|
+
* @param error - The error to check
|
|
241
|
+
* @returns true if the error is a ConfigurationError
|
|
242
|
+
*/
|
|
243
|
+
declare function isConfigurationError(error: unknown): error is ConfigurationError;
|
|
244
|
+
/**
|
|
245
|
+
* Type guard to check if an error is an EntityError
|
|
246
|
+
*
|
|
247
|
+
* @param error - The error to check
|
|
248
|
+
* @returns true if the error is an EntityError
|
|
249
|
+
*/
|
|
250
|
+
declare function isEntityError(error: unknown): error is EntityError;
|
|
251
|
+
/**
|
|
252
|
+
* Type guard to check if an error is a KeyGenerationError
|
|
253
|
+
*
|
|
254
|
+
* @param error - The error to check
|
|
255
|
+
* @returns true if the error is a KeyGenerationError
|
|
256
|
+
*/
|
|
257
|
+
declare function isKeyGenerationError(error: unknown): error is KeyGenerationError;
|
|
258
|
+
/**
|
|
259
|
+
* Type guard to check if an error is an IndexGenerationError
|
|
260
|
+
*
|
|
261
|
+
* @param error - The error to check
|
|
262
|
+
* @returns true if the error is an IndexGenerationError
|
|
263
|
+
*/
|
|
264
|
+
declare function isIndexGenerationError(error: unknown): error is IndexGenerationError;
|
|
265
|
+
/**
|
|
266
|
+
* Type guard to check if an error is an EntityValidationError
|
|
267
|
+
*
|
|
268
|
+
* @param error - The error to check
|
|
269
|
+
* @returns true if the error is an EntityValidationError
|
|
270
|
+
*/
|
|
271
|
+
declare function isEntityValidationError(error: unknown): error is EntityValidationError;
|
|
272
|
+
|
|
273
|
+
export { BatchError, BatchErrors, ConfigurationError, ConfigurationErrors, DynoTableError, EntityError, EntityErrors, EntityValidationError, ExpressionError, ExpressionErrors, IndexErrors, IndexGenerationError, KeyGenerationError, OperationError, OperationErrors, TransactionError, TransactionErrors, ValidationError, ValidationErrors, extractRequiredAttributes, formatErrorContext, getAwsErrorCode, getAwsErrorMessage, getErrorSummary, isBatchError, isConditionalCheckFailed, isConfigurationError, isDynoTableError, isEntityError, isEntityValidationError, isExpressionError, isIndexGenerationError, isKeyGenerationError, isOperationError, isProvisionedThroughputExceeded, isRetryableError, isTransactionCanceled, isTransactionError, isValidationError, isValidationException };
|