@burdenoff/be-sdk 2026.611.1 → 2026.622.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 +3 -3
- package/dist/cache/index.d.ts +2 -2
- package/dist/cache/index.js +2 -2
- package/dist/{chunk-BJVXHIUV.js → chunk-3H4TRD6E.js} +12 -49
- package/dist/chunk-3H4TRD6E.js.map +1 -0
- package/dist/{chunk-UFQQSQG6.js → chunk-4OQRBSHM.js} +3 -3
- package/dist/{chunk-UFQQSQG6.js.map → chunk-4OQRBSHM.js.map} +1 -1
- package/dist/{chunk-BNJFEOGH.js → chunk-6NB7P6SR.js} +4 -4
- package/dist/{chunk-BNJFEOGH.js.map → chunk-6NB7P6SR.js.map} +1 -1
- package/dist/chunk-DXX6C6X6.js +210 -0
- package/dist/chunk-DXX6C6X6.js.map +1 -0
- package/dist/{chunk-O6RHB2YP.js → chunk-EZ4PKRUK.js} +2 -2
- package/dist/chunk-EZ4PKRUK.js.map +1 -0
- package/dist/{chunk-5SD7DU3L.js → chunk-IC7YDBGE.js} +3 -3
- package/dist/{chunk-5SD7DU3L.js.map → chunk-IC7YDBGE.js.map} +1 -1
- package/dist/{chunk-RMDKB5O7.js → chunk-IUL5TEKE.js} +3 -3
- package/dist/{chunk-RMDKB5O7.js.map → chunk-IUL5TEKE.js.map} +1 -1
- package/dist/{chunk-4NFZOFRS.js → chunk-L2P4CJUR.js} +2 -2
- package/dist/{chunk-4NFZOFRS.js.map → chunk-L2P4CJUR.js.map} +1 -1
- package/dist/{chunk-KKCC3Z4I.js → chunk-SS4XWRYR.js} +3 -3
- package/dist/{chunk-KKCC3Z4I.js.map → chunk-SS4XWRYR.js.map} +1 -1
- package/dist/{chunk-PPIDJP2W.js → chunk-TYXGWVRL.js} +5 -5
- package/dist/{chunk-PPIDJP2W.js.map → chunk-TYXGWVRL.js.map} +1 -1
- package/dist/{chunk-GSEPF2B6.js → chunk-UIMPJNWC.js} +3 -3
- package/dist/{chunk-GSEPF2B6.js.map → chunk-UIMPJNWC.js.map} +1 -1
- package/dist/{chunk-7NYCLQFJ.js → chunk-UYE4IEPT.js} +3 -3
- package/dist/{chunk-7NYCLQFJ.js.map → chunk-UYE4IEPT.js.map} +1 -1
- package/dist/chunk-VFCMR5GX.js +49 -0
- package/dist/chunk-VFCMR5GX.js.map +1 -0
- package/dist/{chunk-GMFHIFS5.js → chunk-WD2TUTAS.js} +3 -3
- package/dist/{chunk-GMFHIFS5.js.map → chunk-WD2TUTAS.js.map} +1 -1
- package/dist/{chunk-ZRRLY7SM.js → chunk-Y7GCABRS.js} +4 -4
- package/dist/{chunk-ZRRLY7SM.js.map → chunk-Y7GCABRS.js.map} +1 -1
- package/dist/{chunk-VWCN5PMD.js → chunk-YEA4BZOL.js} +14 -5
- package/dist/chunk-YEA4BZOL.js.map +1 -0
- package/dist/{chunk-HP6JTFNR.js → chunk-YFOHAHZE.js} +2 -2
- package/dist/{chunk-HP6JTFNR.js.map → chunk-YFOHAHZE.js.map} +1 -1
- package/dist/{chunk-TIINMQSD.js → chunk-Z2423JIB.js} +3 -3
- package/dist/{chunk-TIINMQSD.js.map → chunk-Z2423JIB.js.map} +1 -1
- package/dist/database/index.js +3 -3
- package/dist/event-queue/index.d.ts +4 -4
- package/dist/export/index.d.ts +2 -2
- package/dist/export/index.js +7 -5
- package/dist/feature-flags/index.d.ts +1 -1
- package/dist/feature-flags/index.js +3 -1
- package/dist/gateway/index.d.ts +2 -2
- package/dist/gateway/index.js +6 -4
- package/dist/gateway/security/index.js +1 -1
- package/dist/graph/index.d.ts +4 -3
- package/dist/graph/index.js +3 -3
- package/dist/{graphql-DH3L5Hj7.d.ts → graphql-BRj5KPOL.d.ts} +3 -2
- package/dist/{index-DohaJRZP.d.ts → index-1qCbBvKE.d.ts} +2 -2
- package/dist/{index-BqSh1K8I.d.ts → index-B0ebYV9W.d.ts} +1 -1
- package/dist/{index-C7T0Xx19.d.ts → index-B3ECnOLp.d.ts} +3 -3
- package/dist/{index-Dg4kH1VJ.d.ts → index-B4ciT3OZ.d.ts} +1 -1
- package/dist/{index-BVjR9llq.d.ts → index-BCUkR8sC.d.ts} +1 -1
- package/dist/{index-fhOvuvlv.d.ts → index-BIhZJ1w7.d.ts} +1 -1
- package/dist/{index-Cz9_vPi7.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-KA3gg4es.d.ts → index-Bm6MYdqS.d.ts} +6 -3
- package/dist/{index-DLyc5o_K.d.ts → index-CNy4MwKc.d.ts} +1 -1
- package/dist/{index-Caqvetqq.d.ts → index-DDCOGyYh.d.ts} +6 -0
- package/dist/{index-DBF8VqIf.d.ts → index-DkObbJD_.d.ts} +1 -1
- package/dist/{index-BZPEyVOl.d.ts → index-DsBZRR82.d.ts} +3 -3
- package/dist/index.d.ts +24 -20
- package/dist/index.js +125 -170
- package/dist/index.js.map +1 -1
- package/dist/init/index.d.ts +2 -2
- package/dist/init/index.js +7 -5
- package/dist/instrumentation/index.d.ts +4 -3
- package/dist/layer/index.d.ts +2 -2
- package/dist/layer/index.js +2 -2
- package/dist/{layer-CUu_cZ7d.d.ts → layer-GNAVXBMf.d.ts} +2 -0
- package/dist/logger/index.d.ts +3 -2
- package/dist/notifications/index.d.ts +4 -3
- package/dist/notifications/index.js +3 -3
- package/dist/rbac/index.d.ts +3 -3
- package/dist/rbac/index.js +3 -3
- package/dist/resource-caps/index.d.ts +3 -2
- package/dist/server/index.js +2 -0
- package/dist/server/index.js.map +1 -1
- package/dist/telemetry/index.d.ts +5 -4
- package/dist/temporal/index.d.ts +1 -1
- package/dist/temporal/index.js +2 -2
- package/dist/tracker/index.d.ts +5 -4
- package/dist/tracker/index.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-BJVXHIUV.js.map +0 -1
- package/dist/chunk-O6RHB2YP.js.map +0 -1
- package/dist/chunk-VWCN5PMD.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -2,22 +2,22 @@ export { prisma_exports as Prisma } from './chunk-GCBR3TFZ.js';
|
|
|
2
2
|
export { RESOURCE_CAP_DEFAULTS, ResourceCapExceededError, ResourceCapsModule, getResourceCaps } from './chunk-VDDOGIWY.js';
|
|
3
3
|
import './chunk-GTEMQXCA.js';
|
|
4
4
|
export { sharing_exports as Sharing } from './chunk-XD5ZK727.js';
|
|
5
|
-
export { TemporalClient, TemporalClientFactory, TemporalModule, TemporalWorker, TemporalWorkerFactory, TemporalWorkerManager } from './chunk-
|
|
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-
|
|
5
|
+
export { TemporalClient, TemporalClientFactory, TemporalModule, TemporalWorker, TemporalWorkerFactory, TemporalWorkerManager } from './chunk-IC7YDBGE.js';
|
|
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-
|
|
14
|
-
export { tenant_notifications_exports as Notifications, NotificationsModule } from './chunk-
|
|
13
|
+
import { TenantNotificationsModule, NotificationsModule } from './chunk-IUL5TEKE.js';
|
|
14
|
+
export { tenant_notifications_exports as Notifications, NotificationsModule } from './chunk-IUL5TEKE.js';
|
|
15
15
|
export { observability_exports as Observability } from './chunk-5LXDPGDH.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-WD2TUTAS.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,34 +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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
export { init_exports as Init } from './chunk-Y7GCABRS.js';
|
|
31
|
+
import { GatewayClient, GatewayError, GatewayErrorType } from './chunk-3H4TRD6E.js';
|
|
32
|
+
export { gateway_exports as Gateway } from './chunk-3H4TRD6E.js';
|
|
33
|
+
import './chunk-L2P4CJUR.js';
|
|
34
|
+
export { layer_exports as Layer } from './chunk-UIMPJNWC.js';
|
|
35
|
+
import './chunk-VFCMR5GX.js';
|
|
36
|
+
import { ContextManager } from './chunk-DXX6C6X6.js';
|
|
37
|
+
export { ContextManager } from './chunk-DXX6C6X6.js';
|
|
38
|
+
import { AuthModule } from './chunk-SS4XWRYR.js';
|
|
39
|
+
export { AuthModule } from './chunk-SS4XWRYR.js';
|
|
36
40
|
export { utils_exports as Utils } from './chunk-B7I4TABG.js';
|
|
37
|
-
export { cache_exports as Cache } from './chunk-
|
|
41
|
+
export { cache_exports as Cache } from './chunk-UYE4IEPT.js';
|
|
38
42
|
export { captcha_exports as Captcha, isCaptchaEnabled, verifyCaptcha, verifyCaptchaIfEnabled } from './chunk-YMZEUTD2.js';
|
|
39
43
|
export { createInternalClient, createInternalClientForTenant, createInternalClientForWorkspaces } from './chunk-VI4VSNTI.js';
|
|
40
44
|
export { crypto_exports as Crypto } from './chunk-SBS4S2PJ.js';
|
|
41
|
-
import { DatabaseModule } from './chunk-
|
|
42
|
-
export { DatabaseModule } from './chunk-
|
|
43
|
-
import { APIError, NetworkError, TimeoutError, ValidationError } from './chunk-
|
|
44
|
-
export { DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_GATEWAY_RETRY_CONFIG, DEFAULT_GATEWAY_ROUTING, DEFAULT_LAYER_RESOURCES, DEFAULT_LAYER_STREAMS } from './chunk-
|
|
45
|
+
import { DatabaseModule } from './chunk-4OQRBSHM.js';
|
|
46
|
+
export { DatabaseModule } from './chunk-4OQRBSHM.js';
|
|
47
|
+
import { APIError, NetworkError, TimeoutError, ValidationError } from './chunk-EZ4PKRUK.js';
|
|
48
|
+
export { DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_GATEWAY_RETRY_CONFIG, DEFAULT_GATEWAY_ROUTING, DEFAULT_LAYER_RESOURCES, DEFAULT_LAYER_STREAMS } from './chunk-YFOHAHZE.js';
|
|
45
49
|
import { logger } from './chunk-CBZNP6RF.js';
|
|
46
50
|
export { logger_exports as Logger } from './chunk-CBZNP6RF.js';
|
|
47
51
|
export { dataloader_exports as DataLoader } from './chunk-NUB5GQTU.js';
|
|
48
52
|
import { __name } from './chunk-XE4OXN2W.js';
|
|
49
53
|
import { GraphQLClient } from 'graphql-request';
|
|
50
|
-
import { AsyncLocalStorage } from 'async_hooks';
|
|
51
54
|
|
|
55
|
+
function isServiceLayer(value) {
|
|
56
|
+
return value === "wspace" || value === "global";
|
|
57
|
+
}
|
|
58
|
+
__name(isServiceLayer, "isServiceLayer");
|
|
52
59
|
var BurdenoffGraphQLClient = class {
|
|
53
60
|
static {
|
|
54
61
|
__name(this, "BurdenoffGraphQLClient");
|
|
55
62
|
}
|
|
56
63
|
workspacesClient;
|
|
57
|
-
|
|
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;
|
|
58
73
|
config;
|
|
59
74
|
defaultContext;
|
|
60
75
|
constructor(config, defaultContext = {}) {
|
|
@@ -64,8 +79,15 @@ var BurdenoffGraphQLClient = class {
|
|
|
64
79
|
headers: this.getHeaders(defaultContext)
|
|
65
80
|
});
|
|
66
81
|
if (config.tenantApiUrl) {
|
|
67
|
-
this.
|
|
68
|
-
|
|
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
|
|
69
91
|
});
|
|
70
92
|
}
|
|
71
93
|
}
|
|
@@ -103,9 +125,6 @@ var BurdenoffGraphQLClient = class {
|
|
|
103
125
|
...context
|
|
104
126
|
};
|
|
105
127
|
this.workspacesClient.setHeaders(this.getHeaders(this.defaultContext));
|
|
106
|
-
if (this.tenantClient) {
|
|
107
|
-
this.tenantClient.setHeaders(this.getHeaders(this.defaultContext));
|
|
108
|
-
}
|
|
109
128
|
}
|
|
110
129
|
/**
|
|
111
130
|
* Execute GraphQL query/mutation against workspaces API
|
|
@@ -114,15 +133,79 @@ var BurdenoffGraphQLClient = class {
|
|
|
114
133
|
return this.executeWithRetry(() => this.executeQuery(this.workspacesClient, query, variables, context), "workspaces");
|
|
115
134
|
}
|
|
116
135
|
/**
|
|
117
|
-
* 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.
|
|
118
143
|
*/
|
|
119
144
|
async tenantQuery(query, variables, context) {
|
|
120
|
-
if (!this.
|
|
145
|
+
if (!this.tenantGateway) {
|
|
121
146
|
throw new APIError("Tenant API URL not configured", {
|
|
122
147
|
operation: "tenantQuery"
|
|
123
148
|
});
|
|
124
149
|
}
|
|
125
|
-
|
|
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);
|
|
126
209
|
}
|
|
127
210
|
/**
|
|
128
211
|
* Execute GraphQL request
|
|
@@ -134,8 +217,7 @@ var BurdenoffGraphQLClient = class {
|
|
|
134
217
|
...context
|
|
135
218
|
};
|
|
136
219
|
if (context) {
|
|
137
|
-
|
|
138
|
-
client.setHeaders(headers);
|
|
220
|
+
client.setHeaders(this.getHeaders(mergedContext));
|
|
139
221
|
}
|
|
140
222
|
const response = await client.request(query, variables);
|
|
141
223
|
return response;
|
|
@@ -235,141 +317,6 @@ var BurdenoffGraphQLClient = class {
|
|
|
235
317
|
};
|
|
236
318
|
}
|
|
237
319
|
};
|
|
238
|
-
var asyncLocalStorage = new AsyncLocalStorage();
|
|
239
|
-
var ContextManager = class {
|
|
240
|
-
static {
|
|
241
|
-
__name(this, "ContextManager");
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Get current context from async local storage
|
|
245
|
-
*/
|
|
246
|
-
static getContext() {
|
|
247
|
-
return asyncLocalStorage.getStore();
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Set context for current async scope
|
|
251
|
-
* Merges with existing context if present
|
|
252
|
-
*/
|
|
253
|
-
static setContext(context) {
|
|
254
|
-
const currentContext = this.getContext() || {};
|
|
255
|
-
asyncLocalStorage.enterWith({
|
|
256
|
-
...currentContext,
|
|
257
|
-
...context
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Run function with specific context
|
|
262
|
-
* Context is isolated to this execution and its children
|
|
263
|
-
*/
|
|
264
|
-
static async withContext(context, fn) {
|
|
265
|
-
return asyncLocalStorage.run(context, fn);
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Run synchronous function with specific context
|
|
269
|
-
*/
|
|
270
|
-
static withContextSync(context, fn) {
|
|
271
|
-
return asyncLocalStorage.run(context, fn);
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Clear current context
|
|
275
|
-
*/
|
|
276
|
-
static clearContext() {
|
|
277
|
-
asyncLocalStorage.disable();
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Get actor ID from context
|
|
281
|
-
*/
|
|
282
|
-
static getActorId() {
|
|
283
|
-
return this.getContext()?.actorId;
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Get legacy user ID from context.
|
|
287
|
-
*/
|
|
288
|
-
static getUser() {
|
|
289
|
-
const context = this.getContext();
|
|
290
|
-
const userId = context?.["userId"];
|
|
291
|
-
return typeof userId === "string" ? userId : context?.actorId;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Get workspace ID from context
|
|
295
|
-
*/
|
|
296
|
-
static getWorkspace() {
|
|
297
|
-
return this.getContext()?.workspaceId;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* Get tenant ID from context
|
|
301
|
-
*/
|
|
302
|
-
static getTenant() {
|
|
303
|
-
return this.getContext()?.tenantId;
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Get legacy organization ID from context.
|
|
307
|
-
*/
|
|
308
|
-
static getOrganization() {
|
|
309
|
-
const organizationId = this.getContext()?.["organizationId"];
|
|
310
|
-
return typeof organizationId === "string" ? organizationId : void 0;
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Get project ID from context
|
|
314
|
-
*/
|
|
315
|
-
static getProject() {
|
|
316
|
-
return this.getContext()?.projectId;
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* Get app ID from context
|
|
320
|
-
*/
|
|
321
|
-
static getApp() {
|
|
322
|
-
return this.getContext()?.appId;
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Get JWT token from context
|
|
326
|
-
*/
|
|
327
|
-
static getToken() {
|
|
328
|
-
return this.getContext()?.token;
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Get product ID from context
|
|
332
|
-
*/
|
|
333
|
-
static getProduct() {
|
|
334
|
-
return this.getContext()?.productId;
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Update specific context fields
|
|
338
|
-
*/
|
|
339
|
-
static updateContext(updates) {
|
|
340
|
-
const current = this.getContext();
|
|
341
|
-
if (current) {
|
|
342
|
-
this.setContext({
|
|
343
|
-
...current,
|
|
344
|
-
...updates
|
|
345
|
-
});
|
|
346
|
-
} else {
|
|
347
|
-
this.setContext(updates);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Check if context exists
|
|
352
|
-
*/
|
|
353
|
-
static hasContext() {
|
|
354
|
-
return this.getContext() !== void 0;
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Get custom field from context
|
|
358
|
-
*/
|
|
359
|
-
static getCustomField(key) {
|
|
360
|
-
return this.getContext()?.[key];
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* Set custom field in context
|
|
364
|
-
*/
|
|
365
|
-
static setCustomField(key, value) {
|
|
366
|
-
const current = this.getContext() || {};
|
|
367
|
-
this.setContext({
|
|
368
|
-
...current,
|
|
369
|
-
[key]: value
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
320
|
|
|
374
321
|
// src/search/index.ts
|
|
375
322
|
var SearchModule = class {
|
|
@@ -2036,6 +1983,14 @@ var BootstrapModule = class {
|
|
|
2036
1983
|
if (appId) {
|
|
2037
1984
|
context.appId = appId;
|
|
2038
1985
|
}
|
|
1986
|
+
const cfAccessClientId = getHeader("cf-access-client-id");
|
|
1987
|
+
if (cfAccessClientId) {
|
|
1988
|
+
context.cfAccessClientId = cfAccessClientId;
|
|
1989
|
+
}
|
|
1990
|
+
const cfAccessClientSecret = getHeader("cf-access-client-secret");
|
|
1991
|
+
if (cfAccessClientSecret) {
|
|
1992
|
+
context.cfAccessClientSecret = cfAccessClientSecret;
|
|
1993
|
+
}
|
|
2039
1994
|
return context;
|
|
2040
1995
|
}
|
|
2041
1996
|
/**
|
|
@@ -2626,6 +2581,6 @@ function createSDK(config, context) {
|
|
|
2626
2581
|
}
|
|
2627
2582
|
__name(createSDK, "createSDK");
|
|
2628
2583
|
|
|
2629
|
-
export { BootstrapModule, BurdenoffGraphQLClient, BurdenoffSDK,
|
|
2584
|
+
export { BootstrapModule, BurdenoffGraphQLClient, BurdenoffSDK, PaymentsModule, SearchModule, TenantBackendClient, TranslationModule, createBootstrap, createSDK, createTenantBackendClient, index_default as default };
|
|
2630
2585
|
//# sourceMappingURL=index.js.map
|
|
2631
2586
|
//# sourceMappingURL=index.js.map
|