@develit-services/bank 0.3.49 → 0.3.51
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/database/schema.cjs +1 -1
- 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/database/schema.mjs +1 -1
- package/dist/export/worker.cjs +10 -13
- package/dist/export/worker.d.cts +9 -10
- package/dist/export/worker.d.mts +9 -10
- package/dist/export/worker.d.ts +9 -10
- package/dist/export/worker.mjs +10 -13
- package/dist/export/workflows.cjs +3 -3
- package/dist/export/workflows.mjs +3 -3
- package/dist/shared/{bank.D7JSg_d9.mjs → bank.BrwlZUfo.mjs} +10 -4
- package/dist/shared/{bank.m2X4FSvr.mjs → bank.C1bHZDjr.mjs} +1 -0
- package/dist/shared/{bank.CF4oNDZH.d.cts → bank.DHQNmyQt.d.cts} +27 -5
- package/dist/shared/{bank.CF4oNDZH.d.mts → bank.DHQNmyQt.d.mts} +27 -5
- package/dist/shared/{bank.CF4oNDZH.d.ts → bank.DHQNmyQt.d.ts} +27 -5
- package/dist/shared/{bank.DXj5tpXa.cjs → bank.DIn77H1S.cjs} +10 -4
- package/dist/shared/{bank.BfBw79Y1.cjs → bank.DoHc7geB.cjs} +1 -0
- package/dist/shared/{bank.DYJuicD-.mjs → bank.DyoWDyOf.mjs} +2 -2
- package/dist/shared/{bank.CwRMB9Ek.cjs → bank.tqnXqWCE.cjs} +2 -2
- package/dist/types.cjs +2 -2
- package/dist/types.d.cts +16 -6
- package/dist/types.d.mts +16 -6
- package/dist/types.d.ts +16 -6
- package/dist/types.mjs +2 -2
- package/package.json +1 -1
package/dist/database/schema.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a9 as account, aa as accountCredentials, a5 as batch, a8 as ott, a6 as payment, a7 as paymentRelations } from '../shared/bank.
|
|
1
|
+
export { a9 as account, aa as accountCredentials, a5 as batch, a8 as ott, a6 as payment, a7 as paymentRelations } from '../shared/bank.DHQNmyQt.cjs';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'drizzle-zod';
|
|
4
4
|
import 'drizzle-orm/sqlite-core';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a9 as account, aa as accountCredentials, a5 as batch, a8 as ott, a6 as payment, a7 as paymentRelations } from '../shared/bank.
|
|
1
|
+
export { a9 as account, aa as accountCredentials, a5 as batch, a8 as ott, a6 as payment, a7 as paymentRelations } from '../shared/bank.DHQNmyQt.mjs';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'drizzle-zod';
|
|
4
4
|
import 'drizzle-orm/sqlite-core';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a9 as account, aa as accountCredentials, a5 as batch, a8 as ott, a6 as payment, a7 as paymentRelations } from '../shared/bank.
|
|
1
|
+
export { a9 as account, aa as accountCredentials, a5 as batch, a8 as ott, a6 as payment, a7 as paymentRelations } from '../shared/bank.DHQNmyQt.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'drizzle-zod';
|
|
4
4
|
import 'drizzle-orm/sqlite-core';
|
package/dist/database/schema.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { t as account, u as accountCredentials, n as batch, r as ott, p as payment, q as paymentRelations } from '../shared/bank.
|
|
1
|
+
export { t as account, u as accountCredentials, n as batch, r as ott, p as payment, q as paymentRelations } from '../shared/bank.C1bHZDjr.mjs';
|
|
2
2
|
import '@develit-io/backend-sdk';
|
|
3
3
|
import 'drizzle-orm/sqlite-core';
|
|
4
4
|
import 'date-fns';
|
package/dist/export/worker.cjs
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
4
|
const cloudflare_workers = require('cloudflare:workers');
|
|
5
5
|
const d1 = require('drizzle-orm/d1');
|
|
6
|
-
const drizzle = require('../shared/bank.
|
|
6
|
+
const drizzle = require('../shared/bank.DIn77H1S.cjs');
|
|
7
7
|
const zod = require('zod');
|
|
8
|
-
const database_schema = require('../shared/bank.
|
|
8
|
+
const database_schema = require('../shared/bank.DoHc7geB.cjs');
|
|
9
9
|
const generalCodes = require('@develit-io/general-codes');
|
|
10
10
|
require('date-fns');
|
|
11
11
|
const drizzleOrm = require('drizzle-orm');
|
|
12
12
|
require('jose');
|
|
13
13
|
require('node:crypto');
|
|
14
|
-
const encryption = require('../shared/bank.
|
|
14
|
+
const encryption = require('../shared/bank.tqnXqWCE.cjs');
|
|
15
15
|
require('drizzle-orm/sqlite-core');
|
|
16
16
|
require('drizzle-orm/relations');
|
|
17
17
|
require('drizzle-zod');
|
|
@@ -407,10 +407,8 @@ const updateAccountInputSchema = zod.z.object({
|
|
|
407
407
|
});
|
|
408
408
|
|
|
409
409
|
const getBankAccountsInputSchema = zod.z.object({
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
batchCounts: zod.z.boolean().optional()
|
|
413
|
-
}).optional()
|
|
410
|
+
includeWorkflow: zod.z.boolean().optional(),
|
|
411
|
+
includeBatchCounts: zod.z.boolean().optional()
|
|
414
412
|
});
|
|
415
413
|
|
|
416
414
|
const disconnectAccountInputSchema = zod.z.object({
|
|
@@ -580,15 +578,16 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
|
|
|
580
578
|
}
|
|
581
579
|
async _resolveSingleBatch(batch, connector) {
|
|
582
580
|
const previousStatus = batch.status;
|
|
583
|
-
const currentStatus = await connector.getBatchStatus({
|
|
581
|
+
const { status: currentStatus, apiResponse } = await connector.getBatchStatus({
|
|
584
582
|
batchId: batch.id
|
|
585
583
|
});
|
|
586
584
|
let statusChanged = false;
|
|
587
|
-
if (previousStatus !== currentStatus) {
|
|
585
|
+
if (previousStatus !== currentStatus || !batch.statusResponse) {
|
|
588
586
|
await encryption.upsertBatchCommand(this.db, {
|
|
589
587
|
batch: {
|
|
590
588
|
...batch,
|
|
591
|
-
status: currentStatus
|
|
589
|
+
status: currentStatus,
|
|
590
|
+
statusResponse: apiResponse
|
|
592
591
|
}
|
|
593
592
|
}).command.execute();
|
|
594
593
|
statusChanged = true;
|
|
@@ -1013,10 +1012,8 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
|
|
|
1013
1012
|
return this.handleAction(
|
|
1014
1013
|
{ data: input, schema: getBankAccountsInputSchema },
|
|
1015
1014
|
{ successMessage: "Bank accounts retrieved successfully" },
|
|
1016
|
-
async ({
|
|
1015
|
+
async ({ includeWorkflow, includeBatchCounts }) => {
|
|
1017
1016
|
const accounts = await this._getAccounts();
|
|
1018
|
-
const includeWorkflow = includes?.workflow ?? true;
|
|
1019
|
-
const includeBatchCounts = includes?.batchCounts ?? false;
|
|
1020
1017
|
const accountsWithOptionalFields = await Promise.all(
|
|
1021
1018
|
accounts.map(async (a) => {
|
|
1022
1019
|
const result = {
|
package/dist/export/worker.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.
|
|
1
|
+
import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.DHQNmyQt.cjs';
|
|
2
2
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
3
3
|
import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
@@ -1531,19 +1531,19 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
1531
1531
|
}, z.core.$strip>;
|
|
1532
1532
|
filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
|
|
1533
1533
|
filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1534
|
+
FAILED: "FAILED";
|
|
1534
1535
|
OPEN: "OPEN";
|
|
1535
1536
|
PROCESSING: "PROCESSING";
|
|
1536
1537
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1537
1538
|
SIGNED: "SIGNED";
|
|
1538
1539
|
SIGNATURE_FAILED: "SIGNATURE_FAILED";
|
|
1539
|
-
FAILED: "FAILED";
|
|
1540
1540
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1541
|
+
FAILED: "FAILED";
|
|
1541
1542
|
OPEN: "OPEN";
|
|
1542
1543
|
PROCESSING: "PROCESSING";
|
|
1543
1544
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1544
1545
|
SIGNED: "SIGNED";
|
|
1545
1546
|
SIGNATURE_FAILED: "SIGNATURE_FAILED";
|
|
1546
|
-
FAILED: "FAILED";
|
|
1547
1547
|
}>>]>>;
|
|
1548
1548
|
}, z.core.$strip>;
|
|
1549
1549
|
type GetBatchesInput = z.input<typeof getBatchesInputSchema>;
|
|
@@ -1788,16 +1788,16 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
1788
1788
|
filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
|
|
1789
1789
|
filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
|
|
1790
1790
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1791
|
-
FAILED: "FAILED";
|
|
1792
1791
|
PREPARED: "PREPARED";
|
|
1793
1792
|
INITIALIZED: "INITIALIZED";
|
|
1793
|
+
FAILED: "FAILED";
|
|
1794
1794
|
PENDING: "PENDING";
|
|
1795
1795
|
COMPLETED: "COMPLETED";
|
|
1796
1796
|
CREATED: "CREATED";
|
|
1797
1797
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1798
|
-
FAILED: "FAILED";
|
|
1799
1798
|
PREPARED: "PREPARED";
|
|
1800
1799
|
INITIALIZED: "INITIALIZED";
|
|
1800
|
+
FAILED: "FAILED";
|
|
1801
1801
|
PENDING: "PENDING";
|
|
1802
1802
|
COMPLETED: "COMPLETED";
|
|
1803
1803
|
CREATED: "CREATED";
|
|
@@ -2395,10 +2395,8 @@ type UpdateAccountInput = z.infer<typeof updateAccountInputSchema>;
|
|
|
2395
2395
|
type UpdateAccountOutput = AccountSelectType;
|
|
2396
2396
|
|
|
2397
2397
|
declare const getBankAccountsInputSchema: z.ZodObject<{
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
batchCounts: z.ZodOptional<z.ZodBoolean>;
|
|
2401
|
-
}, z.core.$strip>>;
|
|
2398
|
+
includeWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
2399
|
+
includeBatchCounts: z.ZodOptional<z.ZodBoolean>;
|
|
2402
2400
|
}, z.core.$strip>;
|
|
2403
2401
|
type GetBankAccountsInput = z.infer<typeof getBankAccountsInputSchema>;
|
|
2404
2402
|
type WorkflowInfo = {
|
|
@@ -2512,7 +2510,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2512
2510
|
addPaymentsToBatch({ paymentsToBatch, }: {
|
|
2513
2511
|
paymentsToBatch: SendPaymentInput[];
|
|
2514
2512
|
}): Promise<IRPCResponse<{
|
|
2515
|
-
status: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" |
|
|
2513
|
+
status: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | null;
|
|
2516
2514
|
id: string;
|
|
2517
2515
|
createdAt: Date | null;
|
|
2518
2516
|
updatedAt: Date | null;
|
|
@@ -2521,6 +2519,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2521
2519
|
batchPaymentInitiatedAt: Date | null;
|
|
2522
2520
|
authorizationUrls: string[] | null;
|
|
2523
2521
|
statusReason: string | null;
|
|
2522
|
+
statusResponse: object | null;
|
|
2524
2523
|
payments: PaymentInsertType[];
|
|
2525
2524
|
metadata: BatchMetadata | null;
|
|
2526
2525
|
paymentsChecksum: string | null;
|
package/dist/export/worker.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.
|
|
1
|
+
import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.DHQNmyQt.mjs';
|
|
2
2
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
3
3
|
import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
@@ -1531,19 +1531,19 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
1531
1531
|
}, z.core.$strip>;
|
|
1532
1532
|
filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
|
|
1533
1533
|
filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1534
|
+
FAILED: "FAILED";
|
|
1534
1535
|
OPEN: "OPEN";
|
|
1535
1536
|
PROCESSING: "PROCESSING";
|
|
1536
1537
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1537
1538
|
SIGNED: "SIGNED";
|
|
1538
1539
|
SIGNATURE_FAILED: "SIGNATURE_FAILED";
|
|
1539
|
-
FAILED: "FAILED";
|
|
1540
1540
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1541
|
+
FAILED: "FAILED";
|
|
1541
1542
|
OPEN: "OPEN";
|
|
1542
1543
|
PROCESSING: "PROCESSING";
|
|
1543
1544
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1544
1545
|
SIGNED: "SIGNED";
|
|
1545
1546
|
SIGNATURE_FAILED: "SIGNATURE_FAILED";
|
|
1546
|
-
FAILED: "FAILED";
|
|
1547
1547
|
}>>]>>;
|
|
1548
1548
|
}, z.core.$strip>;
|
|
1549
1549
|
type GetBatchesInput = z.input<typeof getBatchesInputSchema>;
|
|
@@ -1788,16 +1788,16 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
1788
1788
|
filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
|
|
1789
1789
|
filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
|
|
1790
1790
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1791
|
-
FAILED: "FAILED";
|
|
1792
1791
|
PREPARED: "PREPARED";
|
|
1793
1792
|
INITIALIZED: "INITIALIZED";
|
|
1793
|
+
FAILED: "FAILED";
|
|
1794
1794
|
PENDING: "PENDING";
|
|
1795
1795
|
COMPLETED: "COMPLETED";
|
|
1796
1796
|
CREATED: "CREATED";
|
|
1797
1797
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1798
|
-
FAILED: "FAILED";
|
|
1799
1798
|
PREPARED: "PREPARED";
|
|
1800
1799
|
INITIALIZED: "INITIALIZED";
|
|
1800
|
+
FAILED: "FAILED";
|
|
1801
1801
|
PENDING: "PENDING";
|
|
1802
1802
|
COMPLETED: "COMPLETED";
|
|
1803
1803
|
CREATED: "CREATED";
|
|
@@ -2395,10 +2395,8 @@ type UpdateAccountInput = z.infer<typeof updateAccountInputSchema>;
|
|
|
2395
2395
|
type UpdateAccountOutput = AccountSelectType;
|
|
2396
2396
|
|
|
2397
2397
|
declare const getBankAccountsInputSchema: z.ZodObject<{
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
batchCounts: z.ZodOptional<z.ZodBoolean>;
|
|
2401
|
-
}, z.core.$strip>>;
|
|
2398
|
+
includeWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
2399
|
+
includeBatchCounts: z.ZodOptional<z.ZodBoolean>;
|
|
2402
2400
|
}, z.core.$strip>;
|
|
2403
2401
|
type GetBankAccountsInput = z.infer<typeof getBankAccountsInputSchema>;
|
|
2404
2402
|
type WorkflowInfo = {
|
|
@@ -2512,7 +2510,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2512
2510
|
addPaymentsToBatch({ paymentsToBatch, }: {
|
|
2513
2511
|
paymentsToBatch: SendPaymentInput[];
|
|
2514
2512
|
}): Promise<IRPCResponse<{
|
|
2515
|
-
status: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" |
|
|
2513
|
+
status: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | null;
|
|
2516
2514
|
id: string;
|
|
2517
2515
|
createdAt: Date | null;
|
|
2518
2516
|
updatedAt: Date | null;
|
|
@@ -2521,6 +2519,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2521
2519
|
batchPaymentInitiatedAt: Date | null;
|
|
2522
2520
|
authorizationUrls: string[] | null;
|
|
2523
2521
|
statusReason: string | null;
|
|
2522
|
+
statusResponse: object | null;
|
|
2524
2523
|
payments: PaymentInsertType[];
|
|
2525
2524
|
metadata: BatchMetadata | null;
|
|
2526
2525
|
paymentsChecksum: string | null;
|
package/dist/export/worker.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.
|
|
1
|
+
import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.DHQNmyQt.js';
|
|
2
2
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
3
3
|
import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
@@ -1531,19 +1531,19 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
1531
1531
|
}, z.core.$strip>;
|
|
1532
1532
|
filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
|
|
1533
1533
|
filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1534
|
+
FAILED: "FAILED";
|
|
1534
1535
|
OPEN: "OPEN";
|
|
1535
1536
|
PROCESSING: "PROCESSING";
|
|
1536
1537
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1537
1538
|
SIGNED: "SIGNED";
|
|
1538
1539
|
SIGNATURE_FAILED: "SIGNATURE_FAILED";
|
|
1539
|
-
FAILED: "FAILED";
|
|
1540
1540
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1541
|
+
FAILED: "FAILED";
|
|
1541
1542
|
OPEN: "OPEN";
|
|
1542
1543
|
PROCESSING: "PROCESSING";
|
|
1543
1544
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1544
1545
|
SIGNED: "SIGNED";
|
|
1545
1546
|
SIGNATURE_FAILED: "SIGNATURE_FAILED";
|
|
1546
|
-
FAILED: "FAILED";
|
|
1547
1547
|
}>>]>>;
|
|
1548
1548
|
}, z.core.$strip>;
|
|
1549
1549
|
type GetBatchesInput = z.input<typeof getBatchesInputSchema>;
|
|
@@ -1788,16 +1788,16 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
1788
1788
|
filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
|
|
1789
1789
|
filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
|
|
1790
1790
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1791
|
-
FAILED: "FAILED";
|
|
1792
1791
|
PREPARED: "PREPARED";
|
|
1793
1792
|
INITIALIZED: "INITIALIZED";
|
|
1793
|
+
FAILED: "FAILED";
|
|
1794
1794
|
PENDING: "PENDING";
|
|
1795
1795
|
COMPLETED: "COMPLETED";
|
|
1796
1796
|
CREATED: "CREATED";
|
|
1797
1797
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1798
|
-
FAILED: "FAILED";
|
|
1799
1798
|
PREPARED: "PREPARED";
|
|
1800
1799
|
INITIALIZED: "INITIALIZED";
|
|
1800
|
+
FAILED: "FAILED";
|
|
1801
1801
|
PENDING: "PENDING";
|
|
1802
1802
|
COMPLETED: "COMPLETED";
|
|
1803
1803
|
CREATED: "CREATED";
|
|
@@ -2395,10 +2395,8 @@ type UpdateAccountInput = z.infer<typeof updateAccountInputSchema>;
|
|
|
2395
2395
|
type UpdateAccountOutput = AccountSelectType;
|
|
2396
2396
|
|
|
2397
2397
|
declare const getBankAccountsInputSchema: z.ZodObject<{
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
batchCounts: z.ZodOptional<z.ZodBoolean>;
|
|
2401
|
-
}, z.core.$strip>>;
|
|
2398
|
+
includeWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
2399
|
+
includeBatchCounts: z.ZodOptional<z.ZodBoolean>;
|
|
2402
2400
|
}, z.core.$strip>;
|
|
2403
2401
|
type GetBankAccountsInput = z.infer<typeof getBankAccountsInputSchema>;
|
|
2404
2402
|
type WorkflowInfo = {
|
|
@@ -2512,7 +2510,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2512
2510
|
addPaymentsToBatch({ paymentsToBatch, }: {
|
|
2513
2511
|
paymentsToBatch: SendPaymentInput[];
|
|
2514
2512
|
}): Promise<IRPCResponse<{
|
|
2515
|
-
status: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" |
|
|
2513
|
+
status: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | null;
|
|
2516
2514
|
id: string;
|
|
2517
2515
|
createdAt: Date | null;
|
|
2518
2516
|
updatedAt: Date | null;
|
|
@@ -2521,6 +2519,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2521
2519
|
batchPaymentInitiatedAt: Date | null;
|
|
2522
2520
|
authorizationUrls: string[] | null;
|
|
2523
2521
|
statusReason: string | null;
|
|
2522
|
+
statusResponse: object | null;
|
|
2524
2523
|
payments: PaymentInsertType[];
|
|
2525
2524
|
metadata: BatchMetadata | null;
|
|
2526
2525
|
paymentsChecksum: string | null;
|
package/dist/export/worker.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { uuidv4, first, bankAccountMetadataSchema, workflowInstanceStatusSchema, develitWorker, createInternalError, action, service } from '@develit-io/backend-sdk';
|
|
2
2
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
3
3
|
import { drizzle } from 'drizzle-orm/d1';
|
|
4
|
-
import { t as tables } from '../shared/bank.
|
|
4
|
+
import { t as tables } from '../shared/bank.BrwlZUfo.mjs';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import { I as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, P as PAYMENT_TYPES, d as CONNECTOR_KEYS, B as BATCH_STATUSES, a as PAYMENT_STATUSES, b as PAYMENT_DIRECTIONS, f as accountInsertSchema } from '../shared/bank.
|
|
6
|
+
import { I as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, P as PAYMENT_TYPES, d as CONNECTOR_KEYS, B as BATCH_STATUSES, a as PAYMENT_STATUSES, b as PAYMENT_DIRECTIONS, f as accountInsertSchema } from '../shared/bank.C1bHZDjr.mjs';
|
|
7
7
|
import { CURRENCY_CODES } from '@develit-io/general-codes';
|
|
8
8
|
import 'date-fns';
|
|
9
9
|
import { eq, sql, inArray, and, asc, desc, gte, lte } from 'drizzle-orm';
|
|
10
10
|
import 'jose';
|
|
11
11
|
import 'node:crypto';
|
|
12
|
-
import { f as encrypt, i as importAesKey, a as getCredentialsByAccountId, b as initiateConnector, u as upsertBatchCommand, d as getBatchByIdQuery, c as createPaymentCommand, g as getAccountByIdQuery } from '../shared/bank.
|
|
12
|
+
import { f as encrypt, i as importAesKey, a as getCredentialsByAccountId, b as initiateConnector, u as upsertBatchCommand, d as getBatchByIdQuery, c as createPaymentCommand, g as getAccountByIdQuery } from '../shared/bank.DyoWDyOf.mjs';
|
|
13
13
|
import 'drizzle-orm/sqlite-core';
|
|
14
14
|
import 'drizzle-orm/relations';
|
|
15
15
|
import 'drizzle-zod';
|
|
@@ -405,10 +405,8 @@ const updateAccountInputSchema = z.object({
|
|
|
405
405
|
});
|
|
406
406
|
|
|
407
407
|
const getBankAccountsInputSchema = z.object({
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
batchCounts: z.boolean().optional()
|
|
411
|
-
}).optional()
|
|
408
|
+
includeWorkflow: z.boolean().optional(),
|
|
409
|
+
includeBatchCounts: z.boolean().optional()
|
|
412
410
|
});
|
|
413
411
|
|
|
414
412
|
const disconnectAccountInputSchema = z.object({
|
|
@@ -578,15 +576,16 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
578
576
|
}
|
|
579
577
|
async _resolveSingleBatch(batch, connector) {
|
|
580
578
|
const previousStatus = batch.status;
|
|
581
|
-
const currentStatus = await connector.getBatchStatus({
|
|
579
|
+
const { status: currentStatus, apiResponse } = await connector.getBatchStatus({
|
|
582
580
|
batchId: batch.id
|
|
583
581
|
});
|
|
584
582
|
let statusChanged = false;
|
|
585
|
-
if (previousStatus !== currentStatus) {
|
|
583
|
+
if (previousStatus !== currentStatus || !batch.statusResponse) {
|
|
586
584
|
await upsertBatchCommand(this.db, {
|
|
587
585
|
batch: {
|
|
588
586
|
...batch,
|
|
589
|
-
status: currentStatus
|
|
587
|
+
status: currentStatus,
|
|
588
|
+
statusResponse: apiResponse
|
|
590
589
|
}
|
|
591
590
|
}).command.execute();
|
|
592
591
|
statusChanged = true;
|
|
@@ -1011,10 +1010,8 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
1011
1010
|
return this.handleAction(
|
|
1012
1011
|
{ data: input, schema: getBankAccountsInputSchema },
|
|
1013
1012
|
{ successMessage: "Bank accounts retrieved successfully" },
|
|
1014
|
-
async ({
|
|
1013
|
+
async ({ includeWorkflow, includeBatchCounts }) => {
|
|
1015
1014
|
const accounts = await this._getAccounts();
|
|
1016
|
-
const includeWorkflow = includes?.workflow ?? true;
|
|
1017
|
-
const includeBatchCounts = includes?.batchCounts ?? false;
|
|
1018
1015
|
const accountsWithOptionalFields = await Promise.all(
|
|
1019
1016
|
accounts.map(async (a) => {
|
|
1020
1017
|
const result = {
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
const cloudflare_workers = require('cloudflare:workers');
|
|
4
4
|
const cloudflare_workflows = require('cloudflare:workflows');
|
|
5
5
|
const d1 = require('drizzle-orm/d1');
|
|
6
|
-
const drizzle = require('../shared/bank.
|
|
6
|
+
const drizzle = require('../shared/bank.DIn77H1S.cjs');
|
|
7
7
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
8
|
-
const encryption = require('../shared/bank.
|
|
8
|
+
const encryption = require('../shared/bank.tqnXqWCE.cjs');
|
|
9
9
|
const drizzleOrm = require('drizzle-orm');
|
|
10
10
|
require('date-fns');
|
|
11
|
-
require('../shared/bank.
|
|
11
|
+
require('../shared/bank.DoHc7geB.cjs');
|
|
12
12
|
require('drizzle-orm/sqlite-core');
|
|
13
13
|
require('drizzle-orm/relations');
|
|
14
14
|
require('@develit-io/general-codes');
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { WorkflowEntrypoint } from 'cloudflare:workers';
|
|
2
2
|
import { NonRetryableError } from 'cloudflare:workflows';
|
|
3
3
|
import { drizzle } from 'drizzle-orm/d1';
|
|
4
|
-
import { t as tables } from '../shared/bank.
|
|
4
|
+
import { t as tables } from '../shared/bank.BrwlZUfo.mjs';
|
|
5
5
|
import { asNonEmpty, first } from '@develit-io/backend-sdk';
|
|
6
|
-
import { g as getAccountByIdQuery, i as importAesKey, a as getCredentialsByAccountId, b as initiateConnector, c as createPaymentCommand, d as getBatchByIdQuery, e as checksum, u as upsertBatchCommand } from '../shared/bank.
|
|
6
|
+
import { g as getAccountByIdQuery, i as importAesKey, a as getCredentialsByAccountId, b as initiateConnector, c as createPaymentCommand, d as getBatchByIdQuery, e as checksum, u as upsertBatchCommand } from '../shared/bank.DyoWDyOf.mjs';
|
|
7
7
|
import { eq } from 'drizzle-orm';
|
|
8
8
|
import 'date-fns';
|
|
9
|
-
import '../shared/bank.
|
|
9
|
+
import '../shared/bank.C1bHZDjr.mjs';
|
|
10
10
|
import 'drizzle-orm/sqlite-core';
|
|
11
11
|
import 'drizzle-orm/relations';
|
|
12
12
|
import '@develit-io/general-codes';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { uuidv4, useResult, createInternalError } from '@develit-io/backend-sdk';
|
|
2
2
|
import { format, parseISO } from 'date-fns';
|
|
3
|
-
import { s as schema } from './bank.
|
|
3
|
+
import { s as schema } from './bank.C1bHZDjr.mjs';
|
|
4
4
|
import { and, eq } from 'drizzle-orm';
|
|
5
5
|
import { importPKCS8, SignJWT } from 'jose';
|
|
6
6
|
import '@develit-io/general-codes';
|
|
@@ -172,7 +172,7 @@ const mapFinbricksTransactionStatus = (status) => {
|
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
174
|
const mapFinbricksBatchStatus = (status) => {
|
|
175
|
-
return status === "REJECTED" ? "
|
|
175
|
+
return status === "REJECTED" ? "SIGNATURE_FAILED" : status === "AUTHORIZED" ? "SIGNED" : void 0;
|
|
176
176
|
};
|
|
177
177
|
|
|
178
178
|
const mapFinbricksAccountInsert = ({
|
|
@@ -686,7 +686,10 @@ class FinbricksConnector extends IBankConnector {
|
|
|
686
686
|
}
|
|
687
687
|
return mapFinbricksTransactionStatus(response.resultCode);
|
|
688
688
|
}
|
|
689
|
-
async getBatchStatus({
|
|
689
|
+
async getBatchStatus({
|
|
690
|
+
batchId,
|
|
691
|
+
currentStatus
|
|
692
|
+
}) {
|
|
690
693
|
const [response, error] = await useResult(
|
|
691
694
|
this.finbricks.request({
|
|
692
695
|
method: "POST",
|
|
@@ -702,7 +705,10 @@ class FinbricksConnector extends IBankConnector {
|
|
|
702
705
|
message: "Finbricks: failed to fetch batch status"
|
|
703
706
|
});
|
|
704
707
|
}
|
|
705
|
-
return
|
|
708
|
+
return {
|
|
709
|
+
status: mapFinbricksBatchStatus(response.batchResultCode) ?? currentStatus,
|
|
710
|
+
apiResponse: response
|
|
711
|
+
};
|
|
706
712
|
}
|
|
707
713
|
}
|
|
708
714
|
|
|
@@ -114,6 +114,7 @@ const batch = sqliteTable("batch", {
|
|
|
114
114
|
accountId: text("account_id").references(() => account.id),
|
|
115
115
|
status: text("status", { enum: BATCH_STATUSES }).$type(),
|
|
116
116
|
statusReason: text("status_reason"),
|
|
117
|
+
statusResponse: text("status_response", { mode: "json" }).$type(),
|
|
117
118
|
payments: text("payments", { mode: "json" }).$type().notNull(),
|
|
118
119
|
metadata: text("metadata", { mode: "json" }).$type(),
|
|
119
120
|
paymentsChecksum: text("payments_checksum")
|
|
@@ -71,7 +71,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
71
71
|
tableName: "batch";
|
|
72
72
|
dataType: "string";
|
|
73
73
|
columnType: "SQLiteText";
|
|
74
|
-
data: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED"
|
|
74
|
+
data: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED";
|
|
75
75
|
driverParam: string;
|
|
76
76
|
notNull: false;
|
|
77
77
|
hasDefault: false;
|
|
@@ -84,7 +84,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
84
84
|
generated: undefined;
|
|
85
85
|
}, {}, {
|
|
86
86
|
length: number | undefined;
|
|
87
|
-
$type: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED"
|
|
87
|
+
$type: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED";
|
|
88
88
|
}>;
|
|
89
89
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
90
90
|
name: "status_reason";
|
|
@@ -105,6 +105,25 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
105
105
|
}, {}, {
|
|
106
106
|
length: number | undefined;
|
|
107
107
|
}>;
|
|
108
|
+
statusResponse: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
109
|
+
name: "status_response";
|
|
110
|
+
tableName: "batch";
|
|
111
|
+
dataType: "json";
|
|
112
|
+
columnType: "SQLiteTextJson";
|
|
113
|
+
data: object;
|
|
114
|
+
driverParam: string;
|
|
115
|
+
notNull: false;
|
|
116
|
+
hasDefault: false;
|
|
117
|
+
isPrimaryKey: false;
|
|
118
|
+
isAutoincrement: false;
|
|
119
|
+
hasRuntimeDefault: false;
|
|
120
|
+
enumValues: undefined;
|
|
121
|
+
baseColumn: never;
|
|
122
|
+
identity: undefined;
|
|
123
|
+
generated: undefined;
|
|
124
|
+
}, {}, {
|
|
125
|
+
$type: object;
|
|
126
|
+
}>;
|
|
108
127
|
payments: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
109
128
|
name: "payments";
|
|
110
129
|
tableName: "batch";
|
|
@@ -418,7 +437,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
418
437
|
tableName: "payment";
|
|
419
438
|
dataType: "string";
|
|
420
439
|
columnType: "SQLiteText";
|
|
421
|
-
data: "
|
|
440
|
+
data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
422
441
|
driverParam: string;
|
|
423
442
|
notNull: true;
|
|
424
443
|
hasDefault: false;
|
|
@@ -431,7 +450,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
431
450
|
generated: undefined;
|
|
432
451
|
}, {}, {
|
|
433
452
|
length: number | undefined;
|
|
434
|
-
$type: "
|
|
453
|
+
$type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
435
454
|
}>;
|
|
436
455
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
437
456
|
name: "status_reason";
|
|
@@ -1694,7 +1713,10 @@ declare abstract class IBankConnector {
|
|
|
1694
1713
|
}): Promise<PaymentStatus>;
|
|
1695
1714
|
abstract getBatchStatus({ batchId, }: {
|
|
1696
1715
|
batchId: string;
|
|
1697
|
-
}): Promise<
|
|
1716
|
+
}): Promise<{
|
|
1717
|
+
status: BatchStatus;
|
|
1718
|
+
apiResponse: object;
|
|
1719
|
+
}>;
|
|
1698
1720
|
}
|
|
1699
1721
|
|
|
1700
1722
|
interface PaymentSelectType extends InferSelectModel<typeof tables.payment> {
|
|
@@ -71,7 +71,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
71
71
|
tableName: "batch";
|
|
72
72
|
dataType: "string";
|
|
73
73
|
columnType: "SQLiteText";
|
|
74
|
-
data: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED"
|
|
74
|
+
data: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED";
|
|
75
75
|
driverParam: string;
|
|
76
76
|
notNull: false;
|
|
77
77
|
hasDefault: false;
|
|
@@ -84,7 +84,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
84
84
|
generated: undefined;
|
|
85
85
|
}, {}, {
|
|
86
86
|
length: number | undefined;
|
|
87
|
-
$type: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED"
|
|
87
|
+
$type: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED";
|
|
88
88
|
}>;
|
|
89
89
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
90
90
|
name: "status_reason";
|
|
@@ -105,6 +105,25 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
105
105
|
}, {}, {
|
|
106
106
|
length: number | undefined;
|
|
107
107
|
}>;
|
|
108
|
+
statusResponse: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
109
|
+
name: "status_response";
|
|
110
|
+
tableName: "batch";
|
|
111
|
+
dataType: "json";
|
|
112
|
+
columnType: "SQLiteTextJson";
|
|
113
|
+
data: object;
|
|
114
|
+
driverParam: string;
|
|
115
|
+
notNull: false;
|
|
116
|
+
hasDefault: false;
|
|
117
|
+
isPrimaryKey: false;
|
|
118
|
+
isAutoincrement: false;
|
|
119
|
+
hasRuntimeDefault: false;
|
|
120
|
+
enumValues: undefined;
|
|
121
|
+
baseColumn: never;
|
|
122
|
+
identity: undefined;
|
|
123
|
+
generated: undefined;
|
|
124
|
+
}, {}, {
|
|
125
|
+
$type: object;
|
|
126
|
+
}>;
|
|
108
127
|
payments: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
109
128
|
name: "payments";
|
|
110
129
|
tableName: "batch";
|
|
@@ -418,7 +437,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
418
437
|
tableName: "payment";
|
|
419
438
|
dataType: "string";
|
|
420
439
|
columnType: "SQLiteText";
|
|
421
|
-
data: "
|
|
440
|
+
data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
422
441
|
driverParam: string;
|
|
423
442
|
notNull: true;
|
|
424
443
|
hasDefault: false;
|
|
@@ -431,7 +450,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
431
450
|
generated: undefined;
|
|
432
451
|
}, {}, {
|
|
433
452
|
length: number | undefined;
|
|
434
|
-
$type: "
|
|
453
|
+
$type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
435
454
|
}>;
|
|
436
455
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
437
456
|
name: "status_reason";
|
|
@@ -1694,7 +1713,10 @@ declare abstract class IBankConnector {
|
|
|
1694
1713
|
}): Promise<PaymentStatus>;
|
|
1695
1714
|
abstract getBatchStatus({ batchId, }: {
|
|
1696
1715
|
batchId: string;
|
|
1697
|
-
}): Promise<
|
|
1716
|
+
}): Promise<{
|
|
1717
|
+
status: BatchStatus;
|
|
1718
|
+
apiResponse: object;
|
|
1719
|
+
}>;
|
|
1698
1720
|
}
|
|
1699
1721
|
|
|
1700
1722
|
interface PaymentSelectType extends InferSelectModel<typeof tables.payment> {
|
|
@@ -71,7 +71,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
71
71
|
tableName: "batch";
|
|
72
72
|
dataType: "string";
|
|
73
73
|
columnType: "SQLiteText";
|
|
74
|
-
data: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED"
|
|
74
|
+
data: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED";
|
|
75
75
|
driverParam: string;
|
|
76
76
|
notNull: false;
|
|
77
77
|
hasDefault: false;
|
|
@@ -84,7 +84,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
84
84
|
generated: undefined;
|
|
85
85
|
}, {}, {
|
|
86
86
|
length: number | undefined;
|
|
87
|
-
$type: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED"
|
|
87
|
+
$type: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED";
|
|
88
88
|
}>;
|
|
89
89
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
90
90
|
name: "status_reason";
|
|
@@ -105,6 +105,25 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
105
105
|
}, {}, {
|
|
106
106
|
length: number | undefined;
|
|
107
107
|
}>;
|
|
108
|
+
statusResponse: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
109
|
+
name: "status_response";
|
|
110
|
+
tableName: "batch";
|
|
111
|
+
dataType: "json";
|
|
112
|
+
columnType: "SQLiteTextJson";
|
|
113
|
+
data: object;
|
|
114
|
+
driverParam: string;
|
|
115
|
+
notNull: false;
|
|
116
|
+
hasDefault: false;
|
|
117
|
+
isPrimaryKey: false;
|
|
118
|
+
isAutoincrement: false;
|
|
119
|
+
hasRuntimeDefault: false;
|
|
120
|
+
enumValues: undefined;
|
|
121
|
+
baseColumn: never;
|
|
122
|
+
identity: undefined;
|
|
123
|
+
generated: undefined;
|
|
124
|
+
}, {}, {
|
|
125
|
+
$type: object;
|
|
126
|
+
}>;
|
|
108
127
|
payments: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
109
128
|
name: "payments";
|
|
110
129
|
tableName: "batch";
|
|
@@ -418,7 +437,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
418
437
|
tableName: "payment";
|
|
419
438
|
dataType: "string";
|
|
420
439
|
columnType: "SQLiteText";
|
|
421
|
-
data: "
|
|
440
|
+
data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
422
441
|
driverParam: string;
|
|
423
442
|
notNull: true;
|
|
424
443
|
hasDefault: false;
|
|
@@ -431,7 +450,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
431
450
|
generated: undefined;
|
|
432
451
|
}, {}, {
|
|
433
452
|
length: number | undefined;
|
|
434
|
-
$type: "
|
|
453
|
+
$type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
435
454
|
}>;
|
|
436
455
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
437
456
|
name: "status_reason";
|
|
@@ -1694,7 +1713,10 @@ declare abstract class IBankConnector {
|
|
|
1694
1713
|
}): Promise<PaymentStatus>;
|
|
1695
1714
|
abstract getBatchStatus({ batchId, }: {
|
|
1696
1715
|
batchId: string;
|
|
1697
|
-
}): Promise<
|
|
1716
|
+
}): Promise<{
|
|
1717
|
+
status: BatchStatus;
|
|
1718
|
+
apiResponse: object;
|
|
1719
|
+
}>;
|
|
1698
1720
|
}
|
|
1699
1721
|
|
|
1700
1722
|
interface PaymentSelectType extends InferSelectModel<typeof tables.payment> {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
4
|
const dateFns = require('date-fns');
|
|
5
|
-
const database_schema = require('./bank.
|
|
5
|
+
const database_schema = require('./bank.DoHc7geB.cjs');
|
|
6
6
|
const drizzleOrm = require('drizzle-orm');
|
|
7
7
|
const jose = require('jose');
|
|
8
8
|
require('@develit-io/general-codes');
|
|
@@ -174,7 +174,7 @@ const mapFinbricksTransactionStatus = (status) => {
|
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
176
|
const mapFinbricksBatchStatus = (status) => {
|
|
177
|
-
return status === "REJECTED" ? "
|
|
177
|
+
return status === "REJECTED" ? "SIGNATURE_FAILED" : status === "AUTHORIZED" ? "SIGNED" : void 0;
|
|
178
178
|
};
|
|
179
179
|
|
|
180
180
|
const mapFinbricksAccountInsert = ({
|
|
@@ -688,7 +688,10 @@ class FinbricksConnector extends IBankConnector {
|
|
|
688
688
|
}
|
|
689
689
|
return mapFinbricksTransactionStatus(response.resultCode);
|
|
690
690
|
}
|
|
691
|
-
async getBatchStatus({
|
|
691
|
+
async getBatchStatus({
|
|
692
|
+
batchId,
|
|
693
|
+
currentStatus
|
|
694
|
+
}) {
|
|
692
695
|
const [response, error] = await backendSdk.useResult(
|
|
693
696
|
this.finbricks.request({
|
|
694
697
|
method: "POST",
|
|
@@ -704,7 +707,10 @@ class FinbricksConnector extends IBankConnector {
|
|
|
704
707
|
message: "Finbricks: failed to fetch batch status"
|
|
705
708
|
});
|
|
706
709
|
}
|
|
707
|
-
return
|
|
710
|
+
return {
|
|
711
|
+
status: mapFinbricksBatchStatus(response.batchResultCode) ?? currentStatus,
|
|
712
|
+
apiResponse: response
|
|
713
|
+
};
|
|
708
714
|
}
|
|
709
715
|
}
|
|
710
716
|
|
|
@@ -116,6 +116,7 @@ const batch = sqliteCore.sqliteTable("batch", {
|
|
|
116
116
|
accountId: sqliteCore.text("account_id").references(() => account.id),
|
|
117
117
|
status: sqliteCore.text("status", { enum: BATCH_STATUSES }).$type(),
|
|
118
118
|
statusReason: sqliteCore.text("status_reason"),
|
|
119
|
+
statusResponse: sqliteCore.text("status_response", { mode: "json" }).$type(),
|
|
119
120
|
payments: sqliteCore.text("payments", { mode: "json" }).$type().notNull(),
|
|
120
121
|
metadata: sqliteCore.text("metadata", { mode: "json" }).$type(),
|
|
121
122
|
paymentsChecksum: sqliteCore.text("payments_checksum")
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as tables, F as FinbricksConnector, M as MockConnector, a as MockCobsConnector, E as ErsteConnector } from './bank.
|
|
1
|
+
import { t as tables, F as FinbricksConnector, M as MockConnector, a as MockCobsConnector, E as ErsteConnector } from './bank.BrwlZUfo.mjs';
|
|
2
2
|
import { uuidv4 } from '@develit-io/backend-sdk';
|
|
3
3
|
import { eq } from 'drizzle-orm';
|
|
4
4
|
import 'date-fns';
|
|
5
5
|
import 'jose';
|
|
6
6
|
import '@develit-io/general-codes';
|
|
7
|
-
import './bank.
|
|
7
|
+
import './bank.C1bHZDjr.mjs';
|
|
8
8
|
import { createHash } from 'node:crypto';
|
|
9
9
|
|
|
10
10
|
const createPaymentCommand = (db, { payment }) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const drizzle = require('./bank.
|
|
3
|
+
const drizzle = require('./bank.DIn77H1S.cjs');
|
|
4
4
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
5
5
|
const drizzleOrm = require('drizzle-orm');
|
|
6
6
|
require('date-fns');
|
|
7
7
|
require('jose');
|
|
8
8
|
require('@develit-io/general-codes');
|
|
9
|
-
require('./bank.
|
|
9
|
+
require('./bank.DoHc7geB.cjs');
|
|
10
10
|
const node_crypto = require('node:crypto');
|
|
11
11
|
|
|
12
12
|
const createPaymentCommand = (db, { payment }) => {
|
package/dist/types.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const drizzle = require('./shared/bank.
|
|
4
|
-
const database_schema = require('./shared/bank.
|
|
3
|
+
const drizzle = require('./shared/bank.DIn77H1S.cjs');
|
|
4
|
+
const database_schema = require('./shared/bank.DoHc7geB.cjs');
|
|
5
5
|
const generalCodes = require('@develit-io/general-codes');
|
|
6
6
|
require('@develit-io/backend-sdk');
|
|
7
7
|
require('date-fns');
|
package/dist/types.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.
|
|
2
|
-
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.DHQNmyQt.cjs';
|
|
2
|
+
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.DHQNmyQt.cjs';
|
|
3
3
|
import { Environment, BaseEvent } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
5
|
export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.Dh_H_5rC.cjs';
|
|
@@ -69,7 +69,10 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
69
69
|
}): Promise<PaymentStatus>;
|
|
70
70
|
getBatchStatus(_: {
|
|
71
71
|
batchId: string;
|
|
72
|
-
}): Promise<
|
|
72
|
+
}): Promise<{
|
|
73
|
+
status: BatchStatus;
|
|
74
|
+
apiResponse: object;
|
|
75
|
+
}>;
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
type FinbricksProvider = 'KB' | 'ERSTE' | 'CSOB' | 'MOCK_COBS' | 'CREDITAS' | 'FIO' | 'MONETA';
|
|
@@ -494,9 +497,13 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
494
497
|
getPaymentStatus({ paymentId, }: {
|
|
495
498
|
paymentId: string;
|
|
496
499
|
}): Promise<PaymentStatus>;
|
|
497
|
-
getBatchStatus({ batchId }: {
|
|
500
|
+
getBatchStatus({ batchId, currentStatus, }: {
|
|
498
501
|
batchId: string;
|
|
499
|
-
|
|
502
|
+
currentStatus: BatchStatus;
|
|
503
|
+
}): Promise<{
|
|
504
|
+
status: BatchStatus;
|
|
505
|
+
apiResponse: object;
|
|
506
|
+
}>;
|
|
500
507
|
}
|
|
501
508
|
|
|
502
509
|
declare class MockConnector extends IBankConnector {
|
|
@@ -530,7 +537,10 @@ declare class MockConnector extends IBankConnector {
|
|
|
530
537
|
}): Promise<PaymentStatus>;
|
|
531
538
|
getBatchStatus(_: {
|
|
532
539
|
batchId: string;
|
|
533
|
-
}): Promise<
|
|
540
|
+
}): Promise<{
|
|
541
|
+
status: BatchStatus;
|
|
542
|
+
apiResponse: object;
|
|
543
|
+
}>;
|
|
534
544
|
}
|
|
535
545
|
|
|
536
546
|
declare class MockCobsConnector extends FinbricksConnector {
|
package/dist/types.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.
|
|
2
|
-
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.DHQNmyQt.mjs';
|
|
2
|
+
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.DHQNmyQt.mjs';
|
|
3
3
|
import { Environment, BaseEvent } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
5
|
export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.Dh_H_5rC.mjs';
|
|
@@ -69,7 +69,10 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
69
69
|
}): Promise<PaymentStatus>;
|
|
70
70
|
getBatchStatus(_: {
|
|
71
71
|
batchId: string;
|
|
72
|
-
}): Promise<
|
|
72
|
+
}): Promise<{
|
|
73
|
+
status: BatchStatus;
|
|
74
|
+
apiResponse: object;
|
|
75
|
+
}>;
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
type FinbricksProvider = 'KB' | 'ERSTE' | 'CSOB' | 'MOCK_COBS' | 'CREDITAS' | 'FIO' | 'MONETA';
|
|
@@ -494,9 +497,13 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
494
497
|
getPaymentStatus({ paymentId, }: {
|
|
495
498
|
paymentId: string;
|
|
496
499
|
}): Promise<PaymentStatus>;
|
|
497
|
-
getBatchStatus({ batchId }: {
|
|
500
|
+
getBatchStatus({ batchId, currentStatus, }: {
|
|
498
501
|
batchId: string;
|
|
499
|
-
|
|
502
|
+
currentStatus: BatchStatus;
|
|
503
|
+
}): Promise<{
|
|
504
|
+
status: BatchStatus;
|
|
505
|
+
apiResponse: object;
|
|
506
|
+
}>;
|
|
500
507
|
}
|
|
501
508
|
|
|
502
509
|
declare class MockConnector extends IBankConnector {
|
|
@@ -530,7 +537,10 @@ declare class MockConnector extends IBankConnector {
|
|
|
530
537
|
}): Promise<PaymentStatus>;
|
|
531
538
|
getBatchStatus(_: {
|
|
532
539
|
batchId: string;
|
|
533
|
-
}): Promise<
|
|
540
|
+
}): Promise<{
|
|
541
|
+
status: BatchStatus;
|
|
542
|
+
apiResponse: object;
|
|
543
|
+
}>;
|
|
534
544
|
}
|
|
535
545
|
|
|
536
546
|
declare class MockCobsConnector extends FinbricksConnector {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.
|
|
2
|
-
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.DHQNmyQt.js';
|
|
2
|
+
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.DHQNmyQt.js';
|
|
3
3
|
import { Environment, BaseEvent } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
5
|
export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.Dh_H_5rC.js';
|
|
@@ -69,7 +69,10 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
69
69
|
}): Promise<PaymentStatus>;
|
|
70
70
|
getBatchStatus(_: {
|
|
71
71
|
batchId: string;
|
|
72
|
-
}): Promise<
|
|
72
|
+
}): Promise<{
|
|
73
|
+
status: BatchStatus;
|
|
74
|
+
apiResponse: object;
|
|
75
|
+
}>;
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
type FinbricksProvider = 'KB' | 'ERSTE' | 'CSOB' | 'MOCK_COBS' | 'CREDITAS' | 'FIO' | 'MONETA';
|
|
@@ -494,9 +497,13 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
494
497
|
getPaymentStatus({ paymentId, }: {
|
|
495
498
|
paymentId: string;
|
|
496
499
|
}): Promise<PaymentStatus>;
|
|
497
|
-
getBatchStatus({ batchId }: {
|
|
500
|
+
getBatchStatus({ batchId, currentStatus, }: {
|
|
498
501
|
batchId: string;
|
|
499
|
-
|
|
502
|
+
currentStatus: BatchStatus;
|
|
503
|
+
}): Promise<{
|
|
504
|
+
status: BatchStatus;
|
|
505
|
+
apiResponse: object;
|
|
506
|
+
}>;
|
|
500
507
|
}
|
|
501
508
|
|
|
502
509
|
declare class MockConnector extends IBankConnector {
|
|
@@ -530,7 +537,10 @@ declare class MockConnector extends IBankConnector {
|
|
|
530
537
|
}): Promise<PaymentStatus>;
|
|
531
538
|
getBatchStatus(_: {
|
|
532
539
|
batchId: string;
|
|
533
|
-
}): Promise<
|
|
540
|
+
}): Promise<{
|
|
541
|
+
status: BatchStatus;
|
|
542
|
+
apiResponse: object;
|
|
543
|
+
}>;
|
|
534
544
|
}
|
|
535
545
|
|
|
536
546
|
declare class MockCobsConnector extends FinbricksConnector {
|
package/dist/types.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { E as ErsteConnector, c as FINBRICKS_ENDPOINTS, b as FinbricksClient, F as FinbricksConnector, I as IBankConnector, a as MockCobsConnector, M as MockConnector, s as signFinbricksJws, u as useFinbricksFetch } from './shared/bank.
|
|
2
|
-
export { A as ACCOUNT_STATUSES, B as BATCH_STATUES, B as BATCH_STATUSES, C as CHARGE_BEARERS, d as CONNECTOR_KEYS, c as COUNTRY_CODES, e as CREDENTIALS_TYPES, I as INSTRUCTION_PRIORITIES, b as PAYMENT_DIRECTIONS, a as PAYMENT_STATUSES, P as PAYMENT_TYPES, T as TOKEN_TYPES, i as accountCredentialsInsertSchema, k as accountCredentialsSelectSchema, j as accountCredentialsUpdateSchema, f as accountInsertSchema, h as accountSelectSchema, g as accountUpdateSchema, o as ottInsertSchema, m as ottSelectSchema, l as ottUpdateSchema } from './shared/bank.
|
|
1
|
+
export { E as ErsteConnector, c as FINBRICKS_ENDPOINTS, b as FinbricksClient, F as FinbricksConnector, I as IBankConnector, a as MockCobsConnector, M as MockConnector, s as signFinbricksJws, u as useFinbricksFetch } from './shared/bank.BrwlZUfo.mjs';
|
|
2
|
+
export { A as ACCOUNT_STATUSES, B as BATCH_STATUES, B as BATCH_STATUSES, C as CHARGE_BEARERS, d as CONNECTOR_KEYS, c as COUNTRY_CODES, e as CREDENTIALS_TYPES, I as INSTRUCTION_PRIORITIES, b as PAYMENT_DIRECTIONS, a as PAYMENT_STATUSES, P as PAYMENT_TYPES, T as TOKEN_TYPES, i as accountCredentialsInsertSchema, k as accountCredentialsSelectSchema, j as accountCredentialsUpdateSchema, f as accountInsertSchema, h as accountSelectSchema, g as accountUpdateSchema, o as ottInsertSchema, m as ottSelectSchema, l as ottUpdateSchema } from './shared/bank.C1bHZDjr.mjs';
|
|
3
3
|
export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
4
4
|
import '@develit-io/backend-sdk';
|
|
5
5
|
import 'date-fns';
|