@develit-services/bank 0.0.26 → 0.0.28

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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const backendSdk = require('@develit-io/backend-sdk');
6
- const db = require('../shared/bank.CfvkOFs5.cjs');
6
+ const db = require('../shared/bank.Cy_TcyKb.cjs');
7
7
  const cloudflare_workers = require('cloudflare:workers');
8
8
  const d1 = require('drizzle-orm/d1');
9
9
  const zod = require('zod');
@@ -241,16 +241,16 @@ declare class BankServiceBase extends BankServiceBase_base {
241
241
  addPaymentsToBatch({ paymentsToBatch, }: {
242
242
  paymentsToBatch: SendPaymentInput[];
243
243
  }): Promise<IRPCResponse<{
244
- status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
245
- batchPaymentInitiatedAt: Date | null;
246
- authorizationUrls: string | string[] | null;
247
244
  accountId: string | null;
248
- payments: PaymentInsertType[];
249
- metadata: object | null;
250
245
  id: string;
251
246
  createdAt: Date | null;
252
247
  updatedAt: Date | null;
253
248
  deletedAt: Date | null;
249
+ batchPaymentInitiatedAt: Date | null;
250
+ authorizationUrls: string | string[] | null;
251
+ status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
252
+ payments: PaymentInsertType[];
253
+ metadata: object | null;
254
254
  }[] | undefined>>;
255
255
  processBatch(input: ProcessBatchInput): Promise<IRPCResponse<void>>;
256
256
  queue(b: MessageBatch<SendPaymentInput>): Promise<void>;
@@ -241,16 +241,16 @@ declare class BankServiceBase extends BankServiceBase_base {
241
241
  addPaymentsToBatch({ paymentsToBatch, }: {
242
242
  paymentsToBatch: SendPaymentInput[];
243
243
  }): Promise<IRPCResponse<{
244
- status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
245
- batchPaymentInitiatedAt: Date | null;
246
- authorizationUrls: string | string[] | null;
247
244
  accountId: string | null;
248
- payments: PaymentInsertType[];
249
- metadata: object | null;
250
245
  id: string;
251
246
  createdAt: Date | null;
252
247
  updatedAt: Date | null;
253
248
  deletedAt: Date | null;
249
+ batchPaymentInitiatedAt: Date | null;
250
+ authorizationUrls: string | string[] | null;
251
+ status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
252
+ payments: PaymentInsertType[];
253
+ metadata: object | null;
254
254
  }[] | undefined>>;
255
255
  processBatch(input: ProcessBatchInput): Promise<IRPCResponse<void>>;
256
256
  queue(b: MessageBatch<SendPaymentInput>): Promise<void>;
@@ -241,16 +241,16 @@ declare class BankServiceBase extends BankServiceBase_base {
241
241
  addPaymentsToBatch({ paymentsToBatch, }: {
242
242
  paymentsToBatch: SendPaymentInput[];
243
243
  }): Promise<IRPCResponse<{
244
- status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
245
- batchPaymentInitiatedAt: Date | null;
246
- authorizationUrls: string | string[] | null;
247
244
  accountId: string | null;
248
- payments: PaymentInsertType[];
249
- metadata: object | null;
250
245
  id: string;
251
246
  createdAt: Date | null;
252
247
  updatedAt: Date | null;
253
248
  deletedAt: Date | null;
249
+ batchPaymentInitiatedAt: Date | null;
250
+ authorizationUrls: string | string[] | null;
251
+ status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
252
+ payments: PaymentInsertType[];
253
+ metadata: object | null;
254
254
  }[] | undefined>>;
255
255
  processBatch(input: ProcessBatchInput): Promise<IRPCResponse<void>>;
256
256
  queue(b: MessageBatch<SendPaymentInput>): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import { uuidv4, useResult, createInternalError, develitWorker, first, RPCResponse, action, service } from '@develit-io/backend-sdk';
2
- import { P as PAYMENT_TYPES, t as tables, F as FinbricksConnector, M as MockConnector, a as MockCobsConnector, E as ErsteConnector, g as getPaymentDirection } from '../shared/bank.C03cnXOh.mjs';
2
+ import { P as PAYMENT_TYPES, t as tables, F as FinbricksConnector, M as MockConnector, a as MockCobsConnector, E as ErsteConnector, g as getPaymentDirection } from '../shared/bank.DnDcNEvX.mjs';
3
3
  import { WorkerEntrypoint } from 'cloudflare:workers';
4
4
  import { drizzle } from 'drizzle-orm/d1';
5
5
  import { z } from 'zod';
@@ -213,10 +213,10 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
213
213
  ...mapReferencesToPayment(
214
214
  tx.entryDetails.transactionDetails?.remittanceInformation?.structured?.creditorReferenceInformation?.reference || tx.entryDetails.transactionDetails?.references?.endToEndIdentification
215
215
  ),
216
- debtorHolderName: isIncoming ? related.debtor?.name || "Unknown" : "Unknown",
217
- creditorHolderName: isIncoming ? "Unknown" : related.creditor?.name || "Unknown",
218
- debtorIban: isIncoming ? related.debtorAccount?.identification?.iban || account.identification.iban : account.identification.iban,
219
- creditorIban: isIncoming ? account.identification.iban : related.creditorAccount?.identification?.iban || account.identification.iban,
216
+ debtorHolderName: isIncoming ? related?.debtor?.name || "Unknown" : "Unknown",
217
+ creditorHolderName: isIncoming ? "Unknown" : related?.creditor?.name || "Unknown",
218
+ debtorIban: isIncoming ? related?.debtorAccount?.identification?.iban || account.identification.iban : account.identification.iban,
219
+ creditorIban: isIncoming ? account.identification.iban : related?.creditorAccount?.identification?.iban || account.identification.iban,
220
220
  direction: "INCOMING"
221
221
  // přepíšeme správným směrem níže
222
222
  };
@@ -498,8 +498,10 @@ class FinbricksConnector extends IBankConnector {
498
498
  }
499
499
  const { transactions, links } = response;
500
500
  cursor = links?.[0]?.value || null;
501
- for (const tx of transactions) {
502
- allPayments.push(mapFinbricksTransactionToPayment(tx, account));
501
+ if (transactions) {
502
+ for (const tx of transactions) {
503
+ allPayments.push(mapFinbricksTransactionToPayment(tx, account));
504
+ }
503
505
  }
504
506
  } while (cursor != null);
505
507
  return allPayments;
@@ -211,10 +211,10 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
211
211
  ...mapReferencesToPayment(
212
212
  tx.entryDetails.transactionDetails?.remittanceInformation?.structured?.creditorReferenceInformation?.reference || tx.entryDetails.transactionDetails?.references?.endToEndIdentification
213
213
  ),
214
- debtorHolderName: isIncoming ? related.debtor?.name || "Unknown" : "Unknown",
215
- creditorHolderName: isIncoming ? "Unknown" : related.creditor?.name || "Unknown",
216
- debtorIban: isIncoming ? related.debtorAccount?.identification?.iban || account.identification.iban : account.identification.iban,
217
- creditorIban: isIncoming ? account.identification.iban : related.creditorAccount?.identification?.iban || account.identification.iban,
214
+ debtorHolderName: isIncoming ? related?.debtor?.name || "Unknown" : "Unknown",
215
+ creditorHolderName: isIncoming ? "Unknown" : related?.creditor?.name || "Unknown",
216
+ debtorIban: isIncoming ? related?.debtorAccount?.identification?.iban || account.identification.iban : account.identification.iban,
217
+ creditorIban: isIncoming ? account.identification.iban : related?.creditorAccount?.identification?.iban || account.identification.iban,
218
218
  direction: "INCOMING"
219
219
  // přepíšeme správným směrem níže
220
220
  };
@@ -496,8 +496,10 @@ class FinbricksConnector extends IBankConnector {
496
496
  }
497
497
  const { transactions, links } = response;
498
498
  cursor = links?.[0]?.value || null;
499
- for (const tx of transactions) {
500
- allPayments.push(mapFinbricksTransactionToPayment(tx, account));
499
+ if (transactions) {
500
+ for (const tx of transactions) {
501
+ allPayments.push(mapFinbricksTransactionToPayment(tx, account));
502
+ }
501
503
  }
502
504
  } while (cursor != null);
503
505
  return allPayments;
package/dist/types.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const db = require('./shared/bank.CfvkOFs5.cjs');
3
+ const db = require('./shared/bank.Cy_TcyKb.cjs');
4
4
  const database_schema = require('./shared/bank.P9gDUycr.cjs');
5
5
  const generalCodes = require('@develit-io/general-codes');
6
6
  require('@develit-io/backend-sdk');
package/dist/types.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { B as BATCH_STATUES, B as BATCH_STATUSES, C as COUNTRY_CODES, E as ErsteConnector, c as FINBRICKS_ENDPOINTS, b as FinbricksClient, F as FinbricksConnector, I as IBankConnector, a as MockCobsConnector, M as MockConnector, e as PAYMENT_DIRECTIONS, d as PAYMENT_STATUSES, P as PAYMENT_TYPES, p as paymentInsertTypeZod, s as signFinbricksJws, u as useFinbricksFetch } from './shared/bank.C03cnXOh.mjs';
1
+ export { B as BATCH_STATUES, B as BATCH_STATUSES, C as COUNTRY_CODES, E as ErsteConnector, c as FINBRICKS_ENDPOINTS, b as FinbricksClient, F as FinbricksConnector, I as IBankConnector, a as MockCobsConnector, M as MockConnector, e as PAYMENT_DIRECTIONS, d as PAYMENT_STATUSES, P as PAYMENT_TYPES, p as paymentInsertTypeZod, s as signFinbricksJws, u as useFinbricksFetch } from './shared/bank.DnDcNEvX.mjs';
2
2
  export { C as CONNECTOR_KEYS, T as TOKEN_TYPES } from './shared/bank.C9jAvwna.mjs';
3
3
  export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
4
4
  import '@develit-io/backend-sdk';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/bank",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {