atomservices 0.10.0-alpha.9 → 0.12.0-alpha.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 (212) hide show
  1. package/package.json +16 -34
  2. package/src/IEvent.ts +33 -0
  3. package/src/index.ts +1 -0
  4. package/tsconfig.json +24 -0
  5. package/tsup.config.ts +9 -0
  6. package/LICENSE +0 -21
  7. package/README.md +0 -1
  8. package/RELEASES.md +0 -1
  9. package/lib/Commands/DispatchResult.js +0 -38
  10. package/lib/Commands/DispatchResult.js.map +0 -1
  11. package/lib/Commands/ICommandDispatcher.js +0 -3
  12. package/lib/Commands/ICommandDispatcher.js.map +0 -1
  13. package/lib/Commands/ICommandDispatchers.js +0 -3
  14. package/lib/Commands/ICommandDispatchers.js.map +0 -1
  15. package/lib/Commands/ICommandHandlers.js +0 -3
  16. package/lib/Commands/ICommandHandlers.js.map +0 -1
  17. package/lib/Commands/combineCommandDispatchers.js +0 -28
  18. package/lib/Commands/combineCommandDispatchers.js.map +0 -1
  19. package/lib/Commands/composeCommandHandlers.js +0 -31
  20. package/lib/Commands/composeCommandHandlers.js.map +0 -1
  21. package/lib/Commands/index.js +0 -9
  22. package/lib/Commands/index.js.map +0 -1
  23. package/lib/Containers/Enhancement.js +0 -3
  24. package/lib/Containers/Enhancement.js.map +0 -1
  25. package/lib/Containers/IManagedServiceContainerResult.js +0 -4
  26. package/lib/Containers/IManagedServiceContainerResult.js.map +0 -1
  27. package/lib/Containers/createContainer.js +0 -75
  28. package/lib/Containers/createContainer.js.map +0 -1
  29. package/lib/Containers/createContainerCompose.js +0 -11
  30. package/lib/Containers/createContainerCompose.js.map +0 -1
  31. package/lib/Containers/index.js +0 -7
  32. package/lib/Containers/index.js.map +0 -1
  33. package/lib/Context/Factories/ServiceConfigurateFactory.js +0 -25
  34. package/lib/Context/Factories/ServiceConfigurateFactory.js.map +0 -1
  35. package/lib/Context/Factories/ServiceIdentifierFactory.js +0 -16
  36. package/lib/Context/Factories/ServiceIdentifierFactory.js.map +0 -1
  37. package/lib/Context/Factories/index.js +0 -11
  38. package/lib/Context/Factories/index.js.map +0 -1
  39. package/lib/Context/index.js +0 -5
  40. package/lib/Context/index.js.map +0 -1
  41. package/lib/Events/IEventHandlers.js +0 -3
  42. package/lib/Events/IEventHandlers.js.map +0 -1
  43. package/lib/Events/composeEventHandlers.js +0 -31
  44. package/lib/Events/composeEventHandlers.js.map +0 -1
  45. package/lib/Events/index.js +0 -5
  46. package/lib/Events/index.js.map +0 -1
  47. package/lib/Exceptions/Constants.js +0 -28
  48. package/lib/Exceptions/Constants.js.map +0 -1
  49. package/lib/Exceptions/Core.js +0 -41
  50. package/lib/Exceptions/Core.js.map +0 -1
  51. package/lib/Exceptions/ExtendException.js +0 -15
  52. package/lib/Exceptions/ExtendException.js.map +0 -1
  53. package/lib/Exceptions/IExtendException.js +0 -3
  54. package/lib/Exceptions/IExtendException.js.map +0 -1
  55. package/lib/Exceptions/createException.js +0 -7
  56. package/lib/Exceptions/createException.js.map +0 -1
  57. package/lib/GlobalScope.js +0 -5
  58. package/lib/GlobalScope.js.map +0 -1
  59. package/lib/Identifiers/UUIDIdentifier.js +0 -10
  60. package/lib/Identifiers/UUIDIdentifier.js.map +0 -1
  61. package/lib/Identifiers/index.js +0 -5
  62. package/lib/Identifiers/index.js.map +0 -1
  63. package/lib/Notifiers/NotifyLog.js +0 -30
  64. package/lib/Notifiers/NotifyLog.js.map +0 -1
  65. package/lib/Notifiers/NotifyObject.js +0 -35
  66. package/lib/Notifiers/NotifyObject.js.map +0 -1
  67. package/lib/Notifiers/composeNotifiers.js +0 -36
  68. package/lib/Notifiers/composeNotifiers.js.map +0 -1
  69. package/lib/Notifiers/data/ContainersNotifyData.js +0 -10
  70. package/lib/Notifiers/data/ContainersNotifyData.js.map +0 -1
  71. package/lib/Notifiers/data/ServicesNotifyData.js +0 -18
  72. package/lib/Notifiers/data/ServicesNotifyData.js.map +0 -1
  73. package/lib/Notifiers/data/common/ContainersData.js +0 -9
  74. package/lib/Notifiers/data/common/ContainersData.js.map +0 -1
  75. package/lib/Notifiers/data/common/IConstantData.js +0 -3
  76. package/lib/Notifiers/data/common/IConstantData.js.map +0 -1
  77. package/lib/Notifiers/data/common/ServicesData.js +0 -17
  78. package/lib/Notifiers/data/common/ServicesData.js.map +0 -1
  79. package/lib/Notifiers/data/common/composeNotifyData.js +0 -15
  80. package/lib/Notifiers/data/common/composeNotifyData.js.map +0 -1
  81. package/lib/Notifiers/data/common/index.js +0 -9
  82. package/lib/Notifiers/data/common/index.js.map +0 -1
  83. package/lib/Notifiers/data/index.js +0 -7
  84. package/lib/Notifiers/data/index.js.map +0 -1
  85. package/lib/Notifiers/index.js +0 -13
  86. package/lib/Notifiers/index.js.map +0 -1
  87. package/lib/Reactions/IReactions.js +0 -3
  88. package/lib/Reactions/IReactions.js.map +0 -1
  89. package/lib/Reactions/composeReactions.js +0 -41
  90. package/lib/Reactions/composeReactions.js.map +0 -1
  91. package/lib/Reactions/index.js +0 -5
  92. package/lib/Reactions/index.js.map +0 -1
  93. package/lib/SFComponents/createSFComponents.js +0 -147
  94. package/lib/SFComponents/createSFComponents.js.map +0 -1
  95. package/lib/SFComponents/index.js +0 -5
  96. package/lib/SFComponents/index.js.map +0 -1
  97. package/lib/Services/core/MetadataRefiner.js +0 -31
  98. package/lib/Services/core/MetadataRefiner.js.map +0 -1
  99. package/lib/Services/core/composeEventProcess.js +0 -31
  100. package/lib/Services/core/composeEventProcess.js.map +0 -1
  101. package/lib/Services/core/composeEventReactions.js +0 -56
  102. package/lib/Services/core/composeEventReactions.js.map +0 -1
  103. package/lib/Services/core/composeEventResulting.js +0 -5
  104. package/lib/Services/core/composeEventResulting.js.map +0 -1
  105. package/lib/Services/core/composeServiceContext.js +0 -126
  106. package/lib/Services/core/composeServiceContext.js.map +0 -1
  107. package/lib/Services/core/connectStream/connectStream.js +0 -26
  108. package/lib/Services/core/connectStream/connectStream.js.map +0 -1
  109. package/lib/Services/core/connectStream/index.js +0 -5
  110. package/lib/Services/core/connectStream/index.js.map +0 -1
  111. package/lib/Services/core/connectStream/mapHandlersEvents.js +0 -9
  112. package/lib/Services/core/connectStream/mapHandlersEvents.js.map +0 -1
  113. package/lib/Services/core/connectStream/mapReactionsEvents.js +0 -5
  114. package/lib/Services/core/connectStream/mapReactionsEvents.js.map +0 -1
  115. package/lib/Services/core/createCommandDispatcher.js +0 -56
  116. package/lib/Services/core/createCommandDispatcher.js.map +0 -1
  117. package/lib/Services/core/index.js +0 -13
  118. package/lib/Services/core/index.js.map +0 -1
  119. package/lib/Services/core/operateEventProcess.js +0 -39
  120. package/lib/Services/core/operateEventProcess.js.map +0 -1
  121. package/lib/Services/createService.js +0 -111
  122. package/lib/Services/createService.js.map +0 -1
  123. package/lib/Services/index.js +0 -5
  124. package/lib/Services/index.js.map +0 -1
  125. package/lib/States/IStateHandlers.js +0 -3
  126. package/lib/States/IStateHandlers.js.map +0 -1
  127. package/lib/States/composeStateApplier.js +0 -14
  128. package/lib/States/composeStateApplier.js.map +0 -1
  129. package/lib/States/composeStateHandlers.js +0 -27
  130. package/lib/States/composeStateHandlers.js.map +0 -1
  131. package/lib/States/index.js +0 -7
  132. package/lib/States/index.js.map +0 -1
  133. package/lib/Streams/LocalDirectStream.js +0 -16
  134. package/lib/Streams/LocalDirectStream.js.map +0 -1
  135. package/lib/Streams/LocalEventStream.js +0 -47
  136. package/lib/Streams/LocalEventStream.js.map +0 -1
  137. package/lib/Streams/LocalInMemoryEventStream.js +0 -13
  138. package/lib/Streams/LocalInMemoryEventStream.js.map +0 -1
  139. package/lib/Streams/endpoints.js +0 -9
  140. package/lib/Streams/endpoints.js.map +0 -1
  141. package/lib/Streams/index.js +0 -7
  142. package/lib/Streams/index.js.map +0 -1
  143. package/lib/index.js +0 -18
  144. package/lib/index.js.map +0 -1
  145. package/typings/Commands/DispatchResult.d.ts +0 -16
  146. package/typings/Commands/ICommandDispatcher.d.ts +0 -6
  147. package/typings/Commands/ICommandDispatchers.d.ts +0 -4
  148. package/typings/Commands/ICommandHandlers.d.ts +0 -6
  149. package/typings/Commands/combineCommandDispatchers.d.ts +0 -3
  150. package/typings/Commands/composeCommandHandlers.d.ts +0 -3
  151. package/typings/Commands/index.d.ts +0 -6
  152. package/typings/Containers/Enhancement.d.ts +0 -3
  153. package/typings/Containers/IManagedServiceContainerResult.d.ts +0 -5
  154. package/typings/Containers/createContainer.d.ts +0 -4
  155. package/typings/Containers/createContainerCompose.d.ts +0 -5
  156. package/typings/Containers/index.d.ts +0 -3
  157. package/typings/Context/Factories/ServiceConfigurateFactory.d.ts +0 -4
  158. package/typings/Context/Factories/ServiceIdentifierFactory.d.ts +0 -4
  159. package/typings/Context/Factories/index.d.ts +0 -8
  160. package/typings/Context/index.d.ts +0 -1
  161. package/typings/Events/IEventHandlers.d.ts +0 -6
  162. package/typings/Events/composeEventHandlers.d.ts +0 -3
  163. package/typings/Events/index.d.ts +0 -2
  164. package/typings/Exceptions/Constants.d.ts +0 -58
  165. package/typings/Exceptions/Core.d.ts +0 -12
  166. package/typings/Exceptions/ExtendException.d.ts +0 -6
  167. package/typings/Exceptions/IExtendException.d.ts +0 -7
  168. package/typings/Exceptions/createException.d.ts +0 -5
  169. package/typings/GlobalScope.d.ts +0 -1
  170. package/typings/Identifiers/UUIDIdentifier.d.ts +0 -2
  171. package/typings/Identifiers/index.d.ts +0 -1
  172. package/typings/Notifiers/NotifyLog.d.ts +0 -14
  173. package/typings/Notifiers/NotifyObject.d.ts +0 -17
  174. package/typings/Notifiers/composeNotifiers.d.ts +0 -2
  175. package/typings/Notifiers/data/ContainersNotifyData.d.ts +0 -12
  176. package/typings/Notifiers/data/ServicesNotifyData.d.ts +0 -52
  177. package/typings/Notifiers/data/common/ContainersData.d.ts +0 -5
  178. package/typings/Notifiers/data/common/IConstantData.d.ts +0 -6
  179. package/typings/Notifiers/data/common/ServicesData.d.ts +0 -13
  180. package/typings/Notifiers/data/common/composeNotifyData.d.ts +0 -9
  181. package/typings/Notifiers/data/common/index.d.ts +0 -4
  182. package/typings/Notifiers/data/index.d.ts +0 -2
  183. package/typings/Notifiers/index.d.ts +0 -5
  184. package/typings/Reactions/IReactions.d.ts +0 -6
  185. package/typings/Reactions/composeReactions.d.ts +0 -3
  186. package/typings/Reactions/index.d.ts +0 -2
  187. package/typings/SFComponents/createSFComponents.d.ts +0 -22
  188. package/typings/SFComponents/index.d.ts +0 -1
  189. package/typings/Services/core/MetadataRefiner.d.ts +0 -13
  190. package/typings/Services/core/composeEventProcess.d.ts +0 -2
  191. package/typings/Services/core/composeEventReactions.d.ts +0 -2
  192. package/typings/Services/core/composeEventResulting.d.ts +0 -2
  193. package/typings/Services/core/composeServiceContext.d.ts +0 -5
  194. package/typings/Services/core/connectStream/connectStream.d.ts +0 -2
  195. package/typings/Services/core/connectStream/index.d.ts +0 -1
  196. package/typings/Services/core/connectStream/mapHandlersEvents.d.ts +0 -5
  197. package/typings/Services/core/connectStream/mapReactionsEvents.d.ts +0 -6
  198. package/typings/Services/core/createCommandDispatcher.d.ts +0 -3
  199. package/typings/Services/core/index.d.ts +0 -5
  200. package/typings/Services/core/operateEventProcess.d.ts +0 -5
  201. package/typings/Services/createService.d.ts +0 -2
  202. package/typings/Services/index.d.ts +0 -1
  203. package/typings/States/IStateHandlers.d.ts +0 -5
  204. package/typings/States/composeStateApplier.d.ts +0 -5
  205. package/typings/States/composeStateHandlers.d.ts +0 -3
  206. package/typings/States/index.d.ts +0 -3
  207. package/typings/Streams/LocalDirectStream.d.ts +0 -2
  208. package/typings/Streams/LocalEventStream.d.ts +0 -2
  209. package/typings/Streams/LocalInMemoryEventStream.d.ts +0 -2
  210. package/typings/Streams/endpoints.d.ts +0 -13
  211. package/typings/Streams/index.d.ts +0 -2
  212. package/typings/index.d.ts +0 -11
@@ -1,5 +0,0 @@
1
- export { ContainersNotifyData } from "./data/ContainersNotifyData";
2
- export { ServicesNotifyData } from "./data/ServicesNotifyData";
3
- export { composeNotifiers } from "./composeNotifiers";
4
- export { NotifyLog } from "./NotifyLog";
5
- export { NotifyObject } from "./NotifyObject";
@@ -1,6 +0,0 @@
1
- import { IEvent, IReaction } from "atomservicescore";
2
- export interface IReactions {
3
- type: () => string;
4
- resolve: (event: IEvent, scope: string) => IReaction[];
5
- forEach: (callback: (reaction: IReaction) => void) => number;
6
- }
@@ -1,3 +0,0 @@
1
- import { IReaction } from "atomservicescore";
2
- import { IReactions } from "./IReactions";
3
- export declare const composeReactions: (...reactions: IReaction[]) => (type: string) => IReactions;
@@ -1,2 +0,0 @@
1
- export { composeReactions } from "./composeReactions";
2
- export { IReactions } from "./IReactions";
@@ -1,22 +0,0 @@
1
- /// <reference types="node" />
2
- import { ICommand, IEvent, ISFComponents, IServiceIdentifier, IValidationResultType, EventHandler, EventProcessType, EventStream, EventVersioning } from "atomservicescore";
3
- export declare const createSFComponents: <Event_1 extends IEvent<any, any, any, any> = IEvent<any, any, any, any>, Command extends ICommand<any, any> = ICommand<Event_1["payloads"], Event_1["_createdBy"]>, ProcessResult = any>(structure: {
4
- configs?: {
5
- level?: "Public" | "Scope" | undefined;
6
- processType?: "asynchronous" | "synchronous" | undefined;
7
- versioning?: "none" | "static" | "dynamic" | undefined;
8
- } | undefined;
9
- event: {
10
- name: string;
11
- process?: EventHandler.EventProcessHandle<Event_1, ProcessResult> | undefined;
12
- processEffect?: EventHandler.EventProcessEffectHandle<Event_1, ProcessResult> | undefined;
13
- };
14
- command?: {
15
- name?: string | undefined;
16
- validate?: ((command: Command) => IValidationResultType) | undefined;
17
- transform?: ((command: Command, identifier: IServiceIdentifier<Event_1["aggregateID"], Event_1["_id"]>) => Event_1) | undefined;
18
- } | undefined;
19
- state?: {
20
- apply?: ((event: Event_1) => Promise<void>) | undefined;
21
- } | undefined;
22
- }) => ISFComponents<Event_1, Command, any>;
@@ -1 +0,0 @@
1
- export { createSFComponents } from "./createSFComponents";
@@ -1,13 +0,0 @@
1
- import { EventStream } from "atomservicescore";
2
- export declare const MetadataRefiner: {
3
- consume: (metadata: EventStream.IStreamMetadata) => EventStream.IStreamMetadata & {
4
- __: any;
5
- };
6
- dispatch: (metadata: EventStream.IStreamMetadata) => EventStream.IStreamMetadata & {
7
- __: {
8
- dispatch: {
9
- time: number;
10
- };
11
- };
12
- };
13
- };
@@ -1,2 +0,0 @@
1
- import { EventStream, IServiceDefinition } from "atomservicescore";
2
- export declare const composeEventProcess: (definition: IServiceDefinition) => EventStream.StreamProcessing;
@@ -1,2 +0,0 @@
1
- import { EventStream, IServiceDefinition } from "atomservicescore";
2
- export declare const composeEventReactions: (definition: IServiceDefinition) => EventStream.IReactStreamProcesses;
@@ -1,2 +0,0 @@
1
- import { IEvent, IServiceContext } from "atomservicescore";
2
- export declare const composeEventResulting: (ServiceContext: IServiceContext, event: IEvent) => (result: any) => Promise<void>;
@@ -1,5 +0,0 @@
1
- import { IEvent, IServiceContext, IServiceDefinition } from "atomservicescore";
2
- export declare const isEventVersionDefined: (event: IEvent) => boolean | 0 | undefined;
3
- export declare const composeServiceContext: (definition: IServiceDefinition) => (options?: {
4
- isReplay?: boolean;
5
- }) => IServiceContext;
@@ -1,2 +0,0 @@
1
- import { IServiceDefinition } from "atomservicescore";
2
- export declare const connectStream: (definition: IServiceDefinition) => Promise<void>;
@@ -1 +0,0 @@
1
- export { connectStream } from "./connectStream";
@@ -1,5 +0,0 @@
1
- import { EventStream, IServiceDefinition } from "atomservicescore";
2
- export declare const mapHandlersEvents: (definition: IServiceDefinition) => {
3
- name: string;
4
- level: EventStream.StreamLevel;
5
- }[];
@@ -1,6 +0,0 @@
1
- import { IServiceDefinition } from "atomservicescore";
2
- export declare const mapReactionsEvents: (definition: IServiceDefinition) => {
3
- scope: string;
4
- type: string;
5
- name: string;
6
- }[];
@@ -1,3 +0,0 @@
1
- import { IServiceDefinition } from "atomservicescore";
2
- import { ICommandDispatcher } from "../../Commands/ICommandDispatcher";
3
- export declare const createCommandDispatcher: (definition: IServiceDefinition) => ICommandDispatcher;
@@ -1,5 +0,0 @@
1
- export { connectStream } from "./connectStream";
2
- export { composeEventProcess } from "./composeEventProcess";
3
- export { composeEventReactions } from "./composeEventReactions";
4
- export { composeEventResulting } from "./composeEventResulting";
5
- export { composeServiceContext } from "./composeServiceContext";
@@ -1,5 +0,0 @@
1
- import { EventStream, IEvent, IEventHandler, INotifiers, IServiceContext, IStateApplier } from "atomservicescore";
2
- export declare const operateEventProcess: (EventHandler: IEventHandler, StateApplier: IStateApplier, ServiceContext: IServiceContext, resulting: (result: any) => Promise<void>, Notifiers: INotifiers) => (service: {
3
- scope: string;
4
- type: string;
5
- }, event: IEvent, metadata: EventStream.IStreamMetadata) => Promise<void>;
@@ -1,2 +0,0 @@
1
- import { IManagedService, IService, IServicesContainer } from "atomservicescore";
2
- export declare const createService: (service: IService, container?: IServicesContainer | undefined) => IManagedService;
@@ -1 +0,0 @@
1
- export { createService } from "./createService";
@@ -1,5 +0,0 @@
1
- import { IEvent } from "atomservicescore";
2
- export interface IStateHandlers {
3
- type: () => string;
4
- apply: (events: IEvent) => Promise<void>;
5
- }
@@ -1,5 +0,0 @@
1
- import { IStateApplier } from "atomservicescore";
2
- import { IStateHandlers } from "./IStateHandlers";
3
- export declare const composeStateApplier: (props: {
4
- StateHandlers: IStateHandlers;
5
- }) => IStateApplier<import("atomservicescore").IEvent<any, any, any, any>>;
@@ -1,3 +0,0 @@
1
- import { IStateHandler } from "atomservicescore";
2
- import { IStateHandlers } from "./IStateHandlers";
3
- export declare const composeStateHandlers: (...stateHandlers: IStateHandler[]) => (type: string) => IStateHandlers;
@@ -1,3 +0,0 @@
1
- export { composeStateApplier } from "./composeStateApplier";
2
- export { composeStateHandlers } from "./composeStateHandlers";
3
- export { IStateHandlers } from "./IStateHandlers";
@@ -1,2 +0,0 @@
1
- import { EventStream } from "atomservicescore";
2
- export declare const LocalDirectStream: EventStream.IEventDirecting;
@@ -1,2 +0,0 @@
1
- import { EventStream } from "atomservicescore";
2
- export declare const LocalEventStream: EventStream.IEventPublishing & EventStream.IEventSubscribing;
@@ -1,2 +0,0 @@
1
- import { IEventStream } from "atomservicescore";
2
- export declare const LocalInMemoryEventStream: IEventStream;
@@ -1,13 +0,0 @@
1
- import { EventStream } from "atomservicescore";
2
- export declare const endpoints: {
3
- toExchange: (on: {
4
- type: string;
5
- scope: string;
6
- level: EventStream.StreamLevel;
7
- }) => string;
8
- toQueue: (to: {
9
- type: string;
10
- scope: string;
11
- channel: EventStream.EventChannel;
12
- }) => string;
13
- };
@@ -1,2 +0,0 @@
1
- export { LocalDirectStream } from "./LocalDirectStream";
2
- export { LocalInMemoryEventStream } from "./LocalInMemoryEventStream";
@@ -1,11 +0,0 @@
1
- export * as Commands from "./Commands";
2
- export * as Containers from "./Containers";
3
- export * as Context from "./Context";
4
- export * as Events from "./Events";
5
- export * as Identifiers from "./Identifiers";
6
- export * as Reactions from "./Reactions";
7
- export * as SFComponents from "./SFComponents";
8
- export * as Services from "./Services";
9
- export * as States from "./States";
10
- export { GlobalScope } from "./GlobalScope";
11
- export { DispatchFunc, DispatchResult, EventStream, IAtomCommand, IAtomEvent, IAtomState, ICommand, ICommandHandler, IEvent, IEventHandler, IReaction, IEventStores, IEventStream, IIdentifier, IManagedService, IManagedServiceContainer, INotifier, INotifyLog, INotifyObject, ISFComponents, IService, IServicesContainer, IServiceConfigs, IServiceConfigurate, IServiceContext, IServiceDefinition, IServiceIdentifier, IServiceStreamDefinition, IState, IStateApplier, IStateHandler, IValidationResultType, } from "atomservicescore";