@develit-services/bank 0.8.8 → 0.8.10
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 +150 -275
- package/dist/database/schema.cjs +1 -1
- package/dist/database/schema.d.cts +2 -2
- package/dist/database/schema.d.mts +2 -2
- package/dist/database/schema.d.ts +2 -2
- package/dist/database/schema.mjs +1 -1
- package/dist/export/worker.cjs +405 -549
- package/dist/export/worker.d.cts +855 -86
- package/dist/export/worker.d.mts +855 -86
- package/dist/export/worker.d.ts +855 -86
- package/dist/export/worker.mjs +405 -549
- package/dist/export/workflows.cjs +16 -16
- package/dist/export/workflows.mjs +16 -16
- package/dist/export/wrangler.cjs +0 -12
- package/dist/export/wrangler.d.cts +1 -8
- package/dist/export/wrangler.d.mts +1 -8
- package/dist/export/wrangler.d.ts +1 -8
- package/dist/export/wrangler.mjs +0 -12
- package/dist/shared/{bank.JVlyPAAb.cjs → bank.BBXoZ5QU.cjs} +26 -13
- package/dist/shared/{bank.DRTuKO8S.d.ts → bank.BCop1cDT.d.mts} +4 -15
- package/dist/shared/{bank.Bg3Pdwm4.cjs → bank.BsIiXsFH.cjs} +5 -13
- package/dist/shared/{bank.BoZtXQpG.mjs → bank.CR0UlyRi.mjs} +1 -1
- package/dist/shared/{bank.CtnsGHM8.cjs → bank.CUvVxlHy.cjs} +126 -152
- package/dist/shared/{bank.DJnDSYqE.cjs → bank.CVi6R7fr.cjs} +1 -1
- package/dist/shared/{bank.C6jjS1Pl.mjs → bank.CXBeULUL.mjs} +25 -14
- package/dist/shared/{bank.DT6bg8k5.cjs → bank.Cev1E9sk.cjs} +2 -2
- package/dist/shared/{bank.B-NJB8GB.d.cts → bank.Cj2Goq7s.d.cts} +104 -176
- package/dist/shared/{bank.B-NJB8GB.d.mts → bank.Cj2Goq7s.d.mts} +104 -176
- package/dist/shared/{bank.B-NJB8GB.d.ts → bank.Cj2Goq7s.d.ts} +104 -176
- package/dist/shared/{bank.BzobShUU.d.cts → bank.CjTfEd1Q.d.cts} +4 -15
- package/dist/shared/{bank.BtszLapg.mjs → bank.D-O_gmmZ.mjs} +127 -152
- package/dist/shared/{bank.BP_3WMIF.d.cts → bank.DMjtitKo.d.cts} +0 -1
- package/dist/shared/{bank.BP_3WMIF.d.mts → bank.DMjtitKo.d.mts} +0 -1
- package/dist/shared/{bank.BP_3WMIF.d.ts → bank.DMjtitKo.d.ts} +0 -1
- package/dist/shared/{bank.CAVvvZZO.d.mts → bank.OlDt7dpb.d.ts} +4 -15
- package/dist/shared/{bank.CbAwwIhZ.mjs → bank.vz1uqEYa.mjs} +5 -11
- package/dist/shared/{bank.B5bZRvgq.mjs → bank.xB9eTN77.mjs} +2 -2
- package/dist/types.cjs +6 -6
- package/dist/types.d.cts +26 -45
- package/dist/types.d.mts +26 -45
- package/dist/types.d.ts +26 -45
- package/dist/types.mjs +3 -3
- package/package.json +1 -1
package/dist/types.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const mock_connector = require('./shared/bank.
|
|
4
|
-
const paymentRequest_schema = require('./shared/bank.
|
|
5
|
-
const batchLifecycle = require('./shared/bank.
|
|
3
|
+
const mock_connector = require('./shared/bank.CUvVxlHy.cjs');
|
|
4
|
+
const paymentRequest_schema = require('./shared/bank.BBXoZ5QU.cjs');
|
|
5
|
+
const batchLifecycle = require('./shared/bank.BsIiXsFH.cjs');
|
|
6
6
|
const generalCodes = require('@develit-io/general-codes');
|
|
7
7
|
require('@develit-io/backend-sdk');
|
|
8
8
|
require('date-fns');
|
|
@@ -35,6 +35,7 @@ exports.toPaymentRequestInsert = mock_connector.toPaymentRequestInsert;
|
|
|
35
35
|
exports.toPreparedPayment = mock_connector.toPreparedPayment;
|
|
36
36
|
exports.useFinbricksFetch = mock_connector.useFinbricksFetch;
|
|
37
37
|
exports.ACCOUNT_STATUSES = paymentRequest_schema.ACCOUNT_STATUSES;
|
|
38
|
+
exports.BATCH_MODES = paymentRequest_schema.BATCH_MODES;
|
|
38
39
|
exports.BATCH_STATUES = paymentRequest_schema.BATCH_STATUSES;
|
|
39
40
|
exports.BATCH_STATUSES = paymentRequest_schema.BATCH_STATUSES;
|
|
40
41
|
exports.CHARGE_BEARERS = paymentRequest_schema.CHARGE_BEARERS;
|
|
@@ -43,6 +44,7 @@ exports.COUNTRY_CODES = paymentRequest_schema.COUNTRY_CODES;
|
|
|
43
44
|
exports.CREDENTIALS_TYPES = paymentRequest_schema.CREDENTIALS_TYPES;
|
|
44
45
|
exports.INSTRUCTION_PRIORITIES = paymentRequest_schema.INSTRUCTION_PRIORITIES;
|
|
45
46
|
exports.PAYMENT_DIRECTIONS = paymentRequest_schema.PAYMENT_DIRECTIONS;
|
|
47
|
+
exports.PAYMENT_REQUEST_STATUSES = paymentRequest_schema.PAYMENT_REQUEST_STATUSES;
|
|
46
48
|
exports.PAYMENT_STATUSES = paymentRequest_schema.PAYMENT_STATUSES;
|
|
47
49
|
exports.PAYMENT_TYPES = paymentRequest_schema.PAYMENT_TYPES;
|
|
48
50
|
exports.TOKEN_TYPES = paymentRequest_schema.TOKEN_TYPES;
|
|
@@ -56,14 +58,12 @@ exports.ottInsertSchema = paymentRequest_schema.ottInsertSchema;
|
|
|
56
58
|
exports.ottSelectSchema = paymentRequest_schema.ottSelectSchema;
|
|
57
59
|
exports.ottUpdateSchema = paymentRequest_schema.ottUpdateSchema;
|
|
58
60
|
exports.hasPaymentAccountAssigned = batchLifecycle.hasPaymentAccountAssigned;
|
|
61
|
+
exports.isBatchAuthorized = batchLifecycle.isBatchAuthorized;
|
|
59
62
|
exports.isBatchCompleted = batchLifecycle.isBatchCompleted;
|
|
60
63
|
exports.isBatchFailed = batchLifecycle.isBatchFailed;
|
|
61
64
|
exports.isBatchInitiated = batchLifecycle.isBatchInitiated;
|
|
62
|
-
exports.isBatchOpen = batchLifecycle.isBatchOpen;
|
|
63
65
|
exports.isBatchProcessing = batchLifecycle.isBatchProcessing;
|
|
64
66
|
exports.isBatchReadyToSign = batchLifecycle.isBatchReadyToSign;
|
|
65
|
-
exports.isBatchSigned = batchLifecycle.isBatchSigned;
|
|
66
67
|
exports.isPaymentCompleted = batchLifecycle.isPaymentCompleted;
|
|
67
|
-
exports.isPaymentPrepared = batchLifecycle.isPaymentPrepared;
|
|
68
68
|
exports.BANK_CODES = generalCodes.BANK_CODES;
|
|
69
69
|
exports.CURRENCY_CODES = generalCodes.CURRENCY_CODES;
|
package/dist/types.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { I as IBankConnector, b as ConnectorKey,
|
|
2
|
-
export {
|
|
3
|
-
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.
|
|
4
|
-
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse,
|
|
5
|
-
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency, P as PaymentSelectType, a as PaymentRequestSelectType, s as AccountAssignedPayment, u as PreparedPayment, v as CompletedPayment, w as PaymentRequestInsertType } from './shared/bank.Cj2Goq7s.cjs';
|
|
2
|
+
export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted } from './shared/bank.Cj2Goq7s.cjs';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.CjTfEd1Q.cjs';
|
|
4
|
+
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.CjTfEd1Q.cjs';
|
|
5
|
+
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.DMjtitKo.cjs';
|
|
6
6
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_zod from 'drizzle-zod';
|
|
8
8
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
@@ -239,7 +239,6 @@ interface FinbricksConnectorConfig {
|
|
|
239
239
|
}
|
|
240
240
|
declare abstract class FinbricksConnector extends IBankConnector {
|
|
241
241
|
connectorKey: ConnectorKey;
|
|
242
|
-
readonly lifecycleMode: 'batch' | 'per-payment';
|
|
243
242
|
connectedAccounts: ConnectedAccount[];
|
|
244
243
|
supportsPaymentType(paymentType: PaymentType): boolean;
|
|
245
244
|
protected readonly finbricks: FinbricksClient;
|
|
@@ -290,14 +289,8 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
290
289
|
}): Promise<ParsedBankPayment[]>;
|
|
291
290
|
getPaymentStatus({ paymentId, }: {
|
|
292
291
|
paymentId: string;
|
|
293
|
-
}): Promise<
|
|
294
|
-
|
|
295
|
-
batchId: string;
|
|
296
|
-
currentStatus: BatchStatus;
|
|
297
|
-
}): Promise<{
|
|
298
|
-
status: BatchStatus;
|
|
299
|
-
apiResponse: object;
|
|
300
|
-
}>;
|
|
292
|
+
}): Promise<PaymentRequestStatus>;
|
|
293
|
+
parseAuthorizationCallback(callbackUrl: string): AuthorizationCallbackResult;
|
|
301
294
|
}
|
|
302
295
|
|
|
303
296
|
declare class CsobConnector extends FinbricksConnector {
|
|
@@ -316,7 +309,6 @@ interface DbuConnectorConfig {
|
|
|
316
309
|
}
|
|
317
310
|
declare class DbuConnector extends IBankConnector {
|
|
318
311
|
connectorKey: ConnectorKey;
|
|
319
|
-
readonly lifecycleMode = "per-payment";
|
|
320
312
|
connectedAccounts: ConnectedAccount[];
|
|
321
313
|
readonly kv: KVNamespace;
|
|
322
314
|
readonly api: Fetcher;
|
|
@@ -331,6 +323,7 @@ declare class DbuConnector extends IBankConnector {
|
|
|
331
323
|
private makeRequest;
|
|
332
324
|
private mapDbuCurrencyCode;
|
|
333
325
|
private mapDbuTransactionToPayment;
|
|
326
|
+
private mapDbuStatusToPaymentRequestStatus;
|
|
334
327
|
private mapDbuStatusToPaymentStatus;
|
|
335
328
|
getAuthUri({ ott }: {
|
|
336
329
|
ott: string;
|
|
@@ -369,13 +362,8 @@ declare class DbuConnector extends IBankConnector {
|
|
|
369
362
|
}): Promise<ParsedBankPayment[]>;
|
|
370
363
|
getPaymentStatus({ paymentId, }: {
|
|
371
364
|
paymentId: string;
|
|
372
|
-
}): Promise<
|
|
373
|
-
|
|
374
|
-
batchId: string;
|
|
375
|
-
}): Promise<{
|
|
376
|
-
status: BatchStatus;
|
|
377
|
-
apiResponse: object;
|
|
378
|
-
}>;
|
|
365
|
+
}): Promise<PaymentRequestStatus>;
|
|
366
|
+
parseAuthorizationCallback(callbackUrl: string): AuthorizationCallbackResult;
|
|
379
367
|
}
|
|
380
368
|
|
|
381
369
|
interface ErsteConnectorConfig {
|
|
@@ -401,7 +389,6 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
401
389
|
private readonly REDIRECT_URI;
|
|
402
390
|
private readonly ACCOUNTS_URI;
|
|
403
391
|
connectorKey: ConnectorKey;
|
|
404
|
-
readonly lifecycleMode = "batch";
|
|
405
392
|
connectedAccounts: ConnectedAccount[];
|
|
406
393
|
private accessToken;
|
|
407
394
|
constructor(config: ErsteConnectorConfig);
|
|
@@ -446,13 +433,8 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
446
433
|
}): Promise<ParsedBankPayment[]>;
|
|
447
434
|
getPaymentStatus(_: {
|
|
448
435
|
paymentId: string;
|
|
449
|
-
}): Promise<
|
|
450
|
-
|
|
451
|
-
batchId: string;
|
|
452
|
-
}): Promise<{
|
|
453
|
-
status: BatchStatus;
|
|
454
|
-
apiResponse: object;
|
|
455
|
-
}>;
|
|
436
|
+
}): Promise<PaymentRequestStatus>;
|
|
437
|
+
parseAuthorizationCallback(_callbackUrl: string): AuthorizationCallbackResult;
|
|
456
438
|
}
|
|
457
439
|
|
|
458
440
|
declare class KBConnector extends FinbricksConnector {
|
|
@@ -468,7 +450,6 @@ declare class MockCobsConnector extends FinbricksConnector {
|
|
|
468
450
|
declare class MockConnector extends IBankConnector {
|
|
469
451
|
connectedAccounts: ConnectedAccount[];
|
|
470
452
|
connectorKey: ConnectorKey;
|
|
471
|
-
readonly lifecycleMode = "batch";
|
|
472
453
|
constructor();
|
|
473
454
|
supportsBatch(_paymentType: PaymentType): boolean;
|
|
474
455
|
getAuthUri({ accountId, }: {
|
|
@@ -505,13 +486,8 @@ declare class MockConnector extends IBankConnector {
|
|
|
505
486
|
}): Promise<ParsedBankPayment[]>;
|
|
506
487
|
getPaymentStatus(_: {
|
|
507
488
|
paymentId: string;
|
|
508
|
-
}): Promise<
|
|
509
|
-
|
|
510
|
-
batchId: string;
|
|
511
|
-
}): Promise<{
|
|
512
|
-
status: BatchStatus;
|
|
513
|
-
apiResponse: object;
|
|
514
|
-
}>;
|
|
489
|
+
}): Promise<PaymentRequestStatus>;
|
|
490
|
+
parseAuthorizationCallback(_callbackUrl: string): AuthorizationCallbackResult;
|
|
515
491
|
}
|
|
516
492
|
|
|
517
493
|
interface ErsteAuthenticationResponse {
|
|
@@ -649,9 +625,14 @@ interface ErsteObtainAuthorizationURLResponse {
|
|
|
649
625
|
|
|
650
626
|
type BankPaymentEvent = BaseEvent & {
|
|
651
627
|
eventType: 'BANK_PAYMENT';
|
|
652
|
-
eventSignal: '
|
|
628
|
+
eventSignal: 'paymentFetched' | 'paymentUpdated';
|
|
653
629
|
bankPayment: Partial<PaymentSelectType>;
|
|
654
630
|
};
|
|
631
|
+
type BankPaymentRequestEvent = BaseEvent & {
|
|
632
|
+
eventType: 'BANK_PAYMENT_REQUEST';
|
|
633
|
+
eventSignal: 'paymentRequestStatusChanged';
|
|
634
|
+
paymentRequest: PaymentRequestSelectType;
|
|
635
|
+
};
|
|
655
636
|
|
|
656
637
|
declare const ottInsertSchema: drizzle_zod.BuildSchema<"insert", {
|
|
657
638
|
oneTimeToken: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
@@ -1284,7 +1265,7 @@ type OneTimeTokenSelectType = z.infer<typeof ottSelectSchema>;
|
|
|
1284
1265
|
* Transform API input (SendPaymentInput) to incoming payment
|
|
1285
1266
|
*
|
|
1286
1267
|
* This is the first transformation in the payment lifecycle.
|
|
1287
|
-
* Creates a new payment with generated ID and
|
|
1268
|
+
* Creates a new payment with generated ID and OPENED status.
|
|
1288
1269
|
*
|
|
1289
1270
|
* @param input - Payment data from API
|
|
1290
1271
|
* @returns IncomingPayment ready for account assignment
|
|
@@ -1317,7 +1298,7 @@ declare function toBatchedPayment(payment: AccountAssignedPayment): BatchedPayme
|
|
|
1317
1298
|
/**
|
|
1318
1299
|
* Transform batched payment to prepared payment
|
|
1319
1300
|
*
|
|
1320
|
-
* Updates payment
|
|
1301
|
+
* Updates payment after connector.initiateBatch()
|
|
1321
1302
|
* May include bankRefId if connector assigns it during batch initiation.
|
|
1322
1303
|
*
|
|
1323
1304
|
* @param payment - Batched payment
|
|
@@ -1329,7 +1310,7 @@ declare function toPreparedPayment(payment: BatchedPayment, bankRefId?: string,
|
|
|
1329
1310
|
/**
|
|
1330
1311
|
* Transform prepared payment to completed payment
|
|
1331
1312
|
*
|
|
1332
|
-
* Updates payment status to final state (
|
|
1313
|
+
* Updates payment status to final state (SETTLED/REJECTED) after bank processing
|
|
1333
1314
|
* Requires bankRefId to be present.
|
|
1334
1315
|
*
|
|
1335
1316
|
* @param payment - Prepared payment
|
|
@@ -1338,9 +1319,9 @@ declare function toPreparedPayment(payment: BatchedPayment, bankRefId?: string,
|
|
|
1338
1319
|
* @param processedAt - Timestamp when payment was processed by bank
|
|
1339
1320
|
* @returns CompletedPayment with final status
|
|
1340
1321
|
*/
|
|
1341
|
-
declare function toCompletedPayment(payment: PreparedPayment, status: '
|
|
1322
|
+
declare function toCompletedPayment(payment: PreparedPayment, status: 'SETTLED' | 'REJECTED', bankRefId: string, processedAt?: Date): CompletedPayment;
|
|
1342
1323
|
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string | null): PaymentRequestInsertType;
|
|
1343
1324
|
declare function toBatchedPaymentFromPaymentRequest(sp: PaymentRequestSelectType): BatchedPayment;
|
|
1344
1325
|
|
|
1345
|
-
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata,
|
|
1346
|
-
export type { BankPaymentEvent, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksBatchBody, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectorConfig, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksProvider, FinbricksRequestInit, FinbricksSupportedBanksQuery, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
|
|
1326
|
+
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchedPayment, CompletedPayment, ConnectedAccount, ConnectorKey, CredentialsResolver, CsobConnector, Currency, DbuConnector, ErsteConnector, FINBRICKS_ENDPOINTS, FinbricksAccount, FinbricksClient, FinbricksConnector, IBankConnector, IncomingPayment, IncomingPayment as IncomingPaymentMessage, InitiatedBatch, InitiatedPayment, KBConnector, MockCobsConnector, MockConnector, ParsedBankPayment, PaymentRequestInsertType, PaymentRequestSelectType, PaymentRequestStatus, PaymentSelectType, PaymentType, PreparedPayment, SendPaymentInput, assignAccount, ottInsertSchema, ottSelectSchema, ottUpdateSchema, signFinbricksJws, toBatchedPayment, toBatchedPaymentFromPaymentRequest, toCompletedPayment, toIncomingPayment, toPaymentRequestInsert, toPreparedPayment, useFinbricksFetch };
|
|
1327
|
+
export type { BankPaymentEvent, BankPaymentRequestEvent, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksBatchBody, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectorConfig, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksProvider, FinbricksRequestInit, FinbricksSupportedBanksQuery, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { I as IBankConnector, b as ConnectorKey,
|
|
2
|
-
export {
|
|
3
|
-
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.
|
|
4
|
-
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse,
|
|
5
|
-
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency, P as PaymentSelectType, a as PaymentRequestSelectType, s as AccountAssignedPayment, u as PreparedPayment, v as CompletedPayment, w as PaymentRequestInsertType } from './shared/bank.Cj2Goq7s.mjs';
|
|
2
|
+
export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted } from './shared/bank.Cj2Goq7s.mjs';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.BCop1cDT.mjs';
|
|
4
|
+
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.BCop1cDT.mjs';
|
|
5
|
+
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.DMjtitKo.mjs';
|
|
6
6
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_zod from 'drizzle-zod';
|
|
8
8
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
@@ -239,7 +239,6 @@ interface FinbricksConnectorConfig {
|
|
|
239
239
|
}
|
|
240
240
|
declare abstract class FinbricksConnector extends IBankConnector {
|
|
241
241
|
connectorKey: ConnectorKey;
|
|
242
|
-
readonly lifecycleMode: 'batch' | 'per-payment';
|
|
243
242
|
connectedAccounts: ConnectedAccount[];
|
|
244
243
|
supportsPaymentType(paymentType: PaymentType): boolean;
|
|
245
244
|
protected readonly finbricks: FinbricksClient;
|
|
@@ -290,14 +289,8 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
290
289
|
}): Promise<ParsedBankPayment[]>;
|
|
291
290
|
getPaymentStatus({ paymentId, }: {
|
|
292
291
|
paymentId: string;
|
|
293
|
-
}): Promise<
|
|
294
|
-
|
|
295
|
-
batchId: string;
|
|
296
|
-
currentStatus: BatchStatus;
|
|
297
|
-
}): Promise<{
|
|
298
|
-
status: BatchStatus;
|
|
299
|
-
apiResponse: object;
|
|
300
|
-
}>;
|
|
292
|
+
}): Promise<PaymentRequestStatus>;
|
|
293
|
+
parseAuthorizationCallback(callbackUrl: string): AuthorizationCallbackResult;
|
|
301
294
|
}
|
|
302
295
|
|
|
303
296
|
declare class CsobConnector extends FinbricksConnector {
|
|
@@ -316,7 +309,6 @@ interface DbuConnectorConfig {
|
|
|
316
309
|
}
|
|
317
310
|
declare class DbuConnector extends IBankConnector {
|
|
318
311
|
connectorKey: ConnectorKey;
|
|
319
|
-
readonly lifecycleMode = "per-payment";
|
|
320
312
|
connectedAccounts: ConnectedAccount[];
|
|
321
313
|
readonly kv: KVNamespace;
|
|
322
314
|
readonly api: Fetcher;
|
|
@@ -331,6 +323,7 @@ declare class DbuConnector extends IBankConnector {
|
|
|
331
323
|
private makeRequest;
|
|
332
324
|
private mapDbuCurrencyCode;
|
|
333
325
|
private mapDbuTransactionToPayment;
|
|
326
|
+
private mapDbuStatusToPaymentRequestStatus;
|
|
334
327
|
private mapDbuStatusToPaymentStatus;
|
|
335
328
|
getAuthUri({ ott }: {
|
|
336
329
|
ott: string;
|
|
@@ -369,13 +362,8 @@ declare class DbuConnector extends IBankConnector {
|
|
|
369
362
|
}): Promise<ParsedBankPayment[]>;
|
|
370
363
|
getPaymentStatus({ paymentId, }: {
|
|
371
364
|
paymentId: string;
|
|
372
|
-
}): Promise<
|
|
373
|
-
|
|
374
|
-
batchId: string;
|
|
375
|
-
}): Promise<{
|
|
376
|
-
status: BatchStatus;
|
|
377
|
-
apiResponse: object;
|
|
378
|
-
}>;
|
|
365
|
+
}): Promise<PaymentRequestStatus>;
|
|
366
|
+
parseAuthorizationCallback(callbackUrl: string): AuthorizationCallbackResult;
|
|
379
367
|
}
|
|
380
368
|
|
|
381
369
|
interface ErsteConnectorConfig {
|
|
@@ -401,7 +389,6 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
401
389
|
private readonly REDIRECT_URI;
|
|
402
390
|
private readonly ACCOUNTS_URI;
|
|
403
391
|
connectorKey: ConnectorKey;
|
|
404
|
-
readonly lifecycleMode = "batch";
|
|
405
392
|
connectedAccounts: ConnectedAccount[];
|
|
406
393
|
private accessToken;
|
|
407
394
|
constructor(config: ErsteConnectorConfig);
|
|
@@ -446,13 +433,8 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
446
433
|
}): Promise<ParsedBankPayment[]>;
|
|
447
434
|
getPaymentStatus(_: {
|
|
448
435
|
paymentId: string;
|
|
449
|
-
}): Promise<
|
|
450
|
-
|
|
451
|
-
batchId: string;
|
|
452
|
-
}): Promise<{
|
|
453
|
-
status: BatchStatus;
|
|
454
|
-
apiResponse: object;
|
|
455
|
-
}>;
|
|
436
|
+
}): Promise<PaymentRequestStatus>;
|
|
437
|
+
parseAuthorizationCallback(_callbackUrl: string): AuthorizationCallbackResult;
|
|
456
438
|
}
|
|
457
439
|
|
|
458
440
|
declare class KBConnector extends FinbricksConnector {
|
|
@@ -468,7 +450,6 @@ declare class MockCobsConnector extends FinbricksConnector {
|
|
|
468
450
|
declare class MockConnector extends IBankConnector {
|
|
469
451
|
connectedAccounts: ConnectedAccount[];
|
|
470
452
|
connectorKey: ConnectorKey;
|
|
471
|
-
readonly lifecycleMode = "batch";
|
|
472
453
|
constructor();
|
|
473
454
|
supportsBatch(_paymentType: PaymentType): boolean;
|
|
474
455
|
getAuthUri({ accountId, }: {
|
|
@@ -505,13 +486,8 @@ declare class MockConnector extends IBankConnector {
|
|
|
505
486
|
}): Promise<ParsedBankPayment[]>;
|
|
506
487
|
getPaymentStatus(_: {
|
|
507
488
|
paymentId: string;
|
|
508
|
-
}): Promise<
|
|
509
|
-
|
|
510
|
-
batchId: string;
|
|
511
|
-
}): Promise<{
|
|
512
|
-
status: BatchStatus;
|
|
513
|
-
apiResponse: object;
|
|
514
|
-
}>;
|
|
489
|
+
}): Promise<PaymentRequestStatus>;
|
|
490
|
+
parseAuthorizationCallback(_callbackUrl: string): AuthorizationCallbackResult;
|
|
515
491
|
}
|
|
516
492
|
|
|
517
493
|
interface ErsteAuthenticationResponse {
|
|
@@ -649,9 +625,14 @@ interface ErsteObtainAuthorizationURLResponse {
|
|
|
649
625
|
|
|
650
626
|
type BankPaymentEvent = BaseEvent & {
|
|
651
627
|
eventType: 'BANK_PAYMENT';
|
|
652
|
-
eventSignal: '
|
|
628
|
+
eventSignal: 'paymentFetched' | 'paymentUpdated';
|
|
653
629
|
bankPayment: Partial<PaymentSelectType>;
|
|
654
630
|
};
|
|
631
|
+
type BankPaymentRequestEvent = BaseEvent & {
|
|
632
|
+
eventType: 'BANK_PAYMENT_REQUEST';
|
|
633
|
+
eventSignal: 'paymentRequestStatusChanged';
|
|
634
|
+
paymentRequest: PaymentRequestSelectType;
|
|
635
|
+
};
|
|
655
636
|
|
|
656
637
|
declare const ottInsertSchema: drizzle_zod.BuildSchema<"insert", {
|
|
657
638
|
oneTimeToken: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
@@ -1284,7 +1265,7 @@ type OneTimeTokenSelectType = z.infer<typeof ottSelectSchema>;
|
|
|
1284
1265
|
* Transform API input (SendPaymentInput) to incoming payment
|
|
1285
1266
|
*
|
|
1286
1267
|
* This is the first transformation in the payment lifecycle.
|
|
1287
|
-
* Creates a new payment with generated ID and
|
|
1268
|
+
* Creates a new payment with generated ID and OPENED status.
|
|
1288
1269
|
*
|
|
1289
1270
|
* @param input - Payment data from API
|
|
1290
1271
|
* @returns IncomingPayment ready for account assignment
|
|
@@ -1317,7 +1298,7 @@ declare function toBatchedPayment(payment: AccountAssignedPayment): BatchedPayme
|
|
|
1317
1298
|
/**
|
|
1318
1299
|
* Transform batched payment to prepared payment
|
|
1319
1300
|
*
|
|
1320
|
-
* Updates payment
|
|
1301
|
+
* Updates payment after connector.initiateBatch()
|
|
1321
1302
|
* May include bankRefId if connector assigns it during batch initiation.
|
|
1322
1303
|
*
|
|
1323
1304
|
* @param payment - Batched payment
|
|
@@ -1329,7 +1310,7 @@ declare function toPreparedPayment(payment: BatchedPayment, bankRefId?: string,
|
|
|
1329
1310
|
/**
|
|
1330
1311
|
* Transform prepared payment to completed payment
|
|
1331
1312
|
*
|
|
1332
|
-
* Updates payment status to final state (
|
|
1313
|
+
* Updates payment status to final state (SETTLED/REJECTED) after bank processing
|
|
1333
1314
|
* Requires bankRefId to be present.
|
|
1334
1315
|
*
|
|
1335
1316
|
* @param payment - Prepared payment
|
|
@@ -1338,9 +1319,9 @@ declare function toPreparedPayment(payment: BatchedPayment, bankRefId?: string,
|
|
|
1338
1319
|
* @param processedAt - Timestamp when payment was processed by bank
|
|
1339
1320
|
* @returns CompletedPayment with final status
|
|
1340
1321
|
*/
|
|
1341
|
-
declare function toCompletedPayment(payment: PreparedPayment, status: '
|
|
1322
|
+
declare function toCompletedPayment(payment: PreparedPayment, status: 'SETTLED' | 'REJECTED', bankRefId: string, processedAt?: Date): CompletedPayment;
|
|
1342
1323
|
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string | null): PaymentRequestInsertType;
|
|
1343
1324
|
declare function toBatchedPaymentFromPaymentRequest(sp: PaymentRequestSelectType): BatchedPayment;
|
|
1344
1325
|
|
|
1345
|
-
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata,
|
|
1346
|
-
export type { BankPaymentEvent, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksBatchBody, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectorConfig, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksProvider, FinbricksRequestInit, FinbricksSupportedBanksQuery, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
|
|
1326
|
+
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchedPayment, CompletedPayment, ConnectedAccount, ConnectorKey, CredentialsResolver, CsobConnector, Currency, DbuConnector, ErsteConnector, FINBRICKS_ENDPOINTS, FinbricksAccount, FinbricksClient, FinbricksConnector, IBankConnector, IncomingPayment, IncomingPayment as IncomingPaymentMessage, InitiatedBatch, InitiatedPayment, KBConnector, MockCobsConnector, MockConnector, ParsedBankPayment, PaymentRequestInsertType, PaymentRequestSelectType, PaymentRequestStatus, PaymentSelectType, PaymentType, PreparedPayment, SendPaymentInput, assignAccount, ottInsertSchema, ottSelectSchema, ottUpdateSchema, signFinbricksJws, toBatchedPayment, toBatchedPaymentFromPaymentRequest, toCompletedPayment, toIncomingPayment, toPaymentRequestInsert, toPreparedPayment, useFinbricksFetch };
|
|
1327
|
+
export type { BankPaymentEvent, BankPaymentRequestEvent, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksBatchBody, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectorConfig, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksProvider, FinbricksRequestInit, FinbricksSupportedBanksQuery, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { I as IBankConnector, b as ConnectorKey,
|
|
2
|
-
export {
|
|
3
|
-
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.
|
|
4
|
-
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse,
|
|
5
|
-
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency, P as PaymentSelectType, a as PaymentRequestSelectType, s as AccountAssignedPayment, u as PreparedPayment, v as CompletedPayment, w as PaymentRequestInsertType } from './shared/bank.Cj2Goq7s.js';
|
|
2
|
+
export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted } from './shared/bank.Cj2Goq7s.js';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.OlDt7dpb.js';
|
|
4
|
+
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.OlDt7dpb.js';
|
|
5
|
+
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.DMjtitKo.js';
|
|
6
6
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_zod from 'drizzle-zod';
|
|
8
8
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
@@ -239,7 +239,6 @@ interface FinbricksConnectorConfig {
|
|
|
239
239
|
}
|
|
240
240
|
declare abstract class FinbricksConnector extends IBankConnector {
|
|
241
241
|
connectorKey: ConnectorKey;
|
|
242
|
-
readonly lifecycleMode: 'batch' | 'per-payment';
|
|
243
242
|
connectedAccounts: ConnectedAccount[];
|
|
244
243
|
supportsPaymentType(paymentType: PaymentType): boolean;
|
|
245
244
|
protected readonly finbricks: FinbricksClient;
|
|
@@ -290,14 +289,8 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
290
289
|
}): Promise<ParsedBankPayment[]>;
|
|
291
290
|
getPaymentStatus({ paymentId, }: {
|
|
292
291
|
paymentId: string;
|
|
293
|
-
}): Promise<
|
|
294
|
-
|
|
295
|
-
batchId: string;
|
|
296
|
-
currentStatus: BatchStatus;
|
|
297
|
-
}): Promise<{
|
|
298
|
-
status: BatchStatus;
|
|
299
|
-
apiResponse: object;
|
|
300
|
-
}>;
|
|
292
|
+
}): Promise<PaymentRequestStatus>;
|
|
293
|
+
parseAuthorizationCallback(callbackUrl: string): AuthorizationCallbackResult;
|
|
301
294
|
}
|
|
302
295
|
|
|
303
296
|
declare class CsobConnector extends FinbricksConnector {
|
|
@@ -316,7 +309,6 @@ interface DbuConnectorConfig {
|
|
|
316
309
|
}
|
|
317
310
|
declare class DbuConnector extends IBankConnector {
|
|
318
311
|
connectorKey: ConnectorKey;
|
|
319
|
-
readonly lifecycleMode = "per-payment";
|
|
320
312
|
connectedAccounts: ConnectedAccount[];
|
|
321
313
|
readonly kv: KVNamespace;
|
|
322
314
|
readonly api: Fetcher;
|
|
@@ -331,6 +323,7 @@ declare class DbuConnector extends IBankConnector {
|
|
|
331
323
|
private makeRequest;
|
|
332
324
|
private mapDbuCurrencyCode;
|
|
333
325
|
private mapDbuTransactionToPayment;
|
|
326
|
+
private mapDbuStatusToPaymentRequestStatus;
|
|
334
327
|
private mapDbuStatusToPaymentStatus;
|
|
335
328
|
getAuthUri({ ott }: {
|
|
336
329
|
ott: string;
|
|
@@ -369,13 +362,8 @@ declare class DbuConnector extends IBankConnector {
|
|
|
369
362
|
}): Promise<ParsedBankPayment[]>;
|
|
370
363
|
getPaymentStatus({ paymentId, }: {
|
|
371
364
|
paymentId: string;
|
|
372
|
-
}): Promise<
|
|
373
|
-
|
|
374
|
-
batchId: string;
|
|
375
|
-
}): Promise<{
|
|
376
|
-
status: BatchStatus;
|
|
377
|
-
apiResponse: object;
|
|
378
|
-
}>;
|
|
365
|
+
}): Promise<PaymentRequestStatus>;
|
|
366
|
+
parseAuthorizationCallback(callbackUrl: string): AuthorizationCallbackResult;
|
|
379
367
|
}
|
|
380
368
|
|
|
381
369
|
interface ErsteConnectorConfig {
|
|
@@ -401,7 +389,6 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
401
389
|
private readonly REDIRECT_URI;
|
|
402
390
|
private readonly ACCOUNTS_URI;
|
|
403
391
|
connectorKey: ConnectorKey;
|
|
404
|
-
readonly lifecycleMode = "batch";
|
|
405
392
|
connectedAccounts: ConnectedAccount[];
|
|
406
393
|
private accessToken;
|
|
407
394
|
constructor(config: ErsteConnectorConfig);
|
|
@@ -446,13 +433,8 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
446
433
|
}): Promise<ParsedBankPayment[]>;
|
|
447
434
|
getPaymentStatus(_: {
|
|
448
435
|
paymentId: string;
|
|
449
|
-
}): Promise<
|
|
450
|
-
|
|
451
|
-
batchId: string;
|
|
452
|
-
}): Promise<{
|
|
453
|
-
status: BatchStatus;
|
|
454
|
-
apiResponse: object;
|
|
455
|
-
}>;
|
|
436
|
+
}): Promise<PaymentRequestStatus>;
|
|
437
|
+
parseAuthorizationCallback(_callbackUrl: string): AuthorizationCallbackResult;
|
|
456
438
|
}
|
|
457
439
|
|
|
458
440
|
declare class KBConnector extends FinbricksConnector {
|
|
@@ -468,7 +450,6 @@ declare class MockCobsConnector extends FinbricksConnector {
|
|
|
468
450
|
declare class MockConnector extends IBankConnector {
|
|
469
451
|
connectedAccounts: ConnectedAccount[];
|
|
470
452
|
connectorKey: ConnectorKey;
|
|
471
|
-
readonly lifecycleMode = "batch";
|
|
472
453
|
constructor();
|
|
473
454
|
supportsBatch(_paymentType: PaymentType): boolean;
|
|
474
455
|
getAuthUri({ accountId, }: {
|
|
@@ -505,13 +486,8 @@ declare class MockConnector extends IBankConnector {
|
|
|
505
486
|
}): Promise<ParsedBankPayment[]>;
|
|
506
487
|
getPaymentStatus(_: {
|
|
507
488
|
paymentId: string;
|
|
508
|
-
}): Promise<
|
|
509
|
-
|
|
510
|
-
batchId: string;
|
|
511
|
-
}): Promise<{
|
|
512
|
-
status: BatchStatus;
|
|
513
|
-
apiResponse: object;
|
|
514
|
-
}>;
|
|
489
|
+
}): Promise<PaymentRequestStatus>;
|
|
490
|
+
parseAuthorizationCallback(_callbackUrl: string): AuthorizationCallbackResult;
|
|
515
491
|
}
|
|
516
492
|
|
|
517
493
|
interface ErsteAuthenticationResponse {
|
|
@@ -649,9 +625,14 @@ interface ErsteObtainAuthorizationURLResponse {
|
|
|
649
625
|
|
|
650
626
|
type BankPaymentEvent = BaseEvent & {
|
|
651
627
|
eventType: 'BANK_PAYMENT';
|
|
652
|
-
eventSignal: '
|
|
628
|
+
eventSignal: 'paymentFetched' | 'paymentUpdated';
|
|
653
629
|
bankPayment: Partial<PaymentSelectType>;
|
|
654
630
|
};
|
|
631
|
+
type BankPaymentRequestEvent = BaseEvent & {
|
|
632
|
+
eventType: 'BANK_PAYMENT_REQUEST';
|
|
633
|
+
eventSignal: 'paymentRequestStatusChanged';
|
|
634
|
+
paymentRequest: PaymentRequestSelectType;
|
|
635
|
+
};
|
|
655
636
|
|
|
656
637
|
declare const ottInsertSchema: drizzle_zod.BuildSchema<"insert", {
|
|
657
638
|
oneTimeToken: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
@@ -1284,7 +1265,7 @@ type OneTimeTokenSelectType = z.infer<typeof ottSelectSchema>;
|
|
|
1284
1265
|
* Transform API input (SendPaymentInput) to incoming payment
|
|
1285
1266
|
*
|
|
1286
1267
|
* This is the first transformation in the payment lifecycle.
|
|
1287
|
-
* Creates a new payment with generated ID and
|
|
1268
|
+
* Creates a new payment with generated ID and OPENED status.
|
|
1288
1269
|
*
|
|
1289
1270
|
* @param input - Payment data from API
|
|
1290
1271
|
* @returns IncomingPayment ready for account assignment
|
|
@@ -1317,7 +1298,7 @@ declare function toBatchedPayment(payment: AccountAssignedPayment): BatchedPayme
|
|
|
1317
1298
|
/**
|
|
1318
1299
|
* Transform batched payment to prepared payment
|
|
1319
1300
|
*
|
|
1320
|
-
* Updates payment
|
|
1301
|
+
* Updates payment after connector.initiateBatch()
|
|
1321
1302
|
* May include bankRefId if connector assigns it during batch initiation.
|
|
1322
1303
|
*
|
|
1323
1304
|
* @param payment - Batched payment
|
|
@@ -1329,7 +1310,7 @@ declare function toPreparedPayment(payment: BatchedPayment, bankRefId?: string,
|
|
|
1329
1310
|
/**
|
|
1330
1311
|
* Transform prepared payment to completed payment
|
|
1331
1312
|
*
|
|
1332
|
-
* Updates payment status to final state (
|
|
1313
|
+
* Updates payment status to final state (SETTLED/REJECTED) after bank processing
|
|
1333
1314
|
* Requires bankRefId to be present.
|
|
1334
1315
|
*
|
|
1335
1316
|
* @param payment - Prepared payment
|
|
@@ -1338,9 +1319,9 @@ declare function toPreparedPayment(payment: BatchedPayment, bankRefId?: string,
|
|
|
1338
1319
|
* @param processedAt - Timestamp when payment was processed by bank
|
|
1339
1320
|
* @returns CompletedPayment with final status
|
|
1340
1321
|
*/
|
|
1341
|
-
declare function toCompletedPayment(payment: PreparedPayment, status: '
|
|
1322
|
+
declare function toCompletedPayment(payment: PreparedPayment, status: 'SETTLED' | 'REJECTED', bankRefId: string, processedAt?: Date): CompletedPayment;
|
|
1342
1323
|
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string | null): PaymentRequestInsertType;
|
|
1343
1324
|
declare function toBatchedPaymentFromPaymentRequest(sp: PaymentRequestSelectType): BatchedPayment;
|
|
1344
1325
|
|
|
1345
|
-
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata,
|
|
1346
|
-
export type { BankPaymentEvent, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksBatchBody, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectorConfig, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksProvider, FinbricksRequestInit, FinbricksSupportedBanksQuery, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
|
|
1326
|
+
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchedPayment, CompletedPayment, ConnectedAccount, ConnectorKey, CredentialsResolver, CsobConnector, Currency, DbuConnector, ErsteConnector, FINBRICKS_ENDPOINTS, FinbricksAccount, FinbricksClient, FinbricksConnector, IBankConnector, IncomingPayment, IncomingPayment as IncomingPaymentMessage, InitiatedBatch, InitiatedPayment, KBConnector, MockCobsConnector, MockConnector, ParsedBankPayment, PaymentRequestInsertType, PaymentRequestSelectType, PaymentRequestStatus, PaymentSelectType, PaymentType, PreparedPayment, SendPaymentInput, assignAccount, ottInsertSchema, ottSelectSchema, ottUpdateSchema, signFinbricksJws, toBatchedPayment, toBatchedPaymentFromPaymentRequest, toCompletedPayment, toIncomingPayment, toPaymentRequestInsert, toPreparedPayment, useFinbricksFetch };
|
|
1327
|
+
export type { BankPaymentEvent, BankPaymentRequestEvent, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksBatchBody, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectorConfig, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksProvider, FinbricksRequestInit, FinbricksSupportedBanksQuery, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
|
package/dist/types.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { C as CsobConnector, D as DbuConnector, E as ErsteConnector, F as FINBRICKS_ENDPOINTS, a as FinbricksClient, b as FinbricksConnector, I as IBankConnector, K as KBConnector, M as MockCobsConnector, c as MockConnector, d as assignAccount, s as signFinbricksJws, t as toBatchedPayment, e as toBatchedPaymentFromPaymentRequest, f as toCompletedPayment, g as toIncomingPayment, h as toPaymentRequestInsert, i as toPreparedPayment, u as useFinbricksFetch } from './shared/bank.
|
|
2
|
-
export { A as ACCOUNT_STATUSES, B as BATCH_STATUES,
|
|
3
|
-
export { h as hasPaymentAccountAssigned, i as
|
|
1
|
+
export { C as CsobConnector, D as DbuConnector, E as ErsteConnector, F as FINBRICKS_ENDPOINTS, a as FinbricksClient, b as FinbricksConnector, I as IBankConnector, K as KBConnector, M as MockCobsConnector, c as MockConnector, d as assignAccount, s as signFinbricksJws, t as toBatchedPayment, e as toBatchedPaymentFromPaymentRequest, f as toCompletedPayment, g as toIncomingPayment, h as toPaymentRequestInsert, i as toPreparedPayment, u as useFinbricksFetch } from './shared/bank.D-O_gmmZ.mjs';
|
|
2
|
+
export { A as ACCOUNT_STATUSES, B as BATCH_MODES, a as BATCH_STATUES, a as BATCH_STATUSES, C as CHARGE_BEARERS, b as CONNECTOR_KEYS, c as COUNTRY_CODES, d as CREDENTIALS_TYPES, I as INSTRUCTION_PRIORITIES, P as PAYMENT_DIRECTIONS, e as PAYMENT_REQUEST_STATUSES, f as PAYMENT_STATUSES, g as PAYMENT_TYPES, T as TOKEN_TYPES, h as accountCredentialsInsertSchema, i as accountCredentialsSelectSchema, j as accountCredentialsUpdateSchema, k as accountInsertSchema, l as accountSelectSchema, m as accountUpdateSchema, o as ottInsertSchema, n as ottSelectSchema, p as ottUpdateSchema } from './shared/bank.CXBeULUL.mjs';
|
|
3
|
+
export { h as hasPaymentAccountAssigned, i as isBatchAuthorized, a as isBatchCompleted, b as isBatchFailed, c as isBatchInitiated, d as isBatchProcessing, e as isBatchReadyToSign, f as isPaymentCompleted } from './shared/bank.vz1uqEYa.mjs';
|
|
4
4
|
export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
5
5
|
import '@develit-io/backend-sdk';
|
|
6
6
|
import 'date-fns';
|