@develit-services/bank 0.8.5 → 0.8.7
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 +583 -146
- package/dist/export/worker.d.cts +286 -44
- package/dist/export/worker.d.mts +286 -44
- package/dist/export/worker.d.ts +286 -44
- package/dist/export/worker.mjs +584 -147
- package/dist/export/workflows.cjs +132 -16
- package/dist/export/workflows.mjs +133 -17
- package/dist/shared/{bank.C-T1FQxg.cjs → bank.62VzK9Aj.cjs} +1 -1
- package/dist/shared/{bank.SQ4Mmr8u.cjs → bank.BS7fFjGA.cjs} +34 -4
- package/dist/shared/{bank.6faPHUEY.d.ts → bank.BYRq3yJf.d.ts} +81 -11
- package/dist/shared/{bank.C4VOdIx1.mjs → bank.C0UN6luZ.mjs} +34 -4
- package/dist/shared/{bank.DDHrdFgy.mjs → bank.CA5ytXxp.mjs} +1 -1
- package/dist/shared/{bank.BoWCMu5n.d.cts → bank.CO89tR9U.d.cts} +81 -11
- package/dist/shared/{bank.BaMRCHk-.d.ts → bank.Cns5ss41.d.cts} +55 -18
- package/dist/shared/{bank.BaMRCHk-.d.cts → bank.Cns5ss41.d.mts} +55 -18
- package/dist/shared/{bank.BaMRCHk-.d.mts → bank.Cns5ss41.d.ts} +55 -18
- package/dist/shared/{bank.DOL1uM4n.d.mts → bank.CreoSb2d.d.mts} +81 -11
- package/dist/shared/{bank.DRrBrAdI.mjs → bank.D1jqaHaF.mjs} +91 -31
- package/dist/shared/{bank.Cpy9PULF.mjs → bank.DEmzZGZW.mjs} +31 -5
- package/dist/shared/{bank.BOnP9p9Y.cjs → bank.Dm8GHThw.cjs} +31 -5
- package/dist/shared/{bank.CQURey1E.cjs → bank.DwyCCyd0.cjs} +90 -31
- package/dist/types.cjs +3 -4
- package/dist/types.d.cts +8 -16
- package/dist/types.d.mts +8 -16
- package/dist/types.d.ts +8 -16
- package/dist/types.mjs +3 -3
- package/package.json +2 -2
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
3
|
const drizzleOrm = require('drizzle-orm');
|
|
5
|
-
require('
|
|
4
|
+
const backendSdk = require('@develit-io/backend-sdk');
|
|
5
|
+
require('./bank.BS7fFjGA.cjs');
|
|
6
6
|
require('date-fns');
|
|
7
7
|
require('jose');
|
|
8
8
|
require('@develit-io/general-codes');
|
|
9
9
|
const node_crypto = require('node:crypto');
|
|
10
|
-
const database_schema = require('./bank.
|
|
10
|
+
const database_schema = require('./bank.62VzK9Aj.cjs');
|
|
11
|
+
require('drizzle-orm/sqlite-core');
|
|
11
12
|
|
|
12
13
|
const createPaymentCommand = (db, { payment }) => {
|
|
13
14
|
return {
|
|
@@ -15,6 +16,21 @@ const createPaymentCommand = (db, { payment }) => {
|
|
|
15
16
|
...payment,
|
|
16
17
|
creditorIban: payment.creditor.iban,
|
|
17
18
|
debtorIban: payment.debtor.iban
|
|
19
|
+
}).onConflictDoUpdate({
|
|
20
|
+
// Unique index: (connector_key, bank_ref_id)
|
|
21
|
+
target: [tables.payment.connectorKey, tables.payment.bankRefId],
|
|
22
|
+
set: {
|
|
23
|
+
status: drizzleOrm.sql`excluded.status`,
|
|
24
|
+
statusReason: drizzleOrm.sql`excluded.status_reason`,
|
|
25
|
+
processedAt: drizzleOrm.sql`excluded.processed_at`,
|
|
26
|
+
updatedAt: drizzleOrm.sql`excluded.updated_at`,
|
|
27
|
+
// Keep existing paymentRequestId if already set, otherwise use new value
|
|
28
|
+
paymentRequestId: drizzleOrm.sql`coalesce(payment.payment_request_id, excluded.payment_request_id)`,
|
|
29
|
+
// Keep existing refId if already set, otherwise use enriched value
|
|
30
|
+
refId: drizzleOrm.sql`coalesce(payment.ref_id, excluded.ref_id)`,
|
|
31
|
+
// Keep existing batchId if already set, otherwise use enriched value
|
|
32
|
+
batchId: drizzleOrm.sql`coalesce(payment.bank_execution_batch_id, excluded.bank_execution_batch_id)`
|
|
33
|
+
}
|
|
18
34
|
}).returning()
|
|
19
35
|
};
|
|
20
36
|
};
|
|
@@ -39,7 +55,12 @@ const upsertBatchCommand = (db, { batch }) => {
|
|
|
39
55
|
const updatePaymentRequestStatusCommand = (db, values) => {
|
|
40
56
|
const { id, ...set } = values;
|
|
41
57
|
return {
|
|
42
|
-
command: db.update(tables.paymentRequest).set(set).where(
|
|
58
|
+
command: db.update(tables.paymentRequest).set(set).where(
|
|
59
|
+
drizzleOrm.and(
|
|
60
|
+
drizzleOrm.eq(tables.paymentRequest.id, id),
|
|
61
|
+
drizzleOrm.isNull(tables.paymentRequest.deletedAt)
|
|
62
|
+
)
|
|
63
|
+
).returning()
|
|
43
64
|
};
|
|
44
65
|
};
|
|
45
66
|
|
|
@@ -60,7 +81,12 @@ const getCredentialsByAccountId = async (db, encryptionKey, { accountId }) => {
|
|
|
60
81
|
};
|
|
61
82
|
|
|
62
83
|
const getPaymentRequestsByBatchIdQuery = async (db, { batchId }) => {
|
|
63
|
-
return await db.select().from(tables.paymentRequest).where(
|
|
84
|
+
return await db.select().from(tables.paymentRequest).where(
|
|
85
|
+
drizzleOrm.and(
|
|
86
|
+
drizzleOrm.eq(tables.paymentRequest.batchId, batchId),
|
|
87
|
+
drizzleOrm.isNull(tables.paymentRequest.deletedAt)
|
|
88
|
+
)
|
|
89
|
+
);
|
|
64
90
|
};
|
|
65
91
|
|
|
66
92
|
async function importAesKey(base64Key) {
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
4
|
const dateFns = require('date-fns');
|
|
5
5
|
const generalCodes = require('@develit-io/general-codes');
|
|
6
|
-
require('./bank.
|
|
6
|
+
require('./bank.BS7fFjGA.cjs');
|
|
7
7
|
require('drizzle-orm');
|
|
8
|
+
require('drizzle-orm/sqlite-core');
|
|
8
9
|
const jose = require('jose');
|
|
9
10
|
require('node:crypto');
|
|
10
11
|
|
|
@@ -62,9 +63,6 @@ function toCompletedPayment(payment, status, bankRefId, processedAt) {
|
|
|
62
63
|
processedAt: processedAt ?? /* @__PURE__ */ new Date()
|
|
63
64
|
};
|
|
64
65
|
}
|
|
65
|
-
function batchTransform(payments, transformer) {
|
|
66
|
-
return payments.map(transformer);
|
|
67
|
-
}
|
|
68
66
|
function toPaymentRequestInsert(payment, batchId) {
|
|
69
67
|
return {
|
|
70
68
|
id: payment.id,
|
|
@@ -86,7 +84,8 @@ function toPaymentRequestInsert(payment, batchId) {
|
|
|
86
84
|
creditor: payment.creditor,
|
|
87
85
|
creditorIban: payment.creditorIban ?? null,
|
|
88
86
|
debtor: payment.debtor,
|
|
89
|
-
debtorIban: payment.debtorIban ?? null
|
|
87
|
+
debtorIban: payment.debtorIban ?? null,
|
|
88
|
+
sendAsSinglePayment: payment.sendAsSinglePayment ?? null
|
|
90
89
|
};
|
|
91
90
|
}
|
|
92
91
|
function toBatchedPaymentFromPaymentRequest(sp) {
|
|
@@ -119,6 +118,9 @@ function toBatchedPaymentFromPaymentRequest(sp) {
|
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
class IBankConnector {
|
|
121
|
+
supportsPaymentType(paymentType) {
|
|
122
|
+
return paymentType === "DOMESTIC";
|
|
123
|
+
}
|
|
122
124
|
// ── Deprecated methods (backward compatibility) ────────────────────
|
|
123
125
|
/**
|
|
124
126
|
* @deprecated Use initiateDomesticBatch, initiateSEPABatch, or initiateForeignBatch instead.
|
|
@@ -394,10 +396,13 @@ const mapReferencesToPayment = (reference) => {
|
|
|
394
396
|
const mapFinbricksTransactionToPayment = (tx, account) => {
|
|
395
397
|
const isIncoming = tx.creditDebitIndicator === "CRDT";
|
|
396
398
|
const related = tx.entryDetails?.transactionDetails?.relatedParties;
|
|
399
|
+
const endToEndId = tx.entryDetails.transactionDetails?.references?.endToEndIdentification;
|
|
400
|
+
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
401
|
+
const paymentRequestId = endToEndId && uuidRegex.test(endToEndId) ? endToEndId : null;
|
|
397
402
|
const base = {
|
|
398
403
|
id: backendSdk.uuidv4(),
|
|
399
404
|
correlationId: backendSdk.uuidv4(),
|
|
400
|
-
|
|
405
|
+
paymentRequestId,
|
|
401
406
|
connectorKey: account.connectorKey,
|
|
402
407
|
accountId: account.id,
|
|
403
408
|
bankRefId: tx.fbxReference,
|
|
@@ -408,7 +413,7 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
|
|
|
408
413
|
message: tx.entryDetails.transactionDetails?.remittanceInformation?.unstructured || tx.entryDetails.transactionDetails?.additionalRemittanceInformation || tx.entryDetails.transactionDetails?.additionalTransactionInformation || null,
|
|
409
414
|
processedAt: new Date(tx.bookingDate.date),
|
|
410
415
|
...mapReferencesToPayment(
|
|
411
|
-
tx.entryDetails.transactionDetails?.remittanceInformation?.structured?.creditorReferenceInformation?.reference ||
|
|
416
|
+
tx.entryDetails.transactionDetails?.remittanceInformation?.structured?.creditorReferenceInformation?.reference || (!paymentRequestId ? endToEndId : void 0)
|
|
412
417
|
),
|
|
413
418
|
creditor: {
|
|
414
419
|
holderName: related?.creditorAccount?.name || related?.creditor?.name || "Unknown",
|
|
@@ -457,6 +462,9 @@ class FinbricksConnector extends IBankConnector {
|
|
|
457
462
|
this.connectedAccounts = connectedAccounts;
|
|
458
463
|
this.resolveCredentials = resolveCredentials;
|
|
459
464
|
}
|
|
465
|
+
supportsPaymentType(paymentType) {
|
|
466
|
+
return paymentType === "DOMESTIC" || paymentType === "SEPA" || paymentType === "SWIFT";
|
|
467
|
+
}
|
|
460
468
|
async getClientId(accountId) {
|
|
461
469
|
if (!this.resolveCredentials) {
|
|
462
470
|
throw backendSdk.createInternalError(null, {
|
|
@@ -1147,24 +1155,64 @@ function mod97(string) {
|
|
|
1147
1155
|
}
|
|
1148
1156
|
return parseInt(checksum, 10);
|
|
1149
1157
|
}
|
|
1158
|
+
const parseCzechIban = (iban) => {
|
|
1159
|
+
const stripped = iban.replace(/\s/g, "").toUpperCase();
|
|
1160
|
+
if (!stripped.startsWith("CZ") || stripped.length !== 24) {
|
|
1161
|
+
throw new Error(`Invalid Czech IBAN: ${iban}`);
|
|
1162
|
+
}
|
|
1163
|
+
const bankCode = stripped.slice(4, 8);
|
|
1164
|
+
const prefix = stripped.slice(8, 14).replace(/^0+/, "");
|
|
1165
|
+
const main = stripped.slice(14, 24).replace(/^0+/, "");
|
|
1166
|
+
const accountNumber = prefix ? `${prefix}-${main}` : main;
|
|
1167
|
+
return { bankCode, accountNumber };
|
|
1168
|
+
};
|
|
1150
1169
|
const calculateCzechIban = (accountNumber, bankCode) => {
|
|
1151
1170
|
const paddedBankCode = bankCode.padStart(4, "0");
|
|
1152
1171
|
let prefix = "";
|
|
1153
1172
|
let mainAccount = accountNumber;
|
|
1154
1173
|
if (accountNumber.includes("-")) {
|
|
1155
1174
|
const parts = accountNumber.split("-");
|
|
1175
|
+
if (parts.length !== 2) {
|
|
1176
|
+
throw new Error(
|
|
1177
|
+
`Invalid account number format: expected "prefix-main" or "main", got "${accountNumber}"`
|
|
1178
|
+
);
|
|
1179
|
+
}
|
|
1156
1180
|
prefix = parts[0];
|
|
1157
1181
|
mainAccount = parts[1];
|
|
1158
1182
|
}
|
|
1159
1183
|
const paddedPrefix = prefix.padStart(6, "0");
|
|
1160
1184
|
const paddedAccount = mainAccount.padStart(10, "0");
|
|
1161
1185
|
const basicIban = paddedBankCode + paddedPrefix + paddedAccount;
|
|
1162
|
-
const rearranged = basicIban + "
|
|
1186
|
+
const rearranged = basicIban + "123500";
|
|
1163
1187
|
const remainder = mod97(rearranged);
|
|
1164
1188
|
const checkDigits = (98 - remainder).toString().padStart(2, "0");
|
|
1165
1189
|
return `CZ${checkDigits}${basicIban}`;
|
|
1166
1190
|
};
|
|
1167
1191
|
|
|
1192
|
+
function parseFlatAddress(addr, fallbackCountry) {
|
|
1193
|
+
if (!addr) {
|
|
1194
|
+
return {
|
|
1195
|
+
streetName: null,
|
|
1196
|
+
buildingNumber: null,
|
|
1197
|
+
city: null,
|
|
1198
|
+
zip: null,
|
|
1199
|
+
countryCode: fallbackCountry
|
|
1200
|
+
};
|
|
1201
|
+
}
|
|
1202
|
+
const parts = addr.split(",").map((p) => p.trim());
|
|
1203
|
+
const streetPart = parts[0];
|
|
1204
|
+
const cityPart = parts[1];
|
|
1205
|
+
const countryCode = parts[2]?.trim() || fallbackCountry;
|
|
1206
|
+
const streetMatch = streetPart?.match(/^(.+?)\s+(\d+\w*)$/);
|
|
1207
|
+
const cityMatch = cityPart?.match(/^(\d[\d ]*?)\s+(.+)$/);
|
|
1208
|
+
return {
|
|
1209
|
+
streetName: streetMatch?.[1] ?? streetPart ?? null,
|
|
1210
|
+
buildingNumber: streetMatch?.[2] ?? null,
|
|
1211
|
+
city: cityMatch?.[2] ?? cityPart ?? null,
|
|
1212
|
+
zip: cityMatch?.[1]?.replace(/\s/g, "") ?? null,
|
|
1213
|
+
countryCode
|
|
1214
|
+
};
|
|
1215
|
+
}
|
|
1168
1216
|
class DbuConnector extends IBankConnector {
|
|
1169
1217
|
constructor({
|
|
1170
1218
|
BASE_URL,
|
|
@@ -1260,6 +1308,7 @@ class DbuConnector extends IBankConnector {
|
|
|
1260
1308
|
const parsed = {
|
|
1261
1309
|
id: backendSdk.uuidv4(),
|
|
1262
1310
|
correlationId: backendSdk.uuidv4(),
|
|
1311
|
+
paymentRequestId: transaction.uniqueExternalId ?? null,
|
|
1263
1312
|
connectorKey: "DBU",
|
|
1264
1313
|
accountId: account.id,
|
|
1265
1314
|
bankRefId: transaction.idRequiredTransaction.toString(),
|
|
@@ -1425,11 +1474,25 @@ class DbuConnector extends IBankConnector {
|
|
|
1425
1474
|
}
|
|
1426
1475
|
return Number(account.bankRefId);
|
|
1427
1476
|
}
|
|
1477
|
+
resolveAccountDetails(account) {
|
|
1478
|
+
if (account.number && account.bankCode) {
|
|
1479
|
+
return { number: account.number, bankCode: account.bankCode };
|
|
1480
|
+
}
|
|
1481
|
+
if (account.iban) {
|
|
1482
|
+
const { bankCode, accountNumber } = parseCzechIban(account.iban);
|
|
1483
|
+
return { number: accountNumber, bankCode };
|
|
1484
|
+
}
|
|
1485
|
+
throw backendSdk.createInternalError(null, {
|
|
1486
|
+
message: "DBU: account has neither number+bankCode nor iban",
|
|
1487
|
+
code: "DBU_MISSING_ACCOUNT_DETAILS"
|
|
1488
|
+
});
|
|
1489
|
+
}
|
|
1428
1490
|
async initiateInstantPayment(payment) {
|
|
1491
|
+
const creditor = this.resolveAccountDetails(payment.creditor);
|
|
1429
1492
|
const body = {
|
|
1430
|
-
accountNumberCredit:
|
|
1493
|
+
accountNumberCredit: creditor.number,
|
|
1431
1494
|
idAccountDebit: this.resolveIdAccountDebit(payment),
|
|
1432
|
-
bankCodeCredit:
|
|
1495
|
+
bankCodeCredit: creditor.bankCode,
|
|
1433
1496
|
amount: payment.amount,
|
|
1434
1497
|
currencyCode: "CZK",
|
|
1435
1498
|
channelCode: "WWW",
|
|
@@ -1461,11 +1524,13 @@ class DbuConnector extends IBankConnector {
|
|
|
1461
1524
|
if (payment.instructionPriority === "INST") {
|
|
1462
1525
|
return this.initiateInstantPayment(payment);
|
|
1463
1526
|
}
|
|
1527
|
+
const debtor = this.resolveAccountDetails(payment.debtor);
|
|
1528
|
+
const creditor = this.resolveAccountDetails(payment.creditor);
|
|
1464
1529
|
const body = {
|
|
1465
|
-
accountNumberDebit:
|
|
1466
|
-
accountNumberCredit:
|
|
1467
|
-
bankCodeDebit:
|
|
1468
|
-
bankCodeCredit:
|
|
1530
|
+
accountNumberDebit: debtor.number,
|
|
1531
|
+
accountNumberCredit: creditor.number,
|
|
1532
|
+
bankCodeDebit: debtor.bankCode,
|
|
1533
|
+
bankCodeCredit: creditor.bankCode,
|
|
1469
1534
|
amount: payment.amount,
|
|
1470
1535
|
currencyCode: "CZK",
|
|
1471
1536
|
actionTypeCode: "TRANSFER",
|
|
@@ -1482,20 +1547,14 @@ class DbuConnector extends IBankConnector {
|
|
|
1482
1547
|
constSymbol: payment.ks,
|
|
1483
1548
|
uniqueExternalId: payment.id,
|
|
1484
1549
|
with4EyeApproval: "Y",
|
|
1485
|
-
debtorAddress:
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
streetName: null,
|
|
1494
|
-
buildingNumber: null,
|
|
1495
|
-
city: null,
|
|
1496
|
-
zip: null,
|
|
1497
|
-
countryCode: payment.creditor.countryCode || "CZ"
|
|
1498
|
-
}
|
|
1550
|
+
debtorAddress: parseFlatAddress(
|
|
1551
|
+
payment.debtor.address,
|
|
1552
|
+
payment.debtor.countryCode || "CZ"
|
|
1553
|
+
),
|
|
1554
|
+
creditorAddress: parseFlatAddress(
|
|
1555
|
+
payment.creditor.address,
|
|
1556
|
+
payment.creditor.countryCode || "CZ"
|
|
1557
|
+
)
|
|
1499
1558
|
};
|
|
1500
1559
|
const response = await this.makeRequest(
|
|
1501
1560
|
"/required-transactions",
|
|
@@ -1549,7 +1608,7 @@ class DbuConnector extends IBankConnector {
|
|
|
1549
1608
|
const limit = 10;
|
|
1550
1609
|
let hasMoreData = true;
|
|
1551
1610
|
let pageNumber = 1;
|
|
1552
|
-
const baseRequestId = backendSdk.uuidv4();
|
|
1611
|
+
const baseRequestId = backendSdk.uuidv4().replace(/-/g, "");
|
|
1553
1612
|
while (hasMoreData) {
|
|
1554
1613
|
const response = await this.makeRequest(
|
|
1555
1614
|
"/required-transactions",
|
|
@@ -1575,7 +1634,7 @@ class DbuConnector extends IBankConnector {
|
|
|
1575
1634
|
}
|
|
1576
1635
|
for (const transaction of response.transactions.transaction) {
|
|
1577
1636
|
const status = transaction.status.trim();
|
|
1578
|
-
if (status === "0" || status === "50") continue;
|
|
1637
|
+
if (status === "0" || status === "50" || status === "51") continue;
|
|
1579
1638
|
try {
|
|
1580
1639
|
const payment = this.mapDbuTransactionToPayment(
|
|
1581
1640
|
transaction,
|
|
@@ -1888,6 +1947,7 @@ class ErsteConnector extends IBankConnector {
|
|
|
1888
1947
|
const paymentInsert = {
|
|
1889
1948
|
id: backendSdk.uuidv4(),
|
|
1890
1949
|
correlationId: backendSdk.uuidv4(),
|
|
1950
|
+
paymentRequestId: payment.entryDetails.transactionDetails.references.endToEndIdentification ?? null,
|
|
1891
1951
|
connectorKey: "ERSTE",
|
|
1892
1952
|
accountId: account.id,
|
|
1893
1953
|
bankRefId: payment.entryReference,
|
|
@@ -2040,7 +2100,6 @@ exports.KBConnector = KBConnector;
|
|
|
2040
2100
|
exports.MockCobsConnector = MockCobsConnector;
|
|
2041
2101
|
exports.MockConnector = MockConnector;
|
|
2042
2102
|
exports.assignAccount = assignAccount;
|
|
2043
|
-
exports.batchTransform = batchTransform;
|
|
2044
2103
|
exports.initiateConnector = initiateConnector;
|
|
2045
2104
|
exports.mapFinbricksTransactionStatus = mapFinbricksTransactionStatus;
|
|
2046
2105
|
exports.signFinbricksJws = signFinbricksJws;
|
package/dist/types.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
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.DwyCCyd0.cjs');
|
|
4
|
+
const paymentRequest_schema = require('./shared/bank.BS7fFjGA.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');
|
|
8
8
|
require('date-fns');
|
|
9
9
|
require('drizzle-orm');
|
|
10
|
+
require('drizzle-orm/sqlite-core');
|
|
10
11
|
require('jose');
|
|
11
12
|
require('node:crypto');
|
|
12
13
|
require('drizzle-orm/relations');
|
|
13
|
-
require('drizzle-orm/sqlite-core');
|
|
14
14
|
require('drizzle-zod');
|
|
15
15
|
|
|
16
16
|
|
|
@@ -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,7 +1,7 @@
|
|
|
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.
|
|
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.Cns5ss41.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.Cns5ss41.cjs';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.CO89tR9U.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.CO89tR9U.cjs';
|
|
5
5
|
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CQBfbG8u.cjs';
|
|
6
6
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_zod from 'drizzle-zod';
|
|
@@ -240,6 +240,7 @@ interface FinbricksConnectorConfig {
|
|
|
240
240
|
declare abstract class FinbricksConnector extends IBankConnector {
|
|
241
241
|
connectorKey: ConnectorKey;
|
|
242
242
|
connectedAccounts: ConnectedAccount[];
|
|
243
|
+
supportsPaymentType(paymentType: PaymentType): boolean;
|
|
243
244
|
protected readonly finbricks: FinbricksClient;
|
|
244
245
|
protected readonly PROVIDER: FinbricksProvider;
|
|
245
246
|
constructor(provider: FinbricksProvider, { BASE_URI, MERCHANT_ID, PRIVATE_KEY_PEM, REDIRECT_URI, connectedAccounts, resolveCredentials, }: FinbricksConnectorConfig);
|
|
@@ -340,6 +341,7 @@ declare class DbuConnector extends IBankConnector {
|
|
|
340
341
|
}>;
|
|
341
342
|
listAccounts(): Promise<AccountInsertType[]>;
|
|
342
343
|
private resolveIdAccountDebit;
|
|
344
|
+
private resolveAccountDetails;
|
|
343
345
|
private initiateInstantPayment;
|
|
344
346
|
initiateDomesticPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
345
347
|
initiateSEPAPayment(_payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
@@ -1333,18 +1335,8 @@ declare function toPreparedPayment(payment: BatchedPayment, bankRefId?: string,
|
|
|
1333
1335
|
* @returns CompletedPayment with final status
|
|
1334
1336
|
*/
|
|
1335
1337
|
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;
|
|
1338
|
+
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string | null): PaymentRequestInsertType;
|
|
1347
1339
|
declare function toBatchedPaymentFromPaymentRequest(sp: PaymentRequestSelectType): BatchedPayment;
|
|
1348
1340
|
|
|
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,
|
|
1341
|
+
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
1342
|
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,7 +1,7 @@
|
|
|
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.
|
|
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.Cns5ss41.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.Cns5ss41.mjs';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.CreoSb2d.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.CreoSb2d.mjs';
|
|
5
5
|
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CQBfbG8u.mjs';
|
|
6
6
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_zod from 'drizzle-zod';
|
|
@@ -240,6 +240,7 @@ interface FinbricksConnectorConfig {
|
|
|
240
240
|
declare abstract class FinbricksConnector extends IBankConnector {
|
|
241
241
|
connectorKey: ConnectorKey;
|
|
242
242
|
connectedAccounts: ConnectedAccount[];
|
|
243
|
+
supportsPaymentType(paymentType: PaymentType): boolean;
|
|
243
244
|
protected readonly finbricks: FinbricksClient;
|
|
244
245
|
protected readonly PROVIDER: FinbricksProvider;
|
|
245
246
|
constructor(provider: FinbricksProvider, { BASE_URI, MERCHANT_ID, PRIVATE_KEY_PEM, REDIRECT_URI, connectedAccounts, resolveCredentials, }: FinbricksConnectorConfig);
|
|
@@ -340,6 +341,7 @@ declare class DbuConnector extends IBankConnector {
|
|
|
340
341
|
}>;
|
|
341
342
|
listAccounts(): Promise<AccountInsertType[]>;
|
|
342
343
|
private resolveIdAccountDebit;
|
|
344
|
+
private resolveAccountDetails;
|
|
343
345
|
private initiateInstantPayment;
|
|
344
346
|
initiateDomesticPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
345
347
|
initiateSEPAPayment(_payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
@@ -1333,18 +1335,8 @@ declare function toPreparedPayment(payment: BatchedPayment, bankRefId?: string,
|
|
|
1333
1335
|
* @returns CompletedPayment with final status
|
|
1334
1336
|
*/
|
|
1335
1337
|
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;
|
|
1338
|
+
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string | null): PaymentRequestInsertType;
|
|
1347
1339
|
declare function toBatchedPaymentFromPaymentRequest(sp: PaymentRequestSelectType): BatchedPayment;
|
|
1348
1340
|
|
|
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,
|
|
1341
|
+
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
1342
|
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,7 +1,7 @@
|
|
|
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.
|
|
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.Cns5ss41.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.Cns5ss41.js';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.BYRq3yJf.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.BYRq3yJf.js';
|
|
5
5
|
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CQBfbG8u.js';
|
|
6
6
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_zod from 'drizzle-zod';
|
|
@@ -240,6 +240,7 @@ interface FinbricksConnectorConfig {
|
|
|
240
240
|
declare abstract class FinbricksConnector extends IBankConnector {
|
|
241
241
|
connectorKey: ConnectorKey;
|
|
242
242
|
connectedAccounts: ConnectedAccount[];
|
|
243
|
+
supportsPaymentType(paymentType: PaymentType): boolean;
|
|
243
244
|
protected readonly finbricks: FinbricksClient;
|
|
244
245
|
protected readonly PROVIDER: FinbricksProvider;
|
|
245
246
|
constructor(provider: FinbricksProvider, { BASE_URI, MERCHANT_ID, PRIVATE_KEY_PEM, REDIRECT_URI, connectedAccounts, resolveCredentials, }: FinbricksConnectorConfig);
|
|
@@ -340,6 +341,7 @@ declare class DbuConnector extends IBankConnector {
|
|
|
340
341
|
}>;
|
|
341
342
|
listAccounts(): Promise<AccountInsertType[]>;
|
|
342
343
|
private resolveIdAccountDebit;
|
|
344
|
+
private resolveAccountDetails;
|
|
343
345
|
private initiateInstantPayment;
|
|
344
346
|
initiateDomesticPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
345
347
|
initiateSEPAPayment(_payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
@@ -1333,18 +1335,8 @@ declare function toPreparedPayment(payment: BatchedPayment, bankRefId?: string,
|
|
|
1333
1335
|
* @returns CompletedPayment with final status
|
|
1334
1336
|
*/
|
|
1335
1337
|
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;
|
|
1338
|
+
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string | null): PaymentRequestInsertType;
|
|
1347
1339
|
declare function toBatchedPaymentFromPaymentRequest(sp: PaymentRequestSelectType): BatchedPayment;
|
|
1348
1340
|
|
|
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,
|
|
1341
|
+
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
1342
|
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,12 +1,12 @@
|
|
|
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.D1jqaHaF.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.C0UN6luZ.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';
|
|
6
6
|
import 'date-fns';
|
|
7
7
|
import 'drizzle-orm';
|
|
8
|
+
import 'drizzle-orm/sqlite-core';
|
|
8
9
|
import 'jose';
|
|
9
10
|
import 'node:crypto';
|
|
10
11
|
import 'drizzle-orm/relations';
|
|
11
|
-
import 'drizzle-orm/sqlite-core';
|
|
12
12
|
import 'drizzle-zod';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@develit-services/bank",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.7",
|
|
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",
|