@burdenoff/fe-libs 2026.1023.6 → 2026.1023.8
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/shared/assistant/gatewayClient.js +23 -19
- package/dist/shared/assistant/index.d.ts +1 -0
- package/dist/shared/assistant/productContext.d.ts +16 -0
- package/dist/shared/assistant/productContext.js +16 -0
- package/dist/shared/graphql/client.d.ts +9 -0
- package/dist/shared/graphql/client.js +241 -201
- package/dist/shared/graphql/fetch.js +135 -123
- package/dist/shared/graphql/index.d.ts +1 -0
- package/dist/shared/graphql/workspaceOperationGuard.d.ts +70 -0
- package/dist/shared/graphql/workspaceOperationGuard.js +62 -0
- package/dist/shared/providers/AppShellProvider.d.ts +16 -0
- package/dist/shared/providers/AppShellProvider.js +258 -251
- package/dist/shared/providers/shell/AuthProvider.d.ts +14 -1
- package/dist/shared/providers/shell/AuthProvider.js +105 -94
- package/dist/shared/providers/shell/MultiGatewayProvider.d.ts +8 -1
- package/dist/shared/providers/shell/MultiGatewayProvider.js +115 -119
- package/dist/shared/providers/shell/ProfileStorageManager.js +1 -1
- package/dist/shared/providers/shell/WorkspaceWriteRefusedToastListener.d.ts +4 -0
- package/dist/shared/providers/shell/WorkspaceWriteRefusedToastListener.js +23 -0
- package/dist/shared/providers/shell/authProvider/identityChange.d.ts +26 -0
- package/dist/shared/providers/shell/authProvider/identityChange.js +11 -0
- package/dist/shared/providers/shell/authProvider/useAuthActions.d.ts +4 -1
- package/dist/shared/providers/shell/authProvider/useAuthActions.js +105 -92
- package/dist/shared/providers/shell/authProvider/useBridgeInitialization.d.ts +27 -1
- package/dist/shared/providers/shell/authProvider/useBridgeInitialization.js +82 -62
- package/dist/shared/providers/shell/authProvider/useRemoteSLO.d.ts +4 -1
- package/dist/shared/providers/shell/authProvider/useRemoteSLO.js +16 -14
- package/dist/shared/providers/shell/authProvider/useStorageSync.d.ts +4 -1
- package/dist/shared/providers/shell/authProvider/useStorageSync.js +19 -14
- package/dist/shared/providers/shell/contextSwitchCache.d.ts +4 -0
- package/dist/shared/providers/shell/contextSwitchCache.js +17 -0
- package/dist/shared/providers/shell/identityQueryReset.d.ts +17 -0
- package/dist/shared/providers/shell/identityQueryReset.js +21 -0
- package/dist/shared/providers/shell/identityScopedQueryReset.d.ts +16 -0
- package/dist/shared/providers/shell/identityScopedQueryReset.js +30 -0
- package/dist/shared/providers/shell/index.d.ts +1 -1
- package/dist/shared-assistant.js +306 -305
- package/dist/shared-graphql.js +11 -10
- package/dist/shared.js +129 -128
- package/package.json +2 -2
|
@@ -1,45 +1,49 @@
|
|
|
1
1
|
import { graphqlFetch as e } from "../graphql/fetch.js";
|
|
2
2
|
import "../../shared-graphql.js";
|
|
3
3
|
import "./quota.js";
|
|
4
|
+
import { assistantProductHeaders as t } from "./productContext.js";
|
|
4
5
|
//#region src/shared/assistant/gatewayClient.ts
|
|
5
|
-
function
|
|
6
|
+
function n() {
|
|
6
7
|
try {
|
|
7
8
|
return `bf-assistant-${crypto.randomUUID()}`;
|
|
8
9
|
} catch {
|
|
9
10
|
return `bf-assistant-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
+
function r(e, t) {
|
|
13
14
|
return {
|
|
14
15
|
workspaceId: e,
|
|
15
16
|
...t?.organizationId ? { custom: { organizationId: t.organizationId } } : {}
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
|
-
async function r
|
|
19
|
-
let
|
|
19
|
+
async function i(r) {
|
|
20
|
+
let i = await e({
|
|
20
21
|
gateway: "workspace",
|
|
21
|
-
query:
|
|
22
|
-
operationName:
|
|
23
|
-
variables:
|
|
24
|
-
...
|
|
25
|
-
authToken:
|
|
22
|
+
query: r.query,
|
|
23
|
+
operationName: r.operationName,
|
|
24
|
+
variables: r.variables,
|
|
25
|
+
...r.signal ? { signal: r.signal } : {},
|
|
26
|
+
authToken: r.authContext?.accessToken ?? void 0,
|
|
26
27
|
workspaceToken: !0,
|
|
27
|
-
workspaceId:
|
|
28
|
-
organizationId:
|
|
28
|
+
workspaceId: r.workspaceId,
|
|
29
|
+
organizationId: r.authContext?.organizationId ?? !0,
|
|
29
30
|
suppressGlobalErrorEvent: !0,
|
|
30
|
-
extraHeaders: {
|
|
31
|
+
extraHeaders: {
|
|
32
|
+
"x-request-id": n(),
|
|
33
|
+
...t()
|
|
34
|
+
}
|
|
31
35
|
});
|
|
32
|
-
if (
|
|
33
|
-
let e =
|
|
36
|
+
if (i.errors?.length) {
|
|
37
|
+
let e = i.errors[0], t = Error(e.message);
|
|
34
38
|
throw t.extensions = e.extensions, t;
|
|
35
39
|
}
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
40
|
+
if (i.data == null) throw Error("Sandbox GraphQL returned no data");
|
|
41
|
+
return i.data;
|
|
38
42
|
}
|
|
39
|
-
async function
|
|
43
|
+
async function a(e) {
|
|
40
44
|
let t;
|
|
41
45
|
for (let n = 0; n < 3; n++) try {
|
|
42
|
-
return await
|
|
46
|
+
return await i(e);
|
|
43
47
|
} catch (e) {
|
|
44
48
|
t = e;
|
|
45
49
|
let r = e instanceof Error ? e.message.toLowerCase() : String(e).toLowerCase();
|
|
@@ -49,4 +53,4 @@ async function i(e) {
|
|
|
49
53
|
throw t;
|
|
50
54
|
}
|
|
51
55
|
//#endregion
|
|
52
|
-
export {
|
|
56
|
+
export { r as buildSandboxContextInput, i as executeAssistantGraphQLOnce, a as executeSandboxGraphQL };
|
|
@@ -33,6 +33,7 @@ export * from './useSandboxAssistantTransport';
|
|
|
33
33
|
export * from './createSandboxAssistantTransport';
|
|
34
34
|
export * from './runtime';
|
|
35
35
|
export * from './gatewayClient';
|
|
36
|
+
export * from './productContext';
|
|
36
37
|
export * from './progress';
|
|
37
38
|
export * from './streamBudget';
|
|
38
39
|
export * from './api';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The product the assistant runs in, sent as `x-product-id` on every
|
|
3
|
+
* assistant gateway call.
|
|
4
|
+
*
|
|
5
|
+
* The session relay re-sends the assistant's reads to the gateway with this
|
|
6
|
+
* product, and product-scoped services (wspace-workflow-svc) answer a read only
|
|
7
|
+
* when it names one: without it every FluidGrids read came back
|
|
8
|
+
* BAD_USER_INPUT. The shell registers its product while it is mounted
|
|
9
|
+
* (AppShellProvider), so the assistant code itself never names a product.
|
|
10
|
+
*/
|
|
11
|
+
/** Register the shell's product; returns a disposer that clears it if it is still the one set. */
|
|
12
|
+
export declare function setAssistantProductId(productId: string | null | undefined): () => void;
|
|
13
|
+
/** The registered product, or null outside a shell (an MFE in isolation, a test). */
|
|
14
|
+
export declare function getAssistantProductId(): string | null;
|
|
15
|
+
/** The headers that carry the product, when one is registered. */
|
|
16
|
+
export declare function assistantProductHeaders(): Record<string, string>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/shared/assistant/productContext.ts
|
|
2
|
+
var e = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/, t = null;
|
|
3
|
+
function n(n) {
|
|
4
|
+
let r = typeof n == "string" && e.test(n) ? n : null;
|
|
5
|
+
return t = r, () => {
|
|
6
|
+
t === r && (t = null);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function r() {
|
|
10
|
+
return t;
|
|
11
|
+
}
|
|
12
|
+
function i() {
|
|
13
|
+
return t ? { "x-product-id": t } : {};
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { i as assistantProductHeaders, r as getAssistantProductId, n as setAssistantProductId };
|
|
@@ -2,6 +2,7 @@ import { ApolloClient, InMemoryCache } from '@apollo/client/core';
|
|
|
2
2
|
import { RetryLink } from '@apollo/client/link/retry';
|
|
3
3
|
import { Gateway } from '../config';
|
|
4
4
|
import { RetryPolicyOperation } from './retryPolicy';
|
|
5
|
+
import { WorkspaceOperationGuardMode } from './workspaceOperationGuard';
|
|
5
6
|
/**
|
|
6
7
|
* Decide whether the transport may retry a failed operation. Pure so it can be
|
|
7
8
|
* unit-tested without a client. Mutations are never retried (an ambiguous
|
|
@@ -92,6 +93,14 @@ export interface CreateClientOptions {
|
|
|
92
93
|
batchInterval?: number;
|
|
93
94
|
/** Enable debug logging */
|
|
94
95
|
debug?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* BOFF-8106: what to do with an operation whose ContextInput names a
|
|
98
|
+
* workspace other than the active one (workspace gateway only). `'off'`
|
|
99
|
+
* (default) sends it as before; `'report'` sends it and dispatches
|
|
100
|
+
* `burdenoff:workspace-context-mismatch`; `'enforce'` does not send it and
|
|
101
|
+
* ends it with a `WorkspaceContextChangedError`. See workspaceOperationGuard.ts.
|
|
102
|
+
*/
|
|
103
|
+
workspaceOperationGuard?: WorkspaceOperationGuardMode;
|
|
95
104
|
}
|
|
96
105
|
export interface MutationSuccessEvent {
|
|
97
106
|
gateway: Gateway;
|