@tesouro/embedded-components-react 0.5.278 → 0.5.280
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 +21 -6
- package/dist/lib/ReceivablesWidget.d.ts +21 -6
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +14 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +24 -168
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +173 -44
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +42 -94
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js +91 -76
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index14.js +67 -173
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index15.js +186 -17
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index16.js +27 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +11 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +42 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +28 -132
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +137 -16
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +16 -62
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +66 -28
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +28 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableAttachmentsSection.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableCustomerSection.js +38 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +304 -287
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/customer.js +58 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +14 -6
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/permissions.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/preview.js +62 -62
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +41 -35
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/reminders.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/totals.js +21 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +124 -124
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableAttachmentUploads.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableBankAccount.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableCustomerPicker.js +109 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +520 -476
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentTerms.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePreview.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableRecurrence.js +92 -77
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +79 -75
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useSendReceivableWithPaymentLink.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +26 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +9 -25
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +26 -228
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +227 -52
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +50 -212
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +193 -138
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +157 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +10 -19
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +23 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +2 -116
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +118 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +3 -39
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +209 -53
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +2 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +36 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +53 -77
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +17 -35
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +8 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +73 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +36 -26
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +17 -19
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +39 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +26 -33
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +20 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +8 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +34 -84
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +14 -492
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +28 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +79 -39
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +490 -68
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +2 -487
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +41 -217
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +70 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +440 -5
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +224 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +21 -263
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +8 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +261 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +2 -237
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +100 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +21 -242
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +226 -82
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +3 -60
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +233 -178
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +85 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +60 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +194 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +45 -0
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index503.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +2 -23
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartSelector.js +2 -51
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +4 -80
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +10 -22
- 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/util/dist/lib/widgetDomEvents.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +0 -100
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js
CHANGED
|
@@ -2,104 +2,52 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { getPaymentRecords as e } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
|
+
import { getPaymentRecordsQueryKey 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";
|
|
9
10
|
import "../../../shared/data-access/dist/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import { useMutation as d } from "@tanstack/react-query";
|
|
11
|
+
import { queryOptions as a, useQuery as o } from "@tanstack/react-query";
|
|
12
12
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
client:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
mutationFn: async ({ path: r, body: i }) => {
|
|
43
|
-
let { data: o } = await t({
|
|
44
|
-
client: e,
|
|
45
|
-
headers: a(n),
|
|
46
|
-
path: r,
|
|
47
|
-
body: i,
|
|
48
|
-
throwOnError: !0
|
|
49
|
-
});
|
|
50
|
-
return o;
|
|
51
|
-
},
|
|
52
|
-
onSuccess: async (t, r) => {
|
|
53
|
-
await f({
|
|
54
|
-
client: e,
|
|
55
|
-
organizationId: n,
|
|
56
|
-
receivableId: r.path.receivable_id
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
function m() {
|
|
62
|
-
let { client: t, organizationId: n } = i();
|
|
63
|
-
return d({
|
|
64
|
-
mutationFn: async ({ body: r }) => {
|
|
65
|
-
let { data: i } = await e({
|
|
66
|
-
client: t,
|
|
67
|
-
headers: a(n),
|
|
68
|
-
body: r,
|
|
69
|
-
throwOnError: !0
|
|
70
|
-
});
|
|
71
|
-
return i;
|
|
72
|
-
},
|
|
73
|
-
onSuccess: async (e, r) => {
|
|
74
|
-
await f({
|
|
75
|
-
client: t,
|
|
76
|
-
organizationId: n,
|
|
77
|
-
receivableId: r.body.object.id
|
|
78
|
-
});
|
|
13
|
+
var s = 100;
|
|
14
|
+
function c(c, { enabled: l = !0 } = {}) {
|
|
15
|
+
let { client: u, organizationId: d, widgetToken: f, authEpoch: p, organizationStatus: m } = r(), h = i(d), g = {
|
|
16
|
+
object_id: c ?? "",
|
|
17
|
+
limit: s
|
|
18
|
+
}, _ = a({
|
|
19
|
+
queryKey: [...t({
|
|
20
|
+
client: u,
|
|
21
|
+
headers: h,
|
|
22
|
+
query: g
|
|
23
|
+
}), "all"],
|
|
24
|
+
queryFn: async ({ signal: t }) => {
|
|
25
|
+
let n = [], r = /* @__PURE__ */ new Set(), i;
|
|
26
|
+
do {
|
|
27
|
+
let { data: a } = await e({
|
|
28
|
+
client: u,
|
|
29
|
+
headers: h,
|
|
30
|
+
query: {
|
|
31
|
+
...g,
|
|
32
|
+
...i ? { pagination_token: i } : {}
|
|
33
|
+
},
|
|
34
|
+
signal: t,
|
|
35
|
+
throwOnError: !0
|
|
36
|
+
});
|
|
37
|
+
n.push(...a.data ?? []);
|
|
38
|
+
let o = a.next_pagination_token ?? void 0;
|
|
39
|
+
i = o && !r.has(o) ? o : void 0, i && r.add(i);
|
|
40
|
+
} while (i);
|
|
41
|
+
return { data: n };
|
|
79
42
|
}
|
|
80
43
|
});
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
client: e,
|
|
88
|
-
headers: a(t),
|
|
89
|
-
path: r,
|
|
90
|
-
body: i,
|
|
91
|
-
throwOnError: !0
|
|
92
|
-
});
|
|
93
|
-
return o;
|
|
94
|
-
},
|
|
95
|
-
onSuccess: async (n, r) => {
|
|
96
|
-
await f({
|
|
97
|
-
client: e,
|
|
98
|
-
organizationId: t,
|
|
99
|
-
receivableId: r.path.receivable_id
|
|
100
|
-
});
|
|
101
|
-
}
|
|
44
|
+
return o({
|
|
45
|
+
...n(_, {
|
|
46
|
+
authEpoch: p,
|
|
47
|
+
organizationStatus: m
|
|
48
|
+
}),
|
|
49
|
+
enabled: !!(d && f && c) && l
|
|
102
50
|
});
|
|
103
51
|
}
|
|
104
52
|
//#endregion
|
|
105
|
-
export {
|
|
53
|
+
export { c as useReceivablePaymentRecordsQuery };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js
CHANGED
|
@@ -2,89 +2,104 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useEmbedApi as
|
|
8
|
-
import { organizationHeaders as
|
|
5
|
+
import { postPaymentRecords as e, postReceivablesIdMarkAsPaid as t, postReceivablesIdMarkAsUncollectible as n } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
|
+
import { invalidateAllClients as r } from "../../../shared/data-access/dist/lib/clientRegistry.js";
|
|
7
|
+
import { useEmbedApi as i } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
+
import { organizationHeaders as a } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
9
9
|
import "../../../shared/data-access/dist/index.js";
|
|
10
|
-
import {
|
|
10
|
+
import { paymentRecordsInvalidationKey as o, receivableHistoryInvalidationKey as s, receivableInvalidationKey as c, receivablesAnalyticsInvalidationKey as l, receivablesInvalidationKey as u } from "./index2.js";
|
|
11
|
+
import { useMutation as d } from "@tanstack/react-query";
|
|
11
12
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
-
return c({
|
|
19
|
-
...i(p, {
|
|
20
|
-
authEpoch: u,
|
|
21
|
-
organizationStatus: d
|
|
22
|
-
}, { carryWithinOrg: !0 }),
|
|
23
|
-
enabled: f
|
|
24
|
-
});
|
|
25
|
-
}
|
|
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 ?? "" }
|
|
31
|
-
});
|
|
32
|
-
return c({
|
|
33
|
-
...i(p, {
|
|
34
|
-
authEpoch: u,
|
|
35
|
-
organizationStatus: d
|
|
36
|
-
}),
|
|
37
|
-
enabled: f
|
|
38
|
-
});
|
|
39
|
-
}
|
|
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
|
|
13
|
+
async function f({ client: e, organizationId: t, receivableId: n }) {
|
|
14
|
+
await Promise.all([
|
|
15
|
+
r(u({
|
|
16
|
+
client: e,
|
|
17
|
+
organizationId: t
|
|
54
18
|
})),
|
|
55
|
-
|
|
56
|
-
|
|
19
|
+
r(c({
|
|
20
|
+
client: e,
|
|
21
|
+
organizationId: t,
|
|
22
|
+
receivableId: n
|
|
23
|
+
})),
|
|
24
|
+
r(s({
|
|
25
|
+
client: e,
|
|
26
|
+
organizationId: t,
|
|
27
|
+
receivableId: n
|
|
28
|
+
})),
|
|
29
|
+
r(l({
|
|
30
|
+
client: e,
|
|
31
|
+
organizationId: t
|
|
32
|
+
})),
|
|
33
|
+
r(o({
|
|
34
|
+
client: e,
|
|
35
|
+
organizationId: t
|
|
36
|
+
}))
|
|
37
|
+
]);
|
|
57
38
|
}
|
|
58
|
-
function p(
|
|
59
|
-
let { client:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
39
|
+
function p() {
|
|
40
|
+
let { client: e, organizationId: n } = i();
|
|
41
|
+
return d({
|
|
42
|
+
mutationFn: async ({ path: r, body: i }) => {
|
|
43
|
+
let { data: o } = await t({
|
|
44
|
+
client: e,
|
|
45
|
+
headers: a(n),
|
|
46
|
+
path: r,
|
|
47
|
+
body: i,
|
|
48
|
+
throwOnError: !0
|
|
49
|
+
});
|
|
50
|
+
return o;
|
|
51
|
+
},
|
|
52
|
+
onSuccess: async (t, r) => {
|
|
53
|
+
await f({
|
|
54
|
+
client: e,
|
|
55
|
+
organizationId: n,
|
|
56
|
+
receivableId: r.path.receivable_id
|
|
57
|
+
});
|
|
58
|
+
}
|
|
70
59
|
});
|
|
71
60
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
function m() {
|
|
62
|
+
let { client: t, organizationId: n } = i();
|
|
63
|
+
return d({
|
|
64
|
+
mutationFn: async ({ body: r }) => {
|
|
65
|
+
let { data: i } = await e({
|
|
66
|
+
client: t,
|
|
67
|
+
headers: a(n),
|
|
68
|
+
body: r,
|
|
69
|
+
throwOnError: !0
|
|
70
|
+
});
|
|
71
|
+
return i;
|
|
72
|
+
},
|
|
73
|
+
onSuccess: async (e, r) => {
|
|
74
|
+
await f({
|
|
75
|
+
client: t,
|
|
76
|
+
organizationId: n,
|
|
77
|
+
receivableId: r.body.object.id
|
|
78
|
+
});
|
|
79
|
+
}
|
|
78
80
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
}
|
|
82
|
+
function h() {
|
|
83
|
+
let { client: e, organizationId: t } = i();
|
|
84
|
+
return d({
|
|
85
|
+
mutationFn: async ({ path: r, body: i }) => {
|
|
86
|
+
let { data: o } = await n({
|
|
87
|
+
client: e,
|
|
88
|
+
headers: a(t),
|
|
89
|
+
path: r,
|
|
90
|
+
body: i,
|
|
91
|
+
throwOnError: !0
|
|
92
|
+
});
|
|
93
|
+
return o;
|
|
94
|
+
},
|
|
95
|
+
onSuccess: async (n, r) => {
|
|
96
|
+
await f({
|
|
97
|
+
client: e,
|
|
98
|
+
organizationId: t,
|
|
99
|
+
receivableId: r.path.receivable_id
|
|
100
|
+
});
|
|
101
|
+
}
|
|
87
102
|
});
|
|
88
103
|
}
|
|
89
104
|
//#endregion
|
|
90
|
-
export {
|
|
105
|
+
export { m as useCreateReceivablePaymentRecordMutation, p as useMarkReceivablePaidMutation, h as useMarkReceivableUncollectibleMutation };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index14.js
CHANGED
|
@@ -2,195 +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 f } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
10
|
-
import { organizationHeaders as p } 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 v } from "./index8.js";
|
|
14
|
-
import { useMutation as y, useQuery as b } 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/index14.js
|
|
16
|
-
function
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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)
|
|
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:
|
|
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
|
-
}
|
|
37
|
+
enabled: f
|
|
67
38
|
});
|
|
68
39
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
|
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
|
-
v({
|
|
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: 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
|
-
}
|
|
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 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
|
-
}
|
|
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
|
|
184
87
|
});
|
|
185
88
|
}
|
|
186
|
-
function j() {
|
|
187
|
-
return A(i);
|
|
188
|
-
}
|
|
189
|
-
function M() {
|
|
190
|
-
return A(a);
|
|
191
|
-
}
|
|
192
|
-
function N() {
|
|
193
|
-
return A(o);
|
|
194
|
-
}
|
|
195
89
|
//#endregion
|
|
196
|
-
export {
|
|
90
|
+
export { g as useReceivablePdfLinkQuery, u as useReceivableQuery, p as useReceivableRequiredFieldsQuery, f as useReceivablesByIdQueries, l as useReceivablesQuery };
|