@privateaim/server-kit 0.8.15 → 0.8.17

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 (154) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/constants.d.ts +6 -0
  3. package/dist/constants.d.ts.map +1 -0
  4. package/dist/core/component/handler/check.d.ts +4 -0
  5. package/dist/core/component/handler/check.d.ts.map +1 -0
  6. package/dist/core/component/handler/index.d.ts +3 -0
  7. package/dist/core/component/handler/index.d.ts.map +1 -0
  8. package/dist/core/component/handler/module.d.ts +11 -0
  9. package/dist/core/component/handler/module.d.ts.map +1 -0
  10. package/dist/core/component/handler/types.d.ts +11 -0
  11. package/dist/core/component/handler/types.d.ts.map +1 -0
  12. package/dist/core/component/index.d.ts +1 -0
  13. package/dist/core/component/index.d.ts.map +1 -1
  14. package/dist/core/queue-router/module.d.ts +3 -2
  15. package/dist/core/queue-router/module.d.ts.map +1 -1
  16. package/dist/core/queue-router/types.d.ts +7 -4
  17. package/dist/core/queue-router/types.d.ts.map +1 -1
  18. package/dist/index.cjs +262 -550
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.mjs +250 -504
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/services/amqp/index.d.ts +1 -0
  25. package/dist/services/amqp/index.d.ts.map +1 -1
  26. package/dist/services/amqp/module.d.ts +2 -5
  27. package/dist/services/amqp/module.d.ts.map +1 -1
  28. package/dist/services/amqp/singleton.d.ts +6 -0
  29. package/dist/services/amqp/singleton.d.ts.map +1 -0
  30. package/dist/services/entity-event/handlers/index.d.ts +3 -0
  31. package/dist/services/entity-event/handlers/index.d.ts.map +1 -0
  32. package/dist/services/entity-event/handlers/redis/helpers.d.ts +2 -0
  33. package/dist/services/entity-event/handlers/redis/helpers.d.ts.map +1 -0
  34. package/dist/services/entity-event/handlers/redis/index.d.ts +3 -0
  35. package/dist/services/entity-event/handlers/redis/index.d.ts.map +1 -0
  36. package/dist/services/entity-event/handlers/redis/module.d.ts +8 -0
  37. package/dist/services/entity-event/handlers/redis/module.d.ts.map +1 -0
  38. package/dist/services/entity-event/handlers/socket/index.d.ts.map +1 -0
  39. package/dist/services/entity-event/handlers/socket/module.d.ts +10 -0
  40. package/dist/services/entity-event/handlers/socket/module.d.ts.map +1 -0
  41. package/dist/services/entity-event/index.d.ts +5 -0
  42. package/dist/services/entity-event/index.d.ts.map +1 -0
  43. package/dist/services/entity-event/module.d.ts +10 -0
  44. package/dist/services/entity-event/module.d.ts.map +1 -0
  45. package/dist/services/entity-event/singleton.d.ts +5 -0
  46. package/dist/services/entity-event/singleton.d.ts.map +1 -0
  47. package/dist/services/entity-event/types.d.ts +38 -0
  48. package/dist/services/entity-event/types.d.ts.map +1 -0
  49. package/dist/services/entity-event/utils.d.ts +2 -0
  50. package/dist/services/entity-event/utils.d.ts.map +1 -0
  51. package/dist/services/index.d.ts +1 -3
  52. package/dist/services/index.d.ts.map +1 -1
  53. package/dist/services/logger/index.d.ts +1 -0
  54. package/dist/services/logger/index.d.ts.map +1 -1
  55. package/dist/services/logger/module.d.ts +1 -2
  56. package/dist/services/logger/module.d.ts.map +1 -1
  57. package/dist/services/logger/singleton.d.ts +1 -1
  58. package/dist/services/logger/transports/console.d.ts +8 -0
  59. package/dist/services/logger/transports/console.d.ts.map +1 -0
  60. package/dist/services/logger/transports/index.d.ts +3 -0
  61. package/dist/services/logger/transports/index.d.ts.map +1 -0
  62. package/dist/services/logger/transports/memory.d.ts +6 -0
  63. package/dist/services/logger/transports/memory.d.ts.map +1 -0
  64. package/dist/services/logger/types.d.ts +27 -7
  65. package/dist/services/logger/types.d.ts.map +1 -1
  66. package/package.json +2 -3
  67. package/src/constants.ts +12 -0
  68. package/src/core/component/handler/check.ts +23 -0
  69. package/src/{services/loki → core/component/handler}/index.ts +2 -2
  70. package/src/core/component/handler/module.ts +57 -0
  71. package/src/core/component/handler/types.ts +28 -0
  72. package/src/core/component/index.ts +1 -0
  73. package/src/core/queue-router/module.ts +30 -4
  74. package/src/core/queue-router/types.ts +12 -5
  75. package/src/index.ts +1 -0
  76. package/src/services/amqp/index.ts +1 -0
  77. package/src/services/amqp/module.ts +5 -19
  78. package/src/services/{loki → amqp}/singleton.ts +6 -6
  79. package/src/services/entity-event/handlers/index.ts +9 -0
  80. package/src/services/entity-event/handlers/redis/helpers.ts +28 -0
  81. package/src/services/{domain-event → entity-event/handlers}/redis/index.ts +1 -0
  82. package/src/services/entity-event/handlers/redis/module.ts +44 -0
  83. package/src/services/entity-event/handlers/socket/module.ts +72 -0
  84. package/src/services/{domain-event → entity-event}/index.ts +1 -2
  85. package/src/services/entity-event/module.ts +75 -0
  86. package/src/services/entity-event/singleton.ts +22 -0
  87. package/src/services/entity-event/types.ts +61 -0
  88. package/src/services/{domain-event → entity-event}/utils.ts +1 -13
  89. package/src/services/index.ts +1 -3
  90. package/src/services/logger/index.ts +1 -0
  91. package/src/services/logger/module.ts +11 -49
  92. package/src/services/logger/singleton.ts +1 -1
  93. package/src/services/logger/transports/console.ts +27 -0
  94. package/src/services/logger/transports/index.ts +9 -0
  95. package/src/services/logger/transports/memory.ts +18 -0
  96. package/src/services/logger/types.ts +27 -8
  97. package/test/data/error.ts +16 -0
  98. package/test/unit/logger.spec.ts +41 -20
  99. package/dist/services/domain-event/index.d.ts +0 -6
  100. package/dist/services/domain-event/index.d.ts.map +0 -1
  101. package/dist/services/domain-event/module.d.ts +0 -10
  102. package/dist/services/domain-event/module.d.ts.map +0 -1
  103. package/dist/services/domain-event/redis/index.d.ts.map +0 -1
  104. package/dist/services/domain-event/redis/module.d.ts +0 -8
  105. package/dist/services/domain-event/redis/module.d.ts.map +0 -1
  106. package/dist/services/domain-event/singleton.d.ts +0 -4
  107. package/dist/services/domain-event/singleton.d.ts.map +0 -1
  108. package/dist/services/domain-event/socket/index.d.ts +0 -2
  109. package/dist/services/domain-event/socket/index.d.ts.map +0 -1
  110. package/dist/services/domain-event/socket/module.d.ts +0 -8
  111. package/dist/services/domain-event/socket/module.d.ts.map +0 -1
  112. package/dist/services/domain-event/types.d.ts +0 -29
  113. package/dist/services/domain-event/types.d.ts.map +0 -1
  114. package/dist/services/domain-event/utils.d.ts +0 -4
  115. package/dist/services/domain-event/utils.d.ts.map +0 -1
  116. package/dist/services/log-store/entities/base.d.ts +0 -7
  117. package/dist/services/log-store/entities/base.d.ts.map +0 -1
  118. package/dist/services/log-store/entities/index.d.ts +0 -3
  119. package/dist/services/log-store/entities/index.d.ts.map +0 -1
  120. package/dist/services/log-store/entities/loki.d.ts +0 -13
  121. package/dist/services/log-store/entities/loki.d.ts.map +0 -1
  122. package/dist/services/log-store/entities/memory.d.ts +0 -11
  123. package/dist/services/log-store/entities/memory.d.ts.map +0 -1
  124. package/dist/services/log-store/index.d.ts +0 -4
  125. package/dist/services/log-store/index.d.ts.map +0 -1
  126. package/dist/services/log-store/singleton.d.ts +0 -6
  127. package/dist/services/log-store/singleton.d.ts.map +0 -1
  128. package/dist/services/log-store/types.d.ts +0 -27
  129. package/dist/services/log-store/types.d.ts.map +0 -1
  130. package/dist/services/logger/store.d.ts +0 -14
  131. package/dist/services/logger/store.d.ts.map +0 -1
  132. package/dist/services/loki/index.d.ts +0 -3
  133. package/dist/services/loki/index.d.ts.map +0 -1
  134. package/dist/services/loki/module.d.ts +0 -3
  135. package/dist/services/loki/module.d.ts.map +0 -1
  136. package/dist/services/loki/singleton.d.ts +0 -6
  137. package/dist/services/loki/singleton.d.ts.map +0 -1
  138. package/src/services/domain-event/module.ts +0 -54
  139. package/src/services/domain-event/redis/module.ts +0 -56
  140. package/src/services/domain-event/singleton.ts +0 -36
  141. package/src/services/domain-event/socket/module.ts +0 -68
  142. package/src/services/domain-event/types.ts +0 -50
  143. package/src/services/log-store/entities/base.ts +0 -25
  144. package/src/services/log-store/entities/index.ts +0 -9
  145. package/src/services/log-store/entities/loki.ts +0 -158
  146. package/src/services/log-store/entities/memory.ts +0 -100
  147. package/src/services/log-store/index.ts +0 -10
  148. package/src/services/log-store/singleton.ts +0 -36
  149. package/src/services/log-store/types.ts +0 -42
  150. package/src/services/logger/store.ts +0 -70
  151. package/src/services/loki/module.ts +0 -30
  152. package/test/unit/log-store.spec.ts +0 -21
  153. /package/dist/services/{domain-event/redis → entity-event/handlers/socket}/index.d.ts +0 -0
  154. /package/src/services/{domain-event → entity-event/handlers}/socket/index.ts +0 -0
package/dist/index.cjs CHANGED
@@ -7,20 +7,29 @@ var vault = require('@hapic/vault');
7
7
  var coreHttpKit = require('@authup/core-http-kit');
8
8
  var redisExtension = require('redis-extension');
9
9
  var TTLCache = require('@isaacs/ttlcache');
10
- var envix = require('envix');
11
- var path = require('node:path');
12
- var typeormExtension = require('typeorm-extension');
13
10
  var winston = require('winston');
14
- var WinstonTransport = require('winston-transport');
15
- var loki = require('@hapic/loki');
11
+ var envix = require('envix');
12
+ var Transport = require('winston-transport');
16
13
  var redisEmitter = require('@socket.io/redis-emitter');
17
14
 
15
+ /*
16
+ * Copyright (c) 2025.
17
+ * Author Peter Placzek (tada5hi)
18
+ * For the full copyright and license information,
19
+ * view the LICENSE file that was distributed with this source code.
20
+ */ var EnvironmentName = /*#__PURE__*/ function(EnvironmentName) {
21
+ EnvironmentName["TEST"] = "test";
22
+ EnvironmentName["DEVELOPMENT"] = "development";
23
+ EnvironmentName["PRODUCTION"] = "production";
24
+ return EnvironmentName;
25
+ }({});
26
+
18
27
  /*
19
28
  * Copyright (c) 2023-2024.
20
29
  * Author Peter Placzek (tada5hi)
21
30
  * For the full copyright and license information,
22
31
  * view the LICENSE file that was distributed with this source code.
23
- */ function _define_property$b(obj, key, value) {
32
+ */ function _define_property$9(obj, key, value) {
24
33
  if (key in obj) {
25
34
  Object.defineProperty(obj, key, {
26
35
  value: value,
@@ -37,11 +46,81 @@ class ComponentError extends Error {
37
46
  constructor(input){
38
47
  super(input.message, {
39
48
  cause: input.cause
40
- }), _define_property$b(this, "code", void 0);
49
+ }), _define_property$9(this, "code", void 0);
41
50
  this.code = input.code;
42
51
  }
43
52
  }
44
53
 
54
+ /*
55
+ * Copyright (c) 2022-2024.
56
+ * Author Peter Placzek (tada5hi)
57
+ * For the full copyright and license information,
58
+ * view the LICENSE file that was distributed with this source code.
59
+ */ function hasOwnProperty(obj, prop) {
60
+ return Object.prototype.hasOwnProperty.call(obj, prop);
61
+ }
62
+
63
+ function isComponentHandlerFn(input) {
64
+ return typeof input === 'function';
65
+ }
66
+
67
+ /*
68
+ * Copyright (c) 2025.
69
+ * Author Peter Placzek (tada5hi)
70
+ * For the full copyright and license information,
71
+ * view the LICENSE file that was distributed with this source code.
72
+ */ function _define_property$8(obj, key, value) {
73
+ if (key in obj) {
74
+ Object.defineProperty(obj, key, {
75
+ value: value,
76
+ enumerable: true,
77
+ configurable: true,
78
+ writable: true
79
+ });
80
+ } else {
81
+ obj[key] = value;
82
+ }
83
+ return obj;
84
+ }
85
+ class ComponentHandlers {
86
+ mount(key, fn) {
87
+ this.handlers[key] = fn;
88
+ }
89
+ unmount(key) {
90
+ delete this.handlers[key];
91
+ }
92
+ async setup() {
93
+ const keys = Object.keys(this.handlers);
94
+ for(let i = 0; i < keys.length; i++){
95
+ const handler = this.handlers[keys[i]];
96
+ if (!isComponentHandlerFn(handler) && handler.setup) {
97
+ await handler.setup();
98
+ }
99
+ }
100
+ }
101
+ async execute(key, value = {}, metadata = {}) {
102
+ const handler = this.handlers[key];
103
+ if (!handler) {
104
+ return;
105
+ }
106
+ if (isComponentHandlerFn(handler)) {
107
+ await handler(value, {
108
+ key,
109
+ metadata
110
+ });
111
+ } else {
112
+ await handler.handle(value, {
113
+ key,
114
+ metadata
115
+ });
116
+ }
117
+ }
118
+ constructor(){
119
+ _define_property$8(this, "handlers", void 0);
120
+ this.handlers = {};
121
+ }
122
+ }
123
+
45
124
  function isComponentError(input) {
46
125
  if (!kit.isObject(input)) {
47
126
  return false;
@@ -85,30 +164,30 @@ function isQueueRouterPayload(input) {
85
164
  return kit.isObject(input) && typeof input.id === 'string' && typeof input.type === 'string' && kit.hasOwnProperty(input, 'data') && kit.isObject(input.data) && kit.hasOwnProperty(input, 'metadata') && kit.isObject(input.metadata);
86
165
  }
87
166
 
88
- const instance$b = singa.singa({
167
+ const instance$a = singa.singa({
89
168
  name: 'amqp'
90
169
  });
91
170
  function setAmqpClientFactory(factory) {
92
- instance$b.setFactory(factory);
171
+ instance$a.setFactory(factory);
93
172
  }
94
173
  function isAmqpClientUsable() {
95
- return instance$b.has() || instance$b.hasFactory();
174
+ return instance$a.has() || instance$a.hasFactory();
96
175
  }
97
176
  function useAmqpClient() {
98
- return instance$b.use();
177
+ return instance$a.use();
99
178
  }
100
179
 
101
- const instance$a = singa.singa({
180
+ const instance$9 = singa.singa({
102
181
  name: 'vault'
103
182
  });
104
183
  function setVaultFactory(factory) {
105
- instance$a.setFactory(factory);
184
+ instance$9.setFactory(factory);
106
185
  }
107
186
  function isVaultClientUsable() {
108
- return instance$a.has() || instance$a.hasFactory();
187
+ return instance$9.has() || instance$9.hasFactory();
109
188
  }
110
189
  function useVaultClient() {
111
- return instance$a.use();
190
+ return instance$9.use();
112
191
  }
113
192
 
114
193
  function guessAuthupTokenCreatorOptions() {
@@ -129,17 +208,17 @@ function guessAuthupTokenCreatorOptions() {
129
208
  return options;
130
209
  }
131
210
 
132
- const instance$9 = singa.singa({
211
+ const instance$8 = singa.singa({
133
212
  name: 'clientAuthenticationHook'
134
213
  });
135
214
  function setClientAuthenticationHookFactory(factory) {
136
- instance$9.setFactory(factory);
215
+ instance$8.setFactory(factory);
137
216
  }
138
217
  function isClientAuthenticationHookUsable() {
139
- return instance$9.has() || instance$9.hasFactory();
218
+ return instance$8.has() || instance$8.hasFactory();
140
219
  }
141
220
  function useClientAuthenticationHook() {
142
- return instance$9.use();
221
+ return instance$8.use();
143
222
  }
144
223
 
145
224
  class AuthupClient extends coreHttpKit.Client {
@@ -156,49 +235,49 @@ class AuthupClient extends coreHttpKit.Client {
156
235
  }
157
236
  }
158
237
 
159
- const instance$8 = singa.singa({
238
+ const instance$7 = singa.singa({
160
239
  name: 'authup'
161
240
  });
162
241
  function useAuthupClient() {
163
- return instance$8.use();
242
+ return instance$7.use();
164
243
  }
165
244
  function isAuthupClientUsable() {
166
- return instance$8.has() || instance$8.hasFactory();
245
+ return instance$7.has() || instance$7.hasFactory();
167
246
  }
168
247
  function setAuthupClientFactory(factory) {
169
- instance$8.setFactory(factory);
248
+ instance$7.setFactory(factory);
170
249
  }
171
250
 
172
- const instance$7 = singa.singa({
251
+ const instance$6 = singa.singa({
173
252
  name: 'redis'
174
253
  });
175
254
  function setRedisFactory(factory) {
176
- instance$7.setFactory(factory);
255
+ instance$6.setFactory(factory);
177
256
  }
178
257
  function isRedisClientUsable() {
179
- return instance$7.has() || instance$7.hasFactory();
258
+ return instance$6.has() || instance$6.hasFactory();
180
259
  }
181
260
  function setRedisClient(input) {
182
- instance$7.set(input);
261
+ instance$6.set(input);
183
262
  }
184
263
  function useRedisClient() {
185
- return instance$7.use();
264
+ return instance$6.use();
186
265
  }
187
266
 
188
- const instance$6 = singa.singa({
267
+ const instance$5 = singa.singa({
189
268
  name: 'redisPublish',
190
269
  factory: ()=>useRedisClient().duplicate()
191
270
  });
192
271
  function useRedisPublishClient() {
193
- return instance$6.use();
272
+ return instance$5.use();
194
273
  }
195
274
 
196
- const instance$5 = singa.singa({
275
+ const instance$4 = singa.singa({
197
276
  name: 'redisSubscribe',
198
277
  factory: ()=>useRedisClient().duplicate()
199
278
  });
200
279
  function useRedisSubscribeClient() {
201
- return instance$5.use();
280
+ return instance$4.use();
202
281
  }
203
282
 
204
283
  /*
@@ -206,7 +285,7 @@ function useRedisSubscribeClient() {
206
285
  * Author Peter Placzek (tada5hi)
207
286
  * For the full copyright and license information,
208
287
  * view the LICENSE file that was distributed with this source code.
209
- */ function _define_property$a(obj, key, value) {
288
+ */ function _define_property$7(obj, key, value) {
210
289
  if (key in obj) {
211
290
  Object.defineProperty(obj, key, {
212
291
  value: value,
@@ -254,7 +333,7 @@ class MemoryCacheAdapter {
254
333
  this.instance.clear();
255
334
  }
256
335
  constructor(options = {}){
257
- _define_property$a(this, "instance", void 0);
336
+ _define_property$7(this, "instance", void 0);
258
337
  this.instance = new TTLCache({
259
338
  checkAgeOnGet: true,
260
339
  ttl: Infinity,
@@ -268,7 +347,7 @@ class MemoryCacheAdapter {
268
347
  * Author Peter Placzek (tada5hi)
269
348
  * For the full copyright and license information,
270
349
  * view the LICENSE file that was distributed with this source code.
271
- */ function _define_property$9(obj, key, value) {
350
+ */ function _define_property$6(obj, key, value) {
272
351
  if (key in obj) {
273
352
  Object.defineProperty(obj, key, {
274
353
  value: value,
@@ -317,8 +396,8 @@ class RedisCacheAdapter {
317
396
  await this.client.flushdb();
318
397
  }
319
398
  constructor(){
320
- _define_property$9(this, "client", void 0);
321
- _define_property$9(this, "instance", void 0);
399
+ _define_property$6(this, "client", void 0);
400
+ _define_property$6(this, "instance", void 0);
322
401
  this.client = useRedisClient();
323
402
  this.instance = new redisExtension.JsonAdapter(this.client);
324
403
  }
@@ -340,7 +419,7 @@ function buildCacheKey(options) {
340
419
  * Author Peter Placzek (tada5hi)
341
420
  * For the full copyright and license information,
342
421
  * view the LICENSE file that was distributed with this source code.
343
- */ function _define_property$8(obj, key, value) {
422
+ */ function _define_property$5(obj, key, value) {
344
423
  if (key in obj) {
345
424
  Object.defineProperty(obj, key, {
346
425
  value: value,
@@ -373,12 +452,12 @@ class Cache {
373
452
  return this.adapter.clear(options);
374
453
  }
375
454
  constructor(adapter){
376
- _define_property$8(this, "adapter", void 0);
455
+ _define_property$5(this, "adapter", void 0);
377
456
  this.adapter = adapter;
378
457
  }
379
458
  }
380
459
 
381
- const instance$4 = singa.singa({
460
+ const instance$3 = singa.singa({
382
461
  name: 'cache',
383
462
  factory: ()=>{
384
463
  let adapter;
@@ -391,261 +470,26 @@ const instance$4 = singa.singa({
391
470
  }
392
471
  });
393
472
  function useCache() {
394
- return instance$4.use();
395
- }
396
-
397
- /*
398
- * Copyright (c) 2025.
399
- * Author Peter Placzek (tada5hi)
400
- * For the full copyright and license information,
401
- * view the LICENSE file that was distributed with this source code.
402
- */ function _define_property$7(obj, key, value) {
403
- if (key in obj) {
404
- Object.defineProperty(obj, key, {
405
- value: value,
406
- enumerable: true,
407
- configurable: true,
408
- writable: true
409
- });
410
- } else {
411
- obj[key] = value;
412
- }
413
- return obj;
414
- }
415
- class LogStoreTransport extends WinstonTransport {
416
- log(info, next) {
417
- const { message, timestamp, stack, ...data } = info;
418
- const labels = {
419
- ...this.labels
420
- };
421
- const keys = Object.keys(data);
422
- for(let i = 0; i < keys.length; i++){
423
- if (typeof keys[i] !== 'string') {
424
- continue;
425
- }
426
- const value = data[keys[i]];
427
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
428
- labels[keys[i]] = `${value}`;
429
- }
430
- }
431
- let date;
432
- if (typeof timestamp === 'string') {
433
- date = new Date(`${timestamp}`);
434
- } else {
435
- date = new Date();
436
- }
437
- const payload = {
438
- message: stack || message,
439
- time: BigInt(date.getTime()) * 1000000n,
440
- labels
441
- };
442
- Promise.resolve().then(()=>this.instance.write(payload)).then(()=>next());
443
- }
444
- constructor(store, options = {}){
445
- super(options), _define_property$7(this, "instance", void 0), _define_property$7(this, "labels", void 0);
446
- this.instance = store;
447
- this.labels = options.labels || {};
448
- }
449
- }
450
-
451
- const instance$3 = singa.singa({
452
- name: 'loki'
453
- });
454
- function setLokiFactory(factory) {
455
- instance$3.setFactory(factory);
456
- }
457
- function isLokiClientUsable() {
458
- return instance$3.has() || instance$3.hasFactory();
459
- }
460
- function useLokiClient() {
461
473
  return instance$3.use();
462
474
  }
463
475
 
464
- /*
465
- * Copyright (c) 2025.
466
- * Author Peter Placzek (tada5hi)
467
- * For the full copyright and license information,
468
- * view the LICENSE file that was distributed with this source code.
469
- */ function _define_property$6(obj, key, value) {
470
- if (key in obj) {
471
- Object.defineProperty(obj, key, {
472
- value: value,
473
- enumerable: true,
474
- configurable: true,
475
- writable: true
476
+ class LoggerConsoleTransport extends winston.transports.Console {
477
+ constructor(options = {}){
478
+ super({
479
+ level: envix.read('env') === EnvironmentName.PRODUCTION ? 'info' : 'debug',
480
+ ...options
476
481
  });
477
- } else {
478
- obj[key] = value;
479
482
  }
480
- return obj;
481
483
  }
482
- class BaseLogStore {
483
- setLabels(labels) {
484
- this.labels = labels;
485
- }
486
- getLabels() {
487
- return this.labels;
488
- }
489
- extendLabels(labels) {
490
- const keys = Object.keys(labels);
491
- for(let i = 0; i < keys.length; i++){
492
- this.labels[keys[i]] = labels[keys[i]];
493
- }
494
- }
495
- constructor(){
496
- _define_property$6(this, "labels", void 0);
497
- }
484
+ function createLoggerConsoleTransport(options = {}) {
485
+ return new LoggerConsoleTransport(options);
498
486
  }
499
487
 
500
488
  /*
501
489
  * Copyright (c) 2025.
502
- * Author Peter Placzek (tada5hi)
503
- * For the full copyright and license information,
504
- * view the LICENSE file that was distributed with this source code.
505
- */ function _define_property$5(obj, key, value) {
506
- if (key in obj) {
507
- Object.defineProperty(obj, key, {
508
- value: value,
509
- enumerable: true,
510
- configurable: true,
511
- writable: true
512
- });
513
- } else {
514
- obj[key] = value;
515
- }
516
- return obj;
517
- }
518
- class LokiLogStore extends BaseLogStore {
519
- async write(message, labels) {
520
- let data;
521
- if (typeof message === 'string') {
522
- const labelsNormalized = {
523
- ...this.labels,
524
- ...labels || {}
525
- };
526
- const level = labelsNormalized.level || kit.LogLevel.DEBUG;
527
- delete labelsNormalized.level;
528
- data = {
529
- message,
530
- level,
531
- time: loki.nanoSeconds(),
532
- labels: labelsNormalized
533
- };
534
- } else {
535
- const labelsNormalized = {
536
- ...this.labels,
537
- ...message.labels || {},
538
- ...labels || {}
539
- };
540
- const level = message.level || labelsNormalized.level || kit.LogLevel.DEBUG;
541
- delete labelsNormalized.level;
542
- data = {
543
- ...message,
544
- level,
545
- time: message.time || loki.nanoSeconds(),
546
- labels: labelsNormalized
547
- };
548
- }
549
- const stream = {
550
- stream: data.labels,
551
- values: [
552
- [
553
- data.time,
554
- data.message,
555
- {
556
- level: data.level
557
- }
558
- ]
559
- ]
560
- };
561
- await this.instance.distributor.push(stream);
562
- return data;
563
- }
564
- async delete(options) {
565
- await this.instance.compactor.createDeletionRequest({
566
- start: options.start,
567
- ...options.end ? {
568
- end: options.end
569
- } : {},
570
- query: this.buildQuery({
571
- ...this.labels,
572
- ...options.labels || {}
573
- })
574
- });
575
- }
576
- async query(input) {
577
- const options = {
578
- query: this.buildQuery({
579
- ...this.labels,
580
- ...input.labels || {}
581
- })
582
- };
583
- if (input.sort) {
584
- options.direction = input.sort === 'DESC' ? 'forward' : 'backward';
585
- }
586
- if (input.limit) {
587
- options.limit = input.limit;
588
- }
589
- if (input.start) {
590
- options.start = BigInt(new Date(`${input.start}`).getTime()) * 1000000n;
591
- }
592
- if (input.end) {
593
- options.end = BigInt(new Date(`${input.end}`).getTime()) * 1000000n;
594
- }
595
- const output = [];
596
- const response = await this.instance.querier.queryRange(options);
597
- if (response.data.resultType === 'streams') {
598
- for(let i = 0; i < response.data.result.length; i++){
599
- const set = response.data.result[i];
600
- const labels = set.stream;
601
- let level;
602
- if (labels.level) {
603
- level = labels.level;
604
- } else {
605
- level = labels.detected_level;
606
- }
607
- delete labels.level;
608
- delete labels.detected_level;
609
- if (!labels.service) {
610
- labels.service = labels.service_name;
611
- }
612
- delete labels.service_name;
613
- for(let j = 0; j < set.values.length; j++){
614
- output.push({
615
- time: BigInt(set.values[j][0]),
616
- message: set.values[j][1],
617
- level,
618
- labels
619
- });
620
- }
621
- }
622
- }
623
- return [
624
- output,
625
- output.length
626
- ];
627
- }
628
- // ----------------------------------------------
629
- buildQuery(labels) {
630
- const output = [];
631
- const keys = Object.keys(labels);
632
- for(let i = 0; i < keys.length; i++){
633
- output.push(`${keys[i]}="${labels[keys[i]]}"`);
634
- }
635
- return `{${output.join(',')}}`;
636
- }
637
- constructor(instance, labels){
638
- super(), _define_property$5(this, "instance", void 0);
639
- this.instance = instance;
640
- this.labels = labels || {};
641
- }
642
- }
643
-
644
- /*
645
- * Copyright (c) 2025.
646
- * Author Peter Placzek (tada5hi)
647
- * For the full copyright and license information,
648
- * view the LICENSE file that was distributed with this source code.
490
+ * Author Peter Placzek (tada5hi)
491
+ * For the full copyright and license information,
492
+ * view the LICENSE file that was distributed with this source code.
649
493
  */ function _define_property$4(obj, key, value) {
650
494
  if (key in obj) {
651
495
  Object.defineProperty(obj, key, {
@@ -659,160 +503,52 @@ class LokiLogStore extends BaseLogStore {
659
503
  }
660
504
  return obj;
661
505
  }
662
- class MemoryLogStore extends BaseLogStore {
663
- // todo: apply query options
664
- async delete() {
665
- return Promise.resolve();
666
- }
667
- async query(options = {}) {
668
- // todo: apply all query options
669
- const data = this.items.filter((item)=>{
670
- if (options.labels) {
671
- if (!item.labels) {
672
- return false;
673
- }
674
- const labelKeys = Object.keys(options.labels);
675
- for(let i = 0; i < labelKeys.length; i++){
676
- if (!item.labels[labelKeys[i]]) {
677
- return false;
678
- }
679
- if (item.labels[labelKeys[i]] !== options.labels[labelKeys[i]]) {
680
- return false;
681
- }
682
- }
683
- }
684
- return true;
685
- });
686
- return [
687
- data,
688
- data.length
689
- ];
690
- }
691
- async write(message, labels) {
692
- let data;
693
- if (typeof message === 'string') {
694
- const labelsNormalized = {
695
- ...this.labels,
696
- ...labels || {}
697
- };
698
- const level = labelsNormalized.level || kit.LogLevel.DEBUG;
699
- delete labelsNormalized.level;
700
- data = {
701
- message,
702
- level,
703
- time: loki.nanoSeconds(),
704
- labels: labelsNormalized
705
- };
706
- } else {
707
- const labelsNormalized = {
708
- ...this.labels,
709
- ...message.labels || {},
710
- ...labels || {}
711
- };
712
- const level = message.level || labelsNormalized.level || kit.LogLevel.DEBUG;
713
- delete labelsNormalized.level;
714
- data = {
715
- ...message,
716
- level,
717
- time: message.time || loki.nanoSeconds(),
718
- labels: labelsNormalized
719
- };
720
- }
721
- this.items.push(data);
722
- return data;
723
- }
724
- constructor(labels){
725
- super(), _define_property$4(this, "items", void 0);
726
- this.items = [];
727
- this.labels = labels;
506
+ class LoggerMemoryTransport extends Transport {
507
+ log(info, next) {
508
+ this.items.push(info);
509
+ next();
728
510
  }
729
- }
730
-
731
- const instance$2 = singa.singa({
732
- name: 'logStore',
733
- factory: ()=>{
734
- if (isLokiClientUsable()) {
735
- const loki = useLokiClient();
736
- return new LokiLogStore(loki);
737
- }
738
- return new MemoryLogStore();
511
+ constructor(...args){
512
+ super(...args), _define_property$4(this, "items", []);
739
513
  }
740
- });
741
- function isLogStoreUsable() {
742
- return instance$2.has() || instance$2.hasFactory();
743
- }
744
- function setLogStoreFactory(input) {
745
- instance$2.setFactory(input);
746
- }
747
- function useLogStore() {
748
- return instance$2.use();
749
514
  }
750
515
 
751
516
  function createLogger(ctx = {}) {
752
- const store = ctx.store || useLogStore();
753
- let loggerTransports;
754
- if (envix.read('env') === typeormExtension.EnvironmentName.PRODUCTION) {
755
- loggerTransports = [
756
- new winston.transports.Console({
757
- level: 'info'
758
- }),
759
- new winston.transports.File({
760
- filename: path.join(ctx.directory || process.cwd(), 'access.log'),
761
- level: 'http',
762
- maxsize: 10 * 1024 * 1024,
763
- maxFiles: 5
764
- }),
765
- new winston.transports.File({
766
- filename: path.join(ctx.directory || process.cwd(), 'error.log'),
767
- level: 'warn',
768
- maxsize: 10 * 1024 * 1024,
769
- maxFiles: 5
770
- }),
771
- new LogStoreTransport(store, {
772
- level: 'http',
773
- labels: ctx.labels
774
- })
775
- ];
776
- } else {
777
- loggerTransports = [
778
- new winston.transports.Console({
779
- level: 'debug'
780
- }),
781
- new LogStoreTransport(store, {
782
- level: 'http',
783
- labels: ctx.labels
784
- })
785
- ];
517
+ const transports = [
518
+ ...ctx.transports || []
519
+ ];
520
+ if (transports.length === 0) {
521
+ transports.push(createLoggerConsoleTransport());
786
522
  }
787
523
  return winston.createLogger({
788
524
  format: winston.format.combine(winston.format.errors({
789
525
  stack: true
790
526
  }), winston.format.timestamp(), winston.format.simple()),
791
527
  level: 'debug',
792
- transports: loggerTransports,
528
+ transports,
793
529
  // todo: deeply merge options
794
530
  ...ctx.options || {}
795
531
  });
796
532
  }
797
533
 
798
- const instance$1 = singa.singa({
534
+ const instance$2 = singa.singa({
799
535
  name: 'logger'
800
536
  });
801
537
  function setLoggerFactory(factory) {
802
- instance$1.setFactory(factory);
538
+ instance$2.setFactory(factory);
803
539
  }
804
540
  function isLoggerUsable() {
805
- return instance$1.has() || instance$1.hasFactory();
541
+ return instance$2.has() || instance$2.hasFactory();
806
542
  }
807
543
  function setLogger(input) {
808
- instance$1.set(input);
544
+ instance$2.set(input);
809
545
  }
810
546
  function useLogger() {
811
- return instance$1.use();
547
+ return instance$2.use();
812
548
  }
813
549
 
814
550
  /*
815
- * Copyright (c) 2024-2024.
551
+ * Copyright (c) 2024-2025.
816
552
  * Author Peter Placzek (tada5hi)
817
553
  * For the full copyright and license information,
818
554
  * view the LICENSE file that was distributed with this source code.
@@ -829,40 +565,50 @@ function useLogger() {
829
565
  }
830
566
  return obj;
831
567
  }
832
- class DomainEventPublisher {
833
- addPublisher(publisher) {
834
- this.publishers.add(publisher);
568
+ class EntityEventPublisher {
569
+ register(consumer) {
570
+ this.handlers.add(consumer);
835
571
  }
836
572
  async safePublish(ctx) {
837
573
  try {
838
574
  await this.publish(ctx);
839
575
  } catch (e) {
840
576
  if (isLoggerUsable()) {
841
- useLogger().error(`Publishing event ${kit.buildDomainEventFullName(ctx.metadata.domain, ctx.metadata.event)} failed`);
577
+ useLogger().error(`Publishing event ${kit.buildDomainEventFullName(ctx.metadata.ref_type, ctx.metadata.event)} failed`);
842
578
  useLogger().error(e);
843
579
  }
844
580
  }
845
581
  }
846
582
  async publish(ctx) {
847
583
  if (isLoggerUsable()) {
848
- useLogger().info(`Publishing event ${kit.buildDomainEventFullName(ctx.metadata.domain, ctx.metadata.event)}`);
584
+ useLogger().debug(`Publishing event ${kit.buildDomainEventFullName(ctx.metadata.ref_type, ctx.metadata.event)}`);
849
585
  }
850
- const publishers = this.publishers.values();
586
+ let destinations = [];
587
+ if (typeof ctx.destinations === 'function') {
588
+ destinations = ctx.destinations(ctx.data);
589
+ } else {
590
+ destinations = ctx.destinations;
591
+ }
592
+ const consumeContext = {
593
+ ...ctx,
594
+ destinations
595
+ };
596
+ const handlers = this.handlers.values();
851
597
  while(true){
852
- const it = publishers.next();
853
- if (it.done) {
598
+ const handler = handlers.next();
599
+ if (handler.done) {
854
600
  return;
855
601
  }
856
- await it.value.publish(ctx);
602
+ await handler.value.handle(consumeContext);
857
603
  }
858
604
  }
859
605
  constructor(){
860
- _define_property$3(this, "publishers", void 0);
861
- this.publishers = new Set();
606
+ _define_property$3(this, "handlers", void 0);
607
+ this.handlers = new Set();
862
608
  }
863
609
  }
864
610
 
865
- function transformEventData(input) {
611
+ function transformEntityEventData(input) {
866
612
  if (kit.isObject(input)) {
867
613
  const keys = Object.keys(input);
868
614
  for(let i = 0; i < keys.length; i++){
@@ -874,11 +620,25 @@ function transformEventData(input) {
874
620
  }
875
621
  return input;
876
622
  }
877
- function buildEventChannelName(input, id) {
878
- if (typeof input === 'string') {
879
- return input;
623
+
624
+ /*
625
+ * Copyright (c) 2025.
626
+ * Author Peter Placzek (tada5hi)
627
+ * For the full copyright and license information,
628
+ * view the LICENSE file that was distributed with this source code.
629
+ */ function stringify(input) {
630
+ return typeof input === 'string' ? input : input.join('/');
631
+ }
632
+ function buildEntityEventRedisChannel(channel, namespace) {
633
+ const channelNormalized = stringify(channel);
634
+ let namespaceNormalized;
635
+ if (namespace) {
636
+ namespaceNormalized = stringify(namespace);
880
637
  }
881
- return input(id);
638
+ if (typeof namespaceNormalized === 'undefined') {
639
+ return channelNormalized;
640
+ }
641
+ return `${namespaceNormalized}/${channelNormalized}`;
882
642
  }
883
643
 
884
644
  /*
@@ -899,32 +659,19 @@ function buildEventChannelName(input, id) {
899
659
  }
900
660
  return obj;
901
661
  }
902
- class DomainEventRedisPublisher {
903
- async publish(ctx) {
662
+ class EntityEventRedisHandler {
663
+ async handle(ctx) {
904
664
  const payload = {
905
- type: ctx.metadata.domain,
665
+ type: ctx.metadata.ref_type,
906
666
  event: ctx.metadata.event,
907
- data: transformEventData(ctx.data)
667
+ data: transformEntityEventData(ctx.data)
908
668
  };
909
669
  const payloadSerialized = JSON.stringify(payload);
910
670
  const pipeline = this.driver.pipeline();
911
671
  for(let i = 0; i < ctx.destinations.length; i++){
912
672
  const destination = ctx.destinations[i];
913
- let keyPrefix;
914
- if (destination.namespace) {
915
- keyPrefix = typeof destination.namespace === 'function' ? destination.namespace(ctx.data) : destination.namespace;
916
- }
917
- let key;
918
- if (keyPrefix) {
919
- key = keyPrefix + buildEventChannelName(destination.channel);
920
- } else {
921
- key = buildEventChannelName(destination.channel);
922
- }
673
+ const key = buildEntityEventRedisChannel(destination.channel, destination.namespace);
923
674
  pipeline.publish(key, payloadSerialized);
924
- if (typeof destination.channel === 'function') {
925
- key = keyPrefix + buildEventChannelName(destination.channel, ctx.data.id);
926
- pipeline.publish(key, payloadSerialized);
927
- }
928
675
  }
929
676
  await pipeline.exec();
930
677
  }
@@ -952,39 +699,42 @@ class DomainEventRedisPublisher {
952
699
  }
953
700
  return obj;
954
701
  }
955
- class DomainEventSocketPublisher {
956
- async publish(ctx) {
957
- ctx.data = transformEventData(ctx.data);
702
+ class EntityEventSocketHandler {
703
+ async handle(ctx) {
704
+ ctx.data = transformEntityEventData(ctx.data);
958
705
  for(let i = 0; i < ctx.destinations.length; i++){
959
706
  const destination = ctx.destinations[i];
960
- let namespace;
961
- if (destination.namespace) {
962
- namespace = typeof destination.namespace === 'function' ? destination.namespace(ctx.data) : destination.namespace;
963
- } else {
964
- namespace = '/';
965
- }
707
+ const namespace = this.buildNamespace(destination.namespace);
708
+ const roomName = this.buildChannel(destination.channel);
709
+ const fullEventName = kit.buildDomainEventFullName(ctx.metadata.ref_type, ctx.metadata.event);
966
710
  const emitter = new redisEmitter.Emitter(this.client, {}, namespace);
967
- const fullEventName = kit.buildDomainEventFullName(ctx.metadata.domain, ctx.metadata.event);
968
- const rooms = [
969
- buildEventChannelName(destination.channel)
970
- ];
971
- if (typeof destination.channel === 'function') {
972
- rooms.push(buildEventChannelName(destination.channel, ctx.data.id));
973
- }
974
- for(let j = 0; j < rooms.length; j++){
975
- emitter.in(rooms[j]).emit(fullEventName, {
976
- data: {
977
- data: ctx.data,
978
- type: ctx.metadata.domain,
979
- event: ctx.metadata.event
980
- },
981
- meta: {
982
- namespace,
983
- roomName: rooms[j]
984
- }
985
- });
986
- }
711
+ emitter.in(roomName).emit(fullEventName, {
712
+ data: {
713
+ data: ctx.data,
714
+ type: ctx.metadata.ref_type,
715
+ event: ctx.metadata.event
716
+ },
717
+ meta: {
718
+ namespace,
719
+ roomName
720
+ }
721
+ });
722
+ }
723
+ }
724
+ buildNamespace(namespace) {
725
+ if (typeof namespace === 'undefined') {
726
+ return '/';
727
+ }
728
+ if (typeof namespace === 'string') {
729
+ return namespace.startsWith('/') ? namespace : `/${namespace}`;
987
730
  }
731
+ return `/${namespace.join('/')}`;
732
+ }
733
+ buildChannel(channel) {
734
+ if (typeof channel === 'string') {
735
+ return channel;
736
+ }
737
+ return channel.join('/');
988
738
  }
989
739
  constructor(client){
990
740
  _define_property$1(this, "client", void 0);
@@ -992,23 +742,14 @@ class DomainEventSocketPublisher {
992
742
  }
993
743
  }
994
744
 
995
- const singaInstance = singa.singa({
996
- name: 'domainEventPublisher',
997
- factory: ()=>{
998
- const publisher = new DomainEventPublisher();
999
- if (isRedisClientUsable()) {
1000
- const client = useRedisClient();
1001
- publisher.addPublisher(new DomainEventRedisPublisher(client));
1002
- publisher.addPublisher(new DomainEventSocketPublisher(client));
1003
- }
1004
- return publisher;
1005
- }
745
+ const instance$1 = singa.singa({
746
+ name: 'entityEventPublisher'
1006
747
  });
1007
- function useDomainEventPublisherSinga() {
1008
- return singaInstance;
748
+ function setEntityEventPublisherFactory(factory) {
749
+ instance$1.setFactory(factory);
1009
750
  }
1010
- function useDomainEventPublisher() {
1011
- return singaInstance.use();
751
+ function useEntityEventPublisher() {
752
+ return instance$1.use();
1012
753
  }
1013
754
 
1014
755
  /*
@@ -1031,7 +772,9 @@ function useDomainEventPublisher() {
1031
772
  }
1032
773
  class QueueRouter {
1033
774
  //----------------------------------------------------------------
1034
- publish(message) {
775
+ publish(message, options = {}) {
776
+ var _options;
777
+ (_options = options).logging ?? (_options.logging = true);
1035
778
  let exchange;
1036
779
  if (message.metadata.routing.type === 'work') {
1037
780
  exchange = this.driver.of({
@@ -1044,7 +787,7 @@ class QueueRouter {
1044
787
  name: message.metadata.routing.namespace || 'FLAME'
1045
788
  });
1046
789
  }
1047
- if (isLoggerUsable()) {
790
+ if (options.logging && isLoggerUsable()) {
1048
791
  useLogger().debug(`Publishing queue message ${message.type} in ${message.metadata.routing.key}`);
1049
792
  }
1050
793
  return exchange.publish(message.metadata.routing.key, message, {
@@ -1053,6 +796,11 @@ class QueueRouter {
1053
796
  persistent: message.metadata.persistent ?? message.metadata.routing.type === QueueRouterRoutingType.WORK
1054
797
  });
1055
798
  }
799
+ consumeAny(routing, fn) {
800
+ return this.consume(routing, {
801
+ $any: (payload)=>fn(payload)
802
+ });
803
+ }
1056
804
  consume(routing, handlers) {
1057
805
  let exchange;
1058
806
  if (routing.type === 'work') {
@@ -1097,7 +845,14 @@ class QueueRouter {
1097
845
  }
1098
846
  return;
1099
847
  }
1100
- await handler(payload);
848
+ try {
849
+ await handler(payload);
850
+ } catch (e) {
851
+ if (isLoggerUsable()) {
852
+ useLogger().error(e);
853
+ }
854
+ throw e;
855
+ }
1101
856
  }
1102
857
  });
1103
858
  }
@@ -1122,15 +877,10 @@ function useQueueRouter() {
1122
877
  return instance.use();
1123
878
  }
1124
879
 
1125
- /*
1126
- * Copyright (c) 2022-2024.
1127
- * Author Peter Placzek (tada5hi)
1128
- * For the full copyright and license information,
1129
- * view the LICENSE file that was distributed with this source code.
1130
- */ function hasOwnProperty(obj, prop) {
1131
- return Object.prototype.hasOwnProperty.call(obj, prop);
1132
- }
1133
-
880
+ Object.defineProperty(exports, "AmqpClient", {
881
+ enumerable: true,
882
+ get: function () { return amqpExtension.Client; }
883
+ });
1134
884
  Object.defineProperty(exports, "VaultClient", {
1135
885
  enumerable: true,
1136
886
  get: function () { return vault.VaultClient; }
@@ -1155,67 +905,33 @@ Object.defineProperty(exports, "createRedisClient", {
1155
905
  enumerable: true,
1156
906
  get: function () { return redisExtension.createClient; }
1157
907
  });
1158
- Object.defineProperty(exports, "LokiClient", {
1159
- enumerable: true,
1160
- get: function () { return loki.LokiClient; }
1161
- });
1162
- Object.defineProperty(exports, "LokiCompactorDeletionRequestCreate", {
1163
- enumerable: true,
1164
- get: function () { return loki.CompactorDeletionRequestCreate; }
1165
- });
1166
- Object.defineProperty(exports, "LokiConfig", {
1167
- enumerable: true,
1168
- get: function () { return loki.Config; }
1169
- });
1170
- Object.defineProperty(exports, "LokiConfigInput", {
1171
- enumerable: true,
1172
- get: function () { return loki.ConfigInput; }
1173
- });
1174
- Object.defineProperty(exports, "LokiDistributorPushStream", {
1175
- enumerable: true,
1176
- get: function () { return loki.DistributorPushStream; }
1177
- });
1178
- Object.defineProperty(exports, "LokiQuerierQueryRangeOptions", {
1179
- enumerable: true,
1180
- get: function () { return loki.QuerierQueryRangeOptions; }
1181
- });
1182
- Object.defineProperty(exports, "LokiQuerierQueryResult", {
1183
- enumerable: true,
1184
- get: function () { return loki.QuerierQueryResult; }
1185
- });
1186
- Object.defineProperty(exports, "createLokiClient", {
1187
- enumerable: true,
1188
- get: function () { return loki.createClient; }
1189
- });
1190
- Object.defineProperty(exports, "nanoSeconds", {
1191
- enumerable: true,
1192
- get: function () { return loki.nanoSeconds; }
1193
- });
1194
908
  exports.AuthupClient = AuthupClient;
1195
909
  exports.Cache = Cache;
1196
910
  exports.ComponentError = ComponentError;
1197
- exports.DomainEventPublisher = DomainEventPublisher;
1198
- exports.DomainEventRedisPublisher = DomainEventRedisPublisher;
1199
- exports.DomainEventSocketPublisher = DomainEventSocketPublisher;
1200
- exports.LokiLogStore = LokiLogStore;
911
+ exports.ComponentHandlers = ComponentHandlers;
912
+ exports.EntityEventPublisher = EntityEventPublisher;
913
+ exports.EntityEventRedisHandler = EntityEventRedisHandler;
914
+ exports.EntityEventSocketHandler = EntityEventSocketHandler;
915
+ exports.EnvironmentName = EnvironmentName;
916
+ exports.LoggerConsoleTransport = LoggerConsoleTransport;
917
+ exports.LoggerMemoryTransport = LoggerMemoryTransport;
1201
918
  exports.MemoryCacheAdapter = MemoryCacheAdapter;
1202
- exports.MemoryLogStore = MemoryLogStore;
1203
919
  exports.QueueRouter = QueueRouter;
1204
920
  exports.QueueRouterRoutingType = QueueRouterRoutingType;
1205
921
  exports.RedisCacheAdapter = RedisCacheAdapter;
1206
922
  exports.buildCacheKey = buildCacheKey;
923
+ exports.buildEntityEventRedisChannel = buildEntityEventRedisChannel;
1207
924
  exports.buildQueueRouterPublishPayload = buildQueueRouterPublishPayload;
1208
925
  exports.createCacheAdapter = createCacheAdapter;
1209
926
  exports.createLogger = createLogger;
927
+ exports.createLoggerConsoleTransport = createLoggerConsoleTransport;
1210
928
  exports.guessAuthupTokenCreatorOptions = guessAuthupTokenCreatorOptions;
1211
929
  exports.hasOwnProperty = hasOwnProperty;
1212
930
  exports.isAmqpClientUsable = isAmqpClientUsable;
1213
931
  exports.isAuthupClientUsable = isAuthupClientUsable;
1214
932
  exports.isClientAuthenticationHookUsable = isClientAuthenticationHookUsable;
1215
933
  exports.isComponentError = isComponentError;
1216
- exports.isLogStoreUsable = isLogStoreUsable;
1217
934
  exports.isLoggerUsable = isLoggerUsable;
1218
- exports.isLokiClientUsable = isLokiClientUsable;
1219
935
  exports.isQueuePayload = isQueuePayload;
1220
936
  exports.isQueueRouterPayload = isQueueRouterPayload;
1221
937
  exports.isQueueRouterUsable = isQueueRouterUsable;
@@ -1224,10 +940,9 @@ exports.isVaultClientUsable = isVaultClientUsable;
1224
940
  exports.setAmqpClientFactory = setAmqpClientFactory;
1225
941
  exports.setAuthupClientFactory = setAuthupClientFactory;
1226
942
  exports.setClientAuthenticationHookFactory = setClientAuthenticationHookFactory;
1227
- exports.setLogStoreFactory = setLogStoreFactory;
943
+ exports.setEntityEventPublisherFactory = setEntityEventPublisherFactory;
1228
944
  exports.setLogger = setLogger;
1229
945
  exports.setLoggerFactory = setLoggerFactory;
1230
- exports.setLokiFactory = setLokiFactory;
1231
946
  exports.setRedisClient = setRedisClient;
1232
947
  exports.setRedisFactory = setRedisFactory;
1233
948
  exports.setVaultFactory = setVaultFactory;
@@ -1235,11 +950,8 @@ exports.useAmqpClient = useAmqpClient;
1235
950
  exports.useAuthupClient = useAuthupClient;
1236
951
  exports.useCache = useCache;
1237
952
  exports.useClientAuthenticationHook = useClientAuthenticationHook;
1238
- exports.useDomainEventPublisher = useDomainEventPublisher;
1239
- exports.useDomainEventPublisherSinga = useDomainEventPublisherSinga;
1240
- exports.useLogStore = useLogStore;
953
+ exports.useEntityEventPublisher = useEntityEventPublisher;
1241
954
  exports.useLogger = useLogger;
1242
- exports.useLokiClient = useLokiClient;
1243
955
  exports.useQueueRouter = useQueueRouter;
1244
956
  exports.useRedisClient = useRedisClient;
1245
957
  exports.useRedisPublishClient = useRedisPublishClient;