@tesouro/embedded-components-react 0.5.270 → 0.5.271
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/bill-pay-widget/bill-detail/data-access/dist/index2.js +22 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +8 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/invalidation.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/reconcileSubmittedForApprovalQueries.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -11,29 +11,33 @@ import "../../../../shared/data-access/dist/index.js";
|
|
|
11
11
|
import { NEWEST_REQUEST_FIRST as o, PAYABLE_OBJECT_TYPE as s } from "../../../data-access/dist/lib/queryKeys.js";
|
|
12
12
|
import { invalidateApprovalDecisionQueries as c, reconcileApprovalDecisionQueries as l } from "../../../data-access/dist/lib/invalidatePayableQueries/approvalDecisionQueries.js";
|
|
13
13
|
import { beginApprovalRequestWatch as u } from "../../../data-access/dist/lib/invalidatePayableQueries/approvalRequestWatch.js";
|
|
14
|
+
import { APPROVAL_REQUEST_POLL_TIMEOUT_MS as d } from "../../../data-access/dist/lib/invalidatePayableQueries/reconcileSubmittedForApprovalQueries.js";
|
|
14
15
|
import "../../../data-access/dist/invalidation.js";
|
|
15
16
|
import "../../../data-access/dist/index.js";
|
|
16
|
-
import {
|
|
17
|
+
import { useState as f } from "react";
|
|
18
|
+
import { useMutation as p, useQuery as m } from "@tanstack/react-query";
|
|
17
19
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
var h = 5e3, g = 3e4;
|
|
21
|
+
function _(e, { enabled: t, hasAwaitedRequest: c, currentRoundStartedAt: l } = {}) {
|
|
22
|
+
let { client: u, organizationId: p, widgetToken: _, authEpoch: v, organizationStatus: y } = i(), [b] = f(() => Date.now()), x = Math.max(l ? Date.parse(l) : b, b) + d, S = !!(p && _ && e) && t !== !1, C = n({
|
|
23
|
+
client: u,
|
|
24
|
+
headers: a(p),
|
|
22
25
|
query: {
|
|
23
26
|
object_id: e ?? "",
|
|
24
27
|
object_type: s,
|
|
25
28
|
order: o
|
|
26
29
|
}
|
|
27
30
|
});
|
|
28
|
-
return
|
|
29
|
-
...r(
|
|
30
|
-
authEpoch:
|
|
31
|
-
organizationStatus:
|
|
31
|
+
return m({
|
|
32
|
+
...r(C, {
|
|
33
|
+
authEpoch: v,
|
|
34
|
+
organizationStatus: y
|
|
32
35
|
}),
|
|
33
|
-
enabled:
|
|
36
|
+
enabled: S,
|
|
37
|
+
refetchInterval: (e) => !c || c(e.state.data?.data ?? []) ? !1 : Date.now() < x ? h : g
|
|
34
38
|
});
|
|
35
39
|
}
|
|
36
|
-
async function
|
|
40
|
+
async function v({ client: e, organizationId: t, payableId: n, requestStatus: r }) {
|
|
37
41
|
let i = n && r !== "waiting" && n ? await u({
|
|
38
42
|
client: e,
|
|
39
43
|
organizationId: t,
|
|
@@ -50,9 +54,9 @@ async function m({ client: e, organizationId: t, payableId: n, requestStatus: r
|
|
|
50
54
|
watch: i
|
|
51
55
|
}).catch(() => {});
|
|
52
56
|
}
|
|
53
|
-
function
|
|
57
|
+
function y() {
|
|
54
58
|
let { client: t, organizationId: n } = i();
|
|
55
|
-
return
|
|
59
|
+
return p({
|
|
56
60
|
mutationFn: async ({ path: r }) => {
|
|
57
61
|
let { data: i } = await e({
|
|
58
62
|
client: t,
|
|
@@ -63,7 +67,7 @@ function h() {
|
|
|
63
67
|
return i;
|
|
64
68
|
},
|
|
65
69
|
onSuccess: async (e) => {
|
|
66
|
-
await
|
|
70
|
+
await v({
|
|
67
71
|
client: t,
|
|
68
72
|
organizationId: n,
|
|
69
73
|
payableId: e?.object_id,
|
|
@@ -72,9 +76,9 @@ function h() {
|
|
|
72
76
|
}
|
|
73
77
|
});
|
|
74
78
|
}
|
|
75
|
-
function
|
|
79
|
+
function b() {
|
|
76
80
|
let { client: e, organizationId: n } = i();
|
|
77
|
-
return
|
|
81
|
+
return p({
|
|
78
82
|
mutationFn: async ({ path: r, body: i }) => {
|
|
79
83
|
let { data: o } = await t({
|
|
80
84
|
client: e,
|
|
@@ -86,7 +90,7 @@ function g() {
|
|
|
86
90
|
return o;
|
|
87
91
|
},
|
|
88
92
|
onSuccess: async (t) => {
|
|
89
|
-
await
|
|
93
|
+
await v({
|
|
90
94
|
client: e,
|
|
91
95
|
organizationId: n,
|
|
92
96
|
payableId: t?.object_id,
|
|
@@ -96,4 +100,4 @@ function g() {
|
|
|
96
100
|
});
|
|
97
101
|
}
|
|
98
102
|
//#endregion
|
|
99
|
-
export {
|
|
103
|
+
export { y as useApprovePayableApprovalRequestMutation, _ as usePayableApprovalRequestsQuery, b as useRejectPayableApprovalRequestMutation };
|
|
@@ -14,15 +14,19 @@ import { currentApprovalRound as a } from "./index3.js";
|
|
|
14
14
|
import { usePayableApprovalRoundStart as o } from "./index11.js";
|
|
15
15
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js
|
|
16
16
|
function s({ payableId: s, status: c }) {
|
|
17
|
-
let { initResponse: l } = r(), u = e(l?.scopes, [n.ApprovalRequestReadOrg]), d = c === "approve_in_progress" && u,
|
|
17
|
+
let { initResponse: l } = r(), u = e(l?.scopes, [n.ApprovalRequestReadOrg]), d = c === "approve_in_progress" && u, { roundStartedAt: f } = o({
|
|
18
18
|
payableId: s,
|
|
19
19
|
enabled: d
|
|
20
|
-
}),
|
|
20
|
+
}), p = t({ enabled: d }), m = p.data?.id, h = (e) => e.caller_is_policy_approver ?? !!(m && e.user_ids.includes(m)), g = i(s, {
|
|
21
|
+
enabled: d,
|
|
22
|
+
hasAwaitedRequest: d ? (e) => a(e, f).some(h) : void 0,
|
|
23
|
+
currentRoundStartedAt: f
|
|
24
|
+
}), _ = d ? a(g.data?.data, f) : [], v = _.some(h), y = _.filter((e) => e.status === "waiting");
|
|
21
25
|
return {
|
|
22
|
-
id: y.filter(
|
|
26
|
+
id: y.filter(h).find((e) => !(m && (e.approved_by ?? []).includes(m)))?.id,
|
|
23
27
|
isPolicyApprover: v,
|
|
24
28
|
hasWaitingRequest: y.length > 0,
|
|
25
|
-
isLoading:
|
|
29
|
+
isLoading: g.isLoading || p.isLoading
|
|
26
30
|
};
|
|
27
31
|
}
|
|
28
32
|
//#endregion
|
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/invalidation.js
CHANGED
|
@@ -5,7 +5,7 @@ import { beginApprovalRequestWatch as o } from "./lib/invalidatePayableQueries/a
|
|
|
5
5
|
import { invalidateDeletedPayableQueries as s } from "./lib/invalidatePayableQueries/invalidateDeletedPayableQueries.js";
|
|
6
6
|
import { hasLiveScheduledRecord as c } from "./lib/invalidatePayableQueries/hasLiveScheduledRecord.js";
|
|
7
7
|
import { reconcileCancelledPaymentQueries as l } from "./lib/invalidatePayableQueries/reconcileCancelledPaymentQueries.js";
|
|
8
|
-
import {
|
|
8
|
+
import { APPROVAL_REQUEST_POLL_TIMEOUT_MS as u, reconcileSubmittedForApprovalQueries as d } from "./lib/invalidatePayableQueries/reconcileSubmittedForApprovalQueries.js";
|
|
9
9
|
import "./lib/invalidatePayableQueries/index.js";
|
|
10
|
-
import { OCR_POLL_INTERVAL_MS as
|
|
11
|
-
export {
|
|
10
|
+
import { OCR_POLL_INTERVAL_MS as f, payableOcrQueryOptions as p } from "./lib/payableOcrQueryOptions.js";
|
|
11
|
+
export { u as APPROVAL_REQUEST_POLL_TIMEOUT_MS, f as OCR_POLL_INTERVAL_MS, t as PAYABLE_PROJECTION_POLL_INTERVAL_MS, n as PAYABLE_PROJECTION_POLL_TIMEOUT_MS, o as beginApprovalRequestWatch, c as hasLiveScheduledRecord, i as invalidateApprovalDecisionQueries, s as invalidateDeletedPayableQueries, e as invalidatePayableQueries, r as nextPollInterval, p as payableOcrQueryOptions, a as reconcileApprovalDecisionQueries, l as reconcileCancelledPaymentQueries, d as reconcileSubmittedForApprovalQueries };
|
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.271", n = "8dab6570778b10180c6641788625a690f8f812c8", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|