@burdenoff/be-sdk 2026.1112.1 → 2026.1114.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/dist/activity/index.d.ts +2 -2
- package/dist/ai-credits/index.d.ts +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/bootstrap/index.d.ts +1 -1
- package/dist/cache/index.d.ts +1 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/event-queue/index.d.ts +1 -1
- package/dist/export/index.d.ts +1 -1
- package/dist/export/index.js +1 -1
- package/dist/{export-DJXE3Osa.js → export-lqKewsuF.js} +2 -2
- package/dist/{export-DJXE3Osa.js.map → export-lqKewsuF.js.map} +1 -1
- package/dist/files/index.d.ts +1 -1
- package/dist/gateway/index.d.ts +3 -3
- package/dist/gateway/index.js +2 -2
- package/dist/gateway-2en8Gx_a.js +274 -0
- package/dist/gateway-2en8Gx_a.js.map +1 -0
- package/dist/graph/index.d.ts +1 -1
- package/dist/{graphql-CUDyhibV.d.ts → graphql-C8jKLLel.d.ts} +1 -1
- package/dist/{index-B2LCaK0R.d.ts → index-479i3w77.d.ts} +1 -1
- package/dist/{index-BGzMYJsm.d.ts → index-8pUSoT85.d.ts} +1 -1
- package/dist/{index-ADmsX0BI.d.ts → index-9MJVKzWA.d.ts} +3 -3
- package/dist/{index-FbXPfen7.d.ts → index-BJwHEzpN.d.ts} +1 -1
- package/dist/{index-CTTwo9av.d.ts → index-BTaQMEgB.d.ts} +1 -1
- package/dist/{index-CDOqxSIi.d.ts → index-Base-sg5.d.ts} +1 -1
- package/dist/{index-C_GXXF32.d.ts → index-Bh6W5JO4.d.ts} +3 -3
- package/dist/{index-BeVtqGO-.d.ts → index-Bwn5Z1h-.d.ts} +1 -1
- package/dist/{index-FRRaa6h2.d.ts → index-CEtULfb_.d.ts} +3 -3
- package/dist/{index-DqbGqfAy.d.ts → index-Cwu5Mpji.d.ts} +1 -1
- package/dist/{index-CaM9JUcc.d.ts → index-DSynXDRD.d.ts} +1 -1
- package/dist/{index-CVCyKzhB.d.ts → index-DWER4-_x.d.ts} +3 -3
- package/dist/{index-cmR9k9ga.d.ts → index-DhFP_AIB.d.ts} +1 -1
- package/dist/{index-zd_NPGJo.d.ts → index-DqpCL9kD.d.ts} +4 -4
- package/dist/{index-U_tu3zUl.d.ts → index-Dw_0wE4q.d.ts} +2 -2
- package/dist/{index-3KOZ1zN9.d.ts → index-HeUeEsMU.d.ts} +1 -1
- package/dist/{index-Cot73bdh.d.ts → index-KlrnELrN.d.ts} +1 -1
- package/dist/{index-MArCb8Aq.d.ts → index-SvWwlTUC.d.ts} +1 -1
- package/dist/{index-CHwMhK6v.d.ts → index-YMGOJins.d.ts} +2 -2
- package/dist/index-oJMtR3nl.d.ts +88 -0
- package/dist/index.d.ts +21 -21
- package/dist/index.js +5 -5
- package/dist/init/index.d.ts +1 -1
- package/dist/init/index.js +1 -1
- package/dist/{init-CQPFmOOe.js → init-D814LeLF.js} +2 -2
- package/dist/{init-CQPFmOOe.js.map → init-D814LeLF.js.map} +1 -1
- package/dist/instrumentation/index.d.ts +2 -2
- package/dist/layer/index.d.ts +2 -2
- package/dist/layer-Bcix-WCl.js.map +1 -1
- package/dist/{layer-BZBZZWeV.d.ts → layer-C0zxAUgR.d.ts} +1 -0
- package/dist/logger/index.d.ts +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/payments/index.d.ts +2 -2
- package/dist/rbac/index.d.ts +1 -1
- package/dist/resource-caps/index.d.ts +1 -1
- package/dist/search/index.d.ts +2 -2
- package/dist/security/index.d.ts +1 -1
- package/dist/security/rate-limit/index.d.ts +1 -1
- package/dist/tags/index.d.ts +1 -1
- package/dist/telemetry/index.d.ts +2 -2
- package/dist/temporal/index.d.ts +1 -1
- package/dist/tracker/index.d.ts +2 -2
- package/dist/tracker/index.js +2 -2
- package/dist/{tracker-PQztSlhJ.js → tracker-Cl3cGKe-.js} +2 -2
- package/dist/{tracker-PQztSlhJ.js.map → tracker-Cl3cGKe-.js.map} +1 -1
- package/dist/translation/index.d.ts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/{types-C6EKaS3V.d.ts → types-gJ9Qqi9E.d.ts} +1 -1
- package/dist/usage/index.d.ts +1 -1
- package/dist/usage/index.js +1 -1
- package/dist/{usage-BRqVP3CJ.js → usage-ygkKsxdd.js} +2 -2
- package/dist/{usage-BRqVP3CJ.js.map → usage-ygkKsxdd.js.map} +1 -1
- package/package.json +3 -3
- package/dist/gateway-ByVo-n37.js +0 -50
- package/dist/gateway-ByVo-n37.js.map +0 -1
- package/dist/index-YOShAwkq.d.ts +0 -45
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway-2en8Gx_a.js","names":[],"sources":["../src/gateway/delegated-transport.ts","../src/gateway/proactive-identity.ts","../src/gateway/index.ts"],"sourcesContent":["/**\n * Delegated gateway transport (BOFF-9962).\n *\n * A service that must call the platform as \"agent X acting for user Y\" does\n * not set actor or consent headers itself: internal gateways strip those.\n * Instead it obtains a short-lived `app_as_user` token from global-auth\n * (`issueAppAsUserTokenInternal`) and presents it on the internal gateway's\n * `x-delegated-authorization` header. The gateway verifies the signature,\n * checks revocation and the grant's workspace bounds, and only then forwards\n * the represented user as the actor together with `x-verified-delegation`.\n *\n * @module gateway/delegated-transport\n */\n\nimport type { GatewayRequestHeaders } from '../types/layer.js';\n\n/** Header an internal gateway reads a delegated `app_as_user` bearer from. */\nexport const DELEGATED_AUTHORIZATION_HEADER = 'x-delegated-authorization';\n\nexport interface DelegatedGatewayTransportInput {\n /** Signed `app_as_user` access token issued by global-auth. */\n appAsUserToken: string;\n /** Workspace the call targets; must be inside the grant's workspace bounds. */\n workspaceId?: string;\n}\n\nconst JWT_SEGMENT = /^[A-Za-z0-9_-]+$/;\n\nfunction isCompactJwt(token: string): boolean {\n const segments = token.split('.');\n return segments.length === 3 && segments.every((segment) => JWT_SEGMENT.test(segment));\n}\n\n/**\n * Builds the request headers for a delegated internal-gateway call, for use as\n * `GatewayClient.internalQuery({ query, headers })`.\n *\n * @throws Error when the token is not a compact JWS (so a malformed value can\n * never be smuggled into a header) or the workspace id is blank.\n */\nexport function buildDelegatedGatewayHeaders(input: DelegatedGatewayTransportInput): GatewayRequestHeaders {\n const token = input.appAsUserToken;\n if (typeof token !== 'string' || token.length === 0 || token.length > 8192 || !isCompactJwt(token)) {\n throw new Error('Delegated gateway transport requires a compact app_as_user token');\n }\n const headers: GatewayRequestHeaders = {\n [DELEGATED_AUTHORIZATION_HEADER]: `Bearer ${token}`,\n };\n if (input.workspaceId !== undefined) {\n const workspaceId = input.workspaceId.trim();\n if (workspaceId.length === 0 || workspaceId !== input.workspaceId) {\n throw new Error('Delegated gateway transport requires a non-blank workspace id');\n }\n headers['x-workspace-id'] = workspaceId;\n }\n return headers;\n}\n","/**\n * Proactive assistant identity (BOFF-13161, Contract C2 of BOFF-13159).\n *\n * A background proactive assistant reads a product AS a user, read-only, and\n * only after the user opted in. global-auth-svc owns the identity: one\n * service-managed BOT app per product (`proactive-assistant-<product>`), the\n * user's consent as an AppUserDelegation with scopes `[\"delegation:read\"]`\n * per workspace for 30 days, and a short-lived `app_as_user` read token. The\n * gateways refuse every mutation and subscription such a token sends\n * (FORBIDDEN / DELEGATION_READ_ONLY, Contract C1).\n *\n * These helpers call global-auth's internal, service-only fields over the\n * global internal gateway, signed as the calling service. Only the proactive\n * orchestrator service (wspace-sandbox-svc) is accepted by global-auth.\n *\n * Trust boundary: pass the user the calling service authenticated itself (the\n * gateway-verified actor of its own self-scoped request), never an id taken\n * from job input, a model's output or any other untrusted text.\n *\n * @example\n * ```ts\n * import {\n * buildDelegatedGatewayHeaders,\n * createGatewayClientFromEnv,\n * issueProactiveReadToken,\n * } from '@burdenoff/be-sdk/gateway';\n *\n * const { token } = await issueProactiveReadToken({ product: 'fluidgrids', userId, workspaceId });\n * // Read as the user through the internal gateway; a mutation is refused there.\n * await createGatewayClientFromEnv().internalQuery({\n * query: '{ workflows { id name } }',\n * headers: buildDelegatedGatewayHeaders({ appAsUserToken: token, workspaceId }),\n * });\n * ```\n *\n * @module gateway/proactive-identity\n */\n\nimport { GatewayClient } from './client.js';\nimport { GatewayError, type GraphQLError, type GraphQLRequestOptions, type GraphQLResponse } from './types.js';\n\n/** The only scope a proactive consent or read token carries. */\nexport const PROACTIVE_READ_SCOPE = 'delegation:read';\n\n/** Client id of a product's proactive assistant app. */\nexport function proactiveAssistantClientId(product: string): string {\n return `proactive-assistant-${product.trim().toLowerCase()}`;\n}\n\n/**\n * Why a proactive identity call failed. `CONSENT_MISSING` means the user has\n * no live consent for the workspace (never granted, revoked or expired);\n * `UNAVAILABLE` means global-auth could not be reached or gave no answer. Any\n * other value is the GraphQL error code global-auth refused with.\n */\nexport type ProactiveIdentityErrorCode = string;\n\nexport class ProactiveIdentityError extends Error {\n constructor(\n message: string,\n readonly code: ProactiveIdentityErrorCode\n ) {\n super(message);\n this.name = 'ProactiveIdentityError';\n }\n}\n\n/** Whether `error` is the refusal for a user without live consent. */\nexport function isProactiveConsentMissing(error: unknown): boolean {\n return error instanceof ProactiveIdentityError && error.code === 'CONSENT_MISSING';\n}\n\n/** Whose consent, for which product and workspace. */\nexport interface ProactiveIdentityTarget {\n /** Product slug, e.g. `fluidgrids`. */\n product: string;\n /** The user the assistant reads as; see the trust boundary above. */\n userId: string;\n /** The workspace (UUID) the consent and token are bound to. */\n workspaceId: string;\n}\n\nexport interface IssueProactiveReadTokenInput extends ProactiveIdentityTarget {\n /** Token lifetime in seconds, 60 to 900; default 900 (15 minutes). */\n ttlSeconds?: number;\n}\n\nexport interface RevokeProactiveConsentInput extends ProactiveIdentityTarget {\n /** Recorded on the audit entry. */\n reason?: string;\n}\n\n/** A read-only `app_as_user` token, for `buildDelegatedGatewayHeaders`. */\nexport interface ProactiveReadToken {\n token: string;\n expiresAt: Date;\n}\n\n/** A user's consent state for one product and workspace. */\nexport interface ProactiveConsent {\n product: string;\n clientId: string;\n userId: string;\n workspaceId: string;\n granted: boolean;\n /** When the consent ends; null when it is not granted. */\n expiresAt: Date | null;\n}\n\n/** The part of a gateway client these helpers use. */\nexport type ProactiveIdentityClient = {\n crossLayerQuery<T = unknown>(options: GraphQLRequestOptions): Promise<GraphQLResponse<T>>;\n};\n\nexport interface ProactiveIdentityOptions {\n /**\n * Gateway client to call global-auth with. Default: a client signed as this\n * service (`SERVICE_IDENTITY`, else `SERVICE_NAME`) bound to\n * `GLOBAL_INT_GATEWAY_URL` (else `GLOBAL_PUBLIC_GATEWAY_URL`).\n */\n client?: ProactiveIdentityClient;\n /** Request timeout in milliseconds for the default client. Default 10 s. */\n timeoutMs?: number;\n /**\n * The calling service's identity, sent as `x-service-name` so the internal\n * gateway names the service as the actor (global-auth accepts only the\n * proactive orchestrator). Default: `SERVICE_IDENTITY`, else `SERVICE_NAME`.\n */\n serviceIdentity?: string;\n}\n\n/**\n * GraphQL codes that describe an unavailable dependency rather than a decision\n * by global-auth; the gateways mask an unreachable subgraph with these.\n */\nconst UNAVAILABLE_CODES = new Set([\n 'INTERNAL_SERVER_ERROR',\n 'SERVICE_UNAVAILABLE',\n 'AUTH_SERVICE_UNAVAILABLE',\n 'DOWNSTREAM_SERVICE_ERROR',\n 'GATEWAY_TIMEOUT',\n]);\n\nconst DEFAULT_TIMEOUT_MS = 10_000;\n\nfunction codeOf(error: GraphQLError): string | null {\n const code = error.extensions?.['code'];\n return typeof code === 'string' ? code : null;\n}\n\n/** The refusal carried by a GraphQL error, or null when it is not a decision. */\nfunction refusalOf(errors: readonly GraphQLError[] | undefined): ProactiveIdentityError | null {\n const first = errors?.[0];\n if (!first) return null;\n const code = codeOf(first);\n if (!code || UNAVAILABLE_CODES.has(code)) return null;\n return new ProactiveIdentityError(first.message, code);\n}\n\nfunction cloudflareAccessHeaders(): Record<string, string> {\n const id = process.env['CF_ACCESS_CLIENT_ID'];\n const secret = process.env['CF_ACCESS_CLIENT_SECRET'];\n return id && secret ? { 'cf-access-client-id': id, 'cf-access-client-secret': secret } : {};\n}\n\nfunction envServiceIdentity(): string | undefined {\n return (process.env['SERVICE_IDENTITY'] || process.env['SERVICE_NAME'])?.trim() || undefined;\n}\n\nfunction defaultClient(timeoutMs: number, identity: string | undefined): ProactiveIdentityClient {\n const url = (process.env['GLOBAL_INT_GATEWAY_URL'] || process.env['GLOBAL_PUBLIC_GATEWAY_URL'])?.trim();\n if (!url) {\n throw new ProactiveIdentityError('No global gateway is configured (GLOBAL_INT_GATEWAY_URL)', 'UNAVAILABLE');\n }\n if (!identity) {\n throw new ProactiveIdentityError('SERVICE_IDENTITY or SERVICE_NAME is required to sign the call', 'UNAVAILABLE');\n }\n const layer = process.env['SERVICE_LAYER'] === 'global' ? 'global' : 'wspace';\n return new GatewayClient({\n layer,\n serviceName: identity,\n serviceIdentity: identity,\n crossLayerGatewayUrl: url,\n timeout: timeoutMs,\n });\n}\n\nfunction requireTarget(input: ProactiveIdentityTarget): void {\n for (const [name, value] of Object.entries({\n product: input.product,\n userId: input.userId,\n workspaceId: input.workspaceId,\n })) {\n if (typeof value !== 'string' || value.trim().length === 0) {\n throw new ProactiveIdentityError(`${name} is required`, 'BAD_USER_INPUT');\n }\n }\n}\n\n/**\n * Call one global-auth field as this service. The call is never retried and\n * bypasses the circuit breaker: a refusal must surface at once, and the\n * callers fail closed.\n */\nasync function call<T>(\n query: string,\n variables: Record<string, unknown>,\n field: string,\n options: ProactiveIdentityOptions\n): Promise<T> {\n const identity = options.serviceIdentity?.trim() || envServiceIdentity();\n const client = options.client ?? defaultClient(options.timeoutMs ?? DEFAULT_TIMEOUT_MS, identity);\n let response: GraphQLResponse<Record<string, T | null>>;\n try {\n response = await client.crossLayerQuery<Record<string, T | null>>({\n query,\n variables,\n // No x-actor-id: on a service token it would mean \"on behalf of\". The\n // internal gateway takes the actor from x-service-name instead.\n headers: {\n 'x-actor-type': 'service',\n ...(identity ? { 'x-service-name': identity } : {}),\n ...cloudflareAccessHeaders(),\n },\n skipRetry: true,\n skipCircuitBreaker: true,\n });\n } catch (error) {\n // The internal gateway maps unknown error codes (CONSENT_MISSING) to HTTP\n // statuses, so a refusal often arrives as a thrown GatewayError.\n const refusal = error instanceof GatewayError ? refusalOf(error.graphqlErrors) : null;\n if (refusal) throw refusal;\n throw new ProactiveIdentityError(\n `global-auth is unreachable: ${error instanceof Error ? error.message : String(error)}`,\n 'UNAVAILABLE'\n );\n }\n if (response.errors?.length) {\n throw (\n refusalOf(response.errors) ??\n new ProactiveIdentityError(response.errors[0]?.message ?? 'global-auth failed', 'UNAVAILABLE')\n );\n }\n const data = response.data?.[field];\n if (data === undefined || data === null) {\n throw new ProactiveIdentityError(`global-auth returned no ${field}`, 'EMPTY_RESPONSE');\n }\n return data;\n}\n\ninterface RawConsent {\n product: string;\n clientId: string;\n userId: string;\n workspaceId: string;\n granted: boolean;\n expiresAt: string | null;\n}\n\nconst CONSENT_FIELDS = 'product clientId userId workspaceId granted expiresAt';\n\nfunction toConsent(raw: RawConsent): ProactiveConsent {\n return { ...raw, expiresAt: raw.expiresAt ? new Date(raw.expiresAt) : null };\n}\n\n/**\n * Mint a read-only `app_as_user` token (scope `delegation:read`, bound to the\n * workspace, 15 minutes by default and never past the consent) for the\n * product's proactive assistant acting as the user. Use it with\n * `buildDelegatedGatewayHeaders`.\n *\n * @throws ProactiveIdentityError with code `CONSENT_MISSING` when the user has\n * no live consent for the workspace, or another code when the call failed.\n */\nexport async function issueProactiveReadToken(\n input: IssueProactiveReadTokenInput,\n options: ProactiveIdentityOptions = {}\n): Promise<ProactiveReadToken> {\n requireTarget(input);\n const minted = await call<{ token: string; expiresAt: string }>(\n `mutation IssueProactiveReadToken($input: IssueProactiveReadTokenInternalInput!) {\n issueProactiveReadTokenInternal(input: $input) { token expiresAt }\n }`,\n {\n input: {\n product: input.product,\n userId: input.userId,\n workspaceId: input.workspaceId,\n ...(input.ttlSeconds === undefined ? {} : { ttlSeconds: input.ttlSeconds }),\n },\n },\n 'issueProactiveReadTokenInternal',\n options\n );\n const expiresAt = new Date(minted.expiresAt);\n if (typeof minted.token !== 'string' || minted.token.length === 0 || Number.isNaN(expiresAt.getTime())) {\n throw new ProactiveIdentityError('global-auth returned a malformed read token', 'EMPTY_RESPONSE');\n }\n return { token: minted.token, expiresAt };\n}\n\n/**\n * Record or renew the user's opt-in to the product's proactive assistant for\n * one workspace (30 days from now).\n */\nexport async function grantProactiveConsent(\n input: ProactiveIdentityTarget,\n options: ProactiveIdentityOptions = {}\n): Promise<ProactiveConsent> {\n requireTarget(input);\n const raw = await call<RawConsent>(\n `mutation GrantProactiveConsent($input: ProactiveConsentInternalInput!) {\n grantProactiveConsentInternal(input: $input) { ${CONSENT_FIELDS} }\n }`,\n { input: { product: input.product, userId: input.userId, workspaceId: input.workspaceId } },\n 'grantProactiveConsentInternal',\n options\n );\n return toConsent(raw);\n}\n\n/**\n * Withdraw the user's opt-in for one workspace. Tokens already minted for it\n * stop verifying at the gateways. False when there was nothing to withdraw.\n */\nexport async function revokeProactiveConsent(\n input: RevokeProactiveConsentInput,\n options: ProactiveIdentityOptions = {}\n): Promise<boolean> {\n requireTarget(input);\n return call<boolean>(\n `mutation RevokeProactiveConsent($input: RevokeProactiveConsentInternalInput!) {\n revokeProactiveConsentInternal(input: $input)\n }`,\n {\n input: {\n product: input.product,\n userId: input.userId,\n workspaceId: input.workspaceId,\n ...(input.reason === undefined ? {} : { reason: input.reason }),\n },\n },\n 'revokeProactiveConsentInternal',\n options\n );\n}\n\n/** The user's current consent state for the product and workspace. */\nexport async function getProactiveConsent(\n input: ProactiveIdentityTarget,\n options: ProactiveIdentityOptions = {}\n): Promise<ProactiveConsent> {\n requireTarget(input);\n const raw = await call<RawConsent>(\n `query ProactiveConsent($input: ProactiveConsentInternalInput!) {\n proactiveConsentInternal(input: $input) { ${CONSENT_FIELDS} }\n }`,\n { input: { product: input.product, userId: input.userId, workspaceId: input.workspaceId } },\n 'proactiveConsentInternal',\n options\n );\n return toConsent(raw);\n}\n","/**\n * Gateway Module\n *\n * Provides unified gateway client for layer-aware M2M communication\n * with circuit breaker and retry logic.\n *\n * @module gateway\n * @category Gateway\n *\n * @example\n * ```typescript\n * import { GatewayClient, createGatewayClientFromEnv } from '@burdenoff/be-sdk/gateway';\n *\n * // Create from environment variables\n * const client = createGatewayClientFromEnv();\n *\n * // Or create manually\n * const client = new GatewayClient({\n * layer: 'wspace',\n * serviceName: 'wspace-tags-svc',\n * });\n *\n * // Internal call (same layer, uses int-gateway with bypass)\n * const internalResult = await client.internalQuery({\n * query: `query { getTag(id: \"123\") { id name } }`,\n * });\n *\n * // Cross-layer call (via public gateway)\n * const crossLayerResult = await client.crossLayerQuery({\n * query: `query { getCurrentUser { id email } }`,\n * });\n * ```\n */\n\n// Client exports\nexport { GatewayClient, createGatewayClient, createGatewayClientFromEnv, isGatewayClientError } from './client.js';\n\n// Service-JWT minting for cross-layer M2M auth. Exposed so non-GatewayClient\n// callers (e.g. bespoke graphql-request clients) can authenticate identically.\nexport { signServiceJwt } from './service-jwt.js';\n\n// Delegated internal-gateway transport (BOFF-9962): call as an agent acting\n// for a user by presenting a verified app_as_user token, never raw headers.\nexport {\n buildDelegatedGatewayHeaders,\n DELEGATED_AUTHORIZATION_HEADER,\n type DelegatedGatewayTransportInput,\n} from './delegated-transport.js';\n\n// Proactive assistant identity (BOFF-13161): opt-in, read-only consent and the\n// short-lived delegation:read token to use with buildDelegatedGatewayHeaders.\nexport {\n getProactiveConsent,\n grantProactiveConsent,\n isProactiveConsentMissing,\n issueProactiveReadToken,\n PROACTIVE_READ_SCOPE,\n proactiveAssistantClientId,\n ProactiveIdentityError,\n revokeProactiveConsent,\n type IssueProactiveReadTokenInput,\n type ProactiveConsent,\n type ProactiveIdentityClient,\n type ProactiveIdentityErrorCode,\n type ProactiveIdentityOptions,\n type ProactiveIdentityTarget,\n type ProactiveReadToken,\n type RevokeProactiveConsentInput,\n} from './proactive-identity.js';\n\n// Type exports\nexport {\n CircuitState,\n GatewayErrorType,\n GatewayError,\n type GatewayClientConfig,\n type GraphQLRequestOptions,\n type GraphQLResponse,\n type GraphQLError,\n type IGatewayClient,\n type ICircuitBreaker,\n type CircuitBreakerStats,\n type GatewayClientHealth,\n type RequestContext,\n} from './types.js';\n\n// Gateway-side security plugin stack (for public gateways).\n// Imported by consumers as `@burdenoff/be-sdk/gateway/security` — this\n// re-export lets `@burdenoff/be-sdk/gateway` also resolve the namespace.\nexport * as Security from './security/index.js';\n"],"mappings":";;;;;;;;AAiBA,MAAa,iCAAiC;AAS9C,MAAM,cAAc;AAEpB,SAAS,aAAa,OAAwB;CAC5C,MAAM,WAAW,MAAM,MAAM,GAAG;CAChC,OAAO,SAAS,WAAW,KAAK,SAAS,OAAO,YAAY,YAAY,KAAK,OAAO,CAAC;AACvF;;;;;;;;AASA,SAAgB,6BAA6B,OAA8D;CACzG,MAAM,QAAQ,MAAM;CACpB,IAAI,OAAO,UAAU,YAAY,MAAM,WAAW,KAAK,MAAM,SAAS,QAAQ,CAAC,aAAa,KAAK,GAC/F,MAAM,IAAI,MAAM,kEAAkE;CAEpF,MAAM,UAAiC,GACpC,iCAAiC,UAAU,QAC9C;CACA,IAAI,MAAM,gBAAgB,QAAW;EACnC,MAAM,cAAc,MAAM,YAAY,KAAK;EAC3C,IAAI,YAAY,WAAW,KAAK,gBAAgB,MAAM,aACpD,MAAM,IAAI,MAAM,+DAA+D;EAEjF,QAAQ,oBAAoB;CAC9B;CACA,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACdA,MAAa,uBAAuB;;AAGpC,SAAgB,2BAA2B,SAAyB;CAClE,OAAO,uBAAuB,QAAQ,KAAK,CAAC,CAAC,YAAY;AAC3D;AAUA,IAAa,yBAAb,cAA4C,MAAM;CAGrC;CAFX,YACE,SACA,AAAS,MACT;EACA,MAAM,OAAO;EAFJ;EAGT,KAAK,OAAO;CACd;AACF;;AAGA,SAAgB,0BAA0B,OAAyB;CACjE,OAAO,iBAAiB,0BAA0B,MAAM,SAAS;AACnE;;;;;AAiEA,MAA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AAM,WAAW;CAC3E,EACF,GACA,mCACA,OACF;CACA,MAAM,YAAY,IAAI,KAAK,OAAO,SAAS;CAC3C,IAAI,OAAO,OAAO,UAAU,YAAY,OAAO,MAAM,WAAW,KAAK,OAAO,MAAM,UAAU,QAAQ,CAAC,GACnG,MAAM,IAAI,uBAAuB,+CAA+C,gBAAgB;CAElG,OAAO;EAAE,OAAO,OAAO;EAAO;CAAU;AAC1C;;;;;AAMA,eAAsB,sBACpB,OACA,UAAoC,CAAC,GACV;CAC3B,cAAc,KAAK;CASnB,OAAO,UAAU,MARC,KAChB;uDACmD,eAAe;QAElE,EAAE,OAAO;EAAE,SAAS,MAAM;EAAS,QAAQ,MAAM;EAAQ,aAAa,MAAM;CAAY,EAAE,GAC1F,iCACA,OACF,CACoB;AACtB;;;;;AAMA,eAAsB,uBACpB,OACA,UAAoC,CAAC,GACnB;CAClB,cAAc,KAAK;CACnB,OAAO,KACL;;QAGA,EACE,OAAO;EACL,SAAS,MAAM;EACf,QAAQ,MAAM;EACd,aAAa,MAAM;EACnB,GAAI,MAAM,WAAW,SAAY,CAAC,IAAI,EAAE,QAAQ,MAAM,OAAO;CAC/D,EACF,GACA,kCACA,OACF;AACF;;AAGA,eAAsB,oBACpB,OACA,UAAoC,CAAC,GACV;CAC3B,cAAc,KAAK;CASnB,OAAO,UAAU,MARC,KAChB;kDAC8C,eAAe;QAE7D,EAAE,OAAO;EAAE,SAAS,MAAM;EAAS,QAAQ,MAAM;EAAQ,aAAa,MAAM;CAAY,EAAE,GAC1F,4BACA,OACF,CACoB;AACtB"}
|
package/dist/graph/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { _ as SearchResponse, a as EdgeDocument, c as EntityVertex, d as ModuleGraphConfig, f as ProductFacet, g as SearchFilters, h as SearchFacets, i as addGraphExtension, l as GraphEvent, m as RelationshipGraphConfig, n as GraphEventEmitter, o as EntityBulkOperationsConfig, r as GraphMiddlewareConfig, s as EntityGraphConfig, t as EntityEventType, u as GraphEventType, v as SearchResult, y as TypeFacet } from "../prisma-extension-Cfl09swM.js";
|
|
2
|
-
import { $ as createGraphEventsHelper, A as GraphSchema, B as GraphExportService, C as defineGraphConfig, Ct as shouldSyncRelationship, D as EntityEventHook, E as EntityEventContext, F as RelationshipExportData, G as createRelationshipFromEntity, H as GraphRelationshipExport, I as defineModuleGraph, J as GraphEventPublishOptions, K as EntityEventData, L as EntityFetcher, M as ModuleGraphDefinition, N as RelationshipDefinition, O as EntityRbacConfig, P as RelationshipEventData, Q as GraphRelationshipData, R as GraphEntityExport, S as defineEntity, St as shouldSyncEntity, T as EntityDefinition, U as RelationshipFetcher, V as GraphExportServiceConfig, W as createGraphExportService, X as GraphEventsHelperConfig, Y as GraphEventsHelper, Z as GraphEventsPublisher, _ as DefineGraphConfigOptions, _t as createRelationshipEvent, a as GraphNode, at as createPrismaGraphIntegration, b as STANDARD_FIELDS, bt as getCollectionForEntity, c as TraverseOptions, ct as ExtractedRelationshipData, d as InitializeGraphOptions, dt as GenericGraphConfig, et as getGraphEventsPublisher, f as getGraphStats, ft as GenericRelationshipConfig, g as DefineEntityConfigOptions, gt as createEntityEvent, h as AUDIT_FIELDS, ht as ValidationErrorType, i as GraphModule, it as PrismaGraphIntegrationOptions, j as ModuleGraph, k as GraphEventOptions, l as TraverseResult, lt as FieldMapper, m as isGraphInitialized, mt as GraphValidationResult, n as CreateNodeOptions, nt as withDeferredGraphEvents, o as QueryGraphOptions, ot as EntityRbacConfig$1, p as initializeGraph, pt as GraphValidationError, q as GraphEntityConfig, r as GraphEdge, rt as PrismaGraphIntegration, s as TraverseDirection, st as ExtractedEntityData, t as CreateEdgeOptions, tt as DeferredGraphResult, ut as GenericEntityConfig, v as DefineRelationshipConfigOptions, vt as extractEntityTitle, w as defineRelationship, wt as GraphRegistry, x as TENANT_FIELDS, xt as parseRelationship, y as SOFT_DELETE_FIELDS, yt as extractMinimalFields, z as GraphExportResponse } from "../index-
|
|
2
|
+
import { $ as createGraphEventsHelper, A as GraphSchema, B as GraphExportService, C as defineGraphConfig, Ct as shouldSyncRelationship, D as EntityEventHook, E as EntityEventContext, F as RelationshipExportData, G as createRelationshipFromEntity, H as GraphRelationshipExport, I as defineModuleGraph, J as GraphEventPublishOptions, K as EntityEventData, L as EntityFetcher, M as ModuleGraphDefinition, N as RelationshipDefinition, O as EntityRbacConfig, P as RelationshipEventData, Q as GraphRelationshipData, R as GraphEntityExport, S as defineEntity, St as shouldSyncEntity, T as EntityDefinition, U as RelationshipFetcher, V as GraphExportServiceConfig, W as createGraphExportService, X as GraphEventsHelperConfig, Y as GraphEventsHelper, Z as GraphEventsPublisher, _ as DefineGraphConfigOptions, _t as createRelationshipEvent, a as GraphNode, at as createPrismaGraphIntegration, b as STANDARD_FIELDS, bt as getCollectionForEntity, c as TraverseOptions, ct as ExtractedRelationshipData, d as InitializeGraphOptions, dt as GenericGraphConfig, et as getGraphEventsPublisher, f as getGraphStats, ft as GenericRelationshipConfig, g as DefineEntityConfigOptions, gt as createEntityEvent, h as AUDIT_FIELDS, ht as ValidationErrorType, i as GraphModule, it as PrismaGraphIntegrationOptions, j as ModuleGraph, k as GraphEventOptions, l as TraverseResult, lt as FieldMapper, m as isGraphInitialized, mt as GraphValidationResult, n as CreateNodeOptions, nt as withDeferredGraphEvents, o as QueryGraphOptions, ot as EntityRbacConfig$1, p as initializeGraph, pt as GraphValidationError, q as GraphEntityConfig, r as GraphEdge, rt as PrismaGraphIntegration, s as TraverseDirection, st as ExtractedEntityData, t as CreateEdgeOptions, tt as DeferredGraphResult, ut as GenericEntityConfig, v as DefineRelationshipConfigOptions, vt as extractEntityTitle, w as defineRelationship, wt as GraphRegistry, x as TENANT_FIELDS, xt as parseRelationship, y as SOFT_DELETE_FIELDS, yt as extractMinimalFields, z as GraphExportResponse } from "../index-9MJVKzWA.js";
|
|
3
3
|
export { AUDIT_FIELDS, CreateEdgeOptions, CreateNodeOptions, type DeferredGraphResult, type DefineEntityConfigOptions, type DefineGraphConfigOptions, type DefineRelationshipConfigOptions, type EdgeDocument, type EntityBulkOperationsConfig, type EntityDefinition, type EntityEventContext, type EntityEventData, type EntityEventHook, type EntityEventType, type EntityFetcher, type EntityGraphConfig, type EntityRbacConfig, type EntityVertex, type ExtractedEntityData, type ExtractedRelationshipData, type FieldMapper, type GenericEntityConfig, type EntityRbacConfig$1 as GenericEntityRbacConfig, type GenericGraphConfig, type GenericRelationshipConfig, GraphEdge, type GraphEntityConfig, type GraphEntityExport, type GraphEvent, type GraphEventEmitter, type GraphEventOptions, type GraphEventPublishOptions, type GraphEventType, type GraphEventsHelper, type GraphEventsHelperConfig, GraphEventsPublisher, type GraphExportResponse, GraphExportService, type GraphExportServiceConfig, type GraphMiddlewareConfig, GraphModule, GraphNode, GraphRegistry, type GraphRelationshipData, type GraphRelationshipExport, type GraphSchema, type GraphValidationError, type GraphValidationResult, type InitializeGraphOptions, type ModuleGraph, type ModuleGraphConfig, type ModuleGraphDefinition, type PrismaGraphIntegration, type PrismaGraphIntegrationOptions, type ProductFacet, QueryGraphOptions, type RelationshipDefinition, type RelationshipEventData, type RelationshipExportData, type RelationshipFetcher, type RelationshipGraphConfig, SOFT_DELETE_FIELDS, STANDARD_FIELDS, type SearchFacets, type SearchFilters, type SearchResponse, type SearchResult, TENANT_FIELDS, TraverseDirection, TraverseOptions, TraverseResult, type TypeFacet, type ValidationErrorType, addGraphExtension, createEntityEvent, createGraphEventsHelper, createGraphExportService, createPrismaGraphIntegration, createRelationshipEvent, createRelationshipFromEntity, defineEntity, defineGraphConfig, defineModuleGraph, defineRelationship, extractEntityTitle, extractMinimalFields, getCollectionForEntity, getGraphEventsPublisher, getGraphStats, initializeGraph, isGraphInitialized, parseRelationship, shouldSyncEntity, shouldSyncRelationship, withDeferredGraphEvents };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as GraphQLRequestOptions, l as GraphQLResponse, s as GraphQLError } from "./types-
|
|
1
|
+
import { c as GraphQLRequestOptions, l as GraphQLResponse, s as GraphQLError } from "./types-gJ9Qqi9E.js";
|
|
2
2
|
declare const FILE_ACTOR_TYPES: readonly ["user", "app", "service", "super_admin"];
|
|
3
3
|
type FileActorType = (typeof FILE_ACTOR_TYPES)[number];
|
|
4
4
|
interface FileActor {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { p as SDKContext } from "./index-
|
|
2
|
-
import { t as BurdenoffGraphQLClient } from "./graphql-
|
|
1
|
+
import { p as SDKContext } from "./index-BTaQMEgB.js";
|
|
2
|
+
import { t as BurdenoffGraphQLClient } from "./graphql-C8jKLLel.js";
|
|
3
3
|
import { n as PrismaClientBase } from "./client-BgAEvDC2.js";
|
|
4
|
-
import { Mt as GraphEventEmitterImpl, kt as EntityEventRbacMetadata } from "./index-
|
|
4
|
+
import { Mt as GraphEventEmitterImpl, kt as EntityEventRbacMetadata } from "./index-CEtULfb_.js";
|
|
5
5
|
import { _ as SearchResponse, a as EdgeDocument, c as EntityVertex, d as ModuleGraphConfig, f as ProductFacet, g as SearchFilters, h as SearchFacets, i as addGraphExtension, l as GraphEvent, m as RelationshipGraphConfig, n as GraphEventEmitter, o as EntityBulkOperationsConfig, p as RegistryEntityRbacConfig, r as GraphMiddlewareConfig, s as EntityGraphConfig, t as EntityEventType, u as GraphEventType, v as SearchResult, y as TypeFacet } from "./prisma-extension-Cfl09swM.js";
|
|
6
6
|
interface ResolvedEntityGraphConfig extends Omit<EntityGraphConfig, 'fields'> {
|
|
7
7
|
fields: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as DEFAULT_LAYER_RESOURCES, d as LayerFullConfig, f as LayerGatewayConfig, i as DEFAULT_GATEWAY_ROUTING, l as GatewayRoutingConfig, m as ServiceLayer, o as DEFAULT_LAYER_STREAMS, p as LayerResourceUrls, u as LayerConfig } from "./layer-
|
|
1
|
+
import { a as DEFAULT_LAYER_RESOURCES, d as LayerFullConfig, f as LayerGatewayConfig, i as DEFAULT_GATEWAY_ROUTING, l as GatewayRoutingConfig, m as ServiceLayer, o as DEFAULT_LAYER_STREAMS, p as LayerResourceUrls, u as LayerConfig } from "./layer-C0zxAUgR.js";
|
|
2
2
|
declare namespace index_d_exports {
|
|
3
3
|
export { DEFAULT_GATEWAY_ROUTING, DEFAULT_LAYER_RESOURCES, DEFAULT_LAYER_STREAMS, GatewayRoutingConfig, LayerConfig, LayerFullConfig, LayerGatewayConfig, LayerManager, LayerResourceUrls, ServiceLayer, createLayerManagerFromEnv, detectLayerFromServiceName, getGatewayUrlForLayer, validateLayerConfig };
|
|
4
4
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as BurdenoffGraphQLClient } from "./graphql-
|
|
2
|
-
import { p as SDKContext } from "./index-
|
|
3
|
-
import { m as ServiceLayer } from "./layer-
|
|
1
|
+
import { t as BurdenoffGraphQLClient } from "./graphql-C8jKLLel.js";
|
|
2
|
+
import { p as SDKContext } from "./index-BTaQMEgB.js";
|
|
3
|
+
import { m as ServiceLayer } from "./layer-C0zxAUgR.js";
|
|
4
4
|
type MaybePromise<T> = Promise<T> | T;
|
|
5
5
|
type AsyncIterableIteratorOrValue<T> = T | AsyncIterableIterator<T>;
|
|
6
6
|
type Maybe<T> = T | null | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { m as ServiceLayer } from "./layer-
|
|
1
|
+
import { m as ServiceLayer } from "./layer-C0zxAUgR.js";
|
|
2
2
|
import { n as ShutdownDisposable } from "./index-Dt1HJPTX.js";
|
|
3
|
-
import { t as BurdenoffGraphQLClient } from "./graphql-
|
|
4
|
-
import { p as SDKContext } from "./index-
|
|
3
|
+
import { t as BurdenoffGraphQLClient } from "./graphql-C8jKLLel.js";
|
|
4
|
+
import { p as SDKContext } from "./index-BTaQMEgB.js";
|
|
5
5
|
interface EventMessage$1<T = unknown> {
|
|
6
6
|
id: string;
|
|
7
7
|
subject: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as ServiceLayer } from "./layer-
|
|
1
|
+
import { m as ServiceLayer } from "./layer-C0zxAUgR.js";
|
|
2
2
|
import { Client, WorkflowHandle } from "@temporalio/client";
|
|
3
3
|
import { Duration } from "@temporalio/common";
|
|
4
4
|
type WorkflowSearchAttributes = Record<string, unknown>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as BurdenoffGraphQLClient } from "./graphql-
|
|
2
|
-
import { m as SDKError, p as SDKContext } from "./index-
|
|
3
|
-
import {
|
|
1
|
+
import { t as BurdenoffGraphQLClient } from "./graphql-C8jKLLel.js";
|
|
2
|
+
import { m as SDKError, p as SDKContext } from "./index-BTaQMEgB.js";
|
|
3
|
+
import { S as GatewayClient } from "./index-oJMtR3nl.js";
|
|
4
4
|
interface BillingUsageOperationInput {
|
|
5
5
|
quotaName: string;
|
|
6
6
|
value?: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as BurdenoffGraphQLClient } from "./graphql-
|
|
2
|
-
import { p as SDKContext } from "./index-
|
|
1
|
+
import { t as BurdenoffGraphQLClient } from "./graphql-C8jKLLel.js";
|
|
2
|
+
import { p as SDKContext } from "./index-BTaQMEgB.js";
|
|
3
3
|
import { ActivitySeverity, ActivityType } from "./activity/index.js";
|
|
4
|
-
import { p as UsageMetricType } from "./index-
|
|
5
|
-
import { a as NotificationType } from "./index-
|
|
4
|
+
import { p as UsageMetricType } from "./index-DWER4-_x.js";
|
|
5
|
+
import { a as NotificationType } from "./index-Dw_0wE4q.js";
|
|
6
6
|
import { o as AssistantSessionAttribution } from "./assistant-session-DA5ZKJOr.js";
|
|
7
7
|
interface TrackingEvent {
|
|
8
8
|
eventType: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as BurdenoffGraphQLClient } from "./graphql-
|
|
2
|
-
import { p as SDKContext } from "./index-
|
|
1
|
+
import { t as BurdenoffGraphQLClient } from "./graphql-C8jKLLel.js";
|
|
2
|
+
import { p as SDKContext } from "./index-BTaQMEgB.js";
|
|
3
3
|
declare namespace tenant_notifications_d_exports {
|
|
4
4
|
export { BatchNotificationInput, Notification$1 as Notification, NotificationChannel$1 as NotificationChannel, NotificationPriority, NotificationStats, NotificationTemplate, NotificationType$1 as NotificationType, RecipientInput$1 as RecipientInput, SendNotificationInput, SendWithTemplateInput, TenantNotificationsModule };
|
|
5
5
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as GraphQLRequestOptions, l as GraphQLResponse } from "./types-
|
|
1
|
+
import { c as GraphQLRequestOptions, l as GraphQLResponse } from "./types-gJ9Qqi9E.js";
|
|
2
2
|
declare const TAG_ACTOR_TYPES: readonly ["user", "app", "service", "super_admin"];
|
|
3
3
|
type TagActorType = (typeof TAG_ACTOR_TYPES)[number];
|
|
4
4
|
interface TagActor {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as SDKContext } from "./index-
|
|
1
|
+
import { p as SDKContext } from "./index-BTaQMEgB.js";
|
|
2
2
|
declare namespace index_d_exports {
|
|
3
3
|
export { LogLevel, LogMeta, Logger, LoggerConfig, LoggerTransport, debug, error, log, logger, redactSensitiveFields, redactSensitiveString, warn };
|
|
4
4
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as BurdenoffGraphQLClient } from "./graphql-
|
|
2
|
-
import { p as SDKContext } from "./index-
|
|
1
|
+
import { t as BurdenoffGraphQLClient } from "./graphql-C8jKLLel.js";
|
|
2
|
+
import { p as SDKContext } from "./index-BTaQMEgB.js";
|
|
3
3
|
import { i as GraphQLContext } from "./types-CWybW61E.js";
|
|
4
4
|
interface CookieOptions {
|
|
5
5
|
name: string;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { s as GatewayRequestHeaders } from "./layer-C0zxAUgR.js";
|
|
2
|
+
import { a as GatewayError, c as GraphQLRequestOptions, d as IGatewayClient, f as RequestContext, i as GatewayClientHealth, l as GraphQLResponse, n as CircuitState, o as GatewayErrorType, r as GatewayClientConfig, s as GraphQLError, t as CircuitBreakerStats, u as ICircuitBreaker } from "./types-gJ9Qqi9E.js";
|
|
3
|
+
import { t as index_d_exports$1 } from "./index-C0qLquY0.js";
|
|
4
|
+
declare function isGatewayClientError(error: unknown): boolean;
|
|
5
|
+
declare class GatewayClient implements IGatewayClient {
|
|
6
|
+
private config;
|
|
7
|
+
private layerManager;
|
|
8
|
+
private internalCircuitBreaker;
|
|
9
|
+
private crossLayerCircuitBreaker;
|
|
10
|
+
private retryConfig;
|
|
11
|
+
private defaultHeaders;
|
|
12
|
+
constructor(config: GatewayClientConfig);
|
|
13
|
+
private getInternalUrl;
|
|
14
|
+
private getCrossLayerUrl;
|
|
15
|
+
internalQuery<T = unknown>(options: GraphQLRequestOptions): Promise<GraphQLResponse<T>>;
|
|
16
|
+
crossLayerQuery<T = unknown>(options: GraphQLRequestOptions): Promise<GraphQLResponse<T>>;
|
|
17
|
+
query<T = unknown>(gatewayUrl: string, options: GraphQLRequestOptions): Promise<GraphQLResponse<T>>;
|
|
18
|
+
getInternalCircuitBreaker(): ICircuitBreaker;
|
|
19
|
+
getCrossLayerCircuitBreaker(): ICircuitBreaker;
|
|
20
|
+
getHealthStatus(): GatewayClientHealth;
|
|
21
|
+
updateDefaultHeaders(headers: Partial<GatewayRequestHeaders>): void;
|
|
22
|
+
private createRequestContext;
|
|
23
|
+
private shouldRetryError;
|
|
24
|
+
private calculateRetryDelay;
|
|
25
|
+
private logRetryAttempt;
|
|
26
|
+
private executeWithRetry;
|
|
27
|
+
private buildRequestHeaders;
|
|
28
|
+
private handleGraphQLErrors;
|
|
29
|
+
private handleFetchError;
|
|
30
|
+
private executeRequest;
|
|
31
|
+
private sleep;
|
|
32
|
+
}
|
|
33
|
+
declare function createGatewayClient(config: GatewayClientConfig): GatewayClient;
|
|
34
|
+
declare function createGatewayClientFromEnv(): GatewayClient;
|
|
35
|
+
declare function signServiceJwt(actorId: string, ttlSeconds?: number): Promise<string | null>;
|
|
36
|
+
declare const DELEGATED_AUTHORIZATION_HEADER = "x-delegated-authorization";
|
|
37
|
+
interface DelegatedGatewayTransportInput {
|
|
38
|
+
appAsUserToken: string;
|
|
39
|
+
workspaceId?: string;
|
|
40
|
+
}
|
|
41
|
+
declare function buildDelegatedGatewayHeaders(input: DelegatedGatewayTransportInput): GatewayRequestHeaders;
|
|
42
|
+
declare const PROACTIVE_READ_SCOPE = "delegation:read";
|
|
43
|
+
declare function proactiveAssistantClientId(product: string): string;
|
|
44
|
+
type ProactiveIdentityErrorCode = string;
|
|
45
|
+
declare class ProactiveIdentityError extends Error {
|
|
46
|
+
readonly code: ProactiveIdentityErrorCode;
|
|
47
|
+
constructor(message: string, code: ProactiveIdentityErrorCode);
|
|
48
|
+
}
|
|
49
|
+
declare function isProactiveConsentMissing(error: unknown): boolean;
|
|
50
|
+
interface ProactiveIdentityTarget {
|
|
51
|
+
product: string;
|
|
52
|
+
userId: string;
|
|
53
|
+
workspaceId: string;
|
|
54
|
+
}
|
|
55
|
+
interface IssueProactiveReadTokenInput extends ProactiveIdentityTarget {
|
|
56
|
+
ttlSeconds?: number;
|
|
57
|
+
}
|
|
58
|
+
interface RevokeProactiveConsentInput extends ProactiveIdentityTarget {
|
|
59
|
+
reason?: string;
|
|
60
|
+
}
|
|
61
|
+
interface ProactiveReadToken {
|
|
62
|
+
token: string;
|
|
63
|
+
expiresAt: Date;
|
|
64
|
+
}
|
|
65
|
+
interface ProactiveConsent {
|
|
66
|
+
product: string;
|
|
67
|
+
clientId: string;
|
|
68
|
+
userId: string;
|
|
69
|
+
workspaceId: string;
|
|
70
|
+
granted: boolean;
|
|
71
|
+
expiresAt: Date | null;
|
|
72
|
+
}
|
|
73
|
+
type ProactiveIdentityClient = {
|
|
74
|
+
crossLayerQuery<T = unknown>(options: GraphQLRequestOptions): Promise<GraphQLResponse<T>>;
|
|
75
|
+
};
|
|
76
|
+
interface ProactiveIdentityOptions {
|
|
77
|
+
client?: ProactiveIdentityClient;
|
|
78
|
+
timeoutMs?: number;
|
|
79
|
+
serviceIdentity?: string;
|
|
80
|
+
}
|
|
81
|
+
declare function issueProactiveReadToken(input: IssueProactiveReadTokenInput, options?: ProactiveIdentityOptions): Promise<ProactiveReadToken>;
|
|
82
|
+
declare function grantProactiveConsent(input: ProactiveIdentityTarget, options?: ProactiveIdentityOptions): Promise<ProactiveConsent>;
|
|
83
|
+
declare function revokeProactiveConsent(input: RevokeProactiveConsentInput, options?: ProactiveIdentityOptions): Promise<boolean>;
|
|
84
|
+
declare function getProactiveConsent(input: ProactiveIdentityTarget, options?: ProactiveIdentityOptions): Promise<ProactiveConsent>;
|
|
85
|
+
declare namespace index_d_exports {
|
|
86
|
+
export { CircuitBreakerStats, CircuitState, DELEGATED_AUTHORIZATION_HEADER, DelegatedGatewayTransportInput, GatewayClient, GatewayClientConfig, GatewayClientHealth, GatewayError, GatewayErrorType, GraphQLError, GraphQLRequestOptions, GraphQLResponse, ICircuitBreaker, IGatewayClient, IssueProactiveReadTokenInput, PROACTIVE_READ_SCOPE, ProactiveConsent, ProactiveIdentityClient, ProactiveIdentityError, ProactiveIdentityErrorCode, ProactiveIdentityOptions, ProactiveIdentityTarget, ProactiveReadToken, RequestContext, RevokeProactiveConsentInput, index_d_exports$1 as Security, buildDelegatedGatewayHeaders, createGatewayClient, createGatewayClientFromEnv, getProactiveConsent, grantProactiveConsent, isGatewayClientError, isProactiveConsentMissing, issueProactiveReadToken, proactiveAssistantClientId, revokeProactiveConsent, signServiceJwt };
|
|
87
|
+
}
|
|
88
|
+
export { createGatewayClient as C, GatewayClient as S, isGatewayClientError as T, revokeProactiveConsent as _, ProactiveIdentityClient as a, buildDelegatedGatewayHeaders as b, ProactiveIdentityOptions as c, RevokeProactiveConsentInput as d, getProactiveConsent as f, proactiveAssistantClientId as g, issueProactiveReadToken as h, ProactiveConsent as i, ProactiveIdentityTarget as l, isProactiveConsentMissing as m, IssueProactiveReadTokenInput as n, ProactiveIdentityError as o, grantProactiveConsent as p, PROACTIVE_READ_SCOPE as r, ProactiveIdentityErrorCode as s, index_d_exports as t, ProactiveReadToken as u, DELEGATED_AUTHORIZATION_HEADER as v, createGatewayClientFromEnv as w, signServiceJwt as x, DelegatedGatewayTransportInput as y };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { a as DEFAULT_LAYER_RESOURCES, c as GatewayRetryConfig, d as LayerFullConfig, f as LayerGatewayConfig, i as DEFAULT_GATEWAY_ROUTING, l as GatewayRoutingConfig, m as ServiceLayer, n as DEFAULT_CIRCUIT_BREAKER_CONFIG, o as DEFAULT_LAYER_STREAMS, p as LayerResourceUrls, r as DEFAULT_GATEWAY_RETRY_CONFIG, s as GatewayRequestHeaders, t as CircuitBreakerConfig, u as LayerConfig } from "./layer-
|
|
2
|
-
import { _ as TemporalHealthStatus, a as EventQueueSDKConfig, f as SDKConfig, g as SDKShutdownOptions, h as SDKHealthStatus, i as EventQueueHealthStatus, o as LoggerConfig, p as SDKContext, s as LoggerTransport } from "./index-
|
|
3
|
-
import { c as index_d_exports$17, r as Logger } from "./index-
|
|
1
|
+
import { a as DEFAULT_LAYER_RESOURCES, c as GatewayRetryConfig, d as LayerFullConfig, f as LayerGatewayConfig, i as DEFAULT_GATEWAY_ROUTING, l as GatewayRoutingConfig, m as ServiceLayer, n as DEFAULT_CIRCUIT_BREAKER_CONFIG, o as DEFAULT_LAYER_STREAMS, p as LayerResourceUrls, r as DEFAULT_GATEWAY_RETRY_CONFIG, s as GatewayRequestHeaders, t as CircuitBreakerConfig, u as LayerConfig } from "./layer-C0zxAUgR.js";
|
|
2
|
+
import { _ as TemporalHealthStatus, a as EventQueueSDKConfig, f as SDKConfig, g as SDKShutdownOptions, h as SDKHealthStatus, i as EventQueueHealthStatus, o as LoggerConfig, p as SDKContext, s as LoggerTransport } from "./index-BTaQMEgB.js";
|
|
3
|
+
import { c as index_d_exports$17, r as Logger } from "./index-KlrnELrN.js";
|
|
4
4
|
import { ContextManager } from "./context/index.js";
|
|
5
|
-
import { t as AuthModule } from "./index-
|
|
6
|
-
import { _ as TenantNotificationsModule, o as NotificationsModule, v as tenant_notifications_d_exports } from "./index-
|
|
7
|
-
import { f as RBACDirectiveConfig, h as createRBACDirectiveFromEnv, m as createRBACDirectiveForLayer, o as RBACModule, p as createRBACDirective, u as LayerAwareRBACConfig } from "./index-
|
|
5
|
+
import { t as AuthModule } from "./index-YMGOJins.js";
|
|
6
|
+
import { _ as TenantNotificationsModule, o as NotificationsModule, v as tenant_notifications_d_exports } from "./index-Dw_0wE4q.js";
|
|
7
|
+
import { f as RBACDirectiveConfig, h as createRBACDirectiveFromEnv, m as createRBACDirectiveForLayer, o as RBACModule, p as createRBACDirective, u as LayerAwareRBACConfig } from "./index-Bh6W5JO4.js";
|
|
8
8
|
import { Activity, ActivityActorType, ActivityModule, ActivityOperationUnsupportedError, GetActivitiesOptions, LogActivityOptions } from "./activity/index.js";
|
|
9
|
-
import { C as OrgBillingUsageOperationInput, S as BillingUsageOperationInput, T as WorkspaceBillingUsageOperationInput, b as BillingUsageClient, m as UsageModule, w as QuotaLimit, x as BillingUsageClientConfig } from "./index-
|
|
10
|
-
import { r as TrackerModule } from "./index-
|
|
9
|
+
import { C as OrgBillingUsageOperationInput, S as BillingUsageOperationInput, T as WorkspaceBillingUsageOperationInput, b as BillingUsageClient, m as UsageModule, w as QuotaLimit, x as BillingUsageClientConfig } from "./index-DWER4-_x.js";
|
|
10
|
+
import { r as TrackerModule } from "./index-DqpCL9kD.js";
|
|
11
11
|
import { DatabaseModule } from "./database/index.js";
|
|
12
|
-
import { Zt as IEventPublisher, t as index_d_exports$5, yt as EventsModule } from "./index-
|
|
13
|
-
import { i as GraphModule, u as index_d_exports$10 } from "./index-
|
|
12
|
+
import { Zt as IEventPublisher, t as index_d_exports$5, yt as EventsModule } from "./index-CEtULfb_.js";
|
|
13
|
+
import { i as GraphModule, u as index_d_exports$10 } from "./index-9MJVKzWA.js";
|
|
14
14
|
import { SearchModule } from "./search/index.js";
|
|
15
15
|
import { ExportProductTranslationsOptions, ProductTranslationTree, ProductTranslationsExportResult, TranslationExportFormat, TranslationModule, UpsertProductTranslationsOptions, UpsertProductTranslationsResult } from "./translation/index.js";
|
|
16
16
|
import { PaymentsModule } from "./payments/index.js";
|
|
17
17
|
import { BootstrapModule, createBootstrap } from "./bootstrap/index.js";
|
|
18
|
-
import { a as TemporalWorkerManager, c as TemporalClientFactory, i as TemporalWorkerFactory, l as WorkflowStartOptions, n as TemporalWorker, o as TemporalClient, r as TemporalWorkerConfig, s as TemporalClientConfig, t as TemporalModule } from "./index-
|
|
19
|
-
import { t as BurdenoffGraphQLClient } from "./graphql-
|
|
18
|
+
import { a as TemporalWorkerManager, c as TemporalClientFactory, i as TemporalWorkerFactory, l as WorkflowStartOptions, n as TemporalWorker, o as TemporalClient, r as TemporalWorkerConfig, s as TemporalClientConfig, t as TemporalModule } from "./index-DSynXDRD.js";
|
|
19
|
+
import { t as BurdenoffGraphQLClient } from "./graphql-C8jKLLel.js";
|
|
20
20
|
import { createInternalClient, createInternalClientForTenant, createInternalClientForWorkspaces } from "./client/internal-client.js";
|
|
21
21
|
import { a as registerDisposable, i as getRegisteredDisposableCount, n as ShutdownDisposable, o as unregisterDisposable, r as disposeAll, t as index_d_exports$16 } from "./index-Dt1HJPTX.js";
|
|
22
22
|
import { BillingPlanTransport, PlanTier, RESOURCE_CAP_DEFAULTS, ResourceCap, ResourceCapDefaults, ResourceCapExceededError, ResourceCapsConfig, ResourceCapsModule, ResourceName, WorkspaceResourceCapScope, configureResourceCaps, getResourceCaps } from "./resource-caps/index.js";
|
|
23
23
|
import { t as index_d_exports$23 } from "./index-CliOgq6L.js";
|
|
24
|
-
import { t as index_d_exports$24 } from "./index-
|
|
25
|
-
import { t as index_d_exports$8 } from "./index-
|
|
26
|
-
import { t as index_d_exports } from "./index-
|
|
27
|
-
import { o as index_d_exports$1 } from "./index-
|
|
24
|
+
import { t as index_d_exports$24 } from "./index-HeUeEsMU.js";
|
|
25
|
+
import { t as index_d_exports$8 } from "./index-8pUSoT85.js";
|
|
26
|
+
import { t as index_d_exports } from "./index-BJwHEzpN.js";
|
|
27
|
+
import { o as index_d_exports$1 } from "./index-SvWwlTUC.js";
|
|
28
28
|
import { t as index_d_exports$18 } from "./index-BMIMnp6T.js";
|
|
29
29
|
import { t as index_d_exports$19 } from "./index-C5uEKchX.js";
|
|
30
30
|
import { t as index_d_exports$11 } from "./index-CSRcgkVi.js";
|
|
31
31
|
import { t as index_d_exports$21 } from "./index-BiTzGUZP.js";
|
|
32
32
|
import { s as index_d_exports$25 } from "./index-FKohsiex.js";
|
|
33
33
|
import { C as getLocale, S as getLanguage, T as t, b as Translator, r as index_d_exports$12, w as hasI18n, x as createTranslator, y as I18nCapableContext } from "./index-CPQDMSFS.js";
|
|
34
|
-
import { t as index_d_exports$6 } from "./index-
|
|
35
|
-
import { n as index_d_exports$13 } from "./index-
|
|
34
|
+
import { t as index_d_exports$6 } from "./index-Bwn5Z1h-.js";
|
|
35
|
+
import { n as index_d_exports$13 } from "./index-Cwu5Mpji.js";
|
|
36
36
|
import { p as index_d_exports$4 } from "./index-DGgh9DWn.js";
|
|
37
|
-
import { a as index_d_exports$14 } from "./index-
|
|
38
|
-
import { a as index_d_exports$15 } from "./index-
|
|
37
|
+
import { a as index_d_exports$14 } from "./index-479i3w77.js";
|
|
38
|
+
import { a as index_d_exports$15 } from "./index-Base-sg5.js";
|
|
39
39
|
import { t as index_d_exports$3 } from "./index-BVOL7458.js";
|
|
40
|
-
import { t as index_d_exports$9 } from "./index-
|
|
40
|
+
import { t as index_d_exports$9 } from "./index-oJMtR3nl.js";
|
|
41
41
|
import { t as index_d_exports$7 } from "./index-BcqQs-Uq.js";
|
|
42
42
|
import { a as index_d_exports$2, c as verifyCaptchaIfEnabled, n as RecaptchaVerifyResult, o as isCaptchaEnabled, s as verifyCaptcha, t as RecaptchaVerifyOptions } from "./index-yBSjMY32.js";
|
|
43
43
|
import { t as index_d_exports$20 } from "./index-DY3dNhMN.js";
|
package/dist/index.js
CHANGED
|
@@ -8,8 +8,8 @@ import { t as AuthModule } from "./auth-C5ctwSLp.js";
|
|
|
8
8
|
import { c as tenant_notifications_exports, r as NotificationsModule, s as TenantNotificationsModule } from "./notifications-DY_i37WN.js";
|
|
9
9
|
import { a as createRBACDirectiveForLayer, i as createRBACDirective, o as createRBACDirectiveFromEnv, t as RBACModule } from "./rbac-Dvz0YzEt.js";
|
|
10
10
|
import { ActivityModule, ActivityOperationUnsupportedError } from "./activity/index.js";
|
|
11
|
-
import { a as UsageModule, c as BillingUsageClient } from "./usage-
|
|
12
|
-
import { t as TrackerModule } from "./tracker-
|
|
11
|
+
import { a as UsageModule, c as BillingUsageClient } from "./usage-ygkKsxdd.js";
|
|
12
|
+
import { t as TrackerModule } from "./tracker-Cl3cGKe-.js";
|
|
13
13
|
import { DatabaseModule } from "./database/index.js";
|
|
14
14
|
import { T as EventsModule, t as event_queue_exports } from "./event-queue-Cw-YJPY_.js";
|
|
15
15
|
import { a as unregisterDisposable, i as registerDisposable, n as disposeAll, r as getRegisteredDisposableCount, t as lifecycle_exports } from "./lifecycle-DeoLSX0U.js";
|
|
@@ -34,13 +34,13 @@ import { t as graphql_exports } from "./graphql-DHAHHcww.js";
|
|
|
34
34
|
import { t as prisma_exports } from "./prisma-BzOOdt79.js";
|
|
35
35
|
import { _ as utils_exports } from "./utils-DL85Tnbn.js";
|
|
36
36
|
import { a as getLanguage, c as t, i as createTranslator, o as getLocale, r as i18n_exports, s as hasI18n } from "./i18n-BBMYFd0P.js";
|
|
37
|
-
import { t as export_exports } from "./export-
|
|
38
|
-
import { n as init_exports } from "./init-
|
|
37
|
+
import { t as export_exports } from "./export-lqKewsuF.js";
|
|
38
|
+
import { n as init_exports } from "./init-D814LeLF.js";
|
|
39
39
|
import { s as dataloader_exports } from "./dataloader-DwpT3YoS.js";
|
|
40
40
|
import { r as instrumentation_exports } from "./instrumentation-xkkmDgJ0.js";
|
|
41
41
|
import { a as layer_exports } from "./layer-CEKy6cm8.js";
|
|
42
42
|
import { t as crypto_exports } from "./crypto-DO9fM0FO.js";
|
|
43
|
-
import { t as gateway_exports } from "./gateway-
|
|
43
|
+
import { t as gateway_exports } from "./gateway-2en8Gx_a.js";
|
|
44
44
|
import { t as feature_flags_exports } from "./feature-flags-CP1KRgwD.js";
|
|
45
45
|
import { i as verifyCaptchaIfEnabled, n as isCaptchaEnabled, r as verifyCaptcha, t as captcha_exports } from "./captcha-BT7yh1YS.js";
|
|
46
46
|
import { t as platform_exports } from "./platform-DZwczW7v.js";
|
package/dist/init/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as OpenTelemetryConfig, a as resetSDK, c as ClickHouseConfig, d as GraphSyncConfig, f as InitializedSDKState, g as ObservabilityConfig, h as MetricsConfig, i as isSDKInitialized, l as DatabaseConfig, m as LoggingConfig, o as AnalyticsConfig, p as LayerInitConfig, r as initializeBurdenoffSDK, s as BurdenoffSDKInitConfig, t as getSDKState, u as EventQueueConfig, v as SDKCacheConfig, y as SDKValkeyCacheConfig } from "../index-
|
|
1
|
+
import { _ as OpenTelemetryConfig, a as resetSDK, c as ClickHouseConfig, d as GraphSyncConfig, f as InitializedSDKState, g as ObservabilityConfig, h as MetricsConfig, i as isSDKInitialized, l as DatabaseConfig, m as LoggingConfig, o as AnalyticsConfig, p as LayerInitConfig, r as initializeBurdenoffSDK, s as BurdenoffSDKInitConfig, t as getSDKState, u as EventQueueConfig, v as SDKCacheConfig, y as SDKValkeyCacheConfig } from "../index-Cwu5Mpji.js";
|
|
2
2
|
export { type AnalyticsConfig, type BurdenoffSDKInitConfig, type ClickHouseConfig, type DatabaseConfig, type EventQueueConfig, type GraphSyncConfig, type InitializedSDKState, type LayerInitConfig, type LoggingConfig, type MetricsConfig, type ObservabilityConfig, type OpenTelemetryConfig, type SDKCacheConfig, type SDKValkeyCacheConfig, getSDKState, initializeBurdenoffSDK, isSDKInitialized, resetSDK };
|
package/dist/init/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as resetSDK, i as isSDKInitialized, r as initializeBurdenoffSDK, t as getSDKState } from "../init-
|
|
1
|
+
import { a as resetSDK, i as isSDKInitialized, r as initializeBurdenoffSDK, t as getSDKState } from "../init-D814LeLF.js";
|
|
2
2
|
|
|
3
3
|
export { getSDKState, initializeBurdenoffSDK, isSDKInitialized, resetSDK };
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,7 +2,7 @@ import { t as __exportAll } from "./rolldown-runtime-ad2WFvuA.js";
|
|
|
2
2
|
import { a as logger } from "./logger-B6rCpb7D.js";
|
|
3
3
|
import { t as LayerManager } from "./layer-CEKy6cm8.js";
|
|
4
4
|
import { t as GatewayClient } from "./client-sAJTrb4i.js";
|
|
5
|
-
import "./gateway-
|
|
5
|
+
import "./gateway-2en8Gx_a.js";
|
|
6
6
|
import { configureResourceCaps } from "./resource-caps/index.js";
|
|
7
7
|
import { n as createCounter } from "./metrics-collector-C2eShrlW.js";
|
|
8
8
|
|
|
@@ -322,4 +322,4 @@ async function initializeLayerStreams(config) {
|
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
export { resetSDK as a, isSDKInitialized as i, init_exports as n, initializeBurdenoffSDK as r, getSDKState as t };
|
|
325
|
-
//# sourceMappingURL=init-
|
|
325
|
+
//# sourceMappingURL=init-D814LeLF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-CQPFmOOe.js","names":[],"sources":["../src/init/index.ts"],"sourcesContent":["/**\n * Burdenoff SDK Initialization Module\n *\n * Provides a unified initialization function for all state services\n * including database, cache, analytics, event queue, and graph sync.\n *\n * @module init\n * @category Initialization\n */\n\nimport { logger } from '../logger/index.js';\nimport { LayerManager } from '../layer/index.js';\nimport { GatewayClient } from '../gateway/index.js';\nimport { configureResourceCaps } from '../resource-caps/index.js';\nimport { createCounter } from '../instrumentation/metrics-collector.js';\nimport type { BurdenoffSDKInitConfig, InitializedSDKState } from './types.js';\n\n/**\n * Global SDK state\n */\nlet sdkState: InitializedSDKState | null = null;\nlet isInitialized = false;\n\n/**\n * Initialize Burdenoff SDK with unified configuration\n *\n * This function initializes all configured state services in the correct order:\n * 1. Logging configuration\n * 2. Database (Prisma with PostgreSQL)\n * 3. Cache (Valkey)\n * 4. Event Queue (Redis Streams)\n * 5. Graph Sync (Redis Streams-based — Apache AGE writes happen inside wspace-graph-svc)\n * 6. Analytics (ClickHouse)\n * 7. Observability (Metrics, OpenTelemetry)\n *\n * @param config - SDK initialization configuration\n * @returns Initialized SDK state\n *\n * @example\n * ```typescript\n * import { initializeBurdenoffSDK } from '@burdenoff/be-sdk/init';\n *\n * const state = await initializeBurdenoffSDK({\n * database: {\n * url: process.env.DATABASE_URL!,\n * maxConnections: 20,\n * },\n * graph: {\n * enabled: true,\n * eventsEnabled: true,\n * },\n * cache: {\n * valkey: {\n * url: process.env.VALKEY_URL!,\n * },\n * },\n * });\n * ```\n */\nexport async function initializeBurdenoffSDK(config: BurdenoffSDKInitConfig): Promise<InitializedSDKState> {\n if (isInitialized && sdkState) {\n logger.warn('[SDK Init] SDK already initialized, returning existing state');\n return sdkState;\n }\n\n logger.info('[SDK Init] Starting SDK initialization...');\n const startTime = Date.now();\n\n try {\n // 1. Configure logging\n await initializeLogging(config);\n\n // 2. Initialize layer manager (if configured)\n const { layerManager, gatewayClient } = await initializeLayer(config);\n\n // 2b. Wire resource caps to billing so plan-based limits actually apply.\n // `userBillingPlan` lives in the GLOBAL layer: global services reach it\n // on their own internal gateway; wspace services go cross-layer via the\n // public global gateway (service JWT). Without this, every resource cap\n // silently collapses to the free-tier fallback regardless of the\n // customer's plan (BOFF-4805). Primes the process-wide singleton so all\n // existing `getResourceCaps()` call sites resolve real plans unchanged.\n if (gatewayClient && config.layer) {\n const layerType = config.layer.type;\n const fallbackCounter = createCounter(\n 'resource_caps.clientless_fallback_total',\n 'Total number of times resource caps fell back because no billing source was configured at bootstrap'\n );\n configureResourceCaps({\n transport: async (query, variables) => {\n // Cap checks run on entity-create paths and ALWAYS fall back to the\n // configured billing-failure tier on failure, so a billing outage\n // must degrade fast rather than stall writes. Bound the lookup with a\n // short timeout and no retries instead of the gateway defaults\n // (~30s × 3 ≈ 90s). Results are cached 60s, so healthy lookups rarely\n // hit the gateway anyway. `skipCircuitBreaker` keeps this best-effort\n // probe OUT of the shared gateway circuit: its failures already\n // degrade to the fallback here, so they must not count toward opening\n // the internal/cross-layer circuit and fail-fast unrelated M2M calls\n // during a billing outage.\n const options = { query, variables, timeout: 8000, skipRetry: true, skipCircuitBreaker: true };\n const response =\n layerType === 'global'\n ? await gatewayClient.internalQuery(options)\n : await gatewayClient.crossLayerQuery(options);\n return response?.data ?? null;\n },\n // Emitting a dedicated clientless-fallback counter at bootstrap means\n // a service that somehow starts without a billing transport is\n // immediately visible in metrics (BOFF-4809). The resource-caps module\n // itself also emits `resource_caps.plan_resolution_total`, but that\n // only fires on the first cap check; this counter fires at bootstrap.\n onFallback: () => fallbackCounter.inc(),\n });\n logger.info('[SDK Init] Resource caps wired to billing', { layer: layerType });\n } else {\n logger.warn('[SDK Init] No layer/gateway configured — resource caps will use free-tier fallbacks (BOFF-4805)');\n }\n\n // 3. Initialize database (required)\n const prisma = await initializeDatabase(config);\n\n // 4. Initialize cache (optional)\n const valkey = await initializeCache(config);\n\n // 5. Initialize event queue (optional) — Redis Streams via REDIS_URL\n const eventPublisher = await initializeEventQueue(config);\n\n // 6. Initialize layer streams (if layer configured)\n if (config.layer?.autoCreateStreams !== false && config.layer) {\n await initializeLayerStreams(config);\n }\n\n // 7. Initialize graph sync (optional) — publisher emits to Redis Streams,\n // never opens a graph-DB connection\n const graphSync = await initializeGraphSync(config);\n\n // 8. Initialize analytics (optional)\n const clickhouse = await initializeAnalytics(config);\n\n // 9. Initialize observability (optional)\n await initializeObservability(config);\n\n // Create SDK state\n // graphSync is a publisher-side placeholder; services emit Redis Streams\n // events and wspace-graph-svc owns the sole Apache AGE connection.\n void graphSync;\n sdkState = {\n prisma,\n valkey,\n clickhouse,\n eventPublisher,\n layerManager,\n gatewayClient,\n graphSyncEnabled: config.graph?.enabled ?? false,\n analyticsEnabled: !!config.analytics?.clickhouse,\n observabilityEnabled: config.observability?.metrics?.enabled ?? false,\n layerAwareEnabled: !!config.layer,\n };\n\n isInitialized = true;\n\n const duration = Date.now() - startTime;\n // sdkState is guaranteed non-null here since we just assigned it above\n const initializedState = sdkState;\n logger.info(`[SDK Init] SDK initialized successfully in ${duration}ms`, {\n graphSyncEnabled: initializedState.graphSyncEnabled,\n analyticsEnabled: initializedState.analyticsEnabled,\n observabilityEnabled: initializedState.observabilityEnabled,\n layerAwareEnabled: initializedState.layerAwareEnabled,\n layer: config.layer?.type,\n serviceName: config.layer?.serviceName,\n });\n\n return initializedState;\n } catch (error) {\n logger.error('[SDK Init] Failed to initialize SDK:', error);\n throw error;\n }\n}\n\n/**\n * Get current SDK state\n * @throws Error if SDK is not initialized\n */\nexport function getSDKState(): InitializedSDKState {\n if (!isInitialized || !sdkState) {\n throw new Error('SDK not initialized. Call initializeBurdenoffSDK() first.');\n }\n return sdkState;\n}\n\n/**\n * Check if SDK is initialized\n */\nexport function isSDKInitialized(): boolean {\n return isInitialized;\n}\n\n/**\n * Reset SDK state (useful for testing)\n */\nexport async function resetSDK(): Promise<void> {\n logger.info('[SDK Init] Resetting SDK state...');\n\n if (sdkState) {\n // Cleanup resources\n // Note: Individual cleanup will be handled by service-specific shutdown handlers\n sdkState = null;\n }\n\n isInitialized = false;\n logger.info('[SDK Init] SDK state reset');\n}\n\n/**\n * Initialize logging configuration\n */\nasync function initializeLogging(config: BurdenoffSDKInitConfig): Promise<void> {\n logger.info('[SDK Init] Configuring logging...');\n\n const loggingConfig = config.logging ?? {};\n const isDevelopment = config.app?.nodeEnv === 'development';\n\n // Set log level\n const level = loggingConfig.level ?? 'info';\n logger.setLevel(level);\n\n // Set console logging\n const console = loggingConfig.console ?? true;\n logger.setConsoleEnabled(console);\n\n logger.info('[SDK Init] Logging configured', {\n level,\n console,\n format: loggingConfig.format ?? (isDevelopment ? 'pretty' : 'json'),\n });\n}\n\n/**\n * Initialize database (Prisma with PostgreSQL)\n */\nasync function initializeDatabase(config: BurdenoffSDKInitConfig): Promise<unknown> {\n logger.info('[SDK Init] Initializing database...');\n\n // Note: Database initialization is handled by createPrismaClient in prisma/client.ts\n // This is called by the application (e.g., workspaces-backend)\n // We just validate the config here\n if (!config.database?.url) {\n throw new Error('Database URL is required');\n }\n\n logger.info('[SDK Init] Database configuration validated', {\n maxConnections: config.database.maxConnections ?? 20,\n enableQueryLogging: config.database.enableQueryLogging ?? false,\n });\n\n // Return undefined as database client is created separately\n return undefined;\n}\n\n/**\n * Initialize cache (Valkey)\n */\nasync function initializeCache(config: BurdenoffSDKInitConfig): Promise<unknown> {\n const cacheConfig = config.cache?.valkey;\n\n if (!cacheConfig) {\n logger.info('[SDK Init] Cache not configured, skipping');\n return undefined;\n }\n\n logger.info('[SDK Init] Initializing Valkey cache...');\n\n // Note: Valkey initialization is handled by cache module\n // This is a placeholder for future implementation\n logger.info('[SDK Init] Valkey cache configuration validated', {\n url: cacheConfig.url ? '***' : undefined,\n defaultTTL: cacheConfig.defaultTTL ?? 3600,\n });\n\n return undefined;\n}\n\n/**\n * Initialize event queue (Redis Streams).\n *\n * NATS was retired on 2026-05-16. The publisher is created from\n * `REDIS_STREAMS_URL` when set, else `REDIS_URL` (set in every SM bundle). Legacy `config.eventQueue.nats`\n * values are ignored — kept on the type only as a back-compat shim.\n */\nasync function initializeEventQueue(_config: BurdenoffSDKInitConfig): Promise<unknown> {\n const { resolveEventStreamsUrl } = await import('../event-queue/env.js');\n if (!resolveEventStreamsUrl()) {\n logger.info('[SDK Init] REDIS_STREAMS_URL / REDIS_URL not set, skipping event queue init');\n return undefined;\n }\n\n try {\n const { EventQueueFactory } = await import('../event-queue/factory/EventQueueFactory.js');\n const publisher = EventQueueFactory.createPublisherFromEnv();\n await publisher.connect();\n\n logger.info('[SDK Init] Redis Streams event publisher connected');\n\n return publisher;\n } catch (error) {\n logger.warn('[SDK Init] Failed to connect Redis Streams event publisher (non-fatal)', {\n error: error instanceof Error ? error.message : String(error),\n note: 'Service will continue without event publishing. Use direct API calls as fallback.',\n });\n return undefined;\n }\n}\n\n/**\n * Initialize graph sync (Redis Streams publisher side).\n *\n * Services publish entity events to Redis Streams; the `wspace-graph-svc`\n * consumer (and only it) persists them into Apache AGE via Azure PG\n * sidecar. This SDK function does no DB work — it just validates that the\n * publisher-side config is sensible and logs it.\n */\nasync function initializeGraphSync(config: BurdenoffSDKInitConfig): Promise<unknown> {\n if (!config.graph?.enabled) {\n logger.info('[SDK Init] Graph sync not enabled, skipping');\n return undefined;\n }\n\n logger.info('[SDK Init] Graph sync enabled (publisher-only mode)', {\n eventsEnabled: config.graph.eventsEnabled ?? true,\n productSource: config.graph.productSource,\n streamName: config.graph.streamName ?? 'graph_events',\n syncInterval: config.graph.syncInterval ?? 1000,\n batchSize: config.graph.batchSize ?? 10,\n });\n\n return undefined;\n}\n\n/**\n * Initialize analytics (ClickHouse)\n */\nasync function initializeAnalytics(config: BurdenoffSDKInitConfig): Promise<unknown> {\n if (!config.analytics?.clickhouse) {\n logger.info('[SDK Init] Analytics not configured, skipping');\n return undefined;\n }\n\n logger.info('[SDK Init] Initializing ClickHouse for analytics...');\n\n // Note: ClickHouse initialization is handled by analytics module\n // This is a placeholder for future implementation\n logger.info('[SDK Init] ClickHouse configuration validated', {\n url: config.analytics.clickhouse.url,\n database: config.analytics.clickhouse.database,\n requestTimeout: config.analytics.clickhouse.requestTimeout ?? 60000,\n });\n\n return undefined;\n}\n\n/**\n * Initialize observability (metrics, tracing)\n */\nasync function initializeObservability(config: BurdenoffSDKInitConfig): Promise<void> {\n if (!config.observability?.metrics?.enabled && !config.observability?.openTelemetry?.enabled) {\n logger.info('[SDK Init] Observability not configured, skipping');\n return;\n }\n\n logger.info('[SDK Init] Initializing observability...');\n\n // Note: Observability initialization is handled by observability module\n // This is a placeholder for future implementation\n if (config.observability.metrics?.enabled) {\n logger.info('[SDK Init] Metrics configuration validated', {\n port: config.observability.metrics.port ?? 9090,\n endpoint: config.observability.metrics.endpoint ?? '/metrics',\n });\n }\n\n if (config.observability.openTelemetry?.enabled) {\n logger.info('[SDK Init] OpenTelemetry configuration validated', {\n serviceName: config.observability.openTelemetry.serviceName,\n samplingRate: config.observability.openTelemetry.samplingRate ?? 1.0,\n });\n }\n}\n\n/**\n * Initialize layer manager and gateway client\n */\nasync function initializeLayer(\n config: BurdenoffSDKInitConfig\n): Promise<{ layerManager?: LayerManager; gatewayClient?: GatewayClient }> {\n if (!config.layer) {\n logger.info('[SDK Init] Layer configuration not provided, skipping layer initialization');\n return {};\n }\n\n logger.info('[SDK Init] Initializing layer manager...', {\n layer: config.layer.type,\n serviceName: config.layer.serviceName,\n });\n\n // Create layer manager\n const layerManager = new LayerManager({\n layer: config.layer.type,\n serviceName: config.layer.serviceName,\n serviceIdentity: config.layer.serviceIdentity,\n });\n\n // Create gateway client\n const gatewayClient = new GatewayClient({\n layer: config.layer.type,\n serviceName: config.layer.serviceName,\n serviceIdentity: config.layer.serviceIdentity,\n internalGatewayUrl: layerManager.getInternalGatewayUrl(),\n crossLayerGatewayUrl: layerManager.getCrossLayerGatewayUrl(),\n });\n\n logger.info('[SDK Init] Layer manager initialized', {\n layer: config.layer.type,\n serviceName: config.layer.serviceName,\n internalGatewayUrl: layerManager.getInternalGatewayUrl(),\n crossLayerGatewayUrl: layerManager.getCrossLayerGatewayUrl(),\n });\n\n return { layerManager, gatewayClient };\n}\n\n/**\n * Initialize layer-specific Redis streams.\n *\n * No-op since the 2026-05-16 NATS retirement: Redis Streams are created\n * on demand by `XGROUP CREATE ... MKSTREAM` inside the consumer, so no\n * upfront connect-and-provision step is needed.\n */\nasync function initializeLayerStreams(config: BurdenoffSDKInitConfig): Promise<void> {\n if (!config.layer) {\n return;\n }\n logger.debug('[SDK Init] Layer streams init is a no-op for Redis Streams (auto-created on first XADD/XGROUP)', {\n layer: config.layer.type,\n });\n}\n\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;CAED,OAAO;EAAE;EAAc;CAAc;AACvC;;;;;;;;AASA,eAAe,uBAAuB,QAA+C;CACnF,IAAI,CAAC,OAAO,OACV;CAEF,OAAO,MAAM,kGAAkG,EAC7G,OAAO,OAAO,MAAM,KACtB,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"init-D814LeLF.js","names":[],"sources":["../src/init/index.ts"],"sourcesContent":["/**\n * Burdenoff SDK Initialization Module\n *\n * Provides a unified initialization function for all state services\n * including database, cache, analytics, event queue, and graph sync.\n *\n * @module init\n * @category Initialization\n */\n\nimport { logger } from '../logger/index.js';\nimport { LayerManager } from '../layer/index.js';\nimport { GatewayClient } from '../gateway/index.js';\nimport { configureResourceCaps } from '../resource-caps/index.js';\nimport { createCounter } from '../instrumentation/metrics-collector.js';\nimport type { BurdenoffSDKInitConfig, InitializedSDKState } from './types.js';\n\n/**\n * Global SDK state\n */\nlet sdkState: InitializedSDKState | null = null;\nlet isInitialized = false;\n\n/**\n * Initialize Burdenoff SDK with unified configuration\n *\n * This function initializes all configured state services in the correct order:\n * 1. Logging configuration\n * 2. Database (Prisma with PostgreSQL)\n * 3. Cache (Valkey)\n * 4. Event Queue (Redis Streams)\n * 5. Graph Sync (Redis Streams-based — Apache AGE writes happen inside wspace-graph-svc)\n * 6. Analytics (ClickHouse)\n * 7. Observability (Metrics, OpenTelemetry)\n *\n * @param config - SDK initialization configuration\n * @returns Initialized SDK state\n *\n * @example\n * ```typescript\n * import { initializeBurdenoffSDK } from '@burdenoff/be-sdk/init';\n *\n * const state = await initializeBurdenoffSDK({\n * database: {\n * url: process.env.DATABASE_URL!,\n * maxConnections: 20,\n * },\n * graph: {\n * enabled: true,\n * eventsEnabled: true,\n * },\n * cache: {\n * valkey: {\n * url: process.env.VALKEY_URL!,\n * },\n * },\n * });\n * ```\n */\nexport async function initializeBurdenoffSDK(config: BurdenoffSDKInitConfig): Promise<InitializedSDKState> {\n if (isInitialized && sdkState) {\n logger.warn('[SDK Init] SDK already initialized, returning existing state');\n return sdkState;\n }\n\n logger.info('[SDK Init] Starting SDK initialization...');\n const startTime = Date.now();\n\n try {\n // 1. Configure logging\n await initializeLogging(config);\n\n // 2. Initialize layer manager (if configured)\n const { layerManager, gatewayClient } = await initializeLayer(config);\n\n // 2b. Wire resource caps to billing so plan-based limits actually apply.\n // `userBillingPlan` lives in the GLOBAL layer: global services reach it\n // on their own internal gateway; wspace services go cross-layer via the\n // public global gateway (service JWT). Without this, every resource cap\n // silently collapses to the free-tier fallback regardless of the\n // customer's plan (BOFF-4805). Primes the process-wide singleton so all\n // existing `getResourceCaps()` call sites resolve real plans unchanged.\n if (gatewayClient && config.layer) {\n const layerType = config.layer.type;\n const fallbackCounter = createCounter(\n 'resource_caps.clientless_fallback_total',\n 'Total number of times resource caps fell back because no billing source was configured at bootstrap'\n );\n configureResourceCaps({\n transport: async (query, variables) => {\n // Cap checks run on entity-create paths and ALWAYS fall back to the\n // configured billing-failure tier on failure, so a billing outage\n // must degrade fast rather than stall writes. Bound the lookup with a\n // short timeout and no retries instead of the gateway defaults\n // (~30s × 3 ≈ 90s). Results are cached 60s, so healthy lookups rarely\n // hit the gateway anyway. `skipCircuitBreaker` keeps this best-effort\n // probe OUT of the shared gateway circuit: its failures already\n // degrade to the fallback here, so they must not count toward opening\n // the internal/cross-layer circuit and fail-fast unrelated M2M calls\n // during a billing outage.\n const options = { query, variables, timeout: 8000, skipRetry: true, skipCircuitBreaker: true };\n const response =\n layerType === 'global'\n ? await gatewayClient.internalQuery(options)\n : await gatewayClient.crossLayerQuery(options);\n return response?.data ?? null;\n },\n // Emitting a dedicated clientless-fallback counter at bootstrap means\n // a service that somehow starts without a billing transport is\n // immediately visible in metrics (BOFF-4809). The resource-caps module\n // itself also emits `resource_caps.plan_resolution_total`, but that\n // only fires on the first cap check; this counter fires at bootstrap.\n onFallback: () => fallbackCounter.inc(),\n });\n logger.info('[SDK Init] Resource caps wired to billing', { layer: layerType });\n } else {\n logger.warn('[SDK Init] No layer/gateway configured — resource caps will use free-tier fallbacks (BOFF-4805)');\n }\n\n // 3. Initialize database (required)\n const prisma = await initializeDatabase(config);\n\n // 4. Initialize cache (optional)\n const valkey = await initializeCache(config);\n\n // 5. Initialize event queue (optional) — Redis Streams via REDIS_URL\n const eventPublisher = await initializeEventQueue(config);\n\n // 6. Initialize layer streams (if layer configured)\n if (config.layer?.autoCreateStreams !== false && config.layer) {\n await initializeLayerStreams(config);\n }\n\n // 7. Initialize graph sync (optional) — publisher emits to Redis Streams,\n // never opens a graph-DB connection\n const graphSync = await initializeGraphSync(config);\n\n // 8. Initialize analytics (optional)\n const clickhouse = await initializeAnalytics(config);\n\n // 9. Initialize observability (optional)\n await initializeObservability(config);\n\n // Create SDK state\n // graphSync is a publisher-side placeholder; services emit Redis Streams\n // events and wspace-graph-svc owns the sole Apache AGE connection.\n void graphSync;\n sdkState = {\n prisma,\n valkey,\n clickhouse,\n eventPublisher,\n layerManager,\n gatewayClient,\n graphSyncEnabled: config.graph?.enabled ?? false,\n analyticsEnabled: !!config.analytics?.clickhouse,\n observabilityEnabled: config.observability?.metrics?.enabled ?? false,\n layerAwareEnabled: !!config.layer,\n };\n\n isInitialized = true;\n\n const duration = Date.now() - startTime;\n // sdkState is guaranteed non-null here since we just assigned it above\n const initializedState = sdkState;\n logger.info(`[SDK Init] SDK initialized successfully in ${duration}ms`, {\n graphSyncEnabled: initializedState.graphSyncEnabled,\n analyticsEnabled: initializedState.analyticsEnabled,\n observabilityEnabled: initializedState.observabilityEnabled,\n layerAwareEnabled: initializedState.layerAwareEnabled,\n layer: config.layer?.type,\n serviceName: config.layer?.serviceName,\n });\n\n return initializedState;\n } catch (error) {\n logger.error('[SDK Init] Failed to initialize SDK:', error);\n throw error;\n }\n}\n\n/**\n * Get current SDK state\n * @throws Error if SDK is not initialized\n */\nexport function getSDKState(): InitializedSDKState {\n if (!isInitialized || !sdkState) {\n throw new Error('SDK not initialized. Call initializeBurdenoffSDK() first.');\n }\n return sdkState;\n}\n\n/**\n * Check if SDK is initialized\n */\nexport function isSDKInitialized(): boolean {\n return isInitialized;\n}\n\n/**\n * Reset SDK state (useful for testing)\n */\nexport async function resetSDK(): Promise<void> {\n logger.info('[SDK Init] Resetting SDK state...');\n\n if (sdkState) {\n // Cleanup resources\n // Note: Individual cleanup will be handled by service-specific shutdown handlers\n sdkState = null;\n }\n\n isInitialized = false;\n logger.info('[SDK Init] SDK state reset');\n}\n\n/**\n * Initialize logging configuration\n */\nasync function initializeLogging(config: BurdenoffSDKInitConfig): Promise<void> {\n logger.info('[SDK Init] Configuring logging...');\n\n const loggingConfig = config.logging ?? {};\n const isDevelopment = config.app?.nodeEnv === 'development';\n\n // Set log level\n const level = loggingConfig.level ?? 'info';\n logger.setLevel(level);\n\n // Set console logging\n const console = loggingConfig.console ?? true;\n logger.setConsoleEnabled(console);\n\n logger.info('[SDK Init] Logging configured', {\n level,\n console,\n format: loggingConfig.format ?? (isDevelopment ? 'pretty' : 'json'),\n });\n}\n\n/**\n * Initialize database (Prisma with PostgreSQL)\n */\nasync function initializeDatabase(config: BurdenoffSDKInitConfig): Promise<unknown> {\n logger.info('[SDK Init] Initializing database...');\n\n // Note: Database initialization is handled by createPrismaClient in prisma/client.ts\n // This is called by the application (e.g., workspaces-backend)\n // We just validate the config here\n if (!config.database?.url) {\n throw new Error('Database URL is required');\n }\n\n logger.info('[SDK Init] Database configuration validated', {\n maxConnections: config.database.maxConnections ?? 20,\n enableQueryLogging: config.database.enableQueryLogging ?? false,\n });\n\n // Return undefined as database client is created separately\n return undefined;\n}\n\n/**\n * Initialize cache (Valkey)\n */\nasync function initializeCache(config: BurdenoffSDKInitConfig): Promise<unknown> {\n const cacheConfig = config.cache?.valkey;\n\n if (!cacheConfig) {\n logger.info('[SDK Init] Cache not configured, skipping');\n return undefined;\n }\n\n logger.info('[SDK Init] Initializing Valkey cache...');\n\n // Note: Valkey initialization is handled by cache module\n // This is a placeholder for future implementation\n logger.info('[SDK Init] Valkey cache configuration validated', {\n url: cacheConfig.url ? '***' : undefined,\n defaultTTL: cacheConfig.defaultTTL ?? 3600,\n });\n\n return undefined;\n}\n\n/**\n * Initialize event queue (Redis Streams).\n *\n * NATS was retired on 2026-05-16. The publisher is created from\n * `REDIS_STREAMS_URL` when set, else `REDIS_URL` (set in every SM bundle). Legacy `config.eventQueue.nats`\n * values are ignored — kept on the type only as a back-compat shim.\n */\nasync function initializeEventQueue(_config: BurdenoffSDKInitConfig): Promise<unknown> {\n const { resolveEventStreamsUrl } = await import('../event-queue/env.js');\n if (!resolveEventStreamsUrl()) {\n logger.info('[SDK Init] REDIS_STREAMS_URL / REDIS_URL not set, skipping event queue init');\n return undefined;\n }\n\n try {\n const { EventQueueFactory } = await import('../event-queue/factory/EventQueueFactory.js');\n const publisher = EventQueueFactory.createPublisherFromEnv();\n await publisher.connect();\n\n logger.info('[SDK Init] Redis Streams event publisher connected');\n\n return publisher;\n } catch (error) {\n logger.warn('[SDK Init] Failed to connect Redis Streams event publisher (non-fatal)', {\n error: error instanceof Error ? error.message : String(error),\n note: 'Service will continue without event publishing. Use direct API calls as fallback.',\n });\n return undefined;\n }\n}\n\n/**\n * Initialize graph sync (Redis Streams publisher side).\n *\n * Services publish entity events to Redis Streams; the `wspace-graph-svc`\n * consumer (and only it) persists them into Apache AGE via Azure PG\n * sidecar. This SDK function does no DB work — it just validates that the\n * publisher-side config is sensible and logs it.\n */\nasync function initializeGraphSync(config: BurdenoffSDKInitConfig): Promise<unknown> {\n if (!config.graph?.enabled) {\n logger.info('[SDK Init] Graph sync not enabled, skipping');\n return undefined;\n }\n\n logger.info('[SDK Init] Graph sync enabled (publisher-only mode)', {\n eventsEnabled: config.graph.eventsEnabled ?? true,\n productSource: config.graph.productSource,\n streamName: config.graph.streamName ?? 'graph_events',\n syncInterval: config.graph.syncInterval ?? 1000,\n batchSize: config.graph.batchSize ?? 10,\n });\n\n return undefined;\n}\n\n/**\n * Initialize analytics (ClickHouse)\n */\nasync function initializeAnalytics(config: BurdenoffSDKInitConfig): Promise<unknown> {\n if (!config.analytics?.clickhouse) {\n logger.info('[SDK Init] Analytics not configured, skipping');\n return undefined;\n }\n\n logger.info('[SDK Init] Initializing ClickHouse for analytics...');\n\n // Note: ClickHouse initialization is handled by analytics module\n // This is a placeholder for future implementation\n logger.info('[SDK Init] ClickHouse configuration validated', {\n url: config.analytics.clickhouse.url,\n database: config.analytics.clickhouse.database,\n requestTimeout: config.analytics.clickhouse.requestTimeout ?? 60000,\n });\n\n return undefined;\n}\n\n/**\n * Initialize observability (metrics, tracing)\n */\nasync function initializeObservability(config: BurdenoffSDKInitConfig): Promise<void> {\n if (!config.observability?.metrics?.enabled && !config.observability?.openTelemetry?.enabled) {\n logger.info('[SDK Init] Observability not configured, skipping');\n return;\n }\n\n logger.info('[SDK Init] Initializing observability...');\n\n // Note: Observability initialization is handled by observability module\n // This is a placeholder for future implementation\n if (config.observability.metrics?.enabled) {\n logger.info('[SDK Init] Metrics configuration validated', {\n port: config.observability.metrics.port ?? 9090,\n endpoint: config.observability.metrics.endpoint ?? '/metrics',\n });\n }\n\n if (config.observability.openTelemetry?.enabled) {\n logger.info('[SDK Init] OpenTelemetry configuration validated', {\n serviceName: config.observability.openTelemetry.serviceName,\n samplingRate: config.observability.openTelemetry.samplingRate ?? 1.0,\n });\n }\n}\n\n/**\n * Initialize layer manager and gateway client\n */\nasync function initializeLayer(\n config: BurdenoffSDKInitConfig\n): Promise<{ layerManager?: LayerManager; gatewayClient?: GatewayClient }> {\n if (!config.layer) {\n logger.info('[SDK Init] Layer configuration not provided, skipping layer initialization');\n return {};\n }\n\n logger.info('[SDK Init] Initializing layer manager...', {\n layer: config.layer.type,\n serviceName: config.layer.serviceName,\n });\n\n // Create layer manager\n const layerManager = new LayerManager({\n layer: config.layer.type,\n serviceName: config.layer.serviceName,\n serviceIdentity: config.layer.serviceIdentity,\n });\n\n // Create gateway client\n const gatewayClient = new GatewayClient({\n layer: config.layer.type,\n serviceName: config.layer.serviceName,\n serviceIdentity: config.layer.serviceIdentity,\n internalGatewayUrl: layerManager.getInternalGatewayUrl(),\n crossLayerGatewayUrl: layerManager.getCrossLayerGatewayUrl(),\n });\n\n logger.info('[SDK Init] Layer manager initialized', {\n layer: config.layer.type,\n serviceName: config.layer.serviceName,\n internalGatewayUrl: layerManager.getInternalGatewayUrl(),\n crossLayerGatewayUrl: layerManager.getCrossLayerGatewayUrl(),\n });\n\n return { layerManager, gatewayClient };\n}\n\n/**\n * Initialize layer-specific Redis streams.\n *\n * No-op since the 2026-05-16 NATS retirement: Redis Streams are created\n * on demand by `XGROUP CREATE ... MKSTREAM` inside the consumer, so no\n * upfront connect-and-provision step is needed.\n */\nasync function initializeLayerStreams(config: BurdenoffSDKInitConfig): Promise<void> {\n if (!config.layer) {\n return;\n }\n logger.debug('[SDK Init] Layer streams init is a no-op for Redis Streams (auto-created on first XADD/XGROUP)', {\n layer: config.layer.type,\n });\n}\n\n// Export types\nexport type * from './types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAI,WAAuC;AAC3C,IAAI,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCpB,eAAsB,uBAAuB,QAA8D;CACzG,IAAI,iBAAiB,UAAU;EAC7B,OAAO,KAAK,8DAA8D;EAC1E,OAAO;CACT;CAEA,OAAO,KAAK,2CAA2C;CACvD,MAAM,YAAY,KAAK,IAAI;CAE3B,IAAI;EAEF,MAAM,kBAAkB,MAAM;EAG9B,MAAM,EAAE,cAAc,kBAAkB,MAAM,gBAAgB,MAAM;EASpE,IAAI,iBAAiB,OAAO,OAAO;GACjC,MAAM,YAAY,OAAO,MAAM;GAC/B,MAAM,kBAAkB,cACtB,2CACA,qGACF;GACA,sBAAsB;IACpB,WAAW,OAAO,OAAO,cAAc;KAWrC,MAAM,UAAU;MAAE;MAAO;MAAW,SAAS;MAAM,WAAW;MAAM,oBAAoB;KAAK;KAK7F,QAHE,cAAc,WACV,MAAM,cAAc,cAAc,OAAO,IACzC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