@graphrefly/graphrefly 0.46.0 → 0.47.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.
- package/dist/base/composition/index.cjs +69 -15
- package/dist/base/composition/index.cjs.map +1 -1
- package/dist/base/composition/index.d.cts +1 -2
- package/dist/base/composition/index.d.ts +1 -2
- package/dist/base/composition/index.js +1 -1
- package/dist/base/index.cjs +69 -15
- package/dist/base/index.cjs.map +1 -1
- package/dist/base/index.d.cts +1 -2
- package/dist/base/index.d.ts +1 -2
- package/dist/base/index.js +1 -1
- package/dist/{chunk-WKSWLSCX.js → chunk-22SG74BD.js} +2 -2
- package/dist/{chunk-OO5BM6CJ.js → chunk-5IMMNARC.js} +2 -2
- package/dist/{chunk-KIIXR252.js → chunk-EHRRQ4IC.js} +2 -2
- package/dist/{chunk-HULCUY35.js → chunk-GWRNLJNW.js} +2 -2
- package/dist/{chunk-5THCXDWY.js → chunk-JKTC747G.js} +2 -2
- package/dist/{chunk-RGL53X5G.js → chunk-TNX5ZGDJ.js} +3 -3
- package/dist/{chunk-LBAJK24K.js → chunk-VLAGJZSL.js} +11 -3
- package/dist/chunk-VLAGJZSL.js.map +1 -0
- package/dist/chunk-Z65DVDEQ.js +146 -0
- package/dist/chunk-Z65DVDEQ.js.map +1 -0
- package/dist/{chunk-GBCENOLN.js → chunk-ZT4WMQW4.js} +3 -3
- package/dist/{chunk-FR6RGA3B.js → chunk-ZVXXDWIB.js} +19 -14
- package/dist/{chunk-FR6RGA3B.js.map → chunk-ZVXXDWIB.js.map} +1 -1
- package/dist/compat/index.cjs +156 -93
- package/dist/compat/index.cjs.map +1 -1
- package/dist/compat/index.d.cts +3 -3
- package/dist/compat/index.d.ts +3 -3
- package/dist/compat/index.js +2 -2
- package/dist/compat/nestjs/index.cjs +156 -93
- package/dist/compat/nestjs/index.cjs.map +1 -1
- package/dist/compat/nestjs/index.d.cts +4 -4
- package/dist/compat/nestjs/index.d.ts +4 -4
- package/dist/compat/nestjs/index.js +4 -5
- package/dist/{index-5SU_O78r.d.cts → index-B_p8tnvf.d.cts} +19 -3
- package/dist/{index-CEXCtYYJ.d.ts → index-_HDSmPyp.d.ts} +19 -3
- package/dist/index.cjs +77 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +9 -9
- package/dist/observable-B25XqCbZ.d.cts +59 -0
- package/dist/observable-B25XqCbZ.d.ts +59 -0
- package/dist/presets/ai/index.js +5 -5
- package/dist/presets/harness/index.js +7 -7
- package/dist/presets/index.js +8 -8
- package/dist/solutions/index.js +6 -6
- package/dist/utils/ai/index.js +3 -3
- package/dist/utils/index.cjs +8 -3
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +3 -3
- package/dist/utils/memory/index.cjs +8 -3
- package/dist/utils/memory/index.cjs.map +1 -1
- package/dist/utils/memory/index.d.cts +78 -0
- package/dist/utils/memory/index.d.ts +78 -0
- package/dist/utils/memory/index.js +1 -1
- package/package.json +1 -5
- package/dist/chunk-3QZY5BI7.js +0 -92
- package/dist/chunk-3QZY5BI7.js.map +0 -1
- package/dist/chunk-LBAJK24K.js.map +0 -1
- package/dist/observable-BXQoW1P-.d.cts +0 -36
- package/dist/observable-BXQoW1P-.d.ts +0 -36
- /package/dist/{chunk-WKSWLSCX.js.map → chunk-22SG74BD.js.map} +0 -0
- /package/dist/{chunk-OO5BM6CJ.js.map → chunk-5IMMNARC.js.map} +0 -0
- /package/dist/{chunk-KIIXR252.js.map → chunk-EHRRQ4IC.js.map} +0 -0
- /package/dist/{chunk-HULCUY35.js.map → chunk-GWRNLJNW.js.map} +0 -0
- /package/dist/{chunk-5THCXDWY.js.map → chunk-JKTC747G.js.map} +0 -0
- /package/dist/{chunk-RGL53X5G.js.map → chunk-TNX5ZGDJ.js.map} +0 -0
- /package/dist/{chunk-GBCENOLN.js.map → chunk-ZT4WMQW4.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
import '@graphrefly/pure-ts/core';
|
|
4
|
-
import 'rxjs';
|
|
1
|
+
export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, c as CRON_HANDLERS, d as CommandHandler, e as CommandHandlerMeta, E as EVENT_HANDLERS, f as EventHandler, g as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, h as GRAPHREFLY_ROOT_GRAPH, j as GraphCron, k as GraphCronMeta, l as GraphInterval, m as GraphIntervalMeta, n as GraphReflyCqrsOptions, o as GraphReflyEventExplorer, p as GraphReflyFeatureOptions, q as GraphReflyGuard, r as GraphReflyGuardImpl, s as GraphReflyModule, t as GraphReflyRootOptions, I as INTERVAL_HANDLERS, u as InjectCqrsGraph, v as InjectGraph, w as InjectNode, O as ObserveGateway, x as ObserveGatewayOptions, y as ObserveSSEOptions, z as ObserveSubscriptionOptions, B as ObserveWsCommand, D as ObserveWsMessage, F as OnGraphEvent, H as OnGraphEventMeta, Q as QUERY_HANDLERS, J as QueryHandler, K as QueryHandlerMeta, S as SAGA_HANDLERS, L as SagaHandler, M as SagaHandlerMeta, N as fromHeader, P as fromJwtPayload, R as getActor, T as getGraphToken, U as getNodeToken, V as observeSSE, W as observeSubscription, X as toObservable } from '../../index-B_p8tnvf.cjs';
|
|
2
|
+
export { T as ToObservableOptions } from '../../observable-B25XqCbZ.cjs';
|
|
5
3
|
import '@graphrefly/pure-ts/graph';
|
|
6
4
|
import '@nestjs/common';
|
|
7
5
|
import '@nestjs/core';
|
|
6
|
+
import '@graphrefly/pure-ts/core';
|
|
8
7
|
import '../../utils/cqrs/index.cjs';
|
|
9
8
|
import '@graphrefly/pure-ts/extra';
|
|
10
9
|
import '../../base/mutation/index.cjs';
|
|
10
|
+
import 'rxjs';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
import '@graphrefly/pure-ts/core';
|
|
4
|
-
import 'rxjs';
|
|
1
|
+
export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, c as CRON_HANDLERS, d as CommandHandler, e as CommandHandlerMeta, E as EVENT_HANDLERS, f as EventHandler, g as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, h as GRAPHREFLY_ROOT_GRAPH, j as GraphCron, k as GraphCronMeta, l as GraphInterval, m as GraphIntervalMeta, n as GraphReflyCqrsOptions, o as GraphReflyEventExplorer, p as GraphReflyFeatureOptions, q as GraphReflyGuard, r as GraphReflyGuardImpl, s as GraphReflyModule, t as GraphReflyRootOptions, I as INTERVAL_HANDLERS, u as InjectCqrsGraph, v as InjectGraph, w as InjectNode, O as ObserveGateway, x as ObserveGatewayOptions, y as ObserveSSEOptions, z as ObserveSubscriptionOptions, B as ObserveWsCommand, D as ObserveWsMessage, F as OnGraphEvent, H as OnGraphEventMeta, Q as QUERY_HANDLERS, J as QueryHandler, K as QueryHandlerMeta, S as SAGA_HANDLERS, L as SagaHandler, M as SagaHandlerMeta, N as fromHeader, P as fromJwtPayload, R as getActor, T as getGraphToken, U as getNodeToken, V as observeSSE, W as observeSubscription, X as toObservable } from '../../index-_HDSmPyp.js';
|
|
2
|
+
export { T as ToObservableOptions } from '../../observable-B25XqCbZ.js';
|
|
5
3
|
import '@graphrefly/pure-ts/graph';
|
|
6
4
|
import '@nestjs/common';
|
|
7
5
|
import '@nestjs/core';
|
|
6
|
+
import '@graphrefly/pure-ts/core';
|
|
8
7
|
import '../../utils/cqrs/index.js';
|
|
9
8
|
import '@graphrefly/pure-ts/extra';
|
|
10
9
|
import '../../base/mutation/index.js';
|
|
10
|
+
import 'rxjs';
|
|
@@ -30,15 +30,14 @@ import {
|
|
|
30
30
|
getGraphToken,
|
|
31
31
|
getNodeToken,
|
|
32
32
|
observeSSE,
|
|
33
|
-
observeSubscription
|
|
34
|
-
|
|
33
|
+
observeSubscription,
|
|
34
|
+
toObservable
|
|
35
|
+
} from "../../chunk-VLAGJZSL.js";
|
|
35
36
|
import "../../chunk-7EGRP2VX.js";
|
|
36
37
|
import "../../chunk-NY2PYHNC.js";
|
|
37
38
|
import "../../chunk-FMPF42Q4.js";
|
|
38
39
|
import "../../chunk-BXGZFGZ4.js";
|
|
39
|
-
import
|
|
40
|
-
toObservable
|
|
41
|
-
} from "../../chunk-3QZY5BI7.js";
|
|
40
|
+
import "../../chunk-Z65DVDEQ.js";
|
|
42
41
|
import "../../chunk-AZDQPQ3V.js";
|
|
43
42
|
export {
|
|
44
43
|
ACTOR_KEY,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { T as ToObservableOptions, t as toObservable } from './observable-BXQoW1P-.cjs';
|
|
2
1
|
import { Graph, GraphPersistSnapshot } from '@graphrefly/pure-ts/graph';
|
|
3
2
|
import { OnModuleInit, OnModuleDestroy, ExecutionContext, CanActivate, DynamicModule } from '@nestjs/common';
|
|
4
3
|
import { ModuleRef } from '@nestjs/core';
|
|
5
|
-
import { Actor } from '@graphrefly/pure-ts/core';
|
|
4
|
+
import { Actor, Node, Messages } from '@graphrefly/pure-ts/core';
|
|
6
5
|
import { CqrsOptions, CqrsGraph, CqrsEvent } from './utils/cqrs/index.cjs';
|
|
7
6
|
import { AppendLogStorageTier } from '@graphrefly/pure-ts/extra';
|
|
7
|
+
import { Observable } from 'rxjs';
|
|
8
|
+
import { T as ToObservableOptions } from './observable-B25XqCbZ.cjs';
|
|
8
9
|
|
|
9
10
|
/** Class constructor key for decorator registries and Nest `ModuleRef.get()`. */
|
|
10
11
|
type DecoratorHostConstructor = abstract new (...args: unknown[]) => unknown;
|
|
@@ -674,6 +675,21 @@ declare class GraphReflyModule {
|
|
|
674
675
|
static forCqrs(opts: GraphReflyCqrsOptions): DynamicModule;
|
|
675
676
|
}
|
|
676
677
|
|
|
678
|
+
/**
|
|
679
|
+
* Bridge a `Node<T>` to a real rxjs `Observable` for NestJS controllers,
|
|
680
|
+
* gateways, and interceptors. Wraps the dependency-free base interop
|
|
681
|
+
* observable with rxjs `from()` so `isObservable()` / `.pipe()` work.
|
|
682
|
+
*
|
|
683
|
+
* See {@link baseToObservable} for the DATA/ERROR/COMPLETE mapping and the
|
|
684
|
+
* `{ raw: true }` message-batch mode.
|
|
685
|
+
*/
|
|
686
|
+
declare function toObservable<T>(node: Node<T>, options?: ToObservableOptions & {
|
|
687
|
+
raw?: false;
|
|
688
|
+
}): Observable<T>;
|
|
689
|
+
declare function toObservable<T>(node: Node<T>, options: ToObservableOptions & {
|
|
690
|
+
raw: true;
|
|
691
|
+
}): Observable<Messages>;
|
|
692
|
+
|
|
677
693
|
/** Injection token for the root `Graph` singleton created by `forRoot()`. */
|
|
678
694
|
declare const GRAPHREFLY_ROOT_GRAPH: unique symbol;
|
|
679
695
|
/** Injection token for the request-scoped `Graph` created by request scope config. */
|
|
@@ -751,4 +767,4 @@ declare namespace index {
|
|
|
751
767
|
export { index_ACTOR_KEY as ACTOR_KEY, type index_ActorExtractor as ActorExtractor, index_COMMAND_HANDLERS as COMMAND_HANDLERS, index_CQRS_EVENT_HANDLERS as CQRS_EVENT_HANDLERS, index_CRON_HANDLERS as CRON_HANDLERS, index_CommandHandler as CommandHandler, type index_CommandHandlerMeta as CommandHandlerMeta, index_EVENT_HANDLERS as EVENT_HANDLERS, index_EventHandler as EventHandler, type index_EventHandlerMeta as EventHandlerMeta, index_GRAPHREFLY_REQUEST_GRAPH as GRAPHREFLY_REQUEST_GRAPH, index_GRAPHREFLY_ROOT_GRAPH as GRAPHREFLY_ROOT_GRAPH, index_GraphCron as GraphCron, type index_GraphCronMeta as GraphCronMeta, index_GraphInterval as GraphInterval, type index_GraphIntervalMeta as GraphIntervalMeta, type index_GraphReflyCqrsOptions as GraphReflyCqrsOptions, index_GraphReflyEventExplorer as GraphReflyEventExplorer, type index_GraphReflyFeatureOptions as GraphReflyFeatureOptions, index_GraphReflyGuard as GraphReflyGuard, index_GraphReflyGuardImpl as GraphReflyGuardImpl, index_GraphReflyModule as GraphReflyModule, type index_GraphReflyRootOptions as GraphReflyRootOptions, index_INTERVAL_HANDLERS as INTERVAL_HANDLERS, index_InjectCqrsGraph as InjectCqrsGraph, index_InjectGraph as InjectGraph, index_InjectNode as InjectNode, index_ObserveGateway as ObserveGateway, type index_ObserveGatewayOptions as ObserveGatewayOptions, type index_ObserveSSEOptions as ObserveSSEOptions, type index_ObserveSubscriptionOptions as ObserveSubscriptionOptions, type index_ObserveWsCommand as ObserveWsCommand, type index_ObserveWsMessage as ObserveWsMessage, index_OnGraphEvent as OnGraphEvent, type index_OnGraphEventMeta as OnGraphEventMeta, index_QUERY_HANDLERS as QUERY_HANDLERS, index_QueryHandler as QueryHandler, type index_QueryHandlerMeta as QueryHandlerMeta, index_SAGA_HANDLERS as SAGA_HANDLERS, index_SagaHandler as SagaHandler, type index_SagaHandlerMeta as SagaHandlerMeta, index_ToObservableOptions as ToObservableOptions, index_fromHeader as fromHeader, index_fromJwtPayload as fromJwtPayload, index_getActor as getActor, index_getGraphToken as getGraphToken, index_getNodeToken as getNodeToken, index_observeSSE as observeSSE, index_observeSubscription as observeSubscription, index_toObservable as toObservable };
|
|
752
768
|
}
|
|
753
769
|
|
|
754
|
-
export { ACTOR_KEY as A, type ObserveWsCommand as B, COMMAND_HANDLERS as C, type ObserveWsMessage as D, EVENT_HANDLERS as E, OnGraphEvent as F, GRAPHREFLY_REQUEST_GRAPH as G, type OnGraphEventMeta as H, INTERVAL_HANDLERS as I, QueryHandler as J, type QueryHandlerMeta as K, SagaHandler as L, type SagaHandlerMeta as M, fromHeader as N, ObserveGateway as O, fromJwtPayload as P, QUERY_HANDLERS as Q, getActor as R, SAGA_HANDLERS as S, getGraphToken as T, getNodeToken as U, observeSSE as V, observeSubscription as W, type ActorExtractor as a, CQRS_EVENT_HANDLERS as b, CRON_HANDLERS as c, CommandHandler as d, type CommandHandlerMeta as e, EventHandler as f, type EventHandlerMeta as g, GRAPHREFLY_ROOT_GRAPH as h, index as i, GraphCron as j, type GraphCronMeta as k, GraphInterval as l, type GraphIntervalMeta as m, type GraphReflyCqrsOptions as n, GraphReflyEventExplorer as o, type GraphReflyFeatureOptions as p, GraphReflyGuard as q, GraphReflyGuardImpl as r, GraphReflyModule as s, type GraphReflyRootOptions as t, InjectCqrsGraph as u, InjectGraph as v, InjectNode as w, type ObserveGatewayOptions as x, type ObserveSSEOptions as y, type ObserveSubscriptionOptions as z };
|
|
770
|
+
export { ACTOR_KEY as A, type ObserveWsCommand as B, COMMAND_HANDLERS as C, type ObserveWsMessage as D, EVENT_HANDLERS as E, OnGraphEvent as F, GRAPHREFLY_REQUEST_GRAPH as G, type OnGraphEventMeta as H, INTERVAL_HANDLERS as I, QueryHandler as J, type QueryHandlerMeta as K, SagaHandler as L, type SagaHandlerMeta as M, fromHeader as N, ObserveGateway as O, fromJwtPayload as P, QUERY_HANDLERS as Q, getActor as R, SAGA_HANDLERS as S, getGraphToken as T, getNodeToken as U, observeSSE as V, observeSubscription as W, toObservable as X, type ActorExtractor as a, CQRS_EVENT_HANDLERS as b, CRON_HANDLERS as c, CommandHandler as d, type CommandHandlerMeta as e, EventHandler as f, type EventHandlerMeta as g, GRAPHREFLY_ROOT_GRAPH as h, index as i, GraphCron as j, type GraphCronMeta as k, GraphInterval as l, type GraphIntervalMeta as m, type GraphReflyCqrsOptions as n, GraphReflyEventExplorer as o, type GraphReflyFeatureOptions as p, GraphReflyGuard as q, GraphReflyGuardImpl as r, GraphReflyModule as s, type GraphReflyRootOptions as t, InjectCqrsGraph as u, InjectGraph as v, InjectNode as w, type ObserveGatewayOptions as x, type ObserveSSEOptions as y, type ObserveSubscriptionOptions as z };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { T as ToObservableOptions, t as toObservable } from './observable-BXQoW1P-.js';
|
|
2
1
|
import { Graph, GraphPersistSnapshot } from '@graphrefly/pure-ts/graph';
|
|
3
2
|
import { OnModuleInit, OnModuleDestroy, ExecutionContext, CanActivate, DynamicModule } from '@nestjs/common';
|
|
4
3
|
import { ModuleRef } from '@nestjs/core';
|
|
5
|
-
import { Actor } from '@graphrefly/pure-ts/core';
|
|
4
|
+
import { Actor, Node, Messages } from '@graphrefly/pure-ts/core';
|
|
6
5
|
import { CqrsOptions, CqrsGraph, CqrsEvent } from './utils/cqrs/index.js';
|
|
7
6
|
import { AppendLogStorageTier } from '@graphrefly/pure-ts/extra';
|
|
7
|
+
import { Observable } from 'rxjs';
|
|
8
|
+
import { T as ToObservableOptions } from './observable-B25XqCbZ.js';
|
|
8
9
|
|
|
9
10
|
/** Class constructor key for decorator registries and Nest `ModuleRef.get()`. */
|
|
10
11
|
type DecoratorHostConstructor = abstract new (...args: unknown[]) => unknown;
|
|
@@ -674,6 +675,21 @@ declare class GraphReflyModule {
|
|
|
674
675
|
static forCqrs(opts: GraphReflyCqrsOptions): DynamicModule;
|
|
675
676
|
}
|
|
676
677
|
|
|
678
|
+
/**
|
|
679
|
+
* Bridge a `Node<T>` to a real rxjs `Observable` for NestJS controllers,
|
|
680
|
+
* gateways, and interceptors. Wraps the dependency-free base interop
|
|
681
|
+
* observable with rxjs `from()` so `isObservable()` / `.pipe()` work.
|
|
682
|
+
*
|
|
683
|
+
* See {@link baseToObservable} for the DATA/ERROR/COMPLETE mapping and the
|
|
684
|
+
* `{ raw: true }` message-batch mode.
|
|
685
|
+
*/
|
|
686
|
+
declare function toObservable<T>(node: Node<T>, options?: ToObservableOptions & {
|
|
687
|
+
raw?: false;
|
|
688
|
+
}): Observable<T>;
|
|
689
|
+
declare function toObservable<T>(node: Node<T>, options: ToObservableOptions & {
|
|
690
|
+
raw: true;
|
|
691
|
+
}): Observable<Messages>;
|
|
692
|
+
|
|
677
693
|
/** Injection token for the root `Graph` singleton created by `forRoot()`. */
|
|
678
694
|
declare const GRAPHREFLY_ROOT_GRAPH: unique symbol;
|
|
679
695
|
/** Injection token for the request-scoped `Graph` created by request scope config. */
|
|
@@ -751,4 +767,4 @@ declare namespace index {
|
|
|
751
767
|
export { index_ACTOR_KEY as ACTOR_KEY, type index_ActorExtractor as ActorExtractor, index_COMMAND_HANDLERS as COMMAND_HANDLERS, index_CQRS_EVENT_HANDLERS as CQRS_EVENT_HANDLERS, index_CRON_HANDLERS as CRON_HANDLERS, index_CommandHandler as CommandHandler, type index_CommandHandlerMeta as CommandHandlerMeta, index_EVENT_HANDLERS as EVENT_HANDLERS, index_EventHandler as EventHandler, type index_EventHandlerMeta as EventHandlerMeta, index_GRAPHREFLY_REQUEST_GRAPH as GRAPHREFLY_REQUEST_GRAPH, index_GRAPHREFLY_ROOT_GRAPH as GRAPHREFLY_ROOT_GRAPH, index_GraphCron as GraphCron, type index_GraphCronMeta as GraphCronMeta, index_GraphInterval as GraphInterval, type index_GraphIntervalMeta as GraphIntervalMeta, type index_GraphReflyCqrsOptions as GraphReflyCqrsOptions, index_GraphReflyEventExplorer as GraphReflyEventExplorer, type index_GraphReflyFeatureOptions as GraphReflyFeatureOptions, index_GraphReflyGuard as GraphReflyGuard, index_GraphReflyGuardImpl as GraphReflyGuardImpl, index_GraphReflyModule as GraphReflyModule, type index_GraphReflyRootOptions as GraphReflyRootOptions, index_INTERVAL_HANDLERS as INTERVAL_HANDLERS, index_InjectCqrsGraph as InjectCqrsGraph, index_InjectGraph as InjectGraph, index_InjectNode as InjectNode, index_ObserveGateway as ObserveGateway, type index_ObserveGatewayOptions as ObserveGatewayOptions, type index_ObserveSSEOptions as ObserveSSEOptions, type index_ObserveSubscriptionOptions as ObserveSubscriptionOptions, type index_ObserveWsCommand as ObserveWsCommand, type index_ObserveWsMessage as ObserveWsMessage, index_OnGraphEvent as OnGraphEvent, type index_OnGraphEventMeta as OnGraphEventMeta, index_QUERY_HANDLERS as QUERY_HANDLERS, index_QueryHandler as QueryHandler, type index_QueryHandlerMeta as QueryHandlerMeta, index_SAGA_HANDLERS as SAGA_HANDLERS, index_SagaHandler as SagaHandler, type index_SagaHandlerMeta as SagaHandlerMeta, index_ToObservableOptions as ToObservableOptions, index_fromHeader as fromHeader, index_fromJwtPayload as fromJwtPayload, index_getActor as getActor, index_getGraphToken as getGraphToken, index_getNodeToken as getNodeToken, index_observeSSE as observeSSE, index_observeSubscription as observeSubscription, index_toObservable as toObservable };
|
|
752
768
|
}
|
|
753
769
|
|
|
754
|
-
export { ACTOR_KEY as A, type ObserveWsCommand as B, COMMAND_HANDLERS as C, type ObserveWsMessage as D, EVENT_HANDLERS as E, OnGraphEvent as F, GRAPHREFLY_REQUEST_GRAPH as G, type OnGraphEventMeta as H, INTERVAL_HANDLERS as I, QueryHandler as J, type QueryHandlerMeta as K, SagaHandler as L, type SagaHandlerMeta as M, fromHeader as N, ObserveGateway as O, fromJwtPayload as P, QUERY_HANDLERS as Q, getActor as R, SAGA_HANDLERS as S, getGraphToken as T, getNodeToken as U, observeSSE as V, observeSubscription as W, type ActorExtractor as a, CQRS_EVENT_HANDLERS as b, CRON_HANDLERS as c, CommandHandler as d, type CommandHandlerMeta as e, EventHandler as f, type EventHandlerMeta as g, GRAPHREFLY_ROOT_GRAPH as h, index as i, GraphCron as j, type GraphCronMeta as k, GraphInterval as l, type GraphIntervalMeta as m, type GraphReflyCqrsOptions as n, GraphReflyEventExplorer as o, type GraphReflyFeatureOptions as p, GraphReflyGuard as q, GraphReflyGuardImpl as r, GraphReflyModule as s, type GraphReflyRootOptions as t, InjectCqrsGraph as u, InjectGraph as v, InjectNode as w, type ObserveGatewayOptions as x, type ObserveSSEOptions as y, type ObserveSubscriptionOptions as z };
|
|
770
|
+
export { ACTOR_KEY as A, type ObserveWsCommand as B, COMMAND_HANDLERS as C, type ObserveWsMessage as D, EVENT_HANDLERS as E, OnGraphEvent as F, GRAPHREFLY_REQUEST_GRAPH as G, type OnGraphEventMeta as H, INTERVAL_HANDLERS as I, QueryHandler as J, type QueryHandlerMeta as K, SagaHandler as L, type SagaHandlerMeta as M, fromHeader as N, ObserveGateway as O, fromJwtPayload as P, QUERY_HANDLERS as Q, getActor as R, SAGA_HANDLERS as S, getGraphToken as T, getNodeToken as U, observeSSE as V, observeSubscription as W, toObservable as X, type ActorExtractor as a, CQRS_EVENT_HANDLERS as b, CRON_HANDLERS as c, CommandHandler as d, type CommandHandlerMeta as e, EventHandler as f, type EventHandlerMeta as g, GRAPHREFLY_ROOT_GRAPH as h, index as i, GraphCron as j, type GraphCronMeta as k, GraphInterval as l, type GraphIntervalMeta as m, type GraphReflyCqrsOptions as n, GraphReflyEventExplorer as o, type GraphReflyFeatureOptions as p, GraphReflyGuard as q, GraphReflyGuardImpl as r, GraphReflyModule as s, type GraphReflyRootOptions as t, InjectCqrsGraph as u, InjectGraph as v, InjectNode as w, type ObserveGatewayOptions as x, type ObserveSSEOptions as y, type ObserveSubscriptionOptions as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1293,43 +1293,97 @@ function materialize(key, factories, parent, opts) {
|
|
|
1293
1293
|
|
|
1294
1294
|
// src/base/composition/observable.ts
|
|
1295
1295
|
var import_core6 = require("@graphrefly/pure-ts/core");
|
|
1296
|
-
var
|
|
1296
|
+
var OBSERVABLE_KEY = typeof Symbol === "function" && Symbol.observable || "@@observable";
|
|
1297
|
+
function normalizeObserver(observer) {
|
|
1298
|
+
return typeof observer === "function" ? { next: observer } : observer;
|
|
1299
|
+
}
|
|
1300
|
+
function makeInterop(onSubscribe) {
|
|
1301
|
+
const obs = {
|
|
1302
|
+
subscribe(rawObserver) {
|
|
1303
|
+
const observer = normalizeObserver(rawObserver);
|
|
1304
|
+
let closed = false;
|
|
1305
|
+
let teardown;
|
|
1306
|
+
let teardownPending = false;
|
|
1307
|
+
const runTeardown = () => {
|
|
1308
|
+
if (teardown) teardown();
|
|
1309
|
+
else teardownPending = true;
|
|
1310
|
+
};
|
|
1311
|
+
const guarded = {
|
|
1312
|
+
get closed() {
|
|
1313
|
+
return closed;
|
|
1314
|
+
},
|
|
1315
|
+
next(value) {
|
|
1316
|
+
if (!closed) observer.next?.(value);
|
|
1317
|
+
},
|
|
1318
|
+
error(err) {
|
|
1319
|
+
if (closed) return;
|
|
1320
|
+
closed = true;
|
|
1321
|
+
try {
|
|
1322
|
+
observer.error?.(err);
|
|
1323
|
+
} finally {
|
|
1324
|
+
runTeardown();
|
|
1325
|
+
}
|
|
1326
|
+
},
|
|
1327
|
+
complete() {
|
|
1328
|
+
if (closed) return;
|
|
1329
|
+
closed = true;
|
|
1330
|
+
try {
|
|
1331
|
+
observer.complete?.();
|
|
1332
|
+
} finally {
|
|
1333
|
+
runTeardown();
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
};
|
|
1337
|
+
teardown = onSubscribe(guarded);
|
|
1338
|
+
if (teardownPending) teardown();
|
|
1339
|
+
return {
|
|
1340
|
+
unsubscribe() {
|
|
1341
|
+
if (closed) return;
|
|
1342
|
+
closed = true;
|
|
1343
|
+
teardown?.();
|
|
1344
|
+
}
|
|
1345
|
+
};
|
|
1346
|
+
}
|
|
1347
|
+
};
|
|
1348
|
+
obs[OBSERVABLE_KEY] = function() {
|
|
1349
|
+
return this;
|
|
1350
|
+
};
|
|
1351
|
+
return obs;
|
|
1352
|
+
}
|
|
1297
1353
|
function toObservable(node92, options) {
|
|
1298
1354
|
if (options?.raw) {
|
|
1299
|
-
return
|
|
1300
|
-
|
|
1301
|
-
if (
|
|
1302
|
-
|
|
1355
|
+
return makeInterop((observer) => {
|
|
1356
|
+
return node92.subscribe((msgs) => {
|
|
1357
|
+
if (observer.closed) return;
|
|
1358
|
+
observer.next?.(msgs);
|
|
1303
1359
|
for (const m of msgs) {
|
|
1304
1360
|
if (m[0] === import_core6.ERROR) {
|
|
1305
|
-
|
|
1361
|
+
observer.error?.(m[1]);
|
|
1306
1362
|
return;
|
|
1307
1363
|
}
|
|
1308
1364
|
if (m[0] === import_core6.COMPLETE) {
|
|
1309
|
-
|
|
1365
|
+
observer.complete?.();
|
|
1310
1366
|
return;
|
|
1311
1367
|
}
|
|
1312
1368
|
}
|
|
1313
1369
|
});
|
|
1314
|
-
return unsub;
|
|
1315
1370
|
});
|
|
1316
1371
|
}
|
|
1317
|
-
return
|
|
1318
|
-
|
|
1372
|
+
return makeInterop((observer) => {
|
|
1373
|
+
return node92.subscribe((msgs) => {
|
|
1319
1374
|
for (const m of msgs) {
|
|
1320
|
-
if (
|
|
1375
|
+
if (observer.closed) return;
|
|
1321
1376
|
if (m[0] === import_core6.DATA) {
|
|
1322
|
-
|
|
1377
|
+
observer.next?.(m[1]);
|
|
1323
1378
|
} else if (m[0] === import_core6.ERROR) {
|
|
1324
|
-
|
|
1379
|
+
observer.error?.(m[1]);
|
|
1325
1380
|
return;
|
|
1326
1381
|
} else if (m[0] === import_core6.COMPLETE) {
|
|
1327
|
-
|
|
1382
|
+
observer.complete?.();
|
|
1328
1383
|
return;
|
|
1329
1384
|
}
|
|
1330
1385
|
}
|
|
1331
1386
|
});
|
|
1332
|
-
return unsub;
|
|
1333
1387
|
});
|
|
1334
1388
|
}
|
|
1335
1389
|
|
|
@@ -8228,6 +8282,8 @@ function reactiveFactStore(config) {
|
|
|
8228
8282
|
graph
|
|
8229
8283
|
});
|
|
8230
8284
|
const seqCursor = registerCursor(graph, "seq", 0);
|
|
8285
|
+
const ingestLog = config.recordIngest ? (0, import_extra19.reactiveLog)([], { name: "ingest_log" }) : void 0;
|
|
8286
|
+
if (ingestLog) graph.addDisposer(() => ingestLog.dispose());
|
|
8231
8287
|
const emptyStore = () => ({ byId: /* @__PURE__ */ new Map() });
|
|
8232
8288
|
const shards = [];
|
|
8233
8289
|
for (let s = 0; s < shardCount; s += 1) {
|
|
@@ -8383,6 +8439,8 @@ function reactiveFactStore(config) {
|
|
|
8383
8439
|
factId: dep,
|
|
8384
8440
|
rootFactId: f.id,
|
|
8385
8441
|
reason: "obsolete",
|
|
8442
|
+
// `obsolete` guard above guarantees `f.validTo` is set.
|
|
8443
|
+
rootValidTo: f.validTo,
|
|
8386
8444
|
iteration: cascadeIteration + 1,
|
|
8387
8445
|
causalReason: `dependentsIndex[${f.id}] \u2192 ${dep} (obsolete: validTo set)`
|
|
8388
8446
|
});
|
|
@@ -8455,11 +8513,10 @@ function reactiveFactStore(config) {
|
|
|
8455
8513
|
actions.emit([]);
|
|
8456
8514
|
return;
|
|
8457
8515
|
}
|
|
8458
|
-
const
|
|
8459
|
-
for (const [id] of byId) {
|
|
8516
|
+
for (const [id, e] of byId) {
|
|
8460
8517
|
replaceFragment(
|
|
8461
8518
|
id,
|
|
8462
|
-
(prev) => prev.validTo !== void 0 ? prev : { ...prev, validTo:
|
|
8519
|
+
(prev) => prev.validTo !== void 0 ? prev : { ...prev, validTo: e.rootValidTo }
|
|
8463
8520
|
);
|
|
8464
8521
|
}
|
|
8465
8522
|
actions.emit([...byId.values()]);
|
|
@@ -8617,6 +8674,7 @@ function reactiveFactStore(config) {
|
|
|
8617
8674
|
t_ns: (0, import_core51.wallClockNs)(),
|
|
8618
8675
|
seq: bumpCursor(seqCursor)
|
|
8619
8676
|
});
|
|
8677
|
+
ingestLog?.append(f);
|
|
8620
8678
|
}
|
|
8621
8679
|
actions.emit(f ?? null);
|
|
8622
8680
|
},
|
|
@@ -8653,6 +8711,7 @@ function reactiveFactStore(config) {
|
|
|
8653
8711
|
review,
|
|
8654
8712
|
consolidated,
|
|
8655
8713
|
events,
|
|
8714
|
+
...ingestLog ? { ingestLog } : {},
|
|
8656
8715
|
itemNode
|
|
8657
8716
|
});
|
|
8658
8717
|
return out;
|