@tesouro/embedded-components-react 0.3.32 → 0.3.33
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 +11 -10
- package/dist/index.d.ts +38 -0
- package/dist/index.js +2 -2
- package/dist/lib/CardsWidget.d.ts +36 -0
- package/dist/lib/CreateCardWidget.d.ts +38 -0
- package/dist/lib/CreateCardWidget.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index3.js +9 -3
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index5.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index6.js +19 -12
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index7.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index4.js +35 -30
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index5.js +52 -10
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index6.js +12 -31
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +25 -248
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index8.js +389 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/CardControlRow.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/CardControls.js +13 -12
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/MerchantCategoriesControl.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +19 -18
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js +53 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +224 -206
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +174 -146
- 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
|
@@ -290,20 +290,21 @@ Read-only details for one credit **or** debit card — status, form factor, prog
|
|
|
290
290
|
|
|
291
291
|
Issues a new **debit** card for an enrolled team member: cardholder, format
|
|
292
292
|
(virtual / physical), funding bank account, and — for physical cards — a mailing
|
|
293
|
-
destination.
|
|
293
|
+
destination. Optional spend limit and per-transaction maximum are applied after
|
|
294
|
+
issuance. Loading, success, and error feedback use both full-screen views and
|
|
294
295
|
sonner toasts.
|
|
295
296
|
|
|
296
297
|
#### Props
|
|
297
298
|
|
|
298
|
-
| Prop | Type
|
|
299
|
-
| --------------- |
|
|
300
|
-
| `cardArtSrc` | `string`
|
|
301
|
-
| `labels` | `PartialDeep<CreateCardWidgetLabels>`
|
|
302
|
-
| `featureLabels` | toast / untitled-funding overrides
|
|
303
|
-
| `className` | `string`
|
|
304
|
-
| `onClose` | `() => void`
|
|
305
|
-
| `onCancel` | `() => void`
|
|
306
|
-
| `onViewCard` | `(cardId: string) => void`
|
|
299
|
+
| Prop | Type | Default | Description |
|
|
300
|
+
| --------------- | ---------------------------------------------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
301
|
+
| `cardArtSrc` | `string` | **Required** | Static card plastic image URL (no name overlays). |
|
|
302
|
+
| `labels` | `PartialDeep<CreateCardWidgetLabels>` | English labels | Overrides presentational copy (header, setup, mailing, card controls, preparing, success, footer). Nested groups merge per group. |
|
|
303
|
+
| `featureLabels` | toast / untitled-funding / velocity-control-name overrides | English labels | Overrides mutation toast strings (including spend-control and admin-access warnings), the funding-account fallback name, and API velocity-control `name`s. |
|
|
304
|
+
| `className` | `string` | — | Optional class on the presentational root. |
|
|
305
|
+
| `onClose` | `() => void` | — | Header close control. Omit and no close control is rendered. |
|
|
306
|
+
| `onCancel` | `() => void` | — | Called when Cancel is pressed (also invokes `onClose` when both are set). |
|
|
307
|
+
| `onViewCard` | `(cardId: string) => void` | — | Called with the new debit card id after a successful create when the user presses **View card**. |
|
|
307
308
|
|
|
308
309
|
### CounterpartsWidget
|
|
309
310
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2396,11 +2396,23 @@ interface CreateCardFeatureLabels {
|
|
|
2396
2396
|
creating: string;
|
|
2397
2397
|
success: string;
|
|
2398
2398
|
error: string;
|
|
2399
|
+
/**
|
|
2400
|
+
* Card issued but a follow-up velocity-control POST failed. The card
|
|
2401
|
+
* already exists; this must not read as a create failure.
|
|
2402
|
+
*/
|
|
2403
|
+
controlsWarning: string;
|
|
2399
2404
|
/**
|
|
2400
2405
|
* Card issued but granting company admins access to it failed. The card
|
|
2401
2406
|
* already exists; this must not read as a create failure.
|
|
2402
2407
|
*/
|
|
2403
2408
|
companyAdminAccessWarning: string;
|
|
2409
|
+
/**
|
|
2410
|
+
* Card issued, but BOTH the velocity-control POST(s) and the company-admin
|
|
2411
|
+
* access grant failed. Distinct from the two single-failure warnings above
|
|
2412
|
+
* so an issuer who hits both is told about both, not just whichever this
|
|
2413
|
+
* code checks first.
|
|
2414
|
+
*/
|
|
2415
|
+
controlsAndAccessWarning: string;
|
|
2404
2416
|
/**
|
|
2405
2417
|
* The roster of users to grant access to a new card failed to load.
|
|
2406
2418
|
* Shown with a retry action; Create stays disabled until it resolves so
|
|
@@ -2410,6 +2422,28 @@ interface CreateCardFeatureLabels {
|
|
|
2410
2422
|
retry: string;
|
|
2411
2423
|
};
|
|
2412
2424
|
untitledFundingAccount: string;
|
|
2425
|
+
/**
|
|
2426
|
+
* API-required `name` on a velocity control. Not shown in this widget;
|
|
2427
|
+
* may surface on a later controls list.
|
|
2428
|
+
*/
|
|
2429
|
+
velocityControlNames: {
|
|
2430
|
+
spendLimit: string;
|
|
2431
|
+
perTransactionMaximum: string;
|
|
2432
|
+
};
|
|
2433
|
+
/**
|
|
2434
|
+
* Spend-limit reset-period tab labels and notices. Owned here (not UI
|
|
2435
|
+
* labels) because the feature layer decides what each opaque period value
|
|
2436
|
+
* means.
|
|
2437
|
+
*/
|
|
2438
|
+
spendLimit: {
|
|
2439
|
+
periodOneTime: string;
|
|
2440
|
+
periodDaily: string;
|
|
2441
|
+
periodMonthly: string;
|
|
2442
|
+
oneTimeWarningTitle: string;
|
|
2443
|
+
oneTimeWarningDescription: string;
|
|
2444
|
+
dailyResetNotice: string;
|
|
2445
|
+
monthlyResetNotice: string;
|
|
2446
|
+
};
|
|
2413
2447
|
/**
|
|
2414
2448
|
* Success-screen copy chosen from the create response's `cardStatus`.
|
|
2415
2449
|
* Active/ready wording lives on the UI defaults; these cover statuses that
|
|
@@ -2426,6 +2460,8 @@ declare const CREATE_CARD_FEATURE_LABELS_EN: CreateCardFeatureLabels;
|
|
|
2426
2460
|
declare function resolveCreateCardFeatureLabels(overrides?: Partial<{
|
|
2427
2461
|
toast: Partial<CreateCardFeatureLabels['toast']>;
|
|
2428
2462
|
untitledFundingAccount: string;
|
|
2463
|
+
velocityControlNames: Partial<CreateCardFeatureLabels['velocityControlNames']>;
|
|
2464
|
+
spendLimit: Partial<CreateCardFeatureLabels['spendLimit']>;
|
|
2429
2465
|
success: Partial<CreateCardFeatureLabels['success']>;
|
|
2430
2466
|
}>): CreateCardFeatureLabels;
|
|
2431
2467
|
|
|
@@ -2436,6 +2472,8 @@ type CreateCardWidgetProps = WidgetProviderProps & {
|
|
|
2436
2472
|
featureLabels?: Partial<{
|
|
2437
2473
|
toast: Partial<CreateCardFeatureLabels['toast']>;
|
|
2438
2474
|
untitledFundingAccount: string;
|
|
2475
|
+
velocityControlNames: Partial<CreateCardFeatureLabels['velocityControlNames']>;
|
|
2476
|
+
spendLimit: Partial<CreateCardFeatureLabels['spendLimit']>;
|
|
2439
2477
|
success: Partial<CreateCardFeatureLabels['success']>;
|
|
2440
2478
|
}>;
|
|
2441
2479
|
className?: string;
|
package/dist/index.js
CHANGED
|
@@ -20,8 +20,8 @@ import { BillPayWidget as T } from "./libs/tesouro-embedded-components-react/bil
|
|
|
20
20
|
import "./lib/BillPayWidget.js";
|
|
21
21
|
import { CardDetailsWidget as E } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js";
|
|
22
22
|
import { CardFormatValue as D } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index3.js";
|
|
23
|
-
import { CREATE_CARD_FEATURE_LABELS_EN as O, resolveCreateCardFeatureLabels as k } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/
|
|
24
|
-
import { CreateCardWidget as A } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/
|
|
23
|
+
import { CREATE_CARD_FEATURE_LABELS_EN as O, resolveCreateCardFeatureLabels as k } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index5.js";
|
|
24
|
+
import { CreateCardWidget as A } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index8.js";
|
|
25
25
|
import { CardsWidget as j } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js";
|
|
26
26
|
import "./lib/CardsWidget.js";
|
|
27
27
|
import "./lib/CardDetailsWidget.js";
|
|
@@ -997,11 +997,23 @@ interface CreateCardFeatureLabels {
|
|
|
997
997
|
creating: string;
|
|
998
998
|
success: string;
|
|
999
999
|
error: string;
|
|
1000
|
+
/**
|
|
1001
|
+
* Card issued but a follow-up velocity-control POST failed. The card
|
|
1002
|
+
* already exists; this must not read as a create failure.
|
|
1003
|
+
*/
|
|
1004
|
+
controlsWarning: string;
|
|
1000
1005
|
/**
|
|
1001
1006
|
* Card issued but granting company admins access to it failed. The card
|
|
1002
1007
|
* already exists; this must not read as a create failure.
|
|
1003
1008
|
*/
|
|
1004
1009
|
companyAdminAccessWarning: string;
|
|
1010
|
+
/**
|
|
1011
|
+
* Card issued, but BOTH the velocity-control POST(s) and the company-admin
|
|
1012
|
+
* access grant failed. Distinct from the two single-failure warnings above
|
|
1013
|
+
* so an issuer who hits both is told about both, not just whichever this
|
|
1014
|
+
* code checks first.
|
|
1015
|
+
*/
|
|
1016
|
+
controlsAndAccessWarning: string;
|
|
1005
1017
|
/**
|
|
1006
1018
|
* The roster of users to grant access to a new card failed to load.
|
|
1007
1019
|
* Shown with a retry action; Create stays disabled until it resolves so
|
|
@@ -1011,6 +1023,28 @@ interface CreateCardFeatureLabels {
|
|
|
1011
1023
|
retry: string;
|
|
1012
1024
|
};
|
|
1013
1025
|
untitledFundingAccount: string;
|
|
1026
|
+
/**
|
|
1027
|
+
* API-required `name` on a velocity control. Not shown in this widget;
|
|
1028
|
+
* may surface on a later controls list.
|
|
1029
|
+
*/
|
|
1030
|
+
velocityControlNames: {
|
|
1031
|
+
spendLimit: string;
|
|
1032
|
+
perTransactionMaximum: string;
|
|
1033
|
+
};
|
|
1034
|
+
/**
|
|
1035
|
+
* Spend-limit reset-period tab labels and notices. Owned here (not UI
|
|
1036
|
+
* labels) because the feature layer decides what each opaque period value
|
|
1037
|
+
* means.
|
|
1038
|
+
*/
|
|
1039
|
+
spendLimit: {
|
|
1040
|
+
periodOneTime: string;
|
|
1041
|
+
periodDaily: string;
|
|
1042
|
+
periodMonthly: string;
|
|
1043
|
+
oneTimeWarningTitle: string;
|
|
1044
|
+
oneTimeWarningDescription: string;
|
|
1045
|
+
dailyResetNotice: string;
|
|
1046
|
+
monthlyResetNotice: string;
|
|
1047
|
+
};
|
|
1014
1048
|
/**
|
|
1015
1049
|
* Success-screen copy chosen from the create response's `cardStatus`.
|
|
1016
1050
|
* Active/ready wording lives on the UI defaults; these cover statuses that
|
|
@@ -1031,6 +1065,8 @@ type CreateCardWidgetProps = WidgetProviderProps & {
|
|
|
1031
1065
|
featureLabels?: Partial<{
|
|
1032
1066
|
toast: Partial<CreateCardFeatureLabels['toast']>;
|
|
1033
1067
|
untitledFundingAccount: string;
|
|
1068
|
+
velocityControlNames: Partial<CreateCardFeatureLabels['velocityControlNames']>;
|
|
1069
|
+
spendLimit: Partial<CreateCardFeatureLabels['spendLimit']>;
|
|
1034
1070
|
success: Partial<CreateCardFeatureLabels['success']>;
|
|
1035
1071
|
}>;
|
|
1036
1072
|
className?: string;
|
|
@@ -720,11 +720,23 @@ interface CreateCardFeatureLabels {
|
|
|
720
720
|
creating: string;
|
|
721
721
|
success: string;
|
|
722
722
|
error: string;
|
|
723
|
+
/**
|
|
724
|
+
* Card issued but a follow-up velocity-control POST failed. The card
|
|
725
|
+
* already exists; this must not read as a create failure.
|
|
726
|
+
*/
|
|
727
|
+
controlsWarning: string;
|
|
723
728
|
/**
|
|
724
729
|
* Card issued but granting company admins access to it failed. The card
|
|
725
730
|
* already exists; this must not read as a create failure.
|
|
726
731
|
*/
|
|
727
732
|
companyAdminAccessWarning: string;
|
|
733
|
+
/**
|
|
734
|
+
* Card issued, but BOTH the velocity-control POST(s) and the company-admin
|
|
735
|
+
* access grant failed. Distinct from the two single-failure warnings above
|
|
736
|
+
* so an issuer who hits both is told about both, not just whichever this
|
|
737
|
+
* code checks first.
|
|
738
|
+
*/
|
|
739
|
+
controlsAndAccessWarning: string;
|
|
728
740
|
/**
|
|
729
741
|
* The roster of users to grant access to a new card failed to load.
|
|
730
742
|
* Shown with a retry action; Create stays disabled until it resolves so
|
|
@@ -734,6 +746,28 @@ interface CreateCardFeatureLabels {
|
|
|
734
746
|
retry: string;
|
|
735
747
|
};
|
|
736
748
|
untitledFundingAccount: string;
|
|
749
|
+
/**
|
|
750
|
+
* API-required `name` on a velocity control. Not shown in this widget;
|
|
751
|
+
* may surface on a later controls list.
|
|
752
|
+
*/
|
|
753
|
+
velocityControlNames: {
|
|
754
|
+
spendLimit: string;
|
|
755
|
+
perTransactionMaximum: string;
|
|
756
|
+
};
|
|
757
|
+
/**
|
|
758
|
+
* Spend-limit reset-period tab labels and notices. Owned here (not UI
|
|
759
|
+
* labels) because the feature layer decides what each opaque period value
|
|
760
|
+
* means.
|
|
761
|
+
*/
|
|
762
|
+
spendLimit: {
|
|
763
|
+
periodOneTime: string;
|
|
764
|
+
periodDaily: string;
|
|
765
|
+
periodMonthly: string;
|
|
766
|
+
oneTimeWarningTitle: string;
|
|
767
|
+
oneTimeWarningDescription: string;
|
|
768
|
+
dailyResetNotice: string;
|
|
769
|
+
monthlyResetNotice: string;
|
|
770
|
+
};
|
|
737
771
|
/**
|
|
738
772
|
* Success-screen copy chosen from the create response's `cardStatus`.
|
|
739
773
|
* Active/ready wording lives on the UI defaults; these cover statuses that
|
|
@@ -750,6 +784,8 @@ declare const CREATE_CARD_FEATURE_LABELS_EN: CreateCardFeatureLabels;
|
|
|
750
784
|
declare function resolveCreateCardFeatureLabels(overrides?: Partial<{
|
|
751
785
|
toast: Partial<CreateCardFeatureLabels['toast']>;
|
|
752
786
|
untitledFundingAccount: string;
|
|
787
|
+
velocityControlNames: Partial<CreateCardFeatureLabels['velocityControlNames']>;
|
|
788
|
+
spendLimit: Partial<CreateCardFeatureLabels['spendLimit']>;
|
|
753
789
|
success: Partial<CreateCardFeatureLabels['success']>;
|
|
754
790
|
}>): CreateCardFeatureLabels;
|
|
755
791
|
|
|
@@ -760,6 +796,8 @@ type CreateCardWidgetProps = WidgetProviderProps & {
|
|
|
760
796
|
featureLabels?: Partial<{
|
|
761
797
|
toast: Partial<CreateCardFeatureLabels['toast']>;
|
|
762
798
|
untitledFundingAccount: string;
|
|
799
|
+
velocityControlNames: Partial<CreateCardFeatureLabels['velocityControlNames']>;
|
|
800
|
+
spendLimit: Partial<CreateCardFeatureLabels['spendLimit']>;
|
|
763
801
|
success: Partial<CreateCardFeatureLabels['success']>;
|
|
764
802
|
}>;
|
|
765
803
|
className?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CardFormatValue as e } from "../libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index3.js";
|
|
2
|
-
import { CREATE_CARD_FEATURE_LABELS_EN as t, resolveCreateCardFeatureLabels as n } from "../libs/tesouro-embedded-components-react/create-card-widget/feature/dist/
|
|
3
|
-
import { CreateCardWidget as r } from "../libs/tesouro-embedded-components-react/create-card-widget/feature/dist/
|
|
2
|
+
import { CREATE_CARD_FEATURE_LABELS_EN as t, resolveCreateCardFeatureLabels as n } from "../libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index5.js";
|
|
3
|
+
import { CreateCardWidget as r } from "../libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index8.js";
|
|
4
4
|
import "../libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index.js";
|
|
5
5
|
export { t as CREATE_CARD_FEATURE_LABELS_EN, e as CardFormatValue, r as CreateCardWidget, n as resolveCreateCardFeatureLabels };
|
|
@@ -13,7 +13,7 @@ import "../../ui/dist/index.js";
|
|
|
13
13
|
import { useCardsWidget as o } from "./index8.js";
|
|
14
14
|
import { CardDetailsWidget as s } from "../../../card-details-widget/feature/dist/index6.js";
|
|
15
15
|
import "../../../card-details-widget/feature/dist/index.js";
|
|
16
|
-
import { CreateCardWidget as c } from "../../../create-card-widget/feature/dist/
|
|
16
|
+
import { CreateCardWidget as c } from "../../../create-card-widget/feature/dist/index8.js";
|
|
17
17
|
import "../../../create-card-widget/feature/dist/index.js";
|
|
18
18
|
import { useCallback as l, useMemo as u, useState as d } from "react";
|
|
19
19
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useCreateCard as e } from "./index2.js";
|
|
2
2
|
import "./index3.js";
|
|
3
3
|
import { useCreateDebitCardMutation as t } from "./index4.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
4
|
+
import { useCreateVelocityControlMutation as n } from "./index5.js";
|
|
5
|
+
import { useManageDebitCardAccessMutation as r } from "./index6.js";
|
|
6
|
+
import { useCreateCardOrganizationQuery as i } from "./index7.js";
|
|
7
|
+
export { e as useCreateCard, i as useCreateCardOrganizationQuery, t as useCreateDebitCardMutation, n as useCreateVelocityControlMutation, r as useManageDebitCardAccessMutation };
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index3.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { organizationHeaders as e } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
2
|
-
import { getDebitCardsQueryKey as t } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
2
|
+
import { getDebitCardsQueryKey as t, getVelocityControlsQueryKey as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
3
3
|
import "../../../shared/data-access/dist/index.js";
|
|
4
4
|
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index3.js
|
|
5
|
-
function
|
|
5
|
+
function r({ client: n, organizationId: r }) {
|
|
6
6
|
return t({
|
|
7
7
|
client: n,
|
|
8
8
|
headers: e(r)
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
+
function i({ client: t, organizationId: r }) {
|
|
12
|
+
return n({
|
|
13
|
+
client: t,
|
|
14
|
+
headers: e(r)
|
|
15
|
+
});
|
|
16
|
+
}
|
|
11
17
|
//#endregion
|
|
12
|
-
export {
|
|
18
|
+
export { r as debitCardsInvalidationKey, i as velocityControlsInvalidationKey };
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index5.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
import { invalidateAllClients as e } from "../../../shared/data-access/dist/lib/clientRegistry.js";
|
|
6
6
|
import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
7
|
import { organizationHeaders as n } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
8
|
-
import {
|
|
8
|
+
import { createVelocityControlMutation as r } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
9
9
|
import "../../../shared/data-access/dist/index.js";
|
|
10
|
-
import {
|
|
10
|
+
import { velocityControlsInvalidationKey as i } from "./index3.js";
|
|
11
11
|
import { useMutation as a } from "@tanstack/react-query";
|
|
12
12
|
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index5.js
|
|
13
13
|
function o() {
|
|
@@ -26,4 +26,4 @@ function o() {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
|
-
export { o as
|
|
29
|
+
export { o as useCreateVelocityControlMutation };
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index6.js
CHANGED
|
@@ -2,21 +2,28 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { invalidateAllClients as e } from "../../../shared/data-access/dist/lib/clientRegistry.js";
|
|
6
|
+
import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
|
+
import { organizationHeaders as n } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
8
|
+
import { manageDebitCardAccessMutation as r } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
8
9
|
import "../../../shared/data-access/dist/index.js";
|
|
9
|
-
import {
|
|
10
|
+
import { debitCardsInvalidationKey as i } from "./index3.js";
|
|
11
|
+
import { useMutation as a } from "@tanstack/react-query";
|
|
10
12
|
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index6.js
|
|
11
|
-
function
|
|
12
|
-
let { client:
|
|
13
|
-
client:
|
|
14
|
-
|
|
13
|
+
function o() {
|
|
14
|
+
let { client: o, organizationId: s } = t(), c = n(s), l = r({
|
|
15
|
+
client: o,
|
|
16
|
+
headers: c
|
|
15
17
|
});
|
|
16
|
-
return
|
|
17
|
-
...
|
|
18
|
-
|
|
18
|
+
return a({
|
|
19
|
+
...l,
|
|
20
|
+
onSuccess: async (...t) => {
|
|
21
|
+
await e(i({
|
|
22
|
+
client: o,
|
|
23
|
+
organizationId: s
|
|
24
|
+
})), await l.onSuccess?.(...t);
|
|
25
|
+
}
|
|
19
26
|
});
|
|
20
27
|
}
|
|
21
28
|
//#endregion
|
|
22
|
-
export {
|
|
29
|
+
export { o as useManageDebitCardAccessMutation };
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index7.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
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 { getOrganizationOptions as t } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
7
|
+
import { withAuthEpoch as n } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
8
|
+
import "../../../shared/data-access/dist/index.js";
|
|
9
|
+
import { useQuery as r } from "@tanstack/react-query";
|
|
10
|
+
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index7.js
|
|
11
|
+
function i({ enabled: i } = {}) {
|
|
12
|
+
let { client: a, organizationId: o, widgetToken: s, authEpoch: c } = e(), l = t({
|
|
13
|
+
client: a,
|
|
14
|
+
path: { organizationId: o ?? "" }
|
|
15
|
+
});
|
|
16
|
+
return r({
|
|
17
|
+
...n(l, c),
|
|
18
|
+
enabled: !!(o && s) && (i === !0 || i === void 0)
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { i as useCreateCardOrganizationQuery };
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CardFormatValue as e } from "./index3.js";
|
|
2
|
-
import { CREATE_CARD_FEATURE_LABELS_EN as t, resolveCreateCardFeatureLabels as n } from "./
|
|
3
|
-
import { CreateCardWidget as r } from "./
|
|
2
|
+
import { CREATE_CARD_FEATURE_LABELS_EN as t, resolveCreateCardFeatureLabels as n } from "./index5.js";
|
|
3
|
+
import { CreateCardWidget as r } from "./index8.js";
|
|
4
4
|
export { t as CREATE_CARD_FEATURE_LABELS_EN, e as CardFormatValue, r as CreateCardWidget, n as resolveCreateCardFeatureLabels };
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index4.js
CHANGED
|
@@ -1,34 +1,39 @@
|
|
|
1
|
+
import { parseDecimalAmountToMinorUnits as e } from "../../../shared/util/dist/lib/parseDecimalAmountToMinorUnits.js";
|
|
1
2
|
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index4.js
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
3
|
+
var t = {
|
|
4
|
+
OneTime: "LIFETIME",
|
|
5
|
+
Daily: "DAY",
|
|
6
|
+
Monthly: "MONTH"
|
|
7
|
+
}, n = new Set(Object.values(t));
|
|
8
|
+
function r(e) {
|
|
9
|
+
return e !== null && n.has(e);
|
|
10
|
+
}
|
|
11
|
+
function i(t) {
|
|
12
|
+
return e(t, "USD");
|
|
13
|
+
}
|
|
14
|
+
function a({ cardId: e, amount: t, period: n, id: a, name: o }) {
|
|
15
|
+
let s = i(t);
|
|
16
|
+
if (!(!s || !r(n))) return {
|
|
17
|
+
id: a,
|
|
18
|
+
name: o,
|
|
19
|
+
amountLimit: s,
|
|
20
|
+
currencyCode: "USD",
|
|
21
|
+
velocityWindow: n,
|
|
22
|
+
cardId: e,
|
|
23
|
+
active: !0
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function o({ cardId: e, amount: t, id: n, name: r }) {
|
|
27
|
+
let a = i(t);
|
|
28
|
+
if (a) return {
|
|
29
|
+
id: n,
|
|
30
|
+
name: r,
|
|
31
|
+
amountLimit: a,
|
|
32
|
+
currencyCode: "USD",
|
|
33
|
+
velocityWindow: "TRANSACTION",
|
|
34
|
+
cardId: e,
|
|
35
|
+
active: !0
|
|
31
36
|
};
|
|
32
37
|
}
|
|
33
38
|
//#endregion
|
|
34
|
-
export {
|
|
39
|
+
export { t as SpendLimitPeriodValue, o as buildPerTransactionMaximumVelocityControlRequest, a as buildSpendLimitVelocityControlRequest, r as isSpendLimitPeriod, i as parseControlAmountToMinorUnits };
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index5.js
CHANGED
|
@@ -1,15 +1,57 @@
|
|
|
1
|
-
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
2
|
-
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
3
|
-
import "../../../shared/data-access/dist/index.js";
|
|
4
1
|
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index5.js
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var e = {
|
|
3
|
+
toast: {
|
|
4
|
+
creating: "Creating your card…",
|
|
5
|
+
success: "Card created successfully.",
|
|
6
|
+
error: "We could not create this card. Please try again.",
|
|
7
|
+
controlsWarning: "Card created, but spend controls could not be applied.",
|
|
8
|
+
companyAdminAccessWarning: "Card created, but some admins could not be granted access to it.",
|
|
9
|
+
controlsAndAccessWarning: "Card created, but spend controls could not be applied and some admins could not be granted access to it.",
|
|
10
|
+
debitCardIssuersError: "We could not load the list of admins to grant access to this card.",
|
|
11
|
+
retry: "Retry"
|
|
12
|
+
},
|
|
13
|
+
untitledFundingAccount: "Bank account",
|
|
14
|
+
velocityControlNames: {
|
|
15
|
+
spendLimit: "Spend limit",
|
|
16
|
+
perTransactionMaximum: "Per-transaction maximum"
|
|
17
|
+
},
|
|
18
|
+
spendLimit: {
|
|
19
|
+
periodOneTime: "One-time",
|
|
20
|
+
periodDaily: "Daily",
|
|
21
|
+
periodMonthly: "Monthly",
|
|
22
|
+
oneTimeWarningTitle: "Single-use behavior:",
|
|
23
|
+
oneTimeWarningDescription: "once total spend reaches the limit, this card locks automatically and declines all future purchases. Refunds can still be credited to a locked card.",
|
|
24
|
+
dailyResetNotice: "Spend accumulates toward the limit and resets every day at 12:00 AM ET.",
|
|
25
|
+
monthlyResetNotice: "Spend accumulates toward the limit and resets on the 1st of each month at 12:00 AM ET."
|
|
26
|
+
},
|
|
27
|
+
success: {
|
|
28
|
+
pendingActivationTitle: "Card created",
|
|
29
|
+
pendingActivationDescription: "Your card needs to be activated before it can be used.",
|
|
30
|
+
createdTitle: "Card created",
|
|
31
|
+
createdDescription: "Your card has been created."
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function t(t) {
|
|
7
35
|
return {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
36
|
+
...e,
|
|
37
|
+
...t,
|
|
38
|
+
toast: {
|
|
39
|
+
...e.toast,
|
|
40
|
+
...t?.toast
|
|
41
|
+
},
|
|
42
|
+
velocityControlNames: {
|
|
43
|
+
...e.velocityControlNames,
|
|
44
|
+
...t?.velocityControlNames
|
|
45
|
+
},
|
|
46
|
+
spendLimit: {
|
|
47
|
+
...e.spendLimit,
|
|
48
|
+
...t?.spendLimit
|
|
49
|
+
},
|
|
50
|
+
success: {
|
|
51
|
+
...e.success,
|
|
52
|
+
...t?.success
|
|
53
|
+
}
|
|
12
54
|
};
|
|
13
55
|
}
|
|
14
56
|
//#endregion
|
|
15
|
-
export {
|
|
57
|
+
export { e as CREATE_CARD_FEATURE_LABELS_EN, t as resolveCreateCardFeatureLabels };
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index6.js
CHANGED
|
@@ -1,37 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { Scope as e } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
6
|
-
import { useAllOrganizationUsersQuery as t } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
1
|
+
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
2
|
+
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
7
3
|
import "../../../shared/data-access/dist/index.js";
|
|
8
|
-
import { useCallback as n, useMemo as r } from "react";
|
|
9
4
|
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index6.js
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
return t && n ? `${t} (${n})` : t || n || e.id;
|
|
14
|
-
}
|
|
15
|
-
function o({ enabled: e = !0 } = {}) {
|
|
16
|
-
let o = t({
|
|
17
|
-
enabled: e,
|
|
18
|
-
permissions: [i]
|
|
19
|
-
}), s = o.data?.data, c = r(() => !e || o.isResolving ? [] : [...s ?? []].sort((e, t) => e.name.localeCompare(t.name)).map((e) => ({
|
|
20
|
-
value: e.id,
|
|
21
|
-
label: a(e)
|
|
22
|
-
})), [
|
|
23
|
-
e,
|
|
24
|
-
s,
|
|
25
|
-
o.isResolving
|
|
26
|
-
]), l = o.refetch, u = n(() => {
|
|
27
|
-
l();
|
|
28
|
-
}, [l]);
|
|
5
|
+
var n = "authorization_control:write:org";
|
|
6
|
+
function r(r) {
|
|
7
|
+
let i = new Set(r ?? []);
|
|
29
8
|
return {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
9
|
+
canIssue: e(i, [t.DebitCardIssueOrg]),
|
|
10
|
+
canReadUsers: e(i, [t.UserReadOrg]),
|
|
11
|
+
canReadFundingAccounts: e(i, [t.BankAccountReadOrg]),
|
|
12
|
+
canReadOrganization: e(i, [t.OrganizationReadOrg]),
|
|
13
|
+
canWriteAuthorizationControls: e(i, [n]),
|
|
14
|
+
canReadMerchantCategoryGroups: e(i, [t.AuthorizationControlReadOrg])
|
|
34
15
|
};
|
|
35
16
|
}
|
|
36
17
|
//#endregion
|
|
37
|
-
export {
|
|
18
|
+
export { n as AUTHORIZATION_CONTROL_WRITE_ORG, r as getCreateCardPermissions };
|