@tesouro/embedded-components-react 0.11.277 → 0.11.279

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.
Files changed (25) hide show
  1. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +8 -9
  2. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +169 -24
  3. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +46 -176
  4. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +94 -42
  5. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js +5 -103
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index14.js +91 -5
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index15.js +189 -70
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index16.js +19 -202
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +64 -1
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +28 -66
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +34 -28
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +3 -3
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +2 -2
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableAttachmentUploads.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +3 -3
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +2 -2
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useRecurringSeriesTable.js +2 -2
  23. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  24. package/package.json +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index17.js +0 -28
@@ -1,104 +1,6 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
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
- import "../../../shared/data-access/dist/index.js";
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";
12
1
  // ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js
13
- async function f({ client: e, organizationId: t, receivableId: n }) {
14
- await Promise.all([
15
- r(u({
16
- client: e,
17
- organizationId: t
18
- })),
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
- ]);
38
- }
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
- }
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
- });
79
- }
80
- });
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
- }
102
- });
103
- }
104
- export { m as useCreateReceivablePaymentRecordMutation, p as useMarkReceivablePaidMutation, h as useMarkReceivableUncollectibleMutation };
2
+ var e = {
3
+ staleTime: 6e4,
4
+ refetchOnWindowFocus: (e) => e.state.status !== "error"
5
+ };
6
+ export { e as REFETCH_ON_RETURN };
@@ -1,6 +1,92 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
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";
9
+ import "../../../shared/data-access/dist/index.js";
10
+ import { REFETCH_ON_RETURN as s } from "./index13.js";
11
+ import { useQueries as c, useQuery as l } from "@tanstack/react-query";
1
12
  // ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index14.js
2
- var e = {
3
- staleTime: 6e4,
4
- refetchOnWindowFocus: (e) => e.state.status !== "error"
5
- };
6
- export { e as REFETCH_ON_RETURN };
13
+ function u({ enabled: e, ...t } = {}) {
14
+ let { client: r, organizationId: c, widgetToken: u, authEpoch: d, organizationStatus: f } = a(), p = !!(c && u) && (e === !0 || e === void 0), m = n({
15
+ client: r,
16
+ headers: o(c),
17
+ query: t
18
+ });
19
+ return l({
20
+ ...i(m, {
21
+ authEpoch: d,
22
+ organizationStatus: f
23
+ }, { carryWithinOrg: !0 }),
24
+ ...s,
25
+ enabled: p
26
+ });
27
+ }
28
+ function d(t, { enabled: n = !0 } = {}) {
29
+ let { client: r, organizationId: c, widgetToken: u, authEpoch: d, organizationStatus: f } = a(), p = !!(c && u && t) && n, m = e({
30
+ client: r,
31
+ headers: o(c),
32
+ path: { receivable_id: t ?? "" }
33
+ });
34
+ return l({
35
+ ...i(m, {
36
+ authEpoch: d,
37
+ organizationStatus: f
38
+ }),
39
+ ...s,
40
+ enabled: p
41
+ });
42
+ }
43
+ var f = (e) => e.map((e) => e.data);
44
+ function p(t, { enabled: n = !0 } = {}) {
45
+ let { client: r, organizationId: s, widgetToken: l, authEpoch: u, organizationStatus: d } = a(), p = !!(s && l) && n;
46
+ return c({
47
+ queries: t.map((t) => ({
48
+ ...i(e({
49
+ client: r,
50
+ headers: o(s),
51
+ path: { receivable_id: t }
52
+ }), {
53
+ authEpoch: u,
54
+ organizationStatus: d
55
+ }),
56
+ enabled: p
57
+ })),
58
+ combine: f
59
+ });
60
+ }
61
+ function m({ enabled: e, ...t } = {}) {
62
+ let { client: n, organizationId: s, widgetToken: c, authEpoch: u, organizationStatus: d } = a(), f = !!(s && c) && (e === !0 || e === void 0), p = r({
63
+ client: n,
64
+ headers: o(s),
65
+ query: t
66
+ });
67
+ return l({
68
+ ...i(p, {
69
+ authEpoch: u,
70
+ organizationStatus: d
71
+ }),
72
+ enabled: f
73
+ });
74
+ }
75
+ var h = 1e3, g = 30;
76
+ function _(e, { enabled: n = !0 } = {}) {
77
+ let { client: r, organizationId: s, widgetToken: c, authEpoch: u, organizationStatus: d } = a(), f = !!(s && c && e) && n, p = t({
78
+ client: r,
79
+ headers: o(s),
80
+ path: { receivable_id: e ?? "" }
81
+ });
82
+ return l({
83
+ ...i(p, {
84
+ authEpoch: u,
85
+ organizationStatus: d
86
+ }),
87
+ enabled: f,
88
+ refetchInterval: ({ state: e }) => e.data?.file_url || e.dataUpdateCount + e.errorUpdateCount > g ? !1 : h,
89
+ refetchIntervalInBackground: !0
90
+ });
91
+ }
92
+ export { _ as useReceivablePdfLinkQuery, d as useReceivableQuery, m as useReceivableRequiredFieldsQuery, p as useReceivablesByIdQueries, u as useReceivablesQuery };
@@ -2,91 +2,210 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
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";
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, getRecurrencesOptions as u } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
+ import { withAuthEpoch as d } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
+ import { invalidateAllClients as f } from "../../../shared/data-access/dist/lib/clientRegistry.js";
9
+ import { useEmbedApi as p } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
10
+ import { organizationHeaders as m } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
9
11
  import "../../../shared/data-access/dist/index.js";
10
- import { REFETCH_ON_RETURN as s } from "./index14.js";
11
- import { useQueries as c, useQuery as l } from "@tanstack/react-query";
12
+ import { overdueRemindersInvalidationKey as h, paymentRemindersInvalidationKey as g, recurrenceInvalidationKey as _, recurrencesInvalidationKey as v } from "./index2.js";
13
+ import { invalidateReceivable as y } from "./index8.js";
14
+ import { REFETCH_ON_RETURN as b } from "./index13.js";
15
+ import { useMutation as x, useQuery as S } from "@tanstack/react-query";
12
16
  // ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index15.js
13
- function u({ enabled: e, ...t } = {}) {
14
- let { client: r, organizationId: c, widgetToken: u, authEpoch: d, organizationStatus: f } = a(), p = !!(c && u) && (e === !0 || e === void 0), m = n({
15
- client: r,
16
- headers: o(c),
17
- query: t
17
+ function C() {
18
+ let e = p();
19
+ return {
20
+ ...e,
21
+ isEnabled: !!(e.organizationId && e.widgetToken)
22
+ };
23
+ }
24
+ function w({ enabled: e = !0 } = {}) {
25
+ let { client: t, organizationId: n, authEpoch: r, organizationStatus: i, isEnabled: a } = C(), o = c({
26
+ client: t,
27
+ headers: m(n)
18
28
  });
19
- return l({
20
- ...i(m, {
21
- authEpoch: d,
22
- organizationStatus: f
23
- }, { carryWithinOrg: !0 }),
24
- ...s,
25
- enabled: p
29
+ return S({
30
+ ...d(o, {
31
+ authEpoch: r,
32
+ organizationStatus: i
33
+ }),
34
+ enabled: a && e
26
35
  });
27
36
  }
28
- function d(t, { enabled: n = !0 } = {}) {
29
- let { client: r, organizationId: c, widgetToken: u, authEpoch: d, organizationStatus: f } = a(), p = !!(c && u && t) && n, m = e({
30
- client: r,
31
- headers: o(c),
32
- path: { receivable_id: t ?? "" }
37
+ function T({ enabled: e = !0 } = {}) {
38
+ let { client: t, organizationId: n, authEpoch: r, organizationStatus: i, isEnabled: a } = C(), o = s({
39
+ client: t,
40
+ headers: m(n)
33
41
  });
34
- return l({
35
- ...i(m, {
36
- authEpoch: d,
37
- organizationStatus: f
42
+ return S({
43
+ ...d(o, {
44
+ authEpoch: r,
45
+ organizationStatus: i
38
46
  }),
39
- ...s,
40
- enabled: p
47
+ enabled: a && e
41
48
  });
42
49
  }
43
- var f = (e) => e.map((e) => e.data);
44
- function p(t, { enabled: n = !0 } = {}) {
45
- let { client: r, organizationId: s, widgetToken: l, authEpoch: u, organizationStatus: d } = a(), p = !!(s && l) && n;
46
- return c({
47
- queries: t.map((t) => ({
48
- ...i(e({
49
- client: r,
50
- headers: o(s),
51
- path: { receivable_id: t }
52
- }), {
53
- authEpoch: u,
54
- organizationStatus: d
55
- }),
56
- enabled: p
57
- })),
58
- combine: f
50
+ function E({ enabled: e = !0 } = {}) {
51
+ let { client: t, organizationId: n, authEpoch: r, organizationStatus: i, isEnabled: a } = C(), o = u({
52
+ client: t,
53
+ headers: m(n)
54
+ });
55
+ return S({
56
+ ...d(o, {
57
+ authEpoch: r,
58
+ organizationStatus: i
59
+ }),
60
+ ...b,
61
+ enabled: a && e
59
62
  });
60
63
  }
61
- function m({ enabled: e, ...t } = {}) {
62
- let { client: n, organizationId: s, widgetToken: c, authEpoch: u, organizationStatus: d } = a(), f = !!(s && c) && (e === !0 || e === void 0), p = r({
63
- client: n,
64
- headers: o(s),
65
- query: t
64
+ function D() {
65
+ let { client: e, organizationId: t } = p();
66
+ return x({
67
+ mutationFn: async ({ body: r }) => {
68
+ let { data: i } = await n({
69
+ client: e,
70
+ headers: m(t),
71
+ body: r,
72
+ throwOnError: !0
73
+ });
74
+ return i;
75
+ },
76
+ onSuccess: async () => {
77
+ await f(g({
78
+ client: e,
79
+ organizationId: t
80
+ }));
81
+ }
66
82
  });
67
- return l({
68
- ...i(p, {
69
- authEpoch: u,
70
- organizationStatus: d
71
- }),
72
- enabled: f
83
+ }
84
+ function O() {
85
+ let { client: e, organizationId: n } = p();
86
+ return x({
87
+ mutationFn: async ({ body: r }) => {
88
+ let { data: i } = await t({
89
+ client: e,
90
+ headers: m(n),
91
+ body: r,
92
+ throwOnError: !0
93
+ });
94
+ return i;
95
+ },
96
+ onSuccess: async () => {
97
+ await f(h({
98
+ client: e,
99
+ organizationId: n
100
+ }));
101
+ }
73
102
  });
74
103
  }
75
- var h = 1e3, g = 30;
76
- function _(e, { enabled: n = !0 } = {}) {
77
- let { client: r, organizationId: s, widgetToken: c, authEpoch: u, organizationStatus: d } = a(), f = !!(s && c && e) && n, p = t({
78
- client: r,
79
- headers: o(s),
80
- path: { receivable_id: e ?? "" }
104
+ async function k({ client: e, organizationId: t, recurrenceId: n, receivableId: r }) {
105
+ await Promise.all([
106
+ f(v({
107
+ client: e,
108
+ organizationId: t
109
+ })),
110
+ ...n ? [f(_({
111
+ client: e,
112
+ organizationId: t,
113
+ recurrenceId: n
114
+ }))] : [],
115
+ y({
116
+ client: e,
117
+ organizationId: t,
118
+ receivableId: r
119
+ })
120
+ ]);
121
+ }
122
+ function A(e) {
123
+ let { client: t, organizationId: n, authEpoch: r, organizationStatus: i, isEnabled: a } = C(), o = l({
124
+ client: t,
125
+ headers: m(n),
126
+ path: { recurrence_id: e ?? "" }
81
127
  });
82
- return l({
83
- ...i(p, {
84
- authEpoch: u,
85
- organizationStatus: d
128
+ return S({
129
+ ...d(o, {
130
+ authEpoch: r,
131
+ organizationStatus: i
86
132
  }),
87
- enabled: f,
88
- refetchInterval: ({ state: e }) => e.data?.file_url || e.dataUpdateCount + e.errorUpdateCount > g ? !1 : h,
89
- refetchIntervalInBackground: !0
133
+ ...b,
134
+ enabled: a && !!e
90
135
  });
91
136
  }
92
- export { _ as useReceivablePdfLinkQuery, d as useReceivableQuery, m as useReceivableRequiredFieldsQuery, p as useReceivablesByIdQueries, u as useReceivablesQuery };
137
+ function j() {
138
+ let { client: e, organizationId: t } = p();
139
+ return x({
140
+ mutationFn: async ({ body: n }) => {
141
+ let { data: i } = await r({
142
+ client: e,
143
+ headers: m(t),
144
+ body: n,
145
+ throwOnError: !0
146
+ });
147
+ return i;
148
+ },
149
+ onSuccess: async (n, r) => {
150
+ await k({
151
+ client: e,
152
+ organizationId: t,
153
+ receivableId: r.body.invoice_id
154
+ });
155
+ }
156
+ });
157
+ }
158
+ function M() {
159
+ let { client: t, organizationId: n } = p();
160
+ return x({
161
+ mutationFn: async ({ path: r, body: i }) => {
162
+ let { data: a } = await e({
163
+ client: t,
164
+ headers: m(n),
165
+ path: r,
166
+ body: i,
167
+ throwOnError: !0
168
+ });
169
+ return a;
170
+ },
171
+ onSuccess: async (e, r) => {
172
+ await k({
173
+ client: t,
174
+ organizationId: n,
175
+ recurrenceId: r.path.recurrence_id
176
+ });
177
+ }
178
+ });
179
+ }
180
+ function N(e) {
181
+ let { client: t, organizationId: n } = p();
182
+ return x({
183
+ mutationFn: async ({ path: r }) => {
184
+ let { data: i } = await e({
185
+ client: t,
186
+ headers: m(n),
187
+ path: r,
188
+ throwOnError: !0
189
+ });
190
+ return i;
191
+ },
192
+ onSuccess: async (e, r) => {
193
+ await k({
194
+ client: t,
195
+ organizationId: n,
196
+ recurrenceId: r.path.recurrence_id,
197
+ receivableId: r.receivableId
198
+ });
199
+ }
200
+ });
201
+ }
202
+ function P() {
203
+ return N(i);
204
+ }
205
+ function F() {
206
+ return N(a);
207
+ }
208
+ function I() {
209
+ return N(o);
210
+ }
211
+ export { P as useCancelRecurrenceMutation, O as useCreateOverdueReminderMutation, D as useCreatePaymentReminderMutation, j as useCreateRecurrenceMutation, T as useOverdueRemindersQuery, F as usePauseRecurrenceMutation, w as usePaymentRemindersQuery, A as useRecurrenceQuery, E as useRecurrencesQuery, I as useResumeRecurrenceMutation, M as useUpdateRecurrenceMutation };