@tesouro/embedded-components-react 0.7.43 → 0.7.45
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/index.d.ts +1 -0
- package/dist/lib/LinkedAccountsWidget.d.ts +1 -0
- package/dist/lib/WidgetSuite.d.ts +1 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +36 -36
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/forms.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/permissions.js +8 -7
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +200 -191
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/mocks/linkedAccounts.js +87 -79
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index15.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index5.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/organization/useOrganizationQuery.js +24 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index7.js +0 -25
package/dist/index.d.ts
CHANGED
|
@@ -3,5 +3,4 @@ import "./index3.js";
|
|
|
3
3
|
import { useCreateDebitCardMutation as t } from "./index4.js";
|
|
4
4
|
import { useCreateVelocityControlMutation as n } from "./index5.js";
|
|
5
5
|
import { useManageDebitCardAccessMutation as r } from "./index6.js";
|
|
6
|
-
|
|
7
|
-
export { e as useCreateCard, i as useCreateCardOrganizationQuery, t as useCreateDebitCardMutation, n as useCreateVelocityControlMutation, r as useManageDebitCardAccessMutation };
|
|
6
|
+
export { e as useCreateCard, t as useCreateDebitCardMutation, n as useCreateVelocityControlMutation, r as useManageDebitCardAccessMutation };
|
package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js
CHANGED
|
@@ -7,30 +7,30 @@ import { getStateOptions as t } from "../../../../shared/util/dist/lib/usStates.
|
|
|
7
7
|
import { Scope as n } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
8
8
|
import { useAllBankAccountsQuery as r } from "../../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
|
|
9
9
|
import { useAllMerchantCategoryGroupsQuery as i } from "../../../../shared/data-access/dist/lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js";
|
|
10
|
-
import {
|
|
10
|
+
import { useOrganizationQuery as a } from "../../../../shared/data-access/dist/lib/organization/useOrganizationQuery.js";
|
|
11
|
+
import { useAllOrganizationUsersQuery as o } from "../../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
11
12
|
import "../../../../shared/data-access/dist/index.js";
|
|
12
|
-
import { EmbeddedToaster as
|
|
13
|
+
import { EmbeddedToaster as ee } from "../../../../shared/ui/dist/lib/EmbeddedToaster.js";
|
|
13
14
|
import "../../../../shared/ui/dist/index.js";
|
|
14
|
-
import { useAnalyticsTrack as
|
|
15
|
+
import { useAnalyticsTrack as te } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
15
16
|
import { WidgetProvider as s } from "../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
16
|
-
import { useWidgetConfig as
|
|
17
|
+
import { useWidgetConfig as ne } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
17
18
|
import "../../../../shared/feature/dist/index.js";
|
|
18
|
-
import { filterUsersForOrganization as
|
|
19
|
+
import { filterUsersForOrganization as re } from "../../../../../shared/util-validation/dist/index7.js";
|
|
19
20
|
import { CREATE_CARD_WIDGET_LABELS_EN as c } from "../../ui/dist/lib/CreateCardWidget/labels.js";
|
|
20
21
|
import { CreateCardView as l, MailingOptionValue as u } from "../../ui/dist/lib/CreateCardWidget/types.js";
|
|
21
|
-
import { CreateCardWidget as
|
|
22
|
+
import { CreateCardWidget as ie } from "../../ui/dist/lib/CreateCardWidget/CreateCardWidget.js";
|
|
22
23
|
import "../../ui/dist/index.js";
|
|
23
|
-
import { CardFormatValue as d, buildCreateDebitCardRequest as
|
|
24
|
-
import { resolveCreateCardFeatureLabels as
|
|
25
|
-
import { CreateCardWidgetAnalyticsEvent as
|
|
26
|
-
import { SpendLimitPeriodValue as f, buildPerTransactionMaximumVelocityControlRequest as
|
|
27
|
-
import { getCreateCardPermissions as
|
|
28
|
-
import { useCreateCardCardholderOptions as
|
|
29
|
-
import { useCreateCard as
|
|
30
|
-
import { useCreateDebitCardMutation as
|
|
31
|
-
import { useCreateVelocityControlMutation as
|
|
32
|
-
import { useManageDebitCardAccessMutation as
|
|
33
|
-
import { useCreateCardOrganizationQuery as xe } from "../../data-access/dist/index7.js";
|
|
24
|
+
import { CardFormatValue as d, buildCreateDebitCardRequest as ae, createDebitCardReference as oe, formatBusinessAddress as se, isBusinessAddressComplete as ce, isManualAddressComplete as le } from "./index3.js";
|
|
25
|
+
import { resolveCreateCardFeatureLabels as ue } from "./index5.js";
|
|
26
|
+
import { CreateCardWidgetAnalyticsEvent as de, WIDGET_NAME as fe } from "./index2.js";
|
|
27
|
+
import { SpendLimitPeriodValue as f, buildPerTransactionMaximumVelocityControlRequest as pe, buildSpendLimitVelocityControlRequest as me, parseControlAmountToMinorUnits as he } from "./index4.js";
|
|
28
|
+
import { getCreateCardPermissions as ge } from "./index6.js";
|
|
29
|
+
import { useCreateCardCardholderOptions as _e } from "./index7.js";
|
|
30
|
+
import { useCreateCard as ve } from "../../data-access/dist/index2.js";
|
|
31
|
+
import { useCreateDebitCardMutation as ye } from "../../data-access/dist/index4.js";
|
|
32
|
+
import { useCreateVelocityControlMutation as be } from "../../data-access/dist/index5.js";
|
|
33
|
+
import { useManageDebitCardAccessMutation as xe } from "../../data-access/dist/index6.js";
|
|
34
34
|
import "../../data-access/dist/index.js";
|
|
35
35
|
import { useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
36
36
|
import { Fragment as Se, jsx as _, jsxs as Ce } from "react/jsx-runtime";
|
|
@@ -59,8 +59,8 @@ function ke(e, t) {
|
|
|
59
59
|
let n = e.nickname?.trim(), r = Oe(e.accountNumber);
|
|
60
60
|
return n && r ? `${n} (${r})` : n || r || t;
|
|
61
61
|
}
|
|
62
|
-
function y({ cardArtSrc: n, labels: s, featureLabels:
|
|
63
|
-
let Me =
|
|
62
|
+
function y({ cardArtSrc: n, labels: s, featureLabels: fe, className: Oe, onClose: y, onCancel: Ae, onViewCard: je }) {
|
|
63
|
+
let Me = te(), { isReady: b } = ve(), { initResponse: Ne, organizationId: x } = ne(), S = m(() => ge(Ne?.scopes), [Ne?.scopes]), C = ue(fe), w = {
|
|
64
64
|
...c,
|
|
65
65
|
...s,
|
|
66
66
|
setup: {
|
|
@@ -81,12 +81,12 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
|
|
|
81
81
|
p(() => (W.current = !0, () => {
|
|
82
82
|
W.current = !1;
|
|
83
83
|
}), []), p(() => {
|
|
84
|
-
Me(
|
|
84
|
+
Me(de.Mounted);
|
|
85
85
|
}, [Me]);
|
|
86
|
-
let { options: Ye, isError: G, refetch: Xe } =
|
|
86
|
+
let { options: Ye, isError: G, refetch: Xe } = _e({ enabled: b && S.canReadUsers }), K = o({
|
|
87
87
|
enabled: b && S.canReadUsers,
|
|
88
88
|
permissions: [we]
|
|
89
|
-
}), Ze = m(() => !b || !S.canReadUsers || K.isResolving || K.isError ? [] :
|
|
89
|
+
}), Ze = m(() => !b || !S.canReadUsers || K.isResolving || K.isError ? [] : re(K.data?.data ?? [], x).map((e) => e.id), [
|
|
90
90
|
K.data?.data,
|
|
91
91
|
K.isError,
|
|
92
92
|
K.isResolving,
|
|
@@ -116,7 +116,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
|
|
|
116
116
|
C.toast.retry,
|
|
117
117
|
q
|
|
118
118
|
]);
|
|
119
|
-
let $e =
|
|
119
|
+
let $e = a({ enabled: b && S.canReadOrganization }), Y = r({ enabled: b && S.canReadFundingAccounts }), et = i({ enabled: b && S.canReadMerchantCategoryGroups }), tt = ye(), nt = be(), rt = xe(), X = !!Y.isError && b && S.canReadFundingAccounts, Z = m(() => X ? [] : (Y.data?.data ?? []).map((e) => ({
|
|
120
120
|
value: e.id,
|
|
121
121
|
label: ke(e, C.untitledFundingAccount)
|
|
122
122
|
})), [
|
|
@@ -126,7 +126,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
|
|
|
126
126
|
]), Q = m(() => (et.data?.data ?? []).map((e) => ({
|
|
127
127
|
value: e.id,
|
|
128
128
|
label: e.name
|
|
129
|
-
})), [et.data?.data]), $ = ze ?? (Z.length === 1 ? Z[0].value : null), it = $e.data?.address, at =
|
|
129
|
+
})), [et.data?.data]), $ = ze ?? (Z.length === 1 ? Z[0].value : null), it = $e.data?.address, at = se(it), ot = ce(it), st = D === d.Physical, ct = st && O === u.BusinessAddress && !!at, lt = st && O === u.DifferentAddress, ut = X || Z.length > 0, dt = b && S.canWriteAuthorizationControls, ft = m(() => [
|
|
130
130
|
{
|
|
131
131
|
value: f.OneTime,
|
|
132
132
|
label: C.spendLimit.periodOneTime
|
|
@@ -165,7 +165,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
|
|
|
165
165
|
C.spendLimit.monthlyResetNotice,
|
|
166
166
|
C.spendLimit.oneTimeWarningDescription,
|
|
167
167
|
C.spendLimit.oneTimeWarningTitle
|
|
168
|
-
]), mt = A && (
|
|
168
|
+
]), mt = A && (he(M) === null || P === null), ht = I && he(R) === null, gt = B && H.length === 0, _t = Q.length === 0 && !B;
|
|
169
169
|
dt || (A && j(!1), M !== "" && N(""), P !== null && F(null), I && L(!1), R !== "" && z(""), B && V(!1), H.length > 0 && U([]));
|
|
170
170
|
let vt = m(() => ({
|
|
171
171
|
isSpendLimitEnabled: A,
|
|
@@ -202,7 +202,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
|
|
|
202
202
|
M,
|
|
203
203
|
pt,
|
|
204
204
|
ft
|
|
205
|
-
]), yt = !b || !S.canIssue || tt.isPending || nt.isPending || rt.isPending || G || X || q || Qe || !E || !D || !$ || mt || ht || gt || D === d.Physical && (!O || O === u.BusinessAddress && !ot || O === u.DifferentAddress && !
|
|
205
|
+
]), yt = !b || !S.canIssue || tt.isPending || nt.isPending || rt.isPending || G || X || q || Qe || !E || !D || !$ || mt || ht || gt || D === d.Physical && (!O || O === u.BusinessAddress && !ot || O === u.DifferentAddress && !le(Ve)), bt = m(() => {
|
|
206
206
|
let e = De(Ge, C);
|
|
207
207
|
return {
|
|
208
208
|
...s,
|
|
@@ -217,7 +217,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
|
|
|
217
217
|
s
|
|
218
218
|
]), xt = async () => {
|
|
219
219
|
if (!b) return;
|
|
220
|
-
let t =
|
|
220
|
+
let t = oe(), n = ae({
|
|
221
221
|
cardholderUserId: E,
|
|
222
222
|
format: D,
|
|
223
223
|
bankAccountId: $,
|
|
@@ -238,7 +238,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
|
|
|
238
238
|
We(t.id), Ke(t.cardStatus);
|
|
239
239
|
let i = [];
|
|
240
240
|
if (A) {
|
|
241
|
-
let e =
|
|
241
|
+
let e = me({
|
|
242
242
|
cardId: t.id,
|
|
243
243
|
amount: M,
|
|
244
244
|
period: P,
|
|
@@ -248,7 +248,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
|
|
|
248
248
|
e && i.push(e);
|
|
249
249
|
}
|
|
250
250
|
if (I) {
|
|
251
|
-
let e =
|
|
251
|
+
let e = pe({
|
|
252
252
|
cardId: t.id,
|
|
253
253
|
amount: R,
|
|
254
254
|
id: crypto.randomUUID(),
|
|
@@ -316,7 +316,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
|
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
318
|
};
|
|
319
|
-
return /* @__PURE__ */ Ce(Se, { children: [/* @__PURE__ */ _(
|
|
319
|
+
return /* @__PURE__ */ Ce(Se, { children: [/* @__PURE__ */ _(ee, {}), /* @__PURE__ */ _(ie, {
|
|
320
320
|
view: Ie,
|
|
321
321
|
cardArtSrc: n,
|
|
322
322
|
labels: bt,
|
|
@@ -367,9 +367,9 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
|
|
|
367
367
|
} : void 0
|
|
368
368
|
})] });
|
|
369
369
|
}
|
|
370
|
-
function Ae({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: ee, errorFallback: te, onError: ne, analytics:
|
|
370
|
+
function Ae({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: ee, errorFallback: te, onError: ne, analytics: re, disclosuresAcceptance: c, providerLabels: l, ...u }) {
|
|
371
371
|
return /* @__PURE__ */ _(s, {
|
|
372
|
-
widgetName:
|
|
372
|
+
widgetName: fe,
|
|
373
373
|
baseUrl: e,
|
|
374
374
|
widgetToken: t,
|
|
375
375
|
organizationId: n,
|
|
@@ -380,10 +380,10 @@ function Ae({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, ga
|
|
|
380
380
|
uiFramework: ee,
|
|
381
381
|
errorFallback: te,
|
|
382
382
|
onError: ne,
|
|
383
|
-
analytics:
|
|
384
|
-
disclosuresAcceptance:
|
|
385
|
-
providerLabels:
|
|
386
|
-
children: /* @__PURE__ */ _(y, { ...
|
|
383
|
+
analytics: re,
|
|
384
|
+
disclosuresAcceptance: c,
|
|
385
|
+
providerLabels: l,
|
|
386
|
+
children: /* @__PURE__ */ _(y, { ...u })
|
|
387
387
|
});
|
|
388
388
|
}
|
|
389
389
|
//#endregion
|
package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/forms.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
var e = {
|
|
3
3
|
accountHolderType: "",
|
|
4
4
|
nickname: "",
|
|
5
|
+
nameOnAccount: "",
|
|
5
6
|
accountNumber: "",
|
|
6
7
|
routingNumber: "",
|
|
7
8
|
type: ""
|
|
@@ -21,7 +22,7 @@ function n(e) {
|
|
|
21
22
|
return r % 10 == 0;
|
|
22
23
|
}
|
|
23
24
|
function r(e) {
|
|
24
|
-
return e.accountHolderType !== "" && e.type !== "" && e.nickname.trim() !== "" && e.accountNumber.trim() !== "" && n(e.routingNumber);
|
|
25
|
+
return e.accountHolderType !== "" && e.type !== "" && e.nameOnAccount.trim() !== "" && e.nickname.trim() !== "" && e.accountNumber.trim() !== "" && n(e.routingNumber);
|
|
25
26
|
}
|
|
26
27
|
var i = {
|
|
27
28
|
nickname: "",
|
|
@@ -2,14 +2,15 @@ import { hasAnyScope as e } from "../../../../shared/data-access/dist/lib/hasAny
|
|
|
2
2
|
import { Scope as t } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
3
3
|
import "../../../../shared/data-access/dist/index.js";
|
|
4
4
|
//#region ../../libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/permissions.js
|
|
5
|
-
var n = [t.ExternalBankAccountReadOrg], r = [t.ExternalBankAccountWriteOrg], i = [t.ExternalBankAccountMicroDepositOrg];
|
|
6
|
-
function
|
|
7
|
-
let
|
|
5
|
+
var n = [t.ExternalBankAccountReadOrg], r = [t.ExternalBankAccountWriteOrg], i = [t.ExternalBankAccountMicroDepositOrg], a = [t.OrganizationReadOrg];
|
|
6
|
+
function o(t) {
|
|
7
|
+
let o = new Set(t ?? []);
|
|
8
8
|
return {
|
|
9
|
-
canRead: e(
|
|
10
|
-
canWrite: e(
|
|
11
|
-
canMicroDeposit: e(
|
|
9
|
+
canRead: e(o, n),
|
|
10
|
+
canWrite: e(o, r),
|
|
11
|
+
canMicroDeposit: e(o, i),
|
|
12
|
+
canReadOrganization: e(o, a)
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
//#endregion
|
|
15
|
-
export {
|
|
16
|
+
export { o as getLinkedAccountsPermissions };
|
|
@@ -7,42 +7,43 @@ import { TESOURO_NEW_EXTERNAL_BANK_ACCOUNT_LINKED_SUCCESS_EVENT as t, emitWidget
|
|
|
7
7
|
import { extractApiErrorMessage as ee } from "../../../../shared/util/dist/lib/apiErrors.js";
|
|
8
8
|
import { OrganizationStatus as te, isOrganizationOnItsWay as ne } from "../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
9
9
|
import { useEmbedApi as re } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
10
|
-
import { Scope as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
10
|
+
import { Scope as ie } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
11
|
+
import { useOrganizationQuery as ae } from "../../../../shared/data-access/dist/lib/organization/useOrganizationQuery.js";
|
|
12
|
+
import { useAllOrganizationRolesQuery as oe } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
|
|
13
|
+
import { useAllOrganizationUsersQuery as se } from "../../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
13
14
|
import "../../../../shared/data-access/dist/index.js";
|
|
14
15
|
import "../../../../shared/ui/dist/index.js";
|
|
15
|
-
import { useAnalyticsTrack as
|
|
16
|
-
import { useWidgetConfig as
|
|
16
|
+
import { useAnalyticsTrack as ce } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
17
|
+
import { useWidgetConfig as le, useWidgetError as ue, useWidgetLoading as de } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
17
18
|
import "../../../../shared/feature/dist/index.js";
|
|
18
|
-
import { filterRolesForOrganization as
|
|
19
|
-
import { filterUsersForOrganization as
|
|
20
|
-
import { DEFAULT_FEATURE_LABELS as
|
|
21
|
-
import { LinkedAccountsWidgetAnalyticsEvent as
|
|
22
|
-
import { EMPTY_CONNECT_FORM as
|
|
23
|
-
import { getLinkedAccountsPermissions as
|
|
24
|
-
import { toAccountRows as
|
|
25
|
-
import { fromApiAccountHolderType as
|
|
26
|
-
import { useConnectExternalBankAccountMutation as
|
|
27
|
-
import { useExternalBankAccountsQuery as
|
|
28
|
-
import { useGrantExternalBankAccountAccessMutation as
|
|
29
|
-
import { useLinkExternalBankAccountMutation as
|
|
30
|
-
import { useUnlinkExternalBankAccountMutation as
|
|
31
|
-
import { useUpdateExternalBankAccountMutation as
|
|
32
|
-
import { useValidateExternalBankAccountMutation as
|
|
19
|
+
import { filterRolesForOrganization as fe } from "../../../../../shared/util-validation/dist/index6.js";
|
|
20
|
+
import { filterUsersForOrganization as pe } from "../../../../../shared/util-validation/dist/index7.js";
|
|
21
|
+
import { DEFAULT_FEATURE_LABELS as me } from "./labels.js";
|
|
22
|
+
import { LinkedAccountsWidgetAnalyticsEvent as r } from "./analytics/events.js";
|
|
23
|
+
import { EMPTY_CONNECT_FORM as he, EMPTY_EDIT_FORM as ge, EMPTY_VERIFY_FORM as i, isConnectStep1Valid as a, isRoutingNumberValid as _e, isVerifyAmountInRange as ve, isVerifyFormValid as ye, parseVerifyAmountToMinorUnits as be, sanitizeRoutingNumberInput as xe, toEditForm as Se, toUpdateBody as Ce } from "./forms.js";
|
|
24
|
+
import { getLinkedAccountsPermissions as we } from "./permissions.js";
|
|
25
|
+
import { toAccountRows as Te } from "./rows.js";
|
|
26
|
+
import { fromApiAccountHolderType as Ee, toApiAccountHolderType as De, toSummaryTypeLabel as Oe, toTextParts as o } from "./summary.js";
|
|
27
|
+
import { useConnectExternalBankAccountMutation as ke } from "../../../data-access/dist/index3.js";
|
|
28
|
+
import { useExternalBankAccountsQuery as Ae } from "../../../data-access/dist/index4.js";
|
|
29
|
+
import { useGrantExternalBankAccountAccessMutation as je } from "../../../data-access/dist/index5.js";
|
|
30
|
+
import { useLinkExternalBankAccountMutation as Me } from "../../../data-access/dist/index6.js";
|
|
31
|
+
import { useUnlinkExternalBankAccountMutation as Ne } from "../../../data-access/dist/index9.js";
|
|
32
|
+
import { useUpdateExternalBankAccountMutation as Pe } from "../../../data-access/dist/index10.js";
|
|
33
|
+
import { useValidateExternalBankAccountMutation as Fe } from "../../../data-access/dist/index11.js";
|
|
33
34
|
import "../../../data-access/dist/index.js";
|
|
34
|
-
import { useAdminEligibleUserIds as
|
|
35
|
-
import { toAccessRows as
|
|
36
|
-
import { DEFAULT_LABELS as
|
|
35
|
+
import { useAdminEligibleUserIds as Ie } from "./useAdminEligibleUserIds.js";
|
|
36
|
+
import { toAccessRows as Le, toOrganizationRoleOptions as Re, toTeamMembers as ze } from "./teamMembers.js";
|
|
37
|
+
import { DEFAULT_LABELS as Be } from "../../../ui/dist/index15.js";
|
|
37
38
|
import "../../../ui/dist/index.js";
|
|
38
|
-
import { useCallback as
|
|
39
|
+
import { useCallback as Ve, useEffect as He, useMemo as s, useState as c } from "react";
|
|
39
40
|
//#region ../../libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js
|
|
40
|
-
function
|
|
41
|
+
function Ue(e) {
|
|
41
42
|
let t = e;
|
|
42
43
|
return typeof e == "object" && !!e && "verificationStatus" in e && t.verificationStatus === "VERIFIED";
|
|
43
44
|
}
|
|
44
45
|
var l = "tesouro.linkedAccounts.locallySentMicroDepositAccountIds.v1";
|
|
45
|
-
function
|
|
46
|
+
function We() {
|
|
46
47
|
if (typeof window > "u") return /* @__PURE__ */ new Set();
|
|
47
48
|
try {
|
|
48
49
|
let e = window.sessionStorage.getItem(l), t = e ? JSON.parse(e) : [];
|
|
@@ -59,158 +60,166 @@ function d(e) {
|
|
|
59
60
|
window.sessionStorage.setItem(l, JSON.stringify([...e]));
|
|
60
61
|
} catch {}
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
+
function Ge(e, t) {
|
|
63
64
|
let n = new Set(e).add(t);
|
|
64
65
|
return d(n), n;
|
|
65
66
|
}
|
|
66
|
-
var
|
|
67
|
-
function
|
|
67
|
+
var Ke = ie.ExternalBankAccountWriteOrg;
|
|
68
|
+
function f({ labels: ie, featureLabels: l }) {
|
|
68
69
|
let u = {
|
|
69
|
-
...
|
|
70
|
-
...
|
|
70
|
+
...Be,
|
|
71
|
+
...ie
|
|
71
72
|
}, d = {
|
|
72
|
-
...
|
|
73
|
+
...me,
|
|
73
74
|
...l
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
let
|
|
75
|
+
}, f = ce(), { organizationId: p, widgetToken: qe, initResponse: m } = le(), Je = de(), { organizationStatus: Ye } = re(), Xe = ne(Ye), Ze = !!ue(), h = !!(p && qe), Qe = h || !!qe && Ye === te.Rotating, g = s(() => we(m?.scopes), [m?.scopes]), _ = Qe && g.canRead && !!m, [v, $e] = c(), [y, et] = c(!1), [b, x] = c(1), [S, tt] = c([]), [C, nt] = c(), [rt, w] = c(), [T, it] = c(We), [at, E] = c(!1), [ot, st] = c(!1), [ct, D] = c(!1), [lt, O] = c(!1), [k, A] = c(), [j, ut] = c(he), [M, N] = c(!1), [P, F] = c(ge), [I, L] = c(i);
|
|
76
|
+
He(() => {
|
|
77
|
+
f(r.Mounted);
|
|
78
|
+
}, [f]);
|
|
79
|
+
let R = Ae({
|
|
79
80
|
limit: 100,
|
|
80
|
-
enabled:
|
|
81
|
-
}), B =
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
enabled: _
|
|
82
|
+
}), z = ke(), B = je(), V = Pe(), H = Ne(), U = Me(), W = Fe(), G = y && b >= 2, K = se({ enabled: G }), q = oe({ enabled: G }), dt = ae({ enabled: y && g.canReadOrganization }).data?.legalName ?? "", J = s(() => M ? j : {
|
|
83
|
+
...j,
|
|
84
|
+
nameOnAccount: dt
|
|
85
|
+
}, [
|
|
86
|
+
M,
|
|
87
|
+
j,
|
|
88
|
+
dt
|
|
89
|
+
]), { userIds: ft, isResolving: pt, isError: mt } = Ie({
|
|
90
|
+
enabled: G,
|
|
91
|
+
permissionKey: Ke,
|
|
92
|
+
organizationId: p
|
|
85
93
|
}), Y = s(() => {
|
|
86
|
-
let e =
|
|
87
|
-
organizationId:
|
|
88
|
-
organizationTypes:
|
|
89
|
-
}) : e, n =
|
|
90
|
-
return
|
|
94
|
+
let e = q.data?.data ?? [], t = p ? fe(e, {
|
|
95
|
+
organizationId: p,
|
|
96
|
+
organizationTypes: m?.organizationTypes ?? []
|
|
97
|
+
}) : e, n = pe(K.data?.data ?? [], p);
|
|
98
|
+
return ze(n, Re(t), ft);
|
|
91
99
|
}, [
|
|
92
|
-
|
|
93
|
-
J.data?.data,
|
|
100
|
+
ft,
|
|
94
101
|
q.data?.data,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
K.data?.data,
|
|
103
|
+
p,
|
|
104
|
+
m?.organizationTypes
|
|
105
|
+
]), ht = K.isLoading || K.isFetchingNextPage || !!K.hasNextPage || q.isResolving || pt, gt = !ht && !K.isError && !mt, X = _ ? R.data?.data ?? [] : [], Z = s(() => X.map((e) => e.verificationStatus === "UNVERIFIED" && T.has(e.id) ? {
|
|
98
106
|
...e,
|
|
99
107
|
verificationStatus: "VERIFICATION_SENT"
|
|
100
|
-
} : e), [X,
|
|
101
|
-
|
|
108
|
+
} : e), [X, T]), _t = [.../* @__PURE__ */ new Set([...Y.filter((e) => e.locked).map((e) => e.id), ...S])], vt = Ve((e) => {
|
|
109
|
+
z.reset(), B.reset(), U.reset(), e.nameOnAccount !== J.nameOnAccount && N(!0), ut({
|
|
102
110
|
...e,
|
|
103
|
-
routingNumber:
|
|
111
|
+
routingNumber: xe(e.routingNumber)
|
|
104
112
|
});
|
|
105
113
|
}, [
|
|
114
|
+
J.nameOnAccount,
|
|
115
|
+
z,
|
|
106
116
|
B,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
mt();
|
|
117
|
+
U
|
|
118
|
+
]), Q = () => {
|
|
119
|
+
x(3), n(t);
|
|
120
|
+
}, yt = (e) => {
|
|
121
|
+
if (!g.canMicroDeposit) {
|
|
122
|
+
Q();
|
|
114
123
|
return;
|
|
115
124
|
}
|
|
116
|
-
|
|
117
|
-
|
|
125
|
+
w("connect"), U.mutate({ path: { id: e } }, { onSuccess: () => {
|
|
126
|
+
w(void 0), it((t) => Ge(t, e)), f(r.AccountLinked, { accountId: e }), Q();
|
|
118
127
|
} });
|
|
119
|
-
},
|
|
120
|
-
|
|
128
|
+
}, bt = (e) => {
|
|
129
|
+
B.mutate({
|
|
121
130
|
path: { id: e },
|
|
122
|
-
body: { userIds:
|
|
123
|
-
}, { onSuccess: () =>
|
|
124
|
-
},
|
|
125
|
-
if (
|
|
126
|
-
if (
|
|
127
|
-
if (!
|
|
128
|
-
|
|
131
|
+
body: { userIds: _t }
|
|
132
|
+
}, { onSuccess: () => yt(e) });
|
|
133
|
+
}, xt = () => {
|
|
134
|
+
if (h && g.canWrite) {
|
|
135
|
+
if (b === 1) {
|
|
136
|
+
if (!a(J)) return;
|
|
137
|
+
x(2);
|
|
129
138
|
return;
|
|
130
139
|
}
|
|
131
|
-
if (
|
|
132
|
-
if (
|
|
133
|
-
|
|
140
|
+
if (b === 2 && gt) {
|
|
141
|
+
if (C) {
|
|
142
|
+
bt(C.id);
|
|
134
143
|
return;
|
|
135
144
|
}
|
|
136
|
-
|
|
137
|
-
nickname:
|
|
138
|
-
accountNumber:
|
|
139
|
-
routingNumber:
|
|
140
|
-
nameOnAccount:
|
|
141
|
-
type:
|
|
142
|
-
accountHolderType:
|
|
145
|
+
z.mutate({ body: {
|
|
146
|
+
nickname: J.nickname.trim(),
|
|
147
|
+
accountNumber: J.accountNumber.trim(),
|
|
148
|
+
routingNumber: J.routingNumber.trim(),
|
|
149
|
+
nameOnAccount: J.nameOnAccount.trim(),
|
|
150
|
+
type: J.type,
|
|
151
|
+
accountHolderType: De(J.accountHolderType)
|
|
143
152
|
} }, { onSuccess: (e) => {
|
|
144
|
-
|
|
153
|
+
f(r.AccountConnected, { accountId: e?.id }), nt(e), e?.id && bt(e.id);
|
|
145
154
|
} });
|
|
146
155
|
}
|
|
147
156
|
}
|
|
148
|
-
}, _t = () => {
|
|
149
|
-
S === 2 && C(1);
|
|
150
|
-
}, vt = (e, t) => {
|
|
151
|
-
Y.find((t) => t.id === e)?.locked || Qe((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
|
|
152
|
-
}, yt = (e) => {
|
|
153
|
-
(!e || g) && (!e || _.canWrite) && (e && (C(1), P(pe), Qe([]), $e(void 0), E(void 0), B.reset(), V.reset(), W.reset()), Ze(e));
|
|
154
|
-
}, bt = (e) => {
|
|
155
|
-
if (!g || !_.canWrite) return;
|
|
156
|
-
let t = X.find((t) => t.id === e);
|
|
157
|
-
b(e), I(xe(t)), O(!0);
|
|
158
|
-
}, xt = (e) => {
|
|
159
|
-
(!e || g) && (!e || _.canWrite) && O(e);
|
|
160
157
|
}, St = () => {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
b === 2 && x(1);
|
|
159
|
+
}, Ct = (e, t) => {
|
|
160
|
+
Y.find((t) => t.id === e)?.locked || tt((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
|
|
161
|
+
}, wt = (e) => {
|
|
162
|
+
(!e || h) && (!e || g.canWrite) && (e && (x(1), ut(he), N(!1), tt([]), nt(void 0), w(void 0), z.reset(), B.reset(), U.reset()), et(e));
|
|
163
|
+
}, Tt = (e) => {
|
|
164
|
+
if (!h || !g.canWrite) return;
|
|
165
|
+
let t = X.find((t) => t.id === e);
|
|
166
|
+
$e(e), F(Se(t)), E(!0);
|
|
167
|
+
}, Et = (e) => {
|
|
168
|
+
(!e || h) && (!e || g.canWrite) && E(e);
|
|
169
|
+
}, Dt = () => {
|
|
170
|
+
if (!h || !g.canWrite || !v) return;
|
|
171
|
+
let t = X.find((e) => e.id === v), n = Ce(P, t);
|
|
172
|
+
Object.keys(n).length !== 0 && V.mutate({
|
|
173
|
+
path: { id: v },
|
|
165
174
|
body: n
|
|
166
175
|
}, { onSuccess: () => {
|
|
167
|
-
|
|
176
|
+
f(r.AccountUpdated, { accountId: v }), e.success(d.editSuccessToast), E(!1);
|
|
168
177
|
} });
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
(!e ||
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
},
|
|
176
|
-
if (!
|
|
177
|
-
let e =
|
|
178
|
-
e !== null && t !== null && (
|
|
179
|
-
path: { id:
|
|
178
|
+
}, Ot = (e) => {
|
|
179
|
+
h && g.canWrite && ($e(e), L(i), O(!1), D(!1), st(!0));
|
|
180
|
+
}, kt = (e) => {
|
|
181
|
+
(!e || h) && (!e || g.canWrite) && (e || (O(!1), D(!1)), st(e));
|
|
182
|
+
}, At = (e) => {
|
|
183
|
+
W.reset(), O(!1), L(e);
|
|
184
|
+
}, jt = () => {
|
|
185
|
+
if (!h || !g.canWrite || !v || !ye(I)) return;
|
|
186
|
+
let e = be(I.firstAmount), t = be(I.secondAmount);
|
|
187
|
+
e !== null && t !== null && (O(!1), W.mutate({
|
|
188
|
+
path: { id: v },
|
|
180
189
|
body: {
|
|
181
190
|
firstAmount: e,
|
|
182
191
|
secondAmount: t
|
|
183
192
|
}
|
|
184
193
|
}, { onSuccess: (e) => {
|
|
185
|
-
if (!
|
|
186
|
-
|
|
194
|
+
if (!Ue(e)) {
|
|
195
|
+
O(!0);
|
|
187
196
|
return;
|
|
188
197
|
}
|
|
189
|
-
|
|
198
|
+
f(r.AccountVerified, { accountId: v }), n("tesouro-new-external-bank-account-linked-success"), D(!0);
|
|
190
199
|
} }));
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
|
|
200
|
+
}, Mt = (e) => {
|
|
201
|
+
h && g.canMicroDeposit && (w("row"), U.mutate({ path: { id: e } }, { onSuccess: () => {
|
|
202
|
+
w(void 0), it((t) => Ge(t, e)), f(r.AccountLinked, { accountId: e });
|
|
194
203
|
} }));
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
},
|
|
198
|
-
e ||
|
|
199
|
-
},
|
|
200
|
-
if (!
|
|
201
|
-
let t =
|
|
202
|
-
|
|
203
|
-
|
|
204
|
+
}, Nt = (e) => {
|
|
205
|
+
h && g.canWrite && A(e);
|
|
206
|
+
}, Pt = (e) => {
|
|
207
|
+
e || A(void 0);
|
|
208
|
+
}, Ft = () => {
|
|
209
|
+
if (!h || !g.canWrite || !k) return;
|
|
210
|
+
let t = k;
|
|
211
|
+
H.mutate({ path: { id: t } }, { onSuccess: () => {
|
|
212
|
+
f(r.AccountUnlinked, { accountId: t }), e.success(d.unlinkSuccessToast), A(void 0);
|
|
204
213
|
} });
|
|
205
|
-
},
|
|
206
|
-
selectedUserIds:
|
|
207
|
-
disabled:
|
|
214
|
+
}, It = z.isPending || B.isPending || V.isPending || W.isPending || H.isPending || U.isPending, Lt = g.canWrite, Rt = !h || It, $ = U.isError && rt === "connect", zt = Le(Y, {
|
|
215
|
+
selectedUserIds: S,
|
|
216
|
+
disabled: Rt || !Lt,
|
|
208
217
|
fallbackTooltip: u.teamMemberAccessTooltip,
|
|
209
|
-
onUserToggle:
|
|
210
|
-
}),
|
|
218
|
+
onUserToggle: Ct
|
|
219
|
+
}), Bt = Y.filter((e) => e.locked).length + S.length, Vt = C ? ((e) => {
|
|
211
220
|
let t = e.accountNumber.slice(-4), n = {
|
|
212
221
|
type: {
|
|
213
|
-
text:
|
|
222
|
+
text: Oe(e.accountHolderType ? Ee(e.accountHolderType) : J.accountHolderType, e.type ?? J.type, d),
|
|
214
223
|
emphasized: !1
|
|
215
224
|
},
|
|
216
225
|
last4: {
|
|
@@ -218,7 +227,7 @@ function p({ labels: r, featureLabels: l }) {
|
|
|
218
227
|
emphasized: !0
|
|
219
228
|
}
|
|
220
229
|
};
|
|
221
|
-
return
|
|
230
|
+
return T.has(e.id) ? {
|
|
222
231
|
variant: "deposits-sent",
|
|
223
232
|
description: o(d.summaryDescription, n),
|
|
224
233
|
nextSteps: [{
|
|
@@ -235,72 +244,72 @@ function p({ labels: r, featureLabels: l }) {
|
|
|
235
244
|
description: o(d.summaryAccountAddedDescription, n),
|
|
236
245
|
nextSteps: []
|
|
237
246
|
};
|
|
238
|
-
})(
|
|
247
|
+
})(C) : void 0, Ht = Te(Z, d, g, {
|
|
239
248
|
labels: u,
|
|
240
|
-
onEditSelect:
|
|
241
|
-
onVerifySelect:
|
|
242
|
-
onLinkSelect:
|
|
243
|
-
onUnlinkSelect:
|
|
244
|
-
}),
|
|
245
|
-
if (!
|
|
246
|
-
let e =
|
|
249
|
+
onEditSelect: Tt,
|
|
250
|
+
onVerifySelect: Ot,
|
|
251
|
+
onLinkSelect: Mt,
|
|
252
|
+
onUnlinkSelect: Nt
|
|
253
|
+
}), Ut = s(() => {
|
|
254
|
+
if (!z.isError && !B.isError && !$) return;
|
|
255
|
+
let e = z.error ?? B.error ?? ($ ? U.error : void 0);
|
|
247
256
|
return ee(e) ?? u.actionErrorTitle;
|
|
248
257
|
}, [
|
|
258
|
+
z.error,
|
|
259
|
+
z.isError,
|
|
249
260
|
B.error,
|
|
250
261
|
B.isError,
|
|
251
|
-
V.error,
|
|
252
|
-
V.isError,
|
|
253
262
|
$,
|
|
254
|
-
|
|
263
|
+
U.error,
|
|
255
264
|
u.actionErrorTitle
|
|
256
265
|
]);
|
|
257
266
|
return {
|
|
258
|
-
rows:
|
|
259
|
-
isLoading: !
|
|
260
|
-
isError:
|
|
261
|
-
isConnectOpen:
|
|
262
|
-
isEditOpen:
|
|
263
|
-
isVerifyOpen:
|
|
264
|
-
isVerifySuccess:
|
|
265
|
-
verifyAccountName: Z.find((e) => e.id ===
|
|
266
|
-
verifyAccountNumber: Z.find((e) => e.id ===
|
|
267
|
-
isUnlinkOpen: !!
|
|
268
|
-
unlinkAccountNumber: Z.find((e) => e.id ===
|
|
269
|
-
connectStep:
|
|
270
|
-
accessRows:
|
|
271
|
-
accessGrantedCount:
|
|
272
|
-
connectSummary:
|
|
273
|
-
isTeamMembersLoading:
|
|
274
|
-
isTeamMembersError:
|
|
275
|
-
isConnectNextDisabled:
|
|
276
|
-
isConnectRoutingNumberInvalid:
|
|
277
|
-
connectErrorMessage:
|
|
278
|
-
isVerifyFirstAmountInvalid:
|
|
279
|
-
isVerifySecondAmountInvalid:
|
|
280
|
-
isVerifySubmitDisabled: !ye(
|
|
281
|
-
isActionDisabled:
|
|
282
|
-
canConnect:
|
|
283
|
-
isSubmitting:
|
|
284
|
-
isActionError:
|
|
285
|
-
isConnectError:
|
|
286
|
-
isEditError:
|
|
287
|
-
isVerifyError:
|
|
288
|
-
connectForm:
|
|
289
|
-
editForm:
|
|
290
|
-
verifyForm:
|
|
291
|
-
onConnectOpenChange:
|
|
292
|
-
onEditOpenChange:
|
|
293
|
-
onVerifyOpenChange:
|
|
294
|
-
onUnlinkOpenChange:
|
|
295
|
-
onConnectFormChange:
|
|
296
|
-
onEditFormChange:
|
|
297
|
-
onVerifyFormChange:
|
|
298
|
-
onConnectNext:
|
|
299
|
-
onConnectBack:
|
|
300
|
-
onEditSubmit:
|
|
301
|
-
onVerifySubmit:
|
|
302
|
-
onUnlinkConfirm:
|
|
267
|
+
rows: Ht,
|
|
268
|
+
isLoading: !Ze && (Xe && !R.data || Je && !m || _ && R.isLoading),
|
|
269
|
+
isError: Ze || _ && R.isError,
|
|
270
|
+
isConnectOpen: y,
|
|
271
|
+
isEditOpen: at,
|
|
272
|
+
isVerifyOpen: ot,
|
|
273
|
+
isVerifySuccess: ct,
|
|
274
|
+
verifyAccountName: Z.find((e) => e.id === v)?.nickname,
|
|
275
|
+
verifyAccountNumber: Z.find((e) => e.id === v)?.accountNumber,
|
|
276
|
+
isUnlinkOpen: !!k,
|
|
277
|
+
unlinkAccountNumber: Z.find((e) => e.id === k)?.accountNumber,
|
|
278
|
+
connectStep: b,
|
|
279
|
+
accessRows: zt,
|
|
280
|
+
accessGrantedCount: Bt,
|
|
281
|
+
connectSummary: Vt,
|
|
282
|
+
isTeamMembersLoading: ht,
|
|
283
|
+
isTeamMembersError: K.isError || mt,
|
|
284
|
+
isConnectNextDisabled: b === 1 ? !a(J) : b === 2 && !gt,
|
|
285
|
+
isConnectRoutingNumberInvalid: J.routingNumber.trim() !== "" && !_e(J.routingNumber),
|
|
286
|
+
connectErrorMessage: Ut,
|
|
287
|
+
isVerifyFirstAmountInvalid: I.firstAmount.trim() !== "" && !ve(I.firstAmount),
|
|
288
|
+
isVerifySecondAmountInvalid: I.secondAmount.trim() !== "" && !ve(I.secondAmount),
|
|
289
|
+
isVerifySubmitDisabled: !ye(I),
|
|
290
|
+
isActionDisabled: Rt,
|
|
291
|
+
canConnect: Lt,
|
|
292
|
+
isSubmitting: It,
|
|
293
|
+
isActionError: U.isError || H.isError || z.isError || B.isError || V.isError || W.isError || lt,
|
|
294
|
+
isConnectError: z.isError || B.isError || $,
|
|
295
|
+
isEditError: V.isError,
|
|
296
|
+
isVerifyError: W.isError || lt,
|
|
297
|
+
connectForm: J,
|
|
298
|
+
editForm: P,
|
|
299
|
+
verifyForm: I,
|
|
300
|
+
onConnectOpenChange: wt,
|
|
301
|
+
onEditOpenChange: Et,
|
|
302
|
+
onVerifyOpenChange: kt,
|
|
303
|
+
onUnlinkOpenChange: Pt,
|
|
304
|
+
onConnectFormChange: vt,
|
|
305
|
+
onEditFormChange: F,
|
|
306
|
+
onVerifyFormChange: At,
|
|
307
|
+
onConnectNext: xt,
|
|
308
|
+
onConnectBack: St,
|
|
309
|
+
onEditSubmit: Dt,
|
|
310
|
+
onVerifySubmit: jt,
|
|
311
|
+
onUnlinkConfirm: Ft
|
|
303
312
|
};
|
|
304
313
|
}
|
|
305
314
|
//#endregion
|
|
306
|
-
export { l as LOCALLY_SENT_MICRO_DEPOSIT_ACCOUNT_IDS_STORAGE_KEY,
|
|
315
|
+
export { l as LOCALLY_SENT_MICRO_DEPOSIT_ACCOUNT_IDS_STORAGE_KEY, f as useLinkedAccountsWidget };
|
|
@@ -1,145 +1,153 @@
|
|
|
1
1
|
import { Scope as e } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
2
2
|
import "../../../../shared/data-access/dist/index.js";
|
|
3
|
-
import { AN_EXTERNAL_BANK_ACCOUNT as t,
|
|
4
|
-
import { SCENARIO_LABELS as
|
|
5
|
-
import { IDENTITY as
|
|
6
|
-
import { MintKind as
|
|
7
|
-
import { LINKED_ACCOUNTS_LABELS as
|
|
3
|
+
import { AN_EXTERNAL_BANK_ACCOUNT as t, AN_ORGANIZATION as n, AN_ORGANIZATION_ROLE as r, AN_ORGANIZATION_USER as i } from "../../../../shared/data-access-mocks/dist/lib/fixtures.js";
|
|
4
|
+
import { SCENARIO_LABELS as a } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/labels.js";
|
|
5
|
+
import { IDENTITY as o, LOADING_DELAY_MS as s, PROXY as c, answer as l, bodyOf as u, endpoint as d, initRoute as f, json as p, noContent as m, problem as h, wait as g } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/scenario.js";
|
|
6
|
+
import { MintKind as _, minter as v } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/worlds.js";
|
|
7
|
+
import { LINKED_ACCOUNTS_LABELS as y } from "./labels.js";
|
|
8
8
|
//#region ../../libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/mocks/linkedAccounts.js
|
|
9
|
-
var
|
|
9
|
+
var b = [e.ExternalBankAccountReadOrg], x = [
|
|
10
|
+
...b,
|
|
11
|
+
e.ExternalBankAccountWriteOrg,
|
|
12
|
+
e.OrganizationReadOrg
|
|
13
|
+
], S = [...x, e.ExternalBankAccountMicroDepositOrg], C = (e) => `00000000-0000-4000-8000-0000000002${String(e).padStart(2, "0")}`, w = (e) => `••••••••${e.slice(-4)}`, T = (e) => [
|
|
10
14
|
t,
|
|
11
15
|
{
|
|
12
16
|
...t,
|
|
13
|
-
id:
|
|
14
|
-
accountNumber:
|
|
17
|
+
id: C(e),
|
|
18
|
+
accountNumber: w("4321"),
|
|
15
19
|
nickname: "Supplier payouts",
|
|
16
20
|
type: "SAVINGS",
|
|
17
21
|
verificationStatus: "UNVERIFIED"
|
|
18
22
|
},
|
|
19
23
|
{
|
|
20
24
|
...t,
|
|
21
|
-
id:
|
|
22
|
-
accountNumber:
|
|
25
|
+
id: C(e + 1),
|
|
26
|
+
accountNumber: w("5678"),
|
|
23
27
|
nickname: "Payroll funding",
|
|
24
28
|
verificationStatus: "VERIFICATION_SENT"
|
|
25
29
|
},
|
|
26
30
|
{
|
|
27
31
|
...t,
|
|
28
|
-
id:
|
|
29
|
-
accountNumber:
|
|
32
|
+
id: C(e + 2),
|
|
33
|
+
accountNumber: w("8765"),
|
|
30
34
|
nickname: "Old savings",
|
|
31
35
|
type: "SAVINGS",
|
|
32
36
|
verificationStatus: "FAILED"
|
|
33
37
|
},
|
|
34
38
|
{
|
|
35
39
|
...t,
|
|
36
|
-
id:
|
|
37
|
-
accountNumber:
|
|
40
|
+
id: C(e + 3),
|
|
41
|
+
accountNumber: w("2468"),
|
|
38
42
|
nickname: "Closed checking",
|
|
39
43
|
accountStatus: "INACTIVE"
|
|
40
44
|
}
|
|
41
|
-
],
|
|
42
|
-
...
|
|
43
|
-
id:
|
|
45
|
+
], E = {
|
|
46
|
+
...r,
|
|
47
|
+
id: C(9),
|
|
44
48
|
key: "embedded:employee",
|
|
45
49
|
name: "Employee",
|
|
46
50
|
description: "Can see their own cards and expenses."
|
|
47
|
-
},
|
|
48
|
-
...
|
|
49
|
-
id:
|
|
51
|
+
}, D = {
|
|
52
|
+
...i,
|
|
53
|
+
id: C(10),
|
|
50
54
|
name: "Grace Example",
|
|
51
55
|
email: "grace@example.com",
|
|
52
|
-
role:
|
|
53
|
-
},
|
|
56
|
+
role: E.key
|
|
57
|
+
}, O = (e) => ({
|
|
54
58
|
data: e,
|
|
55
59
|
nextPaginationToken: null,
|
|
56
60
|
prevPaginationToken: null
|
|
57
|
-
}),
|
|
61
|
+
}), k = () => [
|
|
62
|
+
l((e) => e === `${o}/users`, ({ query: e }) => e.get("Status") === "INVITED" ? p(O([])) : p(O(e.has("Permissions") ? [i] : [i, D]))),
|
|
63
|
+
l((e) => e === `${o}/roles`, () => p(O([r, E]))),
|
|
64
|
+
d("GET", `${o}/organizations/:id`, () => p(n))
|
|
65
|
+
], A = `${c}/external-bank-accounts`, j = "tesouro.linkedAccounts.locallySentMicroDepositAccountIds.v1", M = () => {
|
|
58
66
|
try {
|
|
59
|
-
globalThis.sessionStorage?.removeItem(
|
|
67
|
+
globalThis.sessionStorage?.removeItem(j);
|
|
60
68
|
} catch {}
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
let
|
|
64
|
-
let
|
|
69
|
+
}, N = (e) => {
|
|
70
|
+
M();
|
|
71
|
+
let r = [...e], i = v(), a = () => h(404, "Not Found", "No such external bank account."), o = (e, t) => {
|
|
72
|
+
let n = r.findIndex((t) => t.id === e), i = r[n];
|
|
65
73
|
if (!i) return;
|
|
66
74
|
let a = {
|
|
67
75
|
...i,
|
|
68
76
|
...t
|
|
69
77
|
};
|
|
70
|
-
return n
|
|
78
|
+
return r[n] = a, a;
|
|
71
79
|
};
|
|
72
80
|
return [
|
|
73
|
-
...
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
await
|
|
77
|
-
let
|
|
81
|
+
...k(),
|
|
82
|
+
l((e) => e === A, () => p(O(r))),
|
|
83
|
+
d("POST", A, async (e) => {
|
|
84
|
+
await g(400);
|
|
85
|
+
let a = u(e), o = (e, t) => typeof e == "string" && e ? e : t, s = {
|
|
78
86
|
...t,
|
|
79
|
-
id:
|
|
80
|
-
nickname: a
|
|
81
|
-
nameOnAccount: a
|
|
82
|
-
accountNumber:
|
|
83
|
-
routingNumber: a
|
|
84
|
-
type:
|
|
85
|
-
accountHolderType:
|
|
87
|
+
id: i(_.ExternalAccount),
|
|
88
|
+
nickname: o(a.nickname, "New account"),
|
|
89
|
+
nameOnAccount: o(a.nameOnAccount, n.legalName),
|
|
90
|
+
accountNumber: w(o(a.accountNumber, "0000")),
|
|
91
|
+
routingNumber: o(a.routingNumber, "123456780"),
|
|
92
|
+
type: a.type === "SAVINGS" ? "SAVINGS" : "CHECKING",
|
|
93
|
+
accountHolderType: a.accountHolderType === "BUSINESS" ? "BUSINESS" : "INDIVIDUAL",
|
|
86
94
|
verificationStatus: "UNVERIFIED"
|
|
87
95
|
};
|
|
88
|
-
return
|
|
96
|
+
return r.push(s), p(s, 201);
|
|
89
97
|
}),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
await
|
|
93
|
-
let n =
|
|
94
|
-
return n ?
|
|
98
|
+
d("POST", `${A}/:id/access`, () => m()),
|
|
99
|
+
d("POST", `${A}/:id/link`, async (e, { id: t }) => {
|
|
100
|
+
await g(400);
|
|
101
|
+
let n = o(t, { verificationStatus: "VERIFICATION_SENT" });
|
|
102
|
+
return n ? p(n) : a();
|
|
95
103
|
}),
|
|
96
|
-
|
|
97
|
-
await
|
|
98
|
-
let n =
|
|
99
|
-
return n ?
|
|
104
|
+
d("POST", `${A}/:id/validate`, async (e, { id: t }) => {
|
|
105
|
+
await g(400);
|
|
106
|
+
let n = o(t, { verificationStatus: "VERIFIED" });
|
|
107
|
+
return n ? p(n) : a();
|
|
100
108
|
}),
|
|
101
|
-
|
|
102
|
-
let { nickname: n } =
|
|
103
|
-
return r ?
|
|
109
|
+
d("PATCH", `${A}/:id`, (e, { id: t }) => {
|
|
110
|
+
let { nickname: n } = u(e), r = o(t, typeof n == "string" ? { nickname: n } : {});
|
|
111
|
+
return r ? p(r) : a();
|
|
104
112
|
}),
|
|
105
|
-
|
|
106
|
-
let
|
|
107
|
-
return
|
|
113
|
+
d("DELETE", `${A}/:id`, (e, { id: t }) => {
|
|
114
|
+
let n = r.findIndex((e) => e.id === t);
|
|
115
|
+
return n < 0 ? a() : (r.splice(n, 1), m());
|
|
108
116
|
})
|
|
109
117
|
];
|
|
110
|
-
},
|
|
118
|
+
}, P = (e, t, n, r) => ({
|
|
111
119
|
key: e,
|
|
112
120
|
...t,
|
|
113
|
-
routes: () => [
|
|
114
|
-
}),
|
|
115
|
-
label:
|
|
116
|
-
blurb:
|
|
117
|
-
}),
|
|
121
|
+
routes: () => [f(n), ...N(r.empty ? [] : T(r.base))]
|
|
122
|
+
}), F = y.blurbs, I = (e) => ({
|
|
123
|
+
label: a[e].label,
|
|
124
|
+
blurb: F[e] ?? a[e].blurb
|
|
125
|
+
}), L = (e) => e === A, R = {
|
|
118
126
|
key: "loading",
|
|
119
|
-
...
|
|
127
|
+
...I("loading"),
|
|
120
128
|
routes: () => [
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
...
|
|
129
|
+
f(S),
|
|
130
|
+
l(L, async () => (await g(s), p(O(T(16))))),
|
|
131
|
+
...N(T(16))
|
|
124
132
|
]
|
|
125
|
-
},
|
|
133
|
+
}, z = {
|
|
126
134
|
key: "error",
|
|
127
|
-
...
|
|
135
|
+
...I("error"),
|
|
128
136
|
routes: () => [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
...
|
|
137
|
+
f(S),
|
|
138
|
+
l(L, () => h(500, "Internal Server Error", "Something went wrong.")),
|
|
139
|
+
...N(T(16))
|
|
132
140
|
]
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
|
|
141
|
+
}, B = [
|
|
142
|
+
P("populated", I("populated"), S, { base: 16 }),
|
|
143
|
+
P("empty", I("empty"), S, {
|
|
136
144
|
base: 16,
|
|
137
145
|
empty: !0
|
|
138
146
|
}),
|
|
139
|
-
L,
|
|
140
147
|
R,
|
|
141
|
-
|
|
142
|
-
|
|
148
|
+
z,
|
|
149
|
+
P("control-hidden", I("control-hidden"), [...b, e.ExternalBankAccountMicroDepositOrg], { base: 22 }),
|
|
150
|
+
P("no-micro-deposits", y.scenarios["no-micro-deposits"], x, { base: 27 })
|
|
143
151
|
];
|
|
144
152
|
//#endregion
|
|
145
|
-
export {
|
|
153
|
+
export { B as linkedAccountsScenarios };
|
package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index15.js
CHANGED
|
@@ -6,6 +6,7 @@ var e = {
|
|
|
6
6
|
learnMoreButton: "Learn more about linked accounts",
|
|
7
7
|
connectTitle: "Link Account",
|
|
8
8
|
nicknameLabel: "Account nickname",
|
|
9
|
+
nameOnAccountLabel: "Legal name on account",
|
|
9
10
|
accountNumberLabel: "Account number",
|
|
10
11
|
routingNumberLabel: "Routing number",
|
|
11
12
|
routingNumberError: "Routing number must be a valid 9-digit ABA routing number.",
|
package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index5.js
CHANGED
|
@@ -129,6 +129,16 @@ function u({ labels: e, connectForm: t, disabled: n, routingNumberError: r = !1,
|
|
|
129
129
|
type: e
|
|
130
130
|
})
|
|
131
131
|
}),
|
|
132
|
+
/* @__PURE__ */ a(l, {
|
|
133
|
+
id: "linked-account-name-on-account",
|
|
134
|
+
label: e.nameOnAccountLabel,
|
|
135
|
+
value: t.nameOnAccount,
|
|
136
|
+
disabled: n,
|
|
137
|
+
onChange: (e) => i({
|
|
138
|
+
...t,
|
|
139
|
+
nameOnAccount: e
|
|
140
|
+
})
|
|
141
|
+
}),
|
|
132
142
|
/* @__PURE__ */ a(l, {
|
|
133
143
|
id: "linked-account-nickname",
|
|
134
144
|
label: e.nicknameLabel,
|
|
@@ -36,13 +36,14 @@ import { useAllExternalBankAccountsQuery as Ci } from "./lib/external-bank-accou
|
|
|
36
36
|
import { useAllMerchantCategoryGroupsQuery as wi } from "./lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js";
|
|
37
37
|
import { useAllLedgerAccountsQuery as Ti, useLedgerAccountsQuery as Ei } from "./lib/reference-data/useLedgerAccountsQuery.js";
|
|
38
38
|
import { usePaymentTermsQuery as Di } from "./lib/reference-data/usePaymentTermsQuery.js";
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
|
|
39
|
+
import { useOrganizationQuery as Oi } from "./lib/organization/useOrganizationQuery.js";
|
|
40
|
+
import { useAllOrganizationRolesQuery as ki } from "./lib/role/useAllOrganizationRolesQuery.js";
|
|
41
|
+
import { useRolePermissionsQueries as Ai } from "./lib/role/useRolePermissionsQueries.js";
|
|
42
|
+
import { useAllOrganizationUsersQuery as ji } from "./lib/user/useAllOrganizationUsersQuery.js";
|
|
43
|
+
import { personDisclosure as Mi } from "./lib/disclosures/personDisclosure.js";
|
|
44
|
+
import { useAcceptWidgetDisclosures as Ni } from "./lib/disclosures/useAcceptWidgetDisclosures.js";
|
|
45
|
+
import { useDisclosuresQuery as Pi } from "./lib/disclosures/useDisclosuresQuery.js";
|
|
46
|
+
import { OnboardingSuppressionReason as Fi } from "./lib/onboardingSuppressionReason.js";
|
|
47
|
+
import { useOrganizationOnboardingSuppression as Ii } from "./lib/useOrganizationOnboardingSuppression.js";
|
|
48
|
+
import { useOrganizationApplicationStatus as Li } from "./lib/useOrganizationApplicationStatus.js";
|
|
49
|
+
export { $r as EmbedApiProvider, Fi as OnboardingSuppressionReason, Ir as OrganizationStatus, hi as Scope, Je as activateCreditCardMutation, Ye as activateDebitCardMutation, Br as applicationStatusInvalidationKey, Vr as applicationStatusQueryOptions, Qr as attachTransportInterceptors, e as bulkUpdateDepartmentMembers, t as bulkUpdateLocationMembers, n as bulkUpdateRoleMembers, Ur as cancelAllClients, Xr as cloneEmbeddedClient, Xe as connectExternalBankAccountMutation, Ze as createAchMoneyMovementMutation, Qe as createApplicationMutation, $e as createBankAccountMutation, et as createBookTransferMutation, tt as createCheckDepositMutation, Hr as createClientSecretInstaller, nt as createDebitCardMutation, r as createDepartment, Zr as createEmbeddedClient, i as createLocation, a as createUser, rt as createVelocityControlMutation, o as deactivateDepartment, s as deactivateLocation, it as deleteApprovalPoliciesIdMutation, at as deleteBankAccountApplicationMutation, c as deleteCounterpartsId, l as deleteCounterpartsIdBankAccountsId, u as deleteEntitiesIdLogo, d as deleteFilesId, ot as deleteLedgerAccountsIdMutation, f as deleteMeasureUnitsId, p as deletePayablesId, m as deletePayablesIdFile, h as deleteProductsId, st as deleteReceiptsIdMutation, g as deleteReceivablesId, ct as disableUserMutation, _ as downloadBankAccountTransactions, ri as fetchWidgetInit, _i as getAllPagesNextPageParam, vi as getAllPagesNextPaginationTokenParam, lt as getAnalyticsPayablesOptions, ut as getAnalyticsPayablesQueryKey, dt as getAnalyticsReceiptsOptions, ft as getAnalyticsReceiptsQueryKey, pt as getAnalyticsReceivablesOptions, mt as getAnalyticsReceivablesQueryKey, ht as getAnalyticsTransactionsOptions, gt as getAnalyticsTransactionsQueryKey, v as getApplicationStatus, y as getApprovalPolicies, _t as getApprovalPoliciesOptions, vt as getApprovalPoliciesQueryKey, b as getApprovalRequests, yt as getApprovalRequestsOptions, bt as getApprovalRequestsQueryKey, x as getBankAccountAccess, xt as getBankAccountAccessQueryKey, St as getBankAccountApplicationOptions, Ct as getBankAccountOptions, wt as getBankAccountQueryKey, S as getBankAccountStatement, Tt as getBankAccountStatementsOptions, Et as getBankAccountTransactionsOptions, Dt as getBankAccountTransactionsQueryKey, Ot as getBankAccountsQueryKey, kt as getBankDetailsIdOptions, At as getBankDetailsOptions, jt as getBankDetailsQueryKey, C as getCounterparts, Mt as getCounterpartsIdAddressesOptions, Nt as getCounterpartsIdAddressesQueryKey, Pt as getCounterpartsIdBankAccountsOptions, Ft as getCounterpartsIdBankAccountsQueryKey, It as getCounterpartsIdOptions, Lt as getCounterpartsIdQueryKey, Rt as getCounterpartsOptions, zt as getCounterpartsQueryKey, Bt as getCreditCardByIdOptions, Vt as getCreditCardByIdQueryKey, Ht as getCreditCardsOptions, Ut as getCreditCardsQueryKey, Wt as getDebitCardByIdOptions, Gt as getDebitCardByIdQueryKey, Kt as getDebitCardCredentialsOptions, qt as getDebitCardsOptions, Jt as getDebitCardsQueryKey, w as getDepartment, Yt as getDepartmentOptions, Xt as getDepartmentQueryKey, T as getDepositableBankAccounts, Zt as getDepositableBankAccountsOptions, Qt as getDocumentsIdNextNumbersOptions, $t as getDocumentsIdNextNumbersQueryKey, en as getEntitiesIdPaymentMethodsOptions, tn as getEntitiesIdSettingsOptions, nn as getEntitiesIdSettingsQueryKey, rn as getEntityUsersOptions, E as getExternalBankAccountAccess, an as getExternalBankAccountAccessQueryKey, on as getExternalBankAccountOptions, sn as getExternalBankAccountsOptions, cn as getExternalBankAccountsQueryKey, ln as getFilesQueryKey, un as getLedgerAccountsQueryKey, D as getLocation, dn as getLocationOptions, fn as getLocationQueryKey, pn as getMeOptions, mn as getMeasureUnitsOptions, hn as getMeasureUnitsQueryKey, gn as getOrganizationOptions, _n as getOrganizationTransfersOptions, vn as getOrganizationTransfersQueryKey, yn as getOverdueRemindersOptions, bn as getOverdueRemindersQueryKey, O as getPayables, k as getPayablesId, A as getPayablesIdHistory, xn as getPayablesIdHistoryOptions, Sn as getPayablesIdHistoryQueryKey, j as getPayablesIdLineItems, Cn as getPayablesIdLineItemsOptions, wn as getPayablesIdLineItemsQueryKey, Tn as getPayablesIdOptions, En as getPayablesIdQueryKey, Dn as getPayablesIdSuggestionsOptions, On as getPayablesOptions, kn as getPayablesQueryKey, M as getPaymentRecords, An as getPaymentRecordsOptions, jn as getPaymentRecordsQueryKey, Mn as getPaymentRemindersOptions, Nn as getPaymentRemindersQueryKey, N as getProducts, Pn as getProductsIdOptions, Fn as getProductsIdQueryKey, In as getProductsOptions, Ln as getProductsQueryKey, P as getReceipts, Rn as getReceiptsIdQueryKey, zn as getReceiptsOptions, Bn as getReceiptsQueryKey, F as getReceivables, I as getReceivablesIdHistory, Vn as getReceivablesIdHistoryQueryKey, Hn as getReceivablesIdMailsQueryKey, Un as getReceivablesIdOptions, Wn as getReceivablesIdPdfLinkOptions, Gn as getReceivablesIdPdfLinkQueryKey, Kn as getReceivablesIdQueryKey, qn as getReceivablesOptions, Jn as getReceivablesQueryKey, Yn as getReceivablesRequiredFieldsOptions, Xn as getRecurrencesIdOptions, Zn as getRecurrencesIdQueryKey, Qn as getRecurrencesQueryKey, $n as getTransactionsIdExpenseHistoryOptions, er as getTransactionsIdExpenseHistoryQueryKey, tr as getTransactionsIdOptions, nr as getTransactionsIdQueryKey, rr as getTransactionsOptions, ir as getTransactionsQueryKey, ar as getTransactionsValidationsOptions, or as getTransactionsValidationsQueryKey, L as getUsers, sr as getUsersOptions, cr as getUsersQueryKey, lr as getVelocityControlsQueryKey, ur as grantBankAccountAccessMutation, dr as grantExternalBankAccountAccessMutation, ii as hasAnyScope, Wr as invalidateAllClients, yi as isAllPagesResolving, li as isApiConflictError, ui as isApiForbiddenError, di as isApiNotFoundError, fi as isApiUnprocessableError, Lr as isOrganizationOnItsWay, gi as isScope, fr as linkExternalBankAccountMutation, R as listDepartments, pr as listDepartmentsOptions, mr as listDepartmentsQueryKey, z as listLocations, hr as listLocationsOptions, gr as listLocationsQueryKey, B as listRoles, _r as listRolesQueryKey, V as manageBankAccountAccess, H as manageDebitCardAccess, vr as manageDebitCardAccessMutation, ai as myEntityInvalidationKey, ti as optionalOrganizationHeaders, ni as organizationHeaders, yr as patchApprovalPoliciesIdMutation, U as patchCounterpartsId, W as patchCounterpartsIdAddressesId, G as patchCounterpartsIdBankAccountsId, K as patchEntitiesIdSettings, br as patchLedgerAccountsIdMutation, q as patchMeasureUnitsId, J as patchPayablesId, Y as patchProductsId, xr as patchReceiptsIdMutation, X as patchReceivablesId, Z as patchRecurrencesId, Q as patchTransactionsId, Mi as personDisclosure, Sr as postApprovalPoliciesMutation, $ as postApprovalRequestsIdApprove, ee as postApprovalRequestsIdReject, te as postBankDetails, ne as postCounterparts, re as postCounterpartsIdAddresses, ie as postCounterpartsIdBankAccounts, ae as postFiles, Cr as postLedgerAccountsMutation, oe as postMeasureUnits, se as postOverdueReminders, ce as postPayables, le as postPayablesIdApprovePaymentOperation, ue as postPayablesIdAttachFile, de as postPayablesIdCancel, fe as postPayablesIdDuplicatesIdConfirm, pe as postPayablesIdDuplicatesIdDismiss, me as postPayablesIdMarkAsPaid, he as postPayablesIdReject, ge as postPayablesIdReopen, _e as postPayablesIdSchedulePayment, ve as postPayablesIdSubmitForApproval, ye as postPayablesIdValidate, be as postPayablesUploadFromFile, xe as postPaymentIntentsIdCancel, Se as postPaymentLinks, Ce as postPaymentRecords, we as postPaymentReminders, Te as postProducts, wr as postReceiptsUploadFromFileMutation, Ee as postReceivables, De as postReceivablesIdAccept, Oe as postReceivablesIdCancel, ke as postReceivablesIdClone, Ae as postReceivablesIdDecline, je as postReceivablesIdIssue, Me as postReceivablesIdMarkAsPaid, Ne as postReceivablesIdMarkAsUncollectible, Pe as postReceivablesIdSend, Fe as postRecurrences, Ie as postRecurrencesIdCancel, Le as postRecurrencesIdPause, Re as postRecurrencesIdResume, ze as postTransactionsIdApprove, Be as postTransactionsIdReject, Ve as postTransactionsIdReopen, He as postTransactionsIdSubmit, Ue as putEntitiesIdLogo, We as putPayablesIdLineItems, Tr as putTransactionsValidationsMutation, Gr as registerQueryClient, Kr as removeInactiveFromAllClients, qr as resetAllClients, Jr as setAllClientsQueriesData, Er as setDebitCardLockStatusMutation, Dr as submitApplicationMutation, Or as unlinkExternalBankAccountMutation, Yr as unregisterQueryClient, kr as updateApplicationMutation, Ar as updateBankAccountMutation, jr as updateDebitCardMutation, Ge as updateDepartment, Mr as updateExternalBankAccountMutation, Ke as updateLocation, qe as updateUser, Ni as useAcceptWidgetDisclosures, xi as useAllBankAccountsQuery, Si as useAllDebitCardsQuery, Ci as useAllExternalBankAccountsQuery, Ti as useAllLedgerAccountsQuery, wi as useAllMerchantCategoryGroupsQuery, ki as useAllOrganizationRolesQuery, ji as useAllOrganizationUsersQuery, bi as useAutoFetchNextPage, oi as useCurrentUserQuery, Pi as useDisclosuresQuery, ei as useEmbedApi, pi as useGetUserDataQuery, Ei as useLedgerAccountsQuery, ci as useMailboxAddress, si as useMyEntityQuery, Li as useOrganizationApplicationStatus, Ii as useOrganizationOnboardingSuppression, Oi as useOrganizationQuery, Di as usePaymentTermsQuery, Ai as useRolePermissionsQueries, mi as useUpsertUserDataMutation, Nr as validateExternalBankAccountMutation, Pr as verifyDebitCardMutation, Fr as widgetTokenCacheId, Rr as withAuthEpoch, zr as withAuthEpochInfinite };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { getOrganizationOptions as e } from "../rest/@tanstack/react-query.gen.js";
|
|
6
|
+
import { withAuthEpoch as t } from "../withAuthEpoch.js";
|
|
7
|
+
import { useEmbedApi as n } from "../EmbedApiContext.js";
|
|
8
|
+
import { useQuery as r } from "@tanstack/react-query";
|
|
9
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/organization/useOrganizationQuery.js
|
|
10
|
+
function i({ enabled: i } = {}) {
|
|
11
|
+
let { client: a, organizationId: o, widgetToken: s, authEpoch: c, organizationStatus: l } = n(), u = e({
|
|
12
|
+
client: a,
|
|
13
|
+
path: { organizationId: o ?? "" }
|
|
14
|
+
});
|
|
15
|
+
return r({
|
|
16
|
+
...t(u, {
|
|
17
|
+
authEpoch: c,
|
|
18
|
+
organizationStatus: l
|
|
19
|
+
}),
|
|
20
|
+
enabled: !!(o && s) && (i === !0 || i === void 0)
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { i as useOrganizationQuery };
|
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.7.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.7.45", n = "65b4bd182e857936feb530d4ce54f0be7426b6b2", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { getOrganizationOptions as e } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
6
|
-
import { withAuthEpoch as t } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
7
|
-
import { useEmbedApi as n } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
-
import "../../../../shared/data-access/dist/index.js";
|
|
9
|
-
import { useQuery as r } from "@tanstack/react-query";
|
|
10
|
-
//#region ../../libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index7.js
|
|
11
|
-
function i({ enabled: i } = {}) {
|
|
12
|
-
let { client: a, organizationId: o, widgetToken: s, authEpoch: c, organizationStatus: l } = n(), u = e({
|
|
13
|
-
client: a,
|
|
14
|
-
path: { organizationId: o ?? "" }
|
|
15
|
-
});
|
|
16
|
-
return r({
|
|
17
|
-
...t(u, {
|
|
18
|
-
authEpoch: c,
|
|
19
|
-
organizationStatus: l
|
|
20
|
-
}),
|
|
21
|
-
enabled: !!(o && s) && (i === !0 || i === void 0)
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
export { i as useCreateCardOrganizationQuery };
|