@schorts/shared-kernel 1.0.2 → 1.0.4

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 (202) hide show
  1. package/CHANGELOG +25 -0
  2. package/dist/auth/auth-provider.d.ts +10 -0
  3. package/dist/auth/auth-provider.d.ts.map +1 -0
  4. package/dist/auth/auth-provider.js +3 -0
  5. package/dist/auth/auth-provider.js.map +1 -0
  6. package/dist/auth/exceptions/index.d.ts +2 -0
  7. package/dist/auth/exceptions/index.d.ts.map +1 -0
  8. package/dist/auth/exceptions/index.js +6 -0
  9. package/dist/auth/exceptions/index.js.map +1 -0
  10. package/dist/auth/exceptions/not-authenticated.d.ts +3 -0
  11. package/dist/auth/exceptions/not-authenticated.d.ts.map +1 -0
  12. package/dist/auth/exceptions/not-authenticated.js +7 -0
  13. package/dist/auth/exceptions/not-authenticated.js.map +1 -0
  14. package/dist/auth/index.d.ts +4 -0
  15. package/dist/auth/index.d.ts.map +1 -0
  16. package/dist/auth/index.js +8 -0
  17. package/dist/auth/index.js.map +1 -0
  18. package/dist/auth/require-auth.decorator.d.ts +5 -0
  19. package/dist/auth/require-auth.decorator.d.ts.map +1 -0
  20. package/dist/auth/require-auth.decorator.js +36 -0
  21. package/dist/auth/require-auth.decorator.js.map +1 -0
  22. package/dist/criteria/criteria.d.ts +15 -0
  23. package/dist/criteria/criteria.d.ts.map +1 -0
  24. package/dist/criteria/criteria.js +34 -0
  25. package/dist/criteria/criteria.js.map +1 -0
  26. package/dist/criteria/direction.d.ts +2 -0
  27. package/dist/criteria/direction.d.ts.map +1 -0
  28. package/dist/criteria/direction.js +3 -0
  29. package/dist/criteria/direction.js.map +1 -0
  30. package/dist/criteria/exceptions/index.d.ts +3 -0
  31. package/dist/criteria/exceptions/index.d.ts.map +1 -0
  32. package/dist/criteria/exceptions/index.js +8 -0
  33. package/dist/criteria/exceptions/index.js.map +1 -0
  34. package/dist/criteria/exceptions/limit-not-valid.d.ts +3 -0
  35. package/dist/criteria/exceptions/limit-not-valid.d.ts.map +1 -0
  36. package/dist/criteria/exceptions/limit-not-valid.js +7 -0
  37. package/dist/criteria/exceptions/limit-not-valid.js.map +1 -0
  38. package/dist/criteria/exceptions/offset-not-valid.d.ts +3 -0
  39. package/dist/criteria/exceptions/offset-not-valid.d.ts.map +1 -0
  40. package/dist/criteria/exceptions/offset-not-valid.js +7 -0
  41. package/dist/criteria/exceptions/offset-not-valid.js.map +1 -0
  42. package/dist/criteria/filter-criterion.d.ts +6 -0
  43. package/dist/criteria/filter-criterion.d.ts.map +1 -0
  44. package/dist/criteria/filter-criterion.js +3 -0
  45. package/dist/criteria/filter-criterion.js.map +1 -0
  46. package/dist/criteria/index.d.ts +7 -0
  47. package/dist/criteria/index.d.ts.map +1 -0
  48. package/dist/criteria/index.js +9 -0
  49. package/dist/criteria/index.js.map +1 -0
  50. package/dist/criteria/operator.d.ts +2 -0
  51. package/dist/criteria/operator.d.ts.map +1 -0
  52. package/dist/criteria/operator.js +3 -0
  53. package/dist/criteria/operator.js.map +1 -0
  54. package/dist/criteria/order.d.ts +5 -0
  55. package/dist/criteria/order.d.ts.map +1 -0
  56. package/dist/criteria/order.js +3 -0
  57. package/dist/criteria/order.js.map +1 -0
  58. package/dist/domain-events/domain-event-primitives.d.ts +8 -0
  59. package/dist/domain-events/domain-event-primitives.d.ts.map +1 -0
  60. package/dist/domain-events/domain-event-primitives.js +3 -0
  61. package/dist/domain-events/domain-event-primitives.js.map +1 -0
  62. package/dist/domain-events/domain-event.d.ts +13 -0
  63. package/dist/domain-events/domain-event.d.ts.map +1 -0
  64. package/dist/domain-events/domain-event.js +19 -0
  65. package/dist/domain-events/domain-event.js.map +1 -0
  66. package/dist/domain-events/index.d.ts +3 -0
  67. package/dist/domain-events/index.d.ts.map +1 -0
  68. package/dist/domain-events/index.js +6 -0
  69. package/dist/domain-events/index.js.map +1 -0
  70. package/dist/entities/entity.d.ts +12 -0
  71. package/dist/entities/entity.d.ts.map +1 -0
  72. package/dist/entities/entity.js +20 -0
  73. package/dist/entities/entity.js.map +1 -0
  74. package/dist/entities/index.d.ts +2 -0
  75. package/dist/entities/index.d.ts.map +1 -0
  76. package/dist/entities/index.js +6 -0
  77. package/dist/entities/index.js.map +1 -0
  78. package/dist/formatters/index.d.ts +2 -0
  79. package/dist/formatters/index.d.ts.map +1 -0
  80. package/dist/formatters/index.js +6 -0
  81. package/dist/formatters/index.js.map +1 -0
  82. package/dist/formatters/pascal-camel-to-snake.d.ts +4 -0
  83. package/dist/formatters/pascal-camel-to-snake.d.ts.map +1 -0
  84. package/dist/formatters/pascal-camel-to-snake.js +13 -0
  85. package/dist/formatters/pascal-camel-to-snake.js.map +1 -0
  86. package/dist/http/exceptions/http-exception.d.ts +6 -0
  87. package/dist/http/exceptions/http-exception.d.ts.map +1 -0
  88. package/dist/http/exceptions/http-exception.js +14 -0
  89. package/dist/http/exceptions/http-exception.js.map +1 -0
  90. package/dist/http/exceptions/index.d.ts +2 -0
  91. package/dist/http/exceptions/index.d.ts.map +1 -0
  92. package/dist/http/exceptions/index.js +6 -0
  93. package/dist/http/exceptions/index.js.map +1 -0
  94. package/dist/http/fetch-http-provider.d.ts +13 -0
  95. package/dist/http/fetch-http-provider.d.ts.map +1 -0
  96. package/dist/http/fetch-http-provider.js +88 -0
  97. package/dist/http/fetch-http-provider.js.map +1 -0
  98. package/dist/http/http-provider.d.ts +8 -0
  99. package/dist/http/http-provider.d.ts.map +1 -0
  100. package/dist/http/http-provider.js +3 -0
  101. package/dist/http/http-provider.js.map +1 -0
  102. package/dist/http/index.d.ts +4 -0
  103. package/dist/http/index.d.ts.map +1 -0
  104. package/dist/http/index.js +8 -0
  105. package/dist/http/index.js.map +1 -0
  106. package/dist/json-api/index.d.ts +5 -0
  107. package/dist/json-api/index.d.ts.map +1 -0
  108. package/dist/json-api/index.js +8 -0
  109. package/dist/json-api/index.js.map +1 -0
  110. package/dist/json-api/json-api-connector.d.ts +21 -0
  111. package/dist/json-api/json-api-connector.d.ts.map +1 -0
  112. package/dist/json-api/json-api-connector.js +29 -0
  113. package/dist/json-api/json-api-connector.js.map +1 -0
  114. package/dist/json-api/json-api-list.d.ts +14 -0
  115. package/dist/json-api/json-api-list.d.ts.map +1 -0
  116. package/dist/json-api/json-api-list.js +3 -0
  117. package/dist/json-api/json-api-list.js.map +1 -0
  118. package/dist/json-api/json-api-single.d.ts +14 -0
  119. package/dist/json-api/json-api-single.d.ts.map +1 -0
  120. package/dist/json-api/json-api-single.js +3 -0
  121. package/dist/json-api/json-api-single.js.map +1 -0
  122. package/dist/json-api/url-criteria-builder.d.ts +9 -0
  123. package/dist/json-api/url-criteria-builder.d.ts.map +1 -0
  124. package/dist/json-api/url-criteria-builder.js +49 -0
  125. package/dist/json-api/url-criteria-builder.js.map +1 -0
  126. package/dist/messages/index.d.ts +2 -0
  127. package/dist/messages/index.d.ts.map +1 -0
  128. package/dist/messages/index.js +3 -0
  129. package/dist/messages/index.js.map +1 -0
  130. package/dist/messages/message.d.ts +4 -0
  131. package/dist/messages/message.d.ts.map +1 -0
  132. package/dist/messages/message.js +3 -0
  133. package/dist/messages/message.js.map +1 -0
  134. package/dist/models/base-model.d.ts +4 -0
  135. package/dist/models/base-model.d.ts.map +1 -0
  136. package/dist/models/base-model.js +3 -0
  137. package/dist/models/base-model.js.map +1 -0
  138. package/dist/models/index.d.ts +2 -0
  139. package/dist/models/index.d.ts.map +1 -0
  140. package/dist/models/index.js +3 -0
  141. package/dist/models/index.js.map +1 -0
  142. package/dist/state-manager/index.d.ts +2 -0
  143. package/dist/state-manager/index.d.ts.map +1 -0
  144. package/dist/state-manager/index.js +6 -0
  145. package/dist/state-manager/index.js.map +1 -0
  146. package/dist/state-manager/state-manager.d.ts +12 -0
  147. package/dist/state-manager/state-manager.d.ts.map +1 -0
  148. package/dist/state-manager/state-manager.js +24 -0
  149. package/dist/state-manager/state-manager.js.map +1 -0
  150. package/dist/utils/index.d.ts +2 -0
  151. package/dist/utils/index.d.ts.map +1 -0
  152. package/dist/utils/index.js +6 -0
  153. package/dist/utils/index.js.map +1 -0
  154. package/dist/utils/url/index.d.ts +2 -0
  155. package/dist/utils/url/index.d.ts.map +1 -0
  156. package/dist/utils/url/index.js +6 -0
  157. package/dist/utils/url/index.js.map +1 -0
  158. package/dist/utils/url/url-with-params-builder.d.ts +7 -0
  159. package/dist/utils/url/url-with-params-builder.d.ts.map +1 -0
  160. package/dist/utils/url/url-with-params-builder.js +25 -0
  161. package/dist/utils/url/url-with-params-builder.js.map +1 -0
  162. package/dist/value-objects/coordinates-value.d.ts +15 -0
  163. package/dist/value-objects/coordinates-value.d.ts.map +1 -0
  164. package/dist/value-objects/coordinates-value.js +39 -0
  165. package/dist/value-objects/coordinates-value.js.map +1 -0
  166. package/dist/value-objects/email-value.d.ts +10 -0
  167. package/dist/value-objects/email-value.d.ts.map +1 -0
  168. package/dist/value-objects/email-value.js +23 -0
  169. package/dist/value-objects/email-value.js.map +1 -0
  170. package/dist/value-objects/enum-value.d.ts +11 -0
  171. package/dist/value-objects/enum-value.d.ts.map +1 -0
  172. package/dist/value-objects/enum-value.js +24 -0
  173. package/dist/value-objects/enum-value.js.map +1 -0
  174. package/dist/value-objects/index.d.ts +10 -0
  175. package/dist/value-objects/index.d.ts.map +1 -0
  176. package/dist/value-objects/index.js +20 -0
  177. package/dist/value-objects/index.js.map +1 -0
  178. package/dist/value-objects/integer-value.d.ts +12 -0
  179. package/dist/value-objects/integer-value.d.ts.map +1 -0
  180. package/dist/value-objects/integer-value.js +28 -0
  181. package/dist/value-objects/integer-value.js.map +1 -0
  182. package/dist/value-objects/phone-value.d.ts +13 -0
  183. package/dist/value-objects/phone-value.d.ts.map +1 -0
  184. package/dist/value-objects/phone-value.js +43 -0
  185. package/dist/value-objects/phone-value.js.map +1 -0
  186. package/dist/value-objects/slug-value.d.ts +10 -0
  187. package/dist/value-objects/slug-value.d.ts.map +1 -0
  188. package/dist/value-objects/slug-value.js +23 -0
  189. package/dist/value-objects/slug-value.js.map +1 -0
  190. package/dist/value-objects/string-value.d.ts +12 -0
  191. package/dist/value-objects/string-value.d.ts.map +1 -0
  192. package/dist/value-objects/string-value.js +26 -0
  193. package/dist/value-objects/string-value.js.map +1 -0
  194. package/dist/value-objects/uuid-value.d.ts +13 -0
  195. package/dist/value-objects/uuid-value.d.ts.map +1 -0
  196. package/dist/value-objects/uuid-value.js +29 -0
  197. package/dist/value-objects/uuid-value.js.map +1 -0
  198. package/dist/value-objects/value-object.d.ts +8 -0
  199. package/dist/value-objects/value-object.d.ts.map +1 -0
  200. package/dist/value-objects/value-object.js +3 -0
  201. package/dist/value-objects/value-object.js.map +1 -0
  202. package/package.json +8 -200
package/CHANGELOG CHANGED
@@ -0,0 +1,25 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.4] - 2025-09-30
9
+
10
+ ### Fixed
11
+
12
+ - Add `dist` folder to the repo and NPM package.
13
+
14
+ ## [1.0.3] - 2025-09-30
15
+
16
+ ### Added
17
+
18
+ - This CHANGELOG file to keep track of the relevant changes.
19
+
20
+ ### Changed
21
+
22
+ - Removed indirect dependencies from the `package.json`.
23
+
24
+ [1.0.3]: https://github.com/schorts99/shared-kernel/compare/v1.0.3...v0.0.4
25
+ [1.0.3]: https://github.com/schorts99/shared-kernel/releases/tag/v1.0.3
@@ -0,0 +1,10 @@
1
+ import { Entity } from "../entities";
2
+ import { BaseModel } from "../models";
3
+ export interface AuthProvider<UserEntity extends Entity<BaseModel>> {
4
+ authenticate(...args: any[]): Promise<void>;
5
+ logout(): Promise<void>;
6
+ isAuthenticated(): Promise<boolean>;
7
+ currentUser(): Promise<UserEntity | null>;
8
+ onAuthChange(callback: (user: UserEntity | null) => void): () => void;
9
+ }
10
+ //# sourceMappingURL=auth-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-provider.d.ts","sourceRoot":"","sources":["../../src/auth/auth-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,WAAW,YAAY,CAAC,UAAU,SAAS,MAAM,CAAC,SAAS,CAAC;IAChE,YAAY,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,WAAW,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAC1C,YAAY,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACvE"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=auth-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-provider.js","sourceRoot":"","sources":["../../src/auth/auth-provider.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { NotAuthenticated } from "./not-authenticated";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/exceptions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotAuthenticated = void 0;
4
+ var not_authenticated_1 = require("./not-authenticated");
5
+ Object.defineProperty(exports, "NotAuthenticated", { enumerable: true, get: function () { return not_authenticated_1.NotAuthenticated; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/exceptions/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA"}
@@ -0,0 +1,3 @@
1
+ export declare class NotAuthenticated extends Error {
2
+ }
3
+ //# sourceMappingURL=not-authenticated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not-authenticated.d.ts","sourceRoot":"","sources":["../../../src/auth/exceptions/not-authenticated.ts"],"names":[],"mappings":"AAAA,qBAAa,gBAAiB,SAAQ,KAAK;CAAG"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotAuthenticated = void 0;
4
+ class NotAuthenticated extends Error {
5
+ }
6
+ exports.NotAuthenticated = NotAuthenticated;
7
+ //# sourceMappingURL=not-authenticated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not-authenticated.js","sourceRoot":"","sources":["../../../src/auth/exceptions/not-authenticated.ts"],"names":[],"mappings":";;;AAAA,MAAa,gBAAiB,SAAQ,KAAK;CAAG;AAA9C,4CAA8C"}
@@ -0,0 +1,4 @@
1
+ export type { AuthProvider } from "./auth-provider";
2
+ export { RequireAuth } from "./require-auth.decorator";
3
+ export { NotAuthenticated } from "./exceptions";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotAuthenticated = exports.RequireAuth = void 0;
4
+ var require_auth_decorator_1 = require("./require-auth.decorator");
5
+ Object.defineProperty(exports, "RequireAuth", { enumerable: true, get: function () { return require_auth_decorator_1.RequireAuth; } });
6
+ var exceptions_1 = require("./exceptions");
7
+ Object.defineProperty(exports, "NotAuthenticated", { enumerable: true, get: function () { return exceptions_1.NotAuthenticated; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";;;AACA,mEAAuD;AAA9C,qHAAA,WAAW,OAAA;AACpB,2CAAgD;AAAvC,8GAAA,gBAAgB,OAAA"}
@@ -0,0 +1,5 @@
1
+ import { AuthProvider } from "./auth-provider";
2
+ export declare function RequireAuth(onFail?: () => any): (...args: any[]) => PropertyDescriptor | ((this: {
3
+ authProvider?: AuthProvider<any>;
4
+ }, ...args: any[]) => Promise<unknown>);
5
+ //# sourceMappingURL=require-auth.decorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"require-auth.decorator.d.ts","sourceRoot":"","sources":["../../src/auth/require-auth.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAuB3B,GAAG,MAAM,GAAG,EAAE;mBAtBa,YAAY,CAAC,GAAG,CAAC;wCAoC9D"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RequireAuth = RequireAuth;
4
+ const exceptions_1 = require("./exceptions");
5
+ function RequireAuth(onFail) {
6
+ function wrapper(originalMethod) {
7
+ return async function (...args) {
8
+ if (!this.authProvider) {
9
+ throw new Error("authProvider: AuthProvider is required on this instance");
10
+ }
11
+ const isAuthenticated = await this.authProvider.isAuthenticated();
12
+ if (!isAuthenticated) {
13
+ if (onFail) {
14
+ return onFail();
15
+ }
16
+ else {
17
+ throw new exceptions_1.NotAuthenticated();
18
+ }
19
+ }
20
+ return await originalMethod.apply(this, args);
21
+ };
22
+ }
23
+ return function (...args) {
24
+ if (args.length === 3 && typeof args[2] === 'object') {
25
+ const descriptor = args[2];
26
+ descriptor.value = wrapper(descriptor.value);
27
+ return descriptor;
28
+ }
29
+ if (args.length === 2 && typeof args[1] === 'object' && 'kind' in args[1]) {
30
+ const [originalMethod] = args;
31
+ return wrapper(originalMethod);
32
+ }
33
+ throw new Error("RequireAuth decorator used incorrectly");
34
+ };
35
+ }
36
+ //# sourceMappingURL=require-auth.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"require-auth.decorator.js","sourceRoot":"","sources":["../../src/auth/require-auth.decorator.ts"],"names":[],"mappings":";;AAGA,kCAqCC;AAvCD,6CAAgD;AAEhD,SAAgB,WAAW,CAAC,MAAkB;IAC5C,SAAS,OAAO,CACd,cAAmD;QAEnD,OAAO,KAAK,WAAoB,GAAG,IAAO;YACxC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;YAC7E,CAAC;YAED,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;YAElE,IAAI,CAAC,eAAe,EAAE,CAAC;gBACrB,IAAI,MAAM,EAAE,CAAC;oBACX,OAAO,MAAM,EAAE,CAAC;gBAClB,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,6BAAgB,EAAE,CAAC;gBAC/B,CAAC;YACH,CAAC;YAED,OAAO,MAAM,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAChD,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,GAAG,IAAW;QAC7B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;YACrD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAuB,CAAC;YACjD,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC7C,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1E,MAAM,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;YAC9B,OAAO,OAAO,CAAC,cAAc,CAAC,CAAC;QACjC,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { FilterCriterion } from "./filter-criterion";
2
+ import { Order } from "./order";
3
+ import { Operator } from "./operator";
4
+ import { Direction } from "./direction";
5
+ export declare class Criteria {
6
+ readonly filters: Record<string, FilterCriterion>;
7
+ readonly orders: Array<Order>;
8
+ limit?: number;
9
+ offset?: number;
10
+ where(field: string, operator: Operator, value: any): Criteria;
11
+ orderBy(field: string, direction?: Direction): Criteria;
12
+ limitResults(limit: number): Criteria;
13
+ offsetResults(offset: number): Criteria;
14
+ }
15
+ //# sourceMappingURL=criteria.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criteria.d.ts","sourceRoot":"","sources":["../../src/criteria/criteria.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,qBAAa,QAAQ;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAM;IACvD,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAM;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,KAAK,CACH,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,GAAG,GACT,QAAQ;IAMX,OAAO,CACL,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,SAAiB,GAC3B,QAAQ;IAMX,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ;IAUrC,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ;CASxC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Criteria = void 0;
4
+ const exceptions_1 = require("./exceptions");
5
+ class Criteria {
6
+ filters = {};
7
+ orders = [];
8
+ limit;
9
+ offset;
10
+ where(field, operator, value) {
11
+ this.filters[field] = { value, operator };
12
+ return this;
13
+ }
14
+ orderBy(field, direction = "ASC") {
15
+ this.orders.push({ field, direction });
16
+ return this;
17
+ }
18
+ limitResults(limit) {
19
+ if (limit < 1) {
20
+ throw new exceptions_1.LimitNotValid();
21
+ }
22
+ this.limit = limit;
23
+ return this;
24
+ }
25
+ offsetResults(offset) {
26
+ if (offset < 1) {
27
+ throw new exceptions_1.OffsetNotValid();
28
+ }
29
+ this.offset = offset;
30
+ return this;
31
+ }
32
+ }
33
+ exports.Criteria = Criteria;
34
+ //# sourceMappingURL=criteria.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criteria.js","sourceRoot":"","sources":["../../src/criteria/criteria.ts"],"names":[],"mappings":";;;AAIA,6CAA6D;AAE7D,MAAa,QAAQ;IACV,OAAO,GAAoC,EAAE,CAAC;IAC9C,MAAM,GAAiB,EAAE,CAAC;IACnC,KAAK,CAAU;IACf,MAAM,CAAU;IAEhB,KAAK,CACH,KAAa,EACb,QAAkB,EAClB,KAAU;QAEV,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;QAE1C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,KAAa,EACb,YAAuB,KAAK;QAE5B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAEvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,KAAa;QACxB,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACd,MAAM,IAAI,0BAAa,EAAE,CAAC;QAC5B,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CAAC,MAAc;QAC1B,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YACf,MAAM,IAAI,2BAAc,EAAE,CAAC;QAC7B,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA5CD,4BA4CC"}
@@ -0,0 +1,2 @@
1
+ export type Direction = "ASC" | "DESC";
2
+ //# sourceMappingURL=direction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"direction.d.ts","sourceRoot":"","sources":["../../src/criteria/direction.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=direction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"direction.js","sourceRoot":"","sources":["../../src/criteria/direction.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export { OffsetNotValid } from "./offset-not-valid";
2
+ export { LimitNotValid } from "./limit-not-valid";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/criteria/exceptions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LimitNotValid = exports.OffsetNotValid = void 0;
4
+ var offset_not_valid_1 = require("./offset-not-valid");
5
+ Object.defineProperty(exports, "OffsetNotValid", { enumerable: true, get: function () { return offset_not_valid_1.OffsetNotValid; } });
6
+ var limit_not_valid_1 = require("./limit-not-valid");
7
+ Object.defineProperty(exports, "LimitNotValid", { enumerable: true, get: function () { return limit_not_valid_1.LimitNotValid; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/criteria/exceptions/index.ts"],"names":[],"mappings":";;;AAAA,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,qDAAkD;AAAzC,gHAAA,aAAa,OAAA"}
@@ -0,0 +1,3 @@
1
+ export declare class LimitNotValid extends Error {
2
+ }
3
+ //# sourceMappingURL=limit-not-valid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limit-not-valid.d.ts","sourceRoot":"","sources":["../../../src/criteria/exceptions/limit-not-valid.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAc,SAAQ,KAAK;CAAG"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LimitNotValid = void 0;
4
+ class LimitNotValid extends Error {
5
+ }
6
+ exports.LimitNotValid = LimitNotValid;
7
+ //# sourceMappingURL=limit-not-valid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limit-not-valid.js","sourceRoot":"","sources":["../../../src/criteria/exceptions/limit-not-valid.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAc,SAAQ,KAAK;CAAG;AAA3C,sCAA2C"}
@@ -0,0 +1,3 @@
1
+ export declare class OffsetNotValid extends Error {
2
+ }
3
+ //# sourceMappingURL=offset-not-valid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"offset-not-valid.d.ts","sourceRoot":"","sources":["../../../src/criteria/exceptions/offset-not-valid.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAe,SAAQ,KAAK;CAAG"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OffsetNotValid = void 0;
4
+ class OffsetNotValid extends Error {
5
+ }
6
+ exports.OffsetNotValid = OffsetNotValid;
7
+ //# sourceMappingURL=offset-not-valid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"offset-not-valid.js","sourceRoot":"","sources":["../../../src/criteria/exceptions/offset-not-valid.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAe,SAAQ,KAAK;CAAG;AAA5C,wCAA4C"}
@@ -0,0 +1,6 @@
1
+ import { Operator } from "./operator";
2
+ export type FilterCriterion = {
3
+ value: any;
4
+ operator: Operator;
5
+ };
6
+ //# sourceMappingURL=filter-criterion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-criterion.d.ts","sourceRoot":"","sources":["../../src/criteria/filter-criterion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=filter-criterion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-criterion.js","sourceRoot":"","sources":["../../src/criteria/filter-criterion.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export type { Operator } from "./operator";
2
+ export type { Order } from "./order";
3
+ export type { FilterCriterion } from "./filter-criterion";
4
+ export type { Direction } from "./direction";
5
+ export { Criteria } from "./criteria";
6
+ export { OffsetNotValid, LimitNotValid } from "./exceptions";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/criteria/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LimitNotValid = exports.OffsetNotValid = exports.Criteria = void 0;
4
+ var criteria_1 = require("./criteria");
5
+ Object.defineProperty(exports, "Criteria", { enumerable: true, get: function () { return criteria_1.Criteria; } });
6
+ var exceptions_1 = require("./exceptions");
7
+ Object.defineProperty(exports, "OffsetNotValid", { enumerable: true, get: function () { return exceptions_1.OffsetNotValid; } });
8
+ Object.defineProperty(exports, "LimitNotValid", { enumerable: true, get: function () { return exceptions_1.LimitNotValid; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/criteria/index.ts"],"names":[],"mappings":";;;AAKA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,2CAA6D;AAApD,4GAAA,cAAc,OAAA;AAAE,2GAAA,aAAa,OAAA"}
@@ -0,0 +1,2 @@
1
+ export type Operator = "EQUAL" | "GREATER_THAN" | "LESS_THAN" | "GREATER_THAN_OR_EQUAL" | "LESS_THAN_OR_EQUAL" | "NOT_EQUAL" | "IN" | "NOT_IN" | "LIKE" | "BETWEEN" | "GEO_RADIUS";
2
+ //# sourceMappingURL=operator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../src/criteria/operator.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAChB,OAAO,GACP,cAAc,GACd,WAAW,GACX,uBAAuB,GACvB,oBAAoB,GACpB,WAAW,GACX,IAAI,GACJ,QAAQ,GACR,MAAM,GACN,SAAS,GACT,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=operator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operator.js","sourceRoot":"","sources":["../../src/criteria/operator.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export type Order = {
2
+ field: string;
3
+ direction: "ASC" | "DESC" | "NONE";
4
+ };
5
+ //# sourceMappingURL=order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../src/criteria/order.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;CACpC,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.js","sourceRoot":"","sources":["../../src/criteria/order.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export type DomainEventPrimitives<PayloadSchema = {}> = {
2
+ id: string;
3
+ occurred_at: string;
4
+ type: string;
5
+ version: number;
6
+ payload: PayloadSchema;
7
+ };
8
+ //# sourceMappingURL=domain-event-primitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-event-primitives.d.ts","sourceRoot":"","sources":["../../src/domain-events/domain-event-primitives.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,CAAC,aAAa,GAAG,EAAE,IAAI;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,aAAa,CAAC;CACxB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=domain-event-primitives.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-event-primitives.js","sourceRoot":"","sources":["../../src/domain-events/domain-event-primitives.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { Message } from "../messages";
2
+ import { DomainEventPrimitives } from "./domain-event-primitives";
3
+ export declare abstract class DomainEvent<PayloadSchema = {}> implements Message<DomainEventPrimitives<PayloadSchema>> {
4
+ readonly id: string;
5
+ readonly occurredAt: Date;
6
+ readonly type: string;
7
+ readonly version: number;
8
+ readonly payload: PayloadSchema;
9
+ constructor(id: string, occurredAt: Date, type: string, version: number, payload: PayloadSchema);
10
+ abstract getEventName(): string;
11
+ abstract toPrimitives(): DomainEventPrimitives<PayloadSchema>;
12
+ }
13
+ //# sourceMappingURL=domain-event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-event.d.ts","sourceRoot":"","sources":["../../src/domain-events/domain-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,8BAAsB,WAAW,CAAC,aAAa,GAAG,EAAE,CAAE,YAAW,OAAO,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAE1G,QAAQ,CAAC,EAAE,EAAE,MAAM;IACnB,QAAQ,CAAC,UAAU,EAAE,IAAI;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB,QAAQ,CAAC,OAAO,EAAE,aAAa;gBAJtB,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,IAAI,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa;IAGjC,QAAQ,CAAC,YAAY,IAAI,MAAM;IAC/B,QAAQ,CAAC,YAAY,IAAI,qBAAqB,CAAC,aAAa,CAAC;CAC9D"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DomainEvent = void 0;
4
+ class DomainEvent {
5
+ id;
6
+ occurredAt;
7
+ type;
8
+ version;
9
+ payload;
10
+ constructor(id, occurredAt, type, version, payload) {
11
+ this.id = id;
12
+ this.occurredAt = occurredAt;
13
+ this.type = type;
14
+ this.version = version;
15
+ this.payload = payload;
16
+ }
17
+ }
18
+ exports.DomainEvent = DomainEvent;
19
+ //# sourceMappingURL=domain-event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-event.js","sourceRoot":"","sources":["../../src/domain-events/domain-event.ts"],"names":[],"mappings":";;;AAGA,MAAsB,WAAW;IAEpB;IACA;IACA;IACA;IACA;IALX,YACW,EAAU,EACV,UAAgB,EAChB,IAAY,EACZ,OAAe,EACf,OAAsB;QAJtB,OAAE,GAAF,EAAE,CAAQ;QACV,eAAU,GAAV,UAAU,CAAM;QAChB,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAQ;QACf,YAAO,GAAP,OAAO,CAAe;IAC9B,CAAC;CAIL;AAXD,kCAWC"}
@@ -0,0 +1,3 @@
1
+ export { DomainEvent } from "./domain-event";
2
+ export type { DomainEventPrimitives } from "./domain-event-primitives";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domain-events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DomainEvent = void 0;
4
+ var domain_event_1 = require("./domain-event");
5
+ Object.defineProperty(exports, "DomainEvent", { enumerable: true, get: function () { return domain_event_1.DomainEvent; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domain-events/index.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAApC,2GAAA,WAAW,OAAA"}
@@ -0,0 +1,12 @@
1
+ import { ValueObject } from "../value-objects";
2
+ import { BaseModel } from "../models";
3
+ import { DomainEvent } from "../domain-events";
4
+ export declare abstract class Entity<Model extends BaseModel> {
5
+ readonly id: ValueObject;
6
+ private domainEvents;
7
+ constructor(id: ValueObject);
8
+ pullDomainEvents(): Array<DomainEvent>;
9
+ recordDomainEvent(domainEvent: DomainEvent): void;
10
+ abstract toPrimitives(): Model;
11
+ }
12
+ //# sourceMappingURL=entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../src/entities/entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,8BAAsB,MAAM,CAAC,KAAK,SAAS,SAAS;IAGtC,QAAQ,CAAC,EAAE,EAAE,WAAW;IAFpC,OAAO,CAAC,YAAY,CAA0B;gBAEzB,EAAE,EAAE,WAAW;IAEpC,gBAAgB,IAAI,KAAK,CAAC,WAAW,CAAC;IAOtC,iBAAiB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI;IAIjD,QAAQ,CAAC,YAAY,IAAI,KAAK;CAC/B"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Entity = void 0;
4
+ class Entity {
5
+ id;
6
+ domainEvents = [];
7
+ constructor(id) {
8
+ this.id = id;
9
+ }
10
+ pullDomainEvents() {
11
+ const domainEvents = [...this.domainEvents];
12
+ this.domainEvents = [];
13
+ return domainEvents;
14
+ }
15
+ recordDomainEvent(domainEvent) {
16
+ this.domainEvents.push(domainEvent);
17
+ }
18
+ }
19
+ exports.Entity = Entity;
20
+ //# sourceMappingURL=entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity.js","sourceRoot":"","sources":["../../src/entities/entity.ts"],"names":[],"mappings":";;;AAIA,MAAsB,MAAM;IAGL;IAFb,YAAY,GAAuB,EAAE,CAAC;IAE9C,YAAqB,EAAe;QAAf,OAAE,GAAF,EAAE,CAAa;IAAG,CAAC;IAExC,gBAAgB;QACd,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QAEvB,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,iBAAiB,CAAC,WAAwB;QACxC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;CAGF;AAjBD,wBAiBC"}
@@ -0,0 +1,2 @@
1
+ export { Entity } from "./entity";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Entity = void 0;
4
+ var entity_1 = require("./entity");
5
+ Object.defineProperty(exports, "Entity", { enumerable: true, get: function () { return entity_1.Entity; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA"}
@@ -0,0 +1,2 @@
1
+ export { PascalCamelToSnake } from "./pascal-camel-to-snake";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formatters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PascalCamelToSnake = void 0;
4
+ var pascal_camel_to_snake_1 = require("./pascal-camel-to-snake");
5
+ Object.defineProperty(exports, "PascalCamelToSnake", { enumerable: true, get: function () { return pascal_camel_to_snake_1.PascalCamelToSnake; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/formatters/index.ts"],"names":[],"mappings":";;;AAAA,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA"}
@@ -0,0 +1,4 @@
1
+ export declare class PascalCamelToSnake {
2
+ static format(text: string): string;
3
+ }
4
+ //# sourceMappingURL=pascal-camel-to-snake.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pascal-camel-to-snake.d.ts","sourceRoot":"","sources":["../../src/formatters/pascal-camel-to-snake.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;IAC7B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM;CAM3B"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PascalCamelToSnake = void 0;
4
+ class PascalCamelToSnake {
5
+ static format(text) {
6
+ return text
7
+ .replace(/([a-z0-9])([A-Z])/g, '$1_$2')
8
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
9
+ .toLowerCase();
10
+ }
11
+ }
12
+ exports.PascalCamelToSnake = PascalCamelToSnake;
13
+ //# sourceMappingURL=pascal-camel-to-snake.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pascal-camel-to-snake.js","sourceRoot":"","sources":["../../src/formatters/pascal-camel-to-snake.ts"],"names":[],"mappings":";;;AAAA,MAAa,kBAAkB;IAC7B,MAAM,CAAC,MAAM,CAAC,IAAY;QACxB,OAAO,IAAI;aACR,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC;aACtC,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC;aACzC,WAAW,EAAE,CAAC;IACnB,CAAC;CACF;AAPD,gDAOC"}
@@ -0,0 +1,6 @@
1
+ export declare class HTTPException extends Error {
2
+ readonly message: string;
3
+ readonly statusCode: number;
4
+ constructor(message: string, statusCode: number);
5
+ }
6
+ //# sourceMappingURL=http-exception.d.ts.map