@tesouro/embedded-components-react 0.5.179 → 0.5.181

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.
@@ -1,9 +1,10 @@
1
1
  import { usePaymentTermsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js";
2
2
  import "../../../shared/data-access/dist/index.js";
3
3
  import "./index2.js";
4
- import { useSendReceivableEmailMutation as t } from "./index3.js";
5
- import { useAcceptReceivableMutation as n, useCancelReceivableMutation as r, useCloneReceivableMutation as i, useCreateReceivableMutation as a, useDeclineReceivableMutation as o, useDeleteReceivableMutation as s, useIssueReceivableMutation as c, useUpdateReceivableMutation as l } from "./index4.js";
6
- import { useMarkReceivablePaidMutation as u, useMarkReceivablePartiallyPaidMutation as d, useMarkReceivableUncollectibleMutation as f } from "./index5.js";
7
- import { useReceivableHistoryQuery as p, useReceivableMailsQuery as m, useReceivablePdfLinkQuery as h, useReceivableQuery as g, useReceivablesQuery as _ } from "./index6.js";
8
- import "./index7.js";
4
+ import "./index3.js";
5
+ import { useSendReceivableEmailMutation as t } from "./index4.js";
6
+ import { useAcceptReceivableMutation as n, useCancelReceivableMutation as r, useCloneReceivableMutation as i, useCreateReceivableMutation as a, useDeclineReceivableMutation as o, useDeleteReceivableMutation as s, useIssueReceivableMutation as c, useUpdateReceivableMutation as l } from "./index5.js";
7
+ import { useMarkReceivablePaidMutation as u, useMarkReceivablePartiallyPaidMutation as d, useMarkReceivableUncollectibleMutation as f } from "./index6.js";
8
+ import { useReceivableHistoryQuery as p, useReceivableMailsQuery as m, useReceivablePdfLinkQuery as h, useReceivableQuery as g, useReceivablesQuery as _ } from "./index7.js";
9
+ import "./index8.js";
9
10
  export { n as useAcceptReceivableMutation, r as useCancelReceivableMutation, i as useCloneReceivableMutation, a as useCreateReceivableMutation, o as useDeclineReceivableMutation, s as useDeleteReceivableMutation, c as useIssueReceivableMutation, u as useMarkReceivablePaidMutation, d as useMarkReceivablePartiallyPaidMutation, f as useMarkReceivableUncollectibleMutation, e as usePaymentTermsQuery, p as useReceivableHistoryQuery, m as useReceivableMailsQuery, h as useReceivablePdfLinkQuery, g as useReceivableQuery, _ as useReceivablesQuery, t as useSendReceivableEmailMutation, l as useUpdateReceivableMutation };
@@ -2,36 +2,6 @@
2
2
  "use client";
3
3
  "use client";
4
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";
9
5
  import "../../../shared/data-access/dist/index.js";
10
- import { receivableHistoryInvalidationKey as i, receivableMailsInvalidationKey as a } from "./index2.js";
11
- import { useMutation as o } from "@tanstack/react-query";
12
- //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js
13
- function s() {
14
- let { client: s, organizationId: c } = n();
15
- return o({
16
- mutationFn: async ({ path: t, body: n }) => {
17
- let { data: i } = await e({
18
- client: s,
19
- headers: r(c),
20
- path: t,
21
- body: n,
22
- throwOnError: !0
23
- });
24
- return i;
25
- },
26
- onSuccess: async (e, n) => {
27
- let r = {
28
- client: s,
29
- organizationId: c,
30
- receivableId: n.path.receivable_id
31
- };
32
- await Promise.all([t(a(r)), t(i(r))]);
33
- }
34
- });
35
- }
36
- //#endregion
37
- export { s as useSendReceivableEmailMutation };
6
+ import "./index2.js";
7
+ import "@tanstack/react-query";
@@ -2,203 +2,36 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { deleteReceivablesId as e, patchReceivablesId as t, postReceivables as n, postReceivablesIdAccept as r, postReceivablesIdCancel as i, postReceivablesIdClone as a, postReceivablesIdDecline as o, postReceivablesIdIssue as s } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
6
- import { invalidateAllClients as c } from "../../../shared/data-access/dist/lib/clientRegistry.js";
7
- import { useEmbedApi as l } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
- import { organizationHeaders as u } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
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";
9
9
  import "../../../shared/data-access/dist/index.js";
10
- import { receivableHistoryInvalidationKey as d, receivableInvalidationKey as f, receivablePdfInvalidationKey as p, receivablesInvalidationKey as m } from "./index2.js";
11
- import { useMutation as h } from "@tanstack/react-query";
10
+ import { receivableHistoryInvalidationKey as i, receivableMailsInvalidationKey as a } from "./index2.js";
11
+ import { useMutation as o } from "@tanstack/react-query";
12
12
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js
13
- async function g({ client: e, organizationId: t, receivableId: n }) {
14
- let r = [m({
15
- client: e,
16
- organizationId: t
17
- }), ...n ? [
18
- f({
19
- client: e,
20
- organizationId: t,
21
- receivableId: n
22
- }),
23
- d({
24
- client: e,
25
- organizationId: t,
26
- receivableId: n
27
- }),
28
- p({
29
- client: e,
30
- organizationId: t,
31
- receivableId: n
32
- })
33
- ] : []];
34
- await Promise.all(r.map((e) => c(e)));
35
- }
36
- function _() {
37
- let { client: e, organizationId: t } = l();
38
- return h({
39
- mutationFn: async ({ body: r }) => {
40
- let { data: i } = await n({
41
- client: e,
42
- headers: u(t),
43
- body: r,
44
- throwOnError: !0
45
- });
46
- return i;
47
- },
48
- onSuccess: async () => {
49
- await g({
50
- client: e,
51
- organizationId: t
52
- });
53
- }
54
- });
55
- }
56
- function v() {
57
- let { client: e, organizationId: n } = l();
58
- return h({
59
- mutationFn: async ({ path: r, body: i }) => {
60
- let { data: a } = await t({
61
- client: e,
62
- headers: u(n),
63
- path: r,
64
- body: i,
65
- throwOnError: !0
66
- });
67
- return a;
68
- },
69
- onSuccess: async (t, r) => {
70
- await g({
71
- client: e,
72
- organizationId: n,
73
- receivableId: r.path.receivable_id
74
- });
75
- }
76
- });
77
- }
78
- function y() {
79
- let { client: t, organizationId: n } = l();
80
- return h({
81
- mutationFn: async ({ path: r }) => {
82
- await e({
83
- client: t,
84
- headers: u(n),
85
- path: r,
86
- throwOnError: !0
87
- });
88
- },
89
- onSuccess: async (e, r) => {
90
- await g({
91
- client: t,
92
- organizationId: n,
93
- receivableId: r.path.receivable_id
94
- });
95
- }
96
- });
97
- }
98
- function b() {
99
- let { client: e, organizationId: t } = l();
100
- return h({
101
- mutationFn: async ({ path: n }) => {
102
- let { data: r } = await s({
103
- client: e,
104
- headers: u(t),
105
- path: n,
106
- throwOnError: !0
107
- });
108
- return r;
109
- },
110
- onSuccess: async (n, r) => {
111
- await g({
112
- client: e,
113
- organizationId: t,
114
- receivableId: r.path.receivable_id
115
- });
116
- }
117
- });
118
- }
119
- function x() {
120
- let { client: e, organizationId: t } = l();
121
- return h({
122
- mutationFn: async ({ path: n }) => {
123
- await i({
124
- client: e,
125
- headers: u(t),
126
- path: n,
127
- throwOnError: !0
128
- });
129
- },
130
- onSuccess: async (n, r) => {
131
- await g({
132
- client: e,
133
- organizationId: t,
134
- receivableId: r.path.receivable_id
135
- });
136
- }
137
- });
138
- }
139
- function S() {
140
- let { client: e, organizationId: t } = l();
141
- return h({
142
- mutationFn: async ({ path: n }) => {
143
- let { data: r } = await a({
144
- client: e,
145
- headers: u(t),
146
- path: n,
147
- throwOnError: !0
148
- });
149
- return r;
150
- },
151
- onSuccess: async () => {
152
- await g({
153
- client: e,
154
- organizationId: t
155
- });
156
- }
157
- });
158
- }
159
- function C() {
160
- let { client: e, organizationId: t } = l();
161
- return h({
162
- mutationFn: async ({ path: n, body: i }) => {
163
- let { data: a } = await r({
164
- client: e,
165
- headers: u(t),
166
- path: n,
167
- body: i,
168
- throwOnError: !0
169
- });
170
- return a;
171
- },
172
- onSuccess: async (n, r) => {
173
- await g({
174
- client: e,
175
- organizationId: t,
176
- receivableId: r.path.receivable_id
177
- });
178
- }
179
- });
180
- }
181
- function w() {
182
- let { client: e, organizationId: t } = l();
183
- return h({
184
- mutationFn: async ({ path: n, body: r }) => {
185
- let { data: i } = await o({
186
- client: e,
187
- headers: u(t),
188
- path: n,
189
- body: r,
13
+ function s() {
14
+ let { client: s, organizationId: c } = n();
15
+ return o({
16
+ mutationFn: async ({ path: t, body: n }) => {
17
+ let { data: i } = await e({
18
+ client: s,
19
+ headers: r(c),
20
+ path: t,
21
+ body: n,
190
22
  throwOnError: !0
191
23
  });
192
24
  return i;
193
25
  },
194
- onSuccess: async (n, r) => {
195
- await g({
196
- client: e,
197
- organizationId: t,
198
- receivableId: r.path.receivable_id
199
- });
26
+ onSuccess: async (e, n) => {
27
+ let r = {
28
+ client: s,
29
+ organizationId: c,
30
+ receivableId: n.path.receivable_id
31
+ };
32
+ await Promise.all([t(a(r)), t(i(r))]);
200
33
  }
201
34
  });
202
35
  }
203
36
  //#endregion
204
- export { C as useAcceptReceivableMutation, x as useCancelReceivableMutation, S as useCloneReceivableMutation, _ as useCreateReceivableMutation, w as useDeclineReceivableMutation, y as useDeleteReceivableMutation, b as useIssueReceivableMutation, v as useUpdateReceivableMutation };
37
+ export { s as useSendReceivableEmailMutation };
@@ -2,47 +2,92 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { postReceivablesIdMarkAsPaid as e, postReceivablesIdMarkAsPartiallyPaid 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";
5
+ import { deleteReceivablesId as e, patchReceivablesId as t, postReceivables as n, postReceivablesIdAccept as r, postReceivablesIdCancel as i, postReceivablesIdClone as a, postReceivablesIdDecline as o, postReceivablesIdIssue as s } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
6
+ import { invalidateAllClients as c } from "../../../shared/data-access/dist/lib/clientRegistry.js";
7
+ import { useEmbedApi as l } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
+ import { organizationHeaders as u } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
9
9
  import "../../../shared/data-access/dist/index.js";
10
- import { receivableHistoryInvalidationKey as o, receivableInvalidationKey as s, receivablesInvalidationKey as c } from "./index2.js";
11
- import { useMutation as l } from "@tanstack/react-query";
10
+ import { receivableHistoryInvalidationKey as d, receivableInvalidationKey as f, receivablePdfInvalidationKey as p, receivablesInvalidationKey as m } from "./index2.js";
11
+ import { useMutation as h } from "@tanstack/react-query";
12
12
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js
13
- async function u({ client: e, organizationId: t, receivableId: n }) {
14
- await Promise.all([
15
- r(c({
13
+ async function g({ client: e, organizationId: t, receivableId: n }) {
14
+ let r = [m({
15
+ client: e,
16
+ organizationId: t
17
+ }), ...n ? [
18
+ f({
16
19
  client: e,
17
- organizationId: t
18
- })),
19
- r(s({
20
+ organizationId: t,
21
+ receivableId: n
22
+ }),
23
+ d({
20
24
  client: e,
21
25
  organizationId: t,
22
26
  receivableId: n
23
- })),
24
- r(o({
27
+ }),
28
+ p({
25
29
  client: e,
26
30
  organizationId: t,
27
31
  receivableId: n
28
- }))
29
- ]);
32
+ })
33
+ ] : []];
34
+ await Promise.all(r.map((e) => c(e)));
30
35
  }
31
- function d() {
32
- let { client: t, organizationId: n } = i();
33
- return l({
36
+ function _() {
37
+ let { client: e, organizationId: t } = l();
38
+ return h({
39
+ mutationFn: async ({ body: r }) => {
40
+ let { data: i } = await n({
41
+ client: e,
42
+ headers: u(t),
43
+ body: r,
44
+ throwOnError: !0
45
+ });
46
+ return i;
47
+ },
48
+ onSuccess: async () => {
49
+ await g({
50
+ client: e,
51
+ organizationId: t
52
+ });
53
+ }
54
+ });
55
+ }
56
+ function v() {
57
+ let { client: e, organizationId: n } = l();
58
+ return h({
34
59
  mutationFn: async ({ path: r, body: i }) => {
35
- let { data: o } = await e({
36
- client: t,
37
- headers: a(n),
60
+ let { data: a } = await t({
61
+ client: e,
62
+ headers: u(n),
38
63
  path: r,
39
64
  body: i,
40
65
  throwOnError: !0
41
66
  });
42
- return o;
67
+ return a;
68
+ },
69
+ onSuccess: async (t, r) => {
70
+ await g({
71
+ client: e,
72
+ organizationId: n,
73
+ receivableId: r.path.receivable_id
74
+ });
75
+ }
76
+ });
77
+ }
78
+ function y() {
79
+ let { client: t, organizationId: n } = l();
80
+ return h({
81
+ mutationFn: async ({ path: r }) => {
82
+ await e({
83
+ client: t,
84
+ headers: u(n),
85
+ path: r,
86
+ throwOnError: !0
87
+ });
43
88
  },
44
89
  onSuccess: async (e, r) => {
45
- await u({
90
+ await g({
46
91
  client: t,
47
92
  organizationId: n,
48
93
  receivableId: r.path.receivable_id
@@ -50,43 +95,104 @@ function d() {
50
95
  }
51
96
  });
52
97
  }
53
- function f() {
54
- let { client: e, organizationId: n } = i();
55
- return l({
56
- mutationFn: async ({ path: r, body: i }) => {
57
- let { data: o } = await t({
98
+ function b() {
99
+ let { client: e, organizationId: t } = l();
100
+ return h({
101
+ mutationFn: async ({ path: n }) => {
102
+ let { data: r } = await s({
58
103
  client: e,
59
- headers: a(n),
60
- path: r,
61
- body: i,
104
+ headers: u(t),
105
+ path: n,
62
106
  throwOnError: !0
63
107
  });
64
- return o;
108
+ return r;
65
109
  },
66
- onSuccess: async (t, r) => {
67
- await u({
110
+ onSuccess: async (n, r) => {
111
+ await g({
68
112
  client: e,
69
- organizationId: n,
113
+ organizationId: t,
70
114
  receivableId: r.path.receivable_id
71
115
  });
72
116
  }
73
117
  });
74
118
  }
75
- function p() {
76
- let { client: e, organizationId: t } = i();
77
- return l({
78
- mutationFn: async ({ path: r, body: i }) => {
79
- let { data: o } = await n({
119
+ function x() {
120
+ let { client: e, organizationId: t } = l();
121
+ return h({
122
+ mutationFn: async ({ path: n }) => {
123
+ await i({
80
124
  client: e,
81
- headers: a(t),
82
- path: r,
125
+ headers: u(t),
126
+ path: n,
127
+ throwOnError: !0
128
+ });
129
+ },
130
+ onSuccess: async (n, r) => {
131
+ await g({
132
+ client: e,
133
+ organizationId: t,
134
+ receivableId: r.path.receivable_id
135
+ });
136
+ }
137
+ });
138
+ }
139
+ function S() {
140
+ let { client: e, organizationId: t } = l();
141
+ return h({
142
+ mutationFn: async ({ path: n }) => {
143
+ let { data: r } = await a({
144
+ client: e,
145
+ headers: u(t),
146
+ path: n,
147
+ throwOnError: !0
148
+ });
149
+ return r;
150
+ },
151
+ onSuccess: async () => {
152
+ await g({
153
+ client: e,
154
+ organizationId: t
155
+ });
156
+ }
157
+ });
158
+ }
159
+ function C() {
160
+ let { client: e, organizationId: t } = l();
161
+ return h({
162
+ mutationFn: async ({ path: n, body: i }) => {
163
+ let { data: a } = await r({
164
+ client: e,
165
+ headers: u(t),
166
+ path: n,
83
167
  body: i,
84
168
  throwOnError: !0
85
169
  });
86
- return o;
170
+ return a;
171
+ },
172
+ onSuccess: async (n, r) => {
173
+ await g({
174
+ client: e,
175
+ organizationId: t,
176
+ receivableId: r.path.receivable_id
177
+ });
178
+ }
179
+ });
180
+ }
181
+ function w() {
182
+ let { client: e, organizationId: t } = l();
183
+ return h({
184
+ mutationFn: async ({ path: n, body: r }) => {
185
+ let { data: i } = await o({
186
+ client: e,
187
+ headers: u(t),
188
+ path: n,
189
+ body: r,
190
+ throwOnError: !0
191
+ });
192
+ return i;
87
193
  },
88
194
  onSuccess: async (n, r) => {
89
- await u({
195
+ await g({
90
196
  client: e,
91
197
  organizationId: t,
92
198
  receivableId: r.path.receivable_id
@@ -95,4 +201,4 @@ function p() {
95
201
  });
96
202
  }
97
203
  //#endregion
98
- export { d as useMarkReceivablePaidMutation, f as useMarkReceivablePartiallyPaidMutation, p as useMarkReceivableUncollectibleMutation };
204
+ export { C as useAcceptReceivableMutation, x as useCancelReceivableMutation, S as useCloneReceivableMutation, _ as useCreateReceivableMutation, w as useDeclineReceivableMutation, y as useDeleteReceivableMutation, b as useIssueReceivableMutation, v as useUpdateReceivableMutation };
@@ -2,84 +2,97 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { getReceivablesIdHistoryOptions as e, getReceivablesIdMailsOptions as t, getReceivablesIdOptions as n, getReceivablesIdPdfLinkOptions as r, getReceivablesOptions as i } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
- import { withAuthEpoch as a } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
7
- import { useEmbedApi as o } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
- import { organizationHeaders as s } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
5
+ import { postReceivablesIdMarkAsPaid as e, postReceivablesIdMarkAsPartiallyPaid 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 { useQuery as c } from "@tanstack/react-query";
10
+ import { receivableHistoryInvalidationKey as o, receivableInvalidationKey as s, receivablesInvalidationKey as c } from "./index2.js";
11
+ import { useMutation as l } from "@tanstack/react-query";
11
12
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js
12
- function l({ enabled: e, ...t } = {}) {
13
- let { client: n, organizationId: r, widgetToken: l, authEpoch: u, organizationPending: d } = o(), f = !!(r && l) && (e === !0 || e === void 0), p = i({
14
- client: n,
15
- headers: s(r),
16
- query: t
17
- });
18
- return c({
19
- ...a(p, {
20
- authEpoch: u,
21
- organizationPending: d
22
- }, { carryWithinOrg: !0 }),
23
- enabled: f
24
- });
25
- }
26
- function u(e, { enabled: t = !0 } = {}) {
27
- let { client: r, organizationId: i, widgetToken: l, authEpoch: u, organizationPending: d } = o(), f = !!(i && l && e) && t, p = n({
28
- client: r,
29
- headers: s(i),
30
- path: { receivable_id: e ?? "" }
31
- });
32
- return c({
33
- ...a(p, {
34
- authEpoch: u,
35
- organizationPending: d
36
- }),
37
- enabled: f
38
- });
13
+ async function u({ client: e, organizationId: t, receivableId: n }) {
14
+ await Promise.all([
15
+ r(c({
16
+ client: e,
17
+ organizationId: t
18
+ })),
19
+ r(s({
20
+ client: e,
21
+ organizationId: t,
22
+ receivableId: n
23
+ })),
24
+ r(o({
25
+ client: e,
26
+ organizationId: t,
27
+ receivableId: n
28
+ }))
29
+ ]);
39
30
  }
40
- function d(t, { enabled: n, ...r } = {}) {
41
- let { client: i, organizationId: l, widgetToken: u, authEpoch: d, organizationPending: f } = o(), p = !!(l && u && t) && (n === !0 || n === void 0), m = e({
42
- client: i,
43
- headers: s(l),
44
- path: { receivable_id: t ?? "" },
45
- query: r
46
- });
47
- return c({
48
- ...a(m, {
49
- authEpoch: d,
50
- organizationPending: f
51
- }),
52
- enabled: p
31
+ function d() {
32
+ let { client: t, organizationId: n } = i();
33
+ return l({
34
+ mutationFn: async ({ path: r, body: i }) => {
35
+ let { data: o } = await e({
36
+ client: t,
37
+ headers: a(n),
38
+ path: r,
39
+ body: i,
40
+ throwOnError: !0
41
+ });
42
+ return o;
43
+ },
44
+ onSuccess: async (e, r) => {
45
+ await u({
46
+ client: t,
47
+ organizationId: n,
48
+ receivableId: r.path.receivable_id
49
+ });
50
+ }
53
51
  });
54
52
  }
55
- function f(e, { enabled: n, ...r } = {}) {
56
- let { client: i, organizationId: l, widgetToken: u, authEpoch: d, organizationPending: f } = o(), p = !!(l && u && e) && (n === !0 || n === void 0), m = t({
57
- client: i,
58
- headers: s(l),
59
- path: { receivable_id: e ?? "" },
60
- query: r
61
- });
62
- return c({
63
- ...a(m, {
64
- authEpoch: d,
65
- organizationPending: f
66
- }),
67
- enabled: p
53
+ function f() {
54
+ let { client: e, organizationId: n } = i();
55
+ return l({
56
+ mutationFn: async ({ path: r, body: i }) => {
57
+ let { data: o } = await t({
58
+ client: e,
59
+ headers: a(n),
60
+ path: r,
61
+ body: i,
62
+ throwOnError: !0
63
+ });
64
+ return o;
65
+ },
66
+ onSuccess: async (t, r) => {
67
+ await u({
68
+ client: e,
69
+ organizationId: n,
70
+ receivableId: r.path.receivable_id
71
+ });
72
+ }
68
73
  });
69
74
  }
70
- function p(e, { enabled: t = !0 } = {}) {
71
- let { client: n, organizationId: i, widgetToken: l, authEpoch: u, organizationPending: d } = o(), f = !!(i && l && e) && t, p = r({
72
- client: n,
73
- headers: s(i),
74
- path: { receivable_id: e ?? "" }
75
- });
76
- return c({
77
- ...a(p, {
78
- authEpoch: u,
79
- organizationPending: d
80
- }),
81
- enabled: f
75
+ function p() {
76
+ let { client: e, organizationId: t } = i();
77
+ return l({
78
+ mutationFn: async ({ path: r, body: i }) => {
79
+ let { data: o } = await n({
80
+ client: e,
81
+ headers: a(t),
82
+ path: r,
83
+ body: i,
84
+ throwOnError: !0
85
+ });
86
+ return o;
87
+ },
88
+ onSuccess: async (n, r) => {
89
+ await u({
90
+ client: e,
91
+ organizationId: t,
92
+ receivableId: r.path.receivable_id
93
+ });
94
+ }
82
95
  });
83
96
  }
84
97
  //#endregion
85
- export { d as useReceivableHistoryQuery, f as useReceivableMailsQuery, p as useReceivablePdfLinkQuery, u as useReceivableQuery, l as useReceivablesQuery };
98
+ export { d as useMarkReceivablePaidMutation, f as useMarkReceivablePartiallyPaidMutation, p as useMarkReceivableUncollectibleMutation };
@@ -2,6 +2,84 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
+ import { getReceivablesIdHistoryOptions as e, getReceivablesIdMailsOptions as t, getReceivablesIdOptions as n, getReceivablesIdPdfLinkOptions as r, getReceivablesOptions as i } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
+ import { withAuthEpoch as a } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
7
+ import { useEmbedApi as o } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
+ import { organizationHeaders as s } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
5
9
  import "../../../shared/data-access/dist/index.js";
6
- import "./index2.js";
7
- import "@tanstack/react-query";
10
+ import { useQuery as c } from "@tanstack/react-query";
11
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js
12
+ function l({ enabled: e, ...t } = {}) {
13
+ let { client: n, organizationId: r, widgetToken: l, authEpoch: u, organizationPending: d } = o(), f = !!(r && l) && (e === !0 || e === void 0), p = i({
14
+ client: n,
15
+ headers: s(r),
16
+ query: t
17
+ });
18
+ return c({
19
+ ...a(p, {
20
+ authEpoch: u,
21
+ organizationPending: d
22
+ }, { carryWithinOrg: !0 }),
23
+ enabled: f
24
+ });
25
+ }
26
+ function u(e, { enabled: t = !0 } = {}) {
27
+ let { client: r, organizationId: i, widgetToken: l, authEpoch: u, organizationPending: d } = o(), f = !!(i && l && e) && t, p = n({
28
+ client: r,
29
+ headers: s(i),
30
+ path: { receivable_id: e ?? "" }
31
+ });
32
+ return c({
33
+ ...a(p, {
34
+ authEpoch: u,
35
+ organizationPending: d
36
+ }),
37
+ enabled: f
38
+ });
39
+ }
40
+ function d(t, { enabled: n, ...r } = {}) {
41
+ let { client: i, organizationId: l, widgetToken: u, authEpoch: d, organizationPending: f } = o(), p = !!(l && u && t) && (n === !0 || n === void 0), m = e({
42
+ client: i,
43
+ headers: s(l),
44
+ path: { receivable_id: t ?? "" },
45
+ query: r
46
+ });
47
+ return c({
48
+ ...a(m, {
49
+ authEpoch: d,
50
+ organizationPending: f
51
+ }),
52
+ enabled: p
53
+ });
54
+ }
55
+ function f(e, { enabled: n, ...r } = {}) {
56
+ let { client: i, organizationId: l, widgetToken: u, authEpoch: d, organizationPending: f } = o(), p = !!(l && u && e) && (n === !0 || n === void 0), m = t({
57
+ client: i,
58
+ headers: s(l),
59
+ path: { receivable_id: e ?? "" },
60
+ query: r
61
+ });
62
+ return c({
63
+ ...a(m, {
64
+ authEpoch: d,
65
+ organizationPending: f
66
+ }),
67
+ enabled: p
68
+ });
69
+ }
70
+ function p(e, { enabled: t = !0 } = {}) {
71
+ let { client: n, organizationId: i, widgetToken: l, authEpoch: u, organizationPending: d } = o(), f = !!(i && l && e) && t, p = r({
72
+ client: n,
73
+ headers: s(i),
74
+ path: { receivable_id: e ?? "" }
75
+ });
76
+ return c({
77
+ ...a(p, {
78
+ authEpoch: u,
79
+ organizationPending: d
80
+ }),
81
+ enabled: f
82
+ });
83
+ }
84
+ //#endregion
85
+ export { d as useReceivableHistoryQuery, f as useReceivableMailsQuery, p as useReceivablePdfLinkQuery, u as useReceivableQuery, l as useReceivablesQuery };
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import "../../../shared/data-access/dist/index.js";
6
+ import "./index2.js";
7
+ import "@tanstack/react-query";
@@ -3,7 +3,7 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { buildReceivableRows as e, statusFilterOptions as t, typeForTab as n } from "./index5.js";
6
- import { useReceivablesQuery as r } from "../../data-access/dist/index6.js";
6
+ import { useReceivablesQuery as r } from "../../data-access/dist/index7.js";
7
7
  import "../../data-access/dist/index.js";
8
8
  import { useCallback as i, useEffect as a, useMemo as o, useState as s } from "react";
9
9
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js
@@ -4,9 +4,9 @@
4
4
  "use client";
5
5
  import { extractApiErrorMessage as e } from "../../../shared/util/dist/lib/apiErrors.js";
6
6
  import { defaultPaymentValues as t, defaultSendValues as n, fromMajorUnits as r, hasPaymentErrors as i, hasSendErrors as a, splitEmailList as o, validatePaymentValues as s, validateSendValues as c } from "./index5.js";
7
- import { useSendReceivableEmailMutation as l } from "../../data-access/dist/index3.js";
8
- import { useAcceptReceivableMutation as ee, useCancelReceivableMutation as te, useCloneReceivableMutation as u, useDeclineReceivableMutation as d, useDeleteReceivableMutation as f, useIssueReceivableMutation as p } from "../../data-access/dist/index4.js";
9
- import { useMarkReceivablePaidMutation as m, useMarkReceivablePartiallyPaidMutation as h, useMarkReceivableUncollectibleMutation as g } from "../../data-access/dist/index5.js";
7
+ import { useSendReceivableEmailMutation as l } from "../../data-access/dist/index4.js";
8
+ import { useAcceptReceivableMutation as ee, useCancelReceivableMutation as te, useCloneReceivableMutation as u, useDeclineReceivableMutation as d, useDeleteReceivableMutation as f, useIssueReceivableMutation as p } from "../../data-access/dist/index5.js";
9
+ import { useMarkReceivablePaidMutation as m, useMarkReceivablePartiallyPaidMutation as h, useMarkReceivableUncollectibleMutation as g } from "../../data-access/dist/index6.js";
10
10
  import "../../data-access/dist/index.js";
11
11
  import { useCallback as _, useState as v } from "react";
12
12
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index7.js
@@ -3,7 +3,7 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { buildReceivableDetailsView as e } from "./index5.js";
6
- import { useReceivableHistoryQuery as t, useReceivableMailsQuery as n, useReceivablePdfLinkQuery as r, useReceivableQuery as i } from "../../data-access/dist/index6.js";
6
+ import { useReceivableHistoryQuery as t, useReceivableMailsQuery as n, useReceivablePdfLinkQuery as r, useReceivableQuery as i } from "../../data-access/dist/index7.js";
7
7
  import "../../data-access/dist/index.js";
8
8
  import { useMemo as a } from "react";
9
9
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js
@@ -10,7 +10,7 @@ import { COUNTERPART_MESSAGE_LABELS_EN as i } from "../../../shared/counterpart-
10
10
  import { useCounterpartForm as ee } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
11
11
  import "../../../shared/counterpart-management/feature/dist/index.js";
12
12
  import { createEmptyReceivableFormValues as a, createLineItem as o, getPaymentTermOptions as s, hasReceivableFormErrors as c, receivableFormValuesToCreatePayload as l, receivableFormValuesToLineItemChanges as u, receivableFormValuesToUpdatePayload as te, receivableToFormValues as d, validateReceivableForm as f } from "./index5.js";
13
- import { useCreateReceivableMutation as p, useUpdateReceivableMutation as m } from "../../data-access/dist/index4.js";
13
+ import { useCreateReceivableMutation as p, useUpdateReceivableMutation as m } from "../../data-access/dist/index5.js";
14
14
  import "../../data-access/dist/index.js";
15
15
  import { PRODUCT_MESSAGE_LABELS_EN as ne } from "../../../shared/product-catalog/feature/dist/lib/labels.js";
16
16
  import { EMPTY_PRODUCT_FORM_VALUES as re, getCurrencyOptions as ie } from "../../../shared/product-catalog/feature/dist/lib/helpers.js";
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.5.179", n = "0c9c798044788e78dbcfadeeef124e1607accdbe", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.181", n = "ce2f6c5170bf0f6ef337971adcf7467d4d5c2baf", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.179",
3
+ "version": "0.5.181",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {