@tesouro/embedded-components-react 0.3.35 → 0.3.37
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 +10 -10
- package/dist/index.d.ts +15 -0
- package/dist/lib/CardDetailsWidget.d.ts +15 -0
- package/dist/lib/CardsWidget.d.ts +15 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/data-access/dist/index5.js +33 -31
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index6.js +5 -9
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +98 -92
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index5.js +16 -9
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index6.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js +21 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js +9 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index5.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +115 -59
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +21 -19
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/apiErrorStatus.js +26 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/isApiForbiddenError.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/isApiNotFoundError.js +4 -23
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/isUserDataNotFoundError.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +177 -166
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +139 -127
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js
CHANGED
|
@@ -14,7 +14,14 @@ function i(t) {
|
|
|
14
14
|
function a({ programValidity: e, isNotFound: t, isError: n, hasCard: i }) {
|
|
15
15
|
return e === r.Supported ? t ? "notFound" : i ? "loaded" : n ? "error" : "loading" : "error";
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
var o = "PENDING_ACTIVATION";
|
|
18
|
+
function s({ panelState: t, cardProgram: n, cardStatus: r }) {
|
|
19
|
+
return t !== "loaded" || n !== e.Debit || r === void 0 ? !1 : r !== o;
|
|
20
|
+
}
|
|
21
|
+
function c({ isRevealRequested: e, isError: t, hasCredentials: n }) {
|
|
22
|
+
return e ? t ? "errored" : n ? "revealed" : "revealing" : "hidden";
|
|
23
|
+
}
|
|
24
|
+
function l({ card: e, cardProgram: r, labels: i }) {
|
|
18
25
|
let a = e.cardholderName.trim(), o = e.nickname?.trim();
|
|
19
26
|
return {
|
|
20
27
|
statusLabel: i.statusLabels[e.cardStatus],
|
|
@@ -27,4 +34,4 @@ function o({ card: e, cardProgram: r, labels: i }) {
|
|
|
27
34
|
};
|
|
28
35
|
}
|
|
29
36
|
//#endregion
|
|
30
|
-
export { r as CardProgramValidity, a as resolveCardDetailsPanelState,
|
|
37
|
+
export { r as CardProgramValidity, s as resolveCanRevealCredentials, a as resolveCardDetailsPanelState, l as resolveCardDetailsPresentation, c as resolveCardDetailsRevealState, i as resolveCardProgramValidity };
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index5.js
CHANGED
|
@@ -4,6 +4,7 @@ import "../../../shared/feature/dist/index.js";
|
|
|
4
4
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index5.js
|
|
5
5
|
var r = {
|
|
6
6
|
copySuccessToast: "Copied to clipboard",
|
|
7
|
+
revealNotPermittedDescription: "This card's details can't be shown for this session.",
|
|
7
8
|
programLabels: {
|
|
8
9
|
[e.Credit]: "Business credit",
|
|
9
10
|
[e.Debit]: "Business debit"
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js
CHANGED
|
@@ -12,79 +12,135 @@ import { CardProgram as o } from "../../../shared/feature/dist/lib/card/cardProg
|
|
|
12
12
|
import "../../../shared/feature/dist/index.js";
|
|
13
13
|
import { resolveCardDetailsFeatureLabels as s } from "./index5.js";
|
|
14
14
|
import { CardDetailsWidgetAnalyticsEvent as c, WIDGET_NAME as l } from "./index2.js";
|
|
15
|
-
import { copyTextToClipboard as u } from "./index3.js";
|
|
16
|
-
import { CardProgramValidity as
|
|
17
|
-
import { useCreditCardDetailsQuery as
|
|
18
|
-
import {
|
|
15
|
+
import { copyTextToClipboard as u, formatCardNumber as d, formatExpirationDate as f } from "./index3.js";
|
|
16
|
+
import { CardProgramValidity as p, resolveCanRevealCredentials as m, resolveCardDetailsPanelState as h, resolveCardDetailsPresentation as ee, resolveCardDetailsRevealState as te, resolveCardProgramValidity as g } from "./index4.js";
|
|
17
|
+
import { useCreditCardDetailsQuery as _ } from "../../data-access/dist/index4.js";
|
|
18
|
+
import { useDebitCardCredentialsQuery as v } from "../../data-access/dist/index5.js";
|
|
19
|
+
import { useDebitCardDetailsQuery as y } from "../../data-access/dist/index6.js";
|
|
19
20
|
import "../../data-access/dist/index.js";
|
|
20
|
-
import { CardDetailsPanel as
|
|
21
|
+
import { CardDetailsPanel as b } from "../../ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js";
|
|
21
22
|
import "../../ui/dist/index.js";
|
|
22
|
-
import { useCallback as
|
|
23
|
-
import { Fragment as
|
|
23
|
+
import { useCallback as x, useEffect as S, useMemo as C, useState as ne } from "react";
|
|
24
|
+
import { Fragment as w, jsx as T, jsxs as re } from "react/jsx-runtime";
|
|
24
25
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js
|
|
25
|
-
function
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}, [
|
|
30
|
-
let
|
|
26
|
+
function E({ cardId: r, cardProgram: l, onClose: E, labels: D, featureLabels: O, bankLogoSrc: k, bankLogoAlt: A }) {
|
|
27
|
+
let j = n(), M = a(), N = i();
|
|
28
|
+
S(() => {
|
|
29
|
+
j(c.Mounted);
|
|
30
|
+
}, [j]);
|
|
31
|
+
let P = C(() => s(O), [O]), F = g(l), I = l === o.Credit, L = l === o.Debit, R = _({
|
|
31
32
|
cardId: r,
|
|
32
|
-
enabled:
|
|
33
|
-
}),
|
|
33
|
+
enabled: I
|
|
34
|
+
}), z = y({
|
|
34
35
|
cardId: r,
|
|
35
|
-
enabled:
|
|
36
|
-
}), { data:
|
|
37
|
-
programValidity:
|
|
38
|
-
isNotFound:
|
|
39
|
-
isError: !!
|
|
40
|
-
hasCard: !!
|
|
36
|
+
enabled: L
|
|
37
|
+
}), { data: B, isError: V, isNotFound: H, refetch: U } = I ? R : z, W = h({
|
|
38
|
+
programValidity: F,
|
|
39
|
+
isNotFound: H,
|
|
40
|
+
isError: !!M || V,
|
|
41
|
+
hasCard: !!B
|
|
41
42
|
});
|
|
42
|
-
|
|
43
|
-
if (
|
|
43
|
+
S(() => {
|
|
44
|
+
if (F === p.Supported) return;
|
|
44
45
|
let e = `"${o.Credit}" or "${o.Debit}"`;
|
|
45
|
-
console.error(
|
|
46
|
-
}, [l,
|
|
47
|
-
let
|
|
48
|
-
|
|
46
|
+
console.error(F === p.Missing ? `[CardDetailsWidget] cardProgram is required and was not set. Pass ${e} — it selects which card program to read, so there is no default. No card was fetched.` : `[CardDetailsWidget] cardProgram must be ${e}, received ${JSON.stringify(l)}. No card was fetched.`);
|
|
47
|
+
}, [l, F]);
|
|
48
|
+
let [G, K] = ne(), q = G === r;
|
|
49
|
+
S(() => {
|
|
50
|
+
K(void 0);
|
|
51
|
+
}, [r]);
|
|
52
|
+
let J = m({
|
|
53
|
+
panelState: W,
|
|
49
54
|
cardProgram: l,
|
|
50
|
-
|
|
55
|
+
cardStatus: B?.cardStatus
|
|
56
|
+
});
|
|
57
|
+
S(() => {
|
|
58
|
+
q && !J && K(void 0);
|
|
59
|
+
}, [q, J]);
|
|
60
|
+
let Y = v({
|
|
61
|
+
cardId: r,
|
|
62
|
+
enabled: J && q
|
|
63
|
+
}), X = te({
|
|
64
|
+
isRevealRequested: q,
|
|
65
|
+
isError: Y.isError,
|
|
66
|
+
hasCredentials: !!Y.data
|
|
67
|
+
}), Z = C(() => W === "loaded" && B ? ee({
|
|
68
|
+
card: B,
|
|
69
|
+
cardProgram: l,
|
|
70
|
+
labels: P
|
|
51
71
|
}) : void 0, [
|
|
52
|
-
|
|
72
|
+
B,
|
|
53
73
|
l,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
]),
|
|
57
|
-
await u(t) && (e.success(
|
|
58
|
-
}, [
|
|
59
|
-
if (
|
|
60
|
-
|
|
74
|
+
P,
|
|
75
|
+
W
|
|
76
|
+
]), ie = x(async (t) => {
|
|
77
|
+
await u(t) && (e.success(P.copySuccessToast), j(c.ValueCopied));
|
|
78
|
+
}, [P.copySuccessToast, j]), { refetch: Q } = Y, ae = x(() => {
|
|
79
|
+
if (q) {
|
|
80
|
+
Q();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
K(r);
|
|
84
|
+
}, [
|
|
85
|
+
r,
|
|
86
|
+
q,
|
|
87
|
+
Q
|
|
88
|
+
]), oe = x(() => {
|
|
89
|
+
K(void 0);
|
|
90
|
+
}, []), se = x(() => {
|
|
91
|
+
K(void 0), E?.();
|
|
92
|
+
}, [E]), ce = C(() => Y.isForbidden ? {
|
|
93
|
+
...D,
|
|
94
|
+
credentials: {
|
|
95
|
+
...D?.credentials,
|
|
96
|
+
errorDescription: P.revealNotPermittedDescription
|
|
97
|
+
}
|
|
98
|
+
} : D, [
|
|
99
|
+
Y.isForbidden,
|
|
100
|
+
D,
|
|
101
|
+
P.revealNotPermittedDescription
|
|
102
|
+
]), $ = C(() => {
|
|
103
|
+
if (!(X !== "revealed" || !Y.data)) return {
|
|
104
|
+
cardNumber: d(Y.data.pan),
|
|
105
|
+
expirationDate: f(Y.data.expirationDate),
|
|
106
|
+
securityCode: Y.data.cvv
|
|
107
|
+
};
|
|
108
|
+
}, [Y.data, X]), le = x(() => {
|
|
109
|
+
if (M) {
|
|
110
|
+
N();
|
|
61
111
|
return;
|
|
62
112
|
}
|
|
63
|
-
|
|
113
|
+
U();
|
|
64
114
|
}, [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
115
|
+
U,
|
|
116
|
+
N,
|
|
117
|
+
M
|
|
68
118
|
]);
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
labels:
|
|
71
|
-
state:
|
|
72
|
-
nickname:
|
|
73
|
-
statusLabel:
|
|
74
|
-
statusTone:
|
|
75
|
-
formFactorLabel:
|
|
76
|
-
onClose:
|
|
77
|
-
bankLogoSrc:
|
|
78
|
-
bankLogoAlt:
|
|
79
|
-
cardholderName:
|
|
80
|
-
maskedCardNumber:
|
|
81
|
-
programLabel:
|
|
82
|
-
onCopy:
|
|
83
|
-
|
|
119
|
+
return /* @__PURE__ */ re(w, { children: [/* @__PURE__ */ T(t, {}), /* @__PURE__ */ T(b, {
|
|
120
|
+
labels: ce,
|
|
121
|
+
state: W,
|
|
122
|
+
nickname: Z?.nickname,
|
|
123
|
+
statusLabel: Z?.statusLabel,
|
|
124
|
+
statusTone: Z?.statusTone,
|
|
125
|
+
formFactorLabel: Z?.formFactorLabel,
|
|
126
|
+
onClose: E ? se : void 0,
|
|
127
|
+
bankLogoSrc: k,
|
|
128
|
+
bankLogoAlt: A,
|
|
129
|
+
cardholderName: Z?.cardholderName,
|
|
130
|
+
maskedCardNumber: Z?.maskedCardNumber,
|
|
131
|
+
programLabel: Z?.programLabel,
|
|
132
|
+
onCopy: ie,
|
|
133
|
+
onViewCard: J ? ae : void 0,
|
|
134
|
+
onHideCard: J ? oe : void 0,
|
|
135
|
+
revealState: X,
|
|
136
|
+
revealedCardNumber: $?.cardNumber,
|
|
137
|
+
revealedExpirationDate: $?.expirationDate,
|
|
138
|
+
revealedSecurityCode: $?.securityCode,
|
|
139
|
+
onRetry: F === p.Supported ? le : void 0
|
|
84
140
|
})] });
|
|
85
141
|
}
|
|
86
|
-
function
|
|
87
|
-
return /* @__PURE__ */
|
|
142
|
+
function D({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, gatewayRouting: a, linkComponent: o, implementation: s, uiFramework: c, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
|
|
143
|
+
return /* @__PURE__ */ T(r, {
|
|
88
144
|
widgetName: l,
|
|
89
145
|
baseUrl: e,
|
|
90
146
|
widgetToken: t,
|
|
@@ -99,8 +155,8 @@ function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, gat
|
|
|
99
155
|
analytics: f,
|
|
100
156
|
disclosuresAcceptance: p,
|
|
101
157
|
providerLabels: m,
|
|
102
|
-
children: /* @__PURE__ */
|
|
158
|
+
children: /* @__PURE__ */ T(E, { ...h })
|
|
103
159
|
});
|
|
104
160
|
}
|
|
105
161
|
//#endregion
|
|
106
|
-
export {
|
|
162
|
+
export { D as CardDetailsWidget, D as default };
|
|
@@ -8,25 +8,27 @@ import { optionalOrganizationHeaders as d, organizationHeaders as f } from "./li
|
|
|
8
8
|
import { bulkUpdateDepartmentMembers as p, bulkUpdateLocationMembers as m, bulkUpdateRoleMembers as h, createDepartment as g, createLocation as _, createUser as v, deactivateDepartment as y, deactivateLocation as b, deleteCounterpartsId as x, deleteCounterpartsIdBankAccountsId as S, deleteMeasureUnitsId as C, deletePayablesId as w, deletePayablesIdFile as T, deleteProductsId as E, deleteReceivablesId as D, deleteTagsId as O, downloadBankAccountTransactions as k, getApplicationStatus as A, getApprovalPolicies as j, getBankAccountAccess as M, getDepartment as N, getExternalBankAccountAccess as P, getLocation as F, getPayablesId as I, getPayablesIdLineItems as L, getPaymentRecords as R, getUsers as z, listDepartments as B, listLocations as V, listRoles as H, manageBankAccountAccess as U, patchCounterpartsId as W, patchCounterpartsIdAddressesId as G, patchCounterpartsIdBankAccountsId as K, patchMeasureUnitsId as q, patchPayablesId as J, patchProductsId as Y, patchReceivablesId as X, patchTagsId as Z, postApprovalRequestsIdApprove as Q, postApprovalRequestsIdReject as $, postCounterparts as ee, postCounterpartsIdAddresses as te, postCounterpartsIdBankAccounts as ne, postCounterpartsIdBankAccountsIdMakeDefault as re, postMeasureUnits as ie, postPayables as ae, postPayablesIdApprovePaymentOperation as oe, postPayablesIdAttachFile as se, postPayablesIdCancel as ce, postPayablesIdMarkAsPaid as le, postPayablesIdReject as ue, postPayablesIdReopen as de, postPayablesIdSchedulePayment as fe, postPayablesIdSubmitForApproval as pe, postPayablesIdValidate as me, postPayablesUploadFromFile as he, postPaymentIntentsIdCancel as ge, postProducts as _e, postReceivables as ve, postReceivablesIdAccept as ye, postReceivablesIdCancel as be, postReceivablesIdClone as xe, postReceivablesIdDecline as Se, postReceivablesIdIssue as Ce, postReceivablesIdMarkAsPaid as we, postReceivablesIdMarkAsPartiallyPaid as Te, postReceivablesIdMarkAsUncollectible as Ee, postReceivablesIdSend as De, postTags as Oe, putPayablesIdLineItems as ke, putReceivablesIdLineItems as Ae, updateDepartment as je, updateLocation as Me, updateUser as Ne } from "./lib/rest/sdk.gen.js";
|
|
9
9
|
import { fetchWidgetInit as Pe } from "./lib/fetchWidgetInit.js";
|
|
10
10
|
import { hasAnyScope as Fe } from "./lib/hasAnyScope.js";
|
|
11
|
-
import { connectExternalBankAccountMutation as Ie, createAchMoneyMovementMutation as Le, createApplicationMutation as Re, createBankAccountMutation as ze, createBookTransferMutation as Be, createDebitCardMutation as Ve, createVelocityControlMutation as He, deleteApprovalPoliciesIdMutation as Ue, deleteLedgerAccountsIdMutation as We, deleteReceiptsIdMutation as Ge, disableUserMutation as Ke, getAnalyticsPayablesOptions as qe, getAnalyticsReceivablesOptions as Je, getApplicationStatusOptions as Ye, getApprovalPoliciesOptions as Xe, getApprovalPoliciesQueryKey as Ze, getApprovalRequestsOptions as Qe, getApprovalRequestsQueryKey as $e, getBankAccountAccessQueryKey as et, getBankAccountOptions as tt, getBankAccountQueryKey as nt, getBankAccountTransactionsOptions as rt, getBankAccountTransfersOptions as it, getBankAccountTransfersQueryKey as at, getBankAccountsQueryKey as ot, getCounterpartsIdAddressesOptions as st, getCounterpartsIdAddressesQueryKey as ct, getCounterpartsIdBankAccountsOptions as lt, getCounterpartsIdBankAccountsQueryKey as ut, getCounterpartsIdOptions as dt, getCounterpartsIdQueryKey as ft, getCounterpartsOptions as pt, getCounterpartsQueryKey as mt, getCreditCardByIdOptions as ht, getCreditCardsOptions as gt, getDebitCardByIdOptions as _t,
|
|
11
|
+
import { connectExternalBankAccountMutation as Ie, createAchMoneyMovementMutation as Le, createApplicationMutation as Re, createBankAccountMutation as ze, createBookTransferMutation as Be, createDebitCardMutation as Ve, createVelocityControlMutation as He, deleteApprovalPoliciesIdMutation as Ue, deleteLedgerAccountsIdMutation as We, deleteReceiptsIdMutation as Ge, disableUserMutation as Ke, getAnalyticsPayablesOptions as qe, getAnalyticsReceivablesOptions as Je, getApplicationStatusOptions as Ye, getApprovalPoliciesOptions as Xe, getApprovalPoliciesQueryKey as Ze, getApprovalRequestsOptions as Qe, getApprovalRequestsQueryKey as $e, getBankAccountAccessQueryKey as et, getBankAccountOptions as tt, getBankAccountQueryKey as nt, getBankAccountTransactionsOptions as rt, getBankAccountTransfersOptions as it, getBankAccountTransfersQueryKey as at, getBankAccountsQueryKey as ot, getCounterpartsIdAddressesOptions as st, getCounterpartsIdAddressesQueryKey as ct, getCounterpartsIdBankAccountsOptions as lt, getCounterpartsIdBankAccountsQueryKey as ut, getCounterpartsIdOptions as dt, getCounterpartsIdQueryKey as ft, getCounterpartsOptions as pt, getCounterpartsQueryKey as mt, getCreditCardByIdOptions as ht, getCreditCardsOptions as gt, getDebitCardByIdOptions as _t, getDebitCardCredentialsOptions as vt, getDebitCardsOptions as yt, getDebitCardsQueryKey as bt, getDepartmentOptions as xt, getDepartmentQueryKey as St, getEntitiesIdSettingsOptions as Ct, getEntitiesIdSettingsQueryKey as wt, getEntitiesMeOptions as Tt, getEntityUsersMyEntityOptions as Et, getEntityUsersOptions as Dt, getExternalBankAccountAccessQueryKey as Ot, getExternalBankAccountsOptions as kt, getExternalBankAccountsQueryKey as At, getLedgerAccountsQueryKey as jt, getLocationOptions as Mt, getLocationQueryKey as Nt, getMeasureUnitsOptions as Pt, getMeasureUnitsQueryKey as Ft, getOrganizationOptions as It, getPayablesAnalyticsOptions as Lt, getPayablesAnalyticsQueryKey as Rt, getPayablesIdHistoryOptions as zt, getPayablesIdHistoryQueryKey as Bt, getPayablesIdLineItemsOptions as Vt, getPayablesIdLineItemsQueryKey as Ht, getPayablesIdOptions as Ut, getPayablesIdQueryKey as Wt, getPayablesIdSuggestionsOptions as Gt, getPayablesOptions as Kt, getPayablesQueryKey as qt, getPaymentRecordsOptions as Jt, getPaymentRecordsQueryKey as Yt, getProductsIdOptions as Xt, getProductsIdQueryKey as Zt, getProductsOptions as Qt, getProductsQueryKey as $t, getReceiptsIdQueryKey as en, getReceiptsOptions as tn, getReceiptsQueryKey as nn, getReceivablesIdHistoryOptions as rn, getReceivablesIdHistoryQueryKey as an, getReceivablesIdMailsOptions as on, getReceivablesIdMailsQueryKey as sn, getReceivablesIdOptions as cn, getReceivablesIdPdfLinkOptions as ln, getReceivablesIdPdfLinkQueryKey as un, getReceivablesIdQueryKey as dn, getReceivablesOptions as fn, getReceivablesQueryKey as pn, getTagsOptions as mn, getTagsQueryKey as hn, getTransactionsIdQueryKey as gn, getTransactionsOptions as _n, getTransactionsQueryKey as vn, getTransactionsValidationsOptions as yn, getTransactionsValidationsQueryKey as bn, getUsersOptions as xn, getUsersQueryKey as Sn, getVelocityControlsQueryKey as Cn, grantBankAccountAccessMutation as wn, grantExternalBankAccountAccessMutation as Tn, linkExternalBankAccountMutation as En, listDepartmentsOptions as Dn, listDepartmentsQueryKey as On, listLocationsOptions as kn, listLocationsQueryKey as An, listRolesQueryKey as jn, manageDebitCardAccessMutation as Mn, patchApprovalPoliciesIdMutation as Nn, patchEntitiesIdSettingsMutation as Pn, patchLedgerAccountsIdMutation as Fn, patchReceiptsIdMutation as In, postApprovalPoliciesMutation as Ln, postLedgerAccountsMutation as Rn, putTransactionsValidationsMutation as zn, submitApplicationMutation as Bn, unlinkExternalBankAccountMutation as Vn, updateApplicationMutation as Hn, updateBankAccountMutation as Un, updateExternalBankAccountMutation as Wn, validateExternalBankAccountMutation as Gn } from "./lib/rest/@tanstack/react-query.gen.js";
|
|
12
12
|
import "./lib/queryKeys.js";
|
|
13
|
-
import { withAuthEpoch as
|
|
14
|
-
import { useCurrentUserQuery as
|
|
15
|
-
import
|
|
13
|
+
import { withAuthEpoch as Kn } from "./lib/withAuthEpoch.js";
|
|
14
|
+
import { useCurrentUserQuery as qn } from "./lib/useCurrentUserQuery.js";
|
|
15
|
+
import "./lib/apiErrorStatus.js";
|
|
16
|
+
import { isApiForbiddenError as Jn } from "./lib/isApiForbiddenError.js";
|
|
17
|
+
import { isApiNotFoundError as Yn } from "./lib/isApiNotFoundError.js";
|
|
16
18
|
import "./lib/isUserDataNotFoundError.js";
|
|
17
|
-
import { useGetUserDataQuery as
|
|
18
|
-
import { useUpsertUserDataMutation as
|
|
19
|
+
import { useGetUserDataQuery as Xn } from "./lib/useGetUserDataQuery.js";
|
|
20
|
+
import { useUpsertUserDataMutation as Zn } from "./lib/useUpsertUserDataMutation.js";
|
|
19
21
|
import "./lib/rest/zod.gen.js";
|
|
20
|
-
import { Scope as
|
|
21
|
-
import { getAllPagesNextPageParam as
|
|
22
|
-
import { useAllBankAccountsQuery as
|
|
23
|
-
import { useAllExternalBankAccountsQuery as
|
|
24
|
-
import { useAllMerchantCategoryGroupsQuery as
|
|
25
|
-
import { useAllLedgerAccountsQuery as
|
|
26
|
-
import { usePaymentTermsQuery as
|
|
27
|
-
import { useAllOrganizationRolesQuery as
|
|
28
|
-
import { useRolePermissionsQueries as
|
|
29
|
-
import { useAllOrganizationUsersQuery as
|
|
30
|
-
import { useAcceptWidgetDisclosures as
|
|
31
|
-
import { useDisclosuresQuery as
|
|
32
|
-
export { l as EmbedApiProvider,
|
|
22
|
+
import { Scope as Qn } from "./lib/scopes.js";
|
|
23
|
+
import { getAllPagesNextPageParam as $n, getAllPagesNextPaginationTokenParam as er, isAllPagesResolving as tr, useAutoFetchNextPage as nr } from "./lib/allPages.js";
|
|
24
|
+
import { useAllBankAccountsQuery as rr } from "./lib/bank-account/useAllBankAccountsQuery.js";
|
|
25
|
+
import { useAllExternalBankAccountsQuery as ir } from "./lib/external-bank-account/useAllExternalBankAccountsQuery.js";
|
|
26
|
+
import { useAllMerchantCategoryGroupsQuery as ar } from "./lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js";
|
|
27
|
+
import { useAllLedgerAccountsQuery as or, useLedgerAccountsQuery as sr } from "./lib/reference-data/useLedgerAccountsQuery.js";
|
|
28
|
+
import { usePaymentTermsQuery as cr } from "./lib/reference-data/usePaymentTermsQuery.js";
|
|
29
|
+
import { useAllOrganizationRolesQuery as lr } from "./lib/role/useAllOrganizationRolesQuery.js";
|
|
30
|
+
import { useRolePermissionsQueries as ur } from "./lib/role/useRolePermissionsQueries.js";
|
|
31
|
+
import { useAllOrganizationUsersQuery as dr } from "./lib/user/useAllOrganizationUsersQuery.js";
|
|
32
|
+
import { useAcceptWidgetDisclosures as fr } from "./lib/disclosures/useAcceptWidgetDisclosures.js";
|
|
33
|
+
import { useDisclosuresQuery as pr } from "./lib/disclosures/useDisclosuresQuery.js";
|
|
34
|
+
export { l as EmbedApiProvider, Qn as Scope, p as bulkUpdateDepartmentMembers, m as bulkUpdateLocationMembers, h as bulkUpdateRoleMembers, e as cancelAllClients, o as cloneEmbeddedClient, Ie as connectExternalBankAccountMutation, Le as createAchMoneyMovementMutation, Re as createApplicationMutation, ze as createBankAccountMutation, Be as createBookTransferMutation, Ve as createDebitCardMutation, g as createDepartment, s as createEmbeddedClient, _ as createLocation, v as createUser, He as createVelocityControlMutation, y as deactivateDepartment, b as deactivateLocation, Ue as deleteApprovalPoliciesIdMutation, x as deleteCounterpartsId, S as deleteCounterpartsIdBankAccountsId, We as deleteLedgerAccountsIdMutation, C as deleteMeasureUnitsId, w as deletePayablesId, T as deletePayablesIdFile, E as deleteProductsId, Ge as deleteReceiptsIdMutation, D as deleteReceivablesId, O as deleteTagsId, Ke as disableUserMutation, k as downloadBankAccountTransactions, Pe as fetchWidgetInit, $n as getAllPagesNextPageParam, er as getAllPagesNextPaginationTokenParam, qe as getAnalyticsPayablesOptions, Je as getAnalyticsReceivablesOptions, A as getApplicationStatus, Ye as getApplicationStatusOptions, j as getApprovalPolicies, Xe as getApprovalPoliciesOptions, Ze as getApprovalPoliciesQueryKey, Qe as getApprovalRequestsOptions, $e as getApprovalRequestsQueryKey, M as getBankAccountAccess, et as getBankAccountAccessQueryKey, tt as getBankAccountOptions, nt as getBankAccountQueryKey, rt as getBankAccountTransactionsOptions, it as getBankAccountTransfersOptions, at as getBankAccountTransfersQueryKey, ot as getBankAccountsQueryKey, st as getCounterpartsIdAddressesOptions, ct as getCounterpartsIdAddressesQueryKey, lt as getCounterpartsIdBankAccountsOptions, ut as getCounterpartsIdBankAccountsQueryKey, dt as getCounterpartsIdOptions, ft as getCounterpartsIdQueryKey, pt as getCounterpartsOptions, mt as getCounterpartsQueryKey, ht as getCreditCardByIdOptions, gt as getCreditCardsOptions, _t as getDebitCardByIdOptions, vt as getDebitCardCredentialsOptions, yt as getDebitCardsOptions, bt as getDebitCardsQueryKey, N as getDepartment, xt as getDepartmentOptions, St as getDepartmentQueryKey, Ct as getEntitiesIdSettingsOptions, wt as getEntitiesIdSettingsQueryKey, Tt as getEntitiesMeOptions, Et as getEntityUsersMyEntityOptions, Dt as getEntityUsersOptions, P as getExternalBankAccountAccess, Ot as getExternalBankAccountAccessQueryKey, kt as getExternalBankAccountsOptions, At as getExternalBankAccountsQueryKey, jt as getLedgerAccountsQueryKey, F as getLocation, Mt as getLocationOptions, Nt as getLocationQueryKey, Pt as getMeasureUnitsOptions, Ft as getMeasureUnitsQueryKey, It as getOrganizationOptions, Lt as getPayablesAnalyticsOptions, Rt as getPayablesAnalyticsQueryKey, I as getPayablesId, zt as getPayablesIdHistoryOptions, Bt as getPayablesIdHistoryQueryKey, L as getPayablesIdLineItems, Vt as getPayablesIdLineItemsOptions, Ht as getPayablesIdLineItemsQueryKey, Ut as getPayablesIdOptions, Wt as getPayablesIdQueryKey, Gt as getPayablesIdSuggestionsOptions, Kt as getPayablesOptions, qt as getPayablesQueryKey, R as getPaymentRecords, Jt as getPaymentRecordsOptions, Yt as getPaymentRecordsQueryKey, Xt as getProductsIdOptions, Zt as getProductsIdQueryKey, Qt as getProductsOptions, $t as getProductsQueryKey, en as getReceiptsIdQueryKey, tn as getReceiptsOptions, nn as getReceiptsQueryKey, rn as getReceivablesIdHistoryOptions, an as getReceivablesIdHistoryQueryKey, on as getReceivablesIdMailsOptions, sn as getReceivablesIdMailsQueryKey, cn as getReceivablesIdOptions, ln as getReceivablesIdPdfLinkOptions, un as getReceivablesIdPdfLinkQueryKey, dn as getReceivablesIdQueryKey, fn as getReceivablesOptions, pn as getReceivablesQueryKey, mn as getTagsOptions, hn as getTagsQueryKey, gn as getTransactionsIdQueryKey, _n as getTransactionsOptions, vn as getTransactionsQueryKey, yn as getTransactionsValidationsOptions, bn as getTransactionsValidationsQueryKey, z as getUsers, xn as getUsersOptions, Sn as getUsersQueryKey, Cn as getVelocityControlsQueryKey, wn as grantBankAccountAccessMutation, Tn as grantExternalBankAccountAccessMutation, Fe as hasAnyScope, t as invalidateAllClients, tr as isAllPagesResolving, Jn as isApiForbiddenError, Yn as isApiNotFoundError, c as isWidgetGatewayHost, En as linkExternalBankAccountMutation, B as listDepartments, Dn as listDepartmentsOptions, On as listDepartmentsQueryKey, V as listLocations, kn as listLocationsOptions, An as listLocationsQueryKey, H as listRoles, jn as listRolesQueryKey, U as manageBankAccountAccess, Mn as manageDebitCardAccessMutation, d as optionalOrganizationHeaders, f as organizationHeaders, Nn as patchApprovalPoliciesIdMutation, W as patchCounterpartsId, G as patchCounterpartsIdAddressesId, K as patchCounterpartsIdBankAccountsId, Pn as patchEntitiesIdSettingsMutation, Fn as patchLedgerAccountsIdMutation, q as patchMeasureUnitsId, J as patchPayablesId, Y as patchProductsId, In as patchReceiptsIdMutation, X as patchReceivablesId, Z as patchTagsId, Ln as postApprovalPoliciesMutation, Q as postApprovalRequestsIdApprove, $ as postApprovalRequestsIdReject, ee as postCounterparts, te as postCounterpartsIdAddresses, ne as postCounterpartsIdBankAccounts, re as postCounterpartsIdBankAccountsIdMakeDefault, Rn as postLedgerAccountsMutation, ie as postMeasureUnits, ae as postPayables, oe as postPayablesIdApprovePaymentOperation, se as postPayablesIdAttachFile, ce as postPayablesIdCancel, le as postPayablesIdMarkAsPaid, ue as postPayablesIdReject, de as postPayablesIdReopen, fe as postPayablesIdSchedulePayment, pe as postPayablesIdSubmitForApproval, me as postPayablesIdValidate, he as postPayablesUploadFromFile, ge as postPaymentIntentsIdCancel, _e as postProducts, ve as postReceivables, ye as postReceivablesIdAccept, be as postReceivablesIdCancel, xe as postReceivablesIdClone, Se as postReceivablesIdDecline, Ce as postReceivablesIdIssue, we as postReceivablesIdMarkAsPaid, Te as postReceivablesIdMarkAsPartiallyPaid, Ee as postReceivablesIdMarkAsUncollectible, De as postReceivablesIdSend, Oe as postTags, ke as putPayablesIdLineItems, Ae as putReceivablesIdLineItems, zn as putTransactionsValidationsMutation, n as registerQueryClient, r as removeInactiveFromAllClients, i as setAllClientsQueriesData, Bn as submitApplicationMutation, Vn as unlinkExternalBankAccountMutation, a as unregisterQueryClient, Hn as updateApplicationMutation, Un as updateBankAccountMutation, je as updateDepartment, Wn as updateExternalBankAccountMutation, Me as updateLocation, Ne as updateUser, fr as useAcceptWidgetDisclosures, rr as useAllBankAccountsQuery, ir as useAllExternalBankAccountsQuery, or as useAllLedgerAccountsQuery, ar as useAllMerchantCategoryGroupsQuery, lr as useAllOrganizationRolesQuery, dr as useAllOrganizationUsersQuery, nr as useAutoFetchNextPage, qn as useCurrentUserQuery, pr as useDisclosuresQuery, u as useEmbedApi, Xn as useGetUserDataQuery, sr as useLedgerAccountsQuery, cr as usePaymentTermsQuery, ur as useRolePermissionsQueries, Zn as useUpsertUserDataMutation, Gn as validateExternalBankAccountMutation, Kn as withAuthEpoch };
|
package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/apiErrorStatus.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/apiErrorStatus.js
|
|
2
|
+
function e(e) {
|
|
3
|
+
return typeof e == "object" && !!e;
|
|
4
|
+
}
|
|
5
|
+
var t = [
|
|
6
|
+
"error",
|
|
7
|
+
"data",
|
|
8
|
+
"body",
|
|
9
|
+
"cause"
|
|
10
|
+
];
|
|
11
|
+
function n(t) {
|
|
12
|
+
if (!e(t)) return;
|
|
13
|
+
let n = t.status;
|
|
14
|
+
return typeof n == "number" || typeof n == "string" ? n : void 0;
|
|
15
|
+
}
|
|
16
|
+
function r(e, t) {
|
|
17
|
+
return e === t || e === String(t);
|
|
18
|
+
}
|
|
19
|
+
function i(i, a) {
|
|
20
|
+
if (r(n(i), a)) return !0;
|
|
21
|
+
if (!e(i)) return !1;
|
|
22
|
+
for (let e of t) if (r(n(i[e]), a)) return !0;
|
|
23
|
+
return !1;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { i as hasApiStatus, e as isRecord };
|
|
@@ -1,26 +1,7 @@
|
|
|
1
|
+
import { hasApiStatus as e } from "./apiErrorStatus.js";
|
|
1
2
|
//#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/isApiNotFoundError.js
|
|
2
|
-
function
|
|
3
|
-
return
|
|
4
|
-
}
|
|
5
|
-
var t = [
|
|
6
|
-
"error",
|
|
7
|
-
"data",
|
|
8
|
-
"body",
|
|
9
|
-
"cause"
|
|
10
|
-
];
|
|
11
|
-
function n(t) {
|
|
12
|
-
if (!e(t)) return;
|
|
13
|
-
let n = t.status;
|
|
14
|
-
return typeof n == "number" || typeof n == "string" ? n : void 0;
|
|
15
|
-
}
|
|
16
|
-
function r(e) {
|
|
17
|
-
return e === 404 || e === "404";
|
|
18
|
-
}
|
|
19
|
-
function i(i) {
|
|
20
|
-
if (r(n(i))) return !0;
|
|
21
|
-
if (!e(i)) return !1;
|
|
22
|
-
for (let e of t) if (r(n(i[e]))) return !0;
|
|
23
|
-
return !1;
|
|
3
|
+
function t(t) {
|
|
4
|
+
return e(t, 404);
|
|
24
5
|
}
|
|
25
6
|
//#endregion
|
|
26
|
-
export {
|
|
7
|
+
export { t as isApiNotFoundError };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isRecord as e } from "./apiErrorStatus.js";
|
|
2
|
+
import { isApiNotFoundError as t } from "./isApiNotFoundError.js";
|
|
2
3
|
//#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/isUserDataNotFoundError.js
|
|
3
|
-
function n(
|
|
4
|
-
if (!t
|
|
5
|
-
let { detail: n } =
|
|
4
|
+
function n(t) {
|
|
5
|
+
if (!e(t)) return !1;
|
|
6
|
+
let { detail: n } = t;
|
|
6
7
|
return typeof n == "string" && n.includes("No value stored under key");
|
|
7
8
|
}
|
|
8
9
|
function r(r) {
|
|
9
|
-
if (
|
|
10
|
-
if (!
|
|
10
|
+
if (t(r) || n(r)) return !0;
|
|
11
|
+
if (!e(r)) return !1;
|
|
11
12
|
for (let e of [
|
|
12
13
|
r.error,
|
|
13
14
|
r.data,
|