@infra-blocks/aws-dynamodb 0.64.0-alpha.1 → 0.65.0-alpha.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
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import { ExpressionFormatter } from "../../expression.js";
|
|
3
|
+
import type { ConditionComparisonParams } from "../condition-comparison.js";
|
|
4
|
+
import type { ComparableOperand } from "./operand.js";
|
|
5
|
+
export type BetweenParams = [
|
|
6
|
+
ComparableOperand,
|
|
7
|
+
"BETWEEN",
|
|
8
|
+
ComparableOperand,
|
|
9
|
+
"AND",
|
|
10
|
+
ComparableOperand
|
|
11
|
+
];
|
|
12
|
+
export declare function isBetweenParams(value: ConditionComparisonParams): value is BetweenParams;
|
|
13
|
+
export type Between = ExpressionFormatter & Brand<"Between">;
|
|
14
|
+
export declare const Between: {
|
|
15
|
+
/**
|
|
16
|
+
* Returns a condition that uses the `BETWEEN` operator.
|
|
17
|
+
*
|
|
18
|
+
* Both bounds are inclusive, meaning that the returned condition corresponds to `lower <= lhs <= upper`.
|
|
19
|
+
*
|
|
20
|
+
* @param params - The parameters of the `BETWEEN` comparison. The first element contains the left-hand side operand,
|
|
21
|
+
* the third element contains the lower inclusive bound, and the fifth element contains the upper inclusive bound.
|
|
22
|
+
*
|
|
23
|
+
* @returns A {@link Between} that evaluates to true if this operand is within the provided bounds.
|
|
24
|
+
*
|
|
25
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
26
|
+
*/
|
|
27
|
+
from(params: BetweenParams): Between;
|
|
28
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Between = void 0;
|
|
4
|
+
exports.isBetweenParams = isBetweenParams;
|
|
5
|
+
const types_1 = require("@infra-blocks/types");
|
|
6
|
+
const expression_js_1 = require("../../expression.js");
|
|
7
|
+
const operand_js_1 = require("../operand.js");
|
|
8
|
+
function isBetweenParams(value) {
|
|
9
|
+
return value[1] === "BETWEEN" && value[3] === "AND";
|
|
10
|
+
}
|
|
11
|
+
exports.Between = {
|
|
12
|
+
/**
|
|
13
|
+
* Returns a condition that uses the `BETWEEN` operator.
|
|
14
|
+
*
|
|
15
|
+
* Both bounds are inclusive, meaning that the returned condition corresponds to `lower <= lhs <= upper`.
|
|
16
|
+
*
|
|
17
|
+
* @param params - The parameters of the `BETWEEN` comparison. The first element contains the left-hand side operand,
|
|
18
|
+
* the third element contains the lower inclusive bound, and the fifth element contains the upper inclusive bound.
|
|
19
|
+
*
|
|
20
|
+
* @returns A {@link Between} that evaluates to true if this operand is within the provided bounds.
|
|
21
|
+
*
|
|
22
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
23
|
+
*/
|
|
24
|
+
from(params) {
|
|
25
|
+
const lhs = operand_js_1.ConditionOperand.normalize(params[0]);
|
|
26
|
+
const lower = operand_js_1.ConditionOperand.normalize(params[2]);
|
|
27
|
+
const upper = operand_js_1.ConditionOperand.normalize(params[4]);
|
|
28
|
+
return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names, values }) => `${lhs.substitute({ names, values })} BETWEEN ${lower.substitute({ names, values })} AND ${upper.substitute({ names, values })}`));
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=between.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"between.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/between.ts"],"names":[],"mappings":";;;AAcA,0CAIC;AAlBD,+CAA0D;AAC1D,uDAA0D;AAE1D,8CAAiD;AAWjD,SAAgB,eAAe,CAC7B,KAAgC;IAEhC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC;AACtD,CAAC;AAIY,QAAA,OAAO,GAAG;IACrB;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,MAAqB;QACxB,MAAM,GAAG,GAAG,6BAAgB,CAAC,SAAS,CAAkB,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACnE,MAAM,KAAK,GAAG,6BAAgB,CAAC,SAAS,CAAkB,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACrE,MAAM,KAAK,GAAG,6BAAgB,CAAC,SAAS,CAAkB,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAErE,OAAO,IAAA,eAAO,EACZ,mCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,GAAG,GAAG,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,YAAY,KAAK,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,QAAQ,KAAK,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CACnI,CACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AttributeValue } from "../../../../types.js";
|
|
2
|
+
import { ExpressionFormatter } from "../../expression.js";
|
|
3
|
+
import { type RawConditionOperand } from "../operand.js";
|
|
4
|
+
export declare function binaryOperation<T extends AttributeValue = AttributeValue>(params: [RawConditionOperand<T>, string, RawConditionOperand<T>]): ExpressionFormatter;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.binaryOperation = binaryOperation;
|
|
4
|
+
const expression_js_1 = require("../../expression.js");
|
|
5
|
+
const operand_js_1 = require("../operand.js");
|
|
6
|
+
function binaryOperation(params) {
|
|
7
|
+
const lhs = operand_js_1.ConditionOperand.normalize(params[0]);
|
|
8
|
+
const rhs = operand_js_1.ConditionOperand.normalize(params[2]);
|
|
9
|
+
return expression_js_1.ExpressionFormatter.from(({ names, values }) => `${lhs.substitute({ names, values })} ${params[1]} ${rhs.substitute({ names, values })}`);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=binary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binary.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/binary.ts"],"names":[],"mappings":";;AAIA,0CAUC;AAbD,uDAA0D;AAC1D,8CAA2E;AAE3E,SAAgB,eAAe,CAC7B,MAAgE;IAEhE,MAAM,GAAG,GAAG,6BAAgB,CAAC,SAAS,CAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,MAAM,GAAG,GAAG,6BAAgB,CAAC,SAAS,CAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAErD,OAAO,mCAAmB,CAAC,IAAI,CAC7B,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,GAAG,GAAG,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAC3F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import type { ExpressionFormatter } from "../../expression.js";
|
|
3
|
+
import type { ConditionComparisonParams } from "../condition-comparison.js";
|
|
4
|
+
import type { RawConditionOperand } from "../operand.js";
|
|
5
|
+
export type EqualsParams = [RawConditionOperand, "=", RawConditionOperand];
|
|
6
|
+
export type Equals = ExpressionFormatter & Brand<"Equals">;
|
|
7
|
+
export declare const Equals: {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a condition that uses the `=` operator.
|
|
10
|
+
*
|
|
11
|
+
* @param params - The parameters of the `=` comparison. The first element contains the left-hand side operand,
|
|
12
|
+
* and the third element contains the right-hand side operand.
|
|
13
|
+
*
|
|
14
|
+
* @returns An {@link Equals} that evaluates to true if this operand is equal to the provided one.
|
|
15
|
+
*
|
|
16
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
17
|
+
*/
|
|
18
|
+
from(params: EqualsParams): Equals;
|
|
19
|
+
};
|
|
20
|
+
export declare function isEqualsParams(value: ConditionComparisonParams): value is EqualsParams;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Equals = void 0;
|
|
4
|
+
exports.isEqualsParams = isEqualsParams;
|
|
5
|
+
const types_1 = require("@infra-blocks/types");
|
|
6
|
+
const binary_js_1 = require("./binary.js");
|
|
7
|
+
exports.Equals = {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a condition that uses the `=` operator.
|
|
10
|
+
*
|
|
11
|
+
* @param params - The parameters of the `=` comparison. The first element contains the left-hand side operand,
|
|
12
|
+
* and the third element contains the right-hand side operand.
|
|
13
|
+
*
|
|
14
|
+
* @returns An {@link Equals} that evaluates to true if this operand is equal to the provided one.
|
|
15
|
+
*
|
|
16
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
17
|
+
*/
|
|
18
|
+
from(params) {
|
|
19
|
+
return (0, types_1.trusted)((0, binary_js_1.binaryOperation)(params));
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
function isEqualsParams(value) {
|
|
23
|
+
return value[1] === "=";
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=equals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equals.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/equals.ts"],"names":[],"mappings":";;;AA0BA,wCAIC;AA9BD,+CAA0D;AAI1D,2CAA8C;AAMjC,QAAA,MAAM,GAAG;IACpB;;;;;;;;;OASG;IACH,IAAI,CAAC,MAAoB;QACvB,OAAO,IAAA,eAAO,EAAC,IAAA,2BAAe,EAAC,MAAM,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF,CAAC;AAEF,SAAgB,cAAc,CAC5B,KAAgC;IAEhC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import type { ExpressionFormatter } from "../../expression.js";
|
|
3
|
+
import type { ConditionComparisonParams } from "../condition-comparison.js";
|
|
4
|
+
import type { ComparableOperand } from "./operand.js";
|
|
5
|
+
export type GreaterThanOrEqualsParams = [
|
|
6
|
+
ComparableOperand,
|
|
7
|
+
">=",
|
|
8
|
+
ComparableOperand
|
|
9
|
+
];
|
|
10
|
+
export type GreaterThanOrEquals = ExpressionFormatter & Brand<"GreaterThanOrEquals">;
|
|
11
|
+
export declare const GreaterThanOrEquals: {
|
|
12
|
+
/**
|
|
13
|
+
* Returns a condition that uses the `>=` operator.
|
|
14
|
+
*
|
|
15
|
+
* @param params - The parameters of the `>=` comparison. The first element contains the left-hand side operand,
|
|
16
|
+
* the third element contains the right-hand side operand.
|
|
17
|
+
*
|
|
18
|
+
* @returns A {@link GreaterThanOrEquals} that evaluates to true if this operand is greater than or equal to the provided one.
|
|
19
|
+
*
|
|
20
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
21
|
+
*/
|
|
22
|
+
from(params: GreaterThanOrEqualsParams): GreaterThanOrEquals;
|
|
23
|
+
};
|
|
24
|
+
export declare function isGreaterThanOrEqualsParams(value: ConditionComparisonParams): value is GreaterThanOrEqualsParams;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GreaterThanOrEquals = void 0;
|
|
4
|
+
exports.isGreaterThanOrEqualsParams = isGreaterThanOrEqualsParams;
|
|
5
|
+
const types_1 = require("@infra-blocks/types");
|
|
6
|
+
const binary_js_1 = require("./binary.js");
|
|
7
|
+
exports.GreaterThanOrEquals = {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a condition that uses the `>=` operator.
|
|
10
|
+
*
|
|
11
|
+
* @param params - The parameters of the `>=` comparison. The first element contains the left-hand side operand,
|
|
12
|
+
* the third element contains the right-hand side operand.
|
|
13
|
+
*
|
|
14
|
+
* @returns A {@link GreaterThanOrEquals} that evaluates to true if this operand is greater than or equal to the provided one.
|
|
15
|
+
*
|
|
16
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
17
|
+
*/
|
|
18
|
+
from(params) {
|
|
19
|
+
return (0, types_1.trusted)((0, binary_js_1.binaryOperation)(params));
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
function isGreaterThanOrEqualsParams(value) {
|
|
23
|
+
return value[1] === ">=";
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=greater-than-or-equals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greater-than-or-equals.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/greater-than-or-equals.ts"],"names":[],"mappings":";;;AA+BA,kEAIC;AAnCD,+CAA0D;AAG1D,2CAA8C;AAYjC,QAAA,mBAAmB,GAAG;IACjC;;;;;;;;;OASG;IACH,IAAI,CAAC,MAAiC;QACpC,OAAO,IAAA,eAAO,EAAC,IAAA,2BAAe,EAAkB,MAAM,CAAC,CAAC,CAAC;IAC3D,CAAC;CACF,CAAC;AAEF,SAAgB,2BAA2B,CACzC,KAAgC;IAEhC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import type { ExpressionFormatter } from "../../expression.js";
|
|
3
|
+
import type { ConditionComparisonParams } from "../condition-comparison.js";
|
|
4
|
+
import type { ComparableOperand } from "./operand.js";
|
|
5
|
+
export type GreaterThanParams = [ComparableOperand, ">", ComparableOperand];
|
|
6
|
+
export type GreaterThan = ExpressionFormatter & Brand<"GreaterThan">;
|
|
7
|
+
export declare const GreatThan: {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a condition that uses the `>` operator.
|
|
10
|
+
*
|
|
11
|
+
* @param params - The parameters of the `>` comparison. The first element contains the left-hand side operand,
|
|
12
|
+
* the third element contains the right-hand side operand.
|
|
13
|
+
*
|
|
14
|
+
* @returns A {@link GreaterThan} that evaluates to true if this operand is greater than the provided one.
|
|
15
|
+
*
|
|
16
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
17
|
+
*/
|
|
18
|
+
from(params: GreaterThanParams): GreaterThan;
|
|
19
|
+
};
|
|
20
|
+
export declare function isGreaterThanParams(value: ConditionComparisonParams): value is GreaterThanParams;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GreatThan = void 0;
|
|
4
|
+
exports.isGreaterThanParams = isGreaterThanParams;
|
|
5
|
+
const types_1 = require("@infra-blocks/types");
|
|
6
|
+
const binary_js_1 = require("./binary.js");
|
|
7
|
+
exports.GreatThan = {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a condition that uses the `>` operator.
|
|
10
|
+
*
|
|
11
|
+
* @param params - The parameters of the `>` comparison. The first element contains the left-hand side operand,
|
|
12
|
+
* the third element contains the right-hand side operand.
|
|
13
|
+
*
|
|
14
|
+
* @returns A {@link GreaterThan} that evaluates to true if this operand is greater than the provided one.
|
|
15
|
+
*
|
|
16
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
17
|
+
*/
|
|
18
|
+
from(params) {
|
|
19
|
+
return (0, types_1.trusted)((0, binary_js_1.binaryOperation)(params));
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
function isGreaterThanParams(value) {
|
|
23
|
+
return value[1] === ">";
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=greater-than.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greater-than.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/greater-than.ts"],"names":[],"mappings":";;;AA0BA,kDAIC;AA9BD,+CAA0D;AAG1D,2CAA8C;AAOjC,QAAA,SAAS,GAAG;IACvB;;;;;;;;;OASG;IACH,IAAI,CAAC,MAAyB;QAC5B,OAAO,IAAA,eAAO,EAAC,IAAA,2BAAe,EAAkB,MAAM,CAAC,CAAC,CAAC;IAC3D,CAAC;CACF,CAAC;AAEF,SAAgB,mBAAmB,CACjC,KAAgC;IAEhC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import { ExpressionFormatter } from "../../expression.js";
|
|
3
|
+
import type { ConditionComparisonParams } from "../condition-comparison.js";
|
|
4
|
+
import type { ComparableOperand } from "./operand.js";
|
|
5
|
+
export type InParams = [ComparableOperand, "IN", ComparableOperand[]];
|
|
6
|
+
export type In = ExpressionFormatter & Brand<"In">;
|
|
7
|
+
export declare const In: {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a condition that uses the `IN` operator.
|
|
10
|
+
*
|
|
11
|
+
* This function throws if the list of elements to compared against is empty or exceeds 100 elements.
|
|
12
|
+
*
|
|
13
|
+
* @param params - The parameters of the `IN` comparison. The first element contains the left-hand side operand,
|
|
14
|
+
* the third element contains the list of elements to compare against.
|
|
15
|
+
*
|
|
16
|
+
* @returns An {@link In} that evaluates to true if this operand is equal to any of the provided ones.
|
|
17
|
+
*
|
|
18
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
19
|
+
*/
|
|
20
|
+
from(params: InParams): In;
|
|
21
|
+
};
|
|
22
|
+
export declare function isInParams(value: ConditionComparisonParams): value is InParams;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.In = void 0;
|
|
4
|
+
exports.isInParams = isInParams;
|
|
5
|
+
const types_1 = require("@infra-blocks/types");
|
|
6
|
+
const expression_js_1 = require("../../expression.js");
|
|
7
|
+
const operand_js_1 = require("../operand.js");
|
|
8
|
+
exports.In = {
|
|
9
|
+
/**
|
|
10
|
+
* Returns a condition that uses the `IN` operator.
|
|
11
|
+
*
|
|
12
|
+
* This function throws if the list of elements to compared against is empty or exceeds 100 elements.
|
|
13
|
+
*
|
|
14
|
+
* @param params - The parameters of the `IN` comparison. The first element contains the left-hand side operand,
|
|
15
|
+
* the third element contains the list of elements to compare against.
|
|
16
|
+
*
|
|
17
|
+
* @returns An {@link In} that evaluates to true if this operand is equal to any of the provided ones.
|
|
18
|
+
*
|
|
19
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
20
|
+
*/
|
|
21
|
+
from(params) {
|
|
22
|
+
// TODO: unit test those limits
|
|
23
|
+
if (params[2].length === 0) {
|
|
24
|
+
throw new Error("the IN operator requires at least one operand.");
|
|
25
|
+
}
|
|
26
|
+
if (params[2].length > 100) {
|
|
27
|
+
throw new Error(`up to 100 operands are support for the IN operator, got ${params[2].length}`);
|
|
28
|
+
}
|
|
29
|
+
const element = operand_js_1.ConditionOperand.normalize(params[0]);
|
|
30
|
+
const elements = params[2].map((operand_js_1.ConditionOperand.normalize));
|
|
31
|
+
return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names, values }) => {
|
|
32
|
+
const elementsString = elements
|
|
33
|
+
.map((operand) => operand.substitute({ names, values }))
|
|
34
|
+
.join(",");
|
|
35
|
+
return `${element.substitute({ names, values })} IN (${elementsString})`;
|
|
36
|
+
}));
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
function isInParams(value) {
|
|
40
|
+
return value[1] === "IN";
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=in.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/in.ts"],"names":[],"mappings":";;;AAgDA,gCAIC;AApDD,+CAA0D;AAC1D,uDAA0D;AAG1D,8CAAiD;AAOpC,QAAA,EAAE,GAAG;IAChB;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,MAAgB;QACnB,+BAA+B;QAC/B,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;QACpE,CAAC;QACD,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,2DAA2D,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAC9E,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,GAAG,6BAAgB,CAAC,SAAS,CAAkB,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA,6BAAgB,CAAC,SAA0B,CAAA,CAAC,CAAC;QAC5E,OAAO,IAAA,eAAO,EACZ,mCAAmB,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;YAC7C,MAAM,cAAc,GAAG,QAAQ;iBAC5B,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAE,OAAmB,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;iBACpE,IAAI,CAAC,GAAG,CAAC,CAAC;YACb,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,QAAQ,cAAc,GAAG,CAAC;QAC3E,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,SAAgB,UAAU,CACxB,KAAgC;IAEhC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./between.js";
|
|
2
|
+
export * from "./equals.js";
|
|
3
|
+
export * from "./greater-than.js";
|
|
4
|
+
export * from "./greater-than-or-equals.js";
|
|
5
|
+
export * from "./in.js";
|
|
6
|
+
export * from "./lower-than.js";
|
|
7
|
+
export * from "./lower-than-or-equals.js";
|
|
8
|
+
export * from "./not-equals.js";
|
|
9
|
+
export * from "./operand.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
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("./between.js"), exports);
|
|
18
|
+
__exportStar(require("./equals.js"), exports);
|
|
19
|
+
__exportStar(require("./greater-than.js"), exports);
|
|
20
|
+
__exportStar(require("./greater-than-or-equals.js"), exports);
|
|
21
|
+
__exportStar(require("./in.js"), exports);
|
|
22
|
+
__exportStar(require("./lower-than.js"), exports);
|
|
23
|
+
__exportStar(require("./lower-than-or-equals.js"), exports);
|
|
24
|
+
__exportStar(require("./not-equals.js"), exports);
|
|
25
|
+
__exportStar(require("./operand.js"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,8CAA4B;AAC5B,oDAAkC;AAClC,8DAA4C;AAC5C,0CAAwB;AACxB,kDAAgC;AAChC,4DAA0C;AAC1C,kDAAgC;AAChC,+CAA6B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import type { ExpressionFormatter } from "../../expression.js";
|
|
3
|
+
import type { ConditionComparisonParams } from "../condition-comparison.js";
|
|
4
|
+
import type { ComparableOperand } from "./operand.js";
|
|
5
|
+
export type LowerThanOrEqualsParams = [
|
|
6
|
+
ComparableOperand,
|
|
7
|
+
"<=",
|
|
8
|
+
ComparableOperand
|
|
9
|
+
];
|
|
10
|
+
export type LowerThanOrEquals = ExpressionFormatter & Brand<"LowerThanOrEquals">;
|
|
11
|
+
export declare const LowerThanOrEquals: {
|
|
12
|
+
/**
|
|
13
|
+
* Returns a condition that uses the `<=` operator.
|
|
14
|
+
*
|
|
15
|
+
* @param params - The parameters of the `<=` comparison. The first element contains the left-hand side operand,
|
|
16
|
+
* the third element contains the right-hand side operand.
|
|
17
|
+
*
|
|
18
|
+
* @returns A {@link LowerThanOrEquals} that evaluates to true if this operand is lower than or equal to the provided one.
|
|
19
|
+
*
|
|
20
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
21
|
+
*/
|
|
22
|
+
from(params: LowerThanOrEqualsParams): LowerThanOrEquals;
|
|
23
|
+
};
|
|
24
|
+
export declare function isLowerThanOrEqualsParams(value: ConditionComparisonParams): value is LowerThanOrEqualsParams;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LowerThanOrEquals = void 0;
|
|
4
|
+
exports.isLowerThanOrEqualsParams = isLowerThanOrEqualsParams;
|
|
5
|
+
const types_1 = require("@infra-blocks/types");
|
|
6
|
+
const binary_js_1 = require("./binary.js");
|
|
7
|
+
exports.LowerThanOrEquals = {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a condition that uses the `<=` operator.
|
|
10
|
+
*
|
|
11
|
+
* @param params - The parameters of the `<=` comparison. The first element contains the left-hand side operand,
|
|
12
|
+
* the third element contains the right-hand side operand.
|
|
13
|
+
*
|
|
14
|
+
* @returns A {@link LowerThanOrEquals} that evaluates to true if this operand is lower than or equal to the provided one.
|
|
15
|
+
*
|
|
16
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
17
|
+
*/
|
|
18
|
+
from(params) {
|
|
19
|
+
return (0, types_1.trusted)((0, binary_js_1.binaryOperation)(params));
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
function isLowerThanOrEqualsParams(value) {
|
|
23
|
+
return value[1] === "<=";
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=lower-than-or-equals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lower-than-or-equals.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/lower-than-or-equals.ts"],"names":[],"mappings":";;;AA+BA,8DAIC;AAnCD,+CAA0D;AAG1D,2CAA8C;AAYjC,QAAA,iBAAiB,GAAG;IAC/B;;;;;;;;;OASG;IACH,IAAI,CAAC,MAA+B;QAClC,OAAO,IAAA,eAAO,EAAC,IAAA,2BAAe,EAAkB,MAAM,CAAC,CAAC,CAAC;IAC3D,CAAC;CACF,CAAC;AAEF,SAAgB,yBAAyB,CACvC,KAAgC;IAEhC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import type { ExpressionFormatter } from "../../expression.js";
|
|
3
|
+
import type { ConditionComparisonParams } from "../condition-comparison.js";
|
|
4
|
+
import type { ComparableOperand } from "./operand.js";
|
|
5
|
+
export type LowerThanParams = [ComparableOperand, "<", ComparableOperand];
|
|
6
|
+
export type LowerThan = ExpressionFormatter & Brand<"LowerThan">;
|
|
7
|
+
export declare const LowerThan: {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a condition that uses the `<` operator
|
|
10
|
+
*
|
|
11
|
+
* @param params - The parameters of the `<` comparison. The first element contains the left-hand side operand,
|
|
12
|
+
* the third element contains the right-hand side operand.
|
|
13
|
+
*
|
|
14
|
+
* @returns A {@link LowerThan} that evaluates to true if this operand is lower than the provided one.
|
|
15
|
+
*
|
|
16
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
17
|
+
*/
|
|
18
|
+
from(params: LowerThanParams): LowerThan;
|
|
19
|
+
};
|
|
20
|
+
export declare function isLowerThanParams(value: ConditionComparisonParams): value is LowerThanParams;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LowerThan = void 0;
|
|
4
|
+
exports.isLowerThanParams = isLowerThanParams;
|
|
5
|
+
const types_1 = require("@infra-blocks/types");
|
|
6
|
+
const binary_js_1 = require("./binary.js");
|
|
7
|
+
exports.LowerThan = {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a condition that uses the `<` operator
|
|
10
|
+
*
|
|
11
|
+
* @param params - The parameters of the `<` comparison. The first element contains the left-hand side operand,
|
|
12
|
+
* the third element contains the right-hand side operand.
|
|
13
|
+
*
|
|
14
|
+
* @returns A {@link LowerThan} that evaluates to true if this operand is lower than the provided one.
|
|
15
|
+
*
|
|
16
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
17
|
+
*/
|
|
18
|
+
from(params) {
|
|
19
|
+
return (0, types_1.trusted)((0, binary_js_1.binaryOperation)(params));
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
function isLowerThanParams(value) {
|
|
23
|
+
return value[1] === "<";
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=lower-than.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lower-than.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/lower-than.ts"],"names":[],"mappings":";;;AA0BA,8CAIC;AA9BD,+CAA0D;AAG1D,2CAA8C;AAOjC,QAAA,SAAS,GAAG;IACvB;;;;;;;;;OASG;IACH,IAAI,CAAC,MAAuB;QAC1B,OAAO,IAAA,eAAO,EAAC,IAAA,2BAAe,EAAkB,MAAM,CAAC,CAAC,CAAC;IAC3D,CAAC;CACF,CAAC;AAEF,SAAgB,iBAAiB,CAC/B,KAAgC;IAEhC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import type { ExpressionFormatter } from "../../expression.js";
|
|
3
|
+
import type { ConditionComparisonParams } from "../condition-comparison.js";
|
|
4
|
+
import type { RawConditionOperand } from "../operand.js";
|
|
5
|
+
export type NotEqualsParams = [RawConditionOperand, "<>", RawConditionOperand];
|
|
6
|
+
export type NotEquals = ExpressionFormatter & Brand<"NotEquals">;
|
|
7
|
+
export declare const NotEquals: {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a condition that uses the `<>` operator.
|
|
10
|
+
*
|
|
11
|
+
* @param params - The parameters of the `<>` comparison. The first element contains the left-hand side operand,
|
|
12
|
+
* the third element contains the right-hand side operand.
|
|
13
|
+
*
|
|
14
|
+
* @returns A {@link NotEquals} that evaluates to true if this operand is not equal to the provided one.
|
|
15
|
+
*
|
|
16
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
17
|
+
*/
|
|
18
|
+
from(params: NotEqualsParams): NotEquals;
|
|
19
|
+
};
|
|
20
|
+
export declare function isNotEqualsParams(value: ConditionComparisonParams): value is NotEqualsParams;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotEquals = void 0;
|
|
4
|
+
exports.isNotEqualsParams = isNotEqualsParams;
|
|
5
|
+
const types_1 = require("@infra-blocks/types");
|
|
6
|
+
const binary_js_1 = require("./binary.js");
|
|
7
|
+
exports.NotEquals = {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a condition that uses the `<>` operator.
|
|
10
|
+
*
|
|
11
|
+
* @param params - The parameters of the `<>` comparison. The first element contains the left-hand side operand,
|
|
12
|
+
* the third element contains the right-hand side operand.
|
|
13
|
+
*
|
|
14
|
+
* @returns A {@link NotEquals} that evaluates to true if this operand is not equal to the provided one.
|
|
15
|
+
*
|
|
16
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
|
|
17
|
+
*/
|
|
18
|
+
from(params) {
|
|
19
|
+
return (0, types_1.trusted)((0, binary_js_1.binaryOperation)(params));
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
function isNotEqualsParams(value) {
|
|
23
|
+
return value[1] === "<>";
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=not-equals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-equals.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/not-equals.ts"],"names":[],"mappings":";;;AA0BA,8CAIC;AA9BD,+CAA0D;AAI1D,2CAA8C;AAMjC,QAAA,SAAS,GAAG;IACvB;;;;;;;;;OASG;IACH,IAAI,CAAC,MAAuB;QAC1B,OAAO,IAAA,eAAO,EAAC,IAAA,2BAAe,EAAC,MAAM,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF,CAAC;AAEF,SAAgB,iBAAiB,CAC/B,KAAgC;IAEhC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NativeBinary, NativeNumber, NativeString } from "../../../../types.js";
|
|
2
|
+
import type { RawConditionOperand } from "../operand.js";
|
|
3
|
+
export type ComparableValue = NativeBinary | NativeNumber | NativeString;
|
|
4
|
+
export type ComparableOperand = RawConditionOperand<ComparableValue>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operand.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/operand.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Between, type BetweenParams } from "./comparisons/between.js";
|
|
2
|
+
import { Equals, type EqualsParams } from "./comparisons/equals.js";
|
|
3
|
+
import { type GreaterThan, type GreaterThanParams } from "./comparisons/greater-than.js";
|
|
4
|
+
import { GreaterThanOrEquals, type GreaterThanOrEqualsParams } from "./comparisons/greater-than-or-equals.js";
|
|
5
|
+
import { In, type InParams } from "./comparisons/in.js";
|
|
6
|
+
import { LowerThan, type LowerThanParams } from "./comparisons/lower-than.js";
|
|
7
|
+
import { LowerThanOrEquals, type LowerThanOrEqualsParams } from "./comparisons/lower-than-or-equals.js";
|
|
8
|
+
import { NotEquals, type NotEqualsParams } from "./comparisons/not-equals.js";
|
|
9
|
+
import type { ConditionParams } from "./condition.js";
|
|
10
|
+
export type ConditionComparisonParams = BetweenParams | EqualsParams | GreaterThanParams | GreaterThanOrEqualsParams | InParams | LowerThanParams | LowerThanOrEqualsParams | NotEqualsParams;
|
|
11
|
+
export type ConditionComparison = Between | Equals | GreaterThan | GreaterThanOrEquals | In | LowerThan | LowerThanOrEquals | NotEquals;
|
|
12
|
+
export declare const ConditionComparison: {
|
|
13
|
+
from(params: ConditionComparisonParams): ConditionComparison;
|
|
14
|
+
};
|
|
15
|
+
export declare function isConditionComparisonParams(params: ConditionParams): params is ConditionComparisonParams;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConditionComparison = void 0;
|
|
4
|
+
exports.isConditionComparisonParams = isConditionComparisonParams;
|
|
5
|
+
const types_1 = require("@infra-blocks/types");
|
|
6
|
+
const between_js_1 = require("./comparisons/between.js");
|
|
7
|
+
const equals_js_1 = require("./comparisons/equals.js");
|
|
8
|
+
const greater_than_js_1 = require("./comparisons/greater-than.js");
|
|
9
|
+
const greater_than_or_equals_js_1 = require("./comparisons/greater-than-or-equals.js");
|
|
10
|
+
const in_js_1 = require("./comparisons/in.js");
|
|
11
|
+
const lower_than_js_1 = require("./comparisons/lower-than.js");
|
|
12
|
+
const lower_than_or_equals_js_1 = require("./comparisons/lower-than-or-equals.js");
|
|
13
|
+
const not_equals_js_1 = require("./comparisons/not-equals.js");
|
|
14
|
+
exports.ConditionComparison = {
|
|
15
|
+
from(params) {
|
|
16
|
+
if ((0, between_js_1.isBetweenParams)(params)) {
|
|
17
|
+
return between_js_1.Between.from(params);
|
|
18
|
+
}
|
|
19
|
+
if ((0, equals_js_1.isEqualsParams)(params)) {
|
|
20
|
+
return equals_js_1.Equals.from(params);
|
|
21
|
+
}
|
|
22
|
+
if ((0, greater_than_js_1.isGreaterThanParams)(params)) {
|
|
23
|
+
return greater_than_js_1.GreatThan.from(params);
|
|
24
|
+
}
|
|
25
|
+
if ((0, greater_than_or_equals_js_1.isGreaterThanOrEqualsParams)(params)) {
|
|
26
|
+
return greater_than_or_equals_js_1.GreaterThanOrEquals.from(params);
|
|
27
|
+
}
|
|
28
|
+
if ((0, in_js_1.isInParams)(params)) {
|
|
29
|
+
return in_js_1.In.from(params);
|
|
30
|
+
}
|
|
31
|
+
if ((0, lower_than_js_1.isLowerThanParams)(params)) {
|
|
32
|
+
return lower_than_js_1.LowerThan.from(params);
|
|
33
|
+
}
|
|
34
|
+
if ((0, lower_than_or_equals_js_1.isLowerThanOrEqualsParams)(params)) {
|
|
35
|
+
return lower_than_or_equals_js_1.LowerThanOrEquals.from(params);
|
|
36
|
+
}
|
|
37
|
+
if ((0, not_equals_js_1.isNotEqualsParams)(params)) {
|
|
38
|
+
return not_equals_js_1.NotEquals.from(params);
|
|
39
|
+
}
|
|
40
|
+
(0, types_1.unreachable)(params);
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
function isConditionComparisonParams(params) {
|
|
44
|
+
const casted = params;
|
|
45
|
+
return ((0, between_js_1.isBetweenParams)(casted) ||
|
|
46
|
+
(0, equals_js_1.isEqualsParams)(casted) ||
|
|
47
|
+
(0, greater_than_js_1.isGreaterThanParams)(casted) ||
|
|
48
|
+
(0, greater_than_or_equals_js_1.isGreaterThanOrEqualsParams)(casted) ||
|
|
49
|
+
(0, in_js_1.isInParams)(casted) ||
|
|
50
|
+
(0, lower_than_js_1.isLowerThanParams)(casted) ||
|
|
51
|
+
(0, lower_than_or_equals_js_1.isLowerThanOrEqualsParams)(casted) ||
|
|
52
|
+
(0, not_equals_js_1.isNotEqualsParams)(casted));
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=condition-comparison.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"condition-comparison.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/condition-comparison.ts"],"names":[],"mappings":";;;AA2FA,kEAcC;AAzGD,+CAAkD;AAClD,yDAIkC;AAClC,uDAIiC;AACjC,mEAKuC;AACvC,uFAIiD;AACjD,+CAAoE;AACpE,+DAIqC;AACrC,mFAI+C;AAC/C,+DAIqC;AAwBxB,QAAA,mBAAmB,GAAG;IACjC,IAAI,CAAC,MAAiC;QACpC,IAAI,IAAA,4BAAe,EAAC,MAAM,CAAC,EAAE,CAAC;YAC5B,OAAO,oBAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;QACD,IAAI,IAAA,0BAAc,EAAC,MAAM,CAAC,EAAE,CAAC;YAC3B,OAAO,kBAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC;QACD,IAAI,IAAA,qCAAmB,EAAC,MAAM,CAAC,EAAE,CAAC;YAChC,OAAO,2BAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;QACD,IAAI,IAAA,uDAA2B,EAAC,MAAM,CAAC,EAAE,CAAC;YACxC,OAAO,+CAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC;QACD,IAAI,IAAA,kBAAU,EAAC,MAAM,CAAC,EAAE,CAAC;YACvB,OAAO,UAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;QACD,IAAI,IAAA,iCAAiB,EAAC,MAAM,CAAC,EAAE,CAAC;YAC9B,OAAO,yBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;QACD,IAAI,IAAA,mDAAyB,EAAC,MAAM,CAAC,EAAE,CAAC;YACtC,OAAO,2CAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,IAAA,iCAAiB,EAAC,MAAM,CAAC,EAAE,CAAC;YAC9B,OAAO,yBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;QACD,IAAA,mBAAW,EAAC,MAAM,CAAC,CAAC;IACtB,CAAC;CACF,CAAC;AAEF,SAAgB,2BAA2B,CACzC,MAAuB;IAEvB,MAAM,MAAM,GAAG,MAAmC,CAAC;IACnD,OAAO,CACL,IAAA,4BAAe,EAAC,MAAM,CAAC;QACvB,IAAA,0BAAc,EAAC,MAAM,CAAC;QACtB,IAAA,qCAAmB,EAAC,MAAM,CAAC;QAC3B,IAAA,uDAA2B,EAAC,MAAM,CAAC;QACnC,IAAA,kBAAU,EAAC,MAAM,CAAC;QAClB,IAAA,iCAAiB,EAAC,MAAM,CAAC;QACzB,IAAA,mDAAyB,EAAC,MAAM,CAAC;QACjC,IAAA,iCAAiB,EAAC,MAAM,CAAC,CAC1B,CAAC;AACJ,CAAC"}
|