@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,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,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.conditionOperand = conditionOperand;
4
- const index_js_1 = require("../operands/index.js");
5
- const size_js_1 = require("./size.js");
6
- function conditionOperand(raw) {
7
- if ((0, size_js_1.isSize)(raw)) {
8
- return raw;
9
- }
10
- return (0, index_js_1.operand)(raw);
11
- }
3
+ exports.Condition = void 0;
4
+ const condition_comparison_js_1 = require("./condition-comparison.js");
5
+ exports.Condition = {
6
+ from(params) {
7
+ if ((0, condition_comparison_js_1.isConditionComparisonParams)(params)) {
8
+ return condition_comparison_js_1.ConditionComparison.from(params);
9
+ }
10
+ return params;
11
+ },
12
+ };
12
13
  //# sourceMappingURL=condition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/condition.ts"],"names":[],"mappings":";;AAgBA,4CAOC;AAtBD,mDAA8E;AAG9E,uCAA8C;AAY9C,SAAgB,gBAAgB,CAC9B,GAA2B;IAE3B,IAAI,IAAA,gBAAM,EAAC,GAAG,CAAC,EAAE,CAAC;QAChB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,IAAA,kBAAO,EAAI,GAAG,CAAC,CAAC;AACzB,CAAC"}
1
+ {"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/condition.ts"],"names":[],"mappings":";;;AAOA,uEAImC;AAsBtB,QAAA,SAAS,GAAG;IACvB,IAAI,CAAC,MAAuB;QAC1B,IAAI,IAAA,qDAA2B,EAAC,MAAM,CAAC,EAAE,CAAC;YACxC,OAAO,6CAAmB,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";
@@ -15,7 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./condition.js"), exports);
18
- __exportStar(require("./functions.js"), exports);
19
18
  __exportStar(require("./logic.js"), exports);
20
- __exportStar(require("./size.js"), exports);
21
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAaA,iDAA+B;AAC/B,iDAA+B;AAC/B,6CAA2B;AAC3B,4CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAYA,iDAA+B;AAE/B,6CAA2B"}
@@ -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;
@@ -3,23 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.not = not;
4
4
  exports.and = and;
5
5
  exports.or = or;
6
- const expression_js_1 = require("./expression.js");
6
+ const types_1 = require("@infra-blocks/types");
7
+ const expression_js_1 = require("../expression.js");
8
+ const condition_js_1 = require("./condition.js");
7
9
  /**
8
10
  * Negates the provided condition using the `NOT` operator.
9
11
  *
10
12
  * @param condition - The condition to negate.
11
13
  *
12
- * @returns A {@link ConditionExpression} that evaluates to the opposite of what the provided condition evaluates to.
14
+ * @returns A {@link Not} that evaluates to the opposite of what the provided condition evaluates to.
13
15
  *
14
16
  * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
15
17
  */
16
18
  function not(condition) {
17
- const expression = (0, expression_js_1.conditionExpression)(condition);
18
- return expression_js_1.ConditionExpression.from({
19
- stringify: ({ names, values }) => {
20
- return `(NOT ${expression.stringify({ names, values })})`;
21
- },
22
- });
19
+ const expression = condition_js_1.Condition.from(condition);
20
+ return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names, values }) => `(NOT ${expression.format({ names, values })})`));
23
21
  }
24
22
  /**
25
23
  * Returns a condition that combines the provided ones using the `AND` operator.
@@ -27,21 +25,17 @@ function not(condition) {
27
25
  * @param lhs - The first condition to combine.
28
26
  * @param rhs - The second condition to combine.
29
27
  *
30
- * @returns A {@link ConditionExpression} that evaluates to true only if both conditions evaluate to true.
28
+ * @returns An {@link And} that evaluates to true only if both conditions evaluate to true.
31
29
  *
32
30
  * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
33
31
  */
34
32
  function and(lhs, rhs) {
35
- const left = (0, expression_js_1.conditionExpression)(lhs);
36
- const right = (0, expression_js_1.conditionExpression)(rhs);
37
- return expression_js_1.ConditionExpression.from({
38
- stringify: ({ names, values }) => {
39
- return `(${left.stringify({ names, values })} AND ${right.stringify({
40
- names,
41
- values,
42
- })})`;
43
- },
44
- });
33
+ const left = condition_js_1.Condition.from(lhs);
34
+ const right = condition_js_1.Condition.from(rhs);
35
+ return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names, values }) => `(${left.format({ names, values })} AND ${right.format({
36
+ names,
37
+ values,
38
+ })})`));
45
39
  }
46
40
  /**
47
41
  * Returns a condition that combines the provided ones using the `OR` operator.
@@ -49,20 +43,16 @@ function and(lhs, rhs) {
49
43
  * @param lhs - The first condition to combine.
50
44
  * @param rhs - The second condition to combine.
51
45
  *
52
- * @returns A {@link ConditionExpression} that evaluates to true if any conditions evaluate to true.
46
+ * @returns An {@link Or} that evaluates to true if any conditions evaluate to true.
53
47
  *
54
48
  * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
55
49
  */
56
50
  function or(lhs, rhs) {
57
- const left = (0, expression_js_1.conditionExpression)(lhs);
58
- const right = (0, expression_js_1.conditionExpression)(rhs);
59
- return expression_js_1.ConditionExpression.from({
60
- stringify: ({ names, values }) => {
61
- return `(${left.stringify({ names, values })} OR ${right.stringify({
62
- names,
63
- values,
64
- })})`;
65
- },
66
- });
51
+ const left = condition_js_1.Condition.from(lhs);
52
+ const right = condition_js_1.Condition.from(rhs);
53
+ return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names, values }) => `(${left.format({ names, values })} OR ${right.format({
54
+ names,
55
+ values,
56
+ })})`));
67
57
  }
68
58
  //# sourceMappingURL=logic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logic.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/logic.ts"],"names":[],"mappings":";;AAYA,kBAOC;AAYD,kBAcC;AAYD,gBAcC;AAtED,mDAA2E;AAE3E;;;;;;;;GAQG;AACH,SAAgB,GAAG,CAAC,SAA0B;IAC5C,MAAM,UAAU,GAAG,IAAA,mCAAmB,EAAC,SAAS,CAAC,CAAC;IAClD,OAAO,mCAAmB,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,SAAgB,GAAG,CACjB,GAAoB,EACpB,GAAoB;IAEpB,MAAM,IAAI,GAAG,IAAA,mCAAmB,EAAC,GAAG,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,IAAA,mCAAmB,EAAC,GAAG,CAAC,CAAC;IACvC,OAAO,mCAAmB,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,SAAgB,EAAE,CAChB,GAAoB,EACpB,GAAoB;IAEpB,MAAM,IAAI,GAAG,IAAA,mCAAmB,EAAC,GAAG,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,IAAA,mCAAmB,EAAC,GAAG,CAAC,CAAC;IACvC,OAAO,mCAAmB,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":";;AAeA,kBAOC;AAcD,kBAYC;AAcD,gBAYC;AA1ED,+CAA0D;AAC1D,oDAAuD;AACvD,iDAAiE;AAIjE;;;;;;;;GAQG;AACH,SAAgB,GAAG,CAAC,SAA0B;IAC5C,MAAM,UAAU,GAAG,wBAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC7C,OAAO,IAAA,eAAO,EACZ,mCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,QAAQ,UAAU,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,CACvE,CACF,CAAC;AACJ,CAAC;AAID;;;;;;;;;GASG;AACH,SAAgB,GAAG,CAAC,GAAoB,EAAE,GAAoB;IAC5D,MAAM,IAAI,GAAG,wBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,wBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,IAAA,eAAO,EACZ,mCAAmB,CAAC,IAAI,CACtB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACpB,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,QAAQ,KAAK,CAAC,MAAM,CAAC;QACrD,KAAK;QACL,MAAM;KACP,CAAC,GAAG,CACR,CACF,CAAC;AACJ,CAAC;AAID;;;;;;;;;GASG;AACH,SAAgB,EAAE,CAAC,GAAoB,EAAE,GAAoB;IAC3D,MAAM,IAAI,GAAG,wBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,wBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,IAAA,eAAO,EACZ,mCAAmB,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,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConditionOperand = void 0;
4
+ const operand_js_1 = require("../operands/operand.js");
5
+ const size_js_1 = require("../operands/size.js");
6
+ // TODO: internal
7
+ exports.ConditionOperand = {
8
+ normalize(raw) {
9
+ if ((0, size_js_1.isSize)(raw)) {
10
+ return raw;
11
+ }
12
+ return (0, operand_js_1.operand)(raw);
13
+ },
14
+ };
15
+ //# sourceMappingURL=operand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operand.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/condition/operand.ts"],"names":[],"mappings":";;;AACA,uDAAgF;AAChF,iDAAwD;AASxD,iBAAiB;AAEJ,QAAA,gBAAgB,GAAG;IAC9B,SAAS,CACP,GAA2B;QAE3B,IAAI,IAAA,gBAAM,EAAC,GAAG,CAAC,EAAE,CAAC;YAChB,OAAO,GAAG,CAAC;QACb,CAAC;QACD,OAAO,IAAA,oBAAO,EAAI,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,3 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExpressionFormatter = void 0;
4
+ exports.ExpressionFormatter = {
5
+ from(formatter) {
6
+ return {
7
+ format: formatter,
8
+ };
9
+ },
10
+ };
3
11
  //# 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,QAAA,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,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.attributeExists = attributeExists;
4
+ const types_1 = require("@infra-blocks/types");
5
+ const expression_js_1 = require("../expression.js");
6
+ const path_js_1 = require("../operands/path.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 An {@link AttributeExists} 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
+ function attributeExists(rawPath) {
16
+ const path = path_js_1.Path.normalize(rawPath);
17
+ return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names }) => `attribute_exists(${path.substitute({ names })})`));
18
+ }
19
+ //# 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":";;AAcA,0CAOC;AArBD,+CAA0D;AAC1D,oDAAuD;AACvD,iDAAyD;AAIzD;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,OAAgB;IAC9C,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,IAAA,eAAO,EACZ,mCAAmB,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,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.attributeNotExists = attributeNotExists;
4
+ const types_1 = require("@infra-blocks/types");
5
+ const expression_js_1 = require("../expression.js");
6
+ const path_js_1 = require("../operands/path.js");
7
+ /**
8
+ * Returns a condition that uses the `attribute_not_exists` function.
9
+ *
10
+ * @param rawPath - The attribute path to check for non-existence.
11
+ * @returns An {@link AttributeNotExists} that evaluates to true if the provided attribute path does not exist.
12
+ *
13
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
14
+ */
15
+ function attributeNotExists(rawPath) {
16
+ const path = path_js_1.Path.normalize(rawPath);
17
+ return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names }) => `attribute_not_exists(${path.substitute({ names })})`));
18
+ }
19
+ //# 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":";;AAeA,gDAOC;AAtBD,+CAA0D;AAC1D,oDAAuD;AACvD,iDAAyD;AAKzD;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,OAAgB;IACjD,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,IAAA,eAAO,EACZ,mCAAmB,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,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.attributeType = attributeType;
4
+ const types_1 = require("@infra-blocks/types");
5
+ const expression_js_1 = require("../expression.js");
6
+ const path_js_1 = require("../operands/path.js");
7
+ const value_js_1 = require("../operands/value.js");
8
+ /**
9
+ * Returns a condition that uses the `attribute_type` function.
10
+ *
11
+ * @param attribute - The attribute path to check.
12
+ * @param rawType - The expected type of the attribute.
13
+ *
14
+ * @returns An {@link IsAttributeOfType} that evaluates to true if the attribute is of the expected type.
15
+ *
16
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
17
+ */
18
+ function attributeType(attribute, rawType) {
19
+ const path = path_js_1.Path.normalize(attribute);
20
+ const type = value_js_1.Value.normalize(rawType);
21
+ return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names, values }) => `attribute_type(${path.substitute({ names })}, ${type.substitute({ values })})`));
22
+ }
23
+ //# 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":";;AAoBA,sCAYC;AAhCD,+CAA0D;AAE1D,oDAAuD;AACvD,iDAAyD;AACzD,mDAA4D;AAM5D;;;;;;;;;GASG;AACH,SAAgB,aAAa,CAC3B,SAAkB,EAClB,OAAgC;IAEhC,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,gBAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACtC,OAAO,IAAA,eAAO,EACZ,mCAAmB,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,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.beginsWith = beginsWith;
4
+ const types_1 = require("@infra-blocks/types");
5
+ const expression_js_1 = require("../expression.js");
6
+ const operand_js_1 = require("../operands/operand.js");
7
+ /**
8
+ * Returns a condition that uses the `begins_with` function.
9
+ *
10
+ * @param first - The first function operand, which is the path or value to check.
11
+ * @param second - The second function operand, which is the prefix to validate against.
12
+ *
13
+ * @returns A {@link BeginsWith} that evaluates to true if the first operand begins with the second.
14
+ *
15
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
16
+ */
17
+ function beginsWith(first, second) {
18
+ const firstOperand = (0, operand_js_1.operand)(first);
19
+ const secondOperand = (0, operand_js_1.operand)(second);
20
+ return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names, values }) => `begins_with(${firstOperand.substitute({ names, values })}, ${secondOperand.substitute({ names, values })})`));
21
+ }
22
+ //# 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":";;AAwBA,gCAaC;AArCD,+CAA0D;AAE1D,oDAAuD;AACvD,uDAAkE;AAWlE;;;;;;;;;GASG;AACH,SAAgB,UAAU,CACxB,KAAwB,EACxB,MAAyB;IAEzB,MAAM,YAAY,GAAG,IAAA,oBAAO,EAAiB,KAAK,CAAC,CAAC;IACpD,MAAM,aAAa,GAAG,IAAA,oBAAO,EAAiB,MAAM,CAAC,CAAC;IAEtD,OAAO,IAAA,eAAO,EACZ,mCAAmB,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,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.contains = contains;
4
+ const types_1 = require("@infra-blocks/types");
5
+ const expression_js_1 = require("../expression.js");
6
+ const operand_js_1 = require("../operands/operand.js");
7
+ const size_js_1 = require("../operands/size.js");
8
+ /**
9
+ * Returns a condition that uses the `contains` function.
10
+ *
11
+ * @param first - The first function operand, which is the path or value to check.
12
+ * @param second - The second function operand, which is the value to check for containment.
13
+ *
14
+ * @returns A {@link ConditionExpressionFormatter} that evaluates to true if this operand contains the provided one.
15
+ *
16
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
17
+ */
18
+ function contains(first, second) {
19
+ const firstOperand = (0, operand_js_1.operand)(first);
20
+ const secondOperand = (0, size_js_1.isSize)(second) ? second : (0, operand_js_1.operand)(second);
21
+ return (0, types_1.trusted)(expression_js_1.ExpressionFormatter.from(({ names, values }) => `contains(${firstOperand.substitute({ names, values })}, ${secondOperand.substitute({ names, values })})`));
22
+ }
23
+ //# sourceMappingURL=contains.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contains.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/contains.ts"],"names":[],"mappings":";;AAiBA,4BAaC;AA9BD,+CAA0D;AAC1D,oDAAuD;AACvD,uDAAkE;AAClE,iDAAwD;AAIxD;;;;;;;;;GASG;AACH,SAAgB,QAAQ,CACtB,KAAiB,EACjB,MAAyB;IAEzB,MAAM,YAAY,GAAG,IAAA,oBAAO,EAAC,KAAK,CAAC,CAAC;IACpC,MAAM,aAAa,GAAG,IAAA,gBAAM,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAA,oBAAO,EAAC,MAAM,CAAC,CAAC;IAEhE,OAAO,IAAA,eAAO,EACZ,mCAAmB,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,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./attribute-exists.js"), exports);
18
+ __exportStar(require("./attribute-not-exists.js"), exports);
19
+ __exportStar(require("./attribute-type.js"), exports);
20
+ __exportStar(require("./begins-with.js"), exports);
21
+ __exportStar(require("./contains.js"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/functions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,4DAA0C;AAC1C,sDAAoC;AACpC,mDAAiC;AACjC,gDAA8B"}
@@ -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";
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./condition/index.js"), exports);
18
+ __exportStar(require("./functions/index.js"), exports);
18
19
  __exportStar(require("./key-condition.js"), exports);
19
20
  __exportStar(require("./operands/index.js"), exports);
20
21
  __exportStar(require("./projection.js"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/expressions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,qDAAmC;AACnC,sDAAoC;AACpC,kDAAgC;AAChC,oDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/expressions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,uDAAqC;AACrC,qDAAmC;AACnC,sDAAoC;AACpC,kDAAgC;AAChC,oDAAkC"}
@@ -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,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.value = exports.Value = exports.path = exports.Path = exports.literal = exports.operand = void 0;
3
+ exports.value = exports.Value = exports.size = exports.path = exports.Path = exports.literal = exports.operand = void 0;
4
4
  var operand_js_1 = require("./operand.js");
5
5
  Object.defineProperty(exports, "operand", { enumerable: true, get: function () { return operand_js_1.operand; } });
6
6
  var path_js_1 = require("./path.js");
7
7
  Object.defineProperty(exports, "literal", { enumerable: true, get: function () { return path_js_1.literal; } });
8
8
  Object.defineProperty(exports, "Path", { enumerable: true, get: function () { return path_js_1.Path; } });
9
9
  Object.defineProperty(exports, "path", { enumerable: true, get: function () { return path_js_1.path; } });
10
+ var size_js_1 = require("./size.js");
11
+ Object.defineProperty(exports, "size", { enumerable: true, get: function () { return size_js_1.size; } });
10
12
  var value_js_1 = require("./value.js");
11
13
  Object.defineProperty(exports, "Value", { enumerable: true, get: function () { return value_js_1.Value; } });
12
14
  Object.defineProperty(exports, "value", { enumerable: true, get: function () { return value_js_1.value; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/index.ts"],"names":[],"mappings":";;;AAAA,2CAKsB;AAFpB,qGAAA,OAAO,OAAA;AAGT,qCAMmB;AAJjB,kGAAA,OAAO,OAAA;AACP,+FAAA,IAAI,OAAA;AACJ,+FAAA,IAAI,OAAA;AAGN,uCAKoB;AAFlB,iGAAA,KAAK,OAAA;AACL,iGAAA,KAAK,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/index.ts"],"names":[],"mappings":";;;AAAA,2CAKsB;AAFpB,qGAAA,OAAO,OAAA;AAGT,qCAMmB;AAJjB,kGAAA,OAAO,OAAA;AACP,+FAAA,IAAI,OAAA;AACJ,+FAAA,IAAI,OAAA;AAGN,qCAKmB;AADjB,+FAAA,IAAI,OAAA;AAEN,uCAKoB;AAFlB,iGAAA,KAAK,OAAA;AACL,iGAAA,KAAK,OAAA"}