@burdenoff/be-sdk 2026.1110.1 → 2026.1110.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/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-Ca-NNcVx.js +546 -0
- package/dist/ai-credits-Ca-NNcVx.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-CEuBEBQN.js +228 -0
- package/dist/auth-CEuBEBQN.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-DcZ3iGES.js +565 -0
- package/dist/client-DcZ3iGES.js.map +1 -0
- package/dist/collector-endpoint-iyQYeI50.js +50 -0
- package/dist/collector-endpoint-iyQYeI50.js.map +1 -0
- package/dist/context-CZnXf2yb.js +247 -0
- package/dist/context-CZnXf2yb.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/export/index.d.ts +2 -2
- package/dist/export/index.js +3 -14
- package/dist/export/index.js.map +1 -1
- package/dist/export-B6fphx8a.js +642 -0
- package/dist/export-B6fphx8a.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-71oDkrUe.js +422 -0
- package/dist/feature-flags-71oDkrUe.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-DjH0099H.js +830 -0
- package/dist/files-DjH0099H.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-DBFmxWks.js +50 -0
- package/dist/gateway-DBFmxWks.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-DDYgIryR.js +2152 -0
- package/dist/graph-DDYgIryR.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-DHAHHcww.js +161 -0
- package/dist/graphql-DHAHHcww.js.map +1 -0
- package/dist/graphql-DNkMkGBZ.d.ts +21 -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-BBqooJ52.d.ts +45 -0
- package/dist/index-BGzMYJsm.d.ts +209 -0
- package/dist/index-BKwHQtHQ.d.ts +63 -0
- package/dist/index-BMIMnp6T.d.ts +8 -0
- package/dist/index-BQDsNAMR.d.ts +81 -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-BqYfCQSP.d.ts +500 -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-CIgoeobA.d.ts +145 -0
- package/dist/index-CPQDMSFS.d.ts +103 -0
- package/dist/index-CSRcgkVi.d.ts +23 -0
- package/dist/index-CZTnQIRU.d.ts +341 -0
- package/dist/index-CaM9JUcc.d.ts +144 -0
- package/dist/index-CkT2aUr3.d.ts +704 -0
- package/dist/index-CliOgq6L.d.ts +203 -0
- package/dist/index-CnzbJZP7.d.ts +999 -0
- package/dist/index-D6UeLAye.d.ts +63 -0
- package/dist/index-DGgh9DWn.d.ts +59 -0
- package/dist/index-DY3dNhMN.d.ts +420 -0
- package/dist/index-DZC-2o9R.d.ts +207 -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-FbXPfen7.d.ts +132 -0
- package/dist/index-MArCb8Aq.d.ts +306 -0
- package/dist/index-N-huORcj.d.ts +303 -0
- package/dist/index-YOShAwkq.d.ts +45 -0
- package/dist/index-bZKZUvBu.d.ts +646 -0
- package/dist/index-yBSjMY32.d.ts +24 -0
- package/dist/index.d.ts +501 -544
- package/dist/index.js +1820 -2171
- 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-Dy3KhT6Y.js +325 -0
- package/dist/init-Dy3KhT6Y.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-CdETrtFK.js +869 -0
- package/dist/notifications-CdETrtFK.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/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/rbac/index.d.ts +2 -122
- package/dist/rbac/index.js +3 -6
- package/dist/rbac/index.js.map +1 -1
- package/dist/rbac-BB9l9Xph.js +1486 -0
- package/dist/rbac-BB9l9Xph.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/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 +2000 -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-BqwKn4eh.js +630 -0
- package/dist/stub-BqwKn4eh.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-B5xpbgsk.js +868 -0
- package/dist/{chunk-PBZFAAOM.js.map → tags-B5xpbgsk.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 +5 -20
- package/dist/tracker/index.js.map +1 -1
- package/dist/tracker-BQVoEFUo.js +839 -0
- package/dist/tracker-BQVoEFUo.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-Cj2RWXbz.js +90 -0
- package/dist/types-Cj2RWXbz.js.map +1 -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-BKFZiWQn.js +682 -0
- package/dist/usage-BKFZiWQn.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-PP534MBQ.js +0 -8
- package/dist/EventQueueFactory-PP534MBQ.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-7EISSMFP.js +0 -617
- package/dist/chunk-7EISSMFP.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-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-DIOS6L7M.js +0 -690
- package/dist/chunk-DIOS6L7M.js.map +0 -1
- package/dist/chunk-DJNHR37J.js +0 -1185
- package/dist/chunk-DJNHR37J.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-E6OAFS7A.js +0 -1346
- package/dist/chunk-E6OAFS7A.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-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-JVMAQOA3.js +0 -521
- package/dist/chunk-JVMAQOA3.js.map +0 -1
- package/dist/chunk-K56L7NUR.js +0 -1444
- package/dist/chunk-K56L7NUR.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-O2JMZHNH.js +0 -1908
- package/dist/chunk-O2JMZHNH.js.map +0 -1
- package/dist/chunk-OBBCR6WY.js +0 -277
- package/dist/chunk-OBBCR6WY.js.map +0 -1
- package/dist/chunk-OBZQ4AJC.js +0 -272
- package/dist/chunk-OBZQ4AJC.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-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-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-BJQOGOVW.js
DELETED
|
@@ -1,602 +0,0 @@
|
|
|
1
|
-
import { logger } from './chunk-RU266375.js';
|
|
2
|
-
import { __name } from './chunk-XE4OXN2W.js';
|
|
3
|
-
import { GraphQLError } from 'graphql';
|
|
4
|
-
|
|
5
|
-
var DEFAULT_ERROR_CODE = "INTERNAL_SERVER_ERROR";
|
|
6
|
-
var DEFAULT_HTTP_STATUS = 500;
|
|
7
|
-
var INVALID_CREDENTIALS_USER_MESSAGE = "The password you entered is incorrect.";
|
|
8
|
-
var DEFAULT_USER_MESSAGES = {
|
|
9
|
-
BAD_REQUEST: "Please check the request and try again.",
|
|
10
|
-
BAD_USER_INPUT: "Please check the information and try again.",
|
|
11
|
-
CAPTCHA_FAILED: "The verification failed. Please try again.",
|
|
12
|
-
CAPTCHA_REQUIRED: "Please complete the verification to continue.",
|
|
13
|
-
COMPLEXITY_TOO_HIGH: "This request is too large to process. Please simplify it and try again.",
|
|
14
|
-
CONFLICT: "This change conflicts with existing data. Please refresh and try again.",
|
|
15
|
-
FORBIDDEN: "You do not have permission to do that.",
|
|
16
|
-
INTERNAL_SERVER_ERROR: "Something went wrong. Please try again.",
|
|
17
|
-
INVALID_PASSWORD: INVALID_CREDENTIALS_USER_MESSAGE,
|
|
18
|
-
NOT_FOUND: "We could not find the requested item.",
|
|
19
|
-
PERMISSION_DENIED: "You do not have permission to do that.",
|
|
20
|
-
QUOTA_EXCEEDED: "You've reached your usage limit.",
|
|
21
|
-
QUOTA_EXHAUSTED: "You've reached your usage limit.",
|
|
22
|
-
RATE_LIMITED: "Too many requests. Please wait a moment and try again.",
|
|
23
|
-
RESOURCE_CAP_EXCEEDED: "You've reached your plan limit. Upgrade your plan to continue.",
|
|
24
|
-
STORAGE_QUOTA_EXCEEDED: "You've reached your storage limit. Upgrade your plan to continue.",
|
|
25
|
-
TIMEOUT: "The request took too long. Please try again.",
|
|
26
|
-
UNAUTHENTICATED: "Please sign in to continue.",
|
|
27
|
-
VALIDATION_ERROR: "Please check the information and try again.",
|
|
28
|
-
WORKSPACE_REQUIRED: "Please choose a workspace and try again."
|
|
29
|
-
};
|
|
30
|
-
var DEFAULT_STATUS_BY_CODE = {
|
|
31
|
-
BAD_REQUEST: 400,
|
|
32
|
-
BAD_USER_INPUT: 400,
|
|
33
|
-
CAPTCHA_FAILED: 400,
|
|
34
|
-
CAPTCHA_REQUIRED: 400,
|
|
35
|
-
COMPLEXITY_TOO_HIGH: 400,
|
|
36
|
-
CONFLICT: 409,
|
|
37
|
-
FORBIDDEN: 403,
|
|
38
|
-
INVALID_PASSWORD: 400,
|
|
39
|
-
NOT_FOUND: 404,
|
|
40
|
-
PERMISSION_DENIED: 403,
|
|
41
|
-
QUOTA_EXCEEDED: 429,
|
|
42
|
-
QUOTA_EXHAUSTED: 429,
|
|
43
|
-
RATE_LIMITED: 429,
|
|
44
|
-
RESOURCE_CAP_EXCEEDED: 429,
|
|
45
|
-
STORAGE_QUOTA_EXCEEDED: 429,
|
|
46
|
-
TIMEOUT: 504,
|
|
47
|
-
UNAUTHENTICATED: 401,
|
|
48
|
-
VALIDATION_ERROR: 400,
|
|
49
|
-
WORKSPACE_REQUIRED: 403
|
|
50
|
-
};
|
|
51
|
-
var SENSITIVE_EXTENSION_KEYS = /* @__PURE__ */ new Set([
|
|
52
|
-
"exception",
|
|
53
|
-
"originalError",
|
|
54
|
-
"stack",
|
|
55
|
-
"stacktrace"
|
|
56
|
-
]);
|
|
57
|
-
var TECHNICAL_MESSAGE_PATTERNS = [
|
|
58
|
-
/\bprisma\b/i,
|
|
59
|
-
/\bsql\b/i,
|
|
60
|
-
/\bconstraint\b/i,
|
|
61
|
-
/\bstack\b/i,
|
|
62
|
-
/\bundefined\b/i,
|
|
63
|
-
/\bnull\b/i,
|
|
64
|
-
/\bECONN[A-Z_]*\b/,
|
|
65
|
-
/\bETIMEDOUT\b/,
|
|
66
|
-
/\bENOTFOUND\b/,
|
|
67
|
-
/\bP\d{4}\b/,
|
|
68
|
-
/Cannot (read|set|find|access)/i,
|
|
69
|
-
/Build failed \(exit \d+\)/i,
|
|
70
|
-
/JSON\.stringify/i
|
|
71
|
-
];
|
|
72
|
-
var GRAPHQL_VALIDATION_MESSAGE_PATTERNS = [
|
|
73
|
-
/^Syntax Error:/i,
|
|
74
|
-
/^Cannot query field\b/i,
|
|
75
|
-
/^Cannot return null for non-nullable field\b/i,
|
|
76
|
-
/^Unknown (argument|directive|type)\b/i,
|
|
77
|
-
/^Variable "\$[^"]+" got invalid value/i,
|
|
78
|
-
/^Field "[^"]+" of required type/i,
|
|
79
|
-
/^Field "[^"]+" must not have a selection/i,
|
|
80
|
-
/^Field "[^"]+" must have a selection/i,
|
|
81
|
-
/^Fragment "[^"]+" cannot be spread here/i,
|
|
82
|
-
/^There can be only one/i,
|
|
83
|
-
/Did you mean /i
|
|
84
|
-
];
|
|
85
|
-
function isRecord(value) {
|
|
86
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
87
|
-
}
|
|
88
|
-
__name(isRecord, "isRecord");
|
|
89
|
-
function readString(record, key) {
|
|
90
|
-
const value = record[key];
|
|
91
|
-
return typeof value === "string" && value.trim().length > 0 ? value : null;
|
|
92
|
-
}
|
|
93
|
-
__name(readString, "readString");
|
|
94
|
-
function readExtensions(error) {
|
|
95
|
-
if (!isRecord(error)) return {};
|
|
96
|
-
const extensions = error["extensions"];
|
|
97
|
-
return isRecord(extensions) ? extensions : {};
|
|
98
|
-
}
|
|
99
|
-
__name(readExtensions, "readExtensions");
|
|
100
|
-
function readOriginalError(error) {
|
|
101
|
-
if (error instanceof GraphQLError && error.originalError instanceof Error) {
|
|
102
|
-
return error.originalError;
|
|
103
|
-
}
|
|
104
|
-
return void 0;
|
|
105
|
-
}
|
|
106
|
-
__name(readOriginalError, "readOriginalError");
|
|
107
|
-
function sanitizeExtensions(extensions) {
|
|
108
|
-
const sanitized = {};
|
|
109
|
-
for (const [key, value] of Object.entries(extensions)) {
|
|
110
|
-
if (!SENSITIVE_EXTENSION_KEYS.has(key)) {
|
|
111
|
-
sanitized[key] = value;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return sanitized;
|
|
115
|
-
}
|
|
116
|
-
__name(sanitizeExtensions, "sanitizeExtensions");
|
|
117
|
-
function normalizeCode(code) {
|
|
118
|
-
if (!code) return DEFAULT_ERROR_CODE;
|
|
119
|
-
return code.trim().replace(/[\s-]+/g, "_").toUpperCase();
|
|
120
|
-
}
|
|
121
|
-
__name(normalizeCode, "normalizeCode");
|
|
122
|
-
function inferCodeFromMessage(message) {
|
|
123
|
-
const lower = message.toLowerCase();
|
|
124
|
-
if (GRAPHQL_VALIDATION_MESSAGE_PATTERNS.some((pattern) => pattern.test(message))) {
|
|
125
|
-
return "BAD_USER_INPUT";
|
|
126
|
-
}
|
|
127
|
-
if (lower.includes("unauthenticated") || lower.includes("not authenticated") || lower.includes("authentication required") || lower.includes("unauthorized") || lower.includes("please sign in") || lower.includes("sign in to")) {
|
|
128
|
-
return "UNAUTHENTICATED";
|
|
129
|
-
}
|
|
130
|
-
if (lower.includes("workspace context") || lower.includes("switch to a workspace")) {
|
|
131
|
-
return "WORKSPACE_REQUIRED";
|
|
132
|
-
}
|
|
133
|
-
if (lower.includes("forbidden") || lower.includes("access denied") || lower.includes("permission denied") || lower.includes("not authorized")) {
|
|
134
|
-
return "FORBIDDEN";
|
|
135
|
-
}
|
|
136
|
-
if (lower.includes("not found") || lower.includes("disappeared")) {
|
|
137
|
-
return "NOT_FOUND";
|
|
138
|
-
}
|
|
139
|
-
if (lower.includes("already exists") || lower.includes("already taken") || lower.includes("conflict")) {
|
|
140
|
-
return "CONFLICT";
|
|
141
|
-
}
|
|
142
|
-
if (lower.includes("quota") || lower.includes("cap exceeded") || lower.includes("limit reached")) {
|
|
143
|
-
return "QUOTA_EXCEEDED";
|
|
144
|
-
}
|
|
145
|
-
if (lower.includes("timeout") || lower.includes("timed out")) {
|
|
146
|
-
return "TIMEOUT";
|
|
147
|
-
}
|
|
148
|
-
if (lower.includes("required") || lower.includes("invalid") || lower.includes("missing") || lower.includes("unsupported")) {
|
|
149
|
-
return "BAD_USER_INPUT";
|
|
150
|
-
}
|
|
151
|
-
return DEFAULT_ERROR_CODE;
|
|
152
|
-
}
|
|
153
|
-
__name(inferCodeFromMessage, "inferCodeFromMessage");
|
|
154
|
-
function inferCode(error, extensions, originalError) {
|
|
155
|
-
const extensionCode = typeof extensions["code"] === "string" ? extensions["code"] : null;
|
|
156
|
-
if (extensionCode) return normalizeCode(extensionCode);
|
|
157
|
-
if (isRecord(originalError)) {
|
|
158
|
-
const originalCode = readString(originalError, "code");
|
|
159
|
-
if (originalCode) return normalizeCode(originalCode);
|
|
160
|
-
}
|
|
161
|
-
if (isRecord(error)) {
|
|
162
|
-
const directCode = readString(error, "code");
|
|
163
|
-
if (directCode) return normalizeCode(directCode);
|
|
164
|
-
}
|
|
165
|
-
const message = readErrorMessage(error);
|
|
166
|
-
return inferCodeFromMessage(message);
|
|
167
|
-
}
|
|
168
|
-
__name(inferCode, "inferCode");
|
|
169
|
-
function readErrorMessage(error) {
|
|
170
|
-
if (error instanceof Error && error.message.trim().length > 0) {
|
|
171
|
-
return error.message;
|
|
172
|
-
}
|
|
173
|
-
if (isRecord(error)) {
|
|
174
|
-
const message = readString(error, "message");
|
|
175
|
-
if (message) return message;
|
|
176
|
-
}
|
|
177
|
-
return DEFAULT_USER_MESSAGES[DEFAULT_ERROR_CODE];
|
|
178
|
-
}
|
|
179
|
-
__name(readErrorMessage, "readErrorMessage");
|
|
180
|
-
function isLikelyTechnicalMessage(message) {
|
|
181
|
-
if (message.length > 220) return true;
|
|
182
|
-
if (message.includes("\n")) return true;
|
|
183
|
-
if (message.includes("{") && message.includes("}")) return true;
|
|
184
|
-
if (GRAPHQL_VALIDATION_MESSAGE_PATTERNS.some((pattern) => pattern.test(message))) return true;
|
|
185
|
-
return TECHNICAL_MESSAGE_PATTERNS.some((pattern) => pattern.test(message));
|
|
186
|
-
}
|
|
187
|
-
__name(isLikelyTechnicalMessage, "isLikelyTechnicalMessage");
|
|
188
|
-
function readExplicitUserMessage(extensions) {
|
|
189
|
-
return readString(extensions, "userMessage") ?? readString(extensions, "humanMessage") ?? readString(extensions, "displayMessage");
|
|
190
|
-
}
|
|
191
|
-
__name(readExplicitUserMessage, "readExplicitUserMessage");
|
|
192
|
-
function resolveUserMessage(code, message, extensions) {
|
|
193
|
-
const explicit = readExplicitUserMessage(extensions);
|
|
194
|
-
if (explicit) return explicit;
|
|
195
|
-
const fallback = DEFAULT_USER_MESSAGES[code] ?? DEFAULT_USER_MESSAGES[DEFAULT_ERROR_CODE] ?? "Something went wrong. Please try again.";
|
|
196
|
-
if (code === DEFAULT_ERROR_CODE) {
|
|
197
|
-
return fallback;
|
|
198
|
-
}
|
|
199
|
-
if (!isLikelyTechnicalMessage(message)) {
|
|
200
|
-
return message;
|
|
201
|
-
}
|
|
202
|
-
return fallback;
|
|
203
|
-
}
|
|
204
|
-
__name(resolveUserMessage, "resolveUserMessage");
|
|
205
|
-
function resolveTechnicalMessage(code, message, extensions, options) {
|
|
206
|
-
const explicit = readString(extensions, "technicalMessage");
|
|
207
|
-
if (explicit) return explicit;
|
|
208
|
-
if (options.environment === "production" && code === DEFAULT_ERROR_CODE) {
|
|
209
|
-
return options.serviceName ? `${options.serviceName} returned ${DEFAULT_ERROR_CODE}` : DEFAULT_ERROR_CODE;
|
|
210
|
-
}
|
|
211
|
-
return message;
|
|
212
|
-
}
|
|
213
|
-
__name(resolveTechnicalMessage, "resolveTechnicalMessage");
|
|
214
|
-
function isValidHttpStatus(status) {
|
|
215
|
-
return typeof status === "number" && Number.isInteger(status) && status >= 200 && status <= 599;
|
|
216
|
-
}
|
|
217
|
-
__name(isValidHttpStatus, "isValidHttpStatus");
|
|
218
|
-
function readHttpStatus(extensions, code) {
|
|
219
|
-
const http = extensions["http"];
|
|
220
|
-
if (isRecord(http) && isValidHttpStatus(http["status"])) {
|
|
221
|
-
return http["status"];
|
|
222
|
-
}
|
|
223
|
-
return DEFAULT_STATUS_BY_CODE[code] ?? DEFAULT_HTTP_STATUS;
|
|
224
|
-
}
|
|
225
|
-
__name(readHttpStatus, "readHttpStatus");
|
|
226
|
-
function normalizeError(error, options = {}) {
|
|
227
|
-
const originalError = readOriginalError(error);
|
|
228
|
-
const originalExtensions = readExtensions(originalError);
|
|
229
|
-
const directExtensions = readExtensions(error);
|
|
230
|
-
const mergedExtensions = sanitizeExtensions({
|
|
231
|
-
...originalExtensions,
|
|
232
|
-
...directExtensions
|
|
233
|
-
});
|
|
234
|
-
const message = readErrorMessage(error);
|
|
235
|
-
const code = inferCode(error, mergedExtensions, originalError);
|
|
236
|
-
const userMessage = resolveUserMessage(code, message, mergedExtensions);
|
|
237
|
-
const technicalMessage = resolveTechnicalMessage(code, message, mergedExtensions, options);
|
|
238
|
-
const status = readHttpStatus(mergedExtensions, code);
|
|
239
|
-
const extensions = {
|
|
240
|
-
...mergedExtensions,
|
|
241
|
-
code,
|
|
242
|
-
userMessage,
|
|
243
|
-
technicalMessage
|
|
244
|
-
};
|
|
245
|
-
if (options.serviceName) {
|
|
246
|
-
extensions["serviceName"] = options.serviceName;
|
|
247
|
-
}
|
|
248
|
-
const http = extensions["http"];
|
|
249
|
-
extensions["http"] = {
|
|
250
|
-
...isRecord(http) ? http : {},
|
|
251
|
-
status
|
|
252
|
-
};
|
|
253
|
-
return {
|
|
254
|
-
code,
|
|
255
|
-
userMessage,
|
|
256
|
-
technicalMessage,
|
|
257
|
-
extensions,
|
|
258
|
-
status
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
__name(normalizeError, "normalizeError");
|
|
262
|
-
var UserFacingGraphQLError = class extends GraphQLError {
|
|
263
|
-
static {
|
|
264
|
-
__name(this, "UserFacingGraphQLError");
|
|
265
|
-
}
|
|
266
|
-
constructor(options) {
|
|
267
|
-
const extensions = {
|
|
268
|
-
code: normalizeCode(options.code),
|
|
269
|
-
userMessage: options.userMessage,
|
|
270
|
-
technicalMessage: options.technicalMessage ?? options.userMessage
|
|
271
|
-
};
|
|
272
|
-
if (options.details) {
|
|
273
|
-
extensions["details"] = options.details;
|
|
274
|
-
}
|
|
275
|
-
if (options.httpStatus) {
|
|
276
|
-
extensions["http"] = {
|
|
277
|
-
status: options.httpStatus
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
super(options.userMessage, {
|
|
281
|
-
originalError: options.cause,
|
|
282
|
-
extensions
|
|
283
|
-
});
|
|
284
|
-
this.name = "UserFacingGraphQLError";
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
function toUserFacingGraphQLError(error, options = {}) {
|
|
288
|
-
const normalized = normalizeError(error, options);
|
|
289
|
-
if (error instanceof GraphQLError) {
|
|
290
|
-
return new GraphQLError(normalized.userMessage, {
|
|
291
|
-
nodes: error.nodes,
|
|
292
|
-
source: error.source,
|
|
293
|
-
positions: error.positions,
|
|
294
|
-
path: error.path,
|
|
295
|
-
originalError: error.originalError,
|
|
296
|
-
extensions: normalized.extensions
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
return new GraphQLError(normalized.userMessage, {
|
|
300
|
-
originalError: error instanceof Error ? error : void 0,
|
|
301
|
-
extensions: normalized.extensions
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
__name(toUserFacingGraphQLError, "toUserFacingGraphQLError");
|
|
305
|
-
function normalizeExecutionResultErrors(result, options = {}) {
|
|
306
|
-
if (Array.isArray(result)) {
|
|
307
|
-
result.forEach((entry) => normalizeExecutionResultErrors(entry, options));
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
if (!isRecord(result)) return;
|
|
311
|
-
const errors = result["errors"];
|
|
312
|
-
if (!Array.isArray(errors) || errors.length === 0) return;
|
|
313
|
-
result["errors"] = errors.map((error) => toUserFacingGraphQLError(error, options));
|
|
314
|
-
}
|
|
315
|
-
__name(normalizeExecutionResultErrors, "normalizeExecutionResultErrors");
|
|
316
|
-
function normalizeGraphQLResponsePayload(payload, options = {}) {
|
|
317
|
-
normalizeExecutionResultErrors(payload, options);
|
|
318
|
-
return payload;
|
|
319
|
-
}
|
|
320
|
-
__name(normalizeGraphQLResponsePayload, "normalizeGraphQLResponsePayload");
|
|
321
|
-
function restoreSerializedHttpStatuses(payload, responseStatus) {
|
|
322
|
-
if (Array.isArray(payload)) {
|
|
323
|
-
payload.forEach((entry) => restoreSerializedHttpStatuses(entry, responseStatus));
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
if (!isRecord(payload) || !Array.isArray(payload["errors"])) return;
|
|
327
|
-
for (const error of payload["errors"]) {
|
|
328
|
-
if (!isRecord(error)) continue;
|
|
329
|
-
const extensions = readExtensions(error);
|
|
330
|
-
const http = extensions["http"];
|
|
331
|
-
if (isRecord(http) && isValidHttpStatus(http["status"])) continue;
|
|
332
|
-
const code = inferCode(error, extensions, void 0);
|
|
333
|
-
const status = DEFAULT_STATUS_BY_CODE[code] ?? (code !== DEFAULT_ERROR_CODE && responseStatus >= 400 ? responseStatus : DEFAULT_HTTP_STATUS);
|
|
334
|
-
error["extensions"] = {
|
|
335
|
-
...extensions,
|
|
336
|
-
http: {
|
|
337
|
-
...isRecord(http) ? http : {},
|
|
338
|
-
status
|
|
339
|
-
}
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
__name(restoreSerializedHttpStatuses, "restoreSerializedHttpStatuses");
|
|
344
|
-
async function normalizeGraphQLResponse(response, options = {}) {
|
|
345
|
-
const contentType = response.headers.get("content-type") ?? "";
|
|
346
|
-
if (!contentType.toLowerCase().includes("json")) {
|
|
347
|
-
return response;
|
|
348
|
-
}
|
|
349
|
-
const text = await response.text();
|
|
350
|
-
if (!text) {
|
|
351
|
-
return new Response(text, {
|
|
352
|
-
status: response.status,
|
|
353
|
-
statusText: response.statusText,
|
|
354
|
-
headers: response.headers
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
let payload;
|
|
358
|
-
try {
|
|
359
|
-
payload = JSON.parse(text);
|
|
360
|
-
} catch {
|
|
361
|
-
return new Response(text, {
|
|
362
|
-
status: response.status,
|
|
363
|
-
statusText: response.statusText,
|
|
364
|
-
headers: response.headers
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
restoreSerializedHttpStatuses(payload, response.status);
|
|
368
|
-
normalizeGraphQLResponsePayload(payload, options);
|
|
369
|
-
return new Response(JSON.stringify(payload), {
|
|
370
|
-
status: response.status,
|
|
371
|
-
statusText: response.statusText,
|
|
372
|
-
headers: response.headers
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
__name(normalizeGraphQLResponse, "normalizeGraphQLResponse");
|
|
376
|
-
function createHumanReadableErrorPlugin(options = {}) {
|
|
377
|
-
return {
|
|
378
|
-
onExecute() {
|
|
379
|
-
return {
|
|
380
|
-
onExecuteDone({ result }) {
|
|
381
|
-
normalizeExecutionResultErrors(result, options);
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
__name(createHumanReadableErrorPlugin, "createHumanReadableErrorPlugin");
|
|
388
|
-
function formatHttpError(error, options = {}) {
|
|
389
|
-
const normalized = normalizeError(error, options);
|
|
390
|
-
return {
|
|
391
|
-
status: normalized.status,
|
|
392
|
-
body: {
|
|
393
|
-
error: normalized.userMessage,
|
|
394
|
-
message: normalized.userMessage,
|
|
395
|
-
userMessage: normalized.userMessage,
|
|
396
|
-
technicalMessage: normalized.technicalMessage,
|
|
397
|
-
code: normalized.code,
|
|
398
|
-
extensions: normalized.extensions
|
|
399
|
-
}
|
|
400
|
-
};
|
|
401
|
-
}
|
|
402
|
-
__name(formatHttpError, "formatHttpError");
|
|
403
|
-
function createHttpErrorResponse(error, options = {}) {
|
|
404
|
-
const formatted = formatHttpError(error, options);
|
|
405
|
-
return new Response(JSON.stringify(formatted.body), {
|
|
406
|
-
status: formatted.status,
|
|
407
|
-
headers: {
|
|
408
|
-
"Content-Type": "application/json"
|
|
409
|
-
}
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
__name(createHttpErrorResponse, "createHttpErrorResponse");
|
|
413
|
-
|
|
414
|
-
// src/server/workspace-guard.ts
|
|
415
|
-
var WorkspaceRequiredError = class WorkspaceRequiredError2 extends UserFacingGraphQLError {
|
|
416
|
-
static {
|
|
417
|
-
__name(this, "WorkspaceRequiredError");
|
|
418
|
-
}
|
|
419
|
-
constructor(message) {
|
|
420
|
-
super({
|
|
421
|
-
code: "WORKSPACE_REQUIRED",
|
|
422
|
-
userMessage: "Please choose a workspace and try again.",
|
|
423
|
-
technicalMessage: message,
|
|
424
|
-
httpStatus: 403
|
|
425
|
-
});
|
|
426
|
-
this.name = "WorkspaceRequiredError";
|
|
427
|
-
}
|
|
428
|
-
};
|
|
429
|
-
var WorkspaceMembershipError = class WorkspaceMembershipError2 extends UserFacingGraphQLError {
|
|
430
|
-
static {
|
|
431
|
-
__name(this, "WorkspaceMembershipError");
|
|
432
|
-
}
|
|
433
|
-
constructor(workspaceId) {
|
|
434
|
-
super({
|
|
435
|
-
code: "NOT_FOUND",
|
|
436
|
-
userMessage: "We could not find the requested item.",
|
|
437
|
-
technicalMessage: `Workspace ${workspaceId} was not found for the current actor.`,
|
|
438
|
-
httpStatus: 404
|
|
439
|
-
});
|
|
440
|
-
this.name = "WorkspaceMembershipError";
|
|
441
|
-
}
|
|
442
|
-
};
|
|
443
|
-
function isFieldPublic(field) {
|
|
444
|
-
const directives = field?.astNode?.directives;
|
|
445
|
-
if (!directives || directives.length === 0) return false;
|
|
446
|
-
for (const dir of directives) {
|
|
447
|
-
const name = dir.name?.value;
|
|
448
|
-
if (name === "public") return true;
|
|
449
|
-
if (name === "rbac") {
|
|
450
|
-
const args = dir.arguments ?? [];
|
|
451
|
-
for (const arg of args) {
|
|
452
|
-
if (arg.name?.value === "public" && arg.value?.kind === "BooleanValue" && arg.value.value === true) {
|
|
453
|
-
return true;
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
return false;
|
|
459
|
-
}
|
|
460
|
-
__name(isFieldPublic, "isFieldPublic");
|
|
461
|
-
function resolveOperationType(document, operationName) {
|
|
462
|
-
const defs = document?.definitions ?? [];
|
|
463
|
-
for (const def of defs) {
|
|
464
|
-
if (def.kind !== "OperationDefinition") ;
|
|
465
|
-
if (def.operation && (!operationName || def.name?.value === operationName)) {
|
|
466
|
-
return def.operation;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
return "query";
|
|
470
|
-
}
|
|
471
|
-
__name(resolveOperationType, "resolveOperationType");
|
|
472
|
-
function resolveRootFieldNames(document, operationName) {
|
|
473
|
-
const defs = document?.definitions ?? [];
|
|
474
|
-
const opDef = defs.find((d) => d.operation && (!operationName || d.name?.value === operationName));
|
|
475
|
-
const selections = opDef?.selectionSet?.selections ?? [];
|
|
476
|
-
if (selections.length === 0) return null;
|
|
477
|
-
const fieldNames = [];
|
|
478
|
-
for (const sel of selections) {
|
|
479
|
-
if (sel.kind && sel.kind !== "Field") return null;
|
|
480
|
-
const fieldName = sel.name?.value;
|
|
481
|
-
if (!fieldName) return null;
|
|
482
|
-
if (fieldName.startsWith("__")) continue;
|
|
483
|
-
fieldNames.push(fieldName);
|
|
484
|
-
}
|
|
485
|
-
return fieldNames;
|
|
486
|
-
}
|
|
487
|
-
__name(resolveRootFieldNames, "resolveRootFieldNames");
|
|
488
|
-
function allRootFieldsWhitelisted(rootFieldNames, whitelistedFields) {
|
|
489
|
-
return rootFieldNames.length > 0 && rootFieldNames.every((name) => whitelistedFields.has(name));
|
|
490
|
-
}
|
|
491
|
-
__name(allRootFieldsWhitelisted, "allRootFieldsWhitelisted");
|
|
492
|
-
function allRootFieldsPublic(schema, document, operationName, rootFieldNames) {
|
|
493
|
-
if (!document) return false;
|
|
494
|
-
if (rootFieldNames === null) return false;
|
|
495
|
-
if (rootFieldNames.length === 0) return true;
|
|
496
|
-
if (!schema) return false;
|
|
497
|
-
const opType = resolveOperationType(document, operationName);
|
|
498
|
-
let rootType;
|
|
499
|
-
if (opType === "mutation") {
|
|
500
|
-
rootType = schema.getMutationType?.();
|
|
501
|
-
} else if (opType === "subscription") {
|
|
502
|
-
rootType = schema.getSubscriptionType?.();
|
|
503
|
-
} else {
|
|
504
|
-
rootType = schema.getQueryType?.();
|
|
505
|
-
}
|
|
506
|
-
if (!rootType) return false;
|
|
507
|
-
const fields = rootType.getFields();
|
|
508
|
-
for (const fieldName of rootFieldNames) {
|
|
509
|
-
const fieldDef = fields[fieldName];
|
|
510
|
-
if (!isFieldPublic(fieldDef)) return false;
|
|
511
|
-
}
|
|
512
|
-
return true;
|
|
513
|
-
}
|
|
514
|
-
__name(allRootFieldsPublic, "allRootFieldsPublic");
|
|
515
|
-
function createWorkspaceGuardPlugin(config) {
|
|
516
|
-
const enabled = config?.enabled ?? true;
|
|
517
|
-
const whitelistedOperations = new Set(config?.whitelistedOperations ?? []);
|
|
518
|
-
const whitelistedFields = new Set(config?.whitelistedFields ?? []);
|
|
519
|
-
const validateWorkspaceMembership = config?.validateWorkspaceMembership;
|
|
520
|
-
const allowPublicDirective = config?.allowPublicDirective ?? true;
|
|
521
|
-
const errorMessage = config?.errorMessage ?? "Workspace context required. Ensure the request includes a valid workspace context (x-workspace-id header).";
|
|
522
|
-
if (!enabled) {
|
|
523
|
-
logger.info("[WorkspaceGuard] Workspace guard disabled");
|
|
524
|
-
return {};
|
|
525
|
-
}
|
|
526
|
-
logger.info("[WorkspaceGuard] Workspace guard enabled", {
|
|
527
|
-
whitelistedOperations: [
|
|
528
|
-
...whitelistedOperations
|
|
529
|
-
],
|
|
530
|
-
whitelistedFields: [
|
|
531
|
-
...whitelistedFields
|
|
532
|
-
],
|
|
533
|
-
membershipValidation: validateWorkspaceMembership ? "enabled" : "disabled",
|
|
534
|
-
allowPublicDirective
|
|
535
|
-
});
|
|
536
|
-
return {
|
|
537
|
-
async onExecute({ args }) {
|
|
538
|
-
let operationName = args.operationName;
|
|
539
|
-
if (!operationName && args.document?.definitions) {
|
|
540
|
-
for (const def of args.document.definitions) {
|
|
541
|
-
if (def.operation && def.name?.value) {
|
|
542
|
-
operationName = def.name.value;
|
|
543
|
-
break;
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
if (operationName && whitelistedOperations.has(operationName)) {
|
|
548
|
-
return void 0;
|
|
549
|
-
}
|
|
550
|
-
const rootFieldNames = resolveRootFieldNames(args.document, operationName);
|
|
551
|
-
if (whitelistedFields.size > 0 && rootFieldNames && allRootFieldsWhitelisted(rootFieldNames, whitelistedFields)) {
|
|
552
|
-
return void 0;
|
|
553
|
-
}
|
|
554
|
-
if (allowPublicDirective && allRootFieldsPublic(args.schema, args.document, operationName, rootFieldNames)) {
|
|
555
|
-
return void 0;
|
|
556
|
-
}
|
|
557
|
-
const context = args.contextValue;
|
|
558
|
-
const workspaceId = context?.workspace?.id;
|
|
559
|
-
const headerWorkspaceId = context?.request?.headers?.get?.("x-workspace-id");
|
|
560
|
-
if (!workspaceId && !headerWorkspaceId) {
|
|
561
|
-
logger.warn("[WorkspaceGuard] Blocked operation without workspace context", {
|
|
562
|
-
operationName: operationName ?? "<anonymous>"
|
|
563
|
-
});
|
|
564
|
-
throw new WorkspaceRequiredError(errorMessage);
|
|
565
|
-
}
|
|
566
|
-
if (validateWorkspaceMembership) {
|
|
567
|
-
const resolvedWorkspaceId = workspaceId ? workspaceId : headerWorkspaceId ?? "";
|
|
568
|
-
const actor = context?.actor ?? null;
|
|
569
|
-
let isMember = false;
|
|
570
|
-
try {
|
|
571
|
-
isMember = await validateWorkspaceMembership({
|
|
572
|
-
actorId: actor?.id ?? null,
|
|
573
|
-
actorType: actor?.type ?? null,
|
|
574
|
-
workspaceId: resolvedWorkspaceId,
|
|
575
|
-
contextValue: context
|
|
576
|
-
});
|
|
577
|
-
} catch (error) {
|
|
578
|
-
logger.error("[WorkspaceGuard] Workspace membership validation failed", {
|
|
579
|
-
operationName: operationName ?? "<anonymous>",
|
|
580
|
-
workspaceId: resolvedWorkspaceId,
|
|
581
|
-
error
|
|
582
|
-
});
|
|
583
|
-
throw new WorkspaceMembershipError(resolvedWorkspaceId);
|
|
584
|
-
}
|
|
585
|
-
if (!isMember) {
|
|
586
|
-
logger.warn("[WorkspaceGuard] Rejected non-member workspace context", {
|
|
587
|
-
operationName: operationName ?? "<anonymous>",
|
|
588
|
-
workspaceId: resolvedWorkspaceId,
|
|
589
|
-
actorId: actor?.id ?? null
|
|
590
|
-
});
|
|
591
|
-
throw new WorkspaceMembershipError(resolvedWorkspaceId);
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
return void 0;
|
|
595
|
-
}
|
|
596
|
-
};
|
|
597
|
-
}
|
|
598
|
-
__name(createWorkspaceGuardPlugin, "createWorkspaceGuardPlugin");
|
|
599
|
-
|
|
600
|
-
export { UserFacingGraphQLError, createHttpErrorResponse, createHumanReadableErrorPlugin, createWorkspaceGuardPlugin, formatHttpError, normalizeError, normalizeExecutionResultErrors, normalizeGraphQLResponse, normalizeGraphQLResponsePayload, toUserFacingGraphQLError };
|
|
601
|
-
//# sourceMappingURL=chunk-BJQOGOVW.js.map
|
|
602
|
-
//# sourceMappingURL=chunk-BJQOGOVW.js.map
|