@develit-services/bank 0.3.51 → 0.3.52

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
  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 drizzle = require('../shared/bank.DIn77H1S.cjs');
6
+ const drizzle = require('../shared/bank.DF_uKc1D.cjs');
7
7
  const zod = require('zod');
8
8
  const database_schema = require('../shared/bank.DoHc7geB.cjs');
9
9
  const generalCodes = require('@develit-io/general-codes');
@@ -11,7 +11,7 @@ require('date-fns');
11
11
  const drizzleOrm = require('drizzle-orm');
12
12
  require('jose');
13
13
  require('node:crypto');
14
- const encryption = require('../shared/bank.tqnXqWCE.cjs');
14
+ const encryption = require('../shared/bank.DH-qLkp5.cjs');
15
15
  require('drizzle-orm/sqlite-core');
16
16
  require('drizzle-orm/relations');
17
17
  require('drizzle-zod');
@@ -2515,9 +2515,9 @@ declare class BankServiceBase extends BankServiceBase_base {
2515
2515
  createdAt: Date | null;
2516
2516
  updatedAt: Date | null;
2517
2517
  deletedAt: Date | null;
2518
- accountId: string | null;
2519
2518
  batchPaymentInitiatedAt: Date | null;
2520
2519
  authorizationUrls: string[] | null;
2520
+ accountId: string | null;
2521
2521
  statusReason: string | null;
2522
2522
  statusResponse: object | null;
2523
2523
  payments: PaymentInsertType[];
@@ -2515,9 +2515,9 @@ declare class BankServiceBase extends BankServiceBase_base {
2515
2515
  createdAt: Date | null;
2516
2516
  updatedAt: Date | null;
2517
2517
  deletedAt: Date | null;
2518
- accountId: string | null;
2519
2518
  batchPaymentInitiatedAt: Date | null;
2520
2519
  authorizationUrls: string[] | null;
2520
+ accountId: string | null;
2521
2521
  statusReason: string | null;
2522
2522
  statusResponse: object | null;
2523
2523
  payments: PaymentInsertType[];
@@ -2515,9 +2515,9 @@ declare class BankServiceBase extends BankServiceBase_base {
2515
2515
  createdAt: Date | null;
2516
2516
  updatedAt: Date | null;
2517
2517
  deletedAt: Date | null;
2518
- accountId: string | null;
2519
2518
  batchPaymentInitiatedAt: Date | null;
2520
2519
  authorizationUrls: string[] | null;
2520
+ accountId: string | null;
2521
2521
  statusReason: string | null;
2522
2522
  statusResponse: object | null;
2523
2523
  payments: PaymentInsertType[];
@@ -1,7 +1,7 @@
1
1
  import { uuidv4, first, bankAccountMetadataSchema, workflowInstanceStatusSchema, develitWorker, createInternalError, 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 } from '../shared/bank.BrwlZUfo.mjs';
4
+ import { t as tables } from '../shared/bank.BiHEgOL8.mjs';
5
5
  import { z } from 'zod';
6
6
  import { I as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, P as PAYMENT_TYPES, d as CONNECTOR_KEYS, B as BATCH_STATUSES, a as PAYMENT_STATUSES, b as PAYMENT_DIRECTIONS, f as accountInsertSchema } from '../shared/bank.C1bHZDjr.mjs';
7
7
  import { CURRENCY_CODES } from '@develit-io/general-codes';
@@ -9,7 +9,7 @@ import 'date-fns';
9
9
  import { eq, sql, inArray, and, asc, desc, gte, lte } from 'drizzle-orm';
10
10
  import 'jose';
11
11
  import 'node:crypto';
12
- import { f as encrypt, i as importAesKey, a as getCredentialsByAccountId, b as initiateConnector, u as upsertBatchCommand, d as getBatchByIdQuery, c as createPaymentCommand, g as getAccountByIdQuery } from '../shared/bank.DyoWDyOf.mjs';
12
+ import { f as encrypt, i as importAesKey, a as getCredentialsByAccountId, b as initiateConnector, u as upsertBatchCommand, d as getBatchByIdQuery, c as createPaymentCommand, g as getAccountByIdQuery } from '../shared/bank.BpLl-Z93.mjs';
13
13
  import 'drizzle-orm/sqlite-core';
14
14
  import 'drizzle-orm/relations';
15
15
  import 'drizzle-zod';
@@ -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 drizzle = require('../shared/bank.DIn77H1S.cjs');
6
+ const drizzle = require('../shared/bank.DF_uKc1D.cjs');
7
7
  const backendSdk = require('@develit-io/backend-sdk');
8
- const encryption = require('../shared/bank.tqnXqWCE.cjs');
8
+ const encryption = require('../shared/bank.DH-qLkp5.cjs');
9
9
  const drizzleOrm = require('drizzle-orm');
10
10
  require('date-fns');
11
11
  require('../shared/bank.DoHc7geB.cjs');
@@ -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 } from '../shared/bank.BrwlZUfo.mjs';
4
+ import { t as tables } from '../shared/bank.BiHEgOL8.mjs';
5
5
  import { asNonEmpty, first } from '@develit-io/backend-sdk';
6
- import { g as getAccountByIdQuery, i as importAesKey, a as getCredentialsByAccountId, b as initiateConnector, c as createPaymentCommand, d as getBatchByIdQuery, e as checksum, u as upsertBatchCommand } from '../shared/bank.DyoWDyOf.mjs';
6
+ import { g as getAccountByIdQuery, i as importAesKey, a as getCredentialsByAccountId, b as initiateConnector, c as createPaymentCommand, d as getBatchByIdQuery, e as checksum, u as upsertBatchCommand } from '../shared/bank.BpLl-Z93.mjs';
7
7
  import { eq } from 'drizzle-orm';
8
8
  import 'date-fns';
9
9
  import '../shared/bank.C1bHZDjr.mjs';
@@ -705,8 +705,12 @@ class FinbricksConnector extends IBankConnector {
705
705
  message: "Finbricks: failed to fetch batch status"
706
706
  });
707
707
  }
708
+ const allAuthorized = response.payments.every(
709
+ (p) => p.resultCode === "AUTHORIZED" || p.resultCode === "BOOKED" || p.resultCode === "SETTLED" || p.resultCode === "COMPLETED"
710
+ );
711
+ const status = allAuthorized ? "SIGNED" : mapFinbricksBatchStatus(response.batchResultCode) ?? currentStatus;
708
712
  return {
709
- status: mapFinbricksBatchStatus(response.batchResultCode) ?? currentStatus,
713
+ status,
710
714
  apiResponse: response
711
715
  };
712
716
  }
@@ -1,4 +1,4 @@
1
- import { t as tables, F as FinbricksConnector, M as MockConnector, a as MockCobsConnector, E as ErsteConnector } from './bank.BrwlZUfo.mjs';
1
+ import { t as tables, F as FinbricksConnector, M as MockConnector, a as MockCobsConnector, E as ErsteConnector } from './bank.BiHEgOL8.mjs';
2
2
  import { uuidv4 } from '@develit-io/backend-sdk';
3
3
  import { eq } from 'drizzle-orm';
4
4
  import 'date-fns';
@@ -707,8 +707,12 @@ class FinbricksConnector extends IBankConnector {
707
707
  message: "Finbricks: failed to fetch batch status"
708
708
  });
709
709
  }
710
+ const allAuthorized = response.payments.every(
711
+ (p) => p.resultCode === "AUTHORIZED" || p.resultCode === "BOOKED" || p.resultCode === "SETTLED" || p.resultCode === "COMPLETED"
712
+ );
713
+ const status = allAuthorized ? "SIGNED" : mapFinbricksBatchStatus(response.batchResultCode) ?? currentStatus;
710
714
  return {
711
- status: mapFinbricksBatchStatus(response.batchResultCode) ?? currentStatus,
715
+ status,
712
716
  apiResponse: response
713
717
  };
714
718
  }
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const drizzle = require('./bank.DIn77H1S.cjs');
3
+ const drizzle = require('./bank.DF_uKc1D.cjs');
4
4
  const backendSdk = require('@develit-io/backend-sdk');
5
5
  const drizzleOrm = require('drizzle-orm');
6
6
  require('date-fns');
package/dist/types.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const drizzle = require('./shared/bank.DIn77H1S.cjs');
3
+ const drizzle = require('./shared/bank.DF_uKc1D.cjs');
4
4
  const database_schema = require('./shared/bank.DoHc7geB.cjs');
5
5
  const generalCodes = require('@develit-io/general-codes');
6
6
  require('@develit-io/backend-sdk');
package/dist/types.d.cts CHANGED
@@ -101,7 +101,7 @@ type FinbricksGetBatchStatusResponse = {
101
101
  merchantTransactionId: string;
102
102
  resultCode: FinbricksTransactionStatus;
103
103
  finalbankStatus: boolean;
104
- };
104
+ }[];
105
105
  batchRecoveryUrl: string;
106
106
  };
107
107
  type FinbricksPaymentBody = {
package/dist/types.d.mts CHANGED
@@ -101,7 +101,7 @@ type FinbricksGetBatchStatusResponse = {
101
101
  merchantTransactionId: string;
102
102
  resultCode: FinbricksTransactionStatus;
103
103
  finalbankStatus: boolean;
104
- };
104
+ }[];
105
105
  batchRecoveryUrl: string;
106
106
  };
107
107
  type FinbricksPaymentBody = {
package/dist/types.d.ts CHANGED
@@ -101,7 +101,7 @@ type FinbricksGetBatchStatusResponse = {
101
101
  merchantTransactionId: string;
102
102
  resultCode: FinbricksTransactionStatus;
103
103
  finalbankStatus: boolean;
104
- };
104
+ }[];
105
105
  batchRecoveryUrl: string;
106
106
  };
107
107
  type FinbricksPaymentBody = {
package/dist/types.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { E as ErsteConnector, c as FINBRICKS_ENDPOINTS, b as FinbricksClient, F as FinbricksConnector, I as IBankConnector, a as MockCobsConnector, M as MockConnector, s as signFinbricksJws, u as useFinbricksFetch } from './shared/bank.BrwlZUfo.mjs';
1
+ export { E as ErsteConnector, c as FINBRICKS_ENDPOINTS, b as FinbricksClient, F as FinbricksConnector, I as IBankConnector, a as MockCobsConnector, M as MockConnector, s as signFinbricksJws, u as useFinbricksFetch } from './shared/bank.BiHEgOL8.mjs';
2
2
  export { A as ACCOUNT_STATUSES, B as BATCH_STATUES, B as BATCH_STATUSES, C as CHARGE_BEARERS, d as CONNECTOR_KEYS, c as COUNTRY_CODES, e as CREDENTIALS_TYPES, I as INSTRUCTION_PRIORITIES, b as PAYMENT_DIRECTIONS, a as PAYMENT_STATUSES, P as PAYMENT_TYPES, T as TOKEN_TYPES, i as accountCredentialsInsertSchema, k as accountCredentialsSelectSchema, j as accountCredentialsUpdateSchema, f as accountInsertSchema, h as accountSelectSchema, g as accountUpdateSchema, o as ottInsertSchema, m as ottSelectSchema, l as ottUpdateSchema } from './shared/bank.C1bHZDjr.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.3.51",
3
+ "version": "0.3.52",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {