@burdenoff/be-sdk 2026.1110.2 → 2026.1110.4
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/configs/eslint/index.js +1 -1
- package/configs/tsconfig/tsconfig.json +1 -1
- package/dist/EventQueueFactory-9NGZV9jl.js +1457 -0
- package/dist/EventQueueFactory-9NGZV9jl.js.map +1 -0
- package/dist/RedisStreamsConnection-CY8WySJy.js +283 -0
- package/dist/RedisStreamsConnection-CY8WySJy.js.map +1 -0
- package/dist/activity/index.d.ts +165 -0
- package/dist/activity/index.js +389 -0
- package/dist/activity/index.js.map +1 -0
- package/dist/ai-credits/index.d.ts +2 -3
- package/dist/ai-credits/index.js +3 -4
- package/dist/ai-credits/index.js.map +1 -1
- package/dist/ai-credits-xxfwGpHS.js +546 -0
- package/dist/ai-credits-xxfwGpHS.js.map +1 -0
- package/dist/{assistant-session-CJZhF4D6.d.ts → assistant-session-DA5ZKJOr.d.ts} +4 -5
- package/dist/auth/index.d.ts +2 -77
- package/dist/auth/index.js +3 -7
- package/dist/auth/index.js.map +1 -1
- package/dist/auth-C5ctwSLp.js +228 -0
- package/dist/auth-C5ctwSLp.js.map +1 -0
- package/dist/bootstrap/index.d.ts +74 -0
- package/dist/bootstrap/index.js +282 -0
- package/dist/bootstrap/index.js.map +1 -0
- package/dist/cache/index.d.ts +2 -3
- package/dist/cache/index.js +3 -7
- package/dist/cache/index.js.map +1 -1
- package/dist/cache-CU0uLwcS.js +1837 -0
- package/dist/cache-CU0uLwcS.js.map +1 -0
- package/dist/captcha/index.d.ts +2 -1
- package/dist/captcha/index.js +3 -3
- package/dist/captcha/index.js.map +1 -1
- package/dist/captcha-BT7yh1YS.js +77 -0
- package/dist/captcha-BT7yh1YS.js.map +1 -0
- package/dist/client/internal-client.d.ts +4 -7
- package/dist/client/internal-client.js +172 -4
- package/dist/client/internal-client.js.map +1 -1
- package/dist/client-BgAEvDC2.d.ts +86 -0
- package/dist/client-sAJTrb4i.js +565 -0
- package/dist/client-sAJTrb4i.js.map +1 -0
- package/dist/collector-endpoint-iyQYeI50.js +50 -0
- package/dist/collector-endpoint-iyQYeI50.js.map +1 -0
- package/dist/context/index.d.ts +35 -0
- package/dist/context/index.js +283 -0
- package/dist/context/index.js.map +1 -0
- package/dist/crypto/index.d.ts +2 -1
- package/dist/crypto/index.js +3 -3
- package/dist/crypto/index.js.map +1 -1
- package/dist/crypto-DO9fM0FO.js +145 -0
- package/dist/crypto-DO9fM0FO.js.map +1 -0
- package/dist/database/index.d.ts +104 -108
- package/dist/database/index.js +468 -6
- package/dist/database/index.js.map +1 -1
- package/dist/dataloader/index.d.ts +2 -1
- package/dist/dataloader/index.js +3 -3
- package/dist/dataloader/index.js.map +1 -1
- package/dist/dataloader-DwpT3YoS.js +294 -0
- package/dist/dataloader-DwpT3YoS.js.map +1 -0
- package/dist/deployed-environment-p_Tdl3sT.js +38 -0
- package/dist/deployed-environment-p_Tdl3sT.js.map +1 -0
- package/dist/dist-BGKdXVy3.js +1718 -0
- package/dist/dist-BGKdXVy3.js.map +1 -0
- package/dist/env-DdaoGjIt.js +74 -0
- package/dist/env-DdaoGjIt.js.map +1 -0
- package/dist/event-queue/index.d.ts +2 -7
- package/dist/event-queue/index.js +7 -9
- package/dist/event-queue/index.js.map +1 -1
- package/dist/event-queue-Cw-YJPY_.js +1384 -0
- package/dist/event-queue-Cw-YJPY_.js.map +1 -0
- package/dist/{explicit-activity-scope-CCoxVwAr.d.ts → explicit-activity-scope-D8VeGGpt.d.ts} +1 -2
- package/dist/explicit-activity-scope-DikJ7NAE.js +57 -0
- package/dist/explicit-activity-scope-DikJ7NAE.js.map +1 -0
- package/dist/export/index.d.ts +2 -2
- package/dist/export/index.js +3 -14
- package/dist/export/index.js.map +1 -1
- package/dist/export-DJXE3Osa.js +642 -0
- package/dist/export-DJXE3Osa.js.map +1 -0
- package/dist/feature-flags/index.d.ts +2 -10
- package/dist/feature-flags/index.js +3 -6
- package/dist/feature-flags/index.js.map +1 -1
- package/dist/feature-flags-CP1KRgwD.js +422 -0
- package/dist/feature-flags-CP1KRgwD.js.map +1 -0
- package/dist/files/index.d.ts +2 -3
- package/dist/files/index.js +3 -4
- package/dist/files/index.js.map +1 -1
- package/dist/files-h5U-D2AF.js +830 -0
- package/dist/files-h5U-D2AF.js.map +1 -0
- package/dist/gateway/index.d.ts +4 -6
- package/dist/gateway/index.js +7 -13
- package/dist/gateway/index.js.map +1 -1
- package/dist/gateway/security/index.d.ts +2 -2
- package/dist/gateway/security/index.js +3 -5
- package/dist/gateway/security/index.js.map +1 -1
- package/dist/gateway-ByVo-n37.js +50 -0
- package/dist/gateway-ByVo-n37.js.map +1 -0
- package/dist/graph/index.d.ts +3 -10
- package/dist/graph/index.js +4 -13
- package/dist/graph/index.js.map +1 -1
- package/dist/graph-CR7u4lpl.js +2152 -0
- package/dist/graph-CR7u4lpl.js.map +1 -0
- package/dist/graph-emitter-CdOXP7Tn.js +621 -0
- package/dist/graph-emitter-CdOXP7Tn.js.map +1 -0
- package/dist/graphql/index.d.ts +3 -2
- package/dist/graphql/index.js +4 -6
- package/dist/graphql/index.js.map +1 -1
- package/dist/graphql/services/index.d.ts +2 -24
- package/dist/graphql/services/index.js +3 -4
- package/dist/graphql/services/index.js.map +1 -1
- package/dist/graphql-CUDyhibV.d.ts +21 -0
- package/dist/graphql-DHAHHcww.js +161 -0
- package/dist/graphql-DHAHHcww.js.map +1 -0
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/index.js +3 -4
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n-BBMYFd0P.js +860 -0
- package/dist/i18n-BBMYFd0P.js.map +1 -0
- package/dist/import-optional-peer-B82VYxeX.js +18 -0
- package/dist/import-optional-peer-B82VYxeX.js.map +1 -0
- package/dist/index-3KOZ1zN9.d.ts +233 -0
- package/dist/index-ADmsX0BI.d.ts +646 -0
- package/dist/index-B2LCaK0R.d.ts +500 -0
- package/dist/index-BBqooJ52.d.ts +45 -0
- package/dist/index-BGzMYJsm.d.ts +209 -0
- package/dist/index-BMIMnp6T.d.ts +8 -0
- package/dist/index-BVOL7458.d.ts +10 -0
- package/dist/index-BcqQs-Uq.d.ts +69 -0
- package/dist/index-BeVtqGO-.d.ts +208 -0
- package/dist/index-BiTzGUZP.d.ts +114 -0
- package/dist/index-C0qLquY0.d.ts +150 -0
- package/dist/index-C5uEKchX.d.ts +60 -0
- package/dist/index-CDOqxSIi.d.ts +37 -0
- package/dist/index-CG6wj66Y.d.ts +148 -0
- package/dist/index-CHwMhK6v.d.ts +63 -0
- package/dist/index-CIgoeobA.d.ts +145 -0
- package/dist/index-CPQDMSFS.d.ts +103 -0
- package/dist/index-CSRcgkVi.d.ts +23 -0
- package/dist/index-CTTwo9av.d.ts +102 -0
- package/dist/index-CVCyKzhB.d.ts +207 -0
- package/dist/index-C_GXXF32.d.ts +704 -0
- package/dist/index-CaM9JUcc.d.ts +144 -0
- package/dist/index-CliOgq6L.d.ts +203 -0
- package/dist/index-Cot73bdh.d.ts +63 -0
- package/dist/index-DGgh9DWn.d.ts +59 -0
- package/dist/index-DY3dNhMN.d.ts +420 -0
- package/dist/index-DqbGqfAy.d.ts +127 -0
- package/dist/index-Dt1HJPTX.d.ts +12 -0
- package/dist/index-DtI6aBtB.d.ts +22 -0
- package/dist/index-FKohsiex.d.ts +38 -0
- package/dist/index-FRRaa6h2.d.ts +999 -0
- package/dist/index-FbXPfen7.d.ts +132 -0
- package/dist/index-MArCb8Aq.d.ts +306 -0
- package/dist/index-U_tu3zUl.d.ts +303 -0
- package/dist/index-YOShAwkq.d.ts +45 -0
- package/dist/index-cmR9k9ga.d.ts +26 -0
- package/dist/index-yBSjMY32.d.ts +24 -0
- package/dist/index-zd_NPGJo.d.ts +206 -0
- package/dist/index.d.ts +106 -609
- package/dist/index.js +769 -2590
- package/dist/index.js.map +1 -1
- package/dist/init/index.d.ts +2 -2
- package/dist/init/index.js +3 -16
- package/dist/init/index.js.map +1 -1
- package/dist/init-CQPFmOOe.js +325 -0
- package/dist/init-CQPFmOOe.js.map +1 -0
- package/dist/instrumentation/index.d.ts +3 -4
- package/dist/instrumentation/index.js +5 -5
- package/dist/instrumentation/index.js.map +1 -1
- package/dist/instrumentation-xkkmDgJ0.js +1678 -0
- package/dist/instrumentation-xkkmDgJ0.js.map +1 -0
- package/dist/lake/index.d.ts +50 -54
- package/dist/lake/index.js +169 -193
- package/dist/lake/index.js.map +1 -1
- package/dist/layer/index.d.ts +3 -2
- package/dist/layer/index.js +4 -5
- package/dist/layer/index.js.map +1 -1
- package/dist/layer-BZBZZWeV.d.ts +69 -0
- package/dist/layer-Bcix-WCl.js +105 -0
- package/dist/layer-Bcix-WCl.js.map +1 -0
- package/dist/layer-CEKy6cm8.js +252 -0
- package/dist/layer-CEKy6cm8.js.map +1 -0
- package/dist/lifecycle/index.d.ts +2 -1
- package/dist/lifecycle/index.js +3 -4
- package/dist/lifecycle/index.js.map +1 -1
- package/dist/lifecycle-DeoLSX0U.js +76 -0
- package/dist/lifecycle-DeoLSX0U.js.map +1 -0
- package/dist/logger/index.d.ts +2 -3
- package/dist/logger/index.js +3 -3
- package/dist/logger/index.js.map +1 -1
- package/dist/logger-B6rCpb7D.js +290 -0
- package/dist/logger-B6rCpb7D.js.map +1 -0
- package/dist/metrics/index.d.ts +13 -14
- package/dist/metrics/index.js +3 -4
- package/dist/metrics/index.js.map +1 -1
- package/dist/metrics-BrLwNUrb.js +52 -0
- package/dist/metrics-BrLwNUrb.js.map +1 -0
- package/dist/metrics-collector-C2eShrlW.js +922 -0
- package/dist/metrics-collector-C2eShrlW.js.map +1 -0
- package/dist/middleware/index.d.ts +3 -3
- package/dist/middleware/index.js +3 -4
- package/dist/middleware/index.js.map +1 -1
- package/dist/middleware-CUxJVUpD.js +1243 -0
- package/dist/middleware-CUxJVUpD.js.map +1 -0
- package/dist/middleware-Cq0zFMGp.js +253 -0
- package/dist/middleware-Cq0zFMGp.js.map +1 -0
- package/dist/notifications/index.d.ts +2 -5
- package/dist/notifications/index.js +3 -6
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications-DY_i37WN.js +869 -0
- package/dist/notifications-DY_i37WN.js.map +1 -0
- package/dist/observability/index.d.ts +2 -3
- package/dist/observability/index.js +3 -4
- package/dist/observability/index.js.map +1 -1
- package/dist/observability-DBDXipTU.js +272 -0
- package/dist/observability-DBDXipTU.js.map +1 -0
- package/dist/payments/index.d.ts +144 -0
- package/dist/payments/index.js +404 -0
- package/dist/payments/index.js.map +1 -0
- package/dist/platform/index.d.ts +2 -1
- package/dist/platform/index.js +3 -5
- package/dist/platform/index.js.map +1 -1
- package/dist/platform-DZwczW7v.js +1510 -0
- package/dist/platform-DZwczW7v.js.map +1 -0
- package/dist/prisma/generator/index.d.ts +1 -1
- package/dist/prisma/generator/index.js +97 -84
- package/dist/prisma/generator/index.js.map +1 -1
- package/dist/prisma/index.d.ts +4 -7
- package/dist/prisma/index.js +5 -12
- package/dist/prisma/index.js.map +1 -1
- package/dist/prisma-BzOOdt79.js +863 -0
- package/dist/prisma-BzOOdt79.js.map +1 -0
- package/dist/prisma-extension-Cfl09swM.d.ts +172 -0
- package/dist/product-alias/index.d.ts +2 -1
- package/dist/product-alias/index.js +3 -3
- package/dist/product-alias/index.js.map +1 -1
- package/dist/product-alias-BPqtskMq.js +273 -0
- package/dist/product-alias-BPqtskMq.js.map +1 -0
- package/dist/rate-limit-CBrK_U5H.js +142 -0
- package/dist/rate-limit-CBrK_U5H.js.map +1 -0
- package/dist/rbac/index.d.ts +2 -122
- package/dist/rbac/index.js +3 -6
- package/dist/rbac/index.js.map +1 -1
- package/dist/rbac-Dvz0YzEt.js +1486 -0
- package/dist/rbac-Dvz0YzEt.js.map +1 -0
- package/dist/resource-caps/index.d.ts +66 -72
- package/dist/resource-caps/index.js +430 -5
- package/dist/resource-caps/index.js.map +1 -1
- package/dist/rolldown-runtime-ad2WFvuA.js +17 -0
- package/dist/sdk-Dju9o-sq.js +124 -0
- package/dist/sdk-Dju9o-sq.js.map +1 -0
- package/dist/search/index.d.ts +112 -0
- package/dist/search/index.js +266 -0
- package/dist/search/index.js.map +1 -0
- package/dist/security/index.d.ts +2 -0
- package/dist/security/index.js +4 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/rate-limit/index.d.ts +2 -0
- package/dist/security/rate-limit/index.js +4 -0
- package/dist/security/rate-limit/index.js.map +1 -0
- package/dist/security-DIG-95Ic.js +1647 -0
- package/dist/security-DIG-95Ic.js.map +1 -0
- package/dist/server/index.d.ts +7 -164
- package/dist/server/index.js +2001 -1507
- package/dist/server/index.js.map +1 -1
- package/dist/service-jwt-Bu-WNA_-.js +80 -0
- package/dist/service-jwt-Bu-WNA_-.js.map +1 -0
- package/dist/services-BWzfz7vG.js +102 -0
- package/dist/services-BWzfz7vG.js.map +1 -0
- package/dist/sharding/index.d.ts +41 -44
- package/dist/sharding/index.js +156 -137
- package/dist/sharding/index.js.map +1 -1
- package/dist/sharing/index.d.ts +2 -1
- package/dist/sharing/index.js +3 -4
- package/dist/sharing/index.js.map +1 -1
- package/dist/sharing-CflDsSJ-.js +911 -0
- package/dist/sharing-CflDsSJ-.js.map +1 -0
- package/dist/stub-BUnfMiAS.js +577 -0
- package/dist/stub-BUnfMiAS.js.map +1 -0
- package/dist/tags/index.d.ts +2 -3
- package/dist/tags/index.js +3 -4
- package/dist/tags/index.js.map +1 -1
- package/dist/tags-CbijgoqR.js +868 -0
- package/dist/{chunk-PBZFAAOM.js.map → tags-CbijgoqR.js.map} +1 -1
- package/dist/telemetry/index.d.ts +64 -76
- package/dist/telemetry/index.js +369 -201
- package/dist/telemetry/index.js.map +1 -1
- package/dist/temporal/index.d.ts +2 -148
- package/dist/temporal/index.js +3 -5
- package/dist/temporal/index.js.map +1 -1
- package/dist/temporal-B534uYK8.js +706 -0
- package/dist/temporal-B534uYK8.js.map +1 -0
- package/dist/tracker/index.d.ts +5 -11
- package/dist/tracker/index.js +7 -20
- package/dist/tracker/index.js.map +1 -1
- package/dist/tracker-PQztSlhJ.js +458 -0
- package/dist/tracker-PQztSlhJ.js.map +1 -0
- package/dist/translation/index.d.ts +120 -0
- package/dist/translation/index.js +573 -0
- package/dist/translation/index.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +90 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types-BYMYND1L.js +44 -0
- package/dist/types-BYMYND1L.js.map +1 -0
- package/dist/types-C6EKaS3V.d.ts +106 -0
- package/dist/types-CWybW61E.d.ts +323 -0
- package/dist/types-C_yfu3XK.d.ts +34 -0
- package/dist/types-DgaQqvxo.d.ts +70 -0
- package/dist/usage/index.d.ts +2 -213
- package/dist/usage/index.js +3 -15
- package/dist/usage/index.js.map +1 -1
- package/dist/usage-BRqVP3CJ.js +682 -0
- package/dist/usage-BRqVP3CJ.js.map +1 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +3 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils-DL85Tnbn.js +500 -0
- package/dist/utils-DL85Tnbn.js.map +1 -0
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +3 -3
- package/dist/validation/index.js.map +1 -1
- package/dist/validation-CPUITdMk.js +762 -0
- package/dist/validation-CPUITdMk.js.map +1 -0
- package/dist/workspace-extension-COrC0dYi.js +979 -0
- package/dist/workspace-extension-COrC0dYi.js.map +1 -0
- package/dist/{workspace-extension-BGwTOV_r.d.ts → workspace-extension-DTFTdGVF.d.ts} +43 -45
- package/package.json +7 -10
- package/dist/EventQueueFactory-GXC3A7DH.js +0 -8
- package/dist/EventQueueFactory-GXC3A7DH.js.map +0 -1
- package/dist/chunk-4XIBXZ6J.js +0 -276
- package/dist/chunk-4XIBXZ6J.js.map +0 -1
- package/dist/chunk-554Z4C2K.js +0 -1006
- package/dist/chunk-554Z4C2K.js.map +0 -1
- package/dist/chunk-5CAFHK2Z.js +0 -107
- package/dist/chunk-5CAFHK2Z.js.map +0 -1
- package/dist/chunk-63ZXJ42X.js +0 -451
- package/dist/chunk-63ZXJ42X.js.map +0 -1
- package/dist/chunk-6XEXJATV.js +0 -304
- package/dist/chunk-6XEXJATV.js.map +0 -1
- package/dist/chunk-726AR6Q7.js +0 -1532
- package/dist/chunk-726AR6Q7.js.map +0 -1
- package/dist/chunk-A5F6Z5UE.js +0 -21
- package/dist/chunk-A5F6Z5UE.js.map +0 -1
- package/dist/chunk-A6DE32ZS.js +0 -1507
- package/dist/chunk-A6DE32ZS.js.map +0 -1
- package/dist/chunk-AXJDGQPE.js +0 -690
- package/dist/chunk-AXJDGQPE.js.map +0 -1
- package/dist/chunk-BJQOGOVW.js +0 -602
- package/dist/chunk-BJQOGOVW.js.map +0 -1
- package/dist/chunk-CFXWH2IS.js +0 -52
- package/dist/chunk-CFXWH2IS.js.map +0 -1
- package/dist/chunk-DRWH5XCJ.js +0 -876
- package/dist/chunk-DRWH5XCJ.js.map +0 -1
- package/dist/chunk-E4QNLVY4.js +0 -909
- package/dist/chunk-E4QNLVY4.js.map +0 -1
- package/dist/chunk-EBDHIL7V.js +0 -774
- package/dist/chunk-EBDHIL7V.js.map +0 -1
- package/dist/chunk-ELU7VL3E.js +0 -245
- package/dist/chunk-ELU7VL3E.js.map +0 -1
- package/dist/chunk-FZRODKIN.js +0 -31
- package/dist/chunk-FZRODKIN.js.map +0 -1
- package/dist/chunk-GCIB76AJ.js +0 -882
- package/dist/chunk-GCIB76AJ.js.map +0 -1
- package/dist/chunk-HC6MPUIH.js +0 -1571
- package/dist/chunk-HC6MPUIH.js.map +0 -1
- package/dist/chunk-HNMHPSAM.js +0 -272
- package/dist/chunk-HNMHPSAM.js.map +0 -1
- package/dist/chunk-HTLEGD3Q.js +0 -1480
- package/dist/chunk-HTLEGD3Q.js.map +0 -1
- package/dist/chunk-I3KOWRT3.js +0 -89
- package/dist/chunk-I3KOWRT3.js.map +0 -1
- package/dist/chunk-ID3WR4JS.js +0 -509
- package/dist/chunk-ID3WR4JS.js.map +0 -1
- package/dist/chunk-JS52ZHTK.js +0 -1346
- package/dist/chunk-JS52ZHTK.js.map +0 -1
- package/dist/chunk-JVMAQOA3.js +0 -521
- package/dist/chunk-JVMAQOA3.js.map +0 -1
- package/dist/chunk-KH4TRQCO.js +0 -1063
- package/dist/chunk-KH4TRQCO.js.map +0 -1
- package/dist/chunk-KJOSPVB2.js +0 -57
- package/dist/chunk-KJOSPVB2.js.map +0 -1
- package/dist/chunk-KO2ZXZ7W.js +0 -61
- package/dist/chunk-KO2ZXZ7W.js.map +0 -1
- package/dist/chunk-KS2HQCJR.js +0 -56
- package/dist/chunk-KS2HQCJR.js.map +0 -1
- package/dist/chunk-LA5KPWZ2.js +0 -413
- package/dist/chunk-LA5KPWZ2.js.map +0 -1
- package/dist/chunk-MESLAC5W.js +0 -574
- package/dist/chunk-MESLAC5W.js.map +0 -1
- package/dist/chunk-MWPYA2HD.js +0 -94
- package/dist/chunk-MWPYA2HD.js.map +0 -1
- package/dist/chunk-NUB5GQTU.js +0 -270
- package/dist/chunk-NUB5GQTU.js.map +0 -1
- package/dist/chunk-OBBCR6WY.js +0 -277
- package/dist/chunk-OBBCR6WY.js.map +0 -1
- package/dist/chunk-OQDSAOG3.js +0 -1908
- package/dist/chunk-OQDSAOG3.js.map +0 -1
- package/dist/chunk-OXNCBE7P.js +0 -971
- package/dist/chunk-OXNCBE7P.js.map +0 -1
- package/dist/chunk-PBZFAAOM.js +0 -941
- package/dist/chunk-PN6GIF3R.js +0 -1185
- package/dist/chunk-PN6GIF3R.js.map +0 -1
- package/dist/chunk-PYD44IHJ.js +0 -728
- package/dist/chunk-PYD44IHJ.js.map +0 -1
- package/dist/chunk-QVPIACWD.js +0 -679
- package/dist/chunk-QVPIACWD.js.map +0 -1
- package/dist/chunk-QWNNFE4P.js +0 -41
- package/dist/chunk-QWNNFE4P.js.map +0 -1
- package/dist/chunk-RU266375.js +0 -327
- package/dist/chunk-RU266375.js.map +0 -1
- package/dist/chunk-RYTSVGGA.js +0 -1624
- package/dist/chunk-RYTSVGGA.js.map +0 -1
- package/dist/chunk-RZOFS2BQ.js +0 -225
- package/dist/chunk-RZOFS2BQ.js.map +0 -1
- package/dist/chunk-SBS4S2PJ.js +0 -100
- package/dist/chunk-SBS4S2PJ.js.map +0 -1
- package/dist/chunk-SPRG6G6G.js +0 -530
- package/dist/chunk-SPRG6G6G.js.map +0 -1
- package/dist/chunk-STWFX5E2.js +0 -233
- package/dist/chunk-STWFX5E2.js.map +0 -1
- package/dist/chunk-UNASM5VJ.js +0 -419
- package/dist/chunk-UNASM5VJ.js.map +0 -1
- package/dist/chunk-VAT66FJA.js +0 -245
- package/dist/chunk-VAT66FJA.js.map +0 -1
- package/dist/chunk-VFCMR5GX.js +0 -49
- package/dist/chunk-VFCMR5GX.js.map +0 -1
- package/dist/chunk-VGAHZKNJ.js +0 -66
- package/dist/chunk-VGAHZKNJ.js.map +0 -1
- package/dist/chunk-VTJTAAXC.js +0 -627
- package/dist/chunk-VTJTAAXC.js.map +0 -1
- package/dist/chunk-VXVLKRU6.js +0 -758
- package/dist/chunk-VXVLKRU6.js.map +0 -1
- package/dist/chunk-WWUU5ETI.js +0 -163
- package/dist/chunk-WWUU5ETI.js.map +0 -1
- package/dist/chunk-XE4OXN2W.js +0 -10
- package/dist/chunk-XE4OXN2W.js.map +0 -1
- package/dist/chunk-XOJORS75.js +0 -1853
- package/dist/chunk-XOJORS75.js.map +0 -1
- package/dist/chunk-YMZEUTD2.js +0 -110
- package/dist/chunk-YMZEUTD2.js.map +0 -1
- package/dist/chunk-Z77BTSOK.js +0 -617
- package/dist/chunk-Z77BTSOK.js.map +0 -1
- package/dist/chunk-ZZK3WEDI.js +0 -181
- package/dist/chunk-ZZK3WEDI.js.map +0 -1
- package/dist/client-CCXpAZ2r.d.ts +0 -89
- package/dist/client-DSI_760t.d.ts +0 -36
- package/dist/client-JU6T3UPB.js +0 -11
- package/dist/client-JU6T3UPB.js.map +0 -1
- package/dist/dist-2X4Q7PJA.js +0 -1491
- package/dist/dist-2X4Q7PJA.js.map +0 -1
- package/dist/env-4UWSUS64.js +0 -4
- package/dist/env-4UWSUS64.js.map +0 -1
- package/dist/graph-emitter-r5TylDBm.d.ts +0 -47
- package/dist/graphql-CMHMQjvd.d.ts +0 -23
- package/dist/i18n-Qm2AkPC-.d.ts +0 -33
- package/dist/index--yvpa6ay.d.ts +0 -83
- package/dist/index-4gKQKZ2B.d.ts +0 -71
- package/dist/index-5x0XMKXN.d.ts +0 -149
- package/dist/index-B70b5mYS.d.ts +0 -33
- package/dist/index-B8KrxO4j.d.ts +0 -755
- package/dist/index-BOuDKnqD.d.ts +0 -201
- package/dist/index-BTMt4OjA.d.ts +0 -201
- package/dist/index-BejbszA7.d.ts +0 -39
- package/dist/index-BkeOYZye.d.ts +0 -198
- package/dist/index-BuAj5nXg.d.ts +0 -83
- package/dist/index-BvkVcW8I.d.ts +0 -349
- package/dist/index-CWmH_-RZ.d.ts +0 -247
- package/dist/index-CbgWNcus.d.ts +0 -258
- package/dist/index-CmfPeQza.d.ts +0 -166
- package/dist/index-CmpG-zak.d.ts +0 -607
- package/dist/index-CoMKgL-p.d.ts +0 -12
- package/dist/index-D8HGwglK.d.ts +0 -541
- package/dist/index-DCaVm66D.d.ts +0 -1101
- package/dist/index-DE2w7E0d.d.ts +0 -83
- package/dist/index-DSOpj8DI.d.ts +0 -17
- package/dist/index-DW9q22GH.d.ts +0 -75
- package/dist/index-DnjJ9CwI.d.ts +0 -347
- package/dist/index-DwMJZ8PP.d.ts +0 -317
- package/dist/index-PaojfSdd.d.ts +0 -71
- package/dist/index-aHtYvc3i.d.ts +0 -284
- package/dist/index-e_18DzAg.d.ts +0 -18
- package/dist/index-ffmipXSA.d.ts +0 -55
- package/dist/index-joONjwLt.d.ts +0 -33
- package/dist/index-kssw5ziY.d.ts +0 -250
- package/dist/index-lFffh5-G.d.ts +0 -125
- package/dist/index-pxYge_6k.d.ts +0 -79
- package/dist/layer-Cv9vSwBx.d.ts +0 -70
- package/dist/pino-logger-H4HPW5P6.js +0 -5
- package/dist/pino-logger-H4HPW5P6.js.map +0 -1
- package/dist/prisma-extension-gYhYriA0.d.ts +0 -174
- package/dist/sdk-L75WWUP3.js +0 -156
- package/dist/sdk-L75WWUP3.js.map +0 -1
- package/dist/shutdown-registry-CW9LryO8.d.ts +0 -10
- package/dist/types-Bo2wkjSP.d.ts +0 -35
- package/dist/types-DVpvrAhd.d.ts +0 -71
- package/dist/types-DgJ4lDYA.d.ts +0 -108
- package/dist/types-USOv09qy.d.ts +0 -327
- package/dist/workspace-guard-NXVYYBVJ.js +0 -5
- package/dist/workspace-guard-NXVYYBVJ.js.map +0 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// src/types/layer.ts
|
|
2
|
+
/**
|
|
3
|
+
* Default gateway routing configuration
|
|
4
|
+
*/
|
|
5
|
+
const DEFAULT_GATEWAY_ROUTING = {
|
|
6
|
+
wspace: {
|
|
7
|
+
layer: "wspace",
|
|
8
|
+
internalGateway: {
|
|
9
|
+
host: "wspace-int-gateway",
|
|
10
|
+
port: 4001,
|
|
11
|
+
graphqlPath: "/workspaces/graphql"
|
|
12
|
+
},
|
|
13
|
+
crossLayerGateway: {
|
|
14
|
+
host: "global-public-gateway",
|
|
15
|
+
port: 4e3,
|
|
16
|
+
graphqlPath: "/global/graphql"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
global: {
|
|
20
|
+
layer: "global",
|
|
21
|
+
internalGateway: {
|
|
22
|
+
host: "global-int-gateway",
|
|
23
|
+
port: 4002,
|
|
24
|
+
graphqlPath: "/global/graphql"
|
|
25
|
+
},
|
|
26
|
+
crossLayerGateway: {
|
|
27
|
+
host: "wspace-public-gateway",
|
|
28
|
+
port: 4003,
|
|
29
|
+
graphqlPath: "/workspaces/graphql"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Default stream configurations per layer
|
|
35
|
+
*/
|
|
36
|
+
const DEFAULT_LAYER_STREAMS = {
|
|
37
|
+
wspace: [{
|
|
38
|
+
name: "WSPACE_EVENTS",
|
|
39
|
+
subjects: ["wspace.>"],
|
|
40
|
+
description: "Workspace layer events stream"
|
|
41
|
+
}, {
|
|
42
|
+
name: "WSPACE_GRAPH_EVENTS",
|
|
43
|
+
subjects: ["graph.>"],
|
|
44
|
+
description: "Workspace layer graph events stream (captures all graph entity events)"
|
|
45
|
+
}],
|
|
46
|
+
global: [{
|
|
47
|
+
name: "GLOBAL_EVENTS",
|
|
48
|
+
subjects: ["global.>"],
|
|
49
|
+
description: "Global layer events stream"
|
|
50
|
+
}, {
|
|
51
|
+
name: "GLOBAL_GRAPH_EVENTS",
|
|
52
|
+
subjects: ["graph.>"],
|
|
53
|
+
description: "Global layer graph events stream (captures all graph entity events)"
|
|
54
|
+
}]
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Build internal gateway URL for a layer
|
|
58
|
+
* Uses HTTP for internal K8s communication (mTLS via Istio service mesh)
|
|
59
|
+
*/
|
|
60
|
+
function buildInternalGatewayUrl(layer) {
|
|
61
|
+
const { host, port, graphqlPath } = DEFAULT_GATEWAY_ROUTING[layer].internalGateway;
|
|
62
|
+
return `http://${host}:${port}${graphqlPath}`;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Default resource URLs per layer
|
|
66
|
+
*
|
|
67
|
+
* Note: Internal K8s service communication uses plain HTTP with mTLS via Istio.
|
|
68
|
+
* External traffic uses HTTPS via ingress gateway.
|
|
69
|
+
*/
|
|
70
|
+
const DEFAULT_LAYER_RESOURCES = {
|
|
71
|
+
wspace: {
|
|
72
|
+
eventQueueUrl: "redis://wspace-shared-valkey:6379",
|
|
73
|
+
valkeyUrl: "valkey://wspace-valkey:6379",
|
|
74
|
+
temporalAddress: "wspace-temporal:7233",
|
|
75
|
+
temporalNamespace: "wspace-default",
|
|
76
|
+
rbacGatewayUrl: buildInternalGatewayUrl("wspace")
|
|
77
|
+
},
|
|
78
|
+
global: {
|
|
79
|
+
eventQueueUrl: "redis://global-shared-valkey:6379",
|
|
80
|
+
valkeyUrl: "valkey://global-valkey:6379",
|
|
81
|
+
temporalAddress: "global-temporal:7233",
|
|
82
|
+
temporalNamespace: "global-default",
|
|
83
|
+
rbacGatewayUrl: buildInternalGatewayUrl("global")
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Default circuit breaker configuration
|
|
88
|
+
*/
|
|
89
|
+
const DEFAULT_CIRCUIT_BREAKER_CONFIG = {
|
|
90
|
+
failureThreshold: 5,
|
|
91
|
+
resetTimeout: 3e4,
|
|
92
|
+
failureWindow: 6e4
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Default retry configuration
|
|
96
|
+
*/
|
|
97
|
+
const DEFAULT_GATEWAY_RETRY_CONFIG = {
|
|
98
|
+
maxAttempts: 3,
|
|
99
|
+
initialDelay: 1e3,
|
|
100
|
+
maxDelay: 1e4,
|
|
101
|
+
backoffMultiplier: 2
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { DEFAULT_LAYER_STREAMS as a, DEFAULT_LAYER_RESOURCES as i, DEFAULT_GATEWAY_RETRY_CONFIG as n, DEFAULT_GATEWAY_ROUTING as r, DEFAULT_CIRCUIT_BREAKER_CONFIG as t };
|
|
105
|
+
//# sourceMappingURL=layer-Bcix-WCl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-Bcix-WCl.js","names":[],"sources":["../src/types/layer.ts"],"sourcesContent":["/**\n * Layer Type Definitions for Burdenoff Backend SDK\n *\n * This module defines types for the layer-aware architecture,\n * supporting wspace (workspace) and global (tenant) service layers.\n *\n * @module types/layer\n * @category Configuration\n */\n\n/**\n * Service layer types\n * - wspace: Workspace layer services (product-specific operations)\n * - global: Global/tenant layer services (cross-product services)\n */\nexport type ServiceLayer = 'wspace' | 'global';\n\n/**\n * Layer configuration for a service\n */\nexport interface LayerConfig {\n /**\n * Layer type this service belongs to\n * @example 'wspace' or 'global'\n */\n layer: ServiceLayer;\n\n /**\n * Service name (e.g., 'wspace-tags-svc', 'global-auth-svc')\n */\n serviceName: string;\n\n /**\n * Service identity for bypass headers\n * Used for M2M authentication\n * @default serviceName\n */\n serviceIdentity?: string;\n}\n\n/**\n * Gateway configuration per layer\n */\nexport interface LayerGatewayConfig {\n /**\n * Internal gateway URL (same layer int-gateway)\n * - wspace services use: wspace-int-gateway\n * - global services use: global-int-gateway\n */\n internalGatewayUrl: string;\n\n /**\n * Cross-layer gateway URL (cross layer public-gateway)\n * - wspace services use: global-public-gateway\n * - global services use: wspace-public-gateway\n */\n crossLayerGatewayUrl: string;\n}\n\n/**\n * Resource URLs per layer\n */\nexport interface LayerResourceUrls {\n /**\n * Event queue (Redis Streams) URL.\n *\n * Single fleet-shared Redis instance in every environment:\n * - ACA (prod/alpha): Azure Managed Redis — `REDIS_URL` injected from\n * KeyVault overrides this default.\n * - Local dev: self-hosted `shared-valkey` reachable via\n * docker-compose; the default below points at the same container\n * name used by `~/products/dev`'s compose graph.\n *\n * `LayerManager.resolveResourceConfig()` always prefers `REDIS_URL`\n * from the environment, so the layer-scoped default is only the\n * local-dev fallback.\n */\n eventQueueUrl: string;\n\n /**\n * Valkey/Redis URL for the layer\n */\n valkeyUrl: string;\n\n /**\n * Temporal server address for the layer\n */\n temporalAddress: string;\n\n /**\n * Temporal namespace for the layer\n */\n temporalNamespace: string;\n\n /**\n * RBAC gateway URL (for permission checks)\n */\n rbacGatewayUrl: string;\n}\n\n/**\n * Complete layer configuration including gateways and resources\n */\nexport interface LayerFullConfig extends LayerConfig {\n /**\n * Gateway configuration\n */\n gateways: LayerGatewayConfig;\n\n /**\n * Resource URLs\n */\n resources: LayerResourceUrls;\n}\n\n/**\n * Gateway routing rules by layer\n * Defines which gateway to use for same-layer vs cross-layer communication\n */\nexport interface GatewayRoutingConfig {\n /**\n * Layer this config applies to\n */\n layer: ServiceLayer;\n\n /**\n * Internal gateway for same-layer M2M calls\n */\n internalGateway: {\n /** Gateway host (without protocol) */\n host: string;\n /** Gateway port */\n port: number;\n /** GraphQL endpoint path */\n graphqlPath: string;\n };\n\n /**\n * Public gateway for cross-layer calls\n */\n crossLayerGateway: {\n /** Gateway host (without protocol) */\n host: string;\n /** Gateway port */\n port: number;\n /** GraphQL endpoint path */\n graphqlPath: string;\n };\n}\n\n/**\n * Default gateway routing configuration\n */\nexport const DEFAULT_GATEWAY_ROUTING: Record<ServiceLayer, GatewayRoutingConfig> = {\n wspace: {\n layer: 'wspace',\n internalGateway: {\n host: 'wspace-int-gateway',\n port: 4001,\n graphqlPath: '/workspaces/graphql',\n },\n crossLayerGateway: {\n host: 'global-public-gateway',\n port: 4000,\n graphqlPath: '/global/graphql',\n },\n },\n global: {\n layer: 'global',\n internalGateway: {\n host: 'global-int-gateway',\n port: 4002,\n graphqlPath: '/global/graphql',\n },\n crossLayerGateway: {\n host: 'wspace-public-gateway',\n port: 4003,\n graphqlPath: '/workspaces/graphql',\n },\n },\n};\n\n/**\n * Default stream configurations per layer\n */\nexport const DEFAULT_LAYER_STREAMS: Record<\n ServiceLayer,\n Array<{ name: string; subjects: string[]; description?: string }>\n> = {\n wspace: [\n {\n name: 'WSPACE_EVENTS',\n subjects: ['wspace.>'],\n description: 'Workspace layer events stream',\n },\n {\n name: 'WSPACE_GRAPH_EVENTS',\n subjects: ['graph.>'],\n description: 'Workspace layer graph events stream (captures all graph entity events)',\n },\n ],\n global: [\n {\n name: 'GLOBAL_EVENTS',\n subjects: ['global.>'],\n description: 'Global layer events stream',\n },\n {\n name: 'GLOBAL_GRAPH_EVENTS',\n subjects: ['graph.>'],\n description: 'Global layer graph events stream (captures all graph entity events)',\n },\n ],\n};\n\n/**\n * Build internal gateway URL for a layer\n * Uses HTTP for internal K8s communication (mTLS via Istio service mesh)\n */\nfunction buildInternalGatewayUrl(layer: ServiceLayer): string {\n const routing = DEFAULT_GATEWAY_ROUTING[layer];\n const { host, port, graphqlPath } = routing.internalGateway;\n // Internal K8s services use plain HTTP with mTLS handled by Istio\n const protocol = 'http';\n return `${protocol}://${host}:${port}${graphqlPath}`;\n}\n\n/**\n * Default resource URLs per layer\n *\n * Note: Internal K8s service communication uses plain HTTP with mTLS via Istio.\n * External traffic uses HTTPS via ingress gateway.\n */\nexport const DEFAULT_LAYER_RESOURCES: Record<ServiceLayer, LayerResourceUrls> = {\n // The event queue is a single fleet-shared Redis (Azure Managed Redis in\n // ACA, fed via REDIS_URL; self-hosted shared-valkey in local dev). The\n // layer-scoped default URL below is only the local-dev compose hostname —\n // production always overrides via REDIS_URL.\n wspace: {\n eventQueueUrl: 'redis://wspace-shared-valkey:6379',\n valkeyUrl: 'valkey://wspace-valkey:6379',\n temporalAddress: 'wspace-temporal:7233',\n temporalNamespace: 'wspace-default',\n rbacGatewayUrl: buildInternalGatewayUrl('wspace'),\n },\n global: {\n eventQueueUrl: 'redis://global-shared-valkey:6379',\n valkeyUrl: 'valkey://global-valkey:6379',\n temporalAddress: 'global-temporal:7233',\n temporalNamespace: 'global-default',\n rbacGatewayUrl: buildInternalGatewayUrl('global'),\n },\n};\n\n/**\n * Circuit breaker configuration for gateway client\n */\nexport interface CircuitBreakerConfig {\n /**\n * Number of failures before opening circuit\n * @default 5\n */\n failureThreshold: number;\n\n /**\n * Time in milliseconds to wait before attempting to close circuit\n * @default 30000 (30 seconds)\n */\n resetTimeout: number;\n\n /**\n * Time window in milliseconds for counting failures\n * @default 60000 (60 seconds)\n */\n failureWindow: number;\n}\n\n/**\n * Default circuit breaker configuration\n */\nexport const DEFAULT_CIRCUIT_BREAKER_CONFIG: CircuitBreakerConfig = {\n failureThreshold: 5,\n resetTimeout: 30000,\n failureWindow: 60000,\n};\n\n/**\n * Retry configuration for gateway client\n */\nexport interface GatewayRetryConfig {\n /**\n * Maximum number of retry attempts\n * @default 3\n */\n maxAttempts: number;\n\n /**\n * Initial delay in milliseconds before first retry\n * @default 1000 (1 second)\n */\n initialDelay: number;\n\n /**\n * Maximum delay in milliseconds between retries\n * @default 10000 (10 seconds)\n */\n maxDelay: number;\n\n /**\n * Backoff multiplier for exponential backoff\n * @default 2\n */\n backoffMultiplier: number;\n}\n\n/**\n * Default retry configuration\n */\nexport const DEFAULT_GATEWAY_RETRY_CONFIG: GatewayRetryConfig = {\n maxAttempts: 3,\n initialDelay: 1000,\n maxDelay: 10000,\n backoffMultiplier: 2,\n};\n\n/**\n * Headers automatically added by gateway client for M2M calls\n */\nexport interface GatewayRequestHeaders {\n /**\n * Actor ID making the request\n */\n 'x-actor-id'?: string;\n\n /**\n * Actor type\n */\n 'x-actor-type'?: 'user' | 'app' | 'service' | 'super_admin';\n\n /**\n * Workspace ID for the request context\n */\n 'x-workspace-id'?: string;\n\n /**\n * Service identity for bypass validation\n */\n 'x-service-identity'?: string;\n\n /**\n * Call type indicator\n */\n 'x-call-type'?: 'internal' | 'cross-layer';\n\n /**\n * Permission bypass flag\n */\n 'x-bypass-permission'?: string;\n\n /**\n * RBAC bypass flag (set by gateway)\n */\n 'x-rbac-bypass'?: 'true' | 'false';\n\n /**\n * Bypass source (set by gateway)\n */\n 'x-bypass-source'?: string;\n\n /**\n * Bypass timestamp (set by gateway)\n */\n 'x-bypass-timestamp'?: string;\n\n /**\n * Cloudflare Access service-token client id, re-presented on cross-layer\n * outbound calls so the peer layer's CF-Access-gated public gateway admits\n * the request. Normally attached automatically from request context.\n */\n 'cf-access-client-id'?: string;\n\n /**\n * Cloudflare Access service-token client secret (paired with the client id).\n */\n 'cf-access-client-secret'?: string;\n\n /**\n * Delegated `app_as_user` bearer (`Bearer <jwt>`) for an internal-gateway\n * call made as an agent acting for a user. The internal gateway verifies it\n * and derives the actor; see `buildDelegatedGatewayHeaders`.\n */\n 'x-delegated-authorization'?: string;\n}\n"],"mappings":";;;;AAyJA,MAAa,0BAAsE;CACjF,QAAQ;EACN,OAAO;EACP,iBAAiB;GACf,MAAM;GACN,MAAM;GACN,aAAa;EACf;EACA,mBAAmB;GACjB,MAAM;GACN,MAAM;GACN,aAAa;EACf;CACF;CACA,QAAQ;EACN,OAAO;EACP,iBAAiB;GACf,MAAM;GACN,MAAM;GACN,aAAa;EACf;EACA,mBAAmB;GACjB,MAAM;GACN,MAAM;GACN,aAAa;EACf;CACF;AACF;;;;AAKA,MAAa,wBAGT;CACF,QAAQ,CACN;EACE,MAAM;EACN,UAAU,CAAC,UAAU;EACrB,aAAa;CACf,GACA;EACE,MAAM;EACN,UAAU,CAAC,SAAS;EACpB,aAAa;CACf,CACF;CACA,QAAQ,CACN;EACE,MAAM;EACN,UAAU,CAAC,UAAU;EACrB,aAAa;CACf,GACA;EACE,MAAM;EACN,UAAU,CAAC,SAAS;EACpB,aAAa;CACf,CACF;AACF;;;;;AAMA,SAAS,wBAAwB,OAA6B;CAE5D,MAAM,EAAE,MAAM,MAAM,gBADJ,wBAAwB,MACG,CAAC;CAG5C,OAAO,UAAiB,KAAK,GAAG,OAAO;AACzC;;;;;;;AAQA,MAAa,0BAAmE;CAK9E,QAAQ;EACN,eAAe;EACf,WAAW;EACX,iBAAiB;EACjB,mBAAmB;EACnB,gBAAgB,wBAAwB,QAAQ;CAClD;CACA,QAAQ;EACN,eAAe;EACf,WAAW;EACX,iBAAiB;EACjB,mBAAmB;EACnB,gBAAgB,wBAAwB,QAAQ;CAClD;AACF;;;;AA4BA,MAAa,iCAAuD;CAClE,kBAAkB;CAClB,cAAc;CACd,eAAe;AACjB;;;;AAkCA,MAAa,+BAAmD;CAC9D,aAAa;CACb,cAAc;CACd,UAAU;CACV,mBAAmB;AACrB"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-ad2WFvuA.js";
|
|
2
|
+
import { a as DEFAULT_LAYER_STREAMS, i as DEFAULT_LAYER_RESOURCES, r as DEFAULT_GATEWAY_ROUTING } from "./layer-Bcix-WCl.js";
|
|
3
|
+
import { a as logger } from "./logger-B6rCpb7D.js";
|
|
4
|
+
|
|
5
|
+
// src/layer/index.ts
|
|
6
|
+
/**
|
|
7
|
+
* Layer Detection and Configuration Module
|
|
8
|
+
*
|
|
9
|
+
* Provides layer-aware configuration and gateway URL resolution
|
|
10
|
+
* for wspace (workspace) and global (tenant) service layers.
|
|
11
|
+
*
|
|
12
|
+
* @module layer
|
|
13
|
+
* @category Configuration
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { LayerManager } from '@burdenoff/be-sdk/layer';
|
|
18
|
+
*
|
|
19
|
+
* // Create layer manager for a wspace service
|
|
20
|
+
* const layer = new LayerManager({
|
|
21
|
+
* layer: 'wspace',
|
|
22
|
+
* serviceName: 'wspace-tags-svc',
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // Get gateway URLs
|
|
26
|
+
* const internalUrl = layer.getInternalGatewayUrl(); // wspace-int-gateway
|
|
27
|
+
* const crossLayerUrl = layer.getCrossLayerGatewayUrl(); // global-public-gateway
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
var layer_exports = /* @__PURE__ */ __exportAll({
|
|
31
|
+
DEFAULT_GATEWAY_ROUTING: () => DEFAULT_GATEWAY_ROUTING,
|
|
32
|
+
DEFAULT_LAYER_RESOURCES: () => DEFAULT_LAYER_RESOURCES,
|
|
33
|
+
DEFAULT_LAYER_STREAMS: () => DEFAULT_LAYER_STREAMS,
|
|
34
|
+
LayerManager: () => LayerManager,
|
|
35
|
+
createLayerManagerFromEnv: () => createLayerManagerFromEnv,
|
|
36
|
+
detectLayerFromServiceName: () => detectLayerFromServiceName,
|
|
37
|
+
getGatewayUrlForLayer: () => getGatewayUrlForLayer,
|
|
38
|
+
validateLayerConfig: () => validateLayerConfig
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* Layer Manager - Provides layer-aware configuration and URL resolution
|
|
42
|
+
*/
|
|
43
|
+
var LayerManager = class {
|
|
44
|
+
config;
|
|
45
|
+
gatewayConfig;
|
|
46
|
+
resourceConfig;
|
|
47
|
+
routingConfig;
|
|
48
|
+
constructor(config) {
|
|
49
|
+
this.config = {
|
|
50
|
+
serviceIdentity: config.serviceName,
|
|
51
|
+
...config
|
|
52
|
+
};
|
|
53
|
+
this.routingConfig = DEFAULT_GATEWAY_ROUTING[config.layer];
|
|
54
|
+
this.gatewayConfig = this.resolveGatewayConfig();
|
|
55
|
+
this.resourceConfig = this.resolveResourceConfig();
|
|
56
|
+
logger.debug("[LayerManager] Initialized", {
|
|
57
|
+
layer: this.config.layer,
|
|
58
|
+
serviceName: this.config.serviceName,
|
|
59
|
+
serviceIdentity: this.config.serviceIdentity
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Resolve gateway configuration from environment or defaults
|
|
64
|
+
*/
|
|
65
|
+
resolveGatewayConfig() {
|
|
66
|
+
const envPrefix = this.config.layer.toUpperCase();
|
|
67
|
+
const internalGatewayUrl = process.env[`${envPrefix}_INT_GATEWAY_URL`] || `http://${this.routingConfig.internalGateway.host}:${this.routingConfig.internalGateway.port}${this.routingConfig.internalGateway.graphqlPath}`;
|
|
68
|
+
const crossLayerEnvPrefix = this.config.layer === "wspace" ? "GLOBAL" : "WSPACE";
|
|
69
|
+
return {
|
|
70
|
+
internalGatewayUrl,
|
|
71
|
+
crossLayerGatewayUrl: process.env[`${crossLayerEnvPrefix}_PUBLIC_GATEWAY_URL`] || `http://${this.routingConfig.crossLayerGateway.host}:${this.routingConfig.crossLayerGateway.port}${this.routingConfig.crossLayerGateway.graphqlPath}`
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Resolve resource configuration from environment or defaults
|
|
76
|
+
*/
|
|
77
|
+
resolveResourceConfig() {
|
|
78
|
+
const envPrefix = this.config.layer.toUpperCase();
|
|
79
|
+
const defaults = DEFAULT_LAYER_RESOURCES[this.config.layer];
|
|
80
|
+
return {
|
|
81
|
+
eventQueueUrl: process.env["REDIS_URL"] || defaults.eventQueueUrl,
|
|
82
|
+
valkeyUrl: process.env[`${envPrefix}_VALKEY_URL`] || process.env["VALKEY_URL"] || process.env["REDIS_URL"] || defaults.valkeyUrl,
|
|
83
|
+
temporalAddress: process.env[`${envPrefix}_TEMPORAL_ADDRESS`] || defaults.temporalAddress,
|
|
84
|
+
temporalNamespace: process.env[`${envPrefix}_TEMPORAL_NAMESPACE`] || defaults.temporalNamespace,
|
|
85
|
+
rbacGatewayUrl: process.env[`${envPrefix}_RBAC_GATEWAY_URL`] || defaults.rbacGatewayUrl
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Get the layer type
|
|
90
|
+
*/
|
|
91
|
+
getLayer() {
|
|
92
|
+
return this.config.layer;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get the service name
|
|
96
|
+
*/
|
|
97
|
+
getServiceName() {
|
|
98
|
+
return this.config.serviceName;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get the service identity (for bypass headers)
|
|
102
|
+
*/
|
|
103
|
+
getServiceIdentity() {
|
|
104
|
+
return this.config.serviceIdentity || this.config.serviceName;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Get internal gateway URL (same layer M2M calls)
|
|
108
|
+
*/
|
|
109
|
+
getInternalGatewayUrl() {
|
|
110
|
+
return this.gatewayConfig.internalGatewayUrl;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Get cross-layer gateway URL (cross layer calls via public gateway)
|
|
114
|
+
*/
|
|
115
|
+
getCrossLayerGatewayUrl() {
|
|
116
|
+
return this.gatewayConfig.crossLayerGatewayUrl;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Get event queue (Redis Streams) URL for this layer
|
|
120
|
+
*/
|
|
121
|
+
getEventQueueUrl() {
|
|
122
|
+
return this.resourceConfig.eventQueueUrl;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Get Valkey URL for this layer
|
|
126
|
+
*/
|
|
127
|
+
getValkeyUrl() {
|
|
128
|
+
return this.resourceConfig.valkeyUrl;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Get Temporal address for this layer
|
|
132
|
+
*/
|
|
133
|
+
getTemporalAddress() {
|
|
134
|
+
return this.resourceConfig.temporalAddress;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get Temporal namespace for this layer
|
|
138
|
+
*/
|
|
139
|
+
getTemporalNamespace() {
|
|
140
|
+
return this.resourceConfig.temporalNamespace;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Get RBAC gateway URL for this layer
|
|
144
|
+
*/
|
|
145
|
+
getRbacGatewayUrl() {
|
|
146
|
+
return this.resourceConfig.rbacGatewayUrl;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Get default streams for this layer
|
|
150
|
+
*/
|
|
151
|
+
getDefaultStreams() {
|
|
152
|
+
return DEFAULT_LAYER_STREAMS[this.config.layer];
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Get full configuration
|
|
156
|
+
*/
|
|
157
|
+
getFullConfig() {
|
|
158
|
+
return {
|
|
159
|
+
...this.config,
|
|
160
|
+
gateways: this.gatewayConfig,
|
|
161
|
+
resources: this.resourceConfig
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Check if this is a wspace layer service
|
|
166
|
+
*/
|
|
167
|
+
isWspaceLayer() {
|
|
168
|
+
return this.config.layer === "wspace";
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Check if this is a global layer service
|
|
172
|
+
*/
|
|
173
|
+
isGlobalLayer() {
|
|
174
|
+
return this.config.layer === "global";
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Get the opposite layer
|
|
178
|
+
*/
|
|
179
|
+
getOppositeLayer() {
|
|
180
|
+
return this.config.layer === "wspace" ? "global" : "wspace";
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Create LayerManager from environment variables
|
|
185
|
+
*
|
|
186
|
+
* Environment variables:
|
|
187
|
+
* - SERVICE_LAYER: 'wspace' | 'global'
|
|
188
|
+
* - SERVICE_NAME: Service name (e.g., 'wspace-tags-svc')
|
|
189
|
+
* - SERVICE_IDENTITY: Service identity for bypass headers (defaults to SERVICE_NAME)
|
|
190
|
+
*
|
|
191
|
+
* @throws Error if SERVICE_LAYER is not set or invalid
|
|
192
|
+
*/
|
|
193
|
+
function createLayerManagerFromEnv() {
|
|
194
|
+
const layer = process.env["SERVICE_LAYER"];
|
|
195
|
+
if (!layer || layer !== "wspace" && layer !== "global") throw new Error(`[LayerManager] Invalid or missing SERVICE_LAYER environment variable. Expected 'wspace' or 'global', got '${layer}'`);
|
|
196
|
+
const serviceName = process.env["SERVICE_NAME"];
|
|
197
|
+
if (!serviceName) throw new Error("[LayerManager] SERVICE_NAME environment variable is required");
|
|
198
|
+
const serviceIdentity = process.env["SERVICE_IDENTITY"] || serviceName;
|
|
199
|
+
return new LayerManager({
|
|
200
|
+
layer,
|
|
201
|
+
serviceName,
|
|
202
|
+
serviceIdentity
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Detect layer from service name
|
|
207
|
+
*
|
|
208
|
+
* @param serviceName - Service name (e.g., 'wspace-tags-svc', 'global-auth-svc')
|
|
209
|
+
* @returns Detected layer or undefined if unable to detect
|
|
210
|
+
*/
|
|
211
|
+
function detectLayerFromServiceName(serviceName) {
|
|
212
|
+
if (serviceName.startsWith("wspace-")) return "wspace";
|
|
213
|
+
if (serviceName.startsWith("global-")) return "global";
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Get gateway URL for a target layer from a source layer
|
|
217
|
+
*
|
|
218
|
+
* @param sourceLayer - Layer making the call
|
|
219
|
+
* @param targetLayer - Layer being called
|
|
220
|
+
* @param sourceManager - LayerManager for the source layer (optional, for URL resolution)
|
|
221
|
+
* @returns Gateway URL to use for the call
|
|
222
|
+
*/
|
|
223
|
+
function getGatewayUrlForLayer(sourceLayer, targetLayer, sourceManager) {
|
|
224
|
+
if (sourceLayer === targetLayer) {
|
|
225
|
+
if (sourceManager) return sourceManager.getInternalGatewayUrl();
|
|
226
|
+
const routing = DEFAULT_GATEWAY_ROUTING[sourceLayer];
|
|
227
|
+
return `http://${routing.internalGateway.host}:${routing.internalGateway.port}${routing.internalGateway.graphqlPath}`;
|
|
228
|
+
}
|
|
229
|
+
if (sourceManager) return sourceManager.getCrossLayerGatewayUrl();
|
|
230
|
+
const routing = DEFAULT_GATEWAY_ROUTING[sourceLayer];
|
|
231
|
+
return `http://${routing.crossLayerGateway.host}:${routing.crossLayerGateway.port}${routing.crossLayerGateway.graphqlPath}`;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Validate layer configuration
|
|
235
|
+
*
|
|
236
|
+
* @param config - Layer configuration to validate
|
|
237
|
+
* @throws Error if configuration is invalid
|
|
238
|
+
*/
|
|
239
|
+
function validateLayerConfig(config) {
|
|
240
|
+
if (!config.layer) throw new Error("[LayerManager] layer is required");
|
|
241
|
+
if (config.layer !== "wspace" && config.layer !== "global") throw new Error(`[LayerManager] Invalid layer '${config.layer}'. Must be 'wspace' or 'global'`);
|
|
242
|
+
if (!config.serviceName) throw new Error("[LayerManager] serviceName is required");
|
|
243
|
+
const expectedPrefix = `${config.layer}-`;
|
|
244
|
+
if (!config.serviceName.startsWith(expectedPrefix)) logger.warn("[LayerManager] Service name does not follow naming convention", {
|
|
245
|
+
serviceName: config.serviceName,
|
|
246
|
+
expectedPrefix,
|
|
247
|
+
layer: config.layer
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export { layer_exports as a, getGatewayUrlForLayer as i, createLayerManagerFromEnv as n, validateLayerConfig as o, detectLayerFromServiceName as r, LayerManager as t };
|
|
252
|
+
//# sourceMappingURL=layer-CEKy6cm8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-CEKy6cm8.js","names":[],"sources":["../src/layer/index.ts"],"sourcesContent":["/**\n * Layer Detection and Configuration Module\n *\n * Provides layer-aware configuration and gateway URL resolution\n * for wspace (workspace) and global (tenant) service layers.\n *\n * @module layer\n * @category Configuration\n *\n * @example\n * ```typescript\n * import { LayerManager } from '@burdenoff/be-sdk/layer';\n *\n * // Create layer manager for a wspace service\n * const layer = new LayerManager({\n * layer: 'wspace',\n * serviceName: 'wspace-tags-svc',\n * });\n *\n * // Get gateway URLs\n * const internalUrl = layer.getInternalGatewayUrl(); // wspace-int-gateway\n * const crossLayerUrl = layer.getCrossLayerGatewayUrl(); // global-public-gateway\n * ```\n */\n\nimport {\n type ServiceLayer,\n type LayerConfig,\n type LayerGatewayConfig,\n type LayerResourceUrls,\n type LayerFullConfig,\n type GatewayRoutingConfig,\n DEFAULT_GATEWAY_ROUTING,\n DEFAULT_LAYER_RESOURCES,\n DEFAULT_LAYER_STREAMS,\n} from '../types/layer.js';\nimport { logger } from '../logger/index.js';\n\n/**\n * Layer Manager - Provides layer-aware configuration and URL resolution\n */\nexport class LayerManager {\n private config: LayerConfig;\n private gatewayConfig: LayerGatewayConfig;\n private resourceConfig: LayerResourceUrls;\n private routingConfig: GatewayRoutingConfig;\n\n constructor(config: LayerConfig) {\n this.config = {\n serviceIdentity: config.serviceName, // Default to service name\n ...config,\n };\n\n // Load routing config for layer\n this.routingConfig = DEFAULT_GATEWAY_ROUTING[config.layer];\n\n // Initialize gateway config\n this.gatewayConfig = this.resolveGatewayConfig();\n\n // Initialize resource config\n this.resourceConfig = this.resolveResourceConfig();\n\n logger.debug('[LayerManager] Initialized', {\n layer: this.config.layer,\n serviceName: this.config.serviceName,\n serviceIdentity: this.config.serviceIdentity,\n });\n }\n\n /**\n * Resolve gateway configuration from environment or defaults\n */\n private resolveGatewayConfig(): LayerGatewayConfig {\n const envPrefix = this.config.layer.toUpperCase();\n\n // Internal gateway URL\n const internalGatewayUrl =\n process.env[`${envPrefix}_INT_GATEWAY_URL`] ||\n `http://${this.routingConfig.internalGateway.host}:${this.routingConfig.internalGateway.port}${this.routingConfig.internalGateway.graphqlPath}`;\n\n // Cross-layer gateway URL\n const crossLayerEnvPrefix = this.config.layer === 'wspace' ? 'GLOBAL' : 'WSPACE';\n const crossLayerGatewayUrl =\n process.env[`${crossLayerEnvPrefix}_PUBLIC_GATEWAY_URL`] ||\n `http://${this.routingConfig.crossLayerGateway.host}:${this.routingConfig.crossLayerGateway.port}${this.routingConfig.crossLayerGateway.graphqlPath}`;\n\n return {\n internalGatewayUrl,\n crossLayerGatewayUrl,\n };\n }\n\n /**\n * Resolve resource configuration from environment or defaults\n */\n private resolveResourceConfig(): LayerResourceUrls {\n const envPrefix = this.config.layer.toUpperCase();\n const defaults = DEFAULT_LAYER_RESOURCES[this.config.layer];\n\n return {\n // Event queue is fleet-shared (ACA Managed Redis or local shared-valkey).\n // REDIS_URL (set in ACA KV / local .env) always wins; the per-layer\n // default is only the local-dev compose fallback.\n eventQueueUrl: process.env['REDIS_URL'] || defaults.eventQueueUrl,\n // Cache Valkey: layer-specific → generic VALKEY_URL → canonical REDIS_URL →\n // local-dev compose default. REDIS_URL is the same Azure Managed Redis the\n // event queue uses; falling back to it keeps a service whose VALKEY_URL is\n // blank from silently dropping to the local-dev host in prod.\n valkeyUrl:\n process.env[`${envPrefix}_VALKEY_URL`] ||\n process.env['VALKEY_URL'] ||\n process.env['REDIS_URL'] ||\n defaults.valkeyUrl,\n temporalAddress: process.env[`${envPrefix}_TEMPORAL_ADDRESS`] || defaults.temporalAddress,\n temporalNamespace: process.env[`${envPrefix}_TEMPORAL_NAMESPACE`] || defaults.temporalNamespace,\n rbacGatewayUrl: process.env[`${envPrefix}_RBAC_GATEWAY_URL`] || defaults.rbacGatewayUrl,\n };\n }\n\n /**\n * Get the layer type\n */\n getLayer(): ServiceLayer {\n return this.config.layer;\n }\n\n /**\n * Get the service name\n */\n getServiceName(): string {\n return this.config.serviceName;\n }\n\n /**\n * Get the service identity (for bypass headers)\n */\n getServiceIdentity(): string {\n return this.config.serviceIdentity || this.config.serviceName;\n }\n\n /**\n * Get internal gateway URL (same layer M2M calls)\n */\n getInternalGatewayUrl(): string {\n return this.gatewayConfig.internalGatewayUrl;\n }\n\n /**\n * Get cross-layer gateway URL (cross layer calls via public gateway)\n */\n getCrossLayerGatewayUrl(): string {\n return this.gatewayConfig.crossLayerGatewayUrl;\n }\n\n /**\n * Get event queue (Redis Streams) URL for this layer\n */\n getEventQueueUrl(): string {\n return this.resourceConfig.eventQueueUrl;\n }\n\n /**\n * Get Valkey URL for this layer\n */\n getValkeyUrl(): string {\n return this.resourceConfig.valkeyUrl;\n }\n\n /**\n * Get Temporal address for this layer\n */\n getTemporalAddress(): string {\n return this.resourceConfig.temporalAddress;\n }\n\n /**\n * Get Temporal namespace for this layer\n */\n getTemporalNamespace(): string {\n return this.resourceConfig.temporalNamespace;\n }\n\n /**\n * Get RBAC gateway URL for this layer\n */\n getRbacGatewayUrl(): string {\n return this.resourceConfig.rbacGatewayUrl;\n }\n\n /**\n * Get default streams for this layer\n */\n getDefaultStreams(): Array<{ name: string; subjects: string[]; description?: string }> {\n return DEFAULT_LAYER_STREAMS[this.config.layer];\n }\n\n /**\n * Get full configuration\n */\n getFullConfig(): LayerFullConfig {\n return {\n ...this.config,\n gateways: this.gatewayConfig,\n resources: this.resourceConfig,\n };\n }\n\n /**\n * Check if this is a wspace layer service\n */\n isWspaceLayer(): boolean {\n return this.config.layer === 'wspace';\n }\n\n /**\n * Check if this is a global layer service\n */\n isGlobalLayer(): boolean {\n return this.config.layer === 'global';\n }\n\n /**\n * Get the opposite layer\n */\n getOppositeLayer(): ServiceLayer {\n return this.config.layer === 'wspace' ? 'global' : 'wspace';\n }\n}\n\n/**\n * Create LayerManager from environment variables\n *\n * Environment variables:\n * - SERVICE_LAYER: 'wspace' | 'global'\n * - SERVICE_NAME: Service name (e.g., 'wspace-tags-svc')\n * - SERVICE_IDENTITY: Service identity for bypass headers (defaults to SERVICE_NAME)\n *\n * @throws Error if SERVICE_LAYER is not set or invalid\n */\nexport function createLayerManagerFromEnv(): LayerManager {\n const layer = process.env['SERVICE_LAYER'] as ServiceLayer;\n\n if (!layer || (layer !== 'wspace' && layer !== 'global')) {\n throw new Error(\n `[LayerManager] Invalid or missing SERVICE_LAYER environment variable. ` +\n `Expected 'wspace' or 'global', got '${layer}'`\n );\n }\n\n const serviceName = process.env['SERVICE_NAME'];\n if (!serviceName) {\n throw new Error('[LayerManager] SERVICE_NAME environment variable is required');\n }\n\n const serviceIdentity = process.env['SERVICE_IDENTITY'] || serviceName;\n\n return new LayerManager({\n layer,\n serviceName,\n serviceIdentity,\n });\n}\n\n/**\n * Detect layer from service name\n *\n * @param serviceName - Service name (e.g., 'wspace-tags-svc', 'global-auth-svc')\n * @returns Detected layer or undefined if unable to detect\n */\nexport function detectLayerFromServiceName(serviceName: string): ServiceLayer | undefined {\n if (serviceName.startsWith('wspace-')) {\n return 'wspace';\n }\n if (serviceName.startsWith('global-')) {\n return 'global';\n }\n return undefined;\n}\n\n/**\n * Get gateway URL for a target layer from a source layer\n *\n * @param sourceLayer - Layer making the call\n * @param targetLayer - Layer being called\n * @param sourceManager - LayerManager for the source layer (optional, for URL resolution)\n * @returns Gateway URL to use for the call\n */\nexport function getGatewayUrlForLayer(\n sourceLayer: ServiceLayer,\n targetLayer: ServiceLayer,\n sourceManager?: LayerManager\n): string {\n // Same layer = internal gateway\n if (sourceLayer === targetLayer) {\n if (sourceManager) {\n return sourceManager.getInternalGatewayUrl();\n }\n const routing = DEFAULT_GATEWAY_ROUTING[sourceLayer];\n return `http://${routing.internalGateway.host}:${routing.internalGateway.port}${routing.internalGateway.graphqlPath}`;\n }\n\n // Different layer = cross-layer public gateway\n if (sourceManager) {\n return sourceManager.getCrossLayerGatewayUrl();\n }\n const routing = DEFAULT_GATEWAY_ROUTING[sourceLayer];\n return `http://${routing.crossLayerGateway.host}:${routing.crossLayerGateway.port}${routing.crossLayerGateway.graphqlPath}`;\n}\n\n/**\n * Validate layer configuration\n *\n * @param config - Layer configuration to validate\n * @throws Error if configuration is invalid\n */\nexport function validateLayerConfig(config: LayerConfig): void {\n if (!config.layer) {\n throw new Error('[LayerManager] layer is required');\n }\n if (config.layer !== 'wspace' && config.layer !== 'global') {\n throw new Error(`[LayerManager] Invalid layer '${config.layer}'. Must be 'wspace' or 'global'`);\n }\n if (!config.serviceName) {\n throw new Error('[LayerManager] serviceName is required');\n }\n\n // Validate naming convention\n const expectedPrefix = `${config.layer}-`;\n if (!config.serviceName.startsWith(expectedPrefix)) {\n logger.warn('[LayerManager] Service name does not follow naming convention', {\n serviceName: config.serviceName,\n expectedPrefix,\n layer: config.layer,\n });\n }\n}\n\n// Re-export types for convenience\nexport type {\n ServiceLayer,\n LayerConfig,\n LayerGatewayConfig,\n LayerResourceUrls,\n LayerFullConfig,\n GatewayRoutingConfig,\n} from '../types/layer.js';\n\nexport { DEFAULT_GATEWAY_ROUTING, DEFAULT_LAYER_RESOURCES, DEFAULT_LAYER_STREAMS } from '../types/layer.js';\n"],"mappings":"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"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { a as registerDisposable, i as getRegisteredDisposableCount, n as ShutdownDisposable, o as unregisterDisposable, r as disposeAll } from "../index-Dt1HJPTX.js";
|
|
2
|
+
export { type ShutdownDisposable, disposeAll, getRegisteredDisposableCount, registerDisposable, unregisterDisposable };
|
package/dist/lifecycle/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { a as unregisterDisposable, i as registerDisposable, n as disposeAll, r as getRegisteredDisposableCount } from "../lifecycle-DeoLSX0U.js";
|
|
2
|
+
|
|
3
|
+
export { disposeAll, getRegisteredDisposableCount, registerDisposable, unregisterDisposable };
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-ad2WFvuA.js";
|
|
2
|
+
import { a as logger } from "./logger-B6rCpb7D.js";
|
|
3
|
+
|
|
4
|
+
// src/lifecycle/shutdown-registry.ts
|
|
5
|
+
/**
|
|
6
|
+
* Process-wide graceful-shutdown registry.
|
|
7
|
+
*
|
|
8
|
+
* Long-lived connection holders — the Redis Streams event publisher/consumer
|
|
9
|
+
* (ioredis) and the cache provider (valkey-glide) — open sockets that are not
|
|
10
|
+
* owned by any single object the bootstrap/SDK can reach (services create them
|
|
11
|
+
* via factories). Without an explicit close on SIGTERM, those sockets are only
|
|
12
|
+
* torn down by the OS at `process.exit`, and any that are half-open or slow to
|
|
13
|
+
* FIN linger server-side against the connection cap during churn (this is part
|
|
14
|
+
* of what pinned wspace-prod Redis at its cap during a mass restart — see
|
|
15
|
+
* BOFF-3073).
|
|
16
|
+
*
|
|
17
|
+
* Each holder registers itself here on creation/connect and unregisters on its
|
|
18
|
+
* own disconnect. The bootstrap signal handler and the SDK `shutdown()` both
|
|
19
|
+
* call `disposeAll()`, so every registered connection is closed deterministically
|
|
20
|
+
* (each bounded by a timeout) before the process exits — regardless of how the
|
|
21
|
+
* holder was constructed.
|
|
22
|
+
*/
|
|
23
|
+
const disposables = /* @__PURE__ */ new Set();
|
|
24
|
+
/** Register a resource to be closed on graceful shutdown. Idempotent. */
|
|
25
|
+
function registerDisposable(d) {
|
|
26
|
+
disposables.add(d);
|
|
27
|
+
}
|
|
28
|
+
/** Remove a resource from the registry (call after it disconnects itself). */
|
|
29
|
+
function unregisterDisposable(d) {
|
|
30
|
+
disposables.delete(d);
|
|
31
|
+
}
|
|
32
|
+
/** Count of currently-registered disposables (diagnostics / tests). */
|
|
33
|
+
function getRegisteredDisposableCount() {
|
|
34
|
+
return disposables.size;
|
|
35
|
+
}
|
|
36
|
+
async function disposeOne(d, timeoutMs) {
|
|
37
|
+
let timer;
|
|
38
|
+
try {
|
|
39
|
+
await Promise.race([Promise.resolve(d.dispose()), new Promise((_, reject) => {
|
|
40
|
+
timer = setTimeout(() => reject(/* @__PURE__ */ new Error(`dispose timeout after ${timeoutMs}ms`)), timeoutMs);
|
|
41
|
+
timer.unref?.();
|
|
42
|
+
})]);
|
|
43
|
+
} catch (err) {
|
|
44
|
+
logger.warn("[shutdown] disposable failed to close cleanly", {
|
|
45
|
+
name: d.shutdownName,
|
|
46
|
+
error: err instanceof Error ? err.message : String(err)
|
|
47
|
+
});
|
|
48
|
+
} finally {
|
|
49
|
+
if (timer) clearTimeout(timer);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Close every registered resource concurrently, each bounded by `timeoutMs`.
|
|
54
|
+
* The registry is drained up front so concurrent or repeated calls (e.g. both
|
|
55
|
+
* the bootstrap signal handler and an explicit SDK `shutdown()`) are safe — the
|
|
56
|
+
* second call simply finds an empty registry. Never throws.
|
|
57
|
+
*/
|
|
58
|
+
async function disposeAll(timeoutMs = 5e3) {
|
|
59
|
+
const current = Array.from(disposables);
|
|
60
|
+
disposables.clear();
|
|
61
|
+
if (current.length === 0) return;
|
|
62
|
+
logger.info("[shutdown] closing registered connections", { count: current.length });
|
|
63
|
+
await Promise.all(current.map((d) => disposeOne(d, timeoutMs)));
|
|
64
|
+
logger.info("[shutdown] registered connections closed");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// src/lifecycle/index.ts
|
|
68
|
+
var lifecycle_exports = /* @__PURE__ */ __exportAll({
|
|
69
|
+
disposeAll: () => disposeAll,
|
|
70
|
+
getRegisteredDisposableCount: () => getRegisteredDisposableCount,
|
|
71
|
+
registerDisposable: () => registerDisposable,
|
|
72
|
+
unregisterDisposable: () => unregisterDisposable
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export { unregisterDisposable as a, registerDisposable as i, disposeAll as n, getRegisteredDisposableCount as r, lifecycle_exports as t };
|
|
76
|
+
//# sourceMappingURL=lifecycle-DeoLSX0U.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-DeoLSX0U.js","names":[],"sources":["../src/lifecycle/shutdown-registry.ts","../src/lifecycle/index.ts"],"sourcesContent":["/**\n * Process-wide graceful-shutdown registry.\n *\n * Long-lived connection holders — the Redis Streams event publisher/consumer\n * (ioredis) and the cache provider (valkey-glide) — open sockets that are not\n * owned by any single object the bootstrap/SDK can reach (services create them\n * via factories). Without an explicit close on SIGTERM, those sockets are only\n * torn down by the OS at `process.exit`, and any that are half-open or slow to\n * FIN linger server-side against the connection cap during churn (this is part\n * of what pinned wspace-prod Redis at its cap during a mass restart — see\n * BOFF-3073).\n *\n * Each holder registers itself here on creation/connect and unregisters on its\n * own disconnect. The bootstrap signal handler and the SDK `shutdown()` both\n * call `disposeAll()`, so every registered connection is closed deterministically\n * (each bounded by a timeout) before the process exits — regardless of how the\n * holder was constructed.\n */\nimport { logger } from '../logger/index.js';\n\n/**\n * A resource that holds long-lived connections and must be closed on graceful\n * shutdown. `dispose()` must be idempotent (it may be called after the resource\n * already disconnected itself) and should not throw — the registry logs and\n * swallows failures so shutdown always proceeds.\n */\nexport interface ShutdownDisposable {\n /** Human-readable label, used only for shutdown logging. */\n readonly shutdownName: string;\n /** Close the underlying connection(s). */\n dispose(): Promise<void> | void;\n}\n\nconst disposables = new Set<ShutdownDisposable>();\n\n/** Register a resource to be closed on graceful shutdown. Idempotent. */\nexport function registerDisposable(d: ShutdownDisposable): void {\n disposables.add(d);\n}\n\n/** Remove a resource from the registry (call after it disconnects itself). */\nexport function unregisterDisposable(d: ShutdownDisposable): void {\n disposables.delete(d);\n}\n\n/** Count of currently-registered disposables (diagnostics / tests). */\nexport function getRegisteredDisposableCount(): number {\n return disposables.size;\n}\n\nasync function disposeOne(d: ShutdownDisposable, timeoutMs: number): Promise<void> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n try {\n await Promise.race([\n Promise.resolve(d.dispose()),\n new Promise<never>((_, reject) => {\n timer = setTimeout(() => reject(new Error(`dispose timeout after ${timeoutMs}ms`)), timeoutMs);\n timer.unref?.();\n }),\n ]);\n } catch (err) {\n logger.warn('[shutdown] disposable failed to close cleanly', {\n name: d.shutdownName,\n error: err instanceof Error ? err.message : String(err),\n });\n } finally {\n if (timer) clearTimeout(timer);\n }\n}\n\n/**\n * Close every registered resource concurrently, each bounded by `timeoutMs`.\n * The registry is drained up front so concurrent or repeated calls (e.g. both\n * the bootstrap signal handler and an explicit SDK `shutdown()`) are safe — the\n * second call simply finds an empty registry. Never throws.\n */\nexport async function disposeAll(timeoutMs = 5000): Promise<void> {\n const current = Array.from(disposables);\n disposables.clear();\n if (current.length === 0) return;\n logger.info('[shutdown] closing registered connections', { count: current.length });\n await Promise.all(current.map((d) => disposeOne(d, timeoutMs)));\n logger.info('[shutdown] registered connections closed');\n}\n","export {\n registerDisposable,\n unregisterDisposable,\n getRegisteredDisposableCount,\n disposeAll,\n type ShutdownDisposable,\n} from './shutdown-registry.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,8BAAc,IAAI,IAAwB;;AAGhD,SAAgB,mBAAmB,GAA6B;CAC9D,YAAY,IAAI,CAAC;AACnB;;AAGA,SAAgB,qBAAqB,GAA6B;CAChE,YAAY,OAAO,CAAC;AACtB;;AAGA,SAAgB,+BAAuC;CACrD,OAAO,YAAY;AACrB;AAEA,eAAe,WAAW,GAAuB,WAAkC;CACjF,IAAI;CACJ,IAAI;EACF,MAAM,QAAQ,KAAK,CACjB,QAAQ,QAAQ,EAAE,QAAQ,CAAC,GAC3B,IAAI,SAAgB,GAAG,WAAW;GAChC,QAAQ,iBAAiB,uBAAO,IAAI,MAAM,yBAAyB,UAAU,GAAG,CAAC,GAAG,SAAS;GAC7F,MAAM,QAAQ;EAChB,CAAC,CACH,CAAC;CACH,SAAS,KAAK;EACZ,OAAO,KAAK,iDAAiD;GAC3D,MAAM,EAAE;GACR,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;EACxD,CAAC;CACH,UAAU;EACR,IAAI,OAAO,aAAa,KAAK;CAC/B;AACF;;;;;;;AAQA,eAAsB,WAAW,YAAY,KAAqB;CAChE,MAAM,UAAU,MAAM,KAAK,WAAW;CACtC,YAAY,MAAM;CAClB,IAAI,QAAQ,WAAW,GAAG;CAC1B,OAAO,KAAK,6CAA6C,EAAE,OAAO,QAAQ,OAAO,CAAC;CAClF,MAAM,QAAQ,IAAI,QAAQ,KAAK,MAAM,WAAW,GAAG,SAAS,CAAC,CAAC;CAC9D,OAAO,KAAK,0CAA0C;AACxD"}
|
package/dist/logger/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export {
|
|
3
|
-
import '../layer-Cv9vSwBx.js';
|
|
1
|
+
import { a as LoggerTransport, d as redactSensitiveFields, f as redactSensitiveString, i as LoggerConfig, l as log, n as LogMeta, o as debug, p as warn, r as Logger, s as error, t as LogLevel, u as logger } from "../index-Cot73bdh.js";
|
|
2
|
+
export { LogLevel, LogMeta, Logger, LoggerConfig, LoggerTransport, debug, error, log, logger, redactSensitiveFields, redactSensitiveString, warn };
|
package/dist/logger/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { a as logger, c as redactSensitiveString, i as log, l as warn, n as debug, r as error, s as redactSensitiveFields, t as Logger } from "../logger-B6rCpb7D.js";
|
|
2
|
+
|
|
3
|
+
export { Logger, debug, error, log, logger, redactSensitiveFields, redactSensitiveString, warn };
|
|
3
4
|
//# sourceMappingURL=index.js.map
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
package/dist/logger/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"names":[],"mappings":""}
|