@tesouro/embedded-components-react 0.7.37 → 0.7.40
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/fixtures/index.d.ts +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/lib/TransfersWidget.d.ts +5 -0
- package/dist/lib/WidgetSuite.d.ts +5 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/fieldInput/formatPhoneNumberInput.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/mocks/bankAccounts.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +50 -50
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +22 -22
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index3.js +6 -7
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index6.js +14 -34
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index7.js +16 -13
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index8.js +4 -10
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js +99 -75
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/featureLabels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransfersPageState.js +49 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/mocks/labels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/mocks/transfers.js +103 -85
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransfersWidget.js +73 -61
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/labels.js +3 -0
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js
CHANGED
|
@@ -162,7 +162,19 @@ var n = (e) => (e.client ?? t).post({
|
|
|
162
162
|
}],
|
|
163
163
|
url: "/embedded-banking/v1/bank-accounts/depositable",
|
|
164
164
|
...e
|
|
165
|
-
}), g = (e) => (e
|
|
165
|
+
}), g = (e) => (e?.client ?? t).get({
|
|
166
|
+
security: [{
|
|
167
|
+
key: "APPToken",
|
|
168
|
+
scheme: "bearer",
|
|
169
|
+
type: "http"
|
|
170
|
+
}, {
|
|
171
|
+
key: "USERToken",
|
|
172
|
+
scheme: "bearer",
|
|
173
|
+
type: "http"
|
|
174
|
+
}],
|
|
175
|
+
url: "/embedded-banking/v1/bank-accounts/transfers",
|
|
176
|
+
...e
|
|
177
|
+
}), _ = (e) => (e.client ?? t).get({
|
|
166
178
|
security: [{
|
|
167
179
|
key: "APPToken",
|
|
168
180
|
scheme: "bearer",
|
|
@@ -174,7 +186,7 @@ var n = (e) => (e.client ?? t).post({
|
|
|
174
186
|
}],
|
|
175
187
|
url: "/embedded-banking/v1/bank-accounts/{id}",
|
|
176
188
|
...e
|
|
177
|
-
}),
|
|
189
|
+
}), v = (e) => (e.client ?? t).patch({
|
|
178
190
|
security: [{
|
|
179
191
|
key: "APPToken",
|
|
180
192
|
scheme: "bearer",
|
|
@@ -190,7 +202,7 @@ var n = (e) => (e.client ?? t).post({
|
|
|
190
202
|
"Content-Type": "application/json",
|
|
191
203
|
...e.headers
|
|
192
204
|
}
|
|
193
|
-
}),
|
|
205
|
+
}), y = (e) => (e.client ?? t).get({
|
|
194
206
|
security: [{
|
|
195
207
|
key: "APPToken",
|
|
196
208
|
scheme: "bearer",
|
|
@@ -202,7 +214,7 @@ var n = (e) => (e.client ?? t).post({
|
|
|
202
214
|
}],
|
|
203
215
|
url: "/embedded-banking/v1/bank-accounts/{id}/access",
|
|
204
216
|
...e
|
|
205
|
-
}),
|
|
217
|
+
}), b = (e) => (e.client ?? t).post({
|
|
206
218
|
security: [{
|
|
207
219
|
key: "APPToken",
|
|
208
220
|
scheme: "bearer",
|
|
@@ -218,7 +230,7 @@ var n = (e) => (e.client ?? t).post({
|
|
|
218
230
|
"Content-Type": "application/json",
|
|
219
231
|
...e.headers
|
|
220
232
|
}
|
|
221
|
-
}),
|
|
233
|
+
}), x = (e) => (e.client ?? t).post({
|
|
222
234
|
security: [{
|
|
223
235
|
key: "USERToken",
|
|
224
236
|
scheme: "bearer",
|
|
@@ -230,18 +242,6 @@ var n = (e) => (e.client ?? t).post({
|
|
|
230
242
|
"Content-Type": "application/json",
|
|
231
243
|
...e.headers
|
|
232
244
|
}
|
|
233
|
-
}), x = (e) => (e.client ?? t).get({
|
|
234
|
-
security: [{
|
|
235
|
-
key: "APPToken",
|
|
236
|
-
scheme: "bearer",
|
|
237
|
-
type: "http"
|
|
238
|
-
}, {
|
|
239
|
-
key: "USERToken",
|
|
240
|
-
scheme: "bearer",
|
|
241
|
-
type: "http"
|
|
242
|
-
}],
|
|
243
|
-
url: "/embedded-banking/v1/bank-accounts/{id}/statements",
|
|
244
|
-
...e
|
|
245
245
|
}), S = (e) => (e.client ?? t).get({
|
|
246
246
|
security: [{
|
|
247
247
|
key: "APPToken",
|
|
@@ -252,7 +252,7 @@ var n = (e) => (e.client ?? t).post({
|
|
|
252
252
|
scheme: "bearer",
|
|
253
253
|
type: "http"
|
|
254
254
|
}],
|
|
255
|
-
url: "/embedded-banking/v1/bank-accounts/{id}/statements
|
|
255
|
+
url: "/embedded-banking/v1/bank-accounts/{id}/statements",
|
|
256
256
|
...e
|
|
257
257
|
}), C = (e) => (e.client ?? t).get({
|
|
258
258
|
security: [{
|
|
@@ -264,7 +264,7 @@ var n = (e) => (e.client ?? t).post({
|
|
|
264
264
|
scheme: "bearer",
|
|
265
265
|
type: "http"
|
|
266
266
|
}],
|
|
267
|
-
url: "/embedded-banking/v1/bank-accounts/{id}/
|
|
267
|
+
url: "/embedded-banking/v1/bank-accounts/{id}/statements/{statementId}",
|
|
268
268
|
...e
|
|
269
269
|
}), w = (e) => (e.client ?? t).get({
|
|
270
270
|
security: [{
|
|
@@ -276,7 +276,7 @@ var n = (e) => (e.client ?? t).post({
|
|
|
276
276
|
scheme: "bearer",
|
|
277
277
|
type: "http"
|
|
278
278
|
}],
|
|
279
|
-
url: "/embedded-banking/v1/bank-accounts/{id}/transactions
|
|
279
|
+
url: "/embedded-banking/v1/bank-accounts/{id}/transactions",
|
|
280
280
|
...e
|
|
281
281
|
}), T = (e) => (e.client ?? t).get({
|
|
282
282
|
security: [{
|
|
@@ -288,7 +288,7 @@ var n = (e) => (e.client ?? t).post({
|
|
|
288
288
|
scheme: "bearer",
|
|
289
289
|
type: "http"
|
|
290
290
|
}],
|
|
291
|
-
url: "/embedded-banking/v1/bank-accounts/{id}/
|
|
291
|
+
url: "/embedded-banking/v1/bank-accounts/{id}/transactions/download",
|
|
292
292
|
...e
|
|
293
293
|
}), E = (e) => (e?.client ?? t).get({
|
|
294
294
|
security: [{
|
|
@@ -2049,4 +2049,4 @@ var n = (e) => (e.client ?? t).post({
|
|
|
2049
2049
|
...e
|
|
2050
2050
|
});
|
|
2051
2051
|
//#endregion
|
|
2052
|
-
export { O as activateCreditCard, P as activateDebitCard, dn as bulkUpdateDepartmentMembers, vn as bulkUpdateLocationMembers, xn as bulkUpdateRoleMembers, z as connectExternalBankAccount, q as createAchMoneyMovement, s as createApplication, p as createBankAccount, J as createBookTransfer,
|
|
2052
|
+
export { O as activateCreditCard, P as activateDebitCard, dn as bulkUpdateDepartmentMembers, vn as bulkUpdateLocationMembers, xn as bulkUpdateRoleMembers, z as connectExternalBankAccount, q as createAchMoneyMovement, s as createApplication, p as createBankAccount, J as createBookTransfer, x as createCheckDeposit, A as createDebitCard, sn as createDepartment, mn as createLocation, En as createUser, o as createVelocityControl, cn as deactivateDepartment, hn as deactivateLocation, te as deleteApprovalPoliciesId, c as deleteBankAccountApplication, de as deleteCounterpartsId, ye as deleteCounterpartsIdBankAccountsId, Se as deleteEntitiesIdLogo, je as deleteFilesId, Pe as deleteLedgerAccountsId, ze as deleteMeasureUnitsId, Ke as deletePayablesId, et as deletePayablesIdFile, bt as deleteProductsId, Tt as deleteReceiptsId, At as deleteReceivablesId, kn as disableUser, T as downloadBankAccountTransactions, Y as getAnalyticsPayables, X as getAnalyticsReceipts, Z as getAnalyticsReceivables, Q as getAnalyticsTransactions, r as getApiWidgetGatewayInit, i as getApplicationStatus, $ as getApprovalPolicies, re as getApprovalRequests, _ as getBankAccount, y as getBankAccountAccess, l as getBankAccountApplication, C as getBankAccountStatement, S as getBankAccountStatements, w as getBankAccountTransactions, f as getBankAccounts, oe as getBankDetails, ce as getBankDetailsId, le as getCounterparts, fe as getCounterpartsId, me as getCounterpartsIdAddresses, _e as getCounterpartsIdBankAccounts, D as getCreditCardById, E as getCreditCards, M as getDebitCardById, F as getDebitCardCredentials, k as getDebitCards, ln as getDepartment, h as getDepositableBankAccounts, fn as getDisclosures, xe as getDocumentsIdNextNumbers, we as getEntitiesIdPaymentMethods, Te as getEntitiesIdSettings, De as getEntityUsers, Oe as getEntityUsersMe, ke as getEntityUsersMyEntity, V as getExternalBankAccount, U as getExternalBankAccountAccess, R as getExternalBankAccounts, Me as getLedgerAccounts, gn as getLocation, Ie as getMailboxes, Dn as getMe, Le as getMeasureUnits, a as getMerchantCategoryGroups, yn as getOrganization, g as getOrganizationTransfers, Ve as getOverdueReminders, Ue as getPayables, qe as getPayablesId, tt as getPayablesIdHistory, nt as getPayablesIdLineItems, lt as getPayablesIdSuggestions, pt as getPaymentRecords, ht as getPaymentReminders, _t as getPaymentTerms, vt as getProducts, xt as getProductsId, Ct as getReceipts, Dt as getReceivables, jt as getReceivablesId, Lt as getReceivablesIdHistory, Vt as getReceivablesIdPdfLink, kt as getReceivablesRequiredFields, Wt as getRecurrencesId, Yt as getTransactions, Qt as getTransactionsId, tn as getTransactionsIdExpenseHistory, Xt as getTransactionsValidations, Cn as getUserData, Tn as getUsers, b as grantBankAccountAccess, W as grantExternalBankAccountAccess, G as linkExternalBankAccount, on as listDepartments, pn as listLocations, Sn as listRolePermissions, bn as listRoles, m as manageBankAccountAccess, j as manageDebitCardAccess, ne as patchApprovalPoliciesId, pe as patchCounterpartsId, ge as patchCounterpartsIdAddressesId, be as patchCounterpartsIdBankAccountsId, Ee as patchEntitiesIdSettings, Fe as patchLedgerAccountsId, Be as patchMeasureUnitsId, Je as patchPayablesId, St as patchProductsId, Et as patchReceiptsId, Mt as patchReceivablesId, Gt as patchRecurrencesId, $t as patchTransactionsId, n as postApiWidgetGatewayDisclosureAcceptance, ee as postApprovalPolicies, ie as postApprovalRequestsIdApprove, ae as postApprovalRequestsIdReject, se as postBankDetails, ue as postCounterparts, he as postCounterpartsIdAddresses, ve as postCounterpartsIdBankAccounts, Ae as postFiles, Ne as postLedgerAccounts, Re as postMeasureUnits, He as postOverdueReminders, We as postPayables, Ye as postPayablesIdApprovePaymentOperation, Xe as postPayablesIdAttachFile, Ze as postPayablesIdCancel, Qe as postPayablesIdDuplicatesIdConfirm, $e as postPayablesIdDuplicatesIdDismiss, it as postPayablesIdMarkAsPaid, at as postPayablesIdReject, ot as postPayablesIdReopen, st as postPayablesIdSchedulePayment, ct as postPayablesIdSubmitForApproval, ut as postPayablesIdValidate, Ge as postPayablesUploadFromFile, dt as postPaymentIntentsIdCancel, ft as postPaymentLinks, mt as postPaymentRecords, gt as postPaymentReminders, yt as postProducts, wt as postReceiptsUploadFromFile, Ot as postReceivables, Nt as postReceivablesIdAccept, Pt as postReceivablesIdCancel, Ft as postReceivablesIdClone, It as postReceivablesIdDecline, Rt as postReceivablesIdIssue, zt as postReceivablesIdMarkAsPaid, Bt as postReceivablesIdMarkAsUncollectible, Ht as postReceivablesIdSend, Ut as postRecurrences, Kt as postRecurrencesIdCancel, qt as postRecurrencesIdPause, Jt as postRecurrencesIdResume, en as postTransactionsIdApprove, nn as postTransactionsIdReject, rn as postTransactionsIdReopen, an as postTransactionsIdSubmit, Ce as putEntitiesIdLogo, rt as putPayablesIdLineItems, Zt as putTransactionsValidations, I as setDebitCardLockStatus, d as submitApplication, B as unlinkExternalBankAccount, u as updateApplication, v as updateBankAccount, N as updateDebitCard, un as updateDepartment, H as updateExternalBankAccount, _n as updateLocation, On as updateUser, wn as upsertUserData, K as validateExternalBankAccount, L as verifyDebitCard };
|
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.40", n = "8a65463a80cdc97b53623e602554f1982c442263", 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/transfers-widget/data-access/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { isPaginatedAccountsQueryInFlight as e } from "./index2.js";
|
|
|
2
2
|
import "./index3.js";
|
|
3
3
|
import { useTransferBankAccountsQuery as t } from "./index4.js";
|
|
4
4
|
import { useTransferExternalAccountsQuery as n } from "./index5.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useOrganizationTransfersQuery as r } from "./index6.js";
|
|
6
6
|
import { useCreateBookTransferMutation as i } from "./index7.js";
|
|
7
7
|
import { useCreateAchMoneyMovementMutation as a } from "./index8.js";
|
|
8
|
-
export { e as isPaginatedAccountsQueryInFlight, a as useCreateAchMoneyMovementMutation, i as useCreateBookTransferMutation, r as
|
|
8
|
+
export { e as isPaginatedAccountsQueryInFlight, a as useCreateAchMoneyMovementMutation, i as useCreateBookTransferMutation, r as useOrganizationTransfersQuery, t as useTransferBankAccountsQuery, n as useTransferExternalAccountsQuery };
|
package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index3.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { getBankAccountQueryKey as e,
|
|
1
|
+
import { getBankAccountQueryKey as e, getBankAccountsQueryKey as t, getOrganizationTransfersQueryKey as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
2
2
|
import { organizationHeaders as r } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
3
3
|
import "../../../shared/data-access/dist/index.js";
|
|
4
4
|
//#region ../../libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index3.js
|
|
5
|
-
var i = ({ client: e, organizationId:
|
|
5
|
+
var i = ({ client: e, organizationId: n }) => t({
|
|
6
6
|
client: e,
|
|
7
|
-
headers: r(
|
|
8
|
-
}), a = ({ client: e, organizationId:
|
|
7
|
+
headers: r(n)
|
|
8
|
+
}), a = ({ client: e, organizationId: t }) => n({
|
|
9
9
|
client: e,
|
|
10
|
-
headers: r(
|
|
11
|
-
path: { id: i }
|
|
10
|
+
headers: r(t)
|
|
12
11
|
}), o = ({ client: t, organizationId: n, bankAccountId: i }) => e({
|
|
13
12
|
client: t,
|
|
14
13
|
headers: r(n),
|
|
15
14
|
path: { id: i }
|
|
16
15
|
});
|
|
17
16
|
//#endregion
|
|
18
|
-
export { o as bankAccountInvalidationKeyForAccount,
|
|
17
|
+
export { o as bankAccountInvalidationKeyForAccount, i as bankAccountsInvalidationKey, a as organizationTransfersInvalidationKey };
|
package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index6.js
CHANGED
|
@@ -2,46 +2,26 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { getOrganizationTransfersOptions as e } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
6
6
|
import { withAuthEpoch as t } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
7
7
|
import { useEmbedApi as n } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
8
|
import { organizationHeaders as r } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
9
9
|
import "../../../shared/data-access/dist/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import { useTransferBankAccountsQuery as a } from "./index4.js";
|
|
12
|
-
import { useMemo as o } from "react";
|
|
13
|
-
import { useQueries as s } from "@tanstack/react-query";
|
|
10
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
14
11
|
//#region ../../libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index6.js
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
function a({ enabled: a, ...o } = {}) {
|
|
13
|
+
let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationStatus: d } = n(), f = !!(c && l) && (a === !0 || a === void 0);
|
|
14
|
+
return i({
|
|
18
15
|
...t(e({
|
|
19
|
-
client:
|
|
20
|
-
headers:
|
|
21
|
-
|
|
22
|
-
query: { limit: u }
|
|
16
|
+
client: s,
|
|
17
|
+
headers: r(c),
|
|
18
|
+
query: o
|
|
23
19
|
}), {
|
|
24
|
-
authEpoch:
|
|
25
|
-
organizationStatus:
|
|
26
|
-
}),
|
|
27
|
-
enabled:
|
|
28
|
-
})
|
|
29
|
-
return {
|
|
30
|
-
mergedTransfers: o(() => {
|
|
31
|
-
let e = /* @__PURE__ */ new Map();
|
|
32
|
-
for (let t of b) for (let n of t.data?.data ?? []) e.set(n.id, n);
|
|
33
|
-
return [...e.values()].sort((e, t) => t.date.localeCompare(e.date));
|
|
34
|
-
}, [b]),
|
|
35
|
-
accountIds: y,
|
|
36
|
-
isLoading: i(v) || b.some((e) => e.isLoading && e.fetchStatus !== "idle"),
|
|
37
|
-
isError: v.isError || b.some((e) => e.isError),
|
|
38
|
-
refetch: () => {
|
|
39
|
-
v.refetch();
|
|
40
|
-
for (let e of b) e.refetch();
|
|
41
|
-
},
|
|
42
|
-
accountsQuery: v,
|
|
43
|
-
transferQueries: b
|
|
44
|
-
};
|
|
20
|
+
authEpoch: u,
|
|
21
|
+
organizationStatus: d
|
|
22
|
+
}, { carryWithinOrg: !0 }),
|
|
23
|
+
enabled: f
|
|
24
|
+
});
|
|
45
25
|
}
|
|
46
26
|
//#endregion
|
|
47
|
-
export {
|
|
27
|
+
export { a as useOrganizationTransfersQuery };
|
package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index7.js
CHANGED
|
@@ -7,7 +7,7 @@ import { invalidateAllClients as t } from "../../../shared/data-access/dist/lib/
|
|
|
7
7
|
import { useEmbedApi as n } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
8
|
import { organizationHeaders as r } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
9
9
|
import "../../../shared/data-access/dist/index.js";
|
|
10
|
-
import { bankAccountInvalidationKeyForAccount as i,
|
|
10
|
+
import { bankAccountInvalidationKeyForAccount as i, bankAccountsInvalidationKey as a, organizationTransfersInvalidationKey as o } from "./index3.js";
|
|
11
11
|
import { useMutation as s } from "@tanstack/react-query";
|
|
12
12
|
//#region ../../libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index7.js
|
|
13
13
|
function c() {
|
|
@@ -19,18 +19,21 @@ function c() {
|
|
|
19
19
|
}),
|
|
20
20
|
onSuccess: async (e, n) => {
|
|
21
21
|
let r = n.body.fromBankAccountId, s = n.body.toBankAccountId, u = [.../* @__PURE__ */ new Set([r, s])];
|
|
22
|
-
await Promise.all([
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
await Promise.all([
|
|
23
|
+
t(a({
|
|
24
|
+
client: c,
|
|
25
|
+
organizationId: l
|
|
26
|
+
})),
|
|
27
|
+
t(o({
|
|
28
|
+
client: c,
|
|
29
|
+
organizationId: l
|
|
30
|
+
})),
|
|
31
|
+
...u.map((e) => t(i({
|
|
32
|
+
client: c,
|
|
33
|
+
organizationId: l,
|
|
34
|
+
bankAccountId: e
|
|
35
|
+
})))
|
|
36
|
+
]);
|
|
34
37
|
}
|
|
35
38
|
});
|
|
36
39
|
}
|
package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index8.js
CHANGED
|
@@ -7,7 +7,7 @@ import { invalidateAllClients as t } from "../../../shared/data-access/dist/lib/
|
|
|
7
7
|
import { useEmbedApi as n } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
8
|
import { organizationHeaders as r } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
9
9
|
import "../../../shared/data-access/dist/index.js";
|
|
10
|
-
import { bankAccountInvalidationKeyForAccount as i,
|
|
10
|
+
import { bankAccountInvalidationKeyForAccount as i, bankAccountsInvalidationKey as a, organizationTransfersInvalidationKey as o } from "./index3.js";
|
|
11
11
|
import { useMutation as s } from "@tanstack/react-query";
|
|
12
12
|
//#region ../../libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index8.js
|
|
13
13
|
function c() {
|
|
@@ -20,19 +20,13 @@ function c() {
|
|
|
20
20
|
onSuccess: async (e, n) => {
|
|
21
21
|
let r = n.body.fromBankAccountId, s = n.body.toBankAccountId, u = n.body.type === "EXTERNAL_TO_INTERNAL" ? s : r;
|
|
22
22
|
await Promise.all([
|
|
23
|
-
t(o({
|
|
24
|
-
client: c,
|
|
25
|
-
organizationId: l
|
|
26
|
-
})),
|
|
27
23
|
t(a({
|
|
28
24
|
client: c,
|
|
29
|
-
organizationId: l
|
|
30
|
-
bankAccountId: r
|
|
25
|
+
organizationId: l
|
|
31
26
|
})),
|
|
32
|
-
t(
|
|
27
|
+
t(o({
|
|
33
28
|
client: c,
|
|
34
|
-
organizationId: l
|
|
35
|
-
bankAccountId: s
|
|
29
|
+
organizationId: l
|
|
36
30
|
})),
|
|
37
31
|
t(i({
|
|
38
32
|
client: c,
|
|
@@ -14,114 +14,138 @@ import { DEFAULT_FEATURE_LABELS as o } from "./featureLabels.js";
|
|
|
14
14
|
import { TRANSFERS_ANALYTICS_EVENTS as s } from "../analytics/events.js";
|
|
15
15
|
import { isPaginatedAccountsQueryInFlight as c } from "../../../../data-access/dist/index2.js";
|
|
16
16
|
import { useTransferBankAccountsQuery as l } from "../../../../data-access/dist/index4.js";
|
|
17
|
-
import { useTransferExternalAccountsQuery as
|
|
18
|
-
import {
|
|
17
|
+
import { useTransferExternalAccountsQuery as u } from "../../../../data-access/dist/index5.js";
|
|
18
|
+
import { useOrganizationTransfersQuery as te } from "../../../../data-access/dist/index6.js";
|
|
19
19
|
import "../../../../data-access/dist/index.js";
|
|
20
|
-
import { mapTransferToRowView as
|
|
21
|
-
import { transfersWidgetTestIds as
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
20
|
+
import { mapTransferToRowView as ne, useTransferMoneyModalController as re } from "./useTransferMoneyModalController.js";
|
|
21
|
+
import { transfersWidgetTestIds as d } from "./testIds.js";
|
|
22
|
+
import { TRANSFERS_PAGE_SIZE_OPTIONS as ie, useTransfersPageState as ae } from "./useTransfersPageState.js";
|
|
23
|
+
import { TRANSFERS_WIDGET_LABELS_EN as oe } from "../../../../ui/dist/lib/TransfersWidget/labels.js";
|
|
24
|
+
import { TransfersWidget as se } from "../../../../ui/dist/lib/TransfersWidget/TransfersWidget.js";
|
|
24
25
|
import "../../../../ui/dist/index.js";
|
|
25
|
-
import { useCallback as
|
|
26
|
-
import { jsx as
|
|
26
|
+
import { useCallback as ce, useEffect as f, useMemo as p, useState as m } from "react";
|
|
27
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
27
28
|
//#region ../../libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js
|
|
28
|
-
var
|
|
29
|
-
function
|
|
29
|
+
var g = [i.TransferWriteOrg, i.BankAccountReadOrg], _ = [t, e];
|
|
30
|
+
function v(e) {
|
|
30
31
|
return e.slice(-4);
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
let
|
|
33
|
+
function y({ labels: e, featureLabels: t, isTransferMoneyOpen: y, defaultIsTransferMoneyOpen: le, onTransferMoneyOpenChange: ue }) {
|
|
34
|
+
let b = {
|
|
34
35
|
...o,
|
|
35
36
|
...t
|
|
36
|
-
},
|
|
37
|
-
...
|
|
37
|
+
}, x = {
|
|
38
|
+
...oe,
|
|
38
39
|
...e,
|
|
39
40
|
...t?.routeSeparator === void 0 ? {} : { listAccountsSeparator: t.routeSeparator }
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
let
|
|
41
|
+
}, S = a(), { initResponse: C } = ee(), { organizationId: de, organizationStatus: fe } = r(), pe = n(fe);
|
|
42
|
+
f(() => {
|
|
43
|
+
S(s.Mounted);
|
|
44
|
+
}, [S]);
|
|
45
|
+
let w = C?.scopes ?? [], T = w.includes(i.ExternalBankAccountReadOrg), me = w.includes(i.PaymentRailAch), E = T && me, D = g.every((e) => w.includes(e)), O = ae({
|
|
46
|
+
organizationId: de,
|
|
47
|
+
userId: C?.userId
|
|
48
|
+
}), { data: k, isLoading: A, isError: j, isPlaceholderData: M, refetch: N } = te({
|
|
49
|
+
limit: O.pageSize,
|
|
50
|
+
pagination_token: O.paginationToken
|
|
51
|
+
}), P = l(), { data: F, isError: I, refetch: L } = P, R = u({ enabled: T }), { data: z, isError: he, refetch: B } = R, V = F?.data ?? [], H = p(() => E ? (z?.data ?? []).filter((e) => e.verificationStatus === "VERIFIED" && e.accountStatus === "ACTIVE") : [], [E, z?.data]), U = p(() => {
|
|
45
52
|
let e = /* @__PURE__ */ new Map();
|
|
46
|
-
for (let t of
|
|
47
|
-
let n =
|
|
53
|
+
for (let t of V) {
|
|
54
|
+
let n = v(t.accountNumber), r = t.nickname?.trim() || x.accountFallbackName;
|
|
48
55
|
e.set(t.id, `${r} ···${n}`);
|
|
49
56
|
}
|
|
50
|
-
for (let t of
|
|
51
|
-
let n =
|
|
57
|
+
for (let t of H) {
|
|
58
|
+
let n = v(t.accountNumber), r = t.nickname?.trim() || t.nameOnAccount;
|
|
52
59
|
e.set(t.id, `${r} ···${n}`);
|
|
53
60
|
}
|
|
54
61
|
return e;
|
|
55
62
|
}, [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
]),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
]),
|
|
65
|
-
|
|
63
|
+
V,
|
|
64
|
+
x.accountFallbackName,
|
|
65
|
+
H
|
|
66
|
+
]), W = k?.data, G = p(() => (W ?? []).map((e) => ne(e, U, x, b)), [
|
|
67
|
+
U,
|
|
68
|
+
b,
|
|
69
|
+
x,
|
|
70
|
+
W
|
|
71
|
+
]), K = k?.nextPaginationToken ?? void 0, q = k?.prevPaginationToken ?? void 0, [J, ge] = m(O);
|
|
72
|
+
!M && (J.pageIndex !== O.pageIndex || J.pageSize !== O.pageSize) && ge(O);
|
|
73
|
+
let Y = J.pageIndex * J.pageSize, _e = {
|
|
74
|
+
pageSize: O.pageSize,
|
|
75
|
+
pageSizeOptions: ie,
|
|
76
|
+
rangeLabel: `${b.viewingRangeLabel} ${G.length === 0 ? "0-0" : `${Y + 1}-${Y + G.length}`}`,
|
|
77
|
+
isPreviousDisabled: !q,
|
|
78
|
+
isNextDisabled: !K,
|
|
79
|
+
isDisabled: M,
|
|
80
|
+
onPageSizeChange: O.changePageSize,
|
|
81
|
+
onPreviousPageClick: () => {
|
|
82
|
+
q && O.goToPreviousPage(q);
|
|
83
|
+
},
|
|
84
|
+
onNextPageClick: () => {
|
|
85
|
+
K && O.goToNextPage(K);
|
|
86
|
+
}
|
|
87
|
+
}, X = ce(() => {
|
|
88
|
+
N(), L(), T && B();
|
|
66
89
|
}, [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
90
|
+
T,
|
|
91
|
+
L,
|
|
92
|
+
B,
|
|
93
|
+
N
|
|
71
94
|
]);
|
|
72
|
-
|
|
95
|
+
f(() => {
|
|
73
96
|
let e = () => {
|
|
74
|
-
|
|
97
|
+
X();
|
|
75
98
|
};
|
|
76
|
-
for (let t of
|
|
99
|
+
for (let t of _) window.addEventListener(t, e);
|
|
77
100
|
return () => {
|
|
78
|
-
for (let t of
|
|
101
|
+
for (let t of _) window.removeEventListener(t, e);
|
|
79
102
|
};
|
|
80
|
-
}, [
|
|
81
|
-
let { modalProps:
|
|
82
|
-
labels:
|
|
83
|
-
featureLabels:
|
|
84
|
-
embeddedBankAccounts:
|
|
85
|
-
verifiedExternalBankAccounts:
|
|
86
|
-
track:
|
|
87
|
-
isTransferMoneyOpen:
|
|
88
|
-
defaultIsTransferMoneyOpen:
|
|
89
|
-
onTransferMoneyOpenChange:
|
|
90
|
-
}),
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
transferRows:
|
|
93
|
-
|
|
103
|
+
}, [X]);
|
|
104
|
+
let { modalProps: ve, openModal: Z } = re({
|
|
105
|
+
labels: x,
|
|
106
|
+
featureLabels: b,
|
|
107
|
+
embeddedBankAccounts: V,
|
|
108
|
+
verifiedExternalBankAccounts: H,
|
|
109
|
+
track: S,
|
|
110
|
+
isTransferMoneyOpen: y,
|
|
111
|
+
defaultIsTransferMoneyOpen: le,
|
|
112
|
+
onTransferMoneyOpenChange: ue
|
|
113
|
+
}), ye = c(P), be = T && c(R), xe = pe && !F || A || ye || be, Q = j || I || T && he, Se = V.length + H.length, $ = !(V.length > 0) || Se <= 1;
|
|
114
|
+
return /* @__PURE__ */ h(se, {
|
|
115
|
+
transferRows: G,
|
|
116
|
+
pagination: _e,
|
|
117
|
+
isLoading: xe,
|
|
94
118
|
isError: Q,
|
|
95
|
-
onRetry: Q ? () => void
|
|
96
|
-
showTransferMoneyCta:
|
|
119
|
+
onRetry: Q ? () => void X() : void 0,
|
|
120
|
+
showTransferMoneyCta: D,
|
|
97
121
|
isTransferMoneyCtaDisabled: $,
|
|
98
|
-
onTransferMoneyClick:
|
|
122
|
+
onTransferMoneyClick: D && !$ ? () => Z() : void 0,
|
|
99
123
|
transferMoneyModal: {
|
|
100
|
-
...
|
|
124
|
+
...ve,
|
|
101
125
|
testIds: {
|
|
102
|
-
root:
|
|
103
|
-
closeButton:
|
|
104
|
-
fromAccountTrigger:
|
|
105
|
-
toAccountTrigger:
|
|
106
|
-
accountsConfirm:
|
|
107
|
-
amountInput:
|
|
126
|
+
root: d.modal,
|
|
127
|
+
closeButton: d.modalCloseButton,
|
|
128
|
+
fromAccountTrigger: d.modalFromAccountTrigger,
|
|
129
|
+
toAccountTrigger: d.modalToAccountTrigger,
|
|
130
|
+
accountsConfirm: d.modalAccountsConfirmButton,
|
|
131
|
+
amountInput: d.modalAmountInput,
|
|
108
132
|
reviewStep: {
|
|
109
|
-
confirm:
|
|
110
|
-
goBack:
|
|
133
|
+
confirm: d.modalConfirmTransferButton,
|
|
134
|
+
goBack: d.modalGoBackButton
|
|
111
135
|
},
|
|
112
|
-
resultStep: { backToTransfers:
|
|
136
|
+
resultStep: { backToTransfers: d.modalBackToTransfersButton }
|
|
113
137
|
}
|
|
114
138
|
},
|
|
115
139
|
labels: e,
|
|
116
140
|
testIds: {
|
|
117
|
-
transferMoneyButton:
|
|
118
|
-
skeleton:
|
|
119
|
-
error:
|
|
120
|
-
retry:
|
|
121
|
-
empty:
|
|
122
|
-
transferRow:
|
|
141
|
+
transferMoneyButton: d.transferMoneyButton,
|
|
142
|
+
skeleton: d.skeleton,
|
|
143
|
+
error: d.error,
|
|
144
|
+
retry: d.retry,
|
|
145
|
+
empty: d.empty,
|
|
146
|
+
transferRow: d.transferRow
|
|
123
147
|
}
|
|
124
148
|
});
|
|
125
149
|
}
|
|
126
150
|
//#endregion
|
|
127
|
-
export {
|
|
151
|
+
export { y as TransfersWidgetInner };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useCallback as e, useState as t } from "react";
|
|
6
|
+
//#region ../../libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransfersPageState.js
|
|
7
|
+
var n = [
|
|
8
|
+
10,
|
|
9
|
+
25,
|
|
10
|
+
50,
|
|
11
|
+
100
|
|
12
|
+
], r = (e) => ({
|
|
13
|
+
paginationToken: void 0,
|
|
14
|
+
pageIndex: 0,
|
|
15
|
+
pageSize: e
|
|
16
|
+
});
|
|
17
|
+
function i({ organizationId: n, userId: i }) {
|
|
18
|
+
let [a, o] = t({
|
|
19
|
+
organizationId: n,
|
|
20
|
+
userId: i
|
|
21
|
+
}), [s, c] = t(() => r(25)), l = n === void 0 ? a.organizationId : n, u = i === void 0 ? a.userId : i;
|
|
22
|
+
(l !== a.organizationId || u !== a.userId) && (o({
|
|
23
|
+
organizationId: l,
|
|
24
|
+
userId: u
|
|
25
|
+
}), c(r(s.pageSize)));
|
|
26
|
+
let d = e((e) => {
|
|
27
|
+
c((t) => ({
|
|
28
|
+
...t,
|
|
29
|
+
paginationToken: e,
|
|
30
|
+
pageIndex: t.pageIndex + 1
|
|
31
|
+
}));
|
|
32
|
+
}, []), f = e((e) => {
|
|
33
|
+
c((t) => ({
|
|
34
|
+
...t,
|
|
35
|
+
paginationToken: e,
|
|
36
|
+
pageIndex: Math.max(0, t.pageIndex - 1)
|
|
37
|
+
}));
|
|
38
|
+
}, []), p = e((e) => {
|
|
39
|
+
c(r(e));
|
|
40
|
+
}, []);
|
|
41
|
+
return {
|
|
42
|
+
...s,
|
|
43
|
+
goToNextPage: d,
|
|
44
|
+
goToPreviousPage: f,
|
|
45
|
+
changePageSize: p
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { n as TRANSFERS_PAGE_SIZE_OPTIONS, i as useTransfersPageState };
|
package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/mocks/labels.js
CHANGED
|
@@ -4,7 +4,8 @@ var e = {
|
|
|
4
4
|
populated: "Recent transfers across three accounts: completed, pending and failed, internal and to or from an external account. Hover a row for its status and type. Transfer money moves money between your accounts or to and from Operating reserve, and the new transfer lands in the list as pending.",
|
|
5
5
|
empty: "Three accounts and no transfers yet. Transfer money is enabled, and a submitted transfer becomes the first row.",
|
|
6
6
|
loading: "The accounts read is held open, so the list skeleton stays on screen.",
|
|
7
|
-
error: "
|
|
7
|
+
error: "The transfers read fails with a 500. The widget shows its own error with Try again; Transfer money still works, because the accounts themselves loaded.",
|
|
8
|
+
paginated: "Fifty-seven transfers, newest first, 25 to a page. Next and previous follow the tokens the transfers read returns.",
|
|
8
9
|
"control-hidden": "The same transfers, read by a session without transfer:write:org. The Transfer money button is absent."
|
|
9
10
|
},
|
|
10
11
|
scenarios: {
|