dynamo-document-builder 0.5.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 (288) 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 +77 -6
  188. package/dist/core/entity.cjs.map +1 -1
  189. package/dist/core/entity.d.ts +81 -6
  190. package/dist/core/entity.mjs +77 -6
  191. package/dist/core/entity.mjs.map +1 -1
  192. package/dist/core/index.cjs +1 -0
  193. package/dist/core/index.cjs.map +1 -1
  194. package/dist/core/index.d.ts +140 -3
  195. package/dist/core/index.mjs +1 -1
  196. package/dist/core/key.cjs +48 -0
  197. package/dist/core/key.cjs.map +1 -1
  198. package/dist/core/key.d.ts +66 -6
  199. package/dist/core/key.mjs +48 -1
  200. package/dist/core/key.mjs.map +1 -1
  201. package/dist/core/table.cjs +22 -0
  202. package/dist/core/table.cjs.map +1 -1
  203. package/dist/core/table.d.ts +35 -1
  204. package/dist/core/table.mjs +22 -0
  205. package/dist/core/table.mjs.map +1 -1
  206. package/dist/errors.cjs +3 -0
  207. package/dist/errors.cjs.map +1 -1
  208. package/dist/errors.d.ts +3 -0
  209. package/dist/errors.mjs +3 -0
  210. package/dist/errors.mjs.map +1 -1
  211. package/dist/index.cjs +5 -4
  212. package/dist/index.cjs.map +1 -1
  213. package/dist/index.d.ts +8 -8
  214. package/dist/index.mjs +3 -3
  215. package/dist/projections/index.d.ts +7 -1
  216. package/dist/projections/projection-parser.d.ts +1 -1
  217. package/dist/updates/add-to-set.cjs +5 -0
  218. package/dist/updates/add-to-set.cjs.map +1 -1
  219. package/dist/updates/add-to-set.d.ts +6 -1
  220. package/dist/updates/add-to-set.mjs +5 -0
  221. package/dist/updates/add-to-set.mjs.map +1 -1
  222. package/dist/updates/add.cjs +5 -0
  223. package/dist/updates/add.cjs.map +1 -1
  224. package/dist/updates/add.d.ts +6 -1
  225. package/dist/updates/add.mjs +5 -0
  226. package/dist/updates/add.mjs.map +1 -1
  227. package/dist/updates/append.cjs +5 -0
  228. package/dist/updates/append.cjs.map +1 -1
  229. package/dist/updates/append.d.ts +6 -1
  230. package/dist/updates/append.mjs +5 -0
  231. package/dist/updates/append.mjs.map +1 -1
  232. package/dist/updates/index.d.ts +78 -1
  233. package/dist/updates/prepend.cjs +5 -0
  234. package/dist/updates/prepend.cjs.map +1 -1
  235. package/dist/updates/prepend.d.ts +6 -1
  236. package/dist/updates/prepend.mjs +5 -0
  237. package/dist/updates/prepend.mjs.map +1 -1
  238. package/dist/updates/ref.cjs +6 -0
  239. package/dist/updates/ref.cjs.map +1 -1
  240. package/dist/updates/ref.d.ts +7 -1
  241. package/dist/updates/ref.mjs +6 -0
  242. package/dist/updates/ref.mjs.map +1 -1
  243. package/dist/updates/remove-from-set.cjs +5 -0
  244. package/dist/updates/remove-from-set.cjs.map +1 -1
  245. package/dist/updates/remove-from-set.d.ts +6 -1
  246. package/dist/updates/remove-from-set.mjs +5 -0
  247. package/dist/updates/remove-from-set.mjs.map +1 -1
  248. package/dist/updates/remove.cjs +3 -0
  249. package/dist/updates/remove.cjs.map +1 -1
  250. package/dist/updates/remove.d.ts +4 -1
  251. package/dist/updates/remove.mjs +3 -0
  252. package/dist/updates/remove.mjs.map +1 -1
  253. package/dist/updates/subtract.cjs +5 -0
  254. package/dist/updates/subtract.cjs.map +1 -1
  255. package/dist/updates/subtract.d.ts +6 -1
  256. package/dist/updates/subtract.mjs +5 -0
  257. package/dist/updates/subtract.mjs.map +1 -1
  258. package/dist/updates/update-parser.cjs +10 -0
  259. package/dist/updates/update-parser.cjs.map +1 -1
  260. package/dist/updates/update-parser.d.ts +17 -1
  261. package/dist/updates/update-parser.mjs +10 -0
  262. package/dist/updates/update-parser.mjs.map +1 -1
  263. package/package.json +2 -1
  264. package/dist/commands/base-command.cjs +0 -3
  265. package/dist/commands/base-command.cjs.map +0 -1
  266. package/dist/commands/base-command.d.ts +0 -27
  267. package/dist/commands/base-command.mjs +0 -2
  268. package/dist/commands/base-command.mjs.map +0 -1
  269. package/dist/conditions/condition-types.cjs +0 -3
  270. package/dist/conditions/condition-types.cjs.map +0 -1
  271. package/dist/conditions/condition-types.d.ts +0 -95
  272. package/dist/conditions/condition-types.mjs +0 -2
  273. package/dist/conditions/condition-types.mjs.map +0 -1
  274. package/dist/core/core-types.cjs +0 -3
  275. package/dist/core/core-types.cjs.map +0 -1
  276. package/dist/core/core-types.d.ts +0 -44
  277. package/dist/core/core-types.mjs +0 -2
  278. package/dist/core/core-types.mjs.map +0 -1
  279. package/dist/projections/projection-types.cjs +0 -3
  280. package/dist/projections/projection-types.cjs.map +0 -1
  281. package/dist/projections/projection-types.d.ts +0 -3
  282. package/dist/projections/projection-types.mjs +0 -2
  283. package/dist/projections/projection-types.mjs.map +0 -1
  284. package/dist/updates/update-types.cjs +0 -3
  285. package/dist/updates/update-types.cjs.map +0 -1
  286. package/dist/updates/update-types.d.ts +0 -45
  287. package/dist/updates/update-types.mjs +0 -2
  288. package/dist/updates/update-types.mjs.map +0 -1
package/dist/core/key.cjs CHANGED
@@ -1,8 +1,56 @@
1
1
  'use strict';
2
2
 
3
+ var errors = require('../errors.cjs');
4
+
5
+ /**
6
+ * Builds a DynamoDB key from the given parts by concatenating them with a `#` separator.
7
+ * At least one part must be provided, or a DocumentBuilderError will be thrown.
8
+ *
9
+ * @param parts - The parts to combine into a key.
10
+ * @returns The combined key as a string.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const key1 = key('USER', 123) // 'USER#123'
15
+ * const key2 = key('METADATA') // 'METADATA'
16
+ * ```
17
+ */
3
18
  function key(...parts) {
19
+ if (!parts.length) {
20
+ throw new errors.DocumentBuilderError('At least one key part must be provided');
21
+ }
4
22
  return parts.join('#');
5
23
  }
24
+ /**
25
+ * Builds a DynamoDB key from the given parts. This function is specifically for secondary index keys,
26
+ * where any part can be undefined. If any part is undefined, the function returns undefined.
27
+ *
28
+ * For primary keys, use the `key` function instead.
29
+ *
30
+ * This is specifically useful for building keys for queries on secondary indexes, or for sparse indexes.
31
+ *
32
+ * @param parts - The parts to combine into a key.
33
+ * @returns The combined key as a string, or undefined if any part is undefined.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const key1 = indexKey('part1', 'part2', 'part3') // 'part1#part2#part3'
38
+ * const key2 = indexKey('part1', undefined, 'part3') // undefined
39
+ * const key3 = indexKey(undefined, 'part2', 'part3') // undefined
40
+ * const key4 = indexKey('part1', 'part2', undefined) // undefined
41
+ * ```
42
+ */
43
+ function indexKey(...parts) {
44
+ let key = '';
45
+ for (const part of parts) {
46
+ if (part === undefined) {
47
+ return undefined;
48
+ }
49
+ key += key ? `#${part}` : part;
50
+ }
51
+ return key;
52
+ }
6
53
 
54
+ exports.indexKey = indexKey;
7
55
  exports.key = key;
8
56
  //# sourceMappingURL=key.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"key.cjs","sources":["../../src/core/key.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAsBM,SAAU,GAAG,CAAC,GAAG,KAA2B,EAAA;AAChD,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AACxB;;;;"}
1
+ {"version":3,"file":"key.cjs","sources":["../../src/core/key.ts"],"sourcesContent":[null],"names":["DocumentBuilderError"],"mappings":";;;;AAsDA;;;;;;;;;;;;AAYG;AACG,SAAU,GAAG,CAAC,GAAG,KAA2B,EAAA;AAChD,IAAA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;AACjB,QAAA,MAAM,IAAIA,2BAAoB,CAAC,wCAAwC,CAAC;IAC1E;AACA,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AACxB;AAEA;;;;;;;;;;;;;;;;;;AAkBG;AACG,SAAU,QAAQ,CAAC,GAAG,KAAgC,EAAA;IAC1D,IAAI,GAAG,GAAW,EAAE;AACpB,IAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AACxB,QAAA,IAAI,IAAI,KAAK,SAAS,EAAE;AACtB,YAAA,OAAO,SAAS;QAClB;AACA,QAAA,GAAG,IAAI,GAAG,GAAG,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,GAAG,IAAI;IAChC;AACA,IAAA,OAAO,GAAG;AACZ;;;;;"}
@@ -1,16 +1,76 @@
1
- import { IndexName } from './core-types.js';
1
+ import { IndexName } from './index.js';
2
2
 
3
+ /**
4
+ * Represents a value that can be used as a DynamoDB primary key.
5
+ */
3
6
  type DynamoKeyableValue = string | number | Buffer;
7
+ /**
8
+ * Represents a value that can be used as a DynamoDB secondary index key.
9
+ */
10
+ type DynamoIndexKeyableValue = string | number | Buffer | undefined;
11
+ /**
12
+ * A function that builds a DynamoDB primary key from an item.
13
+ */
4
14
  type DynamoKeyBuilder<Item> = (item: Item) => DynamoKeyableValue;
15
+ /**
16
+ * A function that builds a DynamoDB secondary index key from an item.
17
+ */
18
+ type DynamoIndexKeyBuilder<Item> = (item: Item) => DynamoIndexKeyableValue;
19
+ /**
20
+ * A mapping type of global secondary index names to their key builders.
21
+ */
5
22
  type GlobalSecondaryIndexKeyBuilders<Item> = Record<IndexName, {
6
- partitionKey: DynamoKeyBuilder<Item>;
7
- sortKey?: DynamoKeyBuilder<Item>;
23
+ partitionKey: DynamoIndexKeyBuilder<Item>;
24
+ sortKey?: DynamoIndexKeyBuilder<Item>;
8
25
  }>;
26
+ /**
27
+ * A mapping type of local secondary index names to their key builders.
28
+ */
9
29
  type LocalSecondaryIndexKeyBuilders<Item> = Record<IndexName, {
10
- sortKey: DynamoKeyBuilder<Item>;
30
+ sortKey: DynamoIndexKeyBuilder<Item>;
11
31
  }>;
32
+ /**
33
+ * Record type representing a DynamoDB primary key.
34
+ */
12
35
  type DynamoKey = Record<string, DynamoKeyableValue>;
36
+ /**
37
+ * Record type representing a DynamoDB secondary index key.
38
+ */
39
+ type DynamoIndexKey = Record<string, DynamoIndexKeyableValue>;
40
+ /**
41
+ * Builds a DynamoDB key from the given parts by concatenating them with a `#` separator.
42
+ * At least one part must be provided, or a DocumentBuilderError will be thrown.
43
+ *
44
+ * @param parts - The parts to combine into a key.
45
+ * @returns The combined key as a string.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const key1 = key('USER', 123) // 'USER#123'
50
+ * const key2 = key('METADATA') // 'METADATA'
51
+ * ```
52
+ */
13
53
  declare function key(...parts: DynamoKeyableValue[]): string;
54
+ /**
55
+ * Builds a DynamoDB key from the given parts. This function is specifically for secondary index keys,
56
+ * where any part can be undefined. If any part is undefined, the function returns undefined.
57
+ *
58
+ * For primary keys, use the `key` function instead.
59
+ *
60
+ * This is specifically useful for building keys for queries on secondary indexes, or for sparse indexes.
61
+ *
62
+ * @param parts - The parts to combine into a key.
63
+ * @returns The combined key as a string, or undefined if any part is undefined.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * const key1 = indexKey('part1', 'part2', 'part3') // 'part1#part2#part3'
68
+ * const key2 = indexKey('part1', undefined, 'part3') // undefined
69
+ * const key3 = indexKey(undefined, 'part2', 'part3') // undefined
70
+ * const key4 = indexKey('part1', 'part2', undefined) // undefined
71
+ * ```
72
+ */
73
+ declare function indexKey(...parts: DynamoIndexKeyableValue[]): string | undefined;
14
74
 
15
- export { key };
16
- export type { DynamoKey, DynamoKeyBuilder, DynamoKeyableValue, GlobalSecondaryIndexKeyBuilders, LocalSecondaryIndexKeyBuilders };
75
+ export { indexKey, key };
76
+ export type { DynamoIndexKey, DynamoIndexKeyBuilder, DynamoIndexKeyableValue, DynamoKey, DynamoKeyBuilder, DynamoKeyableValue, GlobalSecondaryIndexKeyBuilders, LocalSecondaryIndexKeyBuilders };
package/dist/core/key.mjs CHANGED
@@ -1,6 +1,53 @@
1
+ import { DocumentBuilderError } from '../errors.mjs';
2
+
3
+ /**
4
+ * Builds a DynamoDB key from the given parts by concatenating them with a `#` separator.
5
+ * At least one part must be provided, or a DocumentBuilderError will be thrown.
6
+ *
7
+ * @param parts - The parts to combine into a key.
8
+ * @returns The combined key as a string.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const key1 = key('USER', 123) // 'USER#123'
13
+ * const key2 = key('METADATA') // 'METADATA'
14
+ * ```
15
+ */
1
16
  function key(...parts) {
17
+ if (!parts.length) {
18
+ throw new DocumentBuilderError('At least one key part must be provided');
19
+ }
2
20
  return parts.join('#');
3
21
  }
22
+ /**
23
+ * Builds a DynamoDB key from the given parts. This function is specifically for secondary index keys,
24
+ * where any part can be undefined. If any part is undefined, the function returns undefined.
25
+ *
26
+ * For primary keys, use the `key` function instead.
27
+ *
28
+ * This is specifically useful for building keys for queries on secondary indexes, or for sparse indexes.
29
+ *
30
+ * @param parts - The parts to combine into a key.
31
+ * @returns The combined key as a string, or undefined if any part is undefined.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const key1 = indexKey('part1', 'part2', 'part3') // 'part1#part2#part3'
36
+ * const key2 = indexKey('part1', undefined, 'part3') // undefined
37
+ * const key3 = indexKey(undefined, 'part2', 'part3') // undefined
38
+ * const key4 = indexKey('part1', 'part2', undefined) // undefined
39
+ * ```
40
+ */
41
+ function indexKey(...parts) {
42
+ let key = '';
43
+ for (const part of parts) {
44
+ if (part === undefined) {
45
+ return undefined;
46
+ }
47
+ key += key ? `#${part}` : part;
48
+ }
49
+ return key;
50
+ }
4
51
 
5
- export { key };
52
+ export { indexKey, key };
6
53
  //# sourceMappingURL=key.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"key.mjs","sources":["../../src/core/key.ts"],"sourcesContent":[null],"names":[],"mappings":"AAsBM,SAAU,GAAG,CAAC,GAAG,KAA2B,EAAA;AAChD,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AACxB;;;;"}
1
+ {"version":3,"file":"key.mjs","sources":["../../src/core/key.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAsDA;;;;;;;;;;;;AAYG;AACG,SAAU,GAAG,CAAC,GAAG,KAA2B,EAAA;AAChD,IAAA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;AACjB,QAAA,MAAM,IAAI,oBAAoB,CAAC,wCAAwC,CAAC;IAC1E;AACA,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AACxB;AAEA;;;;;;;;;;;;;;;;;;AAkBG;AACG,SAAU,QAAQ,CAAC,GAAG,KAAgC,EAAA;IAC1D,IAAI,GAAG,GAAW,EAAE;AACpB,IAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AACxB,QAAA,IAAI,IAAI,KAAK,SAAS,EAAE;AACtB,YAAA,OAAO,SAAS;QAClB;AACA,QAAA,GAAG,IAAI,GAAG,GAAG,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,GAAG,IAAI;IAChC;AACA,IAAA,OAAO,GAAG;AACZ;;;;"}
@@ -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,QAAAA,gCAAA,CAAA,IAAI,EAAA,gBAAA,EAAQ,CAAA,EAAA,GAAA,CAAA,EAAA,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AAA,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;AAEA,QAAA,eAAA,CAAA,GAAA,CAAA,IAAA,EAAc,IAAI,CAAA;AAClB,QAAA,eAA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AAI;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;
@@ -92,9 +93,9 @@ exports.or = conditions_or.or;
92
93
  exports.size = conditions_size.size;
93
94
  exports.typeIs = conditions_typeIs.typeIs;
94
95
  exports.DynamoEntity = core_entity.DynamoEntity;
96
+ exports.indexKey = core_key.indexKey;
95
97
  exports.key = core_key.key;
96
98
  exports.DynamoTable = core_table.DynamoTable;
97
- exports.DocumentBuilderError = errors.DocumentBuilderError;
98
99
  exports.parseProjection = projections_projectionParser.parseProjection;
99
100
  exports.parseUpdate = updates_updateParser.parseUpdate;
100
101
  exports.ref = updates_ref.ref;
@@ -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, 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
- export { DynamoKey, DynamoKeyBuilder, DynamoKeyableValue, GlobalSecondaryIndexKeyBuilders, LocalSecondaryIndexKeyBuilders, key } from './core/key.js';
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';
@@ -36,9 +37,8 @@ export { or } from './conditions/or.mjs';
36
37
  export { size } from './conditions/size.mjs';
37
38
  export { typeIs } from './conditions/type-is.mjs';
38
39
  export { DynamoEntity } from './core/entity.mjs';
39
- export { key } from './core/key.mjs';
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,