@infra-blocks/aws-dynamodb 0.64.0 → 0.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/lib/cjs/commands/expressions/condition/comparisons/between.d.ts +28 -0
  2. package/lib/cjs/commands/expressions/condition/comparisons/between.js +31 -0
  3. package/lib/cjs/commands/expressions/condition/comparisons/between.js.map +1 -0
  4. package/lib/cjs/commands/expressions/condition/comparisons/binary.d.ts +4 -0
  5. package/lib/cjs/commands/expressions/condition/comparisons/binary.js +11 -0
  6. package/lib/cjs/commands/expressions/condition/comparisons/binary.js.map +1 -0
  7. package/lib/cjs/commands/expressions/condition/comparisons/equals.d.ts +20 -0
  8. package/lib/cjs/commands/expressions/condition/comparisons/equals.js +25 -0
  9. package/lib/cjs/commands/expressions/condition/comparisons/equals.js.map +1 -0
  10. package/lib/cjs/commands/expressions/condition/comparisons/greater-than-or-equals.d.ts +24 -0
  11. package/lib/cjs/commands/expressions/condition/comparisons/greater-than-or-equals.js +25 -0
  12. package/lib/cjs/commands/expressions/condition/comparisons/greater-than-or-equals.js.map +1 -0
  13. package/lib/cjs/commands/expressions/condition/comparisons/greater-than.d.ts +20 -0
  14. package/lib/cjs/commands/expressions/condition/comparisons/greater-than.js +25 -0
  15. package/lib/cjs/commands/expressions/condition/comparisons/greater-than.js.map +1 -0
  16. package/lib/cjs/commands/expressions/condition/comparisons/in.d.ts +22 -0
  17. package/lib/cjs/commands/expressions/condition/comparisons/in.js +42 -0
  18. package/lib/cjs/commands/expressions/condition/comparisons/in.js.map +1 -0
  19. package/lib/cjs/commands/expressions/condition/comparisons/index.d.ts +9 -0
  20. package/lib/cjs/commands/expressions/condition/comparisons/index.js +26 -0
  21. package/lib/cjs/commands/expressions/condition/comparisons/index.js.map +1 -0
  22. package/lib/cjs/commands/expressions/condition/comparisons/lower-than-or-equals.d.ts +24 -0
  23. package/lib/cjs/commands/expressions/condition/comparisons/lower-than-or-equals.js +25 -0
  24. package/lib/cjs/commands/expressions/condition/comparisons/lower-than-or-equals.js.map +1 -0
  25. package/lib/cjs/commands/expressions/condition/comparisons/lower-than.d.ts +20 -0
  26. package/lib/cjs/commands/expressions/condition/comparisons/lower-than.js +25 -0
  27. package/lib/cjs/commands/expressions/condition/comparisons/lower-than.js.map +1 -0
  28. package/lib/cjs/commands/expressions/condition/comparisons/not-equals.d.ts +20 -0
  29. package/lib/cjs/commands/expressions/condition/comparisons/not-equals.js +25 -0
  30. package/lib/cjs/commands/expressions/condition/comparisons/not-equals.js.map +1 -0
  31. package/lib/cjs/commands/expressions/condition/comparisons/operand.d.ts +4 -0
  32. package/lib/cjs/commands/expressions/condition/comparisons/operand.js +3 -0
  33. package/lib/cjs/commands/expressions/condition/comparisons/operand.js.map +1 -0
  34. package/lib/cjs/commands/expressions/condition/condition-comparison.d.ts +15 -0
  35. package/lib/cjs/commands/expressions/condition/condition-comparison.js +54 -0
  36. package/lib/cjs/commands/expressions/condition/condition-comparison.js.map +1 -0
  37. package/lib/cjs/commands/expressions/condition/condition.d.ts +10 -9
  38. package/lib/cjs/commands/expressions/condition/condition.js +10 -9
  39. package/lib/cjs/commands/expressions/condition/condition.js.map +1 -1
  40. package/lib/cjs/commands/expressions/condition/index.d.ts +2 -3
  41. package/lib/cjs/commands/expressions/condition/index.js +0 -2
  42. package/lib/cjs/commands/expressions/condition/index.js.map +1 -1
  43. package/lib/cjs/commands/expressions/condition/logic.d.ts +12 -8
  44. package/lib/cjs/commands/expressions/condition/logic.js +20 -30
  45. package/lib/cjs/commands/expressions/condition/logic.js.map +1 -1
  46. package/lib/cjs/commands/expressions/condition/operand.d.ts +8 -0
  47. package/lib/cjs/commands/expressions/condition/operand.js +15 -0
  48. package/lib/cjs/commands/expressions/condition/operand.js.map +1 -0
  49. package/lib/cjs/commands/expressions/expression.d.ts +8 -6
  50. package/lib/cjs/commands/expressions/expression.js +8 -0
  51. package/lib/cjs/commands/expressions/expression.js.map +1 -1
  52. package/lib/cjs/commands/expressions/functions/attribute-exists.d.ts +13 -0
  53. package/lib/cjs/commands/expressions/functions/attribute-exists.js +19 -0
  54. package/lib/cjs/commands/expressions/functions/attribute-exists.js.map +1 -0
  55. package/lib/cjs/commands/expressions/functions/attribute-not-exists.d.ts +13 -0
  56. package/lib/cjs/commands/expressions/functions/attribute-not-exists.js +19 -0
  57. package/lib/cjs/commands/expressions/functions/attribute-not-exists.js.map +1 -0
  58. package/lib/cjs/commands/expressions/functions/attribute-type.d.ts +17 -0
  59. package/lib/cjs/commands/expressions/functions/attribute-type.js +23 -0
  60. package/lib/cjs/commands/expressions/functions/attribute-type.js.map +1 -0
  61. package/lib/cjs/commands/expressions/functions/begins-with.d.ts +24 -0
  62. package/lib/cjs/commands/expressions/functions/begins-with.js +22 -0
  63. package/lib/cjs/commands/expressions/functions/begins-with.js.map +1 -0
  64. package/lib/cjs/commands/expressions/functions/contains.d.ts +16 -0
  65. package/lib/cjs/commands/expressions/functions/contains.js +23 -0
  66. package/lib/cjs/commands/expressions/functions/contains.js.map +1 -0
  67. package/lib/cjs/commands/expressions/functions/index.d.ts +5 -0
  68. package/lib/cjs/commands/expressions/functions/index.js +22 -0
  69. package/lib/cjs/commands/expressions/functions/index.js.map +1 -0
  70. package/lib/cjs/commands/expressions/index.d.ts +1 -0
  71. package/lib/cjs/commands/expressions/index.js +1 -0
  72. package/lib/cjs/commands/expressions/index.js.map +1 -1
  73. package/lib/cjs/commands/expressions/key-condition.d.ts +1 -1
  74. package/lib/cjs/commands/expressions/operands/index.d.ts +1 -0
  75. package/lib/cjs/commands/expressions/operands/index.js +3 -1
  76. package/lib/cjs/commands/expressions/operands/index.js.map +1 -1
  77. package/lib/cjs/commands/expressions/operands/operand.js +1 -0
  78. package/lib/cjs/commands/expressions/operands/operand.js.map +1 -1
  79. package/lib/{esm/commands/expressions/condition → cjs/commands/expressions/operands}/size.d.ts +3 -2
  80. package/lib/cjs/commands/expressions/{condition → operands}/size.js +1 -1
  81. package/lib/cjs/commands/expressions/operands/size.js.map +1 -0
  82. package/lib/cjs/commands/expressions/projection.d.ts +9 -8
  83. package/lib/cjs/commands/expressions/projection.js +14 -14
  84. package/lib/cjs/commands/expressions/projection.js.map +1 -1
  85. package/lib/cjs/commands/expressions/update/expression.d.ts +5 -5
  86. package/lib/cjs/commands/expressions/update/expression.js +5 -5
  87. package/lib/cjs/commands/expressions/update/expression.js.map +1 -1
  88. package/lib/cjs/commands/index.d.ts +1 -1
  89. package/lib/cjs/commands/index.js +19 -16
  90. package/lib/cjs/commands/index.js.map +1 -1
  91. package/lib/cjs/commands/inputs/condition-check.d.ts +1 -1
  92. package/lib/cjs/commands/inputs/condition-check.js +7 -7
  93. package/lib/cjs/commands/inputs/condition-check.js.map +1 -1
  94. package/lib/cjs/commands/inputs/delete-item.d.ts +2 -2
  95. package/lib/cjs/commands/inputs/delete-item.js +5 -4
  96. package/lib/cjs/commands/inputs/delete-item.js.map +1 -1
  97. package/lib/cjs/commands/inputs/get-item.d.ts +2 -2
  98. package/lib/cjs/commands/inputs/get-item.js +9 -10
  99. package/lib/cjs/commands/inputs/get-item.js.map +1 -1
  100. package/lib/cjs/commands/inputs/index.d.ts +0 -1
  101. package/lib/cjs/commands/inputs/index.js.map +1 -1
  102. package/lib/cjs/commands/inputs/lib.d.ts +13 -7
  103. package/lib/cjs/commands/inputs/lib.js +13 -16
  104. package/lib/cjs/commands/inputs/lib.js.map +1 -1
  105. package/lib/cjs/commands/inputs/put-item.d.ts +2 -2
  106. package/lib/cjs/commands/inputs/put-item.js +5 -4
  107. package/lib/cjs/commands/inputs/put-item.js.map +1 -1
  108. package/lib/cjs/commands/inputs/query.d.ts +4 -3
  109. package/lib/cjs/commands/inputs/query.js +16 -12
  110. package/lib/cjs/commands/inputs/query.js.map +1 -1
  111. package/lib/cjs/commands/inputs/update-item.d.ts +2 -2
  112. package/lib/cjs/commands/inputs/update-item.js +9 -17
  113. package/lib/cjs/commands/inputs/update-item.js.map +1 -1
  114. package/lib/cjs/index.js +0 -1
  115. package/lib/cjs/index.js.map +1 -1
  116. package/lib/esm/commands/expressions/condition/comparisons/between.d.ts +28 -0
  117. package/lib/esm/commands/expressions/condition/comparisons/between.js +27 -0
  118. package/lib/esm/commands/expressions/condition/comparisons/between.js.map +1 -0
  119. package/lib/esm/commands/expressions/condition/comparisons/binary.d.ts +4 -0
  120. package/lib/esm/commands/expressions/condition/comparisons/binary.js +8 -0
  121. package/lib/esm/commands/expressions/condition/comparisons/binary.js.map +1 -0
  122. package/lib/esm/commands/expressions/condition/comparisons/equals.d.ts +20 -0
  123. package/lib/esm/commands/expressions/condition/comparisons/equals.js +21 -0
  124. package/lib/esm/commands/expressions/condition/comparisons/equals.js.map +1 -0
  125. package/lib/esm/commands/expressions/condition/comparisons/greater-than-or-equals.d.ts +24 -0
  126. package/lib/esm/commands/expressions/condition/comparisons/greater-than-or-equals.js +21 -0
  127. package/lib/esm/commands/expressions/condition/comparisons/greater-than-or-equals.js.map +1 -0
  128. package/lib/esm/commands/expressions/condition/comparisons/greater-than.d.ts +20 -0
  129. package/lib/esm/commands/expressions/condition/comparisons/greater-than.js +21 -0
  130. package/lib/esm/commands/expressions/condition/comparisons/greater-than.js.map +1 -0
  131. package/lib/esm/commands/expressions/condition/comparisons/in.d.ts +22 -0
  132. package/lib/esm/commands/expressions/condition/comparisons/in.js +38 -0
  133. package/lib/esm/commands/expressions/condition/comparisons/in.js.map +1 -0
  134. package/lib/esm/commands/expressions/condition/comparisons/index.d.ts +9 -0
  135. package/lib/esm/commands/expressions/condition/comparisons/index.js +10 -0
  136. package/lib/esm/commands/expressions/condition/comparisons/index.js.map +1 -0
  137. package/lib/esm/commands/expressions/condition/comparisons/lower-than-or-equals.d.ts +24 -0
  138. package/lib/esm/commands/expressions/condition/comparisons/lower-than-or-equals.js +21 -0
  139. package/lib/esm/commands/expressions/condition/comparisons/lower-than-or-equals.js.map +1 -0
  140. package/lib/esm/commands/expressions/condition/comparisons/lower-than.d.ts +20 -0
  141. package/lib/esm/commands/expressions/condition/comparisons/lower-than.js +21 -0
  142. package/lib/esm/commands/expressions/condition/comparisons/lower-than.js.map +1 -0
  143. package/lib/esm/commands/expressions/condition/comparisons/not-equals.d.ts +20 -0
  144. package/lib/esm/commands/expressions/condition/comparisons/not-equals.js +21 -0
  145. package/lib/esm/commands/expressions/condition/comparisons/not-equals.js.map +1 -0
  146. package/lib/esm/commands/expressions/condition/comparisons/operand.d.ts +4 -0
  147. package/lib/esm/commands/expressions/condition/comparisons/operand.js +2 -0
  148. package/lib/esm/commands/expressions/condition/comparisons/operand.js.map +1 -0
  149. package/lib/esm/commands/expressions/condition/condition-comparison.d.ts +15 -0
  150. package/lib/esm/commands/expressions/condition/condition-comparison.js +50 -0
  151. package/lib/esm/commands/expressions/condition/condition-comparison.js.map +1 -0
  152. package/lib/esm/commands/expressions/condition/condition.d.ts +10 -9
  153. package/lib/esm/commands/expressions/condition/condition.js +9 -8
  154. package/lib/esm/commands/expressions/condition/condition.js.map +1 -1
  155. package/lib/esm/commands/expressions/condition/index.d.ts +2 -3
  156. package/lib/esm/commands/expressions/condition/index.js +0 -2
  157. package/lib/esm/commands/expressions/condition/index.js.map +1 -1
  158. package/lib/esm/commands/expressions/condition/logic.d.ts +12 -8
  159. package/lib/esm/commands/expressions/condition/logic.js +20 -30
  160. package/lib/esm/commands/expressions/condition/logic.js.map +1 -1
  161. package/lib/esm/commands/expressions/condition/operand.d.ts +8 -0
  162. package/lib/esm/commands/expressions/condition/operand.js +12 -0
  163. package/lib/esm/commands/expressions/condition/operand.js.map +1 -0
  164. package/lib/esm/commands/expressions/expression.d.ts +8 -6
  165. package/lib/esm/commands/expressions/expression.js +7 -1
  166. package/lib/esm/commands/expressions/expression.js.map +1 -1
  167. package/lib/esm/commands/expressions/functions/attribute-exists.d.ts +13 -0
  168. package/lib/esm/commands/expressions/functions/attribute-exists.js +16 -0
  169. package/lib/esm/commands/expressions/functions/attribute-exists.js.map +1 -0
  170. package/lib/esm/commands/expressions/functions/attribute-not-exists.d.ts +13 -0
  171. package/lib/esm/commands/expressions/functions/attribute-not-exists.js +16 -0
  172. package/lib/esm/commands/expressions/functions/attribute-not-exists.js.map +1 -0
  173. package/lib/esm/commands/expressions/functions/attribute-type.d.ts +17 -0
  174. package/lib/esm/commands/expressions/functions/attribute-type.js +20 -0
  175. package/lib/esm/commands/expressions/functions/attribute-type.js.map +1 -0
  176. package/lib/esm/commands/expressions/functions/begins-with.d.ts +24 -0
  177. package/lib/esm/commands/expressions/functions/begins-with.js +19 -0
  178. package/lib/esm/commands/expressions/functions/begins-with.js.map +1 -0
  179. package/lib/esm/commands/expressions/functions/contains.d.ts +16 -0
  180. package/lib/esm/commands/expressions/functions/contains.js +20 -0
  181. package/lib/esm/commands/expressions/functions/contains.js.map +1 -0
  182. package/lib/esm/commands/expressions/functions/index.d.ts +5 -0
  183. package/lib/esm/commands/expressions/functions/index.js +6 -0
  184. package/lib/esm/commands/expressions/functions/index.js.map +1 -0
  185. package/lib/esm/commands/expressions/index.d.ts +1 -0
  186. package/lib/esm/commands/expressions/index.js +1 -0
  187. package/lib/esm/commands/expressions/index.js.map +1 -1
  188. package/lib/esm/commands/expressions/key-condition.d.ts +1 -1
  189. package/lib/esm/commands/expressions/operands/index.d.ts +1 -0
  190. package/lib/esm/commands/expressions/operands/index.js +1 -0
  191. package/lib/esm/commands/expressions/operands/index.js.map +1 -1
  192. package/lib/esm/commands/expressions/operands/operand.js +1 -0
  193. package/lib/esm/commands/expressions/operands/operand.js.map +1 -1
  194. package/lib/{cjs/commands/expressions/condition → esm/commands/expressions/operands}/size.d.ts +3 -2
  195. package/lib/esm/commands/expressions/{condition → operands}/size.js +1 -1
  196. package/lib/esm/commands/expressions/operands/size.js.map +1 -0
  197. package/lib/esm/commands/expressions/projection.d.ts +9 -8
  198. package/lib/esm/commands/expressions/projection.js +13 -13
  199. package/lib/esm/commands/expressions/projection.js.map +1 -1
  200. package/lib/esm/commands/expressions/update/expression.d.ts +5 -5
  201. package/lib/esm/commands/expressions/update/expression.js +3 -3
  202. package/lib/esm/commands/expressions/update/expression.js.map +1 -1
  203. package/lib/esm/commands/index.d.ts +1 -1
  204. package/lib/esm/commands/index.js +1 -1
  205. package/lib/esm/commands/index.js.map +1 -1
  206. package/lib/esm/commands/inputs/condition-check.d.ts +1 -1
  207. package/lib/esm/commands/inputs/condition-check.js +8 -8
  208. package/lib/esm/commands/inputs/condition-check.js.map +1 -1
  209. package/lib/esm/commands/inputs/delete-item.d.ts +2 -2
  210. package/lib/esm/commands/inputs/delete-item.js +6 -5
  211. package/lib/esm/commands/inputs/delete-item.js.map +1 -1
  212. package/lib/esm/commands/inputs/get-item.d.ts +2 -2
  213. package/lib/esm/commands/inputs/get-item.js +10 -11
  214. package/lib/esm/commands/inputs/get-item.js.map +1 -1
  215. package/lib/esm/commands/inputs/index.d.ts +0 -1
  216. package/lib/esm/commands/inputs/index.js.map +1 -1
  217. package/lib/esm/commands/inputs/lib.d.ts +13 -7
  218. package/lib/esm/commands/inputs/lib.js +12 -15
  219. package/lib/esm/commands/inputs/lib.js.map +1 -1
  220. package/lib/esm/commands/inputs/put-item.d.ts +2 -2
  221. package/lib/esm/commands/inputs/put-item.js +6 -5
  222. package/lib/esm/commands/inputs/put-item.js.map +1 -1
  223. package/lib/esm/commands/inputs/query.d.ts +4 -3
  224. package/lib/esm/commands/inputs/query.js +17 -13
  225. package/lib/esm/commands/inputs/query.js.map +1 -1
  226. package/lib/esm/commands/inputs/update-item.d.ts +2 -2
  227. package/lib/esm/commands/inputs/update-item.js +9 -17
  228. package/lib/esm/commands/inputs/update-item.js.map +1 -1
  229. package/lib/esm/index.js +0 -1
  230. package/lib/esm/index.js.map +1 -1
  231. package/package.json +1 -1
  232. package/lib/cjs/commands/expressions/condition/comparisons.d.ts +0 -22
  233. package/lib/cjs/commands/expressions/condition/comparisons.js +0 -211
  234. package/lib/cjs/commands/expressions/condition/comparisons.js.map +0 -1
  235. package/lib/cjs/commands/expressions/condition/expression.d.ts +0 -19
  236. package/lib/cjs/commands/expressions/condition/expression.js +0 -28
  237. package/lib/cjs/commands/expressions/condition/expression.js.map +0 -1
  238. package/lib/cjs/commands/expressions/condition/functions.d.ts +0 -71
  239. package/lib/cjs/commands/expressions/condition/functions.js +0 -92
  240. package/lib/cjs/commands/expressions/condition/functions.js.map +0 -1
  241. package/lib/cjs/commands/expressions/condition/size.js.map +0 -1
  242. package/lib/esm/commands/expressions/condition/comparisons.d.ts +0 -22
  243. package/lib/esm/commands/expressions/condition/comparisons.js +0 -207
  244. package/lib/esm/commands/expressions/condition/comparisons.js.map +0 -1
  245. package/lib/esm/commands/expressions/condition/expression.d.ts +0 -19
  246. package/lib/esm/commands/expressions/condition/expression.js +0 -23
  247. package/lib/esm/commands/expressions/condition/expression.js.map +0 -1
  248. package/lib/esm/commands/expressions/condition/functions.d.ts +0 -71
  249. package/lib/esm/commands/expressions/condition/functions.js +0 -85
  250. package/lib/esm/commands/expressions/condition/functions.js.map +0 -1
  251. package/lib/esm/commands/expressions/condition/size.js.map +0 -1
@@ -0,0 +1,50 @@
1
+ import { unreachable } from "@infra-blocks/types";
2
+ import { Between, isBetweenParams, } from "./comparisons/between.js";
3
+ import { Equals, isEqualsParams, } from "./comparisons/equals.js";
4
+ import { GreatThan, isGreaterThanParams, } from "./comparisons/greater-than.js";
5
+ import { GreaterThanOrEquals, isGreaterThanOrEqualsParams, } from "./comparisons/greater-than-or-equals.js";
6
+ import { In, isInParams } from "./comparisons/in.js";
7
+ import { isLowerThanParams, LowerThan, } from "./comparisons/lower-than.js";
8
+ import { isLowerThanOrEqualsParams, LowerThanOrEquals, } from "./comparisons/lower-than-or-equals.js";
9
+ import { isNotEqualsParams, NotEquals, } from "./comparisons/not-equals.js";
10
+ export const ConditionComparison = {
11
+ from(params) {
12
+ if (isBetweenParams(params)) {
13
+ return Between.from(params);
14
+ }
15
+ if (isEqualsParams(params)) {
16
+ return Equals.from(params);
17
+ }
18
+ if (isGreaterThanParams(params)) {
19
+ return GreatThan.from(params);
20
+ }
21
+ if (isGreaterThanOrEqualsParams(params)) {
22
+ return GreaterThanOrEquals.from(params);
23
+ }
24
+ if (isInParams(params)) {
25
+ return In.from(params);
26
+ }
27
+ if (isLowerThanParams(params)) {
28
+ return LowerThan.from(params);
29
+ }
30
+ if (isLowerThanOrEqualsParams(params)) {
31
+ return LowerThanOrEquals.from(params);
32
+ }
33
+ if (isNotEqualsParams(params)) {
34
+ return NotEquals.from(params);
35
+ }
36
+ unreachable(params);
37
+ },
38
+ };
39
+ export function isConditionComparisonParams(params) {
40
+ const casted = params;
41
+ return (isBetweenParams(casted) ||
42
+ isEqualsParams(casted) ||
43
+ isGreaterThanParams(casted) ||
44
+ isGreaterThanOrEqualsParams(casted) ||
45
+ isInParams(casted) ||
46
+ isLowerThanParams(casted) ||
47
+ isLowerThanOrEqualsParams(casted) ||
48
+ isNotEqualsParams(casted));
49
+ }
50
+ //# 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":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EACL,OAAO,EAEP,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,MAAM,EAEN,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,SAAS,EACT,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,mBAAmB,EAEnB,2BAA2B,GAC5B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,EAAE,EAAiB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EACL,iBAAiB,EACjB,SAAS,GAEV,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAElB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,SAAS,GAEV,MAAM,6BAA6B,CAAC;AAwBrC,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,CAAC,MAAiC;QACpC,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5B,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;QACD,IAAI,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3B,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC;QACD,IAAI,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC;YAChC,OAAO,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;QACD,IAAI,2BAA2B,CAAC,MAAM,CAAC,EAAE,CAAC;YACxC,OAAO,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC;QACD,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YACvB,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;QACD,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9B,OAAO,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;QACD,IAAI,yBAAyB,CAAC,MAAM,CAAC,EAAE,CAAC;YACtC,OAAO,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9B,OAAO,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;QACD,WAAW,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;CACF,CAAC;AAEF,MAAM,UAAU,2BAA2B,CACzC,MAAuB;IAEvB,MAAM,MAAM,GAAG,MAAmC,CAAC;IACnD,OAAO,CACL,eAAe,CAAC,MAAM,CAAC;QACvB,cAAc,CAAC,MAAM,CAAC;QACtB,mBAAmB,CAAC,MAAM,CAAC;QAC3B,2BAA2B,CAAC,MAAM,CAAC;QACnC,UAAU,CAAC,MAAM,CAAC;QAClB,iBAAiB,CAAC,MAAM,CAAC;QACzB,yBAAyB,CAAC,MAAM,CAAC;QACjC,iBAAiB,CAAC,MAAM,CAAC,CAC1B,CAAC;AACJ,CAAC"}
@@ -1,9 +1,10 @@
1
- import type { AttributeValue } from "../../../types.js";
2
- import { type Operand, type RawOperand } from "../operands/index.js";
3
- import type { ConditionComparisonParams } from "./comparisons.js";
4
- import type { ConditionExpression } from "./expression.js";
5
- import { type Size } from "./size.js";
6
- export type ConditionParams = ConditionExpression | ConditionComparisonParams;
7
- export type ConditionOperand<T extends AttributeValue = AttributeValue> = Operand<T> | Size;
8
- export type RawConditionOperand<T extends AttributeValue = AttributeValue> = RawOperand<T> | Size;
9
- export declare function conditionOperand<T extends AttributeValue = AttributeValue>(raw: RawConditionOperand<T>): ConditionOperand<T>;
1
+ import type { AttributeExists, AttributeNotExists, BeginsWith, Contains, IsAttributeOfType } from "../functions/index.js";
2
+ import { ConditionComparison, type ConditionComparisonParams } from "./condition-comparison.js";
3
+ import type { And, Not, Or } from "./logic.js";
4
+ export type ConditionParams = ConditionComparisonParams | ConditionFunction | ConditionLogic;
5
+ export type ConditionFunction = AttributeExists | AttributeNotExists | BeginsWith | IsAttributeOfType | Contains;
6
+ export type ConditionLogic = And | Not | Or;
7
+ export type Condition = ConditionComparison | ConditionFunction | ConditionLogic;
8
+ export declare const Condition: {
9
+ from(params: ConditionParams): Condition;
10
+ };
@@ -1,9 +1,10 @@
1
- import { operand } from "../operands/index.js";
2
- import { isSize } from "./size.js";
3
- export function conditionOperand(raw) {
4
- if (isSize(raw)) {
5
- return raw;
6
- }
7
- return operand(raw);
8
- }
1
+ import { ConditionComparison, isConditionComparisonParams, } from "./condition-comparison.js";
2
+ export const Condition = {
3
+ from(params) {
4
+ if (isConditionComparisonParams(params)) {
5
+ return ConditionComparison.from(params);
6
+ }
7
+ return params;
8
+ },
9
+ };
9
10
  //# sourceMappingURL=condition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/condition.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,OAAO,EAAmB,MAAM,sBAAsB,CAAC;AAG9E,OAAO,EAAE,MAAM,EAAa,MAAM,WAAW,CAAC;AAY9C,MAAM,UAAU,gBAAgB,CAC9B,GAA2B;IAE3B,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QAChB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,OAAO,CAAI,GAAG,CAAC,CAAC;AACzB,CAAC"}
1
+ {"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/condition.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,mBAAmB,EAEnB,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAsBnC,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,CAAC,MAAuB;QAC1B,IAAI,2BAA2B,CAAC,MAAM,CAAC,EAAE,CAAC;YACxC,OAAO,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC"}
@@ -1,5 +1,4 @@
1
- export type { Between, ComparableOperand, ComparableValue, ConditionComparisonParams, Equals, GreaterThan, GreaterThanOrEquals, In, LowerThan, LowerThanOrEquals, NotEquals, } from "./comparisons.js";
1
+ export type { BetweenParams, ComparableOperand, ComparableValue, EqualsParams, GreaterThanOrEqualsParams, GreaterThanParams, InParams, LowerThanOrEqualsParams, LowerThanParams, NotEqualsParams, } from "./comparisons/index.js";
2
2
  export * from "./condition.js";
3
- export * from "./functions.js";
3
+ export type { ConditionComparisonParams } from "./condition-comparison.js";
4
4
  export * from "./logic.js";
5
- export * from "./size.js";
@@ -1,5 +1,3 @@
1
1
  export * from "./condition.js";
2
- export * from "./functions.js";
3
2
  export * from "./logic.js";
4
- export * from "./size.js";
5
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/index.ts"],"names":[],"mappings":"AAaA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/index.ts"],"names":[],"mappings":"AAYA,cAAc,gBAAgB,CAAC;AAE/B,cAAc,YAAY,CAAC"}
@@ -1,34 +1,38 @@
1
- import type { ConditionParams } from "./condition.js";
2
- import { ConditionExpression } from "./expression.js";
1
+ import { type Brand } from "@infra-blocks/types";
2
+ import { ExpressionFormatter } from "../expression.js";
3
+ import { type ConditionParams } from "./condition.js";
4
+ export type Not = ExpressionFormatter & Brand<"Not">;
3
5
  /**
4
6
  * Negates the provided condition using the `NOT` operator.
5
7
  *
6
8
  * @param condition - The condition to negate.
7
9
  *
8
- * @returns A {@link ConditionExpression} that evaluates to the opposite of what the provided condition evaluates to.
10
+ * @returns A {@link Not} that evaluates to the opposite of what the provided condition evaluates to.
9
11
  *
10
12
  * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
11
13
  */
12
- export declare function not(condition: ConditionParams): ConditionExpression;
14
+ export declare function not(condition: ConditionParams): Not;
15
+ export type And = ExpressionFormatter & Brand<"And">;
13
16
  /**
14
17
  * Returns a condition that combines the provided ones using the `AND` operator.
15
18
  *
16
19
  * @param lhs - The first condition to combine.
17
20
  * @param rhs - The second condition to combine.
18
21
  *
19
- * @returns A {@link ConditionExpression} that evaluates to true only if both conditions evaluate to true.
22
+ * @returns An {@link And} that evaluates to true only if both conditions evaluate to true.
20
23
  *
21
24
  * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
22
25
  */
23
- export declare function and(lhs: ConditionParams, rhs: ConditionParams): ConditionExpression;
26
+ export declare function and(lhs: ConditionParams, rhs: ConditionParams): And;
27
+ export type Or = ExpressionFormatter & Brand<"Or">;
24
28
  /**
25
29
  * Returns a condition that combines the provided ones using the `OR` operator.
26
30
  *
27
31
  * @param lhs - The first condition to combine.
28
32
  * @param rhs - The second condition to combine.
29
33
  *
30
- * @returns A {@link ConditionExpression} that evaluates to true if any conditions evaluate to true.
34
+ * @returns An {@link Or} that evaluates to true if any conditions evaluate to true.
31
35
  *
32
36
  * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
33
37
  */
34
- export declare function or(lhs: ConditionParams, rhs: ConditionParams): ConditionExpression;
38
+ export declare function or(lhs: ConditionParams, rhs: ConditionParams): Or;
@@ -1,20 +1,18 @@
1
- import { ConditionExpression, conditionExpression } from "./expression.js";
1
+ import { trusted } from "@infra-blocks/types";
2
+ import { ExpressionFormatter } from "../expression.js";
3
+ import { Condition } from "./condition.js";
2
4
  /**
3
5
  * Negates the provided condition using the `NOT` operator.
4
6
  *
5
7
  * @param condition - The condition to negate.
6
8
  *
7
- * @returns A {@link ConditionExpression} that evaluates to the opposite of what the provided condition evaluates to.
9
+ * @returns A {@link Not} that evaluates to the opposite of what the provided condition evaluates to.
8
10
  *
9
11
  * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
10
12
  */
11
13
  export function not(condition) {
12
- const expression = conditionExpression(condition);
13
- return ConditionExpression.from({
14
- stringify: ({ names, values }) => {
15
- return `(NOT ${expression.stringify({ names, values })})`;
16
- },
17
- });
14
+ const expression = Condition.from(condition);
15
+ return trusted(ExpressionFormatter.from(({ names, values }) => `(NOT ${expression.format({ names, values })})`));
18
16
  }
19
17
  /**
20
18
  * Returns a condition that combines the provided ones using the `AND` operator.
@@ -22,21 +20,17 @@ export function not(condition) {
22
20
  * @param lhs - The first condition to combine.
23
21
  * @param rhs - The second condition to combine.
24
22
  *
25
- * @returns A {@link ConditionExpression} that evaluates to true only if both conditions evaluate to true.
23
+ * @returns An {@link And} that evaluates to true only if both conditions evaluate to true.
26
24
  *
27
25
  * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
28
26
  */
29
27
  export function and(lhs, rhs) {
30
- const left = conditionExpression(lhs);
31
- const right = conditionExpression(rhs);
32
- return ConditionExpression.from({
33
- stringify: ({ names, values }) => {
34
- return `(${left.stringify({ names, values })} AND ${right.stringify({
35
- names,
36
- values,
37
- })})`;
38
- },
39
- });
28
+ const left = Condition.from(lhs);
29
+ const right = Condition.from(rhs);
30
+ return trusted(ExpressionFormatter.from(({ names, values }) => `(${left.format({ names, values })} AND ${right.format({
31
+ names,
32
+ values,
33
+ })})`));
40
34
  }
41
35
  /**
42
36
  * Returns a condition that combines the provided ones using the `OR` operator.
@@ -44,20 +38,16 @@ export function and(lhs, rhs) {
44
38
  * @param lhs - The first condition to combine.
45
39
  * @param rhs - The second condition to combine.
46
40
  *
47
- * @returns A {@link ConditionExpression} that evaluates to true if any conditions evaluate to true.
41
+ * @returns An {@link Or} that evaluates to true if any conditions evaluate to true.
48
42
  *
49
43
  * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
50
44
  */
51
45
  export function or(lhs, rhs) {
52
- const left = conditionExpression(lhs);
53
- const right = conditionExpression(rhs);
54
- return ConditionExpression.from({
55
- stringify: ({ names, values }) => {
56
- return `(${left.stringify({ names, values })} OR ${right.stringify({
57
- names,
58
- values,
59
- })})`;
60
- },
61
- });
46
+ const left = Condition.from(lhs);
47
+ const right = Condition.from(rhs);
48
+ return trusted(ExpressionFormatter.from(({ names, values }) => `(${left.format({ names, values })} OR ${right.format({
49
+ names,
50
+ values,
51
+ })})`));
62
52
  }
63
53
  //# sourceMappingURL=logic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logic.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/logic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3E;;;;;;;;GAQG;AACH,MAAM,UAAU,GAAG,CAAC,SAA0B;IAC5C,MAAM,UAAU,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAClD,OAAO,mBAAmB,CAAC,IAAI,CAAC;QAC9B,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;YAC/B,OAAO,QAAQ,UAAU,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC;QAC5D,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,GAAG,CACjB,GAAoB,EACpB,GAAoB;IAEpB,MAAM,IAAI,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACvC,OAAO,mBAAmB,CAAC,IAAI,CAAC;QAC9B,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;YAC/B,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,QAAQ,KAAK,CAAC,SAAS,CAAC;gBAClE,KAAK;gBACL,MAAM;aACP,CAAC,GAAG,CAAC;QACR,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,EAAE,CAChB,GAAoB,EACpB,GAAoB;IAEpB,MAAM,IAAI,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACvC,OAAO,mBAAmB,CAAC,IAAI,CAAC;QAC9B,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;YAC/B,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,OAAO,KAAK,CAAC,SAAS,CAAC;gBACjE,KAAK;gBACL,MAAM;aACP,CAAC,GAAG,CAAC;QACR,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"logic.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/logic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAwB,MAAM,gBAAgB,CAAC;AAIjE;;;;;;;;GAQG;AACH,MAAM,UAAU,GAAG,CAAC,SAA0B;IAC5C,MAAM,UAAU,GAAG,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC7C,OAAO,OAAO,CACZ,mBAAmB,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,MAAM,UAAU,GAAG,CAAC,GAAoB,EAAE,GAAoB;IAC5D,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,OAAO,CACZ,mBAAmB,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,MAAM,UAAU,EAAE,CAAC,GAAoB,EAAE,GAAoB;IAC3D,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,OAAO,CACZ,mBAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,OAAO,KAAK,CAAC,MAAM,CAAC;QACpD,KAAK;QACL,MAAM;KACP,CAAC,GAAG,CACR,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { AttributeValue } from "../../../types.js";
2
+ import { type Operand, type RawOperand } from "../operands/operand.js";
3
+ import { type Size } from "../operands/size.js";
4
+ export type ConditionOperand<T extends AttributeValue = AttributeValue> = Operand<T> | Size;
5
+ export type RawConditionOperand<T extends AttributeValue = AttributeValue> = RawOperand<T> | Size;
6
+ export declare const ConditionOperand: {
7
+ normalize<T extends AttributeValue = AttributeValue>(raw: RawConditionOperand<T>): ConditionOperand<T>;
8
+ };
@@ -0,0 +1,12 @@
1
+ import { operand } from "../operands/operand.js";
2
+ import { isSize } from "../operands/size.js";
3
+ // TODO: internal
4
+ export const ConditionOperand = {
5
+ normalize(raw) {
6
+ if (isSize(raw)) {
7
+ return raw;
8
+ }
9
+ return operand(raw);
10
+ },
11
+ };
12
+ //# sourceMappingURL=operand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operand.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/operand.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,OAAO,EAAmB,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,MAAM,EAAa,MAAM,qBAAqB,CAAC;AASxD,iBAAiB;AAEjB,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,SAAS,CACP,GAA2B;QAE3B,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YAChB,OAAO,GAAG,CAAC;QACb,CAAC;QACD,OAAO,OAAO,CAAI,GAAG,CAAC,CAAC;IACzB,CAAC;CACF,CAAC"}
@@ -1,12 +1,14 @@
1
- import type { AttributeNames } from "../attributes/names.js";
2
- import type { AttributeValues } from "../attributes/values.js";
3
- export type Stringifier = (params: {
1
+ import type { AttributeNames, AttributeValues } from "../attributes/index.js";
2
+ export type Formatter = (params: {
4
3
  names: AttributeNames;
5
4
  values: AttributeValues;
6
5
  }) => string;
7
- export interface IExpression {
8
- stringify(params: {
6
+ export type ExpressionFormatter = {
7
+ format(params: {
9
8
  names: AttributeNames;
10
9
  values: AttributeValues;
11
10
  }): string;
12
- }
11
+ };
12
+ export declare const ExpressionFormatter: {
13
+ from(formatter: Formatter): ExpressionFormatter;
14
+ };
@@ -1,2 +1,8 @@
1
- export {};
1
+ export const ExpressionFormatter = {
2
+ from(formatter) {
3
+ return {
4
+ format: formatter,
5
+ };
6
+ },
7
+ };
2
8
  //# sourceMappingURL=expression.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"expression.js","sourceRoot":"","sources":["../../../../src/commands/expressions/expression.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"expression.js","sourceRoot":"","sources":["../../../../src/commands/expressions/expression.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,CAAC,SAAoB;QACvB,OAAO;YACL,MAAM,EAAE,SAAS;SAClB,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type Brand } from "@infra-blocks/types";
2
+ import { ExpressionFormatter } from "../expression.js";
3
+ import { type RawPath } from "../operands/path.js";
4
+ export type AttributeExists = ExpressionFormatter & Brand<"AttributeExists">;
5
+ /**
6
+ * Returns a condition that uses the `attribute_exists` function.
7
+ *
8
+ * @param rawPath - The attribute path to check for existence.
9
+ * @returns An {@link AttributeExists} that evaluates to true if the provided attribute path exists.
10
+ *
11
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
12
+ */
13
+ export declare function attributeExists(rawPath: RawPath): AttributeExists;
@@ -0,0 +1,16 @@
1
+ import { trusted } from "@infra-blocks/types";
2
+ import { ExpressionFormatter } from "../expression.js";
3
+ import { Path } from "../operands/path.js";
4
+ /**
5
+ * Returns a condition that uses the `attribute_exists` function.
6
+ *
7
+ * @param rawPath - The attribute path to check for existence.
8
+ * @returns An {@link AttributeExists} that evaluates to true if the provided attribute path exists.
9
+ *
10
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
11
+ */
12
+ export function attributeExists(rawPath) {
13
+ const path = Path.normalize(rawPath);
14
+ return trusted(ExpressionFormatter.from(({ names }) => `attribute_exists(${path.substitute({ names })})`));
15
+ }
16
+ //# sourceMappingURL=attribute-exists.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attribute-exists.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/attribute-exists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAgB,MAAM,qBAAqB,CAAC;AAIzD;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC9C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,OAAO,CACZ,mBAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,oBAAoB,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CACjE,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type Brand } from "@infra-blocks/types";
2
+ import { ExpressionFormatter } from "../expression.js";
3
+ import { type RawPath } from "../operands/path.js";
4
+ export type AttributeNotExists = ExpressionFormatter & Brand<"AttributeNotExists">;
5
+ /**
6
+ * Returns a condition that uses the `attribute_not_exists` function.
7
+ *
8
+ * @param rawPath - The attribute path to check for non-existence.
9
+ * @returns An {@link AttributeNotExists} that evaluates to true if the provided attribute path does not exist.
10
+ *
11
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
12
+ */
13
+ export declare function attributeNotExists(rawPath: RawPath): AttributeNotExists;
@@ -0,0 +1,16 @@
1
+ import { trusted } from "@infra-blocks/types";
2
+ import { ExpressionFormatter } from "../expression.js";
3
+ import { Path } from "../operands/path.js";
4
+ /**
5
+ * Returns a condition that uses the `attribute_not_exists` function.
6
+ *
7
+ * @param rawPath - The attribute path to check for non-existence.
8
+ * @returns An {@link AttributeNotExists} that evaluates to true if the provided attribute path does not exist.
9
+ *
10
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
11
+ */
12
+ export function attributeNotExists(rawPath) {
13
+ const path = Path.normalize(rawPath);
14
+ return trusted(ExpressionFormatter.from(({ names }) => `attribute_not_exists(${path.substitute({ names })})`));
15
+ }
16
+ //# sourceMappingURL=attribute-not-exists.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attribute-not-exists.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/attribute-not-exists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAgB,MAAM,qBAAqB,CAAC;AAKzD;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IACjD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,OAAO,CACZ,mBAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,wBAAwB,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CACrE,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type Brand } from "@infra-blocks/types";
2
+ import type { AttributeType } from "../../../types.js";
3
+ import { ExpressionFormatter } from "../expression.js";
4
+ import { type RawPath } from "../operands/path.js";
5
+ import { type RawValue } from "../operands/value.js";
6
+ export type IsAttributeOfType = ExpressionFormatter & Brand<"IsAttributeOfType">;
7
+ /**
8
+ * Returns a condition that uses the `attribute_type` function.
9
+ *
10
+ * @param attribute - The attribute path to check.
11
+ * @param rawType - The expected type of the attribute.
12
+ *
13
+ * @returns An {@link IsAttributeOfType} that evaluates to true if the attribute is of the expected type.
14
+ *
15
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
16
+ */
17
+ export declare function attributeType(attribute: RawPath, rawType: RawValue<AttributeType>): IsAttributeOfType;
@@ -0,0 +1,20 @@
1
+ import { trusted } from "@infra-blocks/types";
2
+ import { ExpressionFormatter } from "../expression.js";
3
+ import { Path } from "../operands/path.js";
4
+ import { Value } from "../operands/value.js";
5
+ /**
6
+ * Returns a condition that uses the `attribute_type` function.
7
+ *
8
+ * @param attribute - The attribute path to check.
9
+ * @param rawType - The expected type of the attribute.
10
+ *
11
+ * @returns An {@link IsAttributeOfType} that evaluates to true if the attribute is of the expected type.
12
+ *
13
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
14
+ */
15
+ export function attributeType(attribute, rawType) {
16
+ const path = Path.normalize(attribute);
17
+ const type = Value.normalize(rawType);
18
+ return trusted(ExpressionFormatter.from(({ names, values }) => `attribute_type(${path.substitute({ names })}, ${type.substitute({ values })})`));
19
+ }
20
+ //# sourceMappingURL=attribute-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attribute-type.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/attribute-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAgB,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAiB,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAM5D;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAC3B,SAAkB,EAClB,OAAgC;IAEhC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACtC,OAAO,OAAO,CACZ,mBAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,kBAAkB,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAClF,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { type Brand } from "@infra-blocks/types";
2
+ import type { NativeBinary, NativeString } from "../../../types.js";
3
+ import { ExpressionFormatter } from "../expression.js";
4
+ import { type RawOperand } from "../operands/operand.js";
5
+ /**
6
+ * This type aggregates the types of operands that can be used with the {@link beginsWith} function.
7
+ *
8
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
9
+ */
10
+ export type BeginsWithOperand = RawOperand<StringOrBinary>;
11
+ export type BeginsWith = ExpressionFormatter & Brand<"BeginsWith">;
12
+ /**
13
+ * Returns a condition that uses the `begins_with` function.
14
+ *
15
+ * @param first - The first function operand, which is the path or value to check.
16
+ * @param second - The second function operand, which is the prefix to validate against.
17
+ *
18
+ * @returns A {@link BeginsWith} that evaluates to true if the first operand begins with the second.
19
+ *
20
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
21
+ */
22
+ export declare function beginsWith(first: BeginsWithOperand, second: BeginsWithOperand): BeginsWith;
23
+ type StringOrBinary = NativeString | NativeBinary;
24
+ export {};
@@ -0,0 +1,19 @@
1
+ import { trusted } from "@infra-blocks/types";
2
+ import { ExpressionFormatter } from "../expression.js";
3
+ import { operand } from "../operands/operand.js";
4
+ /**
5
+ * Returns a condition that uses the `begins_with` function.
6
+ *
7
+ * @param first - The first function operand, which is the path or value to check.
8
+ * @param second - The second function operand, which is the prefix to validate against.
9
+ *
10
+ * @returns A {@link BeginsWith} that evaluates to true if the first operand begins with the second.
11
+ *
12
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
13
+ */
14
+ export function beginsWith(first, second) {
15
+ const firstOperand = operand(first);
16
+ const secondOperand = operand(second);
17
+ return trusted(ExpressionFormatter.from(({ names, values }) => `begins_with(${firstOperand.substitute({ names, values })}, ${secondOperand.substitute({ names, values })})`));
18
+ }
19
+ //# sourceMappingURL=begins-with.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"begins-with.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/begins-with.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAmB,MAAM,wBAAwB,CAAC;AAWlE;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CACxB,KAAwB,EACxB,MAAyB;IAEzB,MAAM,YAAY,GAAG,OAAO,CAAiB,KAAK,CAAC,CAAC;IACpD,MAAM,aAAa,GAAG,OAAO,CAAiB,MAAM,CAAC,CAAC;IAEtD,OAAO,OAAO,CACZ,mBAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,eAAe,YAAY,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,KAAK,aAAa,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,CAC/G,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type Brand } from "@infra-blocks/types";
2
+ import { ExpressionFormatter } from "../expression.js";
3
+ import { type RawOperand } from "../operands/operand.js";
4
+ import { type Size } from "../operands/size.js";
5
+ export type Contains = ExpressionFormatter & Brand<"Contains">;
6
+ /**
7
+ * Returns a condition that uses the `contains` function.
8
+ *
9
+ * @param first - The first function operand, which is the path or value to check.
10
+ * @param second - The second function operand, which is the value to check for containment.
11
+ *
12
+ * @returns A {@link ConditionExpressionFormatter} that evaluates to true if this operand contains the provided one.
13
+ *
14
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
15
+ */
16
+ export declare function contains(first: RawOperand, second: RawOperand | Size): Contains;
@@ -0,0 +1,20 @@
1
+ import { trusted } from "@infra-blocks/types";
2
+ import { ExpressionFormatter } from "../expression.js";
3
+ import { operand } from "../operands/operand.js";
4
+ import { isSize } from "../operands/size.js";
5
+ /**
6
+ * Returns a condition that uses the `contains` function.
7
+ *
8
+ * @param first - The first function operand, which is the path or value to check.
9
+ * @param second - The second function operand, which is the value to check for containment.
10
+ *
11
+ * @returns A {@link ConditionExpressionFormatter} that evaluates to true if this operand contains the provided one.
12
+ *
13
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
14
+ */
15
+ export function contains(first, second) {
16
+ const firstOperand = operand(first);
17
+ const secondOperand = isSize(second) ? second : operand(second);
18
+ return trusted(ExpressionFormatter.from(({ names, values }) => `contains(${firstOperand.substitute({ names, values })}, ${secondOperand.substitute({ names, values })})`));
19
+ }
20
+ //# sourceMappingURL=contains.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contains.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/contains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAmB,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAa,MAAM,qBAAqB,CAAC;AAIxD;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CACtB,KAAiB,EACjB,MAAyB;IAEzB,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhE,OAAO,OAAO,CACZ,mBAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,YAAY,YAAY,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,KAAK,aAAa,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,CAC5G,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./attribute-exists.js";
2
+ export * from "./attribute-not-exists.js";
3
+ export * from "./attribute-type.js";
4
+ export * from "./begins-with.js";
5
+ export * from "./contains.js";
@@ -0,0 +1,6 @@
1
+ export * from "./attribute-exists.js";
2
+ export * from "./attribute-not-exists.js";
3
+ export * from "./attribute-type.js";
4
+ export * from "./begins-with.js";
5
+ export * from "./contains.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from "./condition/index.js";
2
+ export * from "./functions/index.js";
2
3
  export * from "./key-condition.js";
3
4
  export * from "./operands/index.js";
4
5
  export * from "./projection.js";
@@ -1,4 +1,5 @@
1
1
  export * from "./condition/index.js";
2
+ export * from "./functions/index.js";
2
3
  export * from "./key-condition.js";
3
4
  export * from "./operands/index.js";
4
5
  export * from "./projection.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/expressions/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/expressions/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
@@ -1,2 +1,2 @@
1
1
  import type { ConditionParams } from "./condition/index.js";
2
- export type KeyConditionExpression = ConditionParams;
2
+ export type KeyConditionParams = ConditionParams;
@@ -1,3 +1,4 @@
1
1
  export { type ImplicitOperand, type Operand, operand, type RawOperand, } from "./operand.js";
2
2
  export { type ImplicitPath, literal, Path, path, type RawPath, } from "./path.js";
3
+ export { type RawSizeOperand, type SizeOperand, type SizeOperandValue, size, } from "./size.js";
3
4
  export { type ImplicitValue, type RawValue, Value, value, } from "./value.js";
@@ -1,4 +1,5 @@
1
1
  export { operand, } from "./operand.js";
2
2
  export { literal, Path, path, } from "./path.js";
3
+ export { size, } from "./size.js";
3
4
  export { Value, value, } from "./value.js";
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,OAAO,GAER,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,OAAO,EACP,IAAI,EACJ,IAAI,GAEL,MAAM,WAAW,CAAC;AACnB,OAAO,EAGL,KAAK,EACL,KAAK,GACN,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,OAAO,GAER,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,OAAO,EACP,IAAI,EACJ,IAAI,GAEL,MAAM,WAAW,CAAC;AACnB,OAAO,EAIL,IAAI,GACL,MAAM,WAAW,CAAC;AACnB,OAAO,EAGL,KAAK,EACL,KAAK,GACN,MAAM,YAAY,CAAC"}