@tesouro/embedded-components-react 0.5.128 → 0.5.129
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/cards-widget/data-access/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index13.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/applicationStatusQueryOptions.js +8 -5
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js +20 -30
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/withAuthEpoch.js +27 -9
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index2.js +1 -1
- package/package.json +1 -1
|
@@ -7,12 +7,15 @@ function i({ client: t }) {
|
|
|
7
7
|
return e({ client: t }).queryKey;
|
|
8
8
|
}
|
|
9
9
|
function a({ client: i, widgetToken: a, authEpoch: o }) {
|
|
10
|
-
let { queryFn: s, queryKey: c } = e({ client: i });
|
|
10
|
+
let { queryFn: s, queryKey: c } = e({ client: i }), { placeholderData: l } = t({ queryKey: c }, o);
|
|
11
11
|
return {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
queryKey: [
|
|
13
|
+
c[0],
|
|
14
|
+
{ authEpoch: o },
|
|
15
|
+
{ widgetTokenId: n(a) }
|
|
16
|
+
],
|
|
17
|
+
queryFn: s,
|
|
18
|
+
placeholderData: l,
|
|
16
19
|
retry: 2,
|
|
17
20
|
retryDelay: 300,
|
|
18
21
|
staleTime: r
|
|
@@ -4,7 +4,7 @@
|
|
|
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 {
|
|
7
|
+
import { authEpochPlaceholder as n } from "../withAuthEpoch.js";
|
|
8
8
|
import { useEmbedApi as r } from "../EmbedApiContext.js";
|
|
9
9
|
import { organizationHeaders as i } from "../organizationHeaders.js";
|
|
10
10
|
import { getAllPagesNextPageParam as a, useAutoFetchNextPage as o } from "../allPages.js";
|
|
@@ -17,9 +17,9 @@ function u({ enabled: u } = {}) {
|
|
|
17
17
|
client: d,
|
|
18
18
|
headers: h,
|
|
19
19
|
query: { limit: l }
|
|
20
|
-
}).queryKey, "all"], v =
|
|
20
|
+
}).queryKey, "all"], v = c({
|
|
21
21
|
queryKey: [..._, { authEpoch: m }],
|
|
22
|
-
placeholderData:
|
|
22
|
+
placeholderData: n(_),
|
|
23
23
|
enabled: g,
|
|
24
24
|
initialPageParam: void 0,
|
|
25
25
|
queryFn: async ({ signal: t, pageParam: n }) => {
|
|
@@ -37,17 +37,17 @@ function u({ enabled: u } = {}) {
|
|
|
37
37
|
},
|
|
38
38
|
getNextPageParam: a
|
|
39
39
|
});
|
|
40
|
-
o(
|
|
41
|
-
let
|
|
42
|
-
if (
|
|
43
|
-
data:
|
|
40
|
+
o(v, g);
|
|
41
|
+
let y = s(() => {
|
|
42
|
+
if (v.data) return {
|
|
43
|
+
data: v.data.pages.flatMap((e) => e.data ?? []),
|
|
44
44
|
nextPaginationToken: null,
|
|
45
45
|
prevPaginationToken: null
|
|
46
46
|
};
|
|
47
|
-
}, [
|
|
47
|
+
}, [v.data]);
|
|
48
48
|
return {
|
|
49
|
-
...
|
|
50
|
-
data:
|
|
49
|
+
...v,
|
|
50
|
+
data: y
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
@@ -12,44 +12,34 @@ function i(e) {
|
|
|
12
12
|
for (let n = 0; n < e.length; n += 1) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
|
|
13
13
|
return (t >>> 0).toString(16);
|
|
14
14
|
}
|
|
15
|
-
function a(
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
var o = [];
|
|
19
|
-
function s(e, t) {
|
|
20
|
-
if (e !== void 0 && t !== void 0 && a(t.queryKey, o)) return e;
|
|
21
|
-
}
|
|
22
|
-
function c({ invitationToken: a, userId: c, enabled: l } = {}) {
|
|
23
|
-
let { client: u, widgetToken: d, authEpoch: f } = n(), p = a && c ? {
|
|
15
|
+
function a({ invitationToken: a, userId: o, enabled: s } = {}) {
|
|
16
|
+
let { client: c, widgetToken: l, authEpoch: u } = n(), d = a && o ? {
|
|
24
17
|
invitationToken: a,
|
|
25
|
-
userId:
|
|
26
|
-
} : void 0,
|
|
18
|
+
userId: o
|
|
19
|
+
} : void 0, f = async ({ signal: t }) => {
|
|
27
20
|
let { data: n } = await e({
|
|
28
|
-
client:
|
|
29
|
-
headers: { "X-Widget-Token":
|
|
30
|
-
...
|
|
21
|
+
client: c,
|
|
22
|
+
headers: { "X-Widget-Token": l ?? "" },
|
|
23
|
+
...d ? { query: d } : {},
|
|
31
24
|
signal: t,
|
|
32
25
|
throwOnError: !0
|
|
33
26
|
});
|
|
34
27
|
if (!n) throw Error("Unexpected disclosures response from widget gateway");
|
|
35
28
|
return n;
|
|
36
|
-
},
|
|
37
|
-
baseUrl:
|
|
38
|
-
...
|
|
39
|
-
...
|
|
40
|
-
}]
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
queryFn: m,
|
|
45
|
-
placeholderData: void 0
|
|
46
|
-
}, f);
|
|
29
|
+
}, p = ["getDisclosures", {
|
|
30
|
+
baseUrl: c.getConfig().baseUrl,
|
|
31
|
+
...o ? { userId: o } : {},
|
|
32
|
+
...d ? { invitationTokenFingerprint: i(d.invitationToken) } : {}
|
|
33
|
+
}], { queryKey: m, placeholderData: h } = t({
|
|
34
|
+
queryKey: p,
|
|
35
|
+
queryFn: f
|
|
36
|
+
}, u);
|
|
47
37
|
return r({
|
|
48
|
-
queryKey:
|
|
49
|
-
queryFn:
|
|
50
|
-
placeholderData:
|
|
51
|
-
enabled: !!
|
|
38
|
+
queryKey: m,
|
|
39
|
+
queryFn: f,
|
|
40
|
+
placeholderData: h,
|
|
41
|
+
enabled: !!l && (s === !0 || s === void 0)
|
|
52
42
|
});
|
|
53
43
|
}
|
|
54
44
|
//#endregion
|
|
55
|
-
export {
|
|
45
|
+
export { a as useDisclosuresQuery };
|
package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/withAuthEpoch.js
CHANGED
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
import { useMemo as e } from "react";
|
|
2
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/withAuthEpoch.js
|
|
3
|
-
var t = (e) => e
|
|
4
|
-
|
|
5
|
-
let
|
|
6
|
-
return
|
|
2
|
+
var e = "x-organization-id", t = (e) => typeof e == "object" && !!e && !Array.isArray(e), n = (n) => t(n.headers) ? n.headers[e] : void 0, r = ([n, ...r]) => {
|
|
3
|
+
if (!t(n) || !t(n.headers)) return [n, ...r];
|
|
4
|
+
let i = { ...n.headers };
|
|
5
|
+
return delete i[e], [{
|
|
6
|
+
...n,
|
|
7
|
+
headers: i
|
|
8
|
+
}, ...r];
|
|
9
|
+
}, i = (e) => JSON.stringify(e, (e, n) => t(n) ? Object.fromEntries(Object.keys(n).sort().map((e) => [e, n[e]])) : n);
|
|
10
|
+
function a(e, a, o) {
|
|
11
|
+
let s = o ? r(e) : e, [c] = s;
|
|
12
|
+
return i(a && t(c) ? [c.baseUrl, n(c)] : s);
|
|
7
13
|
}
|
|
8
|
-
function
|
|
14
|
+
function o(n) {
|
|
15
|
+
let [r] = n;
|
|
16
|
+
return t(r) && t(r.headers) && e in r.headers && !r.headers[e];
|
|
17
|
+
}
|
|
18
|
+
var s = /* @__PURE__ */ new Map(), c = 500;
|
|
19
|
+
function l(e, t) {
|
|
20
|
+
let n = o(e), r = a(e, t, n), i = `${t}:${n}:${e.length}:${r}`, l = s.get(i);
|
|
21
|
+
if (l) return s.delete(i), s.set(i, l), l;
|
|
22
|
+
let u = (i, o) => o && a(o.queryKey.slice(0, e.length), t, n) === r ? i : void 0;
|
|
23
|
+
return s.size >= c && s.delete(s.keys().next().value), s.set(i, u), u;
|
|
24
|
+
}
|
|
25
|
+
var u = (e) => l(e, !1);
|
|
26
|
+
function d(e, t, { carryWithinOrg: n = !1 } = {}) {
|
|
9
27
|
return {
|
|
10
|
-
placeholderData:
|
|
28
|
+
placeholderData: l(e.queryKey, n),
|
|
11
29
|
...e,
|
|
12
|
-
queryKey: [...e.queryKey, { authEpoch:
|
|
30
|
+
queryKey: [...e.queryKey, { authEpoch: t }]
|
|
13
31
|
};
|
|
14
32
|
}
|
|
15
33
|
//#endregion
|
|
16
|
-
export {
|
|
34
|
+
export { u as authEpochPlaceholder, d 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.129", n = "be19c976cefc2e40777e2dfb87a8b3cd2a50caa8", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|