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/builders.cjs
CHANGED
|
@@ -1,55 +1,56 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkAHF4H42Q_cjs = require('./chunk-AHF4H42Q.cjs');
|
|
4
|
+
require('./chunk-ELULXDSB.cjs');
|
|
4
5
|
require('./chunk-7UJJ7JXM.cjs');
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
Object.defineProperty(exports, "BatchBuilder", {
|
|
9
10
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkAHF4H42Q_cjs.BatchBuilder; }
|
|
11
12
|
});
|
|
12
13
|
Object.defineProperty(exports, "ConditionCheckBuilder", {
|
|
13
14
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkAHF4H42Q_cjs.ConditionCheckBuilder; }
|
|
15
16
|
});
|
|
16
17
|
Object.defineProperty(exports, "DeleteBuilder", {
|
|
17
18
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkAHF4H42Q_cjs.DeleteBuilder; }
|
|
19
20
|
});
|
|
20
21
|
Object.defineProperty(exports, "FilterBuilder", {
|
|
21
22
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkAHF4H42Q_cjs.FilterBuilder; }
|
|
23
24
|
});
|
|
24
25
|
Object.defineProperty(exports, "GetBuilder", {
|
|
25
26
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkAHF4H42Q_cjs.GetBuilder; }
|
|
27
28
|
});
|
|
28
29
|
Object.defineProperty(exports, "Paginator", {
|
|
29
30
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkAHF4H42Q_cjs.Paginator; }
|
|
31
32
|
});
|
|
32
33
|
Object.defineProperty(exports, "PutBuilder", {
|
|
33
34
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkAHF4H42Q_cjs.PutBuilder; }
|
|
35
36
|
});
|
|
36
37
|
Object.defineProperty(exports, "QueryBuilder", {
|
|
37
38
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkAHF4H42Q_cjs.QueryBuilder; }
|
|
39
40
|
});
|
|
40
41
|
Object.defineProperty(exports, "ResultIterator", {
|
|
41
42
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkAHF4H42Q_cjs.ResultIterator; }
|
|
43
44
|
});
|
|
44
45
|
Object.defineProperty(exports, "ScanBuilder", {
|
|
45
46
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkAHF4H42Q_cjs.ScanBuilder; }
|
|
47
48
|
});
|
|
48
49
|
Object.defineProperty(exports, "TransactionBuilder", {
|
|
49
50
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkAHF4H42Q_cjs.TransactionBuilder; }
|
|
51
52
|
});
|
|
52
53
|
Object.defineProperty(exports, "UpdateBuilder", {
|
|
53
54
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkAHF4H42Q_cjs.UpdateBuilder; }
|
|
55
56
|
});
|
package/dist/builders.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { s as Path, t as PathType } from './conditions-
|
|
1
|
+
export { u as BaseBuilderInterface, B as BatchBuilder, C as ConditionCheckBuilder, t as ConditionCheckCommandParams, D as DeleteBuilder, r as DeleteCommandParams, F as FilterBuilder, x as FilterBuilderInterface, G as GetBuilder, y as PaginationResult, q as Paginator, P as PutBuilder, s as PutCommandParams, Q as QueryBuilder, v as QueryBuilderInterface, R as ResultIterator, S as ScanBuilder, w as ScanBuilderInterface, T as TransactionBuilder, z as TransactionItem, U as UpdateBuilder, p as UpdateCommandParams } from './index-BX-MSZHj.cjs';
|
|
2
|
+
export { s as Path, t as PathType } from './conditions-C8bM__Pn.cjs';
|
|
3
3
|
import './types.cjs';
|
|
4
4
|
import '@aws-sdk/lib-dynamodb';
|
package/dist/builders.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { s as Path, t as PathType } from './conditions-
|
|
1
|
+
export { u as BaseBuilderInterface, B as BatchBuilder, C as ConditionCheckBuilder, t as ConditionCheckCommandParams, D as DeleteBuilder, r as DeleteCommandParams, F as FilterBuilder, x as FilterBuilderInterface, G as GetBuilder, y as PaginationResult, q as Paginator, P as PutBuilder, s as PutCommandParams, Q as QueryBuilder, v as QueryBuilderInterface, R as ResultIterator, S as ScanBuilder, w as ScanBuilderInterface, T as TransactionBuilder, z as TransactionItem, U as UpdateBuilder, p as UpdateCommandParams } from './index-DdTolMJW.js';
|
|
2
|
+
export { s as Path, t as PathType } from './conditions-BSAcZswY.js';
|
|
3
3
|
import './types.js';
|
|
4
4
|
import '@aws-sdk/lib-dynamodb';
|
package/dist/builders.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { BatchBuilder, ConditionCheckBuilder, DeleteBuilder, FilterBuilder, GetBuilder, Paginator, PutBuilder, QueryBuilder, ResultIterator, ScanBuilder, TransactionBuilder, UpdateBuilder } from './chunk-
|
|
1
|
+
export { BatchBuilder, ConditionCheckBuilder, DeleteBuilder, FilterBuilder, GetBuilder, Paginator, PutBuilder, QueryBuilder, ResultIterator, ScanBuilder, TransactionBuilder, UpdateBuilder } from './chunk-GWHGUKAL.js';
|
|
2
|
+
import './chunk-FF7FYGDH.js';
|
|
2
3
|
import './chunk-2WIBY7PZ.js';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { GetBuilder, PutBuilder, QueryBuilder, ScanBuilder, DeleteBuilder, UpdateBuilder, TransactionBuilder, BatchBuilder, ConditionCheckBuilder, buildExpression, generateAttributeName
|
|
1
|
+
import { GetBuilder, PutBuilder, QueryBuilder, ScanBuilder, DeleteBuilder, UpdateBuilder, TransactionBuilder, BatchBuilder, ConditionCheckBuilder, buildExpression, generateAttributeName } from './chunk-GWHGUKAL.js';
|
|
2
|
+
import { ConfigurationErrors, OperationErrors } from './chunk-FF7FYGDH.js';
|
|
2
3
|
import { eq, and, beginsWith, between, gte, gt, lte, lt } from './chunk-2WIBY7PZ.js';
|
|
3
4
|
|
|
4
5
|
// src/utils/chunk-array.ts
|
|
5
6
|
function* chunkArray(array, size) {
|
|
6
7
|
if (size <= 0) {
|
|
7
|
-
throw
|
|
8
|
+
throw ConfigurationErrors.invalidChunkSize(size);
|
|
8
9
|
}
|
|
9
10
|
for (let i = 0; i < array.length; i += size) {
|
|
10
11
|
yield array.slice(i, i + size);
|
|
@@ -40,7 +41,7 @@ var Table = class {
|
|
|
40
41
|
const primaryCondition = { [this.partitionKey]: keyCondition.pk };
|
|
41
42
|
if (this.sortKey) {
|
|
42
43
|
if (!keyCondition.sk) {
|
|
43
|
-
throw
|
|
44
|
+
throw ConfigurationErrors.sortKeyRequired(this.tableName, this.partitionKey, this.sortKey);
|
|
44
45
|
}
|
|
45
46
|
primaryCondition[this.sortKey] = keyCondition.sk;
|
|
46
47
|
}
|
|
@@ -94,8 +95,7 @@ var Table = class {
|
|
|
94
95
|
item: result.Item ? result.Item : void 0
|
|
95
96
|
};
|
|
96
97
|
} catch (error) {
|
|
97
|
-
|
|
98
|
-
throw error;
|
|
98
|
+
throw OperationErrors.getFailed(params.tableName, keyCondition, error instanceof Error ? error : void 0);
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
return new GetBuilder(executor, keyCondition, this.tableName);
|
|
@@ -135,8 +135,7 @@ var Table = class {
|
|
|
135
135
|
}
|
|
136
136
|
return result.Attributes;
|
|
137
137
|
} catch (error) {
|
|
138
|
-
|
|
139
|
-
throw error;
|
|
138
|
+
throw OperationErrors.putFailed(params.tableName, params.item, error instanceof Error ? error : void 0);
|
|
140
139
|
}
|
|
141
140
|
};
|
|
142
141
|
return new PutBuilder(executor, item, this.tableName);
|
|
@@ -151,7 +150,7 @@ var Table = class {
|
|
|
151
150
|
let keyConditionExpression = eq(pkAttributeName, keyCondition.pk);
|
|
152
151
|
if (keyCondition.sk) {
|
|
153
152
|
if (!skAttributeName) {
|
|
154
|
-
throw
|
|
153
|
+
throw ConfigurationErrors.sortKeyNotDefined(this.tableName, pkAttributeName);
|
|
155
154
|
}
|
|
156
155
|
const keyConditionOperator = {
|
|
157
156
|
eq: (value) => eq(skAttributeName, value),
|
|
@@ -172,7 +171,7 @@ var Table = class {
|
|
|
172
171
|
const gsiName = String(options.indexName);
|
|
173
172
|
const gsi = this.gsis[gsiName];
|
|
174
173
|
if (!gsi) {
|
|
175
|
-
throw
|
|
174
|
+
throw ConfigurationErrors.gsiNotFound(gsiName, this.tableName, Object.keys(this.gsis));
|
|
176
175
|
}
|
|
177
176
|
const gsiPkAttributeName = gsi.partitionKey;
|
|
178
177
|
const gsiSkAttributeName = gsi.sortKey;
|
|
@@ -201,7 +200,7 @@ var Table = class {
|
|
|
201
200
|
}
|
|
202
201
|
}
|
|
203
202
|
if (!pkValue) {
|
|
204
|
-
throw
|
|
203
|
+
throw ConfigurationErrors.pkExtractionFailed(this.tableName, options.indexName, originalKeyCondition);
|
|
205
204
|
}
|
|
206
205
|
let gsiKeyCondition = eq(gsiPkAttributeName, pkValue);
|
|
207
206
|
if (skValue && gsiSkAttributeName) {
|
|
@@ -252,9 +251,11 @@ var Table = class {
|
|
|
252
251
|
lastEvaluatedKey: result.LastEvaluatedKey
|
|
253
252
|
};
|
|
254
253
|
} catch (error) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
254
|
+
throw OperationErrors.queryFailed(
|
|
255
|
+
this.tableName,
|
|
256
|
+
{ indexName, keyConditionExpression: keyConditionExpression2, filterExpression },
|
|
257
|
+
error instanceof Error ? error : void 0
|
|
258
|
+
);
|
|
258
259
|
}
|
|
259
260
|
};
|
|
260
261
|
return new QueryBuilder(executor, keyConditionExpression);
|
|
@@ -300,9 +301,11 @@ var Table = class {
|
|
|
300
301
|
lastEvaluatedKey: result.LastEvaluatedKey
|
|
301
302
|
};
|
|
302
303
|
} catch (error) {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
304
|
+
throw OperationErrors.scanFailed(
|
|
305
|
+
this.tableName,
|
|
306
|
+
{ indexName: options.indexName, filterExpression },
|
|
307
|
+
error instanceof Error ? error : void 0
|
|
308
|
+
);
|
|
306
309
|
}
|
|
307
310
|
};
|
|
308
311
|
return new ScanBuilder(executor);
|
|
@@ -322,8 +325,7 @@ var Table = class {
|
|
|
322
325
|
item: result.Attributes
|
|
323
326
|
};
|
|
324
327
|
} catch (error) {
|
|
325
|
-
|
|
326
|
-
throw error;
|
|
328
|
+
throw OperationErrors.deleteFailed(params.tableName, keyCondition, error instanceof Error ? error : void 0);
|
|
327
329
|
}
|
|
328
330
|
};
|
|
329
331
|
return new DeleteBuilder(executor, this.tableName, keyCondition);
|
|
@@ -350,8 +352,7 @@ var Table = class {
|
|
|
350
352
|
item: result.Attributes
|
|
351
353
|
};
|
|
352
354
|
} catch (error) {
|
|
353
|
-
|
|
354
|
-
throw error;
|
|
355
|
+
throw OperationErrors.updateFailed(params.tableName, keyCondition, error instanceof Error ? error : void 0);
|
|
355
356
|
}
|
|
356
357
|
};
|
|
357
358
|
return new UpdateBuilder(executor, this.tableName, keyCondition);
|
|
@@ -483,8 +484,11 @@ var Table = class {
|
|
|
483
484
|
allUnprocessedKeys.push(...unprocessedKeys);
|
|
484
485
|
}
|
|
485
486
|
} catch (error) {
|
|
486
|
-
|
|
487
|
-
|
|
487
|
+
throw OperationErrors.batchGetFailed(
|
|
488
|
+
this.tableName,
|
|
489
|
+
{ requestedKeys: keys.length },
|
|
490
|
+
error instanceof Error ? error : void 0
|
|
491
|
+
);
|
|
488
492
|
}
|
|
489
493
|
}
|
|
490
494
|
return {
|
|
@@ -545,8 +549,11 @@ var Table = class {
|
|
|
545
549
|
allUnprocessedItems.push(...unprocessedItems);
|
|
546
550
|
}
|
|
547
551
|
} catch (error) {
|
|
548
|
-
|
|
549
|
-
|
|
552
|
+
throw OperationErrors.batchWriteFailed(
|
|
553
|
+
this.tableName,
|
|
554
|
+
{ requestedOperations: operations.length },
|
|
555
|
+
error instanceof Error ? error : void 0
|
|
556
|
+
);
|
|
550
557
|
}
|
|
551
558
|
}
|
|
552
559
|
return {
|