dynamo-document-builder 0.6.0 → 0.7.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 (310) hide show
  1. package/README.md +367 -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 +43 -0
  8. package/dist/commands/batch-get.cjs.map +1 -1
  9. package/dist/commands/batch-get.d.ts +51 -3
  10. package/dist/commands/batch-get.mjs +44 -1
  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 +44 -0
  18. package/dist/commands/batch-write.cjs.map +1 -1
  19. package/dist/commands/batch-write.d.ts +54 -4
  20. package/dist/commands/batch-write.mjs +45 -1
  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.cjs +8 -0
  53. package/dist/commands/index.cjs.map +1 -1
  54. package/dist/commands/index.d.ts +160 -1
  55. package/dist/commands/index.mjs +4 -0
  56. package/dist/commands/index.mjs.map +1 -1
  57. package/dist/commands/projected-get.cjs +40 -0
  58. package/dist/commands/projected-get.cjs.map +1 -1
  59. package/dist/commands/projected-get.d.ts +54 -3
  60. package/dist/commands/projected-get.mjs +40 -0
  61. package/dist/commands/projected-get.mjs.map +1 -1
  62. package/dist/commands/projected-query.cjs +41 -0
  63. package/dist/commands/projected-query.cjs.map +1 -1
  64. package/dist/commands/projected-query.d.ts +56 -3
  65. package/dist/commands/projected-query.mjs +41 -0
  66. package/dist/commands/projected-query.mjs.map +1 -1
  67. package/dist/commands/projected-scan.cjs +41 -0
  68. package/dist/commands/projected-scan.cjs.map +1 -1
  69. package/dist/commands/projected-scan.d.ts +55 -3
  70. package/dist/commands/projected-scan.mjs +41 -0
  71. package/dist/commands/projected-scan.mjs.map +1 -1
  72. package/dist/commands/put.cjs +37 -0
  73. package/dist/commands/put.cjs.map +1 -1
  74. package/dist/commands/put.d.ts +50 -3
  75. package/dist/commands/put.mjs +37 -0
  76. package/dist/commands/put.mjs.map +1 -1
  77. package/dist/commands/query.cjs +35 -0
  78. package/dist/commands/query.cjs.map +1 -1
  79. package/dist/commands/query.d.ts +48 -3
  80. package/dist/commands/query.mjs +35 -0
  81. package/dist/commands/query.mjs.map +1 -1
  82. package/dist/commands/scan.cjs +33 -0
  83. package/dist/commands/scan.cjs.map +1 -1
  84. package/dist/commands/scan.d.ts +46 -3
  85. package/dist/commands/scan.mjs +33 -0
  86. package/dist/commands/scan.mjs.map +1 -1
  87. package/dist/commands/table-batch-get.cjs +123 -0
  88. package/dist/commands/table-batch-get.cjs.map +1 -0
  89. package/dist/commands/table-batch-get.d.ts +86 -0
  90. package/dist/commands/table-batch-get.mjs +121 -0
  91. package/dist/commands/table-batch-get.mjs.map +1 -0
  92. package/dist/commands/table-batch-write.cjs +119 -0
  93. package/dist/commands/table-batch-write.cjs.map +1 -0
  94. package/dist/commands/table-batch-write.d.ts +79 -0
  95. package/dist/commands/table-batch-write.mjs +117 -0
  96. package/dist/commands/table-batch-write.mjs.map +1 -0
  97. package/dist/commands/table-transact-get.cjs +73 -0
  98. package/dist/commands/table-transact-get.cjs.map +1 -0
  99. package/dist/commands/table-transact-get.d.ts +60 -0
  100. package/dist/commands/table-transact-get.mjs +71 -0
  101. package/dist/commands/table-transact-get.mjs.map +1 -0
  102. package/dist/commands/table-transact-write.cjs +76 -0
  103. package/dist/commands/table-transact-write.cjs.map +1 -0
  104. package/dist/commands/table-transact-write.d.ts +51 -0
  105. package/dist/commands/table-transact-write.mjs +74 -0
  106. package/dist/commands/table-transact-write.mjs.map +1 -0
  107. package/dist/commands/transact-get.cjs +38 -0
  108. package/dist/commands/transact-get.cjs.map +1 -1
  109. package/dist/commands/transact-get.d.ts +49 -3
  110. package/dist/commands/transact-get.mjs +39 -1
  111. package/dist/commands/transact-get.mjs.map +1 -1
  112. package/dist/commands/transact-write.cjs +37 -0
  113. package/dist/commands/transact-write.cjs.map +1 -1
  114. package/dist/commands/transact-write.d.ts +46 -1
  115. package/dist/commands/transact-write.mjs +37 -0
  116. package/dist/commands/transact-write.mjs.map +1 -1
  117. package/dist/commands/update.cjs +37 -0
  118. package/dist/commands/update.cjs.map +1 -1
  119. package/dist/commands/update.d.ts +50 -3
  120. package/dist/commands/update.mjs +37 -0
  121. package/dist/commands/update.mjs.map +1 -1
  122. package/dist/conditions/and.cjs +3 -0
  123. package/dist/conditions/and.cjs.map +1 -1
  124. package/dist/conditions/and.d.ts +4 -1
  125. package/dist/conditions/and.mjs +3 -0
  126. package/dist/conditions/and.mjs.map +1 -1
  127. package/dist/conditions/begins-with.cjs +3 -0
  128. package/dist/conditions/begins-with.cjs.map +1 -1
  129. package/dist/conditions/begins-with.d.ts +4 -1
  130. package/dist/conditions/begins-with.mjs +3 -0
  131. package/dist/conditions/begins-with.mjs.map +1 -1
  132. package/dist/conditions/between.cjs +3 -0
  133. package/dist/conditions/between.cjs.map +1 -1
  134. package/dist/conditions/between.d.ts +4 -1
  135. package/dist/conditions/between.mjs +3 -0
  136. package/dist/conditions/between.mjs.map +1 -1
  137. package/dist/conditions/condition-parser.d.ts +1 -1
  138. package/dist/conditions/contains.cjs +3 -0
  139. package/dist/conditions/contains.cjs.map +1 -1
  140. package/dist/conditions/contains.d.ts +4 -1
  141. package/dist/conditions/contains.mjs +3 -0
  142. package/dist/conditions/contains.mjs.map +1 -1
  143. package/dist/conditions/equals.cjs +3 -0
  144. package/dist/conditions/equals.cjs.map +1 -1
  145. package/dist/conditions/equals.d.ts +4 -1
  146. package/dist/conditions/equals.mjs +3 -0
  147. package/dist/conditions/equals.mjs.map +1 -1
  148. package/dist/conditions/exists.cjs +3 -0
  149. package/dist/conditions/exists.cjs.map +1 -1
  150. package/dist/conditions/exists.d.ts +4 -1
  151. package/dist/conditions/exists.mjs +3 -0
  152. package/dist/conditions/exists.mjs.map +1 -1
  153. package/dist/conditions/greater-than-or-equal.cjs +3 -0
  154. package/dist/conditions/greater-than-or-equal.cjs.map +1 -1
  155. package/dist/conditions/greater-than-or-equal.d.ts +4 -1
  156. package/dist/conditions/greater-than-or-equal.mjs +3 -0
  157. package/dist/conditions/greater-than-or-equal.mjs.map +1 -1
  158. package/dist/conditions/greater-than.cjs +3 -0
  159. package/dist/conditions/greater-than.cjs.map +1 -1
  160. package/dist/conditions/greater-than.d.ts +4 -1
  161. package/dist/conditions/greater-than.mjs +3 -0
  162. package/dist/conditions/greater-than.mjs.map +1 -1
  163. package/dist/conditions/index.cjs +2 -2
  164. package/dist/conditions/index.d.ts +185 -2
  165. package/dist/conditions/index.mjs +1 -1
  166. package/dist/conditions/is-in.cjs +3 -0
  167. package/dist/conditions/is-in.cjs.map +1 -1
  168. package/dist/conditions/is-in.d.ts +4 -1
  169. package/dist/conditions/is-in.mjs +3 -0
  170. package/dist/conditions/is-in.mjs.map +1 -1
  171. package/dist/conditions/less-than-or-equal.cjs +3 -0
  172. package/dist/conditions/less-than-or-equal.cjs.map +1 -1
  173. package/dist/conditions/less-than-or-equal.d.ts +4 -1
  174. package/dist/conditions/less-than-or-equal.mjs +3 -0
  175. package/dist/conditions/less-than-or-equal.mjs.map +1 -1
  176. package/dist/conditions/less-than.cjs +3 -0
  177. package/dist/conditions/less-than.cjs.map +1 -1
  178. package/dist/conditions/less-than.d.ts +4 -1
  179. package/dist/conditions/less-than.mjs +3 -0
  180. package/dist/conditions/less-than.mjs.map +1 -1
  181. package/dist/conditions/not-equals.cjs +3 -0
  182. package/dist/conditions/not-equals.cjs.map +1 -1
  183. package/dist/conditions/not-equals.d.ts +4 -1
  184. package/dist/conditions/not-equals.mjs +3 -0
  185. package/dist/conditions/not-equals.mjs.map +1 -1
  186. package/dist/conditions/not-exists.cjs +3 -0
  187. package/dist/conditions/not-exists.cjs.map +1 -1
  188. package/dist/conditions/not-exists.d.ts +4 -1
  189. package/dist/conditions/not-exists.mjs +3 -0
  190. package/dist/conditions/not-exists.mjs.map +1 -1
  191. package/dist/conditions/not.cjs +3 -0
  192. package/dist/conditions/not.cjs.map +1 -1
  193. package/dist/conditions/not.d.ts +4 -1
  194. package/dist/conditions/not.mjs +3 -0
  195. package/dist/conditions/not.mjs.map +1 -1
  196. package/dist/conditions/or.cjs +3 -0
  197. package/dist/conditions/or.cjs.map +1 -1
  198. package/dist/conditions/or.d.ts +4 -1
  199. package/dist/conditions/or.mjs +3 -0
  200. package/dist/conditions/or.mjs.map +1 -1
  201. package/dist/conditions/size.cjs +3 -0
  202. package/dist/conditions/size.cjs.map +1 -1
  203. package/dist/conditions/size.d.ts +4 -1
  204. package/dist/conditions/size.mjs +3 -0
  205. package/dist/conditions/size.mjs.map +1 -1
  206. package/dist/conditions/type-is.cjs +3 -0
  207. package/dist/conditions/type-is.cjs.map +1 -1
  208. package/dist/conditions/type-is.d.ts +4 -1
  209. package/dist/conditions/type-is.mjs +3 -0
  210. package/dist/conditions/type-is.mjs.map +1 -1
  211. package/dist/core/entity.cjs +171 -0
  212. package/dist/core/entity.cjs.map +1 -1
  213. package/dist/core/entity.d.ts +99 -4
  214. package/dist/core/entity.mjs +171 -0
  215. package/dist/core/entity.mjs.map +1 -1
  216. package/dist/core/index.d.ts +139 -2
  217. package/dist/core/key.cjs +1 -1
  218. package/dist/core/key.cjs.map +1 -1
  219. package/dist/core/key.d.ts +26 -2
  220. package/dist/core/key.mjs +1 -1
  221. package/dist/core/key.mjs.map +1 -1
  222. package/dist/core/table.cjs +30 -0
  223. package/dist/core/table.cjs.map +1 -1
  224. package/dist/core/table.d.ts +40 -1
  225. package/dist/core/table.mjs +31 -1
  226. package/dist/core/table.mjs.map +1 -1
  227. package/dist/errors.cjs +3 -0
  228. package/dist/errors.cjs.map +1 -1
  229. package/dist/errors.d.ts +3 -0
  230. package/dist/errors.mjs +3 -0
  231. package/dist/errors.mjs.map +1 -1
  232. package/dist/index.cjs +10 -2
  233. package/dist/index.cjs.map +1 -1
  234. package/dist/index.d.ts +11 -7
  235. package/dist/index.mjs +5 -1
  236. package/dist/index.mjs.map +1 -1
  237. package/dist/projections/index.d.ts +7 -1
  238. package/dist/projections/projection-parser.d.ts +1 -1
  239. package/dist/updates/add-to-set.cjs +5 -0
  240. package/dist/updates/add-to-set.cjs.map +1 -1
  241. package/dist/updates/add-to-set.d.ts +6 -1
  242. package/dist/updates/add-to-set.mjs +5 -0
  243. package/dist/updates/add-to-set.mjs.map +1 -1
  244. package/dist/updates/add.cjs +5 -0
  245. package/dist/updates/add.cjs.map +1 -1
  246. package/dist/updates/add.d.ts +6 -1
  247. package/dist/updates/add.mjs +5 -0
  248. package/dist/updates/add.mjs.map +1 -1
  249. package/dist/updates/append.cjs +5 -0
  250. package/dist/updates/append.cjs.map +1 -1
  251. package/dist/updates/append.d.ts +6 -1
  252. package/dist/updates/append.mjs +5 -0
  253. package/dist/updates/append.mjs.map +1 -1
  254. package/dist/updates/index.d.ts +78 -1
  255. package/dist/updates/prepend.cjs +5 -0
  256. package/dist/updates/prepend.cjs.map +1 -1
  257. package/dist/updates/prepend.d.ts +6 -1
  258. package/dist/updates/prepend.mjs +5 -0
  259. package/dist/updates/prepend.mjs.map +1 -1
  260. package/dist/updates/ref.cjs +6 -0
  261. package/dist/updates/ref.cjs.map +1 -1
  262. package/dist/updates/ref.d.ts +7 -1
  263. package/dist/updates/ref.mjs +6 -0
  264. package/dist/updates/ref.mjs.map +1 -1
  265. package/dist/updates/remove-from-set.cjs +5 -0
  266. package/dist/updates/remove-from-set.cjs.map +1 -1
  267. package/dist/updates/remove-from-set.d.ts +6 -1
  268. package/dist/updates/remove-from-set.mjs +5 -0
  269. package/dist/updates/remove-from-set.mjs.map +1 -1
  270. package/dist/updates/remove.cjs +3 -0
  271. package/dist/updates/remove.cjs.map +1 -1
  272. package/dist/updates/remove.d.ts +4 -1
  273. package/dist/updates/remove.mjs +3 -0
  274. package/dist/updates/remove.mjs.map +1 -1
  275. package/dist/updates/subtract.cjs +5 -0
  276. package/dist/updates/subtract.cjs.map +1 -1
  277. package/dist/updates/subtract.d.ts +6 -1
  278. package/dist/updates/subtract.mjs +5 -0
  279. package/dist/updates/subtract.mjs.map +1 -1
  280. package/dist/updates/update-parser.cjs +10 -0
  281. package/dist/updates/update-parser.cjs.map +1 -1
  282. package/dist/updates/update-parser.d.ts +17 -1
  283. package/dist/updates/update-parser.mjs +10 -0
  284. package/dist/updates/update-parser.mjs.map +1 -1
  285. package/package.json +2 -1
  286. package/dist/commands/base-command.cjs +0 -3
  287. package/dist/commands/base-command.cjs.map +0 -1
  288. package/dist/commands/base-command.d.ts +0 -27
  289. package/dist/commands/base-command.mjs +0 -2
  290. package/dist/commands/base-command.mjs.map +0 -1
  291. package/dist/conditions/condition-types.cjs +0 -3
  292. package/dist/conditions/condition-types.cjs.map +0 -1
  293. package/dist/conditions/condition-types.d.ts +0 -95
  294. package/dist/conditions/condition-types.mjs +0 -2
  295. package/dist/conditions/condition-types.mjs.map +0 -1
  296. package/dist/core/core-types.cjs +0 -3
  297. package/dist/core/core-types.cjs.map +0 -1
  298. package/dist/core/core-types.d.ts +0 -44
  299. package/dist/core/core-types.mjs +0 -2
  300. package/dist/core/core-types.mjs.map +0 -1
  301. package/dist/projections/projection-types.cjs +0 -3
  302. package/dist/projections/projection-types.cjs.map +0 -1
  303. package/dist/projections/projection-types.d.ts +0 -3
  304. package/dist/projections/projection-types.mjs +0 -2
  305. package/dist/projections/projection-types.mjs.map +0 -1
  306. package/dist/updates/update-types.cjs +0 -3
  307. package/dist/updates/update-types.cjs.map +0 -1
  308. package/dist/updates/update-types.d.ts +0 -45
  309. package/dist/updates/update-types.mjs +0 -2
  310. package/dist/updates/update-types.mjs.map +0 -1
@@ -1,6 +1,9 @@
1
- import { __classPrivateFieldSet, __classPrivateFieldGet } from '../node_modules/tslib/tslib.es6.mjs';
1
+ import { __classPrivateFieldSet, __classPrivateFieldGet, __awaiter } 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,24 +24,51 @@ 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
  }
64
+ /**
65
+ * Sends a table-level command to be executed against this table.
66
+ */
67
+ send(command) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ return yield command.execute(this);
70
+ });
71
+ }
42
72
  }
43
73
  _DynamoTable_tableName = new WeakMap(), _DynamoTable_documentClient = new WeakMap(), _DynamoTable_pk = new WeakMap(), _DynamoTable_sk = new WeakMap(), _DynamoTable_gsi = new WeakMap(), _DynamoTable_lsi = new WeakMap();
44
74
 
@@ -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;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,QAAA,sBAAA,CAAA,IAAI,EAAA,sBAAA,EAAc,MAAM,CAAC,SAAS,MAAA;AAClC,QAAA,sBAAA,CAAA,IAAI,EAAA,2BAAA,EAAmB,MAAM,CAAC,cAAc,MAAA;QAC5C,IAAI,CAAA,CAAA,EAAA,GAAA,MAAM,CAAC,QAAQ,0CAAE,YAAY,MAAK,SAAS,EAAE;YAC/C,sBAAA,CAAA,IAAI,mBAAO,MAAM,CAAC,QAAQ,CAAC,YAAY,MAAA;QACzC;QACA,IAAI,CAAA,CAAA,EAAA,GAAA,MAAM,CAAC,QAAQ,0CAAE,OAAO,MAAK,SAAS,EAAE;YAC1C,sBAAA,CAAA,IAAI,mBAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,MAAA;QACpC;AACA,QAAA,sBAAA,CAAA,IAAI,EAAA,gBAAA,EAAQ,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,MAAM,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,sBAAsB,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,EAAE,EAAA,GAAA,CAAA;AACzD,QAAA,sBAAA,CAAA,IAAI,EAAA,gBAAA,EAAQ,CAAA,EAAA,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,IAAA,IAAW,SAAS,GAAA;QAClB,OAAO,sBAAA,CAAA,IAAI,EAAA,sBAAA,EAAA,GAAA,CAAW;IACxB;AAEA,IAAA,IAAW,cAAc,GAAA;QACvB,OAAO,sBAAA,CAAA,IAAI,EAAA,2BAAA,EAAA,GAAA,CAAgB;IAC7B;AAEA,IAAA,IAAW,gBAAgB,GAAA;QACzB,OAAO,sBAAA,CAAA,IAAI,EAAA,eAAA,EAAA,GAAA,CAAI;IACjB;AAEA,IAAA,IAAW,WAAW,GAAA;QACpB,OAAO,sBAAA,CAAA,IAAI,EAAA,eAAA,EAAA,GAAA,CAAI;IACjB;AAEA,IAAA,IAAW,4BAA4B,GAAA;QACrC,OAAO,sBAAA,CAAA,IAAI,EAAA,gBAAA,EAAA,GAAA,CAAK;IAClB;AAEA,IAAA,IAAW,2BAA2B,GAAA;QACpC,OAAO,sBAAA,CAAA,IAAI,EAAA,gBAAA,EAAA,GAAA,CAAK;IAClB;AACD;;;;;"}
1
+ {"version":3,"file":"table.mjs","sources":["../../src/core/table.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AA2BA;;AAEG;MACU,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,QAAA,sBAAA,CAAA,IAAI,EAAA,sBAAA,EAAc,MAAM,CAAC,SAAS,MAAA;AAClC,QAAA,sBAAA,CAAA,IAAI,EAAA,2BAAA,EAAmB,MAAM,CAAC,cAAc,MAAA;QAC5C,IAAI,CAAA,CAAA,EAAA,GAAA,MAAM,CAAC,QAAQ,0CAAE,YAAY,MAAK,SAAS,EAAE;YAC/C,sBAAA,CAAA,IAAI,mBAAO,MAAM,CAAC,QAAQ,CAAC,YAAY,MAAA;QACzC;QACA,IAAI,CAAA,CAAA,EAAA,GAAA,MAAM,CAAC,QAAQ,0CAAE,OAAO,MAAK,SAAS,EAAE;YAC1C,sBAAA,CAAA,IAAI,mBAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,MAAA;QACpC;AACA,QAAA,sBAAA,CAAA,IAAI,EAAA,gBAAA,EAAQ,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,MAAM,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,sBAAsB,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,EAAE,EAAA,GAAA,CAAA;AACzD,QAAA,sBAAA,CAAA,IAAI,EAAA,gBAAA,EAAQ,CAAA,EAAA,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,OAAO,sBAAA,CAAA,IAAI,EAAA,sBAAA,EAAA,GAAA,CAAW;IACxB;AAEA;;AAEG;AACH,IAAA,IAAW,cAAc,GAAA;QACvB,OAAO,sBAAA,CAAA,IAAI,EAAA,2BAAA,EAAA,GAAA,CAAgB;IAC7B;AAEA;;AAEG;AACH,IAAA,IAAW,gBAAgB,GAAA;QACzB,OAAO,sBAAA,CAAA,IAAI,EAAA,eAAA,EAAA,GAAA,CAAI;IACjB;AAEA;;;AAGG;AACH,IAAA,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;AAEA;;AAEG;AACU,IAAA,IAAI,CAAgB,OAAoC,EAAA;;AACnE,YAAA,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;QACpC,CAAC,CAAA;AAAA,IAAA;AACF;;;;;"}
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
@@ -18,11 +18,15 @@ var commands_conditionalUpdate = require('./commands/conditional-update.cjs');
18
18
  var commands_conditionalDelete = require('./commands/conditional-delete.cjs');
19
19
  var commands_batchWrite = require('./commands/batch-write.cjs');
20
20
  var commands_transactWrite = require('./commands/transact-write.cjs');
21
+ var commands_tableTransactWrite = require('./commands/table-transact-write.cjs');
22
+ var commands_tableBatchWrite = require('./commands/table-batch-write.cjs');
23
+ var commands_tableTransactGet = require('./commands/table-transact-get.cjs');
24
+ var commands_tableBatchGet = require('./commands/table-batch-get.cjs');
21
25
  var commands_conditionCheck = require('./commands/condition-check.cjs');
26
+ var conditions_conditionParser = require('./conditions/condition-parser.cjs');
22
27
  var conditions_and = require('./conditions/and.cjs');
23
28
  var conditions_beginsWith = require('./conditions/begins-with.cjs');
24
29
  var conditions_between = require('./conditions/between.cjs');
25
- var conditions_conditionParser = require('./conditions/condition-parser.cjs');
26
30
  var conditions_contains = require('./conditions/contains.cjs');
27
31
  var conditions_equals = require('./conditions/equals.cjs');
28
32
  var conditions_exists = require('./conditions/exists.cjs');
@@ -72,11 +76,15 @@ exports.ConditionalUpdate = commands_conditionalUpdate.ConditionalUpdate;
72
76
  exports.ConditionalDelete = commands_conditionalDelete.ConditionalDelete;
73
77
  exports.BatchWrite = commands_batchWrite.BatchWrite;
74
78
  exports.TransactWrite = commands_transactWrite.TransactWrite;
79
+ exports.TableTransactWrite = commands_tableTransactWrite.TableTransactWrite;
80
+ exports.TableBatchWrite = commands_tableBatchWrite.TableBatchWrite;
81
+ exports.TableTransactGet = commands_tableTransactGet.TableTransactGet;
82
+ exports.TableBatchGet = commands_tableBatchGet.TableBatchGet;
75
83
  exports.ConditionCheck = commands_conditionCheck.ConditionCheck;
84
+ exports.parseCondition = conditions_conditionParser.parseCondition;
76
85
  exports.and = conditions_and.and;
77
86
  exports.beginsWith = conditions_beginsWith.beginsWith;
78
87
  exports.between = conditions_between.between;
79
- exports.parseCondition = conditions_conditionParser.parseCondition;
80
88
  exports.contains = conditions_contains.contains;
81
89
  exports.equals = conditions_equals.equals;
82
90
  exports.exists = conditions_exists.exists;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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, BatchGetPreparable, BatchWritePreparable, GetTransactable, PreparedBatchGet, PreparedBatchWrite, PreparedGetTransaction, PreparedWriteTransaction, TableCommand, 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';
@@ -17,12 +22,15 @@ export { ConditionalUpdate, ConditionalUpdateConfig, ConditionalUpdateResult } f
17
22
  export { ConditionalDelete, ConditionalDeleteConfig, ConditionalDeleteResult } from './commands/conditional-delete.js';
18
23
  export { BatchWrite, BatchWriteConfig, BatchWriteResult } from './commands/batch-write.js';
19
24
  export { TransactWrite, TransactWriteConfig, TransactWriteResult } from './commands/transact-write.js';
25
+ export { TableTransactWrite, TableTransactWriteConfig, TableTransactWriteResult } from './commands/table-transact-write.js';
26
+ export { TableBatchWrite, TableBatchWriteConfig, TableBatchWriteResult } from './commands/table-batch-write.js';
27
+ export { TableTransactGet, TableTransactGetConfig, TableTransactGetResult } from './commands/table-transact-get.js';
28
+ export { TableBatchGet, TableBatchGetConfig, TableBatchGetResult } from './commands/table-batch-get.js';
20
29
  export { ConditionCheck, ConditionCheckConfig } from './commands/condition-check.js';
30
+ export { ConditionParserResult, parseCondition } from './conditions/condition-parser.js';
21
31
  export { and } from './conditions/and.js';
22
32
  export { beginsWith } from './conditions/begins-with.js';
23
33
  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
34
  export { contains } from './conditions/contains.js';
27
35
  export { equals } from './conditions/equals.js';
28
36
  export { exists } from './conditions/exists.js';
@@ -37,15 +45,11 @@ export { notExists } from './conditions/not-exists.js';
37
45
  export { or } from './conditions/or.js';
38
46
  export { size } from './conditions/size.js';
39
47
  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
48
  export { DynamoEntity, DynamoEntityConfig, EntityKeyInput } from './core/entity.js';
42
49
  export { DynamoIndexKey, DynamoIndexKeyBuilder, DynamoIndexKeyableValue, DynamoKey, DynamoKeyBuilder, DynamoKeyableValue, GlobalSecondaryIndexKeyBuilders, LocalSecondaryIndexKeyBuilders, indexKey, key } from './core/key.js';
43
50
  export { DynamoTable, DynamoTableConfig } from './core/table.js';
44
- export { DocumentBuilderError } from './errors.js';
45
- export { Projection } from './projections/projection-types.js';
46
51
  export { ProjectionResult, parseProjection } from './projections/projection-parser.js';
47
52
  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
53
  export { ref } from './updates/ref.js';
50
54
  export { remove } from './updates/remove.js';
51
55
  export { add } from './updates/add.js';
package/dist/index.mjs CHANGED
@@ -16,11 +16,15 @@ export { ConditionalUpdate } from './commands/conditional-update.mjs';
16
16
  export { ConditionalDelete } from './commands/conditional-delete.mjs';
17
17
  export { BatchWrite } from './commands/batch-write.mjs';
18
18
  export { TransactWrite } from './commands/transact-write.mjs';
19
+ export { TableTransactWrite } from './commands/table-transact-write.mjs';
20
+ export { TableBatchWrite } from './commands/table-batch-write.mjs';
21
+ export { TableTransactGet } from './commands/table-transact-get.mjs';
22
+ export { TableBatchGet } from './commands/table-batch-get.mjs';
19
23
  export { ConditionCheck } from './commands/condition-check.mjs';
24
+ export { parseCondition } from './conditions/condition-parser.mjs';
20
25
  export { and } from './conditions/and.mjs';
21
26
  export { beginsWith } from './conditions/begins-with.mjs';
22
27
  export { between } from './conditions/between.mjs';
23
- export { parseCondition } from './conditions/condition-parser.mjs';
24
28
  export { contains } from './conditions/contains.mjs';
25
29
  export { equals } from './conditions/equals.mjs';
26
30
  export { exists } from './conditions/exists.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -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 };
@@ -1,5 +1,10 @@
1
1
  import { $prepend, $set } from './update-symbols.mjs';
2
2
 
3
+ /**
4
+ * Update function to prepend values to a list attribute.
5
+ *
6
+ * @param values - The values or reference to prepend.
7
+ */
3
8
  function prepend(values) {
4
9
  return {
5
10
  type: $set,
@@ -1 +1 @@
1
- {"version":3,"file":"prepend.mjs","sources":["../../src/updates/prepend.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIM,SAAU,OAAO,CAAC,MAA+C,EAAA;IACrE,OAAO;AACL,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,EAAE,EAAE,QAAQ;QACZ,MAAM;KACP;AACH;;;;"}
1
+ {"version":3,"file":"prepend.mjs","sources":["../../src/updates/prepend.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIA;;;;AAIG;AACG,SAAU,OAAO,CAAC,MAA+C,EAAA;IACrE,OAAO;AACL,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,EAAE,EAAE,QAAQ;QACZ,MAAM;KACP;AACH;;;;"}
@@ -2,6 +2,12 @@
2
2
 
3
3
  var updates_updateSymbols = require('./update-symbols.cjs');
4
4
 
5
+ /**
6
+ * Creates a reference to another attribute's value.
7
+ *
8
+ * @param attributePath - The path of the attribute to reference.
9
+ * @param defaultTo - An optional default value if the referenced attribute does not exist.
10
+ */
5
11
  function ref(attributePath, defaultTo) {
6
12
  return {
7
13
  type: updates_updateSymbols.$ref,
@@ -1 +1 @@
1
- {"version":3,"file":"ref.cjs","sources":["../../src/updates/ref.ts"],"sourcesContent":[null],"names":["$ref"],"mappings":";;;;AAIM,SAAU,GAAG,CAAC,aAAqB,EAAE,SAAgC,EAAA;IACzE,OAAO;AACL,QAAA,IAAI,EAAEA,0BAAI;AACV,QAAA,EAAE,EAAE,aAAa;AACjB,QAAA,OAAO,EAAE,SAAS;KACnB;AACH;;;;"}
1
+ {"version":3,"file":"ref.cjs","sources":["../../src/updates/ref.ts"],"sourcesContent":[null],"names":["$ref"],"mappings":";;;;AAIA;;;;;AAKG;AACG,SAAU,GAAG,CAAC,aAAqB,EAAE,SAAgC,EAAA;IACzE,OAAO;AACL,QAAA,IAAI,EAAEA,0BAAI;AACV,QAAA,EAAE,EAAE,aAAa;AACjB,QAAA,OAAO,EAAE,SAAS;KACnB;AACH;;;;"}
@@ -1,6 +1,12 @@
1
- import { ValueReference } from './update-types.js';
1
+ import { ValueReference } from './index.js';
2
2
  import { NativeAttributeValue } from '@aws-sdk/lib-dynamodb';
3
3
 
4
+ /**
5
+ * Creates a reference to another attribute's value.
6
+ *
7
+ * @param attributePath - The path of the attribute to reference.
8
+ * @param defaultTo - An optional default value if the referenced attribute does not exist.
9
+ */
4
10
  declare function ref(attributePath: string, defaultTo?: NativeAttributeValue): ValueReference;
5
11
 
6
12
  export { ref };
@@ -1,5 +1,11 @@
1
1
  import { $ref } from './update-symbols.mjs';
2
2
 
3
+ /**
4
+ * Creates a reference to another attribute's value.
5
+ *
6
+ * @param attributePath - The path of the attribute to reference.
7
+ * @param defaultTo - An optional default value if the referenced attribute does not exist.
8
+ */
3
9
  function ref(attributePath, defaultTo) {
4
10
  return {
5
11
  type: $ref,
@@ -1 +1 @@
1
- {"version":3,"file":"ref.mjs","sources":["../../src/updates/ref.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIM,SAAU,GAAG,CAAC,aAAqB,EAAE,SAAgC,EAAA;IACzE,OAAO;AACL,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,EAAE,EAAE,aAAa;AACjB,QAAA,OAAO,EAAE,SAAS;KACnB;AACH;;;;"}
1
+ {"version":3,"file":"ref.mjs","sources":["../../src/updates/ref.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIA;;;;;AAKG;AACG,SAAU,GAAG,CAAC,aAAqB,EAAE,SAAgC,EAAA;IACzE,OAAO;AACL,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,EAAE,EAAE,aAAa;AACjB,QAAA,OAAO,EAAE,SAAS;KACnB;AACH;;;;"}
@@ -2,6 +2,11 @@
2
2
 
3
3
  var updates_updateSymbols = require('./update-symbols.cjs');
4
4
 
5
+ /**
6
+ * Update function to remove values from a set attribute.
7
+ *
8
+ * @param values - The values or reference to remove.
9
+ */
5
10
  function removeFromSet(values) {
6
11
  return {
7
12
  type: updates_updateSymbols.$delete,
@@ -1 +1 @@
1
- {"version":3,"file":"remove-from-set.cjs","sources":["../../src/updates/remove-from-set.ts"],"sourcesContent":[null],"names":["$delete"],"mappings":";;;;AAIM,SAAU,aAAa,CAAC,MAA+C,EAAA;IAC3E,OAAO;AACL,QAAA,IAAI,EAAEA,6BAAO;QACb,MAAM;KACP;AACH;;;;"}
1
+ {"version":3,"file":"remove-from-set.cjs","sources":["../../src/updates/remove-from-set.ts"],"sourcesContent":[null],"names":["$delete"],"mappings":";;;;AAIA;;;;AAIG;AACG,SAAU,aAAa,CAAC,MAA+C,EAAA;IAC3E,OAAO;AACL,QAAA,IAAI,EAAEA,6BAAO;QACb,MAAM;KACP;AACH;;;;"}
@@ -1,6 +1,11 @@
1
1
  import { NativeAttributeValue } from '@aws-sdk/lib-dynamodb';
2
- import { ValueReference, DeleteExpression } from './update-types.js';
2
+ import { ValueReference, DeleteExpression } from './index.js';
3
3
 
4
+ /**
5
+ * Update function to remove values from a set attribute.
6
+ *
7
+ * @param values - The values or reference to remove.
8
+ */
4
9
  declare function removeFromSet(values: NativeAttributeValue[] | ValueReference): DeleteExpression;
5
10
 
6
11
  export { removeFromSet };
@@ -1,5 +1,10 @@
1
1
  import { $delete } from './update-symbols.mjs';
2
2
 
3
+ /**
4
+ * Update function to remove values from a set attribute.
5
+ *
6
+ * @param values - The values or reference to remove.
7
+ */
3
8
  function removeFromSet(values) {
4
9
  return {
5
10
  type: $delete,
@@ -1 +1 @@
1
- {"version":3,"file":"remove-from-set.mjs","sources":["../../src/updates/remove-from-set.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIM,SAAU,aAAa,CAAC,MAA+C,EAAA;IAC3E,OAAO;AACL,QAAA,IAAI,EAAE,OAAO;QACb,MAAM;KACP;AACH;;;;"}
1
+ {"version":3,"file":"remove-from-set.mjs","sources":["../../src/updates/remove-from-set.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIA;;;;AAIG;AACG,SAAU,aAAa,CAAC,MAA+C,EAAA;IAC3E,OAAO;AACL,QAAA,IAAI,EAAE,OAAO;QACb,MAAM;KACP;AACH;;;;"}