@capitalos/react 1.1.0-rc.1 → 1.1.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/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/_tsup-dts-rollup.d.mts +0 -915
- package/dist/_tsup-dts-rollup.d.ts +0 -915
- package/dist/src/index.d.mts +0 -23
- package/dist/src/index.d.ts +0 -23
|
@@ -1,915 +0,0 @@
|
|
|
1
|
-
import { IFrameComponent } from 'iframe-resizer';
|
|
2
|
-
import { IFrameMessageData } from 'iframe-resizer';
|
|
3
|
-
import { IFrameOptions } from 'iframe-resizer';
|
|
4
|
-
import { IFrameResizedData } from 'iframe-resizer';
|
|
5
|
-
import { IFrameScrollData } from 'iframe-resizer';
|
|
6
|
-
import { default as React_2 } from 'react';
|
|
7
|
-
import { ReactNode } from 'react';
|
|
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;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Renders the CapitalOS Account Details experience.
|
|
24
|
-
*/
|
|
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;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Builds the iframe url from token data, rendering context, and theme.
|
|
50
|
-
*/
|
|
51
|
-
export declare function buildIframeUrl({ tokenData, renderingContext, theme, onError, }: {
|
|
52
|
-
tokenData: TokenData;
|
|
53
|
-
renderingContext: CapitalOsRenderingContext;
|
|
54
|
-
theme?: ThemeColorScheme | undefined;
|
|
55
|
-
onError?: ((error: Error) => void) | undefined;
|
|
56
|
-
}): string | undefined;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* The internal component that handles all the heavy lifting of connecting to the iframe and rendering the app.
|
|
60
|
-
* all user facing components are basically a syntactic sugar on top of this.
|
|
61
|
-
*/
|
|
62
|
-
export declare function CapitalOS<T extends CapitalOsRenderingContext>(props: CapitalOsProps<T>): JSX.Element;
|
|
63
|
-
|
|
64
|
-
declare type CapitalOsAuthenticationContextType = {
|
|
65
|
-
tokenData?: TokenData | undefined;
|
|
66
|
-
isLoading: boolean;
|
|
67
|
-
error?: Error | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* Invalidates the current token..
|
|
70
|
-
* This is used when the iframe signals that the token has expired.
|
|
71
|
-
* The authentication flow will automatically refresh the token after invalidation.
|
|
72
|
-
*/
|
|
73
|
-
invalidateToken: () => void;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
declare const CapitalOsAuthenticationProvider: React_2.FC<ProviderProps>;
|
|
77
|
-
export { CapitalOsAuthenticationProvider }
|
|
78
|
-
export { CapitalOsAuthenticationProvider as CapitalOsAuthenticationProvider_alias_1 }
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Base class for all SDK errors
|
|
82
|
-
*/
|
|
83
|
-
export declare class CapitalOSError extends Error {
|
|
84
|
-
code: ErrorCode;
|
|
85
|
-
constructor({ message, code }: {
|
|
86
|
-
message: string;
|
|
87
|
-
code: ErrorCode;
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
declare type CapitalOsProps<T extends CapitalOsRenderingContext> = CommonProps & {
|
|
92
|
-
renderingContext: T;
|
|
93
|
-
methods?: Partial<IframeConnectionMethods>;
|
|
94
|
-
sizeWidth?: boolean;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export declare type CapitalOsRenderingContext = {
|
|
98
|
-
entryPoint?: EntryPoint;
|
|
99
|
-
referer?: string;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export declare type CardApiDto = z_2.infer<typeof cardApiDtoSchema>;
|
|
103
|
-
|
|
104
|
-
declare const cardApiDtoSchema: z_2.ZodObject<{
|
|
105
|
-
accountUserId: z_2.ZodNullable<z_2.ZodString>;
|
|
106
|
-
status: z_2.ZodEnum<["active", "inactive", "canceled", "frozen"]>;
|
|
107
|
-
id: z_2.ZodString;
|
|
108
|
-
last4: z_2.ZodString;
|
|
109
|
-
platformId: z_2.ZodString;
|
|
110
|
-
cardholderFirstName: z_2.ZodString;
|
|
111
|
-
cardholderLastName: z_2.ZodString;
|
|
112
|
-
cardholderPhoneNumber: z_2.ZodEffects<z_2.ZodString, string, string>;
|
|
113
|
-
nickname: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
|
|
114
|
-
spend: z_2.ZodObject<{
|
|
115
|
-
daily: z_2.ZodObject<{
|
|
116
|
-
limit: z_2.ZodOptional<z_2.ZodNumber>;
|
|
117
|
-
amount: z_2.ZodNumber;
|
|
118
|
-
}, "strip", z_2.ZodTypeAny, {
|
|
119
|
-
amount: number;
|
|
120
|
-
limit?: number | undefined;
|
|
121
|
-
}, {
|
|
122
|
-
amount: number;
|
|
123
|
-
limit?: number | undefined;
|
|
124
|
-
}>;
|
|
125
|
-
weekly: z_2.ZodObject<{
|
|
126
|
-
limit: z_2.ZodOptional<z_2.ZodNumber>;
|
|
127
|
-
amount: z_2.ZodNumber;
|
|
128
|
-
}, "strip", z_2.ZodTypeAny, {
|
|
129
|
-
amount: number;
|
|
130
|
-
limit?: number | undefined;
|
|
131
|
-
}, {
|
|
132
|
-
amount: number;
|
|
133
|
-
limit?: number | undefined;
|
|
134
|
-
}>;
|
|
135
|
-
monthly: z_2.ZodObject<{
|
|
136
|
-
limit: z_2.ZodOptional<z_2.ZodNumber>;
|
|
137
|
-
amount: z_2.ZodNumber;
|
|
138
|
-
}, "strip", z_2.ZodTypeAny, {
|
|
139
|
-
amount: number;
|
|
140
|
-
limit?: number | undefined;
|
|
141
|
-
}, {
|
|
142
|
-
amount: number;
|
|
143
|
-
limit?: number | undefined;
|
|
144
|
-
}>;
|
|
145
|
-
lifetime: z_2.ZodObject<{
|
|
146
|
-
limit: z_2.ZodOptional<z_2.ZodNumber>;
|
|
147
|
-
amount: z_2.ZodNumber;
|
|
148
|
-
}, "strip", z_2.ZodTypeAny, {
|
|
149
|
-
amount: number;
|
|
150
|
-
limit?: number | undefined;
|
|
151
|
-
}, {
|
|
152
|
-
amount: number;
|
|
153
|
-
limit?: number | undefined;
|
|
154
|
-
}>;
|
|
155
|
-
}, "strip", z_2.ZodTypeAny, {
|
|
156
|
-
daily: {
|
|
157
|
-
amount: number;
|
|
158
|
-
limit?: number | undefined;
|
|
159
|
-
};
|
|
160
|
-
weekly: {
|
|
161
|
-
amount: number;
|
|
162
|
-
limit?: number | undefined;
|
|
163
|
-
};
|
|
164
|
-
monthly: {
|
|
165
|
-
amount: number;
|
|
166
|
-
limit?: number | undefined;
|
|
167
|
-
};
|
|
168
|
-
lifetime: {
|
|
169
|
-
amount: number;
|
|
170
|
-
limit?: number | undefined;
|
|
171
|
-
};
|
|
172
|
-
}, {
|
|
173
|
-
daily: {
|
|
174
|
-
amount: number;
|
|
175
|
-
limit?: number | undefined;
|
|
176
|
-
};
|
|
177
|
-
weekly: {
|
|
178
|
-
amount: number;
|
|
179
|
-
limit?: number | undefined;
|
|
180
|
-
};
|
|
181
|
-
monthly: {
|
|
182
|
-
amount: number;
|
|
183
|
-
limit?: number | undefined;
|
|
184
|
-
};
|
|
185
|
-
lifetime: {
|
|
186
|
-
amount: number;
|
|
187
|
-
limit?: number | undefined;
|
|
188
|
-
};
|
|
189
|
-
}>;
|
|
190
|
-
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">;
|
|
191
|
-
allowedMerchants: z_2.ZodArray<z_2.ZodObject<{
|
|
192
|
-
id: z_2.ZodUnion<[z_2.ZodString, z_2.ZodString]>;
|
|
193
|
-
name: z_2.ZodString;
|
|
194
|
-
logoUrl: z_2.ZodNullable<z_2.ZodString>;
|
|
195
|
-
}, "strip", z_2.ZodTypeAny, {
|
|
196
|
-
id: string;
|
|
197
|
-
name: string;
|
|
198
|
-
logoUrl: string | null;
|
|
199
|
-
}, {
|
|
200
|
-
id: string;
|
|
201
|
-
name: string;
|
|
202
|
-
logoUrl: string | null;
|
|
203
|
-
}>, "many">;
|
|
204
|
-
physicalCard: z_2.ZodNullable<z_2.ZodObject<z_2.objectUtil.extendShape<{
|
|
205
|
-
status: z_2.ZodEnum<["active", "disabled", "canceled"]>;
|
|
206
|
-
shipment: z_2.ZodObject<{
|
|
207
|
-
address: z_2.ZodObject<{
|
|
208
|
-
addressLine1: z_2.ZodString;
|
|
209
|
-
addressLine2: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
|
|
210
|
-
city: z_2.ZodString;
|
|
211
|
-
state: z_2.ZodEffects<z_2.ZodString, string, string>;
|
|
212
|
-
zipcode: z_2.ZodString;
|
|
213
|
-
}, "strip", z_2.ZodTypeAny, {
|
|
214
|
-
addressLine1: string;
|
|
215
|
-
city: string;
|
|
216
|
-
state: string;
|
|
217
|
-
zipcode: string;
|
|
218
|
-
addressLine2?: string | null | undefined;
|
|
219
|
-
}, {
|
|
220
|
-
addressLine1: string;
|
|
221
|
-
city: string;
|
|
222
|
-
state: string;
|
|
223
|
-
zipcode: string;
|
|
224
|
-
addressLine2?: string | null | undefined;
|
|
225
|
-
}>;
|
|
226
|
-
method: z_2.ZodEnum<["usps", "fedexPriorityOvernight", "fedexTwoDay"]>;
|
|
227
|
-
recipientName: z_2.ZodString;
|
|
228
|
-
returnReason: z_2.ZodNullable<z_2.ZodString>;
|
|
229
|
-
shippedAt: z_2.ZodNullable<z_2.ZodString>;
|
|
230
|
-
status: z_2.ZodEnum<["canceled", "pending", "rejected", "returned", "shipped"]>;
|
|
231
|
-
trackingNumber: z_2.ZodNullable<z_2.ZodString>;
|
|
232
|
-
trackingUrl: z_2.ZodNullable<z_2.ZodString>;
|
|
233
|
-
}, "strip", z_2.ZodTypeAny, {
|
|
234
|
-
status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
|
|
235
|
-
method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
|
|
236
|
-
address: {
|
|
237
|
-
addressLine1: string;
|
|
238
|
-
city: string;
|
|
239
|
-
state: string;
|
|
240
|
-
zipcode: string;
|
|
241
|
-
addressLine2?: string | null | undefined;
|
|
242
|
-
};
|
|
243
|
-
recipientName: string;
|
|
244
|
-
returnReason: string | null;
|
|
245
|
-
shippedAt: string | null;
|
|
246
|
-
trackingNumber: string | null;
|
|
247
|
-
trackingUrl: string | null;
|
|
248
|
-
}, {
|
|
249
|
-
status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
|
|
250
|
-
method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
|
|
251
|
-
address: {
|
|
252
|
-
addressLine1: string;
|
|
253
|
-
city: string;
|
|
254
|
-
state: string;
|
|
255
|
-
zipcode: string;
|
|
256
|
-
addressLine2?: string | null | undefined;
|
|
257
|
-
};
|
|
258
|
-
recipientName: string;
|
|
259
|
-
returnReason: string | null;
|
|
260
|
-
shippedAt: string | null;
|
|
261
|
-
trackingNumber: string | null;
|
|
262
|
-
trackingUrl: string | null;
|
|
263
|
-
}>;
|
|
264
|
-
}, {
|
|
265
|
-
id: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
|
|
266
|
-
}>, "strip", z_2.ZodTypeAny, {
|
|
267
|
-
status: "active" | "canceled" | "disabled";
|
|
268
|
-
shipment: {
|
|
269
|
-
status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
|
|
270
|
-
method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
|
|
271
|
-
address: {
|
|
272
|
-
addressLine1: string;
|
|
273
|
-
city: string;
|
|
274
|
-
state: string;
|
|
275
|
-
zipcode: string;
|
|
276
|
-
addressLine2?: string | null | undefined;
|
|
277
|
-
};
|
|
278
|
-
recipientName: string;
|
|
279
|
-
returnReason: string | null;
|
|
280
|
-
shippedAt: string | null;
|
|
281
|
-
trackingNumber: string | null;
|
|
282
|
-
trackingUrl: string | null;
|
|
283
|
-
};
|
|
284
|
-
id?: string | null | undefined;
|
|
285
|
-
}, {
|
|
286
|
-
status: "active" | "canceled" | "disabled";
|
|
287
|
-
shipment: {
|
|
288
|
-
status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
|
|
289
|
-
method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
|
|
290
|
-
address: {
|
|
291
|
-
addressLine1: string;
|
|
292
|
-
city: string;
|
|
293
|
-
state: string;
|
|
294
|
-
zipcode: string;
|
|
295
|
-
addressLine2?: string | null | undefined;
|
|
296
|
-
};
|
|
297
|
-
recipientName: string;
|
|
298
|
-
returnReason: string | null;
|
|
299
|
-
shippedAt: string | null;
|
|
300
|
-
trackingNumber: string | null;
|
|
301
|
-
trackingUrl: string | null;
|
|
302
|
-
};
|
|
303
|
-
id?: string | null | undefined;
|
|
304
|
-
}>>;
|
|
305
|
-
cardSpendPolicyId: z_2.ZodOptional<z_2.ZodNullable<z_2.ZodString>>;
|
|
306
|
-
}, "strip", z_2.ZodTypeAny, {
|
|
307
|
-
status: "active" | "inactive" | "canceled" | "frozen";
|
|
308
|
-
id: string;
|
|
309
|
-
platformId: string;
|
|
310
|
-
accountUserId: string | null;
|
|
311
|
-
last4: string;
|
|
312
|
-
cardholderFirstName: string;
|
|
313
|
-
cardholderLastName: string;
|
|
314
|
-
cardholderPhoneNumber: string;
|
|
315
|
-
spend: {
|
|
316
|
-
daily: {
|
|
317
|
-
amount: number;
|
|
318
|
-
limit?: number | undefined;
|
|
319
|
-
};
|
|
320
|
-
weekly: {
|
|
321
|
-
amount: number;
|
|
322
|
-
limit?: number | undefined;
|
|
323
|
-
};
|
|
324
|
-
monthly: {
|
|
325
|
-
amount: number;
|
|
326
|
-
limit?: number | undefined;
|
|
327
|
-
};
|
|
328
|
-
lifetime: {
|
|
329
|
-
amount: number;
|
|
330
|
-
limit?: number | undefined;
|
|
331
|
-
};
|
|
332
|
-
};
|
|
333
|
-
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")[];
|
|
334
|
-
allowedMerchants: {
|
|
335
|
-
id: string;
|
|
336
|
-
name: string;
|
|
337
|
-
logoUrl: string | null;
|
|
338
|
-
}[];
|
|
339
|
-
physicalCard: {
|
|
340
|
-
status: "active" | "canceled" | "disabled";
|
|
341
|
-
shipment: {
|
|
342
|
-
status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
|
|
343
|
-
method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
|
|
344
|
-
address: {
|
|
345
|
-
addressLine1: string;
|
|
346
|
-
city: string;
|
|
347
|
-
state: string;
|
|
348
|
-
zipcode: string;
|
|
349
|
-
addressLine2?: string | null | undefined;
|
|
350
|
-
};
|
|
351
|
-
recipientName: string;
|
|
352
|
-
returnReason: string | null;
|
|
353
|
-
shippedAt: string | null;
|
|
354
|
-
trackingNumber: string | null;
|
|
355
|
-
trackingUrl: string | null;
|
|
356
|
-
};
|
|
357
|
-
id?: string | null | undefined;
|
|
358
|
-
} | null;
|
|
359
|
-
nickname?: string | null | undefined;
|
|
360
|
-
cardSpendPolicyId?: string | null | undefined;
|
|
361
|
-
}, {
|
|
362
|
-
status: "active" | "inactive" | "canceled" | "frozen";
|
|
363
|
-
id: string;
|
|
364
|
-
platformId: string;
|
|
365
|
-
accountUserId: string | null;
|
|
366
|
-
last4: string;
|
|
367
|
-
cardholderFirstName: string;
|
|
368
|
-
cardholderLastName: string;
|
|
369
|
-
cardholderPhoneNumber: string;
|
|
370
|
-
spend: {
|
|
371
|
-
daily: {
|
|
372
|
-
amount: number;
|
|
373
|
-
limit?: number | undefined;
|
|
374
|
-
};
|
|
375
|
-
weekly: {
|
|
376
|
-
amount: number;
|
|
377
|
-
limit?: number | undefined;
|
|
378
|
-
};
|
|
379
|
-
monthly: {
|
|
380
|
-
amount: number;
|
|
381
|
-
limit?: number | undefined;
|
|
382
|
-
};
|
|
383
|
-
lifetime: {
|
|
384
|
-
amount: number;
|
|
385
|
-
limit?: number | undefined;
|
|
386
|
-
};
|
|
387
|
-
};
|
|
388
|
-
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")[];
|
|
389
|
-
allowedMerchants: {
|
|
390
|
-
id: string;
|
|
391
|
-
name: string;
|
|
392
|
-
logoUrl: string | null;
|
|
393
|
-
}[];
|
|
394
|
-
physicalCard: {
|
|
395
|
-
status: "active" | "canceled" | "disabled";
|
|
396
|
-
shipment: {
|
|
397
|
-
status: "pending" | "canceled" | "rejected" | "returned" | "shipped";
|
|
398
|
-
method: "usps" | "fedexPriorityOvernight" | "fedexTwoDay";
|
|
399
|
-
address: {
|
|
400
|
-
addressLine1: string;
|
|
401
|
-
city: string;
|
|
402
|
-
state: string;
|
|
403
|
-
zipcode: string;
|
|
404
|
-
addressLine2?: string | null | undefined;
|
|
405
|
-
};
|
|
406
|
-
recipientName: string;
|
|
407
|
-
returnReason: string | null;
|
|
408
|
-
shippedAt: string | null;
|
|
409
|
-
trackingNumber: string | null;
|
|
410
|
-
trackingUrl: string | null;
|
|
411
|
-
};
|
|
412
|
-
id?: string | null | undefined;
|
|
413
|
-
} | null;
|
|
414
|
-
nickname?: string | null | undefined;
|
|
415
|
-
cardSpendPolicyId?: string | null | undefined;
|
|
416
|
-
}>;
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Renders the CapitalOS Manage Card experience.
|
|
420
|
-
*/
|
|
421
|
-
export declare function CardDetails(props: CardDetailsProps): JSX.Element;
|
|
422
|
-
|
|
423
|
-
export declare type CardDetailsProps = CommonProps & {
|
|
424
|
-
/**
|
|
425
|
-
* The ID of the card to manage.
|
|
426
|
-
*/
|
|
427
|
-
cardId: string;
|
|
428
|
-
cardOnly?: boolean | undefined;
|
|
429
|
-
hideAddress?: boolean | undefined;
|
|
430
|
-
onCardCanceled?: () => void;
|
|
431
|
-
};
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* Renders the CapitalOS CardsApp.
|
|
435
|
-
*/
|
|
436
|
-
export declare function CardsApp(props: CommonProps): JSX.Element;
|
|
437
|
-
|
|
438
|
-
export declare type CommonProps = {
|
|
439
|
-
/**
|
|
440
|
-
* The token provided by initiate-login.
|
|
441
|
-
*/
|
|
442
|
-
token?: string;
|
|
443
|
-
/**
|
|
444
|
-
* Optional CSS class name for the component.
|
|
445
|
-
*/
|
|
446
|
-
className?: string;
|
|
447
|
-
/**
|
|
448
|
-
* Optional flag indicating whether to log events to the console.
|
|
449
|
-
*/
|
|
450
|
-
enableLogging?: boolean;
|
|
451
|
-
/**
|
|
452
|
-
* Optional callback for when the app encounters an error.
|
|
453
|
-
*/
|
|
454
|
-
onError?: (error: Error) => void;
|
|
455
|
-
/**
|
|
456
|
-
* Optional component to render while the app is loading.
|
|
457
|
-
*/
|
|
458
|
-
loadingComponent?: ReactNode;
|
|
459
|
-
/**
|
|
460
|
-
* Optional theme color scheme to apply to the app or component.
|
|
461
|
-
*/
|
|
462
|
-
theme?: ThemeColorScheme;
|
|
463
|
-
};
|
|
464
|
-
|
|
465
|
-
export declare function decodeOneTimeToken(token: string): any;
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* Renders the CapitalOS Dev Tools experience.
|
|
469
|
-
* Allows for simulating transactions, etc.
|
|
470
|
-
*/
|
|
471
|
-
declare function DevTools(props: DevToolsProps): JSX.Element;
|
|
472
|
-
export { DevTools }
|
|
473
|
-
export { DevTools as DevTools_alias_1 }
|
|
474
|
-
|
|
475
|
-
export declare function DevToolsButton({ onClick, isLoading }: DevToolsButtonProps): JSX.Element;
|
|
476
|
-
|
|
477
|
-
declare interface DevToolsButtonProps {
|
|
478
|
-
onClick?: () => void;
|
|
479
|
-
isLoading?: boolean;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
export declare type DevToolsProps = CommonProps;
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* Renders the CapitalOS Dispute Transaction experience.
|
|
486
|
-
*/
|
|
487
|
-
export declare function DisputeTransaction({ transactionId, onDone, onCancel, ...restOfProps }: DisputeTransactionProps): JSX.Element;
|
|
488
|
-
|
|
489
|
-
export declare type DisputeTransactionProps = CommonProps & {
|
|
490
|
-
/**
|
|
491
|
-
* The ID of the transaction to dispute.
|
|
492
|
-
*/
|
|
493
|
-
transactionId: string;
|
|
494
|
-
/**
|
|
495
|
-
* Callback to invoke when the dispute was successfully submitted.
|
|
496
|
-
*/
|
|
497
|
-
onDone: () => void;
|
|
498
|
-
/**
|
|
499
|
-
* Callback to invoke when the user cancels the dispute submission.
|
|
500
|
-
*/
|
|
501
|
-
onCancel: () => void;
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* Encodes the rendering context as base64 and then URI encodes it.
|
|
506
|
-
*/
|
|
507
|
-
export declare function encodeRenderingContext<T>(renderingContext: NonNullable<T>): string;
|
|
508
|
-
|
|
509
|
-
export declare type EntryPoint = RenderingContext_2['entryPoint'];
|
|
510
|
-
|
|
511
|
-
export declare const ErrorCode: {
|
|
512
|
-
readonly unauthorized: "unauthorized";
|
|
513
|
-
readonly invalid_account_status: "invalid_account_status";
|
|
514
|
-
readonly unsupported_entry_point: "unsupported_entry_point";
|
|
515
|
-
readonly internal_error: "internal_error";
|
|
516
|
-
};
|
|
517
|
-
|
|
518
|
-
export declare type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
519
|
-
|
|
520
|
-
export declare type IframeConnectionMethods = {
|
|
521
|
-
onLoad: () => void;
|
|
522
|
-
onError: (error: RawErrorDetails) => void;
|
|
523
|
-
/**
|
|
524
|
-
* Called when the iframe detects that the JWT token has expired.
|
|
525
|
-
* This triggers the token refresh flow, which will obtain a new token
|
|
526
|
-
* and reload the iframe with the fresh token.
|
|
527
|
-
*/
|
|
528
|
-
onTokenExpired?: () => void;
|
|
529
|
-
createCard?: {
|
|
530
|
-
onDone?: () => void;
|
|
531
|
-
onCancel?: () => void;
|
|
532
|
-
};
|
|
533
|
-
createDispute?: {
|
|
534
|
-
onDone?: () => void;
|
|
535
|
-
onCancel?: () => void;
|
|
536
|
-
};
|
|
537
|
-
onboarding?: {
|
|
538
|
-
onDone?: (account: Account) => void;
|
|
539
|
-
};
|
|
540
|
-
tokenExchange?: {
|
|
541
|
-
onLongLivedToken?: (jwtToken: string) => void;
|
|
542
|
-
};
|
|
543
|
-
makePayment?: {
|
|
544
|
-
onDone?: () => void;
|
|
545
|
-
};
|
|
546
|
-
devTools?: {
|
|
547
|
-
onClose?: () => void;
|
|
548
|
-
};
|
|
549
|
-
cardDetails?: {
|
|
550
|
-
onCardCanceled?: () => void;
|
|
551
|
-
};
|
|
552
|
-
};
|
|
553
|
-
|
|
554
|
-
export declare const IframeResizer: React_2.ForwardRefExoticComponent<Omit<IFrameOptions, "closedCallback" | "scrollCallback" | "resizedCallback" | "messageCallback" | "initCallback"> & {
|
|
555
|
-
onClosed?(iframeId: string): void;
|
|
556
|
-
onInit?(iframe: IFrameComponent): void;
|
|
557
|
-
onMessage?(data: IFrameMessageData): void;
|
|
558
|
-
onResized?(data: IFrameResizedData): void;
|
|
559
|
-
onScroll?(data: IFrameScrollData): boolean;
|
|
560
|
-
} & React_2.IframeHTMLAttributes<HTMLIFrameElement> & React_2.RefAttributes<HTMLIFrameElement>>;
|
|
561
|
-
|
|
562
|
-
/**
|
|
563
|
-
* Renders the CapitalOS Insights Dashboard experience
|
|
564
|
-
*/
|
|
565
|
-
export declare function InsightsDashboard(props: InsightsDashboardProps): JSX.Element;
|
|
566
|
-
|
|
567
|
-
export declare type InsightsDashboardProps = CommonProps;
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* Renders a specific CapitalOS Insights Widget
|
|
571
|
-
*/
|
|
572
|
-
export declare function InsightsWidget(props: InsightsWidgetProps): JSX.Element;
|
|
573
|
-
|
|
574
|
-
export declare type InsightsWidgetProps = CommonProps & {
|
|
575
|
-
/**
|
|
576
|
-
* The specific widget to render.
|
|
577
|
-
* naming convention:
|
|
578
|
-
* 1. Over-time Widgets
|
|
579
|
-
* over-time-{metric}-by-{dimension}-per-{time-granularity}
|
|
580
|
-
* 2. Top/Ranking Widgets
|
|
581
|
-
* top-{entities}-by-{metric}-{timeframe}
|
|
582
|
-
* 3. Comparison Widgets
|
|
583
|
-
* comparison-{metric}-{primary-timeframe}-vs-{secondary-timeframe}
|
|
584
|
-
*/
|
|
585
|
-
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';
|
|
586
|
-
/**
|
|
587
|
-
* Whether to hide the title of the widget.
|
|
588
|
-
*/
|
|
589
|
-
hideTitle?: boolean | undefined;
|
|
590
|
-
/**
|
|
591
|
-
* The height of the widget.
|
|
592
|
-
*/
|
|
593
|
-
height?: number | undefined;
|
|
594
|
-
/**
|
|
595
|
-
* The width of the widget.
|
|
596
|
-
*/
|
|
597
|
-
width?: number | undefined;
|
|
598
|
-
};
|
|
599
|
-
|
|
600
|
-
/**
|
|
601
|
-
* Represents an error that occurs when an invalid token is encountered.
|
|
602
|
-
*/
|
|
603
|
-
export declare class InvalidTokenError extends CapitalOSError {
|
|
604
|
-
constructor(message?: string);
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* Renders the CapitalOS Issue Card experience.
|
|
609
|
-
*/
|
|
610
|
-
export declare function IssueCard({ cardholder, onDone, onCancel, ...restOfProps }: IssueCardProps): JSX.Element;
|
|
611
|
-
|
|
612
|
-
export declare type IssueCardDefaultValues = z.infer<typeof issueCardDefaultValuesSchema>;
|
|
613
|
-
|
|
614
|
-
declare const issueCardDefaultValuesSchema: z.ZodUnion<[z.ZodObject<{
|
|
615
|
-
firstName: z.ZodString;
|
|
616
|
-
lastName: z.ZodString;
|
|
617
|
-
phone: z.ZodString;
|
|
618
|
-
}, "strip", z.ZodTypeAny, {
|
|
619
|
-
firstName: string;
|
|
620
|
-
lastName: string;
|
|
621
|
-
phone: string;
|
|
622
|
-
}, {
|
|
623
|
-
firstName: string;
|
|
624
|
-
lastName: string;
|
|
625
|
-
phone: string;
|
|
626
|
-
}>, z.ZodObject<{
|
|
627
|
-
userId: z.ZodString;
|
|
628
|
-
}, "strip", z.ZodTypeAny, {
|
|
629
|
-
userId: string;
|
|
630
|
-
}, {
|
|
631
|
-
userId: string;
|
|
632
|
-
}>]>;
|
|
633
|
-
|
|
634
|
-
export declare type IssueCardProps = CommonProps & {
|
|
635
|
-
/**
|
|
636
|
-
* Default values to prefill the form with.
|
|
637
|
-
*
|
|
638
|
-
* 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.
|
|
639
|
-
*/
|
|
640
|
-
cardholder?: IssueCardDefaultValues;
|
|
641
|
-
/**
|
|
642
|
-
* Callback to invoke when the card was created successfully.
|
|
643
|
-
*/
|
|
644
|
-
onDone: () => void;
|
|
645
|
-
/**
|
|
646
|
-
* Callback to invoke when the card creation was cancelled by the user.
|
|
647
|
-
*/
|
|
648
|
-
onCancel: () => void;
|
|
649
|
-
};
|
|
650
|
-
|
|
651
|
-
/**
|
|
652
|
-
* Renders the CapitalOS Make a Payment experience.
|
|
653
|
-
*/
|
|
654
|
-
export declare function MakePayment({ onDone, ...restOfProps }: MakePaymentProps): JSX.Element;
|
|
655
|
-
|
|
656
|
-
export declare type MakePaymentProps = CommonProps & {
|
|
657
|
-
/**
|
|
658
|
-
* Callback to invoke when the payment was made successfully.
|
|
659
|
-
*/
|
|
660
|
-
onDone: () => void;
|
|
661
|
-
};
|
|
662
|
-
|
|
663
|
-
export declare function Onboarding<T extends OnboardingEntryPoint>({ onDone, entryPoint: onboardingEntryPoint, exitPoint: onboardingExitPoint, ...restOfProps }: OnboardingProps<T>): JSX.Element;
|
|
664
|
-
|
|
665
|
-
declare type OnboardingEntryPoint = keyof AllowedExitPoints;
|
|
666
|
-
|
|
667
|
-
declare type OnboardingProps<T extends keyof AllowedExitPoints> = CommonProps & {
|
|
668
|
-
entryPoint?: T;
|
|
669
|
-
exitPoint?: AllowedExitPoints[T];
|
|
670
|
-
onDone: (account: Account) => void;
|
|
671
|
-
};
|
|
672
|
-
|
|
673
|
-
declare type ProviderProps = {
|
|
674
|
-
getToken: () => Promise<string>;
|
|
675
|
-
enableLogging?: boolean | undefined;
|
|
676
|
-
children: React_2.ReactNode;
|
|
677
|
-
};
|
|
678
|
-
|
|
679
|
-
/**
|
|
680
|
-
* An error type providing a reason code and message.
|
|
681
|
-
* Penpal only passes plain objects, so this does not inherit from Error.
|
|
682
|
-
*/
|
|
683
|
-
export declare type RawErrorDetails = {
|
|
684
|
-
code: ErrorCode;
|
|
685
|
-
message: string;
|
|
686
|
-
};
|
|
687
|
-
|
|
688
|
-
declare type RenderingContext_2 = z.infer<typeof renderingContextSchema>;
|
|
689
|
-
|
|
690
|
-
declare const renderingContextSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<"entryPoint", [z.ZodObject<{
|
|
691
|
-
entryPoint: z.ZodLiteral<"createCard">;
|
|
692
|
-
cardholder: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodObject<{
|
|
693
|
-
firstName: z.ZodString;
|
|
694
|
-
lastName: z.ZodString;
|
|
695
|
-
phone: z.ZodString;
|
|
696
|
-
}, "strip", z.ZodTypeAny, {
|
|
697
|
-
firstName: string;
|
|
698
|
-
lastName: string;
|
|
699
|
-
phone: string;
|
|
700
|
-
}, {
|
|
701
|
-
firstName: string;
|
|
702
|
-
lastName: string;
|
|
703
|
-
phone: string;
|
|
704
|
-
}>, z.ZodObject<{
|
|
705
|
-
userId: z.ZodString;
|
|
706
|
-
}, "strip", z.ZodTypeAny, {
|
|
707
|
-
userId: string;
|
|
708
|
-
}, {
|
|
709
|
-
userId: string;
|
|
710
|
-
}>]>>>;
|
|
711
|
-
}, "strip", z.ZodTypeAny, {
|
|
712
|
-
entryPoint: "createCard";
|
|
713
|
-
cardholder?: {
|
|
714
|
-
firstName: string;
|
|
715
|
-
lastName: string;
|
|
716
|
-
phone: string;
|
|
717
|
-
} | {
|
|
718
|
-
userId: string;
|
|
719
|
-
} | null | undefined;
|
|
720
|
-
}, {
|
|
721
|
-
entryPoint: "createCard";
|
|
722
|
-
cardholder?: {
|
|
723
|
-
firstName: string;
|
|
724
|
-
lastName: string;
|
|
725
|
-
phone: string;
|
|
726
|
-
} | {
|
|
727
|
-
userId: string;
|
|
728
|
-
} | null | undefined;
|
|
729
|
-
}>, z.ZodObject<{
|
|
730
|
-
entryPoint: z.ZodLiteral<"createDispute">;
|
|
731
|
-
transactionId: z.ZodString;
|
|
732
|
-
}, "strip", z.ZodTypeAny, {
|
|
733
|
-
entryPoint: "createDispute";
|
|
734
|
-
transactionId: string;
|
|
735
|
-
}, {
|
|
736
|
-
entryPoint: "createDispute";
|
|
737
|
-
transactionId: string;
|
|
738
|
-
}>, z.ZodObject<{
|
|
739
|
-
entryPoint: z.ZodLiteral<"billPayApp">;
|
|
740
|
-
}, "strip", z.ZodTypeAny, {
|
|
741
|
-
entryPoint: "billPayApp";
|
|
742
|
-
}, {
|
|
743
|
-
entryPoint: "billPayApp";
|
|
744
|
-
}>, z.ZodObject<{
|
|
745
|
-
entryPoint: z.ZodLiteral<"cardDetails">;
|
|
746
|
-
cardId: z.ZodString;
|
|
747
|
-
cardOnly: z.ZodOptional<z.ZodBoolean>;
|
|
748
|
-
hideAddress: z.ZodOptional<z.ZodBoolean>;
|
|
749
|
-
}, "strip", z.ZodTypeAny, {
|
|
750
|
-
cardId: string;
|
|
751
|
-
entryPoint: "cardDetails";
|
|
752
|
-
cardOnly?: boolean | undefined;
|
|
753
|
-
hideAddress?: boolean | undefined;
|
|
754
|
-
}, {
|
|
755
|
-
cardId: string;
|
|
756
|
-
entryPoint: "cardDetails";
|
|
757
|
-
cardOnly?: boolean | undefined;
|
|
758
|
-
hideAddress?: boolean | undefined;
|
|
759
|
-
}>, z.ZodObject<{
|
|
760
|
-
entryPoint: z.ZodLiteral<"accountDetails">;
|
|
761
|
-
}, "strip", z.ZodTypeAny, {
|
|
762
|
-
entryPoint: "accountDetails";
|
|
763
|
-
}, {
|
|
764
|
-
entryPoint: "accountDetails";
|
|
765
|
-
}>, z.ZodObject<{
|
|
766
|
-
entryPoint: z.ZodLiteral<"accountActions">;
|
|
767
|
-
}, "strip", z.ZodTypeAny, {
|
|
768
|
-
entryPoint: "accountActions";
|
|
769
|
-
}, {
|
|
770
|
-
entryPoint: "accountActions";
|
|
771
|
-
}>, z.ZodObject<{
|
|
772
|
-
entryPoint: z.ZodLiteral<"insightsDashboard">;
|
|
773
|
-
}, "strip", z.ZodTypeAny, {
|
|
774
|
-
entryPoint: "insightsDashboard";
|
|
775
|
-
}, {
|
|
776
|
-
entryPoint: "insightsDashboard";
|
|
777
|
-
}>, z.ZodObject<{
|
|
778
|
-
entryPoint: z.ZodLiteral<"insightsWidget">;
|
|
779
|
-
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"]>;
|
|
780
|
-
hideTitle: z.ZodOptional<z.ZodBoolean>;
|
|
781
|
-
height: z.ZodOptional<z.ZodNumber>;
|
|
782
|
-
width: z.ZodOptional<z.ZodNumber>;
|
|
783
|
-
}, "strip", z.ZodTypeAny, {
|
|
784
|
-
entryPoint: "insightsWidget";
|
|
785
|
-
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";
|
|
786
|
-
hideTitle?: boolean | undefined;
|
|
787
|
-
height?: number | undefined;
|
|
788
|
-
width?: number | undefined;
|
|
789
|
-
}, {
|
|
790
|
-
entryPoint: "insightsWidget";
|
|
791
|
-
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";
|
|
792
|
-
hideTitle?: boolean | undefined;
|
|
793
|
-
height?: number | undefined;
|
|
794
|
-
width?: number | undefined;
|
|
795
|
-
}>, z.ZodObject<{
|
|
796
|
-
entryPoint: z.ZodLiteral<"onboarding">;
|
|
797
|
-
onboardingEntryPoint: z.ZodDefault<z.ZodEnum<["welcome", "application"]>>;
|
|
798
|
-
onboardingExitPoint: z.ZodDefault<z.ZodEnum<["application", "activation"]>>;
|
|
799
|
-
}, "strip", z.ZodTypeAny, {
|
|
800
|
-
entryPoint: "onboarding";
|
|
801
|
-
onboardingEntryPoint: "welcome" | "application";
|
|
802
|
-
onboardingExitPoint: "application" | "activation";
|
|
803
|
-
}, {
|
|
804
|
-
entryPoint: "onboarding";
|
|
805
|
-
onboardingEntryPoint?: "welcome" | "application" | undefined;
|
|
806
|
-
onboardingExitPoint?: "application" | "activation" | undefined;
|
|
807
|
-
}>, z.ZodObject<{
|
|
808
|
-
entryPoint: z.ZodLiteral<"cardsApp">;
|
|
809
|
-
}, "strip", z.ZodTypeAny, {
|
|
810
|
-
entryPoint: "cardsApp";
|
|
811
|
-
}, {
|
|
812
|
-
entryPoint: "cardsApp";
|
|
813
|
-
}>, z.ZodObject<{
|
|
814
|
-
entryPoint: z.ZodLiteral<"tokenExchange">;
|
|
815
|
-
}, "strip", z.ZodTypeAny, {
|
|
816
|
-
entryPoint: "tokenExchange";
|
|
817
|
-
}, {
|
|
818
|
-
entryPoint: "tokenExchange";
|
|
819
|
-
}>, z.ZodObject<{
|
|
820
|
-
entryPoint: z.ZodLiteral<"makePayment">;
|
|
821
|
-
}, "strip", z.ZodTypeAny, {
|
|
822
|
-
entryPoint: "makePayment";
|
|
823
|
-
}, {
|
|
824
|
-
entryPoint: "makePayment";
|
|
825
|
-
}>, z.ZodObject<{
|
|
826
|
-
entryPoint: z.ZodLiteral<"devTools">;
|
|
827
|
-
}, "strip", z.ZodTypeAny, {
|
|
828
|
-
entryPoint: "devTools";
|
|
829
|
-
}, {
|
|
830
|
-
entryPoint: "devTools";
|
|
831
|
-
}>]>, z.ZodObject<{
|
|
832
|
-
referer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
833
|
-
}, "strip", z.ZodTypeAny, {
|
|
834
|
-
referer?: string | null | undefined;
|
|
835
|
-
}, {
|
|
836
|
-
referer?: string | null | undefined;
|
|
837
|
-
}>>;
|
|
838
|
-
|
|
839
|
-
/**
|
|
840
|
-
* Safely decodes a URL component, handling potential errors
|
|
841
|
-
*/
|
|
842
|
-
export declare function safeDecodeURIComponent(str: string): string;
|
|
843
|
-
|
|
844
|
-
export declare type ThemeColorScheme = 'light' | 'dark' | 'system';
|
|
845
|
-
|
|
846
|
-
export declare type TokenData = {
|
|
847
|
-
token: string;
|
|
848
|
-
tokenType: TokenType;
|
|
849
|
-
baseUrl: string;
|
|
850
|
-
paramKey: TokenParamKey;
|
|
851
|
-
paramLocation: TokenParamLocation;
|
|
852
|
-
};
|
|
853
|
-
|
|
854
|
-
export declare function tokenDataFromOneTimeToken(oneTimeToken: string): TokenData;
|
|
855
|
-
|
|
856
|
-
/**
|
|
857
|
-
* The component is hidden from the user and is only used to exchange a one-time token for a JWT in the authentication context.
|
|
858
|
-
*
|
|
859
|
-
* The token exchange process works as follows:
|
|
860
|
-
* 1. Component renders a hidden iframe with the one-time token in the URL
|
|
861
|
-
* 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
|
|
862
|
-
* 3. The iframe passes the long-lived token to the parent via postMessage
|
|
863
|
-
* 4. onExchangeComplete callback is triggered with the new JWT
|
|
864
|
-
*
|
|
865
|
-
* If any errors occur during this process, they are passed to onExchangeError.
|
|
866
|
-
*/
|
|
867
|
-
export declare function TokenExchangeIframe(props: TokenExchangeIframeProps): JSX.Element;
|
|
868
|
-
|
|
869
|
-
export declare interface TokenExchangeIframeProps {
|
|
870
|
-
oneTimeToken: string;
|
|
871
|
-
enableLogging?: boolean | undefined;
|
|
872
|
-
onExchangeComplete: (jwtToken: string) => void;
|
|
873
|
-
onExchangeError?: (error: Error) => void;
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
export declare enum TokenParamKey {
|
|
877
|
-
token = "token",
|
|
878
|
-
accessToken = "access_token"
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
export declare enum TokenParamLocation {
|
|
882
|
-
search = "search",
|
|
883
|
-
hash = "hash"
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
export declare class TokenRefreshError extends CapitalOSError {
|
|
887
|
-
constructor(originalError?: Error);
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
export declare enum TokenType {
|
|
891
|
-
oneTime = "oneTime",
|
|
892
|
-
longLived = "longLived"
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
export declare const useCapitalOsAuthContext: () => CapitalOsAuthenticationContextType;
|
|
896
|
-
|
|
897
|
-
/**
|
|
898
|
-
* connects to child iframe and returns whether the iframe is loaded or not.
|
|
899
|
-
* token was added to the list of dependencies to make sure that the connection is re-established when the token changes.
|
|
900
|
-
*/
|
|
901
|
-
export declare function useIframeConnection({ iframeRef, token, onError, methods, }: {
|
|
902
|
-
iframeRef: React.RefObject<HTMLIFrameElement>;
|
|
903
|
-
token: string | undefined;
|
|
904
|
-
onError: ((error: Error) => void) | undefined | null;
|
|
905
|
-
methods: IframeConnectionMethods;
|
|
906
|
-
}): void;
|
|
907
|
-
|
|
908
|
-
export declare function useIframeUrl({ tokenData, renderingContext, theme, onError, }: {
|
|
909
|
-
tokenData: TokenData | undefined;
|
|
910
|
-
renderingContext: CapitalOsRenderingContext;
|
|
911
|
-
theme?: ThemeColorScheme | undefined;
|
|
912
|
-
onError?: ((error: Error) => void) | undefined;
|
|
913
|
-
}): string | undefined;
|
|
914
|
-
|
|
915
|
-
export { }
|