@tesouro/embedded-components-react 0.3.36 → 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/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/README.md
CHANGED
|
@@ -272,19 +272,19 @@ One page of an organization's credit **or** debit cards, with a scope-gated "Sho
|
|
|
272
272
|
|
|
273
273
|
### CardDetailsWidget
|
|
274
274
|
|
|
275
|
-
Read-only details for one credit **or** debit card — status, form factor, program, masked card number, and copyable cardholder and nickname rows. It renders panel content rather than its own drawer, so it sits on a page of your own as readily as inside chrome you already have.
|
|
275
|
+
Read-only details for one credit **or** debit card — status, form factor, program, masked card number, and copyable cardholder and nickname rows. A debit card can also reveal its number, expiry and security code on demand. It renders panel content rather than its own drawer, so it sits on a page of your own as readily as inside chrome you already have.
|
|
276
276
|
|
|
277
277
|
#### Props
|
|
278
278
|
|
|
279
|
-
| Prop | Type | Default | Description
|
|
280
|
-
| ---------------- | --------------------------------------- | -------------- |
|
|
281
|
-
| `cardId` | `string` | **Required** | Id of the card to show.
|
|
282
|
-
| `cardProgram` | `'credit' \| 'debit'` | **Required** | Which issuing program `cardId` belongs to. Selects the endpoint the card is fetched from.
|
|
283
|
-
| `onClose` | `() => void` | `undefined` | Called when the header's close control is pressed. Omit it and no close control is rendered at all.
|
|
284
|
-
| `labels` | `PartialDeep<CardDetailsWidgetLabels>` | English labels | Overrides the panel's own copy — header, card face alt text, row headings, copy-button accessible names, and the loading/error/not-found screens.
|
|
285
|
-
| `featureLabels` | `PartialDeep<CardDetailsFeatureLabels>` | English labels | Overrides the copy this widget resolves rather than passes through — status, form-factor and program vocabulary,
|
|
286
|
-
| `bankLogoSrc` | `string` | `undefined` | Bank logo for the card face. Omit and the face renders without a logo rather than with a placeholder.
|
|
287
|
-
| `bankLogoAlt` | `string` | `undefined` | Alt text for `bankLogoSrc`. Falls back to `labels.cardFace.bankLogoAlt`.
|
|
279
|
+
| Prop | Type | Default | Description |
|
|
280
|
+
| ---------------- | --------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
281
|
+
| `cardId` | `string` | **Required** | Id of the card to show. |
|
|
282
|
+
| `cardProgram` | `'credit' \| 'debit'` | **Required** | Which issuing program `cardId` belongs to. Selects the endpoint the card is fetched from. |
|
|
283
|
+
| `onClose` | `() => void` | `undefined` | Called when the header's close control is pressed. Omit it and no close control is rendered at all. |
|
|
284
|
+
| `labels` | `PartialDeep<CardDetailsWidgetLabels>` | English labels | Overrides the panel's own copy — header, card face alt text, row headings, copy-button accessible names, and the loading/error/not-found screens. |
|
|
285
|
+
| `featureLabels` | `PartialDeep<CardDetailsFeatureLabels>` | English labels | Overrides the copy this widget resolves rather than passes through — status, form-factor and program vocabulary, the copy-success toast, and the refused-reveal sentence. |
|
|
286
|
+
| `bankLogoSrc` | `string` | `undefined` | Bank logo for the card face. Omit and the face renders without a logo rather than with a placeholder. |
|
|
287
|
+
| `bankLogoAlt` | `string` | `undefined` | Alt text for `bankLogoSrc`. Falls back to `labels.cardFace.bankLogoAlt`. |
|
|
288
288
|
|
|
289
289
|
### CreateCardWidget
|
|
290
290
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2235,6 +2235,21 @@ type PartialDeep$3<T> = {
|
|
|
2235
2235
|
interface CardDetailsFeatureLabels {
|
|
2236
2236
|
/** Confirmation toast after a copy affordance writes to the clipboard. */
|
|
2237
2237
|
copySuccessToast: string;
|
|
2238
|
+
/**
|
|
2239
|
+
* Replaces the panel's generic reveal error when the credentials call was
|
|
2240
|
+
* refused (HTTP 403).
|
|
2241
|
+
*
|
|
2242
|
+
* It lives here rather than on the panel because deciding that a failure was a
|
|
2243
|
+
* refusal means reading the error, which is this layer's job — the panel is
|
|
2244
|
+
* handed one already-chosen sentence either way, and its own
|
|
2245
|
+
* `credentials.errorDescription` still covers every other failure.
|
|
2246
|
+
*
|
|
2247
|
+
* The wording deliberately does not tell the reader to ask for a permission.
|
|
2248
|
+
* Reading a debit card and reading its credentials take the same scope, so a
|
|
2249
|
+
* reader looking at this panel already holds it; a 403 here means the call was
|
|
2250
|
+
* refused for this session, which asking an admin for a role will not fix.
|
|
2251
|
+
*/
|
|
2252
|
+
revealNotPermittedDescription: string;
|
|
2238
2253
|
/** Program wording on the card face, keyed on the widget's `cardProgram`. */
|
|
2239
2254
|
programLabels: Record<CardProgram, string>;
|
|
2240
2255
|
/** Status badge wording, keyed on the generated card status. */
|
|
@@ -764,6 +764,21 @@ type PartialDeep<T> = {
|
|
|
764
764
|
interface CardDetailsFeatureLabels {
|
|
765
765
|
/** Confirmation toast after a copy affordance writes to the clipboard. */
|
|
766
766
|
copySuccessToast: string;
|
|
767
|
+
/**
|
|
768
|
+
* Replaces the panel's generic reveal error when the credentials call was
|
|
769
|
+
* refused (HTTP 403).
|
|
770
|
+
*
|
|
771
|
+
* It lives here rather than on the panel because deciding that a failure was a
|
|
772
|
+
* refusal means reading the error, which is this layer's job — the panel is
|
|
773
|
+
* handed one already-chosen sentence either way, and its own
|
|
774
|
+
* `credentials.errorDescription` still covers every other failure.
|
|
775
|
+
*
|
|
776
|
+
* The wording deliberately does not tell the reader to ask for a permission.
|
|
777
|
+
* Reading a debit card and reading its credentials take the same scope, so a
|
|
778
|
+
* reader looking at this panel already holds it; a 403 here means the call was
|
|
779
|
+
* refused for this session, which asking an admin for a role will not fix.
|
|
780
|
+
*/
|
|
781
|
+
revealNotPermittedDescription: string;
|
|
767
782
|
/** Program wording on the card face, keyed on the widget's `cardProgram`. */
|
|
768
783
|
programLabels: Record<CardProgram, string>;
|
|
769
784
|
/** Status badge wording, keyed on the generated card status. */
|
|
@@ -851,6 +851,21 @@ type PartialDeep$2<T> = {
|
|
|
851
851
|
interface CardDetailsFeatureLabels {
|
|
852
852
|
/** Confirmation toast after a copy affordance writes to the clipboard. */
|
|
853
853
|
copySuccessToast: string;
|
|
854
|
+
/**
|
|
855
|
+
* Replaces the panel's generic reveal error when the credentials call was
|
|
856
|
+
* refused (HTTP 403).
|
|
857
|
+
*
|
|
858
|
+
* It lives here rather than on the panel because deciding that a failure was a
|
|
859
|
+
* refusal means reading the error, which is this layer's job — the panel is
|
|
860
|
+
* handed one already-chosen sentence either way, and its own
|
|
861
|
+
* `credentials.errorDescription` still covers every other failure.
|
|
862
|
+
*
|
|
863
|
+
* The wording deliberately does not tell the reader to ask for a permission.
|
|
864
|
+
* Reading a debit card and reading its credentials take the same scope, so a
|
|
865
|
+
* reader looking at this panel already holds it; a 403 here means the call was
|
|
866
|
+
* refused for this session, which asking an admin for a role will not fix.
|
|
867
|
+
*/
|
|
868
|
+
revealNotPermittedDescription: string;
|
|
854
869
|
/** Program wording on the card face, keyed on the widget's `cardProgram`. */
|
|
855
870
|
programLabels: Record<CardProgram, string>;
|
|
856
871
|
/** Status badge wording, keyed on the generated card status. */
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "./index2.js";
|
|
2
2
|
import { useCreditCardDetailsQuery as e } from "./index4.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { useDebitCardCredentialsQuery as t } from "./index5.js";
|
|
4
|
+
import { useDebitCardDetailsQuery as n } from "./index6.js";
|
|
5
|
+
export { e as useCreditCardDetailsQuery, t as useDebitCardCredentialsQuery, n as useDebitCardDetailsQuery };
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index5.js
CHANGED
|
@@ -4,22 +4,29 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
6
|
import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
7
|
-
import {
|
|
7
|
+
import { getDebitCardCredentialsOptions as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
8
8
|
import { withAuthEpoch as r } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
9
|
+
import { isApiForbiddenError as i } from "../../../shared/data-access/dist/lib/isApiForbiddenError.js";
|
|
9
10
|
import "../../../shared/data-access/dist/index.js";
|
|
10
|
-
import { withNotFoundOutcome as i } from "./index3.js";
|
|
11
11
|
import { useQuery as a } from "@tanstack/react-query";
|
|
12
12
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index5.js
|
|
13
13
|
function o({ cardId: o, enabled: s }) {
|
|
14
|
-
let { client: c, organizationId: l, widgetToken: u, authEpoch: d } = e(), f = n({
|
|
14
|
+
let { client: c, organizationId: l, widgetToken: u, authEpoch: d } = e(), f = !!(o && l && u) && s, p = f ? o ?? "" : "", m = n({
|
|
15
15
|
client: c,
|
|
16
16
|
headers: t(l),
|
|
17
|
-
path: { id:
|
|
18
|
-
}),
|
|
19
|
-
...r(
|
|
20
|
-
enabled:
|
|
17
|
+
path: { id: p }
|
|
18
|
+
}), h = a({
|
|
19
|
+
...r(m, d),
|
|
20
|
+
enabled: f,
|
|
21
|
+
staleTime: 0,
|
|
22
|
+
gcTime: 0,
|
|
23
|
+
retry: !1,
|
|
24
|
+
placeholderData: void 0
|
|
21
25
|
});
|
|
22
|
-
return
|
|
26
|
+
return {
|
|
27
|
+
...h,
|
|
28
|
+
isForbidden: h.isError && i(h.error)
|
|
29
|
+
};
|
|
23
30
|
}
|
|
24
31
|
//#endregion
|
|
25
|
-
export { o as
|
|
32
|
+
export { o as useDebitCardCredentialsQuery };
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index6.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
|
+
import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
7
|
+
import { getDebitCardByIdOptions as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
8
|
+
import { withAuthEpoch as r } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
9
|
+
import "../../../shared/data-access/dist/index.js";
|
|
10
|
+
import { withNotFoundOutcome as i } from "./index3.js";
|
|
11
|
+
import { useQuery as a } from "@tanstack/react-query";
|
|
12
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index6.js
|
|
13
|
+
function o({ cardId: o, enabled: s }) {
|
|
14
|
+
let { client: c, organizationId: l, widgetToken: u, authEpoch: d } = e(), f = n({
|
|
15
|
+
client: c,
|
|
16
|
+
headers: t(l),
|
|
17
|
+
path: { id: o ?? "" }
|
|
18
|
+
}), p = a({
|
|
19
|
+
...r(f, d),
|
|
20
|
+
enabled: !!(o && l && u) && s !== !1
|
|
21
|
+
});
|
|
22
|
+
return i(p);
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { o as useDebitCardDetailsQuery };
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js
CHANGED
|
@@ -4,7 +4,26 @@ function t(t) {
|
|
|
4
4
|
let n = t.trim().slice(-4);
|
|
5
5
|
return n ? `${e} ${e} ${e} ${n}` : "";
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
function n(e) {
|
|
8
|
+
let t = e.replace(/\s+/g, "");
|
|
9
|
+
return t ? (t.match(/.{1,4}/g) ?? []).join(" ") : "";
|
|
10
|
+
}
|
|
11
|
+
function r(e) {
|
|
12
|
+
let t = e.trim();
|
|
13
|
+
if (!t) return "";
|
|
14
|
+
let n = /^(\d{4})-(\d{2})(?:\D|$)/.exec(t);
|
|
15
|
+
if (n) {
|
|
16
|
+
let [, e, t] = n;
|
|
17
|
+
return `${t}/${e.slice(-2)}`;
|
|
18
|
+
}
|
|
19
|
+
let r = /^(\d{2})\/(\d{2}|\d{4})$/.exec(t);
|
|
20
|
+
if (r) {
|
|
21
|
+
let [, e, t] = r;
|
|
22
|
+
return `${e}/${t.slice(-2)}`;
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
}
|
|
26
|
+
async function i(e) {
|
|
8
27
|
if (!e.trim()) return !1;
|
|
9
28
|
try {
|
|
10
29
|
return await navigator.clipboard.writeText(e), !0;
|
|
@@ -13,4 +32,4 @@ async function n(e) {
|
|
|
13
32
|
}
|
|
14
33
|
}
|
|
15
34
|
//#endregion
|
|
16
|
-
export {
|
|
35
|
+
export { i as copyTextToClipboard, n as formatCardNumber, r as formatExpirationDate, t as maskCardNumber };
|
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 };
|