@wirestate/core 0.6.0 → 0.6.3

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 (78) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +173 -230
  3. package/cjs/development/index.js +1 -1
  4. package/cjs/development/index.js.map +1 -1
  5. package/cjs/development/lib.js +9 -9
  6. package/cjs/development/lib.js.map +1 -1
  7. package/cjs/development/test-utils.js.map +1 -1
  8. package/cjs/production/index.js.map +1 -1
  9. package/cjs/production/lib.js.map +1 -1
  10. package/cjs/production/test-utils.js.map +1 -1
  11. package/esm/development/bind/bind-constant.js.map +1 -1
  12. package/esm/development/bind/bind-dynamic-value.js.map +1 -1
  13. package/esm/development/bind/bind-entry.js.map +1 -1
  14. package/esm/development/bind/bind-service.js.map +1 -1
  15. package/esm/development/bind/get-entry-token.js.map +1 -1
  16. package/esm/development/commands/command-bus.js +4 -4
  17. package/esm/development/commands/command-bus.js.map +1 -1
  18. package/esm/development/commands/command-optional.js.map +1 -1
  19. package/esm/development/commands/command.js.map +1 -1
  20. package/esm/development/commands/get-command-handler-metadata.js.map +1 -1
  21. package/esm/development/commands/on-command.js.map +1 -1
  22. package/esm/development/container/create-ioc-container.js +1 -1
  23. package/esm/development/container/create-ioc-container.js.map +1 -1
  24. package/esm/development/container/wire-scope.js.map +1 -1
  25. package/esm/development/events/build-event-dispatcher.js.map +1 -1
  26. package/esm/development/events/emit-event.js.map +1 -1
  27. package/esm/development/events/event-bus.js.map +1 -1
  28. package/esm/development/events/get-event-handler-metadata.js.map +1 -1
  29. package/esm/development/events/on-event.js.map +1 -1
  30. package/esm/development/index.js +1 -1
  31. package/esm/development/queries/get-query-handler-metadata.js.map +1 -1
  32. package/esm/development/queries/on-query.js.map +1 -1
  33. package/esm/development/queries/query-bus.js.map +1 -1
  34. package/esm/development/queries/query-optional.js.map +1 -1
  35. package/esm/development/queries/query.js.map +1 -1
  36. package/esm/development/registry.js.map +1 -1
  37. package/esm/development/seeds/apply-seeds.js.map +1 -1
  38. package/esm/development/seeds/apply-shared-seed.js.map +1 -1
  39. package/esm/development/seeds/unapply-seeds.js.map +1 -1
  40. package/esm/development/test-utils/mock-bind-entry.js.map +1 -1
  41. package/esm/development/test-utils/mock-bind-service.js.map +1 -1
  42. package/esm/development/test-utils/mock-container.js.map +1 -1
  43. package/esm/development/test-utils/mock-service.js.map +1 -1
  44. package/esm/development/types/commands.js +7 -7
  45. package/esm/development/types/commands.js.map +1 -1
  46. package/esm/production/bind/bind-entry.js.map +1 -1
  47. package/esm/production/bind/bind-service.js.map +1 -1
  48. package/esm/production/commands/command-bus.js +1 -1
  49. package/esm/production/commands/command-bus.js.map +1 -1
  50. package/esm/production/commands/command-optional.js.map +1 -1
  51. package/esm/production/commands/command.js.map +1 -1
  52. package/esm/production/commands/get-command-handler-metadata.js.map +1 -1
  53. package/esm/production/commands/on-command.js.map +1 -1
  54. package/esm/production/container/create-ioc-container.js +1 -1
  55. package/esm/production/container/create-ioc-container.js.map +1 -1
  56. package/esm/production/container/wire-scope.js.map +1 -1
  57. package/esm/production/events/build-event-dispatcher.js.map +1 -1
  58. package/esm/production/events/emit-event.js.map +1 -1
  59. package/esm/production/events/event-bus.js.map +1 -1
  60. package/esm/production/events/get-event-handler-metadata.js.map +1 -1
  61. package/esm/production/events/on-event.js.map +1 -1
  62. package/esm/production/index.js +1 -1
  63. package/esm/production/queries/get-query-handler-metadata.js.map +1 -1
  64. package/esm/production/queries/on-query.js.map +1 -1
  65. package/esm/production/queries/query-bus.js.map +1 -1
  66. package/esm/production/queries/query-optional.js.map +1 -1
  67. package/esm/production/queries/query.js.map +1 -1
  68. package/esm/production/registry.js.map +1 -1
  69. package/esm/production/seeds/apply-seeds.js.map +1 -1
  70. package/esm/production/seeds/apply-shared-seed.js.map +1 -1
  71. package/esm/production/seeds/unapply-seeds.js.map +1 -1
  72. package/esm/production/test-utils/mock-container.js.map +1 -1
  73. package/esm/production/types/commands.js +1 -1
  74. package/esm/production/types/commands.js.map +1 -1
  75. package/index.d.ts +56 -88
  76. package/lib.d.ts +6 -6
  77. package/package.json +1 -1
  78. package/test-utils.d.ts +10 -10
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## 0.6.3
2
+
3
+ - Update readme files for each module
4
+
5
+ ## 0.6.2
6
+
7
+ - Corrected build system, react package structure
8
+
9
+ ## 0.6.1
10
+
11
+ - React related types moved to react lib
12
+ - Avoid prefixed I/T types
13
+
1
14
  ## 0.6.0
2
15
 
3
16
  - Split wirestate as separate @wirestate packages
package/README.md CHANGED
@@ -1,317 +1,260 @@
1
- # <a href='https://www.npmjs.com/package/wirestate'> ⚡ wirestate </a>
1
+ # @wirestate/core
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/wirestate.svg?style=flat-square)](https://www.npmjs.com/package/wirestate)
4
- [![language-ts](https://img.shields.io/badge/language-typescript-blue.svg?style=flat)](https://github.com/Neloreck/wirestate/search?l=typescript)
3
+ [![npm](https://img.shields.io/npm/v/@wirestate/core.svg?style=flat-square)](https://www.npmjs.com/package/@wirestate/core)
5
4
  [![license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/Neloreck/wirestate/blob/master/LICENSE)
6
5
 
7
- `wirestate` is a reactivity-independent state management framework for React. It integrates **InversifyJS** for robust Dependency Injection,
8
- providing IOC/DI/indirection based architecture based on concepts of Services, Events, Commands, and Queries.
6
+ Core package for wirestate.
7
+ Provides the DI container, service primitives, and event/command/query buses.
8
+ React integration is in [`@wirestate/react`](https://www.npmjs.com/package/@wirestate/react).
9
9
 
10
- It optionally works with **MobX**, **Signals**, or other custom reactivity implementations.
10
+ ## Installation
11
11
 
12
- ## Architecture & Core Concepts
12
+ ```bash
13
+ npm install @wirestate/core reflect-metadata
14
+ ```
13
15
 
14
- Designed for complex applications, `wirestate` enforces a clear separation of concerns:
16
+ Import `reflect-metadata` once at your application entry point, before any wirestate imports:
15
17
 
16
- - **Services**: Singleton-scoped logic units that hold state and business logic.
17
- - **Dependency Injection**: First-class InversifyJS integration for decoupled, testable code.
18
- - **Reactivity**: Independent state tracking (optional integration with MobX, Signals, etc.).
19
- - **Events**: Fire-and-forget communication for cross-service side effects.
20
- - **Commands**: Encapsulated write operations with standardized execution status (pending, settled, error).
21
- - **Queries**: Synchronous or asynchronous request-response patterns for data retrieval.
22
- - **Lifecycle Management**: Automated services provision within react tree, activation/deactivation lifecycle.
18
+ ```ts
19
+ import 'reflect-metadata';
20
+ ```
23
21
 
24
- ## Requirements
22
+ ## Services
25
23
 
26
- - `react >= 16.8.0`
27
- - `reflect-metadata` (must be imported at application entry)
24
+ Services are plain classes decorated with `@Injectable`. Each service may inject a `WireScope` which provides access to the event, command, and query buses and to other services in the container.
28
25
 
29
- ## Installation
26
+ ```ts
27
+ import { Injectable, Inject, WireScope } from '@wirestate/core';
30
28
 
31
- ```bash
32
- npm install --save @wirestate/core reflect-metadata
33
- ```
29
+ @Injectable()
30
+ export class CounterService {
31
+ public count = 0;
34
32
 
35
- ### For react-mobx
33
+ public constructor(
34
+ @Inject(WireScope) private scope: WireScope
35
+ ) {}
36
36
 
37
- ```bash
38
- npm install --save @wirestate/react @wirestate/react-mobx mobx mobx-react-lite
37
+ public increment(): void {
38
+ this.count++;
39
+ }
40
+ }
39
41
  ```
40
42
 
41
- ### For signals
43
+ ## Container
42
44
 
43
- ```bash
44
- npm install --save @wirestate/react @wirestate/react-signals @preact/signals-react
45
- npm install --save-dev @preact/signals-react-transform
46
- ```
47
-
48
- ## Quick Start with mobx
45
+ ```ts
46
+ import { createIocContainer, bindService } from '@wirestate/core';
49
47
 
50
- ### 1. Define a Service
48
+ const container = createIocContainer();
51
49
 
52
- Services are standard classes decorated with `@Injectable`. Use `WireScope` to interact with the framework.
50
+ bindService(container, CounterService);
53
51
 
54
- ```typescript
55
- import { Injectable, Inject, WireScope, OnEvent, OnCommand, OnQuery } from '@wirestate/core';
56
- import { makeObservable, Observable, Action } from '@wirestate/react-mobx';
52
+ const service = container.get(CounterService);
53
+ ```
57
54
 
58
- @Injectable()
59
- export class CounterService {
60
- @Observable()
61
- public count: number = 0;
55
+ `bindService` binds a class in singleton scope by default.
56
+ Use `bindConstant` to bind a value, `bindEntry` to bind under a custom token.
62
57
 
63
- public constructor(
64
- @Inject(WireScope)
65
- private scope: WireScope
66
- ) {
67
- makeObservable(this);
68
- }
58
+ ## Events
69
59
 
70
- @Action()
71
- public increment(amount: number = 1): void {
72
- this.count += amount;
73
- }
60
+ Events are fire-and-forget messages. Any service can emit or subscribe.
74
61
 
75
- @Action()
76
- public reset(): void {
77
- this.count = 0;
78
- }
62
+ ```ts
63
+ import { OnEvent, WireScope, Inject } from '@wirestate/core';
79
64
 
80
- @OnCommand('INCREMENT')
81
- public onIncrementCommand(amount: number = 1): void {
82
- this.increment(amount);
83
- }
65
+ @Injectable()
66
+ export class SenderService {
67
+ public constructor(@Inject(WireScope) private scope: WireScope) {}
84
68
 
85
- @OnQuery('GET_TOTAL')
86
- public onGetTotal(): number {
87
- return this.count;
69
+ public notify(): void {
70
+ this.scope.emitEvent('USER_LOGGED_OUT');
88
71
  }
72
+ }
89
73
 
90
- @OnEvent('RESET')
91
- public onResetEvent(): void {
92
- this.reset();
74
+ @Injectable()
75
+ export class ReceiverService {
76
+ @OnEvent('USER_LOGGED_OUT')
77
+ public onLogout(): void {
78
+ // handle logout
93
79
  }
94
80
  }
95
81
  ```
96
82
 
97
- ### 2. Configure the Provider
83
+ `@OnEvent()` with no argument subscribes to all events.
98
84
 
99
- Bind services at any level of the component tree.
100
- Lifetimes are managed automatically.
85
+ ## Commands
101
86
 
102
- ```tsx
103
- import { IocProvider, createInjectablesProvider } from '@wirestate/react';
104
- import { CounterService } from './CounterService';
87
+ Commands are write operations dispatched by token. A single handler is expected per command type.
105
88
 
106
- const MainProvider = createInjectablesProvider([CounterService]);
89
+ ```ts
90
+ import { OnCommand, WireScope, Inject } from '@wirestate/core';
107
91
 
108
- export function Application() {
109
- return (
110
- <IocProvider>
111
- <MainProvider>
112
- <CounterView />
113
- </MainProvider>
114
- </IocProvider>
115
- );
92
+ @Injectable()
93
+ export class AuthService {
94
+ @OnCommand('LOGIN')
95
+ public async onLogin(payload: { username: string }): Promise<void> {
96
+ // perform login
97
+ }
116
98
  }
117
- ```
118
99
 
119
- ### 3. Consume in Components
120
-
121
- Directly use services and rely on mobx reactivity.
122
- Or use specialized hooks for communication without direct references.
123
-
124
- ```tsx
125
- import { useInjection, useCommandCaller, useEventEmitter } from '@wirestate/react';
126
- import { observer } from '@wirestate/react-mobx';
127
- import { CounterService } from './CounterService';
128
-
129
- export const CounterView = observer(() => {
130
- const service = useInjection(CounterService);
131
- const call = useCommandCaller();
132
- const emit = useEventEmitter();
133
-
134
- return (
135
- <div>
136
- <p>Count: {service.count}</p>
137
- <button onClick={() => service.increment(5)}>Add 1 (Method)</button>
138
- <button onClick={() => call('INCREMENT', 5)}>Add 5 (Command)</button>
139
- <button onClick={() => service.reset()}>Reset (Method)</button>
140
- <button onClick={() => emit('RESET')}>Reset (Event)</button>
141
- </div>
142
- );
143
- });
100
+ @Injectable()
101
+ export class AnotherService {
102
+ public constructor(@Inject(WireScope) private scope: WireScope) {}
103
+
104
+ public async login(): Promise<void> {
105
+ await this.scope.executeCommand('LOGIN').task;
106
+ }
107
+ }
144
108
  ```
145
109
 
146
- ## Quick Start with signals
110
+ Use `commandOptional` when a handler may not be registered — returns `null` instead of throwing.
147
111
 
148
- ### 1. Define a Service
112
+ ## Queries
149
113
 
150
- Services use `signal` and `computed` for state management.
114
+ Queries are request-response operations. A single handler is expected per query type.
151
115
 
152
- ```typescript
153
- import { Injectable, Inject, WireScope, OnEvent, OnCommand, OnQuery } from '@wirestate/core';
154
- import { signal, computed, Signal, ReadonlySignal } from '@wirestate/react-signals';
116
+ ```ts
117
+ import { OnQuery, WireScope, Inject } from '@wirestate/core';
155
118
 
156
119
  @Injectable()
157
- export class CounterService {
158
- public readonly count: Signal<number> = signal(0);
159
- public readonly isEven: ReadonlySignal<boolean> = computed(() => this.count.value % 2 === 0);
120
+ export class StoreService {
121
+ private items: Array<string> = [];
160
122
 
161
- public constructor(
162
- @Inject(WireScope)
163
- private scope: WireScope
164
- ) {}
165
-
166
- public increment(amount: number = 1): void {
167
- this.count.value += amount;
123
+ @OnQuery('STORE_ITEMS')
124
+ public onGetItems(): Array<string> {
125
+ return this.items;
168
126
  }
127
+ }
169
128
 
170
- public reset(): void {
171
- this.count.value = 0;
172
- }
129
+ @Injectable()
130
+ export class AnotherService {
131
+ public constructor(@Inject(WireScope) private scope: WireScope) {}
173
132
 
174
- @OnCommand('INCREMENT')
175
- public onIncrementCommand(amount: number = 1): void {
176
- this.increment(amount);
133
+ public async someActionRequiringItems(): Promise<void> {
134
+ const asyncItems: Array<string> = await this.scope.queryData('STORE_ITEMS');
135
+ const syncItems: Array<string> = await this.scope.queryData('STORE_ITEMS');
177
136
  }
137
+ }
138
+ ```
178
139
 
179
- @OnQuery('GET_TOTAL')
180
- public onGetTotal(): number {
181
- return this.count.value;
182
- }
140
+ ## Seeds
141
+
142
+ Seeds pass initial data to services when they are activated.
143
+
144
+ ```ts
145
+ import { SEED, Injectable, Inject } from '@wirestate/core';
183
146
 
184
- @OnEvent('RESET')
185
- public onResetEvent(): void {
186
- this.reset();
147
+ // Shared seed — same object injected into all services in the tree:
148
+ @Injectable()
149
+ export class MyService {
150
+ public constructor(@Inject(SEED) private seed: { theme: string }) {}
151
+ }
152
+
153
+ // Per-service seed — each service gets its own seed value:
154
+ @Injectable()
155
+ export class OtherService {
156
+ public constructor(@Inject(WireScope) scope: WireScope) {
157
+ const { count } = scope.getSeed(OtherService) as { count: number };
187
158
  }
188
159
  }
189
160
  ```
190
161
 
191
- ### 2. Configure the Provider
162
+ Seeds are applied via `applySeeds` / `applySharedSeed` and removed via `unapplySeeds`.
163
+ In React, pass them as `seed` or `seeds` props to the provider — see `@wirestate/react`.
192
164
 
193
- The provider configuration remains the same regardless of the reactivity implementation.
165
+ ## Lifecycle
194
166
 
195
- ```tsx
196
- import { IocProvider, createInjectablesProvider } from '@wirestate/react';
197
- import { CounterService } from './CounterService';
167
+ ```ts
168
+ import { OnActivated, OnDeactivation } from '@wirestate/core';
198
169
 
199
- const MainProvider = createInjectablesProvider([CounterService]);
170
+ @Injectable()
171
+ export class PollingService {
172
+ private timer?: ReturnType<typeof setInterval>;
200
173
 
201
- export function Application() {
202
- return (
203
- <IocProvider>
204
- <MainProvider>
205
- <CounterView />
206
- </MainProvider>
207
- </IocProvider>
208
- );
209
- }
210
- ```
174
+ @OnActivated()
175
+ public onActivated(): void {
176
+ this.timer = setInterval(() => console.info('interval execution'), 5000);
177
+ }
211
178
 
212
- ### 3. Consume in Components
213
-
214
- Access signals directly in components. Reactivity is handled by the signals transform or manual subscription.
215
-
216
- ```tsx
217
- import { useInjection, useCommandCaller, useEventEmitter } from '@wirestate/react';
218
- import { CounterService } from './CounterService';
219
-
220
- export function CounterView() {
221
- const service = useInjection(CounterService);
222
- const call = useCommandCaller();
223
- const emit = useEventEmitter();
224
-
225
- return (
226
- <div>
227
- <p>Count: {service.count}</p>
228
- <p>Even: {service.isEven.value ? 'Yes' : 'No'}</p>
229
- <button onClick={() => service.increment(5)}>Add 1 (Method)</button>
230
- <button onClick={() => call('INCREMENT', 5)}>Add 5 (Command)</button>
231
- <button onClick={() => service.reset()}>Reset (Method)</button>
232
- <button onClick={() => emit('RESET')}>Reset (Event)</button>
233
- </div>
234
- );
179
+ @OnDeactivation()
180
+ public onDeactivation(): void {
181
+ clearInterval(this.timer);
182
+ }
235
183
  }
236
184
  ```
237
185
 
238
- ## Advanced Usage
239
-
240
- ### Seeding Shared Initial State
186
+ `@OnActivated` runs after the service is bound and all dependencies are resolved.
187
+ `@OnDeactivation` runs when the container scope is disposed.
241
188
 
242
- `wirestate` supports providing initial data (seeds) to services during activation.
189
+ ## WireScope API
243
190
 
244
- ```tsx
245
- const MainProvider = createInjectablesProvider([CounterService]);
191
+ `WireScope` is injected per-service and exposes:
246
192
 
247
- <IocProvider>
248
- <MainProvider seed={{ initialCount: 100 }}>
249
- <CounterView />
250
- </MainProvider>
251
- </IocProvider>
252
- ```
193
+ | Method | Description |
194
+ |---|---|
195
+ | `getContainer()` | Access the raw IoC container |
196
+ | `resolve(token)` | Resolve a service or value by token |
197
+ | `getSeed(token)` | Get the per-service seed for a given token |
198
+ | `emitEvent(type, payload?)` | Emit an event |
199
+ | `command(type)` | Get a caller for a command |
200
+ | `query(type)` | Get a caller for a query |
253
201
 
254
- In the service:
202
+ ## Test utilities
255
203
 
256
- ```typescript
257
- import { Injectable, Inject, SEED } from 'wirestate';
204
+ Available via `@wirestate/core/test-utils`:
258
205
 
259
- @Injectable()
260
- export class CounterService {
261
- // ...
262
- public constructor(
263
- @Inject(SEED)
264
- initialState: { initialCount: number }
265
- ) {
266
- this.count = seed.initialCount;
267
- }
268
- }
206
+ ```ts
207
+ import {
208
+ mockContainer,
209
+ mockService,
210
+ mockBindService,
211
+ mockBindEntry,
212
+ mockUnbindService,
213
+ } from '@wirestate/core/test-utils';
269
214
  ```
270
215
 
271
- ### Seeding Bound Initial State
216
+ ### `mockContainer(options?)`
272
217
 
273
- `wirestate` supports providing initial data (seeds) to services during activation.
218
+ Creates a configured IoC container for testing. Accepts an optional object:
274
219
 
275
- ```tsx
276
- const MainProvider = createInjectablesProvider([CounterService]);
220
+ | Option | Type | Description |
221
+ |---|---|---|
222
+ | `entries` | `Array<Newable \| InjectableDescriptor>` | Services or descriptors to bind |
223
+ | `activate` | `Array<ServiceIdentifier>` | Tokens to resolve immediately after binding |
224
+ | `skipLifecycle` | `boolean` | Skip `@OnActivated` / `@OnDeactivation` hooks |
277
225
 
278
- <IocProvider>
279
- <MainProvider seeds={[[CounterService, { count: 10 }]]}>
280
- <CounterView />
281
- </MainProvider>
282
- </IocProvider>
226
+ ```ts
227
+ const container = mockContainer({
228
+ entries: [CounterService, LoggerService],
229
+ activate: [CounterService],
230
+ });
283
231
  ```
284
232
 
285
- In the service:
233
+ ### `mockService(ServiceClass, container?, options?)`
286
234
 
287
- ```typescript
288
- import { Injectable, Inject, WireScope } from 'wirestate';
235
+ Binds a service class to a container and returns its instance. Creates a new `mockContainer` if none is provided.
289
236
 
290
- @Injectable()
291
- export class CounterService {
292
- // ...
293
- public constructor(@Inject(WireScope) scope: WireScope) {
294
- this.count = scope.getSeed(CounterService).count;
295
- }
296
- }
237
+ ```ts
238
+ const counter = mockService(CounterService);
239
+ counter.increment();
240
+ expect(counter.count).toBe(1);
297
241
  ```
298
242
 
299
- ### Service Lifecycle
243
+ ### `mockBindService(container, ServiceClass, options?)`
300
244
 
301
- Use decorators to handle initialization and cleanup.
245
+ Binds a service class to an existing container. Accepts `{ skipLifecycle?: boolean }`.
302
246
 
303
- ```typescript
304
- import { OnActivated, OnDeactivation } from 'wirestate';
247
+ ### `mockBindEntry(container, entry, options?)`
305
248
 
306
- @OnActivated()
307
- public onActivated(): void {
308
- // Start polling, fetch initial data, etc.
309
- }
249
+ Binds a service class or `InjectableDescriptor` to an existing container. Accepts `{ skipLifecycle?: boolean }`.
310
250
 
311
- @OnDeactivation()
312
- public onDeactivation(): void {
313
- // Cleanup subscriptions
314
- }
251
+ ### `mockUnbindService(container, ServiceClass)`
252
+
253
+ Removes a service binding from the container. Useful for overriding registrations between tests.
254
+
255
+ ```ts
256
+ mockUnbindService(container, CounterService);
257
+ mockBindEntry(container, { token: CounterService, useValue: fakeCounter });
315
258
  ```
316
259
 
317
260
  ## License
@@ -271,7 +271,7 @@ Object.defineProperty(exports, "Tagged", {
271
271
  exports.CommandBus = createIocContainer.CommandBus;
272
272
  Object.defineProperty(exports, "CommandStatus", {
273
273
  enumerable: true,
274
- get: function () { return createIocContainer.ECommandStatus; }
274
+ get: function () { return createIocContainer.CommandStatus; }
275
275
  });
276
276
  exports.EventBus = createIocContainer.EventBus;
277
277
  exports.QueryBus = createIocContainer.QueryBus;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../src/wirestate-core/alias.ts","../../../../../../../src/wirestate-core/commands/command.ts","../../../../../../../src/wirestate-core/commands/command-optional.ts","../../../../../../../src/wirestate-core/commands/on-command.ts","../../../../../../../src/wirestate-core/events/emit-event.ts","../../../../../../../src/wirestate-core/events/on-event.ts","../../../../../../../src/wirestate-core/queries/query.ts","../../../../../../../src/wirestate-core/queries/query-optional.ts","../../../../../../../src/wirestate-core/queries/on-query.ts","../../../../../../../src/wirestate-core/seeds/apply-seeds.ts","../../../../../../../src/wirestate-core/seeds/apply-shared-seed.ts","../../../../../../../src/wirestate-core/seeds/unapply-seeds.ts","../../../../../../../src/wirestate-core/service/on-activated.ts","../../../../../../../src/wirestate-core/service/on-deactivation.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["forwardRef","forward","LazyServiceIdentifier","command","container","type","data","get","CommandBus","commandOptional","OnCommand","target","propertyKey","constructor","list","COMMAND_HANDLER_METADATA","set","push","methodName","emitEvent","payload","from","EventBus","emit","OnEvent","types","normalized","undefined","Array","isArray","__spreadArray","EVENT_HANDLER_METADATA","query","QueryBus","queryOptional","OnQuery","QUERY_HANDLER_METADATA","applySeeds","seeds","existing","SEEDS_TOKEN","_i","seeds_1","_a","key","state","applySharedSeed","seed","rebind","SEED_TOKEN","toConstantValue","unapplySeeds","delete","OnActivated","ACTIVATED_HANDLER_METADATA","OnDeactivation","DEACTIVATION_HANDLER_METADATA"],"mappings":";;;;;;AAoBM,SAAUA,UAAUA,CACxBC,OAA2C,EAAA;AAE3C,EAAA,OAAO,IAAIC,+BAAqB,CAACD,OAAO,CAAC;AAC3C;;AChBA;;;;;;;AAOG;SACaE,OAAOA,CACrBC,SAAoB,EACpBC,IAAO,EACPC,IAAQ,EAAA;AAIR,EAAA,OAAOF,SAAS,CAACG,GAAG,CAACC,6BAAU,CAAC,CAACL,OAAO,CAAOE,IAAI,EAAEC,IAAI,CAAC;AAC5D;;ACfA;;;;;;;AAOG;SACaG,eAAeA,CAC7BL,SAAoB,EACpBC,IA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B,CAACE,WAAW;AAElD,IAAA,IAAIC,IAAI,GAAkCwC,6CAA0B,CAAC/C,GAAG,CAACM,WAAW,CAAC;IAErF,IAAI,CAACC,IAAI,EAAE;AACTA,MAAAA,IAAI,GAAG,EAAE;AACTwC,MAAAA,6CAA0B,CAACtC,GAAG,CAACH,WAAW,EAAEC,IAAI,CAAC;AACnD,IAAA;AAEAA,IAAAA,IAAI,CAACG,IAAI,CAACL,WAAW,CAAC;EACxB,CAAC;AACH;;ACzBA;;;;AAIG;SACa2C,cAAcA,GAAA;AAC5B,EAAA,OAAO,UAAC5C,MAAM,EAAEC,WAAW,EAAA;AAQzB,IAAA,IAAMC,WAAW,GAAIF,MAAiB,CAACE,WAAW;AAElD,IAAA,IAAIC,IAAI,GAAkC0C,gDAA6B,CAACjD,GAAG,CAACM,WAAW,CAAC;IAExF,IAAI,CAACC,IAAI,EAAE;AACTA,MAAAA,IAAI,GAAG,EAAE;AACT0C,MAAAA,gDAA6B,CAACxC,GAAG,CAACH,WAAW,EAAEC,IAAI,CAAC;AACtD,IAAA;AAEAA,IAAAA,IAAI,CAACG,IAAI,CAACL,WAAW,CAAC;EACxB,CAAC;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../src/wirestate-core/alias.ts","../../../../../../../src/wirestate-core/commands/command.ts","../../../../../../../src/wirestate-core/commands/command-optional.ts","../../../../../../../src/wirestate-core/commands/on-command.ts","../../../../../../../src/wirestate-core/events/emit-event.ts","../../../../../../../src/wirestate-core/events/on-event.ts","../../../../../../../src/wirestate-core/queries/query.ts","../../../../../../../src/wirestate-core/queries/query-optional.ts","../../../../../../../src/wirestate-core/queries/on-query.ts","../../../../../../../src/wirestate-core/seeds/apply-seeds.ts","../../../../../../../src/wirestate-core/seeds/apply-shared-seed.ts","../../../../../../../src/wirestate-core/seeds/unapply-seeds.ts","../../../../../../../src/wirestate-core/service/on-activated.ts","../../../../../../../src/wirestate-core/service/on-deactivation.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["forwardRef","forward","LazyServiceIdentifier","command","container","type","data","get","CommandBus","commandOptional","OnCommand","target","propertyKey","constructor","list","COMMAND_HANDLER_METADATA","set","push","methodName","emitEvent","payload","from","EventBus","emit","OnEvent","types","normalized","undefined","Array","isArray","__spreadArray","EVENT_HANDLER_METADATA","query","QueryBus","queryOptional","OnQuery","QUERY_HANDLER_METADATA","applySeeds","seeds","existing","SEEDS_TOKEN","_i","seeds_1","_a","key","state","applySharedSeed","seed","rebind","SEED_TOKEN","toConstantValue","unapplySeeds","delete","OnActivated","ACTIVATED_HANDLER_METADATA","OnDeactivation","DEACTIVATION_HANDLER_METADATA"],"mappings":";;;;;;AAoBM,SAAUA,UAAUA,CACxBC,OAA2C,EAAA;AAE3C,EAAA,OAAO,IAAIC,+BAAqB,CAACD,OAAO,CAAC;AAC3C;;ACfA;;;;;;;AAOG;SACaE,OAAOA,CACrBC,SAAoB,EACpBC,IAAO,EACPC,IAAQ,EAAA;AAIR,EAAA,OAAOF,SAAS,CAACG,GAAG,CAACC,6BAAU,CAAC,CAACL,OAAO,CAAOE,IAAI,EAAEC,IAAI,CAAC;AAC5D;;ACfA;;;;;;;AAOG;SACaG,eAAeA,CAC7BL,SAAoB,EACpBC,IAAO,EACPC,IAAQ,EAAA;AAIR,EAAA,OAAOF,SAAS,CAACG,GAAG,CAACC,6BAAU,CAAC,CAACC,eAAe,CAAOJ,IAAI,EAAEC,IAAI,CAAC;AACpE;;ACnBA;;;;;AAKG;AACG,SAAUI,SAASA,CAACL,IAAiB,EAAA;AACzC,EAAA,OAAO,UAACM,MAAM,EAAEC,WAAW,EAAA;AASzB,IAAA,IAAMC,WAAW,GAAGF,MAAM,CAACE,WAAW;AAEtC,IAAA,IAAIC,IAAI,GAAyCC,2CAAwB,CAACR,GAAG,CAACM,W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AO,UAAC5C,MAAM,EAAEC,WAAW,EAAA;AAQzB,IAAA,IAAMC,WAAW,GAAIF,MAAiB,CAACE,WAAW;AAElD,IAAA,IAAIC,IAAI,GAAkC0C,gDAA6B,CAACjD,GAAG,CAACM,WAAW,CAAC;IAExF,IAAI,CAACC,IAAI,EAAE;AACTA,MAAAA,IAAI,GAAG,EAAE;AACT0C,MAAAA,gDAA6B,CAACxC,GAAG,CAACH,WAAW,EAAEC,IAAI,CAAC;AACtD,IAAA;AAEAA,IAAAA,IAAI,CAACG,IAAI,CAACL,WAAW,CAAC;EACxB,CAAC;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -75,12 +75,12 @@ function bindDynamicValue(container, entry) {
75
75
  /**
76
76
  * Command execution status.
77
77
  */
78
- exports.ECommandStatus = void 0;
79
- (function (ECommandStatus) {
80
- ECommandStatus["PENDING"] = "pending";
81
- ECommandStatus["SETTLED"] = "settled";
82
- ECommandStatus["ERROR"] = "error";
83
- })(exports.ECommandStatus || (exports.ECommandStatus = {}));
78
+ exports.CommandStatus = void 0;
79
+ (function (CommandStatus) {
80
+ CommandStatus["PENDING"] = "pending";
81
+ CommandStatus["SETTLED"] = "settled";
82
+ CommandStatus["ERROR"] = "error";
83
+ })(exports.CommandStatus || (exports.CommandStatus = {}));
84
84
 
85
85
  /**
86
86
  * Dispatches commands to handlers.
@@ -145,15 +145,15 @@ var CommandBus = /** @class */function () {
145
145
  var handler = stack[stack.length - 1];
146
146
  var descriptor = {
147
147
  task: null,
148
- status: exports.ECommandStatus.PENDING
148
+ status: exports.CommandStatus.PENDING
149
149
  };
150
150
  descriptor.task = Promise.resolve().then(function () {
151
151
  return handler(data);
152
152
  }).then(function (result) {
153
- descriptor.status = exports.ECommandStatus.SETTLED;
153
+ descriptor.status = exports.CommandStatus.SETTLED;
154
154
  return result;
155
155
  }).catch(function (error) {
156
- descriptor.status = exports.ECommandStatus.ERROR;
156
+ descriptor.status = exports.CommandStatus.ERROR;
157
157
  throw error;
158
158
  });
159
159
  return descriptor;