@burdenoff/be-sdk 2026.1107.2 → 2026.1107.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { security_exports } from './chunk-2WBJFTQ6.js';
1
+ import { security_exports } from './chunk-726AR6Q7.js';
2
2
  import { isGatewayClientError, createGatewayClientFromEnv, createGatewayClient, GatewayClient } from './chunk-SPRG6G6G.js';
3
3
  import { signServiceJwt } from './chunk-VFCMR5GX.js';
4
4
  import { GatewayErrorType, GatewayError, CircuitState } from './chunk-QWNNFE4P.js';
@@ -48,5 +48,5 @@ function buildDelegatedGatewayHeaders(input) {
48
48
  __name(buildDelegatedGatewayHeaders, "buildDelegatedGatewayHeaders");
49
49
 
50
50
  export { DELEGATED_AUTHORIZATION_HEADER, buildDelegatedGatewayHeaders, gateway_exports };
51
- //# sourceMappingURL=chunk-AP7PXEC7.js.map
52
- //# sourceMappingURL=chunk-AP7PXEC7.js.map
51
+ //# sourceMappingURL=chunk-CFXWH2IS.js.map
52
+ //# sourceMappingURL=chunk-CFXWH2IS.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/gateway/index.ts","../src/gateway/delegated-transport.ts"],"names":["DELEGATED_AUTHORIZATION_HEADER","JWT_SEGMENT","isCompactJwt","token","segments","split","length","every","segment","test","buildDelegatedGatewayHeaders","input","appAsUserToken","Error","headers","workspaceId","undefined","trim"],"mappings":";;;;;;;AAAA,IAAA,eAAA,GAAA;;;;;;;;;;;;;;;;ACiBO,IAAMA,8BAAAA,GAAiC;AAS9C,IAAMC,WAAAA,GAAc,kBAAA;AAEpB,SAASC,aAAaC,KAAAA,EAAa;AACjC,EAAA,MAAMC,QAAAA,GAAWD,KAAAA,CAAME,KAAAA,CAAM,GAAA,CAAA;AAC7B,EAAA,OAAOD,QAAAA,CAASE,MAAAA,KAAW,CAAA,IAAKF,QAAAA,CAASG,KAAAA,CAAM,CAACC,OAAAA,KAAYP,WAAAA,CAAYQ,IAAAA,CAAKD,OAAAA,CAAAA,CAAAA;AAC/E;AAHSN,MAAAA,CAAAA,YAAAA,EAAAA,cAAAA,CAAAA;AAYF,SAASQ,6BAA6BC,KAAAA,EAAqC;AAChF,EAAA,MAAMR,QAAQQ,KAAAA,CAAMC,cAAAA;AACpB,EAAA,IAAI,OAAOT,KAAAA,KAAU,QAAA,IAAYA,KAAAA,CAAMG,MAAAA,KAAW,CAAA,IAAKH,KAAAA,CAAMG,MAAAA,GAAS,IAAA,IAAQ,CAACJ,YAAAA,CAAaC,KAAAA,CAAAA,EAAQ;AAClG,IAAA,MAAM,IAAIU,MAAM,kEAAA,CAAA;AAClB,EAAA;AACA,EAAA,MAAMC,OAAAA,GAAiC;IACrC,CAACd,8BAAAA,GAAiC,CAAA,OAAA,EAAUG,KAAAA,CAAAA;AAC9C,GAAA;AACA,EAAA,IAAIQ,KAAAA,CAAMI,gBAAgBC,MAAAA,EAAW;AACnC,IAAA,MAAMD,WAAAA,GAAcJ,KAAAA,CAAMI,WAAAA,CAAYE,IAAAA,EAAI;AAC1C,IAAA,IAAIF,WAAAA,CAAYT,MAAAA,KAAW,CAAA,IAAKS,WAAAA,KAAgBJ,MAAMI,WAAAA,EAAa;AACjE,MAAA,MAAM,IAAIF,MAAM,+DAAA,CAAA;AAClB,IAAA;AACAC,IAAAA,OAAAA,CAAQ,gBAAA,CAAA,GAAoBC,WAAAA;AAC9B,EAAA;AACA,EAAA,OAAOD,OAAAA;AACT;AAhBgBJ,MAAAA,CAAAA,4BAAAA,EAAAA,8BAAAA,CAAAA","file":"chunk-AP7PXEC7.js","sourcesContent":["/**\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// 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","/**\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"]}
1
+ {"version":3,"sources":["../src/gateway/index.ts","../src/gateway/delegated-transport.ts"],"names":["DELEGATED_AUTHORIZATION_HEADER","JWT_SEGMENT","isCompactJwt","token","segments","split","length","every","segment","test","buildDelegatedGatewayHeaders","input","appAsUserToken","Error","headers","workspaceId","undefined","trim"],"mappings":";;;;;;;AAAA,IAAA,eAAA,GAAA;;;;;;;;;;;;;;;;ACiBO,IAAMA,8BAAAA,GAAiC;AAS9C,IAAMC,WAAAA,GAAc,kBAAA;AAEpB,SAASC,aAAaC,KAAAA,EAAa;AACjC,EAA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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// 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","/**\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"]}
@@ -1,5 +1,5 @@
1
- import { registerDisposable, unregisterDisposable } from './chunk-KO2ZXZ7W.js';
2
1
  import { currentEnvironment, DEPLOYED_ENVIRONMENTS } from './chunk-A5F6Z5UE.js';
2
+ import { registerDisposable, unregisterDisposable } from './chunk-KO2ZXZ7W.js';
3
3
  import { DEFAULT_LAYER_RESOURCES } from './chunk-5CAFHK2Z.js';
4
4
  import { logger } from './chunk-RU266375.js';
5
5
  import { __export, __name } from './chunk-XE4OXN2W.js';
@@ -1849,5 +1849,5 @@ async function closeAllCaches() {
1849
1849
  __name(closeAllCaches, "closeAllCaches");
1850
1850
 
1851
1851
  export { CacheFactory, CacheProviderType, MemoryCacheProvider, ValkeyGlideProvider, assertCacheEndpointConfigured, cache_exports, closeAllCaches, createCache, getCache, getValkeyClient, warnOnLayerDefaultEndpoint };
1852
- //# sourceMappingURL=chunk-2HJC3ZL6.js.map
1853
- //# sourceMappingURL=chunk-2HJC3ZL6.js.map
1852
+ //# sourceMappingURL=chunk-XOJORS75.js.map
1853
+ //# sourceMappingURL=chunk-XOJORS75.js.map