@infra-blocks/aws-dynamodb 0.26.0-alpha.0 → 0.27.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.
Files changed (121) hide show
  1. package/lib/cjs/commands/attributes/index.d.ts +2 -0
  2. package/lib/cjs/commands/attributes/index.js +19 -0
  3. package/lib/cjs/commands/attributes/index.js.map +1 -0
  4. package/lib/cjs/commands/attributes/names.d.ts +4 -4
  5. package/lib/cjs/commands/attributes/names.js.map +1 -1
  6. package/lib/cjs/commands/attributes/values.d.ts +6 -3
  7. package/lib/cjs/commands/attributes/values.js.map +1 -1
  8. package/lib/cjs/commands/expressions/condition/comparisons.d.ts +22 -0
  9. package/lib/cjs/commands/expressions/condition/comparisons.js +204 -0
  10. package/lib/cjs/commands/expressions/condition/comparisons.js.map +1 -0
  11. package/lib/cjs/commands/expressions/condition/condition.d.ts +24 -0
  12. package/lib/cjs/commands/expressions/condition/condition.js +27 -0
  13. package/lib/cjs/commands/expressions/condition/condition.js.map +1 -0
  14. package/lib/cjs/commands/expressions/condition/expression.d.ts +19 -0
  15. package/lib/cjs/commands/expressions/condition/expression.js +28 -0
  16. package/lib/cjs/commands/expressions/condition/expression.js.map +1 -0
  17. package/lib/cjs/commands/expressions/condition/functions.d.ts +70 -0
  18. package/lib/cjs/commands/expressions/condition/functions.js +80 -0
  19. package/lib/cjs/commands/expressions/condition/functions.js.map +1 -0
  20. package/lib/cjs/commands/expressions/condition/index.d.ts +5 -0
  21. package/lib/cjs/commands/expressions/condition/index.js +21 -0
  22. package/lib/cjs/commands/expressions/condition/index.js.map +1 -0
  23. package/lib/cjs/commands/expressions/condition/logic.d.ts +34 -0
  24. package/lib/cjs/commands/expressions/condition/logic.js +68 -0
  25. package/lib/cjs/commands/expressions/condition/logic.js.map +1 -0
  26. package/lib/cjs/commands/expressions/condition/size.d.ts +37 -0
  27. package/lib/cjs/commands/expressions/condition/size.js +35 -0
  28. package/lib/cjs/commands/expressions/condition/size.js.map +1 -0
  29. package/lib/cjs/commands/expressions/expression.d.ts +4 -0
  30. package/lib/cjs/commands/expressions/index.d.ts +1 -1
  31. package/lib/cjs/commands/expressions/index.js +1 -1
  32. package/lib/cjs/commands/expressions/index.js.map +1 -1
  33. package/lib/cjs/commands/expressions/key-condition.d.ts +2 -2
  34. package/lib/cjs/commands/expressions/operands/index.d.ts +1 -1
  35. package/lib/cjs/commands/expressions/operands/index.js +1 -1
  36. package/lib/cjs/commands/expressions/operands/{name.js → path.js} +1 -1
  37. package/lib/cjs/commands/expressions/operands/{name.js.map → path.js.map} +1 -1
  38. package/lib/cjs/commands/expressions/operands/type.d.ts +1 -1
  39. package/lib/cjs/commands/expressions/operands/value.js +0 -1
  40. package/lib/cjs/commands/expressions/operands/value.js.map +1 -1
  41. package/lib/cjs/commands/expressions/update/add.d.ts +1 -1
  42. package/lib/cjs/commands/expressions/update/delete.d.ts +1 -1
  43. package/lib/cjs/commands/expressions/update/if-not-exists.d.ts +1 -1
  44. package/lib/cjs/commands/expressions/update/remove.d.ts +1 -1
  45. package/lib/cjs/commands/expressions/update/set.d.ts +1 -1
  46. package/lib/cjs/commands/put-item.d.ts +2 -2
  47. package/lib/cjs/commands/put-item.js +5 -1
  48. package/lib/cjs/commands/put-item.js.map +1 -1
  49. package/lib/cjs/commands/query.js +5 -1
  50. package/lib/cjs/commands/query.js.map +1 -1
  51. package/lib/cjs/commands/update-item.d.ts +2 -2
  52. package/lib/cjs/commands/update-item.js +5 -1
  53. package/lib/cjs/commands/update-item.js.map +1 -1
  54. package/lib/cjs/types.d.ts +3 -2
  55. package/lib/cjs/types.js +13 -0
  56. package/lib/cjs/types.js.map +1 -1
  57. package/lib/esm/commands/attributes/index.d.ts +2 -0
  58. package/lib/esm/commands/attributes/index.js +3 -0
  59. package/lib/esm/commands/attributes/index.js.map +1 -0
  60. package/lib/esm/commands/attributes/names.d.ts +4 -4
  61. package/lib/esm/commands/attributes/names.js.map +1 -1
  62. package/lib/esm/commands/attributes/values.d.ts +6 -3
  63. package/lib/esm/commands/attributes/values.js.map +1 -1
  64. package/lib/esm/commands/expressions/condition/comparisons.d.ts +22 -0
  65. package/lib/esm/commands/expressions/condition/comparisons.js +200 -0
  66. package/lib/esm/commands/expressions/condition/comparisons.js.map +1 -0
  67. package/lib/esm/commands/expressions/condition/condition.d.ts +24 -0
  68. package/lib/esm/commands/expressions/condition/condition.js +22 -0
  69. package/lib/esm/commands/expressions/condition/condition.js.map +1 -0
  70. package/lib/esm/commands/expressions/condition/expression.d.ts +19 -0
  71. package/lib/esm/commands/expressions/condition/expression.js +23 -0
  72. package/lib/esm/commands/expressions/condition/expression.js.map +1 -0
  73. package/lib/esm/commands/expressions/condition/functions.d.ts +70 -0
  74. package/lib/esm/commands/expressions/condition/functions.js +73 -0
  75. package/lib/esm/commands/expressions/condition/functions.js.map +1 -0
  76. package/lib/esm/commands/expressions/condition/index.d.ts +5 -0
  77. package/lib/esm/commands/expressions/condition/index.js +5 -0
  78. package/lib/esm/commands/expressions/condition/index.js.map +1 -0
  79. package/lib/esm/commands/expressions/condition/logic.d.ts +34 -0
  80. package/lib/esm/commands/expressions/condition/logic.js +63 -0
  81. package/lib/esm/commands/expressions/condition/logic.js.map +1 -0
  82. package/lib/esm/commands/expressions/condition/size.d.ts +37 -0
  83. package/lib/esm/commands/expressions/condition/size.js +30 -0
  84. package/lib/esm/commands/expressions/condition/size.js.map +1 -0
  85. package/lib/esm/commands/expressions/expression.d.ts +4 -0
  86. package/lib/esm/commands/expressions/index.d.ts +1 -1
  87. package/lib/esm/commands/expressions/index.js +1 -1
  88. package/lib/esm/commands/expressions/index.js.map +1 -1
  89. package/lib/esm/commands/expressions/key-condition.d.ts +2 -2
  90. package/lib/esm/commands/expressions/operands/index.d.ts +1 -1
  91. package/lib/esm/commands/expressions/operands/index.js +1 -1
  92. package/lib/esm/commands/expressions/operands/{name.js → path.js} +1 -1
  93. package/lib/esm/commands/expressions/operands/{name.js.map → path.js.map} +1 -1
  94. package/lib/esm/commands/expressions/operands/type.d.ts +1 -1
  95. package/lib/esm/commands/expressions/operands/value.js +0 -1
  96. package/lib/esm/commands/expressions/operands/value.js.map +1 -1
  97. package/lib/esm/commands/expressions/update/add.d.ts +1 -1
  98. package/lib/esm/commands/expressions/update/delete.d.ts +1 -1
  99. package/lib/esm/commands/expressions/update/if-not-exists.d.ts +1 -1
  100. package/lib/esm/commands/expressions/update/remove.d.ts +1 -1
  101. package/lib/esm/commands/expressions/update/set.d.ts +1 -1
  102. package/lib/esm/commands/put-item.d.ts +2 -2
  103. package/lib/esm/commands/put-item.js +5 -1
  104. package/lib/esm/commands/put-item.js.map +1 -1
  105. package/lib/esm/commands/query.js +5 -1
  106. package/lib/esm/commands/query.js.map +1 -1
  107. package/lib/esm/commands/update-item.d.ts +2 -2
  108. package/lib/esm/commands/update-item.js +5 -1
  109. package/lib/esm/commands/update-item.js.map +1 -1
  110. package/lib/esm/types.d.ts +3 -2
  111. package/lib/esm/types.js +12 -1
  112. package/lib/esm/types.js.map +1 -1
  113. package/package.json +2 -2
  114. package/lib/cjs/commands/expressions/condition.d.ts +0 -224
  115. package/lib/cjs/commands/expressions/condition.js +0 -360
  116. package/lib/cjs/commands/expressions/condition.js.map +0 -1
  117. package/lib/esm/commands/expressions/condition.d.ts +0 -224
  118. package/lib/esm/commands/expressions/condition.js +0 -350
  119. package/lib/esm/commands/expressions/condition.js.map +0 -1
  120. /package/lib/cjs/commands/expressions/operands/{name.d.ts → path.d.ts} +0 -0
  121. /package/lib/esm/commands/expressions/operands/{name.d.ts → path.d.ts} +0 -0
@@ -0,0 +1,34 @@
1
+ import type { ConditionParams } from "./condition.js";
2
+ import { ConditionExpression } from "./expression.js";
3
+ /**
4
+ * Negates the provided condition using the `NOT` operator.
5
+ *
6
+ * @param condition - The condition to negate.
7
+ *
8
+ * @returns A {@link ConditionExpression} that evaluates to the opposite of what the provided condition evaluates to.
9
+ *
10
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
11
+ */
12
+ export declare function not(condition: ConditionParams): ConditionExpression;
13
+ /**
14
+ * Returns a condition that combines the provided ones using the `AND` operator.
15
+ *
16
+ * @param lhs - The first condition to combine.
17
+ * @param rhs - The second condition to combine.
18
+ *
19
+ * @returns A {@link ConditionExpression} that evaluates to true only if both conditions evaluate to true.
20
+ *
21
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
22
+ */
23
+ export declare function and(lhs: ConditionParams, rhs: ConditionParams): ConditionExpression;
24
+ /**
25
+ * Returns a condition that combines the provided ones using the `OR` operator.
26
+ *
27
+ * @param lhs - The first condition to combine.
28
+ * @param rhs - The second condition to combine.
29
+ *
30
+ * @returns A {@link ConditionExpression} that evaluates to true if any conditions evaluate to true.
31
+ *
32
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
33
+ */
34
+ export declare function or(lhs: ConditionParams, rhs: ConditionParams): ConditionExpression;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.not = not;
4
+ exports.and = and;
5
+ exports.or = or;
6
+ const expression_js_1 = require("./expression.js");
7
+ /**
8
+ * Negates the provided condition using the `NOT` operator.
9
+ *
10
+ * @param condition - The condition to negate.
11
+ *
12
+ * @returns A {@link ConditionExpression} that evaluates to the opposite of what the provided condition evaluates to.
13
+ *
14
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
15
+ */
16
+ function not(condition) {
17
+ const expression = (0, expression_js_1.conditionExpression)(condition);
18
+ return expression_js_1.ConditionExpression.from({
19
+ stringify: ({ names, values }) => {
20
+ return `(NOT ${expression.stringify({ names, values })})`;
21
+ },
22
+ });
23
+ }
24
+ /**
25
+ * Returns a condition that combines the provided ones using the `AND` operator.
26
+ *
27
+ * @param lhs - The first condition to combine.
28
+ * @param rhs - The second condition to combine.
29
+ *
30
+ * @returns A {@link ConditionExpression} that evaluates to true only if both conditions evaluate to true.
31
+ *
32
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
33
+ */
34
+ function and(lhs, rhs) {
35
+ const left = (0, expression_js_1.conditionExpression)(lhs);
36
+ const right = (0, expression_js_1.conditionExpression)(rhs);
37
+ return expression_js_1.ConditionExpression.from({
38
+ stringify: ({ names, values }) => {
39
+ return `(${left.stringify({ names, values })} AND ${right.stringify({
40
+ names,
41
+ values,
42
+ })})`;
43
+ },
44
+ });
45
+ }
46
+ /**
47
+ * Returns a condition that combines the provided ones using the `OR` operator.
48
+ *
49
+ * @param lhs - The first condition to combine.
50
+ * @param rhs - The second condition to combine.
51
+ *
52
+ * @returns A {@link ConditionExpression} that evaluates to true if any conditions evaluate to true.
53
+ *
54
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
55
+ */
56
+ function or(lhs, rhs) {
57
+ const left = (0, expression_js_1.conditionExpression)(lhs);
58
+ const right = (0, expression_js_1.conditionExpression)(rhs);
59
+ return expression_js_1.ConditionExpression.from({
60
+ stringify: ({ names, values }) => {
61
+ return `(${left.stringify({ names, values })} OR ${right.stringify({
62
+ names,
63
+ values,
64
+ })})`;
65
+ },
66
+ });
67
+ }
68
+ //# sourceMappingURL=logic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logic.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/logic.ts"],"names":[],"mappings":";;AAYA,kBAOC;AAYD,kBAcC;AAYD,gBAcC;AAtED,mDAA2E;AAE3E;;;;;;;;GA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AAC;gBACjE,KAAK;gBACL,MAAM;aACP,CAAC,GAAG,CAAC;QACR,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,37 @@
1
+ import type { NativeBinary, NativeList, NativeMap, NativeSet, NativeString } from "../../../types.js";
2
+ import type { AttributeNames, AttributeValues } from "../../attributes/index.js";
3
+ import type { PathOperand } from "../operands/path.js";
4
+ import type { IOperand } from "../operands/type.js";
5
+ import type { ValueOperand } from "../operands/value.js";
6
+ /**
7
+ * This type aggregates the types of operands that can be used with the {@link size} function.
8
+ *
9
+ * @see size
10
+ * @see PathOperand
11
+ * @see ValueOperand
12
+ */
13
+ export type SizeOperand = PathOperand | ValueOperand<NativeBinary | NativeList | NativeMap | NativeSet | NativeString>;
14
+ /**
15
+ * A type representing the result of the {@link size} function as an operand to be used in expressions.
16
+ */
17
+ export declare class Size implements IOperand {
18
+ private readonly inner;
19
+ constructor(operand: SizeOperand);
20
+ substitute(params: {
21
+ names: AttributeNames;
22
+ values: AttributeValues;
23
+ }): string;
24
+ /**
25
+ * @private
26
+ */
27
+ static from(operand: SizeOperand): Size;
28
+ }
29
+ /**
30
+ * Creates a new {@link Size} operand to be nested in expressions.
31
+ *
32
+ * @param operand - The operand to calculate the size of.
33
+ * @returns A new {@link Size} operand.
34
+ *
35
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
36
+ */
37
+ export declare function size(operand: SizeOperand): Size;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Size = void 0;
4
+ exports.size = size;
5
+ /**
6
+ * A type representing the result of the {@link size} function as an operand to be used in expressions.
7
+ */
8
+ class Size {
9
+ inner;
10
+ constructor(operand) {
11
+ this.inner = operand;
12
+ }
13
+ substitute(params) {
14
+ return `size(${this.inner.substitute(params)})`;
15
+ }
16
+ /**
17
+ * @private
18
+ */
19
+ static from(operand) {
20
+ return new Size(operand);
21
+ }
22
+ }
23
+ exports.Size = Size;
24
+ /**
25
+ * Creates a new {@link Size} operand to be nested in expressions.
26
+ *
27
+ * @param operand - The operand to calculate the size of.
28
+ * @returns A new {@link Size} operand.
29
+ *
30
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
31
+ */
32
+ function size(operand) {
33
+ return Size.from(operand);
34
+ }
35
+ //# sourceMappingURL=size.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"size.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/size.ts"],"names":[],"mappings":";;;AA6DA,oBAEC;AAnCD;;GAEG;AACH,MAAa,IAAI;IACE,KAAK,CAAc;IAEpC,YAAY,OAAoB;QAC9B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC;IACvB,CAAC;IAED,UAAU,CAAC,MAGV;QACC,OAAO,QAAQ,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAoB;QAC9B,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;CACF;AApBD,oBAoBC;AAED;;;;;;;GAOG;AACH,SAAgB,IAAI,CAAC,OAAoB;IACvC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC"}
@@ -1,5 +1,9 @@
1
1
  import type { AttributeNames } from "../attributes/names.js";
2
2
  import type { AttributeValues } from "../attributes/values.js";
3
+ export type Stringifier = (params: {
4
+ names: AttributeNames;
5
+ values: AttributeValues;
6
+ }) => string;
3
7
  export interface IExpression {
4
8
  stringify(params: {
5
9
  names: AttributeNames;
@@ -1,4 +1,4 @@
1
- export * from "./condition.js";
1
+ export * from "./condition/index.js";
2
2
  export * from "./key-condition.js";
3
3
  export * from "./operands/index.js";
4
4
  export * from "./update/index.js";
@@ -14,7 +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
- __exportStar(require("./condition.js"), exports);
17
+ __exportStar(require("./condition/index.js"), exports);
18
18
  __exportStar(require("./key-condition.js"), exports);
19
19
  __exportStar(require("./operands/index.js"), exports);
20
20
  __exportStar(require("./update/index.js"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/expressions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,qDAAmC;AACnC,sDAAoC;AACpC,oDAAkC;AAElC;;;;;GAKG"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/expressions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,qDAAmC;AACnC,sDAAoC;AACpC,oDAAkC;AAElC;;;;;GAKG"}
@@ -1,2 +1,2 @@
1
- import type { Condition } from "./condition.js";
2
- export type KeyConditionExpression = Condition;
1
+ import type { ConditionParams } from "./condition/index.js";
2
+ export type KeyConditionExpression = ConditionParams;
@@ -1,3 +1,3 @@
1
- export * from "./name.js";
1
+ export * from "./path.js";
2
2
  export * from "./type.js";
3
3
  export * from "./value.js";
@@ -14,7 +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
- __exportStar(require("./name.js"), exports);
17
+ __exportStar(require("./path.js"), exports);
18
18
  __exportStar(require("./type.js"), exports);
19
19
  __exportStar(require("./value.js"), exports);
20
20
  //# sourceMappingURL=index.js.map
@@ -30,4 +30,4 @@ exports.PathOperand = PathOperand;
30
30
  function path(path) {
31
31
  return new PathOperand(path);
32
32
  }
33
- //# sourceMappingURL=name.js.map
33
+ //# sourceMappingURL=path.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"name.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/name.ts"],"names":[],"mappings":";;;AA+BA,oBAEC;AA7BD;;;;;;GAMG;AACH,MAAa,WAAW;IACL,IAAI,CAAgB;IAErC,YAAY,IAAmB;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,UAAU,CAAC,MAAiC;QAC1C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QACzB,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACF;AAXD,kCAWC;AAED;;;;;;GAMG;AACH,SAAgB,IAAI,CAAC,IAAmB;IACtC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC"}
1
+ {"version":3,"file":"path.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/path.ts"],"names":[],"mappings":";;;AA+BA,oBAEC;AA7BD;;;;;;GAMG;AACH,MAAa,WAAW;IACL,IAAI,CAAgB;IAErC,YAAY,IAAmB;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,UAAU,CAAC,MAAiC;QAC1C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QACzB,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACF;AAXD,kCAWC;AAED;;;;;;GAMG;AACH,SAAgB,IAAI,CAAC,IAAmB;IACtC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { AttributeValue } from "../../../types.js";
2
2
  import type { AttributeNames } from "../../attributes/names.js";
3
3
  import type { AttributeValues } from "../../attributes/values.js";
4
- import type { PathOperand } from "./name.js";
4
+ import type { PathOperand } from "./path.js";
5
5
  import type { ValueOperand } from "./value.js";
6
6
  export type Operand<T extends AttributeValue = AttributeValue> = PathOperand | ValueOperand<T>;
7
7
  export interface IOperand {
@@ -14,7 +14,6 @@ class ValueOperand {
14
14
  constructor(value) {
15
15
  this.value = value;
16
16
  }
17
- // TODO: make the names optional
18
17
  substitute(params) {
19
18
  const { values } = params;
20
19
  return values.substitute(this.value);
@@ -1 +1 @@
1
- {"version":3,"file":"value.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/value.ts"],"names":[],"mappings":";;;AAkCA,sBAIC;AAlCD;;;;;;GAMG;AACH,MAAa,YAAY;IAGN,KAAK,CAAI;IAE1B,YAAY,KAAQ;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,gCAAgC;IAChC,UAAU,CAAC,MAAmC;QAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAC1B,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;CACF;AAdD,oCAcC;AAED;;;;;;GAMG;AACH,SAAgB,KAAK,CACnB,KAAQ;IAER,OAAO,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC"}
1
+ {"version":3,"file":"value.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/value.ts"],"names":[],"mappings":";;;AAiCA,sBAIC;AAjCD;;;;;;GAMG;AACH,MAAa,YAAY;IAGN,KAAK,CAAI;IAE1B,YAAY,KAAQ;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,UAAU,CAAC,MAAmC;QAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAC1B,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;CACF;AAbD,oCAaC;AAED;;;;;;GAMG;AACH,SAAgB,KAAK,CACnB,KAAQ;IAER,OAAO,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { NativeNumber, NativeSet } from "../../../types.js";
2
2
  import type { AttributeNames } from "../../attributes/names.js";
3
3
  import type { AttributeValues } from "../../attributes/values.js";
4
- import type { PathOperand } from "../operands/name.js";
4
+ import type { PathOperand } from "../operands/path.js";
5
5
  import type { ValueOperand } from "../operands/value.js";
6
6
  import type { IUpdateAction, UpdateAction } from "./action.js";
7
7
  import type { UpdateExpressionClauses } from "./clauses.js";
@@ -1,7 +1,7 @@
1
1
  import type { NativeSet } from "../../../types.js";
2
2
  import type { AttributeNames } from "../../attributes/names.js";
3
3
  import type { AttributeValues } from "../../attributes/values.js";
4
- import type { PathOperand } from "../operands/name.js";
4
+ import type { PathOperand } from "../operands/path.js";
5
5
  import type { ValueOperand } from "../operands/value.js";
6
6
  import type { IUpdateAction, UpdateAction } from "./action.js";
7
7
  import type { UpdateExpressionClauses } from "./clauses.js";
@@ -1,6 +1,6 @@
1
1
  import type { AttributeNames } from "../../attributes/names.js";
2
2
  import type { AttributeValues } from "../../attributes/values.js";
3
- import type { PathOperand } from "../operands/name.js";
3
+ import type { PathOperand } from "../operands/path.js";
4
4
  import type { IOperand, Operand } from "../operands/type.js";
5
5
  export declare class IfNotExistsOperand implements IOperand {
6
6
  private readonly path;
@@ -1,5 +1,5 @@
1
1
  import type { AttributeNames } from "../../attributes/names.js";
2
- import type { PathOperand } from "../operands/name.js";
2
+ import type { PathOperand } from "../operands/path.js";
3
3
  import type { IUpdateAction, UpdateAction } from "./action.js";
4
4
  import type { UpdateExpressionClauses } from "./clauses.js";
5
5
  export declare class RemoveAction implements IUpdateAction {
@@ -1,6 +1,6 @@
1
1
  import type { AttributeNames } from "../../attributes/names.js";
2
2
  import type { AttributeValues } from "../../attributes/values.js";
3
- import type { PathOperand } from "../operands/name.js";
3
+ import type { PathOperand } from "../operands/path.js";
4
4
  import type { Operand } from "../operands/type.js";
5
5
  import type { IUpdateAction, UpdateAction } from "./action.js";
6
6
  import type { UpdateExpressionClauses } from "./clauses.js";
@@ -1,11 +1,11 @@
1
1
  import { PutCommand, type PutCommandInput } from "@aws-sdk/lib-dynamodb";
2
2
  import type { Attributes } from "../types.js";
3
- import type { Condition } from "./expressions/condition.js";
3
+ import type { ConditionParams } from "./expressions/index.js";
4
4
  import type { Command } from "./types.js";
5
5
  export interface PutItemParams {
6
6
  table: string;
7
7
  item: Attributes;
8
- condition?: Condition;
8
+ condition?: ConditionParams;
9
9
  }
10
10
  export declare class PutItem implements Command<PutCommandInput, PutCommand> {
11
11
  private readonly table;
@@ -4,6 +4,7 @@ exports.PutItem = void 0;
4
4
  const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
5
5
  const names_js_1 = require("./attributes/names.js");
6
6
  const values_js_1 = require("./attributes/values.js");
7
+ const expression_js_1 = require("./expressions/condition/expression.js");
7
8
  class PutItem {
8
9
  table;
9
10
  item;
@@ -27,7 +28,10 @@ class PutItem {
27
28
  const names = names_js_1.AttributeNames.create();
28
29
  const values = values_js_1.AttributeValues.create();
29
30
  // Ask the expression to stringify itself, applying the substitutions by itself.
30
- const expression = this.condition.stringify({ names, values });
31
+ const expression = (0, expression_js_1.conditionExpression)(this.condition).stringify({
32
+ names,
33
+ values,
34
+ });
31
35
  return {
32
36
  ...input,
33
37
  ConditionExpression: expression,
@@ -1 +1 @@
1
- {"version":3,"file":"put-item.js","sourceRoot":"","sources":["../../../src/commands/put-item.ts"],"names":[],"mappings":";;;AAAA,wDAAyE;AAEzE,oDAAuD;AACvD,sDAAyD;AAUzD,MAAa,OAAO;IACD,KAAK,CAAS;IACd,IAAI,CAAa;IACjB,SAAS,CAAa;IAEvC,YAAoB,MAAqB;QACvC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACn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GAAG,MAAM,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,iBAAiB;QACf,MAAM,KAAK,GAAoB;YAC7B,SAAS,EAAE,IAAI,CAAC,KAAK;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;QAEF,4FAA4F;QAC5F,qBAAqB;QACrB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;YAC3B,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,KAAK,GAAG,yBAAc,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,2BAAe,CAAC,MAAM,EAAE,CAAC;QACxC,gFAAgF;QAChF,MAAM,UAAU,GAAG,IAAA,mCAAmB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;YAC/D,KAAK;YACL,MAAM;SACP,CAAC,CAAC;QAEH,OAAO;YACL,GAAG,KAAK;YACR,mBAAmB,EAAE,UAAU;YAC/B,wBAAwB,EAAE,KAAK,CAAC,gBAAgB,EAAE;YAClD,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE;SACrD,CAAC;IACJ,CAAC;IAED,YAAY;QACV,OAAO,IAAI,yBAAU,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,MAAqB;QAC/B,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;CACF;AA/CD,0BA+CC"}
@@ -4,6 +4,7 @@ exports.Query = void 0;
4
4
  const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
5
5
  const names_js_1 = require("./attributes/names.js");
6
6
  const values_js_1 = require("./attributes/values.js");
7
+ const expression_js_1 = require("./expressions/condition/expression.js");
7
8
  class Query {
8
9
  table;
9
10
  index;
@@ -19,7 +20,10 @@ class Query {
19
20
  toAwsCommandInput() {
20
21
  const names = names_js_1.AttributeNames.create();
21
22
  const values = values_js_1.AttributeValues.create();
22
- const expression = this.condition.stringify({ names, values });
23
+ const expression = (0, expression_js_1.conditionExpression)(this.condition).stringify({
24
+ names,
25
+ values,
26
+ });
23
27
  return {
24
28
  TableName: this.table,
25
29
  IndexName: this.index,
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/commands/query.ts"],"names":[],"mappings":";;;AAAA,wDAA6E;AAE7E,oDAAuD;AACvD,sDAAyD;AAWzD,MAAa,KAAK;IACC,KAAK,CAAS;IACd,KAAK,CAAU;IACf,SAAS,CAAyB;IAClC,iBAAiB,CAAkC;IAEpE,YAAoB,MAAmB;QACrC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAC;QAC9D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAED,iBAAiB;QACf,MAAM,KAAK,GAAG,yBAAc,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,2BAAe,CAAC,MAAM,EAAE,CAAC;QACxC,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC/D,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,KAAK;YACrB,SAAS,EAAE,IAAI,CAAC,KAAK;YACrB,sBAAsB,EAAE,UAAU;YAClC,wBAAwB,EAAE,KAAK,CAAC,gBAAgB,EAAE;YAClD,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE;YACpD,iBAAiB,EAAE,IAAI,CAAC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,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC;IACJ,CAAC;IAED,YAAY;QACV,OAAO,IAAI,2BAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,MAAmB;QAC7B,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;CACF;AAtCD,sBAsCC"}
@@ -1,11 +1,11 @@
1
1
  import { UpdateCommand, type UpdateCommandInput } from "@aws-sdk/lib-dynamodb";
2
2
  import type { Attributes } from "../types.js";
3
- import { type Condition, type UpdateExpressionParams } from "./expressions/index.js";
3
+ import { type ConditionParams, type UpdateExpressionParams } from "./expressions/index.js";
4
4
  import type { Command } from "./types.js";
5
5
  export interface UpdateItemParams {
6
6
  table: string;
7
7
  key: Attributes;
8
- condition?: Condition;
8
+ condition?: ConditionParams;
9
9
  update: UpdateExpressionParams;
10
10
  }
11
11
  export declare class UpdateItem implements Command<UpdateCommandInput, UpdateCommand> {
@@ -4,6 +4,7 @@ exports.UpdateItem = void 0;
4
4
  const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
5
5
  const names_js_1 = require("./attributes/names.js");
6
6
  const values_js_1 = require("./attributes/values.js");
7
+ const expression_js_1 = require("./expressions/condition/expression.js");
7
8
  const index_js_1 = require("./expressions/index.js");
8
9
  class UpdateItem {
9
10
  params;
@@ -32,7 +33,10 @@ class UpdateItem {
32
33
  }
33
34
  // Otherwise, we need to stringify the condition, reusing the same names and values
34
35
  // as before.
35
- input.ConditionExpression = condition.stringify({ names, values });
36
+ input.ConditionExpression = (0, expression_js_1.conditionExpression)(condition).stringify({
37
+ names,
38
+ values,
39
+ });
36
40
  input.ExpressionAttributeNames = names.getSubstitutions();
37
41
  input.ExpressionAttributeValues = values.getSubstitutions();
38
42
  return input;
@@ -1 +1 @@
1
- {"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../src/commands/update-item.ts"],"names":[],"mappings":";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C,SAAS,CAAC;YACnE,KAAK;YACL,MAAM;SACP,CAAC,CAAC;QACH,KAAK,CAAC,wBAAwB,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC;QAC1D,KAAK,CAAC,yBAAyB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC5D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,YAAY;QACV,OAAO,IAAI,4BAAa,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,MAAwB;QAClC,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;CACF;AAlDD,gCAkDC"}
@@ -1,3 +1,5 @@
1
+ export type NativeType = "B" | "BS" | "BOOL" | "L" | "M" | "N" | "NS" | "NULL" | "S" | "SS";
2
+ export declare const NATIVE_TYPES: readonly ["B", "BS", "BOOL", "L", "M", "N", "NS", "NULL", "S", "SS"];
1
3
  export type NativeBinary = Buffer;
2
4
  export type NativeBinarySet = Set<NativeBinary>;
3
5
  export type NativeBoolean = boolean;
@@ -30,10 +32,9 @@ export type AttributeName = string;
30
32
  * @see AttributeName
31
33
  */
32
34
  export type AttributePath = AttributeName;
33
- export type AttributeType = "S" | "N" | "B" | "BOOL" | "NULL" | "M" | "L" | "SS" | "NS" | "BS";
34
35
  export type AttributeValue = NativeBinary | NativeBinarySet | NativeBoolean | NativeList | NativeMap | NativeNull | NativeNumber | NativeNumberSet | NativeSet | NativeString | NativeStringSet;
35
36
  export type Attributes = Record<AttributeName, AttributeValue>;
36
- export type IndexAttributeType = Extract<AttributeType, "B" | "N" | "S">;
37
+ export type IndexAttributeType = Extract<NativeType, "B" | "N" | "S">;
37
38
  export interface IndexAttributeDefinition {
38
39
  name: string;
39
40
  type: IndexAttributeType;
package/lib/cjs/types.js CHANGED
@@ -1,3 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NATIVE_TYPES = void 0;
4
+ exports.NATIVE_TYPES = [
5
+ "B",
6
+ "BS",
7
+ "BOOL",
8
+ "L",
9
+ "M",
10
+ "N",
11
+ "NS",
12
+ "NULL",
13
+ "S",
14
+ "SS",
15
+ ];
3
16
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAYa,QAAA,YAAY,GAAG;IAC1B,GAAG;IACH,IAAI;IACJ,MAAM;IACN,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;IACJ,MAAM;IACN,GAAG;IACH,IAAI;CACI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./names.js";
2
+ export * from "./values.js";
@@ -0,0 +1,3 @@
1
+ export * from "./names.js";
2
+ export * from "./values.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/attributes/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import type { AttributePath } from "../../types.js";
2
2
  /**
3
- * A substitution always starts with the `#` character.
3
+ * A path substitution always starts with the `#` character.
4
4
  */
5
- export type Substitution = `#${string}`;
5
+ export type PathSubstitution = `#${string}`;
6
6
  /**
7
7
  * Represents a set of attribute names used in a condition expression.
8
8
  *
@@ -36,14 +36,14 @@ export declare class AttributeNames {
36
36
  *
37
37
  * @returns The substitution associated with the attribute path.
38
38
  */
39
- substitute(attribute: AttributePath): Substitution;
39
+ substitute(attribute: AttributePath): PathSubstitution;
40
40
  /**
41
41
  * Returns a record where the keys are the substitutions generated by this object
42
42
  * and the values are the corresponding attribute paths they where generated for.
43
43
  *
44
44
  * @returns A mapping of substitutions generated by this object, undefined if none were.
45
45
  */
46
- getSubstitutions(): Record<Substitution, AttributePath> | undefined;
46
+ getSubstitutions(): Record<PathSubstitution, AttributePath> | undefined;
47
47
  private getAndSetNextSubstituteFor;
48
48
  static create(): AttributeNames;
49
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"names.js","sourceRoot":"","sources":["../../../../src/commands/attributes/names.ts"],"names":[],"mappings":"AAOA,yJAAyJ;AACzJ,kEAAkE;AAClE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,cAAc;IACR,KAAK,CAAmC;IAEzD;QACE,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAA+B,CAAC;IACtD,CAAC;IAED;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,SAAwB;QACjC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;QACJ,CAAC;QAED,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxC,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE,CAAC;YAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CACb,gCAAgC,SAAS,gCAAgC,CAC1E,CAAC;YACJ,CAAC;YACD,MAAM,UAAU,GACd,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;YAClE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAiB,CAAC;IAC1C,CAAC;IAED;;;;;OAKG;IACH,gBAAgB;QACd,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,MAAM,G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,GACd,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;YAClE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAqB,CAAC;IAC9C,CAAC;IAED;;;;;OAKG;IACH,gBAAgB;QACd,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,MAAM,GAA4C,EAAE,CAAC;QAC3D,KAAK,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YAC3D,MAAM,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;QACjC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,0BAA0B,CAAC,IAAmB;QACpD,MAAM,cAAc,GAAG,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,EAAsB,CAAC;QACzE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QACrC,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,MAAM;QACX,OAAO,IAAI,cAAc,EAAE,CAAC;IAC9B,CAAC;CACF"}
@@ -1,5 +1,8 @@
1
1
  import type { AttributeValue } from "../../types.js";
2
- export type ValueReference = `:${string}`;
2
+ /**
3
+ * A value substitution always starts with the `:` character.
4
+ */
5
+ export type ValueSubstitution = `:${string}`;
3
6
  /**
4
7
  * Represents a set of attribute values used in an expression.
5
8
  *
@@ -36,14 +39,14 @@ export declare class AttributeValues {
36
39
  *
37
40
  * @returns The reference associated with the attribute value.
38
41
  */
39
- substitute(value: AttributeValue): ValueReference;
42
+ substitute(value: AttributeValue): ValueSubstitution;
40
43
  /**
41
44
  * Returns record of all substitutions made by this object where the keys are
42
45
  * the value references and the values are the attribute values they correspond to.
43
46
  *
44
47
  * @returns A mapping of value references generated by this object, undefined if none were.
45
48
  */
46
- getSubstitutions(): Record<ValueReference, AttributeValue> | undefined;
49
+ getSubstitutions(): Record<ValueSubstitution, AttributeValue> | undefined;
47
50
  private getAndSetNextSubstitutionFor;
48
51
  static create(): AttributeValues;
49
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"values.js","sourceRoot":"","sources":["../../../../src/commands/attributes/values.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,eAAe;IACT,MAAM,CAAsC;IAE7D;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,EAAkC,CAAC;IAC1D,CAAC;IAED;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,KAAqB;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,4BAA4B,CAAC,KAAK,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;OAKG;IACH,gBAAgB;QACd,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,MAAM,GAA2C,EAAE,CAAC;QAC1D,KAAK,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;YACvD,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;QAC5B,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,4BAA4B,CAAC,KAAqB;QACxD,MAAM,SAAS,GAAG,SAAS,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,EAAoB,CAAC;QACpE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAClC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,MAAM;QACX,OAAO,IAAI,eAAe,EAAE,CAAC;IAC/B,CAAC;CACF"}
1
+ {"version":3,"file":"values.js","sourceRoot":"","sources":["../../../../src/commands/attributes/values.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,eAAe;IACT,MAAM,CAAyC;IAEhE;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,EAAqC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,KAAqB;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,4BAA4B,CAAC,KAAK,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;OAKG;IACH,gBAAgB;QACd,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,MAAM,GAA8C,EAAE,CAAC;QAC7D,KAAK,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;YACvD,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;QAC5B,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,4BAA4B,CAClC,KAAqB;QAErB,MAAM,SAAS,GAAG,SAAS,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,EAAuB,CAAC;QACvE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAClC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,MAAM;QACX,OAAO,IAAI,eAAe,EAAE,CAAC;IAC/B,CAAC;CACF"}
@@ -0,0 +1,22 @@
1
+ import type { NativeBinary, NativeNumber, NativeString } from "../../../types.js";
2
+ import type { ConditionOperand, ConditionParams } from "./condition.js";
3
+ import { ConditionExpression } from "./expression.js";
4
+ export type ComparableValue = NativeBinary | NativeNumber | NativeString;
5
+ export type ComparableOperand = ConditionOperand<ComparableValue>;
6
+ export type ConditionComparisonParams = Between | Equals | GreaterThan | GreaterThanOrEquals | In | LowerThan | LowerThanOrEquals | NotEquals;
7
+ export type Between = [
8
+ ComparableOperand,
9
+ "BETWEEN",
10
+ ComparableOperand,
11
+ "AND",
12
+ ComparableOperand
13
+ ];
14
+ export type Equals = [ConditionOperand, "=", ConditionOperand];
15
+ export type GreaterThan = [ComparableOperand, ">", ComparableOperand];
16
+ export type GreaterThanOrEquals = [ComparableOperand, ">=", ComparableOperand];
17
+ export type In = [ComparableOperand, "IN", ComparableOperand[]];
18
+ export type LowerThan = [ComparableOperand, "<", ComparableOperand];
19
+ export type LowerThanOrEquals = [ComparableOperand, "<=", ComparableOperand];
20
+ export type NotEquals = [ConditionOperand, "<>", ConditionOperand];
21
+ export declare function comparison(params: ConditionComparisonParams): ConditionExpression;
22
+ export declare function isComparison(params: ConditionParams): params is ConditionComparisonParams;