@develit-services/bank 0.0.39 → 0.0.41

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.BCFCsGc4.cjs');
3
+ const database_schema = require('../shared/bank.C2tmTjwq.cjs');
4
4
  require('@develit-io/backend-sdk');
5
5
  require('drizzle-orm/sqlite-core');
6
6
  require('drizzle-orm');
@@ -1,4 +1,4 @@
1
- export { y as account, z as accountCredentials, r as batch, x as ott, v as payment, w as paymentRelations } from '../shared/bank.ClhW343d.mjs';
1
+ export { y as account, z as accountCredentials, r as batch, x as ott, v as payment, w as paymentRelations } from '../shared/bank.HuMp6uP6.mjs';
2
2
  import '@develit-io/backend-sdk';
3
3
  import 'drizzle-orm/sqlite-core';
4
4
  import 'drizzle-orm';
@@ -5,12 +5,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const backendSdk = require('@develit-io/backend-sdk');
6
6
  const cloudflare_workers = require('cloudflare:workers');
7
7
  const d1 = require('drizzle-orm/d1');
8
- const database_schema = require('../shared/bank.BCFCsGc4.cjs');
8
+ const database_schema = require('../shared/bank.C2tmTjwq.cjs');
9
9
  require('jose');
10
10
  const generalCodes = require('@develit-io/general-codes');
11
11
  const zod = require('zod');
12
12
  const drizzleOrm = require('drizzle-orm');
13
- const mockCobs_connector = require('../shared/bank.mZ26nAqL.cjs');
13
+ const mockCobs_connector = require('../shared/bank.DBgpADhg.cjs');
14
14
  require('drizzle-orm/sqlite-core');
15
15
  require('drizzle-zod');
16
16
  require('date-fns');
@@ -813,7 +813,8 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
813
813
  ...preparedBatch.retriedPayments
814
814
  ]
815
815
  });
816
- if (!authorizationUrls) {
816
+ console.log(authorizationUrls, "AUTH URIS FROM BANK");
817
+ if (!authorizationUrls.length) {
817
818
  this.logError({ message: "Failed to retrieve signing URI" });
818
819
  await upsertBatchCommand(this.db, {
819
820
  batch: {
@@ -225,9 +225,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
225
225
  limit: z.ZodNumber;
226
226
  sort: z.ZodObject<{
227
227
  column: z.ZodEnum<{
228
- batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
229
228
  createdAt: "createdAt";
230
229
  updatedAt: "updatedAt";
230
+ batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
231
231
  }>;
232
232
  direction: z.ZodEnum<{
233
233
  asc: "asc";
@@ -479,14 +479,14 @@ declare class BankServiceBase extends BankServiceBase_base {
479
479
  addPaymentsToBatch({ paymentsToBatch, }: {
480
480
  paymentsToBatch: SendPaymentInput[];
481
481
  }): Promise<IRPCResponse<{
482
- batchPaymentInitiatedAt: Date | null;
483
- authorizationUrls: string | string[] | null;
484
482
  status: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | "PREPARED" | "COMPLETED" | "FAILED" | null;
485
483
  id: string;
486
484
  createdAt: Date | null;
487
485
  updatedAt: Date | null;
488
486
  deletedAt: Date | null;
489
487
  accountId: string | null;
488
+ batchPaymentInitiatedAt: Date | null;
489
+ authorizationUrls: string | string[] | null;
490
490
  payments: PaymentInsertType[];
491
491
  metadata: object | null;
492
492
  }[] | undefined>>;
@@ -225,9 +225,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
225
225
  limit: z.ZodNumber;
226
226
  sort: z.ZodObject<{
227
227
  column: z.ZodEnum<{
228
- batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
229
228
  createdAt: "createdAt";
230
229
  updatedAt: "updatedAt";
230
+ batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
231
231
  }>;
232
232
  direction: z.ZodEnum<{
233
233
  asc: "asc";
@@ -479,14 +479,14 @@ declare class BankServiceBase extends BankServiceBase_base {
479
479
  addPaymentsToBatch({ paymentsToBatch, }: {
480
480
  paymentsToBatch: SendPaymentInput[];
481
481
  }): Promise<IRPCResponse<{
482
- batchPaymentInitiatedAt: Date | null;
483
- authorizationUrls: string | string[] | null;
484
482
  status: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | "PREPARED" | "COMPLETED" | "FAILED" | null;
485
483
  id: string;
486
484
  createdAt: Date | null;
487
485
  updatedAt: Date | null;
488
486
  deletedAt: Date | null;
489
487
  accountId: string | null;
488
+ batchPaymentInitiatedAt: Date | null;
489
+ authorizationUrls: string | string[] | null;
490
490
  payments: PaymentInsertType[];
491
491
  metadata: object | null;
492
492
  }[] | undefined>>;
@@ -225,9 +225,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
225
225
  limit: z.ZodNumber;
226
226
  sort: z.ZodObject<{
227
227
  column: z.ZodEnum<{
228
- batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
229
228
  createdAt: "createdAt";
230
229
  updatedAt: "updatedAt";
230
+ batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
231
231
  }>;
232
232
  direction: z.ZodEnum<{
233
233
  asc: "asc";
@@ -479,14 +479,14 @@ declare class BankServiceBase extends BankServiceBase_base {
479
479
  addPaymentsToBatch({ paymentsToBatch, }: {
480
480
  paymentsToBatch: SendPaymentInput[];
481
481
  }): Promise<IRPCResponse<{
482
- batchPaymentInitiatedAt: Date | null;
483
- authorizationUrls: string | string[] | null;
484
482
  status: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | "PREPARED" | "COMPLETED" | "FAILED" | null;
485
483
  id: string;
486
484
  createdAt: Date | null;
487
485
  updatedAt: Date | null;
488
486
  deletedAt: Date | null;
489
487
  accountId: string | null;
488
+ batchPaymentInitiatedAt: Date | null;
489
+ authorizationUrls: string | string[] | null;
490
490
  payments: PaymentInsertType[];
491
491
  metadata: object | null;
492
492
  }[] | undefined>>;
@@ -1,12 +1,12 @@
1
1
  import { uuidv4, develitWorker, createInternalError, first, RPCResponse, 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, F as FinbricksConnector, M as MockConnector, E as ErsteConnector, P as PAYMENT_TYPES, e as CONNECTOR_KEYS, B as BATCH_STATUSES, c as PAYMENT_STATUSES, d as PAYMENT_DIRECTIONS, q as getPaymentDirection } from '../shared/bank.ClhW343d.mjs';
4
+ import { t as tables, F as FinbricksConnector, M as MockConnector, E as ErsteConnector, P as PAYMENT_TYPES, e as CONNECTOR_KEYS, B as BATCH_STATUSES, c as PAYMENT_STATUSES, d as PAYMENT_DIRECTIONS, q as getPaymentDirection } from '../shared/bank.HuMp6uP6.mjs';
5
5
  import 'jose';
6
6
  import { CURRENCY_CODES } from '@develit-io/general-codes';
7
7
  import { z } from 'zod';
8
8
  import { eq, inArray, and, sql, asc, desc, gte, lte } from 'drizzle-orm';
9
- import { M as MockCobsConnector } from '../shared/bank.UaH89pIW.mjs';
9
+ import { M as MockCobsConnector } from '../shared/bank.E-nyO12E.mjs';
10
10
  import 'drizzle-orm/sqlite-core';
11
11
  import 'drizzle-zod';
12
12
  import 'date-fns';
@@ -809,7 +809,8 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
809
809
  ...preparedBatch.retriedPayments
810
810
  ]
811
811
  });
812
- if (!authorizationUrls) {
812
+ console.log(authorizationUrls, "AUTH URIS FROM BANK");
813
+ if (!authorizationUrls.length) {
813
814
  this.logError({ message: "Failed to retrieve signing URI" });
814
815
  await upsertBatchCommand(this.db, {
815
816
  batch: {
@@ -460,9 +460,8 @@ class FinbricksConnector extends IBankConnector {
460
460
  })
461
461
  );
462
462
  if (error || !response) {
463
- throw backendSdk.createInternalError(error, {
464
- message: "Finbricks: failed to initiate batch payment"
465
- });
463
+ console.error("FINBRICKS BATCH ERROR", error);
464
+ throw backendSdk.createInternalError(error);
466
465
  }
467
466
  return {
468
467
  id: batchId,
@@ -568,7 +567,7 @@ class FinbricksConnector extends IBankConnector {
568
567
  (acc) => acc.iban === account.iban
569
568
  ).token,
570
569
  paymentProvider: this.PROVIDER,
571
- bankAccountId: account.id,
570
+ bankAccountId: account.bankRefId,
572
571
  dateFrom,
573
572
  dateTo,
574
573
  currency: account.currency,
@@ -581,9 +580,8 @@ class FinbricksConnector extends IBankConnector {
581
580
  do {
582
581
  const [response, error] = await fetchTransactions(cursor);
583
582
  if (error || !response) {
584
- throw backendSdk.createInternalError(error, {
585
- message: "Finbricks: failed to fetch account transactions"
586
- });
583
+ console.error(error, "TRANSACTIONS GET ERROR");
584
+ throw backendSdk.createInternalError(error);
587
585
  }
588
586
  const { transactions, links } = response;
589
587
  cursor = links?.[0]?.value || null;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const database_schema = require('./bank.BCFCsGc4.cjs');
3
+ const database_schema = require('./bank.C2tmTjwq.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.ClhW343d.mjs';
1
+ import { F as FinbricksConnector } from './bank.HuMp6uP6.mjs';
2
2
 
3
3
  class MockCobsConnector extends FinbricksConnector {
4
4
  constructor(config) {
@@ -458,9 +458,8 @@ class FinbricksConnector extends IBankConnector {
458
458
  })
459
459
  );
460
460
  if (error || !response) {
461
- throw createInternalError(error, {
462
- message: "Finbricks: failed to initiate batch payment"
463
- });
461
+ console.error("FINBRICKS BATCH ERROR", error);
462
+ throw createInternalError(error);
464
463
  }
465
464
  return {
466
465
  id: batchId,
@@ -566,7 +565,7 @@ class FinbricksConnector extends IBankConnector {
566
565
  (acc) => acc.iban === account.iban
567
566
  ).token,
568
567
  paymentProvider: this.PROVIDER,
569
- bankAccountId: account.id,
568
+ bankAccountId: account.bankRefId,
570
569
  dateFrom,
571
570
  dateTo,
572
571
  currency: account.currency,
@@ -579,9 +578,8 @@ class FinbricksConnector extends IBankConnector {
579
578
  do {
580
579
  const [response, error] = await fetchTransactions(cursor);
581
580
  if (error || !response) {
582
- throw createInternalError(error, {
583
- message: "Finbricks: failed to fetch account transactions"
584
- });
581
+ console.error(error, "TRANSACTIONS GET ERROR");
582
+ throw createInternalError(error);
585
583
  }
586
584
  const { transactions, links } = response;
587
585
  cursor = links?.[0]?.value || null;
package/dist/types.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const database_schema = require('./shared/bank.BCFCsGc4.cjs');
4
- const mockCobs_connector = require('./shared/bank.mZ26nAqL.cjs');
3
+ const database_schema = require('./shared/bank.C2tmTjwq.cjs');
4
+ const mockCobs_connector = require('./shared/bank.DBgpADhg.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.mjs CHANGED
@@ -1,5 +1,5 @@
1
- export { A as ACCOUNT_STATUSES, B as BATCH_STATUES, B as BATCH_STATUSES, e as CONNECTOR_KEYS, C as COUNTRY_CODES, f as CREDENTIALS_TYPES, E as ErsteConnector, b as FINBRICKS_ENDPOINTS, a as FinbricksClient, F as FinbricksConnector, I as IBankConnector, M as MockConnector, d as PAYMENT_DIRECTIONS, c as PAYMENT_STATUSES, P as PAYMENT_TYPES, T as TOKEN_TYPES, j as accountCredentialsInsertSchema, l as accountCredentialsSelectSchema, k as accountCredentialsUpdateSchema, g as accountInsertSchema, i as accountSelectSchema, h as accountUpdateSchema, o as ottInsertSchema, n as ottSelectSchema, m as ottUpdateSchema, p as paymentInsertTypeZod, s as signFinbricksJws, u as useFinbricksFetch } from './shared/bank.ClhW343d.mjs';
2
- export { M as MockCobsConnector } from './shared/bank.UaH89pIW.mjs';
1
+ export { A as ACCOUNT_STATUSES, B as BATCH_STATUES, B as BATCH_STATUSES, e as CONNECTOR_KEYS, C as COUNTRY_CODES, f as CREDENTIALS_TYPES, E as ErsteConnector, b as FINBRICKS_ENDPOINTS, a as FinbricksClient, F as FinbricksConnector, I as IBankConnector, M as MockConnector, d as PAYMENT_DIRECTIONS, c as PAYMENT_STATUSES, P as PAYMENT_TYPES, T as TOKEN_TYPES, j as accountCredentialsInsertSchema, l as accountCredentialsSelectSchema, k as accountCredentialsUpdateSchema, g as accountInsertSchema, i as accountSelectSchema, h as accountUpdateSchema, o as ottInsertSchema, n as ottSelectSchema, m as ottUpdateSchema, p as paymentInsertTypeZod, s as signFinbricksJws, u as useFinbricksFetch } from './shared/bank.HuMp6uP6.mjs';
2
+ export { M as MockCobsConnector } from './shared/bank.E-nyO12E.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.0.39",
3
+ "version": "0.0.41",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {