@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.
Files changed (32) hide show
  1. package/dist/database/schema.cjs +1 -1
  2. package/dist/database/schema.d.cts +1 -1
  3. package/dist/database/schema.d.mts +1 -1
  4. package/dist/database/schema.d.ts +1 -1
  5. package/dist/database/schema.mjs +1 -1
  6. package/dist/export/worker.cjs +583 -146
  7. package/dist/export/worker.d.cts +286 -44
  8. package/dist/export/worker.d.mts +286 -44
  9. package/dist/export/worker.d.ts +286 -44
  10. package/dist/export/worker.mjs +584 -147
  11. package/dist/export/workflows.cjs +132 -16
  12. package/dist/export/workflows.mjs +133 -17
  13. package/dist/shared/{bank.C-T1FQxg.cjs → bank.62VzK9Aj.cjs} +1 -1
  14. package/dist/shared/{bank.SQ4Mmr8u.cjs → bank.BS7fFjGA.cjs} +34 -4
  15. package/dist/shared/{bank.6faPHUEY.d.ts → bank.BYRq3yJf.d.ts} +81 -11
  16. package/dist/shared/{bank.C4VOdIx1.mjs → bank.C0UN6luZ.mjs} +34 -4
  17. package/dist/shared/{bank.DDHrdFgy.mjs → bank.CA5ytXxp.mjs} +1 -1
  18. package/dist/shared/{bank.BoWCMu5n.d.cts → bank.CO89tR9U.d.cts} +81 -11
  19. package/dist/shared/{bank.BaMRCHk-.d.ts → bank.Cns5ss41.d.cts} +55 -18
  20. package/dist/shared/{bank.BaMRCHk-.d.cts → bank.Cns5ss41.d.mts} +55 -18
  21. package/dist/shared/{bank.BaMRCHk-.d.mts → bank.Cns5ss41.d.ts} +55 -18
  22. package/dist/shared/{bank.DOL1uM4n.d.mts → bank.CreoSb2d.d.mts} +81 -11
  23. package/dist/shared/{bank.DRrBrAdI.mjs → bank.D1jqaHaF.mjs} +91 -31
  24. package/dist/shared/{bank.Cpy9PULF.mjs → bank.DEmzZGZW.mjs} +31 -5
  25. package/dist/shared/{bank.BOnP9p9Y.cjs → bank.Dm8GHThw.cjs} +31 -5
  26. package/dist/shared/{bank.CQURey1E.cjs → bank.DwyCCyd0.cjs} +90 -31
  27. package/dist/types.cjs +3 -4
  28. package/dist/types.d.cts +8 -16
  29. package/dist/types.d.mts +8 -16
  30. package/dist/types.d.ts +8 -16
  31. package/dist/types.mjs +3 -3
  32. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { X as CurrencyCode, H as BankCode, U as CountryCode } from './bank.BaMRCHk-.js';
1
+ import { d as CurrencyCode, J as BankCode, V as CountryCode } from './bank.Cns5ss41.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
@@ -210,6 +210,18 @@ type FinbricksAccountTransactionsResponse = {
210
210
  transactions: FinbricksTransaction[];
211
211
  };
212
212
 
213
+ /**
214
+ * @deprecated Use IncomingPayment from './payment-lifecycle' instead
215
+ * This type is kept for backward compatibility during migration
216
+ */
217
+
218
+ /**
219
+ * Message pushed to PAYMENTS_READY_TO_BATCH_QUEUE after payment_request is created in DB
220
+ */
221
+ type PaymentQueueMessage = {
222
+ paymentId: string;
223
+ };
224
+
213
225
  declare const sendPaymentInputSchema: z.ZodObject<{
214
226
  correlationId: z.ZodString;
215
227
  refId: z.ZodOptional<z.ZodString>;
@@ -225,7 +237,6 @@ declare const sendPaymentInputSchema: z.ZodObject<{
225
237
  OUR: "OUR";
226
238
  BEN: "BEN";
227
239
  }>>;
228
- executionDate: z.ZodOptional<z.ZodString>;
229
240
  instructionPriority: z.ZodOptional<z.ZodEnum<{
230
241
  NORM: "NORM";
231
242
  HIGH: "HIGH";
@@ -301,31 +312,42 @@ declare const sendPaymentInputSchema: z.ZodObject<{
301
312
  "0710": "0710";
302
313
  "0800": "0800";
303
314
  2010: "2010";
315
+ 2020: "2020";
316
+ 2030: "2030";
304
317
  2060: "2060";
305
318
  2070: "2070";
306
319
  2100: "2100";
307
320
  2200: "2200";
321
+ 2210: "2210";
308
322
  2220: "2220";
323
+ 2240: "2240";
309
324
  2250: "2250";
310
325
  2260: "2260";
326
+ 2310: "2310";
311
327
  2600: "2600";
312
328
  2700: "2700";
313
329
  3030: "3030";
330
+ 3050: "3050";
314
331
  3060: "3060";
315
332
  3500: "3500";
333
+ 4000: "4000";
316
334
  4300: "4300";
317
335
  5500: "5500";
336
+ 5400: "5400";
318
337
  5800: "5800";
319
338
  6000: "6000";
339
+ 6100: "6100";
320
340
  6200: "6200";
321
341
  6210: "6210";
322
342
  6300: "6300";
323
343
  6363: "6363";
324
344
  6700: "6700";
325
345
  6800: "6800";
346
+ 7940: "7940";
326
347
  7910: "7910";
327
348
  7950: "7950";
328
349
  7960: "7960";
350
+ 7980: "7980";
329
351
  7970: "7970";
330
352
  7990: "7990";
331
353
  8030: "8030";
@@ -335,11 +357,15 @@ declare const sendPaymentInputSchema: z.ZodObject<{
335
357
  8150: "8150";
336
358
  8190: "8190";
337
359
  8198: "8198";
360
+ 8200: "8200";
338
361
  8220: "8220";
362
+ 8230: "8230";
363
+ 8240: "8240";
339
364
  8250: "8250";
340
365
  8255: "8255";
341
366
  8265: "8265";
342
367
  8500: "8500";
368
+ 8610: "8610";
343
369
  }>>;
344
370
  holderName: z.ZodOptional<z.ZodString>;
345
371
  iban: z.ZodOptional<z.ZodString>;
@@ -402,6 +428,7 @@ declare const sendPaymentInputSchema: z.ZodObject<{
402
428
  AVAX: "AVAX";
403
429
  }>>;
404
430
  countryCode: z.ZodOptional<z.ZodEnum<{
431
+ IM: "IM";
405
432
  AF: "AF";
406
433
  AL: "AL";
407
434
  DZ: "DZ";
@@ -490,7 +517,6 @@ declare const sendPaymentInputSchema: z.ZodObject<{
490
517
  IR: "IR";
491
518
  IQ: "IQ";
492
519
  IE: "IE";
493
- IM: "IM";
494
520
  IL: "IL";
495
521
  IT: "IT";
496
522
  CI: "CI";
@@ -631,31 +657,42 @@ declare const sendPaymentInputSchema: z.ZodObject<{
631
657
  "0710": "0710";
632
658
  "0800": "0800";
633
659
  2010: "2010";
660
+ 2020: "2020";
661
+ 2030: "2030";
634
662
  2060: "2060";
635
663
  2070: "2070";
636
664
  2100: "2100";
637
665
  2200: "2200";
666
+ 2210: "2210";
638
667
  2220: "2220";
668
+ 2240: "2240";
639
669
  2250: "2250";
640
670
  2260: "2260";
671
+ 2310: "2310";
641
672
  2600: "2600";
642
673
  2700: "2700";
643
674
  3030: "3030";
675
+ 3050: "3050";
644
676
  3060: "3060";
645
677
  3500: "3500";
678
+ 4000: "4000";
646
679
  4300: "4300";
647
680
  5500: "5500";
681
+ 5400: "5400";
648
682
  5800: "5800";
649
683
  6000: "6000";
684
+ 6100: "6100";
650
685
  6200: "6200";
651
686
  6210: "6210";
652
687
  6300: "6300";
653
688
  6363: "6363";
654
689
  6700: "6700";
655
690
  6800: "6800";
691
+ 7940: "7940";
656
692
  7910: "7910";
657
693
  7950: "7950";
658
694
  7960: "7960";
695
+ 7980: "7980";
659
696
  7970: "7970";
660
697
  7990: "7990";
661
698
  8030: "8030";
@@ -665,11 +702,15 @@ declare const sendPaymentInputSchema: z.ZodObject<{
665
702
  8150: "8150";
666
703
  8190: "8190";
667
704
  8198: "8198";
705
+ 8200: "8200";
668
706
  8220: "8220";
707
+ 8230: "8230";
708
+ 8240: "8240";
669
709
  8250: "8250";
670
710
  8255: "8255";
671
711
  8265: "8265";
672
712
  8500: "8500";
713
+ 8610: "8610";
673
714
  }>>;
674
715
  holderName: z.ZodOptional<z.ZodString>;
675
716
  iban: z.ZodOptional<z.ZodString>;
@@ -732,6 +773,7 @@ declare const sendPaymentInputSchema: z.ZodObject<{
732
773
  AVAX: "AVAX";
733
774
  }>>;
734
775
  countryCode: z.ZodOptional<z.ZodEnum<{
776
+ IM: "IM";
735
777
  AF: "AF";
736
778
  AL: "AL";
737
779
  DZ: "DZ";
@@ -820,7 +862,6 @@ declare const sendPaymentInputSchema: z.ZodObject<{
820
862
  IR: "IR";
821
863
  IQ: "IQ";
822
864
  IE: "IE";
823
- IM: "IM";
824
865
  IL: "IL";
825
866
  IT: "IT";
826
867
  CI: "CI";
@@ -950,12 +991,13 @@ declare const sendPaymentInputSchema: z.ZodObject<{
950
991
  bsb: z.ZodOptional<z.ZodString>;
951
992
  brBankNumber: z.ZodOptional<z.ZodString>;
952
993
  }, z.core.$strip>;
953
- purpose: z.ZodOptional<z.ZodString>;
954
994
  sendAsSinglePayment: z.ZodOptional<z.ZodBoolean>;
955
995
  }, z.core.$strip>;
956
996
  interface SendPaymentInput extends z.infer<typeof sendPaymentInputSchema> {
957
997
  }
958
- type SendPaymentOutput = void;
998
+ type SendPaymentOutput = {
999
+ paymentId: string;
1000
+ };
959
1001
 
960
1002
  declare const sendPaymentSyncInputSchema: z.ZodObject<{
961
1003
  correlationId: z.ZodString;
@@ -972,7 +1014,6 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
972
1014
  OUR: "OUR";
973
1015
  BEN: "BEN";
974
1016
  }>>;
975
- executionDate: z.ZodOptional<z.ZodString>;
976
1017
  instructionPriority: z.ZodOptional<z.ZodEnum<{
977
1018
  NORM: "NORM";
978
1019
  HIGH: "HIGH";
@@ -1048,31 +1089,42 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1048
1089
  "0710": "0710";
1049
1090
  "0800": "0800";
1050
1091
  2010: "2010";
1092
+ 2020: "2020";
1093
+ 2030: "2030";
1051
1094
  2060: "2060";
1052
1095
  2070: "2070";
1053
1096
  2100: "2100";
1054
1097
  2200: "2200";
1098
+ 2210: "2210";
1055
1099
  2220: "2220";
1100
+ 2240: "2240";
1056
1101
  2250: "2250";
1057
1102
  2260: "2260";
1103
+ 2310: "2310";
1058
1104
  2600: "2600";
1059
1105
  2700: "2700";
1060
1106
  3030: "3030";
1107
+ 3050: "3050";
1061
1108
  3060: "3060";
1062
1109
  3500: "3500";
1110
+ 4000: "4000";
1063
1111
  4300: "4300";
1064
1112
  5500: "5500";
1113
+ 5400: "5400";
1065
1114
  5800: "5800";
1066
1115
  6000: "6000";
1116
+ 6100: "6100";
1067
1117
  6200: "6200";
1068
1118
  6210: "6210";
1069
1119
  6300: "6300";
1070
1120
  6363: "6363";
1071
1121
  6700: "6700";
1072
1122
  6800: "6800";
1123
+ 7940: "7940";
1073
1124
  7910: "7910";
1074
1125
  7950: "7950";
1075
1126
  7960: "7960";
1127
+ 7980: "7980";
1076
1128
  7970: "7970";
1077
1129
  7990: "7990";
1078
1130
  8030: "8030";
@@ -1082,11 +1134,15 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1082
1134
  8150: "8150";
1083
1135
  8190: "8190";
1084
1136
  8198: "8198";
1137
+ 8200: "8200";
1085
1138
  8220: "8220";
1139
+ 8230: "8230";
1140
+ 8240: "8240";
1086
1141
  8250: "8250";
1087
1142
  8255: "8255";
1088
1143
  8265: "8265";
1089
1144
  8500: "8500";
1145
+ 8610: "8610";
1090
1146
  }>>;
1091
1147
  holderName: z.ZodOptional<z.ZodString>;
1092
1148
  iban: z.ZodOptional<z.ZodString>;
@@ -1149,6 +1205,7 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1149
1205
  AVAX: "AVAX";
1150
1206
  }>>;
1151
1207
  countryCode: z.ZodOptional<z.ZodEnum<{
1208
+ IM: "IM";
1152
1209
  AF: "AF";
1153
1210
  AL: "AL";
1154
1211
  DZ: "DZ";
@@ -1237,7 +1294,6 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1237
1294
  IR: "IR";
1238
1295
  IQ: "IQ";
1239
1296
  IE: "IE";
1240
- IM: "IM";
1241
1297
  IL: "IL";
1242
1298
  IT: "IT";
1243
1299
  CI: "CI";
@@ -1378,31 +1434,42 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1378
1434
  "0710": "0710";
1379
1435
  "0800": "0800";
1380
1436
  2010: "2010";
1437
+ 2020: "2020";
1438
+ 2030: "2030";
1381
1439
  2060: "2060";
1382
1440
  2070: "2070";
1383
1441
  2100: "2100";
1384
1442
  2200: "2200";
1443
+ 2210: "2210";
1385
1444
  2220: "2220";
1445
+ 2240: "2240";
1386
1446
  2250: "2250";
1387
1447
  2260: "2260";
1448
+ 2310: "2310";
1388
1449
  2600: "2600";
1389
1450
  2700: "2700";
1390
1451
  3030: "3030";
1452
+ 3050: "3050";
1391
1453
  3060: "3060";
1392
1454
  3500: "3500";
1455
+ 4000: "4000";
1393
1456
  4300: "4300";
1394
1457
  5500: "5500";
1458
+ 5400: "5400";
1395
1459
  5800: "5800";
1396
1460
  6000: "6000";
1461
+ 6100: "6100";
1397
1462
  6200: "6200";
1398
1463
  6210: "6210";
1399
1464
  6300: "6300";
1400
1465
  6363: "6363";
1401
1466
  6700: "6700";
1402
1467
  6800: "6800";
1468
+ 7940: "7940";
1403
1469
  7910: "7910";
1404
1470
  7950: "7950";
1405
1471
  7960: "7960";
1472
+ 7980: "7980";
1406
1473
  7970: "7970";
1407
1474
  7990: "7990";
1408
1475
  8030: "8030";
@@ -1412,11 +1479,15 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1412
1479
  8150: "8150";
1413
1480
  8190: "8190";
1414
1481
  8198: "8198";
1482
+ 8200: "8200";
1415
1483
  8220: "8220";
1484
+ 8230: "8230";
1485
+ 8240: "8240";
1416
1486
  8250: "8250";
1417
1487
  8255: "8255";
1418
1488
  8265: "8265";
1419
1489
  8500: "8500";
1490
+ 8610: "8610";
1420
1491
  }>>;
1421
1492
  holderName: z.ZodOptional<z.ZodString>;
1422
1493
  iban: z.ZodOptional<z.ZodString>;
@@ -1479,6 +1550,7 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1479
1550
  AVAX: "AVAX";
1480
1551
  }>>;
1481
1552
  countryCode: z.ZodOptional<z.ZodEnum<{
1553
+ IM: "IM";
1482
1554
  AF: "AF";
1483
1555
  AL: "AL";
1484
1556
  DZ: "DZ";
@@ -1567,7 +1639,6 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1567
1639
  IR: "IR";
1568
1640
  IQ: "IQ";
1569
1641
  IE: "IE";
1570
- IM: "IM";
1571
1642
  IL: "IL";
1572
1643
  IT: "IT";
1573
1644
  CI: "CI";
@@ -1697,7 +1768,6 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1697
1768
  bsb: z.ZodOptional<z.ZodString>;
1698
1769
  brBankNumber: z.ZodOptional<z.ZodString>;
1699
1770
  }, z.core.$strip>;
1700
- purpose: z.ZodOptional<z.ZodString>;
1701
1771
  sendAsSinglePayment: z.ZodOptional<z.ZodBoolean>;
1702
1772
  }, z.core.$strip>;
1703
1773
  interface SendPaymentSyncInput extends z.infer<typeof sendPaymentSyncInputSchema> {
@@ -1707,4 +1777,4 @@ type SendPaymentSyncOutput = {
1707
1777
  authorizationUrl: string;
1708
1778
  };
1709
1779
 
1710
- export type { FinbricksSupportedBanksResponse as F, ReferenceType as R, SendPaymentInput as S, SendPaymentOutput as a, SendPaymentSyncInput as b, SendPaymentSyncOutput as c, FinbricksAccount as d, FinbricksAccountTransactionsResponse as e, FinbricksAccountsListResponse as f, FinbricksAuthTokenResponse as g, FinbricksBatchResponse as h, FinbricksConnectAccountResponse as i, FinbricksPaymentResponse as j, FinbricksSupportedBank as k };
1780
+ export type { FinbricksSupportedBanksResponse as F, PaymentQueueMessage as P, ReferenceType as R, SendPaymentInput as S, SendPaymentOutput as a, SendPaymentSyncInput as b, SendPaymentSyncOutput as c, FinbricksAccount as d, FinbricksAccountTransactionsResponse as e, FinbricksAccountsListResponse as f, FinbricksAuthTokenResponse as g, FinbricksBatchResponse as h, FinbricksConnectAccountResponse as i, FinbricksPaymentResponse as j, FinbricksSupportedBank as k };
@@ -26,7 +26,8 @@ const BATCH_STATUSES = [
26
26
  "READY_TO_SIGN",
27
27
  "SIGNED",
28
28
  "SIGNATURE_FAILED",
29
- "FAILED"
29
+ "FAILED",
30
+ "COMPLETED"
30
31
  ];
31
32
  const ACCOUNT_STATUSES = ["AUTHORIZED", "DISABLED", "EXPIRED"];
32
33
  const COUNTRY_CODES = COUNTRY_CODES_2;
@@ -137,6 +138,7 @@ const payment = sqliteTable(
137
138
  {
138
139
  ...base,
139
140
  correlationId: text("correlation_id").notNull(),
141
+ paymentRequestId: text("payment_request_id"),
140
142
  refId: text("ref_id"),
141
143
  bankRefId: text("bank_ref_id").notNull(),
142
144
  accountId: text("account_id").references(() => account.id, {
@@ -172,7 +174,18 @@ const payment = sqliteTable(
172
174
  debtor: text("debtor", { mode: "json" }).$type().notNull(),
173
175
  debtorIban: text("debtor_iban")
174
176
  },
175
- (t) => [unique().on(t.connectorKey, t.bankRefId)]
177
+ (t) => [
178
+ unique().on(t.connectorKey, t.bankRefId),
179
+ index("payment_account_id_idx").on(t.accountId),
180
+ index("payment_account_id_status_idx").on(t.accountId, t.status),
181
+ index("payment_account_id_created_at_idx").on(t.accountId, t.createdAt),
182
+ index("payment_created_at_idx").on(t.createdAt),
183
+ index("payment_payment_request_id_idx").on(t.paymentRequestId),
184
+ index("payment_direction_idx").on(t.direction),
185
+ index("payment_batch_id_idx").on(t.batchId),
186
+ index("payment_creditor_iban_idx").on(t.creditorIban),
187
+ index("payment_debtor_iban_idx").on(t.debtorIban)
188
+ ]
176
189
  );
177
190
  const paymentRelations = relations(payment, ({ one }) => ({
178
191
  batch: one(batch, { fields: [payment.batchId], references: [batch.id] })
@@ -215,9 +228,26 @@ const paymentRequest = sqliteTable(
215
228
  creditor: text("creditor", { mode: "json" }).$type().notNull(),
216
229
  creditorIban: text("creditor_iban"),
217
230
  debtor: text("debtor", { mode: "json" }).$type().notNull(),
218
- debtorIban: text("debtor_iban")
231
+ debtorIban: text("debtor_iban"),
232
+ sendAsSinglePayment: integer("send_as_single_payment", {
233
+ mode: "boolean"
234
+ })
219
235
  },
220
- (t) => [index("payment_request_batch_id_idx").on(t.batchId)]
236
+ (t) => [
237
+ index("payment_request_batch_id_idx").on(t.batchId),
238
+ index("payment_request_account_id_idx").on(t.accountId),
239
+ index("payment_request_creditor_iban_idx").on(t.creditorIban),
240
+ index("payment_request_debtor_iban_idx").on(t.debtorIban),
241
+ index("payment_request_status_idx").on(t.status),
242
+ index("payment_request_created_at_idx").on(t.createdAt),
243
+ index("payment_request_account_status_idx").on(t.accountId, t.status),
244
+ index("payment_request_status_created_at_idx").on(t.status, t.createdAt),
245
+ index("payment_request_account_status_created_at_idx").on(
246
+ t.accountId,
247
+ t.status,
248
+ t.createdAt
249
+ )
250
+ ]
221
251
  );
222
252
  const paymentRequestRelations = relations(paymentRequest, ({ one }) => ({
223
253
  batch: one(batch, {
@@ -1,4 +1,4 @@
1
- import { n as account, p as accountCredentials, q as batch, r as ott, s as payment, t as paymentRelations, u as paymentRequest, v as paymentRequestRelations } from './bank.C4VOdIx1.mjs';
1
+ import { n as account, p as accountCredentials, q as batch, r as ott, s as payment, t as paymentRelations, u as paymentRequest, v as paymentRequestRelations } from './bank.C0UN6luZ.mjs';
2
2
 
3
3
  const schema = {
4
4
  __proto__: null,