dyna-record 0.6.7 → 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 (244) hide show
  1. package/README.md +23 -7
  2. package/dist/index.d.ts +12 -2
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +13 -22
  5. package/dist/src/DynaRecord.d.ts +3 -3
  6. package/dist/src/DynaRecord.d.ts.map +1 -1
  7. package/dist/src/DynaRecord.js +24 -59
  8. package/dist/src/Logger.js +1 -3
  9. package/dist/src/decorators/Entity.d.ts +1 -1
  10. package/dist/src/decorators/Entity.d.ts.map +1 -1
  11. package/dist/src/decorators/Entity.js +3 -8
  12. package/dist/src/decorators/Table.d.ts +2 -2
  13. package/dist/src/decorators/Table.d.ts.map +1 -1
  14. package/dist/src/decorators/Table.js +3 -8
  15. package/dist/src/decorators/attributes/BooleanAttribute.d.ts +2 -2
  16. package/dist/src/decorators/attributes/BooleanAttribute.d.ts.map +1 -1
  17. package/dist/src/decorators/attributes/BooleanAttribute.js +5 -10
  18. package/dist/src/decorators/attributes/DateAttribute.d.ts +2 -2
  19. package/dist/src/decorators/attributes/DateAttribute.d.ts.map +1 -1
  20. package/dist/src/decorators/attributes/DateAttribute.js +7 -12
  21. package/dist/src/decorators/attributes/EnumAttribute.d.ts +2 -2
  22. package/dist/src/decorators/attributes/EnumAttribute.d.ts.map +1 -1
  23. package/dist/src/decorators/attributes/EnumAttribute.js +5 -10
  24. package/dist/src/decorators/attributes/ForeignKeyAttribute.d.ts +3 -3
  25. package/dist/src/decorators/attributes/ForeignKeyAttribute.d.ts.map +1 -1
  26. package/dist/src/decorators/attributes/ForeignKeyAttribute.js +5 -10
  27. package/dist/src/decorators/attributes/IdAttribute.d.ts +1 -1
  28. package/dist/src/decorators/attributes/IdAttribute.d.ts.map +1 -1
  29. package/dist/src/decorators/attributes/IdAttribute.js +3 -8
  30. package/dist/src/decorators/attributes/NumberAttribute.d.ts +2 -2
  31. package/dist/src/decorators/attributes/NumberAttribute.d.ts.map +1 -1
  32. package/dist/src/decorators/attributes/NumberAttribute.js +5 -10
  33. package/dist/src/decorators/attributes/ObjectAttribute.d.ts +3 -3
  34. package/dist/src/decorators/attributes/ObjectAttribute.d.ts.map +1 -1
  35. package/dist/src/decorators/attributes/ObjectAttribute.js +16 -21
  36. package/dist/src/decorators/attributes/PartitionKeyAttribute.d.ts +3 -3
  37. package/dist/src/decorators/attributes/PartitionKeyAttribute.d.ts.map +1 -1
  38. package/dist/src/decorators/attributes/PartitionKeyAttribute.js +5 -10
  39. package/dist/src/decorators/attributes/SortKeyAttribute.d.ts +3 -3
  40. package/dist/src/decorators/attributes/SortKeyAttribute.d.ts.map +1 -1
  41. package/dist/src/decorators/attributes/SortKeyAttribute.js +5 -10
  42. package/dist/src/decorators/attributes/StringAttribute.d.ts +2 -2
  43. package/dist/src/decorators/attributes/StringAttribute.d.ts.map +1 -1
  44. package/dist/src/decorators/attributes/StringAttribute.js +5 -10
  45. package/dist/src/decorators/attributes/index.d.ts +13 -13
  46. package/dist/src/decorators/attributes/index.d.ts.map +1 -1
  47. package/dist/src/decorators/attributes/index.js +11 -41
  48. package/dist/src/decorators/attributes/serializers.d.ts +2 -2
  49. package/dist/src/decorators/attributes/serializers.d.ts.map +1 -1
  50. package/dist/src/decorators/attributes/serializers.js +5 -12
  51. package/dist/src/decorators/attributes/types.js +1 -2
  52. package/dist/src/decorators/index.d.ts +5 -5
  53. package/dist/src/decorators/index.d.ts.map +1 -1
  54. package/dist/src/decorators/index.js +5 -27
  55. package/dist/src/decorators/relationships/BelongsTo.d.ts +4 -4
  56. package/dist/src/decorators/relationships/BelongsTo.d.ts.map +1 -1
  57. package/dist/src/decorators/relationships/BelongsTo.js +3 -8
  58. package/dist/src/decorators/relationships/HasAndBelongsToMany.d.ts +3 -3
  59. package/dist/src/decorators/relationships/HasAndBelongsToMany.d.ts.map +1 -1
  60. package/dist/src/decorators/relationships/HasAndBelongsToMany.js +4 -9
  61. package/dist/src/decorators/relationships/HasMany.d.ts +3 -3
  62. package/dist/src/decorators/relationships/HasMany.d.ts.map +1 -1
  63. package/dist/src/decorators/relationships/HasMany.js +4 -9
  64. package/dist/src/decorators/relationships/HasOne.d.ts +3 -3
  65. package/dist/src/decorators/relationships/HasOne.d.ts.map +1 -1
  66. package/dist/src/decorators/relationships/HasOne.js +3 -8
  67. package/dist/src/decorators/relationships/index.d.ts +5 -5
  68. package/dist/src/decorators/relationships/index.d.ts.map +1 -1
  69. package/dist/src/decorators/relationships/index.js +5 -29
  70. package/dist/src/decorators/relationships/types.d.ts +3 -3
  71. package/dist/src/decorators/relationships/types.d.ts.map +1 -1
  72. package/dist/src/decorators/relationships/types.js +1 -2
  73. package/dist/src/decorators/types.d.ts +3 -3
  74. package/dist/src/decorators/types.d.ts.map +1 -1
  75. package/dist/src/decorators/types.js +1 -2
  76. package/dist/src/dynamo-utils/DynamoClient.d.ts +1 -1
  77. package/dist/src/dynamo-utils/DynamoClient.d.ts.map +1 -1
  78. package/dist/src/dynamo-utils/DynamoClient.js +13 -18
  79. package/dist/src/dynamo-utils/TransactGetBuilder.d.ts +1 -1
  80. package/dist/src/dynamo-utils/TransactGetBuilder.d.ts.map +1 -1
  81. package/dist/src/dynamo-utils/TransactGetBuilder.js +5 -10
  82. package/dist/src/dynamo-utils/TransactWriteBuilder.d.ts +1 -1
  83. package/dist/src/dynamo-utils/TransactWriteBuilder.d.ts.map +1 -1
  84. package/dist/src/dynamo-utils/TransactWriteBuilder.js +11 -16
  85. package/dist/src/dynamo-utils/errors.js +2 -7
  86. package/dist/src/dynamo-utils/index.d.ts +7 -7
  87. package/dist/src/dynamo-utils/index.d.ts.map +1 -1
  88. package/dist/src/dynamo-utils/index.js +7 -30
  89. package/dist/src/dynamo-utils/types.js +1 -2
  90. package/dist/src/errors.js +3 -9
  91. package/dist/src/id.d.ts +12 -0
  92. package/dist/src/id.d.ts.map +1 -0
  93. package/dist/src/id.js +11 -0
  94. package/dist/src/index.d.ts +8 -8
  95. package/dist/src/index.d.ts.map +1 -1
  96. package/dist/src/index.js +4 -20
  97. package/dist/src/metadata/AttributeMetadata.d.ts +4 -4
  98. package/dist/src/metadata/AttributeMetadata.d.ts.map +1 -1
  99. package/dist/src/metadata/AttributeMetadata.js +1 -3
  100. package/dist/src/metadata/EntityMetadata.d.ts +3 -3
  101. package/dist/src/metadata/EntityMetadata.d.ts.map +1 -1
  102. package/dist/src/metadata/EntityMetadata.js +18 -23
  103. package/dist/src/metadata/JoinTableMetadata.d.ts +3 -3
  104. package/dist/src/metadata/JoinTableMetadata.d.ts.map +1 -1
  105. package/dist/src/metadata/JoinTableMetadata.js +1 -3
  106. package/dist/src/metadata/MetadataStorage.d.ts +7 -7
  107. package/dist/src/metadata/MetadataStorage.d.ts.map +1 -1
  108. package/dist/src/metadata/MetadataStorage.js +12 -17
  109. package/dist/src/metadata/TableMetadata.d.ts +3 -3
  110. package/dist/src/metadata/TableMetadata.d.ts.map +1 -1
  111. package/dist/src/metadata/TableMetadata.js +17 -20
  112. package/dist/src/metadata/index.d.ts +9 -9
  113. package/dist/src/metadata/index.d.ts.map +1 -1
  114. package/dist/src/metadata/index.js +11 -34
  115. package/dist/src/metadata/relationship-metadata/BelongsToRelationship.d.ts +2 -2
  116. package/dist/src/metadata/relationship-metadata/BelongsToRelationship.d.ts.map +1 -1
  117. package/dist/src/metadata/relationship-metadata/BelongsToRelationship.js +3 -8
  118. package/dist/src/metadata/relationship-metadata/HasAndBelongsToManyRelationship.d.ts +1 -1
  119. package/dist/src/metadata/relationship-metadata/HasAndBelongsToManyRelationship.d.ts.map +1 -1
  120. package/dist/src/metadata/relationship-metadata/HasAndBelongsToManyRelationship.js +3 -8
  121. package/dist/src/metadata/relationship-metadata/HasManyRelationship.d.ts +2 -2
  122. package/dist/src/metadata/relationship-metadata/HasManyRelationship.d.ts.map +1 -1
  123. package/dist/src/metadata/relationship-metadata/HasManyRelationship.js +3 -8
  124. package/dist/src/metadata/relationship-metadata/HasOneRelationship.d.ts +2 -2
  125. package/dist/src/metadata/relationship-metadata/HasOneRelationship.d.ts.map +1 -1
  126. package/dist/src/metadata/relationship-metadata/HasOneRelationship.js +3 -8
  127. package/dist/src/metadata/relationship-metadata/OwnedByRelationship.d.ts +2 -2
  128. package/dist/src/metadata/relationship-metadata/OwnedByRelationship.d.ts.map +1 -1
  129. package/dist/src/metadata/relationship-metadata/OwnedByRelationship.js +3 -8
  130. package/dist/src/metadata/relationship-metadata/RelationshipMetadata.d.ts +2 -2
  131. package/dist/src/metadata/relationship-metadata/RelationshipMetadata.d.ts.map +1 -1
  132. package/dist/src/metadata/relationship-metadata/RelationshipMetadata.js +1 -3
  133. package/dist/src/metadata/relationship-metadata/index.d.ts +6 -6
  134. package/dist/src/metadata/relationship-metadata/index.d.ts.map +1 -1
  135. package/dist/src/metadata/relationship-metadata/index.js +7 -31
  136. package/dist/src/metadata/relationship-metadata/types.d.ts +5 -5
  137. package/dist/src/metadata/relationship-metadata/types.d.ts.map +1 -1
  138. package/dist/src/metadata/relationship-metadata/types.js +1 -2
  139. package/dist/src/metadata/relationship-metadata/utils.d.ts +1 -1
  140. package/dist/src/metadata/relationship-metadata/utils.d.ts.map +1 -1
  141. package/dist/src/metadata/relationship-metadata/utils.js +11 -18
  142. package/dist/src/metadata/schemas.d.ts +3 -3
  143. package/dist/src/metadata/schemas.d.ts.map +1 -1
  144. package/dist/src/metadata/schemas.js +34 -37
  145. package/dist/src/metadata/types.d.ts +4 -4
  146. package/dist/src/metadata/types.d.ts.map +1 -1
  147. package/dist/src/metadata/types.js +1 -2
  148. package/dist/src/metadata/utils.d.ts +5 -5
  149. package/dist/src/metadata/utils.d.ts.map +1 -1
  150. package/dist/src/metadata/utils.js +14 -29
  151. package/dist/src/operations/Create/Create.d.ts +5 -5
  152. package/dist/src/operations/Create/Create.d.ts.map +1 -1
  153. package/dist/src/operations/Create/Create.js +18 -23
  154. package/dist/src/operations/Create/index.d.ts +2 -2
  155. package/dist/src/operations/Create/index.d.ts.map +1 -1
  156. package/dist/src/operations/Create/index.js +2 -23
  157. package/dist/src/operations/Create/types.d.ts +2 -2
  158. package/dist/src/operations/Create/types.d.ts.map +1 -1
  159. package/dist/src/operations/Create/types.js +1 -2
  160. package/dist/src/operations/Delete/Delete.d.ts +3 -3
  161. package/dist/src/operations/Delete/Delete.d.ts.map +1 -1
  162. package/dist/src/operations/Delete/Delete.js +28 -33
  163. package/dist/src/operations/Delete/index.d.ts +1 -1
  164. package/dist/src/operations/Delete/index.d.ts.map +1 -1
  165. package/dist/src/operations/Delete/index.js +1 -8
  166. package/dist/src/operations/Delete/types.js +1 -2
  167. package/dist/src/operations/FindById/FindById.d.ts +4 -4
  168. package/dist/src/operations/FindById/FindById.d.ts.map +1 -1
  169. package/dist/src/operations/FindById/FindById.js +17 -22
  170. package/dist/src/operations/FindById/index.d.ts +2 -2
  171. package/dist/src/operations/FindById/index.d.ts.map +1 -1
  172. package/dist/src/operations/FindById/index.js +2 -23
  173. package/dist/src/operations/FindById/types.d.ts +3 -3
  174. package/dist/src/operations/FindById/types.d.ts.map +1 -1
  175. package/dist/src/operations/FindById/types.js +1 -2
  176. package/dist/src/operations/OperationBase.d.ts +3 -3
  177. package/dist/src/operations/OperationBase.d.ts.map +1 -1
  178. package/dist/src/operations/OperationBase.js +4 -9
  179. package/dist/src/operations/Query/Query.d.ts +4 -4
  180. package/dist/src/operations/Query/Query.d.ts.map +1 -1
  181. package/dist/src/operations/Query/Query.js +15 -20
  182. package/dist/src/operations/Query/index.d.ts +2 -2
  183. package/dist/src/operations/Query/index.d.ts.map +1 -1
  184. package/dist/src/operations/Query/index.js +2 -23
  185. package/dist/src/operations/Query/types.d.ts +4 -4
  186. package/dist/src/operations/Query/types.d.ts.map +1 -1
  187. package/dist/src/operations/Query/types.js +1 -2
  188. package/dist/src/operations/Update/Update.d.ts +5 -5
  189. package/dist/src/operations/Update/Update.d.ts.map +1 -1
  190. package/dist/src/operations/Update/Update.js +37 -42
  191. package/dist/src/operations/Update/UpdateDryRun.d.ts +2 -2
  192. package/dist/src/operations/Update/UpdateDryRun.d.ts.map +1 -1
  193. package/dist/src/operations/Update/UpdateDryRun.js +3 -8
  194. package/dist/src/operations/Update/index.d.ts +3 -3
  195. package/dist/src/operations/Update/index.d.ts.map +1 -1
  196. package/dist/src/operations/Update/index.js +3 -25
  197. package/dist/src/operations/Update/types.d.ts +2 -2
  198. package/dist/src/operations/Update/types.d.ts.map +1 -1
  199. package/dist/src/operations/Update/types.js +1 -2
  200. package/dist/src/operations/index.d.ts +6 -6
  201. package/dist/src/operations/index.d.ts.map +1 -1
  202. package/dist/src/operations/index.js +6 -22
  203. package/dist/src/operations/types.d.ts +3 -3
  204. package/dist/src/operations/types.d.ts.map +1 -1
  205. package/dist/src/operations/types.js +1 -2
  206. package/dist/src/operations/utils/expressionBuilder.d.ts +2 -2
  207. package/dist/src/operations/utils/expressionBuilder.d.ts.map +1 -1
  208. package/dist/src/operations/utils/expressionBuilder.js +1 -5
  209. package/dist/src/operations/utils/flattenObjectForUpdate.d.ts +2 -2
  210. package/dist/src/operations/utils/flattenObjectForUpdate.d.ts.map +1 -1
  211. package/dist/src/operations/utils/flattenObjectForUpdate.js +3 -6
  212. package/dist/src/operations/utils/index.d.ts +5 -5
  213. package/dist/src/operations/utils/index.d.ts.map +1 -1
  214. package/dist/src/operations/utils/index.js +5 -21
  215. package/dist/src/operations/utils/mergePartialObjectAttributes.d.ts +1 -1
  216. package/dist/src/operations/utils/mergePartialObjectAttributes.d.ts.map +1 -1
  217. package/dist/src/operations/utils/mergePartialObjectAttributes.js +1 -4
  218. package/dist/src/operations/utils/types.js +1 -2
  219. package/dist/src/operations/utils/utils.d.ts +4 -4
  220. package/dist/src/operations/utils/utils.d.ts.map +1 -1
  221. package/dist/src/operations/utils/utils.js +13 -23
  222. package/dist/src/query-utils/Filters.d.ts +2 -2
  223. package/dist/src/query-utils/Filters.d.ts.map +1 -1
  224. package/dist/src/query-utils/Filters.js +1 -4
  225. package/dist/src/query-utils/QueryBuilder.d.ts +1 -1
  226. package/dist/src/query-utils/QueryBuilder.d.ts.map +1 -1
  227. package/dist/src/query-utils/QueryBuilder.js +8 -13
  228. package/dist/src/query-utils/index.d.ts +2 -2
  229. package/dist/src/query-utils/index.d.ts.map +1 -1
  230. package/dist/src/query-utils/index.js +2 -23
  231. package/dist/src/query-utils/types.js +1 -2
  232. package/dist/src/relationships/JoinTable.d.ts +2 -2
  233. package/dist/src/relationships/JoinTable.d.ts.map +1 -1
  234. package/dist/src/relationships/JoinTable.js +14 -19
  235. package/dist/src/relationships/index.d.ts +1 -1
  236. package/dist/src/relationships/index.d.ts.map +1 -1
  237. package/dist/src/relationships/index.js +1 -8
  238. package/dist/src/types.d.ts +2 -2
  239. package/dist/src/types.d.ts.map +1 -1
  240. package/dist/src/types.js +1 -2
  241. package/dist/src/utils.d.ts +3 -3
  242. package/dist/src/utils.d.ts.map +1 -1
  243. package/dist/src/utils.js +16 -31
  244. package/package.json +28 -24
@@ -1,6 +1,6 @@
1
- import { type JoinTable } from "../../relationships";
2
- import type DynaRecord from "../../DynaRecord";
3
- import type { EntityClass } from "../../types";
1
+ import { type JoinTable } from "../../relationships/index.js";
2
+ import type DynaRecord from "../../DynaRecord.js";
3
+ import type { EntityClass } from "../../types.js";
4
4
  /**
5
5
  * The key on the related Entity which is associated with this Entity
6
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"HasAndBelongsToMany.d.ts","sourceRoot":"","sources":["../../../../src/decorators/relationships/HasAndBelongsToMany.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;GAEG;AACH,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC,IAAI;KACpB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAA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W,CAAC,CAAC,CAAC,EAC/B,KAAK,EAAE,wBAAwB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,IAEnC,QAAQ,SAAS,EAAE,SAAS,0BAA0B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,UAkBvE;AAED,eAAe,mBAAmB,CAAC"}
@@ -1,9 +1,4 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const metadata_1 = __importDefault(require("../../metadata"));
1
+ import Metadata from "../../metadata/index.js";
7
2
  /**
8
3
  * A decorator for defining a many-to-many relationship between entities in a single-table design ORM system. This relationship is facilitated through a join table, representing the connection between the two entities. The decorator simplifies the management of such relationships by automating the setup and handling of the join table metadata, thereby enabling seamless querying and manipulation of related entities.
9
4
  *
@@ -51,17 +46,17 @@ function HasAndBelongsToMany(getTarget, props) {
51
46
  context.addInitializer(function () {
52
47
  const target = getTarget();
53
48
  const { joinTable, foreignKey } = props.through();
54
- metadata_1.default.addEntityRelationship(this.constructor.name, {
49
+ Metadata.addEntityRelationship(this.constructor.name, {
55
50
  type: "HasAndBelongsToMany",
56
51
  propertyName: context.name,
57
52
  target,
58
53
  joinTableName: joinTable.name
59
54
  });
60
- metadata_1.default.addJoinTable(joinTable.name, {
55
+ Metadata.addJoinTable(joinTable.name, {
61
56
  entity: target,
62
57
  foreignKey: foreignKey
63
58
  });
64
59
  });
65
60
  };
66
61
  }
67
- exports.default = HasAndBelongsToMany;
62
+ export default HasAndBelongsToMany;
@@ -1,6 +1,6 @@
1
- import type DynaRecord from "../../DynaRecord";
2
- import type { EntityClass } from "../../types";
3
- import { type ForeignEntityAttribute } from "../types";
1
+ import type DynaRecord from "../../DynaRecord.js";
2
+ import type { EntityClass } from "../../types.js";
3
+ import { type ForeignEntityAttribute } from "../types.js";
4
4
  interface HasManyProps<T extends DynaRecord> {
5
5
  foreignKey: ForeignEntityAttribute<T>;
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"HasMany.d.ts","sourceRoot":"","sources":["../../../../src/decorators/relationships/HasMany.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,UAAU,YAAY,CAAC,CAAC,SAAS,UAAU;IACzC,UAAU,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,iBAAS,OAAO,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,UAAU,EACzD,SAAS,EAAE,MAAM,WAAW,CAAC,CAAC,CAAC,EAC/B,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,YAEN,SAAS,WAAW,0BAA0B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,UAsBvE;AAED,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"HasMany.d.ts","sourceRoot":"","sources":["../../../../src/decorators/relationships/HasMany.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,UAAU,YAAY,CAAC,CAAC,SAAS,UAAU;IACzC,UAAU,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,iBAAS,OAAO,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,UAAU,EACzD,SAAS,EAAE,MAAM,WAAW,CAAC,CAAC,CAAC,EAC/B,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,IAEd,QAAQ,SAAS,EAAE,SAAS,0BAA0B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,UAsBvE;AAED,eAAe,OAAO,CAAC"}
@@ -1,9 +1,4 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const metadata_1 = __importDefault(require("../../metadata"));
1
+ import Metadata from "../../metadata/index.js";
7
2
  /**
8
3
  * A decorator for establishing a one-to-many relationship between entities in a single-table design ORM system. This relationship indicates that a single instance of the entity where this decorator is applied can be associated with multiple instances of another entity. The decorator facilitates the definition and management of such relationships by automatically handling the necessary metadata registration, thereby simplifying the implementation of relational data models.
9
4
  *
@@ -35,14 +30,14 @@ function HasMany(getTarget, props) {
35
30
  context.addInitializer(function () {
36
31
  const target = getTarget();
37
32
  if (props.uniDirectional === true) {
38
- metadata_1.default.addEntityRelationship(target.name, {
33
+ Metadata.addEntityRelationship(target.name, {
39
34
  type: "OwnedBy",
40
35
  propertyName: props.foreignKey,
41
36
  foreignKey: props.foreignKey,
42
37
  target: this.constructor
43
38
  });
44
39
  }
45
- metadata_1.default.addEntityRelationship(this.constructor.name, {
40
+ Metadata.addEntityRelationship(this.constructor.name, {
46
41
  type: "HasMany",
47
42
  propertyName: context.name,
48
43
  target,
@@ -52,4 +47,4 @@ function HasMany(getTarget, props) {
52
47
  });
53
48
  };
54
49
  }
55
- exports.default = HasMany;
50
+ export default HasMany;
@@ -1,6 +1,6 @@
1
- import type DynaRecord from "../../DynaRecord";
2
- import type { EntityClass, Optional } from "../../types";
3
- import { type ForeignEntityAttribute } from "../types";
1
+ import type DynaRecord from "../../DynaRecord.js";
2
+ import type { EntityClass, Optional } from "../../types.js";
3
+ import { type ForeignEntityAttribute } from "../types.js";
4
4
  interface HasOneProps<T extends DynaRecord> {
5
5
  foreignKey: ForeignEntityAttribute<T> & keyof T;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"HasOne.d.ts","sourceRoot":"","sources":["../../../../src/decorators/relationships/HasOne.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAsB,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,UAAU,WAAW,CAAC,CAAC,SAAS,UAAU;IACxC,UAAU,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;CACjD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,iBAAS,MAAM,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,UAAU,EACxD,SAAS,EAAE,MAAM,WAAW,CAAC,CAAC,CAAC,EAC/B,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,YAGX,SAAS,WACR,0BAA0B,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,UAWtD;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"HasOne.d.ts","sourceRoot":"","sources":["../../../../src/decorators/relationships/HasOne.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAsB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,UAAU,WAAW,CAAC,CAAC,SAAS,UAAU;IACxC,UAAU,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;CACjD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,iBAAS,MAAM,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,UAAU,EACxD,SAAS,EAAE,MAAM,WAAW,CAAC,CAAC,CAAC,EAC/B,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,IAGnB,QAAQ,SAAS,EACjB,SAAS,0BAA0B,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,UAWtD;AAED,eAAe,MAAM,CAAC"}
@@ -1,9 +1,4 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const metadata_1 = __importDefault(require("../../metadata"));
1
+ import Metadata from "../../metadata/index.js";
7
2
  /**
8
3
  * A decorator for defining a one-to-one relationship between entities in a single-table design ORM system. This relationship implies that an instance of the entity to which this decorator is applied can be associated with at most one instance of another entity. The `HasOne` decorator plays a crucial role in establishing and managing such relationships by automatically registering the necessary metadata, thereby enabling the ORM to recognize and navigate these associations effectively.
9
4
  *
@@ -33,7 +28,7 @@ const metadata_1 = __importDefault(require("../../metadata"));
33
28
  function HasOne(getTarget, props) {
34
29
  return function (_value, context) {
35
30
  context.addInitializer(function () {
36
- metadata_1.default.addEntityRelationship(this.constructor.name, {
31
+ Metadata.addEntityRelationship(this.constructor.name, {
37
32
  type: "HasOne",
38
33
  propertyName: context.name,
39
34
  target: getTarget(),
@@ -42,4 +37,4 @@ function HasOne(getTarget, props) {
42
37
  });
43
38
  };
44
39
  }
45
- exports.default = HasOne;
40
+ export default HasOne;
@@ -1,6 +1,6 @@
1
- export { default as HasMany } from "./HasMany";
2
- export { default as HasOne } from "./HasOne";
3
- export { default as BelongsTo } from "./BelongsTo";
4
- export { default as HasAndBelongsToMany } from "./HasAndBelongsToMany";
5
- export * from "./types";
1
+ export { default as HasMany } from "./HasMany.js";
2
+ export { default as HasOne } from "./HasOne.js";
3
+ export { default as BelongsTo } from "./BelongsTo.js";
4
+ export { default as HasAndBelongsToMany } from "./HasAndBelongsToMany.js";
5
+ export * from "./types.js";
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/decorators/relationships/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/decorators/relationships/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,cAAc,YAAY,CAAC"}
@@ -1,29 +1,5 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- var __importDefault = (this && this.__importDefault) || function (mod) {
17
- return (mod && mod.__esModule) ? mod : { "default": mod };
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.HasAndBelongsToMany = exports.BelongsTo = exports.HasOne = exports.HasMany = void 0;
21
- var HasMany_1 = require("./HasMany");
22
- Object.defineProperty(exports, "HasMany", { enumerable: true, get: function () { return __importDefault(HasMany_1).default; } });
23
- var HasOne_1 = require("./HasOne");
24
- Object.defineProperty(exports, "HasOne", { enumerable: true, get: function () { return __importDefault(HasOne_1).default; } });
25
- var BelongsTo_1 = require("./BelongsTo");
26
- Object.defineProperty(exports, "BelongsTo", { enumerable: true, get: function () { return __importDefault(BelongsTo_1).default; } });
27
- var HasAndBelongsToMany_1 = require("./HasAndBelongsToMany");
28
- Object.defineProperty(exports, "HasAndBelongsToMany", { enumerable: true, get: function () { return __importDefault(HasAndBelongsToMany_1).default; } });
29
- __exportStar(require("./types"), exports);
1
+ export { default as HasMany } from "./HasMany.js";
2
+ export { default as HasOne } from "./HasOne.js";
3
+ export { default as BelongsTo } from "./BelongsTo.js";
4
+ export { default as HasAndBelongsToMany } from "./HasAndBelongsToMany.js";
5
+ export * from "./types.js";
@@ -1,6 +1,6 @@
1
- import type DynaRecord from "../../DynaRecord";
2
- import type { ForeignKey, NullableForeignKey, Optional } from "../../types";
3
- import type { ForeignEntityAttribute } from "../types";
1
+ import type DynaRecord from "../../DynaRecord.js";
2
+ import type { ForeignKey, NullableForeignKey, Optional } from "../../types.js";
3
+ import type { ForeignEntityAttribute } from "../types.js";
4
4
  type NullableForeignKeyBrand<T extends DynaRecord> = NonNullable<NullableForeignKey<T>>;
5
5
  type NormalizedForeignKey<Value> = NonNullable<Value>;
6
6
  type ExtractForeignKeyTarget<Value> = NormalizedForeignKey<Value> extends ForeignKey<infer Target> ? Target : NormalizedForeignKey<Value> extends NullableForeignKeyBrand<infer Target> ? Target : never;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRo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AK,GAClC,KAAK,GACL,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,GACrB,QAAQ,CAAC,eAAe,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAChC,eAAe,CAAC,CAAC,EAAE,EAAE,CAAC,GAC1B,KAAK,CAAC"}
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,6 +1,6 @@
1
- import type DynaRecord from "../DynaRecord";
2
- import { type EntityAttributesOnly } from "../operations/types";
3
- import type { NullableForeignKey, ForeignKey, Optional } from "../types";
1
+ import type DynaRecord from "../DynaRecord.js";
2
+ import { type EntityAttributesOnly } from "../operations/types.js";
3
+ import type { NullableForeignKey, ForeignKey, Optional } from "../types.js";
4
4
  /**
5
5
  * Returns attributes on the provided model which are EntityAttributes of type ForeignKey
6
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/decorators/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,UAAU,IAAI;KACxD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,UAAU,GACnC,CAAC,GACD,CAAC,CAAC,CAAC,CAAC,SAAS,kBAAkB,GAC7B,QAAQ,CAAC,CAAC,CAAC,GACX,KAAK;CACZ,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEjC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAA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C;AAEzE;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,GAAG,kBAAkB,GACpE,KAAK,GACL,CAAC,CAAC;AAEN,MAAM,MAAM,yBAAyB,CACnC,CAAC,SAAS,UAAU,EACpB,CAAC,EACD,CAAC,SAAS,gBAAgB,IACxB,0BAA0B,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,SAAS,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC"}
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { type QueryCommandInput, type GetCommandInput, type GetCommandOutput, type TransactWriteCommandInput, type TransactWriteCommandOutput, type TransactGetCommandInput } from "@aws-sdk/lib-dynamodb";
2
- import type { QueryItems, TransactGetItemResponses } from "./types";
2
+ import type { QueryItems, TransactGetItemResponses } from "./types.js";
3
3
  /**
4
4
  * A utility class for interacting with DynamoDB, providing static methods
5
5
  * for common operations such as retrieving, querying, and transacting items.
@@ -1 +1 @@
1
- {"version":3,"file":"DynamoClient.d.ts","sourceRoot":"","sources":["../../../src/dynamo-utils/DynamoClient.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC7B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAOpE;;;GAGG;AAEH,cAAM,YAAY;IAChB;;;;OAIG;WACiB,OAAO,CACzB,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAMpC;;;;OAIG;WACiB,KAAK,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC;IAMzE;;;;OAIG;WACiB,gBAAgB,CAClC,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,wBAAwB,CAAC;IAMpC;;;;OAIG;WACiB,kBAAkB,CACpC,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,0BAA0B,CAAC;CAIvC;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"DynamoClient.d.ts","sourceRoot":"","sources":["../../../src/dynamo-utils/DynamoClient.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC7B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAOvE;;;GAGG;AAEH,cAAM,YAAY;IAChB;;;;OAIG;WACiB,OAAO,CACzB,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAMpC;;;;OAIG;WACiB,KAAK,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC;IAMzE;;;;OAIG;WACiB,gBAAgB,CAClC,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,wBAAwB,CAAC;IAMpC;;;;OAIG;WACiB,kBAAkB,CACpC,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,0BAA0B,CAAC;CAIvC;AAED,eAAe,YAAY,CAAC"}
@@ -1,13 +1,8 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
7
- const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
8
- const Logger_1 = __importDefault(require("../Logger"));
1
+ import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
2
+ import { DynamoDBDocumentClient, GetCommand, QueryCommand, TransactWriteCommand, TransactGetCommand } from "@aws-sdk/lib-dynamodb";
3
+ import Logger from "../Logger.js";
9
4
  // Initialize the DynamoDB Document Client with a specific AWS region.
10
- const dynamo = lib_dynamodb_1.DynamoDBDocumentClient.from(new client_dynamodb_1.DynamoDBClient({ region: "us-west-2" }));
5
+ const dynamo = DynamoDBDocumentClient.from(new DynamoDBClient({ region: "us-west-2" }));
11
6
  /**
12
7
  * A utility class for interacting with DynamoDB, providing static methods
13
8
  * for common operations such as retrieving, querying, and transacting items.
@@ -20,8 +15,8 @@ class DynamoClient {
20
15
  * @returns A Promise resolving to the retrieved item.
21
16
  */
22
17
  static async getItem(params) {
23
- Logger_1.default.log("getItem", { params });
24
- const response = await dynamo.send(new lib_dynamodb_1.GetCommand(params));
18
+ Logger.log("getItem", { params });
19
+ const response = await dynamo.send(new GetCommand(params));
25
20
  return response.Item;
26
21
  }
27
22
  /**
@@ -30,8 +25,8 @@ class DynamoClient {
30
25
  * @returns A Promise resolving to an array of the queried items.
31
26
  */
32
27
  static async query(params) {
33
- Logger_1.default.log("query", { params });
34
- const response = await dynamo.send(new lib_dynamodb_1.QueryCommand(params));
28
+ Logger.log("query", { params });
29
+ const response = await dynamo.send(new QueryCommand(params));
35
30
  return response.Items ?? [];
36
31
  }
37
32
  /**
@@ -40,8 +35,8 @@ class DynamoClient {
40
35
  * @returns A Promise resolving to the responses of the transactional get operation.
41
36
  */
42
37
  static async transactGetItems(params) {
43
- Logger_1.default.log("transactGetItems", { params });
44
- const response = await dynamo.send(new lib_dynamodb_1.TransactGetCommand(params));
38
+ Logger.log("transactGetItems", { params });
39
+ const response = await dynamo.send(new TransactGetCommand(params));
45
40
  return response.Responses ?? [];
46
41
  }
47
42
  /**
@@ -50,8 +45,8 @@ class DynamoClient {
50
45
  * @returns A Promise resolving to the output of the transactional write operation.
51
46
  */
52
47
  static async transactWriteItems(params) {
53
- Logger_1.default.log("transactWriteItems", { params });
54
- return await dynamo.send(new lib_dynamodb_1.TransactWriteCommand(params));
48
+ Logger.log("transactWriteItems", { params });
49
+ return await dynamo.send(new TransactWriteCommand(params));
55
50
  }
56
51
  }
57
- exports.default = DynamoClient;
52
+ export default DynamoClient;
@@ -1,4 +1,4 @@
1
- import type { Get, TransactGetItemResponses } from "./types";
1
+ import type { Get, TransactGetItemResponses } from "./types.js";
2
2
  /**
3
3
  * Build and executes a [TransactGetItems](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html) request
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TransactGetBuilder.d.ts","sourceRoot":"","sources":["../../../src/dynamo-utils/TransactGetBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB,EAAoB,MAAM,SAAS,CAAC;AAK/E;;GAEG;AACH,cAAM,kBAAkB;;IAGtB;;OAEG;IACU,kBAAkB,IAAI,OAAO,CAAC,wBAAwB,CAAC;IAiBpE;;;OAGG;IACI,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAI9B;;OAEG;IACI,eAAe,IAAI,OAAO;CAGlC;AAED,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"TransactGetBuilder.d.ts","sourceRoot":"","sources":["../../../src/dynamo-utils/TransactGetBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,GAAG,EACH,wBAAwB,EAEzB,MAAM,YAAY,CAAC;AAKpB;;GAEG;AACH,cAAM,kBAAkB;;IAGtB;;OAEG;IACU,kBAAkB,IAAI,OAAO,CAAC,wBAAwB,CAAC;IAiBpE;;;OAGG;IACI,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAI9B;;OAEG;IACI,eAAe,IAAI,OAAO;CAGlC;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,10 +1,5 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const DynamoClient_1 = __importDefault(require("./DynamoClient"));
7
- const utils_1 = require("../utils");
1
+ import DynamoClient from "./DynamoClient.js";
2
+ import { chunkArray } from "../utils.js";
8
3
  // https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html
9
4
  const MAX_TRANSACTION_ITEMS = 100;
10
5
  /**
@@ -16,9 +11,9 @@ class TransactGetBuilder {
16
11
  * Execute the transaction
17
12
  */
18
13
  async executeTransaction() {
19
- const transactionChunks = (0, utils_1.chunkArray)(this.#transactionItems, MAX_TRANSACTION_ITEMS);
14
+ const transactionChunks = chunkArray(this.#transactionItems, MAX_TRANSACTION_ITEMS);
20
15
  // Break transaction into chunks of 100 due to Dynamo limit
21
- const res = await Promise.all(transactionChunks.map(async (chunk) => await DynamoClient_1.default.transactGetItems({ TransactItems: chunk })));
16
+ const res = await Promise.all(transactionChunks.map(async (chunk) => await DynamoClient.transactGetItems({ TransactItems: chunk })));
22
17
  return res.flat();
23
18
  }
24
19
  /**
@@ -35,4 +30,4 @@ class TransactGetBuilder {
35
30
  return this.#transactionItems.length > 0;
36
31
  }
37
32
  }
38
- exports.default = TransactGetBuilder;
33
+ export default TransactGetBuilder;
@@ -1,4 +1,4 @@
1
- import type { ConditionCheck, Put, Update, Delete } from "./types";
1
+ import type { ConditionCheck, Put, Update, Delete } from "./types.js";
2
2
  /**
3
3
  * Build and executes a [TransactWriteItems](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html) request
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TransactWriteBuilder.d.ts","sourceRoot":"","sources":["../../../src/dynamo-utils/TransactWriteBuilder.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEV,cAAc,EACd,GAAG,EACH,MAAM,EACN,MAAM,EACP,MAAM,SAAS,CAAC;AAEjB;;GAE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;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAMzB;;;;OAIG;IACH,OAAO,CAAC,iCAAiC;CA6B1C;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,12 +1,7 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const DynamoClient_1 = __importDefault(require("./DynamoClient"));
7
- const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
8
- const errors_1 = require("./errors");
9
- const Logger_1 = __importDefault(require("../Logger"));
1
+ import DynamoClient from "./DynamoClient.js";
2
+ import { TransactionCanceledException } from "@aws-sdk/client-dynamodb";
3
+ import { ConditionalCheckFailedError, TransactionWriteFailedError } from "./errors.js";
4
+ import Logger from "../Logger.js";
10
5
  /**
11
6
  * Build and executes a [TransactWriteItems](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html) request
12
7
  */
@@ -18,13 +13,13 @@ class TransactionBuilder {
18
13
  */
19
14
  async executeTransaction() {
20
15
  try {
21
- const response = await DynamoClient_1.default.transactWriteItems({
16
+ const response = await DynamoClient.transactWriteItems({
22
17
  TransactItems: this.#transactionItems
23
18
  });
24
- Logger_1.default.log("Transaction successful:", response);
19
+ Logger.log("Transaction successful:", response);
25
20
  }
26
21
  catch (error) {
27
- if (error instanceof client_dynamodb_1.TransactionCanceledException) {
22
+ if (error instanceof TransactionCanceledException) {
28
23
  throw this.buildTransactionCanceledException(error);
29
24
  }
30
25
  throw error;
@@ -85,16 +80,16 @@ class TransactionBuilder {
85
80
  if (reason.Code === "ConditionalCheckFailed") {
86
81
  const failure = this.#errorMessages[idx] ?? reason.Message;
87
82
  const msg = `${reason.Code}: ${failure}`;
88
- errors.push(new errors_1.ConditionalCheckFailedError(msg));
83
+ errors.push(new ConditionalCheckFailedError(msg));
89
84
  }
90
85
  return errors;
91
86
  }, []);
92
87
  if (conditionFailedErrs.length > 0) {
93
- Logger_1.default.error(conditionFailedErrs.map(err => err.message));
94
- return new errors_1.TransactionWriteFailedError(conditionFailedErrs, "Failed Conditional Checks", { cause: error });
88
+ Logger.error(conditionFailedErrs.map(err => err.message));
89
+ return new TransactionWriteFailedError(conditionFailedErrs, "Failed Conditional Checks", { cause: error });
95
90
  }
96
91
  }
97
92
  return error;
98
93
  }
99
94
  }
100
- exports.default = TransactionBuilder;
95
+ export default TransactionBuilder;
@@ -1,17 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TransactionWriteFailedError = exports.ConditionalCheckFailedError = void 0;
4
1
  /**
5
2
  * Error thrown if a condition within a dynamo operation fails
6
3
  */
7
- class ConditionalCheckFailedError extends Error {
4
+ export class ConditionalCheckFailedError extends Error {
8
5
  code = "ConditionalCheckFailedError";
9
6
  }
10
- exports.ConditionalCheckFailedError = ConditionalCheckFailedError;
11
7
  /**
12
8
  * AggregateError thrown if a transaction fails. Check errors for reasons
13
9
  */
14
- class TransactionWriteFailedError extends AggregateError {
10
+ export class TransactionWriteFailedError extends AggregateError {
15
11
  code = "TransactionWriteFailedError";
16
12
  }
17
- exports.TransactionWriteFailedError = TransactionWriteFailedError;
@@ -1,8 +1,8 @@
1
- export { default as TransactWriteBuilder } from "./TransactWriteBuilder";
2
- export { default as TransactGetBuilder } from "./TransactGetBuilder";
3
- export { default as DynamoClient } from "./DynamoClient";
4
- export * from "./TransactWriteBuilder";
5
- export * from "./TransactGetBuilder";
6
- export * from "./errors";
7
- export * from "./types";
1
+ export { default as TransactWriteBuilder } from "./TransactWriteBuilder.js";
2
+ export { default as TransactGetBuilder } from "./TransactGetBuilder.js";
3
+ export { default as DynamoClient } from "./DynamoClient.js";
4
+ export * from "./TransactWriteBuilder.js";
5
+ export * from "./TransactGetBuilder.js";
6
+ export * from "./errors.js";
7
+ export * from "./types.js";
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dynamo-utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEzD,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dynamo-utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE5D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -1,30 +1,7 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- var __importDefault = (this && this.__importDefault) || function (mod) {
17
- return (mod && mod.__esModule) ? mod : { "default": mod };
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.DynamoClient = exports.TransactGetBuilder = exports.TransactWriteBuilder = void 0;
21
- var TransactWriteBuilder_1 = require("./TransactWriteBuilder");
22
- Object.defineProperty(exports, "TransactWriteBuilder", { enumerable: true, get: function () { return __importDefault(TransactWriteBuilder_1).default; } });
23
- var TransactGetBuilder_1 = require("./TransactGetBuilder");
24
- Object.defineProperty(exports, "TransactGetBuilder", { enumerable: true, get: function () { return __importDefault(TransactGetBuilder_1).default; } });
25
- var DynamoClient_1 = require("./DynamoClient");
26
- Object.defineProperty(exports, "DynamoClient", { enumerable: true, get: function () { return __importDefault(DynamoClient_1).default; } });
27
- __exportStar(require("./TransactWriteBuilder"), exports);
28
- __exportStar(require("./TransactGetBuilder"), exports);
29
- __exportStar(require("./errors"), exports);
30
- __exportStar(require("./types"), exports);
1
+ export { default as TransactWriteBuilder } from "./TransactWriteBuilder.js";
2
+ export { default as TransactGetBuilder } from "./TransactGetBuilder.js";
3
+ export { default as DynamoClient } from "./DynamoClient.js";
4
+ export * from "./TransactWriteBuilder.js";
5
+ export * from "./TransactGetBuilder.js";
6
+ export * from "./errors.js";
7
+ export * from "./types.js";
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,24 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ValidationError = exports.NotFoundError = exports.NullConstraintViolationError = void 0;
4
1
  /**
5
2
  * Represents an error indicating a violation of a null constraint within the ORM system. This error is typically thrown when an operation attempts to set a non-nullable attribute to `null`, which would violate the data integrity rules of the database schema.
6
3
  */
7
- class NullConstraintViolationError extends Error {
4
+ export class NullConstraintViolationError extends Error {
8
5
  code = "NullConstraintViolationError";
9
6
  }
10
- exports.NullConstraintViolationError = NullConstraintViolationError;
11
7
  /**
12
8
  * Represents an error indicating that a requested entity or item could not be found within the database. This error is thrown during operations that expect to find and return a specific item, but the item does not exist in the database.
13
9
  */
14
- class NotFoundError extends Error {
10
+ export class NotFoundError extends Error {
15
11
  code = "NotFoundError";
16
12
  }
17
- exports.NotFoundError = NotFoundError;
18
13
  /**
19
14
  * Represents an error indicating that an entities attributes are not valid
20
15
  */
21
- class ValidationError extends Error {
16
+ export class ValidationError extends Error {
22
17
  code = "ValidationError";
23
18
  }
24
- exports.ValidationError = ValidationError;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Thin indirection over `globalThis.crypto.randomUUID()` so the test suite
3
+ * can mock ID generation via `vi.mock("../../src/id")` rather than patching
4
+ * the non-configurable `globalThis.crypto.randomUUID` property.
5
+ *
6
+ * Behavior identical to the prior `uuid.v4()` implementation: returns a v4
7
+ * UUID string in the canonical 8-4-4-4-12 hex format.
8
+ *
9
+ * @returns A canonical 8-4-4-4-12 hex v4 UUID string.
10
+ */
11
+ export declare const generateId: () => string;
12
+ //# sourceMappingURL=id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src/id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,QAAO,MAAwC,CAAC"}
package/dist/src/id.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Thin indirection over `globalThis.crypto.randomUUID()` so the test suite
3
+ * can mock ID generation via `vi.mock("../../src/id")` rather than patching
4
+ * the non-configurable `globalThis.crypto.randomUUID` property.
5
+ *
6
+ * Behavior identical to the prior `uuid.v4()` implementation: returns a v4
7
+ * UUID string in the canonical 8-4-4-4-12 hex format.
8
+ *
9
+ * @returns A canonical 8-4-4-4-12 hex v4 UUID string.
10
+ */
11
+ export const generateId = () => globalThis.crypto.randomUUID();