dynamo-document-builder 0.6.0 → 0.7.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/README.md +367 -0
- package/dist/attributes/attribute-map.cjs +52 -0
- package/dist/attributes/attribute-map.cjs.map +1 -1
- package/dist/attributes/attribute-map.d.ts +67 -0
- package/dist/attributes/attribute-map.mjs +52 -0
- package/dist/attributes/attribute-map.mjs.map +1 -1
- package/dist/commands/batch-get.cjs +43 -0
- package/dist/commands/batch-get.cjs.map +1 -1
- package/dist/commands/batch-get.d.ts +51 -3
- package/dist/commands/batch-get.mjs +44 -1
- package/dist/commands/batch-get.mjs.map +1 -1
- package/dist/commands/batch-projected-get.cjs +42 -0
- package/dist/commands/batch-projected-get.cjs.map +1 -1
- package/dist/commands/batch-projected-get.d.ts +56 -3
- package/dist/commands/batch-projected-get.mjs +42 -0
- package/dist/commands/batch-projected-get.mjs.map +1 -1
- package/dist/commands/batch-write.cjs +44 -0
- package/dist/commands/batch-write.cjs.map +1 -1
- package/dist/commands/batch-write.d.ts +54 -4
- package/dist/commands/batch-write.mjs +45 -1
- package/dist/commands/batch-write.mjs.map +1 -1
- package/dist/commands/condition-check.cjs +37 -0
- package/dist/commands/condition-check.cjs.map +1 -1
- package/dist/commands/condition-check.d.ts +45 -3
- package/dist/commands/condition-check.mjs +37 -0
- package/dist/commands/condition-check.mjs.map +1 -1
- package/dist/commands/conditional-delete.cjs +33 -0
- package/dist/commands/conditional-delete.cjs.map +1 -1
- package/dist/commands/conditional-delete.d.ts +46 -3
- package/dist/commands/conditional-delete.mjs +33 -0
- package/dist/commands/conditional-delete.mjs.map +1 -1
- package/dist/commands/conditional-put.cjs +34 -0
- package/dist/commands/conditional-put.cjs.map +1 -1
- package/dist/commands/conditional-put.d.ts +48 -4
- package/dist/commands/conditional-put.mjs +34 -0
- package/dist/commands/conditional-put.mjs.map +1 -1
- package/dist/commands/conditional-update.cjs +35 -0
- package/dist/commands/conditional-update.cjs.map +1 -1
- package/dist/commands/conditional-update.d.ts +48 -3
- package/dist/commands/conditional-update.mjs +35 -0
- package/dist/commands/conditional-update.mjs.map +1 -1
- package/dist/commands/delete.cjs +32 -0
- package/dist/commands/delete.cjs.map +1 -1
- package/dist/commands/delete.d.ts +44 -2
- package/dist/commands/delete.mjs +32 -0
- package/dist/commands/delete.mjs.map +1 -1
- package/dist/commands/get.cjs +33 -0
- package/dist/commands/get.cjs.map +1 -1
- package/dist/commands/get.d.ts +45 -2
- package/dist/commands/get.mjs +33 -0
- package/dist/commands/get.mjs.map +1 -1
- package/dist/commands/index.cjs +8 -0
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.d.ts +160 -1
- package/dist/commands/index.mjs +4 -0
- package/dist/commands/index.mjs.map +1 -1
- package/dist/commands/projected-get.cjs +40 -0
- package/dist/commands/projected-get.cjs.map +1 -1
- package/dist/commands/projected-get.d.ts +54 -3
- package/dist/commands/projected-get.mjs +40 -0
- package/dist/commands/projected-get.mjs.map +1 -1
- package/dist/commands/projected-query.cjs +41 -0
- package/dist/commands/projected-query.cjs.map +1 -1
- package/dist/commands/projected-query.d.ts +56 -3
- package/dist/commands/projected-query.mjs +41 -0
- package/dist/commands/projected-query.mjs.map +1 -1
- package/dist/commands/projected-scan.cjs +41 -0
- package/dist/commands/projected-scan.cjs.map +1 -1
- package/dist/commands/projected-scan.d.ts +55 -3
- package/dist/commands/projected-scan.mjs +41 -0
- package/dist/commands/projected-scan.mjs.map +1 -1
- package/dist/commands/put.cjs +37 -0
- package/dist/commands/put.cjs.map +1 -1
- package/dist/commands/put.d.ts +50 -3
- package/dist/commands/put.mjs +37 -0
- package/dist/commands/put.mjs.map +1 -1
- package/dist/commands/query.cjs +35 -0
- package/dist/commands/query.cjs.map +1 -1
- package/dist/commands/query.d.ts +48 -3
- package/dist/commands/query.mjs +35 -0
- package/dist/commands/query.mjs.map +1 -1
- package/dist/commands/scan.cjs +33 -0
- package/dist/commands/scan.cjs.map +1 -1
- package/dist/commands/scan.d.ts +46 -3
- package/dist/commands/scan.mjs +33 -0
- package/dist/commands/scan.mjs.map +1 -1
- package/dist/commands/table-batch-get.cjs +123 -0
- package/dist/commands/table-batch-get.cjs.map +1 -0
- package/dist/commands/table-batch-get.d.ts +86 -0
- package/dist/commands/table-batch-get.mjs +121 -0
- package/dist/commands/table-batch-get.mjs.map +1 -0
- package/dist/commands/table-batch-write.cjs +119 -0
- package/dist/commands/table-batch-write.cjs.map +1 -0
- package/dist/commands/table-batch-write.d.ts +79 -0
- package/dist/commands/table-batch-write.mjs +117 -0
- package/dist/commands/table-batch-write.mjs.map +1 -0
- package/dist/commands/table-transact-get.cjs +73 -0
- package/dist/commands/table-transact-get.cjs.map +1 -0
- package/dist/commands/table-transact-get.d.ts +60 -0
- package/dist/commands/table-transact-get.mjs +71 -0
- package/dist/commands/table-transact-get.mjs.map +1 -0
- package/dist/commands/table-transact-write.cjs +76 -0
- package/dist/commands/table-transact-write.cjs.map +1 -0
- package/dist/commands/table-transact-write.d.ts +51 -0
- package/dist/commands/table-transact-write.mjs +74 -0
- package/dist/commands/table-transact-write.mjs.map +1 -0
- package/dist/commands/transact-get.cjs +38 -0
- package/dist/commands/transact-get.cjs.map +1 -1
- package/dist/commands/transact-get.d.ts +49 -3
- package/dist/commands/transact-get.mjs +39 -1
- package/dist/commands/transact-get.mjs.map +1 -1
- package/dist/commands/transact-write.cjs +37 -0
- package/dist/commands/transact-write.cjs.map +1 -1
- package/dist/commands/transact-write.d.ts +46 -1
- package/dist/commands/transact-write.mjs +37 -0
- package/dist/commands/transact-write.mjs.map +1 -1
- package/dist/commands/update.cjs +37 -0
- package/dist/commands/update.cjs.map +1 -1
- package/dist/commands/update.d.ts +50 -3
- package/dist/commands/update.mjs +37 -0
- package/dist/commands/update.mjs.map +1 -1
- package/dist/conditions/and.cjs +3 -0
- package/dist/conditions/and.cjs.map +1 -1
- package/dist/conditions/and.d.ts +4 -1
- package/dist/conditions/and.mjs +3 -0
- package/dist/conditions/and.mjs.map +1 -1
- package/dist/conditions/begins-with.cjs +3 -0
- package/dist/conditions/begins-with.cjs.map +1 -1
- package/dist/conditions/begins-with.d.ts +4 -1
- package/dist/conditions/begins-with.mjs +3 -0
- package/dist/conditions/begins-with.mjs.map +1 -1
- package/dist/conditions/between.cjs +3 -0
- package/dist/conditions/between.cjs.map +1 -1
- package/dist/conditions/between.d.ts +4 -1
- package/dist/conditions/between.mjs +3 -0
- package/dist/conditions/between.mjs.map +1 -1
- package/dist/conditions/condition-parser.d.ts +1 -1
- package/dist/conditions/contains.cjs +3 -0
- package/dist/conditions/contains.cjs.map +1 -1
- package/dist/conditions/contains.d.ts +4 -1
- package/dist/conditions/contains.mjs +3 -0
- package/dist/conditions/contains.mjs.map +1 -1
- package/dist/conditions/equals.cjs +3 -0
- package/dist/conditions/equals.cjs.map +1 -1
- package/dist/conditions/equals.d.ts +4 -1
- package/dist/conditions/equals.mjs +3 -0
- package/dist/conditions/equals.mjs.map +1 -1
- package/dist/conditions/exists.cjs +3 -0
- package/dist/conditions/exists.cjs.map +1 -1
- package/dist/conditions/exists.d.ts +4 -1
- package/dist/conditions/exists.mjs +3 -0
- package/dist/conditions/exists.mjs.map +1 -1
- package/dist/conditions/greater-than-or-equal.cjs +3 -0
- package/dist/conditions/greater-than-or-equal.cjs.map +1 -1
- package/dist/conditions/greater-than-or-equal.d.ts +4 -1
- package/dist/conditions/greater-than-or-equal.mjs +3 -0
- package/dist/conditions/greater-than-or-equal.mjs.map +1 -1
- package/dist/conditions/greater-than.cjs +3 -0
- package/dist/conditions/greater-than.cjs.map +1 -1
- package/dist/conditions/greater-than.d.ts +4 -1
- package/dist/conditions/greater-than.mjs +3 -0
- package/dist/conditions/greater-than.mjs.map +1 -1
- package/dist/conditions/index.cjs +2 -2
- package/dist/conditions/index.d.ts +185 -2
- package/dist/conditions/index.mjs +1 -1
- package/dist/conditions/is-in.cjs +3 -0
- package/dist/conditions/is-in.cjs.map +1 -1
- package/dist/conditions/is-in.d.ts +4 -1
- package/dist/conditions/is-in.mjs +3 -0
- package/dist/conditions/is-in.mjs.map +1 -1
- package/dist/conditions/less-than-or-equal.cjs +3 -0
- package/dist/conditions/less-than-or-equal.cjs.map +1 -1
- package/dist/conditions/less-than-or-equal.d.ts +4 -1
- package/dist/conditions/less-than-or-equal.mjs +3 -0
- package/dist/conditions/less-than-or-equal.mjs.map +1 -1
- package/dist/conditions/less-than.cjs +3 -0
- package/dist/conditions/less-than.cjs.map +1 -1
- package/dist/conditions/less-than.d.ts +4 -1
- package/dist/conditions/less-than.mjs +3 -0
- package/dist/conditions/less-than.mjs.map +1 -1
- package/dist/conditions/not-equals.cjs +3 -0
- package/dist/conditions/not-equals.cjs.map +1 -1
- package/dist/conditions/not-equals.d.ts +4 -1
- package/dist/conditions/not-equals.mjs +3 -0
- package/dist/conditions/not-equals.mjs.map +1 -1
- package/dist/conditions/not-exists.cjs +3 -0
- package/dist/conditions/not-exists.cjs.map +1 -1
- package/dist/conditions/not-exists.d.ts +4 -1
- package/dist/conditions/not-exists.mjs +3 -0
- package/dist/conditions/not-exists.mjs.map +1 -1
- package/dist/conditions/not.cjs +3 -0
- package/dist/conditions/not.cjs.map +1 -1
- package/dist/conditions/not.d.ts +4 -1
- package/dist/conditions/not.mjs +3 -0
- package/dist/conditions/not.mjs.map +1 -1
- package/dist/conditions/or.cjs +3 -0
- package/dist/conditions/or.cjs.map +1 -1
- package/dist/conditions/or.d.ts +4 -1
- package/dist/conditions/or.mjs +3 -0
- package/dist/conditions/or.mjs.map +1 -1
- package/dist/conditions/size.cjs +3 -0
- package/dist/conditions/size.cjs.map +1 -1
- package/dist/conditions/size.d.ts +4 -1
- package/dist/conditions/size.mjs +3 -0
- package/dist/conditions/size.mjs.map +1 -1
- package/dist/conditions/type-is.cjs +3 -0
- package/dist/conditions/type-is.cjs.map +1 -1
- package/dist/conditions/type-is.d.ts +4 -1
- package/dist/conditions/type-is.mjs +3 -0
- package/dist/conditions/type-is.mjs.map +1 -1
- package/dist/core/entity.cjs +171 -0
- package/dist/core/entity.cjs.map +1 -1
- package/dist/core/entity.d.ts +99 -4
- package/dist/core/entity.mjs +171 -0
- package/dist/core/entity.mjs.map +1 -1
- package/dist/core/index.d.ts +139 -2
- package/dist/core/key.cjs +1 -1
- package/dist/core/key.cjs.map +1 -1
- package/dist/core/key.d.ts +26 -2
- package/dist/core/key.mjs +1 -1
- package/dist/core/key.mjs.map +1 -1
- package/dist/core/table.cjs +30 -0
- package/dist/core/table.cjs.map +1 -1
- package/dist/core/table.d.ts +40 -1
- package/dist/core/table.mjs +31 -1
- package/dist/core/table.mjs.map +1 -1
- package/dist/errors.cjs +3 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +3 -0
- package/dist/errors.mjs +3 -0
- package/dist/errors.mjs.map +1 -1
- package/dist/index.cjs +10 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +11 -7
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/dist/projections/index.d.ts +7 -1
- package/dist/projections/projection-parser.d.ts +1 -1
- package/dist/updates/add-to-set.cjs +5 -0
- package/dist/updates/add-to-set.cjs.map +1 -1
- package/dist/updates/add-to-set.d.ts +6 -1
- package/dist/updates/add-to-set.mjs +5 -0
- package/dist/updates/add-to-set.mjs.map +1 -1
- package/dist/updates/add.cjs +5 -0
- package/dist/updates/add.cjs.map +1 -1
- package/dist/updates/add.d.ts +6 -1
- package/dist/updates/add.mjs +5 -0
- package/dist/updates/add.mjs.map +1 -1
- package/dist/updates/append.cjs +5 -0
- package/dist/updates/append.cjs.map +1 -1
- package/dist/updates/append.d.ts +6 -1
- package/dist/updates/append.mjs +5 -0
- package/dist/updates/append.mjs.map +1 -1
- package/dist/updates/index.d.ts +78 -1
- package/dist/updates/prepend.cjs +5 -0
- package/dist/updates/prepend.cjs.map +1 -1
- package/dist/updates/prepend.d.ts +6 -1
- package/dist/updates/prepend.mjs +5 -0
- package/dist/updates/prepend.mjs.map +1 -1
- package/dist/updates/ref.cjs +6 -0
- package/dist/updates/ref.cjs.map +1 -1
- package/dist/updates/ref.d.ts +7 -1
- package/dist/updates/ref.mjs +6 -0
- package/dist/updates/ref.mjs.map +1 -1
- package/dist/updates/remove-from-set.cjs +5 -0
- package/dist/updates/remove-from-set.cjs.map +1 -1
- package/dist/updates/remove-from-set.d.ts +6 -1
- package/dist/updates/remove-from-set.mjs +5 -0
- package/dist/updates/remove-from-set.mjs.map +1 -1
- package/dist/updates/remove.cjs +3 -0
- package/dist/updates/remove.cjs.map +1 -1
- package/dist/updates/remove.d.ts +4 -1
- package/dist/updates/remove.mjs +3 -0
- package/dist/updates/remove.mjs.map +1 -1
- package/dist/updates/subtract.cjs +5 -0
- package/dist/updates/subtract.cjs.map +1 -1
- package/dist/updates/subtract.d.ts +6 -1
- package/dist/updates/subtract.mjs +5 -0
- package/dist/updates/subtract.mjs.map +1 -1
- package/dist/updates/update-parser.cjs +10 -0
- package/dist/updates/update-parser.cjs.map +1 -1
- package/dist/updates/update-parser.d.ts +17 -1
- package/dist/updates/update-parser.mjs +10 -0
- package/dist/updates/update-parser.mjs.map +1 -1
- package/package.json +2 -1
- package/dist/commands/base-command.cjs +0 -3
- package/dist/commands/base-command.cjs.map +0 -1
- package/dist/commands/base-command.d.ts +0 -27
- package/dist/commands/base-command.mjs +0 -2
- package/dist/commands/base-command.mjs.map +0 -1
- package/dist/conditions/condition-types.cjs +0 -3
- package/dist/conditions/condition-types.cjs.map +0 -1
- package/dist/conditions/condition-types.d.ts +0 -95
- package/dist/conditions/condition-types.mjs +0 -2
- package/dist/conditions/condition-types.mjs.map +0 -1
- package/dist/core/core-types.cjs +0 -3
- package/dist/core/core-types.cjs.map +0 -1
- package/dist/core/core-types.d.ts +0 -44
- package/dist/core/core-types.mjs +0 -2
- package/dist/core/core-types.mjs.map +0 -1
- package/dist/projections/projection-types.cjs +0 -3
- package/dist/projections/projection-types.cjs.map +0 -1
- package/dist/projections/projection-types.d.ts +0 -3
- package/dist/projections/projection-types.mjs +0 -2
- package/dist/projections/projection-types.mjs.map +0 -1
- package/dist/updates/update-types.cjs +0 -3
- package/dist/updates/update-types.cjs.map +0 -1
- package/dist/updates/update-types.d.ts +0 -45
- package/dist/updates/update-types.mjs +0 -2
- package/dist/updates/update-types.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-exists.mjs","sources":["../../src/conditions/not-exists.ts"],"sourcesContent":[null],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"not-exists.mjs","sources":["../../src/conditions/not-exists.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;;AAEG;SACa,SAAS,GAAA;IACvB,OAAO;AACL,QAAA,IAAI,EAAE,OAAO;AACb,QAAA,GAAG,EAAE,IAAI;KACV;AACH;;;;"}
|
package/dist/conditions/not.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not.cjs","sources":["../../src/conditions/not.ts"],"sourcesContent":[null],"names":["$not"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"not.cjs","sources":["../../src/conditions/not.ts"],"sourcesContent":[null],"names":["$not"],"mappings":";;;;AAGA;;AAEG;AACG,SAAU,GAAG,CAAC,SAAsC,EAAA;IACxD,OAAO;AACL,QAAA,IAAI,EAAEA,gCAAI;QACV,SAAS;KACV;AACH;;;;"}
|
package/dist/conditions/not.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { ConditionExpressionTemplate, NotExpression } from './
|
|
1
|
+
import { ConditionExpressionTemplate, NotExpression } from './index.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Creates a NOT expression template that negates a given condition expression.
|
|
5
|
+
*/
|
|
3
6
|
declare function not(condition: ConditionExpressionTemplate): NotExpression;
|
|
4
7
|
|
|
5
8
|
export { not };
|
package/dist/conditions/not.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not.mjs","sources":["../../src/conditions/not.ts"],"sourcesContent":[null],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"not.mjs","sources":["../../src/conditions/not.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;;AAEG;AACG,SAAU,GAAG,CAAC,SAAsC,EAAA;IACxD,OAAO;AACL,QAAA,IAAI,EAAE,IAAI;QACV,SAAS;KACV;AACH;;;;"}
|
package/dist/conditions/or.cjs
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var conditions_conditionSymbols = require('./condition-symbols.cjs');
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Creates an OR logical expression template that combines multiple condition expressions.
|
|
7
|
+
*/
|
|
5
8
|
function or(firstCondition, secondCondition, ...additionalConditions) {
|
|
6
9
|
return {
|
|
7
10
|
type: conditions_conditionSymbols.$logical,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"or.cjs","sources":["../../src/conditions/or.ts"],"sourcesContent":[null],"names":["$logical"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"or.cjs","sources":["../../src/conditions/or.ts"],"sourcesContent":[null],"names":["$logical"],"mappings":";;;;AAGA;;AAEG;AACG,SAAU,EAAE,CAChB,cAA2C,EAC3C,eAA4C,EAC5C,GAAG,oBAAmD,EAAA;IAEtD,OAAO;AACL,QAAA,IAAI,EAAEA,oCAAQ;AACd,QAAA,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,GAAG,oBAAoB,CAAC;KAC1E;AACH;;;;"}
|
package/dist/conditions/or.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { ConditionExpressionTemplate, LogicalExpression } from './
|
|
1
|
+
import { ConditionExpressionTemplate, LogicalExpression } from './index.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Creates an OR logical expression template that combines multiple condition expressions.
|
|
5
|
+
*/
|
|
3
6
|
declare function or(firstCondition: ConditionExpressionTemplate, secondCondition: ConditionExpressionTemplate, ...additionalConditions: ConditionExpressionTemplate[]): LogicalExpression;
|
|
4
7
|
|
|
5
8
|
export { or };
|
package/dist/conditions/or.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"or.mjs","sources":["../../src/conditions/or.ts"],"sourcesContent":[null],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"or.mjs","sources":["../../src/conditions/or.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;;AAEG;AACG,SAAU,EAAE,CAChB,cAA2C,EAC3C,eAA4C,EAC5C,GAAG,oBAAmD,EAAA;IAEtD,OAAO;AACL,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,GAAG,oBAAoB,CAAC;KAC1E;AACH;;;;"}
|
package/dist/conditions/size.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"size.cjs","sources":["../../src/conditions/size.ts"],"sourcesContent":[null],"names":["$size"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"size.cjs","sources":["../../src/conditions/size.ts"],"sourcesContent":[null],"names":["$size"],"mappings":";;;;AAGA;;AAEG;AACG,SAAU,IAAI,CAClB,iBAAwD,EAAA;AAExD,IAAA,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE;QACzC,OAAO;AACL,YAAA,IAAI,EAAEA,iCAAK;AACX,YAAA,QAAQ,EAAE,GAAG;AACb,YAAA,KAAK,EAAE,iBAAiB;SACzB;IACH;IAEA,OAAO;AACL,QAAA,IAAI,EAAEA,iCAAK;QACX,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;QACpC,KAAK,EAAE,iBAAiB,CAAC,KAAK;KAC/B;AACH;;;;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { ComparisonExpressionTemplate, SizeConditionExpressionTemplate } from './
|
|
1
|
+
import { ComparisonExpressionTemplate, SizeConditionExpressionTemplate } from './index.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Creates a SIZE condition expression template.
|
|
5
|
+
*/
|
|
3
6
|
declare function size(valueOrComparison: number | ComparisonExpressionTemplate): SizeConditionExpressionTemplate;
|
|
4
7
|
|
|
5
8
|
export { size };
|
package/dist/conditions/size.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"size.mjs","sources":["../../src/conditions/size.ts"],"sourcesContent":[null],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"size.mjs","sources":["../../src/conditions/size.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;;AAEG;AACG,SAAU,IAAI,CAClB,iBAAwD,EAAA;AAExD,IAAA,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE;QACzC,OAAO;AACL,YAAA,IAAI,EAAE,KAAK;AACX,YAAA,QAAQ,EAAE,GAAG;AACb,YAAA,KAAK,EAAE,iBAAiB;SACzB;IACH;IAEA,OAAO;AACL,QAAA,IAAI,EAAE,KAAK;QACX,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;QACpC,KAAK,EAAE,iBAAiB,CAAC,KAAK;KAC/B;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-is.cjs","sources":["../../src/conditions/type-is.ts"],"sourcesContent":[null],"names":["$type"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"type-is.cjs","sources":["../../src/conditions/type-is.ts"],"sourcesContent":[null],"names":["$type"],"mappings":";;;;AAGA;;AAEG;AACG,SAAU,MAAM,CAAC,IAAyB,EAAA;IAC9C,OAAO;AACL,QAAA,IAAI,EAAEA,iCAAK;AACX,QAAA,aAAa,EAAE,IAAI;KACpB;AACH;;;;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { DynamoAttributeType, TypeCheckExpressionTemplate } from './
|
|
1
|
+
import { DynamoAttributeType, TypeCheckExpressionTemplate } from './index.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Creates a type check expression template for the specified DynamoDB attribute type.
|
|
5
|
+
*/
|
|
3
6
|
declare function typeIs(type: DynamoAttributeType): TypeCheckExpressionTemplate;
|
|
4
7
|
|
|
5
8
|
export { typeIs };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-is.mjs","sources":["../../src/conditions/type-is.ts"],"sourcesContent":[null],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"type-is.mjs","sources":["../../src/conditions/type-is.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;;AAEG;AACG,SAAU,MAAM,CAAC,IAAyB,EAAA;IAC9C,OAAO;AACL,QAAA,IAAI,EAAE,KAAK;AACX,QAAA,aAAa,EAAE,IAAI;KACpB;AACH;;;;"}
|
package/dist/core/entity.cjs
CHANGED
|
@@ -4,6 +4,11 @@ var tslib_es6 = require('../node_modules/tslib/tslib.es6.cjs');
|
|
|
4
4
|
var errors = require('../errors.cjs');
|
|
5
5
|
|
|
6
6
|
var _DynamoEntity_table, _DynamoEntity_schema, _DynamoEntity_pk, _DynamoEntity_sk, _DynamoEntity_gsi, _DynamoEntity_lsi;
|
|
7
|
+
/**
|
|
8
|
+
* Core class that represents a DynamoDB entity.
|
|
9
|
+
*
|
|
10
|
+
* @template Schema - The Zod schema representing the entity's structure.
|
|
11
|
+
*/
|
|
7
12
|
class DynamoEntity {
|
|
8
13
|
constructor(config) {
|
|
9
14
|
var _a, _b;
|
|
@@ -20,26 +25,46 @@ class DynamoEntity {
|
|
|
20
25
|
tslib_es6.__classPrivateFieldSet(this, _DynamoEntity_gsi, (_a = config.globalSecondaryIndexes) !== null && _a !== void 0 ? _a : {}, "f");
|
|
21
26
|
tslib_es6.__classPrivateFieldSet(this, _DynamoEntity_lsi, (_b = config.localSecondaryIndexes) !== null && _b !== void 0 ? _b : {}, "f");
|
|
22
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Gets the DynamoDB table associated with this entity.
|
|
30
|
+
*/
|
|
23
31
|
get table() {
|
|
24
32
|
return tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_table, "f");
|
|
25
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Gets the Zod schema defining the structure of this entity.
|
|
36
|
+
*/
|
|
26
37
|
get schema() {
|
|
27
38
|
return tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_schema, "f");
|
|
28
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Gets the key builders for the secondary indexes defined on this entity.
|
|
42
|
+
*/
|
|
29
43
|
get secondaryIndexKeyBuilders() {
|
|
30
44
|
return {
|
|
31
45
|
gsi: tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_gsi, "f"),
|
|
32
46
|
lsi: tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_lsi, "f"),
|
|
33
47
|
};
|
|
34
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Builds the partition key for the given item using the entity's partition key builder.
|
|
51
|
+
*/
|
|
35
52
|
buildPartitionKey(item) {
|
|
36
53
|
var _a;
|
|
37
54
|
return (_a = tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_pk, "f")) === null || _a === void 0 ? void 0 : _a.call(this, item);
|
|
38
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Builds the sort key for the given item using the entity's sort key builder.
|
|
58
|
+
*/
|
|
39
59
|
buildSortKey(item) {
|
|
40
60
|
var _a;
|
|
41
61
|
return (_a = tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_sk, "f")) === null || _a === void 0 ? void 0 : _a.call(this, item);
|
|
42
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Builds the primary key for the given item, including both partition and sort keys if defined.
|
|
65
|
+
*
|
|
66
|
+
* If the entity does not have partition or sort key builders defined, the item is returned as-is.
|
|
67
|
+
*/
|
|
43
68
|
buildPrimaryKey(item) {
|
|
44
69
|
if (!tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_pk, "f") && !tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_sk, "f")) {
|
|
45
70
|
return item;
|
|
@@ -59,6 +84,12 @@ class DynamoEntity {
|
|
|
59
84
|
}
|
|
60
85
|
return key;
|
|
61
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Builds the key for a global secondary index for the given item.
|
|
89
|
+
*
|
|
90
|
+
* If the specified index does not exist or its key builders are not defined,
|
|
91
|
+
* the item is returned as-is.
|
|
92
|
+
*/
|
|
62
93
|
buildGlobalSecondaryIndexKey(indexName, item) {
|
|
63
94
|
const gsiKeyBuilder = tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_gsi, "f")[indexName];
|
|
64
95
|
const gsiKeyNames = this.table.globalSecondaryIndexKeyNames[indexName];
|
|
@@ -83,6 +114,12 @@ class DynamoEntity {
|
|
|
83
114
|
}
|
|
84
115
|
return key;
|
|
85
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Builds the key for a local secondary index for the given item.
|
|
119
|
+
*
|
|
120
|
+
* If the specified index does not exist or its key builders are not defined,
|
|
121
|
+
* the item is returned as-is.
|
|
122
|
+
*/
|
|
86
123
|
buildLocalSecondaryIndexKey(indexName, item) {
|
|
87
124
|
const lsiKeyBuilder = tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_lsi, "f")[indexName];
|
|
88
125
|
const lsiKeyNames = this.table.localSecondaryIndexKeyNames[indexName];
|
|
@@ -98,6 +135,17 @@ class DynamoEntity {
|
|
|
98
135
|
}
|
|
99
136
|
return key;
|
|
100
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* Builds either a primary key or a secondary index key based on the provided input.
|
|
140
|
+
*
|
|
141
|
+
* If the input contains a `key`, the primary key is built.
|
|
142
|
+
* If the input contains an `index`, the corresponding secondary index key is built.
|
|
143
|
+
*
|
|
144
|
+
* Works similarly to the other key building methods and will pass-through the key or index
|
|
145
|
+
* input if the entity does not have the necessary key builders defined.
|
|
146
|
+
*
|
|
147
|
+
* @throws DocumentBuilderError if the index name is missing or not defined on the entity.
|
|
148
|
+
*/
|
|
101
149
|
buildPrimaryOrIndexKey(keyInput) {
|
|
102
150
|
if ('key' in keyInput) {
|
|
103
151
|
return this.buildPrimaryKey(keyInput.key);
|
|
@@ -118,6 +166,9 @@ class DynamoEntity {
|
|
|
118
166
|
}
|
|
119
167
|
throw new errors.DocumentBuilderError(`Index "${indexName}" is not defined on entity`);
|
|
120
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* Builds all keys (primary and secondary index keys) for the given item.
|
|
171
|
+
*/
|
|
121
172
|
buildAllKeys(item) {
|
|
122
173
|
const allKeys = this.buildPrimaryKey(item);
|
|
123
174
|
for (const indexName of Object.keys(tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_gsi, "f"))) {
|
|
@@ -128,11 +179,17 @@ class DynamoEntity {
|
|
|
128
179
|
}
|
|
129
180
|
return allKeys;
|
|
130
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Sends a command to be executed against this entity's table.
|
|
184
|
+
*/
|
|
131
185
|
send(command) {
|
|
132
186
|
return tslib_es6.__awaiter(this, void 0, void 0, function* () {
|
|
133
187
|
return yield command.execute(this);
|
|
134
188
|
});
|
|
135
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* Paginates through results of a paginatable command for this entity's table.
|
|
192
|
+
*/
|
|
136
193
|
paginate(paginatable) {
|
|
137
194
|
return tslib_es6.__asyncGenerator(this, arguments, function* paginate_1() {
|
|
138
195
|
var _a, e_1, _b, _c;
|
|
@@ -153,6 +210,120 @@ class DynamoEntity {
|
|
|
153
210
|
}
|
|
154
211
|
});
|
|
155
212
|
}
|
|
213
|
+
prepare(input) {
|
|
214
|
+
var _a;
|
|
215
|
+
// WriteTransactable[] — array of transact write operations
|
|
216
|
+
if (Array.isArray(input)) {
|
|
217
|
+
return {
|
|
218
|
+
entity: this,
|
|
219
|
+
writes: input,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
// BatchWritePreparable — has items and/or deletes, no keys
|
|
223
|
+
if ('items' in input || ('deletes' in input && !('keys' in input))) {
|
|
224
|
+
const batchWrite = input;
|
|
225
|
+
return {
|
|
226
|
+
entity: this,
|
|
227
|
+
buildRequests: (skipValidation, abortSignal) => tslib_es6.__awaiter(this, void 0, void 0, function* () {
|
|
228
|
+
const putRequests = [];
|
|
229
|
+
const deleteRequests = [];
|
|
230
|
+
if (batchWrite.items && batchWrite.items.length > 0) {
|
|
231
|
+
for (const item of batchWrite.items) {
|
|
232
|
+
if (skipValidation) {
|
|
233
|
+
putRequests.push({
|
|
234
|
+
PutRequest: {
|
|
235
|
+
Item: Object.assign(Object.assign({}, item), this.buildAllKeys(item)),
|
|
236
|
+
},
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
const encodedData = yield tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_schema, "f").encodeAsync(item);
|
|
241
|
+
putRequests.push({
|
|
242
|
+
PutRequest: {
|
|
243
|
+
Item: Object.assign(Object.assign({}, encodedData), this.buildAllKeys(item)),
|
|
244
|
+
},
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (batchWrite.deletes && batchWrite.deletes.length > 0) {
|
|
250
|
+
for (const deleteKey of batchWrite.deletes) {
|
|
251
|
+
deleteRequests.push({
|
|
252
|
+
DeleteRequest: {
|
|
253
|
+
Key: this.buildPrimaryKey(deleteKey),
|
|
254
|
+
},
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return [...putRequests, ...deleteRequests];
|
|
259
|
+
}),
|
|
260
|
+
matchUnprocessedPut: (item) => {
|
|
261
|
+
if (!batchWrite.items)
|
|
262
|
+
return undefined;
|
|
263
|
+
const itemPrimaryKey = this.buildPrimaryKey(item);
|
|
264
|
+
return batchWrite.items.find(original => {
|
|
265
|
+
const originalKey = this.buildPrimaryKey(original);
|
|
266
|
+
return JSON.stringify(originalKey) === JSON.stringify(itemPrimaryKey);
|
|
267
|
+
});
|
|
268
|
+
},
|
|
269
|
+
matchUnprocessedDelete: (key) => {
|
|
270
|
+
if (!batchWrite.deletes)
|
|
271
|
+
return undefined;
|
|
272
|
+
const keyStr = JSON.stringify(key);
|
|
273
|
+
return batchWrite.deletes.find(original => {
|
|
274
|
+
const originalKey = this.buildPrimaryKey(original);
|
|
275
|
+
return JSON.stringify(originalKey) === keyStr;
|
|
276
|
+
});
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
// BatchGetPreparable — has keys as entity partials plus consistent flag
|
|
281
|
+
if ('consistent' in input) {
|
|
282
|
+
const batchGet = input;
|
|
283
|
+
const builtKeys = batchGet.keys.map(k => this.buildPrimaryKey(k));
|
|
284
|
+
return {
|
|
285
|
+
entity: this,
|
|
286
|
+
keys: builtKeys,
|
|
287
|
+
consistent: (_a = batchGet.consistent) !== null && _a !== void 0 ? _a : false,
|
|
288
|
+
matchItem: (item) => {
|
|
289
|
+
const itemKey = this.buildPrimaryKey(item);
|
|
290
|
+
const itemKeyStr = JSON.stringify(itemKey);
|
|
291
|
+
return builtKeys.some(k => JSON.stringify(k) === itemKeyStr);
|
|
292
|
+
},
|
|
293
|
+
parseResults: (items, skipValidation) => tslib_es6.__awaiter(this, void 0, void 0, function* () {
|
|
294
|
+
return yield Promise.all(items.map((item) => tslib_es6.__awaiter(this, void 0, void 0, function* () {
|
|
295
|
+
if (skipValidation)
|
|
296
|
+
return item;
|
|
297
|
+
return yield tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_schema, "f").parseAsync(item);
|
|
298
|
+
})));
|
|
299
|
+
}),
|
|
300
|
+
matchUnprocessedKey: (key) => {
|
|
301
|
+
const keyStr = JSON.stringify(key);
|
|
302
|
+
return batchGet.keys.find(original => {
|
|
303
|
+
const originalKey = this.buildPrimaryKey(original);
|
|
304
|
+
return JSON.stringify(originalKey) === keyStr;
|
|
305
|
+
});
|
|
306
|
+
},
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
// GetTransactable — has keys as entity partials, no consistent flag
|
|
310
|
+
return {
|
|
311
|
+
entity: this,
|
|
312
|
+
keys: input.keys.map(key => ({
|
|
313
|
+
TableName: tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_table, "f").tableName,
|
|
314
|
+
Key: this.buildPrimaryKey(key),
|
|
315
|
+
})),
|
|
316
|
+
parseResults: (items, skipValidation) => tslib_es6.__awaiter(this, void 0, void 0, function* () {
|
|
317
|
+
return yield Promise.all(items.map((item) => tslib_es6.__awaiter(this, void 0, void 0, function* () {
|
|
318
|
+
if (item === undefined || item === null)
|
|
319
|
+
return undefined;
|
|
320
|
+
if (skipValidation)
|
|
321
|
+
return item;
|
|
322
|
+
return yield tslib_es6.__classPrivateFieldGet(this, _DynamoEntity_schema, "f").parseAsync(item);
|
|
323
|
+
})));
|
|
324
|
+
}),
|
|
325
|
+
};
|
|
326
|
+
}
|
|
156
327
|
}
|
|
157
328
|
_DynamoEntity_table = new WeakMap(), _DynamoEntity_schema = new WeakMap(), _DynamoEntity_pk = new WeakMap(), _DynamoEntity_sk = new WeakMap(), _DynamoEntity_gsi = new WeakMap(), _DynamoEntity_lsi = new WeakMap();
|
|
158
329
|
|
package/dist/core/entity.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.cjs","sources":["../../src/core/entity.ts"],"sourcesContent":[null],"names":["__classPrivateFieldSet","__classPrivateFieldGet","DocumentBuilderError","__asyncValues","__await"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"entity.cjs","sources":["../../src/core/entity.ts"],"sourcesContent":[null],"names":["__classPrivateFieldSet","__classPrivateFieldGet","DocumentBuilderError","__asyncValues","__await","__awaiter"],"mappings":";;;;;;AA8DA;;;;AAIG;MACU,YAAY,CAAA;AAUvB,IAAA,WAAA,CAAY,MAAkC,EAAA;;QAT9C,mBAAA,CAAA,GAAA,CAAA,IAAA,EAAA,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AAI,EAAA,oBAAA,EAAA,GAAA,CAAQ,CAAC,UAAU,CAAC,IAAI,CAAC;gBAC5C,CAAC,CAAA,CAAC,CACH;AACH,YAAA,CAAC,CAAA;SACuC;IAC5C;AACD;;;;;"}
|
package/dist/core/entity.d.ts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import { BaseCommand, BasePaginatable } from '../commands/
|
|
1
|
+
import { BaseCommand, BasePaginatable, WriteTransactable, PreparedWriteTransaction, BatchWritePreparable, PreparedBatchWrite, BatchGetPreparable, PreparedBatchGet, GetTransactable, PreparedGetTransaction } from '../commands/index.js';
|
|
2
2
|
import { DynamoKeyBuilder, GlobalSecondaryIndexKeyBuilders, LocalSecondaryIndexKeyBuilders, DynamoKeyableValue, DynamoKey, DynamoIndexKey } from './key.js';
|
|
3
3
|
import { DynamoTable } from './table.js';
|
|
4
4
|
import { ZodObject } from 'zod/v4';
|
|
5
|
-
import { EntitySchema } from './
|
|
5
|
+
import { EntitySchema, IndexName } from './index.js';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Configuration type for creating a DynamoEntity.
|
|
9
|
+
*
|
|
10
|
+
* @template Schema - The Zod schema representing the entity's structure.
|
|
11
|
+
*
|
|
12
|
+
* @property table - The DynamoTable instance associated with the entity.
|
|
13
|
+
* @property schema - The Zod schema defining the entity's structure.
|
|
14
|
+
* @property partitionKey - Key builder function to build the partition key from an entity item.
|
|
15
|
+
* @property sortKey - Key builder function to build the sort key from an entity item.
|
|
16
|
+
* @property globalSecondaryIndexes - Mapping of global secondary index names to their key builders.
|
|
17
|
+
* @property localSecondaryIndexes - Mapping of local secondary index names to their key builders.
|
|
18
|
+
*/
|
|
7
19
|
type DynamoEntityConfig<Schema extends ZodObject> = {
|
|
8
20
|
table: DynamoTable;
|
|
9
21
|
schema: Schema;
|
|
@@ -12,6 +24,12 @@ type DynamoEntityConfig<Schema extends ZodObject> = {
|
|
|
12
24
|
globalSecondaryIndexes?: GlobalSecondaryIndexKeyBuilders<EntitySchema<Schema>>;
|
|
13
25
|
localSecondaryIndexes?: LocalSecondaryIndexKeyBuilders<EntitySchema<Schema>>;
|
|
14
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* Input type for building *either* a DynamoDB primary key or secondary index key.
|
|
29
|
+
*
|
|
30
|
+
* This is used in cases where the user may want to specify either a full primary key
|
|
31
|
+
* or a secondary index key to identify an item.
|
|
32
|
+
*/
|
|
15
33
|
type EntityKeyInput<Item> = {
|
|
16
34
|
key: Partial<Item>;
|
|
17
35
|
} | {
|
|
@@ -19,24 +37,101 @@ type EntityKeyInput<Item> = {
|
|
|
19
37
|
[index: IndexName]: Partial<Item>;
|
|
20
38
|
};
|
|
21
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* Core class that represents a DynamoDB entity.
|
|
42
|
+
*
|
|
43
|
+
* @template Schema - The Zod schema representing the entity's structure.
|
|
44
|
+
*/
|
|
22
45
|
declare class DynamoEntity<Schema extends ZodObject> {
|
|
23
46
|
#private;
|
|
24
47
|
constructor(config: DynamoEntityConfig<Schema>);
|
|
48
|
+
/**
|
|
49
|
+
* Gets the DynamoDB table associated with this entity.
|
|
50
|
+
*/
|
|
25
51
|
get table(): DynamoTable;
|
|
52
|
+
/**
|
|
53
|
+
* Gets the Zod schema defining the structure of this entity.
|
|
54
|
+
*/
|
|
26
55
|
get schema(): Schema;
|
|
56
|
+
/**
|
|
57
|
+
* Gets the key builders for the secondary indexes defined on this entity.
|
|
58
|
+
*/
|
|
27
59
|
get secondaryIndexKeyBuilders(): {
|
|
28
60
|
gsi: GlobalSecondaryIndexKeyBuilders<EntitySchema<Schema>>;
|
|
29
61
|
lsi: LocalSecondaryIndexKeyBuilders<EntitySchema<Schema>>;
|
|
30
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* Builds the partition key for the given item using the entity's partition key builder.
|
|
65
|
+
*/
|
|
31
66
|
buildPartitionKey(item: Partial<EntitySchema<Schema>>): DynamoKeyableValue | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Builds the sort key for the given item using the entity's sort key builder.
|
|
69
|
+
*/
|
|
32
70
|
buildSortKey(item: Partial<EntitySchema<Schema>>): DynamoKeyableValue | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Builds the primary key for the given item, including both partition and sort keys if defined.
|
|
73
|
+
*
|
|
74
|
+
* If the entity does not have partition or sort key builders defined, the item is returned as-is.
|
|
75
|
+
*/
|
|
33
76
|
buildPrimaryKey(item: Partial<EntitySchema<Schema>>): DynamoKey;
|
|
34
|
-
|
|
35
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Builds the key for a global secondary index for the given item.
|
|
79
|
+
*
|
|
80
|
+
* If the specified index does not exist or its key builders are not defined,
|
|
81
|
+
* the item is returned as-is.
|
|
82
|
+
*/
|
|
83
|
+
buildGlobalSecondaryIndexKey(indexName: IndexName, item: Partial<EntitySchema<Schema>>): DynamoIndexKey;
|
|
84
|
+
/**
|
|
85
|
+
* Builds the key for a local secondary index for the given item.
|
|
86
|
+
*
|
|
87
|
+
* If the specified index does not exist or its key builders are not defined,
|
|
88
|
+
* the item is returned as-is.
|
|
89
|
+
*/
|
|
90
|
+
buildLocalSecondaryIndexKey(indexName: IndexName, item: Partial<EntitySchema<Schema>>): DynamoIndexKey;
|
|
91
|
+
/**
|
|
92
|
+
* Builds either a primary key or a secondary index key based on the provided input.
|
|
93
|
+
*
|
|
94
|
+
* If the input contains a `key`, the primary key is built.
|
|
95
|
+
* If the input contains an `index`, the corresponding secondary index key is built.
|
|
96
|
+
*
|
|
97
|
+
* Works similarly to the other key building methods and will pass-through the key or index
|
|
98
|
+
* input if the entity does not have the necessary key builders defined.
|
|
99
|
+
*
|
|
100
|
+
* @throws DocumentBuilderError if the index name is missing or not defined on the entity.
|
|
101
|
+
*/
|
|
36
102
|
buildPrimaryOrIndexKey(keyInput: EntityKeyInput<EntitySchema<Schema>>): DynamoKey | DynamoIndexKey;
|
|
103
|
+
/**
|
|
104
|
+
* Builds all keys (primary and secondary index keys) for the given item.
|
|
105
|
+
*/
|
|
37
106
|
buildAllKeys(item: Partial<EntitySchema<Schema>>): DynamoKey;
|
|
107
|
+
/**
|
|
108
|
+
* Sends a command to be executed against this entity's table.
|
|
109
|
+
*/
|
|
38
110
|
send<CommandOutput>(command: BaseCommand<CommandOutput, Schema>): Promise<CommandOutput>;
|
|
111
|
+
/**
|
|
112
|
+
* Paginates through results of a paginatable command for this entity's table.
|
|
113
|
+
*/
|
|
39
114
|
paginate<CommandOutput>(paginatable: BasePaginatable<CommandOutput, Schema>): AsyncGenerator<CommandOutput, void, unknown>;
|
|
115
|
+
/**
|
|
116
|
+
* Prepares a set of write operations bound to this entity for use in a table-level
|
|
117
|
+
* `TableTransactWrite` command.
|
|
118
|
+
*/
|
|
119
|
+
prepare(writes: WriteTransactable<Schema>[]): PreparedWriteTransaction<Schema>;
|
|
120
|
+
/**
|
|
121
|
+
* Prepares a batch write command bound to this entity for use in a table-level
|
|
122
|
+
* `TableBatchWrite` command.
|
|
123
|
+
*/
|
|
124
|
+
prepare(batchWrite: BatchWritePreparable<Schema>): PreparedBatchWrite<Schema>;
|
|
125
|
+
/**
|
|
126
|
+
* Prepares a batch get command bound to this entity for use in a table-level
|
|
127
|
+
* `TableBatchGet` command.
|
|
128
|
+
*/
|
|
129
|
+
prepare(batchGet: BatchGetPreparable<Schema>): PreparedBatchGet<Schema>;
|
|
130
|
+
/**
|
|
131
|
+
* Prepares a get command bound to this entity for use in a table-level
|
|
132
|
+
* `TableTransactGet` command.
|
|
133
|
+
*/
|
|
134
|
+
prepare(get: GetTransactable<Schema>): PreparedGetTransaction<Schema>;
|
|
40
135
|
}
|
|
41
136
|
|
|
42
137
|
export { DynamoEntity };
|