@tesouro/embedded-components-react 0.3.36 → 0.3.38
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 +31 -0
- package/dist/lib/CardDetailsWidget.d.ts +31 -0
- package/dist/lib/CardsWidget.d.ts +31 -0
- 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 +36 -6
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js +34 -11
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index5.js +13 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +118 -59
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +151 -124
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +3 -0
- 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
|
@@ -2,147 +2,174 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { EmptyState as
|
|
7
|
-
import { ErrorState as
|
|
8
|
-
import { InlineErrorAlert as
|
|
5
|
+
import { Button as e, Skeleton as t, cn as n } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { EmptyState as r } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
|
|
7
|
+
import { ErrorState as i } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
8
|
+
import { InlineErrorAlert as a } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
|
|
9
9
|
import "../../../../../shared/ui/dist/index.js";
|
|
10
|
-
import { cardDetailsWidgetUiTestIds as
|
|
11
|
-
import { CardDetailsHeader as
|
|
12
|
-
import { CARD_FACE_WIDTH_CLASS_NAME as
|
|
13
|
-
import { CardFace as
|
|
14
|
-
import { DetailCopyRow as
|
|
15
|
-
import { resolveCardDetailsPanelLabels as
|
|
16
|
-
import { CardCredentialsFace as
|
|
17
|
-
import { CardFaceFlip as
|
|
18
|
-
import { useMemo as
|
|
19
|
-
import { jsx as
|
|
20
|
-
import { CreditCardIcon as
|
|
10
|
+
import { cardDetailsWidgetUiTestIds as o } from "./testIds.js";
|
|
11
|
+
import { CardDetailsHeader as s } from "./CardDetailsHeader.js";
|
|
12
|
+
import { CARD_FACE_WIDTH_CLASS_NAME as c } from "./cardFaceSurface.js";
|
|
13
|
+
import { CardFace as ee } from "./CardFace.js";
|
|
14
|
+
import { DetailCopyRow as l } from "./DetailCopyRow.js";
|
|
15
|
+
import { resolveCardDetailsPanelLabels as u } from "./labels.js";
|
|
16
|
+
import { CardCredentialsFace as d } from "./CardCredentialsFace.js";
|
|
17
|
+
import { CardFaceFlip as f } from "./CardFaceFlip.js";
|
|
18
|
+
import { useMemo as p } from "react";
|
|
19
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
20
|
+
import { CheckIcon as g, CreditCardIcon as _, EyeIcon as v, EyeOffIcon as y, PowerIcon as b } from "lucide-react";
|
|
21
21
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js
|
|
22
|
-
function
|
|
23
|
-
let
|
|
24
|
-
bankLogoSrc:
|
|
25
|
-
bankLogoAlt:
|
|
26
|
-
cardholderName:
|
|
27
|
-
maskedCardNumber:
|
|
28
|
-
programLabel:
|
|
29
|
-
statusLabel:
|
|
22
|
+
function x({ labels: x, state: S, nickname: C, statusLabel: te, statusTone: ne, formFactorLabel: w, cardMenu: T, onClose: E, bankLogoSrc: D, bankLogoAlt: O, cardholderName: k, maskedCardNumber: A, programLabel: j, cardFaceStatusLabel: M, billingAddress: N, allowedCategories: P, spendLimitLabels: F, perTransactionMaxLabel: I, onCopy: L, onActivate: R, onViewCard: z, onHideCard: B, revealState: V = "hidden", revealedCardNumber: H, revealedExpirationDate: U, revealedSecurityCode: W, onRetry: G, className: K }) {
|
|
23
|
+
let q = p(() => u(x), [x]), J = !!P?.length, Y = !!F?.length, X = !!I, Z = V === "revealed", Q = Z ? B : z, $ = /* @__PURE__ */ m(ee, {
|
|
24
|
+
bankLogoSrc: D,
|
|
25
|
+
bankLogoAlt: O ?? q.cardFace.bankLogoAlt,
|
|
26
|
+
cardholderName: k ?? "",
|
|
27
|
+
maskedCardNumber: A ?? "",
|
|
28
|
+
programLabel: j ?? "",
|
|
29
|
+
statusLabel: M
|
|
30
30
|
});
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
"data-testid":
|
|
33
|
-
className:
|
|
34
|
-
children: [/* @__PURE__ */
|
|
35
|
-
labels:
|
|
36
|
-
title:
|
|
37
|
-
isTitlePending:
|
|
38
|
-
statusLabel:
|
|
39
|
-
statusTone:
|
|
40
|
-
formFactorLabel:
|
|
41
|
-
cardMenu:
|
|
42
|
-
onClose:
|
|
43
|
-
}), /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ h("div", {
|
|
32
|
+
"data-testid": o.panel,
|
|
33
|
+
className: n("ttw:flex ttw:w-full ttw:flex-col", K),
|
|
34
|
+
children: [/* @__PURE__ */ m(s, {
|
|
35
|
+
labels: q.header,
|
|
36
|
+
title: S === "loaded" ? C ?? q.header.untitledCard : void 0,
|
|
37
|
+
isTitlePending: S === "loading",
|
|
38
|
+
statusLabel: S === "loaded" ? te : void 0,
|
|
39
|
+
statusTone: ne,
|
|
40
|
+
formFactorLabel: S === "loaded" ? w : void 0,
|
|
41
|
+
cardMenu: S === "loaded" ? T : void 0,
|
|
42
|
+
onClose: E
|
|
43
|
+
}), /* @__PURE__ */ m("div", {
|
|
44
44
|
className: "ttw:px-4 ttw:pb-4",
|
|
45
|
-
children:
|
|
46
|
-
"data-testid":
|
|
45
|
+
children: S === "loading" ? /* @__PURE__ */ h("div", {
|
|
46
|
+
"data-testid": o.loading,
|
|
47
47
|
role: "status",
|
|
48
|
-
"aria-label":
|
|
48
|
+
"aria-label": q.status.loadingAriaLabel,
|
|
49
49
|
className: "ttw:space-y-4",
|
|
50
|
-
children: [/* @__PURE__ */
|
|
51
|
-
}) :
|
|
52
|
-
title:
|
|
53
|
-
description:
|
|
54
|
-
retryLabel:
|
|
55
|
-
onRetry:
|
|
56
|
-
}) :
|
|
57
|
-
icon: /* @__PURE__ */
|
|
58
|
-
title:
|
|
59
|
-
description:
|
|
60
|
-
}) : /* @__PURE__ */
|
|
61
|
-
className: "ttw:flex ttw:flex-col ttw:
|
|
62
|
-
children: [/* @__PURE__ */
|
|
63
|
-
className: "ttw:flex ttw:
|
|
64
|
-
children: /* @__PURE__ */
|
|
65
|
-
className:
|
|
66
|
-
children:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
onClick: z,
|
|
83
|
-
children: [/* @__PURE__ */ g(x, {
|
|
84
|
-
className: "ttw:size-4",
|
|
85
|
-
"aria-hidden": "true"
|
|
86
|
-
}), J.actions.activateCard]
|
|
87
|
-
}) : null,
|
|
88
|
-
B ? /* @__PURE__ */ g("div", {
|
|
89
|
-
className: "ttw:flex ttw:gap-2",
|
|
90
|
-
children: /* @__PURE__ */ _(t, {
|
|
50
|
+
children: [/* @__PURE__ */ m(t, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ m(t, { className: "ttw:h-64 ttw:w-full ttw:rounded-xl" })]
|
|
51
|
+
}) : S === "error" ? /* @__PURE__ */ m(i, {
|
|
52
|
+
title: q.status.errorTitle,
|
|
53
|
+
description: q.status.errorDescription,
|
|
54
|
+
retryLabel: q.status.errorRetry,
|
|
55
|
+
onRetry: G
|
|
56
|
+
}) : S === "notFound" ? /* @__PURE__ */ m(r, {
|
|
57
|
+
icon: /* @__PURE__ */ m(_, { className: "ttw:size-6 ttw:text-muted-foreground" }),
|
|
58
|
+
title: q.status.notFoundTitle,
|
|
59
|
+
description: q.status.notFoundDescription
|
|
60
|
+
}) : /* @__PURE__ */ h("div", {
|
|
61
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
62
|
+
children: [/* @__PURE__ */ h("div", {
|
|
63
|
+
className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border ttw:sm:flex-row",
|
|
64
|
+
children: [/* @__PURE__ */ m("div", {
|
|
65
|
+
className: "ttw:flex ttw:items-center ttw:justify-center ttw:bg-muted ttw:px-4 ttw:py-5",
|
|
66
|
+
children: /* @__PURE__ */ h("div", {
|
|
67
|
+
className: n("ttw:flex ttw:flex-col ttw:gap-4", c),
|
|
68
|
+
children: [z ? /* @__PURE__ */ m(f, {
|
|
69
|
+
isFlipped: Z,
|
|
70
|
+
front: $,
|
|
71
|
+
back: /* @__PURE__ */ m(d, {
|
|
72
|
+
labels: q.credentials,
|
|
73
|
+
cardNumber: H,
|
|
74
|
+
expirationDate: U,
|
|
75
|
+
securityCode: W,
|
|
76
|
+
onCopy: L
|
|
77
|
+
})
|
|
78
|
+
}) : $, R || z ? /* @__PURE__ */ h("div", {
|
|
79
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
80
|
+
children: [
|
|
81
|
+
R ? /* @__PURE__ */ h(e, {
|
|
91
82
|
type: "button",
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
loading: H === "revealing",
|
|
96
|
-
onClick: Z,
|
|
97
|
-
children: [g(X ? b : y, {
|
|
83
|
+
className: "ttw:self-center",
|
|
84
|
+
onClick: R,
|
|
85
|
+
children: [/* @__PURE__ */ m(b, {
|
|
98
86
|
className: "ttw:size-4",
|
|
99
87
|
"aria-hidden": "true"
|
|
100
|
-
}),
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
88
|
+
}), q.actions.activateCard]
|
|
89
|
+
}) : null,
|
|
90
|
+
z ? /* @__PURE__ */ m("div", {
|
|
91
|
+
className: "ttw:flex ttw:gap-2",
|
|
92
|
+
children: /* @__PURE__ */ h(e, {
|
|
93
|
+
type: "button",
|
|
94
|
+
variant: "outline",
|
|
95
|
+
className: "ttw:flex-1",
|
|
96
|
+
disabled: !Q,
|
|
97
|
+
loading: V === "revealing",
|
|
98
|
+
onClick: Q,
|
|
99
|
+
children: [m(Z ? y : v, {
|
|
100
|
+
className: "ttw:size-4",
|
|
101
|
+
"aria-hidden": "true"
|
|
102
|
+
}), Z ? q.actions.hideCard : q.actions.viewCard]
|
|
103
|
+
})
|
|
104
|
+
}) : null,
|
|
105
|
+
V === "errored" ? /* @__PURE__ */ m(a, { children: q.credentials.errorDescription }) : null
|
|
106
|
+
]
|
|
107
|
+
}) : null]
|
|
108
|
+
})
|
|
109
|
+
}), /* @__PURE__ */ h("div", {
|
|
110
|
+
className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:border-t ttw:border-border ttw:sm:border-t-0 ttw:sm:border-l",
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ m(l, {
|
|
113
|
+
label: q.fields.cardholder,
|
|
114
|
+
copyAriaLabel: k && L ? q.fields.copyCardholderAriaLabel : void 0,
|
|
115
|
+
onCopy: k && L ? () => L(k) : void 0,
|
|
116
|
+
children: k ?? q.fields.emptyValue
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ m(l, {
|
|
119
|
+
label: q.fields.nickname,
|
|
120
|
+
copyAriaLabel: C && L ? q.fields.copyNicknameAriaLabel : void 0,
|
|
121
|
+
onCopy: C && L ? () => L(C) : void 0,
|
|
122
|
+
isLast: !N,
|
|
123
|
+
children: C ?? q.fields.emptyValue
|
|
124
|
+
}),
|
|
125
|
+
N ? /* @__PURE__ */ m(l, {
|
|
126
|
+
label: q.fields.billingAddress,
|
|
127
|
+
copyAriaLabel: L ? q.fields.copyBillingAddressAriaLabel : void 0,
|
|
128
|
+
onCopy: L ? () => L(N) : void 0,
|
|
129
|
+
isLast: !0,
|
|
130
|
+
children: N
|
|
131
|
+
}) : null
|
|
132
|
+
]
|
|
133
|
+
})]
|
|
134
|
+
}), J || Y || X ? /* @__PURE__ */ h("div", {
|
|
135
|
+
className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border",
|
|
109
136
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
onCopy: M && R ? () => R(M) : void 0,
|
|
114
|
-
children: M ?? J.fields.emptyValue
|
|
115
|
-
}),
|
|
116
|
-
/* @__PURE__ */ g(d, {
|
|
117
|
-
label: J.fields.nickname,
|
|
118
|
-
copyAriaLabel: w && R ? J.fields.copyNicknameAriaLabel : void 0,
|
|
119
|
-
onCopy: w && R ? () => R(w) : void 0,
|
|
120
|
-
isLast: !I && !Y,
|
|
121
|
-
children: w ?? J.fields.emptyValue
|
|
137
|
+
/* @__PURE__ */ m("h3", {
|
|
138
|
+
className: "ttw:border-b ttw:border-border ttw:px-4 ttw:pt-4 ttw:pb-3 ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
139
|
+
children: q.fields.cardControlsHeading
|
|
122
140
|
}),
|
|
123
|
-
|
|
124
|
-
label:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
141
|
+
J ? /* @__PURE__ */ m(l, {
|
|
142
|
+
label: q.fields.allowedCategories,
|
|
143
|
+
isLast: !Y && !X,
|
|
144
|
+
children: /* @__PURE__ */ m("div", {
|
|
145
|
+
className: "ttw:mt-2 ttw:flex ttw:flex-wrap ttw:gap-2",
|
|
146
|
+
children: P?.map((e) => /* @__PURE__ */ h("span", {
|
|
147
|
+
className: "ttw:inline-flex ttw:items-center ttw:gap-1.5 ttw:rounded-full ttw:border ttw:border-primary ttw:bg-primary/5 ttw:px-4 ttw:py-2 ttw:text-sm ttw:font-semibold ttw:text-primary",
|
|
148
|
+
children: [/* @__PURE__ */ m(g, {
|
|
149
|
+
"aria-hidden": "true",
|
|
150
|
+
className: "ttw:size-3.5"
|
|
151
|
+
}), e]
|
|
152
|
+
}, e))
|
|
153
|
+
})
|
|
129
154
|
}) : null,
|
|
130
|
-
Y ? /* @__PURE__ */
|
|
131
|
-
label:
|
|
132
|
-
isLast: !
|
|
133
|
-
children: /* @__PURE__ */
|
|
134
|
-
className: "ttw:flex ttw:flex-
|
|
135
|
-
children:
|
|
136
|
-
variant: "secondary",
|
|
137
|
-
children: t
|
|
138
|
-
}, t))
|
|
155
|
+
Y ? /* @__PURE__ */ m(l, {
|
|
156
|
+
label: q.fields.spendLimit,
|
|
157
|
+
isLast: !X,
|
|
158
|
+
children: /* @__PURE__ */ m("div", {
|
|
159
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
160
|
+
children: F?.map((e, t) => /* @__PURE__ */ m("div", { children: e }, `${e}-${t}`))
|
|
139
161
|
})
|
|
162
|
+
}) : null,
|
|
163
|
+
X ? /* @__PURE__ */ m(l, {
|
|
164
|
+
label: q.fields.perTransactionMax,
|
|
165
|
+
isLast: !0,
|
|
166
|
+
children: I
|
|
140
167
|
}) : null
|
|
141
168
|
]
|
|
142
|
-
})]
|
|
169
|
+
}) : null]
|
|
143
170
|
})
|
|
144
171
|
})]
|
|
145
172
|
});
|
|
146
173
|
}
|
|
147
174
|
//#endregion
|
|
148
|
-
export {
|
|
175
|
+
export { x as CardDetailsPanel };
|
|
@@ -10,7 +10,10 @@ var e = {
|
|
|
10
10
|
cardholder: "Cardholder",
|
|
11
11
|
nickname: "Nickname",
|
|
12
12
|
billingAddress: "Billing address",
|
|
13
|
+
cardControlsHeading: "Card controls",
|
|
13
14
|
allowedCategories: "Allowed categories",
|
|
15
|
+
spendLimit: "Spend limit",
|
|
16
|
+
perTransactionMax: "Per-transaction max",
|
|
14
17
|
emptyValue: "—",
|
|
15
18
|
copyCardholderAriaLabel: "Copy cardholder",
|
|
16
19
|
copyNicknameAriaLabel: "Copy nickname",
|
|
@@ -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,
|