@rotorsoft/act 0.25.0 → 0.25.2
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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/adapters/InMemoryStore.d.ts.map +1 -1
- package/dist/@types/types/action.d.ts +2 -1
- package/dist/@types/types/action.d.ts.map +1 -1
- package/dist/@types/types/ports.d.ts +73 -73
- package/dist/@types/types/ports.d.ts.map +1 -1
- package/dist/@types/types/schemas.d.ts +1 -0
- package/dist/@types/types/schemas.d.ts.map +1 -1
- package/dist/index.cjs +8 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,32 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { Committed, EventMeta, Message, Query, Schema, Schemas } from "./action.js";
|
|
8
8
|
import type { Lease } from "./reaction.js";
|
|
9
|
-
/**
|
|
10
|
-
* A cached snapshot entry for a stream.
|
|
11
|
-
*
|
|
12
|
-
* @template TState - The state schema type
|
|
13
|
-
*/
|
|
14
|
-
export interface CacheEntry<TState extends Schema> {
|
|
15
|
-
readonly state: TState;
|
|
16
|
-
readonly version: number;
|
|
17
|
-
readonly event_id: number;
|
|
18
|
-
readonly patches: number;
|
|
19
|
-
readonly snaps: number;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Cache port for storing stream snapshots in-process.
|
|
23
|
-
*
|
|
24
|
-
* Implementations should provide fast key-value access with bounded memory.
|
|
25
|
-
* The async interface is forward-compatible with external caches (e.g., Redis).
|
|
26
|
-
*
|
|
27
|
-
* @template TState - The state schema type
|
|
28
|
-
*/
|
|
29
|
-
export interface Cache extends Disposable {
|
|
30
|
-
get<TState extends Schema>(stream: string): Promise<CacheEntry<TState> | undefined>;
|
|
31
|
-
set<TState extends Schema>(stream: string, entry: CacheEntry<TState>): Promise<void>;
|
|
32
|
-
invalidate(stream: string): Promise<void>;
|
|
33
|
-
clear(): Promise<void>;
|
|
34
|
-
}
|
|
35
9
|
/**
|
|
36
10
|
* A function that disposes of a resource asynchronously.
|
|
37
11
|
* @returns Promise that resolves when disposal is complete.
|
|
@@ -43,6 +17,34 @@ export type Disposer = () => Promise<void>;
|
|
|
43
17
|
export type Disposable = {
|
|
44
18
|
dispose: Disposer;
|
|
45
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Minimal logger port compatible with pino, winston, bunyan, and console.
|
|
22
|
+
*
|
|
23
|
+
* Each log method accepts either:
|
|
24
|
+
* - `(msg: string)` — plain message
|
|
25
|
+
* - `(obj: unknown, msg?: string)` — structured data with optional message
|
|
26
|
+
*
|
|
27
|
+
* Implementations should respect `level` to gate output.
|
|
28
|
+
*
|
|
29
|
+
* @see {@link ConsoleLogger} for the default implementation
|
|
30
|
+
* @see {@link https://www.npmjs.com/package/@rotorsoft/act-pino | @rotorsoft/act-pino} for the Pino adapter
|
|
31
|
+
*/
|
|
32
|
+
export interface Logger extends Disposable {
|
|
33
|
+
level: string;
|
|
34
|
+
fatal(obj: unknown, msg?: string): void;
|
|
35
|
+
fatal(msg: string): void;
|
|
36
|
+
error(obj: unknown, msg?: string): void;
|
|
37
|
+
error(msg: string): void;
|
|
38
|
+
warn(obj: unknown, msg?: string): void;
|
|
39
|
+
warn(msg: string): void;
|
|
40
|
+
info(obj: unknown, msg?: string): void;
|
|
41
|
+
info(msg: string): void;
|
|
42
|
+
debug(obj: unknown, msg?: string): void;
|
|
43
|
+
debug(msg: string): void;
|
|
44
|
+
trace(obj: unknown, msg?: string): void;
|
|
45
|
+
trace(msg: string): void;
|
|
46
|
+
child(bindings: Record<string, unknown>): Logger;
|
|
47
|
+
}
|
|
46
48
|
/**
|
|
47
49
|
* Interface for event store implementations.
|
|
48
50
|
*
|
|
@@ -78,34 +80,6 @@ export type Disposable = {
|
|
|
78
80
|
* @see {@link InMemoryStore} for the default implementation
|
|
79
81
|
* @see {@link PostgresStore} for the PostgreSQL implementation
|
|
80
82
|
*/
|
|
81
|
-
/**
|
|
82
|
-
* Minimal logger port compatible with pino, winston, bunyan, and console.
|
|
83
|
-
*
|
|
84
|
-
* Each log method accepts either:
|
|
85
|
-
* - `(msg: string)` — plain message
|
|
86
|
-
* - `(obj: unknown, msg?: string)` — structured data with optional message
|
|
87
|
-
*
|
|
88
|
-
* Implementations should respect `level` to gate output.
|
|
89
|
-
*
|
|
90
|
-
* @see {@link ConsoleLogger} for the default implementation
|
|
91
|
-
* @see {@link https://www.npmjs.com/package/@rotorsoft/act-pino | @rotorsoft/act-pino} for the Pino adapter
|
|
92
|
-
*/
|
|
93
|
-
export interface Logger extends Disposable {
|
|
94
|
-
level: string;
|
|
95
|
-
fatal(obj: unknown, msg?: string): void;
|
|
96
|
-
fatal(msg: string): void;
|
|
97
|
-
error(obj: unknown, msg?: string): void;
|
|
98
|
-
error(msg: string): void;
|
|
99
|
-
warn(obj: unknown, msg?: string): void;
|
|
100
|
-
warn(msg: string): void;
|
|
101
|
-
info(obj: unknown, msg?: string): void;
|
|
102
|
-
info(msg: string): void;
|
|
103
|
-
debug(obj: unknown, msg?: string): void;
|
|
104
|
-
debug(msg: string): void;
|
|
105
|
-
trace(obj: unknown, msg?: string): void;
|
|
106
|
-
trace(msg: string): void;
|
|
107
|
-
child(bindings: Record<string, unknown>): Logger;
|
|
108
|
-
}
|
|
109
83
|
export interface Store extends Disposable {
|
|
110
84
|
/**
|
|
111
85
|
* Initializes or resets the store.
|
|
@@ -197,25 +171,6 @@ export interface Store extends Disposable {
|
|
|
197
171
|
* ```
|
|
198
172
|
*/
|
|
199
173
|
query: <E extends Schemas>(callback: (event: Committed<E, keyof E>) => void, query?: Query) => Promise<number>;
|
|
200
|
-
/**
|
|
201
|
-
* Acknowledges successful processing of leased streams.
|
|
202
|
-
*
|
|
203
|
-
* Updates the watermark to indicate events have been processed successfully.
|
|
204
|
-
* Releases the lease so other workers can process subsequent events.
|
|
205
|
-
*
|
|
206
|
-
* @param leases - Leases to acknowledge with updated watermarks
|
|
207
|
-
* @returns Acknowledged leases
|
|
208
|
-
*
|
|
209
|
-
* @example
|
|
210
|
-
* ```typescript
|
|
211
|
-
* const leased = await store().claim(5, 5, randomUUID(), 10000);
|
|
212
|
-
* // Process events up to ID 150
|
|
213
|
-
* await store().ack(leased.map(l => ({ ...l, at: 150 })));
|
|
214
|
-
* ```
|
|
215
|
-
*
|
|
216
|
-
* @see {@link claim} for acquiring leases
|
|
217
|
-
*/
|
|
218
|
-
ack: (leases: Lease[]) => Promise<Lease[]>;
|
|
219
174
|
/**
|
|
220
175
|
* Atomically discovers and leases streams for reaction processing.
|
|
221
176
|
*
|
|
@@ -276,6 +231,25 @@ export interface Store extends Disposable {
|
|
|
276
231
|
subscribed: number;
|
|
277
232
|
watermark: number;
|
|
278
233
|
}>;
|
|
234
|
+
/**
|
|
235
|
+
* Acknowledges successful processing of leased streams.
|
|
236
|
+
*
|
|
237
|
+
* Updates the watermark to indicate events have been processed successfully.
|
|
238
|
+
* Releases the lease so other workers can process subsequent events.
|
|
239
|
+
*
|
|
240
|
+
* @param leases - Leases to acknowledge with updated watermarks
|
|
241
|
+
* @returns Acknowledged leases
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* const leased = await store().claim(5, 5, randomUUID(), 10000);
|
|
246
|
+
* // Process events up to ID 150
|
|
247
|
+
* await store().ack(leased.map(l => ({ ...l, at: 150 })));
|
|
248
|
+
* ```
|
|
249
|
+
*
|
|
250
|
+
* @see {@link claim} for acquiring leases
|
|
251
|
+
*/
|
|
252
|
+
ack: (leases: Lease[]) => Promise<Lease[]>;
|
|
279
253
|
/**
|
|
280
254
|
* Blocks streams after persistent processing failures.
|
|
281
255
|
*
|
|
@@ -313,4 +287,30 @@ export interface Store extends Disposable {
|
|
|
313
287
|
error: string;
|
|
314
288
|
}>>;
|
|
315
289
|
}
|
|
290
|
+
/**
|
|
291
|
+
* A cached snapshot entry for a stream.
|
|
292
|
+
*
|
|
293
|
+
* @template TState - The state schema type
|
|
294
|
+
*/
|
|
295
|
+
export interface CacheEntry<TState extends Schema> {
|
|
296
|
+
readonly state: TState;
|
|
297
|
+
readonly version: number;
|
|
298
|
+
readonly event_id: number;
|
|
299
|
+
readonly patches: number;
|
|
300
|
+
readonly snaps: number;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Cache port for storing stream snapshots in-process.
|
|
304
|
+
*
|
|
305
|
+
* Implementations should provide fast key-value access with bounded memory.
|
|
306
|
+
* The async interface is forward-compatible with external caches (e.g., Redis).
|
|
307
|
+
*
|
|
308
|
+
* @template TState - The state schema type
|
|
309
|
+
*/
|
|
310
|
+
export interface Cache extends Disposable {
|
|
311
|
+
get<TState extends Schema>(stream: string): Promise<CacheEntry<TState> | undefined>;
|
|
312
|
+
set<TState extends Schema>(stream: string, entry: CacheEntry<TState>): Promise<void>;
|
|
313
|
+
invalidate(stream: string): Promise<void>;
|
|
314
|
+
clear(): Promise<void>;
|
|
315
|
+
}
|
|
316
316
|
//# sourceMappingURL=ports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../../src/types/ports.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,OAAO,EACP,KAAK,EACL,MAAM,EACN,OAAO,EACR,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../../src/types/ports.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,OAAO,EACP,KAAK,EACL,MAAM,EACN,OAAO,EACR,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C;;;GAGG;AACH,MAA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AAC,MAAM,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,KAAK,EAAE,CACL,MAAM,EAAE,KAAK,CAAC,KAAK,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,KACrC,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;CAChD;AAMD;;;;GAIG;AACH,MAAM,WAAW,UAAU,CAAC,MAAM,SAAS,MAAM;IAC/C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,KAAM,SAAQ,UAAU;IACvC,GAAG,CAAC,MAAM,SAAS,MAAM,EACvB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC;IAC3C,GAAG,CAAC,MAAM,SAAS,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,GACxB,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
|
|
@@ -112,5 +112,6 @@ export declare const QuerySchema: z.ZodReadonly<z.ZodObject<{
|
|
|
112
112
|
backward: z.ZodOptional<z.ZodBoolean>;
|
|
113
113
|
correlation: z.ZodOptional<z.ZodString>;
|
|
114
114
|
with_snaps: z.ZodOptional<z.ZodBoolean>;
|
|
115
|
+
stream_exact: z.ZodOptional<z.ZodBoolean>;
|
|
115
116
|
}, z.core.$strip>>;
|
|
116
117
|
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/types/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAEhD;;;;;GAKG;AAEH;;GAEG;AACH,eAAO,MAAM,QAAQ,sCAAkC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,WAAW;;;kBAMX,CAAC;AAEd;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;kBAOZ,CAAC;AAEd;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;iBAI/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;kBAQf,CAAC;AAEd;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;kBAQnB,CAAC;AAEd;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,OAAO,QAAQ,CAAC,CAAC;IACjE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,OAAO,QAAQ,CAAC,CAAC;IAClE,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CAC/B,CAAC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/types/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAEhD;;;;;GAKG;AAEH;;GAEG;AACH,eAAO,MAAM,QAAQ,sCAAkC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,WAAW;;;kBAMX,CAAC;AAEd;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;kBAOZ,CAAC;AAEd;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;iBAI/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;kBAQf,CAAC;AAEd;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;kBAQnB,CAAC;AAEd;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,OAAO,QAAQ,CAAC,CAAC;IACjE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,OAAO,QAAQ,CAAC,CAAC;IAClE,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CAC/B,CAAC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;kBAcX,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -295,7 +295,8 @@ var QuerySchema = import_zod.z.object({
|
|
|
295
295
|
created_after: import_zod.z.date().optional(),
|
|
296
296
|
backward: import_zod.z.boolean().optional(),
|
|
297
297
|
correlation: import_zod.z.string().optional(),
|
|
298
|
-
with_snaps: import_zod.z.boolean().optional()
|
|
298
|
+
with_snaps: import_zod.z.boolean().optional(),
|
|
299
|
+
stream_exact: import_zod.z.boolean().optional()
|
|
299
300
|
}).readonly();
|
|
300
301
|
|
|
301
302
|
// src/types/index.ts
|
|
@@ -476,8 +477,11 @@ var InMemoryStore = class {
|
|
|
476
477
|
this._streams = /* @__PURE__ */ new Map();
|
|
477
478
|
}
|
|
478
479
|
in_query(query, e) {
|
|
479
|
-
if (query.stream
|
|
480
|
-
|
|
480
|
+
if (query.stream) {
|
|
481
|
+
if (query.stream_exact) {
|
|
482
|
+
if (e.stream !== query.stream) return false;
|
|
483
|
+
} else if (!RegExp(`^${query.stream}$`).test(e.stream)) return false;
|
|
484
|
+
}
|
|
481
485
|
if (query.names && !query.names.includes(e.name)) return false;
|
|
482
486
|
if (query.correlation && e.meta?.correlation !== query.correlation)
|
|
483
487
|
return false;
|
|
@@ -800,7 +804,7 @@ async function load(me, stream, callback) {
|
|
|
800
804
|
}
|
|
801
805
|
callback && callback({ event, state: state2, patches, snaps });
|
|
802
806
|
},
|
|
803
|
-
{ stream, with_snaps: !cached, after: cached?.event_id }
|
|
807
|
+
{ stream, with_snaps: !cached, after: cached?.event_id, stream_exact: true }
|
|
804
808
|
);
|
|
805
809
|
logger2.trace(
|
|
806
810
|
state2,
|