@edge-markets/connect 1.0.0 → 1.3.0
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/README.md +6 -0
- package/dist/index.d.mts +250 -195
- package/dist/index.d.ts +250 -195
- package/dist/index.js +50 -45
- package/dist/index.mjs +48 -45
- package/package.json +10 -11
package/README.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,139 @@
|
|
|
1
|
+
type EdgeEnvironment = 'production' | 'staging' | 'sandbox' | 'development';
|
|
2
|
+
interface EdgeEnvironmentConfig {
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated cognitoDomain is no longer used. Token exchange now goes through EdgeBoost API.
|
|
5
|
+
*/
|
|
6
|
+
cognitoDomain: string;
|
|
7
|
+
apiBaseUrl: string;
|
|
8
|
+
oauthBaseUrl: string;
|
|
9
|
+
userClientUrl: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
isProduction: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const EDGE_ENVIRONMENTS: Readonly<Record<EdgeEnvironment, EdgeEnvironmentConfig>>;
|
|
14
|
+
declare function getEnvironmentConfig(environment: EdgeEnvironment): EdgeEnvironmentConfig;
|
|
15
|
+
declare function isProductionEnvironment(environment: EdgeEnvironment): boolean;
|
|
16
|
+
declare function getAvailableEnvironments(): readonly EdgeEnvironment[];
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* EDGE Connect OAuth Scopes
|
|
20
|
+
*
|
|
21
|
+
* OAuth scopes define what permissions your application requests from users.
|
|
22
|
+
* Each scope grants access to specific API endpoints.
|
|
23
|
+
*
|
|
24
|
+
* @module @edge-markets/connect/config
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Available OAuth scopes for EDGE Connect.
|
|
28
|
+
*
|
|
29
|
+
* Request the minimum scopes your application needs.
|
|
30
|
+
* Users see these permissions during the consent flow.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* // Request only what you need
|
|
35
|
+
* link.open({
|
|
36
|
+
* scopes: [EDGE_SCOPES.USER_READ, EDGE_SCOPES.BALANCE_READ],
|
|
37
|
+
* })
|
|
38
|
+
*
|
|
39
|
+
* // Or request all scopes
|
|
40
|
+
* link.open({
|
|
41
|
+
* scopes: ALL_EDGE_SCOPES,
|
|
42
|
+
* })
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
declare const EDGE_SCOPES: {
|
|
46
|
+
/**
|
|
47
|
+
* Read user profile information (name, email).
|
|
48
|
+
* Required for: `GET /v1/user`
|
|
49
|
+
*/
|
|
50
|
+
readonly USER_READ: "user.read";
|
|
51
|
+
/**
|
|
52
|
+
* Read account balance.
|
|
53
|
+
* Required for: `GET /v1/balance`
|
|
54
|
+
*/
|
|
55
|
+
readonly BALANCE_READ: "balance.read";
|
|
56
|
+
/**
|
|
57
|
+
* Initiate and verify fund transfers.
|
|
58
|
+
* Required for: `POST /v1/transfer`, `POST /v1/transfer/:id/verify`, `GET /v1/transfers`
|
|
59
|
+
*/
|
|
60
|
+
readonly TRANSFER_WRITE: "transfer.write";
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Type representing a valid EDGE Connect scope.
|
|
64
|
+
*/
|
|
65
|
+
type EdgeScope = (typeof EDGE_SCOPES)[keyof typeof EDGE_SCOPES];
|
|
66
|
+
/**
|
|
67
|
+
* All available scopes as an array.
|
|
68
|
+
* Use when you need full access to all API features.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* const link = new EdgeLink({
|
|
73
|
+
* clientId: 'your-client-id',
|
|
74
|
+
* environment: 'staging',
|
|
75
|
+
* scopes: ALL_EDGE_SCOPES, // Request all permissions
|
|
76
|
+
* onSuccess: handleSuccess,
|
|
77
|
+
* })
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
declare const ALL_EDGE_SCOPES: readonly EdgeScope[];
|
|
81
|
+
/**
|
|
82
|
+
* Human-readable descriptions for each scope.
|
|
83
|
+
* Useful for building custom consent UIs or explaining permissions.
|
|
84
|
+
*/
|
|
85
|
+
declare const SCOPE_DESCRIPTIONS: Readonly<Record<EdgeScope, string>>;
|
|
86
|
+
/**
|
|
87
|
+
* Icons for each scope (for UI display).
|
|
88
|
+
* Using common icon library names (e.g., Lucide, Heroicons).
|
|
89
|
+
*/
|
|
90
|
+
declare const SCOPE_ICONS: Readonly<Record<EdgeScope, string>>;
|
|
91
|
+
/**
|
|
92
|
+
* Builds the full scope string for a given environment.
|
|
93
|
+
*
|
|
94
|
+
* Different environments may use different scope prefixes in the API Gateway.
|
|
95
|
+
* This function handles the prefix automatically.
|
|
96
|
+
*
|
|
97
|
+
* Note: 'development' environment uses 'staging' scope prefix because it
|
|
98
|
+
* connects to the staging API Gateway for local testing.
|
|
99
|
+
*
|
|
100
|
+
* @param scope - The scope to format
|
|
101
|
+
* @param environment - The target environment
|
|
102
|
+
* @returns The full scope string for API Gateway authorization
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```typescript
|
|
106
|
+
* formatScopeForEnvironment('user.read', 'staging')
|
|
107
|
+
* // Returns: 'edge-connect-staging/user.read'
|
|
108
|
+
*
|
|
109
|
+
* formatScopeForEnvironment('user.read', 'production')
|
|
110
|
+
* // Returns: 'edge-connect/user.read'
|
|
111
|
+
*
|
|
112
|
+
* formatScopeForEnvironment('user.read', 'development')
|
|
113
|
+
* // Returns: 'edge-connect-staging/user.read' (maps to staging)
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
declare function formatScopeForEnvironment(scope: EdgeScope, environment: 'production' | 'staging' | 'sandbox' | 'development'): string;
|
|
117
|
+
/**
|
|
118
|
+
* Formats multiple scopes for an environment.
|
|
119
|
+
*
|
|
120
|
+
* @param scopes - Array of scopes to format
|
|
121
|
+
* @param environment - The target environment
|
|
122
|
+
* @returns Array of full scope strings
|
|
123
|
+
*/
|
|
124
|
+
declare function formatScopesForEnvironment(scopes: readonly EdgeScope[] | EdgeScope[], environment: 'production' | 'staging' | 'sandbox' | 'development'): string[];
|
|
125
|
+
/**
|
|
126
|
+
* Parses a full scope string to extract the base scope.
|
|
127
|
+
*
|
|
128
|
+
* @param fullScope - The full scope string (e.g., 'edge-connect-staging/user.read')
|
|
129
|
+
* @returns The base scope (e.g., 'user.read') or null if invalid
|
|
130
|
+
*/
|
|
131
|
+
declare function parseScope(fullScope: string): EdgeScope | null;
|
|
132
|
+
/**
|
|
133
|
+
* Checks if a scope string is valid.
|
|
134
|
+
*/
|
|
135
|
+
declare function isValidScope(scope: string): scope is EdgeScope;
|
|
136
|
+
|
|
1
137
|
/**
|
|
2
138
|
* This file was auto-generated by openapi-typescript.
|
|
3
139
|
* Do not make direct changes to the file.
|
|
@@ -2308,6 +2444,67 @@ type OtpMethod = 'sms' | 'totp';
|
|
|
2308
2444
|
* Parameters for listing transfers.
|
|
2309
2445
|
*/
|
|
2310
2446
|
type ListTransfersParams = NonNullable<operations['listTransfers']['parameters']['query']>;
|
|
2447
|
+
/**
|
|
2448
|
+
* Address block for identity verification.
|
|
2449
|
+
* The block itself is required; all sub-fields are optional — supply as many
|
|
2450
|
+
* as the partner holds for a higher-confidence match.
|
|
2451
|
+
*/
|
|
2452
|
+
interface VerifyIdentityAddress {
|
|
2453
|
+
/** Street address line (e.g. "123 Main St") */
|
|
2454
|
+
street?: string;
|
|
2455
|
+
city?: string;
|
|
2456
|
+
/** US state code (e.g. "TX") */
|
|
2457
|
+
state?: string;
|
|
2458
|
+
zip?: string;
|
|
2459
|
+
}
|
|
2460
|
+
/**
|
|
2461
|
+
* Options for `EdgeConnectServer.verifyIdentity()`.
|
|
2462
|
+
*
|
|
2463
|
+
* @example
|
|
2464
|
+
* ```typescript
|
|
2465
|
+
* const options: VerifyIdentityOptions = {
|
|
2466
|
+
* firstName: 'John',
|
|
2467
|
+
* lastName: 'Doe',
|
|
2468
|
+
* address: { street: '123 Main St', city: 'Austin', state: 'TX', zip: '78701' },
|
|
2469
|
+
* }
|
|
2470
|
+
* ```
|
|
2471
|
+
*/
|
|
2472
|
+
interface VerifyIdentityOptions {
|
|
2473
|
+
firstName: string;
|
|
2474
|
+
lastName: string;
|
|
2475
|
+
/**
|
|
2476
|
+
* Address details are required per the verification contract.
|
|
2477
|
+
* All sub-fields within the block are individually optional — supply as many
|
|
2478
|
+
* as the partner holds for a higher-confidence match.
|
|
2479
|
+
* Address threshold enforcement is skipped if the EdgeBoost user has no address on file.
|
|
2480
|
+
*/
|
|
2481
|
+
address: VerifyIdentityAddress;
|
|
2482
|
+
}
|
|
2483
|
+
/**
|
|
2484
|
+
* Similarity scores returned when identity verification passes.
|
|
2485
|
+
* Partners should log these for their own audit trail.
|
|
2486
|
+
*/
|
|
2487
|
+
interface VerifyIdentityScores {
|
|
2488
|
+
/** Levenshtein-based full-name similarity score (0–100). Threshold: 70. */
|
|
2489
|
+
name: number;
|
|
2490
|
+
/** Levenshtein-based combined address similarity score (0–100). Threshold: 65. */
|
|
2491
|
+
address: number;
|
|
2492
|
+
/** Whether the ZIP code is an exact digit match. */
|
|
2493
|
+
zipMatch: boolean;
|
|
2494
|
+
}
|
|
2495
|
+
/**
|
|
2496
|
+
* Response from a successful `verifyIdentity()` call.
|
|
2497
|
+
*
|
|
2498
|
+
* @example
|
|
2499
|
+
* ```typescript
|
|
2500
|
+
* const result: VerifyIdentityResult = await edge.verifyIdentity(accessToken, options)
|
|
2501
|
+
* console.log(`Name score: ${result.scores.name}`) // e.g. 95
|
|
2502
|
+
* ```
|
|
2503
|
+
*/
|
|
2504
|
+
interface VerifyIdentityResult {
|
|
2505
|
+
verified: true;
|
|
2506
|
+
scores: VerifyIdentityScores;
|
|
2507
|
+
}
|
|
2311
2508
|
/**
|
|
2312
2509
|
* All possible transfer types.
|
|
2313
2510
|
* Use for validation or building UI select options.
|
|
@@ -2429,201 +2626,29 @@ interface EdgeLinkExit {
|
|
|
2429
2626
|
message: string;
|
|
2430
2627
|
};
|
|
2431
2628
|
}
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
* })
|
|
2455
|
-
* ```
|
|
2456
|
-
*/
|
|
2457
|
-
type EdgeEnvironment = 'production' | 'staging' | 'sandbox';
|
|
2458
|
-
/**
|
|
2459
|
-
* Configuration for a specific environment.
|
|
2460
|
-
*/
|
|
2461
|
-
interface EdgeEnvironmentConfig {
|
|
2462
|
-
/** Legacy: Cognito domain for OAuth token endpoints. */
|
|
2463
|
-
authDomain: string;
|
|
2464
|
-
/** Base URL for the Connect API endpoints (without trailing slash). */
|
|
2465
|
-
apiBaseUrl: string;
|
|
2466
|
-
/** Base URL for OAuth token operations (without trailing slash). */
|
|
2467
|
-
oauthBaseUrl: string;
|
|
2468
|
-
/** URL for the EdgeBoost user client (for Link popup). */
|
|
2469
|
-
userClientUrl: string;
|
|
2470
|
-
/** Human-readable name for debugging/logging. */
|
|
2471
|
-
displayName: string;
|
|
2472
|
-
/** Whether this environment uses real money. */
|
|
2473
|
-
isProduction: boolean;
|
|
2629
|
+
/** PKCE code verifier and challenge pair */
|
|
2630
|
+
interface PKCEPair {
|
|
2631
|
+
verifier: string;
|
|
2632
|
+
challenge: string;
|
|
2633
|
+
}
|
|
2634
|
+
/** Event emitted during the Link flow */
|
|
2635
|
+
interface EdgeLinkEvent {
|
|
2636
|
+
eventName: EdgeLinkEventName;
|
|
2637
|
+
timestamp: number;
|
|
2638
|
+
metadata?: Record<string, unknown>;
|
|
2639
|
+
}
|
|
2640
|
+
/** All possible Link event names (superset of browser + mobile events) */
|
|
2641
|
+
type EdgeLinkEventName = 'OPEN' | 'CLOSE' | 'HANDOFF' | 'TRANSITION' | 'REDIRECT' | 'ERROR' | 'SUCCESS';
|
|
2642
|
+
/** Base configuration shared by all EdgeLink implementations */
|
|
2643
|
+
interface EdgeLinkConfigBase {
|
|
2644
|
+
clientId: string;
|
|
2645
|
+
environment: EdgeEnvironment;
|
|
2646
|
+
onSuccess: (result: EdgeLinkSuccess) => void;
|
|
2647
|
+
onExit?: (metadata: EdgeLinkExit) => void;
|
|
2648
|
+
onEvent?: (event: EdgeLinkEvent) => void;
|
|
2649
|
+
scopes?: EdgeScope[];
|
|
2650
|
+
linkUrl?: string;
|
|
2474
2651
|
}
|
|
2475
|
-
/**
|
|
2476
|
-
* Environment configurations.
|
|
2477
|
-
*
|
|
2478
|
-
* These URLs are updated when infrastructure changes.
|
|
2479
|
-
* Partners shouldn't need to modify these directly.
|
|
2480
|
-
*/
|
|
2481
|
-
declare const EDGE_ENVIRONMENTS: Readonly<Record<EdgeEnvironment, EdgeEnvironmentConfig>>;
|
|
2482
|
-
/**
|
|
2483
|
-
* Gets the configuration for a specific environment.
|
|
2484
|
-
*
|
|
2485
|
-
* @param environment - The environment to get config for
|
|
2486
|
-
* @returns The environment configuration
|
|
2487
|
-
*
|
|
2488
|
-
* @example
|
|
2489
|
-
* ```typescript
|
|
2490
|
-
* const config = getEnvironmentConfig('staging')
|
|
2491
|
-
* console.log(`Using ${config.displayName} at ${config.apiBaseUrl}`)
|
|
2492
|
-
* ```
|
|
2493
|
-
*/
|
|
2494
|
-
declare function getEnvironmentConfig(environment: EdgeEnvironment): EdgeEnvironmentConfig;
|
|
2495
|
-
/**
|
|
2496
|
-
* Checks if an environment is the production environment.
|
|
2497
|
-
*
|
|
2498
|
-
* @param environment - The environment to check
|
|
2499
|
-
* @returns true if this is the production environment
|
|
2500
|
-
*
|
|
2501
|
-
* @example
|
|
2502
|
-
* ```typescript
|
|
2503
|
-
* if (isProductionEnvironment('staging')) {
|
|
2504
|
-
* // false - staging is not production
|
|
2505
|
-
* }
|
|
2506
|
-
* ```
|
|
2507
|
-
*/
|
|
2508
|
-
declare function isProductionEnvironment(environment: EdgeEnvironment): boolean;
|
|
2509
|
-
/**
|
|
2510
|
-
* Gets all available environment names.
|
|
2511
|
-
* Useful for building environment selectors in admin UIs.
|
|
2512
|
-
*/
|
|
2513
|
-
declare function getAvailableEnvironments(): readonly EdgeEnvironment[];
|
|
2514
|
-
|
|
2515
|
-
/**
|
|
2516
|
-
* EDGE Connect OAuth Scopes
|
|
2517
|
-
*
|
|
2518
|
-
* OAuth scopes define what permissions your application requests from users.
|
|
2519
|
-
* Each scope grants access to specific API endpoints.
|
|
2520
|
-
*
|
|
2521
|
-
* @module @edge-markets/connect/config
|
|
2522
|
-
*/
|
|
2523
|
-
/**
|
|
2524
|
-
* Available OAuth scopes for EDGE Connect.
|
|
2525
|
-
*
|
|
2526
|
-
* Request the minimum scopes your application needs.
|
|
2527
|
-
* Users see these permissions during the consent flow.
|
|
2528
|
-
*
|
|
2529
|
-
* @example
|
|
2530
|
-
* ```typescript
|
|
2531
|
-
* // Request only what you need
|
|
2532
|
-
* link.open({
|
|
2533
|
-
* scopes: [EDGE_SCOPES.USER_READ, EDGE_SCOPES.BALANCE_READ],
|
|
2534
|
-
* })
|
|
2535
|
-
*
|
|
2536
|
-
* // Or request all scopes
|
|
2537
|
-
* link.open({
|
|
2538
|
-
* scopes: ALL_EDGE_SCOPES,
|
|
2539
|
-
* })
|
|
2540
|
-
* ```
|
|
2541
|
-
*/
|
|
2542
|
-
declare const EDGE_SCOPES: {
|
|
2543
|
-
/**
|
|
2544
|
-
* Read user profile information (name, email).
|
|
2545
|
-
* Required for: `GET /v1/user`
|
|
2546
|
-
*/
|
|
2547
|
-
readonly USER_READ: "user.read";
|
|
2548
|
-
/**
|
|
2549
|
-
* Read account balance.
|
|
2550
|
-
* Required for: `GET /v1/balance`
|
|
2551
|
-
*/
|
|
2552
|
-
readonly BALANCE_READ: "balance.read";
|
|
2553
|
-
/**
|
|
2554
|
-
* Initiate and verify fund transfers.
|
|
2555
|
-
* Required for: `POST /v1/transfer`, `POST /v1/transfer/:id/verify`, `GET /v1/transfers`
|
|
2556
|
-
*/
|
|
2557
|
-
readonly TRANSFER_WRITE: "transfer.write";
|
|
2558
|
-
};
|
|
2559
|
-
/**
|
|
2560
|
-
* Type representing a valid EDGE Connect scope.
|
|
2561
|
-
*/
|
|
2562
|
-
type EdgeScope = (typeof EDGE_SCOPES)[keyof typeof EDGE_SCOPES];
|
|
2563
|
-
/**
|
|
2564
|
-
* All available scopes as an array.
|
|
2565
|
-
* Use when you need full access to all API features.
|
|
2566
|
-
*
|
|
2567
|
-
* @example
|
|
2568
|
-
* ```typescript
|
|
2569
|
-
* const link = new EdgeLink({
|
|
2570
|
-
* clientId: 'your-client-id',
|
|
2571
|
-
* environment: 'staging',
|
|
2572
|
-
* scopes: ALL_EDGE_SCOPES, // Request all permissions
|
|
2573
|
-
* onSuccess: handleSuccess,
|
|
2574
|
-
* })
|
|
2575
|
-
* ```
|
|
2576
|
-
*/
|
|
2577
|
-
declare const ALL_EDGE_SCOPES: readonly EdgeScope[];
|
|
2578
|
-
/**
|
|
2579
|
-
* Human-readable descriptions for each scope.
|
|
2580
|
-
* Useful for building custom consent UIs or explaining permissions.
|
|
2581
|
-
*/
|
|
2582
|
-
declare const SCOPE_DESCRIPTIONS: Readonly<Record<EdgeScope, string>>;
|
|
2583
|
-
/**
|
|
2584
|
-
* Icons for each scope (for UI display).
|
|
2585
|
-
* Using common icon library names (e.g., Lucide, Heroicons).
|
|
2586
|
-
*/
|
|
2587
|
-
declare const SCOPE_ICONS: Readonly<Record<EdgeScope, string>>;
|
|
2588
|
-
/**
|
|
2589
|
-
* Builds the full scope string for a given environment.
|
|
2590
|
-
*
|
|
2591
|
-
* Different environments may use different scope prefixes in Cognito.
|
|
2592
|
-
* This function handles the prefix automatically.
|
|
2593
|
-
*
|
|
2594
|
-
* @param scope - The scope to format
|
|
2595
|
-
* @param environment - The target environment
|
|
2596
|
-
* @returns The full scope string for Cognito
|
|
2597
|
-
*
|
|
2598
|
-
* @example
|
|
2599
|
-
* ```typescript
|
|
2600
|
-
* formatScopeForEnvironment('user.read', 'staging')
|
|
2601
|
-
* // Returns: 'edge-connect-staging/user.read'
|
|
2602
|
-
*
|
|
2603
|
-
* formatScopeForEnvironment('user.read', 'production')
|
|
2604
|
-
* // Returns: 'edge-connect/user.read'
|
|
2605
|
-
* ```
|
|
2606
|
-
*/
|
|
2607
|
-
declare function formatScopeForEnvironment(scope: EdgeScope, environment: 'production' | 'staging' | 'sandbox'): string;
|
|
2608
|
-
/**
|
|
2609
|
-
* Formats multiple scopes for an environment.
|
|
2610
|
-
*
|
|
2611
|
-
* @param scopes - Array of scopes to format
|
|
2612
|
-
* @param environment - The target environment
|
|
2613
|
-
* @returns Array of full scope strings
|
|
2614
|
-
*/
|
|
2615
|
-
declare function formatScopesForEnvironment(scopes: readonly EdgeScope[] | EdgeScope[], environment: 'production' | 'staging' | 'sandbox'): string[];
|
|
2616
|
-
/**
|
|
2617
|
-
* Parses a full scope string to extract the base scope.
|
|
2618
|
-
*
|
|
2619
|
-
* @param fullScope - The full scope string (e.g., 'edge-connect-staging/user.read')
|
|
2620
|
-
* @returns The base scope (e.g., 'user.read') or null if invalid
|
|
2621
|
-
*/
|
|
2622
|
-
declare function parseScope(fullScope: string): EdgeScope | null;
|
|
2623
|
-
/**
|
|
2624
|
-
* Checks if a scope string is valid.
|
|
2625
|
-
*/
|
|
2626
|
-
declare function isValidScope(scope: string): scope is EdgeScope;
|
|
2627
2652
|
|
|
2628
2653
|
/**
|
|
2629
2654
|
* EDGE Connect SDK Error Classes
|
|
@@ -2838,6 +2863,32 @@ declare class EdgeValidationError extends EdgeError {
|
|
|
2838
2863
|
readonly validationErrors: Record<string, string[]>;
|
|
2839
2864
|
constructor(message: string, validationErrors: Record<string, string[]>);
|
|
2840
2865
|
}
|
|
2866
|
+
/**
|
|
2867
|
+
* Thrown when identity verification fails because one or more fields do not meet
|
|
2868
|
+
* the similarity threshold when compared against the user's stored EdgeBoost profile.
|
|
2869
|
+
*
|
|
2870
|
+
* The `fieldErrors` map contains only the fields that failed verification.
|
|
2871
|
+
* Each value is a human-readable message safe to display directly to the user.
|
|
2872
|
+
*
|
|
2873
|
+
* @example
|
|
2874
|
+
* ```typescript
|
|
2875
|
+
* try {
|
|
2876
|
+
* await edge.verifyIdentity(accessToken, { firstName: 'John', lastName: 'Doe', address: {} })
|
|
2877
|
+
* } catch (error) {
|
|
2878
|
+
* if (error instanceof EdgeIdentityVerificationError) {
|
|
2879
|
+
* if (error.fieldErrors.name) {
|
|
2880
|
+
* showMessage(error.fieldErrors.name)
|
|
2881
|
+
* // "Name doesn't match what is on file, please contact support"
|
|
2882
|
+
* }
|
|
2883
|
+
* }
|
|
2884
|
+
* }
|
|
2885
|
+
* ```
|
|
2886
|
+
*/
|
|
2887
|
+
declare class EdgeIdentityVerificationError extends EdgeError {
|
|
2888
|
+
/** Field-level messages for each failing field. Keys match the request fields (e.g. `name`, `address`). */
|
|
2889
|
+
readonly fieldErrors: Record<string, string>;
|
|
2890
|
+
constructor(fieldErrors: Record<string, string>, message?: string);
|
|
2891
|
+
}
|
|
2841
2892
|
/**
|
|
2842
2893
|
* Thrown when a popup is blocked by the browser.
|
|
2843
2894
|
*
|
|
@@ -2916,6 +2967,10 @@ declare function isConsentRequiredError(error: unknown): error is EdgeConsentReq
|
|
|
2916
2967
|
* Type guard for API errors.
|
|
2917
2968
|
*/
|
|
2918
2969
|
declare function isApiError(error: unknown): error is EdgeApiError;
|
|
2970
|
+
/**
|
|
2971
|
+
* Type guard for identity verification errors.
|
|
2972
|
+
*/
|
|
2973
|
+
declare function isIdentityVerificationError(error: unknown): error is EdgeIdentityVerificationError;
|
|
2919
2974
|
/**
|
|
2920
2975
|
* Type guard for network errors.
|
|
2921
2976
|
*/
|
|
@@ -2968,4 +3023,4 @@ declare const SDK_VERSION = "1.0.0";
|
|
|
2968
3023
|
*/
|
|
2969
3024
|
declare const SDK_NAME = "@edge-markets/connect";
|
|
2970
3025
|
|
|
2971
|
-
export { ALL_EDGE_SCOPES, type ApiError, type Balance, type ConsentRequiredError, EDGE_ENVIRONMENTS, EDGE_SCOPES, EdgeApiError, EdgeAuthenticationError, EdgeConsentRequiredError, type EdgeEnvironment, type EdgeEnvironmentConfig, EdgeError, EdgeInsufficientScopeError, type EdgeLinkExit, type EdgeLinkSuccess, EdgeNetworkError, EdgeNotFoundError, EdgePopupBlockedError, EdgePopupClosedError, type EdgeScope, EdgeStateMismatchError, EdgeTokenExchangeError, type EdgeTokens, EdgeValidationError, type InitiateTransferRequest, type ListTransfersParams, OTP_METHODS, type OtpMethod, type RevokeConsentResponse, SCOPE_DESCRIPTIONS, SCOPE_ICONS, SDK_NAME, SDK_VERSION, TRANSFER_STATUSES, TRANSFER_TYPES, type Transfer, type TransferList, type TransferListItem, type TransferStatus, type TransferType, type User, type VerifyTransferRequest, type components, formatScopeForEnvironment, formatScopesForEnvironment, getAvailableEnvironments, getEnvironmentConfig, isApiError, isAuthenticationError, isConsentRequiredError, isEdgeError, isNetworkError, isProductionEnvironment, isValidScope, type operations, parseScope, type paths };
|
|
3026
|
+
export { ALL_EDGE_SCOPES, type ApiError, type Balance, type ConsentRequiredError, EDGE_ENVIRONMENTS, EDGE_SCOPES, EdgeApiError, EdgeAuthenticationError, EdgeConsentRequiredError, type EdgeEnvironment, type EdgeEnvironmentConfig, EdgeError, EdgeIdentityVerificationError, EdgeInsufficientScopeError, type EdgeLinkConfigBase, type EdgeLinkEvent, type EdgeLinkEventName, type EdgeLinkExit, type EdgeLinkSuccess, EdgeNetworkError, EdgeNotFoundError, EdgePopupBlockedError, EdgePopupClosedError, type EdgeScope, EdgeStateMismatchError, EdgeTokenExchangeError, type EdgeTokens, EdgeValidationError, type InitiateTransferRequest, type ListTransfersParams, OTP_METHODS, type OtpMethod, type PKCEPair, type RevokeConsentResponse, SCOPE_DESCRIPTIONS, SCOPE_ICONS, SDK_NAME, SDK_VERSION, TRANSFER_STATUSES, TRANSFER_TYPES, type Transfer, type TransferList, type TransferListItem, type TransferStatus, type TransferType, type User, type VerifyIdentityAddress, type VerifyIdentityOptions, type VerifyIdentityResult, type VerifyIdentityScores, type VerifyTransferRequest, type components, formatScopeForEnvironment, formatScopesForEnvironment, getAvailableEnvironments, getEnvironmentConfig, isApiError, isAuthenticationError, isConsentRequiredError, isEdgeError, isIdentityVerificationError, isNetworkError, isProductionEnvironment, isValidScope, type operations, parseScope, type paths };
|