@cratis/chronicle 0.0.1 → 0.1.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 (157) hide show
  1. package/Auditing/Causation.ts +29 -0
  2. package/Auditing/CausationManager.ts +51 -0
  3. package/Auditing/CausationType.ts +38 -0
  4. package/Auditing/ICausationManager.ts +29 -0
  5. package/Auditing/index.ts +15 -0
  6. package/Correlation/CorrelationId.ts +33 -0
  7. package/Correlation/CorrelationIdManager.ts +30 -0
  8. package/Correlation/ICorrelationIdAccessor.ts +15 -0
  9. package/Correlation/ICorrelationIdSetter.ts +21 -0
  10. package/Correlation/index.ts +15 -0
  11. package/EventSequences/EventSequence.ts +48 -50
  12. package/Identity/IIdentityProvider.ts +26 -0
  13. package/Identity/Identity.ts +61 -0
  14. package/Identity/IdentityProvider.ts +28 -0
  15. package/Identity/index.ts +14 -0
  16. package/Projections/Projections.ts +75 -20
  17. package/Projections/declarative/ProjectionBuilderFor.ts +19 -2
  18. package/Projections/declarative/projection.ts +6 -2
  19. package/Projections/modelBound/index.ts +0 -2
  20. package/Projections/modelBound/setFromContext.ts +20 -2
  21. package/README.md +1 -1
  22. package/Reactors/Reactors.ts +1 -0
  23. package/Reducers/Reducers.ts +66 -2
  24. package/Schemas/JsonSchemaGenerator.ts +20 -3
  25. package/artifacts/DefaultClientArtifactsProvider.ts +0 -5
  26. package/artifacts/IClientArtifactsProvider.ts +0 -3
  27. package/connection/Guid.ts +29 -1
  28. package/dist/Auditing/Causation.d.ts +22 -0
  29. package/dist/Auditing/Causation.d.ts.map +1 -0
  30. package/dist/Auditing/Causation.js +30 -0
  31. package/dist/Auditing/Causation.js.map +1 -0
  32. package/dist/Auditing/CausationManager.d.ts +23 -0
  33. package/dist/Auditing/CausationManager.d.ts.map +1 -0
  34. package/dist/Auditing/CausationManager.js +45 -0
  35. package/dist/Auditing/CausationManager.js.map +1 -0
  36. package/dist/Auditing/CausationType.d.ts +30 -0
  37. package/dist/Auditing/CausationType.d.ts.map +1 -0
  38. package/dist/Auditing/CausationType.js +36 -0
  39. package/dist/Auditing/CausationType.js.map +1 -0
  40. package/dist/Auditing/ICausationManager.d.ts +24 -0
  41. package/dist/Auditing/ICausationManager.d.ts.map +1 -0
  42. package/dist/Auditing/ICausationManager.js +4 -0
  43. package/dist/Auditing/ICausationManager.js.map +1 -0
  44. package/dist/Auditing/index.d.ts +11 -0
  45. package/dist/Auditing/index.d.ts.map +1 -0
  46. package/dist/Auditing/index.js +12 -0
  47. package/dist/Auditing/index.js.map +1 -0
  48. package/dist/Correlation/CorrelationId.d.ts +23 -0
  49. package/dist/Correlation/CorrelationId.d.ts.map +1 -0
  50. package/dist/Correlation/CorrelationId.js +32 -0
  51. package/dist/Correlation/CorrelationId.js.map +1 -0
  52. package/dist/Correlation/CorrelationIdManager.d.ts +17 -0
  53. package/dist/Correlation/CorrelationIdManager.d.ts.map +1 -0
  54. package/dist/Correlation/CorrelationIdManager.js +24 -0
  55. package/dist/Correlation/CorrelationIdManager.js.map +1 -0
  56. package/dist/Correlation/ICorrelationIdAccessor.d.ts +12 -0
  57. package/dist/Correlation/ICorrelationIdAccessor.d.ts.map +1 -0
  58. package/dist/Correlation/ICorrelationIdAccessor.js +4 -0
  59. package/dist/Correlation/ICorrelationIdAccessor.js.map +1 -0
  60. package/dist/Correlation/ICorrelationIdSetter.d.ts +17 -0
  61. package/dist/Correlation/ICorrelationIdSetter.d.ts.map +1 -0
  62. package/dist/Correlation/ICorrelationIdSetter.js +4 -0
  63. package/dist/Correlation/ICorrelationIdSetter.js.map +1 -0
  64. package/dist/Correlation/index.d.ts +11 -0
  65. package/dist/Correlation/index.d.ts.map +1 -0
  66. package/dist/Correlation/index.js +11 -0
  67. package/dist/Correlation/index.js.map +1 -0
  68. package/dist/EventSequences/EventSequence.d.ts.map +1 -1
  69. package/dist/EventSequences/EventSequence.js +45 -46
  70. package/dist/EventSequences/EventSequence.js.map +1 -1
  71. package/dist/Identity/IIdentityProvider.d.ts +21 -0
  72. package/dist/Identity/IIdentityProvider.d.ts.map +1 -0
  73. package/dist/Identity/IIdentityProvider.js +4 -0
  74. package/dist/Identity/IIdentityProvider.js.map +1 -0
  75. package/dist/Identity/Identity.d.ts +37 -0
  76. package/dist/Identity/Identity.d.ts.map +1 -0
  77. package/dist/Identity/Identity.js +60 -0
  78. package/dist/Identity/Identity.js.map +1 -0
  79. package/dist/Identity/IdentityProvider.d.ts +15 -0
  80. package/dist/Identity/IdentityProvider.d.ts.map +1 -0
  81. package/dist/Identity/IdentityProvider.js +23 -0
  82. package/dist/Identity/IdentityProvider.js.map +1 -0
  83. package/dist/Identity/index.d.ts +10 -0
  84. package/dist/Identity/index.d.ts.map +1 -0
  85. package/dist/Identity/index.js +11 -0
  86. package/dist/Identity/index.js.map +1 -0
  87. package/dist/Projections/Projections.d.ts +9 -1
  88. package/dist/Projections/Projections.d.ts.map +1 -1
  89. package/dist/Projections/Projections.js +70 -19
  90. package/dist/Projections/Projections.js.map +1 -1
  91. package/dist/Projections/declarative/ProjectionBuilderFor.d.ts +6 -0
  92. package/dist/Projections/declarative/ProjectionBuilderFor.d.ts.map +1 -1
  93. package/dist/Projections/declarative/ProjectionBuilderFor.js +18 -2
  94. package/dist/Projections/declarative/ProjectionBuilderFor.js.map +1 -1
  95. package/dist/Projections/declarative/projection.d.ts +5 -1
  96. package/dist/Projections/declarative/projection.d.ts.map +1 -1
  97. package/dist/Projections/declarative/projection.js +3 -2
  98. package/dist/Projections/declarative/projection.js.map +1 -1
  99. package/dist/Projections/modelBound/index.d.ts +0 -2
  100. package/dist/Projections/modelBound/index.d.ts.map +1 -1
  101. package/dist/Projections/modelBound/index.js +0 -1
  102. package/dist/Projections/modelBound/index.js.map +1 -1
  103. package/dist/Projections/modelBound/setFromContext.d.ts +4 -1
  104. package/dist/Projections/modelBound/setFromContext.d.ts.map +1 -1
  105. package/dist/Projections/modelBound/setFromContext.js +12 -7
  106. package/dist/Projections/modelBound/setFromContext.js.map +1 -1
  107. package/dist/Reactors/Reactors.d.ts.map +1 -1
  108. package/dist/Reactors/Reactors.js +1 -0
  109. package/dist/Reactors/Reactors.js.map +1 -1
  110. package/dist/Reducers/Reducers.d.ts +2 -0
  111. package/dist/Reducers/Reducers.d.ts.map +1 -1
  112. package/dist/Reducers/Reducers.js +60 -2
  113. package/dist/Reducers/Reducers.js.map +1 -1
  114. package/dist/Schemas/JsonSchemaGenerator.d.ts.map +1 -1
  115. package/dist/Schemas/JsonSchemaGenerator.js +17 -3
  116. package/dist/Schemas/JsonSchemaGenerator.js.map +1 -1
  117. package/dist/artifacts/DefaultClientArtifactsProvider.d.ts +0 -2
  118. package/dist/artifacts/DefaultClientArtifactsProvider.d.ts.map +1 -1
  119. package/dist/artifacts/DefaultClientArtifactsProvider.js +0 -4
  120. package/dist/artifacts/DefaultClientArtifactsProvider.js.map +1 -1
  121. package/dist/artifacts/IClientArtifactsProvider.d.ts +0 -2
  122. package/dist/artifacts/IClientArtifactsProvider.d.ts.map +1 -1
  123. package/dist/connection/Guid.d.ts +8 -1
  124. package/dist/connection/Guid.d.ts.map +1 -1
  125. package/dist/connection/Guid.js +24 -1
  126. package/dist/connection/Guid.js.map +1 -1
  127. package/dist/index.d.ts +4 -0
  128. package/dist/index.d.ts.map +1 -1
  129. package/dist/index.js +4 -0
  130. package/dist/index.js.map +1 -1
  131. package/dist/sinks/WellKnownSinks.d.ts +15 -0
  132. package/dist/sinks/WellKnownSinks.d.ts.map +1 -0
  133. package/dist/sinks/WellKnownSinks.js +17 -0
  134. package/dist/sinks/WellKnownSinks.js.map +1 -0
  135. package/dist/sinks/index.d.ts +2 -0
  136. package/dist/sinks/index.d.ts.map +1 -0
  137. package/dist/sinks/index.js +4 -0
  138. package/dist/sinks/index.js.map +1 -0
  139. package/dist/tsconfig.tsbuildinfo +1 -1
  140. package/dist/types/DecoratorType.d.ts +1 -3
  141. package/dist/types/DecoratorType.d.ts.map +1 -1
  142. package/dist/types/DecoratorType.js +0 -2
  143. package/dist/types/DecoratorType.js.map +1 -1
  144. package/index.ts +4 -0
  145. package/package.json +2 -2
  146. package/sinks/WellKnownSinks.ts +21 -0
  147. package/sinks/index.ts +4 -0
  148. package/types/DecoratorType.ts +1 -4
  149. package/Projections/modelBound/modelBound.ts +0 -59
  150. package/dist/Grpc.d.ts +0 -19
  151. package/dist/Grpc.d.ts.map +0 -1
  152. package/dist/Grpc.js +0 -33
  153. package/dist/Grpc.js.map +0 -1
  154. package/dist/Projections/modelBound/modelBound.d.ts +0 -31
  155. package/dist/Projections/modelBound/modelBound.d.ts.map +0 -1
  156. package/dist/Projections/modelBound/modelBound.js +0 -39
  157. package/dist/Projections/modelBound/modelBound.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEjF,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEjF,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -15,7 +15,11 @@ export * from './Reducers';
15
15
  export * from './ReadModels';
16
16
  export * from './Projections';
17
17
  export * from './Observation';
18
+ export * from './sinks';
18
19
  export * from './Schemas';
19
20
  export * from './types';
20
21
  export * from './artifacts';
22
+ export * from './Identity';
23
+ export * from './Auditing';
24
+ export * from './Correlation';
21
25
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEjF,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEjF,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Guid } from '@cratis/fundamentals';
2
+ /**
3
+ * Well-known Chronicle sink identifiers.
4
+ */
5
+ export declare const WellKnownSinks: {
6
+ /** In-memory sink. */
7
+ readonly InMemory: Guid;
8
+ /** Null sink. */
9
+ readonly Null: Guid;
10
+ /** MongoDB sink. */
11
+ readonly MongoDB: Guid;
12
+ /** SQL sink. */
13
+ readonly SQL: Guid;
14
+ };
15
+ //# sourceMappingURL=WellKnownSinks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WellKnownSinks.d.ts","sourceRoot":"","sources":["../../sinks/WellKnownSinks.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,cAAc;IACvB,sBAAsB;;IAGtB,iBAAiB;;IAGjB,oBAAoB;;IAGpB,gBAAgB;;CAEV,CAAC"}
@@ -0,0 +1,17 @@
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
+ import { Guid } from '@cratis/fundamentals';
4
+ /**
5
+ * Well-known Chronicle sink identifiers.
6
+ */
7
+ export const WellKnownSinks = {
8
+ /** In-memory sink. */
9
+ InMemory: Guid.parse('8a23995d-da0b-4c4c-818b-f97992f26bbf'),
10
+ /** Null sink. */
11
+ Null: Guid.empty,
12
+ /** MongoDB sink. */
13
+ MongoDB: Guid.parse('22202c41-2be1-4547-9c00-f0b1f797fd75'),
14
+ /** SQL sink. */
15
+ SQL: Guid.parse('f7d3a1e2-4b5c-4d6e-8f9a-0b1c2d3e4f5a')
16
+ };
17
+ //# sourceMappingURL=WellKnownSinks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WellKnownSinks.js","sourceRoot":"","sources":["../../sinks/WellKnownSinks.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,sBAAsB;IACtB,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,sCAAsC,CAAC;IAE5D,iBAAiB;IACjB,IAAI,EAAE,IAAI,CAAC,KAAK;IAEhB,oBAAoB;IACpB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,sCAAsC,CAAC;IAE3D,gBAAgB;IAChB,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,sCAAsC,CAAC;CACjD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { WellKnownSinks } from './WellKnownSinks';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../sinks/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,4 @@
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
+ export { WellKnownSinks } from './WellKnownSinks';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../sinks/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"root":["../ChronicleClient.ts","../ChronicleOptions.ts","../EventStore.ts","../EventStoreName.ts","../EventStoreNamespaceName.ts","../IChronicleClient.ts","../IEventStore.ts","../Metrics.ts","../Tracing.ts","../index.ts","../EventSequences/AppendError.ts","../EventSequences/AppendOptions.ts","../EventSequences/AppendResult.ts","../EventSequences/ConstraintViolation.ts","../EventSequences/EventLog.ts","../EventSequences/EventSequence.ts","../EventSequences/EventSequenceId.ts","../EventSequences/EventSequenceNumber.ts","../EventSequences/IEventLog.ts","../EventSequences/IEventSequence.ts","../EventSequences/index.ts","../Events/AppendedEvent.ts","../Events/CausationEntry.ts","../Events/EventContext.ts","../Events/EventType.ts","../Events/EventTypeGeneration.ts","../Events/EventTypeId.ts","../Events/EventTypes.ts","../Events/IEventTypes.ts","../Events/eventTypeDecorator.ts","../Events/index.ts","../Events/Constraints/ConstraintBuilder.ts","../Events/Constraints/ConstraintId.ts","../Events/Constraints/Constraints.ts","../Events/Constraints/IConstraint.ts","../Events/Constraints/IConstraintBuilder.ts","../Events/Constraints/IConstraints.ts","../Events/Constraints/IUniqueConstraintBuilder.ts","../Events/Constraints/UniqueConstraintBuilder.ts","../Events/Constraints/constraint.ts","../Events/Constraints/index.ts","../Observation/ObserverId.ts","../Observation/ObserverRunningState.ts","../Observation/index.ts","../Projections/IProjections.ts","../Projections/ProjectionId.ts","../Projections/Projections.ts","../Projections/index.ts","../Projections/declarative/AllSetBuilder.ts","../Projections/declarative/FromBuilder.ts","../Projections/declarative/FromEveryBuilder.ts","../Projections/declarative/IAddBuilder.ts","../Projections/declarative/IAddChildBuilder.ts","../Projections/declarative/IAllSetBuilder.ts","../Projections/declarative/IChildrenBuilder.ts","../Projections/declarative/ICompositeKeyBuilder.ts","../Projections/declarative/IFromBuilder.ts","../Projections/declarative/IFromEveryBuilder.ts","../Projections/declarative/IJoinBuilder.ts","../Projections/declarative/INestedBuilder.ts","../Projections/declarative/IProjectionBuilder.ts","../Projections/declarative/IProjectionBuilderFor.ts","../Projections/declarative/IProjectionFor.ts","../Projections/declarative/IReadModelPropertiesBuilder.ts","../Projections/declarative/IRemovedWithBuilder.ts","../Projections/declarative/IRemovedWithJoinBuilder.ts","../Projections/declarative/ISetBuilder.ts","../Projections/declarative/ISubtractBuilder.ts","../Projections/declarative/JoinBuilder.ts","../Projections/declarative/ProjectionBuilderFor.ts","../Projections/declarative/RemovedWithBuilder.ts","../Projections/declarative/RemovedWithJoinBuilder.ts","../Projections/declarative/SetBuilder.ts","../Projections/declarative/index.ts","../Projections/declarative/projection.ts","../Projections/modelBound/FromEventMetadata.ts","../Projections/modelBound/FromEventOptions.ts","../Projections/modelBound/addFrom.ts","../Projections/modelBound/childrenFrom.ts","../Projections/modelBound/clearWith.ts","../Projections/modelBound/count.ts","../Projections/modelBound/decrement.ts","../Projections/modelBound/fromEvent.ts","../Projections/modelBound/fromEvery.ts","../Projections/modelBound/increment.ts","../Projections/modelBound/index.ts","../Projections/modelBound/join.ts","../Projections/modelBound/modelBound.ts","../Projections/modelBound/nested.ts","../Projections/modelBound/notRewindable.ts","../Projections/modelBound/removedWith.ts","../Projections/modelBound/removedWithJoin.ts","../Projections/modelBound/setFrom.ts","../Projections/modelBound/setFromContext.ts","../Projections/modelBound/setValue.ts","../Projections/modelBound/subtractFrom.ts","../Reactors/IReactors.ts","../Reactors/ReactorId.ts","../Reactors/Reactors.ts","../Reactors/index.ts","../Reactors/reactor.ts","../ReadModels/ReadModelId.ts","../ReadModels/index.ts","../ReadModels/readModel.ts","../Reducers/IReducers.ts","../Reducers/ReducerId.ts","../Reducers/Reducers.ts","../Reducers/index.ts","../Reducers/reducer.ts","../Schemas/JsonSchema.ts","../Schemas/JsonSchemaGenerator.ts","../Schemas/index.ts","../Schemas/jsonSchemaProperty.ts","../artifacts/DefaultClientArtifactsProvider.ts","../artifacts/IClientArtifactsProvider.ts","../artifacts/index.ts","../connection/ChronicleConnection.ts","../connection/ChronicleConnectionString.ts","../connection/ChronicleServices.ts","../connection/ConnectionLifecycle.ts","../connection/DateTimeOffset.ts","../connection/Guid.ts","../connection/TokenProvider.ts","../connection/index.ts","../types/DecoratorType.ts","../types/TypeDiscoverer.ts","../types/TypeIntrospector.ts","../types/index.ts"],"version":"6.0.3"}
1
+ {"root":["../ChronicleClient.ts","../ChronicleOptions.ts","../EventStore.ts","../EventStoreName.ts","../EventStoreNamespaceName.ts","../IChronicleClient.ts","../IEventStore.ts","../Metrics.ts","../Tracing.ts","../index.ts","../Auditing/Causation.ts","../Auditing/CausationManager.ts","../Auditing/CausationType.ts","../Auditing/ICausationManager.ts","../Auditing/index.ts","../Correlation/CorrelationId.ts","../Correlation/CorrelationIdManager.ts","../Correlation/ICorrelationIdAccessor.ts","../Correlation/ICorrelationIdSetter.ts","../Correlation/index.ts","../EventSequences/AppendError.ts","../EventSequences/AppendOptions.ts","../EventSequences/AppendResult.ts","../EventSequences/ConstraintViolation.ts","../EventSequences/EventLog.ts","../EventSequences/EventSequence.ts","../EventSequences/EventSequenceId.ts","../EventSequences/EventSequenceNumber.ts","../EventSequences/IEventLog.ts","../EventSequences/IEventSequence.ts","../EventSequences/index.ts","../Events/AppendedEvent.ts","../Events/CausationEntry.ts","../Events/EventContext.ts","../Events/EventType.ts","../Events/EventTypeGeneration.ts","../Events/EventTypeId.ts","../Events/EventTypes.ts","../Events/IEventTypes.ts","../Events/eventTypeDecorator.ts","../Events/index.ts","../Events/Constraints/ConstraintBuilder.ts","../Events/Constraints/ConstraintId.ts","../Events/Constraints/Constraints.ts","../Events/Constraints/IConstraint.ts","../Events/Constraints/IConstraintBuilder.ts","../Events/Constraints/IConstraints.ts","../Events/Constraints/IUniqueConstraintBuilder.ts","../Events/Constraints/UniqueConstraintBuilder.ts","../Events/Constraints/constraint.ts","../Events/Constraints/index.ts","../Identity/IIdentityProvider.ts","../Identity/Identity.ts","../Identity/IdentityProvider.ts","../Identity/index.ts","../Observation/ObserverId.ts","../Observation/ObserverRunningState.ts","../Observation/index.ts","../Projections/IProjections.ts","../Projections/ProjectionId.ts","../Projections/Projections.ts","../Projections/index.ts","../Projections/declarative/AllSetBuilder.ts","../Projections/declarative/FromBuilder.ts","../Projections/declarative/FromEveryBuilder.ts","../Projections/declarative/IAddBuilder.ts","../Projections/declarative/IAddChildBuilder.ts","../Projections/declarative/IAllSetBuilder.ts","../Projections/declarative/IChildrenBuilder.ts","../Projections/declarative/ICompositeKeyBuilder.ts","../Projections/declarative/IFromBuilder.ts","../Projections/declarative/IFromEveryBuilder.ts","../Projections/declarative/IJoinBuilder.ts","../Projections/declarative/INestedBuilder.ts","../Projections/declarative/IProjectionBuilder.ts","../Projections/declarative/IProjectionBuilderFor.ts","../Projections/declarative/IProjectionFor.ts","../Projections/declarative/IReadModelPropertiesBuilder.ts","../Projections/declarative/IRemovedWithBuilder.ts","../Projections/declarative/IRemovedWithJoinBuilder.ts","../Projections/declarative/ISetBuilder.ts","../Projections/declarative/ISubtractBuilder.ts","../Projections/declarative/JoinBuilder.ts","../Projections/declarative/ProjectionBuilderFor.ts","../Projections/declarative/RemovedWithBuilder.ts","../Projections/declarative/RemovedWithJoinBuilder.ts","../Projections/declarative/SetBuilder.ts","../Projections/declarative/index.ts","../Projections/declarative/projection.ts","../Projections/modelBound/FromEventMetadata.ts","../Projections/modelBound/FromEventOptions.ts","../Projections/modelBound/addFrom.ts","../Projections/modelBound/childrenFrom.ts","../Projections/modelBound/clearWith.ts","../Projections/modelBound/count.ts","../Projections/modelBound/decrement.ts","../Projections/modelBound/fromEvent.ts","../Projections/modelBound/fromEvery.ts","../Projections/modelBound/increment.ts","../Projections/modelBound/index.ts","../Projections/modelBound/join.ts","../Projections/modelBound/nested.ts","../Projections/modelBound/notRewindable.ts","../Projections/modelBound/removedWith.ts","../Projections/modelBound/removedWithJoin.ts","../Projections/modelBound/setFrom.ts","../Projections/modelBound/setFromContext.ts","../Projections/modelBound/setValue.ts","../Projections/modelBound/subtractFrom.ts","../Reactors/IReactors.ts","../Reactors/ReactorId.ts","../Reactors/Reactors.ts","../Reactors/index.ts","../Reactors/reactor.ts","../ReadModels/ReadModelId.ts","../ReadModels/index.ts","../ReadModels/readModel.ts","../Reducers/IReducers.ts","../Reducers/ReducerId.ts","../Reducers/Reducers.ts","../Reducers/index.ts","../Reducers/reducer.ts","../Schemas/JsonSchema.ts","../Schemas/JsonSchemaGenerator.ts","../Schemas/index.ts","../Schemas/jsonSchemaProperty.ts","../artifacts/DefaultClientArtifactsProvider.ts","../artifacts/IClientArtifactsProvider.ts","../artifacts/index.ts","../connection/ChronicleConnection.ts","../connection/ChronicleConnectionString.ts","../connection/ChronicleServices.ts","../connection/ConnectionLifecycle.ts","../connection/DateTimeOffset.ts","../connection/Guid.ts","../connection/TokenProvider.ts","../connection/index.ts","../sinks/WellKnownSinks.ts","../sinks/index.ts","../types/DecoratorType.ts","../types/TypeDiscoverer.ts","../types/TypeIntrospector.ts","../types/index.ts"],"version":"6.0.3"}
@@ -13,8 +13,6 @@ export declare enum DecoratorType {
13
13
  /** Constraint artifacts discovered through the constraint decorator. */
14
14
  Constraint = "constraint",
15
15
  /** Declarative projection artifacts discovered through the projection decorator. */
16
- Projection = "projection",
17
- /** Model-bound projection artifacts discovered through the modelBound decorator. */
18
- ModelBoundProjection = "modelBoundProjection"
16
+ Projection = "projection"
19
17
  }
20
18
  //# sourceMappingURL=DecoratorType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DecoratorType.d.ts","sourceRoot":"","sources":["../../types/DecoratorType.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,aAAa;IACrB,uEAAuE;IACvE,SAAS,cAAc;IAEvB,uEAAuE;IACvE,SAAS,cAAc;IAEvB,kEAAkE;IAClE,OAAO,YAAY;IAEnB,kEAAkE;IAClE,OAAO,YAAY;IAEnB,wEAAwE;IACxE,UAAU,eAAe;IAEzB,oFAAoF;IACpF,UAAU,eAAe;IAEzB,oFAAoF;IACpF,oBAAoB,yBAAyB;CAChD"}
1
+ {"version":3,"file":"DecoratorType.d.ts","sourceRoot":"","sources":["../../types/DecoratorType.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,aAAa;IACrB,uEAAuE;IACvE,SAAS,cAAc;IAEvB,uEAAuE;IACvE,SAAS,cAAc;IAEvB,kEAAkE;IAClE,OAAO,YAAY;IAEnB,kEAAkE;IAClE,OAAO,YAAY;IAEnB,wEAAwE;IACxE,UAAU,eAAe;IAEzB,oFAAoF;IACpF,UAAU,eAAe;CAC5B"}
@@ -17,7 +17,5 @@ export var DecoratorType;
17
17
  DecoratorType["Constraint"] = "constraint";
18
18
  /** Declarative projection artifacts discovered through the projection decorator. */
19
19
  DecoratorType["Projection"] = "projection";
20
- /** Model-bound projection artifacts discovered through the modelBound decorator. */
21
- DecoratorType["ModelBoundProjection"] = "modelBoundProjection";
22
20
  })(DecoratorType || (DecoratorType = {}));
23
21
  //# sourceMappingURL=DecoratorType.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DecoratorType.js","sourceRoot":"","sources":["../../types/DecoratorType.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG;;GAEG;AACH,MAAM,CAAN,IAAY,aAqBX;AArBD,WAAY,aAAa;IACrB,uEAAuE;IACvE,wCAAuB,CAAA;IAEvB,uEAAuE;IACvE,wCAAuB,CAAA;IAEvB,kEAAkE;IAClE,oCAAmB,CAAA;IAEnB,kEAAkE;IAClE,oCAAmB,CAAA;IAEnB,wEAAwE;IACxE,0CAAyB,CAAA;IAEzB,oFAAoF;IACpF,0CAAyB,CAAA;IAEzB,oFAAoF;IACpF,8DAA6C,CAAA;AACjD,CAAC,EArBW,aAAa,KAAb,aAAa,QAqBxB"}
1
+ {"version":3,"file":"DecoratorType.js","sourceRoot":"","sources":["../../types/DecoratorType.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG;;GAEG;AACH,MAAM,CAAN,IAAY,aAkBX;AAlBD,WAAY,aAAa;IACrB,uEAAuE;IACvE,wCAAuB,CAAA;IAEvB,uEAAuE;IACvE,wCAAuB,CAAA;IAEvB,kEAAkE;IAClE,oCAAmB,CAAA;IAEnB,kEAAkE;IAClE,oCAAmB,CAAA;IAEnB,wEAAwE;IACxE,0CAAyB,CAAA;IAEzB,oFAAoF;IACpF,0CAAyB,CAAA;AAC7B,CAAC,EAlBW,aAAa,KAAb,aAAa,QAkBxB"}
package/index.ts CHANGED
@@ -19,6 +19,10 @@ export * from './Reducers';
19
19
  export * from './ReadModels';
20
20
  export * from './Projections';
21
21
  export * from './Observation';
22
+ export * from './sinks';
22
23
  export * from './Schemas';
23
24
  export * from './types';
24
25
  export * from './artifacts';
26
+ export * from './Identity';
27
+ export * from './Auditing';
28
+ export * from './Correlation';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/chronicle",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "TypeScript idiomatic client for Cratis Chronicle",
5
5
  "author": "Cratis",
6
6
  "license": "MIT",
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "publishConfig": {
16
16
  "access": "public",
17
- "provenance": false
17
+ "provenance": true
18
18
  },
19
19
  "type": "module",
20
20
  "main": "dist/index.js",
@@ -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 { Guid } from '@cratis/fundamentals';
5
+
6
+ /**
7
+ * Well-known Chronicle sink identifiers.
8
+ */
9
+ export const WellKnownSinks = {
10
+ /** In-memory sink. */
11
+ InMemory: Guid.parse('8a23995d-da0b-4c4c-818b-f97992f26bbf'),
12
+
13
+ /** Null sink. */
14
+ Null: Guid.empty,
15
+
16
+ /** MongoDB sink. */
17
+ MongoDB: Guid.parse('22202c41-2be1-4547-9c00-f0b1f797fd75'),
18
+
19
+ /** SQL sink. */
20
+ SQL: Guid.parse('f7d3a1e2-4b5c-4d6e-8f9a-0b1c2d3e4f5a')
21
+ } as const;
package/sinks/index.ts ADDED
@@ -0,0 +1,4 @@
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 { WellKnownSinks } from './WellKnownSinks';
@@ -21,8 +21,5 @@ export enum DecoratorType {
21
21
  Constraint = 'constraint',
22
22
 
23
23
  /** Declarative projection artifacts discovered through the projection decorator. */
24
- Projection = 'projection',
25
-
26
- /** Model-bound projection artifacts discovered through the modelBound decorator. */
27
- ModelBoundProjection = 'modelBoundProjection'
24
+ Projection = 'projection'
28
25
  }
@@ -1,59 +0,0 @@
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 'reflect-metadata';
5
- import { Constructor } from '@cratis/fundamentals';
6
- import { ProjectionId } from '../ProjectionId';
7
- import { DecoratorType, TypeDiscoverer } from '../../types';
8
-
9
- /** Metadata key used to store model-bound projection information on a class. */
10
- const MODEL_BOUND_METADATA_KEY = 'chronicle:modelBound';
11
-
12
- /**
13
- * Metadata stored on a model-bound projection class.
14
- */
15
- export interface ModelBoundMetadata {
16
- /** The unique identifier for the projection. */
17
- readonly id: ProjectionId;
18
-
19
- /** The optional explicit event sequence identifier. */
20
- readonly eventSequenceId: string | undefined;
21
- }
22
-
23
- /**
24
- * TypeScript decorator that marks a class as a model-bound projection.
25
- * @param id - The unique identifier for the projection. Defaults to the class name if omitted.
26
- * @param eventSequenceId - Optional explicit event sequence identifier.
27
- * @returns A class decorator.
28
- */
29
- export function modelBound(id: string = '', eventSequenceId?: string): ClassDecorator {
30
- return (target: object) => {
31
- const constructor = target as Function;
32
- const projectionId = new ProjectionId(id || constructor.name);
33
- const metadata: ModelBoundMetadata = { id: projectionId, eventSequenceId };
34
- Reflect.defineMetadata(MODEL_BOUND_METADATA_KEY, metadata, target);
35
- TypeDiscoverer.default.register(
36
- DecoratorType.ModelBoundProjection,
37
- constructor as Constructor,
38
- projectionId.value
39
- );
40
- };
41
- }
42
-
43
- /**
44
- * Gets the {@link ModelBoundMetadata} associated with a class decorated with {@link modelBound}.
45
- * @param target - The class constructor to retrieve metadata for.
46
- * @returns The associated metadata, or undefined if not decorated.
47
- */
48
- export function getModelBoundMetadata(target: Function): ModelBoundMetadata | undefined {
49
- return Reflect.getMetadata(MODEL_BOUND_METADATA_KEY, target);
50
- }
51
-
52
- /**
53
- * Checks whether a class has been decorated with {@link modelBound}.
54
- * @param target - The class constructor to check.
55
- * @returns True if the class has a model-bound decorator; false otherwise.
56
- */
57
- export function isModelBound(target: Function): boolean {
58
- return Reflect.hasMetadata(MODEL_BOUND_METADATA_KEY, target);
59
- }
package/dist/Grpc.d.ts DELETED
@@ -1,19 +0,0 @@
1
- import { ServiceError, ClientUnaryCall } from '@grpc/grpc-js';
2
- /**
3
- * Provides utility methods for working with gRPC clients.
4
- */
5
- export declare class Grpc {
6
- /**
7
- * Promisifies a gRPC unary call that uses a callback-based API.
8
- * @param callFunction - A function that invokes the gRPC method with a callback.
9
- * @returns A Promise that resolves with the response or rejects with the service error.
10
- */
11
- static call<TResponse>(callFunction: (callback: (error: ServiceError | null, response: TResponse) => void) => ClientUnaryCall): Promise<TResponse>;
12
- }
13
- /**
14
- * Promisifies a gRPC unary call that uses a callback-based API.
15
- * @param callFunction - A function that invokes the gRPC method with a callback.
16
- * @returns A Promise that resolves with the response or rejects with the service error.
17
- */
18
- export declare function promisifyGrpcCall<TResponse>(callFunction: (callback: (error: ServiceError | null, response: TResponse) => void) => ClientUnaryCall): Promise<TResponse>;
19
- //# sourceMappingURL=Grpc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Grpc.d.ts","sourceRoot":"","sources":["../Grpc.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE9D;;GAEG;AACH,qBAAa,IAAI;IACb;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAC,SAAS,EACjB,YAAY,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,EAAE,QAAQ,EAAE,SAAS,KAAK,IAAI,KAAK,eAAe,GACvG,OAAO,CAAC,SAAS,CAAC;CAWxB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EACvC,YAAY,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,EAAE,QAAQ,EAAE,SAAS,KAAK,IAAI,KAAK,eAAe,GACvG,OAAO,CAAC,SAAS,CAAC,CAEpB"}
package/dist/Grpc.js DELETED
@@ -1,33 +0,0 @@
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
- * Provides utility methods for working with gRPC clients.
5
- */
6
- export class Grpc {
7
- /**
8
- * Promisifies a gRPC unary call that uses a callback-based API.
9
- * @param callFunction - A function that invokes the gRPC method with a callback.
10
- * @returns A Promise that resolves with the response or rejects with the service error.
11
- */
12
- static call(callFunction) {
13
- return new Promise((resolve, reject) => {
14
- callFunction((error, response) => {
15
- if (error) {
16
- reject(error);
17
- }
18
- else {
19
- resolve(response);
20
- }
21
- });
22
- });
23
- }
24
- }
25
- /**
26
- * Promisifies a gRPC unary call that uses a callback-based API.
27
- * @param callFunction - A function that invokes the gRPC method with a callback.
28
- * @returns A Promise that resolves with the response or rejects with the service error.
29
- */
30
- export function promisifyGrpcCall(callFunction) {
31
- return Grpc.call(callFunction);
32
- }
33
- //# sourceMappingURL=Grpc.js.map
package/dist/Grpc.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Grpc.js","sourceRoot":"","sources":["../Grpc.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAIrG;;GAEG;AACH,MAAM,OAAO,IAAI;IACb;;;;OAIG;IACH,MAAM,CAAC,IAAI,CACP,YAAsG;QAEtG,OAAO,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC9C,YAAY,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;gBAC7B,IAAI,KAAK,EAAE,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;qBAAM,CAAC;oBACJ,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACtB,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC7B,YAAsG;IAEtG,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACnC,CAAC"}
@@ -1,31 +0,0 @@
1
- import 'reflect-metadata';
2
- import { ProjectionId } from '../ProjectionId';
3
- /**
4
- * Metadata stored on a model-bound projection class.
5
- */
6
- export interface ModelBoundMetadata {
7
- /** The unique identifier for the projection. */
8
- readonly id: ProjectionId;
9
- /** The optional explicit event sequence identifier. */
10
- readonly eventSequenceId: string | undefined;
11
- }
12
- /**
13
- * TypeScript decorator that marks a class as a model-bound projection.
14
- * @param id - The unique identifier for the projection. Defaults to the class name if omitted.
15
- * @param eventSequenceId - Optional explicit event sequence identifier.
16
- * @returns A class decorator.
17
- */
18
- export declare function modelBound(id?: string, eventSequenceId?: string): ClassDecorator;
19
- /**
20
- * Gets the {@link ModelBoundMetadata} associated with a class decorated with {@link modelBound}.
21
- * @param target - The class constructor to retrieve metadata for.
22
- * @returns The associated metadata, or undefined if not decorated.
23
- */
24
- export declare function getModelBoundMetadata(target: Function): ModelBoundMetadata | undefined;
25
- /**
26
- * Checks whether a class has been decorated with {@link modelBound}.
27
- * @param target - The class constructor to check.
28
- * @returns True if the class has a model-bound decorator; false otherwise.
29
- */
30
- export declare function isModelBound(target: Function): boolean;
31
- //# sourceMappingURL=modelBound.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modelBound.d.ts","sourceRoot":"","sources":["../../../Projections/modelBound/modelBound.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAM/C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,EAAE,YAAY,CAAC;IAE1B,uDAAuD;IACvD,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CAChD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EAAE,GAAE,MAAW,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,cAAc,CAYpF;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,GAAG,kBAAkB,GAAG,SAAS,CAEtF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAEtD"}
@@ -1,39 +0,0 @@
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
- import 'reflect-metadata';
4
- import { ProjectionId } from '../ProjectionId';
5
- import { DecoratorType, TypeDiscoverer } from '../../types';
6
- /** Metadata key used to store model-bound projection information on a class. */
7
- const MODEL_BOUND_METADATA_KEY = 'chronicle:modelBound';
8
- /**
9
- * TypeScript decorator that marks a class as a model-bound projection.
10
- * @param id - The unique identifier for the projection. Defaults to the class name if omitted.
11
- * @param eventSequenceId - Optional explicit event sequence identifier.
12
- * @returns A class decorator.
13
- */
14
- export function modelBound(id = '', eventSequenceId) {
15
- return (target) => {
16
- const constructor = target;
17
- const projectionId = new ProjectionId(id || constructor.name);
18
- const metadata = { id: projectionId, eventSequenceId };
19
- Reflect.defineMetadata(MODEL_BOUND_METADATA_KEY, metadata, target);
20
- TypeDiscoverer.default.register(DecoratorType.ModelBoundProjection, constructor, projectionId.value);
21
- };
22
- }
23
- /**
24
- * Gets the {@link ModelBoundMetadata} associated with a class decorated with {@link modelBound}.
25
- * @param target - The class constructor to retrieve metadata for.
26
- * @returns The associated metadata, or undefined if not decorated.
27
- */
28
- export function getModelBoundMetadata(target) {
29
- return Reflect.getMetadata(MODEL_BOUND_METADATA_KEY, target);
30
- }
31
- /**
32
- * Checks whether a class has been decorated with {@link modelBound}.
33
- * @param target - The class constructor to check.
34
- * @returns True if the class has a model-bound decorator; false otherwise.
35
- */
36
- export function isModelBound(target) {
37
- return Reflect.hasMetadata(MODEL_BOUND_METADATA_KEY, target);
38
- }
39
- //# sourceMappingURL=modelBound.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modelBound.js","sourceRoot":"","sources":["../../../Projections/modelBound/modelBound.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE5D,gFAAgF;AAChF,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAaxD;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa,EAAE,EAAE,eAAwB;IAChE,OAAO,CAAC,MAAc,EAAE,EAAE;QACtB,MAAM,WAAW,GAAG,MAAkB,CAAC;QACvC,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,EAAE,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9D,MAAM,QAAQ,GAAuB,EAAE,EAAE,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;QAC3E,OAAO,CAAC,cAAc,CAAC,wBAAwB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACnE,cAAc,CAAC,OAAO,CAAC,QAAQ,CAC3B,aAAa,CAAC,oBAAoB,EAClC,WAA0B,EAC1B,YAAY,CAAC,KAAK,CACrB,CAAC;IACN,CAAC,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAgB;IAClD,OAAO,OAAO,CAAC,WAAW,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,MAAgB;IACzC,OAAO,OAAO,CAAC,WAAW,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC"}