@tesouro/embedded-components-react 0.3.49 → 0.3.50
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/index.css +8 -2
- package/dist/index.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +39 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js +26 -311
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index12.js +325 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index13.js +13 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +20 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +75 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +36 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +80 -68
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +86 -73
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +77 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +18 -63
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +50 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +22 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +82 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +7 -42
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +15 -159
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +23 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +66 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +2 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +5 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +3 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +31 -63
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +23 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +37 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +161 -61
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +29 -130
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +1 -25
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +47 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +4 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +12 -55
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +13 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +63 -72
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +26 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +23 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +62 -93
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +133 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +20 -163
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +4 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +39 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +5 -210
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +70 -211
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +47 -103
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +92 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +34 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +59 -62
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +163 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +67 -181
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +20 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +203 -94
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +214 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +98 -312
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +16 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +49 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +29 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +183 -156
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +9 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +38 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +102 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +18 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +343 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +30 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +79 -88
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +179 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +3 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +2 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +38 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +6 -126
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +92 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +123 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +7 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +45 -250
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +69 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +21 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +27 -208
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +86 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +47 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +244 -106
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +115 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +201 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +115 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +44 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +94 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +19 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +28 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +1 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +6 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +119 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +24 -111
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +89 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +5 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +5 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +34 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +2 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +10 -104
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +105 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +2 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +15 -123
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +125 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +2 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +14 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +7 -167
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +170 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +2 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +11 -105
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +108 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +2 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +8 -45
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +47 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +23 -23
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +87 -71
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js
CHANGED
|
@@ -5,44 +5,56 @@ import "../../../shared/data-access/dist/index.js";
|
|
|
5
5
|
import { isLiveScheduledPaymentRecord as c } from "./index3.js";
|
|
6
6
|
import { NEWEST_REQUEST_FIRST as l, PAYABLE_OBJECT_TYPE as u, approvalRequestsInvalidationKey as d, payableHistoryInvalidationKey as f, payableInvalidationKey as p, payableLineItemsInvalidationKey as m, payablePaymentRecordsInvalidationKey as h, payablesAnalyticsInvalidationKey as g, payablesInvalidationKey as _ } from "./index4.js";
|
|
7
7
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js
|
|
8
|
-
async function v({ client: e, organizationId: n, payableId: r,
|
|
9
|
-
let
|
|
8
|
+
async function v({ client: e, organizationId: n, payableId: r, payableIds: i, deletedPayableIds: a, includeLineItems: o, includeApprovalRequests: s }) {
|
|
9
|
+
let c = {
|
|
10
10
|
client: e,
|
|
11
11
|
organizationId: n
|
|
12
|
-
},
|
|
13
|
-
...
|
|
14
|
-
payableId:
|
|
15
|
-
}
|
|
16
|
-
_(
|
|
17
|
-
g(
|
|
18
|
-
...
|
|
19
|
-
...
|
|
20
|
-
p(
|
|
21
|
-
f(
|
|
22
|
-
h(
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
}, l = new Set(a ?? []), u = [.../* @__PURE__ */ new Set([...i ?? [], r])].filter((e) => !!e && !l.has(e)).map((e) => ({
|
|
13
|
+
...c,
|
|
14
|
+
payableId: e
|
|
15
|
+
})), v = [
|
|
16
|
+
_(c),
|
|
17
|
+
g(c),
|
|
18
|
+
...s ? [d(c)] : [],
|
|
19
|
+
...u.flatMap((e) => [
|
|
20
|
+
p(e),
|
|
21
|
+
f(e),
|
|
22
|
+
h(e),
|
|
23
|
+
...o ? [m(e)] : []
|
|
24
|
+
])
|
|
25
25
|
];
|
|
26
|
-
await Promise.all(
|
|
26
|
+
await Promise.all(v.map((e) => t(e))), await Promise.all([...l].map((t) => y({
|
|
27
|
+
client: e,
|
|
28
|
+
organizationId: n,
|
|
29
|
+
payableId: t
|
|
30
|
+
})));
|
|
27
31
|
}
|
|
28
|
-
async function y({ client:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
p(s),
|
|
39
|
-
f(s),
|
|
40
|
-
m(s)
|
|
32
|
+
async function y({ client: t, organizationId: r, payableId: i }) {
|
|
33
|
+
if (!i) return;
|
|
34
|
+
let a = {
|
|
35
|
+
client: t,
|
|
36
|
+
organizationId: r,
|
|
37
|
+
payableId: i
|
|
38
|
+
}, o = [
|
|
39
|
+
p(a),
|
|
40
|
+
f(a),
|
|
41
|
+
m(a)
|
|
41
42
|
];
|
|
42
|
-
await Promise.all(
|
|
43
|
+
await Promise.all(o.map((t) => e(t))), o.forEach((e) => n(e));
|
|
44
|
+
}
|
|
45
|
+
async function b({ client: e, organizationId: n, payableId: r }) {
|
|
46
|
+
let i = {
|
|
47
|
+
client: e,
|
|
48
|
+
organizationId: n
|
|
49
|
+
};
|
|
50
|
+
await Promise.all([t(_(i)), t(g(i))]), await y({
|
|
51
|
+
client: e,
|
|
52
|
+
organizationId: n,
|
|
53
|
+
payableId: r
|
|
54
|
+
});
|
|
43
55
|
}
|
|
44
|
-
var
|
|
45
|
-
async function
|
|
56
|
+
var x = 2e4, S = 1e3, C = 1.5, w = 5e3, T = (e) => Math.min(e * C, w), E = /* @__PURE__ */ new Set(["new", "approve_in_progress"]), D = 6e4;
|
|
57
|
+
async function O({ client: e, organizationId: n, payableId: r }) {
|
|
46
58
|
await t(d({
|
|
47
59
|
client: e,
|
|
48
60
|
organizationId: n
|
|
@@ -52,8 +64,8 @@ async function D({ client: e, organizationId: n, payableId: r }) {
|
|
|
52
64
|
payableId: r
|
|
53
65
|
});
|
|
54
66
|
}
|
|
55
|
-
var
|
|
56
|
-
async function
|
|
67
|
+
var k = 100;
|
|
68
|
+
async function A({ client: e, organizationId: t, payableId: n }) {
|
|
57
69
|
try {
|
|
58
70
|
let { data: a } = await i({
|
|
59
71
|
client: e,
|
|
@@ -62,7 +74,7 @@ async function k({ client: e, organizationId: t, payableId: n }) {
|
|
|
62
74
|
object_id: n,
|
|
63
75
|
object_type: u,
|
|
64
76
|
order: l,
|
|
65
|
-
limit:
|
|
77
|
+
limit: k
|
|
66
78
|
}
|
|
67
79
|
});
|
|
68
80
|
return (a?.data ?? []).map((e) => `${e.id}:${e.status}`).sort().join(",");
|
|
@@ -70,19 +82,19 @@ async function k({ client: e, organizationId: t, payableId: n }) {
|
|
|
70
82
|
return;
|
|
71
83
|
}
|
|
72
84
|
}
|
|
73
|
-
var
|
|
74
|
-
async function
|
|
85
|
+
var j = 3, M = 250;
|
|
86
|
+
async function N(e) {
|
|
75
87
|
let t = 0;
|
|
76
88
|
for (;;) {
|
|
77
|
-
let n = await
|
|
78
|
-
if (t += 1, n.readable || t >=
|
|
89
|
+
let n = await I(e);
|
|
90
|
+
if (t += 1, n.readable || t >= j) return n;
|
|
79
91
|
await new Promise((e) => {
|
|
80
|
-
setTimeout(e,
|
|
92
|
+
setTimeout(e, M * t);
|
|
81
93
|
});
|
|
82
94
|
}
|
|
83
95
|
}
|
|
84
|
-
var
|
|
85
|
-
async function
|
|
96
|
+
var P = "submitted_for_approval", F = 100;
|
|
97
|
+
async function I({ client: e, organizationId: t, payableId: n }) {
|
|
86
98
|
try {
|
|
87
99
|
let { data: i } = await o({
|
|
88
100
|
client: e,
|
|
@@ -91,41 +103,41 @@ async function F({ client: e, organizationId: t, payableId: n }) {
|
|
|
91
103
|
query: {
|
|
92
104
|
sort: "timestamp",
|
|
93
105
|
order: "asc",
|
|
94
|
-
limit:
|
|
106
|
+
limit: F
|
|
95
107
|
}
|
|
96
108
|
});
|
|
97
109
|
return {
|
|
98
110
|
readable: !0,
|
|
99
|
-
at: (i?.data ?? []).reduce((e, t) => t.event_type ===
|
|
111
|
+
at: (i?.data ?? []).reduce((e, t) => t.event_type === P ? t.timestamp : e, void 0)
|
|
100
112
|
};
|
|
101
113
|
} catch {
|
|
102
114
|
return { readable: !1 };
|
|
103
115
|
}
|
|
104
116
|
}
|
|
105
|
-
async function
|
|
106
|
-
let [n, r] = await Promise.all([
|
|
117
|
+
async function L(e, { requireRoundMarker: t = !1 } = {}) {
|
|
118
|
+
let [n, r] = await Promise.all([A(e), t ? N(e) : void 0]), i = n, a = async () => {
|
|
107
119
|
if (!r?.readable) return !0;
|
|
108
|
-
let t = await
|
|
120
|
+
let t = await I(e);
|
|
109
121
|
return t.readable && t.at !== r.at;
|
|
110
122
|
}, o = !1;
|
|
111
123
|
return { async poll() {
|
|
112
|
-
let t = await
|
|
124
|
+
let t = await A(e);
|
|
113
125
|
return t !== void 0 && i === void 0 ? (i = t, o = !0, await a() ? "changed" : "resynced") : (t !== void 0 && t !== i && (o = !0), o && await a() ? "changed" : "unchanged");
|
|
114
126
|
} };
|
|
115
127
|
}
|
|
116
|
-
async function
|
|
117
|
-
let o = Date.now() +
|
|
128
|
+
async function R({ client: e, organizationId: t, payableId: n, watch: i }) {
|
|
129
|
+
let o = Date.now() + D, s = S, c = !1;
|
|
118
130
|
for (; !c && Date.now() < o;) {
|
|
119
131
|
await new Promise((e) => {
|
|
120
132
|
setTimeout(e, s);
|
|
121
|
-
}), s =
|
|
133
|
+
}), s = T(s);
|
|
122
134
|
try {
|
|
123
135
|
let { data: i } = await a({
|
|
124
136
|
client: e,
|
|
125
137
|
headers: r(t),
|
|
126
138
|
path: { payable_id: n }
|
|
127
139
|
});
|
|
128
|
-
c = !!(i?.status && !
|
|
140
|
+
c = !!(i?.status && !E.has(i.status));
|
|
129
141
|
} catch {}
|
|
130
142
|
if (!c) {
|
|
131
143
|
let r = await i.poll();
|
|
@@ -144,13 +156,13 @@ async function L({ client: e, organizationId: t, payableId: n, watch: i }) {
|
|
|
144
156
|
includeApprovalRequests: !0
|
|
145
157
|
}), c;
|
|
146
158
|
}
|
|
147
|
-
var
|
|
148
|
-
async function
|
|
149
|
-
let i = Date.now() +
|
|
159
|
+
var z = 15e4, B = 3e3;
|
|
160
|
+
async function V({ client: e, organizationId: t, payableId: n, watch: r }) {
|
|
161
|
+
let i = Date.now() + z, a = B, o = !1;
|
|
150
162
|
for (; !o && Date.now() < i;) {
|
|
151
163
|
await new Promise((e) => {
|
|
152
164
|
setTimeout(e, a);
|
|
153
|
-
}), a =
|
|
165
|
+
}), a = T(a);
|
|
154
166
|
let i = await r.poll();
|
|
155
167
|
o = i === "changed", i === "resynced" && await v({
|
|
156
168
|
client: e,
|
|
@@ -166,12 +178,12 @@ async function B({ client: e, organizationId: t, payableId: n, watch: r }) {
|
|
|
166
178
|
includeApprovalRequests: !0
|
|
167
179
|
}), o;
|
|
168
180
|
}
|
|
169
|
-
var
|
|
170
|
-
async function
|
|
171
|
-
let r = Date.now() +
|
|
181
|
+
var H = 100;
|
|
182
|
+
async function U({ client: e, organizationId: t, payableId: n }) {
|
|
183
|
+
let r = Date.now() + x, i = !1;
|
|
172
184
|
for (; !i && Date.now() < r;) await new Promise((e) => {
|
|
173
|
-
setTimeout(e,
|
|
174
|
-
}), i = await
|
|
185
|
+
setTimeout(e, S);
|
|
186
|
+
}), i = await W({
|
|
175
187
|
client: e,
|
|
176
188
|
organizationId: t,
|
|
177
189
|
payableId: n
|
|
@@ -182,7 +194,7 @@ async function H({ client: e, organizationId: t, payableId: n }) {
|
|
|
182
194
|
payableId: n
|
|
183
195
|
}), i;
|
|
184
196
|
}
|
|
185
|
-
async function
|
|
197
|
+
async function W({ client: e, organizationId: t, payableId: n }) {
|
|
186
198
|
let i = /* @__PURE__ */ new Set(), a;
|
|
187
199
|
try {
|
|
188
200
|
do {
|
|
@@ -190,7 +202,7 @@ async function U({ client: e, organizationId: t, payableId: n }) {
|
|
|
190
202
|
client: e,
|
|
191
203
|
headers: r(t),
|
|
192
204
|
query: {
|
|
193
|
-
limit:
|
|
205
|
+
limit: H,
|
|
194
206
|
object_id__in: [n],
|
|
195
207
|
order: "desc",
|
|
196
208
|
sort: "paid_at",
|
|
@@ -207,11 +219,11 @@ async function U({ client: e, organizationId: t, payableId: n }) {
|
|
|
207
219
|
return;
|
|
208
220
|
}
|
|
209
221
|
}
|
|
210
|
-
async function
|
|
211
|
-
let i = Date.now() +
|
|
222
|
+
async function G({ client: e, organizationId: t, payableId: n }) {
|
|
223
|
+
let i = Date.now() + x, o = !1;
|
|
212
224
|
for (; !o && Date.now() < i;) {
|
|
213
225
|
await new Promise((e) => {
|
|
214
|
-
setTimeout(e,
|
|
226
|
+
setTimeout(e, S);
|
|
215
227
|
});
|
|
216
228
|
try {
|
|
217
229
|
let { data: i } = await a({
|
|
@@ -219,7 +231,7 @@ async function W({ client: e, organizationId: t, payableId: n }) {
|
|
|
219
231
|
headers: r(t),
|
|
220
232
|
path: { payable_id: n }
|
|
221
233
|
});
|
|
222
|
-
o = !i?.scheduled_payment_date && await
|
|
234
|
+
o = !i?.scheduled_payment_date && await W({
|
|
223
235
|
client: e,
|
|
224
236
|
organizationId: t,
|
|
225
237
|
payableId: n
|
|
@@ -233,4 +245,4 @@ async function W({ client: e, organizationId: t, payableId: n }) {
|
|
|
233
245
|
}), o;
|
|
234
246
|
}
|
|
235
247
|
//#endregion
|
|
236
|
-
export {
|
|
248
|
+
export { L as beginApprovalRequestWatch, O as invalidateApprovalDecisionQueries, b as invalidateDeletedPayableQueries, v as invalidatePayableQueries, R as reconcileApprovalDecisionQueries, G as reconcileCancelledPaymentQueries, U as reconcileScheduledPaymentQueries, V as reconcileSubmittedForApprovalQueries };
|
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js
CHANGED
|
@@ -4,90 +4,103 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
6
|
import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
7
|
-
import {
|
|
8
|
-
import { getApprovalRequestsOptions as i } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
9
|
-
import { withAuthEpoch as a } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
7
|
+
import { deletePayablesId as n, postPayablesIdCancel as r, postPayablesIdDuplicatesIdConfirm as i, postPayablesIdDuplicatesIdDismiss as a } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
10
8
|
import "../../../shared/data-access/dist/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { useMutation as d, useQuery as f } from "@tanstack/react-query";
|
|
9
|
+
import { invalidatePayableQueries as o } from "./index5.js";
|
|
10
|
+
import { useMutation as s } from "@tanstack/react-query";
|
|
14
11
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
return f({
|
|
26
|
-
...a(m, d),
|
|
27
|
-
enabled: p
|
|
28
|
-
});
|
|
12
|
+
var c = [
|
|
13
|
+
"suspected",
|
|
14
|
+
"dismissed",
|
|
15
|
+
"confirmed"
|
|
16
|
+
];
|
|
17
|
+
function l(e) {
|
|
18
|
+
if (typeof e != "object" || !e) return !1;
|
|
19
|
+
let t = e;
|
|
20
|
+
return typeof t.id == "string" && typeof t.matched_payable_id == "string" && c.includes(t.status);
|
|
29
21
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
client: e,
|
|
33
|
-
organizationId: t,
|
|
34
|
-
payableId: n
|
|
35
|
-
}) : void 0;
|
|
36
|
-
await l({
|
|
37
|
-
client: e,
|
|
38
|
-
organizationId: t,
|
|
39
|
-
payableId: n
|
|
40
|
-
}), !(!n || !i) && u({
|
|
41
|
-
client: e,
|
|
42
|
-
organizationId: t,
|
|
43
|
-
payableId: n,
|
|
44
|
-
watch: i
|
|
45
|
-
}).catch(() => {});
|
|
22
|
+
function u(e) {
|
|
23
|
+
return Array.isArray(e?.duplicates) ? e.duplicates.filter(l) : [];
|
|
46
24
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
requestStatus: e?.status
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
});
|
|
25
|
+
function d(e) {
|
|
26
|
+
return u(e).filter((e) => e.status === "suspected");
|
|
27
|
+
}
|
|
28
|
+
function f(e) {
|
|
29
|
+
return d(e).length > 0;
|
|
30
|
+
}
|
|
31
|
+
var p = {
|
|
32
|
+
Keep: "keep",
|
|
33
|
+
Remove: "remove"
|
|
34
|
+
}, m = class extends Error {
|
|
35
|
+
applied;
|
|
36
|
+
constructor(e, t) {
|
|
37
|
+
super("A duplicate verdict batch failed partway through.", { cause: t }), this.name = "DuplicateVerdictBatchError", this.applied = e;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
function h(e) {
|
|
41
|
+
return e.payableIds.length > 0 || e.deletedPayableIds.length > 0;
|
|
68
42
|
}
|
|
69
43
|
function g() {
|
|
70
|
-
let { client:
|
|
71
|
-
return
|
|
72
|
-
mutationFn: async ({
|
|
73
|
-
let
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
path: e,
|
|
77
|
-
body: a?.reject_reason ? a : void 0,
|
|
78
|
-
throwOnError: !0
|
|
44
|
+
let { client: c, organizationId: l } = e();
|
|
45
|
+
return s({
|
|
46
|
+
mutationFn: async ({ verdict: e, targets: o }) => {
|
|
47
|
+
let s = t(l), u = [], d = [], f = () => o.filter((e) => e.matchedPayableId !== void 0 && d.includes(e.payableId) && !d.includes(e.matchedPayableId)).map((e) => e.matchedPayableId), h = () => ({
|
|
48
|
+
payableIds: [.../* @__PURE__ */ new Set([...u, ...f()])],
|
|
49
|
+
deletedPayableIds: [...new Set(d)]
|
|
79
50
|
});
|
|
80
|
-
|
|
51
|
+
try {
|
|
52
|
+
let t = /* @__PURE__ */ new Set();
|
|
53
|
+
if (e === p.Remove) {
|
|
54
|
+
for (let e of o) if (!t.has(e.payableId)) {
|
|
55
|
+
if (t.add(e.payableId), e.removeBy === "delete") {
|
|
56
|
+
await n({
|
|
57
|
+
client: c,
|
|
58
|
+
headers: s,
|
|
59
|
+
path: { payable_id: e.payableId },
|
|
60
|
+
throwOnError: !0
|
|
61
|
+
}), d.push(e.payableId);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
e.removeBy === "cancel" && (await r({
|
|
65
|
+
client: c,
|
|
66
|
+
headers: s,
|
|
67
|
+
path: { payable_id: e.payableId },
|
|
68
|
+
throwOnError: !0
|
|
69
|
+
}), u.push(e.payableId));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
let l = /* @__PURE__ */ new Set(), f = e === p.Remove ? i : a;
|
|
73
|
+
for (let e of o) l.has(e.duplicateId) || d.includes(e.payableId) || e.matchedPayableId && d.includes(e.matchedPayableId) || (l.add(e.duplicateId), await f({
|
|
74
|
+
client: c,
|
|
75
|
+
headers: s,
|
|
76
|
+
path: {
|
|
77
|
+
payable_id: e.payableId,
|
|
78
|
+
duplicate_id: e.duplicateId
|
|
79
|
+
},
|
|
80
|
+
throwOnError: !0
|
|
81
|
+
}), u.push(e.payableId), e.matchedPayableId && u.push(e.matchedPayableId));
|
|
82
|
+
} catch (e) {
|
|
83
|
+
throw new m(h(), e);
|
|
84
|
+
}
|
|
85
|
+
return h();
|
|
81
86
|
},
|
|
82
87
|
onSuccess: async (e) => {
|
|
83
|
-
await
|
|
84
|
-
client:
|
|
85
|
-
organizationId:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
await o({
|
|
89
|
+
client: c,
|
|
90
|
+
organizationId: l,
|
|
91
|
+
payableIds: e.payableIds,
|
|
92
|
+
deletedPayableIds: e.deletedPayableIds
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
onError: async (e) => {
|
|
96
|
+
!(e instanceof m) || !h(e.applied) || await o({
|
|
97
|
+
client: c,
|
|
98
|
+
organizationId: l,
|
|
99
|
+
payableIds: e.applied.payableIds,
|
|
100
|
+
deletedPayableIds: e.applied.deletedPayableIds
|
|
88
101
|
});
|
|
89
102
|
}
|
|
90
103
|
});
|
|
91
104
|
}
|
|
92
105
|
//#endregion
|
|
93
|
-
export {
|
|
106
|
+
export { p as DuplicateVerdict, m as DuplicateVerdictBatchError, f as hasSuspectedPayableDuplicate, u as readPayableDuplicates, d as suspectedPayableDuplicates, g as useApplyDuplicateVerdictsMutation };
|
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js
CHANGED
|
@@ -4,27 +4,90 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
6
|
import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { postApprovalRequestsIdApprove as n, postApprovalRequestsIdReject as r } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
8
|
+
import { getApprovalRequestsOptions as i } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
9
|
+
import { withAuthEpoch as a } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
9
10
|
import "../../../shared/data-access/dist/index.js";
|
|
10
|
-
import {
|
|
11
|
+
import { NEWEST_REQUEST_FIRST as o, PAYABLE_OBJECT_TYPE as s } from "./index4.js";
|
|
12
|
+
import { beginApprovalRequestWatch as c, invalidateApprovalDecisionQueries as l, reconcileApprovalDecisionQueries as u } from "./index5.js";
|
|
13
|
+
import { useMutation as d, useQuery as f } from "@tanstack/react-query";
|
|
11
14
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let { client: c, organizationId: l, widgetToken: u, authEpoch: d } = e(), f = !!(l && u && o) && s !== !1, p = n({
|
|
15
|
+
function p(n, { enabled: r } = {}) {
|
|
16
|
+
let { client: c, organizationId: l, widgetToken: u, authEpoch: d } = e(), p = !!(l && u && n) && r !== !1, m = i({
|
|
15
17
|
client: c,
|
|
16
18
|
headers: t(l),
|
|
17
|
-
path: { payable_id: o ?? "" },
|
|
18
19
|
query: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
object_id: n ?? "",
|
|
21
|
+
object_type: s,
|
|
22
|
+
order: o
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
|
-
return
|
|
25
|
-
...
|
|
26
|
-
enabled:
|
|
25
|
+
return f({
|
|
26
|
+
...a(m, d),
|
|
27
|
+
enabled: p
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
async function m({ client: e, organizationId: t, payableId: n, requestStatus: r }) {
|
|
31
|
+
let i = n && r !== "waiting" && n ? await c({
|
|
32
|
+
client: e,
|
|
33
|
+
organizationId: t,
|
|
34
|
+
payableId: n
|
|
35
|
+
}) : void 0;
|
|
36
|
+
await l({
|
|
37
|
+
client: e,
|
|
38
|
+
organizationId: t,
|
|
39
|
+
payableId: n
|
|
40
|
+
}), !(!n || !i) && u({
|
|
41
|
+
client: e,
|
|
42
|
+
organizationId: t,
|
|
43
|
+
payableId: n,
|
|
44
|
+
watch: i
|
|
45
|
+
}).catch(() => {});
|
|
46
|
+
}
|
|
47
|
+
function h() {
|
|
48
|
+
let { client: r, organizationId: i } = e();
|
|
49
|
+
return d({
|
|
50
|
+
mutationFn: async ({ path: e }) => {
|
|
51
|
+
let { data: a } = await n({
|
|
52
|
+
client: r,
|
|
53
|
+
headers: t(i),
|
|
54
|
+
path: e,
|
|
55
|
+
throwOnError: !0
|
|
56
|
+
});
|
|
57
|
+
return a;
|
|
58
|
+
},
|
|
59
|
+
onSuccess: async (e) => {
|
|
60
|
+
await m({
|
|
61
|
+
client: r,
|
|
62
|
+
organizationId: i,
|
|
63
|
+
payableId: e?.object_id,
|
|
64
|
+
requestStatus: e?.status
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function g() {
|
|
70
|
+
let { client: n, organizationId: i } = e();
|
|
71
|
+
return d({
|
|
72
|
+
mutationFn: async ({ path: e, body: a }) => {
|
|
73
|
+
let { data: o } = await r({
|
|
74
|
+
client: n,
|
|
75
|
+
headers: t(i),
|
|
76
|
+
path: e,
|
|
77
|
+
body: a?.reject_reason ? a : void 0,
|
|
78
|
+
throwOnError: !0
|
|
79
|
+
});
|
|
80
|
+
return o;
|
|
81
|
+
},
|
|
82
|
+
onSuccess: async (e) => {
|
|
83
|
+
await m({
|
|
84
|
+
client: n,
|
|
85
|
+
organizationId: i,
|
|
86
|
+
payableId: e?.object_id,
|
|
87
|
+
requestStatus: e?.status
|
|
88
|
+
});
|
|
89
|
+
}
|
|
27
90
|
});
|
|
28
91
|
}
|
|
29
92
|
//#endregion
|
|
30
|
-
export {
|
|
93
|
+
export { h as useApprovePayableApprovalRequestMutation, p as usePayableApprovalRequestsQuery, g as useRejectPayableApprovalRequestMutation };
|
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js
CHANGED
|
@@ -4,72 +4,27 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
6
|
import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { withAuthEpoch as a } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
10
|
-
import { getAllPagesNextPaginationTokenParam as o, isAllPagesResolving as s, useAutoFetchNextPage as c } from "../../../shared/data-access/dist/lib/allPages.js";
|
|
7
|
+
import { getPayablesIdHistoryOptions as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
8
|
+
import { withAuthEpoch as r } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
11
9
|
import "../../../shared/data-access/dist/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import { useMemo as u } from "react";
|
|
14
|
-
import { useInfiniteQuery as d, useMutation as f } from "@tanstack/react-query";
|
|
10
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
15
11
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
let { client:
|
|
19
|
-
client:
|
|
20
|
-
headers:
|
|
21
|
-
path: { payable_id:
|
|
22
|
-
query: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
initialPageParam: void 0,
|
|
27
|
-
queryFn: async ({ signal: e, pageParam: t }) => {
|
|
28
|
-
let { data: i } = await n({
|
|
29
|
-
client: f,
|
|
30
|
-
headers: _,
|
|
31
|
-
path: { payable_id: r ?? "" },
|
|
32
|
-
query: {
|
|
33
|
-
limit: p,
|
|
34
|
-
...t ? { pagination_token: t } : {}
|
|
35
|
-
},
|
|
36
|
-
signal: e,
|
|
37
|
-
throwOnError: !0
|
|
38
|
-
});
|
|
39
|
-
return i;
|
|
40
|
-
},
|
|
41
|
-
getNextPageParam: o
|
|
42
|
-
});
|
|
43
|
-
c(b, v);
|
|
44
|
-
let x = u(() => b.data?.pages.flatMap((e) => e.data ?? []) ?? [], [b.data]);
|
|
45
|
-
return {
|
|
46
|
-
...b,
|
|
47
|
-
lineItems: x,
|
|
48
|
-
isResolving: s(b)
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function h() {
|
|
52
|
-
let { client: n, organizationId: i } = e();
|
|
53
|
-
return f({
|
|
54
|
-
mutationFn: async ({ path: e, body: a }) => {
|
|
55
|
-
let { data: o } = await r({
|
|
56
|
-
client: n,
|
|
57
|
-
headers: t(i),
|
|
58
|
-
path: e,
|
|
59
|
-
body: a,
|
|
60
|
-
throwOnError: !0
|
|
61
|
-
});
|
|
62
|
-
return o;
|
|
63
|
-
},
|
|
64
|
-
onSuccess: async (e, t) => {
|
|
65
|
-
await l({
|
|
66
|
-
client: n,
|
|
67
|
-
organizationId: i,
|
|
68
|
-
payableId: t.path.payable_id,
|
|
69
|
-
includeLineItems: !0
|
|
70
|
-
});
|
|
12
|
+
var a = 100;
|
|
13
|
+
function o(o, { enabled: s } = {}) {
|
|
14
|
+
let { client: c, organizationId: l, widgetToken: u, authEpoch: d } = e(), f = !!(l && u && o) && s !== !1, p = n({
|
|
15
|
+
client: c,
|
|
16
|
+
headers: t(l),
|
|
17
|
+
path: { payable_id: o ?? "" },
|
|
18
|
+
query: {
|
|
19
|
+
sort: "timestamp",
|
|
20
|
+
order: "asc",
|
|
21
|
+
limit: a
|
|
71
22
|
}
|
|
72
23
|
});
|
|
24
|
+
return i({
|
|
25
|
+
...r(p, d),
|
|
26
|
+
enabled: f
|
|
27
|
+
});
|
|
73
28
|
}
|
|
74
29
|
//#endregion
|
|
75
|
-
export {
|
|
30
|
+
export { o as usePayableHistoryQuery };
|