@develit-services/bank 0.2.2 → 0.2.4

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 (35) hide show
  1. package/dist/database/schema.cjs +2 -3
  2. package/dist/database/schema.d.cts +6 -3
  3. package/dist/database/schema.d.mts +6 -3
  4. package/dist/database/schema.d.ts +6 -3
  5. package/dist/database/schema.mjs +2 -3
  6. package/dist/export/worker.cjs +39 -46
  7. package/dist/export/worker.d.cts +25 -15
  8. package/dist/export/worker.d.mts +25 -15
  9. package/dist/export/worker.d.ts +25 -15
  10. package/dist/export/worker.mjs +35 -42
  11. package/dist/export/workflows.cjs +92 -94
  12. package/dist/export/workflows.mjs +92 -94
  13. package/dist/export/wrangler.cjs +1 -0
  14. package/dist/export/wrangler.d.cts +1 -0
  15. package/dist/export/wrangler.d.mts +1 -0
  16. package/dist/export/wrangler.d.ts +1 -0
  17. package/dist/export/wrangler.mjs +1 -0
  18. package/dist/shared/{bank.CXUMEJH4.mjs → bank.BvUtf1S3.mjs} +41 -20
  19. package/dist/shared/{bank.CEraaQIT.cjs → bank.CHS79KTx.cjs} +42 -21
  20. package/dist/shared/{bank.2BgwPCw_.d.ts → bank.Cfz44GPA.d.cts} +1598 -12
  21. package/dist/shared/{bank.BOe_Qmuw.d.mts → bank.Cfz44GPA.d.mts} +1598 -12
  22. package/dist/shared/{bank.RD4xwHFf.d.cts → bank.Cfz44GPA.d.ts} +1598 -12
  23. package/dist/shared/{bank.B8QzFnJl.cjs → bank.CyinOg3r.cjs} +1 -1
  24. package/dist/shared/{bank.CjZRgRoJ.mjs → bank.DKtu6cfY.mjs} +1 -1
  25. package/dist/shared/{bank.B0uSWeRe.mjs → bank.DXn9jD0Q.mjs} +43 -60
  26. package/dist/shared/{bank.CWAToo_g.cjs → bank.NdqOkgpd.cjs} +41 -59
  27. package/dist/types.cjs +2 -4
  28. package/dist/types.d.cts +3 -5
  29. package/dist/types.d.mts +3 -5
  30. package/dist/types.d.ts +3 -5
  31. package/dist/types.mjs +2 -3
  32. package/package.json +2 -1
  33. package/dist/shared/bank.BGZYksmV.d.cts +0 -1598
  34. package/dist/shared/bank.BGZYksmV.d.mts +0 -1598
  35. package/dist/shared/bank.BGZYksmV.d.ts +0 -1598
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const database_schema = require('./bank.CWAToo_g.cjs');
3
+ const database_schema = require('./bank.NdqOkgpd.cjs');
4
4
 
5
5
  class MockCobsConnector extends database_schema.FinbricksConnector {
6
6
  constructor(config) {
@@ -1,4 +1,4 @@
1
- import { F as FinbricksConnector } from './bank.B0uSWeRe.mjs';
1
+ import { F as FinbricksConnector } from './bank.DXn9jD0Q.mjs';
2
2
 
3
3
  class MockCobsConnector extends FinbricksConnector {
4
4
  constructor(config) {
@@ -1,10 +1,9 @@
1
1
  import { uuidv4, useResult, createInternalError, bankAccount, base } from '@develit-io/backend-sdk';
2
- import { sqliteTable, integer, text, unique, real } from 'drizzle-orm/sqlite-core';
2
+ import { sqliteTable, text, integer, unique, real } from 'drizzle-orm/sqlite-core';
3
3
  import { format, parseISO } from 'date-fns';
4
4
  import { and, eq } from 'drizzle-orm';
5
- import { COUNTRY_CODES_2, CURRENCY_CODES, BANK_CODES } from '@develit-io/general-codes';
6
- import { z } from 'zod';
7
5
  import { importPKCS8, SignJWT } from 'jose';
6
+ import { COUNTRY_CODES_2, BANK_CODES } from '@develit-io/general-codes';
8
7
  import { createInsertSchema, createUpdateSchema, createSelectSchema } from 'drizzle-zod';
9
8
  import { relations } from 'drizzle-orm/relations';
10
9
 
@@ -204,7 +203,7 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
204
203
  //TODO(kleinpetr): use real correlationId once available
205
204
  connectorKey: account.connectorKey,
206
205
  accountId: account.id,
207
- bankRefId: tx.fbxReference || tx.entryReference,
206
+ bankRefId: tx.fbxReference,
208
207
  amount: tx.amount?.value || 0,
209
208
  currency: tx.amount?.currency || "CZK",
210
209
  paymentType: "DOMESTIC",
@@ -308,7 +307,6 @@ class FinbricksConnector extends IBankConnector {
308
307
  id: uuidv4()
309
308
  })
310
309
  );
311
- console.log(accounts, "accs finbricks");
312
310
  const credentials = accounts.map((acc) => ({
313
311
  connectorKey: this.PROVIDER,
314
312
  expiresAt: new Date(Date.now() + 36e5),
@@ -428,11 +426,10 @@ class FinbricksConnector extends IBankConnector {
428
426
  }));
429
427
  }
430
428
  async preparePayment(payment) {
431
- const bankRefId = uuidv4();
432
429
  return {
433
430
  ...payment,
434
431
  id: uuidv4(),
435
- bankRefId,
432
+ bankRefId: "TO_BE_ASSIGNED",
436
433
  direction: "OUTGOING",
437
434
  paymentType: "DOMESTIC",
438
435
  status: "PREPARED",
@@ -843,7 +840,7 @@ class ErsteConnector extends IBankConnector {
843
840
  return {
844
841
  ...payment,
845
842
  id: uuidv4(),
846
- bankRefId: erstePayment.signInfo?.signId,
843
+ bankRefId: erstePayment.signInfo.signId,
847
844
  refId: payment.refId,
848
845
  direction: "OUTGOING",
849
846
  paymentType: "DOMESTIC",
@@ -1136,27 +1133,6 @@ const BATCH_STATUSES = [
1136
1133
  const ACCOUNT_STATUSES = ["AUTHORIZED", "DISABLED", "EXPIRED"];
1137
1134
  const COUNTRY_CODES = COUNTRY_CODES_2;
1138
1135
 
1139
- const paymentInsertTypeZod = z.object({
1140
- refId: z.string(),
1141
- bankRefId: z.string(),
1142
- amount: z.number(),
1143
- direction: z.enum(PAYMENT_DIRECTIONS),
1144
- paymentType: z.enum(PAYMENT_TYPES),
1145
- currency: z.enum(CURRENCY_CODES),
1146
- status: z.enum(PAYMENT_STATUSES),
1147
- batchId: z.string(),
1148
- bankPaymentInitiatedAt: z.coerce.date(),
1149
- bankPaymentProcessedAt: z.coerce.date(),
1150
- bankingVs: z.string().max(10),
1151
- bankingSs: z.string().max(10),
1152
- bankingKs: z.string().max(10),
1153
- message: z.string(),
1154
- creditorIban: z.string().max(34),
1155
- creditorHolderName: z.string(),
1156
- debtorIban: z.string().max(34),
1157
- debtorHolderName: z.string().nullable()
1158
- });
1159
-
1160
1136
  const CONNECTOR_KEYS = [
1161
1137
  "ERSTE",
1162
1138
  "FINBRICKS",
@@ -1189,7 +1165,10 @@ const account = sqliteTable(
1189
1165
  bankRefId: text("bank_ref_id").notNull(),
1190
1166
  batchSizeLimit: integer("batch_size_limit").notNull().default(50),
1191
1167
  syncIntervalS: integer("sync_interval_s").notNull().default(600),
1192
- lastSyncedAt: integer("last_synced_at", { mode: "timestamp_ms" })
1168
+ lastSyncAt: integer("last_sync_at", { mode: "timestamp_ms" }),
1169
+ lastSyncMetadata: text("last_sync_metadata", {
1170
+ mode: "json"
1171
+ }).$type()
1193
1172
  },
1194
1173
  (t) => [unique().on(t.iban)]
1195
1174
  );
@@ -1239,35 +1218,39 @@ const batch = sqliteTable("batch", {
1239
1218
  metadata: text("metadata", { mode: "json" }).$type()
1240
1219
  });
1241
1220
 
1242
- const payment = sqliteTable("payment", {
1243
- ...base,
1244
- correlationId: text("correlation_id").notNull(),
1245
- refId: text("ref_id"),
1246
- bankRefId: text("bank_ref_id"),
1247
- accountId: text("account_id").references(() => account.id).notNull(),
1248
- connectorKey: text("connector_key", { enum: CONNECTOR_KEYS }).$type().notNull(),
1249
- amount: real("amount").notNull(),
1250
- direction: text("direction").$type().notNull(),
1251
- paymentType: text("payment_type").$type().notNull(),
1252
- currency: text("currency").$type().notNull(),
1253
- status: text("status").$type().notNull(),
1254
- statusReason: text("status_reason"),
1255
- batchId: text("bank_execution_batch_id"),
1256
- initiatedAt: integer("initiated_at", {
1257
- mode: "timestamp_ms"
1258
- }),
1259
- vs: text("vs"),
1260
- ss: text("ss"),
1261
- ks: text("ks"),
1262
- message: text("message"),
1263
- processedAt: integer("processed_at", {
1264
- mode: "timestamp_ms"
1265
- }),
1266
- creditor: text("creditor", { mode: "json" }).$type().notNull(),
1267
- creditorIban: text("creditor_iban"),
1268
- debtor: text("debtor", { mode: "json" }).$type().notNull(),
1269
- debtorIban: text("debtor_iban")
1270
- });
1221
+ const payment = sqliteTable(
1222
+ "payment",
1223
+ {
1224
+ ...base,
1225
+ correlationId: text("correlation_id").notNull(),
1226
+ refId: text("ref_id"),
1227
+ bankRefId: text("bank_ref_id").notNull(),
1228
+ accountId: text("account_id").references(() => account.id).notNull(),
1229
+ connectorKey: text("connector_key", { enum: CONNECTOR_KEYS }).$type().notNull(),
1230
+ amount: real("amount").notNull(),
1231
+ direction: text("direction").$type().notNull(),
1232
+ paymentType: text("payment_type").$type().notNull(),
1233
+ currency: text("currency").$type().notNull(),
1234
+ status: text("status").$type().notNull(),
1235
+ statusReason: text("status_reason"),
1236
+ batchId: text("bank_execution_batch_id"),
1237
+ initiatedAt: integer("initiated_at", {
1238
+ mode: "timestamp_ms"
1239
+ }),
1240
+ vs: text("vs"),
1241
+ ss: text("ss"),
1242
+ ks: text("ks"),
1243
+ message: text("message"),
1244
+ processedAt: integer("processed_at", {
1245
+ mode: "timestamp_ms"
1246
+ }),
1247
+ creditor: text("creditor", { mode: "json" }).$type().notNull(),
1248
+ creditorIban: text("creditor_iban"),
1249
+ debtor: text("debtor", { mode: "json" }).$type().notNull(),
1250
+ debtorIban: text("debtor_iban")
1251
+ },
1252
+ (t) => [unique().on(t.connectorKey, t.bankRefId)]
1253
+ );
1271
1254
  const paymentRelations = relations(payment, ({ one }) => ({
1272
1255
  batch: one(batch, { fields: [payment.batchId], references: [batch.id] })
1273
1256
  }));
@@ -1284,4 +1267,4 @@ const schema = {
1284
1267
 
1285
1268
  const tables = schema;
1286
1269
 
1287
- export { ACCOUNT_STATUSES as A, BATCH_STATUSES as B, CHARGE_BEARERS as C, accountCredentials as D, ErsteConnector as E, FinbricksConnector as F, IBankConnector as I, MockConnector as M, PAYMENT_TYPES as P, TOKEN_TYPES as T, FinbricksClient as a, FINBRICKS_ENDPOINTS as b, INSTRUCTION_PRIORITIES as c, PAYMENT_STATUSES as d, PAYMENT_DIRECTIONS as e, COUNTRY_CODES as f, CONNECTOR_KEYS as g, CREDENTIALS_TYPES as h, accountInsertSchema as i, accountUpdateSchema as j, accountSelectSchema as k, accountCredentialsInsertSchema as l, accountCredentialsUpdateSchema as m, accountCredentialsSelectSchema as n, ottInsertSchema as o, paymentInsertTypeZod as p, ottUpdateSchema as q, ottSelectSchema as r, signFinbricksJws as s, tables as t, useFinbricksFetch as u, batch as v, payment as w, paymentRelations as x, ott as y, account as z };
1270
+ export { ACCOUNT_STATUSES as A, BATCH_STATUSES as B, CHARGE_BEARERS as C, ErsteConnector as E, FinbricksConnector as F, IBankConnector as I, MockConnector as M, PAYMENT_TYPES as P, TOKEN_TYPES as T, FinbricksClient as a, FINBRICKS_ENDPOINTS as b, INSTRUCTION_PRIORITIES as c, PAYMENT_STATUSES as d, PAYMENT_DIRECTIONS as e, COUNTRY_CODES as f, CONNECTOR_KEYS as g, CREDENTIALS_TYPES as h, accountInsertSchema as i, accountUpdateSchema as j, accountSelectSchema as k, accountCredentialsInsertSchema as l, accountCredentialsUpdateSchema as m, accountCredentialsSelectSchema as n, ottInsertSchema as o, ottUpdateSchema as p, ottSelectSchema as q, batch as r, signFinbricksJws as s, tables as t, useFinbricksFetch as u, payment as v, paymentRelations as w, ott as x, account as y, accountCredentials as z };
@@ -4,9 +4,8 @@ const backendSdk = require('@develit-io/backend-sdk');
4
4
  const sqliteCore = require('drizzle-orm/sqlite-core');
5
5
  const dateFns = require('date-fns');
6
6
  const drizzleOrm = require('drizzle-orm');
7
- const generalCodes = require('@develit-io/general-codes');
8
- const zod = require('zod');
9
7
  const jose = require('jose');
8
+ const generalCodes = require('@develit-io/general-codes');
10
9
  const drizzleZod = require('drizzle-zod');
11
10
  const relations = require('drizzle-orm/relations');
12
11
 
@@ -206,7 +205,7 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
206
205
  //TODO(kleinpetr): use real correlationId once available
207
206
  connectorKey: account.connectorKey,
208
207
  accountId: account.id,
209
- bankRefId: tx.fbxReference || tx.entryReference,
208
+ bankRefId: tx.fbxReference,
210
209
  amount: tx.amount?.value || 0,
211
210
  currency: tx.amount?.currency || "CZK",
212
211
  paymentType: "DOMESTIC",
@@ -310,7 +309,6 @@ class FinbricksConnector extends IBankConnector {
310
309
  id: backendSdk.uuidv4()
311
310
  })
312
311
  );
313
- console.log(accounts, "accs finbricks");
314
312
  const credentials = accounts.map((acc) => ({
315
313
  connectorKey: this.PROVIDER,
316
314
  expiresAt: new Date(Date.now() + 36e5),
@@ -430,11 +428,10 @@ class FinbricksConnector extends IBankConnector {
430
428
  }));
431
429
  }
432
430
  async preparePayment(payment) {
433
- const bankRefId = backendSdk.uuidv4();
434
431
  return {
435
432
  ...payment,
436
433
  id: backendSdk.uuidv4(),
437
- bankRefId,
434
+ bankRefId: "TO_BE_ASSIGNED",
438
435
  direction: "OUTGOING",
439
436
  paymentType: "DOMESTIC",
440
437
  status: "PREPARED",
@@ -845,7 +842,7 @@ class ErsteConnector extends IBankConnector {
845
842
  return {
846
843
  ...payment,
847
844
  id: backendSdk.uuidv4(),
848
- bankRefId: erstePayment.signInfo?.signId,
845
+ bankRefId: erstePayment.signInfo.signId,
849
846
  refId: payment.refId,
850
847
  direction: "OUTGOING",
851
848
  paymentType: "DOMESTIC",
@@ -1138,27 +1135,6 @@ const BATCH_STATUSES = [
1138
1135
  const ACCOUNT_STATUSES = ["AUTHORIZED", "DISABLED", "EXPIRED"];
1139
1136
  const COUNTRY_CODES = generalCodes.COUNTRY_CODES_2;
1140
1137
 
1141
- const paymentInsertTypeZod = zod.z.object({
1142
- refId: zod.z.string(),
1143
- bankRefId: zod.z.string(),
1144
- amount: zod.z.number(),
1145
- direction: zod.z.enum(PAYMENT_DIRECTIONS),
1146
- paymentType: zod.z.enum(PAYMENT_TYPES),
1147
- currency: zod.z.enum(generalCodes.CURRENCY_CODES),
1148
- status: zod.z.enum(PAYMENT_STATUSES),
1149
- batchId: zod.z.string(),
1150
- bankPaymentInitiatedAt: zod.z.coerce.date(),
1151
- bankPaymentProcessedAt: zod.z.coerce.date(),
1152
- bankingVs: zod.z.string().max(10),
1153
- bankingSs: zod.z.string().max(10),
1154
- bankingKs: zod.z.string().max(10),
1155
- message: zod.z.string(),
1156
- creditorIban: zod.z.string().max(34),
1157
- creditorHolderName: zod.z.string(),
1158
- debtorIban: zod.z.string().max(34),
1159
- debtorHolderName: zod.z.string().nullable()
1160
- });
1161
-
1162
1138
  const CONNECTOR_KEYS = [
1163
1139
  "ERSTE",
1164
1140
  "FINBRICKS",
@@ -1191,7 +1167,10 @@ const account = sqliteCore.sqliteTable(
1191
1167
  bankRefId: sqliteCore.text("bank_ref_id").notNull(),
1192
1168
  batchSizeLimit: sqliteCore.integer("batch_size_limit").notNull().default(50),
1193
1169
  syncIntervalS: sqliteCore.integer("sync_interval_s").notNull().default(600),
1194
- lastSyncedAt: sqliteCore.integer("last_synced_at", { mode: "timestamp_ms" })
1170
+ lastSyncAt: sqliteCore.integer("last_sync_at", { mode: "timestamp_ms" }),
1171
+ lastSyncMetadata: sqliteCore.text("last_sync_metadata", {
1172
+ mode: "json"
1173
+ }).$type()
1195
1174
  },
1196
1175
  (t) => [sqliteCore.unique().on(t.iban)]
1197
1176
  );
@@ -1241,35 +1220,39 @@ const batch = sqliteCore.sqliteTable("batch", {
1241
1220
  metadata: sqliteCore.text("metadata", { mode: "json" }).$type()
1242
1221
  });
1243
1222
 
1244
- const payment = sqliteCore.sqliteTable("payment", {
1245
- ...backendSdk.base,
1246
- correlationId: sqliteCore.text("correlation_id").notNull(),
1247
- refId: sqliteCore.text("ref_id"),
1248
- bankRefId: sqliteCore.text("bank_ref_id"),
1249
- accountId: sqliteCore.text("account_id").references(() => account.id).notNull(),
1250
- connectorKey: sqliteCore.text("connector_key", { enum: CONNECTOR_KEYS }).$type().notNull(),
1251
- amount: sqliteCore.real("amount").notNull(),
1252
- direction: sqliteCore.text("direction").$type().notNull(),
1253
- paymentType: sqliteCore.text("payment_type").$type().notNull(),
1254
- currency: sqliteCore.text("currency").$type().notNull(),
1255
- status: sqliteCore.text("status").$type().notNull(),
1256
- statusReason: sqliteCore.text("status_reason"),
1257
- batchId: sqliteCore.text("bank_execution_batch_id"),
1258
- initiatedAt: sqliteCore.integer("initiated_at", {
1259
- mode: "timestamp_ms"
1260
- }),
1261
- vs: sqliteCore.text("vs"),
1262
- ss: sqliteCore.text("ss"),
1263
- ks: sqliteCore.text("ks"),
1264
- message: sqliteCore.text("message"),
1265
- processedAt: sqliteCore.integer("processed_at", {
1266
- mode: "timestamp_ms"
1267
- }),
1268
- creditor: sqliteCore.text("creditor", { mode: "json" }).$type().notNull(),
1269
- creditorIban: sqliteCore.text("creditor_iban"),
1270
- debtor: sqliteCore.text("debtor", { mode: "json" }).$type().notNull(),
1271
- debtorIban: sqliteCore.text("debtor_iban")
1272
- });
1223
+ const payment = sqliteCore.sqliteTable(
1224
+ "payment",
1225
+ {
1226
+ ...backendSdk.base,
1227
+ correlationId: sqliteCore.text("correlation_id").notNull(),
1228
+ refId: sqliteCore.text("ref_id"),
1229
+ bankRefId: sqliteCore.text("bank_ref_id").notNull(),
1230
+ accountId: sqliteCore.text("account_id").references(() => account.id).notNull(),
1231
+ connectorKey: sqliteCore.text("connector_key", { enum: CONNECTOR_KEYS }).$type().notNull(),
1232
+ amount: sqliteCore.real("amount").notNull(),
1233
+ direction: sqliteCore.text("direction").$type().notNull(),
1234
+ paymentType: sqliteCore.text("payment_type").$type().notNull(),
1235
+ currency: sqliteCore.text("currency").$type().notNull(),
1236
+ status: sqliteCore.text("status").$type().notNull(),
1237
+ statusReason: sqliteCore.text("status_reason"),
1238
+ batchId: sqliteCore.text("bank_execution_batch_id"),
1239
+ initiatedAt: sqliteCore.integer("initiated_at", {
1240
+ mode: "timestamp_ms"
1241
+ }),
1242
+ vs: sqliteCore.text("vs"),
1243
+ ss: sqliteCore.text("ss"),
1244
+ ks: sqliteCore.text("ks"),
1245
+ message: sqliteCore.text("message"),
1246
+ processedAt: sqliteCore.integer("processed_at", {
1247
+ mode: "timestamp_ms"
1248
+ }),
1249
+ creditor: sqliteCore.text("creditor", { mode: "json" }).$type().notNull(),
1250
+ creditorIban: sqliteCore.text("creditor_iban"),
1251
+ debtor: sqliteCore.text("debtor", { mode: "json" }).$type().notNull(),
1252
+ debtorIban: sqliteCore.text("debtor_iban")
1253
+ },
1254
+ (t) => [sqliteCore.unique().on(t.connectorKey, t.bankRefId)]
1255
+ );
1273
1256
  const paymentRelations = relations.relations(payment, ({ one }) => ({
1274
1257
  batch: one(batch, { fields: [payment.batchId], references: [batch.id] })
1275
1258
  }));
@@ -1317,7 +1300,6 @@ exports.ottInsertSchema = ottInsertSchema;
1317
1300
  exports.ottSelectSchema = ottSelectSchema;
1318
1301
  exports.ottUpdateSchema = ottUpdateSchema;
1319
1302
  exports.payment = payment;
1320
- exports.paymentInsertTypeZod = paymentInsertTypeZod;
1321
1303
  exports.paymentRelations = paymentRelations;
1322
1304
  exports.signFinbricksJws = signFinbricksJws;
1323
1305
  exports.tables = tables;
package/dist/types.cjs CHANGED
@@ -1,13 +1,12 @@
1
1
  'use strict';
2
2
 
3
- const database_schema = require('./shared/bank.CWAToo_g.cjs');
4
- const mockCobs_connector = require('./shared/bank.B8QzFnJl.cjs');
3
+ const database_schema = require('./shared/bank.NdqOkgpd.cjs');
4
+ const mockCobs_connector = require('./shared/bank.CyinOg3r.cjs');
5
5
  const generalCodes = require('@develit-io/general-codes');
6
6
  require('@develit-io/backend-sdk');
7
7
  require('drizzle-orm/sqlite-core');
8
8
  require('date-fns');
9
9
  require('drizzle-orm');
10
- require('zod');
11
10
  require('jose');
12
11
  require('drizzle-zod');
13
12
  require('drizzle-orm/relations');
@@ -41,7 +40,6 @@ exports.accountUpdateSchema = database_schema.accountUpdateSchema;
41
40
  exports.ottInsertSchema = database_schema.ottInsertSchema;
42
41
  exports.ottSelectSchema = database_schema.ottSelectSchema;
43
42
  exports.ottUpdateSchema = database_schema.ottUpdateSchema;
44
- exports.paymentInsertTypeZod = database_schema.paymentInsertTypeZod;
45
43
  exports.signFinbricksJws = database_schema.signFinbricksJws;
46
44
  exports.useFinbricksFetch = database_schema.useFinbricksFetch;
47
45
  exports.MockCobsConnector = mockCobs_connector.MockCobsConnector;
package/dist/types.d.cts CHANGED
@@ -1,7 +1,5 @@
1
- import { I as IBankConnector, b as IncomingPaymentMessage, c as InitiatedPayment, a as ConnectorKey, d as ConnectedAccount, e as AccountCredentialsInsertType, f as AccountInsertType, P as PaymentPreparedInsertType, g as InitiatedBatch, B as BatchMetadata, A as AccountSelectType, h as PaymentStatus, i as BatchStatus, j as CurrencyCode, k as BankCode, l as CountryCode, m as AuthInput, n as Currency } from './shared/bank.RD4xwHFf.cjs';
2
- export { D as ACCOUNT_STATUSES, Y as AccountCredentialsPatchType, Z as AccountCredentialsSelectType, X as AccountCredentialsUpdateType, S as AccountPatchType, E as AccountStatus, R as AccountUpdateType, q as BATCH_STATUES, q as BATCH_STATUSES, G as BankAccountWithLastSync, t as CHARGE_BEARERS, H as CONNECTOR_KEYS, F as COUNTRY_CODES, J as CREDENTIALS_TYPES, u as ChargeBearer, C as ConfigEnvironmentBank, K as CredentialsType, v as INSTRUCTION_PRIORITIES, w as InstructionPriority, O as OutgoingPaymentMessage, y as PAYMENT_DIRECTIONS, x as PAYMENT_STATUSES, r as PAYMENT_TYPES, z as PaymentDirection, o as PaymentFailedInsertType, s as PaymentType, T as TOKEN_TYPES, L as TokenType, U as accountCredentialsInsertSchema, W as accountCredentialsSelectSchema, V as accountCredentialsUpdateSchema, M as accountInsertSchema, Q as accountSelectSchema, N as accountUpdateSchema, p as paymentInitializedInsertType } from './shared/bank.RD4xwHFf.cjs';
3
- import { b as ParsedBankPayment, t as tables, P as PaymentSelectType } from './shared/bank.BGZYksmV.cjs';
4
- export { c as BatchInsertType, B as BatchSelectType, a as PaymentInsertType, p as paymentInsertTypeZod } from './shared/bank.BGZYksmV.cjs';
1
+ import { I as IBankConnector, c as IncomingPaymentMessage, d as InitiatedPayment, a as ConnectorKey, e as ConnectedAccount, f as AccountCredentialsInsertType, g as AccountInsertType, h as PaymentPreparedInsertType, i as InitiatedBatch, j as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.Cfz44GPA.cjs';
2
+ export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema, u as paymentInitializedInsertType } from './shared/bank.Cfz44GPA.cjs';
5
3
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
6
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
7
5
  export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.BchnXQDL.cjs';
@@ -282,7 +280,7 @@ type FinbricksAddress = {
282
280
  adressLine: string;
283
281
  };
284
282
  type FinbricksTransaction = {
285
- fbxReference: string | null;
283
+ fbxReference: string;
286
284
  entryReference: string;
287
285
  amount: FinbricksAmount;
288
286
  creditDebitIndicator: 'CRDT' | 'DBIT';
package/dist/types.d.mts CHANGED
@@ -1,7 +1,5 @@
1
- import { I as IBankConnector, b as IncomingPaymentMessage, c as InitiatedPayment, a as ConnectorKey, d as ConnectedAccount, e as AccountCredentialsInsertType, f as AccountInsertType, P as PaymentPreparedInsertType, g as InitiatedBatch, B as BatchMetadata, A as AccountSelectType, h as PaymentStatus, i as BatchStatus, j as CurrencyCode, k as BankCode, l as CountryCode, m as AuthInput, n as Currency } from './shared/bank.BOe_Qmuw.mjs';
2
- export { D as ACCOUNT_STATUSES, Y as AccountCredentialsPatchType, Z as AccountCredentialsSelectType, X as AccountCredentialsUpdateType, S as AccountPatchType, E as AccountStatus, R as AccountUpdateType, q as BATCH_STATUES, q as BATCH_STATUSES, G as BankAccountWithLastSync, t as CHARGE_BEARERS, H as CONNECTOR_KEYS, F as COUNTRY_CODES, J as CREDENTIALS_TYPES, u as ChargeBearer, C as ConfigEnvironmentBank, K as CredentialsType, v as INSTRUCTION_PRIORITIES, w as InstructionPriority, O as OutgoingPaymentMessage, y as PAYMENT_DIRECTIONS, x as PAYMENT_STATUSES, r as PAYMENT_TYPES, z as PaymentDirection, o as PaymentFailedInsertType, s as PaymentType, T as TOKEN_TYPES, L as TokenType, U as accountCredentialsInsertSchema, W as accountCredentialsSelectSchema, V as accountCredentialsUpdateSchema, M as accountInsertSchema, Q as accountSelectSchema, N as accountUpdateSchema, p as paymentInitializedInsertType } from './shared/bank.BOe_Qmuw.mjs';
3
- import { b as ParsedBankPayment, t as tables, P as PaymentSelectType } from './shared/bank.BGZYksmV.mjs';
4
- export { c as BatchInsertType, B as BatchSelectType, a as PaymentInsertType, p as paymentInsertTypeZod } from './shared/bank.BGZYksmV.mjs';
1
+ import { I as IBankConnector, c as IncomingPaymentMessage, d as InitiatedPayment, a as ConnectorKey, e as ConnectedAccount, f as AccountCredentialsInsertType, g as AccountInsertType, h as PaymentPreparedInsertType, i as InitiatedBatch, j as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.Cfz44GPA.mjs';
2
+ export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema, u as paymentInitializedInsertType } from './shared/bank.Cfz44GPA.mjs';
5
3
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
6
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
7
5
  export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.BchnXQDL.mjs';
@@ -282,7 +280,7 @@ type FinbricksAddress = {
282
280
  adressLine: string;
283
281
  };
284
282
  type FinbricksTransaction = {
285
- fbxReference: string | null;
283
+ fbxReference: string;
286
284
  entryReference: string;
287
285
  amount: FinbricksAmount;
288
286
  creditDebitIndicator: 'CRDT' | 'DBIT';
package/dist/types.d.ts CHANGED
@@ -1,7 +1,5 @@
1
- import { I as IBankConnector, b as IncomingPaymentMessage, c as InitiatedPayment, a as ConnectorKey, d as ConnectedAccount, e as AccountCredentialsInsertType, f as AccountInsertType, P as PaymentPreparedInsertType, g as InitiatedBatch, B as BatchMetadata, A as AccountSelectType, h as PaymentStatus, i as BatchStatus, j as CurrencyCode, k as BankCode, l as CountryCode, m as AuthInput, n as Currency } from './shared/bank.2BgwPCw_.js';
2
- export { D as ACCOUNT_STATUSES, Y as AccountCredentialsPatchType, Z as AccountCredentialsSelectType, X as AccountCredentialsUpdateType, S as AccountPatchType, E as AccountStatus, R as AccountUpdateType, q as BATCH_STATUES, q as BATCH_STATUSES, G as BankAccountWithLastSync, t as CHARGE_BEARERS, H as CONNECTOR_KEYS, F as COUNTRY_CODES, J as CREDENTIALS_TYPES, u as ChargeBearer, C as ConfigEnvironmentBank, K as CredentialsType, v as INSTRUCTION_PRIORITIES, w as InstructionPriority, O as OutgoingPaymentMessage, y as PAYMENT_DIRECTIONS, x as PAYMENT_STATUSES, r as PAYMENT_TYPES, z as PaymentDirection, o as PaymentFailedInsertType, s as PaymentType, T as TOKEN_TYPES, L as TokenType, U as accountCredentialsInsertSchema, W as accountCredentialsSelectSchema, V as accountCredentialsUpdateSchema, M as accountInsertSchema, Q as accountSelectSchema, N as accountUpdateSchema, p as paymentInitializedInsertType } from './shared/bank.2BgwPCw_.js';
3
- import { b as ParsedBankPayment, t as tables, P as PaymentSelectType } from './shared/bank.BGZYksmV.js';
4
- export { c as BatchInsertType, B as BatchSelectType, a as PaymentInsertType, p as paymentInsertTypeZod } from './shared/bank.BGZYksmV.js';
1
+ import { I as IBankConnector, c as IncomingPaymentMessage, d as InitiatedPayment, a as ConnectorKey, e as ConnectedAccount, f as AccountCredentialsInsertType, g as AccountInsertType, h as PaymentPreparedInsertType, i as InitiatedBatch, j as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.Cfz44GPA.js';
2
+ export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema, u as paymentInitializedInsertType } from './shared/bank.Cfz44GPA.js';
5
3
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
6
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
7
5
  export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.BchnXQDL.js';
@@ -282,7 +280,7 @@ type FinbricksAddress = {
282
280
  adressLine: string;
283
281
  };
284
282
  type FinbricksTransaction = {
285
- fbxReference: string | null;
283
+ fbxReference: string;
286
284
  entryReference: string;
287
285
  amount: FinbricksAmount;
288
286
  creditDebitIndicator: 'CRDT' | 'DBIT';
package/dist/types.mjs CHANGED
@@ -1,11 +1,10 @@
1
- export { A as ACCOUNT_STATUSES, B as BATCH_STATUES, B as BATCH_STATUSES, C as CHARGE_BEARERS, g as CONNECTOR_KEYS, f as COUNTRY_CODES, h as CREDENTIALS_TYPES, E as ErsteConnector, b as FINBRICKS_ENDPOINTS, a as FinbricksClient, F as FinbricksConnector, I as IBankConnector, c as INSTRUCTION_PRIORITIES, M as MockConnector, e as PAYMENT_DIRECTIONS, d as PAYMENT_STATUSES, P as PAYMENT_TYPES, T as TOKEN_TYPES, l as accountCredentialsInsertSchema, n as accountCredentialsSelectSchema, m as accountCredentialsUpdateSchema, i as accountInsertSchema, k as accountSelectSchema, j as accountUpdateSchema, o as ottInsertSchema, r as ottSelectSchema, q as ottUpdateSchema, p as paymentInsertTypeZod, s as signFinbricksJws, u as useFinbricksFetch } from './shared/bank.B0uSWeRe.mjs';
2
- export { M as MockCobsConnector } from './shared/bank.CjZRgRoJ.mjs';
1
+ export { A as ACCOUNT_STATUSES, B as BATCH_STATUES, B as BATCH_STATUSES, C as CHARGE_BEARERS, g as CONNECTOR_KEYS, f as COUNTRY_CODES, h as CREDENTIALS_TYPES, E as ErsteConnector, b as FINBRICKS_ENDPOINTS, a as FinbricksClient, F as FinbricksConnector, I as IBankConnector, c as INSTRUCTION_PRIORITIES, M as MockConnector, e as PAYMENT_DIRECTIONS, d as PAYMENT_STATUSES, P as PAYMENT_TYPES, T as TOKEN_TYPES, l as accountCredentialsInsertSchema, n as accountCredentialsSelectSchema, m as accountCredentialsUpdateSchema, i as accountInsertSchema, k as accountSelectSchema, j as accountUpdateSchema, o as ottInsertSchema, q as ottSelectSchema, p as ottUpdateSchema, s as signFinbricksJws, u as useFinbricksFetch } from './shared/bank.DXn9jD0Q.mjs';
2
+ export { M as MockCobsConnector } from './shared/bank.DKtu6cfY.mjs';
3
3
  export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
4
4
  import '@develit-io/backend-sdk';
5
5
  import 'drizzle-orm/sqlite-core';
6
6
  import 'date-fns';
7
7
  import 'drizzle-orm';
8
- import 'zod';
9
8
  import 'jose';
10
9
  import 'drizzle-zod';
11
10
  import 'drizzle-orm/relations';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/bank",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -49,6 +49,7 @@
49
49
  "test:cov": "vitest run --coverage",
50
50
  "test:unit": "vitest unit fixtures",
51
51
  "test:int": "vitest integration",
52
+ "test:workflows": "vitest workflows",
52
53
  "build": "unbuild",
53
54
  "changelogen": "bunx changelogen@latest --bump",
54
55
  "release": "bun run build && bunx changelogen@latest --release --push && npm publish --access public"