@tesouro/embedded-components-react 0.9.44 → 0.9.46
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/dist/experimental/ApprovalRequests.d.ts +10 -2
- package/dist/experimental/index.d.ts +10 -2
- package/dist/fixtures/index.d.ts +40 -5
- package/dist/index.d.ts +3 -0
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/ApprovalRequestsWidget.js +67 -57
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/labels.js +6 -1
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestDecisions.js +72 -54
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/scopes.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access-mocks/dist/lib/fixtures.js +11 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -680,11 +680,19 @@ interface ApprovalRequestsListLabels {
|
|
|
680
680
|
status: Record<ApprovalRequestStatus, string>;
|
|
681
681
|
filters: ApprovalRequestsFilterLabels;
|
|
682
682
|
}
|
|
683
|
+
/** Toast copy for approve and reject; the error copy is the fallback when the API gives no reason. */
|
|
684
|
+
interface ApprovalRequestsMessageLabels {
|
|
685
|
+
approved: string;
|
|
686
|
+
rejected: string;
|
|
687
|
+
approveError: string;
|
|
688
|
+
rejectError: string;
|
|
689
|
+
}
|
|
683
690
|
|
|
684
691
|
interface ApprovalRequestsWidgetOwnProps {
|
|
685
692
|
screenLabels?: PartialDeep<ApprovalRequestsScreenLabels>;
|
|
686
693
|
listLabels?: PartialDeep<ApprovalRequestsListLabels>;
|
|
687
|
-
rejectDialogLabels?:
|
|
694
|
+
rejectDialogLabels?: PartialDeep<RejectApprovalRequestDialogLabels>;
|
|
695
|
+
messageLabels?: PartialDeep<ApprovalRequestsMessageLabels>;
|
|
688
696
|
}
|
|
689
697
|
/** Public props for {@link ApprovalRequestsWidget}. */
|
|
690
698
|
type ApprovalRequestsWidgetProps = WidgetProviderProps & ApprovalRequestsWidgetOwnProps;
|
|
@@ -692,7 +700,7 @@ type ApprovalRequestsWidgetProps = WidgetProviderProps & ApprovalRequestsWidgetO
|
|
|
692
700
|
* Self-contained approval requests widget, a native port of Monite's approval
|
|
693
701
|
* requests (FOPS-97). Exported only from the package's `/experimental` entry.
|
|
694
702
|
*/
|
|
695
|
-
declare function ApprovalRequestsWidget({ screenLabels, listLabels, rejectDialogLabels, ...widgetProviderProps }: ApprovalRequestsWidgetProps): React.JSX.Element;
|
|
703
|
+
declare function ApprovalRequestsWidget({ screenLabels, listLabels, rejectDialogLabels, messageLabels, ...widgetProviderProps }: ApprovalRequestsWidgetProps): React.JSX.Element;
|
|
696
704
|
|
|
697
705
|
export { ApprovalRequestsWidget };
|
|
698
706
|
export type { ApprovalRequestsWidgetProps };
|
|
@@ -680,11 +680,19 @@ interface ApprovalRequestsListLabels {
|
|
|
680
680
|
status: Record<ApprovalRequestStatus, string>;
|
|
681
681
|
filters: ApprovalRequestsFilterLabels;
|
|
682
682
|
}
|
|
683
|
+
/** Toast copy for approve and reject; the error copy is the fallback when the API gives no reason. */
|
|
684
|
+
interface ApprovalRequestsMessageLabels {
|
|
685
|
+
approved: string;
|
|
686
|
+
rejected: string;
|
|
687
|
+
approveError: string;
|
|
688
|
+
rejectError: string;
|
|
689
|
+
}
|
|
683
690
|
|
|
684
691
|
interface ApprovalRequestsWidgetOwnProps {
|
|
685
692
|
screenLabels?: PartialDeep<ApprovalRequestsScreenLabels>;
|
|
686
693
|
listLabels?: PartialDeep<ApprovalRequestsListLabels>;
|
|
687
|
-
rejectDialogLabels?:
|
|
694
|
+
rejectDialogLabels?: PartialDeep<RejectApprovalRequestDialogLabels>;
|
|
695
|
+
messageLabels?: PartialDeep<ApprovalRequestsMessageLabels>;
|
|
688
696
|
}
|
|
689
697
|
/** Public props for {@link ApprovalRequestsWidget}. */
|
|
690
698
|
type ApprovalRequestsWidgetProps = WidgetProviderProps & ApprovalRequestsWidgetOwnProps;
|
|
@@ -692,7 +700,7 @@ type ApprovalRequestsWidgetProps = WidgetProviderProps & ApprovalRequestsWidgetO
|
|
|
692
700
|
* Self-contained approval requests widget, a native port of Monite's approval
|
|
693
701
|
* requests (FOPS-97). Exported only from the package's `/experimental` entry.
|
|
694
702
|
*/
|
|
695
|
-
declare function ApprovalRequestsWidget({ screenLabels, listLabels, rejectDialogLabels, ...widgetProviderProps }: ApprovalRequestsWidgetProps): React.JSX.Element;
|
|
703
|
+
declare function ApprovalRequestsWidget({ screenLabels, listLabels, rejectDialogLabels, messageLabels, ...widgetProviderProps }: ApprovalRequestsWidgetProps): React.JSX.Element;
|
|
696
704
|
|
|
697
705
|
interface CheckAmountAndDetailScreenLabels {
|
|
698
706
|
title: string;
|
package/dist/fixtures/index.d.ts
CHANGED
|
@@ -452,6 +452,7 @@ type BankAccountTransferResponse = {
|
|
|
452
452
|
* The amount transferred.
|
|
453
453
|
*/
|
|
454
454
|
amount: AmountOutput;
|
|
455
|
+
balanceNames?: null | TransferBalanceNames;
|
|
455
456
|
/**
|
|
456
457
|
* When the transfer was initiated, in UTC.
|
|
457
458
|
*/
|
|
@@ -963,6 +964,19 @@ type CurrencyExchangeSchema = {
|
|
|
963
964
|
rate: number;
|
|
964
965
|
total: number;
|
|
965
966
|
};
|
|
967
|
+
/**
|
|
968
|
+
* Which operations the card's provider supports. A true value does not mean the card's current status
|
|
969
|
+
* allows the operation: a closed card still reports `lock` when its provider supports locking.
|
|
970
|
+
*/
|
|
971
|
+
type DebitCardCapabilitiesResponse = {
|
|
972
|
+
activate: boolean;
|
|
973
|
+
billingAddress: boolean;
|
|
974
|
+
close: boolean;
|
|
975
|
+
credentials: boolean;
|
|
976
|
+
lock: boolean;
|
|
977
|
+
merchantCategoryGroups: boolean;
|
|
978
|
+
velocityControls: boolean;
|
|
979
|
+
};
|
|
966
980
|
type DebitCardCredentialsResponse = {
|
|
967
981
|
cvv: string;
|
|
968
982
|
expirationDate: string;
|
|
@@ -975,10 +989,8 @@ type DebitCardCredentialsResponse = {
|
|
|
975
989
|
type DebitCardDetailResponse = {
|
|
976
990
|
id: string;
|
|
977
991
|
bankAccountId: string;
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
*/
|
|
981
|
-
billingAddress: AddressOutput;
|
|
992
|
+
billingAddress: null | AddressOutput;
|
|
993
|
+
capabilities: DebitCardCapabilitiesResponse;
|
|
982
994
|
cardBrand: CardBrand;
|
|
983
995
|
cardStatus: DebitCardStatus;
|
|
984
996
|
cardType: DebitCardType;
|
|
@@ -993,6 +1005,7 @@ type DebitCardDetailResponse = {
|
|
|
993
1005
|
mccGroups: Array<MccGroupResponse>;
|
|
994
1006
|
nickname?: null | string;
|
|
995
1007
|
reference: string;
|
|
1008
|
+
statusReason?: null | DebitCardStatusReason;
|
|
996
1009
|
updatedAt: string;
|
|
997
1010
|
userId: string;
|
|
998
1011
|
/**
|
|
@@ -1002,6 +1015,7 @@ type DebitCardDetailResponse = {
|
|
|
1002
1015
|
velocityControls: Array<VelocityControlResponse>;
|
|
1003
1016
|
};
|
|
1004
1017
|
type DebitCardStatus = 'PENDING_ACTIVATION' | 'ACTIVE' | 'LOCKED' | 'CLOSED';
|
|
1018
|
+
type DebitCardStatusReason = 'LOST' | 'STOLEN' | 'FRAUD' | 'CARDHOLDER_EXIT' | 'REPLACED' | 'EXPIRED';
|
|
1005
1019
|
type DebitCardType = 'DIGITAL' | 'PHYSICAL';
|
|
1006
1020
|
type DeductionItem = {
|
|
1007
1021
|
/**
|
|
@@ -1650,6 +1664,10 @@ type ExternalBankAccountResponse = {
|
|
|
1650
1664
|
* Status of the external bank account.
|
|
1651
1665
|
*/
|
|
1652
1666
|
accountStatus: ExternalBankAccountStatusDto;
|
|
1667
|
+
/**
|
|
1668
|
+
* When the external bank account was created, in UTC.
|
|
1669
|
+
*/
|
|
1670
|
+
createdAt: string;
|
|
1653
1671
|
microDepositVerification?: null | MicroDepositVerificationResponse;
|
|
1654
1672
|
/**
|
|
1655
1673
|
* Name on the bank account.
|
|
@@ -2751,7 +2769,7 @@ type OrganizationLogoResponseDto = {
|
|
|
2751
2769
|
*/
|
|
2752
2770
|
size: number | string;
|
|
2753
2771
|
/**
|
|
2754
|
-
* Relative
|
|
2772
|
+
* Relative path from the authenticated organization endpoints; an absolute CDN URL from the anonymous internal detail endpoint.
|
|
2755
2773
|
*/
|
|
2756
2774
|
url: string;
|
|
2757
2775
|
};
|
|
@@ -3062,6 +3080,10 @@ type PayableResponseSchema = {
|
|
|
3062
3080
|
* Specifies how this payable was created in Monite: `upload` - created via an API call, `email` - sent via email to the entity's mailbox.
|
|
3063
3081
|
*/
|
|
3064
3082
|
payable_origin: PayableOriginEnum;
|
|
3083
|
+
/**
|
|
3084
|
+
* The ID of the FIS payee account object stored in the Payments service, used for FIS Bill Pay STP.
|
|
3085
|
+
*/
|
|
3086
|
+
payee_account_id?: string | null;
|
|
3065
3087
|
/**
|
|
3066
3088
|
* The number of days to pay with potential discount for options shorter than due_date
|
|
3067
3089
|
*/
|
|
@@ -4254,6 +4276,19 @@ type TransactionTypeEnum = 'capture' | 'refund' | 'cash_withdrawal' | 'fee' | 'a
|
|
|
4254
4276
|
type TransactionValidationResponse = {
|
|
4255
4277
|
required_fields: Array<TransactionRequiredFieldItem>;
|
|
4256
4278
|
};
|
|
4279
|
+
/**
|
|
4280
|
+
* The named balances a book transfer moved the amount between, e.g. `available` to `savings`.
|
|
4281
|
+
*/
|
|
4282
|
+
type TransferBalanceNames = {
|
|
4283
|
+
/**
|
|
4284
|
+
* The balance the amount left.
|
|
4285
|
+
*/
|
|
4286
|
+
fromBalanceName: string;
|
|
4287
|
+
/**
|
|
4288
|
+
* The balance the amount landed in.
|
|
4289
|
+
*/
|
|
4290
|
+
toBalanceName: string;
|
|
4291
|
+
};
|
|
4257
4292
|
type UnitResponse = {
|
|
4258
4293
|
id: string;
|
|
4259
4294
|
created_at: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -440,6 +440,7 @@ declare const Scope: {
|
|
|
440
440
|
readonly ExternalBankAccountReadOrg: "external_bank_account:read:org";
|
|
441
441
|
readonly ExternalBankAccountSetVerificationOrg: "external_bank_account:set_verification:org";
|
|
442
442
|
readonly ExternalBankAccountWriteOrg: "external_bank_account:write:org";
|
|
443
|
+
readonly InstantPaymentLimitWriteOrg: "instant_payment_limit:write:org";
|
|
443
444
|
readonly InvoiceReadOrg: "invoice:read:org";
|
|
444
445
|
readonly InvoiceWriteOrg: "invoice:write:org";
|
|
445
446
|
readonly MailboxReadOrg: "mailbox:read:org";
|
|
@@ -477,6 +478,8 @@ declare const Scope: {
|
|
|
477
478
|
readonly RoleReadOrg: "role:read:org";
|
|
478
479
|
readonly RoleWriteOrg: "role:write:org";
|
|
479
480
|
readonly TransferWriteOrg: "transfer:write:org";
|
|
481
|
+
readonly UnderwritingAccountRead: "underwriting:account:read";
|
|
482
|
+
readonly UnderwritingAccountWrite: "underwriting:account:write";
|
|
480
483
|
readonly UnderwritingApplicationApprovalEscalation: "underwriting:application:approval:escalation";
|
|
481
484
|
readonly UnderwritingApplicationApprovalSecondary: "underwriting:application:approval:secondary";
|
|
482
485
|
readonly UnderwritingApplicationRead: "underwriting:application:read";
|
|
@@ -5,76 +5,86 @@
|
|
|
5
5
|
import { isOrganizationOnItsWay as e } from "../../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
6
6
|
import { useEmbedApi as t } from "../../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
7
|
import "../../../../../shared/data-access/dist/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
8
|
+
import { EmbeddedToaster as n } from "../../../../../shared/ui/dist/lib/EmbeddedToaster.js";
|
|
9
|
+
import "../../../../../shared/ui/dist/index.js";
|
|
10
|
+
import { useAnalyticsTrack as r } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
11
|
+
import { WidgetProvider as i } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
12
|
+
import { useRefetchWidget as a, useWidgetConfig as o, useWidgetError as s, useWidgetInitStaleForToken as c, useWidgetLoading as l } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
13
|
import "../../../../../shared/feature/dist/index.js";
|
|
12
|
-
import { ApprovalRequestsWidgetAnalyticsEvent as
|
|
13
|
-
import { APPROVAL_REQUESTS_LIST_LABELS_EN as
|
|
14
|
-
import { getApprovalRequestPermissions as
|
|
15
|
-
import { useApprovalRequestDecisions as
|
|
16
|
-
import { ApprovalRequestsScreen as
|
|
17
|
-
import { RejectApprovalRequestDialog as
|
|
14
|
+
import { ApprovalRequestsWidgetAnalyticsEvent as u, WIDGET_NAME as d } from "../analytics/events.js";
|
|
15
|
+
import { APPROVAL_REQUESTS_LIST_LABELS_EN as f, APPROVAL_REQUESTS_MESSAGE_LABELS_EN as p } from "./labels.js";
|
|
16
|
+
import { getApprovalRequestPermissions as m } from "./permissions.js";
|
|
17
|
+
import { useApprovalRequestDecisions as h } from "./useApprovalRequestDecisions.js";
|
|
18
|
+
import { ApprovalRequestsScreen as g } from "../../../../ui/dist/index4.js";
|
|
19
|
+
import { RejectApprovalRequestDialog as _ } from "../../../../ui/dist/index5.js";
|
|
18
20
|
import "../../../../ui/dist/index.js";
|
|
19
|
-
import { useApprovalRequestsTable as
|
|
20
|
-
import { useEffect as
|
|
21
|
-
import { Fragment as
|
|
21
|
+
import { useApprovalRequestsTable as v } from "./useApprovalRequestsTable.js";
|
|
22
|
+
import { useEffect as y, useMemo as b } from "react";
|
|
23
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
22
24
|
//#region ../../libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/ApprovalRequestsWidget.js
|
|
23
|
-
function
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
let
|
|
25
|
+
function w({ screenLabels: i, listLabels: d, rejectDialogLabels: w, messageLabels: T }) {
|
|
26
|
+
let E = r();
|
|
27
|
+
y(() => {
|
|
28
|
+
E(u.Mounted);
|
|
29
|
+
}, [E]);
|
|
30
|
+
let D = b(() => ({
|
|
31
|
+
...f,
|
|
29
32
|
...d,
|
|
30
|
-
...u,
|
|
31
33
|
status: {
|
|
32
|
-
...
|
|
33
|
-
...
|
|
34
|
+
...f.status,
|
|
35
|
+
...d?.status
|
|
34
36
|
},
|
|
35
37
|
filters: {
|
|
36
|
-
...
|
|
37
|
-
...
|
|
38
|
+
...f.filters,
|
|
39
|
+
...d?.filters
|
|
38
40
|
}
|
|
39
|
-
}), [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
}), [d]), { initResponse: O, widgetToken: k } = o(), A = l(), j = s(), M = c(), N = a(), { organizationStatus: P } = t(), F = b(() => m(M ? void 0 : O?.scopes), [M, O?.scopes]), I = !(!k || O || j) || A && !O || M, L = !!j && (!O || M), R = b(() => ({
|
|
42
|
+
...p,
|
|
43
|
+
...T
|
|
44
|
+
}), [T]), z = h({ messages: R }), B = v({
|
|
45
|
+
labels: D,
|
|
46
|
+
enabled: F.canRead,
|
|
47
|
+
pendingRequestIds: z.pendingRequestIds,
|
|
48
|
+
areDecisionsPaused: z.areDecisionsPaused
|
|
44
49
|
});
|
|
45
|
-
return /* @__PURE__ */ x
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
return /* @__PURE__ */ C(x, { children: [
|
|
51
|
+
/* @__PURE__ */ S(n, {}),
|
|
52
|
+
/* @__PURE__ */ S(g, {
|
|
53
|
+
rows: B.rows,
|
|
54
|
+
isLoading: B.isLoading || (I || e(P)) && B.rows.length === 0,
|
|
55
|
+
isError: L || B.isError,
|
|
56
|
+
isAccessRestricted: !I && !L && !F.canRead,
|
|
57
|
+
pageSize: B.pageSize,
|
|
58
|
+
onPageSizeChange: B.onPageSizeChange,
|
|
59
|
+
pageSizeOptions: B.pageSizeOptions,
|
|
60
|
+
hasNextPage: B.hasNextPage,
|
|
61
|
+
hasPrevPage: B.hasPrevPage,
|
|
62
|
+
onNextPage: B.onNextPage,
|
|
63
|
+
onPrevPage: B.onPrevPage,
|
|
64
|
+
emptyState: B.emptyState,
|
|
65
|
+
filters: B.filters,
|
|
66
|
+
onRetry: L ? N : B.onRetry,
|
|
67
|
+
onApprove: z.onApprove,
|
|
68
|
+
onReject: z.onReject,
|
|
69
|
+
labels: i
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ S(_, {
|
|
72
|
+
...z.rejectDialog,
|
|
73
|
+
labels: w
|
|
74
|
+
})
|
|
75
|
+
] });
|
|
67
76
|
}
|
|
68
|
-
function
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
...
|
|
71
|
-
widgetName:
|
|
72
|
-
children: /* @__PURE__ */
|
|
77
|
+
function T({ screenLabels: e, listLabels: t, rejectDialogLabels: n, messageLabels: r, ...a }) {
|
|
78
|
+
return /* @__PURE__ */ S(i, {
|
|
79
|
+
...a,
|
|
80
|
+
widgetName: d,
|
|
81
|
+
children: /* @__PURE__ */ S(w, {
|
|
73
82
|
screenLabels: e,
|
|
74
83
|
listLabels: t,
|
|
75
|
-
rejectDialogLabels: n
|
|
84
|
+
rejectDialogLabels: n,
|
|
85
|
+
messageLabels: r
|
|
76
86
|
})
|
|
77
87
|
});
|
|
78
88
|
}
|
|
79
89
|
//#endregion
|
|
80
|
-
export {
|
|
90
|
+
export { T as ApprovalRequestsWidget, T as default };
|
|
@@ -19,6 +19,11 @@ var e = {
|
|
|
19
19
|
moreSelected: (e, t) => `${e} + ${t} more`,
|
|
20
20
|
dateRange: (e, t) => `${e} - ${t}`
|
|
21
21
|
}
|
|
22
|
+
}, t = {
|
|
23
|
+
approved: "Request was approved",
|
|
24
|
+
rejected: "Request was rejected",
|
|
25
|
+
approveError: "Couldn't approve the request. Try again.",
|
|
26
|
+
rejectError: "Couldn't reject the request. Try again."
|
|
22
27
|
};
|
|
23
28
|
//#endregion
|
|
24
|
-
export { e as APPROVAL_REQUESTS_LIST_LABELS_EN };
|
|
29
|
+
export { e as APPROVAL_REQUESTS_LIST_LABELS_EN, t as APPROVAL_REQUESTS_MESSAGE_LABELS_EN };
|
|
@@ -2,75 +2,93 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { toast as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { extractApiErrorMessage as t } from "../../../../../shared/util/dist/lib/apiErrors.js";
|
|
7
|
+
import "../../../../../shared/util/dist/index.js";
|
|
8
|
+
import { isOrganizationOnItsWay as n } from "../../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
9
|
+
import { useEmbedApi as r } from "../../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
10
|
import "../../../../../shared/data-access/dist/index.js";
|
|
8
|
-
import
|
|
11
|
+
import "../../../../../shared/ui/dist/index.js";
|
|
12
|
+
import { useWidgetConfig as i, useWidgetInitStaleForToken as a } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
9
13
|
import "../../../../../shared/feature/dist/index.js";
|
|
10
|
-
import { useApproveApprovalRequestMutation as
|
|
11
|
-
import { useRejectApprovalRequestMutation as
|
|
14
|
+
import { useApproveApprovalRequestMutation as o } from "../../../../data-access/dist/index4.js";
|
|
15
|
+
import { useRejectApprovalRequestMutation as s } from "../../../../data-access/dist/index5.js";
|
|
12
16
|
import "../../../../data-access/dist/index.js";
|
|
13
|
-
import { useCallback as
|
|
17
|
+
import { useCallback as c, useState as l } from "react";
|
|
14
18
|
//#region ../../libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestDecisions.js
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
let { mutateAsync:
|
|
18
|
-
client:
|
|
19
|
-
organizationId:
|
|
20
|
-
userId:
|
|
19
|
+
var u = /* @__PURE__ */ new Set();
|
|
20
|
+
function d({ messages: d }) {
|
|
21
|
+
let { mutateAsync: f } = o(), { mutateAsync: p } = s(), [m, h] = l(u), [g, _] = l(), [v, y] = l(""), { client: b, organizationId: x, organizationStatus: S } = r(), C = a(), w = n(S) || C, T = i().initResponse?.userId, E = C ? void 0 : T, [D, O] = l({
|
|
22
|
+
client: b,
|
|
23
|
+
organizationId: x,
|
|
24
|
+
userId: E
|
|
21
25
|
});
|
|
22
|
-
(
|
|
23
|
-
client:
|
|
24
|
-
organizationId:
|
|
25
|
-
userId:
|
|
26
|
-
}),
|
|
27
|
-
let
|
|
28
|
-
|
|
26
|
+
(b !== D.client || x !== void 0 && x !== D.organizationId || E !== void 0 && E !== D.userId) && (O({
|
|
27
|
+
client: b,
|
|
28
|
+
organizationId: x === void 0 ? D.organizationId : x,
|
|
29
|
+
userId: E === void 0 ? D.userId : E
|
|
30
|
+
}), _(void 0));
|
|
31
|
+
let k = c(async (n, { decide: r, successMessage: i, errorFallback: a }) => {
|
|
32
|
+
h((e) => new Set(e).add(n));
|
|
29
33
|
try {
|
|
30
|
-
return await
|
|
31
|
-
} catch {
|
|
32
|
-
return !1;
|
|
34
|
+
return await r(), e.success(i), !0;
|
|
35
|
+
} catch (n) {
|
|
36
|
+
return e.error(t(n) ?? a), !1;
|
|
33
37
|
} finally {
|
|
34
|
-
|
|
35
|
-
let
|
|
36
|
-
return
|
|
38
|
+
h((e) => {
|
|
39
|
+
let t = new Set(e);
|
|
40
|
+
return t.delete(n), t;
|
|
37
41
|
});
|
|
38
42
|
}
|
|
39
|
-
}, []),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
p && !x && E(p, () => u({
|
|
45
|
-
approvalRequestId: p,
|
|
46
|
-
rejectReason: h
|
|
47
|
-
})).then((e) => {
|
|
48
|
-
e && m((e) => e === p ? void 0 : e);
|
|
43
|
+
}, []), A = c((e) => {
|
|
44
|
+
w || k(e, {
|
|
45
|
+
decide: () => f({ approvalRequestId: e }),
|
|
46
|
+
successMessage: d.approved,
|
|
47
|
+
errorFallback: d.approveError
|
|
49
48
|
});
|
|
50
49
|
}, [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
f,
|
|
51
|
+
w,
|
|
52
|
+
d,
|
|
53
|
+
k
|
|
54
|
+
]), j = c((e) => {
|
|
55
|
+
_(e), y("");
|
|
56
|
+
}, []), M = !!(g && m.has(g)), N = c(() => {
|
|
57
|
+
g && !w && k(g, {
|
|
58
|
+
decide: () => p({
|
|
59
|
+
approvalRequestId: g,
|
|
60
|
+
rejectReason: v
|
|
61
|
+
}),
|
|
62
|
+
successMessage: d.rejected,
|
|
63
|
+
errorFallback: d.rejectError
|
|
64
|
+
}).then((e) => {
|
|
65
|
+
e && _((e) => e === g ? void 0 : e);
|
|
66
|
+
});
|
|
67
|
+
}, [
|
|
68
|
+
w,
|
|
69
|
+
d,
|
|
54
70
|
p,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
k
|
|
58
|
-
|
|
71
|
+
v,
|
|
72
|
+
g,
|
|
73
|
+
k
|
|
74
|
+
]), P = c(() => {
|
|
75
|
+
M || _(void 0);
|
|
76
|
+
}, [M]);
|
|
59
77
|
return {
|
|
60
|
-
pendingRequestIds:
|
|
61
|
-
areDecisionsPaused:
|
|
62
|
-
onApprove:
|
|
63
|
-
onReject:
|
|
78
|
+
pendingRequestIds: m,
|
|
79
|
+
areDecisionsPaused: w,
|
|
80
|
+
onApprove: A,
|
|
81
|
+
onReject: j,
|
|
64
82
|
rejectDialog: {
|
|
65
|
-
open: !!
|
|
66
|
-
reason:
|
|
67
|
-
onReasonChange:
|
|
68
|
-
onConfirm:
|
|
69
|
-
onCancel:
|
|
70
|
-
isPending:
|
|
71
|
-
isConfirmDisabled:
|
|
83
|
+
open: !!g,
|
|
84
|
+
reason: v,
|
|
85
|
+
onReasonChange: y,
|
|
86
|
+
onConfirm: N,
|
|
87
|
+
onCancel: P,
|
|
88
|
+
isPending: M,
|
|
89
|
+
isConfirmDisabled: w
|
|
72
90
|
}
|
|
73
91
|
};
|
|
74
92
|
}
|
|
75
93
|
//#endregion
|
|
76
|
-
export {
|
|
94
|
+
export { d as useApprovalRequestDecisions };
|
|
@@ -49,6 +49,7 @@ var e = {
|
|
|
49
49
|
ExternalBankAccountReadOrg: "external_bank_account:read:org",
|
|
50
50
|
ExternalBankAccountSetVerificationOrg: "external_bank_account:set_verification:org",
|
|
51
51
|
ExternalBankAccountWriteOrg: "external_bank_account:write:org",
|
|
52
|
+
InstantPaymentLimitWriteOrg: "instant_payment_limit:write:org",
|
|
52
53
|
InvoiceReadOrg: "invoice:read:org",
|
|
53
54
|
InvoiceWriteOrg: "invoice:write:org",
|
|
54
55
|
MailboxReadOrg: "mailbox:read:org",
|
|
@@ -86,6 +87,8 @@ var e = {
|
|
|
86
87
|
RoleReadOrg: "role:read:org",
|
|
87
88
|
RoleWriteOrg: "role:write:org",
|
|
88
89
|
TransferWriteOrg: "transfer:write:org",
|
|
90
|
+
UnderwritingAccountRead: "underwriting:account:read",
|
|
91
|
+
UnderwritingAccountWrite: "underwriting:account:write",
|
|
89
92
|
UnderwritingApplicationApprovalEscalation: "underwriting:application:approval:escalation",
|
|
90
93
|
UnderwritingApplicationApprovalSecondary: "underwriting:application:approval:secondary",
|
|
91
94
|
UnderwritingApplicationRead: "underwriting:application:read",
|
package/dist/libs/tesouro-embedded-components-react/shared/data-access-mocks/dist/lib/fixtures.js
CHANGED
|
@@ -116,6 +116,15 @@ var e = "00000000-0000-4000-8000-000000000002", t = "00000000-0000-4000-8000-000
|
|
|
116
116
|
},
|
|
117
117
|
mccGroups: [],
|
|
118
118
|
velocityControls: [],
|
|
119
|
+
capabilities: {
|
|
120
|
+
activate: !0,
|
|
121
|
+
billingAddress: !0,
|
|
122
|
+
close: !0,
|
|
123
|
+
credentials: !0,
|
|
124
|
+
lock: !0,
|
|
125
|
+
merchantCategoryGroups: !0,
|
|
126
|
+
velocityControls: !0
|
|
127
|
+
},
|
|
119
128
|
createdAt: "2026-01-15T09:00:00.000Z",
|
|
120
129
|
updatedAt: "2026-02-01T09:00:00.000Z"
|
|
121
130
|
}, p = {
|
|
@@ -186,7 +195,8 @@ var e = "00000000-0000-4000-8000-000000000002", t = "00000000-0000-4000-8000-000
|
|
|
186
195
|
nickname: "Operating reserve",
|
|
187
196
|
routingNumber: "123456780",
|
|
188
197
|
type: "CHECKING",
|
|
189
|
-
verificationStatus: "VERIFIED"
|
|
198
|
+
verificationStatus: "VERIFIED",
|
|
199
|
+
createdAt: "2026-01-10T09:00:00.000Z"
|
|
190
200
|
}, S = {
|
|
191
201
|
id: "00000000-0000-4000-8000-000000000040",
|
|
192
202
|
amount: {
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.9.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.9.46", n = "6e258653288e9ff222a1a7a1b35dee390a5649b3", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|