@tesouro/embedded-components-react 0.3.37 → 0.3.39
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.d.ts +16 -0
- package/dist/lib/CardDetailsWidget.d.ts +16 -0
- package/dist/lib/CardsWidget.d.ts +16 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js +59 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +163 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +39 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +156 -138
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js +19 -8
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js +31 -15
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index5.js +12 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +151 -124
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +23 -23
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js
CHANGED
|
@@ -1,124 +1,236 @@
|
|
|
1
1
|
import { cancelAllClients as e, invalidateAllClients as t, removeInactiveFromAllClients as n } from "../../../shared/data-access/dist/lib/clientRegistry.js";
|
|
2
2
|
import { organizationHeaders as r } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getApprovalRequests as i, getPayablesId as a, getPayablesIdHistory as o, getPaymentRecords as s } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
4
4
|
import "../../../shared/data-access/dist/index.js";
|
|
5
|
-
import { isLiveScheduledPaymentRecord as
|
|
6
|
-
import { approvalRequestsInvalidationKey as
|
|
5
|
+
import { isLiveScheduledPaymentRecord as c } from "./index3.js";
|
|
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
|
|
8
|
+
async function v({ client: e, organizationId: n, payableId: r, includeLineItems: i, includeApprovalRequests: a }) {
|
|
9
9
|
let o = {
|
|
10
10
|
client: e,
|
|
11
11
|
organizationId: n
|
|
12
|
-
},
|
|
12
|
+
}, s = r ? {
|
|
13
13
|
...o,
|
|
14
14
|
payableId: r
|
|
15
|
-
} : void 0,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
...a ? [
|
|
19
|
-
...
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
} : void 0, c = [
|
|
16
|
+
_(o),
|
|
17
|
+
g(o),
|
|
18
|
+
...a ? [d(o)] : [],
|
|
19
|
+
...s ? [
|
|
20
|
+
p(s),
|
|
21
|
+
f(s),
|
|
22
|
+
h(s)
|
|
23
23
|
] : [],
|
|
24
|
-
...
|
|
24
|
+
...s && i ? [m(s)] : []
|
|
25
25
|
];
|
|
26
|
-
await Promise.all(
|
|
26
|
+
await Promise.all(c.map((e) => t(e)));
|
|
27
27
|
}
|
|
28
|
-
async function
|
|
28
|
+
async function y({ client: r, organizationId: i, payableId: a }) {
|
|
29
29
|
let o = {
|
|
30
30
|
client: r,
|
|
31
31
|
organizationId: i
|
|
32
32
|
};
|
|
33
|
-
if (await Promise.all([t(
|
|
33
|
+
if (await Promise.all([t(_(o)), t(g(o))]), !a) return;
|
|
34
34
|
let s = {
|
|
35
35
|
...o,
|
|
36
36
|
payableId: a
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
}, c = [
|
|
38
|
+
p(s),
|
|
39
|
+
f(s),
|
|
40
|
+
m(s)
|
|
41
41
|
];
|
|
42
|
-
await Promise.all(
|
|
42
|
+
await Promise.all(c.map((t) => e(t))), c.forEach((e) => n(e));
|
|
43
43
|
}
|
|
44
|
-
var
|
|
45
|
-
async function
|
|
46
|
-
await t(
|
|
44
|
+
var b = 2e4, x = 1e3, S = 1.5, C = 5e3, w = (e) => Math.min(e * S, C), T = /* @__PURE__ */ new Set(["new", "approve_in_progress"]), E = 6e4;
|
|
45
|
+
async function D({ client: e, organizationId: n, payableId: r }) {
|
|
46
|
+
await t(d({
|
|
47
47
|
client: e,
|
|
48
48
|
organizationId: n
|
|
49
|
-
})), await
|
|
50
|
-
setTimeout(e, g);
|
|
51
|
-
}), await m({
|
|
49
|
+
})), await v({
|
|
52
50
|
client: e,
|
|
53
51
|
organizationId: n,
|
|
54
52
|
payableId: r
|
|
55
53
|
});
|
|
56
54
|
}
|
|
57
|
-
var
|
|
58
|
-
async function
|
|
59
|
-
|
|
55
|
+
var O = 100;
|
|
56
|
+
async function k({ client: e, organizationId: t, payableId: n }) {
|
|
57
|
+
try {
|
|
58
|
+
let { data: a } = await i({
|
|
59
|
+
client: e,
|
|
60
|
+
headers: r(t),
|
|
61
|
+
query: {
|
|
62
|
+
object_id: n,
|
|
63
|
+
object_type: u,
|
|
64
|
+
order: l,
|
|
65
|
+
limit: O
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
return (a?.data ?? []).map((e) => `${e.id}:${e.status}`).sort().join(",");
|
|
69
|
+
} catch {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
var A = 3, j = 250;
|
|
74
|
+
async function M(e) {
|
|
75
|
+
let t = 0;
|
|
76
|
+
for (;;) {
|
|
77
|
+
let n = await F(e);
|
|
78
|
+
if (t += 1, n.readable || t >= A) return n;
|
|
79
|
+
await new Promise((e) => {
|
|
80
|
+
setTimeout(e, j * t);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
var N = "submitted_for_approval", P = 100;
|
|
85
|
+
async function F({ client: e, organizationId: t, payableId: n }) {
|
|
86
|
+
try {
|
|
87
|
+
let { data: i } = await o({
|
|
88
|
+
client: e,
|
|
89
|
+
headers: r(t),
|
|
90
|
+
path: { payable_id: n },
|
|
91
|
+
query: {
|
|
92
|
+
sort: "timestamp",
|
|
93
|
+
order: "asc",
|
|
94
|
+
limit: P
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
return {
|
|
98
|
+
readable: !0,
|
|
99
|
+
at: (i?.data ?? []).reduce((e, t) => t.event_type === N ? t.timestamp : e, void 0)
|
|
100
|
+
};
|
|
101
|
+
} catch {
|
|
102
|
+
return { readable: !1 };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async function I(e, { requireRoundMarker: t = !1 } = {}) {
|
|
106
|
+
let [n, r] = await Promise.all([k(e), t ? M(e) : void 0]), i = n, a = async () => {
|
|
107
|
+
if (!r?.readable) return !0;
|
|
108
|
+
let t = await F(e);
|
|
109
|
+
return t.readable && t.at !== r.at;
|
|
110
|
+
}, o = !1;
|
|
111
|
+
return { async poll() {
|
|
112
|
+
let t = await k(e);
|
|
113
|
+
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
|
+
} };
|
|
115
|
+
}
|
|
116
|
+
async function L({ client: e, organizationId: t, payableId: n, watch: i }) {
|
|
117
|
+
let o = Date.now() + E, s = x, c = !1;
|
|
118
|
+
for (; !c && Date.now() < o;) {
|
|
119
|
+
await new Promise((e) => {
|
|
120
|
+
setTimeout(e, s);
|
|
121
|
+
}), s = w(s);
|
|
122
|
+
try {
|
|
123
|
+
let { data: i } = await a({
|
|
124
|
+
client: e,
|
|
125
|
+
headers: r(t),
|
|
126
|
+
path: { payable_id: n }
|
|
127
|
+
});
|
|
128
|
+
c = !!(i?.status && !T.has(i.status));
|
|
129
|
+
} catch {}
|
|
130
|
+
if (!c) {
|
|
131
|
+
let r = await i.poll();
|
|
132
|
+
c = r === "changed", r === "resynced" && await v({
|
|
133
|
+
client: e,
|
|
134
|
+
organizationId: t,
|
|
135
|
+
payableId: n,
|
|
136
|
+
includeApprovalRequests: !0
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return await v({
|
|
141
|
+
client: e,
|
|
142
|
+
organizationId: t,
|
|
143
|
+
payableId: n,
|
|
144
|
+
includeApprovalRequests: !0
|
|
145
|
+
}), c;
|
|
146
|
+
}
|
|
147
|
+
var R = 15e4, z = 3e3;
|
|
148
|
+
async function B({ client: e, organizationId: t, payableId: n, watch: r }) {
|
|
149
|
+
let i = Date.now() + R, a = z, o = !1;
|
|
150
|
+
for (; !o && Date.now() < i;) {
|
|
151
|
+
await new Promise((e) => {
|
|
152
|
+
setTimeout(e, a);
|
|
153
|
+
}), a = w(a);
|
|
154
|
+
let i = await r.poll();
|
|
155
|
+
o = i === "changed", i === "resynced" && await v({
|
|
156
|
+
client: e,
|
|
157
|
+
organizationId: t,
|
|
158
|
+
payableId: n,
|
|
159
|
+
includeApprovalRequests: !0
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
return await v({
|
|
163
|
+
client: e,
|
|
164
|
+
organizationId: t,
|
|
165
|
+
payableId: n,
|
|
166
|
+
includeApprovalRequests: !0
|
|
167
|
+
}), o;
|
|
168
|
+
}
|
|
169
|
+
var V = 100;
|
|
170
|
+
async function H({ client: e, organizationId: t, payableId: n }) {
|
|
171
|
+
let r = Date.now() + b, i = !1;
|
|
60
172
|
for (; !i && Date.now() < r;) await new Promise((e) => {
|
|
61
|
-
setTimeout(e,
|
|
62
|
-
}), i = await
|
|
173
|
+
setTimeout(e, x);
|
|
174
|
+
}), i = await U({
|
|
63
175
|
client: e,
|
|
64
176
|
organizationId: t,
|
|
65
177
|
payableId: n
|
|
66
178
|
}) === !0;
|
|
67
|
-
return await
|
|
179
|
+
return await v({
|
|
68
180
|
client: e,
|
|
69
181
|
organizationId: t,
|
|
70
182
|
payableId: n
|
|
71
183
|
}), i;
|
|
72
184
|
}
|
|
73
|
-
async function
|
|
74
|
-
let i = /* @__PURE__ */ new Set(),
|
|
185
|
+
async function U({ client: e, organizationId: t, payableId: n }) {
|
|
186
|
+
let i = /* @__PURE__ */ new Set(), a;
|
|
75
187
|
try {
|
|
76
188
|
do {
|
|
77
|
-
let { data:
|
|
189
|
+
let { data: o } = await s({
|
|
78
190
|
client: e,
|
|
79
191
|
headers: r(t),
|
|
80
192
|
query: {
|
|
81
|
-
limit:
|
|
193
|
+
limit: V,
|
|
82
194
|
object_id__in: [n],
|
|
83
195
|
order: "desc",
|
|
84
196
|
sort: "paid_at",
|
|
85
197
|
is_external: !1,
|
|
86
|
-
...
|
|
198
|
+
...a ? { pagination_token: a } : {}
|
|
87
199
|
}
|
|
88
200
|
});
|
|
89
|
-
if ((
|
|
90
|
-
let l =
|
|
91
|
-
|
|
92
|
-
} while (
|
|
201
|
+
if ((o?.data ?? []).some(c)) return !0;
|
|
202
|
+
let l = o?.next_pagination_token ?? void 0;
|
|
203
|
+
a = l && !i.has(l) ? (i.add(l), l) : void 0;
|
|
204
|
+
} while (a);
|
|
93
205
|
return !1;
|
|
94
206
|
} catch {
|
|
95
207
|
return;
|
|
96
208
|
}
|
|
97
209
|
}
|
|
98
|
-
async function
|
|
99
|
-
let
|
|
100
|
-
for (; !o && Date.now() <
|
|
210
|
+
async function W({ client: e, organizationId: t, payableId: n }) {
|
|
211
|
+
let i = Date.now() + b, o = !1;
|
|
212
|
+
for (; !o && Date.now() < i;) {
|
|
101
213
|
await new Promise((e) => {
|
|
102
|
-
setTimeout(e,
|
|
214
|
+
setTimeout(e, x);
|
|
103
215
|
});
|
|
104
216
|
try {
|
|
105
|
-
let { data:
|
|
217
|
+
let { data: i } = await a({
|
|
106
218
|
client: e,
|
|
107
219
|
headers: r(t),
|
|
108
220
|
path: { payable_id: n }
|
|
109
221
|
});
|
|
110
|
-
o = !
|
|
222
|
+
o = !i?.scheduled_payment_date && await U({
|
|
111
223
|
client: e,
|
|
112
224
|
organizationId: t,
|
|
113
225
|
payableId: n
|
|
114
226
|
}) === !1;
|
|
115
227
|
} catch {}
|
|
116
228
|
}
|
|
117
|
-
return await
|
|
229
|
+
return await v({
|
|
118
230
|
client: e,
|
|
119
231
|
organizationId: t,
|
|
120
232
|
payableId: n
|
|
121
233
|
}), o;
|
|
122
234
|
}
|
|
123
235
|
//#endregion
|
|
124
|
-
export {
|
|
236
|
+
export { I as beginApprovalRequestWatch, D as invalidateApprovalDecisionQueries, y as invalidateDeletedPayableQueries, v as invalidatePayableQueries, L as reconcileApprovalDecisionQueries, W as reconcileCancelledPaymentQueries, H as reconcileScheduledPaymentQueries, B as reconcileSubmittedForApprovalQueries };
|
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js
CHANGED
|
@@ -8,28 +8,45 @@ import { postApprovalRequestsIdApprove as n, postApprovalRequestsIdReject as r }
|
|
|
8
8
|
import { getApprovalRequestsOptions as i } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
9
9
|
import { withAuthEpoch as a } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
10
10
|
import "../../../shared/data-access/dist/index.js";
|
|
11
|
-
import {
|
|
12
|
-
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";
|
|
13
14
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
headers: t(s),
|
|
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({
|
|
17
|
+
client: c,
|
|
18
|
+
headers: t(l),
|
|
19
19
|
query: {
|
|
20
20
|
object_id: n ?? "",
|
|
21
|
-
object_type:
|
|
22
|
-
order:
|
|
21
|
+
object_type: s,
|
|
22
|
+
order: o
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
-
return
|
|
26
|
-
...a(m,
|
|
25
|
+
return f({
|
|
26
|
+
...a(m, d),
|
|
27
27
|
enabled: p
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
function
|
|
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() {
|
|
31
48
|
let { client: r, organizationId: i } = e();
|
|
32
|
-
return
|
|
49
|
+
return d({
|
|
33
50
|
mutationFn: async ({ path: e }) => {
|
|
34
51
|
let { data: a } = await n({
|
|
35
52
|
client: r,
|
|
@@ -40,17 +57,18 @@ function f() {
|
|
|
40
57
|
return a;
|
|
41
58
|
},
|
|
42
59
|
onSuccess: async (e) => {
|
|
43
|
-
await
|
|
60
|
+
await m({
|
|
44
61
|
client: r,
|
|
45
62
|
organizationId: i,
|
|
46
|
-
payableId: e?.object_id
|
|
63
|
+
payableId: e?.object_id,
|
|
64
|
+
requestStatus: e?.status
|
|
47
65
|
});
|
|
48
66
|
}
|
|
49
67
|
});
|
|
50
68
|
}
|
|
51
|
-
function
|
|
69
|
+
function g() {
|
|
52
70
|
let { client: n, organizationId: i } = e();
|
|
53
|
-
return
|
|
71
|
+
return d({
|
|
54
72
|
mutationFn: async ({ path: e, body: a }) => {
|
|
55
73
|
let { data: o } = await r({
|
|
56
74
|
client: n,
|
|
@@ -62,13 +80,14 @@ function p() {
|
|
|
62
80
|
return o;
|
|
63
81
|
},
|
|
64
82
|
onSuccess: async (e) => {
|
|
65
|
-
await
|
|
83
|
+
await m({
|
|
66
84
|
client: n,
|
|
67
85
|
organizationId: i,
|
|
68
|
-
payableId: e?.object_id
|
|
86
|
+
payableId: e?.object_id,
|
|
87
|
+
requestStatus: e?.status
|
|
69
88
|
});
|
|
70
89
|
}
|
|
71
90
|
});
|
|
72
91
|
}
|
|
73
92
|
//#endregion
|
|
74
|
-
export {
|
|
93
|
+
export { h as useApprovePayableApprovalRequestMutation, p as usePayableApprovalRequestsQuery, g as useRejectPayableApprovalRequestMutation };
|
|
@@ -42,6 +42,7 @@ var a = t.Pending, o = [
|
|
|
42
42
|
], s = {
|
|
43
43
|
[t.Drafts]: [
|
|
44
44
|
e.Vendor,
|
|
45
|
+
e.Attachment,
|
|
45
46
|
e.IssueDate,
|
|
46
47
|
e.DueDate,
|
|
47
48
|
e.Status,
|
|
@@ -51,6 +52,7 @@ var a = t.Pending, o = [
|
|
|
51
52
|
],
|
|
52
53
|
[t.Pending]: [
|
|
53
54
|
e.Vendor,
|
|
55
|
+
e.Attachment,
|
|
54
56
|
e.IssueDate,
|
|
55
57
|
e.DueDate,
|
|
56
58
|
e.Status,
|
|
@@ -60,6 +62,7 @@ var a = t.Pending, o = [
|
|
|
60
62
|
],
|
|
61
63
|
[t.Scheduled]: [
|
|
62
64
|
e.Vendor,
|
|
65
|
+
e.Attachment,
|
|
63
66
|
e.IssueDate,
|
|
64
67
|
e.DueDate,
|
|
65
68
|
e.ScheduledDate,
|
|
@@ -70,6 +73,7 @@ var a = t.Pending, o = [
|
|
|
70
73
|
],
|
|
71
74
|
[t.Paid]: [
|
|
72
75
|
e.Vendor,
|
|
76
|
+
e.Attachment,
|
|
73
77
|
e.IssueDate,
|
|
74
78
|
e.DueDate,
|
|
75
79
|
e.PaidDate,
|
|
@@ -80,6 +84,7 @@ var a = t.Pending, o = [
|
|
|
80
84
|
],
|
|
81
85
|
[t.All]: [
|
|
82
86
|
e.Vendor,
|
|
87
|
+
e.Attachment,
|
|
83
88
|
e.IssueDate,
|
|
84
89
|
e.DueDate,
|
|
85
90
|
e.ScheduledDate,
|
|
@@ -7,6 +7,7 @@ var t = {
|
|
|
7
7
|
detailsSheet: "bill-pay-details-sheet"
|
|
8
8
|
}, n = {
|
|
9
9
|
[e.Vendor]: "bill-pay-bills-cell-vendor",
|
|
10
|
+
[e.Attachment]: "bill-pay-bills-cell-attachment",
|
|
10
11
|
[e.IssueDate]: "bill-pay-bills-cell-issue-date",
|
|
11
12
|
[e.DueDate]: "bill-pay-bills-cell-due-date",
|
|
12
13
|
[e.ScheduledDate]: "bill-pay-bills-cell-scheduled-date",
|