@tesouro/embedded-components-react 0.5.123 → 0.5.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js +28 -30
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/withAuthEpoch.js +11 -6
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ var h = u({
|
|
|
25
25
|
isRowClickable: !1,
|
|
26
26
|
onViewAllAccountsClicked: () => {}
|
|
27
27
|
}), g = () => f(h), _ = ({ children: u, maxAccounts: f, onBalanceRowClick: g, onViewAllAccountsClick: _ }) => {
|
|
28
|
-
let { data: v, isLoading: y, isError: b, refetch: x, hasNextPage: S, isFetchingNextPage: C } = t(), { initResponse: w } = s(), T = l(), E = c(), D = o(), O = T || y, k = !!E || b, A = d(() => {
|
|
28
|
+
let { data: v, isLoading: y, isError: b, refetch: x, hasNextPage: S, isFetchingNextPage: C } = t(), { initResponse: w } = s(), T = l(), E = c(), D = o(), O = T && !w || y, k = !!E || b, A = d(() => {
|
|
29
29
|
D(), E || x();
|
|
30
30
|
}, [
|
|
31
31
|
D,
|
|
@@ -4,32 +4,30 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { getBankAccounts as e } from "../rest/sdk.gen.js";
|
|
6
6
|
import { getBankAccountsOptions as t } from "../rest/@tanstack/react-query.gen.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { useAuthEpochPlaceholder as n } from "../withAuthEpoch.js";
|
|
8
|
+
import { useEmbedApi as r } from "../EmbedApiContext.js";
|
|
9
|
+
import { organizationHeaders as i } from "../organizationHeaders.js";
|
|
10
|
+
import { getAllPagesNextPageParam as a, useAutoFetchNextPage as o } from "../allPages.js";
|
|
11
|
+
import { useMemo as s } from "react";
|
|
12
|
+
import { useInfiniteQuery as c } from "@tanstack/react-query";
|
|
12
13
|
//#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
let { client:
|
|
16
|
-
client:
|
|
17
|
-
headers:
|
|
18
|
-
query: { limit:
|
|
19
|
-
}), _ =
|
|
20
|
-
queryKey: [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{ authEpoch: p }
|
|
24
|
-
],
|
|
25
|
-
enabled: h,
|
|
14
|
+
var l = 100;
|
|
15
|
+
function u({ enabled: u } = {}) {
|
|
16
|
+
let { client: d, organizationId: f, widgetToken: p, authEpoch: m } = r(), h = i(f), g = !!(f && p) && (u === !0 || u === void 0), _ = [...t({
|
|
17
|
+
client: d,
|
|
18
|
+
headers: h,
|
|
19
|
+
query: { limit: l }
|
|
20
|
+
}).queryKey, "all"], v = n(f ? _ : void 0), y = c({
|
|
21
|
+
queryKey: [..._, { authEpoch: m }],
|
|
22
|
+
placeholderData: v,
|
|
23
|
+
enabled: g,
|
|
26
24
|
initialPageParam: void 0,
|
|
27
25
|
queryFn: async ({ signal: t, pageParam: n }) => {
|
|
28
26
|
let { data: r } = await e({
|
|
29
|
-
client:
|
|
30
|
-
headers:
|
|
27
|
+
client: d,
|
|
28
|
+
headers: h,
|
|
31
29
|
query: {
|
|
32
|
-
limit:
|
|
30
|
+
limit: l,
|
|
33
31
|
...n ? { pagination_token: n } : {}
|
|
34
32
|
},
|
|
35
33
|
signal: t,
|
|
@@ -37,20 +35,20 @@ function l({ enabled: l } = {}) {
|
|
|
37
35
|
});
|
|
38
36
|
return r;
|
|
39
37
|
},
|
|
40
|
-
getNextPageParam:
|
|
38
|
+
getNextPageParam: a
|
|
41
39
|
});
|
|
42
|
-
|
|
43
|
-
let
|
|
44
|
-
if (
|
|
45
|
-
data:
|
|
40
|
+
o(y, g);
|
|
41
|
+
let b = s(() => {
|
|
42
|
+
if (y.data) return {
|
|
43
|
+
data: y.data.pages.flatMap((e) => e.data ?? []),
|
|
46
44
|
nextPaginationToken: null,
|
|
47
45
|
prevPaginationToken: null
|
|
48
46
|
};
|
|
49
|
-
}, [
|
|
47
|
+
}, [y.data]);
|
|
50
48
|
return {
|
|
51
|
-
...
|
|
52
|
-
data:
|
|
49
|
+
...y,
|
|
50
|
+
data: b
|
|
53
51
|
};
|
|
54
52
|
}
|
|
55
53
|
//#endregion
|
|
56
|
-
export {
|
|
54
|
+
export { u as useAllBankAccountsQuery };
|
package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/withAuthEpoch.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { useMemo as e } from "react";
|
|
1
2
|
//#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/withAuthEpoch.js
|
|
2
|
-
var
|
|
3
|
-
function
|
|
3
|
+
var t = (e) => e;
|
|
4
|
+
function n(t) {
|
|
5
|
+
let n = t && JSON.stringify(t);
|
|
6
|
+
return e(() => (e, t) => n === void 0 || t && JSON.stringify(t.queryKey.slice(0, -1)) === n ? e : void 0, [n]);
|
|
7
|
+
}
|
|
8
|
+
function r(e, n) {
|
|
4
9
|
return {
|
|
5
|
-
placeholderData:
|
|
6
|
-
...
|
|
7
|
-
queryKey: [...
|
|
10
|
+
placeholderData: t,
|
|
11
|
+
...e,
|
|
12
|
+
queryKey: [...e.queryKey, { authEpoch: n }]
|
|
8
13
|
};
|
|
9
14
|
}
|
|
10
15
|
//#endregion
|
|
11
|
-
export {
|
|
16
|
+
export { n as useAuthEpochPlaceholder, r as withAuthEpoch };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.124", n = "02feefabf2c21972814adc66f109f8a70b35b66e", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|