dynamo-document-builder 0.6.0 → 0.6.1

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 (284) hide show
  1. package/README.md +270 -0
  2. package/dist/attributes/attribute-map.cjs +52 -0
  3. package/dist/attributes/attribute-map.cjs.map +1 -1
  4. package/dist/attributes/attribute-map.d.ts +67 -0
  5. package/dist/attributes/attribute-map.mjs +52 -0
  6. package/dist/attributes/attribute-map.mjs.map +1 -1
  7. package/dist/commands/batch-get.cjs +36 -0
  8. package/dist/commands/batch-get.cjs.map +1 -1
  9. package/dist/commands/batch-get.d.ts +48 -2
  10. package/dist/commands/batch-get.mjs +36 -0
  11. package/dist/commands/batch-get.mjs.map +1 -1
  12. package/dist/commands/batch-projected-get.cjs +42 -0
  13. package/dist/commands/batch-projected-get.cjs.map +1 -1
  14. package/dist/commands/batch-projected-get.d.ts +56 -3
  15. package/dist/commands/batch-projected-get.mjs +42 -0
  16. package/dist/commands/batch-projected-get.mjs.map +1 -1
  17. package/dist/commands/batch-write.cjs +38 -0
  18. package/dist/commands/batch-write.cjs.map +1 -1
  19. package/dist/commands/batch-write.d.ts +51 -3
  20. package/dist/commands/batch-write.mjs +38 -0
  21. package/dist/commands/batch-write.mjs.map +1 -1
  22. package/dist/commands/condition-check.cjs +37 -0
  23. package/dist/commands/condition-check.cjs.map +1 -1
  24. package/dist/commands/condition-check.d.ts +45 -3
  25. package/dist/commands/condition-check.mjs +37 -0
  26. package/dist/commands/condition-check.mjs.map +1 -1
  27. package/dist/commands/conditional-delete.cjs +33 -0
  28. package/dist/commands/conditional-delete.cjs.map +1 -1
  29. package/dist/commands/conditional-delete.d.ts +46 -3
  30. package/dist/commands/conditional-delete.mjs +33 -0
  31. package/dist/commands/conditional-delete.mjs.map +1 -1
  32. package/dist/commands/conditional-put.cjs +34 -0
  33. package/dist/commands/conditional-put.cjs.map +1 -1
  34. package/dist/commands/conditional-put.d.ts +48 -4
  35. package/dist/commands/conditional-put.mjs +34 -0
  36. package/dist/commands/conditional-put.mjs.map +1 -1
  37. package/dist/commands/conditional-update.cjs +35 -0
  38. package/dist/commands/conditional-update.cjs.map +1 -1
  39. package/dist/commands/conditional-update.d.ts +48 -3
  40. package/dist/commands/conditional-update.mjs +35 -0
  41. package/dist/commands/conditional-update.mjs.map +1 -1
  42. package/dist/commands/delete.cjs +32 -0
  43. package/dist/commands/delete.cjs.map +1 -1
  44. package/dist/commands/delete.d.ts +44 -2
  45. package/dist/commands/delete.mjs +32 -0
  46. package/dist/commands/delete.mjs.map +1 -1
  47. package/dist/commands/get.cjs +33 -0
  48. package/dist/commands/get.cjs.map +1 -1
  49. package/dist/commands/get.d.ts +45 -2
  50. package/dist/commands/get.mjs +33 -0
  51. package/dist/commands/get.mjs.map +1 -1
  52. package/dist/commands/index.d.ts +62 -1
  53. package/dist/commands/projected-get.cjs +40 -0
  54. package/dist/commands/projected-get.cjs.map +1 -1
  55. package/dist/commands/projected-get.d.ts +54 -3
  56. package/dist/commands/projected-get.mjs +40 -0
  57. package/dist/commands/projected-get.mjs.map +1 -1
  58. package/dist/commands/projected-query.cjs +41 -0
  59. package/dist/commands/projected-query.cjs.map +1 -1
  60. package/dist/commands/projected-query.d.ts +56 -3
  61. package/dist/commands/projected-query.mjs +41 -0
  62. package/dist/commands/projected-query.mjs.map +1 -1
  63. package/dist/commands/projected-scan.cjs +41 -0
  64. package/dist/commands/projected-scan.cjs.map +1 -1
  65. package/dist/commands/projected-scan.d.ts +55 -3
  66. package/dist/commands/projected-scan.mjs +41 -0
  67. package/dist/commands/projected-scan.mjs.map +1 -1
  68. package/dist/commands/put.cjs +37 -0
  69. package/dist/commands/put.cjs.map +1 -1
  70. package/dist/commands/put.d.ts +50 -3
  71. package/dist/commands/put.mjs +37 -0
  72. package/dist/commands/put.mjs.map +1 -1
  73. package/dist/commands/query.cjs +36 -1
  74. package/dist/commands/query.cjs.map +1 -1
  75. package/dist/commands/query.d.ts +48 -3
  76. package/dist/commands/query.mjs +36 -1
  77. package/dist/commands/query.mjs.map +1 -1
  78. package/dist/commands/scan.cjs +33 -0
  79. package/dist/commands/scan.cjs.map +1 -1
  80. package/dist/commands/scan.d.ts +46 -3
  81. package/dist/commands/scan.mjs +33 -0
  82. package/dist/commands/scan.mjs.map +1 -1
  83. package/dist/commands/transact-get.cjs +35 -0
  84. package/dist/commands/transact-get.cjs.map +1 -1
  85. package/dist/commands/transact-get.d.ts +47 -2
  86. package/dist/commands/transact-get.mjs +35 -0
  87. package/dist/commands/transact-get.mjs.map +1 -1
  88. package/dist/commands/transact-write.cjs +37 -0
  89. package/dist/commands/transact-write.cjs.map +1 -1
  90. package/dist/commands/transact-write.d.ts +46 -1
  91. package/dist/commands/transact-write.mjs +37 -0
  92. package/dist/commands/transact-write.mjs.map +1 -1
  93. package/dist/commands/update.cjs +37 -0
  94. package/dist/commands/update.cjs.map +1 -1
  95. package/dist/commands/update.d.ts +50 -3
  96. package/dist/commands/update.mjs +37 -0
  97. package/dist/commands/update.mjs.map +1 -1
  98. package/dist/conditions/and.cjs +3 -0
  99. package/dist/conditions/and.cjs.map +1 -1
  100. package/dist/conditions/and.d.ts +4 -1
  101. package/dist/conditions/and.mjs +3 -0
  102. package/dist/conditions/and.mjs.map +1 -1
  103. package/dist/conditions/begins-with.cjs +3 -0
  104. package/dist/conditions/begins-with.cjs.map +1 -1
  105. package/dist/conditions/begins-with.d.ts +4 -1
  106. package/dist/conditions/begins-with.mjs +3 -0
  107. package/dist/conditions/begins-with.mjs.map +1 -1
  108. package/dist/conditions/between.cjs +3 -0
  109. package/dist/conditions/between.cjs.map +1 -1
  110. package/dist/conditions/between.d.ts +4 -1
  111. package/dist/conditions/between.mjs +3 -0
  112. package/dist/conditions/between.mjs.map +1 -1
  113. package/dist/conditions/condition-parser.d.ts +1 -1
  114. package/dist/conditions/contains.cjs +3 -0
  115. package/dist/conditions/contains.cjs.map +1 -1
  116. package/dist/conditions/contains.d.ts +4 -1
  117. package/dist/conditions/contains.mjs +3 -0
  118. package/dist/conditions/contains.mjs.map +1 -1
  119. package/dist/conditions/equals.cjs +3 -0
  120. package/dist/conditions/equals.cjs.map +1 -1
  121. package/dist/conditions/equals.d.ts +4 -1
  122. package/dist/conditions/equals.mjs +3 -0
  123. package/dist/conditions/equals.mjs.map +1 -1
  124. package/dist/conditions/exists.cjs +3 -0
  125. package/dist/conditions/exists.cjs.map +1 -1
  126. package/dist/conditions/exists.d.ts +4 -1
  127. package/dist/conditions/exists.mjs +3 -0
  128. package/dist/conditions/exists.mjs.map +1 -1
  129. package/dist/conditions/greater-than-or-equal.cjs +3 -0
  130. package/dist/conditions/greater-than-or-equal.cjs.map +1 -1
  131. package/dist/conditions/greater-than-or-equal.d.ts +4 -1
  132. package/dist/conditions/greater-than-or-equal.mjs +3 -0
  133. package/dist/conditions/greater-than-or-equal.mjs.map +1 -1
  134. package/dist/conditions/greater-than.cjs +3 -0
  135. package/dist/conditions/greater-than.cjs.map +1 -1
  136. package/dist/conditions/greater-than.d.ts +4 -1
  137. package/dist/conditions/greater-than.mjs +3 -0
  138. package/dist/conditions/greater-than.mjs.map +1 -1
  139. package/dist/conditions/index.cjs +2 -2
  140. package/dist/conditions/index.d.ts +185 -2
  141. package/dist/conditions/index.mjs +1 -1
  142. package/dist/conditions/is-in.cjs +3 -0
  143. package/dist/conditions/is-in.cjs.map +1 -1
  144. package/dist/conditions/is-in.d.ts +4 -1
  145. package/dist/conditions/is-in.mjs +3 -0
  146. package/dist/conditions/is-in.mjs.map +1 -1
  147. package/dist/conditions/less-than-or-equal.cjs +3 -0
  148. package/dist/conditions/less-than-or-equal.cjs.map +1 -1
  149. package/dist/conditions/less-than-or-equal.d.ts +4 -1
  150. package/dist/conditions/less-than-or-equal.mjs +3 -0
  151. package/dist/conditions/less-than-or-equal.mjs.map +1 -1
  152. package/dist/conditions/less-than.cjs +3 -0
  153. package/dist/conditions/less-than.cjs.map +1 -1
  154. package/dist/conditions/less-than.d.ts +4 -1
  155. package/dist/conditions/less-than.mjs +3 -0
  156. package/dist/conditions/less-than.mjs.map +1 -1
  157. package/dist/conditions/not-equals.cjs +3 -0
  158. package/dist/conditions/not-equals.cjs.map +1 -1
  159. package/dist/conditions/not-equals.d.ts +4 -1
  160. package/dist/conditions/not-equals.mjs +3 -0
  161. package/dist/conditions/not-equals.mjs.map +1 -1
  162. package/dist/conditions/not-exists.cjs +3 -0
  163. package/dist/conditions/not-exists.cjs.map +1 -1
  164. package/dist/conditions/not-exists.d.ts +4 -1
  165. package/dist/conditions/not-exists.mjs +3 -0
  166. package/dist/conditions/not-exists.mjs.map +1 -1
  167. package/dist/conditions/not.cjs +3 -0
  168. package/dist/conditions/not.cjs.map +1 -1
  169. package/dist/conditions/not.d.ts +4 -1
  170. package/dist/conditions/not.mjs +3 -0
  171. package/dist/conditions/not.mjs.map +1 -1
  172. package/dist/conditions/or.cjs +3 -0
  173. package/dist/conditions/or.cjs.map +1 -1
  174. package/dist/conditions/or.d.ts +4 -1
  175. package/dist/conditions/or.mjs +3 -0
  176. package/dist/conditions/or.mjs.map +1 -1
  177. package/dist/conditions/size.cjs +3 -0
  178. package/dist/conditions/size.cjs.map +1 -1
  179. package/dist/conditions/size.d.ts +4 -1
  180. package/dist/conditions/size.mjs +3 -0
  181. package/dist/conditions/size.mjs.map +1 -1
  182. package/dist/conditions/type-is.cjs +3 -0
  183. package/dist/conditions/type-is.cjs.map +1 -1
  184. package/dist/conditions/type-is.d.ts +4 -1
  185. package/dist/conditions/type-is.mjs +3 -0
  186. package/dist/conditions/type-is.mjs.map +1 -1
  187. package/dist/core/entity.cjs +57 -0
  188. package/dist/core/entity.cjs.map +1 -1
  189. package/dist/core/entity.d.ts +79 -4
  190. package/dist/core/entity.mjs +57 -0
  191. package/dist/core/entity.mjs.map +1 -1
  192. package/dist/core/index.d.ts +139 -2
  193. package/dist/core/key.cjs +1 -1
  194. package/dist/core/key.cjs.map +1 -1
  195. package/dist/core/key.d.ts +26 -2
  196. package/dist/core/key.mjs +1 -1
  197. package/dist/core/key.mjs.map +1 -1
  198. package/dist/core/table.cjs +22 -0
  199. package/dist/core/table.cjs.map +1 -1
  200. package/dist/core/table.d.ts +35 -1
  201. package/dist/core/table.mjs +22 -0
  202. package/dist/core/table.mjs.map +1 -1
  203. package/dist/errors.cjs +3 -0
  204. package/dist/errors.cjs.map +1 -1
  205. package/dist/errors.d.ts +3 -0
  206. package/dist/errors.mjs +3 -0
  207. package/dist/errors.mjs.map +1 -1
  208. package/dist/index.cjs +4 -4
  209. package/dist/index.d.ts +7 -7
  210. package/dist/index.mjs +2 -2
  211. package/dist/projections/index.d.ts +7 -1
  212. package/dist/projections/projection-parser.d.ts +1 -1
  213. package/dist/updates/add-to-set.cjs +5 -0
  214. package/dist/updates/add-to-set.cjs.map +1 -1
  215. package/dist/updates/add-to-set.d.ts +6 -1
  216. package/dist/updates/add-to-set.mjs +5 -0
  217. package/dist/updates/add-to-set.mjs.map +1 -1
  218. package/dist/updates/add.cjs +5 -0
  219. package/dist/updates/add.cjs.map +1 -1
  220. package/dist/updates/add.d.ts +6 -1
  221. package/dist/updates/add.mjs +5 -0
  222. package/dist/updates/add.mjs.map +1 -1
  223. package/dist/updates/append.cjs +5 -0
  224. package/dist/updates/append.cjs.map +1 -1
  225. package/dist/updates/append.d.ts +6 -1
  226. package/dist/updates/append.mjs +5 -0
  227. package/dist/updates/append.mjs.map +1 -1
  228. package/dist/updates/index.d.ts +78 -1
  229. package/dist/updates/prepend.cjs +5 -0
  230. package/dist/updates/prepend.cjs.map +1 -1
  231. package/dist/updates/prepend.d.ts +6 -1
  232. package/dist/updates/prepend.mjs +5 -0
  233. package/dist/updates/prepend.mjs.map +1 -1
  234. package/dist/updates/ref.cjs +6 -0
  235. package/dist/updates/ref.cjs.map +1 -1
  236. package/dist/updates/ref.d.ts +7 -1
  237. package/dist/updates/ref.mjs +6 -0
  238. package/dist/updates/ref.mjs.map +1 -1
  239. package/dist/updates/remove-from-set.cjs +5 -0
  240. package/dist/updates/remove-from-set.cjs.map +1 -1
  241. package/dist/updates/remove-from-set.d.ts +6 -1
  242. package/dist/updates/remove-from-set.mjs +5 -0
  243. package/dist/updates/remove-from-set.mjs.map +1 -1
  244. package/dist/updates/remove.cjs +3 -0
  245. package/dist/updates/remove.cjs.map +1 -1
  246. package/dist/updates/remove.d.ts +4 -1
  247. package/dist/updates/remove.mjs +3 -0
  248. package/dist/updates/remove.mjs.map +1 -1
  249. package/dist/updates/subtract.cjs +5 -0
  250. package/dist/updates/subtract.cjs.map +1 -1
  251. package/dist/updates/subtract.d.ts +6 -1
  252. package/dist/updates/subtract.mjs +5 -0
  253. package/dist/updates/subtract.mjs.map +1 -1
  254. package/dist/updates/update-parser.cjs +10 -0
  255. package/dist/updates/update-parser.cjs.map +1 -1
  256. package/dist/updates/update-parser.d.ts +17 -1
  257. package/dist/updates/update-parser.mjs +10 -0
  258. package/dist/updates/update-parser.mjs.map +1 -1
  259. package/package.json +2 -1
  260. package/dist/commands/base-command.cjs +0 -3
  261. package/dist/commands/base-command.cjs.map +0 -1
  262. package/dist/commands/base-command.d.ts +0 -27
  263. package/dist/commands/base-command.mjs +0 -2
  264. package/dist/commands/base-command.mjs.map +0 -1
  265. package/dist/conditions/condition-types.cjs +0 -3
  266. package/dist/conditions/condition-types.cjs.map +0 -1
  267. package/dist/conditions/condition-types.d.ts +0 -95
  268. package/dist/conditions/condition-types.mjs +0 -2
  269. package/dist/conditions/condition-types.mjs.map +0 -1
  270. package/dist/core/core-types.cjs +0 -3
  271. package/dist/core/core-types.cjs.map +0 -1
  272. package/dist/core/core-types.d.ts +0 -44
  273. package/dist/core/core-types.mjs +0 -2
  274. package/dist/core/core-types.mjs.map +0 -1
  275. package/dist/projections/projection-types.cjs +0 -3
  276. package/dist/projections/projection-types.cjs.map +0 -1
  277. package/dist/projections/projection-types.d.ts +0 -3
  278. package/dist/projections/projection-types.mjs +0 -2
  279. package/dist/projections/projection-types.mjs.map +0 -1
  280. package/dist/updates/update-types.cjs +0 -3
  281. package/dist/updates/update-types.cjs.map +0 -1
  282. package/dist/updates/update-types.d.ts +0 -45
  283. package/dist/updates/update-types.mjs +0 -2
  284. package/dist/updates/update-types.mjs.map +0 -1
@@ -3,6 +3,9 @@
3
3
  var tslib_es6 = require('../node_modules/tslib/tslib.es6.cjs');
4
4
 
5
5
  var _DynamoTable_tableName, _DynamoTable_documentClient, _DynamoTable_pk, _DynamoTable_sk, _DynamoTable_gsi, _DynamoTable_lsi;
6
+ /**
7
+ * Core class that represents a DynamoDB table.
8
+ */
6
9
  class DynamoTable {
7
10
  constructor(config) {
8
11
  var _a, _b, _c, _d, _e, _f;
@@ -23,21 +26,40 @@ class DynamoTable {
23
26
  tslib_es6.__classPrivateFieldSet(this, _DynamoTable_gsi, (_d = (_c = config.keyNames) === null || _c === void 0 ? void 0 : _c.globalSecondaryIndexes) !== null && _d !== void 0 ? _d : {}, "f");
24
27
  tslib_es6.__classPrivateFieldSet(this, _DynamoTable_lsi, (_f = (_e = config.keyNames) === null || _e === void 0 ? void 0 : _e.localSecondaryIndexes) !== null && _f !== void 0 ? _f : {}, "f");
25
28
  }
29
+ /**
30
+ * The name of the DynamoDB table.
31
+ */
26
32
  get tableName() {
27
33
  return tslib_es6.__classPrivateFieldGet(this, _DynamoTable_tableName, "f");
28
34
  }
35
+ /**
36
+ * The DynamoDB Document Client instance used for operations.
37
+ */
29
38
  get documentClient() {
30
39
  return tslib_es6.__classPrivateFieldGet(this, _DynamoTable_documentClient, "f");
31
40
  }
41
+ /**
42
+ * The name of the partition key for the table.
43
+ */
32
44
  get partitionKeyName() {
33
45
  return tslib_es6.__classPrivateFieldGet(this, _DynamoTable_pk, "f");
34
46
  }
47
+ /**
48
+ * The name of the sort key for the table, or `null` if the table does not have a sort key
49
+ * (`null` would indicate a "simple" primary key).
50
+ */
35
51
  get sortKeyName() {
36
52
  return tslib_es6.__classPrivateFieldGet(this, _DynamoTable_sk, "f");
37
53
  }
54
+ /**
55
+ * The key names for the global secondary indexes defined on the table.
56
+ */
38
57
  get globalSecondaryIndexKeyNames() {
39
58
  return tslib_es6.__classPrivateFieldGet(this, _DynamoTable_gsi, "f");
40
59
  }
60
+ /**
61
+ * The key names for the local secondary indexes defined on the table.
62
+ */
41
63
  get localSecondaryIndexKeyNames() {
42
64
  return tslib_es6.__classPrivateFieldGet(this, _DynamoTable_lsi, "f");
43
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"table.cjs","sources":["../../src/core/table.ts"],"sourcesContent":[null],"names":["__classPrivateFieldSet","__classPrivateFieldGet"],"mappings":";;;;;MAiBa,WAAW,CAAA;AAUtB,IAAA,WAAA,CAAY,MAAyB,EAAA;;QATrC,sBAAA,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;QACA,2BAAA,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;AAEA,QAAA,eAAA,CAAA,GAAA,CAAA,IAAA,EAAc,IAAI,CAAA;AAClB,QAAA,eAAA,CAAA,GAAA,CAAA,IAAA,EAAqB,IAAI,CAAA;QAEzB,gBAAA,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;QACA,gBAAA,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;AAGE,QAAAA,gCAAA,CAAA,IAAI,EAAA,sBAAA,EAAc,MAAM,CAAC,SAAS,MAAA;AAClC,QAAAA,gCAAA,CAAA,IAAI,EAAA,2BAAA,EAAmB,MAAM,CAAC,cAAc,MAAA;QAC5C,IAAI,CAAA,CAAA,EAAA,GAAA,MAAM,CAAC,QAAQ,0CAAE,YAAY,MAAK,SAAS,EAAE;YAC/CA,gCAAA,CAAA,IAAI,mBAAO,MAAM,CAAC,QAAQ,CAAC,YAAY,MAAA;QACzC;QACA,IAAI,CAAA,CAAA,EAAA,GAAA,MAAM,CAAC,QAAQ,0CAAE,OAAO,MAAK,SAAS,EAAE;YAC1CA,gCAAA,CAAA,IAAI,mBAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,MAAA;QACpC;AACA,Q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,GAAA,CAAA,EAAA,GAAA,MAAM,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,qBAAqB,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,EAAE,EAAA,GAAA,CAAA;IAC1D;AAEA;;AAEG;AACH,IAAA,IAAW,SAAS,GAAA;QAClB,OAAOC,gCAAA,CAAA,IAAI,EAAA,sBAAA,EAAA,GAAA,CAAW;IACxB;AAEA;;AAEG;AACH,IAAA,IAAW,cAAc,GAAA;QACvB,OAAOA,gCAAA,CAAA,IAAI,EAAA,2BAAA,EAAA,GAAA,CAAgB;IAC7B;AAEA;;AAEG;AACH,IAAA,IAAW,gBAAgB,GAAA;QACzB,OAAOA,gCAAA,CAAA,IAAI,EAAA,eAAA,EAAA,GAAA,CAAI;IACjB;AAEA;;;AAGG;AACH,IAAA,IAAW,WAAW,GAAA;QACpB,OAAOA,gCAAA,CAAA,IAAI,EAAA,eAAA,EAAA,GAAA,CAAI;IACjB;AAEA;;AAEG;AACH,IAAA,IAAW,4BAA4B,GAAA;QACrC,OAAOA,gCAAA,CAAA,IAAI,EAAA,gBAAA,EAAA,GAAA,CAAK;IAClB;AAEA;;AAEG;AACH,IAAA,IAAW,2BAA2B,GAAA;QACpC,OAAOA,gCAAA,CAAA,IAAI,EAAA,gBAAA,EAAA,GAAA,CAAK;IAClB;AACD;;;;;"}
@@ -1,6 +1,18 @@
1
1
  import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
2
- import { NamedGlobalSecondaryIndexKeyNames, NamedLocalSecondaryIndexKeyNames } from './core-types.js';
2
+ import { NamedGlobalSecondaryIndexKeyNames, NamedLocalSecondaryIndexKeyNames } from './index.js';
3
3
 
4
+ /**
5
+ * Configuration type for creating a DynamoTable.
6
+ *
7
+ * The table is assumed to have a primary key composed of a partition key named `"PK"` and
8
+ * a sort key named `"SK"` by default, unless overridden in the `keyNames` property.
9
+ *
10
+ * @template Schema - The Zod schema representing the entity's structure.
11
+ *
12
+ * @property tableName - The name of the DynamoDB table.
13
+ * @property documentClient - The DynamoDB Document Client instance to use for operations.
14
+ * @property keyNames - Key names object for the table's primary key and secondary indexes.
15
+ */
4
16
  type DynamoTableConfig = {
5
17
  tableName: string;
6
18
  documentClient: DynamoDBDocumentClient;
@@ -11,14 +23,36 @@ type DynamoTableConfig = {
11
23
  localSecondaryIndexes?: NamedLocalSecondaryIndexKeyNames;
12
24
  };
13
25
  };
26
+ /**
27
+ * Core class that represents a DynamoDB table.
28
+ */
14
29
  declare class DynamoTable {
15
30
  #private;
16
31
  constructor(config: DynamoTableConfig);
32
+ /**
33
+ * The name of the DynamoDB table.
34
+ */
17
35
  get tableName(): string;
36
+ /**
37
+ * The DynamoDB Document Client instance used for operations.
38
+ */
18
39
  get documentClient(): DynamoDBDocumentClient;
40
+ /**
41
+ * The name of the partition key for the table.
42
+ */
19
43
  get partitionKeyName(): string;
44
+ /**
45
+ * The name of the sort key for the table, or `null` if the table does not have a sort key
46
+ * (`null` would indicate a "simple" primary key).
47
+ */
20
48
  get sortKeyName(): string | null;
49
+ /**
50
+ * The key names for the global secondary indexes defined on the table.
51
+ */
21
52
  get globalSecondaryIndexKeyNames(): NamedGlobalSecondaryIndexKeyNames;
53
+ /**
54
+ * The key names for the local secondary indexes defined on the table.
55
+ */
22
56
  get localSecondaryIndexKeyNames(): NamedLocalSecondaryIndexKeyNames;
23
57
  }
24
58
 
@@ -1,6 +1,9 @@
1
1
  import { __classPrivateFieldSet, __classPrivateFieldGet } from '../node_modules/tslib/tslib.es6.mjs';
2
2
 
3
3
  var _DynamoTable_tableName, _DynamoTable_documentClient, _DynamoTable_pk, _DynamoTable_sk, _DynamoTable_gsi, _DynamoTable_lsi;
4
+ /**
5
+ * Core class that represents a DynamoDB table.
6
+ */
4
7
  class DynamoTable {
5
8
  constructor(config) {
6
9
  var _a, _b, _c, _d, _e, _f;
@@ -21,21 +24,40 @@ class DynamoTable {
21
24
  __classPrivateFieldSet(this, _DynamoTable_gsi, (_d = (_c = config.keyNames) === null || _c === void 0 ? void 0 : _c.globalSecondaryIndexes) !== null && _d !== void 0 ? _d : {}, "f");
22
25
  __classPrivateFieldSet(this, _DynamoTable_lsi, (_f = (_e = config.keyNames) === null || _e === void 0 ? void 0 : _e.localSecondaryIndexes) !== null && _f !== void 0 ? _f : {}, "f");
23
26
  }
27
+ /**
28
+ * The name of the DynamoDB table.
29
+ */
24
30
  get tableName() {
25
31
  return __classPrivateFieldGet(this, _DynamoTable_tableName, "f");
26
32
  }
33
+ /**
34
+ * The DynamoDB Document Client instance used for operations.
35
+ */
27
36
  get documentClient() {
28
37
  return __classPrivateFieldGet(this, _DynamoTable_documentClient, "f");
29
38
  }
39
+ /**
40
+ * The name of the partition key for the table.
41
+ */
30
42
  get partitionKeyName() {
31
43
  return __classPrivateFieldGet(this, _DynamoTable_pk, "f");
32
44
  }
45
+ /**
46
+ * The name of the sort key for the table, or `null` if the table does not have a sort key
47
+ * (`null` would indicate a "simple" primary key).
48
+ */
33
49
  get sortKeyName() {
34
50
  return __classPrivateFieldGet(this, _DynamoTable_sk, "f");
35
51
  }
52
+ /**
53
+ * The key names for the global secondary indexes defined on the table.
54
+ */
36
55
  get globalSecondaryIndexKeyNames() {
37
56
  return __classPrivateFieldGet(this, _DynamoTable_gsi, "f");
38
57
  }
58
+ /**
59
+ * The key names for the local secondary indexes defined on the table.
60
+ */
39
61
  get localSecondaryIndexKeyNames() {
40
62
  return __classPrivateFieldGet(this, _DynamoTable_lsi, "f");
41
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"table.mjs","sources":["../../src/core/table.ts"],"sourcesContent":[null],"names":[],"mappings":";;;MAiBa,WAAW,CAAA;AAUtB,IAAA,WAAA,CAAY,MAAyB,EAAA;;QATrC,sBAAA,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;QACA,2BAAA,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;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,IAAW,WAAW,GAAA;QACpB,OAAO,sBAAA,CAAA,IAAI,EAAA,eAAA,EAAA,GAAA,CAAI;IACjB;AAEA;;AAEG;AACH,IAAA,IAAW,4BAA4B,GAAA;QACrC,OAAO,sBAAA,CAAA,IAAI,EAAA,gBAAA,EAAA,GAAA,CAAK;IAClB;AAEA;;AAEG;AACH,IAAA,IAAW,2BAA2B,GAAA;QACpC,OAAO,sBAAA,CAAA,IAAI,EAAA,gBAAA,EAAA,GAAA,CAAK;IAClB;AACD;;;;;"}
package/dist/errors.cjs CHANGED
@@ -1,5 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ /**
4
+ * Custom error class for handling Document Builder related errors.
5
+ */
3
6
  class DocumentBuilderError extends Error {
4
7
  constructor(message) {
5
8
  super(`DocumentBuilderError: ${message}`);
@@ -1 +1 @@
1
- {"version":3,"file":"errors.cjs","sources":["../src/errors.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAM,MAAO,oBAAqB,SAAQ,KAAK,CAAA;AAC7C,IAAA,WAAA,CAAY,OAAe,EAAA;AACzB,QAAA,KAAK,CAAC,CAAA,sBAAA,EAAyB,OAAO,CAAA,CAAE,CAAC;AACzC,QAAA,IAAI,CAAC,IAAI,GAAG,sBAAsB;AAClC,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;IACxB;AACD;;;;"}
1
+ {"version":3,"file":"errors.cjs","sources":["../src/errors.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;AAEG;AACG,MAAO,oBAAqB,SAAQ,KAAK,CAAA;AAC7C,IAAA,WAAA,CAAY,OAAe,EAAA;AACzB,QAAA,KAAK,CAAC,CAAA,sBAAA,EAAyB,OAAO,CAAA,CAAE,CAAC;AACzC,QAAA,IAAI,CAAC,IAAI,GAAG,sBAAsB;AAClC,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;IACxB;AACD;;;;"}
package/dist/errors.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Custom error class for handling Document Builder related errors.
3
+ */
1
4
  declare class DocumentBuilderError extends Error {
2
5
  constructor(message: string);
3
6
  }
package/dist/errors.mjs CHANGED
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Custom error class for handling Document Builder related errors.
3
+ */
1
4
  class DocumentBuilderError extends Error {
2
5
  constructor(message) {
3
6
  super(`DocumentBuilderError: ${message}`);
@@ -1 +1 @@
1
- {"version":3,"file":"errors.mjs","sources":["../src/errors.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAM,MAAO,oBAAqB,SAAQ,KAAK,CAAA;AAC7C,IAAA,WAAA,CAAY,OAAe,EAAA;AACzB,QAAA,KAAK,CAAC,CAAA,sBAAA,EAAyB,OAAO,CAAA,CAAE,CAAC;AACzC,QAAA,IAAI,CAAC,IAAI,GAAG,sBAAsB;AAClC,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;IACxB;AACD;;;;"}
1
+ {"version":3,"file":"errors.mjs","sources":["../src/errors.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;AAEG;AACG,MAAO,oBAAqB,SAAQ,KAAK,CAAA;AAC7C,IAAA,WAAA,CAAY,OAAe,EAAA;AACzB,QAAA,KAAK,CAAC,CAAA,sBAAA,EAAyB,OAAO,CAAA,CAAE,CAAC;AACzC,QAAA,IAAI,CAAC,IAAI,GAAG,sBAAsB;AAClC,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;IACxB;AACD;;;;"}
package/dist/index.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var attributes_attributeMap = require('./attributes/attribute-map.cjs');
4
+ var errors = require('./errors.cjs');
4
5
  var commands_get = require('./commands/get.cjs');
5
6
  var commands_query = require('./commands/query.cjs');
6
7
  var commands_scan = require('./commands/scan.cjs');
@@ -19,10 +20,10 @@ var commands_conditionalDelete = require('./commands/conditional-delete.cjs');
19
20
  var commands_batchWrite = require('./commands/batch-write.cjs');
20
21
  var commands_transactWrite = require('./commands/transact-write.cjs');
21
22
  var commands_conditionCheck = require('./commands/condition-check.cjs');
23
+ var conditions_conditionParser = require('./conditions/condition-parser.cjs');
22
24
  var conditions_and = require('./conditions/and.cjs');
23
25
  var conditions_beginsWith = require('./conditions/begins-with.cjs');
24
26
  var conditions_between = require('./conditions/between.cjs');
25
- var conditions_conditionParser = require('./conditions/condition-parser.cjs');
26
27
  var conditions_contains = require('./conditions/contains.cjs');
27
28
  var conditions_equals = require('./conditions/equals.cjs');
28
29
  var conditions_exists = require('./conditions/exists.cjs');
@@ -40,7 +41,6 @@ var conditions_typeIs = require('./conditions/type-is.cjs');
40
41
  var core_entity = require('./core/entity.cjs');
41
42
  var core_key = require('./core/key.cjs');
42
43
  var core_table = require('./core/table.cjs');
43
- var errors = require('./errors.cjs');
44
44
  var projections_projectionParser = require('./projections/projection-parser.cjs');
45
45
  var updates_updateParser = require('./updates/update-parser.cjs');
46
46
  var updates_ref = require('./updates/ref.cjs');
@@ -55,6 +55,7 @@ var updates_removeFromSet = require('./updates/remove-from-set.cjs');
55
55
 
56
56
 
57
57
  exports.AttributeExpressionMap = attributes_attributeMap.AttributeExpressionMap;
58
+ exports.DocumentBuilderError = errors.DocumentBuilderError;
58
59
  exports.Get = commands_get.Get;
59
60
  exports.Query = commands_query.Query;
60
61
  exports.Scan = commands_scan.Scan;
@@ -73,10 +74,10 @@ exports.ConditionalDelete = commands_conditionalDelete.ConditionalDelete;
73
74
  exports.BatchWrite = commands_batchWrite.BatchWrite;
74
75
  exports.TransactWrite = commands_transactWrite.TransactWrite;
75
76
  exports.ConditionCheck = commands_conditionCheck.ConditionCheck;
77
+ exports.parseCondition = conditions_conditionParser.parseCondition;
76
78
  exports.and = conditions_and.and;
77
79
  exports.beginsWith = conditions_beginsWith.beginsWith;
78
80
  exports.between = conditions_between.between;
79
- exports.parseCondition = conditions_conditionParser.parseCondition;
80
81
  exports.contains = conditions_contains.contains;
81
82
  exports.equals = conditions_equals.equals;
82
83
  exports.exists = conditions_exists.exists;
@@ -95,7 +96,6 @@ exports.DynamoEntity = core_entity.DynamoEntity;
95
96
  exports.indexKey = core_key.indexKey;
96
97
  exports.key = core_key.key;
97
98
  exports.DynamoTable = core_table.DynamoTable;
98
- exports.DocumentBuilderError = errors.DocumentBuilderError;
99
99
  exports.parseProjection = projections_projectionParser.parseProjection;
100
100
  exports.parseUpdate = updates_updateParser.parseUpdate;
101
101
  exports.ref = updates_ref.ref;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  export { AttributeExpressionMap, AttributeNamePlaceholder, AttributeNames, AttributeValuePlaceholder, AttributeValues, DynamoAttributeExpression } from './attributes/attribute-map.js';
2
- export { BaseCommand, BaseConfig, BasePaginatable, BaseResult, WriteTransactable } from './commands/base-command.js';
2
+ export { BaseCommand, BaseConfig, BasePaginatable, BaseResult, WriteTransactable } from './commands/index.js';
3
+ export { BeginsWithExpression, BeginsWithExpressionTemplate, BetweenExpression, BetweenExpressionTemplate, BooleanExpression, ComparisonExpression, ComparisonExpressionTemplate, ComparisonOperator, Condition, ConditionExpression, ConditionExpressionTemplate, ConditionTemplate, ContainsExpression, ContainsExpressionTemplate, DynamoAttributeType, ExistsExpression, ExistsExpressionTemplate, FunctionExpression, InExpression, InExpressionTemplate, LogicalExpression, LogicalOperator, NotExpression, Operand, SizeConditionExpression, SizeConditionExpressionTemplate, SizeExpression, TemplateExpression, TypeCheckExpression, TypeCheckExpressionTemplate, ValueExpression } from './conditions/index.js';
4
+ export { EncodedEntity, EncodedEntitySchema, Entity, EntitySchema, GlobalSecondaryIndexKeyName, IndexName, LocalSecondaryIndexKeyName, NamedGlobalSecondaryIndexKeyNames, NamedLocalSecondaryIndexKeyNames, TransactWriteOperation } from './core/index.js';
5
+ export { DocumentBuilderError } from './errors.js';
6
+ export { Projection } from './projections/index.js';
7
+ export { AddExpression, AddToSetExpression, AppendExpression, DeleteExpression, PrependExpression, RemoveExpression, SubtractExpression, UpdateExpression, UpdateType, UpdateValues, ValueReference } from './updates/index.js';
3
8
  export { Get, GetConfig, GetResult } from './commands/get.js';
4
9
  export { Query, QueryConfig, QueryResult } from './commands/query.js';
5
10
  export { Scan, ScanConfig, ScanResult } from './commands/scan.js';
@@ -18,11 +23,10 @@ export { ConditionalDelete, ConditionalDeleteConfig, ConditionalDeleteResult } f
18
23
  export { BatchWrite, BatchWriteConfig, BatchWriteResult } from './commands/batch-write.js';
19
24
  export { TransactWrite, TransactWriteConfig, TransactWriteResult } from './commands/transact-write.js';
20
25
  export { ConditionCheck, ConditionCheckConfig } from './commands/condition-check.js';
26
+ export { ConditionParserResult, parseCondition } from './conditions/condition-parser.js';
21
27
  export { and } from './conditions/and.js';
22
28
  export { beginsWith } from './conditions/begins-with.js';
23
29
  export { between } from './conditions/between.js';
24
- export { ConditionParserResult, parseCondition } from './conditions/condition-parser.js';
25
- export { BeginsWithExpression, BeginsWithExpressionTemplate, BetweenExpression, BetweenExpressionTemplate, BooleanExpression, ComparisonExpression, ComparisonExpressionTemplate, ComparisonOperator, Condition, ConditionExpression, ConditionExpressionTemplate, ConditionTemplate, ContainsExpression, ContainsExpressionTemplate, DynamoAttributeType, ExistsExpression, ExistsExpressionTemplate, FunctionExpression, InExpression, InExpressionTemplate, LogicalExpression, LogicalOperator, NotExpression, Operand, SizeConditionExpression, SizeConditionExpressionTemplate, SizeExpression, TemplateExpression, TypeCheckExpression, TypeCheckExpressionTemplate, ValueExpression } from './conditions/condition-types.js';
26
30
  export { contains } from './conditions/contains.js';
27
31
  export { equals } from './conditions/equals.js';
28
32
  export { exists } from './conditions/exists.js';
@@ -37,15 +41,11 @@ export { notExists } from './conditions/not-exists.js';
37
41
  export { or } from './conditions/or.js';
38
42
  export { size } from './conditions/size.js';
39
43
  export { typeIs } from './conditions/type-is.js';
40
- export { EncodedEntity, EncodedEntitySchema, Entity, EntitySchema, GlobalSecondaryIndexKeyName, IndexName, LocalSecondaryIndexKeyName, NamedGlobalSecondaryIndexKeyNames, NamedLocalSecondaryIndexKeyNames, TransactWriteOperation } from './core/core-types.js';
41
44
  export { DynamoEntity, DynamoEntityConfig, EntityKeyInput } from './core/entity.js';
42
45
  export { DynamoIndexKey, DynamoIndexKeyBuilder, DynamoIndexKeyableValue, DynamoKey, DynamoKeyBuilder, DynamoKeyableValue, GlobalSecondaryIndexKeyBuilders, LocalSecondaryIndexKeyBuilders, indexKey, key } from './core/key.js';
43
46
  export { DynamoTable, DynamoTableConfig } from './core/table.js';
44
- export { DocumentBuilderError } from './errors.js';
45
- export { Projection } from './projections/projection-types.js';
46
47
  export { ProjectionResult, parseProjection } from './projections/projection-parser.js';
47
48
  export { UpdateParserResult, parseUpdate } from './updates/update-parser.js';
48
- export { AddExpression, AddToSetExpression, AppendExpression, DeleteExpression, PrependExpression, RemoveExpression, SubtractExpression, UpdateExpression, UpdateType, UpdateValues, ValueReference } from './updates/update-types.js';
49
49
  export { ref } from './updates/ref.js';
50
50
  export { remove } from './updates/remove.js';
51
51
  export { add } from './updates/add.js';
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  export { AttributeExpressionMap } from './attributes/attribute-map.mjs';
2
+ export { DocumentBuilderError } from './errors.mjs';
2
3
  export { Get } from './commands/get.mjs';
3
4
  export { Query } from './commands/query.mjs';
4
5
  export { Scan } from './commands/scan.mjs';
@@ -17,10 +18,10 @@ export { ConditionalDelete } from './commands/conditional-delete.mjs';
17
18
  export { BatchWrite } from './commands/batch-write.mjs';
18
19
  export { TransactWrite } from './commands/transact-write.mjs';
19
20
  export { ConditionCheck } from './commands/condition-check.mjs';
21
+ export { parseCondition } from './conditions/condition-parser.mjs';
20
22
  export { and } from './conditions/and.mjs';
21
23
  export { beginsWith } from './conditions/begins-with.mjs';
22
24
  export { between } from './conditions/between.mjs';
23
- export { parseCondition } from './conditions/condition-parser.mjs';
24
25
  export { contains } from './conditions/contains.mjs';
25
26
  export { equals } from './conditions/equals.mjs';
26
27
  export { exists } from './conditions/exists.mjs';
@@ -38,7 +39,6 @@ export { typeIs } from './conditions/type-is.mjs';
38
39
  export { DynamoEntity } from './core/entity.mjs';
39
40
  export { indexKey, key } from './core/key.mjs';
40
41
  export { DynamoTable } from './core/table.mjs';
41
- export { DocumentBuilderError } from './errors.mjs';
42
42
  export { parseProjection } from './projections/projection-parser.mjs';
43
43
  export { parseUpdate } from './updates/update-parser.mjs';
44
44
  export { ref } from './updates/ref.mjs';
@@ -1,2 +1,8 @@
1
- export { Projection } from './projection-types.js';
2
1
  export { ProjectionResult, parseProjection } from './projection-parser.js';
2
+
3
+ /**
4
+ * Type representing a DynamoDB projection (list of attribute names).
5
+ */
6
+ type Projection = string[];
7
+
8
+ export type { Projection };
@@ -1,5 +1,5 @@
1
1
  import { AttributeExpressionMap } from '../attributes/attribute-map.js';
2
- import { Projection } from './projection-types.js';
2
+ import { Projection } from './index.js';
3
3
 
4
4
  type ProjectionResult = {
5
5
  projectionExpression: string;
@@ -2,6 +2,11 @@
2
2
 
3
3
  var updates_updateSymbols = require('./update-symbols.cjs');
4
4
 
5
+ /**
6
+ * Update function to add values to a set attribute.
7
+ *
8
+ * @param values - The values or reference to add to the set.
9
+ */
5
10
  function addToSet(values) {
6
11
  return {
7
12
  type: updates_updateSymbols.$add,
@@ -1 +1 @@
1
- {"version":3,"file":"add-to-set.cjs","sources":["../../src/updates/add-to-set.ts"],"sourcesContent":[null],"names":["$add","$addToSet"],"mappings":";;;;AAIM,SAAU,QAAQ,CAAC,MAA+C,EAAA;IACtE,OAAO;AACL,QAAA,IAAI,EAAEA,0BAAI;AACV,QAAA,EAAE,EAAEC,+BAAS;QACb,MAAM;KACP;AACH;;;;"}
1
+ {"version":3,"file":"add-to-set.cjs","sources":["../../src/updates/add-to-set.ts"],"sourcesContent":[null],"names":["$add","$addToSet"],"mappings":";;;;AAIA;;;;AAIG;AACG,SAAU,QAAQ,CAAC,MAA+C,EAAA;IACtE,OAAO;AACL,QAAA,IAAI,EAAEA,0BAAI;AACV,QAAA,EAAE,EAAEC,+BAAS;QACb,MAAM;KACP;AACH;;;;"}
@@ -1,6 +1,11 @@
1
1
  import { NativeAttributeValue } from '@aws-sdk/lib-dynamodb';
2
- import { ValueReference, AddToSetExpression } from './update-types.js';
2
+ import { ValueReference, AddToSetExpression } from './index.js';
3
3
 
4
+ /**
5
+ * Update function to add values to a set attribute.
6
+ *
7
+ * @param values - The values or reference to add to the set.
8
+ */
4
9
  declare function addToSet(values: NativeAttributeValue[] | ValueReference): AddToSetExpression;
5
10
 
6
11
  export { addToSet };
@@ -1,5 +1,10 @@
1
1
  import { $addToSet, $add } from './update-symbols.mjs';
2
2
 
3
+ /**
4
+ * Update function to add values to a set attribute.
5
+ *
6
+ * @param values - The values or reference to add to the set.
7
+ */
3
8
  function addToSet(values) {
4
9
  return {
5
10
  type: $add,
@@ -1 +1 @@
1
- {"version":3,"file":"add-to-set.mjs","sources":["../../src/updates/add-to-set.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIM,SAAU,QAAQ,CAAC,MAA+C,EAAA;IACtE,OAAO;AACL,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,EAAE,EAAE,SAAS;QACb,MAAM;KACP;AACH;;;;"}
1
+ {"version":3,"file":"add-to-set.mjs","sources":["../../src/updates/add-to-set.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIA;;;;AAIG;AACG,SAAU,QAAQ,CAAC,MAA+C,EAAA;IACtE,OAAO;AACL,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,EAAE,EAAE,SAAS;QACb,MAAM;KACP;AACH;;;;"}
@@ -2,6 +2,11 @@
2
2
 
3
3
  var updates_updateSymbols = require('./update-symbols.cjs');
4
4
 
5
+ /**
6
+ * Update function to add a number to an attribute.
7
+ *
8
+ * @param value - The number or reference to add.
9
+ */
5
10
  function add(value) {
6
11
  return {
7
12
  type: updates_updateSymbols.$set,
@@ -1 +1 @@
1
- {"version":3,"file":"add.cjs","sources":["../../src/updates/add.ts"],"sourcesContent":[null],"names":["$set","$add"],"mappings":";;;;AAGM,SAAU,GAAG,CAAC,KAAsC,EAAA;IACxD,OAAO;AACL,QAAA,IAAI,EAAEA,0BAAI;AACV,QAAA,EAAE,EAAEC,0BAAI;QACR,KAAK;KACN;AACH;;;;"}
1
+ {"version":3,"file":"add.cjs","sources":["../../src/updates/add.ts"],"sourcesContent":[null],"names":["$set","$add"],"mappings":";;;;AAGA;;;;AAIG;AACG,SAAU,GAAG,CAAC,KAAsC,EAAA;IACxD,OAAO;AACL,QAAA,IAAI,EAAEA,0BAAI;AACV,QAAA,EAAE,EAAEC,0BAAI;QACR,KAAK;KACN;AACH;;;;"}
@@ -1,5 +1,10 @@
1
- import { ValueReference, AddExpression } from './update-types.js';
1
+ import { ValueReference, AddExpression } from './index.js';
2
2
 
3
+ /**
4
+ * Update function to add a number to an attribute.
5
+ *
6
+ * @param value - The number or reference to add.
7
+ */
3
8
  declare function add(value: number | ValueReference<number>): AddExpression;
4
9
 
5
10
  export { add };
@@ -1,5 +1,10 @@
1
1
  import { $add, $set } from './update-symbols.mjs';
2
2
 
3
+ /**
4
+ * Update function to add a number to an attribute.
5
+ *
6
+ * @param value - The number or reference to add.
7
+ */
3
8
  function add(value) {
4
9
  return {
5
10
  type: $set,
@@ -1 +1 @@
1
- {"version":3,"file":"add.mjs","sources":["../../src/updates/add.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAGM,SAAU,GAAG,CAAC,KAAsC,EAAA;IACxD,OAAO;AACL,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,EAAE,EAAE,IAAI;QACR,KAAK;KACN;AACH;;;;"}
1
+ {"version":3,"file":"add.mjs","sources":["../../src/updates/add.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;;;;AAIG;AACG,SAAU,GAAG,CAAC,KAAsC,EAAA;IACxD,OAAO;AACL,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,EAAE,EAAE,IAAI;QACR,KAAK;KACN;AACH;;;;"}
@@ -2,6 +2,11 @@
2
2
 
3
3
  var updates_updateSymbols = require('./update-symbols.cjs');
4
4
 
5
+ /**
6
+ * Update function to append values to a list attribute.
7
+ *
8
+ * @param values - The values or reference to append.
9
+ */
5
10
  function append(values) {
6
11
  return {
7
12
  type: updates_updateSymbols.$set,
@@ -1 +1 @@
1
- {"version":3,"file":"append.cjs","sources":["../../src/updates/append.ts"],"sourcesContent":[null],"names":["$set","$append"],"mappings":";;;;AAIM,SAAU,MAAM,CAAC,MAA+C,EAAA;IACpE,OAAO;AACL,QAAA,IAAI,EAAEA,0BAAI;AACV,QAAA,EAAE,EAAEC,6BAAO;QACX,MAAM;KACP;AACH;;;;"}
1
+ {"version":3,"file":"append.cjs","sources":["../../src/updates/append.ts"],"sourcesContent":[null],"names":["$set","$append"],"mappings":";;;;AAIA;;;;AAIG;AACG,SAAU,MAAM,CAAC,MAA+C,EAAA;IACpE,OAAO;AACL,QAAA,IAAI,EAAEA,0BAAI;AACV,QAAA,EAAE,EAAEC,6BAAO;QACX,MAAM;KACP;AACH;;;;"}
@@ -1,6 +1,11 @@
1
1
  import { NativeAttributeValue } from '@aws-sdk/lib-dynamodb';
2
- import { ValueReference, AppendExpression } from './update-types.js';
2
+ import { ValueReference, AppendExpression } from './index.js';
3
3
 
4
+ /**
5
+ * Update function to append values to a list attribute.
6
+ *
7
+ * @param values - The values or reference to append.
8
+ */
4
9
  declare function append(values: NativeAttributeValue[] | ValueReference): AppendExpression;
5
10
 
6
11
  export { append };
@@ -1,5 +1,10 @@
1
1
  import { $append, $set } from './update-symbols.mjs';
2
2
 
3
+ /**
4
+ * Update function to append values to a list attribute.
5
+ *
6
+ * @param values - The values or reference to append.
7
+ */
3
8
  function append(values) {
4
9
  return {
5
10
  type: $set,
@@ -1 +1 @@
1
- {"version":3,"file":"append.mjs","sources":["../../src/updates/append.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIM,SAAU,MAAM,CAAC,MAA+C,EAAA;IACpE,OAAO;AACL,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,EAAE,EAAE,OAAO;QACX,MAAM;KACP;AACH;;;;"}
1
+ {"version":3,"file":"append.mjs","sources":["../../src/updates/append.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIA;;;;AAIG;AACG,SAAU,MAAM,CAAC,MAA+C,EAAA;IACpE,OAAO;AACL,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,EAAE,EAAE,OAAO;QACX,MAAM;KACP;AACH;;;;"}
@@ -1,5 +1,6 @@
1
+ import { NativeAttributeValue } from '@aws-sdk/lib-dynamodb';
2
+ import { $set, $add, $ref, $subtract, $append, $prepend, $addToSet, $delete, $remove } from './update-symbols.js';
1
3
  export { UpdateParserResult, parseUpdate } from './update-parser.js';
2
- export { AddExpression, AddToSetExpression, AppendExpression, DeleteExpression, PrependExpression, RemoveExpression, SubtractExpression, UpdateExpression, UpdateType, UpdateValues, ValueReference } from './update-types.js';
3
4
  export { ref } from './ref.js';
4
5
  export { remove } from './remove.js';
5
6
  export { add } from './add.js';
@@ -8,3 +9,79 @@ export { append } from './append.js';
8
9
  export { prepend } from './prepend.js';
9
10
  export { addToSet } from './add-to-set.js';
10
11
  export { removeFromSet } from './remove-from-set.js';
12
+
13
+ /**
14
+ * Type representing the different kinds of update operations.
15
+ */
16
+ type UpdateType = 'SET' | 'REMOVE' | 'ADD' | 'DELETE';
17
+ /**
18
+ * Type representing a reference to another attribute's value.
19
+ */
20
+ type ValueReference<ValueType extends NativeAttributeValue = NativeAttributeValue> = {
21
+ type: typeof $ref;
22
+ to: string;
23
+ default?: ValueType;
24
+ };
25
+ /**
26
+ * Update expression from a REMOVE operation
27
+ */
28
+ type RemoveExpression = {
29
+ type: typeof $remove;
30
+ };
31
+ /**
32
+ * Update expression from a DELETE operation
33
+ */
34
+ type DeleteExpression = {
35
+ type: typeof $delete;
36
+ values: NativeAttributeValue[] | ValueReference;
37
+ };
38
+ /**
39
+ * Update expression from an ADD operation
40
+ */
41
+ type AddExpression = {
42
+ type: typeof $set;
43
+ op: typeof $add;
44
+ value: number | ValueReference<number>;
45
+ };
46
+ /**
47
+ * Update expression from a SUBTRACT operation
48
+ */
49
+ type SubtractExpression = {
50
+ type: typeof $set;
51
+ op: typeof $subtract;
52
+ value: number | ValueReference<number>;
53
+ };
54
+ /**
55
+ * Update expression from an APPEND operation
56
+ */
57
+ type AppendExpression = {
58
+ type: typeof $set;
59
+ op: typeof $append;
60
+ values: NativeAttributeValue[] | ValueReference;
61
+ };
62
+ /**
63
+ * Update expression from a PREPEND operation
64
+ */
65
+ type PrependExpression = {
66
+ type: typeof $set;
67
+ op: typeof $prepend;
68
+ values: NativeAttributeValue[] | ValueReference;
69
+ };
70
+ /**
71
+ * Update expression from an ADD TO SET operation
72
+ */
73
+ type AddToSetExpression = {
74
+ type: typeof $add;
75
+ op: typeof $addToSet;
76
+ values: NativeAttributeValue[] | ValueReference;
77
+ };
78
+ /**
79
+ * Union type of all possible update expressions.
80
+ */
81
+ type UpdateExpression = AddExpression | SubtractExpression | AppendExpression | PrependExpression | AddToSetExpression | DeleteExpression | RemoveExpression;
82
+ /**
83
+ * Type representing an update operation for an entity.
84
+ */
85
+ type UpdateValues = Record<string, NativeAttributeValue | UpdateExpression | ValueReference>;
86
+
87
+ export type { AddExpression, AddToSetExpression, AppendExpression, DeleteExpression, PrependExpression, RemoveExpression, SubtractExpression, UpdateExpression, UpdateType, UpdateValues, ValueReference };
@@ -2,6 +2,11 @@
2
2
 
3
3
  var updates_updateSymbols = require('./update-symbols.cjs');
4
4
 
5
+ /**
6
+ * Update function to prepend values to a list attribute.
7
+ *
8
+ * @param values - The values or reference to prepend.
9
+ */
5
10
  function prepend(values) {
6
11
  return {
7
12
  type: updates_updateSymbols.$set,
@@ -1 +1 @@
1
- {"version":3,"file":"prepend.cjs","sources":["../../src/updates/prepend.ts"],"sourcesContent":[null],"names":["$set","$prepend"],"mappings":";;;;AAIM,SAAU,OAAO,CAAC,MAA+C,EAAA;IACrE,OAAO;AACL,QAAA,IAAI,EAAEA,0BAAI;AACV,QAAA,EAAE,EAAEC,8BAAQ;QACZ,MAAM;KACP;AACH;;;;"}
1
+ {"version":3,"file":"prepend.cjs","sources":["../../src/updates/prepend.ts"],"sourcesContent":[null],"names":["$set","$prepend"],"mappings":";;;;AAIA;;;;AAIG;AACG,SAAU,OAAO,CAAC,MAA+C,EAAA;IACrE,OAAO;AACL,QAAA,IAAI,EAAEA,0BAAI;AACV,QAAA,EAAE,EAAEC,8BAAQ;QACZ,MAAM;KACP;AACH;;;;"}
@@ -1,6 +1,11 @@
1
1
  import { NativeAttributeValue } from '@aws-sdk/lib-dynamodb';
2
- import { ValueReference, PrependExpression } from './update-types.js';
2
+ import { ValueReference, PrependExpression } from './index.js';
3
3
 
4
+ /**
5
+ * Update function to prepend values to a list attribute.
6
+ *
7
+ * @param values - The values or reference to prepend.
8
+ */
4
9
  declare function prepend(values: NativeAttributeValue[] | ValueReference): PrependExpression;
5
10
 
6
11
  export { prepend };