@tesouro/embedded-components-react 0.2.267 → 0.2.269

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.
Files changed (62) hide show
  1. package/README.md +15 -12
  2. package/dist/experimental/WidgetSuite.d.ts +25 -1
  3. package/dist/experimental/index.d.ts +25 -1
  4. package/dist/index.d.ts +46 -22
  5. package/dist/lib/AcceptDisclosuresWidget.d.ts +25 -1
  6. package/dist/lib/BalancesWidget.d.ts +24 -0
  7. package/dist/lib/BankAccountOnboardingWidget.d.ts +25 -1
  8. package/dist/lib/BankAccountsWidget.d.ts +25 -1
  9. package/dist/lib/BillPayWidget.d.ts +24 -0
  10. package/dist/lib/CardDetailsWidget.d.ts +25 -1
  11. package/dist/lib/CardsWidget.d.ts +25 -1
  12. package/dist/lib/ChartOfAccountsWidget.d.ts +25 -1
  13. package/dist/lib/CounterpartsWidget.d.ts +25 -1
  14. package/dist/lib/CreateCardWidget.d.ts +25 -1
  15. package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +25 -1
  16. package/dist/lib/ExpenseManagementWidget.d.ts +25 -1
  17. package/dist/lib/ExpenseRequirementsWidget.d.ts +25 -1
  18. package/dist/lib/HelpWidget.d.ts +25 -1
  19. package/dist/lib/InsightsWidget.d.ts +24 -0
  20. package/dist/lib/InvoicingWidget.d.ts +25 -1
  21. package/dist/lib/LinkedAccountsWidget.d.ts +25 -1
  22. package/dist/lib/ProductsWidget.d.ts +25 -1
  23. package/dist/lib/ProfileWidget.d.ts +25 -1
  24. package/dist/lib/ReceiptMatchWidget.d.ts +25 -1
  25. package/dist/lib/ReceivablesWidget.d.ts +25 -1
  26. package/dist/lib/SettingsWidget.d.ts +25 -1
  27. package/dist/lib/TagsWidget.d.ts +25 -1
  28. package/dist/lib/TeamWidget.d.ts +25 -1
  29. package/dist/lib/TransfersWidget.d.ts +24 -0
  30. package/dist/lib/WidgetProvider.d.ts +25 -1
  31. package/dist/lib/WidgetProviderPublic.d.ts +24 -0
  32. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +9 -8
  33. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +122 -121
  34. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +9 -8
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +11 -10
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +9 -8
  37. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +9 -8
  38. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +9 -8
  39. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +9 -8
  40. package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +94 -93
  41. package/dist/libs/tesouro-embedded-components-react/expense-approval-policies-widget/feature/dist/lib/ExpenseApprovalPoliciesWidgetFeature.js +7 -6
  42. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +9 -8
  43. package/dist/libs/tesouro-embedded-components-react/expense-receipt-match-widget/feature/dist/lib/ReceiptMatchWidget.js +12 -11
  44. package/dist/libs/tesouro-embedded-components-react/expense-requirements-widget/feature/dist/lib/ExpenseRequirementsWidget.js +7 -6
  45. package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index8.js +9 -8
  46. package/dist/libs/tesouro-embedded-components-react/help-widget/feature/dist/index3.js +9 -8
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +9 -8
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +10 -9
  49. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +9 -8
  50. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +9 -8
  51. package/dist/libs/tesouro-embedded-components-react/profile-widget/feature/dist/index4.js +9 -8
  52. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +10 -9
  53. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +22 -21
  54. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/widgetGatewayHosts.js +14 -0
  55. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +76 -67
  56. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +107 -101
  57. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  58. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js +12 -4
  59. package/dist/libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js +9 -8
  60. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js +106 -105
  61. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +9 -8
  62. package/package.json +1 -1
@@ -566,6 +566,30 @@ interface WidgetConfigInput {
566
566
  * ```
567
567
  */
568
568
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
569
+ /**
570
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
571
+ *
572
+ * Any caller reaching the Tesouro API with a widget token must route data
573
+ * requests through the widget gateway: prefix the path with
574
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
575
+ * provider applies both automatically per request when the request origin is
576
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
577
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
578
+ * init round-trip) always pass through untouched.
579
+ *
580
+ * - `undefined` — decide from the request origin, as above. Inherits from
581
+ * the nearest ancestor or global store like every other config field.
582
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
583
+ * custom domain in front of the gateway).
584
+ * - `false` — never apply it. For hosts that route widget requests their own
585
+ * way, such as a same-origin BFF whose `configClient` retargets every
586
+ * request.
587
+ *
588
+ * Independent of {@link configClient}: a host that only adds a header keeps
589
+ * the built-in routing, and the built-in interceptor runs before any
590
+ * `configClient` interceptor.
591
+ */
592
+ gatewayRouting?: boolean;
569
593
  /**
570
594
  * Component the embedded widgets should render in place of plain `<a>` tags.
571
595
  *
@@ -1127,7 +1151,7 @@ interface CardsWidgetProps extends WidgetProviderProps {
1127
1151
  * inside `WidgetProvider`'s subtree, which is what the data-access hooks read
1128
1152
  * their client, org and token from.
1129
1153
  */
1130
- declare function CardsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CardsWidgetProps): React.JSX.Element;
1154
+ declare function CardsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CardsWidgetProps): React.JSX.Element;
1131
1155
 
1132
1156
  export { CardsWidget };
1133
1157
  export type { CardsFeatureLabels as CardsWidgetFeatureLabels, CardsListLabels as CardsWidgetLabels, CardsWidgetPagination, CardsWidgetProps };
@@ -724,6 +724,30 @@ interface WidgetConfigInput {
724
724
  * ```
725
725
  */
726
726
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
727
+ /**
728
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
729
+ *
730
+ * Any caller reaching the Tesouro API with a widget token must route data
731
+ * requests through the widget gateway: prefix the path with
732
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
733
+ * provider applies both automatically per request when the request origin is
734
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
735
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
736
+ * init round-trip) always pass through untouched.
737
+ *
738
+ * - `undefined` — decide from the request origin, as above. Inherits from
739
+ * the nearest ancestor or global store like every other config field.
740
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
741
+ * custom domain in front of the gateway).
742
+ * - `false` — never apply it. For hosts that route widget requests their own
743
+ * way, such as a same-origin BFF whose `configClient` retargets every
744
+ * request.
745
+ *
746
+ * Independent of {@link configClient}: a host that only adds a header keeps
747
+ * the built-in routing, and the built-in interceptor runs before any
748
+ * `configClient` interceptor.
749
+ */
750
+ gatewayRouting?: boolean;
727
751
  /**
728
752
  * Component the embedded widgets should render in place of plain `<a>` tags.
729
753
  *
@@ -895,7 +919,7 @@ type ChartOfAccountsWidgetProps = WidgetProviderProps & TableProps & ChartOfAcco
895
919
  * />
896
920
  * ```
897
921
  */
898
- declare function ChartOfAccountsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, analytics, errorFallback, onError, ...tableProps }: ChartOfAccountsWidgetProps): React.JSX.Element;
922
+ declare function ChartOfAccountsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, analytics, errorFallback, onError, ...tableProps }: ChartOfAccountsWidgetProps): React.JSX.Element;
899
923
 
900
924
  export { ACCOUNT_DELETE_DIALOG_LABELS_EN, ACCOUNT_FORM_SHEET_LABELS_EN, AccountDeleteDialog, AccountFormSheet, CHART_OF_ACCOUNTS_LABELS_EN, CHART_OF_ACCOUNTS_MESSAGE_LABELS_EN, ChartOfAccountsTable, ChartOfAccountsWidget };
901
925
  export type { AccountDeleteDialogLabels, AccountDeleteDialogProps, AccountFormErrors, AccountFormMode, AccountFormSheetLabels, AccountFormSheetProps, AccountFormValues, ChartOfAccountsLabels, ChartOfAccountsMessageLabels, ChartOfAccountsTableProps, ChartOfAccountsWidgetLabelProps, ChartOfAccountsWidgetProps, LedgerAccountRow };
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
477
477
  * ```
478
478
  */
479
479
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
480
+ /**
481
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
482
+ *
483
+ * Any caller reaching the Tesouro API with a widget token must route data
484
+ * requests through the widget gateway: prefix the path with
485
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
486
+ * provider applies both automatically per request when the request origin is
487
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
488
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
489
+ * init round-trip) always pass through untouched.
490
+ *
491
+ * - `undefined` — decide from the request origin, as above. Inherits from
492
+ * the nearest ancestor or global store like every other config field.
493
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
494
+ * custom domain in front of the gateway).
495
+ * - `false` — never apply it. For hosts that route widget requests their own
496
+ * way, such as a same-origin BFF whose `configClient` retargets every
497
+ * request.
498
+ *
499
+ * Independent of {@link configClient}: a host that only adds a header keeps
500
+ * the built-in routing, and the built-in interceptor runs before any
501
+ * `configClient` interceptor.
502
+ */
503
+ gatewayRouting?: boolean;
480
504
  /**
481
505
  * Component the embedded widgets should render in place of plain `<a>` tags.
482
506
  *
@@ -835,7 +859,7 @@ type CounterpartsWidgetProps = WidgetProviderProps & CounterpartsWidgetOwnProps;
835
859
  * />
836
860
  * ```
837
861
  */
838
- declare function CounterpartsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CounterpartsWidgetProps): React.JSX.Element;
862
+ declare function CounterpartsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CounterpartsWidgetProps): React.JSX.Element;
839
863
 
840
864
  export { CounterpartsWidget };
841
865
  export type { AddressFormSheetLabels, BankAccountFormSheetLabels, ConfirmDeleteDialogLabels, CounterpartDetailsSheetLabels, CounterpartFormSheetLabels, CounterpartMessageLabels, CounterpartMode, CounterpartsScreenLabels, CounterpartsWidgetProps };
@@ -539,6 +539,30 @@ interface WidgetConfigInput {
539
539
  * ```
540
540
  */
541
541
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
542
+ /**
543
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
544
+ *
545
+ * Any caller reaching the Tesouro API with a widget token must route data
546
+ * requests through the widget gateway: prefix the path with
547
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
548
+ * provider applies both automatically per request when the request origin is
549
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
550
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
551
+ * init round-trip) always pass through untouched.
552
+ *
553
+ * - `undefined` — decide from the request origin, as above. Inherits from
554
+ * the nearest ancestor or global store like every other config field.
555
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
556
+ * custom domain in front of the gateway).
557
+ * - `false` — never apply it. For hosts that route widget requests their own
558
+ * way, such as a same-origin BFF whose `configClient` retargets every
559
+ * request.
560
+ *
561
+ * Independent of {@link configClient}: a host that only adds a header keeps
562
+ * the built-in routing, and the built-in interceptor runs before any
563
+ * `configClient` interceptor.
564
+ */
565
+ gatewayRouting?: boolean;
542
566
  /**
543
567
  * Component the embedded widgets should render in place of plain `<a>` tags.
544
568
  *
@@ -673,7 +697,7 @@ type CreateCardWidgetProps = WidgetProviderProps & {
673
697
  * Self-contained Create Card widget. Issues a debit card via the Embed API and
674
698
  * drives setup → preparing → success with sonner toasts for the mutation.
675
699
  */
676
- declare function CreateCardWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CreateCardWidgetProps): React.JSX.Element;
700
+ declare function CreateCardWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: CreateCardWidgetProps): React.JSX.Element;
677
701
 
678
702
  /** Opaque UI format values — mapped to API `DebitCardType` in the feature. */
679
703
  declare const CardFormatValue: {
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
477
477
  * ```
478
478
  */
479
479
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
480
+ /**
481
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
482
+ *
483
+ * Any caller reaching the Tesouro API with a widget token must route data
484
+ * requests through the widget gateway: prefix the path with
485
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
486
+ * provider applies both automatically per request when the request origin is
487
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
488
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
489
+ * init round-trip) always pass through untouched.
490
+ *
491
+ * - `undefined` — decide from the request origin, as above. Inherits from
492
+ * the nearest ancestor or global store like every other config field.
493
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
494
+ * custom domain in front of the gateway).
495
+ * - `false` — never apply it. For hosts that route widget requests their own
496
+ * way, such as a same-origin BFF whose `configClient` retargets every
497
+ * request.
498
+ *
499
+ * Independent of {@link configClient}: a host that only adds a header keeps
500
+ * the built-in routing, and the built-in interceptor runs before any
501
+ * `configClient` interceptor.
502
+ */
503
+ gatewayRouting?: boolean;
480
504
  /**
481
505
  * Component the embedded widgets should render in place of plain `<a>` tags.
482
506
  *
@@ -572,7 +596,7 @@ type ExpenseApprovalPoliciesWidgetProps = WidgetProviderProps & {
572
596
  /** @deprecated Use `organizationId` instead */
573
597
  orgId?: string | null;
574
598
  };
575
- declare function ExpenseApprovalPoliciesWidget({ token, orgId, widgetToken, organizationId, baseUrl, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, }?: ExpenseApprovalPoliciesWidgetProps): React.JSX.Element;
599
+ declare function ExpenseApprovalPoliciesWidget({ token, orgId, widgetToken, organizationId, baseUrl, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, }?: ExpenseApprovalPoliciesWidgetProps): React.JSX.Element;
576
600
 
577
601
  export { ExpenseApprovalPoliciesWidget };
578
602
  export type { ExpenseApprovalPoliciesWidgetProps };
@@ -510,6 +510,30 @@ interface WidgetConfigInput {
510
510
  * ```
511
511
  */
512
512
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
513
+ /**
514
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
515
+ *
516
+ * Any caller reaching the Tesouro API with a widget token must route data
517
+ * requests through the widget gateway: prefix the path with
518
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
519
+ * provider applies both automatically per request when the request origin is
520
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
521
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
522
+ * init round-trip) always pass through untouched.
523
+ *
524
+ * - `undefined` — decide from the request origin, as above. Inherits from
525
+ * the nearest ancestor or global store like every other config field.
526
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
527
+ * custom domain in front of the gateway).
528
+ * - `false` — never apply it. For hosts that route widget requests their own
529
+ * way, such as a same-origin BFF whose `configClient` retargets every
530
+ * request.
531
+ *
532
+ * Independent of {@link configClient}: a host that only adds a header keeps
533
+ * the built-in routing, and the built-in interceptor runs before any
534
+ * `configClient` interceptor.
535
+ */
536
+ gatewayRouting?: boolean;
513
537
  /**
514
538
  * Component the embedded widgets should render in place of plain `<a>` tags.
515
539
  *
@@ -607,7 +631,7 @@ interface ExpenseManagementWidgetProps extends WidgetProviderProps {
607
631
  policiesContent?: ReactNode;
608
632
  requirementsContent?: ReactNode;
609
633
  }
610
- declare function ExpenseManagementWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ExpenseManagementWidgetProps): React.JSX.Element;
634
+ declare function ExpenseManagementWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ExpenseManagementWidgetProps): React.JSX.Element;
611
635
 
612
636
  export { ExpenseManagementWidget };
613
637
  export type { Labels as ExpenseManagementWidgetLabels, ExpenseManagementWidgetProps };
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
477
477
  * ```
478
478
  */
479
479
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
480
+ /**
481
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
482
+ *
483
+ * Any caller reaching the Tesouro API with a widget token must route data
484
+ * requests through the widget gateway: prefix the path with
485
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
486
+ * provider applies both automatically per request when the request origin is
487
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
488
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
489
+ * init round-trip) always pass through untouched.
490
+ *
491
+ * - `undefined` — decide from the request origin, as above. Inherits from
492
+ * the nearest ancestor or global store like every other config field.
493
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
494
+ * custom domain in front of the gateway).
495
+ * - `false` — never apply it. For hosts that route widget requests their own
496
+ * way, such as a same-origin BFF whose `configClient` retargets every
497
+ * request.
498
+ *
499
+ * Independent of {@link configClient}: a host that only adds a header keeps
500
+ * the built-in routing, and the built-in interceptor runs before any
501
+ * `configClient` interceptor.
502
+ */
503
+ gatewayRouting?: boolean;
480
504
  /**
481
505
  * Component the embedded widgets should render in place of plain `<a>` tags.
482
506
  *
@@ -572,7 +596,7 @@ type ExpenseRequirementsWidgetProps = WidgetProviderProps & {
572
596
  /** @deprecated Use `organizationId` instead */
573
597
  orgId?: string | null;
574
598
  };
575
- declare function ExpenseRequirementsWidget({ token, orgId, widgetToken, organizationId, baseUrl, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, }?: ExpenseRequirementsWidgetProps): React.JSX.Element;
599
+ declare function ExpenseRequirementsWidget({ token, orgId, widgetToken, organizationId, baseUrl, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, }?: ExpenseRequirementsWidgetProps): React.JSX.Element;
576
600
 
577
601
  export { ExpenseRequirementsWidget };
578
602
  export type { ExpenseRequirementsWidgetProps };
@@ -561,6 +561,30 @@ interface WidgetConfigInput {
561
561
  * ```
562
562
  */
563
563
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
564
+ /**
565
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
566
+ *
567
+ * Any caller reaching the Tesouro API with a widget token must route data
568
+ * requests through the widget gateway: prefix the path with
569
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
570
+ * provider applies both automatically per request when the request origin is
571
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
572
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
573
+ * init round-trip) always pass through untouched.
574
+ *
575
+ * - `undefined` — decide from the request origin, as above. Inherits from
576
+ * the nearest ancestor or global store like every other config field.
577
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
578
+ * custom domain in front of the gateway).
579
+ * - `false` — never apply it. For hosts that route widget requests their own
580
+ * way, such as a same-origin BFF whose `configClient` retargets every
581
+ * request.
582
+ *
583
+ * Independent of {@link configClient}: a host that only adds a header keeps
584
+ * the built-in routing, and the built-in interceptor runs before any
585
+ * `configClient` interceptor.
586
+ */
587
+ gatewayRouting?: boolean;
564
588
  /**
565
589
  * Component the embedded widgets should render in place of plain `<a>` tags.
566
590
  *
@@ -672,7 +696,7 @@ type HelpWidgetProps = WidgetProviderProps & HelpContentProps;
672
696
  * <HelpWidget bankName="Acme Bank" contactUrl="https://acme.example/support" />
673
697
  * ```
674
698
  */
675
- declare function HelpWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...contentProps }: HelpWidgetProps): React.JSX.Element;
699
+ declare function HelpWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...contentProps }: HelpWidgetProps): React.JSX.Element;
676
700
 
677
701
  export { HELP_FAQ_EN, HELP_WIDGET_LABELS_EN, HelpWidget };
678
702
  export type { HelpFaqAnswer, HelpFaqBullet, HelpFaqBulletType, HelpFaqItem, HelpFaqSection, HelpWidgetLabels, HelpWidgetProps };
@@ -513,6 +513,30 @@ interface WidgetConfigInput {
513
513
  * ```
514
514
  */
515
515
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
516
+ /**
517
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
518
+ *
519
+ * Any caller reaching the Tesouro API with a widget token must route data
520
+ * requests through the widget gateway: prefix the path with
521
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
522
+ * provider applies both automatically per request when the request origin is
523
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
524
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
525
+ * init round-trip) always pass through untouched.
526
+ *
527
+ * - `undefined` — decide from the request origin, as above. Inherits from
528
+ * the nearest ancestor or global store like every other config field.
529
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
530
+ * custom domain in front of the gateway).
531
+ * - `false` — never apply it. For hosts that route widget requests their own
532
+ * way, such as a same-origin BFF whose `configClient` retargets every
533
+ * request.
534
+ *
535
+ * Independent of {@link configClient}: a host that only adds a header keeps
536
+ * the built-in routing, and the built-in interceptor runs before any
537
+ * `configClient` interceptor.
538
+ */
539
+ gatewayRouting?: boolean;
516
540
  /**
517
541
  * Component the embedded widgets should render in place of plain `<a>` tags.
518
542
  *
@@ -507,6 +507,30 @@ interface WidgetConfigInput {
507
507
  * ```
508
508
  */
509
509
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
510
+ /**
511
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
512
+ *
513
+ * Any caller reaching the Tesouro API with a widget token must route data
514
+ * requests through the widget gateway: prefix the path with
515
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
516
+ * provider applies both automatically per request when the request origin is
517
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
518
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
519
+ * init round-trip) always pass through untouched.
520
+ *
521
+ * - `undefined` — decide from the request origin, as above. Inherits from
522
+ * the nearest ancestor or global store like every other config field.
523
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
524
+ * custom domain in front of the gateway).
525
+ * - `false` — never apply it. For hosts that route widget requests their own
526
+ * way, such as a same-origin BFF whose `configClient` retargets every
527
+ * request.
528
+ *
529
+ * Independent of {@link configClient}: a host that only adds a header keeps
530
+ * the built-in routing, and the built-in interceptor runs before any
531
+ * `configClient` interceptor.
532
+ */
533
+ gatewayRouting?: boolean;
510
534
  /**
511
535
  * Component the embedded widgets should render in place of plain `<a>` tags.
512
536
  *
@@ -601,7 +625,7 @@ type MoniteRegionProviderProps = WidgetProviderProps & MoniteWrapperProps;
601
625
  type ReceivablesWidgetMoniteProps = MoniteRegionProviderProps & Omit<ReceivablesProps, 'pageTitleComponent' | 'initialView' | 'initialCounterpartId'> & {
602
626
  pageTitleComponent?: ReceivablesProps['pageTitleComponent'];
603
627
  };
604
- declare function ReceivablesWidgetMonite({ baseUrl, widgetToken, organizationId, configClient, linkComponent, errorFallback, onError, finopsThemeColors, analytics, pageTitleComponent, uiFramework, ...receivablesProps }: ReceivablesWidgetMoniteProps): React.JSX.Element;
628
+ declare function ReceivablesWidgetMonite({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, errorFallback, onError, finopsThemeColors, analytics, pageTitleComponent, uiFramework, ...receivablesProps }: ReceivablesWidgetMoniteProps): React.JSX.Element;
605
629
 
606
630
  export { ReceivablesWidgetMonite as InvoicingWidget };
607
631
  export type { ReceivablesWidgetMoniteProps as InvoicingWidgetProps };
@@ -545,6 +545,30 @@ interface WidgetConfigInput {
545
545
  * ```
546
546
  */
547
547
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
548
+ /**
549
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
550
+ *
551
+ * Any caller reaching the Tesouro API with a widget token must route data
552
+ * requests through the widget gateway: prefix the path with
553
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
554
+ * provider applies both automatically per request when the request origin is
555
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
556
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
557
+ * init round-trip) always pass through untouched.
558
+ *
559
+ * - `undefined` — decide from the request origin, as above. Inherits from
560
+ * the nearest ancestor or global store like every other config field.
561
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
562
+ * custom domain in front of the gateway).
563
+ * - `false` — never apply it. For hosts that route widget requests their own
564
+ * way, such as a same-origin BFF whose `configClient` retargets every
565
+ * request.
566
+ *
567
+ * Independent of {@link configClient}: a host that only adds a header keeps
568
+ * the built-in routing, and the built-in interceptor runs before any
569
+ * `configClient` interceptor.
570
+ */
571
+ gatewayRouting?: boolean;
548
572
  /**
549
573
  * Component the embedded widgets should render in place of plain `<a>` tags.
550
574
  *
@@ -646,7 +670,7 @@ interface LinkedAccountsWidgetProps extends WidgetProviderProps {
646
670
  labels?: Partial<Labels>;
647
671
  featureLabels?: Partial<FeatureLabels>;
648
672
  }
649
- declare function LinkedAccountsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: LinkedAccountsWidgetProps): React.JSX.Element;
673
+ declare function LinkedAccountsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: LinkedAccountsWidgetProps): React.JSX.Element;
650
674
 
651
675
  export { LinkedAccountsWidget };
652
676
  export type { FeatureLabels as LinkedAccountsWidgetFeatureLabels, Labels as LinkedAccountsWidgetLabels, LinkedAccountsWidgetProps };
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
477
477
  * ```
478
478
  */
479
479
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
480
+ /**
481
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
482
+ *
483
+ * Any caller reaching the Tesouro API with a widget token must route data
484
+ * requests through the widget gateway: prefix the path with
485
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
486
+ * provider applies both automatically per request when the request origin is
487
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
488
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
489
+ * init round-trip) always pass through untouched.
490
+ *
491
+ * - `undefined` — decide from the request origin, as above. Inherits from
492
+ * the nearest ancestor or global store like every other config field.
493
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
494
+ * custom domain in front of the gateway).
495
+ * - `false` — never apply it. For hosts that route widget requests their own
496
+ * way, such as a same-origin BFF whose `configClient` retargets every
497
+ * request.
498
+ *
499
+ * Independent of {@link configClient}: a host that only adds a header keeps
500
+ * the built-in routing, and the built-in interceptor runs before any
501
+ * `configClient` interceptor.
502
+ */
503
+ gatewayRouting?: boolean;
480
504
  /**
481
505
  * Component the embedded widgets should render in place of plain `<a>` tags.
482
506
  *
@@ -749,7 +773,7 @@ type ProductsWidgetProps = WidgetProviderProps & ProductsWidgetOwnProps;
749
773
  * <ProductsWidget baseUrl="https://api.tesouro.com" widgetToken="wt_..." organizationId="org_..." />
750
774
  * ```
751
775
  */
752
- declare function ProductsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ProductsWidgetProps): React.JSX.Element;
776
+ declare function ProductsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ProductsWidgetProps): React.JSX.Element;
753
777
 
754
778
  export { ProductsWidget };
755
779
  export type { MeasureUnitDeleteDialogLabels, MeasureUnitsManagerLabels, ProductDeleteDialogLabels, ProductDetailsSheetLabels, ProductFormSheetLabels, ProductMessageLabels, ProductsScreenLabels, ProductsWidgetProps };
@@ -490,6 +490,30 @@ interface WidgetConfigInput {
490
490
  * ```
491
491
  */
492
492
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
493
+ /**
494
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
495
+ *
496
+ * Any caller reaching the Tesouro API with a widget token must route data
497
+ * requests through the widget gateway: prefix the path with
498
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
499
+ * provider applies both automatically per request when the request origin is
500
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
501
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
502
+ * init round-trip) always pass through untouched.
503
+ *
504
+ * - `undefined` — decide from the request origin, as above. Inherits from
505
+ * the nearest ancestor or global store like every other config field.
506
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
507
+ * custom domain in front of the gateway).
508
+ * - `false` — never apply it. For hosts that route widget requests their own
509
+ * way, such as a same-origin BFF whose `configClient` retargets every
510
+ * request.
511
+ *
512
+ * Independent of {@link configClient}: a host that only adds a header keeps
513
+ * the built-in routing, and the built-in interceptor runs before any
514
+ * `configClient` interceptor.
515
+ */
516
+ gatewayRouting?: boolean;
493
517
  /**
494
518
  * Component the embedded widgets should render in place of plain `<a>` tags.
495
519
  *
@@ -605,7 +629,7 @@ interface ProfileWidgetProps extends WidgetProviderProps {
605
629
  */
606
630
  contactUrl?: string;
607
631
  }
608
- declare function ProfileWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ProfileWidgetProps): React.JSX.Element;
632
+ declare function ProfileWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ProfileWidgetProps): React.JSX.Element;
609
633
 
610
634
  export { ProfileWidget };
611
635
  export type { FeatureLabels as ProfileWidgetFeatureLabels, Labels as ProfileWidgetLabels, ProfileWidgetProps };
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
477
477
  * ```
478
478
  */
479
479
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
480
+ /**
481
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
482
+ *
483
+ * Any caller reaching the Tesouro API with a widget token must route data
484
+ * requests through the widget gateway: prefix the path with
485
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
486
+ * provider applies both automatically per request when the request origin is
487
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
488
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
489
+ * init round-trip) always pass through untouched.
490
+ *
491
+ * - `undefined` — decide from the request origin, as above. Inherits from
492
+ * the nearest ancestor or global store like every other config field.
493
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
494
+ * custom domain in front of the gateway).
495
+ * - `false` — never apply it. For hosts that route widget requests their own
496
+ * way, such as a same-origin BFF whose `configClient` retargets every
497
+ * request.
498
+ *
499
+ * Independent of {@link configClient}: a host that only adds a header keeps
500
+ * the built-in routing, and the built-in interceptor runs before any
501
+ * `configClient` interceptor.
502
+ */
503
+ gatewayRouting?: boolean;
480
504
  /**
481
505
  * Component the embedded widgets should render in place of plain `<a>` tags.
482
506
  *
@@ -573,7 +597,7 @@ type ReceiptMatchWidgetProps = WidgetProviderProps & {
573
597
  targetTransactionId?: string;
574
598
  onSingleTransactionUpdate?: () => void;
575
599
  };
576
- declare function ReceiptMatchWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, isOpen, preSelectedReceiptIds, onClose, targetTransactionId, onSingleTransactionUpdate, }: ReceiptMatchWidgetProps): React.JSX.Element;
600
+ declare function ReceiptMatchWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, isOpen, preSelectedReceiptIds, onClose, targetTransactionId, onSingleTransactionUpdate, }: ReceiptMatchWidgetProps): React.JSX.Element;
577
601
 
578
602
  export { ReceiptMatchWidget };
579
603
  export type { ReceiptMatchWidgetProps };
@@ -484,6 +484,30 @@ interface WidgetConfigInput {
484
484
  * ```
485
485
  */
486
486
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
487
+ /**
488
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
489
+ *
490
+ * Any caller reaching the Tesouro API with a widget token must route data
491
+ * requests through the widget gateway: prefix the path with
492
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
493
+ * provider applies both automatically per request when the request origin is
494
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
495
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
496
+ * init round-trip) always pass through untouched.
497
+ *
498
+ * - `undefined` — decide from the request origin, as above. Inherits from
499
+ * the nearest ancestor or global store like every other config field.
500
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
501
+ * custom domain in front of the gateway).
502
+ * - `false` — never apply it. For hosts that route widget requests their own
503
+ * way, such as a same-origin BFF whose `configClient` retargets every
504
+ * request.
505
+ *
506
+ * Independent of {@link configClient}: a host that only adds a header keeps
507
+ * the built-in routing, and the built-in interceptor runs before any
508
+ * `configClient` interceptor.
509
+ */
510
+ gatewayRouting?: boolean;
487
511
  /**
488
512
  * Component the embedded widgets should render in place of plain `<a>` tags.
489
513
  *
@@ -979,7 +1003,7 @@ interface ReceivablesWidgetOwnProps {
979
1003
  }
980
1004
  type ReceivablesWidgetProps = WidgetProviderProps & ReceivablesWidgetOwnProps;
981
1005
 
982
- declare function ReceivablesWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ReceivablesWidgetProps): React.JSX.Element;
1006
+ declare function ReceivablesWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: ReceivablesWidgetProps): React.JSX.Element;
983
1007
 
984
1008
  export { ReceivablesWidget };
985
1009
  export type { CounterpartFormSheetLabels, CounterpartMessageLabels, MeasureUnitDeleteDialogLabels, MeasureUnitsManagerLabels, ProductFormSheetLabels, ProductMessageLabels, ReceivableActionDialogLabels, ReceivableDetailsSheetLabelOverrides, ReceivableDetailsSheetLabels, ReceivableDocumentType, ReceivableFormSheetLabels, ReceivableMessageLabels, ReceivablePaymentDialogLabels, ReceivableSendDialogLabels, ReceivableStatusBadgeLabels, ReceivablesScreenLabelOverrides, ReceivablesScreenLabels, ReceivablesWidgetProps, ReceivablesWidgetTab };
@@ -496,6 +496,30 @@ interface WidgetConfigInput {
496
496
  * ```
497
497
  */
498
498
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
499
+ /**
500
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
501
+ *
502
+ * Any caller reaching the Tesouro API with a widget token must route data
503
+ * requests through the widget gateway: prefix the path with
504
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
505
+ * provider applies both automatically per request when the request origin is
506
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
507
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
508
+ * init round-trip) always pass through untouched.
509
+ *
510
+ * - `undefined` — decide from the request origin, as above. Inherits from
511
+ * the nearest ancestor or global store like every other config field.
512
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
513
+ * custom domain in front of the gateway).
514
+ * - `false` — never apply it. For hosts that route widget requests their own
515
+ * way, such as a same-origin BFF whose `configClient` retargets every
516
+ * request.
517
+ *
518
+ * Independent of {@link configClient}: a host that only adds a header keeps
519
+ * the built-in routing, and the built-in interceptor runs before any
520
+ * `configClient` interceptor.
521
+ */
522
+ gatewayRouting?: boolean;
499
523
  /**
500
524
  * Component the embedded widgets should render in place of plain `<a>` tags.
501
525
  *
@@ -680,7 +704,7 @@ interface SettingsWidgetProps extends MoniteRegionProviderProps {
680
704
  tagsContent?: ReactNode;
681
705
  invoiceContent?: ReactNode;
682
706
  }
683
- declare function SettingsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, finopsThemeColors, analytics, ...innerProps }: SettingsWidgetProps): React.JSX.Element;
707
+ declare function SettingsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, finopsThemeColors, analytics, ...innerProps }: SettingsWidgetProps): React.JSX.Element;
684
708
 
685
709
  export { SettingsSection, SettingsWidget };
686
710
  export type { SettingsWidgetAdditionalSection, FeatureLabels as SettingsWidgetFeatureLabels, Labels as SettingsWidgetLabels, SettingsWidgetProps, SettingsWidgetSection, SettingsWidgetSectionId };