@capitalos/react 1.3.4 → 1.4.5-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.
- package/dist/_tsup-dts-rollup.d.mts +1527 -1485
- package/dist/_tsup-dts-rollup.d.ts +1527 -1485
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +46 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/src/index.d.mts +0 -44
- package/dist/src/index.d.ts +0 -44
|
@@ -1,1485 +1,1527 @@
|
|
|
1
|
-
import { Connection } from 'penpal';
|
|
2
|
-
import { IFrameComponent } from 'iframe-resizer';
|
|
3
|
-
import { IFrameMessageData } from 'iframe-resizer';
|
|
4
|
-
import { IFrameOptions } from 'iframe-resizer';
|
|
5
|
-
import { IFrameResizedData } from 'iframe-resizer';
|
|
6
|
-
import { IFrameScrollData } from 'iframe-resizer';
|
|
7
|
-
import { default as React_2 } from 'react';
|
|
8
|
-
import { ReactNode } from 'react';
|
|
9
|
-
import { RefObject } from 'react';
|
|
10
|
-
import { z } from 'zod';
|
|
11
|
-
import * as z_2 from 'zod';
|
|
12
|
-
|
|
13
|
-
export declare type Account = {
|
|
14
|
-
status: AccountStatus;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Renders the CapitalOS Account Actions experience.
|
|
19
|
-
*/
|
|
20
|
-
export declare function AccountActions(props: AccountActionsProps): JSX.Element;
|
|
21
|
-
|
|
22
|
-
export declare type AccountActionsProps = CommonProps;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Renders the CapitalOS Account Details experience.
|
|
26
|
-
*/
|
|
27
|
-
export declare function AccountDetails(props: AccountDetailsProps): JSX.Element;
|
|
28
|
-
|
|
29
|
-
export declare type AccountDetailsProps = CommonProps;
|
|
30
|
-
|
|
31
|
-
export declare type AccountStatus = z_2.infer<typeof accountStatusSchema>;
|
|
32
|
-
|
|
33
|
-
declare const accountStatusSchema: z_2.ZodEnum<["eligible", "ineligible", "engaged", "onboarding", "approved", "processing", "pending", "declined", "closed", "waiting"]>;
|
|
34
|
-
|
|
35
|
-
export declare type ActionResult<T = void> = {
|
|
36
|
-
success: true;
|
|
37
|
-
canceled: false;
|
|
38
|
-
data: T;
|
|
39
|
-
} | {
|
|
40
|
-
success: false;
|
|
41
|
-
canceled: true;
|
|
42
|
-
} | {
|
|
43
|
-
success: false;
|
|
44
|
-
canceled: false;
|
|
45
|
-
error: CapitalOSError;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export declare const ActionsIframeContext: React_2.Context<ActionsIframeContextValue | null>;
|
|
49
|
-
|
|
50
|
-
declare interface ActionsIframeContextValue {
|
|
51
|
-
childFunctions: ChildFunctions | null;
|
|
52
|
-
actions: {
|
|
53
|
-
freezeCard: (cardId: string) => Promise<ActionResult<Card>>;
|
|
54
|
-
unfreezeCard: (cardId: string) => Promise<ActionResult<Card>>;
|
|
55
|
-
} | null;
|
|
56
|
-
isLoading: boolean;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export declare function ActionsIframeProvider({ children }: {
|
|
60
|
-
children: React_2.ReactNode;
|
|
61
|
-
}): JSX.Element;
|
|
62
|
-
|
|
63
|
-
declare type AllowedExitPoints = {
|
|
64
|
-
welcome: 'application' | 'activation';
|
|
65
|
-
application: 'application' | 'activation';
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/** @deprecated Use {@link CardsApp} instead */
|
|
69
|
-
export declare const App: typeof CardsApp;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Renders the CapitalOS Bill Payment Dashboard experience.
|
|
73
|
-
*/
|
|
74
|
-
export declare function BillPayApp(props: BillPayAppProps): JSX.Element;
|
|
75
|
-
|
|
76
|
-
export declare type BillPayAppProps = CommonProps;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Builds the iframe url from token data, rendering context, and theme.
|
|
80
|
-
*/
|
|
81
|
-
export declare function buildIframeUrl({ tokenData, renderingContext, theme, onError, }: {
|
|
82
|
-
tokenData: TokenData;
|
|
83
|
-
renderingContext: CapitalOsRenderingContext;
|
|
84
|
-
theme?: ThemeColorScheme | undefined;
|
|
85
|
-
onError?: ((error: Error) => void) | undefined;
|
|
86
|
-
}): string | undefined;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* The internal component that handles all the heavy lifting of connecting to the iframe and rendering the app.
|
|
90
|
-
* all user facing components are basically a syntactic sugar on top of this.
|
|
91
|
-
*/
|
|
92
|
-
export declare function CapitalOS<T extends CapitalOsRenderingContext>(props: CapitalOsProps<T>): JSX.Element;
|
|
93
|
-
|
|
94
|
-
declare type CapitalOsAuthenticationContextType = {
|
|
95
|
-
tokenData?: TokenData | undefined;
|
|
96
|
-
isLoading: boolean;
|
|
97
|
-
error?: Error | undefined;
|
|
98
|
-
/**
|
|
99
|
-
* Invalidates the current token..
|
|
100
|
-
* This is used when the iframe signals that the token has expired.
|
|
101
|
-
* The authentication flow will automatically refresh the token after invalidation.
|
|
102
|
-
*/
|
|
103
|
-
invalidateToken: () => void;
|
|
104
|
-
/**
|
|
105
|
-
* Optional flag indicating whether to log events to the console.
|
|
106
|
-
*/
|
|
107
|
-
enableLogging: boolean;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export declare type
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
limit
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
limit
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
limit
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
limit
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
amount: number;
|
|
200
|
-
limit?: number | undefined;
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
amount: number;
|
|
204
|
-
limit?: number | undefined;
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
amount: number;
|
|
208
|
-
limit?: number | undefined;
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
amount: number;
|
|
217
|
-
limit?: number | undefined;
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
amount: number;
|
|
221
|
-
limit?: number | undefined;
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
amount: number;
|
|
225
|
-
limit?: number | undefined;
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
id:
|
|
235
|
-
name:
|
|
236
|
-
logoUrl:
|
|
237
|
-
}, {
|
|
238
|
-
id: string;
|
|
239
|
-
name: string;
|
|
240
|
-
logoUrl: string | null;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
status: "
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
amount: number;
|
|
414
|
-
limit?: number | undefined;
|
|
415
|
-
};
|
|
416
|
-
|
|
417
|
-
amount: number;
|
|
418
|
-
limit?: number | undefined;
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
amount: number;
|
|
422
|
-
limit?: number | undefined;
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
amount: number;
|
|
477
|
-
limit?: number | undefined;
|
|
478
|
-
};
|
|
479
|
-
|
|
480
|
-
amount: number;
|
|
481
|
-
limit?: number | undefined;
|
|
482
|
-
};
|
|
483
|
-
|
|
484
|
-
amount: number;
|
|
485
|
-
limit?: number | undefined;
|
|
486
|
-
};
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
*
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
/**
|
|
559
|
-
*
|
|
560
|
-
*/
|
|
561
|
-
|
|
562
|
-
/**
|
|
563
|
-
*
|
|
564
|
-
*/
|
|
565
|
-
|
|
566
|
-
/**
|
|
567
|
-
* Callback to invoke when the
|
|
568
|
-
*/
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
success:
|
|
588
|
-
canceled:
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
/**
|
|
601
|
-
*
|
|
602
|
-
*/
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* Optional
|
|
606
|
-
*/
|
|
607
|
-
|
|
608
|
-
/**
|
|
609
|
-
* Optional
|
|
610
|
-
*/
|
|
611
|
-
|
|
612
|
-
/**
|
|
613
|
-
* Optional
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
*
|
|
651
|
-
*/
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
export
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
export declare type
|
|
716
|
-
|
|
717
|
-
export declare const
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
export declare
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
*
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
*
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
/**
|
|
814
|
-
*
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
export
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
export
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
/**
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
declare
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
};
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
};
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
}
|
|
1131
|
-
entryPoint: "
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
},
|
|
1137
|
-
entryPoint: "
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
entryPoint:
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
cardId
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
},
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
entryPoint: "
|
|
1251
|
-
}
|
|
1252
|
-
entryPoint:
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
entryPoint: "
|
|
1257
|
-
}, {
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
}, "strip", z.ZodTypeAny, {
|
|
1274
|
-
entryPoint: "
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
entryPoint:
|
|
1289
|
-
},
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
}, "strip", z.ZodTypeAny, {
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
export declare
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
*
|
|
1391
|
-
*
|
|
1392
|
-
*
|
|
1393
|
-
*
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
*
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
*
|
|
1446
|
-
*
|
|
1447
|
-
*/
|
|
1448
|
-
export declare function
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
/**
|
|
1456
|
-
*
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
*
|
|
1467
|
-
*
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
};
|
|
1484
|
-
|
|
1485
|
-
|
|
1
|
+
import { Connection } from 'penpal';
|
|
2
|
+
import { IFrameComponent } from 'iframe-resizer';
|
|
3
|
+
import { IFrameMessageData } from 'iframe-resizer';
|
|
4
|
+
import { IFrameOptions } from 'iframe-resizer';
|
|
5
|
+
import { IFrameResizedData } from 'iframe-resizer';
|
|
6
|
+
import { IFrameScrollData } from 'iframe-resizer';
|
|
7
|
+
import { default as React_2 } from 'react';
|
|
8
|
+
import { ReactNode } from 'react';
|
|
9
|
+
import { RefObject } from 'react';
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
import * as z_2 from 'zod';
|
|
12
|
+
|
|
13
|
+
export declare type Account = {
|
|
14
|
+
status: AccountStatus;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Renders the CapitalOS Account Actions experience.
|
|
19
|
+
*/
|
|
20
|
+
export declare function AccountActions(props: AccountActionsProps): JSX.Element;
|
|
21
|
+
|
|
22
|
+
export declare type AccountActionsProps = CommonProps;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Renders the CapitalOS Account Details experience.
|
|
26
|
+
*/
|
|
27
|
+
export declare function AccountDetails(props: AccountDetailsProps): JSX.Element;
|
|
28
|
+
|
|
29
|
+
export declare type AccountDetailsProps = CommonProps;
|
|
30
|
+
|
|
31
|
+
export declare type AccountStatus = z_2.infer<typeof accountStatusSchema>;
|
|
32
|
+
|
|
33
|
+
declare const accountStatusSchema: z_2.ZodEnum<["eligible", "ineligible", "engaged", "onboarding", "approved", "processing", "pending", "declined", "closed", "waiting"]>;
|
|
34
|
+
|
|
35
|
+
export declare type ActionResult<T = void> = {
|
|
36
|
+
success: true;
|
|
37
|
+
canceled: false;
|
|
38
|
+
data: T;
|
|
39
|
+
} | {
|
|
40
|
+
success: false;
|
|
41
|
+
canceled: true;
|
|
42
|
+
} | {
|
|
43
|
+
success: false;
|
|
44
|
+
canceled: false;
|
|
45
|
+
error: CapitalOSError;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export declare const ActionsIframeContext: React_2.Context<ActionsIframeContextValue | null>;
|
|
49
|
+
|
|
50
|
+
declare interface ActionsIframeContextValue {
|
|
51
|
+
childFunctions: ChildFunctions | null;
|
|
52
|
+
actions: {
|
|
53
|
+
freezeCard: (cardId: string) => Promise<ActionResult<Card>>;
|
|
54
|
+
unfreezeCard: (cardId: string) => Promise<ActionResult<Card>>;
|
|
55
|
+
} | null;
|
|
56
|
+
isLoading: boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export declare function ActionsIframeProvider({ children }: {
|
|
60
|
+
children: React_2.ReactNode;
|
|
61
|
+
}): JSX.Element;
|
|
62
|
+
|
|
63
|
+
declare type AllowedExitPoints = {
|
|
64
|
+
welcome: 'application' | 'activation';
|
|
65
|
+
application: 'application' | 'activation';
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** @deprecated Use {@link CardsApp} instead */
|
|
69
|
+
export declare const App: typeof CardsApp;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Renders the CapitalOS Bill Payment Dashboard experience.
|
|
73
|
+
*/
|
|
74
|
+
export declare function BillPayApp(props: BillPayAppProps): JSX.Element;
|
|
75
|
+
|
|
76
|
+
export declare type BillPayAppProps = CommonProps;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Builds the iframe url from token data, rendering context, and theme.
|
|
80
|
+
*/
|
|
81
|
+
export declare function buildIframeUrl({ tokenData, renderingContext, theme, onError, }: {
|
|
82
|
+
tokenData: TokenData;
|
|
83
|
+
renderingContext: CapitalOsRenderingContext;
|
|
84
|
+
theme?: ThemeColorScheme | undefined;
|
|
85
|
+
onError?: ((error: Error) => void) | undefined;
|
|
86
|
+
}): string | undefined;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The internal component that handles all the heavy lifting of connecting to the iframe and rendering the app.
|
|
90
|
+
* all user facing components are basically a syntactic sugar on top of this.
|
|
91
|
+
*/
|
|
92
|
+
export declare function CapitalOS<T extends CapitalOsRenderingContext>(props: CapitalOsProps<T>): JSX.Element;
|
|
93
|
+
|
|
94
|
+
declare type CapitalOsAuthenticationContextType = {
|
|
95
|
+
tokenData?: TokenData | undefined;
|
|
96
|
+
isLoading: boolean;
|
|
97
|
+
error?: Error | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Invalidates the current token..
|
|
100
|
+
* This is used when the iframe signals that the token has expired.
|
|
101
|
+
* The authentication flow will automatically refresh the token after invalidation.
|
|
102
|
+
*/
|
|
103
|
+
invalidateToken: () => void;
|
|
104
|
+
/**
|
|
105
|
+
* Optional flag indicating whether to log events to the console.
|
|
106
|
+
*/
|
|
107
|
+
enableLogging: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Optional logger for capturing all SDK logs including Penpal.
|
|
110
|
+
*/
|
|
111
|
+
logger?: Logger | undefined;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
declare const CapitalOsAuthenticationProvider: React_2.FC<ProviderProps>;
|
|
115
|
+
export { CapitalOsAuthenticationProvider }
|
|
116
|
+
export { CapitalOsAuthenticationProvider as CapitalOsAuthenticationProvider_alias_1 }
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Base class for all SDK errors
|
|
120
|
+
*/
|
|
121
|
+
export declare class CapitalOSError extends Error {
|
|
122
|
+
code: ErrorCode;
|
|
123
|
+
constructor({ message, code }: {
|
|
124
|
+
message: string;
|
|
125
|
+
code: ErrorCode;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
declare type CapitalOsProps<T extends CapitalOsRenderingContext> = CommonProps & {
|
|
130
|
+
renderingContext: T;
|
|
131
|
+
methods?: Partial<ParentFunctions>;
|
|
132
|
+
sizeWidth?: boolean;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export declare type CapitalOsRenderingContext = {
|
|
136
|
+
entryPoint?: EntryPoint;
|
|
137
|
+
referer?: string;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export declare type Card = {
|
|
141
|
+
status: 'active' | 'inactive' | 'canceled' | 'frozen';
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export declare type CardApiDto = z_2.infer<typeof cardApiDtoSchema>;
|
|
145
|
+
|
|
146
|
+
declare const cardApiDtoSchema: z_2.ZodObject<{
|
|
147
|
+
accountUserId: z_2.ZodNullable<z_2.ZodString>;
|
|
148
|
+
status: z_2.ZodEnum<["active", "inactive", "canceled", "frozen"]>;
|
|
149
|
+
id: z_2.ZodString;
|
|
150
|
+
last4: z_2.ZodString;
|
|
151
|
+
platformId: z_2.ZodString;
|
|
152
|
+
cardholderFirstName: z_2.ZodString;
|
|
153
|
+
cardholderLastName: z_2.ZodString;
|
|
154
|
+
cardholderPhoneNumber: z_2.ZodEffects<z_2.ZodString, string, string>;
|
|
155
|
+
nickname: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
|
|
156
|
+
spend: z_2.ZodObject<{
|
|
157
|
+
daily: z_2.ZodObject<{
|
|
158
|
+
limit: z_2.ZodOptional<z_2.ZodNumber>;
|
|
159
|
+
amount: z_2.ZodNumber;
|
|
160
|
+
}, "strip", z_2.ZodTypeAny, {
|
|
161
|
+
amount: number;
|
|
162
|
+
limit?: number | undefined;
|
|
163
|
+
}, {
|
|
164
|
+
amount: number;
|
|
165
|
+
limit?: number | undefined;
|
|
166
|
+
}>;
|
|
167
|
+
weekly: z_2.ZodObject<{
|
|
168
|
+
limit: z_2.ZodOptional<z_2.ZodNumber>;
|
|
169
|
+
amount: z_2.ZodNumber;
|
|
170
|
+
}, "strip", z_2.ZodTypeAny, {
|
|
171
|
+
amount: number;
|
|
172
|
+
limit?: number | undefined;
|
|
173
|
+
}, {
|
|
174
|
+
amount: number;
|
|
175
|
+
limit?: number | undefined;
|
|
176
|
+
}>;
|
|
177
|
+
monthly: z_2.ZodObject<{
|
|
178
|
+
limit: z_2.ZodOptional<z_2.ZodNumber>;
|
|
179
|
+
amount: z_2.ZodNumber;
|
|
180
|
+
}, "strip", z_2.ZodTypeAny, {
|
|
181
|
+
amount: number;
|
|
182
|
+
limit?: number | undefined;
|
|
183
|
+
}, {
|
|
184
|
+
amount: number;
|
|
185
|
+
limit?: number | undefined;
|
|
186
|
+
}>;
|
|
187
|
+
lifetime: z_2.ZodObject<{
|
|
188
|
+
limit: z_2.ZodOptional<z_2.ZodNumber>;
|
|
189
|
+
amount: z_2.ZodNumber;
|
|
190
|
+
}, "strip", z_2.ZodTypeAny, {
|
|
191
|
+
amount: number;
|
|
192
|
+
limit?: number | undefined;
|
|
193
|
+
}, {
|
|
194
|
+
amount: number;
|
|
195
|
+
limit?: number | undefined;
|
|
196
|
+
}>;
|
|
197
|
+
}, "strip", z_2.ZodTypeAny, {
|
|
198
|
+
daily: {
|
|
199
|
+
amount: number;
|
|
200
|
+
limit?: number | undefined;
|
|
201
|
+
};
|
|
202
|
+
weekly: {
|
|
203
|
+
amount: number;
|
|
204
|
+
limit?: number | undefined;
|
|
205
|
+
};
|
|
206
|
+
monthly: {
|
|
207
|
+
amount: number;
|
|
208
|
+
limit?: number | undefined;
|
|
209
|
+
};
|
|
210
|
+
lifetime: {
|
|
211
|
+
amount: number;
|
|
212
|
+
limit?: number | undefined;
|
|
213
|
+
};
|
|
214
|
+
}, {
|
|
215
|
+
daily: {
|
|
216
|
+
amount: number;
|
|
217
|
+
limit?: number | undefined;
|
|
218
|
+
};
|
|
219
|
+
weekly: {
|
|
220
|
+
amount: number;
|
|
221
|
+
limit?: number | undefined;
|
|
222
|
+
};
|
|
223
|
+
monthly: {
|
|
224
|
+
amount: number;
|
|
225
|
+
limit?: number | undefined;
|
|
226
|
+
};
|
|
227
|
+
lifetime: {
|
|
228
|
+
amount: number;
|
|
229
|
+
limit?: number | undefined;
|
|
230
|
+
};
|
|
231
|
+
}>;
|
|
232
|
+
allowedSpendCategories: z_2.ZodArray<z_2.ZodEnum<["advertisingAndMarketing", "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">;
|
|
233
|
+
allowedMerchants: z_2.ZodArray<z_2.ZodObject<{
|
|
234
|
+
id: z_2.ZodUnion<[z_2.ZodString, z_2.ZodString]>;
|
|
235
|
+
name: z_2.ZodString;
|
|
236
|
+
logoUrl: z_2.ZodNullable<z_2.ZodString>;
|
|
237
|
+
}, "strip", z_2.ZodTypeAny, {
|
|
238
|
+
id: string;
|
|
239
|
+
name: string;
|
|
240
|
+
logoUrl: string | null;
|
|
241
|
+
}, {
|
|
242
|
+
id: string;
|
|
243
|
+
name: string;
|
|
244
|
+
logoUrl: string | null;
|
|
245
|
+
}>, "many">;
|
|
246
|
+
physicalCard: z_2.ZodNullable<z_2.ZodObject<z_2.objectUtil.extendShape<{
|
|
247
|
+
status: z_2.ZodEnum<["active", "disabled", "canceled"]>;
|
|
248
|
+
shipment: z_2.ZodObject<{
|
|
249
|
+
address: z_2.ZodObject<{
|
|
250
|
+
addressLine1: z_2.ZodString;
|
|
251
|
+
addressLine2: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodEffects<z_2.ZodNullable<z_2.ZodString>, string | null, string | null>>>;
|
|
252
|
+
city: z_2.ZodString;
|
|
253
|
+
state: z_2.ZodEffects<z_2.ZodString, string, string>;
|
|
254
|
+
zipcode: z_2.ZodString;
|
|
255
|
+
}, "strip", z_2.ZodTypeAny, {
|
|
256
|
+
addressLine1: string;
|
|
257
|
+
city: string;
|
|
258
|
+
state: string;
|
|
259
|
+
zipcode: string;
|
|
260
|
+
addressLine2?: string | null | undefined;
|
|
261
|
+
}, {
|
|
262
|
+
addressLine1: string;
|
|
263
|
+
city: string;
|
|
264
|
+
state: string;
|
|
265
|
+
zipcode: string;
|
|
266
|
+
addressLine2?: string | null | undefined;
|
|
267
|
+
}>;
|
|
268
|
+
method: z_2.ZodEnum<["usps", "fedexPriorityOvernight", "fedexTwoDay"]>;
|
|
269
|
+
recipientName: z_2.ZodString;
|
|
270
|
+
returnReason: z_2.ZodNullable<z_2.ZodString>;
|
|
271
|
+
shippedAt: z_2.ZodNullable<z_2.ZodString>;
|
|
272
|
+
trackingUpdates: z_2.ZodArray<z_2.ZodObject<{
|
|
273
|
+
estimatedDeliveryAt: z_2.ZodNullable<z_2.ZodEffects<z_2.ZodUnion<[z_2.ZodString, z_2.ZodDate]>, string, string | Date>>;
|
|
274
|
+
trackingStatus: z_2.ZodEnum<["inTransit", "processedForDelivery", "delivered", "returnedToSender"]>;
|
|
275
|
+
city: z_2.ZodNullable<z_2.ZodString>;
|
|
276
|
+
createdAt: z_2.ZodEffects<z_2.ZodUnion<[z_2.ZodString, z_2.ZodDate]>, string, string | Date>;
|
|
277
|
+
zipcode: z_2.ZodNullable<z_2.ZodString>;
|
|
278
|
+
state: z_2.ZodNullable<z_2.ZodString>;
|
|
279
|
+
}, "strip", z_2.ZodTypeAny, {
|
|
280
|
+
city: string | null;
|
|
281
|
+
state: string | null;
|
|
282
|
+
zipcode: string | null;
|
|
283
|
+
estimatedDeliveryAt: string | null;
|
|
284
|
+
trackingStatus: "inTransit" | "processedForDelivery" | "delivered" | "returnedToSender";
|
|
285
|
+
createdAt: string;
|
|
286
|
+
}, {
|
|
287
|
+
city: string | null;
|
|
288
|
+
state: string | null;
|
|
289
|
+
zipcode: string | null;
|
|
290
|
+
estimatedDeliveryAt: string | Date | null;
|
|
291
|
+
trackingStatus: "inTransit" | "processedForDelivery" | "delivered" | "returnedToSender";
|
|
292
|
+
createdAt: string | Date;
|
|
293
|
+
}>, "many">;
|
|
294
|
+
status: z_2.ZodEnum<["canceled", "pending", "rejected", "returned", "shipped"]>;
|
|
295
|
+
trackingNumber: z_2.ZodNullable<z_2.ZodString>;
|
|
296
|
+
trackingUrl: z_2.ZodNullable<z_2.ZodString>;
|
|
297
|
+
}, "strip", z_2.ZodTypeAny, {
|
|
298
|
+
status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
|
|
299
|
+
method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
|
|
300
|
+
address: {
|
|
301
|
+
addressLine1: string;
|
|
302
|
+
city: string;
|
|
303
|
+
state: string;
|
|
304
|
+
zipcode: string;
|
|
305
|
+
addressLine2?: string | null | undefined;
|
|
306
|
+
};
|
|
307
|
+
recipientName: string;
|
|
308
|
+
returnReason: string | null;
|
|
309
|
+
shippedAt: string | null;
|
|
310
|
+
trackingUpdates: {
|
|
311
|
+
city: string | null;
|
|
312
|
+
state: string | null;
|
|
313
|
+
zipcode: string | null;
|
|
314
|
+
estimatedDeliveryAt: string | null;
|
|
315
|
+
trackingStatus: "inTransit" | "processedForDelivery" | "delivered" | "returnedToSender";
|
|
316
|
+
createdAt: string;
|
|
317
|
+
}[];
|
|
318
|
+
trackingNumber: string | null;
|
|
319
|
+
trackingUrl: string | null;
|
|
320
|
+
}, {
|
|
321
|
+
status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
|
|
322
|
+
method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
|
|
323
|
+
address: {
|
|
324
|
+
addressLine1: string;
|
|
325
|
+
city: string;
|
|
326
|
+
state: string;
|
|
327
|
+
zipcode: string;
|
|
328
|
+
addressLine2?: string | null | undefined;
|
|
329
|
+
};
|
|
330
|
+
recipientName: string;
|
|
331
|
+
returnReason: string | null;
|
|
332
|
+
shippedAt: string | null;
|
|
333
|
+
trackingUpdates: {
|
|
334
|
+
city: string | null;
|
|
335
|
+
state: string | null;
|
|
336
|
+
zipcode: string | null;
|
|
337
|
+
estimatedDeliveryAt: string | Date | null;
|
|
338
|
+
trackingStatus: "inTransit" | "processedForDelivery" | "delivered" | "returnedToSender";
|
|
339
|
+
createdAt: string | Date;
|
|
340
|
+
}[];
|
|
341
|
+
trackingNumber: string | null;
|
|
342
|
+
trackingUrl: string | null;
|
|
343
|
+
}>;
|
|
344
|
+
}, {
|
|
345
|
+
id: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
|
|
346
|
+
}>, "strip", z_2.ZodTypeAny, {
|
|
347
|
+
status: "active" | "canceled" | "disabled";
|
|
348
|
+
shipment: {
|
|
349
|
+
status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
|
|
350
|
+
method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
|
|
351
|
+
address: {
|
|
352
|
+
addressLine1: string;
|
|
353
|
+
city: string;
|
|
354
|
+
state: string;
|
|
355
|
+
zipcode: string;
|
|
356
|
+
addressLine2?: string | null | undefined;
|
|
357
|
+
};
|
|
358
|
+
recipientName: string;
|
|
359
|
+
returnReason: string | null;
|
|
360
|
+
shippedAt: string | null;
|
|
361
|
+
trackingUpdates: {
|
|
362
|
+
city: string | null;
|
|
363
|
+
state: string | null;
|
|
364
|
+
zipcode: string | null;
|
|
365
|
+
estimatedDeliveryAt: string | null;
|
|
366
|
+
trackingStatus: "inTransit" | "processedForDelivery" | "delivered" | "returnedToSender";
|
|
367
|
+
createdAt: string;
|
|
368
|
+
}[];
|
|
369
|
+
trackingNumber: string | null;
|
|
370
|
+
trackingUrl: string | null;
|
|
371
|
+
};
|
|
372
|
+
id?: string | null | undefined;
|
|
373
|
+
}, {
|
|
374
|
+
status: "active" | "canceled" | "disabled";
|
|
375
|
+
shipment: {
|
|
376
|
+
status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
|
|
377
|
+
method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
|
|
378
|
+
address: {
|
|
379
|
+
addressLine1: string;
|
|
380
|
+
city: string;
|
|
381
|
+
state: string;
|
|
382
|
+
zipcode: string;
|
|
383
|
+
addressLine2?: string | null | undefined;
|
|
384
|
+
};
|
|
385
|
+
recipientName: string;
|
|
386
|
+
returnReason: string | null;
|
|
387
|
+
shippedAt: string | null;
|
|
388
|
+
trackingUpdates: {
|
|
389
|
+
city: string | null;
|
|
390
|
+
state: string | null;
|
|
391
|
+
zipcode: string | null;
|
|
392
|
+
estimatedDeliveryAt: string | Date | null;
|
|
393
|
+
trackingStatus: "inTransit" | "processedForDelivery" | "delivered" | "returnedToSender";
|
|
394
|
+
createdAt: string | Date;
|
|
395
|
+
}[];
|
|
396
|
+
trackingNumber: string | null;
|
|
397
|
+
trackingUrl: string | null;
|
|
398
|
+
};
|
|
399
|
+
id?: string | null | undefined;
|
|
400
|
+
}>>;
|
|
401
|
+
cardSpendPolicyId: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
|
|
402
|
+
}, "strip", z_2.ZodTypeAny, {
|
|
403
|
+
status: "active" | "inactive" | "canceled" | "frozen";
|
|
404
|
+
id: string;
|
|
405
|
+
platformId: string;
|
|
406
|
+
accountUserId: string | null;
|
|
407
|
+
last4: string;
|
|
408
|
+
cardholderFirstName: string;
|
|
409
|
+
cardholderLastName: string;
|
|
410
|
+
cardholderPhoneNumber: string;
|
|
411
|
+
spend: {
|
|
412
|
+
daily: {
|
|
413
|
+
amount: number;
|
|
414
|
+
limit?: number | undefined;
|
|
415
|
+
};
|
|
416
|
+
weekly: {
|
|
417
|
+
amount: number;
|
|
418
|
+
limit?: number | undefined;
|
|
419
|
+
};
|
|
420
|
+
monthly: {
|
|
421
|
+
amount: number;
|
|
422
|
+
limit?: number | undefined;
|
|
423
|
+
};
|
|
424
|
+
lifetime: {
|
|
425
|
+
amount: number;
|
|
426
|
+
limit?: number | undefined;
|
|
427
|
+
};
|
|
428
|
+
};
|
|
429
|
+
allowedSpendCategories: ("other" | "advertisingAndMarketing" | "airlines" | "carRental" | "carService" | "education" | "electronics" | "gasPump" | "gasStation" | "generalMerchandise" | "government" | "hardwareAndConstruction" | "insurance" | "legal" | "lodging" | "medical" | "parking" | "phoneAndInternet" | "professionalServices" | "recreationAndEntertainment" | "restaurants" | "shipping" | "software" | "taxisAndRideshare" | "transportation" | "travelMisc" | "utilities")[];
|
|
430
|
+
allowedMerchants: {
|
|
431
|
+
id: string;
|
|
432
|
+
name: string;
|
|
433
|
+
logoUrl: string | null;
|
|
434
|
+
}[];
|
|
435
|
+
physicalCard: {
|
|
436
|
+
status: "active" | "canceled" | "disabled";
|
|
437
|
+
shipment: {
|
|
438
|
+
status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
|
|
439
|
+
method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
|
|
440
|
+
address: {
|
|
441
|
+
addressLine1: string;
|
|
442
|
+
city: string;
|
|
443
|
+
state: string;
|
|
444
|
+
zipcode: string;
|
|
445
|
+
addressLine2?: string | null | undefined;
|
|
446
|
+
};
|
|
447
|
+
recipientName: string;
|
|
448
|
+
returnReason: string | null;
|
|
449
|
+
shippedAt: string | null;
|
|
450
|
+
trackingUpdates: {
|
|
451
|
+
city: string | null;
|
|
452
|
+
state: string | null;
|
|
453
|
+
zipcode: string | null;
|
|
454
|
+
estimatedDeliveryAt: string | null;
|
|
455
|
+
trackingStatus: "inTransit" | "processedForDelivery" | "delivered" | "returnedToSender";
|
|
456
|
+
createdAt: string;
|
|
457
|
+
}[];
|
|
458
|
+
trackingNumber: string | null;
|
|
459
|
+
trackingUrl: string | null;
|
|
460
|
+
};
|
|
461
|
+
id?: string | null | undefined;
|
|
462
|
+
} | null;
|
|
463
|
+
nickname?: string | null | undefined;
|
|
464
|
+
cardSpendPolicyId?: string | null | undefined;
|
|
465
|
+
}, {
|
|
466
|
+
status: "active" | "inactive" | "canceled" | "frozen";
|
|
467
|
+
id: string;
|
|
468
|
+
platformId: string;
|
|
469
|
+
accountUserId: string | null;
|
|
470
|
+
last4: string;
|
|
471
|
+
cardholderFirstName: string;
|
|
472
|
+
cardholderLastName: string;
|
|
473
|
+
cardholderPhoneNumber: string;
|
|
474
|
+
spend: {
|
|
475
|
+
daily: {
|
|
476
|
+
amount: number;
|
|
477
|
+
limit?: number | undefined;
|
|
478
|
+
};
|
|
479
|
+
weekly: {
|
|
480
|
+
amount: number;
|
|
481
|
+
limit?: number | undefined;
|
|
482
|
+
};
|
|
483
|
+
monthly: {
|
|
484
|
+
amount: number;
|
|
485
|
+
limit?: number | undefined;
|
|
486
|
+
};
|
|
487
|
+
lifetime: {
|
|
488
|
+
amount: number;
|
|
489
|
+
limit?: number | undefined;
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
allowedSpendCategories: ("other" | "advertisingAndMarketing" | "airlines" | "carRental" | "carService" | "education" | "electronics" | "gasPump" | "gasStation" | "generalMerchandise" | "government" | "hardwareAndConstruction" | "insurance" | "legal" | "lodging" | "medical" | "parking" | "phoneAndInternet" | "professionalServices" | "recreationAndEntertainment" | "restaurants" | "shipping" | "software" | "taxisAndRideshare" | "transportation" | "travelMisc" | "utilities")[];
|
|
493
|
+
allowedMerchants: {
|
|
494
|
+
id: string;
|
|
495
|
+
name: string;
|
|
496
|
+
logoUrl: string | null;
|
|
497
|
+
}[];
|
|
498
|
+
physicalCard: {
|
|
499
|
+
status: "active" | "canceled" | "disabled";
|
|
500
|
+
shipment: {
|
|
501
|
+
status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
|
|
502
|
+
method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
|
|
503
|
+
address: {
|
|
504
|
+
addressLine1: string;
|
|
505
|
+
city: string;
|
|
506
|
+
state: string;
|
|
507
|
+
zipcode: string;
|
|
508
|
+
addressLine2?: string | null | undefined;
|
|
509
|
+
};
|
|
510
|
+
recipientName: string;
|
|
511
|
+
returnReason: string | null;
|
|
512
|
+
shippedAt: string | null;
|
|
513
|
+
trackingUpdates: {
|
|
514
|
+
city: string | null;
|
|
515
|
+
state: string | null;
|
|
516
|
+
zipcode: string | null;
|
|
517
|
+
estimatedDeliveryAt: string | Date | null;
|
|
518
|
+
trackingStatus: "inTransit" | "processedForDelivery" | "delivered" | "returnedToSender";
|
|
519
|
+
createdAt: string | Date;
|
|
520
|
+
}[];
|
|
521
|
+
trackingNumber: string | null;
|
|
522
|
+
trackingUrl: string | null;
|
|
523
|
+
};
|
|
524
|
+
id?: string | null | undefined;
|
|
525
|
+
} | null;
|
|
526
|
+
nickname?: string | null | undefined;
|
|
527
|
+
cardSpendPolicyId?: string | null | undefined;
|
|
528
|
+
}>;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Renders the CapitalOS Manage Card experience.
|
|
532
|
+
*/
|
|
533
|
+
export declare function CardDetails(props: CardDetailsProps): JSX.Element;
|
|
534
|
+
|
|
535
|
+
declare type CardDetailsConditionalProps = {
|
|
536
|
+
/**
|
|
537
|
+
* Whether to render only the card component, without the surrounding UI.
|
|
538
|
+
* @default false
|
|
539
|
+
*/
|
|
540
|
+
cardOnly?: false;
|
|
541
|
+
/** This prop can only be used when `cardOnly` is true. */
|
|
542
|
+
backOnly?: never;
|
|
543
|
+
} | {
|
|
544
|
+
/**
|
|
545
|
+
* Whether to render only the card component, without the surrounding UI.
|
|
546
|
+
* @default false
|
|
547
|
+
*/
|
|
548
|
+
cardOnly: true;
|
|
549
|
+
/**
|
|
550
|
+
* Whether to render only the back of the card.
|
|
551
|
+
* This is only applicable when `cardOnly` is true.
|
|
552
|
+
* @default false
|
|
553
|
+
*/
|
|
554
|
+
backOnly?: boolean;
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
export declare type CardDetailsProps = CommonProps & {
|
|
558
|
+
/**
|
|
559
|
+
* The ID of the card to manage.
|
|
560
|
+
*/
|
|
561
|
+
cardId: string;
|
|
562
|
+
/**
|
|
563
|
+
* Whether to hide the address on the back of the card.
|
|
564
|
+
*/
|
|
565
|
+
hideAddress?: boolean | undefined;
|
|
566
|
+
/**
|
|
567
|
+
* Callback to invoke when the card has been successfully canceled.
|
|
568
|
+
*/
|
|
569
|
+
onCardCanceled?: () => void;
|
|
570
|
+
/**
|
|
571
|
+
* Callback to invoke when the user requests to hide sensitive details.
|
|
572
|
+
*/
|
|
573
|
+
onHideSensitiveDetails?: () => void;
|
|
574
|
+
} & CardDetailsConditionalProps;
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Renders the CapitalOS CardsApp.
|
|
578
|
+
*/
|
|
579
|
+
export declare function CardsApp(props: CommonProps): JSX.Element;
|
|
580
|
+
|
|
581
|
+
export declare type ChildFunctions = {
|
|
582
|
+
freezeCard: (cardId: string) => Promise<ClientActionResult<Card>>;
|
|
583
|
+
unfreezeCard: (cardId: string) => Promise<ClientActionResult<Card>>;
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
export declare type ClientActionResult<T> = {
|
|
587
|
+
success: true;
|
|
588
|
+
canceled: false;
|
|
589
|
+
data: T;
|
|
590
|
+
} | {
|
|
591
|
+
success: false;
|
|
592
|
+
canceled: true;
|
|
593
|
+
} | {
|
|
594
|
+
success: false;
|
|
595
|
+
canceled: false;
|
|
596
|
+
error: string;
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
export declare type CommonProps = {
|
|
600
|
+
/**
|
|
601
|
+
* The token provided by initiate-login.
|
|
602
|
+
*/
|
|
603
|
+
token?: string;
|
|
604
|
+
/**
|
|
605
|
+
* Optional CSS class name for the component.
|
|
606
|
+
*/
|
|
607
|
+
className?: string;
|
|
608
|
+
/**
|
|
609
|
+
* Optional flag indicating whether to log events to the console.
|
|
610
|
+
*/
|
|
611
|
+
enableLogging?: boolean;
|
|
612
|
+
/**
|
|
613
|
+
* Optional logger to capture SDK logs.
|
|
614
|
+
* When provided, logs will be sent to this logger instead of console.
|
|
615
|
+
*/
|
|
616
|
+
logger?: Logger;
|
|
617
|
+
/**
|
|
618
|
+
* Optional callback for when the app encounters an error.
|
|
619
|
+
*/
|
|
620
|
+
onError?: (error: Error) => void;
|
|
621
|
+
/**
|
|
622
|
+
* Optional component to render while the app is loading.
|
|
623
|
+
*/
|
|
624
|
+
loadingComponent?: ReactNode;
|
|
625
|
+
/**
|
|
626
|
+
* Optional theme color scheme to apply to the app or component.
|
|
627
|
+
*/
|
|
628
|
+
theme?: ThemeColorScheme;
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Renders the CapitalOS Configure Autopay experience.
|
|
633
|
+
*/
|
|
634
|
+
export declare function ConfigureAutoPay({ onClose, ...restOfProps }: ConfigureAutoPayProps): JSX.Element;
|
|
635
|
+
|
|
636
|
+
export declare type ConfigureAutoPayProps = CommonProps & {
|
|
637
|
+
/**
|
|
638
|
+
* Callback to invoke when the user closes the autopay configuration screen.
|
|
639
|
+
*/
|
|
640
|
+
onClose: () => void;
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Renders the CapitalOS Connect To Vendors experience.
|
|
645
|
+
*/
|
|
646
|
+
export declare function ConnectToVendors({ cardId, onClose, inlineCardOnFile, ...restOfProps }: ConnectToVendorsProps): JSX.Element;
|
|
647
|
+
|
|
648
|
+
export declare type ConnectToVendorsProps = CommonProps & {
|
|
649
|
+
/**
|
|
650
|
+
* The ID of the card to connect to vendor services. If not provided, uses the default card.
|
|
651
|
+
*/
|
|
652
|
+
cardId?: string;
|
|
653
|
+
/**
|
|
654
|
+
* Callback to invoke when the user closes the connect to vendors screen.
|
|
655
|
+
*/
|
|
656
|
+
onClose: () => void;
|
|
657
|
+
/**
|
|
658
|
+
* Whether to render the card-on-file experience inline instead of opening it in a separate modal.
|
|
659
|
+
* When true, the card-on-file flow will replace the current content rather than stacking modals.
|
|
660
|
+
*/
|
|
661
|
+
inlineCardOnFile?: boolean;
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
export declare function ContactSupport({ onDone, onCancel, ...restOfProps }: ContactSupportProps): JSX.Element;
|
|
665
|
+
|
|
666
|
+
export declare type ContactSupportProps = CommonProps & {
|
|
667
|
+
onDone: () => void;
|
|
668
|
+
onCancel: () => void;
|
|
669
|
+
};
|
|
670
|
+
|
|
671
|
+
export declare function decodeOneTimeToken(token: string): any;
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Renders the CapitalOS Dev Tools experience.
|
|
675
|
+
* Allows for simulating transactions, etc.
|
|
676
|
+
*/
|
|
677
|
+
declare function DevTools(props: DevToolsProps): JSX.Element;
|
|
678
|
+
export { DevTools }
|
|
679
|
+
export { DevTools as DevTools_alias_1 }
|
|
680
|
+
|
|
681
|
+
export declare function DevToolsButton({ onClick, isLoading }: DevToolsButtonProps): JSX.Element;
|
|
682
|
+
|
|
683
|
+
declare interface DevToolsButtonProps {
|
|
684
|
+
onClick?: () => void;
|
|
685
|
+
isLoading?: boolean;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
export declare type DevToolsProps = CommonProps;
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* Renders the CapitalOS Dispute Transaction experience.
|
|
692
|
+
*/
|
|
693
|
+
export declare function DisputeTransaction({ transactionId, onDone, onCancel, ...restOfProps }: DisputeTransactionProps): JSX.Element;
|
|
694
|
+
|
|
695
|
+
export declare type DisputeTransactionProps = CommonProps & {
|
|
696
|
+
/**
|
|
697
|
+
* The ID of the transaction to dispute.
|
|
698
|
+
*/
|
|
699
|
+
transactionId: string;
|
|
700
|
+
/**
|
|
701
|
+
* Callback to invoke when the dispute was successfully submitted.
|
|
702
|
+
*/
|
|
703
|
+
onDone: () => void;
|
|
704
|
+
/**
|
|
705
|
+
* Callback to invoke when the user cancels the dispute submission.
|
|
706
|
+
*/
|
|
707
|
+
onCancel: () => void;
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Encodes the rendering context as base64 and then URI encodes it.
|
|
712
|
+
*/
|
|
713
|
+
export declare function encodeRenderingContext<T>(renderingContext: NonNullable<T>): string;
|
|
714
|
+
|
|
715
|
+
export declare type EntryPoint = RenderingContext_2['entryPoint'];
|
|
716
|
+
|
|
717
|
+
export declare const ErrorCode: {
|
|
718
|
+
readonly unauthorized: "unauthorized";
|
|
719
|
+
readonly invalid_account_status: "invalid_account_status";
|
|
720
|
+
readonly unsupported_entry_point: "unsupported_entry_point";
|
|
721
|
+
readonly internal_error: "internal_error";
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
export declare type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
725
|
+
|
|
726
|
+
export declare const IframeResizer: React_2.ForwardRefExoticComponent<Omit<IFrameOptions, "closedCallback" | "scrollCallback" | "resizedCallback" | "messageCallback" | "initCallback"> & {
|
|
727
|
+
onClosed?(iframeId: string): void;
|
|
728
|
+
onInit?(iframe: IFrameComponent): void;
|
|
729
|
+
onMessage?(data: IFrameMessageData): void;
|
|
730
|
+
onResized?(data: IFrameResizedData): void;
|
|
731
|
+
onScroll?(data: IFrameScrollData): boolean;
|
|
732
|
+
} & React_2.IframeHTMLAttributes<HTMLIFrameElement> & React_2.RefAttributes<HTMLIFrameElement>>;
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Renders the CapitalOS Insights Dashboard experience
|
|
736
|
+
*/
|
|
737
|
+
export declare function InsightsDashboard(props: InsightsDashboardProps): JSX.Element;
|
|
738
|
+
|
|
739
|
+
export declare type InsightsDashboardProps = CommonProps;
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* Renders a specific CapitalOS Insights Widget
|
|
743
|
+
*/
|
|
744
|
+
export declare function InsightsWidget(props: InsightsWidgetProps): JSX.Element;
|
|
745
|
+
|
|
746
|
+
export declare type InsightsWidgetProps = CommonProps & {
|
|
747
|
+
/**
|
|
748
|
+
* The specific widget to render.
|
|
749
|
+
* naming convention:
|
|
750
|
+
* 1. Over-time Widgets
|
|
751
|
+
* over-time-{metric}-by-{dimension}-per-{time-granularity}
|
|
752
|
+
* 2. Top/Ranking Widgets
|
|
753
|
+
* top-{entities}-by-{metric}-{timeframe}
|
|
754
|
+
* 3. Comparison Widgets
|
|
755
|
+
* comparison-{metric}-{primary-timeframe}-vs-{secondary-timeframe}
|
|
756
|
+
*/
|
|
757
|
+
widget: 'over-time-spend-by-card-per-month' | 'over-time-spend-by-category-per-month' | 'top-cards-by-spend-this-month' | 'top-categories-by-spend-this-month' | 'top-transactions-by-amount-this-month' | 'comparison-spend-this-month-vs-last-month';
|
|
758
|
+
/**
|
|
759
|
+
* Whether to hide the title of the widget.
|
|
760
|
+
*/
|
|
761
|
+
hideTitle?: boolean | undefined;
|
|
762
|
+
/**
|
|
763
|
+
* The height of the widget.
|
|
764
|
+
*/
|
|
765
|
+
height?: number | undefined;
|
|
766
|
+
/**
|
|
767
|
+
* The width of the widget.
|
|
768
|
+
*/
|
|
769
|
+
width?: number | undefined;
|
|
770
|
+
};
|
|
771
|
+
|
|
772
|
+
export declare const internalLogger: {
|
|
773
|
+
log: (message: string, options?: LoggerOptions) => void;
|
|
774
|
+
warn: (message: string, options?: LoggerOptions) => void;
|
|
775
|
+
error: (message: string, options?: LoggerOptions) => void;
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Represents an error that occurs when an invalid token is encountered.
|
|
780
|
+
*/
|
|
781
|
+
export declare class InvalidTokenError extends CapitalOSError {
|
|
782
|
+
constructor(message?: string);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* Renders the CapitalOS Issue Card experience.
|
|
787
|
+
*/
|
|
788
|
+
export declare function IssueCard({ cardholder, onDone, onCancel, ...restOfProps }: IssueCardProps): JSX.Element;
|
|
789
|
+
|
|
790
|
+
export declare type IssueCardDefaultValues = z.infer<typeof issueCardDefaultValuesSchema>;
|
|
791
|
+
|
|
792
|
+
declare const issueCardDefaultValuesSchema: z.ZodUnion<[z.ZodObject<{
|
|
793
|
+
firstName: z.ZodString;
|
|
794
|
+
lastName: z.ZodString;
|
|
795
|
+
phone: z.ZodString;
|
|
796
|
+
}, "strip", z.ZodTypeAny, {
|
|
797
|
+
firstName: string;
|
|
798
|
+
lastName: string;
|
|
799
|
+
phone: string;
|
|
800
|
+
}, {
|
|
801
|
+
firstName: string;
|
|
802
|
+
lastName: string;
|
|
803
|
+
phone: string;
|
|
804
|
+
}>, z.ZodObject<{
|
|
805
|
+
userId: z.ZodString;
|
|
806
|
+
}, "strip", z.ZodTypeAny, {
|
|
807
|
+
userId: string;
|
|
808
|
+
}, {
|
|
809
|
+
userId: string;
|
|
810
|
+
}>]>;
|
|
811
|
+
|
|
812
|
+
export declare type IssueCardProps = CommonProps & {
|
|
813
|
+
/**
|
|
814
|
+
* Default values to prefill the form with.
|
|
815
|
+
*
|
|
816
|
+
* 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.
|
|
817
|
+
*/
|
|
818
|
+
cardholder?: IssueCardDefaultValues;
|
|
819
|
+
/**
|
|
820
|
+
* Callback to invoke when the card was created successfully.
|
|
821
|
+
*
|
|
822
|
+
* @param result - Object containing the created card's ID
|
|
823
|
+
* @param result.cardId - The ID of the newly created card
|
|
824
|
+
*/
|
|
825
|
+
onDone: (result: {
|
|
826
|
+
cardId: string;
|
|
827
|
+
}) => void;
|
|
828
|
+
/**
|
|
829
|
+
* Callback to invoke when the card creation was cancelled by the user.
|
|
830
|
+
*/
|
|
831
|
+
onCancel: () => void;
|
|
832
|
+
};
|
|
833
|
+
|
|
834
|
+
export declare function LegalDocuments({ onDone, ...restOfProps }: LegalDocumentsProps): JSX.Element;
|
|
835
|
+
|
|
836
|
+
export declare type LegalDocumentsProps = CommonProps & {
|
|
837
|
+
onDone: () => void;
|
|
838
|
+
};
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
* Logger interface for capturing SDK logs.
|
|
842
|
+
* If provided, all SDK logs (including Penpal communication logs) will be sent to this logger.
|
|
843
|
+
*/
|
|
844
|
+
declare type Logger = {
|
|
845
|
+
[LogLevel_2.log]: (message: string) => void;
|
|
846
|
+
[LogLevel_2.warn]: (message: string) => void;
|
|
847
|
+
[LogLevel_2.error]: (message: string) => void;
|
|
848
|
+
};
|
|
849
|
+
export { Logger }
|
|
850
|
+
export { Logger as Logger_alias_1 }
|
|
851
|
+
|
|
852
|
+
declare type LoggerOptions = {
|
|
853
|
+
enableLogging: boolean | undefined;
|
|
854
|
+
logger?: Logger | undefined;
|
|
855
|
+
};
|
|
856
|
+
|
|
857
|
+
declare type LogLevel = (typeof LogLevel_2)[keyof typeof LogLevel_2];
|
|
858
|
+
export { LogLevel }
|
|
859
|
+
export { LogLevel as LogLevel_alias_1 }
|
|
860
|
+
|
|
861
|
+
declare const LogLevel_2: {
|
|
862
|
+
readonly log: "log";
|
|
863
|
+
readonly warn: "warn";
|
|
864
|
+
readonly error: "error";
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
declare type LogLevel = (typeof LogLevel_2)[keyof typeof LogLevel_2];
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Renders the CapitalOS Make a Payment experience.
|
|
871
|
+
*/
|
|
872
|
+
export declare function MakePayment({ onDone, ...restOfProps }: MakePaymentProps): JSX.Element;
|
|
873
|
+
|
|
874
|
+
export declare type MakePaymentProps = CommonProps & {
|
|
875
|
+
/**
|
|
876
|
+
* Callback to invoke when the payment was made successfully.
|
|
877
|
+
*/
|
|
878
|
+
onDone: () => void;
|
|
879
|
+
};
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* Renders the CapitalOS Manage Bank Connections experience.
|
|
883
|
+
*/
|
|
884
|
+
export declare function ManageBankConnections({ onClose, ...restOfProps }: ManageBankConnectionsProps): JSX.Element;
|
|
885
|
+
|
|
886
|
+
export declare type ManageBankConnectionsProps = CommonProps & {
|
|
887
|
+
/**
|
|
888
|
+
* Callback to invoke when the user closes the bank connections management interface.
|
|
889
|
+
*/
|
|
890
|
+
onClose: () => void;
|
|
891
|
+
};
|
|
892
|
+
|
|
893
|
+
export declare function Mfa({ onDone, onCancel, mfaId, destination, codeLength, canResendAfter, operationName, ...restOfProps }: MfaProps): JSX.Element;
|
|
894
|
+
|
|
895
|
+
export declare type MfaActionResult = ActionResult<void>;
|
|
896
|
+
|
|
897
|
+
export declare type MfaProps = CommonProps & {
|
|
898
|
+
/**
|
|
899
|
+
* The ID of the MFA request.
|
|
900
|
+
*/
|
|
901
|
+
mfaId: string;
|
|
902
|
+
/**
|
|
903
|
+
* The destination of the MFA request.
|
|
904
|
+
*/
|
|
905
|
+
destination: string;
|
|
906
|
+
/**
|
|
907
|
+
* The length of the code to be entered.
|
|
908
|
+
*/
|
|
909
|
+
codeLength: number;
|
|
910
|
+
/**
|
|
911
|
+
* ISO string representation of DateTime in UTC
|
|
912
|
+
*/
|
|
913
|
+
canResendAfter: string;
|
|
914
|
+
/**
|
|
915
|
+
* The name of the operation that is being performed.
|
|
916
|
+
*/
|
|
917
|
+
operationName?: string;
|
|
918
|
+
/**
|
|
919
|
+
* Callback to invoke when the MFA was successfully completed.
|
|
920
|
+
*/
|
|
921
|
+
onDone: () => void;
|
|
922
|
+
/**
|
|
923
|
+
* Callback to invoke when the MFA was cancelled by the user.
|
|
924
|
+
*/
|
|
925
|
+
onCancel: () => void;
|
|
926
|
+
};
|
|
927
|
+
|
|
928
|
+
export declare interface MfaRequestContext {
|
|
929
|
+
mfaId: string;
|
|
930
|
+
destination: string;
|
|
931
|
+
codeLength: number;
|
|
932
|
+
canResendAfter: string;
|
|
933
|
+
operationName?: string;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
export declare interface MfaResult {
|
|
937
|
+
success: boolean;
|
|
938
|
+
canceled?: boolean;
|
|
939
|
+
error?: string;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
declare interface MfaState {
|
|
943
|
+
context: MfaRequestContext;
|
|
944
|
+
resolve: (result: MfaActionResult) => void;
|
|
945
|
+
reject: (error: Error) => void;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* Generic modal component that displays content with backdrop/blur
|
|
950
|
+
*/
|
|
951
|
+
export declare function Modal({ onClose, children, ariaLabel }: ModalProps): JSX.Element;
|
|
952
|
+
|
|
953
|
+
export declare interface ModalProps {
|
|
954
|
+
/**
|
|
955
|
+
* Callback when modal should be closed (backdrop click)
|
|
956
|
+
*/
|
|
957
|
+
onClose: () => void;
|
|
958
|
+
/**
|
|
959
|
+
* Content to render inside the modal
|
|
960
|
+
*/
|
|
961
|
+
children: ReactNode;
|
|
962
|
+
/**
|
|
963
|
+
* Accessible label for screen readers
|
|
964
|
+
*/
|
|
965
|
+
ariaLabel?: string;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
export declare function Onboarding<T extends OnboardingEntryPoint>({ onDone, entryPoint: onboardingEntryPoint, exitPoint: onboardingExitPoint, ...restOfProps }: OnboardingProps<T>): JSX.Element;
|
|
969
|
+
|
|
970
|
+
declare type OnboardingEntryPoint = keyof AllowedExitPoints;
|
|
971
|
+
|
|
972
|
+
declare type OnboardingProps<T extends keyof AllowedExitPoints> = CommonProps & {
|
|
973
|
+
entryPoint?: T;
|
|
974
|
+
exitPoint?: AllowedExitPoints[T];
|
|
975
|
+
onDone: (account: Account) => void;
|
|
976
|
+
};
|
|
977
|
+
|
|
978
|
+
export declare type ParentFunctions = {
|
|
979
|
+
onLoad: () => void;
|
|
980
|
+
onError: (error: RawErrorDetails) => void;
|
|
981
|
+
/**
|
|
982
|
+
* Called when the iframe detects that the JWT token has expired.
|
|
983
|
+
* This triggers the token refresh flow, which will obtain a new token
|
|
984
|
+
* and reload the iframe with the fresh token.
|
|
985
|
+
*/
|
|
986
|
+
onTokenExpired?: () => void;
|
|
987
|
+
cardDetails?: {
|
|
988
|
+
onCardCanceled?: () => void;
|
|
989
|
+
onHideSensitiveDetails?: () => void;
|
|
990
|
+
};
|
|
991
|
+
contactSupport?: {
|
|
992
|
+
onDone?: () => void;
|
|
993
|
+
onCancel?: () => void;
|
|
994
|
+
};
|
|
995
|
+
createCard?: {
|
|
996
|
+
onDone?: (result: {
|
|
997
|
+
cardId: string;
|
|
998
|
+
}) => void;
|
|
999
|
+
onCancel?: () => void;
|
|
1000
|
+
};
|
|
1001
|
+
createDispute?: {
|
|
1002
|
+
onDone?: () => void;
|
|
1003
|
+
onCancel?: () => void;
|
|
1004
|
+
};
|
|
1005
|
+
devTools?: {
|
|
1006
|
+
onClose?: () => void;
|
|
1007
|
+
};
|
|
1008
|
+
legalDocuments?: {
|
|
1009
|
+
onDone?: () => void;
|
|
1010
|
+
};
|
|
1011
|
+
makePayment?: {
|
|
1012
|
+
onDone?: () => void;
|
|
1013
|
+
};
|
|
1014
|
+
manageBankConnections?: {
|
|
1015
|
+
onClose?: () => void;
|
|
1016
|
+
};
|
|
1017
|
+
configureAutoPay?: {
|
|
1018
|
+
onClose?: () => void;
|
|
1019
|
+
};
|
|
1020
|
+
policySettings?: {
|
|
1021
|
+
onClose?: () => void;
|
|
1022
|
+
};
|
|
1023
|
+
connectToVendors?: {
|
|
1024
|
+
onClose?: () => void;
|
|
1025
|
+
};
|
|
1026
|
+
mfa?: {
|
|
1027
|
+
onDone?: () => void;
|
|
1028
|
+
onCancel?: () => void;
|
|
1029
|
+
};
|
|
1030
|
+
onboarding?: {
|
|
1031
|
+
onDone?: (account: Account) => void;
|
|
1032
|
+
};
|
|
1033
|
+
replaceCard?: {
|
|
1034
|
+
onDone?: (result: {
|
|
1035
|
+
oldCardId: string;
|
|
1036
|
+
newCardId: string;
|
|
1037
|
+
}) => void;
|
|
1038
|
+
onClose?: () => void;
|
|
1039
|
+
};
|
|
1040
|
+
'system-messages'?: {
|
|
1041
|
+
requestMfa?: (context: MfaRequestContext) => Promise<MfaResult>;
|
|
1042
|
+
};
|
|
1043
|
+
statements?: {
|
|
1044
|
+
onDone?: () => void;
|
|
1045
|
+
};
|
|
1046
|
+
terminateCard?: {
|
|
1047
|
+
onDone?: () => void;
|
|
1048
|
+
onClose?: () => void;
|
|
1049
|
+
};
|
|
1050
|
+
tokenExchange?: {
|
|
1051
|
+
onLongLivedToken?: (jwtToken: string) => void;
|
|
1052
|
+
};
|
|
1053
|
+
};
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* Renders the CapitalOS Policy Settings experience.
|
|
1057
|
+
*/
|
|
1058
|
+
export declare function PolicySettings({ onClose, ...restOfProps }: PolicySettingsProps): JSX.Element;
|
|
1059
|
+
|
|
1060
|
+
export declare type PolicySettingsProps = CommonProps & {
|
|
1061
|
+
/**
|
|
1062
|
+
* Callback to invoke when the user closes the policy settings screen.
|
|
1063
|
+
*/
|
|
1064
|
+
onClose: () => void;
|
|
1065
|
+
};
|
|
1066
|
+
|
|
1067
|
+
declare type ProviderProps = {
|
|
1068
|
+
getToken: () => Promise<string>;
|
|
1069
|
+
enableLogging?: boolean | undefined;
|
|
1070
|
+
logger?: Logger | undefined;
|
|
1071
|
+
children: React_2.ReactNode;
|
|
1072
|
+
};
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* An error type providing a reason code and message.
|
|
1076
|
+
* Penpal only passes plain objects, so this does not inherit from Error.
|
|
1077
|
+
*/
|
|
1078
|
+
export declare type RawErrorDetails = {
|
|
1079
|
+
code: ErrorCode;
|
|
1080
|
+
message: string;
|
|
1081
|
+
};
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* Redacts token values from a string, keeping first 4 and last 4 characters for debugging
|
|
1085
|
+
* Safe to use - will not throw even with malformed input
|
|
1086
|
+
*/
|
|
1087
|
+
export declare function redactToken(str: string): string;
|
|
1088
|
+
|
|
1089
|
+
declare type RenderingContext_2 = z.infer<typeof renderingContextSchema>;
|
|
1090
|
+
|
|
1091
|
+
declare const renderingContextSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<"entryPoint", [z.ZodObject<{
|
|
1092
|
+
entryPoint: z.ZodLiteral<"createCard">;
|
|
1093
|
+
cardholder: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodObject<{
|
|
1094
|
+
firstName: z.ZodString;
|
|
1095
|
+
lastName: z.ZodString;
|
|
1096
|
+
phone: z.ZodString;
|
|
1097
|
+
}, "strip", z.ZodTypeAny, {
|
|
1098
|
+
firstName: string;
|
|
1099
|
+
lastName: string;
|
|
1100
|
+
phone: string;
|
|
1101
|
+
}, {
|
|
1102
|
+
firstName: string;
|
|
1103
|
+
lastName: string;
|
|
1104
|
+
phone: string;
|
|
1105
|
+
}>, z.ZodObject<{
|
|
1106
|
+
userId: z.ZodString;
|
|
1107
|
+
}, "strip", z.ZodTypeAny, {
|
|
1108
|
+
userId: string;
|
|
1109
|
+
}, {
|
|
1110
|
+
userId: string;
|
|
1111
|
+
}>]>>>;
|
|
1112
|
+
}, "strip", z.ZodTypeAny, {
|
|
1113
|
+
entryPoint: "createCard";
|
|
1114
|
+
cardholder?: {
|
|
1115
|
+
firstName: string;
|
|
1116
|
+
lastName: string;
|
|
1117
|
+
phone: string;
|
|
1118
|
+
} | {
|
|
1119
|
+
userId: string;
|
|
1120
|
+
} | null | undefined;
|
|
1121
|
+
}, {
|
|
1122
|
+
entryPoint: "createCard";
|
|
1123
|
+
cardholder?: {
|
|
1124
|
+
firstName: string;
|
|
1125
|
+
lastName: string;
|
|
1126
|
+
phone: string;
|
|
1127
|
+
} | {
|
|
1128
|
+
userId: string;
|
|
1129
|
+
} | null | undefined;
|
|
1130
|
+
}>, z.ZodObject<{
|
|
1131
|
+
entryPoint: z.ZodLiteral<"createDispute">;
|
|
1132
|
+
transactionId: z.ZodString;
|
|
1133
|
+
}, "strip", z.ZodTypeAny, {
|
|
1134
|
+
entryPoint: "createDispute";
|
|
1135
|
+
transactionId: string;
|
|
1136
|
+
}, {
|
|
1137
|
+
entryPoint: "createDispute";
|
|
1138
|
+
transactionId: string;
|
|
1139
|
+
}>, z.ZodObject<{
|
|
1140
|
+
entryPoint: z.ZodLiteral<"billPayApp">;
|
|
1141
|
+
}, "strip", z.ZodTypeAny, {
|
|
1142
|
+
entryPoint: "billPayApp";
|
|
1143
|
+
}, {
|
|
1144
|
+
entryPoint: "billPayApp";
|
|
1145
|
+
}>, z.ZodObject<{
|
|
1146
|
+
entryPoint: z.ZodLiteral<"cardDetails">;
|
|
1147
|
+
cardId: z.ZodString;
|
|
1148
|
+
cardOnly: z.ZodOptional<z.ZodBoolean>;
|
|
1149
|
+
hideAddress: z.ZodOptional<z.ZodBoolean>;
|
|
1150
|
+
backOnly: z.ZodOptional<z.ZodBoolean>;
|
|
1151
|
+
}, "strip", z.ZodTypeAny, {
|
|
1152
|
+
cardId: string;
|
|
1153
|
+
entryPoint: "cardDetails";
|
|
1154
|
+
cardOnly?: boolean | undefined;
|
|
1155
|
+
hideAddress?: boolean | undefined;
|
|
1156
|
+
backOnly?: boolean | undefined;
|
|
1157
|
+
}, {
|
|
1158
|
+
cardId: string;
|
|
1159
|
+
entryPoint: "cardDetails";
|
|
1160
|
+
cardOnly?: boolean | undefined;
|
|
1161
|
+
hideAddress?: boolean | undefined;
|
|
1162
|
+
backOnly?: boolean | undefined;
|
|
1163
|
+
}>, z.ZodObject<{
|
|
1164
|
+
entryPoint: z.ZodLiteral<"accountDetails">;
|
|
1165
|
+
}, "strip", z.ZodTypeAny, {
|
|
1166
|
+
entryPoint: "accountDetails";
|
|
1167
|
+
}, {
|
|
1168
|
+
entryPoint: "accountDetails";
|
|
1169
|
+
}>, z.ZodObject<{
|
|
1170
|
+
entryPoint: z.ZodLiteral<"accountActions">;
|
|
1171
|
+
}, "strip", z.ZodTypeAny, {
|
|
1172
|
+
entryPoint: "accountActions";
|
|
1173
|
+
}, {
|
|
1174
|
+
entryPoint: "accountActions";
|
|
1175
|
+
}>, z.ZodObject<{
|
|
1176
|
+
entryPoint: z.ZodLiteral<"manageBankConnections">;
|
|
1177
|
+
}, "strip", z.ZodTypeAny, {
|
|
1178
|
+
entryPoint: "manageBankConnections";
|
|
1179
|
+
}, {
|
|
1180
|
+
entryPoint: "manageBankConnections";
|
|
1181
|
+
}>, z.ZodObject<{
|
|
1182
|
+
entryPoint: z.ZodLiteral<"configureAutoPay">;
|
|
1183
|
+
}, "strip", z.ZodTypeAny, {
|
|
1184
|
+
entryPoint: "configureAutoPay";
|
|
1185
|
+
}, {
|
|
1186
|
+
entryPoint: "configureAutoPay";
|
|
1187
|
+
}>, z.ZodObject<{
|
|
1188
|
+
entryPoint: z.ZodLiteral<"policySettings">;
|
|
1189
|
+
}, "strip", z.ZodTypeAny, {
|
|
1190
|
+
entryPoint: "policySettings";
|
|
1191
|
+
}, {
|
|
1192
|
+
entryPoint: "policySettings";
|
|
1193
|
+
}>, z.ZodObject<{
|
|
1194
|
+
entryPoint: z.ZodLiteral<"connectToVendors">;
|
|
1195
|
+
cardId: z.ZodOptional<z.ZodString>;
|
|
1196
|
+
inlineCardOnFile: z.ZodOptional<z.ZodBoolean>;
|
|
1197
|
+
}, "strip", z.ZodTypeAny, {
|
|
1198
|
+
entryPoint: "connectToVendors";
|
|
1199
|
+
cardId?: string | undefined;
|
|
1200
|
+
inlineCardOnFile?: boolean | undefined;
|
|
1201
|
+
}, {
|
|
1202
|
+
entryPoint: "connectToVendors";
|
|
1203
|
+
cardId?: string | undefined;
|
|
1204
|
+
inlineCardOnFile?: boolean | undefined;
|
|
1205
|
+
}>, z.ZodObject<{
|
|
1206
|
+
entryPoint: z.ZodLiteral<"insightsDashboard">;
|
|
1207
|
+
}, "strip", z.ZodTypeAny, {
|
|
1208
|
+
entryPoint: "insightsDashboard";
|
|
1209
|
+
}, {
|
|
1210
|
+
entryPoint: "insightsDashboard";
|
|
1211
|
+
}>, z.ZodObject<{
|
|
1212
|
+
entryPoint: z.ZodLiteral<"insightsWidget">;
|
|
1213
|
+
widget: z.ZodEnum<["over-time-spend-by-card-per-month", "over-time-spend-by-category-per-month", "top-cards-by-spend-this-month", "top-categories-by-spend-this-month", "top-transactions-by-amount-this-month", "comparison-spend-this-month-vs-last-month"]>;
|
|
1214
|
+
hideTitle: z.ZodOptional<z.ZodBoolean>;
|
|
1215
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
1216
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
1217
|
+
}, "strip", z.ZodTypeAny, {
|
|
1218
|
+
entryPoint: "insightsWidget";
|
|
1219
|
+
widget: "over-time-spend-by-card-per-month" | "over-time-spend-by-category-per-month" | "top-cards-by-spend-this-month" | "top-categories-by-spend-this-month" | "top-transactions-by-amount-this-month" | "comparison-spend-this-month-vs-last-month";
|
|
1220
|
+
hideTitle?: boolean | undefined;
|
|
1221
|
+
height?: number | undefined;
|
|
1222
|
+
width?: number | undefined;
|
|
1223
|
+
}, {
|
|
1224
|
+
entryPoint: "insightsWidget";
|
|
1225
|
+
widget: "over-time-spend-by-card-per-month" | "over-time-spend-by-category-per-month" | "top-cards-by-spend-this-month" | "top-categories-by-spend-this-month" | "top-transactions-by-amount-this-month" | "comparison-spend-this-month-vs-last-month";
|
|
1226
|
+
hideTitle?: boolean | undefined;
|
|
1227
|
+
height?: number | undefined;
|
|
1228
|
+
width?: number | undefined;
|
|
1229
|
+
}>, z.ZodObject<{
|
|
1230
|
+
entryPoint: z.ZodLiteral<"onboarding">;
|
|
1231
|
+
onboardingEntryPoint: z.ZodDefault<z.ZodEnum<["welcome", "application"]>>;
|
|
1232
|
+
onboardingExitPoint: z.ZodDefault<z.ZodEnum<["application", "activation"]>>;
|
|
1233
|
+
}, "strip", z.ZodTypeAny, {
|
|
1234
|
+
entryPoint: "onboarding";
|
|
1235
|
+
onboardingEntryPoint: "welcome" | "application";
|
|
1236
|
+
onboardingExitPoint: "application" | "activation";
|
|
1237
|
+
}, {
|
|
1238
|
+
entryPoint: "onboarding";
|
|
1239
|
+
onboardingEntryPoint?: "welcome" | "application" | undefined;
|
|
1240
|
+
onboardingExitPoint?: "application" | "activation" | undefined;
|
|
1241
|
+
}>, z.ZodObject<{
|
|
1242
|
+
entryPoint: z.ZodLiteral<"cardsApp">;
|
|
1243
|
+
}, "strip", z.ZodTypeAny, {
|
|
1244
|
+
entryPoint: "cardsApp";
|
|
1245
|
+
}, {
|
|
1246
|
+
entryPoint: "cardsApp";
|
|
1247
|
+
}>, z.ZodObject<{
|
|
1248
|
+
entryPoint: z.ZodLiteral<"tokenExchange">;
|
|
1249
|
+
}, "strip", z.ZodTypeAny, {
|
|
1250
|
+
entryPoint: "tokenExchange";
|
|
1251
|
+
}, {
|
|
1252
|
+
entryPoint: "tokenExchange";
|
|
1253
|
+
}>, z.ZodObject<{
|
|
1254
|
+
entryPoint: z.ZodLiteral<"makePayment">;
|
|
1255
|
+
}, "strip", z.ZodTypeAny, {
|
|
1256
|
+
entryPoint: "makePayment";
|
|
1257
|
+
}, {
|
|
1258
|
+
entryPoint: "makePayment";
|
|
1259
|
+
}>, z.ZodObject<{
|
|
1260
|
+
entryPoint: z.ZodLiteral<"devTools">;
|
|
1261
|
+
}, "strip", z.ZodTypeAny, {
|
|
1262
|
+
entryPoint: "devTools";
|
|
1263
|
+
}, {
|
|
1264
|
+
entryPoint: "devTools";
|
|
1265
|
+
}>, z.ZodObject<{
|
|
1266
|
+
entryPoint: z.ZodLiteral<"contactSupport">;
|
|
1267
|
+
}, "strip", z.ZodTypeAny, {
|
|
1268
|
+
entryPoint: "contactSupport";
|
|
1269
|
+
}, {
|
|
1270
|
+
entryPoint: "contactSupport";
|
|
1271
|
+
}>, z.ZodObject<{
|
|
1272
|
+
entryPoint: z.ZodLiteral<"statements">;
|
|
1273
|
+
}, "strip", z.ZodTypeAny, {
|
|
1274
|
+
entryPoint: "statements";
|
|
1275
|
+
}, {
|
|
1276
|
+
entryPoint: "statements";
|
|
1277
|
+
}>, z.ZodObject<{
|
|
1278
|
+
entryPoint: z.ZodLiteral<"legalDocuments">;
|
|
1279
|
+
}, "strip", z.ZodTypeAny, {
|
|
1280
|
+
entryPoint: "legalDocuments";
|
|
1281
|
+
}, {
|
|
1282
|
+
entryPoint: "legalDocuments";
|
|
1283
|
+
}>, z.ZodObject<{
|
|
1284
|
+
entryPoint: z.ZodLiteral<"replaceCard">;
|
|
1285
|
+
cardId: z.ZodString;
|
|
1286
|
+
}, "strip", z.ZodTypeAny, {
|
|
1287
|
+
cardId: string;
|
|
1288
|
+
entryPoint: "replaceCard";
|
|
1289
|
+
}, {
|
|
1290
|
+
cardId: string;
|
|
1291
|
+
entryPoint: "replaceCard";
|
|
1292
|
+
}>, z.ZodObject<{
|
|
1293
|
+
entryPoint: z.ZodLiteral<"terminateCard">;
|
|
1294
|
+
cardId: z.ZodString;
|
|
1295
|
+
}, "strip", z.ZodTypeAny, {
|
|
1296
|
+
cardId: string;
|
|
1297
|
+
entryPoint: "terminateCard";
|
|
1298
|
+
}, {
|
|
1299
|
+
cardId: string;
|
|
1300
|
+
entryPoint: "terminateCard";
|
|
1301
|
+
}>, z.ZodObject<{
|
|
1302
|
+
entryPoint: z.ZodLiteral<"actions">;
|
|
1303
|
+
}, "strip", z.ZodTypeAny, {
|
|
1304
|
+
entryPoint: "actions";
|
|
1305
|
+
}, {
|
|
1306
|
+
entryPoint: "actions";
|
|
1307
|
+
}>, z.ZodObject<{
|
|
1308
|
+
entryPoint: z.ZodLiteral<"mfa">;
|
|
1309
|
+
mfaId: z.ZodString;
|
|
1310
|
+
destination: z.ZodString;
|
|
1311
|
+
codeLength: z.ZodNumber;
|
|
1312
|
+
canResendAfter: z.ZodString;
|
|
1313
|
+
operationName: z.ZodOptional<z.ZodString>;
|
|
1314
|
+
}, "strip", z.ZodTypeAny, {
|
|
1315
|
+
entryPoint: "mfa";
|
|
1316
|
+
mfaId: string;
|
|
1317
|
+
destination: string;
|
|
1318
|
+
codeLength: number;
|
|
1319
|
+
canResendAfter: string;
|
|
1320
|
+
operationName?: string | undefined;
|
|
1321
|
+
}, {
|
|
1322
|
+
entryPoint: "mfa";
|
|
1323
|
+
mfaId: string;
|
|
1324
|
+
destination: string;
|
|
1325
|
+
codeLength: number;
|
|
1326
|
+
canResendAfter: string;
|
|
1327
|
+
operationName?: string | undefined;
|
|
1328
|
+
}>, z.ZodObject<{
|
|
1329
|
+
entryPoint: z.ZodLiteral<"transactions">;
|
|
1330
|
+
}, "strip", z.ZodTypeAny, {
|
|
1331
|
+
entryPoint: "transactions";
|
|
1332
|
+
}, {
|
|
1333
|
+
entryPoint: "transactions";
|
|
1334
|
+
}>]>, z.ZodObject<{
|
|
1335
|
+
referer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1336
|
+
}, "strip", z.ZodTypeAny, {
|
|
1337
|
+
referer?: string | null | undefined;
|
|
1338
|
+
}, {
|
|
1339
|
+
referer?: string | null | undefined;
|
|
1340
|
+
}>>;
|
|
1341
|
+
|
|
1342
|
+
export declare function ReplaceCard({ cardId, onDone, onClose, ...restOfProps }: ReplaceCardProps): JSX.Element;
|
|
1343
|
+
|
|
1344
|
+
export declare type ReplaceCardProps = CommonProps & {
|
|
1345
|
+
cardId: string;
|
|
1346
|
+
onDone: (result: {
|
|
1347
|
+
oldCardId: string;
|
|
1348
|
+
newCardId: string;
|
|
1349
|
+
}) => void;
|
|
1350
|
+
onClose: () => void;
|
|
1351
|
+
};
|
|
1352
|
+
|
|
1353
|
+
/**
|
|
1354
|
+
* Safely decodes a URL component, handling potential errors
|
|
1355
|
+
*/
|
|
1356
|
+
export declare function safeDecodeURIComponent(str: string): string;
|
|
1357
|
+
|
|
1358
|
+
export declare function Statements({ onDone, ...restOfProps }: StatementsProps): JSX.Element;
|
|
1359
|
+
|
|
1360
|
+
export declare type StatementsProps = CommonProps & {
|
|
1361
|
+
onDone: () => void;
|
|
1362
|
+
};
|
|
1363
|
+
|
|
1364
|
+
export declare function TerminateCard({ cardId, onDone, onClose, ...restOfProps }: TerminateCardProps): JSX.Element;
|
|
1365
|
+
|
|
1366
|
+
export declare type TerminateCardProps = CommonProps & {
|
|
1367
|
+
cardId: string;
|
|
1368
|
+
onDone: () => void;
|
|
1369
|
+
onClose: () => void;
|
|
1370
|
+
};
|
|
1371
|
+
|
|
1372
|
+
export declare type ThemeColorScheme = 'light' | 'dark' | 'system';
|
|
1373
|
+
|
|
1374
|
+
export declare type TokenData = {
|
|
1375
|
+
token: string;
|
|
1376
|
+
tokenType: TokenType;
|
|
1377
|
+
baseUrl: string;
|
|
1378
|
+
paramKey: TokenParamKey;
|
|
1379
|
+
paramLocation: TokenParamLocation;
|
|
1380
|
+
};
|
|
1381
|
+
|
|
1382
|
+
export declare function tokenDataFromOneTimeToken(oneTimeToken: string): TokenData;
|
|
1383
|
+
|
|
1384
|
+
/**
|
|
1385
|
+
* The component is hidden from the user and is only used to exchange a one-time token for a JWT in the authentication context.
|
|
1386
|
+
*
|
|
1387
|
+
* The token exchange process works as follows:
|
|
1388
|
+
* 1. Component renders a hidden iframe with the one-time token in the URL
|
|
1389
|
+
* 2. The iframe loads with the long-lived token as part of its url redirect response and establishes a secure connection with the parent window
|
|
1390
|
+
* 3. The iframe passes the long-lived token to the parent via postMessage
|
|
1391
|
+
* 4. onExchangeComplete callback is triggered with the new JWT
|
|
1392
|
+
*
|
|
1393
|
+
* If any errors occur during this process, they are passed to onExchangeError.
|
|
1394
|
+
*/
|
|
1395
|
+
export declare function TokenExchangeIframe(props: TokenExchangeIframeProps): JSX.Element;
|
|
1396
|
+
|
|
1397
|
+
export declare interface TokenExchangeIframeProps {
|
|
1398
|
+
oneTimeToken: string;
|
|
1399
|
+
enableLogging?: boolean | undefined;
|
|
1400
|
+
onExchangeComplete: (jwtToken: string) => void;
|
|
1401
|
+
onExchangeError?: (error: Error) => void;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
export declare enum TokenParamKey {
|
|
1405
|
+
token = "token",
|
|
1406
|
+
accessToken = "access_token"
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
export declare enum TokenParamLocation {
|
|
1410
|
+
search = "search",
|
|
1411
|
+
hash = "hash"
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
export declare class TokenRefreshError extends CapitalOSError {
|
|
1415
|
+
constructor(originalError?: Error);
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
export declare enum TokenType {
|
|
1419
|
+
oneTime = "oneTime",
|
|
1420
|
+
longLived = "longLived"
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
/**
|
|
1424
|
+
* Renders the CapitalOS Transactions experience.
|
|
1425
|
+
*/
|
|
1426
|
+
export declare function Transactions(props: TransactionsProps): JSX.Element;
|
|
1427
|
+
|
|
1428
|
+
export declare type TransactionsProps = CommonProps;
|
|
1429
|
+
|
|
1430
|
+
/**
|
|
1431
|
+
* Hook to access the actions iframe functions.
|
|
1432
|
+
*
|
|
1433
|
+
* @returns An object containing the actions functions and loading state
|
|
1434
|
+
* @throws {CapitalOSError} If the hook is used outside of a CapitalOS component
|
|
1435
|
+
*
|
|
1436
|
+
* @example
|
|
1437
|
+
* ```tsx
|
|
1438
|
+
* const { actions, isLoading } = useActions()
|
|
1439
|
+
*
|
|
1440
|
+
* if (isLoading) {
|
|
1441
|
+
* return <LoadingSpinner />
|
|
1442
|
+
* }
|
|
1443
|
+
*
|
|
1444
|
+
* // Use the actions
|
|
1445
|
+
* await actions.freezeCard()
|
|
1446
|
+
* ```
|
|
1447
|
+
*/
|
|
1448
|
+
export declare function useActions(): {
|
|
1449
|
+
actions: ChildFunctions | null;
|
|
1450
|
+
isLoading: boolean;
|
|
1451
|
+
};
|
|
1452
|
+
|
|
1453
|
+
export declare const useCapitalOsAuthContext: () => CapitalOsAuthenticationContextType;
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* Hook to resolve logging preference, with direct prop taking precedence over context.
|
|
1457
|
+
* @param enableLoggingProp Direct prop for enableLogging.
|
|
1458
|
+
* @returns Effective logging flag.
|
|
1459
|
+
*/
|
|
1460
|
+
export declare function useEnableLogging(enableLoggingProp?: boolean): boolean;
|
|
1461
|
+
|
|
1462
|
+
/**
|
|
1463
|
+
* A React hook that manages the iframe connection lifecycle, including:
|
|
1464
|
+
* - Establishing and maintaining the iframe connection
|
|
1465
|
+
* - Handling token expiration and refresh flows
|
|
1466
|
+
* - Managing loading states
|
|
1467
|
+
* - Coordinating between one-time tokens and context-based authentication
|
|
1468
|
+
* - Providing error handling and logging capabilities
|
|
1469
|
+
*/
|
|
1470
|
+
export declare function useIframe(props: {
|
|
1471
|
+
renderingContext: CapitalOsRenderingContext;
|
|
1472
|
+
oneTimeToken?: string | undefined;
|
|
1473
|
+
enableLogging?: boolean | undefined;
|
|
1474
|
+
onError?: ((error: Error) => void) | undefined;
|
|
1475
|
+
theme?: ThemeColorScheme | undefined;
|
|
1476
|
+
methods?: Partial<Omit<ParentFunctions, 'onLoad' | 'onError' | 'onTokenExpired'>> | undefined;
|
|
1477
|
+
}): {
|
|
1478
|
+
isLoaded: boolean;
|
|
1479
|
+
url: string | undefined;
|
|
1480
|
+
tokenData: TokenData | undefined;
|
|
1481
|
+
iframeRef: RefObject<HTMLIFrameElement>;
|
|
1482
|
+
connection: Connection<ChildFunctions> | null;
|
|
1483
|
+
};
|
|
1484
|
+
|
|
1485
|
+
/**
|
|
1486
|
+
* connects to child iframe and returns whether the iframe is loaded or not.
|
|
1487
|
+
* token was added to the list of dependencies to make sure that the connection is re-established when the token changes.
|
|
1488
|
+
*/
|
|
1489
|
+
export declare function useIframeConnection({ iframeRef, token, onError, methods, iframeLabel, }: {
|
|
1490
|
+
iframeRef: React.RefObject<HTMLIFrameElement>;
|
|
1491
|
+
token: string | undefined;
|
|
1492
|
+
onError: ((error: Error) => void) | undefined | null;
|
|
1493
|
+
methods: ParentFunctions;
|
|
1494
|
+
iframeLabel?: string | undefined;
|
|
1495
|
+
}): Connection<ChildFunctions> | null;
|
|
1496
|
+
|
|
1497
|
+
/**
|
|
1498
|
+
* returns a memoized url of the iframe or undefined if the token is not available yet.
|
|
1499
|
+
*/
|
|
1500
|
+
export declare function useIframeUrl({ tokenData, renderingContext, theme, onError, }: {
|
|
1501
|
+
tokenData: TokenData | undefined;
|
|
1502
|
+
renderingContext: CapitalOsRenderingContext;
|
|
1503
|
+
theme?: ThemeColorScheme | undefined;
|
|
1504
|
+
onError?: ((error: Error) => void) | undefined;
|
|
1505
|
+
}): string | undefined;
|
|
1506
|
+
|
|
1507
|
+
/**
|
|
1508
|
+
* Hook that provides stable logging functions (log, warn, error), scoped to the resolved enableLogging flag.
|
|
1509
|
+
* @param enableLoggingProp Optional direct prop to override logging.
|
|
1510
|
+
*/
|
|
1511
|
+
export declare function useLogger(enableLoggingProp?: boolean): {
|
|
1512
|
+
log: (message: string) => void;
|
|
1513
|
+
warn: (message: string) => void;
|
|
1514
|
+
error: (message: string) => void;
|
|
1515
|
+
};
|
|
1516
|
+
|
|
1517
|
+
export declare function useMfaState(): {
|
|
1518
|
+
activeMfaRequest: MfaState | null;
|
|
1519
|
+
isMfaActive: boolean;
|
|
1520
|
+
mfaContext: MfaRequestContext | null;
|
|
1521
|
+
requestMfa: (context: MfaRequestContext) => Promise<MfaActionResult>;
|
|
1522
|
+
handleMfaDone: () => void;
|
|
1523
|
+
handleMfaCancel: () => void;
|
|
1524
|
+
handleMfaError: (error: CapitalOSError) => void;
|
|
1525
|
+
};
|
|
1526
|
+
|
|
1527
|
+
export { }
|