@olane/o-node 0.7.12-alpha.39 → 0.7.12-alpha.40
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/o-core/src/connection/index.d.ts +8 -0
- package/dist/o-core/src/connection/index.d.ts.map +1 -0
- package/dist/o-core/src/connection/index.js +7 -0
- package/dist/o-core/src/connection/interfaces/connection-manager.config.d.ts +15 -0
- package/dist/o-core/src/connection/interfaces/connection-manager.config.d.ts.map +1 -0
- package/dist/o-core/src/connection/interfaces/connection-manager.config.js +1 -0
- package/dist/o-core/src/connection/interfaces/connection-send-params.interface.d.ts +9 -0
- package/dist/o-core/src/connection/interfaces/connection-send-params.interface.d.ts.map +1 -0
- package/dist/o-core/src/connection/interfaces/connection-send-params.interface.js +1 -0
- package/dist/o-core/src/connection/interfaces/connection.config.d.ts +20 -0
- package/dist/o-core/src/connection/interfaces/connection.config.d.ts.map +1 -0
- package/dist/o-core/src/connection/interfaces/connection.config.js +1 -0
- package/dist/o-core/src/connection/interfaces/index.d.ts +5 -0
- package/dist/o-core/src/connection/interfaces/index.d.ts.map +1 -0
- package/dist/o-core/src/connection/interfaces/index.js +4 -0
- package/dist/o-core/src/connection/interfaces/request-state.enum.d.ts +7 -0
- package/dist/o-core/src/connection/interfaces/request-state.enum.d.ts.map +1 -0
- package/dist/o-core/src/connection/interfaces/request-state.enum.js +7 -0
- package/dist/o-core/src/connection/o-connection-manager.d.ts +19 -0
- package/dist/o-core/src/connection/o-connection-manager.d.ts.map +1 -0
- package/dist/o-core/src/connection/o-connection-manager.js +27 -0
- package/dist/o-core/src/connection/o-connection.d.ts +26 -0
- package/dist/o-core/src/connection/o-connection.d.ts.map +1 -0
- package/dist/o-core/src/connection/o-connection.js +54 -0
- package/dist/o-core/src/connection/o-request.d.ts +23 -0
- package/dist/o-core/src/connection/o-request.d.ts.map +1 -0
- package/dist/o-core/src/connection/o-request.js +42 -0
- package/dist/o-core/src/connection/o-response.d.ts +1 -0
- package/dist/o-core/src/connection/o-response.d.ts.map +1 -1
- package/dist/o-core/src/connection/o-response.js +7 -0
- package/dist/o-core/src/core/defaults/config.d.ts +4 -0
- package/dist/o-core/src/core/defaults/config.d.ts.map +1 -0
- package/dist/o-core/src/core/defaults/config.js +5 -0
- package/dist/o-core/src/core/defaults/index.d.ts +2 -0
- package/dist/o-core/src/core/defaults/index.d.ts.map +1 -0
- package/dist/o-core/src/core/defaults/index.js +1 -0
- package/dist/o-core/src/core/graceful-shutdown.d.ts +25 -0
- package/dist/o-core/src/core/graceful-shutdown.d.ts.map +1 -0
- package/dist/o-core/src/core/graceful-shutdown.js +84 -0
- package/dist/o-core/src/core/index.d.ts +9 -0
- package/dist/o-core/src/core/index.d.ts.map +1 -0
- package/dist/o-core/src/core/index.js +8 -0
- package/dist/o-core/src/core/interfaces/index.d.ts +7 -0
- package/dist/o-core/src/core/interfaces/index.d.ts.map +1 -0
- package/dist/o-core/src/core/interfaces/index.js +6 -0
- package/dist/o-core/src/core/interfaces/node-type.enum.d.ts +10 -0
- package/dist/o-core/src/core/interfaces/node-type.enum.d.ts.map +1 -0
- package/dist/o-core/src/core/interfaces/node-type.enum.js +10 -0
- package/dist/o-core/src/core/interfaces/o-core.config.d.ts +23 -0
- package/dist/o-core/src/core/interfaces/o-core.config.d.ts.map +1 -0
- package/dist/o-core/src/core/interfaces/o-core.config.js +1 -0
- package/dist/o-core/src/core/interfaces/o-core.interface.d.ts +18 -0
- package/dist/o-core/src/core/interfaces/o-core.interface.d.ts.map +1 -0
- package/dist/o-core/src/core/interfaces/o-core.interface.js +1 -0
- package/dist/o-core/src/core/interfaces/state.enum.d.ts +8 -0
- package/dist/o-core/src/core/interfaces/state.enum.d.ts.map +1 -0
- package/dist/o-core/src/core/interfaces/state.enum.js +8 -0
- package/dist/o-core/src/core/interfaces/use-options.interface.d.ts +11 -0
- package/dist/o-core/src/core/interfaces/use-options.interface.d.ts.map +1 -0
- package/dist/o-core/src/core/interfaces/use-options.interface.js +1 -0
- package/dist/o-core/src/core/interfaces/use-stream-options.interface.d.ts +4 -0
- package/dist/o-core/src/core/interfaces/use-stream-options.interface.d.ts.map +1 -0
- package/dist/o-core/src/core/interfaces/use-stream-options.interface.js +1 -0
- package/dist/o-core/src/core/lib/events/connection-events.d.ts +31 -0
- package/dist/o-core/src/core/lib/events/connection-events.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/events/connection-events.js +46 -0
- package/dist/o-core/src/core/lib/events/hierarchy-events.d.ts +69 -0
- package/dist/o-core/src/core/lib/events/hierarchy-events.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/events/hierarchy-events.js +100 -0
- package/dist/o-core/src/core/lib/events/index.d.ts +6 -0
- package/dist/o-core/src/core/lib/events/index.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/events/index.js +5 -0
- package/dist/o-core/src/core/lib/events/node-events.d.ts +40 -0
- package/dist/o-core/src/core/lib/events/node-events.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/events/node-events.js +58 -0
- package/dist/o-core/src/core/lib/events/o-notification-event.d.ts +26 -0
- package/dist/o-core/src/core/lib/events/o-notification-event.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/events/o-notification-event.js +30 -0
- package/dist/o-core/src/core/lib/index.d.ts +8 -0
- package/dist/o-core/src/core/lib/index.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/index.js +7 -0
- package/dist/o-core/src/core/lib/interfaces/notification-types.d.ts +49 -0
- package/dist/o-core/src/core/lib/interfaces/notification-types.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/interfaces/notification-types.js +1 -0
- package/dist/o-core/src/core/lib/o-hierarchy.manager.d.ts +24 -0
- package/dist/o-core/src/core/lib/o-hierarchy.manager.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/o-hierarchy.manager.js +58 -0
- package/dist/o-core/src/core/lib/o-metrics.d.ts +5 -0
- package/dist/o-core/src/core/lib/o-metrics.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/o-metrics.js +6 -0
- package/dist/o-core/src/core/lib/o-notification.manager.d.ts +58 -0
- package/dist/o-core/src/core/lib/o-notification.manager.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/o-notification.manager.js +159 -0
- package/dist/o-core/src/core/lib/o-request.manager.d.ts +10 -0
- package/dist/o-core/src/core/lib/o-request.manager.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/o-request.manager.js +18 -0
- package/dist/o-core/src/core/lib/utils/event-filters.d.ts +38 -0
- package/dist/o-core/src/core/lib/utils/event-filters.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/utils/event-filters.js +159 -0
- package/dist/o-core/src/core/o-core.d.ts +240 -0
- package/dist/o-core/src/core/o-core.d.ts.map +1 -0
- package/dist/o-core/src/core/o-core.js +463 -0
- package/dist/o-core/src/core/o-dependency.d.ts +9 -0
- package/dist/o-core/src/core/o-dependency.d.ts.map +1 -0
- package/dist/o-core/src/core/o-dependency.js +15 -0
- package/dist/o-core/src/core/o-object.d.ts +7 -0
- package/dist/o-core/src/core/o-object.d.ts.map +1 -0
- package/dist/o-core/src/core/o-object.js +10 -0
- package/dist/o-core/src/core/o-parameter.d.ts +12 -0
- package/dist/o-core/src/core/o-parameter.d.ts.map +1 -0
- package/dist/o-core/src/core/o-parameter.js +21 -0
- package/dist/o-core/src/error/index.d.ts +3 -0
- package/dist/o-core/src/error/index.d.ts.map +1 -0
- package/dist/o-core/src/error/index.js +2 -0
- package/dist/o-core/src/index.d.ts +8 -0
- package/dist/o-core/src/index.d.ts.map +1 -0
- package/dist/o-core/src/index.js +7 -0
- package/dist/o-core/src/response/index.d.ts +2 -0
- package/dist/o-core/src/response/index.d.ts.map +1 -0
- package/dist/o-core/src/response/index.js +1 -0
- package/dist/o-core/src/response/response-builder.d.ts +140 -0
- package/dist/o-core/src/response/response-builder.d.ts.map +1 -0
- package/dist/o-core/src/response/response-builder.js +190 -0
- package/dist/o-core/src/router/enums/restricted-addresses.enum.d.ts +8 -0
- package/dist/o-core/src/router/enums/restricted-addresses.enum.d.ts.map +1 -0
- package/dist/o-core/src/router/enums/restricted-addresses.enum.js +13 -0
- package/dist/o-core/src/router/index.d.ts +11 -0
- package/dist/o-core/src/router/index.d.ts.map +1 -0
- package/dist/o-core/src/router/index.js +10 -0
- package/dist/o-core/src/router/interfaces/resolve.request.d.ts +10 -0
- package/dist/o-core/src/router/interfaces/resolve.request.d.ts.map +1 -0
- package/dist/o-core/src/router/interfaces/resolve.request.js +1 -0
- package/dist/o-core/src/router/interfaces/route.response.d.ts +8 -0
- package/dist/o-core/src/router/interfaces/route.response.d.ts.map +1 -0
- package/dist/o-core/src/router/interfaces/route.response.js +1 -0
- package/dist/o-core/src/router/o-address-resolver.d.ts +14 -0
- package/dist/o-core/src/router/o-address-resolver.d.ts.map +1 -0
- package/dist/o-core/src/router/o-address-resolver.js +19 -0
- package/dist/o-core/src/router/o-address.d.ts +33 -0
- package/dist/o-core/src/router/o-address.d.ts.map +1 -0
- package/dist/o-core/src/router/o-address.js +114 -0
- package/dist/o-core/src/router/o-request-preparation.d.ts +37 -0
- package/dist/o-core/src/router/o-request-preparation.d.ts.map +1 -0
- package/dist/o-core/src/router/o-request-preparation.js +75 -0
- package/dist/o-core/src/router/o-request.router.d.ts +18 -0
- package/dist/o-core/src/router/o-request.router.d.ts.map +1 -0
- package/dist/o-core/src/router/o-request.router.js +12 -0
- package/dist/o-core/src/router/o-resolver-chain.d.ts +32 -0
- package/dist/o-core/src/router/o-resolver-chain.d.ts.map +1 -0
- package/dist/o-core/src/router/o-resolver-chain.js +62 -0
- package/dist/o-core/src/router/o-router.d.ts +19 -0
- package/dist/o-core/src/router/o-router.d.ts.map +1 -0
- package/dist/o-core/src/router/o-router.js +14 -0
- package/dist/o-core/src/router/o-routing-policy.d.ts +36 -0
- package/dist/o-core/src/router/o-routing-policy.d.ts.map +1 -0
- package/dist/o-core/src/router/o-routing-policy.js +19 -0
- package/dist/o-core/src/transports/custom.transport.d.ts +6 -0
- package/dist/o-core/src/transports/custom.transport.d.ts.map +1 -0
- package/dist/o-core/src/transports/custom.transport.js +10 -0
- package/dist/o-core/src/transports/index.d.ts +4 -0
- package/dist/o-core/src/transports/index.d.ts.map +1 -0
- package/dist/o-core/src/transports/index.js +3 -0
- package/dist/o-core/src/transports/interfaces/transport-type.enum.d.ts +5 -0
- package/dist/o-core/src/transports/interfaces/transport-type.enum.d.ts.map +1 -0
- package/dist/o-core/src/transports/interfaces/transport-type.enum.js +5 -0
- package/dist/o-core/src/transports/o-transport.d.ts +10 -0
- package/dist/o-core/src/transports/o-transport.d.ts.map +1 -0
- package/dist/o-core/src/transports/o-transport.js +16 -0
- package/dist/o-core/src/utils/core.utils.d.ts +34 -0
- package/dist/o-core/src/utils/core.utils.d.ts.map +1 -0
- package/dist/o-core/src/utils/core.utils.js +123 -0
- package/dist/o-core/src/utils/index.d.ts +6 -0
- package/dist/o-core/src/utils/index.d.ts.map +1 -0
- package/dist/o-core/src/utils/index.js +5 -0
- package/dist/o-core/src/utils/logger.d.ts +14 -0
- package/dist/o-core/src/utils/logger.d.ts.map +1 -0
- package/dist/o-core/src/utils/logger.js +31 -0
- package/dist/o-core/src/utils/object.utils.d.ts +5 -0
- package/dist/o-core/src/utils/object.utils.d.ts.map +1 -0
- package/dist/o-core/src/utils/object.utils.js +23 -0
- package/dist/o-core/src/utils/regex.utils.d.ts +4 -0
- package/dist/o-core/src/utils/regex.utils.d.ts.map +1 -0
- package/dist/o-core/src/utils/regex.utils.js +13 -0
- package/dist/o-core/src/utils/remote.utils.d.ts +4 -0
- package/dist/o-core/src/utils/remote.utils.d.ts.map +1 -0
- package/dist/o-core/src/utils/remote.utils.js +5 -0
- package/dist/o-node/src/connection/o-node-connection.d.ts +2 -2
- package/dist/o-node/src/connection/o-node-connection.d.ts.map +1 -1
- package/dist/o-node/src/connection/o-node-connection.js +36 -23
- package/dist/o-node/src/connection/o-node-connection.manager.d.ts.map +1 -1
- package/dist/o-node/src/connection/o-node-connection.manager.js +13 -41
- package/dist/o-node/src/index.d.ts +1 -0
- package/dist/o-node/src/index.d.ts.map +1 -1
- package/dist/o-node/src/index.js +1 -0
- package/dist/o-node/src/interfaces/o-node.config.d.ts +0 -17
- package/dist/o-node/src/interfaces/o-node.config.d.ts.map +1 -1
- package/dist/o-node/src/managers/o-connection-heartbeat.manager.d.ts +1 -0
- package/dist/o-node/src/managers/o-connection-heartbeat.manager.d.ts.map +1 -1
- package/dist/o-node/src/managers/o-connection-heartbeat.manager.js +17 -3
- package/dist/o-node/src/o-node.d.ts +11 -12
- package/dist/o-node/src/o-node.d.ts.map +1 -1
- package/dist/o-node/src/o-node.js +104 -25
- package/dist/o-node/src/o-node.notification-manager.js +4 -1
- package/dist/o-node/src/o-node.tool.d.ts.map +1 -1
- package/dist/o-node/src/o-node.tool.js +16 -23
- package/dist/o-node/src/router/o-node.router.d.ts +1 -0
- package/dist/o-node/src/router/o-node.router.d.ts.map +1 -1
- package/dist/o-node/src/router/o-node.router.js +53 -7
- package/dist/o-node/src/router/resolvers/o-node.resolver.d.ts.map +1 -1
- package/dist/o-node/src/router/resolvers/o-node.resolver.js +5 -1
- package/dist/o-node/src/ui/index.d.ts +3 -0
- package/dist/o-node/src/ui/index.d.ts.map +1 -0
- package/dist/o-node/src/ui/index.js +2 -0
- package/dist/o-node/src/ui/types.d.ts +110 -0
- package/dist/o-node/src/ui/types.d.ts.map +1 -0
- package/dist/o-node/src/ui/types.js +17 -0
- package/dist/o-node/src/ui/ui-graph.manager.d.ts +70 -0
- package/dist/o-node/src/ui/ui-graph.manager.d.ts.map +1 -0
- package/dist/o-node/src/ui/ui-graph.manager.js +274 -0
- package/dist/o-node/src/utils/index.d.ts +0 -2
- package/dist/o-node/src/utils/index.d.ts.map +1 -1
- package/dist/o-node/src/utils/index.js +0 -2
- package/dist/o-node/src/utils/stream.utils.d.ts.map +1 -1
- package/dist/o-node/src/utils/stream.utils.js +25 -21
- package/dist/o-node/test/helpers/test-node.tool.d.ts +15 -0
- package/dist/o-node/test/helpers/test-node.tool.d.ts.map +1 -0
- package/dist/o-node/test/helpers/test-node.tool.js +27 -0
- package/dist/src/connection/o-node-connection.manager.d.ts +14 -4
- package/dist/src/connection/o-node-connection.manager.d.ts.map +1 -1
- package/dist/src/connection/o-node-connection.manager.js +61 -29
- package/package.json +6 -6
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Multiaddr } from '@olane/o-config';
|
|
2
|
+
import { oAddress } from '../../router/o-address';
|
|
3
|
+
import { oConnectionManager } from '../../connection/o-connection-manager';
|
|
4
|
+
import { oResolverChain } from '../../router/o-resolver-chain';
|
|
5
|
+
import { NodeState } from './state.enum';
|
|
6
|
+
export interface oCoreInterface {
|
|
7
|
+
leaders: Multiaddr[];
|
|
8
|
+
address: oAddress;
|
|
9
|
+
staticAddress: oAddress;
|
|
10
|
+
state: NodeState;
|
|
11
|
+
errors: Error[];
|
|
12
|
+
connectionManager: oConnectionManager;
|
|
13
|
+
addressResolution: oResolverChain;
|
|
14
|
+
description: string;
|
|
15
|
+
start: () => Promise<void>;
|
|
16
|
+
stop: () => Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=o-core.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-core.interface.d.ts","sourceRoot":"","sources":["../../../../../../o-core/src/core/interfaces/o-core.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,OAAO,EAAE,QAAQ,CAAC;IAClB,aAAa,EAAE,QAAQ,CAAC;IACxB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,iBAAiB,EAAE,cAAc,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IAEpB,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.enum.d.ts","sourceRoot":"","sources":["../../../../../../o-core/src/core/interfaces/state.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { oResponse } from '../../connection/o-response.js';
|
|
3
|
+
export interface UseOptions {
|
|
4
|
+
readTimeoutMs?: number;
|
|
5
|
+
drainTimeoutMs?: number;
|
|
6
|
+
isStream?: boolean;
|
|
7
|
+
onChunk?: (chunk: oResponse) => void;
|
|
8
|
+
noRouting?: boolean;
|
|
9
|
+
abortSignal?: AbortSignal;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=use-options.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-options.interface.d.ts","sourceRoot":"","sources":["../../../../../../o-core/src/core/interfaces/use-options.interface.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,MAAM,WAAW,UAAU;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-stream-options.interface.d.ts","sourceRoot":"","sources":["../../../../../../o-core/src/core/interfaces/use-stream-options.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { oAddress } from '../../../router/o-address.js';
|
|
2
|
+
import { oNotificationEvent } from './o-notification-event.js';
|
|
3
|
+
/**
|
|
4
|
+
* Emitted when a connection becomes degraded (some pings failing)
|
|
5
|
+
*/
|
|
6
|
+
export declare class ConnectionDegradedEvent extends oNotificationEvent {
|
|
7
|
+
readonly targetAddress: oAddress;
|
|
8
|
+
readonly role: 'parent' | 'child';
|
|
9
|
+
readonly consecutiveFailures: number;
|
|
10
|
+
constructor(config: {
|
|
11
|
+
source: oAddress;
|
|
12
|
+
targetAddress: oAddress;
|
|
13
|
+
role: 'parent' | 'child';
|
|
14
|
+
consecutiveFailures: number;
|
|
15
|
+
});
|
|
16
|
+
protected getEventData(): Record<string, any>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Emitted when a degraded connection recovers
|
|
20
|
+
*/
|
|
21
|
+
export declare class ConnectionRecoveredEvent extends oNotificationEvent {
|
|
22
|
+
readonly targetAddress: oAddress;
|
|
23
|
+
readonly role: 'parent' | 'child';
|
|
24
|
+
constructor(config: {
|
|
25
|
+
source: oAddress;
|
|
26
|
+
targetAddress: oAddress;
|
|
27
|
+
role: 'parent' | 'child';
|
|
28
|
+
});
|
|
29
|
+
protected getEventData(): Record<string, any>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=connection-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-events.d.ts","sourceRoot":"","sources":["../../../../../../../o-core/src/core/lib/events/connection-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB;IAC7D,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;gBAEzB,MAAM,EAAE;QAClB,MAAM,EAAE,QAAQ,CAAC;QACjB,aAAa,EAAE,QAAQ,CAAC;QACxB,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;QACzB,mBAAmB,EAAE,MAAM,CAAC;KAC7B;IAcD,SAAS,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAO9C;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,kBAAkB;IAC9D,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;gBAEtB,MAAM,EAAE;QAClB,MAAM,EAAE,QAAQ,CAAC;QACjB,aAAa,EAAE,QAAQ,CAAC;QACxB,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;KAC1B;IAUD,SAAS,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAM9C"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { oNotificationEvent, } from './o-notification-event.js';
|
|
2
|
+
/**
|
|
3
|
+
* Emitted when a connection becomes degraded (some pings failing)
|
|
4
|
+
*/
|
|
5
|
+
export class ConnectionDegradedEvent extends oNotificationEvent {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
super({
|
|
8
|
+
type: 'connection:degraded',
|
|
9
|
+
source: config.source,
|
|
10
|
+
metadata: {
|
|
11
|
+
role: config.role,
|
|
12
|
+
consecutiveFailures: config.consecutiveFailures,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
this.targetAddress = config.targetAddress;
|
|
16
|
+
this.role = config.role;
|
|
17
|
+
this.consecutiveFailures = config.consecutiveFailures;
|
|
18
|
+
}
|
|
19
|
+
getEventData() {
|
|
20
|
+
return {
|
|
21
|
+
targetAddress: this.targetAddress.toString(),
|
|
22
|
+
role: this.role,
|
|
23
|
+
consecutiveFailures: this.consecutiveFailures,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Emitted when a degraded connection recovers
|
|
29
|
+
*/
|
|
30
|
+
export class ConnectionRecoveredEvent extends oNotificationEvent {
|
|
31
|
+
constructor(config) {
|
|
32
|
+
super({
|
|
33
|
+
type: 'connection:recovered',
|
|
34
|
+
source: config.source,
|
|
35
|
+
metadata: { role: config.role },
|
|
36
|
+
});
|
|
37
|
+
this.targetAddress = config.targetAddress;
|
|
38
|
+
this.role = config.role;
|
|
39
|
+
}
|
|
40
|
+
getEventData() {
|
|
41
|
+
return {
|
|
42
|
+
targetAddress: this.targetAddress.toString(),
|
|
43
|
+
role: this.role,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { oAddress } from '../../../router/o-address.js';
|
|
2
|
+
import { oNotificationEvent } from './o-notification-event.js';
|
|
3
|
+
/**
|
|
4
|
+
* Emitted when a child node joins the hierarchy (registers with parent)
|
|
5
|
+
*/
|
|
6
|
+
export declare class ChildJoinedEvent extends oNotificationEvent {
|
|
7
|
+
readonly childAddress: oAddress;
|
|
8
|
+
readonly parentAddress: oAddress;
|
|
9
|
+
constructor(config: {
|
|
10
|
+
source: oAddress;
|
|
11
|
+
childAddress: oAddress;
|
|
12
|
+
parentAddress: oAddress;
|
|
13
|
+
});
|
|
14
|
+
protected getEventData(): Record<string, any>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Emitted when a child node leaves the hierarchy (unregisters or disconnects)
|
|
18
|
+
*/
|
|
19
|
+
export declare class ChildLeftEvent extends oNotificationEvent {
|
|
20
|
+
readonly childAddress: oAddress;
|
|
21
|
+
readonly parentAddress: oAddress;
|
|
22
|
+
readonly reason?: string;
|
|
23
|
+
constructor(config: {
|
|
24
|
+
source: oAddress;
|
|
25
|
+
childAddress: oAddress;
|
|
26
|
+
parentAddress: oAddress;
|
|
27
|
+
reason?: string;
|
|
28
|
+
});
|
|
29
|
+
protected getEventData(): Record<string, any>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Emitted when a parent connection is established
|
|
33
|
+
*/
|
|
34
|
+
export declare class ParentConnectedEvent extends oNotificationEvent {
|
|
35
|
+
readonly parentAddress: oAddress;
|
|
36
|
+
constructor(config: {
|
|
37
|
+
source: oAddress;
|
|
38
|
+
parentAddress: oAddress;
|
|
39
|
+
});
|
|
40
|
+
protected getEventData(): Record<string, any>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Emitted when a parent connection is lost
|
|
44
|
+
*/
|
|
45
|
+
export declare class ParentDisconnectedEvent extends oNotificationEvent {
|
|
46
|
+
readonly parentAddress: oAddress;
|
|
47
|
+
readonly reason?: string;
|
|
48
|
+
constructor(config: {
|
|
49
|
+
source: oAddress;
|
|
50
|
+
parentAddress: oAddress;
|
|
51
|
+
reason?: string;
|
|
52
|
+
});
|
|
53
|
+
protected getEventData(): Record<string, any>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Emitted when connection to leader is lost (CRITICAL)
|
|
57
|
+
* This is a catastrophic failure - node cannot function without leader
|
|
58
|
+
*/
|
|
59
|
+
export declare class LeaderDisconnectedEvent extends oNotificationEvent {
|
|
60
|
+
readonly leaderAddress: oAddress;
|
|
61
|
+
readonly reason?: string;
|
|
62
|
+
constructor(config: {
|
|
63
|
+
source: oAddress;
|
|
64
|
+
leaderAddress: oAddress;
|
|
65
|
+
reason?: string;
|
|
66
|
+
});
|
|
67
|
+
protected getEventData(): Record<string, any>;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=hierarchy-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hierarchy-events.d.ts","sourceRoot":"","sources":["../../../../../../../o-core/src/core/lib/events/hierarchy-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,kBAAkB;IACtD,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC;gBAErB,MAAM,EAAE;QAClB,MAAM,EAAE,QAAQ,CAAC;QACjB,YAAY,EAAE,QAAQ,CAAC;QACvB,aAAa,EAAE,QAAQ,CAAC;KACzB;IASD,SAAS,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAM9C;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;IACpD,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEb,MAAM,EAAE;QAClB,MAAM,EAAE,QAAQ,CAAC;QACjB,YAAY,EAAE,QAAQ,CAAC;QACvB,aAAa,EAAE,QAAQ,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAWD,SAAS,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAO9C;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,kBAAkB;IAC1D,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC;gBAErB,MAAM,EAAE;QAAE,MAAM,EAAE,QAAQ,CAAC;QAAC,aAAa,EAAE,QAAQ,CAAA;KAAE;IAQjE,SAAS,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAK9C;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB;IAC7D,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEb,MAAM,EAAE;QAClB,MAAM,EAAE,QAAQ,CAAC;QACjB,aAAa,EAAE,QAAQ,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAUD,SAAS,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAM9C;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB;IAC7D,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEb,MAAM,EAAE;QAClB,MAAM,EAAE,QAAQ,CAAC;QACjB,aAAa,EAAE,QAAQ,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAUD,SAAS,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAM9C"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { oNotificationEvent, } from './o-notification-event.js';
|
|
2
|
+
/**
|
|
3
|
+
* Emitted when a child node joins the hierarchy (registers with parent)
|
|
4
|
+
*/
|
|
5
|
+
export class ChildJoinedEvent extends oNotificationEvent {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
super({
|
|
8
|
+
type: 'child:joined',
|
|
9
|
+
source: config.source,
|
|
10
|
+
});
|
|
11
|
+
this.childAddress = config.childAddress;
|
|
12
|
+
this.parentAddress = config.parentAddress;
|
|
13
|
+
}
|
|
14
|
+
getEventData() {
|
|
15
|
+
return {
|
|
16
|
+
childAddress: this.childAddress.toString(),
|
|
17
|
+
parentAddress: this.parentAddress.toString(),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Emitted when a child node leaves the hierarchy (unregisters or disconnects)
|
|
23
|
+
*/
|
|
24
|
+
export class ChildLeftEvent extends oNotificationEvent {
|
|
25
|
+
constructor(config) {
|
|
26
|
+
super({
|
|
27
|
+
type: 'child:left',
|
|
28
|
+
source: config.source,
|
|
29
|
+
metadata: { reason: config.reason },
|
|
30
|
+
});
|
|
31
|
+
this.childAddress = config.childAddress;
|
|
32
|
+
this.parentAddress = config.parentAddress;
|
|
33
|
+
this.reason = config.reason;
|
|
34
|
+
}
|
|
35
|
+
getEventData() {
|
|
36
|
+
return {
|
|
37
|
+
childAddress: this.childAddress.toString(),
|
|
38
|
+
parentAddress: this.parentAddress.toString(),
|
|
39
|
+
reason: this.reason,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Emitted when a parent connection is established
|
|
45
|
+
*/
|
|
46
|
+
export class ParentConnectedEvent extends oNotificationEvent {
|
|
47
|
+
constructor(config) {
|
|
48
|
+
super({
|
|
49
|
+
type: 'parent:connected',
|
|
50
|
+
source: config.source,
|
|
51
|
+
});
|
|
52
|
+
this.parentAddress = config.parentAddress;
|
|
53
|
+
}
|
|
54
|
+
getEventData() {
|
|
55
|
+
return {
|
|
56
|
+
parentAddress: this.parentAddress.toString(),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Emitted when a parent connection is lost
|
|
62
|
+
*/
|
|
63
|
+
export class ParentDisconnectedEvent extends oNotificationEvent {
|
|
64
|
+
constructor(config) {
|
|
65
|
+
super({
|
|
66
|
+
type: 'parent:disconnected',
|
|
67
|
+
source: config.source,
|
|
68
|
+
metadata: { reason: config.reason },
|
|
69
|
+
});
|
|
70
|
+
this.parentAddress = config.parentAddress;
|
|
71
|
+
this.reason = config.reason;
|
|
72
|
+
}
|
|
73
|
+
getEventData() {
|
|
74
|
+
return {
|
|
75
|
+
parentAddress: this.parentAddress.toString(),
|
|
76
|
+
reason: this.reason,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Emitted when connection to leader is lost (CRITICAL)
|
|
82
|
+
* This is a catastrophic failure - node cannot function without leader
|
|
83
|
+
*/
|
|
84
|
+
export class LeaderDisconnectedEvent extends oNotificationEvent {
|
|
85
|
+
constructor(config) {
|
|
86
|
+
super({
|
|
87
|
+
type: 'leader:disconnected',
|
|
88
|
+
source: config.source,
|
|
89
|
+
metadata: { reason: config.reason },
|
|
90
|
+
});
|
|
91
|
+
this.leaderAddress = config.leaderAddress;
|
|
92
|
+
this.reason = config.reason;
|
|
93
|
+
}
|
|
94
|
+
getEventData() {
|
|
95
|
+
return {
|
|
96
|
+
leaderAddress: this.leaderAddress.toString(),
|
|
97
|
+
reason: this.reason,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../o-core/src/core/lib/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { oAddress } from '../../../router/o-address.js';
|
|
2
|
+
import { oNotificationEvent } from './o-notification-event.js';
|
|
3
|
+
/**
|
|
4
|
+
* Emitted when a node establishes a connection (transport-agnostic)
|
|
5
|
+
*/
|
|
6
|
+
export declare class NodeConnectedEvent extends oNotificationEvent {
|
|
7
|
+
readonly nodeAddress: oAddress;
|
|
8
|
+
readonly connectionMetadata: Record<string, any>;
|
|
9
|
+
constructor(config: {
|
|
10
|
+
source: oAddress;
|
|
11
|
+
nodeAddress: oAddress;
|
|
12
|
+
connectionMetadata?: Record<string, any>;
|
|
13
|
+
});
|
|
14
|
+
protected getEventData(): Record<string, any>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Emitted when a node disconnects (transport-agnostic)
|
|
18
|
+
*/
|
|
19
|
+
export declare class NodeDisconnectedEvent extends oNotificationEvent {
|
|
20
|
+
readonly nodeAddress: oAddress;
|
|
21
|
+
readonly reason?: string;
|
|
22
|
+
constructor(config: {
|
|
23
|
+
source: oAddress;
|
|
24
|
+
nodeAddress: oAddress;
|
|
25
|
+
reason?: string;
|
|
26
|
+
});
|
|
27
|
+
protected getEventData(): Record<string, any>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Emitted when a node is discovered but not yet connected
|
|
31
|
+
*/
|
|
32
|
+
export declare class NodeDiscoveredEvent extends oNotificationEvent {
|
|
33
|
+
readonly nodeAddress: oAddress;
|
|
34
|
+
constructor(config: {
|
|
35
|
+
source: oAddress;
|
|
36
|
+
nodeAddress: oAddress;
|
|
37
|
+
});
|
|
38
|
+
protected getEventData(): Record<string, any>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=node-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-events.d.ts","sourceRoot":"","sources":["../../../../../../../o-core/src/core/lib/events/node-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,kBAAkB;IACxD,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC;IAC/B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBAErC,MAAM,EAAE;QAClB,MAAM,EAAE,QAAQ,CAAC;QACjB,WAAW,EAAE,QAAQ,CAAC;QACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC1C;IAUD,SAAS,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAM9C;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,kBAAkB;IAC3D,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEb,MAAM,EAAE;QAClB,MAAM,EAAE,QAAQ,CAAC;QACjB,WAAW,EAAE,QAAQ,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAUD,SAAS,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAM9C;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,kBAAkB;IACzD,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC;gBAEnB,MAAM,EAAE;QAAE,MAAM,EAAE,QAAQ,CAAC;QAAC,WAAW,EAAE,QAAQ,CAAA;KAAE;IAQ/D,SAAS,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAK9C"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { oNotificationEvent, } from './o-notification-event.js';
|
|
2
|
+
/**
|
|
3
|
+
* Emitted when a node establishes a connection (transport-agnostic)
|
|
4
|
+
*/
|
|
5
|
+
export class NodeConnectedEvent extends oNotificationEvent {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
super({
|
|
8
|
+
type: 'node:connected',
|
|
9
|
+
source: config.source,
|
|
10
|
+
metadata: config.connectionMetadata || {},
|
|
11
|
+
});
|
|
12
|
+
this.nodeAddress = config.nodeAddress;
|
|
13
|
+
this.connectionMetadata = config.connectionMetadata || {};
|
|
14
|
+
}
|
|
15
|
+
getEventData() {
|
|
16
|
+
return {
|
|
17
|
+
nodeAddress: this.nodeAddress.toString(),
|
|
18
|
+
connectionMetadata: this.connectionMetadata,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Emitted when a node disconnects (transport-agnostic)
|
|
24
|
+
*/
|
|
25
|
+
export class NodeDisconnectedEvent extends oNotificationEvent {
|
|
26
|
+
constructor(config) {
|
|
27
|
+
super({
|
|
28
|
+
type: 'node:disconnected',
|
|
29
|
+
source: config.source,
|
|
30
|
+
metadata: { reason: config.reason },
|
|
31
|
+
});
|
|
32
|
+
this.nodeAddress = config.nodeAddress;
|
|
33
|
+
this.reason = config.reason;
|
|
34
|
+
}
|
|
35
|
+
getEventData() {
|
|
36
|
+
return {
|
|
37
|
+
nodeAddress: this.nodeAddress.toString(),
|
|
38
|
+
reason: this.reason,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Emitted when a node is discovered but not yet connected
|
|
44
|
+
*/
|
|
45
|
+
export class NodeDiscoveredEvent extends oNotificationEvent {
|
|
46
|
+
constructor(config) {
|
|
47
|
+
super({
|
|
48
|
+
type: 'node:discovered',
|
|
49
|
+
source: config.source,
|
|
50
|
+
});
|
|
51
|
+
this.nodeAddress = config.nodeAddress;
|
|
52
|
+
}
|
|
53
|
+
getEventData() {
|
|
54
|
+
return {
|
|
55
|
+
nodeAddress: this.nodeAddress.toString(),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { oAddress } from '../../../router/o-address.js';
|
|
2
|
+
export interface oNotificationEventConfig {
|
|
3
|
+
type: string;
|
|
4
|
+
source: oAddress;
|
|
5
|
+
metadata?: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Base class for all notification events in the Olane system.
|
|
9
|
+
* Transport-agnostic - contains only Olane concepts, no libp2p/HTTP/etc dependencies.
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class oNotificationEvent {
|
|
12
|
+
readonly type: string;
|
|
13
|
+
readonly timestamp: Date;
|
|
14
|
+
readonly source: oAddress;
|
|
15
|
+
readonly metadata: Record<string, any>;
|
|
16
|
+
constructor(config: oNotificationEventConfig);
|
|
17
|
+
/**
|
|
18
|
+
* Serialize event to JSON for transmission
|
|
19
|
+
*/
|
|
20
|
+
toJSON(): Record<string, any>;
|
|
21
|
+
/**
|
|
22
|
+
* Subclasses override to provide event-specific data
|
|
23
|
+
*/
|
|
24
|
+
protected getEventData(): Record<string, any>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=o-notification-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-notification-event.d.ts","sourceRoot":"","sources":["../../../../../../../o-core/src/core/lib/events/o-notification-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED;;;GAGG;AACH,8BAAsB,kBAAkB;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBAE3B,MAAM,EAAE,wBAAwB;IAO5C;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAU7B;;OAEG;IACH,SAAS,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAG9C"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for all notification events in the Olane system.
|
|
3
|
+
* Transport-agnostic - contains only Olane concepts, no libp2p/HTTP/etc dependencies.
|
|
4
|
+
*/
|
|
5
|
+
export class oNotificationEvent {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.type = config.type;
|
|
8
|
+
this.source = config.source;
|
|
9
|
+
this.metadata = config.metadata || {};
|
|
10
|
+
this.timestamp = new Date();
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Serialize event to JSON for transmission
|
|
14
|
+
*/
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
type: this.type,
|
|
18
|
+
timestamp: this.timestamp.toISOString(),
|
|
19
|
+
source: this.source.toString(),
|
|
20
|
+
metadata: this.metadata,
|
|
21
|
+
...this.getEventData(),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Subclasses override to provide event-specific data
|
|
26
|
+
*/
|
|
27
|
+
getEventData() {
|
|
28
|
+
return {};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './o-hierarchy.manager.js';
|
|
2
|
+
export * from './o-metrics.js';
|
|
3
|
+
export * from './o-request.manager.js';
|
|
4
|
+
export * from './o-notification.manager.js';
|
|
5
|
+
export * from './events/index.js';
|
|
6
|
+
export * from './interfaces/notification-types.js';
|
|
7
|
+
export * from './utils/event-filters.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../o-core/src/core/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './o-hierarchy.manager.js';
|
|
2
|
+
export * from './o-metrics.js';
|
|
3
|
+
export * from './o-request.manager.js';
|
|
4
|
+
export * from './o-notification.manager.js';
|
|
5
|
+
export * from './events/index.js';
|
|
6
|
+
export * from './interfaces/notification-types.js';
|
|
7
|
+
export * from './utils/event-filters.js';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { oNotificationEvent } from '../events/o-notification-event.js';
|
|
2
|
+
/**
|
|
3
|
+
* Handler function for notification events
|
|
4
|
+
*/
|
|
5
|
+
export type NotificationHandler = (event: oNotificationEvent) => void | Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Filter for event subscriptions
|
|
8
|
+
*/
|
|
9
|
+
export interface EventFilter {
|
|
10
|
+
/**
|
|
11
|
+
* Match events from nodes matching this address pattern
|
|
12
|
+
* Supports wildcards: e.g., "o://leader/children/*"
|
|
13
|
+
*/
|
|
14
|
+
addressPattern?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Only match these specific event types
|
|
17
|
+
*/
|
|
18
|
+
eventTypes?: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Custom filter function
|
|
21
|
+
*/
|
|
22
|
+
customFilter?: (event: oNotificationEvent) => boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Subscription handle returned when subscribing to events
|
|
26
|
+
*/
|
|
27
|
+
export interface Subscription {
|
|
28
|
+
/**
|
|
29
|
+
* Unique subscription ID
|
|
30
|
+
*/
|
|
31
|
+
id: string;
|
|
32
|
+
/**
|
|
33
|
+
* Event type subscribed to
|
|
34
|
+
*/
|
|
35
|
+
eventType: string;
|
|
36
|
+
/**
|
|
37
|
+
* Handler function
|
|
38
|
+
*/
|
|
39
|
+
handler: NotificationHandler;
|
|
40
|
+
/**
|
|
41
|
+
* Optional filter
|
|
42
|
+
*/
|
|
43
|
+
filter?: EventFilter;
|
|
44
|
+
/**
|
|
45
|
+
* Unsubscribe from this event
|
|
46
|
+
*/
|
|
47
|
+
unsubscribe(): void;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=notification-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-types.d.ts","sourceRoot":"","sources":["../../../../../../../o-core/src/core/lib/interfaces/notification-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAChC,KAAK,EAAE,kBAAkB,KACtB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC;CACvD;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,mBAAmB,CAAC;IAE7B;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;OAEG;IACH,WAAW,IAAI,IAAI,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { oAddress } from '../../router/o-address.js';
|
|
2
|
+
import { oObject } from '../o-object.js';
|
|
3
|
+
export interface oHierarchyManagerConfig {
|
|
4
|
+
leaders?: oAddress[];
|
|
5
|
+
parents?: oAddress[];
|
|
6
|
+
children?: oAddress[];
|
|
7
|
+
}
|
|
8
|
+
export declare class oHierarchyManager extends oObject {
|
|
9
|
+
leaders: oAddress[];
|
|
10
|
+
children: oAddress[];
|
|
11
|
+
parents: oAddress[];
|
|
12
|
+
constructor(config: oHierarchyManagerConfig);
|
|
13
|
+
clear(): void;
|
|
14
|
+
private deduplicate;
|
|
15
|
+
addChild(address: oAddress): void;
|
|
16
|
+
getChild(address: oAddress): oAddress | undefined;
|
|
17
|
+
removeChild(address: oAddress | string): void;
|
|
18
|
+
addParent(address: oAddress): void;
|
|
19
|
+
removeParent(address: oAddress | string): void;
|
|
20
|
+
getChildren(): oAddress[];
|
|
21
|
+
getParents(): oAddress[];
|
|
22
|
+
getLeaders(): oAddress[];
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=o-hierarchy.manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-hierarchy.manager.d.ts","sourceRoot":"","sources":["../../../../../../o-core/src/core/lib/o-hierarchy.manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,qBAAa,iBAAkB,SAAQ,OAAO;IACrC,OAAO,EAAE,QAAQ,EAAE,CAAM;IACzB,QAAQ,EAAE,QAAQ,EAAE,CAAM;IAC1B,OAAO,EAAE,QAAQ,EAAE,CAAM;gBAEpB,MAAM,EAAE,uBAAuB;IAO3C,KAAK,IAAI,IAAI;IAMb,OAAO,CAAC,WAAW;IAWnB,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,IAAI;IAOjC,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS;IAOjD,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI;IAM7C,SAAS,CAAC,OAAO,EAAE,QAAQ,GAAG,IAAI;IAIlC,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI;IAM9C,WAAW,IAAI,QAAQ,EAAE;IAIzB,UAAU,IAAI,QAAQ,EAAE;IAIxB,UAAU,IAAI,QAAQ,EAAE;CAGzB"}
|