@develit-services/bank 0.8.7 → 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 +236 -276
- package/dist/export/worker.d.cts +26 -26
- package/dist/export/worker.d.mts +26 -26
- package/dist/export/worker.d.ts +26 -26
- package/dist/export/worker.mjs +237 -277
- package/dist/export/workflows.cjs +58 -96
- package/dist/export/workflows.mjs +59 -97
- 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.Cns5ss41.d.cts → bank.B-NJB8GB.d.cts} +12 -25
- package/dist/shared/{bank.Cns5ss41.d.mts → bank.B-NJB8GB.d.mts} +12 -25
- package/dist/shared/{bank.Cns5ss41.d.ts → bank.B-NJB8GB.d.ts} +12 -25
- package/dist/shared/{bank.DEmzZGZW.mjs → bank.B5bZRvgq.mjs} +2 -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.CA5ytXxp.mjs → bank.BoZtXQpG.mjs} +1 -1
- package/dist/shared/{bank.D1jqaHaF.mjs → bank.BtszLapg.mjs} +128 -20
- package/dist/shared/{bank.CO89tR9U.d.cts → bank.BzobShUU.d.cts} +1 -1
- package/dist/shared/{bank.C0UN6luZ.mjs → bank.C6jjS1Pl.mjs} +0 -2
- package/dist/shared/{bank.CreoSb2d.d.mts → bank.CAVvvZZO.d.mts} +1 -1
- package/dist/shared/{bank.DwyCCyd0.cjs → bank.CtnsGHM8.cjs} +128 -20
- package/dist/shared/{bank.62VzK9Aj.cjs → bank.DJnDSYqE.cjs} +1 -1
- package/dist/shared/{bank.BYRq3yJf.d.ts → bank.DRTuKO8S.d.ts} +1 -1
- package/dist/shared/{bank.Dm8GHThw.cjs → bank.DT6bg8k5.cjs} +2 -5
- package/dist/shared/{bank.BS7fFjGA.cjs → bank.JVlyPAAb.cjs} +0 -2
- package/dist/types.cjs +3 -3
- package/dist/types.d.cts +10 -6
- package/dist/types.d.mts +10 -6
- package/dist/types.d.ts +10 -6
- package/dist/types.mjs +3 -3
- package/package.json +1 -1
|
@@ -3,9 +3,8 @@
|
|
|
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.JVlyPAAb.cjs');
|
|
7
7
|
require('drizzle-orm');
|
|
8
|
-
require('drizzle-orm/sqlite-core');
|
|
9
8
|
const jose = require('jose');
|
|
10
9
|
require('node:crypto');
|
|
11
10
|
|
|
@@ -208,6 +207,17 @@ class IBankConnector {
|
|
|
208
207
|
}
|
|
209
208
|
}
|
|
210
209
|
|
|
210
|
+
function buildEndToEndId(payment) {
|
|
211
|
+
const parts = [];
|
|
212
|
+
if (payment.vs) parts.push(`VS${payment.vs}`);
|
|
213
|
+
if (payment.ss) parts.push(`SS${payment.ss}`);
|
|
214
|
+
if (payment.ks) parts.push(`KS${payment.ks}`);
|
|
215
|
+
if (parts.length === 0) {
|
|
216
|
+
return payment.id.replace(/-/g, "");
|
|
217
|
+
}
|
|
218
|
+
return `/${parts.join("/")}`;
|
|
219
|
+
}
|
|
220
|
+
|
|
211
221
|
async function signFinbricksJws({
|
|
212
222
|
privateKeyPem,
|
|
213
223
|
merchantId,
|
|
@@ -264,6 +274,18 @@ const useFinbricksFetch = async (config, init) => {
|
|
|
264
274
|
if (correlationId) {
|
|
265
275
|
headers["Correlation-ID"] = correlationId;
|
|
266
276
|
}
|
|
277
|
+
console.log(
|
|
278
|
+
"[Finbricks] request",
|
|
279
|
+
JSON.stringify(
|
|
280
|
+
{
|
|
281
|
+
method,
|
|
282
|
+
url: url.toString(),
|
|
283
|
+
body: body ?? null
|
|
284
|
+
},
|
|
285
|
+
null,
|
|
286
|
+
2
|
|
287
|
+
)
|
|
288
|
+
);
|
|
267
289
|
const res = await fetch(url.toString(), {
|
|
268
290
|
method,
|
|
269
291
|
headers,
|
|
@@ -271,11 +293,30 @@ const useFinbricksFetch = async (config, init) => {
|
|
|
271
293
|
});
|
|
272
294
|
if (!res.ok) {
|
|
273
295
|
const text = await res.text().catch(() => "unknown error");
|
|
296
|
+
console.error("[Finbricks] error response", {
|
|
297
|
+
status: res.status,
|
|
298
|
+
statusText: res.statusText,
|
|
299
|
+
url: url.toString(),
|
|
300
|
+
body: text
|
|
301
|
+
});
|
|
274
302
|
throw new Error(
|
|
275
303
|
`Finbricks API error: ${res.status} ${res.statusText} \u2013 ${text}`
|
|
276
304
|
);
|
|
277
305
|
}
|
|
278
|
-
|
|
306
|
+
const json = await res.json();
|
|
307
|
+
console.log(
|
|
308
|
+
"[Finbricks] response",
|
|
309
|
+
JSON.stringify(
|
|
310
|
+
{
|
|
311
|
+
status: res.status,
|
|
312
|
+
url: url.toString(),
|
|
313
|
+
body: json
|
|
314
|
+
},
|
|
315
|
+
null,
|
|
316
|
+
2
|
|
317
|
+
)
|
|
318
|
+
);
|
|
319
|
+
return json;
|
|
279
320
|
};
|
|
280
321
|
class FinbricksClient {
|
|
281
322
|
constructor(baseUrl, merchantId, privateKeyPem, redirectUri) {
|
|
@@ -330,16 +371,16 @@ const mapFinbricksStatus = (status) => {
|
|
|
330
371
|
return "PENDING";
|
|
331
372
|
}
|
|
332
373
|
};
|
|
333
|
-
const mapFinbricksTransactionStatus = (status) => {
|
|
374
|
+
const mapFinbricksTransactionStatus = (status, finalBankStatus) => {
|
|
334
375
|
switch (status) {
|
|
335
376
|
case "OPENED":
|
|
336
|
-
return "
|
|
377
|
+
return "PREPARED";
|
|
337
378
|
case "AUTHORIZED":
|
|
338
|
-
return "PENDING";
|
|
379
|
+
return finalBankStatus ? "COMPLETED" : "PENDING";
|
|
339
380
|
case "COMPLETED":
|
|
340
|
-
return "COMPLETED";
|
|
381
|
+
return finalBankStatus ? "COMPLETED" : "PENDING";
|
|
341
382
|
case "BOOKED":
|
|
342
|
-
return "PENDING";
|
|
383
|
+
return finalBankStatus ? "COMPLETED" : "PENDING";
|
|
343
384
|
case "SETTLED":
|
|
344
385
|
return "COMPLETED";
|
|
345
386
|
case "REJECTED":
|
|
@@ -393,27 +434,81 @@ const mapReferencesToPayment = (reference) => {
|
|
|
393
434
|
return symbols;
|
|
394
435
|
};
|
|
395
436
|
|
|
437
|
+
const SEPA_COUNTRIES = /* @__PURE__ */ new Set([
|
|
438
|
+
"AT",
|
|
439
|
+
"BE",
|
|
440
|
+
"BG",
|
|
441
|
+
"CY",
|
|
442
|
+
"CZ",
|
|
443
|
+
"DE",
|
|
444
|
+
"DK",
|
|
445
|
+
"EE",
|
|
446
|
+
"ES",
|
|
447
|
+
"FI",
|
|
448
|
+
"FR",
|
|
449
|
+
"GR",
|
|
450
|
+
"HR",
|
|
451
|
+
"HU",
|
|
452
|
+
"IE",
|
|
453
|
+
"IT",
|
|
454
|
+
"LT",
|
|
455
|
+
"LU",
|
|
456
|
+
"LV",
|
|
457
|
+
"MT",
|
|
458
|
+
"NL",
|
|
459
|
+
"PL",
|
|
460
|
+
"PT",
|
|
461
|
+
"RO",
|
|
462
|
+
"SE",
|
|
463
|
+
"SI",
|
|
464
|
+
"SK",
|
|
465
|
+
"IS",
|
|
466
|
+
"LI",
|
|
467
|
+
"NO",
|
|
468
|
+
"CH",
|
|
469
|
+
"GB",
|
|
470
|
+
"MC",
|
|
471
|
+
"SM",
|
|
472
|
+
"VA",
|
|
473
|
+
"AD",
|
|
474
|
+
"GI",
|
|
475
|
+
"XK"
|
|
476
|
+
]);
|
|
477
|
+
function detectPaymentType(tx, isIncoming) {
|
|
478
|
+
const related = tx.entryDetails?.transactionDetails?.relatedParties;
|
|
479
|
+
const otherParty = isIncoming ? related?.debtorAccount : related?.creditorAccount;
|
|
480
|
+
if (otherParty?.identification?.other?.identification) return "DOMESTIC";
|
|
481
|
+
const otherIban = otherParty?.identification?.iban;
|
|
482
|
+
const otherCountry = otherIban?.slice(0, 2);
|
|
483
|
+
if (otherCountry === "CZ") return "DOMESTIC";
|
|
484
|
+
if (otherIban && otherCountry) {
|
|
485
|
+
if (SEPA_COUNTRIES.has(otherCountry) && tx.amount?.currency === "EUR")
|
|
486
|
+
return "SEPA";
|
|
487
|
+
return "SWIFT";
|
|
488
|
+
}
|
|
489
|
+
if (tx.amount?.currency === "EUR") return "SEPA";
|
|
490
|
+
if (tx.amount?.currency !== "CZK") return "SWIFT";
|
|
491
|
+
return "DOMESTIC";
|
|
492
|
+
}
|
|
396
493
|
const mapFinbricksTransactionToPayment = (tx, account) => {
|
|
397
494
|
const isIncoming = tx.creditDebitIndicator === "CRDT";
|
|
398
495
|
const related = tx.entryDetails?.transactionDetails?.relatedParties;
|
|
399
496
|
const endToEndId = tx.entryDetails.transactionDetails?.references?.endToEndIdentification;
|
|
400
|
-
const
|
|
401
|
-
const paymentRequestId = endToEndId && uuidRegex.test(endToEndId) ? endToEndId : null;
|
|
497
|
+
const symbolsRegex = /^\/VS\d+/;
|
|
402
498
|
const base = {
|
|
403
499
|
id: backendSdk.uuidv4(),
|
|
404
500
|
correlationId: backendSdk.uuidv4(),
|
|
405
|
-
paymentRequestId,
|
|
406
501
|
connectorKey: account.connectorKey,
|
|
407
502
|
accountId: account.id,
|
|
408
503
|
bankRefId: tx.fbxReference,
|
|
409
504
|
amount: tx.amount?.value || 0,
|
|
410
505
|
currency: tx.amount?.currency || "CZK",
|
|
411
|
-
paymentType:
|
|
506
|
+
paymentType: detectPaymentType(tx, isIncoming),
|
|
412
507
|
status: mapFinbricksStatus(tx.status),
|
|
413
508
|
message: tx.entryDetails.transactionDetails?.remittanceInformation?.unstructured || tx.entryDetails.transactionDetails?.additionalRemittanceInformation || tx.entryDetails.transactionDetails?.additionalTransactionInformation || null,
|
|
414
509
|
processedAt: new Date(tx.bookingDate.date),
|
|
415
510
|
...mapReferencesToPayment(
|
|
416
|
-
tx.entryDetails.transactionDetails?.remittanceInformation?.structured?.creditorReferenceInformation?.reference || (
|
|
511
|
+
tx.entryDetails.transactionDetails?.remittanceInformation?.structured?.creditorReferenceInformation?.reference || (endToEndId && symbolsRegex.test(endToEndId) ? endToEndId : void 0)
|
|
417
512
|
),
|
|
418
513
|
creditor: {
|
|
419
514
|
holderName: related?.creditorAccount?.name || related?.creditor?.name || "Unknown",
|
|
@@ -440,6 +535,13 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
|
|
|
440
535
|
return base;
|
|
441
536
|
};
|
|
442
537
|
|
|
538
|
+
function autoVariableSymbol(paymentId) {
|
|
539
|
+
let hash = 0;
|
|
540
|
+
for (let i = 0; i < paymentId.length; i++) {
|
|
541
|
+
hash = (hash << 5) - hash + paymentId.charCodeAt(i) | 0;
|
|
542
|
+
}
|
|
543
|
+
return String(Math.abs(hash) % 1e10).padStart(10, "0");
|
|
544
|
+
}
|
|
443
545
|
class FinbricksConnector extends IBankConnector {
|
|
444
546
|
constructor(provider, {
|
|
445
547
|
BASE_URI,
|
|
@@ -451,6 +553,7 @@ class FinbricksConnector extends IBankConnector {
|
|
|
451
553
|
}) {
|
|
452
554
|
super();
|
|
453
555
|
this.connectorKey = "FINBRICKS";
|
|
556
|
+
this.lifecycleMode = "batch";
|
|
454
557
|
this.connectedAccounts = [];
|
|
455
558
|
this.PROVIDER = provider;
|
|
456
559
|
this.finbricks = new FinbricksClient(
|
|
@@ -654,7 +757,7 @@ class FinbricksConnector extends IBankConnector {
|
|
|
654
757
|
merchantTransactionId: p.id,
|
|
655
758
|
creditorAccountIban: p.creditor.iban,
|
|
656
759
|
amount: p.amount,
|
|
657
|
-
variableSymbol: p.vs,
|
|
760
|
+
variableSymbol: p.vs ?? (p.ss ? void 0 : autoVariableSymbol(p.id)),
|
|
658
761
|
specificSymbol: p.ss,
|
|
659
762
|
constantSymbol: p.ks,
|
|
660
763
|
description: p.message
|
|
@@ -762,7 +865,7 @@ class FinbricksConnector extends IBankConnector {
|
|
|
762
865
|
},
|
|
763
866
|
paymentIdentification: {
|
|
764
867
|
merchantTransactionId: bankRefId,
|
|
765
|
-
endToEndIdentification: payment
|
|
868
|
+
endToEndIdentification: buildEndToEndId(payment)
|
|
766
869
|
},
|
|
767
870
|
amount: payment.amount,
|
|
768
871
|
debtor: {
|
|
@@ -812,7 +915,7 @@ class FinbricksConnector extends IBankConnector {
|
|
|
812
915
|
creditorAccountIban: payment.creditor.iban,
|
|
813
916
|
creditorName: payment.creditor.holderName,
|
|
814
917
|
description: payment.message,
|
|
815
|
-
variableSymbol: payment.vs,
|
|
918
|
+
variableSymbol: payment.vs ?? (payment.ss ? void 0 : autoVariableSymbol(payment.id)),
|
|
816
919
|
callbackUrl: `${this.finbricks.REDIRECT_URI}?type=payment&paymentId=${payment.id}`,
|
|
817
920
|
paymentProvider: this.PROVIDER
|
|
818
921
|
}
|
|
@@ -903,7 +1006,10 @@ class FinbricksConnector extends IBankConnector {
|
|
|
903
1006
|
message: "Finbricks: failed to fetch payment status"
|
|
904
1007
|
});
|
|
905
1008
|
}
|
|
906
|
-
return mapFinbricksTransactionStatus(
|
|
1009
|
+
return mapFinbricksTransactionStatus(
|
|
1010
|
+
response.resultCode,
|
|
1011
|
+
response.finalBankStatus ?? false
|
|
1012
|
+
);
|
|
907
1013
|
}
|
|
908
1014
|
async getBatchStatus({
|
|
909
1015
|
batchId,
|
|
@@ -956,6 +1062,7 @@ class AirBankConnector extends FinbricksConnector {
|
|
|
956
1062
|
class CreditasConnector extends FinbricksConnector {
|
|
957
1063
|
constructor(config) {
|
|
958
1064
|
super("CREDITAS", config);
|
|
1065
|
+
this.lifecycleMode = "per-payment";
|
|
959
1066
|
}
|
|
960
1067
|
/**
|
|
961
1068
|
* Creditas bank doesn't support batch payments at all.
|
|
@@ -1225,6 +1332,7 @@ class DbuConnector extends IBankConnector {
|
|
|
1225
1332
|
}) {
|
|
1226
1333
|
super();
|
|
1227
1334
|
this.connectorKey = "DBU";
|
|
1335
|
+
this.lifecycleMode = "per-payment";
|
|
1228
1336
|
this.connectedAccounts = [];
|
|
1229
1337
|
this.baseUrl = BASE_URL;
|
|
1230
1338
|
this.username = USERNAME;
|
|
@@ -1308,7 +1416,6 @@ class DbuConnector extends IBankConnector {
|
|
|
1308
1416
|
const parsed = {
|
|
1309
1417
|
id: backendSdk.uuidv4(),
|
|
1310
1418
|
correlationId: backendSdk.uuidv4(),
|
|
1311
|
-
paymentRequestId: transaction.uniqueExternalId ?? null,
|
|
1312
1419
|
connectorKey: "DBU",
|
|
1313
1420
|
accountId: account.id,
|
|
1314
1421
|
bankRefId: transaction.idRequiredTransaction.toString(),
|
|
@@ -1682,6 +1789,7 @@ class ErsteConnector extends IBankConnector {
|
|
|
1682
1789
|
constructor(config) {
|
|
1683
1790
|
super();
|
|
1684
1791
|
this.connectorKey = "ERSTE";
|
|
1792
|
+
this.lifecycleMode = "batch";
|
|
1685
1793
|
this.accessToken = null;
|
|
1686
1794
|
this.API_KEY = config.API_KEY;
|
|
1687
1795
|
this.CLIENT_ID = config.CLIENT_ID;
|
|
@@ -1787,7 +1895,7 @@ class ErsteConnector extends IBankConnector {
|
|
|
1787
1895
|
}
|
|
1788
1896
|
const paymentBody = {
|
|
1789
1897
|
paymentIdentification: {
|
|
1790
|
-
endToEndIdentification: payment
|
|
1898
|
+
endToEndIdentification: buildEndToEndId(payment),
|
|
1791
1899
|
instructionIdentification: payment.id
|
|
1792
1900
|
},
|
|
1793
1901
|
paymentTypeInformation: { instructionPriority: "NORM" },
|
|
@@ -1947,7 +2055,6 @@ class ErsteConnector extends IBankConnector {
|
|
|
1947
2055
|
const paymentInsert = {
|
|
1948
2056
|
id: backendSdk.uuidv4(),
|
|
1949
2057
|
correlationId: backendSdk.uuidv4(),
|
|
1950
|
-
paymentRequestId: payment.entryDetails.transactionDetails.references.endToEndIdentification ?? null,
|
|
1951
2058
|
connectorKey: "ERSTE",
|
|
1952
2059
|
accountId: account.id,
|
|
1953
2060
|
bankRefId: payment.entryReference,
|
|
@@ -2014,6 +2121,7 @@ class MockConnector extends IBankConnector {
|
|
|
2014
2121
|
constructor() {
|
|
2015
2122
|
super();
|
|
2016
2123
|
this.connectorKey = "MOCK";
|
|
2124
|
+
this.lifecycleMode = "batch";
|
|
2017
2125
|
this.connectedAccounts = [];
|
|
2018
2126
|
}
|
|
2019
2127
|
supportsBatch(_paymentType) {
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
const drizzleOrm = require('drizzle-orm');
|
|
4
4
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
5
|
-
require('./bank.
|
|
5
|
+
require('./bank.JVlyPAAb.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.
|
|
11
|
-
require('drizzle-orm/sqlite-core');
|
|
10
|
+
const database_schema = require('./bank.DJnDSYqE.cjs');
|
|
12
11
|
|
|
13
12
|
const createPaymentCommand = (db, { payment }) => {
|
|
14
13
|
return {
|
|
@@ -24,8 +23,6 @@ const createPaymentCommand = (db, { payment }) => {
|
|
|
24
23
|
statusReason: drizzleOrm.sql`excluded.status_reason`,
|
|
25
24
|
processedAt: drizzleOrm.sql`excluded.processed_at`,
|
|
26
25
|
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
26
|
// Keep existing refId if already set, otherwise use enriched value
|
|
30
27
|
refId: drizzleOrm.sql`coalesce(payment.ref_id, excluded.ref_id)`,
|
|
31
28
|
// Keep existing batchId if already set, otherwise use enriched value
|
|
@@ -140,7 +140,6 @@ const payment = sqliteCore.sqliteTable(
|
|
|
140
140
|
{
|
|
141
141
|
...backendSdk.base,
|
|
142
142
|
correlationId: sqliteCore.text("correlation_id").notNull(),
|
|
143
|
-
paymentRequestId: sqliteCore.text("payment_request_id"),
|
|
144
143
|
refId: sqliteCore.text("ref_id"),
|
|
145
144
|
bankRefId: sqliteCore.text("bank_ref_id").notNull(),
|
|
146
145
|
accountId: sqliteCore.text("account_id").references(() => account.id, {
|
|
@@ -182,7 +181,6 @@ const payment = sqliteCore.sqliteTable(
|
|
|
182
181
|
sqliteCore.index("payment_account_id_status_idx").on(t.accountId, t.status),
|
|
183
182
|
sqliteCore.index("payment_account_id_created_at_idx").on(t.accountId, t.createdAt),
|
|
184
183
|
sqliteCore.index("payment_created_at_idx").on(t.createdAt),
|
|
185
|
-
sqliteCore.index("payment_payment_request_id_idx").on(t.paymentRequestId),
|
|
186
184
|
sqliteCore.index("payment_direction_idx").on(t.direction),
|
|
187
185
|
sqliteCore.index("payment_batch_id_idx").on(t.batchId),
|
|
188
186
|
sqliteCore.index("payment_creditor_iban_idx").on(t.creditorIban),
|
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.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');
|
|
8
8
|
require('date-fns');
|
|
9
9
|
require('drizzle-orm');
|
|
10
|
-
require('drizzle-orm/sqlite-core');
|
|
11
10
|
require('jose');
|
|
12
11
|
require('node:crypto');
|
|
13
12
|
require('drizzle-orm/relations');
|
|
13
|
+
require('drizzle-orm/sqlite-core');
|
|
14
14
|
require('drizzle-zod');
|
|
15
15
|
|
|
16
16
|
|
package/dist/types.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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.
|
|
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.
|
|
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, P as PaymentQueueMessage, 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,6 +239,7 @@ 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[];
|
|
243
244
|
supportsPaymentType(paymentType: PaymentType): boolean;
|
|
244
245
|
protected readonly finbricks: FinbricksClient;
|
|
@@ -315,6 +316,7 @@ interface DbuConnectorConfig {
|
|
|
315
316
|
}
|
|
316
317
|
declare class DbuConnector extends IBankConnector {
|
|
317
318
|
connectorKey: ConnectorKey;
|
|
319
|
+
readonly lifecycleMode = "per-payment";
|
|
318
320
|
connectedAccounts: ConnectedAccount[];
|
|
319
321
|
readonly kv: KVNamespace;
|
|
320
322
|
readonly api: Fetcher;
|
|
@@ -399,6 +401,7 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
399
401
|
private readonly REDIRECT_URI;
|
|
400
402
|
private readonly ACCOUNTS_URI;
|
|
401
403
|
connectorKey: ConnectorKey;
|
|
404
|
+
readonly lifecycleMode = "batch";
|
|
402
405
|
connectedAccounts: ConnectedAccount[];
|
|
403
406
|
private accessToken;
|
|
404
407
|
constructor(config: ErsteConnectorConfig);
|
|
@@ -465,6 +468,7 @@ declare class MockCobsConnector extends FinbricksConnector {
|
|
|
465
468
|
declare class MockConnector extends IBankConnector {
|
|
466
469
|
connectedAccounts: ConnectedAccount[];
|
|
467
470
|
connectorKey: ConnectorKey;
|
|
471
|
+
readonly lifecycleMode = "batch";
|
|
468
472
|
constructor();
|
|
469
473
|
supportsBatch(_paymentType: PaymentType): boolean;
|
|
470
474
|
getAuthUri({ accountId, }: {
|
package/dist/types.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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.
|
|
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.
|
|
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, P as PaymentQueueMessage, 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,6 +239,7 @@ 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[];
|
|
243
244
|
supportsPaymentType(paymentType: PaymentType): boolean;
|
|
244
245
|
protected readonly finbricks: FinbricksClient;
|
|
@@ -315,6 +316,7 @@ interface DbuConnectorConfig {
|
|
|
315
316
|
}
|
|
316
317
|
declare class DbuConnector extends IBankConnector {
|
|
317
318
|
connectorKey: ConnectorKey;
|
|
319
|
+
readonly lifecycleMode = "per-payment";
|
|
318
320
|
connectedAccounts: ConnectedAccount[];
|
|
319
321
|
readonly kv: KVNamespace;
|
|
320
322
|
readonly api: Fetcher;
|
|
@@ -399,6 +401,7 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
399
401
|
private readonly REDIRECT_URI;
|
|
400
402
|
private readonly ACCOUNTS_URI;
|
|
401
403
|
connectorKey: ConnectorKey;
|
|
404
|
+
readonly lifecycleMode = "batch";
|
|
402
405
|
connectedAccounts: ConnectedAccount[];
|
|
403
406
|
private accessToken;
|
|
404
407
|
constructor(config: ErsteConnectorConfig);
|
|
@@ -465,6 +468,7 @@ declare class MockCobsConnector extends FinbricksConnector {
|
|
|
465
468
|
declare class MockConnector extends IBankConnector {
|
|
466
469
|
connectedAccounts: ConnectedAccount[];
|
|
467
470
|
connectorKey: ConnectorKey;
|
|
471
|
+
readonly lifecycleMode = "batch";
|
|
468
472
|
constructor();
|
|
469
473
|
supportsBatch(_paymentType: PaymentType): boolean;
|
|
470
474
|
getAuthUri({ accountId, }: {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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.
|
|
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.
|
|
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, P as PaymentQueueMessage, 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,6 +239,7 @@ 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[];
|
|
243
244
|
supportsPaymentType(paymentType: PaymentType): boolean;
|
|
244
245
|
protected readonly finbricks: FinbricksClient;
|
|
@@ -315,6 +316,7 @@ interface DbuConnectorConfig {
|
|
|
315
316
|
}
|
|
316
317
|
declare class DbuConnector extends IBankConnector {
|
|
317
318
|
connectorKey: ConnectorKey;
|
|
319
|
+
readonly lifecycleMode = "per-payment";
|
|
318
320
|
connectedAccounts: ConnectedAccount[];
|
|
319
321
|
readonly kv: KVNamespace;
|
|
320
322
|
readonly api: Fetcher;
|
|
@@ -399,6 +401,7 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
399
401
|
private readonly REDIRECT_URI;
|
|
400
402
|
private readonly ACCOUNTS_URI;
|
|
401
403
|
connectorKey: ConnectorKey;
|
|
404
|
+
readonly lifecycleMode = "batch";
|
|
402
405
|
connectedAccounts: ConnectedAccount[];
|
|
403
406
|
private accessToken;
|
|
404
407
|
constructor(config: ErsteConnectorConfig);
|
|
@@ -465,6 +468,7 @@ declare class MockCobsConnector extends FinbricksConnector {
|
|
|
465
468
|
declare class MockConnector extends IBankConnector {
|
|
466
469
|
connectedAccounts: ConnectedAccount[];
|
|
467
470
|
connectorKey: ConnectorKey;
|
|
471
|
+
readonly lifecycleMode = "batch";
|
|
468
472
|
constructor();
|
|
469
473
|
supportsBatch(_paymentType: PaymentType): boolean;
|
|
470
474
|
getAuthUri({ accountId, }: {
|
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, 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, 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';
|
|
6
6
|
import 'date-fns';
|
|
7
7
|
import 'drizzle-orm';
|
|
8
|
-
import 'drizzle-orm/sqlite-core';
|
|
9
8
|
import 'jose';
|
|
10
9
|
import 'node:crypto';
|
|
11
10
|
import 'drizzle-orm/relations';
|
|
11
|
+
import 'drizzle-orm/sqlite-core';
|
|
12
12
|
import 'drizzle-zod';
|