@tesouro/embedded-components-react 0.5.2 → 0.5.4

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 (113) hide show
  1. package/README.md +15 -2
  2. package/dist/index.d.ts +120 -100
  3. package/dist/index.js +7 -4
  4. package/dist/lib/BankAccountOnboardingWidget.d.ts +214 -246
  5. package/dist/lib/BillPayWidget.js +1 -1
  6. package/dist/lib/MarketingWidget.d.ts +684 -0
  7. package/dist/lib/MarketingWidget.js +4 -0
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index.js +9 -8
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +0 -2
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +183 -205
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +1 -4
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +13 -13
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +70 -5
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +37 -64
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +110 -38
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +73 -104
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +7 -87
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +21 -7
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +22 -17
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +63 -23
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +2 -66
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +81 -2
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +3 -78
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +5 -4
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +4 -5
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +32 -3
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +39 -30
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +166 -37
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +39 -164
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +1 -48
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +50 -1
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +11 -45
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +8 -13
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +14 -8
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +59 -7
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +8 -64
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +24 -8
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +139 -18
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +16 -139
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +4 -24
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +41 -4
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +14 -39
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +8 -16
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +91 -8
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +86 -80
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +3 -97
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +49 -3
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +135 -47
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +33 -135
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +186 -33
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +75 -186
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +21 -75
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +25 -14
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +232 -22
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +210 -223
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +103 -202
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +13 -121
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +47 -12
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +31 -47
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +198 -27
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +31 -198
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +234 -31
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +19 -240
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +24 -25
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +427 -19
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +4 -433
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +38 -4
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +220 -35
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +3 -224
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +4 -3
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +44 -2
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +1 -46
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -1
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +10 -6
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +57 -21
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +110 -10
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +3 -112
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +127 -3
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +8 -124
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +7 -8
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +46 -8
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +18 -43
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +28 -20
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +82 -27
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +47 -83
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +5 -58
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +250 -47
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +101 -239
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +202 -107
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +3 -209
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +8 -4
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +113 -6
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +1 -115
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +24 -0
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +4 -5
  96. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +3 -0
  97. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index2.js +8 -0
  98. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index26.js → marketing-widget/feature/dist/index3.js} +1 -1
  99. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js +81 -0
  100. package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index.js +4 -0
  101. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index24.js → marketing-widget/ui/dist/index2.js} +1 -1
  102. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index25.js → marketing-widget/ui/dist/index3.js} +1 -1
  103. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index27.js → marketing-widget/ui/dist/index4.js} +36 -37
  104. package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index5.js +75 -0
  105. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +24 -22
  106. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/data-access/dist/index9.js → shared/data-access/dist/lib/onboardingSuppressionReason.js} +1 -1
  107. package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/data-access/dist/index10.js → shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js} +5 -6
  108. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js +1 -0
  109. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  110. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  111. package/package.json +1 -1
  112. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +0 -75
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +0 -25
@@ -0,0 +1,684 @@
1
+ import * as React from 'react';
2
+ import { ComponentType, AnchorHTMLAttributes, ReactNode, ErrorInfo } from 'react';
3
+ import { PartialDeep } from 'type-fest';
4
+ import { FallbackProps } from 'react-error-boundary';
5
+
6
+ interface MarketingWidgetLabels {
7
+ learnMore: string;
8
+ primaryCta: string;
9
+ dismissModalAriaLabel: string;
10
+ }
11
+ declare const MARKETING_WIDGET_LABELS_EN: MarketingWidgetLabels;
12
+
13
+ interface MarketingWidgetImage {
14
+ src: string;
15
+ alt: string;
16
+ width?: number;
17
+ }
18
+ interface MarketingWidgetAppearance {
19
+ primaryColor: string;
20
+ primaryContrastColor: string;
21
+ cardBackgroundColor: string;
22
+ borderRadius: string;
23
+ boxShadow: string;
24
+ modalBackgroundColor: string;
25
+ }
26
+ interface MarketingWidgetContent {
27
+ vspLogo: MarketingWidgetImage;
28
+ bankingText: string;
29
+ primaryCaption: string;
30
+ secondaryCaption: string;
31
+ /** Full card/modal attribution, e.g. "Provided by Zenith Bank, Member FDIC". */
32
+ providedByCaption: string;
33
+ modalPrimaryImg: MarketingWidgetImage;
34
+ primaryModalHeader: string;
35
+ benefits: string[];
36
+ appearance: MarketingWidgetAppearance;
37
+ }
38
+
39
+ type AuthToken = string | undefined;
40
+ interface Auth {
41
+ /**
42
+ * Which part of the request do we use to send the auth?
43
+ *
44
+ * @default 'header'
45
+ */
46
+ in?: 'header' | 'query' | 'cookie';
47
+ /**
48
+ * A unique identifier for the security scheme.
49
+ *
50
+ * Defined only when there are multiple security schemes whose `Auth`
51
+ * shape would otherwise be identical.
52
+ */
53
+ key?: string;
54
+ /**
55
+ * Header or query parameter name.
56
+ *
57
+ * @default 'Authorization'
58
+ */
59
+ name?: string;
60
+ scheme?: 'basic' | 'bearer';
61
+ type: 'apiKey' | 'http';
62
+ }
63
+
64
+ interface SerializerOptions<T> {
65
+ /**
66
+ * @default true
67
+ */
68
+ explode: boolean;
69
+ style: T;
70
+ }
71
+ type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
72
+ type ObjectStyle = 'form' | 'deepObject';
73
+
74
+ type QuerySerializer = (query: Record<string, unknown>) => string;
75
+ type BodySerializer = (body: unknown) => unknown;
76
+ type QuerySerializerOptionsObject = {
77
+ allowReserved?: boolean;
78
+ array?: Partial<SerializerOptions<ArrayStyle>>;
79
+ object?: Partial<SerializerOptions<ObjectStyle>>;
80
+ };
81
+ type QuerySerializerOptions = QuerySerializerOptionsObject & {
82
+ /**
83
+ * Per-parameter serialization overrides. When provided, these settings
84
+ * override the global array/object settings for specific parameter names.
85
+ */
86
+ parameters?: Record<string, QuerySerializerOptionsObject>;
87
+ };
88
+
89
+ type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
90
+ type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
91
+ /**
92
+ * Returns the final request URL.
93
+ */
94
+ buildUrl: BuildUrlFn;
95
+ getConfig: () => Config;
96
+ request: RequestFn;
97
+ setConfig: (config: Config) => Config;
98
+ } & {
99
+ [K in HttpMethod]: MethodFn;
100
+ } & ([SseFn] extends [never] ? {
101
+ sse?: never;
102
+ } : {
103
+ sse: {
104
+ [K in HttpMethod]: SseFn;
105
+ };
106
+ });
107
+ interface Config$1 {
108
+ /**
109
+ * Auth token or a function returning auth token. The resolved value will be
110
+ * added to the request payload as defined by its `security` array.
111
+ */
112
+ auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
113
+ /**
114
+ * A function for serializing request body parameter. By default,
115
+ * {@link JSON.stringify()} will be used.
116
+ */
117
+ bodySerializer?: BodySerializer | null;
118
+ /**
119
+ * An object containing any HTTP headers that you want to pre-populate your
120
+ * `Headers` object with.
121
+ *
122
+ * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
123
+ */
124
+ headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
125
+ /**
126
+ * The request method.
127
+ *
128
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
129
+ */
130
+ method?: Uppercase<HttpMethod>;
131
+ /**
132
+ * A function for serializing request query parameters. By default, arrays
133
+ * will be exploded in form style, objects will be exploded in deepObject
134
+ * style, and reserved characters are percent-encoded.
135
+ *
136
+ * This method will have no effect if the native `paramsSerializer()` Axios
137
+ * API function is used.
138
+ *
139
+ * {@link https://swagger.io/docs/specification/serialization/#query View examples}
140
+ */
141
+ querySerializer?: QuerySerializer | QuerySerializerOptions;
142
+ /**
143
+ * A function validating request data. This is useful if you want to ensure
144
+ * the request conforms to the desired shape, so it can be safely sent to
145
+ * the server.
146
+ */
147
+ requestValidator?: (data: unknown) => Promise<unknown>;
148
+ /**
149
+ * A function transforming response data before it's returned. This is useful
150
+ * for post-processing data, e.g., converting ISO strings into Date objects.
151
+ */
152
+ responseTransformer?: (data: unknown) => Promise<unknown>;
153
+ /**
154
+ * A function validating response data. This is useful if you want to ensure
155
+ * the response conforms to the desired shape, so it can be safely passed to
156
+ * the transformers and returned to the user.
157
+ */
158
+ responseValidator?: (data: unknown) => Promise<unknown>;
159
+ }
160
+
161
+ type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$1, 'method' | 'responseTransformer' | 'responseValidator'> & {
162
+ /**
163
+ * Fetch API implementation. You can use this option to provide a custom
164
+ * fetch instance.
165
+ *
166
+ * @default globalThis.fetch
167
+ */
168
+ fetch?: typeof fetch;
169
+ /**
170
+ * Implementing clients can call request interceptors inside this hook.
171
+ */
172
+ onRequest?: (url: string, init: RequestInit) => Promise<Request>;
173
+ /**
174
+ * Callback invoked when a network or parsing error occurs during streaming.
175
+ *
176
+ * This option applies only if the endpoint returns a stream of events.
177
+ *
178
+ * @param error The error that occurred.
179
+ */
180
+ onSseError?: (error: unknown) => void;
181
+ /**
182
+ * Callback invoked when an event is streamed from the server.
183
+ *
184
+ * This option applies only if the endpoint returns a stream of events.
185
+ *
186
+ * @param event Event streamed from the server.
187
+ * @returns Nothing (void).
188
+ */
189
+ onSseEvent?: (event: StreamEvent<TData>) => void;
190
+ serializedBody?: RequestInit['body'];
191
+ /**
192
+ * Default retry delay in milliseconds.
193
+ *
194
+ * This option applies only if the endpoint returns a stream of events.
195
+ *
196
+ * @default 3000
197
+ */
198
+ sseDefaultRetryDelay?: number;
199
+ /**
200
+ * Maximum number of retry attempts before giving up.
201
+ */
202
+ sseMaxRetryAttempts?: number;
203
+ /**
204
+ * Maximum retry delay in milliseconds.
205
+ *
206
+ * Applies only when exponential backoff is used.
207
+ *
208
+ * This option applies only if the endpoint returns a stream of events.
209
+ *
210
+ * @default 30000
211
+ */
212
+ sseMaxRetryDelay?: number;
213
+ /**
214
+ * Optional sleep function for retry backoff.
215
+ *
216
+ * Defaults to using `setTimeout`.
217
+ */
218
+ sseSleepFn?: (ms: number) => Promise<void>;
219
+ url: string;
220
+ };
221
+ interface StreamEvent<TData = unknown> {
222
+ data: TData;
223
+ event?: string;
224
+ id?: string;
225
+ retry?: number;
226
+ }
227
+ type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
228
+ stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
229
+ };
230
+
231
+ type ErrInterceptor<Err, Res, Req, Options> = (error: Err,
232
+ /** response may be undefined due to a network error where no response object is produced */
233
+ response: Res | undefined,
234
+ /** request may be undefined, because error may be from building the request object itself */
235
+ request: Req | undefined, options: Options) => Err | Promise<Err>;
236
+ type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
237
+ type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
238
+ declare class Interceptors<Interceptor> {
239
+ fns: Array<Interceptor | null>;
240
+ clear(): void;
241
+ eject(id: number | Interceptor): void;
242
+ exists(id: number | Interceptor): boolean;
243
+ getInterceptorIndex(id: number | Interceptor): number;
244
+ update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
245
+ use(fn: Interceptor): number;
246
+ }
247
+ interface Middleware<Req, Res, Err, Options> {
248
+ error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
249
+ request: Interceptors<ReqInterceptor<Req, Options>>;
250
+ response: Interceptors<ResInterceptor<Res, Req, Options>>;
251
+ }
252
+
253
+ type ResponseStyle = 'data' | 'fields';
254
+ interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$1 {
255
+ /**
256
+ * Base URL for all requests made by this client.
257
+ */
258
+ baseUrl?: T['baseUrl'];
259
+ /**
260
+ * Fetch API implementation. You can use this option to provide a custom
261
+ * fetch instance.
262
+ *
263
+ * @default globalThis.fetch
264
+ */
265
+ fetch?: typeof fetch;
266
+ /**
267
+ * Please don't use the Fetch client for Next.js applications. The `next`
268
+ * options won't have any effect.
269
+ *
270
+ * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
271
+ */
272
+ next?: never;
273
+ /**
274
+ * Return the response data parsed in a specified format. By default, `auto`
275
+ * will infer the appropriate method from the `Content-Type` response header.
276
+ * You can override this behavior with any of the {@link Body} methods.
277
+ * Select `stream` if you don't want to parse response data at all.
278
+ *
279
+ * @default 'auto'
280
+ */
281
+ parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
282
+ /**
283
+ * Should we return only data or multiple fields (data, error, response, etc.)?
284
+ *
285
+ * @default 'fields'
286
+ */
287
+ responseStyle?: ResponseStyle;
288
+ /**
289
+ * Throw an error instead of returning it in the response?
290
+ *
291
+ * @default false
292
+ */
293
+ throwOnError?: T['throwOnError'];
294
+ }
295
+ interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
296
+ responseStyle: TResponseStyle;
297
+ throwOnError: ThrowOnError;
298
+ }>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
299
+ /**
300
+ * Any body that you want to add to your request.
301
+ *
302
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
303
+ */
304
+ body?: unknown;
305
+ path?: Record<string, unknown>;
306
+ query?: Record<string, unknown>;
307
+ /**
308
+ * Security mechanism(s) to use for the request.
309
+ */
310
+ security?: ReadonlyArray<Auth>;
311
+ url: Url;
312
+ }
313
+ interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
314
+ headers: Headers;
315
+ serializedBody?: string;
316
+ }
317
+ type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
318
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
319
+ request: Request;
320
+ response: Response;
321
+ }> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
322
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
323
+ error: undefined;
324
+ } | {
325
+ data: undefined;
326
+ error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
327
+ }) & {
328
+ /** request may be undefined, because error may be from building the request object itself */
329
+ request?: Request;
330
+ /** response may be undefined, because error may be from building the request object itself or from a network error */
331
+ response?: Response;
332
+ }>;
333
+ interface ClientOptions$1 {
334
+ baseUrl?: string;
335
+ responseStyle?: ResponseStyle;
336
+ throwOnError?: boolean;
337
+ }
338
+ type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
339
+ type SseFn = <TData = unknown, _TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData>>;
340
+ type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
341
+ type BuildUrlFn = <TData extends {
342
+ body?: unknown;
343
+ path?: Record<string, unknown>;
344
+ query?: Record<string, unknown>;
345
+ url: string;
346
+ }>(options: TData & Options<TData>) => string;
347
+ type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
348
+ interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
349
+ };
350
+ interface TDataShape {
351
+ body?: unknown;
352
+ headers?: unknown;
353
+ path?: unknown;
354
+ query?: unknown;
355
+ url: string;
356
+ }
357
+ type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
358
+ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
359
+
360
+ type ClientOptions = {
361
+ baseUrl: 'https://api.stage.tesouro.com' | 'https://api.sandbox.stage.tesouro.com' | 'https://api.stage.business-banking.app' | 'https://api.tesouro.com' | 'https://api.sandbox.tesouro.com' | 'https://api.business-banking.app' | (string & {});
362
+ };
363
+
364
+ type EmbeddedClient = Client;
365
+ type ExtractLiterals<T> = T extends string ? string extends T ? never : T : never;
366
+ type BaseUrl = ExtractLiterals<ClientOptions['baseUrl']>;
367
+
368
+ type LinkComponentProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
369
+ children?: ReactNode;
370
+ };
371
+ type LinkComponent = ComponentType<LinkComponentProps>;
372
+ /**
373
+ * The UI frameworks a widget's UI layer can render with.
374
+ *
375
+ * - `shadcn` — the shadcn/Tailwind implementation. This is the default and the
376
+ * implicit fallback, so existing consumers that select nothing keep rendering
377
+ * shadcn.
378
+ * - `tecton` — the Tecton implementation.
379
+ *
380
+ * Declared as an `as const` object (not a TypeScript `enum`) per repo
381
+ * convention.
382
+ */
383
+ declare const UIFramework: {
384
+ readonly Shadcn: "shadcn";
385
+ readonly Tecton: "tecton";
386
+ };
387
+ type UIFramework = (typeof UIFramework)[keyof typeof UIFramework];
388
+
389
+ /**
390
+ * The implementation a widget renders with.
391
+ *
392
+ * - `native` — the Tesouro-native implementation. This is the default and the
393
+ * implicit fallback, so consumers that select nothing keep rendering native.
394
+ * - `monite` — the Monite SDK implementation.
395
+ *
396
+ * Declared as an `as const` object (not a TypeScript `enum`) per repo
397
+ * convention.
398
+ */
399
+ declare const Implementation: {
400
+ readonly Native: "native";
401
+ readonly Monite: "monite";
402
+ };
403
+ type Implementation = (typeof Implementation)[keyof typeof Implementation];
404
+ /**
405
+ * The settable fields of the widget config cascade.
406
+ *
407
+ * This is the type accepted by {@link setGlobalWidgetConfig} and all provider props.
408
+ * It intentionally excludes `initResponse`, which is populated automatically by the
409
+ * provider after a successful fetch and must never be set manually.
410
+ *
411
+ * The `null` vs `undefined` distinction on `widgetToken` and `organizationId` is intentional:
412
+ * - `undefined` — not set at this level; inherit from the nearest ancestor or global store.
413
+ * - `null` — explicitly cleared; downstream sees "no value" even if an ancestor had one
414
+ * (e.g. after logout or deliberate de-scoping).
415
+ *
416
+ * @see {@link WidgetConfig} for the resolved output type (includes `initResponse`)
417
+ * @see {@link RootWidgetProvider}
418
+ * @see {@link WidgetProvider}
419
+ * @see {@link setGlobalWidgetConfig}
420
+ */
421
+ interface WidgetConfigInput {
422
+ /**
423
+ * Base URL of the Tesouro embedded API (e.g. `"https://api.tesouro.com"`).
424
+ *
425
+ * When omitted the nearest ancestor's `baseUrl` or the global store value is used.
426
+ * Changing this recreates the underlying HTTP client so all subsequent requests
427
+ * go to the new host.
428
+ */
429
+ baseUrl?: BaseUrl;
430
+ /**
431
+ * Bearer token used to authenticate widget requests.
432
+ *
433
+ * Injected as `Authorization: Bearer <token>` on every outgoing request via an
434
+ * interceptor on the scoped HTTP client. Token updates are picked up immediately
435
+ * without recreating the client.
436
+ *
437
+ * - `string` — send this token on all requests from this level downward.
438
+ * - `null` — explicitly cleared; no auth header is sent and fetching is suppressed.
439
+ * - `undefined` — not set at this level; inherit from the nearest ancestor or global store.
440
+ */
441
+ widgetToken?: string | null;
442
+ /**
443
+ * Organization ID forwarded as the `x-organization-id` request header.
444
+ *
445
+ * Passed through {@link EmbedApiProvider} context rather than the auth interceptor,
446
+ * so individual data-access hooks can opt in per-request.
447
+ *
448
+ * - `string` — use this organization for downstream data requests.
449
+ * - `null` — explicitly cleared; queries that require an org ID will be disabled.
450
+ * - `undefined` — not set at this level; inherit from the nearest ancestor or global store.
451
+ *
452
+ * When `undefined` across the **whole** cascade (no prop, no ancestor, no global
453
+ * value), the resolved org defaults to the loaded `initResponse.organizationId`
454
+ * (see {@link WidgetConfig.initResponse}) once the widget-init fetch settles. This
455
+ * is the lowest-priority fallback — any explicit `string` or `null` at any cascade
456
+ * level wins, and an explicit `null` is preserved and never falls back.
457
+ *
458
+ * Only an **explicit** ancestor org is inherited. An ancestor's *init-derived*
459
+ * default does not propagate into a descendant that owns its own fetch (its own
460
+ * `baseUrl`/`widgetToken`); such a descendant defaults to its own
461
+ * `initResponse.organizationId` instead, so it never sends an ancestor's org with
462
+ * its own token.
463
+ */
464
+ organizationId?: string | null;
465
+ /**
466
+ * Optional post-creation hook for the scoped HTTP client.
467
+ *
468
+ * Called once after the provider creates its scoped {@link EmbeddedClient} and
469
+ * applies the built-in `Authorization: Bearer` interceptor. Receives the
470
+ * fully-configured client and must return the client to be used for the lifetime of
471
+ * this provider level — either the same instance (with additional interceptors
472
+ * attached) or a new client entirely.
473
+ *
474
+ * **Order:** The built-in auth interceptor is always applied first. `configClient`
475
+ * is called on top of it, so any interceptors you add here run after auth is set.
476
+ *
477
+ * **Any prop triggers a scoped client.** A {@link WidgetProvider} creates its own
478
+ * scoped client whenever any prop is set — including `configClient` alone, without
479
+ * `baseUrl` or `widgetToken`. Only a fully props-free pass-through provider skips
480
+ * client creation and never calls this function.
481
+ *
482
+ * **Stability:** The function reference is included in the client creation memo's
483
+ * dependency array. Passing an unstable (inline) function recreates the client on
484
+ * every render. Stabilize with `useCallback` or define the function outside the
485
+ * component.
486
+ *
487
+ * **Cascade:** Inherits from the nearest ancestor when `undefined`. A child
488
+ * {@link WidgetProvider} that creates its own scoped client will use the resolved
489
+ * `configClient` from the cascade unless it provides its own override.
490
+ *
491
+ * @example
492
+ * ```tsx
493
+ * const addLogging = useCallback(
494
+ * (client: EmbeddedClient) => {
495
+ * client.interceptors.request.use((req) => {
496
+ * console.log('[widget]', req.method, req.url);
497
+ * return req;
498
+ * });
499
+ * return client;
500
+ * },
501
+ * [],
502
+ * );
503
+ *
504
+ * <RootWidgetProvider
505
+ * baseUrl="https://api.tesouro.com"
506
+ * widgetToken={token}
507
+ * configClient={addLogging}
508
+ * >
509
+ * <App />
510
+ * </RootWidgetProvider>
511
+ * ```
512
+ */
513
+ configClient?: (client: EmbeddedClient) => EmbeddedClient;
514
+ /**
515
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
516
+ *
517
+ * Any caller reaching the Tesouro API with a widget token must route data
518
+ * requests through the widget gateway: prefix the path with
519
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
520
+ * provider applies both automatically per request when the request origin is
521
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
522
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
523
+ * init round-trip) always pass through untouched.
524
+ *
525
+ * - `undefined` — decide from the request origin, as above. Inherits from
526
+ * the nearest ancestor or global store like every other config field.
527
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
528
+ * custom domain in front of the gateway).
529
+ * - `false` — never apply it. For hosts that route widget requests their own
530
+ * way, such as a same-origin BFF whose `configClient` retargets every
531
+ * request.
532
+ *
533
+ * Independent of {@link configClient}: a host that only adds a header keeps
534
+ * the built-in routing, and the built-in interceptor runs before any
535
+ * `configClient` interceptor.
536
+ */
537
+ gatewayRouting?: boolean;
538
+ /**
539
+ * Component the embedded widgets should render in place of plain `<a>` tags.
540
+ *
541
+ * Pass e.g. Next.js's `Link` to make in-app navigation use the host router.
542
+ * Cascades like other config: provider prop > nearest ancestor > global store.
543
+ * When no value is set anywhere, widgets fall back to a plain `<a>` element.
544
+ */
545
+ linkComponent?: LinkComponent;
546
+ /**
547
+ * Which UI framework the widget UI layer should render with.
548
+ *
549
+ * Lets a consuming context bind widgets to either the shadcn/Tailwind or the
550
+ * Tecton implementation behind the same outward-facing API. The selection is
551
+ * a presentation concern only — it cascades through the provider tree exactly
552
+ * like {@link linkComponent} and is read by UI libraries via `useUIFramework`;
553
+ * it never appears in any widget's feature-library or component props.
554
+ *
555
+ * - `'shadcn'` — the shadcn/Tailwind implementation.
556
+ * - `'tecton'` — the Tecton implementation.
557
+ * - `null` / `undefined` — not set at this level; inherit from the nearest
558
+ * ancestor or global store, falling back to `shadcn` when unset everywhere.
559
+ * `shadcn` is the implicit default, so existing consumers need no changes.
560
+ */
561
+ uiFramework?: UIFramework | null;
562
+ /**
563
+ * Which implementation a widget renders with.
564
+ *
565
+ * Lets a consuming context bind widgets to either the Tesouro-native or the
566
+ * Monite SDK implementation behind the same outward-facing API. It cascades
567
+ * through the provider tree exactly like {@link linkComponent} and
568
+ * {@link uiFramework} — provider prop > nearest ancestor > global store — and
569
+ * is read via `useImplementation`.
570
+ *
571
+ * - `'native'` — the Tesouro-native implementation.
572
+ * - `'monite'` — the Monite SDK implementation.
573
+ * - `null` / `undefined` — not set at this level; inherit from the nearest
574
+ * ancestor or global store, falling back to `native` when unset everywhere.
575
+ * `native` is the implicit default, so existing consumers need no changes.
576
+ */
577
+ implementation?: Implementation | null;
578
+ }
579
+ /**
580
+ * Props shared by every analytics-owner-capable widget provider.
581
+ *
582
+ * Combines the full settable cascade ({@link WidgetConfigInput}) with the
583
+ * analytics opt-out honored by analytics owners. Both {@link RootWidgetProvider}
584
+ * and {@link WidgetProvider} build their public props on top of this; the latter
585
+ * adds error-boundary props of its own.
586
+ *
587
+ * @see {@link WidgetConfigInput} for per-field cascade and `null` vs omitted semantics
588
+ */
589
+ interface WidgetProviderBaseProps extends WidgetConfigInput {
590
+ /**
591
+ * Opt out of all analytics capture and prevent PostHog from loading. Default `true`.
592
+ *
593
+ * Honored only by an analytics **owner** — a {@link RootWidgetProvider} or a
594
+ * standalone {@link WidgetProvider} with no parent provider. When `false`,
595
+ * owner-bound `track` calls in this subtree become no-ops and the PostHog
596
+ * installer is never dynamically imported for this owner's environment.
597
+ * Setting it on a nested {@link WidgetProvider} is ignored in v1 (a one-time
598
+ * `console.warn` is emitted to make the no-op discoverable).
599
+ */
600
+ analytics?: boolean;
601
+ }
602
+
603
+ /**
604
+ * Copy for the states `WidgetProvider` renders *itself*, in place of the widget:
605
+ * the error-boundary fallback and the disclosures gate. A host overrides any
606
+ * subset through the `providerLabels` prop, which cascades like
607
+ * `disclosuresAcceptance`.
608
+ *
609
+ * Not named `Labels` on the public surface: a widget's own `labels` prop is a
610
+ * different thing, and these two travel together on every widget's props type.
611
+ */
612
+ interface WidgetProviderLabels {
613
+ /** Default copy for the built-in error boundary fallback. */
614
+ errorBoundaryFallback: string;
615
+ /** Heading when init reports disclosures are required and not yet accepted. */
616
+ disclosuresRequiredTitle: string;
617
+ /** Heading while a token-only refresh leaves init stale for the live token. */
618
+ disclosuresRefreshingTitle: string;
619
+ /** Supporting copy while the accept action is withheld for a stale init. */
620
+ disclosuresRefreshingDescription: string;
621
+ }
622
+
623
+ /**
624
+ * Props for {@link WidgetProvider}.
625
+ *
626
+ * All fields are optional. When **all** are omitted the provider is a transparent
627
+ * pass-through: no fetch is issued and all resolved values cascade unchanged from
628
+ * the nearest ancestor.
629
+ */
630
+ interface WidgetProviderProps extends WidgetProviderBaseProps {
631
+ /**
632
+ * Fallback rendered when a render-time exception is caught inside this
633
+ * provider's subtree. Pass either a `ReactNode` (rendered directly) or a
634
+ * render-prop receiving `{ error, resetErrorBoundary }` from
635
+ * `react-error-boundary`. Default is a plain `role="alert"` div whose copy
636
+ * comes from `providerLabels.errorBoundaryFallback`.
637
+ */
638
+ errorFallback?: ReactNode | ((props: FallbackProps) => ReactNode);
639
+ /**
640
+ * Called once when the boundary catches an error, before the fallback
641
+ * renders. Use for telemetry / error tracking / partner logging. Exceptions
642
+ * thrown from `onError` propagate per `react-error-boundary` semantics.
643
+ */
644
+ onError?: (error: unknown, info: ErrorInfo) => void;
645
+ /**
646
+ * Accept surface shown when the caller owes disclosures — an INVITED
647
+ * teammate (including `NOT_REQUIRED` orgs, who still need Accept to
648
+ * activate) or an ACTIVE user who owes a new version. Pass
649
+ * `<AcceptDisclosuresWidget />`. Cascades like `linkComponent`.
650
+ * WidgetProvider cannot import the widget itself (cycle).
651
+ */
652
+ disclosuresAcceptance?: ReactNode;
653
+ /**
654
+ * Overrides for the copy this provider renders in place of the widget: the
655
+ * built-in error-boundary fallback and the disclosures gate. Any subset;
656
+ * unlisted keys keep their defaults. Cascades like `linkComponent`.
657
+ *
658
+ * Named `providerLabels` rather than `labels` because a widget's own
659
+ * `labels` prop sits alongside this one on the same props type.
660
+ */
661
+ providerLabels?: Partial<WidgetProviderLabels>;
662
+ }
663
+
664
+ type InnerProps = {
665
+ content: MarketingWidgetContent;
666
+ onPrimaryCtaClick: () => void;
667
+ labels?: PartialDeep<MarketingWidgetLabels>;
668
+ };
669
+ type MarketingWidgetProps = WidgetProviderProps & InnerProps;
670
+ /**
671
+ * Self-contained marketing card + modal. Hosts supply tenant-specific
672
+ * `content` (logos, copy, colors) and wire `onPrimaryCtaClick` to whatever
673
+ * should happen next — typically opening bank-account onboarding.
674
+ *
675
+ * Renders nothing until widget init resolves, and hides itself when the
676
+ * caller is already onboarded (`ACTIVE` / `INACTIVE`), invited (`INVITED`),
677
+ * or their organization already has a bank-account application (COMPLETE or
678
+ * started by another member). That last case is a NOT_FOUND widget user who
679
+ * still must not apply.
680
+ */
681
+ declare function MarketingWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: MarketingWidgetProps): React.JSX.Element;
682
+
683
+ export { MARKETING_WIDGET_LABELS_EN, MarketingWidget };
684
+ export type { MarketingWidgetAppearance, MarketingWidgetContent, MarketingWidgetImage, MarketingWidgetLabels, MarketingWidgetProps };
@@ -0,0 +1,4 @@
1
+ import { MARKETING_WIDGET_LABELS_EN as e } from "../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index2.js";
2
+ import { MarketingWidget as t } from "../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js";
3
+ import "../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js";
4
+ export { e as MARKETING_WIDGET_LABELS_EN, t as MarketingWidget };