@iwentsourcing/core 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/aggregation/aggregation-declaration.d.ts +27 -27
  2. package/dist/authentication/public-auth-providers.js.map +1 -1
  3. package/dist/event-store/create-file-event-store.d.ts +1 -1
  4. package/dist/example/todo-example.d.ts +6 -6
  5. package/dist/management/access/access-events.d.ts +104 -104
  6. package/dist/management/access/access-state.d.ts +269 -269
  7. package/dist/management/access/access-stream.d.ts +286 -286
  8. package/dist/management/authentication/authentication-state.d.ts +21 -21
  9. package/dist/management/authentication/authentication-stream.d.ts +66 -66
  10. package/dist/management/permission/permission-aggregation.d.ts +101 -101
  11. package/dist/management/permission/permission-aggregation.test.js +0 -1
  12. package/dist/management/permission/permission-aggregation.test.js.map +1 -1
  13. package/dist/management/permission-error-schema.d.ts +29 -29
  14. package/dist/management/registry/registry-events.d.ts +186 -186
  15. package/dist/management/registry/registry-state.d.ts +55 -55
  16. package/dist/management/registry/registry-stream.d.ts +284 -284
  17. package/dist/management/state-read-policy.js.map +1 -1
  18. package/dist/management/system/iwentsourcing-realm.d.ts +106 -106
  19. package/dist/runtime/host-result-builder.d.ts +13 -13
  20. package/dist/runtime/permission-grant-schema.d.ts +7 -7
  21. package/dist/runtime/runtime-result.d.ts +26 -26
  22. package/dist/sequencer/create-sequencer-storage.d.ts +4 -4
  23. package/dist/sequencer/create-state-processor.d.ts +4 -4
  24. package/dist/sequencer/sequence-topic.d.ts +1 -1
  25. package/dist/stream/stream-declaration.d.ts +34 -34
  26. package/dist/tsbuild.info +1 -1
  27. package/dist/utils/combine-abort-signal.js.map +1 -1
  28. package/dist/worker/create-stream-worker.d.ts +2 -2
  29. package/package.json +1 -1
  30. package/dist/lock/exclusive-lock.d.ts +0 -4
  31. package/dist/lock/exclusive-lock.js +0 -8
  32. package/dist/lock/exclusive-lock.js.map +0 -1
  33. package/dist/management/managed-permission-denied-error.d.ts +0 -50
  34. package/dist/management/managed-permission-denied-error.js +0 -26
  35. package/dist/management/managed-permission-denied-error.js.map +0 -1
  36. package/dist/processing/create-event-processor.d.ts +0 -23
  37. package/dist/processing/create-event-processor.js +0 -133
  38. package/dist/processing/create-event-processor.js.map +0 -1
  39. package/dist/processing/create-event-processor.test.d.ts +0 -1
  40. package/dist/processing/create-event-processor.test.js +0 -218
  41. package/dist/processing/create-event-processor.test.js.map +0 -1
  42. package/dist/processing/event-processing-topic.d.ts +0 -5
  43. package/dist/processing/event-processing-topic.js +0 -13
  44. package/dist/processing/event-processing-topic.js.map +0 -1
  45. package/dist/processing/select-event-shard.d.ts +0 -1
  46. package/dist/processing/select-event-shard.js +0 -14
  47. package/dist/processing/select-event-shard.js.map +0 -1
  48. package/dist/processing/sequencer-cache-key.d.ts +0 -2
  49. package/dist/processing/sequencer-cache-key.js +0 -13
  50. package/dist/processing/sequencer-cache-key.js.map +0 -1
  51. package/dist/tmp-typetest.d.ts +0 -1
  52. package/dist/tmp-typetest.js +0 -3
  53. package/dist/tmp-typetest.js.map +0 -1
  54. package/dist/tracer/create-noop-telemetry.d.ts +0 -2
  55. package/dist/tracer/create-noop-telemetry.js +0 -22
  56. package/dist/tracer/create-noop-telemetry.js.map +0 -1
  57. package/dist/tracer/create-tracer.d.ts +0 -2
  58. package/dist/tracer/create-tracer.js +0 -15
  59. package/dist/tracer/create-tracer.js.map +0 -1
  60. package/dist/utils/lru-cache.d.ts +0 -11
  61. package/dist/utils/lru-cache.js +0 -44
  62. package/dist/utils/lru-cache.js.map +0 -1
  63. package/dist/worker/create-stream-wroker.test.d.ts +0 -0
  64. package/dist/worker/create-stream-wroker.test.js +0 -2
  65. package/dist/worker/create-stream-wroker.test.js.map +0 -1
  66. package/dist/worker/process-pending-events.d.ts +0 -20
  67. package/dist/worker/process-pending-events.js +0 -106
  68. package/dist/worker/process-pending-events.js.map +0 -1
@@ -9,106 +9,137 @@ export declare const UploadVersionEvent: import("../../event-store/event-declara
9
9
  type: "secret";
10
10
  name: string;
11
11
  };
12
- issuer: string;
13
12
  algorithm: "HS256";
13
+ issuer: string;
14
14
  audience: string;
15
15
  expirationTime: string;
16
16
  } | {
17
- type: "token";
18
- token: {
19
- url: string;
20
- formData: {
21
- [key: string]: string;
17
+ type: "openid";
18
+ jwt: {
19
+ type: "jwt";
20
+ secret: string | {
21
+ type: "secret";
22
+ name: string;
22
23
  };
23
- tokenAttributes: string[] | undefined;
24
+ algorithm: "HS256";
25
+ issuer: string;
26
+ audience: string;
27
+ expirationTime: string;
24
28
  };
25
- clientId: string;
26
- issuer: string;
29
+ issuer: string | string[];
30
+ audience: string | string[] | undefined;
31
+ clientId: string | undefined;
27
32
  clientSecret: string | {
28
33
  type: "secret";
29
34
  name: string;
35
+ } | undefined;
36
+ jwks: {
37
+ url: string;
38
+ subKey: string;
30
39
  };
40
+ token: {
41
+ url: string;
42
+ formData: {
43
+ [key: string]: string;
44
+ };
45
+ tokenAttributes: string[] | undefined;
46
+ } | undefined;
31
47
  authorize: {
32
48
  url: string;
33
49
  queryParams: {
34
50
  [key: string]: string;
35
51
  };
36
- };
52
+ } | undefined;
37
53
  deviceCode: {
38
54
  clientSecret: boolean;
39
55
  verificationUriName: string;
40
56
  codeUrl: string;
41
57
  grantType: string;
42
58
  scope: string | undefined;
43
- };
44
- user: {
45
- url: string;
46
- tokenAttributes: string[] | undefined;
47
- };
59
+ } | undefined;
60
+ } | {
61
+ type: "token";
48
62
  jwt: {
49
63
  type: "jwt";
50
64
  secret: string | {
51
65
  type: "secret";
52
66
  name: string;
53
67
  };
54
- issuer: string;
55
68
  algorithm: "HS256";
69
+ issuer: string;
56
70
  audience: string;
57
71
  expirationTime: string;
58
72
  };
59
- } | {
60
- type: "openid";
73
+ issuer: string;
74
+ clientId: string;
75
+ clientSecret: string | {
76
+ type: "secret";
77
+ name: string;
78
+ };
61
79
  token: {
62
80
  url: string;
63
81
  formData: {
64
82
  [key: string]: string;
65
83
  };
66
84
  tokenAttributes: string[] | undefined;
67
- } | undefined;
68
- clientId: string | undefined;
69
- issuer: string | string[];
70
- clientSecret: string | {
71
- type: "secret";
72
- name: string;
73
- } | undefined;
85
+ };
74
86
  authorize: {
75
87
  url: string;
76
88
  queryParams: {
77
89
  [key: string]: string;
78
90
  };
79
- } | undefined;
91
+ };
80
92
  deviceCode: {
81
93
  clientSecret: boolean;
82
94
  verificationUriName: string;
83
95
  codeUrl: string;
84
96
  grantType: string;
85
97
  scope: string | undefined;
86
- } | undefined;
87
- jwt: {
88
- type: "jwt";
89
- secret: string | {
90
- type: "secret";
91
- name: string;
92
- };
93
- issuer: string;
94
- algorithm: "HS256";
95
- audience: string;
96
- expirationTime: string;
97
98
  };
98
- audience: string | string[] | undefined;
99
- jwks: {
99
+ user: {
100
100
  url: string;
101
- subKey: string;
101
+ tokenAttributes: string[] | undefined;
102
102
  };
103
103
  };
104
104
  }>;
105
105
  streams: import("../../typing/array-type-description.js").ArrayTypeDescription<{
106
- realm: string;
107
106
  auth: {
108
107
  allowAnonymous: boolean;
109
108
  };
109
+ outputs: {
110
+ [key: string]: {
111
+ schema: {
112
+ schemas: {
113
+ [key: string]: import("../../json-schema/json-schema.js").JsonSchema;
114
+ };
115
+ mainSchema: import("../../json-schema/json-schema.js").JsonSchema;
116
+ };
117
+ };
118
+ };
119
+ realm: string;
110
120
  pattern: string;
111
121
  version: string;
122
+ runtime: {
123
+ source: string;
124
+ exportName: string;
125
+ };
126
+ states: {
127
+ [key: string]: {
128
+ key: string[];
129
+ indices: {
130
+ [key: string]: {
131
+ fields: string[];
132
+ unique: boolean;
133
+ };
134
+ };
135
+ schema: {
136
+ schemas: {
137
+ [key: string]: import("../../json-schema/json-schema.js").JsonSchema;
138
+ };
139
+ mainSchema: import("../../json-schema/json-schema.js").JsonSchema;
140
+ };
141
+ };
142
+ };
112
143
  events: {
113
144
  [key: string]: {
114
145
  schema: {
@@ -121,31 +152,29 @@ export declare const UploadVersionEvent: import("../../event-store/event-declara
121
152
  };
122
153
  stateGrant: {
123
154
  state: string;
124
- methods: ("get" | "range" | "observe" | "iterate" | "observeRange")[];
125
155
  filters: {
126
- field: string;
127
156
  value: string;
157
+ field: string;
128
158
  }[];
129
159
  access: "read" | "write";
160
+ methods: ("get" | "range" | "observe" | "iterate" | "observeRange")[];
130
161
  }[];
131
162
  eventGrant: {
132
163
  event: string;
133
164
  filters: {
134
- field: string;
135
165
  value: string;
166
+ field: string;
136
167
  }[];
137
168
  access: "read" | "write";
138
169
  }[];
139
- outputs: {
140
- [key: string]: {
141
- schema: {
142
- schemas: {
143
- [key: string]: import("../../json-schema/json-schema.js").JsonSchema;
144
- };
145
- mainSchema: import("../../json-schema/json-schema.js").JsonSchema;
146
- };
147
- };
170
+ }>;
171
+ aggregations: import("../../typing/array-type-description.js").ArrayTypeDescription<{
172
+ auth: {
173
+ allowAnonymous: boolean;
148
174
  };
175
+ realm: string;
176
+ pattern: string;
177
+ version: string;
149
178
  runtime: {
150
179
  source: string;
151
180
  exportName: string;
@@ -153,28 +182,20 @@ export declare const UploadVersionEvent: import("../../event-store/event-declara
153
182
  states: {
154
183
  [key: string]: {
155
184
  key: string[];
156
- schema: {
157
- schemas: {
158
- [key: string]: import("../../json-schema/json-schema.js").JsonSchema;
159
- };
160
- mainSchema: import("../../json-schema/json-schema.js").JsonSchema;
161
- };
162
185
  indices: {
163
186
  [key: string]: {
164
187
  fields: string[];
165
188
  unique: boolean;
166
189
  };
167
190
  };
191
+ schema: {
192
+ schemas: {
193
+ [key: string]: import("../../json-schema/json-schema.js").JsonSchema;
194
+ };
195
+ mainSchema: import("../../json-schema/json-schema.js").JsonSchema;
196
+ };
168
197
  };
169
198
  };
170
- }>;
171
- aggregations: import("../../typing/array-type-description.js").ArrayTypeDescription<{
172
- realm: string;
173
- auth: {
174
- allowAnonymous: boolean;
175
- };
176
- pattern: string;
177
- version: string;
178
199
  events: {
179
200
  [key: string]: {
180
201
  schema: {
@@ -183,13 +204,12 @@ export declare const UploadVersionEvent: import("../../event-store/event-declara
183
204
  };
184
205
  mainSchema: import("../../json-schema/json-schema.js").JsonSchema;
185
206
  };
186
- output: string;
207
+ event: string;
187
208
  stream: {
188
209
  pattern: string;
189
210
  version: string;
190
211
  };
191
212
  } | {
192
- event: string;
193
213
  schema: {
194
214
  schemas: {
195
215
  [key: string]: import("../../json-schema/json-schema.js").JsonSchema;
@@ -200,46 +220,26 @@ export declare const UploadVersionEvent: import("../../event-store/event-declara
200
220
  pattern: string;
201
221
  version: string;
202
222
  };
223
+ output: string;
203
224
  };
204
225
  };
205
226
  stateGrant: {
206
227
  state: string;
207
- methods: ("get" | "range" | "observe" | "iterate" | "observeRange")[];
208
228
  filters: {
209
- field: string;
210
229
  value: string;
230
+ field: string;
211
231
  }[];
212
232
  access: "read" | "write";
233
+ methods: ("get" | "range" | "observe" | "iterate" | "observeRange")[];
213
234
  }[];
214
235
  eventGrant: {
215
236
  event: string;
216
237
  filters: {
217
- field: string;
218
238
  value: string;
239
+ field: string;
219
240
  }[];
220
241
  access: "read" | "write";
221
242
  }[];
222
- runtime: {
223
- source: string;
224
- exportName: string;
225
- };
226
- states: {
227
- [key: string]: {
228
- key: string[];
229
- schema: {
230
- schemas: {
231
- [key: string]: import("../../json-schema/json-schema.js").JsonSchema;
232
- };
233
- mainSchema: import("../../json-schema/json-schema.js").JsonSchema;
234
- };
235
- indices: {
236
- [key: string]: {
237
- fields: string[];
238
- unique: boolean;
239
- };
240
- };
241
- };
242
- };
243
243
  }>;
244
244
  }>> & {
245
245
  key: "upload-definition";
@@ -262,106 +262,137 @@ export declare const RegistryEvents: {
262
262
  type: "secret";
263
263
  name: string;
264
264
  };
265
- issuer: string;
266
265
  algorithm: "HS256";
266
+ issuer: string;
267
267
  audience: string;
268
268
  expirationTime: string;
269
269
  } | {
270
- type: "token";
271
- token: {
272
- url: string;
273
- formData: {
274
- [key: string]: string;
270
+ type: "openid";
271
+ jwt: {
272
+ type: "jwt";
273
+ secret: string | {
274
+ type: "secret";
275
+ name: string;
275
276
  };
276
- tokenAttributes: string[] | undefined;
277
+ algorithm: "HS256";
278
+ issuer: string;
279
+ audience: string;
280
+ expirationTime: string;
277
281
  };
278
- clientId: string;
279
- issuer: string;
282
+ issuer: string | string[];
283
+ audience: string | string[] | undefined;
284
+ clientId: string | undefined;
280
285
  clientSecret: string | {
281
286
  type: "secret";
282
287
  name: string;
288
+ } | undefined;
289
+ jwks: {
290
+ url: string;
291
+ subKey: string;
283
292
  };
293
+ token: {
294
+ url: string;
295
+ formData: {
296
+ [key: string]: string;
297
+ };
298
+ tokenAttributes: string[] | undefined;
299
+ } | undefined;
284
300
  authorize: {
285
301
  url: string;
286
302
  queryParams: {
287
303
  [key: string]: string;
288
304
  };
289
- };
305
+ } | undefined;
290
306
  deviceCode: {
291
307
  clientSecret: boolean;
292
308
  verificationUriName: string;
293
309
  codeUrl: string;
294
310
  grantType: string;
295
311
  scope: string | undefined;
296
- };
297
- user: {
298
- url: string;
299
- tokenAttributes: string[] | undefined;
300
- };
312
+ } | undefined;
313
+ } | {
314
+ type: "token";
301
315
  jwt: {
302
316
  type: "jwt";
303
317
  secret: string | {
304
318
  type: "secret";
305
319
  name: string;
306
320
  };
307
- issuer: string;
308
321
  algorithm: "HS256";
322
+ issuer: string;
309
323
  audience: string;
310
324
  expirationTime: string;
311
325
  };
312
- } | {
313
- type: "openid";
326
+ issuer: string;
327
+ clientId: string;
328
+ clientSecret: string | {
329
+ type: "secret";
330
+ name: string;
331
+ };
314
332
  token: {
315
333
  url: string;
316
334
  formData: {
317
335
  [key: string]: string;
318
336
  };
319
337
  tokenAttributes: string[] | undefined;
320
- } | undefined;
321
- clientId: string | undefined;
322
- issuer: string | string[];
323
- clientSecret: string | {
324
- type: "secret";
325
- name: string;
326
- } | undefined;
338
+ };
327
339
  authorize: {
328
340
  url: string;
329
341
  queryParams: {
330
342
  [key: string]: string;
331
343
  };
332
- } | undefined;
344
+ };
333
345
  deviceCode: {
334
346
  clientSecret: boolean;
335
347
  verificationUriName: string;
336
348
  codeUrl: string;
337
349
  grantType: string;
338
350
  scope: string | undefined;
339
- } | undefined;
340
- jwt: {
341
- type: "jwt";
342
- secret: string | {
343
- type: "secret";
344
- name: string;
345
- };
346
- issuer: string;
347
- algorithm: "HS256";
348
- audience: string;
349
- expirationTime: string;
350
351
  };
351
- audience: string | string[] | undefined;
352
- jwks: {
352
+ user: {
353
353
  url: string;
354
- subKey: string;
354
+ tokenAttributes: string[] | undefined;
355
355
  };
356
356
  };
357
357
  }>;
358
358
  streams: import("../../typing/array-type-description.js").ArrayTypeDescription<{
359
- realm: string;
360
359
  auth: {
361
360
  allowAnonymous: boolean;
362
361
  };
362
+ outputs: {
363
+ [key: string]: {
364
+ schema: {
365
+ schemas: {
366
+ [key: string]: import("../../json-schema/json-schema.js").JsonSchema;
367
+ };
368
+ mainSchema: import("../../json-schema/json-schema.js").JsonSchema;
369
+ };
370
+ };
371
+ };
372
+ realm: string;
363
373
  pattern: string;
364
374
  version: string;
375
+ runtime: {
376
+ source: string;
377
+ exportName: string;
378
+ };
379
+ states: {
380
+ [key: string]: {
381
+ key: string[];
382
+ indices: {
383
+ [key: string]: {
384
+ fields: string[];
385
+ unique: boolean;
386
+ };
387
+ };
388
+ schema: {
389
+ schemas: {
390
+ [key: string]: import("../../json-schema/json-schema.js").JsonSchema;
391
+ };
392
+ mainSchema: import("../../json-schema/json-schema.js").JsonSchema;
393
+ };
394
+ };
395
+ };
365
396
  events: {
366
397
  [key: string]: {
367
398
  schema: {
@@ -374,31 +405,29 @@ export declare const RegistryEvents: {
374
405
  };
375
406
  stateGrant: {
376
407
  state: string;
377
- methods: ("get" | "range" | "observe" | "iterate" | "observeRange")[];
378
408
  filters: {
379
- field: string;
380
409
  value: string;
410
+ field: string;
381
411
  }[];
382
412
  access: "read" | "write";
413
+ methods: ("get" | "range" | "observe" | "iterate" | "observeRange")[];
383
414
  }[];
384
415
  eventGrant: {
385
416
  event: string;
386
417
  filters: {
387
- field: string;
388
418
  value: string;
419
+ field: string;
389
420
  }[];
390
421
  access: "read" | "write";
391
422
  }[];
392
- outputs: {
393
- [key: string]: {
394
- schema: {
395
- schemas: {
396
- [key: string]: import("../../json-schema/json-schema.js").JsonSchema;
397
- };
398
- mainSchema: import("../../json-schema/json-schema.js").JsonSchema;
399
- };
400
- };
423
+ }>;
424
+ aggregations: import("../../typing/array-type-description.js").ArrayTypeDescription<{
425
+ auth: {
426
+ allowAnonymous: boolean;
401
427
  };
428
+ realm: string;
429
+ pattern: string;
430
+ version: string;
402
431
  runtime: {
403
432
  source: string;
404
433
  exportName: string;
@@ -406,28 +435,20 @@ export declare const RegistryEvents: {
406
435
  states: {
407
436
  [key: string]: {
408
437
  key: string[];
409
- schema: {
410
- schemas: {
411
- [key: string]: import("../../json-schema/json-schema.js").JsonSchema;
412
- };
413
- mainSchema: import("../../json-schema/json-schema.js").JsonSchema;
414
- };
415
438
  indices: {
416
439
  [key: string]: {
417
440
  fields: string[];
418
441
  unique: boolean;
419
442
  };
420
443
  };
444
+ schema: {
445
+ schemas: {
446
+ [key: string]: import("../../json-schema/json-schema.js").JsonSchema;
447
+ };
448
+ mainSchema: import("../../json-schema/json-schema.js").JsonSchema;
449
+ };
421
450
  };
422
451
  };
423
- }>;
424
- aggregations: import("../../typing/array-type-description.js").ArrayTypeDescription<{
425
- realm: string;
426
- auth: {
427
- allowAnonymous: boolean;
428
- };
429
- pattern: string;
430
- version: string;
431
452
  events: {
432
453
  [key: string]: {
433
454
  schema: {
@@ -436,13 +457,12 @@ export declare const RegistryEvents: {
436
457
  };
437
458
  mainSchema: import("../../json-schema/json-schema.js").JsonSchema;
438
459
  };
439
- output: string;
460
+ event: string;
440
461
  stream: {
441
462
  pattern: string;
442
463
  version: string;
443
464
  };
444
465
  } | {
445
- event: string;
446
466
  schema: {
447
467
  schemas: {
448
468
  [key: string]: import("../../json-schema/json-schema.js").JsonSchema;
@@ -453,46 +473,26 @@ export declare const RegistryEvents: {
453
473
  pattern: string;
454
474
  version: string;
455
475
  };
476
+ output: string;
456
477
  };
457
478
  };
458
479
  stateGrant: {
459
480
  state: string;
460
- methods: ("get" | "range" | "observe" | "iterate" | "observeRange")[];
461
481
  filters: {
462
- field: string;
463
482
  value: string;
483
+ field: string;
464
484
  }[];
465
485
  access: "read" | "write";
486
+ methods: ("get" | "range" | "observe" | "iterate" | "observeRange")[];
466
487
  }[];
467
488
  eventGrant: {
468
489
  event: string;
469
490
  filters: {
470
- field: string;
471
491
  value: string;
492
+ field: string;
472
493
  }[];
473
494
  access: "read" | "write";
474
495
  }[];
475
- runtime: {
476
- source: string;
477
- exportName: string;
478
- };
479
- states: {
480
- [key: string]: {
481
- key: string[];
482
- schema: {
483
- schemas: {
484
- [key: string]: import("../../json-schema/json-schema.js").JsonSchema;
485
- };
486
- mainSchema: import("../../json-schema/json-schema.js").JsonSchema;
487
- };
488
- indices: {
489
- [key: string]: {
490
- fields: string[];
491
- unique: boolean;
492
- };
493
- };
494
- };
495
- };
496
496
  }>;
497
497
  }>> & {
498
498
  key: "upload-definition";