@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
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
import { a as logger } from "./logger-B6rCpb7D.js";
|
|
2
|
+
import { a as getScopedWorkspaceContext, o as getWorkspaceContext } from "./workspace-extension-COrC0dYi.js";
|
|
3
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
|
+
import { randomUUID } from "node:crypto";
|
|
5
|
+
|
|
6
|
+
// src/activity/explicit-activity-scope.ts
|
|
7
|
+
/**
|
|
8
|
+
* Explicit-activity scope
|
|
9
|
+
*
|
|
10
|
+
* Lets the mutation-audit backstop (`createMutationAuditPlugin` in
|
|
11
|
+
* `@burdenoff/be-sdk/server`) know whether a GraphQL operation already wrote an
|
|
12
|
+
* activity row through an explicit call (`trackOperation`, `trackerStub.track`,
|
|
13
|
+
* `ActivityModule.log`, or a service's own `logAudit` wrapper over them). When it
|
|
14
|
+
* did, the backstop skips its generic `graphql.mutation` row so the activity feed
|
|
15
|
+
* never carries two rows for one mutation.
|
|
16
|
+
*
|
|
17
|
+
* The scope is entered with `AsyncLocalStorage.run()` around the operation's
|
|
18
|
+
* execute function. `run()` (unlike `enterWith()`) propagates through every
|
|
19
|
+
* promise continuation started inside it, including fire-and-forget calls made
|
|
20
|
+
* by resolvers, so concurrent requests never see each other's marks.
|
|
21
|
+
*
|
|
22
|
+
* Outside a scope (background jobs, event consumers, REST handlers) every
|
|
23
|
+
* function here is a no-op.
|
|
24
|
+
*/
|
|
25
|
+
const scopeStorage = new AsyncLocalStorage();
|
|
26
|
+
/** Create a fresh, unmarked scope. */
|
|
27
|
+
function createExplicitActivityScope() {
|
|
28
|
+
return {
|
|
29
|
+
explicitCount: 0,
|
|
30
|
+
suppressed: false
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Run `fn` with `scope` as the active explicit-activity scope. */
|
|
34
|
+
function runInExplicitActivityScope(scope, fn) {
|
|
35
|
+
return scopeStorage.run(scope, fn);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Record that an explicit activity write happened in the current operation.
|
|
39
|
+
* Called by the SDK's own activity writers; services never need to call it.
|
|
40
|
+
*/
|
|
41
|
+
function markExplicitActivity() {
|
|
42
|
+
const scope = scopeStorage.getStore();
|
|
43
|
+
if (scope) scope.explicitCount += 1;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Tell the mutation-audit backstop not to write its generic row for the current
|
|
47
|
+
* operation.
|
|
48
|
+
*
|
|
49
|
+
* Use it in a resolver whose audit trail goes through a path the SDK cannot see
|
|
50
|
+
* (for example a direct call to the activity subgraph), or for a mutation that
|
|
51
|
+
* must deliberately leave no activity row. Has no effect outside an operation
|
|
52
|
+
* that mounts the backstop.
|
|
53
|
+
*/
|
|
54
|
+
function suppressMutationAudit() {
|
|
55
|
+
const scope = scopeStorage.getStore();
|
|
56
|
+
if (scope) scope.suppressed = true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// src/activity/assistant-session.ts
|
|
60
|
+
/**
|
|
61
|
+
* Assistant-session attribution (BOFF-9649)
|
|
62
|
+
*
|
|
63
|
+
* When an AI assistant session runs a GraphQL mutation for its owner, the
|
|
64
|
+
* assistant session relay (wspace-sandbox-svc) forwards it to a public gateway
|
|
65
|
+
* as the owner, with a signed assistant-session marker. The gateway verifies
|
|
66
|
+
* that marker against the owner's verified token, strips any copy a client
|
|
67
|
+
* sent, and passes the result to subgraphs as three headers:
|
|
68
|
+
*
|
|
69
|
+
* x-actor-origin: ai_assistant
|
|
70
|
+
* x-assistant-session-id: <the relay session id (the assistant sandbox id)>
|
|
71
|
+
* x-assistant-correlation-id: <the proposal / idempotency key, when there is one>
|
|
72
|
+
*
|
|
73
|
+
* A service never verifies these itself. `buildContext` reads them only when it
|
|
74
|
+
* already trusts the gateway's actor headers, exposes them as
|
|
75
|
+
* `context.assistantSession`, and binds them to the operation's workspace
|
|
76
|
+
* context so `trackOperation` can stamp every activity row written while the
|
|
77
|
+
* operation runs, without each service re-implementing audit.
|
|
78
|
+
*
|
|
79
|
+
* Values outside the vocabulary or the id pattern are dropped, never coerced:
|
|
80
|
+
* a wrong attribution is worse than none.
|
|
81
|
+
*/
|
|
82
|
+
/** The only actor origin the platform records today. */
|
|
83
|
+
const AI_ASSISTANT_ACTOR_ORIGIN = "ai_assistant";
|
|
84
|
+
/** Gateway-to-subgraph headers. Clients cannot set them: the public gateways strip them. */
|
|
85
|
+
const ACTOR_ORIGIN_HEADER = "x-actor-origin";
|
|
86
|
+
const ASSISTANT_SESSION_ID_HEADER = "x-assistant-session-id";
|
|
87
|
+
const ASSISTANT_CORRELATION_ID_HEADER = "x-assistant-correlation-id";
|
|
88
|
+
/** Session ids (UUIDs, cuid-style ids) and proposal / idempotency keys. */
|
|
89
|
+
const ATTRIBUTION_ID_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
|
|
90
|
+
function attributionId(value) {
|
|
91
|
+
return typeof value === "string" && ATTRIBUTION_ID_PATTERN.test(value) ? value : void 0;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Build an attribution from raw values. Undefined unless the origin is
|
|
95
|
+
* `ai_assistant` and the session id is well formed; a malformed correlation id
|
|
96
|
+
* is dropped on its own.
|
|
97
|
+
*/
|
|
98
|
+
function toAssistantSessionAttribution(actorOrigin, assistantSessionId, assistantCorrelationId) {
|
|
99
|
+
if (actorOrigin !== "ai_assistant") return void 0;
|
|
100
|
+
const sessionId = attributionId(assistantSessionId);
|
|
101
|
+
if (!sessionId) return void 0;
|
|
102
|
+
const correlationId = attributionId(assistantCorrelationId);
|
|
103
|
+
return {
|
|
104
|
+
actorOrigin: AI_ASSISTANT_ACTOR_ORIGIN,
|
|
105
|
+
assistantSessionId: sessionId,
|
|
106
|
+
...correlationId ? { assistantCorrelationId: correlationId } : {}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Read the gateway's assistant-session headers. The caller decides whether the
|
|
111
|
+
* request's gateway headers are trusted at all; this only parses them.
|
|
112
|
+
*/
|
|
113
|
+
function parseAssistantSessionHeaders(getHeader) {
|
|
114
|
+
return toAssistantSessionAttribution(getHeader(ACTOR_ORIGIN_HEADER), getHeader(ASSISTANT_SESSION_ID_HEADER), getHeader(ASSISTANT_CORRELATION_ID_HEADER));
|
|
115
|
+
}
|
|
116
|
+
/** Re-validate an attribution-shaped value (from a request context or caller options). */
|
|
117
|
+
function readAssistantSessionAttribution(value) {
|
|
118
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
119
|
+
const record = value;
|
|
120
|
+
return toAssistantSessionAttribution(record["actorOrigin"], record["assistantSessionId"], record["assistantCorrelationId"]);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// src/tracker/stub.ts
|
|
124
|
+
/**
|
|
125
|
+
* Unified Tracking — Auto-Promoting Implementation
|
|
126
|
+
*
|
|
127
|
+
* Automatically promotes from stub to real tracking when gateway URLs are configured.
|
|
128
|
+
* When WSPACE_INT_GATEWAY_URL or GLOBAL_INT_GATEWAY_URL is set, this module will:
|
|
129
|
+
* - Log activity events via GraphQL to the activity service
|
|
130
|
+
* - Track usage via GraphQL to the usage service (if usage options provided)
|
|
131
|
+
* - RBAC checks are NOT performed here (handled by gateway @rbac directives)
|
|
132
|
+
*
|
|
133
|
+
* When no gateway URL is configured, falls back to debug-level logging (stub mode).
|
|
134
|
+
*
|
|
135
|
+
* This is a backward-compatible drop-in replacement for the original stub. All 1,100+
|
|
136
|
+
* existing call sites continue to work without modification.
|
|
137
|
+
*
|
|
138
|
+
* @module tracker/stub
|
|
139
|
+
* @category Tracking
|
|
140
|
+
*/
|
|
141
|
+
const TRACKED_ACTOR_TYPES = /* @__PURE__ */ new Set([
|
|
142
|
+
"user",
|
|
143
|
+
"app",
|
|
144
|
+
"service",
|
|
145
|
+
"super_admin"
|
|
146
|
+
]);
|
|
147
|
+
function isTrackedActorType(value) {
|
|
148
|
+
return typeof value === "string" && TRACKED_ACTOR_TYPES.has(value);
|
|
149
|
+
}
|
|
150
|
+
let _gatewayUrl;
|
|
151
|
+
let _gatewayLayer;
|
|
152
|
+
let _gatewayUrlResolved = false;
|
|
153
|
+
/**
|
|
154
|
+
* The layer the running service belongs to, when its environment says so: `SERVICE_LAYER`, then a
|
|
155
|
+
* `global-` / `wspace-` `SERVICE_NAME` prefix (the same rule the RBAC directive and the Temporal
|
|
156
|
+
* client use). Undefined when neither says.
|
|
157
|
+
*/
|
|
158
|
+
function declaredServiceLayer() {
|
|
159
|
+
const layer = process.env["SERVICE_LAYER"];
|
|
160
|
+
if (layer === "global" || layer === "wspace") return layer;
|
|
161
|
+
const name = process.env["SERVICE_NAME"] ?? "";
|
|
162
|
+
if (name.startsWith("global-")) return "global";
|
|
163
|
+
if (name.startsWith("wspace-")) return "wspace";
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Resolve the internal gateway URL from environment.
|
|
167
|
+
*
|
|
168
|
+
* Activity belongs to the service's OWN layer: workspace services record in wspace-activity-svc
|
|
169
|
+
* through WSPACE_INT_GATEWAY_URL, global services in global-activity-svc through
|
|
170
|
+
* GLOBAL_INT_GATEWAY_URL. Global services also hold WSPACE_INT_GATEWAY_URL for cross-layer
|
|
171
|
+
* calls, so the URL that happens to be set is not a layer signal: the declared layer
|
|
172
|
+
* (`SERVICE_LAYER` / `SERVICE_NAME`) decides, and only an undeclared service falls back to
|
|
173
|
+
* "workspace URL first" (BOFF-9649 — every global service was sending its audit rows to the
|
|
174
|
+
* workspace activity owner, which rejected them). Undefined (stub mode) when no URL is set.
|
|
175
|
+
*/
|
|
176
|
+
function getGatewayUrl() {
|
|
177
|
+
if (!_gatewayUrlResolved) {
|
|
178
|
+
const wspaceUrl = process.env["WSPACE_INT_GATEWAY_URL"];
|
|
179
|
+
const globalUrl = process.env["GLOBAL_INT_GATEWAY_URL"];
|
|
180
|
+
const declared = declaredServiceLayer();
|
|
181
|
+
if (Boolean(globalUrl) && (declared === "global" || !wspaceUrl)) {
|
|
182
|
+
_gatewayUrl = globalUrl;
|
|
183
|
+
_gatewayLayer = "global";
|
|
184
|
+
} else if (wspaceUrl) {
|
|
185
|
+
_gatewayUrl = wspaceUrl;
|
|
186
|
+
_gatewayLayer = "wspace";
|
|
187
|
+
} else {
|
|
188
|
+
_gatewayUrl = void 0;
|
|
189
|
+
_gatewayLayer = void 0;
|
|
190
|
+
}
|
|
191
|
+
if (declared && _gatewayLayer && declared !== _gatewayLayer) logger.warn(`[trackOperation] ${declared} service has no ${declared === "global" ? "GLOBAL" : "WSPACE"}_INT_GATEWAY_URL; activity goes to the ${_gatewayLayer} activity owner instead`);
|
|
192
|
+
_gatewayUrlResolved = true;
|
|
193
|
+
if (_gatewayUrl) logger.info(`[trackOperation] Real tracking enabled via ${_gatewayLayer} gateway: ${_gatewayUrl}`);
|
|
194
|
+
else logger.debug("[trackOperation] No gateway URL configured — running in stub mode");
|
|
195
|
+
}
|
|
196
|
+
return _gatewayUrl;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Resolve which activity layer the configured gateway fronts.
|
|
200
|
+
* Always call `getGatewayUrl()` first — it performs the resolution.
|
|
201
|
+
*/
|
|
202
|
+
function getGatewayLayer() {
|
|
203
|
+
return _gatewayLayer ?? "wspace";
|
|
204
|
+
}
|
|
205
|
+
const LOG_ACTIVITY_MUTATION = `
|
|
206
|
+
mutation RecordActivity($input: RecordActivityInput!) {
|
|
207
|
+
recordActivity(input: $input) {
|
|
208
|
+
id
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
`;
|
|
212
|
+
/**
|
|
213
|
+
* Derive the `resource` value required by global-activity-svc.
|
|
214
|
+
*
|
|
215
|
+
* Prefers an explicit resourceType; otherwise falls back to the leading dotted segment of the
|
|
216
|
+
* operation name (`auth.session.revoke` → `auth`), which matches the platform's
|
|
217
|
+
* `<domain>.<resource>.<verb>` activity taxonomy. Never returns empty — `resource` is non-nullable
|
|
218
|
+
* on global-activity-svc and an empty string would be silently useless in the audit trail.
|
|
219
|
+
*/
|
|
220
|
+
function deriveResource(options) {
|
|
221
|
+
const explicit = options.activityOptions?.resourceType ?? options.resourceType;
|
|
222
|
+
if (explicit && explicit.trim().length > 0) return explicit;
|
|
223
|
+
const op = options.operationName;
|
|
224
|
+
if (op && op.trim().length > 0) {
|
|
225
|
+
const [head] = op.split(".");
|
|
226
|
+
if (head && head.trim().length > 0) return head;
|
|
227
|
+
}
|
|
228
|
+
return "unknown";
|
|
229
|
+
}
|
|
230
|
+
function readRecord(value) {
|
|
231
|
+
return typeof value === "object" && value !== null ? value : void 0;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Resolve the kind of actor behind a tracked operation. Exported for unit tests.
|
|
235
|
+
*
|
|
236
|
+
* Precedence: the explicit `actorType` option, then the request `context` the caller passed
|
|
237
|
+
* (`actor.type`, then the flat `actorType`), then the ambient be-sdk workspace context. A request
|
|
238
|
+
* context is authoritative once given: an unknown kind there yields undefined rather than falling
|
|
239
|
+
* through to the ambient context, which could belong to a different request in the same async
|
|
240
|
+
* chain. A wrong attribution is worse than none.
|
|
241
|
+
*/
|
|
242
|
+
function resolveTrackedActorType(options) {
|
|
243
|
+
if (options.actorType !== void 0) return isTrackedActorType(options.actorType) ? options.actorType : void 0;
|
|
244
|
+
const context = readRecord(options.context);
|
|
245
|
+
if (context) {
|
|
246
|
+
const fromContext = readRecord(context["actor"])?.["type"] ?? context["actorType"];
|
|
247
|
+
return isTrackedActorType(fromContext) ? fromContext : void 0;
|
|
248
|
+
}
|
|
249
|
+
const ambient = getWorkspaceContext()?.actorType;
|
|
250
|
+
return isTrackedActorType(ambient) ? ambient : void 0;
|
|
251
|
+
}
|
|
252
|
+
function resolveOnBehalfOf(options) {
|
|
253
|
+
if (options.onBehalfOf) return options.onBehalfOf;
|
|
254
|
+
const fromContext = readRecord(options.context)?.["onBehalfOf"];
|
|
255
|
+
return typeof fromContext === "string" && fromContext.length > 0 ? fromContext : void 0;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Resolve the assistant session behind a tracked operation (BOFF-9649). Exported for unit tests.
|
|
259
|
+
*
|
|
260
|
+
* Precedence: the explicit `assistantSession` option, then `context.assistantSession`, then the
|
|
261
|
+
* workspace context bound to the operation's own async scope. The module-level fallback context is
|
|
262
|
+
* never read: it belongs to whichever request built its context last, and tagging a human's row
|
|
263
|
+
* as AI-originated (or the reverse) is worse than leaving it untagged.
|
|
264
|
+
*/
|
|
265
|
+
function resolveAssistantSession(options) {
|
|
266
|
+
if (options.assistantSession !== void 0) return readAssistantSessionAttribution(options.assistantSession);
|
|
267
|
+
const fromContext = readAssistantSessionAttribution(readRecord(options.context)?.["assistantSession"]);
|
|
268
|
+
if (fromContext) return fromContext;
|
|
269
|
+
return readAssistantSessionAttribution(getScopedWorkspaceContext()?.assistantSession);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Input fields an older activity owner may not define yet: wspace-activity-svc before BOFF-9684
|
|
273
|
+
* (`actorType`, `onBehalfOf`), global-activity-svc before BOFF-9649 (assistant-session fields).
|
|
274
|
+
*/
|
|
275
|
+
const ATTRIBUTION_FIELDS = [
|
|
276
|
+
"actorType",
|
|
277
|
+
"onBehalfOf",
|
|
278
|
+
"actorOrigin",
|
|
279
|
+
"assistantSessionId",
|
|
280
|
+
"assistantCorrelationId"
|
|
281
|
+
];
|
|
282
|
+
/**
|
|
283
|
+
* True when the activity owner rejected the write only because it predates the attribution
|
|
284
|
+
* fields (`Field "actorType" is not defined by type "RecordActivityInput"`).
|
|
285
|
+
*/
|
|
286
|
+
function isUnknownAttributionFieldRejection(detail) {
|
|
287
|
+
return ATTRIBUTION_FIELDS.some((field) => detail.includes(`"${field}"`) && /not defined|unknown field|is not defined by type/i.test(detail));
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Build the layer-appropriate `RecordActivityInput`.
|
|
291
|
+
*
|
|
292
|
+
* Exported for unit testing: the whole class of defect this guards against is a payload that is
|
|
293
|
+
* structurally plausible but rejected by the owning subgraph, which — because delivery is
|
|
294
|
+
* fire-and-forget — is invisible at runtime.
|
|
295
|
+
*/
|
|
296
|
+
function buildActivityInput(options, layer) {
|
|
297
|
+
const actOpts = options.activityOptions;
|
|
298
|
+
const action = actOpts?.activityType ?? options.action ?? options.operationName ?? "unknown";
|
|
299
|
+
const description = actOpts?.description ?? `${options.operationName ?? "operation"} executed`;
|
|
300
|
+
const resourceType = actOpts?.resourceType ?? options.resourceType;
|
|
301
|
+
const resourceId = actOpts?.resourceId ?? options.resourceId;
|
|
302
|
+
const workspaceId = actOpts?.workspaceId ?? options.workspaceId;
|
|
303
|
+
const metadata = {
|
|
304
|
+
...actOpts?.metadata,
|
|
305
|
+
success: options.success ?? true,
|
|
306
|
+
...options.operationName ? { operationName: options.operationName } : {},
|
|
307
|
+
...options.errorMessage ? { errorMessage: options.errorMessage } : {}
|
|
308
|
+
};
|
|
309
|
+
const assistantSession = layer === "global" ? resolveAssistantSession(options) : void 0;
|
|
310
|
+
const input = layer === "global" ? {
|
|
311
|
+
action,
|
|
312
|
+
resource: deriveResource(options),
|
|
313
|
+
description,
|
|
314
|
+
resourceType,
|
|
315
|
+
resourceId,
|
|
316
|
+
userId: options.userId,
|
|
317
|
+
actorId: options.userId,
|
|
318
|
+
tenantId: options.tenantId,
|
|
319
|
+
workspaceId,
|
|
320
|
+
metadata,
|
|
321
|
+
actorOrigin: assistantSession?.actorOrigin,
|
|
322
|
+
assistantSessionId: assistantSession?.assistantSessionId,
|
|
323
|
+
assistantCorrelationId: assistantSession?.assistantCorrelationId
|
|
324
|
+
} : {
|
|
325
|
+
action,
|
|
326
|
+
description,
|
|
327
|
+
resourceType,
|
|
328
|
+
resourceId,
|
|
329
|
+
workspaceId,
|
|
330
|
+
targetUserId: actOpts?.targetUserId,
|
|
331
|
+
teamId: actOpts?.teamId,
|
|
332
|
+
productId: options.productId,
|
|
333
|
+
success: options.success ?? true,
|
|
334
|
+
...options.errorMessage ? { errorMessage: options.errorMessage } : {},
|
|
335
|
+
metadata: {
|
|
336
|
+
...metadata,
|
|
337
|
+
userId: options.userId
|
|
338
|
+
},
|
|
339
|
+
actorType: resolveTrackedActorType(options),
|
|
340
|
+
onBehalfOf: resolveOnBehalfOf(options)
|
|
341
|
+
};
|
|
342
|
+
input["dedupeKey"] = actOpts?.dedupeKey ?? `sdk:${randomUUID()}`;
|
|
343
|
+
return input;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Delivery policy for activity writes.
|
|
347
|
+
*
|
|
348
|
+
* A single attempt silently lost audit records whenever the internal gateway or the activity
|
|
349
|
+
* subgraph was briefly unavailable (e.g. during a single-replica rolling deploy): the write timed
|
|
350
|
+
* out, was logged at warn level, and the attributed activity never existed. Writes now retry
|
|
351
|
+
* transient failures with backoff. Retrying is idempotent because every input carries a
|
|
352
|
+
* `dedupeKey` (see {@link buildActivityInput}).
|
|
353
|
+
*/
|
|
354
|
+
const ACTIVITY_ATTEMPT_TIMEOUT_MS = 5e3;
|
|
355
|
+
const DEFAULT_ACTIVITY_RETRY_DELAYS_MS = [
|
|
356
|
+
1e3,
|
|
357
|
+
3e3,
|
|
358
|
+
8e3
|
|
359
|
+
];
|
|
360
|
+
let activityRetryDelaysMs = DEFAULT_ACTIVITY_RETRY_DELAYS_MS;
|
|
361
|
+
/** HTTP statuses that mean "the request may not have been processed — try again". */
|
|
362
|
+
const RETRYABLE_HTTP_STATUSES = /* @__PURE__ */ new Set([
|
|
363
|
+
408,
|
|
364
|
+
425,
|
|
365
|
+
429,
|
|
366
|
+
500,
|
|
367
|
+
502,
|
|
368
|
+
503,
|
|
369
|
+
504
|
|
370
|
+
]);
|
|
371
|
+
/**
|
|
372
|
+
* GraphQL error codes that describe an unavailable dependency rather than a rejected payload.
|
|
373
|
+
* The internal gateways mask an unreachable subgraph as INTERNAL_SERVER_ERROR, and surface request
|
|
374
|
+
* validation failures as BAD_USER_INPUT (or with no code at all from graphql-js), so a payload the
|
|
375
|
+
* owner rejects is never retried.
|
|
376
|
+
*/
|
|
377
|
+
const RETRYABLE_GRAPHQL_CODES = /* @__PURE__ */ new Set([
|
|
378
|
+
"INTERNAL_SERVER_ERROR",
|
|
379
|
+
"SERVICE_UNAVAILABLE",
|
|
380
|
+
"AUTH_SERVICE_UNAVAILABLE",
|
|
381
|
+
"DOWNSTREAM_SERVICE_ERROR",
|
|
382
|
+
"GATEWAY_TIMEOUT"
|
|
383
|
+
]);
|
|
384
|
+
function classifyGraphQLErrors(errors) {
|
|
385
|
+
const detail = errors.map((e) => e?.message ?? "unknown error").join("; ").slice(0, 500);
|
|
386
|
+
return errors.every((e) => {
|
|
387
|
+
const code = e?.extensions?.code;
|
|
388
|
+
return typeof code === "string" && RETRYABLE_GRAPHQL_CODES.has(code);
|
|
389
|
+
}) ? {
|
|
390
|
+
kind: "transient",
|
|
391
|
+
detail
|
|
392
|
+
} : {
|
|
393
|
+
kind: "rejected",
|
|
394
|
+
detail
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
async function attemptActivityDelivery(gatewayUrl, headers, body) {
|
|
398
|
+
try {
|
|
399
|
+
const response = await fetch(gatewayUrl, {
|
|
400
|
+
method: "POST",
|
|
401
|
+
headers,
|
|
402
|
+
body,
|
|
403
|
+
signal: AbortSignal.timeout(ACTIVITY_ATTEMPT_TIMEOUT_MS)
|
|
404
|
+
});
|
|
405
|
+
if (!response.ok) {
|
|
406
|
+
const detail = `HTTP ${response.status}`;
|
|
407
|
+
return RETRYABLE_HTTP_STATUSES.has(response.status) ? {
|
|
408
|
+
kind: "transient",
|
|
409
|
+
detail
|
|
410
|
+
} : {
|
|
411
|
+
kind: "rejected",
|
|
412
|
+
detail
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
const errors = (await response.json().catch(() => void 0))?.errors;
|
|
416
|
+
if (errors && errors.length > 0) return classifyGraphQLErrors(errors);
|
|
417
|
+
return { kind: "delivered" };
|
|
418
|
+
} catch (err) {
|
|
419
|
+
return {
|
|
420
|
+
kind: "transient",
|
|
421
|
+
detail: err.message
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Fire-and-forget activity log via GraphQL, retrying transient failures.
|
|
427
|
+
* Never throws — logs errors and continues.
|
|
428
|
+
*/
|
|
429
|
+
async function fireActivityLog(gatewayUrl, options, layer) {
|
|
430
|
+
try {
|
|
431
|
+
const actOpts = options.activityOptions;
|
|
432
|
+
const input = buildActivityInput(options, layer);
|
|
433
|
+
for (const key of Object.keys(input)) if (input[key] === void 0) delete input[key];
|
|
434
|
+
const headers = { "Content-Type": "application/json" };
|
|
435
|
+
if (options.userId) {
|
|
436
|
+
headers["x-actor-id"] = options.userId;
|
|
437
|
+
headers["x-actor-type"] = "service";
|
|
438
|
+
}
|
|
439
|
+
if (options.workspaceId ?? actOpts?.workspaceId) headers["x-workspace-id"] = options.workspaceId ?? actOpts?.workspaceId;
|
|
440
|
+
const operation = options.operationName ?? "operation";
|
|
441
|
+
let body = JSON.stringify({
|
|
442
|
+
query: LOG_ACTIVITY_MUTATION,
|
|
443
|
+
variables: { input }
|
|
444
|
+
});
|
|
445
|
+
let attributionStripped = false;
|
|
446
|
+
const maxAttempts = activityRetryDelaysMs.length + 1;
|
|
447
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
|
|
448
|
+
const outcome = await attemptActivityDelivery(gatewayUrl, headers, body);
|
|
449
|
+
if (outcome.kind === "delivered") {
|
|
450
|
+
if (attempt > 1) logger.info(`[trackOperation] Activity log delivered on attempt ${attempt}: ${operation}`);
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
if (outcome.kind === "rejected" && !attributionStripped && ATTRIBUTION_FIELDS.some((field) => field in input) && isUnknownAttributionFieldRejection(outcome.detail)) {
|
|
454
|
+
attributionStripped = true;
|
|
455
|
+
const stripped = { ...input };
|
|
456
|
+
for (const field of ATTRIBUTION_FIELDS) delete stripped[field];
|
|
457
|
+
body = JSON.stringify({
|
|
458
|
+
query: LOG_ACTIVITY_MUTATION,
|
|
459
|
+
variables: { input: stripped }
|
|
460
|
+
});
|
|
461
|
+
logger.warn(`[trackOperation] ${layer}-activity subgraph does not accept the actor attribution fields yet; resending "${operation}" without them`);
|
|
462
|
+
attempt -= 1;
|
|
463
|
+
continue;
|
|
464
|
+
}
|
|
465
|
+
if (outcome.kind === "rejected") {
|
|
466
|
+
logger.error(`[trackOperation] Activity log REJECTED by ${layer}-activity subgraph for "${operation}": ${outcome.detail}`);
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
const delay = activityRetryDelaysMs[attempt - 1];
|
|
470
|
+
if (delay === void 0) {
|
|
471
|
+
logger.error(`[trackOperation] Activity log failed after ${attempt} attempts for "${operation}": ${outcome.detail}`);
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
logger.warn(`[trackOperation] Activity log attempt ${attempt} failed for "${operation}" (${outcome.detail}); retrying in ${delay}ms`);
|
|
475
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
476
|
+
}
|
|
477
|
+
} catch (err) {
|
|
478
|
+
logger.warn(`[trackOperation] Activity log failed: ${err.message}`);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Simple tracker class with auto-promoting behavior
|
|
483
|
+
*/
|
|
484
|
+
var UnifiedTrackerStub = class UnifiedTrackerStub {
|
|
485
|
+
static instance;
|
|
486
|
+
static getInstance() {
|
|
487
|
+
if (!UnifiedTrackerStub.instance) UnifiedTrackerStub.instance = new UnifiedTrackerStub();
|
|
488
|
+
return UnifiedTrackerStub.instance;
|
|
489
|
+
}
|
|
490
|
+
async track(event) {
|
|
491
|
+
markExplicitActivity();
|
|
492
|
+
const gatewayUrl = getGatewayUrl();
|
|
493
|
+
if (gatewayUrl) await fireActivityLog(gatewayUrl, {
|
|
494
|
+
operationName: event.eventType,
|
|
495
|
+
userId: event.userId,
|
|
496
|
+
workspaceId: event.workspaceId,
|
|
497
|
+
resourceType: event.entityType,
|
|
498
|
+
resourceId: event.entityId,
|
|
499
|
+
activityOptions: {
|
|
500
|
+
activityType: event.eventType,
|
|
501
|
+
metadata: event.metadata,
|
|
502
|
+
workspaceId: event.workspaceId,
|
|
503
|
+
resourceType: event.entityType,
|
|
504
|
+
resourceId: event.entityId,
|
|
505
|
+
enabled: true
|
|
506
|
+
}
|
|
507
|
+
}, getGatewayLayer());
|
|
508
|
+
else logger.debug("[UnifiedTracker:Stub]", event.eventType, event.entityType, event.entityId);
|
|
509
|
+
}
|
|
510
|
+
async trackBatch(events) {
|
|
511
|
+
for (const event of events) await this.track(event);
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
const trackerStub = UnifiedTrackerStub.getInstance();
|
|
515
|
+
/**
|
|
516
|
+
* Unified tracking function — auto-promoting
|
|
517
|
+
*
|
|
518
|
+
* When a gateway URL is configured (WSPACE_INT_GATEWAY_URL or GLOBAL_INT_GATEWAY_URL),
|
|
519
|
+
* this function makes real fire-and-forget GraphQL calls for activity logging.
|
|
520
|
+
* When no gateway URL is configured, it falls back to debug-level logging (stub mode).
|
|
521
|
+
*
|
|
522
|
+
* RBAC checks are NOT performed here — they are handled by gateway @rbac directives.
|
|
523
|
+
* The rbacCheck option is accepted for interface compatibility but not enforced.
|
|
524
|
+
*
|
|
525
|
+
* @param options - Tracking options
|
|
526
|
+
* @returns Always returns true (never blocks the calling operation)
|
|
527
|
+
*/
|
|
528
|
+
async function trackOperation(options) {
|
|
529
|
+
const { operationName, userId, success = true } = options;
|
|
530
|
+
const gatewayUrl = getGatewayUrl();
|
|
531
|
+
const activityEnabled = options.activityOptions?.enabled !== false;
|
|
532
|
+
if (activityEnabled) markExplicitActivity();
|
|
533
|
+
if (!gatewayUrl) {
|
|
534
|
+
logger.debug(`[trackOperation:Stub] ${operationName} for user ${userId} - success: ${success}`);
|
|
535
|
+
return true;
|
|
536
|
+
}
|
|
537
|
+
if (activityEnabled) fireActivityLog(gatewayUrl, options, getGatewayLayer());
|
|
538
|
+
else logger.debug(`[trackOperation] ${operationName} for user ${userId} - activity disabled, skipping`);
|
|
539
|
+
return true;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Create a product-scoped tracker (auto-promoting implementation)
|
|
543
|
+
*
|
|
544
|
+
* @param productId - Product identifier
|
|
545
|
+
* @param userId - User identifier
|
|
546
|
+
* @param billingAccountId - Optional billing account ID
|
|
547
|
+
* @param defaultContext - Optional default tracking context
|
|
548
|
+
* @returns Product tracker instance
|
|
549
|
+
*/
|
|
550
|
+
function createProductTracker(productId, userId, billingAccountId, defaultContext) {
|
|
551
|
+
return {
|
|
552
|
+
async track(operationName, additionalOptions) {
|
|
553
|
+
return trackOperation({
|
|
554
|
+
...defaultContext,
|
|
555
|
+
productId,
|
|
556
|
+
operationName,
|
|
557
|
+
userId,
|
|
558
|
+
...additionalOptions
|
|
559
|
+
});
|
|
560
|
+
},
|
|
561
|
+
async freeUp(operationName, additionalOptions) {
|
|
562
|
+
return trackOperation({
|
|
563
|
+
...defaultContext,
|
|
564
|
+
productId,
|
|
565
|
+
operationName,
|
|
566
|
+
userId,
|
|
567
|
+
...additionalOptions,
|
|
568
|
+
activityOptions: {
|
|
569
|
+
...defaultContext?.activityOptions,
|
|
570
|
+
...additionalOptions?.activityOptions,
|
|
571
|
+
activityType: "free_up"
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
},
|
|
575
|
+
async trackActivityOnly(operationName, additionalOptions) {
|
|
576
|
+
return trackOperation({
|
|
577
|
+
...defaultContext,
|
|
578
|
+
productId,
|
|
579
|
+
operationName,
|
|
580
|
+
userId,
|
|
581
|
+
...additionalOptions,
|
|
582
|
+
activityOptions: {
|
|
583
|
+
...defaultContext?.activityOptions,
|
|
584
|
+
...additionalOptions?.activityOptions,
|
|
585
|
+
enabled: true
|
|
586
|
+
},
|
|
587
|
+
usageOptions: { enabled: false }
|
|
588
|
+
});
|
|
589
|
+
},
|
|
590
|
+
async trackUsageOnly(operationName, additionalOptions) {
|
|
591
|
+
return trackOperation({
|
|
592
|
+
...defaultContext,
|
|
593
|
+
productId,
|
|
594
|
+
operationName,
|
|
595
|
+
userId,
|
|
596
|
+
...additionalOptions,
|
|
597
|
+
activityOptions: { enabled: false },
|
|
598
|
+
usageOptions: {
|
|
599
|
+
...defaultContext?.usageOptions,
|
|
600
|
+
...additionalOptions?.usageOptions,
|
|
601
|
+
enabled: true
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
},
|
|
605
|
+
async trackCustom(operationName, additionalOptions) {
|
|
606
|
+
return trackOperation({
|
|
607
|
+
...defaultContext,
|
|
608
|
+
productId,
|
|
609
|
+
operationName,
|
|
610
|
+
userId,
|
|
611
|
+
...additionalOptions
|
|
612
|
+
});
|
|
613
|
+
},
|
|
614
|
+
productId,
|
|
615
|
+
userId,
|
|
616
|
+
billingAccountId,
|
|
617
|
+
defaultContext
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Constants for tracking
|
|
622
|
+
*/
|
|
623
|
+
const UNIFIED_TRACKER_CONSTANTS = {
|
|
624
|
+
DEFAULT_PRODUCT_ID: "module",
|
|
625
|
+
OPERATIONS: {},
|
|
626
|
+
PRODUCTS: {}
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
export { runInExplicitActivityScope as _, resolveAssistantSession as a, ACTOR_ORIGIN_HEADER as c, ASSISTANT_SESSION_ID_HEADER as d, parseAssistantSessionHeaders as f, markExplicitActivity as g, createExplicitActivityScope as h, isTrackedActorType as i, AI_ASSISTANT_ACTOR_ORIGIN as l, toAssistantSessionAttribution as m, UnifiedTrackerStub as n, trackOperation as o, readAssistantSessionAttribution as p, createProductTracker as r, trackerStub as s, UNIFIED_TRACKER_CONSTANTS as t, ASSISTANT_CORRELATION_ID_HEADER as u, suppressMutationAudit as v };
|
|
630
|
+
//# sourceMappingURL=stub-BqwKn4eh.js.map
|