@graphrefly/ts 0.0.1 → 0.0.3
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 +197 -117
- package/dist/actions-types-CH-XCU9O.d.cts +657 -0
- package/dist/actions-types-w2iPQTkv.d.ts +657 -0
- package/dist/adapters/index.cjs +5157 -2951
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +207 -70
- package/dist/adapters/index.d.ts +207 -70
- package/dist/adapters/index.js +3738 -1688
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/nestjs/microservices.cjs +841 -0
- package/dist/adapters/nestjs/microservices.cjs.map +1 -0
- package/dist/adapters/nestjs/microservices.d.cts +45 -0
- package/dist/adapters/nestjs/microservices.d.ts +45 -0
- package/dist/adapters/nestjs/microservices.js +206 -0
- package/dist/adapters/nestjs/microservices.js.map +1 -0
- package/dist/adapters/nestjs/native.cjs +1391 -0
- package/dist/adapters/nestjs/native.cjs.map +1 -0
- package/dist/adapters/nestjs/native.d.cts +111 -0
- package/dist/adapters/nestjs/native.d.ts +111 -0
- package/dist/adapters/nestjs/native.js +577 -0
- package/dist/adapters/nestjs/native.js.map +1 -0
- package/dist/adapters/nestjs/websockets.cjs +924 -0
- package/dist/adapters/nestjs/websockets.cjs.map +1 -0
- package/dist/adapters/nestjs/websockets.d.cts +47 -0
- package/dist/adapters/nestjs/websockets.d.ts +47 -0
- package/dist/adapters/nestjs/websockets.js +286 -0
- package/dist/adapters/nestjs/websockets.js.map +1 -0
- package/dist/adapters/nestjs.cjs +1085 -0
- package/dist/adapters/nestjs.cjs.map +1 -0
- package/dist/adapters/nestjs.d.cts +385 -0
- package/dist/adapters/nestjs.d.ts +385 -0
- package/dist/adapters/nestjs.js +112 -0
- package/dist/adapters/nestjs.js.map +1 -0
- package/dist/adapters/observe-storage.d.cts +3 -3
- package/dist/adapters/observe-storage.d.ts +3 -3
- package/dist/adapters/observe-storage.js +4 -4
- package/dist/adapters/react.cjs.map +1 -1
- package/dist/adapters/react.d.cts +2 -2
- package/dist/adapters/react.d.ts +2 -2
- package/dist/adapters/react.js +1 -1
- package/dist/adapters/solid.cjs.map +1 -1
- package/dist/adapters/solid.d.cts +2 -2
- package/dist/adapters/solid.d.ts +2 -2
- package/dist/adapters/solid.js +1 -1
- package/dist/adapters/svelte.cjs.map +1 -1
- package/dist/adapters/svelte.d.cts +2 -2
- package/dist/adapters/svelte.d.ts +2 -2
- package/dist/adapters/svelte.js +1 -1
- package/dist/adapters/vue.cjs.map +1 -1
- package/dist/adapters/vue.d.cts +2 -2
- package/dist/adapters/vue.d.ts +2 -2
- package/dist/adapters/vue.js +1 -1
- package/dist/{agent-runtime-BesGDZcB.d.ts → agent-runtime-types-core-CKwrBDyi.d.ts} +171 -320
- package/dist/{agent-runtime-DZTJ3C-p.d.cts → agent-runtime-types-core-bfl4m0vM.d.cts} +171 -320
- package/dist/agent-runtime-types-tool-BLPV3azj.d.cts +695 -0
- package/dist/agent-runtime-types-tool-hwqvVqNt.d.ts +695 -0
- package/dist/agentic-memory-retention-CLwI76JK.d.ts +14 -0
- package/dist/agentic-memory-retention-Cz8GR6ie.d.cts +14 -0
- package/dist/{agentic-memory-DfuVZ-lY.d.cts → agentic-memory-types-JDr7MPhh.d.cts} +13 -57
- package/dist/{agentic-memory-BmRCvh0d.d.ts → agentic-memory-types-khYJgzKL.d.ts} +13 -57
- package/dist/{capability-admission-B0BzqAm5.d.cts → capability-admission-B8RNFyaZ.d.cts} +3 -3
- package/dist/{capability-admission-g0mn9hpq.d.ts → capability-admission-Dkw1Xz3r.d.ts} +3 -3
- package/dist/chunk-2KUAG2GZ.js +9693 -0
- package/dist/chunk-2KUAG2GZ.js.map +1 -0
- package/dist/{chunk-CZNV3VXM.js → chunk-3J7UPZL5.js} +11 -11
- package/dist/{chunk-HKK2JD7Z.js → chunk-3LYI6ADX.js} +12 -125
- package/dist/chunk-3LYI6ADX.js.map +1 -0
- package/dist/{chunk-YXMZ2N6J.js → chunk-4M37FH2I.js} +1071 -1025
- package/dist/chunk-4M37FH2I.js.map +1 -0
- package/dist/{chunk-YDSIVHRR.js → chunk-4NWSNI4K.js} +1598 -1584
- package/dist/chunk-4NWSNI4K.js.map +1 -0
- package/dist/{chunk-Z2ANQ6JW.js → chunk-4Q77MMJY.js} +2 -2
- package/dist/{chunk-SS2A464I.js → chunk-54WPEODM.js} +3 -3
- package/dist/chunk-54WPEODM.js.map +1 -0
- package/dist/chunk-6E76H4OU.js +132 -0
- package/dist/chunk-6E76H4OU.js.map +1 -0
- package/dist/chunk-7GOTIIQ7.js +819 -0
- package/dist/chunk-7GOTIIQ7.js.map +1 -0
- package/dist/{chunk-V7CIJE4B.js → chunk-DKFWDTVY.js} +92 -9
- package/dist/chunk-DKFWDTVY.js.map +1 -0
- package/dist/{chunk-FBUU43PM.js → chunk-E4QCH32M.js} +448 -446
- package/dist/chunk-E4QCH32M.js.map +1 -0
- package/dist/{chunk-XKXWK2KP.js → chunk-GXU6WFEJ.js} +1157 -1021
- package/dist/chunk-GXU6WFEJ.js.map +1 -0
- package/dist/{chunk-K3FXTC3I.js → chunk-HJACH5PU.js} +3 -3
- package/dist/{chunk-GTPCOEOZ.js → chunk-IDMLXLLG.js} +3 -3
- package/dist/{chunk-DKP56CSW.js → chunk-JKAYLDQV.js} +2 -2
- package/dist/{chunk-4VLAQHZI.js → chunk-K7FB3JTD.js} +17 -1
- package/dist/chunk-K7FB3JTD.js.map +1 -0
- package/dist/{chunk-43BKLFZU.js → chunk-KFURM6FM.js} +10 -10
- package/dist/{chunk-H75VXTGT.js → chunk-L6LDXRWE.js} +3 -3
- package/dist/{chunk-H75VXTGT.js.map → chunk-L6LDXRWE.js.map} +1 -1
- package/dist/chunk-MCOFHMUU.js +4131 -0
- package/dist/chunk-MCOFHMUU.js.map +1 -0
- package/dist/chunk-MQEQMS7B.js +1009 -0
- package/dist/chunk-MQEQMS7B.js.map +1 -0
- package/dist/chunk-MTELVIYR.js +1421 -0
- package/dist/chunk-MTELVIYR.js.map +1 -0
- package/dist/{chunk-3JR3EDB2.js → chunk-NNDIFUKX.js} +121 -115
- package/dist/chunk-NNDIFUKX.js.map +1 -0
- package/dist/{chunk-2747WN4Y.js → chunk-PUSRRALM.js} +3 -3
- package/dist/{chunk-QFY4AFY4.js → chunk-PVC7WDKI.js} +58 -52
- package/dist/chunk-PVC7WDKI.js.map +1 -0
- package/dist/{chunk-VTHLCFN4.js → chunk-RAHNUYA5.js} +2 -2
- package/dist/chunk-TQPCAIQI.js +612 -0
- package/dist/chunk-TQPCAIQI.js.map +1 -0
- package/dist/{chunk-IXZBUWSP.js → chunk-UEMN5URK.js} +2 -2
- package/dist/chunk-WOS7RJYZ.js +1320 -0
- package/dist/chunk-WOS7RJYZ.js.map +1 -0
- package/dist/{chunk-6PHB5CJS.js → chunk-ZLFRB6FI.js} +2 -2
- package/dist/composition/index.cjs +1228 -1076
- package/dist/composition/index.cjs.map +1 -1
- package/dist/composition/index.d.cts +3 -3
- package/dist/composition/index.d.ts +3 -3
- package/dist/composition/index.js +4 -4
- package/dist/core/index.cjs +1198 -1046
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +23 -2
- package/dist/core/index.d.ts +23 -2
- package/dist/core/index.js +2 -2
- package/dist/cqrs/index.d.cts +3 -3
- package/dist/cqrs/index.d.ts +3 -3
- package/dist/cqrs/messaging.d.cts +4 -4
- package/dist/cqrs/messaging.d.ts +4 -4
- package/dist/cqrs/work-queue.d.cts +5 -5
- package/dist/cqrs/work-queue.d.ts +5 -5
- package/dist/data-structures/index.cjs +1226 -1074
- package/dist/data-structures/index.cjs.map +1 -1
- package/dist/data-structures/index.d.cts +8 -7
- package/dist/data-structures/index.d.ts +8 -7
- package/dist/data-structures/index.js +6 -5
- package/dist/{describe-DYMw_l1C.d.cts → describe-BumQ-3_0.d.cts} +1 -1
- package/dist/{describe-BpyJuWkw.d.ts → describe-cYr_Z5zm.d.ts} +1 -1
- package/dist/executors/tool-provider-adapters.cjs +3091 -0
- package/dist/executors/tool-provider-adapters.cjs.map +1 -0
- package/dist/executors/tool-provider-adapters.d.cts +174 -0
- package/dist/executors/tool-provider-adapters.d.ts +174 -0
- package/dist/executors/tool-provider-adapters.js +1336 -0
- package/dist/executors/tool-provider-adapters.js.map +1 -0
- package/dist/executors/tool-provider-runtime.cjs +5178 -0
- package/dist/executors/tool-provider-runtime.cjs.map +1 -0
- package/dist/executors/tool-provider-runtime.d.cts +17 -0
- package/dist/executors/tool-provider-runtime.d.ts +17 -0
- package/dist/executors/tool-provider-runtime.js +15 -0
- package/dist/executors/tool-provider-runtime.js.map +1 -0
- package/dist/executors/tool-provider.cjs +6392 -0
- package/dist/executors/tool-provider.cjs.map +1 -0
- package/dist/executors/tool-provider.d.cts +60 -0
- package/dist/executors/tool-provider.d.ts +60 -0
- package/dist/executors/tool-provider.js +89 -0
- package/dist/executors/tool-provider.js.map +1 -0
- package/dist/executors/work-queue.d.cts +6 -6
- package/dist/executors/work-queue.d.ts +6 -6
- package/dist/graph/index.cjs +1499 -1341
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +9 -8
- package/dist/graph/index.d.ts +9 -8
- package/dist/graph/index.js +23 -22
- package/dist/{graph-DCEWh4T2.d.cts → graph-C1C-wb0L.d.cts} +266 -137
- package/dist/{graph-D-1-SQeC.d.ts → graph-CS0b4V9B.d.ts} +266 -137
- package/dist/{index-72VZC0-E.d.cts → index-DLrNopda.d.cts} +151 -10
- package/dist/{index-Bmxeu0nK.d.ts → index-DzJni3_6.d.ts} +151 -10
- package/dist/index.cjs +3397 -3140
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -9
- package/dist/index.d.ts +12 -9
- package/dist/index.js +110 -109
- package/dist/inspection/boundary.d.cts +4 -4
- package/dist/inspection/boundary.d.ts +4 -4
- package/dist/measurements-BWAnochv.d.ts +294 -0
- package/dist/measurements-B_gJfD8h.d.cts +294 -0
- package/dist/messaging/index.cjs +57 -51
- package/dist/messaging/index.cjs.map +1 -1
- package/dist/messaging/index.d.cts +11 -276
- package/dist/messaging/index.d.ts +11 -276
- package/dist/messaging/index.js +1 -1
- package/dist/operators/index.cjs +1228 -1076
- package/dist/operators/index.cjs.map +1 -1
- package/dist/operators/index.d.cts +5 -5
- package/dist/operators/index.d.ts +5 -5
- package/dist/operators/index.js +5 -5
- package/dist/orchestration/index.cjs +8844 -6071
- package/dist/orchestration/index.cjs.map +1 -1
- package/dist/orchestration/index.d.cts +171 -224
- package/dist/orchestration/index.d.ts +171 -224
- package/dist/orchestration/index.js +42 -991
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/messaging.d.cts +5 -8
- package/dist/orchestration/messaging.d.ts +5 -8
- package/dist/orchestration/work-queue.cjs +1243 -5
- package/dist/orchestration/work-queue.cjs.map +1 -1
- package/dist/orchestration/work-queue.d.cts +121 -10
- package/dist/orchestration/work-queue.d.ts +121 -10
- package/dist/orchestration/work-queue.js +1067 -4
- package/dist/orchestration/work-queue.js.map +1 -1
- package/dist/patterns/event-flow.cjs +6 -20
- package/dist/patterns/event-flow.cjs.map +1 -1
- package/dist/patterns/event-flow.d.cts +4 -4
- package/dist/patterns/event-flow.d.ts +4 -4
- package/dist/patterns/event-flow.js +2 -2
- package/dist/patterns/index.cjs +453 -465
- package/dist/patterns/index.cjs.map +1 -1
- package/dist/patterns/index.d.cts +6 -5
- package/dist/patterns/index.d.ts +6 -5
- package/dist/patterns/index.js +3 -3
- package/dist/process-types-BB7oRhX3.d.cts +200 -0
- package/dist/process-types-QNhyoYJ8.d.ts +200 -0
- package/dist/{reactive-collection-DNV0-gFi.d.cts → reactive-collection-BYlWvtnp.d.cts} +4 -34
- package/dist/{reactive-collection-BAmfrGjd.d.ts → reactive-collection-efOEdGFN.d.ts} +4 -34
- package/dist/{reactive-collection-storage-BNEldDyi.d.cts → reactive-collection-storage-BjoLsoiC.d.cts} +5 -5
- package/dist/{reactive-collection-storage-YZsAQsWK.d.ts → reactive-collection-storage-DwW6UuK_.d.ts} +5 -5
- package/dist/{reactive-map-DRD1LJ2H.d.cts → reactive-map-BHacbIqz.d.cts} +7 -2
- package/dist/{reactive-map-EsDiCmJk.d.ts → reactive-map-DN4Jyqnf.d.ts} +7 -2
- package/dist/render/index.d.cts +2 -2
- package/dist/render/index.d.ts +2 -2
- package/dist/scheduled-readiness-BmqXxnzX.d.ts +91 -0
- package/dist/scheduled-readiness-CYSw7KDE.d.cts +91 -0
- package/dist/semantic-memory-graph-B_LwbM-E.d.cts +30 -0
- package/dist/semantic-memory-graph-rsFNNhwn.d.ts +30 -0
- package/dist/{semantic-memory-graph-DKuNzuWw.d.cts → semantic-memory-graph-types-Y73bbwVI.d.cts} +2 -28
- package/dist/{semantic-memory-graph-uwbwJdhe.d.ts → semantic-memory-graph-types-safmPkuX.d.ts} +2 -28
- package/dist/solutions/index.cjs +6353 -6169
- package/dist/solutions/index.cjs.map +1 -1
- package/dist/solutions/index.d.cts +12 -10
- package/dist/solutions/index.d.ts +12 -10
- package/dist/solutions/index.js +5 -5
- package/dist/solutions/reactive-layout/browser/index.cjs +116 -108
- package/dist/solutions/reactive-layout/browser/index.cjs.map +1 -1
- package/dist/solutions/reactive-layout/browser/index.d.cts +4 -4
- package/dist/solutions/reactive-layout/browser/index.d.ts +4 -4
- package/dist/solutions/reactive-layout/browser/index.js +3 -3
- package/dist/solutions/reactive-layout/index.cjs +3578 -3350
- package/dist/solutions/reactive-layout/index.cjs.map +1 -1
- package/dist/solutions/reactive-layout/index.d.cts +32 -576
- package/dist/solutions/reactive-layout/index.d.ts +32 -576
- package/dist/solutions/reactive-layout/index.js +65 -5
- package/dist/solutions/reactive-layout/node-canvas/index.cjs +127 -117
- package/dist/solutions/reactive-layout/node-canvas/index.cjs.map +1 -1
- package/dist/solutions/reactive-layout/node-canvas/index.d.cts +4 -4
- package/dist/solutions/reactive-layout/node-canvas/index.d.ts +4 -4
- package/dist/solutions/reactive-layout/node-canvas/index.js +3 -3
- package/dist/solutions/reactive-layout/react-native/index.cjs +127 -117
- package/dist/solutions/reactive-layout/react-native/index.cjs.map +1 -1
- package/dist/solutions/reactive-layout/react-native/index.d.cts +4 -4
- package/dist/solutions/reactive-layout/react-native/index.d.ts +4 -4
- package/dist/solutions/reactive-layout/react-native/index.js +3 -3
- package/dist/solutions/reactive-layout/skia/index.cjs +127 -117
- package/dist/solutions/reactive-layout/skia/index.cjs.map +1 -1
- package/dist/solutions/reactive-layout/skia/index.d.cts +4 -4
- package/dist/solutions/reactive-layout/skia/index.d.ts +4 -4
- package/dist/solutions/reactive-layout/skia/index.js +3 -3
- package/dist/solutions/work-item/actions.cjs +1609 -1428
- package/dist/solutions/work-item/actions.cjs.map +1 -1
- package/dist/solutions/work-item/actions.d.cts +23 -184
- package/dist/solutions/work-item/actions.d.ts +23 -184
- package/dist/solutions/work-item/actions.js +1558 -934
- package/dist/solutions/work-item/actions.js.map +1 -1
- package/dist/solutions/work-item/scheduling.cjs +9181 -1838
- package/dist/solutions/work-item/scheduling.cjs.map +1 -1
- package/dist/solutions/work-item/scheduling.d.cts +1763 -328
- package/dist/solutions/work-item/scheduling.d.ts +1763 -328
- package/dist/solutions/work-item/scheduling.js +117 -3
- package/dist/solutions/work-item/work-queue.d.cts +7 -7
- package/dist/solutions/work-item/work-queue.d.ts +7 -7
- package/dist/sources/browser.cjs +1318 -1083
- package/dist/sources/browser.cjs.map +1 -1
- package/dist/sources/browser.d.cts +22 -6
- package/dist/sources/browser.d.ts +22 -6
- package/dist/sources/browser.js +4 -4
- package/dist/sources/browser.js.map +1 -1
- package/dist/sources/index.cjs +1318 -1083
- package/dist/sources/index.cjs.map +1 -1
- package/dist/sources/index.d.cts +4 -4
- package/dist/sources/index.d.ts +4 -4
- package/dist/sources/index.js +4 -4
- package/dist/sources/node.d.cts +3 -3
- package/dist/sources/node.d.ts +3 -3
- package/dist/storage/browser.cjs +16 -0
- package/dist/storage/browser.cjs.map +1 -1
- package/dist/storage/browser.js +3 -3
- package/dist/storage/index.cjs +16 -0
- package/dist/storage/index.cjs.map +1 -1
- package/dist/storage/index.d.cts +5 -4
- package/dist/storage/index.d.ts +5 -4
- package/dist/storage/index.js +6 -6
- package/dist/storage/node.cjs +16 -0
- package/dist/storage/node.cjs.map +1 -1
- package/dist/storage/node.js +3 -3
- package/dist/{store-C-joM4gh.d.ts → store-6_CHF6Ge.d.ts} +1 -1
- package/dist/{store-CNJwmT-h.d.cts → store-BljX8RkQ.d.cts} +1 -1
- package/dist/types-BAw2QVVE.d.cts +274 -0
- package/dist/types-BUbbbh4f.d.cts +34 -0
- package/dist/types-CMnzoL54.d.cts +457 -0
- package/dist/{types-CcPIn7sy.d.cts → types-CTN3XoMl.d.cts} +57 -108
- package/dist/types-CV_ohy5T.d.cts +357 -0
- package/dist/{types-BsJvElYZ.d.ts → types-DChxk1vK.d.ts} +57 -108
- package/dist/types-DRu7SnLV.d.ts +274 -0
- package/dist/types-DeID_FRl.d.ts +34 -0
- package/dist/types-IhKH0hGW.d.ts +357 -0
- package/dist/types-ePlD2uyT.d.ts +457 -0
- package/dist/{work-item-runtime-qaVgsL0T.d.cts → work-item-runtime-types-BTxLskN5.d.cts} +3 -93
- package/dist/{work-item-runtime-C3M79vE9.d.ts → work-item-runtime-types-DAsZbb2y.d.ts} +3 -93
- package/dist/work-queue/index.cjs +957 -953
- package/dist/work-queue/index.cjs.map +1 -1
- package/dist/work-queue/index.d.cts +9 -357
- package/dist/work-queue/index.d.ts +9 -357
- package/dist/work-queue/index.js +957 -953
- package/dist/work-queue/index.js.map +1 -1
- package/package.json +611 -513
- package/dist/chunk-3JR3EDB2.js.map +0 -1
- package/dist/chunk-4VLAQHZI.js.map +0 -1
- package/dist/chunk-6XAIOL3X.js +0 -2407
- package/dist/chunk-6XAIOL3X.js.map +0 -1
- package/dist/chunk-FBUU43PM.js.map +0 -1
- package/dist/chunk-HKK2JD7Z.js.map +0 -1
- package/dist/chunk-PC3BTTBE.js +0 -3217
- package/dist/chunk-PC3BTTBE.js.map +0 -1
- package/dist/chunk-QFY4AFY4.js.map +0 -1
- package/dist/chunk-SS2A464I.js.map +0 -1
- package/dist/chunk-V7CIJE4B.js.map +0 -1
- package/dist/chunk-XKXWK2KP.js.map +0 -1
- package/dist/chunk-YDSIVHRR.js.map +0 -1
- package/dist/chunk-YXMZ2N6J.js.map +0 -1
- /package/dist/{chunk-CZNV3VXM.js.map → chunk-3J7UPZL5.js.map} +0 -0
- /package/dist/{chunk-Z2ANQ6JW.js.map → chunk-4Q77MMJY.js.map} +0 -0
- /package/dist/{chunk-K3FXTC3I.js.map → chunk-HJACH5PU.js.map} +0 -0
- /package/dist/{chunk-GTPCOEOZ.js.map → chunk-IDMLXLLG.js.map} +0 -0
- /package/dist/{chunk-DKP56CSW.js.map → chunk-JKAYLDQV.js.map} +0 -0
- /package/dist/{chunk-43BKLFZU.js.map → chunk-KFURM6FM.js.map} +0 -0
- /package/dist/{chunk-2747WN4Y.js.map → chunk-PUSRRALM.js.map} +0 -0
- /package/dist/{chunk-VTHLCFN4.js.map → chunk-RAHNUYA5.js.map} +0 -0
- /package/dist/{chunk-IXZBUWSP.js.map → chunk-UEMN5URK.js.map} +0 -0
- /package/dist/{chunk-6PHB5CJS.js.map → chunk-ZLFRB6FI.js.map} +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { ExceptionFilter, OnModuleDestroy, ArgumentsHost, HttpException, ExecutionContext, Provider } from '@nestjs/common';
|
|
2
|
+
import { F as FromCronOptions } from '../../index-DzJni3_6.js';
|
|
3
|
+
import { DecoratorHostConstructor, NestDiagnosticIngressBoundary, NestIssueResponse, NestProtocolErrorResponse, NestHttpResponsePayload, NestGraphRunOptions } from '../nestjs.js';
|
|
4
|
+
import '../../types-DChxk1vK.js';
|
|
5
|
+
import '../../messages-CAzUPPJM.js';
|
|
6
|
+
import '../../graph-CS0b4V9B.js';
|
|
7
|
+
import '../../core/index.js';
|
|
8
|
+
import '../../codec-BB7p8fJc.js';
|
|
9
|
+
import '../../describe-cYr_Z5zm.js';
|
|
10
|
+
import '../../data/index.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Nest-native provider bridge for GraphReFly boundary metadata (D484).
|
|
14
|
+
*
|
|
15
|
+
* This focused subpath is allowed to import Nest/RxJS. The dependency-light
|
|
16
|
+
* `@graphrefly/ts/adapters/nestjs` structural layer stays Nest-free.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
declare const GRAPHREFLY_NEST_CRON_SCHEDULER: unique symbol;
|
|
20
|
+
declare const GRAPHREFLY_NEST_EXCEPTION_FILTER: unique symbol;
|
|
21
|
+
declare const GRAPHREFLY_NEST_LIFECYCLE_HOOKS: unique symbol;
|
|
22
|
+
interface GraphNativeHostOptions<THost = unknown> extends NestGraphRunOptions<THost> {
|
|
23
|
+
readonly host?: (context: ExecutionContext) => THost;
|
|
24
|
+
readonly diagnosticBoundary?: NestDiagnosticIngressBoundary;
|
|
25
|
+
}
|
|
26
|
+
interface GraphNativeHttpOptions<THost = unknown> extends GraphNativeHostOptions<THost> {
|
|
27
|
+
readonly issueResponse?: NestIssueResponse<THost>;
|
|
28
|
+
readonly protocolError?: NestProtocolErrorResponse<THost>;
|
|
29
|
+
}
|
|
30
|
+
interface GraphExceptionFilterTarget {
|
|
31
|
+
readonly target: DecoratorHostConstructor | object;
|
|
32
|
+
readonly methodKey: string | symbol;
|
|
33
|
+
}
|
|
34
|
+
interface GraphExceptionFilterProviderOptions<THost = unknown> {
|
|
35
|
+
readonly host?: (host: ArgumentsHost, exception: unknown) => THost;
|
|
36
|
+
readonly target: (host: ArgumentsHost, exception: unknown) => GraphExceptionFilterTarget | undefined;
|
|
37
|
+
readonly diagnosticBoundary?: NestDiagnosticIngressBoundary;
|
|
38
|
+
readonly requestId?: string | ((host: THost) => string | undefined);
|
|
39
|
+
readonly issueResponse?: NestIssueResponse<THost>;
|
|
40
|
+
readonly protocolError?: NestProtocolErrorResponse<THost>;
|
|
41
|
+
}
|
|
42
|
+
interface GraphCronProviderTarget<THost = unknown> {
|
|
43
|
+
readonly target: DecoratorHostConstructor | object;
|
|
44
|
+
readonly methodKey?: string | symbol;
|
|
45
|
+
readonly expr: string;
|
|
46
|
+
readonly tickMs?: number;
|
|
47
|
+
readonly timezone?: string;
|
|
48
|
+
readonly dst?: FromCronOptions["dst"];
|
|
49
|
+
readonly host?: (date: Date) => THost;
|
|
50
|
+
}
|
|
51
|
+
interface GraphCronSchedulerProviderOptions {
|
|
52
|
+
readonly targets: readonly GraphCronProviderTarget[];
|
|
53
|
+
}
|
|
54
|
+
interface GraphCronController {
|
|
55
|
+
check(now: Date): void;
|
|
56
|
+
}
|
|
57
|
+
interface GraphCronControllerOptions {
|
|
58
|
+
readonly targets: readonly GraphCronProviderTarget[];
|
|
59
|
+
}
|
|
60
|
+
interface GraphLifecycleProviderTarget<THost = unknown> {
|
|
61
|
+
readonly target: DecoratorHostConstructor | object;
|
|
62
|
+
readonly methodKey?: string | symbol;
|
|
63
|
+
readonly event?: "module-init" | "module-destroy";
|
|
64
|
+
readonly host?: (event: "module-init" | "module-destroy") => THost;
|
|
65
|
+
}
|
|
66
|
+
interface GraphLifecycleHooksProviderOptions {
|
|
67
|
+
readonly targets: readonly GraphLifecycleProviderTarget[];
|
|
68
|
+
}
|
|
69
|
+
interface GraphNativeHttpProviderBundleOptions<THost = unknown> {
|
|
70
|
+
readonly boundaryInterceptor?: GraphNativeHttpOptions<THost> | false;
|
|
71
|
+
readonly guard?: GraphNativeHttpOptions<THost> | false;
|
|
72
|
+
readonly guardDeniedFilter?: boolean;
|
|
73
|
+
readonly exceptionFilter?: GraphExceptionFilterProviderOptions<THost>;
|
|
74
|
+
}
|
|
75
|
+
interface GraphNativeProviderBundleOptions<THost = unknown> {
|
|
76
|
+
readonly http?: GraphNativeHttpProviderBundleOptions<THost> | false;
|
|
77
|
+
readonly cronScheduler?: GraphCronSchedulerProviderOptions;
|
|
78
|
+
readonly lifecycleHooks?: GraphLifecycleHooksProviderOptions;
|
|
79
|
+
}
|
|
80
|
+
declare function provideGraphBoundaryInterceptor<THost = unknown>(opts?: GraphNativeHttpOptions<THost>): Provider;
|
|
81
|
+
declare function provideGraphGuard<THost = unknown>(opts?: GraphNativeHttpOptions<THost>): Provider;
|
|
82
|
+
declare function provideGraphExceptionFilter<THost = unknown>(opts: GraphExceptionFilterProviderOptions<THost>): Provider;
|
|
83
|
+
declare function createGraphExceptionFilter<THost = unknown>(opts: GraphExceptionFilterProviderOptions<THost>): ExceptionFilter & OnModuleDestroy;
|
|
84
|
+
declare function provideGraphGuardDeniedFilter(): Provider;
|
|
85
|
+
declare function createGraphGuardDeniedFilter(): ExceptionFilter;
|
|
86
|
+
declare function provideGraphCronScheduler(opts: GraphCronSchedulerProviderOptions): Provider;
|
|
87
|
+
declare function provideGraphLifecycleHooks(opts: GraphLifecycleHooksProviderOptions): Provider;
|
|
88
|
+
declare function provideGraphNativeHttpProviders<THost = unknown>(opts?: GraphNativeHttpProviderBundleOptions<THost>): Provider[];
|
|
89
|
+
declare function provideGraphNativeProviders<THost = unknown>(opts?: GraphNativeProviderBundleOptions<THost>): Provider[];
|
|
90
|
+
declare function graphCronTarget<THost = unknown>(target: DecoratorHostConstructor | object, methodKey: string | symbol, opts: Omit<GraphCronProviderTarget<THost>, "target" | "methodKey">): GraphCronProviderTarget<THost>;
|
|
91
|
+
declare function graphLifecycleTarget<THost = unknown>(target: DecoratorHostConstructor | object, methodKey: string | symbol, opts?: Omit<GraphLifecycleProviderTarget<THost>, "target" | "methodKey">): GraphLifecycleProviderTarget<THost>;
|
|
92
|
+
declare function createGraphCronController(opts: GraphCronControllerOptions): GraphCronController;
|
|
93
|
+
declare class GraphExceptionFilterBridge<THost> implements ExceptionFilter, OnModuleDestroy {
|
|
94
|
+
private readonly opts;
|
|
95
|
+
private readonly replies;
|
|
96
|
+
private readonly disposableReplies;
|
|
97
|
+
constructor(opts: GraphExceptionFilterProviderOptions<THost>);
|
|
98
|
+
catch(exception: unknown, host: ArgumentsHost): unknown;
|
|
99
|
+
onModuleDestroy(): void;
|
|
100
|
+
private replyBoundary;
|
|
101
|
+
}
|
|
102
|
+
declare class GraphGuardDeniedException extends HttpException {
|
|
103
|
+
readonly payload: NestHttpResponsePayload;
|
|
104
|
+
constructor(payload: NestHttpResponsePayload);
|
|
105
|
+
}
|
|
106
|
+
declare function isGraphGuardDeniedException(value: unknown): value is GraphGuardDeniedException;
|
|
107
|
+
declare class GraphGuardDeniedFilter implements ExceptionFilter {
|
|
108
|
+
catch(exception: unknown, host: ArgumentsHost): unknown;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export { GRAPHREFLY_NEST_CRON_SCHEDULER, GRAPHREFLY_NEST_EXCEPTION_FILTER, GRAPHREFLY_NEST_LIFECYCLE_HOOKS, type GraphCronController, type GraphCronControllerOptions, type GraphCronProviderTarget, type GraphCronSchedulerProviderOptions, GraphExceptionFilterBridge, type GraphExceptionFilterProviderOptions, type GraphExceptionFilterTarget, GraphGuardDeniedException, GraphGuardDeniedFilter, type GraphLifecycleHooksProviderOptions, type GraphLifecycleProviderTarget, type GraphNativeHostOptions, type GraphNativeHttpOptions, type GraphNativeHttpProviderBundleOptions, type GraphNativeProviderBundleOptions, createGraphCronController, createGraphExceptionFilter, createGraphGuardDeniedFilter, graphCronTarget, graphLifecycleTarget, isGraphGuardDeniedException, provideGraphBoundaryInterceptor, provideGraphCronScheduler, provideGraphExceptionFilter, provideGraphGuard, provideGraphGuardDeniedFilter, provideGraphLifecycleHooks, provideGraphNativeHttpProviders, provideGraphNativeProviders };
|
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
import {
|
|
2
|
+
matchesCron,
|
|
3
|
+
parseCron
|
|
4
|
+
} from "../../chunk-DKFWDTVY.js";
|
|
5
|
+
import "../../chunk-54WPEODM.js";
|
|
6
|
+
import "../../chunk-GXU6WFEJ.js";
|
|
7
|
+
import "../../chunk-WQIA3GFB.js";
|
|
8
|
+
import "../../chunk-S6HXABGL.js";
|
|
9
|
+
import {
|
|
10
|
+
bindingEmitOptions,
|
|
11
|
+
bindingRequestId,
|
|
12
|
+
createNestGraphBoundaryRunner,
|
|
13
|
+
getNestBoundaryBindings,
|
|
14
|
+
isDataIssue,
|
|
15
|
+
lowerHttpReplyPayload,
|
|
16
|
+
lowerProtocolError,
|
|
17
|
+
protocolError,
|
|
18
|
+
resolveNestMethodKey,
|
|
19
|
+
toNestHttp
|
|
20
|
+
} from "../../chunk-MQEQMS7B.js";
|
|
21
|
+
import "../../chunk-K7FB3JTD.js";
|
|
22
|
+
import "../../chunk-DGUM43GV.js";
|
|
23
|
+
|
|
24
|
+
// src/adapters/nestjs/native.ts
|
|
25
|
+
import { Catch, HttpException } from "@nestjs/common";
|
|
26
|
+
import { APP_GUARD, APP_INTERCEPTOR } from "@nestjs/core";
|
|
27
|
+
import { from } from "rxjs";
|
|
28
|
+
var GRAPHREFLY_NEST_CRON_SCHEDULER = /* @__PURE__ */ Symbol.for("graphrefly:nest:cron-scheduler");
|
|
29
|
+
var GRAPHREFLY_NEST_EXCEPTION_FILTER = /* @__PURE__ */ Symbol.for("graphrefly:nest:exception-filter");
|
|
30
|
+
var GRAPHREFLY_NEST_LIFECYCLE_HOOKS = /* @__PURE__ */ Symbol.for("graphrefly:nest:lifecycle-hooks");
|
|
31
|
+
function provideGraphBoundaryInterceptor(opts = {}) {
|
|
32
|
+
return { provide: APP_INTERCEPTOR, useValue: new GraphBoundaryInterceptorBridge(opts) };
|
|
33
|
+
}
|
|
34
|
+
function provideGraphGuard(opts = {}) {
|
|
35
|
+
return { provide: APP_GUARD, useValue: new GraphGuardBridge(opts) };
|
|
36
|
+
}
|
|
37
|
+
function provideGraphExceptionFilter(opts) {
|
|
38
|
+
return { provide: GRAPHREFLY_NEST_EXCEPTION_FILTER, useValue: createGraphExceptionFilter(opts) };
|
|
39
|
+
}
|
|
40
|
+
function createGraphExceptionFilter(opts) {
|
|
41
|
+
return new GraphExceptionFilterBridge(opts);
|
|
42
|
+
}
|
|
43
|
+
function provideGraphGuardDeniedFilter() {
|
|
44
|
+
return GraphGuardDeniedFilter;
|
|
45
|
+
}
|
|
46
|
+
function createGraphGuardDeniedFilter() {
|
|
47
|
+
return new GraphGuardDeniedFilter();
|
|
48
|
+
}
|
|
49
|
+
function provideGraphCronScheduler(opts) {
|
|
50
|
+
return { provide: GRAPHREFLY_NEST_CRON_SCHEDULER, useValue: new GraphCronSchedulerBridge(opts) };
|
|
51
|
+
}
|
|
52
|
+
function provideGraphLifecycleHooks(opts) {
|
|
53
|
+
return {
|
|
54
|
+
provide: GRAPHREFLY_NEST_LIFECYCLE_HOOKS,
|
|
55
|
+
useValue: new GraphLifecycleHooksBridge(opts)
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function provideGraphNativeHttpProviders(opts = {}) {
|
|
59
|
+
const providers = [];
|
|
60
|
+
if (opts.boundaryInterceptor !== false)
|
|
61
|
+
providers.push(provideGraphBoundaryInterceptor(opts.boundaryInterceptor ?? {}));
|
|
62
|
+
if (opts.guard !== false) providers.push(provideGraphGuard(opts.guard ?? {}));
|
|
63
|
+
if (opts.guardDeniedFilter ?? true) providers.push(provideGraphGuardDeniedFilter());
|
|
64
|
+
if (opts.exceptionFilter !== void 0)
|
|
65
|
+
providers.push(provideGraphExceptionFilter(opts.exceptionFilter));
|
|
66
|
+
return providers;
|
|
67
|
+
}
|
|
68
|
+
function provideGraphNativeProviders(opts = {}) {
|
|
69
|
+
const providers = [];
|
|
70
|
+
if (opts.http !== false) providers.push(...provideGraphNativeHttpProviders(opts.http ?? {}));
|
|
71
|
+
if (opts.cronScheduler !== void 0)
|
|
72
|
+
providers.push(provideGraphCronScheduler(opts.cronScheduler));
|
|
73
|
+
if (opts.lifecycleHooks !== void 0)
|
|
74
|
+
providers.push(provideGraphLifecycleHooks(opts.lifecycleHooks));
|
|
75
|
+
return providers;
|
|
76
|
+
}
|
|
77
|
+
function graphCronTarget(target, methodKey, opts) {
|
|
78
|
+
return { ...opts, target, methodKey };
|
|
79
|
+
}
|
|
80
|
+
function graphLifecycleTarget(target, methodKey, opts = {}) {
|
|
81
|
+
return { ...opts, target, methodKey };
|
|
82
|
+
}
|
|
83
|
+
function createGraphCronController(opts) {
|
|
84
|
+
return new GraphCronControllerImpl(opts);
|
|
85
|
+
}
|
|
86
|
+
var GraphBoundaryInterceptorBridge = class {
|
|
87
|
+
constructor(opts) {
|
|
88
|
+
this.opts = opts;
|
|
89
|
+
this.runner = createNestGraphBoundaryRunner({
|
|
90
|
+
diagnosticBoundary: opts.diagnosticBoundary,
|
|
91
|
+
diagnosticPhase: "http"
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
runner;
|
|
95
|
+
intercept(context, next) {
|
|
96
|
+
const host = this.opts.host?.(context) ?? defaultHttpHost(context);
|
|
97
|
+
const result = this.runner.run(
|
|
98
|
+
context.getClass(),
|
|
99
|
+
methodKeyForContext(context),
|
|
100
|
+
host,
|
|
101
|
+
this.opts
|
|
102
|
+
);
|
|
103
|
+
const reply = firstHttpReply(context);
|
|
104
|
+
const value = result === void 0 ? next.handle() : Promise.resolve(result).then(
|
|
105
|
+
(payload) => writeHttpResponse(
|
|
106
|
+
context,
|
|
107
|
+
lowerHttpReplyPayload(payload, host, {
|
|
108
|
+
issueResponse: reply?.issueResponse ?? this.opts.issueResponse
|
|
109
|
+
})
|
|
110
|
+
),
|
|
111
|
+
(errorPayload) => writeHttpResponse(
|
|
112
|
+
context,
|
|
113
|
+
lowerProtocolError(errorPayload, host, {
|
|
114
|
+
protocolError: reply?.protocolError ?? this.opts.protocolError
|
|
115
|
+
})
|
|
116
|
+
)
|
|
117
|
+
);
|
|
118
|
+
return isObservableLike(value) ? value : from(Promise.resolve(value));
|
|
119
|
+
}
|
|
120
|
+
onModuleDestroy() {
|
|
121
|
+
this.runner.dispose();
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
var GraphGuardBridge = class {
|
|
125
|
+
constructor(opts) {
|
|
126
|
+
this.opts = opts;
|
|
127
|
+
}
|
|
128
|
+
decisions = /* @__PURE__ */ new WeakMap();
|
|
129
|
+
disposableDecisions = /* @__PURE__ */ new Set();
|
|
130
|
+
async canActivate(context) {
|
|
131
|
+
const methodKey = methodKeyForContext(context);
|
|
132
|
+
const bindings = getNestBoundaryBindings(context.getClass(), methodKey);
|
|
133
|
+
const guards = bindings.filter(isGuardIngress);
|
|
134
|
+
if (guards.length === 0) return true;
|
|
135
|
+
const decisions = bindings.filter(isGuardDecision);
|
|
136
|
+
if (decisions.length === 0) return false;
|
|
137
|
+
const host = this.opts.host?.(context) ?? defaultHttpHost(context);
|
|
138
|
+
const guardEmits = guards.map((guard) => ({
|
|
139
|
+
guard,
|
|
140
|
+
requestId: bindingRequestId(host, guard, this.opts.requestId)
|
|
141
|
+
}));
|
|
142
|
+
if (guardEmits.some((entry) => entry.requestId === void 0)) return false;
|
|
143
|
+
const requestIds = new Set(guardEmits.map((entry) => entry.requestId));
|
|
144
|
+
const cleanups = [];
|
|
145
|
+
try {
|
|
146
|
+
const pending = [];
|
|
147
|
+
for (const requestId of requestIds) {
|
|
148
|
+
for (const decision of decisions) {
|
|
149
|
+
const state = { status: "pending", binding: decision };
|
|
150
|
+
pending.push(state);
|
|
151
|
+
cleanups.push(
|
|
152
|
+
this.decisionBoundary(decision).attach({
|
|
153
|
+
requestId,
|
|
154
|
+
bindingId: decision.bindingId,
|
|
155
|
+
handle: {
|
|
156
|
+
resolve(payload) {
|
|
157
|
+
state.status = "resolved";
|
|
158
|
+
state.payload = payload;
|
|
159
|
+
},
|
|
160
|
+
reject(error) {
|
|
161
|
+
state.status = "rejected";
|
|
162
|
+
state.error = error;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
})
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
for (const entry of guardEmits)
|
|
170
|
+
entry.guard.boundary.emit(host, bindingEmitOptions(host, entry.guard, entry.requestId));
|
|
171
|
+
const rejected = pending.find((state) => state.status === "rejected");
|
|
172
|
+
if (rejected !== void 0) {
|
|
173
|
+
throw new GraphGuardProtocolErrorException(
|
|
174
|
+
lowerProtocolError(rejected.error, host, {
|
|
175
|
+
protocolError: rejected.binding.protocolError ?? this.opts.protocolError
|
|
176
|
+
})
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
if (pending.some((state) => state.status !== "resolved")) return false;
|
|
180
|
+
const denied = pending.find(
|
|
181
|
+
(state) => state.status === "resolved" && state.payload?.kind === "deny"
|
|
182
|
+
);
|
|
183
|
+
if (denied !== void 0) {
|
|
184
|
+
throw new GraphGuardDeniedException(
|
|
185
|
+
guardDecisionResponse(denied.payload, host, {
|
|
186
|
+
issueResponse: denied.binding.issueResponse ?? this.opts.issueResponse
|
|
187
|
+
})
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
return pending.every((state) => state.payload?.kind === "allow");
|
|
191
|
+
} catch (error) {
|
|
192
|
+
if (isGraphGuardDeniedException(error) || error instanceof GraphGuardProtocolErrorException) {
|
|
193
|
+
throw error;
|
|
194
|
+
}
|
|
195
|
+
return false;
|
|
196
|
+
} finally {
|
|
197
|
+
for (const cleanup of cleanups) cleanup();
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
onModuleDestroy() {
|
|
201
|
+
for (const boundary of this.disposableDecisions) boundary.dispose();
|
|
202
|
+
this.disposableDecisions.clear();
|
|
203
|
+
}
|
|
204
|
+
decisionBoundary(binding) {
|
|
205
|
+
const node = binding.decisionNode;
|
|
206
|
+
let byBinding = this.decisions.get(node);
|
|
207
|
+
if (byBinding === void 0) {
|
|
208
|
+
byBinding = /* @__PURE__ */ new Map();
|
|
209
|
+
this.decisions.set(node, byBinding);
|
|
210
|
+
}
|
|
211
|
+
const existing = byBinding.get(binding.bindingId);
|
|
212
|
+
if (existing !== void 0) return existing;
|
|
213
|
+
const boundary = toNestHttp(binding.decisionNode, {
|
|
214
|
+
bindingId: binding.bindingId,
|
|
215
|
+
diagnosticBoundary: this.opts.diagnosticBoundary,
|
|
216
|
+
diagnosticPhase: "guard"
|
|
217
|
+
});
|
|
218
|
+
byBinding.set(binding.bindingId, boundary);
|
|
219
|
+
this.disposableDecisions.add(boundary);
|
|
220
|
+
return boundary;
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
var GraphExceptionFilterBridge = class {
|
|
224
|
+
constructor(opts) {
|
|
225
|
+
this.opts = opts;
|
|
226
|
+
}
|
|
227
|
+
replies = /* @__PURE__ */ new WeakMap();
|
|
228
|
+
disposableReplies = /* @__PURE__ */ new Set();
|
|
229
|
+
catch(exception, host) {
|
|
230
|
+
const target = this.opts.target(host, exception);
|
|
231
|
+
if (target === void 0) throw exception;
|
|
232
|
+
const bindings = getNestBoundaryBindings(target.target, target.methodKey);
|
|
233
|
+
const filters = bindings.filter(isErrorIngress);
|
|
234
|
+
if (filters.length === 0) throw exception;
|
|
235
|
+
const nativeHost = this.opts.host?.(host, exception) ?? defaultArgumentsHost(host, exception);
|
|
236
|
+
const filterEmits = filters.map((filter) => ({
|
|
237
|
+
filter,
|
|
238
|
+
requestId: bindingRequestId(nativeHost, filter, this.opts.requestId)
|
|
239
|
+
}));
|
|
240
|
+
const handleFilters = filterEmits.filter((entry) => entry.filter.mode !== "observe");
|
|
241
|
+
const observeOnly = handleFilters.length === 0;
|
|
242
|
+
const replies = bindings.filter(isHttpReply);
|
|
243
|
+
const cleanups = [];
|
|
244
|
+
const emitFilters = () => {
|
|
245
|
+
for (const entry of filterEmits) {
|
|
246
|
+
entry.filter.boundary.emit(
|
|
247
|
+
nativeHost,
|
|
248
|
+
bindingEmitOptions(nativeHost, entry.filter, entry.requestId)
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
if (observeOnly) {
|
|
253
|
+
emitFilters();
|
|
254
|
+
throw exception;
|
|
255
|
+
}
|
|
256
|
+
const requestIds = new Set(
|
|
257
|
+
handleFilters.map((entry) => entry.requestId).filter((requestId) => requestId !== void 0)
|
|
258
|
+
);
|
|
259
|
+
if (replies.length === 0 || requestIds.size === 0) {
|
|
260
|
+
for (const entry of filterEmits) {
|
|
261
|
+
if (entry.requestId === void 0) continue;
|
|
262
|
+
entry.filter.boundary.emit(
|
|
263
|
+
nativeHost,
|
|
264
|
+
bindingEmitOptions(nativeHost, entry.filter, entry.requestId)
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
const filter = handleFilters[0]?.filter;
|
|
268
|
+
const lowered = lowerCaughtException(exception, nativeHost, {
|
|
269
|
+
issueResponse: filter?.issueResponse ?? this.opts.issueResponse,
|
|
270
|
+
protocolError: filter?.protocolError ?? this.opts.protocolError
|
|
271
|
+
});
|
|
272
|
+
return writeHttpResponse(host, lowered);
|
|
273
|
+
}
|
|
274
|
+
const pending = [];
|
|
275
|
+
try {
|
|
276
|
+
for (const requestId of requestIds) {
|
|
277
|
+
for (const reply of replies) {
|
|
278
|
+
const state = { status: "pending", reply };
|
|
279
|
+
pending.push(state);
|
|
280
|
+
cleanups.push(
|
|
281
|
+
this.replyBoundary(reply).attach({
|
|
282
|
+
requestId,
|
|
283
|
+
bindingId: reply.bindingId,
|
|
284
|
+
handle: {
|
|
285
|
+
resolve(payload) {
|
|
286
|
+
state.status = "resolved";
|
|
287
|
+
state.payload = payload;
|
|
288
|
+
},
|
|
289
|
+
reject(error) {
|
|
290
|
+
state.status = "rejected";
|
|
291
|
+
state.error = error;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
})
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
emitFilters();
|
|
299
|
+
const resolved = pending.find((state) => state.status === "resolved");
|
|
300
|
+
if (resolved !== void 0) {
|
|
301
|
+
return writeHttpResponse(
|
|
302
|
+
host,
|
|
303
|
+
lowerHttpReplyPayload(resolved.payload, nativeHost, {
|
|
304
|
+
issueResponse: resolved.reply.issueResponse ?? handleFilters[0]?.filter.issueResponse ?? this.opts.issueResponse
|
|
305
|
+
})
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
const rejected = pending.find((state) => state.status === "rejected");
|
|
309
|
+
if (rejected !== void 0) {
|
|
310
|
+
return writeHttpResponse(
|
|
311
|
+
host,
|
|
312
|
+
lowerProtocolError(rejected.error, nativeHost, {
|
|
313
|
+
protocolError: rejected.reply.protocolError ?? handleFilters[0]?.filter.protocolError ?? this.opts.protocolError
|
|
314
|
+
})
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
const filter = handleFilters[0]?.filter;
|
|
318
|
+
return writeHttpResponse(
|
|
319
|
+
host,
|
|
320
|
+
lowerCaughtException(exception, nativeHost, {
|
|
321
|
+
issueResponse: filter?.issueResponse ?? this.opts.issueResponse,
|
|
322
|
+
protocolError: filter?.protocolError ?? this.opts.protocolError
|
|
323
|
+
})
|
|
324
|
+
);
|
|
325
|
+
} finally {
|
|
326
|
+
for (const cleanup of cleanups) cleanup();
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
onModuleDestroy() {
|
|
330
|
+
for (const boundary of this.disposableReplies) boundary.dispose();
|
|
331
|
+
this.disposableReplies.clear();
|
|
332
|
+
}
|
|
333
|
+
replyBoundary(binding) {
|
|
334
|
+
const node = binding.replyNode;
|
|
335
|
+
let byBinding = this.replies.get(node);
|
|
336
|
+
if (byBinding === void 0) {
|
|
337
|
+
byBinding = /* @__PURE__ */ new Map();
|
|
338
|
+
this.replies.set(node, byBinding);
|
|
339
|
+
}
|
|
340
|
+
const existing = byBinding.get(binding.bindingId);
|
|
341
|
+
if (existing !== void 0) return existing;
|
|
342
|
+
const boundary = toNestHttp(binding.replyNode, {
|
|
343
|
+
bindingId: binding.bindingId,
|
|
344
|
+
diagnosticBoundary: this.opts.diagnosticBoundary,
|
|
345
|
+
diagnosticPhase: "filter"
|
|
346
|
+
});
|
|
347
|
+
byBinding.set(binding.bindingId, boundary);
|
|
348
|
+
this.disposableReplies.add(boundary);
|
|
349
|
+
return boundary;
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
var GraphCronControllerImpl = class {
|
|
353
|
+
targets;
|
|
354
|
+
constructor(opts) {
|
|
355
|
+
this.targets = opts.targets.map((target) => ({
|
|
356
|
+
target,
|
|
357
|
+
schedule: parseCron(target.expr),
|
|
358
|
+
fired: /* @__PURE__ */ new Set()
|
|
359
|
+
}));
|
|
360
|
+
}
|
|
361
|
+
check(now) {
|
|
362
|
+
for (const entry of this.targets) {
|
|
363
|
+
emitCronTarget(entry.target, entry.schedule, entry.fired, now);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
var GraphCronSchedulerBridge = class {
|
|
368
|
+
constructor(opts) {
|
|
369
|
+
this.opts = opts;
|
|
370
|
+
}
|
|
371
|
+
timers = [];
|
|
372
|
+
onModuleInit() {
|
|
373
|
+
try {
|
|
374
|
+
for (const target of this.opts.targets) this.startTarget(target);
|
|
375
|
+
} catch (error) {
|
|
376
|
+
this.onModuleDestroy();
|
|
377
|
+
throw error;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
onModuleDestroy() {
|
|
381
|
+
for (const timer of this.timers.splice(0)) clearInterval(timer);
|
|
382
|
+
}
|
|
383
|
+
startTarget(target) {
|
|
384
|
+
const tickMs = target.tickMs ?? 6e4;
|
|
385
|
+
if (!Number.isFinite(tickMs) || tickMs <= 0) {
|
|
386
|
+
throw new RangeError("provideGraphCronScheduler: tickMs must be a positive finite number");
|
|
387
|
+
}
|
|
388
|
+
const controller = createGraphCronController({ targets: [target] });
|
|
389
|
+
const check = () => controller.check(/* @__PURE__ */ new Date());
|
|
390
|
+
check();
|
|
391
|
+
this.timers.push(setInterval(check, tickMs));
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
var GraphLifecycleHooksBridge = class {
|
|
395
|
+
constructor(opts) {
|
|
396
|
+
this.opts = opts;
|
|
397
|
+
}
|
|
398
|
+
onModuleInit() {
|
|
399
|
+
this.emit("module-init");
|
|
400
|
+
}
|
|
401
|
+
onModuleDestroy() {
|
|
402
|
+
this.emit("module-destroy");
|
|
403
|
+
}
|
|
404
|
+
emit(event) {
|
|
405
|
+
for (const target of this.opts.targets) {
|
|
406
|
+
if (target.event !== void 0 && target.event !== event) continue;
|
|
407
|
+
const host = target.host?.(event) ?? { event };
|
|
408
|
+
for (const binding of lifecycleBindings(target)) {
|
|
409
|
+
binding.boundary.emit(host, bindingEmitOptions(host, binding, void 0));
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
function methodKeyForContext(context) {
|
|
415
|
+
const resolved = resolveNestMethodKey(
|
|
416
|
+
context.getClass(),
|
|
417
|
+
context.getHandler()
|
|
418
|
+
);
|
|
419
|
+
return resolved ?? context.getHandler().name;
|
|
420
|
+
}
|
|
421
|
+
function defaultHttpHost(context) {
|
|
422
|
+
const request = context.switchToHttp?.().getRequest?.();
|
|
423
|
+
return request ?? {};
|
|
424
|
+
}
|
|
425
|
+
function defaultArgumentsHost(host, exception) {
|
|
426
|
+
const request = host.switchToHttp?.().getRequest?.();
|
|
427
|
+
if (request !== void 0 && request !== null) return { ...request, exception };
|
|
428
|
+
return { exception };
|
|
429
|
+
}
|
|
430
|
+
function isObservableLike(value) {
|
|
431
|
+
return value !== null && typeof value === "object" && typeof value.subscribe === "function";
|
|
432
|
+
}
|
|
433
|
+
function isGuardIngress(binding) {
|
|
434
|
+
return binding.direction === "ingress" && binding.kind === "guard";
|
|
435
|
+
}
|
|
436
|
+
function isErrorIngress(binding) {
|
|
437
|
+
return binding.direction === "ingress" && binding.kind === "error";
|
|
438
|
+
}
|
|
439
|
+
function isHttpReply(binding) {
|
|
440
|
+
return binding.direction === "egress" && binding.kind === "http";
|
|
441
|
+
}
|
|
442
|
+
function isGuardDecision(binding) {
|
|
443
|
+
return binding.direction === "egress" && binding.kind === "guard-decision";
|
|
444
|
+
}
|
|
445
|
+
function firstHttpReply(context) {
|
|
446
|
+
return getNestBoundaryBindings(context.getClass(), methodKeyForContext(context)).find(
|
|
447
|
+
isHttpReply
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
function lifecycleBindings(target) {
|
|
451
|
+
return getNestBoundaryBindings(target.target, target.methodKey).filter(
|
|
452
|
+
(binding) => binding.direction === "ingress" && binding.kind === "lifecycle"
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
function cronBindings(target) {
|
|
456
|
+
return getNestBoundaryBindings(target.target, target.methodKey).filter(
|
|
457
|
+
(binding) => binding.direction === "ingress" && binding.kind === "cron"
|
|
458
|
+
);
|
|
459
|
+
}
|
|
460
|
+
function emitCronTarget(target, schedule, fired, now) {
|
|
461
|
+
if (!matchesCron(schedule, now, { timezone: target.timezone })) return;
|
|
462
|
+
const key = cronProviderMinuteKey(now, target.timezone);
|
|
463
|
+
for (const existing of fired) {
|
|
464
|
+
if (!existing.startsWith(`${key.dayKey}:`)) fired.delete(existing);
|
|
465
|
+
}
|
|
466
|
+
if (fired.has(key.minuteKey)) return;
|
|
467
|
+
fired.add(key.minuteKey);
|
|
468
|
+
const host = target.host?.(now) ?? {
|
|
469
|
+
iso: now.toISOString(),
|
|
470
|
+
timestamp_ms: now.getTime(),
|
|
471
|
+
timestamp_ns: (BigInt(now.getTime()) * 1000000n).toString(),
|
|
472
|
+
timezone: target.timezone
|
|
473
|
+
};
|
|
474
|
+
for (const binding of cronBindings(target)) {
|
|
475
|
+
binding.boundary.emit(host, bindingEmitOptions(host, binding, void 0));
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
function cronProviderMinuteKey(date, timezone) {
|
|
479
|
+
if (timezone === void 0) {
|
|
480
|
+
const dayKey2 = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
|
|
481
|
+
return { dayKey: dayKey2, minuteKey: `${dayKey2}:${date.getHours()}:${date.getMinutes()}` };
|
|
482
|
+
}
|
|
483
|
+
const parts = new Intl.DateTimeFormat("en-US-u-ca-gregory-nu-latn", {
|
|
484
|
+
timeZone: timezone,
|
|
485
|
+
year: "numeric",
|
|
486
|
+
month: "2-digit",
|
|
487
|
+
day: "2-digit",
|
|
488
|
+
hour: "2-digit",
|
|
489
|
+
minute: "2-digit",
|
|
490
|
+
hourCycle: "h23"
|
|
491
|
+
}).formatToParts(date);
|
|
492
|
+
const byType = new Map(parts.map((part) => [part.type, part.value]));
|
|
493
|
+
const dayKey = `${byType.get("year")}-${byType.get("month")}-${byType.get("day")}`;
|
|
494
|
+
return { dayKey, minuteKey: `${dayKey}:${byType.get("hour")}:${byType.get("minute")}` };
|
|
495
|
+
}
|
|
496
|
+
function lowerCaughtException(exception, host, opts) {
|
|
497
|
+
if (isDataIssue(exception)) return lowerHttpReplyPayload(exception, host, opts);
|
|
498
|
+
return (opts.protocolError ?? protocolError)(exception, host);
|
|
499
|
+
}
|
|
500
|
+
function guardDecisionResponse(decision, host, opts) {
|
|
501
|
+
if (decision.issue !== void 0) return lowerHttpReplyPayload(decision.issue, host, opts);
|
|
502
|
+
if (Number.isInteger(decision.status)) {
|
|
503
|
+
return {
|
|
504
|
+
status: decision.status,
|
|
505
|
+
body: decision.body ?? {
|
|
506
|
+
code: "graphrefly.guard_denied",
|
|
507
|
+
message: decision.reason ?? "GraphReFly guard denied request"
|
|
508
|
+
},
|
|
509
|
+
headers: decision.headers
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
return {
|
|
513
|
+
status: 403,
|
|
514
|
+
body: {
|
|
515
|
+
code: "graphrefly.guard_denied",
|
|
516
|
+
message: decision.reason ?? "GraphReFly guard denied request"
|
|
517
|
+
},
|
|
518
|
+
headers: decision.headers
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
var GraphGuardDeniedException = class extends HttpException {
|
|
522
|
+
payload;
|
|
523
|
+
constructor(payload) {
|
|
524
|
+
super(payload.body ?? {}, payload.status);
|
|
525
|
+
this.payload = payload;
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
var GraphGuardProtocolErrorException = class extends HttpException {
|
|
529
|
+
constructor(payload) {
|
|
530
|
+
super(payload.body ?? {}, payload.status);
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
function isGraphGuardDeniedException(value) {
|
|
534
|
+
return value instanceof GraphGuardDeniedException;
|
|
535
|
+
}
|
|
536
|
+
var GraphGuardDeniedFilter = class {
|
|
537
|
+
catch(exception, host) {
|
|
538
|
+
if (!isGraphGuardDeniedException(exception)) throw exception;
|
|
539
|
+
return writeHttpResponse(host, exception.payload);
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
Catch(GraphGuardDeniedException)(GraphGuardDeniedFilter);
|
|
543
|
+
function writeHttpResponse(host, payload) {
|
|
544
|
+
const response = host.switchToHttp?.().getResponse?.();
|
|
545
|
+
if (response === void 0) return payload;
|
|
546
|
+
for (const [name, value] of Object.entries(payload.headers ?? {})) {
|
|
547
|
+
if (typeof response.setHeader === "function") response.setHeader(name, value);
|
|
548
|
+
else response.header?.(name, value);
|
|
549
|
+
}
|
|
550
|
+
response.status?.(payload.status);
|
|
551
|
+
if (typeof response.json === "function") return response.json(payload.body ?? {});
|
|
552
|
+
if (typeof response.send === "function") return response.send(payload.body);
|
|
553
|
+
return payload;
|
|
554
|
+
}
|
|
555
|
+
export {
|
|
556
|
+
GRAPHREFLY_NEST_CRON_SCHEDULER,
|
|
557
|
+
GRAPHREFLY_NEST_EXCEPTION_FILTER,
|
|
558
|
+
GRAPHREFLY_NEST_LIFECYCLE_HOOKS,
|
|
559
|
+
GraphExceptionFilterBridge,
|
|
560
|
+
GraphGuardDeniedException,
|
|
561
|
+
GraphGuardDeniedFilter,
|
|
562
|
+
createGraphCronController,
|
|
563
|
+
createGraphExceptionFilter,
|
|
564
|
+
createGraphGuardDeniedFilter,
|
|
565
|
+
graphCronTarget,
|
|
566
|
+
graphLifecycleTarget,
|
|
567
|
+
isGraphGuardDeniedException,
|
|
568
|
+
provideGraphBoundaryInterceptor,
|
|
569
|
+
provideGraphCronScheduler,
|
|
570
|
+
provideGraphExceptionFilter,
|
|
571
|
+
provideGraphGuard,
|
|
572
|
+
provideGraphGuardDeniedFilter,
|
|
573
|
+
provideGraphLifecycleHooks,
|
|
574
|
+
provideGraphNativeHttpProviders,
|
|
575
|
+
provideGraphNativeProviders
|
|
576
|
+
};
|
|
577
|
+
//# sourceMappingURL=native.js.map
|