@burdenoff/be-sdk 2026.1031.2 → 2026.1101.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,36 @@
1
+ import { f as GatewayRequestHeaders } from './layer-Cv9vSwBx.js';
2
+ import { I as IGatewayClient, G as GatewayClientConfig, a as GraphQLRequestOptions, b as GraphQLResponse, c as ICircuitBreaker, d as GatewayClientHealth } from './types-DgJ4lDYA.js';
3
+
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
+
36
+ export { GatewayClient as G, createGatewayClientFromEnv as a, createGatewayClient as c, isGatewayClientError as i };
@@ -1,4 +1,5 @@
1
- export { D as DELEGATED_AUTHORIZATION_HEADER, a as DelegatedGatewayTransportInput, G as GatewayClient, b as buildDelegatedGatewayHeaders, c as createGatewayClient, d as createGatewayClientFromEnv, e as isGatewayClientError, s as signServiceJwt } from '../index-szTxGaO6.js';
1
+ export { G as GatewayClient, c as createGatewayClient, a as createGatewayClientFromEnv, i as isGatewayClientError } from '../client-DSI_760t.js';
2
+ export { D as DELEGATED_AUTHORIZATION_HEADER, a as DelegatedGatewayTransportInput, b as buildDelegatedGatewayHeaders, s as signServiceJwt } from '../index-wGuKj5rr.js';
2
3
  export { C as CircuitBreakerStats, e as CircuitState, G as GatewayClientConfig, d as GatewayClientHealth, f as GatewayError, g as GatewayErrorType, h as GraphQLError, a as GraphQLRequestOptions, b as GraphQLResponse, c as ICircuitBreaker, I as IGatewayClient, R as RequestContext } from '../types-DgJ4lDYA.js';
3
4
  export { i as Security } from '../index-D3d2TAS-.js';
4
5
  import '../layer-Cv9vSwBx.js';
@@ -1,5 +1,6 @@
1
1
  import { B as BurdenoffGraphQLClient } from './graphql-BUbw43Zx.js';
2
2
  import { a as SDKContext } from './index-CV3r9Taj.js';
3
+ import { UsageMetricType } from './usage/index.js';
3
4
  import { N as NotificationType } from './index-BKOBmdq7.js';
4
5
  import { A as AssistantSessionAttribution } from './assistant-session-CJZhF4D6.js';
5
6
  import './explicit-activity-scope-CCoxVwAr.js';
@@ -123,132 +124,6 @@ declare class ActivityModule {
123
124
  exportToCSV(options: GetActivitiesOptions): Promise<string>;
124
125
  }
125
126
 
126
- declare enum UsageMetricType {
127
- API_CALLS = "api_calls",
128
- STORAGE = "storage",
129
- BANDWIDTH = "bandwidth",
130
- USERS = "users",
131
- PROJECTS = "projects",
132
- WORKSPACES = "workspaces",
133
- RECORDS = "records",
134
- COMPUTE_TIME = "compute_time",
135
- TRANSACTIONS = "transactions",
136
- CUSTOM = "custom"
137
- }
138
- declare enum QuotaPeriod {
139
- DAILY = "daily",
140
- WEEKLY = "weekly",
141
- MONTHLY = "monthly",
142
- YEARLY = "yearly",
143
- LIFETIME = "lifetime"
144
- }
145
- type UsageEntityType = 'user' | 'workspace' | 'organization';
146
- interface TrackUsageOptions {
147
- entityId: string;
148
- entityType: UsageEntityType;
149
- metricType: UsageMetricType;
150
- amount: number;
151
- resourceId?: string;
152
- metadata?: Record<string, unknown>;
153
- workspaceId?: string;
154
- organizationId?: string;
155
- }
156
- interface CheckQuotaOptions {
157
- entityId: string;
158
- entityType: UsageEntityType;
159
- metricType: UsageMetricType;
160
- requestedAmount: number;
161
- workspaceId?: string;
162
- organizationId?: string;
163
- }
164
- interface QuotaCheckResult {
165
- allowed: boolean;
166
- currentUsage: number;
167
- quotaLimit: number;
168
- remainingQuota: number;
169
- resetAt?: string;
170
- period: QuotaPeriod;
171
- reason?: string;
172
- }
173
- interface UsageRecord {
174
- id: string;
175
- entityId: string;
176
- entityType: UsageEntityType;
177
- metricType: UsageMetricType;
178
- amount: number;
179
- resourceId?: string;
180
- metadata?: Record<string, unknown>;
181
- workspaceId?: string;
182
- organizationId?: string;
183
- recordedAt: string;
184
- }
185
- interface UsageSummary {
186
- entityId: string;
187
- entityType: string;
188
- metricType: UsageMetricType;
189
- totalUsage: number;
190
- period: QuotaPeriod;
191
- periodStart: string;
192
- periodEnd: string;
193
- quotaLimit?: number;
194
- utilizationPercentage?: number;
195
- }
196
- interface SetQuotaOptions {
197
- entityId: string;
198
- entityType: UsageEntityType;
199
- metricType: UsageMetricType;
200
- limit: number;
201
- period: QuotaPeriod;
202
- workspaceId?: string;
203
- organizationId?: string;
204
- }
205
- interface Quota {
206
- id: string;
207
- entityId: string;
208
- entityType: string;
209
- metricType: UsageMetricType;
210
- limit: number;
211
- period: QuotaPeriod;
212
- currentUsage: number;
213
- resetAt: string;
214
- createdAt: string;
215
- updatedAt: string;
216
- }
217
- interface GetUsageOptions {
218
- entityId: string;
219
- entityType: UsageEntityType;
220
- metricType?: UsageMetricType;
221
- startDate?: string;
222
- endDate?: string;
223
- workspaceId?: string;
224
- organizationId?: string;
225
- limit?: number;
226
- offset?: number;
227
- }
228
- declare class UsageModule {
229
- private client;
230
- private context;
231
- constructor(client: BurdenoffGraphQLClient, context: SDKContext);
232
- track(options: TrackUsageOptions): Promise<UsageRecord>;
233
- checkQuota(options: CheckQuotaOptions): Promise<QuotaCheckResult>;
234
- requireQuota(options: CheckQuotaOptions): Promise<void>;
235
- trackAndCheck(options: TrackUsageOptions): Promise<{
236
- usage: UsageRecord;
237
- quotaCheck: QuotaCheckResult;
238
- }>;
239
- getUsage(options: GetUsageOptions): Promise<{
240
- records: UsageRecord[];
241
- total: number;
242
- }>;
243
- getSummary(entityId: string, entityType: UsageEntityType, metricType: UsageMetricType, period: QuotaPeriod): Promise<UsageSummary>;
244
- setQuota(options: SetQuotaOptions): Promise<Quota>;
245
- getQuota(entityId: string, entityType: UsageEntityType, metricType: UsageMetricType): Promise<Quota | null>;
246
- getQuotas(entityId: string, entityType: UsageEntityType): Promise<Quota[]>;
247
- resetQuota(entityId: string, entityType: UsageEntityType, metricType: UsageMetricType): Promise<boolean>;
248
- deleteQuota(entityId: string, entityType: UsageEntityType, metricType: UsageMetricType): Promise<boolean>;
249
- trackBulk(records: TrackUsageOptions[]): Promise<UsageRecord[]>;
250
- }
251
-
252
127
  interface TrackingEvent {
253
128
  eventType: string;
254
129
  entityType: string;
@@ -446,4 +321,4 @@ declare class TrackerModule {
446
321
  trackBatch(operations: TrackOptions[]): Promise<TrackResult[]>;
447
322
  }
448
323
 
449
- export { ActivityModule as A, type ProductTracker as P, type RbacCheckOptions as R, TrackerModule as T, UsageModule as U, AGENT_ACTIVITY_ACTIONS as a, AGENT_ACTIVITY_RESOURCE_TYPE as b, type ActivityTrackingOptions as c, type AgentActivityAction as d, type AgentActivityOptions as e, type TrackOptions as f, type TrackResult as g, type TrackedActorType as h, type TrackingEvent as i, UNIFIED_TRACKER_CONSTANTS as j, UnifiedTrackerStub as k, type UnifiedTrackingOptions as l, UsageMetricType as m, type UsageTrackingOptions as n, createProductTracker as o, isTrackedActorType as p, trackOperation as q, resolveAssistantSession as r, trackerStub as s, trackAgentActivity as t };
324
+ export { ActivityModule as A, type ProductTracker as P, type RbacCheckOptions as R, TrackerModule as T, UNIFIED_TRACKER_CONSTANTS as U, AGENT_ACTIVITY_ACTIONS as a, AGENT_ACTIVITY_RESOURCE_TYPE as b, type ActivityTrackingOptions as c, type AgentActivityAction as d, type AgentActivityOptions as e, type TrackOptions as f, type TrackResult as g, type TrackedActorType as h, type TrackingEvent as i, UnifiedTrackerStub as j, type UnifiedTrackingOptions as k, type UsageTrackingOptions as l, createProductTracker as m, isTrackedActorType as n, trackOperation as o, trackerStub as p, resolveAssistantSession as r, trackAgentActivity as t };
@@ -1,39 +1,8 @@
1
+ import { G as GatewayClient, c as createGatewayClient, a as createGatewayClientFromEnv, i as isGatewayClientError } from './client-DSI_760t.js';
1
2
  import { f as GatewayRequestHeaders } from './layer-Cv9vSwBx.js';
2
- import { I as IGatewayClient, G as GatewayClientConfig, a as GraphQLRequestOptions, b as GraphQLResponse, c as ICircuitBreaker, d as GatewayClientHealth, C as CircuitBreakerStats, e as CircuitState, f as GatewayError, g as GatewayErrorType, h as GraphQLError, R as RequestContext } from './types-DgJ4lDYA.js';
3
+ import { C as CircuitBreakerStats, e as CircuitState, G as GatewayClientConfig, d as GatewayClientHealth, f as GatewayError, g as GatewayErrorType, h as GraphQLError, a as GraphQLRequestOptions, b as GraphQLResponse, c as ICircuitBreaker, I as IGatewayClient, R as RequestContext } from './types-DgJ4lDYA.js';
3
4
  import { i as index$1 } from './index-D3d2TAS-.js';
4
5
 
5
- declare function isGatewayClientError(error: unknown): boolean;
6
- declare class GatewayClient implements IGatewayClient {
7
- private config;
8
- private layerManager;
9
- private internalCircuitBreaker;
10
- private crossLayerCircuitBreaker;
11
- private retryConfig;
12
- private defaultHeaders;
13
- constructor(config: GatewayClientConfig);
14
- private getInternalUrl;
15
- private getCrossLayerUrl;
16
- internalQuery<T = unknown>(options: GraphQLRequestOptions): Promise<GraphQLResponse<T>>;
17
- crossLayerQuery<T = unknown>(options: GraphQLRequestOptions): Promise<GraphQLResponse<T>>;
18
- query<T = unknown>(gatewayUrl: string, options: GraphQLRequestOptions): Promise<GraphQLResponse<T>>;
19
- getInternalCircuitBreaker(): ICircuitBreaker;
20
- getCrossLayerCircuitBreaker(): ICircuitBreaker;
21
- getHealthStatus(): GatewayClientHealth;
22
- updateDefaultHeaders(headers: Partial<GatewayRequestHeaders>): void;
23
- private createRequestContext;
24
- private shouldRetryError;
25
- private calculateRetryDelay;
26
- private logRetryAttempt;
27
- private executeWithRetry;
28
- private buildRequestHeaders;
29
- private handleGraphQLErrors;
30
- private handleFetchError;
31
- private executeRequest;
32
- private sleep;
33
- }
34
- declare function createGatewayClient(config: GatewayClientConfig): GatewayClient;
35
- declare function createGatewayClientFromEnv(): GatewayClient;
36
-
37
6
  declare function signServiceJwt(actorId: string, ttlSeconds?: number): Promise<string | null>;
38
7
 
39
8
  declare const DELEGATED_AUTHORIZATION_HEADER = "x-delegated-authorization";
@@ -47,7 +16,6 @@ declare const index_CircuitBreakerStats: typeof CircuitBreakerStats;
47
16
  declare const index_CircuitState: typeof CircuitState;
48
17
  declare const index_DELEGATED_AUTHORIZATION_HEADER: typeof DELEGATED_AUTHORIZATION_HEADER;
49
18
  type index_DelegatedGatewayTransportInput = DelegatedGatewayTransportInput;
50
- type index_GatewayClient = GatewayClient;
51
19
  declare const index_GatewayClient: typeof GatewayClient;
52
20
  declare const index_GatewayClientConfig: typeof GatewayClientConfig;
53
21
  declare const index_GatewayClientHealth: typeof GatewayClientHealth;
@@ -68,4 +36,4 @@ declare namespace index {
68
36
  export { index_CircuitBreakerStats as CircuitBreakerStats, index_CircuitState as CircuitState, index_DELEGATED_AUTHORIZATION_HEADER as DELEGATED_AUTHORIZATION_HEADER, type index_DelegatedGatewayTransportInput as DelegatedGatewayTransportInput, index_GatewayClient as GatewayClient, index_GatewayClientConfig as GatewayClientConfig, index_GatewayClientHealth as GatewayClientHealth, index_GatewayError as GatewayError, index_GatewayErrorType as GatewayErrorType, index_GraphQLError as GraphQLError, index_GraphQLRequestOptions as GraphQLRequestOptions, index_GraphQLResponse as GraphQLResponse, index_ICircuitBreaker as ICircuitBreaker, index_IGatewayClient as IGatewayClient, index_RequestContext as RequestContext, index$1 as Security, index_buildDelegatedGatewayHeaders as buildDelegatedGatewayHeaders, index_createGatewayClient as createGatewayClient, index_createGatewayClientFromEnv as createGatewayClientFromEnv, index_isGatewayClientError as isGatewayClientError, index_signServiceJwt as signServiceJwt };
69
37
  }
70
38
 
71
- export { DELEGATED_AUTHORIZATION_HEADER as D, GatewayClient as G, type DelegatedGatewayTransportInput as a, buildDelegatedGatewayHeaders as b, createGatewayClient as c, createGatewayClientFromEnv as d, isGatewayClientError as e, index as i, signServiceJwt as s };
39
+ export { DELEGATED_AUTHORIZATION_HEADER as D, type DelegatedGatewayTransportInput as a, buildDelegatedGatewayHeaders as b, index as i, signServiceJwt as s };
package/dist/index.d.ts CHANGED
@@ -7,7 +7,9 @@ import { T as TenantNotificationsModule, a as NotificationsModule } from './inde
7
7
  export { t as Notifications } from './index-BKOBmdq7.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-DJCb-l2J.js';
10
+ import { A as ActivityModule, T as TrackerModule } from './index-DXPFlxpZ.js';
11
+ import { UsageModule } from './usage/index.js';
12
+ export { BillingUsageClient, BillingUsageClientConfig, BillingUsageOperationInput, OrgBillingUsageOperationInput, QuotaLimit, WorkspaceBillingUsageOperationInput } from './usage/index.js';
11
13
  import { DatabaseConfig, DatabaseModule } from './database/index.js';
12
14
  import { E as EventsModule, I as IEventPublisher } from './index-JTx7ZQHe.js';
13
15
  export { i as EventQueue } from './index-JTx7ZQHe.js';
@@ -36,7 +38,7 @@ export { i as DataLoader } from './index-DW9q22GH.js';
36
38
  export { i as Instrumentation } from './index-Coua7_P7.js';
37
39
  export { i as Layer } from './index-ffmipXSA.js';
38
40
  export { i as Crypto } from './index-e_18DzAg.js';
39
- export { i as Gateway } from './index-szTxGaO6.js';
41
+ export { i as Gateway } from './index-wGuKj5rr.js';
40
42
  export { i as FeatureFlags } from './index--yvpa6ay.js';
41
43
  export { i as Captcha, R as RecaptchaVerifyOptions, a as RecaptchaVerifyResult, b as isCaptchaEnabled, v as verifyCaptcha, c as verifyCaptchaIfEnabled } from './index-B70b5mYS.js';
42
44
  export { i as Platform } from './index-D8HGwglK.js';
@@ -56,12 +58,13 @@ import './types-DVpvrAhd.js';
56
58
  import 'graphql-request';
57
59
  import '@envelop/core';
58
60
  import './explicit-activity-scope-CCoxVwAr.js';
61
+ import './client-DSI_760t.js';
62
+ import './types-DgJ4lDYA.js';
59
63
  import '@clickhouse/client';
60
64
  import './graph-emitter-r5TylDBm.js';
61
65
  import './prisma-extension-gYhYriA0.js';
62
66
  import '@temporalio/client';
63
67
  import '@temporalio/common';
64
- import './types-DgJ4lDYA.js';
65
68
  import 'elysia';
66
69
  import './types-Bo2wkjSP.js';
67
70
  import './graphql/services/index.js';
package/dist/index.js CHANGED
@@ -2,9 +2,11 @@ export { NAME_MAX_LENGTH, NAME_MIN_LENGTH, RbacCoverageError, USERNAME_MAX_LENGT
2
2
  export { sharing_exports as Sharing } from './chunk-DS3YMJ4X.js';
3
3
  export { tags_exports as Tags } from './chunk-OHUBPOZ6.js';
4
4
  export { TemporalClient, TemporalClientFactory, TemporalModule, TemporalWorker, TemporalWorkerFactory, TemporalWorkerManager } from './chunk-VXVLKRU6.js';
5
- import { ActivityModule, UsageModule, TrackerModule } from './chunk-57GT6PJK.js';
6
- export { ActivityModule, TrackerModule, UsageModule } from './chunk-57GT6PJK.js';
5
+ import { ActivityModule, TrackerModule } from './chunk-X3RYQ74H.js';
6
+ export { ActivityModule, TrackerModule } from './chunk-X3RYQ74H.js';
7
7
  import './chunk-TANAOLAV.js';
8
+ import { UsageModule } from './chunk-CKL6U4XE.js';
9
+ export { BillingUsageClient, UsageModule } from './chunk-CKL6U4XE.js';
8
10
  export { middleware_exports as Middleware } from './chunk-ELU7VL3E.js';
9
11
  import { TenantNotificationsModule, NotificationsModule } from './chunk-INAZ3PKF.js';
10
12
  export { tenant_notifications_exports as Notifications, NotificationsModule } from './chunk-INAZ3PKF.js';
@@ -16,7 +18,7 @@ export { PRODUCT_RENAMES, PRODUCT_RENAME_EMIT, PRODUCT_SLUG_ALIASES, product_ali
16
18
  import { RBACModule } from './chunk-PQGMZH6K.js';
17
19
  export { RBACModule, createRBACDirective, createRBACDirectiveForLayer, createRBACDirectiveFromEnv } from './chunk-PQGMZH6K.js';
18
20
  export { i18n_exports as I18n, createTranslator, getLanguage, getLocale, hasI18n, t } from './chunk-EBDHIL7V.js';
19
- export { init_exports as Init } from './chunk-5ZP576CV.js';
21
+ export { init_exports as Init } from './chunk-3MEZRD4Z.js';
20
22
  export { RESOURCE_CAP_DEFAULTS, ResourceCapExceededError, ResourceCapsModule, configureResourceCaps, getResourceCaps } from './chunk-MZCBEJ67.js';
21
23
  export { instrumentation_exports as Instrumentation } from './chunk-E5DTAGCA.js';
22
24
  import './chunk-AWPNRV3L.js';
@@ -45,9 +47,9 @@ export { graphql_exports as GraphQL } from './chunk-NGAGKLAM.js';
45
47
  import './chunk-MWPYA2HD.js';
46
48
  import './chunk-ENEDTQET.js';
47
49
  export { ai_credits_exports as AiCredits } from './chunk-JSEG3G5L.js';
48
- import { AuthModule } from './chunk-GJWQK3IU.js';
49
- export { AuthModule } from './chunk-GJWQK3IU.js';
50
- export { utils_exports as Utils } from './chunk-B7I4TABG.js';
50
+ import { AuthModule } from './chunk-Q5MGYZHG.js';
51
+ export { AuthModule } from './chunk-Q5MGYZHG.js';
52
+ export { utils_exports as Utils } from './chunk-LA5KPWZ2.js';
51
53
  export { cache_exports as Cache } from './chunk-PAQK3YF2.js';
52
54
  import './chunk-A5F6Z5UE.js';
53
55
  import { disposeAll } from './chunk-KO2ZXZ7W.js';