@develit-services/bank 6.1.0 → 6.1.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.
package/dist/base.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.D3w3JIsQ.cjs';
2
- import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.CggHtT3y.cjs';
1
+ import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.CgiEbvJu.cjs';
2
+ import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.DZyrkXc_.cjs';
3
3
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
4
4
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
5
5
  import { WorkerEntrypoint } from 'cloudflare:workers';
@@ -2711,15 +2711,15 @@ declare const getBatchesInputSchema: z.ZodObject<{
2711
2711
  filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
2712
2712
  filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2713
2713
  AUTHORIZED: "AUTHORIZED";
2714
+ COMPLETED: "COMPLETED";
2714
2715
  PROCESSING: "PROCESSING";
2715
2716
  READY_TO_SIGN: "READY_TO_SIGN";
2716
- COMPLETED: "COMPLETED";
2717
2717
  FAILED: "FAILED";
2718
2718
  }>, z.ZodArray<z.ZodEnum<{
2719
2719
  AUTHORIZED: "AUTHORIZED";
2720
+ COMPLETED: "COMPLETED";
2720
2721
  PROCESSING: "PROCESSING";
2721
2722
  READY_TO_SIGN: "READY_TO_SIGN";
2722
- COMPLETED: "COMPLETED";
2723
2723
  FAILED: "FAILED";
2724
2724
  }>>]>>;
2725
2725
  }, z.core.$strip>;
@@ -2956,20 +2956,20 @@ declare const getPaymentsInputSchema: z.ZodObject<{
2956
2956
  filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
2957
2957
  filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
2958
2958
  filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2959
- PROCESSING: "PROCESSING";
2960
- PENDING: "PENDING";
2961
2959
  BOOKED: "BOOKED";
2962
- CANCELLED: "CANCELLED";
2963
2960
  REJECTED: "REJECTED";
2961
+ PENDING: "PENDING";
2962
+ PROCESSING: "PROCESSING";
2963
+ CANCELLED: "CANCELLED";
2964
2964
  SCHEDULED: "SCHEDULED";
2965
2965
  HOLD: "HOLD";
2966
2966
  INFO: "INFO";
2967
2967
  }>, z.ZodArray<z.ZodEnum<{
2968
- PROCESSING: "PROCESSING";
2969
- PENDING: "PENDING";
2970
2968
  BOOKED: "BOOKED";
2971
- CANCELLED: "CANCELLED";
2972
2969
  REJECTED: "REJECTED";
2970
+ PENDING: "PENDING";
2971
+ PROCESSING: "PROCESSING";
2972
+ CANCELLED: "CANCELLED";
2973
2973
  SCHEDULED: "SCHEDULED";
2974
2974
  HOLD: "HOLD";
2975
2975
  INFO: "INFO";
@@ -3903,20 +3903,20 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
3903
3903
  }, z.core.$strip>;
3904
3904
  filterAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
3905
3905
  filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
3906
+ OPENED: "OPENED";
3906
3907
  AUTHORIZED: "AUTHORIZED";
3907
3908
  COMPLETED: "COMPLETED";
3908
3909
  BOOKED: "BOOKED";
3909
- REJECTED: "REJECTED";
3910
- OPENED: "OPENED";
3911
3910
  SETTLED: "SETTLED";
3911
+ REJECTED: "REJECTED";
3912
3912
  CLOSED: "CLOSED";
3913
3913
  }>, z.ZodArray<z.ZodEnum<{
3914
+ OPENED: "OPENED";
3914
3915
  AUTHORIZED: "AUTHORIZED";
3915
3916
  COMPLETED: "COMPLETED";
3916
3917
  BOOKED: "BOOKED";
3917
- REJECTED: "REJECTED";
3918
- OPENED: "OPENED";
3919
3918
  SETTLED: "SETTLED";
3919
+ REJECTED: "REJECTED";
3920
3920
  CLOSED: "CLOSED";
3921
3921
  }>>]>>;
3922
3922
  filterPaymentType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
package/dist/base.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.D3w3JIsQ.mjs';
2
- import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.CDB7SWNr.mjs';
1
+ import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.CgiEbvJu.mjs';
2
+ import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.D19D3a9C.mjs';
3
3
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
4
4
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
5
5
  import { WorkerEntrypoint } from 'cloudflare:workers';
@@ -2711,15 +2711,15 @@ declare const getBatchesInputSchema: z.ZodObject<{
2711
2711
  filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
2712
2712
  filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2713
2713
  AUTHORIZED: "AUTHORIZED";
2714
+ COMPLETED: "COMPLETED";
2714
2715
  PROCESSING: "PROCESSING";
2715
2716
  READY_TO_SIGN: "READY_TO_SIGN";
2716
- COMPLETED: "COMPLETED";
2717
2717
  FAILED: "FAILED";
2718
2718
  }>, z.ZodArray<z.ZodEnum<{
2719
2719
  AUTHORIZED: "AUTHORIZED";
2720
+ COMPLETED: "COMPLETED";
2720
2721
  PROCESSING: "PROCESSING";
2721
2722
  READY_TO_SIGN: "READY_TO_SIGN";
2722
- COMPLETED: "COMPLETED";
2723
2723
  FAILED: "FAILED";
2724
2724
  }>>]>>;
2725
2725
  }, z.core.$strip>;
@@ -2956,20 +2956,20 @@ declare const getPaymentsInputSchema: z.ZodObject<{
2956
2956
  filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
2957
2957
  filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
2958
2958
  filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2959
- PROCESSING: "PROCESSING";
2960
- PENDING: "PENDING";
2961
2959
  BOOKED: "BOOKED";
2962
- CANCELLED: "CANCELLED";
2963
2960
  REJECTED: "REJECTED";
2961
+ PENDING: "PENDING";
2962
+ PROCESSING: "PROCESSING";
2963
+ CANCELLED: "CANCELLED";
2964
2964
  SCHEDULED: "SCHEDULED";
2965
2965
  HOLD: "HOLD";
2966
2966
  INFO: "INFO";
2967
2967
  }>, z.ZodArray<z.ZodEnum<{
2968
- PROCESSING: "PROCESSING";
2969
- PENDING: "PENDING";
2970
2968
  BOOKED: "BOOKED";
2971
- CANCELLED: "CANCELLED";
2972
2969
  REJECTED: "REJECTED";
2970
+ PENDING: "PENDING";
2971
+ PROCESSING: "PROCESSING";
2972
+ CANCELLED: "CANCELLED";
2973
2973
  SCHEDULED: "SCHEDULED";
2974
2974
  HOLD: "HOLD";
2975
2975
  INFO: "INFO";
@@ -3903,20 +3903,20 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
3903
3903
  }, z.core.$strip>;
3904
3904
  filterAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
3905
3905
  filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
3906
+ OPENED: "OPENED";
3906
3907
  AUTHORIZED: "AUTHORIZED";
3907
3908
  COMPLETED: "COMPLETED";
3908
3909
  BOOKED: "BOOKED";
3909
- REJECTED: "REJECTED";
3910
- OPENED: "OPENED";
3911
3910
  SETTLED: "SETTLED";
3911
+ REJECTED: "REJECTED";
3912
3912
  CLOSED: "CLOSED";
3913
3913
  }>, z.ZodArray<z.ZodEnum<{
3914
+ OPENED: "OPENED";
3914
3915
  AUTHORIZED: "AUTHORIZED";
3915
3916
  COMPLETED: "COMPLETED";
3916
3917
  BOOKED: "BOOKED";
3917
- REJECTED: "REJECTED";
3918
- OPENED: "OPENED";
3919
3918
  SETTLED: "SETTLED";
3919
+ REJECTED: "REJECTED";
3920
3920
  CLOSED: "CLOSED";
3921
3921
  }>>]>>;
3922
3922
  filterPaymentType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
package/dist/base.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.D3w3JIsQ.js';
2
- import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.DhMeQgpB.js';
1
+ import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.CgiEbvJu.js';
2
+ import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.-8YAJoxw.js';
3
3
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
4
4
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
5
5
  import { WorkerEntrypoint } from 'cloudflare:workers';
@@ -2711,15 +2711,15 @@ declare const getBatchesInputSchema: z.ZodObject<{
2711
2711
  filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
2712
2712
  filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2713
2713
  AUTHORIZED: "AUTHORIZED";
2714
+ COMPLETED: "COMPLETED";
2714
2715
  PROCESSING: "PROCESSING";
2715
2716
  READY_TO_SIGN: "READY_TO_SIGN";
2716
- COMPLETED: "COMPLETED";
2717
2717
  FAILED: "FAILED";
2718
2718
  }>, z.ZodArray<z.ZodEnum<{
2719
2719
  AUTHORIZED: "AUTHORIZED";
2720
+ COMPLETED: "COMPLETED";
2720
2721
  PROCESSING: "PROCESSING";
2721
2722
  READY_TO_SIGN: "READY_TO_SIGN";
2722
- COMPLETED: "COMPLETED";
2723
2723
  FAILED: "FAILED";
2724
2724
  }>>]>>;
2725
2725
  }, z.core.$strip>;
@@ -2956,20 +2956,20 @@ declare const getPaymentsInputSchema: z.ZodObject<{
2956
2956
  filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
2957
2957
  filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
2958
2958
  filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2959
- PROCESSING: "PROCESSING";
2960
- PENDING: "PENDING";
2961
2959
  BOOKED: "BOOKED";
2962
- CANCELLED: "CANCELLED";
2963
2960
  REJECTED: "REJECTED";
2961
+ PENDING: "PENDING";
2962
+ PROCESSING: "PROCESSING";
2963
+ CANCELLED: "CANCELLED";
2964
2964
  SCHEDULED: "SCHEDULED";
2965
2965
  HOLD: "HOLD";
2966
2966
  INFO: "INFO";
2967
2967
  }>, z.ZodArray<z.ZodEnum<{
2968
- PROCESSING: "PROCESSING";
2969
- PENDING: "PENDING";
2970
2968
  BOOKED: "BOOKED";
2971
- CANCELLED: "CANCELLED";
2972
2969
  REJECTED: "REJECTED";
2970
+ PENDING: "PENDING";
2971
+ PROCESSING: "PROCESSING";
2972
+ CANCELLED: "CANCELLED";
2973
2973
  SCHEDULED: "SCHEDULED";
2974
2974
  HOLD: "HOLD";
2975
2975
  INFO: "INFO";
@@ -3903,20 +3903,20 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
3903
3903
  }, z.core.$strip>;
3904
3904
  filterAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
3905
3905
  filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
3906
+ OPENED: "OPENED";
3906
3907
  AUTHORIZED: "AUTHORIZED";
3907
3908
  COMPLETED: "COMPLETED";
3908
3909
  BOOKED: "BOOKED";
3909
- REJECTED: "REJECTED";
3910
- OPENED: "OPENED";
3911
3910
  SETTLED: "SETTLED";
3911
+ REJECTED: "REJECTED";
3912
3912
  CLOSED: "CLOSED";
3913
3913
  }>, z.ZodArray<z.ZodEnum<{
3914
+ OPENED: "OPENED";
3914
3915
  AUTHORIZED: "AUTHORIZED";
3915
3916
  COMPLETED: "COMPLETED";
3916
3917
  BOOKED: "BOOKED";
3917
- REJECTED: "REJECTED";
3918
- OPENED: "OPENED";
3919
3918
  SETTLED: "SETTLED";
3919
+ REJECTED: "REJECTED";
3920
3920
  CLOSED: "CLOSED";
3921
3921
  }>>]>>;
3922
3922
  filterPaymentType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
@@ -1,4 +1,4 @@
1
- export { aC as account, aD as accountCredentials, aE as batch, aF as ott, aG as payment, aH as paymentRequest } from '../shared/bank.D3w3JIsQ.cjs';
1
+ export { aC as account, aD as accountCredentials, aE as batch, aF as ott, aG as payment, aH as paymentRequest } from '../shared/bank.CgiEbvJu.cjs';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import '@develit-io/general-codes';
@@ -1,4 +1,4 @@
1
- export { aC as account, aD as accountCredentials, aE as batch, aF as ott, aG as payment, aH as paymentRequest } from '../shared/bank.D3w3JIsQ.mjs';
1
+ export { aC as account, aD as accountCredentials, aE as batch, aF as ott, aG as payment, aH as paymentRequest } from '../shared/bank.CgiEbvJu.mjs';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import '@develit-io/general-codes';
@@ -1,4 +1,4 @@
1
- export { aC as account, aD as accountCredentials, aE as batch, aF as ott, aG as payment, aH as paymentRequest } from '../shared/bank.D3w3JIsQ.js';
1
+ export { aC as account, aD as accountCredentials, aE as batch, aF as ott, aG as payment, aH as paymentRequest } from '../shared/bank.CgiEbvJu.js';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import '@develit-io/general-codes';
@@ -66,18 +66,54 @@ const mergeLastSyncBankRefIds = (previous, incoming, cap = LAST_SYNC_BANK_REF_ID
66
66
  return [...new Set(merged)].slice(-cap);
67
67
  };
68
68
 
69
- async function pushToQueue$1(queue, message) {
70
- if (!Array.isArray(message)) {
71
- await queue.send(message, { contentType: "v8" });
72
- return;
69
+ const MAX_BATCH_MESSAGES = 100;
70
+ const MESSAGE_BYTE_CEILING = 112 * 1024;
71
+ const BATCH_BYTE_CEILING = 224 * 1024;
72
+ function estimateMessageBytes(message) {
73
+ return new TextEncoder().encode(JSON.stringify(message)).length;
74
+ }
75
+ function planQueueBatches(messages) {
76
+ const chunks = [];
77
+ const oversized = [];
78
+ let current = [];
79
+ let currentBytes = 0;
80
+ for (const message of messages) {
81
+ const bytes = estimateMessageBytes(message);
82
+ if (bytes > MESSAGE_BYTE_CEILING) {
83
+ oversized.push({ message, bytes });
84
+ continue;
85
+ }
86
+ if (current.length >= MAX_BATCH_MESSAGES || currentBytes + bytes > BATCH_BYTE_CEILING) {
87
+ chunks.push(current);
88
+ current = [];
89
+ currentBytes = 0;
90
+ }
91
+ current.push(message);
92
+ currentBytes += bytes;
73
93
  }
74
- await queue.sendBatch(
75
- message.map((m) => ({
76
- body: m,
77
- contentType: "v8"
78
- }))
79
- );
94
+ if (current.length > 0) {
95
+ chunks.push(current);
96
+ }
97
+ return { chunks, oversized };
80
98
  }
99
+ async function pushToQueue(queue, message) {
100
+ const messages = Array.isArray(message) ? message : [message];
101
+ const { chunks, oversized } = planQueueBatches(messages);
102
+ for (const chunk of chunks) {
103
+ if (chunk.length === 1) {
104
+ await queue.send(chunk[0], { contentType: "v8" });
105
+ continue;
106
+ }
107
+ await queue.sendBatch(
108
+ chunk.map((m) => ({
109
+ body: m,
110
+ contentType: "v8"
111
+ }))
112
+ );
113
+ }
114
+ return { sent: messages.length - oversized.length, oversized };
115
+ }
116
+
81
117
  async function failBatchAndPayments(db, batch, paymentRequests, reason) {
82
118
  const prCmds = paymentRequests.filter((p) => p.status !== "REJECTED").map(
83
119
  (p) => bank.updatePaymentRequestStatusCommand(db, {
@@ -289,7 +325,7 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
289
325
  timestamp: /* @__PURE__ */ new Date()
290
326
  }
291
327
  }));
292
- await pushToQueue$1(
328
+ await pushToQueue(
293
329
  this.env.QUEUE_BUS_QUEUE,
294
330
  eventsToEmit
295
331
  );
@@ -301,7 +337,7 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
301
337
  }
302
338
  if (!isMockConnector) {
303
339
  await step.do("enqueue authorization email", async () => {
304
- await pushToQueue$1(this.env.NOTIFICATIONS_QUEUE, {
340
+ await pushToQueue(this.env.NOTIFICATIONS_QUEUE, {
305
341
  type: "email",
306
342
  payload: {
307
343
  email: {
@@ -411,18 +447,6 @@ async function fetchBoundedByWindow({
411
447
  }
412
448
  }
413
449
 
414
- async function pushToQueue(queue, message) {
415
- if (!Array.isArray(message)) {
416
- await queue.send(message, { contentType: "v8" });
417
- return;
418
- }
419
- await queue.sendBatch(
420
- message.map((m) => ({
421
- body: m,
422
- contentType: "v8"
423
- }))
424
- );
425
- }
426
450
  class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
427
451
  async run(event, step) {
428
452
  const { accountId } = event.payload;
@@ -682,10 +706,18 @@ class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
682
706
  seenInstanceId: account.lastSyncMetadata?.instanceId ?? null
683
707
  }).command;
684
708
  if (eventsToEmit.length) {
685
- await pushToQueue(
709
+ const { oversized } = await pushToQueue(
686
710
  this.env.QUEUE_BUS_QUEUE,
687
711
  eventsToEmit
688
712
  );
713
+ for (const { message, bytes } of oversized) {
714
+ logger.error("queue.event-oversized", {
715
+ accountId,
716
+ bytes,
717
+ eventSignal: message.eventSignal,
718
+ bankRefId: message.bankPayment.bankRefId
719
+ });
720
+ }
689
721
  }
690
722
  let syncStateRows;
691
723
  if (createCommands.length) {
@@ -64,18 +64,54 @@ const mergeLastSyncBankRefIds = (previous, incoming, cap = LAST_SYNC_BANK_REF_ID
64
64
  return [...new Set(merged)].slice(-cap);
65
65
  };
66
66
 
67
- async function pushToQueue$1(queue, message) {
68
- if (!Array.isArray(message)) {
69
- await queue.send(message, { contentType: "v8" });
70
- return;
67
+ const MAX_BATCH_MESSAGES = 100;
68
+ const MESSAGE_BYTE_CEILING = 112 * 1024;
69
+ const BATCH_BYTE_CEILING = 224 * 1024;
70
+ function estimateMessageBytes(message) {
71
+ return new TextEncoder().encode(JSON.stringify(message)).length;
72
+ }
73
+ function planQueueBatches(messages) {
74
+ const chunks = [];
75
+ const oversized = [];
76
+ let current = [];
77
+ let currentBytes = 0;
78
+ for (const message of messages) {
79
+ const bytes = estimateMessageBytes(message);
80
+ if (bytes > MESSAGE_BYTE_CEILING) {
81
+ oversized.push({ message, bytes });
82
+ continue;
83
+ }
84
+ if (current.length >= MAX_BATCH_MESSAGES || currentBytes + bytes > BATCH_BYTE_CEILING) {
85
+ chunks.push(current);
86
+ current = [];
87
+ currentBytes = 0;
88
+ }
89
+ current.push(message);
90
+ currentBytes += bytes;
71
91
  }
72
- await queue.sendBatch(
73
- message.map((m) => ({
74
- body: m,
75
- contentType: "v8"
76
- }))
77
- );
92
+ if (current.length > 0) {
93
+ chunks.push(current);
94
+ }
95
+ return { chunks, oversized };
78
96
  }
97
+ async function pushToQueue(queue, message) {
98
+ const messages = Array.isArray(message) ? message : [message];
99
+ const { chunks, oversized } = planQueueBatches(messages);
100
+ for (const chunk of chunks) {
101
+ if (chunk.length === 1) {
102
+ await queue.send(chunk[0], { contentType: "v8" });
103
+ continue;
104
+ }
105
+ await queue.sendBatch(
106
+ chunk.map((m) => ({
107
+ body: m,
108
+ contentType: "v8"
109
+ }))
110
+ );
111
+ }
112
+ return { sent: messages.length - oversized.length, oversized };
113
+ }
114
+
79
115
  async function failBatchAndPayments(db, batch, paymentRequests, reason) {
80
116
  const prCmds = paymentRequests.filter((p) => p.status !== "REJECTED").map(
81
117
  (p) => updatePaymentRequestStatusCommand(db, {
@@ -287,7 +323,7 @@ class BankProcessBatch extends WorkflowEntrypoint {
287
323
  timestamp: /* @__PURE__ */ new Date()
288
324
  }
289
325
  }));
290
- await pushToQueue$1(
326
+ await pushToQueue(
291
327
  this.env.QUEUE_BUS_QUEUE,
292
328
  eventsToEmit
293
329
  );
@@ -299,7 +335,7 @@ class BankProcessBatch extends WorkflowEntrypoint {
299
335
  }
300
336
  if (!isMockConnector) {
301
337
  await step.do("enqueue authorization email", async () => {
302
- await pushToQueue$1(this.env.NOTIFICATIONS_QUEUE, {
338
+ await pushToQueue(this.env.NOTIFICATIONS_QUEUE, {
303
339
  type: "email",
304
340
  payload: {
305
341
  email: {
@@ -409,18 +445,6 @@ async function fetchBoundedByWindow({
409
445
  }
410
446
  }
411
447
 
412
- async function pushToQueue(queue, message) {
413
- if (!Array.isArray(message)) {
414
- await queue.send(message, { contentType: "v8" });
415
- return;
416
- }
417
- await queue.sendBatch(
418
- message.map((m) => ({
419
- body: m,
420
- contentType: "v8"
421
- }))
422
- );
423
- }
424
448
  class BankSyncAccountPayments extends WorkflowEntrypoint {
425
449
  async run(event, step) {
426
450
  const { accountId } = event.payload;
@@ -680,10 +704,18 @@ class BankSyncAccountPayments extends WorkflowEntrypoint {
680
704
  seenInstanceId: account.lastSyncMetadata?.instanceId ?? null
681
705
  }).command;
682
706
  if (eventsToEmit.length) {
683
- await pushToQueue(
707
+ const { oversized } = await pushToQueue(
684
708
  this.env.QUEUE_BUS_QUEUE,
685
709
  eventsToEmit
686
710
  );
711
+ for (const { message, bytes } of oversized) {
712
+ logger.error("queue.event-oversized", {
713
+ accountId,
714
+ bytes,
715
+ eventSignal: message.eventSignal,
716
+ bankRefId: message.bankPayment.bankRefId
717
+ });
718
+ }
687
719
  }
688
720
  let syncStateRows;
689
721
  if (createCommands.length) {
@@ -1,4 +1,4 @@
1
- import { e as CurrencyCode, S as BankCode, a2 as CountryCode, P as PaymentRequestSelectType } from './bank.D3w3JIsQ.js';
1
+ import { e as CurrencyCode, S as BankCode, a2 as CountryCode, P as PaymentRequestSelectType } from './bank.CgiEbvJu.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
@@ -3280,7 +3280,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3280
3280
  name: string;
3281
3281
  tableName: "batch";
3282
3282
  dataType: "string enum";
3283
- data: "AUTHORIZED" | "PROCESSING" | "READY_TO_SIGN" | "COMPLETED" | "FAILED";
3283
+ data: "AUTHORIZED" | "COMPLETED" | "PROCESSING" | "READY_TO_SIGN" | "FAILED";
3284
3284
  driverParam: string;
3285
3285
  notNull: false;
3286
3286
  hasDefault: false;
@@ -3656,7 +3656,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3656
3656
  name: string;
3657
3657
  tableName: "payment";
3658
3658
  dataType: "string enum";
3659
- data: "PROCESSING" | "PENDING" | "BOOKED" | "CANCELLED" | "REJECTED" | "SCHEDULED" | "HOLD" | "INFO";
3659
+ data: "BOOKED" | "REJECTED" | "PENDING" | "PROCESSING" | "CANCELLED" | "SCHEDULED" | "HOLD" | "INFO";
3660
3660
  driverParam: string;
3661
3661
  notNull: true;
3662
3662
  hasDefault: false;
@@ -4160,7 +4160,7 @@ declare const paymentRequest: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
4160
4160
  name: string;
4161
4161
  tableName: "payment_request";
4162
4162
  dataType: "string enum";
4163
- data: "AUTHORIZED" | "COMPLETED" | "BOOKED" | "REJECTED" | "OPENED" | "SETTLED" | "CLOSED";
4163
+ data: "OPENED" | "AUTHORIZED" | "COMPLETED" | "BOOKED" | "SETTLED" | "REJECTED" | "CLOSED";
4164
4164
  driverParam: string;
4165
4165
  notNull: true;
4166
4166
  hasDefault: false;
@@ -3280,7 +3280,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3280
3280
  name: string;
3281
3281
  tableName: "batch";
3282
3282
  dataType: "string enum";
3283
- data: "AUTHORIZED" | "PROCESSING" | "READY_TO_SIGN" | "COMPLETED" | "FAILED";
3283
+ data: "AUTHORIZED" | "COMPLETED" | "PROCESSING" | "READY_TO_SIGN" | "FAILED";
3284
3284
  driverParam: string;
3285
3285
  notNull: false;
3286
3286
  hasDefault: false;
@@ -3656,7 +3656,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3656
3656
  name: string;
3657
3657
  tableName: "payment";
3658
3658
  dataType: "string enum";
3659
- data: "PROCESSING" | "PENDING" | "BOOKED" | "CANCELLED" | "REJECTED" | "SCHEDULED" | "HOLD" | "INFO";
3659
+ data: "BOOKED" | "REJECTED" | "PENDING" | "PROCESSING" | "CANCELLED" | "SCHEDULED" | "HOLD" | "INFO";
3660
3660
  driverParam: string;
3661
3661
  notNull: true;
3662
3662
  hasDefault: false;
@@ -4160,7 +4160,7 @@ declare const paymentRequest: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
4160
4160
  name: string;
4161
4161
  tableName: "payment_request";
4162
4162
  dataType: "string enum";
4163
- data: "AUTHORIZED" | "COMPLETED" | "BOOKED" | "REJECTED" | "OPENED" | "SETTLED" | "CLOSED";
4163
+ data: "OPENED" | "AUTHORIZED" | "COMPLETED" | "BOOKED" | "SETTLED" | "REJECTED" | "CLOSED";
4164
4164
  driverParam: string;
4165
4165
  notNull: true;
4166
4166
  hasDefault: false;
@@ -3280,7 +3280,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3280
3280
  name: string;
3281
3281
  tableName: "batch";
3282
3282
  dataType: "string enum";
3283
- data: "AUTHORIZED" | "PROCESSING" | "READY_TO_SIGN" | "COMPLETED" | "FAILED";
3283
+ data: "AUTHORIZED" | "COMPLETED" | "PROCESSING" | "READY_TO_SIGN" | "FAILED";
3284
3284
  driverParam: string;
3285
3285
  notNull: false;
3286
3286
  hasDefault: false;
@@ -3656,7 +3656,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3656
3656
  name: string;
3657
3657
  tableName: "payment";
3658
3658
  dataType: "string enum";
3659
- data: "PROCESSING" | "PENDING" | "BOOKED" | "CANCELLED" | "REJECTED" | "SCHEDULED" | "HOLD" | "INFO";
3659
+ data: "BOOKED" | "REJECTED" | "PENDING" | "PROCESSING" | "CANCELLED" | "SCHEDULED" | "HOLD" | "INFO";
3660
3660
  driverParam: string;
3661
3661
  notNull: true;
3662
3662
  hasDefault: false;
@@ -4160,7 +4160,7 @@ declare const paymentRequest: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
4160
4160
  name: string;
4161
4161
  tableName: "payment_request";
4162
4162
  dataType: "string enum";
4163
- data: "AUTHORIZED" | "COMPLETED" | "BOOKED" | "REJECTED" | "OPENED" | "SETTLED" | "CLOSED";
4163
+ data: "OPENED" | "AUTHORIZED" | "COMPLETED" | "BOOKED" | "SETTLED" | "REJECTED" | "CLOSED";
4164
4164
  driverParam: string;
4165
4165
  notNull: true;
4166
4166
  hasDefault: false;
@@ -1,4 +1,4 @@
1
- import { e as CurrencyCode, S as BankCode, a2 as CountryCode, P as PaymentRequestSelectType } from './bank.D3w3JIsQ.mjs';
1
+ import { e as CurrencyCode, S as BankCode, a2 as CountryCode, P as PaymentRequestSelectType } from './bank.CgiEbvJu.mjs';
2
2
  import { z } from 'zod';
3
3
 
4
4
  type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
@@ -1,4 +1,4 @@
1
- import { e as CurrencyCode, S as BankCode, a2 as CountryCode, P as PaymentRequestSelectType } from './bank.D3w3JIsQ.cjs';
1
+ import { e as CurrencyCode, S as BankCode, a2 as CountryCode, P as PaymentRequestSelectType } from './bank.CgiEbvJu.cjs';
2
2
  import { z } from 'zod';
3
3
 
4
4
  type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
package/dist/types.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { I as IBankConnector, b as ConnectorKey, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, E as EndToEndIdPayment, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.D3w3JIsQ.cjs';
2
- export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, F as AccountCredentialsUpdateType, G as AccountPatchType, J as AccountStatus, K as AccountUpdateType, M as AuthorizedBatch, N as BASE_TERMINAL_STATUSES, O as BATCH_MODES, Q as BATCH_STATUES, Q as BATCH_STATUSES, R as BankAccountWithLastSync, S as BankCode, T as BatchInsertType, U as BatchLifecycle, V as BatchMode, W as BatchPayment, B as BatchSelectType, X as BatchStatus, Y as CHARGE_BEARERS, Z as CONNECTOR_KEYS, _ as COUNTRY_CODES, $ as CREDENTIALS_TYPES, a0 as ChargeBearer, a1 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a2 as CountryCode, a3 as CredentialsType, e as CurrencyCode, a4 as INSTRUCTION_PRIORITIES, a5 as InstructionPriority, L as LastSyncMetadata, a6 as PAYMENT_DIRECTIONS, a7 as PAYMENT_REQUEST_STATUSES, a8 as PAYMENT_STATUSES, a9 as PAYMENT_TYPES, aa as PaymentDirection, ab as PaymentFailedInsertType, ac as PaymentInsertType, ad as PaymentLifecycle, ae as PaymentPreparedInsertType, af as PaymentStatus, ag as ProcessingBatch, ah as ReadyToSignBatch, ai as ResolvedCredentials, aj as TOKEN_TYPES, ak as TokenType, al as accountCredentialsInsertSchema, am as accountCredentialsSelectSchema, an as accountCredentialsUpdateSchema, ao as accountInsertSchema, ap as accountSelectSchema, aq as accountUpdateSchema, ar as hasPaymentAccountAssigned, as as isBatchAuthorized, at as isBatchCompleted, au as isBatchFailed, av as isBatchInitiated, aw as isBatchProcessing, ax as isBatchReadyToSign, ay as isPaymentCompleted, az as isPendingStatus, aA as isProcessedStatus, aB as isTerminalStatus } from './shared/bank.D3w3JIsQ.cjs';
3
- import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.CggHtT3y.cjs';
4
- export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.CggHtT3y.cjs';
1
+ import { I as IBankConnector, b as ConnectorKey, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, E as EndToEndIdPayment, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.CgiEbvJu.cjs';
2
+ export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, F as AccountCredentialsUpdateType, G as AccountPatchType, J as AccountStatus, K as AccountUpdateType, M as AuthorizedBatch, N as BASE_TERMINAL_STATUSES, O as BATCH_MODES, Q as BATCH_STATUES, Q as BATCH_STATUSES, R as BankAccountWithLastSync, S as BankCode, T as BatchInsertType, U as BatchLifecycle, V as BatchMode, W as BatchPayment, B as BatchSelectType, X as BatchStatus, Y as CHARGE_BEARERS, Z as CONNECTOR_KEYS, _ as COUNTRY_CODES, $ as CREDENTIALS_TYPES, a0 as ChargeBearer, a1 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a2 as CountryCode, a3 as CredentialsType, e as CurrencyCode, a4 as INSTRUCTION_PRIORITIES, a5 as InstructionPriority, L as LastSyncMetadata, a6 as PAYMENT_DIRECTIONS, a7 as PAYMENT_REQUEST_STATUSES, a8 as PAYMENT_STATUSES, a9 as PAYMENT_TYPES, aa as PaymentDirection, ab as PaymentFailedInsertType, ac as PaymentInsertType, ad as PaymentLifecycle, ae as PaymentPreparedInsertType, af as PaymentStatus, ag as ProcessingBatch, ah as ReadyToSignBatch, ai as ResolvedCredentials, aj as TOKEN_TYPES, ak as TokenType, al as accountCredentialsInsertSchema, am as accountCredentialsSelectSchema, an as accountCredentialsUpdateSchema, ao as accountInsertSchema, ap as accountSelectSchema, aq as accountUpdateSchema, ar as hasPaymentAccountAssigned, as as isBatchAuthorized, at as isBatchCompleted, au as isBatchFailed, av as isBatchInitiated, aw as isBatchProcessing, ax as isBatchReadyToSign, ay as isPaymentCompleted, az as isPendingStatus, aA as isProcessedStatus, aB as isTerminalStatus } from './shared/bank.CgiEbvJu.cjs';
3
+ import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.DZyrkXc_.cjs';
4
+ export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.DZyrkXc_.cjs';
5
5
  import { z } from 'zod';
6
6
  import { BaseEvent } from '@develit-io/backend-sdk';
7
7
  import * as drizzle_orm_zod from 'drizzle-orm/zod';
package/dist/types.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { I as IBankConnector, b as ConnectorKey, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, E as EndToEndIdPayment, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.D3w3JIsQ.mjs';
2
- export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, F as AccountCredentialsUpdateType, G as AccountPatchType, J as AccountStatus, K as AccountUpdateType, M as AuthorizedBatch, N as BASE_TERMINAL_STATUSES, O as BATCH_MODES, Q as BATCH_STATUES, Q as BATCH_STATUSES, R as BankAccountWithLastSync, S as BankCode, T as BatchInsertType, U as BatchLifecycle, V as BatchMode, W as BatchPayment, B as BatchSelectType, X as BatchStatus, Y as CHARGE_BEARERS, Z as CONNECTOR_KEYS, _ as COUNTRY_CODES, $ as CREDENTIALS_TYPES, a0 as ChargeBearer, a1 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a2 as CountryCode, a3 as CredentialsType, e as CurrencyCode, a4 as INSTRUCTION_PRIORITIES, a5 as InstructionPriority, L as LastSyncMetadata, a6 as PAYMENT_DIRECTIONS, a7 as PAYMENT_REQUEST_STATUSES, a8 as PAYMENT_STATUSES, a9 as PAYMENT_TYPES, aa as PaymentDirection, ab as PaymentFailedInsertType, ac as PaymentInsertType, ad as PaymentLifecycle, ae as PaymentPreparedInsertType, af as PaymentStatus, ag as ProcessingBatch, ah as ReadyToSignBatch, ai as ResolvedCredentials, aj as TOKEN_TYPES, ak as TokenType, al as accountCredentialsInsertSchema, am as accountCredentialsSelectSchema, an as accountCredentialsUpdateSchema, ao as accountInsertSchema, ap as accountSelectSchema, aq as accountUpdateSchema, ar as hasPaymentAccountAssigned, as as isBatchAuthorized, at as isBatchCompleted, au as isBatchFailed, av as isBatchInitiated, aw as isBatchProcessing, ax as isBatchReadyToSign, ay as isPaymentCompleted, az as isPendingStatus, aA as isProcessedStatus, aB as isTerminalStatus } from './shared/bank.D3w3JIsQ.mjs';
3
- import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.CDB7SWNr.mjs';
4
- export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.CDB7SWNr.mjs';
1
+ import { I as IBankConnector, b as ConnectorKey, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, E as EndToEndIdPayment, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.CgiEbvJu.mjs';
2
+ export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, F as AccountCredentialsUpdateType, G as AccountPatchType, J as AccountStatus, K as AccountUpdateType, M as AuthorizedBatch, N as BASE_TERMINAL_STATUSES, O as BATCH_MODES, Q as BATCH_STATUES, Q as BATCH_STATUSES, R as BankAccountWithLastSync, S as BankCode, T as BatchInsertType, U as BatchLifecycle, V as BatchMode, W as BatchPayment, B as BatchSelectType, X as BatchStatus, Y as CHARGE_BEARERS, Z as CONNECTOR_KEYS, _ as COUNTRY_CODES, $ as CREDENTIALS_TYPES, a0 as ChargeBearer, a1 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a2 as CountryCode, a3 as CredentialsType, e as CurrencyCode, a4 as INSTRUCTION_PRIORITIES, a5 as InstructionPriority, L as LastSyncMetadata, a6 as PAYMENT_DIRECTIONS, a7 as PAYMENT_REQUEST_STATUSES, a8 as PAYMENT_STATUSES, a9 as PAYMENT_TYPES, aa as PaymentDirection, ab as PaymentFailedInsertType, ac as PaymentInsertType, ad as PaymentLifecycle, ae as PaymentPreparedInsertType, af as PaymentStatus, ag as ProcessingBatch, ah as ReadyToSignBatch, ai as ResolvedCredentials, aj as TOKEN_TYPES, ak as TokenType, al as accountCredentialsInsertSchema, am as accountCredentialsSelectSchema, an as accountCredentialsUpdateSchema, ao as accountInsertSchema, ap as accountSelectSchema, aq as accountUpdateSchema, ar as hasPaymentAccountAssigned, as as isBatchAuthorized, at as isBatchCompleted, au as isBatchFailed, av as isBatchInitiated, aw as isBatchProcessing, ax as isBatchReadyToSign, ay as isPaymentCompleted, az as isPendingStatus, aA as isProcessedStatus, aB as isTerminalStatus } from './shared/bank.CgiEbvJu.mjs';
3
+ import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.D19D3a9C.mjs';
4
+ export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.D19D3a9C.mjs';
5
5
  import { z } from 'zod';
6
6
  import { BaseEvent } from '@develit-io/backend-sdk';
7
7
  import * as drizzle_orm_zod from 'drizzle-orm/zod';
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { I as IBankConnector, b as ConnectorKey, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, E as EndToEndIdPayment, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.D3w3JIsQ.js';
2
- export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, F as AccountCredentialsUpdateType, G as AccountPatchType, J as AccountStatus, K as AccountUpdateType, M as AuthorizedBatch, N as BASE_TERMINAL_STATUSES, O as BATCH_MODES, Q as BATCH_STATUES, Q as BATCH_STATUSES, R as BankAccountWithLastSync, S as BankCode, T as BatchInsertType, U as BatchLifecycle, V as BatchMode, W as BatchPayment, B as BatchSelectType, X as BatchStatus, Y as CHARGE_BEARERS, Z as CONNECTOR_KEYS, _ as COUNTRY_CODES, $ as CREDENTIALS_TYPES, a0 as ChargeBearer, a1 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a2 as CountryCode, a3 as CredentialsType, e as CurrencyCode, a4 as INSTRUCTION_PRIORITIES, a5 as InstructionPriority, L as LastSyncMetadata, a6 as PAYMENT_DIRECTIONS, a7 as PAYMENT_REQUEST_STATUSES, a8 as PAYMENT_STATUSES, a9 as PAYMENT_TYPES, aa as PaymentDirection, ab as PaymentFailedInsertType, ac as PaymentInsertType, ad as PaymentLifecycle, ae as PaymentPreparedInsertType, af as PaymentStatus, ag as ProcessingBatch, ah as ReadyToSignBatch, ai as ResolvedCredentials, aj as TOKEN_TYPES, ak as TokenType, al as accountCredentialsInsertSchema, am as accountCredentialsSelectSchema, an as accountCredentialsUpdateSchema, ao as accountInsertSchema, ap as accountSelectSchema, aq as accountUpdateSchema, ar as hasPaymentAccountAssigned, as as isBatchAuthorized, at as isBatchCompleted, au as isBatchFailed, av as isBatchInitiated, aw as isBatchProcessing, ax as isBatchReadyToSign, ay as isPaymentCompleted, az as isPendingStatus, aA as isProcessedStatus, aB as isTerminalStatus } from './shared/bank.D3w3JIsQ.js';
3
- import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.DhMeQgpB.js';
4
- export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.DhMeQgpB.js';
1
+ import { I as IBankConnector, b as ConnectorKey, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, E as EndToEndIdPayment, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.CgiEbvJu.js';
2
+ export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, F as AccountCredentialsUpdateType, G as AccountPatchType, J as AccountStatus, K as AccountUpdateType, M as AuthorizedBatch, N as BASE_TERMINAL_STATUSES, O as BATCH_MODES, Q as BATCH_STATUES, Q as BATCH_STATUSES, R as BankAccountWithLastSync, S as BankCode, T as BatchInsertType, U as BatchLifecycle, V as BatchMode, W as BatchPayment, B as BatchSelectType, X as BatchStatus, Y as CHARGE_BEARERS, Z as CONNECTOR_KEYS, _ as COUNTRY_CODES, $ as CREDENTIALS_TYPES, a0 as ChargeBearer, a1 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a2 as CountryCode, a3 as CredentialsType, e as CurrencyCode, a4 as INSTRUCTION_PRIORITIES, a5 as InstructionPriority, L as LastSyncMetadata, a6 as PAYMENT_DIRECTIONS, a7 as PAYMENT_REQUEST_STATUSES, a8 as PAYMENT_STATUSES, a9 as PAYMENT_TYPES, aa as PaymentDirection, ab as PaymentFailedInsertType, ac as PaymentInsertType, ad as PaymentLifecycle, ae as PaymentPreparedInsertType, af as PaymentStatus, ag as ProcessingBatch, ah as ReadyToSignBatch, ai as ResolvedCredentials, aj as TOKEN_TYPES, ak as TokenType, al as accountCredentialsInsertSchema, am as accountCredentialsSelectSchema, an as accountCredentialsUpdateSchema, ao as accountInsertSchema, ap as accountSelectSchema, aq as accountUpdateSchema, ar as hasPaymentAccountAssigned, as as isBatchAuthorized, at as isBatchCompleted, au as isBatchFailed, av as isBatchInitiated, aw as isBatchProcessing, ax as isBatchReadyToSign, ay as isPaymentCompleted, az as isPendingStatus, aA as isProcessedStatus, aB as isTerminalStatus } from './shared/bank.CgiEbvJu.js';
3
+ import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.-8YAJoxw.js';
4
+ export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.-8YAJoxw.js';
5
5
  import { z } from 'zod';
6
6
  import { BaseEvent } from '@develit-io/backend-sdk';
7
7
  import * as drizzle_orm_zod from 'drizzle-orm/zod';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/bank",
3
- "version": "6.1.0",
3
+ "version": "6.1.1",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {