@schorts/shared-kernel 1.0.3 → 1.0.5

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 (210) hide show
  1. package/CHANGELOG +15 -0
  2. package/README.md +5 -0
  3. package/__tests__/dao/dao.test.ts +116 -0
  4. package/__tests__/unit-of-work/unit-of-work.test.ts +47 -0
  5. package/dist/auth/auth-provider.d.ts +10 -0
  6. package/dist/auth/auth-provider.d.ts.map +1 -0
  7. package/dist/auth/auth-provider.js +3 -0
  8. package/dist/auth/auth-provider.js.map +1 -0
  9. package/dist/auth/exceptions/index.d.ts +2 -0
  10. package/dist/auth/exceptions/index.d.ts.map +1 -0
  11. package/dist/auth/exceptions/index.js +6 -0
  12. package/dist/auth/exceptions/index.js.map +1 -0
  13. package/dist/auth/exceptions/not-authenticated.d.ts +3 -0
  14. package/dist/auth/exceptions/not-authenticated.d.ts.map +1 -0
  15. package/dist/auth/exceptions/not-authenticated.js +7 -0
  16. package/dist/auth/exceptions/not-authenticated.js.map +1 -0
  17. package/dist/auth/index.d.ts +4 -0
  18. package/dist/auth/index.d.ts.map +1 -0
  19. package/dist/auth/index.js +8 -0
  20. package/dist/auth/index.js.map +1 -0
  21. package/dist/auth/require-auth.decorator.d.ts +5 -0
  22. package/dist/auth/require-auth.decorator.d.ts.map +1 -0
  23. package/dist/auth/require-auth.decorator.js +36 -0
  24. package/dist/auth/require-auth.decorator.js.map +1 -0
  25. package/dist/criteria/criteria.d.ts +15 -0
  26. package/dist/criteria/criteria.d.ts.map +1 -0
  27. package/dist/criteria/criteria.js +34 -0
  28. package/dist/criteria/criteria.js.map +1 -0
  29. package/dist/criteria/direction.d.ts +2 -0
  30. package/dist/criteria/direction.d.ts.map +1 -0
  31. package/dist/criteria/direction.js +3 -0
  32. package/dist/criteria/direction.js.map +1 -0
  33. package/dist/criteria/exceptions/index.d.ts +3 -0
  34. package/dist/criteria/exceptions/index.d.ts.map +1 -0
  35. package/dist/criteria/exceptions/index.js +8 -0
  36. package/dist/criteria/exceptions/index.js.map +1 -0
  37. package/dist/criteria/exceptions/limit-not-valid.d.ts +3 -0
  38. package/dist/criteria/exceptions/limit-not-valid.d.ts.map +1 -0
  39. package/dist/criteria/exceptions/limit-not-valid.js +7 -0
  40. package/dist/criteria/exceptions/limit-not-valid.js.map +1 -0
  41. package/dist/criteria/exceptions/offset-not-valid.d.ts +3 -0
  42. package/dist/criteria/exceptions/offset-not-valid.d.ts.map +1 -0
  43. package/dist/criteria/exceptions/offset-not-valid.js +7 -0
  44. package/dist/criteria/exceptions/offset-not-valid.js.map +1 -0
  45. package/dist/criteria/filter-criterion.d.ts +6 -0
  46. package/dist/criteria/filter-criterion.d.ts.map +1 -0
  47. package/dist/criteria/filter-criterion.js +3 -0
  48. package/dist/criteria/filter-criterion.js.map +1 -0
  49. package/dist/criteria/index.d.ts +7 -0
  50. package/dist/criteria/index.d.ts.map +1 -0
  51. package/dist/criteria/index.js +9 -0
  52. package/dist/criteria/index.js.map +1 -0
  53. package/dist/criteria/operator.d.ts +2 -0
  54. package/dist/criteria/operator.d.ts.map +1 -0
  55. package/dist/criteria/operator.js +3 -0
  56. package/dist/criteria/operator.js.map +1 -0
  57. package/dist/criteria/order.d.ts +5 -0
  58. package/dist/criteria/order.d.ts.map +1 -0
  59. package/dist/criteria/order.js +3 -0
  60. package/dist/criteria/order.js.map +1 -0
  61. package/dist/domain-events/domain-event-primitives.d.ts +8 -0
  62. package/dist/domain-events/domain-event-primitives.d.ts.map +1 -0
  63. package/dist/domain-events/domain-event-primitives.js +3 -0
  64. package/dist/domain-events/domain-event-primitives.js.map +1 -0
  65. package/dist/domain-events/domain-event.d.ts +13 -0
  66. package/dist/domain-events/domain-event.d.ts.map +1 -0
  67. package/dist/domain-events/domain-event.js +19 -0
  68. package/dist/domain-events/domain-event.js.map +1 -0
  69. package/dist/domain-events/index.d.ts +3 -0
  70. package/dist/domain-events/index.d.ts.map +1 -0
  71. package/dist/domain-events/index.js +6 -0
  72. package/dist/domain-events/index.js.map +1 -0
  73. package/dist/entities/entity.d.ts +12 -0
  74. package/dist/entities/entity.d.ts.map +1 -0
  75. package/dist/entities/entity.js +20 -0
  76. package/dist/entities/entity.js.map +1 -0
  77. package/dist/entities/index.d.ts +2 -0
  78. package/dist/entities/index.d.ts.map +1 -0
  79. package/dist/entities/index.js +6 -0
  80. package/dist/entities/index.js.map +1 -0
  81. package/dist/formatters/index.d.ts +2 -0
  82. package/dist/formatters/index.d.ts.map +1 -0
  83. package/dist/formatters/index.js +6 -0
  84. package/dist/formatters/index.js.map +1 -0
  85. package/dist/formatters/pascal-camel-to-snake.d.ts +4 -0
  86. package/dist/formatters/pascal-camel-to-snake.d.ts.map +1 -0
  87. package/dist/formatters/pascal-camel-to-snake.js +13 -0
  88. package/dist/formatters/pascal-camel-to-snake.js.map +1 -0
  89. package/dist/http/exceptions/http-exception.d.ts +6 -0
  90. package/dist/http/exceptions/http-exception.d.ts.map +1 -0
  91. package/dist/http/exceptions/http-exception.js +14 -0
  92. package/dist/http/exceptions/http-exception.js.map +1 -0
  93. package/dist/http/exceptions/index.d.ts +2 -0
  94. package/dist/http/exceptions/index.d.ts.map +1 -0
  95. package/dist/http/exceptions/index.js +6 -0
  96. package/dist/http/exceptions/index.js.map +1 -0
  97. package/dist/http/fetch-http-provider.d.ts +13 -0
  98. package/dist/http/fetch-http-provider.d.ts.map +1 -0
  99. package/dist/http/fetch-http-provider.js +88 -0
  100. package/dist/http/fetch-http-provider.js.map +1 -0
  101. package/dist/http/http-provider.d.ts +8 -0
  102. package/dist/http/http-provider.d.ts.map +1 -0
  103. package/dist/http/http-provider.js +3 -0
  104. package/dist/http/http-provider.js.map +1 -0
  105. package/dist/http/index.d.ts +4 -0
  106. package/dist/http/index.d.ts.map +1 -0
  107. package/dist/http/index.js +8 -0
  108. package/dist/http/index.js.map +1 -0
  109. package/dist/json-api/index.d.ts +5 -0
  110. package/dist/json-api/index.d.ts.map +1 -0
  111. package/dist/json-api/index.js +8 -0
  112. package/dist/json-api/index.js.map +1 -0
  113. package/dist/json-api/json-api-connector.d.ts +21 -0
  114. package/dist/json-api/json-api-connector.d.ts.map +1 -0
  115. package/dist/json-api/json-api-connector.js +29 -0
  116. package/dist/json-api/json-api-connector.js.map +1 -0
  117. package/dist/json-api/json-api-list.d.ts +14 -0
  118. package/dist/json-api/json-api-list.d.ts.map +1 -0
  119. package/dist/json-api/json-api-list.js +3 -0
  120. package/dist/json-api/json-api-list.js.map +1 -0
  121. package/dist/json-api/json-api-single.d.ts +14 -0
  122. package/dist/json-api/json-api-single.d.ts.map +1 -0
  123. package/dist/json-api/json-api-single.js +3 -0
  124. package/dist/json-api/json-api-single.js.map +1 -0
  125. package/dist/json-api/url-criteria-builder.d.ts +9 -0
  126. package/dist/json-api/url-criteria-builder.d.ts.map +1 -0
  127. package/dist/json-api/url-criteria-builder.js +49 -0
  128. package/dist/json-api/url-criteria-builder.js.map +1 -0
  129. package/dist/messages/index.d.ts +2 -0
  130. package/dist/messages/index.d.ts.map +1 -0
  131. package/dist/messages/index.js +3 -0
  132. package/dist/messages/index.js.map +1 -0
  133. package/dist/messages/message.d.ts +4 -0
  134. package/dist/messages/message.d.ts.map +1 -0
  135. package/dist/messages/message.js +3 -0
  136. package/dist/messages/message.js.map +1 -0
  137. package/dist/models/base-model.d.ts +4 -0
  138. package/dist/models/base-model.d.ts.map +1 -0
  139. package/dist/models/base-model.js +3 -0
  140. package/dist/models/base-model.js.map +1 -0
  141. package/dist/models/index.d.ts +2 -0
  142. package/dist/models/index.d.ts.map +1 -0
  143. package/dist/models/index.js +3 -0
  144. package/dist/models/index.js.map +1 -0
  145. package/dist/state-manager/index.d.ts +2 -0
  146. package/dist/state-manager/index.d.ts.map +1 -0
  147. package/dist/state-manager/index.js +6 -0
  148. package/dist/state-manager/index.js.map +1 -0
  149. package/dist/state-manager/state-manager.d.ts +12 -0
  150. package/dist/state-manager/state-manager.d.ts.map +1 -0
  151. package/dist/state-manager/state-manager.js +24 -0
  152. package/dist/state-manager/state-manager.js.map +1 -0
  153. package/dist/utils/index.d.ts +2 -0
  154. package/dist/utils/index.d.ts.map +1 -0
  155. package/dist/utils/index.js +6 -0
  156. package/dist/utils/index.js.map +1 -0
  157. package/dist/utils/url/index.d.ts +2 -0
  158. package/dist/utils/url/index.d.ts.map +1 -0
  159. package/dist/utils/url/index.js +6 -0
  160. package/dist/utils/url/index.js.map +1 -0
  161. package/dist/utils/url/url-with-params-builder.d.ts +7 -0
  162. package/dist/utils/url/url-with-params-builder.d.ts.map +1 -0
  163. package/dist/utils/url/url-with-params-builder.js +25 -0
  164. package/dist/utils/url/url-with-params-builder.js.map +1 -0
  165. package/dist/value-objects/coordinates-value.d.ts +15 -0
  166. package/dist/value-objects/coordinates-value.d.ts.map +1 -0
  167. package/dist/value-objects/coordinates-value.js +39 -0
  168. package/dist/value-objects/coordinates-value.js.map +1 -0
  169. package/dist/value-objects/email-value.d.ts +10 -0
  170. package/dist/value-objects/email-value.d.ts.map +1 -0
  171. package/dist/value-objects/email-value.js +23 -0
  172. package/dist/value-objects/email-value.js.map +1 -0
  173. package/dist/value-objects/enum-value.d.ts +11 -0
  174. package/dist/value-objects/enum-value.d.ts.map +1 -0
  175. package/dist/value-objects/enum-value.js +24 -0
  176. package/dist/value-objects/enum-value.js.map +1 -0
  177. package/dist/value-objects/index.d.ts +10 -0
  178. package/dist/value-objects/index.d.ts.map +1 -0
  179. package/dist/value-objects/index.js +20 -0
  180. package/dist/value-objects/index.js.map +1 -0
  181. package/dist/value-objects/integer-value.d.ts +12 -0
  182. package/dist/value-objects/integer-value.d.ts.map +1 -0
  183. package/dist/value-objects/integer-value.js +28 -0
  184. package/dist/value-objects/integer-value.js.map +1 -0
  185. package/dist/value-objects/phone-value.d.ts +13 -0
  186. package/dist/value-objects/phone-value.d.ts.map +1 -0
  187. package/dist/value-objects/phone-value.js +43 -0
  188. package/dist/value-objects/phone-value.js.map +1 -0
  189. package/dist/value-objects/slug-value.d.ts +10 -0
  190. package/dist/value-objects/slug-value.d.ts.map +1 -0
  191. package/dist/value-objects/slug-value.js +23 -0
  192. package/dist/value-objects/slug-value.js.map +1 -0
  193. package/dist/value-objects/string-value.d.ts +12 -0
  194. package/dist/value-objects/string-value.d.ts.map +1 -0
  195. package/dist/value-objects/string-value.js +26 -0
  196. package/dist/value-objects/string-value.js.map +1 -0
  197. package/dist/value-objects/uuid-value.d.ts +13 -0
  198. package/dist/value-objects/uuid-value.d.ts.map +1 -0
  199. package/dist/value-objects/uuid-value.js +29 -0
  200. package/dist/value-objects/uuid-value.js.map +1 -0
  201. package/dist/value-objects/value-object.d.ts +8 -0
  202. package/dist/value-objects/value-object.d.ts.map +1 -0
  203. package/dist/value-objects/value-object.js +3 -0
  204. package/dist/value-objects/value-object.js.map +1 -0
  205. package/jest.config.js +2 -2
  206. package/package.json +10 -1
  207. package/src/dao/dao.ts +13 -0
  208. package/src/dao/index.ts +1 -0
  209. package/src/unit-of-work/index.ts +1 -0
  210. package/src/unit-of-work/unit-of-work.ts +5 -0
package/CHANGELOG CHANGED
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.5] - 2025-09-30
9
+
10
+ ### Added
11
+
12
+ - Introduce `DAO` concept for a related package with a `Firestore` implementation.
13
+ - Introduce `UnitOfWOrk` concept for a related package with a `Firestore` implementation.
14
+
15
+ ## [1.0.4] - 2025-09-30
16
+
17
+ ### Fixed
18
+
19
+ - Add `dist` folder to the repo and NPM package.
20
+
8
21
  ## [1.0.3] - 2025-09-30
9
22
 
10
23
  ### Added
@@ -15,4 +28,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
28
 
16
29
  - Removed indirect dependencies from the `package.json`.
17
30
 
31
+ [1.0.5]: https://github.com/schorts99/shared-kernel/compare/v1.0.4...v0.0.5
32
+ [1.0.4]: https://github.com/schorts99/shared-kernel/compare/v1.0.3...v0.0.4
18
33
  [1.0.3]: https://github.com/schorts99/shared-kernel/releases/tag/v1.0.3
package/README.md CHANGED
@@ -44,6 +44,11 @@ npm install @schorts/shared-kernel --save
44
44
 
45
45
  - **BaseModel:** Base class for serializable, type-safe models.
46
46
 
47
+ ### 🛠 Persistence
48
+
49
+ - **DAO:** Generic interface defining data access operations for domain entities.
50
+ - **UnitOfWork:** Interface enabling transactional coordination across multiple persistence operations.
51
+
47
52
  ### 🧠 State Manager
48
53
 
49
54
  - **StateManager:** Abstract reactive state manager with listener support.
@@ -0,0 +1,116 @@
1
+ import { expectTypeOf } from "expect-type";
2
+
3
+ import { DAO } from "../../src/dao";
4
+ import { Entity } from "../../src/entities";
5
+ import { Criteria } from "../../src/criteria";
6
+
7
+ type Model = {
8
+ id: string;
9
+ name: string;
10
+ };
11
+
12
+ class ModelEntity extends Entity<Model> {
13
+ toPrimitives(): Model {
14
+ throw new Error("Method not implemented.");
15
+ }
16
+ }
17
+
18
+ describe("DAO", () => {
19
+ describe('#getAll', () => {
20
+ it('should declare the method', () => {
21
+ expectTypeOf<DAO<Model, ModelEntity>>().toHaveProperty("getAll");
22
+ });
23
+
24
+ it('should no require any arguments', () => {
25
+ expectTypeOf<DAO<Model, ModelEntity>['getAll']>().parameters.toEqualTypeOf<[]>();
26
+ });
27
+
28
+ it('should return a promise with the Entity', () => {
29
+ expectTypeOf<DAO<Model, ModelEntity>['getAll']>().returns.toEqualTypeOf<Promise<ModelEntity[]>>();
30
+ });
31
+ });
32
+
33
+ describe('#findByID', () => {
34
+ it('should declare the method', () => {
35
+ expectTypeOf<DAO<Model, ModelEntity>>().toHaveProperty("findByID");
36
+ });
37
+
38
+ it('should require the ID argument', () => {
39
+ expectTypeOf<DAO<Model, ModelEntity>['findByID']>().parameters.toEqualTypeOf<[ModelEntity["id"]["value"]]>();
40
+ });
41
+
42
+ it('should return a promise with the Entity or null', () => {
43
+ expectTypeOf<DAO<Model, ModelEntity>['findByID']>().returns.toEqualTypeOf<Promise<ModelEntity | null>>();
44
+ });
45
+ });
46
+
47
+ describe('#findOneBy', () => {
48
+ it('should declare the method', () => {
49
+ expectTypeOf<DAO<Model, ModelEntity>>().toHaveProperty("findOneBy");
50
+ });
51
+
52
+ it('should receive the criteria', () => {
53
+ expectTypeOf<DAO<Model, ModelEntity>['findOneBy']>().parameters.toEqualTypeOf<[Criteria]>();
54
+ });
55
+
56
+ it('should return a promise with the Entity or null', () => {
57
+ expectTypeOf<DAO<Model, ModelEntity>['findOneBy']>().returns.toEqualTypeOf<Promise<ModelEntity | null>>();
58
+ });
59
+ });
60
+
61
+ describe('#search', () => {
62
+ it('should declare the method', () => {
63
+ expectTypeOf<DAO<Model, ModelEntity>>().toHaveProperty("search");
64
+ });
65
+
66
+ it('should receive the criteria argument', () => {
67
+ expectTypeOf<DAO<Model, ModelEntity>['search']>().parameters.toEqualTypeOf<[Criteria]>();
68
+ });
69
+
70
+ it('should return a promise with an array of entities', () => {
71
+ expectTypeOf<DAO<Model, ModelEntity>['search']>().returns.toEqualTypeOf<Promise<ModelEntity[]>>();
72
+ });
73
+ });
74
+
75
+ describe('#create', () => {
76
+ it('should declare the method', () => {
77
+ expectTypeOf<DAO<Model, ModelEntity>>().toHaveProperty("create");
78
+ });
79
+
80
+ it('should receive the entity argument', () => {
81
+ expectTypeOf<DAO<Model, ModelEntity>['create']>().parameters.toEqualTypeOf<[ModelEntity]>();
82
+ });
83
+
84
+ it('should return a promise with the created entity', () => {
85
+ expectTypeOf<DAO<Model, ModelEntity>['create']>().returns.toEqualTypeOf<Promise<ModelEntity>>();
86
+ });
87
+ });
88
+
89
+ describe('#update', () => {
90
+ it('should declare the method', () => {
91
+ expectTypeOf<DAO<Model, ModelEntity>>().toHaveProperty("update");
92
+ });
93
+
94
+ it('should receive the entity argument', () => {
95
+ expectTypeOf<DAO<Model, ModelEntity>['update']>().parameters.toEqualTypeOf<[ModelEntity]>();
96
+ });
97
+
98
+ it('should return a promise with the updated entity', () => {
99
+ expectTypeOf<DAO<Model, ModelEntity>['update']>().returns.toEqualTypeOf<Promise<ModelEntity>>();
100
+ });
101
+ });
102
+
103
+ describe('#delete', () => {
104
+ it('should declare the method', () => {
105
+ expectTypeOf<DAO<Model, ModelEntity>>().toHaveProperty("delete");
106
+ });
107
+
108
+ it('should receive the entity argument', () => {
109
+ expectTypeOf<DAO<Model, ModelEntity>['delete']>().parameters.toEqualTypeOf<[ModelEntity]>();
110
+ });
111
+
112
+ it('should return a promise with the deleted entity', () => {
113
+ expectTypeOf<DAO<Model, ModelEntity>['delete']>().returns.toEqualTypeOf<Promise<ModelEntity>>();
114
+ });
115
+ });
116
+ });
@@ -0,0 +1,47 @@
1
+ import { expectTypeOf } from "expect-type";
2
+
3
+ import { UnitOfWork } from "../../src/unit-of-work";
4
+
5
+ describe("UnitOfWork", () => {
6
+ describe('#begin', () => {
7
+ it('should declare the method', () => {
8
+ expectTypeOf<UnitOfWork>().toHaveProperty("begin");
9
+ });
10
+
11
+ it('should no require any arguments', () => {
12
+ expectTypeOf<UnitOfWork['begin']>().parameters.toEqualTypeOf<[]>();
13
+ });
14
+
15
+ it('should return a promise', () => {
16
+ expectTypeOf<UnitOfWork['begin']>().returns.toEqualTypeOf<Promise<void>>();
17
+ });
18
+ })
19
+
20
+ describe('#commit', () => {
21
+ it('should declare the method', () => {
22
+ expectTypeOf<UnitOfWork>().toHaveProperty("commit");
23
+ });
24
+
25
+ it('should no require any arguments', () => {
26
+ expectTypeOf<UnitOfWork['commit']>().parameters.toEqualTypeOf<[]>();
27
+ });
28
+
29
+ it('should return a promise', () => {
30
+ expectTypeOf<UnitOfWork['commit']>().returns.toEqualTypeOf<Promise<void>>();
31
+ });
32
+ })
33
+
34
+ describe('#rollback', () => {
35
+ it('should declare the method', () => {
36
+ expectTypeOf<UnitOfWork>().toHaveProperty("rollback");
37
+ });
38
+
39
+ it('should no require any arguments', () => {
40
+ expectTypeOf<UnitOfWork['rollback']>().parameters.toEqualTypeOf<[]>();
41
+ });
42
+
43
+ it('should return a promise', () => {
44
+ expectTypeOf<UnitOfWork['rollback']>().returns.toEqualTypeOf<Promise<void>>();
45
+ });
46
+ })
47
+ });
@@ -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"}