@edge-markets/connect 1.7.0 → 1.9.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 +3 -1
- package/dist/index.d.mts +42 -19
- package/dist/index.d.ts +42 -19
- package/dist/index.js +41 -6
- package/dist/index.mjs +35 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -153,7 +153,9 @@ try {
|
|
|
153
153
|
| `EDGE_ENVIRONMENTS` | All environment configs |
|
|
154
154
|
| `getEnvironmentConfig(env)` | Get config for environment |
|
|
155
155
|
| `EDGE_SCOPES` | Available OAuth scopes |
|
|
156
|
-
| `
|
|
156
|
+
| `ACTIVE_EDGE_SCOPES` | Scopes enabled for current partner integrations |
|
|
157
|
+
| `ALL_EDGE_SCOPES` | Alias for all currently requestable scopes |
|
|
158
|
+
| `RESERVED_EDGE_SCOPES` | Future-only scopes that should not be requested |
|
|
157
159
|
| `formatScopeForEnvironment(scope, env)` | Format scope for Cognito |
|
|
158
160
|
|
|
159
161
|
### Errors
|
package/dist/index.d.mts
CHANGED
|
@@ -45,7 +45,7 @@ declare function getAvailableEnvironments(): readonly EdgeEnvironment[];
|
|
|
45
45
|
* scopes: [EDGE_SCOPES.USER_READ, EDGE_SCOPES.BALANCE_READ],
|
|
46
46
|
* })
|
|
47
47
|
*
|
|
48
|
-
* // Or request all scopes
|
|
48
|
+
* // Or request all currently enabled scopes
|
|
49
49
|
* link.open({
|
|
50
50
|
* scopes: ALL_EDGE_SCOPES,
|
|
51
51
|
* })
|
|
@@ -63,7 +63,11 @@ declare const EDGE_SCOPES: {
|
|
|
63
63
|
*/
|
|
64
64
|
readonly BALANCE_READ: "balance.read";
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* Reserved for future fund transfers and EDGE-hosted verification sessions.
|
|
67
|
+
* Not available in staging or production. Requesting this scope from Link
|
|
68
|
+
* SDKs fails with EdgeFeatureUnavailableError until EDGE enables transfers
|
|
69
|
+
* for a partner.
|
|
70
|
+
*
|
|
67
71
|
* Required for: `POST /v1/transfer`, `POST /v1/transfer/:id/verification-session`, `GET /v1/transfers`
|
|
68
72
|
*/
|
|
69
73
|
readonly TRANSFER_WRITE: "transfer.write";
|
|
@@ -73,15 +77,29 @@ declare const EDGE_SCOPES: {
|
|
|
73
77
|
*/
|
|
74
78
|
type EdgeScope = (typeof EDGE_SCOPES)[keyof typeof EDGE_SCOPES];
|
|
75
79
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
80
|
+
* Scopes active for current EDGE Connect partner integrations.
|
|
81
|
+
*
|
|
82
|
+
* Transfers are intentionally unavailable for now, so SDK Link flows request
|
|
83
|
+
* this set by default.
|
|
84
|
+
*/
|
|
85
|
+
declare const ACTIVE_EDGE_SCOPES: readonly EdgeScope[];
|
|
86
|
+
/**
|
|
87
|
+
* Reserved scopes kept in the SDK catalog for future feature launches.
|
|
88
|
+
*
|
|
89
|
+
* Do not request these scopes unless EDGE has explicitly enabled the feature
|
|
90
|
+
* for your integration.
|
|
91
|
+
*/
|
|
92
|
+
declare const RESERVED_EDGE_SCOPES: readonly EdgeScope[];
|
|
93
|
+
/**
|
|
94
|
+
* All currently requestable scopes as an array.
|
|
95
|
+
* This intentionally excludes reserved scopes such as `transfer.write`.
|
|
78
96
|
*
|
|
79
97
|
* @example
|
|
80
98
|
* ```typescript
|
|
81
99
|
* const link = new EdgeLink({
|
|
82
100
|
* clientId: 'your-client-id',
|
|
83
101
|
* environment: 'staging',
|
|
84
|
-
* scopes: ALL_EDGE_SCOPES, //
|
|
102
|
+
* scopes: ALL_EDGE_SCOPES, // Same values as ACTIVE_EDGE_SCOPES today
|
|
85
103
|
* onSuccess: handleSuccess,
|
|
86
104
|
* })
|
|
87
105
|
* ```
|
|
@@ -142,6 +160,12 @@ declare function parseScope(fullScope: string): EdgeScope | null;
|
|
|
142
160
|
* Checks if a scope string is valid.
|
|
143
161
|
*/
|
|
144
162
|
declare function isValidScope(scope: string): scope is EdgeScope;
|
|
163
|
+
/**
|
|
164
|
+
* Checks whether a scope string requests the future transfer feature.
|
|
165
|
+
* Accepts either short scopes (`transfer.write`) or formatted environment
|
|
166
|
+
* scopes (`edge-connect-staging/transfer.write`).
|
|
167
|
+
*/
|
|
168
|
+
declare function isTransferWriteScope(scope: string): boolean;
|
|
145
169
|
|
|
146
170
|
/**
|
|
147
171
|
* This file was auto-generated by openapi-typescript.
|
|
@@ -695,17 +719,7 @@ interface paths {
|
|
|
695
719
|
put?: never;
|
|
696
720
|
/**
|
|
697
721
|
* Initiate a transfer
|
|
698
|
-
* @description
|
|
699
|
-
*
|
|
700
|
-
* **Transfer Types:**
|
|
701
|
-
* - `debit`: Pull funds FROM user's EdgeBoost TO partner (user deposits to partner platform)
|
|
702
|
-
* - `credit`: Push funds FROM partner TO user's EdgeBoost (user withdraws from partner platform)
|
|
703
|
-
*
|
|
704
|
-
* **Idempotency:**
|
|
705
|
-
* Use the `idempotencyKey` to safely retry requests. If a transfer with the same key exists, its current status will be returned.
|
|
706
|
-
*
|
|
707
|
-
* **OTP Verification:**
|
|
708
|
-
* After initiating, the transfer will be in `pending_verification` status. Call `POST /transfer/{transferId}/verification-session` to create an EDGE-hosted verification session and embed the returned `verificationUrl` in your frontend.
|
|
722
|
+
* @description Reserved for a future transfer release. Currently returns feature_unavailable with message: Feature not available yet, please contact Edge product team for more details.
|
|
709
723
|
*/
|
|
710
724
|
post: operations['initiateTransfer'];
|
|
711
725
|
delete?: never;
|
|
@@ -723,7 +737,7 @@ interface paths {
|
|
|
723
737
|
};
|
|
724
738
|
/**
|
|
725
739
|
* Get transfer status
|
|
726
|
-
* @description
|
|
740
|
+
* @description Reserved for a future transfer release. Currently returns feature_unavailable with message: Feature not available yet, please contact Edge product team for more details.
|
|
727
741
|
*/
|
|
728
742
|
get: operations['getTransferStatus'];
|
|
729
743
|
put?: never;
|
|
@@ -743,7 +757,7 @@ interface paths {
|
|
|
743
757
|
};
|
|
744
758
|
/**
|
|
745
759
|
* List transfers
|
|
746
|
-
* @description
|
|
760
|
+
* @description Reserved for a future transfer release. Currently returns feature_unavailable with message: Feature not available yet, please contact Edge product team for more details.
|
|
747
761
|
*/
|
|
748
762
|
get: operations['listTransfers'];
|
|
749
763
|
put?: never;
|
|
@@ -3011,6 +3025,14 @@ declare class EdgeInsufficientScopeError extends EdgeError {
|
|
|
3011
3025
|
readonly missingScopes: string[];
|
|
3012
3026
|
constructor(missingScopes: string[], message?: string);
|
|
3013
3027
|
}
|
|
3028
|
+
declare const EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE = "Feature not available yet, please contact Edge product team for more details";
|
|
3029
|
+
/**
|
|
3030
|
+
* Thrown when an SDK surface exists for a future EDGE Connect feature that is
|
|
3031
|
+
* not active for partners yet.
|
|
3032
|
+
*/
|
|
3033
|
+
declare class EdgeFeatureUnavailableError extends EdgeError {
|
|
3034
|
+
constructor(message?: string);
|
|
3035
|
+
}
|
|
3014
3036
|
/**
|
|
3015
3037
|
* Thrown when an API request fails with a known error.
|
|
3016
3038
|
*
|
|
@@ -3182,6 +3204,7 @@ declare function isIdentityVerificationError(error: unknown): error is EdgeIdent
|
|
|
3182
3204
|
* Type guard for network errors.
|
|
3183
3205
|
*/
|
|
3184
3206
|
declare function isNetworkError(error: unknown): error is EdgeNetworkError;
|
|
3207
|
+
declare function isFeatureUnavailableError(error: unknown): error is EdgeFeatureUnavailableError;
|
|
3185
3208
|
|
|
3186
3209
|
/**
|
|
3187
3210
|
* @edge-markets/connect
|
|
@@ -3230,4 +3253,4 @@ declare const SDK_VERSION = "1.0.0";
|
|
|
3230
3253
|
*/
|
|
3231
3254
|
declare const SDK_NAME = "@edge-markets/connect";
|
|
3232
3255
|
|
|
3233
|
-
export { ALL_EDGE_SCOPES, type ApiError, type Balance, type BaseWebhookEvent, type ConsentRequiredError, type ConsentRevokedEventData, type CreateVerificationSessionRequest, EDGE_ENVIRONMENTS, EDGE_LINK_PATH, EDGE_SCOPES, EDGE_WEBHOOK_EVENT_TYPES, 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 EdgeWebhookEvent, type EdgeWebhookEventType, type InitiateTransferRequest, type ListTransfersParams, OTP_METHODS, type OtpMethod, type PKCEPair, 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, isIdentityVerificationError, isNetworkError, isProductionEnvironment, isValidScope, type operations, parseScope, type paths };
|
|
3256
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ declare function getAvailableEnvironments(): readonly EdgeEnvironment[];
|
|
|
45
45
|
* scopes: [EDGE_SCOPES.USER_READ, EDGE_SCOPES.BALANCE_READ],
|
|
46
46
|
* })
|
|
47
47
|
*
|
|
48
|
-
* // Or request all scopes
|
|
48
|
+
* // Or request all currently enabled scopes
|
|
49
49
|
* link.open({
|
|
50
50
|
* scopes: ALL_EDGE_SCOPES,
|
|
51
51
|
* })
|
|
@@ -63,7 +63,11 @@ declare const EDGE_SCOPES: {
|
|
|
63
63
|
*/
|
|
64
64
|
readonly BALANCE_READ: "balance.read";
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* Reserved for future fund transfers and EDGE-hosted verification sessions.
|
|
67
|
+
* Not available in staging or production. Requesting this scope from Link
|
|
68
|
+
* SDKs fails with EdgeFeatureUnavailableError until EDGE enables transfers
|
|
69
|
+
* for a partner.
|
|
70
|
+
*
|
|
67
71
|
* Required for: `POST /v1/transfer`, `POST /v1/transfer/:id/verification-session`, `GET /v1/transfers`
|
|
68
72
|
*/
|
|
69
73
|
readonly TRANSFER_WRITE: "transfer.write";
|
|
@@ -73,15 +77,29 @@ declare const EDGE_SCOPES: {
|
|
|
73
77
|
*/
|
|
74
78
|
type EdgeScope = (typeof EDGE_SCOPES)[keyof typeof EDGE_SCOPES];
|
|
75
79
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
80
|
+
* Scopes active for current EDGE Connect partner integrations.
|
|
81
|
+
*
|
|
82
|
+
* Transfers are intentionally unavailable for now, so SDK Link flows request
|
|
83
|
+
* this set by default.
|
|
84
|
+
*/
|
|
85
|
+
declare const ACTIVE_EDGE_SCOPES: readonly EdgeScope[];
|
|
86
|
+
/**
|
|
87
|
+
* Reserved scopes kept in the SDK catalog for future feature launches.
|
|
88
|
+
*
|
|
89
|
+
* Do not request these scopes unless EDGE has explicitly enabled the feature
|
|
90
|
+
* for your integration.
|
|
91
|
+
*/
|
|
92
|
+
declare const RESERVED_EDGE_SCOPES: readonly EdgeScope[];
|
|
93
|
+
/**
|
|
94
|
+
* All currently requestable scopes as an array.
|
|
95
|
+
* This intentionally excludes reserved scopes such as `transfer.write`.
|
|
78
96
|
*
|
|
79
97
|
* @example
|
|
80
98
|
* ```typescript
|
|
81
99
|
* const link = new EdgeLink({
|
|
82
100
|
* clientId: 'your-client-id',
|
|
83
101
|
* environment: 'staging',
|
|
84
|
-
* scopes: ALL_EDGE_SCOPES, //
|
|
102
|
+
* scopes: ALL_EDGE_SCOPES, // Same values as ACTIVE_EDGE_SCOPES today
|
|
85
103
|
* onSuccess: handleSuccess,
|
|
86
104
|
* })
|
|
87
105
|
* ```
|
|
@@ -142,6 +160,12 @@ declare function parseScope(fullScope: string): EdgeScope | null;
|
|
|
142
160
|
* Checks if a scope string is valid.
|
|
143
161
|
*/
|
|
144
162
|
declare function isValidScope(scope: string): scope is EdgeScope;
|
|
163
|
+
/**
|
|
164
|
+
* Checks whether a scope string requests the future transfer feature.
|
|
165
|
+
* Accepts either short scopes (`transfer.write`) or formatted environment
|
|
166
|
+
* scopes (`edge-connect-staging/transfer.write`).
|
|
167
|
+
*/
|
|
168
|
+
declare function isTransferWriteScope(scope: string): boolean;
|
|
145
169
|
|
|
146
170
|
/**
|
|
147
171
|
* This file was auto-generated by openapi-typescript.
|
|
@@ -695,17 +719,7 @@ interface paths {
|
|
|
695
719
|
put?: never;
|
|
696
720
|
/**
|
|
697
721
|
* Initiate a transfer
|
|
698
|
-
* @description
|
|
699
|
-
*
|
|
700
|
-
* **Transfer Types:**
|
|
701
|
-
* - `debit`: Pull funds FROM user's EdgeBoost TO partner (user deposits to partner platform)
|
|
702
|
-
* - `credit`: Push funds FROM partner TO user's EdgeBoost (user withdraws from partner platform)
|
|
703
|
-
*
|
|
704
|
-
* **Idempotency:**
|
|
705
|
-
* Use the `idempotencyKey` to safely retry requests. If a transfer with the same key exists, its current status will be returned.
|
|
706
|
-
*
|
|
707
|
-
* **OTP Verification:**
|
|
708
|
-
* After initiating, the transfer will be in `pending_verification` status. Call `POST /transfer/{transferId}/verification-session` to create an EDGE-hosted verification session and embed the returned `verificationUrl` in your frontend.
|
|
722
|
+
* @description Reserved for a future transfer release. Currently returns feature_unavailable with message: Feature not available yet, please contact Edge product team for more details.
|
|
709
723
|
*/
|
|
710
724
|
post: operations['initiateTransfer'];
|
|
711
725
|
delete?: never;
|
|
@@ -723,7 +737,7 @@ interface paths {
|
|
|
723
737
|
};
|
|
724
738
|
/**
|
|
725
739
|
* Get transfer status
|
|
726
|
-
* @description
|
|
740
|
+
* @description Reserved for a future transfer release. Currently returns feature_unavailable with message: Feature not available yet, please contact Edge product team for more details.
|
|
727
741
|
*/
|
|
728
742
|
get: operations['getTransferStatus'];
|
|
729
743
|
put?: never;
|
|
@@ -743,7 +757,7 @@ interface paths {
|
|
|
743
757
|
};
|
|
744
758
|
/**
|
|
745
759
|
* List transfers
|
|
746
|
-
* @description
|
|
760
|
+
* @description Reserved for a future transfer release. Currently returns feature_unavailable with message: Feature not available yet, please contact Edge product team for more details.
|
|
747
761
|
*/
|
|
748
762
|
get: operations['listTransfers'];
|
|
749
763
|
put?: never;
|
|
@@ -3011,6 +3025,14 @@ declare class EdgeInsufficientScopeError extends EdgeError {
|
|
|
3011
3025
|
readonly missingScopes: string[];
|
|
3012
3026
|
constructor(missingScopes: string[], message?: string);
|
|
3013
3027
|
}
|
|
3028
|
+
declare const EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE = "Feature not available yet, please contact Edge product team for more details";
|
|
3029
|
+
/**
|
|
3030
|
+
* Thrown when an SDK surface exists for a future EDGE Connect feature that is
|
|
3031
|
+
* not active for partners yet.
|
|
3032
|
+
*/
|
|
3033
|
+
declare class EdgeFeatureUnavailableError extends EdgeError {
|
|
3034
|
+
constructor(message?: string);
|
|
3035
|
+
}
|
|
3014
3036
|
/**
|
|
3015
3037
|
* Thrown when an API request fails with a known error.
|
|
3016
3038
|
*
|
|
@@ -3182,6 +3204,7 @@ declare function isIdentityVerificationError(error: unknown): error is EdgeIdent
|
|
|
3182
3204
|
* Type guard for network errors.
|
|
3183
3205
|
*/
|
|
3184
3206
|
declare function isNetworkError(error: unknown): error is EdgeNetworkError;
|
|
3207
|
+
declare function isFeatureUnavailableError(error: unknown): error is EdgeFeatureUnavailableError;
|
|
3185
3208
|
|
|
3186
3209
|
/**
|
|
3187
3210
|
* @edge-markets/connect
|
|
@@ -3230,4 +3253,4 @@ declare const SDK_VERSION = "1.0.0";
|
|
|
3230
3253
|
*/
|
|
3231
3254
|
declare const SDK_NAME = "@edge-markets/connect";
|
|
3232
3255
|
|
|
3233
|
-
export { ALL_EDGE_SCOPES, type ApiError, type Balance, type BaseWebhookEvent, type ConsentRequiredError, type ConsentRevokedEventData, type CreateVerificationSessionRequest, EDGE_ENVIRONMENTS, EDGE_LINK_PATH, EDGE_SCOPES, EDGE_WEBHOOK_EVENT_TYPES, 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 EdgeWebhookEvent, type EdgeWebhookEventType, type InitiateTransferRequest, type ListTransfersParams, OTP_METHODS, type OtpMethod, type PKCEPair, 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, isIdentityVerificationError, isNetworkError, isProductionEnvironment, isValidScope, type operations, parseScope, type paths };
|
|
3256
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
ACTIVE_EDGE_SCOPES: () => ACTIVE_EDGE_SCOPES,
|
|
23
24
|
ALL_EDGE_SCOPES: () => ALL_EDGE_SCOPES,
|
|
25
|
+
EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE: () => EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE,
|
|
24
26
|
EDGE_ENVIRONMENTS: () => EDGE_ENVIRONMENTS,
|
|
25
27
|
EDGE_LINK_PATH: () => EDGE_LINK_PATH,
|
|
26
28
|
EDGE_SCOPES: () => EDGE_SCOPES,
|
|
@@ -29,6 +31,7 @@ __export(index_exports, {
|
|
|
29
31
|
EdgeAuthenticationError: () => EdgeAuthenticationError,
|
|
30
32
|
EdgeConsentRequiredError: () => EdgeConsentRequiredError,
|
|
31
33
|
EdgeError: () => EdgeError,
|
|
34
|
+
EdgeFeatureUnavailableError: () => EdgeFeatureUnavailableError,
|
|
32
35
|
EdgeIdentityVerificationError: () => EdgeIdentityVerificationError,
|
|
33
36
|
EdgeInsufficientScopeError: () => EdgeInsufficientScopeError,
|
|
34
37
|
EdgeNetworkError: () => EdgeNetworkError,
|
|
@@ -39,6 +42,7 @@ __export(index_exports, {
|
|
|
39
42
|
EdgeTokenExchangeError: () => EdgeTokenExchangeError,
|
|
40
43
|
EdgeValidationError: () => EdgeValidationError,
|
|
41
44
|
OTP_METHODS: () => OTP_METHODS,
|
|
45
|
+
RESERVED_EDGE_SCOPES: () => RESERVED_EDGE_SCOPES,
|
|
42
46
|
SCOPE_DESCRIPTIONS: () => SCOPE_DESCRIPTIONS,
|
|
43
47
|
SCOPE_ICONS: () => SCOPE_ICONS,
|
|
44
48
|
SDK_NAME: () => SDK_NAME,
|
|
@@ -55,9 +59,11 @@ __export(index_exports, {
|
|
|
55
59
|
isAuthenticationError: () => isAuthenticationError,
|
|
56
60
|
isConsentRequiredError: () => isConsentRequiredError,
|
|
57
61
|
isEdgeError: () => isEdgeError,
|
|
62
|
+
isFeatureUnavailableError: () => isFeatureUnavailableError,
|
|
58
63
|
isIdentityVerificationError: () => isIdentityVerificationError,
|
|
59
64
|
isNetworkError: () => isNetworkError,
|
|
60
65
|
isProductionEnvironment: () => isProductionEnvironment,
|
|
66
|
+
isTransferWriteScope: () => isTransferWriteScope,
|
|
61
67
|
isValidScope: () => isValidScope,
|
|
62
68
|
parseScope: () => parseScope
|
|
63
69
|
});
|
|
@@ -118,9 +124,12 @@ var EDGE_ENVIRONMENTS = {
|
|
|
118
124
|
},
|
|
119
125
|
sandbox: {
|
|
120
126
|
cognitoDomain: "https://edge-connect-sandbox.auth.us-east-1.amazoncognito.com",
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
127
|
+
// Sandbox partner API — mTLS-enforced. Uses its own sandbox gateway and
|
|
128
|
+
// sandbox OAuth/JWKS issuer. The browser Link UI is served from a separate
|
|
129
|
+
// sandbox host so SDK consumers do not enter the staging OAuth origin.
|
|
130
|
+
apiBaseUrl: "https://sandbox.connect.staging.edgeboost.io/connect/v1",
|
|
131
|
+
oauthBaseUrl: "https://sandbox.connect.staging.edgeboost.io/connect/oauth",
|
|
132
|
+
userClientUrl: "https://sandbox-oauth.staging-app.edgeboost.io",
|
|
124
133
|
displayName: "Sandbox",
|
|
125
134
|
isProduction: false
|
|
126
135
|
},
|
|
@@ -177,16 +186,22 @@ var EDGE_SCOPES = {
|
|
|
177
186
|
*/
|
|
178
187
|
BALANCE_READ: "balance.read",
|
|
179
188
|
/**
|
|
180
|
-
*
|
|
189
|
+
* Reserved for future fund transfers and EDGE-hosted verification sessions.
|
|
190
|
+
* Not available in staging or production. Requesting this scope from Link
|
|
191
|
+
* SDKs fails with EdgeFeatureUnavailableError until EDGE enables transfers
|
|
192
|
+
* for a partner.
|
|
193
|
+
*
|
|
181
194
|
* Required for: `POST /v1/transfer`, `POST /v1/transfer/:id/verification-session`, `GET /v1/transfers`
|
|
182
195
|
*/
|
|
183
196
|
TRANSFER_WRITE: "transfer.write"
|
|
184
197
|
};
|
|
185
|
-
var
|
|
198
|
+
var ACTIVE_EDGE_SCOPES = [EDGE_SCOPES.USER_READ, EDGE_SCOPES.BALANCE_READ];
|
|
199
|
+
var RESERVED_EDGE_SCOPES = [EDGE_SCOPES.TRANSFER_WRITE];
|
|
200
|
+
var ALL_EDGE_SCOPES = ACTIVE_EDGE_SCOPES;
|
|
186
201
|
var SCOPE_DESCRIPTIONS = {
|
|
187
202
|
[EDGE_SCOPES.USER_READ]: "View your profile information (name and email)",
|
|
188
203
|
[EDGE_SCOPES.BALANCE_READ]: "View your EdgeBoost account balance",
|
|
189
|
-
[EDGE_SCOPES.TRANSFER_WRITE]: "
|
|
204
|
+
[EDGE_SCOPES.TRANSFER_WRITE]: "Transfers are not available yet"
|
|
190
205
|
};
|
|
191
206
|
var SCOPE_ICONS = {
|
|
192
207
|
[EDGE_SCOPES.USER_READ]: "user",
|
|
@@ -210,6 +225,10 @@ function parseScope(fullScope) {
|
|
|
210
225
|
function isValidScope(scope) {
|
|
211
226
|
return Object.values(EDGE_SCOPES).includes(scope);
|
|
212
227
|
}
|
|
228
|
+
function isTransferWriteScope(scope) {
|
|
229
|
+
const normalized = typeof scope === "string" ? scope.trim() : "";
|
|
230
|
+
return normalized === EDGE_SCOPES.TRANSFER_WRITE || normalized.endsWith(`/${EDGE_SCOPES.TRANSFER_WRITE}`);
|
|
231
|
+
}
|
|
213
232
|
|
|
214
233
|
// src/errors/edge.error.ts
|
|
215
234
|
var EdgeError = class _EdgeError extends Error {
|
|
@@ -270,6 +289,13 @@ var EdgeInsufficientScopeError = class extends EdgeError {
|
|
|
270
289
|
this.missingScopes = missingScopes;
|
|
271
290
|
}
|
|
272
291
|
};
|
|
292
|
+
var EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE = "Feature not available yet, please contact Edge product team for more details";
|
|
293
|
+
var EdgeFeatureUnavailableError = class extends EdgeError {
|
|
294
|
+
constructor(message = EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE) {
|
|
295
|
+
super("feature_unavailable", message, 501);
|
|
296
|
+
this.name = "EdgeFeatureUnavailableError";
|
|
297
|
+
}
|
|
298
|
+
};
|
|
273
299
|
var EdgeApiError = class extends EdgeError {
|
|
274
300
|
constructor(code, message, statusCode, details) {
|
|
275
301
|
super(code, message, statusCode, details);
|
|
@@ -348,13 +374,18 @@ function isIdentityVerificationError(error) {
|
|
|
348
374
|
function isNetworkError(error) {
|
|
349
375
|
return error instanceof EdgeNetworkError;
|
|
350
376
|
}
|
|
377
|
+
function isFeatureUnavailableError(error) {
|
|
378
|
+
return error instanceof EdgeFeatureUnavailableError;
|
|
379
|
+
}
|
|
351
380
|
|
|
352
381
|
// src/index.ts
|
|
353
382
|
var SDK_VERSION = "1.0.0";
|
|
354
383
|
var SDK_NAME = "@edge-markets/connect";
|
|
355
384
|
// Annotate the CommonJS export names for ESM import in node:
|
|
356
385
|
0 && (module.exports = {
|
|
386
|
+
ACTIVE_EDGE_SCOPES,
|
|
357
387
|
ALL_EDGE_SCOPES,
|
|
388
|
+
EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE,
|
|
358
389
|
EDGE_ENVIRONMENTS,
|
|
359
390
|
EDGE_LINK_PATH,
|
|
360
391
|
EDGE_SCOPES,
|
|
@@ -363,6 +394,7 @@ var SDK_NAME = "@edge-markets/connect";
|
|
|
363
394
|
EdgeAuthenticationError,
|
|
364
395
|
EdgeConsentRequiredError,
|
|
365
396
|
EdgeError,
|
|
397
|
+
EdgeFeatureUnavailableError,
|
|
366
398
|
EdgeIdentityVerificationError,
|
|
367
399
|
EdgeInsufficientScopeError,
|
|
368
400
|
EdgeNetworkError,
|
|
@@ -373,6 +405,7 @@ var SDK_NAME = "@edge-markets/connect";
|
|
|
373
405
|
EdgeTokenExchangeError,
|
|
374
406
|
EdgeValidationError,
|
|
375
407
|
OTP_METHODS,
|
|
408
|
+
RESERVED_EDGE_SCOPES,
|
|
376
409
|
SCOPE_DESCRIPTIONS,
|
|
377
410
|
SCOPE_ICONS,
|
|
378
411
|
SDK_NAME,
|
|
@@ -389,9 +422,11 @@ var SDK_NAME = "@edge-markets/connect";
|
|
|
389
422
|
isAuthenticationError,
|
|
390
423
|
isConsentRequiredError,
|
|
391
424
|
isEdgeError,
|
|
425
|
+
isFeatureUnavailableError,
|
|
392
426
|
isIdentityVerificationError,
|
|
393
427
|
isNetworkError,
|
|
394
428
|
isProductionEnvironment,
|
|
429
|
+
isTransferWriteScope,
|
|
395
430
|
isValidScope,
|
|
396
431
|
parseScope
|
|
397
432
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -53,9 +53,12 @@ var EDGE_ENVIRONMENTS = {
|
|
|
53
53
|
},
|
|
54
54
|
sandbox: {
|
|
55
55
|
cognitoDomain: "https://edge-connect-sandbox.auth.us-east-1.amazoncognito.com",
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
// Sandbox partner API — mTLS-enforced. Uses its own sandbox gateway and
|
|
57
|
+
// sandbox OAuth/JWKS issuer. The browser Link UI is served from a separate
|
|
58
|
+
// sandbox host so SDK consumers do not enter the staging OAuth origin.
|
|
59
|
+
apiBaseUrl: "https://sandbox.connect.staging.edgeboost.io/connect/v1",
|
|
60
|
+
oauthBaseUrl: "https://sandbox.connect.staging.edgeboost.io/connect/oauth",
|
|
61
|
+
userClientUrl: "https://sandbox-oauth.staging-app.edgeboost.io",
|
|
59
62
|
displayName: "Sandbox",
|
|
60
63
|
isProduction: false
|
|
61
64
|
},
|
|
@@ -112,16 +115,22 @@ var EDGE_SCOPES = {
|
|
|
112
115
|
*/
|
|
113
116
|
BALANCE_READ: "balance.read",
|
|
114
117
|
/**
|
|
115
|
-
*
|
|
118
|
+
* Reserved for future fund transfers and EDGE-hosted verification sessions.
|
|
119
|
+
* Not available in staging or production. Requesting this scope from Link
|
|
120
|
+
* SDKs fails with EdgeFeatureUnavailableError until EDGE enables transfers
|
|
121
|
+
* for a partner.
|
|
122
|
+
*
|
|
116
123
|
* Required for: `POST /v1/transfer`, `POST /v1/transfer/:id/verification-session`, `GET /v1/transfers`
|
|
117
124
|
*/
|
|
118
125
|
TRANSFER_WRITE: "transfer.write"
|
|
119
126
|
};
|
|
120
|
-
var
|
|
127
|
+
var ACTIVE_EDGE_SCOPES = [EDGE_SCOPES.USER_READ, EDGE_SCOPES.BALANCE_READ];
|
|
128
|
+
var RESERVED_EDGE_SCOPES = [EDGE_SCOPES.TRANSFER_WRITE];
|
|
129
|
+
var ALL_EDGE_SCOPES = ACTIVE_EDGE_SCOPES;
|
|
121
130
|
var SCOPE_DESCRIPTIONS = {
|
|
122
131
|
[EDGE_SCOPES.USER_READ]: "View your profile information (name and email)",
|
|
123
132
|
[EDGE_SCOPES.BALANCE_READ]: "View your EdgeBoost account balance",
|
|
124
|
-
[EDGE_SCOPES.TRANSFER_WRITE]: "
|
|
133
|
+
[EDGE_SCOPES.TRANSFER_WRITE]: "Transfers are not available yet"
|
|
125
134
|
};
|
|
126
135
|
var SCOPE_ICONS = {
|
|
127
136
|
[EDGE_SCOPES.USER_READ]: "user",
|
|
@@ -145,6 +154,10 @@ function parseScope(fullScope) {
|
|
|
145
154
|
function isValidScope(scope) {
|
|
146
155
|
return Object.values(EDGE_SCOPES).includes(scope);
|
|
147
156
|
}
|
|
157
|
+
function isTransferWriteScope(scope) {
|
|
158
|
+
const normalized = typeof scope === "string" ? scope.trim() : "";
|
|
159
|
+
return normalized === EDGE_SCOPES.TRANSFER_WRITE || normalized.endsWith(`/${EDGE_SCOPES.TRANSFER_WRITE}`);
|
|
160
|
+
}
|
|
148
161
|
|
|
149
162
|
// src/errors/edge.error.ts
|
|
150
163
|
var EdgeError = class _EdgeError extends Error {
|
|
@@ -205,6 +218,13 @@ var EdgeInsufficientScopeError = class extends EdgeError {
|
|
|
205
218
|
this.missingScopes = missingScopes;
|
|
206
219
|
}
|
|
207
220
|
};
|
|
221
|
+
var EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE = "Feature not available yet, please contact Edge product team for more details";
|
|
222
|
+
var EdgeFeatureUnavailableError = class extends EdgeError {
|
|
223
|
+
constructor(message = EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE) {
|
|
224
|
+
super("feature_unavailable", message, 501);
|
|
225
|
+
this.name = "EdgeFeatureUnavailableError";
|
|
226
|
+
}
|
|
227
|
+
};
|
|
208
228
|
var EdgeApiError = class extends EdgeError {
|
|
209
229
|
constructor(code, message, statusCode, details) {
|
|
210
230
|
super(code, message, statusCode, details);
|
|
@@ -283,12 +303,17 @@ function isIdentityVerificationError(error) {
|
|
|
283
303
|
function isNetworkError(error) {
|
|
284
304
|
return error instanceof EdgeNetworkError;
|
|
285
305
|
}
|
|
306
|
+
function isFeatureUnavailableError(error) {
|
|
307
|
+
return error instanceof EdgeFeatureUnavailableError;
|
|
308
|
+
}
|
|
286
309
|
|
|
287
310
|
// src/index.ts
|
|
288
311
|
var SDK_VERSION = "1.0.0";
|
|
289
312
|
var SDK_NAME = "@edge-markets/connect";
|
|
290
313
|
export {
|
|
314
|
+
ACTIVE_EDGE_SCOPES,
|
|
291
315
|
ALL_EDGE_SCOPES,
|
|
316
|
+
EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE,
|
|
292
317
|
EDGE_ENVIRONMENTS,
|
|
293
318
|
EDGE_LINK_PATH,
|
|
294
319
|
EDGE_SCOPES,
|
|
@@ -297,6 +322,7 @@ export {
|
|
|
297
322
|
EdgeAuthenticationError,
|
|
298
323
|
EdgeConsentRequiredError,
|
|
299
324
|
EdgeError,
|
|
325
|
+
EdgeFeatureUnavailableError,
|
|
300
326
|
EdgeIdentityVerificationError,
|
|
301
327
|
EdgeInsufficientScopeError,
|
|
302
328
|
EdgeNetworkError,
|
|
@@ -307,6 +333,7 @@ export {
|
|
|
307
333
|
EdgeTokenExchangeError,
|
|
308
334
|
EdgeValidationError,
|
|
309
335
|
OTP_METHODS,
|
|
336
|
+
RESERVED_EDGE_SCOPES,
|
|
310
337
|
SCOPE_DESCRIPTIONS,
|
|
311
338
|
SCOPE_ICONS,
|
|
312
339
|
SDK_NAME,
|
|
@@ -323,9 +350,11 @@ export {
|
|
|
323
350
|
isAuthenticationError,
|
|
324
351
|
isConsentRequiredError,
|
|
325
352
|
isEdgeError,
|
|
353
|
+
isFeatureUnavailableError,
|
|
326
354
|
isIdentityVerificationError,
|
|
327
355
|
isNetworkError,
|
|
328
356
|
isProductionEnvironment,
|
|
357
|
+
isTransferWriteScope,
|
|
329
358
|
isValidScope,
|
|
330
359
|
parseScope
|
|
331
360
|
};
|