@graphrefly/graphrefly 0.10.0 → 0.11.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 (69) hide show
  1. package/dist/{chunk-WYI7YW54.js → chunk-2OTXEZQO.js} +3 -3
  2. package/dist/{chunk-TZLX4KIT.js → chunk-2VHNCFGG.js} +3 -3
  3. package/dist/{chunk-XCZPGOVP.js → chunk-3WACHRHV.js} +3 -3
  4. package/dist/{chunk-YWTP2XRJ.js → chunk-5WXTWOD7.js} +2 -2
  5. package/dist/{chunk-E7OH6ZAZ.js → chunk-FMVFRP7L.js} +62 -3
  6. package/dist/chunk-FMVFRP7L.js.map +1 -0
  7. package/dist/{chunk-LR2CLSEF.js → chunk-OHUECHWY.js} +2 -3
  8. package/dist/chunk-OHUECHWY.js.map +1 -0
  9. package/dist/{chunk-UCW3VWMN.js → chunk-PZCDQD2U.js} +4 -4
  10. package/dist/{chunk-A2AJJOSJ.js → chunk-U5HFZGAQ.js} +3 -3
  11. package/dist/{chunk-QTZSBQGJ.js → chunk-UG2QZMRN.js} +18 -1
  12. package/dist/chunk-UG2QZMRN.js.map +1 -0
  13. package/dist/compat/nestjs/index.cjs +10 -1
  14. package/dist/compat/nestjs/index.cjs.map +1 -1
  15. package/dist/compat/nestjs/index.d.cts +4 -4
  16. package/dist/compat/nestjs/index.d.ts +4 -4
  17. package/dist/compat/nestjs/index.js +7 -7
  18. package/dist/core/index.cjs +74 -1
  19. package/dist/core/index.cjs.map +1 -1
  20. package/dist/core/index.d.cts +2 -2
  21. package/dist/core/index.d.ts +2 -2
  22. package/dist/core/index.js +12 -3
  23. package/dist/extra/index.cjs +10 -0
  24. package/dist/extra/index.cjs.map +1 -1
  25. package/dist/extra/index.d.cts +4 -4
  26. package/dist/extra/index.d.ts +4 -4
  27. package/dist/extra/index.js +3 -3
  28. package/dist/graph/index.cjs +10 -1
  29. package/dist/graph/index.cjs.map +1 -1
  30. package/dist/graph/index.d.cts +3 -3
  31. package/dist/graph/index.d.ts +3 -3
  32. package/dist/graph/index.js +4 -4
  33. package/dist/{graph-DqTICAY2.d.cts → graph-BE10ujU9.d.cts} +1 -1
  34. package/dist/{graph-X9uwnD_z.d.ts → graph-DXT95WZ3.d.ts} +1 -1
  35. package/dist/{index-DLO8wnYU.d.ts → index-53cDGX7F.d.ts} +3 -3
  36. package/dist/{index-DMv1Etbi.d.ts → index-B10Q0sQB.d.ts} +2 -2
  37. package/dist/{index-a5gHmH5b.d.ts → index-Bbgvinsi.d.ts} +3 -3
  38. package/dist/{index-BPCeYDS4.d.ts → index-C0_7g9sj.d.ts} +1 -1
  39. package/dist/{index-3U0WxdD-.d.cts → index-CCvzN5GB.d.cts} +2 -2
  40. package/dist/{index-BP1t_38S.d.cts → index-DpZozxaJ.d.cts} +3 -3
  41. package/dist/{index-BVG5pjin.d.ts → index-Dzdm20sx.d.ts} +88 -3
  42. package/dist/{index-BYEgosAX.d.cts → index-QfbXNW1N.d.cts} +88 -3
  43. package/dist/{index-BYa2YMat.d.cts → index-aBZ2RoP0.d.cts} +3 -3
  44. package/dist/{index-DbwgQ4Cw.d.cts → index-nRulwTr-.d.cts} +1 -1
  45. package/dist/index.cjs +855 -101
  46. package/dist/index.cjs.map +1 -1
  47. package/dist/index.d.cts +349 -19
  48. package/dist/index.d.ts +349 -19
  49. package/dist/index.js +800 -116
  50. package/dist/index.js.map +1 -1
  51. package/dist/{meta-BJEU8fYz.d.cts → meta-BcuDhtwu.d.cts} +33 -1
  52. package/dist/{meta-BJEU8fYz.d.ts → meta-BcuDhtwu.d.ts} +33 -1
  53. package/dist/patterns/reactive-layout/index.cjs +10 -1
  54. package/dist/patterns/reactive-layout/index.cjs.map +1 -1
  55. package/dist/patterns/reactive-layout/index.d.cts +3 -3
  56. package/dist/patterns/reactive-layout/index.d.ts +3 -3
  57. package/dist/patterns/reactive-layout/index.js +4 -4
  58. package/dist/{reactive-log-RhgIog2Z.d.ts → reactive-log-Cu0VdqkT.d.ts} +2 -2
  59. package/dist/{reactive-log-BfX6bOSZ.d.cts → reactive-log-OULQssZg.d.cts} +2 -2
  60. package/package.json +7 -2
  61. package/dist/chunk-E7OH6ZAZ.js.map +0 -1
  62. package/dist/chunk-LR2CLSEF.js.map +0 -1
  63. package/dist/chunk-QTZSBQGJ.js.map +0 -1
  64. /package/dist/{chunk-WYI7YW54.js.map → chunk-2OTXEZQO.js.map} +0 -0
  65. /package/dist/{chunk-TZLX4KIT.js.map → chunk-2VHNCFGG.js.map} +0 -0
  66. /package/dist/{chunk-XCZPGOVP.js.map → chunk-3WACHRHV.js.map} +0 -0
  67. /package/dist/{chunk-YWTP2XRJ.js.map → chunk-5WXTWOD7.js.map} +0 -0
  68. /package/dist/{chunk-UCW3VWMN.js.map → chunk-PZCDQD2U.js.map} +0 -0
  69. /package/dist/{chunk-A2AJJOSJ.js.map → chunk-U5HFZGAQ.js.map} +0 -0
@@ -1,7 +1,7 @@
1
- export { o as observeGraph$, c as observeNode$, t as toMessages$, d as toObservable } from '../../reactive-log-BfX6bOSZ.cjs';
2
- export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, d as CRON_HANDLERS, e as CommandHandler, f as CommandHandlerMeta, E as EVENT_HANDLERS, g as EventHandler, h as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, j as GRAPHREFLY_ROOT_GRAPH, k as GraphCron, l as GraphCronMeta, m as GraphInterval, n as GraphIntervalMeta, o as GraphReflyCqrsOptions, p as GraphReflyEventExplorer, q as GraphReflyFeatureOptions, r as GraphReflyGuard, s as GraphReflyGuardImpl, t as GraphReflyModule, u as GraphReflyRootOptions, I as INTERVAL_HANDLERS, v as InjectCqrsGraph, w as InjectGraph, x as InjectNode, O as ObserveGateway, y as ObserveGatewayOptions, z as ObserveSSEOptions, B as ObserveSubscriptionOptions, D as ObserveWsCommand, F as ObserveWsMessage, H as OnGraphEvent, J as OnGraphEventMeta, Q as QUERY_HANDLERS, K as QueryHandler, L as QueryHandlerMeta, S as SAGA_HANDLERS, M as SagaHandler, N as SagaHandlerMeta, P as fromHeader, R as fromJwtPayload, T as getActor, U as getGraphToken, V as getNodeToken, W as observeSSE, X as observeSubscription } from '../../index-BYa2YMat.cjs';
1
+ export { o as observeGraph$, c as observeNode$, t as toMessages$, d as toObservable } from '../../reactive-log-OULQssZg.cjs';
2
+ export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, d as CRON_HANDLERS, e as CommandHandler, f as CommandHandlerMeta, E as EVENT_HANDLERS, g as EventHandler, h as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, j as GRAPHREFLY_ROOT_GRAPH, k as GraphCron, l as GraphCronMeta, m as GraphInterval, n as GraphIntervalMeta, o as GraphReflyCqrsOptions, p as GraphReflyEventExplorer, q as GraphReflyFeatureOptions, r as GraphReflyGuard, s as GraphReflyGuardImpl, t as GraphReflyModule, u as GraphReflyRootOptions, I as INTERVAL_HANDLERS, v as InjectCqrsGraph, w as InjectGraph, x as InjectNode, O as ObserveGateway, y as ObserveGatewayOptions, z as ObserveSSEOptions, B as ObserveSubscriptionOptions, D as ObserveWsCommand, F as ObserveWsMessage, H as OnGraphEvent, J as OnGraphEventMeta, Q as QUERY_HANDLERS, K as QueryHandler, L as QueryHandlerMeta, S as SAGA_HANDLERS, M as SagaHandler, N as SagaHandlerMeta, P as fromHeader, R as fromJwtPayload, T as getActor, U as getGraphToken, V as getNodeToken, W as observeSSE, X as observeSubscription } from '../../index-aBZ2RoP0.cjs';
3
3
  import 'rxjs';
4
- import '../../meta-BJEU8fYz.cjs';
5
- import '../../graph-DqTICAY2.cjs';
4
+ import '../../meta-BcuDhtwu.cjs';
5
+ import '../../graph-BE10ujU9.cjs';
6
6
  import '@nestjs/common';
7
7
  import '@nestjs/core';
@@ -1,7 +1,7 @@
1
- export { o as observeGraph$, c as observeNode$, t as toMessages$, d as toObservable } from '../../reactive-log-RhgIog2Z.js';
2
- export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, d as CRON_HANDLERS, e as CommandHandler, f as CommandHandlerMeta, E as EVENT_HANDLERS, g as EventHandler, h as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, j as GRAPHREFLY_ROOT_GRAPH, k as GraphCron, l as GraphCronMeta, m as GraphInterval, n as GraphIntervalMeta, o as GraphReflyCqrsOptions, p as GraphReflyEventExplorer, q as GraphReflyFeatureOptions, r as GraphReflyGuard, s as GraphReflyGuardImpl, t as GraphReflyModule, u as GraphReflyRootOptions, I as INTERVAL_HANDLERS, v as InjectCqrsGraph, w as InjectGraph, x as InjectNode, O as ObserveGateway, y as ObserveGatewayOptions, z as ObserveSSEOptions, B as ObserveSubscriptionOptions, D as ObserveWsCommand, F as ObserveWsMessage, H as OnGraphEvent, J as OnGraphEventMeta, Q as QUERY_HANDLERS, K as QueryHandler, L as QueryHandlerMeta, S as SAGA_HANDLERS, M as SagaHandler, N as SagaHandlerMeta, P as fromHeader, R as fromJwtPayload, T as getActor, U as getGraphToken, V as getNodeToken, W as observeSSE, X as observeSubscription } from '../../index-DLO8wnYU.js';
1
+ export { o as observeGraph$, c as observeNode$, t as toMessages$, d as toObservable } from '../../reactive-log-Cu0VdqkT.js';
2
+ export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, d as CRON_HANDLERS, e as CommandHandler, f as CommandHandlerMeta, E as EVENT_HANDLERS, g as EventHandler, h as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, j as GRAPHREFLY_ROOT_GRAPH, k as GraphCron, l as GraphCronMeta, m as GraphInterval, n as GraphIntervalMeta, o as GraphReflyCqrsOptions, p as GraphReflyEventExplorer, q as GraphReflyFeatureOptions, r as GraphReflyGuard, s as GraphReflyGuardImpl, t as GraphReflyModule, u as GraphReflyRootOptions, I as INTERVAL_HANDLERS, v as InjectCqrsGraph, w as InjectGraph, x as InjectNode, O as ObserveGateway, y as ObserveGatewayOptions, z as ObserveSSEOptions, B as ObserveSubscriptionOptions, D as ObserveWsCommand, F as ObserveWsMessage, H as OnGraphEvent, J as OnGraphEventMeta, Q as QUERY_HANDLERS, K as QueryHandler, L as QueryHandlerMeta, S as SAGA_HANDLERS, M as SagaHandler, N as SagaHandlerMeta, P as fromHeader, R as fromJwtPayload, T as getActor, U as getGraphToken, V as getNodeToken, W as observeSSE, X as observeSubscription } from '../../index-53cDGX7F.js';
3
3
  import 'rxjs';
4
- import '../../meta-BJEU8fYz.js';
5
- import '../../graph-X9uwnD_z.js';
4
+ import '../../meta-BcuDhtwu.js';
5
+ import '../../graph-DXT95WZ3.js';
6
6
  import '@nestjs/common';
7
7
  import '@nestjs/core';
@@ -31,19 +31,19 @@ import {
31
31
  getNodeToken,
32
32
  observeSSE,
33
33
  observeSubscription
34
- } from "../../chunk-UCW3VWMN.js";
35
- import "../../chunk-E7OH6ZAZ.js";
34
+ } from "../../chunk-PZCDQD2U.js";
35
+ import "../../chunk-FMVFRP7L.js";
36
+ import "../../chunk-U5HFZGAQ.js";
36
37
  import {
37
38
  observeGraph$,
38
39
  observeNode$,
39
40
  toMessages$,
40
41
  toObservable
41
- } from "../../chunk-YWTP2XRJ.js";
42
+ } from "../../chunk-5WXTWOD7.js";
42
43
  import "../../chunk-WZ2Z2CRV.js";
43
- import "../../chunk-A2AJJOSJ.js";
44
- import "../../chunk-WYI7YW54.js";
45
- import "../../chunk-LR2CLSEF.js";
46
- import "../../chunk-QTZSBQGJ.js";
44
+ import "../../chunk-2OTXEZQO.js";
45
+ import "../../chunk-OHUECHWY.js";
46
+ import "../../chunk-UG2QZMRN.js";
47
47
  export {
48
48
  ACTOR_KEY,
49
49
  COMMAND_HANDLERS,
@@ -20,9 +20,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/core/index.ts
21
21
  var core_exports = {};
22
22
  __export(core_exports, {
23
+ CLEANUP_RESULT: () => CLEANUP_RESULT,
23
24
  COMPLETE: () => COMPLETE,
24
25
  DATA: () => DATA,
25
26
  DEFAULT_ACTOR: () => DEFAULT_ACTOR,
27
+ DEFAULT_DOWN: () => DEFAULT_DOWN,
26
28
  DIRTY: () => DIRTY,
27
29
  DynamicNodeImpl: () => DynamicNodeImpl,
28
30
  ERROR: () => ERROR,
@@ -36,6 +38,8 @@ __export(core_exports, {
36
38
  accessHintForGuard: () => accessHintForGuard,
37
39
  advanceVersion: () => advanceVersion,
38
40
  batch: () => batch,
41
+ bridge: () => bridge,
42
+ cleanupResult: () => cleanupResult,
39
43
  createVersioning: () => createVersioning,
40
44
  defaultHash: () => defaultHash,
41
45
  derived: () => derived,
@@ -464,6 +468,7 @@ function isV1(info) {
464
468
 
465
469
  // src/core/node.ts
466
470
  var NO_VALUE = /* @__PURE__ */ Symbol.for("graphrefly/NO_VALUE");
471
+ var CLEANUP_RESULT = /* @__PURE__ */ Symbol.for("graphrefly/CLEANUP_RESULT");
467
472
  function createIntBitSet() {
468
473
  let bits = 0;
469
474
  return {
@@ -526,6 +531,12 @@ function createBitSet(size) {
526
531
  }
527
532
  var isNodeArray = (value) => Array.isArray(value);
528
533
  var isNodeOptions = (value) => typeof value === "object" && value != null && !Array.isArray(value);
534
+ function cleanupResult(cleanup, ...args) {
535
+ const r = { [CLEANUP_RESULT]: true, cleanup };
536
+ if (args.length > 0) r.value = args[0];
537
+ return r;
538
+ }
539
+ var isCleanupResult = (value) => typeof value === "object" && value !== null && CLEANUP_RESULT in value;
529
540
  var isCleanupFn = (value) => typeof value === "function";
530
541
  var statusAfterMessage = (status, msg) => {
531
542
  const t = msg[0];
@@ -941,6 +952,14 @@ var NodeImpl = class {
941
952
  this._lastDepValues = depValues;
942
953
  this._inspectorHook?.({ kind: "run", depValues });
943
954
  const out = this._fn(depValues, this._actions);
955
+ if (isCleanupResult(out)) {
956
+ this._cleanup = out.cleanup;
957
+ if (this._manualEmitUsed) return;
958
+ if ("value" in out) {
959
+ this._emitAutoValue(out.value);
960
+ }
961
+ return;
962
+ }
944
963
  if (isCleanupFn(out)) {
945
964
  this._cleanup = out;
946
965
  return;
@@ -1098,6 +1117,57 @@ function node(depsOrFn, fnOrOpts, optsArg) {
1098
1117
  return new NodeImpl(deps, fn, opts);
1099
1118
  }
1100
1119
 
1120
+ // src/core/bridge.ts
1121
+ var DEFAULT_DOWN = [
1122
+ DATA,
1123
+ DIRTY,
1124
+ RESOLVED,
1125
+ COMPLETE,
1126
+ ERROR,
1127
+ TEARDOWN,
1128
+ PAUSE,
1129
+ RESUME,
1130
+ INVALIDATE
1131
+ ];
1132
+ var STANDARD_TYPES = /* @__PURE__ */ new Set([
1133
+ DATA,
1134
+ DIRTY,
1135
+ RESOLVED,
1136
+ COMPLETE,
1137
+ ERROR,
1138
+ TEARDOWN,
1139
+ PAUSE,
1140
+ RESUME,
1141
+ INVALIDATE
1142
+ ]);
1143
+ function bridge(from, to, opts) {
1144
+ const allowedDown = new Set(opts?.down ?? DEFAULT_DOWN);
1145
+ const onMessage = (msg, _depIndex, _actions) => {
1146
+ const type = msg[0];
1147
+ if (!STANDARD_TYPES.has(type)) {
1148
+ to.down([msg]);
1149
+ return true;
1150
+ }
1151
+ if (type === COMPLETE || type === ERROR) {
1152
+ if (allowedDown.has(type)) {
1153
+ to.down([msg]);
1154
+ }
1155
+ return false;
1156
+ }
1157
+ if (!allowedDown.has(type)) {
1158
+ return true;
1159
+ }
1160
+ to.down([msg]);
1161
+ return true;
1162
+ };
1163
+ return node([from], void 0, {
1164
+ name: opts?.name,
1165
+ describeKind: "effect",
1166
+ onMessage,
1167
+ meta: { _internal: true }
1168
+ });
1169
+ }
1170
+
1101
1171
  // src/core/dynamic-node.ts
1102
1172
  function dynamicNode(fn, opts) {
1103
1173
  return new DynamicNodeImpl(fn, opts ?? {});
@@ -1578,7 +1648,6 @@ function resolveDescribeFields(detail, fields) {
1578
1648
  case "full":
1579
1649
  return null;
1580
1650
  // null = include everything
1581
- case "minimal":
1582
1651
  default:
1583
1652
  return /* @__PURE__ */ new Set(["type", "deps"]);
1584
1653
  }
@@ -1713,9 +1782,11 @@ var ResettableTimer = class {
1713
1782
  };
1714
1783
  // Annotate the CommonJS export names for ESM import in node:
1715
1784
  0 && (module.exports = {
1785
+ CLEANUP_RESULT,
1716
1786
  COMPLETE,
1717
1787
  DATA,
1718
1788
  DEFAULT_ACTOR,
1789
+ DEFAULT_DOWN,
1719
1790
  DIRTY,
1720
1791
  DynamicNodeImpl,
1721
1792
  ERROR,
@@ -1729,6 +1800,8 @@ var ResettableTimer = class {
1729
1800
  accessHintForGuard,
1730
1801
  advanceVersion,
1731
1802
  batch,
1803
+ bridge,
1804
+ cleanupResult,
1732
1805
  createVersioning,
1733
1806
  defaultHash,
1734
1807
  derived,