@develit-services/bank 0.8.6 → 0.8.8
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/dist/database/schema.cjs +1 -1
- package/dist/database/schema.d.cts +1 -1
- package/dist/database/schema.d.mts +1 -1
- package/dist/database/schema.d.ts +1 -1
- package/dist/database/schema.mjs +1 -1
- package/dist/export/worker.cjs +550 -153
- package/dist/export/worker.d.cts +259 -47
- package/dist/export/worker.d.mts +259 -47
- package/dist/export/worker.d.ts +259 -47
- package/dist/export/worker.mjs +551 -154
- package/dist/export/workflows.cjs +95 -17
- package/dist/export/workflows.mjs +96 -18
- package/dist/export/wrangler.d.cts +2 -1
- package/dist/export/wrangler.d.mts +2 -1
- package/dist/export/wrangler.d.ts +2 -1
- package/dist/shared/{bank.BliD3oCT.d.ts → bank.B-NJB8GB.d.cts} +34 -10
- package/dist/shared/{bank.BliD3oCT.d.cts → bank.B-NJB8GB.d.mts} +34 -10
- package/dist/shared/{bank.BliD3oCT.d.mts → bank.B-NJB8GB.d.ts} +34 -10
- package/dist/shared/{bank.Cpy9PULF.mjs → bank.B5bZRvgq.mjs} +28 -5
- package/dist/shared/{bank.CQBfbG8u.d.cts → bank.BP_3WMIF.d.cts} +1 -0
- package/dist/shared/{bank.CQBfbG8u.d.mts → bank.BP_3WMIF.d.mts} +1 -0
- package/dist/shared/{bank.CQBfbG8u.d.ts → bank.BP_3WMIF.d.ts} +1 -0
- package/dist/shared/{bank.DDHrdFgy.mjs → bank.BoZtXQpG.mjs} +1 -1
- package/dist/shared/{bank.DRrBrAdI.mjs → bank.BtszLapg.mjs} +211 -43
- package/dist/shared/{bank.BoMDujsl.d.ts → bank.BzobShUU.d.cts} +17 -7
- package/dist/shared/{bank.C4VOdIx1.mjs → bank.C6jjS1Pl.mjs} +32 -4
- package/dist/shared/{bank.lbzMqyr3.d.cts → bank.CAVvvZZO.d.mts} +17 -7
- package/dist/shared/{bank.CQURey1E.cjs → bank.CtnsGHM8.cjs} +210 -43
- package/dist/shared/{bank.C-T1FQxg.cjs → bank.DJnDSYqE.cjs} +1 -1
- package/dist/shared/{bank.B6U8sUZn.d.mts → bank.DRTuKO8S.d.ts} +17 -7
- package/dist/shared/{bank.BOnP9p9Y.cjs → bank.DT6bg8k5.cjs} +28 -5
- package/dist/shared/{bank.SQ4Mmr8u.cjs → bank.JVlyPAAb.cjs} +32 -4
- package/dist/types.cjs +2 -3
- package/dist/types.d.cts +14 -18
- package/dist/types.d.mts +14 -18
- package/dist/types.d.ts +14 -18
- package/dist/types.mjs +2 -2
- package/package.json +2 -2
package/dist/types.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const mock_connector = require('./shared/bank.
|
|
4
|
-
const paymentRequest_schema = require('./shared/bank.
|
|
3
|
+
const mock_connector = require('./shared/bank.CtnsGHM8.cjs');
|
|
4
|
+
const paymentRequest_schema = require('./shared/bank.JVlyPAAb.cjs');
|
|
5
5
|
const batchLifecycle = require('./shared/bank.Bg3Pdwm4.cjs');
|
|
6
6
|
const generalCodes = require('@develit-io/general-codes');
|
|
7
7
|
require('@develit-io/backend-sdk');
|
|
@@ -26,7 +26,6 @@ exports.KBConnector = mock_connector.KBConnector;
|
|
|
26
26
|
exports.MockCobsConnector = mock_connector.MockCobsConnector;
|
|
27
27
|
exports.MockConnector = mock_connector.MockConnector;
|
|
28
28
|
exports.assignAccount = mock_connector.assignAccount;
|
|
29
|
-
exports.batchTransform = mock_connector.batchTransform;
|
|
30
29
|
exports.signFinbricksJws = mock_connector.signFinbricksJws;
|
|
31
30
|
exports.toBatchedPayment = mock_connector.toBatchedPayment;
|
|
32
31
|
exports.toBatchedPaymentFromPaymentRequest = mock_connector.toBatchedPaymentFromPaymentRequest;
|
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, b as SendPaymentSyncInput } from './shared/bank.
|
|
5
|
-
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, b as ConnectorKey, e as ConnectedAccount, c as PaymentType, f as CredentialsResolver, g as AccountCredentialsInsertType, h as AccountInsertType, i as BatchedPayment, j as InitiatedBatch, k as IncomingPayment, l as InitiatedPayment, A as AccountSelectType, m as ParsedBankPayment, n as PaymentStatus, o as BatchStatus, p as BatchMetadata, q as Currency, P as PaymentSelectType, r as AccountAssignedPayment, a as PaymentRequestSelectType, s as PreparedPayment, u as CompletedPayment, v as PaymentRequestInsertType } from './shared/bank.B-NJB8GB.cjs';
|
|
2
|
+
export { w as ACCOUNT_STATUSES, x as AccountCredentialsPatchType, y as AccountCredentialsSelectType, z as AccountCredentialsUpdateType, D as AccountPatchType, E as AccountStatus, F as AccountUpdateType, G as BATCH_STATUES, G as BATCH_STATUSES, H as BankAccountWithLastSync, J as BankCode, K as BatchInsertType, M as BatchLifecycle, N as BatchPayment, B as BatchSelectType, O as CHARGE_BEARERS, Q as CONNECTOR_KEYS, R as COUNTRY_CODES, S as CREDENTIALS_TYPES, T as ChargeBearer, U as CompletedBatch, C as ConfigEnvironmentBank, V as CountryCode, W as CreatedBatch, X as CredentialsType, d as CurrencyCode, Y as INSTRUCTION_PRIORITIES, Z as InstructionPriority, L as LastSyncMetadata, _ as PAYMENT_DIRECTIONS, $ as PAYMENT_STATUSES, a0 as PAYMENT_TYPES, a1 as PaymentDirection, a2 as PaymentFailedInsertType, a3 as PaymentInsertType, a4 as PaymentLifecycle, a5 as PaymentPreparedInsertType, a6 as ProcessingBatch, a7 as ReadyToSignBatch, a8 as ResolvedCredentials, a9 as SignedBatch, aa as TOKEN_TYPES, ab as TokenType, ac as accountCredentialsInsertSchema, ad as accountCredentialsSelectSchema, ae as accountCredentialsUpdateSchema, af as accountInsertSchema, ag as accountSelectSchema, ah as accountUpdateSchema, ai as hasPaymentAccountAssigned, aj as isBatchCompleted, ak as isBatchFailed, al as isBatchInitiated, am as isBatchOpen, an as isBatchProcessing, ao as isBatchReadyToSign, ap as isBatchSigned, aq as isPaymentCompleted, ar as isPaymentPrepared } from './shared/bank.B-NJB8GB.cjs';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.BzobShUU.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, P as PaymentQueueMessage, b as SendPaymentSyncInput } from './shared/bank.BzobShUU.cjs';
|
|
5
|
+
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.BP_3WMIF.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';
|
|
@@ -35,7 +35,7 @@ type FinbricksGetBatchStatusResponse = {
|
|
|
35
35
|
payments: {
|
|
36
36
|
merchantTransactionId: string;
|
|
37
37
|
resultCode: FinbricksTransactionStatus;
|
|
38
|
-
|
|
38
|
+
finalBankStatus: boolean;
|
|
39
39
|
}[];
|
|
40
40
|
batchRecoveryUrl: string;
|
|
41
41
|
};
|
|
@@ -239,7 +239,9 @@ interface FinbricksConnectorConfig {
|
|
|
239
239
|
}
|
|
240
240
|
declare abstract class FinbricksConnector extends IBankConnector {
|
|
241
241
|
connectorKey: ConnectorKey;
|
|
242
|
+
readonly lifecycleMode: 'batch' | 'per-payment';
|
|
242
243
|
connectedAccounts: ConnectedAccount[];
|
|
244
|
+
supportsPaymentType(paymentType: PaymentType): boolean;
|
|
243
245
|
protected readonly finbricks: FinbricksClient;
|
|
244
246
|
protected readonly PROVIDER: FinbricksProvider;
|
|
245
247
|
constructor(provider: FinbricksProvider, { BASE_URI, MERCHANT_ID, PRIVATE_KEY_PEM, REDIRECT_URI, connectedAccounts, resolveCredentials, }: FinbricksConnectorConfig);
|
|
@@ -314,6 +316,7 @@ interface DbuConnectorConfig {
|
|
|
314
316
|
}
|
|
315
317
|
declare class DbuConnector extends IBankConnector {
|
|
316
318
|
connectorKey: ConnectorKey;
|
|
319
|
+
readonly lifecycleMode = "per-payment";
|
|
317
320
|
connectedAccounts: ConnectedAccount[];
|
|
318
321
|
readonly kv: KVNamespace;
|
|
319
322
|
readonly api: Fetcher;
|
|
@@ -340,6 +343,7 @@ declare class DbuConnector extends IBankConnector {
|
|
|
340
343
|
}>;
|
|
341
344
|
listAccounts(): Promise<AccountInsertType[]>;
|
|
342
345
|
private resolveIdAccountDebit;
|
|
346
|
+
private resolveAccountDetails;
|
|
343
347
|
private initiateInstantPayment;
|
|
344
348
|
initiateDomesticPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
345
349
|
initiateSEPAPayment(_payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
@@ -397,6 +401,7 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
397
401
|
private readonly REDIRECT_URI;
|
|
398
402
|
private readonly ACCOUNTS_URI;
|
|
399
403
|
connectorKey: ConnectorKey;
|
|
404
|
+
readonly lifecycleMode = "batch";
|
|
400
405
|
connectedAccounts: ConnectedAccount[];
|
|
401
406
|
private accessToken;
|
|
402
407
|
constructor(config: ErsteConnectorConfig);
|
|
@@ -463,6 +468,7 @@ declare class MockCobsConnector extends FinbricksConnector {
|
|
|
463
468
|
declare class MockConnector extends IBankConnector {
|
|
464
469
|
connectedAccounts: ConnectedAccount[];
|
|
465
470
|
connectorKey: ConnectorKey;
|
|
471
|
+
readonly lifecycleMode = "batch";
|
|
466
472
|
constructor();
|
|
467
473
|
supportsBatch(_paymentType: PaymentType): boolean;
|
|
468
474
|
getAuthUri({ accountId, }: {
|
|
@@ -1333,18 +1339,8 @@ declare function toPreparedPayment(payment: BatchedPayment, bankRefId?: string,
|
|
|
1333
1339
|
* @returns CompletedPayment with final status
|
|
1334
1340
|
*/
|
|
1335
1341
|
declare function toCompletedPayment(payment: PreparedPayment, status: 'COMPLETED' | 'FAILED', bankRefId: string, processedAt?: Date): CompletedPayment;
|
|
1336
|
-
|
|
1337
|
-
* Batch transform multiple payments
|
|
1338
|
-
*
|
|
1339
|
-
* Helper to transform array of payments using a transformer function.
|
|
1340
|
-
*
|
|
1341
|
-
* @param payments - Array of payments to transform
|
|
1342
|
-
* @param transformer - Transformer function
|
|
1343
|
-
* @returns Array of transformed payments
|
|
1344
|
-
*/
|
|
1345
|
-
declare function batchTransform<TInput, TOutput>(payments: TInput[], transformer: (payment: TInput) => TOutput): TOutput[];
|
|
1346
|
-
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string): PaymentRequestInsertType;
|
|
1342
|
+
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string | null): PaymentRequestInsertType;
|
|
1347
1343
|
declare function toBatchedPaymentFromPaymentRequest(sp: PaymentRequestSelectType): BatchedPayment;
|
|
1348
1344
|
|
|
1349
|
-
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchStatus, 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, PaymentSelectType, PaymentStatus, PaymentType, PreparedPayment, SendPaymentInput, assignAccount,
|
|
1345
|
+
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchStatus, 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, PaymentSelectType, PaymentStatus, PaymentType, PreparedPayment, SendPaymentInput, assignAccount, ottInsertSchema, ottSelectSchema, ottUpdateSchema, signFinbricksJws, toBatchedPayment, toBatchedPaymentFromPaymentRequest, toCompletedPayment, toIncomingPayment, toPaymentRequestInsert, toPreparedPayment, useFinbricksFetch };
|
|
1350
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 };
|
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, b as SendPaymentSyncInput } from './shared/bank.
|
|
5
|
-
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, b as ConnectorKey, e as ConnectedAccount, c as PaymentType, f as CredentialsResolver, g as AccountCredentialsInsertType, h as AccountInsertType, i as BatchedPayment, j as InitiatedBatch, k as IncomingPayment, l as InitiatedPayment, A as AccountSelectType, m as ParsedBankPayment, n as PaymentStatus, o as BatchStatus, p as BatchMetadata, q as Currency, P as PaymentSelectType, r as AccountAssignedPayment, a as PaymentRequestSelectType, s as PreparedPayment, u as CompletedPayment, v as PaymentRequestInsertType } from './shared/bank.B-NJB8GB.mjs';
|
|
2
|
+
export { w as ACCOUNT_STATUSES, x as AccountCredentialsPatchType, y as AccountCredentialsSelectType, z as AccountCredentialsUpdateType, D as AccountPatchType, E as AccountStatus, F as AccountUpdateType, G as BATCH_STATUES, G as BATCH_STATUSES, H as BankAccountWithLastSync, J as BankCode, K as BatchInsertType, M as BatchLifecycle, N as BatchPayment, B as BatchSelectType, O as CHARGE_BEARERS, Q as CONNECTOR_KEYS, R as COUNTRY_CODES, S as CREDENTIALS_TYPES, T as ChargeBearer, U as CompletedBatch, C as ConfigEnvironmentBank, V as CountryCode, W as CreatedBatch, X as CredentialsType, d as CurrencyCode, Y as INSTRUCTION_PRIORITIES, Z as InstructionPriority, L as LastSyncMetadata, _ as PAYMENT_DIRECTIONS, $ as PAYMENT_STATUSES, a0 as PAYMENT_TYPES, a1 as PaymentDirection, a2 as PaymentFailedInsertType, a3 as PaymentInsertType, a4 as PaymentLifecycle, a5 as PaymentPreparedInsertType, a6 as ProcessingBatch, a7 as ReadyToSignBatch, a8 as ResolvedCredentials, a9 as SignedBatch, aa as TOKEN_TYPES, ab as TokenType, ac as accountCredentialsInsertSchema, ad as accountCredentialsSelectSchema, ae as accountCredentialsUpdateSchema, af as accountInsertSchema, ag as accountSelectSchema, ah as accountUpdateSchema, ai as hasPaymentAccountAssigned, aj as isBatchCompleted, ak as isBatchFailed, al as isBatchInitiated, am as isBatchOpen, an as isBatchProcessing, ao as isBatchReadyToSign, ap as isBatchSigned, aq as isPaymentCompleted, ar as isPaymentPrepared } from './shared/bank.B-NJB8GB.mjs';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.CAVvvZZO.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, P as PaymentQueueMessage, b as SendPaymentSyncInput } from './shared/bank.CAVvvZZO.mjs';
|
|
5
|
+
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.BP_3WMIF.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';
|
|
@@ -35,7 +35,7 @@ type FinbricksGetBatchStatusResponse = {
|
|
|
35
35
|
payments: {
|
|
36
36
|
merchantTransactionId: string;
|
|
37
37
|
resultCode: FinbricksTransactionStatus;
|
|
38
|
-
|
|
38
|
+
finalBankStatus: boolean;
|
|
39
39
|
}[];
|
|
40
40
|
batchRecoveryUrl: string;
|
|
41
41
|
};
|
|
@@ -239,7 +239,9 @@ interface FinbricksConnectorConfig {
|
|
|
239
239
|
}
|
|
240
240
|
declare abstract class FinbricksConnector extends IBankConnector {
|
|
241
241
|
connectorKey: ConnectorKey;
|
|
242
|
+
readonly lifecycleMode: 'batch' | 'per-payment';
|
|
242
243
|
connectedAccounts: ConnectedAccount[];
|
|
244
|
+
supportsPaymentType(paymentType: PaymentType): boolean;
|
|
243
245
|
protected readonly finbricks: FinbricksClient;
|
|
244
246
|
protected readonly PROVIDER: FinbricksProvider;
|
|
245
247
|
constructor(provider: FinbricksProvider, { BASE_URI, MERCHANT_ID, PRIVATE_KEY_PEM, REDIRECT_URI, connectedAccounts, resolveCredentials, }: FinbricksConnectorConfig);
|
|
@@ -314,6 +316,7 @@ interface DbuConnectorConfig {
|
|
|
314
316
|
}
|
|
315
317
|
declare class DbuConnector extends IBankConnector {
|
|
316
318
|
connectorKey: ConnectorKey;
|
|
319
|
+
readonly lifecycleMode = "per-payment";
|
|
317
320
|
connectedAccounts: ConnectedAccount[];
|
|
318
321
|
readonly kv: KVNamespace;
|
|
319
322
|
readonly api: Fetcher;
|
|
@@ -340,6 +343,7 @@ declare class DbuConnector extends IBankConnector {
|
|
|
340
343
|
}>;
|
|
341
344
|
listAccounts(): Promise<AccountInsertType[]>;
|
|
342
345
|
private resolveIdAccountDebit;
|
|
346
|
+
private resolveAccountDetails;
|
|
343
347
|
private initiateInstantPayment;
|
|
344
348
|
initiateDomesticPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
345
349
|
initiateSEPAPayment(_payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
@@ -397,6 +401,7 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
397
401
|
private readonly REDIRECT_URI;
|
|
398
402
|
private readonly ACCOUNTS_URI;
|
|
399
403
|
connectorKey: ConnectorKey;
|
|
404
|
+
readonly lifecycleMode = "batch";
|
|
400
405
|
connectedAccounts: ConnectedAccount[];
|
|
401
406
|
private accessToken;
|
|
402
407
|
constructor(config: ErsteConnectorConfig);
|
|
@@ -463,6 +468,7 @@ declare class MockCobsConnector extends FinbricksConnector {
|
|
|
463
468
|
declare class MockConnector extends IBankConnector {
|
|
464
469
|
connectedAccounts: ConnectedAccount[];
|
|
465
470
|
connectorKey: ConnectorKey;
|
|
471
|
+
readonly lifecycleMode = "batch";
|
|
466
472
|
constructor();
|
|
467
473
|
supportsBatch(_paymentType: PaymentType): boolean;
|
|
468
474
|
getAuthUri({ accountId, }: {
|
|
@@ -1333,18 +1339,8 @@ declare function toPreparedPayment(payment: BatchedPayment, bankRefId?: string,
|
|
|
1333
1339
|
* @returns CompletedPayment with final status
|
|
1334
1340
|
*/
|
|
1335
1341
|
declare function toCompletedPayment(payment: PreparedPayment, status: 'COMPLETED' | 'FAILED', bankRefId: string, processedAt?: Date): CompletedPayment;
|
|
1336
|
-
|
|
1337
|
-
* Batch transform multiple payments
|
|
1338
|
-
*
|
|
1339
|
-
* Helper to transform array of payments using a transformer function.
|
|
1340
|
-
*
|
|
1341
|
-
* @param payments - Array of payments to transform
|
|
1342
|
-
* @param transformer - Transformer function
|
|
1343
|
-
* @returns Array of transformed payments
|
|
1344
|
-
*/
|
|
1345
|
-
declare function batchTransform<TInput, TOutput>(payments: TInput[], transformer: (payment: TInput) => TOutput): TOutput[];
|
|
1346
|
-
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string): PaymentRequestInsertType;
|
|
1342
|
+
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string | null): PaymentRequestInsertType;
|
|
1347
1343
|
declare function toBatchedPaymentFromPaymentRequest(sp: PaymentRequestSelectType): BatchedPayment;
|
|
1348
1344
|
|
|
1349
|
-
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchStatus, 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, PaymentSelectType, PaymentStatus, PaymentType, PreparedPayment, SendPaymentInput, assignAccount,
|
|
1345
|
+
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchStatus, 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, PaymentSelectType, PaymentStatus, PaymentType, PreparedPayment, SendPaymentInput, assignAccount, ottInsertSchema, ottSelectSchema, ottUpdateSchema, signFinbricksJws, toBatchedPayment, toBatchedPaymentFromPaymentRequest, toCompletedPayment, toIncomingPayment, toPaymentRequestInsert, toPreparedPayment, useFinbricksFetch };
|
|
1350
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 };
|
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, b as SendPaymentSyncInput } from './shared/bank.
|
|
5
|
-
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, b as ConnectorKey, e as ConnectedAccount, c as PaymentType, f as CredentialsResolver, g as AccountCredentialsInsertType, h as AccountInsertType, i as BatchedPayment, j as InitiatedBatch, k as IncomingPayment, l as InitiatedPayment, A as AccountSelectType, m as ParsedBankPayment, n as PaymentStatus, o as BatchStatus, p as BatchMetadata, q as Currency, P as PaymentSelectType, r as AccountAssignedPayment, a as PaymentRequestSelectType, s as PreparedPayment, u as CompletedPayment, v as PaymentRequestInsertType } from './shared/bank.B-NJB8GB.js';
|
|
2
|
+
export { w as ACCOUNT_STATUSES, x as AccountCredentialsPatchType, y as AccountCredentialsSelectType, z as AccountCredentialsUpdateType, D as AccountPatchType, E as AccountStatus, F as AccountUpdateType, G as BATCH_STATUES, G as BATCH_STATUSES, H as BankAccountWithLastSync, J as BankCode, K as BatchInsertType, M as BatchLifecycle, N as BatchPayment, B as BatchSelectType, O as CHARGE_BEARERS, Q as CONNECTOR_KEYS, R as COUNTRY_CODES, S as CREDENTIALS_TYPES, T as ChargeBearer, U as CompletedBatch, C as ConfigEnvironmentBank, V as CountryCode, W as CreatedBatch, X as CredentialsType, d as CurrencyCode, Y as INSTRUCTION_PRIORITIES, Z as InstructionPriority, L as LastSyncMetadata, _ as PAYMENT_DIRECTIONS, $ as PAYMENT_STATUSES, a0 as PAYMENT_TYPES, a1 as PaymentDirection, a2 as PaymentFailedInsertType, a3 as PaymentInsertType, a4 as PaymentLifecycle, a5 as PaymentPreparedInsertType, a6 as ProcessingBatch, a7 as ReadyToSignBatch, a8 as ResolvedCredentials, a9 as SignedBatch, aa as TOKEN_TYPES, ab as TokenType, ac as accountCredentialsInsertSchema, ad as accountCredentialsSelectSchema, ae as accountCredentialsUpdateSchema, af as accountInsertSchema, ag as accountSelectSchema, ah as accountUpdateSchema, ai as hasPaymentAccountAssigned, aj as isBatchCompleted, ak as isBatchFailed, al as isBatchInitiated, am as isBatchOpen, an as isBatchProcessing, ao as isBatchReadyToSign, ap as isBatchSigned, aq as isPaymentCompleted, ar as isPaymentPrepared } from './shared/bank.B-NJB8GB.js';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.DRTuKO8S.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, P as PaymentQueueMessage, b as SendPaymentSyncInput } from './shared/bank.DRTuKO8S.js';
|
|
5
|
+
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.BP_3WMIF.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';
|
|
@@ -35,7 +35,7 @@ type FinbricksGetBatchStatusResponse = {
|
|
|
35
35
|
payments: {
|
|
36
36
|
merchantTransactionId: string;
|
|
37
37
|
resultCode: FinbricksTransactionStatus;
|
|
38
|
-
|
|
38
|
+
finalBankStatus: boolean;
|
|
39
39
|
}[];
|
|
40
40
|
batchRecoveryUrl: string;
|
|
41
41
|
};
|
|
@@ -239,7 +239,9 @@ interface FinbricksConnectorConfig {
|
|
|
239
239
|
}
|
|
240
240
|
declare abstract class FinbricksConnector extends IBankConnector {
|
|
241
241
|
connectorKey: ConnectorKey;
|
|
242
|
+
readonly lifecycleMode: 'batch' | 'per-payment';
|
|
242
243
|
connectedAccounts: ConnectedAccount[];
|
|
244
|
+
supportsPaymentType(paymentType: PaymentType): boolean;
|
|
243
245
|
protected readonly finbricks: FinbricksClient;
|
|
244
246
|
protected readonly PROVIDER: FinbricksProvider;
|
|
245
247
|
constructor(provider: FinbricksProvider, { BASE_URI, MERCHANT_ID, PRIVATE_KEY_PEM, REDIRECT_URI, connectedAccounts, resolveCredentials, }: FinbricksConnectorConfig);
|
|
@@ -314,6 +316,7 @@ interface DbuConnectorConfig {
|
|
|
314
316
|
}
|
|
315
317
|
declare class DbuConnector extends IBankConnector {
|
|
316
318
|
connectorKey: ConnectorKey;
|
|
319
|
+
readonly lifecycleMode = "per-payment";
|
|
317
320
|
connectedAccounts: ConnectedAccount[];
|
|
318
321
|
readonly kv: KVNamespace;
|
|
319
322
|
readonly api: Fetcher;
|
|
@@ -340,6 +343,7 @@ declare class DbuConnector extends IBankConnector {
|
|
|
340
343
|
}>;
|
|
341
344
|
listAccounts(): Promise<AccountInsertType[]>;
|
|
342
345
|
private resolveIdAccountDebit;
|
|
346
|
+
private resolveAccountDetails;
|
|
343
347
|
private initiateInstantPayment;
|
|
344
348
|
initiateDomesticPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
345
349
|
initiateSEPAPayment(_payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
@@ -397,6 +401,7 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
397
401
|
private readonly REDIRECT_URI;
|
|
398
402
|
private readonly ACCOUNTS_URI;
|
|
399
403
|
connectorKey: ConnectorKey;
|
|
404
|
+
readonly lifecycleMode = "batch";
|
|
400
405
|
connectedAccounts: ConnectedAccount[];
|
|
401
406
|
private accessToken;
|
|
402
407
|
constructor(config: ErsteConnectorConfig);
|
|
@@ -463,6 +468,7 @@ declare class MockCobsConnector extends FinbricksConnector {
|
|
|
463
468
|
declare class MockConnector extends IBankConnector {
|
|
464
469
|
connectedAccounts: ConnectedAccount[];
|
|
465
470
|
connectorKey: ConnectorKey;
|
|
471
|
+
readonly lifecycleMode = "batch";
|
|
466
472
|
constructor();
|
|
467
473
|
supportsBatch(_paymentType: PaymentType): boolean;
|
|
468
474
|
getAuthUri({ accountId, }: {
|
|
@@ -1333,18 +1339,8 @@ declare function toPreparedPayment(payment: BatchedPayment, bankRefId?: string,
|
|
|
1333
1339
|
* @returns CompletedPayment with final status
|
|
1334
1340
|
*/
|
|
1335
1341
|
declare function toCompletedPayment(payment: PreparedPayment, status: 'COMPLETED' | 'FAILED', bankRefId: string, processedAt?: Date): CompletedPayment;
|
|
1336
|
-
|
|
1337
|
-
* Batch transform multiple payments
|
|
1338
|
-
*
|
|
1339
|
-
* Helper to transform array of payments using a transformer function.
|
|
1340
|
-
*
|
|
1341
|
-
* @param payments - Array of payments to transform
|
|
1342
|
-
* @param transformer - Transformer function
|
|
1343
|
-
* @returns Array of transformed payments
|
|
1344
|
-
*/
|
|
1345
|
-
declare function batchTransform<TInput, TOutput>(payments: TInput[], transformer: (payment: TInput) => TOutput): TOutput[];
|
|
1346
|
-
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string): PaymentRequestInsertType;
|
|
1342
|
+
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string | null): PaymentRequestInsertType;
|
|
1347
1343
|
declare function toBatchedPaymentFromPaymentRequest(sp: PaymentRequestSelectType): BatchedPayment;
|
|
1348
1344
|
|
|
1349
|
-
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchStatus, 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, PaymentSelectType, PaymentStatus, PaymentType, PreparedPayment, SendPaymentInput, assignAccount,
|
|
1345
|
+
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchStatus, 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, PaymentSelectType, PaymentStatus, PaymentType, PreparedPayment, SendPaymentInput, assignAccount, ottInsertSchema, ottSelectSchema, ottUpdateSchema, signFinbricksJws, toBatchedPayment, toBatchedPaymentFromPaymentRequest, toCompletedPayment, toIncomingPayment, toPaymentRequestInsert, toPreparedPayment, useFinbricksFetch };
|
|
1350
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 };
|
package/dist/types.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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,
|
|
2
|
-
export { A as ACCOUNT_STATUSES, B as BATCH_STATUES, B as BATCH_STATUSES, C as CHARGE_BEARERS, a as CONNECTOR_KEYS, b as COUNTRY_CODES, c as CREDENTIALS_TYPES, I as INSTRUCTION_PRIORITIES, P as PAYMENT_DIRECTIONS, d as PAYMENT_STATUSES, e as PAYMENT_TYPES, T as TOKEN_TYPES, f as accountCredentialsInsertSchema, g as accountCredentialsSelectSchema, h as accountCredentialsUpdateSchema, i as accountInsertSchema, j as accountSelectSchema, k as accountUpdateSchema, o as ottInsertSchema, l as ottSelectSchema, m as ottUpdateSchema } from './shared/bank.
|
|
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.BtszLapg.mjs';
|
|
2
|
+
export { A as ACCOUNT_STATUSES, B as BATCH_STATUES, B as BATCH_STATUSES, C as CHARGE_BEARERS, a as CONNECTOR_KEYS, b as COUNTRY_CODES, c as CREDENTIALS_TYPES, I as INSTRUCTION_PRIORITIES, P as PAYMENT_DIRECTIONS, d as PAYMENT_STATUSES, e as PAYMENT_TYPES, T as TOKEN_TYPES, f as accountCredentialsInsertSchema, g as accountCredentialsSelectSchema, h as accountCredentialsUpdateSchema, i as accountInsertSchema, j as accountSelectSchema, k as accountUpdateSchema, o as ottInsertSchema, l as ottSelectSchema, m as ottUpdateSchema } from './shared/bank.C6jjS1Pl.mjs';
|
|
3
3
|
export { h as hasPaymentAccountAssigned, i as isBatchCompleted, a as isBatchFailed, b as isBatchInitiated, c as isBatchOpen, d as isBatchProcessing, e as isBatchReadyToSign, f as isBatchSigned, g as isPaymentCompleted, j as isPaymentPrepared } from './shared/bank.CbAwwIhZ.mjs';
|
|
4
4
|
export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
5
5
|
import '@develit-io/backend-sdk';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@develit-services/bank",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.8",
|
|
4
4
|
"author": "Develit.io s.r.o.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"jose": "^6.1.3"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@develit-io/backend-sdk": "^9.
|
|
59
|
+
"@develit-io/backend-sdk": "^9.11.9",
|
|
60
60
|
"@develit-io/general-codes": "^1.19.0",
|
|
61
61
|
"drizzle-orm": "^0.45.0",
|
|
62
62
|
"drizzle-zod": "^0.8.3",
|