@tesouro/embedded-components-react 0.5.180 → 0.5.182

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 (33) hide show
  1. package/README.md +32 -32
  2. package/dist/index.d.ts +18 -19
  3. package/dist/index.js +2 -2
  4. package/dist/lib/CreditCardsWidget.d.ts +9 -11
  5. package/dist/lib/CreditCardsWidget.js +1 -1
  6. package/dist/lib/DebitCardsWidget.d.ts +14 -15
  7. package/dist/lib/DebitCardsWidget.js +1 -1
  8. package/dist/lib/WidgetSuite.d.ts +13 -15
  9. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index.js +4 -4
  10. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index10.js +87 -8
  11. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js +3 -3
  12. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index12.js +17 -0
  13. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index4.js +17 -24
  14. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index5.js +23 -24
  15. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index6.js +24 -30
  16. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index7.js +28 -55
  17. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +53 -222
  18. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +219 -87
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +6 -5
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +2 -32
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +23 -190
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +152 -46
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +84 -71
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +80 -2
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +7 -0
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index7.js +3 -3
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +1 -1
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +1 -1
  30. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  31. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index9.js +3 -3
  32. package/package.json +1 -1
  33. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index3.js +0 -19
@@ -2,96 +2,228 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { WidgetProvider as e } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
5
+ import { useAllBankAccountsQuery as e } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
6
+ import "../../../shared/data-access/dist/index.js";
7
+ import { useAnalyticsTrack as t } from "../../../shared/feature/dist/lib/analytics/hooks.js";
8
+ import { useWidgetConfig as n, useWidgetError as ee, useWidgetLoading as te } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
9
+ import { CardProgram as r } from "../../../shared/feature/dist/lib/card/cardProgram.js";
6
10
  import "../../../shared/feature/dist/index.js";
7
- import { WIDGET_NAME as t } from "./index2.js";
8
- import { cardsListDetailsSheetTestIds as n, cardsListTestIds as r } from "./index3.js";
9
- import { resolveCardsListLabels as i } from "../../ui/dist/lib/CardsList/labels.js";
10
- import { CardsList as a } from "../../ui/dist/lib/CardsList/CardsList.js";
11
- import { CardsListDetailsSheet as o } from "../../ui/dist/lib/CardsList/CardsListDetailsSheet.js";
12
- import "../../ui/dist/index.js";
13
- import { useCardsWidget as s } from "./index8.js";
14
- import { CardDetailsWidget as c } from "../../../card-details-widget/feature/dist/index13.js";
15
- import "../../../card-details-widget/feature/dist/index.js";
16
- import { CreateCardWidget as l } from "../../create-card/feature/dist/index8.js";
17
- import "../../create-card/feature/dist/index.js";
18
- import { useCallback as u, useMemo as d, useState as f } from "react";
19
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
11
+ import { resolveCardsFeatureLabels as ne } from "./index5.js";
12
+ import { getCardsPermissions as re } from "./index7.js";
13
+ import { CardsWidgetAnalyticsEvent as ie } from "./index2.js";
14
+ import { maskAccountNumber as ae } from "./index6.js";
15
+ import { CARD_COLUMNS_BY_PROGRAM as oe, toCardRows as se, toCreditCardListItems as ce, toDebitCardListItems as le } from "./index8.js";
16
+ import { useCreditCardsQuery as ue } from "../../data-access/dist/index2.js";
17
+ import { useDebitCardsQuery as de } from "../../data-access/dist/index3.js";
18
+ import "../../data-access/dist/index.js";
19
+ import { useCallback as i, useEffect as a, useMemo as o, useRef as fe, useState as s } from "react";
20
+ import { useControllableState as pe } from "@radix-ui/react-use-controllable-state";
20
21
  //#region ../../libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js
21
- function g({ cardProgram: e, pagination: t, defaultPagination: g, onPaginationChange: _, labels: v, featureLabels: y, selectedCardId: b, defaultSelectedCardId: x, onSelectedCardIdChange: S, cardDetailsLabels: C, cardDetailsFeatureLabels: w, cardDetailsActivateLabels: T, bankLogoSrc: E, bankLogoAlt: D, cardArtSrc: O, createCardLabels: k, createCardFeatureLabels: A, onCreateCard: j, onActivateCard: M, headerStart: ee }) {
22
- let { selectedCardId: N, onSelectCard: P, onCreateCardClick: F, canCreateCard: I, canReadCards: L, ...R } = s({
23
- cardProgram: e,
24
- pagination: t,
25
- defaultPagination: g,
26
- onPaginationChange: _,
27
- featureLabels: y,
28
- selectedCardId: b,
29
- defaultSelectedCardId: x,
30
- onSelectedCardIdChange: S,
31
- onCreateCard: j,
32
- onActivateCard: M,
33
- cardArtSrc: O
34
- }), z = d(() => i(v), [v]), [B, V] = f(!1), [H, U] = f(0), [W, G] = f(N), [K, q] = f(null), J = u(() => {
35
- N !== null && P(null), U((e) => e + 1), V(!0);
36
- }, [N, P]), Y = u(() => {
37
- V(!1), N !== null && P(null);
38
- }, [N, P]), X = u((e) => {
39
- V(!1), P(e);
40
- }, [P]), Z = e === "debit" && !!O && !!I && F === void 0, Q = B && N === null && Z;
41
- B && (N !== null || !Z) && V(!1), Q ? K !== "create" && q("create") : N !== null && (K !== "details" && q("details"), N !== W && G(N));
42
- let $ = K === "create", te = N !== null || Q;
43
- return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(a, {
44
- ...R,
45
- canCreateCard: I,
46
- onCreateCardClick: F ?? J,
47
- headerStart: ee,
48
- labels: z,
49
- testIds: r
50
- }), /* @__PURE__ */ m(o, {
51
- isOpen: te,
52
- labels: $ ? z.createSheet : z.detailsSheet,
53
- contentClassName: $ ? "ttw:overflow-hidden ttw:p-0 ttw:min-h-0" : void 0,
54
- onClose: Y,
55
- testIds: n,
56
- children: $ && Z && O ? /* @__PURE__ */ m(l, {
57
- cardArtSrc: O,
58
- labels: k,
59
- featureLabels: A,
60
- onClose: Y,
61
- onCancel: Y,
62
- onViewCard: L ? X : void 0,
63
- className: "ttw:min-h-0 ttw:flex-1"
64
- }, H) : W === null ? null : /* @__PURE__ */ m(c, {
65
- cardId: W,
66
- cardProgram: e,
67
- labels: C,
68
- activateLabels: T,
69
- featureLabels: w,
70
- cardArtSrc: O,
71
- bankLogoSrc: E,
72
- bankLogoAlt: D,
73
- onClose: Y
74
- }, W)
75
- })] });
22
+ var me = [
23
+ 10,
24
+ 25,
25
+ 50
26
+ ], c = 10, he = "<none>";
27
+ function l(e, t) {
28
+ return e !== void 0 && t !== void 0 && e !== t;
76
29
  }
77
- function _({ baseUrl: n, widgetToken: r, organizationId: i, configClient: a, gatewayRouting: o, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: h, ..._ }) {
78
- return /* @__PURE__ */ m(e, {
79
- widgetName: t,
80
- baseUrl: n,
81
- widgetToken: r,
82
- organizationId: i,
83
- configClient: a,
84
- gatewayRouting: o,
85
- linkComponent: s,
86
- implementation: c,
87
- uiFramework: l,
88
- errorFallback: u,
89
- onError: d,
90
- analytics: f,
91
- disclosuresAcceptance: p,
92
- providerLabels: h,
93
- children: /* @__PURE__ */ m(g, { ..._ })
30
+ function u(e) {
31
+ let t = Number.isInteger(e?.pageSize) && Number(e?.pageSize) > 0 ? Number(e?.pageSize) : c;
32
+ return {
33
+ paginationToken: e?.paginationToken,
34
+ pageSize: t
35
+ };
36
+ }
37
+ function d({ cardProgram: c, pagination: d, defaultPagination: f, onPaginationChange: ge, featureLabels: p, selectedCardId: _e, defaultSelectedCardId: ve, onSelectedCardIdChange: ye, onCreateCard: m, onActivateCard: be }) {
38
+ let h = o(() => ne(p), [p]), g = t();
39
+ a(() => {
40
+ g(ie.Mounted);
41
+ }, [g]);
42
+ let { organizationId: _, widgetToken: xe, initResponse: v } = n(), y = v?.userId ?? void 0, Se = te(), b = !!ee(), x = !!(_ && xe), S = o(() => re({
43
+ cardProgram: c,
44
+ scopes: v?.scopes
45
+ }), [c, v?.scopes]), C = x && S.canRead && !!v, Ce = o(() => u(d), [d?.pageSize, d?.paginationToken]), w = o(() => u(f), [f?.pageSize, f?.paginationToken]), [T, we] = s(y);
46
+ y !== void 0 && y !== T && we(y);
47
+ let [E, Te] = s(_);
48
+ _ !== void 0 && _ !== E && Te(_);
49
+ let D = [
50
+ c,
51
+ E === null ? he : E ?? "",
52
+ T ?? ""
53
+ ].join("\0"), O = [
54
+ D,
55
+ w.paginationToken ?? "",
56
+ w.pageSize
57
+ ].join("\0"), k = d !== void 0, [A, j] = s(() => ({
58
+ resetKey: O,
59
+ paginationToken: w.paginationToken,
60
+ pageSize: w.pageSize
61
+ })), [Ee, M] = s(!1), [De, N] = pe({
62
+ prop: _e,
63
+ defaultProp: ve ?? null,
64
+ onChange: ye,
65
+ caller: "CardsWidget"
66
+ }), P = fe({
67
+ cardProgram: c,
68
+ organizationId: E,
69
+ userId: T
70
+ }), Oe = P.current.cardProgram !== c || l(P.current.organizationId, E) || l(P.current.userId, T);
71
+ a(() => {
72
+ let e = P.current;
73
+ P.current = {
74
+ cardProgram: c,
75
+ organizationId: E,
76
+ userId: T
77
+ }, (e.cardProgram !== c || l(e.organizationId, E) || l(e.userId, T)) && (N(null), M(!1));
78
+ }, [
79
+ c,
80
+ E,
81
+ T,
82
+ N
83
+ ]);
84
+ let F = i((e) => {
85
+ N(e);
86
+ }, [N]), I = Ee && !!y, ke = A.resetKey === O;
87
+ a(() => {
88
+ k || j((e) => e.resetKey === O ? e : {
89
+ resetKey: O,
90
+ paginationToken: w.paginationToken,
91
+ pageSize: w.pageSize
92
+ });
93
+ }, [
94
+ w.pageSize,
95
+ w.paginationToken,
96
+ k,
97
+ O
98
+ ]);
99
+ let L = k ? Ce : ke ? A : w, Ae = L.paginationToken, R = L.pageSize, z = I ? y : void 0, B = {
100
+ limit: R,
101
+ paginationToken: Ae
102
+ }, V = ue({
103
+ ...B,
104
+ userId: z,
105
+ enabled: C && c === r.Credit
106
+ }), H = de({
107
+ ...B,
108
+ cardholderUserId: z,
109
+ enabled: C && c === r.Debit
110
+ }), U = c === r.Credit ? V : H, W = C && S.canReadFundingAccounts, G = e({ enabled: W }), K = o(() => {
111
+ let e = /* @__PURE__ */ new Map();
112
+ if (!S.canReadFundingAccounts) return e;
113
+ for (let t of G.data?.data ?? []) {
114
+ let n = t.nickname?.trim();
115
+ e.set(t.id, n ? {
116
+ name: n,
117
+ lastFour: t.accountNumber?.trim().slice(-4) || void 0
118
+ } : { name: ae(t.accountNumber) ?? h.untitledFundingAccount });
119
+ }
120
+ return e;
121
+ }, [
122
+ G.data?.data,
123
+ h.untitledFundingAccount,
124
+ S.canReadFundingAccounts
125
+ ]), q = W && G.isError, je = W && !q && (G.isLoading || G.isFetchingNextPage || !!G.hasNextPage), J = o(() => C ? c === r.Credit ? ce(V.data?.data ?? []) : le(H.data?.data ?? []) : [], [
126
+ C,
127
+ c,
128
+ V.data?.data,
129
+ H.data?.data
130
+ ]), Me = o(() => se(J, {
131
+ labels: h,
132
+ fundingAccountNames: K,
133
+ canActivate: S.canActivate,
134
+ onCardSelect: F,
135
+ onActivateCard: be
136
+ }), [
137
+ J,
138
+ K,
139
+ F,
140
+ h,
141
+ be,
142
+ S.canActivate
143
+ ]), Y = U.data?.nextPaginationToken ?? void 0, X = U.data?.prevPaginationToken ?? void 0, Z = !!U.data, Ne = C && (U.isError || q), [Q, Pe] = s({
144
+ key: D,
145
+ value: !1
146
+ });
147
+ if (C && !I && Z) {
148
+ let e = Q.key !== D, t = !!y && J.some((e) => e.userId !== y) || !e && Q.value;
149
+ (e || Q.value !== t) && Pe({
150
+ key: D,
151
+ value: t
152
+ });
153
+ } else Q.key !== D && Pe({
154
+ key: D,
155
+ value: !1
94
156
  });
157
+ let Fe = Q.value, $ = i((e) => {
158
+ k || j({
159
+ resetKey: O,
160
+ paginationToken: e.paginationToken,
161
+ pageSize: e.pageSize
162
+ }), ge?.(e);
163
+ }, [
164
+ k,
165
+ ge,
166
+ O
167
+ ]), Ie = i(() => {
168
+ $({
169
+ paginationToken: void 0,
170
+ pageSize: R
171
+ });
172
+ }, [$, R]), Le = i((e) => {
173
+ $({
174
+ paginationToken: void 0,
175
+ pageSize: e
176
+ });
177
+ }, [$]), Re = i((e) => {
178
+ M(e), Ie();
179
+ }, [Ie]), ze = i(() => {
180
+ $({
181
+ paginationToken: X,
182
+ pageSize: R
183
+ });
184
+ }, [
185
+ $,
186
+ R,
187
+ X
188
+ ]), Be = i(() => {
189
+ $({
190
+ paginationToken: Y,
191
+ pageSize: R
192
+ });
193
+ }, [
194
+ $,
195
+ Y,
196
+ R
197
+ ]), Ve = U.refetch, He = G.refetch, Ue = i(() => {
198
+ Ve(), W && He();
199
+ }, [
200
+ W,
201
+ Ve,
202
+ He
203
+ ]);
204
+ return {
205
+ rows: Me,
206
+ selectedCardId: Oe ? null : De,
207
+ onSelectCard: F,
208
+ canReadCards: S.canRead,
209
+ columns: oe[c],
210
+ isLoading: !b && (!x || Se && !v || C && (U.isLoading || je)),
211
+ isError: b || Ne,
212
+ canToggleShowMyCards: S.canRead && !!y && Fe,
213
+ isShowingMyCards: I,
214
+ onShowMyCardsChange: Re,
215
+ canCreateCard: S.canCreate && (!!m || S.canComposeDebitCreate),
216
+ onCreateCardClick: m,
217
+ onRetry: Ue,
218
+ isPaginationVisible: C && Z && !Ne,
219
+ pageSize: R,
220
+ pageSizeOptions: me,
221
+ isPreviousPageDisabled: !X,
222
+ isNextPageDisabled: !Y,
223
+ onPageSizeChange: Le,
224
+ onPreviousPageClick: ze,
225
+ onNextPageClick: Be
226
+ };
95
227
  }
96
228
  //#endregion
97
- export { _ as CardsWidget, _ as default };
229
+ export { d as useCardsWidget };
@@ -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 };