@tesouro/embedded-components-react 0.5.231 → 0.5.233
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/README.md +1 -0
- package/dist/index.css +4 -0
- package/dist/index.d.ts +105 -2
- package/dist/index.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +105 -2
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +92 -55
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +67 -142
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +186 -17
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js +27 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +45 -74
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +68 -53
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +66 -32
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +28 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +24 -166
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +177 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +42 -95
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +36 -33
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +38 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +206 -147
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +39 -58
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +53 -227
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +216 -287
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +453 -43
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +103 -126
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +122 -146
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +145 -41
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +39 -115
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +113 -90
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +81 -98
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +111 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +26 -633
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +639 -39
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +41 -40
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +35 -74
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index34.js +73 -130
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index35.js +133 -329
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index36.js +345 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +13 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +15 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +35 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +8 -71
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +70 -17
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +31 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +18 -30
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +12 -301
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +33 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +14 -46
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +23 -67
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +76 -485
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +395 -95
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +48 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +72 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +496 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +97 -91
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +2 -236
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +1 -249
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +89 -82
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +23 -54
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +223 -340
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +249 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +93 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +59 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +353 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +18 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +41 -41
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/clientRegistry.js +6 -3
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +75 -43
- 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/invoicing-widget/ui/dist/index36.js +0 -28
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js
CHANGED
|
@@ -2,164 +2,89 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { useEmbedApi as l } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
10
|
-
import { organizationHeaders as u } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
5
|
+
import { getReceivablesIdOptions as e, getReceivablesIdPdfLinkOptions as t, getReceivablesOptions as n, getReceivablesRequiredFieldsOptions as r } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
6
|
+
import { withAuthEpoch as i } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
7
|
+
import { useEmbedApi as a } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
+
import { organizationHeaders as o } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
11
9
|
import "../../../shared/data-access/dist/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import { invalidateReceivable as h } from "./index5.js";
|
|
14
|
-
import { useMutation as g, useQuery as _ } from "@tanstack/react-query";
|
|
10
|
+
import { useQueries as s, useQuery as c } from "@tanstack/react-query";
|
|
15
11
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js
|
|
16
|
-
function
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function y({ enabled: e = !0 } = {}) {
|
|
24
|
-
let { client: t, organizationId: n, authEpoch: r, organizationStatus: i, isEnabled: o } = v(), c = a({
|
|
25
|
-
client: t,
|
|
26
|
-
headers: u(n)
|
|
12
|
+
function l({ enabled: e, ...t } = {}) {
|
|
13
|
+
let { client: r, organizationId: s, widgetToken: l, authEpoch: u, organizationStatus: d } = a(), f = !!(s && l) && (e === !0 || e === void 0), p = n({
|
|
14
|
+
client: r,
|
|
15
|
+
headers: o(s),
|
|
16
|
+
query: t
|
|
27
17
|
});
|
|
28
|
-
return
|
|
29
|
-
...
|
|
30
|
-
authEpoch:
|
|
31
|
-
organizationStatus:
|
|
32
|
-
}),
|
|
33
|
-
enabled:
|
|
18
|
+
return c({
|
|
19
|
+
...i(p, {
|
|
20
|
+
authEpoch: u,
|
|
21
|
+
organizationStatus: d
|
|
22
|
+
}, { carryWithinOrg: !0 }),
|
|
23
|
+
enabled: f
|
|
34
24
|
});
|
|
35
25
|
}
|
|
36
|
-
function
|
|
37
|
-
let { client:
|
|
38
|
-
client:
|
|
39
|
-
headers:
|
|
26
|
+
function u(t, { enabled: n = !0 } = {}) {
|
|
27
|
+
let { client: r, organizationId: s, widgetToken: l, authEpoch: u, organizationStatus: d } = a(), f = !!(s && l && t) && n, p = e({
|
|
28
|
+
client: r,
|
|
29
|
+
headers: o(s),
|
|
30
|
+
path: { receivable_id: t ?? "" }
|
|
40
31
|
});
|
|
41
|
-
return
|
|
42
|
-
...
|
|
43
|
-
authEpoch:
|
|
44
|
-
organizationStatus:
|
|
32
|
+
return c({
|
|
33
|
+
...i(p, {
|
|
34
|
+
authEpoch: u,
|
|
35
|
+
organizationStatus: d
|
|
45
36
|
}),
|
|
46
|
-
enabled:
|
|
37
|
+
enabled: f
|
|
47
38
|
});
|
|
48
39
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
client: e,
|
|
64
|
-
organizationId: t
|
|
65
|
-
}));
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
function S() {
|
|
70
|
-
let { client: e, organizationId: n } = l();
|
|
71
|
-
return g({
|
|
72
|
-
mutationFn: async ({ body: r }) => {
|
|
73
|
-
let { data: i } = await t({
|
|
74
|
-
client: e,
|
|
75
|
-
headers: u(n),
|
|
76
|
-
body: r,
|
|
77
|
-
throwOnError: !0
|
|
78
|
-
});
|
|
79
|
-
return i;
|
|
80
|
-
},
|
|
81
|
-
onSuccess: async () => {
|
|
82
|
-
await c(d({
|
|
83
|
-
client: e,
|
|
84
|
-
organizationId: n
|
|
85
|
-
}));
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
async function C({ client: e, organizationId: t, recurrenceId: n, receivableId: r }) {
|
|
90
|
-
await Promise.all([
|
|
91
|
-
c(m({
|
|
92
|
-
client: e,
|
|
93
|
-
organizationId: t
|
|
40
|
+
var d = (e) => e.map((e) => e.data);
|
|
41
|
+
function f(t, { enabled: n = !0 } = {}) {
|
|
42
|
+
let { client: r, organizationId: c, widgetToken: l, authEpoch: u, organizationStatus: f } = a(), p = !!(c && l) && n;
|
|
43
|
+
return s({
|
|
44
|
+
queries: t.map((t) => ({
|
|
45
|
+
...i(e({
|
|
46
|
+
client: r,
|
|
47
|
+
headers: o(c),
|
|
48
|
+
path: { receivable_id: t }
|
|
49
|
+
}), {
|
|
50
|
+
authEpoch: u,
|
|
51
|
+
organizationStatus: f
|
|
52
|
+
}),
|
|
53
|
+
enabled: p
|
|
94
54
|
})),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
organizationId: t,
|
|
98
|
-
recurrenceId: n
|
|
99
|
-
}))] : [],
|
|
100
|
-
h({
|
|
101
|
-
client: e,
|
|
102
|
-
organizationId: t,
|
|
103
|
-
receivableId: r
|
|
104
|
-
})
|
|
105
|
-
]);
|
|
55
|
+
combine: d
|
|
56
|
+
});
|
|
106
57
|
}
|
|
107
|
-
function
|
|
108
|
-
let { client:
|
|
109
|
-
client:
|
|
110
|
-
headers:
|
|
111
|
-
|
|
58
|
+
function p({ enabled: e, ...t } = {}) {
|
|
59
|
+
let { client: n, organizationId: s, widgetToken: l, authEpoch: u, organizationStatus: d } = a(), f = !!(s && l) && (e === !0 || e === void 0), p = r({
|
|
60
|
+
client: n,
|
|
61
|
+
headers: o(s),
|
|
62
|
+
query: t
|
|
112
63
|
});
|
|
113
|
-
return
|
|
114
|
-
...
|
|
115
|
-
authEpoch:
|
|
116
|
-
organizationStatus:
|
|
64
|
+
return c({
|
|
65
|
+
...i(p, {
|
|
66
|
+
authEpoch: u,
|
|
67
|
+
organizationStatus: d
|
|
117
68
|
}),
|
|
118
|
-
enabled:
|
|
69
|
+
enabled: f
|
|
119
70
|
});
|
|
120
71
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
headers: u(t),
|
|
128
|
-
body: n,
|
|
129
|
-
throwOnError: !0
|
|
130
|
-
});
|
|
131
|
-
return i;
|
|
132
|
-
},
|
|
133
|
-
onSuccess: async (n, r) => {
|
|
134
|
-
await C({
|
|
135
|
-
client: e,
|
|
136
|
-
organizationId: t,
|
|
137
|
-
receivableId: r.body.invoice_id
|
|
138
|
-
});
|
|
139
|
-
}
|
|
72
|
+
var m = 1e3, h = 30;
|
|
73
|
+
function g(e, { enabled: n = !0 } = {}) {
|
|
74
|
+
let { client: r, organizationId: s, widgetToken: l, authEpoch: u, organizationStatus: d } = a(), f = !!(s && l && e) && n, p = t({
|
|
75
|
+
client: r,
|
|
76
|
+
headers: o(s),
|
|
77
|
+
path: { receivable_id: e ?? "" }
|
|
140
78
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
path: r,
|
|
150
|
-
body: i,
|
|
151
|
-
throwOnError: !0
|
|
152
|
-
});
|
|
153
|
-
return a;
|
|
154
|
-
},
|
|
155
|
-
onSuccess: async (e, r) => {
|
|
156
|
-
await C({
|
|
157
|
-
client: t,
|
|
158
|
-
organizationId: n,
|
|
159
|
-
recurrenceId: r.path.recurrence_id
|
|
160
|
-
});
|
|
161
|
-
}
|
|
79
|
+
return c({
|
|
80
|
+
...i(p, {
|
|
81
|
+
authEpoch: u,
|
|
82
|
+
organizationStatus: d
|
|
83
|
+
}),
|
|
84
|
+
enabled: f,
|
|
85
|
+
refetchInterval: ({ state: e }) => e.data?.file_url || e.dataUpdateCount + e.errorUpdateCount > h ? !1 : m,
|
|
86
|
+
refetchIntervalInBackground: !0
|
|
162
87
|
});
|
|
163
88
|
}
|
|
164
89
|
//#endregion
|
|
165
|
-
export {
|
|
90
|
+
export { g as useReceivablePdfLinkQuery, u as useReceivableQuery, p as useReceivableRequiredFieldsQuery, f as useReceivablesByIdQueries, l as useReceivablesQuery };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js
CHANGED
|
@@ -2,26 +2,195 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { patchRecurrencesId as e, postOverdueReminders as t, postPaymentReminders as n, postRecurrences as r, postRecurrencesIdCancel as i, postRecurrencesIdPause as a, postRecurrencesIdResume as o } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
|
+
import { getOverdueRemindersOptions as s, getPaymentRemindersOptions as c, getRecurrencesIdOptions as l } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
7
|
+
import { withAuthEpoch as u } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
8
|
+
import { invalidateAllClients as d } from "../../../shared/data-access/dist/lib/clientRegistry.js";
|
|
9
|
+
import { useEmbedApi as f } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
10
|
+
import { organizationHeaders as p } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
9
11
|
import "../../../shared/data-access/dist/index.js";
|
|
10
|
-
import {
|
|
12
|
+
import { overdueRemindersInvalidationKey as m, paymentRemindersInvalidationKey as h, recurrenceInvalidationKey as g, recurrencesInvalidationKey as _ } from "./index2.js";
|
|
13
|
+
import { invalidateReceivable as v } from "./index6.js";
|
|
14
|
+
import { useMutation as y, useQuery as b } from "@tanstack/react-query";
|
|
11
15
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
function x() {
|
|
17
|
+
let e = f();
|
|
18
|
+
return {
|
|
19
|
+
...e,
|
|
20
|
+
isEnabled: !!(e.organizationId && e.widgetToken)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function S({ enabled: e = !0 } = {}) {
|
|
24
|
+
let { client: t, organizationId: n, authEpoch: r, organizationStatus: i, isEnabled: a } = x(), o = c({
|
|
25
|
+
client: t,
|
|
26
|
+
headers: p(n)
|
|
27
|
+
});
|
|
28
|
+
return b({
|
|
29
|
+
...u(o, {
|
|
30
|
+
authEpoch: r,
|
|
31
|
+
organizationStatus: i
|
|
32
|
+
}),
|
|
33
|
+
enabled: a && e
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function C({ enabled: e = !0 } = {}) {
|
|
37
|
+
let { client: t, organizationId: n, authEpoch: r, organizationStatus: i, isEnabled: a } = x(), o = s({
|
|
38
|
+
client: t,
|
|
39
|
+
headers: p(n)
|
|
40
|
+
});
|
|
41
|
+
return b({
|
|
42
|
+
...u(o, {
|
|
43
|
+
authEpoch: r,
|
|
44
|
+
organizationStatus: i
|
|
45
|
+
}),
|
|
46
|
+
enabled: a && e
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function w() {
|
|
50
|
+
let { client: e, organizationId: t } = f();
|
|
51
|
+
return y({
|
|
52
|
+
mutationFn: async ({ body: r }) => {
|
|
53
|
+
let { data: i } = await n({
|
|
54
|
+
client: e,
|
|
55
|
+
headers: p(t),
|
|
56
|
+
body: r,
|
|
57
|
+
throwOnError: !0
|
|
58
|
+
});
|
|
59
|
+
return i;
|
|
60
|
+
},
|
|
61
|
+
onSuccess: async () => {
|
|
62
|
+
await d(h({
|
|
63
|
+
client: e,
|
|
64
|
+
organizationId: t
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function T() {
|
|
70
|
+
let { client: e, organizationId: n } = f();
|
|
71
|
+
return y({
|
|
72
|
+
mutationFn: async ({ body: r }) => {
|
|
73
|
+
let { data: i } = await t({
|
|
74
|
+
client: e,
|
|
75
|
+
headers: p(n),
|
|
76
|
+
body: r,
|
|
77
|
+
throwOnError: !0
|
|
78
|
+
});
|
|
79
|
+
return i;
|
|
80
|
+
},
|
|
81
|
+
onSuccess: async () => {
|
|
82
|
+
await d(m({
|
|
83
|
+
client: e,
|
|
84
|
+
organizationId: n
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
async function E({ client: e, organizationId: t, recurrenceId: n, receivableId: r }) {
|
|
90
|
+
await Promise.all([
|
|
91
|
+
d(_({
|
|
92
|
+
client: e,
|
|
93
|
+
organizationId: t
|
|
94
|
+
})),
|
|
95
|
+
...n ? [d(g({
|
|
96
|
+
client: e,
|
|
97
|
+
organizationId: t,
|
|
98
|
+
recurrenceId: n
|
|
99
|
+
}))] : [],
|
|
100
|
+
v({
|
|
101
|
+
client: e,
|
|
102
|
+
organizationId: t,
|
|
103
|
+
receivableId: r
|
|
104
|
+
})
|
|
105
|
+
]);
|
|
106
|
+
}
|
|
107
|
+
function D(e) {
|
|
108
|
+
let { client: t, organizationId: n, authEpoch: r, organizationStatus: i, isEnabled: a } = x(), o = l({
|
|
109
|
+
client: t,
|
|
110
|
+
headers: p(n),
|
|
111
|
+
path: { recurrence_id: e ?? "" }
|
|
112
|
+
});
|
|
113
|
+
return b({
|
|
114
|
+
...u(o, {
|
|
115
|
+
authEpoch: r,
|
|
116
|
+
organizationStatus: i
|
|
22
117
|
}),
|
|
23
|
-
enabled:
|
|
118
|
+
enabled: a && !!e
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function O() {
|
|
122
|
+
let { client: e, organizationId: t } = f();
|
|
123
|
+
return y({
|
|
124
|
+
mutationFn: async ({ body: n }) => {
|
|
125
|
+
let { data: i } = await r({
|
|
126
|
+
client: e,
|
|
127
|
+
headers: p(t),
|
|
128
|
+
body: n,
|
|
129
|
+
throwOnError: !0
|
|
130
|
+
});
|
|
131
|
+
return i;
|
|
132
|
+
},
|
|
133
|
+
onSuccess: async (n, r) => {
|
|
134
|
+
await E({
|
|
135
|
+
client: e,
|
|
136
|
+
organizationId: t,
|
|
137
|
+
receivableId: r.body.invoice_id
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
function k() {
|
|
143
|
+
let { client: t, organizationId: n } = f();
|
|
144
|
+
return y({
|
|
145
|
+
mutationFn: async ({ path: r, body: i }) => {
|
|
146
|
+
let { data: a } = await e({
|
|
147
|
+
client: t,
|
|
148
|
+
headers: p(n),
|
|
149
|
+
path: r,
|
|
150
|
+
body: i,
|
|
151
|
+
throwOnError: !0
|
|
152
|
+
});
|
|
153
|
+
return a;
|
|
154
|
+
},
|
|
155
|
+
onSuccess: async (e, r) => {
|
|
156
|
+
await E({
|
|
157
|
+
client: t,
|
|
158
|
+
organizationId: n,
|
|
159
|
+
recurrenceId: r.path.recurrence_id
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function A(e) {
|
|
165
|
+
let { client: t, organizationId: n } = f();
|
|
166
|
+
return y({
|
|
167
|
+
mutationFn: async ({ path: r }) => {
|
|
168
|
+
let { data: i } = await e({
|
|
169
|
+
client: t,
|
|
170
|
+
headers: p(n),
|
|
171
|
+
path: r,
|
|
172
|
+
throwOnError: !0
|
|
173
|
+
});
|
|
174
|
+
return i;
|
|
175
|
+
},
|
|
176
|
+
onSuccess: async (e, r) => {
|
|
177
|
+
await E({
|
|
178
|
+
client: t,
|
|
179
|
+
organizationId: n,
|
|
180
|
+
recurrenceId: r.path.recurrence_id,
|
|
181
|
+
receivableId: r.receivableId
|
|
182
|
+
});
|
|
183
|
+
}
|
|
24
184
|
});
|
|
25
185
|
}
|
|
186
|
+
function j() {
|
|
187
|
+
return A(i);
|
|
188
|
+
}
|
|
189
|
+
function M() {
|
|
190
|
+
return A(a);
|
|
191
|
+
}
|
|
192
|
+
function N() {
|
|
193
|
+
return A(o);
|
|
194
|
+
}
|
|
26
195
|
//#endregion
|
|
27
|
-
export {
|
|
196
|
+
export { j as useCancelRecurrenceMutation, T as useCreateOverdueReminderMutation, w as useCreatePaymentReminderMutation, O as useCreateRecurrenceMutation, C as useOverdueRemindersQuery, M as usePauseRecurrenceMutation, S as usePaymentRemindersQuery, D as useRecurrenceQuery, N as useResumeRecurrenceMutation, k as useUpdateRecurrenceMutation };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { getAnalyticsReceivablesOptions as e } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
6
|
+
import { withAuthEpoch as t } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
7
|
+
import { useEmbedApi as n } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
+
import { organizationHeaders as r } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
9
|
+
import "../../../shared/data-access/dist/index.js";
|
|
10
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
11
|
+
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js
|
|
12
|
+
function a({ enabled: a = !0, ...o }) {
|
|
13
|
+
let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationStatus: d } = n(), f = !!(c && l) && a, p = e({
|
|
14
|
+
client: s,
|
|
15
|
+
headers: r(c),
|
|
16
|
+
query: o
|
|
17
|
+
});
|
|
18
|
+
return i({
|
|
19
|
+
...t(p, {
|
|
20
|
+
authEpoch: u,
|
|
21
|
+
organizationStatus: d
|
|
22
|
+
}),
|
|
23
|
+
enabled: f
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { a as useReceivablesAnalyticsQuery };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js
CHANGED
|
@@ -2,84 +2,55 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { useEmbedApi as a } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
11
|
-
import { organizationHeaders as o } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
12
|
-
import { useAllBankAccountsQuery as s } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
|
|
13
|
-
import { useAllExternalBankAccountsQuery as c } from "../../../shared/data-access/dist/lib/external-bank-account/useAllExternalBankAccountsQuery.js";
|
|
5
|
+
import { getReceivablesIdHistory as e } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
|
+
import { getReceivablesIdHistoryQueryKey as t } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
7
|
+
import { withAuthEpoch as n } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
8
|
+
import { useEmbedApi as r } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
9
|
+
import { organizationHeaders as i } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
14
10
|
import "../../../shared/data-access/dist/index.js";
|
|
15
|
-
import {
|
|
16
|
-
import { useMemo as u } from "react";
|
|
17
|
-
import { useMutation as d, useQuery as f } from "@tanstack/react-query";
|
|
11
|
+
import { queryOptions as a, useQuery as o } from "@tanstack/react-query";
|
|
18
12
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
var s = {
|
|
14
|
+
limit: 100,
|
|
15
|
+
sort: "timestamp",
|
|
16
|
+
order: "desc"
|
|
17
|
+
};
|
|
18
|
+
function c(c, { enabled: l = !0 } = {}) {
|
|
19
|
+
let { client: u, organizationId: d, widgetToken: f, authEpoch: p, organizationStatus: m } = r(), h = i(d), g = { receivable_id: c ?? "" }, _ = a({
|
|
20
|
+
queryKey: [...t({
|
|
21
|
+
client: u,
|
|
22
|
+
headers: h,
|
|
23
|
+
path: g,
|
|
24
|
+
query: s
|
|
25
|
+
}), "all"],
|
|
26
|
+
queryFn: async ({ signal: t }) => {
|
|
27
|
+
let n = [], r = /* @__PURE__ */ new Set(), i;
|
|
28
|
+
do {
|
|
29
|
+
let { data: a } = await e({
|
|
30
|
+
client: u,
|
|
31
|
+
headers: h,
|
|
32
|
+
path: g,
|
|
33
|
+
query: {
|
|
34
|
+
...s,
|
|
35
|
+
...i ? { pagination_token: i } : {}
|
|
36
|
+
},
|
|
37
|
+
signal: t,
|
|
38
|
+
throwOnError: !0
|
|
39
|
+
});
|
|
40
|
+
n.push(...a.data ?? []);
|
|
41
|
+
let o = a.next_pagination_token ?? void 0;
|
|
42
|
+
i = o && !r.has(o) ? o : void 0, i && r.add(i);
|
|
43
|
+
} while (i);
|
|
44
|
+
return { data: n };
|
|
45
|
+
}
|
|
23
46
|
});
|
|
24
|
-
return
|
|
25
|
-
...
|
|
26
|
-
authEpoch:
|
|
27
|
-
organizationStatus:
|
|
47
|
+
return o({
|
|
48
|
+
...n(_, {
|
|
49
|
+
authEpoch: p,
|
|
50
|
+
organizationStatus: m
|
|
28
51
|
}),
|
|
29
|
-
enabled:
|
|
52
|
+
enabled: !!(d && f && c) && l
|
|
30
53
|
});
|
|
31
54
|
}
|
|
32
|
-
function m() {
|
|
33
|
-
let { client: t, organizationId: n } = a();
|
|
34
|
-
return d({
|
|
35
|
-
mutationFn: async ({ body: r }) => {
|
|
36
|
-
let { data: i } = await e({
|
|
37
|
-
client: t,
|
|
38
|
-
headers: o(n),
|
|
39
|
-
body: r,
|
|
40
|
-
throwOnError: !0
|
|
41
|
-
});
|
|
42
|
-
return i;
|
|
43
|
-
},
|
|
44
|
-
onSuccess: async () => {
|
|
45
|
-
await i(l({
|
|
46
|
-
client: t,
|
|
47
|
-
organizationId: n
|
|
48
|
-
}));
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
var h = (e) => e ? e.slice(-4) : null;
|
|
53
|
-
function g({ enabled: e = !0, canReadEmbedded: t = !1, canReadExternal: r = !1 } = {}) {
|
|
54
|
-
let { organizationId: i, widgetToken: o, organizationStatus: l } = a(), d = l === n.Rotating, f = e && !!(o && (i || d)), m = f && t, g = f && r, _ = p({ enabled: e }), v = s({ enabled: m }), y = c({ enabled: g }), b = f ? _.data?.data : void 0, x = m ? v.data?.data : void 0, S = g ? y.data?.data : void 0, C = u(() => [
|
|
55
|
-
...(b ?? []).map((e) => ({
|
|
56
|
-
id: e.id,
|
|
57
|
-
type: "BANK_DETAILS",
|
|
58
|
-
displayName: e.display_name ?? null,
|
|
59
|
-
accountNumberLast4: h(e.account_number) ?? e.account_number_last4 ?? null
|
|
60
|
-
})),
|
|
61
|
-
...(x ?? []).filter((e) => e.status === "ACTIVE").map((e) => ({
|
|
62
|
-
id: e.id,
|
|
63
|
-
type: "INTERNAL",
|
|
64
|
-
displayName: e.nickname ?? null,
|
|
65
|
-
accountNumberLast4: h(e.accountNumber)
|
|
66
|
-
})),
|
|
67
|
-
...(S ?? []).filter((e) => e.accountStatus === "ACTIVE" && e.verificationStatus === "VERIFIED").map((e) => ({
|
|
68
|
-
id: e.id,
|
|
69
|
-
type: "EXTERNAL",
|
|
70
|
-
displayName: e.nickname || e.nameOnAccount || null,
|
|
71
|
-
accountNumberLast4: h(e.accountNumber)
|
|
72
|
-
}))
|
|
73
|
-
], [
|
|
74
|
-
b,
|
|
75
|
-
x,
|
|
76
|
-
S
|
|
77
|
-
]), w = f && _.isLoading || m && v.isLoading || g && y.isLoading;
|
|
78
|
-
return {
|
|
79
|
-
paymentAccounts: C,
|
|
80
|
-
isLoading: w,
|
|
81
|
-
isIncomplete: w || f && d || f && (_.isFetching || _.isError) || m && (v.isFetching || v.isError || v.hasNextPage) || g && (y.isFetching || y.isError || y.hasNextPage) || !!(f && _.data?.next_pagination_token)
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
55
|
//#endregion
|
|
85
|
-
export {
|
|
56
|
+
export { c as useAllReceivableHistoryQuery };
|