@tesouro/embedded-components-react 0.11.77 → 0.11.81
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/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/expectedApiNotFound.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/interceptor.js +32 -24
- package/dist/packages/shared-ui-shadcn/dist/index.js +2707 -2701
- package/package.json +2 -3
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.11.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.11.81", n = "b3957c6730e7e58a4074004d77100085725ccaa3", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
|
@@ -4,7 +4,8 @@ var e = /* @__PURE__ */ new Set([
|
|
|
4
4
|
"GET /embedded-banking/v1/credit-cards/{cardId}",
|
|
5
5
|
"GET /embedded-banking/v1/debit-cards/{cardId}",
|
|
6
6
|
"GET /finops/v1/payables/{payable_id}/suggestions",
|
|
7
|
-
"GET /identity/v1/financial_institution"
|
|
7
|
+
"GET /identity/v1/financial_institution",
|
|
8
|
+
"GET /finops/v1/entity-users/my-entity"
|
|
8
9
|
]);
|
|
9
10
|
function t(t, n, r) {
|
|
10
11
|
return t === 404 && n !== void 0 && r !== void 0 && e.has(`${n.toUpperCase()} ${r}`);
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/interceptor.js
CHANGED
|
@@ -6,45 +6,45 @@ import { isExpectedApiNotFound as a } from "./expectedApiNotFound.js";
|
|
|
6
6
|
import { isExpectedApiUnprocessable as o } from "./expectedApiUnprocessable.js";
|
|
7
7
|
import { extractTraceIdFromHeaders as s, resolveTraceId as c } from "./traceId.js";
|
|
8
8
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/interceptor.js
|
|
9
|
-
function l(l,
|
|
10
|
-
let
|
|
11
|
-
return l.interceptors.request.use((e) => (
|
|
9
|
+
function l(l, p) {
|
|
10
|
+
let _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new Set();
|
|
11
|
+
return l.interceptors.request.use((e) => (_.set(e, h()), e)), l.interceptors.response.use((e, r, a) => {
|
|
12
12
|
if (!e.ok || !n.has(r.method.toUpperCase())) return e;
|
|
13
13
|
let o = s(e);
|
|
14
14
|
return i(t.ApiRequestCompleted, {
|
|
15
15
|
method: r.method,
|
|
16
16
|
route: a.url,
|
|
17
17
|
status: e.status,
|
|
18
|
-
duration_ms:
|
|
18
|
+
duration_ms: g(_.get(r)),
|
|
19
19
|
...o ? { trace_id: o } : {}
|
|
20
|
-
},
|
|
21
|
-
}), l.interceptors.error.use((n, s, l,
|
|
20
|
+
}, p.current), e;
|
|
21
|
+
}), l.interceptors.error.use((n, s, l, h) => {
|
|
22
22
|
if (f(n, l)) return n;
|
|
23
|
-
let
|
|
23
|
+
let y = c(s, n);
|
|
24
24
|
i(t.ApiRequestFailed, {
|
|
25
|
-
method: l?.method ??
|
|
26
|
-
route:
|
|
25
|
+
method: l?.method ?? h.method,
|
|
26
|
+
route: h.url,
|
|
27
27
|
status: s?.status,
|
|
28
|
-
duration_ms: l ?
|
|
28
|
+
duration_ms: l ? g(_.get(l)) : void 0,
|
|
29
29
|
error_kind: s ? "http" : "network",
|
|
30
30
|
error_name: n instanceof Error ? n.name : "unknown",
|
|
31
|
-
...
|
|
32
|
-
},
|
|
33
|
-
let
|
|
34
|
-
if (a(s?.status,
|
|
31
|
+
...y ? { trace_id: y } : {}
|
|
32
|
+
}, p.current);
|
|
33
|
+
let b = l?.method ?? h.method;
|
|
34
|
+
if (a(s?.status, b, h.url) || o(s?.status, b, h.url) || m(n, s, l)) return n;
|
|
35
35
|
if (s?.status === 401) {
|
|
36
36
|
let t = e(d(l));
|
|
37
|
-
if (
|
|
38
|
-
|
|
37
|
+
if (v.has(t)) return n;
|
|
38
|
+
v.add(t);
|
|
39
39
|
}
|
|
40
|
-
return r(u(s,
|
|
41
|
-
method: l?.method ??
|
|
42
|
-
route:
|
|
40
|
+
return r(u(s, h.url), {
|
|
41
|
+
method: l?.method ?? h.method,
|
|
42
|
+
route: h.url,
|
|
43
43
|
status: s?.status,
|
|
44
44
|
error_kind: s ? "http" : "network",
|
|
45
45
|
error_name: n instanceof Error ? n.name : "unknown",
|
|
46
|
-
...
|
|
47
|
-
},
|
|
46
|
+
...y ? { trace_id: y } : {}
|
|
47
|
+
}, p.current), n;
|
|
48
48
|
}), l;
|
|
49
49
|
}
|
|
50
50
|
function u(e, t) {
|
|
@@ -60,10 +60,18 @@ function d(e) {
|
|
|
60
60
|
function f(e, t) {
|
|
61
61
|
return t?.signal.aborted ? !0 : e instanceof Error && e.name === "AbortError";
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
var p = /* @__PURE__ */ new Set([
|
|
64
|
+
"Failed to fetch",
|
|
65
|
+
"Load failed",
|
|
66
|
+
"NetworkError when attempting to fetch resource."
|
|
67
|
+
]);
|
|
68
|
+
function m(e, t, n) {
|
|
69
|
+
return !t && n !== void 0 && e instanceof TypeError && p.has(e.message) && typeof document < "u" && document.visibilityState === "hidden";
|
|
70
|
+
}
|
|
71
|
+
function h() {
|
|
64
72
|
return typeof performance < "u" ? performance.now() : Date.now();
|
|
65
73
|
}
|
|
66
|
-
function
|
|
67
|
-
return e === void 0 ? void 0 : Math.round(
|
|
74
|
+
function g(e) {
|
|
75
|
+
return e === void 0 ? void 0 : Math.round(h() - e);
|
|
68
76
|
}
|
|
69
77
|
export { l as attachAnalyticsInterceptors, d as tokenCarriedBy };
|