@develit-services/bank 5.0.1 → 5.1.0

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,6 +1,6 @@
1
1
  import * as drizzle_orm from 'drizzle-orm';
2
- 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.BJTq7Qw9.cjs';
3
- import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.wFDtecu7.cjs';
2
+ 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.Do1KUeDr.cjs';
3
+ import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.C-edstpR.cjs';
4
4
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
5
5
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
6
6
  import { WorkerEntrypoint } from 'cloudflare:workers';
@@ -2703,15 +2703,15 @@ declare const getBatchesInputSchema: z.ZodObject<{
2703
2703
  filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
2704
2704
  filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2705
2705
  AUTHORIZED: "AUTHORIZED";
2706
- COMPLETED: "COMPLETED";
2707
2706
  PROCESSING: "PROCESSING";
2708
2707
  READY_TO_SIGN: "READY_TO_SIGN";
2708
+ COMPLETED: "COMPLETED";
2709
2709
  FAILED: "FAILED";
2710
2710
  }>, z.ZodArray<z.ZodEnum<{
2711
2711
  AUTHORIZED: "AUTHORIZED";
2712
- COMPLETED: "COMPLETED";
2713
2712
  PROCESSING: "PROCESSING";
2714
2713
  READY_TO_SIGN: "READY_TO_SIGN";
2714
+ COMPLETED: "COMPLETED";
2715
2715
  FAILED: "FAILED";
2716
2716
  }>>]>>;
2717
2717
  }, z.core.$strip>;
@@ -2948,20 +2948,20 @@ declare const getPaymentsInputSchema: z.ZodObject<{
2948
2948
  filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
2949
2949
  filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
2950
2950
  filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2951
- BOOKED: "BOOKED";
2952
- REJECTED: "REJECTED";
2953
- PENDING: "PENDING";
2954
2951
  PROCESSING: "PROCESSING";
2952
+ PENDING: "PENDING";
2953
+ BOOKED: "BOOKED";
2955
2954
  CANCELLED: "CANCELLED";
2955
+ REJECTED: "REJECTED";
2956
2956
  SCHEDULED: "SCHEDULED";
2957
2957
  HOLD: "HOLD";
2958
2958
  INFO: "INFO";
2959
2959
  }>, z.ZodArray<z.ZodEnum<{
2960
- BOOKED: "BOOKED";
2961
- REJECTED: "REJECTED";
2962
- PENDING: "PENDING";
2963
2960
  PROCESSING: "PROCESSING";
2961
+ PENDING: "PENDING";
2962
+ BOOKED: "BOOKED";
2964
2963
  CANCELLED: "CANCELLED";
2964
+ REJECTED: "REJECTED";
2965
2965
  SCHEDULED: "SCHEDULED";
2966
2966
  HOLD: "HOLD";
2967
2967
  INFO: "INFO";
@@ -2994,6 +2994,30 @@ type GetPaymentsOutput = {
2994
2994
  totalCount: number;
2995
2995
  };
2996
2996
 
2997
+ declare const getPaymentsByRequestIdsInputSchema: z.ZodObject<{
2998
+ paymentRequestIds: z.ZodArray<z.ZodString>;
2999
+ }, z.core.$strip>;
3000
+ interface GetPaymentsByRequestIdsInput extends z.infer<typeof getPaymentsByRequestIdsInputSchema> {
3001
+ }
3002
+ interface GetPaymentsByRequestIdsOutput {
3003
+ payments: Array<{
3004
+ paymentRequestId: string;
3005
+ payment: {
3006
+ id: string;
3007
+ correlationId: string;
3008
+ status: string;
3009
+ amount: number;
3010
+ currency: string;
3011
+ creditor: {
3012
+ iban?: string;
3013
+ holderName?: string;
3014
+ };
3015
+ createdAt: number;
3016
+ updatedAt?: number;
3017
+ } | null;
3018
+ }>;
3019
+ }
3020
+
2997
3021
  declare const syncAccountInputSchema: z.ZodObject<{
2998
3022
  accountId: z.ZodUUID;
2999
3023
  }, z.core.$strip>;
@@ -3596,20 +3620,20 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
3596
3620
  }, z.core.$strip>;
3597
3621
  filterAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
3598
3622
  filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
3599
- OPENED: "OPENED";
3600
3623
  AUTHORIZED: "AUTHORIZED";
3601
3624
  COMPLETED: "COMPLETED";
3602
3625
  BOOKED: "BOOKED";
3603
- SETTLED: "SETTLED";
3604
3626
  REJECTED: "REJECTED";
3627
+ OPENED: "OPENED";
3628
+ SETTLED: "SETTLED";
3605
3629
  CLOSED: "CLOSED";
3606
3630
  }>, z.ZodArray<z.ZodEnum<{
3607
- OPENED: "OPENED";
3608
3631
  AUTHORIZED: "AUTHORIZED";
3609
3632
  COMPLETED: "COMPLETED";
3610
3633
  BOOKED: "BOOKED";
3611
- SETTLED: "SETTLED";
3612
3634
  REJECTED: "REJECTED";
3635
+ OPENED: "OPENED";
3636
+ SETTLED: "SETTLED";
3613
3637
  CLOSED: "CLOSED";
3614
3638
  }>>]>>;
3615
3639
  filterPaymentType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
@@ -3858,6 +3882,13 @@ declare class BankServiceBase extends BankServiceBase_base {
3858
3882
  iban?: string | null;
3859
3883
  }): void;
3860
3884
  getPayments(input: GetPaymentsInput): Promise<IRPCResponse<GetPaymentsOutput>>;
3885
+ /**
3886
+ * Get payments by payment request IDs (batch query for sweep history)
3887
+ *
3888
+ * @connector DBU - Fully supported
3889
+ * @connector FIO - Not yet implemented (will return empty for FIO payments)
3890
+ */
3891
+ getPaymentsByRequestIds(input: GetPaymentsByRequestIdsInput): Promise<IRPCResponse<GetPaymentsByRequestIdsOutput>>;
3861
3892
  syncAccount(input: SyncAccountInput): Promise<IRPCResponse<SyncAccountOutput>>;
3862
3893
  syncAccountStatus(input: SyncAccountStatusInput): Promise<IRPCResponse<SyncAccountStatusOutput>>;
3863
3894
  syncAccountRestart(input: SyncAccountRestartInput): Promise<IRPCResponse<SyncAccountRestartOutput>>;
package/dist/base.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as drizzle_orm from 'drizzle-orm';
2
- 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.BJTq7Qw9.mjs';
3
- import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.DXU-wqnl.mjs';
2
+ 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.Do1KUeDr.mjs';
3
+ import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.C6BQDtpF.mjs';
4
4
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
5
5
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
6
6
  import { WorkerEntrypoint } from 'cloudflare:workers';
@@ -2703,15 +2703,15 @@ declare const getBatchesInputSchema: z.ZodObject<{
2703
2703
  filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
2704
2704
  filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2705
2705
  AUTHORIZED: "AUTHORIZED";
2706
- COMPLETED: "COMPLETED";
2707
2706
  PROCESSING: "PROCESSING";
2708
2707
  READY_TO_SIGN: "READY_TO_SIGN";
2708
+ COMPLETED: "COMPLETED";
2709
2709
  FAILED: "FAILED";
2710
2710
  }>, z.ZodArray<z.ZodEnum<{
2711
2711
  AUTHORIZED: "AUTHORIZED";
2712
- COMPLETED: "COMPLETED";
2713
2712
  PROCESSING: "PROCESSING";
2714
2713
  READY_TO_SIGN: "READY_TO_SIGN";
2714
+ COMPLETED: "COMPLETED";
2715
2715
  FAILED: "FAILED";
2716
2716
  }>>]>>;
2717
2717
  }, z.core.$strip>;
@@ -2948,20 +2948,20 @@ declare const getPaymentsInputSchema: z.ZodObject<{
2948
2948
  filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
2949
2949
  filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
2950
2950
  filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2951
- BOOKED: "BOOKED";
2952
- REJECTED: "REJECTED";
2953
- PENDING: "PENDING";
2954
2951
  PROCESSING: "PROCESSING";
2952
+ PENDING: "PENDING";
2953
+ BOOKED: "BOOKED";
2955
2954
  CANCELLED: "CANCELLED";
2955
+ REJECTED: "REJECTED";
2956
2956
  SCHEDULED: "SCHEDULED";
2957
2957
  HOLD: "HOLD";
2958
2958
  INFO: "INFO";
2959
2959
  }>, z.ZodArray<z.ZodEnum<{
2960
- BOOKED: "BOOKED";
2961
- REJECTED: "REJECTED";
2962
- PENDING: "PENDING";
2963
2960
  PROCESSING: "PROCESSING";
2961
+ PENDING: "PENDING";
2962
+ BOOKED: "BOOKED";
2964
2963
  CANCELLED: "CANCELLED";
2964
+ REJECTED: "REJECTED";
2965
2965
  SCHEDULED: "SCHEDULED";
2966
2966
  HOLD: "HOLD";
2967
2967
  INFO: "INFO";
@@ -2994,6 +2994,30 @@ type GetPaymentsOutput = {
2994
2994
  totalCount: number;
2995
2995
  };
2996
2996
 
2997
+ declare const getPaymentsByRequestIdsInputSchema: z.ZodObject<{
2998
+ paymentRequestIds: z.ZodArray<z.ZodString>;
2999
+ }, z.core.$strip>;
3000
+ interface GetPaymentsByRequestIdsInput extends z.infer<typeof getPaymentsByRequestIdsInputSchema> {
3001
+ }
3002
+ interface GetPaymentsByRequestIdsOutput {
3003
+ payments: Array<{
3004
+ paymentRequestId: string;
3005
+ payment: {
3006
+ id: string;
3007
+ correlationId: string;
3008
+ status: string;
3009
+ amount: number;
3010
+ currency: string;
3011
+ creditor: {
3012
+ iban?: string;
3013
+ holderName?: string;
3014
+ };
3015
+ createdAt: number;
3016
+ updatedAt?: number;
3017
+ } | null;
3018
+ }>;
3019
+ }
3020
+
2997
3021
  declare const syncAccountInputSchema: z.ZodObject<{
2998
3022
  accountId: z.ZodUUID;
2999
3023
  }, z.core.$strip>;
@@ -3596,20 +3620,20 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
3596
3620
  }, z.core.$strip>;
3597
3621
  filterAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
3598
3622
  filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
3599
- OPENED: "OPENED";
3600
3623
  AUTHORIZED: "AUTHORIZED";
3601
3624
  COMPLETED: "COMPLETED";
3602
3625
  BOOKED: "BOOKED";
3603
- SETTLED: "SETTLED";
3604
3626
  REJECTED: "REJECTED";
3627
+ OPENED: "OPENED";
3628
+ SETTLED: "SETTLED";
3605
3629
  CLOSED: "CLOSED";
3606
3630
  }>, z.ZodArray<z.ZodEnum<{
3607
- OPENED: "OPENED";
3608
3631
  AUTHORIZED: "AUTHORIZED";
3609
3632
  COMPLETED: "COMPLETED";
3610
3633
  BOOKED: "BOOKED";
3611
- SETTLED: "SETTLED";
3612
3634
  REJECTED: "REJECTED";
3635
+ OPENED: "OPENED";
3636
+ SETTLED: "SETTLED";
3613
3637
  CLOSED: "CLOSED";
3614
3638
  }>>]>>;
3615
3639
  filterPaymentType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
@@ -3858,6 +3882,13 @@ declare class BankServiceBase extends BankServiceBase_base {
3858
3882
  iban?: string | null;
3859
3883
  }): void;
3860
3884
  getPayments(input: GetPaymentsInput): Promise<IRPCResponse<GetPaymentsOutput>>;
3885
+ /**
3886
+ * Get payments by payment request IDs (batch query for sweep history)
3887
+ *
3888
+ * @connector DBU - Fully supported
3889
+ * @connector FIO - Not yet implemented (will return empty for FIO payments)
3890
+ */
3891
+ getPaymentsByRequestIds(input: GetPaymentsByRequestIdsInput): Promise<IRPCResponse<GetPaymentsByRequestIdsOutput>>;
3861
3892
  syncAccount(input: SyncAccountInput): Promise<IRPCResponse<SyncAccountOutput>>;
3862
3893
  syncAccountStatus(input: SyncAccountStatusInput): Promise<IRPCResponse<SyncAccountStatusOutput>>;
3863
3894
  syncAccountRestart(input: SyncAccountRestartInput): Promise<IRPCResponse<SyncAccountRestartOutput>>;
package/dist/base.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as drizzle_orm from 'drizzle-orm';
2
- 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.BJTq7Qw9.js';
3
- import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.JAN0kymF.js';
2
+ 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.Do1KUeDr.js';
3
+ import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.pZQAWlIB.js';
4
4
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
5
5
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
6
6
  import { WorkerEntrypoint } from 'cloudflare:workers';
@@ -2703,15 +2703,15 @@ declare const getBatchesInputSchema: z.ZodObject<{
2703
2703
  filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
2704
2704
  filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2705
2705
  AUTHORIZED: "AUTHORIZED";
2706
- COMPLETED: "COMPLETED";
2707
2706
  PROCESSING: "PROCESSING";
2708
2707
  READY_TO_SIGN: "READY_TO_SIGN";
2708
+ COMPLETED: "COMPLETED";
2709
2709
  FAILED: "FAILED";
2710
2710
  }>, z.ZodArray<z.ZodEnum<{
2711
2711
  AUTHORIZED: "AUTHORIZED";
2712
- COMPLETED: "COMPLETED";
2713
2712
  PROCESSING: "PROCESSING";
2714
2713
  READY_TO_SIGN: "READY_TO_SIGN";
2714
+ COMPLETED: "COMPLETED";
2715
2715
  FAILED: "FAILED";
2716
2716
  }>>]>>;
2717
2717
  }, z.core.$strip>;
@@ -2948,20 +2948,20 @@ declare const getPaymentsInputSchema: z.ZodObject<{
2948
2948
  filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
2949
2949
  filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
2950
2950
  filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2951
- BOOKED: "BOOKED";
2952
- REJECTED: "REJECTED";
2953
- PENDING: "PENDING";
2954
2951
  PROCESSING: "PROCESSING";
2952
+ PENDING: "PENDING";
2953
+ BOOKED: "BOOKED";
2955
2954
  CANCELLED: "CANCELLED";
2955
+ REJECTED: "REJECTED";
2956
2956
  SCHEDULED: "SCHEDULED";
2957
2957
  HOLD: "HOLD";
2958
2958
  INFO: "INFO";
2959
2959
  }>, z.ZodArray<z.ZodEnum<{
2960
- BOOKED: "BOOKED";
2961
- REJECTED: "REJECTED";
2962
- PENDING: "PENDING";
2963
2960
  PROCESSING: "PROCESSING";
2961
+ PENDING: "PENDING";
2962
+ BOOKED: "BOOKED";
2964
2963
  CANCELLED: "CANCELLED";
2964
+ REJECTED: "REJECTED";
2965
2965
  SCHEDULED: "SCHEDULED";
2966
2966
  HOLD: "HOLD";
2967
2967
  INFO: "INFO";
@@ -2994,6 +2994,30 @@ type GetPaymentsOutput = {
2994
2994
  totalCount: number;
2995
2995
  };
2996
2996
 
2997
+ declare const getPaymentsByRequestIdsInputSchema: z.ZodObject<{
2998
+ paymentRequestIds: z.ZodArray<z.ZodString>;
2999
+ }, z.core.$strip>;
3000
+ interface GetPaymentsByRequestIdsInput extends z.infer<typeof getPaymentsByRequestIdsInputSchema> {
3001
+ }
3002
+ interface GetPaymentsByRequestIdsOutput {
3003
+ payments: Array<{
3004
+ paymentRequestId: string;
3005
+ payment: {
3006
+ id: string;
3007
+ correlationId: string;
3008
+ status: string;
3009
+ amount: number;
3010
+ currency: string;
3011
+ creditor: {
3012
+ iban?: string;
3013
+ holderName?: string;
3014
+ };
3015
+ createdAt: number;
3016
+ updatedAt?: number;
3017
+ } | null;
3018
+ }>;
3019
+ }
3020
+
2997
3021
  declare const syncAccountInputSchema: z.ZodObject<{
2998
3022
  accountId: z.ZodUUID;
2999
3023
  }, z.core.$strip>;
@@ -3596,20 +3620,20 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
3596
3620
  }, z.core.$strip>;
3597
3621
  filterAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
3598
3622
  filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
3599
- OPENED: "OPENED";
3600
3623
  AUTHORIZED: "AUTHORIZED";
3601
3624
  COMPLETED: "COMPLETED";
3602
3625
  BOOKED: "BOOKED";
3603
- SETTLED: "SETTLED";
3604
3626
  REJECTED: "REJECTED";
3627
+ OPENED: "OPENED";
3628
+ SETTLED: "SETTLED";
3605
3629
  CLOSED: "CLOSED";
3606
3630
  }>, z.ZodArray<z.ZodEnum<{
3607
- OPENED: "OPENED";
3608
3631
  AUTHORIZED: "AUTHORIZED";
3609
3632
  COMPLETED: "COMPLETED";
3610
3633
  BOOKED: "BOOKED";
3611
- SETTLED: "SETTLED";
3612
3634
  REJECTED: "REJECTED";
3635
+ OPENED: "OPENED";
3636
+ SETTLED: "SETTLED";
3613
3637
  CLOSED: "CLOSED";
3614
3638
  }>>]>>;
3615
3639
  filterPaymentType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
@@ -3858,6 +3882,13 @@ declare class BankServiceBase extends BankServiceBase_base {
3858
3882
  iban?: string | null;
3859
3883
  }): void;
3860
3884
  getPayments(input: GetPaymentsInput): Promise<IRPCResponse<GetPaymentsOutput>>;
3885
+ /**
3886
+ * Get payments by payment request IDs (batch query for sweep history)
3887
+ *
3888
+ * @connector DBU - Fully supported
3889
+ * @connector FIO - Not yet implemented (will return empty for FIO payments)
3890
+ */
3891
+ getPaymentsByRequestIds(input: GetPaymentsByRequestIdsInput): Promise<IRPCResponse<GetPaymentsByRequestIdsOutput>>;
3861
3892
  syncAccount(input: SyncAccountInput): Promise<IRPCResponse<SyncAccountOutput>>;
3862
3893
  syncAccountStatus(input: SyncAccountStatusInput): Promise<IRPCResponse<SyncAccountStatusOutput>>;
3863
3894
  syncAccountRestart(input: SyncAccountRestartInput): Promise<IRPCResponse<SyncAccountRestartOutput>>;
package/dist/base.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { bankAccountMetadataSchema, structuredAddressSchema, uuidv4, first, buildMultiFilterConditions as buildMultiFilterConditions$1, workflowInstanceStatusSchema, develitWorker, createInternalError, action, service } from '@develit-io/backend-sdk';
2
- import { G as tables, g as accountInsertSchema, H as relations, J as initiateConnector, o as isProcessedStatus, p as isTerminalStatus, L as getNonTerminalPaymentRequestsQuery, x as toIncomingPayment, j as assignAccount, u as toBatchedPayment, y as toPaymentRequestInsert, a as FinbricksClient, F as FINBRICKS_ENDPOINTS } from './shared/bank.CZ8MQDPa.mjs';
1
+ import { uuidv4, first, buildMultiFilterConditions as buildMultiFilterConditions$1, bankAccountMetadataSchema, structuredAddressSchema, workflowInstanceStatusSchema, develitWorker, createInternalError, action, service } from '@develit-io/backend-sdk';
2
+ import { G as tables, g as accountInsertSchema, H as relations, J as initiateConnector, o as isProcessedStatus, p as isTerminalStatus, L as getNonTerminalPaymentRequestsQuery, x as toIncomingPayment, N as calculateCzechIban, j as assignAccount, u as toBatchedPayment, y as toPaymentRequestInsert, a as FinbricksClient, F as FINBRICKS_ENDPOINTS } from './shared/bank.D5skCz3H.mjs';
3
3
  import { eq, sql, and, like, asc, desc, inArray, gte, lte, isNull, count } from 'drizzle-orm';
4
4
  import { WorkerEntrypoint } from 'cloudflare:workers';
5
5
  import { drizzle } from 'drizzle-orm/d1';
@@ -9,7 +9,7 @@ import { I as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, g as PAYMENT_TYPES, b
9
9
  import { CURRENCY_CODES } from '@develit-io/general-codes';
10
10
  import 'date-fns';
11
11
  import 'node:crypto';
12
- import { h as encrypt, d as createCredentialsResolver, e as updatePaymentRequestStatusCommand, a as getPaymentRequestsByBatchIdQuery, g as getBatchByIdQuery, u as upsertBatchCommand, i as importAesKey, f as createPaymentCommand, b as getAccountByIdQuery } from './shared/bank.BdTj54NO.mjs';
12
+ import { h as encrypt, d as createCredentialsResolver, e as updatePaymentRequestStatusCommand, a as getPaymentRequestsByBatchIdQuery, g as getBatchByIdQuery, u as upsertBatchCommand, i as importAesKey, f as createPaymentCommand, b as getAccountByIdQuery } from './shared/bank.C_JpNoSI.mjs';
13
13
  import 'drizzle-orm/zod';
14
14
  import 'drizzle-orm/sqlite-core';
15
15
 
@@ -71,77 +71,6 @@ async function heartbeatSyncWorkflows({
71
71
  );
72
72
  }
73
73
 
74
- const sendPaymentInputSchema = z.object({
75
- correlationId: z.string().min(1),
76
- refId: z.string().optional(),
77
- amount: z.number().positive(),
78
- paymentType: z.enum(PAYMENT_TYPES),
79
- chargeBearer: z.enum(CHARGE_BEARERS).optional(),
80
- instructionPriority: z.enum(INSTRUCTION_PRIORITIES).optional(),
81
- currency: z.enum(CURRENCY_CODES),
82
- vs: z.string().optional(),
83
- ss: z.string().optional(),
84
- ks: z.string().optional(),
85
- message: z.string().optional(),
86
- creditor: bankAccountMetadataSchema,
87
- debtor: bankAccountMetadataSchema,
88
- sendAsSinglePayment: z.boolean().optional()
89
- }).superRefine((data, ctx) => {
90
- if (data.paymentType === "UNKNOWN") {
91
- ctx.addIssue({
92
- code: "custom",
93
- message: "paymentType=UNKNOWN is not supported. Use DOMESTIC, SEPA, or SWIFT.",
94
- path: ["paymentType"]
95
- });
96
- return;
97
- }
98
- if (!data.debtor.iban) {
99
- ctx.addIssue({
100
- code: "custom",
101
- message: "debtor.iban is required",
102
- path: ["debtor", "iban"]
103
- });
104
- }
105
- if (data.paymentType === "DOMESTIC" || data.paymentType === "SEPA") {
106
- if (!data.creditor.iban) {
107
- ctx.addIssue({
108
- code: "custom",
109
- message: `creditor.iban is required for ${data.paymentType} payments`,
110
- path: ["creditor", "iban"]
111
- });
112
- }
113
- return;
114
- }
115
- if (data.paymentType === "SWIFT") {
116
- const hasIban = !!data.creditor.iban;
117
- const hasBban = !!data.creditor.number && !!(data.creditor.swiftBic ?? data.creditor.bicCor);
118
- if (!hasIban && !hasBban) {
119
- ctx.addIssue({
120
- code: "custom",
121
- message: "SWIFT creditor requires either iban OR (number + swiftBic/bicCor)",
122
- path: ["creditor"]
123
- });
124
- }
125
- }
126
- });
127
-
128
- const sendBatchInputSchema = z.object({
129
- payments: z.array(sendPaymentInputSchema).min(1)
130
- });
131
-
132
- const getAuthUriInputSchema = z.object({
133
- connectorKey: z.enum(CONNECTOR_KEYS)
134
- });
135
-
136
- const authorizeAccountInputSchema = z.object({
137
- ott: z.string(),
138
- urlParams: z.string(),
139
- syncIntervalS: z.number().int().positive().optional(),
140
- startSync: z.boolean().optional(),
141
- lastSyncAt: z.date().optional(),
142
- address: structuredAddressSchema.optional()
143
- });
144
-
145
74
  const upsertAccountCommand = (db, { account }) => {
146
75
  const id = account.id || uuidv4();
147
76
  const { id: _id, ...accountWithoutId } = account;
@@ -420,6 +349,42 @@ const getOttQuery = async (db, { ott }) => {
420
349
  return await db.select().from(tables.ott).where(eq(tables.ott.oneTimeToken, ott)).get();
421
350
  };
422
351
 
352
+ const CHUNK_SIZE = 90;
353
+ const getPaymentsByPaymentRequestIdsQuery = async (db, { paymentRequestIds }) => {
354
+ if (paymentRequestIds.length === 0) return [];
355
+ const paymentRequests = [];
356
+ for (let i = 0; i < paymentRequestIds.length; i += CHUNK_SIZE) {
357
+ const chunkIds = paymentRequestIds.slice(i, i + CHUNK_SIZE);
358
+ const rows = await db.select({
359
+ id: tables.paymentRequest.id,
360
+ correlationId: tables.paymentRequest.correlationId,
361
+ status: tables.paymentRequest.status,
362
+ amount: tables.paymentRequest.amount,
363
+ currency: tables.paymentRequest.currency,
364
+ creditor: tables.paymentRequest.creditor,
365
+ createdAt: tables.paymentRequest.createdAt,
366
+ updatedAt: tables.paymentRequest.updatedAt
367
+ }).from(tables.paymentRequest).where(inArray(tables.paymentRequest.id, chunkIds));
368
+ paymentRequests.push(...rows);
369
+ }
370
+ return paymentRequests.map((pr) => {
371
+ const creditor = typeof pr.creditor === "string" ? JSON.parse(pr.creditor) : pr.creditor || {};
372
+ return {
373
+ paymentRequestId: pr.id,
374
+ payment: {
375
+ id: pr.id,
376
+ correlationId: pr.correlationId,
377
+ status: pr.status,
378
+ amount: pr.amount,
379
+ currency: pr.currency,
380
+ creditor,
381
+ createdAt: pr.createdAt,
382
+ updatedAt: pr.updatedAt
383
+ }
384
+ };
385
+ });
386
+ };
387
+
423
388
  const getPaymentRequestByIdQuery = async (db, { paymentRequestId }) => {
424
389
  const result = await db.select().from(tables.paymentRequest).where(
425
390
  and(
@@ -484,6 +449,79 @@ function buildPaymentRequestEvent(pr) {
484
449
  };
485
450
  }
486
451
 
452
+ const sendPaymentInputSchema = z.object({
453
+ correlationId: z.string().min(1),
454
+ refId: z.string().optional(),
455
+ amount: z.number().positive(),
456
+ paymentType: z.enum(PAYMENT_TYPES),
457
+ chargeBearer: z.enum(CHARGE_BEARERS).optional(),
458
+ instructionPriority: z.enum(INSTRUCTION_PRIORITIES).optional(),
459
+ currency: z.enum(CURRENCY_CODES),
460
+ vs: z.string().optional(),
461
+ ss: z.string().optional(),
462
+ ks: z.string().optional(),
463
+ message: z.string().optional(),
464
+ creditor: bankAccountMetadataSchema,
465
+ debtor: bankAccountMetadataSchema,
466
+ sendAsSinglePayment: z.boolean().optional()
467
+ }).superRefine((data, ctx) => {
468
+ if (data.paymentType === "UNKNOWN") {
469
+ ctx.addIssue({
470
+ code: "custom",
471
+ message: "paymentType=UNKNOWN is not supported. Use DOMESTIC, SEPA, or SWIFT.",
472
+ path: ["paymentType"]
473
+ });
474
+ return;
475
+ }
476
+ if (!data.debtor.iban) {
477
+ ctx.addIssue({
478
+ code: "custom",
479
+ message: "debtor.iban is required",
480
+ path: ["debtor", "iban"]
481
+ });
482
+ }
483
+ if (data.paymentType === "DOMESTIC" || data.paymentType === "SEPA") {
484
+ const hasIban = !!data.creditor.iban;
485
+ const hasAccountNumber = !!data.creditor.number && !!data.creditor.bankCode;
486
+ if (!hasIban && !hasAccountNumber) {
487
+ ctx.addIssue({
488
+ code: "custom",
489
+ message: `creditor must have either iban OR (number + bankCode) for ${data.paymentType} payments`,
490
+ path: ["creditor"]
491
+ });
492
+ }
493
+ return;
494
+ }
495
+ if (data.paymentType === "SWIFT") {
496
+ const hasIban = !!data.creditor.iban;
497
+ const hasBban = !!data.creditor.number && !!(data.creditor.swiftBic ?? data.creditor.bicCor);
498
+ if (!hasIban && !hasBban) {
499
+ ctx.addIssue({
500
+ code: "custom",
501
+ message: "SWIFT creditor requires either iban OR (number + swiftBic/bicCor)",
502
+ path: ["creditor"]
503
+ });
504
+ }
505
+ }
506
+ });
507
+
508
+ const sendBatchInputSchema = z.object({
509
+ payments: z.array(sendPaymentInputSchema).min(1)
510
+ });
511
+
512
+ const getAuthUriInputSchema = z.object({
513
+ connectorKey: z.enum(CONNECTOR_KEYS)
514
+ });
515
+
516
+ const authorizeAccountInputSchema = z.object({
517
+ ott: z.string(),
518
+ urlParams: z.string(),
519
+ syncIntervalS: z.number().int().positive().optional(),
520
+ startSync: z.boolean().optional(),
521
+ lastSyncAt: z.date().optional(),
522
+ address: structuredAddressSchema.optional()
523
+ });
524
+
487
525
  const simulateDepositInputSchema = z.object({
488
526
  amount: z.number(),
489
527
  currency: z.enum(CURRENCY_CODES),
@@ -583,6 +621,10 @@ const getPaymentsInputSchema = z.object({
583
621
  [ALLOWED_PAYMENT_FILTERS.BANK_REF_ID]: z.string().optional()
584
622
  });
585
623
 
624
+ const getPaymentsByRequestIdsInputSchema = z.object({
625
+ paymentRequestIds: z.array(z.string().uuid()).min(1, "At least one payment request ID is required").max(100, "Maximum 100 payment request IDs per request")
626
+ });
627
+
586
628
  const syncAccountInputSchema = z.object({
587
629
  accountId: z.uuid()
588
630
  });
@@ -764,6 +806,18 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
764
806
  }
765
807
  );
766
808
  }
809
+ async getPaymentsByRequestIds(input) {
810
+ return this.handleAction(
811
+ { data: input, schema: getPaymentsByRequestIdsInputSchema },
812
+ { successMessage: "Payments retrieved successfully" },
813
+ async (validated) => {
814
+ const payments = await getPaymentsByPaymentRequestIdsQuery(this.db, {
815
+ paymentRequestIds: validated.paymentRequestIds
816
+ });
817
+ return { payments };
818
+ }
819
+ );
820
+ }
767
821
  async syncAccount(input) {
768
822
  return this.handleAction(
769
823
  { data: input, schema: syncAccountInputSchema },
@@ -1445,6 +1499,15 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
1445
1499
  data.currency,
1446
1500
  data.creditor
1447
1501
  );
1502
+ if (data.creditor.bankCode?.length === 4 && !data.creditor.iban && data.creditor.number) {
1503
+ try {
1504
+ data.creditor.iban = calculateCzechIban(
1505
+ data.creditor.number,
1506
+ data.creditor.bankCode
1507
+ );
1508
+ } catch (_error) {
1509
+ }
1510
+ }
1448
1511
  const { accounts } = await this._getAccounts({
1449
1512
  filterIbans: [incomingPayment.debtorIban]
1450
1513
  });
@@ -1996,6 +2059,9 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
1996
2059
  __decorateClass([
1997
2060
  action("get-payments")
1998
2061
  ], BankServiceBase.prototype, "getPayments", 1);
2062
+ __decorateClass([
2063
+ action("get-payments-by-request-ids")
2064
+ ], BankServiceBase.prototype, "getPaymentsByRequestIds", 1);
1999
2065
  __decorateClass([
2000
2066
  action("sync-account")
2001
2067
  ], BankServiceBase.prototype, "syncAccount", 1);
@@ -1,4 +1,4 @@
1
- export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.BJTq7Qw9.cjs';
1
+ export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.Do1KUeDr.cjs';
2
2
  import 'drizzle-orm';
3
3
  import 'drizzle-orm/sqlite-core';
4
4
  import '@develit-io/general-codes';
@@ -1,4 +1,4 @@
1
- export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.BJTq7Qw9.mjs';
1
+ export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.Do1KUeDr.mjs';
2
2
  import 'drizzle-orm';
3
3
  import 'drizzle-orm/sqlite-core';
4
4
  import '@develit-io/general-codes';
@@ -1,4 +1,4 @@
1
- export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.BJTq7Qw9.js';
1
+ export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.Do1KUeDr.js';
2
2
  import 'drizzle-orm';
3
3
  import 'drizzle-orm/sqlite-core';
4
4
  import '@develit-io/general-codes';