@tesouro/embedded-components-react 0.5.231 → 0.5.232
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 +104 -2
- package/dist/index.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +104 -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 +64 -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 +32 -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 +175 -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 +392 -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 +17 -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/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/index4.js
CHANGED
|
@@ -2,69 +2,84 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { postBankDetails as e } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
|
+
import { getBankDetailsOptions as t } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
7
|
+
import { OrganizationStatus as n } from "../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
8
|
+
import { withAuthEpoch as r } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
9
|
+
import { invalidateAllClients as i } from "../../../shared/data-access/dist/lib/clientRegistry.js";
|
|
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";
|
|
9
14
|
import "../../../shared/data-access/dist/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
15
|
+
import { entityBankAccountsInvalidationKey as l } from "./index2.js";
|
|
16
|
+
import { useMemo as u } from "react";
|
|
17
|
+
import { useMutation as d, useQuery as f } from "@tanstack/react-query";
|
|
12
18
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
function u() {
|
|
26
|
-
let { client: e, organizationId: n } = r();
|
|
27
|
-
return s({
|
|
28
|
-
mutationFn: async ({ file: r }) => {
|
|
29
|
-
let { data: a } = await t({
|
|
30
|
-
client: e,
|
|
31
|
-
headers: i(n),
|
|
32
|
-
body: {
|
|
33
|
-
file: r,
|
|
34
|
-
file_type: c
|
|
35
|
-
},
|
|
36
|
-
throwOnError: !0
|
|
37
|
-
});
|
|
38
|
-
return a;
|
|
39
|
-
},
|
|
40
|
-
onSuccess: async (t, r) => {
|
|
41
|
-
await l({
|
|
42
|
-
client: e,
|
|
43
|
-
organizationId: n,
|
|
44
|
-
receivableId: r.receivableId
|
|
45
|
-
});
|
|
46
|
-
}
|
|
19
|
+
function p({ enabled: e = !0 } = {}) {
|
|
20
|
+
let { client: n, organizationId: i, widgetToken: s, authEpoch: c, organizationStatus: l } = a(), u = t({
|
|
21
|
+
client: n,
|
|
22
|
+
headers: o(i)
|
|
23
|
+
});
|
|
24
|
+
return f({
|
|
25
|
+
...r(u, {
|
|
26
|
+
authEpoch: c,
|
|
27
|
+
organizationStatus: l
|
|
28
|
+
}),
|
|
29
|
+
enabled: e && !!(i && s)
|
|
47
30
|
});
|
|
48
31
|
}
|
|
49
|
-
function
|
|
50
|
-
let { client: t, organizationId: n } =
|
|
51
|
-
return
|
|
52
|
-
mutationFn: async ({
|
|
53
|
-
await e({
|
|
32
|
+
function m() {
|
|
33
|
+
let { client: t, organizationId: n } = a();
|
|
34
|
+
return d({
|
|
35
|
+
mutationFn: async ({ body: r }) => {
|
|
36
|
+
let { data: i } = await e({
|
|
54
37
|
client: t,
|
|
55
|
-
headers:
|
|
56
|
-
|
|
38
|
+
headers: o(n),
|
|
39
|
+
body: r,
|
|
57
40
|
throwOnError: !0
|
|
58
41
|
});
|
|
42
|
+
return i;
|
|
59
43
|
},
|
|
60
|
-
onSuccess: async (
|
|
61
|
-
await l({
|
|
44
|
+
onSuccess: async () => {
|
|
45
|
+
await i(l({
|
|
62
46
|
client: t,
|
|
63
|
-
organizationId: n
|
|
64
|
-
|
|
65
|
-
});
|
|
47
|
+
organizationId: n
|
|
48
|
+
}));
|
|
66
49
|
}
|
|
67
50
|
});
|
|
68
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
|
+
}
|
|
69
84
|
//#endregion
|
|
70
|
-
export {
|
|
85
|
+
export { m as useCreateEntityBankAccountMutation, p as useEntityBankAccountsQuery, g as usePaymentAccountsQuery };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js
CHANGED
|
@@ -1,36 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { deleteFilesId as e, postFiles as t } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
|
+
import { invalidateAllClients as n } from "../../../shared/data-access/dist/lib/clientRegistry.js";
|
|
7
|
+
import { useEmbedApi as r } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
+
import { organizationHeaders as i } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
2
9
|
import "../../../shared/data-access/dist/index.js";
|
|
3
|
-
import {
|
|
10
|
+
import { receivableAttachmentsInvalidationKey as a, receivableInvalidationKey as o } from "./index2.js";
|
|
11
|
+
import { useMutation as s } from "@tanstack/react-query";
|
|
4
12
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
t({
|
|
22
|
-
client:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
13
|
+
var c = "attachments";
|
|
14
|
+
async function l({ client: e, organizationId: t, receivableId: r }) {
|
|
15
|
+
let i = [a({
|
|
16
|
+
client: e,
|
|
17
|
+
organizationId: t
|
|
18
|
+
}), ...r ? [o({
|
|
19
|
+
client: e,
|
|
20
|
+
organizationId: t,
|
|
21
|
+
receivableId: r
|
|
22
|
+
})] : []];
|
|
23
|
+
await Promise.all(i.map((e) => n(e)));
|
|
24
|
+
}
|
|
25
|
+
function u() {
|
|
26
|
+
let { client: e, organizationId: n } = r();
|
|
27
|
+
return s({
|
|
28
|
+
mutationFn: async ({ file: r }) => {
|
|
29
|
+
let { data: a } = await t({
|
|
30
|
+
client: e,
|
|
31
|
+
headers: i(n),
|
|
32
|
+
body: {
|
|
33
|
+
file: r,
|
|
34
|
+
file_type: c
|
|
35
|
+
},
|
|
36
|
+
throwOnError: !0
|
|
37
|
+
});
|
|
38
|
+
return a;
|
|
39
|
+
},
|
|
40
|
+
onSuccess: async (t, r) => {
|
|
41
|
+
await l({
|
|
42
|
+
client: e,
|
|
43
|
+
organizationId: n,
|
|
44
|
+
receivableId: r.receivableId
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function d() {
|
|
50
|
+
let { client: t, organizationId: n } = r();
|
|
51
|
+
return s({
|
|
52
|
+
mutationFn: async ({ path: r }) => {
|
|
53
|
+
await e({
|
|
54
|
+
client: t,
|
|
55
|
+
headers: i(n),
|
|
56
|
+
path: r,
|
|
57
|
+
throwOnError: !0
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
onSuccess: async (e, r) => {
|
|
61
|
+
await l({
|
|
62
|
+
client: t,
|
|
63
|
+
organizationId: n,
|
|
64
|
+
receivableId: r.receivableId
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
34
68
|
}
|
|
35
69
|
//#endregion
|
|
36
|
-
export {
|
|
70
|
+
export { d as useDeleteReceivableAttachmentMutation, u as useUploadReceivableAttachmentMutation };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js
CHANGED
|
@@ -1,38 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { postReceivablesIdSend as e } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
|
-
import { invalidateAllClients as t } from "../../../shared/data-access/dist/lib/clientRegistry.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";
|
|
1
|
+
import { invalidateAllClients as e } from "../../../shared/data-access/dist/lib/clientRegistry.js";
|
|
9
2
|
import "../../../shared/data-access/dist/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import { invalidateReceivable as a } from "./index5.js";
|
|
12
|
-
import { useMutation as o } from "@tanstack/react-query";
|
|
3
|
+
import { receivableHistoryInvalidationKey as t, receivableInvalidationKey as n, receivablePdfInvalidationKey as r, receivablesAnalyticsInvalidationKey as i, receivablesInvalidationKey as a } from "./index2.js";
|
|
13
4
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js
|
|
14
|
-
function s
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
5
|
+
async function o({ client: o, organizationId: s, receivableId: c }) {
|
|
6
|
+
let l = [
|
|
7
|
+
a({
|
|
8
|
+
client: o,
|
|
9
|
+
organizationId: s
|
|
10
|
+
}),
|
|
11
|
+
i({
|
|
12
|
+
client: o,
|
|
13
|
+
organizationId: s
|
|
14
|
+
}),
|
|
15
|
+
...c ? [
|
|
16
|
+
n({
|
|
17
|
+
client: o,
|
|
18
|
+
organizationId: s,
|
|
19
|
+
receivableId: c
|
|
20
|
+
}),
|
|
21
|
+
t({
|
|
22
|
+
client: o,
|
|
23
|
+
organizationId: s,
|
|
24
|
+
receivableId: c
|
|
25
|
+
}),
|
|
26
|
+
r({
|
|
27
|
+
client: o,
|
|
28
|
+
organizationId: s,
|
|
29
|
+
receivableId: c
|
|
30
|
+
})
|
|
31
|
+
] : []
|
|
32
|
+
];
|
|
33
|
+
await Promise.all(l.map((t) => e(t)));
|
|
36
34
|
}
|
|
37
35
|
//#endregion
|
|
38
|
-
export {
|
|
36
|
+
export { o as invalidateReceivable };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js
CHANGED
|
@@ -2,179 +2,37 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { postReceivablesIdSend as e } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
|
+
import { invalidateAllClients as t } from "../../../shared/data-access/dist/lib/clientRegistry.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";
|
|
8
9
|
import "../../../shared/data-access/dist/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
10
|
+
import { receivableMailsInvalidationKey as i } from "./index2.js";
|
|
11
|
+
import { invalidateReceivable as a } from "./index6.js";
|
|
12
|
+
import { useMutation as o } from "@tanstack/react-query";
|
|
11
13
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js
|
|
12
|
-
function
|
|
13
|
-
let { client:
|
|
14
|
-
return
|
|
15
|
-
mutationFn: async ({ body:
|
|
16
|
-
let { data: i } = await
|
|
17
|
-
client:
|
|
18
|
-
headers:
|
|
19
|
-
|
|
14
|
+
function s() {
|
|
15
|
+
let { client: s, organizationId: c } = n();
|
|
16
|
+
return o({
|
|
17
|
+
mutationFn: async ({ path: t, body: n }) => {
|
|
18
|
+
let { data: i } = await e({
|
|
19
|
+
client: s,
|
|
20
|
+
headers: r(c),
|
|
21
|
+
path: t,
|
|
22
|
+
body: n,
|
|
20
23
|
throwOnError: !0
|
|
21
24
|
});
|
|
22
25
|
return i;
|
|
23
26
|
},
|
|
24
|
-
onSuccess: async () => {
|
|
25
|
-
|
|
26
|
-
client:
|
|
27
|
-
organizationId:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
function p() {
|
|
33
|
-
let { client: e, organizationId: n } = c();
|
|
34
|
-
return d({
|
|
35
|
-
mutationFn: async ({ path: r, body: i }) => {
|
|
36
|
-
let { data: a } = await t({
|
|
37
|
-
client: e,
|
|
38
|
-
headers: l(n),
|
|
39
|
-
path: r,
|
|
40
|
-
body: i,
|
|
41
|
-
throwOnError: !0
|
|
42
|
-
});
|
|
43
|
-
return a;
|
|
44
|
-
},
|
|
45
|
-
onSuccess: async (t, r) => {
|
|
46
|
-
await u({
|
|
47
|
-
client: e,
|
|
48
|
-
organizationId: n,
|
|
49
|
-
receivableId: r.path.receivable_id
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function m() {
|
|
55
|
-
let { client: t, organizationId: n } = c();
|
|
56
|
-
return d({
|
|
57
|
-
mutationFn: async ({ path: r }) => {
|
|
58
|
-
await e({
|
|
59
|
-
client: t,
|
|
60
|
-
headers: l(n),
|
|
61
|
-
path: r,
|
|
62
|
-
throwOnError: !0
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
onSuccess: async (e, r) => {
|
|
66
|
-
await u({
|
|
67
|
-
client: t,
|
|
68
|
-
organizationId: n,
|
|
69
|
-
receivableId: r.path.receivable_id
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
function h() {
|
|
75
|
-
let { client: e, organizationId: t } = c();
|
|
76
|
-
return d({
|
|
77
|
-
mutationFn: async ({ path: n }) => {
|
|
78
|
-
let { data: r } = await s({
|
|
79
|
-
client: e,
|
|
80
|
-
headers: l(t),
|
|
81
|
-
path: n,
|
|
82
|
-
throwOnError: !0
|
|
83
|
-
});
|
|
84
|
-
return r;
|
|
85
|
-
},
|
|
86
|
-
onSuccess: async (n, r) => {
|
|
87
|
-
await u({
|
|
88
|
-
client: e,
|
|
89
|
-
organizationId: t,
|
|
90
|
-
receivableId: r.path.receivable_id
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
function g() {
|
|
96
|
-
let { client: e, organizationId: t } = c();
|
|
97
|
-
return d({
|
|
98
|
-
mutationFn: async ({ path: n }) => {
|
|
99
|
-
await i({
|
|
100
|
-
client: e,
|
|
101
|
-
headers: l(t),
|
|
102
|
-
path: n,
|
|
103
|
-
throwOnError: !0
|
|
104
|
-
});
|
|
105
|
-
},
|
|
106
|
-
onSuccess: async (n, r) => {
|
|
107
|
-
await u({
|
|
108
|
-
client: e,
|
|
109
|
-
organizationId: t,
|
|
110
|
-
receivableId: r.path.receivable_id
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
function _() {
|
|
116
|
-
let { client: e, organizationId: t } = c();
|
|
117
|
-
return d({
|
|
118
|
-
mutationFn: async ({ path: n }) => {
|
|
119
|
-
let { data: r } = await a({
|
|
120
|
-
client: e,
|
|
121
|
-
headers: l(t),
|
|
122
|
-
path: n,
|
|
123
|
-
throwOnError: !0
|
|
124
|
-
});
|
|
125
|
-
return r;
|
|
126
|
-
},
|
|
127
|
-
onSuccess: async () => {
|
|
128
|
-
await u({
|
|
129
|
-
client: e,
|
|
130
|
-
organizationId: t
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
function v() {
|
|
136
|
-
let { client: e, organizationId: t } = c();
|
|
137
|
-
return d({
|
|
138
|
-
mutationFn: async ({ path: n, body: i }) => {
|
|
139
|
-
let { data: a } = await r({
|
|
140
|
-
client: e,
|
|
141
|
-
headers: l(t),
|
|
142
|
-
path: n,
|
|
143
|
-
body: i,
|
|
144
|
-
throwOnError: !0
|
|
145
|
-
});
|
|
146
|
-
return a;
|
|
147
|
-
},
|
|
148
|
-
onSuccess: async (n, r) => {
|
|
149
|
-
await u({
|
|
150
|
-
client: e,
|
|
151
|
-
organizationId: t,
|
|
152
|
-
receivableId: r.path.receivable_id
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
function y() {
|
|
158
|
-
let { client: e, organizationId: t } = c();
|
|
159
|
-
return d({
|
|
160
|
-
mutationFn: async ({ path: n, body: r }) => {
|
|
161
|
-
let { data: i } = await o({
|
|
162
|
-
client: e,
|
|
163
|
-
headers: l(t),
|
|
164
|
-
path: n,
|
|
165
|
-
body: r,
|
|
166
|
-
throwOnError: !0
|
|
167
|
-
});
|
|
168
|
-
return i;
|
|
169
|
-
},
|
|
170
|
-
onSuccess: async (n, r) => {
|
|
171
|
-
await u({
|
|
172
|
-
client: e,
|
|
173
|
-
organizationId: t,
|
|
174
|
-
receivableId: r.path.receivable_id
|
|
175
|
-
});
|
|
27
|
+
onSuccess: async (e, n) => {
|
|
28
|
+
let r = {
|
|
29
|
+
client: s,
|
|
30
|
+
organizationId: c,
|
|
31
|
+
receivableId: n.path.receivable_id
|
|
32
|
+
};
|
|
33
|
+
await Promise.all([t(i(r)), a(r)]);
|
|
176
34
|
}
|
|
177
35
|
});
|
|
178
36
|
}
|
|
179
37
|
//#endregion
|
|
180
|
-
export {
|
|
38
|
+
export { s as useSendReceivableEmailMutation };
|