@infra-blocks/aws-dynamodb 0.66.0-alpha.0 → 0.67.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 +1 -1
- package/lib/cjs/commands/expressions/condition/comparisons/between.js +2 -2
- package/lib/cjs/commands/expressions/condition/comparisons/between.js.map +1 -1
- package/lib/cjs/commands/expressions/condition/comparisons/binary.d.ts +1 -1
- package/lib/cjs/commands/expressions/condition/comparisons/binary.js +2 -2
- package/lib/cjs/commands/expressions/condition/comparisons/binary.js.map +1 -1
- package/lib/cjs/commands/expressions/condition/comparisons/equals.d.ts +1 -1
- package/lib/cjs/commands/expressions/condition/comparisons/greater-than-or-equals.d.ts +1 -1
- package/lib/cjs/commands/expressions/condition/comparisons/greater-than.d.ts +1 -1
- package/lib/cjs/commands/expressions/condition/comparisons/in.d.ts +1 -1
- package/lib/cjs/commands/expressions/condition/comparisons/in.js +4 -4
- package/lib/cjs/commands/expressions/condition/comparisons/in.js.map +1 -1
- package/lib/cjs/commands/expressions/condition/comparisons/lower-than-or-equals.d.ts +1 -1
- package/lib/cjs/commands/expressions/condition/comparisons/lower-than.d.ts +1 -1
- package/lib/cjs/commands/expressions/condition/comparisons/not-equals.d.ts +1 -1
- package/lib/cjs/commands/expressions/condition/logic.d.ts +1 -1
- package/lib/cjs/commands/expressions/condition/logic.js +4 -4
- package/lib/cjs/commands/expressions/condition/logic.js.map +1 -1
- package/lib/cjs/commands/expressions/{expression.d.ts → formatter.d.ts} +11 -0
- package/lib/cjs/commands/expressions/formatter.js +16 -0
- package/lib/cjs/commands/expressions/formatter.js.map +1 -0
- package/lib/cjs/commands/expressions/functions/attribute-exists.d.ts +1 -1
- package/lib/cjs/commands/expressions/functions/attribute-exists.js +2 -2
- package/lib/cjs/commands/expressions/functions/attribute-exists.js.map +1 -1
- package/lib/cjs/commands/expressions/functions/attribute-not-exists.d.ts +1 -1
- package/lib/cjs/commands/expressions/functions/attribute-not-exists.js +2 -2
- package/lib/cjs/commands/expressions/functions/attribute-not-exists.js.map +1 -1
- package/lib/cjs/commands/expressions/functions/attribute-type.d.ts +1 -1
- package/lib/cjs/commands/expressions/functions/attribute-type.js +2 -2
- package/lib/cjs/commands/expressions/functions/attribute-type.js.map +1 -1
- package/lib/cjs/commands/expressions/functions/begins-with.d.ts +1 -1
- package/lib/cjs/commands/expressions/functions/begins-with.js +2 -2
- package/lib/cjs/commands/expressions/functions/begins-with.js.map +1 -1
- package/lib/cjs/commands/expressions/functions/contains.d.ts +1 -1
- package/lib/cjs/commands/expressions/functions/contains.js +2 -2
- package/lib/cjs/commands/expressions/functions/contains.js.map +1 -1
- 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 +10 -1
- package/lib/cjs/commands/expressions/key-condition.js +11 -0
- package/lib/cjs/commands/expressions/key-condition.js.map +1 -1
- package/lib/cjs/commands/expressions/operands/operand.d.ts +0 -8
- package/lib/cjs/commands/expressions/operands/operand.js.map +1 -1
- package/lib/cjs/commands/expressions/operands/path.d.ts +10 -35
- package/lib/cjs/commands/expressions/operands/path.js +22 -48
- package/lib/cjs/commands/expressions/operands/path.js.map +1 -1
- package/lib/cjs/commands/expressions/operands/size.d.ts +9 -18
- package/lib/cjs/commands/expressions/operands/size.js +12 -21
- package/lib/cjs/commands/expressions/operands/size.js.map +1 -1
- package/lib/cjs/commands/expressions/operands/value.d.ts +20 -26
- package/lib/cjs/commands/expressions/operands/value.js +22 -41
- package/lib/cjs/commands/expressions/operands/value.js.map +1 -1
- package/lib/cjs/commands/expressions/projection.d.ts +2 -6
- package/lib/cjs/commands/expressions/projection.js +3 -3
- package/lib/cjs/commands/expressions/projection.js.map +1 -1
- package/lib/cjs/commands/expressions/update/action.d.ts +2 -2
- package/lib/cjs/commands/expressions/update/add.js +1 -1
- package/lib/cjs/commands/expressions/update/add.js.map +1 -1
- package/lib/cjs/commands/expressions/update/delete.js +1 -1
- package/lib/cjs/commands/expressions/update/delete.js.map +1 -1
- package/lib/cjs/commands/expressions/update/expression.d.ts +1 -1
- package/lib/cjs/commands/expressions/update/if-not-exists.d.ts +9 -15
- package/lib/cjs/commands/expressions/update/if-not-exists.js +10 -15
- package/lib/cjs/commands/expressions/update/if-not-exists.js.map +1 -1
- package/lib/cjs/commands/expressions/update/remove.js +1 -1
- package/lib/cjs/commands/expressions/update/remove.js.map +1 -1
- package/lib/cjs/commands/expressions/update/set.js +2 -2
- package/lib/cjs/commands/expressions/update/set.js.map +1 -1
- package/lib/cjs/commands/inputs/lib.d.ts +1 -1
- package/lib/cjs/types.d.ts +2 -0
- package/lib/cjs/types.js +2 -1
- package/lib/cjs/types.js.map +1 -1
- package/lib/esm/commands/expressions/condition/comparisons/between.d.ts +1 -1
- package/lib/esm/commands/expressions/condition/comparisons/between.js +2 -2
- package/lib/esm/commands/expressions/condition/comparisons/between.js.map +1 -1
- package/lib/esm/commands/expressions/condition/comparisons/binary.d.ts +1 -1
- package/lib/esm/commands/expressions/condition/comparisons/binary.js +2 -2
- package/lib/esm/commands/expressions/condition/comparisons/binary.js.map +1 -1
- package/lib/esm/commands/expressions/condition/comparisons/equals.d.ts +1 -1
- package/lib/esm/commands/expressions/condition/comparisons/greater-than-or-equals.d.ts +1 -1
- package/lib/esm/commands/expressions/condition/comparisons/greater-than.d.ts +1 -1
- package/lib/esm/commands/expressions/condition/comparisons/in.d.ts +1 -1
- package/lib/esm/commands/expressions/condition/comparisons/in.js +3 -3
- package/lib/esm/commands/expressions/condition/comparisons/in.js.map +1 -1
- package/lib/esm/commands/expressions/condition/comparisons/lower-than-or-equals.d.ts +1 -1
- package/lib/esm/commands/expressions/condition/comparisons/lower-than.d.ts +1 -1
- package/lib/esm/commands/expressions/condition/comparisons/not-equals.d.ts +1 -1
- package/lib/esm/commands/expressions/condition/logic.d.ts +1 -1
- package/lib/esm/commands/expressions/condition/logic.js +1 -1
- package/lib/esm/commands/expressions/condition/logic.js.map +1 -1
- package/lib/esm/commands/expressions/{expression.d.ts → formatter.d.ts} +11 -0
- package/lib/esm/commands/expressions/formatter.js +12 -0
- package/lib/esm/commands/expressions/formatter.js.map +1 -0
- package/lib/esm/commands/expressions/functions/attribute-exists.d.ts +1 -1
- package/lib/esm/commands/expressions/functions/attribute-exists.js +2 -2
- package/lib/esm/commands/expressions/functions/attribute-exists.js.map +1 -1
- package/lib/esm/commands/expressions/functions/attribute-not-exists.d.ts +1 -1
- package/lib/esm/commands/expressions/functions/attribute-not-exists.js +2 -2
- package/lib/esm/commands/expressions/functions/attribute-not-exists.js.map +1 -1
- package/lib/esm/commands/expressions/functions/attribute-type.d.ts +1 -1
- package/lib/esm/commands/expressions/functions/attribute-type.js +2 -2
- package/lib/esm/commands/expressions/functions/attribute-type.js.map +1 -1
- package/lib/esm/commands/expressions/functions/begins-with.d.ts +1 -1
- package/lib/esm/commands/expressions/functions/begins-with.js +2 -2
- package/lib/esm/commands/expressions/functions/begins-with.js.map +1 -1
- package/lib/esm/commands/expressions/functions/contains.d.ts +1 -1
- package/lib/esm/commands/expressions/functions/contains.js +2 -2
- package/lib/esm/commands/expressions/functions/contains.js.map +1 -1
- 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 +10 -1
- package/lib/esm/commands/expressions/key-condition.js +10 -1
- package/lib/esm/commands/expressions/key-condition.js.map +1 -1
- package/lib/esm/commands/expressions/operands/operand.d.ts +0 -8
- package/lib/esm/commands/expressions/operands/operand.js.map +1 -1
- package/lib/esm/commands/expressions/operands/path.d.ts +10 -35
- package/lib/esm/commands/expressions/operands/path.js +20 -46
- package/lib/esm/commands/expressions/operands/path.js.map +1 -1
- package/lib/esm/commands/expressions/operands/size.d.ts +9 -18
- package/lib/esm/commands/expressions/operands/size.js +12 -20
- package/lib/esm/commands/expressions/operands/size.js.map +1 -1
- package/lib/esm/commands/expressions/operands/value.d.ts +20 -26
- package/lib/esm/commands/expressions/operands/value.js +20 -39
- package/lib/esm/commands/expressions/operands/value.js.map +1 -1
- package/lib/esm/commands/expressions/projection.d.ts +2 -6
- package/lib/esm/commands/expressions/projection.js +2 -2
- package/lib/esm/commands/expressions/projection.js.map +1 -1
- package/lib/esm/commands/expressions/update/action.d.ts +2 -2
- package/lib/esm/commands/expressions/update/add.js +1 -1
- package/lib/esm/commands/expressions/update/add.js.map +1 -1
- package/lib/esm/commands/expressions/update/delete.js +1 -1
- package/lib/esm/commands/expressions/update/delete.js.map +1 -1
- package/lib/esm/commands/expressions/update/expression.d.ts +1 -1
- package/lib/esm/commands/expressions/update/if-not-exists.d.ts +9 -15
- package/lib/esm/commands/expressions/update/if-not-exists.js +10 -14
- package/lib/esm/commands/expressions/update/if-not-exists.js.map +1 -1
- package/lib/esm/commands/expressions/update/remove.js +1 -1
- package/lib/esm/commands/expressions/update/remove.js.map +1 -1
- package/lib/esm/commands/expressions/update/set.js +2 -2
- package/lib/esm/commands/expressions/update/set.js.map +1 -1
- package/lib/esm/commands/inputs/lib.d.ts +1 -1
- package/lib/esm/types.d.ts +2 -0
- package/lib/esm/types.js +1 -0
- package/lib/esm/types.js.map +1 -1
- package/package.json +1 -1
- package/lib/cjs/commands/expressions/expression.js +0 -11
- package/lib/cjs/commands/expressions/expression.js.map +0 -1
- package/lib/esm/commands/expressions/expression.js +0 -8
- package/lib/esm/commands/expressions/expression.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Brand } from "@infra-blocks/types";
|
|
2
|
-
import { ExpressionFormatter } from "../../
|
|
2
|
+
import { ExpressionFormatter } from "../../formatter.js";
|
|
3
3
|
import type { ConditionComparisonInput } from "../condition-comparison.js";
|
|
4
4
|
import type { ComparableOperand } from "./operand.js";
|
|
5
5
|
export type BetweenInput = [
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Between = void 0;
|
|
4
4
|
exports.isBetweenInput = isBetweenInput;
|
|
5
5
|
const types_1 = require("@infra-blocks/types");
|
|
6
|
-
const
|
|
6
|
+
const formatter_js_1 = require("../../formatter.js");
|
|
7
7
|
const operand_js_1 = require("../operand.js");
|
|
8
8
|
function isBetweenInput(value) {
|
|
9
9
|
return value[1] === "BETWEEN" && value[3] === "AND";
|
|
@@ -25,7 +25,7 @@ exports.Between = {
|
|
|
25
25
|
const lhs = operand_js_1.ConditionOperand.normalize(input[0]);
|
|
26
26
|
const lower = operand_js_1.ConditionOperand.normalize(input[2]);
|
|
27
27
|
const upper = operand_js_1.ConditionOperand.normalize(input[4]);
|
|
28
|
-
return (0, types_1.trusted)(
|
|
28
|
+
return (0, types_1.trusted)(formatter_js_1.ExpressionFormatter.from(({ names, values }) => `${lhs.format({ names, values })} BETWEEN ${lower.format({ names, values })} AND ${upper.format({ names, values })}`));
|
|
29
29
|
},
|
|
30
30
|
};
|
|
31
31
|
//# sourceMappingURL=between.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"between.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/between.ts"],"names":[],"mappings":";;;AAcA,wCAIC;AAlBD,+CAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"between.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/between.ts"],"names":[],"mappings":";;;AAcA,wCAIC;AAlBD,+CAA0D;AAC1D,qDAAyD;AAEzD,8CAAiD;AAWjD,SAAgB,cAAc,CAC5B,KAA+B;IAE/B,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,KAAmB;QACtB,MAAM,GAAG,GAAG,6BAAgB,CAAC,SAAS,CAAkB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAClE,MAAM,KAAK,GAAG,6BAAgB,CAAC,SAAS,CAAkB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,MAAM,KAAK,GAAG,6BAAgB,CAAC,SAAS,CAAkB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAEpE,OAAO,IAAA,eAAO,EACZ,kCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,YAAY,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,QAAQ,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CACvH,CACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AttributeValue } from "../../../../types.js";
|
|
2
|
-
import { ExpressionFormatter } from "../../
|
|
2
|
+
import { ExpressionFormatter } from "../../formatter.js";
|
|
3
3
|
import { type RawConditionOperand } from "../operand.js";
|
|
4
4
|
export declare function binaryOperation<T extends AttributeValue = AttributeValue>(params: [RawConditionOperand<T>, string, RawConditionOperand<T>]): ExpressionFormatter;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.binaryOperation = binaryOperation;
|
|
4
|
-
const
|
|
4
|
+
const formatter_js_1 = require("../../formatter.js");
|
|
5
5
|
const operand_js_1 = require("../operand.js");
|
|
6
6
|
function binaryOperation(params) {
|
|
7
7
|
const lhs = operand_js_1.ConditionOperand.normalize(params[0]);
|
|
8
8
|
const rhs = operand_js_1.ConditionOperand.normalize(params[2]);
|
|
9
|
-
return
|
|
9
|
+
return formatter_js_1.ExpressionFormatter.from(({ names, values }) => `${lhs.format({ names, values })} ${params[1]} ${rhs.format({ names, values })}`);
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=binary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/binary.ts"],"names":[],"mappings":";;AAIA,0CAUC;AAbD,
|
|
1
|
+
{"version":3,"file":"binary.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/binary.ts"],"names":[],"mappings":";;AAIA,0CAUC;AAbD,qDAAyD;AACzD,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,kCAAmB,CAAC,IAAI,CAC7B,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CACnF,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Brand } from "@infra-blocks/types";
|
|
2
|
-
import type { ExpressionFormatter } from "../../
|
|
2
|
+
import type { ExpressionFormatter } from "../../formatter.js";
|
|
3
3
|
import type { ConditionComparisonInput } from "../condition-comparison.js";
|
|
4
4
|
import type { RawConditionOperand } from "../operand.js";
|
|
5
5
|
export type EqualsInput = [RawConditionOperand, "=", RawConditionOperand];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Brand } from "@infra-blocks/types";
|
|
2
|
-
import type { ExpressionFormatter } from "../../
|
|
2
|
+
import type { ExpressionFormatter } from "../../formatter.js";
|
|
3
3
|
import type { ConditionComparisonInput } from "../condition-comparison.js";
|
|
4
4
|
import type { ComparableOperand } from "./operand.js";
|
|
5
5
|
export type GreaterThanOrEqualsInput = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Brand } from "@infra-blocks/types";
|
|
2
|
-
import type { ExpressionFormatter } from "../../
|
|
2
|
+
import type { ExpressionFormatter } from "../../formatter.js";
|
|
3
3
|
import type { ConditionComparisonInput } from "../condition-comparison.js";
|
|
4
4
|
import type { ComparableOperand } from "./operand.js";
|
|
5
5
|
export type GreaterThanInput = [ComparableOperand, ">", ComparableOperand];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Brand } from "@infra-blocks/types";
|
|
2
|
-
import { ExpressionFormatter } from "../../
|
|
2
|
+
import { ExpressionFormatter } from "../../formatter.js";
|
|
3
3
|
import type { ConditionComparisonInput } from "../condition-comparison.js";
|
|
4
4
|
import type { ComparableOperand } from "./operand.js";
|
|
5
5
|
export type InInput = [ComparableOperand, "IN", ComparableOperand[]];
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.In = void 0;
|
|
4
4
|
exports.isInInput = isInInput;
|
|
5
5
|
const types_1 = require("@infra-blocks/types");
|
|
6
|
-
const
|
|
6
|
+
const formatter_js_1 = require("../../formatter.js");
|
|
7
7
|
const operand_js_1 = require("../operand.js");
|
|
8
8
|
exports.In = {
|
|
9
9
|
/**
|
|
@@ -28,11 +28,11 @@ exports.In = {
|
|
|
28
28
|
}
|
|
29
29
|
const element = operand_js_1.ConditionOperand.normalize(input[0]);
|
|
30
30
|
const elements = input[2].map((operand_js_1.ConditionOperand.normalize));
|
|
31
|
-
return (0, types_1.trusted)(
|
|
31
|
+
return (0, types_1.trusted)(formatter_js_1.ExpressionFormatter.from(({ names, values }) => {
|
|
32
32
|
const elementsString = elements
|
|
33
|
-
.map((operand) => operand.
|
|
33
|
+
.map((operand) => operand.format({ names, values }))
|
|
34
34
|
.join(",");
|
|
35
|
-
return `${element.
|
|
35
|
+
return `${element.format({ names, values })} IN (${elementsString})`;
|
|
36
36
|
}));
|
|
37
37
|
},
|
|
38
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/in.ts"],"names":[],"mappings":";;;AAgDA,8BAEC;AAlDD,+CAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"in.js","sourceRoot":"","sources":["../../../../../../src/commands/expressions/condition/comparisons/in.ts"],"names":[],"mappings":";;;AAgDA,8BAEC;AAlDD,+CAA0D;AAC1D,qDAAyD;AAGzD,8CAAiD;AAOpC,QAAA,EAAE,GAAG;IAChB;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,KAAc;QACjB,+BAA+B;QAC/B,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;QACpE,CAAC;QACD,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CACb,2DAA2D,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAC7E,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,GAAG,6BAAgB,CAAC,SAAS,CAAkB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACtE,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA,6BAAgB,CAAC,SAA0B,CAAA,CAAC,CAAC;QAC3E,OAAO,IAAA,eAAO,EACZ,kCAAmB,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,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;iBAChE,IAAI,CAAC,GAAG,CAAC,CAAC;YACb,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,QAAQ,cAAc,GAAG,CAAC;QACvE,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,SAAgB,SAAS,CAAC,KAA+B;IACvD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAC3B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Brand } from "@infra-blocks/types";
|
|
2
|
-
import type { ExpressionFormatter } from "../../
|
|
2
|
+
import type { ExpressionFormatter } from "../../formatter.js";
|
|
3
3
|
import type { ConditionComparisonInput } from "../condition-comparison.js";
|
|
4
4
|
import type { ComparableOperand } from "./operand.js";
|
|
5
5
|
export type LowerThanOrEqualsInput = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Brand } from "@infra-blocks/types";
|
|
2
|
-
import type { ExpressionFormatter } from "../../
|
|
2
|
+
import type { ExpressionFormatter } from "../../formatter.js";
|
|
3
3
|
import type { ConditionComparisonInput } from "../condition-comparison.js";
|
|
4
4
|
import type { ComparableOperand } from "./operand.js";
|
|
5
5
|
export type LowerThanInput = [ComparableOperand, "<", ComparableOperand];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Brand } from "@infra-blocks/types";
|
|
2
|
-
import type { ExpressionFormatter } from "../../
|
|
2
|
+
import type { ExpressionFormatter } from "../../formatter.js";
|
|
3
3
|
import type { ConditionComparisonInput } from "../condition-comparison.js";
|
|
4
4
|
import type { RawConditionOperand } from "../operand.js";
|
|
5
5
|
export type NotEqualsInput = [RawConditionOperand, "<>", RawConditionOperand];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Brand } from "@infra-blocks/types";
|
|
2
|
-
import { ExpressionFormatter } from "../
|
|
2
|
+
import { ExpressionFormatter } from "../formatter.js";
|
|
3
3
|
import { type ConditionInput } from "./condition.js";
|
|
4
4
|
export type Not = ExpressionFormatter & Brand<"Not">;
|
|
5
5
|
/**
|
|
@@ -4,7 +4,7 @@ exports.not = not;
|
|
|
4
4
|
exports.and = and;
|
|
5
5
|
exports.or = or;
|
|
6
6
|
const types_1 = require("@infra-blocks/types");
|
|
7
|
-
const
|
|
7
|
+
const formatter_js_1 = require("../formatter.js");
|
|
8
8
|
const condition_js_1 = require("./condition.js");
|
|
9
9
|
/**
|
|
10
10
|
* Negates the provided condition using the `NOT` operator.
|
|
@@ -17,7 +17,7 @@ const condition_js_1 = require("./condition.js");
|
|
|
17
17
|
*/
|
|
18
18
|
function not(condition) {
|
|
19
19
|
const expression = condition_js_1.Condition.from(condition);
|
|
20
|
-
return (0, types_1.trusted)(
|
|
20
|
+
return (0, types_1.trusted)(formatter_js_1.ExpressionFormatter.from(({ names, values }) => `(NOT ${expression.format({ names, values })})`));
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Returns a condition that combines the provided ones using the `AND` operator.
|
|
@@ -32,7 +32,7 @@ function not(condition) {
|
|
|
32
32
|
function and(lhs, rhs) {
|
|
33
33
|
const left = condition_js_1.Condition.from(lhs);
|
|
34
34
|
const right = condition_js_1.Condition.from(rhs);
|
|
35
|
-
return (0, types_1.trusted)(
|
|
35
|
+
return (0, types_1.trusted)(formatter_js_1.ExpressionFormatter.from(({ names, values }) => `(${left.format({ names, values })} AND ${right.format({
|
|
36
36
|
names,
|
|
37
37
|
values,
|
|
38
38
|
})})`));
|
|
@@ -50,7 +50,7 @@ function and(lhs, rhs) {
|
|
|
50
50
|
function or(lhs, rhs) {
|
|
51
51
|
const left = condition_js_1.Condition.from(lhs);
|
|
52
52
|
const right = condition_js_1.Condition.from(rhs);
|
|
53
|
-
return (0, types_1.trusted)(
|
|
53
|
+
return (0, types_1.trusted)(formatter_js_1.ExpressionFormatter.from(({ names, values }) => `(${left.format({ names, values })} OR ${right.format({
|
|
54
54
|
names,
|
|
55
55
|
values,
|
|
56
56
|
})})`));
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,kDAAsD;AACtD,iDAAgE;AAIhE;;;;;;;;GAQG;AACH,SAAgB,GAAG,CAAC,SAAyB;IAC3C,MAAM,UAAU,GAAG,wBAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC7C,OAAO,IAAA,eAAO,EACZ,kCAAmB,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,GAAmB,EAAE,GAAmB;IAC1D,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,kCAAmB,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,GAAmB,EAAE,GAAmB;IACzD,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,kCAAmB,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"}
|
|
@@ -9,6 +9,17 @@ export type ExpressionFormatter = {
|
|
|
9
9
|
values: AttributeValues;
|
|
10
10
|
}): string;
|
|
11
11
|
};
|
|
12
|
+
export type PathFormatter = {
|
|
13
|
+
format(params: {
|
|
14
|
+
names: AttributeNames;
|
|
15
|
+
}): string;
|
|
16
|
+
};
|
|
17
|
+
export type ValueFormatter = {
|
|
18
|
+
format(params: {
|
|
19
|
+
values: AttributeValues;
|
|
20
|
+
}): string;
|
|
21
|
+
};
|
|
12
22
|
export declare const ExpressionFormatter: {
|
|
13
23
|
from(formatter: Formatter): ExpressionFormatter;
|
|
14
24
|
};
|
|
25
|
+
export declare function isExpressionFormatter(value: unknown): value is ExpressionFormatter;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExpressionFormatter = void 0;
|
|
4
|
+
exports.isExpressionFormatter = isExpressionFormatter;
|
|
5
|
+
const types_1 = require("@infra-blocks/types");
|
|
6
|
+
exports.ExpressionFormatter = {
|
|
7
|
+
from(formatter) {
|
|
8
|
+
return {
|
|
9
|
+
format: formatter,
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
function isExpressionFormatter(value) {
|
|
14
|
+
return ((0, types_1.isObjectNotNull)(value) && "format" in value && (0, types_1.isFunction)(value.format));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../../../src/commands/expressions/formatter.ts"],"names":[],"mappings":";;;AA4BA,sDAMC;AAlCD,+CAAkE;AAoBrD,QAAA,mBAAmB,GAAG;IACjC,IAAI,CAAC,SAAoB;QACvB,OAAO;YACL,MAAM,EAAE,SAAS;SAClB,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,SAAgB,qBAAqB,CACnC,KAAc;IAEd,OAAO,CACL,IAAA,uBAAe,EAAC,KAAK,CAAC,IAAI,QAAQ,IAAI,KAAK,IAAI,IAAA,kBAAU,EAAC,KAAK,CAAC,MAAM,CAAC,CACxE,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Brand } from "@infra-blocks/types";
|
|
2
|
-
import { ExpressionFormatter } from "../
|
|
2
|
+
import { ExpressionFormatter } from "../formatter.js";
|
|
3
3
|
import { type RawPath } from "../operands/path.js";
|
|
4
4
|
export type AttributeExists = ExpressionFormatter & Brand<"AttributeExists">;
|
|
5
5
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.attributeExists = attributeExists;
|
|
4
4
|
const types_1 = require("@infra-blocks/types");
|
|
5
|
-
const
|
|
5
|
+
const formatter_js_1 = require("../formatter.js");
|
|
6
6
|
const path_js_1 = require("../operands/path.js");
|
|
7
7
|
/**
|
|
8
8
|
* Returns a condition that uses the `attribute_exists` function.
|
|
@@ -14,6 +14,6 @@ const path_js_1 = require("../operands/path.js");
|
|
|
14
14
|
*/
|
|
15
15
|
function attributeExists(rawPath) {
|
|
16
16
|
const path = path_js_1.Path.normalize(rawPath);
|
|
17
|
-
return (0, types_1.trusted)(
|
|
17
|
+
return (0, types_1.trusted)(formatter_js_1.ExpressionFormatter.from(({ names }) => `attribute_exists(${path.format({ names })})`));
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=attribute-exists.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attribute-exists.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/attribute-exists.ts"],"names":[],"mappings":";;AAcA,0CAOC;AArBD,+CAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"attribute-exists.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/attribute-exists.ts"],"names":[],"mappings":";;AAcA,0CAOC;AArBD,+CAA0D;AAC1D,kDAAsD;AACtD,iDAAyD;AAIzD;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,OAAgB;IAC9C,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,IAAA,eAAO,EACZ,kCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,oBAAoB,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAC7D,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Brand } from "@infra-blocks/types";
|
|
2
|
-
import { ExpressionFormatter } from "../
|
|
2
|
+
import { ExpressionFormatter } from "../formatter.js";
|
|
3
3
|
import { type RawPath } from "../operands/path.js";
|
|
4
4
|
export type AttributeNotExists = ExpressionFormatter & Brand<"AttributeNotExists">;
|
|
5
5
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.attributeNotExists = attributeNotExists;
|
|
4
4
|
const types_1 = require("@infra-blocks/types");
|
|
5
|
-
const
|
|
5
|
+
const formatter_js_1 = require("../formatter.js");
|
|
6
6
|
const path_js_1 = require("../operands/path.js");
|
|
7
7
|
/**
|
|
8
8
|
* Returns a condition that uses the `attribute_not_exists` function.
|
|
@@ -14,6 +14,6 @@ const path_js_1 = require("../operands/path.js");
|
|
|
14
14
|
*/
|
|
15
15
|
function attributeNotExists(rawPath) {
|
|
16
16
|
const path = path_js_1.Path.normalize(rawPath);
|
|
17
|
-
return (0, types_1.trusted)(
|
|
17
|
+
return (0, types_1.trusted)(formatter_js_1.ExpressionFormatter.from(({ names }) => `attribute_not_exists(${path.format({ names })})`));
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=attribute-not-exists.js.map
|
|
@@ -1 +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,
|
|
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,kDAAsD;AACtD,iDAAyD;AAKzD;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,OAAgB;IACjD,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,IAAA,eAAO,EACZ,kCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,wBAAwB,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CACjE,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Brand } from "@infra-blocks/types";
|
|
2
2
|
import type { AttributeType } from "../../../types.js";
|
|
3
|
-
import { ExpressionFormatter } from "../
|
|
3
|
+
import { ExpressionFormatter } from "../formatter.js";
|
|
4
4
|
import { type RawPath } from "../operands/path.js";
|
|
5
5
|
import { type RawValue } from "../operands/value.js";
|
|
6
6
|
export type IsAttributeOfType = ExpressionFormatter & Brand<"IsAttributeOfType">;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.attributeType = attributeType;
|
|
4
4
|
const types_1 = require("@infra-blocks/types");
|
|
5
|
-
const
|
|
5
|
+
const formatter_js_1 = require("../formatter.js");
|
|
6
6
|
const path_js_1 = require("../operands/path.js");
|
|
7
7
|
const value_js_1 = require("../operands/value.js");
|
|
8
8
|
/**
|
|
@@ -18,6 +18,6 @@ const value_js_1 = require("../operands/value.js");
|
|
|
18
18
|
function attributeType(attribute, rawType) {
|
|
19
19
|
const path = path_js_1.Path.normalize(attribute);
|
|
20
20
|
const type = value_js_1.Value.normalize(rawType);
|
|
21
|
-
return (0, types_1.trusted)(
|
|
21
|
+
return (0, types_1.trusted)(formatter_js_1.ExpressionFormatter.from(({ names, values }) => `attribute_type(${path.format({ names })}, ${type.format({ values })})`));
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=attribute-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attribute-type.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/attribute-type.ts"],"names":[],"mappings":";;AAoBA,sCAYC;AAhCD,+CAA0D;AAE1D,
|
|
1
|
+
{"version":3,"file":"attribute-type.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/attribute-type.ts"],"names":[],"mappings":";;AAoBA,sCAYC;AAhCD,+CAA0D;AAE1D,kDAAsD;AACtD,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,kCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,kBAAkB,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAC1E,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Brand } from "@infra-blocks/types";
|
|
2
2
|
import type { NativeBinary, NativeString } from "../../../types.js";
|
|
3
|
-
import { ExpressionFormatter } from "../
|
|
3
|
+
import { ExpressionFormatter } from "../formatter.js";
|
|
4
4
|
import { type RawOperand } from "../operands/operand.js";
|
|
5
5
|
/**
|
|
6
6
|
* This type aggregates the types of operands that can be used with the {@link beginsWith} function.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.beginsWith = beginsWith;
|
|
4
4
|
const types_1 = require("@infra-blocks/types");
|
|
5
|
-
const
|
|
5
|
+
const formatter_js_1 = require("../formatter.js");
|
|
6
6
|
const operand_js_1 = require("../operands/operand.js");
|
|
7
7
|
/**
|
|
8
8
|
* Returns a condition that uses the `begins_with` function.
|
|
@@ -17,6 +17,6 @@ const operand_js_1 = require("../operands/operand.js");
|
|
|
17
17
|
function beginsWith(first, second) {
|
|
18
18
|
const firstOperand = (0, operand_js_1.operand)(first);
|
|
19
19
|
const secondOperand = (0, operand_js_1.operand)(second);
|
|
20
|
-
return (0, types_1.trusted)(
|
|
20
|
+
return (0, types_1.trusted)(formatter_js_1.ExpressionFormatter.from(({ names, values }) => `begins_with(${firstOperand.format({ names, values })}, ${secondOperand.format({ names, values })})`));
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=begins-with.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"begins-with.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/begins-with.ts"],"names":[],"mappings":";;AAwBA,gCAaC;AArCD,+CAA0D;AAE1D,
|
|
1
|
+
{"version":3,"file":"begins-with.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/begins-with.ts"],"names":[],"mappings":";;AAwBA,gCAaC;AArCD,+CAA0D;AAE1D,kDAAsD;AACtD,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,kCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,eAAe,YAAY,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,KAAK,aAAa,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,CACvG,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Brand } from "@infra-blocks/types";
|
|
2
|
-
import { ExpressionFormatter } from "../
|
|
2
|
+
import { ExpressionFormatter } from "../formatter.js";
|
|
3
3
|
import { type RawOperand } from "../operands/operand.js";
|
|
4
4
|
import { type Size } from "../operands/size.js";
|
|
5
5
|
export type Contains = ExpressionFormatter & Brand<"Contains">;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.contains = contains;
|
|
4
4
|
const types_1 = require("@infra-blocks/types");
|
|
5
|
-
const
|
|
5
|
+
const formatter_js_1 = require("../formatter.js");
|
|
6
6
|
const operand_js_1 = require("../operands/operand.js");
|
|
7
7
|
const size_js_1 = require("../operands/size.js");
|
|
8
8
|
/**
|
|
@@ -18,6 +18,6 @@ const size_js_1 = require("../operands/size.js");
|
|
|
18
18
|
function contains(first, second) {
|
|
19
19
|
const firstOperand = (0, operand_js_1.operand)(first);
|
|
20
20
|
const secondOperand = (0, size_js_1.isSize)(second) ? second : (0, operand_js_1.operand)(second);
|
|
21
|
-
return (0, types_1.trusted)(
|
|
21
|
+
return (0, types_1.trusted)(formatter_js_1.ExpressionFormatter.from(({ names, values }) => `contains(${firstOperand.format({ names, values })}, ${secondOperand.format({ names, values })})`));
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=contains.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contains.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/contains.ts"],"names":[],"mappings":";;AAiBA,4BAaC;AA9BD,+CAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"contains.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/contains.ts"],"names":[],"mappings":";;AAiBA,4BAaC;AA9BD,+CAA0D;AAC1D,kDAAsD;AACtD,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,kCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,YAAY,YAAY,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,KAAK,aAAa,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,CACpG,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// TODO: don't export the typeguards beyond here.
|
|
17
18
|
__exportStar(require("./condition/index.js"), exports);
|
|
18
19
|
__exportStar(require("./functions/index.js"), exports);
|
|
19
20
|
__exportStar(require("./key-condition.js"), exports);
|
|
@@ -1 +1 @@
|
|
|
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
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/expressions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAAiD;AACjD,uDAAqC;AACrC,uDAAqC;AACrC,qDAAmC;AACnC,sDAAoC;AACpC,kDAAgC;AAChC,oDAAkC"}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
2
|
+
import { type ConditionInput } from "./condition/index.js";
|
|
3
|
+
import type { ExpressionFormatter } from "./formatter.js";
|
|
4
|
+
import type { BeginsWith } from "./functions/begins-with.js";
|
|
2
5
|
export type KeyConditionInput = ConditionInput;
|
|
6
|
+
export type KeyConditionComparison = never;
|
|
7
|
+
export type KeyConditionFunction = BeginsWith;
|
|
8
|
+
export type KeyCondition = ExpressionFormatter & Brand<"KeyCondition">;
|
|
9
|
+
export declare const KeyCondition: {
|
|
10
|
+
from(input: KeyConditionInput): KeyCondition;
|
|
11
|
+
};
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyCondition = void 0;
|
|
4
|
+
const types_1 = require("@infra-blocks/types");
|
|
5
|
+
const index_js_1 = require("./condition/index.js");
|
|
6
|
+
exports.KeyCondition = {
|
|
7
|
+
from(input) {
|
|
8
|
+
return (0, types_1.trusted)({
|
|
9
|
+
// Same as a condition, just supports a subset of inputs.
|
|
10
|
+
...index_js_1.Condition.from(input),
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
};
|
|
3
14
|
//# sourceMappingURL=key-condition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-condition.js","sourceRoot":"","sources":["../../../../src/commands/expressions/key-condition.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"key-condition.js","sourceRoot":"","sources":["../../../../src/commands/expressions/key-condition.ts"],"names":[],"mappings":";;;AAAA,+CAA0D;AAC1D,mDAAsE;AAsBzD,QAAA,YAAY,GAAG;IAC1B,IAAI,CAAC,KAAwB;QAC3B,OAAO,IAAA,eAAO,EAAC;YACb,yDAAyD;YACzD,GAAG,oBAAS,CAAC,IAAI,CAAC,KAAK,CAAC;SACzB,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import type { AttributeValue } from "../../../types.js";
|
|
2
|
-
import type { AttributeNames } from "../../attributes/names.js";
|
|
3
|
-
import type { AttributeValues } from "../../attributes/values.js";
|
|
4
2
|
import { type ImplicitPath, Path, type RawPath } from "./path.js";
|
|
5
3
|
import { type ImplicitValue, type RawValue, Value } from "./value.js";
|
|
6
4
|
export type ImplicitOperand = ImplicitPath | ImplicitValue;
|
|
7
5
|
export type RawOperand<T extends AttributeValue = AttributeValue> = RawPath | RawValue<T>;
|
|
8
6
|
export type Operand<T extends AttributeValue = AttributeValue> = Path | Value<T>;
|
|
9
|
-
export interface IOperand {
|
|
10
|
-
substitute(params: {
|
|
11
|
-
names: AttributeNames;
|
|
12
|
-
values: AttributeValues;
|
|
13
|
-
}): string;
|
|
14
|
-
}
|
|
15
7
|
export declare function operand<T extends AttributeValue = AttributeValue>(raw: RawOperand<T>): Operand<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operand.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/operand.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"operand.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/operand.ts"],"names":[],"mappings":";;;;;AAsBA,0BAUC;AAhCD,8DAAiC;AAEjC,uCAA6E;AAC7E,yCAKoB;AAapB,mBAAmB;AACnB,SAAgB,OAAO,CACrB,GAAkB;IAElB,IAAI,IAAA,mBAAS,EAAC,GAAG,CAAC,EAAE,CAAC;QACnB,OAAO,cAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,IAAA,qBAAU,EAAI,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,gBAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IACD,IAAA,qBAAM,EAAC,KAAK,EAAE,uBAAuB,GAAG,EAAE,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { type Brand } from "@infra-blocks/types";
|
|
1
2
|
import { type AttributeName, type AttributePath } from "../../../types.js";
|
|
2
|
-
import type
|
|
3
|
-
import type { IOperand } from "./operand.js";
|
|
3
|
+
import { type PathFormatter } from "../formatter.js";
|
|
4
4
|
/**
|
|
5
5
|
* This type represents the types that can implicitly be used
|
|
6
6
|
* as path operands.
|
|
@@ -22,41 +22,15 @@ export type ImplicitPath = AttributePath;
|
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
24
|
export type RawPath = AttributePath | Path;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
* it with the returned value.
|
|
31
|
-
*/
|
|
32
|
-
export declare class Path implements IOperand {
|
|
33
|
-
private readonly path;
|
|
34
|
-
private readonly literal;
|
|
35
|
-
private constructor();
|
|
36
|
-
substitute(params: {
|
|
37
|
-
names: AttributeNames;
|
|
38
|
-
}): string;
|
|
39
|
-
/**
|
|
40
|
-
* @private
|
|
41
|
-
*/
|
|
42
|
-
static from(path: AttributePath, options?: {
|
|
25
|
+
export type Path = PathFormatter & Brand<"Path"> & {
|
|
26
|
+
type: "Path";
|
|
27
|
+
};
|
|
28
|
+
export declare const Path: {
|
|
29
|
+
from(path: AttributePath, options?: {
|
|
43
30
|
literal?: true;
|
|
44
31
|
}): Path;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
*
|
|
48
|
-
* If the provided path is already a {@link Path}, it will be returned as-is.
|
|
49
|
-
* Otherwise, a new {@link Path} instance will be created from the provided
|
|
50
|
-
* argument.
|
|
51
|
-
*
|
|
52
|
-
* @param raw - The path to return as is or convert to a {@link Path} instance.
|
|
53
|
-
*
|
|
54
|
-
* @returns The normalized {@link Path} instance.
|
|
55
|
-
*
|
|
56
|
-
* @private
|
|
57
|
-
*/
|
|
58
|
-
static normalize(raw: RawPath): Path;
|
|
59
|
-
}
|
|
32
|
+
normalize(raw: RawPath): Path;
|
|
33
|
+
};
|
|
60
34
|
/**
|
|
61
35
|
* Factory function to create a {@link Path}.
|
|
62
36
|
*
|
|
@@ -100,3 +74,4 @@ export declare function literal(name: AttributeName): Path;
|
|
|
100
74
|
* @returns Whether the operand is a {@link RawPath}.
|
|
101
75
|
*/
|
|
102
76
|
export declare function isRawPath(operand: unknown): operand is RawPath;
|
|
77
|
+
export declare function isPath(operand: unknown): operand is Path;
|