@burdenoff/fe-libs 2026.921.1 → 2026.921.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;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,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,IAAI,CAAC;IACT,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IAChD,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAA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AAO,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,gBAgtB/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,82 +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 ne, split 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 ne, split as re } from "@apollo/client/core";
|
|
11
|
+
import { getMainDefinition as h } from "@apollo/client/utilities";
|
|
12
|
+
import { print as g } from "graphql";
|
|
13
13
|
//#region src/shared/graphql/client.ts
|
|
14
|
-
var
|
|
14
|
+
var _ = {
|
|
15
15
|
consecutiveFailures: 0,
|
|
16
16
|
lastFailureTime: 0,
|
|
17
17
|
isOpen: !1,
|
|
18
18
|
openCount: 0,
|
|
19
19
|
nextRetryTime: 0
|
|
20
|
-
},
|
|
21
|
-
function
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
let e = Math.min(
|
|
25
|
-
|
|
20
|
+
}, v = 20, y = 5e3, b = 3e4;
|
|
21
|
+
function ie() {
|
|
22
|
+
if (_.consecutiveFailures++, _.lastFailureTime = Date.now(), !_.isOpen && _.consecutiveFailures >= v) {
|
|
23
|
+
_.isOpen = !0, _.openCount++;
|
|
24
|
+
let e = Math.min(y * 2 ** (_.openCount - 1), b);
|
|
25
|
+
_.nextRetryTime = Date.now() + e;
|
|
26
26
|
}
|
|
27
|
-
return
|
|
27
|
+
return _.isOpen;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
29
|
+
function x() {
|
|
30
|
+
_.consecutiveFailures = 0, _.isOpen = !1, _.openCount = 0, _.nextRetryTime = 0, a();
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return !(!
|
|
32
|
+
function S() {
|
|
33
|
+
return !(!_.isOpen || Date.now() >= _.nextRetryTime);
|
|
34
34
|
}
|
|
35
|
-
var
|
|
36
|
-
function
|
|
35
|
+
var C = /(?:\b40[13]\b|status code 40[13]|unauthori[sz]ed|unauthenticated|forbidden|invalid email or password)/i;
|
|
36
|
+
function w(e) {
|
|
37
37
|
return typeof e == "number" && Number.isInteger(e) ? e : typeof e == "string" && /^\d{3}$/.test(e) ? Number(e) : null;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function ae(e) {
|
|
40
40
|
let t = /* @__PURE__ */ new Set(), n = (e, r) => {
|
|
41
41
|
if (r > 3 || e == null || t.has(e)) return !1;
|
|
42
|
-
if (typeof e == "string") return
|
|
42
|
+
if (typeof e == "string") return C.test(e);
|
|
43
43
|
if (typeof e != "object") return !1;
|
|
44
44
|
t.add(e);
|
|
45
|
-
let i = e, a =
|
|
45
|
+
let i = e, a = w(i.status) ?? w(i.statusCode) ?? w(i.response?.status);
|
|
46
46
|
if (a === 401 || a === 403) return !0;
|
|
47
47
|
let o = i.message;
|
|
48
|
-
return typeof o == "string" &&
|
|
48
|
+
return typeof o == "string" && C.test(o) ? !0 : n(i.cause, r + 1);
|
|
49
49
|
};
|
|
50
50
|
return n(e, 0);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function oe(e) {
|
|
53
53
|
if (!e || typeof e != "object") return null;
|
|
54
54
|
let t = e, n = t.workspaceId || t.input?.workspaceId;
|
|
55
55
|
return typeof n == "string" && n.trim() ? n : null;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function se(e) {
|
|
58
58
|
if (!e || typeof e != "object") return null;
|
|
59
59
|
let t = e.projectId;
|
|
60
60
|
return typeof t == "string" && t.trim() ? t : null;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
let t =
|
|
62
|
+
function ce(e) {
|
|
63
|
+
let t = h(e);
|
|
64
64
|
return t.kind === "OperationDefinition" && t.operation === "mutation";
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function le(e) {
|
|
67
67
|
let t = e.errors;
|
|
68
68
|
return Array.isArray(t) && t.length > 0;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function T(e) {
|
|
71
71
|
let t = e.headers;
|
|
72
72
|
if (!t || typeof t != "object" || Array.isArray(t)) return {};
|
|
73
73
|
let n = {};
|
|
74
74
|
for (let [e, r] of Object.entries(t)) typeof r == "string" && (n[e] = r);
|
|
75
75
|
return n;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function E(e) {
|
|
78
78
|
let t = e.fetchOptions;
|
|
79
79
|
if (!t || typeof t != "object" || !("signal" in t)) return;
|
|
80
80
|
let n = t.signal;
|
|
81
81
|
return n instanceof AbortSignal ? n : void 0;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function ue({ uri: e, batchMax: t, batchInterval: n }) {
|
|
84
84
|
return new p((r) => new m((i) => {
|
|
85
|
-
let a = r.getContext(), o = { query:
|
|
85
|
+
let a = r.getContext(), o = { query: g(r.query) };
|
|
86
86
|
r.operationName && (o.operationName = r.operationName);
|
|
87
87
|
let c = r.variables ?? {}, l = r.extensions ?? {};
|
|
88
88
|
Object.keys(c).length > 0 && (o.variables = c), Object.keys(l).length > 0 && (o.extensions = l);
|
|
@@ -90,8 +90,8 @@ function le({ uri: e, batchMax: t, batchInterval: n }) {
|
|
|
90
90
|
return s(e, {
|
|
91
91
|
"content-type": "application/json",
|
|
92
92
|
"Apollo-Require-Preflight": "true",
|
|
93
|
-
...
|
|
94
|
-
}, o,
|
|
93
|
+
...T(a)
|
|
94
|
+
}, o, E(a), {
|
|
95
95
|
batchMax: t,
|
|
96
96
|
batchInterval: n
|
|
97
97
|
}).then((e) => {
|
|
@@ -103,8 +103,8 @@ function le({ uri: e, batchMax: t, batchInterval: n }) {
|
|
|
103
103
|
};
|
|
104
104
|
}));
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
let { gateway: s, baseUrl:
|
|
106
|
+
function D(a) {
|
|
107
|
+
let { gateway: s, baseUrl: g, authToken: v, workspaceToken: y, locale: b, geography: C, organizationId: w, productId: T, productSlug: E, workspaceId: D, projectId: O, tenantId: k, cache: A, enableSubscriptions: j = !1, sseUrl: M, onAuthError: N, onRefreshToken: P, onNetworkError: F, onNetworkStatusChange: I, onMutationSuccess: L, maxRetryAttempts: de = 3, batchMax: fe = 10, batchInterval: pe, debug: R = !1 } = a, z = null, B = null, me = (e) => {
|
|
108
108
|
B ||= setTimeout(() => {
|
|
109
109
|
B = null, z && z.refetchQueries({ include: "active" }).catch((t) => {
|
|
110
110
|
R && console.warn("[GraphQL] Active query refresh failed after mutation:", {
|
|
@@ -114,24 +114,24 @@ function O(a) {
|
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
116
|
}, 0);
|
|
117
|
-
}, V = e[s], H = n(t(
|
|
117
|
+
}, V = e[s], H = n(t(g, s)), U = ue({
|
|
118
118
|
uri: H,
|
|
119
119
|
batchMax: fe,
|
|
120
120
|
batchInterval: pe
|
|
121
121
|
}), W = f((e, t) => {
|
|
122
|
-
let n = t.headers ?? {}, r = typeof
|
|
122
|
+
let n = t.headers ?? {}, r = typeof v == "function" ? v() : v;
|
|
123
123
|
return { headers: {
|
|
124
124
|
...n,
|
|
125
125
|
...r ? { authorization: `Bearer ${r}` } : {}
|
|
126
126
|
} };
|
|
127
127
|
}), G = f((e, t) => {
|
|
128
|
-
let n = t.headers ?? {}, r = typeof
|
|
128
|
+
let n = t.headers ?? {}, r = typeof b == "function" ? b() : b;
|
|
129
129
|
return { headers: {
|
|
130
130
|
...n,
|
|
131
131
|
...r ? { "accept-language": r } : {}
|
|
132
132
|
} };
|
|
133
133
|
}), K = f((e, t) => {
|
|
134
|
-
let n = t.headers ?? {}, r = typeof
|
|
134
|
+
let n = t.headers ?? {}, r = typeof C == "function" ? C() : null;
|
|
135
135
|
return { headers: {
|
|
136
136
|
...n,
|
|
137
137
|
...r?.country ? { "x-geo-country": r.country } : {},
|
|
@@ -139,45 +139,45 @@ function O(a) {
|
|
|
139
139
|
...r?.timezone ? { "x-geo-timezone": r.timezone } : {}
|
|
140
140
|
} };
|
|
141
141
|
}), q = f((e, t) => {
|
|
142
|
-
let n = t.headers ?? {}, r = typeof
|
|
142
|
+
let n = t.headers ?? {}, r = typeof w == "function" ? w() : w;
|
|
143
143
|
return { headers: {
|
|
144
144
|
...n,
|
|
145
145
|
...r ? { "x-org-id": r } : {}
|
|
146
146
|
} };
|
|
147
147
|
}), J = f((e, t) => {
|
|
148
|
-
let n = t.headers ?? {}, r = typeof
|
|
148
|
+
let n = t.headers ?? {}, r = typeof T == "function" ? T() : T, i = typeof E == "function" ? E() : E;
|
|
149
149
|
return { headers: {
|
|
150
150
|
...n,
|
|
151
151
|
...r ? { "x-product-id": r } : {},
|
|
152
152
|
...i ? { "x-product-slug": i } : {}
|
|
153
153
|
} };
|
|
154
154
|
}), Y = f((e, t) => {
|
|
155
|
-
let n = t.headers ?? {}, r = (typeof
|
|
155
|
+
let n = t.headers ?? {}, r = (typeof D == "function" ? D() : D) || oe(e.variables);
|
|
156
156
|
return { headers: {
|
|
157
157
|
...n,
|
|
158
158
|
...r ? { "x-workspace-id": r } : {}
|
|
159
159
|
} };
|
|
160
160
|
}), he = f((e, t) => {
|
|
161
|
-
let n = t.headers ?? {}, r = (typeof
|
|
161
|
+
let n = t.headers ?? {}, r = (typeof O == "function" ? O() : O) || se(e.variables);
|
|
162
162
|
return { headers: {
|
|
163
163
|
...n,
|
|
164
164
|
...r ? { "x-project-id": r } : {}
|
|
165
165
|
} };
|
|
166
166
|
}), ge = f((e, t) => {
|
|
167
|
-
let n = t.headers ?? {}, r = typeof
|
|
167
|
+
let n = t.headers ?? {}, r = typeof k == "function" ? k() : k;
|
|
168
168
|
return { headers: {
|
|
169
169
|
...n,
|
|
170
170
|
...r ? { "x-tenant-id": r } : {}
|
|
171
171
|
} };
|
|
172
172
|
}), _e = f(async (e, t) => {
|
|
173
|
-
let n = t.headers ?? {}, i = typeof
|
|
173
|
+
let n = t.headers ?? {}, i = typeof y == "function" ? y() : y, a = typeof D == "function" ? D() : D, o = typeof w == "function" ? w() : w, l = typeof k == "function" ? k() : k, u = typeof O == "function" ? O() : O, d = r(i, {
|
|
174
174
|
workspaceId: a,
|
|
175
175
|
organizationId: o,
|
|
176
176
|
tenantId: l,
|
|
177
177
|
projectId: u
|
|
178
178
|
}) ? i : null;
|
|
179
179
|
if (!d && s === "workspace") try {
|
|
180
|
-
let t = typeof
|
|
180
|
+
let t = typeof v == "function" ? v() : v;
|
|
181
181
|
if (t) {
|
|
182
182
|
let n = await Promise.race([c({
|
|
183
183
|
url: H,
|
|
@@ -203,15 +203,15 @@ function O(a) {
|
|
|
203
203
|
attempts: {
|
|
204
204
|
max: de,
|
|
205
205
|
retryIf: (e) => {
|
|
206
|
-
if (
|
|
206
|
+
if (S() || !e) return !1;
|
|
207
207
|
let t = e.message?.toLowerCase?.() ?? "";
|
|
208
208
|
return !(t.includes("401") || t.includes("403") || t.includes("unauthorized") || t.includes("forbidden") || t.includes("unauthenticated"));
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
}), ye = new p((e, t) => {
|
|
212
|
-
if (
|
|
212
|
+
if (S()) {
|
|
213
213
|
R && console.warn("[CircuitBreaker] Circuit is open, blocking request:", e.operationName);
|
|
214
|
-
let t = Math.max(0, Math.ceil((
|
|
214
|
+
let t = Math.max(0, Math.ceil((_.nextRetryTime - Date.now()) / 1e3)), n = /* @__PURE__ */ Error(`Network circuit breaker is open — backend appears unreachable. Retrying in ${t} seconds.`);
|
|
215
215
|
return F?.(n), new m((e) => {
|
|
216
216
|
e.error(n);
|
|
217
217
|
});
|
|
@@ -219,7 +219,7 @@ function O(a) {
|
|
|
219
219
|
return new m((n) => {
|
|
220
220
|
let r = t(e).subscribe({
|
|
221
221
|
next: (e) => {
|
|
222
|
-
|
|
222
|
+
x(), _.consecutiveFailures === 0 && I?.(!1), n.next(e);
|
|
223
223
|
},
|
|
224
224
|
error: (e) => {
|
|
225
225
|
n.error(e);
|
|
@@ -241,7 +241,7 @@ function O(a) {
|
|
|
241
241
|
if (r) {
|
|
242
242
|
let a = r.some((e) => e.extensions?.code === "UNAUTHENTICATED" || e.message.includes("Unauthorized") || e.message.includes("Unauthenticated"));
|
|
243
243
|
for (let e of r) R && console.error("[GraphQL Error]:", e.message);
|
|
244
|
-
i({ errors: r }, { operationName: t.operationName });
|
|
244
|
+
a && P || i({ errors: r }, { operationName: t.operationName });
|
|
245
245
|
let o = new Set(["STORAGE_QUOTA_EXCEEDED", "RESOURCE_CAP_EXCEEDED"]);
|
|
246
246
|
for (let e of r) {
|
|
247
247
|
let t = e.extensions?.code;
|
|
@@ -271,16 +271,16 @@ function O(a) {
|
|
|
271
271
|
}
|
|
272
272
|
})();
|
|
273
273
|
});
|
|
274
|
-
a && N?.(),
|
|
274
|
+
a && N?.(), x();
|
|
275
275
|
} else {
|
|
276
|
-
if (R && console.error("[Network Error]:", e),
|
|
277
|
-
|
|
276
|
+
if (R && console.error("[Network Error]:", e), ae(e)) {
|
|
277
|
+
x(), e instanceof Error && i(e, {
|
|
278
278
|
operationName: t.operationName,
|
|
279
279
|
fallbackMessage: "Your session is no longer valid. Please sign in again."
|
|
280
280
|
});
|
|
281
281
|
return;
|
|
282
282
|
}
|
|
283
|
-
if (
|
|
283
|
+
if (ie() && I?.(!0), e instanceof Error) F?.(e), i(e, {
|
|
284
284
|
operationName: t.operationName,
|
|
285
285
|
fallbackMessage: "We could not reach the server. Please check your connection and try again."
|
|
286
286
|
});
|
|
@@ -293,11 +293,11 @@ function O(a) {
|
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
}), xe = new p((e, t) => {
|
|
296
|
-
let n =
|
|
296
|
+
let n = ce(e.query), r = n && e.getContext().autoRefreshAfterMutation !== !1 && e.getContext().skipMutationAutoRefresh !== !0;
|
|
297
297
|
return new m((i) => {
|
|
298
298
|
let a = t(e).subscribe({
|
|
299
299
|
next: (t) => {
|
|
300
|
-
if (i.next(t),
|
|
300
|
+
if (i.next(t), le(t) || (n && o(), !r)) return;
|
|
301
301
|
let a = e.operationName || "anonymous mutation";
|
|
302
302
|
L ? Promise.resolve(L({
|
|
303
303
|
gateway: s,
|
|
@@ -335,15 +335,15 @@ function O(a) {
|
|
|
335
335
|
ge,
|
|
336
336
|
G,
|
|
337
337
|
K,
|
|
338
|
-
|
|
339
|
-
let t =
|
|
338
|
+
re(({ query: e }) => {
|
|
339
|
+
let t = h(e);
|
|
340
340
|
return t.kind === "OperationDefinition" && t.operation === "subscription";
|
|
341
341
|
}, new p((e) => new m((t) => {
|
|
342
342
|
t.error(/* @__PURE__ */ Error(`[graphql] Refusing to send subscription "${e.operationName ?? "anonymous"}" over the batched HTTP transport — this gateway client was created without enableSubscriptions/SSE. Enable subscriptions on this client so it routes over SSE.`));
|
|
343
343
|
})), U)
|
|
344
344
|
]);
|
|
345
|
-
if (
|
|
346
|
-
let e = V.sse, t =
|
|
345
|
+
if (j) {
|
|
346
|
+
let e = V.sse, t = M || (e ? n(g || V.defaultBaseUrl) + e : void 0);
|
|
347
347
|
t && ($ = ne([
|
|
348
348
|
ve,
|
|
349
349
|
ye,
|
|
@@ -358,8 +358,8 @@ function O(a) {
|
|
|
358
358
|
ge,
|
|
359
359
|
G,
|
|
360
360
|
K,
|
|
361
|
-
|
|
362
|
-
let t =
|
|
361
|
+
re(({ query: e }) => {
|
|
362
|
+
let t = h(e);
|
|
363
363
|
return t.kind === "OperationDefinition" && t.operation === "subscription";
|
|
364
364
|
}, new l({
|
|
365
365
|
url: t,
|
|
@@ -405,7 +405,7 @@ function O(a) {
|
|
|
405
405
|
} });
|
|
406
406
|
return z = new ee({
|
|
407
407
|
link: $,
|
|
408
|
-
cache:
|
|
408
|
+
cache: A ?? Se,
|
|
409
409
|
defaultOptions: {
|
|
410
410
|
watchQuery: {
|
|
411
411
|
fetchPolicy: "cache-and-network",
|
|
@@ -419,17 +419,17 @@ function O(a) {
|
|
|
419
419
|
}
|
|
420
420
|
}), z;
|
|
421
421
|
}
|
|
422
|
-
var
|
|
423
|
-
function
|
|
422
|
+
var O = null, k = null;
|
|
423
|
+
function A(e) {
|
|
424
424
|
let { workspaceBaseUrl: t, globalBaseUrl: n, authToken: r, enableSubscriptions: i = !1, onAuthError: a, debug: o = !1 } = e;
|
|
425
|
-
|
|
425
|
+
O = D({
|
|
426
426
|
gateway: "workspace",
|
|
427
427
|
baseUrl: t,
|
|
428
428
|
authToken: r,
|
|
429
429
|
enableSubscriptions: i,
|
|
430
430
|
onAuthError: a,
|
|
431
431
|
debug: o
|
|
432
|
-
}),
|
|
432
|
+
}), k = D({
|
|
433
433
|
gateway: "global",
|
|
434
434
|
baseUrl: n,
|
|
435
435
|
authToken: r,
|
|
@@ -437,16 +437,16 @@ function j(e) {
|
|
|
437
437
|
debug: o
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
|
+
function j() {
|
|
441
|
+
if (!O) throw Error("Workspace client not initialized. Call initializeAppClients first.");
|
|
442
|
+
return O;
|
|
443
|
+
}
|
|
440
444
|
function M() {
|
|
441
|
-
if (!k) throw Error("
|
|
445
|
+
if (!k) throw Error("Global client not initialized. Call initializeAppClients first.");
|
|
442
446
|
return k;
|
|
443
447
|
}
|
|
444
|
-
function ue() {
|
|
445
|
-
if (!A) throw Error("Global client not initialized. Call initializeAppClients first.");
|
|
446
|
-
return A;
|
|
447
|
-
}
|
|
448
448
|
function N() {
|
|
449
|
-
|
|
449
|
+
O &&= (O.clearStore(), null), k &&= (k.clearStore(), null);
|
|
450
450
|
}
|
|
451
451
|
//#endregion
|
|
452
|
-
export {
|
|
452
|
+
export { D as createGraphQLClient, M as getGlobalClient, j as getWorkspaceClient, A as initializeAppClients, N as resetAppClients };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/shared/graphql/fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAY,KAAK,OAAO,EAAsB,MAAM,WAAW,CAAC;AAuBvE,MAAM,WAAW,mBAAmB;IAClC,wBAAwB;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC/B;;;OAGG;IACH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
|
-
|
|
133
|
-
let m = `${p}:${l}:${a ?? ""}`, h = v.get(m);
|
|
132
|
+
let m = `${p ?? ""}:${l}:${a ?? ""}`, h = v.get(m);
|
|
134
133
|
if (h) return h;
|
|
135
134
|
let g = fetch(t, {
|
|
136
135
|
method: "POST",
|
|
@@ -143,15 +142,15 @@ async function N(e) {
|
|
|
143
142
|
body: JSON.stringify({
|
|
144
143
|
query: _,
|
|
145
144
|
variables: { input: {
|
|
146
|
-
organizationId: p,
|
|
147
145
|
workspaceId: l,
|
|
146
|
+
...p ? { organizationId: p } : {},
|
|
148
147
|
...a ? { projectId: a } : {}
|
|
149
148
|
} }
|
|
150
149
|
}),
|
|
151
150
|
signal: s
|
|
152
151
|
}).then(async (e) => {
|
|
153
152
|
let t = (await e.json()).data?.issueWorkspaceToken;
|
|
154
|
-
return t?.success && t.token ? (M(t.workspaceId || l, t.token, p), t.token) : null;
|
|
153
|
+
return t?.success && t.token ? (M(t.workspaceId || l, t.token, p ?? void 0), t.token) : null;
|
|
155
154
|
}).catch(() => null).finally(() => {
|
|
156
155
|
v.delete(m);
|
|
157
156
|
});
|