@burdenoff/be-sdk 2026.1110.2 → 2026.1110.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configs/eslint/index.js +1 -1
- package/configs/tsconfig/tsconfig.json +1 -1
- package/dist/EventQueueFactory-9NGZV9jl.js +1457 -0
- package/dist/EventQueueFactory-9NGZV9jl.js.map +1 -0
- package/dist/RedisStreamsConnection-CY8WySJy.js +283 -0
- package/dist/RedisStreamsConnection-CY8WySJy.js.map +1 -0
- package/dist/activity/index.d.ts +165 -0
- package/dist/activity/index.js +389 -0
- package/dist/activity/index.js.map +1 -0
- package/dist/ai-credits/index.d.ts +2 -3
- package/dist/ai-credits/index.js +3 -4
- package/dist/ai-credits/index.js.map +1 -1
- package/dist/ai-credits-xxfwGpHS.js +546 -0
- package/dist/ai-credits-xxfwGpHS.js.map +1 -0
- package/dist/{assistant-session-CJZhF4D6.d.ts → assistant-session-DA5ZKJOr.d.ts} +4 -5
- package/dist/auth/index.d.ts +2 -77
- package/dist/auth/index.js +3 -7
- package/dist/auth/index.js.map +1 -1
- package/dist/auth-C5ctwSLp.js +228 -0
- package/dist/auth-C5ctwSLp.js.map +1 -0
- package/dist/bootstrap/index.d.ts +74 -0
- package/dist/bootstrap/index.js +282 -0
- package/dist/bootstrap/index.js.map +1 -0
- package/dist/cache/index.d.ts +2 -3
- package/dist/cache/index.js +3 -7
- package/dist/cache/index.js.map +1 -1
- package/dist/cache-CU0uLwcS.js +1837 -0
- package/dist/cache-CU0uLwcS.js.map +1 -0
- package/dist/captcha/index.d.ts +2 -1
- package/dist/captcha/index.js +3 -3
- package/dist/captcha/index.js.map +1 -1
- package/dist/captcha-BT7yh1YS.js +77 -0
- package/dist/captcha-BT7yh1YS.js.map +1 -0
- package/dist/client/internal-client.d.ts +4 -7
- package/dist/client/internal-client.js +172 -4
- package/dist/client/internal-client.js.map +1 -1
- package/dist/client-BgAEvDC2.d.ts +86 -0
- package/dist/client-sAJTrb4i.js +565 -0
- package/dist/client-sAJTrb4i.js.map +1 -0
- package/dist/collector-endpoint-iyQYeI50.js +50 -0
- package/dist/collector-endpoint-iyQYeI50.js.map +1 -0
- package/dist/context/index.d.ts +35 -0
- package/dist/context/index.js +283 -0
- package/dist/context/index.js.map +1 -0
- package/dist/crypto/index.d.ts +2 -1
- package/dist/crypto/index.js +3 -3
- package/dist/crypto/index.js.map +1 -1
- package/dist/crypto-DO9fM0FO.js +145 -0
- package/dist/crypto-DO9fM0FO.js.map +1 -0
- package/dist/database/index.d.ts +104 -108
- package/dist/database/index.js +468 -6
- package/dist/database/index.js.map +1 -1
- package/dist/dataloader/index.d.ts +2 -1
- package/dist/dataloader/index.js +3 -3
- package/dist/dataloader/index.js.map +1 -1
- package/dist/dataloader-DwpT3YoS.js +294 -0
- package/dist/dataloader-DwpT3YoS.js.map +1 -0
- package/dist/deployed-environment-p_Tdl3sT.js +38 -0
- package/dist/deployed-environment-p_Tdl3sT.js.map +1 -0
- package/dist/dist-BGKdXVy3.js +1718 -0
- package/dist/dist-BGKdXVy3.js.map +1 -0
- package/dist/env-DdaoGjIt.js +74 -0
- package/dist/env-DdaoGjIt.js.map +1 -0
- package/dist/event-queue/index.d.ts +2 -7
- package/dist/event-queue/index.js +7 -9
- package/dist/event-queue/index.js.map +1 -1
- package/dist/event-queue-Cw-YJPY_.js +1384 -0
- package/dist/event-queue-Cw-YJPY_.js.map +1 -0
- package/dist/{explicit-activity-scope-CCoxVwAr.d.ts → explicit-activity-scope-D8VeGGpt.d.ts} +1 -2
- package/dist/explicit-activity-scope-DikJ7NAE.js +57 -0
- package/dist/explicit-activity-scope-DikJ7NAE.js.map +1 -0
- package/dist/export/index.d.ts +2 -2
- package/dist/export/index.js +3 -14
- package/dist/export/index.js.map +1 -1
- package/dist/export-DJXE3Osa.js +642 -0
- package/dist/export-DJXE3Osa.js.map +1 -0
- package/dist/feature-flags/index.d.ts +2 -10
- package/dist/feature-flags/index.js +3 -6
- package/dist/feature-flags/index.js.map +1 -1
- package/dist/feature-flags-CP1KRgwD.js +422 -0
- package/dist/feature-flags-CP1KRgwD.js.map +1 -0
- package/dist/files/index.d.ts +2 -3
- package/dist/files/index.js +3 -4
- package/dist/files/index.js.map +1 -1
- package/dist/files-h5U-D2AF.js +830 -0
- package/dist/files-h5U-D2AF.js.map +1 -0
- package/dist/gateway/index.d.ts +4 -6
- package/dist/gateway/index.js +7 -13
- package/dist/gateway/index.js.map +1 -1
- package/dist/gateway/security/index.d.ts +2 -2
- package/dist/gateway/security/index.js +3 -5
- package/dist/gateway/security/index.js.map +1 -1
- package/dist/gateway-ByVo-n37.js +50 -0
- package/dist/gateway-ByVo-n37.js.map +1 -0
- package/dist/graph/index.d.ts +3 -10
- package/dist/graph/index.js +4 -13
- package/dist/graph/index.js.map +1 -1
- package/dist/graph-CR7u4lpl.js +2152 -0
- package/dist/graph-CR7u4lpl.js.map +1 -0
- package/dist/graph-emitter-CdOXP7Tn.js +621 -0
- package/dist/graph-emitter-CdOXP7Tn.js.map +1 -0
- package/dist/graphql/index.d.ts +3 -2
- package/dist/graphql/index.js +4 -6
- package/dist/graphql/index.js.map +1 -1
- package/dist/graphql/services/index.d.ts +2 -24
- package/dist/graphql/services/index.js +3 -4
- package/dist/graphql/services/index.js.map +1 -1
- package/dist/graphql-CUDyhibV.d.ts +21 -0
- package/dist/graphql-DHAHHcww.js +161 -0
- package/dist/graphql-DHAHHcww.js.map +1 -0
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/index.js +3 -4
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n-BBMYFd0P.js +860 -0
- package/dist/i18n-BBMYFd0P.js.map +1 -0
- package/dist/import-optional-peer-B82VYxeX.js +18 -0
- package/dist/import-optional-peer-B82VYxeX.js.map +1 -0
- package/dist/index-3KOZ1zN9.d.ts +233 -0
- package/dist/index-ADmsX0BI.d.ts +646 -0
- package/dist/index-B2LCaK0R.d.ts +500 -0
- package/dist/index-BBqooJ52.d.ts +45 -0
- package/dist/index-BGzMYJsm.d.ts +209 -0
- package/dist/index-BMIMnp6T.d.ts +8 -0
- package/dist/index-BVOL7458.d.ts +10 -0
- package/dist/index-BcqQs-Uq.d.ts +69 -0
- package/dist/index-BeVtqGO-.d.ts +208 -0
- package/dist/index-BiTzGUZP.d.ts +114 -0
- package/dist/index-C0qLquY0.d.ts +150 -0
- package/dist/index-C5uEKchX.d.ts +60 -0
- package/dist/index-CDOqxSIi.d.ts +37 -0
- package/dist/index-CG6wj66Y.d.ts +148 -0
- package/dist/index-CHwMhK6v.d.ts +63 -0
- package/dist/index-CIgoeobA.d.ts +145 -0
- package/dist/index-CPQDMSFS.d.ts +103 -0
- package/dist/index-CSRcgkVi.d.ts +23 -0
- package/dist/index-CTTwo9av.d.ts +102 -0
- package/dist/index-CVCyKzhB.d.ts +207 -0
- package/dist/index-C_GXXF32.d.ts +704 -0
- package/dist/index-CaM9JUcc.d.ts +144 -0
- package/dist/index-CliOgq6L.d.ts +203 -0
- package/dist/index-Cot73bdh.d.ts +63 -0
- package/dist/index-DGgh9DWn.d.ts +59 -0
- package/dist/index-DY3dNhMN.d.ts +420 -0
- package/dist/index-DqbGqfAy.d.ts +127 -0
- package/dist/index-Dt1HJPTX.d.ts +12 -0
- package/dist/index-DtI6aBtB.d.ts +22 -0
- package/dist/index-FKohsiex.d.ts +38 -0
- package/dist/index-FRRaa6h2.d.ts +999 -0
- package/dist/index-FbXPfen7.d.ts +132 -0
- package/dist/index-MArCb8Aq.d.ts +306 -0
- package/dist/index-U_tu3zUl.d.ts +303 -0
- package/dist/index-YOShAwkq.d.ts +45 -0
- package/dist/index-cmR9k9ga.d.ts +26 -0
- package/dist/index-yBSjMY32.d.ts +24 -0
- package/dist/index-zd_NPGJo.d.ts +206 -0
- package/dist/index.d.ts +106 -609
- package/dist/index.js +769 -2590
- package/dist/index.js.map +1 -1
- package/dist/init/index.d.ts +2 -2
- package/dist/init/index.js +3 -16
- package/dist/init/index.js.map +1 -1
- package/dist/init-CQPFmOOe.js +325 -0
- package/dist/init-CQPFmOOe.js.map +1 -0
- package/dist/instrumentation/index.d.ts +3 -4
- package/dist/instrumentation/index.js +5 -5
- package/dist/instrumentation/index.js.map +1 -1
- package/dist/instrumentation-xkkmDgJ0.js +1678 -0
- package/dist/instrumentation-xkkmDgJ0.js.map +1 -0
- package/dist/lake/index.d.ts +50 -54
- package/dist/lake/index.js +169 -193
- package/dist/lake/index.js.map +1 -1
- package/dist/layer/index.d.ts +3 -2
- package/dist/layer/index.js +4 -5
- package/dist/layer/index.js.map +1 -1
- package/dist/layer-BZBZZWeV.d.ts +69 -0
- package/dist/layer-Bcix-WCl.js +105 -0
- package/dist/layer-Bcix-WCl.js.map +1 -0
- package/dist/layer-CEKy6cm8.js +252 -0
- package/dist/layer-CEKy6cm8.js.map +1 -0
- package/dist/lifecycle/index.d.ts +2 -1
- package/dist/lifecycle/index.js +3 -4
- package/dist/lifecycle/index.js.map +1 -1
- package/dist/lifecycle-DeoLSX0U.js +76 -0
- package/dist/lifecycle-DeoLSX0U.js.map +1 -0
- package/dist/logger/index.d.ts +2 -3
- package/dist/logger/index.js +3 -3
- package/dist/logger/index.js.map +1 -1
- package/dist/logger-B6rCpb7D.js +290 -0
- package/dist/logger-B6rCpb7D.js.map +1 -0
- package/dist/metrics/index.d.ts +13 -14
- package/dist/metrics/index.js +3 -4
- package/dist/metrics/index.js.map +1 -1
- package/dist/metrics-BrLwNUrb.js +52 -0
- package/dist/metrics-BrLwNUrb.js.map +1 -0
- package/dist/metrics-collector-C2eShrlW.js +922 -0
- package/dist/metrics-collector-C2eShrlW.js.map +1 -0
- package/dist/middleware/index.d.ts +3 -3
- package/dist/middleware/index.js +3 -4
- package/dist/middleware/index.js.map +1 -1
- package/dist/middleware-CUxJVUpD.js +1243 -0
- package/dist/middleware-CUxJVUpD.js.map +1 -0
- package/dist/middleware-Cq0zFMGp.js +253 -0
- package/dist/middleware-Cq0zFMGp.js.map +1 -0
- package/dist/notifications/index.d.ts +2 -5
- package/dist/notifications/index.js +3 -6
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications-DY_i37WN.js +869 -0
- package/dist/notifications-DY_i37WN.js.map +1 -0
- package/dist/observability/index.d.ts +2 -3
- package/dist/observability/index.js +3 -4
- package/dist/observability/index.js.map +1 -1
- package/dist/observability-DBDXipTU.js +272 -0
- package/dist/observability-DBDXipTU.js.map +1 -0
- package/dist/payments/index.d.ts +144 -0
- package/dist/payments/index.js +404 -0
- package/dist/payments/index.js.map +1 -0
- package/dist/platform/index.d.ts +2 -1
- package/dist/platform/index.js +3 -5
- package/dist/platform/index.js.map +1 -1
- package/dist/platform-DZwczW7v.js +1510 -0
- package/dist/platform-DZwczW7v.js.map +1 -0
- package/dist/prisma/generator/index.d.ts +1 -1
- package/dist/prisma/generator/index.js +97 -84
- package/dist/prisma/generator/index.js.map +1 -1
- package/dist/prisma/index.d.ts +4 -7
- package/dist/prisma/index.js +5 -12
- package/dist/prisma/index.js.map +1 -1
- package/dist/prisma-BzOOdt79.js +863 -0
- package/dist/prisma-BzOOdt79.js.map +1 -0
- package/dist/prisma-extension-Cfl09swM.d.ts +172 -0
- package/dist/product-alias/index.d.ts +2 -1
- package/dist/product-alias/index.js +3 -3
- package/dist/product-alias/index.js.map +1 -1
- package/dist/product-alias-BPqtskMq.js +273 -0
- package/dist/product-alias-BPqtskMq.js.map +1 -0
- package/dist/rate-limit-CBrK_U5H.js +142 -0
- package/dist/rate-limit-CBrK_U5H.js.map +1 -0
- package/dist/rbac/index.d.ts +2 -122
- package/dist/rbac/index.js +3 -6
- package/dist/rbac/index.js.map +1 -1
- package/dist/rbac-Dvz0YzEt.js +1486 -0
- package/dist/rbac-Dvz0YzEt.js.map +1 -0
- package/dist/resource-caps/index.d.ts +66 -72
- package/dist/resource-caps/index.js +430 -5
- package/dist/resource-caps/index.js.map +1 -1
- package/dist/rolldown-runtime-ad2WFvuA.js +17 -0
- package/dist/sdk-Dju9o-sq.js +124 -0
- package/dist/sdk-Dju9o-sq.js.map +1 -0
- package/dist/search/index.d.ts +112 -0
- package/dist/search/index.js +266 -0
- package/dist/search/index.js.map +1 -0
- package/dist/security/index.d.ts +2 -0
- package/dist/security/index.js +4 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/rate-limit/index.d.ts +2 -0
- package/dist/security/rate-limit/index.js +4 -0
- package/dist/security/rate-limit/index.js.map +1 -0
- package/dist/security-DIG-95Ic.js +1647 -0
- package/dist/security-DIG-95Ic.js.map +1 -0
- package/dist/server/index.d.ts +7 -164
- package/dist/server/index.js +2001 -1507
- package/dist/server/index.js.map +1 -1
- package/dist/service-jwt-Bu-WNA_-.js +80 -0
- package/dist/service-jwt-Bu-WNA_-.js.map +1 -0
- package/dist/services-BWzfz7vG.js +102 -0
- package/dist/services-BWzfz7vG.js.map +1 -0
- package/dist/sharding/index.d.ts +41 -44
- package/dist/sharding/index.js +156 -137
- package/dist/sharding/index.js.map +1 -1
- package/dist/sharing/index.d.ts +2 -1
- package/dist/sharing/index.js +3 -4
- package/dist/sharing/index.js.map +1 -1
- package/dist/sharing-CflDsSJ-.js +911 -0
- package/dist/sharing-CflDsSJ-.js.map +1 -0
- package/dist/stub-BUnfMiAS.js +577 -0
- package/dist/stub-BUnfMiAS.js.map +1 -0
- package/dist/tags/index.d.ts +2 -3
- package/dist/tags/index.js +3 -4
- package/dist/tags/index.js.map +1 -1
- package/dist/tags-CbijgoqR.js +868 -0
- package/dist/{chunk-PBZFAAOM.js.map → tags-CbijgoqR.js.map} +1 -1
- package/dist/telemetry/index.d.ts +64 -76
- package/dist/telemetry/index.js +369 -201
- package/dist/telemetry/index.js.map +1 -1
- package/dist/temporal/index.d.ts +2 -148
- package/dist/temporal/index.js +3 -5
- package/dist/temporal/index.js.map +1 -1
- package/dist/temporal-B534uYK8.js +706 -0
- package/dist/temporal-B534uYK8.js.map +1 -0
- package/dist/tracker/index.d.ts +5 -11
- package/dist/tracker/index.js +7 -20
- package/dist/tracker/index.js.map +1 -1
- package/dist/tracker-PQztSlhJ.js +458 -0
- package/dist/tracker-PQztSlhJ.js.map +1 -0
- package/dist/translation/index.d.ts +120 -0
- package/dist/translation/index.js +573 -0
- package/dist/translation/index.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +90 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types-BYMYND1L.js +44 -0
- package/dist/types-BYMYND1L.js.map +1 -0
- package/dist/types-C6EKaS3V.d.ts +106 -0
- package/dist/types-CWybW61E.d.ts +323 -0
- package/dist/types-C_yfu3XK.d.ts +34 -0
- package/dist/types-DgaQqvxo.d.ts +70 -0
- package/dist/usage/index.d.ts +2 -213
- package/dist/usage/index.js +3 -15
- package/dist/usage/index.js.map +1 -1
- package/dist/usage-BRqVP3CJ.js +682 -0
- package/dist/usage-BRqVP3CJ.js.map +1 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +3 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils-DL85Tnbn.js +500 -0
- package/dist/utils-DL85Tnbn.js.map +1 -0
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +3 -3
- package/dist/validation/index.js.map +1 -1
- package/dist/validation-CPUITdMk.js +762 -0
- package/dist/validation-CPUITdMk.js.map +1 -0
- package/dist/workspace-extension-COrC0dYi.js +979 -0
- package/dist/workspace-extension-COrC0dYi.js.map +1 -0
- package/dist/{workspace-extension-BGwTOV_r.d.ts → workspace-extension-DTFTdGVF.d.ts} +43 -45
- package/package.json +7 -10
- package/dist/EventQueueFactory-GXC3A7DH.js +0 -8
- package/dist/EventQueueFactory-GXC3A7DH.js.map +0 -1
- package/dist/chunk-4XIBXZ6J.js +0 -276
- package/dist/chunk-4XIBXZ6J.js.map +0 -1
- package/dist/chunk-554Z4C2K.js +0 -1006
- package/dist/chunk-554Z4C2K.js.map +0 -1
- package/dist/chunk-5CAFHK2Z.js +0 -107
- package/dist/chunk-5CAFHK2Z.js.map +0 -1
- package/dist/chunk-63ZXJ42X.js +0 -451
- package/dist/chunk-63ZXJ42X.js.map +0 -1
- package/dist/chunk-6XEXJATV.js +0 -304
- package/dist/chunk-6XEXJATV.js.map +0 -1
- package/dist/chunk-726AR6Q7.js +0 -1532
- package/dist/chunk-726AR6Q7.js.map +0 -1
- package/dist/chunk-A5F6Z5UE.js +0 -21
- package/dist/chunk-A5F6Z5UE.js.map +0 -1
- package/dist/chunk-A6DE32ZS.js +0 -1507
- package/dist/chunk-A6DE32ZS.js.map +0 -1
- package/dist/chunk-AXJDGQPE.js +0 -690
- package/dist/chunk-AXJDGQPE.js.map +0 -1
- package/dist/chunk-BJQOGOVW.js +0 -602
- package/dist/chunk-BJQOGOVW.js.map +0 -1
- package/dist/chunk-CFXWH2IS.js +0 -52
- package/dist/chunk-CFXWH2IS.js.map +0 -1
- package/dist/chunk-DRWH5XCJ.js +0 -876
- package/dist/chunk-DRWH5XCJ.js.map +0 -1
- package/dist/chunk-E4QNLVY4.js +0 -909
- package/dist/chunk-E4QNLVY4.js.map +0 -1
- package/dist/chunk-EBDHIL7V.js +0 -774
- package/dist/chunk-EBDHIL7V.js.map +0 -1
- package/dist/chunk-ELU7VL3E.js +0 -245
- package/dist/chunk-ELU7VL3E.js.map +0 -1
- package/dist/chunk-FZRODKIN.js +0 -31
- package/dist/chunk-FZRODKIN.js.map +0 -1
- package/dist/chunk-GCIB76AJ.js +0 -882
- package/dist/chunk-GCIB76AJ.js.map +0 -1
- package/dist/chunk-HC6MPUIH.js +0 -1571
- package/dist/chunk-HC6MPUIH.js.map +0 -1
- package/dist/chunk-HNMHPSAM.js +0 -272
- package/dist/chunk-HNMHPSAM.js.map +0 -1
- package/dist/chunk-HTLEGD3Q.js +0 -1480
- package/dist/chunk-HTLEGD3Q.js.map +0 -1
- package/dist/chunk-I3KOWRT3.js +0 -89
- package/dist/chunk-I3KOWRT3.js.map +0 -1
- package/dist/chunk-ID3WR4JS.js +0 -509
- package/dist/chunk-ID3WR4JS.js.map +0 -1
- package/dist/chunk-JS52ZHTK.js +0 -1346
- package/dist/chunk-JS52ZHTK.js.map +0 -1
- package/dist/chunk-JVMAQOA3.js +0 -521
- package/dist/chunk-JVMAQOA3.js.map +0 -1
- package/dist/chunk-KH4TRQCO.js +0 -1063
- package/dist/chunk-KH4TRQCO.js.map +0 -1
- package/dist/chunk-KJOSPVB2.js +0 -57
- package/dist/chunk-KJOSPVB2.js.map +0 -1
- package/dist/chunk-KO2ZXZ7W.js +0 -61
- package/dist/chunk-KO2ZXZ7W.js.map +0 -1
- package/dist/chunk-KS2HQCJR.js +0 -56
- package/dist/chunk-KS2HQCJR.js.map +0 -1
- package/dist/chunk-LA5KPWZ2.js +0 -413
- package/dist/chunk-LA5KPWZ2.js.map +0 -1
- package/dist/chunk-MESLAC5W.js +0 -574
- package/dist/chunk-MESLAC5W.js.map +0 -1
- package/dist/chunk-MWPYA2HD.js +0 -94
- package/dist/chunk-MWPYA2HD.js.map +0 -1
- package/dist/chunk-NUB5GQTU.js +0 -270
- package/dist/chunk-NUB5GQTU.js.map +0 -1
- package/dist/chunk-OBBCR6WY.js +0 -277
- package/dist/chunk-OBBCR6WY.js.map +0 -1
- package/dist/chunk-OQDSAOG3.js +0 -1908
- package/dist/chunk-OQDSAOG3.js.map +0 -1
- package/dist/chunk-OXNCBE7P.js +0 -971
- package/dist/chunk-OXNCBE7P.js.map +0 -1
- package/dist/chunk-PBZFAAOM.js +0 -941
- package/dist/chunk-PN6GIF3R.js +0 -1185
- package/dist/chunk-PN6GIF3R.js.map +0 -1
- package/dist/chunk-PYD44IHJ.js +0 -728
- package/dist/chunk-PYD44IHJ.js.map +0 -1
- package/dist/chunk-QVPIACWD.js +0 -679
- package/dist/chunk-QVPIACWD.js.map +0 -1
- package/dist/chunk-QWNNFE4P.js +0 -41
- package/dist/chunk-QWNNFE4P.js.map +0 -1
- package/dist/chunk-RU266375.js +0 -327
- package/dist/chunk-RU266375.js.map +0 -1
- package/dist/chunk-RYTSVGGA.js +0 -1624
- package/dist/chunk-RYTSVGGA.js.map +0 -1
- package/dist/chunk-RZOFS2BQ.js +0 -225
- package/dist/chunk-RZOFS2BQ.js.map +0 -1
- package/dist/chunk-SBS4S2PJ.js +0 -100
- package/dist/chunk-SBS4S2PJ.js.map +0 -1
- package/dist/chunk-SPRG6G6G.js +0 -530
- package/dist/chunk-SPRG6G6G.js.map +0 -1
- package/dist/chunk-STWFX5E2.js +0 -233
- package/dist/chunk-STWFX5E2.js.map +0 -1
- package/dist/chunk-UNASM5VJ.js +0 -419
- package/dist/chunk-UNASM5VJ.js.map +0 -1
- package/dist/chunk-VAT66FJA.js +0 -245
- package/dist/chunk-VAT66FJA.js.map +0 -1
- package/dist/chunk-VFCMR5GX.js +0 -49
- package/dist/chunk-VFCMR5GX.js.map +0 -1
- package/dist/chunk-VGAHZKNJ.js +0 -66
- package/dist/chunk-VGAHZKNJ.js.map +0 -1
- package/dist/chunk-VTJTAAXC.js +0 -627
- package/dist/chunk-VTJTAAXC.js.map +0 -1
- package/dist/chunk-VXVLKRU6.js +0 -758
- package/dist/chunk-VXVLKRU6.js.map +0 -1
- package/dist/chunk-WWUU5ETI.js +0 -163
- package/dist/chunk-WWUU5ETI.js.map +0 -1
- package/dist/chunk-XE4OXN2W.js +0 -10
- package/dist/chunk-XE4OXN2W.js.map +0 -1
- package/dist/chunk-XOJORS75.js +0 -1853
- package/dist/chunk-XOJORS75.js.map +0 -1
- package/dist/chunk-YMZEUTD2.js +0 -110
- package/dist/chunk-YMZEUTD2.js.map +0 -1
- package/dist/chunk-Z77BTSOK.js +0 -617
- package/dist/chunk-Z77BTSOK.js.map +0 -1
- package/dist/chunk-ZZK3WEDI.js +0 -181
- package/dist/chunk-ZZK3WEDI.js.map +0 -1
- package/dist/client-CCXpAZ2r.d.ts +0 -89
- package/dist/client-DSI_760t.d.ts +0 -36
- package/dist/client-JU6T3UPB.js +0 -11
- package/dist/client-JU6T3UPB.js.map +0 -1
- package/dist/dist-2X4Q7PJA.js +0 -1491
- package/dist/dist-2X4Q7PJA.js.map +0 -1
- package/dist/env-4UWSUS64.js +0 -4
- package/dist/env-4UWSUS64.js.map +0 -1
- package/dist/graph-emitter-r5TylDBm.d.ts +0 -47
- package/dist/graphql-CMHMQjvd.d.ts +0 -23
- package/dist/i18n-Qm2AkPC-.d.ts +0 -33
- package/dist/index--yvpa6ay.d.ts +0 -83
- package/dist/index-4gKQKZ2B.d.ts +0 -71
- package/dist/index-5x0XMKXN.d.ts +0 -149
- package/dist/index-B70b5mYS.d.ts +0 -33
- package/dist/index-B8KrxO4j.d.ts +0 -755
- package/dist/index-BOuDKnqD.d.ts +0 -201
- package/dist/index-BTMt4OjA.d.ts +0 -201
- package/dist/index-BejbszA7.d.ts +0 -39
- package/dist/index-BkeOYZye.d.ts +0 -198
- package/dist/index-BuAj5nXg.d.ts +0 -83
- package/dist/index-BvkVcW8I.d.ts +0 -349
- package/dist/index-CWmH_-RZ.d.ts +0 -247
- package/dist/index-CbgWNcus.d.ts +0 -258
- package/dist/index-CmfPeQza.d.ts +0 -166
- package/dist/index-CmpG-zak.d.ts +0 -607
- package/dist/index-CoMKgL-p.d.ts +0 -12
- package/dist/index-D8HGwglK.d.ts +0 -541
- package/dist/index-DCaVm66D.d.ts +0 -1101
- package/dist/index-DE2w7E0d.d.ts +0 -83
- package/dist/index-DSOpj8DI.d.ts +0 -17
- package/dist/index-DW9q22GH.d.ts +0 -75
- package/dist/index-DnjJ9CwI.d.ts +0 -347
- package/dist/index-DwMJZ8PP.d.ts +0 -317
- package/dist/index-PaojfSdd.d.ts +0 -71
- package/dist/index-aHtYvc3i.d.ts +0 -284
- package/dist/index-e_18DzAg.d.ts +0 -18
- package/dist/index-ffmipXSA.d.ts +0 -55
- package/dist/index-joONjwLt.d.ts +0 -33
- package/dist/index-kssw5ziY.d.ts +0 -250
- package/dist/index-lFffh5-G.d.ts +0 -125
- package/dist/index-pxYge_6k.d.ts +0 -79
- package/dist/layer-Cv9vSwBx.d.ts +0 -70
- package/dist/pino-logger-H4HPW5P6.js +0 -5
- package/dist/pino-logger-H4HPW5P6.js.map +0 -1
- package/dist/prisma-extension-gYhYriA0.d.ts +0 -174
- package/dist/sdk-L75WWUP3.js +0 -156
- package/dist/sdk-L75WWUP3.js.map +0 -1
- package/dist/shutdown-registry-CW9LryO8.d.ts +0 -10
- package/dist/types-Bo2wkjSP.d.ts +0 -35
- package/dist/types-DVpvrAhd.d.ts +0 -71
- package/dist/types-DgJ4lDYA.d.ts +0 -108
- package/dist/types-USOv09qy.d.ts +0 -327
- package/dist/workspace-guard-NXVYYBVJ.js +0 -5
- package/dist/workspace-guard-NXVYYBVJ.js.map +0 -1
package/dist/chunk-DRWH5XCJ.js
DELETED
|
@@ -1,876 +0,0 @@
|
|
|
1
|
-
import { markExplicitActivity, runInExplicitActivityScope, createExplicitActivityScope, trackOperation } from './chunk-JVMAQOA3.js';
|
|
2
|
-
import { UsageModule } from './chunk-QVPIACWD.js';
|
|
3
|
-
import { NotificationsModule, NotificationType2 } from './chunk-KH4TRQCO.js';
|
|
4
|
-
import { RBACModule } from './chunk-A6DE32ZS.js';
|
|
5
|
-
import { SDKError, ValidationError, PermissionDeniedError, QuotaExceededError } from './chunk-I3KOWRT3.js';
|
|
6
|
-
import { logger } from './chunk-RU266375.js';
|
|
7
|
-
import { __name } from './chunk-XE4OXN2W.js';
|
|
8
|
-
import { randomUUID } from 'crypto';
|
|
9
|
-
|
|
10
|
-
var ActivityType = /* @__PURE__ */ (function(ActivityType2) {
|
|
11
|
-
ActivityType2["CREATE"] = "create";
|
|
12
|
-
ActivityType2["READ"] = "read";
|
|
13
|
-
ActivityType2["UPDATE"] = "update";
|
|
14
|
-
ActivityType2["DELETE"] = "delete";
|
|
15
|
-
ActivityType2["LOGIN"] = "login";
|
|
16
|
-
ActivityType2["LOGOUT"] = "logout";
|
|
17
|
-
ActivityType2["EXPORT"] = "export";
|
|
18
|
-
ActivityType2["IMPORT"] = "import";
|
|
19
|
-
ActivityType2["SHARE"] = "share";
|
|
20
|
-
ActivityType2["DOWNLOAD"] = "download";
|
|
21
|
-
ActivityType2["UPLOAD"] = "upload";
|
|
22
|
-
ActivityType2["EXECUTE"] = "execute";
|
|
23
|
-
ActivityType2["APPROVE"] = "approve";
|
|
24
|
-
ActivityType2["REJECT"] = "reject";
|
|
25
|
-
ActivityType2["CUSTOM"] = "custom";
|
|
26
|
-
return ActivityType2;
|
|
27
|
-
})({});
|
|
28
|
-
var ActivityStatus = /* @__PURE__ */ (function(ActivityStatus2) {
|
|
29
|
-
ActivityStatus2["SUCCESS"] = "success";
|
|
30
|
-
ActivityStatus2["FAILURE"] = "failure";
|
|
31
|
-
ActivityStatus2["PENDING"] = "pending";
|
|
32
|
-
ActivityStatus2["WARNING"] = "warning";
|
|
33
|
-
return ActivityStatus2;
|
|
34
|
-
})({});
|
|
35
|
-
var ActivitySeverity = /* @__PURE__ */ (function(ActivitySeverity2) {
|
|
36
|
-
ActivitySeverity2["LOW"] = "low";
|
|
37
|
-
ActivitySeverity2["MEDIUM"] = "medium";
|
|
38
|
-
ActivitySeverity2["HIGH"] = "high";
|
|
39
|
-
ActivitySeverity2["CRITICAL"] = "critical";
|
|
40
|
-
return ActivitySeverity2;
|
|
41
|
-
})({});
|
|
42
|
-
var ActivityOperationUnsupportedError = class _ActivityOperationUnsupportedError extends SDKError {
|
|
43
|
-
static {
|
|
44
|
-
__name(this, "ActivityOperationUnsupportedError");
|
|
45
|
-
}
|
|
46
|
-
constructor(operation, guidance) {
|
|
47
|
-
super(`ActivityModule.${operation} is not supported by the workspace activity owner: ${guidance}`, "ACTIVITY_OPERATION_UNSUPPORTED", {
|
|
48
|
-
operation
|
|
49
|
-
});
|
|
50
|
-
this.name = "ActivityOperationUnsupportedError";
|
|
51
|
-
Object.setPrototypeOf(this, _ActivityOperationUnsupportedError.prototype);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
var ACTIVITY_LOG_SELECTION = `
|
|
55
|
-
id
|
|
56
|
-
userId
|
|
57
|
-
action
|
|
58
|
-
description
|
|
59
|
-
details
|
|
60
|
-
timestamp
|
|
61
|
-
productId
|
|
62
|
-
workspaceId
|
|
63
|
-
resourceType
|
|
64
|
-
resourceId
|
|
65
|
-
targetUserId
|
|
66
|
-
ipAddress
|
|
67
|
-
userAgent
|
|
68
|
-
actorType
|
|
69
|
-
onBehalfOf
|
|
70
|
-
context {
|
|
71
|
-
projectId
|
|
72
|
-
custom
|
|
73
|
-
}
|
|
74
|
-
`;
|
|
75
|
-
var RECORD_ACTIVITY_MUTATION = `
|
|
76
|
-
mutation RecordActivity($input: RecordActivityInput!) {
|
|
77
|
-
recordActivity(input: $input) {
|
|
78
|
-
${ACTIVITY_LOG_SELECTION}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
`;
|
|
82
|
-
var WORKSPACE_ACTIVITY_SLICE_QUERY = `
|
|
83
|
-
query GetWorkspaceActivitySlice($filter: ActivityLogFilter!) {
|
|
84
|
-
getWorkspaceActivitySlice(filter: $filter) {
|
|
85
|
-
${ACTIVITY_LOG_SELECTION}
|
|
86
|
-
}
|
|
87
|
-
activityCount(filter: $filter)
|
|
88
|
-
}
|
|
89
|
-
`;
|
|
90
|
-
var SDK_DETAIL_KEYS = [
|
|
91
|
-
"activityType",
|
|
92
|
-
"status",
|
|
93
|
-
"severity",
|
|
94
|
-
"duration",
|
|
95
|
-
"organizationId",
|
|
96
|
-
"projectId",
|
|
97
|
-
"requestIpAddress",
|
|
98
|
-
"requestUserAgent",
|
|
99
|
-
"errorMessage",
|
|
100
|
-
"ipAddress",
|
|
101
|
-
"userAgent"
|
|
102
|
-
];
|
|
103
|
-
function readRecord(value) {
|
|
104
|
-
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
105
|
-
}
|
|
106
|
-
__name(readRecord, "readRecord");
|
|
107
|
-
function readString(value) {
|
|
108
|
-
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
109
|
-
}
|
|
110
|
-
__name(readString, "readString");
|
|
111
|
-
function readEnum(values, value, fallback) {
|
|
112
|
-
const allowed = Object.values(values);
|
|
113
|
-
return typeof value === "string" && allowed.includes(value) ? value : fallback;
|
|
114
|
-
}
|
|
115
|
-
__name(readEnum, "readEnum");
|
|
116
|
-
function compact(input) {
|
|
117
|
-
return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== void 0));
|
|
118
|
-
}
|
|
119
|
-
__name(compact, "compact");
|
|
120
|
-
function buildRecordActivityInput(options, context = {}) {
|
|
121
|
-
const severity = options.severity ?? "low";
|
|
122
|
-
const metadata = compact({
|
|
123
|
-
...options.metadata,
|
|
124
|
-
activityType: options.activityType,
|
|
125
|
-
status: options.status,
|
|
126
|
-
severity,
|
|
127
|
-
duration: options.duration,
|
|
128
|
-
// The owner stores errorMessage in a column it does not expose on ActivityLog; keeping a
|
|
129
|
-
// copy in details is what lets a read return it.
|
|
130
|
-
errorMessage: options.errorMessage,
|
|
131
|
-
organizationId: options.organizationId,
|
|
132
|
-
projectId: options.projectId,
|
|
133
|
-
requestIpAddress: options.ipAddress,
|
|
134
|
-
requestUserAgent: options.userAgent
|
|
135
|
-
});
|
|
136
|
-
const activityContext = compact({
|
|
137
|
-
workspaceId: options.workspaceId,
|
|
138
|
-
userId: options.userId,
|
|
139
|
-
projectId: options.projectId,
|
|
140
|
-
custom: options.organizationId ? {
|
|
141
|
-
organizationId: options.organizationId
|
|
142
|
-
} : void 0
|
|
143
|
-
});
|
|
144
|
-
return compact({
|
|
145
|
-
action: options.action,
|
|
146
|
-
description: options.description,
|
|
147
|
-
resourceType: options.resourceType,
|
|
148
|
-
resourceId: options.resourceId,
|
|
149
|
-
workspaceId: options.workspaceId,
|
|
150
|
-
productId: options.productId ?? context.productId,
|
|
151
|
-
targetUserId: options.targetUserId,
|
|
152
|
-
teamId: options.teamId,
|
|
153
|
-
success: options.status !== "failure",
|
|
154
|
-
errorMessage: options.errorMessage,
|
|
155
|
-
actorType: options.actorType,
|
|
156
|
-
onBehalfOf: options.onBehalfOf,
|
|
157
|
-
context: activityContext,
|
|
158
|
-
metadata,
|
|
159
|
-
dedupeKey: options.dedupeKey ?? `sdk-activity:${randomUUID()}`
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
__name(buildRecordActivityInput, "buildRecordActivityInput");
|
|
163
|
-
function toActivity(record) {
|
|
164
|
-
const details = readRecord(record.details) ?? {};
|
|
165
|
-
const custom = readRecord(record.context?.custom);
|
|
166
|
-
const metadata = {};
|
|
167
|
-
for (const [key, value] of Object.entries(details)) {
|
|
168
|
-
if (!SDK_DETAIL_KEYS.includes(key)) metadata[key] = value;
|
|
169
|
-
}
|
|
170
|
-
const duration = details["duration"];
|
|
171
|
-
return {
|
|
172
|
-
id: record.id,
|
|
173
|
-
userId: record.userId,
|
|
174
|
-
activityType: readEnum(ActivityType, details["activityType"], "custom"),
|
|
175
|
-
resourceType: record.resourceType ?? "",
|
|
176
|
-
resourceId: record.resourceId ?? void 0,
|
|
177
|
-
action: record.action,
|
|
178
|
-
status: readEnum(ActivityStatus, details["status"], "success"),
|
|
179
|
-
workspaceId: record.workspaceId ?? void 0,
|
|
180
|
-
organizationId: readString(details["organizationId"]) ?? readString(custom?.["organizationId"]),
|
|
181
|
-
projectId: record.context?.projectId ?? readString(details["projectId"]),
|
|
182
|
-
productId: record.productId ?? void 0,
|
|
183
|
-
description: record.description ?? void 0,
|
|
184
|
-
targetUserId: record.targetUserId ?? void 0,
|
|
185
|
-
actorType: record.actorType ?? void 0,
|
|
186
|
-
onBehalfOf: record.onBehalfOf ?? void 0,
|
|
187
|
-
ipAddress: readString(details["requestIpAddress"]) ?? record.ipAddress ?? void 0,
|
|
188
|
-
userAgent: readString(details["requestUserAgent"]) ?? record.userAgent ?? void 0,
|
|
189
|
-
metadata,
|
|
190
|
-
severity: readEnum(ActivitySeverity, details["severity"], "low"),
|
|
191
|
-
errorMessage: readString(details["errorMessage"]),
|
|
192
|
-
duration: typeof duration === "number" && Number.isFinite(duration) ? duration : void 0,
|
|
193
|
-
createdAt: record.timestamp
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
__name(toActivity, "toActivity");
|
|
197
|
-
function buildActivityLogFilter(options) {
|
|
198
|
-
if (!options.workspaceId) {
|
|
199
|
-
throw new ValidationError("workspaceId is required to read activities");
|
|
200
|
-
}
|
|
201
|
-
const unsupported = [
|
|
202
|
-
"organizationId",
|
|
203
|
-
"projectId",
|
|
204
|
-
"activityType",
|
|
205
|
-
"status",
|
|
206
|
-
"severity",
|
|
207
|
-
"search"
|
|
208
|
-
].filter((key) => options[key] !== void 0);
|
|
209
|
-
if (options.sortBy !== void 0 && options.sortBy !== "createdAt") unsupported.push("sortBy");
|
|
210
|
-
if (options.sortOrder !== void 0 && options.sortOrder !== "desc") unsupported.push("sortOrder");
|
|
211
|
-
if (unsupported.length > 0) {
|
|
212
|
-
throw new ValidationError(`Activity filters not supported by the workspace activity owner: ${unsupported.join(", ")}`, {
|
|
213
|
-
unsupported
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
return compact({
|
|
217
|
-
workspaceId: options.workspaceId,
|
|
218
|
-
userId: options.userId,
|
|
219
|
-
action: options.action,
|
|
220
|
-
resourceType: options.resourceType,
|
|
221
|
-
resourceId: options.resourceId,
|
|
222
|
-
targetUserId: options.targetUserId,
|
|
223
|
-
startDate: options.startDate,
|
|
224
|
-
endDate: options.endDate,
|
|
225
|
-
limit: options.limit ?? 50,
|
|
226
|
-
offset: options.offset ?? 0
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
__name(buildActivityLogFilter, "buildActivityLogFilter");
|
|
230
|
-
var ActivityModule = class {
|
|
231
|
-
static {
|
|
232
|
-
__name(this, "ActivityModule");
|
|
233
|
-
}
|
|
234
|
-
client;
|
|
235
|
-
context;
|
|
236
|
-
constructor(client, context) {
|
|
237
|
-
this.client = client;
|
|
238
|
-
this.context = context;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Log activity
|
|
242
|
-
*
|
|
243
|
-
* The write is relayed as a platform service acting for `userId`, the same identity
|
|
244
|
-
* transport `trackOperation` uses, so the owner records the end user as the actor and
|
|
245
|
-
* honours `actorType`/`onBehalfOf` from the input.
|
|
246
|
-
*/
|
|
247
|
-
async log(options) {
|
|
248
|
-
if (!options.userId) {
|
|
249
|
-
throw new ValidationError("User ID is required");
|
|
250
|
-
}
|
|
251
|
-
if (!options.activityType) {
|
|
252
|
-
throw new ValidationError("Activity type is required");
|
|
253
|
-
}
|
|
254
|
-
if (!options.resourceType) {
|
|
255
|
-
throw new ValidationError("Resource type is required");
|
|
256
|
-
}
|
|
257
|
-
if (!options.action) {
|
|
258
|
-
throw new ValidationError("Action is required");
|
|
259
|
-
}
|
|
260
|
-
if (!options.status) {
|
|
261
|
-
throw new ValidationError("Status is required");
|
|
262
|
-
}
|
|
263
|
-
markExplicitActivity();
|
|
264
|
-
logger.debug("[Activity] Logging activity", {
|
|
265
|
-
userId: options.userId,
|
|
266
|
-
action: options.action,
|
|
267
|
-
resourceType: options.resourceType
|
|
268
|
-
});
|
|
269
|
-
const input = buildRecordActivityInput(options, this.context);
|
|
270
|
-
const requestContext = {
|
|
271
|
-
...this.context,
|
|
272
|
-
actorId: options.userId,
|
|
273
|
-
actorType: "service",
|
|
274
|
-
workspaceId: options.workspaceId ?? this.context.workspaceId
|
|
275
|
-
};
|
|
276
|
-
const response = await this.client.query(RECORD_ACTIVITY_MUTATION, {
|
|
277
|
-
input
|
|
278
|
-
}, requestContext);
|
|
279
|
-
const activity = toActivity(response.recordActivity);
|
|
280
|
-
logger.info("[Activity] Activity logged", {
|
|
281
|
-
activityId: activity.id
|
|
282
|
-
});
|
|
283
|
-
return activity;
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Log activity with automatic status detection
|
|
287
|
-
*/
|
|
288
|
-
async logSuccess(userId, action, resourceType, resourceId, metadata) {
|
|
289
|
-
return this.log({
|
|
290
|
-
userId,
|
|
291
|
-
action,
|
|
292
|
-
resourceType,
|
|
293
|
-
resourceId,
|
|
294
|
-
activityType: this.inferActivityType(action),
|
|
295
|
-
status: "success",
|
|
296
|
-
severity: "low",
|
|
297
|
-
metadata,
|
|
298
|
-
workspaceId: this.context.workspaceId
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* Log failed activity
|
|
303
|
-
*/
|
|
304
|
-
async logFailure(userId, action, resourceType, errorMessage, resourceId, metadata) {
|
|
305
|
-
return this.log({
|
|
306
|
-
userId,
|
|
307
|
-
action,
|
|
308
|
-
resourceType,
|
|
309
|
-
resourceId,
|
|
310
|
-
activityType: this.inferActivityType(action),
|
|
311
|
-
status: "failure",
|
|
312
|
-
severity: "high",
|
|
313
|
-
errorMessage,
|
|
314
|
-
metadata,
|
|
315
|
-
workspaceId: this.context.workspaceId
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* Get one workspace's activities, newest first.
|
|
320
|
-
*
|
|
321
|
-
* Reads the owner's workspace-scoped slice (`getWorkspaceActivitySlice`) together with the
|
|
322
|
-
* matching `activityCount`, so `total` counts every row the filter matches, not just the page.
|
|
323
|
-
*/
|
|
324
|
-
async getActivities(options) {
|
|
325
|
-
logger.debug("[Activity] Getting activities", options);
|
|
326
|
-
const filter = buildActivityLogFilter(options);
|
|
327
|
-
const requestContext = {
|
|
328
|
-
...this.context,
|
|
329
|
-
workspaceId: options.workspaceId
|
|
330
|
-
};
|
|
331
|
-
const response = await this.client.query(WORKSPACE_ACTIVITY_SLICE_QUERY, {
|
|
332
|
-
filter
|
|
333
|
-
}, requestContext);
|
|
334
|
-
return {
|
|
335
|
-
activities: response.getWorkspaceActivitySlice.map(toActivity),
|
|
336
|
-
total: response.activityCount
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
* @deprecated The workspace activity owner has no read-by-id operation. Use
|
|
341
|
-
* {@link getActivities} with `resourceId`/`action` filters instead.
|
|
342
|
-
*/
|
|
343
|
-
async getActivity(_activityId) {
|
|
344
|
-
throw new ActivityOperationUnsupportedError("getActivity", "use getActivities with a workspace filter");
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* @deprecated The workspace activity owner has no statistics operation. Use
|
|
348
|
-
* {@link getActivities} (its `total` is the owner's `activityCount`) per filter instead.
|
|
349
|
-
*/
|
|
350
|
-
async getStats(_options) {
|
|
351
|
-
throw new ActivityOperationUnsupportedError("getStats", "use getActivities and its total per filter");
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* @deprecated Retention is enforced by the activity owner's retention policy and legal holds;
|
|
355
|
-
* there is no client-driven cleanup operation.
|
|
356
|
-
*/
|
|
357
|
-
async cleanup(_olderThanDays, _workspaceId) {
|
|
358
|
-
throw new ActivityOperationUnsupportedError("cleanup", "retention is enforced by the activity owner");
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
* @deprecated The workspace activity owner exports through `exportActivityLogsSiem`
|
|
362
|
-
* (CEF/LEEF/JSON lines); there is no CSV export operation.
|
|
363
|
-
*/
|
|
364
|
-
async exportToCSV(_options) {
|
|
365
|
-
throw new ActivityOperationUnsupportedError("exportToCSV", "use the owner exportActivityLogsSiem query");
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* Infer activity type from action string
|
|
369
|
-
*/
|
|
370
|
-
inferActivityType(action) {
|
|
371
|
-
const actionLower = action.toLowerCase();
|
|
372
|
-
if (actionLower.includes("create") || actionLower.includes("add")) {
|
|
373
|
-
return "create";
|
|
374
|
-
}
|
|
375
|
-
if (actionLower.includes("update") || actionLower.includes("edit") || actionLower.includes("modify")) {
|
|
376
|
-
return "update";
|
|
377
|
-
}
|
|
378
|
-
if (actionLower.includes("delete") || actionLower.includes("remove")) {
|
|
379
|
-
return "delete";
|
|
380
|
-
}
|
|
381
|
-
if (actionLower.includes("read") || actionLower.includes("view") || actionLower.includes("get")) {
|
|
382
|
-
return "read";
|
|
383
|
-
}
|
|
384
|
-
if (actionLower.includes("login") || actionLower.includes("signin")) {
|
|
385
|
-
return "login";
|
|
386
|
-
}
|
|
387
|
-
if (actionLower.includes("logout") || actionLower.includes("signout")) {
|
|
388
|
-
return "logout";
|
|
389
|
-
}
|
|
390
|
-
if (actionLower.includes("export")) {
|
|
391
|
-
return "export";
|
|
392
|
-
}
|
|
393
|
-
if (actionLower.includes("import")) {
|
|
394
|
-
return "import";
|
|
395
|
-
}
|
|
396
|
-
if (actionLower.includes("share")) {
|
|
397
|
-
return "share";
|
|
398
|
-
}
|
|
399
|
-
if (actionLower.includes("download")) {
|
|
400
|
-
return "download";
|
|
401
|
-
}
|
|
402
|
-
if (actionLower.includes("upload")) {
|
|
403
|
-
return "upload";
|
|
404
|
-
}
|
|
405
|
-
if (actionLower.includes("execute") || actionLower.includes("run")) {
|
|
406
|
-
return "execute";
|
|
407
|
-
}
|
|
408
|
-
if (actionLower.includes("approve")) {
|
|
409
|
-
return "approve";
|
|
410
|
-
}
|
|
411
|
-
if (actionLower.includes("reject")) {
|
|
412
|
-
return "reject";
|
|
413
|
-
}
|
|
414
|
-
return "custom";
|
|
415
|
-
}
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
// src/tracker/agent-activity.ts
|
|
419
|
-
var AGENT_ACTIVITY_ACTIONS = Object.freeze({
|
|
420
|
-
/** An agent run (one turn) finished and produced a response. */
|
|
421
|
-
RUN_COMPLETED: "agent.run.completed",
|
|
422
|
-
/** An agent run failed before producing a response. */
|
|
423
|
-
RUN_FAILED: "agent.run.failed",
|
|
424
|
-
/** The agent called a tool (MCP or similar). `success: false` when the call failed. */
|
|
425
|
-
TOOL_CALLED: "agent.tool.called",
|
|
426
|
-
/** The agent delegated a sub-task to another agent. */
|
|
427
|
-
DELEGATION_SENT: "agent.delegation.sent",
|
|
428
|
-
/** A governance policy refused something the agent run attempted (input, output, tool, model, budget, rate). */
|
|
429
|
-
POLICY_BLOCKED: "agent.policy.blocked"
|
|
430
|
-
});
|
|
431
|
-
var AGENT_ACTIVITY_RESOURCE_TYPE = "agent";
|
|
432
|
-
var FAILURE_ACTIONS = /* @__PURE__ */ new Set([
|
|
433
|
-
AGENT_ACTIVITY_ACTIONS.RUN_FAILED,
|
|
434
|
-
AGENT_ACTIVITY_ACTIONS.POLICY_BLOCKED
|
|
435
|
-
]);
|
|
436
|
-
function trackAgentActivity(options) {
|
|
437
|
-
const success = options.success ?? !FAILURE_ACTIONS.has(options.action);
|
|
438
|
-
return runInExplicitActivityScope(createExplicitActivityScope(), () => trackOperation({
|
|
439
|
-
operationName: options.action,
|
|
440
|
-
userId: options.agentId,
|
|
441
|
-
actorType: "app",
|
|
442
|
-
...options.onBehalfOf ? {
|
|
443
|
-
onBehalfOf: options.onBehalfOf
|
|
444
|
-
} : {},
|
|
445
|
-
workspaceId: options.workspaceId,
|
|
446
|
-
...options.productId ? {
|
|
447
|
-
productId: options.productId
|
|
448
|
-
} : {},
|
|
449
|
-
success,
|
|
450
|
-
...options.errorMessage ? {
|
|
451
|
-
errorMessage: options.errorMessage
|
|
452
|
-
} : {},
|
|
453
|
-
activityOptions: {
|
|
454
|
-
enabled: true,
|
|
455
|
-
activityType: options.action,
|
|
456
|
-
description: options.description ?? `Agent ${options.agentId}: ${options.action}`,
|
|
457
|
-
workspaceId: options.workspaceId,
|
|
458
|
-
resourceType: options.resourceType ?? AGENT_ACTIVITY_RESOURCE_TYPE,
|
|
459
|
-
resourceId: options.resourceId ?? options.agentId,
|
|
460
|
-
metadata: {
|
|
461
|
-
...options.metadata,
|
|
462
|
-
agentId: options.agentId
|
|
463
|
-
},
|
|
464
|
-
...options.dedupeKey ? {
|
|
465
|
-
dedupeKey: options.dedupeKey
|
|
466
|
-
} : {}
|
|
467
|
-
}
|
|
468
|
-
}));
|
|
469
|
-
}
|
|
470
|
-
__name(trackAgentActivity, "trackAgentActivity");
|
|
471
|
-
|
|
472
|
-
// src/tracker/index.ts
|
|
473
|
-
var TrackerModule = class {
|
|
474
|
-
static {
|
|
475
|
-
__name(this, "TrackerModule");
|
|
476
|
-
}
|
|
477
|
-
context;
|
|
478
|
-
rbac;
|
|
479
|
-
activity;
|
|
480
|
-
usage;
|
|
481
|
-
notifications;
|
|
482
|
-
constructor(client, context = {}) {
|
|
483
|
-
this.context = context;
|
|
484
|
-
this.rbac = new RBACModule(client, context);
|
|
485
|
-
this.activity = new ActivityModule(client, context);
|
|
486
|
-
this.usage = new UsageModule(client, context);
|
|
487
|
-
this.notifications = new NotificationsModule(client, context);
|
|
488
|
-
}
|
|
489
|
-
/**
|
|
490
|
-
* Track operation with RBAC, Activity, Usage, and Notifications
|
|
491
|
-
* This is the primary method products should use
|
|
492
|
-
*/
|
|
493
|
-
async track(options) {
|
|
494
|
-
const startTime = Date.now();
|
|
495
|
-
const result = {
|
|
496
|
-
success: false,
|
|
497
|
-
permissionGranted: false,
|
|
498
|
-
duration: 0
|
|
499
|
-
};
|
|
500
|
-
try {
|
|
501
|
-
this.validateOptions(options);
|
|
502
|
-
if (options.rbac?.enabled !== false) {
|
|
503
|
-
await this.checkPermission(options, result);
|
|
504
|
-
if (!result.permissionGranted) {
|
|
505
|
-
result.duration = Date.now() - startTime;
|
|
506
|
-
await this.logFailedActivity(options, result, startTime);
|
|
507
|
-
return result;
|
|
508
|
-
}
|
|
509
|
-
} else {
|
|
510
|
-
result.permissionGranted = true;
|
|
511
|
-
}
|
|
512
|
-
const usage = this.resolveUsage(options);
|
|
513
|
-
if (usage) {
|
|
514
|
-
let quotaAssignmentId;
|
|
515
|
-
if (usage.checkQuota) {
|
|
516
|
-
quotaAssignmentId = await this.checkQuota(options, usage, result);
|
|
517
|
-
if (result.quotaAvailable === false) {
|
|
518
|
-
result.duration = Date.now() - startTime;
|
|
519
|
-
await this.logFailedActivity(options, result, startTime);
|
|
520
|
-
return result;
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
await this.trackUsage(options, usage, quotaAssignmentId, result);
|
|
524
|
-
}
|
|
525
|
-
if (options.activity?.enabled !== false) {
|
|
526
|
-
await this.logSuccessActivity(options, result, startTime);
|
|
527
|
-
}
|
|
528
|
-
if (options.notification?.onSuccess) {
|
|
529
|
-
await this.sendSuccessNotification(options, result);
|
|
530
|
-
}
|
|
531
|
-
result.success = true;
|
|
532
|
-
result.duration = Date.now() - startTime;
|
|
533
|
-
logger.info("[Tracker] Operation tracked successfully", {
|
|
534
|
-
action: options.action,
|
|
535
|
-
duration: result.duration
|
|
536
|
-
});
|
|
537
|
-
return result;
|
|
538
|
-
} catch (error) {
|
|
539
|
-
result.duration = Date.now() - startTime;
|
|
540
|
-
result.success = false;
|
|
541
|
-
if (error instanceof PermissionDeniedError) {
|
|
542
|
-
result.error = {
|
|
543
|
-
type: "permission",
|
|
544
|
-
message: error.message,
|
|
545
|
-
details: error.details
|
|
546
|
-
};
|
|
547
|
-
} else if (error instanceof QuotaExceededError) {
|
|
548
|
-
result.error = {
|
|
549
|
-
type: "quota",
|
|
550
|
-
message: error.message,
|
|
551
|
-
details: error.details
|
|
552
|
-
};
|
|
553
|
-
} else if (error instanceof ValidationError) {
|
|
554
|
-
result.error = {
|
|
555
|
-
type: "validation",
|
|
556
|
-
message: error.message,
|
|
557
|
-
details: error.details
|
|
558
|
-
};
|
|
559
|
-
} else {
|
|
560
|
-
result.error = {
|
|
561
|
-
type: "unknown",
|
|
562
|
-
message: error instanceof Error ? error.message : "Unknown error"
|
|
563
|
-
};
|
|
564
|
-
}
|
|
565
|
-
await this.logFailedActivity(options, result, startTime);
|
|
566
|
-
if (options.notification?.onFailure) {
|
|
567
|
-
await this.sendFailureNotification(options, result);
|
|
568
|
-
}
|
|
569
|
-
logger.error("[Tracker] Operation tracking failed", {
|
|
570
|
-
action: options.action,
|
|
571
|
-
error: result.error,
|
|
572
|
-
duration: result.duration
|
|
573
|
-
});
|
|
574
|
-
return result;
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
/**
|
|
578
|
-
* Track operation and throw on failure
|
|
579
|
-
* Convenience method that throws errors instead of returning them in result
|
|
580
|
-
*/
|
|
581
|
-
async trackOrThrow(options) {
|
|
582
|
-
const result = await this.track(options);
|
|
583
|
-
if (!result.success && result.error) {
|
|
584
|
-
const errorMessage = result.error.message;
|
|
585
|
-
const errorDetails = result.error.details;
|
|
586
|
-
switch (result.error.type) {
|
|
587
|
-
case "permission":
|
|
588
|
-
throw new PermissionDeniedError(errorMessage, errorDetails);
|
|
589
|
-
case "quota":
|
|
590
|
-
throw new QuotaExceededError(errorMessage, errorDetails);
|
|
591
|
-
case "validation":
|
|
592
|
-
throw new ValidationError(errorMessage, errorDetails);
|
|
593
|
-
default:
|
|
594
|
-
throw new Error(errorMessage);
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
return result;
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
|
-
* Simplified track method for common operations.
|
|
601
|
-
* The trailing metric type is accepted for source compatibility and is not metered.
|
|
602
|
-
*/
|
|
603
|
-
async trackSimple(userId, action, resourceType, resourceId, _metricType) {
|
|
604
|
-
const result = await this.track({
|
|
605
|
-
userId,
|
|
606
|
-
action,
|
|
607
|
-
resourceType,
|
|
608
|
-
resourceId,
|
|
609
|
-
workspaceId: this.context.workspaceId,
|
|
610
|
-
usage: {
|
|
611
|
-
enabled: false
|
|
612
|
-
}
|
|
613
|
-
});
|
|
614
|
-
return result.success;
|
|
615
|
-
}
|
|
616
|
-
/**
|
|
617
|
-
* Validate tracking options
|
|
618
|
-
*/
|
|
619
|
-
validateOptions(options) {
|
|
620
|
-
if (!options.userId) {
|
|
621
|
-
throw new ValidationError("User ID is required");
|
|
622
|
-
}
|
|
623
|
-
if (!options.action) {
|
|
624
|
-
throw new ValidationError("Action is required");
|
|
625
|
-
}
|
|
626
|
-
if (!options.resourceType) {
|
|
627
|
-
throw new ValidationError("Resource type is required");
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
/**
|
|
631
|
-
* Check RBAC permission
|
|
632
|
-
*/
|
|
633
|
-
async checkPermission(options, result) {
|
|
634
|
-
const permissionOptions = {
|
|
635
|
-
userId: options.userId,
|
|
636
|
-
action: options.rbac?.permissionAction || options.action,
|
|
637
|
-
resourceType: options.resourceType,
|
|
638
|
-
resourceId: options.resourceId,
|
|
639
|
-
workspaceId: options.workspaceId
|
|
640
|
-
};
|
|
641
|
-
const hasPermission = await this.rbac.checkPermission(permissionOptions);
|
|
642
|
-
result.permissionGranted = hasPermission;
|
|
643
|
-
if (!hasPermission) {
|
|
644
|
-
result.error = {
|
|
645
|
-
type: "permission",
|
|
646
|
-
message: "Permission denied",
|
|
647
|
-
details: permissionOptions
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
/**
|
|
652
|
-
* Resolve the usage step for an operation, or null when nothing is metered: usage is
|
|
653
|
-
* disabled, or no workspace quota is named (a legacy `metricType` alone has no owner
|
|
654
|
-
* quota to charge).
|
|
655
|
-
*/
|
|
656
|
-
resolveUsage(options) {
|
|
657
|
-
const usage = options.usage;
|
|
658
|
-
if (!usage || usage.enabled === false) {
|
|
659
|
-
return null;
|
|
660
|
-
}
|
|
661
|
-
const quotaName = usage.quotaName?.trim();
|
|
662
|
-
if (!quotaName) {
|
|
663
|
-
if (usage.metricType) {
|
|
664
|
-
logger.debug("[Tracker] Usage step skipped: no quotaName for legacy metricType", {
|
|
665
|
-
action: options.action,
|
|
666
|
-
metricType: usage.metricType
|
|
667
|
-
});
|
|
668
|
-
}
|
|
669
|
-
return null;
|
|
670
|
-
}
|
|
671
|
-
const amount = usage.amount ?? 1;
|
|
672
|
-
if (typeof amount !== "number" || !Number.isFinite(amount) || amount === 0) {
|
|
673
|
-
throw new ValidationError("Usage amount must be a finite, non-zero number");
|
|
674
|
-
}
|
|
675
|
-
const workspaceId = options.workspaceId ?? this.context.workspaceId;
|
|
676
|
-
if (!workspaceId) {
|
|
677
|
-
throw new ValidationError("Workspace ID is required to track workspace quota usage");
|
|
678
|
-
}
|
|
679
|
-
return {
|
|
680
|
-
quotaName,
|
|
681
|
-
amount,
|
|
682
|
-
workspaceId,
|
|
683
|
-
// Only consumption is gated; a release (negative amount) must always go through.
|
|
684
|
-
checkQuota: usage.checkQuota !== false && amount > 0
|
|
685
|
-
};
|
|
686
|
-
}
|
|
687
|
-
/**
|
|
688
|
-
* Check workspace quota capacity. Returns the assignment to charge when one exists.
|
|
689
|
-
*/
|
|
690
|
-
async checkQuota(options, usage, result) {
|
|
691
|
-
const quotaCheck = await this.usage.checkWorkspaceQuota({
|
|
692
|
-
quotaName: usage.quotaName,
|
|
693
|
-
amount: usage.amount,
|
|
694
|
-
workspaceId: usage.workspaceId,
|
|
695
|
-
userId: options.userId
|
|
696
|
-
});
|
|
697
|
-
result.quotaAvailable = quotaCheck.allowed;
|
|
698
|
-
result.quotaRemaining = quotaCheck.limitLeft ?? void 0;
|
|
699
|
-
if (!quotaCheck.allowed) {
|
|
700
|
-
const notProvisioned = quotaCheck.assignmentId === null;
|
|
701
|
-
result.error = {
|
|
702
|
-
type: "quota",
|
|
703
|
-
message: notProvisioned ? `Quota ${usage.quotaName} is not included in this workspace's plan` : "Quota exceeded",
|
|
704
|
-
details: {
|
|
705
|
-
quotaName: usage.quotaName,
|
|
706
|
-
requestedAmount: usage.amount,
|
|
707
|
-
limitLeft: quotaCheck.limitLeft,
|
|
708
|
-
notProvisioned
|
|
709
|
-
}
|
|
710
|
-
};
|
|
711
|
-
}
|
|
712
|
-
return quotaCheck.assignmentId ?? void 0;
|
|
713
|
-
}
|
|
714
|
-
/**
|
|
715
|
-
* Record workspace quota usage with the owner.
|
|
716
|
-
*/
|
|
717
|
-
async trackUsage(options, usage, quotaAssignmentId, result) {
|
|
718
|
-
result.usageTracked = await this.usage.trackUsage({
|
|
719
|
-
quotaName: usage.quotaName,
|
|
720
|
-
productId: options.usage?.productId,
|
|
721
|
-
amount: usage.amount,
|
|
722
|
-
description: options.usage?.description?.trim() || `${options.action} ${options.resourceType}`,
|
|
723
|
-
workspaceId: usage.workspaceId,
|
|
724
|
-
userId: options.userId,
|
|
725
|
-
quotaAssignmentId,
|
|
726
|
-
metadata: {
|
|
727
|
-
action: options.action,
|
|
728
|
-
resourceType: options.resourceType,
|
|
729
|
-
...options.resourceId ? {
|
|
730
|
-
resourceId: options.resourceId
|
|
731
|
-
} : {}
|
|
732
|
-
}
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
/**
|
|
736
|
-
* Log successful activity
|
|
737
|
-
*/
|
|
738
|
-
async logSuccessActivity(options, result, startTime) {
|
|
739
|
-
const activityRecord = await this.activity.log({
|
|
740
|
-
userId: options.userId,
|
|
741
|
-
activityType: options.activity?.activityType || this.inferActivityType(options.action),
|
|
742
|
-
resourceType: options.resourceType,
|
|
743
|
-
resourceId: options.resourceId,
|
|
744
|
-
action: options.action,
|
|
745
|
-
status: ActivityStatus.SUCCESS,
|
|
746
|
-
workspaceId: options.workspaceId,
|
|
747
|
-
organizationId: options.organizationId,
|
|
748
|
-
projectId: options.projectId,
|
|
749
|
-
ipAddress: options.activity?.ipAddress,
|
|
750
|
-
userAgent: options.activity?.userAgent,
|
|
751
|
-
metadata: options.activity?.metadata,
|
|
752
|
-
severity: options.activity?.severity || ActivitySeverity.LOW,
|
|
753
|
-
duration: Date.now() - startTime
|
|
754
|
-
});
|
|
755
|
-
result.activityId = activityRecord.id;
|
|
756
|
-
}
|
|
757
|
-
/**
|
|
758
|
-
* Log failed activity
|
|
759
|
-
*/
|
|
760
|
-
async logFailedActivity(options, result, startTime) {
|
|
761
|
-
if (options.activity?.enabled === false) {
|
|
762
|
-
return;
|
|
763
|
-
}
|
|
764
|
-
try {
|
|
765
|
-
const activityRecord = await this.activity.log({
|
|
766
|
-
userId: options.userId,
|
|
767
|
-
activityType: options.activity?.activityType || this.inferActivityType(options.action),
|
|
768
|
-
resourceType: options.resourceType,
|
|
769
|
-
resourceId: options.resourceId,
|
|
770
|
-
action: options.action,
|
|
771
|
-
status: ActivityStatus.FAILURE,
|
|
772
|
-
workspaceId: options.workspaceId,
|
|
773
|
-
organizationId: options.organizationId,
|
|
774
|
-
projectId: options.projectId,
|
|
775
|
-
ipAddress: options.activity?.ipAddress,
|
|
776
|
-
userAgent: options.activity?.userAgent,
|
|
777
|
-
metadata: options.activity?.metadata,
|
|
778
|
-
severity: ActivitySeverity.HIGH,
|
|
779
|
-
errorMessage: result.error?.message,
|
|
780
|
-
duration: Date.now() - startTime
|
|
781
|
-
});
|
|
782
|
-
result.activityId = activityRecord.id;
|
|
783
|
-
} catch (error) {
|
|
784
|
-
logger.error("[Tracker] Failed to log activity", {
|
|
785
|
-
error
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
/**
|
|
790
|
-
* Send success notification
|
|
791
|
-
*/
|
|
792
|
-
async sendSuccessNotification(options, result) {
|
|
793
|
-
if (!options.notification?.onSuccess) {
|
|
794
|
-
return;
|
|
795
|
-
}
|
|
796
|
-
try {
|
|
797
|
-
const userIds = [
|
|
798
|
-
options.userId,
|
|
799
|
-
...options.notification.onSuccess.additionalUserIds || []
|
|
800
|
-
];
|
|
801
|
-
const response = await this.notifications.send({
|
|
802
|
-
title: options.notification.onSuccess.title,
|
|
803
|
-
message: options.notification.onSuccess.message,
|
|
804
|
-
type: options.notification.onSuccess.type || NotificationType2.SUCCESS,
|
|
805
|
-
userIds
|
|
806
|
-
});
|
|
807
|
-
result.notificationIds = response.notificationIds;
|
|
808
|
-
} catch (error) {
|
|
809
|
-
logger.error("[Tracker] Failed to send success notification", {
|
|
810
|
-
error
|
|
811
|
-
});
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
/**
|
|
815
|
-
* Send failure notification
|
|
816
|
-
*/
|
|
817
|
-
async sendFailureNotification(options, result) {
|
|
818
|
-
if (!options.notification?.onFailure) {
|
|
819
|
-
return;
|
|
820
|
-
}
|
|
821
|
-
try {
|
|
822
|
-
const userIds = [
|
|
823
|
-
options.userId,
|
|
824
|
-
...options.notification.onFailure.additionalUserIds || []
|
|
825
|
-
];
|
|
826
|
-
const response = await this.notifications.send({
|
|
827
|
-
title: options.notification.onFailure.title,
|
|
828
|
-
message: options.notification.onFailure.message,
|
|
829
|
-
type: options.notification.onFailure.type || NotificationType2.ERROR,
|
|
830
|
-
userIds
|
|
831
|
-
});
|
|
832
|
-
result.notificationIds = response.notificationIds;
|
|
833
|
-
} catch (error) {
|
|
834
|
-
logger.error("[Tracker] Failed to send failure notification", {
|
|
835
|
-
error
|
|
836
|
-
});
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
/**
|
|
840
|
-
* Infer activity type from action
|
|
841
|
-
*/
|
|
842
|
-
inferActivityType(action) {
|
|
843
|
-
const actionLower = action.toLowerCase();
|
|
844
|
-
if (actionLower.includes("create") || actionLower.includes("add")) return ActivityType.CREATE;
|
|
845
|
-
if (actionLower.includes("update") || actionLower.includes("edit")) return ActivityType.UPDATE;
|
|
846
|
-
if (actionLower.includes("delete") || actionLower.includes("remove")) return ActivityType.DELETE;
|
|
847
|
-
if (actionLower.includes("read") || actionLower.includes("view")) return ActivityType.READ;
|
|
848
|
-
if (actionLower.includes("login")) return ActivityType.LOGIN;
|
|
849
|
-
if (actionLower.includes("logout")) return ActivityType.LOGOUT;
|
|
850
|
-
if (actionLower.includes("export")) return ActivityType.EXPORT;
|
|
851
|
-
if (actionLower.includes("import")) return ActivityType.IMPORT;
|
|
852
|
-
if (actionLower.includes("share")) return ActivityType.SHARE;
|
|
853
|
-
if (actionLower.includes("download")) return ActivityType.DOWNLOAD;
|
|
854
|
-
if (actionLower.includes("upload")) return ActivityType.UPLOAD;
|
|
855
|
-
return ActivityType.CUSTOM;
|
|
856
|
-
}
|
|
857
|
-
/**
|
|
858
|
-
* Batch track multiple operations
|
|
859
|
-
*/
|
|
860
|
-
async trackBatch(operations) {
|
|
861
|
-
logger.debug("[Tracker] Batch tracking operations", {
|
|
862
|
-
count: operations.length
|
|
863
|
-
});
|
|
864
|
-
const results = await Promise.all(operations.map((op) => this.track(op)));
|
|
865
|
-
logger.info("[Tracker] Batch tracking completed", {
|
|
866
|
-
total: results.length,
|
|
867
|
-
successful: results.filter((r) => r.success).length,
|
|
868
|
-
failed: results.filter((r) => !r.success).length
|
|
869
|
-
});
|
|
870
|
-
return results;
|
|
871
|
-
}
|
|
872
|
-
};
|
|
873
|
-
|
|
874
|
-
export { AGENT_ACTIVITY_ACTIONS, AGENT_ACTIVITY_RESOURCE_TYPE, ActivityModule, ActivityOperationUnsupportedError, TrackerModule, trackAgentActivity };
|
|
875
|
-
//# sourceMappingURL=chunk-DRWH5XCJ.js.map
|
|
876
|
-
//# sourceMappingURL=chunk-DRWH5XCJ.js.map
|