@graphrefly/graphrefly 0.44.0 → 0.45.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 +21 -17
- package/dist/compat/index.cjs +20 -10
- package/dist/compat/index.cjs.map +1 -0
- package/dist/compat/index.d.cts +1 -22
- package/dist/compat/index.d.ts +1 -22
- package/dist/compat/index.js +3 -1
- package/dist/compat/index.js.map +1 -0
- package/dist/compat/jotai/index.cjs +21 -1
- package/dist/compat/jotai/index.cjs.map +1 -0
- package/dist/compat/jotai/index.d.cts +1 -2
- package/dist/compat/jotai/index.d.ts +1 -2
- package/dist/compat/jotai/index.js +3 -1
- package/dist/compat/jotai/index.js.map +1 -0
- package/dist/compat/nanostores/index.cjs +21 -1
- package/dist/compat/nanostores/index.cjs.map +1 -0
- package/dist/compat/nanostores/index.d.cts +1 -2
- package/dist/compat/nanostores/index.d.ts +1 -2
- package/dist/compat/nanostores/index.js +3 -1
- package/dist/compat/nanostores/index.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +20 -10
- package/dist/compat/nestjs/index.cjs.map +1 -0
- package/dist/compat/nestjs/index.d.cts +1 -13
- package/dist/compat/nestjs/index.d.ts +1 -13
- package/dist/compat/nestjs/index.js +3 -1
- package/dist/compat/nestjs/index.js.map +1 -0
- package/dist/compat/react/index.cjs +21 -1
- package/dist/compat/react/index.cjs.map +1 -0
- package/dist/compat/react/index.d.cts +1 -2
- package/dist/compat/react/index.d.ts +1 -2
- package/dist/compat/react/index.js +3 -1
- package/dist/compat/react/index.js.map +1 -0
- package/dist/compat/solid/index.cjs +21 -1
- package/dist/compat/solid/index.cjs.map +1 -0
- package/dist/compat/solid/index.d.cts +1 -2
- package/dist/compat/solid/index.d.ts +1 -2
- package/dist/compat/solid/index.js +3 -1
- package/dist/compat/solid/index.js.map +1 -0
- package/dist/compat/svelte/index.cjs +21 -1
- package/dist/compat/svelte/index.cjs.map +1 -0
- package/dist/compat/svelte/index.d.cts +1 -2
- package/dist/compat/svelte/index.d.ts +1 -2
- package/dist/compat/svelte/index.js +3 -1
- package/dist/compat/svelte/index.js.map +1 -0
- package/dist/compat/vue/index.cjs +21 -1
- package/dist/compat/vue/index.cjs.map +1 -0
- package/dist/compat/vue/index.d.cts +1 -3
- package/dist/compat/vue/index.d.ts +1 -3
- package/dist/compat/vue/index.js +3 -1
- package/dist/compat/vue/index.js.map +1 -0
- package/dist/compat/zustand/index.cjs +21 -3
- package/dist/compat/zustand/index.cjs.map +1 -0
- package/dist/compat/zustand/index.d.cts +1 -6
- package/dist/compat/zustand/index.d.ts +1 -6
- package/dist/compat/zustand/index.js +3 -1
- package/dist/compat/zustand/index.js.map +1 -0
- package/dist/core/index.cjs +21 -1
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +1 -3
- package/dist/core/index.d.ts +1 -3
- package/dist/core/index.js +3 -1
- package/dist/core/index.js.map +1 -0
- package/dist/extra/browser.cjs +21 -1
- package/dist/extra/browser.cjs.map +1 -0
- package/dist/extra/browser.d.cts +1 -4
- package/dist/extra/browser.d.ts +1 -4
- package/dist/extra/browser.js +3 -1
- package/dist/extra/browser.js.map +1 -0
- package/dist/extra/index.cjs +20 -19
- package/dist/extra/index.cjs.map +1 -0
- package/dist/extra/index.d.cts +1 -17
- package/dist/extra/index.d.ts +1 -17
- package/dist/extra/index.js +3 -1
- package/dist/extra/index.js.map +1 -0
- package/dist/extra/node.cjs +21 -2
- package/dist/extra/node.cjs.map +1 -0
- package/dist/extra/node.d.cts +1 -187
- package/dist/extra/node.d.ts +1 -187
- package/dist/extra/node.js +3 -2
- package/dist/extra/node.js.map +1 -0
- package/dist/extra/operators.cjs +21 -1
- package/dist/extra/operators.cjs.map +1 -0
- package/dist/extra/operators.d.cts +1 -958
- package/dist/extra/operators.d.ts +1 -958
- package/dist/extra/operators.js +3 -1
- package/dist/extra/operators.js.map +1 -0
- package/dist/extra/reactive.cjs +21 -1
- package/dist/extra/reactive.cjs.map +1 -0
- package/dist/extra/reactive.d.cts +1 -353
- package/dist/extra/reactive.d.ts +1 -353
- package/dist/extra/reactive.js +3 -1
- package/dist/extra/reactive.js.map +1 -0
- package/dist/extra/render/index.cjs +21 -5
- package/dist/extra/render/index.cjs.map +1 -0
- package/dist/extra/render/index.d.cts +1 -183
- package/dist/extra/render/index.d.ts +1 -183
- package/dist/extra/render/index.js +3 -1
- package/dist/extra/render/index.js.map +1 -0
- package/dist/extra/sources.cjs +21 -3
- package/dist/extra/sources.cjs.map +1 -0
- package/dist/extra/sources.d.cts +1 -584
- package/dist/extra/sources.d.ts +1 -584
- package/dist/extra/sources.js +3 -1
- package/dist/extra/sources.js.map +1 -0
- package/dist/extra/storage-browser.cjs +21 -1
- package/dist/extra/storage-browser.cjs.map +1 -0
- package/dist/extra/storage-browser.d.cts +1 -37
- package/dist/extra/storage-browser.d.ts +1 -37
- package/dist/extra/storage-browser.js +3 -1
- package/dist/extra/storage-browser.js.map +1 -0
- package/dist/extra/storage-core.cjs +21 -1
- package/dist/extra/storage-core.cjs.map +1 -0
- package/dist/extra/storage-core.d.cts +1 -28
- package/dist/extra/storage-core.d.ts +1 -28
- package/dist/extra/storage-core.js +3 -1
- package/dist/extra/storage-core.js.map +1 -0
- package/dist/extra/storage-node.cjs +20 -0
- package/dist/extra/storage-node.cjs.map +1 -0
- package/dist/extra/storage-node.d.cts +1 -2
- package/dist/extra/storage-node.d.ts +1 -2
- package/dist/extra/storage-node.js +3 -0
- package/dist/extra/storage-node.js.map +1 -0
- package/dist/extra/storage-tiers-browser.cjs +21 -1
- package/dist/extra/storage-tiers-browser.cjs.map +1 -0
- package/dist/extra/storage-tiers-browser.d.cts +1 -120
- package/dist/extra/storage-tiers-browser.d.ts +1 -120
- package/dist/extra/storage-tiers-browser.js +3 -1
- package/dist/extra/storage-tiers-browser.js.map +1 -0
- package/dist/extra/storage-tiers-node.cjs +21 -1
- package/dist/extra/storage-tiers-node.cjs.map +1 -0
- package/dist/extra/storage-tiers-node.d.cts +1 -210
- package/dist/extra/storage-tiers-node.d.ts +1 -210
- package/dist/extra/storage-tiers-node.js +3 -1
- package/dist/extra/storage-tiers-node.js.map +1 -0
- package/dist/extra/storage-tiers.cjs +21 -1
- package/dist/extra/storage-tiers.cjs.map +1 -0
- package/dist/extra/storage-tiers.d.cts +1 -412
- package/dist/extra/storage-tiers.d.ts +1 -412
- package/dist/extra/storage-tiers.js +3 -1
- package/dist/extra/storage-tiers.js.map +1 -0
- package/dist/extra/storage-wal.cjs +21 -0
- package/dist/extra/storage-wal.cjs.map +1 -0
- package/dist/extra/storage-wal.d.cts +1 -0
- package/dist/extra/storage-wal.d.ts +1 -0
- package/dist/extra/storage-wal.js +3 -0
- package/dist/extra/storage-wal.js.map +1 -0
- package/dist/graph/index.cjs +21 -7
- package/dist/graph/index.cjs.map +1 -0
- package/dist/graph/index.d.cts +1 -7
- package/dist/graph/index.d.ts +1 -7
- package/dist/graph/index.js +3 -1
- package/dist/graph/index.js.map +1 -0
- package/dist/index.cjs +20 -227
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +45 -95
- package/dist/index.d.ts +45 -95
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -0
- package/dist/patterns/ai/browser.cjs +20 -7
- package/dist/patterns/ai/browser.cjs.map +1 -0
- package/dist/patterns/ai/browser.d.cts +1 -127
- package/dist/patterns/ai/browser.d.ts +1 -127
- package/dist/patterns/ai/browser.js +3 -3
- package/dist/patterns/ai/browser.js.map +1 -0
- package/dist/patterns/ai/index.cjs +20 -73
- package/dist/patterns/ai/index.cjs.map +1 -0
- package/dist/patterns/ai/index.d.cts +1 -20
- package/dist/patterns/ai/index.d.ts +1 -20
- package/dist/patterns/ai/index.js +3 -1
- package/dist/patterns/ai/index.js.map +1 -0
- package/dist/patterns/ai/node.cjs +21 -1
- package/dist/patterns/ai/node.cjs.map +1 -0
- package/dist/patterns/ai/node.d.cts +1 -59
- package/dist/patterns/ai/node.d.ts +1 -59
- package/dist/patterns/ai/node.js +3 -1
- package/dist/patterns/ai/node.js.map +1 -0
- package/dist/patterns/cqrs/index.cjs +21 -3
- package/dist/patterns/cqrs/index.cjs.map +1 -0
- package/dist/patterns/cqrs/index.d.cts +1 -8
- package/dist/patterns/cqrs/index.d.ts +1 -8
- package/dist/patterns/cqrs/index.js +3 -1
- package/dist/patterns/cqrs/index.js.map +1 -0
- package/dist/patterns/demo-shell/index.cjs +21 -5
- package/dist/patterns/demo-shell/index.cjs.map +1 -0
- package/dist/patterns/demo-shell/index.d.cts +1 -7
- package/dist/patterns/demo-shell/index.d.ts +1 -7
- package/dist/patterns/demo-shell/index.js +3 -1
- package/dist/patterns/demo-shell/index.js.map +1 -0
- package/dist/patterns/domain-templates/index.cjs +21 -3
- package/dist/patterns/domain-templates/index.cjs.map +1 -0
- package/dist/patterns/domain-templates/index.d.cts +1 -6
- package/dist/patterns/domain-templates/index.d.ts +1 -6
- package/dist/patterns/domain-templates/index.js +3 -1
- package/dist/patterns/domain-templates/index.js.map +1 -0
- package/dist/patterns/graphspec/index.cjs +21 -86
- package/dist/patterns/graphspec/index.cjs.map +1 -0
- package/dist/patterns/graphspec/index.d.cts +1 -8
- package/dist/patterns/graphspec/index.d.ts +1 -8
- package/dist/patterns/graphspec/index.js +3 -1
- package/dist/patterns/graphspec/index.js.map +1 -0
- package/dist/patterns/harness/index.cjs +21 -48
- package/dist/patterns/harness/index.cjs.map +1 -0
- package/dist/patterns/harness/index.d.cts +1 -13
- package/dist/patterns/harness/index.d.ts +1 -13
- package/dist/patterns/harness/index.js +3 -1
- package/dist/patterns/harness/index.js.map +1 -0
- package/dist/patterns/inspect/index.cjs +21 -3
- package/dist/patterns/inspect/index.cjs.map +1 -0
- package/dist/patterns/inspect/index.d.cts +1 -9
- package/dist/patterns/inspect/index.d.ts +1 -9
- package/dist/patterns/inspect/index.js +3 -1
- package/dist/patterns/inspect/index.js.map +1 -0
- package/dist/patterns/job-queue/index.cjs +21 -3
- package/dist/patterns/job-queue/index.cjs.map +1 -0
- package/dist/patterns/job-queue/index.d.cts +1 -9
- package/dist/patterns/job-queue/index.d.ts +1 -9
- package/dist/patterns/job-queue/index.js +3 -1
- package/dist/patterns/job-queue/index.js.map +1 -0
- package/dist/patterns/memory/index.cjs +21 -3
- package/dist/patterns/memory/index.cjs.map +1 -0
- package/dist/patterns/memory/index.d.cts +1 -8
- package/dist/patterns/memory/index.d.ts +1 -8
- package/dist/patterns/memory/index.js +3 -1
- package/dist/patterns/memory/index.js.map +1 -0
- package/dist/patterns/messaging/index.cjs +21 -3
- package/dist/patterns/messaging/index.cjs.map +1 -0
- package/dist/patterns/messaging/index.d.cts +1 -7
- package/dist/patterns/messaging/index.d.ts +1 -7
- package/dist/patterns/messaging/index.js +3 -1
- package/dist/patterns/messaging/index.js.map +1 -0
- package/dist/patterns/orchestration/index.cjs +21 -3
- package/dist/patterns/orchestration/index.cjs.map +1 -0
- package/dist/patterns/orchestration/index.d.cts +1 -8
- package/dist/patterns/orchestration/index.d.ts +1 -8
- package/dist/patterns/orchestration/index.js +3 -1
- package/dist/patterns/orchestration/index.js.map +1 -0
- package/dist/patterns/process/index.cjs +21 -3
- package/dist/patterns/process/index.cjs.map +1 -0
- package/dist/patterns/process/index.d.cts +1 -10
- package/dist/patterns/process/index.d.ts +1 -10
- package/dist/patterns/process/index.js +3 -1
- package/dist/patterns/process/index.js.map +1 -0
- package/dist/patterns/reactive-layout/index.cjs +21 -4
- package/dist/patterns/reactive-layout/index.cjs.map +1 -0
- package/dist/patterns/reactive-layout/index.d.cts +1 -7
- package/dist/patterns/reactive-layout/index.d.ts +1 -7
- package/dist/patterns/reactive-layout/index.js +3 -1
- package/dist/patterns/reactive-layout/index.js.map +1 -0
- package/dist/patterns/reduction/index.cjs +21 -3
- package/dist/patterns/reduction/index.cjs.map +1 -0
- package/dist/patterns/reduction/index.d.cts +1 -6
- package/dist/patterns/reduction/index.d.ts +1 -6
- package/dist/patterns/reduction/index.js +3 -1
- package/dist/patterns/reduction/index.js.map +1 -0
- package/dist/patterns/surface/index.cjs +21 -13
- package/dist/patterns/surface/index.cjs.map +1 -0
- package/dist/patterns/surface/index.d.cts +1 -9
- package/dist/patterns/surface/index.d.ts +1 -9
- package/dist/patterns/surface/index.js +3 -1
- package/dist/patterns/surface/index.js.map +1 -0
- package/dist/patterns/topology-view/index.cjs +21 -0
- package/dist/patterns/topology-view/index.cjs.map +1 -0
- package/dist/patterns/topology-view/index.d.cts +1 -0
- package/dist/patterns/topology-view/index.d.ts +1 -0
- package/dist/patterns/topology-view/index.js +3 -0
- package/dist/patterns/topology-view/index.js.map +1 -0
- package/dist/testing/index.cjs +21 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +1 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/package.json +608 -584
- package/dist/backoff-HPZMEZNF.js +0 -1
- package/dist/cascading-BglDkMdX.d.cts +0 -199
- package/dist/cascading-MFgxu7Yo.d.ts +0 -199
- 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/decay-BvOWTZ00.d.ts +0 -112
- package/dist/decay-CFlLvXUT.d.cts +0 -112
- package/dist/fallback-74oxi34l.d.cts +0 -250
- package/dist/fallback-DUyyBTBK.d.ts +0 -250
- 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-B-_tFaqV.d.cts +0 -468
- package/dist/index-B17QddL1.d.cts +0 -374
- package/dist/index-B1F8Enjf.d.ts +0 -704
- package/dist/index-B5S8ULbU.d.ts +0 -515
- package/dist/index-B8YnZpIR.d.ts +0 -102
- package/dist/index-BHskSB8v.d.ts +0 -3413
- package/dist/index-BIYAkbAi.d.cts +0 -26
- package/dist/index-BQSKmbuG.d.cts +0 -127
- package/dist/index-BaQaY_IQ.d.cts +0 -231
- package/dist/index-BmZXHqkE.d.ts +0 -36
- package/dist/index-BoJ5JHxI.d.ts +0 -557
- package/dist/index-BocU7pqs.d.ts +0 -779
- package/dist/index-BrPrLl4e.d.cts +0 -86
- package/dist/index-BxNs2HB9.d.cts +0 -1858
- package/dist/index-Byu-OpX_.d.ts +0 -113
- package/dist/index-C1T3d7V-.d.cts +0 -704
- package/dist/index-C5ri2Axc.d.cts +0 -301
- package/dist/index-C5stwKcw.d.cts +0 -44
- package/dist/index-C9l6OEBL.d.ts +0 -26
- package/dist/index-CBBLl_rc.d.ts +0 -127
- package/dist/index-CBGUK09R.d.ts +0 -754
- package/dist/index-CC-AvFTy.d.cts +0 -557
- package/dist/index-CJF1URuX.d.ts +0 -121
- package/dist/index-CK29LV56.d.cts +0 -34
- package/dist/index-CMh5Rz1y.d.ts +0 -385
- package/dist/index-CPQlGA29.d.ts +0 -34
- package/dist/index-CR8QpwX8.d.ts +0 -2680
- package/dist/index-CS0LTlB8.d.cts +0 -385
- package/dist/index-CSOmP7xT.d.cts +0 -291
- package/dist/index-CYq8vAyV.d.ts +0 -291
- package/dist/index-CZ3r5Rxp.d.ts +0 -374
- package/dist/index-CasX6Pfq.d.cts +0 -358
- package/dist/index-CdAlHFEt.d.ts +0 -44
- package/dist/index-CdTelp1M.d.ts +0 -202
- package/dist/index-CeFiHtAg.d.ts +0 -468
- package/dist/index-Cj3WohTd.d.cts +0 -202
- package/dist/index-Climxqsu.d.cts +0 -754
- package/dist/index-Co7uli2l.d.cts +0 -3413
- package/dist/index-CviRnE4K.d.ts +0 -45
- package/dist/index-Cwv0KWcU.d.cts +0 -102
- package/dist/index-CzLVrjxn.d.ts +0 -231
- package/dist/index-D0aciIex.d.cts +0 -209
- package/dist/index-DHen9Klo.d.ts +0 -1858
- package/dist/index-DV_1YuVk.d.cts +0 -221
- package/dist/index-Dc4AYqrJ.d.cts +0 -515
- package/dist/index-Dgl1HpPn.d.ts +0 -86
- package/dist/index-DisjX8a-.d.ts +0 -221
- package/dist/index-UPSiS-X7.d.cts +0 -2680
- package/dist/index-Yq60JP3s.d.ts +0 -209
- package/dist/index-ZVQhLa2i.d.cts +0 -37
- package/dist/index-_6ODbuOu.d.cts +0 -45
- package/dist/index-hcDJ8PSI.d.cts +0 -36
- package/dist/index-nozs3fFC.d.ts +0 -301
- package/dist/index-p09KSrTN.d.ts +0 -358
- package/dist/index-sqkqlb1p.d.ts +0 -37
- package/dist/index-tRCxuAXF.d.cts +0 -113
- package/dist/node-kK3CvTrR.d.cts +0 -1347
- package/dist/node-kK3CvTrR.d.ts +0 -1347
- package/dist/observable-DWjNfLvC.d.ts +0 -36
- package/dist/observable-e3eiPPFy.d.cts +0 -36
- package/dist/pipeline-graph-CIKhynsF.d.cts +0 -142
- package/dist/pipeline-graph-Sgj0gCwn.d.ts +0 -142
- package/dist/reactive-layout-DOTs9P3X.d.ts +0 -183
- package/dist/reactive-layout-DgctbqZo.d.cts +0 -183
- 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
- package/dist/types-C0_yquda.d.cts +0 -442
- package/dist/types-CWFysE9E.d.ts +0 -442
package/dist/index-BHskSB8v.d.ts
DELETED
|
@@ -1,3413 +0,0 @@
|
|
|
1
|
-
import { a as NodeOptions, N as Node, r as Message, M as Messages } from './node-kK3CvTrR.js';
|
|
2
|
-
import { i as GraphCheckpointRecord, a as GraphOptions, G as Graph, D as DescribeChangeset, d as DescribeEvent, M as Meta, Q as topologyDiff } from './graph-D9LFnda9.js';
|
|
3
|
-
import { a as BackoffStrategy, B as BackoffPreset, t as retry, j as WithStatusBundle, C as CircuitBreaker, b as CircuitBreakerOptions, c as CircuitOpenError, d as CircuitState, E as ExponentialBackoffOptions, F as FallbackInput, J as JitterMode, N as NS_PER_MS, e as NS_PER_SEC, R as RateLimiterOptions, f as RateLimiterOverflowError, g as RateLimiterOverflowPolicy, h as RetryOptions, S as StatusValue, T as TimeoutError, i as TokenBucket, W as WithBreakerBundle, k as circuitBreaker, l as constant, m as decorrelatedJitter, n as exponential, o as fallback, p as fibonacci, q as linear, r as rateLimiter, s as resolveBackoffPreset, u as timeout, v as tokenBucket, w as withBreaker, x as withMaxAttempts, y as withStatus } from './index-B1F8Enjf.js';
|
|
4
|
-
import { AsyncSourceOpts, NodeInput, EventTargetLike, FromCronOptions, ReactiveCounterBundle, awaitSettled, cached, defer, empty, escapeRegexChar, firstValueFrom, firstWhere, forEach, fromAny, fromAsyncIter, fromCron, fromEvent, fromIter, fromPromise, fromRaf, fromTimer, globToRegExp, keepalive, matchesAnyPattern, never, nodeSignal, of, reactiveCounter, replay, share, shareReplay, throwError, toArray } from './extra/sources.js';
|
|
5
|
-
import { SnapshotStorageTier, KvStorageTier, AppendCursor, AppendLoadResult, AppendLogStorageOptions, AppendLogStorageTier, BaseStorageTier, Codec, KvStorageOptions, SnapshotStorageOptions, StorageBackend, appendLogStorage, dictKv, dictSnapshot, jsonCodec, jsonCodecFor, kvStorage, memoryAppendLog, memoryBackend, memoryKv, memorySnapshot, snapshotStorage } from './extra/storage-tiers.js';
|
|
6
|
-
import { D as DistillBundle, a as DistillOptions, E as Extraction, V as VerifiableBundle, b as VerifiableOptions, c as VerifyValue, d as decay, e as distill, v as verifiable } from './decay-BvOWTZ00.js';
|
|
7
|
-
import { C as ContentAddressedMissError, a as ContentAddressedMode, b as ContentAddressedStorage, c as ContentAddressedStorageOptions, d as canonicalJson, e as contentAddressedStorage } from './content-addressed-storage-DuYMjV7o.js';
|
|
8
|
-
import { A as AuditLogOpts, B as BaseAuditRecord, D as DEFAULT_AUDIT_GUARD, F as FailureMeta, L as LightMutationOpts, M as MutationOpts, S as SuccessMeta, W as WrapMutationOpts, a as appendAudit, b as bumpCursor, c as createAuditLog, l as lightMutation, r as registerCursor, d as registerCursorMap, t as tryIncrementBounded, w as wrapMutation } from './index-Yq60JP3s.js';
|
|
9
|
-
import { T as ToObservableOptions, t as toObservable } from './observable-DWjNfLvC.js';
|
|
10
|
-
import { MergeMapOptions, TapObserver, ThrottleOptions, audit, buffer, bufferCount, bufferTime, catchError, combine, combineLatest, concat, concatMap, debounce, debounceTime, delay, distinctUntilChanged, elementAt, exhaustMap, filter, find, first, flatMap, interval, last, map, merge, mergeMap, onFirstData, pairwise, pausable, race, reduce, repeat, rescue, sample, scan, skip, switchMap, take, takeUntil, takeWhile, tap, tapFirst, throttle, throttleTime, valve, window, windowCount, windowTime, withLatestFrom, zip } from './extra/operators.js';
|
|
11
|
-
import { IndexBackend, IndexRow, ListBackend, NativeIndexBackend, NativeListBackend, ReactiveIndexBundle, ReactiveIndexOptions, ReactiveListBundle, ReactiveListOptions, UpsertOptions, reactiveIndex, reactiveList } from './extra/reactive.js';
|
|
12
|
-
import { L as LogBackend, M as MergedReactiveLog, N as NativeLogBackend, a as ReactiveLogBundle, R as ReactiveLogOptions, V as ViewSpec, m as mergeReactiveLogs, r as reactiveLog } from './reactive-log-BKALbfal.js';
|
|
13
|
-
import { M as MapBackend, N as NativeMapBackend, a as NativeMapBackendOptions, R as ReactiveMapBundle, b as ReactiveMapOptions, c as ReactiveMapRetention, r as reactiveMap } from './reactive-map-DS_SIAxv.js';
|
|
14
|
-
import { StorageHandle, sortJsonValue, stableJsonString } from './extra/storage-core.js';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* External-register helpers — the common `register({emit, error, complete})`
|
|
18
|
-
* contract shared by webhook, MCP, syslog, StatsD, OTel and other callback-
|
|
19
|
-
* based integrations. Absorbs the `active` flag that every such adapter needs
|
|
20
|
-
* to guard against emits after teardown (§5.10 boundary pattern).
|
|
21
|
-
*
|
|
22
|
-
* Two shapes:
|
|
23
|
-
*
|
|
24
|
-
* - {@link externalProducer} — single channel. Lazy activation: the register
|
|
25
|
-
* fn runs when the node gains its first subscriber; its returned cleanup
|
|
26
|
-
* runs on deactivation.
|
|
27
|
-
*
|
|
28
|
-
* - {@link externalBundle} — multiple named channels. Eager activation: the
|
|
29
|
-
* register fn runs at bundle construction time so externally-owned servers
|
|
30
|
-
* (HTTP endpoints, UDP sockets) start accepting traffic immediately. A
|
|
31
|
-
* shared refcount fires the returned cleanup once every channel has fully
|
|
32
|
-
* torn down.
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
type ExtraOpts$1 = Omit<NodeOptions<unknown>, "describeKind">;
|
|
36
|
-
/**
|
|
37
|
-
* Standard emit-triad passed to a single-channel external registrar.
|
|
38
|
-
*
|
|
39
|
-
* Post-teardown calls on any of these are automatically no-ops — the
|
|
40
|
-
* registrar does not need its own guard flag.
|
|
41
|
-
*
|
|
42
|
-
* @category extra
|
|
43
|
-
*/
|
|
44
|
-
type EmitTriad<T> = {
|
|
45
|
-
/** Emit a value as `DATA`. */
|
|
46
|
-
emit: (value: T) => void;
|
|
47
|
-
/** Terminate with `ERROR`. Subsequent `emit` / `error` / `complete` are ignored. */
|
|
48
|
-
error: (err: unknown) => void;
|
|
49
|
-
/** Terminate with `COMPLETE`. Subsequent `emit` / `error` / `complete` are ignored. */
|
|
50
|
-
complete: () => void;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Multi-channel emit bundle. Each declared channel name maps to an emit fn;
|
|
54
|
-
* `error` and `complete` terminate every channel atomically.
|
|
55
|
-
*
|
|
56
|
-
* @category extra
|
|
57
|
-
*/
|
|
58
|
-
type BundleTriad<TChannels extends Record<string, unknown>> = {
|
|
59
|
-
[K in keyof TChannels]: (value: TChannels[K]) => void;
|
|
60
|
-
} & {
|
|
61
|
-
/** Terminate every channel with `ERROR`. */
|
|
62
|
-
error: (err: unknown) => void;
|
|
63
|
-
/** Terminate every channel with `COMPLETE`. */
|
|
64
|
-
complete: () => void;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Generic external registrator contract. The caller installs handlers into a
|
|
68
|
-
* third-party library / framework / server and optionally returns a cleanup
|
|
69
|
-
* callback. Returning `undefined` / `void` is equivalent to a no-op cleanup.
|
|
70
|
-
*
|
|
71
|
-
* @category extra
|
|
72
|
-
*/
|
|
73
|
-
type ExternalRegister<H> = (handlers: H) => (() => void) | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* Wraps a callback-style external integration as a reactive source.
|
|
76
|
-
*
|
|
77
|
-
* The registrar installs the supplied `emit` / `error` / `complete` handlers
|
|
78
|
-
* into the external SDK; post-teardown calls are silently dropped. Synchronous
|
|
79
|
-
* exceptions thrown by the registrar surface as terminal `ERROR`.
|
|
80
|
-
*
|
|
81
|
-
* @param register - Installs handlers. Optionally returns a cleanup fn.
|
|
82
|
-
* @param opts - Node options (name, equals, resubscribable, ...).
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* ```ts
|
|
86
|
-
* import { externalProducer } from "@graphrefly/graphrefly-ts";
|
|
87
|
-
*
|
|
88
|
-
* const hook$ = externalProducer<Payload>(({ emit, error }) => {
|
|
89
|
-
* const id = transport.onMessage((raw) => {
|
|
90
|
-
* try { emit(parse(raw)); } catch (e) { error(e); }
|
|
91
|
-
* });
|
|
92
|
-
* return () => transport.off(id);
|
|
93
|
-
* });
|
|
94
|
-
* ```
|
|
95
|
-
*
|
|
96
|
-
* @category extra
|
|
97
|
-
*/
|
|
98
|
-
declare function externalProducer<T = unknown>(register: ExternalRegister<EmitTriad<T>>, opts?: ExtraOpts$1): Node<T>;
|
|
99
|
-
/**
|
|
100
|
-
* Options for {@link externalBundle}.
|
|
101
|
-
*
|
|
102
|
-
* @category extra
|
|
103
|
-
*/
|
|
104
|
-
type ExternalBundleOptions<TChannels extends Record<string, unknown>> = {
|
|
105
|
-
/** Base name prefix for channel nodes; each node is named `${name}::${channel}`. */
|
|
106
|
-
name?: string;
|
|
107
|
-
/** Per-channel node options (equals, resubscribable, ...). */
|
|
108
|
-
channelOpts?: {
|
|
109
|
-
[K in keyof TChannels]?: ExtraOpts$1;
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
|
-
* Multi-channel variant — one `Node<T>` per named channel, sharing a single
|
|
114
|
-
* registrar. Activation is eager: the registrar runs at construction time so
|
|
115
|
-
* externally-owned servers (HTTP, UDP, queue consumers) can start accepting
|
|
116
|
-
* traffic immediately. The returned cleanup fires once every channel has been
|
|
117
|
-
* subscribed and then fully deactivated (refcount-on-teardown).
|
|
118
|
-
*
|
|
119
|
-
* Any call to `error` or `complete` propagates to every channel atomically.
|
|
120
|
-
*
|
|
121
|
-
* @param register - Installs handlers for each channel plus shared error/complete.
|
|
122
|
-
* @param channels - Ordered channel names; determines the returned object shape.
|
|
123
|
-
* @param opts - Optional name prefix and per-channel node options.
|
|
124
|
-
*
|
|
125
|
-
* @example
|
|
126
|
-
* ```ts
|
|
127
|
-
* import { externalBundle } from "@graphrefly/graphrefly-ts";
|
|
128
|
-
*
|
|
129
|
-
* type OTelChannels = { traces: Span; metrics: Metric; logs: LogRec };
|
|
130
|
-
* const otel = externalBundle<OTelChannels>(
|
|
131
|
-
* ({ traces, metrics, logs, error }) => {
|
|
132
|
-
* app.post("/v1/traces", (req, res) => { traces(req.body); res.sendStatus(200); });
|
|
133
|
-
* app.post("/v1/metrics", (req, res) => { metrics(req.body); res.sendStatus(200); });
|
|
134
|
-
* app.post("/v1/logs", (req, res) => { logs(req.body); res.sendStatus(200); });
|
|
135
|
-
* server.on("error", error);
|
|
136
|
-
* return () => server.close();
|
|
137
|
-
* },
|
|
138
|
-
* ["traces", "metrics", "logs"],
|
|
139
|
-
* );
|
|
140
|
-
* otel.traces.subscribe(...);
|
|
141
|
-
* ```
|
|
142
|
-
*
|
|
143
|
-
* @category extra
|
|
144
|
-
*/
|
|
145
|
-
declare function externalBundle<TChannels extends Record<string, unknown>>(register: ExternalRegister<BundleTriad<TChannels>>, channels: readonly (keyof TChannels & string)[], opts?: ExternalBundleOptions<TChannels>): {
|
|
146
|
-
[K in keyof TChannels]: Node<TChannels[K]>;
|
|
147
|
-
} & {
|
|
148
|
-
dispose(): void;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* {@link reactiveSink} — canonical sink factory for Wave 5 adapters.
|
|
153
|
-
*
|
|
154
|
-
* Every `to*` adapter in {@link ./adapters.ts} can be expressed as a thin
|
|
155
|
-
* config wrapper around this one factory. It centralizes:
|
|
156
|
-
*
|
|
157
|
-
* - **Transport boundary** — the sole place in the sink layer where a raw
|
|
158
|
-
* Promise / `.then` / `.catch` sits (§5.10 boundary documented here).
|
|
159
|
-
* - **Retry** — delegates to {@link BackoffStrategy} from `backoff.ts`.
|
|
160
|
-
* - **Buffering** — `batchSize` / `flushIntervalMs` with tier-3 flush-on-
|
|
161
|
-
* terminal per spec §5.11. Buffered mode activates when `sendBatch` is
|
|
162
|
-
* supplied or a batching knob is set.
|
|
163
|
-
* - **Backpressure** — bounded internal queue with `drop-oldest` /
|
|
164
|
-
* `drop-newest` / `error` strategies. The `"wait"` strategy is deferred
|
|
165
|
-
* to external composition (`source | valve(...) | reactiveSink(...)`).
|
|
166
|
-
* - **Companions** — `sent` / `failed` / `inFlight` / `errors` (+ `buffered`
|
|
167
|
-
* / `paused` when buffering or backpressure is active). These surface
|
|
168
|
-
* every transport outcome as reactive nodes so downstream operators can
|
|
169
|
-
* build retry fallbacks, dead-letter queues, or SLO gauges without
|
|
170
|
-
* touching callback soup.
|
|
171
|
-
*/
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Structured transport-failure record. Every sink routes both recoverable
|
|
175
|
-
* (pre-retry) and terminal (post-exhaustion) failures through this shape.
|
|
176
|
-
*
|
|
177
|
-
* @category extra
|
|
178
|
-
*/
|
|
179
|
-
type SinkTransportError = {
|
|
180
|
-
/**
|
|
181
|
-
* Failure stage. Known values: `"serialize"`, `"send"`, `"close"`,
|
|
182
|
-
* `"routing_key"`, `"ack"`, `"retry_exhausted"`. Open to extension for
|
|
183
|
-
* protocol-specific stages.
|
|
184
|
-
*/
|
|
185
|
-
stage: string;
|
|
186
|
-
/** The error. */
|
|
187
|
-
error: Error;
|
|
188
|
-
/** Unwrapped DATA value (present for per-record failures). */
|
|
189
|
-
value: unknown;
|
|
190
|
-
/** Full message tuple (present for non-DATA stages like `"close"`). */
|
|
191
|
-
message?: Message;
|
|
192
|
-
/** Attempt number when `retry` is active — `1` = initial send. */
|
|
193
|
-
attempt?: number;
|
|
194
|
-
};
|
|
195
|
-
/**
|
|
196
|
-
* Terminal failure record delivered on the `failed` companion after retries
|
|
197
|
-
* are exhausted (or `shouldRetry` returned `false`).
|
|
198
|
-
*
|
|
199
|
-
* @category extra
|
|
200
|
-
*/
|
|
201
|
-
type SinkFailure<T> = {
|
|
202
|
-
value: T;
|
|
203
|
-
error: Error;
|
|
204
|
-
/** Total attempts made, including the initial send. */
|
|
205
|
-
attempts: number;
|
|
206
|
-
};
|
|
207
|
-
/**
|
|
208
|
-
* Handle returned by every Wave 5 sink.
|
|
209
|
-
*
|
|
210
|
-
* @category extra
|
|
211
|
-
*/
|
|
212
|
-
type ReactiveSinkHandle<T> = {
|
|
213
|
-
/** Unsubscribe from source, cancel timers, fire `TEARDOWN` on companions. */
|
|
214
|
-
dispose(): void;
|
|
215
|
-
/** Drain buffer + await in-flight sends (buffered mode only). */
|
|
216
|
-
flush?(): Promise<void>;
|
|
217
|
-
/** DATA values that successfully reached the transport. */
|
|
218
|
-
sent: Node<T>;
|
|
219
|
-
/** Values that permanently failed (after any retries). */
|
|
220
|
-
failed: Node<SinkFailure<T> | null>;
|
|
221
|
-
/** Number of pending transport operations. */
|
|
222
|
-
inFlight: Node<number>;
|
|
223
|
-
/** Every transient transport error (pre-retry). Latest-only. */
|
|
224
|
-
errors: Node<SinkTransportError | null>;
|
|
225
|
-
/** Items currently buffered (buffered mode / backpressure only). */
|
|
226
|
-
buffered?: Node<number>;
|
|
227
|
-
/** `true` when a backpressure strategy has dropped / rejected items. */
|
|
228
|
-
paused?: Node<boolean>;
|
|
229
|
-
};
|
|
230
|
-
/**
|
|
231
|
-
* Retry configuration for {@link reactiveSink}.
|
|
232
|
-
*
|
|
233
|
-
* @category extra
|
|
234
|
-
*/
|
|
235
|
-
type ReactiveSinkRetryOptions = {
|
|
236
|
-
/** Total attempts including the initial send. Default: `1` (no retry). */
|
|
237
|
-
maxAttempts?: number;
|
|
238
|
-
/** Backoff strategy (ns) or preset name. Default: `"exponential"` when `maxAttempts > 1`. */
|
|
239
|
-
backoff?: BackoffStrategy | BackoffPreset;
|
|
240
|
-
/** Predicate — return `false` to short-circuit retry for a given error. */
|
|
241
|
-
shouldRetry?: (err: Error, attempt: number) => boolean;
|
|
242
|
-
};
|
|
243
|
-
/**
|
|
244
|
-
* Backpressure configuration for {@link reactiveSink}. When omitted, the
|
|
245
|
-
* sink has no internal buffer cap beyond the natural `batchSize` /
|
|
246
|
-
* `flushIntervalMs` limits.
|
|
247
|
-
*
|
|
248
|
-
* @category extra
|
|
249
|
-
*/
|
|
250
|
-
type ReactiveSinkBackpressureOptions = {
|
|
251
|
-
/** Hard cap on buffered items; further items trigger `strategy`. Default: `Infinity`. */
|
|
252
|
-
maxBuffer?: number;
|
|
253
|
-
/** Policy when the buffer is full. Default: `"drop-oldest"`. */
|
|
254
|
-
strategy?: "drop-oldest" | "drop-newest" | "error";
|
|
255
|
-
};
|
|
256
|
-
/**
|
|
257
|
-
* Base options shared by every sink built on {@link reactiveSink}.
|
|
258
|
-
*
|
|
259
|
-
* @category extra
|
|
260
|
-
*/
|
|
261
|
-
type ReactiveSinkOptions<T> = {
|
|
262
|
-
/** Optional name used for companion node naming. */
|
|
263
|
-
name?: string;
|
|
264
|
-
/** Invoked synchronously for every transient transport error. */
|
|
265
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
266
|
-
/** Retry configuration. */
|
|
267
|
-
retry?: ReactiveSinkRetryOptions;
|
|
268
|
-
/** Backpressure configuration. */
|
|
269
|
-
backpressure?: ReactiveSinkBackpressureOptions;
|
|
270
|
-
/** Batch size before auto-flush (buffered mode). */
|
|
271
|
-
batchSize?: number;
|
|
272
|
-
/** Flush interval in ms; `0` = write-through (buffered mode). */
|
|
273
|
-
flushIntervalMs?: number;
|
|
274
|
-
/** Optional transform applied before `send` / `sendBatch`. */
|
|
275
|
-
serialize?: (value: T) => unknown;
|
|
276
|
-
/**
|
|
277
|
-
* Reactive stop signal — when this node emits any DATA or terminal, the
|
|
278
|
-
* sink tears down. Gives callers a reactive alternative to the imperative
|
|
279
|
-
* `handle.dispose()` call so teardown can be wired through the graph.
|
|
280
|
-
*/
|
|
281
|
-
stopOn?: Node<unknown>;
|
|
282
|
-
/**
|
|
283
|
-
* Optional hook invoked for each upstream non-DATA message (COMPLETE /
|
|
284
|
-
* ERROR / etc.) observed by the sink. Used by adapters like
|
|
285
|
-
* {@link toWebSocket} to close the underlying resource when the source
|
|
286
|
-
* terminates, without the caller having to subscribe twice.
|
|
287
|
-
*/
|
|
288
|
-
onUpstreamMessage?: (msg: Message) => void;
|
|
289
|
-
/**
|
|
290
|
-
* Invoked once during `dispose()` after the sink's own cleanup (unsub,
|
|
291
|
-
* final drain, TEARDOWN on companions). Adapters wrap external resources
|
|
292
|
-
* (socket listeners, file handles) by passing their cleanup here —
|
|
293
|
-
* avoids hand-rolling a wrapper around `handle.dispose`.
|
|
294
|
-
*/
|
|
295
|
-
onDispose?: () => void;
|
|
296
|
-
/**
|
|
297
|
-
* Ignored — reserved for future parity with `source.pipe(...)` style.
|
|
298
|
-
*
|
|
299
|
-
* @internal
|
|
300
|
-
*/
|
|
301
|
-
_reserved?: never;
|
|
302
|
-
};
|
|
303
|
-
/**
|
|
304
|
-
* Full config accepted by {@link reactiveSink}. One of `send` / `sendBatch`
|
|
305
|
-
* is required.
|
|
306
|
-
*
|
|
307
|
-
* @category extra
|
|
308
|
-
*/
|
|
309
|
-
type ReactiveSinkConfig<T, Ctx = unknown> = ReactiveSinkOptions<T> & {
|
|
310
|
-
/** Per-record transport call. */
|
|
311
|
-
send?: (value: T, ctx: Ctx) => Promise<void> | void;
|
|
312
|
-
/** Batched transport call. When supplied, buffering activates automatically. */
|
|
313
|
-
sendBatch?: (batch: T[], ctx: Ctx) => Promise<void> | void;
|
|
314
|
-
/** Context object threaded into every `send` / `sendBatch` call. */
|
|
315
|
-
ctx?: Ctx;
|
|
316
|
-
};
|
|
317
|
-
/**
|
|
318
|
-
* Build a reactive sink with retry / buffering / backpressure / observability
|
|
319
|
-
* companions. Every Wave 5 `to*` adapter is a thin config wrapper around
|
|
320
|
-
* this factory.
|
|
321
|
-
*
|
|
322
|
-
* **Modes:**
|
|
323
|
-
* - `send` only, no batching knobs → **per-record write-through**
|
|
324
|
-
* - `send` + `batchSize` or `flushIntervalMs` → **per-record buffered**
|
|
325
|
-
* (buffer drains via repeated `send` calls — one-by-one in order)
|
|
326
|
-
* - `sendBatch` → **batched** (whole chunks handed to the transport)
|
|
327
|
-
*
|
|
328
|
-
* @category extra
|
|
329
|
-
*/
|
|
330
|
-
declare function reactiveSink<T, Ctx = unknown>(source: Node<T>, config: ReactiveSinkConfig<T, Ctx>): ReactiveSinkHandle<T>;
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* `budgetGate` — numeric-constraint flow gate (Tier 2.2 promotion from
|
|
334
|
-
* `patterns/reduction/`).
|
|
335
|
-
*
|
|
336
|
-
* Lives alongside the other `extra/resilience/` flow controls (`retry`,
|
|
337
|
-
* `circuitBreaker`, `rateLimiter`, `tokenBucket`, `fallback`, `withStatus`).
|
|
338
|
-
*
|
|
339
|
-
* @module
|
|
340
|
-
*/
|
|
341
|
-
|
|
342
|
-
/** A reactive constraint for {@link budgetGate}. */
|
|
343
|
-
type BudgetConstraint<T = unknown> = {
|
|
344
|
-
/** Constraint node whose value is checked. */
|
|
345
|
-
node: Node<T>;
|
|
346
|
-
/** Returns `true` when the constraint is satisfied (budget available). */
|
|
347
|
-
check: (value: T) => boolean;
|
|
348
|
-
};
|
|
349
|
-
/** Options for {@link budgetGate}. */
|
|
350
|
-
type BudgetGateOptions = Omit<NodeOptions<unknown>, "describeKind" | "name" | "meta"> & {
|
|
351
|
-
meta?: Record<string, unknown>;
|
|
352
|
-
};
|
|
353
|
-
/**
|
|
354
|
-
* Pass-through that respects reactive constraint nodes.
|
|
355
|
-
*
|
|
356
|
-
* DATA flows through when all constraints are satisfied. When any constraint
|
|
357
|
-
* is exceeded, `PAUSE` is sent upstream and DATA is buffered in a FIFO queue.
|
|
358
|
-
* When constraints relax, the queue drains in arrival order and `RESUME` is
|
|
359
|
-
* sent upstream.
|
|
360
|
-
*
|
|
361
|
-
* ## Invariants (do not refactor without preserving)
|
|
362
|
-
*
|
|
363
|
-
* 1. **Terminal force-flush.** On `COMPLETE` / `ERROR` arriving from `source`,
|
|
364
|
-
* every buffered item is emitted downstream BEFORE the terminal message is
|
|
365
|
-
* forwarded. The constraint is intentionally bypassed for the flush — once
|
|
366
|
-
* upstream is done, the caller must see the buffered work, not lose it.
|
|
367
|
-
* See COMPOSITION-GUIDE §19 (terminal-emission operators).
|
|
368
|
-
*
|
|
369
|
-
* 2. **PAUSE-release ordering.** When a constraint flips from saturated →
|
|
370
|
-
* released, the queue drains in FIFO order downstream BEFORE `RESUME` is
|
|
371
|
-
* sent upstream. Reversing the order (RESUME-then-drain) would let new
|
|
372
|
-
* upstream DATA interleave with the queue tail, breaking arrival-order
|
|
373
|
-
* delivery. See COMPOSITION-GUIDE §9, §9a (diamond + batch coalescing).
|
|
374
|
-
*
|
|
375
|
-
* 3. **Deferred RESOLVED.** A `RESOLVED` from `source` while the queue is
|
|
376
|
-
* non-empty is held until the queue drains, then forwarded — so downstream
|
|
377
|
-
* sees `[buffered DATA…, RESOLVED]` in causal order rather than
|
|
378
|
-
* `[RESOLVED, buffered DATA…]`.
|
|
379
|
-
*
|
|
380
|
-
* **Stall risk (qa D4):** if the constraint never relaxes AND no terminal
|
|
381
|
-
* arrives from `source`, the deferred RESOLVED is held forever. Downstream
|
|
382
|
-
* consumers that depend on `RESOLVED` for an `awaitSettled`-style
|
|
383
|
-
* coordination wait stall in this case. PAUSE is sent upstream so source
|
|
384
|
-
* backpressure stops further DATA, but the gate itself has no escape
|
|
385
|
-
* hatch — by design (the producer-pattern is fire-and-forget; recovery
|
|
386
|
-
* happens at the compositor level via timeout, retry, or cancellation).
|
|
387
|
-
*
|
|
388
|
-
* 4. **Constraint DIRTY suppression.** Constraint-node DIRTY does NOT
|
|
389
|
-
* propagate downstream — only `source`-DIRTY does. The gate's downstream
|
|
390
|
-
* semantics track `source`'s wave, not constraint waves.
|
|
391
|
-
*
|
|
392
|
-
* 5. **Lazy PAUSE (qa D3).** PAUSE is sent upstream ONLY when a `source` DATA
|
|
393
|
-
* arrives that fails the constraint check (the first blocked item). A
|
|
394
|
-
* constraint flipping closed BEFORE any source DATA arrives does NOT emit
|
|
395
|
-
* a preemptive PAUSE — upstream may push DATA freely until the first
|
|
396
|
-
* item is buffered. This matches the producer-pattern lazy-activation
|
|
397
|
-
* philosophy (don't impose backpressure for hypothetical future blocks).
|
|
398
|
-
* For eager-PAUSE semantics, wrap the gate in a compositor that watches
|
|
399
|
-
* constraints + source independently.
|
|
400
|
-
*
|
|
401
|
-
* ## Queue
|
|
402
|
-
*
|
|
403
|
-
* The internal buffer is an unbounded {@link HeadIndexQueue} (O(1) push,
|
|
404
|
-
* O(1) shift, opportunistic compaction). It does NOT use {@link RingBuffer}
|
|
405
|
-
* because RingBuffer's drop-oldest eviction would silently lose buffered
|
|
406
|
-
* items between PAUSE and RESUME. Backpressure (PAUSE) is the upstream
|
|
407
|
-
* contract for bounding the queue, not capacity-driven eviction here.
|
|
408
|
-
*
|
|
409
|
-
* ## Producer-pattern: source edge is invisible to `describe()`
|
|
410
|
-
*
|
|
411
|
-
* `budgetGate` is constructed via `node([], fn)` and subscribes to `source`
|
|
412
|
-
* and the constraint nodes manually inside its activation fn. Because no
|
|
413
|
-
* dep is declared at construction, **`describe()` shows no edge from
|
|
414
|
-
* `source` (or any constraint) into the returned node** — the gate looks
|
|
415
|
-
* like a standalone leaf source. This is intentional (see COMPOSITION-GUIDE
|
|
416
|
-
* §24 "Edges are derived, not declared"): if you want the constraint /
|
|
417
|
-
* source dependency to appear in describe output, surface it at the
|
|
418
|
-
* compositor level (e.g. annotate via `meta.ai.upstream`, or wrap the gate
|
|
419
|
-
* in a parent factory that exposes the deps as constructor args).
|
|
420
|
-
*
|
|
421
|
-
* ## Reference equality + Tier 6.5 3.2.5 locked semantics
|
|
422
|
-
*
|
|
423
|
-
* **Constraint VALUES are reactive.** Each `BudgetConstraint.node` is
|
|
424
|
-
* subscribed at activation; per-value changes flip the gate (re-evaluate
|
|
425
|
-
* in the same wave) and trigger PAUSE/RESUME upstream. Per the locked
|
|
426
|
-
* semantic rule for the reactive-options-widening batch (Tier 6.5 3.2.5,
|
|
427
|
-
* 2026-04-29): "constraints array re-evaluated immediately against
|
|
428
|
-
* current source; adding/removing constraints triggers gate
|
|
429
|
-
* re-evaluation in the same wave" — the per-value half is shipped via
|
|
430
|
-
* the existing constraint-Node subscription model.
|
|
431
|
-
*
|
|
432
|
-
* **The constraints ARRAY shape is static.** The factory captures the
|
|
433
|
-
* `constraints` array reference and each `check` function at
|
|
434
|
-
* construction; it does NOT diff subsequent arrays. To add or remove
|
|
435
|
-
* constraints reactively, build the swap at the compositor level (a
|
|
436
|
-
* `switchMap` rebuild over a constraint-shape Node), or construct a new
|
|
437
|
-
* gate. Dynamic constraint-array reactivity is intentionally deferred —
|
|
438
|
-
* the subscription churn (resub on every constraint add/remove) and
|
|
439
|
-
* `latestValues` shape mutation overshoot the budget-gate's
|
|
440
|
-
* fire-and-forget ergonomics.
|
|
441
|
-
*
|
|
442
|
-
* @param source - Input node.
|
|
443
|
-
* @param constraints - Reactive constraint checks. MUST be non-empty.
|
|
444
|
-
* @param opts - Optional node options.
|
|
445
|
-
* @returns Gated node.
|
|
446
|
-
*
|
|
447
|
-
* @throws {RangeError} when `constraints.length === 0`. The gate has no
|
|
448
|
-
* meaningful identity without at least one check — degenerate to plain
|
|
449
|
-
* pass-through (e.g. via `derived([source], ([v]) => v)`) instead.
|
|
450
|
-
*
|
|
451
|
-
* @category resilience
|
|
452
|
-
*/
|
|
453
|
-
declare function budgetGate<T>(source: Node<T>, constraints: ReadonlyArray<BudgetConstraint>, opts?: BudgetGateOptions): Node<T>;
|
|
454
|
-
|
|
455
|
-
/**
|
|
456
|
-
* Protocol, system, and ingest adapters (roadmap §5.2, §5.2c).
|
|
457
|
-
*
|
|
458
|
-
* Each adapter wraps an external protocol or system as a reactive {@link Node}
|
|
459
|
-
* built on {@link producer} / {@link node} — no second protocol.
|
|
460
|
-
*
|
|
461
|
-
* **Moved from sources.ts:** fromHTTP, fromWebSocket/toWebSocket, fromWebhook,
|
|
462
|
-
* toSSE, fromMCP, fromGitHook.
|
|
463
|
-
*
|
|
464
|
-
* **New (5.2c):** fromOTel, fromSyslog, fromStatsD, fromPrometheus,
|
|
465
|
-
* fromKafka/toKafka, fromRedisStream/toRedisStream, fromCSV, fromNDJSON,
|
|
466
|
-
* fromClickHouseWatch, fromPulsar/toPulsar, fromNATS/toNATS,
|
|
467
|
-
* fromRabbitMQ/toRabbitMQ.
|
|
468
|
-
*/
|
|
469
|
-
|
|
470
|
-
/** Handle returned by per-record and buffered sinks. */
|
|
471
|
-
type SinkHandle = {
|
|
472
|
-
/** Stop the sink (unsubscribe from source). */
|
|
473
|
-
dispose: () => void;
|
|
474
|
-
/** Reactive node that emits the latest transport error (or `null`). */
|
|
475
|
-
errors: Node<SinkTransportError | null>;
|
|
476
|
-
/** Manually drain the internal buffer (buffered sinks only). */
|
|
477
|
-
flush?: () => Promise<void>;
|
|
478
|
-
};
|
|
479
|
-
type ExtraOpts = Omit<NodeOptions, "describeKind">;
|
|
480
|
-
/** WebSocket-like transport accepted by {@link fromWebSocket} / {@link toWebSocket}. */
|
|
481
|
-
type WebSocketLike = {
|
|
482
|
-
send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
|
|
483
|
-
close(code?: number, reason?: string): void;
|
|
484
|
-
addEventListener(type: "message" | "error" | "close", listener: (ev: unknown) => void): void;
|
|
485
|
-
removeEventListener(type: "message" | "error" | "close", listener: (ev: unknown) => void): void;
|
|
486
|
-
};
|
|
487
|
-
type WebSocketMessageEventLike = {
|
|
488
|
-
data: unknown;
|
|
489
|
-
};
|
|
490
|
-
type WebSocketRegister<T> = (emit: (payload: T) => void, error: (err: unknown) => void, complete: () => void) => () => void;
|
|
491
|
-
/**
|
|
492
|
-
* Wraps a WebSocket as a GraphReFly producer source.
|
|
493
|
-
*
|
|
494
|
-
* Incoming socket messages are emitted as `DATA`; socket `error` emits `ERROR`; socket `close`
|
|
495
|
-
* emits `COMPLETE`. Teardown detaches listeners and optionally closes the socket.
|
|
496
|
-
*
|
|
497
|
-
* @category extra
|
|
498
|
-
*/
|
|
499
|
-
declare function fromWebSocket<T = unknown>(socket: WebSocketLike, opts?: ExtraOpts & {
|
|
500
|
-
parse?: (payload: unknown, event: unknown) => T;
|
|
501
|
-
closeOnTeardown?: boolean;
|
|
502
|
-
}): Node<T>;
|
|
503
|
-
declare function fromWebSocket<T = unknown>(register: WebSocketRegister<T>, opts?: ExtraOpts & {
|
|
504
|
-
parse?: (payload: unknown, event: unknown) => T;
|
|
505
|
-
closeOnTeardown?: boolean;
|
|
506
|
-
}): Node<T>;
|
|
507
|
-
/** Registration callback for {@link fromWebhook}. Alias of {@link ExternalRegister} over {@link EmitTriad}. */
|
|
508
|
-
type WebhookRegister<T> = ExternalRegister<EmitTriad<T>>;
|
|
509
|
-
/**
|
|
510
|
-
* Bridges HTTP webhook callbacks into a GraphReFly source.
|
|
511
|
-
*
|
|
512
|
-
* The `register` callback wires your runtime/framework callback to GraphReFly and may return a
|
|
513
|
-
* cleanup function. This keeps the adapter runtime-agnostic while following the same producer
|
|
514
|
-
* pattern as {@link fromEvent}.
|
|
515
|
-
*
|
|
516
|
-
* @param register - Registers webhook handlers (`emit`, `error`, `complete`) and optionally returns cleanup.
|
|
517
|
-
* @param opts - Optional producer options.
|
|
518
|
-
* @returns `Node<T>` — webhook payloads as `DATA`; teardown runs returned cleanup.
|
|
519
|
-
*
|
|
520
|
-
* @example
|
|
521
|
-
* ```ts
|
|
522
|
-
* import express from "express";
|
|
523
|
-
* import { fromWebhook } from "@graphrefly/graphrefly-ts";
|
|
524
|
-
*
|
|
525
|
-
* type HookPayload = { event: string; data: unknown };
|
|
526
|
-
* const app = express();
|
|
527
|
-
* app.use(express.json());
|
|
528
|
-
*
|
|
529
|
-
* const hook$ = fromWebhook<HookPayload>(({ emit, error }) => {
|
|
530
|
-
* const handler = (req: express.Request, res: express.Response) => {
|
|
531
|
-
* try {
|
|
532
|
-
* emit(req.body as HookPayload);
|
|
533
|
-
* res.status(200).send("ok");
|
|
534
|
-
* } catch (e) {
|
|
535
|
-
* error(e);
|
|
536
|
-
* res.status(500).send("error");
|
|
537
|
-
* }
|
|
538
|
-
* };
|
|
539
|
-
* app.post("/webhook", handler);
|
|
540
|
-
* return () => {
|
|
541
|
-
* // Express has no direct route-removal API in common use.
|
|
542
|
-
* };
|
|
543
|
-
* });
|
|
544
|
-
* ```
|
|
545
|
-
*
|
|
546
|
-
* @example Fastify
|
|
547
|
-
* ```ts
|
|
548
|
-
* import Fastify from "fastify";
|
|
549
|
-
* import { fromWebhook } from "@graphrefly/graphrefly-ts";
|
|
550
|
-
*
|
|
551
|
-
* const fastify = Fastify();
|
|
552
|
-
* const hook$ = fromWebhook<any>(({ emit, error }) => {
|
|
553
|
-
* const handler = async (req: any, reply: any) => {
|
|
554
|
-
* try {
|
|
555
|
-
* emit(req.body);
|
|
556
|
-
* reply.code(200).send({ ok: true });
|
|
557
|
-
* } catch (e) {
|
|
558
|
-
* error(e);
|
|
559
|
-
* reply.code(500).send({ ok: false });
|
|
560
|
-
* }
|
|
561
|
-
* };
|
|
562
|
-
* fastify.post("/webhook", handler);
|
|
563
|
-
* return () => {};
|
|
564
|
-
* });
|
|
565
|
-
* ```
|
|
566
|
-
*
|
|
567
|
-
* @category extra
|
|
568
|
-
*/
|
|
569
|
-
declare function fromWebhook<T = unknown>(register: WebhookRegister<T>, opts?: ExtraOpts): Node<T>;
|
|
570
|
-
/**
|
|
571
|
-
* Options for {@link fromHTTP}.
|
|
572
|
-
*
|
|
573
|
-
* @category extra
|
|
574
|
-
*/
|
|
575
|
-
interface FromHTTPOptions extends AsyncSourceOpts {
|
|
576
|
-
/** HTTP method. Default: `"GET"`. */
|
|
577
|
-
method?: string;
|
|
578
|
-
/** Request headers. */
|
|
579
|
-
headers?: Record<string, string>;
|
|
580
|
-
/** Request body (for POST/PUT/PATCH). */
|
|
581
|
-
body?: any;
|
|
582
|
-
/** Transform the Response before emitting. Default: `response.json()`. */
|
|
583
|
-
transform?: (response: Response) => any | Promise<any>;
|
|
584
|
-
/** Request timeout in **nanoseconds**. Default: `30s` (30 * NS_PER_SEC). */
|
|
585
|
-
timeoutNs?: number;
|
|
586
|
-
/**
|
|
587
|
-
* When `true`, emit `COMPLETE` after the first successful fetch. Useful for
|
|
588
|
-
* one-shot semantics where downstream wants to know "no more values ever."
|
|
589
|
-
* Default: `false` — the node stays live and replays cached DATA to late
|
|
590
|
-
* subscribers via push-on-subscribe (spec §2.2).
|
|
591
|
-
*/
|
|
592
|
-
completeAfterFetch?: boolean;
|
|
593
|
-
/**
|
|
594
|
-
* When `true`, trigger a fresh fetch on each new subscriber instead of
|
|
595
|
-
* sharing one cached result. Default: `false` — one shared fetch whose
|
|
596
|
-
* result is cached and replayed to every subscriber.
|
|
597
|
-
*/
|
|
598
|
-
refetchOnSubscribe?: boolean;
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* Result of {@link fromHTTP}: main source plus status, error, and fetch count companions.
|
|
602
|
-
*
|
|
603
|
-
* @category extra
|
|
604
|
-
*/
|
|
605
|
-
type HTTPBundle<T> = WithStatusBundle<T> & {
|
|
606
|
-
/** Number of successful fetches. */
|
|
607
|
-
fetchCount: Node<number>;
|
|
608
|
-
/** Nanosecond wall-clock timestamp of the last successful fetch. */
|
|
609
|
-
lastUpdated: Node<number>;
|
|
610
|
-
/**
|
|
611
|
-
* `true` after at least one successful fetch; stays `true` across
|
|
612
|
-
* resubscribes. Orthogonal to {@link withStatus}'s `active`/`completed`
|
|
613
|
-
* lifecycle — use this as the "fetch done" signal under the default
|
|
614
|
-
* (cached, stays-live) behavior where `withStatus` never transitions to
|
|
615
|
-
* `"completed"` unless `completeAfterFetch: true` is set.
|
|
616
|
-
*/
|
|
617
|
-
fetched: Node<boolean>;
|
|
618
|
-
};
|
|
619
|
-
/**
|
|
620
|
-
* Creates a one-shot fetch-based HTTP source with lifecycle tracking.
|
|
621
|
-
*
|
|
622
|
-
* @category extra
|
|
623
|
-
*/
|
|
624
|
-
declare function fromHTTP<T = any>(url: string, opts?: FromHTTPOptions): HTTPBundle<T>;
|
|
625
|
-
/** Options for {@link toHTTP}. */
|
|
626
|
-
type ToHTTPOptions<T> = ExtraOpts & {
|
|
627
|
-
/** HTTP method. Default: `"POST"`. */
|
|
628
|
-
method?: string;
|
|
629
|
-
/** Request headers applied to every call. Caller sets Content-Type. */
|
|
630
|
-
headers?: Record<string, string>;
|
|
631
|
-
/** Serialize a value to a request body. Default: `JSON.stringify`. */
|
|
632
|
-
serialize?: (value: T) => string | Uint8Array;
|
|
633
|
-
/** Optional request timeout in nanoseconds. */
|
|
634
|
-
timeoutNs?: number;
|
|
635
|
-
/**
|
|
636
|
-
* Format used when `batchSize` / `flushIntervalMs` is set:
|
|
637
|
-
* - `"json-array"` — body is `JSON.stringify(batch)`
|
|
638
|
-
* - `"ndjson"` — body is newline-delimited JSON.
|
|
639
|
-
* Default: `"json-array"`.
|
|
640
|
-
*/
|
|
641
|
-
batchFormat?: "json-array" | "ndjson";
|
|
642
|
-
/** Batch size before auto-flush (buffered mode). */
|
|
643
|
-
batchSize?: number;
|
|
644
|
-
/** Flush interval in ms (buffered mode). */
|
|
645
|
-
flushIntervalMs?: number;
|
|
646
|
-
/** Retry configuration — same shape as {@link ReactiveSinkRetryOptions}. */
|
|
647
|
-
retry?: Parameters<typeof reactiveSink<T>>[1]["retry"];
|
|
648
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
649
|
-
};
|
|
650
|
-
/**
|
|
651
|
-
* HTTP sink — forwards upstream `DATA` values as HTTP requests.
|
|
652
|
-
*
|
|
653
|
-
* Per-record mode (default, no batching knobs): one request per DATA.
|
|
654
|
-
* Buffered mode (`batchSize` / `flushIntervalMs`): one request per chunk,
|
|
655
|
-
* body is JSON-array or NDJSON depending on `batchFormat`.
|
|
656
|
-
*
|
|
657
|
-
* @param source - Upstream node.
|
|
658
|
-
* @param url - Request URL.
|
|
659
|
-
* @param opts - Serialization, batching, retry options.
|
|
660
|
-
* @returns {@link ReactiveSinkHandle}.
|
|
661
|
-
*
|
|
662
|
-
* @category extra
|
|
663
|
-
*/
|
|
664
|
-
declare function toHTTP<T>(source: Node<T>, url: string, opts?: ToHTTPOptions<T>): ReactiveSinkHandle<T>;
|
|
665
|
-
/** Options for {@link toSSE}. */
|
|
666
|
-
type ToSSEOptions = {
|
|
667
|
-
/** Custom payload serializer for non-string payloads. Default: `JSON.stringify` fallback to `String(value)`. */
|
|
668
|
-
serialize?: (value: unknown) => string;
|
|
669
|
-
/** Event name for DATA tuples. Default: `"data"`. */
|
|
670
|
-
dataEvent?: string;
|
|
671
|
-
/** Event name for ERROR tuples. Default: `"error"`. */
|
|
672
|
-
errorEvent?: string;
|
|
673
|
-
/** Event name for COMPLETE tuples. Default: `"complete"`. */
|
|
674
|
-
completeEvent?: string;
|
|
675
|
-
/** Emit `event: resolved` when RESOLVED arrives. Default: `false`. */
|
|
676
|
-
includeResolved?: boolean;
|
|
677
|
-
/** Emit `event: dirty` when DIRTY arrives. Default: `false`. */
|
|
678
|
-
includeDirty?: boolean;
|
|
679
|
-
/** Add SSE comment keepalive frames (`: keepalive`) on an interval. Disabled when unset. */
|
|
680
|
-
keepAliveMs?: number;
|
|
681
|
-
/** Optional abort signal to terminate the stream early. */
|
|
682
|
-
signal?: AbortSignal;
|
|
683
|
-
/** Maps custom message types to SSE event names. */
|
|
684
|
-
eventNameResolver?: (type: symbol) => string;
|
|
685
|
-
};
|
|
686
|
-
/**
|
|
687
|
-
* Creates a standard Server-Sent Events stream from node messages.
|
|
688
|
-
*
|
|
689
|
-
* @category extra
|
|
690
|
-
*/
|
|
691
|
-
declare function toSSE<T>(source: Node<T>, opts?: ToSSEOptions): ReadableStream<Uint8Array>;
|
|
692
|
-
/**
|
|
693
|
-
* Composable variant of {@link toSSE} — emits encoded SSE frames as
|
|
694
|
-
* `Uint8Array` through a reactive `Node`. Use this when you want to pipe SSE
|
|
695
|
-
* bytes through the reactive graph (persist to file, tee to multiple streams,
|
|
696
|
-
* etc.). Wrap with {@link toReadableStream} to expose a `ReadableStream` for
|
|
697
|
-
* `new Response(...)` use cases.
|
|
698
|
-
*
|
|
699
|
-
* @category extra
|
|
700
|
-
*/
|
|
701
|
-
declare function toSSEBytes<T>(source: Node<T>, opts?: ToSSEOptions): Node<Uint8Array>;
|
|
702
|
-
/**
|
|
703
|
-
* Converts a `Node<Uint8Array>` into a WHATWG `ReadableStream<Uint8Array>`.
|
|
704
|
-
* Useful for composing with `new Response(...)` / `fetch` bodies.
|
|
705
|
-
*
|
|
706
|
-
* @category extra
|
|
707
|
-
*/
|
|
708
|
-
declare function toReadableStream(bytes: Node<Uint8Array>): ReadableStream<Uint8Array>;
|
|
709
|
-
/** Parsed Server-Sent Event. */
|
|
710
|
-
type SSEEvent<T = string> = {
|
|
711
|
-
event: string;
|
|
712
|
-
data: T;
|
|
713
|
-
id?: string;
|
|
714
|
-
retry?: number;
|
|
715
|
-
};
|
|
716
|
-
/** Options for {@link fromSSE}. */
|
|
717
|
-
type FromSSEOptions<T = string> = ExtraOpts & {
|
|
718
|
-
/** Parse the raw `data:` payload. Default: identity (string). */
|
|
719
|
-
parse?: (raw: string) => T;
|
|
720
|
-
};
|
|
721
|
-
/** Options for {@link parseSSEStream}. */
|
|
722
|
-
type ParseSSEStreamOptions<T = string> = {
|
|
723
|
-
/** Parse the raw `data:` payload. Default: identity (string). */
|
|
724
|
-
parse?: (raw: string) => T;
|
|
725
|
-
/**
|
|
726
|
-
* External abort signal. If aborted, the generator returns early after
|
|
727
|
-
* cancelling the underlying reader / iterator. Does not emit an error —
|
|
728
|
-
* the generator simply ends.
|
|
729
|
-
*/
|
|
730
|
-
signal?: AbortSignal;
|
|
731
|
-
};
|
|
732
|
-
/**
|
|
733
|
-
* Parses a Server-Sent Events byte stream into an async-iterator of structured
|
|
734
|
-
* `{event, data, id, retry}` records. Pure async generator with no reactive
|
|
735
|
-
* dependency — safe to consume anywhere an `AsyncIterable<SSEEvent>` is
|
|
736
|
-
* expected (LLM provider adapters, tests, non-reactive transports).
|
|
737
|
-
*
|
|
738
|
-
* Handles:
|
|
739
|
-
* - Arbitrary chunk boundaries (internal text buffer + `TextDecoder` streaming).
|
|
740
|
-
* - `\n` and `\r\n` line endings.
|
|
741
|
-
* - `event:` / `data:` (multi-line via repeated fields) / `id:` / `retry:`.
|
|
742
|
-
* - Comments (`:` prefix).
|
|
743
|
-
* - Cancels the underlying reader / iterator on external abort or consumer
|
|
744
|
-
* break, so a quiet stream doesn't leak pending `read()` calls.
|
|
745
|
-
*
|
|
746
|
-
* Used internally by {@link fromSSE} (reactive `Node<SSEEvent>`) — exposed as a
|
|
747
|
-
* pure helper so LLM provider adapters (Anthropic, OpenAI, Google) can parse
|
|
748
|
-
* their SSE streams without building a reactive node per call.
|
|
749
|
-
*
|
|
750
|
-
* @param source - SSE byte source (`ReadableStream`, `Response`, or `AsyncIterable<Uint8Array>`).
|
|
751
|
-
* @param opts - `{ parse?, signal? }`.
|
|
752
|
-
* @returns `AsyncGenerator<SSEEvent<T>>` — yields one event per SSE block; returns on stream end / abort.
|
|
753
|
-
*
|
|
754
|
-
* @category extra
|
|
755
|
-
*/
|
|
756
|
-
declare function parseSSEStream<T = string>(source: ReadableStream<Uint8Array> | Response | AsyncIterable<Uint8Array>, opts?: ParseSSEStreamOptions<T>): AsyncGenerator<SSEEvent<T>, void, unknown>;
|
|
757
|
-
/**
|
|
758
|
-
* Parses a Server-Sent Events stream into structured `{event, data, id}` records.
|
|
759
|
-
*
|
|
760
|
-
* @param source - SSE byte source (`ReadableStream`, `Response`, or `AsyncIterable<Uint8Array>`).
|
|
761
|
-
* @param opts - Parse function and node options.
|
|
762
|
-
* @returns `Node<SSEEvent<T>>` — one `DATA` per SSE event; `COMPLETE` on stream end.
|
|
763
|
-
*
|
|
764
|
-
* @category extra
|
|
765
|
-
*/
|
|
766
|
-
declare function fromSSE<T = string>(source: ReadableStream<Uint8Array> | Response | AsyncIterable<Uint8Array>, opts?: FromSSEOptions<T>): Node<SSEEvent<T>>;
|
|
767
|
-
/** Options for {@link fromHTTPStream}. */
|
|
768
|
-
type FromHTTPStreamOptions = ExtraOpts & {
|
|
769
|
-
method?: string;
|
|
770
|
-
headers?: Record<string, string>;
|
|
771
|
-
body?: unknown;
|
|
772
|
-
signal?: AbortSignal;
|
|
773
|
-
};
|
|
774
|
-
/**
|
|
775
|
-
* Streaming HTTP source — emits each chunk from the response body as a
|
|
776
|
-
* `Uint8Array` `DATA`. `COMPLETE` when the stream ends; `ERROR` on non-ok
|
|
777
|
-
* response or fetch failure.
|
|
778
|
-
*
|
|
779
|
-
* Useful for ingesting server-push APIs (LLM streaming, SSE endpoints — pair
|
|
780
|
-
* with {@link fromSSE}, NDJSON endpoints — pair with {@link fromNDJSON}).
|
|
781
|
-
*
|
|
782
|
-
* @category extra
|
|
783
|
-
*/
|
|
784
|
-
declare function fromHTTPStream(url: string, opts?: FromHTTPStreamOptions): Node<Uint8Array>;
|
|
785
|
-
/** Options for {@link fromHTTPPoll}. */
|
|
786
|
-
type FromHTTPPollOptions = FromHTTPOptions & {
|
|
787
|
-
/** Poll interval in milliseconds. Default: `5000`. */
|
|
788
|
-
intervalMs?: number;
|
|
789
|
-
};
|
|
790
|
-
/**
|
|
791
|
-
* Repeatedly-fetching HTTP source — a reactive composition of
|
|
792
|
-
* {@link fromTimer} + {@link switchMap} + {@link fromHTTP} that fetches on an
|
|
793
|
-
* interval and emits the latest response. Previous in-flight fetches are
|
|
794
|
-
* cancelled when a new tick arrives (switch semantics).
|
|
795
|
-
*
|
|
796
|
-
* @example
|
|
797
|
-
* ```ts
|
|
798
|
-
* import { fromHTTPPoll } from "@graphrefly/graphrefly-ts";
|
|
799
|
-
* const health$ = fromHTTPPoll<{ ok: boolean }>("https://example.com/health", { intervalMs: 10_000 });
|
|
800
|
-
* ```
|
|
801
|
-
*
|
|
802
|
-
* @category extra
|
|
803
|
-
*/
|
|
804
|
-
declare function fromHTTPPoll<T = unknown>(url: string, opts?: FromHTTPPollOptions): Node<T>;
|
|
805
|
-
/** Options for {@link toWebSocket}. */
|
|
806
|
-
type ToWebSocketOptions<T> = {
|
|
807
|
-
/** Serialize DATA payloads before `socket.send(...)`. */
|
|
808
|
-
serialize?: (value: T) => string | ArrayBufferLike | Blob | ArrayBufferView;
|
|
809
|
-
/** Close socket when upstream emits COMPLETE. Default: `true`. */
|
|
810
|
-
closeOnComplete?: boolean;
|
|
811
|
-
/** Close socket when upstream emits ERROR. Default: `true`. */
|
|
812
|
-
closeOnError?: boolean;
|
|
813
|
-
/** Optional close code used when close is triggered by terminal tuples. */
|
|
814
|
-
closeCode?: number;
|
|
815
|
-
/** Optional close reason used when close is triggered by terminal tuples. */
|
|
816
|
-
closeReason?: string;
|
|
817
|
-
/** Structured callback — uses the unified {@link SinkTransportError} shape. */
|
|
818
|
-
onTransportError?: (event: SinkTransportError) => void;
|
|
819
|
-
/** Retry configuration — passed through to {@link reactiveSink}. */
|
|
820
|
-
retry?: ReactiveSinkHandle<T> extends infer _ ? Parameters<typeof reactiveSink<T>>[1]["retry"] : never;
|
|
821
|
-
/** Backpressure configuration — passed through to {@link reactiveSink}. */
|
|
822
|
-
backpressure?: Parameters<typeof reactiveSink<T>>[1]["backpressure"];
|
|
823
|
-
/** Reactive stop signal — when it emits any DATA / terminal, the sink tears down. */
|
|
824
|
-
stopOn?: Node<unknown>;
|
|
825
|
-
};
|
|
826
|
-
/**
|
|
827
|
-
* Forwards upstream `DATA` payloads to a WebSocket via `send`.
|
|
828
|
-
*
|
|
829
|
-
* Returns a {@link ReactiveSinkHandle} — every transport outcome (including
|
|
830
|
-
* socket `close` events) surfaces on the `errors` / `failed` / `sent` /
|
|
831
|
-
* `inFlight` companions.
|
|
832
|
-
*
|
|
833
|
-
* @category extra
|
|
834
|
-
*/
|
|
835
|
-
declare function toWebSocket<T>(source: Node<T>, socket: WebSocketLike, opts?: ToWebSocketOptions<T>): ReactiveSinkHandle<T>;
|
|
836
|
-
/** Options for {@link fromWebSocketReconnect}. */
|
|
837
|
-
type FromWebSocketReconnectOptions<T> = ExtraOpts & {
|
|
838
|
-
/** Optional parser applied to incoming messages. */
|
|
839
|
-
parse?: (payload: unknown, event: unknown) => T;
|
|
840
|
-
/** Max reconnect attempts. Default: `Infinity` (implied when `backoff` is set). */
|
|
841
|
-
maxRetries?: number;
|
|
842
|
-
/** Backoff strategy (ns) or preset name. Default: `"exponential"`. */
|
|
843
|
-
backoff?: Parameters<typeof retry>[1] extends infer O ? O extends {
|
|
844
|
-
backoff?: infer B;
|
|
845
|
-
} ? B : never : never;
|
|
846
|
-
/** Close the socket on teardown. Default: `true`. */
|
|
847
|
-
closeOnTeardown?: boolean;
|
|
848
|
-
};
|
|
849
|
-
/**
|
|
850
|
-
* Reconnecting WebSocket source — each connection attempt calls `factory` to
|
|
851
|
-
* obtain a fresh {@link WebSocketLike}; on `close` (treated as terminal
|
|
852
|
-
* `COMPLETE`), {@link retry} rebuilds the inner source and reconnects.
|
|
853
|
-
*
|
|
854
|
-
* For transient errors, {@link retry} retries with the configured
|
|
855
|
-
* backoff. On `maxRetries` exhaustion, terminal `ERROR` propagates.
|
|
856
|
-
*
|
|
857
|
-
* @param factory - Invoked per reconnect to create a fresh WebSocket.
|
|
858
|
-
* @param opts - Parse, retry, and close options.
|
|
859
|
-
*
|
|
860
|
-
* @example
|
|
861
|
-
* ```ts
|
|
862
|
-
* import { fromWebSocketReconnect } from "@graphrefly/graphrefly-ts";
|
|
863
|
-
* const ws$ = fromWebSocketReconnect(
|
|
864
|
-
* () => new WebSocket("wss://example/stream"),
|
|
865
|
-
* { backoff: "exponential", maxRetries: 10 },
|
|
866
|
-
* );
|
|
867
|
-
* ```
|
|
868
|
-
*
|
|
869
|
-
* @category extra
|
|
870
|
-
*/
|
|
871
|
-
declare function fromWebSocketReconnect<T = unknown>(factory: () => WebSocketLike, opts?: FromWebSocketReconnectOptions<T>): Node<T>;
|
|
872
|
-
/**
|
|
873
|
-
* Duck-typed MCP (Model Context Protocol) client — only the notification
|
|
874
|
-
* registration surface is required so callers are not coupled to a specific SDK.
|
|
875
|
-
*/
|
|
876
|
-
type MCPClientLike = {
|
|
877
|
-
setNotificationHandler(method: string, handler: (notification: unknown) => void): void;
|
|
878
|
-
};
|
|
879
|
-
/** Options for {@link fromMCP}. */
|
|
880
|
-
type FromMCPOptions = ExtraOpts & {
|
|
881
|
-
/** MCP notification method to subscribe to. Default `"notifications/message"`. */
|
|
882
|
-
method?: string;
|
|
883
|
-
onDisconnect?: (cb: (err?: unknown) => void) => void;
|
|
884
|
-
};
|
|
885
|
-
/**
|
|
886
|
-
* Wraps an MCP client's server-push notifications as a reactive source.
|
|
887
|
-
*
|
|
888
|
-
* @category extra
|
|
889
|
-
*/
|
|
890
|
-
declare function fromMCP<T = unknown>(client: MCPClientLike, opts?: FromMCPOptions): Node<T>;
|
|
891
|
-
/** Standard handler triple for adapters that accept injected registrations. Alias of {@link EmitTriad}. */
|
|
892
|
-
type AdapterHandlers<T> = EmitTriad<T>;
|
|
893
|
-
/**
|
|
894
|
-
* Message envelope emitted by queue consumers when `autoAck: false`. The
|
|
895
|
-
* caller is responsible for calling `ack()` after successful processing or
|
|
896
|
-
* `nack()` to re-queue / dead-letter. Pairs cleanly with reactive pipelines:
|
|
897
|
-
*
|
|
898
|
-
* ```ts
|
|
899
|
-
* const messages$ = fromPulsar(consumer, { autoAck: false });
|
|
900
|
-
* effect([messages$], ([m]) => {
|
|
901
|
-
* try {
|
|
902
|
-
* process(m.value);
|
|
903
|
-
* m.ack();
|
|
904
|
-
* } catch (err) {
|
|
905
|
-
* m.nack({ requeue: true });
|
|
906
|
-
* }
|
|
907
|
-
* });
|
|
908
|
-
* ```
|
|
909
|
-
*
|
|
910
|
-
* Ack/nack are imperative callbacks (§5.10 boundary) because the underlying
|
|
911
|
-
* SDKs expose them as such. Reactive-all-the-way ack flows can be built by
|
|
912
|
-
* piping `msg.ack` calls into a `reactiveSink` if desired.
|
|
913
|
-
*
|
|
914
|
-
* **Caller contract — must settle every emitted message.** The envelope holds
|
|
915
|
-
* a closure reference to the raw SDK message; unsettled envelopes keep the
|
|
916
|
-
* broker's in-flight window full and leak memory proportional to consumer
|
|
917
|
-
* throughput. Patterns that drop messages (filter, take-first, switchMap
|
|
918
|
-
* discard) must explicitly `nack({ requeue: true })` the discarded ones, or
|
|
919
|
-
* wrap the source to force-settle on teardown.
|
|
920
|
-
*
|
|
921
|
-
* **Ack/nack transport failures.** Both methods route exceptions through
|
|
922
|
-
* the source's `onAckError` option (when provided) — SDK rejections from
|
|
923
|
-
* `acknowledge()`/`negativeAcknowledge()` don't escape as unhandled
|
|
924
|
-
* rejections. Default (no `onAckError`): swallow. The broker handles
|
|
925
|
-
* redelivery on its own timeline.
|
|
926
|
-
*
|
|
927
|
-
* @category extra
|
|
928
|
-
*/
|
|
929
|
-
type AckableMessage<T> = {
|
|
930
|
-
/** The wrapped message body. */
|
|
931
|
-
value: T;
|
|
932
|
-
/** Acknowledge successful processing. Safe to call more than once — idempotent. */
|
|
933
|
-
ack(): void;
|
|
934
|
-
/**
|
|
935
|
-
* Negative-acknowledge — signals the broker the message was not processed
|
|
936
|
-
* successfully. `requeue: true` asks the broker to redeliver; `requeue: false`
|
|
937
|
-
* may route to a dead-letter queue (SDK-specific). Omit `requeue` to
|
|
938
|
-
* defer to the SDK's own default.
|
|
939
|
-
*/
|
|
940
|
-
nack(opts?: {
|
|
941
|
-
requeue?: boolean;
|
|
942
|
-
}): void;
|
|
943
|
-
};
|
|
944
|
-
/** Structured OTel span. */
|
|
945
|
-
type OTelSpan = {
|
|
946
|
-
traceId: string;
|
|
947
|
-
spanId: string;
|
|
948
|
-
operationName: string;
|
|
949
|
-
serviceName: string;
|
|
950
|
-
startTimeNs: number;
|
|
951
|
-
endTimeNs: number;
|
|
952
|
-
status: "OK" | "ERROR" | "UNSET";
|
|
953
|
-
attributes: Record<string, unknown>;
|
|
954
|
-
events: Array<{
|
|
955
|
-
name: string;
|
|
956
|
-
timestampNs: number;
|
|
957
|
-
attributes?: Record<string, unknown>;
|
|
958
|
-
}>;
|
|
959
|
-
};
|
|
960
|
-
/** Structured OTel metric data point. */
|
|
961
|
-
type OTelMetric = {
|
|
962
|
-
name: string;
|
|
963
|
-
description?: string;
|
|
964
|
-
unit?: string;
|
|
965
|
-
type: "gauge" | "sum" | "histogram" | "summary";
|
|
966
|
-
value: number;
|
|
967
|
-
attributes: Record<string, unknown>;
|
|
968
|
-
timestampNs: number;
|
|
969
|
-
};
|
|
970
|
-
/** Structured OTel log record. */
|
|
971
|
-
type OTelLog = {
|
|
972
|
-
timestampNs: number;
|
|
973
|
-
severityNumber?: number;
|
|
974
|
-
severityText?: string;
|
|
975
|
-
body: unknown;
|
|
976
|
-
attributes: Record<string, unknown>;
|
|
977
|
-
traceId?: string;
|
|
978
|
-
spanId?: string;
|
|
979
|
-
};
|
|
980
|
-
/** Registration callback for the OTLP/HTTP receiver. */
|
|
981
|
-
type OTelRegister = (handlers: {
|
|
982
|
-
onTraces: (spans: OTelSpan[]) => void;
|
|
983
|
-
onMetrics: (metrics: OTelMetric[]) => void;
|
|
984
|
-
onLogs: (logs: OTelLog[]) => void;
|
|
985
|
-
onError: (err: unknown) => void;
|
|
986
|
-
}) => (() => void) | undefined;
|
|
987
|
-
/** Options for {@link fromOTel}. */
|
|
988
|
-
type FromOTelOptions = ExtraOpts & {};
|
|
989
|
-
/** Bundle returned by {@link fromOTel}. */
|
|
990
|
-
type OTelBundle = {
|
|
991
|
-
traces: Node<OTelSpan>;
|
|
992
|
-
metrics: Node<OTelMetric>;
|
|
993
|
-
logs: Node<OTelLog>;
|
|
994
|
-
/** Unconditional teardown — calls the registrar's cleanup and fires COMPLETE on every channel. */
|
|
995
|
-
dispose(): void;
|
|
996
|
-
};
|
|
997
|
-
/**
|
|
998
|
-
* OTLP/HTTP receiver — accepts traces, metrics, and logs as separate reactive nodes.
|
|
999
|
-
*
|
|
1000
|
-
* The caller owns the HTTP server. `fromOTel` receives a `register` callback that
|
|
1001
|
-
* wires OTLP POST endpoints to the three signal handlers. Each signal type gets
|
|
1002
|
-
* its own `Node` so downstream can subscribe selectively.
|
|
1003
|
-
*
|
|
1004
|
-
* @param register - Wires OTLP HTTP routes to `onTraces`, `onMetrics`, `onLogs` handlers.
|
|
1005
|
-
* @param opts - Optional producer options.
|
|
1006
|
-
* @returns {@link OTelBundle} — `{ traces, metrics, logs }` nodes.
|
|
1007
|
-
*
|
|
1008
|
-
* @example
|
|
1009
|
-
* ```ts
|
|
1010
|
-
* import express from "express";
|
|
1011
|
-
* import { fromOTel } from "@graphrefly/graphrefly-ts";
|
|
1012
|
-
*
|
|
1013
|
-
* const app = express();
|
|
1014
|
-
* app.use(express.json());
|
|
1015
|
-
*
|
|
1016
|
-
* const otel = fromOTel(({ onTraces, onMetrics, onLogs }) => {
|
|
1017
|
-
* app.post("/v1/traces", (req, res) => { onTraces(req.body.resourceSpans ?? []); res.sendStatus(200); });
|
|
1018
|
-
* app.post("/v1/metrics", (req, res) => { onMetrics(req.body.resourceMetrics ?? []); res.sendStatus(200); });
|
|
1019
|
-
* app.post("/v1/logs", (req, res) => { onLogs(req.body.resourceLogs ?? []); res.sendStatus(200); });
|
|
1020
|
-
* return () => {};
|
|
1021
|
-
* });
|
|
1022
|
-
* ```
|
|
1023
|
-
*
|
|
1024
|
-
* @category extra
|
|
1025
|
-
*/
|
|
1026
|
-
declare function fromOTel(register: OTelRegister, opts?: FromOTelOptions): OTelBundle;
|
|
1027
|
-
/** Parsed syslog message (RFC 5424). */
|
|
1028
|
-
type SyslogMessage = {
|
|
1029
|
-
facility: number;
|
|
1030
|
-
severity: number;
|
|
1031
|
-
timestamp: string;
|
|
1032
|
-
hostname: string;
|
|
1033
|
-
appName: string;
|
|
1034
|
-
procId: string;
|
|
1035
|
-
msgId: string;
|
|
1036
|
-
message: string;
|
|
1037
|
-
timestampNs: number;
|
|
1038
|
-
};
|
|
1039
|
-
/** Registration callback for syslog receiver. Alias of {@link ExternalRegister} over {@link EmitTriad}. */
|
|
1040
|
-
type SyslogRegister = ExternalRegister<EmitTriad<SyslogMessage>>;
|
|
1041
|
-
/** Options for {@link fromSyslog}. */
|
|
1042
|
-
type FromSyslogOptions = ExtraOpts & {};
|
|
1043
|
-
/**
|
|
1044
|
-
* RFC 5424 syslog receiver as a reactive source.
|
|
1045
|
-
*
|
|
1046
|
-
* The caller owns the UDP/TCP socket. `fromSyslog` receives a `register` callback
|
|
1047
|
-
* that wires socket data events to the `emit` handler with parsed syslog messages.
|
|
1048
|
-
*
|
|
1049
|
-
* @param register - Wires socket to emit/error/complete handlers.
|
|
1050
|
-
* @param opts - Optional producer options.
|
|
1051
|
-
* @returns `Node<SyslogMessage>` — one `DATA` per syslog message.
|
|
1052
|
-
*
|
|
1053
|
-
* @example
|
|
1054
|
-
* ```ts
|
|
1055
|
-
* import dgram from "node:dgram";
|
|
1056
|
-
* import { fromSyslog, parseSyslog } from "@graphrefly/graphrefly-ts";
|
|
1057
|
-
*
|
|
1058
|
-
* const server = dgram.createSocket("udp4");
|
|
1059
|
-
* const syslog$ = fromSyslog(({ emit, error }) => {
|
|
1060
|
-
* server.on("message", (buf) => {
|
|
1061
|
-
* try { emit(parseSyslog(buf.toString())); }
|
|
1062
|
-
* catch (e) { error(e); }
|
|
1063
|
-
* });
|
|
1064
|
-
* server.bind(514);
|
|
1065
|
-
* return () => server.close();
|
|
1066
|
-
* });
|
|
1067
|
-
* ```
|
|
1068
|
-
*
|
|
1069
|
-
* @category extra
|
|
1070
|
-
*/
|
|
1071
|
-
declare function fromSyslog(register: SyslogRegister, opts?: FromSyslogOptions): Node<SyslogMessage>;
|
|
1072
|
-
/**
|
|
1073
|
-
* Parses a raw RFC 5424 syslog line into a structured {@link SyslogMessage}.
|
|
1074
|
-
*
|
|
1075
|
-
* Format: `<PRI>VERSION TIMESTAMP HOSTNAME APP-NAME PROCID MSGID MSG`
|
|
1076
|
-
*
|
|
1077
|
-
* @category extra
|
|
1078
|
-
*/
|
|
1079
|
-
declare function parseSyslog(raw: string): SyslogMessage;
|
|
1080
|
-
/** Parsed StatsD metric. */
|
|
1081
|
-
type StatsDMetric = {
|
|
1082
|
-
name: string;
|
|
1083
|
-
value: number;
|
|
1084
|
-
type: "counter" | "gauge" | "timer" | "histogram" | "set" | "distribution";
|
|
1085
|
-
sampleRate?: number;
|
|
1086
|
-
tags: Record<string, string>;
|
|
1087
|
-
timestampNs: number;
|
|
1088
|
-
};
|
|
1089
|
-
/** Registration callback for StatsD receiver. Alias of {@link ExternalRegister} over {@link EmitTriad}. */
|
|
1090
|
-
type StatsDRegister = ExternalRegister<EmitTriad<StatsDMetric>>;
|
|
1091
|
-
/** Options for {@link fromStatsD}. */
|
|
1092
|
-
type FromStatsDOptions = ExtraOpts & {};
|
|
1093
|
-
/**
|
|
1094
|
-
* StatsD/DogStatsD UDP receiver as a reactive source.
|
|
1095
|
-
*
|
|
1096
|
-
* The caller owns the UDP socket. `fromStatsD` receives a `register` callback
|
|
1097
|
-
* that wires datagrams to the `emit` handler with parsed metrics.
|
|
1098
|
-
*
|
|
1099
|
-
* @param register - Wires socket to emit/error/complete handlers.
|
|
1100
|
-
* @param opts - Optional producer options.
|
|
1101
|
-
* @returns `Node<StatsDMetric>` — one `DATA` per metric line.
|
|
1102
|
-
*
|
|
1103
|
-
* @example
|
|
1104
|
-
* ```ts
|
|
1105
|
-
* import dgram from "node:dgram";
|
|
1106
|
-
* import { fromStatsD, parseStatsD } from "@graphrefly/graphrefly-ts";
|
|
1107
|
-
*
|
|
1108
|
-
* const server = dgram.createSocket("udp4");
|
|
1109
|
-
* const stats$ = fromStatsD(({ emit, error }) => {
|
|
1110
|
-
* server.on("message", (buf) => {
|
|
1111
|
-
* for (const line of buf.toString().split("\\n")) {
|
|
1112
|
-
* if (line.trim()) {
|
|
1113
|
-
* try { emit(parseStatsD(line)); }
|
|
1114
|
-
* catch (e) { error(e); }
|
|
1115
|
-
* }
|
|
1116
|
-
* }
|
|
1117
|
-
* });
|
|
1118
|
-
* server.bind(8125);
|
|
1119
|
-
* return () => server.close();
|
|
1120
|
-
* });
|
|
1121
|
-
* ```
|
|
1122
|
-
*
|
|
1123
|
-
* @category extra
|
|
1124
|
-
*/
|
|
1125
|
-
declare function fromStatsD(register: StatsDRegister, opts?: FromStatsDOptions): Node<StatsDMetric>;
|
|
1126
|
-
/**
|
|
1127
|
-
* Parses a raw StatsD/DogStatsD line into a structured {@link StatsDMetric}.
|
|
1128
|
-
*
|
|
1129
|
-
* Format: `metric.name:value|type|@sampleRate|#tag1:val1,tag2:val2`
|
|
1130
|
-
*
|
|
1131
|
-
* @category extra
|
|
1132
|
-
*/
|
|
1133
|
-
declare function parseStatsD(line: string): StatsDMetric;
|
|
1134
|
-
/** Parsed Prometheus metric. */
|
|
1135
|
-
type PrometheusMetric = {
|
|
1136
|
-
name: string;
|
|
1137
|
-
labels: Record<string, string>;
|
|
1138
|
-
value: number;
|
|
1139
|
-
timestampMs?: number;
|
|
1140
|
-
type?: "counter" | "gauge" | "histogram" | "summary" | "untyped";
|
|
1141
|
-
help?: string;
|
|
1142
|
-
timestampNs: number;
|
|
1143
|
-
};
|
|
1144
|
-
/** Options for {@link fromPrometheus}. */
|
|
1145
|
-
type FromPrometheusOptions = AsyncSourceOpts & {
|
|
1146
|
-
/** Scrape interval in nanoseconds. Default `15 * NS_PER_SEC` (15s). */
|
|
1147
|
-
intervalNs?: number;
|
|
1148
|
-
/** Request headers for the scrape. */
|
|
1149
|
-
headers?: Record<string, string>;
|
|
1150
|
-
/** Request timeout in nanoseconds. Default `10 * NS_PER_SEC` (10s). */
|
|
1151
|
-
timeoutNs?: number;
|
|
1152
|
-
/**
|
|
1153
|
-
* Maximum consecutive scrape errors before terminating the source. Prevents
|
|
1154
|
-
* error storms when the endpoint is down. Default: `1` (terminate on first error — preserves pre-switchMap back-compat). Raise it (or set `Infinity`)
|
|
1155
|
-
* to keep retrying indefinitely.
|
|
1156
|
-
*/
|
|
1157
|
-
maxConsecutiveErrors?: number;
|
|
1158
|
-
};
|
|
1159
|
-
/**
|
|
1160
|
-
* Scrapes a Prometheus `/metrics` endpoint on a reactive timer interval.
|
|
1161
|
-
*
|
|
1162
|
-
* Each scrape parses the exposition format and emits one `DATA` per metric line.
|
|
1163
|
-
* Uses `fromTimer` semantics internally (reactive timer source, not polling).
|
|
1164
|
-
*
|
|
1165
|
-
* @param endpoint - URL of the Prometheus metrics endpoint.
|
|
1166
|
-
* @param opts - Scrape interval, headers, timeout.
|
|
1167
|
-
* @returns `Node<PrometheusMetric>` — one `DATA` per metric per scrape.
|
|
1168
|
-
*
|
|
1169
|
-
* @example
|
|
1170
|
-
* ```ts
|
|
1171
|
-
* import { fromPrometheus } from "@graphrefly/graphrefly-ts";
|
|
1172
|
-
*
|
|
1173
|
-
* const prom$ = fromPrometheus("http://localhost:9090/metrics", { intervalNs: 30 * NS_PER_SEC });
|
|
1174
|
-
* ```
|
|
1175
|
-
*
|
|
1176
|
-
* @category extra
|
|
1177
|
-
*/
|
|
1178
|
-
declare function fromPrometheus(endpoint: string, opts?: FromPrometheusOptions): Node<PrometheusMetric>;
|
|
1179
|
-
/**
|
|
1180
|
-
* Parses Prometheus exposition format text into structured metrics.
|
|
1181
|
-
*
|
|
1182
|
-
* @category extra
|
|
1183
|
-
*/
|
|
1184
|
-
declare function parsePrometheusText(text: string): PrometheusMetric[];
|
|
1185
|
-
/** Duck-typed Kafka consumer (compatible with kafkajs, confluent-kafka, Pulsar KoP). */
|
|
1186
|
-
type KafkaConsumerLike = {
|
|
1187
|
-
subscribe(opts: {
|
|
1188
|
-
topic: string;
|
|
1189
|
-
fromBeginning?: boolean;
|
|
1190
|
-
}): Promise<void>;
|
|
1191
|
-
run(opts: {
|
|
1192
|
-
eachMessage: (payload: {
|
|
1193
|
-
topic: string;
|
|
1194
|
-
partition: number;
|
|
1195
|
-
message: {
|
|
1196
|
-
key: Buffer | null;
|
|
1197
|
-
value: Buffer | null;
|
|
1198
|
-
headers?: Record<string, Buffer | string | undefined>;
|
|
1199
|
-
offset: string;
|
|
1200
|
-
timestamp: string;
|
|
1201
|
-
};
|
|
1202
|
-
}) => Promise<void>;
|
|
1203
|
-
}): Promise<void>;
|
|
1204
|
-
disconnect(): Promise<void>;
|
|
1205
|
-
};
|
|
1206
|
-
/** Duck-typed Kafka producer. */
|
|
1207
|
-
type KafkaProducerLike = {
|
|
1208
|
-
send(record: {
|
|
1209
|
-
topic: string;
|
|
1210
|
-
messages: Array<{
|
|
1211
|
-
key?: string | Buffer | null;
|
|
1212
|
-
value: string | Buffer | null;
|
|
1213
|
-
headers?: Record<string, string | Buffer>;
|
|
1214
|
-
}>;
|
|
1215
|
-
}): Promise<void>;
|
|
1216
|
-
disconnect(): Promise<void>;
|
|
1217
|
-
};
|
|
1218
|
-
/** Structured Kafka message. */
|
|
1219
|
-
type KafkaMessage<T = unknown> = {
|
|
1220
|
-
topic: string;
|
|
1221
|
-
partition: number;
|
|
1222
|
-
key: string | null;
|
|
1223
|
-
value: T;
|
|
1224
|
-
headers: Record<string, string>;
|
|
1225
|
-
offset: string;
|
|
1226
|
-
timestamp: string;
|
|
1227
|
-
timestampNs: number;
|
|
1228
|
-
};
|
|
1229
|
-
/** Options for {@link fromKafka}. */
|
|
1230
|
-
type FromKafkaOptions = ExtraOpts & {
|
|
1231
|
-
/** Start from beginning of topic. Default: `false`. */
|
|
1232
|
-
fromBeginning?: boolean;
|
|
1233
|
-
/** Deserialize message value. Default: `JSON.parse(buffer.toString())`. */
|
|
1234
|
-
deserialize?: (value: Buffer | null) => unknown;
|
|
1235
|
-
};
|
|
1236
|
-
/**
|
|
1237
|
-
* Kafka consumer as a reactive source.
|
|
1238
|
-
*
|
|
1239
|
-
* Wraps a KafkaJS-compatible consumer. Each message becomes a `DATA` emission.
|
|
1240
|
-
* Compatible with Pulsar via KoP (Kafka-on-Pulsar).
|
|
1241
|
-
*
|
|
1242
|
-
* @param consumer - KafkaJS-compatible consumer instance (caller owns connect/disconnect lifecycle).
|
|
1243
|
-
* @param topic - Topic to consume from.
|
|
1244
|
-
* @param opts - Deserialization and source options.
|
|
1245
|
-
* @returns `Node<KafkaMessage<T>>` — one `DATA` per Kafka message.
|
|
1246
|
-
*
|
|
1247
|
-
* @example
|
|
1248
|
-
* ```ts
|
|
1249
|
-
* import { Kafka } from "kafkajs";
|
|
1250
|
-
* import { fromKafka } from "@graphrefly/graphrefly-ts";
|
|
1251
|
-
*
|
|
1252
|
-
* const kafka = new Kafka({ brokers: ["localhost:9092"] });
|
|
1253
|
-
* const consumer = kafka.consumer({ groupId: "my-group" });
|
|
1254
|
-
* await consumer.connect();
|
|
1255
|
-
*
|
|
1256
|
-
* const events$ = fromKafka(consumer, "events", { deserialize: (buf) => JSON.parse(buf!.toString()) });
|
|
1257
|
-
* ```
|
|
1258
|
-
*
|
|
1259
|
-
* @category extra
|
|
1260
|
-
*/
|
|
1261
|
-
declare function fromKafka<T = unknown>(consumer: KafkaConsumerLike, topic: string, opts?: FromKafkaOptions): Node<KafkaMessage<T>>;
|
|
1262
|
-
/** Options for {@link toKafka}. */
|
|
1263
|
-
type ToKafkaOptions<T> = ExtraOpts & {
|
|
1264
|
-
/** Serialize value for Kafka. Default: `JSON.stringify`. */
|
|
1265
|
-
serialize?: (value: T) => string | Buffer;
|
|
1266
|
-
/** Extract message key from value. Default: `null` (no key). */
|
|
1267
|
-
keyExtractor?: (value: T) => string | null;
|
|
1268
|
-
/** Called on serialization or send failures. */
|
|
1269
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
1270
|
-
};
|
|
1271
|
-
/**
|
|
1272
|
-
* Kafka producer sink — forwards upstream `DATA` to a Kafka topic.
|
|
1273
|
-
*
|
|
1274
|
-
* @param source - Upstream node to forward.
|
|
1275
|
-
* @param kafkaProducer - KafkaJS-compatible producer instance.
|
|
1276
|
-
* @param topic - Target topic.
|
|
1277
|
-
* @param opts - Serialization and key extraction options.
|
|
1278
|
-
* @returns Unsubscribe function.
|
|
1279
|
-
*
|
|
1280
|
-
* @category extra
|
|
1281
|
-
*/
|
|
1282
|
-
declare function toKafka<T>(source: Node<T>, kafkaProducer: KafkaProducerLike, topic: string, opts?: ToKafkaOptions<T>): ReactiveSinkHandle<T>;
|
|
1283
|
-
/** Duck-typed Redis client (compatible with ioredis, redis). */
|
|
1284
|
-
type RedisClientLike = {
|
|
1285
|
-
xadd(key: string, id: string, ...fieldsAndValues: string[]): Promise<string>;
|
|
1286
|
-
xread(...args: Array<string | number>): Promise<Array<[string, Array<[string, string[]]>]> | null>;
|
|
1287
|
-
disconnect(): void;
|
|
1288
|
-
};
|
|
1289
|
-
/** Structured Redis Stream entry. */
|
|
1290
|
-
type RedisStreamEntry<T = unknown> = {
|
|
1291
|
-
id: string;
|
|
1292
|
-
key: string;
|
|
1293
|
-
data: T;
|
|
1294
|
-
timestampNs: number;
|
|
1295
|
-
};
|
|
1296
|
-
/** Options for {@link fromRedisStream}. */
|
|
1297
|
-
type FromRedisStreamOptions = ExtraOpts & {
|
|
1298
|
-
/** Block timeout in ms for XREAD. Default: `5000`. */
|
|
1299
|
-
blockMs?: number;
|
|
1300
|
-
/** Start ID. Default: `"$"` (new entries only). */
|
|
1301
|
-
startId?: string;
|
|
1302
|
-
/** Parse raw Redis hash fields to structured data. Default: parses `data` field as JSON. */
|
|
1303
|
-
parse?: (fields: string[]) => unknown;
|
|
1304
|
-
};
|
|
1305
|
-
/**
|
|
1306
|
-
* Redis Streams consumer as a reactive source.
|
|
1307
|
-
*
|
|
1308
|
-
* Uses XREAD with BLOCK to reactively consume stream entries.
|
|
1309
|
-
*
|
|
1310
|
-
* @param client - ioredis/redis-compatible client (caller owns connection).
|
|
1311
|
-
* @param key - Redis stream key.
|
|
1312
|
-
* @param opts - Block timeout, start ID, and parsing options.
|
|
1313
|
-
* @returns `Node<RedisStreamEntry<T>>` — one `DATA` per stream entry.
|
|
1314
|
-
*
|
|
1315
|
-
* @remarks
|
|
1316
|
-
* **COMPLETE:** This source never emits `COMPLETE` under normal operation — it
|
|
1317
|
-
* is a long-lived stream consumer that runs until teardown or error, same as
|
|
1318
|
-
* Kafka consumers. If you need a bounded read, wrap with `take()` or
|
|
1319
|
-
* `takeUntil()`.
|
|
1320
|
-
*
|
|
1321
|
-
* **Client lifecycle:** The caller owns the Redis client connection. The adapter
|
|
1322
|
-
* does not call `disconnect()` on teardown — the caller is responsible for
|
|
1323
|
-
* closing the connection (same contract as `fromKafka`).
|
|
1324
|
-
*
|
|
1325
|
-
* @category extra
|
|
1326
|
-
*/
|
|
1327
|
-
declare function fromRedisStream<T = unknown>(client: RedisClientLike, key: string, opts?: FromRedisStreamOptions): Node<RedisStreamEntry<T>>;
|
|
1328
|
-
/** Options for {@link toRedisStream}. */
|
|
1329
|
-
type ToRedisStreamOptions<T> = ExtraOpts & {
|
|
1330
|
-
/** Serialize value to Redis hash fields. Default: `["data", JSON.stringify(value)]`. */
|
|
1331
|
-
serialize?: (value: T) => string[];
|
|
1332
|
-
/** Max stream length (MAXLEN ~). Default: no trimming. */
|
|
1333
|
-
maxLen?: number;
|
|
1334
|
-
/** Called on serialization or send failures. */
|
|
1335
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
1336
|
-
};
|
|
1337
|
-
/**
|
|
1338
|
-
* Redis Streams producer sink — forwards upstream `DATA` to a Redis stream.
|
|
1339
|
-
*
|
|
1340
|
-
* @param source - Upstream node to forward.
|
|
1341
|
-
* @param client - ioredis/redis-compatible client.
|
|
1342
|
-
* @param key - Redis stream key.
|
|
1343
|
-
* @param opts - Serialization options.
|
|
1344
|
-
* @returns Unsubscribe function.
|
|
1345
|
-
*
|
|
1346
|
-
* @category extra
|
|
1347
|
-
*/
|
|
1348
|
-
declare function toRedisStream<T>(source: Node<T>, client: RedisClientLike, key: string, opts?: ToRedisStreamOptions<T>): ReactiveSinkHandle<T>;
|
|
1349
|
-
/** Parsed CSV row. */
|
|
1350
|
-
type CSVRow = Record<string, string>;
|
|
1351
|
-
/** Options for {@link fromCSV}. */
|
|
1352
|
-
type FromCSVOptions = ExtraOpts & {
|
|
1353
|
-
/** Column delimiter. Default: `","`. */
|
|
1354
|
-
delimiter?: string;
|
|
1355
|
-
/** Whether the first row is a header. Default: `true`. */
|
|
1356
|
-
hasHeader?: boolean;
|
|
1357
|
-
/** Explicit column names (overrides header row). */
|
|
1358
|
-
columns?: string[];
|
|
1359
|
-
/** Custom line parser (e.g. wrapping a library like `csv-parse`). Overrides built-in parser + delimiter. */
|
|
1360
|
-
parseLine?: (line: string) => string[];
|
|
1361
|
-
};
|
|
1362
|
-
/**
|
|
1363
|
-
* CSV file/stream ingest for batch replay.
|
|
1364
|
-
*
|
|
1365
|
-
* Reads a CSV from a `ReadableStream<string>` or an `AsyncIterable<string>` of lines,
|
|
1366
|
-
* emitting one `DATA` per row. `COMPLETE` after all rows are emitted.
|
|
1367
|
-
*
|
|
1368
|
-
* @param source - Async iterable of CSV text chunks (lines or multi-line chunks).
|
|
1369
|
-
* @param opts - Delimiter, header, and column options.
|
|
1370
|
-
* @returns `Node<CSVRow>` — one `DATA` per parsed row.
|
|
1371
|
-
*
|
|
1372
|
-
* @example
|
|
1373
|
-
* ```ts
|
|
1374
|
-
* import { createReadStream } from "node:fs";
|
|
1375
|
-
* import { fromCSV } from "@graphrefly/graphrefly-ts";
|
|
1376
|
-
*
|
|
1377
|
-
* const csv$ = fromCSV(createReadStream("data.csv", "utf-8"));
|
|
1378
|
-
* ```
|
|
1379
|
-
*
|
|
1380
|
-
* @category extra
|
|
1381
|
-
*/
|
|
1382
|
-
declare function fromCSV(source: AsyncIterable<string>, opts?: FromCSVOptions): Node<CSVRow>;
|
|
1383
|
-
/**
|
|
1384
|
-
* Stateful CSV parser operator — takes a `Node<string>` emitting raw text
|
|
1385
|
-
* chunks (from any source: {@link fromAsyncIter}, {@link fromHTTPStream},
|
|
1386
|
-
* WebSocket, file watcher, etc.) and emits one `DATA` per parsed row.
|
|
1387
|
-
*
|
|
1388
|
-
* Buffers incomplete lines across chunks. Mirrors {@link fromCSV}'s parsing
|
|
1389
|
-
* logic without committing to an async-iterable-only input.
|
|
1390
|
-
*
|
|
1391
|
-
* @example
|
|
1392
|
-
* ```ts
|
|
1393
|
-
* import { fromHTTPStream, csvRows } from "@graphrefly/graphrefly-ts";
|
|
1394
|
-
* const bytes$ = fromHTTPStream("https://example.com/data.csv");
|
|
1395
|
-
* const text$ = decodeText(bytes$); // caller-provided byte→string decoder
|
|
1396
|
-
* const rows$ = csvRows(text$, { columns: ["name", "age"] });
|
|
1397
|
-
* ```
|
|
1398
|
-
*
|
|
1399
|
-
* @category extra
|
|
1400
|
-
*/
|
|
1401
|
-
declare function csvRows(source: Node<string>, opts?: FromCSVOptions): Node<CSVRow>;
|
|
1402
|
-
/**
|
|
1403
|
-
* Stateful NDJSON parser operator — takes a `Node<string>` of raw text chunks
|
|
1404
|
-
* and emits one `DATA` per parsed JSON object. Buffers partial lines across
|
|
1405
|
-
* chunks.
|
|
1406
|
-
*
|
|
1407
|
-
* @category extra
|
|
1408
|
-
*/
|
|
1409
|
-
declare function ndjsonRows<T = unknown>(source: Node<string>, opts?: ExtraOpts): Node<T>;
|
|
1410
|
-
/** Options for {@link fromNDJSON}. */
|
|
1411
|
-
type FromNDJSONOptions = ExtraOpts & {};
|
|
1412
|
-
/**
|
|
1413
|
-
* Newline-delimited JSON stream ingest for batch replay.
|
|
1414
|
-
*
|
|
1415
|
-
* Reads an async iterable of text chunks, splits by newline, parses each line
|
|
1416
|
-
* as JSON, and emits one `DATA` per parsed object. `COMPLETE` after stream ends.
|
|
1417
|
-
*
|
|
1418
|
-
* @param source - Async iterable of NDJSON text chunks.
|
|
1419
|
-
* @param opts - Optional producer options.
|
|
1420
|
-
* @returns `Node<T>` — one `DATA` per JSON line.
|
|
1421
|
-
*
|
|
1422
|
-
* @example
|
|
1423
|
-
* ```ts
|
|
1424
|
-
* import { createReadStream } from "node:fs";
|
|
1425
|
-
* import { fromNDJSON } from "@graphrefly/graphrefly-ts";
|
|
1426
|
-
*
|
|
1427
|
-
* const logs$ = fromNDJSON(createReadStream("logs.ndjson", "utf-8"));
|
|
1428
|
-
* ```
|
|
1429
|
-
*
|
|
1430
|
-
* @category extra
|
|
1431
|
-
*/
|
|
1432
|
-
declare function fromNDJSON<T = unknown>(source: AsyncIterable<string>, opts?: FromNDJSONOptions): Node<T>;
|
|
1433
|
-
/** Structured ClickHouse query result row. */
|
|
1434
|
-
type ClickHouseRow = Record<string, unknown>;
|
|
1435
|
-
/** Duck-typed ClickHouse client. */
|
|
1436
|
-
type ClickHouseClientLike = {
|
|
1437
|
-
query(opts: {
|
|
1438
|
-
query: string;
|
|
1439
|
-
format?: string;
|
|
1440
|
-
}): Promise<{
|
|
1441
|
-
json<T = unknown>(): Promise<T[]>;
|
|
1442
|
-
}>;
|
|
1443
|
-
};
|
|
1444
|
-
/** Options for {@link fromClickHouseWatch}. */
|
|
1445
|
-
type FromClickHouseWatchOptions = AsyncSourceOpts & {
|
|
1446
|
-
/** Polling interval in nanoseconds. Default: `5 * NS_PER_SEC` (5s). */
|
|
1447
|
-
intervalNs?: number;
|
|
1448
|
-
/** JSON format to request. Default: `"JSONEachRow"`. */
|
|
1449
|
-
format?: string;
|
|
1450
|
-
/**
|
|
1451
|
-
* Maximum consecutive query errors before terminating the source. Prevents
|
|
1452
|
-
* error storms when the database is unavailable. Default: `5`. Set to
|
|
1453
|
-
* `Infinity` to keep retrying indefinitely.
|
|
1454
|
-
*/
|
|
1455
|
-
maxConsecutiveErrors?: number;
|
|
1456
|
-
};
|
|
1457
|
-
/**
|
|
1458
|
-
* ClickHouse live materialized view as a reactive source.
|
|
1459
|
-
*
|
|
1460
|
-
* Polls a ClickHouse query on a reactive timer interval and emits new/changed rows.
|
|
1461
|
-
* Uses a timer-driven approach (not busy-wait polling).
|
|
1462
|
-
*
|
|
1463
|
-
* @param client - ClickHouse client instance (caller owns connection).
|
|
1464
|
-
* @param query - SQL query to execute on each interval.
|
|
1465
|
-
* @param opts - Polling interval and format options.
|
|
1466
|
-
* @returns `Node<ClickHouseRow>` — one `DATA` per result row per scrape.
|
|
1467
|
-
*
|
|
1468
|
-
* @example
|
|
1469
|
-
* ```ts
|
|
1470
|
-
* import { createClient } from "@clickhouse/client";
|
|
1471
|
-
* import { fromClickHouseWatch } from "@graphrefly/graphrefly-ts";
|
|
1472
|
-
*
|
|
1473
|
-
* const client = createClient({ url: "http://localhost:8123" });
|
|
1474
|
-
* const rows$ = fromClickHouseWatch(client, "SELECT * FROM errors_mv ORDER BY timestamp DESC LIMIT 100");
|
|
1475
|
-
* ```
|
|
1476
|
-
*
|
|
1477
|
-
* @category extra
|
|
1478
|
-
*/
|
|
1479
|
-
declare function fromClickHouseWatch(client: ClickHouseClientLike, query: string, opts?: FromClickHouseWatchOptions): Node<ClickHouseRow>;
|
|
1480
|
-
/** Duck-typed Pulsar consumer (compatible with pulsar-client). */
|
|
1481
|
-
type PulsarConsumerLike = {
|
|
1482
|
-
receive(): Promise<{
|
|
1483
|
-
getData(): Buffer;
|
|
1484
|
-
getMessageId(): {
|
|
1485
|
-
toString(): string;
|
|
1486
|
-
};
|
|
1487
|
-
getPartitionKey(): string;
|
|
1488
|
-
getProperties(): Record<string, string>;
|
|
1489
|
-
getPublishTimestamp(): number;
|
|
1490
|
-
getEventTimestamp(): number;
|
|
1491
|
-
getTopicName(): string;
|
|
1492
|
-
}>;
|
|
1493
|
-
acknowledge(msg: unknown): Promise<void>;
|
|
1494
|
-
close(): Promise<void>;
|
|
1495
|
-
};
|
|
1496
|
-
/** Duck-typed Pulsar producer. */
|
|
1497
|
-
type PulsarProducerLike = {
|
|
1498
|
-
send(msg: {
|
|
1499
|
-
data: Buffer;
|
|
1500
|
-
partitionKey?: string;
|
|
1501
|
-
properties?: Record<string, string>;
|
|
1502
|
-
}): Promise<void>;
|
|
1503
|
-
close(): Promise<void>;
|
|
1504
|
-
};
|
|
1505
|
-
/** Structured Pulsar message. */
|
|
1506
|
-
type PulsarMessage<T = unknown> = {
|
|
1507
|
-
topic: string;
|
|
1508
|
-
messageId: string;
|
|
1509
|
-
key: string;
|
|
1510
|
-
value: T;
|
|
1511
|
-
properties: Record<string, string>;
|
|
1512
|
-
publishTime: number;
|
|
1513
|
-
eventTime: number;
|
|
1514
|
-
timestampNs: number;
|
|
1515
|
-
};
|
|
1516
|
-
/** Options for {@link fromPulsar}. */
|
|
1517
|
-
type FromPulsarOptions = ExtraOpts & {
|
|
1518
|
-
/** Deserialize message data. Default: `JSON.parse(buffer.toString())`. */
|
|
1519
|
-
deserialize?: (data: Buffer) => unknown;
|
|
1520
|
-
/** Acknowledge messages automatically. Default: `true`. */
|
|
1521
|
-
autoAck?: boolean;
|
|
1522
|
-
/**
|
|
1523
|
-
* Routes ack/nack transport failures to the caller. Covers:
|
|
1524
|
-
* - `autoAck: true` — post-emit `acknowledge()` promise rejections.
|
|
1525
|
-
* - `autoAck: false` — envelope `ack()` / `nack()` promise rejections.
|
|
1526
|
-
* Default: swallow (SDK handles redelivery on its own).
|
|
1527
|
-
*/
|
|
1528
|
-
onAckError?: (err: Error) => void;
|
|
1529
|
-
};
|
|
1530
|
-
/**
|
|
1531
|
-
* Apache Pulsar consumer as a reactive source (native client).
|
|
1532
|
-
*
|
|
1533
|
-
* Wraps a `pulsar-client`-compatible consumer. Each message becomes a `DATA` emission.
|
|
1534
|
-
* For Kafka-on-Pulsar (KoP), use {@link fromKafka} instead.
|
|
1535
|
-
*
|
|
1536
|
-
* @param consumer - Pulsar consumer instance (caller owns create/close lifecycle).
|
|
1537
|
-
* @param opts - Deserialization and source options.
|
|
1538
|
-
* @returns `Node<PulsarMessage<T>>` — one `DATA` per Pulsar message.
|
|
1539
|
-
*
|
|
1540
|
-
* @remarks
|
|
1541
|
-
* Teardown sets an internal flag but cannot interrupt a pending `consumer.receive()`.
|
|
1542
|
-
* The loop exits on the next message or when the consumer is closed externally.
|
|
1543
|
-
* Callers should call `consumer.close()` after unsubscribing for prompt cleanup.
|
|
1544
|
-
*
|
|
1545
|
-
* @example
|
|
1546
|
-
* ```ts
|
|
1547
|
-
* import Pulsar from "pulsar-client";
|
|
1548
|
-
* import { fromPulsar } from "@graphrefly/graphrefly-ts";
|
|
1549
|
-
*
|
|
1550
|
-
* const client = new Pulsar.Client({ serviceUrl: "pulsar://localhost:6650" });
|
|
1551
|
-
* const consumer = await client.subscribe({ topic: "events", subscription: "my-sub" });
|
|
1552
|
-
* const events$ = fromPulsar(consumer);
|
|
1553
|
-
* ```
|
|
1554
|
-
*
|
|
1555
|
-
* @category extra
|
|
1556
|
-
*/
|
|
1557
|
-
declare function fromPulsar<T = unknown>(consumer: PulsarConsumerLike, opts?: FromPulsarOptions & {
|
|
1558
|
-
autoAck?: true;
|
|
1559
|
-
}): Node<PulsarMessage<T>>;
|
|
1560
|
-
declare function fromPulsar<T = unknown>(consumer: PulsarConsumerLike, opts: FromPulsarOptions & {
|
|
1561
|
-
autoAck: false;
|
|
1562
|
-
}): Node<AckableMessage<PulsarMessage<T>>>;
|
|
1563
|
-
/** Options for {@link toPulsar}. */
|
|
1564
|
-
type ToPulsarOptions<T> = ExtraOpts & {
|
|
1565
|
-
/** Serialize value for Pulsar. Default: `JSON.stringify` → Buffer. */
|
|
1566
|
-
serialize?: (value: T) => Buffer;
|
|
1567
|
-
/** Extract partition key from value. Default: none. */
|
|
1568
|
-
keyExtractor?: (value: T) => string | undefined;
|
|
1569
|
-
/** Extract properties from value. */
|
|
1570
|
-
propertiesExtractor?: (value: T) => Record<string, string> | undefined;
|
|
1571
|
-
/** Called on serialization or send failures. */
|
|
1572
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
1573
|
-
};
|
|
1574
|
-
/**
|
|
1575
|
-
* Pulsar producer sink — forwards upstream `DATA` to a Pulsar topic.
|
|
1576
|
-
*
|
|
1577
|
-
* @param source - Upstream node to forward.
|
|
1578
|
-
* @param pulsarProducer - Pulsar producer instance (caller owns lifecycle).
|
|
1579
|
-
* @param opts - Serialization options.
|
|
1580
|
-
* @returns Unsubscribe function.
|
|
1581
|
-
*
|
|
1582
|
-
* @category extra
|
|
1583
|
-
*/
|
|
1584
|
-
declare function toPulsar<T>(source: Node<T>, pulsarProducer: PulsarProducerLike, opts?: ToPulsarOptions<T>): ReactiveSinkHandle<T>;
|
|
1585
|
-
/** Duck-typed NATS subscription (compatible with nats.js). */
|
|
1586
|
-
type NATSSubscriptionLike = AsyncIterable<{
|
|
1587
|
-
subject: string;
|
|
1588
|
-
data: Uint8Array;
|
|
1589
|
-
headers?: {
|
|
1590
|
-
get(key: string): string;
|
|
1591
|
-
keys(): string[];
|
|
1592
|
-
};
|
|
1593
|
-
reply?: string;
|
|
1594
|
-
sid: number;
|
|
1595
|
-
}>;
|
|
1596
|
-
/** Duck-typed NATS client (compatible with nats.js). */
|
|
1597
|
-
type NATSClientLike = {
|
|
1598
|
-
subscribe(subject: string, opts?: {
|
|
1599
|
-
queue?: string;
|
|
1600
|
-
}): NATSSubscriptionLike;
|
|
1601
|
-
publish(subject: string, data?: Uint8Array, opts?: {
|
|
1602
|
-
headers?: unknown;
|
|
1603
|
-
reply?: string;
|
|
1604
|
-
}): void;
|
|
1605
|
-
drain(): Promise<void>;
|
|
1606
|
-
};
|
|
1607
|
-
/** Structured NATS message. */
|
|
1608
|
-
type NATSMessage<T = unknown> = {
|
|
1609
|
-
subject: string;
|
|
1610
|
-
data: T;
|
|
1611
|
-
headers: Record<string, string>;
|
|
1612
|
-
reply: string | undefined;
|
|
1613
|
-
sid: number;
|
|
1614
|
-
timestampNs: number;
|
|
1615
|
-
};
|
|
1616
|
-
/** Options for {@link fromNATS}. */
|
|
1617
|
-
type FromNATSOptions = ExtraOpts & {
|
|
1618
|
-
/** Queue group name for load balancing. */
|
|
1619
|
-
queue?: string;
|
|
1620
|
-
/** Deserialize message data. Default: `JSON.parse(textDecoder.decode(data))`. */
|
|
1621
|
-
deserialize?: (data: Uint8Array) => unknown;
|
|
1622
|
-
};
|
|
1623
|
-
/**
|
|
1624
|
-
* NATS consumer as a reactive source.
|
|
1625
|
-
*
|
|
1626
|
-
* Wraps a `nats.js`-compatible client subscription. Each message becomes a `DATA` emission.
|
|
1627
|
-
*
|
|
1628
|
-
* @param client - NATS client instance (caller owns connect/drain lifecycle).
|
|
1629
|
-
* @param subject - Subject to subscribe to (supports wildcards).
|
|
1630
|
-
* @param opts - Queue group, deserialization, and source options.
|
|
1631
|
-
* @returns `Node<NATSMessage<T>>` — one `DATA` per NATS message.
|
|
1632
|
-
*
|
|
1633
|
-
* @remarks
|
|
1634
|
-
* Teardown sets an internal flag but cannot break the async iterator. The loop
|
|
1635
|
-
* exits on the next message or when the subscription is drained/unsubscribed
|
|
1636
|
-
* externally. Call `client.drain()` after unsubscribing for prompt cleanup.
|
|
1637
|
-
*
|
|
1638
|
-
* @example
|
|
1639
|
-
* ```ts
|
|
1640
|
-
* import { connect } from "nats";
|
|
1641
|
-
* import { fromNATS } from "@graphrefly/graphrefly-ts";
|
|
1642
|
-
*
|
|
1643
|
-
* const nc = await connect({ servers: "localhost:4222" });
|
|
1644
|
-
* const events$ = fromNATS(nc, "events.>");
|
|
1645
|
-
* ```
|
|
1646
|
-
*
|
|
1647
|
-
* @category extra
|
|
1648
|
-
*/
|
|
1649
|
-
declare function fromNATS<T = unknown>(client: NATSClientLike, subject: string, opts?: FromNATSOptions): Node<NATSMessage<T>>;
|
|
1650
|
-
/** Options for {@link toNATS}. */
|
|
1651
|
-
type ToNATSOptions<T> = ExtraOpts & {
|
|
1652
|
-
/** Serialize value for NATS. Default: `JSON.stringify` → Uint8Array. */
|
|
1653
|
-
serialize?: (value: T) => Uint8Array;
|
|
1654
|
-
/** Called on serialization failures. */
|
|
1655
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
1656
|
-
};
|
|
1657
|
-
/**
|
|
1658
|
-
* NATS publisher sink — forwards upstream `DATA` to a NATS subject.
|
|
1659
|
-
*
|
|
1660
|
-
* @param source - Upstream node to forward.
|
|
1661
|
-
* @param client - NATS client instance.
|
|
1662
|
-
* @param subject - Target subject.
|
|
1663
|
-
* @param opts - Serialization options.
|
|
1664
|
-
* @returns Unsubscribe function.
|
|
1665
|
-
*
|
|
1666
|
-
* @category extra
|
|
1667
|
-
*/
|
|
1668
|
-
declare function toNATS<T>(source: Node<T>, client: NATSClientLike, subject: string, opts?: ToNATSOptions<T>): ReactiveSinkHandle<T>;
|
|
1669
|
-
/** Duck-typed RabbitMQ channel (compatible with amqplib). */
|
|
1670
|
-
type RabbitMQChannelLike = {
|
|
1671
|
-
consume(queue: string, onMessage: (msg: {
|
|
1672
|
-
content: Buffer;
|
|
1673
|
-
fields: {
|
|
1674
|
-
routingKey: string;
|
|
1675
|
-
exchange: string;
|
|
1676
|
-
deliveryTag: number;
|
|
1677
|
-
redelivered: boolean;
|
|
1678
|
-
};
|
|
1679
|
-
properties: Record<string, unknown>;
|
|
1680
|
-
} | null) => void, opts?: {
|
|
1681
|
-
noAck?: boolean;
|
|
1682
|
-
}): Promise<{
|
|
1683
|
-
consumerTag: string;
|
|
1684
|
-
}>;
|
|
1685
|
-
cancel(consumerTag: string): Promise<void>;
|
|
1686
|
-
ack(msg: unknown): void;
|
|
1687
|
-
publish(exchange: string, routingKey: string, content: Buffer, opts?: Record<string, unknown>): boolean;
|
|
1688
|
-
sendToQueue(queue: string, content: Buffer, opts?: Record<string, unknown>): boolean;
|
|
1689
|
-
};
|
|
1690
|
-
/** Structured RabbitMQ message. */
|
|
1691
|
-
type RabbitMQMessage<T = unknown> = {
|
|
1692
|
-
queue: string;
|
|
1693
|
-
routingKey: string;
|
|
1694
|
-
exchange: string;
|
|
1695
|
-
content: T;
|
|
1696
|
-
properties: Record<string, unknown>;
|
|
1697
|
-
deliveryTag: number;
|
|
1698
|
-
redelivered: boolean;
|
|
1699
|
-
timestampNs: number;
|
|
1700
|
-
};
|
|
1701
|
-
/** Options for {@link fromRabbitMQ}. */
|
|
1702
|
-
type FromRabbitMQOptions = ExtraOpts & {
|
|
1703
|
-
/** Deserialize message content. Default: `JSON.parse(buffer.toString())`. */
|
|
1704
|
-
deserialize?: (content: Buffer) => unknown;
|
|
1705
|
-
/** Auto-acknowledge messages. Default: `true`. */
|
|
1706
|
-
autoAck?: boolean;
|
|
1707
|
-
/**
|
|
1708
|
-
* Routes envelope ack/nack transport failures (including "SDK exposes no
|
|
1709
|
-
* `nack` method") to the caller. Default: swallow.
|
|
1710
|
-
*/
|
|
1711
|
-
onAckError?: (err: Error) => void;
|
|
1712
|
-
};
|
|
1713
|
-
/**
|
|
1714
|
-
* RabbitMQ consumer as a reactive source.
|
|
1715
|
-
*
|
|
1716
|
-
* Wraps an `amqplib`-compatible channel. Each message becomes a `DATA` emission.
|
|
1717
|
-
*
|
|
1718
|
-
* @param channel - AMQP channel instance (caller owns connection/channel lifecycle).
|
|
1719
|
-
* @param queue - Queue to consume from.
|
|
1720
|
-
* @param opts - Deserialization and acknowledgment options.
|
|
1721
|
-
* @returns `Node<RabbitMQMessage<T>>` — one `DATA` per RabbitMQ message.
|
|
1722
|
-
*
|
|
1723
|
-
* @remarks
|
|
1724
|
-
* When `autoAck` is `false`, the adapter opens the channel with `noAck: false`
|
|
1725
|
-
* (broker requires acks) but does not call `channel.ack()`. The caller must ack
|
|
1726
|
-
* messages externally using the `deliveryTag` from the emitted {@link RabbitMQMessage}:
|
|
1727
|
-
* ```ts
|
|
1728
|
-
* channel.ack({ fields: { deliveryTag: msg.deliveryTag } } as any);
|
|
1729
|
-
* ```
|
|
1730
|
-
*
|
|
1731
|
-
* @example
|
|
1732
|
-
* ```ts
|
|
1733
|
-
* import amqplib from "amqplib";
|
|
1734
|
-
* import { fromRabbitMQ } from "@graphrefly/graphrefly-ts";
|
|
1735
|
-
*
|
|
1736
|
-
* const conn = await amqplib.connect("amqp://localhost");
|
|
1737
|
-
* const ch = await conn.createChannel();
|
|
1738
|
-
* await ch.assertQueue("events");
|
|
1739
|
-
* const events$ = fromRabbitMQ(ch, "events");
|
|
1740
|
-
* ```
|
|
1741
|
-
*
|
|
1742
|
-
* @category extra
|
|
1743
|
-
*/
|
|
1744
|
-
declare function fromRabbitMQ<T = unknown>(channel: RabbitMQChannelLike, queue: string, opts?: FromRabbitMQOptions & {
|
|
1745
|
-
autoAck?: true;
|
|
1746
|
-
}): Node<RabbitMQMessage<T>>;
|
|
1747
|
-
declare function fromRabbitMQ<T = unknown>(channel: RabbitMQChannelLike, queue: string, opts: FromRabbitMQOptions & {
|
|
1748
|
-
autoAck: false;
|
|
1749
|
-
}): Node<AckableMessage<RabbitMQMessage<T>>>;
|
|
1750
|
-
/** Options for {@link toRabbitMQ}. */
|
|
1751
|
-
type ToRabbitMQOptions<T> = ExtraOpts & {
|
|
1752
|
-
/** Serialize value for RabbitMQ. Default: `Buffer.from(JSON.stringify(value))`. */
|
|
1753
|
-
serialize?: (value: T) => Buffer;
|
|
1754
|
-
/** Extract routing key from value. Default: `""`. */
|
|
1755
|
-
routingKeyExtractor?: (value: T) => string;
|
|
1756
|
-
/** Called on serialization or send failures. */
|
|
1757
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
1758
|
-
};
|
|
1759
|
-
/**
|
|
1760
|
-
* RabbitMQ producer sink — forwards upstream `DATA` to a RabbitMQ exchange/queue.
|
|
1761
|
-
*
|
|
1762
|
-
* @param source - Upstream node to forward.
|
|
1763
|
-
* @param channel - AMQP channel instance.
|
|
1764
|
-
* @param exchange - Target exchange (use `""` for default exchange + queue routing).
|
|
1765
|
-
* @param opts - Serialization and routing options.
|
|
1766
|
-
* @returns Unsubscribe function.
|
|
1767
|
-
*
|
|
1768
|
-
* @category extra
|
|
1769
|
-
*/
|
|
1770
|
-
declare function toRabbitMQ<T>(source: Node<T>, channel: RabbitMQChannelLike, exchange: string, opts?: ToRabbitMQOptions<T>): ReactiveSinkHandle<T>;
|
|
1771
|
-
/** Handle returned by buffered sinks. `flush()` drains remaining buffer. */
|
|
1772
|
-
type BufferedSinkHandle = SinkHandle & {
|
|
1773
|
-
/** Manually drain the internal buffer. */
|
|
1774
|
-
flush: () => Promise<void>;
|
|
1775
|
-
};
|
|
1776
|
-
/** Duck-typed writable file handle (compatible with `fs.createWriteStream`). */
|
|
1777
|
-
type FileWriterLike = {
|
|
1778
|
-
write(data: string | Uint8Array): boolean | undefined;
|
|
1779
|
-
end(): void;
|
|
1780
|
-
};
|
|
1781
|
-
/** Options for {@link toFile}. */
|
|
1782
|
-
type ToFileOptions<T> = ExtraOpts & {
|
|
1783
|
-
/** Serialize a value to a string line. Default: `JSON.stringify(v) + "\n"`. */
|
|
1784
|
-
serialize?: (value: T) => string;
|
|
1785
|
-
/** `"append"` (default) or `"overwrite"` — controls initial file behavior hint. */
|
|
1786
|
-
mode?: "append" | "overwrite";
|
|
1787
|
-
/** Flush interval in ms. `0` = write-through (no buffering). Default: `0`. */
|
|
1788
|
-
flushIntervalMs?: number;
|
|
1789
|
-
/** Buffer size (item count) before auto-flush. Default: `Infinity` (timer only). */
|
|
1790
|
-
batchSize?: number;
|
|
1791
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
1792
|
-
};
|
|
1793
|
-
/**
|
|
1794
|
-
* File sink — writes upstream `DATA` values to a file-like writable.
|
|
1795
|
-
*
|
|
1796
|
-
* When `flushIntervalMs > 0` or `batchSize` is set, values are buffered and
|
|
1797
|
-
* flushed in batches. Otherwise, each value is written immediately.
|
|
1798
|
-
*
|
|
1799
|
-
* @param source - Upstream node.
|
|
1800
|
-
* @param writer - Writable file handle (e.g. `fs.createWriteStream(path, { flags: "a" })`).
|
|
1801
|
-
* @param opts - Serialization, buffering, and mode options.
|
|
1802
|
-
* @returns `BufferedSinkHandle` with `dispose()` and `flush()`.
|
|
1803
|
-
*
|
|
1804
|
-
* @category extra
|
|
1805
|
-
*/
|
|
1806
|
-
declare function toFile<T>(source: Node<T>, writer: FileWriterLike, opts?: ToFileOptions<T>): ReactiveSinkHandle<T>;
|
|
1807
|
-
/** Options for {@link toCSV}. */
|
|
1808
|
-
type ToCSVOptions<T> = ExtraOpts & {
|
|
1809
|
-
/** Column names. Required — determines header row and field order. */
|
|
1810
|
-
columns: string[];
|
|
1811
|
-
/** Column delimiter. Default: `","`. */
|
|
1812
|
-
delimiter?: string;
|
|
1813
|
-
/** Whether to write a header row on first flush. Default: `true`. */
|
|
1814
|
-
writeHeader?: boolean;
|
|
1815
|
-
/** Extract a cell value from the row object. Default: `String(row[col] ?? "")`. */
|
|
1816
|
-
cellExtractor?: (row: T, column: string) => string;
|
|
1817
|
-
/** Flush interval in ms. Default: `0` (write-through). */
|
|
1818
|
-
flushIntervalMs?: number;
|
|
1819
|
-
/** Buffer size before auto-flush. Default: `Infinity`. */
|
|
1820
|
-
batchSize?: number;
|
|
1821
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
1822
|
-
};
|
|
1823
|
-
/**
|
|
1824
|
-
* CSV file sink — writes upstream `DATA` as CSV rows.
|
|
1825
|
-
*
|
|
1826
|
-
* @param source - Upstream node.
|
|
1827
|
-
* @param writer - Writable file handle.
|
|
1828
|
-
* @param opts - Column definition, delimiter, and buffering options.
|
|
1829
|
-
* @returns `BufferedSinkHandle`.
|
|
1830
|
-
*
|
|
1831
|
-
* @category extra
|
|
1832
|
-
*/
|
|
1833
|
-
declare function toCSV<T>(source: Node<T>, writer: FileWriterLike, opts: ToCSVOptions<T>): ReactiveSinkHandle<T>;
|
|
1834
|
-
/** Duck-typed ClickHouse client for batch inserts. */
|
|
1835
|
-
type ClickHouseInsertClientLike = {
|
|
1836
|
-
insert(params: {
|
|
1837
|
-
table: string;
|
|
1838
|
-
values: unknown[];
|
|
1839
|
-
format?: string;
|
|
1840
|
-
}): Promise<void>;
|
|
1841
|
-
};
|
|
1842
|
-
/** Options for {@link toClickHouse}. */
|
|
1843
|
-
type ToClickHouseOptions<T> = ExtraOpts & {
|
|
1844
|
-
/** Batch size before auto-flush. Default: `1000`. */
|
|
1845
|
-
batchSize?: number;
|
|
1846
|
-
/** Flush interval in ms. Default: `5000`. */
|
|
1847
|
-
flushIntervalMs?: number;
|
|
1848
|
-
/** Insert format. Default: `"JSONEachRow"`. */
|
|
1849
|
-
format?: string;
|
|
1850
|
-
/** Transform value before insert. Default: identity. */
|
|
1851
|
-
transform?: (value: T) => unknown;
|
|
1852
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
1853
|
-
};
|
|
1854
|
-
/**
|
|
1855
|
-
* ClickHouse buffered batch insert sink.
|
|
1856
|
-
*
|
|
1857
|
-
* Accumulates upstream `DATA` values and inserts in batches.
|
|
1858
|
-
*
|
|
1859
|
-
* @param source - Upstream node.
|
|
1860
|
-
* @param client - ClickHouse client with `insert()`.
|
|
1861
|
-
* @param table - Target table name.
|
|
1862
|
-
* @param opts - Batch size, flush interval, and transform options.
|
|
1863
|
-
* @returns `BufferedSinkHandle`.
|
|
1864
|
-
*
|
|
1865
|
-
* @category extra
|
|
1866
|
-
*/
|
|
1867
|
-
declare function toClickHouse<T>(source: Node<T>, client: ClickHouseInsertClientLike, table: string, opts?: ToClickHouseOptions<T>): ReactiveSinkHandle<T>;
|
|
1868
|
-
/** Duck-typed S3 client (compatible with AWS SDK v3 `S3Client.send(PutObjectCommand(...))`). */
|
|
1869
|
-
type S3ClientLike = {
|
|
1870
|
-
putObject(params: {
|
|
1871
|
-
Bucket: string;
|
|
1872
|
-
Key: string;
|
|
1873
|
-
Body: string | Uint8Array;
|
|
1874
|
-
ContentType?: string;
|
|
1875
|
-
}): Promise<unknown>;
|
|
1876
|
-
};
|
|
1877
|
-
/** Options for {@link toS3}. */
|
|
1878
|
-
type ToS3Options<T> = ExtraOpts & {
|
|
1879
|
-
/** Output format. Default: `"ndjson"`. */
|
|
1880
|
-
format?: "ndjson" | "json";
|
|
1881
|
-
/** Generate the S3 key for each batch. Receives `(seq, wallClockNs)`. Default: ISO timestamp + sequence. */
|
|
1882
|
-
keyGenerator?: (seq: number, timestampNs: number) => string;
|
|
1883
|
-
/** Batch size before auto-flush. Default: `1000`. */
|
|
1884
|
-
batchSize?: number;
|
|
1885
|
-
/** Flush interval in ms. Default: `10000`. */
|
|
1886
|
-
flushIntervalMs?: number;
|
|
1887
|
-
/** Transform value before serialization. Default: identity. */
|
|
1888
|
-
transform?: (value: T) => unknown;
|
|
1889
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
1890
|
-
};
|
|
1891
|
-
/**
|
|
1892
|
-
* S3 object storage sink — buffers values and uploads as NDJSON or JSON objects.
|
|
1893
|
-
*
|
|
1894
|
-
* @param source - Upstream node.
|
|
1895
|
-
* @param client - S3-compatible client with `putObject()`.
|
|
1896
|
-
* @param bucket - S3 bucket name.
|
|
1897
|
-
* @param opts - Format, key generation, batching options.
|
|
1898
|
-
* @returns `BufferedSinkHandle`.
|
|
1899
|
-
*
|
|
1900
|
-
* @category extra
|
|
1901
|
-
*/
|
|
1902
|
-
declare function toS3<T>(source: Node<T>, client: S3ClientLike, bucket: string, opts?: ToS3Options<T>): ReactiveSinkHandle<T>;
|
|
1903
|
-
/** Duck-typed Postgres client (compatible with `pg.Client` / `pg.Pool`). */
|
|
1904
|
-
type PostgresClientLike = {
|
|
1905
|
-
query(sql: string, params?: unknown[]): Promise<unknown>;
|
|
1906
|
-
};
|
|
1907
|
-
/** Options for {@link toPostgres}. */
|
|
1908
|
-
type ToPostgresOptions<T> = ExtraOpts & {
|
|
1909
|
-
/** Build the SQL + params for an insert. Default: JSON insert into `table`. */
|
|
1910
|
-
toSQL?: (value: T, table: string) => {
|
|
1911
|
-
sql: string;
|
|
1912
|
-
params: unknown[];
|
|
1913
|
-
};
|
|
1914
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
1915
|
-
};
|
|
1916
|
-
/**
|
|
1917
|
-
* PostgreSQL sink — inserts each upstream `DATA` value as a row.
|
|
1918
|
-
*
|
|
1919
|
-
* @param source - Upstream node.
|
|
1920
|
-
* @param client - Postgres client with `query()`.
|
|
1921
|
-
* @param table - Target table name.
|
|
1922
|
-
* @param opts - SQL builder and error options.
|
|
1923
|
-
* @returns Unsubscribe function.
|
|
1924
|
-
*
|
|
1925
|
-
* @category extra
|
|
1926
|
-
*/
|
|
1927
|
-
declare function toPostgres<T>(source: Node<T>, client: PostgresClientLike, table: string, opts?: ToPostgresOptions<T>): ReactiveSinkHandle<T>;
|
|
1928
|
-
/** Duck-typed MongoDB collection (compatible with `mongodb` driver). */
|
|
1929
|
-
type MongoCollectionLike = {
|
|
1930
|
-
insertOne(doc: unknown): Promise<unknown>;
|
|
1931
|
-
};
|
|
1932
|
-
/** Options for {@link toMongo}. */
|
|
1933
|
-
type ToMongoOptions<T> = ExtraOpts & {
|
|
1934
|
-
/** Transform value to a MongoDB document. Default: identity. */
|
|
1935
|
-
toDocument?: (value: T) => unknown;
|
|
1936
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
1937
|
-
};
|
|
1938
|
-
/**
|
|
1939
|
-
* MongoDB sink — inserts each upstream `DATA` value as a document.
|
|
1940
|
-
*
|
|
1941
|
-
* @param source - Upstream node.
|
|
1942
|
-
* @param collection - MongoDB collection with `insertOne()`.
|
|
1943
|
-
* @param opts - Document transform and error options.
|
|
1944
|
-
* @returns Unsubscribe function.
|
|
1945
|
-
*
|
|
1946
|
-
* @category extra
|
|
1947
|
-
*/
|
|
1948
|
-
declare function toMongo<T>(source: Node<T>, collection: MongoCollectionLike, opts?: ToMongoOptions<T>): ReactiveSinkHandle<T>;
|
|
1949
|
-
/** Loki log stream entry. */
|
|
1950
|
-
type LokiStream = {
|
|
1951
|
-
stream: Record<string, string>;
|
|
1952
|
-
values: [string, string][];
|
|
1953
|
-
};
|
|
1954
|
-
/** Duck-typed Loki push client (HTTP push API). */
|
|
1955
|
-
type LokiClientLike = {
|
|
1956
|
-
push(streams: {
|
|
1957
|
-
streams: LokiStream[];
|
|
1958
|
-
}): Promise<unknown>;
|
|
1959
|
-
};
|
|
1960
|
-
/** Options for {@link toLoki}. */
|
|
1961
|
-
type ToLokiOptions<T> = ExtraOpts & {
|
|
1962
|
-
/** Static labels applied to every log entry. */
|
|
1963
|
-
labels?: Record<string, string>;
|
|
1964
|
-
/** Extract the log line from a value. Default: `JSON.stringify(v)`. */
|
|
1965
|
-
toLine?: (value: T) => string;
|
|
1966
|
-
/** Extract additional labels from a value. Default: none. */
|
|
1967
|
-
toLabels?: (value: T) => Record<string, string>;
|
|
1968
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
1969
|
-
};
|
|
1970
|
-
/**
|
|
1971
|
-
* Grafana Loki sink — pushes upstream `DATA` values as log entries.
|
|
1972
|
-
*
|
|
1973
|
-
* @param source - Upstream node.
|
|
1974
|
-
* @param client - Loki-compatible client with `push()`.
|
|
1975
|
-
* @param opts - Label, serialization, and error options.
|
|
1976
|
-
* @returns Unsubscribe function.
|
|
1977
|
-
*
|
|
1978
|
-
* @category extra
|
|
1979
|
-
*/
|
|
1980
|
-
declare function toLoki<T>(source: Node<T>, client: LokiClientLike, opts?: ToLokiOptions<T>): ReactiveSinkHandle<T>;
|
|
1981
|
-
/** Duck-typed Tempo span push client (OTLP/HTTP shape). */
|
|
1982
|
-
type TempoClientLike = {
|
|
1983
|
-
push(payload: {
|
|
1984
|
-
resourceSpans: unknown[];
|
|
1985
|
-
}): Promise<unknown>;
|
|
1986
|
-
};
|
|
1987
|
-
/** Options for {@link toTempo}. */
|
|
1988
|
-
type ToTempoOptions<T> = ExtraOpts & {
|
|
1989
|
-
/** Transform a value into OTLP resourceSpans entries. */
|
|
1990
|
-
toResourceSpans?: (value: T) => unknown[];
|
|
1991
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
1992
|
-
};
|
|
1993
|
-
/**
|
|
1994
|
-
* Grafana Tempo sink — pushes upstream `DATA` values as trace spans.
|
|
1995
|
-
*
|
|
1996
|
-
* @param source - Upstream node.
|
|
1997
|
-
* @param client - Tempo-compatible client with `push()`.
|
|
1998
|
-
* @param opts - Span transform and error options.
|
|
1999
|
-
* @returns Unsubscribe function.
|
|
2000
|
-
*
|
|
2001
|
-
* @category extra
|
|
2002
|
-
*/
|
|
2003
|
-
declare function toTempo<T>(source: Node<T>, client: TempoClientLike, opts?: ToTempoOptions<T>): ReactiveSinkHandle<T>;
|
|
2004
|
-
/** Options for {@link checkpointToS3}. */
|
|
2005
|
-
type CheckpointToS3Options = {
|
|
2006
|
-
/** S3 key prefix. Default: `"checkpoints/"`. */
|
|
2007
|
-
prefix?: string;
|
|
2008
|
-
/** Debounce ms on the S3 tier. Default: `500`. */
|
|
2009
|
-
debounceMs?: number;
|
|
2010
|
-
/** Full snapshot compaction interval. Default: `10`. */
|
|
2011
|
-
compactEvery?: number;
|
|
2012
|
-
onError?: (error: unknown) => void;
|
|
2013
|
-
};
|
|
2014
|
-
type AttachStorageGraphLike = {
|
|
2015
|
-
attachSnapshotStorage: (tiers: readonly SnapshotStorageTier<GraphCheckpointRecord>[], opts?: unknown) => {
|
|
2016
|
-
dispose(): void;
|
|
2017
|
-
};
|
|
2018
|
-
name: string;
|
|
2019
|
-
};
|
|
2020
|
-
/**
|
|
2021
|
-
* Wires `graph.attachSnapshotStorage()` with an S3-backed tier.
|
|
2022
|
-
*
|
|
2023
|
-
* @param graph - Graph instance to checkpoint.
|
|
2024
|
-
* @param client - S3-compatible client with `putObject()`.
|
|
2025
|
-
* @param bucket - S3 bucket name.
|
|
2026
|
-
* @param opts - Key prefix, debounce, and compaction options.
|
|
2027
|
-
* @returns Dispose handle.
|
|
2028
|
-
*
|
|
2029
|
-
* @category extra
|
|
2030
|
-
*/
|
|
2031
|
-
declare function checkpointToS3(graph: AttachStorageGraphLike, client: S3ClientLike, bucket: string, opts?: CheckpointToS3Options): {
|
|
2032
|
-
dispose(): void;
|
|
2033
|
-
};
|
|
2034
|
-
/** Duck-typed Redis client for checkpoint storage. */
|
|
2035
|
-
type RedisCheckpointClientLike = {
|
|
2036
|
-
set(key: string, value: string): Promise<unknown>;
|
|
2037
|
-
get(key: string): Promise<string | null>;
|
|
2038
|
-
};
|
|
2039
|
-
/** Options for {@link checkpointToRedis}. */
|
|
2040
|
-
type CheckpointToRedisOptions = {
|
|
2041
|
-
/** Key prefix. Default: `"graphrefly:checkpoint:"`. */
|
|
2042
|
-
prefix?: string;
|
|
2043
|
-
/** Debounce ms on the Redis tier. Default: `500`. */
|
|
2044
|
-
debounceMs?: number;
|
|
2045
|
-
/** Full snapshot compaction interval. Default: `10`. */
|
|
2046
|
-
compactEvery?: number;
|
|
2047
|
-
onError?: (error: unknown) => void;
|
|
2048
|
-
};
|
|
2049
|
-
/**
|
|
2050
|
-
* Wires `graph.attachSnapshotStorage()` with a Redis-backed tier.
|
|
2051
|
-
*
|
|
2052
|
-
* @param graph - Graph instance to checkpoint.
|
|
2053
|
-
* @param client - Redis client with `set()`/`get()`.
|
|
2054
|
-
* @param opts - Key prefix, debounce, and compaction options.
|
|
2055
|
-
* @returns Dispose handle.
|
|
2056
|
-
*
|
|
2057
|
-
* @category extra
|
|
2058
|
-
*/
|
|
2059
|
-
declare function checkpointToRedis(graph: AttachStorageGraphLike, client: RedisCheckpointClientLike, opts?: CheckpointToRedisOptions): {
|
|
2060
|
-
dispose(): void;
|
|
2061
|
-
};
|
|
2062
|
-
/**
|
|
2063
|
-
* Duck-typed synchronous SQLite database.
|
|
2064
|
-
*
|
|
2065
|
-
* Compatible with `better-sqlite3` (`.prepare().all()` / `.prepare().run()`)
|
|
2066
|
-
* and Node.js `node:sqlite` `DatabaseSync`. The user wraps their driver behind
|
|
2067
|
-
* this uniform contract — method name `query` matches the project-wide
|
|
2068
|
-
* convention (`PostgresClientLike.query`, `ClickHouseClientLike.query`).
|
|
2069
|
-
*/
|
|
2070
|
-
type SqliteDbLike = {
|
|
2071
|
-
query(sql: string, params?: unknown[]): unknown[];
|
|
2072
|
-
};
|
|
2073
|
-
/** Options for {@link fromSqlite}. */
|
|
2074
|
-
type FromSqliteOptions<T> = ExtraOpts & {
|
|
2075
|
-
/** Map a raw row object to the desired type. Default: identity cast. */
|
|
2076
|
-
mapRow?: (row: unknown) => T;
|
|
2077
|
-
/** Bind parameters for the query. */
|
|
2078
|
-
params?: unknown[];
|
|
2079
|
-
};
|
|
2080
|
-
/**
|
|
2081
|
-
* One-shot SQLite query as a reactive source.
|
|
2082
|
-
*
|
|
2083
|
-
* Executes `query` synchronously via `db.query()`, emits **one `DATA` containing
|
|
2084
|
-
* the full result array**, then `COMPLETE`. Downstream flattens with
|
|
2085
|
-
* `mergeAll` / a custom operator if per-row semantics are required — the
|
|
2086
|
-
* array shape is the simpler default and matches how every SQL driver returns
|
|
2087
|
-
* results natively. Use {@link fromSqliteCursor} for streaming row-by-row.
|
|
2088
|
-
*
|
|
2089
|
-
* @param db - SQLite database (caller owns connection).
|
|
2090
|
-
* @param query - SQL string to execute.
|
|
2091
|
-
* @param opts - Row mapper, params, and node options.
|
|
2092
|
-
* @returns `Node<T[]>` — one `DATA` with the full row array, then `COMPLETE`.
|
|
2093
|
-
*
|
|
2094
|
-
* @example
|
|
2095
|
-
* ```ts
|
|
2096
|
-
* import Database from "better-sqlite3";
|
|
2097
|
-
* import { fromSqlite } from "@graphrefly/graphrefly-ts";
|
|
2098
|
-
*
|
|
2099
|
-
* const raw = new Database("app.db");
|
|
2100
|
-
* const db = { query: (sql, params) => raw.prepare(sql).all(...(params ?? [])) };
|
|
2101
|
-
* const rows$ = fromSqlite(db, "SELECT * FROM users WHERE active = ?", { params: [1] });
|
|
2102
|
-
* ```
|
|
2103
|
-
*
|
|
2104
|
-
* @category extra
|
|
2105
|
-
*/
|
|
2106
|
-
declare function fromSqlite<T = unknown>(db: SqliteDbLike, query: string, opts?: FromSqliteOptions<T>): Node<T[]>;
|
|
2107
|
-
/**
|
|
2108
|
-
* Duck-typed iterable-capable SQLite database — `iterate(sql, params)` returns
|
|
2109
|
-
* a synchronous iterator over rows, avoiding the "all-rows-in-memory" cost of
|
|
2110
|
-
* `db.query`. Compatible with `better-sqlite3`'s `.prepare().iterate()`.
|
|
2111
|
-
*
|
|
2112
|
-
* @category extra
|
|
2113
|
-
*/
|
|
2114
|
-
type SqliteIterableDbLike = {
|
|
2115
|
-
iterate(sql: string, params?: unknown[]): Iterable<unknown>;
|
|
2116
|
-
};
|
|
2117
|
-
/**
|
|
2118
|
-
* Cursor-streaming SQLite query — emits one `DATA` per row from a synchronous
|
|
2119
|
-
* row iterator, then `COMPLETE`. Use when result sets are too large to
|
|
2120
|
-
* materialize fully into an array.
|
|
2121
|
-
*
|
|
2122
|
-
* @category extra
|
|
2123
|
-
*/
|
|
2124
|
-
declare function fromSqliteCursor<T = unknown>(db: SqliteIterableDbLike, query: string, opts?: FromSqliteOptions<T>): Node<T>;
|
|
2125
|
-
/** Options for {@link toSqlite}. */
|
|
2126
|
-
type ToSqliteOptions<T> = ExtraOpts & {
|
|
2127
|
-
/** Build SQL + params for an insert. Default: JSON insert into `(data)` column. */
|
|
2128
|
-
toSQL?: (value: T, table: string) => {
|
|
2129
|
-
sql: string;
|
|
2130
|
-
params: unknown[];
|
|
2131
|
-
};
|
|
2132
|
-
onTransportError?: (err: SinkTransportError) => void;
|
|
2133
|
-
/**
|
|
2134
|
-
* When `true`, buffer DATA values and execute all inserts inside a single
|
|
2135
|
-
* `BEGIN`/`COMMIT` transaction when the batch drains. This avoids per-row
|
|
2136
|
-
* fsync overhead and dramatically reduces event-loop blocking for
|
|
2137
|
-
* high-throughput sources. The first insert error stops the batch and
|
|
2138
|
-
* triggers a `ROLLBACK`; the error is reported via `onTransportError`.
|
|
2139
|
-
*/
|
|
2140
|
-
batchInsert?: boolean;
|
|
2141
|
-
/** Auto-flush when buffer reaches this size. Default: `1000`. Only applies when `batchInsert` is `true`. */
|
|
2142
|
-
maxBatchSize?: number;
|
|
2143
|
-
/** Periodic flush interval in ms. `0` = no timer (flush on terminal messages only). Default: `0`. Only applies when `batchInsert` is `true`. */
|
|
2144
|
-
flushIntervalMs?: number;
|
|
2145
|
-
};
|
|
2146
|
-
/**
|
|
2147
|
-
* SQLite sink — inserts each upstream `DATA` value as a row.
|
|
2148
|
-
*
|
|
2149
|
-
* Follows the same pattern as {@link toPostgres} / {@link toMongo}. Since SQLite
|
|
2150
|
-
* is synchronous, errors propagate immediately (no `void promise.catch`).
|
|
2151
|
-
*
|
|
2152
|
-
* @param source - Upstream node.
|
|
2153
|
-
* @param db - SQLite database (caller owns connection).
|
|
2154
|
-
* @param table - Target table name.
|
|
2155
|
-
* @param opts - SQL builder and error options.
|
|
2156
|
-
* @returns Unsubscribe function.
|
|
2157
|
-
*
|
|
2158
|
-
* @example
|
|
2159
|
-
* ```ts
|
|
2160
|
-
* import Database from "better-sqlite3";
|
|
2161
|
-
* import { toSqlite, state } from "@graphrefly/graphrefly-ts";
|
|
2162
|
-
*
|
|
2163
|
-
* const raw = new Database("app.db");
|
|
2164
|
-
* const db = { query: (sql, params) => (raw.prepare(sql).run(...(params ?? [])), []) };
|
|
2165
|
-
* const source = state({ name: "Alice", score: 42 });
|
|
2166
|
-
* const unsub = toSqlite(source, db, "events");
|
|
2167
|
-
* ```
|
|
2168
|
-
*
|
|
2169
|
-
* @category extra
|
|
2170
|
-
*/
|
|
2171
|
-
declare function toSqlite<T>(source: Node<T>, db: SqliteDbLike, table: string, opts?: ToSqliteOptions<T>): ReactiveSinkHandle<T>;
|
|
2172
|
-
/**
|
|
2173
|
-
* Duck-typed Prisma model delegate.
|
|
2174
|
-
*
|
|
2175
|
-
* Compatible with any Prisma model's `findMany` method (e.g. `prisma.user`).
|
|
2176
|
-
* The consumer passes the model delegate directly — no dependency on `@prisma/client`.
|
|
2177
|
-
*/
|
|
2178
|
-
type PrismaModelLike<T = unknown> = {
|
|
2179
|
-
findMany(args?: unknown): Promise<T[]>;
|
|
2180
|
-
};
|
|
2181
|
-
/** Options for {@link fromPrisma}. */
|
|
2182
|
-
type FromPrismaOptions<T, U = T> = ExtraOpts & {
|
|
2183
|
-
/** Prisma `findMany` args (where, orderBy, select, include, take, skip, etc.). */
|
|
2184
|
-
args?: unknown;
|
|
2185
|
-
/** Map each row to the desired shape. Default: identity cast. */
|
|
2186
|
-
mapRow?: (row: T) => U;
|
|
2187
|
-
};
|
|
2188
|
-
/**
|
|
2189
|
-
* One-shot Prisma query as a reactive source.
|
|
2190
|
-
*
|
|
2191
|
-
* Calls `model.findMany(args)`, emits one `DATA` per result row, then `COMPLETE`.
|
|
2192
|
-
* Compose with `switchMap` + `fromTimer` for periodic re-query.
|
|
2193
|
-
*
|
|
2194
|
-
* @param model - Prisma model delegate (e.g. `prisma.user`).
|
|
2195
|
-
* @param opts - `findMany` args, row mapper, and node options.
|
|
2196
|
-
* @returns `Node<U>` — one `DATA` per row, then `COMPLETE`.
|
|
2197
|
-
*
|
|
2198
|
-
* @example
|
|
2199
|
-
* ```ts
|
|
2200
|
-
* import { PrismaClient } from "@prisma/client";
|
|
2201
|
-
* import { fromPrisma } from "@graphrefly/graphrefly-ts";
|
|
2202
|
-
*
|
|
2203
|
-
* const prisma = new PrismaClient();
|
|
2204
|
-
* const activeUsers = fromPrisma(prisma.user, {
|
|
2205
|
-
* args: { where: { active: true } },
|
|
2206
|
-
* });
|
|
2207
|
-
* ```
|
|
2208
|
-
*
|
|
2209
|
-
* @category extra
|
|
2210
|
-
*/
|
|
2211
|
-
declare function fromPrisma<T = unknown, U = T>(model: PrismaModelLike<T>, opts?: FromPrismaOptions<T, U>): Node<U[]>;
|
|
2212
|
-
/**
|
|
2213
|
-
* Duck-typed Drizzle query builder result.
|
|
2214
|
-
*
|
|
2215
|
-
* Drizzle query builders (e.g. `db.select().from(users)`) expose `.execute()`
|
|
2216
|
-
* which returns `Promise<T[]>`. This interface captures that contract without
|
|
2217
|
-
* depending on `drizzle-orm`.
|
|
2218
|
-
*/
|
|
2219
|
-
type DrizzleQueryLike<T = unknown> = {
|
|
2220
|
-
execute(): Promise<T[]>;
|
|
2221
|
-
};
|
|
2222
|
-
/** Options for {@link fromDrizzle}. */
|
|
2223
|
-
type FromDrizzleOptions<T, U = T> = ExtraOpts & {
|
|
2224
|
-
/** Map each row to the desired shape. Default: identity cast. */
|
|
2225
|
-
mapRow?: (row: T) => U;
|
|
2226
|
-
};
|
|
2227
|
-
/**
|
|
2228
|
-
* One-shot Drizzle query as a reactive source.
|
|
2229
|
-
*
|
|
2230
|
-
* Calls `query.execute()`, emits one `DATA` per result row, then `COMPLETE`.
|
|
2231
|
-
* Compose with `switchMap` + `fromTimer` for periodic re-query.
|
|
2232
|
-
*
|
|
2233
|
-
* @param query - Drizzle query builder (e.g. `db.select().from(users).where(...)`).
|
|
2234
|
-
* @param opts - Row mapper and node options.
|
|
2235
|
-
* @returns `Node<U>` — one `DATA` per row, then `COMPLETE`.
|
|
2236
|
-
*
|
|
2237
|
-
* @example
|
|
2238
|
-
* ```ts
|
|
2239
|
-
* import { drizzle } from "drizzle-orm/node-postgres";
|
|
2240
|
-
* import { fromDrizzle } from "@graphrefly/graphrefly-ts";
|
|
2241
|
-
*
|
|
2242
|
-
* const db = drizzle(pool);
|
|
2243
|
-
* const rows$ = fromDrizzle(db.select().from(users).where(eq(users.active, true)));
|
|
2244
|
-
* ```
|
|
2245
|
-
*
|
|
2246
|
-
* @category extra
|
|
2247
|
-
*/
|
|
2248
|
-
declare function fromDrizzle<T = unknown, U = T>(query: DrizzleQueryLike<T>, opts?: FromDrizzleOptions<T, U>): Node<U[]>;
|
|
2249
|
-
/**
|
|
2250
|
-
* Duck-typed Kysely query builder result.
|
|
2251
|
-
*
|
|
2252
|
-
* Kysely query builders expose `.execute()` which returns `Promise<T[]>`.
|
|
2253
|
-
* This interface captures that contract without depending on `kysely`.
|
|
2254
|
-
*/
|
|
2255
|
-
type KyselyQueryLike<T = unknown> = {
|
|
2256
|
-
execute(): Promise<T[]>;
|
|
2257
|
-
};
|
|
2258
|
-
/** Options for {@link fromKysely}. */
|
|
2259
|
-
type FromKyselyOptions<T, U = T> = ExtraOpts & {
|
|
2260
|
-
/** Map each row to the desired shape. Default: identity cast. */
|
|
2261
|
-
mapRow?: (row: T) => U;
|
|
2262
|
-
};
|
|
2263
|
-
/**
|
|
2264
|
-
* One-shot Kysely query as a reactive source.
|
|
2265
|
-
*
|
|
2266
|
-
* Calls `query.execute()`, emits one `DATA` per result row, then `COMPLETE`.
|
|
2267
|
-
* Compose with `switchMap` + `fromTimer` for periodic re-query.
|
|
2268
|
-
*
|
|
2269
|
-
* @param query - Kysely query builder (e.g. `db.selectFrom("users").selectAll()`).
|
|
2270
|
-
* @param opts - Row mapper and node options.
|
|
2271
|
-
* @returns `Node<U>` — one `DATA` per row, then `COMPLETE`.
|
|
2272
|
-
*
|
|
2273
|
-
* @example
|
|
2274
|
-
* ```ts
|
|
2275
|
-
* import { Kysely, PostgresDialect } from "kysely";
|
|
2276
|
-
* import { fromKysely } from "@graphrefly/graphrefly-ts";
|
|
2277
|
-
*
|
|
2278
|
-
* const db = new Kysely<DB>({ dialect: new PostgresDialect({ pool }) });
|
|
2279
|
-
* const rows$ = fromKysely(db.selectFrom("users").selectAll().where("active", "=", true));
|
|
2280
|
-
* ```
|
|
2281
|
-
*
|
|
2282
|
-
* @category extra
|
|
2283
|
-
*/
|
|
2284
|
-
declare function fromKysely<T = unknown, U = T>(query: KyselyQueryLike<T>, opts?: FromKyselyOptions<T, U>): Node<U[]>;
|
|
2285
|
-
|
|
2286
|
-
/**
|
|
2287
|
-
* Watermark-based backpressure controller — reactive PAUSE/RESUME flow control.
|
|
2288
|
-
*
|
|
2289
|
-
* Purely synchronous, event-driven. No timers, no polling, no Promises.
|
|
2290
|
-
* Each controller instance uses a unique lockId so multiple controllers
|
|
2291
|
-
* on the same upstream node do not collide.
|
|
2292
|
-
*
|
|
2293
|
-
* @module
|
|
2294
|
-
*/
|
|
2295
|
-
|
|
2296
|
-
type WatermarkOptions = {
|
|
2297
|
-
/** Pending count at which PAUSE is sent upstream. */
|
|
2298
|
-
highWaterMark: number;
|
|
2299
|
-
/** Pending count at which RESUME is sent upstream (after being paused). */
|
|
2300
|
-
lowWaterMark: number;
|
|
2301
|
-
};
|
|
2302
|
-
type WatermarkController = {
|
|
2303
|
-
/** Call when a DATA message is buffered/enqueued. Returns `true` if PAUSE was just sent. */
|
|
2304
|
-
onEnqueue(): boolean;
|
|
2305
|
-
/** Call when a buffered item is consumed. Returns `true` if RESUME was just sent. */
|
|
2306
|
-
onDequeue(): boolean;
|
|
2307
|
-
/** Current un-consumed item count. */
|
|
2308
|
-
readonly pending: number;
|
|
2309
|
-
/** Whether upstream is currently paused by this controller. */
|
|
2310
|
-
readonly paused: boolean;
|
|
2311
|
-
/** Dispose: if paused, sends RESUME to unblock upstream. */
|
|
2312
|
-
dispose(): void;
|
|
2313
|
-
};
|
|
2314
|
-
/**
|
|
2315
|
-
* Creates a watermark-based backpressure controller.
|
|
2316
|
-
*
|
|
2317
|
-
* @param sendUp - Callback that delivers messages upstream (typically `handle.up`).
|
|
2318
|
-
* @param opts - High/low watermark thresholds (item counts).
|
|
2319
|
-
* @returns A {@link WatermarkController}.
|
|
2320
|
-
*
|
|
2321
|
-
* @example
|
|
2322
|
-
* ```ts
|
|
2323
|
-
* const handle = graph.observe("fast-source");
|
|
2324
|
-
* const wm = createWatermarkController(
|
|
2325
|
-
* (msgs) => handle.up(msgs),
|
|
2326
|
-
* { highWaterMark: 64, lowWaterMark: 16 },
|
|
2327
|
-
* );
|
|
2328
|
-
*
|
|
2329
|
-
* // In sink callback:
|
|
2330
|
-
* handle.subscribe((msgs) => {
|
|
2331
|
-
* for (const msg of msgs) {
|
|
2332
|
-
* if (msg[0] === DATA) {
|
|
2333
|
-
* buffer.push(msg[1]);
|
|
2334
|
-
* wm.onEnqueue();
|
|
2335
|
-
* }
|
|
2336
|
-
* }
|
|
2337
|
-
* });
|
|
2338
|
-
*
|
|
2339
|
-
* // When consumer drains:
|
|
2340
|
-
* const item = buffer.shift();
|
|
2341
|
-
* wm.onDequeue();
|
|
2342
|
-
* ```
|
|
2343
|
-
*
|
|
2344
|
-
* @category extra
|
|
2345
|
-
*/
|
|
2346
|
-
declare function createWatermarkController(sendUp: (messages: Messages) => void, opts: WatermarkOptions): WatermarkController;
|
|
2347
|
-
|
|
2348
|
-
/** Pluggable eviction policy for {@link cascadingCache}. */
|
|
2349
|
-
interface CacheEvictionPolicy<K> {
|
|
2350
|
-
insert(key: K): void;
|
|
2351
|
-
touch(key: K): void;
|
|
2352
|
-
delete(key: K): void;
|
|
2353
|
-
evict(count: number): K[];
|
|
2354
|
-
size(): number;
|
|
2355
|
-
}
|
|
2356
|
-
/**
|
|
2357
|
-
* LRU eviction policy backed by a doubly-linked list + Map.
|
|
2358
|
-
*
|
|
2359
|
-
* @returns An {@link CacheEvictionPolicy} that evicts least-recently-used entries.
|
|
2360
|
-
*
|
|
2361
|
-
* @category extra
|
|
2362
|
-
*/
|
|
2363
|
-
declare function lru<K>(): CacheEvictionPolicy<K>;
|
|
2364
|
-
interface CascadingCacheOptions {
|
|
2365
|
-
/** Max entries before eviction. 0 = unlimited (default). */
|
|
2366
|
-
maxSize?: number;
|
|
2367
|
-
/** Eviction policy. Default: LRU. Only used when maxSize > 0. */
|
|
2368
|
-
eviction?: CacheEvictionPolicy<string>;
|
|
2369
|
-
/** Write-through: save() writes to all tiers, not just tier 0. Default: false. */
|
|
2370
|
-
writeThrough?: boolean;
|
|
2371
|
-
}
|
|
2372
|
-
interface CascadingCache<V> {
|
|
2373
|
-
/** Get or create a singleton state node for this key. Cascades tiers on miss. */
|
|
2374
|
-
load(key: string): Node<V | undefined>;
|
|
2375
|
-
/** Write value to tier(s) and update cache node in-place. */
|
|
2376
|
-
save(key: string, value: V): void;
|
|
2377
|
-
/** Re-cascade tiers into the existing cache node (subscribers see the update). */
|
|
2378
|
-
invalidate(key: string): void;
|
|
2379
|
-
/** Remove from all tiers, teardown the node, and delete cache entry. */
|
|
2380
|
-
delete(key: string): void;
|
|
2381
|
-
/** Check if key exists in cache map. */
|
|
2382
|
-
has(key: string): boolean;
|
|
2383
|
-
/** Number of cached entries. */
|
|
2384
|
-
readonly size: number;
|
|
2385
|
-
}
|
|
2386
|
-
/**
|
|
2387
|
-
* Creates a singleton reactive cache with N-tier cascading lookup.
|
|
2388
|
-
*
|
|
2389
|
-
* Each cached entry is a `state()` node. On cache miss, tiers are tried in order
|
|
2390
|
-
* (index 0 = hottest/fastest). When a lower tier hits, the value is auto-promoted
|
|
2391
|
-
* to all faster tiers. Concurrent loads for the same key share the same state
|
|
2392
|
-
* instance — natural dedup.
|
|
2393
|
-
*
|
|
2394
|
-
* **Sync vs async tiers:** if `tier.load` returns a plain value, the cache node
|
|
2395
|
-
* cache is populated synchronously (`c.load("k").cache` is readable immediately).
|
|
2396
|
-
* If it returns a `Promise`, the node emits `DATA` when the promise resolves.
|
|
2397
|
-
*
|
|
2398
|
-
* **Miss sentinel:** `undefined` and `null` are both treated as misses — the
|
|
2399
|
-
* cascade continues to the next tier.
|
|
2400
|
-
*
|
|
2401
|
-
* @param tiers - Ordered lookup tiers, hottest first.
|
|
2402
|
-
* @param opts - Optional configuration (maxSize, eviction policy, writeThrough).
|
|
2403
|
-
* @returns A reactive cache where each entry is a `Node<V | undefined>`.
|
|
2404
|
-
*
|
|
2405
|
-
* @example
|
|
2406
|
-
* ```ts
|
|
2407
|
-
* import { cascadingCache, memoryKv, fileKv } from "@graphrefly/graphrefly-ts";
|
|
2408
|
-
*
|
|
2409
|
-
* const cache = cascadingCache<User>([memoryKv(), fileKv("./cache")]);
|
|
2410
|
-
* const user = cache.load("user:42"); // Node<User | undefined>
|
|
2411
|
-
* user.subscribe(msgs => console.log(msgs));
|
|
2412
|
-
* ```
|
|
2413
|
-
*
|
|
2414
|
-
* @category extra
|
|
2415
|
-
*/
|
|
2416
|
-
declare function cascadingCache<V = unknown>(tiers: readonly KvStorageTier[], opts?: CascadingCacheOptions): CascadingCache<V>;
|
|
2417
|
-
|
|
2418
|
-
/**
|
|
2419
|
-
* Minimal 5-field cron parser and matcher (minute hour day-of-month month day-of-week).
|
|
2420
|
-
* Ported from callbag-recharge `extra/cron.ts` for `fromCron` (roadmap §2.3).
|
|
2421
|
-
*/
|
|
2422
|
-
interface CronSchedule {
|
|
2423
|
-
minutes: Set<number>;
|
|
2424
|
-
hours: Set<number>;
|
|
2425
|
-
daysOfMonth: Set<number>;
|
|
2426
|
-
months: Set<number>;
|
|
2427
|
-
daysOfWeek: Set<number>;
|
|
2428
|
-
}
|
|
2429
|
-
/**
|
|
2430
|
-
* Parses a standard 5-field cron expression into a {@link CronSchedule}.
|
|
2431
|
-
*
|
|
2432
|
-
* Supports `*`, ranges (`1-5`), steps (`*\/5`, `0-30/10`), and comma-separated
|
|
2433
|
-
* lists. Fields are: minute (0–59), hour (0–23), day-of-month (1–31),
|
|
2434
|
-
* month (1–12), day-of-week (0–6, Sunday = 0).
|
|
2435
|
-
*
|
|
2436
|
-
* @param expr - Five-field whitespace-separated cron string (e.g. `"0 9 * * 1-5"`).
|
|
2437
|
-
* @returns Parsed {@link CronSchedule} with one `Set<number>` per field.
|
|
2438
|
-
* @throws Error when the expression does not have exactly 5 fields, contains
|
|
2439
|
-
* out-of-range values, or uses an invalid step.
|
|
2440
|
-
*
|
|
2441
|
-
* @example
|
|
2442
|
-
* ```ts
|
|
2443
|
-
* import { parseCron } from "@graphrefly/graphrefly-ts";
|
|
2444
|
-
*
|
|
2445
|
-
* const sched = parseCron("0 9 * * 1-5"); // weekdays at 09:00
|
|
2446
|
-
* sched.hours; // Set { 9 }
|
|
2447
|
-
* sched.daysOfWeek; // Set { 1, 2, 3, 4, 5 }
|
|
2448
|
-
* ```
|
|
2449
|
-
*/
|
|
2450
|
-
declare function parseCron(expr: string): CronSchedule;
|
|
2451
|
-
/**
|
|
2452
|
-
* Returns `true` if `date` satisfies every field of `schedule`.
|
|
2453
|
-
*
|
|
2454
|
-
* @param schedule - Parsed schedule from {@link parseCron}.
|
|
2455
|
-
* @param date - Moment to test (local time via `getMinutes`, `getHours`, etc.).
|
|
2456
|
-
* @returns `true` when all five cron fields match the given date.
|
|
2457
|
-
*
|
|
2458
|
-
* @example
|
|
2459
|
-
* ```ts
|
|
2460
|
-
* import { parseCron, matchesCron } from "@graphrefly/graphrefly-ts";
|
|
2461
|
-
*
|
|
2462
|
-
* const sched = parseCron("30 8 * * 1"); // Mondays at 08:30
|
|
2463
|
-
* const monday = new Date("2026-03-30T08:30:00"); // a Monday
|
|
2464
|
-
* matchesCron(sched, monday); // true
|
|
2465
|
-
* ```
|
|
2466
|
-
*/
|
|
2467
|
-
declare function matchesCron(schedule: CronSchedule, date: Date): boolean;
|
|
2468
|
-
|
|
2469
|
-
/**
|
|
2470
|
-
* HTTP error builder — companion to {@link ./adapters.ts}'s `fromHTTP` /
|
|
2471
|
-
* `fromHTTPStream` / `toHTTP`. Pure, zero-dep function that turns a failed
|
|
2472
|
-
* `Response` into an `Error` exposing the `{status, headers, message}` shape
|
|
2473
|
-
* that `HttpErrorLike` consumers (rate-limit parsers, retry predicates,
|
|
2474
|
-
* observability layers) expect.
|
|
2475
|
-
*
|
|
2476
|
-
* Universal tier — safe for browser and Node. No Node-only imports.
|
|
2477
|
-
*/
|
|
2478
|
-
/**
|
|
2479
|
-
* Construct an `Error` carrying `status` + `headers` fields from a non-ok
|
|
2480
|
-
* `Response`. Reads the body with `resp.text()` for diagnostic context; a
|
|
2481
|
-
* body read failure is swallowed (empty string) so the returned error always
|
|
2482
|
-
* reflects the original status/statusText at minimum.
|
|
2483
|
-
*
|
|
2484
|
-
* @param resp - The offending `Response` object.
|
|
2485
|
-
* @param provider - Optional prefix (e.g. `"Anthropic"`, `"openai"`) used in
|
|
2486
|
-
* the error message. Defaults to `"HTTP"`.
|
|
2487
|
-
* @returns An `Error` whose `message` is `"${provider} API <status>: <statusText>[ — body]"`,
|
|
2488
|
-
* with `status: number` and `headers: Headers` attached.
|
|
2489
|
-
*
|
|
2490
|
-
* @category extra
|
|
2491
|
-
*/
|
|
2492
|
-
declare function makeHttpError(resp: Response, provider?: string): Promise<Error>;
|
|
2493
|
-
|
|
2494
|
-
/**
|
|
2495
|
-
* Metadata helpers for pattern-layer nodes (Tier 2.2 promotion from
|
|
2496
|
-
* `patterns/_internal/`).
|
|
2497
|
-
*
|
|
2498
|
-
* Each domain (orchestration, messaging, reduction, ai, cqrs, domain_template,
|
|
2499
|
-
* memory, lens, audit, harness) shares the same metadata convention. Promoted
|
|
2500
|
-
* to `extra/` so non-patterns code (and downstream consumers building their
|
|
2501
|
-
* own domain primitives) can use the same shape.
|
|
2502
|
-
*
|
|
2503
|
-
* @module
|
|
2504
|
-
*/
|
|
2505
|
-
/**
|
|
2506
|
-
* Build a domain metadata object for pattern-layer nodes.
|
|
2507
|
-
*
|
|
2508
|
-
* Each domain follows the same shape: `{ [domain]: true, [domain]_type: kind, ...extra }`.
|
|
2509
|
-
*
|
|
2510
|
-
* @param domain - The domain tag (e.g. `"orchestration"`, `"ai"`, `"cqrs"`).
|
|
2511
|
-
* @param kind - The specific type within the domain (e.g. `"gate"`, `"prompt"`).
|
|
2512
|
-
* @param extra - Additional metadata to merge.
|
|
2513
|
-
* @returns Metadata object.
|
|
2514
|
-
*/
|
|
2515
|
-
declare function domainMeta(domain: string, kind: string, extra?: Record<string, unknown>): Record<string, unknown>;
|
|
2516
|
-
|
|
2517
|
-
/**
|
|
2518
|
-
* Lazy per-topic state hub (roadmap §3.2) — lightweight last-value broadcasts.
|
|
2519
|
-
*
|
|
2520
|
-
* Each topic is a sentinel `node<unknown>()` with push-on-subscribe replay of
|
|
2521
|
-
* the most recent published value (no push until the first `publish`). For
|
|
2522
|
-
* Pulsar-inspired retained message logs,
|
|
2523
|
-
* cursor-based subscriptions, and job-queue semantics, use `messagingHub()` in
|
|
2524
|
-
* `patterns/messaging.ts` — built on `TopicGraph` / `SubscriptionGraph` with
|
|
2525
|
-
* retention policies, absolute cursor tracking, and per-subscriber state.
|
|
2526
|
-
*
|
|
2527
|
-
* **Wave 4 refactor (2026-04-15):** Introduces `PubSubBackend` (thin registry
|
|
2528
|
-
* with version counter). Converts class-based hub to closure factory for
|
|
2529
|
-
* consistency with other `extra/` factories. New bundle APIs: `has(name)`,
|
|
2530
|
-
* `size`, `topicNames()`, `publishMany(entries)`. `removeTopic` → `TEARDOWN`
|
|
2531
|
-
* semantics preserved.
|
|
2532
|
-
*/
|
|
2533
|
-
|
|
2534
|
-
/**
|
|
2535
|
-
* Storage contract for {@link pubsub} — registry only.
|
|
2536
|
-
*
|
|
2537
|
-
* Tracks the set of topic names plus a monotonic `version` counter that
|
|
2538
|
-
* advances on topic create/remove. Does NOT own per-topic message storage —
|
|
2539
|
-
* per-topic cached last values live in the topic nodes themselves (sentinel
|
|
2540
|
-
* until the first publish).
|
|
2541
|
-
*
|
|
2542
|
-
* For distributed / persistent per-topic storage, use `messagingHub()` in
|
|
2543
|
-
* `patterns/messaging.ts`, which composes `TopicGraph` under a lazy registry.
|
|
2544
|
-
*
|
|
2545
|
-
* @category extra
|
|
2546
|
-
*/
|
|
2547
|
-
interface PubSubBackend {
|
|
2548
|
-
/** Monotonic counter; advances on topic create/remove. */
|
|
2549
|
-
readonly version: number;
|
|
2550
|
-
readonly topicCount: number;
|
|
2551
|
-
hasTopic(name: string): boolean;
|
|
2552
|
-
topicNames(): IterableIterator<string>;
|
|
2553
|
-
/** Records topic creation. Returns `true` if newly added (advances `version`). */
|
|
2554
|
-
createTopic(name: string): boolean;
|
|
2555
|
-
/** Records topic removal. Returns `true` if it existed (advances `version`). */
|
|
2556
|
-
removeTopic(name: string): boolean;
|
|
2557
|
-
}
|
|
2558
|
-
/**
|
|
2559
|
-
* Default in-memory registry backend.
|
|
2560
|
-
*
|
|
2561
|
-
* @category extra
|
|
2562
|
-
*/
|
|
2563
|
-
declare class NativePubSubBackend implements PubSubBackend {
|
|
2564
|
-
private _version;
|
|
2565
|
-
private readonly _topics;
|
|
2566
|
-
get version(): number;
|
|
2567
|
-
get topicCount(): number;
|
|
2568
|
-
hasTopic(name: string): boolean;
|
|
2569
|
-
topicNames(): IterableIterator<string>;
|
|
2570
|
-
createTopic(name: string): boolean;
|
|
2571
|
-
removeTopic(name: string): boolean;
|
|
2572
|
-
}
|
|
2573
|
-
type PubSubHubOptions = {
|
|
2574
|
-
/**
|
|
2575
|
-
* Storage backend. Defaults to `NativePubSubBackend`. Pluggable for audit /
|
|
2576
|
-
* monitoring / mirror-to-external-broker use cases.
|
|
2577
|
-
*/
|
|
2578
|
-
backend?: PubSubBackend;
|
|
2579
|
-
};
|
|
2580
|
-
/**
|
|
2581
|
-
* Lazy per-topic state hub. Topics are single-value sentinel nodes
|
|
2582
|
-
* with push-on-subscribe replay of the most recent publish.
|
|
2583
|
-
*
|
|
2584
|
-
* @category extra
|
|
2585
|
-
*/
|
|
2586
|
-
interface PubSubHub {
|
|
2587
|
-
/**
|
|
2588
|
-
* Returns the topic node, creating it on first use.
|
|
2589
|
-
*
|
|
2590
|
-
* @param name - Topic key.
|
|
2591
|
-
* @returns `Node` whose value is the last published payload. Starts in
|
|
2592
|
-
* sentinel state — no push-on-subscribe until the first publish.
|
|
2593
|
-
*/
|
|
2594
|
-
topic(name: string): Node<unknown>;
|
|
2595
|
-
/** Publishes a value to the topic (lazily creating the topic if missing). */
|
|
2596
|
-
publish(name: string, value: unknown): void;
|
|
2597
|
-
/**
|
|
2598
|
-
* Bulk publish — single outer batch for all entries. No-op if empty.
|
|
2599
|
-
*
|
|
2600
|
-
* **Iterable consumption (F6):** `entries` is consumed once (single-pass).
|
|
2601
|
-
* Pass an array or `Set` for multi-shot callers. Iteration happens INSIDE
|
|
2602
|
-
* the batch frame — if the iterator throws mid-way, the batch is discarded
|
|
2603
|
-
* and NO publishes are visible to subscribers (all-or-nothing within one
|
|
2604
|
-
* call).
|
|
2605
|
-
*/
|
|
2606
|
-
publishMany(entries: Iterable<[string, unknown]>): void;
|
|
2607
|
-
/** Removes a topic; sends `TEARDOWN` to its node. Returns `true` if it existed. */
|
|
2608
|
-
removeTopic(name: string): boolean;
|
|
2609
|
-
/** Checks topic existence without creating. O(1). */
|
|
2610
|
-
has(name: string): boolean;
|
|
2611
|
-
/** Number of topics currently registered. O(1). */
|
|
2612
|
-
readonly size: number;
|
|
2613
|
-
/** Iterator over topic names. */
|
|
2614
|
-
topicNames(): IterableIterator<string>;
|
|
2615
|
-
}
|
|
2616
|
-
/**
|
|
2617
|
-
* Creates a lazy per-topic state hub.
|
|
2618
|
-
*
|
|
2619
|
-
* @param options - Optional pluggable `backend` (defaults to `NativePubSubBackend`).
|
|
2620
|
-
* @returns Hub with lazy `topic()` / `publish()` / `publishMany()` / `removeTopic()` /
|
|
2621
|
-
* `has()` / `size` / `topicNames()`.
|
|
2622
|
-
*
|
|
2623
|
-
* @remarks
|
|
2624
|
-
* **Scope:** Each topic is a sentinel node — retains only the last published
|
|
2625
|
-
* value (no push-on-subscribe before the first publish). For Pulsar-inspired
|
|
2626
|
-
* retention + cursor reading, use
|
|
2627
|
-
* `messagingHub()` in `patterns/messaging.ts`.
|
|
2628
|
-
*
|
|
2629
|
-
* **`removeTopic`:** Sends `TEARDOWN` to the topic node; all subscribers receive
|
|
2630
|
-
* the TEARDOWN message. Subsequent `publish(name, value)` silently recreates the
|
|
2631
|
-
* topic with a fresh node — existing subscribers to the old node do NOT reconnect.
|
|
2632
|
-
*
|
|
2633
|
-
* @example
|
|
2634
|
-
* ```ts
|
|
2635
|
-
* import { pubsub } from "@graphrefly/graphrefly-ts";
|
|
2636
|
-
*
|
|
2637
|
-
* const hub = pubsub();
|
|
2638
|
-
* const t = hub.topic("events");
|
|
2639
|
-
* t.subscribe((msgs) => console.log(msgs));
|
|
2640
|
-
* hub.publish("events", { ok: true });
|
|
2641
|
-
* hub.publishMany([["events", 1], ["status", "ready"]]);
|
|
2642
|
-
* ```
|
|
2643
|
-
*
|
|
2644
|
-
* @category extra
|
|
2645
|
-
*/
|
|
2646
|
-
declare function pubsub(options?: PubSubHubOptions): PubSubHub;
|
|
2647
|
-
|
|
2648
|
-
/**
|
|
2649
|
-
* `singleFromAny` — keyed promise/Node de-duplication ("singleflight").
|
|
2650
|
-
*
|
|
2651
|
-
* Given a `factory: (key) => NodeInput<T>`, returns a callable that dedupes
|
|
2652
|
-
* concurrent invocations sharing the same key — all callers with the same
|
|
2653
|
-
* key while a request is in-flight receive the same `Promise<T>`. Once the
|
|
2654
|
-
* underlying source settles (DATA, ERROR, or COMPLETE), the cache entry is
|
|
2655
|
-
* cleared so the next call re-invokes the factory.
|
|
2656
|
-
*
|
|
2657
|
-
* This is the classic "singleflight" pattern from Go, generalised over the
|
|
2658
|
-
* library's `NodeInput<T>` bridge so callers can pass Promise-returning
|
|
2659
|
-
* factories, Node-returning factories, or plain value factories with
|
|
2660
|
-
* identical semantics.
|
|
2661
|
-
*
|
|
2662
|
-
* Use cases:
|
|
2663
|
-
* - `withReplayCache` cache-miss thundering-herd dedup
|
|
2664
|
-
* - Shared HTTP fetches keyed by URL
|
|
2665
|
-
* - Expensive compute keyed by request fingerprint
|
|
2666
|
-
*
|
|
2667
|
-
* @example
|
|
2668
|
-
* ```ts
|
|
2669
|
-
* const fetchUser = singleFromAny<string, User>((id) => fetch(`/users/${id}`).then(r => r.json()));
|
|
2670
|
-
* // Two concurrent callers with id="42" → one underlying fetch, two Promises resolving to the same User.
|
|
2671
|
-
* const [a, b] = await Promise.all([fetchUser("42"), fetchUser("42")]);
|
|
2672
|
-
* ```
|
|
2673
|
-
*
|
|
2674
|
-
* @category extra
|
|
2675
|
-
*/
|
|
2676
|
-
|
|
2677
|
-
interface SingleFromAnyOptions<K> {
|
|
2678
|
-
/**
|
|
2679
|
-
* Convert a typed key into a cache-string. Defaults to `String(key)`, which
|
|
2680
|
-
* works for primitive keys; callers with object keys should provide a
|
|
2681
|
-
* stable serializer (e.g., canonical JSON).
|
|
2682
|
-
*/
|
|
2683
|
-
keyFn?: (key: K) => string;
|
|
2684
|
-
}
|
|
2685
|
-
/**
|
|
2686
|
-
* Dedupe concurrent `factory(key)` invocations. Returns a bound callable.
|
|
2687
|
-
*
|
|
2688
|
-
* @param factory - Produces a `NodeInput<T>` for each unique key.
|
|
2689
|
-
* @param opts - Optional key-stringification.
|
|
2690
|
-
* @returns A function `(key: K) => Promise<T>` whose inflight results are shared per key.
|
|
2691
|
-
*/
|
|
2692
|
-
declare function singleFromAny<K, T>(factory: (key: K) => NodeInput<T>, opts?: SingleFromAnyOptions<K>): (key: K) => Promise<T>;
|
|
2693
|
-
/**
|
|
2694
|
-
* Reactive variant: returns a bound callable that hands out `Node<T>` values.
|
|
2695
|
-
* All concurrent callers with the same key during an in-flight source share
|
|
2696
|
-
* the same Node. When the underlying source **terminally** settles (ERROR
|
|
2697
|
-
* or COMPLETE), the Node is removed from the cache so the next call
|
|
2698
|
-
* re-invokes `factory`. DATA is NOT terminal — callers subscribing after
|
|
2699
|
-
* the first DATA still receive the shared Node (and push-on-subscribe per
|
|
2700
|
-
* the spec's cached-DATA contract).
|
|
2701
|
-
*
|
|
2702
|
-
* Use when downstream wants reactive subscription (not a one-shot Promise).
|
|
2703
|
-
*
|
|
2704
|
-
* @category extra
|
|
2705
|
-
*/
|
|
2706
|
-
declare function singleNodeFromAny<K, T>(factory: (key: K) => NodeInput<T>, opts?: SingleFromAnyOptions<K>): (key: K) => Node<T>;
|
|
2707
|
-
|
|
2708
|
-
/**
|
|
2709
|
-
* stratify — reactive branch routing over a classifier rule set.
|
|
2710
|
-
*
|
|
2711
|
-
* Protocol-level primitive (no domain assumptions) that routes a source value
|
|
2712
|
-
* to independent branch subgraphs. Rules are reactive — update the `"rules"`
|
|
2713
|
-
* state node to rewrite classification at runtime. Rule updates affect
|
|
2714
|
-
* **future items only** (streaming semantics, not retroactive).
|
|
2715
|
-
*
|
|
2716
|
-
* @module
|
|
2717
|
-
*/
|
|
2718
|
-
|
|
2719
|
-
/** A single routing rule for {@link stratify}. */
|
|
2720
|
-
type StratifyRule<T> = {
|
|
2721
|
-
/** Branch name (used as node name under `branch/<name>`). */
|
|
2722
|
-
name: string;
|
|
2723
|
-
/** Classifier: returns `true` if the value belongs to this branch. */
|
|
2724
|
-
classify: (value: T) => boolean;
|
|
2725
|
-
/** Optional operator chain applied to the branch after classification. */
|
|
2726
|
-
ops?: (n: Node<T>) => Node;
|
|
2727
|
-
};
|
|
2728
|
-
/** Options for {@link stratify}. */
|
|
2729
|
-
type StratifyOptions = GraphOptions & {
|
|
2730
|
-
meta?: Record<string, unknown>;
|
|
2731
|
-
};
|
|
2732
|
-
/**
|
|
2733
|
-
* Route input to different branches based on classifier functions.
|
|
2734
|
-
*
|
|
2735
|
-
* Each branch gets an independent operator chain. Branch nodes are structural —
|
|
2736
|
-
* created at construction time and persist for the graph's lifetime. If a rule
|
|
2737
|
-
* name is removed from the rules array, the corresponding branch silently
|
|
2738
|
-
* drops items (classifier not found). To tear down a dead branch, call
|
|
2739
|
-
* `graph.remove("branch/<name>")`.
|
|
2740
|
-
*
|
|
2741
|
-
* @param name - Graph name.
|
|
2742
|
-
* @param source - Input node (registered as `"source"`).
|
|
2743
|
-
* @param rules - Initial routing rules.
|
|
2744
|
-
* @param opts - Optional graph/meta options.
|
|
2745
|
-
* @returns Graph with `"source"`, `"rules"`, and `"branch/<name>"` nodes.
|
|
2746
|
-
*
|
|
2747
|
-
* @category extra
|
|
2748
|
-
*/
|
|
2749
|
-
declare function stratify<T>(name: string, source: Node<T>, rules: ReadonlyArray<StratifyRule<T>>, opts?: StratifyOptions): Graph;
|
|
2750
|
-
|
|
2751
|
-
/**
|
|
2752
|
-
* Creates a resettable deadline timer for internal timeout, retry, and rate-limiting use.
|
|
2753
|
-
*
|
|
2754
|
-
* @remarks **Centralised primitive:** wraps `setTimeout`/`clearTimeout` with a generation guard
|
|
2755
|
-
* so that stale callbacks never fire after `cancel()` or a new `start()`.
|
|
2756
|
-
*
|
|
2757
|
-
* @remarks **Spec §5.10 exception:** resilience operators (`timeout`, `retry`, `rateLimiter`)
|
|
2758
|
-
* need raw timers — `fromTimer` creates a new Node per reset, which is too heavy here.
|
|
2759
|
-
* Lives in `src/extra/` (not `src/core/`) because it is a documented escape hatch from
|
|
2760
|
-
* the protocol-pure core layer.
|
|
2761
|
-
*
|
|
2762
|
-
* @example
|
|
2763
|
-
* ```ts
|
|
2764
|
-
* import { ResettableTimer } from "@graphrefly/graphrefly-ts";
|
|
2765
|
-
*
|
|
2766
|
-
* const timer = new ResettableTimer();
|
|
2767
|
-
* timer.start(1000, () => console.log("fired"));
|
|
2768
|
-
* timer.cancel(); // cancels before firing
|
|
2769
|
-
* timer.start(500, () => console.log("new deadline"));
|
|
2770
|
-
* console.log(timer.pending); // true
|
|
2771
|
-
* ```
|
|
2772
|
-
*
|
|
2773
|
-
* @category extra
|
|
2774
|
-
*/
|
|
2775
|
-
declare class ResettableTimer {
|
|
2776
|
-
private _timer;
|
|
2777
|
-
private _gen;
|
|
2778
|
-
/** Schedule callback after delayMs. Cancels any pending timer. */
|
|
2779
|
-
start(delayMs: number, callback: () => void): void;
|
|
2780
|
-
/** Cancel the pending timer (if any). */
|
|
2781
|
-
cancel(): void;
|
|
2782
|
-
/** Whether a timer is currently pending. */
|
|
2783
|
-
get pending(): boolean;
|
|
2784
|
-
}
|
|
2785
|
-
|
|
2786
|
-
/**
|
|
2787
|
-
* WorkerTransport — normalized message channel for all worker types.
|
|
2788
|
-
*
|
|
2789
|
-
* Abstracts Worker, SharedWorker, ServiceWorker, BroadcastChannel, and
|
|
2790
|
-
* MessagePort behind a uniform post/listen/terminate interface.
|
|
2791
|
-
*/
|
|
2792
|
-
/** Normalized bidirectional message channel. */
|
|
2793
|
-
interface WorkerTransport {
|
|
2794
|
-
/** Send data to the other side. Optional transferables for zero-copy. */
|
|
2795
|
-
post(data: unknown, transfer?: Transferable[]): void;
|
|
2796
|
-
/** Listen for incoming messages. Returns unsubscribe function. */
|
|
2797
|
-
listen(handler: (data: unknown) => void): () => void;
|
|
2798
|
-
/** Terminate the connection (if supported by the underlying transport). */
|
|
2799
|
-
terminate?(): void;
|
|
2800
|
-
}
|
|
2801
|
-
/**
|
|
2802
|
-
* Auto-detect transport type and create a normalized WorkerTransport.
|
|
2803
|
-
*
|
|
2804
|
-
* Supports:
|
|
2805
|
-
* - `Worker` — direct postMessage/onmessage
|
|
2806
|
-
* - `SharedWorker` — port-based postMessage/onmessage
|
|
2807
|
-
* - `ServiceWorker` — postMessage via controller, listen via navigator.serviceWorker
|
|
2808
|
-
* - `BroadcastChannel` — postMessage/onmessage (no Transferable support)
|
|
2809
|
-
* - `MessagePort` — direct postMessage/onmessage (worker-side SharedWorker port)
|
|
2810
|
-
*/
|
|
2811
|
-
declare function createTransport(target: unknown): WorkerTransport;
|
|
2812
|
-
|
|
2813
|
-
/**
|
|
2814
|
-
* workerBridge — main-thread reactive node bridge to a worker.
|
|
2815
|
-
*
|
|
2816
|
-
* Creates proxy nodes for imported worker nodes, subscribes to exposed
|
|
2817
|
-
* nodes and sends values across the wire. Uses derived() + effect() for
|
|
2818
|
-
* natural batch coalescing via two-phase push + bitmask resolution.
|
|
2819
|
-
*
|
|
2820
|
-
* Wire filtering: graph-local signals ({@link isLocalOnly}) stay local;
|
|
2821
|
-
* DATA values go through the coalescing path; RESOLVED, COMPLETE, ERROR,
|
|
2822
|
-
* TEARDOWN, and unknown {@link Symbol.for} types go through the signal
|
|
2823
|
-
* subscription.
|
|
2824
|
-
*
|
|
2825
|
-
* Handshake:
|
|
2826
|
-
* 1. Main creates bridge, starts listening
|
|
2827
|
-
* 2. Worker sends { t: 'r', stores: { name: initialValue, ... } }
|
|
2828
|
-
* 3. Main creates proxy nodes, marks meta.status "connected"
|
|
2829
|
-
* 4. Main sends { t: 'i', stores: { name: currentValue, ... } }
|
|
2830
|
-
* 5. Bidirectional value flow begins
|
|
2831
|
-
*/
|
|
2832
|
-
|
|
2833
|
-
interface WorkerBridgeOptions<TExpose extends Record<string, Node<any>>, TImport extends readonly string[]> {
|
|
2834
|
-
/** Nodes to send to the worker. */
|
|
2835
|
-
expose?: TExpose;
|
|
2836
|
-
/** Node names the worker will provide. */
|
|
2837
|
-
import?: TImport;
|
|
2838
|
-
/** Per-node transferable extractors for zero-copy ArrayBuffer passing. */
|
|
2839
|
-
transfer?: Partial<Record<keyof TExpose, (value: any) => Transferable[]>>;
|
|
2840
|
-
/** Debug name. */
|
|
2841
|
-
name?: string;
|
|
2842
|
-
/**
|
|
2843
|
-
* Handshake timeout in milliseconds. If the worker doesn't send READY
|
|
2844
|
-
* within this window, `meta.status` transitions to `"closed"` and
|
|
2845
|
-
* `meta.error` is set. Default: no timeout.
|
|
2846
|
-
*/
|
|
2847
|
-
timeoutMs?: number;
|
|
2848
|
-
}
|
|
2849
|
-
/** Proxy nodes created from imported worker node names. */
|
|
2850
|
-
type ImportedNodes<T extends readonly string[]> = {
|
|
2851
|
-
readonly [K in T[number]]: Node<any>;
|
|
2852
|
-
};
|
|
2853
|
-
type WorkerBridge<_TExpose extends Record<string, Node<any>>, TImport extends readonly string[]> = ImportedNodes<TImport> & {
|
|
2854
|
-
/** Connection status meta node. */
|
|
2855
|
-
meta: {
|
|
2856
|
-
status: Node<"connecting" | "connected" | "closed">;
|
|
2857
|
-
error: Node<Error | null>;
|
|
2858
|
-
};
|
|
2859
|
-
/** Destroy the bridge: sends TEARDOWN, disconnects, terminates worker. */
|
|
2860
|
-
destroy(): void;
|
|
2861
|
-
};
|
|
2862
|
-
declare function workerBridge<TExpose extends Record<string, Node<any>>, TImport extends readonly string[]>(target: unknown | WorkerTransport, opts: WorkerBridgeOptions<TExpose, TImport>): WorkerBridge<TExpose, TImport>;
|
|
2863
|
-
|
|
2864
|
-
/**
|
|
2865
|
-
* Wire protocol for worker bridge communication.
|
|
2866
|
-
*
|
|
2867
|
-
* Graph-local signals ({@link isLocalOnly}) stay local to each side's
|
|
2868
|
-
* reactive graph. DATA values cross via coalescing; RESOLVED/COMPLETE/TEARDOWN
|
|
2869
|
-
* as signals; ERROR as serialized payloads.
|
|
2870
|
-
*
|
|
2871
|
-
* Lifecycle signals serialize as string names since Symbols can't survive
|
|
2872
|
-
* structured clone. Unknown {@link Symbol.for} symbols are round-tripped
|
|
2873
|
-
* via their registered key.
|
|
2874
|
-
*/
|
|
2875
|
-
/** Value update — one node changed. */
|
|
2876
|
-
interface ValueMessage {
|
|
2877
|
-
t: "v";
|
|
2878
|
-
/** Node name. */
|
|
2879
|
-
s: string;
|
|
2880
|
-
/** Serialized value. */
|
|
2881
|
-
d: unknown;
|
|
2882
|
-
}
|
|
2883
|
-
/** Lifecycle signal — serialized symbol name. */
|
|
2884
|
-
interface SignalMessage {
|
|
2885
|
-
t: "s";
|
|
2886
|
-
/** Node name, or `"*"` for bridge-wide. */
|
|
2887
|
-
s: string;
|
|
2888
|
-
/** Signal name string (e.g. "TEARDOWN"). */
|
|
2889
|
-
sig: string;
|
|
2890
|
-
/** Optional payload for custom symbols (spec §1.3.6 forward unchanged). */
|
|
2891
|
-
d?: unknown;
|
|
2892
|
-
}
|
|
2893
|
-
/** Ready — worker declares its exported nodes with initial values. */
|
|
2894
|
-
interface ReadyMessage {
|
|
2895
|
-
t: "r";
|
|
2896
|
-
stores: Record<string, unknown>;
|
|
2897
|
-
}
|
|
2898
|
-
/** Init — main sends initial values of its exposed nodes. */
|
|
2899
|
-
interface InitMessage {
|
|
2900
|
-
t: "i";
|
|
2901
|
-
stores: Record<string, unknown>;
|
|
2902
|
-
}
|
|
2903
|
-
/** Batch value update — multiple nodes changed in one reactive cycle. */
|
|
2904
|
-
interface BatchMessage {
|
|
2905
|
-
t: "b";
|
|
2906
|
-
u: Record<string, unknown>;
|
|
2907
|
-
/** V0 versions per node for delta sync — peer skips if version <= lastSeen (§6.0b). */
|
|
2908
|
-
v?: Record<string, number>;
|
|
2909
|
-
}
|
|
2910
|
-
/** Error payload — serialized since Error objects don't survive structured clone. */
|
|
2911
|
-
interface ErrorMessage {
|
|
2912
|
-
t: "e";
|
|
2913
|
-
/** Node name. */
|
|
2914
|
-
s: string;
|
|
2915
|
-
/** Serialized error. */
|
|
2916
|
-
err: {
|
|
2917
|
-
message: string;
|
|
2918
|
-
name: string;
|
|
2919
|
-
stack?: string;
|
|
2920
|
-
};
|
|
2921
|
-
}
|
|
2922
|
-
type BridgeMessage = ValueMessage | SignalMessage | ReadyMessage | InitMessage | BatchMessage | ErrorMessage;
|
|
2923
|
-
/**
|
|
2924
|
-
* Serialize a message type symbol to a string for structured clone transfer.
|
|
2925
|
-
*
|
|
2926
|
-
* Known GraphReFly symbols map to their canonical names. Unknown symbols
|
|
2927
|
-
* registered via {@link Symbol.for} use their registered key. Unregistered
|
|
2928
|
-
* symbols return `"UNKNOWN"`.
|
|
2929
|
-
*/
|
|
2930
|
-
declare function signalToName(s: symbol): string;
|
|
2931
|
-
/**
|
|
2932
|
-
* Deserialize a string back to a message type symbol.
|
|
2933
|
-
*
|
|
2934
|
-
* Known GraphReFly names map to their canonical symbols. Other non-empty
|
|
2935
|
-
* strings are reconstructed via {@link Symbol.for} (round-trip safe for
|
|
2936
|
-
* custom message types). Returns `undefined` for `"UNKNOWN"`.
|
|
2937
|
-
*/
|
|
2938
|
-
declare function nameToSignal(name: string): symbol | undefined;
|
|
2939
|
-
/** Serialize an error for structured clone transfer. */
|
|
2940
|
-
declare function serializeError(err: unknown): {
|
|
2941
|
-
message: string;
|
|
2942
|
-
name: string;
|
|
2943
|
-
stack?: string;
|
|
2944
|
-
};
|
|
2945
|
-
/** Deserialize an error payload back to an Error object. */
|
|
2946
|
-
declare function deserializeError(payload: {
|
|
2947
|
-
message: string;
|
|
2948
|
-
name: string;
|
|
2949
|
-
stack?: string;
|
|
2950
|
-
}): Error;
|
|
2951
|
-
|
|
2952
|
-
/**
|
|
2953
|
-
* workerSelf — worker-side reactive node bridge.
|
|
2954
|
-
*
|
|
2955
|
-
* Mirror of workerBridge() for the worker side. Creates proxy nodes for
|
|
2956
|
-
* imports from main thread, exposes local nodes via the same wire protocol.
|
|
2957
|
-
* Uses derived() + effect() for batch coalescing.
|
|
2958
|
-
*
|
|
2959
|
-
* Wire filtering: graph-local signals ({@link isLocalOnly}) stay local;
|
|
2960
|
-
* DATA values go through the coalescing path; RESOLVED, COMPLETE, ERROR,
|
|
2961
|
-
* TEARDOWN, and unknown {@link Symbol.for} types go through the signal
|
|
2962
|
-
* subscription.
|
|
2963
|
-
*
|
|
2964
|
-
* Handshake (worker perspective):
|
|
2965
|
-
* 1. workerSelf() called — creates proxy nodes for imports
|
|
2966
|
-
* 2. Runs expose factory with proxy nodes -> gets nodes to expose
|
|
2967
|
-
* 3. Sends { t: 'r', stores: { name: initialValue, ... } } to main
|
|
2968
|
-
* 4. Receives { t: 'i', stores: { name: value, ... } } from main
|
|
2969
|
-
* 5. Updates proxy nodes -> triggers local effects
|
|
2970
|
-
*/
|
|
2971
|
-
|
|
2972
|
-
interface WorkerSelfOptions<TImport extends readonly string[]> {
|
|
2973
|
-
/** Node names that the main thread will provide. */
|
|
2974
|
-
import?: TImport;
|
|
2975
|
-
/** Factory that receives imported proxy nodes and returns nodes to expose. */
|
|
2976
|
-
expose: (imported: WorkerImported<TImport>) => Record<string, Node<any>>;
|
|
2977
|
-
/** Per-node transferable extractors for zero-copy ArrayBuffer passing. */
|
|
2978
|
-
transfer?: Record<string, (value: any) => Transferable[]>;
|
|
2979
|
-
}
|
|
2980
|
-
/** Proxy nodes available inside the worker from main-thread exposed nodes. */
|
|
2981
|
-
type WorkerImported<T extends readonly string[]> = {
|
|
2982
|
-
readonly [K in T[number]]: Node<any>;
|
|
2983
|
-
};
|
|
2984
|
-
interface WorkerSelfHandle {
|
|
2985
|
-
/** Dispose all subscriptions and stop the bridge. */
|
|
2986
|
-
destroy(): void;
|
|
2987
|
-
}
|
|
2988
|
-
declare function workerSelf<TImport extends readonly string[]>(target: unknown | WorkerTransport, opts: WorkerSelfOptions<TImport>): WorkerSelfHandle;
|
|
2989
|
-
|
|
2990
|
-
/**
|
|
2991
|
-
* Extra layer: operators, sources, sinks (Phase 2+).
|
|
2992
|
-
*/
|
|
2993
|
-
|
|
2994
|
-
type index_AckableMessage<T> = AckableMessage<T>;
|
|
2995
|
-
type index_AdapterHandlers<T> = AdapterHandlers<T>;
|
|
2996
|
-
declare const index_AppendCursor: typeof AppendCursor;
|
|
2997
|
-
declare const index_AppendLoadResult: typeof AppendLoadResult;
|
|
2998
|
-
declare const index_AppendLogStorageOptions: typeof AppendLogStorageOptions;
|
|
2999
|
-
declare const index_AppendLogStorageTier: typeof AppendLogStorageTier;
|
|
3000
|
-
declare const index_AsyncSourceOpts: typeof AsyncSourceOpts;
|
|
3001
|
-
declare const index_AuditLogOpts: typeof AuditLogOpts;
|
|
3002
|
-
declare const index_BackoffPreset: typeof BackoffPreset;
|
|
3003
|
-
declare const index_BackoffStrategy: typeof BackoffStrategy;
|
|
3004
|
-
declare const index_BaseAuditRecord: typeof BaseAuditRecord;
|
|
3005
|
-
declare const index_BaseStorageTier: typeof BaseStorageTier;
|
|
3006
|
-
type index_BatchMessage = BatchMessage;
|
|
3007
|
-
type index_BridgeMessage = BridgeMessage;
|
|
3008
|
-
type index_BudgetConstraint<T = unknown> = BudgetConstraint<T>;
|
|
3009
|
-
type index_BudgetGateOptions = BudgetGateOptions;
|
|
3010
|
-
type index_BufferedSinkHandle = BufferedSinkHandle;
|
|
3011
|
-
type index_BundleTriad<TChannels extends Record<string, unknown>> = BundleTriad<TChannels>;
|
|
3012
|
-
type index_CSVRow = CSVRow;
|
|
3013
|
-
type index_CacheEvictionPolicy<K> = CacheEvictionPolicy<K>;
|
|
3014
|
-
type index_CascadingCache<V> = CascadingCache<V>;
|
|
3015
|
-
type index_CascadingCacheOptions = CascadingCacheOptions;
|
|
3016
|
-
type index_CheckpointToRedisOptions = CheckpointToRedisOptions;
|
|
3017
|
-
type index_CheckpointToS3Options = CheckpointToS3Options;
|
|
3018
|
-
declare const index_CircuitBreaker: typeof CircuitBreaker;
|
|
3019
|
-
declare const index_CircuitBreakerOptions: typeof CircuitBreakerOptions;
|
|
3020
|
-
declare const index_CircuitOpenError: typeof CircuitOpenError;
|
|
3021
|
-
declare const index_CircuitState: typeof CircuitState;
|
|
3022
|
-
type index_ClickHouseClientLike = ClickHouseClientLike;
|
|
3023
|
-
type index_ClickHouseInsertClientLike = ClickHouseInsertClientLike;
|
|
3024
|
-
type index_ClickHouseRow = ClickHouseRow;
|
|
3025
|
-
declare const index_Codec: typeof Codec;
|
|
3026
|
-
declare const index_ContentAddressedMissError: typeof ContentAddressedMissError;
|
|
3027
|
-
declare const index_ContentAddressedMode: typeof ContentAddressedMode;
|
|
3028
|
-
declare const index_ContentAddressedStorage: typeof ContentAddressedStorage;
|
|
3029
|
-
declare const index_ContentAddressedStorageOptions: typeof ContentAddressedStorageOptions;
|
|
3030
|
-
type index_CronSchedule = CronSchedule;
|
|
3031
|
-
declare const index_DEFAULT_AUDIT_GUARD: typeof DEFAULT_AUDIT_GUARD;
|
|
3032
|
-
declare const index_DescribeChangeset: typeof DescribeChangeset;
|
|
3033
|
-
declare const index_DescribeEvent: typeof DescribeEvent;
|
|
3034
|
-
declare const index_DistillBundle: typeof DistillBundle;
|
|
3035
|
-
declare const index_DistillOptions: typeof DistillOptions;
|
|
3036
|
-
type index_DrizzleQueryLike<T = unknown> = DrizzleQueryLike<T>;
|
|
3037
|
-
type index_EmitTriad<T> = EmitTriad<T>;
|
|
3038
|
-
type index_ErrorMessage = ErrorMessage;
|
|
3039
|
-
declare const index_EventTargetLike: typeof EventTargetLike;
|
|
3040
|
-
declare const index_ExponentialBackoffOptions: typeof ExponentialBackoffOptions;
|
|
3041
|
-
type index_ExternalBundleOptions<TChannels extends Record<string, unknown>> = ExternalBundleOptions<TChannels>;
|
|
3042
|
-
type index_ExternalRegister<H> = ExternalRegister<H>;
|
|
3043
|
-
declare const index_Extraction: typeof Extraction;
|
|
3044
|
-
declare const index_FailureMeta: typeof FailureMeta;
|
|
3045
|
-
declare const index_FallbackInput: typeof FallbackInput;
|
|
3046
|
-
type index_FileWriterLike = FileWriterLike;
|
|
3047
|
-
type index_FromCSVOptions = FromCSVOptions;
|
|
3048
|
-
type index_FromClickHouseWatchOptions = FromClickHouseWatchOptions;
|
|
3049
|
-
declare const index_FromCronOptions: typeof FromCronOptions;
|
|
3050
|
-
type index_FromDrizzleOptions<T, U = T> = FromDrizzleOptions<T, U>;
|
|
3051
|
-
type index_FromHTTPOptions = FromHTTPOptions;
|
|
3052
|
-
type index_FromHTTPPollOptions = FromHTTPPollOptions;
|
|
3053
|
-
type index_FromHTTPStreamOptions = FromHTTPStreamOptions;
|
|
3054
|
-
type index_FromKafkaOptions = FromKafkaOptions;
|
|
3055
|
-
type index_FromKyselyOptions<T, U = T> = FromKyselyOptions<T, U>;
|
|
3056
|
-
type index_FromMCPOptions = FromMCPOptions;
|
|
3057
|
-
type index_FromNATSOptions = FromNATSOptions;
|
|
3058
|
-
type index_FromNDJSONOptions = FromNDJSONOptions;
|
|
3059
|
-
type index_FromOTelOptions = FromOTelOptions;
|
|
3060
|
-
type index_FromPrismaOptions<T, U = T> = FromPrismaOptions<T, U>;
|
|
3061
|
-
type index_FromPrometheusOptions = FromPrometheusOptions;
|
|
3062
|
-
type index_FromPulsarOptions = FromPulsarOptions;
|
|
3063
|
-
type index_FromRabbitMQOptions = FromRabbitMQOptions;
|
|
3064
|
-
type index_FromRedisStreamOptions = FromRedisStreamOptions;
|
|
3065
|
-
type index_FromSSEOptions<T = string> = FromSSEOptions<T>;
|
|
3066
|
-
type index_FromSqliteOptions<T> = FromSqliteOptions<T>;
|
|
3067
|
-
type index_FromStatsDOptions = FromStatsDOptions;
|
|
3068
|
-
type index_FromSyslogOptions = FromSyslogOptions;
|
|
3069
|
-
type index_FromWebSocketReconnectOptions<T> = FromWebSocketReconnectOptions<T>;
|
|
3070
|
-
type index_HTTPBundle<T> = HTTPBundle<T>;
|
|
3071
|
-
declare const index_IndexBackend: typeof IndexBackend;
|
|
3072
|
-
declare const index_IndexRow: typeof IndexRow;
|
|
3073
|
-
type index_InitMessage = InitMessage;
|
|
3074
|
-
declare const index_JitterMode: typeof JitterMode;
|
|
3075
|
-
type index_KafkaConsumerLike = KafkaConsumerLike;
|
|
3076
|
-
type index_KafkaMessage<T = unknown> = KafkaMessage<T>;
|
|
3077
|
-
type index_KafkaProducerLike = KafkaProducerLike;
|
|
3078
|
-
declare const index_KvStorageOptions: typeof KvStorageOptions;
|
|
3079
|
-
declare const index_KvStorageTier: typeof KvStorageTier;
|
|
3080
|
-
type index_KyselyQueryLike<T = unknown> = KyselyQueryLike<T>;
|
|
3081
|
-
declare const index_LightMutationOpts: typeof LightMutationOpts;
|
|
3082
|
-
declare const index_ListBackend: typeof ListBackend;
|
|
3083
|
-
declare const index_LogBackend: typeof LogBackend;
|
|
3084
|
-
type index_LokiClientLike = LokiClientLike;
|
|
3085
|
-
type index_LokiStream = LokiStream;
|
|
3086
|
-
type index_MCPClientLike = MCPClientLike;
|
|
3087
|
-
declare const index_MapBackend: typeof MapBackend;
|
|
3088
|
-
declare const index_MergeMapOptions: typeof MergeMapOptions;
|
|
3089
|
-
declare const index_MergedReactiveLog: typeof MergedReactiveLog;
|
|
3090
|
-
type index_MongoCollectionLike = MongoCollectionLike;
|
|
3091
|
-
declare const index_MutationOpts: typeof MutationOpts;
|
|
3092
|
-
type index_NATSClientLike = NATSClientLike;
|
|
3093
|
-
type index_NATSMessage<T = unknown> = NATSMessage<T>;
|
|
3094
|
-
type index_NATSSubscriptionLike = NATSSubscriptionLike;
|
|
3095
|
-
declare const index_NS_PER_MS: typeof NS_PER_MS;
|
|
3096
|
-
declare const index_NS_PER_SEC: typeof NS_PER_SEC;
|
|
3097
|
-
declare const index_NativeIndexBackend: typeof NativeIndexBackend;
|
|
3098
|
-
declare const index_NativeListBackend: typeof NativeListBackend;
|
|
3099
|
-
declare const index_NativeLogBackend: typeof NativeLogBackend;
|
|
3100
|
-
declare const index_NativeMapBackend: typeof NativeMapBackend;
|
|
3101
|
-
declare const index_NativeMapBackendOptions: typeof NativeMapBackendOptions;
|
|
3102
|
-
type index_NativePubSubBackend = NativePubSubBackend;
|
|
3103
|
-
declare const index_NativePubSubBackend: typeof NativePubSubBackend;
|
|
3104
|
-
declare const index_NodeInput: typeof NodeInput;
|
|
3105
|
-
type index_OTelBundle = OTelBundle;
|
|
3106
|
-
type index_OTelLog = OTelLog;
|
|
3107
|
-
type index_OTelMetric = OTelMetric;
|
|
3108
|
-
type index_OTelRegister = OTelRegister;
|
|
3109
|
-
type index_OTelSpan = OTelSpan;
|
|
3110
|
-
type index_ParseSSEStreamOptions<T = string> = ParseSSEStreamOptions<T>;
|
|
3111
|
-
type index_PostgresClientLike = PostgresClientLike;
|
|
3112
|
-
type index_PrismaModelLike<T = unknown> = PrismaModelLike<T>;
|
|
3113
|
-
type index_PrometheusMetric = PrometheusMetric;
|
|
3114
|
-
type index_PubSubBackend = PubSubBackend;
|
|
3115
|
-
type index_PubSubHub = PubSubHub;
|
|
3116
|
-
type index_PubSubHubOptions = PubSubHubOptions;
|
|
3117
|
-
type index_PulsarConsumerLike = PulsarConsumerLike;
|
|
3118
|
-
type index_PulsarMessage<T = unknown> = PulsarMessage<T>;
|
|
3119
|
-
type index_PulsarProducerLike = PulsarProducerLike;
|
|
3120
|
-
type index_RabbitMQChannelLike = RabbitMQChannelLike;
|
|
3121
|
-
type index_RabbitMQMessage<T = unknown> = RabbitMQMessage<T>;
|
|
3122
|
-
declare const index_RateLimiterOptions: typeof RateLimiterOptions;
|
|
3123
|
-
declare const index_RateLimiterOverflowError: typeof RateLimiterOverflowError;
|
|
3124
|
-
declare const index_RateLimiterOverflowPolicy: typeof RateLimiterOverflowPolicy;
|
|
3125
|
-
declare const index_ReactiveCounterBundle: typeof ReactiveCounterBundle;
|
|
3126
|
-
declare const index_ReactiveIndexBundle: typeof ReactiveIndexBundle;
|
|
3127
|
-
declare const index_ReactiveIndexOptions: typeof ReactiveIndexOptions;
|
|
3128
|
-
declare const index_ReactiveListBundle: typeof ReactiveListBundle;
|
|
3129
|
-
declare const index_ReactiveListOptions: typeof ReactiveListOptions;
|
|
3130
|
-
declare const index_ReactiveLogBundle: typeof ReactiveLogBundle;
|
|
3131
|
-
declare const index_ReactiveLogOptions: typeof ReactiveLogOptions;
|
|
3132
|
-
declare const index_ReactiveMapBundle: typeof ReactiveMapBundle;
|
|
3133
|
-
declare const index_ReactiveMapOptions: typeof ReactiveMapOptions;
|
|
3134
|
-
declare const index_ReactiveMapRetention: typeof ReactiveMapRetention;
|
|
3135
|
-
type index_ReactiveSinkBackpressureOptions = ReactiveSinkBackpressureOptions;
|
|
3136
|
-
type index_ReactiveSinkConfig<T, Ctx = unknown> = ReactiveSinkConfig<T, Ctx>;
|
|
3137
|
-
type index_ReactiveSinkHandle<T> = ReactiveSinkHandle<T>;
|
|
3138
|
-
type index_ReactiveSinkOptions<T> = ReactiveSinkOptions<T>;
|
|
3139
|
-
type index_ReactiveSinkRetryOptions = ReactiveSinkRetryOptions;
|
|
3140
|
-
type index_ReadyMessage = ReadyMessage;
|
|
3141
|
-
type index_RedisCheckpointClientLike = RedisCheckpointClientLike;
|
|
3142
|
-
type index_RedisClientLike = RedisClientLike;
|
|
3143
|
-
type index_RedisStreamEntry<T = unknown> = RedisStreamEntry<T>;
|
|
3144
|
-
type index_ResettableTimer = ResettableTimer;
|
|
3145
|
-
declare const index_ResettableTimer: typeof ResettableTimer;
|
|
3146
|
-
declare const index_RetryOptions: typeof RetryOptions;
|
|
3147
|
-
type index_S3ClientLike = S3ClientLike;
|
|
3148
|
-
type index_SSEEvent<T = string> = SSEEvent<T>;
|
|
3149
|
-
type index_SignalMessage = SignalMessage;
|
|
3150
|
-
type index_SingleFromAnyOptions<K> = SingleFromAnyOptions<K>;
|
|
3151
|
-
type index_SinkFailure<T> = SinkFailure<T>;
|
|
3152
|
-
type index_SinkHandle = SinkHandle;
|
|
3153
|
-
type index_SinkTransportError = SinkTransportError;
|
|
3154
|
-
declare const index_SnapshotStorageOptions: typeof SnapshotStorageOptions;
|
|
3155
|
-
declare const index_SnapshotStorageTier: typeof SnapshotStorageTier;
|
|
3156
|
-
type index_SqliteDbLike = SqliteDbLike;
|
|
3157
|
-
type index_SqliteIterableDbLike = SqliteIterableDbLike;
|
|
3158
|
-
type index_StatsDMetric = StatsDMetric;
|
|
3159
|
-
type index_StatsDRegister = StatsDRegister;
|
|
3160
|
-
declare const index_StatusValue: typeof StatusValue;
|
|
3161
|
-
declare const index_StorageBackend: typeof StorageBackend;
|
|
3162
|
-
declare const index_StorageHandle: typeof StorageHandle;
|
|
3163
|
-
type index_StratifyOptions = StratifyOptions;
|
|
3164
|
-
type index_StratifyRule<T> = StratifyRule<T>;
|
|
3165
|
-
declare const index_SuccessMeta: typeof SuccessMeta;
|
|
3166
|
-
type index_SyslogMessage = SyslogMessage;
|
|
3167
|
-
type index_SyslogRegister = SyslogRegister;
|
|
3168
|
-
declare const index_TapObserver: typeof TapObserver;
|
|
3169
|
-
type index_TempoClientLike = TempoClientLike;
|
|
3170
|
-
declare const index_ThrottleOptions: typeof ThrottleOptions;
|
|
3171
|
-
declare const index_TimeoutError: typeof TimeoutError;
|
|
3172
|
-
type index_ToCSVOptions<T> = ToCSVOptions<T>;
|
|
3173
|
-
type index_ToClickHouseOptions<T> = ToClickHouseOptions<T>;
|
|
3174
|
-
type index_ToFileOptions<T> = ToFileOptions<T>;
|
|
3175
|
-
type index_ToHTTPOptions<T> = ToHTTPOptions<T>;
|
|
3176
|
-
type index_ToKafkaOptions<T> = ToKafkaOptions<T>;
|
|
3177
|
-
type index_ToLokiOptions<T> = ToLokiOptions<T>;
|
|
3178
|
-
type index_ToMongoOptions<T> = ToMongoOptions<T>;
|
|
3179
|
-
type index_ToNATSOptions<T> = ToNATSOptions<T>;
|
|
3180
|
-
declare const index_ToObservableOptions: typeof ToObservableOptions;
|
|
3181
|
-
type index_ToPostgresOptions<T> = ToPostgresOptions<T>;
|
|
3182
|
-
type index_ToPulsarOptions<T> = ToPulsarOptions<T>;
|
|
3183
|
-
type index_ToRabbitMQOptions<T> = ToRabbitMQOptions<T>;
|
|
3184
|
-
type index_ToRedisStreamOptions<T> = ToRedisStreamOptions<T>;
|
|
3185
|
-
type index_ToS3Options<T> = ToS3Options<T>;
|
|
3186
|
-
type index_ToSSEOptions = ToSSEOptions;
|
|
3187
|
-
type index_ToSqliteOptions<T> = ToSqliteOptions<T>;
|
|
3188
|
-
type index_ToTempoOptions<T> = ToTempoOptions<T>;
|
|
3189
|
-
type index_ToWebSocketOptions<T> = ToWebSocketOptions<T>;
|
|
3190
|
-
declare const index_TokenBucket: typeof TokenBucket;
|
|
3191
|
-
declare const index_UpsertOptions: typeof UpsertOptions;
|
|
3192
|
-
type index_ValueMessage = ValueMessage;
|
|
3193
|
-
declare const index_VerifiableBundle: typeof VerifiableBundle;
|
|
3194
|
-
declare const index_VerifiableOptions: typeof VerifiableOptions;
|
|
3195
|
-
declare const index_VerifyValue: typeof VerifyValue;
|
|
3196
|
-
declare const index_ViewSpec: typeof ViewSpec;
|
|
3197
|
-
type index_WatermarkController = WatermarkController;
|
|
3198
|
-
type index_WatermarkOptions = WatermarkOptions;
|
|
3199
|
-
type index_WebSocketLike = WebSocketLike;
|
|
3200
|
-
type index_WebSocketMessageEventLike = WebSocketMessageEventLike;
|
|
3201
|
-
type index_WebSocketRegister<T> = WebSocketRegister<T>;
|
|
3202
|
-
type index_WebhookRegister<T> = WebhookRegister<T>;
|
|
3203
|
-
declare const index_WithBreakerBundle: typeof WithBreakerBundle;
|
|
3204
|
-
declare const index_WithStatusBundle: typeof WithStatusBundle;
|
|
3205
|
-
type index_WorkerBridge<_TExpose extends Record<string, Node<any>>, TImport extends readonly string[]> = WorkerBridge<_TExpose, TImport>;
|
|
3206
|
-
type index_WorkerBridgeOptions<TExpose extends Record<string, Node<any>>, TImport extends readonly string[]> = WorkerBridgeOptions<TExpose, TImport>;
|
|
3207
|
-
type index_WorkerSelfHandle = WorkerSelfHandle;
|
|
3208
|
-
type index_WorkerSelfOptions<TImport extends readonly string[]> = WorkerSelfOptions<TImport>;
|
|
3209
|
-
type index_WorkerTransport = WorkerTransport;
|
|
3210
|
-
declare const index_WrapMutationOpts: typeof WrapMutationOpts;
|
|
3211
|
-
declare const index_appendAudit: typeof appendAudit;
|
|
3212
|
-
declare const index_appendLogStorage: typeof appendLogStorage;
|
|
3213
|
-
declare const index_audit: typeof audit;
|
|
3214
|
-
declare const index_awaitSettled: typeof awaitSettled;
|
|
3215
|
-
declare const index_budgetGate: typeof budgetGate;
|
|
3216
|
-
declare const index_buffer: typeof buffer;
|
|
3217
|
-
declare const index_bufferCount: typeof bufferCount;
|
|
3218
|
-
declare const index_bufferTime: typeof bufferTime;
|
|
3219
|
-
declare const index_bumpCursor: typeof bumpCursor;
|
|
3220
|
-
declare const index_cached: typeof cached;
|
|
3221
|
-
declare const index_canonicalJson: typeof canonicalJson;
|
|
3222
|
-
declare const index_cascadingCache: typeof cascadingCache;
|
|
3223
|
-
declare const index_catchError: typeof catchError;
|
|
3224
|
-
declare const index_checkpointToRedis: typeof checkpointToRedis;
|
|
3225
|
-
declare const index_checkpointToS3: typeof checkpointToS3;
|
|
3226
|
-
declare const index_circuitBreaker: typeof circuitBreaker;
|
|
3227
|
-
declare const index_combine: typeof combine;
|
|
3228
|
-
declare const index_combineLatest: typeof combineLatest;
|
|
3229
|
-
declare const index_concat: typeof concat;
|
|
3230
|
-
declare const index_concatMap: typeof concatMap;
|
|
3231
|
-
declare const index_constant: typeof constant;
|
|
3232
|
-
declare const index_contentAddressedStorage: typeof contentAddressedStorage;
|
|
3233
|
-
declare const index_createAuditLog: typeof createAuditLog;
|
|
3234
|
-
declare const index_createTransport: typeof createTransport;
|
|
3235
|
-
declare const index_createWatermarkController: typeof createWatermarkController;
|
|
3236
|
-
declare const index_csvRows: typeof csvRows;
|
|
3237
|
-
declare const index_debounce: typeof debounce;
|
|
3238
|
-
declare const index_debounceTime: typeof debounceTime;
|
|
3239
|
-
declare const index_decay: typeof decay;
|
|
3240
|
-
declare const index_decorrelatedJitter: typeof decorrelatedJitter;
|
|
3241
|
-
declare const index_defer: typeof defer;
|
|
3242
|
-
declare const index_delay: typeof delay;
|
|
3243
|
-
declare const index_deserializeError: typeof deserializeError;
|
|
3244
|
-
declare const index_dictKv: typeof dictKv;
|
|
3245
|
-
declare const index_dictSnapshot: typeof dictSnapshot;
|
|
3246
|
-
declare const index_distill: typeof distill;
|
|
3247
|
-
declare const index_distinctUntilChanged: typeof distinctUntilChanged;
|
|
3248
|
-
declare const index_domainMeta: typeof domainMeta;
|
|
3249
|
-
declare const index_elementAt: typeof elementAt;
|
|
3250
|
-
declare const index_empty: typeof empty;
|
|
3251
|
-
declare const index_escapeRegexChar: typeof escapeRegexChar;
|
|
3252
|
-
declare const index_exhaustMap: typeof exhaustMap;
|
|
3253
|
-
declare const index_exponential: typeof exponential;
|
|
3254
|
-
declare const index_externalBundle: typeof externalBundle;
|
|
3255
|
-
declare const index_externalProducer: typeof externalProducer;
|
|
3256
|
-
declare const index_fallback: typeof fallback;
|
|
3257
|
-
declare const index_fibonacci: typeof fibonacci;
|
|
3258
|
-
declare const index_filter: typeof filter;
|
|
3259
|
-
declare const index_find: typeof find;
|
|
3260
|
-
declare const index_first: typeof first;
|
|
3261
|
-
declare const index_firstValueFrom: typeof firstValueFrom;
|
|
3262
|
-
declare const index_firstWhere: typeof firstWhere;
|
|
3263
|
-
declare const index_flatMap: typeof flatMap;
|
|
3264
|
-
declare const index_forEach: typeof forEach;
|
|
3265
|
-
declare const index_fromAny: typeof fromAny;
|
|
3266
|
-
declare const index_fromAsyncIter: typeof fromAsyncIter;
|
|
3267
|
-
declare const index_fromCSV: typeof fromCSV;
|
|
3268
|
-
declare const index_fromClickHouseWatch: typeof fromClickHouseWatch;
|
|
3269
|
-
declare const index_fromCron: typeof fromCron;
|
|
3270
|
-
declare const index_fromDrizzle: typeof fromDrizzle;
|
|
3271
|
-
declare const index_fromEvent: typeof fromEvent;
|
|
3272
|
-
declare const index_fromHTTP: typeof fromHTTP;
|
|
3273
|
-
declare const index_fromHTTPPoll: typeof fromHTTPPoll;
|
|
3274
|
-
declare const index_fromHTTPStream: typeof fromHTTPStream;
|
|
3275
|
-
declare const index_fromIter: typeof fromIter;
|
|
3276
|
-
declare const index_fromKafka: typeof fromKafka;
|
|
3277
|
-
declare const index_fromKysely: typeof fromKysely;
|
|
3278
|
-
declare const index_fromMCP: typeof fromMCP;
|
|
3279
|
-
declare const index_fromNATS: typeof fromNATS;
|
|
3280
|
-
declare const index_fromNDJSON: typeof fromNDJSON;
|
|
3281
|
-
declare const index_fromOTel: typeof fromOTel;
|
|
3282
|
-
declare const index_fromPrisma: typeof fromPrisma;
|
|
3283
|
-
declare const index_fromPrometheus: typeof fromPrometheus;
|
|
3284
|
-
declare const index_fromPromise: typeof fromPromise;
|
|
3285
|
-
declare const index_fromPulsar: typeof fromPulsar;
|
|
3286
|
-
declare const index_fromRabbitMQ: typeof fromRabbitMQ;
|
|
3287
|
-
declare const index_fromRaf: typeof fromRaf;
|
|
3288
|
-
declare const index_fromRedisStream: typeof fromRedisStream;
|
|
3289
|
-
declare const index_fromSSE: typeof fromSSE;
|
|
3290
|
-
declare const index_fromSqlite: typeof fromSqlite;
|
|
3291
|
-
declare const index_fromSqliteCursor: typeof fromSqliteCursor;
|
|
3292
|
-
declare const index_fromStatsD: typeof fromStatsD;
|
|
3293
|
-
declare const index_fromSyslog: typeof fromSyslog;
|
|
3294
|
-
declare const index_fromTimer: typeof fromTimer;
|
|
3295
|
-
declare const index_fromWebSocket: typeof fromWebSocket;
|
|
3296
|
-
declare const index_fromWebSocketReconnect: typeof fromWebSocketReconnect;
|
|
3297
|
-
declare const index_fromWebhook: typeof fromWebhook;
|
|
3298
|
-
declare const index_globToRegExp: typeof globToRegExp;
|
|
3299
|
-
declare const index_interval: typeof interval;
|
|
3300
|
-
declare const index_jsonCodec: typeof jsonCodec;
|
|
3301
|
-
declare const index_jsonCodecFor: typeof jsonCodecFor;
|
|
3302
|
-
declare const index_keepalive: typeof keepalive;
|
|
3303
|
-
declare const index_kvStorage: typeof kvStorage;
|
|
3304
|
-
declare const index_last: typeof last;
|
|
3305
|
-
declare const index_lightMutation: typeof lightMutation;
|
|
3306
|
-
declare const index_linear: typeof linear;
|
|
3307
|
-
declare const index_lru: typeof lru;
|
|
3308
|
-
declare const index_makeHttpError: typeof makeHttpError;
|
|
3309
|
-
declare const index_map: typeof map;
|
|
3310
|
-
declare const index_matchesAnyPattern: typeof matchesAnyPattern;
|
|
3311
|
-
declare const index_matchesCron: typeof matchesCron;
|
|
3312
|
-
declare const index_memoryAppendLog: typeof memoryAppendLog;
|
|
3313
|
-
declare const index_memoryBackend: typeof memoryBackend;
|
|
3314
|
-
declare const index_memoryKv: typeof memoryKv;
|
|
3315
|
-
declare const index_memorySnapshot: typeof memorySnapshot;
|
|
3316
|
-
declare const index_merge: typeof merge;
|
|
3317
|
-
declare const index_mergeMap: typeof mergeMap;
|
|
3318
|
-
declare const index_mergeReactiveLogs: typeof mergeReactiveLogs;
|
|
3319
|
-
declare const index_nameToSignal: typeof nameToSignal;
|
|
3320
|
-
declare const index_ndjsonRows: typeof ndjsonRows;
|
|
3321
|
-
declare const index_never: typeof never;
|
|
3322
|
-
declare const index_nodeSignal: typeof nodeSignal;
|
|
3323
|
-
declare const index_of: typeof of;
|
|
3324
|
-
declare const index_onFirstData: typeof onFirstData;
|
|
3325
|
-
declare const index_pairwise: typeof pairwise;
|
|
3326
|
-
declare const index_parseCron: typeof parseCron;
|
|
3327
|
-
declare const index_parsePrometheusText: typeof parsePrometheusText;
|
|
3328
|
-
declare const index_parseSSEStream: typeof parseSSEStream;
|
|
3329
|
-
declare const index_parseStatsD: typeof parseStatsD;
|
|
3330
|
-
declare const index_parseSyslog: typeof parseSyslog;
|
|
3331
|
-
declare const index_pausable: typeof pausable;
|
|
3332
|
-
declare const index_pubsub: typeof pubsub;
|
|
3333
|
-
declare const index_race: typeof race;
|
|
3334
|
-
declare const index_rateLimiter: typeof rateLimiter;
|
|
3335
|
-
declare const index_reactiveCounter: typeof reactiveCounter;
|
|
3336
|
-
declare const index_reactiveIndex: typeof reactiveIndex;
|
|
3337
|
-
declare const index_reactiveList: typeof reactiveList;
|
|
3338
|
-
declare const index_reactiveLog: typeof reactiveLog;
|
|
3339
|
-
declare const index_reactiveMap: typeof reactiveMap;
|
|
3340
|
-
declare const index_reactiveSink: typeof reactiveSink;
|
|
3341
|
-
declare const index_reduce: typeof reduce;
|
|
3342
|
-
declare const index_registerCursor: typeof registerCursor;
|
|
3343
|
-
declare const index_registerCursorMap: typeof registerCursorMap;
|
|
3344
|
-
declare const index_repeat: typeof repeat;
|
|
3345
|
-
declare const index_replay: typeof replay;
|
|
3346
|
-
declare const index_rescue: typeof rescue;
|
|
3347
|
-
declare const index_resolveBackoffPreset: typeof resolveBackoffPreset;
|
|
3348
|
-
declare const index_retry: typeof retry;
|
|
3349
|
-
declare const index_sample: typeof sample;
|
|
3350
|
-
declare const index_scan: typeof scan;
|
|
3351
|
-
declare const index_serializeError: typeof serializeError;
|
|
3352
|
-
declare const index_share: typeof share;
|
|
3353
|
-
declare const index_shareReplay: typeof shareReplay;
|
|
3354
|
-
declare const index_signalToName: typeof signalToName;
|
|
3355
|
-
declare const index_singleFromAny: typeof singleFromAny;
|
|
3356
|
-
declare const index_singleNodeFromAny: typeof singleNodeFromAny;
|
|
3357
|
-
declare const index_skip: typeof skip;
|
|
3358
|
-
declare const index_snapshotStorage: typeof snapshotStorage;
|
|
3359
|
-
declare const index_sortJsonValue: typeof sortJsonValue;
|
|
3360
|
-
declare const index_stableJsonString: typeof stableJsonString;
|
|
3361
|
-
declare const index_stratify: typeof stratify;
|
|
3362
|
-
declare const index_switchMap: typeof switchMap;
|
|
3363
|
-
declare const index_take: typeof take;
|
|
3364
|
-
declare const index_takeUntil: typeof takeUntil;
|
|
3365
|
-
declare const index_takeWhile: typeof takeWhile;
|
|
3366
|
-
declare const index_tap: typeof tap;
|
|
3367
|
-
declare const index_tapFirst: typeof tapFirst;
|
|
3368
|
-
declare const index_throttle: typeof throttle;
|
|
3369
|
-
declare const index_throttleTime: typeof throttleTime;
|
|
3370
|
-
declare const index_throwError: typeof throwError;
|
|
3371
|
-
declare const index_timeout: typeof timeout;
|
|
3372
|
-
declare const index_toArray: typeof toArray;
|
|
3373
|
-
declare const index_toCSV: typeof toCSV;
|
|
3374
|
-
declare const index_toClickHouse: typeof toClickHouse;
|
|
3375
|
-
declare const index_toFile: typeof toFile;
|
|
3376
|
-
declare const index_toHTTP: typeof toHTTP;
|
|
3377
|
-
declare const index_toKafka: typeof toKafka;
|
|
3378
|
-
declare const index_toLoki: typeof toLoki;
|
|
3379
|
-
declare const index_toMongo: typeof toMongo;
|
|
3380
|
-
declare const index_toNATS: typeof toNATS;
|
|
3381
|
-
declare const index_toObservable: typeof toObservable;
|
|
3382
|
-
declare const index_toPostgres: typeof toPostgres;
|
|
3383
|
-
declare const index_toPulsar: typeof toPulsar;
|
|
3384
|
-
declare const index_toRabbitMQ: typeof toRabbitMQ;
|
|
3385
|
-
declare const index_toReadableStream: typeof toReadableStream;
|
|
3386
|
-
declare const index_toRedisStream: typeof toRedisStream;
|
|
3387
|
-
declare const index_toS3: typeof toS3;
|
|
3388
|
-
declare const index_toSSE: typeof toSSE;
|
|
3389
|
-
declare const index_toSSEBytes: typeof toSSEBytes;
|
|
3390
|
-
declare const index_toSqlite: typeof toSqlite;
|
|
3391
|
-
declare const index_toTempo: typeof toTempo;
|
|
3392
|
-
declare const index_toWebSocket: typeof toWebSocket;
|
|
3393
|
-
declare const index_tokenBucket: typeof tokenBucket;
|
|
3394
|
-
declare const index_topologyDiff: typeof topologyDiff;
|
|
3395
|
-
declare const index_tryIncrementBounded: typeof tryIncrementBounded;
|
|
3396
|
-
declare const index_valve: typeof valve;
|
|
3397
|
-
declare const index_verifiable: typeof verifiable;
|
|
3398
|
-
declare const index_window: typeof window;
|
|
3399
|
-
declare const index_windowCount: typeof windowCount;
|
|
3400
|
-
declare const index_windowTime: typeof windowTime;
|
|
3401
|
-
declare const index_withBreaker: typeof withBreaker;
|
|
3402
|
-
declare const index_withLatestFrom: typeof withLatestFrom;
|
|
3403
|
-
declare const index_withMaxAttempts: typeof withMaxAttempts;
|
|
3404
|
-
declare const index_withStatus: typeof withStatus;
|
|
3405
|
-
declare const index_workerBridge: typeof workerBridge;
|
|
3406
|
-
declare const index_workerSelf: typeof workerSelf;
|
|
3407
|
-
declare const index_wrapMutation: typeof wrapMutation;
|
|
3408
|
-
declare const index_zip: typeof zip;
|
|
3409
|
-
declare namespace index {
|
|
3410
|
-
export { type index_AckableMessage as AckableMessage, type index_AdapterHandlers as AdapterHandlers, index_AppendCursor as AppendCursor, index_AppendLoadResult as AppendLoadResult, index_AppendLogStorageOptions as AppendLogStorageOptions, index_AppendLogStorageTier as AppendLogStorageTier, index_AsyncSourceOpts as AsyncSourceOpts, index_AuditLogOpts as AuditLogOpts, index_BackoffPreset as BackoffPreset, index_BackoffStrategy as BackoffStrategy, index_BaseAuditRecord as BaseAuditRecord, index_BaseStorageTier as BaseStorageTier, type index_BatchMessage as BatchMessage, type index_BridgeMessage as BridgeMessage, type index_BudgetConstraint as BudgetConstraint, type index_BudgetGateOptions as BudgetGateOptions, type index_BufferedSinkHandle as BufferedSinkHandle, type index_BundleTriad as BundleTriad, type index_CSVRow as CSVRow, type index_CacheEvictionPolicy as CacheEvictionPolicy, type index_CascadingCache as CascadingCache, type index_CascadingCacheOptions as CascadingCacheOptions, type index_CheckpointToRedisOptions as CheckpointToRedisOptions, type index_CheckpointToS3Options as CheckpointToS3Options, index_CircuitBreaker as CircuitBreaker, index_CircuitBreakerOptions as CircuitBreakerOptions, index_CircuitOpenError as CircuitOpenError, index_CircuitState as CircuitState, type index_ClickHouseClientLike as ClickHouseClientLike, type index_ClickHouseInsertClientLike as ClickHouseInsertClientLike, type index_ClickHouseRow as ClickHouseRow, index_Codec as Codec, index_ContentAddressedMissError as ContentAddressedMissError, index_ContentAddressedMode as ContentAddressedMode, index_ContentAddressedStorage as ContentAddressedStorage, index_ContentAddressedStorageOptions as ContentAddressedStorageOptions, type index_CronSchedule as CronSchedule, index_DEFAULT_AUDIT_GUARD as DEFAULT_AUDIT_GUARD, index_DescribeChangeset as DescribeChangeset, index_DescribeEvent as DescribeEvent, Meta as DescribeNodeMeta, index_DistillBundle as DistillBundle, index_DistillOptions as DistillOptions, type index_DrizzleQueryLike as DrizzleQueryLike, type index_EmitTriad as EmitTriad, type index_ErrorMessage as ErrorMessage, index_EventTargetLike as EventTargetLike, index_ExponentialBackoffOptions as ExponentialBackoffOptions, type index_ExternalBundleOptions as ExternalBundleOptions, type index_ExternalRegister as ExternalRegister, index_Extraction as Extraction, index_FailureMeta as FailureMeta, index_FallbackInput as FallbackInput, type index_FileWriterLike as FileWriterLike, type index_FromCSVOptions as FromCSVOptions, type index_FromClickHouseWatchOptions as FromClickHouseWatchOptions, index_FromCronOptions as FromCronOptions, type index_FromDrizzleOptions as FromDrizzleOptions, type index_FromHTTPOptions as FromHTTPOptions, type index_FromHTTPPollOptions as FromHTTPPollOptions, type index_FromHTTPStreamOptions as FromHTTPStreamOptions, type index_FromKafkaOptions as FromKafkaOptions, type index_FromKyselyOptions as FromKyselyOptions, type index_FromMCPOptions as FromMCPOptions, type index_FromNATSOptions as FromNATSOptions, type index_FromNDJSONOptions as FromNDJSONOptions, type index_FromOTelOptions as FromOTelOptions, type index_FromPrismaOptions as FromPrismaOptions, type index_FromPrometheusOptions as FromPrometheusOptions, type index_FromPulsarOptions as FromPulsarOptions, type index_FromRabbitMQOptions as FromRabbitMQOptions, type index_FromRedisStreamOptions as FromRedisStreamOptions, type index_FromSSEOptions as FromSSEOptions, type index_FromSqliteOptions as FromSqliteOptions, type index_FromStatsDOptions as FromStatsDOptions, type index_FromSyslogOptions as FromSyslogOptions, type index_FromWebSocketReconnectOptions as FromWebSocketReconnectOptions, type index_HTTPBundle as HTTPBundle, index_IndexBackend as IndexBackend, index_IndexRow as IndexRow, type index_InitMessage as InitMessage, index_JitterMode as JitterMode, type index_KafkaConsumerLike as KafkaConsumerLike, type index_KafkaMessage as KafkaMessage, type index_KafkaProducerLike as KafkaProducerLike, index_KvStorageOptions as KvStorageOptions, index_KvStorageTier as KvStorageTier, type index_KyselyQueryLike as KyselyQueryLike, index_LightMutationOpts as LightMutationOpts, index_ListBackend as ListBackend, index_LogBackend as LogBackend, type index_LokiClientLike as LokiClientLike, type index_LokiStream as LokiStream, type index_MCPClientLike as MCPClientLike, index_MapBackend as MapBackend, index_MergeMapOptions as MergeMapOptions, index_MergedReactiveLog as MergedReactiveLog, type index_MongoCollectionLike as MongoCollectionLike, index_MutationOpts as MutationOpts, type index_NATSClientLike as NATSClientLike, type index_NATSMessage as NATSMessage, type index_NATSSubscriptionLike as NATSSubscriptionLike, index_NS_PER_MS as NS_PER_MS, index_NS_PER_SEC as NS_PER_SEC, index_NativeIndexBackend as NativeIndexBackend, index_NativeListBackend as NativeListBackend, index_NativeLogBackend as NativeLogBackend, index_NativeMapBackend as NativeMapBackend, index_NativeMapBackendOptions as NativeMapBackendOptions, index_NativePubSubBackend as NativePubSubBackend, index_NodeInput as NodeInput, type index_OTelBundle as OTelBundle, type index_OTelLog as OTelLog, type index_OTelMetric as OTelMetric, type index_OTelRegister as OTelRegister, type index_OTelSpan as OTelSpan, type index_ParseSSEStreamOptions as ParseSSEStreamOptions, type index_PostgresClientLike as PostgresClientLike, type index_PrismaModelLike as PrismaModelLike, type index_PrometheusMetric as PrometheusMetric, type index_PubSubBackend as PubSubBackend, type index_PubSubHub as PubSubHub, type index_PubSubHubOptions as PubSubHubOptions, type index_PulsarConsumerLike as PulsarConsumerLike, type index_PulsarMessage as PulsarMessage, type index_PulsarProducerLike as PulsarProducerLike, type index_RabbitMQChannelLike as RabbitMQChannelLike, type index_RabbitMQMessage as RabbitMQMessage, index_RateLimiterOptions as RateLimiterOptions, index_RateLimiterOverflowError as RateLimiterOverflowError, index_RateLimiterOverflowPolicy as RateLimiterOverflowPolicy, index_ReactiveCounterBundle as ReactiveCounterBundle, index_ReactiveIndexBundle as ReactiveIndexBundle, index_ReactiveIndexOptions as ReactiveIndexOptions, index_ReactiveListBundle as ReactiveListBundle, index_ReactiveListOptions as ReactiveListOptions, index_ReactiveLogBundle as ReactiveLogBundle, index_ReactiveLogOptions as ReactiveLogOptions, index_ReactiveMapBundle as ReactiveMapBundle, index_ReactiveMapOptions as ReactiveMapOptions, index_ReactiveMapRetention as ReactiveMapRetention, type index_ReactiveSinkBackpressureOptions as ReactiveSinkBackpressureOptions, type index_ReactiveSinkConfig as ReactiveSinkConfig, type index_ReactiveSinkHandle as ReactiveSinkHandle, type index_ReactiveSinkOptions as ReactiveSinkOptions, type index_ReactiveSinkRetryOptions as ReactiveSinkRetryOptions, type index_ReadyMessage as ReadyMessage, type index_RedisCheckpointClientLike as RedisCheckpointClientLike, type index_RedisClientLike as RedisClientLike, type index_RedisStreamEntry as RedisStreamEntry, index_ResettableTimer as ResettableTimer, index_RetryOptions as RetryOptions, type index_S3ClientLike as S3ClientLike, type index_SSEEvent as SSEEvent, type index_SignalMessage as SignalMessage, type index_SingleFromAnyOptions as SingleFromAnyOptions, type index_SinkFailure as SinkFailure, type index_SinkHandle as SinkHandle, type index_SinkTransportError as SinkTransportError, index_SnapshotStorageOptions as SnapshotStorageOptions, index_SnapshotStorageTier as SnapshotStorageTier, type index_SqliteDbLike as SqliteDbLike, type index_SqliteIterableDbLike as SqliteIterableDbLike, type index_StatsDMetric as StatsDMetric, type index_StatsDRegister as StatsDRegister, index_StatusValue as StatusValue, index_StorageBackend as StorageBackend, index_StorageHandle as StorageHandle, type index_StratifyOptions as StratifyOptions, type index_StratifyRule as StratifyRule, index_SuccessMeta as SuccessMeta, type index_SyslogMessage as SyslogMessage, type index_SyslogRegister as SyslogRegister, index_TapObserver as TapObserver, type index_TempoClientLike as TempoClientLike, index_ThrottleOptions as ThrottleOptions, index_TimeoutError as TimeoutError, type index_ToCSVOptions as ToCSVOptions, type index_ToClickHouseOptions as ToClickHouseOptions, type index_ToFileOptions as ToFileOptions, type index_ToHTTPOptions as ToHTTPOptions, type index_ToKafkaOptions as ToKafkaOptions, type index_ToLokiOptions as ToLokiOptions, type index_ToMongoOptions as ToMongoOptions, type index_ToNATSOptions as ToNATSOptions, index_ToObservableOptions as ToObservableOptions, type index_ToPostgresOptions as ToPostgresOptions, type index_ToPulsarOptions as ToPulsarOptions, type index_ToRabbitMQOptions as ToRabbitMQOptions, type index_ToRedisStreamOptions as ToRedisStreamOptions, type index_ToS3Options as ToS3Options, type index_ToSSEOptions as ToSSEOptions, type index_ToSqliteOptions as ToSqliteOptions, type index_ToTempoOptions as ToTempoOptions, type index_ToWebSocketOptions as ToWebSocketOptions, index_TokenBucket as TokenBucket, index_UpsertOptions as UpsertOptions, type index_ValueMessage as ValueMessage, index_VerifiableBundle as VerifiableBundle, index_VerifiableOptions as VerifiableOptions, index_VerifyValue as VerifyValue, index_ViewSpec as ViewSpec, type index_WatermarkController as WatermarkController, type index_WatermarkOptions as WatermarkOptions, type index_WebSocketLike as WebSocketLike, type index_WebSocketMessageEventLike as WebSocketMessageEventLike, type index_WebSocketRegister as WebSocketRegister, type index_WebhookRegister as WebhookRegister, index_WithBreakerBundle as WithBreakerBundle, index_WithStatusBundle as WithStatusBundle, type index_WorkerBridge as WorkerBridge, type index_WorkerBridgeOptions as WorkerBridgeOptions, type index_WorkerSelfHandle as WorkerSelfHandle, type index_WorkerSelfOptions as WorkerSelfOptions, type index_WorkerTransport as WorkerTransport, index_WrapMutationOpts as WrapMutationOpts, index_appendAudit as appendAudit, index_appendLogStorage as appendLogStorage, index_audit as audit, index_awaitSettled as awaitSettled, index_budgetGate as budgetGate, index_buffer as buffer, index_bufferCount as bufferCount, index_bufferTime as bufferTime, index_bumpCursor as bumpCursor, index_cached as cached, index_canonicalJson as canonicalJson, index_cascadingCache as cascadingCache, index_catchError as catchError, index_checkpointToRedis as checkpointToRedis, index_checkpointToS3 as checkpointToS3, index_circuitBreaker as circuitBreaker, index_combine as combine, index_combineLatest as combineLatest, index_concat as concat, index_concatMap as concatMap, index_constant as constant, index_contentAddressedStorage as contentAddressedStorage, index_createAuditLog as createAuditLog, index_createTransport as createTransport, index_createWatermarkController as createWatermarkController, index_csvRows as csvRows, index_debounce as debounce, index_debounceTime as debounceTime, index_decay as decay, index_decorrelatedJitter as decorrelatedJitter, index_defer as defer, index_delay as delay, index_deserializeError as deserializeError, index_dictKv as dictKv, index_dictSnapshot as dictSnapshot, index_distill as distill, index_distinctUntilChanged as distinctUntilChanged, index_domainMeta as domainMeta, index_elementAt as elementAt, index_empty as empty, index_escapeRegexChar as escapeRegexChar, index_exhaustMap as exhaustMap, index_exponential as exponential, index_externalBundle as externalBundle, index_externalProducer as externalProducer, index_fallback as fallback, index_fibonacci as fibonacci, index_filter as filter, index_find as find, index_first as first, index_firstValueFrom as firstValueFrom, index_firstWhere as firstWhere, index_flatMap as flatMap, index_forEach as forEach, index_fromAny as fromAny, index_fromAsyncIter as fromAsyncIter, index_fromCSV as fromCSV, index_fromClickHouseWatch as fromClickHouseWatch, index_fromCron as fromCron, index_fromDrizzle as fromDrizzle, index_fromEvent as fromEvent, index_fromHTTP as fromHTTP, index_fromHTTPPoll as fromHTTPPoll, index_fromHTTPStream as fromHTTPStream, index_fromIter as fromIter, index_fromKafka as fromKafka, index_fromKysely as fromKysely, index_fromMCP as fromMCP, index_fromNATS as fromNATS, index_fromNDJSON as fromNDJSON, index_fromOTel as fromOTel, index_fromPrisma as fromPrisma, index_fromPrometheus as fromPrometheus, index_fromPromise as fromPromise, index_fromPulsar as fromPulsar, index_fromRabbitMQ as fromRabbitMQ, index_fromRaf as fromRaf, index_fromRedisStream as fromRedisStream, index_fromSSE as fromSSE, index_fromSqlite as fromSqlite, index_fromSqliteCursor as fromSqliteCursor, index_fromStatsD as fromStatsD, index_fromSyslog as fromSyslog, index_fromTimer as fromTimer, index_fromWebSocket as fromWebSocket, index_fromWebSocketReconnect as fromWebSocketReconnect, index_fromWebhook as fromWebhook, index_globToRegExp as globToRegExp, index_interval as interval, index_jsonCodec as jsonCodec, index_jsonCodecFor as jsonCodecFor, index_keepalive as keepalive, index_kvStorage as kvStorage, index_last as last, index_lightMutation as lightMutation, index_linear as linear, index_lru as lru, index_makeHttpError as makeHttpError, index_map as map, index_matchesAnyPattern as matchesAnyPattern, index_matchesCron as matchesCron, index_memoryAppendLog as memoryAppendLog, index_memoryBackend as memoryBackend, index_memoryKv as memoryKv, index_memorySnapshot as memorySnapshot, index_merge as merge, index_mergeMap as mergeMap, index_mergeReactiveLogs as mergeReactiveLogs, index_nameToSignal as nameToSignal, index_ndjsonRows as ndjsonRows, index_never as never, index_nodeSignal as nodeSignal, index_of as of, index_onFirstData as onFirstData, index_pairwise as pairwise, index_parseCron as parseCron, index_parsePrometheusText as parsePrometheusText, index_parseSSEStream as parseSSEStream, index_parseStatsD as parseStatsD, index_parseSyslog as parseSyslog, index_pausable as pausable, index_pubsub as pubsub, index_race as race, index_rateLimiter as rateLimiter, index_reactiveCounter as reactiveCounter, index_reactiveIndex as reactiveIndex, index_reactiveList as reactiveList, index_reactiveLog as reactiveLog, index_reactiveMap as reactiveMap, index_reactiveSink as reactiveSink, index_reduce as reduce, index_registerCursor as registerCursor, index_registerCursorMap as registerCursorMap, index_repeat as repeat, index_replay as replay, index_rescue as rescue, index_resolveBackoffPreset as resolveBackoffPreset, index_retry as retry, index_sample as sample, index_scan as scan, index_serializeError as serializeError, index_share as share, index_shareReplay as shareReplay, index_signalToName as signalToName, index_singleFromAny as singleFromAny, index_singleNodeFromAny as singleNodeFromAny, index_skip as skip, index_snapshotStorage as snapshotStorage, index_sortJsonValue as sortJsonValue, index_stableJsonString as stableJsonString, index_stratify as stratify, index_switchMap as switchMap, index_take as take, index_takeUntil as takeUntil, index_takeWhile as takeWhile, index_tap as tap, index_tapFirst as tapFirst, index_throttle as throttle, index_throttleTime as throttleTime, index_throwError as throwError, index_timeout as timeout, index_toArray as toArray, index_toCSV as toCSV, index_toClickHouse as toClickHouse, index_toFile as toFile, index_toHTTP as toHTTP, index_toKafka as toKafka, index_toLoki as toLoki, index_toMongo as toMongo, index_toNATS as toNATS, index_toObservable as toObservable, index_toPostgres as toPostgres, index_toPulsar as toPulsar, index_toRabbitMQ as toRabbitMQ, index_toReadableStream as toReadableStream, index_toRedisStream as toRedisStream, index_toS3 as toS3, index_toSSE as toSSE, index_toSSEBytes as toSSEBytes, index_toSqlite as toSqlite, index_toTempo as toTempo, index_toWebSocket as toWebSocket, index_tokenBucket as tokenBucket, index_topologyDiff as topologyDiff, index_tryIncrementBounded as tryIncrementBounded, index_valve as valve, index_verifiable as verifiable, index_window as window, index_windowCount as windowCount, index_windowTime as windowTime, index_withBreaker as withBreaker, index_withLatestFrom as withLatestFrom, index_withMaxAttempts as withMaxAttempts, index_withStatus as withStatus, index_workerBridge as workerBridge, index_workerSelf as workerSelf, index_wrapMutation as wrapMutation, index_zip as zip };
|
|
3411
|
-
}
|
|
3412
|
-
|
|
3413
|
-
export { type LokiStream as $, type AckableMessage as A, type BatchMessage as B, type CSVRow as C, type DrizzleQueryLike as D, type EmitTriad as E, type FileWriterLike as F, type FromMCPOptions as G, type FromNATSOptions as H, type FromNDJSONOptions as I, type FromOTelOptions as J, type FromPrismaOptions as K, type FromPrometheusOptions as L, type FromPulsarOptions as M, type FromRabbitMQOptions as N, type FromRedisStreamOptions as O, type FromSSEOptions as P, type FromSqliteOptions as Q, type FromStatsDOptions as R, type FromSyslogOptions as S, type FromWebSocketReconnectOptions as T, type HTTPBundle as U, type InitMessage as V, type KafkaConsumerLike as W, type KafkaMessage as X, type KafkaProducerLike as Y, type KyselyQueryLike as Z, type LokiClientLike as _, type AdapterHandlers as a, type ToSqliteOptions as a$, type MCPClientLike as a0, type MongoCollectionLike as a1, type NATSClientLike as a2, type NATSMessage as a3, type NATSSubscriptionLike as a4, NativePubSubBackend as a5, type OTelBundle as a6, type OTelLog as a7, type OTelMetric as a8, type OTelRegister as a9, type SingleFromAnyOptions as aA, type SinkFailure as aB, type SinkHandle as aC, type SinkTransportError as aD, type SqliteDbLike as aE, type SqliteIterableDbLike as aF, type StatsDMetric as aG, type StatsDRegister as aH, type StratifyOptions as aI, type StratifyRule as aJ, type SyslogMessage as aK, type SyslogRegister as aL, type TempoClientLike as aM, type ToCSVOptions as aN, type ToClickHouseOptions as aO, type ToFileOptions as aP, type ToHTTPOptions as aQ, type ToKafkaOptions as aR, type ToLokiOptions as aS, type ToMongoOptions as aT, type ToNATSOptions as aU, type ToPostgresOptions as aV, type ToPulsarOptions as aW, type ToRabbitMQOptions as aX, type ToRedisStreamOptions as aY, type ToS3Options as aZ, type ToSSEOptions as a_, type OTelSpan as aa, type ParseSSEStreamOptions as ab, type PostgresClientLike as ac, type PrismaModelLike as ad, type PrometheusMetric as ae, type PubSubBackend as af, type PubSubHub as ag, type PubSubHubOptions as ah, type PulsarConsumerLike as ai, type PulsarMessage as aj, type PulsarProducerLike as ak, type RabbitMQChannelLike as al, type RabbitMQMessage as am, type ReactiveSinkBackpressureOptions as an, type ReactiveSinkConfig as ao, type ReactiveSinkHandle as ap, type ReactiveSinkOptions as aq, type ReactiveSinkRetryOptions as ar, type ReadyMessage as as, type RedisCheckpointClientLike as at, type RedisClientLike as au, type RedisStreamEntry as av, ResettableTimer as aw, type S3ClientLike as ax, type SSEEvent as ay, type SignalMessage as az, type BridgeMessage as b, serializeError as b$, type ToTempoOptions as b0, type ToWebSocketOptions as b1, type ValueMessage as b2, type WatermarkController as b3, type WatermarkOptions as b4, type WebSocketLike as b5, type WebSocketMessageEventLike as b6, type WebSocketRegister as b7, type WebhookRegister as b8, type WorkerBridge as b9, fromNDJSON as bA, fromOTel as bB, fromPrisma as bC, fromPrometheus as bD, fromPulsar as bE, fromRabbitMQ as bF, fromRedisStream as bG, fromSSE as bH, fromSqlite as bI, fromSqliteCursor as bJ, fromStatsD as bK, fromSyslog as bL, fromWebSocket as bM, fromWebSocketReconnect as bN, fromWebhook as bO, lru as bP, makeHttpError as bQ, matchesCron as bR, nameToSignal as bS, ndjsonRows as bT, parseCron as bU, parsePrometheusText as bV, parseSSEStream as bW, parseStatsD as bX, parseSyslog as bY, pubsub as bZ, reactiveSink as b_, type WorkerBridgeOptions as ba, type WorkerSelfHandle as bb, type WorkerSelfOptions as bc, type WorkerTransport as bd, budgetGate as be, cascadingCache as bf, checkpointToRedis as bg, checkpointToS3 as bh, createTransport as bi, createWatermarkController as bj, csvRows as bk, deserializeError as bl, domainMeta as bm, externalBundle as bn, externalProducer as bo, index as bp, fromCSV as bq, fromClickHouseWatch as br, fromDrizzle as bs, fromHTTP as bt, fromHTTPPoll as bu, fromHTTPStream as bv, fromKafka as bw, fromKysely as bx, fromMCP as by, fromNATS as bz, type BudgetConstraint as c, signalToName as c0, singleFromAny as c1, singleNodeFromAny as c2, stratify as c3, toCSV as c4, toClickHouse as c5, toFile as c6, toHTTP as c7, toKafka as c8, toLoki as c9, toMongo as ca, toNATS as cb, toPostgres as cc, toPulsar as cd, toRabbitMQ as ce, toReadableStream as cf, toRedisStream as cg, toS3 as ch, toSSE as ci, toSSEBytes as cj, toSqlite as ck, toTempo as cl, toWebSocket as cm, workerBridge as cn, workerSelf as co, type BudgetGateOptions as d, type BufferedSinkHandle as e, type BundleTriad as f, type CacheEvictionPolicy as g, type CascadingCache as h, type CascadingCacheOptions as i, type CheckpointToRedisOptions as j, type CheckpointToS3Options as k, type ClickHouseClientLike as l, type ClickHouseInsertClientLike as m, type ClickHouseRow as n, type CronSchedule as o, type ErrorMessage as p, type ExternalBundleOptions as q, type ExternalRegister as r, type FromCSVOptions as s, type FromClickHouseWatchOptions as t, type FromDrizzleOptions as u, type FromHTTPOptions as v, type FromHTTPPollOptions as w, type FromHTTPStreamOptions as x, type FromKafkaOptions as y, type FromKyselyOptions as z };
|