@edge-markets/connect 1.9.1 → 1.10.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/dist/index.d.mts +56 -5
- package/dist/index.d.ts +56 -5
- package/dist/index.js +107 -15
- package/dist/index.mjs +100 -15
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
type EdgeEnvironment = 'production' | 'sandbox';
|
|
2
|
+
type EdgeDeploymentCell = 'staging' | 'sandbox-staging' | 'sandbox-production' | 'production';
|
|
2
3
|
declare const EDGE_LINK_PATH = "/oauth/link";
|
|
3
4
|
interface EdgeEnvironmentConfig {
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated cognitoDomain is no longer used. Token exchange now goes through EdgeBoost API.
|
|
6
|
-
*/
|
|
7
|
-
cognitoDomain: string;
|
|
8
5
|
apiBaseUrl: string;
|
|
9
6
|
oauthBaseUrl: string;
|
|
10
7
|
userClientUrl: string;
|
|
11
8
|
displayName: string;
|
|
12
9
|
isProduction: boolean;
|
|
13
10
|
}
|
|
11
|
+
interface EdgeDeploymentCellConfig extends EdgeEnvironmentConfig {
|
|
12
|
+
environment: EdgeEnvironment;
|
|
13
|
+
awsAccountId: '124355668944' | '471257598653';
|
|
14
|
+
issuer: string;
|
|
15
|
+
scopePrefix: 'edge-connect-staging/' | 'edge-connect-sandbox/' | 'edge-connect/';
|
|
16
|
+
partnerFacing: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const EDGE_DEPLOYMENT_CELLS: Readonly<Record<EdgeDeploymentCell, EdgeDeploymentCellConfig>>;
|
|
14
19
|
declare const EDGE_ENVIRONMENTS: Readonly<Record<EdgeEnvironment, EdgeEnvironmentConfig>>;
|
|
15
20
|
declare function getEnvironmentConfig(environment: EdgeEnvironment): EdgeEnvironmentConfig;
|
|
21
|
+
declare function getDeploymentCellConfig(cell: EdgeDeploymentCell): EdgeDeploymentCellConfig;
|
|
22
|
+
declare function getAvailableDeploymentCells(): readonly EdgeDeploymentCell[];
|
|
16
23
|
/**
|
|
17
24
|
* Resolves the hosted Link UI URL for an environment.
|
|
18
25
|
*
|
|
@@ -63,6 +70,12 @@ declare const EDGE_SCOPES: {
|
|
|
63
70
|
* Required for: `GET /v1/balance`
|
|
64
71
|
*/
|
|
65
72
|
readonly BALANCE_READ: "balance.read";
|
|
73
|
+
/**
|
|
74
|
+
* Compare partner-held identity data with the authenticated EDGE profile.
|
|
75
|
+
* This is separately allowlisted and returns only a coarse advisory result.
|
|
76
|
+
* Required for: `POST /connect/v2/identity/match`
|
|
77
|
+
*/
|
|
78
|
+
readonly IDENTITY_MATCH: "identity.match";
|
|
66
79
|
/**
|
|
67
80
|
* Reserved for future fund transfers and EDGE-hosted verification sessions.
|
|
68
81
|
* Not available in sandbox or production. Requesting this scope from Link
|
|
@@ -2473,6 +2486,32 @@ interface VerifyIdentityResult {
|
|
|
2473
2486
|
verified: true;
|
|
2474
2487
|
scores: VerifyIdentityScores;
|
|
2475
2488
|
}
|
|
2489
|
+
interface IdentityMatchLegalName {
|
|
2490
|
+
givenName: string;
|
|
2491
|
+
familyName: string;
|
|
2492
|
+
}
|
|
2493
|
+
interface IdentityMatchAddress {
|
|
2494
|
+
line1: string;
|
|
2495
|
+
line2?: string;
|
|
2496
|
+
locality: string;
|
|
2497
|
+
region: string;
|
|
2498
|
+
postalCode: string;
|
|
2499
|
+
country: 'US';
|
|
2500
|
+
}
|
|
2501
|
+
/** Partner-held data only. Never populate this from `getUser()`. */
|
|
2502
|
+
interface IdentityMatchOptions {
|
|
2503
|
+
/** Opaque 16-255 character key. Reuse it only when retrying the exact same request. */
|
|
2504
|
+
idempotencyKey: string;
|
|
2505
|
+
legalName: IdentityMatchLegalName;
|
|
2506
|
+
address?: IdentityMatchAddress;
|
|
2507
|
+
}
|
|
2508
|
+
type IdentityMatchResultValue = 'match' | 'no_match' | 'insufficient_data';
|
|
2509
|
+
interface IdentityMatchResult {
|
|
2510
|
+
decisionId: string;
|
|
2511
|
+
result: IdentityMatchResultValue;
|
|
2512
|
+
matcherVersion: string;
|
|
2513
|
+
evaluatedAt: string;
|
|
2514
|
+
}
|
|
2476
2515
|
/**
|
|
2477
2516
|
* Geolocation data collected by the SDK from the browser or device.
|
|
2478
2517
|
*
|
|
@@ -3113,6 +3152,17 @@ declare class EdgeIdentityVerificationError extends EdgeError {
|
|
|
3113
3152
|
readonly fieldErrors: Record<string, string>;
|
|
3114
3153
|
constructor(fieldErrors: Record<string, string>, message?: string);
|
|
3115
3154
|
}
|
|
3155
|
+
/** Stable identity-match precondition/idempotency failure. Submitted identity data is never attached. */
|
|
3156
|
+
declare class EdgeIdentityMatchConflictError extends EdgeError {
|
|
3157
|
+
constructor(code: 'idempotency_conflict' | 'idempotency_in_progress' | 'match_not_eligible', message?: string);
|
|
3158
|
+
}
|
|
3159
|
+
declare class EdgeIdentityMatchAttemptLimitError extends EdgeError {
|
|
3160
|
+
readonly retryAfterSeconds?: number;
|
|
3161
|
+
constructor(retryAfterSeconds?: number, message?: string);
|
|
3162
|
+
}
|
|
3163
|
+
declare class EdgeIdentityMatchUnavailableError extends EdgeError {
|
|
3164
|
+
constructor(message?: string);
|
|
3165
|
+
}
|
|
3116
3166
|
/**
|
|
3117
3167
|
* Thrown when a popup is blocked by the browser.
|
|
3118
3168
|
*
|
|
@@ -3195,6 +3245,7 @@ declare function isApiError(error: unknown): error is EdgeApiError;
|
|
|
3195
3245
|
* Type guard for identity verification errors.
|
|
3196
3246
|
*/
|
|
3197
3247
|
declare function isIdentityVerificationError(error: unknown): error is EdgeIdentityVerificationError;
|
|
3248
|
+
declare function isIdentityMatchError(error: unknown): error is EdgeIdentityMatchConflictError | EdgeIdentityMatchAttemptLimitError | EdgeIdentityMatchUnavailableError;
|
|
3198
3249
|
/**
|
|
3199
3250
|
* Type guard for network errors.
|
|
3200
3251
|
*/
|
|
@@ -3248,4 +3299,4 @@ declare const SDK_VERSION = "1.0.0";
|
|
|
3248
3299
|
*/
|
|
3249
3300
|
declare const SDK_NAME = "@edge-markets/connect";
|
|
3250
3301
|
|
|
3251
|
-
export { ACTIVE_EDGE_SCOPES, ALL_EDGE_SCOPES, type ApiError, type Balance, type BaseWebhookEvent, type ConsentRequiredError, type ConsentRevokedEventData, type CreateVerificationSessionRequest, EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE, EDGE_ENVIRONMENTS, EDGE_LINK_PATH, EDGE_SCOPES, EDGE_WEBHOOK_EVENT_TYPES, EdgeApiError, EdgeAuthenticationError, EdgeConsentRequiredError, type EdgeEnvironment, type EdgeEnvironmentConfig, EdgeError, EdgeFeatureUnavailableError, EdgeIdentityVerificationError, EdgeInsufficientScopeError, type EdgeLinkConfigBase, type EdgeLinkEvent, type EdgeLinkEventName, type EdgeLinkExit, type EdgeLinkSuccess, EdgeNetworkError, EdgeNotFoundError, EdgePopupBlockedError, EdgePopupClosedError, type EdgeScope, EdgeStateMismatchError, EdgeTokenExchangeError, type EdgeTokens, EdgeValidationError, type EdgeWebhookEvent, type EdgeWebhookEventType, type InitiateTransferRequest, type ListTransfersParams, OTP_METHODS, type OtpMethod, type PKCEPair, RESERVED_EDGE_SCOPES, type RevokeConsentResponse, SCOPE_DESCRIPTIONS, SCOPE_ICONS, SDK_NAME, SDK_VERSION, type SdkGeolocation, TRANSFER_CATEGORIES, TRANSFER_STATUSES, TRANSFER_TYPES, type Transfer, type TransferCategory, type TransferCompletedEventData, type TransferExpiredEventData, type TransferFailedEventData, type TransferList, type TransferListItem, type TransferProcessingEventData, type TransferStatus, type TransferType, type User, type UserAddress, type VerificationSession, type VerificationSessionStatus, type VerificationSessionStatusResponse, type VerifyIdentityAddress, type VerifyIdentityOptions, type VerifyIdentityResult, type VerifyIdentityScores, type components, formatScopeForEnvironment, formatScopesForEnvironment, getAvailableEnvironments, getEnvironmentConfig, getLinkUrl, isApiError, isAuthenticationError, isConsentRequiredError, isEdgeError, isFeatureUnavailableError, isIdentityVerificationError, isNetworkError, isProductionEnvironment, isTransferWriteScope, isValidScope, type operations, parseScope, type paths };
|
|
3302
|
+
export { ACTIVE_EDGE_SCOPES, ALL_EDGE_SCOPES, type ApiError, type Balance, type BaseWebhookEvent, type ConsentRequiredError, type ConsentRevokedEventData, type CreateVerificationSessionRequest, EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE, EDGE_DEPLOYMENT_CELLS, EDGE_ENVIRONMENTS, EDGE_LINK_PATH, EDGE_SCOPES, EDGE_WEBHOOK_EVENT_TYPES, EdgeApiError, EdgeAuthenticationError, EdgeConsentRequiredError, type EdgeDeploymentCell, type EdgeDeploymentCellConfig, type EdgeEnvironment, type EdgeEnvironmentConfig, EdgeError, EdgeFeatureUnavailableError, EdgeIdentityMatchAttemptLimitError, EdgeIdentityMatchConflictError, EdgeIdentityMatchUnavailableError, EdgeIdentityVerificationError, EdgeInsufficientScopeError, type EdgeLinkConfigBase, type EdgeLinkEvent, type EdgeLinkEventName, type EdgeLinkExit, type EdgeLinkSuccess, EdgeNetworkError, EdgeNotFoundError, EdgePopupBlockedError, EdgePopupClosedError, type EdgeScope, EdgeStateMismatchError, EdgeTokenExchangeError, type EdgeTokens, EdgeValidationError, type EdgeWebhookEvent, type EdgeWebhookEventType, type IdentityMatchAddress, type IdentityMatchLegalName, type IdentityMatchOptions, type IdentityMatchResult, type IdentityMatchResultValue, type InitiateTransferRequest, type ListTransfersParams, OTP_METHODS, type OtpMethod, type PKCEPair, RESERVED_EDGE_SCOPES, type RevokeConsentResponse, SCOPE_DESCRIPTIONS, SCOPE_ICONS, SDK_NAME, SDK_VERSION, type SdkGeolocation, TRANSFER_CATEGORIES, TRANSFER_STATUSES, TRANSFER_TYPES, type Transfer, type TransferCategory, type TransferCompletedEventData, type TransferExpiredEventData, type TransferFailedEventData, type TransferList, type TransferListItem, type TransferProcessingEventData, type TransferStatus, type TransferType, type User, type UserAddress, type VerificationSession, type VerificationSessionStatus, type VerificationSessionStatusResponse, type VerifyIdentityAddress, type VerifyIdentityOptions, type VerifyIdentityResult, type VerifyIdentityScores, type components, formatScopeForEnvironment, formatScopesForEnvironment, getAvailableDeploymentCells, getAvailableEnvironments, getDeploymentCellConfig, getEnvironmentConfig, getLinkUrl, isApiError, isAuthenticationError, isConsentRequiredError, isEdgeError, isFeatureUnavailableError, isIdentityMatchError, isIdentityVerificationError, isNetworkError, isProductionEnvironment, isTransferWriteScope, isValidScope, type operations, parseScope, type paths };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
type EdgeEnvironment = 'production' | 'sandbox';
|
|
2
|
+
type EdgeDeploymentCell = 'staging' | 'sandbox-staging' | 'sandbox-production' | 'production';
|
|
2
3
|
declare const EDGE_LINK_PATH = "/oauth/link";
|
|
3
4
|
interface EdgeEnvironmentConfig {
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated cognitoDomain is no longer used. Token exchange now goes through EdgeBoost API.
|
|
6
|
-
*/
|
|
7
|
-
cognitoDomain: string;
|
|
8
5
|
apiBaseUrl: string;
|
|
9
6
|
oauthBaseUrl: string;
|
|
10
7
|
userClientUrl: string;
|
|
11
8
|
displayName: string;
|
|
12
9
|
isProduction: boolean;
|
|
13
10
|
}
|
|
11
|
+
interface EdgeDeploymentCellConfig extends EdgeEnvironmentConfig {
|
|
12
|
+
environment: EdgeEnvironment;
|
|
13
|
+
awsAccountId: '124355668944' | '471257598653';
|
|
14
|
+
issuer: string;
|
|
15
|
+
scopePrefix: 'edge-connect-staging/' | 'edge-connect-sandbox/' | 'edge-connect/';
|
|
16
|
+
partnerFacing: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const EDGE_DEPLOYMENT_CELLS: Readonly<Record<EdgeDeploymentCell, EdgeDeploymentCellConfig>>;
|
|
14
19
|
declare const EDGE_ENVIRONMENTS: Readonly<Record<EdgeEnvironment, EdgeEnvironmentConfig>>;
|
|
15
20
|
declare function getEnvironmentConfig(environment: EdgeEnvironment): EdgeEnvironmentConfig;
|
|
21
|
+
declare function getDeploymentCellConfig(cell: EdgeDeploymentCell): EdgeDeploymentCellConfig;
|
|
22
|
+
declare function getAvailableDeploymentCells(): readonly EdgeDeploymentCell[];
|
|
16
23
|
/**
|
|
17
24
|
* Resolves the hosted Link UI URL for an environment.
|
|
18
25
|
*
|
|
@@ -63,6 +70,12 @@ declare const EDGE_SCOPES: {
|
|
|
63
70
|
* Required for: `GET /v1/balance`
|
|
64
71
|
*/
|
|
65
72
|
readonly BALANCE_READ: "balance.read";
|
|
73
|
+
/**
|
|
74
|
+
* Compare partner-held identity data with the authenticated EDGE profile.
|
|
75
|
+
* This is separately allowlisted and returns only a coarse advisory result.
|
|
76
|
+
* Required for: `POST /connect/v2/identity/match`
|
|
77
|
+
*/
|
|
78
|
+
readonly IDENTITY_MATCH: "identity.match";
|
|
66
79
|
/**
|
|
67
80
|
* Reserved for future fund transfers and EDGE-hosted verification sessions.
|
|
68
81
|
* Not available in sandbox or production. Requesting this scope from Link
|
|
@@ -2473,6 +2486,32 @@ interface VerifyIdentityResult {
|
|
|
2473
2486
|
verified: true;
|
|
2474
2487
|
scores: VerifyIdentityScores;
|
|
2475
2488
|
}
|
|
2489
|
+
interface IdentityMatchLegalName {
|
|
2490
|
+
givenName: string;
|
|
2491
|
+
familyName: string;
|
|
2492
|
+
}
|
|
2493
|
+
interface IdentityMatchAddress {
|
|
2494
|
+
line1: string;
|
|
2495
|
+
line2?: string;
|
|
2496
|
+
locality: string;
|
|
2497
|
+
region: string;
|
|
2498
|
+
postalCode: string;
|
|
2499
|
+
country: 'US';
|
|
2500
|
+
}
|
|
2501
|
+
/** Partner-held data only. Never populate this from `getUser()`. */
|
|
2502
|
+
interface IdentityMatchOptions {
|
|
2503
|
+
/** Opaque 16-255 character key. Reuse it only when retrying the exact same request. */
|
|
2504
|
+
idempotencyKey: string;
|
|
2505
|
+
legalName: IdentityMatchLegalName;
|
|
2506
|
+
address?: IdentityMatchAddress;
|
|
2507
|
+
}
|
|
2508
|
+
type IdentityMatchResultValue = 'match' | 'no_match' | 'insufficient_data';
|
|
2509
|
+
interface IdentityMatchResult {
|
|
2510
|
+
decisionId: string;
|
|
2511
|
+
result: IdentityMatchResultValue;
|
|
2512
|
+
matcherVersion: string;
|
|
2513
|
+
evaluatedAt: string;
|
|
2514
|
+
}
|
|
2476
2515
|
/**
|
|
2477
2516
|
* Geolocation data collected by the SDK from the browser or device.
|
|
2478
2517
|
*
|
|
@@ -3113,6 +3152,17 @@ declare class EdgeIdentityVerificationError extends EdgeError {
|
|
|
3113
3152
|
readonly fieldErrors: Record<string, string>;
|
|
3114
3153
|
constructor(fieldErrors: Record<string, string>, message?: string);
|
|
3115
3154
|
}
|
|
3155
|
+
/** Stable identity-match precondition/idempotency failure. Submitted identity data is never attached. */
|
|
3156
|
+
declare class EdgeIdentityMatchConflictError extends EdgeError {
|
|
3157
|
+
constructor(code: 'idempotency_conflict' | 'idempotency_in_progress' | 'match_not_eligible', message?: string);
|
|
3158
|
+
}
|
|
3159
|
+
declare class EdgeIdentityMatchAttemptLimitError extends EdgeError {
|
|
3160
|
+
readonly retryAfterSeconds?: number;
|
|
3161
|
+
constructor(retryAfterSeconds?: number, message?: string);
|
|
3162
|
+
}
|
|
3163
|
+
declare class EdgeIdentityMatchUnavailableError extends EdgeError {
|
|
3164
|
+
constructor(message?: string);
|
|
3165
|
+
}
|
|
3116
3166
|
/**
|
|
3117
3167
|
* Thrown when a popup is blocked by the browser.
|
|
3118
3168
|
*
|
|
@@ -3195,6 +3245,7 @@ declare function isApiError(error: unknown): error is EdgeApiError;
|
|
|
3195
3245
|
* Type guard for identity verification errors.
|
|
3196
3246
|
*/
|
|
3197
3247
|
declare function isIdentityVerificationError(error: unknown): error is EdgeIdentityVerificationError;
|
|
3248
|
+
declare function isIdentityMatchError(error: unknown): error is EdgeIdentityMatchConflictError | EdgeIdentityMatchAttemptLimitError | EdgeIdentityMatchUnavailableError;
|
|
3198
3249
|
/**
|
|
3199
3250
|
* Type guard for network errors.
|
|
3200
3251
|
*/
|
|
@@ -3248,4 +3299,4 @@ declare const SDK_VERSION = "1.0.0";
|
|
|
3248
3299
|
*/
|
|
3249
3300
|
declare const SDK_NAME = "@edge-markets/connect";
|
|
3250
3301
|
|
|
3251
|
-
export { ACTIVE_EDGE_SCOPES, ALL_EDGE_SCOPES, type ApiError, type Balance, type BaseWebhookEvent, type ConsentRequiredError, type ConsentRevokedEventData, type CreateVerificationSessionRequest, EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE, EDGE_ENVIRONMENTS, EDGE_LINK_PATH, EDGE_SCOPES, EDGE_WEBHOOK_EVENT_TYPES, EdgeApiError, EdgeAuthenticationError, EdgeConsentRequiredError, type EdgeEnvironment, type EdgeEnvironmentConfig, EdgeError, EdgeFeatureUnavailableError, EdgeIdentityVerificationError, EdgeInsufficientScopeError, type EdgeLinkConfigBase, type EdgeLinkEvent, type EdgeLinkEventName, type EdgeLinkExit, type EdgeLinkSuccess, EdgeNetworkError, EdgeNotFoundError, EdgePopupBlockedError, EdgePopupClosedError, type EdgeScope, EdgeStateMismatchError, EdgeTokenExchangeError, type EdgeTokens, EdgeValidationError, type EdgeWebhookEvent, type EdgeWebhookEventType, type InitiateTransferRequest, type ListTransfersParams, OTP_METHODS, type OtpMethod, type PKCEPair, RESERVED_EDGE_SCOPES, type RevokeConsentResponse, SCOPE_DESCRIPTIONS, SCOPE_ICONS, SDK_NAME, SDK_VERSION, type SdkGeolocation, TRANSFER_CATEGORIES, TRANSFER_STATUSES, TRANSFER_TYPES, type Transfer, type TransferCategory, type TransferCompletedEventData, type TransferExpiredEventData, type TransferFailedEventData, type TransferList, type TransferListItem, type TransferProcessingEventData, type TransferStatus, type TransferType, type User, type UserAddress, type VerificationSession, type VerificationSessionStatus, type VerificationSessionStatusResponse, type VerifyIdentityAddress, type VerifyIdentityOptions, type VerifyIdentityResult, type VerifyIdentityScores, type components, formatScopeForEnvironment, formatScopesForEnvironment, getAvailableEnvironments, getEnvironmentConfig, getLinkUrl, isApiError, isAuthenticationError, isConsentRequiredError, isEdgeError, isFeatureUnavailableError, isIdentityVerificationError, isNetworkError, isProductionEnvironment, isTransferWriteScope, isValidScope, type operations, parseScope, type paths };
|
|
3302
|
+
export { ACTIVE_EDGE_SCOPES, ALL_EDGE_SCOPES, type ApiError, type Balance, type BaseWebhookEvent, type ConsentRequiredError, type ConsentRevokedEventData, type CreateVerificationSessionRequest, EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE, EDGE_DEPLOYMENT_CELLS, EDGE_ENVIRONMENTS, EDGE_LINK_PATH, EDGE_SCOPES, EDGE_WEBHOOK_EVENT_TYPES, EdgeApiError, EdgeAuthenticationError, EdgeConsentRequiredError, type EdgeDeploymentCell, type EdgeDeploymentCellConfig, type EdgeEnvironment, type EdgeEnvironmentConfig, EdgeError, EdgeFeatureUnavailableError, EdgeIdentityMatchAttemptLimitError, EdgeIdentityMatchConflictError, EdgeIdentityMatchUnavailableError, EdgeIdentityVerificationError, EdgeInsufficientScopeError, type EdgeLinkConfigBase, type EdgeLinkEvent, type EdgeLinkEventName, type EdgeLinkExit, type EdgeLinkSuccess, EdgeNetworkError, EdgeNotFoundError, EdgePopupBlockedError, EdgePopupClosedError, type EdgeScope, EdgeStateMismatchError, EdgeTokenExchangeError, type EdgeTokens, EdgeValidationError, type EdgeWebhookEvent, type EdgeWebhookEventType, type IdentityMatchAddress, type IdentityMatchLegalName, type IdentityMatchOptions, type IdentityMatchResult, type IdentityMatchResultValue, type InitiateTransferRequest, type ListTransfersParams, OTP_METHODS, type OtpMethod, type PKCEPair, RESERVED_EDGE_SCOPES, type RevokeConsentResponse, SCOPE_DESCRIPTIONS, SCOPE_ICONS, SDK_NAME, SDK_VERSION, type SdkGeolocation, TRANSFER_CATEGORIES, TRANSFER_STATUSES, TRANSFER_TYPES, type Transfer, type TransferCategory, type TransferCompletedEventData, type TransferExpiredEventData, type TransferFailedEventData, type TransferList, type TransferListItem, type TransferProcessingEventData, type TransferStatus, type TransferType, type User, type UserAddress, type VerificationSession, type VerificationSessionStatus, type VerificationSessionStatusResponse, type VerifyIdentityAddress, type VerifyIdentityOptions, type VerifyIdentityResult, type VerifyIdentityScores, type components, formatScopeForEnvironment, formatScopesForEnvironment, getAvailableDeploymentCells, getAvailableEnvironments, getDeploymentCellConfig, getEnvironmentConfig, getLinkUrl, isApiError, isAuthenticationError, isConsentRequiredError, isEdgeError, isFeatureUnavailableError, isIdentityMatchError, isIdentityVerificationError, isNetworkError, isProductionEnvironment, isTransferWriteScope, isValidScope, type operations, parseScope, type paths };
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __export(index_exports, {
|
|
|
23
23
|
ACTIVE_EDGE_SCOPES: () => ACTIVE_EDGE_SCOPES,
|
|
24
24
|
ALL_EDGE_SCOPES: () => ALL_EDGE_SCOPES,
|
|
25
25
|
EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE: () => EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE,
|
|
26
|
+
EDGE_DEPLOYMENT_CELLS: () => EDGE_DEPLOYMENT_CELLS,
|
|
26
27
|
EDGE_ENVIRONMENTS: () => EDGE_ENVIRONMENTS,
|
|
27
28
|
EDGE_LINK_PATH: () => EDGE_LINK_PATH,
|
|
28
29
|
EDGE_SCOPES: () => EDGE_SCOPES,
|
|
@@ -32,6 +33,9 @@ __export(index_exports, {
|
|
|
32
33
|
EdgeConsentRequiredError: () => EdgeConsentRequiredError,
|
|
33
34
|
EdgeError: () => EdgeError,
|
|
34
35
|
EdgeFeatureUnavailableError: () => EdgeFeatureUnavailableError,
|
|
36
|
+
EdgeIdentityMatchAttemptLimitError: () => EdgeIdentityMatchAttemptLimitError,
|
|
37
|
+
EdgeIdentityMatchConflictError: () => EdgeIdentityMatchConflictError,
|
|
38
|
+
EdgeIdentityMatchUnavailableError: () => EdgeIdentityMatchUnavailableError,
|
|
35
39
|
EdgeIdentityVerificationError: () => EdgeIdentityVerificationError,
|
|
36
40
|
EdgeInsufficientScopeError: () => EdgeInsufficientScopeError,
|
|
37
41
|
EdgeNetworkError: () => EdgeNetworkError,
|
|
@@ -52,7 +56,9 @@ __export(index_exports, {
|
|
|
52
56
|
TRANSFER_TYPES: () => TRANSFER_TYPES,
|
|
53
57
|
formatScopeForEnvironment: () => formatScopeForEnvironment,
|
|
54
58
|
formatScopesForEnvironment: () => formatScopesForEnvironment,
|
|
59
|
+
getAvailableDeploymentCells: () => getAvailableDeploymentCells,
|
|
55
60
|
getAvailableEnvironments: () => getAvailableEnvironments,
|
|
61
|
+
getDeploymentCellConfig: () => getDeploymentCellConfig,
|
|
56
62
|
getEnvironmentConfig: () => getEnvironmentConfig,
|
|
57
63
|
getLinkUrl: () => getLinkUrl,
|
|
58
64
|
isApiError: () => isApiError,
|
|
@@ -60,6 +66,7 @@ __export(index_exports, {
|
|
|
60
66
|
isConsentRequiredError: () => isConsentRequiredError,
|
|
61
67
|
isEdgeError: () => isEdgeError,
|
|
62
68
|
isFeatureUnavailableError: () => isFeatureUnavailableError,
|
|
69
|
+
isIdentityMatchError: () => isIdentityMatchError,
|
|
63
70
|
isIdentityVerificationError: () => isIdentityVerificationError,
|
|
64
71
|
isNetworkError: () => isNetworkError,
|
|
65
72
|
isProductionEnvironment: () => isProductionEnvironment,
|
|
@@ -97,30 +104,72 @@ var EDGE_WEBHOOK_EVENT_TYPES = [
|
|
|
97
104
|
|
|
98
105
|
// src/config/environments.ts
|
|
99
106
|
var EDGE_LINK_PATH = "/oauth/link";
|
|
100
|
-
var
|
|
107
|
+
var EDGE_DEPLOYMENT_CELLS = {
|
|
108
|
+
staging: {
|
|
109
|
+
environment: "sandbox",
|
|
110
|
+
apiBaseUrl: "https://connect-staging.edgeboost.io/connect/v1",
|
|
111
|
+
oauthBaseUrl: "https://connect-staging.edgeboost.io/connect/oauth",
|
|
112
|
+
userClientUrl: "https://oauth.staging-app.edgeboost.io",
|
|
113
|
+
issuer: "https://jwks.connect-staging.edgeboost.io",
|
|
114
|
+
scopePrefix: "edge-connect-staging/",
|
|
115
|
+
awsAccountId: "124355668944",
|
|
116
|
+
displayName: "Staging",
|
|
117
|
+
isProduction: false,
|
|
118
|
+
partnerFacing: false
|
|
119
|
+
},
|
|
120
|
+
"sandbox-staging": {
|
|
121
|
+
environment: "sandbox",
|
|
122
|
+
apiBaseUrl: "https://sandbox.connect.staging.edgeboost.io/connect/v1",
|
|
123
|
+
oauthBaseUrl: "https://sandbox.connect.staging.edgeboost.io/connect/oauth",
|
|
124
|
+
userClientUrl: "https://sandbox-oauth.staging-app.edgeboost.io",
|
|
125
|
+
issuer: "https://jwks.sandbox.connect.staging.edgeboost.io",
|
|
126
|
+
scopePrefix: "edge-connect-sandbox/",
|
|
127
|
+
awsAccountId: "124355668944",
|
|
128
|
+
displayName: "Sandbox staging",
|
|
129
|
+
isProduction: false,
|
|
130
|
+
partnerFacing: false
|
|
131
|
+
},
|
|
132
|
+
"sandbox-production": {
|
|
133
|
+
environment: "sandbox",
|
|
134
|
+
apiBaseUrl: "https://sandbox.connect.edgeboost.io/connect/v1",
|
|
135
|
+
oauthBaseUrl: "https://sandbox.connect.edgeboost.io/connect/oauth",
|
|
136
|
+
userClientUrl: "https://sandbox-oauth.edgeboost.io",
|
|
137
|
+
issuer: "https://jwks.sandbox.connect.edgeboost.io",
|
|
138
|
+
scopePrefix: "edge-connect-sandbox/",
|
|
139
|
+
awsAccountId: "471257598653",
|
|
140
|
+
displayName: "Sandbox production",
|
|
141
|
+
isProduction: false,
|
|
142
|
+
partnerFacing: true
|
|
143
|
+
},
|
|
101
144
|
production: {
|
|
102
|
-
|
|
145
|
+
environment: "production",
|
|
103
146
|
apiBaseUrl: "https://connect.edgeboost.io/connect/v1",
|
|
104
147
|
oauthBaseUrl: "https://connect.edgeboost.io/connect/oauth",
|
|
105
148
|
userClientUrl: "https://oauth.edgeboost.io",
|
|
149
|
+
issuer: "https://jwks.connect.edgeboost.io",
|
|
150
|
+
scopePrefix: "edge-connect/",
|
|
151
|
+
awsAccountId: "471257598653",
|
|
106
152
|
displayName: "Production",
|
|
107
|
-
isProduction: true
|
|
108
|
-
|
|
109
|
-
sandbox: {
|
|
110
|
-
cognitoDomain: "https://edge-connect-sandbox.auth.us-east-1.amazoncognito.com",
|
|
111
|
-
// Sandbox partner API — mTLS-enforced. Uses its own sandbox gateway and
|
|
112
|
-
// sandbox OAuth/JWKS issuer. The browser Link UI is served from a separate
|
|
113
|
-
// sandbox host.
|
|
114
|
-
apiBaseUrl: "https://sandbox.connect.staging.edgeboost.io/connect/v1",
|
|
115
|
-
oauthBaseUrl: "https://sandbox.connect.staging.edgeboost.io/connect/oauth",
|
|
116
|
-
userClientUrl: "https://sandbox-oauth.staging-app.edgeboost.io",
|
|
117
|
-
displayName: "Sandbox",
|
|
118
|
-
isProduction: false
|
|
153
|
+
isProduction: true,
|
|
154
|
+
partnerFacing: true
|
|
119
155
|
}
|
|
120
156
|
};
|
|
157
|
+
var EDGE_ENVIRONMENTS = {
|
|
158
|
+
production: EDGE_DEPLOYMENT_CELLS.production,
|
|
159
|
+
// The public SDK has two choices. "sandbox" is the canonical partner
|
|
160
|
+
// sandbox in the production account; internal staging cells use explicit
|
|
161
|
+
// deployment-cell configuration instead of another public environment enum.
|
|
162
|
+
sandbox: EDGE_DEPLOYMENT_CELLS["sandbox-production"]
|
|
163
|
+
};
|
|
121
164
|
function getEnvironmentConfig(environment) {
|
|
122
165
|
return EDGE_ENVIRONMENTS[environment];
|
|
123
166
|
}
|
|
167
|
+
function getDeploymentCellConfig(cell) {
|
|
168
|
+
return EDGE_DEPLOYMENT_CELLS[cell];
|
|
169
|
+
}
|
|
170
|
+
function getAvailableDeploymentCells() {
|
|
171
|
+
return Object.keys(EDGE_DEPLOYMENT_CELLS);
|
|
172
|
+
}
|
|
124
173
|
function getLinkUrl(environment, linkUrl) {
|
|
125
174
|
const configuredUrl = linkUrl?.trim();
|
|
126
175
|
const url = new URL(configuredUrl || `${EDGE_ENVIRONMENTS[environment].userClientUrl}${EDGE_LINK_PATH}`);
|
|
@@ -151,6 +200,12 @@ var EDGE_SCOPES = {
|
|
|
151
200
|
* Required for: `GET /v1/balance`
|
|
152
201
|
*/
|
|
153
202
|
BALANCE_READ: "balance.read",
|
|
203
|
+
/**
|
|
204
|
+
* Compare partner-held identity data with the authenticated EDGE profile.
|
|
205
|
+
* This is separately allowlisted and returns only a coarse advisory result.
|
|
206
|
+
* Required for: `POST /connect/v2/identity/match`
|
|
207
|
+
*/
|
|
208
|
+
IDENTITY_MATCH: "identity.match",
|
|
154
209
|
/**
|
|
155
210
|
* Reserved for future fund transfers and EDGE-hosted verification sessions.
|
|
156
211
|
* Not available in sandbox or production. Requesting this scope from Link
|
|
@@ -162,16 +217,18 @@ var EDGE_SCOPES = {
|
|
|
162
217
|
TRANSFER_WRITE: "transfer.write"
|
|
163
218
|
};
|
|
164
219
|
var ACTIVE_EDGE_SCOPES = [EDGE_SCOPES.USER_READ, EDGE_SCOPES.BALANCE_READ];
|
|
165
|
-
var RESERVED_EDGE_SCOPES = [EDGE_SCOPES.TRANSFER_WRITE];
|
|
220
|
+
var RESERVED_EDGE_SCOPES = [EDGE_SCOPES.IDENTITY_MATCH, EDGE_SCOPES.TRANSFER_WRITE];
|
|
166
221
|
var ALL_EDGE_SCOPES = ACTIVE_EDGE_SCOPES;
|
|
167
222
|
var SCOPE_DESCRIPTIONS = {
|
|
168
223
|
[EDGE_SCOPES.USER_READ]: "View your profile information (name and email)",
|
|
169
224
|
[EDGE_SCOPES.BALANCE_READ]: "View your EdgeBoost account balance",
|
|
225
|
+
[EDGE_SCOPES.IDENTITY_MATCH]: "Compare partner-held identity details and return a coarse advisory result",
|
|
170
226
|
[EDGE_SCOPES.TRANSFER_WRITE]: "Transfers are not available yet"
|
|
171
227
|
};
|
|
172
228
|
var SCOPE_ICONS = {
|
|
173
229
|
[EDGE_SCOPES.USER_READ]: "user",
|
|
174
230
|
[EDGE_SCOPES.BALANCE_READ]: "wallet",
|
|
231
|
+
[EDGE_SCOPES.IDENTITY_MATCH]: "shield-check",
|
|
175
232
|
[EDGE_SCOPES.TRANSFER_WRITE]: "arrow-left-right"
|
|
176
233
|
};
|
|
177
234
|
function formatScopeForEnvironment(scope, environment) {
|
|
@@ -291,6 +348,31 @@ var EdgeIdentityVerificationError = class extends EdgeError {
|
|
|
291
348
|
this.fieldErrors = fieldErrors;
|
|
292
349
|
}
|
|
293
350
|
};
|
|
351
|
+
var EdgeIdentityMatchConflictError = class extends EdgeError {
|
|
352
|
+
constructor(code, message) {
|
|
353
|
+
super(code, message || "Identity match could not be completed because a request precondition failed.", 409);
|
|
354
|
+
this.name = "EdgeIdentityMatchConflictError";
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
var EdgeIdentityMatchAttemptLimitError = class extends EdgeError {
|
|
358
|
+
constructor(retryAfterSeconds, message) {
|
|
359
|
+
super("identity_match_attempt_limit", message || "Identity match attempt limit reached. Retry later.", 429, {
|
|
360
|
+
retryAfterSeconds
|
|
361
|
+
});
|
|
362
|
+
this.name = "EdgeIdentityMatchAttemptLimitError";
|
|
363
|
+
this.retryAfterSeconds = retryAfterSeconds;
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
var EdgeIdentityMatchUnavailableError = class extends EdgeError {
|
|
367
|
+
constructor(message) {
|
|
368
|
+
super(
|
|
369
|
+
"identity_match_unavailable",
|
|
370
|
+
message || "Identity match is temporarily unavailable. Retry with the same idempotency key.",
|
|
371
|
+
503
|
|
372
|
+
);
|
|
373
|
+
this.name = "EdgeIdentityMatchUnavailableError";
|
|
374
|
+
}
|
|
375
|
+
};
|
|
294
376
|
var EdgePopupBlockedError = class extends EdgeError {
|
|
295
377
|
constructor() {
|
|
296
378
|
super("popup_blocked", "Popup was blocked by the browser. Please allow popups for this site and try again.");
|
|
@@ -336,6 +418,9 @@ function isApiError(error) {
|
|
|
336
418
|
function isIdentityVerificationError(error) {
|
|
337
419
|
return error instanceof EdgeIdentityVerificationError;
|
|
338
420
|
}
|
|
421
|
+
function isIdentityMatchError(error) {
|
|
422
|
+
return error instanceof EdgeIdentityMatchConflictError || error instanceof EdgeIdentityMatchAttemptLimitError || error instanceof EdgeIdentityMatchUnavailableError;
|
|
423
|
+
}
|
|
339
424
|
function isNetworkError(error) {
|
|
340
425
|
return error instanceof EdgeNetworkError;
|
|
341
426
|
}
|
|
@@ -351,6 +436,7 @@ var SDK_NAME = "@edge-markets/connect";
|
|
|
351
436
|
ACTIVE_EDGE_SCOPES,
|
|
352
437
|
ALL_EDGE_SCOPES,
|
|
353
438
|
EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE,
|
|
439
|
+
EDGE_DEPLOYMENT_CELLS,
|
|
354
440
|
EDGE_ENVIRONMENTS,
|
|
355
441
|
EDGE_LINK_PATH,
|
|
356
442
|
EDGE_SCOPES,
|
|
@@ -360,6 +446,9 @@ var SDK_NAME = "@edge-markets/connect";
|
|
|
360
446
|
EdgeConsentRequiredError,
|
|
361
447
|
EdgeError,
|
|
362
448
|
EdgeFeatureUnavailableError,
|
|
449
|
+
EdgeIdentityMatchAttemptLimitError,
|
|
450
|
+
EdgeIdentityMatchConflictError,
|
|
451
|
+
EdgeIdentityMatchUnavailableError,
|
|
363
452
|
EdgeIdentityVerificationError,
|
|
364
453
|
EdgeInsufficientScopeError,
|
|
365
454
|
EdgeNetworkError,
|
|
@@ -380,7 +469,9 @@ var SDK_NAME = "@edge-markets/connect";
|
|
|
380
469
|
TRANSFER_TYPES,
|
|
381
470
|
formatScopeForEnvironment,
|
|
382
471
|
formatScopesForEnvironment,
|
|
472
|
+
getAvailableDeploymentCells,
|
|
383
473
|
getAvailableEnvironments,
|
|
474
|
+
getDeploymentCellConfig,
|
|
384
475
|
getEnvironmentConfig,
|
|
385
476
|
getLinkUrl,
|
|
386
477
|
isApiError,
|
|
@@ -388,6 +479,7 @@ var SDK_NAME = "@edge-markets/connect";
|
|
|
388
479
|
isConsentRequiredError,
|
|
389
480
|
isEdgeError,
|
|
390
481
|
isFeatureUnavailableError,
|
|
482
|
+
isIdentityMatchError,
|
|
391
483
|
isIdentityVerificationError,
|
|
392
484
|
isNetworkError,
|
|
393
485
|
isProductionEnvironment,
|
package/dist/index.mjs
CHANGED
|
@@ -26,30 +26,72 @@ var EDGE_WEBHOOK_EVENT_TYPES = [
|
|
|
26
26
|
|
|
27
27
|
// src/config/environments.ts
|
|
28
28
|
var EDGE_LINK_PATH = "/oauth/link";
|
|
29
|
-
var
|
|
29
|
+
var EDGE_DEPLOYMENT_CELLS = {
|
|
30
|
+
staging: {
|
|
31
|
+
environment: "sandbox",
|
|
32
|
+
apiBaseUrl: "https://connect-staging.edgeboost.io/connect/v1",
|
|
33
|
+
oauthBaseUrl: "https://connect-staging.edgeboost.io/connect/oauth",
|
|
34
|
+
userClientUrl: "https://oauth.staging-app.edgeboost.io",
|
|
35
|
+
issuer: "https://jwks.connect-staging.edgeboost.io",
|
|
36
|
+
scopePrefix: "edge-connect-staging/",
|
|
37
|
+
awsAccountId: "124355668944",
|
|
38
|
+
displayName: "Staging",
|
|
39
|
+
isProduction: false,
|
|
40
|
+
partnerFacing: false
|
|
41
|
+
},
|
|
42
|
+
"sandbox-staging": {
|
|
43
|
+
environment: "sandbox",
|
|
44
|
+
apiBaseUrl: "https://sandbox.connect.staging.edgeboost.io/connect/v1",
|
|
45
|
+
oauthBaseUrl: "https://sandbox.connect.staging.edgeboost.io/connect/oauth",
|
|
46
|
+
userClientUrl: "https://sandbox-oauth.staging-app.edgeboost.io",
|
|
47
|
+
issuer: "https://jwks.sandbox.connect.staging.edgeboost.io",
|
|
48
|
+
scopePrefix: "edge-connect-sandbox/",
|
|
49
|
+
awsAccountId: "124355668944",
|
|
50
|
+
displayName: "Sandbox staging",
|
|
51
|
+
isProduction: false,
|
|
52
|
+
partnerFacing: false
|
|
53
|
+
},
|
|
54
|
+
"sandbox-production": {
|
|
55
|
+
environment: "sandbox",
|
|
56
|
+
apiBaseUrl: "https://sandbox.connect.edgeboost.io/connect/v1",
|
|
57
|
+
oauthBaseUrl: "https://sandbox.connect.edgeboost.io/connect/oauth",
|
|
58
|
+
userClientUrl: "https://sandbox-oauth.edgeboost.io",
|
|
59
|
+
issuer: "https://jwks.sandbox.connect.edgeboost.io",
|
|
60
|
+
scopePrefix: "edge-connect-sandbox/",
|
|
61
|
+
awsAccountId: "471257598653",
|
|
62
|
+
displayName: "Sandbox production",
|
|
63
|
+
isProduction: false,
|
|
64
|
+
partnerFacing: true
|
|
65
|
+
},
|
|
30
66
|
production: {
|
|
31
|
-
|
|
67
|
+
environment: "production",
|
|
32
68
|
apiBaseUrl: "https://connect.edgeboost.io/connect/v1",
|
|
33
69
|
oauthBaseUrl: "https://connect.edgeboost.io/connect/oauth",
|
|
34
70
|
userClientUrl: "https://oauth.edgeboost.io",
|
|
71
|
+
issuer: "https://jwks.connect.edgeboost.io",
|
|
72
|
+
scopePrefix: "edge-connect/",
|
|
73
|
+
awsAccountId: "471257598653",
|
|
35
74
|
displayName: "Production",
|
|
36
|
-
isProduction: true
|
|
37
|
-
|
|
38
|
-
sandbox: {
|
|
39
|
-
cognitoDomain: "https://edge-connect-sandbox.auth.us-east-1.amazoncognito.com",
|
|
40
|
-
// Sandbox partner API — mTLS-enforced. Uses its own sandbox gateway and
|
|
41
|
-
// sandbox OAuth/JWKS issuer. The browser Link UI is served from a separate
|
|
42
|
-
// sandbox host.
|
|
43
|
-
apiBaseUrl: "https://sandbox.connect.staging.edgeboost.io/connect/v1",
|
|
44
|
-
oauthBaseUrl: "https://sandbox.connect.staging.edgeboost.io/connect/oauth",
|
|
45
|
-
userClientUrl: "https://sandbox-oauth.staging-app.edgeboost.io",
|
|
46
|
-
displayName: "Sandbox",
|
|
47
|
-
isProduction: false
|
|
75
|
+
isProduction: true,
|
|
76
|
+
partnerFacing: true
|
|
48
77
|
}
|
|
49
78
|
};
|
|
79
|
+
var EDGE_ENVIRONMENTS = {
|
|
80
|
+
production: EDGE_DEPLOYMENT_CELLS.production,
|
|
81
|
+
// The public SDK has two choices. "sandbox" is the canonical partner
|
|
82
|
+
// sandbox in the production account; internal staging cells use explicit
|
|
83
|
+
// deployment-cell configuration instead of another public environment enum.
|
|
84
|
+
sandbox: EDGE_DEPLOYMENT_CELLS["sandbox-production"]
|
|
85
|
+
};
|
|
50
86
|
function getEnvironmentConfig(environment) {
|
|
51
87
|
return EDGE_ENVIRONMENTS[environment];
|
|
52
88
|
}
|
|
89
|
+
function getDeploymentCellConfig(cell) {
|
|
90
|
+
return EDGE_DEPLOYMENT_CELLS[cell];
|
|
91
|
+
}
|
|
92
|
+
function getAvailableDeploymentCells() {
|
|
93
|
+
return Object.keys(EDGE_DEPLOYMENT_CELLS);
|
|
94
|
+
}
|
|
53
95
|
function getLinkUrl(environment, linkUrl) {
|
|
54
96
|
const configuredUrl = linkUrl?.trim();
|
|
55
97
|
const url = new URL(configuredUrl || `${EDGE_ENVIRONMENTS[environment].userClientUrl}${EDGE_LINK_PATH}`);
|
|
@@ -80,6 +122,12 @@ var EDGE_SCOPES = {
|
|
|
80
122
|
* Required for: `GET /v1/balance`
|
|
81
123
|
*/
|
|
82
124
|
BALANCE_READ: "balance.read",
|
|
125
|
+
/**
|
|
126
|
+
* Compare partner-held identity data with the authenticated EDGE profile.
|
|
127
|
+
* This is separately allowlisted and returns only a coarse advisory result.
|
|
128
|
+
* Required for: `POST /connect/v2/identity/match`
|
|
129
|
+
*/
|
|
130
|
+
IDENTITY_MATCH: "identity.match",
|
|
83
131
|
/**
|
|
84
132
|
* Reserved for future fund transfers and EDGE-hosted verification sessions.
|
|
85
133
|
* Not available in sandbox or production. Requesting this scope from Link
|
|
@@ -91,16 +139,18 @@ var EDGE_SCOPES = {
|
|
|
91
139
|
TRANSFER_WRITE: "transfer.write"
|
|
92
140
|
};
|
|
93
141
|
var ACTIVE_EDGE_SCOPES = [EDGE_SCOPES.USER_READ, EDGE_SCOPES.BALANCE_READ];
|
|
94
|
-
var RESERVED_EDGE_SCOPES = [EDGE_SCOPES.TRANSFER_WRITE];
|
|
142
|
+
var RESERVED_EDGE_SCOPES = [EDGE_SCOPES.IDENTITY_MATCH, EDGE_SCOPES.TRANSFER_WRITE];
|
|
95
143
|
var ALL_EDGE_SCOPES = ACTIVE_EDGE_SCOPES;
|
|
96
144
|
var SCOPE_DESCRIPTIONS = {
|
|
97
145
|
[EDGE_SCOPES.USER_READ]: "View your profile information (name and email)",
|
|
98
146
|
[EDGE_SCOPES.BALANCE_READ]: "View your EdgeBoost account balance",
|
|
147
|
+
[EDGE_SCOPES.IDENTITY_MATCH]: "Compare partner-held identity details and return a coarse advisory result",
|
|
99
148
|
[EDGE_SCOPES.TRANSFER_WRITE]: "Transfers are not available yet"
|
|
100
149
|
};
|
|
101
150
|
var SCOPE_ICONS = {
|
|
102
151
|
[EDGE_SCOPES.USER_READ]: "user",
|
|
103
152
|
[EDGE_SCOPES.BALANCE_READ]: "wallet",
|
|
153
|
+
[EDGE_SCOPES.IDENTITY_MATCH]: "shield-check",
|
|
104
154
|
[EDGE_SCOPES.TRANSFER_WRITE]: "arrow-left-right"
|
|
105
155
|
};
|
|
106
156
|
function formatScopeForEnvironment(scope, environment) {
|
|
@@ -220,6 +270,31 @@ var EdgeIdentityVerificationError = class extends EdgeError {
|
|
|
220
270
|
this.fieldErrors = fieldErrors;
|
|
221
271
|
}
|
|
222
272
|
};
|
|
273
|
+
var EdgeIdentityMatchConflictError = class extends EdgeError {
|
|
274
|
+
constructor(code, message) {
|
|
275
|
+
super(code, message || "Identity match could not be completed because a request precondition failed.", 409);
|
|
276
|
+
this.name = "EdgeIdentityMatchConflictError";
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
var EdgeIdentityMatchAttemptLimitError = class extends EdgeError {
|
|
280
|
+
constructor(retryAfterSeconds, message) {
|
|
281
|
+
super("identity_match_attempt_limit", message || "Identity match attempt limit reached. Retry later.", 429, {
|
|
282
|
+
retryAfterSeconds
|
|
283
|
+
});
|
|
284
|
+
this.name = "EdgeIdentityMatchAttemptLimitError";
|
|
285
|
+
this.retryAfterSeconds = retryAfterSeconds;
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
var EdgeIdentityMatchUnavailableError = class extends EdgeError {
|
|
289
|
+
constructor(message) {
|
|
290
|
+
super(
|
|
291
|
+
"identity_match_unavailable",
|
|
292
|
+
message || "Identity match is temporarily unavailable. Retry with the same idempotency key.",
|
|
293
|
+
503
|
|
294
|
+
);
|
|
295
|
+
this.name = "EdgeIdentityMatchUnavailableError";
|
|
296
|
+
}
|
|
297
|
+
};
|
|
223
298
|
var EdgePopupBlockedError = class extends EdgeError {
|
|
224
299
|
constructor() {
|
|
225
300
|
super("popup_blocked", "Popup was blocked by the browser. Please allow popups for this site and try again.");
|
|
@@ -265,6 +340,9 @@ function isApiError(error) {
|
|
|
265
340
|
function isIdentityVerificationError(error) {
|
|
266
341
|
return error instanceof EdgeIdentityVerificationError;
|
|
267
342
|
}
|
|
343
|
+
function isIdentityMatchError(error) {
|
|
344
|
+
return error instanceof EdgeIdentityMatchConflictError || error instanceof EdgeIdentityMatchAttemptLimitError || error instanceof EdgeIdentityMatchUnavailableError;
|
|
345
|
+
}
|
|
268
346
|
function isNetworkError(error) {
|
|
269
347
|
return error instanceof EdgeNetworkError;
|
|
270
348
|
}
|
|
@@ -279,6 +357,7 @@ export {
|
|
|
279
357
|
ACTIVE_EDGE_SCOPES,
|
|
280
358
|
ALL_EDGE_SCOPES,
|
|
281
359
|
EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE,
|
|
360
|
+
EDGE_DEPLOYMENT_CELLS,
|
|
282
361
|
EDGE_ENVIRONMENTS,
|
|
283
362
|
EDGE_LINK_PATH,
|
|
284
363
|
EDGE_SCOPES,
|
|
@@ -288,6 +367,9 @@ export {
|
|
|
288
367
|
EdgeConsentRequiredError,
|
|
289
368
|
EdgeError,
|
|
290
369
|
EdgeFeatureUnavailableError,
|
|
370
|
+
EdgeIdentityMatchAttemptLimitError,
|
|
371
|
+
EdgeIdentityMatchConflictError,
|
|
372
|
+
EdgeIdentityMatchUnavailableError,
|
|
291
373
|
EdgeIdentityVerificationError,
|
|
292
374
|
EdgeInsufficientScopeError,
|
|
293
375
|
EdgeNetworkError,
|
|
@@ -308,7 +390,9 @@ export {
|
|
|
308
390
|
TRANSFER_TYPES,
|
|
309
391
|
formatScopeForEnvironment,
|
|
310
392
|
formatScopesForEnvironment,
|
|
393
|
+
getAvailableDeploymentCells,
|
|
311
394
|
getAvailableEnvironments,
|
|
395
|
+
getDeploymentCellConfig,
|
|
312
396
|
getEnvironmentConfig,
|
|
313
397
|
getLinkUrl,
|
|
314
398
|
isApiError,
|
|
@@ -316,6 +400,7 @@ export {
|
|
|
316
400
|
isConsentRequiredError,
|
|
317
401
|
isEdgeError,
|
|
318
402
|
isFeatureUnavailableError,
|
|
403
|
+
isIdentityMatchError,
|
|
319
404
|
isIdentityVerificationError,
|
|
320
405
|
isNetworkError,
|
|
321
406
|
isProductionEnvironment,
|