@graphrefly/graphrefly 0.44.0 → 0.46.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/README.md +22 -19
- package/dist/_internal-B23BagFd.d.cts +33 -0
- package/dist/_internal-B23BagFd.d.ts +33 -0
- package/dist/adaptive-rate-limiter-Dch_xYIi.d.cts +111 -0
- package/dist/adaptive-rate-limiter-Dch_xYIi.d.ts +111 -0
- package/dist/agents-C0Ji9ldU.d.cts +629 -0
- package/dist/agents-C9zexT7I.d.ts +629 -0
- package/dist/audit-BAXb3VOg.d.ts +246 -0
- package/dist/audit-C_bPfkqS.d.cts +246 -0
- package/dist/backoff-7KIK3WQW.js +24 -0
- package/dist/backoff-7KIK3WQW.js.map +1 -0
- package/dist/backoff-Bnb9OoPh.d.cts +6 -0
- package/dist/backoff-Bnb9OoPh.d.ts +6 -0
- package/dist/base/composition/index.cjs +811 -0
- package/dist/base/composition/index.cjs.map +1 -0
- package/dist/base/composition/index.d.cts +469 -0
- package/dist/base/composition/index.d.ts +469 -0
- package/dist/base/composition/index.js +40 -0
- package/dist/base/composition/index.js.map +1 -0
- package/dist/base/index.cjs +6336 -0
- package/dist/base/index.cjs.map +1 -0
- package/dist/base/index.d.cts +22 -0
- package/dist/base/index.d.ts +22 -0
- package/dist/base/index.js +259 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/io/index.cjs +3270 -0
- package/dist/base/io/index.cjs.map +1 -0
- package/dist/base/io/index.d.cts +2245 -0
- package/dist/base/io/index.d.ts +2245 -0
- package/dist/base/io/index.js +117 -0
- package/dist/base/io/index.js.map +1 -0
- package/dist/base/meta/index.cjs +43 -0
- package/dist/base/meta/index.cjs.map +1 -0
- package/dist/base/meta/index.d.cts +45 -0
- package/dist/base/meta/index.d.ts +45 -0
- package/dist/base/meta/index.js +13 -0
- package/dist/base/meta/index.js.map +1 -0
- package/dist/base/mutation/index.cjs +200 -0
- package/dist/base/mutation/index.cjs.map +1 -0
- package/dist/base/mutation/index.d.cts +177 -0
- package/dist/base/mutation/index.d.ts +177 -0
- package/dist/base/mutation/index.js +22 -0
- package/dist/base/mutation/index.js.map +1 -0
- package/dist/base/render/index.cjs +1120 -0
- package/dist/base/render/index.cjs.map +1 -0
- package/dist/{extra/render/index.d.ts → base/render/index.d.cts} +75 -31
- package/dist/{extra/render/index.d.cts → base/render/index.d.ts} +75 -31
- package/dist/base/render/index.js +24 -0
- package/dist/base/render/index.js.map +1 -0
- package/dist/base/sources/browser/index.cjs +172 -0
- package/dist/base/sources/browser/index.cjs.map +1 -0
- package/dist/base/sources/browser/index.d.cts +84 -0
- package/dist/base/sources/browser/index.d.ts +84 -0
- package/dist/base/sources/browser/index.js +151 -0
- package/dist/base/sources/browser/index.js.map +1 -0
- package/dist/base/sources/event/index.cjs +98 -0
- package/dist/base/sources/event/index.cjs.map +1 -0
- package/dist/base/sources/event/index.d.cts +91 -0
- package/dist/base/sources/event/index.d.ts +91 -0
- package/dist/base/sources/event/index.js +13 -0
- package/dist/base/sources/event/index.js.map +1 -0
- package/dist/base/sources/index.cjs +755 -0
- package/dist/base/sources/index.cjs.map +1 -0
- package/dist/{extra/sources.d.ts → base/sources/index.d.cts} +74 -301
- package/dist/{extra/sources.d.cts → base/sources/index.d.ts} +74 -301
- package/dist/base/sources/index.js +42 -0
- package/dist/base/sources/index.js.map +1 -0
- package/dist/base/sources/node/index.cjs +320 -0
- package/dist/base/sources/node/index.cjs.map +1 -0
- package/dist/{extra/node.d.ts → base/sources/node/index.d.cts} +35 -37
- package/dist/{extra/node.d.cts → base/sources/node/index.d.ts} +35 -37
- package/dist/base/sources/node/index.js +306 -0
- package/dist/base/sources/node/index.js.map +1 -0
- package/dist/base/utils/index.cjs +37 -0
- package/dist/base/utils/index.cjs.map +1 -0
- package/dist/base/utils/index.d.cts +37 -0
- package/dist/base/utils/index.d.ts +37 -0
- package/dist/base/utils/index.js +11 -0
- package/dist/base/utils/index.js.map +1 -0
- package/dist/base/worker/index.cjs +548 -0
- package/dist/base/worker/index.cjs.map +1 -0
- package/dist/base/worker/index.d.cts +207 -0
- package/dist/base/worker/index.d.ts +207 -0
- package/dist/base/worker/index.js +20 -0
- package/dist/base/worker/index.js.map +1 -0
- package/dist/breaker-C9skL3d8.d.ts +175 -0
- package/dist/breaker-ugSdq54q.d.cts +175 -0
- package/dist/{cascading-BglDkMdX.d.cts → cascading-CSSbKGrJ.d.ts} +3 -3
- package/dist/{cascading-MFgxu7Yo.d.ts → cascading-baGkiihI.d.cts} +3 -3
- package/dist/chunk-255UCBG4.js +58 -0
- package/dist/chunk-255UCBG4.js.map +1 -0
- package/dist/chunk-2LO3EL4W.js +1 -0
- package/dist/chunk-2LO3EL4W.js.map +1 -0
- package/dist/chunk-2OB3CEJS.js +1065 -0
- package/dist/chunk-2OB3CEJS.js.map +1 -0
- package/dist/chunk-36NMM65U.js +144 -0
- package/dist/chunk-36NMM65U.js.map +1 -0
- package/dist/chunk-3CEXCBN6.js +1 -0
- package/dist/chunk-3CEXCBN6.js.map +1 -0
- package/dist/chunk-3MUSLI6E.js +105 -0
- package/dist/chunk-3MUSLI6E.js.map +1 -0
- package/dist/chunk-3PSLNJDU.js +884 -0
- package/dist/chunk-3PSLNJDU.js.map +1 -0
- package/dist/chunk-3QZY5BI7.js +92 -0
- package/dist/chunk-3QZY5BI7.js.map +1 -0
- package/dist/chunk-42FQ27MQ.js +594 -0
- package/dist/chunk-42FQ27MQ.js.map +1 -0
- package/dist/chunk-4GYMCUDZ.js +1085 -0
- package/dist/chunk-4GYMCUDZ.js.map +1 -0
- package/dist/chunk-4S53H2KR.js +382 -0
- package/dist/chunk-4S53H2KR.js.map +1 -0
- package/dist/chunk-4XCHZRUJ.js +128 -0
- package/dist/chunk-4XCHZRUJ.js.map +1 -0
- package/dist/chunk-5THCXDWY.js +725 -0
- package/dist/chunk-5THCXDWY.js.map +1 -0
- package/dist/chunk-6XZYT4SW.js +256 -0
- package/dist/chunk-6XZYT4SW.js.map +1 -0
- package/dist/chunk-7EGRP2VX.js +76 -0
- package/dist/chunk-7EGRP2VX.js.map +1 -0
- package/dist/chunk-A7KV5UK4.js +150 -0
- package/dist/chunk-A7KV5UK4.js.map +1 -0
- package/dist/chunk-APY2SS5X.js +156 -0
- package/dist/chunk-APY2SS5X.js.map +1 -0
- package/dist/chunk-AZDQPQ3V.js +66 -0
- package/dist/chunk-AZDQPQ3V.js.map +1 -0
- package/dist/chunk-BU3SEFA5.js +90 -0
- package/dist/chunk-BU3SEFA5.js.map +1 -0
- package/dist/chunk-BXGZFGZ4.js +189 -0
- package/dist/chunk-BXGZFGZ4.js.map +1 -0
- package/dist/chunk-CGHORL6G.js +579 -0
- package/dist/chunk-CGHORL6G.js.map +1 -0
- package/dist/chunk-CXANAIZU.js +530 -0
- package/dist/chunk-CXANAIZU.js.map +1 -0
- package/dist/chunk-CZQHCKKG.js +1 -0
- package/dist/chunk-CZQHCKKG.js.map +1 -0
- package/dist/chunk-DKNHAICT.js +133 -0
- package/dist/chunk-DKNHAICT.js.map +1 -0
- package/dist/chunk-DM4OMPWK.js +584 -0
- package/dist/chunk-DM4OMPWK.js.map +1 -0
- package/dist/chunk-DMSNO6ZB.js +452 -0
- package/dist/chunk-DMSNO6ZB.js.map +1 -0
- package/dist/chunk-E5OZPDIW.js +229 -0
- package/dist/chunk-E5OZPDIW.js.map +1 -0
- package/dist/chunk-EVYY4X5A.js +509 -0
- package/dist/chunk-EVYY4X5A.js.map +1 -0
- package/dist/chunk-FDFD67UO.js +1 -0
- package/dist/chunk-FDFD67UO.js.map +1 -0
- package/dist/chunk-FMPF42Q4.js +13 -0
- package/dist/chunk-FMPF42Q4.js.map +1 -0
- package/dist/chunk-FR6RGA3B.js +1277 -0
- package/dist/chunk-FR6RGA3B.js.map +1 -0
- package/dist/chunk-FW23JYNQ.js +454 -0
- package/dist/chunk-FW23JYNQ.js.map +1 -0
- package/dist/chunk-GBCENOLN.js +1575 -0
- package/dist/chunk-GBCENOLN.js.map +1 -0
- package/dist/chunk-HL7HUJIX.js +1 -0
- package/dist/chunk-HL7HUJIX.js.map +1 -0
- package/dist/chunk-HULCUY35.js +2508 -0
- package/dist/chunk-HULCUY35.js.map +1 -0
- package/dist/chunk-IHTWQEDR.js +169 -0
- package/dist/chunk-IHTWQEDR.js.map +1 -0
- package/dist/chunk-IJRR6YAI.js +128 -0
- package/dist/chunk-IJRR6YAI.js.map +1 -0
- package/dist/chunk-JGFRAFDL.js +221 -0
- package/dist/chunk-JGFRAFDL.js.map +1 -0
- package/dist/chunk-KIIXR252.js +211 -0
- package/dist/chunk-KIIXR252.js.map +1 -0
- package/dist/chunk-KN3H5CNT.js +11 -0
- package/dist/chunk-KN3H5CNT.js.map +1 -0
- package/dist/chunk-KPG3DGLA.js +1 -0
- package/dist/chunk-KPG3DGLA.js.map +1 -0
- package/dist/chunk-KRNQ6RGQ.js +1 -0
- package/dist/chunk-KRNQ6RGQ.js.map +1 -0
- package/dist/chunk-LBAJK24K.js +1071 -0
- package/dist/chunk-LBAJK24K.js.map +1 -0
- package/dist/chunk-MLTPJMH6.js +417 -0
- package/dist/chunk-MLTPJMH6.js.map +1 -0
- package/dist/chunk-N3SZ7BMH.js +95 -0
- package/dist/chunk-N3SZ7BMH.js.map +1 -0
- package/dist/chunk-NDUD3IMO.js +540 -0
- package/dist/chunk-NDUD3IMO.js.map +1 -0
- package/dist/chunk-NY2PYHNC.js +873 -0
- package/dist/chunk-NY2PYHNC.js.map +1 -0
- package/dist/chunk-O3MT7DYI.js +225 -0
- package/dist/chunk-O3MT7DYI.js.map +1 -0
- package/dist/chunk-OCUDSN63.js +2386 -0
- package/dist/chunk-OCUDSN63.js.map +1 -0
- package/dist/chunk-OIWU3NYV.js +199 -0
- package/dist/chunk-OIWU3NYV.js.map +1 -0
- package/dist/chunk-OO5BM6CJ.js +1153 -0
- package/dist/chunk-OO5BM6CJ.js.map +1 -0
- package/dist/chunk-OQUIJT7A.js +1 -0
- package/dist/chunk-OQUIJT7A.js.map +1 -0
- package/dist/chunk-P5LBT622.js +105 -0
- package/dist/chunk-P5LBT622.js.map +1 -0
- package/dist/chunk-PKGQG5QQ.js +519 -0
- package/dist/chunk-PKGQG5QQ.js.map +1 -0
- package/dist/chunk-PKPO3JTZ.js +561 -0
- package/dist/chunk-PKPO3JTZ.js.map +1 -0
- package/dist/chunk-PL5UDIQ5.js +118 -0
- package/dist/chunk-PL5UDIQ5.js.map +1 -0
- package/dist/chunk-PZWISPIQ.js +432 -0
- package/dist/chunk-PZWISPIQ.js.map +1 -0
- package/dist/chunk-Q3EYOCZB.js +510 -0
- package/dist/chunk-Q3EYOCZB.js.map +1 -0
- package/dist/chunk-QMBYUVRL.js +15 -0
- package/dist/chunk-QMBYUVRL.js.map +1 -0
- package/dist/chunk-RAGGHLCV.js +200 -0
- package/dist/chunk-RAGGHLCV.js.map +1 -0
- package/dist/chunk-RGL53X5G.js +574 -0
- package/dist/chunk-RGL53X5G.js.map +1 -0
- package/dist/chunk-RJOG4IJU.js +1039 -0
- package/dist/chunk-RJOG4IJU.js.map +1 -0
- package/dist/chunk-SOOKUYVM.js +403 -0
- package/dist/chunk-SOOKUYVM.js.map +1 -0
- package/dist/chunk-T5BN5KG7.js +1 -0
- package/dist/chunk-T5BN5KG7.js.map +1 -0
- package/dist/chunk-TP7244Y6.js +207 -0
- package/dist/chunk-TP7244Y6.js.map +1 -0
- package/dist/chunk-TSBFTJKM.js +57 -0
- package/dist/chunk-TSBFTJKM.js.map +1 -0
- package/dist/chunk-URQ2CBBF.js +143 -0
- package/dist/chunk-URQ2CBBF.js.map +1 -0
- package/dist/chunk-W2BOPXTI.js +1 -0
- package/dist/chunk-W2BOPXTI.js.map +1 -0
- package/dist/chunk-WKSWLSCX.js +207 -0
- package/dist/chunk-WKSWLSCX.js.map +1 -0
- package/dist/chunk-Y52CS6YA.js +88 -0
- package/dist/chunk-Y52CS6YA.js.map +1 -0
- package/dist/chunk-YCBUWK77.js +92 -0
- package/dist/chunk-YCBUWK77.js.map +1 -0
- package/dist/chunk-YJ4U2D2C.js +314 -0
- package/dist/chunk-YJ4U2D2C.js.map +1 -0
- package/dist/chunk-Z4YXAUDN.js +239 -0
- package/dist/chunk-Z4YXAUDN.js.map +1 -0
- package/dist/chunk-Z6EGP5D7.js +92 -0
- package/dist/chunk-Z6EGP5D7.js.map +1 -0
- package/dist/compat/index.cjs +3100 -9
- package/dist/compat/index.cjs.map +1 -0
- package/dist/compat/index.d.cts +112 -18
- package/dist/compat/index.d.ts +112 -18
- package/dist/compat/index.js +176 -1
- package/dist/compat/index.js.map +1 -0
- package/dist/compat/jotai/index.cjs +149 -1
- package/dist/compat/jotai/index.cjs.map +1 -0
- package/dist/compat/jotai/index.d.cts +2 -2
- package/dist/compat/jotai/index.d.ts +2 -2
- package/dist/compat/jotai/index.js +8 -1
- package/dist/compat/jotai/index.js.map +1 -0
- package/dist/compat/nanostores/index.cjs +205 -1
- package/dist/compat/nanostores/index.cjs.map +1 -0
- package/dist/compat/nanostores/index.d.cts +2 -2
- package/dist/compat/nanostores/index.d.ts +2 -2
- package/dist/compat/nanostores/index.js +22 -1
- package/dist/compat/nanostores/index.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +2241 -9
- package/dist/compat/nestjs/index.cjs.map +1 -0
- package/dist/compat/nestjs/index.d.cts +7 -10
- package/dist/compat/nestjs/index.d.ts +7 -10
- package/dist/compat/nestjs/index.js +78 -1
- package/dist/compat/nestjs/index.js.map +1 -0
- package/dist/compat/react/index.cjs +114 -1
- package/dist/compat/react/index.cjs.map +1 -0
- package/dist/compat/react/index.d.cts +2 -2
- package/dist/compat/react/index.d.ts +2 -2
- package/dist/compat/react/index.js +12 -1
- package/dist/compat/react/index.js.map +1 -0
- package/dist/compat/solid/index.cjs +101 -1
- package/dist/compat/solid/index.cjs.map +1 -0
- package/dist/compat/solid/index.d.cts +2 -2
- package/dist/compat/solid/index.d.ts +2 -2
- package/dist/compat/solid/index.js +12 -1
- package/dist/compat/solid/index.js.map +1 -0
- package/dist/compat/svelte/index.cjs +104 -1
- package/dist/compat/svelte/index.cjs.map +1 -0
- package/dist/compat/svelte/index.d.cts +2 -2
- package/dist/compat/svelte/index.d.ts +2 -2
- package/dist/compat/svelte/index.js +12 -1
- package/dist/compat/svelte/index.js.map +1 -0
- package/dist/compat/vue/index.cjs +119 -1
- package/dist/compat/vue/index.cjs.map +1 -0
- package/dist/compat/vue/index.d.cts +2 -2
- package/dist/compat/vue/index.d.ts +2 -2
- package/dist/compat/vue/index.js +12 -1
- package/dist/compat/vue/index.js.map +1 -0
- package/dist/compat/zustand/index.cjs +69 -3
- package/dist/compat/zustand/index.cjs.map +1 -0
- package/dist/compat/zustand/index.d.cts +2 -6
- package/dist/compat/zustand/index.d.ts +2 -6
- package/dist/compat/zustand/index.js +8 -1
- package/dist/compat/zustand/index.js.map +1 -0
- package/dist/distill-De6Rnn15.d.cts +48 -0
- package/dist/distill-De6Rnn15.d.ts +48 -0
- package/dist/external-register-CWyroXb_.d.cts +138 -0
- package/dist/external-register-CWyroXb_.d.ts +138 -0
- package/dist/{fallback-74oxi34l.d.cts → fallback-Bx46zqky.d.cts} +3 -10
- package/dist/{fallback-DUyyBTBK.d.ts → fallback-pIWW8A2d.d.ts} +3 -10
- package/dist/guarded-execution-BcdtxeBk.d.ts +207 -0
- package/dist/guarded-execution-C-3hnP6A.d.cts +207 -0
- package/dist/{index-CBGUK09R.d.ts → index-5SU_O78r.d.cts} +5 -5
- package/dist/{index-BmZXHqkE.d.ts → index-B6pxYJzO.d.cts} +1 -1
- package/dist/{index-hcDJ8PSI.d.cts → index-B6pxYJzO.d.ts} +1 -1
- package/dist/{index-C5stwKcw.d.cts → index-BFsng6v1.d.cts} +1 -1
- package/dist/{index-CdAlHFEt.d.ts → index-BFsng6v1.d.ts} +1 -1
- package/dist/{index-_6ODbuOu.d.cts → index-Bg-LwEt-.d.cts} +1 -1
- package/dist/{index-CviRnE4K.d.ts → index-Bg-LwEt-.d.ts} +1 -1
- package/dist/{index-CBBLl_rc.d.ts → index-Brp888t0.d.cts} +1 -1
- package/dist/{index-BQSKmbuG.d.cts → index-Brp888t0.d.ts} +1 -1
- package/dist/{index-sqkqlb1p.d.ts → index-CDfk6jHN.d.cts} +1 -1
- package/dist/{index-ZVQhLa2i.d.cts → index-CDfk6jHN.d.ts} +1 -1
- package/dist/{index-Climxqsu.d.cts → index-CEXCtYYJ.d.ts} +5 -5
- package/dist/index-DLAxYaN5.d.cts +169 -0
- package/dist/index-DLAxYaN5.d.ts +169 -0
- package/dist/{index-CK29LV56.d.cts → index-DeWbQzMe.d.cts} +1 -1
- package/dist/{index-CPQlGA29.d.ts → index-DeWbQzMe.d.ts} +1 -1
- package/dist/{index-BrPrLl4e.d.cts → index-dX9IzPqj.d.cts} +1 -1
- package/dist/{index-Dgl1HpPn.d.ts → index-dX9IzPqj.d.ts} +1 -1
- package/dist/index.cjs +25934 -191
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +58 -94
- package/dist/index.d.ts +58 -94
- package/dist/index.js +852 -1
- package/dist/index.js.map +1 -0
- package/dist/layout-types-B5aiHYgk.d.cts +72 -0
- package/dist/layout-types-B5aiHYgk.d.ts +72 -0
- package/dist/memory-composers-BryDrRBX.d.cts +529 -0
- package/dist/memory-composers-CVQqPYEV.d.ts +529 -0
- package/dist/{observable-DWjNfLvC.d.ts → observable-BXQoW1P-.d.cts} +1 -1
- package/dist/{observable-e3eiPPFy.d.cts → observable-BXQoW1P-.d.ts} +1 -1
- package/dist/{pipeline-graph-Sgj0gCwn.d.ts → pipeline-graph-Ce47CB6Y.d.cts} +13 -10
- package/dist/{pipeline-graph-CIKhynsF.d.cts → pipeline-graph-DXCwY9vG.d.ts} +13 -10
- package/dist/presets/ai/index.cjs +4377 -0
- package/dist/presets/ai/index.cjs.map +1 -0
- package/dist/presets/ai/index.d.cts +98 -0
- package/dist/presets/ai/index.d.ts +98 -0
- package/dist/presets/ai/index.js +54 -0
- package/dist/presets/ai/index.js.map +1 -0
- package/dist/presets/harness/index.cjs +5929 -0
- package/dist/presets/harness/index.cjs.map +1 -0
- package/dist/presets/harness/index.d.cts +566 -0
- package/dist/presets/harness/index.d.ts +566 -0
- package/dist/presets/harness/index.js +71 -0
- package/dist/presets/harness/index.js.map +1 -0
- package/dist/presets/index.cjs +9782 -0
- package/dist/presets/index.cjs.map +1 -0
- package/dist/presets/index.d.cts +28 -0
- package/dist/presets/index.d.ts +28 -0
- package/dist/presets/index.js +129 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/presets/inspect/index.cjs +1087 -0
- package/dist/presets/inspect/index.cjs.map +1 -0
- package/dist/presets/inspect/index.d.cts +172 -0
- package/dist/presets/inspect/index.d.ts +172 -0
- package/dist/presets/inspect/index.js +21 -0
- package/dist/presets/inspect/index.js.map +1 -0
- package/dist/presets/resilience/index.cjs +1593 -0
- package/dist/presets/resilience/index.cjs.map +1 -0
- package/dist/presets/resilience/index.d.cts +205 -0
- package/dist/presets/resilience/index.d.ts +205 -0
- package/dist/presets/resilience/index.js +18 -0
- package/dist/presets/resilience/index.js.map +1 -0
- package/dist/rate-limiter-CEALq4N1.d.ts +559 -0
- package/dist/rate-limiter-DpVbSYdH.d.cts +559 -0
- package/dist/{reactive-layout-DOTs9P3X.d.ts → reactive-layout-fswlBUvX.d.cts} +19 -7
- package/dist/{reactive-layout-DgctbqZo.d.cts → reactive-layout-fswlBUvX.d.ts} +19 -7
- package/dist/retry-BDbRZ_gx.d.ts +125 -0
- package/dist/retry-DWuhjvsA.d.cts +125 -0
- package/dist/solutions/index.cjs +8200 -0
- package/dist/solutions/index.cjs.map +1 -0
- package/dist/solutions/index.d.cts +23 -0
- package/dist/solutions/index.d.ts +23 -0
- package/dist/solutions/index.js +55 -0
- package/dist/solutions/index.js.map +1 -0
- package/dist/spawnable-5mDY501F.d.cts +746 -0
- package/dist/spawnable-D3lR0oQu.d.ts +746 -0
- package/dist/status-U-rUI79b.d.cts +84 -0
- package/dist/status-U-rUI79b.d.ts +84 -0
- package/dist/timeout-U5O4ESK3.js +12 -0
- package/dist/timeout-U5O4ESK3.js.map +1 -0
- package/dist/{types-CWFysE9E.d.ts → types-BB5Lw-pB.d.cts} +3 -3
- package/dist/{types-C0_yquda.d.cts → types-BB5Lw-pB.d.ts} +3 -3
- package/dist/types-CJWIMJiZ.d.ts +548 -0
- package/dist/types-vCq7ShIm.d.cts +548 -0
- package/dist/utils/ai/browser.cjs +2169 -0
- package/dist/utils/ai/browser.cjs.map +1 -0
- package/dist/{patterns → utils}/ai/browser.d.cts +7 -5
- package/dist/{patterns → utils}/ai/browser.d.ts +7 -5
- package/dist/utils/ai/browser.js +255 -0
- package/dist/utils/ai/browser.js.map +1 -0
- package/dist/utils/ai/index.cjs +8468 -0
- package/dist/utils/ai/index.cjs.map +1 -0
- package/dist/{index-CR8QpwX8.d.ts → utils/ai/index.d.cts} +73 -976
- package/dist/{index-UPSiS-X7.d.cts → utils/ai/index.d.ts} +73 -976
- package/dist/utils/ai/index.js +173 -0
- package/dist/utils/ai/index.js.map +1 -0
- package/dist/utils/ai/node.cjs +648 -0
- package/dist/utils/ai/node.cjs.map +1 -0
- package/dist/{patterns → utils}/ai/node.d.cts +5 -7
- package/dist/{patterns → utils}/ai/node.d.ts +5 -7
- package/dist/utils/ai/node.js +84 -0
- package/dist/utils/ai/node.js.map +1 -0
- package/dist/utils/cqrs/index.cjs +1036 -0
- package/dist/utils/cqrs/index.cjs.map +1 -0
- package/dist/{index-CeFiHtAg.d.ts → utils/cqrs/index.d.cts} +7 -37
- package/dist/{index-B-_tFaqV.d.cts → utils/cqrs/index.d.ts} +7 -37
- package/dist/utils/cqrs/index.js +18 -0
- package/dist/utils/cqrs/index.js.map +1 -0
- package/dist/utils/demo-shell/index.cjs +865 -0
- package/dist/utils/demo-shell/index.cjs.map +1 -0
- package/dist/{index-B8YnZpIR.d.ts → utils/demo-shell/index.d.cts} +4 -16
- package/dist/{index-Cwv0KWcU.d.cts → utils/demo-shell/index.d.ts} +4 -16
- package/dist/utils/demo-shell/index.js +13 -0
- package/dist/utils/demo-shell/index.js.map +1 -0
- package/dist/utils/domain-templates/index.cjs +732 -0
- package/dist/utils/domain-templates/index.cjs.map +1 -0
- package/dist/{index-CzLVrjxn.d.ts → utils/domain-templates/index.d.cts} +3 -20
- package/dist/{index-BaQaY_IQ.d.cts → utils/domain-templates/index.d.ts} +3 -20
- package/dist/utils/domain-templates/index.js +17 -0
- package/dist/utils/domain-templates/index.js.map +1 -0
- package/dist/utils/graphspec/index.cjs +1174 -0
- package/dist/utils/graphspec/index.cjs.map +1 -0
- package/dist/{index-CMh5Rz1y.d.ts → utils/graphspec/index.d.cts} +106 -42
- package/dist/{index-CS0LTlB8.d.cts → utils/graphspec/index.d.ts} +106 -42
- package/dist/utils/graphspec/index.js +35 -0
- package/dist/utils/graphspec/index.js.map +1 -0
- package/dist/utils/harness/index.cjs +656 -0
- package/dist/utils/harness/index.cjs.map +1 -0
- package/dist/utils/harness/index.d.cts +542 -0
- package/dist/utils/harness/index.d.ts +542 -0
- package/dist/utils/harness/index.js +56 -0
- package/dist/utils/harness/index.js.map +1 -0
- package/dist/utils/index.cjs +17609 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +96 -0
- package/dist/utils/index.d.ts +96 -0
- package/dist/utils/index.js +514 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/inspect/index.cjs +807 -0
- package/dist/utils/inspect/index.cjs.map +1 -0
- package/dist/utils/inspect/index.d.cts +123 -0
- package/dist/utils/inspect/index.d.ts +123 -0
- package/dist/utils/inspect/index.js +30 -0
- package/dist/utils/inspect/index.js.map +1 -0
- package/dist/utils/job-queue/index.cjs +717 -0
- package/dist/utils/job-queue/index.cjs.map +1 -0
- package/dist/{index-DisjX8a-.d.ts → utils/job-queue/index.d.cts} +5 -26
- package/dist/{index-DV_1YuVk.d.cts → utils/job-queue/index.d.ts} +5 -26
- package/dist/utils/job-queue/index.js +18 -0
- package/dist/utils/job-queue/index.js.map +1 -0
- package/dist/utils/memory/index.cjs +1451 -0
- package/dist/utils/memory/index.cjs.map +1 -0
- package/dist/{index-CZ3r5Rxp.d.ts → utils/memory/index.d.cts} +242 -34
- package/dist/{index-B17QddL1.d.cts → utils/memory/index.d.ts} +242 -34
- package/dist/utils/memory/index.js +19 -0
- package/dist/utils/memory/index.js.map +1 -0
- package/dist/utils/messaging/index.cjs +666 -0
- package/dist/utils/messaging/index.cjs.map +1 -0
- package/dist/utils/messaging/index.d.cts +562 -0
- package/dist/utils/messaging/index.d.ts +562 -0
- package/dist/utils/messaging/index.js +50 -0
- package/dist/utils/messaging/index.js.map +1 -0
- package/dist/utils/orchestration/index.cjs +876 -0
- package/dist/utils/orchestration/index.cjs.map +1 -0
- package/dist/utils/orchestration/index.d.cts +233 -0
- package/dist/utils/orchestration/index.d.ts +233 -0
- package/dist/utils/orchestration/index.js +19 -0
- package/dist/utils/orchestration/index.js.map +1 -0
- package/dist/utils/process/index.cjs +743 -0
- package/dist/utils/process/index.cjs.map +1 -0
- package/dist/{index-p09KSrTN.d.ts → utils/process/index.d.cts} +97 -44
- package/dist/{index-CasX6Pfq.d.cts → utils/process/index.d.ts} +97 -44
- package/dist/utils/process/index.js +14 -0
- package/dist/utils/process/index.js.map +1 -0
- package/dist/utils/reactive-layout/index.cjs +1607 -0
- package/dist/utils/reactive-layout/index.cjs.map +1 -0
- package/dist/{index-B5S8ULbU.d.ts → utils/reactive-layout/index.d.cts} +58 -81
- package/dist/{index-Dc4AYqrJ.d.cts → utils/reactive-layout/index.d.ts} +58 -81
- package/dist/utils/reactive-layout/index.js +52 -0
- package/dist/utils/reactive-layout/index.js.map +1 -0
- package/dist/utils/reduction/index.cjs +203 -0
- package/dist/utils/reduction/index.cjs.map +1 -0
- package/dist/{index-Byu-OpX_.d.ts → utils/reduction/index.d.cts} +6 -17
- package/dist/{index-tRCxuAXF.d.cts → utils/reduction/index.d.ts} +6 -17
- package/dist/utils/reduction/index.js +14 -0
- package/dist/utils/reduction/index.js.map +1 -0
- package/dist/utils/resilience/index.cjs +1617 -0
- package/dist/utils/resilience/index.cjs.map +1 -0
- package/dist/utils/resilience/index.d.cts +9 -0
- package/dist/utils/resilience/index.d.ts +9 -0
- package/dist/utils/resilience/index.js +44 -0
- package/dist/utils/resilience/index.js.map +1 -0
- package/dist/utils/surface/index.cjs +1070 -0
- package/dist/utils/surface/index.cjs.map +1 -0
- package/dist/{index-CYq8vAyV.d.ts → utils/surface/index.d.cts} +7 -58
- package/dist/{index-CSOmP7xT.d.cts → utils/surface/index.d.ts} +7 -58
- package/dist/utils/surface/index.js +30 -0
- package/dist/utils/surface/index.js.map +1 -0
- package/dist/utils/topology-view/index.cjs +620 -0
- package/dist/utils/topology-view/index.cjs.map +1 -0
- package/dist/utils/topology-view/index.d.cts +68 -0
- package/dist/utils/topology-view/index.d.ts +68 -0
- package/dist/utils/topology-view/index.js +11 -0
- package/dist/utils/topology-view/index.js.map +1 -0
- package/package.json +664 -584
- package/dist/backoff-HPZMEZNF.js +0 -1
- package/dist/chunk-2T7U5EU6.js +0 -1
- package/dist/chunk-3G5U5QNE.js +0 -5
- package/dist/chunk-4VVTGLXJ.js +0 -1
- package/dist/chunk-5M4CCMMD.js +0 -45
- package/dist/chunk-5QDBSZBV.js +0 -1
- package/dist/chunk-5XJ6B66J.js +0 -1
- package/dist/chunk-6QZNQS5B.js +0 -1
- package/dist/chunk-6X7AFUJV.js +0 -9
- package/dist/chunk-7K6PWTDQ.js +0 -1
- package/dist/chunk-7LIAPXJB.js +0 -1
- package/dist/chunk-7WPU3UHQ.js +0 -1
- package/dist/chunk-A5WCQ5NO.js +0 -1
- package/dist/chunk-APPIWSGD.js +0 -84
- package/dist/chunk-BEZWM2SY.js +0 -1
- package/dist/chunk-C72GO4IZ.js +0 -1
- package/dist/chunk-CB676TKJ.js +0 -1
- package/dist/chunk-CE6TI2TL.js +0 -1
- package/dist/chunk-CE72X3WO.js +0 -1
- package/dist/chunk-CK2E7BTU.js +0 -1
- package/dist/chunk-CLVB32RD.js +0 -1
- package/dist/chunk-CRVT7D2P.js +0 -1
- package/dist/chunk-D5RFJOZ2.js +0 -1
- package/dist/chunk-D7GPHKFH.js +0 -1
- package/dist/chunk-DHRX7JX4.js +0 -2
- package/dist/chunk-ESMPEKEV.js +0 -1
- package/dist/chunk-F672GV32.js +0 -1
- package/dist/chunk-FZMYDOWV.js +0 -1
- package/dist/chunk-GHBWHMRZ.js +0 -1
- package/dist/chunk-GLERH466.js +0 -1
- package/dist/chunk-GPW2V3RE.js +0 -1
- package/dist/chunk-HIDYF36O.js +0 -1
- package/dist/chunk-HITNVN6B.js +0 -3
- package/dist/chunk-HY4DJBA7.js +0 -5
- package/dist/chunk-KZIEYVXN.js +0 -1
- package/dist/chunk-L6NSJVJZ.js +0 -1
- package/dist/chunk-N4MQX6JU.js +0 -18
- package/dist/chunk-N7FHEL4D.js +0 -1
- package/dist/chunk-NTEURFZH.js +0 -1
- package/dist/chunk-OIVP6KFV.js +0 -1
- package/dist/chunk-OPHBU3LG.js +0 -1
- package/dist/chunk-OYQOZP2F.js +0 -5
- package/dist/chunk-PTZK576G.js +0 -1
- package/dist/chunk-QYADASLV.js +0 -1
- package/dist/chunk-ST7UXLWR.js +0 -1
- package/dist/chunk-SVY7VUYU.js +0 -1
- package/dist/chunk-TK3NWWD4.js +0 -1
- package/dist/chunk-TSOYJ743.js +0 -1
- package/dist/chunk-UNGSTR4X.js +0 -61
- package/dist/chunk-VIMF6LGM.js +0 -1
- package/dist/chunk-VJLMUKOI.js +0 -1
- package/dist/chunk-VN6RDSK2.js +0 -1
- package/dist/chunk-VV4N5P64.js +0 -1
- package/dist/chunk-W3I423PS.js +0 -1
- package/dist/chunk-WJR24TAG.js +0 -1
- package/dist/chunk-XTGKMHSW.js +0 -1
- package/dist/chunk-YBB7ZGTY.js +0 -1
- package/dist/chunk-Z4NPUARF.js +0 -1
- package/dist/chunk-ZGNQRPDT.js +0 -1
- package/dist/chunk-ZKPSFFKU.js +0 -1
- package/dist/chunk-ZLV5SQSX.js +0 -1
- package/dist/content-addressed-storage-4-ST1tYk.d.cts +0 -124
- package/dist/content-addressed-storage-DuYMjV7o.d.ts +0 -124
- package/dist/core/index.cjs +0 -1
- package/dist/core/index.d.cts +0 -3
- package/dist/core/index.d.ts +0 -3
- package/dist/core/index.js +0 -1
- package/dist/decay-BvOWTZ00.d.ts +0 -112
- package/dist/decay-CFlLvXUT.d.cts +0 -112
- package/dist/extra/browser.cjs +0 -1
- package/dist/extra/browser.d.cts +0 -4
- package/dist/extra/browser.d.ts +0 -4
- package/dist/extra/browser.js +0 -1
- package/dist/extra/index.cjs +0 -20
- package/dist/extra/index.d.cts +0 -17
- package/dist/extra/index.d.ts +0 -17
- package/dist/extra/index.js +0 -1
- package/dist/extra/node.cjs +0 -2
- package/dist/extra/node.js +0 -2
- package/dist/extra/operators.cjs +0 -1
- package/dist/extra/operators.d.cts +0 -958
- package/dist/extra/operators.d.ts +0 -958
- package/dist/extra/operators.js +0 -1
- package/dist/extra/reactive.cjs +0 -1
- package/dist/extra/reactive.d.cts +0 -353
- package/dist/extra/reactive.d.ts +0 -353
- package/dist/extra/reactive.js +0 -1
- package/dist/extra/render/index.cjs +0 -5
- package/dist/extra/render/index.js +0 -1
- package/dist/extra/sources.cjs +0 -3
- package/dist/extra/sources.js +0 -1
- package/dist/extra/storage-browser.cjs +0 -1
- package/dist/extra/storage-browser.d.cts +0 -37
- package/dist/extra/storage-browser.d.ts +0 -37
- package/dist/extra/storage-browser.js +0 -1
- package/dist/extra/storage-core.cjs +0 -1
- package/dist/extra/storage-core.d.cts +0 -28
- package/dist/extra/storage-core.d.ts +0 -28
- package/dist/extra/storage-core.js +0 -1
- package/dist/extra/storage-node.cjs +0 -1
- package/dist/extra/storage-node.d.cts +0 -2
- package/dist/extra/storage-node.d.ts +0 -2
- package/dist/extra/storage-node.js +0 -0
- package/dist/extra/storage-tiers-browser.cjs +0 -1
- package/dist/extra/storage-tiers-browser.d.cts +0 -120
- package/dist/extra/storage-tiers-browser.d.ts +0 -120
- package/dist/extra/storage-tiers-browser.js +0 -1
- package/dist/extra/storage-tiers-node.cjs +0 -1
- package/dist/extra/storage-tiers-node.d.cts +0 -210
- package/dist/extra/storage-tiers-node.d.ts +0 -210
- package/dist/extra/storage-tiers-node.js +0 -1
- package/dist/extra/storage-tiers.cjs +0 -1
- package/dist/extra/storage-tiers.d.cts +0 -412
- package/dist/extra/storage-tiers.d.ts +0 -412
- package/dist/extra/storage-tiers.js +0 -1
- package/dist/graph/index.cjs +0 -7
- package/dist/graph/index.d.cts +0 -7
- package/dist/graph/index.d.ts +0 -7
- package/dist/graph/index.js +0 -1
- package/dist/graph-CWvEUQAq.d.cts +0 -1861
- package/dist/graph-D9LFnda9.d.ts +0 -1861
- package/dist/index-5k1T6jl0.d.cts +0 -121
- package/dist/index-9770hRuQ.d.cts +0 -779
- package/dist/index-B1F8Enjf.d.ts +0 -704
- package/dist/index-BHskSB8v.d.ts +0 -3413
- package/dist/index-BIYAkbAi.d.cts +0 -26
- package/dist/index-BoJ5JHxI.d.ts +0 -557
- package/dist/index-BocU7pqs.d.ts +0 -779
- package/dist/index-BxNs2HB9.d.cts +0 -1858
- package/dist/index-C1T3d7V-.d.cts +0 -704
- package/dist/index-C5ri2Axc.d.cts +0 -301
- package/dist/index-C9l6OEBL.d.ts +0 -26
- package/dist/index-CC-AvFTy.d.cts +0 -557
- package/dist/index-CJF1URuX.d.ts +0 -121
- package/dist/index-CdTelp1M.d.ts +0 -202
- package/dist/index-Cj3WohTd.d.cts +0 -202
- package/dist/index-Co7uli2l.d.cts +0 -3413
- package/dist/index-D0aciIex.d.cts +0 -209
- package/dist/index-DHen9Klo.d.ts +0 -1858
- package/dist/index-Yq60JP3s.d.ts +0 -209
- package/dist/index-nozs3fFC.d.ts +0 -301
- package/dist/node-kK3CvTrR.d.cts +0 -1347
- package/dist/node-kK3CvTrR.d.ts +0 -1347
- package/dist/patterns/ai/browser.cjs +0 -8
- package/dist/patterns/ai/browser.js +0 -3
- package/dist/patterns/ai/index.cjs +0 -74
- package/dist/patterns/ai/index.d.cts +0 -20
- package/dist/patterns/ai/index.d.ts +0 -20
- package/dist/patterns/ai/index.js +0 -1
- package/dist/patterns/ai/node.cjs +0 -1
- package/dist/patterns/ai/node.js +0 -1
- package/dist/patterns/cqrs/index.cjs +0 -3
- package/dist/patterns/cqrs/index.d.cts +0 -8
- package/dist/patterns/cqrs/index.d.ts +0 -8
- package/dist/patterns/cqrs/index.js +0 -1
- package/dist/patterns/demo-shell/index.cjs +0 -5
- package/dist/patterns/demo-shell/index.d.cts +0 -7
- package/dist/patterns/demo-shell/index.d.ts +0 -7
- package/dist/patterns/demo-shell/index.js +0 -1
- package/dist/patterns/domain-templates/index.cjs +0 -3
- package/dist/patterns/domain-templates/index.d.cts +0 -6
- package/dist/patterns/domain-templates/index.d.ts +0 -6
- package/dist/patterns/domain-templates/index.js +0 -1
- package/dist/patterns/graphspec/index.cjs +0 -86
- package/dist/patterns/graphspec/index.d.cts +0 -8
- package/dist/patterns/graphspec/index.d.ts +0 -8
- package/dist/patterns/graphspec/index.js +0 -1
- package/dist/patterns/harness/index.cjs +0 -48
- package/dist/patterns/harness/index.d.cts +0 -13
- package/dist/patterns/harness/index.d.ts +0 -13
- package/dist/patterns/harness/index.js +0 -1
- package/dist/patterns/inspect/index.cjs +0 -3
- package/dist/patterns/inspect/index.d.cts +0 -9
- package/dist/patterns/inspect/index.d.ts +0 -9
- package/dist/patterns/inspect/index.js +0 -1
- package/dist/patterns/job-queue/index.cjs +0 -3
- package/dist/patterns/job-queue/index.d.cts +0 -9
- package/dist/patterns/job-queue/index.d.ts +0 -9
- package/dist/patterns/job-queue/index.js +0 -1
- package/dist/patterns/memory/index.cjs +0 -3
- package/dist/patterns/memory/index.d.cts +0 -8
- package/dist/patterns/memory/index.d.ts +0 -8
- package/dist/patterns/memory/index.js +0 -1
- package/dist/patterns/messaging/index.cjs +0 -3
- package/dist/patterns/messaging/index.d.cts +0 -7
- package/dist/patterns/messaging/index.d.ts +0 -7
- package/dist/patterns/messaging/index.js +0 -1
- package/dist/patterns/orchestration/index.cjs +0 -3
- package/dist/patterns/orchestration/index.d.cts +0 -8
- package/dist/patterns/orchestration/index.d.ts +0 -8
- package/dist/patterns/orchestration/index.js +0 -1
- package/dist/patterns/process/index.cjs +0 -3
- package/dist/patterns/process/index.d.cts +0 -10
- package/dist/patterns/process/index.d.ts +0 -10
- package/dist/patterns/process/index.js +0 -1
- package/dist/patterns/reactive-layout/index.cjs +0 -4
- package/dist/patterns/reactive-layout/index.d.cts +0 -7
- package/dist/patterns/reactive-layout/index.d.ts +0 -7
- package/dist/patterns/reactive-layout/index.js +0 -1
- package/dist/patterns/reduction/index.cjs +0 -3
- package/dist/patterns/reduction/index.d.cts +0 -6
- package/dist/patterns/reduction/index.d.ts +0 -6
- package/dist/patterns/reduction/index.js +0 -1
- package/dist/patterns/surface/index.cjs +0 -13
- package/dist/patterns/surface/index.d.cts +0 -9
- package/dist/patterns/surface/index.d.ts +0 -9
- package/dist/patterns/surface/index.js +0 -1
- package/dist/reactive-log-BKALbfal.d.ts +0 -223
- package/dist/reactive-log-DIGdYqQ6.d.cts +0 -223
- package/dist/reactive-map-CEFGp8TK.d.cts +0 -296
- package/dist/reactive-map-DS_SIAxv.d.ts +0 -296
- package/dist/resilience-6LYQJAC5.js +0 -1
- package/dist/sugar-DQjFmVqb.d.cts +0 -399
- package/dist/sugar-fhLIE7TT.d.ts +0 -399
- package/dist/topology-tree-Bcz27hpF.d.cts +0 -25
- package/dist/topology-tree-xvaD0fOX.d.ts +0 -25
|
@@ -0,0 +1,1071 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fromCron
|
|
3
|
+
} from "./chunk-7EGRP2VX.js";
|
|
4
|
+
import {
|
|
5
|
+
cqrs
|
|
6
|
+
} from "./chunk-NY2PYHNC.js";
|
|
7
|
+
import {
|
|
8
|
+
createWatermarkController,
|
|
9
|
+
toObservable
|
|
10
|
+
} from "./chunk-3QZY5BI7.js";
|
|
11
|
+
import {
|
|
12
|
+
__decorateElement,
|
|
13
|
+
__decoratorStart,
|
|
14
|
+
__export,
|
|
15
|
+
__runInitializers
|
|
16
|
+
} from "./chunk-AZDQPQ3V.js";
|
|
17
|
+
|
|
18
|
+
// src/compat/nestjs/index.ts
|
|
19
|
+
var nestjs_exports = {};
|
|
20
|
+
__export(nestjs_exports, {
|
|
21
|
+
ACTOR_KEY: () => ACTOR_KEY,
|
|
22
|
+
COMMAND_HANDLERS: () => COMMAND_HANDLERS,
|
|
23
|
+
CQRS_EVENT_HANDLERS: () => CQRS_EVENT_HANDLERS,
|
|
24
|
+
CRON_HANDLERS: () => CRON_HANDLERS,
|
|
25
|
+
CommandHandler: () => CommandHandler,
|
|
26
|
+
EVENT_HANDLERS: () => EVENT_HANDLERS,
|
|
27
|
+
EventHandler: () => EventHandler,
|
|
28
|
+
GRAPHREFLY_REQUEST_GRAPH: () => GRAPHREFLY_REQUEST_GRAPH,
|
|
29
|
+
GRAPHREFLY_ROOT_GRAPH: () => GRAPHREFLY_ROOT_GRAPH,
|
|
30
|
+
GraphCron: () => GraphCron,
|
|
31
|
+
GraphInterval: () => GraphInterval,
|
|
32
|
+
GraphReflyEventExplorer: () => GraphReflyEventExplorer,
|
|
33
|
+
GraphReflyGuard: () => GraphReflyGuard,
|
|
34
|
+
GraphReflyGuardImpl: () => GraphReflyGuardImpl,
|
|
35
|
+
GraphReflyModule: () => GraphReflyModule,
|
|
36
|
+
INTERVAL_HANDLERS: () => INTERVAL_HANDLERS,
|
|
37
|
+
InjectCqrsGraph: () => InjectCqrsGraph,
|
|
38
|
+
InjectGraph: () => InjectGraph,
|
|
39
|
+
InjectNode: () => InjectNode,
|
|
40
|
+
ObserveGateway: () => ObserveGateway,
|
|
41
|
+
OnGraphEvent: () => OnGraphEvent,
|
|
42
|
+
QUERY_HANDLERS: () => QUERY_HANDLERS,
|
|
43
|
+
QueryHandler: () => QueryHandler,
|
|
44
|
+
SAGA_HANDLERS: () => SAGA_HANDLERS,
|
|
45
|
+
SagaHandler: () => SagaHandler,
|
|
46
|
+
fromHeader: () => fromHeader,
|
|
47
|
+
fromJwtPayload: () => fromJwtPayload,
|
|
48
|
+
getActor: () => getActor,
|
|
49
|
+
getGraphToken: () => getGraphToken,
|
|
50
|
+
getNodeToken: () => getNodeToken,
|
|
51
|
+
observeSSE: () => observeSSE,
|
|
52
|
+
observeSubscription: () => observeSubscription,
|
|
53
|
+
toObservable: () => toObservable
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// src/compat/nestjs/decorators.ts
|
|
57
|
+
import { Inject } from "@nestjs/common";
|
|
58
|
+
|
|
59
|
+
// src/compat/nestjs/tokens.ts
|
|
60
|
+
var GRAPHREFLY_ROOT_GRAPH = /* @__PURE__ */ Symbol.for("graphrefly:root-graph");
|
|
61
|
+
var GRAPHREFLY_REQUEST_GRAPH = /* @__PURE__ */ Symbol.for("graphrefly:request-graph");
|
|
62
|
+
function getGraphToken(name) {
|
|
63
|
+
return /* @__PURE__ */ Symbol.for(`graphrefly:graph:${name}`);
|
|
64
|
+
}
|
|
65
|
+
function getNodeToken(path) {
|
|
66
|
+
return /* @__PURE__ */ Symbol.for(`graphrefly:node:${path}`);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/compat/nestjs/decorators.ts
|
|
70
|
+
var EVENT_HANDLERS = /* @__PURE__ */ new Map();
|
|
71
|
+
var INTERVAL_HANDLERS = /* @__PURE__ */ new Map();
|
|
72
|
+
var CRON_HANDLERS = /* @__PURE__ */ new Map();
|
|
73
|
+
var COMMAND_HANDLERS = /* @__PURE__ */ new Map();
|
|
74
|
+
var CQRS_EVENT_HANDLERS = /* @__PURE__ */ new Map();
|
|
75
|
+
var QUERY_HANDLERS = /* @__PURE__ */ new Map();
|
|
76
|
+
var SAGA_HANDLERS = /* @__PURE__ */ new Map();
|
|
77
|
+
function InjectGraph(name) {
|
|
78
|
+
if (name === "request") return Inject(GRAPHREFLY_REQUEST_GRAPH);
|
|
79
|
+
return Inject(name ? getGraphToken(name) : GRAPHREFLY_ROOT_GRAPH);
|
|
80
|
+
}
|
|
81
|
+
function InjectCqrsGraph(name) {
|
|
82
|
+
return Inject(getGraphToken(name));
|
|
83
|
+
}
|
|
84
|
+
function InjectNode(path) {
|
|
85
|
+
return Inject(getNodeToken(path));
|
|
86
|
+
}
|
|
87
|
+
function OnGraphEvent(nodeName) {
|
|
88
|
+
return (_value, context) => {
|
|
89
|
+
const methodKey = context.name;
|
|
90
|
+
context.addInitializer(function() {
|
|
91
|
+
const ctor = this.constructor;
|
|
92
|
+
const existing = EVENT_HANDLERS.get(ctor) ?? [];
|
|
93
|
+
existing.push({ nodeName, methodKey });
|
|
94
|
+
EVENT_HANDLERS.set(ctor, existing);
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function GraphInterval(ms) {
|
|
99
|
+
return (_value, context) => {
|
|
100
|
+
const methodKey = context.name;
|
|
101
|
+
context.addInitializer(function() {
|
|
102
|
+
const ctor = this.constructor;
|
|
103
|
+
const existing = INTERVAL_HANDLERS.get(ctor) ?? [];
|
|
104
|
+
existing.push({ ms, methodKey });
|
|
105
|
+
INTERVAL_HANDLERS.set(ctor, existing);
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function GraphCron(expr) {
|
|
110
|
+
return (_value, context) => {
|
|
111
|
+
const methodKey = context.name;
|
|
112
|
+
context.addInitializer(function() {
|
|
113
|
+
const ctor = this.constructor;
|
|
114
|
+
const existing = CRON_HANDLERS.get(ctor) ?? [];
|
|
115
|
+
existing.push({ expr, methodKey });
|
|
116
|
+
CRON_HANDLERS.set(ctor, existing);
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function CommandHandler(cqrsName, commandName) {
|
|
121
|
+
return (_value, context) => {
|
|
122
|
+
const methodKey = context.name;
|
|
123
|
+
context.addInitializer(function() {
|
|
124
|
+
const ctor = this.constructor;
|
|
125
|
+
const existing = COMMAND_HANDLERS.get(ctor) ?? [];
|
|
126
|
+
existing.push({ cqrsName, commandName, methodKey });
|
|
127
|
+
COMMAND_HANDLERS.set(ctor, existing);
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function EventHandler(cqrsName, eventName) {
|
|
132
|
+
return (_value, context) => {
|
|
133
|
+
const methodKey = context.name;
|
|
134
|
+
context.addInitializer(function() {
|
|
135
|
+
const ctor = this.constructor;
|
|
136
|
+
const existing = CQRS_EVENT_HANDLERS.get(ctor) ?? [];
|
|
137
|
+
existing.push({ cqrsName, eventName, methodKey });
|
|
138
|
+
CQRS_EVENT_HANDLERS.set(ctor, existing);
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function QueryHandler(cqrsName, projectionName) {
|
|
143
|
+
return (_value, context) => {
|
|
144
|
+
const methodKey = context.name;
|
|
145
|
+
context.addInitializer(function() {
|
|
146
|
+
const ctor = this.constructor;
|
|
147
|
+
const existing = QUERY_HANDLERS.get(ctor) ?? [];
|
|
148
|
+
existing.push({ cqrsName, projectionName, methodKey });
|
|
149
|
+
QUERY_HANDLERS.set(ctor, existing);
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function SagaHandler(cqrsName, sagaName, eventNames) {
|
|
154
|
+
return (_value, context) => {
|
|
155
|
+
const methodKey = context.name;
|
|
156
|
+
context.addInitializer(function() {
|
|
157
|
+
const ctor = this.constructor;
|
|
158
|
+
const existing = SAGA_HANDLERS.get(ctor) ?? [];
|
|
159
|
+
existing.push({ cqrsName, eventNames, sagaName, methodKey });
|
|
160
|
+
SAGA_HANDLERS.set(ctor, existing);
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// src/compat/nestjs/explorer.ts
|
|
166
|
+
import { DATA } from "@graphrefly/pure-ts/core";
|
|
167
|
+
import { fromTimer } from "@graphrefly/pure-ts/extra";
|
|
168
|
+
var scheduleSeq = 0;
|
|
169
|
+
var GraphReflyEventExplorer = class {
|
|
170
|
+
constructor(graph, moduleRef) {
|
|
171
|
+
this.graph = graph;
|
|
172
|
+
this.moduleRef = moduleRef;
|
|
173
|
+
}
|
|
174
|
+
disposers = [];
|
|
175
|
+
scheduleNodeNames = [];
|
|
176
|
+
onModuleInit() {
|
|
177
|
+
this.wireEvents();
|
|
178
|
+
this.wireIntervals();
|
|
179
|
+
this.wireCrons();
|
|
180
|
+
this.wireCqrsCommands();
|
|
181
|
+
this.wireCqrsEvents();
|
|
182
|
+
this.wireCqrsQueries();
|
|
183
|
+
this.wireCqrsSagas();
|
|
184
|
+
}
|
|
185
|
+
onModuleDestroy() {
|
|
186
|
+
for (const dispose of this.disposers) dispose();
|
|
187
|
+
this.disposers.length = 0;
|
|
188
|
+
for (const name of this.scheduleNodeNames) {
|
|
189
|
+
try {
|
|
190
|
+
this.graph.remove(name);
|
|
191
|
+
} catch {
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
this.scheduleNodeNames.length = 0;
|
|
195
|
+
}
|
|
196
|
+
// -----------------------------------------------------------------------
|
|
197
|
+
// @OnGraphEvent — reactive subscription via graph.observe()
|
|
198
|
+
// -----------------------------------------------------------------------
|
|
199
|
+
wireEvents() {
|
|
200
|
+
for (const [ctor, metas] of EVENT_HANDLERS) {
|
|
201
|
+
const instance = this.resolveInstance(ctor);
|
|
202
|
+
if (!instance) continue;
|
|
203
|
+
for (const meta of metas) {
|
|
204
|
+
this.wireEventHandler(instance, meta);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
wireEventHandler(instance, meta) {
|
|
209
|
+
const method = instance[meta.methodKey];
|
|
210
|
+
if (typeof method !== "function") return;
|
|
211
|
+
const bound = method.bind(instance);
|
|
212
|
+
const handle = this.observeNode(meta.nodeName);
|
|
213
|
+
const unsub = handle.subscribe((msgs) => {
|
|
214
|
+
for (const m of msgs) {
|
|
215
|
+
if (m[0] === DATA) {
|
|
216
|
+
bound(m[1]);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
this.disposers.push(unsub);
|
|
221
|
+
}
|
|
222
|
+
// -----------------------------------------------------------------------
|
|
223
|
+
// @GraphInterval — reactive via fromTimer central timer primitive
|
|
224
|
+
// -----------------------------------------------------------------------
|
|
225
|
+
wireIntervals() {
|
|
226
|
+
for (const [ctor, metas] of INTERVAL_HANDLERS) {
|
|
227
|
+
const instance = this.resolveInstance(ctor);
|
|
228
|
+
if (!instance) continue;
|
|
229
|
+
for (const meta of metas) {
|
|
230
|
+
this.wireIntervalHandler(instance, ctor, meta);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
wireIntervalHandler(instance, ctor, meta) {
|
|
235
|
+
const method = instance[meta.methodKey];
|
|
236
|
+
if (typeof method !== "function") return;
|
|
237
|
+
const bound = method.bind(instance);
|
|
238
|
+
const className = ctor.name ?? "anonymous";
|
|
239
|
+
const nodeName = `__schedule__.${className}.${String(meta.methodKey)}.${scheduleSeq++}`;
|
|
240
|
+
const timerNode = fromTimer(meta.ms, { period: meta.ms, name: nodeName });
|
|
241
|
+
this.graph.add(timerNode);
|
|
242
|
+
this.scheduleNodeNames.push(nodeName);
|
|
243
|
+
const handle = this.observeNode(nodeName);
|
|
244
|
+
const unsub = handle.subscribe((msgs) => {
|
|
245
|
+
for (const m of msgs) {
|
|
246
|
+
if (m[0] === DATA) bound(m[1]);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
this.disposers.push(unsub);
|
|
250
|
+
}
|
|
251
|
+
// -----------------------------------------------------------------------
|
|
252
|
+
// @GraphCron — reactive via fromCron central timer primitive
|
|
253
|
+
// -----------------------------------------------------------------------
|
|
254
|
+
wireCrons() {
|
|
255
|
+
for (const [ctor, metas] of CRON_HANDLERS) {
|
|
256
|
+
const instance = this.resolveInstance(ctor);
|
|
257
|
+
if (!instance) continue;
|
|
258
|
+
for (const meta of metas) {
|
|
259
|
+
this.wireCronHandler(instance, ctor, meta);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
wireCronHandler(instance, ctor, meta) {
|
|
264
|
+
const method = instance[meta.methodKey];
|
|
265
|
+
if (typeof method !== "function") return;
|
|
266
|
+
const bound = method.bind(instance);
|
|
267
|
+
const className = ctor.name ?? "anonymous";
|
|
268
|
+
const nodeName = `__schedule__.${className}.${String(meta.methodKey)}.${scheduleSeq++}`;
|
|
269
|
+
const cronNode = fromCron(meta.expr, { name: nodeName });
|
|
270
|
+
this.graph.add(cronNode);
|
|
271
|
+
this.scheduleNodeNames.push(nodeName);
|
|
272
|
+
const handle = this.observeNode(nodeName);
|
|
273
|
+
const unsub = handle.subscribe((msgs) => {
|
|
274
|
+
for (const m of msgs) {
|
|
275
|
+
if (m[0] === DATA) bound(m[1]);
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
this.disposers.push(unsub);
|
|
279
|
+
}
|
|
280
|
+
// -----------------------------------------------------------------------
|
|
281
|
+
// @CommandHandler — register method as CqrsGraph command handler
|
|
282
|
+
// -----------------------------------------------------------------------
|
|
283
|
+
wireCqrsCommands() {
|
|
284
|
+
for (const [ctor, metas] of COMMAND_HANDLERS) {
|
|
285
|
+
const instance = this.resolveInstance(ctor);
|
|
286
|
+
if (!instance) continue;
|
|
287
|
+
for (const meta of metas) {
|
|
288
|
+
this.wireCqrsCommand(instance, meta);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
wireCqrsCommand(instance, meta) {
|
|
293
|
+
const method = instance[meta.methodKey];
|
|
294
|
+
if (typeof method !== "function") return;
|
|
295
|
+
const bound = method.bind(instance);
|
|
296
|
+
const cqrsGraph = this.resolveCqrsGraph(meta.cqrsName);
|
|
297
|
+
if (!cqrsGraph) return;
|
|
298
|
+
cqrsGraph.command(meta.commandName, bound);
|
|
299
|
+
}
|
|
300
|
+
// -----------------------------------------------------------------------
|
|
301
|
+
// @EventHandler — subscribe method to CQRS event stream
|
|
302
|
+
// -----------------------------------------------------------------------
|
|
303
|
+
wireCqrsEvents() {
|
|
304
|
+
for (const [ctor, metas] of CQRS_EVENT_HANDLERS) {
|
|
305
|
+
const instance = this.resolveInstance(ctor);
|
|
306
|
+
if (!instance) continue;
|
|
307
|
+
for (const meta of metas) {
|
|
308
|
+
this.wireCqrsEventHandler(instance, meta);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
wireCqrsEventHandler(instance, meta) {
|
|
313
|
+
const method = instance[meta.methodKey];
|
|
314
|
+
if (typeof method !== "function") return;
|
|
315
|
+
const bound = method.bind(instance);
|
|
316
|
+
const cqrsGraph = this.resolveCqrsGraph(meta.cqrsName);
|
|
317
|
+
if (!cqrsGraph) return;
|
|
318
|
+
cqrsGraph.event(meta.eventName);
|
|
319
|
+
const eventNode = cqrsGraph.resolve(meta.eventName);
|
|
320
|
+
const existingEntries = eventNode.cache;
|
|
321
|
+
let lastSeq = existingEntries && existingEntries.length > 0 ? existingEntries[existingEntries.length - 1].seq : 0;
|
|
322
|
+
const handle = this.observeNodeOn(cqrsGraph, meta.eventName);
|
|
323
|
+
const unsub = handle.subscribe((msgs) => {
|
|
324
|
+
for (const m of msgs) {
|
|
325
|
+
if (m[0] === DATA) {
|
|
326
|
+
const entries = m[1];
|
|
327
|
+
for (const entry of entries) {
|
|
328
|
+
if (entry.seq > lastSeq) {
|
|
329
|
+
bound(entry);
|
|
330
|
+
lastSeq = entry.seq;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
this.disposers.push(unsub);
|
|
337
|
+
}
|
|
338
|
+
// -----------------------------------------------------------------------
|
|
339
|
+
// @QueryHandler — subscribe method to CQRS projection changes
|
|
340
|
+
// -----------------------------------------------------------------------
|
|
341
|
+
wireCqrsQueries() {
|
|
342
|
+
for (const [ctor, metas] of QUERY_HANDLERS) {
|
|
343
|
+
const instance = this.resolveInstance(ctor);
|
|
344
|
+
if (!instance) continue;
|
|
345
|
+
for (const meta of metas) {
|
|
346
|
+
this.wireCqrsQuery(instance, meta);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
wireCqrsQuery(instance, meta) {
|
|
351
|
+
const method = instance[meta.methodKey];
|
|
352
|
+
if (typeof method !== "function") return;
|
|
353
|
+
const bound = method.bind(instance);
|
|
354
|
+
const cqrsGraph = this.resolveCqrsGraph(meta.cqrsName);
|
|
355
|
+
if (!cqrsGraph) return;
|
|
356
|
+
const handle = this.observeNodeOn(cqrsGraph, meta.projectionName);
|
|
357
|
+
const unsub = handle.subscribe((msgs) => {
|
|
358
|
+
for (const m of msgs) {
|
|
359
|
+
if (m[0] === DATA) {
|
|
360
|
+
bound(m[1]);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
this.disposers.push(unsub);
|
|
365
|
+
}
|
|
366
|
+
// -----------------------------------------------------------------------
|
|
367
|
+
// @SagaHandler — register method as CqrsGraph saga (subgraph side effect)
|
|
368
|
+
// -----------------------------------------------------------------------
|
|
369
|
+
wireCqrsSagas() {
|
|
370
|
+
for (const [ctor, metas] of SAGA_HANDLERS) {
|
|
371
|
+
const instance = this.resolveInstance(ctor);
|
|
372
|
+
if (!instance) continue;
|
|
373
|
+
for (const meta of metas) {
|
|
374
|
+
this.wireCqrsSaga(instance, meta);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
wireCqrsSaga(instance, meta) {
|
|
379
|
+
const method = instance[meta.methodKey];
|
|
380
|
+
if (typeof method !== "function") return;
|
|
381
|
+
const bound = method.bind(instance);
|
|
382
|
+
const cqrsGraph = this.resolveCqrsGraph(meta.cqrsName);
|
|
383
|
+
if (!cqrsGraph) return;
|
|
384
|
+
cqrsGraph.saga(meta.sagaName, meta.eventNames, bound);
|
|
385
|
+
}
|
|
386
|
+
// -----------------------------------------------------------------------
|
|
387
|
+
// Helpers
|
|
388
|
+
// -----------------------------------------------------------------------
|
|
389
|
+
observeNode(name) {
|
|
390
|
+
return this.graph.observe(name);
|
|
391
|
+
}
|
|
392
|
+
observeNodeOn(graph, name) {
|
|
393
|
+
return graph.observe(name);
|
|
394
|
+
}
|
|
395
|
+
resolveCqrsGraph(name) {
|
|
396
|
+
try {
|
|
397
|
+
return this.moduleRef.get(getGraphToken(name), { strict: false });
|
|
398
|
+
} catch {
|
|
399
|
+
console.warn(
|
|
400
|
+
`[GraphReFly] CqrsGraph "${name}" not found in DI \u2014 did you import GraphReflyModule.forCqrs({ name: "${name}" })?`
|
|
401
|
+
);
|
|
402
|
+
return null;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
resolveInstance(ctor) {
|
|
406
|
+
try {
|
|
407
|
+
return this.moduleRef.get(ctor, { strict: false });
|
|
408
|
+
} catch {
|
|
409
|
+
return null;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
// src/compat/nestjs/gateway.ts
|
|
415
|
+
import {
|
|
416
|
+
COMPLETE,
|
|
417
|
+
DATA as DATA2,
|
|
418
|
+
ERROR,
|
|
419
|
+
TEARDOWN
|
|
420
|
+
} from "@graphrefly/pure-ts/core";
|
|
421
|
+
function observeSSE(graph, path, opts) {
|
|
422
|
+
const { actor, serialize = defaultSerialize, keepAliveMs, signal } = opts ?? {};
|
|
423
|
+
const encoder = new TextEncoder();
|
|
424
|
+
let stop;
|
|
425
|
+
const useBackpressure = opts?.highWaterMark != null;
|
|
426
|
+
let wm;
|
|
427
|
+
let pullResolve;
|
|
428
|
+
const taggedBuf = [];
|
|
429
|
+
let closed = false;
|
|
430
|
+
return new ReadableStream({
|
|
431
|
+
start(controller) {
|
|
432
|
+
let keepAlive;
|
|
433
|
+
let unsub = () => {
|
|
434
|
+
};
|
|
435
|
+
const close = () => {
|
|
436
|
+
if (closed) return;
|
|
437
|
+
closed = true;
|
|
438
|
+
if (keepAlive !== void 0) clearInterval(keepAlive);
|
|
439
|
+
signal?.removeEventListener("abort", onAbort);
|
|
440
|
+
unsub();
|
|
441
|
+
wm?.dispose();
|
|
442
|
+
pullResolve?.();
|
|
443
|
+
pullResolve = void 0;
|
|
444
|
+
for (const entry of taggedBuf) controller.enqueue(entry.frame);
|
|
445
|
+
taggedBuf.length = 0;
|
|
446
|
+
controller.close();
|
|
447
|
+
};
|
|
448
|
+
stop = close;
|
|
449
|
+
const onAbort = () => close();
|
|
450
|
+
const handle = graph.observe(path, { actor });
|
|
451
|
+
if (useBackpressure) {
|
|
452
|
+
wm = createWatermarkController((msgs) => handle.up(msgs), {
|
|
453
|
+
highWaterMark: opts.highWaterMark,
|
|
454
|
+
lowWaterMark: opts.lowWaterMark ?? Math.floor(opts.highWaterMark / 2)
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
unsub = handle.subscribe((msgs) => {
|
|
458
|
+
for (const msg of msgs) {
|
|
459
|
+
if (closed) return;
|
|
460
|
+
const t = msg[0];
|
|
461
|
+
if (t === DATA2) {
|
|
462
|
+
const frame = encoder.encode(sseFrame("data", serialize(msg[1])));
|
|
463
|
+
if (useBackpressure) {
|
|
464
|
+
taggedBuf.push({ frame, counted: true });
|
|
465
|
+
wm.onEnqueue();
|
|
466
|
+
pullResolve?.();
|
|
467
|
+
pullResolve = void 0;
|
|
468
|
+
} else {
|
|
469
|
+
controller.enqueue(frame);
|
|
470
|
+
}
|
|
471
|
+
} else if (t === ERROR) {
|
|
472
|
+
const frame = encoder.encode(sseFrame("error", serialize(msg[1])));
|
|
473
|
+
if (useBackpressure) {
|
|
474
|
+
taggedBuf.push({ frame, counted: false });
|
|
475
|
+
pullResolve?.();
|
|
476
|
+
pullResolve = void 0;
|
|
477
|
+
} else {
|
|
478
|
+
controller.enqueue(frame);
|
|
479
|
+
}
|
|
480
|
+
close();
|
|
481
|
+
return;
|
|
482
|
+
} else if (t === COMPLETE || t === TEARDOWN) {
|
|
483
|
+
if (t === COMPLETE) {
|
|
484
|
+
const frame = encoder.encode(sseFrame("complete"));
|
|
485
|
+
if (useBackpressure) {
|
|
486
|
+
taggedBuf.push({ frame, counted: false });
|
|
487
|
+
pullResolve?.();
|
|
488
|
+
pullResolve = void 0;
|
|
489
|
+
} else {
|
|
490
|
+
controller.enqueue(frame);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
close();
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
if (keepAliveMs !== void 0 && keepAliveMs > 0) {
|
|
499
|
+
keepAlive = setInterval(() => {
|
|
500
|
+
if (closed) return;
|
|
501
|
+
if (useBackpressure) {
|
|
502
|
+
taggedBuf.push({ frame: encoder.encode(": keepalive\n\n"), counted: false });
|
|
503
|
+
pullResolve?.();
|
|
504
|
+
pullResolve = void 0;
|
|
505
|
+
} else {
|
|
506
|
+
controller.enqueue(encoder.encode(": keepalive\n\n"));
|
|
507
|
+
}
|
|
508
|
+
}, keepAliveMs);
|
|
509
|
+
}
|
|
510
|
+
if (signal?.aborted) onAbort();
|
|
511
|
+
else signal?.addEventListener("abort", onAbort, { once: true });
|
|
512
|
+
},
|
|
513
|
+
pull(controller) {
|
|
514
|
+
if (!useBackpressure) return;
|
|
515
|
+
if (closed) return;
|
|
516
|
+
if (taggedBuf.length > 0) {
|
|
517
|
+
const entry = taggedBuf.shift();
|
|
518
|
+
controller.enqueue(entry.frame);
|
|
519
|
+
if (entry.counted) wm.onDequeue();
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
return new Promise((resolve) => {
|
|
523
|
+
pullResolve = resolve;
|
|
524
|
+
});
|
|
525
|
+
},
|
|
526
|
+
cancel() {
|
|
527
|
+
try {
|
|
528
|
+
stop?.();
|
|
529
|
+
} catch {
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
function observeSubscription(graph, path, opts) {
|
|
535
|
+
const { actor, filter } = opts ?? {};
|
|
536
|
+
const queue = [];
|
|
537
|
+
const waiters = [];
|
|
538
|
+
let disposed = false;
|
|
539
|
+
const handle = graph.observe(path, { actor });
|
|
540
|
+
const wm = opts?.highWaterMark != null ? createWatermarkController((msgs) => handle.up(msgs), {
|
|
541
|
+
highWaterMark: opts.highWaterMark,
|
|
542
|
+
lowWaterMark: opts.lowWaterMark ?? Math.floor(opts.highWaterMark / 2)
|
|
543
|
+
}) : void 0;
|
|
544
|
+
const dispose = () => {
|
|
545
|
+
if (disposed) return;
|
|
546
|
+
disposed = true;
|
|
547
|
+
wm?.dispose();
|
|
548
|
+
unsub();
|
|
549
|
+
};
|
|
550
|
+
const push = (item) => {
|
|
551
|
+
if (disposed) return;
|
|
552
|
+
if (waiters.length > 0) {
|
|
553
|
+
const w = waiters.shift();
|
|
554
|
+
if (item.done && item.error) w.reject(item.error);
|
|
555
|
+
else if (item.done) w.resolve({ done: true, value: void 0 });
|
|
556
|
+
else w.resolve({ done: false, value: item.value });
|
|
557
|
+
} else {
|
|
558
|
+
queue.push(item);
|
|
559
|
+
if (!item.done) wm?.onEnqueue();
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
const unsub = handle.subscribe((msgs) => {
|
|
563
|
+
for (const msg of msgs) {
|
|
564
|
+
const t = msg[0];
|
|
565
|
+
if (t === DATA2) {
|
|
566
|
+
const value = msg[1];
|
|
567
|
+
if (filter && !filter(value)) continue;
|
|
568
|
+
push({ done: false, value });
|
|
569
|
+
} else if (t === ERROR) {
|
|
570
|
+
const err = msg[1] instanceof Error ? msg[1] : new Error(String(msg[1]));
|
|
571
|
+
push({ done: true, error: err });
|
|
572
|
+
dispose();
|
|
573
|
+
return;
|
|
574
|
+
} else if (t === COMPLETE || t === TEARDOWN) {
|
|
575
|
+
push({ done: true });
|
|
576
|
+
dispose();
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
const iterator = {
|
|
582
|
+
next() {
|
|
583
|
+
if (queue.length > 0) {
|
|
584
|
+
const item = queue.shift();
|
|
585
|
+
if (!item.done) wm?.onDequeue();
|
|
586
|
+
if (item.done && item.error) return Promise.reject(item.error);
|
|
587
|
+
return Promise.resolve(
|
|
588
|
+
item.done ? { done: true, value: void 0 } : { done: false, value: item.value }
|
|
589
|
+
);
|
|
590
|
+
}
|
|
591
|
+
if (disposed) return Promise.resolve({ done: true, value: void 0 });
|
|
592
|
+
return new Promise((resolve, reject) => {
|
|
593
|
+
waiters.push({ resolve, reject });
|
|
594
|
+
});
|
|
595
|
+
},
|
|
596
|
+
return() {
|
|
597
|
+
dispose();
|
|
598
|
+
for (const w of waiters) w.resolve({ done: true, value: void 0 });
|
|
599
|
+
waiters.length = 0;
|
|
600
|
+
return Promise.resolve({ done: true, value: void 0 });
|
|
601
|
+
},
|
|
602
|
+
throw(err) {
|
|
603
|
+
dispose();
|
|
604
|
+
return Promise.reject(err);
|
|
605
|
+
},
|
|
606
|
+
[Symbol.asyncIterator]() {
|
|
607
|
+
return this;
|
|
608
|
+
}
|
|
609
|
+
};
|
|
610
|
+
return iterator;
|
|
611
|
+
}
|
|
612
|
+
var ObserveGateway = class {
|
|
613
|
+
constructor(graph, opts) {
|
|
614
|
+
this.graph = graph;
|
|
615
|
+
this.extractActor = opts?.extractActor ?? (() => void 0);
|
|
616
|
+
this.parse = opts?.parse ?? defaultParseCommand;
|
|
617
|
+
this.highWaterMark = opts?.highWaterMark;
|
|
618
|
+
this.lowWaterMark = opts?.lowWaterMark;
|
|
619
|
+
}
|
|
620
|
+
clients = /* @__PURE__ */ new Map();
|
|
621
|
+
extractActor;
|
|
622
|
+
parse;
|
|
623
|
+
highWaterMark;
|
|
624
|
+
lowWaterMark;
|
|
625
|
+
/**
|
|
626
|
+
* Register a new client. Call from `handleConnection`.
|
|
627
|
+
*/
|
|
628
|
+
handleConnection(client) {
|
|
629
|
+
if (!this.clients.has(client)) {
|
|
630
|
+
this.clients.set(client, /* @__PURE__ */ new Map());
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Unregister a client and dispose all its subscriptions. Call from `handleDisconnect`.
|
|
635
|
+
*/
|
|
636
|
+
handleDisconnect(client) {
|
|
637
|
+
const subs = this.clients.get(client);
|
|
638
|
+
if (!subs) return;
|
|
639
|
+
for (const entry of subs.values()) {
|
|
640
|
+
entry.wm?.dispose();
|
|
641
|
+
entry.unsub();
|
|
642
|
+
}
|
|
643
|
+
this.clients.delete(client);
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Handle an incoming client message (subscribe/unsubscribe/ack command).
|
|
647
|
+
*
|
|
648
|
+
* @param client - The WebSocket client reference.
|
|
649
|
+
* @param raw - Raw message data (string or parsed object).
|
|
650
|
+
* @param send - Function to send a message back to the client.
|
|
651
|
+
* Defaults to `client.send(JSON.stringify(msg))`.
|
|
652
|
+
*/
|
|
653
|
+
handleMessage(client, raw, send) {
|
|
654
|
+
const sender = send ?? defaultSend.bind(null, client);
|
|
655
|
+
let cmd;
|
|
656
|
+
try {
|
|
657
|
+
cmd = typeof raw === "string" ? this.parse(raw) : raw;
|
|
658
|
+
} catch {
|
|
659
|
+
sender({ type: "err", message: "invalid command" });
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
if (cmd.type === "subscribe") {
|
|
663
|
+
this.subscribe(client, cmd.path, sender);
|
|
664
|
+
} else if (cmd.type === "unsubscribe") {
|
|
665
|
+
this.unsubscribe(client, cmd.path, sender);
|
|
666
|
+
} else if (cmd.type === "ack") {
|
|
667
|
+
this.ack(client, cmd.path, cmd.count ?? 1);
|
|
668
|
+
} else {
|
|
669
|
+
sender({ type: "err", message: `unknown command type: ${cmd.type}` });
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Number of active subscriptions for a client. Useful for tests.
|
|
674
|
+
*/
|
|
675
|
+
subscriptionCount(client) {
|
|
676
|
+
return this.clients.get(client)?.size ?? 0;
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Dispose all clients and subscriptions.
|
|
680
|
+
*/
|
|
681
|
+
destroy() {
|
|
682
|
+
for (const [client] of this.clients) {
|
|
683
|
+
this.handleDisconnect(client);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
// -----------------------------------------------------------------------
|
|
687
|
+
// Internal
|
|
688
|
+
// -----------------------------------------------------------------------
|
|
689
|
+
subscribe(client, path, send) {
|
|
690
|
+
let subs = this.clients.get(client);
|
|
691
|
+
if (!subs) {
|
|
692
|
+
subs = /* @__PURE__ */ new Map();
|
|
693
|
+
this.clients.set(client, subs);
|
|
694
|
+
}
|
|
695
|
+
if (subs.has(path)) {
|
|
696
|
+
send({ type: "subscribed", path });
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
const actor = this.extractActor(client);
|
|
700
|
+
let handle;
|
|
701
|
+
try {
|
|
702
|
+
handle = this.graph.observe(path, { actor });
|
|
703
|
+
} catch (err) {
|
|
704
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
705
|
+
send({ type: "err", message });
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
const wm = this.highWaterMark != null ? createWatermarkController((msgs) => handle.up(msgs), {
|
|
709
|
+
highWaterMark: this.highWaterMark,
|
|
710
|
+
lowWaterMark: this.lowWaterMark ?? Math.floor(this.highWaterMark / 2)
|
|
711
|
+
}) : void 0;
|
|
712
|
+
const cleanup = () => {
|
|
713
|
+
wm?.dispose();
|
|
714
|
+
unsub();
|
|
715
|
+
subs.delete(path);
|
|
716
|
+
};
|
|
717
|
+
const unsub = handle.subscribe((msgs) => {
|
|
718
|
+
for (const msg of msgs) {
|
|
719
|
+
const t = msg[0];
|
|
720
|
+
if (t === DATA2) {
|
|
721
|
+
wm?.onEnqueue();
|
|
722
|
+
trySend(send, { type: "data", path, value: msg[1] });
|
|
723
|
+
} else if (t === ERROR) {
|
|
724
|
+
const errMsg = msg[1] instanceof Error ? msg[1].message : String(msg[1]);
|
|
725
|
+
trySend(send, { type: "error", path, error: errMsg });
|
|
726
|
+
cleanup();
|
|
727
|
+
return;
|
|
728
|
+
} else if (t === COMPLETE || t === TEARDOWN) {
|
|
729
|
+
trySend(send, { type: "complete", path });
|
|
730
|
+
cleanup();
|
|
731
|
+
return;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
subs.set(path, { unsub, wm });
|
|
736
|
+
send({ type: "subscribed", path });
|
|
737
|
+
}
|
|
738
|
+
unsubscribe(client, path, send) {
|
|
739
|
+
const subs = this.clients.get(client);
|
|
740
|
+
const entry = subs?.get(path);
|
|
741
|
+
if (entry) {
|
|
742
|
+
entry.wm?.dispose();
|
|
743
|
+
entry.unsub();
|
|
744
|
+
subs.delete(path);
|
|
745
|
+
}
|
|
746
|
+
send({ type: "unsubscribed", path });
|
|
747
|
+
}
|
|
748
|
+
ack(client, path, count) {
|
|
749
|
+
const entry = this.clients.get(client)?.get(path);
|
|
750
|
+
if (!entry?.wm) return;
|
|
751
|
+
const n = Math.min(Math.max(0, Math.floor(count)), 1024);
|
|
752
|
+
for (let i = 0; i < n; i++) entry.wm.onDequeue();
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
function defaultSerialize(value) {
|
|
756
|
+
if (value instanceof Error) return value.message;
|
|
757
|
+
try {
|
|
758
|
+
return JSON.stringify(value);
|
|
759
|
+
} catch {
|
|
760
|
+
return String(value);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
function sseFrame(event, data) {
|
|
764
|
+
let frame = `event: ${event}
|
|
765
|
+
`;
|
|
766
|
+
if (data !== void 0) {
|
|
767
|
+
for (const line of data.split("\n")) {
|
|
768
|
+
frame += `data: ${line}
|
|
769
|
+
`;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
frame += "\n";
|
|
773
|
+
return frame;
|
|
774
|
+
}
|
|
775
|
+
function defaultParseCommand(data) {
|
|
776
|
+
return JSON.parse(data);
|
|
777
|
+
}
|
|
778
|
+
function defaultSend(client, msg) {
|
|
779
|
+
try {
|
|
780
|
+
client.send(JSON.stringify(msg));
|
|
781
|
+
} catch {
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
function trySend(send, msg) {
|
|
785
|
+
try {
|
|
786
|
+
send(msg);
|
|
787
|
+
} catch {
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
// src/compat/nestjs/guard.ts
|
|
792
|
+
import { DEFAULT_ACTOR, normalizeActor } from "@graphrefly/pure-ts/core";
|
|
793
|
+
var ACTOR_KEY = "graphReflyActor";
|
|
794
|
+
function fromJwtPayload(mapping) {
|
|
795
|
+
return (context) => {
|
|
796
|
+
const req = context.switchToHttp().getRequest();
|
|
797
|
+
const user = req?.user;
|
|
798
|
+
if (user == null) return void 0;
|
|
799
|
+
if (mapping) return mapping(user);
|
|
800
|
+
return user;
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
function fromHeader(headerName = "x-graphrefly-actor") {
|
|
804
|
+
return (context) => {
|
|
805
|
+
const req = context.switchToHttp().getRequest();
|
|
806
|
+
const raw = req?.headers?.[headerName.toLowerCase()];
|
|
807
|
+
if (typeof raw !== "string" || raw.length === 0) return void 0;
|
|
808
|
+
try {
|
|
809
|
+
return JSON.parse(raw);
|
|
810
|
+
} catch {
|
|
811
|
+
return void 0;
|
|
812
|
+
}
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
function getActor(req) {
|
|
816
|
+
const actor = req?.[ACTOR_KEY];
|
|
817
|
+
return actor != null ? normalizeActor(actor) : DEFAULT_ACTOR;
|
|
818
|
+
}
|
|
819
|
+
var GraphReflyGuardImpl = class {
|
|
820
|
+
constructor(extractor) {
|
|
821
|
+
this.extractor = extractor;
|
|
822
|
+
}
|
|
823
|
+
canActivate(context) {
|
|
824
|
+
const actor = normalizeActor(this.extractor(context));
|
|
825
|
+
const req = context.switchToHttp().getRequest();
|
|
826
|
+
if (req != null) {
|
|
827
|
+
req[ACTOR_KEY] = actor;
|
|
828
|
+
}
|
|
829
|
+
return true;
|
|
830
|
+
}
|
|
831
|
+
};
|
|
832
|
+
function GraphReflyGuard(extractor) {
|
|
833
|
+
return new GraphReflyGuardImpl(extractor ?? fromJwtPayload());
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
// src/compat/nestjs/module.ts
|
|
837
|
+
import { Graph } from "@graphrefly/pure-ts/graph";
|
|
838
|
+
import {
|
|
839
|
+
Module,
|
|
840
|
+
Scope
|
|
841
|
+
} from "@nestjs/common";
|
|
842
|
+
import { ModuleRef } from "@nestjs/core";
|
|
843
|
+
var GraphReflyRootLifecycle = class {
|
|
844
|
+
constructor(graph) {
|
|
845
|
+
this.graph = graph;
|
|
846
|
+
}
|
|
847
|
+
onModuleDestroy() {
|
|
848
|
+
this.graph.destroy();
|
|
849
|
+
}
|
|
850
|
+
};
|
|
851
|
+
var GraphReflyRequestLifecycle = class {
|
|
852
|
+
graph = new Graph("request");
|
|
853
|
+
onModuleDestroy() {
|
|
854
|
+
this.graph.destroy();
|
|
855
|
+
}
|
|
856
|
+
};
|
|
857
|
+
var _GraphReflyModule_decorators, _init;
|
|
858
|
+
_GraphReflyModule_decorators = [Module({})];
|
|
859
|
+
var _GraphReflyModule = class _GraphReflyModule {
|
|
860
|
+
/**
|
|
861
|
+
* Register the root `Graph` singleton in the NestJS DI container.
|
|
862
|
+
*
|
|
863
|
+
* The root graph is `@Global()` — injectable everywhere without importing
|
|
864
|
+
* the module again. Use `@InjectGraph()` to inject it.
|
|
865
|
+
*
|
|
866
|
+
* Lifecycle:
|
|
867
|
+
* - **init:** Graph created in factory. If `build` is provided, it runs
|
|
868
|
+
* first (registers nodes/mounts). If `snapshot` is provided, values
|
|
869
|
+
* are restored via `graph.restore()`.
|
|
870
|
+
* - **destroy:** Calls `graph.destroy()` — sends `[[TEARDOWN]]` to all
|
|
871
|
+
* nodes, including mounted feature subgraphs (cascading teardown).
|
|
872
|
+
*/
|
|
873
|
+
static forRoot(opts) {
|
|
874
|
+
const options = opts ?? {};
|
|
875
|
+
const graphName = options.name ?? "root";
|
|
876
|
+
const providers = [
|
|
877
|
+
{
|
|
878
|
+
provide: GRAPHREFLY_ROOT_GRAPH,
|
|
879
|
+
useFactory: () => {
|
|
880
|
+
const g = new Graph(graphName);
|
|
881
|
+
if (options.build) options.build(g);
|
|
882
|
+
if (options.snapshot) g.restore(options.snapshot);
|
|
883
|
+
return g;
|
|
884
|
+
}
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
provide: /* @__PURE__ */ Symbol.for("graphrefly:root-lifecycle"),
|
|
888
|
+
useFactory: (graph) => new GraphReflyRootLifecycle(graph),
|
|
889
|
+
inject: [GRAPHREFLY_ROOT_GRAPH]
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
provide: GraphReflyEventExplorer,
|
|
893
|
+
useFactory: (graph, moduleRef) => new GraphReflyEventExplorer(graph, moduleRef),
|
|
894
|
+
inject: [GRAPHREFLY_ROOT_GRAPH, ModuleRef]
|
|
895
|
+
}
|
|
896
|
+
];
|
|
897
|
+
if (options.nodes) {
|
|
898
|
+
for (const path of options.nodes) {
|
|
899
|
+
providers.push({
|
|
900
|
+
provide: getNodeToken(path),
|
|
901
|
+
useFactory: (graph) => graph.resolve(path),
|
|
902
|
+
inject: [GRAPHREFLY_ROOT_GRAPH]
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
if (options.requestScope) {
|
|
907
|
+
providers.push(
|
|
908
|
+
{
|
|
909
|
+
provide: /* @__PURE__ */ Symbol.for("graphrefly:request-lifecycle"),
|
|
910
|
+
useFactory: () => new GraphReflyRequestLifecycle(),
|
|
911
|
+
scope: Scope.REQUEST
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
provide: GRAPHREFLY_REQUEST_GRAPH,
|
|
915
|
+
useFactory: (lifecycle) => lifecycle.graph,
|
|
916
|
+
inject: [/* @__PURE__ */ Symbol.for("graphrefly:request-lifecycle")],
|
|
917
|
+
scope: Scope.REQUEST
|
|
918
|
+
}
|
|
919
|
+
);
|
|
920
|
+
}
|
|
921
|
+
return {
|
|
922
|
+
module: _GraphReflyModule,
|
|
923
|
+
global: true,
|
|
924
|
+
providers,
|
|
925
|
+
exports: [
|
|
926
|
+
GRAPHREFLY_ROOT_GRAPH,
|
|
927
|
+
...(options.nodes ?? []).map(getNodeToken),
|
|
928
|
+
...options.requestScope ? [GRAPHREFLY_REQUEST_GRAPH] : []
|
|
929
|
+
]
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* Register a feature subgraph that auto-mounts into the root graph.
|
|
934
|
+
*
|
|
935
|
+
* The feature graph is created in the factory, built/restored, then
|
|
936
|
+
* mounted into root via `root.mount(name, featureGraph)`. On app
|
|
937
|
+
* shutdown, root's `graph.destroy()` cascades TEARDOWN through all
|
|
938
|
+
* mounted subgraphs (no explicit remove needed).
|
|
939
|
+
*
|
|
940
|
+
* Node tokens are auto-qualified as `featureName::path` to prevent
|
|
941
|
+
* collisions between features declaring nodes with the same local name.
|
|
942
|
+
*
|
|
943
|
+
* Injectable via `@InjectGraph(name)`.
|
|
944
|
+
*/
|
|
945
|
+
static forFeature(opts) {
|
|
946
|
+
const providers = [
|
|
947
|
+
{
|
|
948
|
+
provide: getGraphToken(opts.name),
|
|
949
|
+
useFactory: (rootGraph) => {
|
|
950
|
+
const g = new Graph(opts.name);
|
|
951
|
+
if (opts.build) opts.build(g);
|
|
952
|
+
if (opts.snapshot) g.restore(opts.snapshot);
|
|
953
|
+
rootGraph.mount(opts.name, g);
|
|
954
|
+
return g;
|
|
955
|
+
},
|
|
956
|
+
inject: [GRAPHREFLY_ROOT_GRAPH]
|
|
957
|
+
}
|
|
958
|
+
];
|
|
959
|
+
if (opts.nodes) {
|
|
960
|
+
for (const path of opts.nodes) {
|
|
961
|
+
providers.push({
|
|
962
|
+
provide: getNodeToken(`${opts.name}::${path}`),
|
|
963
|
+
useFactory: (graph) => graph.resolve(path),
|
|
964
|
+
inject: [getGraphToken(opts.name)]
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
return {
|
|
969
|
+
module: _GraphReflyModule,
|
|
970
|
+
providers,
|
|
971
|
+
exports: [
|
|
972
|
+
getGraphToken(opts.name),
|
|
973
|
+
...(opts.nodes ?? []).map((p) => getNodeToken(`${opts.name}::${p}`))
|
|
974
|
+
]
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
/**
|
|
978
|
+
* Register a CQRS subgraph that auto-mounts into the root graph.
|
|
979
|
+
*
|
|
980
|
+
* Creates a `CqrsGraph` via the `cqrs()` factory (roadmap §4.5), mounts it
|
|
981
|
+
* into the root graph, and exposes it for DI via `@InjectGraph(name)`.
|
|
982
|
+
*
|
|
983
|
+
* CQRS decorators (`@CommandHandler`, `@EventHandler`, `@QueryHandler`,
|
|
984
|
+
* `@SagaHandler`) are discovered by the explorer and wired to this graph
|
|
985
|
+
* on module init.
|
|
986
|
+
*
|
|
987
|
+
* @example
|
|
988
|
+
* ```ts
|
|
989
|
+
* GraphReflyModule.forCqrs({
|
|
990
|
+
* name: "orders",
|
|
991
|
+
* build: (g) => {
|
|
992
|
+
* g.event("orderPlaced");
|
|
993
|
+
* g.projection({ name: "orderCount", events: ["orderPlaced"], reducer: (_s, evts) => evts.length, initial: 0 });
|
|
994
|
+
* },
|
|
995
|
+
* })
|
|
996
|
+
* ```
|
|
997
|
+
*/
|
|
998
|
+
static forCqrs(opts) {
|
|
999
|
+
const providers = [
|
|
1000
|
+
{
|
|
1001
|
+
provide: getGraphToken(opts.name),
|
|
1002
|
+
useFactory: (rootGraph) => {
|
|
1003
|
+
const g = cqrs(opts.name, opts.cqrs);
|
|
1004
|
+
if (opts.eventStorage) g.attachEventStorage(opts.eventStorage);
|
|
1005
|
+
if (opts.build) opts.build(g);
|
|
1006
|
+
rootGraph.mount(opts.name, g);
|
|
1007
|
+
return g;
|
|
1008
|
+
},
|
|
1009
|
+
inject: [GRAPHREFLY_ROOT_GRAPH]
|
|
1010
|
+
}
|
|
1011
|
+
];
|
|
1012
|
+
if (opts.nodes) {
|
|
1013
|
+
for (const path of opts.nodes) {
|
|
1014
|
+
providers.push({
|
|
1015
|
+
provide: getNodeToken(`${opts.name}::${path}`),
|
|
1016
|
+
useFactory: (graph) => graph.resolve(path),
|
|
1017
|
+
inject: [getGraphToken(opts.name)]
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
return {
|
|
1022
|
+
module: _GraphReflyModule,
|
|
1023
|
+
providers,
|
|
1024
|
+
exports: [
|
|
1025
|
+
getGraphToken(opts.name),
|
|
1026
|
+
...(opts.nodes ?? []).map((p) => getNodeToken(`${opts.name}::${p}`))
|
|
1027
|
+
]
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
_init = __decoratorStart(null);
|
|
1032
|
+
_GraphReflyModule = __decorateElement(_init, 0, "GraphReflyModule", _GraphReflyModule_decorators, _GraphReflyModule);
|
|
1033
|
+
__runInitializers(_init, 1, _GraphReflyModule);
|
|
1034
|
+
var GraphReflyModule = _GraphReflyModule;
|
|
1035
|
+
|
|
1036
|
+
export {
|
|
1037
|
+
GRAPHREFLY_ROOT_GRAPH,
|
|
1038
|
+
GRAPHREFLY_REQUEST_GRAPH,
|
|
1039
|
+
getGraphToken,
|
|
1040
|
+
getNodeToken,
|
|
1041
|
+
EVENT_HANDLERS,
|
|
1042
|
+
INTERVAL_HANDLERS,
|
|
1043
|
+
CRON_HANDLERS,
|
|
1044
|
+
COMMAND_HANDLERS,
|
|
1045
|
+
CQRS_EVENT_HANDLERS,
|
|
1046
|
+
QUERY_HANDLERS,
|
|
1047
|
+
SAGA_HANDLERS,
|
|
1048
|
+
InjectGraph,
|
|
1049
|
+
InjectCqrsGraph,
|
|
1050
|
+
InjectNode,
|
|
1051
|
+
OnGraphEvent,
|
|
1052
|
+
GraphInterval,
|
|
1053
|
+
GraphCron,
|
|
1054
|
+
CommandHandler,
|
|
1055
|
+
EventHandler,
|
|
1056
|
+
QueryHandler,
|
|
1057
|
+
SagaHandler,
|
|
1058
|
+
GraphReflyEventExplorer,
|
|
1059
|
+
observeSSE,
|
|
1060
|
+
observeSubscription,
|
|
1061
|
+
ObserveGateway,
|
|
1062
|
+
ACTOR_KEY,
|
|
1063
|
+
fromJwtPayload,
|
|
1064
|
+
fromHeader,
|
|
1065
|
+
getActor,
|
|
1066
|
+
GraphReflyGuardImpl,
|
|
1067
|
+
GraphReflyGuard,
|
|
1068
|
+
GraphReflyModule,
|
|
1069
|
+
nestjs_exports
|
|
1070
|
+
};
|
|
1071
|
+
//# sourceMappingURL=chunk-LBAJK24K.js.map
|