@edge-markets/connect-node 1.7.0 → 1.8.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 +176 -46
- package/dist/index.d.mts +266 -4
- package/dist/index.d.ts +266 -4
- package/dist/index.js +1318 -85
- package/dist/index.mjs +1279 -57
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import * as node_https from 'node:https';
|
|
2
|
-
import { EdgeEnvironment, TransferCategory, User, VerifyIdentityOptions, VerifyIdentityResult, Balance,
|
|
3
|
-
export { Balance, BaseWebhookEvent, ConsentRevokedEventData, CreateVerificationSessionRequest, EDGE_WEBHOOK_EVENT_TYPES, EdgeApiError, EdgeAuthenticationError, EdgeConsentRequiredError, EdgeEnvironment, EdgeError, EdgeIdentityVerificationError, EdgeInsufficientScopeError, EdgeNetworkError, EdgeNotFoundError, EdgeTokenExchangeError, EdgeTokens, 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';
|
|
2
|
+
import { EdgeEnvironment, TransferCategory, Transfer, VerificationSession, TransferType, User, VerifyIdentityOptions, VerifyIdentityResult, Balance, ListTransfersParams, TransferList, CreateVerificationSessionRequest, VerificationSessionStatusResponse, EdgeTokens, EdgeWebhookEvent, TransferStatus, 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';
|
|
4
4
|
|
|
5
|
+
type RequestEndpoint = 'connect_api' | 'oauth_token' | 'partner_webhook_sync';
|
|
5
6
|
interface RequestInfo {
|
|
6
7
|
method: string;
|
|
7
8
|
url: string;
|
|
8
9
|
body?: unknown;
|
|
10
|
+
endpoint?: RequestEndpoint;
|
|
11
|
+
attempt?: number;
|
|
9
12
|
}
|
|
10
13
|
interface ResponseInfo {
|
|
11
14
|
status: number;
|
|
12
15
|
body: unknown;
|
|
13
16
|
durationMs: number;
|
|
17
|
+
method?: string;
|
|
18
|
+
url?: string;
|
|
19
|
+
endpoint?: RequestEndpoint;
|
|
20
|
+
attempt?: number;
|
|
14
21
|
}
|
|
15
22
|
interface RetryConfig {
|
|
16
23
|
maxRetries?: number;
|
|
@@ -23,6 +30,17 @@ interface EdgeConnectServerConfig {
|
|
|
23
30
|
clientSecret: string;
|
|
24
31
|
environment: EdgeEnvironment;
|
|
25
32
|
apiBaseUrl?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Override the partner dashboard API base URL.
|
|
35
|
+
*
|
|
36
|
+
* Most integrations should omit this. The SDK derives the dashboard base
|
|
37
|
+
* from `apiBaseUrl` by replacing `/connect/v1` with `/v1`, matching the
|
|
38
|
+
* EDGE Connect gateway layout:
|
|
39
|
+
*
|
|
40
|
+
* - user-scoped API: `https://connect-staging.edgeboost.io/connect/v1`
|
|
41
|
+
* - partner dashboard API: `https://connect-staging.edgeboost.io/v1`
|
|
42
|
+
*/
|
|
43
|
+
partnerApiBaseUrl?: string;
|
|
26
44
|
oauthBaseUrl?: string;
|
|
27
45
|
/**
|
|
28
46
|
* @deprecated cognitoDomain is no longer used. Token exchange now goes through EdgeBoost API.
|
|
@@ -63,9 +81,19 @@ interface EdgeConnectServerConfig {
|
|
|
63
81
|
}
|
|
64
82
|
interface MtlsConfig {
|
|
65
83
|
enabled: boolean;
|
|
84
|
+
/** Client certificate PEM used to authenticate this partner to EDGE Connect. */
|
|
66
85
|
cert: string;
|
|
86
|
+
/** Client private key PEM paired with `cert`. */
|
|
67
87
|
key: string;
|
|
68
|
-
|
|
88
|
+
/**
|
|
89
|
+
* Optional additional server trust root(s), as PEM text.
|
|
90
|
+
*
|
|
91
|
+
* The SDK appends these certificates to Node's default public trust store
|
|
92
|
+
* instead of replacing it. Public EDGE Connect gateways use public ACM
|
|
93
|
+
* certificates, so most partners should omit this unless EDGE provides a
|
|
94
|
+
* private server CA for a non-public endpoint.
|
|
95
|
+
*/
|
|
96
|
+
ca?: string | string[];
|
|
69
97
|
}
|
|
70
98
|
interface TransferOptions {
|
|
71
99
|
type: 'debit' | 'credit';
|
|
@@ -75,6 +103,38 @@ interface TransferOptions {
|
|
|
75
103
|
category?: TransferCategory;
|
|
76
104
|
}
|
|
77
105
|
|
|
106
|
+
interface TransferAmountLimits {
|
|
107
|
+
min?: string | number;
|
|
108
|
+
max?: string | number;
|
|
109
|
+
}
|
|
110
|
+
interface CreateTransferIdempotencyKeyOptions {
|
|
111
|
+
partnerUserId: string;
|
|
112
|
+
type: TransferType;
|
|
113
|
+
amount: string | number;
|
|
114
|
+
category?: TransferCategory;
|
|
115
|
+
externalId?: string;
|
|
116
|
+
nonce?: string;
|
|
117
|
+
namespace?: string;
|
|
118
|
+
}
|
|
119
|
+
interface TransferIntent {
|
|
120
|
+
type: TransferType;
|
|
121
|
+
amount: string | number;
|
|
122
|
+
category?: TransferCategory | null;
|
|
123
|
+
}
|
|
124
|
+
interface StartTransferVerificationOptions {
|
|
125
|
+
transfer: TransferOptions;
|
|
126
|
+
origin: string;
|
|
127
|
+
}
|
|
128
|
+
interface StartTransferVerificationResult {
|
|
129
|
+
transfer: Transfer;
|
|
130
|
+
verificationSession: VerificationSession;
|
|
131
|
+
}
|
|
132
|
+
declare function normalizeMoneyAmount(value: string | number): string;
|
|
133
|
+
declare function validateTransferAmount(value: string | number, limits?: TransferAmountLimits): string;
|
|
134
|
+
declare function createTransferIdempotencyKey(options: CreateTransferIdempotencyKeyOptions): string;
|
|
135
|
+
declare function assertSameTransferIntent(existing: TransferIntent, requested: TransferIntent): void;
|
|
136
|
+
declare function startTransferVerification(client: Pick<EdgeUserClient, 'initiateTransfer' | 'createVerificationSession'>, options: StartTransferVerificationOptions): Promise<StartTransferVerificationResult>;
|
|
137
|
+
|
|
78
138
|
/**
|
|
79
139
|
* A lightweight, user-scoped API client created via {@link EdgeConnectServer.forUser}.
|
|
80
140
|
*
|
|
@@ -89,6 +149,7 @@ declare class EdgeUserClient {
|
|
|
89
149
|
verifyIdentity(options: VerifyIdentityOptions): Promise<VerifyIdentityResult>;
|
|
90
150
|
getBalance(): Promise<Balance>;
|
|
91
151
|
initiateTransfer(options: TransferOptions): Promise<Transfer>;
|
|
152
|
+
startTransferVerification(options: StartTransferVerificationOptions): Promise<StartTransferVerificationResult>;
|
|
92
153
|
getTransfer(transferId: string): Promise<Transfer>;
|
|
93
154
|
listTransfers(params?: ListTransfersParams): Promise<TransferList>;
|
|
94
155
|
revokeConsent(): Promise<{
|
|
@@ -107,6 +168,92 @@ declare class EdgeUserClient {
|
|
|
107
168
|
getVerificationSessionStatus(transferId: string, sessionId: string): Promise<VerificationSessionStatusResponse>;
|
|
108
169
|
}
|
|
109
170
|
|
|
171
|
+
type EdgeTokenVaultKeyMaterial = string | Buffer | Uint8Array;
|
|
172
|
+
interface EdgeTokenVaultKey {
|
|
173
|
+
id: string;
|
|
174
|
+
key: EdgeTokenVaultKeyMaterial;
|
|
175
|
+
}
|
|
176
|
+
interface EdgeTokenVaultOptions {
|
|
177
|
+
currentKey: EdgeTokenVaultKey;
|
|
178
|
+
previousKeys?: EdgeTokenVaultKey[];
|
|
179
|
+
}
|
|
180
|
+
declare class EdgeTokenVault {
|
|
181
|
+
private readonly currentKey;
|
|
182
|
+
private readonly keysById;
|
|
183
|
+
constructor(options: EdgeTokenVaultOptions);
|
|
184
|
+
encryptTokens(tokens: EdgeTokens): string;
|
|
185
|
+
decryptTokens(envelope: string): EdgeTokens;
|
|
186
|
+
isEncrypted(value: unknown): value is string;
|
|
187
|
+
}
|
|
188
|
+
declare function createEdgeTokenVault(options: EdgeTokenVaultOptions): EdgeTokenVault;
|
|
189
|
+
declare function isEdgeTokenVaultEnvelope(value: unknown): value is string;
|
|
190
|
+
|
|
191
|
+
type EdgeTokenStoreValue = EdgeTokens | string;
|
|
192
|
+
interface EdgeTokenStoreSaveContext {
|
|
193
|
+
tokens: EdgeTokens;
|
|
194
|
+
refreshed: boolean;
|
|
195
|
+
}
|
|
196
|
+
interface EdgeTokenStore {
|
|
197
|
+
load: (subjectId: string) => Promise<EdgeTokenStoreValue | null | undefined> | EdgeTokenStoreValue | null | undefined;
|
|
198
|
+
save: (subjectId: string, value: EdgeTokenStoreValue, context: EdgeTokenStoreSaveContext) => Promise<void> | void;
|
|
199
|
+
}
|
|
200
|
+
interface EdgeUserSessionOptions {
|
|
201
|
+
edge: Pick<EdgeConnectServer, 'forUser' | 'refreshTokens'>;
|
|
202
|
+
subjectId: string;
|
|
203
|
+
tokenStore: EdgeTokenStore;
|
|
204
|
+
tokenVault?: Pick<EdgeTokenVault, 'encryptTokens' | 'decryptTokens' | 'isEncrypted'>;
|
|
205
|
+
refreshSkewMs?: number;
|
|
206
|
+
now?: () => number;
|
|
207
|
+
onRefresh?: (tokens: EdgeTokens) => Promise<void> | void;
|
|
208
|
+
}
|
|
209
|
+
interface GetValidTokensOptions {
|
|
210
|
+
forceRefresh?: boolean;
|
|
211
|
+
}
|
|
212
|
+
declare class EdgeUserSession {
|
|
213
|
+
private readonly edge;
|
|
214
|
+
private readonly subjectId;
|
|
215
|
+
private readonly tokenStore;
|
|
216
|
+
private readonly tokenVault?;
|
|
217
|
+
private readonly refreshSkewMs;
|
|
218
|
+
private readonly now;
|
|
219
|
+
private readonly onRefresh?;
|
|
220
|
+
constructor(options: EdgeUserSessionOptions);
|
|
221
|
+
getValidTokens(options?: GetValidTokensOptions): Promise<EdgeTokens>;
|
|
222
|
+
getClient(options?: GetValidTokensOptions): Promise<EdgeUserClient>;
|
|
223
|
+
withClient<T>(callback: (client: EdgeUserClient, tokens: EdgeTokens) => Promise<T> | T): Promise<T>;
|
|
224
|
+
saveTokens(tokens: EdgeTokens, refreshed?: boolean): Promise<void>;
|
|
225
|
+
private loadTokens;
|
|
226
|
+
}
|
|
227
|
+
declare function createEdgeUserSession(options: EdgeUserSessionOptions): EdgeUserSession;
|
|
228
|
+
|
|
229
|
+
interface WebhookReconcilerCursorStore {
|
|
230
|
+
load: () => Promise<string | null | undefined> | string | null | undefined;
|
|
231
|
+
save: (cursor: string) => Promise<void> | void;
|
|
232
|
+
}
|
|
233
|
+
interface WebhookReconcilerOptions {
|
|
234
|
+
edge: Pick<EdgeConnectServer, 'syncWebhookEvents'>;
|
|
235
|
+
cursorStore: WebhookReconcilerCursorStore;
|
|
236
|
+
processEvent: (event: EdgeWebhookEvent) => Promise<void> | void;
|
|
237
|
+
limit?: SyncWebhookEventsOptions['limit'];
|
|
238
|
+
maxPages?: number;
|
|
239
|
+
}
|
|
240
|
+
interface WebhookReconcilerRunResult {
|
|
241
|
+
processed: number;
|
|
242
|
+
pages: number;
|
|
243
|
+
cursor?: string;
|
|
244
|
+
hasMore: boolean;
|
|
245
|
+
skipped: boolean;
|
|
246
|
+
reason?: 'already_running' | 'empty_page_with_has_more' | 'max_pages_reached';
|
|
247
|
+
}
|
|
248
|
+
declare class EdgeWebhookReconciler {
|
|
249
|
+
private readonly options;
|
|
250
|
+
private running;
|
|
251
|
+
constructor(options: WebhookReconcilerOptions);
|
|
252
|
+
run(): Promise<WebhookReconcilerRunResult>;
|
|
253
|
+
private runInternal;
|
|
254
|
+
}
|
|
255
|
+
declare function createWebhookReconciler(options: WebhookReconcilerOptions): EdgeWebhookReconciler;
|
|
256
|
+
|
|
110
257
|
/**
|
|
111
258
|
* Options for {@link EdgeConnectServer.syncWebhookEvents}.
|
|
112
259
|
*/
|
|
@@ -142,6 +289,7 @@ interface SyncWebhookEventsResult {
|
|
|
142
289
|
declare class EdgeConnectServer {
|
|
143
290
|
private readonly config;
|
|
144
291
|
private readonly apiBaseUrl;
|
|
292
|
+
private readonly partnerApiBaseUrl;
|
|
145
293
|
private readonly oauthBaseUrl;
|
|
146
294
|
private readonly timeout;
|
|
147
295
|
private readonly retryConfig;
|
|
@@ -163,6 +311,7 @@ declare class EdgeConnectServer {
|
|
|
163
311
|
* or per user session and discard it when the token changes.
|
|
164
312
|
*/
|
|
165
313
|
forUser(accessToken: string): EdgeUserClient;
|
|
314
|
+
createUserSession(options: Omit<EdgeUserSessionOptions, 'edge'>): EdgeUserSession;
|
|
166
315
|
exchangeCode(code: string, codeVerifier: string, redirectUri?: string): Promise<EdgeTokens>;
|
|
167
316
|
refreshTokens(refreshToken: string): Promise<EdgeTokens>;
|
|
168
317
|
/** @internal Called by {@link EdgeUserClient} — not part of the public API. */
|
|
@@ -205,9 +354,18 @@ declare class EdgeConnectServer {
|
|
|
205
354
|
* @throws {EdgeApiError} For other non-2xx responses after retries
|
|
206
355
|
*/
|
|
207
356
|
syncWebhookEvents(options?: SyncWebhookEventsOptions): Promise<SyncWebhookEventsResult>;
|
|
357
|
+
/**
|
|
358
|
+
* Creates a cursor-based webhook reconciler bound to this SDK instance.
|
|
359
|
+
*
|
|
360
|
+
* Use this from cron jobs to process events returned by
|
|
361
|
+
* {@link EdgeConnectServer.syncWebhookEvents} without hand-writing
|
|
362
|
+
* pagination, cursor advancement, or process-level concurrency guards.
|
|
363
|
+
*/
|
|
364
|
+
createWebhookReconciler(options: Omit<WebhookReconcilerOptions, 'edge'>): EdgeWebhookReconciler;
|
|
208
365
|
/**
|
|
209
366
|
* Builds the sync URL with normalized query parameters.
|
|
210
367
|
*/
|
|
368
|
+
private normalizeSyncWebhookEventsOptions;
|
|
211
369
|
private buildSyncUrl;
|
|
212
370
|
/**
|
|
213
371
|
* Issues a GET to the sync endpoint with the partner Bearer token. Kept
|
|
@@ -228,6 +386,9 @@ declare class EdgeConnectServer {
|
|
|
228
386
|
* to `syncWebhookEvents` re-fetches it. Not part of the public API.
|
|
229
387
|
*/
|
|
230
388
|
_resetPartnerTokenCache(): void;
|
|
389
|
+
private redactPartnerTokenResponseBody;
|
|
390
|
+
private redactPartnerSyncResponseBody;
|
|
391
|
+
private drainResponseBody;
|
|
231
392
|
private getRetryDelay;
|
|
232
393
|
private sleep;
|
|
233
394
|
private fetchWithTimeout;
|
|
@@ -236,6 +397,87 @@ declare class EdgeConnectServer {
|
|
|
236
397
|
private handleApiErrorFromBody;
|
|
237
398
|
}
|
|
238
399
|
|
|
400
|
+
type EdgeConnectEnv = Record<string, string | undefined>;
|
|
401
|
+
interface CreateEdgeConnectServerFromEnvOptions {
|
|
402
|
+
env?: EdgeConnectEnv;
|
|
403
|
+
requireMtls?: boolean;
|
|
404
|
+
timeout?: number;
|
|
405
|
+
retry?: RetryConfig;
|
|
406
|
+
onRequest?: (info: RequestInfo) => void;
|
|
407
|
+
onResponse?: (info: ResponseInfo) => void;
|
|
408
|
+
mle?: EdgeConnectServerConfig['mle'];
|
|
409
|
+
}
|
|
410
|
+
interface EdgeConnectServerFromEnvCapabilities {
|
|
411
|
+
mtlsEnabled: boolean;
|
|
412
|
+
webhookSyncConfigured: boolean;
|
|
413
|
+
customApiBaseUrl: boolean;
|
|
414
|
+
customOAuthBaseUrl: boolean;
|
|
415
|
+
customPartnerApiBaseUrl: boolean;
|
|
416
|
+
}
|
|
417
|
+
interface EdgeConnectServerFromEnvResult {
|
|
418
|
+
server: EdgeConnectServer;
|
|
419
|
+
config: EdgeConnectServerConfig;
|
|
420
|
+
capabilities: EdgeConnectServerFromEnvCapabilities;
|
|
421
|
+
warnings: string[];
|
|
422
|
+
}
|
|
423
|
+
declare function createEdgeConnectServerFromEnv(options?: CreateEdgeConnectServerFromEnvOptions): EdgeConnectServerFromEnvResult;
|
|
424
|
+
|
|
425
|
+
interface EdgeProblemJson {
|
|
426
|
+
type: string;
|
|
427
|
+
title: string;
|
|
428
|
+
status: number;
|
|
429
|
+
detail: string;
|
|
430
|
+
code: string;
|
|
431
|
+
details?: Record<string, unknown>;
|
|
432
|
+
}
|
|
433
|
+
interface EdgeHttpError {
|
|
434
|
+
status: number;
|
|
435
|
+
body: EdgeProblemJson;
|
|
436
|
+
}
|
|
437
|
+
declare function toEdgeHttpError(error: unknown): EdgeHttpError;
|
|
438
|
+
declare function toEdgeProblemJson(error: unknown): EdgeProblemJson;
|
|
439
|
+
|
|
440
|
+
interface PartnerIdentityAddress {
|
|
441
|
+
street?: string | null;
|
|
442
|
+
line1?: string | null;
|
|
443
|
+
address1?: string | null;
|
|
444
|
+
city?: string | null;
|
|
445
|
+
state?: string | null;
|
|
446
|
+
zip?: string | null;
|
|
447
|
+
postalCode?: string | null;
|
|
448
|
+
}
|
|
449
|
+
interface PartnerIdentityProfile {
|
|
450
|
+
firstName?: string | null;
|
|
451
|
+
givenName?: string | null;
|
|
452
|
+
lastName?: string | null;
|
|
453
|
+
familyName?: string | null;
|
|
454
|
+
address?: PartnerIdentityAddress | null;
|
|
455
|
+
}
|
|
456
|
+
interface IdentityPolicy {
|
|
457
|
+
minNameScore?: number;
|
|
458
|
+
minAddressScore?: number;
|
|
459
|
+
requireZipMatch?: boolean;
|
|
460
|
+
requireApiVerified?: boolean;
|
|
461
|
+
}
|
|
462
|
+
interface IdentityPolicyEvaluation {
|
|
463
|
+
verified: boolean;
|
|
464
|
+
reasons: string[];
|
|
465
|
+
scores?: VerifyIdentityResult['scores'];
|
|
466
|
+
}
|
|
467
|
+
declare function buildVerifyIdentityPayload(profile: PartnerIdentityProfile): VerifyIdentityOptions;
|
|
468
|
+
declare function evaluateIdentityResult(result: VerifyIdentityResult, policy?: IdentityPolicy): IdentityPolicyEvaluation;
|
|
469
|
+
|
|
470
|
+
interface TransferWebhookIntent {
|
|
471
|
+
transferId: string;
|
|
472
|
+
type?: TransferType;
|
|
473
|
+
amount?: string | number;
|
|
474
|
+
status?: TransferStatus;
|
|
475
|
+
}
|
|
476
|
+
declare function isTransferWebhookEvent(event: EdgeWebhookEvent): event is Extract<EdgeWebhookEvent, {
|
|
477
|
+
type: `transfer.${string}`;
|
|
478
|
+
}>;
|
|
479
|
+
declare function assertTransferEventMatchesIntent(event: EdgeWebhookEvent, intent: TransferWebhookIntent): void;
|
|
480
|
+
|
|
239
481
|
/**
|
|
240
482
|
* Webhook Signature Verification (SDK-001)
|
|
241
483
|
*
|
|
@@ -300,4 +542,24 @@ interface VerifyWebhookSignatureOptions {
|
|
|
300
542
|
*/
|
|
301
543
|
declare function verifyWebhookSignature(header: string, body: string, secret: string, options?: VerifyWebhookSignatureOptions): boolean;
|
|
302
544
|
|
|
303
|
-
|
|
545
|
+
type EdgeWebhookRawBody = string | Buffer | Uint8Array;
|
|
546
|
+
type EdgeWebhookSignatureHeader = string | string[] | undefined | null;
|
|
547
|
+
interface ParseAndVerifyWebhookOptions extends VerifyWebhookSignatureOptions {
|
|
548
|
+
rawBody: EdgeWebhookRawBody;
|
|
549
|
+
signatureHeader: EdgeWebhookSignatureHeader;
|
|
550
|
+
secret: string;
|
|
551
|
+
receivedAt?: Date;
|
|
552
|
+
}
|
|
553
|
+
interface ParsedEdgeWebhook {
|
|
554
|
+
event: EdgeWebhookEvent;
|
|
555
|
+
eventId: string;
|
|
556
|
+
eventType: EdgeWebhookEventType;
|
|
557
|
+
signatureTimestamp: number;
|
|
558
|
+
receivedAt: Date;
|
|
559
|
+
}
|
|
560
|
+
declare function parseAndVerifyWebhook(options: ParseAndVerifyWebhookOptions): ParsedEdgeWebhook;
|
|
561
|
+
declare function extractWebhookSignatureTimestamp(header: EdgeWebhookSignatureHeader): number | undefined;
|
|
562
|
+
declare function isEdgeWebhookEvent(value: unknown): value is EdgeWebhookEvent;
|
|
563
|
+
declare function validateEdgeWebhookEvent(value: unknown): EdgeWebhookEvent;
|
|
564
|
+
|
|
565
|
+
export { type CreateEdgeConnectServerFromEnvOptions, type CreateTransferIdempotencyKeyOptions, type EdgeConnectEnv, EdgeConnectServer, type EdgeConnectServerConfig, type EdgeConnectServerFromEnvCapabilities, type EdgeConnectServerFromEnvResult, type EdgeHttpError, type EdgeProblemJson, type EdgeTokenStore, type EdgeTokenStoreSaveContext, type EdgeTokenStoreValue, EdgeTokenVault, type EdgeTokenVaultKey, type EdgeTokenVaultKeyMaterial, type EdgeTokenVaultOptions, EdgeUserClient, EdgeUserSession, type EdgeUserSessionOptions, type EdgeWebhookRawBody, EdgeWebhookReconciler, type EdgeWebhookSignatureHeader, type GetValidTokensOptions, type IdentityPolicy, type IdentityPolicyEvaluation, type MtlsConfig, type ParseAndVerifyWebhookOptions, type ParsedEdgeWebhook, type PartnerIdentityAddress, type PartnerIdentityProfile, type RequestInfo, type ResponseInfo, type RetryConfig, type StartTransferVerificationOptions, type StartTransferVerificationResult, type SyncWebhookEventsOptions, type SyncWebhookEventsResult, type TransferAmountLimits, type TransferIntent, type TransferOptions, type TransferWebhookIntent, type VerifyWebhookSignatureOptions, type WebhookReconcilerCursorStore, type WebhookReconcilerOptions, type WebhookReconcilerRunResult, assertSameTransferIntent, assertTransferEventMatchesIntent, buildVerifyIdentityPayload, createEdgeConnectServerFromEnv, createEdgeTokenVault, createEdgeUserSession, createTransferIdempotencyKey, createWebhookReconciler, evaluateIdentityResult, extractWebhookSignatureTimestamp, isEdgeTokenVaultEnvelope, isEdgeWebhookEvent, isTransferWebhookEvent, normalizeMoneyAmount, parseAndVerifyWebhook, startTransferVerification, toEdgeHttpError, toEdgeProblemJson, validateEdgeWebhookEvent, validateTransferAmount, verifyWebhookSignature };
|