@develit-services/bank 2.3.0 → 3.0.0

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 (38) hide show
  1. package/dist/database/schema.cjs +1 -10
  2. package/dist/database/schema.d.cts +3 -3
  3. package/dist/database/schema.d.mts +3 -3
  4. package/dist/database/schema.d.ts +3 -3
  5. package/dist/database/schema.mjs +1 -8
  6. package/dist/export/worker.cjs +137 -137
  7. package/dist/export/worker.d.cts +115 -451
  8. package/dist/export/worker.d.mts +115 -451
  9. package/dist/export/worker.d.ts +115 -451
  10. package/dist/export/worker.mjs +40 -40
  11. package/dist/export/workflows.cjs +29 -23
  12. package/dist/export/workflows.mjs +18 -12
  13. package/dist/export/wrangler.cjs +7 -12
  14. package/dist/export/wrangler.d.cts +11 -3
  15. package/dist/export/wrangler.d.mts +11 -3
  16. package/dist/export/wrangler.d.ts +11 -3
  17. package/dist/export/wrangler.mjs +7 -12
  18. package/dist/shared/bank.9Yw4KHyl.cjs +275 -0
  19. package/dist/shared/{bank.CxAHQOwW.d.cts → bank.BanqNaZK.d.cts} +9 -9
  20. package/dist/shared/{bank.BSiA1m0B.mjs → bank.ByesVuDp.mjs} +2 -1
  21. package/dist/shared/bank.BzDNLxB_.mjs +254 -0
  22. package/dist/shared/{bank.gVOunsjq.mjs → bank.CTFqGRuY.mjs} +227 -447
  23. package/dist/shared/{bank.CC4p6Jf-.d.cts → bank.CVCyY-qU.d.cts} +1225 -3788
  24. package/dist/shared/{bank.CC4p6Jf-.d.mts → bank.CVCyY-qU.d.mts} +1225 -3788
  25. package/dist/shared/{bank.CC4p6Jf-.d.ts → bank.CVCyY-qU.d.ts} +1225 -3788
  26. package/dist/shared/{bank.Dl3mNNS2.d.mts → bank.DOlM7clW.d.mts} +9 -9
  27. package/dist/shared/{bank.DICdNw3T.cjs → bank.OSj3Smwv.cjs} +17 -16
  28. package/dist/shared/{bank.C5NCnZWS.d.ts → bank.SoKDxQxH.d.ts} +9 -9
  29. package/dist/shared/{bank.avgw-IRO.cjs → bank.pU2vSCUr.cjs} +234 -474
  30. package/dist/types.cjs +38 -38
  31. package/dist/types.d.cts +57 -450
  32. package/dist/types.d.mts +57 -450
  33. package/dist/types.d.ts +57 -450
  34. package/dist/types.mjs +4 -4
  35. package/package.json +6 -5
  36. package/dist/shared/{bank.Bz4DIxJL.d.cts → bank.C6sLje8B.d.cts} +3 -3
  37. package/dist/shared/{bank.Bz4DIxJL.d.mts → bank.C6sLje8B.d.mts} +3 -3
  38. package/dist/shared/{bank.Bz4DIxJL.d.ts → bank.C6sLje8B.d.ts} +3 -3
@@ -1,4 +1,4 @@
1
- import { e as CurrencyCode, Q as BankCode, a0 as CountryCode, P as PaymentRequestSelectType } from './bank.CC4p6Jf-.mjs';
1
+ import { e as CurrencyCode, Q as BankCode, a0 as CountryCode, P as PaymentRequestSelectType } from './bank.CVCyY-qU.mjs';
2
2
  import { z } from 'zod';
3
3
 
4
4
  type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
@@ -364,7 +364,6 @@ declare const sendPaymentInputSchema: z.ZodObject<{
364
364
  city: z.ZodOptional<z.ZodString>;
365
365
  postalCode: z.ZodOptional<z.ZodString>;
366
366
  countryCode: z.ZodOptional<z.ZodEnum<{
367
- IM: "IM";
368
367
  AF: "AF";
369
368
  AL: "AL";
370
369
  DZ: "DZ";
@@ -453,6 +452,7 @@ declare const sendPaymentInputSchema: z.ZodObject<{
453
452
  IR: "IR";
454
453
  IQ: "IQ";
455
454
  IE: "IE";
455
+ IM: "IM";
456
456
  IL: "IL";
457
457
  IT: "IT";
458
458
  CI: "CI";
@@ -635,7 +635,6 @@ declare const sendPaymentInputSchema: z.ZodObject<{
635
635
  AVAX: "AVAX";
636
636
  }>>;
637
637
  countryCode: z.ZodOptional<z.ZodEnum<{
638
- IM: "IM";
639
638
  AF: "AF";
640
639
  AL: "AL";
641
640
  DZ: "DZ";
@@ -724,6 +723,7 @@ declare const sendPaymentInputSchema: z.ZodObject<{
724
723
  IR: "IR";
725
724
  IQ: "IQ";
726
725
  IE: "IE";
726
+ IM: "IM";
727
727
  IL: "IL";
728
728
  IT: "IT";
729
729
  CI: "CI";
@@ -927,7 +927,6 @@ declare const sendPaymentInputSchema: z.ZodObject<{
927
927
  city: z.ZodOptional<z.ZodString>;
928
928
  postalCode: z.ZodOptional<z.ZodString>;
929
929
  countryCode: z.ZodOptional<z.ZodEnum<{
930
- IM: "IM";
931
930
  AF: "AF";
932
931
  AL: "AL";
933
932
  DZ: "DZ";
@@ -1016,6 +1015,7 @@ declare const sendPaymentInputSchema: z.ZodObject<{
1016
1015
  IR: "IR";
1017
1016
  IQ: "IQ";
1018
1017
  IE: "IE";
1018
+ IM: "IM";
1019
1019
  IL: "IL";
1020
1020
  IT: "IT";
1021
1021
  CI: "CI";
@@ -1198,7 +1198,6 @@ declare const sendPaymentInputSchema: z.ZodObject<{
1198
1198
  AVAX: "AVAX";
1199
1199
  }>>;
1200
1200
  countryCode: z.ZodOptional<z.ZodEnum<{
1201
- IM: "IM";
1202
1201
  AF: "AF";
1203
1202
  AL: "AL";
1204
1203
  DZ: "DZ";
@@ -1287,6 +1286,7 @@ declare const sendPaymentInputSchema: z.ZodObject<{
1287
1286
  IR: "IR";
1288
1287
  IQ: "IQ";
1289
1288
  IE: "IE";
1289
+ IM: "IM";
1290
1290
  IL: "IL";
1291
1291
  IT: "IT";
1292
1292
  CI: "CI";
@@ -1578,7 +1578,6 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1578
1578
  city: z.ZodOptional<z.ZodString>;
1579
1579
  postalCode: z.ZodOptional<z.ZodString>;
1580
1580
  countryCode: z.ZodOptional<z.ZodEnum<{
1581
- IM: "IM";
1582
1581
  AF: "AF";
1583
1582
  AL: "AL";
1584
1583
  DZ: "DZ";
@@ -1667,6 +1666,7 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1667
1666
  IR: "IR";
1668
1667
  IQ: "IQ";
1669
1668
  IE: "IE";
1669
+ IM: "IM";
1670
1670
  IL: "IL";
1671
1671
  IT: "IT";
1672
1672
  CI: "CI";
@@ -1849,7 +1849,6 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1849
1849
  AVAX: "AVAX";
1850
1850
  }>>;
1851
1851
  countryCode: z.ZodOptional<z.ZodEnum<{
1852
- IM: "IM";
1853
1852
  AF: "AF";
1854
1853
  AL: "AL";
1855
1854
  DZ: "DZ";
@@ -1938,6 +1937,7 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1938
1937
  IR: "IR";
1939
1938
  IQ: "IQ";
1940
1939
  IE: "IE";
1940
+ IM: "IM";
1941
1941
  IL: "IL";
1942
1942
  IT: "IT";
1943
1943
  CI: "CI";
@@ -2141,7 +2141,6 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
2141
2141
  city: z.ZodOptional<z.ZodString>;
2142
2142
  postalCode: z.ZodOptional<z.ZodString>;
2143
2143
  countryCode: z.ZodOptional<z.ZodEnum<{
2144
- IM: "IM";
2145
2144
  AF: "AF";
2146
2145
  AL: "AL";
2147
2146
  DZ: "DZ";
@@ -2230,6 +2229,7 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
2230
2229
  IR: "IR";
2231
2230
  IQ: "IQ";
2232
2231
  IE: "IE";
2232
+ IM: "IM";
2233
2233
  IL: "IL";
2234
2234
  IT: "IT";
2235
2235
  CI: "CI";
@@ -2412,7 +2412,6 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
2412
2412
  AVAX: "AVAX";
2413
2413
  }>>;
2414
2414
  countryCode: z.ZodOptional<z.ZodEnum<{
2415
- IM: "IM";
2416
2415
  AF: "AF";
2417
2416
  AL: "AL";
2418
2417
  DZ: "DZ";
@@ -2501,6 +2500,7 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
2501
2500
  IR: "IR";
2502
2501
  IQ: "IQ";
2503
2502
  IE: "IE";
2503
+ IM: "IM";
2504
2504
  IL: "IL";
2505
2505
  IT: "IT";
2506
2506
  CI: "CI";
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  const drizzleOrm = require('drizzle-orm');
4
- const database_schema = require('./bank.avgw-IRO.cjs');
4
+ const ott_zod = require('./bank.pU2vSCUr.cjs');
5
5
  const backendSdk = require('@develit-io/backend-sdk');
6
+ require('./bank.9Yw4KHyl.cjs');
6
7
  require('date-fns');
7
8
  require('jose');
8
9
  require('@develit-io/general-codes');
@@ -10,16 +11,16 @@ const node_crypto = require('node:crypto');
10
11
 
11
12
  const createPaymentCommand = (db, { payment }) => {
12
13
  return {
13
- command: db.insert(database_schema.tables.payment).values({
14
+ command: db.insert(ott_zod.tables.payment).values({
14
15
  ...payment,
15
16
  creditorIban: payment.creditor.iban,
16
17
  debtorIban: payment.debtor.iban
17
18
  }).onConflictDoUpdate({
18
19
  // Unique index: (connector_key, account_id, bank_ref_id)
19
20
  target: [
20
- database_schema.tables.payment.connectorKey,
21
- database_schema.tables.payment.accountId,
22
- database_schema.tables.payment.bankRefId
21
+ ott_zod.tables.payment.connectorKey,
22
+ ott_zod.tables.payment.accountId,
23
+ ott_zod.tables.payment.bankRefId
23
24
  ],
24
25
  set: {
25
26
  status: drizzleOrm.sql`excluded.status`,
@@ -37,11 +38,11 @@ const createPaymentCommand = (db, { payment }) => {
37
38
 
38
39
  const upsertBatchCommand = (db, { batch }) => {
39
40
  const id = batch.id || backendSdk.uuidv4();
40
- const command = db.insert(database_schema.tables.batch).values({
41
+ const command = db.insert(ott_zod.tables.batch).values({
41
42
  ...batch,
42
43
  id
43
44
  }).onConflictDoUpdate({
44
- target: database_schema.tables.batch.id,
45
+ target: ott_zod.tables.batch.id,
45
46
  set: {
46
47
  ...batch
47
48
  }
@@ -55,25 +56,25 @@ const upsertBatchCommand = (db, { batch }) => {
55
56
  const updatePaymentRequestStatusCommand = (db, values) => {
56
57
  const { id, ...set } = values;
57
58
  return {
58
- command: db.update(database_schema.tables.paymentRequest).set(set).where(
59
+ command: db.update(ott_zod.tables.paymentRequest).set(set).where(
59
60
  drizzleOrm.and(
60
- drizzleOrm.eq(database_schema.tables.paymentRequest.id, id),
61
- drizzleOrm.isNull(database_schema.tables.paymentRequest.deletedAt)
61
+ drizzleOrm.eq(ott_zod.tables.paymentRequest.id, id),
62
+ drizzleOrm.isNull(ott_zod.tables.paymentRequest.deletedAt)
62
63
  )
63
64
  ).returning()
64
65
  };
65
66
  };
66
67
 
67
68
  const getAccountByIdQuery = async (db, { accountId }) => {
68
- return await db.select().from(database_schema.tables.account).where(drizzleOrm.eq(database_schema.tables.account.id, accountId)).get();
69
+ return await db.select().from(ott_zod.tables.account).where(drizzleOrm.eq(ott_zod.tables.account.id, accountId)).get();
69
70
  };
70
71
 
71
72
  const getBatchByIdQuery = async (db, { batchId }) => {
72
- return await db.select().from(database_schema.tables.batch).where(drizzleOrm.eq(database_schema.tables.batch.id, batchId)).get();
73
+ return await db.select().from(ott_zod.tables.batch).where(drizzleOrm.eq(ott_zod.tables.batch.id, batchId)).get();
73
74
  };
74
75
 
75
76
  const getCredentialsByAccountId = async (db, encryptionKey, { accountId }) => {
76
- const cred = await db.select().from(database_schema.tables.accountCredentials).where(drizzleOrm.eq(database_schema.tables.accountCredentials.accountId, accountId)).get();
77
+ const cred = await db.select().from(ott_zod.tables.accountCredentials).where(drizzleOrm.eq(ott_zod.tables.accountCredentials.accountId, accountId)).get();
77
78
  return cred ? {
78
79
  ...cred,
79
80
  value: await decrypt(cred.value, encryptionKey)
@@ -81,10 +82,10 @@ const getCredentialsByAccountId = async (db, encryptionKey, { accountId }) => {
81
82
  };
82
83
 
83
84
  const getPaymentRequestsByBatchIdQuery = async (db, { batchId }) => {
84
- return await db.select().from(database_schema.tables.paymentRequest).where(
85
+ return await db.select().from(ott_zod.tables.paymentRequest).where(
85
86
  drizzleOrm.and(
86
- drizzleOrm.eq(database_schema.tables.paymentRequest.batchId, batchId),
87
- drizzleOrm.isNull(database_schema.tables.paymentRequest.deletedAt)
87
+ drizzleOrm.eq(ott_zod.tables.paymentRequest.batchId, batchId),
88
+ drizzleOrm.isNull(ott_zod.tables.paymentRequest.deletedAt)
88
89
  )
89
90
  );
90
91
  };
@@ -1,4 +1,4 @@
1
- import { e as CurrencyCode, Q as BankCode, a0 as CountryCode, P as PaymentRequestSelectType } from './bank.CC4p6Jf-.js';
1
+ import { e as CurrencyCode, Q as BankCode, a0 as CountryCode, P as PaymentRequestSelectType } from './bank.CVCyY-qU.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
@@ -364,7 +364,6 @@ declare const sendPaymentInputSchema: z.ZodObject<{
364
364
  city: z.ZodOptional<z.ZodString>;
365
365
  postalCode: z.ZodOptional<z.ZodString>;
366
366
  countryCode: z.ZodOptional<z.ZodEnum<{
367
- IM: "IM";
368
367
  AF: "AF";
369
368
  AL: "AL";
370
369
  DZ: "DZ";
@@ -453,6 +452,7 @@ declare const sendPaymentInputSchema: z.ZodObject<{
453
452
  IR: "IR";
454
453
  IQ: "IQ";
455
454
  IE: "IE";
455
+ IM: "IM";
456
456
  IL: "IL";
457
457
  IT: "IT";
458
458
  CI: "CI";
@@ -635,7 +635,6 @@ declare const sendPaymentInputSchema: z.ZodObject<{
635
635
  AVAX: "AVAX";
636
636
  }>>;
637
637
  countryCode: z.ZodOptional<z.ZodEnum<{
638
- IM: "IM";
639
638
  AF: "AF";
640
639
  AL: "AL";
641
640
  DZ: "DZ";
@@ -724,6 +723,7 @@ declare const sendPaymentInputSchema: z.ZodObject<{
724
723
  IR: "IR";
725
724
  IQ: "IQ";
726
725
  IE: "IE";
726
+ IM: "IM";
727
727
  IL: "IL";
728
728
  IT: "IT";
729
729
  CI: "CI";
@@ -927,7 +927,6 @@ declare const sendPaymentInputSchema: z.ZodObject<{
927
927
  city: z.ZodOptional<z.ZodString>;
928
928
  postalCode: z.ZodOptional<z.ZodString>;
929
929
  countryCode: z.ZodOptional<z.ZodEnum<{
930
- IM: "IM";
931
930
  AF: "AF";
932
931
  AL: "AL";
933
932
  DZ: "DZ";
@@ -1016,6 +1015,7 @@ declare const sendPaymentInputSchema: z.ZodObject<{
1016
1015
  IR: "IR";
1017
1016
  IQ: "IQ";
1018
1017
  IE: "IE";
1018
+ IM: "IM";
1019
1019
  IL: "IL";
1020
1020
  IT: "IT";
1021
1021
  CI: "CI";
@@ -1198,7 +1198,6 @@ declare const sendPaymentInputSchema: z.ZodObject<{
1198
1198
  AVAX: "AVAX";
1199
1199
  }>>;
1200
1200
  countryCode: z.ZodOptional<z.ZodEnum<{
1201
- IM: "IM";
1202
1201
  AF: "AF";
1203
1202
  AL: "AL";
1204
1203
  DZ: "DZ";
@@ -1287,6 +1286,7 @@ declare const sendPaymentInputSchema: z.ZodObject<{
1287
1286
  IR: "IR";
1288
1287
  IQ: "IQ";
1289
1288
  IE: "IE";
1289
+ IM: "IM";
1290
1290
  IL: "IL";
1291
1291
  IT: "IT";
1292
1292
  CI: "CI";
@@ -1578,7 +1578,6 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1578
1578
  city: z.ZodOptional<z.ZodString>;
1579
1579
  postalCode: z.ZodOptional<z.ZodString>;
1580
1580
  countryCode: z.ZodOptional<z.ZodEnum<{
1581
- IM: "IM";
1582
1581
  AF: "AF";
1583
1582
  AL: "AL";
1584
1583
  DZ: "DZ";
@@ -1667,6 +1666,7 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1667
1666
  IR: "IR";
1668
1667
  IQ: "IQ";
1669
1668
  IE: "IE";
1669
+ IM: "IM";
1670
1670
  IL: "IL";
1671
1671
  IT: "IT";
1672
1672
  CI: "CI";
@@ -1849,7 +1849,6 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1849
1849
  AVAX: "AVAX";
1850
1850
  }>>;
1851
1851
  countryCode: z.ZodOptional<z.ZodEnum<{
1852
- IM: "IM";
1853
1852
  AF: "AF";
1854
1853
  AL: "AL";
1855
1854
  DZ: "DZ";
@@ -1938,6 +1937,7 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
1938
1937
  IR: "IR";
1939
1938
  IQ: "IQ";
1940
1939
  IE: "IE";
1940
+ IM: "IM";
1941
1941
  IL: "IL";
1942
1942
  IT: "IT";
1943
1943
  CI: "CI";
@@ -2141,7 +2141,6 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
2141
2141
  city: z.ZodOptional<z.ZodString>;
2142
2142
  postalCode: z.ZodOptional<z.ZodString>;
2143
2143
  countryCode: z.ZodOptional<z.ZodEnum<{
2144
- IM: "IM";
2145
2144
  AF: "AF";
2146
2145
  AL: "AL";
2147
2146
  DZ: "DZ";
@@ -2230,6 +2229,7 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
2230
2229
  IR: "IR";
2231
2230
  IQ: "IQ";
2232
2231
  IE: "IE";
2232
+ IM: "IM";
2233
2233
  IL: "IL";
2234
2234
  IT: "IT";
2235
2235
  CI: "CI";
@@ -2412,7 +2412,6 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
2412
2412
  AVAX: "AVAX";
2413
2413
  }>>;
2414
2414
  countryCode: z.ZodOptional<z.ZodEnum<{
2415
- IM: "IM";
2416
2415
  AF: "AF";
2417
2416
  AL: "AL";
2418
2417
  DZ: "DZ";
@@ -2501,6 +2500,7 @@ declare const sendPaymentSyncInputSchema: z.ZodObject<{
2501
2500
  IR: "IR";
2502
2501
  IQ: "IQ";
2503
2502
  IE: "IE";
2503
+ IM: "IM";
2504
2504
  IL: "IL";
2505
2505
  IT: "IT";
2506
2506
  CI: "CI";