@burdenoff/be-sdk 2026.618.1 → 2026.623.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/auth/index.d.ts +3 -2
- package/dist/auth/index.js +2 -2
- package/dist/{chunk-XNQUN3AE.js → chunk-4OQRBSHM.js} +3 -3
- package/dist/{chunk-XNQUN3AE.js.map → chunk-4OQRBSHM.js.map} +1 -1
- package/dist/{chunk-FTDQ6NY5.js → chunk-6NB7P6SR.js} +3 -3
- package/dist/{chunk-FTDQ6NY5.js.map → chunk-6NB7P6SR.js.map} +1 -1
- package/dist/{chunk-L2P4CJUR.js → chunk-B527JLOB.js} +6 -2
- package/dist/chunk-B527JLOB.js.map +1 -0
- package/dist/{chunk-SMGTXYFR.js → chunk-EZ4PKRUK.js} +2 -2
- package/dist/chunk-EZ4PKRUK.js.map +1 -0
- package/dist/{chunk-5FEOFBQ4.js → chunk-F5BPKP75.js} +3 -3
- package/dist/{chunk-5FEOFBQ4.js.map → chunk-F5BPKP75.js.map} +1 -1
- package/dist/{chunk-ZHQUXD6S.js → chunk-IUL5TEKE.js} +3 -3
- package/dist/{chunk-ZHQUXD6S.js.map → chunk-IUL5TEKE.js.map} +1 -1
- package/dist/{chunk-N7UJFZQH.js → chunk-OWUVYM2S.js} +6 -47
- package/dist/chunk-OWUVYM2S.js.map +1 -0
- package/dist/{chunk-FKSMQLIV.js → chunk-SS4XWRYR.js} +3 -3
- package/dist/{chunk-FKSMQLIV.js.map → chunk-SS4XWRYR.js.map} +1 -1
- package/dist/{chunk-ZPEDC5V3.js → chunk-TYXGWVRL.js} +5 -5
- package/dist/{chunk-ZPEDC5V3.js.map → chunk-TYXGWVRL.js.map} +1 -1
- package/dist/{chunk-X7QMT2P6.js → chunk-UJI2S556.js} +3 -3
- package/dist/{chunk-X7QMT2P6.js.map → chunk-UJI2S556.js.map} +1 -1
- package/dist/chunk-VFCMR5GX.js +49 -0
- package/dist/chunk-VFCMR5GX.js.map +1 -0
- package/dist/{chunk-HRCWJLCZ.js → chunk-YEA4BZOL.js} +8 -4
- package/dist/chunk-YEA4BZOL.js.map +1 -0
- package/dist/{chunk-XR3KUHJ5.js → chunk-Z2423JIB.js} +3 -3
- package/dist/{chunk-XR3KUHJ5.js.map → chunk-Z2423JIB.js.map} +1 -1
- package/dist/database/index.js +2 -2
- package/dist/event-queue/index.d.ts +3 -3
- package/dist/export/index.js +4 -3
- package/dist/feature-flags/index.d.ts +1 -1
- package/dist/feature-flags/index.js +2 -1
- package/dist/gateway/index.d.ts +1 -1
- package/dist/gateway/index.js +3 -2
- package/dist/gateway/security/index.js +1 -1
- package/dist/graph/index.d.ts +4 -3
- package/dist/graph/index.js +2 -2
- package/dist/{graphql-CNhiZ89U.d.ts → graphql-BRj5KPOL.d.ts} +3 -2
- package/dist/{index-DraeealK.d.ts → index-1qCbBvKE.d.ts} +2 -2
- package/dist/{index-D7BJuXP3.d.ts → index-B3ECnOLp.d.ts} +2 -2
- package/dist/{index-CVFEyBvK.d.ts → index-BIhZJ1w7.d.ts} +1 -1
- package/dist/{index-DYQF_AIz.d.ts → index-BN_-AWdb.d.ts} +2 -2
- package/dist/{index-jOuh_TKn.d.ts → index-BdPnlJ8_.d.ts} +2 -0
- package/dist/{index-BKjt3X8L.d.ts → index-Bm6MYdqS.d.ts} +5 -2
- package/dist/{index-B-w7NWpD.d.ts → index-CNy4MwKc.d.ts} +1 -1
- package/dist/{index-D9RN6jp1.d.ts → index-DDCOGyYh.d.ts} +4 -0
- package/dist/{index-DohlGQGw.d.ts → index-DsBZRR82.d.ts} +3 -3
- package/dist/index.d.ts +15 -15
- package/dist/index.js +113 -32
- package/dist/index.js.map +1 -1
- package/dist/init/index.js +4 -3
- package/dist/instrumentation/index.d.ts +4 -3
- package/dist/logger/index.d.ts +3 -2
- package/dist/notifications/index.d.ts +4 -3
- package/dist/notifications/index.js +2 -2
- package/dist/rbac/index.d.ts +2 -2
- package/dist/rbac/index.js +2 -2
- package/dist/resource-caps/index.d.ts +3 -2
- package/dist/telemetry/index.d.ts +5 -4
- package/dist/telemetry/index.js.map +1 -1
- package/dist/tracker/index.d.ts +5 -4
- package/dist/tracker/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-HRCWJLCZ.js.map +0 -1
- package/dist/chunk-L2P4CJUR.js.map +0 -1
- package/dist/chunk-N7UJFZQH.js.map +0 -1
- package/dist/chunk-SMGTXYFR.js.map +0 -1
package/dist/database/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { DatabaseModule, closeClickHouseConnection, createTable, executeQuery, getClickHouseClient, getClickHouseStats, insertData, testClickHouseConnection } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { DatabaseModule, closeClickHouseConnection, createTable, executeQuery, getClickHouseClient, getClickHouseStats, insertData, testClickHouseConnection } from '../chunk-4OQRBSHM.js';
|
|
2
|
+
import '../chunk-EZ4PKRUK.js';
|
|
3
3
|
import '../chunk-YFOHAHZE.js';
|
|
4
4
|
import '../chunk-CBZNP6RF.js';
|
|
5
5
|
import '../chunk-XE4OXN2W.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as AcknowledgeableEvent, B as BaseQueueConfig, a as BulkEventPayload, C as ConsumerConfig, b as ConsumerOptions, c as EventHandler, d as EventMessage, e as EventMetadata, f as EventPriority, g as EventQueueFactory, h as EventQueueHealthCheckResult, E as EventsModule, j as GraphQLEventMessage, h as HealthCheckResult, k as IEventConsumer, I as IEventPublisher, l as IEventQueue, m as ISubscription, M as MemoryEventBus, n as MemoryEventConsumer, o as MemoryEventPublisher, p as MemoryEventQueue, q as ModuleEventPayload, r as ModuleEventsConfig, s as ModuleEventsService, P as PublishEventOptions, t as PublishOptions, u as PublishResult, v as PublisherConfig, Q as QueueStatistics, w as QueueType, R as RedisStreamsConnection, x as RedisStreamsEventConsumer, y as RedisStreamsEventPublisher, S as StreamConfig, z as StreamInfo, D as SubscribeOptions, F as SubscriptionOptions, G as createConsumer, H as createMemoryConsumer, J as createMemoryGraphEventEmitter, K as createMemoryPublisher, L as createModuleEventsService, N as createPublisher, O as redisDlqKey, T as redisStreamKey } from '../index-
|
|
1
|
+
export { A as AcknowledgeableEvent, B as BaseQueueConfig, a as BulkEventPayload, C as ConsumerConfig, b as ConsumerOptions, c as EventHandler, d as EventMessage, e as EventMetadata, f as EventPriority, g as EventQueueFactory, h as EventQueueHealthCheckResult, E as EventsModule, j as GraphQLEventMessage, h as HealthCheckResult, k as IEventConsumer, I as IEventPublisher, l as IEventQueue, m as ISubscription, M as MemoryEventBus, n as MemoryEventConsumer, o as MemoryEventPublisher, p as MemoryEventQueue, q as ModuleEventPayload, r as ModuleEventsConfig, s as ModuleEventsService, P as PublishEventOptions, t as PublishOptions, u as PublishResult, v as PublisherConfig, Q as QueueStatistics, w as QueueType, R as RedisStreamsConnection, x as RedisStreamsEventConsumer, y as RedisStreamsEventPublisher, S as StreamConfig, z as StreamInfo, D as SubscribeOptions, F as SubscriptionOptions, G as createConsumer, H as createMemoryConsumer, J as createMemoryGraphEventEmitter, K as createMemoryPublisher, L as createModuleEventsService, N as createPublisher, O as redisDlqKey, T as redisStreamKey } from '../index-B3ECnOLp.js';
|
|
2
2
|
export { E as EntityEventRbacMetadata, a as EntityEventType, b as GraphEventEmitter, G as GraphEventEmitterImpl, c as createGraphEventEmitter, g as getGraphEventEmitter, r as resetGraphEventEmitter } from '../graph-emitter-r5TylDBm.js';
|
|
3
3
|
import '../layer-GNAVXBMf.js';
|
|
4
|
-
import '../graphql-
|
|
4
|
+
import '../graphql-BRj5KPOL.js';
|
|
5
5
|
import 'graphql-request';
|
|
6
|
-
import '../index-
|
|
6
|
+
import '../index-DDCOGyYh.js';
|
package/dist/export/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { BaseModuleExporter, PaginationService, convertToCSV, csvToJSON, estimateCSVSize, getCSVHeaders, parseCSV, triggerExportJob } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { BaseModuleExporter, PaginationService, convertToCSV, csvToJSON, estimateCSVSize, getCSVHeaders, parseCSV, triggerExportJob } from '../chunk-UJI2S556.js';
|
|
2
|
+
import '../chunk-OWUVYM2S.js';
|
|
3
|
+
import '../chunk-B527JLOB.js';
|
|
4
4
|
import '../chunk-UIMPJNWC.js';
|
|
5
|
+
import '../chunk-VFCMR5GX.js';
|
|
5
6
|
import '../chunk-DXX6C6X6.js';
|
|
6
7
|
import '../chunk-YFOHAHZE.js';
|
|
7
8
|
import '../chunk-CBZNP6RF.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { E as EvaluationContext, F as FeatureFlagProvider, a as FeatureFlagProviderConfig, b as FlagEvaluation, c as FlagType, R as ResolutionDetails } from '../index-
|
|
1
|
+
export { E as EvaluationContext, F as FeatureFlagProvider, a as FeatureFlagProviderConfig, b as FlagEvaluation, c as FlagType, R as ResolutionDetails } from '../index-BdPnlJ8_.js';
|
package/dist/gateway/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as CircuitBreakerStats, a as CircuitState, G as GatewayClient, b as GatewayClientConfig, c as GatewayClientHealth, d as GatewayError, e as GatewayErrorType, f as GraphQLError, g as GraphQLRequestOptions, h as GraphQLResponse, I as ICircuitBreaker, j as IGatewayClient, R as RequestContext, k as createGatewayClient, l as createGatewayClientFromEnv } from '../index-
|
|
1
|
+
export { C as CircuitBreakerStats, a as CircuitState, G as GatewayClient, b as GatewayClientConfig, c as GatewayClientHealth, d as GatewayError, e as GatewayErrorType, f as GraphQLError, g as GraphQLRequestOptions, h as GraphQLResponse, I as ICircuitBreaker, j as IGatewayClient, R as RequestContext, k as createGatewayClient, l as createGatewayClientFromEnv, s as signServiceJwt } from '../index-Bm6MYdqS.js';
|
|
2
2
|
export { i as Security } from '../index-UhkH2eaB.js';
|
|
3
3
|
import '../layer-GNAVXBMf.js';
|
|
4
4
|
import 'graphql-yoga';
|
package/dist/gateway/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { CircuitState, GatewayClient, GatewayError, GatewayErrorType, createGatewayClient, createGatewayClientFromEnv } from '../chunk-
|
|
2
|
-
export { security_exports as Security } from '../chunk-
|
|
1
|
+
export { CircuitState, GatewayClient, GatewayError, GatewayErrorType, createGatewayClient, createGatewayClientFromEnv } from '../chunk-OWUVYM2S.js';
|
|
2
|
+
export { security_exports as Security } from '../chunk-B527JLOB.js';
|
|
3
3
|
import '../chunk-UIMPJNWC.js';
|
|
4
|
+
export { signServiceJwt } from '../chunk-VFCMR5GX.js';
|
|
4
5
|
import '../chunk-DXX6C6X6.js';
|
|
5
6
|
import '../chunk-YFOHAHZE.js';
|
|
6
7
|
import '../chunk-CBZNP6RF.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DEFAULT_ARMOR_CONFIG, DEFAULT_COST_MAP, DEFAULT_TIERS, MemoryValkey, __resetMetricsForTest, __setSecurityValkeyForTest, buildSecurityPlugins, checkRateLimit, createArmorPlugins, createOperationTimeoutPlugin, createOtelPlugin, createQueryComplexityPlugin, createRateLimitPlugin, getMetrics, getSecurityValkey, initializeMetrics, initializeOtel, initializeSecurityValkey, mergeCostMap, resolveActor, resolveSecurityOptionsFromEnv, resolveTiersFromEnv, scrapeMetrics, shutdownOtel } from '../../chunk-
|
|
1
|
+
export { DEFAULT_ARMOR_CONFIG, DEFAULT_COST_MAP, DEFAULT_TIERS, MemoryValkey, __resetMetricsForTest, __setSecurityValkeyForTest, buildSecurityPlugins, checkRateLimit, createArmorPlugins, createOperationTimeoutPlugin, createOtelPlugin, createQueryComplexityPlugin, createRateLimitPlugin, getMetrics, getSecurityValkey, initializeMetrics, initializeOtel, initializeSecurityValkey, mergeCostMap, resolveActor, resolveSecurityOptionsFromEnv, resolveTiersFromEnv, scrapeMetrics, shutdownOtel } from '../../chunk-B527JLOB.js';
|
|
2
2
|
import '../../chunk-CBZNP6RF.js';
|
|
3
3
|
import '../../chunk-XE4OXN2W.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/graph/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import '../graphql-
|
|
2
|
-
import '../index-
|
|
3
|
-
export { A as AUDIT_FIELDS, C as CreateEdgeOptions, a as CreateNodeOptions, D as DefineEntityConfigOptions, b as DefineGraphConfigOptions, c as DefineRelationshipConfigOptions, E as EdgeDocument, d as EntityDefinition, e as EntityEventContext, f as EntityEventData, g as EntityEventHook, h as EntityFetcher, j as EntityGraphConfig, k as EntityRbacConfig, l as EntityVertex, m as ExtractedEntityData, n as ExtractedRelationshipData, F as FieldMapper, o as GenericEntityConfig, p as GenericEntityRbacConfig, q as GenericGraphConfig, r as GenericRelationshipConfig, s as GraphEdge, t as GraphEntityConfig, u as GraphEntityExport, v as GraphEvent, w as GraphEventOptions, x as GraphEventPublishOptions, y as GraphEventType, z as GraphEventsHelper, B as GraphEventsHelperConfig, H as GraphEventsPublisher, I as GraphExportResponse, J as GraphExportService, K as GraphExportServiceConfig, G as GraphModule, L as GraphNode, M as GraphRegistry, N as GraphRelationshipData, O as GraphRelationshipExport, P as GraphSchema, Q as GraphValidationError, R as GraphValidationResult, S as InitializeGraphOptions, T as ModuleGraph, U as ModuleGraphConfig, V as ModuleGraphDefinition, W as PrismaGraphIntegration, X as PrismaGraphIntegrationOptions, Y as ProductFacet, Z as QueryGraphOptions, _ as RelationshipDefinition, $ as RelationshipEventData, a0 as RelationshipExportData, a1 as RelationshipFetcher, a2 as RelationshipGraphConfig, a3 as SOFT_DELETE_FIELDS, a4 as STANDARD_FIELDS, a5 as SearchFacets, a6 as SearchFilters, a7 as SearchResponse, a8 as SearchResult, a9 as TENANT_FIELDS, aa as TraverseDirection, ab as TraverseOptions, ac as TraverseResult, ad as TypeFacet, ae as ValidationErrorType, af as createEntityEvent, ag as createGraphEventsHelper, ah as createGraphExportService, ai as createPrismaGraphIntegration, aj as createRelationshipEvent, ak as createRelationshipFromEntity, al as defineEntity, am as defineGraphConfig, an as defineModuleGraph, ao as defineRelationship, ap as extractEntityTitle, aq as extractMinimalFields, ar as getCollectionForEntity, as as getGraphEventsPublisher, at as getGraphStats, au as initializeGraph, av as isGraphInitialized, aw as parseRelationship, ax as shouldSyncEntity, ay as shouldSyncRelationship } from '../index-
|
|
1
|
+
import '../graphql-BRj5KPOL.js';
|
|
2
|
+
import '../index-DDCOGyYh.js';
|
|
3
|
+
export { A as AUDIT_FIELDS, C as CreateEdgeOptions, a as CreateNodeOptions, D as DefineEntityConfigOptions, b as DefineGraphConfigOptions, c as DefineRelationshipConfigOptions, E as EdgeDocument, d as EntityDefinition, e as EntityEventContext, f as EntityEventData, g as EntityEventHook, h as EntityFetcher, j as EntityGraphConfig, k as EntityRbacConfig, l as EntityVertex, m as ExtractedEntityData, n as ExtractedRelationshipData, F as FieldMapper, o as GenericEntityConfig, p as GenericEntityRbacConfig, q as GenericGraphConfig, r as GenericRelationshipConfig, s as GraphEdge, t as GraphEntityConfig, u as GraphEntityExport, v as GraphEvent, w as GraphEventOptions, x as GraphEventPublishOptions, y as GraphEventType, z as GraphEventsHelper, B as GraphEventsHelperConfig, H as GraphEventsPublisher, I as GraphExportResponse, J as GraphExportService, K as GraphExportServiceConfig, G as GraphModule, L as GraphNode, M as GraphRegistry, N as GraphRelationshipData, O as GraphRelationshipExport, P as GraphSchema, Q as GraphValidationError, R as GraphValidationResult, S as InitializeGraphOptions, T as ModuleGraph, U as ModuleGraphConfig, V as ModuleGraphDefinition, W as PrismaGraphIntegration, X as PrismaGraphIntegrationOptions, Y as ProductFacet, Z as QueryGraphOptions, _ as RelationshipDefinition, $ as RelationshipEventData, a0 as RelationshipExportData, a1 as RelationshipFetcher, a2 as RelationshipGraphConfig, a3 as SOFT_DELETE_FIELDS, a4 as STANDARD_FIELDS, a5 as SearchFacets, a6 as SearchFilters, a7 as SearchResponse, a8 as SearchResult, a9 as TENANT_FIELDS, aa as TraverseDirection, ab as TraverseOptions, ac as TraverseResult, ad as TypeFacet, ae as ValidationErrorType, af as createEntityEvent, ag as createGraphEventsHelper, ah as createGraphExportService, ai as createPrismaGraphIntegration, aj as createRelationshipEvent, ak as createRelationshipFromEntity, al as defineEntity, am as defineGraphConfig, an as defineModuleGraph, ao as defineRelationship, ap as extractEntityTitle, aq as extractMinimalFields, ar as getCollectionForEntity, as as getGraphEventsPublisher, at as getGraphStats, au as initializeGraph, av as isGraphInitialized, aw as parseRelationship, ax as shouldSyncEntity, ay as shouldSyncRelationship } from '../index-BN_-AWdb.js';
|
|
4
4
|
export { E as EntityEventType, G as GraphEventEmitter, a as GraphMiddlewareConfig, b as addGraphExtension } from '../prisma-extension-krXnYnrN.js';
|
|
5
5
|
import 'graphql-request';
|
|
6
|
+
import '../layer-GNAVXBMf.js';
|
|
6
7
|
import '../client-CSjIrYKS.js';
|
|
7
8
|
import '@prisma/adapter-pg';
|
|
8
9
|
import 'pg';
|
package/dist/graph/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { AUDIT_FIELDS, GraphEventsPublisher, GraphExportService, GraphModule, SOFT_DELETE_FIELDS, STANDARD_FIELDS, TENANT_FIELDS, createGraphEventsHelper, createGraphExportService, createPrismaGraphIntegration, createRelationshipFromEntity, defineEntity, defineGraphConfig, defineModuleGraph, defineRelationship, getGraphEventsPublisher, getGraphStats, initializeGraph, isGraphInitialized } from '../chunk-
|
|
1
|
+
export { AUDIT_FIELDS, GraphEventsPublisher, GraphExportService, GraphModule, SOFT_DELETE_FIELDS, STANDARD_FIELDS, TENANT_FIELDS, createGraphEventsHelper, createGraphExportService, createPrismaGraphIntegration, createRelationshipFromEntity, defineEntity, defineGraphConfig, defineModuleGraph, defineRelationship, getGraphEventsPublisher, getGraphStats, initializeGraph, isGraphInitialized } from '../chunk-Z2423JIB.js';
|
|
2
2
|
export { GraphRegistry, addGraphExtension, createEntityEvent, createRelationshipEvent, extractEntityTitle, extractMinimalFields, getCollectionForEntity, parseRelationship, shouldSyncEntity, shouldSyncRelationship } from '../chunk-5CESUKWC.js';
|
|
3
3
|
import '../chunk-H3AXO5SY.js';
|
|
4
4
|
import '../chunk-OHEPNJ2X.js';
|
|
5
5
|
import '../chunk-MQCVQCFA.js';
|
|
6
6
|
import '../chunk-MHNA7IS7.js';
|
|
7
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-EZ4PKRUK.js';
|
|
8
8
|
import '../chunk-YFOHAHZE.js';
|
|
9
9
|
import '../chunk-CBZNP6RF.js';
|
|
10
10
|
import '../chunk-XE4OXN2W.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Variables } from 'graphql-request';
|
|
2
|
-
import { a as SDKConfig, S as SDKContext } from './index-
|
|
2
|
+
import { a as SDKConfig, S as SDKContext } from './index-DDCOGyYh.js';
|
|
3
3
|
|
|
4
4
|
declare class BurdenoffGraphQLClient {
|
|
5
5
|
private workspacesClient;
|
|
6
|
-
private
|
|
6
|
+
private tenantGateway?;
|
|
7
7
|
private config;
|
|
8
8
|
private defaultContext;
|
|
9
9
|
constructor(config: SDKConfig, defaultContext?: SDKContext);
|
|
@@ -11,6 +11,7 @@ declare class BurdenoffGraphQLClient {
|
|
|
11
11
|
updateContext(context: Partial<SDKContext>): void;
|
|
12
12
|
query<T>(query: string, variables?: Variables, context?: SDKContext): Promise<T>;
|
|
13
13
|
tenantQuery<T>(query: string, variables?: Variables, context?: SDKContext): Promise<T>;
|
|
14
|
+
private mapTenantError;
|
|
14
15
|
private executeQuery;
|
|
15
16
|
private executeWithRetry;
|
|
16
17
|
private shouldRetry;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BurdenoffGraphQLClient } from './graphql-
|
|
2
|
-
import { S as SDKContext } from './index-
|
|
1
|
+
import { B as BurdenoffGraphQLClient } from './graphql-BRj5KPOL.js';
|
|
2
|
+
import { S as SDKContext } from './index-DDCOGyYh.js';
|
|
3
3
|
|
|
4
4
|
declare enum NotificationChannel$1 {
|
|
5
5
|
EMAIL = "EMAIL",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { S as ServiceLayer } from './layer-GNAVXBMf.js';
|
|
2
2
|
import { E as EntityEventRbacMetadata, a as EntityEventType$1, b as GraphEventEmitter$1, G as GraphEventEmitterImpl, c as createGraphEventEmitter$1, g as getGraphEventEmitter, r as resetGraphEventEmitter } from './graph-emitter-r5TylDBm.js';
|
|
3
|
-
import { B as BurdenoffGraphQLClient } from './graphql-
|
|
4
|
-
import { S as SDKContext } from './index-
|
|
3
|
+
import { B as BurdenoffGraphQLClient } from './graphql-BRj5KPOL.js';
|
|
4
|
+
import { S as SDKContext } from './index-DDCOGyYh.js';
|
|
5
5
|
|
|
6
6
|
interface EventMessage$1<T = unknown> {
|
|
7
7
|
id: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BurdenoffGraphQLClient } from './graphql-
|
|
2
|
-
import { S as SDKContext } from './index-
|
|
1
|
+
import { B as BurdenoffGraphQLClient } from './graphql-BRj5KPOL.js';
|
|
2
|
+
import { S as SDKContext } from './index-DDCOGyYh.js';
|
|
3
3
|
import { P as PrismaClientBase } from './client-CSjIrYKS.js';
|
|
4
4
|
import { G as GraphEventEmitterImpl, E as EntityEventRbacMetadata } from './graph-emitter-r5TylDBm.js';
|
|
5
5
|
import { G as GraphEventEmitter, E as EntityEventType, a as GraphMiddlewareConfig, b as addGraphExtension } from './prisma-extension-krXnYnrN.js';
|
|
@@ -23,6 +23,7 @@ interface FeatureFlagProviderConfig {
|
|
|
23
23
|
gatewayUrl: string;
|
|
24
24
|
cacheTtlSeconds?: number;
|
|
25
25
|
serviceToken?: string;
|
|
26
|
+
serviceName?: string;
|
|
26
27
|
defaultActorType?: 'user' | 'app' | 'service' | 'super_admin';
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -30,6 +31,7 @@ declare class FeatureFlagProvider {
|
|
|
30
31
|
private readonly gatewayUrl;
|
|
31
32
|
private readonly cacheTtlMs;
|
|
32
33
|
private readonly serviceToken?;
|
|
34
|
+
private readonly serviceName;
|
|
33
35
|
private readonly defaultActorType;
|
|
34
36
|
private readonly cache;
|
|
35
37
|
constructor(config: FeatureFlagProviderConfig);
|
|
@@ -137,6 +137,8 @@ declare class GatewayClient implements IGatewayClient {
|
|
|
137
137
|
declare function createGatewayClient(config: GatewayClientConfig): GatewayClient;
|
|
138
138
|
declare function createGatewayClientFromEnv(): GatewayClient;
|
|
139
139
|
|
|
140
|
+
declare function signServiceJwt(actorId: string, ttlSeconds?: number): Promise<string | null>;
|
|
141
|
+
|
|
140
142
|
type index_CircuitBreakerStats = CircuitBreakerStats;
|
|
141
143
|
type index_CircuitState = CircuitState;
|
|
142
144
|
declare const index_CircuitState: typeof CircuitState;
|
|
@@ -156,8 +158,9 @@ type index_IGatewayClient = IGatewayClient;
|
|
|
156
158
|
type index_RequestContext = RequestContext;
|
|
157
159
|
declare const index_createGatewayClient: typeof createGatewayClient;
|
|
158
160
|
declare const index_createGatewayClientFromEnv: typeof createGatewayClientFromEnv;
|
|
161
|
+
declare const index_signServiceJwt: typeof signServiceJwt;
|
|
159
162
|
declare namespace index {
|
|
160
|
-
export { type index_CircuitBreakerStats as CircuitBreakerStats, index_CircuitState as CircuitState, index_GatewayClient as GatewayClient, type index_GatewayClientConfig as GatewayClientConfig, type index_GatewayClientHealth as GatewayClientHealth, index_GatewayError as GatewayError, index_GatewayErrorType as GatewayErrorType, type index_GraphQLError as GraphQLError, type index_GraphQLRequestOptions as GraphQLRequestOptions, type index_GraphQLResponse as GraphQLResponse, type index_ICircuitBreaker as ICircuitBreaker, type index_IGatewayClient as IGatewayClient, type index_RequestContext as RequestContext, index$1 as Security, index_createGatewayClient as createGatewayClient, index_createGatewayClientFromEnv as createGatewayClientFromEnv };
|
|
163
|
+
export { type index_CircuitBreakerStats as CircuitBreakerStats, index_CircuitState as CircuitState, index_GatewayClient as GatewayClient, type index_GatewayClientConfig as GatewayClientConfig, type index_GatewayClientHealth as GatewayClientHealth, index_GatewayError as GatewayError, index_GatewayErrorType as GatewayErrorType, type index_GraphQLError as GraphQLError, type index_GraphQLRequestOptions as GraphQLRequestOptions, type index_GraphQLResponse as GraphQLResponse, type index_ICircuitBreaker as ICircuitBreaker, type index_IGatewayClient as IGatewayClient, type index_RequestContext as RequestContext, index$1 as Security, index_createGatewayClient as createGatewayClient, index_createGatewayClientFromEnv as createGatewayClientFromEnv, index_signServiceJwt as signServiceJwt };
|
|
161
164
|
}
|
|
162
165
|
|
|
163
|
-
export { type CircuitBreakerStats as C, GatewayClient as G, type ICircuitBreaker as I, type RequestContext as R, CircuitState as a, type GatewayClientConfig as b, type GatewayClientHealth as c, GatewayError as d, GatewayErrorType as e, type GraphQLError as f, type GraphQLRequestOptions as g, type GraphQLResponse as h, index as i, type IGatewayClient as j, createGatewayClient as k, createGatewayClientFromEnv as l };
|
|
166
|
+
export { type CircuitBreakerStats as C, GatewayClient as G, type ICircuitBreaker as I, type RequestContext as R, CircuitState as a, type GatewayClientConfig as b, type GatewayClientHealth as c, GatewayError as d, GatewayErrorType as e, type GraphQLError as f, type GraphQLRequestOptions as g, type GraphQLResponse as h, index as i, type IGatewayClient as j, createGatewayClient as k, createGatewayClientFromEnv as l, signServiceJwt as s };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as BurdenoffGraphQLClient } from './graphql-
|
|
2
|
-
import { S as SDKContext } from './index-
|
|
3
|
-
import { N as NotificationType } from './index-
|
|
1
|
+
import { B as BurdenoffGraphQLClient } from './graphql-BRj5KPOL.js';
|
|
2
|
+
import { S as SDKContext } from './index-DDCOGyYh.js';
|
|
3
|
+
import { N as NotificationType } from './index-1qCbBvKE.js';
|
|
4
4
|
|
|
5
5
|
declare enum ActivityType {
|
|
6
6
|
CREATE = "create",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { S as SDKContext, a as SDKConfig, E as EventQueueHealthStatus, T as TemporalHealthStatus, b as SDKHealthStatus, c as SDKShutdownOptions } from './index-
|
|
2
|
-
export { d as EventQueueSDKConfig, L as LoggerConfig, e as LoggerTransport } from './index-
|
|
3
|
-
import { L as Logger } from './index-
|
|
4
|
-
export { i as Logger } from './index-
|
|
1
|
+
import { S as SDKContext, a as SDKConfig, E as EventQueueHealthStatus, T as TemporalHealthStatus, b as SDKHealthStatus, c as SDKShutdownOptions } from './index-DDCOGyYh.js';
|
|
2
|
+
export { d as EventQueueSDKConfig, L as LoggerConfig, e as LoggerTransport } from './index-DDCOGyYh.js';
|
|
3
|
+
import { L as Logger } from './index-CNy4MwKc.js';
|
|
4
|
+
export { i as Logger } from './index-CNy4MwKc.js';
|
|
5
5
|
import { AuthModule } from './auth/index.js';
|
|
6
|
-
import { T as TenantNotificationsModule, a as NotificationsModule } from './index-
|
|
7
|
-
export { t as Notifications } from './index-
|
|
6
|
+
import { T as TenantNotificationsModule, a as NotificationsModule } from './index-1qCbBvKE.js';
|
|
7
|
+
export { t as Notifications } from './index-1qCbBvKE.js';
|
|
8
8
|
import { RBACModule } from './rbac/index.js';
|
|
9
9
|
export { LayerAwareRBACConfig, RBACDirectiveConfig, createRBACDirective, createRBACDirectiveForLayer, createRBACDirectiveFromEnv } from './rbac/index.js';
|
|
10
|
-
import { A as ActivityModule, U as UsageModule, T as TrackerModule } from './index-
|
|
10
|
+
import { A as ActivityModule, U as UsageModule, T as TrackerModule } from './index-DsBZRR82.js';
|
|
11
11
|
import { DatabaseConfig, DatabaseModule } from './database/index.js';
|
|
12
|
-
import { E as EventsModule, I as IEventPublisher } from './index-
|
|
13
|
-
export { i as EventQueue } from './index-
|
|
14
|
-
import { G as GraphModule } from './index-
|
|
15
|
-
export { i as Graph } from './index-
|
|
16
|
-
import { B as BurdenoffGraphQLClient } from './graphql-
|
|
12
|
+
import { E as EventsModule, I as IEventPublisher } from './index-B3ECnOLp.js';
|
|
13
|
+
export { i as EventQueue } from './index-B3ECnOLp.js';
|
|
14
|
+
import { G as GraphModule } from './index-BN_-AWdb.js';
|
|
15
|
+
export { i as Graph } from './index-BN_-AWdb.js';
|
|
16
|
+
import { B as BurdenoffGraphQLClient } from './graphql-BRj5KPOL.js';
|
|
17
17
|
import { TemporalModule } from './temporal/index.js';
|
|
18
18
|
export { TemporalClient, TemporalClientConfig, TemporalClientFactory, TemporalWorker, TemporalWorkerConfig, TemporalWorkerFactory, TemporalWorkerManager, WorkflowStartOptions } from './temporal/index.js';
|
|
19
19
|
export { createInternalClient, createInternalClientForTenant, createInternalClientForWorkspaces } from './client/internal-client.js';
|
|
@@ -29,11 +29,11 @@ export { i as I18n, I as I18nCapableContext, T as Translator, c as createTransla
|
|
|
29
29
|
export { i as Export } from './index-B4ciT3OZ.js';
|
|
30
30
|
export { i as Init } from './index-B0ebYV9W.js';
|
|
31
31
|
export { i as DataLoader } from './index-DW9q22GH.js';
|
|
32
|
-
export { a as Instrumentation } from './index-
|
|
32
|
+
export { a as Instrumentation } from './index-BIhZJ1w7.js';
|
|
33
33
|
export { i as Layer } from './index-BCUkR8sC.js';
|
|
34
34
|
export { i as Crypto } from './index-e_18DzAg.js';
|
|
35
|
-
export { i as Gateway } from './index-
|
|
36
|
-
export { i as FeatureFlags } from './index-
|
|
35
|
+
export { i as Gateway } from './index-Bm6MYdqS.js';
|
|
36
|
+
export { i as FeatureFlags } from './index-BdPnlJ8_.js';
|
|
37
37
|
export { i as Captcha, R as RecaptchaVerifyOptions, a as RecaptchaVerifyResult, b as isCaptchaEnabled, v as verifyCaptcha, c as verifyCaptchaIfEnabled } from './index-B70b5mYS.js';
|
|
38
38
|
export { i as Platform } from './index-BQ1yJn1K.js';
|
|
39
39
|
export { C as CircuitBreakerConfig, h as DEFAULT_CIRCUIT_BREAKER_CONFIG, i as DEFAULT_GATEWAY_RETRY_CONFIG, D as DEFAULT_GATEWAY_ROUTING, b as DEFAULT_LAYER_RESOURCES, c as DEFAULT_LAYER_STREAMS, f as GatewayRequestHeaders, g as GatewayRetryConfig, G as GatewayRoutingConfig, L as LayerConfig, a as LayerFullConfig, d as LayerGatewayConfig, e as LayerResourceUrls, S as ServiceLayer } from './layer-GNAVXBMf.js';
|
package/dist/index.js
CHANGED
|
@@ -3,21 +3,21 @@ export { RESOURCE_CAP_DEFAULTS, ResourceCapExceededError, ResourceCapsModule, ge
|
|
|
3
3
|
import './chunk-GTEMQXCA.js';
|
|
4
4
|
export { sharing_exports as Sharing } from './chunk-XD5ZK727.js';
|
|
5
5
|
export { TemporalClient, TemporalClientFactory, TemporalModule, TemporalWorker, TemporalWorkerFactory, TemporalWorkerManager } from './chunk-IC7YDBGE.js';
|
|
6
|
-
import { ActivityModule, UsageModule, TrackerModule } from './chunk-
|
|
7
|
-
export { ActivityModule, TrackerModule, UsageModule } from './chunk-
|
|
8
|
-
import { RBACModule } from './chunk-
|
|
9
|
-
export { RBACModule, createRBACDirective, createRBACDirectiveForLayer, createRBACDirectiveFromEnv } from './chunk-
|
|
6
|
+
import { ActivityModule, UsageModule, TrackerModule } from './chunk-TYXGWVRL.js';
|
|
7
|
+
export { ActivityModule, TrackerModule, UsageModule } from './chunk-TYXGWVRL.js';
|
|
8
|
+
import { RBACModule } from './chunk-6NB7P6SR.js';
|
|
9
|
+
export { RBACModule, createRBACDirective, createRBACDirectiveForLayer, createRBACDirectiveFromEnv } from './chunk-6NB7P6SR.js';
|
|
10
10
|
export { instrumentation_exports as Instrumentation } from './chunk-ACYGOENW.js';
|
|
11
11
|
import './chunk-REF7PANB.js';
|
|
12
12
|
export { middleware_exports as Middleware } from './chunk-2HANKZZM.js';
|
|
13
|
-
import { TenantNotificationsModule, NotificationsModule } from './chunk-ZHQUXD6S.js';
|
|
14
|
-
export { tenant_notifications_exports as Notifications, NotificationsModule } from './chunk-ZHQUXD6S.js';
|
|
15
13
|
export { observability_exports as Observability } from './chunk-5LXDPGDH.js';
|
|
14
|
+
import { TenantNotificationsModule, NotificationsModule } from './chunk-IUL5TEKE.js';
|
|
15
|
+
export { tenant_notifications_exports as Notifications, NotificationsModule } from './chunk-IUL5TEKE.js';
|
|
16
16
|
export { platform_exports as Platform } from './chunk-PHKK7725.js';
|
|
17
|
-
export { export_exports as Export } from './chunk-
|
|
18
|
-
export { feature_flags_exports as FeatureFlags } from './chunk-
|
|
19
|
-
import { GraphModule } from './chunk-
|
|
20
|
-
export { graph_exports as Graph, GraphModule } from './chunk-
|
|
17
|
+
export { export_exports as Export } from './chunk-UJI2S556.js';
|
|
18
|
+
export { feature_flags_exports as FeatureFlags } from './chunk-YEA4BZOL.js';
|
|
19
|
+
import { GraphModule } from './chunk-Z2423JIB.js';
|
|
20
|
+
export { graph_exports as Graph, GraphModule } from './chunk-Z2423JIB.js';
|
|
21
21
|
import './chunk-5CESUKWC.js';
|
|
22
22
|
import { EventsModule } from './chunk-H3AXO5SY.js';
|
|
23
23
|
export { event_queue_exports as EventQueue, EventsModule } from './chunk-H3AXO5SY.js';
|
|
@@ -27,35 +27,49 @@ export { graphql_exports as GraphQL } from './chunk-X4NELQLV.js';
|
|
|
27
27
|
import './chunk-QLVKMWFA.js';
|
|
28
28
|
import './chunk-MHNA7IS7.js';
|
|
29
29
|
export { i18n_exports as I18n, createTranslator, getLanguage, getLocale, hasI18n, t } from './chunk-ULFFX3YE.js';
|
|
30
|
-
export { init_exports as Init } from './chunk-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
export { init_exports as Init } from './chunk-F5BPKP75.js';
|
|
31
|
+
import { GatewayClient, GatewayError, GatewayErrorType } from './chunk-OWUVYM2S.js';
|
|
32
|
+
export { gateway_exports as Gateway } from './chunk-OWUVYM2S.js';
|
|
33
|
+
import './chunk-B527JLOB.js';
|
|
33
34
|
export { layer_exports as Layer } from './chunk-UIMPJNWC.js';
|
|
35
|
+
import './chunk-VFCMR5GX.js';
|
|
34
36
|
import { ContextManager } from './chunk-DXX6C6X6.js';
|
|
35
37
|
export { ContextManager } from './chunk-DXX6C6X6.js';
|
|
38
|
+
import { AuthModule } from './chunk-SS4XWRYR.js';
|
|
39
|
+
export { AuthModule } from './chunk-SS4XWRYR.js';
|
|
40
|
+
export { utils_exports as Utils } from './chunk-B7I4TABG.js';
|
|
36
41
|
export { cache_exports as Cache } from './chunk-UYE4IEPT.js';
|
|
37
42
|
export { captcha_exports as Captcha, isCaptchaEnabled, verifyCaptcha, verifyCaptchaIfEnabled } from './chunk-YMZEUTD2.js';
|
|
38
43
|
export { createInternalClient, createInternalClientForTenant, createInternalClientForWorkspaces } from './chunk-VI4VSNTI.js';
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export { dataloader_exports as DataLoader } from './chunk-NUB5GQTU.js';
|
|
43
|
-
import { AuthModule } from './chunk-FKSMQLIV.js';
|
|
44
|
-
export { AuthModule } from './chunk-FKSMQLIV.js';
|
|
45
|
-
export { utils_exports as Utils } from './chunk-B7I4TABG.js';
|
|
46
|
-
import { APIError, NetworkError, TimeoutError, ValidationError } from './chunk-SMGTXYFR.js';
|
|
44
|
+
import { DatabaseModule } from './chunk-4OQRBSHM.js';
|
|
45
|
+
export { DatabaseModule } from './chunk-4OQRBSHM.js';
|
|
46
|
+
import { APIError, NetworkError, TimeoutError, ValidationError } from './chunk-EZ4PKRUK.js';
|
|
47
47
|
export { DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_GATEWAY_RETRY_CONFIG, DEFAULT_GATEWAY_ROUTING, DEFAULT_LAYER_RESOURCES, DEFAULT_LAYER_STREAMS } from './chunk-YFOHAHZE.js';
|
|
48
48
|
import { logger } from './chunk-CBZNP6RF.js';
|
|
49
49
|
export { logger_exports as Logger } from './chunk-CBZNP6RF.js';
|
|
50
|
+
export { crypto_exports as Crypto } from './chunk-SBS4S2PJ.js';
|
|
51
|
+
export { dataloader_exports as DataLoader } from './chunk-NUB5GQTU.js';
|
|
50
52
|
import { __name } from './chunk-XE4OXN2W.js';
|
|
51
53
|
import { GraphQLClient } from 'graphql-request';
|
|
52
54
|
|
|
55
|
+
function isServiceLayer(value) {
|
|
56
|
+
return value === "wspace" || value === "global";
|
|
57
|
+
}
|
|
58
|
+
__name(isServiceLayer, "isServiceLayer");
|
|
53
59
|
var BurdenoffGraphQLClient = class {
|
|
54
60
|
static {
|
|
55
61
|
__name(this, "BurdenoffGraphQLClient");
|
|
56
62
|
}
|
|
57
63
|
workspacesClient;
|
|
58
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Cross-layer (tenant) calls go through the unified GatewayClient, which
|
|
66
|
+
* targets the peer layer's PUBLIC gateway and mints a short-lived `service`
|
|
67
|
+
* actor JWT (via signServiceJwt) so the gateway admits the M2M call and the
|
|
68
|
+
* subgraph sees a trusted service context. This is the same mechanism used by
|
|
69
|
+
* `GatewayClient.crossLayerQuery` everywhere else — kept consistent here so
|
|
70
|
+
* tenant SDK calls (notifications, tenant lookups) authenticate identically.
|
|
71
|
+
*/
|
|
72
|
+
tenantGateway;
|
|
59
73
|
config;
|
|
60
74
|
defaultContext;
|
|
61
75
|
constructor(config, defaultContext = {}) {
|
|
@@ -65,8 +79,15 @@ var BurdenoffGraphQLClient = class {
|
|
|
65
79
|
headers: this.getHeaders(defaultContext)
|
|
66
80
|
});
|
|
67
81
|
if (config.tenantApiUrl) {
|
|
68
|
-
this.
|
|
69
|
-
|
|
82
|
+
this.tenantGateway = new GatewayClient({
|
|
83
|
+
layer: config.serviceLayer ?? (isServiceLayer(process.env["SERVICE_LAYER"]) ? process.env["SERVICE_LAYER"] : "wspace"),
|
|
84
|
+
serviceName: config.serviceName ?? process.env["SERVICE_NAME"] ?? "burdenoff-be-sdk",
|
|
85
|
+
crossLayerGatewayUrl: config.tenantApiUrl,
|
|
86
|
+
timeout: config.timeout,
|
|
87
|
+
// Honor the SDK's retry config (same field shape) so callers that lower
|
|
88
|
+
// maxAttempts for non-idempotent tenant mutations (e.g. notification
|
|
89
|
+
// sends) are respected instead of falling back to the gateway default.
|
|
90
|
+
retry: config.retry
|
|
70
91
|
});
|
|
71
92
|
}
|
|
72
93
|
}
|
|
@@ -104,9 +125,6 @@ var BurdenoffGraphQLClient = class {
|
|
|
104
125
|
...context
|
|
105
126
|
};
|
|
106
127
|
this.workspacesClient.setHeaders(this.getHeaders(this.defaultContext));
|
|
107
|
-
if (this.tenantClient) {
|
|
108
|
-
this.tenantClient.setHeaders(this.getHeaders(this.defaultContext));
|
|
109
|
-
}
|
|
110
128
|
}
|
|
111
129
|
/**
|
|
112
130
|
* Execute GraphQL query/mutation against workspaces API
|
|
@@ -115,15 +133,79 @@ var BurdenoffGraphQLClient = class {
|
|
|
115
133
|
return this.executeWithRetry(() => this.executeQuery(this.workspacesClient, query, variables, context), "workspaces");
|
|
116
134
|
}
|
|
117
135
|
/**
|
|
118
|
-
* Execute GraphQL query/mutation against tenant API
|
|
136
|
+
* Execute GraphQL query/mutation against the tenant (cross-layer) API.
|
|
137
|
+
*
|
|
138
|
+
* Routed through GatewayClient.crossLayerQuery: targets the peer layer's
|
|
139
|
+
* PUBLIC gateway and mints a short-lived `service` actor JWT. Only routing
|
|
140
|
+
* context (workspace / product) is forwarded — the end-user identity is not,
|
|
141
|
+
* because cross-layer tenant operations are service-to-service M2M. Retry and
|
|
142
|
+
* circuit-breaking are handled inside GatewayClient.
|
|
119
143
|
*/
|
|
120
144
|
async tenantQuery(query, variables, context) {
|
|
121
|
-
if (!this.
|
|
145
|
+
if (!this.tenantGateway) {
|
|
122
146
|
throw new APIError("Tenant API URL not configured", {
|
|
123
147
|
operation: "tenantQuery"
|
|
124
148
|
});
|
|
125
149
|
}
|
|
126
|
-
|
|
150
|
+
const mergedContext = {
|
|
151
|
+
...this.defaultContext,
|
|
152
|
+
...context
|
|
153
|
+
};
|
|
154
|
+
const headers = {};
|
|
155
|
+
if (mergedContext.workspaceId) {
|
|
156
|
+
headers["x-workspace-id"] = mergedContext.workspaceId;
|
|
157
|
+
}
|
|
158
|
+
if (mergedContext.productId) {
|
|
159
|
+
headers["x-product-id"] = mergedContext.productId;
|
|
160
|
+
}
|
|
161
|
+
try {
|
|
162
|
+
const response = await this.tenantGateway.crossLayerQuery({
|
|
163
|
+
query,
|
|
164
|
+
variables,
|
|
165
|
+
headers
|
|
166
|
+
});
|
|
167
|
+
if (response.data == null) {
|
|
168
|
+
throw new APIError("Tenant query returned no data", {
|
|
169
|
+
api: "tenant"
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
return response.data;
|
|
173
|
+
} catch (error) {
|
|
174
|
+
throw this.mapTenantError(error);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Map a GatewayClient failure back to the SDK's APIError contract so existing
|
|
179
|
+
* tenant callers (which inspect `error.message` / extensions, e.g. "Forbidden")
|
|
180
|
+
* keep working unchanged.
|
|
181
|
+
*/
|
|
182
|
+
mapTenantError(error) {
|
|
183
|
+
if (error instanceof APIError) {
|
|
184
|
+
return error;
|
|
185
|
+
}
|
|
186
|
+
if (error instanceof GatewayError) {
|
|
187
|
+
const first = error.graphqlErrors?.[0];
|
|
188
|
+
if (first) {
|
|
189
|
+
return new APIError(first.message, {
|
|
190
|
+
graphqlErrors: error.graphqlErrors,
|
|
191
|
+
extensions: first.extensions
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
if (error.type === GatewayErrorType.NETWORK_ERROR) {
|
|
195
|
+
return new NetworkError(error.message, {
|
|
196
|
+
gatewayErrorType: error.type
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
if (error.type === GatewayErrorType.TIMEOUT_ERROR) {
|
|
200
|
+
return new TimeoutError(error.message, {
|
|
201
|
+
gatewayErrorType: error.type
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return new APIError(error.message, {
|
|
205
|
+
gatewayErrorType: error.type
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return this.handleError(error);
|
|
127
209
|
}
|
|
128
210
|
/**
|
|
129
211
|
* Execute GraphQL request
|
|
@@ -135,8 +217,7 @@ var BurdenoffGraphQLClient = class {
|
|
|
135
217
|
...context
|
|
136
218
|
};
|
|
137
219
|
if (context) {
|
|
138
|
-
|
|
139
|
-
client.setHeaders(headers);
|
|
220
|
+
client.setHeaders(this.getHeaders(mergedContext));
|
|
140
221
|
}
|
|
141
222
|
const response = await client.request(query, variables);
|
|
142
223
|
return response;
|