@capitalos/react 0.2.1-rc3 → 1.0.0-rc.1

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.
@@ -1,5 +1,3 @@
1
- /// <reference types="react" />
2
-
3
1
  import { IFrameComponent } from 'iframe-resizer';
4
2
  import { IFrameMessageData } from 'iframe-resizer';
5
3
  import { IFrameOptions } from 'iframe-resizer';
@@ -7,86 +5,122 @@ import { IFrameResizedData } from 'iframe-resizer';
7
5
  import { IFrameScrollData } from 'iframe-resizer';
8
6
  import { default as React_2 } from 'react';
9
7
  import { ReactNode } from 'react';
10
- import * as z from 'zod';
11
- import { z as z_2 } from 'zod';
8
+ import { z } from 'zod';
9
+ import * as z_2 from 'zod';
10
+
11
+ export declare type Account = {
12
+ status: AccountStatus;
13
+ };
14
+
15
+ /**
16
+ * Renders the CapitalOS Account Actions experience.
17
+ */
18
+ export declare function AccountActions(props: AccountActionsProps): JSX.Element;
19
+
20
+ export declare type AccountActionsProps = CommonProps;
12
21
 
13
22
  /**
14
- * Renders the CapitalOS App.
23
+ * Renders the CapitalOS Account Details experience.
15
24
  */
16
- export declare function App(props: CommonProps): JSX.Element;
25
+ export declare function AccountDetails(props: AccountDetailsProps): JSX.Element;
26
+
27
+ export declare type AccountDetailsProps = CommonProps;
28
+
29
+ export declare type AccountStatus = z_2.infer<typeof accountStatusSchema>;
30
+
31
+ declare const accountStatusSchema: z_2.ZodEnum<["eligible", "ineligible", "engaged", "onboarding", "approved", "processing", "pending", "declined", "closed", "waiting"]>;
32
+
33
+ declare type AllowedExitPoints = {
34
+ welcome: 'application' | 'activation';
35
+ application: 'application' | 'activation';
36
+ };
37
+
38
+ /** @deprecated Use {@link CardsApp} instead */
39
+ export declare const App: typeof CardsApp;
40
+
41
+ /**
42
+ * Renders the CapitalOS Bill Payment Dashboard experience.
43
+ */
44
+ export declare function BillPayApp(props: BillPayAppProps): JSX.Element;
45
+
46
+ export declare type BillPayAppProps = CommonProps;
17
47
 
18
48
  /**
19
49
  * The internal component that handles all the heavy lifting of connecting to the iframe and rendering the app.
20
50
  * all user facing components are basically a syntactic sugar on top of this.
21
51
  */
22
- export declare function CapitalOS<T>(props: CapitalOsProps<T>): JSX.Element;
52
+ export declare function CapitalOS<T extends RenderingContext_2>(props: CapitalOsProps<T>): JSX.Element;
23
53
 
24
54
  /**
25
55
  * Base class for all SDK errors
26
56
  */
27
57
  export declare class CapitalOSError extends Error {
28
- constructor(message: string);
58
+ code: ErrorCode;
59
+ constructor({ message, code }: {
60
+ message: string;
61
+ code: ErrorCode;
62
+ });
29
63
  }
30
64
 
31
- declare type CapitalOsProps<T> = CommonProps & {
32
- renderingContext?: T | undefined;
65
+ declare type CapitalOsProps<T extends RenderingContext_2> = CommonProps & {
66
+ renderingContext: T;
33
67
  methods?: Partial<IframeConnectionMethods>;
34
68
  };
35
69
 
36
- export declare type CardApiDto = z.infer<typeof cardApiDtoSchema>;
37
-
38
- declare const cardApiDtoSchema: z.ZodObject<{
39
- accountUserId: z.ZodNullable<z.ZodString>;
40
- status: z.ZodEnum<["active", "inactive", "canceled", "frozen"]>;
41
- id: z.ZodString;
42
- last4: z.ZodString;
43
- platformId: z.ZodString;
44
- cardholderFirstName: z.ZodString;
45
- cardholderLastName: z.ZodString;
46
- cardholderPhoneNumber: z.ZodEffects<z.ZodString, string, string>;
47
- nickname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
48
- spend: z.ZodObject<{
49
- daily: z.ZodObject<{
50
- limit: z.ZodOptional<z.ZodNumber>;
51
- amount: z.ZodNumber;
52
- }, "strip", z.ZodTypeAny, {
70
+ export declare type CardApiDto = z_2.infer<typeof cardApiDtoSchema>;
71
+
72
+ declare const cardApiDtoSchema: z_2.ZodObject<{
73
+ accountUserId: z_2.ZodNullable<z_2.ZodString>;
74
+ status: z_2.ZodEnum<["active", "inactive", "canceled", "frozen"]>;
75
+ id: z_2.ZodString;
76
+ last4: z_2.ZodString;
77
+ platformId: z_2.ZodString;
78
+ cardholderFirstName: z_2.ZodString;
79
+ cardholderLastName: z_2.ZodString;
80
+ cardholderPhoneNumber: z_2.ZodEffects<z_2.ZodString, string, string>;
81
+ nickname: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
82
+ spend: z_2.ZodObject<{
83
+ daily: z_2.ZodObject<{
84
+ limit: z_2.ZodOptional<z_2.ZodNumber>;
85
+ amount: z_2.ZodNumber;
86
+ }, "strip", z_2.ZodTypeAny, {
53
87
  amount: number;
54
88
  limit?: number | undefined;
55
89
  }, {
56
90
  amount: number;
57
91
  limit?: number | undefined;
58
92
  }>;
59
- weekly: z.ZodObject<{
60
- limit: z.ZodOptional<z.ZodNumber>;
61
- amount: z.ZodNumber;
62
- }, "strip", z.ZodTypeAny, {
93
+ weekly: z_2.ZodObject<{
94
+ limit: z_2.ZodOptional<z_2.ZodNumber>;
95
+ amount: z_2.ZodNumber;
96
+ }, "strip", z_2.ZodTypeAny, {
63
97
  amount: number;
64
98
  limit?: number | undefined;
65
99
  }, {
66
100
  amount: number;
67
101
  limit?: number | undefined;
68
102
  }>;
69
- monthly: z.ZodObject<{
70
- limit: z.ZodOptional<z.ZodNumber>;
71
- amount: z.ZodNumber;
72
- }, "strip", z.ZodTypeAny, {
103
+ monthly: z_2.ZodObject<{
104
+ limit: z_2.ZodOptional<z_2.ZodNumber>;
105
+ amount: z_2.ZodNumber;
106
+ }, "strip", z_2.ZodTypeAny, {
73
107
  amount: number;
74
108
  limit?: number | undefined;
75
109
  }, {
76
110
  amount: number;
77
111
  limit?: number | undefined;
78
112
  }>;
79
- lifetime: z.ZodObject<{
80
- limit: z.ZodOptional<z.ZodNumber>;
81
- amount: z.ZodNumber;
82
- }, "strip", z.ZodTypeAny, {
113
+ lifetime: z_2.ZodObject<{
114
+ limit: z_2.ZodOptional<z_2.ZodNumber>;
115
+ amount: z_2.ZodNumber;
116
+ }, "strip", z_2.ZodTypeAny, {
83
117
  amount: number;
84
118
  limit?: number | undefined;
85
119
  }, {
86
120
  amount: number;
87
121
  limit?: number | undefined;
88
122
  }>;
89
- }, "strip", z.ZodTypeAny, {
123
+ }, "strip", z_2.ZodTypeAny, {
90
124
  daily: {
91
125
  amount: number;
92
126
  limit?: number | undefined;
@@ -121,18 +155,123 @@ declare const cardApiDtoSchema: z.ZodObject<{
121
155
  limit?: number | undefined;
122
156
  };
123
157
  }>;
124
- allowedSpendCategories: z.ZodArray<z.ZodEnum<["airlines", "car_rental", "fuel_pump_only", "fuel_station", "lodging", "parking", "taxi_and_rideshare", "travel_misc"]>, "many">;
125
- isFuelCard: z.ZodBoolean;
126
- physicalCard: z.ZodOptional<z.ZodNullable<z.ZodObject<{
127
- id: z.ZodString;
128
- }, "strip", z.ZodTypeAny, {
158
+ allowedSpendCategories: z_2.ZodArray<z_2.ZodEnum<["airlines", "carRental", "carService", "education", "electronics", "gasPump", "gasStation", "generalMerchandise", "government", "hardwareAndConstruction", "insurance", "legal", "lodging", "medical", "other", "parking", "phoneAndInternet", "professionalServices", "recreationAndEntertainment", "restaurants", "shipping", "software", "taxisAndRideshare", "transportation", "travelMisc", "utilities"]>, "many">;
159
+ allowedMerchants: z_2.ZodArray<z_2.ZodObject<{
160
+ id: z_2.ZodUnion<[z_2.ZodString, z_2.ZodString]>;
161
+ name: z_2.ZodString;
162
+ logoUrl: z_2.ZodNullable<z_2.ZodString>;
163
+ }, "strip", z_2.ZodTypeAny, {
129
164
  id: string;
165
+ name: string;
166
+ logoUrl: string | null;
130
167
  }, {
131
168
  id: string;
132
- }>>>;
133
- }, "strip", z.ZodTypeAny, {
134
- id: string;
169
+ name: string;
170
+ logoUrl: string | null;
171
+ }>, "many">;
172
+ physicalCard: z_2.ZodNullable<z_2.ZodObject<{
173
+ status: z_2.ZodEnum<["active", "disabled", "canceled"]>;
174
+ shipment: z_2.ZodObject<{
175
+ address: z_2.ZodObject<{
176
+ addressLine1: z_2.ZodString;
177
+ addressLine2: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
178
+ city: z_2.ZodString;
179
+ state: z_2.ZodEffects<z_2.ZodString, string, string>;
180
+ zipcode: z_2.ZodString;
181
+ }, "strip", z_2.ZodTypeAny, {
182
+ addressLine1: string;
183
+ city: string;
184
+ state: string;
185
+ zipcode: string;
186
+ addressLine2?: string | null | undefined;
187
+ }, {
188
+ addressLine1: string;
189
+ city: string;
190
+ state: string;
191
+ zipcode: string;
192
+ addressLine2?: string | null | undefined;
193
+ }>;
194
+ method: z_2.ZodEnum<["usps", "fedexPriorityOvernight", "fedexTwoDay"]>;
195
+ recipientName: z_2.ZodString;
196
+ returnReason: z_2.ZodNullable<z_2.ZodString>;
197
+ shippedAt: z_2.ZodNullable<z_2.ZodString>;
198
+ status: z_2.ZodEnum<["canceled", "pending", "rejected", "returned", "shipped"]>;
199
+ trackingNumber: z_2.ZodNullable<z_2.ZodString>;
200
+ trackingUrl: z_2.ZodNullable<z_2.ZodString>;
201
+ }, "strip", z_2.ZodTypeAny, {
202
+ status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
203
+ method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
204
+ address: {
205
+ addressLine1: string;
206
+ city: string;
207
+ state: string;
208
+ zipcode: string;
209
+ addressLine2?: string | null | undefined;
210
+ };
211
+ recipientName: string;
212
+ returnReason: string | null;
213
+ shippedAt: string | null;
214
+ trackingNumber: string | null;
215
+ trackingUrl: string | null;
216
+ }, {
217
+ status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
218
+ method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
219
+ address: {
220
+ addressLine1: string;
221
+ city: string;
222
+ state: string;
223
+ zipcode: string;
224
+ addressLine2?: string | null | undefined;
225
+ };
226
+ recipientName: string;
227
+ returnReason: string | null;
228
+ shippedAt: string | null;
229
+ trackingNumber: string | null;
230
+ trackingUrl: string | null;
231
+ }>;
232
+ id: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
233
+ }, "strip", z_2.ZodTypeAny, {
234
+ status: "active" | "canceled" | "disabled";
235
+ shipment: {
236
+ status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
237
+ method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
238
+ address: {
239
+ addressLine1: string;
240
+ city: string;
241
+ state: string;
242
+ zipcode: string;
243
+ addressLine2?: string | null | undefined;
244
+ };
245
+ recipientName: string;
246
+ returnReason: string | null;
247
+ shippedAt: string | null;
248
+ trackingNumber: string | null;
249
+ trackingUrl: string | null;
250
+ };
251
+ id?: string | null | undefined;
252
+ }, {
253
+ status: "active" | "canceled" | "disabled";
254
+ shipment: {
255
+ status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
256
+ method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
257
+ address: {
258
+ addressLine1: string;
259
+ city: string;
260
+ state: string;
261
+ zipcode: string;
262
+ addressLine2?: string | null | undefined;
263
+ };
264
+ recipientName: string;
265
+ returnReason: string | null;
266
+ shippedAt: string | null;
267
+ trackingNumber: string | null;
268
+ trackingUrl: string | null;
269
+ };
270
+ id?: string | null | undefined;
271
+ }>>;
272
+ }, "strip", z_2.ZodTypeAny, {
135
273
  status: "active" | "inactive" | "canceled" | "frozen";
274
+ id: string;
136
275
  platformId: string;
137
276
  accountUserId: string | null;
138
277
  last4: string;
@@ -157,15 +296,36 @@ declare const cardApiDtoSchema: z.ZodObject<{
157
296
  limit?: number | undefined;
158
297
  };
159
298
  };
160
- allowedSpendCategories: ("airlines" | "car_rental" | "fuel_pump_only" | "fuel_station" | "lodging" | "parking" | "taxi_and_rideshare" | "travel_misc")[];
161
- isFuelCard: boolean;
162
- nickname?: string | null | undefined;
163
- physicalCard?: {
299
+ allowedSpendCategories: ("airlines" | "carRental" | "carService" | "education" | "electronics" | "gasPump" | "gasStation" | "generalMerchandise" | "government" | "hardwareAndConstruction" | "insurance" | "legal" | "lodging" | "medical" | "other" | "parking" | "phoneAndInternet" | "professionalServices" | "recreationAndEntertainment" | "restaurants" | "shipping" | "software" | "taxisAndRideshare" | "transportation" | "travelMisc" | "utilities")[];
300
+ allowedMerchants: {
164
301
  id: string;
165
- } | null | undefined;
302
+ name: string;
303
+ logoUrl: string | null;
304
+ }[];
305
+ physicalCard: {
306
+ status: "active" | "canceled" | "disabled";
307
+ shipment: {
308
+ status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
309
+ method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
310
+ address: {
311
+ addressLine1: string;
312
+ city: string;
313
+ state: string;
314
+ zipcode: string;
315
+ addressLine2?: string | null | undefined;
316
+ };
317
+ recipientName: string;
318
+ returnReason: string | null;
319
+ shippedAt: string | null;
320
+ trackingNumber: string | null;
321
+ trackingUrl: string | null;
322
+ };
323
+ id?: string | null | undefined;
324
+ } | null;
325
+ nickname?: string | null | undefined;
166
326
  }, {
167
- id: string;
168
327
  status: "active" | "inactive" | "canceled" | "frozen";
328
+ id: string;
169
329
  platformId: string;
170
330
  accountUserId: string | null;
171
331
  last4: string;
@@ -190,14 +350,53 @@ declare const cardApiDtoSchema: z.ZodObject<{
190
350
  limit?: number | undefined;
191
351
  };
192
352
  };
193
- allowedSpendCategories: ("airlines" | "car_rental" | "fuel_pump_only" | "fuel_station" | "lodging" | "parking" | "taxi_and_rideshare" | "travel_misc")[];
194
- isFuelCard: boolean;
195
- nickname?: string | null | undefined;
196
- physicalCard?: {
353
+ allowedSpendCategories: ("airlines" | "carRental" | "carService" | "education" | "electronics" | "gasPump" | "gasStation" | "generalMerchandise" | "government" | "hardwareAndConstruction" | "insurance" | "legal" | "lodging" | "medical" | "other" | "parking" | "phoneAndInternet" | "professionalServices" | "recreationAndEntertainment" | "restaurants" | "shipping" | "software" | "taxisAndRideshare" | "transportation" | "travelMisc" | "utilities")[];
354
+ allowedMerchants: {
197
355
  id: string;
198
- } | null | undefined;
356
+ name: string;
357
+ logoUrl: string | null;
358
+ }[];
359
+ physicalCard: {
360
+ status: "active" | "canceled" | "disabled";
361
+ shipment: {
362
+ status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
363
+ method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
364
+ address: {
365
+ addressLine1: string;
366
+ city: string;
367
+ state: string;
368
+ zipcode: string;
369
+ addressLine2?: string | null | undefined;
370
+ };
371
+ recipientName: string;
372
+ returnReason: string | null;
373
+ shippedAt: string | null;
374
+ trackingNumber: string | null;
375
+ trackingUrl: string | null;
376
+ };
377
+ id?: string | null | undefined;
378
+ } | null;
379
+ nickname?: string | null | undefined;
199
380
  }>;
200
381
 
382
+ /**
383
+ * Renders the CapitalOS Manage Card experience.
384
+ */
385
+ export declare function CardDetails(props: CardDetailsProps): JSX.Element;
386
+
387
+ export declare type CardDetailsProps = CommonProps & {
388
+ /**
389
+ * The ID of the card to manage.
390
+ */
391
+ cardId: string;
392
+ cardOnly?: boolean | undefined;
393
+ };
394
+
395
+ /**
396
+ * Renders the CapitalOS CardsApp.
397
+ */
398
+ export declare function CardsApp(props: CommonProps): JSX.Element;
399
+
201
400
  export declare type CommonProps = {
202
401
  /**
203
402
  * The token provided by initiate-login.
@@ -219,6 +418,10 @@ export declare type CommonProps = {
219
418
  * Optional component to render while the app is loading.
220
419
  */
221
420
  loadingComponent?: ReactNode;
421
+ /**
422
+ * Optional theme to apply to the app or component.
423
+ */
424
+ theme?: 'light' | 'dark' | 'system';
222
425
  };
223
426
 
224
427
  export declare function decodeToken(token: string): any;
@@ -248,10 +451,19 @@ export declare type DisputeTransactionProps = CommonProps & {
248
451
  */
249
452
  export declare function encodeRenderingContext<T>(renderingContext: NonNullable<T>): string;
250
453
 
251
- export declare type EntryPoint = RenderingContext_2['entryPoint'];
454
+ export declare type EntryPoint = RenderingContext_3['entryPoint'];
455
+
456
+ export declare const ErrorCode: {
457
+ readonly unauthorized: "unauthorized";
458
+ readonly invalid_account_status: "invalid_account_status";
459
+ readonly unsupported_entry_point: "unsupported_entry_point";
460
+ };
461
+
462
+ export declare type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
252
463
 
253
464
  export declare type IframeConnectionMethods = {
254
465
  onLoad: () => void;
466
+ onError: (error: RawErrorDetails) => void;
255
467
  createCard?: {
256
468
  onDone?: () => void;
257
469
  onCancel?: () => void;
@@ -260,6 +472,9 @@ export declare type IframeConnectionMethods = {
260
472
  onDone?: () => void;
261
473
  onCancel?: () => void;
262
474
  };
475
+ onboarding?: {
476
+ onDone?: (account: Account) => void;
477
+ };
263
478
  };
264
479
 
265
480
  export declare const IframeResizer: React_2.ForwardRefExoticComponent<Omit<IFrameOptions, "closedCallback" | "scrollCallback" | "resizedCallback" | "messageCallback" | "initCallback"> & {
@@ -270,6 +485,25 @@ export declare const IframeResizer: React_2.ForwardRefExoticComponent<Omit<IFram
270
485
  onScroll?(data: IFrameScrollData): boolean;
271
486
  } & React_2.IframeHTMLAttributes<HTMLIFrameElement> & React_2.RefAttributes<HTMLIFrameElement>>;
272
487
 
488
+ /**
489
+ * Renders the CapitalOS Insights Dashboard experience
490
+ */
491
+ export declare function InsightsDashboard(props: InsightsDashboardProps): JSX.Element;
492
+
493
+ export declare type InsightsDashboardProps = CommonProps;
494
+
495
+ /**
496
+ * Renders a specific CapitalOS Insights Widget
497
+ */
498
+ export declare function InsightsWidget(props: InsightsWidgetProps): JSX.Element;
499
+
500
+ export declare type InsightsWidgetProps = CommonProps & {
501
+ /**
502
+ * The specific widget to render.
503
+ */
504
+ widget: 'cards-by-month' | 'top-spenders';
505
+ };
506
+
273
507
  /**
274
508
  * Represents an error that occurs when an invalid token is encountered.
275
509
  */
@@ -280,38 +514,29 @@ export declare class InvalidTokenError extends CapitalOSError {
280
514
  /**
281
515
  * Renders the CapitalOS Issue Card experience.
282
516
  */
283
- export declare function IssueCard({ defaultValues, onDone, onCancel, ...restOfProps }: IssueCardProps): JSX.Element;
517
+ export declare function IssueCard({ cardholder, onDone, onCancel, ...restOfProps }: IssueCardProps): JSX.Element;
284
518
 
285
- export declare type IssueCardDefaultValues = z_2.infer<typeof issueCardDefaultValuesSchema>;
519
+ export declare type IssueCardDefaultValues = z.infer<typeof issueCardDefaultValuesSchema>;
286
520
 
287
- declare const issueCardDefaultValuesSchema: z_2.ZodIntersection<z_2.ZodUnion<[z_2.ZodObject<{
288
- firstName: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
289
- lastName: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
290
- phone: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
291
- userId: z_2.ZodOptional<z_2.ZodUndefined>;
292
- }, "strip", z_2.ZodTypeAny, {
293
- firstName?: string | null | undefined;
294
- lastName?: string | null | undefined;
295
- phone?: string | null | undefined;
296
- userId?: undefined;
521
+ declare const issueCardDefaultValuesSchema: z.ZodUnion<[z.ZodObject<{
522
+ firstName: z.ZodString;
523
+ lastName: z.ZodString;
524
+ phone: z.ZodString;
525
+ }, "strip", z.ZodTypeAny, {
526
+ firstName: string;
527
+ lastName: string;
528
+ phone: string;
297
529
  }, {
298
- firstName?: string | null | undefined;
299
- lastName?: string | null | undefined;
300
- phone?: string | null | undefined;
301
- userId?: undefined;
302
- }>, z_2.ZodObject<{
303
- userId: z_2.ZodString;
304
- }, "strip", z_2.ZodTypeAny, {
530
+ firstName: string;
531
+ lastName: string;
532
+ phone: string;
533
+ }>, z.ZodObject<{
534
+ userId: z.ZodString;
535
+ }, "strip", z.ZodTypeAny, {
305
536
  userId: string;
306
537
  }, {
307
538
  userId: string;
308
- }>]>, z_2.ZodObject<{
309
- nickname: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
310
- }, "strip", z_2.ZodTypeAny, {
311
- nickname?: string | null | undefined;
312
- }, {
313
- nickname?: string | null | undefined;
314
- }>>;
539
+ }>]>;
315
540
 
316
541
  export declare type IssueCardProps = CommonProps & {
317
542
  /**
@@ -319,7 +544,7 @@ export declare type IssueCardProps = CommonProps & {
319
544
  *
320
545
  * Either provide a userId, in which case the default values will be taken from that user's profile, or provide the cardholder's details directly.
321
546
  */
322
- defaultValues?: IssueCardDefaultValues;
547
+ cardholder?: IssueCardDefaultValues;
323
548
  /**
324
549
  * Callback to invoke when the card was created successfully.
325
550
  */
@@ -330,72 +555,150 @@ export declare type IssueCardProps = CommonProps & {
330
555
  onCancel: () => void;
331
556
  };
332
557
 
333
- declare type RenderingContext_2 = z_2.infer<typeof renderingContextSchema>;
558
+ export declare function Onboarding<T extends OnboardingEntryPoint>({ onDone, entryPoint: onboardingEntryPoint, exitPoint: onboardingExitPoint, ...restOfProps }: OnboardingProps<T>): JSX.Element;
334
559
 
335
- declare const renderingContextSchema: z_2.ZodDiscriminatedUnion<"entryPoint", [z_2.ZodObject<{
336
- entryPoint: z_2.ZodLiteral<"createCard">;
337
- defaultValues: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodIntersection<z_2.ZodUnion<[z_2.ZodObject<{
338
- firstName: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
339
- lastName: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
340
- phone: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
341
- userId: z_2.ZodOptional<z_2.ZodUndefined>;
342
- }, "strip", z_2.ZodTypeAny, {
343
- firstName?: string | null | undefined;
344
- lastName?: string | null | undefined;
345
- phone?: string | null | undefined;
346
- userId?: undefined;
560
+ declare type OnboardingEntryPoint = keyof AllowedExitPoints;
561
+
562
+ declare type OnboardingProps<T extends keyof AllowedExitPoints> = CommonProps & {
563
+ entryPoint?: T;
564
+ exitPoint?: AllowedExitPoints[T];
565
+ onDone: (account: Account) => void;
566
+ };
567
+
568
+ /**
569
+ * An error type providing a reason code and message.
570
+ * Penpal only passes plain objects, so this does not inherit from Error.
571
+ */
572
+ export declare type RawErrorDetails = {
573
+ code: ErrorCode;
574
+ message: string;
575
+ };
576
+
577
+ declare type RenderingContext_2 = {
578
+ entryPoint?: EntryPoint;
579
+ referer?: string;
580
+ };
581
+
582
+ declare type RenderingContext_3 = z.infer<typeof renderingContextSchema>;
583
+
584
+ declare const renderingContextSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<"entryPoint", [z.ZodObject<{
585
+ entryPoint: z.ZodLiteral<"createCard">;
586
+ cardholder: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodObject<{
587
+ firstName: z.ZodString;
588
+ lastName: z.ZodString;
589
+ phone: z.ZodString;
590
+ }, "strip", z.ZodTypeAny, {
591
+ firstName: string;
592
+ lastName: string;
593
+ phone: string;
347
594
  }, {
348
- firstName?: string | null | undefined;
349
- lastName?: string | null | undefined;
350
- phone?: string | null | undefined;
351
- userId?: undefined;
352
- }>, z_2.ZodObject<{
353
- userId: z_2.ZodString;
354
- }, "strip", z_2.ZodTypeAny, {
595
+ firstName: string;
596
+ lastName: string;
597
+ phone: string;
598
+ }>, z.ZodObject<{
599
+ userId: z.ZodString;
600
+ }, "strip", z.ZodTypeAny, {
355
601
  userId: string;
356
602
  }, {
357
603
  userId: string;
358
- }>]>, z_2.ZodObject<{
359
- nickname: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
360
- }, "strip", z_2.ZodTypeAny, {
361
- nickname?: string | null | undefined;
362
- }, {
363
- nickname?: string | null | undefined;
364
- }>>>>;
365
- }, "strip", z_2.ZodTypeAny, {
604
+ }>]>>>;
605
+ }, "strip", z.ZodTypeAny, {
366
606
  entryPoint: "createCard";
367
- defaultValues?: (({
368
- firstName?: string | null | undefined;
369
- lastName?: string | null | undefined;
370
- phone?: string | null | undefined;
371
- userId?: undefined;
607
+ cardholder?: {
608
+ firstName: string;
609
+ lastName: string;
610
+ phone: string;
372
611
  } | {
373
612
  userId: string;
374
- }) & {
375
- nickname?: string | null | undefined;
376
- }) | null | undefined;
613
+ } | null | undefined;
377
614
  }, {
378
615
  entryPoint: "createCard";
379
- defaultValues?: (({
380
- firstName?: string | null | undefined;
381
- lastName?: string | null | undefined;
382
- phone?: string | null | undefined;
383
- userId?: undefined;
616
+ cardholder?: {
617
+ firstName: string;
618
+ lastName: string;
619
+ phone: string;
384
620
  } | {
385
621
  userId: string;
386
- }) & {
387
- nickname?: string | null | undefined;
388
- }) | null | undefined;
389
- }>, z_2.ZodObject<{
390
- entryPoint: z_2.ZodLiteral<"createDispute">;
391
- transactionId: z_2.ZodString;
392
- }, "strip", z_2.ZodTypeAny, {
622
+ } | null | undefined;
623
+ }>, z.ZodObject<{
624
+ entryPoint: z.ZodLiteral<"createDispute">;
625
+ transactionId: z.ZodString;
626
+ }, "strip", z.ZodTypeAny, {
393
627
  entryPoint: "createDispute";
394
628
  transactionId: string;
395
629
  }, {
396
630
  entryPoint: "createDispute";
397
631
  transactionId: string;
398
- }>]>;
632
+ }>, z.ZodObject<{
633
+ entryPoint: z.ZodLiteral<"billPayApp">;
634
+ }, "strip", z.ZodTypeAny, {
635
+ entryPoint: "billPayApp";
636
+ }, {
637
+ entryPoint: "billPayApp";
638
+ }>, z.ZodObject<{
639
+ entryPoint: z.ZodLiteral<"cardDetails">;
640
+ cardId: z.ZodString;
641
+ cardOnly: z.ZodOptional<z.ZodBoolean>;
642
+ }, "strip", z.ZodTypeAny, {
643
+ cardId: string;
644
+ entryPoint: "cardDetails";
645
+ cardOnly?: boolean | undefined;
646
+ }, {
647
+ cardId: string;
648
+ entryPoint: "cardDetails";
649
+ cardOnly?: boolean | undefined;
650
+ }>, z.ZodObject<{
651
+ entryPoint: z.ZodLiteral<"accountDetails">;
652
+ }, "strip", z.ZodTypeAny, {
653
+ entryPoint: "accountDetails";
654
+ }, {
655
+ entryPoint: "accountDetails";
656
+ }>, z.ZodObject<{
657
+ entryPoint: z.ZodLiteral<"accountActions">;
658
+ }, "strip", z.ZodTypeAny, {
659
+ entryPoint: "accountActions";
660
+ }, {
661
+ entryPoint: "accountActions";
662
+ }>, z.ZodObject<{
663
+ entryPoint: z.ZodLiteral<"insightsDashboard">;
664
+ }, "strip", z.ZodTypeAny, {
665
+ entryPoint: "insightsDashboard";
666
+ }, {
667
+ entryPoint: "insightsDashboard";
668
+ }>, z.ZodObject<{
669
+ entryPoint: z.ZodLiteral<"insightsWidget">;
670
+ widget: z.ZodEnum<["cards-by-month", "top-spenders"]>;
671
+ }, "strip", z.ZodTypeAny, {
672
+ entryPoint: "insightsWidget";
673
+ widget: "cards-by-month" | "top-spenders";
674
+ }, {
675
+ entryPoint: "insightsWidget";
676
+ widget: "cards-by-month" | "top-spenders";
677
+ }>, z.ZodObject<{
678
+ entryPoint: z.ZodLiteral<"onboarding">;
679
+ onboardingEntryPoint: z.ZodDefault<z.ZodEnum<["welcome", "application"]>>;
680
+ onboardingExitPoint: z.ZodDefault<z.ZodEnum<["application", "activation"]>>;
681
+ }, "strip", z.ZodTypeAny, {
682
+ entryPoint: "onboarding";
683
+ onboardingEntryPoint: "welcome" | "application";
684
+ onboardingExitPoint: "application" | "activation";
685
+ }, {
686
+ entryPoint: "onboarding";
687
+ onboardingEntryPoint?: "welcome" | "application" | undefined;
688
+ onboardingExitPoint?: "application" | "activation" | undefined;
689
+ }>, z.ZodObject<{
690
+ entryPoint: z.ZodLiteral<"cardsApp">;
691
+ }, "strip", z.ZodTypeAny, {
692
+ entryPoint: "cardsApp";
693
+ }, {
694
+ entryPoint: "cardsApp";
695
+ }>]>, z.ZodObject<{
696
+ referer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
697
+ }, "strip", z.ZodTypeAny, {
698
+ referer?: string | null | undefined;
699
+ }, {
700
+ referer?: string | null | undefined;
701
+ }>>;
399
702
 
400
703
  /**
401
704
  * connects to child iframe and returns whether the iframe is loaded or not.