@develit-services/bank 0.2.0 → 0.2.1

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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const database_schema = require('../shared/bank.DCUsXXjG.cjs');
3
+ const database_schema = require('../shared/bank.NAgd77sr.cjs');
4
4
  require('@develit-io/backend-sdk');
5
5
  require('drizzle-orm/sqlite-core');
6
6
  require('date-fns');
@@ -1,4 +1,4 @@
1
- export { D as account, G as accountCredentials, w as batch, z as ott, x as payment, y as paymentRelations } from '../shared/bank.BTcR2cZW.mjs';
1
+ export { D as account, G as accountCredentials, w as batch, z as ott, x as payment, y as paymentRelations } from '../shared/bank.DdvSjgls.mjs';
2
2
  import '@develit-io/backend-sdk';
3
3
  import 'drizzle-orm/sqlite-core';
4
4
  import 'date-fns';
@@ -3,17 +3,17 @@
3
3
  const backendSdk = require('@develit-io/backend-sdk');
4
4
  const cloudflare_workers = require('cloudflare:workers');
5
5
  const d1 = require('drizzle-orm/d1');
6
- const database_schema = require('../shared/bank.DCUsXXjG.cjs');
6
+ const database_schema = require('../shared/bank.NAgd77sr.cjs');
7
7
  require('jose');
8
8
  const generalCodes = require('@develit-io/general-codes');
9
9
  const zod = require('zod');
10
- const bank = require('../shared/bank.U_QWeuG5.cjs');
10
+ const bank = require('../shared/bank.B5dSMikM.cjs');
11
11
  const drizzleOrm = require('drizzle-orm');
12
12
  require('drizzle-orm/sqlite-core');
13
13
  require('date-fns');
14
14
  require('drizzle-zod');
15
15
  require('drizzle-orm/relations');
16
- require('../shared/bank.Dp5YErpd.cjs');
16
+ require('../shared/bank.DhuHP2ky.cjs');
17
17
 
18
18
  const upsertAccountCommand = (db, { account }) => {
19
19
  const id = account.id || backendSdk.uuidv4();
@@ -1,17 +1,17 @@
1
1
  import { uuidv4, bankAccountMetadataSchema, workflowInstanceStatusSchema, develitWorker, createInternalError, first, action, service } from '@develit-io/backend-sdk';
2
2
  import { WorkerEntrypoint } from 'cloudflare:workers';
3
3
  import { drizzle } from 'drizzle-orm/d1';
4
- import { t as tables, c as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, P as PAYMENT_TYPES, g as CONNECTOR_KEYS, B as BATCH_STATUSES, d as PAYMENT_STATUSES, e as PAYMENT_DIRECTIONS, i as accountInsertSchema, M as MockConnector, F as FinbricksConnector, E as ErsteConnector } from '../shared/bank.BTcR2cZW.mjs';
4
+ import { t as tables, c as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, P as PAYMENT_TYPES, g as CONNECTOR_KEYS, B as BATCH_STATUSES, d as PAYMENT_STATUSES, e as PAYMENT_DIRECTIONS, i as accountInsertSchema, M as MockConnector, F as FinbricksConnector, E as ErsteConnector } from '../shared/bank.DdvSjgls.mjs';
5
5
  import 'jose';
6
6
  import { CURRENCY_CODES } from '@develit-io/general-codes';
7
7
  import { z } from 'zod';
8
- import { g as getCredentialsByAccountId, i as initiateConnector, c as createPaymentCommand, u as updatePaymentCommand, a as updateAccountLastSyncCommand } from '../shared/bank.B6xe3pyX.mjs';
8
+ import { g as getCredentialsByAccountId, i as initiateConnector, c as createPaymentCommand, u as updatePaymentCommand, a as updateAccountLastSyncCommand } from '../shared/bank.CpoWaBu0.mjs';
9
9
  import { eq, inArray, and, sql, asc, desc, gte, lte } from 'drizzle-orm';
10
10
  import 'drizzle-orm/sqlite-core';
11
11
  import 'date-fns';
12
12
  import 'drizzle-zod';
13
13
  import 'drizzle-orm/relations';
14
- import '../shared/bank.BgD9dJ3A.mjs';
14
+ import '../shared/bank.BcDo3cbz.mjs';
15
15
 
16
16
  const upsertAccountCommand = (db, { account }) => {
17
17
  const id = account.id || uuidv4();
@@ -3,9 +3,9 @@
3
3
  const cloudflare_workers = require('cloudflare:workers');
4
4
  const cloudflare_workflows = require('cloudflare:workflows');
5
5
  const d1 = require('drizzle-orm/d1');
6
- const database_schema = require('../shared/bank.DCUsXXjG.cjs');
6
+ const database_schema = require('../shared/bank.NAgd77sr.cjs');
7
7
  const backendSdk = require('@develit-io/backend-sdk');
8
- const bank = require('../shared/bank.U_QWeuG5.cjs');
8
+ const bank = require('../shared/bank.B5dSMikM.cjs');
9
9
  const drizzleOrm = require('drizzle-orm');
10
10
  require('drizzle-orm/sqlite-core');
11
11
  require('date-fns');
@@ -14,7 +14,7 @@ require('zod');
14
14
  require('jose');
15
15
  require('drizzle-zod');
16
16
  require('drizzle-orm/relations');
17
- require('../shared/bank.Dp5YErpd.cjs');
17
+ require('../shared/bank.DhuHP2ky.cjs');
18
18
 
19
19
  const getAccountByIdQuery = async (db, { accountId }) => {
20
20
  return await db.select().from(database_schema.tables.account).where(drizzleOrm.eq(database_schema.tables.account.id, accountId)).get();
@@ -1,9 +1,9 @@
1
1
  import { WorkflowEntrypoint } from 'cloudflare:workers';
2
2
  import { NonRetryableError } from 'cloudflare:workflows';
3
3
  import { drizzle } from 'drizzle-orm/d1';
4
- import { t as tables, v as getPaymentDirection } from '../shared/bank.BTcR2cZW.mjs';
4
+ import { t as tables, v as getPaymentDirection } from '../shared/bank.DdvSjgls.mjs';
5
5
  import { asNonEmpty } from '@develit-io/backend-sdk';
6
- import { g as getCredentialsByAccountId, i as initiateConnector, u as updatePaymentCommand, c as createPaymentCommand, a as updateAccountLastSyncCommand } from '../shared/bank.B6xe3pyX.mjs';
6
+ import { g as getCredentialsByAccountId, i as initiateConnector, u as updatePaymentCommand, c as createPaymentCommand, a as updateAccountLastSyncCommand } from '../shared/bank.CpoWaBu0.mjs';
7
7
  import { eq, inArray } from 'drizzle-orm';
8
8
  import 'drizzle-orm/sqlite-core';
9
9
  import 'date-fns';
@@ -12,7 +12,7 @@ import 'zod';
12
12
  import 'jose';
13
13
  import 'drizzle-zod';
14
14
  import 'drizzle-orm/relations';
15
- import '../shared/bank.BgD9dJ3A.mjs';
15
+ import '../shared/bank.BcDo3cbz.mjs';
16
16
 
17
17
  const getAccountByIdQuery = async (db, { accountId }) => {
18
18
  return await db.select().from(tables.account).where(eq(tables.account.id, accountId)).get();
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const database_schema = require('./bank.DCUsXXjG.cjs');
3
+ const database_schema = require('./bank.NAgd77sr.cjs');
4
4
  const drizzleOrm = require('drizzle-orm');
5
- const mockCobs_connector = require('./bank.Dp5YErpd.cjs');
5
+ const mockCobs_connector = require('./bank.DhuHP2ky.cjs');
6
6
  require('jose');
7
7
  require('@develit-io/general-codes');
8
8
 
@@ -1,4 +1,4 @@
1
- import { F as FinbricksConnector } from './bank.BTcR2cZW.mjs';
1
+ import { F as FinbricksConnector } from './bank.DdvSjgls.mjs';
2
2
 
3
3
  class MockCobsConnector extends FinbricksConnector {
4
4
  constructor(config) {
@@ -1,6 +1,6 @@
1
- import { t as tables, F as FinbricksConnector, M as MockConnector, E as ErsteConnector } from './bank.BTcR2cZW.mjs';
1
+ import { t as tables, F as FinbricksConnector, M as MockConnector, E as ErsteConnector } from './bank.DdvSjgls.mjs';
2
2
  import { eq } from 'drizzle-orm';
3
- import { M as MockCobsConnector } from './bank.BgD9dJ3A.mjs';
3
+ import { M as MockCobsConnector } from './bank.BcDo3cbz.mjs';
4
4
  import 'jose';
5
5
  import '@develit-io/general-codes';
6
6
 
@@ -196,7 +196,7 @@ const mapFinbricksAccountInsert = ({
196
196
  });
197
197
 
198
198
  const mapFinbricksTransactionToPayment = (tx, account) => {
199
- const isIncoming = tx.creditDebitIndicator === "CRDT";
199
+ const isIncoming = tx.creditDebitIndicator !== "DBIT";
200
200
  const related = tx.entryDetails?.transactionDetails?.relatedParties;
201
201
  const base = {
202
202
  id: uuidv4(),
@@ -215,7 +215,7 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
215
215
  tx.entryDetails.transactionDetails?.remittanceInformation?.structured?.creditorReferenceInformation?.reference || tx.entryDetails.transactionDetails?.references?.endToEndIdentification
216
216
  ),
217
217
  creditor: {
218
- holderName: related?.creditor?.name || "Unknown",
218
+ holderName: related?.creditorAccount?.name || related?.creditor?.name || "Unknown",
219
219
  iban: isIncoming ? account.iban || void 0 : related.creditorAccount?.identification?.iban || account.iban || void 0,
220
220
  number: isIncoming ? account.number || void 0 : related.creditorAccount?.identification?.other?.identification ? related.creditorAccount.identification.other.identification.split(
221
221
  "/"
@@ -225,7 +225,7 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
225
225
  )[1] : account.bankCode || void 0
226
226
  },
227
227
  debtor: {
228
- holderName: related?.debtor?.name || "Unknown",
228
+ holderName: related?.debtorAccount?.name || related?.debtor?.name || "Unknown",
229
229
  iban: isIncoming ? related.debtorAccount?.identification?.iban || account.iban || void 0 : account.iban ?? void 0,
230
230
  number: isIncoming ? related.debtorAccount?.identification?.other?.identification ? related.debtorAccount.identification.other.identification.split(
231
231
  "/"
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const database_schema = require('./bank.DCUsXXjG.cjs');
3
+ const database_schema = require('./bank.NAgd77sr.cjs');
4
4
 
5
5
  class MockCobsConnector extends database_schema.FinbricksConnector {
6
6
  constructor(config) {
@@ -198,7 +198,7 @@ const mapFinbricksAccountInsert = ({
198
198
  });
199
199
 
200
200
  const mapFinbricksTransactionToPayment = (tx, account) => {
201
- const isIncoming = tx.creditDebitIndicator === "CRDT";
201
+ const isIncoming = tx.creditDebitIndicator !== "DBIT";
202
202
  const related = tx.entryDetails?.transactionDetails?.relatedParties;
203
203
  const base = {
204
204
  id: backendSdk.uuidv4(),
@@ -217,7 +217,7 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
217
217
  tx.entryDetails.transactionDetails?.remittanceInformation?.structured?.creditorReferenceInformation?.reference || tx.entryDetails.transactionDetails?.references?.endToEndIdentification
218
218
  ),
219
219
  creditor: {
220
- holderName: related?.creditor?.name || "Unknown",
220
+ holderName: related?.creditorAccount?.name || related?.creditor?.name || "Unknown",
221
221
  iban: isIncoming ? account.iban || void 0 : related.creditorAccount?.identification?.iban || account.iban || void 0,
222
222
  number: isIncoming ? account.number || void 0 : related.creditorAccount?.identification?.other?.identification ? related.creditorAccount.identification.other.identification.split(
223
223
  "/"
@@ -227,7 +227,7 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
227
227
  )[1] : account.bankCode || void 0
228
228
  },
229
229
  debtor: {
230
- holderName: related?.debtor?.name || "Unknown",
230
+ holderName: related?.debtorAccount?.name || related?.debtor?.name || "Unknown",
231
231
  iban: isIncoming ? related.debtorAccount?.identification?.iban || account.iban || void 0 : account.iban ?? void 0,
232
232
  number: isIncoming ? related.debtorAccount?.identification?.other?.identification ? related.debtorAccount.identification.other.identification.split(
233
233
  "/"
package/dist/types.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const database_schema = require('./shared/bank.DCUsXXjG.cjs');
4
- const mockCobs_connector = require('./shared/bank.Dp5YErpd.cjs');
3
+ const database_schema = require('./shared/bank.NAgd77sr.cjs');
4
+ const mockCobs_connector = require('./shared/bank.DhuHP2ky.cjs');
5
5
  const generalCodes = require('@develit-io/general-codes');
6
6
  require('@develit-io/backend-sdk');
7
7
  require('drizzle-orm/sqlite-core');
package/dist/types.d.cts CHANGED
@@ -285,7 +285,7 @@ type FinbricksTransaction = {
285
285
  fbxReference: string | null;
286
286
  entryReference: string;
287
287
  amount: FinbricksAmount;
288
- creditDebitIndicator: string;
288
+ creditDebitIndicator: 'CRDT' | 'DBIT';
289
289
  reversalIndicator: boolean;
290
290
  status: string;
291
291
  bookingDate: {
@@ -347,6 +347,7 @@ type FinbricksTransaction = {
347
347
  };
348
348
  };
349
349
  debtorAccount: {
350
+ name: string;
350
351
  identification: {
351
352
  iban: string;
352
353
  other: {
@@ -364,6 +365,7 @@ type FinbricksTransaction = {
364
365
  };
365
366
  };
366
367
  creditorAccount: {
368
+ name: string;
367
369
  identification: {
368
370
  iban: string;
369
371
  other: {
package/dist/types.d.mts CHANGED
@@ -285,7 +285,7 @@ type FinbricksTransaction = {
285
285
  fbxReference: string | null;
286
286
  entryReference: string;
287
287
  amount: FinbricksAmount;
288
- creditDebitIndicator: string;
288
+ creditDebitIndicator: 'CRDT' | 'DBIT';
289
289
  reversalIndicator: boolean;
290
290
  status: string;
291
291
  bookingDate: {
@@ -347,6 +347,7 @@ type FinbricksTransaction = {
347
347
  };
348
348
  };
349
349
  debtorAccount: {
350
+ name: string;
350
351
  identification: {
351
352
  iban: string;
352
353
  other: {
@@ -364,6 +365,7 @@ type FinbricksTransaction = {
364
365
  };
365
366
  };
366
367
  creditorAccount: {
368
+ name: string;
367
369
  identification: {
368
370
  iban: string;
369
371
  other: {
package/dist/types.d.ts CHANGED
@@ -285,7 +285,7 @@ type FinbricksTransaction = {
285
285
  fbxReference: string | null;
286
286
  entryReference: string;
287
287
  amount: FinbricksAmount;
288
- creditDebitIndicator: string;
288
+ creditDebitIndicator: 'CRDT' | 'DBIT';
289
289
  reversalIndicator: boolean;
290
290
  status: string;
291
291
  bookingDate: {
@@ -347,6 +347,7 @@ type FinbricksTransaction = {
347
347
  };
348
348
  };
349
349
  debtorAccount: {
350
+ name: string;
350
351
  identification: {
351
352
  iban: string;
352
353
  other: {
@@ -364,6 +365,7 @@ type FinbricksTransaction = {
364
365
  };
365
366
  };
366
367
  creditorAccount: {
368
+ name: string;
367
369
  identification: {
368
370
  iban: string;
369
371
  other: {
package/dist/types.mjs CHANGED
@@ -1,5 +1,5 @@
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.BTcR2cZW.mjs';
2
- export { M as MockCobsConnector } from './shared/bank.BgD9dJ3A.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, r as ottSelectSchema, q as ottUpdateSchema, p as paymentInsertTypeZod, s as signFinbricksJws, u as useFinbricksFetch } from './shared/bank.DdvSjgls.mjs';
2
+ export { M as MockCobsConnector } from './shared/bank.BcDo3cbz.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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/bank",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {