@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
@@ -1,19 +1,14 @@
1
- import { AttributeNames, AttributeValues } from "../attributes/index.js";
2
- import { conditionExpression } from "../expressions/condition/expression.js";
3
- import { UpdateExpression, } from "../expressions/index.js";
1
+ import { Condition, Update, } from "../expressions/index.js";
2
+ import { ExpressionsFormatter } from "./lib.js";
4
3
  export const UpdateItemInput = {
5
4
  encode,
6
5
  };
7
6
  function encode(input) {
8
- const names = AttributeNames.create();
9
- const values = AttributeValues.create();
7
+ const formatter = ExpressionsFormatter.create();
10
8
  const result = {
11
9
  TableName: input.table,
12
10
  Key: input.key,
13
- UpdateExpression: UpdateExpression.from(input.update).stringify({
14
- names,
15
- values,
16
- }),
11
+ UpdateExpression: formatter.format(Update.from(input.update)),
17
12
  };
18
13
  if (input.returnValues != null) {
19
14
  result.ReturnValues = input.returnValues;
@@ -25,18 +20,15 @@ function encode(input) {
25
20
  // If there is no condition, we know that the names and values are finalized and
26
21
  // we are ready to return the payload.
27
22
  if (input.condition == null) {
28
- result.ExpressionAttributeNames = names.getSubstitutions();
29
- result.ExpressionAttributeValues = values.getSubstitutions();
23
+ result.ExpressionAttributeNames = formatter.getExpressionAttributeNames();
24
+ result.ExpressionAttributeValues = formatter.getExpressionAttributeValues();
30
25
  return result;
31
26
  }
32
27
  // Otherwise, we need to stringify the condition, reusing the same names and values
33
28
  // as before.
34
- result.ConditionExpression = conditionExpression(input.condition).stringify({
35
- names,
36
- values,
37
- });
38
- result.ExpressionAttributeNames = names.getSubstitutions();
39
- result.ExpressionAttributeValues = values.getSubstitutions();
29
+ result.ConditionExpression = formatter.format(Condition.from(input.condition));
30
+ result.ExpressionAttributeNames = formatter.getExpressionAttributeNames();
31
+ result.ExpressionAttributeValues = formatter.getExpressionAttributeValues();
40
32
  return result;
41
33
  }
42
34
  //# sourceMappingURL=update-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../../src/commands/inputs/update-item.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAEL,gBAAgB,GAEjB,MAAM,yBAAyB,CAAC;AAoBjC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM;CACP,CAAC;AAEF,SAAS,MAAM,CACb,KAAyB;IAEzB,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;IACxC,MAAM,MAAM,GAAuB;QACjC,SAAS,EAAE,KAAK,CAAC,KAAK;QACtB,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,gBAAgB,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;YAC9D,KAAK;YACL,MAAM;SACP,CAAC;KACH,CAAC;IAEF,IAAI,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,KAAK,CAAC,GAAG;QACd,gBAAgB,EAAE,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KAC9D,CAAC;IAEF,IAAI,KAAK,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAC3C,CAAC;IAED,IAAI,KAAK,CAAC,mCAAmC,IAAI,IAAI,EAAE,CAAC;QACtD,MAAM,CAAC,mCAAmC;YACxC,KAAK,CAAC,mCAAmC,CAAC;IAC9C,CAAC;IAED,gFAAgF;IAChF,sCAAsC;IACtC,IAAI,KAAK,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QAC5B,MAAM,CAAC,wBAAwB,GAAG,SAAS,CAAC,2BAA2B,EAAE,CAAC;QAC1E,MAAM,CAAC,yBAAyB,GAAG,SAAS,CAAC,4BAA4B,EAAE,CAAC;QAC5E,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,mFAAmF;IACnF,aAAa;IACb,MAAM,CAAC,mBAAmB,GAAG,SAAS,CAAC,MAAM,CAC3C,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAChC,CAAC;IACF,MAAM,CAAC,wBAAwB,GAAG,SAAS,CAAC,2BAA2B,EAAE,CAAC;IAC1E,MAAM,CAAC,yBAAyB,GAAG,SAAS,CAAC,4BAA4B,EAAE,CAAC;IAC5E,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/lib/esm/index.js CHANGED
@@ -1,4 +1,3 @@
1
- // TODO: export new style commands, input and output types.
2
1
  export * from "./client.js";
3
2
  export * from "./commands/index.js";
4
3
  export * from "./error.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infra-blocks/aws-dynamodb",
3
- "version": "0.64.0",
3
+ "version": "0.65.0",
4
4
  "description": "A convenience wrapper over @aws-sdk/client-dynamodb and @aws-sdk/lib-dynamodb.",
5
5
  "keywords": [
6
6
  "aws",
@@ -1,22 +0,0 @@
1
- import type { NativeBinary, NativeNumber, NativeString } from "../../../types.js";
2
- import { type ConditionParams, type RawConditionOperand } from "./condition.js";
3
- import { ConditionExpression } from "./expression.js";
4
- export type ComparableValue = NativeBinary | NativeNumber | NativeString;
5
- export type ComparableOperand = RawConditionOperand<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 = [RawConditionOperand, "=", RawConditionOperand];
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 = [RawConditionOperand, "<>", RawConditionOperand];
21
- export declare function comparison(params: ConditionComparisonParams): ConditionExpression;
22
- export declare function isComparison(params: ConditionParams): params is ConditionComparisonParams;
@@ -1,211 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.comparison = comparison;
4
- exports.isComparison = isComparison;
5
- const types_1 = require("@infra-blocks/types");
6
- const condition_js_1 = require("./condition.js");
7
- const expression_js_1 = require("./expression.js");
8
- // TODO: don't export publicly through index.
9
- function comparison(params) {
10
- if (isBetween(params)) {
11
- return between(params);
12
- }
13
- if (isEquals(params)) {
14
- return equals(params);
15
- }
16
- if (isGreaterThan(params)) {
17
- return greaterThan(params);
18
- }
19
- if (isGreaterThanOrEquals(params)) {
20
- return greaterThanOrEquals(params);
21
- }
22
- if (isIn(params)) {
23
- return inComparison(params);
24
- }
25
- if (isLowerThan(params)) {
26
- return lowerThan(params);
27
- }
28
- if (isLowerThanOrEquals(params)) {
29
- return lowerThanOrEquals(params);
30
- }
31
- if (isNotEquals(params)) {
32
- return notEquals(params);
33
- }
34
- (0, types_1.unreachable)(params);
35
- }
36
- function isComparison(params) {
37
- const casted = params;
38
- return (isBetween(casted) ||
39
- isEquals(casted) ||
40
- isGreaterThan(casted) ||
41
- isGreaterThanOrEquals(casted) ||
42
- isIn(casted) ||
43
- isLowerThan(casted) ||
44
- isLowerThanOrEquals(casted) ||
45
- isNotEquals(casted));
46
- }
47
- /**
48
- * Returns a condition that uses the `BETWEEN` operator.
49
- *
50
- * Both bounds are inclusive, meaning that the returned condition corresponds to `lower <= lhs <= upper`.
51
- *
52
- * @param params - The parameters of the `BETWEEN` comparison. The first element contains the left-hand side operand,
53
- * the third element contains the lower inclusive bound, and the fifth element contains the upper inclusive bound.
54
- *
55
- * @returns A {@link ConditionExpression} that evaluates to true if this operand is within the provided bounds.
56
- *
57
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
58
- */
59
- function between(params) {
60
- const lhs = (0, condition_js_1.conditionOperand)(params[0]);
61
- const lower = (0, condition_js_1.conditionOperand)(params[2]);
62
- const upper = (0, condition_js_1.conditionOperand)(params[4]);
63
- return expression_js_1.ConditionExpression.from({
64
- stringify: ({ names, values }) => {
65
- return `${lhs.substitute({ names, values })} BETWEEN ${lower.substitute({ names, values })} AND ${upper.substitute({ names, values })}`;
66
- },
67
- });
68
- }
69
- function isBetween(value) {
70
- return value[1] === "BETWEEN" && value[3] === "AND";
71
- }
72
- /**
73
- * Returns a condition that uses the `=` operator.
74
- *
75
- * @param params - The parameters of the `=` comparison. The first element contains the left-hand side operand,
76
- * and the third element contains the right-hand side operand.
77
- *
78
- * @returns A {@link ConditionExpression} that evaluates to true if this operand is equal to the provided one.
79
- *
80
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
81
- */
82
- function equals(params) {
83
- return binaryOperation(params);
84
- }
85
- function isEquals(value) {
86
- return value[1] === "=";
87
- }
88
- /**
89
- * Returns a condition that uses the `>` operator.
90
- *
91
- * @param params - The parameters of the `>` comparison. The first element contains the left-hand side operand,
92
- * the third element contains the right-hand side operand.
93
- *
94
- * @returns A {@link ConditionExpression} that evaluates to true if this operand is greater than the provided one.
95
- *
96
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
97
- */
98
- function greaterThan(params) {
99
- return binaryOperation(params);
100
- }
101
- function isGreaterThan(value) {
102
- return value[1] === ">";
103
- }
104
- /**
105
- * Returns a condition that uses the `>=` operator.
106
- *
107
- * @param params - The parameters of the `>=` comparison. The first element contains the left-hand side operand,
108
- * the third element contains the right-hand side operand.
109
- *
110
- * @returns A {@link ConditionExpression} that evaluates to true if this operand is greater than or equal to the provided one.
111
- *
112
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
113
- */
114
- function greaterThanOrEquals(params) {
115
- return binaryOperation(params);
116
- }
117
- function isGreaterThanOrEquals(value) {
118
- return value[1] === ">=";
119
- }
120
- /**
121
- * Returns a condition that uses the `IN` operator.
122
- *
123
- * This function throws if the list of elements to compared against is empty or exceeds 100 elements.
124
- *
125
- * @param params - The parameters of the `IN` comparison. The first element contains the left-hand side operand,
126
- * the third element contains the list of elements to compare against.
127
- *
128
- * @returns A {@link ConditionExpression} that evaluates to true if this operand is equal to any of the provided ones.
129
- *
130
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
131
- */
132
- function inComparison(params) {
133
- // TODO: unit test those limits
134
- if (params[2].length === 0) {
135
- throw new Error("the IN operator requires at least one operand.");
136
- }
137
- if (params[2].length > 100) {
138
- throw new Error(`up to 100 operands are support for the IN operator, got ${params[2].length}`);
139
- }
140
- const element = (0, condition_js_1.conditionOperand)(params[0]);
141
- const elements = params[2].map((condition_js_1.conditionOperand));
142
- return expression_js_1.ConditionExpression.from({
143
- stringify: ({ names, values }) => {
144
- const elementsString = elements
145
- .map((operand) => operand.substitute({ names, values }))
146
- .join(",");
147
- return `${element.substitute({ names, values })} IN (${elementsString})`;
148
- },
149
- });
150
- }
151
- function isIn(value) {
152
- return value[1] === "IN";
153
- }
154
- /**
155
- * Returns a condition that uses the `<` operator
156
- *
157
- * @param params - The parameters of the `<` comparison. The first element contains the left-hand side operand,
158
- * the third element contains the right-hand side operand.
159
- *
160
- * @returns A {@link ConditionExpression} that evaluates to true if this operand is lower than the provided one.
161
- *
162
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
163
- */
164
- function lowerThan(params) {
165
- return binaryOperation(params);
166
- }
167
- function isLowerThan(value) {
168
- return value[1] === "<";
169
- }
170
- /**
171
- * Returns a condition that uses the `<=` operator.
172
- *
173
- * @param params - The parameters of the `<=` comparison. The first element contains the left-hand side operand,
174
- * the third element contains the right-hand side operand.
175
- *
176
- * @returns A {@link ConditionExpression} that evaluates to true if this operand is lower than or equal to the provided one.
177
- *
178
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
179
- */
180
- function lowerThanOrEquals(params) {
181
- return binaryOperation(params);
182
- }
183
- function isLowerThanOrEquals(value) {
184
- return value[1] === "<=";
185
- }
186
- /**
187
- * Returns a condition that uses the `<>` operator.
188
- *
189
- * @param params - The parameters of the `<>` comparison. The first element contains the left-hand side operand,
190
- * the third element contains the right-hand side operand.
191
- *
192
- * @returns A {@link ConditionExpression} that evaluates to true if this operand is not equal to the provided one.
193
- *
194
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
195
- */
196
- function notEquals(params) {
197
- return binaryOperation(params);
198
- }
199
- function isNotEquals(value) {
200
- return value[1] === "<>";
201
- }
202
- function binaryOperation(params) {
203
- const lhs = (0, condition_js_1.conditionOperand)(params[0]);
204
- const rhs = (0, condition_js_1.conditionOperand)(params[2]);
205
- return expression_js_1.ConditionExpression.from({
206
- stringify: ({ names, values }) => {
207
- return `${lhs.substitute({ names, values })} ${params[1]} ${rhs.substitute({ names, values })}`;
208
- },
209
- });
210
- }
211
- //# sourceMappingURL=comparisons.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"comparisons.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/comparisons.ts"],"names":[],"mappings":";;AA8CA,gCA4BC;AAED,oCAcC;AA1FD,+CAAkD;AAQlD,iDAIwB;AACxB,mDAAsD;AAgCtD,6CAA6C;AAC7C,SAAgB,UAAU,CACxB,MAAiC;IAEjC,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QACtB,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACrB,O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ClD,CAAC;AAED,SAAS,WAAW,CAAC,KAAgC;IACnD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;AAC1B,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,iBAAiB,CAAC,MAAyB;IAClD,OAAO,eAAe,CAAkB,MAAM,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,mBAAmB,CAC1B,KAAgC;IAEhC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAC3B,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,SAAS,CAAC,MAAiB;IAClC,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,WAAW,CAAC,KAAgC;IACnD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAC3B,CAAC;AAED,SAAS,eAAe,CACtB,MAAgE;IAEhE,MAAM,GAAG,GAAG,IAAA,+BAAgB,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,IAAA,+BAAgB,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAExC,OAAO,mCAAmB,CAAC,IAAI,CAAC;QAC9B,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;YAC/B,OAAO,GAAG,GAAG,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAClG,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -1,19 +0,0 @@
1
- import type { AttributeNames } from "../../attributes/names.js";
2
- import type { AttributeValues } from "../../attributes/values.js";
3
- import type { IExpression, Stringifier } from "../expression.js";
4
- import type { ConditionParams } from "./condition.js";
5
- export declare class ConditionExpression implements IExpression {
6
- private readonly stringifier;
7
- private constructor();
8
- stringify(params: {
9
- names: AttributeNames;
10
- values: AttributeValues;
11
- }): string;
12
- /**
13
- * @private
14
- */
15
- static from(params: {
16
- stringify: Stringifier;
17
- }): ConditionExpression;
18
- }
19
- export declare function conditionExpression(params: ConditionParams): ConditionExpression;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConditionExpression = void 0;
4
- exports.conditionExpression = conditionExpression;
5
- const comparisons_js_1 = require("./comparisons.js");
6
- class ConditionExpression {
7
- stringifier;
8
- constructor(stringifier) {
9
- this.stringifier = stringifier;
10
- }
11
- stringify(params) {
12
- const { names, values } = params;
13
- return this.stringifier({ names, values });
14
- }
15
- /**
16
- * @private
17
- */
18
- static from(params) {
19
- const { stringify } = params;
20
- return new ConditionExpression(stringify);
21
- }
22
- }
23
- exports.ConditionExpression = ConditionExpression;
24
- // TODO: module visibility.
25
- function conditionExpression(params) {
26
- return (0, comparisons_js_1.isComparison)(params) ? (0, comparisons_js_1.comparison)(params) : params;
27
- }
28
- //# sourceMappingURL=expression.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"expression.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/expression.ts"],"names":[],"mappings":";;;AA+BA,kDAIC;AAhCD,qDAA4D;AAG5D,MAAa,mBAAmB;IACb,WAAW,CAAc;IAE1C,YAAoB,WAAwB;QAC1C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,SAAS,CAAC,MAGT;QACC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QACjC,OAAO,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,MAAkC;QAC5C,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC;CACF;AAtBD,kDAsBC;AAED,2BAA2B;AAC3B,SAAgB,mBAAmB,CACjC,MAAuB;IAEvB,OAAO,IAAA,6BAAY,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAA,2BAAU,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAC5D,CAAC"}
@@ -1,71 +0,0 @@
1
- import type { AttributeType, NativeBinary, NativeString } from "../../../types.js";
2
- import { type RawOperand } from "../operands/operand.js";
3
- import { type RawPath } from "../operands/path.js";
4
- import { type RawValue } from "../operands/value.js";
5
- import { type RawConditionOperand } from "./condition.js";
6
- import { ConditionExpression } from "./expression.js";
7
- /**
8
- * Returns a condition that uses the `attribute_exists` function.
9
- *
10
- * @param rawPath - The attribute path to check for existence.
11
- * @returns A {@link ConditionExpression} that evaluates to true if the provided attribute path exists.
12
- *
13
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
14
- */
15
- export declare function attributeExists(rawPath: RawPath): ConditionExpression;
16
- /**
17
- * Returns a condition that uses the `attribute_not_exists` function.
18
- *
19
- * @param rawPath - The attribute path to check for non-existence.
20
- * @returns A {@link ConditionExpression} that evaluates to true if the provided attribute path does not exist.
21
- *
22
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
23
- */
24
- export declare function attributeNotExists(rawPath: RawPath): ConditionExpression;
25
- /**
26
- * Returns a condition that uses the `attribute_type` function.
27
- *
28
- * @param attribute - The attribute path to check.
29
- * @param rawType - The expected type of the attribute.
30
- *
31
- * @returns A {@link ConditionExpression} that evaluates to true if the attribute is of the expected type.
32
- *
33
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
34
- */
35
- export declare function attributeType(attribute: RawPath, rawType: RawValue<AttributeType>): ConditionExpression;
36
- /**
37
- * This type aggregates the types of operands that can be used with the {@link beginsWith} function.
38
- *
39
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
40
- */
41
- export type BeginsWithOperand = RawOperand<NativeString | NativeBinary>;
42
- /**
43
- * Returns a condition that uses the `begins_with` function.
44
- *
45
- * @param first - The first function operand, which is the path or value to check.
46
- * @param second - The second function operand, which is the prefix to validate against.
47
- *
48
- * @returns A {@link ConditionExpression} that evaluates to true if the first operand begins with the second.
49
- *
50
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
51
- */
52
- export declare function beginsWith(first: BeginsWithOperand, second: BeginsWithOperand): ConditionExpression;
53
- /**
54
- * This type aggregates the types of operands that can be used as the first operand of the {@link contains} function.
55
- */
56
- export type ContainsFirstOperand = RawOperand;
57
- /**
58
- * This type aggregates the types of operands that can be used as the second operand of the {@link contains} function.
59
- */
60
- export type ContainsSecondOperand = RawConditionOperand;
61
- /**
62
- * Returns a condition that uses the `contains` function.
63
- *
64
- * @param first - The first function operand, which is the path or value to check.
65
- * @param second - The second function operand, which is the value to check for containment.
66
- *
67
- * @returns A {@link ConditionExpression} that evaluates to true if this operand contains the provided one.
68
- *
69
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
70
- */
71
- export declare function contains(first: ContainsFirstOperand, second: ContainsSecondOperand): ConditionExpression;
@@ -1,92 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.attributeExists = attributeExists;
4
- exports.attributeNotExists = attributeNotExists;
5
- exports.attributeType = attributeType;
6
- exports.beginsWith = beginsWith;
7
- exports.contains = contains;
8
- const operand_js_1 = require("../operands/operand.js");
9
- const path_js_1 = require("../operands/path.js");
10
- const value_js_1 = require("../operands/value.js");
11
- const condition_js_1 = require("./condition.js");
12
- const expression_js_1 = require("./expression.js");
13
- /**
14
- * Returns a condition that uses the `attribute_exists` function.
15
- *
16
- * @param rawPath - The attribute path to check for existence.
17
- * @returns A {@link ConditionExpression} that evaluates to true if the provided attribute path exists.
18
- *
19
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
20
- */
21
- function attributeExists(rawPath) {
22
- const path = path_js_1.Path.normalize(rawPath);
23
- return expression_js_1.ConditionExpression.from({
24
- stringify: ({ names }) => `attribute_exists(${path.substitute({ names })})`,
25
- });
26
- }
27
- /**
28
- * Returns a condition that uses the `attribute_not_exists` function.
29
- *
30
- * @param rawPath - The attribute path to check for non-existence.
31
- * @returns A {@link ConditionExpression} that evaluates to true if the provided attribute path does not exist.
32
- *
33
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
34
- */
35
- function attributeNotExists(rawPath) {
36
- const path = path_js_1.Path.normalize(rawPath);
37
- return expression_js_1.ConditionExpression.from({
38
- stringify: ({ names }) => `attribute_not_exists(${path.substitute({ names })})`,
39
- });
40
- }
41
- /**
42
- * Returns a condition that uses the `attribute_type` function.
43
- *
44
- * @param attribute - The attribute path to check.
45
- * @param rawType - The expected type of the attribute.
46
- *
47
- * @returns A {@link ConditionExpression} that evaluates to true if the attribute is of the expected type.
48
- *
49
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
50
- */
51
- function attributeType(attribute, rawType) {
52
- const path = path_js_1.Path.normalize(attribute);
53
- const type = value_js_1.Value.normalize(rawType);
54
- return expression_js_1.ConditionExpression.from({
55
- stringify: ({ names, values }) => `attribute_type(${path.substitute({ names })}, ${type.substitute({ values })})`,
56
- });
57
- }
58
- /**
59
- * Returns a condition that uses the `begins_with` function.
60
- *
61
- * @param first - The first function operand, which is the path or value to check.
62
- * @param second - The second function operand, which is the prefix to validate against.
63
- *
64
- * @returns A {@link ConditionExpression} that evaluates to true if the first operand begins with the second.
65
- *
66
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
67
- */
68
- function beginsWith(first, second) {
69
- const firstOperand = (0, operand_js_1.operand)(first);
70
- const secondOperand = (0, operand_js_1.operand)(second);
71
- return expression_js_1.ConditionExpression.from({
72
- stringify: ({ names, values }) => `begins_with(${firstOperand.substitute({ names, values })}, ${secondOperand.substitute({ names, values })})`,
73
- });
74
- }
75
- /**
76
- * Returns a condition that uses the `contains` function.
77
- *
78
- * @param first - The first function operand, which is the path or value to check.
79
- * @param second - The second function operand, which is the value to check for containment.
80
- *
81
- * @returns A {@link ConditionExpression} that evaluates to true if this operand contains the provided one.
82
- *
83
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
84
- */
85
- function contains(first, second) {
86
- const firstOperand = (0, operand_js_1.operand)(first);
87
- const secondOperand = (0, condition_js_1.conditionOperand)(second);
88
- return expression_js_1.ConditionExpression.from({
89
- stringify: ({ names, values }) => `contains(${firstOperand.substitute({ names, values })}, ${secondOperand.substitute({ names, values })})`,
90
- });
91
- }
92
- //# sourceMappingURL=functions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/functions.ts"],"names":[],"mappings":";;AAoBA,0CAKC;AAUD,gDAMC;AAYD,sCAUC;AAoBD,gCAWC;AAqBD,4BAWC;AAxHD,uDAAkE;AAClE,iDAAyD;AACzD,mDAA4D;AAC5D,iDAA4E;AAC5E,mDAAsD;AAEtD;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,OAAgB;IAC9C,MAAM,IAAI,GAAG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AAED;;;;;;;GAOG;AACH,SAAgB,IAAI,CAAC,GAAmB;IACtC,MAAM,SAAS,GAAG,IAAA,oBAAO,EAAmB,GAAG,CAAC,CAAC;IACjD,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC9B,CAAC;AAED,0BAA0B;AAC1B,SAAgB,MAAM,CAAC,KAAc;IACnC,OAAO,KAAK,YAAY,IAAI,CAAC;AAC/B,CAAC"}
@@ -1,22 +0,0 @@
1
- import type { NativeBinary, NativeNumber, NativeString } from "../../../types.js";
2
- import { type ConditionParams, type RawConditionOperand } from "./condition.js";
3
- import { ConditionExpression } from "./expression.js";
4
- export type ComparableValue = NativeBinary | NativeNumber | NativeString;
5
- export type ComparableOperand = RawConditionOperand<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 = [RawConditionOperand, "=", RawConditionOperand];
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 = [RawConditionOperand, "<>", RawConditionOperand];
21
- export declare function comparison(params: ConditionComparisonParams): ConditionExpression;
22
- export declare function isComparison(params: ConditionParams): params is ConditionComparisonParams;