@burdenoff/fe-libs 2026.707.2 → 2026.709.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/shared/graphql/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGZ,aAAa,EAId,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAiB,KAAK,OAAO,EAAY,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/shared/graphql/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGZ,aAAa,EAId,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAiB,KAAK,OAAO,EAAY,MAAM,WAAW,CAAC;AA4ElE;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAWD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAuB3D;AAkBD,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,WAAW,mBAAmB;IAClC,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3C,8FAA8F;IAC9F,cAAc,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IAChD,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IACxC,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,C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gB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB;AA8FD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,mBAAmB,gBA6qB/D;AASD,MAAM,WAAW,eAAe;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CA0BlE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,CAKjD;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAK9C;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAStC"}
|
|
@@ -7,75 +7,82 @@ import { SSELink as l } from "./links/sse-link.js";
|
|
|
7
7
|
import { onError as u } from "@apollo/client/link/error";
|
|
8
8
|
import { RetryLink as d } from "@apollo/client/link/retry";
|
|
9
9
|
import { setContext as f } from "@apollo/client/link/context";
|
|
10
|
-
import { ApolloClient as ee, ApolloLink as p, InMemoryCache as te, Observable as m, from as
|
|
11
|
-
import { getMainDefinition as
|
|
12
|
-
import { print as
|
|
10
|
+
import { ApolloClient as ee, ApolloLink as p, InMemoryCache as te, Observable as m, from as h, split as ne } from "@apollo/client/core";
|
|
11
|
+
import { getMainDefinition as g } from "@apollo/client/utilities";
|
|
12
|
+
import { print as _ } from "graphql";
|
|
13
13
|
//#region src/shared/graphql/client.ts
|
|
14
|
-
var
|
|
14
|
+
var v = {
|
|
15
15
|
consecutiveFailures: 0,
|
|
16
16
|
lastFailureTime: 0,
|
|
17
|
-
isOpen: !1
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
isOpen: !1,
|
|
18
|
+
openCount: 0,
|
|
19
|
+
nextRetryTime: 0
|
|
20
|
+
}, y = 20, b = 5e3, x = 3e4;
|
|
21
|
+
function re() {
|
|
22
|
+
if (v.consecutiveFailures++, v.lastFailureTime = Date.now(), !v.isOpen && v.consecutiveFailures >= y) {
|
|
23
|
+
v.isOpen = !0, v.openCount++;
|
|
24
|
+
let e = Math.min(b * 2 ** (v.openCount - 1), x);
|
|
25
|
+
v.nextRetryTime = Date.now() + e;
|
|
26
|
+
}
|
|
27
|
+
return v.isOpen;
|
|
21
28
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
29
|
+
function S() {
|
|
30
|
+
v.consecutiveFailures = 0, v.isOpen = !1, v.openCount = 0, v.nextRetryTime = 0, a();
|
|
24
31
|
}
|
|
25
|
-
function
|
|
26
|
-
return
|
|
32
|
+
function C() {
|
|
33
|
+
return !(!v.isOpen || Date.now() >= v.nextRetryTime);
|
|
27
34
|
}
|
|
28
|
-
var
|
|
29
|
-
function
|
|
35
|
+
var w = /(?:\b40[13]\b|status code 40[13]|unauthori[sz]ed|unauthenticated|forbidden|invalid email or password)/i;
|
|
36
|
+
function T(e) {
|
|
30
37
|
return typeof e == "number" && Number.isInteger(e) ? e : typeof e == "string" && /^\d{3}$/.test(e) ? Number(e) : null;
|
|
31
38
|
}
|
|
32
|
-
function
|
|
39
|
+
function ie(e) {
|
|
33
40
|
let t = /* @__PURE__ */ new Set(), n = (e, r) => {
|
|
34
41
|
if (r > 3 || e == null || t.has(e)) return !1;
|
|
35
|
-
if (typeof e == "string") return
|
|
42
|
+
if (typeof e == "string") return w.test(e);
|
|
36
43
|
if (typeof e != "object") return !1;
|
|
37
44
|
t.add(e);
|
|
38
|
-
let i = e, a =
|
|
45
|
+
let i = e, a = T(i.status) ?? T(i.statusCode) ?? T(i.response?.status);
|
|
39
46
|
if (a === 401 || a === 403) return !0;
|
|
40
47
|
let o = i.message;
|
|
41
|
-
return typeof o == "string" &&
|
|
48
|
+
return typeof o == "string" && w.test(o) ? !0 : n(i.cause, r + 1);
|
|
42
49
|
};
|
|
43
50
|
return n(e, 0);
|
|
44
51
|
}
|
|
45
|
-
function
|
|
52
|
+
function ae(e) {
|
|
46
53
|
if (!e || typeof e != "object") return null;
|
|
47
54
|
let t = e, n = t.workspaceId || t.input?.workspaceId;
|
|
48
55
|
return typeof n == "string" && n.trim() ? n : null;
|
|
49
56
|
}
|
|
50
|
-
function
|
|
57
|
+
function oe(e) {
|
|
51
58
|
if (!e || typeof e != "object") return null;
|
|
52
59
|
let t = e.projectId;
|
|
53
60
|
return typeof t == "string" && t.trim() ? t : null;
|
|
54
61
|
}
|
|
55
|
-
function
|
|
56
|
-
let t =
|
|
62
|
+
function se(e) {
|
|
63
|
+
let t = g(e);
|
|
57
64
|
return t.kind === "OperationDefinition" && t.operation === "mutation";
|
|
58
65
|
}
|
|
59
|
-
function
|
|
66
|
+
function ce(e) {
|
|
60
67
|
let t = e.errors;
|
|
61
68
|
return Array.isArray(t) && t.length > 0;
|
|
62
69
|
}
|
|
63
|
-
function
|
|
70
|
+
function E(e) {
|
|
64
71
|
let t = e.headers;
|
|
65
72
|
if (!t || typeof t != "object" || Array.isArray(t)) return {};
|
|
66
73
|
let n = {};
|
|
67
74
|
for (let [e, r] of Object.entries(t)) typeof r == "string" && (n[e] = r);
|
|
68
75
|
return n;
|
|
69
76
|
}
|
|
70
|
-
function
|
|
77
|
+
function D(e) {
|
|
71
78
|
let t = e.fetchOptions;
|
|
72
79
|
if (!t || typeof t != "object" || !("signal" in t)) return;
|
|
73
80
|
let n = t.signal;
|
|
74
81
|
return n instanceof AbortSignal ? n : void 0;
|
|
75
82
|
}
|
|
76
|
-
function
|
|
83
|
+
function le({ uri: e, batchMax: t, batchInterval: n }) {
|
|
77
84
|
return new p((r) => new m((i) => {
|
|
78
|
-
let a = r.getContext(), o = { query:
|
|
85
|
+
let a = r.getContext(), o = { query: _(r.query) };
|
|
79
86
|
r.operationName && (o.operationName = r.operationName);
|
|
80
87
|
let c = r.variables ?? {}, l = r.extensions ?? {};
|
|
81
88
|
Object.keys(c).length > 0 && (o.variables = c), Object.keys(l).length > 0 && (o.extensions = l);
|
|
@@ -83,8 +90,8 @@ function ue({ uri: e, batchMax: t, batchInterval: n }) {
|
|
|
83
90
|
return s(e, {
|
|
84
91
|
"content-type": "application/json",
|
|
85
92
|
"Apollo-Require-Preflight": "true",
|
|
86
|
-
...
|
|
87
|
-
}, o,
|
|
93
|
+
...E(a)
|
|
94
|
+
}, o, D(a), {
|
|
88
95
|
batchMax: t,
|
|
89
96
|
batchInterval: n
|
|
90
97
|
}).then((e) => {
|
|
@@ -96,84 +103,84 @@ function ue({ uri: e, batchMax: t, batchInterval: n }) {
|
|
|
96
103
|
};
|
|
97
104
|
}));
|
|
98
105
|
}
|
|
99
|
-
function
|
|
100
|
-
let { gateway: s, baseUrl:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
106
|
+
function O(a) {
|
|
107
|
+
let { gateway: s, baseUrl: _, authToken: y, workspaceToken: b, locale: x, geography: w, organizationId: T, productId: E, productSlug: D, workspaceId: O, projectId: k, tenantId: A, cache: ue, enableSubscriptions: de = !1, sseUrl: fe, onAuthError: j, onRefreshToken: M, onNetworkError: N, onNetworkStatusChange: P, onMutationSuccess: F, maxRetryAttempts: pe = 3, batchMax: me = 10, batchInterval: he, debug: I = !1 } = a, L = null, R = null, ge = (e) => {
|
|
108
|
+
R ||= setTimeout(() => {
|
|
109
|
+
R = null, L && L.refetchQueries({ include: "active" }).catch((t) => {
|
|
110
|
+
I && console.warn("[GraphQL] Active query refresh failed after mutation:", {
|
|
104
111
|
gateway: s,
|
|
105
112
|
operationName: e,
|
|
106
113
|
error: t
|
|
107
114
|
});
|
|
108
115
|
});
|
|
109
116
|
}, 0);
|
|
110
|
-
},
|
|
111
|
-
uri:
|
|
112
|
-
batchMax:
|
|
113
|
-
batchInterval:
|
|
114
|
-
}),
|
|
115
|
-
let n = t.headers ?? {}, r = typeof
|
|
117
|
+
}, z = e[s], B = n(t(_, s)), V = le({
|
|
118
|
+
uri: B,
|
|
119
|
+
batchMax: me,
|
|
120
|
+
batchInterval: he
|
|
121
|
+
}), H = f((e, t) => {
|
|
122
|
+
let n = t.headers ?? {}, r = typeof y == "function" ? y() : y;
|
|
116
123
|
return { headers: {
|
|
117
124
|
...n,
|
|
118
125
|
...r ? { authorization: `Bearer ${r}` } : {}
|
|
119
126
|
} };
|
|
120
|
-
}),
|
|
121
|
-
let n = t.headers ?? {}, r = typeof
|
|
127
|
+
}), U = f((e, t) => {
|
|
128
|
+
let n = t.headers ?? {}, r = typeof x == "function" ? x() : x;
|
|
122
129
|
return { headers: {
|
|
123
130
|
...n,
|
|
124
131
|
...r ? { "accept-language": r } : {}
|
|
125
132
|
} };
|
|
126
|
-
}),
|
|
127
|
-
let n = t.headers ?? {}, r = typeof
|
|
133
|
+
}), W = f((e, t) => {
|
|
134
|
+
let n = t.headers ?? {}, r = typeof w == "function" ? w() : null;
|
|
128
135
|
return { headers: {
|
|
129
136
|
...n,
|
|
130
137
|
...r?.country ? { "x-geo-country": r.country } : {},
|
|
131
138
|
...r?.currency ? { "x-geo-currency": r.currency } : {},
|
|
132
139
|
...r?.timezone ? { "x-geo-timezone": r.timezone } : {}
|
|
133
140
|
} };
|
|
134
|
-
}),
|
|
135
|
-
let n = t.headers ?? {}, r = typeof
|
|
141
|
+
}), G = f((e, t) => {
|
|
142
|
+
let n = t.headers ?? {}, r = typeof T == "function" ? T() : T;
|
|
136
143
|
return { headers: {
|
|
137
144
|
...n,
|
|
138
145
|
...r ? { "x-org-id": r } : {}
|
|
139
146
|
} };
|
|
140
|
-
}),
|
|
141
|
-
let n = t.headers ?? {}, r = typeof
|
|
147
|
+
}), K = f((e, t) => {
|
|
148
|
+
let n = t.headers ?? {}, r = typeof E == "function" ? E() : E, i = typeof D == "function" ? D() : D;
|
|
142
149
|
return { headers: {
|
|
143
150
|
...n,
|
|
144
151
|
...r ? { "x-product-id": r } : {},
|
|
145
152
|
...i ? { "x-product-slug": i } : {}
|
|
146
153
|
} };
|
|
147
|
-
}),
|
|
148
|
-
let n = t.headers ?? {}, r = (typeof
|
|
154
|
+
}), q = f((e, t) => {
|
|
155
|
+
let n = t.headers ?? {}, r = (typeof O == "function" ? O() : O) || ae(e.variables);
|
|
149
156
|
return { headers: {
|
|
150
157
|
...n,
|
|
151
158
|
...r ? { "x-workspace-id": r } : {}
|
|
152
159
|
} };
|
|
153
|
-
}),
|
|
154
|
-
let n = t.headers ?? {}, r = (typeof
|
|
160
|
+
}), J = f((e, t) => {
|
|
161
|
+
let n = t.headers ?? {}, r = (typeof k == "function" ? k() : k) || oe(e.variables);
|
|
155
162
|
return { headers: {
|
|
156
163
|
...n,
|
|
157
164
|
...r ? { "x-project-id": r } : {}
|
|
158
165
|
} };
|
|
159
|
-
}),
|
|
160
|
-
let n = t.headers ?? {}, r = typeof
|
|
166
|
+
}), Y = f((e, t) => {
|
|
167
|
+
let n = t.headers ?? {}, r = typeof A == "function" ? A() : A;
|
|
161
168
|
return { headers: {
|
|
162
169
|
...n,
|
|
163
170
|
...r ? { "x-tenant-id": r } : {}
|
|
164
171
|
} };
|
|
165
|
-
}),
|
|
166
|
-
let n = t.headers ?? {}, i = typeof
|
|
172
|
+
}), _e = f(async (e, t) => {
|
|
173
|
+
let n = t.headers ?? {}, i = typeof b == "function" ? b() : b, a = typeof O == "function" ? O() : O, o = typeof T == "function" ? T() : T, l = typeof A == "function" ? A() : A, u = typeof k == "function" ? k() : k, d = r(i, {
|
|
167
174
|
workspaceId: a,
|
|
168
175
|
organizationId: o,
|
|
169
176
|
tenantId: l,
|
|
170
177
|
projectId: u
|
|
171
178
|
}) ? i : null;
|
|
172
179
|
if (!d && s === "workspace") try {
|
|
173
|
-
let t = typeof
|
|
180
|
+
let t = typeof y == "function" ? y() : y;
|
|
174
181
|
if (t) {
|
|
175
182
|
let n = await Promise.race([c({
|
|
176
|
-
url:
|
|
183
|
+
url: B,
|
|
177
184
|
authToken: t,
|
|
178
185
|
workspaceId: a ?? void 0,
|
|
179
186
|
organizationId: o ?? void 0,
|
|
@@ -194,25 +201,25 @@ function E(a) {
|
|
|
194
201
|
jitter: !0
|
|
195
202
|
},
|
|
196
203
|
attempts: {
|
|
197
|
-
max:
|
|
204
|
+
max: pe,
|
|
198
205
|
retryIf: (e) => {
|
|
199
|
-
if (
|
|
206
|
+
if (C() || !e) return !1;
|
|
200
207
|
let t = e.message?.toLowerCase?.() ?? "";
|
|
201
208
|
return !(t.includes("401") || t.includes("403") || t.includes("unauthorized") || t.includes("forbidden") || t.includes("unauthenticated"));
|
|
202
209
|
}
|
|
203
210
|
}
|
|
204
211
|
}), ye = new p((e, t) => {
|
|
205
|
-
if (
|
|
206
|
-
|
|
207
|
-
let t = /* @__PURE__ */ Error(
|
|
208
|
-
return
|
|
209
|
-
e.error(
|
|
212
|
+
if (C()) {
|
|
213
|
+
I && console.warn("[CircuitBreaker] Circuit is open, blocking request:", e.operationName);
|
|
214
|
+
let t = Math.max(0, Math.ceil((v.nextRetryTime - Date.now()) / 1e3)), n = /* @__PURE__ */ Error(`Network circuit breaker is open — backend appears unreachable. Retrying in ${t} seconds.`);
|
|
215
|
+
return N?.(n), new m((e) => {
|
|
216
|
+
e.error(n);
|
|
210
217
|
});
|
|
211
218
|
}
|
|
212
219
|
return new m((n) => {
|
|
213
220
|
let r = t(e).subscribe({
|
|
214
221
|
next: (e) => {
|
|
215
|
-
|
|
222
|
+
S(), v.consecutiveFailures === 0 && P?.(!1), n.next(e);
|
|
216
223
|
},
|
|
217
224
|
error: (e) => {
|
|
218
225
|
n.error(e);
|
|
@@ -233,7 +240,7 @@ function E(a) {
|
|
|
233
240
|
let r = e.errors;
|
|
234
241
|
if (r) {
|
|
235
242
|
let a = r.some((e) => e.extensions?.code === "UNAUTHENTICATED" || e.message.includes("Unauthorized") || e.message.includes("Unauthenticated"));
|
|
236
|
-
for (let e of r)
|
|
243
|
+
for (let e of r) I && console.error("[GraphQL Error]:", e.message);
|
|
237
244
|
i({ errors: r }, { operationName: t.operationName });
|
|
238
245
|
let o = new Set(["STORAGE_QUOTA_EXCEEDED", "RESOURCE_CAP_EXCEEDED"]);
|
|
239
246
|
for (let e of r) {
|
|
@@ -243,65 +250,65 @@ function E(a) {
|
|
|
243
250
|
break;
|
|
244
251
|
}
|
|
245
252
|
}
|
|
246
|
-
if (a &&
|
|
253
|
+
if (a && M) return new m((r) => {
|
|
247
254
|
(async () => {
|
|
248
255
|
if (X) if (await new Promise((e) => {
|
|
249
256
|
Z.push({ resolve: e });
|
|
250
257
|
})) {
|
|
251
258
|
let e = n(t).subscribe(r);
|
|
252
259
|
return () => e.unsubscribe();
|
|
253
|
-
} else return
|
|
260
|
+
} else return j?.(), r.error(e), () => {};
|
|
254
261
|
X = !0;
|
|
255
262
|
try {
|
|
256
|
-
let i = await
|
|
263
|
+
let i = await M();
|
|
257
264
|
if (X = !1, i) {
|
|
258
265
|
Q(!0);
|
|
259
266
|
let e = n(t).subscribe(r);
|
|
260
267
|
return () => e.unsubscribe();
|
|
261
|
-
} else return Q(!1),
|
|
268
|
+
} else return Q(!1), j?.(), r.error(e), () => {};
|
|
262
269
|
} catch {
|
|
263
|
-
return X = !1, Q(!1),
|
|
270
|
+
return X = !1, Q(!1), j?.(), r.error(e), () => {};
|
|
264
271
|
}
|
|
265
272
|
})();
|
|
266
273
|
});
|
|
267
|
-
a &&
|
|
274
|
+
a && j?.(), S();
|
|
268
275
|
} else {
|
|
269
|
-
if (
|
|
270
|
-
|
|
276
|
+
if (I && console.error("[Network Error]:", e), ie(e)) {
|
|
277
|
+
S(), e instanceof Error && i(e, {
|
|
271
278
|
operationName: t.operationName,
|
|
272
279
|
fallbackMessage: "Your session is no longer valid. Please sign in again."
|
|
273
280
|
});
|
|
274
281
|
return;
|
|
275
282
|
}
|
|
276
|
-
if (
|
|
283
|
+
if (re() && P?.(!0), e instanceof Error) N?.(e), i(e, {
|
|
277
284
|
operationName: t.operationName,
|
|
278
285
|
fallbackMessage: "We could not reach the server. Please check your connection and try again."
|
|
279
286
|
});
|
|
280
287
|
else {
|
|
281
288
|
let n = Error(String(e));
|
|
282
|
-
|
|
289
|
+
N?.(n), i(n, {
|
|
283
290
|
operationName: t.operationName,
|
|
284
291
|
fallbackMessage: "We could not reach the server. Please check your connection and try again."
|
|
285
292
|
});
|
|
286
293
|
}
|
|
287
294
|
}
|
|
288
295
|
}), xe = new p((e, t) => {
|
|
289
|
-
let n =
|
|
296
|
+
let n = se(e.query), r = n && e.getContext().autoRefreshAfterMutation !== !1 && e.getContext().skipMutationAutoRefresh !== !0;
|
|
290
297
|
return new m((i) => {
|
|
291
298
|
let a = t(e).subscribe({
|
|
292
299
|
next: (t) => {
|
|
293
|
-
if (i.next(t),
|
|
300
|
+
if (i.next(t), ce(t) || (n && o(), !r)) return;
|
|
294
301
|
let a = e.operationName || "anonymous mutation";
|
|
295
|
-
|
|
302
|
+
F ? Promise.resolve(F({
|
|
296
303
|
gateway: s,
|
|
297
304
|
operationName: a
|
|
298
305
|
})).catch((e) => {
|
|
299
|
-
|
|
306
|
+
I && console.warn("[GraphQL] Mutation refresh callback failed:", {
|
|
300
307
|
gateway: s,
|
|
301
308
|
operationName: a,
|
|
302
309
|
error: e
|
|
303
310
|
});
|
|
304
|
-
}) :
|
|
311
|
+
}) : ge(a);
|
|
305
312
|
},
|
|
306
313
|
error: (e) => {
|
|
307
314
|
i.error(e);
|
|
@@ -314,46 +321,46 @@ function E(a) {
|
|
|
314
321
|
a.unsubscribe();
|
|
315
322
|
};
|
|
316
323
|
});
|
|
317
|
-
}), $ =
|
|
324
|
+
}), $ = h([
|
|
318
325
|
ve,
|
|
319
326
|
ye,
|
|
320
327
|
be,
|
|
321
328
|
xe,
|
|
322
|
-
|
|
323
|
-
|
|
329
|
+
H,
|
|
330
|
+
_e,
|
|
331
|
+
G,
|
|
324
332
|
K,
|
|
325
333
|
q,
|
|
326
334
|
J,
|
|
327
|
-
|
|
328
|
-
|
|
335
|
+
Y,
|
|
336
|
+
U,
|
|
329
337
|
W,
|
|
330
|
-
|
|
331
|
-
H
|
|
338
|
+
V
|
|
332
339
|
]);
|
|
333
|
-
if (
|
|
334
|
-
let e =
|
|
335
|
-
e && ($ =
|
|
340
|
+
if (de) {
|
|
341
|
+
let e = fe || n(_ || z.defaultBaseUrl) + z.sse;
|
|
342
|
+
e && ($ = h([
|
|
336
343
|
ve,
|
|
337
344
|
ye,
|
|
338
345
|
be,
|
|
339
346
|
xe,
|
|
340
|
-
|
|
341
|
-
|
|
347
|
+
H,
|
|
348
|
+
_e,
|
|
349
|
+
G,
|
|
342
350
|
K,
|
|
343
351
|
q,
|
|
344
352
|
J,
|
|
345
|
-
|
|
346
|
-
|
|
353
|
+
Y,
|
|
354
|
+
U,
|
|
347
355
|
W,
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
let t = h(e);
|
|
356
|
+
ne(({ query: e }) => {
|
|
357
|
+
let t = g(e);
|
|
351
358
|
return t.kind === "OperationDefinition" && t.operation === "subscription";
|
|
352
359
|
}, new l({
|
|
353
360
|
url: e,
|
|
354
361
|
headers: {},
|
|
355
|
-
debug:
|
|
356
|
-
}),
|
|
362
|
+
debug: I
|
|
363
|
+
}), V)
|
|
357
364
|
]));
|
|
358
365
|
}
|
|
359
366
|
let Se = new te({ typePolicies: {
|
|
@@ -391,9 +398,9 @@ function E(a) {
|
|
|
391
398
|
VibecontrolsAgent: { keyFields: ["id"] },
|
|
392
399
|
Query: { fields: { vibes: { keyArgs: ["filter"] } } }
|
|
393
400
|
} });
|
|
394
|
-
return
|
|
401
|
+
return L = new ee({
|
|
395
402
|
link: $,
|
|
396
|
-
cache:
|
|
403
|
+
cache: ue ?? Se,
|
|
397
404
|
defaultOptions: {
|
|
398
405
|
watchQuery: {
|
|
399
406
|
fetchPolicy: "cache-and-network",
|
|
@@ -405,19 +412,19 @@ function E(a) {
|
|
|
405
412
|
},
|
|
406
413
|
mutate: { errorPolicy: "all" }
|
|
407
414
|
}
|
|
408
|
-
}),
|
|
415
|
+
}), L;
|
|
409
416
|
}
|
|
410
|
-
var
|
|
411
|
-
function
|
|
417
|
+
var k = null, A = null;
|
|
418
|
+
function ue(e) {
|
|
412
419
|
let { workspaceBaseUrl: t, globalBaseUrl: n, authToken: r, enableSubscriptions: i = !1, onAuthError: a, debug: o = !1 } = e;
|
|
413
|
-
|
|
420
|
+
k = O({
|
|
414
421
|
gateway: "workspace",
|
|
415
422
|
baseUrl: t,
|
|
416
423
|
authToken: r,
|
|
417
424
|
enableSubscriptions: i,
|
|
418
425
|
onAuthError: a,
|
|
419
426
|
debug: o
|
|
420
|
-
}),
|
|
427
|
+
}), A = O({
|
|
421
428
|
gateway: "global",
|
|
422
429
|
baseUrl: n,
|
|
423
430
|
authToken: r,
|
|
@@ -425,16 +432,16 @@ function k(e) {
|
|
|
425
432
|
debug: o
|
|
426
433
|
});
|
|
427
434
|
}
|
|
428
|
-
function
|
|
429
|
-
if (!
|
|
430
|
-
return
|
|
435
|
+
function de() {
|
|
436
|
+
if (!k) throw Error("Workspace client not initialized. Call initializeAppClients first.");
|
|
437
|
+
return k;
|
|
431
438
|
}
|
|
432
|
-
function
|
|
433
|
-
if (!
|
|
434
|
-
return
|
|
439
|
+
function fe() {
|
|
440
|
+
if (!A) throw Error("Global client not initialized. Call initializeAppClients first.");
|
|
441
|
+
return A;
|
|
435
442
|
}
|
|
436
|
-
function
|
|
437
|
-
|
|
443
|
+
function j() {
|
|
444
|
+
k &&= (k.clearStore(), null), A &&= (A.clearStore(), null);
|
|
438
445
|
}
|
|
439
446
|
//#endregion
|
|
440
|
-
export {
|
|
447
|
+
export { O as createGraphQLClient, fe as getGlobalClient, de as getWorkspaceClient, ue as initializeAppClients, j as resetAppClients };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGlobalSearch.d.ts","sourceRoot":"","sources":["../../../../src/shared/hooks/shell/useGlobalSearch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAgB,MAAM,aAAa,CAAC;AAM9E,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,aAAa,CAAC;AAEpF,sDAAsD;AACtD,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B;AAED,0CAA0C;AAC1C,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,+BAA+B;AAC/B,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,2BAA2B;AAC3B,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAE1D,sCAAsC;AACtC,MAAM,MAAM,YAAY,GACpB,YAAY,GACZ,WAAW,GACX,cAAc,GACd,aAAa,GACb,cAAc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GG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAqC7D,CAAC;AAEF,wBAAgB,6BAA6B,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAGrF;AAoLD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,eAAe,IAAI,qBAAqB,CAiKvD"}
|
|
@@ -28,7 +28,10 @@ var a = "\n query GlobalSearch(\n $query: String!\n $searchMode: GraphSea
|
|
|
28
28
|
"Agent",
|
|
29
29
|
"agent",
|
|
30
30
|
"AiToolEvent",
|
|
31
|
-
"aitoolevent"
|
|
31
|
+
"aitoolevent",
|
|
32
|
+
"SubAiAgent",
|
|
33
|
+
"subAiAgent",
|
|
34
|
+
"subaiagent"
|
|
32
35
|
],
|
|
33
36
|
vibes: ["Vibe", "vibe"],
|
|
34
37
|
sessions: [
|
|
@@ -48,7 +51,27 @@ var a = "\n query GlobalSearch(\n $query: String!\n $searchMode: GraphSea
|
|
|
48
51
|
gitops: ["GitopsProvider", "gitopsprovider"],
|
|
49
52
|
actions: ["Action", "action"],
|
|
50
53
|
vibedecks: ["VibeDeck", "vibedeck"],
|
|
51
|
-
security: ["vault", "secret"]
|
|
54
|
+
security: ["vault", "secret"],
|
|
55
|
+
providers: [
|
|
56
|
+
"SubProvider",
|
|
57
|
+
"subProvider",
|
|
58
|
+
"subprovider"
|
|
59
|
+
],
|
|
60
|
+
relationships: [
|
|
61
|
+
"SubRelationship",
|
|
62
|
+
"subRelationship",
|
|
63
|
+
"subrelationship"
|
|
64
|
+
],
|
|
65
|
+
plans: [
|
|
66
|
+
"SubPlan",
|
|
67
|
+
"subPlan",
|
|
68
|
+
"subplan"
|
|
69
|
+
],
|
|
70
|
+
invoices: [
|
|
71
|
+
"SubInvoice",
|
|
72
|
+
"subInvoice",
|
|
73
|
+
"subinvoice"
|
|
74
|
+
]
|
|
52
75
|
};
|
|
53
76
|
function s(e) {
|
|
54
77
|
if (e) return o[e];
|
|
@@ -89,6 +112,11 @@ function c(e, t, n) {
|
|
|
89
112
|
case "meeting": return `/calendar/${t}`;
|
|
90
113
|
case "vault": return `/security/vaults/${t}`;
|
|
91
114
|
case "secret": return `/security/secrets/${t}`;
|
|
115
|
+
case "subprovider": return `/subscriberbot/providers/${t}`;
|
|
116
|
+
case "subrelationship": return `/subscriberbot/relationships/${t}`;
|
|
117
|
+
case "subplan": return `/subscriberbot/providers?planId=${encodeURIComponent(t)}`;
|
|
118
|
+
case "subinvoice": return `/subscriberbot/invoices?invoiceId=${encodeURIComponent(t)}`;
|
|
119
|
+
case "subaiagent": return `/subscriberbot/agents/${t}`;
|
|
92
120
|
default: return `/entities/${e}/${t}`;
|
|
93
121
|
}
|
|
94
122
|
}
|
|
@@ -128,6 +156,11 @@ function l(e) {
|
|
|
128
156
|
case "aitoolevent": return "agents";
|
|
129
157
|
case "vault":
|
|
130
158
|
case "secret": return "security";
|
|
159
|
+
case "subprovider": return "providers";
|
|
160
|
+
case "subrelationship": return "relationships";
|
|
161
|
+
case "subplan": return "plans";
|
|
162
|
+
case "subinvoice": return "invoices";
|
|
163
|
+
case "subaiagent": return "agents";
|
|
131
164
|
default: return e;
|
|
132
165
|
}
|
|
133
166
|
}
|