@burdenoff/be-sdk 2026.1101.3 → 2026.1102.1
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/README.md +39 -0
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +2 -2
- package/dist/cache/index.js +2 -2
- package/dist/{chunk-INAZ3PKF.js → chunk-23WAZL7I.js} +232 -135
- package/dist/chunk-23WAZL7I.js.map +1 -0
- package/dist/{chunk-QGBXVNRM.js → chunk-5SIL5AG2.js} +2 -2
- package/dist/chunk-5SIL5AG2.js.map +1 -0
- package/dist/{chunk-CKL6U4XE.js → chunk-64QUSPYG.js} +3 -3
- package/dist/{chunk-CKL6U4XE.js.map → chunk-64QUSPYG.js.map} +1 -1
- package/dist/{chunk-RAHVPZAA.js → chunk-6SDWH4OM.js} +96 -12
- package/dist/chunk-6SDWH4OM.js.map +1 -0
- package/dist/{chunk-6XZ4ELHR.js → chunk-7TOWWNHR.js} +3 -3
- package/dist/{chunk-6XZ4ELHR.js.map → chunk-7TOWWNHR.js.map} +1 -1
- package/dist/{chunk-UD5PPGVU.js → chunk-DXTBH7IW.js} +3 -3
- package/dist/{chunk-UD5PPGVU.js.map → chunk-DXTBH7IW.js.map} +1 -1
- package/dist/{chunk-4YPW6NMW.js → chunk-PAQK3YF2.js} +3 -3
- package/dist/{chunk-4YPW6NMW.js.map → chunk-PAQK3YF2.js.map} +1 -1
- package/dist/{chunk-7OAEY6FG.js → chunk-Q5H45UXV.js} +3 -3
- package/dist/{chunk-7OAEY6FG.js.map → chunk-Q5H45UXV.js.map} +1 -1
- package/dist/{chunk-QCOC2SF3.js → chunk-WSAWJC4D.js} +3 -3
- package/dist/{chunk-QCOC2SF3.js.map → chunk-WSAWJC4D.js.map} +1 -1
- package/dist/{chunk-QHSAIVEB.js → chunk-XUS3NXR5.js} +8 -8
- package/dist/{chunk-QHSAIVEB.js.map → chunk-XUS3NXR5.js.map} +1 -1
- package/dist/{chunk-PQGMZH6K.js → chunk-Y4N7N2G4.js} +3 -3
- package/dist/{chunk-PQGMZH6K.js.map → chunk-Y4N7N2G4.js.map} +1 -1
- package/dist/{chunk-Q5MGYZHG.js → chunk-YZIWBUIN.js} +3 -3
- package/dist/{chunk-Q5MGYZHG.js.map → chunk-YZIWBUIN.js.map} +1 -1
- package/dist/database/index.js +2 -2
- package/dist/event-queue/index.d.ts +3 -3
- package/dist/export/index.js +2 -2
- package/dist/gateway/index.js +2 -2
- package/dist/gateway/security/index.js +1 -1
- package/dist/graph/index.d.ts +3 -3
- package/dist/graph/index.js +2 -2
- package/dist/{graphql-BUbw43Zx.d.ts → graphql-CEblo7lw.d.ts} +1 -1
- package/dist/{index-CV3r9Taj.d.ts → index-7pTpoN3Q.d.ts} +1 -0
- package/dist/{index-BKOBmdq7.d.ts → index-BHe7zIVb.d.ts} +16 -8
- package/dist/{index-DXPFlxpZ.d.ts → index-BV8hveh_.d.ts} +3 -3
- package/dist/{index-Coua7_P7.d.ts → index-BioY0Ewz.d.ts} +1 -1
- package/dist/{index-Dtj9Eer3.d.ts → index-KZ4OzW6D.d.ts} +1 -1
- package/dist/{index-3ZE1m-ZJ.d.ts → index-XzbbMKe4.d.ts} +2 -2
- package/dist/{index-JTx7ZQHe.d.ts → index-zCx_euvK.d.ts} +2 -2
- package/dist/index.d.ts +13 -13
- package/dist/index.js +37 -34
- package/dist/index.js.map +1 -1
- package/dist/init/index.js +2 -2
- package/dist/instrumentation/index.d.ts +3 -3
- package/dist/logger/index.d.ts +2 -2
- package/dist/notifications/index.d.ts +3 -3
- package/dist/notifications/index.js +2 -2
- package/dist/prisma/index.js +2 -2
- package/dist/rbac/index.d.ts +2 -2
- package/dist/rbac/index.js +2 -2
- package/dist/resource-caps/index.d.ts +2 -2
- package/dist/telemetry/index.d.ts +4 -4
- package/dist/tracker/index.d.ts +4 -4
- package/dist/tracker/index.js +7 -7
- package/dist/usage/index.d.ts +2 -2
- package/dist/usage/index.js +4 -4
- package/package.json +3 -3
- package/dist/chunk-INAZ3PKF.js.map +0 -1
- package/dist/chunk-QGBXVNRM.js.map +0 -1
- package/dist/chunk-RAHVPZAA.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,QAA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c;AACzE,IAAA,MAAMjB,OAAAA,GAAU,IAAA,CAAKD,WAAAA,CAAYV,KAAAA,CAAAA;AACjC,IAAA,IAAI,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,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,CAAKC,KAAAA,CAAMC,IAAAA,CAAKH,GAAAA,KAAQ,GAAA,CAAA;AACpC,IAAA,OAAOnB,OAAAA,CAAQkB,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"]}
|
package/dist/database/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { DatabaseModule, closeClickHouseConnection, createTable, executeQuery, getClickHouseClient, getClickHouseStats, insertData, testClickHouseConnection } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
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-
|
|
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-
|
|
5
|
+
import '../graphql-CEblo7lw.js';
|
|
6
6
|
import 'graphql-request';
|
|
7
|
-
import '../index-
|
|
7
|
+
import '../index-7pTpoN3Q.js';
|
package/dist/export/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { BaseModuleExporter, PaginationService, convertToCSV, csvToJSON, estimateCSVSize, getCSVHeaders, parseCSV, triggerExportJob } from '../chunk-3YG5JRS5.js';
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
2
|
+
import '../chunk-Q5H45UXV.js';
|
|
3
|
+
import '../chunk-6SDWH4OM.js';
|
|
4
4
|
import '../chunk-ZWKJKL6Y.js';
|
|
5
5
|
import '../chunk-FZRODKIN.js';
|
|
6
6
|
import '../chunk-STWFX5E2.js';
|
package/dist/gateway/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { DELEGATED_AUTHORIZATION_HEADER, buildDelegatedGatewayHeaders } from '../chunk-
|
|
2
|
-
export { security_exports as Security } from '../chunk-
|
|
1
|
+
export { DELEGATED_AUTHORIZATION_HEADER, buildDelegatedGatewayHeaders } from '../chunk-Q5H45UXV.js';
|
|
2
|
+
export { security_exports as Security } from '../chunk-6SDWH4OM.js';
|
|
3
3
|
export { GatewayClient, createGatewayClient, createGatewayClientFromEnv, isGatewayClientError } from '../chunk-ZWKJKL6Y.js';
|
|
4
4
|
import '../chunk-FZRODKIN.js';
|
|
5
5
|
import '../chunk-STWFX5E2.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DEFAULT_ARMOR_CONFIG, DEFAULT_COST_MAP, DEFAULT_TIERS, MemoryValkey, __resetMetricsForTest, __setSecurityValkeyForTest, buildSecurityPlugins, checkRateLimit, createArmorPlugins, createOperationTimeoutPlugin, createOtelPlugin, createQueryComplexityPlugin, createRateLimitPlugin, getMetrics, getSecurityValkey, initializeMetrics, initializeOtel, initializeSecurityValkey, mergeCostMap, resolveActor, resolveSecurityOptionsFromEnv, resolveTiersFromEnv, scrapeMetrics, shutdownOtel } from '../../chunk-
|
|
1
|
+
export { DEFAULT_ARMOR_CONFIG, DEFAULT_COST_MAP, DEFAULT_TIERS, MemoryValkey, __resetMetricsForTest, __setSecurityValkeyForTest, buildSecurityPlugins, checkRateLimit, createArmorPlugins, createOperationTimeoutPlugin, createOtelPlugin, createQueryComplexityPlugin, createRateLimitPlugin, getMetrics, getSecurityValkey, initializeMetrics, initializeOtel, initializeSecurityValkey, mergeCostMap, resolveActor, resolveSecurityOptionsFromEnv, resolveTiersFromEnv, scrapeMetrics, shutdownOtel } from '../../chunk-6SDWH4OM.js';
|
|
2
2
|
import '../../chunk-FZRODKIN.js';
|
|
3
3
|
import '../../chunk-RU266375.js';
|
|
4
4
|
import '../../chunk-XE4OXN2W.js';
|
package/dist/graph/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import '../graphql-
|
|
2
|
-
import '../index-
|
|
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-
|
|
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';
|
package/dist/graph/index.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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
|
-
import { B as BurdenoffGraphQLClient } from './graphql-
|
|
2
|
-
import { a as SDKContext } from './index-
|
|
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
|
|
126
|
-
processing
|
|
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
|
-
|
|
139
|
-
|
|
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-
|
|
2
|
-
import { a as SDKContext } from './index-
|
|
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-
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { B as BurdenoffGraphQLClient } from './graphql-
|
|
2
|
-
import { a as SDKContext } from './index-
|
|
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-
|
|
5
|
-
import { a as SDKContext } from './index-
|
|
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-
|
|
2
|
-
export { d as EventQueueSDKConfig, L as LoggerConfig, e as LoggerTransport } from './index-
|
|
3
|
-
import { L as Logger } from './index-
|
|
4
|
-
export { i as Logger } from './index-
|
|
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-
|
|
7
|
-
export { t as Notifications } from './index-
|
|
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-
|
|
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-
|
|
15
|
-
export { i as EventQueue } from './index-
|
|
16
|
-
import { G as GraphModule } from './index-
|
|
17
|
-
export { i as Graph } from './index-
|
|
18
|
-
import { B as BurdenoffGraphQLClient } from './graphql-
|
|
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,7 +35,7 @@ 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-
|
|
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';
|
package/dist/index.js
CHANGED
|
@@ -1,33 +1,41 @@
|
|
|
1
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';
|
|
2
3
|
export { sharing_exports as Sharing } from './chunk-DS3YMJ4X.js';
|
|
3
4
|
export { tags_exports as Tags } from './chunk-OHUBPOZ6.js';
|
|
4
5
|
export { TemporalClient, TemporalClientFactory, TemporalModule, TemporalWorker, TemporalWorkerFactory, TemporalWorkerManager } from './chunk-VXVLKRU6.js';
|
|
5
|
-
import { ActivityModule, TrackerModule } from './chunk-
|
|
6
|
-
export { ActivityModule, TrackerModule } from './chunk-
|
|
7
|
-
import { UsageModule } from './chunk-
|
|
8
|
-
export { BillingUsageClient, UsageModule } from './chunk-
|
|
9
|
-
import './chunk-
|
|
10
|
-
export {
|
|
11
|
-
import { TenantNotificationsModule, NotificationsModule } from './chunk-INAZ3PKF.js';
|
|
12
|
-
export { tenant_notifications_exports as Notifications, NotificationsModule } from './chunk-INAZ3PKF.js';
|
|
6
|
+
import { ActivityModule, TrackerModule } from './chunk-XUS3NXR5.js';
|
|
7
|
+
export { ActivityModule, TrackerModule } from './chunk-XUS3NXR5.js';
|
|
8
|
+
import { UsageModule } from './chunk-64QUSPYG.js';
|
|
9
|
+
export { BillingUsageClient, UsageModule } from './chunk-64QUSPYG.js';
|
|
10
|
+
import { TenantNotificationsModule, NotificationsModule } from './chunk-23WAZL7I.js';
|
|
11
|
+
export { tenant_notifications_exports as Notifications, NotificationsModule } from './chunk-23WAZL7I.js';
|
|
13
12
|
export { observability_exports as Observability } from './chunk-VAT66FJA.js';
|
|
14
|
-
import { RBACModule } from './chunk-PQGMZH6K.js';
|
|
15
|
-
export { RBACModule, createRBACDirective, createRBACDirectiveForLayer, createRBACDirectiveFromEnv } from './chunk-PQGMZH6K.js';
|
|
16
13
|
export { platform_exports as Platform } from './chunk-XXNT4VCM.js';
|
|
17
|
-
export { prisma_exports as Prisma } from './chunk-
|
|
18
|
-
import './chunk-E4QNLVY4.js';
|
|
14
|
+
export { prisma_exports as Prisma } from './chunk-WSAWJC4D.js';
|
|
19
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';
|
|
20
|
-
|
|
21
|
-
export {
|
|
16
|
+
import { RBACModule } from './chunk-Y4N7N2G4.js';
|
|
17
|
+
export { RBACModule, createRBACDirective, createRBACDirectiveForLayer, createRBACDirectiveFromEnv } from './chunk-Y4N7N2G4.js';
|
|
22
18
|
export { RESOURCE_CAP_DEFAULTS, ResourceCapExceededError, ResourceCapsModule, configureResourceCaps, getResourceCaps } from './chunk-MZCBEJ67.js';
|
|
19
|
+
import './chunk-TANAOLAV.js';
|
|
20
|
+
import './chunk-E4QNLVY4.js';
|
|
21
|
+
export { i18n_exports as I18n, createTranslator, getLanguage, getLocale, hasI18n, t } from './chunk-EBDHIL7V.js';
|
|
23
22
|
export { instrumentation_exports as Instrumentation } from './chunk-E5DTAGCA.js';
|
|
24
23
|
import './chunk-AWPNRV3L.js';
|
|
25
|
-
export {
|
|
24
|
+
export { middleware_exports as Middleware } from './chunk-ELU7VL3E.js';
|
|
26
25
|
export { export_exports as Export } from './chunk-3YG5JRS5.js';
|
|
27
26
|
export { feature_flags_exports as FeatureFlags } from './chunk-UNASM5VJ.js';
|
|
28
27
|
export { files_exports as Files } from './chunk-LCDECFJJ.js';
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
export { gateway_exports as Gateway } from './chunk-Q5H45UXV.js';
|
|
29
|
+
import './chunk-6SDWH4OM.js';
|
|
30
|
+
import { GatewayClient } from './chunk-ZWKJKL6Y.js';
|
|
31
|
+
import './chunk-FZRODKIN.js';
|
|
32
|
+
export { layer_exports as Layer } from './chunk-STWFX5E2.js';
|
|
33
|
+
import './chunk-VFCMR5GX.js';
|
|
34
|
+
import { ContextManager } from './chunk-RZOFS2BQ.js';
|
|
35
|
+
export { ContextManager } from './chunk-RZOFS2BQ.js';
|
|
36
|
+
import { GatewayError, GatewayErrorType } from './chunk-4KK6YJ46.js';
|
|
37
|
+
import { GraphModule } from './chunk-7TOWWNHR.js';
|
|
38
|
+
export { graph_exports as Graph, GraphModule } from './chunk-7TOWWNHR.js';
|
|
31
39
|
import './chunk-K52ICDCP.js';
|
|
32
40
|
import { EventsModule } from './chunk-5M77HKFT.js';
|
|
33
41
|
export { event_queue_exports as EventQueue, EventsModule } from './chunk-5M77HKFT.js';
|
|
@@ -37,32 +45,24 @@ import { resolveEventStreamsUrl } from './chunk-KS2HQCJR.js';
|
|
|
37
45
|
export { graphql_exports as GraphQL } from './chunk-NGAGKLAM.js';
|
|
38
46
|
import './chunk-MWPYA2HD.js';
|
|
39
47
|
import './chunk-ENEDTQET.js';
|
|
40
|
-
export {
|
|
41
|
-
import './chunk-RAHVPZAA.js';
|
|
42
|
-
import { GatewayClient } from './chunk-ZWKJKL6Y.js';
|
|
43
|
-
import './chunk-FZRODKIN.js';
|
|
44
|
-
export { layer_exports as Layer } from './chunk-STWFX5E2.js';
|
|
45
|
-
import './chunk-VFCMR5GX.js';
|
|
46
|
-
import { ContextManager } from './chunk-RZOFS2BQ.js';
|
|
47
|
-
export { ContextManager } from './chunk-RZOFS2BQ.js';
|
|
48
|
-
import { GatewayError, GatewayErrorType } from './chunk-4KK6YJ46.js';
|
|
48
|
+
export { captcha_exports as Captcha, isCaptchaEnabled, verifyCaptcha, verifyCaptchaIfEnabled } from './chunk-YMZEUTD2.js';
|
|
49
49
|
export { ai_credits_exports as AiCredits } from './chunk-JSEG3G5L.js';
|
|
50
|
-
import { AuthModule } from './chunk-
|
|
51
|
-
export { AuthModule } from './chunk-
|
|
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
|
-
export { cache_exports as Cache } from './chunk-
|
|
53
|
+
export { cache_exports as Cache } from './chunk-PAQK3YF2.js';
|
|
54
|
+
import './chunk-A5F6Z5UE.js';
|
|
54
55
|
import { disposeAll } from './chunk-KO2ZXZ7W.js';
|
|
55
56
|
export { lifecycle_exports as Lifecycle, disposeAll, getRegisteredDisposableCount, registerDisposable, unregisterDisposable } from './chunk-KO2ZXZ7W.js';
|
|
56
|
-
import './chunk-A5F6Z5UE.js';
|
|
57
|
-
export { captcha_exports as Captcha, isCaptchaEnabled, verifyCaptcha, verifyCaptchaIfEnabled } from './chunk-YMZEUTD2.js';
|
|
58
57
|
export { createInternalClient, createInternalClientForTenant, createInternalClientForWorkspaces } from './chunk-KJOSPVB2.js';
|
|
59
58
|
export { crypto_exports as Crypto } from './chunk-SBS4S2PJ.js';
|
|
60
|
-
import { DatabaseModule } from './chunk-
|
|
61
|
-
export { DatabaseModule } from './chunk-
|
|
62
|
-
import { APIError, NetworkError, TimeoutError, ValidationError } from './chunk-
|
|
59
|
+
import { DatabaseModule } from './chunk-DXTBH7IW.js';
|
|
60
|
+
export { DatabaseModule } from './chunk-DXTBH7IW.js';
|
|
61
|
+
import { APIError, NetworkError, TimeoutError, ValidationError } from './chunk-5SIL5AG2.js';
|
|
63
62
|
export { DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_GATEWAY_RETRY_CONFIG, DEFAULT_GATEWAY_ROUTING, DEFAULT_LAYER_RESOURCES, DEFAULT_LAYER_STREAMS } from './chunk-5CAFHK2Z.js';
|
|
64
63
|
import { logger } from './chunk-RU266375.js';
|
|
65
64
|
export { logger_exports as Logger } from './chunk-RU266375.js';
|
|
65
|
+
export { dataloader_exports as DataLoader } from './chunk-NUB5GQTU.js';
|
|
66
66
|
import { __name } from './chunk-XE4OXN2W.js';
|
|
67
67
|
import { GraphQLClient } from 'graphql-request';
|
|
68
68
|
|
|
@@ -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,
|