@develit-services/bank 5.4.1 → 5.5.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.cjs +137 -137
- package/dist/base.d.cts +11 -11
- package/dist/base.d.mts +11 -11
- package/dist/base.d.ts +11 -11
- package/dist/base.mjs +2 -2
- package/dist/database/schema.d.cts +1 -1
- package/dist/database/schema.d.mts +1 -1
- package/dist/database/schema.d.ts +1 -1
- package/dist/export/workflows.cjs +32 -32
- package/dist/export/workflows.mjs +5 -5
- package/dist/shared/bank.B04qoHtD.cjs +360 -0
- package/dist/shared/{bank.BqTBTu_N.d.cts → bank.BuwSQL_7.d.mts} +1 -1
- package/dist/shared/{bank.CGVCfq1B.d.cts → bank.CdkOsZE8.d.cts} +3 -3
- package/dist/shared/{bank.CGVCfq1B.d.mts → bank.CdkOsZE8.d.mts} +3 -3
- package/dist/shared/{bank.CGVCfq1B.d.ts → bank.CdkOsZE8.d.ts} +3 -3
- package/dist/shared/{bank.Bw9ayUKF.mjs → bank.D0iIfh-X.mjs} +70 -249
- package/dist/shared/{bank.B4HTEp48.cjs → bank.DMrkshJa.cjs} +70 -249
- package/dist/shared/{bank.SSqNFzWn.d.mts → bank.D__RVhfE.d.cts} +1 -1
- package/dist/shared/{bank.CYJ75FSr.d.ts → bank.IAc8kIC-.d.ts} +1 -1
- package/dist/shared/bank._VynZSqn.mjs +348 -0
- package/dist/types.cjs +37 -37
- package/dist/types.d.cts +4 -4
- package/dist/types.d.mts +4 -4
- package/dist/types.d.ts +4 -4
- package/dist/types.mjs +2 -2
- package/package.json +1 -1
- package/dist/shared/bank.CBE8XWEk.cjs +0 -160
- package/dist/shared/bank.CF0T2m35.mjs +0 -149
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.
|
|
2
|
-
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.
|
|
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.CdkOsZE8.cjs';
|
|
2
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.D__RVhfE.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';
|
|
@@ -2699,9 +2699,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
2699
2699
|
limit: z.ZodNumber;
|
|
2700
2700
|
sort: z.ZodObject<{
|
|
2701
2701
|
column: z.ZodEnum<{
|
|
2702
|
-
batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
|
|
2703
2702
|
createdAt: "createdAt";
|
|
2704
2703
|
updatedAt: "updatedAt";
|
|
2704
|
+
batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
|
|
2705
2705
|
}>;
|
|
2706
2706
|
direction: z.ZodEnum<{
|
|
2707
2707
|
asc: "asc";
|
|
@@ -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>;
|
|
@@ -2825,9 +2825,9 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2825
2825
|
limit: z.ZodNumber;
|
|
2826
2826
|
sort: z.ZodObject<{
|
|
2827
2827
|
column: z.ZodEnum<{
|
|
2828
|
+
amount: "amount";
|
|
2828
2829
|
createdAt: "createdAt";
|
|
2829
2830
|
updatedAt: "updatedAt";
|
|
2830
|
-
amount: "amount";
|
|
2831
2831
|
}>;
|
|
2832
2832
|
direction: z.ZodEnum<{
|
|
2833
2833
|
asc: "asc";
|
|
@@ -2956,19 +2956,19 @@ 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
2959
|
BOOKED: "BOOKED";
|
|
2961
2960
|
REJECTED: "REJECTED";
|
|
2962
2961
|
PENDING: "PENDING";
|
|
2962
|
+
PROCESSING: "PROCESSING";
|
|
2963
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
2968
|
BOOKED: "BOOKED";
|
|
2970
2969
|
REJECTED: "REJECTED";
|
|
2971
2970
|
PENDING: "PENDING";
|
|
2971
|
+
PROCESSING: "PROCESSING";
|
|
2972
2972
|
CANCELLED: "CANCELLED";
|
|
2973
2973
|
SCHEDULED: "SCHEDULED";
|
|
2974
2974
|
HOLD: "HOLD";
|
|
@@ -3875,9 +3875,9 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
|
|
|
3875
3875
|
limit: z.ZodNumber;
|
|
3876
3876
|
sort: z.ZodObject<{
|
|
3877
3877
|
column: z.ZodEnum<{
|
|
3878
|
+
amount: "amount";
|
|
3878
3879
|
createdAt: "createdAt";
|
|
3879
3880
|
updatedAt: "updatedAt";
|
|
3880
|
-
amount: "amount";
|
|
3881
3881
|
}>;
|
|
3882
3882
|
direction: z.ZodEnum<{
|
|
3883
3883
|
asc: "asc";
|
|
@@ -3886,17 +3886,17 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
|
|
|
3886
3886
|
}, z.core.$strip>;
|
|
3887
3887
|
filterAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
|
|
3888
3888
|
filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3889
|
+
OPENED: "OPENED";
|
|
3889
3890
|
AUTHORIZED: "AUTHORIZED";
|
|
3890
3891
|
COMPLETED: "COMPLETED";
|
|
3891
|
-
OPENED: "OPENED";
|
|
3892
3892
|
BOOKED: "BOOKED";
|
|
3893
3893
|
SETTLED: "SETTLED";
|
|
3894
3894
|
REJECTED: "REJECTED";
|
|
3895
3895
|
CLOSED: "CLOSED";
|
|
3896
3896
|
}>, z.ZodArray<z.ZodEnum<{
|
|
3897
|
+
OPENED: "OPENED";
|
|
3897
3898
|
AUTHORIZED: "AUTHORIZED";
|
|
3898
3899
|
COMPLETED: "COMPLETED";
|
|
3899
|
-
OPENED: "OPENED";
|
|
3900
3900
|
BOOKED: "BOOKED";
|
|
3901
3901
|
SETTLED: "SETTLED";
|
|
3902
3902
|
REJECTED: "REJECTED";
|
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.
|
|
2
|
-
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.
|
|
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.CdkOsZE8.mjs';
|
|
2
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.BuwSQL_7.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';
|
|
@@ -2699,9 +2699,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
2699
2699
|
limit: z.ZodNumber;
|
|
2700
2700
|
sort: z.ZodObject<{
|
|
2701
2701
|
column: z.ZodEnum<{
|
|
2702
|
-
batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
|
|
2703
2702
|
createdAt: "createdAt";
|
|
2704
2703
|
updatedAt: "updatedAt";
|
|
2704
|
+
batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
|
|
2705
2705
|
}>;
|
|
2706
2706
|
direction: z.ZodEnum<{
|
|
2707
2707
|
asc: "asc";
|
|
@@ -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>;
|
|
@@ -2825,9 +2825,9 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2825
2825
|
limit: z.ZodNumber;
|
|
2826
2826
|
sort: z.ZodObject<{
|
|
2827
2827
|
column: z.ZodEnum<{
|
|
2828
|
+
amount: "amount";
|
|
2828
2829
|
createdAt: "createdAt";
|
|
2829
2830
|
updatedAt: "updatedAt";
|
|
2830
|
-
amount: "amount";
|
|
2831
2831
|
}>;
|
|
2832
2832
|
direction: z.ZodEnum<{
|
|
2833
2833
|
asc: "asc";
|
|
@@ -2956,19 +2956,19 @@ 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
2959
|
BOOKED: "BOOKED";
|
|
2961
2960
|
REJECTED: "REJECTED";
|
|
2962
2961
|
PENDING: "PENDING";
|
|
2962
|
+
PROCESSING: "PROCESSING";
|
|
2963
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
2968
|
BOOKED: "BOOKED";
|
|
2970
2969
|
REJECTED: "REJECTED";
|
|
2971
2970
|
PENDING: "PENDING";
|
|
2971
|
+
PROCESSING: "PROCESSING";
|
|
2972
2972
|
CANCELLED: "CANCELLED";
|
|
2973
2973
|
SCHEDULED: "SCHEDULED";
|
|
2974
2974
|
HOLD: "HOLD";
|
|
@@ -3875,9 +3875,9 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
|
|
|
3875
3875
|
limit: z.ZodNumber;
|
|
3876
3876
|
sort: z.ZodObject<{
|
|
3877
3877
|
column: z.ZodEnum<{
|
|
3878
|
+
amount: "amount";
|
|
3878
3879
|
createdAt: "createdAt";
|
|
3879
3880
|
updatedAt: "updatedAt";
|
|
3880
|
-
amount: "amount";
|
|
3881
3881
|
}>;
|
|
3882
3882
|
direction: z.ZodEnum<{
|
|
3883
3883
|
asc: "asc";
|
|
@@ -3886,17 +3886,17 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
|
|
|
3886
3886
|
}, z.core.$strip>;
|
|
3887
3887
|
filterAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
|
|
3888
3888
|
filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3889
|
+
OPENED: "OPENED";
|
|
3889
3890
|
AUTHORIZED: "AUTHORIZED";
|
|
3890
3891
|
COMPLETED: "COMPLETED";
|
|
3891
|
-
OPENED: "OPENED";
|
|
3892
3892
|
BOOKED: "BOOKED";
|
|
3893
3893
|
SETTLED: "SETTLED";
|
|
3894
3894
|
REJECTED: "REJECTED";
|
|
3895
3895
|
CLOSED: "CLOSED";
|
|
3896
3896
|
}>, z.ZodArray<z.ZodEnum<{
|
|
3897
|
+
OPENED: "OPENED";
|
|
3897
3898
|
AUTHORIZED: "AUTHORIZED";
|
|
3898
3899
|
COMPLETED: "COMPLETED";
|
|
3899
|
-
OPENED: "OPENED";
|
|
3900
3900
|
BOOKED: "BOOKED";
|
|
3901
3901
|
SETTLED: "SETTLED";
|
|
3902
3902
|
REJECTED: "REJECTED";
|
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.
|
|
2
|
-
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.
|
|
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.CdkOsZE8.js';
|
|
2
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.IAc8kIC-.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';
|
|
@@ -2699,9 +2699,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
2699
2699
|
limit: z.ZodNumber;
|
|
2700
2700
|
sort: z.ZodObject<{
|
|
2701
2701
|
column: z.ZodEnum<{
|
|
2702
|
-
batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
|
|
2703
2702
|
createdAt: "createdAt";
|
|
2704
2703
|
updatedAt: "updatedAt";
|
|
2704
|
+
batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
|
|
2705
2705
|
}>;
|
|
2706
2706
|
direction: z.ZodEnum<{
|
|
2707
2707
|
asc: "asc";
|
|
@@ -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>;
|
|
@@ -2825,9 +2825,9 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2825
2825
|
limit: z.ZodNumber;
|
|
2826
2826
|
sort: z.ZodObject<{
|
|
2827
2827
|
column: z.ZodEnum<{
|
|
2828
|
+
amount: "amount";
|
|
2828
2829
|
createdAt: "createdAt";
|
|
2829
2830
|
updatedAt: "updatedAt";
|
|
2830
|
-
amount: "amount";
|
|
2831
2831
|
}>;
|
|
2832
2832
|
direction: z.ZodEnum<{
|
|
2833
2833
|
asc: "asc";
|
|
@@ -2956,19 +2956,19 @@ 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
2959
|
BOOKED: "BOOKED";
|
|
2961
2960
|
REJECTED: "REJECTED";
|
|
2962
2961
|
PENDING: "PENDING";
|
|
2962
|
+
PROCESSING: "PROCESSING";
|
|
2963
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
2968
|
BOOKED: "BOOKED";
|
|
2970
2969
|
REJECTED: "REJECTED";
|
|
2971
2970
|
PENDING: "PENDING";
|
|
2971
|
+
PROCESSING: "PROCESSING";
|
|
2972
2972
|
CANCELLED: "CANCELLED";
|
|
2973
2973
|
SCHEDULED: "SCHEDULED";
|
|
2974
2974
|
HOLD: "HOLD";
|
|
@@ -3875,9 +3875,9 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
|
|
|
3875
3875
|
limit: z.ZodNumber;
|
|
3876
3876
|
sort: z.ZodObject<{
|
|
3877
3877
|
column: z.ZodEnum<{
|
|
3878
|
+
amount: "amount";
|
|
3878
3879
|
createdAt: "createdAt";
|
|
3879
3880
|
updatedAt: "updatedAt";
|
|
3880
|
-
amount: "amount";
|
|
3881
3881
|
}>;
|
|
3882
3882
|
direction: z.ZodEnum<{
|
|
3883
3883
|
asc: "asc";
|
|
@@ -3886,17 +3886,17 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
|
|
|
3886
3886
|
}, z.core.$strip>;
|
|
3887
3887
|
filterAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
|
|
3888
3888
|
filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3889
|
+
OPENED: "OPENED";
|
|
3889
3890
|
AUTHORIZED: "AUTHORIZED";
|
|
3890
3891
|
COMPLETED: "COMPLETED";
|
|
3891
|
-
OPENED: "OPENED";
|
|
3892
3892
|
BOOKED: "BOOKED";
|
|
3893
3893
|
SETTLED: "SETTLED";
|
|
3894
3894
|
REJECTED: "REJECTED";
|
|
3895
3895
|
CLOSED: "CLOSED";
|
|
3896
3896
|
}>, z.ZodArray<z.ZodEnum<{
|
|
3897
|
+
OPENED: "OPENED";
|
|
3897
3898
|
AUTHORIZED: "AUTHORIZED";
|
|
3898
3899
|
COMPLETED: "COMPLETED";
|
|
3899
|
-
OPENED: "OPENED";
|
|
3900
3900
|
BOOKED: "BOOKED";
|
|
3901
3901
|
SETTLED: "SETTLED";
|
|
3902
3902
|
REJECTED: "REJECTED";
|
package/dist/base.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
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,
|
|
2
|
+
import { G as tables, g as accountInsertSchema, H as relations, 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.D0iIfh-X.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';
|
|
6
6
|
import 'jose';
|
|
7
|
+
import { h as encrypt, d as createCredentialsResolver, i as initiateConnector, e as updatePaymentRequestStatusCommand, a as getPaymentRequestsByBatchIdQuery, g as getBatchByIdQuery, u as upsertBatchCommand, j as importAesKey, f as createPaymentCommand, b as getAccountByIdQuery } from './shared/bank._VynZSqn.mjs';
|
|
7
8
|
import { z } from 'zod';
|
|
8
9
|
import { I as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, g as PAYMENT_TYPES, b as CONNECTOR_KEYS, a as BATCH_STATUSES, f as PAYMENT_STATUSES, P as PAYMENT_DIRECTIONS, e as PAYMENT_REQUEST_STATUSES } from './shared/bank.BzDNLxB_.mjs';
|
|
9
10
|
import { CURRENCY_CODES } from '@develit-io/general-codes';
|
|
10
11
|
import 'date-fns';
|
|
11
12
|
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.CF0T2m35.mjs';
|
|
13
13
|
import 'drizzle-orm/zod';
|
|
14
14
|
import 'drizzle-orm/sqlite-core';
|
|
15
15
|
|
|
@@ -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.
|
|
1
|
+
export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.CdkOsZE8.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 { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.
|
|
1
|
+
export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.CdkOsZE8.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 { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.
|
|
1
|
+
export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.CdkOsZE8.js';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
3
|
import 'drizzle-orm';
|
|
4
4
|
import '@develit-io/general-codes';
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
|
-
const
|
|
4
|
+
const paymentDirection = require('../shared/bank.DMrkshJa.cjs');
|
|
5
5
|
const batchLifecycle = require('../shared/bank.NF8bZBy0.cjs');
|
|
6
6
|
const drizzleOrm = require('drizzle-orm');
|
|
7
|
-
const
|
|
7
|
+
const bank = require('../shared/bank.B04qoHtD.cjs');
|
|
8
8
|
const cloudflare_workers = require('cloudflare:workers');
|
|
9
9
|
const cloudflare_workflows = require('cloudflare:workflows');
|
|
10
10
|
const d1 = require('drizzle-orm/d1');
|
|
11
11
|
require('node:crypto');
|
|
12
12
|
require('date-fns');
|
|
13
|
-
require('jose');
|
|
14
|
-
require('zod');
|
|
15
|
-
require('@develit-io/general-codes');
|
|
16
13
|
require('../shared/bank.9Yw4KHyl.cjs');
|
|
17
14
|
require('drizzle-orm/sqlite-core');
|
|
15
|
+
require('@develit-io/general-codes');
|
|
16
|
+
require('jose');
|
|
17
|
+
require('zod');
|
|
18
18
|
require('drizzle-orm/zod');
|
|
19
19
|
|
|
20
20
|
const updateAccountLastSyncCommand = (db, {
|
|
@@ -22,10 +22,10 @@ const updateAccountLastSyncCommand = (db, {
|
|
|
22
22
|
accountId,
|
|
23
23
|
lastSyncMetadata
|
|
24
24
|
}) => {
|
|
25
|
-
const command = db.update(
|
|
25
|
+
const command = db.update(paymentDirection.tables.account).set({
|
|
26
26
|
lastSyncAt,
|
|
27
27
|
lastSyncMetadata
|
|
28
|
-
}).where(drizzleOrm.eq(
|
|
28
|
+
}).where(drizzleOrm.eq(paymentDirection.tables.account.id, accountId)).returning();
|
|
29
29
|
return {
|
|
30
30
|
command
|
|
31
31
|
};
|
|
@@ -75,14 +75,14 @@ async function pushToQueue$1(queue, message) {
|
|
|
75
75
|
}
|
|
76
76
|
async function failBatchAndPayments(db, batch, paymentRequests, reason) {
|
|
77
77
|
const prCmds = paymentRequests.filter((p) => p.status !== "REJECTED").map(
|
|
78
|
-
(p) =>
|
|
78
|
+
(p) => bank.updatePaymentRequestStatusCommand(db, {
|
|
79
79
|
id: p.id,
|
|
80
80
|
status: "REJECTED",
|
|
81
81
|
statusReason: reason,
|
|
82
82
|
processedAt: /* @__PURE__ */ new Date()
|
|
83
83
|
}).command
|
|
84
84
|
);
|
|
85
|
-
const batchCmd =
|
|
85
|
+
const batchCmd = bank.upsertBatchCommand(db, {
|
|
86
86
|
batch: { ...batch, status: "FAILED" }
|
|
87
87
|
}).command;
|
|
88
88
|
const allCmds = [batchCmd, ...prCmds];
|
|
@@ -93,9 +93,9 @@ async function failBatchAndPayments(db, batch, paymentRequests, reason) {
|
|
|
93
93
|
class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
94
94
|
async run(event, step) {
|
|
95
95
|
const { batchId } = event.payload;
|
|
96
|
-
const db = d1.drizzle(this.env.BANK_D1, { schema:
|
|
96
|
+
const db = d1.drizzle(this.env.BANK_D1, { schema: paymentDirection.tables, relations: paymentDirection.relations });
|
|
97
97
|
const batch = await step.do("load batch", async () => {
|
|
98
|
-
const batch2 = await
|
|
98
|
+
const batch2 = await bank.getBatchByIdQuery(db, { batchId });
|
|
99
99
|
if (!batch2) {
|
|
100
100
|
throw new cloudflare_workflows.NonRetryableError(`Batch not found`);
|
|
101
101
|
}
|
|
@@ -104,13 +104,13 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
104
104
|
return batch2;
|
|
105
105
|
});
|
|
106
106
|
const paymentRequests = await step.do("load payment requests", async () => {
|
|
107
|
-
return await
|
|
107
|
+
return await bank.getPaymentRequestsByBatchIdQuery(db, { batchId });
|
|
108
108
|
});
|
|
109
109
|
if (paymentRequests.length === 0) {
|
|
110
110
|
throw new cloudflare_workflows.NonRetryableError("No payments found for batch");
|
|
111
111
|
}
|
|
112
112
|
await step.do("lock batch", async () => {
|
|
113
|
-
const paymentsChecksum =
|
|
113
|
+
const paymentsChecksum = bank.checksum(paymentRequests);
|
|
114
114
|
if (batch.paymentsChecksum && batch.paymentsChecksum !== paymentsChecksum)
|
|
115
115
|
throw new cloudflare_workflows.NonRetryableError(
|
|
116
116
|
`Batch payments have been modified externally, manual review needed`
|
|
@@ -120,7 +120,7 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
120
120
|
`Batch is in FAILED status and cannot be processed, manual review needed`
|
|
121
121
|
);
|
|
122
122
|
if (batchLifecycle.isBatchProcessing(batch)) {
|
|
123
|
-
const updatedBatch = await
|
|
123
|
+
const updatedBatch = await bank.upsertBatchCommand(db, {
|
|
124
124
|
batch: {
|
|
125
125
|
...batch,
|
|
126
126
|
status: "PROCESSING",
|
|
@@ -139,14 +139,14 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
139
139
|
},
|
|
140
140
|
async () => {
|
|
141
141
|
const batchedPayments = paymentRequests.map(
|
|
142
|
-
|
|
142
|
+
paymentDirection.toBatchedPaymentFromPaymentRequest
|
|
143
143
|
);
|
|
144
|
-
const currentBatch = await
|
|
144
|
+
const currentBatch = await bank.getBatchByIdQuery(db, { batchId });
|
|
145
145
|
if (currentBatch?.batchPaymentInitiatedAt) {
|
|
146
146
|
return {
|
|
147
147
|
authorizationUrls: currentBatch.authorizationUrls,
|
|
148
148
|
preparedPayments: batchedPayments.map(
|
|
149
|
-
(p) =>
|
|
149
|
+
(p) => paymentDirection.toPreparedPayment(
|
|
150
150
|
p,
|
|
151
151
|
void 0,
|
|
152
152
|
currentBatch.batchPaymentInitiatedAt
|
|
@@ -155,7 +155,7 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
155
155
|
metadata: currentBatch.metadata
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
const account = await
|
|
158
|
+
const account = await bank.getAccountByIdQuery(db, {
|
|
159
159
|
accountId: batch.accountId
|
|
160
160
|
});
|
|
161
161
|
if (!account) {
|
|
@@ -163,7 +163,7 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
163
163
|
await failBatchAndPayments(db, batch, paymentRequests, msg);
|
|
164
164
|
throw new cloudflare_workflows.NonRetryableError(msg);
|
|
165
165
|
}
|
|
166
|
-
const resolveCredentials = await
|
|
166
|
+
const resolveCredentials = await bank.createCredentialsResolver(db, this.env);
|
|
167
167
|
const connector = await bank.initiateConnector({
|
|
168
168
|
env: this.env,
|
|
169
169
|
bank: account.connectorKey,
|
|
@@ -221,7 +221,7 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
221
221
|
const { preparedPayments, authorizationUrls } = batchResult;
|
|
222
222
|
const isPaymentRequestFallback = authorizationUrls.length === preparedPayments.length;
|
|
223
223
|
const updateCommands = preparedPayments.map(
|
|
224
|
-
(pp, i) =>
|
|
224
|
+
(pp, i) => bank.updatePaymentRequestStatusCommand(db, {
|
|
225
225
|
id: pp.id,
|
|
226
226
|
status: "OPENED",
|
|
227
227
|
bankRefId: pp.bankRefId,
|
|
@@ -235,7 +235,7 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
235
235
|
return { updated: updateCommands.length };
|
|
236
236
|
});
|
|
237
237
|
await step.do("update batch to ready to sign", async () => {
|
|
238
|
-
const upsertBatch =
|
|
238
|
+
const upsertBatch = bank.upsertBatchCommand(db, {
|
|
239
239
|
batch: {
|
|
240
240
|
...batch,
|
|
241
241
|
authorizationUrls: batchResult.authorizationUrls,
|
|
@@ -257,14 +257,14 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
257
257
|
await step.do("mock: complete payments and update batch", async () => {
|
|
258
258
|
const processedAt = /* @__PURE__ */ new Date();
|
|
259
259
|
const updateCommands = batchResult.preparedPayments.map(
|
|
260
|
-
(p) =>
|
|
260
|
+
(p) => bank.updatePaymentRequestStatusCommand(db, {
|
|
261
261
|
id: p.id,
|
|
262
262
|
status: "SETTLED",
|
|
263
263
|
bankRefId: `MOCK-${backendSdk.uuidv4()}`,
|
|
264
264
|
processedAt
|
|
265
265
|
}).command
|
|
266
266
|
);
|
|
267
|
-
const updateBatchCommand =
|
|
267
|
+
const updateBatchCommand = bank.upsertBatchCommand(db, {
|
|
268
268
|
batch: {
|
|
269
269
|
...batch,
|
|
270
270
|
status: "COMPLETED",
|
|
@@ -355,7 +355,7 @@ async function pushToQueue(queue, message) {
|
|
|
355
355
|
class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
356
356
|
async run(event, step) {
|
|
357
357
|
const { accountId } = event.payload;
|
|
358
|
-
const db = d1.drizzle(this.env.BANK_D1, { schema:
|
|
358
|
+
const db = d1.drizzle(this.env.BANK_D1, { schema: paymentDirection.tables, relations: paymentDirection.relations });
|
|
359
359
|
const logger = createWorkflowLogger(event.instanceId);
|
|
360
360
|
if (!accountId) {
|
|
361
361
|
throw new cloudflare_workflows.NonRetryableError(`Haven't obtained accountId to load.`);
|
|
@@ -367,7 +367,7 @@ class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
367
367
|
while (true) {
|
|
368
368
|
const now = /* @__PURE__ */ new Date();
|
|
369
369
|
const account = await step.do("load account", async () => {
|
|
370
|
-
const account2 = await
|
|
370
|
+
const account2 = await bank.getAccountByIdQuery(db, { accountId });
|
|
371
371
|
if (!account2) {
|
|
372
372
|
throw new cloudflare_workflows.NonRetryableError(`Bank account not found: ${accountId}`);
|
|
373
373
|
}
|
|
@@ -389,7 +389,7 @@ class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
389
389
|
connectorKey: account.connectorKey,
|
|
390
390
|
lastSyncAt: account.lastSyncAt?.toISOString()
|
|
391
391
|
});
|
|
392
|
-
const resolveCredentials = await
|
|
392
|
+
const resolveCredentials = await bank.createCredentialsResolver(
|
|
393
393
|
db,
|
|
394
394
|
this.env
|
|
395
395
|
);
|
|
@@ -442,7 +442,7 @@ class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
442
442
|
}
|
|
443
443
|
);
|
|
444
444
|
const paymentsToProcess = payments.filter(
|
|
445
|
-
(p) =>
|
|
445
|
+
(p) => paymentDirection.isPaymentCompleted(p.parsed)
|
|
446
446
|
);
|
|
447
447
|
const lastSyncBankRefIds = account.lastSyncMetadata?.lastSyncBankRefIds || [];
|
|
448
448
|
const paymentsToInsert = paymentsToProcess.filter(
|
|
@@ -457,11 +457,11 @@ class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
457
457
|
const matchingRequests = [];
|
|
458
458
|
for (let i = 0; i < bankRefIds.length; i += BANK_REF_ID_CHUNK_SIZE) {
|
|
459
459
|
const chunkIds = bankRefIds.slice(i, i + BANK_REF_ID_CHUNK_SIZE);
|
|
460
|
-
const rows = await db.select().from(
|
|
460
|
+
const rows = await db.select().from(paymentDirection.tables.paymentRequest).where(
|
|
461
461
|
drizzleOrm.and(
|
|
462
|
-
drizzleOrm.inArray(
|
|
463
|
-
drizzleOrm.eq(
|
|
464
|
-
drizzleOrm.eq(
|
|
462
|
+
drizzleOrm.inArray(paymentDirection.tables.paymentRequest.bankRefId, chunkIds),
|
|
463
|
+
drizzleOrm.eq(paymentDirection.tables.paymentRequest.accountId, account.id),
|
|
464
|
+
drizzleOrm.eq(paymentDirection.tables.paymentRequest.connectorKey, account.connectorKey)
|
|
465
465
|
)
|
|
466
466
|
);
|
|
467
467
|
matchingRequests.push(...rows);
|
|
@@ -496,7 +496,7 @@ class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
496
496
|
};
|
|
497
497
|
});
|
|
498
498
|
const createCommands = enrichedPayments.map(
|
|
499
|
-
(p) =>
|
|
499
|
+
(p) => bank.createPaymentCommand(db, { payment: p.parsed }).command
|
|
500
500
|
);
|
|
501
501
|
eventsToEmit.push(
|
|
502
502
|
...enrichedPayments.map((p) => ({
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { first, uuidv4, asNonEmpty } from '@develit-io/backend-sdk';
|
|
2
|
-
import { G as tables, H as relations, v as toBatchedPaymentFromPaymentRequest, z as toPreparedPayment,
|
|
2
|
+
import { G as tables, H as relations, v as toBatchedPaymentFromPaymentRequest, z as toPreparedPayment, m as isPaymentCompleted } from '../shared/bank.D0iIfh-X.mjs';
|
|
3
3
|
import { i as isBatchAuthorized, b as isBatchFailed, d as isBatchProcessing } from '../shared/bank.XqSw509X.mjs';
|
|
4
4
|
import { eq, and, inArray } from 'drizzle-orm';
|
|
5
|
-
import { g as getBatchByIdQuery, a as getPaymentRequestsByBatchIdQuery, c as checksum, u as upsertBatchCommand, b as getAccountByIdQuery, d as createCredentialsResolver, e as updatePaymentRequestStatusCommand, f as createPaymentCommand } from '../shared/bank.
|
|
5
|
+
import { g as getBatchByIdQuery, a as getPaymentRequestsByBatchIdQuery, c as checksum, u as upsertBatchCommand, b as getAccountByIdQuery, d as createCredentialsResolver, i as initiateConnector, e as updatePaymentRequestStatusCommand, f as createPaymentCommand } from '../shared/bank._VynZSqn.mjs';
|
|
6
6
|
import { WorkflowEntrypoint } from 'cloudflare:workers';
|
|
7
7
|
import { NonRetryableError } from 'cloudflare:workflows';
|
|
8
8
|
import { drizzle } from 'drizzle-orm/d1';
|
|
9
9
|
import 'node:crypto';
|
|
10
10
|
import 'date-fns';
|
|
11
|
-
import 'jose';
|
|
12
|
-
import 'zod';
|
|
13
|
-
import '@develit-io/general-codes';
|
|
14
11
|
import '../shared/bank.BzDNLxB_.mjs';
|
|
15
12
|
import 'drizzle-orm/sqlite-core';
|
|
13
|
+
import '@develit-io/general-codes';
|
|
14
|
+
import 'jose';
|
|
15
|
+
import 'zod';
|
|
16
16
|
import 'drizzle-orm/zod';
|
|
17
17
|
|
|
18
18
|
const updateAccountLastSyncCommand = (db, {
|