@develit-services/bank 0.0.24 → 0.0.26

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.2vXXoFi2.cjs');
6
+ const db = require('../shared/bank.CfvkOFs5.cjs');
7
7
  const cloudflare_workers = require('cloudflare:workers');
8
8
  const d1 = require('drizzle-orm/d1');
9
9
  const zod = require('zod');
@@ -242,15 +242,15 @@ declare class BankServiceBase extends BankServiceBase_base {
242
242
  paymentsToBatch: SendPaymentInput[];
243
243
  }): Promise<IRPCResponse<{
244
244
  status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
245
+ batchPaymentInitiatedAt: Date | null;
246
+ authorizationUrls: string | string[] | null;
245
247
  accountId: string | null;
248
+ payments: PaymentInsertType[];
249
+ metadata: object | null;
246
250
  id: string;
247
251
  createdAt: Date | null;
248
252
  updatedAt: Date | null;
249
253
  deletedAt: Date | null;
250
- batchPaymentInitiatedAt: Date | null;
251
- authorizationUrls: string | string[] | 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>;
@@ -242,15 +242,15 @@ declare class BankServiceBase extends BankServiceBase_base {
242
242
  paymentsToBatch: SendPaymentInput[];
243
243
  }): Promise<IRPCResponse<{
244
244
  status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
245
+ batchPaymentInitiatedAt: Date | null;
246
+ authorizationUrls: string | string[] | null;
245
247
  accountId: string | null;
248
+ payments: PaymentInsertType[];
249
+ metadata: object | null;
246
250
  id: string;
247
251
  createdAt: Date | null;
248
252
  updatedAt: Date | null;
249
253
  deletedAt: Date | null;
250
- batchPaymentInitiatedAt: Date | null;
251
- authorizationUrls: string | string[] | 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>;
@@ -242,15 +242,15 @@ declare class BankServiceBase extends BankServiceBase_base {
242
242
  paymentsToBatch: SendPaymentInput[];
243
243
  }): Promise<IRPCResponse<{
244
244
  status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
245
+ batchPaymentInitiatedAt: Date | null;
246
+ authorizationUrls: string | string[] | null;
245
247
  accountId: string | null;
248
+ payments: PaymentInsertType[];
249
+ metadata: object | null;
246
250
  id: string;
247
251
  createdAt: Date | null;
248
252
  updatedAt: Date | null;
249
253
  deletedAt: Date | null;
250
- batchPaymentInitiatedAt: Date | null;
251
- authorizationUrls: string | string[] | 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.B5x2DseV.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.C03cnXOh.mjs';
3
3
  import { WorkerEntrypoint } from 'cloudflare:workers';
4
4
  import { drizzle } from 'drizzle-orm/d1';
5
5
  import { z } from 'zod';
@@ -198,7 +198,7 @@ const mapFinbricksBatchStatus = (status) => {
198
198
  };
199
199
  const mapFinbricksTransactionToPayment = (tx, account) => {
200
200
  const isIncoming = tx.creditDebitIndicator === "CRDT";
201
- const related = tx.entryDetails.transactionDetails.relatedParties || null;
201
+ const related = tx.entryDetails?.transactionDetails?.relatedParties;
202
202
  const base = {
203
203
  id: uuidv4(),
204
204
  bankRefId: tx.entryReference || tx.fbxReference,
@@ -206,10 +206,10 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
206
206
  currency: tx.amount?.currency || "CZK",
207
207
  paymentType: "DOMESTIC",
208
208
  status: mapFinbricksStatus(tx.status),
209
- message: tx.entryDetails.transactionDetails.remittanceInformation?.unstructured || tx.entryDetails.transactionDetails.additionalRemittanceInformation || null,
209
+ message: tx.entryDetails.transactionDetails?.remittanceInformation?.unstructured || tx.entryDetails.transactionDetails?.additionalRemittanceInformation || null,
210
210
  processedAt: new Date(tx.bookingDate.date),
211
211
  ...mapReferencesToPayment(
212
- tx.entryDetails.transactionDetails.remittanceInformation?.structured?.creditorReferenceInformation?.reference || tx.entryDetails.transactionDetails.references?.endToEndIdentification
212
+ tx.entryDetails.transactionDetails?.remittanceInformation?.structured?.creditorReferenceInformation?.reference || tx.entryDetails.transactionDetails?.references?.endToEndIdentification
213
213
  ),
214
214
  debtorHolderName: isIncoming ? related.debtor?.name || "Unknown" : "Unknown",
215
215
  creditorHolderName: isIncoming ? "Unknown" : related.creditor?.name || "Unknown",
@@ -200,7 +200,7 @@ const mapFinbricksBatchStatus = (status) => {
200
200
  };
201
201
  const mapFinbricksTransactionToPayment = (tx, account) => {
202
202
  const isIncoming = tx.creditDebitIndicator === "CRDT";
203
- const related = tx.entryDetails.transactionDetails.relatedParties || null;
203
+ const related = tx.entryDetails?.transactionDetails?.relatedParties;
204
204
  const base = {
205
205
  id: backendSdk.uuidv4(),
206
206
  bankRefId: tx.entryReference || tx.fbxReference,
@@ -208,10 +208,10 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
208
208
  currency: tx.amount?.currency || "CZK",
209
209
  paymentType: "DOMESTIC",
210
210
  status: mapFinbricksStatus(tx.status),
211
- message: tx.entryDetails.transactionDetails.remittanceInformation?.unstructured || tx.entryDetails.transactionDetails.additionalRemittanceInformation || null,
211
+ message: tx.entryDetails.transactionDetails?.remittanceInformation?.unstructured || tx.entryDetails.transactionDetails?.additionalRemittanceInformation || null,
212
212
  processedAt: new Date(tx.bookingDate.date),
213
213
  ...mapReferencesToPayment(
214
- tx.entryDetails.transactionDetails.remittanceInformation?.structured?.creditorReferenceInformation?.reference || tx.entryDetails.transactionDetails.references?.endToEndIdentification
214
+ tx.entryDetails.transactionDetails?.remittanceInformation?.structured?.creditorReferenceInformation?.reference || tx.entryDetails.transactionDetails?.references?.endToEndIdentification
215
215
  ),
216
216
  debtorHolderName: isIncoming ? related.debtor?.name || "Unknown" : "Unknown",
217
217
  creditorHolderName: isIncoming ? "Unknown" : related.creditor?.name || "Unknown",
package/dist/types.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const db = require('./shared/bank.2vXXoFi2.cjs');
3
+ const db = require('./shared/bank.CfvkOFs5.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.B5x2DseV.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.C03cnXOh.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.24",
3
+ "version": "0.0.26",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {