@edge-markets/connect-node 1.9.0 → 1.10.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 +37 -1
- package/dist/index.d.mts +5 -6
- package/dist/index.d.ts +5 -6
- package/dist/index.js +184 -134
- package/dist/index.mjs +62 -17
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -92,7 +92,9 @@ Supported environment variables:
|
|
|
92
92
|
| `EDGE_PARTNER_CLIENT_SECRET` | Partner machine-to-machine client secret for webhook sync |
|
|
93
93
|
| `EDGE_MTLS_CERT` / `EDGE_MTLS_CERT_PATH` | Client certificate PEM or file path |
|
|
94
94
|
| `EDGE_MTLS_KEY` / `EDGE_MTLS_KEY_PATH` | Client private key PEM or file path |
|
|
95
|
-
| `
|
|
95
|
+
| `EDGE_SERVER_CA_PEM` / `EDGE_SERVER_CA_PEM_PATH` | Optional extra server trust root PEM or file path |
|
|
96
|
+
| `EDGE_MTLS_CA` / `EDGE_MTLS_CA_PATH` | Legacy alias for optional extra server trust root PEM or file path |
|
|
97
|
+
| `EDGE_REQUIRE_MTLS` | Set to `true` to fail startup unless client cert and key are configured |
|
|
96
98
|
| `EDGE_TIMEOUT_MS` | Optional request timeout in milliseconds |
|
|
97
99
|
|
|
98
100
|
Use inline PEMs with escaped newlines (`\n`) or file paths. If both are set,
|
|
@@ -194,6 +196,40 @@ to Node's default public trust roots instead of replacing them.
|
|
|
194
196
|
|
|
195
197
|
Do not disable TLS verification and do not set `NODE_TLS_REJECT_UNAUTHORIZED=0`.
|
|
196
198
|
|
|
199
|
+
### Next.js and Vercel Route Handlers
|
|
200
|
+
|
|
201
|
+
`@edge-markets/connect-node` is a Node.js server SDK. In Next.js Route Handlers,
|
|
202
|
+
force the Node runtime before importing or constructing the SDK:
|
|
203
|
+
|
|
204
|
+
```typescript
|
|
205
|
+
export const runtime = 'nodejs'
|
|
206
|
+
|
|
207
|
+
import { createEdgeConnectServerFromEnv } from '@edge-markets/connect-node'
|
|
208
|
+
|
|
209
|
+
const { server: edge } = createEdgeConnectServerFromEnv({
|
|
210
|
+
requireMtls: true,
|
|
211
|
+
})
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Do not import this package from Client Components, browser code, middleware, or
|
|
215
|
+
Edge Runtime handlers. It reads server-only secrets and uses Node TLS APIs for
|
|
216
|
+
mTLS.
|
|
217
|
+
|
|
218
|
+
If you are pinned to an older SDK version and your Next.js/Turbopack build logs
|
|
219
|
+
show `dynamic usage of require is not supported`, externalize the package as an
|
|
220
|
+
app-level mitigation until you can upgrade:
|
|
221
|
+
|
|
222
|
+
```typescript
|
|
223
|
+
// next.config.ts
|
|
224
|
+
import type { NextConfig } from 'next'
|
|
225
|
+
|
|
226
|
+
const nextConfig: NextConfig = {
|
|
227
|
+
serverExternalPackages: ['@edge-markets/connect-node', 'undici'],
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export default nextConfig
|
|
231
|
+
```
|
|
232
|
+
|
|
197
233
|
## Token Exchange
|
|
198
234
|
|
|
199
235
|
After EdgeLink completes, exchange the code for tokens:
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as node_https from 'node:https';
|
|
2
2
|
import { EdgeEnvironment, TransferCategory, Transfer, VerificationSession, TransferType, TransferStatus, User, VerifyIdentityOptions, VerifyIdentityResult, Balance, ListTransfersParams, TransferList, CreateVerificationSessionRequest, VerificationSessionStatusResponse, EdgeTokens, EdgeWebhookEvent, EdgeWebhookEventType } from '@edge-markets/connect';
|
|
3
|
-
export { Balance, BaseWebhookEvent, ConsentRevokedEventData, CreateVerificationSessionRequest, EDGE_WEBHOOK_EVENT_TYPES, EdgeApiError, EdgeAuthenticationError, EdgeConsentRequiredError, EdgeEnvironment, EdgeError, EdgeIdentityVerificationError, EdgeInsufficientScopeError, EdgeNetworkError, EdgeNotFoundError, EdgeTokenExchangeError, EdgeTokens, EdgeValidationError, EdgeWebhookEvent, EdgeWebhookEventType, ListTransfersParams, SdkGeolocation, TRANSFER_CATEGORIES, Transfer, TransferCategory, TransferCompletedEventData, TransferExpiredEventData, TransferFailedEventData, TransferList, TransferListItem, TransferProcessingEventData, TransferStatus, TransferType, User, UserAddress, VerificationSession, VerificationSessionStatus, VerificationSessionStatusResponse, VerifyIdentityAddress, VerifyIdentityOptions, VerifyIdentityResult, VerifyIdentityScores, getEnvironmentConfig, isApiError, isAuthenticationError, isConsentRequiredError, isEdgeError, isIdentityVerificationError, isNetworkError, isProductionEnvironment } from '@edge-markets/connect';
|
|
3
|
+
export { ACTIVE_EDGE_SCOPES, Balance, BaseWebhookEvent, ConsentRevokedEventData, CreateVerificationSessionRequest, EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE, EDGE_WEBHOOK_EVENT_TYPES, EdgeApiError, EdgeAuthenticationError, EdgeConsentRequiredError, EdgeEnvironment, EdgeError, EdgeFeatureUnavailableError, EdgeIdentityVerificationError, EdgeInsufficientScopeError, EdgeNetworkError, EdgeNotFoundError, EdgeTokenExchangeError, EdgeTokens, EdgeValidationError, EdgeWebhookEvent, EdgeWebhookEventType, ListTransfersParams, SdkGeolocation, TRANSFER_CATEGORIES, Transfer, TransferCategory, TransferCompletedEventData, TransferExpiredEventData, TransferFailedEventData, TransferList, TransferListItem, TransferProcessingEventData, TransferStatus, TransferType, User, UserAddress, VerificationSession, VerificationSessionStatus, VerificationSessionStatusResponse, VerifyIdentityAddress, VerifyIdentityOptions, VerifyIdentityResult, VerifyIdentityScores, getEnvironmentConfig, isApiError, isAuthenticationError, isConsentRequiredError, isEdgeError, isFeatureUnavailableError, isIdentityVerificationError, isNetworkError, isProductionEnvironment } from '@edge-markets/connect';
|
|
4
4
|
|
|
5
5
|
type RequestEndpoint = 'connect_api' | 'oauth_token' | 'partner_webhook_sync';
|
|
6
6
|
interface RequestInfo {
|
|
@@ -175,14 +175,13 @@ declare class EdgeUserClient {
|
|
|
175
175
|
revoked: boolean;
|
|
176
176
|
}>;
|
|
177
177
|
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
* The handoff token is single-use and expires in 120 seconds.
|
|
178
|
+
* Reserved for a future transfer release.
|
|
179
|
+
* Currently throws EdgeFeatureUnavailableError before validation or network I/O.
|
|
181
180
|
*/
|
|
182
181
|
createVerificationSession(transferId: string, options: CreateVerificationSessionRequest): Promise<VerificationSession>;
|
|
183
182
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
183
|
+
* Reserved for a future transfer release.
|
|
184
|
+
* Currently throws EdgeFeatureUnavailableError before validation or network I/O.
|
|
186
185
|
*/
|
|
187
186
|
getVerificationSessionStatus(transferId: string, sessionId: string): Promise<VerificationSessionStatusResponse>;
|
|
188
187
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as node_https from 'node:https';
|
|
2
2
|
import { EdgeEnvironment, TransferCategory, Transfer, VerificationSession, TransferType, TransferStatus, User, VerifyIdentityOptions, VerifyIdentityResult, Balance, ListTransfersParams, TransferList, CreateVerificationSessionRequest, VerificationSessionStatusResponse, EdgeTokens, EdgeWebhookEvent, EdgeWebhookEventType } from '@edge-markets/connect';
|
|
3
|
-
export { Balance, BaseWebhookEvent, ConsentRevokedEventData, CreateVerificationSessionRequest, EDGE_WEBHOOK_EVENT_TYPES, EdgeApiError, EdgeAuthenticationError, EdgeConsentRequiredError, EdgeEnvironment, EdgeError, EdgeIdentityVerificationError, EdgeInsufficientScopeError, EdgeNetworkError, EdgeNotFoundError, EdgeTokenExchangeError, EdgeTokens, EdgeValidationError, EdgeWebhookEvent, EdgeWebhookEventType, ListTransfersParams, SdkGeolocation, TRANSFER_CATEGORIES, Transfer, TransferCategory, TransferCompletedEventData, TransferExpiredEventData, TransferFailedEventData, TransferList, TransferListItem, TransferProcessingEventData, TransferStatus, TransferType, User, UserAddress, VerificationSession, VerificationSessionStatus, VerificationSessionStatusResponse, VerifyIdentityAddress, VerifyIdentityOptions, VerifyIdentityResult, VerifyIdentityScores, getEnvironmentConfig, isApiError, isAuthenticationError, isConsentRequiredError, isEdgeError, isIdentityVerificationError, isNetworkError, isProductionEnvironment } from '@edge-markets/connect';
|
|
3
|
+
export { ACTIVE_EDGE_SCOPES, Balance, BaseWebhookEvent, ConsentRevokedEventData, CreateVerificationSessionRequest, EDGE_CONNECT_FEATURE_UNAVAILABLE_MESSAGE, EDGE_WEBHOOK_EVENT_TYPES, EdgeApiError, EdgeAuthenticationError, EdgeConsentRequiredError, EdgeEnvironment, EdgeError, EdgeFeatureUnavailableError, EdgeIdentityVerificationError, EdgeInsufficientScopeError, EdgeNetworkError, EdgeNotFoundError, EdgeTokenExchangeError, EdgeTokens, EdgeValidationError, EdgeWebhookEvent, EdgeWebhookEventType, ListTransfersParams, SdkGeolocation, TRANSFER_CATEGORIES, Transfer, TransferCategory, TransferCompletedEventData, TransferExpiredEventData, TransferFailedEventData, TransferList, TransferListItem, TransferProcessingEventData, TransferStatus, TransferType, User, UserAddress, VerificationSession, VerificationSessionStatus, VerificationSessionStatusResponse, VerifyIdentityAddress, VerifyIdentityOptions, VerifyIdentityResult, VerifyIdentityScores, getEnvironmentConfig, isApiError, isAuthenticationError, isConsentRequiredError, isEdgeError, isFeatureUnavailableError, isIdentityVerificationError, isNetworkError, isProductionEnvironment } from '@edge-markets/connect';
|
|
4
4
|
|
|
5
5
|
type RequestEndpoint = 'connect_api' | 'oauth_token' | 'partner_webhook_sync';
|
|
6
6
|
interface RequestInfo {
|
|
@@ -175,14 +175,13 @@ declare class EdgeUserClient {
|
|
|
175
175
|
revoked: boolean;
|
|
176
176
|
}>;
|
|
177
177
|
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
* The handoff token is single-use and expires in 120 seconds.
|
|
178
|
+
* Reserved for a future transfer release.
|
|
179
|
+
* Currently throws EdgeFeatureUnavailableError before validation or network I/O.
|
|
181
180
|
*/
|
|
182
181
|
createVerificationSession(transferId: string, options: CreateVerificationSessionRequest): Promise<VerificationSession>;
|
|
183
182
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
183
|
+
* Reserved for a future transfer release.
|
|
184
|
+
* Currently throws EdgeFeatureUnavailableError before validation or network I/O.
|
|
186
185
|
*/
|
|
187
186
|
getVerificationSessionStatus(transferId: string, sessionId: string): Promise<VerificationSessionStatusResponse>;
|
|
188
187
|
}
|