@burdenoff/be-sdk 2026.1101.4 → 2026.1102.2

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 (58) hide show
  1. package/README.md +39 -0
  2. package/dist/auth/index.d.ts +2 -2
  3. package/dist/auth/index.js +2 -2
  4. package/dist/{chunk-INAZ3PKF.js → chunk-23WAZL7I.js} +232 -135
  5. package/dist/chunk-23WAZL7I.js.map +1 -0
  6. package/dist/{chunk-3UKS6TPM.js → chunk-5ENWB2S6.js} +8 -8
  7. package/dist/{chunk-3UKS6TPM.js.map → chunk-5ENWB2S6.js.map} +1 -1
  8. package/dist/{chunk-QGBXVNRM.js → chunk-5SIL5AG2.js} +2 -2
  9. package/dist/chunk-5SIL5AG2.js.map +1 -0
  10. package/dist/{chunk-CKL6U4XE.js → chunk-64QUSPYG.js} +3 -3
  11. package/dist/{chunk-CKL6U4XE.js.map → chunk-64QUSPYG.js.map} +1 -1
  12. package/dist/{chunk-6XZ4ELHR.js → chunk-7TOWWNHR.js} +3 -3
  13. package/dist/{chunk-6XZ4ELHR.js.map → chunk-7TOWWNHR.js.map} +1 -1
  14. package/dist/{chunk-UD5PPGVU.js → chunk-DXTBH7IW.js} +3 -3
  15. package/dist/{chunk-UD5PPGVU.js.map → chunk-DXTBH7IW.js.map} +1 -1
  16. package/dist/{chunk-WVOW3CJR.js → chunk-I57LWBZU.js} +128 -3
  17. package/dist/chunk-I57LWBZU.js.map +1 -0
  18. package/dist/{chunk-WSAWJC4D.js → chunk-QCOC2SF3.js} +3 -3
  19. package/dist/{chunk-WSAWJC4D.js.map → chunk-QCOC2SF3.js.map} +1 -1
  20. package/dist/{chunk-PQGMZH6K.js → chunk-Y4N7N2G4.js} +3 -3
  21. package/dist/{chunk-PQGMZH6K.js.map → chunk-Y4N7N2G4.js.map} +1 -1
  22. package/dist/{chunk-Q5MGYZHG.js → chunk-YZIWBUIN.js} +3 -3
  23. package/dist/{chunk-Q5MGYZHG.js.map → chunk-YZIWBUIN.js.map} +1 -1
  24. package/dist/database/index.js +2 -2
  25. package/dist/event-queue/index.d.ts +3 -3
  26. package/dist/graph/index.d.ts +3 -3
  27. package/dist/graph/index.js +2 -2
  28. package/dist/{graphql-BUbw43Zx.d.ts → graphql-CEblo7lw.d.ts} +1 -1
  29. package/dist/{index-CV3r9Taj.d.ts → index-7pTpoN3Q.d.ts} +1 -0
  30. package/dist/{index-qwG_TaUg.d.ts → index-B7dknayX.d.ts} +25 -2
  31. package/dist/{index-BKOBmdq7.d.ts → index-BHe7zIVb.d.ts} +16 -8
  32. package/dist/{index-DXPFlxpZ.d.ts → index-BV8hveh_.d.ts} +3 -3
  33. package/dist/{index-Coua7_P7.d.ts → index-BioY0Ewz.d.ts} +1 -1
  34. package/dist/{index-Dtj9Eer3.d.ts → index-KZ4OzW6D.d.ts} +1 -1
  35. package/dist/{index-3ZE1m-ZJ.d.ts → index-XzbbMKe4.d.ts} +2 -2
  36. package/dist/{index-JTx7ZQHe.d.ts → index-zCx_euvK.d.ts} +2 -2
  37. package/dist/index.d.ts +14 -14
  38. package/dist/index.js +26 -23
  39. package/dist/index.js.map +1 -1
  40. package/dist/instrumentation/index.d.ts +3 -3
  41. package/dist/logger/index.d.ts +2 -2
  42. package/dist/notifications/index.d.ts +3 -3
  43. package/dist/notifications/index.js +2 -2
  44. package/dist/prisma/index.js +2 -2
  45. package/dist/rbac/index.d.ts +2 -2
  46. package/dist/rbac/index.js +2 -2
  47. package/dist/resource-caps/index.d.ts +2 -2
  48. package/dist/telemetry/index.d.ts +4 -4
  49. package/dist/tracker/index.d.ts +4 -4
  50. package/dist/tracker/index.js +5 -5
  51. package/dist/usage/index.d.ts +2 -2
  52. package/dist/usage/index.js +2 -2
  53. package/dist/validation/index.d.ts +1 -1
  54. package/dist/validation/index.js +1 -1
  55. package/package.json +3 -3
  56. package/dist/chunk-INAZ3PKF.js.map +0 -1
  57. package/dist/chunk-QGBXVNRM.js.map +0 -1
  58. package/dist/chunk-WVOW3CJR.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/auth/cookie-helper.ts","../src/auth/index.ts"],"names":["AuthCookieHelper","ACCESS_TOKEN_COOKIE","REFRESH_TOKEN_COOKIE","PROFILE_ID_COOKIE","setAuthCookies","context","tokens","options","isProd","process","env","domain","setCookie","name","value","accessToken","maxAge","httpOnly","secure","sameSite","path","refreshToken","rememberMe","profileId","clearAuthCookies","clearOptions","cookie","undefined","responseHeaders","append","AuthModule","client","verifyToken","token","logger","debug","isTokenExpired","valid","error","query","response","Error","message","decodeToken","payload","parseJWT","mutation","info","AuthenticationError","validatePermission","userId","permission","resourceId","allowed","isTokenValid","getUserIdFromToken","user_id","getWorkspaceIdFromToken","workspace_id","getTokenClaims","willExpireSoon","withinSeconds","exp","now","Math","floor","Date"],"mappings":";;;;;;AAoBO,IAAMA,mBAAN,MAAMA;EApBb;;;AAqBE,EAAA,OAAwBC,mBAAAA,GAAsB,OAAA;AAC9C,EAAA,OAAwBC,oBAAAA,GAAuB,OAAA;AAC/C,EAAA,OAAwBC,iBAAAA,GAAoB,QAAA;;;;AAK5C,EAAA,OAAcC,cAAAA,CACZC,OAAAA,EACAC,MAAAA,EACAC,OAAAA,GAAwD,EAAC,EACnD;AACN,IAAA,MAAMC,MAAAA,GAASC,OAAAA,CAAQC,GAAAA,CAAI,UAAA,CAAA,KAAgB,YAAA;AAC3C,IAAA,MAAMC,MAAAA,GAASF,OAAAA,CAAQC,GAAAA,CAAI,eAAA,CAAA;AAG3B,IAAA,IAAA,CAAKE,UAAUP,OAAAA,EAAS;AACtBQ,MAAAA,IAAAA,EAAM,IAAA,CAAKZ,mBAAAA;AACXa,MAAAA,KAAAA,EAAOR,MAAAA,CAAOS,WAAAA;AACdC,MAAAA,MAAAA,EAAQ,EAAA,GAAK,EAAA;MACbC,QAAAA,EAAU,IAAA;MACVC,MAAAA,EAAQV,MAAAA;MACRW,QAAAA,EAAU,KAAA;AACVR,MAAAA,MAAAA;MAC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AAI,CAACW,OAAAA,IAAW,OAAOA,OAAAA,CAAQkB,QAAQ,QAAA,EAAU;AAC/C,MAAA,OAAO,IAAA;AACT,IAAA;AAEA,IAAA,MAAMC,MAAMC,IAAAA,CAAKC,KAAAA,CAAMC,IAAAA,CAAKH,GAAAA,KAAQ,GAAA,CAAA;AACpC,IAAA,OAAOnB,OAAAA,CAAQkB,MAAMC,GAAAA,GAAMF,aAAAA;AAC7B,EAAA;AACF","file":"chunk-Q5MGYZHG.js","sourcesContent":["/**\n * Auth Cookie Helper\n *\n * Utilities for setting secure, HttpOnly cookies for authentication.\n * Used by auth services to transition from localStorage to secure cookies.\n */\n\nimport type { GraphQLContext } from '../server/types.js';\n\nexport interface CookieOptions {\n name: string;\n value: string;\n maxAge?: number;\n domain?: string;\n path?: string;\n httpOnly?: boolean;\n secure?: boolean;\n sameSite?: 'Strict' | 'Lax' | 'None';\n}\n\nexport class AuthCookieHelper {\n private static readonly ACCESS_TOKEN_COOKIE = 'bf_at';\n private static readonly REFRESH_TOKEN_COOKIE = 'bf_rt';\n private static readonly PROFILE_ID_COOKIE = 'bf_pid';\n\n /**\n * Set authentication cookies in the context response headers\n */\n public static setAuthCookies(\n context: GraphQLContext,\n tokens: { accessToken: string; refreshToken?: string },\n options: { profileId?: string; rememberMe?: boolean } = {}\n ): void {\n const isProd = process.env['NODE_ENV'] === 'production';\n const domain = process.env['COOKIE_DOMAIN'];\n\n // Access token cookie (short-lived, 15m)\n this.setCookie(context, {\n name: this.ACCESS_TOKEN_COOKIE,\n value: tokens.accessToken,\n maxAge: 15 * 60,\n httpOnly: true,\n secure: isProd,\n sameSite: 'Lax',\n domain,\n path: '/',\n });\n\n // Refresh token cookie (long-lived, 7d or 30d)\n if (tokens.refreshToken) {\n this.setCookie(context, {\n name: this.REFRESH_TOKEN_COOKIE,\n value: tokens.refreshToken,\n maxAge: options.rememberMe ? 30 * 24 * 60 * 60 : 7 * 24 * 60 * 60,\n httpOnly: true,\n secure: isProd,\n sameSite: 'Lax',\n domain,\n path: '/global/graphql', // Only send to global gateway for refresh\n });\n }\n\n // Profile ID cookie (not HttpOnly, needed for UI profile resolution)\n if (options.profileId) {\n this.setCookie(context, {\n name: this.PROFILE_ID_COOKIE,\n value: options.profileId,\n maxAge: 30 * 24 * 60 * 60,\n httpOnly: false,\n secure: isProd,\n sameSite: 'Lax',\n domain,\n path: '/',\n });\n }\n }\n\n /**\n * Clear authentication cookies\n */\n public static clearAuthCookies(context: GraphQLContext): void {\n const domain = process.env['COOKIE_DOMAIN'];\n const isProd = process.env['NODE_ENV'] === 'production';\n\n const clearOptions = {\n value: '',\n maxAge: 0,\n domain,\n path: '/',\n secure: isProd,\n sameSite: 'Lax' as const,\n };\n\n this.setCookie(context, { ...clearOptions, name: this.ACCESS_TOKEN_COOKIE, httpOnly: true });\n this.setCookie(context, {\n ...clearOptions,\n name: this.REFRESH_TOKEN_COOKIE,\n httpOnly: true,\n path: '/global/graphql',\n });\n this.setCookie(context, { ...clearOptions, name: this.PROFILE_ID_COOKIE, httpOnly: false });\n }\n\n /**\n * Internal helper to set a cookie header\n */\n private static setCookie(context: GraphQLContext, options: CookieOptions): void {\n let cookie = `${options.name}=${options.value}`;\n\n if (options.maxAge !== undefined) {\n cookie += `; Max-Age=${options.maxAge}`;\n }\n\n if (options.domain) {\n cookie += `; Domain=${options.domain}`;\n }\n\n if (options.path) {\n cookie += `; Path=${options.path}`;\n }\n\n if (options.httpOnly) {\n cookie += '; HttpOnly';\n }\n\n if (options.secure) {\n cookie += '; Secure';\n }\n\n if (options.sameSite) {\n cookie += `; SameSite=${options.sameSite}`;\n }\n\n context.responseHeaders.append('Set-Cookie', cookie);\n }\n}\n","/**\n * Authentication Module\n * JWT verification, token management, and user authentication\n */\n\nimport type { BurdenoffGraphQLClient } from '../client/graphql.js';\nimport type { SDKContext } from '../types/index.js';\nimport { AuthenticationError } from '../types/index.js';\nimport { logger } from '../logger/index.js';\nimport { parseJWT, isTokenExpired } from '../utils/index.js';\n\nexport { AuthCookieHelper } from './cookie-helper.js';\n\nexport interface TokenPayload {\n jti: string;\n sub: string;\n user_id: string;\n workspace_id?: string;\n org_id?: string;\n tenant_endpoint?: string;\n iat: number;\n exp: number;\n scope?: string;\n}\n\nexport interface VerifyTokenResult {\n valid: boolean;\n payload?: TokenPayload;\n error?: string;\n}\n\nexport interface RefreshTokenResult {\n accessToken: string;\n refreshToken: string;\n expiresIn: number;\n}\n\nexport * from './cookie-helper.js';\n\n/**\n * Authentication Module\n */\nexport class AuthModule {\n constructor(\n private client: BurdenoffGraphQLClient,\n private context: SDKContext\n ) {}\n\n /**\n * Verify JWT token\n */\n public async verifyToken(token: string): Promise<VerifyTokenResult> {\n logger.debug('[Auth] Verifying token');\n\n // First check if token is expired locally\n if (isTokenExpired(token)) {\n return {\n valid: false,\n error: 'Token expired',\n };\n }\n\n const query = `\n query VerifyToken($token: String!) {\n verifyToken(token: $token) {\n valid\n payload\n error\n }\n }\n `;\n\n try {\n const response = await this.client.query<{ verifyToken: VerifyTokenResult }>(query, { token }, this.context);\n\n logger.debug('[Auth] Token verification result', { valid: response.verifyToken.valid });\n\n return response.verifyToken;\n } catch (error) {\n logger.error('[Auth] Token verification failed', { error });\n return {\n valid: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n };\n }\n }\n\n /**\n * Decode token without verification\n */\n public decodeToken(token: string): TokenPayload | null {\n const payload = parseJWT(token);\n if (!payload) {\n return null;\n }\n return payload as unknown as TokenPayload;\n }\n\n /**\n * Refresh access token using refresh token\n */\n public async refreshToken(refreshToken: string): Promise<RefreshTokenResult> {\n logger.debug('[Auth] Refreshing token');\n\n const mutation = `\n mutation RefreshToken($refreshToken: String!) {\n refreshToken(refreshToken: $refreshToken) {\n accessToken\n refreshToken\n expiresIn\n }\n }\n `;\n\n try {\n const response = await this.client.query<{ refreshToken: RefreshTokenResult }>(\n mutation,\n { refreshToken },\n this.context\n );\n\n logger.info('[Auth] Token refreshed successfully');\n\n return response.refreshToken;\n } catch (error) {\n logger.error('[Auth] Token refresh failed', { error });\n throw new AuthenticationError('Failed to refresh token', {\n error: error instanceof Error ? error.message : 'Unknown error',\n });\n }\n }\n\n /**\n * Validate user has specific permission\n */\n public async validatePermission(userId: string, permission: string, resourceId?: string): Promise<boolean> {\n logger.debug('[Auth] Validating permission', { userId, permission, resourceId });\n\n const query = `\n query ValidatePermission($userId: ID!, $permission: String!, $resourceId: ID) {\n validatePermission(userId: $userId, permission: $permission, resourceId: $resourceId) {\n allowed\n }\n }\n `;\n\n try {\n const response = await this.client.query<{\n validatePermission: { allowed: boolean };\n }>(query, { userId, permission, resourceId }, this.context);\n\n logger.debug('[Auth] Permission validation result', {\n allowed: response.validatePermission.allowed,\n });\n\n return response.validatePermission.allowed;\n } catch (error) {\n logger.error('[Auth] Permission validation failed', { error });\n return false;\n }\n }\n\n /**\n * Check if token is valid and not expired\n */\n public isTokenValid(token: string): boolean {\n return !isTokenExpired(token);\n }\n\n /**\n * Get user ID from token\n */\n public getUserIdFromToken(token: string): string | null {\n const payload = this.decodeToken(token);\n return payload?.user_id || null;\n }\n\n /**\n * Get workspace ID from token\n */\n public getWorkspaceIdFromToken(token: string): string | null {\n const payload = this.decodeToken(token);\n return payload?.workspace_id || null;\n }\n\n /**\n * Extract all claims from token\n */\n public getTokenClaims(token: string): Record<string, unknown> | null {\n const payload = parseJWT(token);\n return payload;\n }\n\n /**\n * Check if token will expire soon (within given seconds)\n */\n public willExpireSoon(token: string, withinSeconds: number = 300): boolean {\n const payload = this.decodeToken(token);\n if (!payload || typeof payload.exp !== 'number') {\n return true;\n }\n\n const now = Math.floor(Date.now() / 1000);\n return payload.exp - now < withinSeconds;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/auth/cookie-helper.ts","../src/auth/index.ts"],"names":["AuthCookieHelper","ACCESS_TOKEN_COOKIE","REFRESH_TOKEN_COOKIE","PROFILE_ID_COOKIE","setAuthCookies","context","tokens","options","isProd","process","env","domain","setCookie","name","value","accessToken","maxAge","httpOnly","secure","sameSite","path","refreshToken","rememberMe","profileId","clearAuthCookies","clearOptions","cookie","undefined","responseHeaders","append","AuthModule","client","verifyToken","token","logger","debug","isTokenExpired","valid","error","query","response","Error","message","decodeToken","payload","parseJWT","mutation","info","AuthenticationError","validatePermission","userId","permission","resourceId","allowed","isTokenValid","getUserIdFromToken","user_id","getWorkspaceIdFromToken","workspace_id","getTokenClaims","willExpireSoon","withinSeconds","exp","now","Math","floor","Date"],"mappings":";;;;;;AAoBO,IAAMA,mBAAN,MAAMA;EApBb;;;AAqBE,EAAA,OAAwBC,mBAAAA,GAAsB,OAAA;AAC9C,EAAA,OAAwBC,oBAAAA,GAAuB,OAAA;AAC/C,EAAA,OAAwBC,iBAAAA,GAAoB,QAAA;;;;AAK5C,EAAA,OAAcC,cAAAA,CACZC,OAAAA,EACAC,MAAAA,EACAC,OAAAA,GAAwD,EAAC,EACnD;AACN,IAAA,MAAMC,MAAAA,GAASC,OAAAA,CAAQC,GAAAA,CAAI,UAAA,CAAA,KAAgB,YAAA;AAC3C,IAAA,MAAMC,MAAAA,GAASF,OAAAA,CAAQC,GAAAA,CAAI,eAAA,CAAA;AAG3B,IAAA,IAAA,CAAKE,UAAUP,OAAAA,EAAS;AACtBQ,MAAAA,IAAAA,EAAM,IAAA,CAAKZ,mBAAAA;AACXa,MAAAA,KAAAA,EAAOR,MAAAA,CAAOS,WAAAA;AACdC,MAAAA,MAAAA,EAAQ,EAAA,GAAK,EAAA;MACbC,QAAAA,EAAU,IAAA;MACVC,MAAAA,EAAQV,MAAAA;MACRW,QAAAA,EAAU,KAAA;AACVR,MAAAA,MAAAA;MACAS,IAAAA,EAAM;KACR,CAAA;AAGA,IAAA,IAAId,OAAOe,YAAAA,EAAc;AACvB,MAAA,IAAA,CAAKT,UAAUP,OAAAA,EAAS;AACtBQ,QAAAA,IAAAA,EAAM,IAAA,CAAKX,oBAAAA;AACXY,QAAAA,KAAAA,EAAOR,MAAAA,CAAOe,YAAAA;QACdL,MAAAA,EAAQT,O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,MAAMC,GAAAA,GAAMF,aAAAA;AAC7B,EAAA;AACF","file":"chunk-YZIWBUIN.js","sourcesContent":["/**\n * Auth Cookie Helper\n *\n * Utilities for setting secure, HttpOnly cookies for authentication.\n * Used by auth services to transition from localStorage to secure cookies.\n */\n\nimport type { GraphQLContext } from '../server/types.js';\n\nexport interface CookieOptions {\n name: string;\n value: string;\n maxAge?: number;\n domain?: string;\n path?: string;\n httpOnly?: boolean;\n secure?: boolean;\n sameSite?: 'Strict' | 'Lax' | 'None';\n}\n\nexport class AuthCookieHelper {\n private static readonly ACCESS_TOKEN_COOKIE = 'bf_at';\n private static readonly REFRESH_TOKEN_COOKIE = 'bf_rt';\n private static readonly PROFILE_ID_COOKIE = 'bf_pid';\n\n /**\n * Set authentication cookies in the context response headers\n */\n public static setAuthCookies(\n context: GraphQLContext,\n tokens: { accessToken: string; refreshToken?: string },\n options: { profileId?: string; rememberMe?: boolean } = {}\n ): void {\n const isProd = process.env['NODE_ENV'] === 'production';\n const domain = process.env['COOKIE_DOMAIN'];\n\n // Access token cookie (short-lived, 15m)\n this.setCookie(context, {\n name: this.ACCESS_TOKEN_COOKIE,\n value: tokens.accessToken,\n maxAge: 15 * 60,\n httpOnly: true,\n secure: isProd,\n sameSite: 'Lax',\n domain,\n path: '/',\n });\n\n // Refresh token cookie (long-lived, 7d or 30d)\n if (tokens.refreshToken) {\n this.setCookie(context, {\n name: this.REFRESH_TOKEN_COOKIE,\n value: tokens.refreshToken,\n maxAge: options.rememberMe ? 30 * 24 * 60 * 60 : 7 * 24 * 60 * 60,\n httpOnly: true,\n secure: isProd,\n sameSite: 'Lax',\n domain,\n path: '/global/graphql', // Only send to global gateway for refresh\n });\n }\n\n // Profile ID cookie (not HttpOnly, needed for UI profile resolution)\n if (options.profileId) {\n this.setCookie(context, {\n name: this.PROFILE_ID_COOKIE,\n value: options.profileId,\n maxAge: 30 * 24 * 60 * 60,\n httpOnly: false,\n secure: isProd,\n sameSite: 'Lax',\n domain,\n path: '/',\n });\n }\n }\n\n /**\n * Clear authentication cookies\n */\n public static clearAuthCookies(context: GraphQLContext): void {\n const domain = process.env['COOKIE_DOMAIN'];\n const isProd = process.env['NODE_ENV'] === 'production';\n\n const clearOptions = {\n value: '',\n maxAge: 0,\n domain,\n path: '/',\n secure: isProd,\n sameSite: 'Lax' as const,\n };\n\n this.setCookie(context, { ...clearOptions, name: this.ACCESS_TOKEN_COOKIE, httpOnly: true });\n this.setCookie(context, {\n ...clearOptions,\n name: this.REFRESH_TOKEN_COOKIE,\n httpOnly: true,\n path: '/global/graphql',\n });\n this.setCookie(context, { ...clearOptions, name: this.PROFILE_ID_COOKIE, httpOnly: false });\n }\n\n /**\n * Internal helper to set a cookie header\n */\n private static setCookie(context: GraphQLContext, options: CookieOptions): void {\n let cookie = `${options.name}=${options.value}`;\n\n if (options.maxAge !== undefined) {\n cookie += `; Max-Age=${options.maxAge}`;\n }\n\n if (options.domain) {\n cookie += `; Domain=${options.domain}`;\n }\n\n if (options.path) {\n cookie += `; Path=${options.path}`;\n }\n\n if (options.httpOnly) {\n cookie += '; HttpOnly';\n }\n\n if (options.secure) {\n cookie += '; Secure';\n }\n\n if (options.sameSite) {\n cookie += `; SameSite=${options.sameSite}`;\n }\n\n context.responseHeaders.append('Set-Cookie', cookie);\n }\n}\n","/**\n * Authentication Module\n * JWT verification, token management, and user authentication\n */\n\nimport type { BurdenoffGraphQLClient } from '../client/graphql.js';\nimport type { SDKContext } from '../types/index.js';\nimport { AuthenticationError } from '../types/index.js';\nimport { logger } from '../logger/index.js';\nimport { parseJWT, isTokenExpired } from '../utils/index.js';\n\nexport { AuthCookieHelper } from './cookie-helper.js';\n\nexport interface TokenPayload {\n jti: string;\n sub: string;\n user_id: string;\n workspace_id?: string;\n org_id?: string;\n tenant_endpoint?: string;\n iat: number;\n exp: number;\n scope?: string;\n}\n\nexport interface VerifyTokenResult {\n valid: boolean;\n payload?: TokenPayload;\n error?: string;\n}\n\nexport interface RefreshTokenResult {\n accessToken: string;\n refreshToken: string;\n expiresIn: number;\n}\n\nexport * from './cookie-helper.js';\n\n/**\n * Authentication Module\n */\nexport class AuthModule {\n constructor(\n private client: BurdenoffGraphQLClient,\n private context: SDKContext\n ) {}\n\n /**\n * Verify JWT token\n */\n public async verifyToken(token: string): Promise<VerifyTokenResult> {\n logger.debug('[Auth] Verifying token');\n\n // First check if token is expired locally\n if (isTokenExpired(token)) {\n return {\n valid: false,\n error: 'Token expired',\n };\n }\n\n const query = `\n query VerifyToken($token: String!) {\n verifyToken(token: $token) {\n valid\n payload\n error\n }\n }\n `;\n\n try {\n const response = await this.client.query<{ verifyToken: VerifyTokenResult }>(query, { token }, this.context);\n\n logger.debug('[Auth] Token verification result', { valid: response.verifyToken.valid });\n\n return response.verifyToken;\n } catch (error) {\n logger.error('[Auth] Token verification failed', { error });\n return {\n valid: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n };\n }\n }\n\n /**\n * Decode token without verification\n */\n public decodeToken(token: string): TokenPayload | null {\n const payload = parseJWT(token);\n if (!payload) {\n return null;\n }\n return payload as unknown as TokenPayload;\n }\n\n /**\n * Refresh access token using refresh token\n */\n public async refreshToken(refreshToken: string): Promise<RefreshTokenResult> {\n logger.debug('[Auth] Refreshing token');\n\n const mutation = `\n mutation RefreshToken($refreshToken: String!) {\n refreshToken(refreshToken: $refreshToken) {\n accessToken\n refreshToken\n expiresIn\n }\n }\n `;\n\n try {\n const response = await this.client.query<{ refreshToken: RefreshTokenResult }>(\n mutation,\n { refreshToken },\n this.context\n );\n\n logger.info('[Auth] Token refreshed successfully');\n\n return response.refreshToken;\n } catch (error) {\n logger.error('[Auth] Token refresh failed', { error });\n throw new AuthenticationError('Failed to refresh token', {\n error: error instanceof Error ? error.message : 'Unknown error',\n });\n }\n }\n\n /**\n * Validate user has specific permission\n */\n public async validatePermission(userId: string, permission: string, resourceId?: string): Promise<boolean> {\n logger.debug('[Auth] Validating permission', { userId, permission, resourceId });\n\n const query = `\n query ValidatePermission($userId: ID!, $permission: String!, $resourceId: ID) {\n validatePermission(userId: $userId, permission: $permission, resourceId: $resourceId) {\n allowed\n }\n }\n `;\n\n try {\n const response = await this.client.query<{\n validatePermission: { allowed: boolean };\n }>(query, { userId, permission, resourceId }, this.context);\n\n logger.debug('[Auth] Permission validation result', {\n allowed: response.validatePermission.allowed,\n });\n\n return response.validatePermission.allowed;\n } catch (error) {\n logger.error('[Auth] Permission validation failed', { error });\n return false;\n }\n }\n\n /**\n * Check if token is valid and not expired\n */\n public isTokenValid(token: string): boolean {\n return !isTokenExpired(token);\n }\n\n /**\n * Get user ID from token\n */\n public getUserIdFromToken(token: string): string | null {\n const payload = this.decodeToken(token);\n return payload?.user_id || null;\n }\n\n /**\n * Get workspace ID from token\n */\n public getWorkspaceIdFromToken(token: string): string | null {\n const payload = this.decodeToken(token);\n return payload?.workspace_id || null;\n }\n\n /**\n * Extract all claims from token\n */\n public getTokenClaims(token: string): Record<string, unknown> | null {\n const payload = parseJWT(token);\n return payload;\n }\n\n /**\n * Check if token will expire soon (within given seconds)\n */\n public willExpireSoon(token: string, withinSeconds: number = 300): boolean {\n const payload = this.decodeToken(token);\n if (!payload || typeof payload.exp !== 'number') {\n return true;\n }\n\n const now = Math.floor(Date.now() / 1000);\n return payload.exp - now < withinSeconds;\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- export { DatabaseModule, closeClickHouseConnection, createTable, executeQuery, getClickHouseClient, getClickHouseStats, insertData, testClickHouseConnection } from '../chunk-UD5PPGVU.js';
2
- import '../chunk-QGBXVNRM.js';
1
+ export { DatabaseModule, closeClickHouseConnection, createTable, executeQuery, getClickHouseClient, getClickHouseStats, insertData, testClickHouseConnection } from '../chunk-DXTBH7IW.js';
2
+ import '../chunk-5SIL5AG2.js';
3
3
  import '../chunk-5CAFHK2Z.js';
4
4
  import '../chunk-RU266375.js';
5
5
  import '../chunk-XE4OXN2W.js';
@@ -1,7 +1,7 @@
1
- export { A as AcknowledgeableEvent, B as BaseQueueConfig, a as BulkEventPayload, C as ConsumerConfig, b as ConsumerOptions, D as DefinedEventTaxonomy, c as EVENT_STREAMS_URL_ENV_KEYS, d as EVENT_TAXONOMY_BRAND, e as EventHandler, f as EventMessage, g as EventMetadata, h as EventPriority, j as EventQueueFactory, k as EventQueueHealthCheckResult, l as EventSpec, m as EventTaxonomy, n as EventsManager, o as EventsManagerHandler, p as EventsManagerMessage, q as EventsManagerOptions, r as EventsManagerSingleton, s as EventsManagerStreamRoute, t as EventsManagerSubscribeOptions, E as EventsModule, G as GRAPH_EVENTS_URL_ENV_KEYS, u as GraphEntityEventPayload, v as GraphQLEventMessage, k as HealthCheckResult, w as IEventConsumer, I as IEventPublisher, x as IEventQueue, y as ISubscription, L as LIFECYCLE_SUBJECTS, z as LifecycleConsumer, F as LifecycleConsumerOptions, H as LifecycleEventContext, J as LifecycleEventSource, K as LifecycleHandlers, M as MemoryEventBus, N as MemoryEventConsumer, O as MemoryEventPublisher, P as MemoryEventQueue, Q as ModuleEventPayload, R as ModuleEventsConfig, S as ModuleEventsService, T as OrganizationDeletedFact, U as OrganizationDeletedPayload, V as PLATFORM_EVENT_TAXONOMY, W as PublishEventOptions, X as PublishOptions, Y as PublishResult, Z as PublishableEventName, _ as PublisherConfig, $ as QueueStatistics, a0 as QueueType, a1 as REFERENCE_PRODUCT_EVENT_TAXONOMY, a2 as RedisStreamsConnection, a3 as RedisStreamsEventConsumer, a4 as RedisStreamsEventPublisher, a5 as StreamConfig, a6 as StreamInfo, a7 as SubscribeOptions, a8 as SubscriptionChangedPayload, a9 as SubscriptionOptions, aa as TaxonomyEventKind, ab as TaxonomyEventLayer, ac as TaxonomyEventPii, ad as TaxonomyEventStatus, ae as TaxonomyPayload, af as TaxonomyPublishMetadata, ag as UserDeletedPayload, ah as VibecontrolsAgentConnectedPayload, ai as VibecontrolsAgentDisconnectedPayload, aj as VibecontrolsSessionEndedPayload, ak as VibecontrolsSessionStartedPayload, al as WSPACE_GRAPH_EVENTS_STREAM, am as WorkflowRunCompletedPayload, an as WorkflowRunFailedPayload, ao as WorkflowRunStartedPayload, ap as WorkspaceCreatedPayload, aq as WorkspaceDeletedFact, ar as WorkspaceDeletedPayload, as as WorkspaceMemberAddedPayload, at as WorkspaceMemberRemovedFact, au as WorkspaceMemberRemovedPayload, av as WorkspaceMemberRoleUpdatedPayload, aw as buildConsumerGroupName, ax as createConsumer, ay as createEventsManagerSingleton, az as createLifecycleConsumer, aA as createMemoryConsumer, aB as createMemoryGraphEventEmitter, aC as createMemoryPublisher, aD as createModuleEventsService, aE as createPublisher, aF as defineEventTaxonomy, aG as eventKeyScopeForUrl, aH as eventSpec, aI as isDefinedEventTaxonomy, aJ as mergeEventTaxonomies, aK as parseOrganizationDeleted, aL as parseWorkspaceDeletedGraph, aM as parseWorkspaceDeletedStream, aN as parseWorkspaceMemberRemoved, aO as publishTaxonomyEvent, aP as redisDlqKey, aQ as redisStreamKey, aR as resolveEventStreamsUrl, aS as resolveEventStreamsUrlSource, aT as resolveGraphEventsUrl, aU as resolveGraphEventsUrlSource, aV as taxonomyEventNames, aW as taxonomyNameViolation } from '../index-JTx7ZQHe.js';
1
+ export { A as AcknowledgeableEvent, B as BaseQueueConfig, a as BulkEventPayload, C as ConsumerConfig, b as ConsumerOptions, D as DefinedEventTaxonomy, c as EVENT_STREAMS_URL_ENV_KEYS, d as EVENT_TAXONOMY_BRAND, e as EventHandler, f as EventMessage, g as EventMetadata, h as EventPriority, j as EventQueueFactory, k as EventQueueHealthCheckResult, l as EventSpec, m as EventTaxonomy, n as EventsManager, o as EventsManagerHandler, p as EventsManagerMessage, q as EventsManagerOptions, r as EventsManagerSingleton, s as EventsManagerStreamRoute, t as EventsManagerSubscribeOptions, E as EventsModule, G as GRAPH_EVENTS_URL_ENV_KEYS, u as GraphEntityEventPayload, v as GraphQLEventMessage, k as HealthCheckResult, w as IEventConsumer, I as IEventPublisher, x as IEventQueue, y as ISubscription, L as LIFECYCLE_SUBJECTS, z as LifecycleConsumer, F as LifecycleConsumerOptions, H as LifecycleEventContext, J as LifecycleEventSource, K as LifecycleHandlers, M as MemoryEventBus, N as MemoryEventConsumer, O as MemoryEventPublisher, P as MemoryEventQueue, Q as ModuleEventPayload, R as ModuleEventsConfig, S as ModuleEventsService, T as OrganizationDeletedFact, U as OrganizationDeletedPayload, V as PLATFORM_EVENT_TAXONOMY, W as PublishEventOptions, X as PublishOptions, Y as PublishResult, Z as PublishableEventName, _ as PublisherConfig, $ as QueueStatistics, a0 as QueueType, a1 as REFERENCE_PRODUCT_EVENT_TAXONOMY, a2 as RedisStreamsConnection, a3 as RedisStreamsEventConsumer, a4 as RedisStreamsEventPublisher, a5 as StreamConfig, a6 as StreamInfo, a7 as SubscribeOptions, a8 as SubscriptionChangedPayload, a9 as SubscriptionOptions, aa as TaxonomyEventKind, ab as TaxonomyEventLayer, ac as TaxonomyEventPii, ad as TaxonomyEventStatus, ae as TaxonomyPayload, af as TaxonomyPublishMetadata, ag as UserDeletedPayload, ah as VibecontrolsAgentConnectedPayload, ai as VibecontrolsAgentDisconnectedPayload, aj as VibecontrolsSessionEndedPayload, ak as VibecontrolsSessionStartedPayload, al as WSPACE_GRAPH_EVENTS_STREAM, am as WorkflowRunCompletedPayload, an as WorkflowRunFailedPayload, ao as WorkflowRunStartedPayload, ap as WorkspaceCreatedPayload, aq as WorkspaceDeletedFact, ar as WorkspaceDeletedPayload, as as WorkspaceMemberAddedPayload, at as WorkspaceMemberRemovedFact, au as WorkspaceMemberRemovedPayload, av as WorkspaceMemberRoleUpdatedPayload, aw as buildConsumerGroupName, ax as createConsumer, ay as createEventsManagerSingleton, az as createLifecycleConsumer, aA as createMemoryConsumer, aB as createMemoryGraphEventEmitter, aC as createMemoryPublisher, aD as createModuleEventsService, aE as createPublisher, aF as defineEventTaxonomy, aG as eventKeyScopeForUrl, aH as eventSpec, aI as isDefinedEventTaxonomy, aJ as mergeEventTaxonomies, aK as parseOrganizationDeleted, aL as parseWorkspaceDeletedGraph, aM as parseWorkspaceDeletedStream, aN as parseWorkspaceMemberRemoved, aO as publishTaxonomyEvent, aP as redisDlqKey, aQ as redisStreamKey, aR as resolveEventStreamsUrl, aS as resolveEventStreamsUrlSource, aT as resolveGraphEventsUrl, aU as resolveGraphEventsUrlSource, aV as taxonomyEventNames, aW as taxonomyNameViolation } from '../index-zCx_euvK.js';
2
2
  export { E as EntityEventRbacMetadata, a as EntityEventType, b as GraphEventEmitter, G as GraphEventEmitterImpl, c as createGraphEventEmitter, g as getGraphEventEmitter, r as resetGraphEventEmitter } from '../graph-emitter-r5TylDBm.js';
3
3
  import '../layer-Cv9vSwBx.js';
4
4
  import '../shutdown-registry-CW9LryO8.js';
5
- import '../graphql-BUbw43Zx.js';
5
+ import '../graphql-CEblo7lw.js';
6
6
  import 'graphql-request';
7
- import '../index-CV3r9Taj.js';
7
+ import '../index-7pTpoN3Q.js';
@@ -1,7 +1,7 @@
1
- import '../graphql-BUbw43Zx.js';
2
- import '../index-CV3r9Taj.js';
1
+ import '../graphql-CEblo7lw.js';
2
+ import '../index-7pTpoN3Q.js';
3
3
  export { e as EdgeDocument, b as EntityBulkOperationsConfig, f as EntityEventType, E as EntityGraphConfig, g as EntityVertex, d as GraphEvent, G as GraphEventEmitter, c as GraphEventType, h as GraphMiddlewareConfig, M as ModuleGraphConfig, P as ProductFacet, a as RelationshipGraphConfig, S as SearchFacets, i as SearchFilters, j as SearchResponse, k as SearchResult, T as TypeFacet, l as addGraphExtension } from '../prisma-extension-gYhYriA0.js';
4
- export { A as AUDIT_FIELDS, C as CreateEdgeOptions, a as CreateNodeOptions, D as DeferredGraphResult, b as DefineEntityConfigOptions, c as DefineGraphConfigOptions, d as DefineRelationshipConfigOptions, E as EntityDefinition, e as EntityEventContext, f as EntityEventData, g as EntityEventHook, h as EntityFetcher, j as EntityRbacConfig, k as ExtractedEntityData, l as ExtractedRelationshipData, F as FieldMapper, m as GenericEntityConfig, n as GenericEntityRbacConfig, o as GenericGraphConfig, p as GenericRelationshipConfig, q as GraphEdge, r as GraphEntityConfig, s as GraphEntityExport, t as GraphEventOptions, u as GraphEventPublishOptions, v as GraphEventsHelper, w as GraphEventsHelperConfig, x as GraphEventsPublisher, y as GraphExportResponse, z as GraphExportService, B as GraphExportServiceConfig, G as GraphModule, H as GraphNode, I as GraphRegistry, J as GraphRelationshipData, K as GraphRelationshipExport, L as GraphSchema, M as GraphValidationError, N as GraphValidationResult, O as InitializeGraphOptions, P as ModuleGraph, Q as ModuleGraphDefinition, R as PrismaGraphIntegration, S as PrismaGraphIntegrationOptions, T as QueryGraphOptions, U as RelationshipDefinition, V as RelationshipEventData, W as RelationshipExportData, X as RelationshipFetcher, Y as SOFT_DELETE_FIELDS, Z as STANDARD_FIELDS, _ as TENANT_FIELDS, $ as TraverseDirection, a0 as TraverseOptions, a1 as TraverseResult, a2 as ValidationErrorType, a3 as createEntityEvent, a4 as createGraphEventsHelper, a5 as createGraphExportService, a6 as createPrismaGraphIntegration, a7 as createRelationshipEvent, a8 as createRelationshipFromEntity, a9 as defineEntity, aa as defineGraphConfig, ab as defineModuleGraph, ac as defineRelationship, ad as extractEntityTitle, ae as extractMinimalFields, af as getCollectionForEntity, ag as getGraphEventsPublisher, ah as getGraphStats, ai as initializeGraph, aj as isGraphInitialized, ak as parseRelationship, al as shouldSyncEntity, am as shouldSyncRelationship, an as withDeferredGraphEvents } from '../index-3ZE1m-ZJ.js';
4
+ export { A as AUDIT_FIELDS, C as CreateEdgeOptions, a as CreateNodeOptions, D as DeferredGraphResult, b as DefineEntityConfigOptions, c as DefineGraphConfigOptions, d as DefineRelationshipConfigOptions, E as EntityDefinition, e as EntityEventContext, f as EntityEventData, g as EntityEventHook, h as EntityFetcher, j as EntityRbacConfig, k as ExtractedEntityData, l as ExtractedRelationshipData, F as FieldMapper, m as GenericEntityConfig, n as GenericEntityRbacConfig, o as GenericGraphConfig, p as GenericRelationshipConfig, q as GraphEdge, r as GraphEntityConfig, s as GraphEntityExport, t as GraphEventOptions, u as GraphEventPublishOptions, v as GraphEventsHelper, w as GraphEventsHelperConfig, x as GraphEventsPublisher, y as GraphExportResponse, z as GraphExportService, B as GraphExportServiceConfig, G as GraphModule, H as GraphNode, I as GraphRegistry, J as GraphRelationshipData, K as GraphRelationshipExport, L as GraphSchema, M as GraphValidationError, N as GraphValidationResult, O as InitializeGraphOptions, P as ModuleGraph, Q as ModuleGraphDefinition, R as PrismaGraphIntegration, S as PrismaGraphIntegrationOptions, T as QueryGraphOptions, U as RelationshipDefinition, V as RelationshipEventData, W as RelationshipExportData, X as RelationshipFetcher, Y as SOFT_DELETE_FIELDS, Z as STANDARD_FIELDS, _ as TENANT_FIELDS, $ as TraverseDirection, a0 as TraverseOptions, a1 as TraverseResult, a2 as ValidationErrorType, a3 as createEntityEvent, a4 as createGraphEventsHelper, a5 as createGraphExportService, a6 as createPrismaGraphIntegration, a7 as createRelationshipEvent, a8 as createRelationshipFromEntity, a9 as defineEntity, aa as defineGraphConfig, ab as defineModuleGraph, ac as defineRelationship, ad as extractEntityTitle, ae as extractMinimalFields, af as getCollectionForEntity, ag as getGraphEventsPublisher, ah as getGraphStats, ai as initializeGraph, aj as isGraphInitialized, ak as parseRelationship, al as shouldSyncEntity, am as shouldSyncRelationship, an as withDeferredGraphEvents } from '../index-XzbbMKe4.js';
5
5
  import 'graphql-request';
6
6
  import '../layer-Cv9vSwBx.js';
7
7
  import '../client-CCXpAZ2r.js';
@@ -1,4 +1,4 @@
1
- export { AUDIT_FIELDS, GraphEventsPublisher, GraphExportService, GraphModule, SOFT_DELETE_FIELDS, STANDARD_FIELDS, TENANT_FIELDS, createGraphEventsHelper, createGraphExportService, createPrismaGraphIntegration, createRelationshipFromEntity, defineEntity, defineGraphConfig, defineModuleGraph, defineRelationship, getGraphEventsPublisher, getGraphStats, initializeGraph, isGraphInitialized } from '../chunk-6XZ4ELHR.js';
1
+ export { AUDIT_FIELDS, GraphEventsPublisher, GraphExportService, GraphModule, SOFT_DELETE_FIELDS, STANDARD_FIELDS, TENANT_FIELDS, createGraphEventsHelper, createGraphExportService, createPrismaGraphIntegration, createRelationshipFromEntity, defineEntity, defineGraphConfig, defineModuleGraph, defineRelationship, getGraphEventsPublisher, getGraphStats, initializeGraph, isGraphInitialized } from '../chunk-7TOWWNHR.js';
2
2
  export { GraphRegistry, addGraphExtension, createEntityEvent, createRelationshipEvent, extractEntityTitle, extractMinimalFields, getCollectionForEntity, parseRelationship, shouldSyncEntity, shouldSyncRelationship, withDeferredGraphEvents } from '../chunk-K52ICDCP.js';
3
3
  import '../chunk-5M77HKFT.js';
4
4
  import '../chunk-TX2GDIWP.js';
@@ -6,7 +6,7 @@ import '../chunk-SIAOIYHW.js';
6
6
  import '../chunk-KS2HQCJR.js';
7
7
  import '../chunk-ENEDTQET.js';
8
8
  import '../chunk-KO2ZXZ7W.js';
9
- import '../chunk-QGBXVNRM.js';
9
+ import '../chunk-5SIL5AG2.js';
10
10
  import '../chunk-5CAFHK2Z.js';
11
11
  import '../chunk-RU266375.js';
12
12
  import '../chunk-XE4OXN2W.js';
@@ -1,5 +1,5 @@
1
1
  import { Variables } from 'graphql-request';
2
- import { S as SDKConfig, a as SDKContext } from './index-CV3r9Taj.js';
2
+ import { S as SDKConfig, a as SDKContext } from './index-7pTpoN3Q.js';
3
3
 
4
4
  declare class BurdenoffGraphQLClient {
5
5
  private workspacesClient;
@@ -34,6 +34,7 @@ interface SDKContext {
34
34
  actorId?: string;
35
35
  actorType?: ActorType;
36
36
  workspaceId?: string;
37
+ organizationId?: string;
37
38
  tenantId?: string;
38
39
  projectId?: string;
39
40
  appId?: string;
@@ -113,8 +113,27 @@ declare function rbacArgPathProblem(field: FieldDefinitionNode, path: string, in
113
113
  declare function analyzeRbacCoverage(source: RbacCoverageSource, options?: RbacCoverageOptions): RbacCoverageReport;
114
114
  declare function assertRbacCoverage(source: RbacCoverageSource, options?: RbacCoverageOptions): RbacCoverageReport;
115
115
 
116
+ declare const SUPPORTED_BILLING_CURRENCIES: readonly ["USD", "EUR", "GBP", "INR", "AUD", "CAD", "SGD", "JPY", "CNY", "BRL", "MXN", "KRW", "HKD", "NOK", "SEK", "DKK", "CHF", "NZD", "ZAR", "AED", "SAR", "QAR", "OMR", "BHD", "KWD", "JOD", "EGP", "PKR", "BDT", "LKR", "THB", "MYR", "IDR", "PHP", "VND", "TWD", "CZK", "HUF", "PLN", "RON", "RUB", "TRY", "ILS", "NGN", "GHS", "KES", "TZS", "UGX", "ETB", "MAD", "DZD", "TND", "BWP", "MUR", "MVR", "BND", "KHR", "MMK", "KZT", "UZS", "AZN", "GEL", "AMD", "UAH", "BGN", "HRK", "MKD", "ALL", "RSD", "CLP", "COP", "PEN", "ARS", "BOB", "PYG", "UYU", "GTQ", "HNL", "NIO", "CRC", "DOP", "TTD", "JMD", "BBD", "HTG", "BZD", "GYD", "SRD", "XCD", "PAB"];
117
+ type SupportedBillingCurrency = (typeof SUPPORTED_BILLING_CURRENCIES)[number];
118
+ declare const MAX_BILLING_AMOUNT = 1000000000;
119
+ declare function isSupportedBillingCurrency(currency: unknown): boolean;
120
+ type BillingAmountErrorCode = 'not_finite' | 'not_positive' | 'negative' | 'exceeds_maximum';
121
+ type BillingAmountValidationResult = {
122
+ valid: true;
123
+ value: number;
124
+ } | {
125
+ valid: false;
126
+ code: BillingAmountErrorCode;
127
+ };
128
+ declare function validateBillingAmount(amount: unknown, options?: {
129
+ allowZero?: boolean;
130
+ }): BillingAmountValidationResult;
131
+
132
+ type index_BillingAmountErrorCode = BillingAmountErrorCode;
133
+ type index_BillingAmountValidationResult = BillingAmountValidationResult;
116
134
  declare const index_DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS: typeof DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS;
117
135
  declare const index_DEFAULT_RBAC_ROOT_TYPES: typeof DEFAULT_RBAC_ROOT_TYPES;
136
+ declare const index_MAX_BILLING_AMOUNT: typeof MAX_BILLING_AMOUNT;
118
137
  declare const index_NAME_MAX_LENGTH: typeof NAME_MAX_LENGTH;
119
138
  declare const index_NAME_MIN_LENGTH: typeof NAME_MIN_LENGTH;
120
139
  type index_NameErrorCode = NameErrorCode;
@@ -131,6 +150,8 @@ type index_RbacFieldPin = RbacFieldPin;
131
150
  type index_RbacRootField = RbacRootField;
132
151
  type index_RbacSchemaDocument = RbacSchemaDocument;
133
152
  type index_RbacScopeType = RbacScopeType;
153
+ declare const index_SUPPORTED_BILLING_CURRENCIES: typeof SUPPORTED_BILLING_CURRENCIES;
154
+ type index_SupportedBillingCurrency = SupportedBillingCurrency;
134
155
  declare const index_USERNAME_MAX_LENGTH: typeof USERNAME_MAX_LENGTH;
135
156
  declare const index_USERNAME_MIN_LENGTH: typeof USERNAME_MIN_LENGTH;
136
157
  type index_UserFieldError = UserFieldError;
@@ -141,15 +162,17 @@ type index_UsernameValidationResult = UsernameValidationResult;
141
162
  type index_ValidatedUserFields = ValidatedUserFields;
142
163
  declare const index_analyzeRbacCoverage: typeof analyzeRbacCoverage;
143
164
  declare const index_assertRbacCoverage: typeof assertRbacCoverage;
165
+ declare const index_isSupportedBillingCurrency: typeof isSupportedBillingCurrency;
144
166
  declare const index_lengthInCodePoints: typeof lengthInCodePoints;
145
167
  declare const index_loadRbacSchemaDocuments: typeof loadRbacSchemaDocuments;
146
168
  declare const index_rbacArgPathProblem: typeof rbacArgPathProblem;
147
169
  declare const index_readRbacDirectiveArgs: typeof readRbacDirectiveArgs;
170
+ declare const index_validateBillingAmount: typeof validateBillingAmount;
148
171
  declare const index_validateName: typeof validateName;
149
172
  declare const index_validateUserFields: typeof validateUserFields;
150
173
  declare const index_validateUsername: typeof validateUsername;
151
174
  declare namespace index {
152
- export { index_DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS as DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS, index_DEFAULT_RBAC_ROOT_TYPES as DEFAULT_RBAC_ROOT_TYPES, index_NAME_MAX_LENGTH as NAME_MAX_LENGTH, index_NAME_MIN_LENGTH as NAME_MIN_LENGTH, type index_NameErrorCode as NameErrorCode, type index_NameValidationResult as NameValidationResult, index_RBAC_GATED_SCOPE_TYPES as RBAC_GATED_SCOPE_TYPES, index_RBAC_SCOPE_TYPES as RBAC_SCOPE_TYPES, index_RbacCoverageError as RbacCoverageError, type index_RbacCoverageOptions as RbacCoverageOptions, type index_RbacCoverageReport as RbacCoverageReport, type index_RbacCoverageSource as RbacCoverageSource, type index_RbacDirectiveArgs as RbacDirectiveArgs, type index_RbacFieldPin as RbacFieldPin, type index_RbacRootField as RbacRootField, type index_RbacSchemaDocument as RbacSchemaDocument, type index_RbacScopeType as RbacScopeType, index_USERNAME_MAX_LENGTH as USERNAME_MAX_LENGTH, index_USERNAME_MIN_LENGTH as USERNAME_MIN_LENGTH, type index_UserFieldError as UserFieldError, type index_UserFieldKey as UserFieldKey, type index_UserFieldsValidationResult as UserFieldsValidationResult, type index_UsernameErrorCode as UsernameErrorCode, type index_UsernameValidationResult as UsernameValidationResult, type index_ValidatedUserFields as ValidatedUserFields, index_analyzeRbacCoverage as analyzeRbacCoverage, index_assertRbacCoverage as assertRbacCoverage, index_lengthInCodePoints as lengthInCodePoints, index_loadRbacSchemaDocuments as loadRbacSchemaDocuments, index_rbacArgPathProblem as rbacArgPathProblem, index_readRbacDirectiveArgs as readRbacDirectiveArgs, index_validateName as validateName, index_validateUserFields as validateUserFields, index_validateUsername as validateUsername };
175
+ export { type index_BillingAmountErrorCode as BillingAmountErrorCode, type index_BillingAmountValidationResult as BillingAmountValidationResult, index_DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS as DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS, index_DEFAULT_RBAC_ROOT_TYPES as DEFAULT_RBAC_ROOT_TYPES, index_MAX_BILLING_AMOUNT as MAX_BILLING_AMOUNT, index_NAME_MAX_LENGTH as NAME_MAX_LENGTH, index_NAME_MIN_LENGTH as NAME_MIN_LENGTH, type index_NameErrorCode as NameErrorCode, type index_NameValidationResult as NameValidationResult, index_RBAC_GATED_SCOPE_TYPES as RBAC_GATED_SCOPE_TYPES, index_RBAC_SCOPE_TYPES as RBAC_SCOPE_TYPES, index_RbacCoverageError as RbacCoverageError, type index_RbacCoverageOptions as RbacCoverageOptions, type index_RbacCoverageReport as RbacCoverageReport, type index_RbacCoverageSource as RbacCoverageSource, type index_RbacDirectiveArgs as RbacDirectiveArgs, type index_RbacFieldPin as RbacFieldPin, type index_RbacRootField as RbacRootField, type index_RbacSchemaDocument as RbacSchemaDocument, type index_RbacScopeType as RbacScopeType, index_SUPPORTED_BILLING_CURRENCIES as SUPPORTED_BILLING_CURRENCIES, type index_SupportedBillingCurrency as SupportedBillingCurrency, index_USERNAME_MAX_LENGTH as USERNAME_MAX_LENGTH, index_USERNAME_MIN_LENGTH as USERNAME_MIN_LENGTH, type index_UserFieldError as UserFieldError, type index_UserFieldKey as UserFieldKey, type index_UserFieldsValidationResult as UserFieldsValidationResult, type index_UsernameErrorCode as UsernameErrorCode, type index_UsernameValidationResult as UsernameValidationResult, type index_ValidatedUserFields as ValidatedUserFields, index_analyzeRbacCoverage as analyzeRbacCoverage, index_assertRbacCoverage as assertRbacCoverage, index_isSupportedBillingCurrency as isSupportedBillingCurrency, index_lengthInCodePoints as lengthInCodePoints, index_loadRbacSchemaDocuments as loadRbacSchemaDocuments, index_rbacArgPathProblem as rbacArgPathProblem, index_readRbacDirectiveArgs as readRbacDirectiveArgs, index_validateBillingAmount as validateBillingAmount, index_validateName as validateName, index_validateUserFields as validateUserFields, index_validateUsername as validateUsername };
153
176
  }
154
177
 
155
- export { type RbacScopeType as A, loadRbacSchemaDocuments as B, rbacArgPathProblem as C, DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS as D, readRbacDirectiveArgs as E, NAME_MAX_LENGTH as N, RbacCoverageError as R, USERNAME_MAX_LENGTH as U, type ValidatedUserFields as V, NAME_MIN_LENGTH as a, type NameErrorCode as b, type NameValidationResult as c, type RbacCoverageOptions as d, type RbacCoverageReport as e, type RbacCoverageSource as f, USERNAME_MIN_LENGTH as g, type UserFieldError as h, type UserFieldKey as i, type UserFieldsValidationResult as j, type UsernameErrorCode as k, type UsernameValidationResult as l, index as m, analyzeRbacCoverage as n, assertRbacCoverage as o, lengthInCodePoints as p, validateUserFields as q, validateUsername as r, DEFAULT_RBAC_ROOT_TYPES as s, RBAC_GATED_SCOPE_TYPES as t, RBAC_SCOPE_TYPES as u, validateName as v, type RbacDirectiveArgs as w, type RbacFieldPin as x, type RbacRootField as y, type RbacSchemaDocument as z };
178
+ export { type RbacSchemaDocument as A, type BillingAmountErrorCode as B, type RbacScopeType as C, DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS as D, type SupportedBillingCurrency as E, isSupportedBillingCurrency as F, loadRbacSchemaDocuments as G, rbacArgPathProblem as H, readRbacDirectiveArgs as I, validateBillingAmount as J, MAX_BILLING_AMOUNT as M, NAME_MAX_LENGTH as N, RbacCoverageError as R, SUPPORTED_BILLING_CURRENCIES as S, USERNAME_MAX_LENGTH as U, type ValidatedUserFields as V, NAME_MIN_LENGTH as a, type NameErrorCode as b, type NameValidationResult as c, type RbacCoverageOptions as d, type RbacCoverageReport as e, type RbacCoverageSource as f, USERNAME_MIN_LENGTH as g, type UserFieldError as h, type UserFieldKey as i, type UserFieldsValidationResult as j, type UsernameErrorCode as k, type UsernameValidationResult as l, index as m, analyzeRbacCoverage as n, assertRbacCoverage as o, lengthInCodePoints as p, validateUserFields as q, validateUsername as r, type BillingAmountValidationResult as s, DEFAULT_RBAC_ROOT_TYPES as t, RBAC_GATED_SCOPE_TYPES as u, validateName as v, RBAC_SCOPE_TYPES as w, type RbacDirectiveArgs as x, type RbacFieldPin as y, type RbacRootField as z };
@@ -1,5 +1,5 @@
1
- import { B as BurdenoffGraphQLClient } from './graphql-BUbw43Zx.js';
2
- import { a as SDKContext } from './index-CV3r9Taj.js';
1
+ import { B as BurdenoffGraphQLClient } from './graphql-CEblo7lw.js';
2
+ import { a as SDKContext } from './index-7pTpoN3Q.js';
3
3
 
4
4
  declare enum NotificationChannel$1 {
5
5
  EMAIL = "EMAIL",
@@ -122,8 +122,11 @@ interface NotificationTemplate {
122
122
  interface NotificationStats {
123
123
  total: number;
124
124
  pending: number;
125
- queued: number;
126
- processing: number;
125
+ queued?: number;
126
+ processing?: number;
127
+ triggered: number;
128
+ scheduled: number;
129
+ cancelled: number;
127
130
  sent: number;
128
131
  delivered: number;
129
132
  failed: number;
@@ -134,9 +137,10 @@ declare class TenantNotificationsModule {
134
137
  private client;
135
138
  private context;
136
139
  constructor(client: BurdenoffGraphQLClient, context: SDKContext);
137
- send(input: SendNotificationInput): Promise<string>;
138
- sendWithTemplate(input: SendWithTemplateInput): Promise<string>;
139
- sendBatch(input: BatchNotificationInput): Promise<{
140
+ send(input: SendNotificationInput, context?: SDKContext): Promise<string>;
141
+ private createNotificationInput;
142
+ sendWithTemplate(input: SendWithTemplateInput, context?: SDKContext): Promise<string>;
143
+ sendBatch(input: BatchNotificationInput, context?: SDKContext): Promise<{
140
144
  totalRequested: number;
141
145
  totalQueued: number;
142
146
  totalFailed: number;
@@ -170,6 +174,7 @@ declare class TenantNotificationsModule {
170
174
  deleteNotifications(notificationIds: string[]): Promise<boolean>;
171
175
  deleteAllReadNotifications(): Promise<boolean>;
172
176
  private validateSendInput;
177
+ private validateDates;
173
178
  }
174
179
 
175
180
  type tenantNotifications_BatchNotificationInput = BatchNotificationInput;
@@ -210,6 +215,9 @@ interface SendNotificationOptions {
210
215
  appName?: string;
211
216
  email?: boolean;
212
217
  sms?: boolean;
218
+ metadata?: Record<string, unknown>;
219
+ data?: Record<string, unknown>;
220
+ expiresAt?: Date;
213
221
  }
214
222
  interface NotificationResponse {
215
223
  successCount: number;
@@ -306,4 +314,4 @@ declare class NotificationsModule {
306
314
  sendTemplateNotification(options: SendTemplateNotificationOptions): Promise<NotificationResponse>;
307
315
  }
308
316
 
309
- export { type GetNotificationsOptions as G, NotificationType as N, type RecipientInput as R, type SendChannelNotificationOptions as S, TenantNotificationsModule as T, NotificationsModule as a, type Notification as b, NotificationChannel as c, NotificationPriority as d, type NotificationResponse as e, type SendNotificationOptions as f, type SendTemplateNotificationOptions as g, tenantNotifications as t };
317
+ export { type BatchNotificationInput as B, type GetNotificationsOptions as G, NotificationType as N, type RecipientInput as R, type SendChannelNotificationOptions as S, TenantNotificationsModule as T, NotificationsModule as a, type Notification as b, NotificationChannel as c, NotificationPriority as d, type NotificationResponse as e, type SendNotificationOptions as f, type SendTemplateNotificationOptions as g, NotificationChannel$1 as h, NotificationType$1 as i, type SendNotificationInput as j, type SendWithTemplateInput as k, tenantNotifications as t };
@@ -1,7 +1,7 @@
1
- import { B as BurdenoffGraphQLClient } from './graphql-BUbw43Zx.js';
2
- import { a as SDKContext } from './index-CV3r9Taj.js';
1
+ import { B as BurdenoffGraphQLClient } from './graphql-CEblo7lw.js';
2
+ import { a as SDKContext } from './index-7pTpoN3Q.js';
3
3
  import { UsageMetricType } from './usage/index.js';
4
- import { N as NotificationType } from './index-BKOBmdq7.js';
4
+ import { N as NotificationType } from './index-BHe7zIVb.js';
5
5
  import { A as AssistantSessionAttribution } from './assistant-session-CJZhF4D6.js';
6
6
  import './explicit-activity-scope-CCoxVwAr.js';
7
7
 
@@ -1,4 +1,4 @@
1
- import { L as Logger, l as logger } from './index-Dtj9Eer3.js';
1
+ import { L as Logger, l as logger } from './index-KZ4OzW6D.js';
2
2
 
3
3
  interface InstrumentationFeatureFlags {
4
4
  tracing: boolean;
@@ -1,4 +1,4 @@
1
- import { a as SDKContext } from './index-CV3r9Taj.js';
1
+ import { a as SDKContext } from './index-7pTpoN3Q.js';
2
2
 
3
3
  declare function redactSensitiveString(value: string): string;
4
4
  declare function redactSensitiveFields<T>(value: T): T;
@@ -1,5 +1,5 @@
1
- import { B as BurdenoffGraphQLClient } from './graphql-BUbw43Zx.js';
2
- import { a as SDKContext } from './index-CV3r9Taj.js';
1
+ import { B as BurdenoffGraphQLClient } from './graphql-CEblo7lw.js';
2
+ import { a as SDKContext } from './index-7pTpoN3Q.js';
3
3
  import { M as ModuleGraphConfig, E as EntityGraphConfig, R as RegistryEntityRbacConfig, a as RelationshipGraphConfig, b as EntityBulkOperationsConfig, c as GraphEventType, d as GraphEvent, G as GraphEventEmitter, e as EdgeDocument, f as EntityEventType, g as EntityVertex, h as GraphMiddlewareConfig, P as ProductFacet, S as SearchFacets, i as SearchFilters, j as SearchResponse, k as SearchResult, T as TypeFacet, l as addGraphExtension } from './prisma-extension-gYhYriA0.js';
4
4
  import { P as PrismaClientBase } from './client-CCXpAZ2r.js';
5
5
  import { G as GraphEventEmitterImpl, E as EntityEventRbacMetadata } from './graph-emitter-r5TylDBm.js';
@@ -1,8 +1,8 @@
1
1
  import { S as ServiceLayer } from './layer-Cv9vSwBx.js';
2
2
  import { S as ShutdownDisposable } from './shutdown-registry-CW9LryO8.js';
3
3
  import { E as EntityEventRbacMetadata, a as EntityEventType$1, b as GraphEventEmitter$1, G as GraphEventEmitterImpl, c as createGraphEventEmitter$1, g as getGraphEventEmitter, r as resetGraphEventEmitter } from './graph-emitter-r5TylDBm.js';
4
- import { B as BurdenoffGraphQLClient } from './graphql-BUbw43Zx.js';
5
- import { a as SDKContext } from './index-CV3r9Taj.js';
4
+ import { B as BurdenoffGraphQLClient } from './graphql-CEblo7lw.js';
5
+ import { a as SDKContext } from './index-7pTpoN3Q.js';
6
6
 
7
7
  interface EventMessage$1<T = unknown> {
8
8
  id: string;
package/dist/index.d.ts CHANGED
@@ -1,21 +1,21 @@
1
- import { a as SDKContext, S as SDKConfig, E as EventQueueHealthStatus, T as TemporalHealthStatus, b as SDKHealthStatus, c as SDKShutdownOptions } from './index-CV3r9Taj.js';
2
- export { d as EventQueueSDKConfig, L as LoggerConfig, e as LoggerTransport } from './index-CV3r9Taj.js';
3
- import { L as Logger } from './index-Dtj9Eer3.js';
4
- export { i as Logger } from './index-Dtj9Eer3.js';
1
+ import { a as SDKContext, S as SDKConfig, E as EventQueueHealthStatus, T as TemporalHealthStatus, b as SDKHealthStatus, c as SDKShutdownOptions } from './index-7pTpoN3Q.js';
2
+ export { d as EventQueueSDKConfig, L as LoggerConfig, e as LoggerTransport } from './index-7pTpoN3Q.js';
3
+ import { L as Logger } from './index-KZ4OzW6D.js';
4
+ export { i as Logger } from './index-KZ4OzW6D.js';
5
5
  import { AuthModule } from './auth/index.js';
6
- import { T as TenantNotificationsModule, a as NotificationsModule } from './index-BKOBmdq7.js';
7
- export { t as Notifications } from './index-BKOBmdq7.js';
6
+ import { T as TenantNotificationsModule, a as NotificationsModule } from './index-BHe7zIVb.js';
7
+ export { t as Notifications } from './index-BHe7zIVb.js';
8
8
  import { RBACModule } from './rbac/index.js';
9
9
  export { LayerAwareRBACConfig, RBACDirectiveConfig, createRBACDirective, createRBACDirectiveForLayer, createRBACDirectiveFromEnv } from './rbac/index.js';
10
- import { A as ActivityModule, T as TrackerModule } from './index-DXPFlxpZ.js';
10
+ import { A as ActivityModule, T as TrackerModule } from './index-BV8hveh_.js';
11
11
  import { UsageModule } from './usage/index.js';
12
12
  export { BillingUsageClient, BillingUsageClientConfig, BillingUsageOperationInput, OrgBillingUsageOperationInput, QuotaLimit, WorkspaceBillingUsageOperationInput } from './usage/index.js';
13
13
  import { DatabaseConfig, DatabaseModule } from './database/index.js';
14
- import { E as EventsModule, I as IEventPublisher } from './index-JTx7ZQHe.js';
15
- export { i as EventQueue } from './index-JTx7ZQHe.js';
16
- import { G as GraphModule } from './index-3ZE1m-ZJ.js';
17
- export { i as Graph } from './index-3ZE1m-ZJ.js';
18
- import { B as BurdenoffGraphQLClient } from './graphql-BUbw43Zx.js';
14
+ import { E as EventsModule, I as IEventPublisher } from './index-zCx_euvK.js';
15
+ export { i as EventQueue } from './index-zCx_euvK.js';
16
+ import { G as GraphModule } from './index-XzbbMKe4.js';
17
+ export { i as Graph } from './index-XzbbMKe4.js';
18
+ import { B as BurdenoffGraphQLClient } from './graphql-CEblo7lw.js';
19
19
  import { TemporalModule } from './temporal/index.js';
20
20
  export { TemporalClient, TemporalClientConfig, TemporalClientFactory, TemporalWorker, TemporalWorkerConfig, TemporalWorkerFactory, TemporalWorkerManager, WorkflowStartOptions } from './temporal/index.js';
21
21
  export { createInternalClient, createInternalClientForTenant, createInternalClientForWorkspaces } from './client/internal-client.js';
@@ -35,14 +35,14 @@ export { i as I18n, I as I18nCapableContext, T as Translator, c as createTransla
35
35
  export { i as Export } from './index-CWmH_-RZ.js';
36
36
  export { i as Init } from './index-5x0XMKXN.js';
37
37
  export { i as DataLoader } from './index-DW9q22GH.js';
38
- export { i as Instrumentation } from './index-Coua7_P7.js';
38
+ export { i as Instrumentation } from './index-BioY0Ewz.js';
39
39
  export { i as Layer } from './index-ffmipXSA.js';
40
40
  export { i as Crypto } from './index-e_18DzAg.js';
41
41
  export { i as Gateway } from './index-BejbszA7.js';
42
42
  export { i as FeatureFlags } from './index--yvpa6ay.js';
43
43
  export { i as Captcha, R as RecaptchaVerifyOptions, a as RecaptchaVerifyResult, b as isCaptchaEnabled, v as verifyCaptcha, c as verifyCaptchaIfEnabled } from './index-B70b5mYS.js';
44
44
  export { i as Platform } from './index-D8HGwglK.js';
45
- export { N as NAME_MAX_LENGTH, a as NAME_MIN_LENGTH, b as NameErrorCode, c as NameValidationResult, R as RbacCoverageError, d as RbacCoverageOptions, e as RbacCoverageReport, f as RbacCoverageSource, U as USERNAME_MAX_LENGTH, g as USERNAME_MIN_LENGTH, h as UserFieldError, i as UserFieldKey, j as UserFieldsValidationResult, k as UsernameErrorCode, l as UsernameValidationResult, V as ValidatedUserFields, m as Validation, n as analyzeRbacCoverage, o as assertRbacCoverage, p as lengthInCodePoints, v as validateName, q as validateUserFields, r as validateUsername } from './index-qwG_TaUg.js';
45
+ export { N as NAME_MAX_LENGTH, a as NAME_MIN_LENGTH, b as NameErrorCode, c as NameValidationResult, R as RbacCoverageError, d as RbacCoverageOptions, e as RbacCoverageReport, f as RbacCoverageSource, U as USERNAME_MAX_LENGTH, g as USERNAME_MIN_LENGTH, h as UserFieldError, i as UserFieldKey, j as UserFieldsValidationResult, k as UsernameErrorCode, l as UsernameValidationResult, V as ValidatedUserFields, m as Validation, n as analyzeRbacCoverage, o as assertRbacCoverage, p as lengthInCodePoints, v as validateName, q as validateUserFields, r as validateUsername } from './index-B7dknayX.js';
46
46
  export { E as EmitGeneration, P as PRODUCT_RENAMES, a as PRODUCT_RENAME_EMIT, b as PRODUCT_SLUG_ALIASES, i as ProductAlias, c as ProductRename, R as RENAME_CONCERNS, d as RenameConcern, e as billingIdVariants, f as emitBillingId, g as emitName, h as emitProductSlug, j as emitQuotaKey, k as emitRbacResource, l as emitTemplateKey, m as isLegacyName, n as isSameBillingId, o as isSameGraphQLName, p as isSameName, q as isSameProductSlug, r as isSameQuotaKey, s as isSameRbacResource, t as isSameTemplateKey, u as nameVariants, v as normalizeBillingId, w as normalizeGraphQLName, x as normalizeProductSlug, y as normalizeQuotaKey, z as normalizeRbacResource, A as normalizeTemplateKey, B as productSlugVariants, C as quotaKeyVariants, D as rbacResourceVariants, F as readRenamedEnv, G as templateKeyVariants, H as toCurrentName, I as toLegacyName } from './index-BuAj5nXg.js';
47
47
  export { C as CircuitBreakerConfig, h as DEFAULT_CIRCUIT_BREAKER_CONFIG, i as DEFAULT_GATEWAY_RETRY_CONFIG, D as DEFAULT_GATEWAY_ROUTING, b as DEFAULT_LAYER_RESOURCES, c as DEFAULT_LAYER_STREAMS, f as GatewayRequestHeaders, g as GatewayRetryConfig, G as GatewayRoutingConfig, L as LayerConfig, a as LayerFullConfig, d as LayerGatewayConfig, e as LayerResourceUrls, S as ServiceLayer } from './layer-Cv9vSwBx.js';
48
48
  export { S as ShutdownDisposable, d as disposeAll, g as getRegisteredDisposableCount, r as registerDisposable, u as unregisterDisposable } from './shutdown-registry-CW9LryO8.js';
package/dist/index.js CHANGED
@@ -1,27 +1,27 @@
1
- export { NAME_MAX_LENGTH, NAME_MIN_LENGTH, RbacCoverageError, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, validation_exports as Validation, analyzeRbacCoverage, assertRbacCoverage, lengthInCodePoints, validateName, validateUserFields, validateUsername } from './chunk-WVOW3CJR.js';
2
- export { init_exports as Init } from './chunk-3MEZRD4Z.js';
1
+ export { NAME_MAX_LENGTH, NAME_MIN_LENGTH, RbacCoverageError, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, validation_exports as Validation, analyzeRbacCoverage, assertRbacCoverage, lengthInCodePoints, validateName, validateUserFields, validateUsername } from './chunk-I57LWBZU.js';
3
2
  export { sharing_exports as Sharing } from './chunk-DS3YMJ4X.js';
4
3
  export { tags_exports as Tags } from './chunk-OHUBPOZ6.js';
5
4
  export { TemporalClient, TemporalClientFactory, TemporalModule, TemporalWorker, TemporalWorkerFactory, TemporalWorkerManager } from './chunk-VXVLKRU6.js';
6
- import { ActivityModule, TrackerModule } from './chunk-3UKS6TPM.js';
7
- export { ActivityModule, TrackerModule } from './chunk-3UKS6TPM.js';
8
- import { UsageModule } from './chunk-CKL6U4XE.js';
9
- export { BillingUsageClient, UsageModule } from './chunk-CKL6U4XE.js';
10
- import { TenantNotificationsModule, NotificationsModule } from './chunk-INAZ3PKF.js';
11
- export { tenant_notifications_exports as Notifications, NotificationsModule } from './chunk-INAZ3PKF.js';
5
+ import { ActivityModule, TrackerModule } from './chunk-5ENWB2S6.js';
6
+ export { ActivityModule, TrackerModule } from './chunk-5ENWB2S6.js';
7
+ import { UsageModule } from './chunk-64QUSPYG.js';
8
+ export { BillingUsageClient, UsageModule } from './chunk-64QUSPYG.js';
9
+ import './chunk-TANAOLAV.js';
10
+ export { middleware_exports as Middleware } from './chunk-ELU7VL3E.js';
11
+ import { TenantNotificationsModule, NotificationsModule } from './chunk-23WAZL7I.js';
12
+ export { tenant_notifications_exports as Notifications, NotificationsModule } from './chunk-23WAZL7I.js';
12
13
  export { observability_exports as Observability } from './chunk-VAT66FJA.js';
13
14
  export { platform_exports as Platform } from './chunk-XXNT4VCM.js';
14
- export { prisma_exports as Prisma } from './chunk-WSAWJC4D.js';
15
- export { PRODUCT_RENAMES, PRODUCT_RENAME_EMIT, PRODUCT_SLUG_ALIASES, product_alias_exports as ProductAlias, RENAME_CONCERNS, billingIdVariants, emitBillingId, emitName, emitProductSlug, emitQuotaKey, emitRbacResource, emitTemplateKey, isLegacyName, isSameBillingId, isSameGraphQLName, isSameName, isSameProductSlug, isSameQuotaKey, isSameRbacResource, isSameTemplateKey, nameVariants, normalizeBillingId, normalizeGraphQLName, normalizeProductSlug, normalizeQuotaKey, normalizeRbacResource, normalizeTemplateKey, productSlugVariants, quotaKeyVariants, rbacResourceVariants, readRenamedEnv, templateKeyVariants, toCurrentName, toLegacyName } from './chunk-OBBCR6WY.js';
16
- import { RBACModule } from './chunk-PQGMZH6K.js';
17
- export { RBACModule, createRBACDirective, createRBACDirectiveForLayer, createRBACDirectiveFromEnv } from './chunk-PQGMZH6K.js';
18
- export { RESOURCE_CAP_DEFAULTS, ResourceCapExceededError, ResourceCapsModule, configureResourceCaps, getResourceCaps } from './chunk-MZCBEJ67.js';
19
- import './chunk-TANAOLAV.js';
15
+ export { prisma_exports as Prisma } from './chunk-QCOC2SF3.js';
20
16
  import './chunk-E4QNLVY4.js';
17
+ export { PRODUCT_RENAMES, PRODUCT_RENAME_EMIT, PRODUCT_SLUG_ALIASES, product_alias_exports as ProductAlias, RENAME_CONCERNS, billingIdVariants, emitBillingId, emitName, emitProductSlug, emitQuotaKey, emitRbacResource, emitTemplateKey, isLegacyName, isSameBillingId, isSameGraphQLName, isSameName, isSameProductSlug, isSameQuotaKey, isSameRbacResource, isSameTemplateKey, nameVariants, normalizeBillingId, normalizeGraphQLName, normalizeProductSlug, normalizeQuotaKey, normalizeRbacResource, normalizeTemplateKey, productSlugVariants, quotaKeyVariants, rbacResourceVariants, readRenamedEnv, templateKeyVariants, toCurrentName, toLegacyName } from './chunk-OBBCR6WY.js';
18
+ import { RBACModule } from './chunk-Y4N7N2G4.js';
19
+ export { RBACModule, createRBACDirective, createRBACDirectiveForLayer, createRBACDirectiveFromEnv } from './chunk-Y4N7N2G4.js';
21
20
  export { i18n_exports as I18n, createTranslator, getLanguage, getLocale, hasI18n, t } from './chunk-EBDHIL7V.js';
21
+ export { init_exports as Init } from './chunk-3MEZRD4Z.js';
22
+ export { RESOURCE_CAP_DEFAULTS, ResourceCapExceededError, ResourceCapsModule, configureResourceCaps, getResourceCaps } from './chunk-MZCBEJ67.js';
22
23
  export { instrumentation_exports as Instrumentation } from './chunk-E5DTAGCA.js';
23
24
  import './chunk-AWPNRV3L.js';
24
- export { middleware_exports as Middleware } from './chunk-ELU7VL3E.js';
25
25
  export { dataloader_exports as DataLoader } from './chunk-NUB5GQTU.js';
26
26
  export { export_exports as Export } from './chunk-3YG5JRS5.js';
27
27
  export { feature_flags_exports as FeatureFlags } from './chunk-UNASM5VJ.js';
@@ -35,8 +35,8 @@ import './chunk-VFCMR5GX.js';
35
35
  import { ContextManager } from './chunk-RZOFS2BQ.js';
36
36
  export { ContextManager } from './chunk-RZOFS2BQ.js';
37
37
  import { GatewayError, GatewayErrorType } from './chunk-4KK6YJ46.js';
38
- import { GraphModule } from './chunk-6XZ4ELHR.js';
39
- export { graph_exports as Graph, GraphModule } from './chunk-6XZ4ELHR.js';
38
+ import { GraphModule } from './chunk-7TOWWNHR.js';
39
+ export { graph_exports as Graph, GraphModule } from './chunk-7TOWWNHR.js';
40
40
  import './chunk-K52ICDCP.js';
41
41
  import { EventsModule } from './chunk-5M77HKFT.js';
42
42
  export { event_queue_exports as EventQueue, EventsModule } from './chunk-5M77HKFT.js';
@@ -47,19 +47,19 @@ export { graphql_exports as GraphQL } from './chunk-NGAGKLAM.js';
47
47
  import './chunk-MWPYA2HD.js';
48
48
  import './chunk-ENEDTQET.js';
49
49
  export { ai_credits_exports as AiCredits } from './chunk-JSEG3G5L.js';
50
- import { AuthModule } from './chunk-Q5MGYZHG.js';
51
- export { AuthModule } from './chunk-Q5MGYZHG.js';
50
+ import { AuthModule } from './chunk-YZIWBUIN.js';
51
+ export { AuthModule } from './chunk-YZIWBUIN.js';
52
52
  export { utils_exports as Utils } from './chunk-LA5KPWZ2.js';
53
53
  export { cache_exports as Cache } from './chunk-PAQK3YF2.js';
54
54
  import './chunk-A5F6Z5UE.js';
55
55
  import { disposeAll } from './chunk-KO2ZXZ7W.js';
56
56
  export { lifecycle_exports as Lifecycle, disposeAll, getRegisteredDisposableCount, registerDisposable, unregisterDisposable } from './chunk-KO2ZXZ7W.js';
57
- export { createInternalClient, createInternalClientForTenant, createInternalClientForWorkspaces } from './chunk-KJOSPVB2.js';
58
57
  export { captcha_exports as Captcha, isCaptchaEnabled, verifyCaptcha, verifyCaptchaIfEnabled } from './chunk-YMZEUTD2.js';
58
+ export { createInternalClient, createInternalClientForTenant, createInternalClientForWorkspaces } from './chunk-KJOSPVB2.js';
59
59
  export { crypto_exports as Crypto } from './chunk-SBS4S2PJ.js';
60
- import { DatabaseModule } from './chunk-UD5PPGVU.js';
61
- export { DatabaseModule } from './chunk-UD5PPGVU.js';
62
- import { APIError, NetworkError, TimeoutError, ValidationError } from './chunk-QGBXVNRM.js';
60
+ import { DatabaseModule } from './chunk-DXTBH7IW.js';
61
+ export { DatabaseModule } from './chunk-DXTBH7IW.js';
62
+ import { APIError, NetworkError, TimeoutError, ValidationError } from './chunk-5SIL5AG2.js';
63
63
  export { DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_GATEWAY_RETRY_CONFIG, DEFAULT_GATEWAY_ROUTING, DEFAULT_LAYER_RESOURCES, DEFAULT_LAYER_STREAMS } from './chunk-5CAFHK2Z.js';
64
64
  import { logger } from './chunk-RU266375.js';
65
65
  export { logger_exports as Logger } from './chunk-RU266375.js';
@@ -172,6 +172,9 @@ var BurdenoffGraphQLClient = class {
172
172
  if (mergedContext.productId) {
173
173
  headers["x-product-id"] = mergedContext.productId;
174
174
  }
175
+ if (mergedContext.organizationId) {
176
+ headers["x-org-id"] = mergedContext.organizationId;
177
+ }
175
178
  try {
176
179
  const response = await this.tenantGateway.crossLayerQuery({
177
180
  query,