@tesouro/embedded-components-react 0.5.83 → 0.5.84
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/bank-account-onboarding-widget/data-access/dist/index.js +6 -7
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index10.js +28 -21
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index2.js +7 -23
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index3.js +34 -6
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index5.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index6.js +11 -17
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index7.js +37 -16
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index8.js +3 -43
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index9.js +31 -3
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +29 -33
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +31 -30
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/EmbedApiContext.js +7 -5
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +186 -175
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/scopedClientSecret.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/transportInterceptors.js +9 -6
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +39 -36
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +86 -83
- 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/client.js +3 -2
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index11.js +0 -48
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/scopedClientSecret.js
|
|
2
|
+
function e(e) {
|
|
3
|
+
return (t) => (e.current = t, () => {
|
|
4
|
+
e.current === t && (e.current = null);
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as createClientSecretInstaller };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { isWidgetGatewayHost as e } from "./widgetGatewayHosts.js";
|
|
2
2
|
//#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/transportInterceptors.js
|
|
3
|
-
function t(t, { tokenRef: n,
|
|
4
|
-
return t.interceptors.request.use((e
|
|
5
|
-
let i =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let
|
|
3
|
+
function t(t, { tokenRef: n, clientSecretRef: r, gatewayRouting: i }) {
|
|
4
|
+
return t.interceptors.request.use((e, t) => {
|
|
5
|
+
let i = r?.current;
|
|
6
|
+
return i?.appliesTo(t) && e.headers.set("X-Client-Secret", i.clientSecret), e.headers.has("X-Client-Secret") ? (e.headers.delete("Authorization"), n.current && e.headers.set("X-Widget-Token", n.current)) : n.current && e.headers.set("Authorization", `Bearer ${n.current}`), e;
|
|
7
|
+
}), i !== !1 && t.interceptors.request.use(async (t) => {
|
|
8
|
+
let r = new URL(t.url);
|
|
9
|
+
if (r.pathname.startsWith("/api/widget-gateway") || !(i ?? e(r.origin))) return t;
|
|
10
|
+
r.pathname = "/api/widget-gateway/proxy" + r.pathname;
|
|
11
|
+
let a = t.body ? await t.clone().arrayBuffer() : void 0, o = new Request(r.toString(), {
|
|
9
12
|
method: t.method,
|
|
10
13
|
headers: t.headers,
|
|
11
14
|
body: a,
|
|
@@ -2,44 +2,46 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { createClientSecretInstaller as e } from "../../../../data-access/dist/lib/scopedClientSecret.js";
|
|
6
|
+
import { registerQueryClient as t, unregisterQueryClient as ee } from "../../../../data-access/dist/lib/clientRegistry.js";
|
|
7
|
+
import { createEmbeddedClient as n } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
|
|
7
8
|
import { EmbedApiProvider as te } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
8
9
|
import "../../../../data-access/dist/index.js";
|
|
9
|
-
import { resolveUIFramework as
|
|
10
|
-
import { UIProvider as
|
|
11
|
-
import { useDesignSystemEnsurer as
|
|
10
|
+
import { resolveUIFramework as r } from "../../../../ui/dist/lib/UIContext/UIContext.js";
|
|
11
|
+
import { UIProvider as i } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
|
|
12
|
+
import { useDesignSystemEnsurer as a } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
|
|
12
13
|
import "../../../../ui/dist/index.js";
|
|
13
|
-
import { getGlobalSnapshot as
|
|
14
|
-
import { configureEmbeddedClient as
|
|
15
|
-
import { generateCorrelationId as
|
|
16
|
-
import { WidgetContext as
|
|
17
|
-
import { resolveOrgId as
|
|
18
|
-
import { useWidgetFetch as
|
|
19
|
-
import { deriveWidgetInitState as
|
|
20
|
-
import { useEffect as
|
|
21
|
-
import { jsx as
|
|
22
|
-
import { QueryClient as
|
|
14
|
+
import { getGlobalSnapshot as o, subscribeToGlobal as s } from "./globalStore.js";
|
|
15
|
+
import { configureEmbeddedClient as ne } from "../analytics/client.js";
|
|
16
|
+
import { generateCorrelationId as re } from "../analytics/ids.js";
|
|
17
|
+
import { WidgetContext as ie } from "./WidgetContext.js";
|
|
18
|
+
import { resolveOrgId as ae, useAuthEpoch as c } from "./utils.js";
|
|
19
|
+
import { useWidgetFetch as l } from "./useWidgetFetch.js";
|
|
20
|
+
import { deriveWidgetInitState as oe, useWidgetInitPublisher as se } from "./useWidgetInitPublisher.js";
|
|
21
|
+
import { useEffect as u, useMemo as d, useRef as f, useState as p, useSyncExternalStore as ce } from "react";
|
|
22
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
23
|
+
import { QueryClient as le, QueryClientProvider as ue } from "@tanstack/react-query";
|
|
23
24
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js
|
|
24
25
|
function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configClient: y, gatewayRouting: b, linkComponent: x, uiFramework: S, implementation: C, analytics: w, unstable_initResponseOverride: T, disclosuresAcceptance: E, providerLabels: D }) {
|
|
25
|
-
let O =
|
|
26
|
+
let O = ce(s, o, o), k = g ?? O.baseUrl, A = _ === void 0 ? O.widgetToken : _, j = v === void 0 ? O.organizationId : v, M = y ?? O.configClient, N = b ?? O.gatewayRouting, P = x ?? O.linkComponent, F = S ?? O.uiFramework, I = C ?? O.implementation, L = w !== !1, [R] = p(re), z = f({
|
|
26
27
|
enabled: L,
|
|
27
28
|
organizationId: j,
|
|
28
29
|
rootCorrelationId: R
|
|
29
|
-
}), [B] =
|
|
30
|
+
}), [B] = p(() => new le({ defaultOptions: {
|
|
30
31
|
queries: {
|
|
31
32
|
retry: !1,
|
|
32
33
|
refetchOnWindowFocus: !1
|
|
33
34
|
},
|
|
34
35
|
mutations: { retry: !1 }
|
|
35
36
|
} }));
|
|
36
|
-
|
|
37
|
-
let V =
|
|
37
|
+
u(() => (t(B), () => ee(B)), [B]);
|
|
38
|
+
let V = f(A);
|
|
38
39
|
V.current = A;
|
|
39
|
-
let H =
|
|
40
|
-
let e =
|
|
40
|
+
let H = f(null), de = d(() => e(H), []), fe = c(A), U = d(() => {
|
|
41
|
+
let e = ne(n(k), {
|
|
41
42
|
tokenRef: V,
|
|
42
43
|
analyticsContextRef: z,
|
|
44
|
+
clientSecretRef: H,
|
|
43
45
|
gatewayRouting: N
|
|
44
46
|
});
|
|
45
47
|
return M ? M(e) : e;
|
|
@@ -48,7 +50,7 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
|
|
|
48
50
|
M,
|
|
49
51
|
N
|
|
50
52
|
]);
|
|
51
|
-
|
|
53
|
+
u(() => {
|
|
52
54
|
if (!L || !("window" in globalThis)) return;
|
|
53
55
|
let e = !1;
|
|
54
56
|
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
|
|
@@ -57,11 +59,11 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
|
|
|
57
59
|
e = !0;
|
|
58
60
|
};
|
|
59
61
|
}, [L]);
|
|
60
|
-
let W =
|
|
61
|
-
|
|
62
|
+
let W = a(r(F));
|
|
63
|
+
u(() => {
|
|
62
64
|
W && W().catch(() => {});
|
|
63
65
|
}, [W]);
|
|
64
|
-
let { result:
|
|
66
|
+
let { result: pe, loading: G, error: K, initStaleForToken: me, refetch: q } = l(T ? null : U, A, z), J = A ? T ?? pe ?? void 0 : void 0, Y = !T && me, X = ae(j, Y ? void 0 : J?.organizationId), he = d(() => oe({
|
|
65
67
|
hasToken: !!A,
|
|
66
68
|
loading: G,
|
|
67
69
|
error: K,
|
|
@@ -74,8 +76,8 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
|
|
|
74
76
|
J,
|
|
75
77
|
Y
|
|
76
78
|
]);
|
|
77
|
-
|
|
78
|
-
let Z =
|
|
79
|
+
se(he, A);
|
|
80
|
+
let Z = d(() => ({
|
|
79
81
|
enabled: L,
|
|
80
82
|
organizationId: X,
|
|
81
83
|
rootCorrelationId: R
|
|
@@ -85,7 +87,7 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
|
|
|
85
87
|
R
|
|
86
88
|
]);
|
|
87
89
|
z.current = Z;
|
|
88
|
-
let Q =
|
|
90
|
+
let Q = d(() => ({
|
|
89
91
|
baseUrl: g,
|
|
90
92
|
widgetToken: _,
|
|
91
93
|
organizationId: v,
|
|
@@ -103,7 +105,7 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
|
|
|
103
105
|
x,
|
|
104
106
|
S,
|
|
105
107
|
C
|
|
106
|
-
]), $ =
|
|
108
|
+
]), $ = d(() => ({
|
|
107
109
|
baseUrl: k,
|
|
108
110
|
widgetToken: A,
|
|
109
111
|
organizationId: X,
|
|
@@ -123,7 +125,7 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
|
|
|
123
125
|
F,
|
|
124
126
|
I,
|
|
125
127
|
J
|
|
126
|
-
]),
|
|
128
|
+
]), ge = d(() => ({
|
|
127
129
|
resolved: $,
|
|
128
130
|
own: Q,
|
|
129
131
|
refetch: q,
|
|
@@ -146,16 +148,17 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
|
|
|
146
148
|
E,
|
|
147
149
|
D
|
|
148
150
|
]);
|
|
149
|
-
return /* @__PURE__ */
|
|
151
|
+
return /* @__PURE__ */ m(ue, {
|
|
150
152
|
client: B,
|
|
151
|
-
children: /* @__PURE__ */
|
|
153
|
+
children: /* @__PURE__ */ m(te, {
|
|
152
154
|
client: U,
|
|
153
155
|
organizationId: X,
|
|
154
156
|
widgetToken: A,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
installClientSecret: de,
|
|
158
|
+
authEpoch: fe,
|
|
159
|
+
children: /* @__PURE__ */ m(ie.Provider, {
|
|
160
|
+
value: ge,
|
|
161
|
+
children: /* @__PURE__ */ m(i, {
|
|
159
162
|
linkComponent: P,
|
|
160
163
|
uiFramework: F,
|
|
161
164
|
children: h
|
|
@@ -2,42 +2,43 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { createClientSecretInstaller as e } from "../../../../data-access/dist/lib/scopedClientSecret.js";
|
|
6
|
+
import { registerQueryClient as t, unregisterQueryClient as n } from "../../../../data-access/dist/lib/clientRegistry.js";
|
|
7
|
+
import { createEmbeddedClient as r } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
|
|
8
|
+
import { EmbedApiProvider as i, useEmbedApi as a } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
8
9
|
import "../../../../data-access/dist/index.js";
|
|
9
|
-
import { resolveUIFramework as
|
|
10
|
-
import { UIProvider as
|
|
11
|
-
import { useDesignSystemEnsurer as
|
|
12
|
-
import { HostIsolationScope as
|
|
10
|
+
import { resolveUIFramework as o } from "../../../../ui/dist/lib/UIContext/UIContext.js";
|
|
11
|
+
import { UIProvider as ee } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
|
|
12
|
+
import { useDesignSystemEnsurer as te, useFrameworkRenderer as ne } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
|
|
13
|
+
import { HostIsolationScope as re } from "../../../../ui/dist/lib/HostIsolationScope/HostIsolationScope.js";
|
|
13
14
|
import { ErrorState as s } from "../../../../ui/dist/lib/ErrorState/ErrorState.js";
|
|
14
15
|
import "../../../../ui/dist/index.js";
|
|
15
|
-
import { getGlobalSnapshot as
|
|
16
|
+
import { getGlobalSnapshot as ie, subscribeToGlobal as ae } from "./globalStore.js";
|
|
16
17
|
import { EmbeddedAnalyticsEvent as c } from "../analytics/events.js";
|
|
17
|
-
import { configureEmbeddedClient as
|
|
18
|
-
import { generateCorrelationId as
|
|
19
|
-
import { WidgetContext as
|
|
20
|
-
import { noop as
|
|
21
|
-
import { useWidgetFetch as
|
|
22
|
-
import { deriveWidgetInitState as
|
|
18
|
+
import { configureEmbeddedClient as oe } from "../analytics/client.js";
|
|
19
|
+
import { generateCorrelationId as se } from "../analytics/ids.js";
|
|
20
|
+
import { WidgetContext as ce } from "./WidgetContext.js";
|
|
21
|
+
import { noop as le, resolveOrgId as ue, useAuthEpoch as de } from "./utils.js";
|
|
22
|
+
import { useWidgetFetch as fe } from "./useWidgetFetch.js";
|
|
23
|
+
import { deriveWidgetInitState as pe, useWidgetInitPublisher as me } from "./useWidgetInitPublisher.js";
|
|
23
24
|
import { useAnalyticsTrack as l } from "../analytics/hooks.js";
|
|
24
|
-
import { resolveProviderLabels as
|
|
25
|
-
import { WidgetErrorBoundary as
|
|
26
|
-
import { DISCLOSURES_REQUIRED_TEST_ID as u, hasRenderableAcceptanceSurface as d, resolveDisclosuresBlockedReason as f, shouldGateOnDisclosuresAcceptance as
|
|
27
|
-
import { useContext as
|
|
25
|
+
import { resolveProviderLabels as he } from "./labels.js";
|
|
26
|
+
import { WidgetErrorBoundary as ge } from "./WidgetErrorBoundary.js";
|
|
27
|
+
import { DISCLOSURES_REQUIRED_TEST_ID as u, hasRenderableAcceptanceSurface as d, resolveDisclosuresBlockedReason as f, shouldGateOnDisclosuresAcceptance as _e } from "./isDisclosuresAcceptanceRequired.js";
|
|
28
|
+
import { useContext as ve, useEffect as p, useMemo as m, useRef as h, useState as g, useSyncExternalStore as ye } from "react";
|
|
28
29
|
import { jsx as _ } from "react/jsx-runtime";
|
|
29
|
-
import { QueryClient as
|
|
30
|
+
import { QueryClient as be, QueryClientProvider as xe } from "@tanstack/react-query";
|
|
30
31
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js
|
|
31
|
-
function v({ children:
|
|
32
|
-
let S =
|
|
32
|
+
function v({ children: ne, baseUrl: s, widgetToken: c, organizationId: l, configClient: u, gatewayRouting: d, linkComponent: f, uiFramework: v, implementation: y, errorFallback: Ce, onError: we, analytics: b, disclosuresAcceptance: Te, providerLabels: Ee, widgetName: x }) {
|
|
33
|
+
let S = ve(ce), De = ye(ae, ie, ie), C = S?.resolved ?? De, Oe = S?.refetch ?? le, ke = S?.loading ?? !1, Ae = S?.error ?? null, w = s ?? C.baseUrl, T = c === void 0 ? C.widgetToken : c, je = S ? S.cascadeOrgId : De.organizationId, E = l === void 0 ? je : l, D = u ?? C.configClient, O = d ?? C.gatewayRouting, k = f ?? C.linkComponent, A = v ?? C.uiFramework, j = y ?? C.implementation, M = Te ?? S?.disclosuresAcceptance, N = Ee ?? S?.providerLabels, Me = m(() => he(N), [N]), P = S === null, F = P ? b !== !1 : S.analytics.enabled, [Ne] = g(se), I = P ? Ne : S.analytics.rootCorrelationId, [Pe] = g(se), L = x === void 0 ? S?.analytics.widgetName : x, R = x === void 0 ? S?.analytics.widgetInstanceId : Pe, z = h({
|
|
33
34
|
enabled: F,
|
|
34
35
|
organizationId: E,
|
|
35
36
|
rootCorrelationId: I,
|
|
36
37
|
widgetName: L,
|
|
37
38
|
widgetInstanceId: R
|
|
38
|
-
}),
|
|
39
|
+
}), Fe = h(!1);
|
|
39
40
|
p(() => {
|
|
40
|
-
P || b === void 0 ||
|
|
41
|
+
P || b === void 0 || Fe.current || (Fe.current = !0, console.warn("[tesouro-embedded] `analytics` on a nested WidgetProvider is ignored in v1. Set it on the outermost RootWidgetProvider or standalone WidgetProvider instead."));
|
|
41
42
|
}, [b, P]), p(() => {
|
|
42
43
|
if (!P || !F || !("window" in globalThis)) return;
|
|
43
44
|
let e = !1;
|
|
@@ -47,41 +48,42 @@ function v({ children: te, baseUrl: s, widgetToken: c, organizationId: l, config
|
|
|
47
48
|
e = !0;
|
|
48
49
|
};
|
|
49
50
|
}, [P, F]);
|
|
50
|
-
let
|
|
51
|
+
let B = te(o(A));
|
|
51
52
|
p(() => {
|
|
52
|
-
|
|
53
|
-
}, [
|
|
54
|
-
let
|
|
55
|
-
|
|
56
|
-
let
|
|
57
|
-
if (!
|
|
58
|
-
let e =
|
|
59
|
-
tokenRef:
|
|
53
|
+
B && B().catch(() => {});
|
|
54
|
+
}, [B]);
|
|
55
|
+
let Ie = S === null || s !== void 0 || c !== void 0 || l !== void 0 || u != null || d !== void 0 || x !== void 0, Le = h(T);
|
|
56
|
+
Le.current = T;
|
|
57
|
+
let Re = h(null), ze = m(() => e(Re), []), Be = a(), Ve = de(T), V = m(() => {
|
|
58
|
+
if (!Ie) return null;
|
|
59
|
+
let e = oe(r(w), {
|
|
60
|
+
tokenRef: Le,
|
|
60
61
|
analyticsContextRef: z,
|
|
62
|
+
clientSecretRef: Re,
|
|
61
63
|
gatewayRouting: O
|
|
62
64
|
});
|
|
63
65
|
return D ? D(e) : e;
|
|
64
66
|
}, [
|
|
65
|
-
|
|
67
|
+
Ie,
|
|
66
68
|
w,
|
|
67
69
|
D,
|
|
68
70
|
O
|
|
69
|
-
]),
|
|
71
|
+
]), H = S === null || s !== void 0 || c !== void 0, He = H ? Ve : Be.authEpoch, { result: U, loading: W, error: G, clearedForAuthChange: Ue, initStaleForToken: K, refetch: We } = fe(H ? V : null, H ? T : void 0, z), Ge = H ? We : Oe, Ke = H ? W : ke, qe = H ? G : Ae, Je = S?.resolved.initResponse, Ye = !H || !Ue && !G && !U && !!T && !W, q = Ye ? Je : U ?? void 0, J = Ye ? H || (S?.initResponseStaleForToken ?? !1) : K, Y = S === null, Xe = m(() => Y ? pe({
|
|
70
72
|
hasToken: !!T,
|
|
71
|
-
loading:
|
|
72
|
-
error:
|
|
73
|
-
initResponse:
|
|
74
|
-
initStaleForToken:
|
|
73
|
+
loading: W,
|
|
74
|
+
error: G,
|
|
75
|
+
initResponse: U ?? void 0,
|
|
76
|
+
initStaleForToken: K
|
|
75
77
|
}) : null, [
|
|
76
|
-
|
|
78
|
+
Y,
|
|
77
79
|
T,
|
|
78
|
-
G,
|
|
79
|
-
K,
|
|
80
80
|
W,
|
|
81
|
-
|
|
81
|
+
G,
|
|
82
|
+
U,
|
|
83
|
+
K
|
|
82
84
|
]);
|
|
83
|
-
|
|
84
|
-
let X =
|
|
85
|
+
me(Xe, T);
|
|
86
|
+
let X = ue(E, J ? void 0 : q?.organizationId), Z = m(() => ({
|
|
85
87
|
enabled: F,
|
|
86
88
|
organizationId: X,
|
|
87
89
|
rootCorrelationId: I,
|
|
@@ -95,7 +97,7 @@ function v({ children: te, baseUrl: s, widgetToken: c, organizationId: l, config
|
|
|
95
97
|
R
|
|
96
98
|
]);
|
|
97
99
|
z.current = Z;
|
|
98
|
-
let [Q] = g(() => S === null ? new
|
|
100
|
+
let [Q] = g(() => S === null ? new be({ defaultOptions: {
|
|
99
101
|
queries: {
|
|
100
102
|
retry: !1,
|
|
101
103
|
refetchOnWindowFocus: !1
|
|
@@ -104,10 +106,10 @@ function v({ children: te, baseUrl: s, widgetToken: c, organizationId: l, config
|
|
|
104
106
|
} }) : null);
|
|
105
107
|
p(() => {
|
|
106
108
|
if (!Q) return;
|
|
107
|
-
let
|
|
108
|
-
return e
|
|
109
|
+
let e = Q;
|
|
110
|
+
return t(e), () => n(e);
|
|
109
111
|
}, [Q]);
|
|
110
|
-
let
|
|
112
|
+
let Ze = m(() => ({
|
|
111
113
|
baseUrl: s,
|
|
112
114
|
widgetToken: c,
|
|
113
115
|
organizationId: l,
|
|
@@ -125,7 +127,7 @@ function v({ children: te, baseUrl: s, widgetToken: c, organizationId: l, config
|
|
|
125
127
|
f,
|
|
126
128
|
v,
|
|
127
129
|
y
|
|
128
|
-
]),
|
|
130
|
+
]), Qe = m(() => ({
|
|
129
131
|
baseUrl: w,
|
|
130
132
|
widgetToken: T,
|
|
131
133
|
organizationId: X,
|
|
@@ -134,7 +136,7 @@ function v({ children: te, baseUrl: s, widgetToken: c, organizationId: l, config
|
|
|
134
136
|
linkComponent: k,
|
|
135
137
|
uiFramework: A,
|
|
136
138
|
implementation: j,
|
|
137
|
-
initResponse:
|
|
139
|
+
initResponse: q
|
|
138
140
|
}), [
|
|
139
141
|
w,
|
|
140
142
|
T,
|
|
@@ -144,60 +146,61 @@ function v({ children: te, baseUrl: s, widgetToken: c, organizationId: l, config
|
|
|
144
146
|
k,
|
|
145
147
|
A,
|
|
146
148
|
j,
|
|
147
|
-
|
|
148
|
-
]),
|
|
149
|
-
resolved:
|
|
150
|
-
own:
|
|
151
|
-
refetch:
|
|
152
|
-
loading:
|
|
153
|
-
error:
|
|
149
|
+
q
|
|
150
|
+
]), $e = m(() => ({
|
|
151
|
+
resolved: Qe,
|
|
152
|
+
own: Ze,
|
|
153
|
+
refetch: Ge,
|
|
154
|
+
loading: Ke,
|
|
155
|
+
error: qe,
|
|
154
156
|
analytics: Z,
|
|
155
157
|
cascadeOrgId: E,
|
|
156
|
-
initResponseStaleForToken:
|
|
158
|
+
initResponseStaleForToken: J,
|
|
157
159
|
disclosuresAcceptance: M,
|
|
158
160
|
providerLabels: N
|
|
159
161
|
}), [
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
Qe,
|
|
163
|
+
Ze,
|
|
164
|
+
Ge,
|
|
165
|
+
Ke,
|
|
166
|
+
qe,
|
|
165
167
|
Z,
|
|
166
168
|
E,
|
|
167
|
-
|
|
169
|
+
J,
|
|
168
170
|
M,
|
|
169
171
|
N
|
|
170
|
-
]),
|
|
171
|
-
value:
|
|
172
|
-
children: /* @__PURE__ */ _(
|
|
172
|
+
]), et = /* @__PURE__ */ _(ce.Provider, {
|
|
173
|
+
value: $e,
|
|
174
|
+
children: /* @__PURE__ */ _(ee, {
|
|
173
175
|
linkComponent: k,
|
|
174
176
|
uiFramework: A,
|
|
175
|
-
children: /* @__PURE__ */ _(
|
|
177
|
+
children: /* @__PURE__ */ _(re, { children: /* @__PURE__ */ _(ge, {
|
|
176
178
|
resetKeys: [T],
|
|
177
|
-
errorFallback:
|
|
178
|
-
onError:
|
|
179
|
-
labels:
|
|
180
|
-
children:
|
|
179
|
+
errorFallback: Ce,
|
|
180
|
+
onError: we,
|
|
181
|
+
labels: Me,
|
|
182
|
+
children: _e(q, x) ? /* @__PURE__ */ _(Se, {
|
|
181
183
|
disclosuresAcceptance: M,
|
|
182
|
-
initStaleForToken:
|
|
183
|
-
labels:
|
|
184
|
-
}) :
|
|
184
|
+
initStaleForToken: J,
|
|
185
|
+
labels: Me
|
|
186
|
+
}) : ne
|
|
185
187
|
}) })
|
|
186
188
|
})
|
|
187
|
-
}), $ =
|
|
188
|
-
client:
|
|
189
|
+
}), $ = V ? /* @__PURE__ */ _(i, {
|
|
190
|
+
client: V,
|
|
189
191
|
organizationId: X,
|
|
190
192
|
widgetToken: T,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
installClientSecret: ze,
|
|
194
|
+
authEpoch: He,
|
|
195
|
+
children: et
|
|
196
|
+
}) : et;
|
|
197
|
+
return Q ? /* @__PURE__ */ _(xe, {
|
|
195
198
|
client: Q,
|
|
196
199
|
children: $
|
|
197
200
|
}) : $;
|
|
198
201
|
}
|
|
199
|
-
function
|
|
200
|
-
let r =
|
|
202
|
+
function Se({ disclosuresAcceptance: e, initStaleForToken: t, labels: n }) {
|
|
203
|
+
let r = ne("error-state") ?? s, i = l(), a = d(e), o = f({
|
|
201
204
|
initStaleForToken: t,
|
|
202
205
|
hasAcceptanceSurface: a
|
|
203
206
|
});
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.84", n = "7cfd4f4027097f08bd71300e75898565395239f2", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js
CHANGED
|
@@ -2,10 +2,11 @@ import { attachTransportInterceptors as e } from "../../../../data-access/dist/l
|
|
|
2
2
|
import "../../../../data-access/dist/index.js";
|
|
3
3
|
import { attachAnalyticsInterceptors as t } from "./interceptor.js";
|
|
4
4
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js
|
|
5
|
-
function n(n, { tokenRef: r, analyticsContextRef: i,
|
|
5
|
+
function n(n, { tokenRef: r, analyticsContextRef: i, clientSecretRef: a, gatewayRouting: o }) {
|
|
6
6
|
return e(n, {
|
|
7
7
|
tokenRef: r,
|
|
8
|
-
|
|
8
|
+
clientSecretRef: a,
|
|
9
|
+
gatewayRouting: o
|
|
9
10
|
}), t(n, i), n;
|
|
10
11
|
}
|
|
11
12
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
|
-
import { getBankAccountApplication as t } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
7
|
-
import { withAuthEpoch as n } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
8
|
-
import "../../../shared/data-access/dist/index.js";
|
|
9
|
-
import { applicationResourceHeaders as r } from "./index3.js";
|
|
10
|
-
import { hasFreshAnswer as i } from "./index9.js";
|
|
11
|
-
import { useMemo as a } from "react";
|
|
12
|
-
import { useQuery as o } from "@tanstack/react-query";
|
|
13
|
-
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index11.js
|
|
14
|
-
var s = "getBankAccountApplication", c = (e, t) => (n, r) => {
|
|
15
|
-
if (n === void 0 || r === void 0) return;
|
|
16
|
-
let [i, a] = r.queryKey;
|
|
17
|
-
if (i === s && a?.baseUrl === e && a?.id === t) return n;
|
|
18
|
-
};
|
|
19
|
-
function l(l, u) {
|
|
20
|
-
let { client: d, organizationId: f, widgetToken: p, authEpoch: m } = e(), h = !!(p && l && u), g = async ({ signal: e }) => {
|
|
21
|
-
let { data: n } = await t({
|
|
22
|
-
client: d,
|
|
23
|
-
path: { id: l ?? "" },
|
|
24
|
-
headers: r(f, u),
|
|
25
|
-
signal: e,
|
|
26
|
-
throwOnError: !0
|
|
27
|
-
});
|
|
28
|
-
if (!n) throw Error("Unexpected application response from widget gateway");
|
|
29
|
-
return n;
|
|
30
|
-
}, _ = d.getConfig().baseUrl, { queryKey: v } = n({ queryKey: [s, {
|
|
31
|
-
baseUrl: _,
|
|
32
|
-
id: l
|
|
33
|
-
}] }, m), y = a(() => c(_, l), [_, l]), b = o({
|
|
34
|
-
queryKey: v,
|
|
35
|
-
queryFn: g,
|
|
36
|
-
placeholderData: y,
|
|
37
|
-
enabled: h,
|
|
38
|
-
retry: 2,
|
|
39
|
-
retryDelay: 300
|
|
40
|
-
});
|
|
41
|
-
return {
|
|
42
|
-
application: b.data ?? null,
|
|
43
|
-
isResolved: !h || i(b),
|
|
44
|
-
isUnavailable: h && b.isError
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
//#endregion
|
|
48
|
-
export { l as useStartedBankAccountApplication };
|