@tesouro/embedded-components-react 0.5.132 → 0.5.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. package/dist/index.d.ts +13 -0
  2. package/dist/lib/BankAccountsWidget.d.ts +13 -0
  3. package/dist/lib/WidgetSuite.d.ts +13 -0
  4. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index.js +6 -4
  5. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index3.js +13 -12
  6. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index4.js +17 -35
  7. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index5.js +35 -24
  8. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index6.js +28 -0
  9. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index7.js +32 -0
  10. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index4.js +17 -5
  11. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index5.js +2 -1
  12. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index8.js +226 -139
  13. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index5.js +100 -5
  14. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index7.js +11 -0
  15. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index8.js +110 -95
  16. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index4.js +2 -1
  17. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +34 -34
  18. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +203 -192
  19. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +168 -144
  20. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  21. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1975,6 +1975,17 @@ interface Labels$3 {
1975
1975
  exportCancelButton: string;
1976
1976
  exportDownloadButton: string;
1977
1977
  noStatementsLabel: string;
1978
+ statementColumn: string;
1979
+ statementsActionsColumn: string;
1980
+ viewStatementButton: string;
1981
+ viewStatementButtonAriaLabel: string;
1982
+ statementsRowsPerPageLabel: string;
1983
+ statementsPreviousPageButton: string;
1984
+ statementsNextPageButton: string;
1985
+ statementsLoadingLabel: string;
1986
+ statementsErrorTitle: string;
1987
+ statementsErrorDescription: string;
1988
+ statementsErrorRetry: string;
1978
1989
  editAccountMenuItem: string;
1979
1990
  editDialogTitle: string;
1980
1991
  editNicknameLabel: string;
@@ -2015,6 +2026,8 @@ interface FeatureLabels$3 {
2015
2026
  exportSuccessToast: string;
2016
2027
  /** Account-details export toast — forwarded to AccountDetailsWidget. */
2017
2028
  exportErrorToast: string;
2029
+ /** Account-details statement-retrieval toast — forwarded to AccountDetailsWidget. */
2030
+ viewStatementErrorToast: string;
2018
2031
  }
2019
2032
 
2020
2033
  interface BankAccountsWidgetProps extends WidgetProviderProps {
@@ -689,6 +689,17 @@ interface Labels {
689
689
  exportCancelButton: string;
690
690
  exportDownloadButton: string;
691
691
  noStatementsLabel: string;
692
+ statementColumn: string;
693
+ statementsActionsColumn: string;
694
+ viewStatementButton: string;
695
+ viewStatementButtonAriaLabel: string;
696
+ statementsRowsPerPageLabel: string;
697
+ statementsPreviousPageButton: string;
698
+ statementsNextPageButton: string;
699
+ statementsLoadingLabel: string;
700
+ statementsErrorTitle: string;
701
+ statementsErrorDescription: string;
702
+ statementsErrorRetry: string;
692
703
  editAccountMenuItem: string;
693
704
  editDialogTitle: string;
694
705
  editNicknameLabel: string;
@@ -729,6 +740,8 @@ interface FeatureLabels {
729
740
  exportSuccessToast: string;
730
741
  /** Account-details export toast — forwarded to AccountDetailsWidget. */
731
742
  exportErrorToast: string;
743
+ /** Account-details statement-retrieval toast — forwarded to AccountDetailsWidget. */
744
+ viewStatementErrorToast: string;
732
745
  }
733
746
 
734
747
  interface BankAccountsWidgetProps extends WidgetProviderProps {
@@ -1175,6 +1175,17 @@ interface Labels$1 {
1175
1175
  exportCancelButton: string;
1176
1176
  exportDownloadButton: string;
1177
1177
  noStatementsLabel: string;
1178
+ statementColumn: string;
1179
+ statementsActionsColumn: string;
1180
+ viewStatementButton: string;
1181
+ viewStatementButtonAriaLabel: string;
1182
+ statementsRowsPerPageLabel: string;
1183
+ statementsPreviousPageButton: string;
1184
+ statementsNextPageButton: string;
1185
+ statementsLoadingLabel: string;
1186
+ statementsErrorTitle: string;
1187
+ statementsErrorDescription: string;
1188
+ statementsErrorRetry: string;
1178
1189
  editAccountMenuItem: string;
1179
1190
  editDialogTitle: string;
1180
1191
  editNicknameLabel: string;
@@ -1215,6 +1226,8 @@ interface FeatureLabels$2 {
1215
1226
  exportSuccessToast: string;
1216
1227
  /** Account-details export toast — forwarded to AccountDetailsWidget. */
1217
1228
  exportErrorToast: string;
1229
+ /** Account-details statement-retrieval toast — forwarded to AccountDetailsWidget. */
1230
+ viewStatementErrorToast: string;
1218
1231
  }
1219
1232
 
1220
1233
  interface BankAccountsWidgetProps extends WidgetProviderProps {
@@ -1,5 +1,7 @@
1
1
  import { useBankAccountDetailsQuery as e } from "./index2.js";
2
- import { useBankAccountTransactionsQuery as t } from "./index3.js";
3
- import { useDownloadBankAccountTransactionsMutation as n } from "./index4.js";
4
- import { useUpdateBankAccountMutation as r } from "./index5.js";
5
- export { e as useBankAccountDetailsQuery, t as useBankAccountTransactionsQuery, n as useDownloadBankAccountTransactionsMutation, r as useUpdateBankAccountMutation };
2
+ import { useBankAccountStatementsQuery as t } from "./index3.js";
3
+ import { useBankAccountTransactionsQuery as n } from "./index4.js";
4
+ import { useDownloadBankAccountTransactionsMutation as r } from "./index5.js";
5
+ import { useRetrieveBankAccountStatementMutation as i } from "./index6.js";
6
+ import { useUpdateBankAccountMutation as a } from "./index7.js";
7
+ export { e as useBankAccountDetailsQuery, t as useBankAccountStatementsQuery, n as useBankAccountTransactionsQuery, r as useDownloadBankAccountTransactionsMutation, i as useRetrieveBankAccountStatementMutation, a as useUpdateBankAccountMutation };
@@ -2,24 +2,25 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { getBankAccountTransactionsOptions as e } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
5
+ import { getBankAccountStatementsOptions 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 { useQuery as i } from "@tanstack/react-query";
10
+ import { keepPreviousData as i, useQuery as a } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index3.js
12
- function a({ id: a, enabled: o, ...s }) {
13
- let { client: c, organizationId: l, widgetToken: u, authEpoch: d } = n(), f = e({
14
- client: c,
15
- headers: r(l),
16
- path: { id: a ?? "" },
17
- query: s
12
+ function o({ id: o, enabled: s, ...c }) {
13
+ let { client: l, organizationId: u, widgetToken: d, authEpoch: f } = n(), p = e({
14
+ client: l,
15
+ headers: r(u),
16
+ path: { id: o ?? "" },
17
+ query: c
18
18
  });
19
- return i({
20
- ...t(f, d),
21
- enabled: !!(a && l && u) && (o === !0 || o === void 0)
19
+ return a({
20
+ ...t(p, f),
21
+ enabled: !!(o && u && d) && (s === !0 || s === void 0),
22
+ placeholderData: i
22
23
  });
23
24
  }
24
25
  //#endregion
25
- export { a as useBankAccountTransactionsQuery };
26
+ export { o as useBankAccountStatementsQuery };
@@ -2,42 +2,24 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { downloadBankAccountTransactions as e } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
6
- import { useEmbedApi as t } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
- import { organizationHeaders as n } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
5
+ import { getBankAccountTransactionsOptions 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 { organizationHeaders as r } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
8
9
  import "../../../../shared/data-access/dist/index.js";
9
- import { useMutation as r } from "@tanstack/react-query";
10
+ import { useQuery as i } from "@tanstack/react-query";
10
11
  //#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index4.js
11
- function i(e) {
12
- if (!e) return;
13
- let t = /filename\*=UTF-8''([^;]+)/i.exec(e);
14
- if (t?.[1]) try {
15
- return decodeURIComponent(t[1].trim());
16
- } catch {
17
- return t[1].trim();
18
- }
19
- let n = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(e);
20
- if (n?.[1]) return n[1].replace(/['"]/g, "").trim() || void 0;
21
- }
22
- function a() {
23
- let { client: a, organizationId: o } = t();
24
- return r({ mutationFn: async ({ id: t, startDate: r, endDate: s }) => {
25
- let { data: c, response: l } = await e({
26
- client: a,
27
- headers: n(o),
28
- path: { id: t },
29
- query: {
30
- startDate: r,
31
- endDate: s
32
- },
33
- parseAs: "text",
34
- throwOnError: !0
35
- });
36
- return {
37
- csv: typeof c == "string" ? c : String(c ?? ""),
38
- filename: i(l.headers.get("Content-Disposition")) ?? `transactions-${r}-to-${s}.csv`
39
- };
40
- } });
12
+ function a({ id: a, enabled: o, ...s }) {
13
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d } = n(), f = e({
14
+ client: c,
15
+ headers: r(l),
16
+ path: { id: a ?? "" },
17
+ query: s
18
+ });
19
+ return i({
20
+ ...t(f, d),
21
+ enabled: !!(a && l && u) && (o === !0 || o === void 0)
22
+ });
41
23
  }
42
24
  //#endregion
43
- export { a as useDownloadBankAccountTransactionsMutation };
25
+ export { a as useBankAccountTransactionsQuery };
@@ -2,31 +2,42 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { getBankAccountQueryKey as e, getBankAccountsQueryKey as t, updateBankAccountMutation as n } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
- import { invalidateAllClients as r } from "../../../../shared/data-access/dist/lib/clientRegistry.js";
7
- import { useEmbedApi as i } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
- import { organizationHeaders as a } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
5
+ import { downloadBankAccountTransactions as e } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
6
+ import { useEmbedApi as t } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
+ import { organizationHeaders as n } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
9
8
  import "../../../../shared/data-access/dist/index.js";
10
- import { useMutation as o } from "@tanstack/react-query";
9
+ import { useMutation as r } from "@tanstack/react-query";
11
10
  //#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index5.js
12
- function s() {
13
- let { client: s, organizationId: c } = i(), l = a(c), u = n({
14
- client: s,
15
- headers: l
16
- });
17
- return o({
18
- ...u,
19
- onSuccess: async (n, i, ...a) => {
20
- await Promise.all([r(t({
21
- client: s,
22
- headers: l
23
- })), r(e({
24
- client: s,
25
- headers: l,
26
- path: i.path
27
- }))]), await u.onSuccess?.(n, i, ...a);
28
- }
29
- });
11
+ function i(e) {
12
+ if (!e) return;
13
+ let t = /filename\*=UTF-8''([^;]+)/i.exec(e);
14
+ if (t?.[1]) try {
15
+ return decodeURIComponent(t[1].trim());
16
+ } catch {
17
+ return t[1].trim();
18
+ }
19
+ let n = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(e);
20
+ if (n?.[1]) return n[1].replace(/['"]/g, "").trim() || void 0;
21
+ }
22
+ function a() {
23
+ let { client: a, organizationId: o } = t();
24
+ return r({ mutationFn: async ({ id: t, startDate: r, endDate: s }) => {
25
+ let { data: c, response: l } = await e({
26
+ client: a,
27
+ headers: n(o),
28
+ path: { id: t },
29
+ query: {
30
+ startDate: r,
31
+ endDate: s
32
+ },
33
+ parseAs: "text",
34
+ throwOnError: !0
35
+ });
36
+ return {
37
+ csv: typeof c == "string" ? c : String(c ?? ""),
38
+ filename: i(l.headers.get("Content-Disposition")) ?? `transactions-${r}-to-${s}.csv`
39
+ };
40
+ } });
30
41
  }
31
42
  //#endregion
32
- export { s as useUpdateBankAccountMutation };
43
+ export { a as useDownloadBankAccountTransactionsMutation };
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { getBankAccountStatement as e } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
6
+ import { useEmbedApi as t } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
+ import { organizationHeaders as n } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
8
+ import "../../../../shared/data-access/dist/index.js";
9
+ import { useMutation as r } from "@tanstack/react-query";
10
+ //#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index6.js
11
+ function i() {
12
+ let { client: i, organizationId: a } = t();
13
+ return r({ mutationFn: async ({ id: t, statementId: r }) => {
14
+ let { data: o } = await e({
15
+ client: i,
16
+ headers: n(a),
17
+ path: {
18
+ id: t,
19
+ statementId: r
20
+ },
21
+ parseAs: "blob",
22
+ throwOnError: !0
23
+ }), s = o instanceof Blob ? o : new Blob([o]);
24
+ return s.type === "application/pdf" ? s : new Blob([s], { type: "application/pdf" });
25
+ } });
26
+ }
27
+ //#endregion
28
+ export { i as useRetrieveBankAccountStatementMutation };
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { getBankAccountQueryKey as e, getBankAccountsQueryKey as t, updateBankAccountMutation as n } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
+ import { invalidateAllClients as r } from "../../../../shared/data-access/dist/lib/clientRegistry.js";
7
+ import { useEmbedApi as i } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
+ import { organizationHeaders as a } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
9
+ import "../../../../shared/data-access/dist/index.js";
10
+ import { useMutation as o } from "@tanstack/react-query";
11
+ //#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index7.js
12
+ function s() {
13
+ let { client: s, organizationId: c } = i(), l = a(c), u = n({
14
+ client: s,
15
+ headers: l
16
+ });
17
+ return o({
18
+ ...u,
19
+ onSuccess: async (n, i, ...a) => {
20
+ await Promise.all([r(t({
21
+ client: s,
22
+ headers: l
23
+ })), r(e({
24
+ client: s,
25
+ headers: l,
26
+ path: i.path
27
+ }))]), await u.onSuccess?.(n, i, ...a);
28
+ }
29
+ });
30
+ }
31
+ //#endregion
32
+ export { s as useUpdateBankAccountMutation };
@@ -6,7 +6,19 @@ function t(t) {
6
6
  let r = e(n);
7
7
  return r ? new Intl.DateTimeFormat(void 0, { dateStyle: "medium" }).format(r) : n;
8
8
  }
9
- function n(e, t = "—") {
9
+ function n(e) {
10
+ return t(e);
11
+ }
12
+ function r(t) {
13
+ let n = t.trim();
14
+ if (!n) return "";
15
+ let r = e(n);
16
+ return r ? new Intl.DateTimeFormat(void 0, {
17
+ month: "long",
18
+ year: "numeric"
19
+ }).format(r) : n;
20
+ }
21
+ function i(e, t = "—") {
10
22
  if (!e) return t;
11
23
  let n = Number(e.value);
12
24
  return Number.isFinite(n) ? new Intl.NumberFormat(void 0, {
@@ -14,7 +26,7 @@ function n(e, t = "—") {
14
26
  currency: e.currencyCode
15
27
  }).format(n / 100) : t;
16
28
  }
17
- function r(e, t, n = "—") {
29
+ function a(e, t, n = "—") {
18
30
  if (!e) return n;
19
31
  let r = Math.abs(Number(e.value));
20
32
  if (!Number.isFinite(r)) return n;
@@ -24,11 +36,11 @@ function r(e, t, n = "—") {
24
36
  }).format(r / 100);
25
37
  return t === "CREDIT" ? `+${i}` : `-${i}`;
26
38
  }
27
- function i(e) {
39
+ function o(e) {
28
40
  let t = e.trim();
29
41
  return t ? `••••••••${t.slice(-4)}` : "";
30
42
  }
31
- async function a(e) {
43
+ async function s(e) {
32
44
  if (!e.trim()) return !1;
33
45
  try {
34
46
  return await navigator.clipboard.writeText(e), !0;
@@ -37,4 +49,4 @@ async function a(e) {
37
49
  }
38
50
  }
39
51
  //#endregion
40
- export { a as copyTextToClipboard, n as formatAmountLabel, r as formatSignedTransactionAmountLabel, t as formatTransactionDateLabel, i as maskAccountNumber };
52
+ export { s as copyTextToClipboard, i as formatAmountLabel, a as formatSignedTransactionAmountLabel, r as formatStatementPeriodLabel, n as formatTransactionDateLabel, o as maskAccountNumber };
@@ -9,7 +9,8 @@ var e = {
9
9
  copyBankAddressToast: "Bank address copied to clipboard",
10
10
  exportLoadingToast: "Exporting CSV...",
11
11
  exportSuccessToast: "Transactions have been exported",
12
- exportErrorToast: "Unable to export transactions"
12
+ exportErrorToast: "Unable to export transactions",
13
+ viewStatementErrorToast: "Unable to open statement"
13
14
  };
14
15
  //#endregion
15
16
  export { e as DEFAULT_FEATURE_LABELS };