@infra-blocks/aws-dynamodb 0.64.0 → 0.65.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/lib/cjs/commands/expressions/condition/comparisons/between.d.ts +28 -0
- package/lib/cjs/commands/expressions/condition/comparisons/between.js +31 -0
- package/lib/cjs/commands/expressions/condition/comparisons/between.js.map +1 -0
- package/lib/cjs/commands/expressions/condition/comparisons/binary.d.ts +4 -0
- package/lib/cjs/commands/expressions/condition/comparisons/binary.js +11 -0
- package/lib/cjs/commands/expressions/condition/comparisons/binary.js.map +1 -0
- package/lib/cjs/commands/expressions/condition/comparisons/equals.d.ts +20 -0
- package/lib/cjs/commands/expressions/condition/comparisons/equals.js +25 -0
- package/lib/cjs/commands/expressions/condition/comparisons/equals.js.map +1 -0
- package/lib/cjs/commands/expressions/condition/comparisons/greater-than-or-equals.d.ts +24 -0
- package/lib/cjs/commands/expressions/condition/comparisons/greater-than-or-equals.js +25 -0
- package/lib/cjs/commands/expressions/condition/comparisons/greater-than-or-equals.js.map +1 -0
- package/lib/cjs/commands/expressions/condition/comparisons/greater-than.d.ts +20 -0
- package/lib/cjs/commands/expressions/condition/comparisons/greater-than.js +25 -0
- package/lib/cjs/commands/expressions/condition/comparisons/greater-than.js.map +1 -0
- package/lib/cjs/commands/expressions/condition/comparisons/in.d.ts +22 -0
- package/lib/cjs/commands/expressions/condition/comparisons/in.js +42 -0
- package/lib/cjs/commands/expressions/condition/comparisons/in.js.map +1 -0
- package/lib/cjs/commands/expressions/condition/comparisons/index.d.ts +9 -0
- package/lib/cjs/commands/expressions/condition/comparisons/index.js +26 -0
- package/lib/cjs/commands/expressions/condition/comparisons/index.js.map +1 -0
- package/lib/cjs/commands/expressions/condition/comparisons/lower-than-or-equals.d.ts +24 -0
- package/lib/cjs/commands/expressions/condition/comparisons/lower-than-or-equals.js +25 -0
- package/lib/cjs/commands/expressions/condition/comparisons/lower-than-or-equals.js.map +1 -0
- package/lib/cjs/commands/expressions/condition/comparisons/lower-than.d.ts +20 -0
- package/lib/cjs/commands/expressions/condition/comparisons/lower-than.js +25 -0
- package/lib/cjs/commands/expressions/condition/comparisons/lower-than.js.map +1 -0
- package/lib/cjs/commands/expressions/condition/comparisons/not-equals.d.ts +20 -0
- package/lib/cjs/commands/expressions/condition/comparisons/not-equals.js +25 -0
- package/lib/cjs/commands/expressions/condition/comparisons/not-equals.js.map +1 -0
- package/lib/cjs/commands/expressions/condition/comparisons/operand.d.ts +4 -0
- package/lib/cjs/commands/expressions/condition/comparisons/operand.js +3 -0
- package/lib/cjs/commands/expressions/condition/comparisons/operand.js.map +1 -0
- package/lib/cjs/commands/expressions/condition/condition-comparison.d.ts +15 -0
- package/lib/cjs/commands/expressions/condition/condition-comparison.js +54 -0
- package/lib/cjs/commands/expressions/condition/condition-comparison.js.map +1 -0
- package/lib/cjs/commands/expressions/condition/condition.d.ts +10 -9
- package/lib/cjs/commands/expressions/condition/condition.js +10 -9
- package/lib/cjs/commands/expressions/condition/condition.js.map +1 -1
- package/lib/cjs/commands/expressions/condition/index.d.ts +2 -3
- package/lib/cjs/commands/expressions/condition/index.js +0 -2
- package/lib/cjs/commands/expressions/condition/index.js.map +1 -1
- package/lib/cjs/commands/expressions/condition/logic.d.ts +12 -8
- package/lib/cjs/commands/expressions/condition/logic.js +20 -30
- package/lib/cjs/commands/expressions/condition/logic.js.map +1 -1
- package/lib/cjs/commands/expressions/condition/operand.d.ts +8 -0
- package/lib/cjs/commands/expressions/condition/operand.js +15 -0
- package/lib/cjs/commands/expressions/condition/operand.js.map +1 -0
- package/lib/cjs/commands/expressions/expression.d.ts +8 -6
- package/lib/cjs/commands/expressions/expression.js +8 -0
- package/lib/cjs/commands/expressions/expression.js.map +1 -1
- package/lib/cjs/commands/expressions/functions/attribute-exists.d.ts +13 -0
- package/lib/cjs/commands/expressions/functions/attribute-exists.js +19 -0
- package/lib/cjs/commands/expressions/functions/attribute-exists.js.map +1 -0
- package/lib/cjs/commands/expressions/functions/attribute-not-exists.d.ts +13 -0
- package/lib/cjs/commands/expressions/functions/attribute-not-exists.js +19 -0
- package/lib/cjs/commands/expressions/functions/attribute-not-exists.js.map +1 -0
- package/lib/cjs/commands/expressions/functions/attribute-type.d.ts +17 -0
- package/lib/cjs/commands/expressions/functions/attribute-type.js +23 -0
- package/lib/cjs/commands/expressions/functions/attribute-type.js.map +1 -0
- package/lib/cjs/commands/expressions/functions/begins-with.d.ts +24 -0
- package/lib/cjs/commands/expressions/functions/begins-with.js +22 -0
- package/lib/cjs/commands/expressions/functions/begins-with.js.map +1 -0
- package/lib/cjs/commands/expressions/functions/contains.d.ts +16 -0
- package/lib/cjs/commands/expressions/functions/contains.js +23 -0
- package/lib/cjs/commands/expressions/functions/contains.js.map +1 -0
- package/lib/cjs/commands/expressions/functions/index.d.ts +5 -0
- package/lib/cjs/commands/expressions/functions/index.js +22 -0
- package/lib/cjs/commands/expressions/functions/index.js.map +1 -0
- package/lib/cjs/commands/expressions/index.d.ts +1 -0
- package/lib/cjs/commands/expressions/index.js +1 -0
- package/lib/cjs/commands/expressions/index.js.map +1 -1
- package/lib/cjs/commands/expressions/key-condition.d.ts +1 -1
- package/lib/cjs/commands/expressions/operands/index.d.ts +1 -0
- package/lib/cjs/commands/expressions/operands/index.js +3 -1
- package/lib/cjs/commands/expressions/operands/index.js.map +1 -1
- package/lib/cjs/commands/expressions/operands/operand.js +1 -0
- package/lib/cjs/commands/expressions/operands/operand.js.map +1 -1
- package/lib/{esm/commands/expressions/condition → cjs/commands/expressions/operands}/size.d.ts +3 -2
- package/lib/cjs/commands/expressions/{condition → operands}/size.js +1 -1
- package/lib/cjs/commands/expressions/operands/size.js.map +1 -0
- package/lib/cjs/commands/expressions/projection.d.ts +9 -8
- package/lib/cjs/commands/expressions/projection.js +14 -14
- package/lib/cjs/commands/expressions/projection.js.map +1 -1
- package/lib/cjs/commands/expressions/update/expression.d.ts +5 -5
- package/lib/cjs/commands/expressions/update/expression.js +5 -5
- package/lib/cjs/commands/expressions/update/expression.js.map +1 -1
- package/lib/cjs/commands/index.d.ts +1 -1
- package/lib/cjs/commands/index.js +19 -16
- package/lib/cjs/commands/index.js.map +1 -1
- package/lib/cjs/commands/inputs/condition-check.d.ts +1 -1
- package/lib/cjs/commands/inputs/condition-check.js +7 -7
- package/lib/cjs/commands/inputs/condition-check.js.map +1 -1
- package/lib/cjs/commands/inputs/delete-item.d.ts +2 -2
- package/lib/cjs/commands/inputs/delete-item.js +5 -4
- package/lib/cjs/commands/inputs/delete-item.js.map +1 -1
- package/lib/cjs/commands/inputs/get-item.d.ts +2 -2
- package/lib/cjs/commands/inputs/get-item.js +9 -10
- package/lib/cjs/commands/inputs/get-item.js.map +1 -1
- package/lib/cjs/commands/inputs/index.d.ts +0 -1
- package/lib/cjs/commands/inputs/index.js.map +1 -1
- package/lib/cjs/commands/inputs/lib.d.ts +13 -7
- package/lib/cjs/commands/inputs/lib.js +13 -16
- package/lib/cjs/commands/inputs/lib.js.map +1 -1
- package/lib/cjs/commands/inputs/put-item.d.ts +2 -2
- package/lib/cjs/commands/inputs/put-item.js +5 -4
- package/lib/cjs/commands/inputs/put-item.js.map +1 -1
- package/lib/cjs/commands/inputs/query.d.ts +4 -3
- package/lib/cjs/commands/inputs/query.js +16 -12
- package/lib/cjs/commands/inputs/query.js.map +1 -1
- package/lib/cjs/commands/inputs/update-item.d.ts +2 -2
- package/lib/cjs/commands/inputs/update-item.js +9 -17
- package/lib/cjs/commands/inputs/update-item.js.map +1 -1
- package/lib/cjs/index.js +0 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/commands/expressions/condition/comparisons/between.d.ts +28 -0
- package/lib/esm/commands/expressions/condition/comparisons/between.js +27 -0
- package/lib/esm/commands/expressions/condition/comparisons/between.js.map +1 -0
- package/lib/esm/commands/expressions/condition/comparisons/binary.d.ts +4 -0
- package/lib/esm/commands/expressions/condition/comparisons/binary.js +8 -0
- package/lib/esm/commands/expressions/condition/comparisons/binary.js.map +1 -0
- package/lib/esm/commands/expressions/condition/comparisons/equals.d.ts +20 -0
- package/lib/esm/commands/expressions/condition/comparisons/equals.js +21 -0
- package/lib/esm/commands/expressions/condition/comparisons/equals.js.map +1 -0
- package/lib/esm/commands/expressions/condition/comparisons/greater-than-or-equals.d.ts +24 -0
- package/lib/esm/commands/expressions/condition/comparisons/greater-than-or-equals.js +21 -0
- package/lib/esm/commands/expressions/condition/comparisons/greater-than-or-equals.js.map +1 -0
- package/lib/esm/commands/expressions/condition/comparisons/greater-than.d.ts +20 -0
- package/lib/esm/commands/expressions/condition/comparisons/greater-than.js +21 -0
- package/lib/esm/commands/expressions/condition/comparisons/greater-than.js.map +1 -0
- package/lib/esm/commands/expressions/condition/comparisons/in.d.ts +22 -0
- package/lib/esm/commands/expressions/condition/comparisons/in.js +38 -0
- package/lib/esm/commands/expressions/condition/comparisons/in.js.map +1 -0
- package/lib/esm/commands/expressions/condition/comparisons/index.d.ts +9 -0
- package/lib/esm/commands/expressions/condition/comparisons/index.js +10 -0
- package/lib/esm/commands/expressions/condition/comparisons/index.js.map +1 -0
- package/lib/esm/commands/expressions/condition/comparisons/lower-than-or-equals.d.ts +24 -0
- package/lib/esm/commands/expressions/condition/comparisons/lower-than-or-equals.js +21 -0
- package/lib/esm/commands/expressions/condition/comparisons/lower-than-or-equals.js.map +1 -0
- package/lib/esm/commands/expressions/condition/comparisons/lower-than.d.ts +20 -0
- package/lib/esm/commands/expressions/condition/comparisons/lower-than.js +21 -0
- package/lib/esm/commands/expressions/condition/comparisons/lower-than.js.map +1 -0
- package/lib/esm/commands/expressions/condition/comparisons/not-equals.d.ts +20 -0
- package/lib/esm/commands/expressions/condition/comparisons/not-equals.js +21 -0
- package/lib/esm/commands/expressions/condition/comparisons/not-equals.js.map +1 -0
- package/lib/esm/commands/expressions/condition/comparisons/operand.d.ts +4 -0
- package/lib/esm/commands/expressions/condition/comparisons/operand.js +2 -0
- package/lib/esm/commands/expressions/condition/comparisons/operand.js.map +1 -0
- package/lib/esm/commands/expressions/condition/condition-comparison.d.ts +15 -0
- package/lib/esm/commands/expressions/condition/condition-comparison.js +50 -0
- package/lib/esm/commands/expressions/condition/condition-comparison.js.map +1 -0
- package/lib/esm/commands/expressions/condition/condition.d.ts +10 -9
- package/lib/esm/commands/expressions/condition/condition.js +9 -8
- package/lib/esm/commands/expressions/condition/condition.js.map +1 -1
- package/lib/esm/commands/expressions/condition/index.d.ts +2 -3
- package/lib/esm/commands/expressions/condition/index.js +0 -2
- package/lib/esm/commands/expressions/condition/index.js.map +1 -1
- package/lib/esm/commands/expressions/condition/logic.d.ts +12 -8
- package/lib/esm/commands/expressions/condition/logic.js +20 -30
- package/lib/esm/commands/expressions/condition/logic.js.map +1 -1
- package/lib/esm/commands/expressions/condition/operand.d.ts +8 -0
- package/lib/esm/commands/expressions/condition/operand.js +12 -0
- package/lib/esm/commands/expressions/condition/operand.js.map +1 -0
- package/lib/esm/commands/expressions/expression.d.ts +8 -6
- package/lib/esm/commands/expressions/expression.js +7 -1
- package/lib/esm/commands/expressions/expression.js.map +1 -1
- package/lib/esm/commands/expressions/functions/attribute-exists.d.ts +13 -0
- package/lib/esm/commands/expressions/functions/attribute-exists.js +16 -0
- package/lib/esm/commands/expressions/functions/attribute-exists.js.map +1 -0
- package/lib/esm/commands/expressions/functions/attribute-not-exists.d.ts +13 -0
- package/lib/esm/commands/expressions/functions/attribute-not-exists.js +16 -0
- package/lib/esm/commands/expressions/functions/attribute-not-exists.js.map +1 -0
- package/lib/esm/commands/expressions/functions/attribute-type.d.ts +17 -0
- package/lib/esm/commands/expressions/functions/attribute-type.js +20 -0
- package/lib/esm/commands/expressions/functions/attribute-type.js.map +1 -0
- package/lib/esm/commands/expressions/functions/begins-with.d.ts +24 -0
- package/lib/esm/commands/expressions/functions/begins-with.js +19 -0
- package/lib/esm/commands/expressions/functions/begins-with.js.map +1 -0
- package/lib/esm/commands/expressions/functions/contains.d.ts +16 -0
- package/lib/esm/commands/expressions/functions/contains.js +20 -0
- package/lib/esm/commands/expressions/functions/contains.js.map +1 -0
- package/lib/esm/commands/expressions/functions/index.d.ts +5 -0
- package/lib/esm/commands/expressions/functions/index.js +6 -0
- package/lib/esm/commands/expressions/functions/index.js.map +1 -0
- package/lib/esm/commands/expressions/index.d.ts +1 -0
- package/lib/esm/commands/expressions/index.js +1 -0
- package/lib/esm/commands/expressions/index.js.map +1 -1
- package/lib/esm/commands/expressions/key-condition.d.ts +1 -1
- package/lib/esm/commands/expressions/operands/index.d.ts +1 -0
- package/lib/esm/commands/expressions/operands/index.js +1 -0
- package/lib/esm/commands/expressions/operands/index.js.map +1 -1
- package/lib/esm/commands/expressions/operands/operand.js +1 -0
- package/lib/esm/commands/expressions/operands/operand.js.map +1 -1
- package/lib/{cjs/commands/expressions/condition → esm/commands/expressions/operands}/size.d.ts +3 -2
- package/lib/esm/commands/expressions/{condition → operands}/size.js +1 -1
- package/lib/esm/commands/expressions/operands/size.js.map +1 -0
- package/lib/esm/commands/expressions/projection.d.ts +9 -8
- package/lib/esm/commands/expressions/projection.js +13 -13
- package/lib/esm/commands/expressions/projection.js.map +1 -1
- package/lib/esm/commands/expressions/update/expression.d.ts +5 -5
- package/lib/esm/commands/expressions/update/expression.js +3 -3
- package/lib/esm/commands/expressions/update/expression.js.map +1 -1
- package/lib/esm/commands/index.d.ts +1 -1
- package/lib/esm/commands/index.js +1 -1
- package/lib/esm/commands/index.js.map +1 -1
- package/lib/esm/commands/inputs/condition-check.d.ts +1 -1
- package/lib/esm/commands/inputs/condition-check.js +8 -8
- package/lib/esm/commands/inputs/condition-check.js.map +1 -1
- package/lib/esm/commands/inputs/delete-item.d.ts +2 -2
- package/lib/esm/commands/inputs/delete-item.js +6 -5
- package/lib/esm/commands/inputs/delete-item.js.map +1 -1
- package/lib/esm/commands/inputs/get-item.d.ts +2 -2
- package/lib/esm/commands/inputs/get-item.js +10 -11
- package/lib/esm/commands/inputs/get-item.js.map +1 -1
- package/lib/esm/commands/inputs/index.d.ts +0 -1
- package/lib/esm/commands/inputs/index.js.map +1 -1
- package/lib/esm/commands/inputs/lib.d.ts +13 -7
- package/lib/esm/commands/inputs/lib.js +12 -15
- package/lib/esm/commands/inputs/lib.js.map +1 -1
- package/lib/esm/commands/inputs/put-item.d.ts +2 -2
- package/lib/esm/commands/inputs/put-item.js +6 -5
- package/lib/esm/commands/inputs/put-item.js.map +1 -1
- package/lib/esm/commands/inputs/query.d.ts +4 -3
- package/lib/esm/commands/inputs/query.js +17 -13
- package/lib/esm/commands/inputs/query.js.map +1 -1
- package/lib/esm/commands/inputs/update-item.d.ts +2 -2
- package/lib/esm/commands/inputs/update-item.js +9 -17
- package/lib/esm/commands/inputs/update-item.js.map +1 -1
- package/lib/esm/index.js +0 -1
- package/lib/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/lib/cjs/commands/expressions/condition/comparisons.d.ts +0 -22
- package/lib/cjs/commands/expressions/condition/comparisons.js +0 -211
- package/lib/cjs/commands/expressions/condition/comparisons.js.map +0 -1
- package/lib/cjs/commands/expressions/condition/expression.d.ts +0 -19
- package/lib/cjs/commands/expressions/condition/expression.js +0 -28
- package/lib/cjs/commands/expressions/condition/expression.js.map +0 -1
- package/lib/cjs/commands/expressions/condition/functions.d.ts +0 -71
- package/lib/cjs/commands/expressions/condition/functions.js +0 -92
- package/lib/cjs/commands/expressions/condition/functions.js.map +0 -1
- package/lib/cjs/commands/expressions/condition/size.js.map +0 -1
- package/lib/esm/commands/expressions/condition/comparisons.d.ts +0 -22
- package/lib/esm/commands/expressions/condition/comparisons.js +0 -207
- package/lib/esm/commands/expressions/condition/comparisons.js.map +0 -1
- package/lib/esm/commands/expressions/condition/expression.d.ts +0 -19
- package/lib/esm/commands/expressions/condition/expression.js +0 -23
- package/lib/esm/commands/expressions/condition/expression.js.map +0 -1
- package/lib/esm/commands/expressions/condition/functions.d.ts +0 -71
- package/lib/esm/commands/expressions/condition/functions.js +0 -85
- package/lib/esm/commands/expressions/condition/functions.js.map +0 -1
- package/lib/esm/commands/expressions/condition/size.js.map +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
8
|
-
export
|
|
9
|
-
|
|
1
|
+
import type { AttributeExists, AttributeNotExists, BeginsWith, Contains, IsAttributeOfType } from "../functions/index.js";
|
|
2
|
+
import { ConditionComparison, type ConditionComparisonParams } from "./condition-comparison.js";
|
|
3
|
+
import type { And, Not, Or } from "./logic.js";
|
|
4
|
+
export type ConditionParams = ConditionComparisonParams | ConditionFunction | ConditionLogic;
|
|
5
|
+
export type ConditionFunction = AttributeExists | AttributeNotExists | BeginsWith | IsAttributeOfType | Contains;
|
|
6
|
+
export type ConditionLogic = And | Not | Or;
|
|
7
|
+
export type Condition = ConditionComparison | ConditionFunction | ConditionLogic;
|
|
8
|
+
export declare const Condition: {
|
|
9
|
+
from(params: ConditionParams): Condition;
|
|
10
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
3
|
+
exports.Condition = void 0;
|
|
4
|
+
const condition_comparison_js_1 = require("./condition-comparison.js");
|
|
5
|
+
exports.Condition = {
|
|
6
|
+
from(params) {
|
|
7
|
+
if ((0, condition_comparison_js_1.isConditionComparisonParams)(params)) {
|
|
8
|
+
return condition_comparison_js_1.ConditionComparison.from(params);
|
|
9
|
+
}
|
|
10
|
+
return params;
|
|
11
|
+
},
|
|
12
|
+
};
|
|
12
13
|
//# sourceMappingURL=condition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/condition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/condition.ts"],"names":[],"mappings":";;;AAOA,uEAImC;AAsBtB,QAAA,SAAS,GAAG;IACvB,IAAI,CAAC,MAAuB;QAC1B,IAAI,IAAA,qDAA2B,EAAC,MAAM,CAAC,EAAE,CAAC;YACxC,OAAO,6CAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { BetweenParams, ComparableOperand, ComparableValue, EqualsParams, GreaterThanOrEqualsParams, GreaterThanParams, InParams, LowerThanOrEqualsParams, LowerThanParams, NotEqualsParams, } from "./comparisons/index.js";
|
|
2
2
|
export * from "./condition.js";
|
|
3
|
-
export
|
|
3
|
+
export type { ConditionComparisonParams } from "./condition-comparison.js";
|
|
4
4
|
export * from "./logic.js";
|
|
5
|
-
export * from "./size.js";
|
|
@@ -15,7 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./condition.js"), exports);
|
|
18
|
-
__exportStar(require("./functions.js"), exports);
|
|
19
18
|
__exportStar(require("./logic.js"), exports);
|
|
20
|
-
__exportStar(require("./size.js"), exports);
|
|
21
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAYA,iDAA+B;AAE/B,6CAA2B"}
|
|
@@ -1,34 +1,38 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import {
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import { ExpressionFormatter } from "../expression.js";
|
|
3
|
+
import { type ConditionParams } from "./condition.js";
|
|
4
|
+
export type Not = ExpressionFormatter & Brand<"Not">;
|
|
3
5
|
/**
|
|
4
6
|
* Negates the provided condition using the `NOT` operator.
|
|
5
7
|
*
|
|
6
8
|
* @param condition - The condition to negate.
|
|
7
9
|
*
|
|
8
|
-
* @returns A {@link
|
|
10
|
+
* @returns A {@link Not} that evaluates to the opposite of what the provided condition evaluates to.
|
|
9
11
|
*
|
|
10
12
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
|
|
11
13
|
*/
|
|
12
|
-
export declare function not(condition: ConditionParams):
|
|
14
|
+
export declare function not(condition: ConditionParams): Not;
|
|
15
|
+
export type And = ExpressionFormatter & Brand<"And">;
|
|
13
16
|
/**
|
|
14
17
|
* Returns a condition that combines the provided ones using the `AND` operator.
|
|
15
18
|
*
|
|
16
19
|
* @param lhs - The first condition to combine.
|
|
17
20
|
* @param rhs - The second condition to combine.
|
|
18
21
|
*
|
|
19
|
-
* @returns
|
|
22
|
+
* @returns An {@link And} that evaluates to true only if both conditions evaluate to true.
|
|
20
23
|
*
|
|
21
24
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
|
|
22
25
|
*/
|
|
23
|
-
export declare function and(lhs: ConditionParams, rhs: ConditionParams):
|
|
26
|
+
export declare function and(lhs: ConditionParams, rhs: ConditionParams): And;
|
|
27
|
+
export type Or = ExpressionFormatter & Brand<"Or">;
|
|
24
28
|
/**
|
|
25
29
|
* Returns a condition that combines the provided ones using the `OR` operator.
|
|
26
30
|
*
|
|
27
31
|
* @param lhs - The first condition to combine.
|
|
28
32
|
* @param rhs - The second condition to combine.
|
|
29
33
|
*
|
|
30
|
-
* @returns
|
|
34
|
+
* @returns An {@link Or} that evaluates to true if any conditions evaluate to true.
|
|
31
35
|
*
|
|
32
36
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
|
|
33
37
|
*/
|
|
34
|
-
export declare function or(lhs: ConditionParams, rhs: ConditionParams):
|
|
38
|
+
export declare function or(lhs: ConditionParams, rhs: ConditionParams): Or;
|
|
@@ -3,23 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.not = not;
|
|
4
4
|
exports.and = and;
|
|
5
5
|
exports.or = or;
|
|
6
|
-
const
|
|
6
|
+
const types_1 = require("@infra-blocks/types");
|
|
7
|
+
const expression_js_1 = require("../expression.js");
|
|
8
|
+
const condition_js_1 = require("./condition.js");
|
|
7
9
|
/**
|
|
8
10
|
* Negates the provided condition using the `NOT` operator.
|
|
9
11
|
*
|
|
10
12
|
* @param condition - The condition to negate.
|
|
11
13
|
*
|
|
12
|
-
* @returns A {@link
|
|
14
|
+
* @returns A {@link Not} that evaluates to the opposite of what the provided condition evaluates to.
|
|
13
15
|
*
|
|
14
16
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
|
|
15
17
|
*/
|
|
16
18
|
function not(condition) {
|
|
17
|
-
const expression =
|
|
18
|
-
return expression_js_1.
|
|
19
|
-
stringify: ({ names, values }) => {
|
|
20
|
-
return `(NOT ${expression.stringify({ names, values })})`;
|
|
21
|
-
},
|
|
22
|
-
});
|
|
19
|
+
const expression = condition_js_1.Condition.from(condition);
|
|
20
|
+
return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names, values }) => `(NOT ${expression.format({ names, values })})`));
|
|
23
21
|
}
|
|
24
22
|
/**
|
|
25
23
|
* Returns a condition that combines the provided ones using the `AND` operator.
|
|
@@ -27,21 +25,17 @@ function not(condition) {
|
|
|
27
25
|
* @param lhs - The first condition to combine.
|
|
28
26
|
* @param rhs - The second condition to combine.
|
|
29
27
|
*
|
|
30
|
-
* @returns
|
|
28
|
+
* @returns An {@link And} that evaluates to true only if both conditions evaluate to true.
|
|
31
29
|
*
|
|
32
30
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
|
|
33
31
|
*/
|
|
34
32
|
function and(lhs, rhs) {
|
|
35
|
-
const left =
|
|
36
|
-
const right =
|
|
37
|
-
return expression_js_1.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
values,
|
|
42
|
-
})})`;
|
|
43
|
-
},
|
|
44
|
-
});
|
|
33
|
+
const left = condition_js_1.Condition.from(lhs);
|
|
34
|
+
const right = condition_js_1.Condition.from(rhs);
|
|
35
|
+
return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names, values }) => `(${left.format({ names, values })} AND ${right.format({
|
|
36
|
+
names,
|
|
37
|
+
values,
|
|
38
|
+
})})`));
|
|
45
39
|
}
|
|
46
40
|
/**
|
|
47
41
|
* Returns a condition that combines the provided ones using the `OR` operator.
|
|
@@ -49,20 +43,16 @@ function and(lhs, rhs) {
|
|
|
49
43
|
* @param lhs - The first condition to combine.
|
|
50
44
|
* @param rhs - The second condition to combine.
|
|
51
45
|
*
|
|
52
|
-
* @returns
|
|
46
|
+
* @returns An {@link Or} that evaluates to true if any conditions evaluate to true.
|
|
53
47
|
*
|
|
54
48
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
|
|
55
49
|
*/
|
|
56
50
|
function or(lhs, rhs) {
|
|
57
|
-
const left =
|
|
58
|
-
const right =
|
|
59
|
-
return expression_js_1.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
values,
|
|
64
|
-
})})`;
|
|
65
|
-
},
|
|
66
|
-
});
|
|
51
|
+
const left = condition_js_1.Condition.from(lhs);
|
|
52
|
+
const right = condition_js_1.Condition.from(rhs);
|
|
53
|
+
return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names, values }) => `(${left.format({ names, values })} OR ${right.format({
|
|
54
|
+
names,
|
|
55
|
+
values,
|
|
56
|
+
})})`));
|
|
67
57
|
}
|
|
68
58
|
//# sourceMappingURL=logic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logic.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/logic.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"logic.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/logic.ts"],"names":[],"mappings":";;AAeA,kBAOC;AAcD,kBAYC;AAcD,gBAYC;AA1ED,+CAA0D;AAC1D,oDAAuD;AACvD,iDAAiE;AAIjE;;;;;;;;GAQG;AACH,SAAgB,GAAG,CAAC,SAA0B;IAC5C,MAAM,UAAU,GAAG,wBAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC7C,OAAO,IAAA,eAAO,EACZ,mCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,QAAQ,UAAU,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,CACvE,CACF,CAAC;AACJ,CAAC;AAID;;;;;;;;;GASG;AACH,SAAgB,GAAG,CAAC,GAAoB,EAAE,GAAoB;IAC5D,MAAM,IAAI,GAAG,wBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,wBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,IAAA,eAAO,EACZ,mCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,QAAQ,KAAK,CAAC,MAAM,CAAC;QACrD,KAAK;QACL,MAAM;KACP,CAAC,GAAG,CACR,CACF,CAAC;AACJ,CAAC;AAID;;;;;;;;;GASG;AACH,SAAgB,EAAE,CAAC,GAAoB,EAAE,GAAoB;IAC3D,MAAM,IAAI,GAAG,wBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,wBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,IAAA,eAAO,EACZ,mCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,OAAO,KAAK,CAAC,MAAM,CAAC;QACpD,KAAK;QACL,MAAM;KACP,CAAC,GAAG,CACR,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AttributeValue } from "../../../types.js";
|
|
2
|
+
import { type Operand, type RawOperand } from "../operands/operand.js";
|
|
3
|
+
import { type Size } from "../operands/size.js";
|
|
4
|
+
export type ConditionOperand<T extends AttributeValue = AttributeValue> = Operand<T> | Size;
|
|
5
|
+
export type RawConditionOperand<T extends AttributeValue = AttributeValue> = RawOperand<T> | Size;
|
|
6
|
+
export declare const ConditionOperand: {
|
|
7
|
+
normalize<T extends AttributeValue = AttributeValue>(raw: RawConditionOperand<T>): ConditionOperand<T>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConditionOperand = void 0;
|
|
4
|
+
const operand_js_1 = require("../operands/operand.js");
|
|
5
|
+
const size_js_1 = require("../operands/size.js");
|
|
6
|
+
// TODO: internal
|
|
7
|
+
exports.ConditionOperand = {
|
|
8
|
+
normalize(raw) {
|
|
9
|
+
if ((0, size_js_1.isSize)(raw)) {
|
|
10
|
+
return raw;
|
|
11
|
+
}
|
|
12
|
+
return (0, operand_js_1.operand)(raw);
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=operand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operand.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/operand.ts"],"names":[],"mappings":";;;AACA,uDAAgF;AAChF,iDAAwD;AASxD,iBAAiB;AAEJ,QAAA,gBAAgB,GAAG;IAC9B,SAAS,CACP,GAA2B;QAE3B,IAAI,IAAA,gBAAM,EAAC,GAAG,CAAC,EAAE,CAAC;YAChB,OAAO,GAAG,CAAC;QACb,CAAC;QACD,OAAO,IAAA,oBAAO,EAAI,GAAG,CAAC,CAAC;IACzB,CAAC;CACF,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import type { AttributeNames } from "../attributes/
|
|
2
|
-
|
|
3
|
-
export type Stringifier = (params: {
|
|
1
|
+
import type { AttributeNames, AttributeValues } from "../attributes/index.js";
|
|
2
|
+
export type Formatter = (params: {
|
|
4
3
|
names: AttributeNames;
|
|
5
4
|
values: AttributeValues;
|
|
6
5
|
}) => string;
|
|
7
|
-
export
|
|
8
|
-
|
|
6
|
+
export type ExpressionFormatter = {
|
|
7
|
+
format(params: {
|
|
9
8
|
names: AttributeNames;
|
|
10
9
|
values: AttributeValues;
|
|
11
10
|
}): string;
|
|
12
|
-
}
|
|
11
|
+
};
|
|
12
|
+
export declare const ExpressionFormatter: {
|
|
13
|
+
from(formatter: Formatter): ExpressionFormatter;
|
|
14
|
+
};
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExpressionFormatter = void 0;
|
|
4
|
+
exports.ExpressionFormatter = {
|
|
5
|
+
from(formatter) {
|
|
6
|
+
return {
|
|
7
|
+
format: formatter,
|
|
8
|
+
};
|
|
9
|
+
},
|
|
10
|
+
};
|
|
3
11
|
//# sourceMappingURL=expression.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression.js","sourceRoot":"","sources":["../../../../src/commands/expressions/expression.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"expression.js","sourceRoot":"","sources":["../../../../src/commands/expressions/expression.ts"],"names":[],"mappings":";;;AAWa,QAAA,mBAAmB,GAAG;IACjC,IAAI,CAAC,SAAoB;QACvB,OAAO;YACL,MAAM,EAAE,SAAS;SAClB,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import { ExpressionFormatter } from "../expression.js";
|
|
3
|
+
import { type RawPath } from "../operands/path.js";
|
|
4
|
+
export type AttributeExists = ExpressionFormatter & Brand<"AttributeExists">;
|
|
5
|
+
/**
|
|
6
|
+
* Returns a condition that uses the `attribute_exists` function.
|
|
7
|
+
*
|
|
8
|
+
* @param rawPath - The attribute path to check for existence.
|
|
9
|
+
* @returns An {@link AttributeExists} that evaluates to true if the provided attribute path exists.
|
|
10
|
+
*
|
|
11
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
|
|
12
|
+
*/
|
|
13
|
+
export declare function attributeExists(rawPath: RawPath): AttributeExists;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.attributeExists = attributeExists;
|
|
4
|
+
const types_1 = require("@infra-blocks/types");
|
|
5
|
+
const expression_js_1 = require("../expression.js");
|
|
6
|
+
const path_js_1 = require("../operands/path.js");
|
|
7
|
+
/**
|
|
8
|
+
* Returns a condition that uses the `attribute_exists` function.
|
|
9
|
+
*
|
|
10
|
+
* @param rawPath - The attribute path to check for existence.
|
|
11
|
+
* @returns An {@link AttributeExists} that evaluates to true if the provided attribute path exists.
|
|
12
|
+
*
|
|
13
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
|
|
14
|
+
*/
|
|
15
|
+
function attributeExists(rawPath) {
|
|
16
|
+
const path = path_js_1.Path.normalize(rawPath);
|
|
17
|
+
return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names }) => `attribute_exists(${path.substitute({ names })})`));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=attribute-exists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribute-exists.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/attribute-exists.ts"],"names":[],"mappings":";;AAcA,0CAOC;AArBD,+CAA0D;AAC1D,oDAAuD;AACvD,iDAAyD;AAIzD;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,OAAgB;IAC9C,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,IAAA,eAAO,EACZ,mCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,oBAAoB,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CACjE,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import { ExpressionFormatter } from "../expression.js";
|
|
3
|
+
import { type RawPath } from "../operands/path.js";
|
|
4
|
+
export type AttributeNotExists = ExpressionFormatter & Brand<"AttributeNotExists">;
|
|
5
|
+
/**
|
|
6
|
+
* Returns a condition that uses the `attribute_not_exists` function.
|
|
7
|
+
*
|
|
8
|
+
* @param rawPath - The attribute path to check for non-existence.
|
|
9
|
+
* @returns An {@link AttributeNotExists} that evaluates to true if the provided attribute path does not exist.
|
|
10
|
+
*
|
|
11
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
|
|
12
|
+
*/
|
|
13
|
+
export declare function attributeNotExists(rawPath: RawPath): AttributeNotExists;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.attributeNotExists = attributeNotExists;
|
|
4
|
+
const types_1 = require("@infra-blocks/types");
|
|
5
|
+
const expression_js_1 = require("../expression.js");
|
|
6
|
+
const path_js_1 = require("../operands/path.js");
|
|
7
|
+
/**
|
|
8
|
+
* Returns a condition that uses the `attribute_not_exists` function.
|
|
9
|
+
*
|
|
10
|
+
* @param rawPath - The attribute path to check for non-existence.
|
|
11
|
+
* @returns An {@link AttributeNotExists} that evaluates to true if the provided attribute path does not exist.
|
|
12
|
+
*
|
|
13
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
|
|
14
|
+
*/
|
|
15
|
+
function attributeNotExists(rawPath) {
|
|
16
|
+
const path = path_js_1.Path.normalize(rawPath);
|
|
17
|
+
return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names }) => `attribute_not_exists(${path.substitute({ names })})`));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=attribute-not-exists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribute-not-exists.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/attribute-not-exists.ts"],"names":[],"mappings":";;AAeA,gDAOC;AAtBD,+CAA0D;AAC1D,oDAAuD;AACvD,iDAAyD;AAKzD;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,OAAgB;IACjD,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,IAAA,eAAO,EACZ,mCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,wBAAwB,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CACrE,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import type { AttributeType } from "../../../types.js";
|
|
3
|
+
import { ExpressionFormatter } from "../expression.js";
|
|
4
|
+
import { type RawPath } from "../operands/path.js";
|
|
5
|
+
import { type RawValue } from "../operands/value.js";
|
|
6
|
+
export type IsAttributeOfType = ExpressionFormatter & Brand<"IsAttributeOfType">;
|
|
7
|
+
/**
|
|
8
|
+
* Returns a condition that uses the `attribute_type` function.
|
|
9
|
+
*
|
|
10
|
+
* @param attribute - The attribute path to check.
|
|
11
|
+
* @param rawType - The expected type of the attribute.
|
|
12
|
+
*
|
|
13
|
+
* @returns An {@link IsAttributeOfType} that evaluates to true if the attribute is of the expected type.
|
|
14
|
+
*
|
|
15
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
|
|
16
|
+
*/
|
|
17
|
+
export declare function attributeType(attribute: RawPath, rawType: RawValue<AttributeType>): IsAttributeOfType;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.attributeType = attributeType;
|
|
4
|
+
const types_1 = require("@infra-blocks/types");
|
|
5
|
+
const expression_js_1 = require("../expression.js");
|
|
6
|
+
const path_js_1 = require("../operands/path.js");
|
|
7
|
+
const value_js_1 = require("../operands/value.js");
|
|
8
|
+
/**
|
|
9
|
+
* Returns a condition that uses the `attribute_type` function.
|
|
10
|
+
*
|
|
11
|
+
* @param attribute - The attribute path to check.
|
|
12
|
+
* @param rawType - The expected type of the attribute.
|
|
13
|
+
*
|
|
14
|
+
* @returns An {@link IsAttributeOfType} that evaluates to true if the attribute is of the expected type.
|
|
15
|
+
*
|
|
16
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
|
|
17
|
+
*/
|
|
18
|
+
function attributeType(attribute, rawType) {
|
|
19
|
+
const path = path_js_1.Path.normalize(attribute);
|
|
20
|
+
const type = value_js_1.Value.normalize(rawType);
|
|
21
|
+
return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names, values }) => `attribute_type(${path.substitute({ names })}, ${type.substitute({ values })})`));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=attribute-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribute-type.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/attribute-type.ts"],"names":[],"mappings":";;AAoBA,sCAYC;AAhCD,+CAA0D;AAE1D,oDAAuD;AACvD,iDAAyD;AACzD,mDAA4D;AAM5D;;;;;;;;;GASG;AACH,SAAgB,aAAa,CAC3B,SAAkB,EAClB,OAAgC;IAEhC,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,gBAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACtC,OAAO,IAAA,eAAO,EACZ,mCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,kBAAkB,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAClF,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import type { NativeBinary, NativeString } from "../../../types.js";
|
|
3
|
+
import { ExpressionFormatter } from "../expression.js";
|
|
4
|
+
import { type RawOperand } from "../operands/operand.js";
|
|
5
|
+
/**
|
|
6
|
+
* This type aggregates the types of operands that can be used with the {@link beginsWith} function.
|
|
7
|
+
*
|
|
8
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
|
|
9
|
+
*/
|
|
10
|
+
export type BeginsWithOperand = RawOperand<StringOrBinary>;
|
|
11
|
+
export type BeginsWith = ExpressionFormatter & Brand<"BeginsWith">;
|
|
12
|
+
/**
|
|
13
|
+
* Returns a condition that uses the `begins_with` function.
|
|
14
|
+
*
|
|
15
|
+
* @param first - The first function operand, which is the path or value to check.
|
|
16
|
+
* @param second - The second function operand, which is the prefix to validate against.
|
|
17
|
+
*
|
|
18
|
+
* @returns A {@link BeginsWith} that evaluates to true if the first operand begins with the second.
|
|
19
|
+
*
|
|
20
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
|
|
21
|
+
*/
|
|
22
|
+
export declare function beginsWith(first: BeginsWithOperand, second: BeginsWithOperand): BeginsWith;
|
|
23
|
+
type StringOrBinary = NativeString | NativeBinary;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.beginsWith = beginsWith;
|
|
4
|
+
const types_1 = require("@infra-blocks/types");
|
|
5
|
+
const expression_js_1 = require("../expression.js");
|
|
6
|
+
const operand_js_1 = require("../operands/operand.js");
|
|
7
|
+
/**
|
|
8
|
+
* Returns a condition that uses the `begins_with` function.
|
|
9
|
+
*
|
|
10
|
+
* @param first - The first function operand, which is the path or value to check.
|
|
11
|
+
* @param second - The second function operand, which is the prefix to validate against.
|
|
12
|
+
*
|
|
13
|
+
* @returns A {@link BeginsWith} that evaluates to true if the first operand begins with the second.
|
|
14
|
+
*
|
|
15
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
|
|
16
|
+
*/
|
|
17
|
+
function beginsWith(first, second) {
|
|
18
|
+
const firstOperand = (0, operand_js_1.operand)(first);
|
|
19
|
+
const secondOperand = (0, operand_js_1.operand)(second);
|
|
20
|
+
return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names, values }) => `begins_with(${firstOperand.substitute({ names, values })}, ${secondOperand.substitute({ names, values })})`));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=begins-with.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"begins-with.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/begins-with.ts"],"names":[],"mappings":";;AAwBA,gCAaC;AArCD,+CAA0D;AAE1D,oDAAuD;AACvD,uDAAkE;AAWlE;;;;;;;;;GASG;AACH,SAAgB,UAAU,CACxB,KAAwB,EACxB,MAAyB;IAEzB,MAAM,YAAY,GAAG,IAAA,oBAAO,EAAiB,KAAK,CAAC,CAAC;IACpD,MAAM,aAAa,GAAG,IAAA,oBAAO,EAAiB,MAAM,CAAC,CAAC;IAEtD,OAAO,IAAA,eAAO,EACZ,mCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,eAAe,YAAY,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,KAAK,aAAa,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,CAC/G,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import { ExpressionFormatter } from "../expression.js";
|
|
3
|
+
import { type RawOperand } from "../operands/operand.js";
|
|
4
|
+
import { type Size } from "../operands/size.js";
|
|
5
|
+
export type Contains = ExpressionFormatter & Brand<"Contains">;
|
|
6
|
+
/**
|
|
7
|
+
* Returns a condition that uses the `contains` function.
|
|
8
|
+
*
|
|
9
|
+
* @param first - The first function operand, which is the path or value to check.
|
|
10
|
+
* @param second - The second function operand, which is the value to check for containment.
|
|
11
|
+
*
|
|
12
|
+
* @returns A {@link ConditionExpressionFormatter} that evaluates to true if this operand contains the provided one.
|
|
13
|
+
*
|
|
14
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
|
|
15
|
+
*/
|
|
16
|
+
export declare function contains(first: RawOperand, second: RawOperand | Size): Contains;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.contains = contains;
|
|
4
|
+
const types_1 = require("@infra-blocks/types");
|
|
5
|
+
const expression_js_1 = require("../expression.js");
|
|
6
|
+
const operand_js_1 = require("../operands/operand.js");
|
|
7
|
+
const size_js_1 = require("../operands/size.js");
|
|
8
|
+
/**
|
|
9
|
+
* Returns a condition that uses the `contains` function.
|
|
10
|
+
*
|
|
11
|
+
* @param first - The first function operand, which is the path or value to check.
|
|
12
|
+
* @param second - The second function operand, which is the value to check for containment.
|
|
13
|
+
*
|
|
14
|
+
* @returns A {@link ConditionExpressionFormatter} that evaluates to true if this operand contains the provided one.
|
|
15
|
+
*
|
|
16
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
|
|
17
|
+
*/
|
|
18
|
+
function contains(first, second) {
|
|
19
|
+
const firstOperand = (0, operand_js_1.operand)(first);
|
|
20
|
+
const secondOperand = (0, size_js_1.isSize)(second) ? second : (0, operand_js_1.operand)(second);
|
|
21
|
+
return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names, values }) => `contains(${firstOperand.substitute({ names, values })}, ${secondOperand.substitute({ names, values })})`));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=contains.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contains.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/contains.ts"],"names":[],"mappings":";;AAiBA,4BAaC;AA9BD,+CAA0D;AAC1D,oDAAuD;AACvD,uDAAkE;AAClE,iDAAwD;AAIxD;;;;;;;;;GASG;AACH,SAAgB,QAAQ,CACtB,KAAiB,EACjB,MAAyB;IAEzB,MAAM,YAAY,GAAG,IAAA,oBAAO,EAAC,KAAK,CAAC,CAAC;IACpC,MAAM,aAAa,GAAG,IAAA,gBAAM,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAA,oBAAO,EAAC,MAAM,CAAC,CAAC;IAEhE,OAAO,IAAA,eAAO,EACZ,mCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,YAAY,YAAY,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,KAAK,aAAa,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,CAC5G,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./attribute-exists.js"), exports);
|
|
18
|
+
__exportStar(require("./attribute-not-exists.js"), exports);
|
|
19
|
+
__exportStar(require("./attribute-type.js"), exports);
|
|
20
|
+
__exportStar(require("./begins-with.js"), exports);
|
|
21
|
+
__exportStar(require("./contains.js"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,4DAA0C;AAC1C,sDAAoC;AACpC,mDAAiC;AACjC,gDAA8B"}
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./condition/index.js"), exports);
|
|
18
|
+
__exportStar(require("./functions/index.js"), exports);
|
|
18
19
|
__exportStar(require("./key-condition.js"), exports);
|
|
19
20
|
__exportStar(require("./operands/index.js"), exports);
|
|
20
21
|
__exportStar(require("./projection.js"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/expressions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,qDAAmC;AACnC,sDAAoC;AACpC,kDAAgC;AAChC,oDAAkC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/expressions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,uDAAqC;AACrC,qDAAmC;AACnC,sDAAoC;AACpC,kDAAgC;AAChC,oDAAkC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ConditionParams } from "./condition/index.js";
|
|
2
|
-
export type
|
|
2
|
+
export type KeyConditionParams = ConditionParams;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { type ImplicitOperand, type Operand, operand, type RawOperand, } from "./operand.js";
|
|
2
2
|
export { type ImplicitPath, literal, Path, path, type RawPath, } from "./path.js";
|
|
3
|
+
export { type RawSizeOperand, type SizeOperand, type SizeOperandValue, size, } from "./size.js";
|
|
3
4
|
export { type ImplicitValue, type RawValue, Value, value, } from "./value.js";
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.value = exports.Value = exports.path = exports.Path = exports.literal = exports.operand = void 0;
|
|
3
|
+
exports.value = exports.Value = exports.size = exports.path = exports.Path = exports.literal = exports.operand = void 0;
|
|
4
4
|
var operand_js_1 = require("./operand.js");
|
|
5
5
|
Object.defineProperty(exports, "operand", { enumerable: true, get: function () { return operand_js_1.operand; } });
|
|
6
6
|
var path_js_1 = require("./path.js");
|
|
7
7
|
Object.defineProperty(exports, "literal", { enumerable: true, get: function () { return path_js_1.literal; } });
|
|
8
8
|
Object.defineProperty(exports, "Path", { enumerable: true, get: function () { return path_js_1.Path; } });
|
|
9
9
|
Object.defineProperty(exports, "path", { enumerable: true, get: function () { return path_js_1.path; } });
|
|
10
|
+
var size_js_1 = require("./size.js");
|
|
11
|
+
Object.defineProperty(exports, "size", { enumerable: true, get: function () { return size_js_1.size; } });
|
|
10
12
|
var value_js_1 = require("./value.js");
|
|
11
13
|
Object.defineProperty(exports, "Value", { enumerable: true, get: function () { return value_js_1.Value; } });
|
|
12
14
|
Object.defineProperty(exports, "value", { enumerable: true, get: function () { return value_js_1.value; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/index.ts"],"names":[],"mappings":";;;AAAA,2CAKsB;AAFpB,qGAAA,OAAO,OAAA;AAGT,qCAMmB;AAJjB,kGAAA,OAAO,OAAA;AACP,+FAAA,IAAI,OAAA;AACJ,+FAAA,IAAI,OAAA;AAGN,uCAKoB;AAFlB,iGAAA,KAAK,OAAA;AACL,iGAAA,KAAK,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/index.ts"],"names":[],"mappings":";;;AAAA,2CAKsB;AAFpB,qGAAA,OAAO,OAAA;AAGT,qCAMmB;AAJjB,kGAAA,OAAO,OAAA;AACP,+FAAA,IAAI,OAAA;AACJ,+FAAA,IAAI,OAAA;AAGN,qCAKmB;AADjB,+FAAA,IAAI,OAAA;AAEN,uCAKoB;AAFlB,iGAAA,KAAK,OAAA;AACL,iGAAA,KAAK,OAAA"}
|