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