@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
package/dist/chunk-E4QNLVY4.js
DELETED
|
@@ -1,909 +0,0 @@
|
|
|
1
|
-
import { logger } from './chunk-RU266375.js';
|
|
2
|
-
import { __name } from './chunk-XE4OXN2W.js';
|
|
3
|
-
import { AsyncLocalStorage } from 'async_hooks';
|
|
4
|
-
|
|
5
|
-
var contextFields = [
|
|
6
|
-
"workspaceId",
|
|
7
|
-
"tenantId",
|
|
8
|
-
"actorId",
|
|
9
|
-
"actorType",
|
|
10
|
-
"organizationId",
|
|
11
|
-
"projectId",
|
|
12
|
-
"appId",
|
|
13
|
-
"onBehalfOf"
|
|
14
|
-
];
|
|
15
|
-
function sameContext(a, b) {
|
|
16
|
-
return contextFields.every((field) => a[field] === b[field]);
|
|
17
|
-
}
|
|
18
|
-
__name(sameContext, "sameContext");
|
|
19
|
-
function bindTransactionContext(client, scope, getWorkspaceContext2) {
|
|
20
|
-
const delegates = /* @__PURE__ */ new WeakMap();
|
|
21
|
-
function bindOperation(value) {
|
|
22
|
-
if (!value || typeof value !== "object" || Reflect.get(value, Symbol.toStringTag) !== "PrismaPromise") return value;
|
|
23
|
-
const sourceContext = getWorkspaceContext2();
|
|
24
|
-
const captured = sourceContext ? {
|
|
25
|
-
...sourceContext
|
|
26
|
-
} : void 0;
|
|
27
|
-
const restore = AsyncLocalStorage.snapshot();
|
|
28
|
-
return new Proxy(value, {
|
|
29
|
-
get(target, property, receiver) {
|
|
30
|
-
const original = Reflect.get(target, property, receiver);
|
|
31
|
-
if (typeof original !== "function" || property === "constructor") return original;
|
|
32
|
-
return (...args) => {
|
|
33
|
-
if (!scope.active) throw new Error("[WorkspaceExtension] Lazy operation belongs to a completed interactive transaction.");
|
|
34
|
-
if (sourceContext && captured && !sameContext(sourceContext, captured)) {
|
|
35
|
-
throw new Error("[WorkspaceExtension] Captured workspace/actor context changed before lazy execution.");
|
|
36
|
-
}
|
|
37
|
-
const current = getWorkspaceContext2();
|
|
38
|
-
if (captured && current && !sameContext(captured, current)) {
|
|
39
|
-
throw new Error("[WorkspaceExtension] Lazy operation cannot cross workspace/actor context.");
|
|
40
|
-
}
|
|
41
|
-
if (property === "requestTransaction") throw new Error("[WorkspaceExtension] Interactive operation cannot be rebound to another transaction.");
|
|
42
|
-
return restore(() => {
|
|
43
|
-
const result = Reflect.apply(original, target, args);
|
|
44
|
-
return [
|
|
45
|
-
"then",
|
|
46
|
-
"catch",
|
|
47
|
-
"finally"
|
|
48
|
-
].includes(String(property)) ? result : bindOperation(result);
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
__name(bindOperation, "bindOperation");
|
|
55
|
-
function facade(target, model) {
|
|
56
|
-
const existing = delegates.get(target);
|
|
57
|
-
if (existing) return existing;
|
|
58
|
-
const proxy = new Proxy(target, {
|
|
59
|
-
get(object, property, receiver) {
|
|
60
|
-
const value = Reflect.get(object, property, receiver);
|
|
61
|
-
if (typeof value === "function" && (model || typeof property === "string" && !property.startsWith("_") && property !== "constructor")) {
|
|
62
|
-
return (...args) => bindOperation(Reflect.apply(value, object, args));
|
|
63
|
-
}
|
|
64
|
-
if (!model && typeof property === "string" && !property.startsWith("_") && !property.startsWith("$") && value && typeof value === "object" && typeof Reflect.get(value, "findMany") === "function") {
|
|
65
|
-
return facade(value, true);
|
|
66
|
-
}
|
|
67
|
-
return value;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
delegates.set(target, proxy);
|
|
71
|
-
return proxy;
|
|
72
|
-
}
|
|
73
|
-
__name(facade, "facade");
|
|
74
|
-
return facade(client, false);
|
|
75
|
-
}
|
|
76
|
-
__name(bindTransactionContext, "bindTransactionContext");
|
|
77
|
-
|
|
78
|
-
// src/prisma/workspace-extension.ts
|
|
79
|
-
var workspaceContextStore = new AsyncLocalStorage();
|
|
80
|
-
var fallbackContext;
|
|
81
|
-
function setWorkspaceContext(context) {
|
|
82
|
-
workspaceContextStore.enterWith(context);
|
|
83
|
-
fallbackContext = context;
|
|
84
|
-
}
|
|
85
|
-
__name(setWorkspaceContext, "setWorkspaceContext");
|
|
86
|
-
function getWorkspaceContext() {
|
|
87
|
-
return workspaceContextStore.getStore() ?? fallbackContext;
|
|
88
|
-
}
|
|
89
|
-
__name(getWorkspaceContext, "getWorkspaceContext");
|
|
90
|
-
function getScopedWorkspaceContext() {
|
|
91
|
-
return workspaceContextStore.getStore();
|
|
92
|
-
}
|
|
93
|
-
__name(getScopedWorkspaceContext, "getScopedWorkspaceContext");
|
|
94
|
-
async function withWorkspaceContext(context, fn) {
|
|
95
|
-
return workspaceContextStore.run(context, fn);
|
|
96
|
-
}
|
|
97
|
-
__name(withWorkspaceContext, "withWorkspaceContext");
|
|
98
|
-
function withWorkspaceContextSync(context, fn) {
|
|
99
|
-
return workspaceContextStore.run(context, fn);
|
|
100
|
-
}
|
|
101
|
-
__name(withWorkspaceContextSync, "withWorkspaceContextSync");
|
|
102
|
-
var defaultWorkspaceExtensionConfig = {
|
|
103
|
-
enabled: true,
|
|
104
|
-
enableReadIsolation: true,
|
|
105
|
-
enableDeleteIsolation: true,
|
|
106
|
-
enableUpdateWhereIsolation: true,
|
|
107
|
-
populateContextJson: true,
|
|
108
|
-
populateCreatedBy: true,
|
|
109
|
-
populateUpdatedBy: true,
|
|
110
|
-
populateTenantId: false,
|
|
111
|
-
populateOnBehalfOf: true,
|
|
112
|
-
excludeModels: [],
|
|
113
|
-
excludeModelsFromReadIsolation: [],
|
|
114
|
-
strictMode: true,
|
|
115
|
-
allowedUnguardedOperations: [],
|
|
116
|
-
debug: false,
|
|
117
|
-
enableApplicationNameTagging: false,
|
|
118
|
-
enableRlsGucTagging: false
|
|
119
|
-
};
|
|
120
|
-
function hasField(data, field) {
|
|
121
|
-
return field in data;
|
|
122
|
-
}
|
|
123
|
-
__name(hasField, "hasField");
|
|
124
|
-
function injectCreateFields(data, wsCtx, config) {
|
|
125
|
-
const injected = {
|
|
126
|
-
...data
|
|
127
|
-
};
|
|
128
|
-
if (wsCtx.workspaceId && !hasField(injected, "workspaceId")) {
|
|
129
|
-
injected["workspaceId"] = wsCtx.workspaceId;
|
|
130
|
-
}
|
|
131
|
-
if (config.populateTenantId && wsCtx.tenantId && !hasField(injected, "tenantId")) {
|
|
132
|
-
injected["tenantId"] = wsCtx.tenantId;
|
|
133
|
-
}
|
|
134
|
-
if (config.populateCreatedBy && wsCtx.actorId && !hasField(injected, "createdBy")) {
|
|
135
|
-
injected["createdBy"] = wsCtx.actorId;
|
|
136
|
-
}
|
|
137
|
-
if (config.populateUpdatedBy && wsCtx.actorId && !hasField(injected, "updatedBy")) {
|
|
138
|
-
injected["updatedBy"] = wsCtx.actorId;
|
|
139
|
-
}
|
|
140
|
-
if (config.populateOnBehalfOf && wsCtx.onBehalfOf && !hasField(injected, "onBehalfOf")) {
|
|
141
|
-
injected["onBehalfOf"] = wsCtx.onBehalfOf;
|
|
142
|
-
} else if (config.populateOnBehalfOf && wsCtx.actorId && !hasField(injected, "onBehalfOf")) {
|
|
143
|
-
injected["onBehalfOf"] = wsCtx.actorId;
|
|
144
|
-
}
|
|
145
|
-
if (config.populateContextJson && !hasField(injected, "context")) {
|
|
146
|
-
const contextJson = buildContextJsonFromWorkspaceContext(wsCtx);
|
|
147
|
-
if (contextJson) {
|
|
148
|
-
injected["context"] = contextJson;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return injected;
|
|
152
|
-
}
|
|
153
|
-
__name(injectCreateFields, "injectCreateFields");
|
|
154
|
-
function injectUpdateFields(data, wsCtx, config) {
|
|
155
|
-
const injected = {
|
|
156
|
-
...data
|
|
157
|
-
};
|
|
158
|
-
if (config.populateUpdatedBy && wsCtx.actorId && !hasField(injected, "updatedBy")) {
|
|
159
|
-
injected["updatedBy"] = wsCtx.actorId;
|
|
160
|
-
}
|
|
161
|
-
return injected;
|
|
162
|
-
}
|
|
163
|
-
__name(injectUpdateFields, "injectUpdateFields");
|
|
164
|
-
function injectWhereClause(where, wsCtx) {
|
|
165
|
-
if (!wsCtx.workspaceId) return where;
|
|
166
|
-
if (!where) {
|
|
167
|
-
return {
|
|
168
|
-
workspaceId: wsCtx.workspaceId
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
if (!hasField(where, "workspaceId")) {
|
|
172
|
-
return {
|
|
173
|
-
...where,
|
|
174
|
-
workspaceId: wsCtx.workspaceId
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
return where;
|
|
178
|
-
}
|
|
179
|
-
__name(injectWhereClause, "injectWhereClause");
|
|
180
|
-
function buildContextJsonFromWorkspaceContext(wsCtx) {
|
|
181
|
-
const context = {};
|
|
182
|
-
if (wsCtx.workspaceId) context["workspaceId"] = wsCtx.workspaceId;
|
|
183
|
-
if (wsCtx.actorId) context["userId"] = wsCtx.actorId;
|
|
184
|
-
if (wsCtx.organizationId) context["organizationId"] = wsCtx.organizationId;
|
|
185
|
-
if (wsCtx.projectId) context["projectId"] = wsCtx.projectId;
|
|
186
|
-
if (wsCtx.appId) context["appId"] = wsCtx.appId;
|
|
187
|
-
return Object.keys(context).length > 0 ? context : void 0;
|
|
188
|
-
}
|
|
189
|
-
__name(buildContextJsonFromWorkspaceContext, "buildContextJsonFromWorkspaceContext");
|
|
190
|
-
function injectWhereWorkspaceId(where, wsCtx) {
|
|
191
|
-
const ctx = wsCtx ?? getWorkspaceContext();
|
|
192
|
-
if (!where || !ctx?.workspaceId) return where;
|
|
193
|
-
if (!hasField(where, "workspaceId")) {
|
|
194
|
-
return {
|
|
195
|
-
...where,
|
|
196
|
-
workspaceId: ctx.workspaceId
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
return where;
|
|
200
|
-
}
|
|
201
|
-
__name(injectWhereWorkspaceId, "injectWhereWorkspaceId");
|
|
202
|
-
function stripSkipFlag(args) {
|
|
203
|
-
const cleaned = {
|
|
204
|
-
...args
|
|
205
|
-
};
|
|
206
|
-
delete cleaned["_skipWorkspaceInjection"];
|
|
207
|
-
return cleaned;
|
|
208
|
-
}
|
|
209
|
-
__name(stripSkipFlag, "stripSkipFlag");
|
|
210
|
-
function isExcludedFromReadIsolation(model, config) {
|
|
211
|
-
return config.excludeModels.includes(model) || config.excludeModelsFromReadIsolation.includes(model);
|
|
212
|
-
}
|
|
213
|
-
__name(isExcludedFromReadIsolation, "isExcludedFromReadIsolation");
|
|
214
|
-
function enforceStrictMode(model, operation, wsCtx, config) {
|
|
215
|
-
if (wsCtx?.workspaceId) return;
|
|
216
|
-
if (!config.strictMode) return;
|
|
217
|
-
const opKey = `${model}.${operation}`;
|
|
218
|
-
if (config.allowedUnguardedOperations.includes(opKey)) return;
|
|
219
|
-
throw new Error(`[WorkspaceExtension] Workspace context required for ${model}.${operation}. No workspaceId found in request context. To bypass, either: (1) add "${model}" to excludeModels, (2) add "${opKey}" to allowedUnguardedOperations, or (3) pass _skipWorkspaceInjection: true in the query args.`);
|
|
220
|
-
}
|
|
221
|
-
__name(enforceStrictMode, "enforceStrictMode");
|
|
222
|
-
var taggedContexts = /* @__PURE__ */ new WeakSet();
|
|
223
|
-
async function maybeTagConnection(rawPrisma, wsCtx) {
|
|
224
|
-
if (taggedContexts.has(wsCtx)) return;
|
|
225
|
-
taggedContexts.add(wsCtx);
|
|
226
|
-
const safeSvc = (process.env["SERVICE_NAME"] ?? "svc").replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
227
|
-
const safeWs = (wsCtx.workspaceId ?? "").replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
228
|
-
const tag = `svc=${safeSvc};ws=${safeWs}`;
|
|
229
|
-
try {
|
|
230
|
-
await rawPrisma.$executeRawUnsafe(`SET application_name = '${tag}'`);
|
|
231
|
-
} catch {
|
|
232
|
-
taggedContexts.delete(wsCtx);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
__name(maybeTagConnection, "maybeTagConnection");
|
|
236
|
-
var rlsTaggedContexts = /* @__PURE__ */ new WeakSet();
|
|
237
|
-
async function maybeSetRlsGuc(rawPrisma, wsCtx) {
|
|
238
|
-
if (rlsTaggedContexts.has(wsCtx)) return;
|
|
239
|
-
rlsTaggedContexts.add(wsCtx);
|
|
240
|
-
const safeWs = (wsCtx.workspaceId ?? "").replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
241
|
-
try {
|
|
242
|
-
await rawPrisma.$executeRawUnsafe(`SET app.workspace_id = '${safeWs}'`);
|
|
243
|
-
} catch {
|
|
244
|
-
rlsTaggedContexts.delete(wsCtx);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
__name(maybeSetRlsGuc, "maybeSetRlsGuc");
|
|
248
|
-
function modelToClientProperty(model) {
|
|
249
|
-
return model.length > 0 ? model.charAt(0).toLowerCase() + model.slice(1) : model;
|
|
250
|
-
}
|
|
251
|
-
__name(modelToClientProperty, "modelToClientProperty");
|
|
252
|
-
async function runOperationWithRlsGuc(rootClient, wsCtx, model, operation, args) {
|
|
253
|
-
const safeWs = (wsCtx.workspaceId ?? "").replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
254
|
-
const clientProperty = modelToClientProperty(model);
|
|
255
|
-
return rootClient.$transaction(async (tx) => {
|
|
256
|
-
await tx.$executeRawUnsafe(`SET LOCAL app.workspace_id = '${safeWs}'`);
|
|
257
|
-
const delegate = tx[clientProperty];
|
|
258
|
-
const method = delegate?.[operation];
|
|
259
|
-
if (typeof method !== "function") {
|
|
260
|
-
throw new Error(`[WorkspaceExtension] Unable to resolve ${model}.${operation} (client property "${clientProperty}") on the interactive-transaction client for RLS GUC tagging.`);
|
|
261
|
-
}
|
|
262
|
-
return method(args);
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
__name(runOperationWithRlsGuc, "runOperationWithRlsGuc");
|
|
266
|
-
async function runQueryWithRlsGuc(rootClient, wsCtx, query) {
|
|
267
|
-
const pendingQuery = query();
|
|
268
|
-
const pendingContext = rootClient.$executeRawUnsafe("SELECT set_config('app.workspace_id', $1, true), set_config('statement_timeout', CASE WHEN current_setting('statement_timeout')::interval > interval '0' AND current_setting('statement_timeout')::interval < interval '5 seconds' THEN current_setting('statement_timeout') ELSE '5000ms' END, true)", sanitizeWorkspaceId(wsCtx.workspaceId));
|
|
269
|
-
if (typeof pendingQuery.requestTransaction !== "function" || typeof pendingContext.requestTransaction !== "function") {
|
|
270
|
-
throw new Error("[WorkspaceExtension] RLS query continuation requires transaction-bindable PrismaPromises; refusing the unsupported Prisma integration (BOFF-8874).");
|
|
271
|
-
}
|
|
272
|
-
const [, result] = await rootClient.$transaction([
|
|
273
|
-
pendingContext,
|
|
274
|
-
pendingQuery
|
|
275
|
-
]);
|
|
276
|
-
return result;
|
|
277
|
-
}
|
|
278
|
-
__name(runQueryWithRlsGuc, "runQueryWithRlsGuc");
|
|
279
|
-
function getCallerTransaction(internalParams) {
|
|
280
|
-
const transaction = internalParams?.transaction;
|
|
281
|
-
if (transaction === void 0 || transaction === null) return void 0;
|
|
282
|
-
if (typeof transaction === "object") {
|
|
283
|
-
const { kind, id } = transaction;
|
|
284
|
-
if (kind === "itx" && typeof id === "string" && id.length > 0) {
|
|
285
|
-
return {
|
|
286
|
-
kind: "itx",
|
|
287
|
-
id,
|
|
288
|
-
descriptor: transaction
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
if (kind === "batch") return {
|
|
292
|
-
kind: "batch"
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
throw new Error("[WorkspaceExtension] Unrecognised Prisma transaction descriptor on __internalParams.transaction; refusing to run the operation outside the caller transaction. This Prisma version is not supported by the be-sdk RLS transaction integration (BOFF-8874).");
|
|
296
|
-
}
|
|
297
|
-
__name(getCallerTransaction, "getCallerTransaction");
|
|
298
|
-
function sanitizeWorkspaceId(workspaceId) {
|
|
299
|
-
return (workspaceId ?? "").replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
300
|
-
}
|
|
301
|
-
__name(sanitizeWorkspaceId, "sanitizeWorkspaceId");
|
|
302
|
-
function buildApplicationNameTag(wsCtx) {
|
|
303
|
-
const safeSvc = (process.env["SERVICE_NAME"] ?? "svc").replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
304
|
-
return `svc=${safeSvc};ws=${sanitizeWorkspaceId(wsCtx.workspaceId)}`;
|
|
305
|
-
}
|
|
306
|
-
__name(buildApplicationNameTag, "buildApplicationNameTag");
|
|
307
|
-
function buildTransactionContextStatement(wsCtx, config) {
|
|
308
|
-
const settings = [];
|
|
309
|
-
const params = [];
|
|
310
|
-
if (config.enableRlsGucTagging) {
|
|
311
|
-
params.push(sanitizeWorkspaceId(wsCtx.workspaceId));
|
|
312
|
-
settings.push(`set_config('app.workspace_id', $${params.length}, true)`);
|
|
313
|
-
}
|
|
314
|
-
if (config.enableApplicationNameTagging) {
|
|
315
|
-
params.push(buildApplicationNameTag(wsCtx));
|
|
316
|
-
settings.push(`set_config('application_name', $${params.length}, true)`);
|
|
317
|
-
}
|
|
318
|
-
if (settings.length === 0) return void 0;
|
|
319
|
-
return {
|
|
320
|
-
sql: `SELECT ${settings.join(", ")}`,
|
|
321
|
-
params,
|
|
322
|
-
key: params.join("\0")
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
__name(buildTransactionContextStatement, "buildTransactionContextStatement");
|
|
326
|
-
var MAX_TRACKED_CALLER_TRANSACTIONS = 4096;
|
|
327
|
-
var callerTransactionStates = /* @__PURE__ */ new Map();
|
|
328
|
-
function rememberCallerTransaction(id, state) {
|
|
329
|
-
callerTransactionStates.delete(id);
|
|
330
|
-
callerTransactionStates.set(id, state);
|
|
331
|
-
if (callerTransactionStates.size > MAX_TRACKED_CALLER_TRANSACTIONS) {
|
|
332
|
-
const oldest = callerTransactionStates.keys().next().value;
|
|
333
|
-
if (oldest !== void 0) callerTransactionStates.delete(oldest);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
__name(rememberCallerTransaction, "rememberCallerTransaction");
|
|
337
|
-
async function applyCallerTransactionContext(rawPrisma, descriptor, statement) {
|
|
338
|
-
const pending = rawPrisma.$executeRawUnsafe(statement.sql, ...statement.params);
|
|
339
|
-
if (typeof pending.requestTransaction !== "function") {
|
|
340
|
-
throw new Error("[WorkspaceExtension] Cannot bind the RLS context statement to the caller transaction (PrismaPromise.requestTransaction is unavailable); refusing to run it on another connection (BOFF-8874).");
|
|
341
|
-
}
|
|
342
|
-
await pending.requestTransaction(descriptor);
|
|
343
|
-
}
|
|
344
|
-
__name(applyCallerTransactionContext, "applyCallerTransactionContext");
|
|
345
|
-
async function runOperationInCallerTransaction(rawPrisma, transaction, wsCtx, config, run) {
|
|
346
|
-
const statement = buildTransactionContextStatement(wsCtx, config);
|
|
347
|
-
if (!statement) return run();
|
|
348
|
-
let state = callerTransactionStates.get(transaction.id);
|
|
349
|
-
if (!state || state.descriptor !== transaction.descriptor || state.key !== statement.key) {
|
|
350
|
-
if (state && state.inflight > 0 && state.key !== statement.key) {
|
|
351
|
-
throw new Error("[WorkspaceExtension] Concurrent operations for different workspaces inside one transaction are not supported: the RLS context is per transaction. Await the other workspace\u2019s operations first.");
|
|
352
|
-
}
|
|
353
|
-
const next = {
|
|
354
|
-
descriptor: transaction.descriptor,
|
|
355
|
-
key: statement.key,
|
|
356
|
-
ready: applyCallerTransactionContext(rawPrisma, transaction.descriptor, statement),
|
|
357
|
-
inflight: 0
|
|
358
|
-
};
|
|
359
|
-
next.ready.catch(() => {
|
|
360
|
-
if (callerTransactionStates.get(transaction.id) === next) callerTransactionStates.delete(transaction.id);
|
|
361
|
-
});
|
|
362
|
-
rememberCallerTransaction(transaction.id, next);
|
|
363
|
-
state = next;
|
|
364
|
-
}
|
|
365
|
-
state.inflight += 1;
|
|
366
|
-
try {
|
|
367
|
-
await state.ready;
|
|
368
|
-
return await run();
|
|
369
|
-
} finally {
|
|
370
|
-
state.inflight -= 1;
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
__name(runOperationInCallerTransaction, "runOperationInCallerTransaction");
|
|
374
|
-
function resetCallerTransactionStateForTests() {
|
|
375
|
-
callerTransactionStates.clear();
|
|
376
|
-
}
|
|
377
|
-
__name(resetCallerTransactionStateForTests, "resetCallerTransactionStateForTests");
|
|
378
|
-
function addWorkspaceExtension(baseClient, config) {
|
|
379
|
-
const fullConfig = {
|
|
380
|
-
...defaultWorkspaceExtensionConfig,
|
|
381
|
-
...config
|
|
382
|
-
};
|
|
383
|
-
if (!fullConfig.enabled) {
|
|
384
|
-
logger.info("[WorkspaceExtension] Extension disabled by configuration");
|
|
385
|
-
return baseClient;
|
|
386
|
-
}
|
|
387
|
-
const rawPrisma = baseClient;
|
|
388
|
-
const rawPrismaForContinuations = baseClient;
|
|
389
|
-
const transactionDelegate = baseClient.$transaction;
|
|
390
|
-
const rawPrismaForCallerTransactions = baseClient;
|
|
391
|
-
const tagsTransactions = fullConfig.enableRlsGucTagging || fullConfig.enableApplicationNameTagging;
|
|
392
|
-
const dispatch = /* @__PURE__ */ __name(async (params, wsCtx, _operation, finalArgs) => {
|
|
393
|
-
if (!tagsTransactions) return params.query(finalArgs);
|
|
394
|
-
const callerTransaction = getCallerTransaction(params.__internalParams);
|
|
395
|
-
if (callerTransaction?.kind === "itx") {
|
|
396
|
-
return runOperationInCallerTransaction(rawPrismaForCallerTransactions, callerTransaction, wsCtx, fullConfig, () => params.query(finalArgs));
|
|
397
|
-
}
|
|
398
|
-
if (callerTransaction?.kind === "batch") {
|
|
399
|
-
return params.query(finalArgs);
|
|
400
|
-
}
|
|
401
|
-
if (fullConfig.enableApplicationNameTagging) {
|
|
402
|
-
await maybeTagConnection(rawPrisma, wsCtx);
|
|
403
|
-
}
|
|
404
|
-
if (fullConfig.enableRlsGucTagging) {
|
|
405
|
-
return runQueryWithRlsGuc(rawPrismaForContinuations, wsCtx, () => params.query(finalArgs));
|
|
406
|
-
}
|
|
407
|
-
return params.query(finalArgs);
|
|
408
|
-
}, "dispatch");
|
|
409
|
-
const rawOperation = /* @__PURE__ */ __name(async ({ args, query, __internalParams }) => {
|
|
410
|
-
if (!tagsTransactions) return query(args);
|
|
411
|
-
const callerTransaction = getCallerTransaction(__internalParams);
|
|
412
|
-
if (callerTransaction?.kind !== "itx") return query(args);
|
|
413
|
-
const wsCtx = getWorkspaceContext();
|
|
414
|
-
if (!wsCtx?.workspaceId) return query(args);
|
|
415
|
-
return runOperationInCallerTransaction(rawPrismaForCallerTransactions, callerTransaction, wsCtx, fullConfig, () => query(args));
|
|
416
|
-
}, "rawOperation");
|
|
417
|
-
const prismaClient = baseClient;
|
|
418
|
-
logger.info("[WorkspaceExtension] Workspace extension enabled", {
|
|
419
|
-
populateContextJson: fullConfig.populateContextJson,
|
|
420
|
-
populateCreatedBy: fullConfig.populateCreatedBy,
|
|
421
|
-
populateUpdatedBy: fullConfig.populateUpdatedBy,
|
|
422
|
-
populateTenantId: fullConfig.populateTenantId,
|
|
423
|
-
enableReadIsolation: fullConfig.enableReadIsolation,
|
|
424
|
-
enableDeleteIsolation: fullConfig.enableDeleteIsolation,
|
|
425
|
-
enableUpdateWhereIsolation: fullConfig.enableUpdateWhereIsolation,
|
|
426
|
-
strictMode: fullConfig.strictMode,
|
|
427
|
-
excludeModels: fullConfig.excludeModels,
|
|
428
|
-
excludeModelsFromReadIsolation: fullConfig.excludeModelsFromReadIsolation,
|
|
429
|
-
allowedUnguardedOperations: fullConfig.allowedUnguardedOperations,
|
|
430
|
-
enableApplicationNameTagging: fullConfig.enableApplicationNameTagging,
|
|
431
|
-
enableRlsGucTagging: fullConfig.enableRlsGucTagging
|
|
432
|
-
});
|
|
433
|
-
const rawOperationHooks = tagsTransactions ? {
|
|
434
|
-
$queryRaw: rawOperation,
|
|
435
|
-
$executeRaw: rawOperation,
|
|
436
|
-
$queryRawUnsafe: rawOperation,
|
|
437
|
-
$executeRawUnsafe: rawOperation,
|
|
438
|
-
$queryRawTyped: rawOperation
|
|
439
|
-
} : {};
|
|
440
|
-
const withQueryHooks = prismaClient.$extends({
|
|
441
|
-
query: {
|
|
442
|
-
...rawOperationHooks,
|
|
443
|
-
$allModels: {
|
|
444
|
-
// ================================================================
|
|
445
|
-
// WRITE OPERATIONS - inject workspaceId into data
|
|
446
|
-
// ================================================================
|
|
447
|
-
async create({ model, args, query, __internalParams }) {
|
|
448
|
-
if (fullConfig.excludeModels.includes(model) || args._skipWorkspaceInjection) {
|
|
449
|
-
return query(stripSkipFlag(args));
|
|
450
|
-
}
|
|
451
|
-
const wsCtx = getWorkspaceContext();
|
|
452
|
-
enforceStrictMode(model, "create", wsCtx, fullConfig);
|
|
453
|
-
if (!wsCtx?.workspaceId) {
|
|
454
|
-
return query(args);
|
|
455
|
-
}
|
|
456
|
-
const injectedData = injectCreateFields(args.data, wsCtx, fullConfig);
|
|
457
|
-
if (fullConfig.debug) {
|
|
458
|
-
const injectedKeys = Object.keys(injectedData).filter((k) => !(k in args.data));
|
|
459
|
-
if (injectedKeys.length > 0) {
|
|
460
|
-
logger.debug(`[WorkspaceExtension] ${model}.create - injected: ${injectedKeys.join(", ")}`, {
|
|
461
|
-
workspaceId: wsCtx.workspaceId,
|
|
462
|
-
actorId: wsCtx.actorId
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
const finalArgs = {
|
|
467
|
-
...stripSkipFlag(args),
|
|
468
|
-
data: injectedData
|
|
469
|
-
};
|
|
470
|
-
return dispatch({
|
|
471
|
-
model,
|
|
472
|
-
query,
|
|
473
|
-
__internalParams
|
|
474
|
-
}, wsCtx, "create", finalArgs);
|
|
475
|
-
},
|
|
476
|
-
async createMany({ model, args, query, __internalParams }) {
|
|
477
|
-
if (fullConfig.excludeModels.includes(model) || args._skipWorkspaceInjection) {
|
|
478
|
-
return query(stripSkipFlag(args));
|
|
479
|
-
}
|
|
480
|
-
const wsCtx = getWorkspaceContext();
|
|
481
|
-
enforceStrictMode(model, "createMany", wsCtx, fullConfig);
|
|
482
|
-
if (!wsCtx?.workspaceId) {
|
|
483
|
-
return query(args);
|
|
484
|
-
}
|
|
485
|
-
const dataArray = Array.isArray(args.data) ? args.data : [
|
|
486
|
-
args.data
|
|
487
|
-
];
|
|
488
|
-
const injectedData = dataArray.map((item) => injectCreateFields(item, wsCtx, fullConfig));
|
|
489
|
-
const finalArgs = {
|
|
490
|
-
...stripSkipFlag(args),
|
|
491
|
-
data: Array.isArray(args.data) ? injectedData : injectedData[0]
|
|
492
|
-
};
|
|
493
|
-
return dispatch({
|
|
494
|
-
model,
|
|
495
|
-
query,
|
|
496
|
-
__internalParams
|
|
497
|
-
}, wsCtx, "createMany", finalArgs);
|
|
498
|
-
},
|
|
499
|
-
async createManyAndReturn({ model, args, query, __internalParams }) {
|
|
500
|
-
if (fullConfig.excludeModels.includes(model) || args._skipWorkspaceInjection) {
|
|
501
|
-
return query(stripSkipFlag(args));
|
|
502
|
-
}
|
|
503
|
-
const wsCtx = getWorkspaceContext();
|
|
504
|
-
enforceStrictMode(model, "createManyAndReturn", wsCtx, fullConfig);
|
|
505
|
-
if (!wsCtx?.workspaceId) {
|
|
506
|
-
return query(args);
|
|
507
|
-
}
|
|
508
|
-
const dataArray = Array.isArray(args.data) ? args.data : [
|
|
509
|
-
args.data
|
|
510
|
-
];
|
|
511
|
-
const injectedData = dataArray.map((item) => injectCreateFields(item, wsCtx, fullConfig));
|
|
512
|
-
const finalArgs = {
|
|
513
|
-
...stripSkipFlag(args),
|
|
514
|
-
data: Array.isArray(args.data) ? injectedData : injectedData[0]
|
|
515
|
-
};
|
|
516
|
-
return dispatch({
|
|
517
|
-
model,
|
|
518
|
-
query,
|
|
519
|
-
__internalParams
|
|
520
|
-
}, wsCtx, "createManyAndReturn", finalArgs);
|
|
521
|
-
},
|
|
522
|
-
// ================================================================
|
|
523
|
-
// UPDATE OPERATIONS - inject updatedBy into data + workspaceId into where
|
|
524
|
-
// ================================================================
|
|
525
|
-
async update({ model, args, query, __internalParams }) {
|
|
526
|
-
if (fullConfig.excludeModels.includes(model) || args._skipWorkspaceInjection) {
|
|
527
|
-
return query(stripSkipFlag(args));
|
|
528
|
-
}
|
|
529
|
-
const wsCtx = getWorkspaceContext();
|
|
530
|
-
enforceStrictMode(model, "update", wsCtx, fullConfig);
|
|
531
|
-
if (!wsCtx?.workspaceId) {
|
|
532
|
-
return query(args);
|
|
533
|
-
}
|
|
534
|
-
const injectedData = injectUpdateFields(args.data, wsCtx, fullConfig);
|
|
535
|
-
let injectedWhere = args.where;
|
|
536
|
-
if (fullConfig.enableUpdateWhereIsolation && !isExcludedFromReadIsolation(model, fullConfig)) {
|
|
537
|
-
injectedWhere = injectWhereClause(args.where, wsCtx);
|
|
538
|
-
}
|
|
539
|
-
if (fullConfig.debug) {
|
|
540
|
-
const injectedDataKeys = Object.keys(injectedData).filter((k) => !(k in args.data));
|
|
541
|
-
const whereChanged = injectedWhere !== args.where;
|
|
542
|
-
if (injectedDataKeys.length > 0 || whereChanged) {
|
|
543
|
-
logger.debug(`[WorkspaceExtension] ${model}.update - injected data: ${injectedDataKeys.join(", ")}${whereChanged ? ", where: workspaceId" : ""}`);
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
const finalArgs = {
|
|
547
|
-
...stripSkipFlag(args),
|
|
548
|
-
data: injectedData,
|
|
549
|
-
where: injectedWhere
|
|
550
|
-
};
|
|
551
|
-
return dispatch({
|
|
552
|
-
model,
|
|
553
|
-
query,
|
|
554
|
-
__internalParams
|
|
555
|
-
}, wsCtx, "update", finalArgs);
|
|
556
|
-
},
|
|
557
|
-
async updateMany({ model, args, query, __internalParams }) {
|
|
558
|
-
if (fullConfig.excludeModels.includes(model) || args._skipWorkspaceInjection) {
|
|
559
|
-
return query(stripSkipFlag(args));
|
|
560
|
-
}
|
|
561
|
-
const wsCtx = getWorkspaceContext();
|
|
562
|
-
enforceStrictMode(model, "updateMany", wsCtx, fullConfig);
|
|
563
|
-
if (!wsCtx?.workspaceId) {
|
|
564
|
-
return query(args);
|
|
565
|
-
}
|
|
566
|
-
const injectedData = injectUpdateFields(args.data, wsCtx, fullConfig);
|
|
567
|
-
let injectedWhere = args.where;
|
|
568
|
-
if (fullConfig.enableUpdateWhereIsolation && !isExcludedFromReadIsolation(model, fullConfig)) {
|
|
569
|
-
injectedWhere = injectWhereClause(args.where, wsCtx);
|
|
570
|
-
}
|
|
571
|
-
const finalArgs = {
|
|
572
|
-
...stripSkipFlag(args),
|
|
573
|
-
data: injectedData,
|
|
574
|
-
where: injectedWhere
|
|
575
|
-
};
|
|
576
|
-
return dispatch({
|
|
577
|
-
model,
|
|
578
|
-
query,
|
|
579
|
-
__internalParams
|
|
580
|
-
}, wsCtx, "updateMany", finalArgs);
|
|
581
|
-
},
|
|
582
|
-
async upsert({ model, args, query, __internalParams }) {
|
|
583
|
-
if (fullConfig.excludeModels.includes(model) || args._skipWorkspaceInjection) {
|
|
584
|
-
return query(stripSkipFlag(args));
|
|
585
|
-
}
|
|
586
|
-
const wsCtx = getWorkspaceContext();
|
|
587
|
-
enforceStrictMode(model, "upsert", wsCtx, fullConfig);
|
|
588
|
-
if (!wsCtx?.workspaceId) {
|
|
589
|
-
return query(args);
|
|
590
|
-
}
|
|
591
|
-
const injectedCreate = injectCreateFields(args.create, wsCtx, fullConfig);
|
|
592
|
-
const injectedUpdate = injectUpdateFields(args.update, wsCtx, fullConfig);
|
|
593
|
-
let injectedWhere = args.where;
|
|
594
|
-
if (fullConfig.enableUpdateWhereIsolation && !isExcludedFromReadIsolation(model, fullConfig)) {
|
|
595
|
-
injectedWhere = injectWhereClause(args.where, wsCtx);
|
|
596
|
-
}
|
|
597
|
-
const finalArgs = {
|
|
598
|
-
...stripSkipFlag(args),
|
|
599
|
-
create: injectedCreate,
|
|
600
|
-
update: injectedUpdate,
|
|
601
|
-
where: injectedWhere
|
|
602
|
-
};
|
|
603
|
-
return dispatch({
|
|
604
|
-
model,
|
|
605
|
-
query,
|
|
606
|
-
__internalParams
|
|
607
|
-
}, wsCtx, "upsert", finalArgs);
|
|
608
|
-
},
|
|
609
|
-
// ================================================================
|
|
610
|
-
// READ OPERATIONS - inject workspaceId into where clause
|
|
611
|
-
// ================================================================
|
|
612
|
-
async findMany({ model, args, query, __internalParams }) {
|
|
613
|
-
if (!fullConfig.enableReadIsolation || isExcludedFromReadIsolation(model, fullConfig) || args._skipWorkspaceInjection) {
|
|
614
|
-
return query(stripSkipFlag(args));
|
|
615
|
-
}
|
|
616
|
-
const wsCtx = getWorkspaceContext();
|
|
617
|
-
enforceStrictMode(model, "findMany", wsCtx, fullConfig);
|
|
618
|
-
if (!wsCtx?.workspaceId) {
|
|
619
|
-
return query(args);
|
|
620
|
-
}
|
|
621
|
-
const injectedWhere = injectWhereClause(args.where, wsCtx);
|
|
622
|
-
if (fullConfig.debug) {
|
|
623
|
-
logger.debug(`[WorkspaceExtension] ${model}.findMany - injected workspaceId into where`, {
|
|
624
|
-
workspaceId: wsCtx.workspaceId
|
|
625
|
-
});
|
|
626
|
-
}
|
|
627
|
-
const finalArgs = {
|
|
628
|
-
...stripSkipFlag(args),
|
|
629
|
-
where: injectedWhere
|
|
630
|
-
};
|
|
631
|
-
return dispatch({
|
|
632
|
-
model,
|
|
633
|
-
query,
|
|
634
|
-
__internalParams
|
|
635
|
-
}, wsCtx, "findMany", finalArgs);
|
|
636
|
-
},
|
|
637
|
-
async findFirst({ model, args, query, __internalParams }) {
|
|
638
|
-
if (!fullConfig.enableReadIsolation || isExcludedFromReadIsolation(model, fullConfig) || args._skipWorkspaceInjection) {
|
|
639
|
-
return query(stripSkipFlag(args));
|
|
640
|
-
}
|
|
641
|
-
const wsCtx = getWorkspaceContext();
|
|
642
|
-
enforceStrictMode(model, "findFirst", wsCtx, fullConfig);
|
|
643
|
-
if (!wsCtx?.workspaceId) {
|
|
644
|
-
return query(args);
|
|
645
|
-
}
|
|
646
|
-
const injectedWhere = injectWhereClause(args.where, wsCtx);
|
|
647
|
-
if (fullConfig.debug) {
|
|
648
|
-
logger.debug(`[WorkspaceExtension] ${model}.findFirst - injected workspaceId into where`, {
|
|
649
|
-
workspaceId: wsCtx.workspaceId
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
const finalArgs = {
|
|
653
|
-
...stripSkipFlag(args),
|
|
654
|
-
where: injectedWhere
|
|
655
|
-
};
|
|
656
|
-
return dispatch({
|
|
657
|
-
model,
|
|
658
|
-
query,
|
|
659
|
-
__internalParams
|
|
660
|
-
}, wsCtx, "findFirst", finalArgs);
|
|
661
|
-
},
|
|
662
|
-
async findFirstOrThrow({ model, args, query, __internalParams }) {
|
|
663
|
-
if (!fullConfig.enableReadIsolation || isExcludedFromReadIsolation(model, fullConfig) || args._skipWorkspaceInjection) {
|
|
664
|
-
return query(stripSkipFlag(args));
|
|
665
|
-
}
|
|
666
|
-
const wsCtx = getWorkspaceContext();
|
|
667
|
-
enforceStrictMode(model, "findFirstOrThrow", wsCtx, fullConfig);
|
|
668
|
-
if (!wsCtx?.workspaceId) {
|
|
669
|
-
return query(args);
|
|
670
|
-
}
|
|
671
|
-
const injectedWhere = injectWhereClause(args.where, wsCtx);
|
|
672
|
-
if (fullConfig.debug) {
|
|
673
|
-
logger.debug(`[WorkspaceExtension] ${model}.findFirstOrThrow - injected workspaceId into where`, {
|
|
674
|
-
workspaceId: wsCtx.workspaceId
|
|
675
|
-
});
|
|
676
|
-
}
|
|
677
|
-
const finalArgs = {
|
|
678
|
-
...stripSkipFlag(args),
|
|
679
|
-
where: injectedWhere
|
|
680
|
-
};
|
|
681
|
-
return dispatch({
|
|
682
|
-
model,
|
|
683
|
-
query,
|
|
684
|
-
__internalParams
|
|
685
|
-
}, wsCtx, "findFirstOrThrow", finalArgs);
|
|
686
|
-
},
|
|
687
|
-
async findUnique({ model, args, query, __internalParams }) {
|
|
688
|
-
if (!fullConfig.enableReadIsolation || isExcludedFromReadIsolation(model, fullConfig) || args._skipWorkspaceInjection) {
|
|
689
|
-
return query(stripSkipFlag(args));
|
|
690
|
-
}
|
|
691
|
-
const wsCtx = getWorkspaceContext();
|
|
692
|
-
enforceStrictMode(model, "findUnique", wsCtx, fullConfig);
|
|
693
|
-
if (!wsCtx?.workspaceId) {
|
|
694
|
-
return query(args);
|
|
695
|
-
}
|
|
696
|
-
const injectedWhere = injectWhereClause(args.where, wsCtx);
|
|
697
|
-
if (fullConfig.debug) {
|
|
698
|
-
logger.debug(`[WorkspaceExtension] ${model}.findUnique - injected workspaceId into where`, {
|
|
699
|
-
workspaceId: wsCtx.workspaceId
|
|
700
|
-
});
|
|
701
|
-
}
|
|
702
|
-
const finalArgs = {
|
|
703
|
-
...stripSkipFlag(args),
|
|
704
|
-
where: injectedWhere
|
|
705
|
-
};
|
|
706
|
-
return dispatch({
|
|
707
|
-
model,
|
|
708
|
-
query,
|
|
709
|
-
__internalParams
|
|
710
|
-
}, wsCtx, "findUnique", finalArgs);
|
|
711
|
-
},
|
|
712
|
-
async findUniqueOrThrow({ model, args, query, __internalParams }) {
|
|
713
|
-
if (!fullConfig.enableReadIsolation || isExcludedFromReadIsolation(model, fullConfig) || args._skipWorkspaceInjection) {
|
|
714
|
-
return query(stripSkipFlag(args));
|
|
715
|
-
}
|
|
716
|
-
const wsCtx = getWorkspaceContext();
|
|
717
|
-
enforceStrictMode(model, "findUniqueOrThrow", wsCtx, fullConfig);
|
|
718
|
-
if (!wsCtx?.workspaceId) {
|
|
719
|
-
return query(args);
|
|
720
|
-
}
|
|
721
|
-
const injectedWhere = injectWhereClause(args.where, wsCtx);
|
|
722
|
-
if (fullConfig.debug) {
|
|
723
|
-
logger.debug(`[WorkspaceExtension] ${model}.findUniqueOrThrow - injected workspaceId into where`, {
|
|
724
|
-
workspaceId: wsCtx.workspaceId
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
const finalArgs = {
|
|
728
|
-
...stripSkipFlag(args),
|
|
729
|
-
where: injectedWhere
|
|
730
|
-
};
|
|
731
|
-
return dispatch({
|
|
732
|
-
model,
|
|
733
|
-
query,
|
|
734
|
-
__internalParams
|
|
735
|
-
}, wsCtx, "findUniqueOrThrow", finalArgs);
|
|
736
|
-
},
|
|
737
|
-
async count({ model, args, query, __internalParams }) {
|
|
738
|
-
if (!fullConfig.enableReadIsolation || isExcludedFromReadIsolation(model, fullConfig) || args._skipWorkspaceInjection) {
|
|
739
|
-
return query(stripSkipFlag(args));
|
|
740
|
-
}
|
|
741
|
-
const wsCtx = getWorkspaceContext();
|
|
742
|
-
enforceStrictMode(model, "count", wsCtx, fullConfig);
|
|
743
|
-
if (!wsCtx?.workspaceId) {
|
|
744
|
-
return query(args);
|
|
745
|
-
}
|
|
746
|
-
const injectedWhere = injectWhereClause(args.where, wsCtx);
|
|
747
|
-
if (fullConfig.debug) {
|
|
748
|
-
logger.debug(`[WorkspaceExtension] ${model}.count - injected workspaceId into where`, {
|
|
749
|
-
workspaceId: wsCtx.workspaceId
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
|
-
const finalArgs = {
|
|
753
|
-
...stripSkipFlag(args),
|
|
754
|
-
where: injectedWhere
|
|
755
|
-
};
|
|
756
|
-
return dispatch({
|
|
757
|
-
model,
|
|
758
|
-
query,
|
|
759
|
-
__internalParams
|
|
760
|
-
}, wsCtx, "count", finalArgs);
|
|
761
|
-
},
|
|
762
|
-
async aggregate({ model, args, query, __internalParams }) {
|
|
763
|
-
if (!fullConfig.enableReadIsolation || isExcludedFromReadIsolation(model, fullConfig) || args._skipWorkspaceInjection) {
|
|
764
|
-
return query(stripSkipFlag(args));
|
|
765
|
-
}
|
|
766
|
-
const wsCtx = getWorkspaceContext();
|
|
767
|
-
enforceStrictMode(model, "aggregate", wsCtx, fullConfig);
|
|
768
|
-
if (!wsCtx?.workspaceId) {
|
|
769
|
-
return query(args);
|
|
770
|
-
}
|
|
771
|
-
const injectedWhere = injectWhereClause(args.where, wsCtx);
|
|
772
|
-
if (fullConfig.debug) {
|
|
773
|
-
logger.debug(`[WorkspaceExtension] ${model}.aggregate - injected workspaceId into where`, {
|
|
774
|
-
workspaceId: wsCtx.workspaceId
|
|
775
|
-
});
|
|
776
|
-
}
|
|
777
|
-
const finalArgs = {
|
|
778
|
-
...stripSkipFlag(args),
|
|
779
|
-
where: injectedWhere
|
|
780
|
-
};
|
|
781
|
-
return dispatch({
|
|
782
|
-
model,
|
|
783
|
-
query,
|
|
784
|
-
__internalParams
|
|
785
|
-
}, wsCtx, "aggregate", finalArgs);
|
|
786
|
-
},
|
|
787
|
-
async groupBy({ model, args, query, __internalParams }) {
|
|
788
|
-
if (!fullConfig.enableReadIsolation || isExcludedFromReadIsolation(model, fullConfig) || args._skipWorkspaceInjection) {
|
|
789
|
-
return query(stripSkipFlag(args));
|
|
790
|
-
}
|
|
791
|
-
const wsCtx = getWorkspaceContext();
|
|
792
|
-
enforceStrictMode(model, "groupBy", wsCtx, fullConfig);
|
|
793
|
-
if (!wsCtx?.workspaceId) {
|
|
794
|
-
return query(args);
|
|
795
|
-
}
|
|
796
|
-
const injectedWhere = injectWhereClause(args.where, wsCtx);
|
|
797
|
-
if (fullConfig.debug) {
|
|
798
|
-
logger.debug(`[WorkspaceExtension] ${model}.groupBy - injected workspaceId into where`, {
|
|
799
|
-
workspaceId: wsCtx.workspaceId
|
|
800
|
-
});
|
|
801
|
-
}
|
|
802
|
-
const finalArgs = {
|
|
803
|
-
...stripSkipFlag(args),
|
|
804
|
-
where: injectedWhere
|
|
805
|
-
};
|
|
806
|
-
return dispatch({
|
|
807
|
-
model,
|
|
808
|
-
query,
|
|
809
|
-
__internalParams
|
|
810
|
-
}, wsCtx, "groupBy", finalArgs);
|
|
811
|
-
},
|
|
812
|
-
// ================================================================
|
|
813
|
-
// DELETE OPERATIONS - inject workspaceId into where clause
|
|
814
|
-
// ================================================================
|
|
815
|
-
async delete({ model, args, query, __internalParams }) {
|
|
816
|
-
if (!fullConfig.enableDeleteIsolation || isExcludedFromReadIsolation(model, fullConfig) || args._skipWorkspaceInjection) {
|
|
817
|
-
return query(stripSkipFlag(args));
|
|
818
|
-
}
|
|
819
|
-
const wsCtx = getWorkspaceContext();
|
|
820
|
-
enforceStrictMode(model, "delete", wsCtx, fullConfig);
|
|
821
|
-
if (!wsCtx?.workspaceId) {
|
|
822
|
-
return query(args);
|
|
823
|
-
}
|
|
824
|
-
const injectedWhere = injectWhereClause(args.where, wsCtx);
|
|
825
|
-
if (fullConfig.debug) {
|
|
826
|
-
logger.debug(`[WorkspaceExtension] ${model}.delete - injected workspaceId into where`, {
|
|
827
|
-
workspaceId: wsCtx.workspaceId
|
|
828
|
-
});
|
|
829
|
-
}
|
|
830
|
-
const finalArgs = {
|
|
831
|
-
...stripSkipFlag(args),
|
|
832
|
-
where: injectedWhere
|
|
833
|
-
};
|
|
834
|
-
return dispatch({
|
|
835
|
-
model,
|
|
836
|
-
query,
|
|
837
|
-
__internalParams
|
|
838
|
-
}, wsCtx, "delete", finalArgs);
|
|
839
|
-
},
|
|
840
|
-
async deleteMany({ model, args, query, __internalParams }) {
|
|
841
|
-
if (!fullConfig.enableDeleteIsolation || isExcludedFromReadIsolation(model, fullConfig) || args._skipWorkspaceInjection) {
|
|
842
|
-
return query(stripSkipFlag(args));
|
|
843
|
-
}
|
|
844
|
-
const wsCtx = getWorkspaceContext();
|
|
845
|
-
enforceStrictMode(model, "deleteMany", wsCtx, fullConfig);
|
|
846
|
-
if (!wsCtx?.workspaceId) {
|
|
847
|
-
return query(args);
|
|
848
|
-
}
|
|
849
|
-
const injectedWhere = injectWhereClause(args.where, wsCtx);
|
|
850
|
-
if (fullConfig.debug) {
|
|
851
|
-
logger.debug(`[WorkspaceExtension] ${model}.deleteMany - injected workspaceId into where`, {
|
|
852
|
-
workspaceId: wsCtx.workspaceId
|
|
853
|
-
});
|
|
854
|
-
}
|
|
855
|
-
const finalArgs = {
|
|
856
|
-
...stripSkipFlag(args),
|
|
857
|
-
where: injectedWhere
|
|
858
|
-
};
|
|
859
|
-
return dispatch({
|
|
860
|
-
model,
|
|
861
|
-
query,
|
|
862
|
-
__internalParams
|
|
863
|
-
}, wsCtx, "deleteMany", finalArgs);
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
});
|
|
868
|
-
const wrapped = withQueryHooks;
|
|
869
|
-
return wrapped.$extends({
|
|
870
|
-
client: {
|
|
871
|
-
$transaction(input, options) {
|
|
872
|
-
const parent = this.$parent;
|
|
873
|
-
if (!parent) {
|
|
874
|
-
throw new Error("[WorkspaceExtension] $transaction wrapper could not resolve its parent client.");
|
|
875
|
-
}
|
|
876
|
-
if (Array.isArray(input)) {
|
|
877
|
-
const wsCtx = getWorkspaceContext();
|
|
878
|
-
const statement = tagsTransactions && wsCtx?.workspaceId ? buildTransactionContextStatement(wsCtx, fullConfig) : void 0;
|
|
879
|
-
if (statement) {
|
|
880
|
-
const setContext = rawPrismaForCallerTransactions.$executeRawUnsafe(statement.sql, ...statement.params);
|
|
881
|
-
return parent.$transaction([
|
|
882
|
-
setContext,
|
|
883
|
-
...input
|
|
884
|
-
], options).then((results) => Array.isArray(results) ? results.slice(1) : results);
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
if (typeof input === "function") {
|
|
888
|
-
const callback = input;
|
|
889
|
-
return transactionDelegate.call(this, async (tx) => {
|
|
890
|
-
const scope = {
|
|
891
|
-
active: true
|
|
892
|
-
};
|
|
893
|
-
try {
|
|
894
|
-
return await callback(bindTransactionContext(tx, scope, getWorkspaceContext));
|
|
895
|
-
} finally {
|
|
896
|
-
scope.active = false;
|
|
897
|
-
}
|
|
898
|
-
}, options);
|
|
899
|
-
}
|
|
900
|
-
return transactionDelegate.call(this, input, options);
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
});
|
|
904
|
-
}
|
|
905
|
-
__name(addWorkspaceExtension, "addWorkspaceExtension");
|
|
906
|
-
|
|
907
|
-
export { addWorkspaceExtension, buildTransactionContextStatement, defaultWorkspaceExtensionConfig, getCallerTransaction, getScopedWorkspaceContext, getWorkspaceContext, injectCreateFields, injectWhereWorkspaceId, maybeSetRlsGuc, maybeTagConnection, resetCallerTransactionStateForTests, runOperationInCallerTransaction, runOperationWithRlsGuc, setWorkspaceContext, withWorkspaceContext, withWorkspaceContextSync };
|
|
908
|
-
//# sourceMappingURL=chunk-E4QNLVY4.js.map
|
|
909
|
-
//# sourceMappingURL=chunk-E4QNLVY4.js.map
|