@burdenoff/be-sdk 2026.1027.1 → 2026.1027.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.
Files changed (116) hide show
  1. package/dist/EventQueueFactory-CWHCJP34.js +8 -0
  2. package/dist/{EventQueueFactory-JG7S6HOL.js.map → EventQueueFactory-CWHCJP34.js.map} +1 -1
  3. package/dist/ai-credits/index.d.ts +3 -3
  4. package/dist/ai-credits/index.js +1 -1
  5. package/dist/auth/index.d.ts +3 -3
  6. package/dist/auth/index.js +1 -1
  7. package/dist/cache/index.d.ts +2 -2
  8. package/dist/cache/index.js +2 -2
  9. package/dist/{chunk-YFOHAHZE.js → chunk-5CAFHK2Z.js} +2 -2
  10. package/dist/{chunk-YFOHAHZE.js.map → chunk-5CAFHK2Z.js.map} +1 -1
  11. package/dist/{chunk-JV7XNJP4.js → chunk-5M77HKFT.js} +21 -9
  12. package/dist/chunk-5M77HKFT.js.map +1 -0
  13. package/dist/{chunk-QUF27D73.js → chunk-5RBIDJBZ.js} +3 -3
  14. package/dist/{chunk-QUF27D73.js.map → chunk-5RBIDJBZ.js.map} +1 -1
  15. package/dist/{chunk-V3N6HDFE.js → chunk-6XZ4ELHR.js} +4 -4
  16. package/dist/{chunk-V3N6HDFE.js.map → chunk-6XZ4ELHR.js.map} +1 -1
  17. package/dist/{chunk-PPFJTSHA.js → chunk-E36LPO3K.js} +5 -5
  18. package/dist/{chunk-PPFJTSHA.js.map → chunk-E36LPO3K.js.map} +1 -1
  19. package/dist/{chunk-LKCBI6B2.js → chunk-ENEDTQET.js} +2 -2
  20. package/dist/{chunk-LKCBI6B2.js.map → chunk-ENEDTQET.js.map} +1 -1
  21. package/dist/{chunk-6HO5AJ3U.js → chunk-FYFA7WAS.js} +3 -3
  22. package/dist/{chunk-6HO5AJ3U.js.map → chunk-FYFA7WAS.js.map} +1 -1
  23. package/dist/{chunk-HZTDMERF.js → chunk-GKOAAC6D.js} +3 -3
  24. package/dist/{chunk-HZTDMERF.js.map → chunk-GKOAAC6D.js.map} +1 -1
  25. package/dist/{chunk-IZZ45AGA.js → chunk-K52ICDCP.js} +3 -3
  26. package/dist/{chunk-IZZ45AGA.js.map → chunk-K52ICDCP.js.map} +1 -1
  27. package/dist/{chunk-GP766LND.js → chunk-NBN52AEM.js} +2 -2
  28. package/dist/{chunk-GP766LND.js.map → chunk-NBN52AEM.js.map} +1 -1
  29. package/dist/{chunk-KMNSVLDS.js → chunk-NGAGKLAM.js} +3 -3
  30. package/dist/{chunk-KMNSVLDS.js.map → chunk-NGAGKLAM.js.map} +1 -1
  31. package/dist/{chunk-OXGIVASV.js → chunk-PAQK3YF2.js} +3 -3
  32. package/dist/{chunk-OXGIVASV.js.map → chunk-PAQK3YF2.js.map} +1 -1
  33. package/dist/{chunk-X3MNBBOL.js → chunk-PNWFTWBQ.js} +3 -3
  34. package/dist/{chunk-X3MNBBOL.js.map → chunk-PNWFTWBQ.js.map} +1 -1
  35. package/dist/{chunk-5JNHVKHG.js → chunk-PQGMZH6K.js} +3 -3
  36. package/dist/{chunk-5JNHVKHG.js.map → chunk-PQGMZH6K.js.map} +1 -1
  37. package/dist/{chunk-UCNTCCV6.js → chunk-QGADOWSG.js} +4 -4
  38. package/dist/{chunk-UCNTCCV6.js.map → chunk-QGADOWSG.js.map} +1 -1
  39. package/dist/chunk-RM6AIMZT.js +51 -0
  40. package/dist/chunk-RM6AIMZT.js.map +1 -0
  41. package/dist/{chunk-DNULGVN3.js → chunk-SIAOIYHW.js} +472 -88
  42. package/dist/chunk-SIAOIYHW.js.map +1 -0
  43. package/dist/{chunk-5NT2OEDQ.js → chunk-STWFX5E2.js} +3 -3
  44. package/dist/{chunk-5NT2OEDQ.js.map → chunk-STWFX5E2.js.map} +1 -1
  45. package/dist/{chunk-HEAQSZBX.js → chunk-TX2GDIWP.js} +41 -28
  46. package/dist/chunk-TX2GDIWP.js.map +1 -0
  47. package/dist/{chunk-OPUC6PYJ.js → chunk-V3GSTCVC.js} +4 -4
  48. package/dist/{chunk-OPUC6PYJ.js.map → chunk-V3GSTCVC.js.map} +1 -1
  49. package/dist/{chunk-YNDJQRI3.js → chunk-VXVLKRU6.js} +3 -3
  50. package/dist/{chunk-YNDJQRI3.js.map → chunk-VXVLKRU6.js.map} +1 -1
  51. package/dist/{chunk-Y2ZUUZNU.js → chunk-YCPVIFDN.js} +5 -5
  52. package/dist/{chunk-Y2ZUUZNU.js.map → chunk-YCPVIFDN.js.map} +1 -1
  53. package/dist/{client-WSFUJHLI.js → client-7DW6EYSA.js} +5 -5
  54. package/dist/{client-WSFUJHLI.js.map → client-7DW6EYSA.js.map} +1 -1
  55. package/dist/database/index.js +1 -1
  56. package/dist/event-queue/index.d.ts +4 -4
  57. package/dist/event-queue/index.js +4 -4
  58. package/dist/export/index.d.ts +2 -2
  59. package/dist/export/index.js +6 -6
  60. package/dist/files/index.d.ts +3 -3
  61. package/dist/files/index.js +1 -1
  62. package/dist/gateway/index.d.ts +3 -3
  63. package/dist/gateway/index.js +5 -5
  64. package/dist/gateway/security/index.js +1 -1
  65. package/dist/graph/index.d.ts +4 -4
  66. package/dist/graph/index.js +7 -7
  67. package/dist/graphql/index.js +2 -2
  68. package/dist/{graphql-AaLJfGzz.d.ts → graphql-BUbw43Zx.d.ts} +1 -1
  69. package/dist/{index-DG5lCWNk.d.ts → index-3ZE1m-ZJ.d.ts} +2 -2
  70. package/dist/{index-B0ebYV9W.d.ts → index-5x0XMKXN.d.ts} +1 -1
  71. package/dist/{index-DMlr5R6K.d.ts → index-BKOBmdq7.d.ts} +2 -2
  72. package/dist/{index-Cx5I3ydM.d.ts → index-BvkVcW8I.d.ts} +1 -1
  73. package/dist/{index-CVX5nRuw.d.ts → index-C135w4ur.d.ts} +3 -3
  74. package/dist/{index-CfRZtB99.d.ts → index-CV3r9Taj.d.ts} +1 -1
  75. package/dist/{index-B4ciT3OZ.d.ts → index-CWmH_-RZ.d.ts} +1 -1
  76. package/dist/{index-CN4RA1PN.d.ts → index-CbgWNcus.d.ts} +1 -1
  77. package/dist/{index-Dvv6irk0.d.ts → index-Coua7_P7.d.ts} +1 -1
  78. package/dist/{index-BWhuZl8f.d.ts → index-Dcq8OduH.d.ts} +14 -4
  79. package/dist/{index-HxigeZFh.d.ts → index-DieBtd0X.d.ts} +1 -1
  80. package/dist/{index-BKafOO7G.d.ts → index-Dtj9Eer3.d.ts} +1 -1
  81. package/dist/{index-BVXRewdr.d.ts → index-JTx7ZQHe.d.ts} +32 -3
  82. package/dist/{index-C_t30VyQ.d.ts → index-aHtYvc3i.d.ts} +1 -1
  83. package/dist/{index-BCUkR8sC.d.ts → index-ffmipXSA.d.ts} +1 -1
  84. package/dist/index.d.ts +23 -23
  85. package/dist/index.js +32 -32
  86. package/dist/init/index.d.ts +2 -2
  87. package/dist/init/index.js +6 -6
  88. package/dist/instrumentation/index.d.ts +4 -4
  89. package/dist/layer/index.d.ts +2 -2
  90. package/dist/layer/index.js +2 -2
  91. package/dist/{layer-GNAVXBMf.d.ts → layer-Cv9vSwBx.d.ts} +1 -0
  92. package/dist/logger/index.d.ts +3 -3
  93. package/dist/notifications/index.d.ts +4 -4
  94. package/dist/notifications/index.js +1 -1
  95. package/dist/prisma/index.js +6 -6
  96. package/dist/rbac/index.d.ts +3 -3
  97. package/dist/rbac/index.js +2 -2
  98. package/dist/resource-caps/index.d.ts +3 -3
  99. package/dist/server/index.d.ts +19 -3
  100. package/dist/server/index.js +28 -20
  101. package/dist/server/index.js.map +1 -1
  102. package/dist/tags/index.d.ts +3 -3
  103. package/dist/tags/index.js +1 -1
  104. package/dist/telemetry/index.d.ts +5 -5
  105. package/dist/temporal/index.d.ts +1 -1
  106. package/dist/temporal/index.js +2 -2
  107. package/dist/tracker/index.d.ts +5 -5
  108. package/dist/tracker/index.js +4 -4
  109. package/dist/{types-B376RbyK.d.ts → types-DgJ4lDYA.d.ts} +1 -1
  110. package/package.json +1 -1
  111. package/dist/EventQueueFactory-JG7S6HOL.js +0 -8
  112. package/dist/chunk-DNULGVN3.js.map +0 -1
  113. package/dist/chunk-HEAQSZBX.js.map +0 -1
  114. package/dist/chunk-JV7XNJP4.js.map +0 -1
  115. package/dist/chunk-KGJ7LPE7.js +0 -22
  116. package/dist/chunk-KGJ7LPE7.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { W as WorkspaceSecret, I as IActor, J as JWTPayload, S as ServerDefinition, a as ServerInstance, R as RESTEndpoint, b as ITenant, G as GraphQLContext, Y as YogaPlugin } from '../types-C-6m9NoG.js';
2
- export { A as ActorProvenance, C as ConsentContext, E as ElysiaApp, c as IContextFilterInput, d as IOperationContext, e as IOrganization, f as IProduct, g as IProject, h as ITracking, i as IWorkspace, M as ModuleGraphConfig, P as PrismaClientConstructor, j as ServerConfig, k as ServerI18nConfig, l as ServerInfo, V as VerifiedDelegationContext, m as WspaceGraphQLContext } from '../types-C-6m9NoG.js';
1
+ import { W as WorkspaceSecret, I as IActor, J as JWTPayload, S as ServerDefinition, a as ServerInstance, R as RESTEndpoint, b as ITenant, G as GraphQLContext, V as VerifiedDelegationContext, Y as YogaPlugin } from '../types-C-6m9NoG.js';
2
+ export { A as ActorProvenance, C as ConsentContext, E as ElysiaApp, c as IContextFilterInput, d as IOperationContext, e as IOrganization, f as IProduct, g as IProject, h as ITracking, i as IWorkspace, M as ModuleGraphConfig, P as PrismaClientConstructor, j as ServerConfig, k as ServerI18nConfig, l as ServerInfo, m as WspaceGraphQLContext } from '../types-C-6m9NoG.js';
3
3
  import * as jose from 'jose';
4
4
  import { VerifyOptions } from 'jsonwebtoken';
5
5
  import { I as I18n } from '../i18n-DrdPTann.js';
@@ -90,6 +90,22 @@ declare function configureContext(options: ContextBuilderOptions): void;
90
90
  declare function buildContext(request: Request): Promise<GraphQLContext>;
91
91
  declare function getContextOptions(): ContextBuilderOptions | null;
92
92
 
93
+ declare function resolveOnBehalfOf(actor: IActor | null, verifiedDelegation: VerifiedDelegationContext | undefined): string | undefined;
94
+ interface DelegatedPrincipal {
95
+ agentAppId: string;
96
+ onBehalfOfUserId: string;
97
+ delegationId: string;
98
+ scopes: readonly string[];
99
+ allowedWorkspaceIds: readonly string[];
100
+ grantedBy: string | null;
101
+ grantExpiresAt: Date | null;
102
+ tokenExpiresAt: Date;
103
+ }
104
+ declare function getDelegatedPrincipal(context: {
105
+ actor: IActor | null;
106
+ verifiedDelegation?: VerifiedDelegationContext;
107
+ }): DelegatedPrincipal | null;
108
+
93
109
  interface WorkspaceGuardConfig {
94
110
  enabled?: boolean;
95
111
  whitelistedOperations?: string[];
@@ -214,4 +230,4 @@ declare function createHumanReadableErrorPlugin(options?: ErrorNormalizationOpti
214
230
  declare function formatHttpError(error: unknown, options?: ErrorNormalizationOptions): HttpErrorResult;
215
231
  declare function createHttpErrorResponse(error: unknown, options?: ErrorNormalizationOptions): Response;
216
232
 
217
- export { type AuthConfig, type ContextBuilderOptions, type ErrorNormalizationOptions, type FetchWorkspaceSecretFn, GraphQLContext, type HttpErrorPayload, type HttpErrorResult, IActor, ITenant, JWTPayload, MAX_IDLE_TIMEOUT_SECONDS, MUTATION_AUDIT_ACTIVITY_TYPE, MUTATION_AUDIT_RESOURCE_TYPE, type MutationAuditPluginOptions, type NormalizedErrorState, type OrdinaryRoute, RESTEndpoint, type RawBodyResolution, type RawBodyRouter, ServerDefinition, ServerInstance, type UserFacingErrorOptions, UserFacingGraphQLError, type WorkspaceGuardConfig, WorkspaceSecret, YogaPlugin, authCheck, buildContext, configureAuth, configureContext, configureDefaultAuth, configureServerAuth, createHttpErrorResponse, createHumanReadableErrorPlugin, createMutationAuditPlugin, createRawBodyRouter, createServer, createWorkspaceGuardPlugin, decodeJWT, extendRequestIdleTimeout, fetchWorkspaceSecret, formatHttpError, generateSymmetricSecret, getContextOptions, getMutationFieldNames, normalizeError, normalizeExecutionResultErrors, normalizeGraphQLResponse, normalizeGraphQLResponsePayload, orgCheck, requireWorkspace, sanitizeAuditValue, tenantCheck, toUserFacingGraphQLError, verifyJWT, workspaceCheck };
233
+ export { type AuthConfig, type ContextBuilderOptions, type DelegatedPrincipal, type ErrorNormalizationOptions, type FetchWorkspaceSecretFn, GraphQLContext, type HttpErrorPayload, type HttpErrorResult, IActor, ITenant, JWTPayload, MAX_IDLE_TIMEOUT_SECONDS, MUTATION_AUDIT_ACTIVITY_TYPE, MUTATION_AUDIT_RESOURCE_TYPE, type MutationAuditPluginOptions, type NormalizedErrorState, type OrdinaryRoute, RESTEndpoint, type RawBodyResolution, type RawBodyRouter, ServerDefinition, ServerInstance, type UserFacingErrorOptions, UserFacingGraphQLError, VerifiedDelegationContext, type WorkspaceGuardConfig, WorkspaceSecret, YogaPlugin, authCheck, buildContext, configureAuth, configureContext, configureDefaultAuth, configureServerAuth, createHttpErrorResponse, createHumanReadableErrorPlugin, createMutationAuditPlugin, createRawBodyRouter, createServer, createWorkspaceGuardPlugin, decodeJWT, extendRequestIdleTimeout, fetchWorkspaceSecret, formatHttpError, generateSymmetricSecret, getContextOptions, getDelegatedPrincipal, getMutationFieldNames, normalizeError, normalizeExecutionResultErrors, normalizeGraphQLResponse, normalizeGraphQLResponsePayload, orgCheck, requireWorkspace, resolveOnBehalfOf, sanitizeAuditValue, tenantCheck, toUserFacingGraphQLError, verifyJWT, workspaceCheck };
@@ -12,6 +12,32 @@ import { __name } from '../chunk-XE4OXN2W.js';
12
12
  import crypto from 'crypto';
13
13
  import { Kind, OperationTypeNode } from 'graphql';
14
14
 
15
+ // src/server/delegated-identity.ts
16
+ function resolveOnBehalfOf(actor, verifiedDelegation) {
17
+ if (verifiedDelegation && actor && verifiedDelegation.representedUserId === actor.id) {
18
+ return verifiedDelegation.representedUserId;
19
+ }
20
+ return actor?.id;
21
+ }
22
+ __name(resolveOnBehalfOf, "resolveOnBehalfOf");
23
+ function getDelegatedPrincipal(context) {
24
+ const delegation = context.verifiedDelegation;
25
+ if (!delegation || !context.actor || delegation.representedUserId !== context.actor.id) {
26
+ return null;
27
+ }
28
+ return {
29
+ agentAppId: delegation.originatingAppId,
30
+ onBehalfOfUserId: delegation.representedUserId,
31
+ delegationId: delegation.delegationId,
32
+ scopes: delegation.scopes,
33
+ allowedWorkspaceIds: delegation.allowedWorkspaceIds,
34
+ grantedBy: delegation.consent?.grantedBy ?? null,
35
+ grantExpiresAt: delegation.consent?.expiresAt ?? null,
36
+ tokenExpiresAt: delegation.tokenExpiresAt
37
+ };
38
+ }
39
+ __name(getDelegatedPrincipal, "getDelegatedPrincipal");
40
+
15
41
  // src/server/auth.ts
16
42
  var getDbFn = null;
17
43
  async function getDb() {
@@ -409,22 +435,6 @@ function extractGeography(request) {
409
435
  };
410
436
  }
411
437
  __name(extractGeography, "extractGeography");
412
- function extractConsentContext(request) {
413
- const grantedBy = getHeader(request, "x-consent-granted-by");
414
- if (!grantedBy) {
415
- return null;
416
- }
417
- const scopesHeader = getHeader(request, "x-consent-scope");
418
- const grantedAtHeader = getHeader(request, "x-consent-granted-at");
419
- const expiresAtHeader = getHeader(request, "x-consent-expires-at");
420
- return {
421
- grantedBy,
422
- scopes: scopesHeader ? scopesHeader.split(",").map((s) => s.trim()) : void 0,
423
- grantedAt: grantedAtHeader ? new Date(grantedAtHeader) : void 0,
424
- expiresAt: expiresAtHeader ? new Date(expiresAtHeader) : void 0
425
- };
426
- }
427
- __name(extractConsentContext, "extractConsentContext");
428
438
  async function buildContext(request) {
429
439
  if (!contextOptions) {
430
440
  throw new Error("[ServerContext] Context not configured - call configureContext() first");
@@ -436,7 +446,6 @@ async function buildContext(request) {
436
446
  const project = extractProject(request);
437
447
  const product = extractProduct(request);
438
448
  const tracking = extractTracking(request);
439
- const consentContext = extractConsentContext(request);
440
449
  const verifiedDelegation = decodeVerifiedDelegation(getHeader(request, "x-verified-delegation"), actor, workspace?.id, shouldTrustActorHeaders(request));
441
450
  let i18n;
442
451
  if (contextOptions.i18n) {
@@ -464,7 +473,7 @@ async function buildContext(request) {
464
473
  };
465
474
  }
466
475
  }
467
- const onBehalfOf = (actor?.type === "app" || actor?.type === "service" || actor?.type === "service_account") && consentContext?.grantedBy ? consentContext.grantedBy : actor?.id;
476
+ const onBehalfOf = resolveOnBehalfOf(actor, verifiedDelegation);
468
477
  const wsCtxPayload = {
469
478
  workspaceId: workspace?.id,
470
479
  tenantId: tenant?.id,
@@ -490,7 +499,6 @@ async function buildContext(request) {
490
499
  project,
491
500
  product,
492
501
  tracking,
493
- consentContext: consentContext || void 0,
494
502
  verifiedDelegation,
495
503
  onBehalfOf: onBehalfOf || actor?.id || "",
496
504
  db: contextOptions.getDb(),
@@ -1608,6 +1616,6 @@ function createMutationAuditPlugin(options) {
1608
1616
  }
1609
1617
  __name(createMutationAuditPlugin, "createMutationAuditPlugin");
1610
1618
 
1611
- export { MAX_IDLE_TIMEOUT_SECONDS, MUTATION_AUDIT_ACTIVITY_TYPE, MUTATION_AUDIT_RESOURCE_TYPE, authCheck, buildContext, configureAuth, configureContext, configureDefaultAuth, configureServerAuth, createMutationAuditPlugin, createRawBodyRouter, createServer, decodeJWT, extendRequestIdleTimeout, fetchWorkspaceSecret, generateSymmetricSecret, getContextOptions, getMutationFieldNames, orgCheck, requireWorkspace, sanitizeAuditValue, tenantCheck, verifyJWT, workspaceCheck };
1619
+ export { MAX_IDLE_TIMEOUT_SECONDS, MUTATION_AUDIT_ACTIVITY_TYPE, MUTATION_AUDIT_RESOURCE_TYPE, authCheck, buildContext, configureAuth, configureContext, configureDefaultAuth, configureServerAuth, createMutationAuditPlugin, createRawBodyRouter, createServer, decodeJWT, extendRequestIdleTimeout, fetchWorkspaceSecret, generateSymmetricSecret, getContextOptions, getDelegatedPrincipal, getMutationFieldNames, orgCheck, requireWorkspace, resolveOnBehalfOf, sanitizeAuditValue, tenantCheck, verifyJWT, workspaceCheck };
1612
1620
  //# sourceMappingURL=index.js.map
1613
1621
  //# sourceMappingURL=index.js.map