@tesouro/embedded-components-react 0.9.41 → 0.9.44
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/experimental/ApprovalRequests.d.ts +15 -1
- package/dist/experimental/index.d.ts +15 -1
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index2.js +9 -0
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index4.js +29 -2
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index5.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/ApprovalRequestsWidget.js +45 -35
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/buildApprovalRequestRows.js +17 -14
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/canDecideApprovalRequest.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestDecisions.js +76 -0
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestsFilters.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestsTable.js +53 -44
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index2.js +13 -1
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index4.js +91 -58
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index5.js +44 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index9.js +159 -158
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index3.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index4.js +57 -52
- 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/expectedApiUnprocessable.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/interceptor.js +41 -38
- package/dist/packages/shared-ui-shadcn/dist/index.js +3432 -3332
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/interceptor.js
CHANGED
|
@@ -3,65 +3,68 @@ import "../../../../data-access/dist/index.js";
|
|
|
3
3
|
import { EmbeddedAnalyticsEvent as t, MUTATION_METHODS as n } from "./events.js";
|
|
4
4
|
import { captureExceptionWithContext as r, trackWithContext as i } from "./runtime.js";
|
|
5
5
|
import { isExpectedApiNotFound as a } from "./expectedApiNotFound.js";
|
|
6
|
-
import {
|
|
6
|
+
import { isExpectedApiUnprocessable as o } from "./expectedApiUnprocessable.js";
|
|
7
|
+
import { extractTraceIdFromHeaders as s, resolveTraceId as c } from "./traceId.js";
|
|
7
8
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/interceptor.js
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
return
|
|
9
|
+
function l(l, h) {
|
|
10
|
+
let g = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new Set();
|
|
11
|
+
return l.interceptors.request.use((e) => (g.set(e, p()), e)), l.interceptors.response.use((e, r, a) => {
|
|
11
12
|
if (!e.ok || !n.has(r.method.toUpperCase())) return e;
|
|
12
|
-
let
|
|
13
|
+
let o = s(e);
|
|
13
14
|
return i(t.ApiRequestCompleted, {
|
|
14
15
|
method: r.method,
|
|
15
16
|
route: a.url,
|
|
16
17
|
status: e.status,
|
|
17
|
-
duration_ms:
|
|
18
|
-
...
|
|
19
|
-
},
|
|
20
|
-
}),
|
|
21
|
-
if (
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
method:
|
|
25
|
-
route:
|
|
26
|
-
status:
|
|
27
|
-
duration_ms:
|
|
28
|
-
error_kind:
|
|
18
|
+
duration_ms: m(g.get(r)),
|
|
19
|
+
...o ? { trace_id: o } : {}
|
|
20
|
+
}, h.current), e;
|
|
21
|
+
}), l.interceptors.error.use((n, s, l, p) => {
|
|
22
|
+
if (f(n, l)) return n;
|
|
23
|
+
let v = c(s, n);
|
|
24
|
+
i(t.ApiRequestFailed, {
|
|
25
|
+
method: l?.method ?? p.method,
|
|
26
|
+
route: p.url,
|
|
27
|
+
status: s?.status,
|
|
28
|
+
duration_ms: l ? m(g.get(l)) : void 0,
|
|
29
|
+
error_kind: s ? "http" : "network",
|
|
29
30
|
error_name: n instanceof Error ? n.name : "unknown",
|
|
30
|
-
...
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
...v ? { trace_id: v } : {}
|
|
32
|
+
}, h.current);
|
|
33
|
+
let y = l?.method ?? p.method;
|
|
34
|
+
if (a(s?.status, y, p.url) || o(s?.status, y, p.url)) return n;
|
|
35
|
+
if (s?.status === 401) {
|
|
36
|
+
let t = e(d(l));
|
|
37
|
+
if (_.has(t)) return n;
|
|
38
|
+
_.add(t);
|
|
36
39
|
}
|
|
37
|
-
return r(
|
|
38
|
-
method:
|
|
39
|
-
route:
|
|
40
|
-
status:
|
|
41
|
-
error_kind:
|
|
40
|
+
return r(u(s, p.url), {
|
|
41
|
+
method: l?.method ?? p.method,
|
|
42
|
+
route: p.url,
|
|
43
|
+
status: s?.status,
|
|
44
|
+
error_kind: s ? "http" : "network",
|
|
42
45
|
error_name: n instanceof Error ? n.name : "unknown",
|
|
43
|
-
...
|
|
44
|
-
},
|
|
45
|
-
}),
|
|
46
|
+
...v ? { trace_id: v } : {}
|
|
47
|
+
}, h.current), n;
|
|
48
|
+
}), l;
|
|
46
49
|
}
|
|
47
|
-
function
|
|
50
|
+
function u(e, t) {
|
|
48
51
|
let n = /* @__PURE__ */ Error(`API request failed (${e?.status ?? "network"}): ${t ?? "unknown route"}`);
|
|
49
52
|
return n.name = "ApiRequestError", n;
|
|
50
53
|
}
|
|
51
|
-
function
|
|
54
|
+
function d(e) {
|
|
52
55
|
let t = e?.headers.get("X-Widget-Token");
|
|
53
56
|
if (t) return t;
|
|
54
57
|
let n = e?.headers.get("Authorization");
|
|
55
58
|
return n?.startsWith("Bearer ") ? n.slice(7) : void 0;
|
|
56
59
|
}
|
|
57
|
-
function
|
|
60
|
+
function f(e, t) {
|
|
58
61
|
return t?.signal.aborted ? !0 : e instanceof Error && e.name === "AbortError";
|
|
59
62
|
}
|
|
60
|
-
function
|
|
63
|
+
function p() {
|
|
61
64
|
return typeof performance < "u" ? performance.now() : Date.now();
|
|
62
65
|
}
|
|
63
|
-
function
|
|
64
|
-
return e === void 0 ? void 0 : Math.round(
|
|
66
|
+
function m(e) {
|
|
67
|
+
return e === void 0 ? void 0 : Math.round(p() - e);
|
|
65
68
|
}
|
|
66
69
|
//#endregion
|
|
67
|
-
export {
|
|
70
|
+
export { l as attachAnalyticsInterceptors };
|