@cratis/chronicle 0.0.1 → 0.2.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 (1107) hide show
  1. package/EventStore.ts +41 -19
  2. package/IEventStore.ts +24 -8
  3. package/README.md +1 -1
  4. package/artifacts/DefaultClientArtifactsProvider.ts +11 -2
  5. package/artifacts/IClientArtifactsProvider.ts +8 -2
  6. package/auditing/Causation.ts +29 -0
  7. package/auditing/CausationManager.ts +51 -0
  8. package/auditing/CausationType.ts +38 -0
  9. package/auditing/ICausationManager.ts +29 -0
  10. package/auditing/index.ts +15 -0
  11. package/connection/ChronicleConnection.ts +314 -216
  12. package/connection/ChronicleConnectionString.ts +327 -1
  13. package/connection/ChronicleServices.ts +42 -1
  14. package/connection/Guid.ts +27 -1
  15. package/connection/TokenProvider.ts +128 -6
  16. package/correlation/CorrelationId.ts +33 -0
  17. package/correlation/CorrelationIdManager.ts +30 -0
  18. package/correlation/ICorrelationIdAccessor.ts +15 -0
  19. package/correlation/ICorrelationIdSetter.ts +21 -0
  20. package/correlation/index.ts +15 -0
  21. package/dist/EventStore.d.ts +16 -8
  22. package/dist/EventStore.d.ts.map +1 -1
  23. package/dist/EventStore.js +28 -12
  24. package/dist/EventStore.js.map +1 -1
  25. package/dist/IEventStore.d.ts +20 -8
  26. package/dist/IEventStore.d.ts.map +1 -1
  27. package/dist/artifacts/DefaultClientArtifactsProvider.d.ts +4 -1
  28. package/dist/artifacts/DefaultClientArtifactsProvider.d.ts.map +1 -1
  29. package/dist/artifacts/DefaultClientArtifactsProvider.js +9 -2
  30. package/dist/artifacts/DefaultClientArtifactsProvider.js.map +1 -1
  31. package/dist/artifacts/IClientArtifactsProvider.d.ts +6 -2
  32. package/dist/artifacts/IClientArtifactsProvider.d.ts.map +1 -1
  33. package/dist/auditing/Causation.d.ts +22 -0
  34. package/dist/auditing/Causation.d.ts.map +1 -0
  35. package/dist/auditing/Causation.js +30 -0
  36. package/dist/auditing/Causation.js.map +1 -0
  37. package/dist/auditing/CausationManager.d.ts +23 -0
  38. package/dist/auditing/CausationManager.d.ts.map +1 -0
  39. package/dist/auditing/CausationManager.js +45 -0
  40. package/dist/auditing/CausationManager.js.map +1 -0
  41. package/dist/auditing/CausationType.d.ts +30 -0
  42. package/dist/auditing/CausationType.d.ts.map +1 -0
  43. package/dist/auditing/CausationType.js +36 -0
  44. package/dist/auditing/CausationType.js.map +1 -0
  45. package/dist/auditing/ICausationManager.d.ts +24 -0
  46. package/dist/auditing/ICausationManager.d.ts.map +1 -0
  47. package/dist/auditing/ICausationManager.js +4 -0
  48. package/dist/auditing/ICausationManager.js.map +1 -0
  49. package/dist/auditing/index.d.ts +11 -0
  50. package/dist/auditing/index.d.ts.map +1 -0
  51. package/dist/auditing/index.js +12 -0
  52. package/dist/auditing/index.js.map +1 -0
  53. package/dist/connection/ChronicleConnection.d.ts +49 -78
  54. package/dist/connection/ChronicleConnection.d.ts.map +1 -1
  55. package/dist/connection/ChronicleConnection.js +140 -130
  56. package/dist/connection/ChronicleConnection.js.map +1 -1
  57. package/dist/connection/ChronicleConnectionString.d.ts +78 -1
  58. package/dist/connection/ChronicleConnectionString.d.ts.map +1 -1
  59. package/dist/connection/ChronicleConnectionString.js +251 -1
  60. package/dist/connection/ChronicleConnectionString.js.map +1 -1
  61. package/dist/connection/ChronicleServices.d.ts +23 -1
  62. package/dist/connection/ChronicleServices.d.ts.map +1 -1
  63. package/dist/connection/Guid.d.ts +8 -1
  64. package/dist/connection/Guid.d.ts.map +1 -1
  65. package/dist/connection/Guid.js +22 -1
  66. package/dist/connection/Guid.js.map +1 -1
  67. package/dist/connection/TokenProvider.d.ts +37 -3
  68. package/dist/connection/TokenProvider.d.ts.map +1 -1
  69. package/dist/connection/TokenProvider.js +95 -1
  70. package/dist/connection/TokenProvider.js.map +1 -1
  71. package/dist/correlation/CorrelationId.d.ts +23 -0
  72. package/dist/correlation/CorrelationId.d.ts.map +1 -0
  73. package/dist/correlation/CorrelationId.js +32 -0
  74. package/dist/correlation/CorrelationId.js.map +1 -0
  75. package/dist/correlation/CorrelationIdManager.d.ts +17 -0
  76. package/dist/correlation/CorrelationIdManager.d.ts.map +1 -0
  77. package/dist/correlation/CorrelationIdManager.js +24 -0
  78. package/dist/correlation/CorrelationIdManager.js.map +1 -0
  79. package/dist/correlation/ICorrelationIdAccessor.d.ts +12 -0
  80. package/dist/correlation/ICorrelationIdAccessor.d.ts.map +1 -0
  81. package/dist/correlation/ICorrelationIdAccessor.js +4 -0
  82. package/dist/correlation/ICorrelationIdAccessor.js.map +1 -0
  83. package/dist/correlation/ICorrelationIdSetter.d.ts +17 -0
  84. package/dist/correlation/ICorrelationIdSetter.d.ts.map +1 -0
  85. package/dist/correlation/ICorrelationIdSetter.js +4 -0
  86. package/dist/correlation/ICorrelationIdSetter.js.map +1 -0
  87. package/dist/correlation/index.d.ts +11 -0
  88. package/dist/correlation/index.d.ts.map +1 -0
  89. package/dist/correlation/index.js +11 -0
  90. package/dist/correlation/index.js.map +1 -0
  91. package/dist/eventSequences/AppendError.d.ts.map +1 -0
  92. package/dist/eventSequences/AppendError.js.map +1 -0
  93. package/dist/eventSequences/AppendOptions.d.ts +14 -0
  94. package/dist/eventSequences/AppendOptions.d.ts.map +1 -0
  95. package/dist/eventSequences/AppendOptions.js.map +1 -0
  96. package/dist/eventSequences/AppendResult.d.ts.map +1 -0
  97. package/dist/eventSequences/AppendResult.js.map +1 -0
  98. package/dist/eventSequences/ConcurrencyScope.d.ts +19 -0
  99. package/dist/eventSequences/ConcurrencyScope.d.ts.map +1 -0
  100. package/dist/eventSequences/ConcurrencyScope.js +4 -0
  101. package/dist/eventSequences/ConcurrencyScope.js.map +1 -0
  102. package/dist/eventSequences/ConstraintViolation.d.ts.map +1 -0
  103. package/dist/eventSequences/ConstraintViolation.js.map +1 -0
  104. package/dist/eventSequences/EventForEventSourceId.d.ts +10 -0
  105. package/dist/eventSequences/EventForEventSourceId.d.ts.map +1 -0
  106. package/dist/eventSequences/EventForEventSourceId.js +4 -0
  107. package/dist/eventSequences/EventForEventSourceId.js.map +1 -0
  108. package/dist/eventSequences/EventLog.d.ts +12 -0
  109. package/dist/eventSequences/EventLog.d.ts.map +1 -0
  110. package/dist/eventSequences/EventLog.js +14 -0
  111. package/dist/eventSequences/EventLog.js.map +1 -0
  112. package/dist/eventSequences/EventSequence.d.ts +34 -0
  113. package/dist/eventSequences/EventSequence.d.ts.map +1 -0
  114. package/dist/eventSequences/EventSequence.js +365 -0
  115. package/dist/eventSequences/EventSequence.js.map +1 -0
  116. package/dist/eventSequences/EventSequenceId.d.ts.map +1 -0
  117. package/dist/eventSequences/EventSequenceId.js.map +1 -0
  118. package/dist/eventSequences/EventSequenceNumber.d.ts +26 -0
  119. package/dist/eventSequences/EventSequenceNumber.d.ts.map +1 -0
  120. package/dist/eventSequences/EventSequenceNumber.js +36 -0
  121. package/dist/eventSequences/EventSequenceNumber.js.map +1 -0
  122. package/dist/eventSequences/IEventLog.d.ts.map +1 -0
  123. package/dist/eventSequences/IEventLog.js.map +1 -0
  124. package/dist/eventSequences/IEventSequence.d.ts +51 -0
  125. package/dist/eventSequences/IEventSequence.d.ts.map +1 -0
  126. package/dist/eventSequences/IEventSequence.js.map +1 -0
  127. package/dist/eventSequences/ITransactionalEventSequence.d.ts +21 -0
  128. package/dist/eventSequences/ITransactionalEventSequence.d.ts.map +1 -0
  129. package/dist/eventSequences/ITransactionalEventSequence.js +4 -0
  130. package/dist/eventSequences/ITransactionalEventSequence.js.map +1 -0
  131. package/dist/eventSequences/TransactionalEventSequence.d.ts +19 -0
  132. package/dist/eventSequences/TransactionalEventSequence.d.ts.map +1 -0
  133. package/dist/eventSequences/TransactionalEventSequence.js +28 -0
  134. package/dist/eventSequences/TransactionalEventSequence.js.map +1 -0
  135. package/dist/eventSequences/index.d.ts +15 -0
  136. package/dist/eventSequences/index.d.ts.map +1 -0
  137. package/dist/eventSequences/index.js +8 -0
  138. package/dist/eventSequences/index.js.map +1 -0
  139. package/dist/events/AppendedEvent.d.ts.map +1 -0
  140. package/dist/events/AppendedEvent.js.map +1 -0
  141. package/dist/events/CausationEntry.d.ts.map +1 -0
  142. package/dist/events/CausationEntry.js.map +1 -0
  143. package/dist/events/EventContext.d.ts +20 -0
  144. package/dist/events/EventContext.d.ts.map +1 -0
  145. package/dist/events/EventContext.js.map +1 -0
  146. package/dist/events/EventType.d.ts.map +1 -0
  147. package/dist/events/EventType.js.map +1 -0
  148. package/dist/events/EventTypeGeneration.d.ts.map +1 -0
  149. package/dist/events/EventTypeGeneration.js.map +1 -0
  150. package/dist/events/EventTypeId.d.ts.map +1 -0
  151. package/dist/events/EventTypeId.js.map +1 -0
  152. package/dist/events/EventTypes.d.ts +35 -0
  153. package/dist/events/EventTypes.d.ts.map +1 -0
  154. package/dist/events/EventTypes.js +157 -0
  155. package/dist/events/EventTypes.js.map +1 -0
  156. package/dist/events/IEventTypes.d.ts.map +1 -0
  157. package/dist/events/IEventTypes.js.map +1 -0
  158. package/dist/events/constraints/ConstraintBuilder.d.ts.map +1 -0
  159. package/dist/events/constraints/ConstraintBuilder.js.map +1 -0
  160. package/dist/events/constraints/ConstraintId.d.ts.map +1 -0
  161. package/dist/events/constraints/ConstraintId.js.map +1 -0
  162. package/dist/events/constraints/Constraints.d.ts.map +1 -0
  163. package/dist/events/constraints/Constraints.js.map +1 -0
  164. package/dist/events/constraints/IConstraint.d.ts.map +1 -0
  165. package/dist/events/constraints/IConstraint.js.map +1 -0
  166. package/dist/events/constraints/IConstraintBuilder.d.ts.map +1 -0
  167. package/dist/events/constraints/IConstraintBuilder.js.map +1 -0
  168. package/dist/events/constraints/IConstraints.d.ts.map +1 -0
  169. package/dist/events/constraints/IConstraints.js.map +1 -0
  170. package/dist/events/constraints/IUniqueConstraintBuilder.d.ts.map +1 -0
  171. package/dist/events/constraints/IUniqueConstraintBuilder.js.map +1 -0
  172. package/dist/events/constraints/UniqueConstraintBuilder.d.ts.map +1 -0
  173. package/dist/events/constraints/UniqueConstraintBuilder.js.map +1 -0
  174. package/dist/events/constraints/constraint.d.ts.map +1 -0
  175. package/dist/events/constraints/constraint.js.map +1 -0
  176. package/dist/events/constraints/index.d.ts.map +1 -0
  177. package/dist/events/constraints/index.js.map +1 -0
  178. package/dist/events/eventTypeDecorator.d.ts +71 -0
  179. package/dist/events/eventTypeDecorator.d.ts.map +1 -0
  180. package/dist/events/eventTypeDecorator.js +86 -0
  181. package/dist/events/eventTypeDecorator.js.map +1 -0
  182. package/dist/events/index.d.ts +13 -0
  183. package/dist/events/index.d.ts.map +1 -0
  184. package/dist/events/index.js +10 -0
  185. package/dist/events/index.js.map +1 -0
  186. package/dist/events/migrations/EventMigrationBuilder.d.ts +16 -0
  187. package/dist/events/migrations/EventMigrationBuilder.d.ts.map +1 -0
  188. package/dist/events/migrations/EventMigrationBuilder.js +27 -0
  189. package/dist/events/migrations/EventMigrationBuilder.js.map +1 -0
  190. package/dist/events/migrations/EventMigrationPropertyBuilder.d.ts +20 -0
  191. package/dist/events/migrations/EventMigrationPropertyBuilder.d.ts.map +1 -0
  192. package/dist/events/migrations/EventMigrationPropertyBuilder.js +54 -0
  193. package/dist/events/migrations/EventMigrationPropertyBuilder.js.map +1 -0
  194. package/dist/events/migrations/EventTypeMigrators.d.ts +21 -0
  195. package/dist/events/migrations/EventTypeMigrators.d.ts.map +1 -0
  196. package/dist/events/migrations/EventTypeMigrators.js +41 -0
  197. package/dist/events/migrations/EventTypeMigrators.js.map +1 -0
  198. package/dist/events/migrations/IEventMigrationBuilder.d.ts +12 -0
  199. package/dist/events/migrations/IEventMigrationBuilder.d.ts.map +1 -0
  200. package/dist/events/migrations/IEventMigrationBuilder.js +4 -0
  201. package/dist/events/migrations/IEventMigrationBuilder.js.map +1 -0
  202. package/dist/events/migrations/IEventMigrationPropertyBuilder.d.ts +37 -0
  203. package/dist/events/migrations/IEventMigrationPropertyBuilder.d.ts.map +1 -0
  204. package/dist/events/migrations/IEventMigrationPropertyBuilder.js +4 -0
  205. package/dist/events/migrations/IEventMigrationPropertyBuilder.js.map +1 -0
  206. package/dist/events/migrations/IEventTypeMigration.d.ts +17 -0
  207. package/dist/events/migrations/IEventTypeMigration.d.ts.map +1 -0
  208. package/dist/events/migrations/IEventTypeMigration.js +4 -0
  209. package/dist/events/migrations/IEventTypeMigration.js.map +1 -0
  210. package/dist/events/migrations/IEventTypeMigrators.d.ts +17 -0
  211. package/dist/events/migrations/IEventTypeMigrators.d.ts.map +1 -0
  212. package/dist/events/migrations/IEventTypeMigrators.js +4 -0
  213. package/dist/events/migrations/IEventTypeMigrators.js.map +1 -0
  214. package/dist/events/migrations/InvalidMigrationGenerationGap.d.ts +7 -0
  215. package/dist/events/migrations/InvalidMigrationGenerationGap.d.ts.map +1 -0
  216. package/dist/events/migrations/InvalidMigrationGenerationGap.js +12 -0
  217. package/dist/events/migrations/InvalidMigrationGenerationGap.js.map +1 -0
  218. package/dist/events/migrations/eventTypeMigration.d.ts +33 -0
  219. package/dist/events/migrations/eventTypeMigration.d.ts.map +1 -0
  220. package/dist/events/migrations/eventTypeMigration.js +52 -0
  221. package/dist/events/migrations/eventTypeMigration.js.map +1 -0
  222. package/dist/events/migrations/index.d.ts +11 -0
  223. package/dist/events/migrations/index.d.ts.map +1 -0
  224. package/dist/events/migrations/index.js +8 -0
  225. package/dist/events/migrations/index.js.map +1 -0
  226. package/dist/identity/IIdentityProvider.d.ts +21 -0
  227. package/dist/identity/IIdentityProvider.d.ts.map +1 -0
  228. package/dist/identity/IIdentityProvider.js +4 -0
  229. package/dist/identity/IIdentityProvider.js.map +1 -0
  230. package/dist/identity/Identity.d.ts +37 -0
  231. package/dist/identity/Identity.d.ts.map +1 -0
  232. package/dist/identity/Identity.js +60 -0
  233. package/dist/identity/Identity.js.map +1 -0
  234. package/dist/identity/IdentityProvider.d.ts +15 -0
  235. package/dist/identity/IdentityProvider.d.ts.map +1 -0
  236. package/dist/identity/IdentityProvider.js +23 -0
  237. package/dist/identity/IdentityProvider.js.map +1 -0
  238. package/dist/identity/index.d.ts +10 -0
  239. package/dist/identity/index.d.ts.map +1 -0
  240. package/dist/identity/index.js +11 -0
  241. package/dist/identity/index.js.map +1 -0
  242. package/dist/index.d.ts +35 -8
  243. package/dist/index.d.ts.map +1 -1
  244. package/dist/index.js +35 -8
  245. package/dist/index.js.map +1 -1
  246. package/dist/jobs/IJobs.d.ts +41 -0
  247. package/dist/jobs/IJobs.d.ts.map +1 -0
  248. package/dist/jobs/IJobs.js +4 -0
  249. package/dist/jobs/IJobs.js.map +1 -0
  250. package/dist/jobs/JobId.d.ts +17 -0
  251. package/dist/jobs/JobId.d.ts.map +1 -0
  252. package/dist/jobs/JobId.js +25 -0
  253. package/dist/jobs/JobId.js.map +1 -0
  254. package/dist/jobs/Jobs.d.ts +35 -0
  255. package/dist/jobs/Jobs.d.ts.map +1 -0
  256. package/dist/jobs/Jobs.js +71 -0
  257. package/dist/jobs/Jobs.js.map +1 -0
  258. package/dist/jobs/index.d.ts +4 -0
  259. package/dist/jobs/index.d.ts.map +1 -0
  260. package/dist/jobs/index.js +5 -0
  261. package/dist/jobs/index.js.map +1 -0
  262. package/dist/observation/ObserverId.d.ts.map +1 -0
  263. package/dist/observation/ObserverId.js.map +1 -0
  264. package/dist/observation/ObserverRunningState.d.ts.map +1 -0
  265. package/dist/observation/ObserverRunningState.js.map +1 -0
  266. package/dist/observation/index.d.ts.map +1 -0
  267. package/dist/observation/index.js.map +1 -0
  268. package/dist/projections/IProjections.d.ts.map +1 -0
  269. package/dist/projections/IProjections.js.map +1 -0
  270. package/dist/projections/ProjectionId.d.ts.map +1 -0
  271. package/dist/projections/ProjectionId.js.map +1 -0
  272. package/dist/projections/Projections.d.ts +44 -0
  273. package/dist/projections/Projections.d.ts.map +1 -0
  274. package/dist/projections/Projections.js +441 -0
  275. package/dist/projections/Projections.js.map +1 -0
  276. package/dist/projections/declarative/AllSetBuilder.d.ts.map +1 -0
  277. package/dist/projections/declarative/AllSetBuilder.js.map +1 -0
  278. package/dist/projections/declarative/FromBuilder.d.ts.map +1 -0
  279. package/dist/projections/declarative/FromBuilder.js.map +1 -0
  280. package/dist/projections/declarative/FromEveryBuilder.d.ts.map +1 -0
  281. package/dist/projections/declarative/FromEveryBuilder.js.map +1 -0
  282. package/dist/projections/declarative/IAddBuilder.d.ts.map +1 -0
  283. package/dist/projections/declarative/IAddBuilder.js.map +1 -0
  284. package/dist/projections/declarative/IAddChildBuilder.d.ts.map +1 -0
  285. package/dist/projections/declarative/IAddChildBuilder.js.map +1 -0
  286. package/dist/projections/declarative/IAllSetBuilder.d.ts.map +1 -0
  287. package/dist/projections/declarative/IAllSetBuilder.js.map +1 -0
  288. package/dist/projections/declarative/IChildrenBuilder.d.ts.map +1 -0
  289. package/dist/projections/declarative/IChildrenBuilder.js.map +1 -0
  290. package/dist/projections/declarative/ICompositeKeyBuilder.d.ts.map +1 -0
  291. package/dist/projections/declarative/ICompositeKeyBuilder.js.map +1 -0
  292. package/dist/projections/declarative/IFromBuilder.d.ts.map +1 -0
  293. package/dist/projections/declarative/IFromBuilder.js.map +1 -0
  294. package/dist/projections/declarative/IFromEveryBuilder.d.ts.map +1 -0
  295. package/dist/projections/declarative/IFromEveryBuilder.js.map +1 -0
  296. package/dist/projections/declarative/IJoinBuilder.d.ts.map +1 -0
  297. package/dist/projections/declarative/IJoinBuilder.js.map +1 -0
  298. package/dist/projections/declarative/INestedBuilder.d.ts.map +1 -0
  299. package/dist/projections/declarative/INestedBuilder.js.map +1 -0
  300. package/dist/projections/declarative/IProjectionBuilder.d.ts.map +1 -0
  301. package/dist/projections/declarative/IProjectionBuilder.js.map +1 -0
  302. package/dist/projections/declarative/IProjectionBuilderFor.d.ts.map +1 -0
  303. package/dist/projections/declarative/IProjectionBuilderFor.js.map +1 -0
  304. package/dist/projections/declarative/IProjectionFor.d.ts.map +1 -0
  305. package/dist/projections/declarative/IProjectionFor.js.map +1 -0
  306. package/dist/projections/declarative/IReadModelPropertiesBuilder.d.ts.map +1 -0
  307. package/dist/projections/declarative/IReadModelPropertiesBuilder.js.map +1 -0
  308. package/dist/projections/declarative/IRemovedWithBuilder.d.ts.map +1 -0
  309. package/dist/projections/declarative/IRemovedWithBuilder.js.map +1 -0
  310. package/dist/projections/declarative/IRemovedWithJoinBuilder.d.ts.map +1 -0
  311. package/dist/projections/declarative/IRemovedWithJoinBuilder.js.map +1 -0
  312. package/dist/projections/declarative/ISetBuilder.d.ts.map +1 -0
  313. package/dist/projections/declarative/ISetBuilder.js.map +1 -0
  314. package/dist/projections/declarative/ISubtractBuilder.d.ts.map +1 -0
  315. package/dist/projections/declarative/ISubtractBuilder.js.map +1 -0
  316. package/dist/projections/declarative/JoinBuilder.d.ts.map +1 -0
  317. package/dist/projections/declarative/JoinBuilder.js.map +1 -0
  318. package/dist/projections/declarative/ProjectionBuilderFor.d.ts +74 -0
  319. package/dist/projections/declarative/ProjectionBuilderFor.d.ts.map +1 -0
  320. package/dist/projections/declarative/ProjectionBuilderFor.js +223 -0
  321. package/dist/projections/declarative/ProjectionBuilderFor.js.map +1 -0
  322. package/dist/projections/declarative/RemovedWithBuilder.d.ts.map +1 -0
  323. package/dist/projections/declarative/RemovedWithBuilder.js.map +1 -0
  324. package/dist/projections/declarative/RemovedWithJoinBuilder.d.ts.map +1 -0
  325. package/dist/projections/declarative/RemovedWithJoinBuilder.js.map +1 -0
  326. package/dist/projections/declarative/SetBuilder.d.ts.map +1 -0
  327. package/dist/projections/declarative/SetBuilder.js.map +1 -0
  328. package/dist/projections/declarative/index.d.ts.map +1 -0
  329. package/dist/projections/declarative/index.js.map +1 -0
  330. package/dist/projections/declarative/projection.d.ts +35 -0
  331. package/dist/projections/declarative/projection.d.ts.map +1 -0
  332. package/dist/projections/declarative/projection.js +40 -0
  333. package/dist/projections/declarative/projection.js.map +1 -0
  334. package/dist/projections/index.d.ts.map +1 -0
  335. package/dist/projections/index.js.map +1 -0
  336. package/dist/projections/modelBound/FromEventMetadata.d.ts.map +1 -0
  337. package/dist/projections/modelBound/FromEventMetadata.js.map +1 -0
  338. package/dist/projections/modelBound/FromEventOptions.d.ts.map +1 -0
  339. package/dist/projections/modelBound/FromEventOptions.js.map +1 -0
  340. package/dist/projections/modelBound/addFrom.d.ts.map +1 -0
  341. package/dist/projections/modelBound/addFrom.js.map +1 -0
  342. package/dist/projections/modelBound/childrenFrom.d.ts.map +1 -0
  343. package/dist/projections/modelBound/childrenFrom.js.map +1 -0
  344. package/dist/projections/modelBound/clearWith.d.ts.map +1 -0
  345. package/dist/projections/modelBound/clearWith.js.map +1 -0
  346. package/dist/projections/modelBound/count.d.ts.map +1 -0
  347. package/dist/projections/modelBound/count.js.map +1 -0
  348. package/dist/projections/modelBound/decrement.d.ts.map +1 -0
  349. package/dist/projections/modelBound/decrement.js.map +1 -0
  350. package/dist/projections/modelBound/fromEvent.d.ts.map +1 -0
  351. package/dist/projections/modelBound/fromEvent.js.map +1 -0
  352. package/dist/projections/modelBound/fromEvery.d.ts.map +1 -0
  353. package/dist/projections/modelBound/fromEvery.js.map +1 -0
  354. package/dist/projections/modelBound/increment.d.ts.map +1 -0
  355. package/dist/projections/modelBound/increment.js.map +1 -0
  356. package/dist/projections/modelBound/index.d.ts +34 -0
  357. package/dist/projections/modelBound/index.d.ts.map +1 -0
  358. package/dist/projections/modelBound/index.js +20 -0
  359. package/dist/projections/modelBound/index.js.map +1 -0
  360. package/dist/projections/modelBound/join.d.ts.map +1 -0
  361. package/dist/projections/modelBound/join.js.map +1 -0
  362. package/dist/projections/modelBound/nested.d.ts.map +1 -0
  363. package/dist/projections/modelBound/nested.js.map +1 -0
  364. package/dist/projections/modelBound/notRewindable.d.ts.map +1 -0
  365. package/dist/projections/modelBound/notRewindable.js.map +1 -0
  366. package/dist/projections/modelBound/removedWith.d.ts.map +1 -0
  367. package/dist/projections/modelBound/removedWith.js.map +1 -0
  368. package/dist/projections/modelBound/removedWithJoin.d.ts.map +1 -0
  369. package/dist/projections/modelBound/removedWithJoin.js.map +1 -0
  370. package/dist/projections/modelBound/setFrom.d.ts.map +1 -0
  371. package/dist/projections/modelBound/setFrom.js.map +1 -0
  372. package/dist/projections/modelBound/setFromContext.d.ts +26 -0
  373. package/dist/projections/modelBound/setFromContext.d.ts.map +1 -0
  374. package/dist/projections/modelBound/setFromContext.js +35 -0
  375. package/dist/projections/modelBound/setFromContext.js.map +1 -0
  376. package/dist/projections/modelBound/setValue.d.ts.map +1 -0
  377. package/dist/projections/modelBound/setValue.js.map +1 -0
  378. package/dist/projections/modelBound/subtractFrom.d.ts.map +1 -0
  379. package/dist/projections/modelBound/subtractFrom.js.map +1 -0
  380. package/dist/reactors/IReactors.d.ts.map +1 -0
  381. package/dist/reactors/IReactors.js.map +1 -0
  382. package/dist/reactors/ReactorId.d.ts.map +1 -0
  383. package/dist/reactors/ReactorId.js.map +1 -0
  384. package/dist/reactors/Reactors.d.ts.map +1 -0
  385. package/dist/reactors/Reactors.js +280 -0
  386. package/dist/reactors/Reactors.js.map +1 -0
  387. package/dist/reactors/index.d.ts.map +1 -0
  388. package/dist/reactors/index.js.map +1 -0
  389. package/dist/reactors/reactor.d.ts.map +1 -0
  390. package/dist/reactors/reactor.js.map +1 -0
  391. package/dist/readModels/ReadModelId.d.ts.map +1 -0
  392. package/dist/readModels/ReadModelId.js.map +1 -0
  393. package/dist/readModels/index.d.ts.map +1 -0
  394. package/dist/readModels/index.js.map +1 -0
  395. package/dist/readModels/readModel.d.ts +33 -0
  396. package/dist/readModels/readModel.d.ts.map +1 -0
  397. package/dist/readModels/readModel.js +64 -0
  398. package/dist/readModels/readModel.js.map +1 -0
  399. package/dist/reducers/IReducers.d.ts.map +1 -0
  400. package/dist/reducers/IReducers.js.map +1 -0
  401. package/dist/reducers/ReducerId.d.ts.map +1 -0
  402. package/dist/reducers/ReducerId.js.map +1 -0
  403. package/dist/reducers/Reducers.d.ts +40 -0
  404. package/dist/reducers/Reducers.d.ts.map +1 -0
  405. package/dist/reducers/Reducers.js +337 -0
  406. package/dist/reducers/Reducers.js.map +1 -0
  407. package/dist/reducers/index.d.ts.map +1 -0
  408. package/dist/reducers/index.js.map +1 -0
  409. package/dist/reducers/reducer.d.ts.map +1 -0
  410. package/dist/reducers/reducer.js.map +1 -0
  411. package/dist/schemas/JsonSchema.d.ts.map +1 -0
  412. package/dist/schemas/JsonSchema.js.map +1 -0
  413. package/dist/schemas/JsonSchemaGenerator.d.ts.map +1 -0
  414. package/dist/schemas/JsonSchemaGenerator.js +104 -0
  415. package/dist/schemas/JsonSchemaGenerator.js.map +1 -0
  416. package/dist/schemas/index.d.ts.map +1 -0
  417. package/dist/schemas/index.js.map +1 -0
  418. package/dist/schemas/jsonSchemaProperty.d.ts.map +1 -0
  419. package/dist/schemas/jsonSchemaProperty.js.map +1 -0
  420. package/dist/seeding/EventSeeding.d.ts +40 -0
  421. package/dist/seeding/EventSeeding.d.ts.map +1 -0
  422. package/dist/seeding/EventSeeding.js +150 -0
  423. package/dist/seeding/EventSeeding.js.map +1 -0
  424. package/dist/seeding/ICanSeedEvents.d.ts +12 -0
  425. package/dist/seeding/ICanSeedEvents.d.ts.map +1 -0
  426. package/dist/seeding/ICanSeedEvents.js +4 -0
  427. package/dist/seeding/ICanSeedEvents.js.map +1 -0
  428. package/dist/seeding/IEventSeeding.d.ts +17 -0
  429. package/dist/seeding/IEventSeeding.d.ts.map +1 -0
  430. package/dist/seeding/IEventSeeding.js +4 -0
  431. package/dist/seeding/IEventSeeding.js.map +1 -0
  432. package/dist/seeding/IEventSeedingBuilder.d.ts +30 -0
  433. package/dist/seeding/IEventSeedingBuilder.d.ts.map +1 -0
  434. package/dist/seeding/IEventSeedingBuilder.js +4 -0
  435. package/dist/seeding/IEventSeedingBuilder.js.map +1 -0
  436. package/dist/seeding/IEventSeedingScopeBuilder.d.ts +20 -0
  437. package/dist/seeding/IEventSeedingScopeBuilder.d.ts.map +1 -0
  438. package/dist/seeding/IEventSeedingScopeBuilder.js +4 -0
  439. package/dist/seeding/IEventSeedingScopeBuilder.js.map +1 -0
  440. package/dist/seeding/index.d.ts +8 -0
  441. package/dist/seeding/index.d.ts.map +1 -0
  442. package/dist/seeding/index.js +5 -0
  443. package/dist/seeding/index.js.map +1 -0
  444. package/dist/seeding/seeder.d.ts +28 -0
  445. package/dist/seeding/seeder.d.ts.map +1 -0
  446. package/dist/seeding/seeder.js +37 -0
  447. package/dist/seeding/seeder.js.map +1 -0
  448. package/dist/sinks/WellKnownSinks.d.ts +15 -0
  449. package/dist/sinks/WellKnownSinks.d.ts.map +1 -0
  450. package/dist/sinks/WellKnownSinks.js +17 -0
  451. package/dist/sinks/WellKnownSinks.js.map +1 -0
  452. package/dist/sinks/index.d.ts +2 -0
  453. package/dist/sinks/index.d.ts.map +1 -0
  454. package/dist/sinks/index.js +4 -0
  455. package/dist/sinks/index.js.map +1 -0
  456. package/dist/transactions/IUnitOfWork.d.ts +45 -0
  457. package/dist/transactions/IUnitOfWork.d.ts.map +1 -0
  458. package/dist/transactions/IUnitOfWork.js +4 -0
  459. package/dist/transactions/IUnitOfWork.js.map +1 -0
  460. package/dist/transactions/IUnitOfWorkManager.d.ts +29 -0
  461. package/dist/transactions/IUnitOfWorkManager.d.ts.map +1 -0
  462. package/dist/transactions/IUnitOfWorkManager.js +4 -0
  463. package/dist/transactions/IUnitOfWorkManager.js.map +1 -0
  464. package/dist/transactions/NoUnitOfWorkHasBeenStarted.d.ts +10 -0
  465. package/dist/transactions/NoUnitOfWorkHasBeenStarted.d.ts.map +1 -0
  466. package/dist/transactions/NoUnitOfWorkHasBeenStarted.js +14 -0
  467. package/dist/transactions/NoUnitOfWorkHasBeenStarted.js.map +1 -0
  468. package/dist/transactions/UnitOfWork.d.ts +36 -0
  469. package/dist/transactions/UnitOfWork.d.ts.map +1 -0
  470. package/dist/transactions/UnitOfWork.js +102 -0
  471. package/dist/transactions/UnitOfWork.js.map +1 -0
  472. package/dist/transactions/UnitOfWorkManager.d.ts +25 -0
  473. package/dist/transactions/UnitOfWorkManager.d.ts.map +1 -0
  474. package/dist/transactions/UnitOfWorkManager.js +57 -0
  475. package/dist/transactions/UnitOfWorkManager.js.map +1 -0
  476. package/dist/transactions/index.d.ts +6 -0
  477. package/dist/transactions/index.d.ts.map +1 -0
  478. package/dist/transactions/index.js +6 -0
  479. package/dist/transactions/index.js.map +1 -0
  480. package/dist/tsconfig.tsbuildinfo +1 -1
  481. package/dist/types/DecoratorType.d.ts +6 -2
  482. package/dist/types/DecoratorType.d.ts.map +1 -1
  483. package/dist/types/DecoratorType.js +6 -2
  484. package/dist/types/DecoratorType.js.map +1 -1
  485. package/dist/webhooks/IWebhook.d.ts +12 -0
  486. package/dist/webhooks/IWebhook.d.ts.map +1 -0
  487. package/dist/webhooks/IWebhook.js +4 -0
  488. package/dist/webhooks/IWebhook.js.map +1 -0
  489. package/dist/webhooks/IWebhookDefinitionBuilder.d.ts +58 -0
  490. package/dist/webhooks/IWebhookDefinitionBuilder.d.ts.map +1 -0
  491. package/dist/webhooks/IWebhookDefinitionBuilder.js +4 -0
  492. package/dist/webhooks/IWebhookDefinitionBuilder.js.map +1 -0
  493. package/dist/webhooks/IWebhooks.d.ts +34 -0
  494. package/dist/webhooks/IWebhooks.d.ts.map +1 -0
  495. package/dist/webhooks/IWebhooks.js +4 -0
  496. package/dist/webhooks/IWebhooks.js.map +1 -0
  497. package/dist/webhooks/WebhookDefinitionBuilder.d.ts +49 -0
  498. package/dist/webhooks/WebhookDefinitionBuilder.d.ts.map +1 -0
  499. package/dist/webhooks/WebhookDefinitionBuilder.js +122 -0
  500. package/dist/webhooks/WebhookDefinitionBuilder.js.map +1 -0
  501. package/dist/webhooks/WebhookId.d.ts +10 -0
  502. package/dist/webhooks/WebhookId.d.ts.map +1 -0
  503. package/dist/webhooks/WebhookId.js +16 -0
  504. package/dist/webhooks/WebhookId.js.map +1 -0
  505. package/dist/webhooks/WebhookTargetUrl.d.ts +10 -0
  506. package/dist/webhooks/WebhookTargetUrl.d.ts.map +1 -0
  507. package/dist/webhooks/WebhookTargetUrl.js +16 -0
  508. package/dist/webhooks/WebhookTargetUrl.js.map +1 -0
  509. package/dist/webhooks/Webhooks.d.ts +38 -0
  510. package/dist/webhooks/Webhooks.d.ts.map +1 -0
  511. package/dist/webhooks/Webhooks.js +92 -0
  512. package/dist/webhooks/Webhooks.js.map +1 -0
  513. package/dist/webhooks/index.d.ts +10 -0
  514. package/dist/webhooks/index.d.ts.map +1 -0
  515. package/dist/webhooks/index.js +8 -0
  516. package/dist/webhooks/index.js.map +1 -0
  517. package/dist/webhooks/webhook.d.ts +41 -0
  518. package/dist/webhooks/webhook.d.ts.map +1 -0
  519. package/dist/webhooks/webhook.js +44 -0
  520. package/dist/webhooks/webhook.js.map +1 -0
  521. package/eventSequences/AppendOptions.ts +19 -0
  522. package/eventSequences/ConcurrencyScope.ts +27 -0
  523. package/eventSequences/EventForEventSourceId.ts +13 -0
  524. package/eventSequences/EventLog.ts +23 -0
  525. package/eventSequences/EventSequence.ts +413 -0
  526. package/eventSequences/EventSequenceNumber.ts +38 -0
  527. package/eventSequences/IEventSequence.ts +60 -0
  528. package/eventSequences/ITransactionalEventSequence.ts +26 -0
  529. package/eventSequences/TransactionalEventSequence.ts +34 -0
  530. package/eventSequences/index.ts +17 -0
  531. package/events/EventContext.ts +28 -0
  532. package/events/EventTypes.ts +186 -0
  533. package/events/eventTypeDecorator.ts +147 -0
  534. package/events/index.ts +15 -0
  535. package/events/migrations/EventMigrationBuilder.ts +31 -0
  536. package/events/migrations/EventMigrationPropertyBuilder.ts +77 -0
  537. package/events/migrations/EventTypeMigrators.ts +48 -0
  538. package/events/migrations/IEventMigrationBuilder.ts +15 -0
  539. package/events/migrations/IEventMigrationPropertyBuilder.ts +57 -0
  540. package/events/migrations/IEventTypeMigration.ts +21 -0
  541. package/events/migrations/IEventTypeMigrators.ts +21 -0
  542. package/events/migrations/InvalidMigrationGenerationGap.ts +19 -0
  543. package/events/migrations/eventTypeMigration.ts +82 -0
  544. package/events/migrations/index.ts +13 -0
  545. package/identity/IIdentityProvider.ts +26 -0
  546. package/identity/Identity.ts +61 -0
  547. package/identity/IdentityProvider.ts +28 -0
  548. package/identity/index.ts +14 -0
  549. package/index.ts +56 -8
  550. package/jobs/IJobs.ts +49 -0
  551. package/jobs/JobId.ts +25 -0
  552. package/jobs/Jobs.ts +81 -0
  553. package/jobs/index.ts +6 -0
  554. package/package.json +104 -3
  555. package/projections/Projections.ts +518 -0
  556. package/projections/declarative/ProjectionBuilderFor.ts +294 -0
  557. package/projections/declarative/projection.ts +63 -0
  558. package/projections/modelBound/index.ts +36 -0
  559. package/projections/modelBound/setFromContext.ts +59 -0
  560. package/reactors/Reactors.ts +321 -0
  561. package/readModels/readModel.ts +89 -0
  562. package/reducers/Reducers.ts +386 -0
  563. package/schemas/JsonSchemaGenerator.ts +124 -0
  564. package/seeding/EventSeeding.ts +176 -0
  565. package/seeding/ICanSeedEvents.ts +15 -0
  566. package/seeding/IEventSeeding.ts +21 -0
  567. package/seeding/IEventSeedingBuilder.ts +35 -0
  568. package/seeding/IEventSeedingScopeBuilder.ts +23 -0
  569. package/seeding/index.ts +10 -0
  570. package/seeding/seeder.ts +54 -0
  571. package/sinks/WellKnownSinks.ts +21 -0
  572. package/sinks/index.ts +4 -0
  573. package/transactions/IUnitOfWork.ts +56 -0
  574. package/transactions/IUnitOfWorkManager.ts +36 -0
  575. package/transactions/NoUnitOfWorkHasBeenStarted.ts +14 -0
  576. package/transactions/UnitOfWork.ts +132 -0
  577. package/transactions/UnitOfWorkManager.ts +70 -0
  578. package/transactions/index.ts +8 -0
  579. package/types/DecoratorType.ts +8 -2
  580. package/webhooks/IWebhook.ts +15 -0
  581. package/webhooks/IWebhookDefinitionBuilder.ts +68 -0
  582. package/webhooks/IWebhooks.ts +45 -0
  583. package/webhooks/WebhookDefinitionBuilder.ts +144 -0
  584. package/webhooks/WebhookId.ts +14 -0
  585. package/webhooks/WebhookTargetUrl.ts +14 -0
  586. package/webhooks/Webhooks.ts +125 -0
  587. package/webhooks/index.ts +12 -0
  588. package/webhooks/webhook.ts +83 -0
  589. package/EventSequences/AppendOptions.ts +0 -15
  590. package/EventSequences/EventLog.ts +0 -21
  591. package/EventSequences/EventSequence.ts +0 -372
  592. package/EventSequences/EventSequenceNumber.ts +0 -38
  593. package/EventSequences/IEventSequence.ts +0 -47
  594. package/EventSequences/index.ts +0 -13
  595. package/Events/EventContext.ts +0 -28
  596. package/Events/EventTypes.ts +0 -95
  597. package/Events/eventTypeDecorator.ts +0 -147
  598. package/Events/index.ts +0 -14
  599. package/Projections/Projections.ts +0 -463
  600. package/Projections/declarative/ProjectionBuilderFor.ts +0 -277
  601. package/Projections/declarative/projection.ts +0 -59
  602. package/Projections/modelBound/index.ts +0 -38
  603. package/Projections/modelBound/modelBound.ts +0 -59
  604. package/Projections/modelBound/setFromContext.ts +0 -41
  605. package/Reactors/Reactors.ts +0 -320
  606. package/ReadModels/readModel.ts +0 -89
  607. package/Reducers/Reducers.ts +0 -322
  608. package/Schemas/JsonSchemaGenerator.ts +0 -107
  609. package/dist/EventSequences/AppendError.d.ts.map +0 -1
  610. package/dist/EventSequences/AppendError.js.map +0 -1
  611. package/dist/EventSequences/AppendOptions.d.ts +0 -11
  612. package/dist/EventSequences/AppendOptions.d.ts.map +0 -1
  613. package/dist/EventSequences/AppendOptions.js.map +0 -1
  614. package/dist/EventSequences/AppendResult.d.ts.map +0 -1
  615. package/dist/EventSequences/AppendResult.js.map +0 -1
  616. package/dist/EventSequences/ConstraintViolation.d.ts.map +0 -1
  617. package/dist/EventSequences/ConstraintViolation.js.map +0 -1
  618. package/dist/EventSequences/EventLog.d.ts +0 -11
  619. package/dist/EventSequences/EventLog.d.ts.map +0 -1
  620. package/dist/EventSequences/EventLog.js +0 -14
  621. package/dist/EventSequences/EventLog.js.map +0 -1
  622. package/dist/EventSequences/EventSequence.d.ts +0 -27
  623. package/dist/EventSequences/EventSequence.d.ts.map +0 -1
  624. package/dist/EventSequences/EventSequence.js +0 -337
  625. package/dist/EventSequences/EventSequence.js.map +0 -1
  626. package/dist/EventSequences/EventSequenceId.d.ts.map +0 -1
  627. package/dist/EventSequences/EventSequenceId.js.map +0 -1
  628. package/dist/EventSequences/EventSequenceNumber.d.ts +0 -26
  629. package/dist/EventSequences/EventSequenceNumber.d.ts.map +0 -1
  630. package/dist/EventSequences/EventSequenceNumber.js +0 -36
  631. package/dist/EventSequences/EventSequenceNumber.js.map +0 -1
  632. package/dist/EventSequences/IEventLog.d.ts.map +0 -1
  633. package/dist/EventSequences/IEventLog.js.map +0 -1
  634. package/dist/EventSequences/IEventSequence.d.ts +0 -40
  635. package/dist/EventSequences/IEventSequence.d.ts.map +0 -1
  636. package/dist/EventSequences/IEventSequence.js.map +0 -1
  637. package/dist/EventSequences/index.d.ts +0 -11
  638. package/dist/EventSequences/index.d.ts.map +0 -1
  639. package/dist/EventSequences/index.js +0 -7
  640. package/dist/EventSequences/index.js.map +0 -1
  641. package/dist/Events/AppendedEvent.d.ts.map +0 -1
  642. package/dist/Events/AppendedEvent.js.map +0 -1
  643. package/dist/Events/CausationEntry.d.ts.map +0 -1
  644. package/dist/Events/CausationEntry.js.map +0 -1
  645. package/dist/Events/Constraints/ConstraintBuilder.d.ts.map +0 -1
  646. package/dist/Events/Constraints/ConstraintBuilder.js.map +0 -1
  647. package/dist/Events/Constraints/ConstraintId.d.ts.map +0 -1
  648. package/dist/Events/Constraints/ConstraintId.js.map +0 -1
  649. package/dist/Events/Constraints/Constraints.d.ts.map +0 -1
  650. package/dist/Events/Constraints/Constraints.js.map +0 -1
  651. package/dist/Events/Constraints/IConstraint.d.ts.map +0 -1
  652. package/dist/Events/Constraints/IConstraint.js.map +0 -1
  653. package/dist/Events/Constraints/IConstraintBuilder.d.ts.map +0 -1
  654. package/dist/Events/Constraints/IConstraintBuilder.js.map +0 -1
  655. package/dist/Events/Constraints/IConstraints.d.ts.map +0 -1
  656. package/dist/Events/Constraints/IConstraints.js.map +0 -1
  657. package/dist/Events/Constraints/IUniqueConstraintBuilder.d.ts.map +0 -1
  658. package/dist/Events/Constraints/IUniqueConstraintBuilder.js.map +0 -1
  659. package/dist/Events/Constraints/UniqueConstraintBuilder.d.ts.map +0 -1
  660. package/dist/Events/Constraints/UniqueConstraintBuilder.js.map +0 -1
  661. package/dist/Events/Constraints/constraint.d.ts.map +0 -1
  662. package/dist/Events/Constraints/constraint.js.map +0 -1
  663. package/dist/Events/Constraints/index.d.ts.map +0 -1
  664. package/dist/Events/Constraints/index.js.map +0 -1
  665. package/dist/Events/EventContext.d.ts +0 -20
  666. package/dist/Events/EventContext.d.ts.map +0 -1
  667. package/dist/Events/EventContext.js.map +0 -1
  668. package/dist/Events/EventType.d.ts.map +0 -1
  669. package/dist/Events/EventType.js.map +0 -1
  670. package/dist/Events/EventTypeGeneration.d.ts.map +0 -1
  671. package/dist/Events/EventTypeGeneration.js.map +0 -1
  672. package/dist/Events/EventTypeId.d.ts.map +0 -1
  673. package/dist/Events/EventTypeId.js.map +0 -1
  674. package/dist/Events/EventTypes.d.ts +0 -33
  675. package/dist/Events/EventTypes.d.ts.map +0 -1
  676. package/dist/Events/EventTypes.js +0 -83
  677. package/dist/Events/EventTypes.js.map +0 -1
  678. package/dist/Events/IEventTypes.d.ts.map +0 -1
  679. package/dist/Events/IEventTypes.js.map +0 -1
  680. package/dist/Events/eventTypeDecorator.d.ts +0 -71
  681. package/dist/Events/eventTypeDecorator.d.ts.map +0 -1
  682. package/dist/Events/eventTypeDecorator.js +0 -86
  683. package/dist/Events/eventTypeDecorator.js.map +0 -1
  684. package/dist/Events/index.d.ts +0 -12
  685. package/dist/Events/index.d.ts.map +0 -1
  686. package/dist/Events/index.js +0 -9
  687. package/dist/Events/index.js.map +0 -1
  688. package/dist/Grpc.d.ts +0 -19
  689. package/dist/Grpc.d.ts.map +0 -1
  690. package/dist/Grpc.js +0 -33
  691. package/dist/Grpc.js.map +0 -1
  692. package/dist/Observation/ObserverId.d.ts.map +0 -1
  693. package/dist/Observation/ObserverId.js.map +0 -1
  694. package/dist/Observation/ObserverRunningState.d.ts.map +0 -1
  695. package/dist/Observation/ObserverRunningState.js.map +0 -1
  696. package/dist/Observation/index.d.ts.map +0 -1
  697. package/dist/Observation/index.js.map +0 -1
  698. package/dist/Projections/IProjections.d.ts.map +0 -1
  699. package/dist/Projections/IProjections.js.map +0 -1
  700. package/dist/Projections/ProjectionId.d.ts.map +0 -1
  701. package/dist/Projections/ProjectionId.js.map +0 -1
  702. package/dist/Projections/Projections.d.ts +0 -36
  703. package/dist/Projections/Projections.d.ts.map +0 -1
  704. package/dist/Projections/Projections.js +0 -390
  705. package/dist/Projections/Projections.js.map +0 -1
  706. package/dist/Projections/declarative/AllSetBuilder.d.ts.map +0 -1
  707. package/dist/Projections/declarative/AllSetBuilder.js.map +0 -1
  708. package/dist/Projections/declarative/FromBuilder.d.ts.map +0 -1
  709. package/dist/Projections/declarative/FromBuilder.js.map +0 -1
  710. package/dist/Projections/declarative/FromEveryBuilder.d.ts.map +0 -1
  711. package/dist/Projections/declarative/FromEveryBuilder.js.map +0 -1
  712. package/dist/Projections/declarative/IAddBuilder.d.ts.map +0 -1
  713. package/dist/Projections/declarative/IAddBuilder.js.map +0 -1
  714. package/dist/Projections/declarative/IAddChildBuilder.d.ts.map +0 -1
  715. package/dist/Projections/declarative/IAddChildBuilder.js.map +0 -1
  716. package/dist/Projections/declarative/IAllSetBuilder.d.ts.map +0 -1
  717. package/dist/Projections/declarative/IAllSetBuilder.js.map +0 -1
  718. package/dist/Projections/declarative/IChildrenBuilder.d.ts.map +0 -1
  719. package/dist/Projections/declarative/IChildrenBuilder.js.map +0 -1
  720. package/dist/Projections/declarative/ICompositeKeyBuilder.d.ts.map +0 -1
  721. package/dist/Projections/declarative/ICompositeKeyBuilder.js.map +0 -1
  722. package/dist/Projections/declarative/IFromBuilder.d.ts.map +0 -1
  723. package/dist/Projections/declarative/IFromBuilder.js.map +0 -1
  724. package/dist/Projections/declarative/IFromEveryBuilder.d.ts.map +0 -1
  725. package/dist/Projections/declarative/IFromEveryBuilder.js.map +0 -1
  726. package/dist/Projections/declarative/IJoinBuilder.d.ts.map +0 -1
  727. package/dist/Projections/declarative/IJoinBuilder.js.map +0 -1
  728. package/dist/Projections/declarative/INestedBuilder.d.ts.map +0 -1
  729. package/dist/Projections/declarative/INestedBuilder.js.map +0 -1
  730. package/dist/Projections/declarative/IProjectionBuilder.d.ts.map +0 -1
  731. package/dist/Projections/declarative/IProjectionBuilder.js.map +0 -1
  732. package/dist/Projections/declarative/IProjectionBuilderFor.d.ts.map +0 -1
  733. package/dist/Projections/declarative/IProjectionBuilderFor.js.map +0 -1
  734. package/dist/Projections/declarative/IProjectionFor.d.ts.map +0 -1
  735. package/dist/Projections/declarative/IProjectionFor.js.map +0 -1
  736. package/dist/Projections/declarative/IReadModelPropertiesBuilder.d.ts.map +0 -1
  737. package/dist/Projections/declarative/IReadModelPropertiesBuilder.js.map +0 -1
  738. package/dist/Projections/declarative/IRemovedWithBuilder.d.ts.map +0 -1
  739. package/dist/Projections/declarative/IRemovedWithBuilder.js.map +0 -1
  740. package/dist/Projections/declarative/IRemovedWithJoinBuilder.d.ts.map +0 -1
  741. package/dist/Projections/declarative/IRemovedWithJoinBuilder.js.map +0 -1
  742. package/dist/Projections/declarative/ISetBuilder.d.ts.map +0 -1
  743. package/dist/Projections/declarative/ISetBuilder.js.map +0 -1
  744. package/dist/Projections/declarative/ISubtractBuilder.d.ts.map +0 -1
  745. package/dist/Projections/declarative/ISubtractBuilder.js.map +0 -1
  746. package/dist/Projections/declarative/JoinBuilder.d.ts.map +0 -1
  747. package/dist/Projections/declarative/JoinBuilder.js.map +0 -1
  748. package/dist/Projections/declarative/ProjectionBuilderFor.d.ts +0 -68
  749. package/dist/Projections/declarative/ProjectionBuilderFor.d.ts.map +0 -1
  750. package/dist/Projections/declarative/ProjectionBuilderFor.js +0 -207
  751. package/dist/Projections/declarative/ProjectionBuilderFor.js.map +0 -1
  752. package/dist/Projections/declarative/RemovedWithBuilder.d.ts.map +0 -1
  753. package/dist/Projections/declarative/RemovedWithBuilder.js.map +0 -1
  754. package/dist/Projections/declarative/RemovedWithJoinBuilder.d.ts.map +0 -1
  755. package/dist/Projections/declarative/RemovedWithJoinBuilder.js.map +0 -1
  756. package/dist/Projections/declarative/SetBuilder.d.ts.map +0 -1
  757. package/dist/Projections/declarative/SetBuilder.js.map +0 -1
  758. package/dist/Projections/declarative/index.d.ts.map +0 -1
  759. package/dist/Projections/declarative/index.js.map +0 -1
  760. package/dist/Projections/declarative/projection.d.ts +0 -31
  761. package/dist/Projections/declarative/projection.d.ts.map +0 -1
  762. package/dist/Projections/declarative/projection.js +0 -39
  763. package/dist/Projections/declarative/projection.js.map +0 -1
  764. package/dist/Projections/index.d.ts.map +0 -1
  765. package/dist/Projections/index.js.map +0 -1
  766. package/dist/Projections/modelBound/FromEventMetadata.d.ts.map +0 -1
  767. package/dist/Projections/modelBound/FromEventMetadata.js.map +0 -1
  768. package/dist/Projections/modelBound/FromEventOptions.d.ts.map +0 -1
  769. package/dist/Projections/modelBound/FromEventOptions.js.map +0 -1
  770. package/dist/Projections/modelBound/addFrom.d.ts.map +0 -1
  771. package/dist/Projections/modelBound/addFrom.js.map +0 -1
  772. package/dist/Projections/modelBound/childrenFrom.d.ts.map +0 -1
  773. package/dist/Projections/modelBound/childrenFrom.js.map +0 -1
  774. package/dist/Projections/modelBound/clearWith.d.ts.map +0 -1
  775. package/dist/Projections/modelBound/clearWith.js.map +0 -1
  776. package/dist/Projections/modelBound/count.d.ts.map +0 -1
  777. package/dist/Projections/modelBound/count.js.map +0 -1
  778. package/dist/Projections/modelBound/decrement.d.ts.map +0 -1
  779. package/dist/Projections/modelBound/decrement.js.map +0 -1
  780. package/dist/Projections/modelBound/fromEvent.d.ts.map +0 -1
  781. package/dist/Projections/modelBound/fromEvent.js.map +0 -1
  782. package/dist/Projections/modelBound/fromEvery.d.ts.map +0 -1
  783. package/dist/Projections/modelBound/fromEvery.js.map +0 -1
  784. package/dist/Projections/modelBound/increment.d.ts.map +0 -1
  785. package/dist/Projections/modelBound/increment.js.map +0 -1
  786. package/dist/Projections/modelBound/index.d.ts +0 -36
  787. package/dist/Projections/modelBound/index.d.ts.map +0 -1
  788. package/dist/Projections/modelBound/index.js +0 -21
  789. package/dist/Projections/modelBound/index.js.map +0 -1
  790. package/dist/Projections/modelBound/join.d.ts.map +0 -1
  791. package/dist/Projections/modelBound/join.js.map +0 -1
  792. package/dist/Projections/modelBound/modelBound.d.ts +0 -31
  793. package/dist/Projections/modelBound/modelBound.d.ts.map +0 -1
  794. package/dist/Projections/modelBound/modelBound.js +0 -39
  795. package/dist/Projections/modelBound/modelBound.js.map +0 -1
  796. package/dist/Projections/modelBound/nested.d.ts.map +0 -1
  797. package/dist/Projections/modelBound/nested.js.map +0 -1
  798. package/dist/Projections/modelBound/notRewindable.d.ts.map +0 -1
  799. package/dist/Projections/modelBound/notRewindable.js.map +0 -1
  800. package/dist/Projections/modelBound/removedWith.d.ts.map +0 -1
  801. package/dist/Projections/modelBound/removedWith.js.map +0 -1
  802. package/dist/Projections/modelBound/removedWithJoin.d.ts.map +0 -1
  803. package/dist/Projections/modelBound/removedWithJoin.js.map +0 -1
  804. package/dist/Projections/modelBound/setFrom.d.ts.map +0 -1
  805. package/dist/Projections/modelBound/setFrom.js.map +0 -1
  806. package/dist/Projections/modelBound/setFromContext.d.ts +0 -23
  807. package/dist/Projections/modelBound/setFromContext.d.ts.map +0 -1
  808. package/dist/Projections/modelBound/setFromContext.js +0 -30
  809. package/dist/Projections/modelBound/setFromContext.js.map +0 -1
  810. package/dist/Projections/modelBound/setValue.d.ts.map +0 -1
  811. package/dist/Projections/modelBound/setValue.js.map +0 -1
  812. package/dist/Projections/modelBound/subtractFrom.d.ts.map +0 -1
  813. package/dist/Projections/modelBound/subtractFrom.js.map +0 -1
  814. package/dist/Reactors/IReactors.d.ts.map +0 -1
  815. package/dist/Reactors/IReactors.js.map +0 -1
  816. package/dist/Reactors/ReactorId.d.ts.map +0 -1
  817. package/dist/Reactors/ReactorId.js.map +0 -1
  818. package/dist/Reactors/Reactors.d.ts.map +0 -1
  819. package/dist/Reactors/Reactors.js +0 -279
  820. package/dist/Reactors/Reactors.js.map +0 -1
  821. package/dist/Reactors/index.d.ts.map +0 -1
  822. package/dist/Reactors/index.js.map +0 -1
  823. package/dist/Reactors/reactor.d.ts.map +0 -1
  824. package/dist/Reactors/reactor.js.map +0 -1
  825. package/dist/ReadModels/ReadModelId.d.ts.map +0 -1
  826. package/dist/ReadModels/ReadModelId.js.map +0 -1
  827. package/dist/ReadModels/index.d.ts.map +0 -1
  828. package/dist/ReadModels/index.js.map +0 -1
  829. package/dist/ReadModels/readModel.d.ts +0 -33
  830. package/dist/ReadModels/readModel.d.ts.map +0 -1
  831. package/dist/ReadModels/readModel.js +0 -64
  832. package/dist/ReadModels/readModel.js.map +0 -1
  833. package/dist/Reducers/IReducers.d.ts.map +0 -1
  834. package/dist/Reducers/IReducers.js.map +0 -1
  835. package/dist/Reducers/ReducerId.d.ts.map +0 -1
  836. package/dist/Reducers/ReducerId.js.map +0 -1
  837. package/dist/Reducers/Reducers.d.ts +0 -38
  838. package/dist/Reducers/Reducers.d.ts.map +0 -1
  839. package/dist/Reducers/Reducers.js +0 -279
  840. package/dist/Reducers/Reducers.js.map +0 -1
  841. package/dist/Reducers/index.d.ts.map +0 -1
  842. package/dist/Reducers/index.js.map +0 -1
  843. package/dist/Reducers/reducer.d.ts.map +0 -1
  844. package/dist/Reducers/reducer.js.map +0 -1
  845. package/dist/Schemas/JsonSchema.d.ts.map +0 -1
  846. package/dist/Schemas/JsonSchema.js.map +0 -1
  847. package/dist/Schemas/JsonSchemaGenerator.d.ts.map +0 -1
  848. package/dist/Schemas/JsonSchemaGenerator.js +0 -90
  849. package/dist/Schemas/JsonSchemaGenerator.js.map +0 -1
  850. package/dist/Schemas/index.d.ts.map +0 -1
  851. package/dist/Schemas/index.js.map +0 -1
  852. package/dist/Schemas/jsonSchemaProperty.d.ts.map +0 -1
  853. package/dist/Schemas/jsonSchemaProperty.js.map +0 -1
  854. /package/dist/{EventSequences → eventSequences}/AppendError.d.ts +0 -0
  855. /package/dist/{EventSequences → eventSequences}/AppendError.js +0 -0
  856. /package/dist/{EventSequences → eventSequences}/AppendOptions.js +0 -0
  857. /package/dist/{EventSequences → eventSequences}/AppendResult.d.ts +0 -0
  858. /package/dist/{EventSequences → eventSequences}/AppendResult.js +0 -0
  859. /package/dist/{EventSequences → eventSequences}/ConstraintViolation.d.ts +0 -0
  860. /package/dist/{EventSequences → eventSequences}/ConstraintViolation.js +0 -0
  861. /package/dist/{EventSequences → eventSequences}/EventSequenceId.d.ts +0 -0
  862. /package/dist/{EventSequences → eventSequences}/EventSequenceId.js +0 -0
  863. /package/dist/{EventSequences → eventSequences}/IEventLog.d.ts +0 -0
  864. /package/dist/{EventSequences → eventSequences}/IEventLog.js +0 -0
  865. /package/dist/{EventSequences → eventSequences}/IEventSequence.js +0 -0
  866. /package/dist/{Events → events}/AppendedEvent.d.ts +0 -0
  867. /package/dist/{Events → events}/AppendedEvent.js +0 -0
  868. /package/dist/{Events → events}/CausationEntry.d.ts +0 -0
  869. /package/dist/{Events → events}/CausationEntry.js +0 -0
  870. /package/dist/{Events → events}/EventContext.js +0 -0
  871. /package/dist/{Events → events}/EventType.d.ts +0 -0
  872. /package/dist/{Events → events}/EventType.js +0 -0
  873. /package/dist/{Events → events}/EventTypeGeneration.d.ts +0 -0
  874. /package/dist/{Events → events}/EventTypeGeneration.js +0 -0
  875. /package/dist/{Events → events}/EventTypeId.d.ts +0 -0
  876. /package/dist/{Events → events}/EventTypeId.js +0 -0
  877. /package/dist/{Events → events}/IEventTypes.d.ts +0 -0
  878. /package/dist/{Events → events}/IEventTypes.js +0 -0
  879. /package/dist/{Events/Constraints → events/constraints}/ConstraintBuilder.d.ts +0 -0
  880. /package/dist/{Events/Constraints → events/constraints}/ConstraintBuilder.js +0 -0
  881. /package/dist/{Events/Constraints → events/constraints}/ConstraintId.d.ts +0 -0
  882. /package/dist/{Events/Constraints → events/constraints}/ConstraintId.js +0 -0
  883. /package/dist/{Events/Constraints → events/constraints}/Constraints.d.ts +0 -0
  884. /package/dist/{Events/Constraints → events/constraints}/Constraints.js +0 -0
  885. /package/dist/{Events/Constraints → events/constraints}/IConstraint.d.ts +0 -0
  886. /package/dist/{Events/Constraints → events/constraints}/IConstraint.js +0 -0
  887. /package/dist/{Events/Constraints → events/constraints}/IConstraintBuilder.d.ts +0 -0
  888. /package/dist/{Events/Constraints → events/constraints}/IConstraintBuilder.js +0 -0
  889. /package/dist/{Events/Constraints → events/constraints}/IConstraints.d.ts +0 -0
  890. /package/dist/{Events/Constraints → events/constraints}/IConstraints.js +0 -0
  891. /package/dist/{Events/Constraints → events/constraints}/IUniqueConstraintBuilder.d.ts +0 -0
  892. /package/dist/{Events/Constraints → events/constraints}/IUniqueConstraintBuilder.js +0 -0
  893. /package/dist/{Events/Constraints → events/constraints}/UniqueConstraintBuilder.d.ts +0 -0
  894. /package/dist/{Events/Constraints → events/constraints}/UniqueConstraintBuilder.js +0 -0
  895. /package/dist/{Events/Constraints → events/constraints}/constraint.d.ts +0 -0
  896. /package/dist/{Events/Constraints → events/constraints}/constraint.js +0 -0
  897. /package/dist/{Events/Constraints → events/constraints}/index.d.ts +0 -0
  898. /package/dist/{Events/Constraints → events/constraints}/index.js +0 -0
  899. /package/dist/{Observation → observation}/ObserverId.d.ts +0 -0
  900. /package/dist/{Observation → observation}/ObserverId.js +0 -0
  901. /package/dist/{Observation → observation}/ObserverRunningState.d.ts +0 -0
  902. /package/dist/{Observation → observation}/ObserverRunningState.js +0 -0
  903. /package/dist/{Observation → observation}/index.d.ts +0 -0
  904. /package/dist/{Observation → observation}/index.js +0 -0
  905. /package/dist/{Projections → projections}/IProjections.d.ts +0 -0
  906. /package/dist/{Projections → projections}/IProjections.js +0 -0
  907. /package/dist/{Projections → projections}/ProjectionId.d.ts +0 -0
  908. /package/dist/{Projections → projections}/ProjectionId.js +0 -0
  909. /package/dist/{Projections → projections}/declarative/AllSetBuilder.d.ts +0 -0
  910. /package/dist/{Projections → projections}/declarative/AllSetBuilder.js +0 -0
  911. /package/dist/{Projections → projections}/declarative/FromBuilder.d.ts +0 -0
  912. /package/dist/{Projections → projections}/declarative/FromBuilder.js +0 -0
  913. /package/dist/{Projections → projections}/declarative/FromEveryBuilder.d.ts +0 -0
  914. /package/dist/{Projections → projections}/declarative/FromEveryBuilder.js +0 -0
  915. /package/dist/{Projections → projections}/declarative/IAddBuilder.d.ts +0 -0
  916. /package/dist/{Projections → projections}/declarative/IAddBuilder.js +0 -0
  917. /package/dist/{Projections → projections}/declarative/IAddChildBuilder.d.ts +0 -0
  918. /package/dist/{Projections → projections}/declarative/IAddChildBuilder.js +0 -0
  919. /package/dist/{Projections → projections}/declarative/IAllSetBuilder.d.ts +0 -0
  920. /package/dist/{Projections → projections}/declarative/IAllSetBuilder.js +0 -0
  921. /package/dist/{Projections → projections}/declarative/IChildrenBuilder.d.ts +0 -0
  922. /package/dist/{Projections → projections}/declarative/IChildrenBuilder.js +0 -0
  923. /package/dist/{Projections → projections}/declarative/ICompositeKeyBuilder.d.ts +0 -0
  924. /package/dist/{Projections → projections}/declarative/ICompositeKeyBuilder.js +0 -0
  925. /package/dist/{Projections → projections}/declarative/IFromBuilder.d.ts +0 -0
  926. /package/dist/{Projections → projections}/declarative/IFromBuilder.js +0 -0
  927. /package/dist/{Projections → projections}/declarative/IFromEveryBuilder.d.ts +0 -0
  928. /package/dist/{Projections → projections}/declarative/IFromEveryBuilder.js +0 -0
  929. /package/dist/{Projections → projections}/declarative/IJoinBuilder.d.ts +0 -0
  930. /package/dist/{Projections → projections}/declarative/IJoinBuilder.js +0 -0
  931. /package/dist/{Projections → projections}/declarative/INestedBuilder.d.ts +0 -0
  932. /package/dist/{Projections → projections}/declarative/INestedBuilder.js +0 -0
  933. /package/dist/{Projections → projections}/declarative/IProjectionBuilder.d.ts +0 -0
  934. /package/dist/{Projections → projections}/declarative/IProjectionBuilder.js +0 -0
  935. /package/dist/{Projections → projections}/declarative/IProjectionBuilderFor.d.ts +0 -0
  936. /package/dist/{Projections → projections}/declarative/IProjectionBuilderFor.js +0 -0
  937. /package/dist/{Projections → projections}/declarative/IProjectionFor.d.ts +0 -0
  938. /package/dist/{Projections → projections}/declarative/IProjectionFor.js +0 -0
  939. /package/dist/{Projections → projections}/declarative/IReadModelPropertiesBuilder.d.ts +0 -0
  940. /package/dist/{Projections → projections}/declarative/IReadModelPropertiesBuilder.js +0 -0
  941. /package/dist/{Projections → projections}/declarative/IRemovedWithBuilder.d.ts +0 -0
  942. /package/dist/{Projections → projections}/declarative/IRemovedWithBuilder.js +0 -0
  943. /package/dist/{Projections → projections}/declarative/IRemovedWithJoinBuilder.d.ts +0 -0
  944. /package/dist/{Projections → projections}/declarative/IRemovedWithJoinBuilder.js +0 -0
  945. /package/dist/{Projections → projections}/declarative/ISetBuilder.d.ts +0 -0
  946. /package/dist/{Projections → projections}/declarative/ISetBuilder.js +0 -0
  947. /package/dist/{Projections → projections}/declarative/ISubtractBuilder.d.ts +0 -0
  948. /package/dist/{Projections → projections}/declarative/ISubtractBuilder.js +0 -0
  949. /package/dist/{Projections → projections}/declarative/JoinBuilder.d.ts +0 -0
  950. /package/dist/{Projections → projections}/declarative/JoinBuilder.js +0 -0
  951. /package/dist/{Projections → projections}/declarative/RemovedWithBuilder.d.ts +0 -0
  952. /package/dist/{Projections → projections}/declarative/RemovedWithBuilder.js +0 -0
  953. /package/dist/{Projections → projections}/declarative/RemovedWithJoinBuilder.d.ts +0 -0
  954. /package/dist/{Projections → projections}/declarative/RemovedWithJoinBuilder.js +0 -0
  955. /package/dist/{Projections → projections}/declarative/SetBuilder.d.ts +0 -0
  956. /package/dist/{Projections → projections}/declarative/SetBuilder.js +0 -0
  957. /package/dist/{Projections → projections}/declarative/index.d.ts +0 -0
  958. /package/dist/{Projections → projections}/declarative/index.js +0 -0
  959. /package/dist/{Projections → projections}/index.d.ts +0 -0
  960. /package/dist/{Projections → projections}/index.js +0 -0
  961. /package/dist/{Projections → projections}/modelBound/FromEventMetadata.d.ts +0 -0
  962. /package/dist/{Projections → projections}/modelBound/FromEventMetadata.js +0 -0
  963. /package/dist/{Projections → projections}/modelBound/FromEventOptions.d.ts +0 -0
  964. /package/dist/{Projections → projections}/modelBound/FromEventOptions.js +0 -0
  965. /package/dist/{Projections → projections}/modelBound/addFrom.d.ts +0 -0
  966. /package/dist/{Projections → projections}/modelBound/addFrom.js +0 -0
  967. /package/dist/{Projections → projections}/modelBound/childrenFrom.d.ts +0 -0
  968. /package/dist/{Projections → projections}/modelBound/childrenFrom.js +0 -0
  969. /package/dist/{Projections → projections}/modelBound/clearWith.d.ts +0 -0
  970. /package/dist/{Projections → projections}/modelBound/clearWith.js +0 -0
  971. /package/dist/{Projections → projections}/modelBound/count.d.ts +0 -0
  972. /package/dist/{Projections → projections}/modelBound/count.js +0 -0
  973. /package/dist/{Projections → projections}/modelBound/decrement.d.ts +0 -0
  974. /package/dist/{Projections → projections}/modelBound/decrement.js +0 -0
  975. /package/dist/{Projections → projections}/modelBound/fromEvent.d.ts +0 -0
  976. /package/dist/{Projections → projections}/modelBound/fromEvent.js +0 -0
  977. /package/dist/{Projections → projections}/modelBound/fromEvery.d.ts +0 -0
  978. /package/dist/{Projections → projections}/modelBound/fromEvery.js +0 -0
  979. /package/dist/{Projections → projections}/modelBound/increment.d.ts +0 -0
  980. /package/dist/{Projections → projections}/modelBound/increment.js +0 -0
  981. /package/dist/{Projections → projections}/modelBound/join.d.ts +0 -0
  982. /package/dist/{Projections → projections}/modelBound/join.js +0 -0
  983. /package/dist/{Projections → projections}/modelBound/nested.d.ts +0 -0
  984. /package/dist/{Projections → projections}/modelBound/nested.js +0 -0
  985. /package/dist/{Projections → projections}/modelBound/notRewindable.d.ts +0 -0
  986. /package/dist/{Projections → projections}/modelBound/notRewindable.js +0 -0
  987. /package/dist/{Projections → projections}/modelBound/removedWith.d.ts +0 -0
  988. /package/dist/{Projections → projections}/modelBound/removedWith.js +0 -0
  989. /package/dist/{Projections → projections}/modelBound/removedWithJoin.d.ts +0 -0
  990. /package/dist/{Projections → projections}/modelBound/removedWithJoin.js +0 -0
  991. /package/dist/{Projections → projections}/modelBound/setFrom.d.ts +0 -0
  992. /package/dist/{Projections → projections}/modelBound/setFrom.js +0 -0
  993. /package/dist/{Projections → projections}/modelBound/setValue.d.ts +0 -0
  994. /package/dist/{Projections → projections}/modelBound/setValue.js +0 -0
  995. /package/dist/{Projections → projections}/modelBound/subtractFrom.d.ts +0 -0
  996. /package/dist/{Projections → projections}/modelBound/subtractFrom.js +0 -0
  997. /package/dist/{Reactors → reactors}/IReactors.d.ts +0 -0
  998. /package/dist/{Reactors → reactors}/IReactors.js +0 -0
  999. /package/dist/{Reactors → reactors}/ReactorId.d.ts +0 -0
  1000. /package/dist/{Reactors → reactors}/ReactorId.js +0 -0
  1001. /package/dist/{Reactors → reactors}/Reactors.d.ts +0 -0
  1002. /package/dist/{Reactors → reactors}/index.d.ts +0 -0
  1003. /package/dist/{Reactors → reactors}/index.js +0 -0
  1004. /package/dist/{Reactors → reactors}/reactor.d.ts +0 -0
  1005. /package/dist/{Reactors → reactors}/reactor.js +0 -0
  1006. /package/dist/{ReadModels → readModels}/ReadModelId.d.ts +0 -0
  1007. /package/dist/{ReadModels → readModels}/ReadModelId.js +0 -0
  1008. /package/dist/{ReadModels → readModels}/index.d.ts +0 -0
  1009. /package/dist/{ReadModels → readModels}/index.js +0 -0
  1010. /package/dist/{Reducers → reducers}/IReducers.d.ts +0 -0
  1011. /package/dist/{Reducers → reducers}/IReducers.js +0 -0
  1012. /package/dist/{Reducers → reducers}/ReducerId.d.ts +0 -0
  1013. /package/dist/{Reducers → reducers}/ReducerId.js +0 -0
  1014. /package/dist/{Reducers → reducers}/index.d.ts +0 -0
  1015. /package/dist/{Reducers → reducers}/index.js +0 -0
  1016. /package/dist/{Reducers → reducers}/reducer.d.ts +0 -0
  1017. /package/dist/{Reducers → reducers}/reducer.js +0 -0
  1018. /package/dist/{Schemas → schemas}/JsonSchema.d.ts +0 -0
  1019. /package/dist/{Schemas → schemas}/JsonSchema.js +0 -0
  1020. /package/dist/{Schemas → schemas}/JsonSchemaGenerator.d.ts +0 -0
  1021. /package/dist/{Schemas → schemas}/index.d.ts +0 -0
  1022. /package/dist/{Schemas → schemas}/index.js +0 -0
  1023. /package/dist/{Schemas → schemas}/jsonSchemaProperty.d.ts +0 -0
  1024. /package/dist/{Schemas → schemas}/jsonSchemaProperty.js +0 -0
  1025. /package/{EventSequences → eventSequences}/AppendError.ts +0 -0
  1026. /package/{EventSequences → eventSequences}/AppendResult.ts +0 -0
  1027. /package/{EventSequences → eventSequences}/ConstraintViolation.ts +0 -0
  1028. /package/{EventSequences → eventSequences}/EventSequenceId.ts +0 -0
  1029. /package/{EventSequences → eventSequences}/IEventLog.ts +0 -0
  1030. /package/{Events → events}/AppendedEvent.ts +0 -0
  1031. /package/{Events → events}/CausationEntry.ts +0 -0
  1032. /package/{Events → events}/EventType.ts +0 -0
  1033. /package/{Events → events}/EventTypeGeneration.ts +0 -0
  1034. /package/{Events → events}/EventTypeId.ts +0 -0
  1035. /package/{Events → events}/IEventTypes.ts +0 -0
  1036. /package/{Events/Constraints → events/constraints}/ConstraintBuilder.ts +0 -0
  1037. /package/{Events/Constraints → events/constraints}/ConstraintId.ts +0 -0
  1038. /package/{Events/Constraints → events/constraints}/Constraints.ts +0 -0
  1039. /package/{Events/Constraints → events/constraints}/IConstraint.ts +0 -0
  1040. /package/{Events/Constraints → events/constraints}/IConstraintBuilder.ts +0 -0
  1041. /package/{Events/Constraints → events/constraints}/IConstraints.ts +0 -0
  1042. /package/{Events/Constraints → events/constraints}/IUniqueConstraintBuilder.ts +0 -0
  1043. /package/{Events/Constraints → events/constraints}/UniqueConstraintBuilder.ts +0 -0
  1044. /package/{Events/Constraints → events/constraints}/constraint.ts +0 -0
  1045. /package/{Events/Constraints → events/constraints}/index.ts +0 -0
  1046. /package/{Observation → observation}/ObserverId.ts +0 -0
  1047. /package/{Observation → observation}/ObserverRunningState.ts +0 -0
  1048. /package/{Observation → observation}/index.ts +0 -0
  1049. /package/{Projections → projections}/IProjections.ts +0 -0
  1050. /package/{Projections → projections}/ProjectionId.ts +0 -0
  1051. /package/{Projections → projections}/declarative/AllSetBuilder.ts +0 -0
  1052. /package/{Projections → projections}/declarative/FromBuilder.ts +0 -0
  1053. /package/{Projections → projections}/declarative/FromEveryBuilder.ts +0 -0
  1054. /package/{Projections → projections}/declarative/IAddBuilder.ts +0 -0
  1055. /package/{Projections → projections}/declarative/IAddChildBuilder.ts +0 -0
  1056. /package/{Projections → projections}/declarative/IAllSetBuilder.ts +0 -0
  1057. /package/{Projections → projections}/declarative/IChildrenBuilder.ts +0 -0
  1058. /package/{Projections → projections}/declarative/ICompositeKeyBuilder.ts +0 -0
  1059. /package/{Projections → projections}/declarative/IFromBuilder.ts +0 -0
  1060. /package/{Projections → projections}/declarative/IFromEveryBuilder.ts +0 -0
  1061. /package/{Projections → projections}/declarative/IJoinBuilder.ts +0 -0
  1062. /package/{Projections → projections}/declarative/INestedBuilder.ts +0 -0
  1063. /package/{Projections → projections}/declarative/IProjectionBuilder.ts +0 -0
  1064. /package/{Projections → projections}/declarative/IProjectionBuilderFor.ts +0 -0
  1065. /package/{Projections → projections}/declarative/IProjectionFor.ts +0 -0
  1066. /package/{Projections → projections}/declarative/IReadModelPropertiesBuilder.ts +0 -0
  1067. /package/{Projections → projections}/declarative/IRemovedWithBuilder.ts +0 -0
  1068. /package/{Projections → projections}/declarative/IRemovedWithJoinBuilder.ts +0 -0
  1069. /package/{Projections → projections}/declarative/ISetBuilder.ts +0 -0
  1070. /package/{Projections → projections}/declarative/ISubtractBuilder.ts +0 -0
  1071. /package/{Projections → projections}/declarative/JoinBuilder.ts +0 -0
  1072. /package/{Projections → projections}/declarative/RemovedWithBuilder.ts +0 -0
  1073. /package/{Projections → projections}/declarative/RemovedWithJoinBuilder.ts +0 -0
  1074. /package/{Projections → projections}/declarative/SetBuilder.ts +0 -0
  1075. /package/{Projections → projections}/declarative/index.ts +0 -0
  1076. /package/{Projections → projections}/index.ts +0 -0
  1077. /package/{Projections → projections}/modelBound/FromEventMetadata.ts +0 -0
  1078. /package/{Projections → projections}/modelBound/FromEventOptions.ts +0 -0
  1079. /package/{Projections → projections}/modelBound/addFrom.ts +0 -0
  1080. /package/{Projections → projections}/modelBound/childrenFrom.ts +0 -0
  1081. /package/{Projections → projections}/modelBound/clearWith.ts +0 -0
  1082. /package/{Projections → projections}/modelBound/count.ts +0 -0
  1083. /package/{Projections → projections}/modelBound/decrement.ts +0 -0
  1084. /package/{Projections → projections}/modelBound/fromEvent.ts +0 -0
  1085. /package/{Projections → projections}/modelBound/fromEvery.ts +0 -0
  1086. /package/{Projections → projections}/modelBound/increment.ts +0 -0
  1087. /package/{Projections → projections}/modelBound/join.ts +0 -0
  1088. /package/{Projections → projections}/modelBound/nested.ts +0 -0
  1089. /package/{Projections → projections}/modelBound/notRewindable.ts +0 -0
  1090. /package/{Projections → projections}/modelBound/removedWith.ts +0 -0
  1091. /package/{Projections → projections}/modelBound/removedWithJoin.ts +0 -0
  1092. /package/{Projections → projections}/modelBound/setFrom.ts +0 -0
  1093. /package/{Projections → projections}/modelBound/setValue.ts +0 -0
  1094. /package/{Projections → projections}/modelBound/subtractFrom.ts +0 -0
  1095. /package/{Reactors → reactors}/IReactors.ts +0 -0
  1096. /package/{Reactors → reactors}/ReactorId.ts +0 -0
  1097. /package/{Reactors → reactors}/index.ts +0 -0
  1098. /package/{Reactors → reactors}/reactor.ts +0 -0
  1099. /package/{ReadModels → readModels}/ReadModelId.ts +0 -0
  1100. /package/{ReadModels → readModels}/index.ts +0 -0
  1101. /package/{Reducers → reducers}/IReducers.ts +0 -0
  1102. /package/{Reducers → reducers}/ReducerId.ts +0 -0
  1103. /package/{Reducers → reducers}/index.ts +0 -0
  1104. /package/{Reducers → reducers}/reducer.ts +0 -0
  1105. /package/{Schemas → schemas}/JsonSchema.ts +0 -0
  1106. /package/{Schemas → schemas}/index.ts +0 -0
  1107. /package/{Schemas → schemas}/jsonSchemaProperty.ts +0 -0
@@ -1,4 +1,330 @@
1
1
  // Copyright (c) Cratis. All rights reserved.
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
 
4
- export { ChronicleConnectionString } from '@cratis/chronicle.contracts';
4
+ import * as grpc from '@grpc/grpc-js';
5
+
6
+ /**
7
+ * Authentication mode for Chronicle connection.
8
+ */
9
+ export enum AuthenticationMode {
10
+ ClientCredentials = 'ClientCredentials',
11
+ ApiKey = 'ApiKey'
12
+ }
13
+
14
+ /**
15
+ * Represents a server address with host and port.
16
+ */
17
+ export interface ChronicleServerAddress {
18
+ host: string;
19
+ port: number;
20
+ }
21
+
22
+ /**
23
+ * Builder for constructing Chronicle connection strings.
24
+ */
25
+ export class ChronicleConnectionStringBuilder {
26
+ private static readonly _defaultPort = 35000;
27
+ private static readonly _hostKey = 'Host';
28
+ private static readonly _portKey = 'Port';
29
+ private static readonly _usernameKey = 'Username';
30
+ private static readonly _passwordKey = 'Password';
31
+ private static readonly _schemeKey = 'Scheme';
32
+ private static readonly _apiKeyKey = 'apiKey';
33
+ private static readonly _disableTlsKey = 'disableTls';
34
+ private static readonly _certificatePathKey = 'certificatePath';
35
+ private static readonly _certificatePasswordKey = 'certificatePassword';
36
+
37
+ private readonly _properties = new Map<string, string>();
38
+
39
+ constructor(connectionString?: string) {
40
+ if (connectionString) {
41
+ this.parseConnectionString(connectionString);
42
+ }
43
+ }
44
+
45
+ get host(): string {
46
+ return this._properties.get(ChronicleConnectionStringBuilder._hostKey) || 'localhost';
47
+ }
48
+
49
+ set host(value: string) {
50
+ this._properties.set(ChronicleConnectionStringBuilder._hostKey, value);
51
+ }
52
+
53
+ get port(): number {
54
+ const port = this._properties.get(ChronicleConnectionStringBuilder._portKey);
55
+ return port ? parseInt(port, 10) : ChronicleConnectionStringBuilder._defaultPort;
56
+ }
57
+
58
+ set port(value: number) {
59
+ this._properties.set(ChronicleConnectionStringBuilder._portKey, value.toString());
60
+ }
61
+
62
+ get username(): string | undefined {
63
+ return this._properties.get(ChronicleConnectionStringBuilder._usernameKey);
64
+ }
65
+
66
+ set username(value: string | undefined) {
67
+ if (value) {
68
+ this._properties.set(ChronicleConnectionStringBuilder._usernameKey, value);
69
+ return;
70
+ }
71
+
72
+ this._properties.delete(ChronicleConnectionStringBuilder._usernameKey);
73
+ }
74
+
75
+ get password(): string | undefined {
76
+ return this._properties.get(ChronicleConnectionStringBuilder._passwordKey);
77
+ }
78
+
79
+ set password(value: string | undefined) {
80
+ if (value) {
81
+ this._properties.set(ChronicleConnectionStringBuilder._passwordKey, value);
82
+ return;
83
+ }
84
+
85
+ this._properties.delete(ChronicleConnectionStringBuilder._passwordKey);
86
+ }
87
+
88
+ get scheme(): string {
89
+ return this._properties.get(ChronicleConnectionStringBuilder._schemeKey) || 'chronicle';
90
+ }
91
+
92
+ set scheme(value: string) {
93
+ this._properties.set(ChronicleConnectionStringBuilder._schemeKey, value);
94
+ }
95
+
96
+ get authenticationMode(): AuthenticationMode {
97
+ const hasClientCredentials = !!this.username && !!this.password;
98
+ const hasApiKey = !!this.apiKey;
99
+
100
+ if (hasClientCredentials && hasApiKey) {
101
+ throw new Error('Cannot specify both username/password and apiKey in the connection string');
102
+ }
103
+
104
+ if (hasClientCredentials) {
105
+ return AuthenticationMode.ClientCredentials;
106
+ }
107
+
108
+ if (hasApiKey) {
109
+ return AuthenticationMode.ApiKey;
110
+ }
111
+
112
+ throw new Error('No authentication method specified. Provide either username/password or apiKey in the connection string');
113
+ }
114
+
115
+ get apiKey(): string | undefined {
116
+ return this._properties.get(ChronicleConnectionStringBuilder._apiKeyKey);
117
+ }
118
+
119
+ set apiKey(value: string | undefined) {
120
+ if (value) {
121
+ this._properties.set(ChronicleConnectionStringBuilder._apiKeyKey, value);
122
+ return;
123
+ }
124
+
125
+ this._properties.delete(ChronicleConnectionStringBuilder._apiKeyKey);
126
+ }
127
+
128
+ get disableTls(): boolean {
129
+ return this._properties.get(ChronicleConnectionStringBuilder._disableTlsKey) === 'true';
130
+ }
131
+
132
+ set disableTls(value: boolean) {
133
+ this._properties.set(ChronicleConnectionStringBuilder._disableTlsKey, value.toString());
134
+ }
135
+
136
+ get certificatePath(): string | undefined {
137
+ return this._properties.get(ChronicleConnectionStringBuilder._certificatePathKey);
138
+ }
139
+
140
+ set certificatePath(value: string | undefined) {
141
+ if (value) {
142
+ this._properties.set(ChronicleConnectionStringBuilder._certificatePathKey, value);
143
+ return;
144
+ }
145
+
146
+ this._properties.delete(ChronicleConnectionStringBuilder._certificatePathKey);
147
+ }
148
+
149
+ get certificatePassword(): string | undefined {
150
+ return this._properties.get(ChronicleConnectionStringBuilder._certificatePasswordKey);
151
+ }
152
+
153
+ set certificatePassword(value: string | undefined) {
154
+ if (value) {
155
+ this._properties.set(ChronicleConnectionStringBuilder._certificatePasswordKey, value);
156
+ return;
157
+ }
158
+
159
+ this._properties.delete(ChronicleConnectionStringBuilder._certificatePasswordKey);
160
+ }
161
+
162
+ build(): string {
163
+ let result = `${this.scheme}://`;
164
+
165
+ if (this.username) {
166
+ result += this.username;
167
+ if (this.password) {
168
+ result += `:${this.password}`;
169
+ }
170
+ result += '@';
171
+ }
172
+
173
+ result += this.host;
174
+ result += `:${this.port}`;
175
+
176
+ const queryParameters: string[] = [];
177
+
178
+ if (this.apiKey) {
179
+ queryParameters.push(`apiKey=${encodeURIComponent(this.apiKey)}`);
180
+ }
181
+
182
+ if (this.disableTls) {
183
+ queryParameters.push('disableTls=true');
184
+ }
185
+
186
+ if (this.certificatePath) {
187
+ queryParameters.push(`certificatePath=${encodeURIComponent(this.certificatePath)}`);
188
+ }
189
+
190
+ if (this.certificatePassword) {
191
+ queryParameters.push(`certificatePassword=${encodeURIComponent(this.certificatePassword)}`);
192
+ }
193
+
194
+ for (const [key, value] of this._properties) {
195
+ if (
196
+ key !== ChronicleConnectionStringBuilder._hostKey &&
197
+ key !== ChronicleConnectionStringBuilder._portKey &&
198
+ key !== ChronicleConnectionStringBuilder._usernameKey &&
199
+ key !== ChronicleConnectionStringBuilder._passwordKey &&
200
+ key !== ChronicleConnectionStringBuilder._schemeKey &&
201
+ key !== ChronicleConnectionStringBuilder._apiKeyKey &&
202
+ key !== ChronicleConnectionStringBuilder._disableTlsKey &&
203
+ key !== ChronicleConnectionStringBuilder._certificatePathKey &&
204
+ key !== ChronicleConnectionStringBuilder._certificatePasswordKey
205
+ ) {
206
+ queryParameters.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
207
+ }
208
+ }
209
+
210
+ if (queryParameters.length > 0) {
211
+ result += `?${queryParameters.join('&')}`;
212
+ }
213
+
214
+ return result;
215
+ }
216
+
217
+ private parseConnectionString(connectionString: string): void {
218
+ if (
219
+ connectionString.startsWith('chronicle://') ||
220
+ connectionString.startsWith('chronicle+srv://')
221
+ ) {
222
+ this.parseUrl(connectionString);
223
+ }
224
+ }
225
+
226
+ private parseUrl(value: string): void {
227
+ try {
228
+ const parsed = new URL(value);
229
+ this.scheme = parsed.protocol.replace(':', '');
230
+ this.host = parsed.hostname;
231
+
232
+ if (parsed.port) {
233
+ this.port = parseInt(parsed.port, 10);
234
+ }
235
+
236
+ if (parsed.username) {
237
+ this.username = decodeURIComponent(parsed.username);
238
+ if (parsed.password) {
239
+ this.password = decodeURIComponent(parsed.password);
240
+ }
241
+ }
242
+
243
+ for (const [key, queryValue] of new URLSearchParams(parsed.search)) {
244
+ this._properties.set(key, decodeURIComponent(queryValue));
245
+ }
246
+ } catch (error) {
247
+ throw new Error(`Invalid Chronicle connection string: ${error}`);
248
+ }
249
+ }
250
+ }
251
+
252
+ /**
253
+ * Represents a Chronicle connection string.
254
+ */
255
+ export class ChronicleConnectionString {
256
+ static readonly DEVELOPMENT_CLIENT = 'chronicle-dev-client';
257
+ static readonly DEVELOPMENT_CLIENT_SECRET = 'chronicle-dev-secret';
258
+ static readonly Default = new ChronicleConnectionString('chronicle://localhost:35000');
259
+ static readonly Development = new ChronicleConnectionString(
260
+ `chronicle://${ChronicleConnectionString.DEVELOPMENT_CLIENT}:${ChronicleConnectionString.DEVELOPMENT_CLIENT_SECRET}@localhost:35000`
261
+ );
262
+
263
+ private readonly _builder: ChronicleConnectionStringBuilder;
264
+ private readonly _serverAddress: ChronicleServerAddress;
265
+
266
+ constructor(connectionString: string) {
267
+ this._builder = new ChronicleConnectionStringBuilder(connectionString);
268
+ this._serverAddress = {
269
+ host: this._builder.host,
270
+ port: this._builder.port
271
+ };
272
+ }
273
+
274
+ get serverAddress(): ChronicleServerAddress {
275
+ return this._serverAddress;
276
+ }
277
+
278
+ get username(): string | undefined {
279
+ return this._builder.username;
280
+ }
281
+
282
+ get password(): string | undefined {
283
+ return this._builder.password;
284
+ }
285
+
286
+ get authenticationMode(): AuthenticationMode {
287
+ return this._builder.authenticationMode;
288
+ }
289
+
290
+ get apiKey(): string | undefined {
291
+ return this._builder.apiKey;
292
+ }
293
+
294
+ get disableTls(): boolean {
295
+ return this._builder.disableTls;
296
+ }
297
+
298
+ get certificatePath(): string | undefined {
299
+ return this._builder.certificatePath;
300
+ }
301
+
302
+ get certificatePassword(): string | undefined {
303
+ return this._builder.certificatePassword;
304
+ }
305
+
306
+ withCredentials(username: string, password: string): ChronicleConnectionString {
307
+ const builder = new ChronicleConnectionStringBuilder(this.toString());
308
+ builder.username = username;
309
+ builder.password = password;
310
+ return new ChronicleConnectionString(builder.build());
311
+ }
312
+
313
+ withApiKey(apiKey: string): ChronicleConnectionString {
314
+ const builder = new ChronicleConnectionStringBuilder(this.toString());
315
+ builder.apiKey = apiKey;
316
+ return new ChronicleConnectionString(builder.build());
317
+ }
318
+
319
+ createCredentials(): grpc.ChannelCredentials {
320
+ if (this.disableTls) {
321
+ return grpc.credentials.createInsecure();
322
+ }
323
+
324
+ return grpc.credentials.createSsl();
325
+ }
326
+
327
+ toString(): string {
328
+ return this._builder.build();
329
+ }
330
+ }
@@ -1,4 +1,45 @@
1
1
  // Copyright (c) Cratis. All rights reserved.
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
 
4
- export { ChronicleServices } from '@cratis/chronicle.contracts';
4
+ import type {
5
+ ConstraintsClient,
6
+ EventSeedingClient,
7
+ EventSequencesClient,
8
+ EventStoresClient,
9
+ EventTypesClient,
10
+ FailedPartitionsClient,
11
+ IdentitiesClient,
12
+ JobsClient,
13
+ NamespacesClient,
14
+ ObserversClient,
15
+ ProjectionsClient,
16
+ ReactorsClient,
17
+ ReadModelsClient,
18
+ RecommendationsClient,
19
+ ReducersClient,
20
+ ServerClient,
21
+ WebhooksClient
22
+ } from '@cratis/chronicle.contracts';
23
+
24
+ /**
25
+ * Represents all Chronicle gRPC services.
26
+ */
27
+ export interface ChronicleServices {
28
+ eventStores: EventStoresClient;
29
+ namespaces: NamespacesClient;
30
+ recommendations: RecommendationsClient;
31
+ identities: IdentitiesClient;
32
+ eventSequences: EventSequencesClient;
33
+ eventTypes: EventTypesClient;
34
+ constraints: ConstraintsClient;
35
+ observers: ObserversClient;
36
+ failedPartitions: FailedPartitionsClient;
37
+ reactors: ReactorsClient;
38
+ reducers: ReducersClient;
39
+ projections: ProjectionsClient;
40
+ readModels: ReadModelsClient;
41
+ jobs: JobsClient;
42
+ webhooks: WebhooksClient;
43
+ eventSeeding: EventSeedingClient;
44
+ server: ServerClient;
45
+ }
@@ -1,4 +1,30 @@
1
1
  // Copyright (c) Cratis. All rights reserved.
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
 
4
- export { Guid } from '@cratis/chronicle.contracts';
4
+ import type { Guid as ContractsGuid } from '@cratis/chronicle.contracts';
5
+ import { Guid as FundamentalGuid } from '@cratis/fundamentals';
6
+
7
+ export { Guid } from '@cratis/fundamentals';
8
+
9
+ /**
10
+ * Converts a Chronicle Guid into the protobuf-net bcl.Guid shape used by the
11
+ * contracts package.
12
+ */
13
+ export function toContractsGuid(guid: FundamentalGuid): ContractsGuid {
14
+ const bytes = guid.bytes ?? FundamentalGuid.empty.bytes ?? [];
15
+ if (bytes.length !== 16) {
16
+ throw new Error(`Invalid Guid '${guid.toString()}'. Expected 16 bytes.`);
17
+ }
18
+
19
+ let lo = 0n;
20
+ let hi = 0n;
21
+ for (let index = 0; index < 8; index++) {
22
+ lo |= BigInt(bytes[index]) << BigInt(index * 8);
23
+ hi |= BigInt(bytes[index + 8]) << BigInt(index * 8);
24
+ }
25
+
26
+ return {
27
+ lo,
28
+ hi
29
+ };
30
+ }
@@ -1,13 +1,135 @@
1
1
  // Copyright (c) Cratis. All rights reserved.
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
 
4
- import type { ITokenProvider } from '@cratis/chronicle.contracts';
4
+ import * as http from 'http';
5
+ import * as https from 'https';
5
6
 
6
- export {
7
- NoOpTokenProvider,
8
- OAuthTokenProvider
9
- } from '@cratis/chronicle.contracts';
7
+ const TOKEN_EXPIRY_BUFFER_SECONDS = 60;
8
+ const DEFAULT_TOKEN_EXPIRY_SECONDS = 3600;
10
9
 
11
- export type { ITokenProvider } from '@cratis/chronicle.contracts';
10
+ /**
11
+ * Interface for providing authentication tokens.
12
+ */
13
+ export interface ITokenProvider {
14
+ /**
15
+ * Gets the current access token.
16
+ * @returns Promise resolving to the access token or undefined if not available.
17
+ */
18
+ getAccessToken(): Promise<string | undefined>;
19
+
20
+ /**
21
+ * Refreshes the access token by clearing cached tokens and obtaining a new one.
22
+ * @returns Promise resolving to the new access token or undefined if not available.
23
+ */
24
+ refresh(): Promise<string | undefined>;
25
+ }
26
+
27
+ /**
28
+ * No-op token provider for when authentication is not required.
29
+ */
30
+ export class NoOpTokenProvider implements ITokenProvider {
31
+ async getAccessToken(): Promise<string | undefined> {
32
+ return undefined;
33
+ }
34
+
35
+ async refresh(): Promise<string | undefined> {
36
+ return undefined;
37
+ }
38
+ }
39
+
40
+ interface OAuthTokenResponse {
41
+ access_token: string;
42
+ expires_in: number;
43
+ }
44
+
45
+ /**
46
+ * OAuth token provider using client credentials flow.
47
+ */
48
+ export class OAuthTokenProvider implements ITokenProvider {
49
+ private _accessToken?: string;
50
+ private _tokenExpiry = new Date(0);
51
+ private _refreshPromise?: Promise<string | undefined>;
52
+
53
+ constructor(
54
+ private readonly _tokenEndpoint: string,
55
+ private readonly _clientId: string,
56
+ private readonly _clientSecret: string
57
+ ) {}
58
+
59
+ async getAccessToken(): Promise<string | undefined> {
60
+ if (this._accessToken && new Date() < this._tokenExpiry) {
61
+ return this._accessToken;
62
+ }
63
+
64
+ if (this._refreshPromise) {
65
+ return this._refreshPromise;
66
+ }
67
+
68
+ this._refreshPromise = this.fetchAccessToken();
69
+ try {
70
+ return await this._refreshPromise;
71
+ } finally {
72
+ this._refreshPromise = undefined;
73
+ }
74
+ }
75
+
76
+ async refresh(): Promise<string | undefined> {
77
+ this._accessToken = undefined;
78
+ this._tokenExpiry = new Date(0);
79
+ return this.getAccessToken();
80
+ }
81
+
82
+ private async fetchAccessToken(): Promise<string | undefined> {
83
+ const params = new URLSearchParams();
84
+ params.append('grant_type', 'client_credentials');
85
+ params.append('client_id', this._clientId);
86
+ params.append('client_secret', this._clientSecret);
87
+
88
+ const body = params.toString();
89
+
90
+ return new Promise((resolve, reject) => {
91
+ const url = new URL(this._tokenEndpoint);
92
+ const httpModule = url.protocol === 'https:' ? https : http;
93
+
94
+ const req = httpModule.request(url, {
95
+ method: 'POST',
96
+ headers: {
97
+ 'Content-Type': 'application/x-www-form-urlencoded',
98
+ 'Content-Length': Buffer.byteLength(body)
99
+ }
100
+ }, response => {
101
+ let data = '';
102
+
103
+ response.on('data', chunk => {
104
+ data += chunk;
105
+ });
106
+
107
+ response.on('end', () => {
108
+ if (response.statusCode !== 200) {
109
+ reject(new Error(`Token request failed with status ${response.statusCode}: ${data}`));
110
+ return;
111
+ }
112
+
113
+ try {
114
+ const tokenResponse = JSON.parse(data) as OAuthTokenResponse;
115
+ this._accessToken = tokenResponse.access_token;
116
+ const expiresInSeconds = tokenResponse.expires_in || DEFAULT_TOKEN_EXPIRY_SECONDS;
117
+ this._tokenExpiry = new Date(Date.now() + (expiresInSeconds - TOKEN_EXPIRY_BUFFER_SECONDS) * 1000);
118
+ resolve(this._accessToken);
119
+ } catch (error) {
120
+ reject(new Error(`Failed to parse token response: ${error instanceof Error ? error.message : String(error)}`));
121
+ }
122
+ });
123
+ });
124
+
125
+ req.on('error', error => {
126
+ reject(new Error(`Token request failed: ${error.message}`));
127
+ });
128
+
129
+ req.write(body);
130
+ req.end();
131
+ });
132
+ }
133
+ }
12
134
 
13
135
  export type TokenProvider = ITokenProvider;
@@ -0,0 +1,33 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { Guid } from '@cratis/fundamentals';
5
+
6
+ /**
7
+ * Represents a correlation identifier used to track operations across call boundaries.
8
+ */
9
+ export class CorrelationId {
10
+ /**
11
+ * A well-known {@link CorrelationId} representing an unset/empty value.
12
+ */
13
+ static readonly notSet = new CorrelationId('00000000-0000-0000-0000-000000000000');
14
+
15
+ /**
16
+ * Creates a new unique {@link CorrelationId}.
17
+ * @returns A new {@link CorrelationId} backed by a freshly generated GUID.
18
+ */
19
+ static create(): CorrelationId {
20
+ return new CorrelationId(Guid.create().toString());
21
+ }
22
+
23
+ /**
24
+ * Initializes a new instance of the {@link CorrelationId} class.
25
+ * @param value - The string value of the correlation identifier.
26
+ */
27
+ constructor(readonly value: string) {}
28
+
29
+ /** @inheritdoc */
30
+ toString(): string {
31
+ return this.value;
32
+ }
33
+ }
@@ -0,0 +1,30 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { AsyncLocalStorage } from 'async_hooks';
5
+ import { CorrelationId } from './CorrelationId';
6
+ import { ICorrelationIdAccessor } from './ICorrelationIdAccessor';
7
+ import { ICorrelationIdSetter } from './ICorrelationIdSetter';
8
+
9
+ /**
10
+ * Implements both {@link ICorrelationIdAccessor} and {@link ICorrelationIdSetter},
11
+ * using {@link AsyncLocalStorage} to scope the correlation identifier to the active async call context.
12
+ */
13
+ export class CorrelationIdManager implements ICorrelationIdAccessor, ICorrelationIdSetter {
14
+ private readonly _storage = new AsyncLocalStorage<CorrelationId>();
15
+
16
+ /** @inheritdoc */
17
+ get current(): CorrelationId {
18
+ return this._storage.getStore() ?? CorrelationId.create();
19
+ }
20
+
21
+ /** @inheritdoc */
22
+ setCurrent(correlationId: CorrelationId): void {
23
+ this._storage.enterWith(correlationId);
24
+ }
25
+
26
+ /** @inheritdoc */
27
+ clear(): void {
28
+ this._storage.enterWith(CorrelationId.create());
29
+ }
30
+ }
@@ -0,0 +1,15 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { CorrelationId } from './CorrelationId';
5
+
6
+ /**
7
+ * Defines the read side of a correlation identifier provider scoped to the active call context.
8
+ */
9
+ export interface ICorrelationIdAccessor {
10
+ /**
11
+ * Gets the current correlation identifier for the active call context.
12
+ * @returns The current {@link CorrelationId}.
13
+ */
14
+ readonly current: CorrelationId;
15
+ }
@@ -0,0 +1,21 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { CorrelationId } from './CorrelationId';
5
+
6
+ /**
7
+ * Defines the write side of a correlation identifier provider scoped to the active call context.
8
+ */
9
+ export interface ICorrelationIdSetter {
10
+ /**
11
+ * Sets the current correlation identifier for the active call context.
12
+ * @param correlationId - The {@link CorrelationId} to set.
13
+ */
14
+ setCurrent(correlationId: CorrelationId): void;
15
+
16
+ /**
17
+ * Clears the current correlation identifier for the active call context,
18
+ * causing the next access to generate a new unique identifier.
19
+ */
20
+ clear(): void;
21
+ }
@@ -0,0 +1,15 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ export { CorrelationId } from './CorrelationId';
5
+ export type { ICorrelationIdAccessor } from './ICorrelationIdAccessor';
6
+ export type { ICorrelationIdSetter } from './ICorrelationIdSetter';
7
+ export { CorrelationIdManager } from './CorrelationIdManager';
8
+
9
+ import { CorrelationIdManager } from './CorrelationIdManager';
10
+
11
+ /**
12
+ * The default singleton {@link CorrelationIdManager} for the process.
13
+ * Use this to get and set the correlation identifier for the current async call context.
14
+ */
15
+ export const correlationIdManager = new CorrelationIdManager();