@tesouro/embedded-components-react 0.5.116 → 0.5.118
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 +6 -6
- package/dist/index.css +13 -6
- package/dist/index.d.ts +31 -4
- package/dist/index.js +5 -4
- package/dist/lib/MarketingWidget.d.ts +31 -4
- package/dist/lib/MarketingWidget.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index10.js +25 -31
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index11.js +41 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index4.js +6 -15
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index5.js +15 -11
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index6.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index7.js +14 -37
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index8.js +43 -3
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index9.js +3 -31
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index2.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index3.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index4.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index5.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/data-access/dist/index3.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/data-access/dist/index4.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/data-access/dist/index5.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +25 -25
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js +12 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index12.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index13.js +168 -168
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js +44 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index18.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +24 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +81 -81
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +17 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +31 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index10.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index11.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index2.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index4.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index6.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index7.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index8.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index9.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index3.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index4.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index5.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index6.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index7.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index2.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index3.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index2.js +14 -14
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index3.js +14 -14
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index2.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index3.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index4.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index5.js +12 -12
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index6.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index2.js +22 -22
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +12 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +87 -87
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +44 -44
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +36 -36
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/data-access/dist/index2.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/data-access/dist/index4.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index3.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js +27 -23
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index2.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index3.js +8 -17
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index4.js +10 -80
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index5.js +16 -72
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index6.js +45 -0
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index7.js +109 -0
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index8.js +88 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index2.js +21 -21
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index3.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index4.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index5.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index6.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/data-access/dist/index2.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/data-access/dist/index3.js +22 -22
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index2.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index3.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index4.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index5.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index6.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index7.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index8.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/data-access/dist/index2.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index10.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index2.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index3.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index4.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index5.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index6.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index7.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index8.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index9.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index10.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index12.js +14 -14
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index13.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index14.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index15.js +59 -59
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index17.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index18.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index19.js +41 -41
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index2.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index21.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index22.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index23.js +41 -41
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index3.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index4.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index5.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index6.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index7.js +73 -73
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index8.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index9.js +20 -20
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js +61 -61
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/data-access/dist/lib/queryKeys.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index2.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index3.js +51 -51
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +63 -63
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index7.js +44 -44
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +35 -34
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/applicationStatusQueryOptions.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/external-bank-account/useAllExternalBankAccountsQuery.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useRolePermissionsQueries.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useCurrentUserQuery.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useGetUserDataQuery.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js +22 -21
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useUpsertUserDataMutation.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/widgetTokenCacheId.js +11 -0
- package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/data-access/dist/index2.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/data-access/dist/index3.js +14 -14
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index10.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index11.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index12.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index2.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index3.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index5.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index6.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index7.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index8.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index3.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index6.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index7.js +12 -12
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index8.js +11 -11
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { getPayables as e } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
|
+
import { getAnalyticsPayablesOptions as t, getPayablesIdOptions as n, getPayablesOptions as r, getPayablesQueryKey as i } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
7
|
+
import { withAuthEpoch as a } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
8
|
+
import { useEmbedApi as o } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
9
|
+
import { organizationHeaders as s } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
10
10
|
import "../../../shared/data-access/dist/index.js";
|
|
11
11
|
import { PAYABLE_COUNT_ANALYTICS as c } from "./index5.js";
|
|
12
12
|
import { OCR_POLL_INTERVAL_MS as l, payableOcrQueryOptions as u } from "./index4.js";
|
|
@@ -14,70 +14,70 @@ import { payablePolicyAssignmentQueryOptions as d } from "./index16.js";
|
|
|
14
14
|
import { useMemo as f } from "react";
|
|
15
15
|
import { queryOptions as p, useQueries as m, useQuery as h } from "@tanstack/react-query";
|
|
16
16
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js
|
|
17
|
-
function g({ enabled:
|
|
18
|
-
let { client:
|
|
19
|
-
client:
|
|
20
|
-
headers:
|
|
21
|
-
query:
|
|
17
|
+
function g({ enabled: e, pollWhileOcrProcessing: t = !1, ...n } = {}) {
|
|
18
|
+
let { client: i, organizationId: c, widgetToken: u, authEpoch: d } = o(), f = !!(c && u) && (e === !0 || e === void 0), p = r({
|
|
19
|
+
client: i,
|
|
20
|
+
headers: s(c),
|
|
21
|
+
query: n
|
|
22
22
|
});
|
|
23
23
|
return h({
|
|
24
|
-
...
|
|
24
|
+
...a(p, d),
|
|
25
25
|
enabled: f,
|
|
26
|
-
...
|
|
26
|
+
...t ? { refetchInterval: (e) => (e.state.data?.data ?? []).some((e) => e.ocr_status === "processing") ? l : !1 } : {}
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
var _ = 100;
|
|
30
|
-
function v({ enabled:
|
|
31
|
-
let { client:
|
|
30
|
+
function v({ enabled: t } = {}) {
|
|
31
|
+
let { client: n, organizationId: r, widgetToken: c, authEpoch: l } = o(), u = s(r), d = {
|
|
32
32
|
duplicate_match_status: "suspected",
|
|
33
33
|
limit: _
|
|
34
34
|
}, f = p({
|
|
35
|
-
queryKey: [...
|
|
36
|
-
client:
|
|
35
|
+
queryKey: [...i({
|
|
36
|
+
client: n,
|
|
37
37
|
headers: u,
|
|
38
38
|
query: d
|
|
39
39
|
}), "all"],
|
|
40
|
-
queryFn: async ({ signal:
|
|
41
|
-
let
|
|
40
|
+
queryFn: async ({ signal: t }) => {
|
|
41
|
+
let r = [], i = /* @__PURE__ */ new Set(), a;
|
|
42
42
|
do {
|
|
43
|
-
let { data: o } = await
|
|
44
|
-
client:
|
|
43
|
+
let { data: o } = await e({
|
|
44
|
+
client: n,
|
|
45
45
|
headers: u,
|
|
46
46
|
query: {
|
|
47
47
|
...d,
|
|
48
48
|
pagination_token: a
|
|
49
49
|
},
|
|
50
|
-
signal:
|
|
50
|
+
signal: t,
|
|
51
51
|
throwOnError: !0
|
|
52
52
|
});
|
|
53
|
-
|
|
53
|
+
r.push(...o.data ?? []);
|
|
54
54
|
let s = o.next_pagination_token ?? void 0;
|
|
55
|
-
a = s && !
|
|
55
|
+
a = s && !i.has(s) ? (i.add(s), s) : void 0;
|
|
56
56
|
} while (a);
|
|
57
|
-
return { data:
|
|
57
|
+
return { data: r };
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
return h({
|
|
61
|
-
...
|
|
62
|
-
enabled: !!(
|
|
61
|
+
...a(f, l),
|
|
62
|
+
enabled: !!(r && c) && t !== !1
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
function y({ enabled:
|
|
66
|
-
let { client:
|
|
67
|
-
client:
|
|
68
|
-
headers:
|
|
65
|
+
function y({ enabled: e } = {}) {
|
|
66
|
+
let { client: n, organizationId: r, widgetToken: i, authEpoch: l } = o(), u = !!(r && i) && (e === !0 || e === void 0), d = t({
|
|
67
|
+
client: n,
|
|
68
|
+
headers: s(r),
|
|
69
69
|
query: c
|
|
70
70
|
});
|
|
71
71
|
return h({
|
|
72
|
-
...
|
|
72
|
+
...a(d, l),
|
|
73
73
|
enabled: u,
|
|
74
74
|
select: (e) => ({ count: e.data[0]?.metric_value ?? 0 })
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
function b({ filters:
|
|
78
|
-
let { client:
|
|
79
|
-
...
|
|
80
|
-
client:
|
|
77
|
+
function b({ filters: e, enabled: n }) {
|
|
78
|
+
let { client: r, organizationId: i, widgetToken: l, authEpoch: u } = o(), d = s(i), p = !!(i && l) && (n === !0 || n === void 0), h = m({ queries: e.map((e) => ({
|
|
79
|
+
...a(t({
|
|
80
|
+
client: r,
|
|
81
81
|
headers: d,
|
|
82
82
|
query: {
|
|
83
83
|
...e,
|
|
@@ -91,19 +91,19 @@ function b({ filters: n, enabled: i }) {
|
|
|
91
91
|
isError: e.isError
|
|
92
92
|
})), [h]);
|
|
93
93
|
}
|
|
94
|
-
function x(
|
|
95
|
-
let { client: c, organizationId: l, widgetToken: f, authEpoch: p } =
|
|
94
|
+
function x(e, { enabled: t = !0, pollWhileOcrProcessing: r = !1, pollWhilePolicyAssignmentUnsettled: i = !1 } = {}) {
|
|
95
|
+
let { client: c, organizationId: l, widgetToken: f, authEpoch: p } = o(), m = !!(l && f && e) && t, g = r ? u({
|
|
96
96
|
client: c,
|
|
97
97
|
organizationId: l,
|
|
98
|
-
payableId:
|
|
99
|
-
}) : void 0, _ =
|
|
98
|
+
payableId: e ?? ""
|
|
99
|
+
}) : void 0, _ = i ? d({
|
|
100
100
|
client: c,
|
|
101
101
|
organizationId: l,
|
|
102
|
-
payableId:
|
|
103
|
-
}) : void 0, v = g ?? _ ??
|
|
102
|
+
payableId: e ?? ""
|
|
103
|
+
}) : void 0, v = g ?? _ ?? n({
|
|
104
104
|
client: c,
|
|
105
|
-
headers:
|
|
106
|
-
path: { payable_id:
|
|
105
|
+
headers: s(l),
|
|
106
|
+
path: { payable_id: e ?? "" }
|
|
107
107
|
}), y = g && _ ? {
|
|
108
108
|
...v,
|
|
109
109
|
refetchInterval: (e) => {
|
|
@@ -112,7 +112,7 @@ function x(n, { enabled: r = !0, pollWhileOcrProcessing: a = !1, pollWhilePolicy
|
|
|
112
112
|
}
|
|
113
113
|
} : v;
|
|
114
114
|
return h({
|
|
115
|
-
...
|
|
115
|
+
...a(y, p),
|
|
116
116
|
enabled: m
|
|
117
117
|
});
|
|
118
118
|
}
|
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index18.js
CHANGED
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { getPayablesIdSuggestionsOptions as e } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
6
|
+
import { withAuthEpoch as t } from "../../../shared/data-access/dist/lib/withAuthEpoch.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 { isApiNotFoundError as i } from "../../../shared/data-access/dist/lib/isApiNotFoundError.js";
|
|
10
10
|
import "../../../shared/data-access/dist/index.js";
|
|
11
11
|
import { useQuery as a } from "@tanstack/react-query";
|
|
12
12
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index18.js
|
|
13
13
|
function o(o, { enabled: s = !0 } = {}) {
|
|
14
|
-
let { client: c, organizationId: l, widgetToken: u, authEpoch: d } =
|
|
14
|
+
let { client: c, organizationId: l, widgetToken: u, authEpoch: d } = n(), f = !!(l && u && o) && s, p = e({
|
|
15
15
|
client: c,
|
|
16
|
-
headers:
|
|
16
|
+
headers: r(l),
|
|
17
17
|
path: { payable_id: o ?? "" }
|
|
18
|
-
}), { queryKey: m, queryFn: h } =
|
|
18
|
+
}), { queryKey: m, queryFn: h } = t(p, d);
|
|
19
19
|
return a({
|
|
20
20
|
queryKey: m,
|
|
21
21
|
enabled: f,
|
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getPayablesIdOptions as e } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
2
|
+
import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
3
3
|
import "../../../shared/data-access/dist/index.js";
|
|
4
4
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js
|
|
5
5
|
var n = 2500;
|
|
6
6
|
function r({ client: n, organizationId: r, payableId: i }) {
|
|
7
7
|
return {
|
|
8
|
-
...
|
|
8
|
+
...e({
|
|
9
9
|
client: n,
|
|
10
|
-
headers:
|
|
10
|
+
headers: t(r),
|
|
11
11
|
path: { payable_id: i }
|
|
12
12
|
}),
|
|
13
13
|
refetchInterval: (e) => e.state.data?.ocr_status === "processing" && 2500
|
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getAnalyticsPayablesQueryKey as e, getApprovalRequestsQueryKey as t, getPayablesIdHistoryQueryKey as n, getPayablesIdLineItemsQueryKey as r, getPayablesIdQueryKey as i, getPayablesQueryKey as a, getPaymentRecordsQueryKey as o } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
2
|
+
import { organizationHeaders as s } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
3
3
|
import "../../../shared/data-access/dist/index.js";
|
|
4
4
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js
|
|
5
5
|
var c = {
|
|
6
6
|
metric: "id",
|
|
7
7
|
aggregation_function: "count"
|
|
8
|
-
}, l = ({ client:
|
|
8
|
+
}, l = ({ client: e, organizationId: t }) => a({
|
|
9
|
+
client: e,
|
|
10
|
+
headers: s(t)
|
|
11
|
+
}), u = ({ client: e, organizationId: n }) => t({
|
|
12
|
+
client: e,
|
|
13
|
+
headers: s(n)
|
|
14
|
+
}), d = ({ client: t, organizationId: n }) => e({
|
|
9
15
|
client: t,
|
|
10
|
-
headers:
|
|
11
|
-
}), u = ({ client: t, organizationId: r }) => n({
|
|
12
|
-
client: t,
|
|
13
|
-
headers: e(r)
|
|
14
|
-
}), d = ({ client: n, organizationId: r }) => t({
|
|
15
|
-
client: n,
|
|
16
|
-
headers: e(r),
|
|
16
|
+
headers: s(n),
|
|
17
17
|
query: c
|
|
18
|
-
}), f = ({ client:
|
|
19
|
-
client:
|
|
20
|
-
headers:
|
|
21
|
-
path: { payable_id:
|
|
22
|
-
}), p = ({ client:
|
|
23
|
-
client:
|
|
24
|
-
headers:
|
|
25
|
-
path: { payable_id: i }
|
|
26
|
-
}), m = ({ client: t, organizationId: n, payableId: r }) => i({
|
|
27
|
-
client: t,
|
|
28
|
-
headers: e(n),
|
|
18
|
+
}), f = ({ client: e, organizationId: t, payableId: n }) => i({
|
|
19
|
+
client: e,
|
|
20
|
+
headers: s(t),
|
|
21
|
+
path: { payable_id: n }
|
|
22
|
+
}), p = ({ client: e, organizationId: t, payableId: r }) => n({
|
|
23
|
+
client: e,
|
|
24
|
+
headers: s(t),
|
|
29
25
|
path: { payable_id: r }
|
|
30
|
-
}),
|
|
31
|
-
client:
|
|
32
|
-
headers:
|
|
26
|
+
}), m = ({ client: e, organizationId: t, payableId: n }) => r({
|
|
27
|
+
client: e,
|
|
28
|
+
headers: s(t),
|
|
29
|
+
path: { payable_id: n }
|
|
30
|
+
}), h = ({ client: e, organizationId: t }) => o({
|
|
31
|
+
client: e,
|
|
32
|
+
headers: s(t)
|
|
33
33
|
}), g = "payable", _ = "desc";
|
|
34
34
|
//#endregion
|
|
35
35
|
export { _ as NEWEST_REQUEST_FIRST, c as PAYABLE_COUNT_ANALYTICS, g as PAYABLE_OBJECT_TYPE, d as analyticsPayablesInvalidationKey, u as approvalRequestsInvalidationKey, p as payableHistoryInvalidationKey, f as payableInvalidationKey, m as payableLineItemsInvalidationKey, h as payablePaymentRecordsInvalidationKey, l as payablesInvalidationKey };
|
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { getApprovalRequests as e, getPayablesId as t, getPayablesIdHistory as n, getPaymentRecords as r } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
2
|
+
import { cancelAllClients as i, invalidateAllClients as a, removeInactiveFromAllClients as o } from "../../../shared/data-access/dist/lib/clientRegistry.js";
|
|
3
|
+
import { organizationHeaders as s } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
4
4
|
import "../../../shared/data-access/dist/index.js";
|
|
5
5
|
import { isLiveScheduledPaymentRecord as c } from "./index3.js";
|
|
6
6
|
import { NEWEST_REQUEST_FIRST as l, PAYABLE_OBJECT_TYPE as u, analyticsPayablesInvalidationKey as d, approvalRequestsInvalidationKey as f, payableHistoryInvalidationKey as p, payableInvalidationKey as m, payableLineItemsInvalidationKey as h, payablePaymentRecordsInvalidationKey as g, payablesInvalidationKey as _ } from "./index5.js";
|
|
7
7
|
import { OCR_POLL_INTERVAL_MS as v } from "./index4.js";
|
|
8
8
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js
|
|
9
|
-
async function y({ client: e, organizationId:
|
|
9
|
+
async function y({ client: e, organizationId: t, payableId: n, payableIds: r, deletedPayableIds: i, includeLineItems: o, includeApprovalRequests: s }) {
|
|
10
10
|
let c = {
|
|
11
11
|
client: e,
|
|
12
|
-
organizationId:
|
|
13
|
-
}, l = new Set(
|
|
12
|
+
organizationId: t
|
|
13
|
+
}, l = new Set(i ?? []), u = [.../* @__PURE__ */ new Set([...r ?? [], n])].filter((e) => !!e && !l.has(e)).map((e) => ({
|
|
14
14
|
...c,
|
|
15
15
|
payableId: e
|
|
16
16
|
})), v = [
|
|
@@ -24,61 +24,61 @@ async function y({ client: e, organizationId: n, payableId: r, payableIds: i, de
|
|
|
24
24
|
...o ? [h(e)] : []
|
|
25
25
|
])
|
|
26
26
|
];
|
|
27
|
-
await Promise.all(v.map((e) =>
|
|
27
|
+
await Promise.all(v.map((e) => a(e))), await Promise.all([...l].map((n) => b({
|
|
28
28
|
client: e,
|
|
29
|
-
organizationId:
|
|
30
|
-
payableId:
|
|
29
|
+
organizationId: t,
|
|
30
|
+
payableId: n
|
|
31
31
|
})));
|
|
32
32
|
}
|
|
33
|
-
async function b({ client:
|
|
34
|
-
if (!
|
|
35
|
-
let
|
|
36
|
-
client:
|
|
37
|
-
organizationId:
|
|
38
|
-
payableId:
|
|
39
|
-
},
|
|
40
|
-
m(
|
|
41
|
-
p(
|
|
42
|
-
h(
|
|
33
|
+
async function b({ client: e, organizationId: t, payableId: n }) {
|
|
34
|
+
if (!n) return;
|
|
35
|
+
let r = {
|
|
36
|
+
client: e,
|
|
37
|
+
organizationId: t,
|
|
38
|
+
payableId: n
|
|
39
|
+
}, a = [
|
|
40
|
+
m(r),
|
|
41
|
+
p(r),
|
|
42
|
+
h(r)
|
|
43
43
|
];
|
|
44
|
-
await Promise.all(
|
|
44
|
+
await Promise.all(a.map((e) => i(e))), a.forEach((e) => o(e));
|
|
45
45
|
}
|
|
46
|
-
async function x({ client: e, organizationId:
|
|
47
|
-
let
|
|
46
|
+
async function x({ client: e, organizationId: t, payableId: n }) {
|
|
47
|
+
let r = {
|
|
48
48
|
client: e,
|
|
49
|
-
organizationId:
|
|
49
|
+
organizationId: t
|
|
50
50
|
};
|
|
51
|
-
await Promise.all([
|
|
51
|
+
await Promise.all([a(_(r)), a(d(r))]), await b({
|
|
52
52
|
client: e,
|
|
53
|
-
organizationId:
|
|
54
|
-
payableId:
|
|
53
|
+
organizationId: t,
|
|
54
|
+
payableId: n
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
var S = 2e4, C = 1e3, w = 1.5, T = 5e3, E = (e) => Math.min(e * w, T), D = /* @__PURE__ */ new Set(["new", "approve_in_progress"]), O = 6e4;
|
|
58
|
-
async function k({ client: e, organizationId:
|
|
59
|
-
await
|
|
58
|
+
async function k({ client: e, organizationId: t, payableId: n }) {
|
|
59
|
+
await a(f({
|
|
60
60
|
client: e,
|
|
61
|
-
organizationId:
|
|
61
|
+
organizationId: t
|
|
62
62
|
})), await y({
|
|
63
63
|
client: e,
|
|
64
|
-
organizationId:
|
|
65
|
-
payableId:
|
|
64
|
+
organizationId: t,
|
|
65
|
+
payableId: n
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
var A = 100;
|
|
69
|
-
async function j({ client:
|
|
69
|
+
async function j({ client: t, organizationId: n, payableId: r }) {
|
|
70
70
|
try {
|
|
71
|
-
let { data:
|
|
72
|
-
client:
|
|
73
|
-
headers:
|
|
71
|
+
let { data: i } = await e({
|
|
72
|
+
client: t,
|
|
73
|
+
headers: s(n),
|
|
74
74
|
query: {
|
|
75
|
-
object_id:
|
|
75
|
+
object_id: r,
|
|
76
76
|
object_type: u,
|
|
77
77
|
order: l,
|
|
78
78
|
limit: A
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
|
-
return (
|
|
81
|
+
return (i?.data ?? []).map((e) => `${e.id}:${e.status}`).sort().join(",");
|
|
82
82
|
} catch {
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
@@ -95,12 +95,12 @@ async function P(e) {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
var F = "submitted_for_approval", I = 100;
|
|
98
|
-
async function L({ client: e, organizationId: t, payableId:
|
|
98
|
+
async function L({ client: e, organizationId: t, payableId: r }) {
|
|
99
99
|
try {
|
|
100
|
-
let { data: i } = await
|
|
100
|
+
let { data: i } = await n({
|
|
101
101
|
client: e,
|
|
102
|
-
headers:
|
|
103
|
-
path: { payable_id:
|
|
102
|
+
headers: s(t),
|
|
103
|
+
path: { payable_id: r },
|
|
104
104
|
query: {
|
|
105
105
|
sort: "timestamp",
|
|
106
106
|
order: "asc",
|
|
@@ -126,34 +126,34 @@ async function R(e, { requireRoundMarker: t = !1 } = {}) {
|
|
|
126
126
|
return t !== void 0 && i === void 0 ? (i = t, o = !0, await a() ? "changed" : "resynced") : (t !== void 0 && t !== i && (o = !0), o && await a() ? "changed" : "unchanged");
|
|
127
127
|
} };
|
|
128
128
|
}
|
|
129
|
-
async function z({ client: e, organizationId:
|
|
130
|
-
let
|
|
131
|
-
for (; !c && Date.now() <
|
|
129
|
+
async function z({ client: e, organizationId: n, payableId: r, watch: i }) {
|
|
130
|
+
let a = Date.now() + O, o = C, c = !1;
|
|
131
|
+
for (; !c && Date.now() < a;) {
|
|
132
132
|
await new Promise((e) => {
|
|
133
|
-
setTimeout(e,
|
|
134
|
-
}),
|
|
133
|
+
setTimeout(e, o);
|
|
134
|
+
}), o = E(o);
|
|
135
135
|
try {
|
|
136
|
-
let { data: i } = await
|
|
136
|
+
let { data: i } = await t({
|
|
137
137
|
client: e,
|
|
138
|
-
headers:
|
|
139
|
-
path: { payable_id:
|
|
138
|
+
headers: s(n),
|
|
139
|
+
path: { payable_id: r }
|
|
140
140
|
});
|
|
141
141
|
c = !!(i?.status && !D.has(i.status));
|
|
142
142
|
} catch {}
|
|
143
143
|
if (!c) {
|
|
144
|
-
let
|
|
145
|
-
c =
|
|
144
|
+
let t = await i.poll();
|
|
145
|
+
c = t === "changed", t === "resynced" && await y({
|
|
146
146
|
client: e,
|
|
147
|
-
organizationId:
|
|
148
|
-
payableId:
|
|
147
|
+
organizationId: n,
|
|
148
|
+
payableId: r,
|
|
149
149
|
includeApprovalRequests: !0
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
return await y({
|
|
154
154
|
client: e,
|
|
155
|
-
organizationId:
|
|
156
|
-
payableId:
|
|
155
|
+
organizationId: n,
|
|
156
|
+
payableId: r,
|
|
157
157
|
includeApprovalRequests: !0
|
|
158
158
|
}), c;
|
|
159
159
|
}
|
|
@@ -199,9 +199,9 @@ async function G({ client: e, organizationId: t, payableId: n }) {
|
|
|
199
199
|
let i = /* @__PURE__ */ new Set(), a;
|
|
200
200
|
try {
|
|
201
201
|
do {
|
|
202
|
-
let { data: o } = await
|
|
202
|
+
let { data: o } = await r({
|
|
203
203
|
client: e,
|
|
204
|
-
headers:
|
|
204
|
+
headers: s(t),
|
|
205
205
|
query: {
|
|
206
206
|
limit: U,
|
|
207
207
|
object_id__in: [n],
|
|
@@ -220,53 +220,53 @@ async function G({ client: e, organizationId: t, payableId: n }) {
|
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
async function K({ client: e, organizationId:
|
|
224
|
-
let i = Date.now() + S,
|
|
225
|
-
for (; !
|
|
223
|
+
async function K({ client: e, organizationId: n, payableId: r }) {
|
|
224
|
+
let i = Date.now() + S, a = !1;
|
|
225
|
+
for (; !a && Date.now() < i;) {
|
|
226
226
|
await new Promise((e) => {
|
|
227
227
|
setTimeout(e, C);
|
|
228
228
|
});
|
|
229
229
|
try {
|
|
230
|
-
let { data: i } = await
|
|
230
|
+
let { data: i } = await t({
|
|
231
231
|
client: e,
|
|
232
|
-
headers:
|
|
233
|
-
path: { payable_id:
|
|
232
|
+
headers: s(n),
|
|
233
|
+
path: { payable_id: r }
|
|
234
234
|
});
|
|
235
|
-
|
|
235
|
+
a = !i?.scheduled_payment_date && await G({
|
|
236
236
|
client: e,
|
|
237
|
-
organizationId:
|
|
238
|
-
payableId:
|
|
237
|
+
organizationId: n,
|
|
238
|
+
payableId: r
|
|
239
239
|
}) === !1;
|
|
240
240
|
} catch {}
|
|
241
241
|
}
|
|
242
242
|
return await y({
|
|
243
243
|
client: e,
|
|
244
|
-
organizationId:
|
|
245
|
-
payableId:
|
|
246
|
-
}),
|
|
244
|
+
organizationId: n,
|
|
245
|
+
payableId: r
|
|
246
|
+
}), a;
|
|
247
247
|
}
|
|
248
248
|
var q = 9e4;
|
|
249
|
-
async function J({ client: e, organizationId:
|
|
250
|
-
let i = Date.now() + q,
|
|
251
|
-
for (; !
|
|
249
|
+
async function J({ client: e, organizationId: n, payableId: r }) {
|
|
250
|
+
let i = Date.now() + q, a = v, o = !1;
|
|
251
|
+
for (; !o && Date.now() < i;) {
|
|
252
252
|
await new Promise((e) => {
|
|
253
|
-
setTimeout(e,
|
|
254
|
-
}),
|
|
253
|
+
setTimeout(e, a);
|
|
254
|
+
}), a = E(a);
|
|
255
255
|
try {
|
|
256
|
-
let { data: i } = await
|
|
256
|
+
let { data: i } = await t({
|
|
257
257
|
client: e,
|
|
258
|
-
headers:
|
|
259
|
-
path: { payable_id:
|
|
258
|
+
headers: s(n),
|
|
259
|
+
path: { payable_id: r }
|
|
260
260
|
});
|
|
261
|
-
|
|
261
|
+
o = i?.ocr_status !== "processing";
|
|
262
262
|
} catch {}
|
|
263
263
|
}
|
|
264
264
|
return await y({
|
|
265
265
|
client: e,
|
|
266
|
-
organizationId:
|
|
267
|
-
payableId:
|
|
266
|
+
organizationId: n,
|
|
267
|
+
payableId: r,
|
|
268
268
|
includeLineItems: !0
|
|
269
|
-
}),
|
|
269
|
+
}), o;
|
|
270
270
|
}
|
|
271
271
|
//#endregion
|
|
272
272
|
export { R as beginApprovalRequestWatch, k as invalidateApprovalDecisionQueries, x as invalidateDeletedPayableQueries, y as invalidatePayableQueries, z as reconcileApprovalDecisionQueries, K as reconcileCancelledPaymentQueries, W as reconcileScheduledPaymentQueries, H as reconcileSubmittedForApprovalQueries, J as reconcileUploadedPayableOcr };
|
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { deletePayablesId as e, postPayablesIdCancel as t, postPayablesIdDuplicatesIdConfirm as n, postPayablesIdDuplicatesIdDismiss as r } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
|
+
import { useEmbedApi as i } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
|
+
import { organizationHeaders as a } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
8
8
|
import "../../../shared/data-access/dist/index.js";
|
|
9
9
|
import { invalidatePayableQueries as o } from "./index6.js";
|
|
10
10
|
import { useMutation as s } from "@tanstack/react-query";
|
|
@@ -41,35 +41,35 @@ function h(e) {
|
|
|
41
41
|
return e.payableIds.length > 0 || e.deletedPayableIds.length > 0;
|
|
42
42
|
}
|
|
43
43
|
function g() {
|
|
44
|
-
let { client: c, organizationId: l } =
|
|
44
|
+
let { client: c, organizationId: l } = i();
|
|
45
45
|
return s({
|
|
46
|
-
mutationFn: async ({ verdict:
|
|
47
|
-
let s =
|
|
46
|
+
mutationFn: async ({ verdict: i, targets: o }) => {
|
|
47
|
+
let s = a(l), u = [], d = [], f = () => o.filter((e) => e.matchedPayableId !== void 0 && d.includes(e.payableId) && !d.includes(e.matchedPayableId)).map((e) => e.matchedPayableId), h = () => ({
|
|
48
48
|
payableIds: [.../* @__PURE__ */ new Set([...u, ...f()])],
|
|
49
49
|
deletedPayableIds: [...new Set(d)]
|
|
50
50
|
});
|
|
51
51
|
try {
|
|
52
|
-
let
|
|
53
|
-
if (
|
|
54
|
-
for (let
|
|
55
|
-
if (
|
|
56
|
-
await
|
|
52
|
+
let a = /* @__PURE__ */ new Set();
|
|
53
|
+
if (i === p.Remove) {
|
|
54
|
+
for (let n of o) if (!a.has(n.payableId)) {
|
|
55
|
+
if (a.add(n.payableId), n.removeBy === "delete") {
|
|
56
|
+
await e({
|
|
57
57
|
client: c,
|
|
58
58
|
headers: s,
|
|
59
|
-
path: { payable_id:
|
|
59
|
+
path: { payable_id: n.payableId },
|
|
60
60
|
throwOnError: !0
|
|
61
|
-
}), d.push(
|
|
61
|
+
}), d.push(n.payableId);
|
|
62
62
|
continue;
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
n.removeBy === "cancel" && (await t({
|
|
65
65
|
client: c,
|
|
66
66
|
headers: s,
|
|
67
|
-
path: { payable_id:
|
|
67
|
+
path: { payable_id: n.payableId },
|
|
68
68
|
throwOnError: !0
|
|
69
|
-
}), u.push(
|
|
69
|
+
}), u.push(n.payableId));
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
let l = /* @__PURE__ */ new Set(), f =
|
|
72
|
+
let l = /* @__PURE__ */ new Set(), f = i === p.Remove ? n : r;
|
|
73
73
|
for (let e of o) l.has(e.duplicateId) || d.includes(e.payableId) || e.matchedPayableId && d.includes(e.matchedPayableId) || (l.add(e.duplicateId), await f({
|
|
74
74
|
client: c,
|
|
75
75
|
headers: s,
|