@edge-markets/connect 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -87,12 +87,14 @@ Get environment-specific URLs:
87
87
  ```typescript
88
88
  import {
89
89
  getEnvironmentConfig,
90
+ getLinkUrl,
90
91
  EDGE_SCOPES,
91
92
  formatScopeForEnvironment,
92
93
  } from '@edge-markets/connect'
93
94
 
94
95
  const config = getEnvironmentConfig('staging')
95
96
  console.log(config.apiBaseUrl) // https://...
97
+ console.log(getLinkUrl('staging')) // https://oauth.staging-app.edgeboost.io/oauth/link
96
98
 
97
99
  // Format scopes for your environment
98
100
  const scopes = formatScopeForEnvironment(EDGE_SCOPES.BALANCE_READ, 'staging')
package/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  type EdgeEnvironment = 'production' | 'staging' | 'sandbox' | 'development';
2
+ declare const EDGE_LINK_PATH = "/oauth/link";
2
3
  interface EdgeEnvironmentConfig {
3
4
  /**
4
5
  * @deprecated cognitoDomain is no longer used. Token exchange now goes through EdgeBoost API.
@@ -12,6 +13,14 @@ interface EdgeEnvironmentConfig {
12
13
  }
13
14
  declare const EDGE_ENVIRONMENTS: Readonly<Record<EdgeEnvironment, EdgeEnvironmentConfig>>;
14
15
  declare function getEnvironmentConfig(environment: EdgeEnvironment): EdgeEnvironmentConfig;
16
+ /**
17
+ * Resolves the hosted Link UI URL for an environment.
18
+ *
19
+ * `linkUrl` is an advanced override for nonstandard deployments. It accepts
20
+ * either the full Link URL (`https://oauth.example.com/oauth/link`) or just the
21
+ * hosted OAuth origin (`https://oauth.example.com`).
22
+ */
23
+ declare function getLinkUrl(environment: EdgeEnvironment, linkUrl?: string): string;
15
24
  declare function isProductionEnvironment(environment: EdgeEnvironment): boolean;
16
25
  declare function getAvailableEnvironments(): readonly EdgeEnvironment[];
17
26
 
@@ -3212,4 +3221,4 @@ declare const SDK_VERSION = "1.0.0";
3212
3221
  */
3213
3222
  declare const SDK_NAME = "@edge-markets/connect";
3214
3223
 
3215
- export { ALL_EDGE_SCOPES, type ApiError, type Balance, type BaseWebhookEvent, type ConsentRequiredError, type ConsentRevokedEventData, type CreateVerificationSessionRequest, EDGE_ENVIRONMENTS, 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, isApiError, isAuthenticationError, isConsentRequiredError, isEdgeError, isIdentityVerificationError, isNetworkError, isProductionEnvironment, isValidScope, type operations, parseScope, type paths };
3224
+ 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 };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  type EdgeEnvironment = 'production' | 'staging' | 'sandbox' | 'development';
2
+ declare const EDGE_LINK_PATH = "/oauth/link";
2
3
  interface EdgeEnvironmentConfig {
3
4
  /**
4
5
  * @deprecated cognitoDomain is no longer used. Token exchange now goes through EdgeBoost API.
@@ -12,6 +13,14 @@ interface EdgeEnvironmentConfig {
12
13
  }
13
14
  declare const EDGE_ENVIRONMENTS: Readonly<Record<EdgeEnvironment, EdgeEnvironmentConfig>>;
14
15
  declare function getEnvironmentConfig(environment: EdgeEnvironment): EdgeEnvironmentConfig;
16
+ /**
17
+ * Resolves the hosted Link UI URL for an environment.
18
+ *
19
+ * `linkUrl` is an advanced override for nonstandard deployments. It accepts
20
+ * either the full Link URL (`https://oauth.example.com/oauth/link`) or just the
21
+ * hosted OAuth origin (`https://oauth.example.com`).
22
+ */
23
+ declare function getLinkUrl(environment: EdgeEnvironment, linkUrl?: string): string;
15
24
  declare function isProductionEnvironment(environment: EdgeEnvironment): boolean;
16
25
  declare function getAvailableEnvironments(): readonly EdgeEnvironment[];
17
26
 
@@ -3212,4 +3221,4 @@ declare const SDK_VERSION = "1.0.0";
3212
3221
  */
3213
3222
  declare const SDK_NAME = "@edge-markets/connect";
3214
3223
 
3215
- export { ALL_EDGE_SCOPES, type ApiError, type Balance, type BaseWebhookEvent, type ConsentRequiredError, type ConsentRevokedEventData, type CreateVerificationSessionRequest, EDGE_ENVIRONMENTS, 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, isApiError, isAuthenticationError, isConsentRequiredError, isEdgeError, isIdentityVerificationError, isNetworkError, isProductionEnvironment, isValidScope, type operations, parseScope, type paths };
3224
+ 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 };
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  ALL_EDGE_SCOPES: () => ALL_EDGE_SCOPES,
24
24
  EDGE_ENVIRONMENTS: () => EDGE_ENVIRONMENTS,
25
+ EDGE_LINK_PATH: () => EDGE_LINK_PATH,
25
26
  EDGE_SCOPES: () => EDGE_SCOPES,
26
27
  EDGE_WEBHOOK_EVENT_TYPES: () => EDGE_WEBHOOK_EVENT_TYPES,
27
28
  EdgeApiError: () => EdgeApiError,
@@ -49,6 +50,7 @@ __export(index_exports, {
49
50
  formatScopesForEnvironment: () => formatScopesForEnvironment,
50
51
  getAvailableEnvironments: () => getAvailableEnvironments,
51
52
  getEnvironmentConfig: () => getEnvironmentConfig,
53
+ getLinkUrl: () => getLinkUrl,
52
54
  isApiError: () => isApiError,
53
55
  isAuthenticationError: () => isAuthenticationError,
54
56
  isConsentRequiredError: () => isConsentRequiredError,
@@ -88,12 +90,13 @@ var EDGE_WEBHOOK_EVENT_TYPES = [
88
90
  ];
89
91
 
90
92
  // src/config/environments.ts
93
+ var EDGE_LINK_PATH = "/oauth/link";
91
94
  var EDGE_ENVIRONMENTS = {
92
95
  production: {
93
96
  cognitoDomain: "https://edge-connect.auth.us-east-1.amazoncognito.com",
94
- apiBaseUrl: "https://api.edgeboost.com/connect/v1",
95
- oauthBaseUrl: "https://api.edgeboost.com/api/v3/oauth",
96
- userClientUrl: "https://app.edgeboost.com",
97
+ apiBaseUrl: "https://connect.edgeboost.io/connect/v1",
98
+ oauthBaseUrl: "https://connect.edgeboost.io/connect/oauth",
99
+ userClientUrl: "https://oauth.edgeboost.io",
97
100
  displayName: "Production",
98
101
  isProduction: true
99
102
  },
@@ -109,15 +112,15 @@ var EDGE_ENVIRONMENTS = {
109
112
  // User-facing captive frame for the Link SDK enrollment and transfer
110
113
  // verification flows. Served from the edge-connect-oauth Vite app
111
114
  // deployed on Amplify. No mTLS — browser traffic.
112
- userClientUrl: "https://oauth.staging-app.edgeboost.bet",
115
+ userClientUrl: "https://oauth.staging-app.edgeboost.io",
113
116
  displayName: "Staging",
114
117
  isProduction: false
115
118
  },
116
119
  sandbox: {
117
120
  cognitoDomain: "https://edge-connect-sandbox.auth.us-east-1.amazoncognito.com",
118
- apiBaseUrl: "https://sandbox-api.edgeboost.com/connect/v1",
119
- oauthBaseUrl: "https://sandbox-api.edgeboost.com/api/v3/oauth",
120
- userClientUrl: "https://sandbox.edgeboost.com",
121
+ apiBaseUrl: "https://api-sandbox.staging.edgeboost.io/connect/v1",
122
+ oauthBaseUrl: "https://api-sandbox.staging.edgeboost.io/api/v3/oauth",
123
+ userClientUrl: "https://oauth.staging-app.edgeboost.io",
121
124
  displayName: "Sandbox",
122
125
  isProduction: false
123
126
  },
@@ -143,6 +146,17 @@ var EDGE_ENVIRONMENTS = {
143
146
  function getEnvironmentConfig(environment) {
144
147
  return EDGE_ENVIRONMENTS[environment];
145
148
  }
149
+ function getLinkUrl(environment, linkUrl) {
150
+ const configuredUrl = linkUrl?.trim();
151
+ const url = new URL(configuredUrl || `${EDGE_ENVIRONMENTS[environment].userClientUrl}${EDGE_LINK_PATH}`);
152
+ const normalizedPath = url.pathname.replace(/\/+$/, "");
153
+ if (!normalizedPath || normalizedPath === "/" || normalizedPath === "/oauth") {
154
+ url.pathname = EDGE_LINK_PATH;
155
+ } else {
156
+ url.pathname = normalizedPath;
157
+ }
158
+ return url.toString();
159
+ }
146
160
  function isProductionEnvironment(environment) {
147
161
  return EDGE_ENVIRONMENTS[environment].isProduction;
148
162
  }
@@ -342,6 +356,7 @@ var SDK_NAME = "@edge-markets/connect";
342
356
  0 && (module.exports = {
343
357
  ALL_EDGE_SCOPES,
344
358
  EDGE_ENVIRONMENTS,
359
+ EDGE_LINK_PATH,
345
360
  EDGE_SCOPES,
346
361
  EDGE_WEBHOOK_EVENT_TYPES,
347
362
  EdgeApiError,
@@ -369,6 +384,7 @@ var SDK_NAME = "@edge-markets/connect";
369
384
  formatScopesForEnvironment,
370
385
  getAvailableEnvironments,
371
386
  getEnvironmentConfig,
387
+ getLinkUrl,
372
388
  isApiError,
373
389
  isAuthenticationError,
374
390
  isConsentRequiredError,
package/dist/index.mjs CHANGED
@@ -25,12 +25,13 @@ var EDGE_WEBHOOK_EVENT_TYPES = [
25
25
  ];
26
26
 
27
27
  // src/config/environments.ts
28
+ var EDGE_LINK_PATH = "/oauth/link";
28
29
  var EDGE_ENVIRONMENTS = {
29
30
  production: {
30
31
  cognitoDomain: "https://edge-connect.auth.us-east-1.amazoncognito.com",
31
- apiBaseUrl: "https://api.edgeboost.com/connect/v1",
32
- oauthBaseUrl: "https://api.edgeboost.com/api/v3/oauth",
33
- userClientUrl: "https://app.edgeboost.com",
32
+ apiBaseUrl: "https://connect.edgeboost.io/connect/v1",
33
+ oauthBaseUrl: "https://connect.edgeboost.io/connect/oauth",
34
+ userClientUrl: "https://oauth.edgeboost.io",
34
35
  displayName: "Production",
35
36
  isProduction: true
36
37
  },
@@ -46,15 +47,15 @@ var EDGE_ENVIRONMENTS = {
46
47
  // User-facing captive frame for the Link SDK enrollment and transfer
47
48
  // verification flows. Served from the edge-connect-oauth Vite app
48
49
  // deployed on Amplify. No mTLS — browser traffic.
49
- userClientUrl: "https://oauth.staging-app.edgeboost.bet",
50
+ userClientUrl: "https://oauth.staging-app.edgeboost.io",
50
51
  displayName: "Staging",
51
52
  isProduction: false
52
53
  },
53
54
  sandbox: {
54
55
  cognitoDomain: "https://edge-connect-sandbox.auth.us-east-1.amazoncognito.com",
55
- apiBaseUrl: "https://sandbox-api.edgeboost.com/connect/v1",
56
- oauthBaseUrl: "https://sandbox-api.edgeboost.com/api/v3/oauth",
57
- userClientUrl: "https://sandbox.edgeboost.com",
56
+ apiBaseUrl: "https://api-sandbox.staging.edgeboost.io/connect/v1",
57
+ oauthBaseUrl: "https://api-sandbox.staging.edgeboost.io/api/v3/oauth",
58
+ userClientUrl: "https://oauth.staging-app.edgeboost.io",
58
59
  displayName: "Sandbox",
59
60
  isProduction: false
60
61
  },
@@ -80,6 +81,17 @@ var EDGE_ENVIRONMENTS = {
80
81
  function getEnvironmentConfig(environment) {
81
82
  return EDGE_ENVIRONMENTS[environment];
82
83
  }
84
+ function getLinkUrl(environment, linkUrl) {
85
+ const configuredUrl = linkUrl?.trim();
86
+ const url = new URL(configuredUrl || `${EDGE_ENVIRONMENTS[environment].userClientUrl}${EDGE_LINK_PATH}`);
87
+ const normalizedPath = url.pathname.replace(/\/+$/, "");
88
+ if (!normalizedPath || normalizedPath === "/" || normalizedPath === "/oauth") {
89
+ url.pathname = EDGE_LINK_PATH;
90
+ } else {
91
+ url.pathname = normalizedPath;
92
+ }
93
+ return url.toString();
94
+ }
83
95
  function isProductionEnvironment(environment) {
84
96
  return EDGE_ENVIRONMENTS[environment].isProduction;
85
97
  }
@@ -278,6 +290,7 @@ var SDK_NAME = "@edge-markets/connect";
278
290
  export {
279
291
  ALL_EDGE_SCOPES,
280
292
  EDGE_ENVIRONMENTS,
293
+ EDGE_LINK_PATH,
281
294
  EDGE_SCOPES,
282
295
  EDGE_WEBHOOK_EVENT_TYPES,
283
296
  EdgeApiError,
@@ -305,6 +318,7 @@ export {
305
318
  formatScopesForEnvironment,
306
319
  getAvailableEnvironments,
307
320
  getEnvironmentConfig,
321
+ getLinkUrl,
308
322
  isApiError,
309
323
  isAuthenticationError,
310
324
  isConsentRequiredError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edge-markets/connect",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Core types, configuration, and utilities for EDGE Connect SDK",
5
5
  "author": "EdgeBoost",
6
6
  "license": "MIT",