@develit-services/bank 0.8.18 → 0.8.20
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 +10 -10
- 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 +2 -2
- package/dist/export/worker.cjs +178 -172
- package/dist/export/worker.d.cts +4 -5
- package/dist/export/worker.d.mts +4 -5
- package/dist/export/worker.d.ts +4 -5
- package/dist/export/worker.mjs +63 -57
- package/dist/export/workflows.cjs +31 -45
- package/dist/export/workflows.mjs +6 -20
- package/dist/shared/{bank.Cj2Goq7s.d.cts → bank.BOY6AI1t.d.cts} +6 -3
- package/dist/shared/{bank.Cj2Goq7s.d.mts → bank.BOY6AI1t.d.mts} +6 -3
- package/dist/shared/{bank.Cj2Goq7s.d.ts → bank.BOY6AI1t.d.ts} +6 -3
- package/dist/shared/{bank.t3wDtBAy.d.mts → bank.Bo01T_MM.d.cts} +1 -1
- package/dist/shared/{bank.xB9eTN77.mjs → bank.CPLR0Ul7.mjs} +2 -5
- package/dist/shared/{bank.B6dkPRYF.mjs → bank.Cwg6oHMM.mjs} +5 -3
- package/dist/shared/{bank.C75Z9vML.cjs → bank.DWsHTK_n.cjs} +5 -3
- package/dist/shared/{bank.BInWezKM.d.ts → bank.DfTdMAi9.d.ts} +1 -1
- package/dist/shared/{bank.CXBeULUL.mjs → bank.ESTBT4J6.mjs} +50 -3
- package/dist/shared/{bank.BsIiXsFH.cjs → bank.NF8bZBy0.cjs} +0 -9
- package/dist/shared/{bank.vz1uqEYa.mjs → bank.XqSw509X.mjs} +1 -8
- package/dist/shared/{bank.DzFAA6Gp.d.cts → bank.jRGa7MKk.d.mts} +1 -1
- package/dist/shared/{bank.BBXoZ5QU.cjs → bank.o95cOH_P.cjs} +56 -2
- package/dist/shared/{bank.Cev1E9sk.cjs → bank.vGCuP898.cjs} +14 -18
- package/dist/types.cjs +32 -29
- 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 +4 -4
- package/package.json +1 -1
- package/dist/shared/bank.CR0UlyRi.mjs +0 -15
- package/dist/shared/bank.CVi6R7fr.cjs +0 -17
package/dist/export/worker.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
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 ConfigEnvironmentBank, t as tables, b as ConnectorKey, I as IBankConnector, c as PaymentType, d as CurrencyCode, H as HandleAuthorizationCallbackInput, e as HandleAuthorizationCallbackOutput } from '../shared/bank.BOY6AI1t.cjs';
|
|
2
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from '../shared/bank.Bo01T_MM.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';
|
|
@@ -785,9 +785,8 @@ declare const sendBatchInputSchema: z.ZodObject<{
|
|
|
785
785
|
}, z.core.$strip>;
|
|
786
786
|
interface SendBatchInput extends z.infer<typeof sendBatchInputSchema> {
|
|
787
787
|
}
|
|
788
|
-
type SendBatchOutput = {
|
|
789
|
-
|
|
790
|
-
authorizationUrls: string[];
|
|
788
|
+
type SendBatchOutput = BatchSelectType & {
|
|
789
|
+
paymentRequests: PaymentRequestSelectType[];
|
|
791
790
|
};
|
|
792
791
|
|
|
793
792
|
declare const getAuthUriInputSchema: z.ZodObject<{
|
package/dist/export/worker.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
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 ConfigEnvironmentBank, t as tables, b as ConnectorKey, I as IBankConnector, c as PaymentType, d as CurrencyCode, H as HandleAuthorizationCallbackInput, e as HandleAuthorizationCallbackOutput } from '../shared/bank.BOY6AI1t.mjs';
|
|
2
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from '../shared/bank.jRGa7MKk.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';
|
|
@@ -785,9 +785,8 @@ declare const sendBatchInputSchema: z.ZodObject<{
|
|
|
785
785
|
}, z.core.$strip>;
|
|
786
786
|
interface SendBatchInput extends z.infer<typeof sendBatchInputSchema> {
|
|
787
787
|
}
|
|
788
|
-
type SendBatchOutput = {
|
|
789
|
-
|
|
790
|
-
authorizationUrls: string[];
|
|
788
|
+
type SendBatchOutput = BatchSelectType & {
|
|
789
|
+
paymentRequests: PaymentRequestSelectType[];
|
|
791
790
|
};
|
|
792
791
|
|
|
793
792
|
declare const getAuthUriInputSchema: z.ZodObject<{
|
package/dist/export/worker.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
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 ConfigEnvironmentBank, t as tables, b as ConnectorKey, I as IBankConnector, c as PaymentType, d as CurrencyCode, H as HandleAuthorizationCallbackInput, e as HandleAuthorizationCallbackOutput } from '../shared/bank.BOY6AI1t.js';
|
|
2
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from '../shared/bank.DfTdMAi9.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';
|
|
@@ -785,9 +785,8 @@ declare const sendBatchInputSchema: z.ZodObject<{
|
|
|
785
785
|
}, z.core.$strip>;
|
|
786
786
|
interface SendBatchInput extends z.infer<typeof sendBatchInputSchema> {
|
|
787
787
|
}
|
|
788
|
-
type SendBatchOutput = {
|
|
789
|
-
|
|
790
|
-
authorizationUrls: string[];
|
|
788
|
+
type SendBatchOutput = BatchSelectType & {
|
|
789
|
+
paymentRequests: PaymentRequestSelectType[];
|
|
791
790
|
};
|
|
792
791
|
|
|
793
792
|
declare const getAuthUriInputSchema: z.ZodObject<{
|
package/dist/export/worker.mjs
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { uuidv4, first, buildMultiFilterConditions as buildMultiFilterConditions$1, bankAccountMetadataSchema, workflowInstanceStatusSchema, develitWorker, createInternalError, action, service } from '@develit-io/backend-sdk';
|
|
2
|
-
import {
|
|
3
|
-
import { eq, sql, and, like, asc, desc, inArray, gte, lte, isNull, count
|
|
2
|
+
import { v as tables, 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, k as accountInsertSchema, e as PAYMENT_REQUEST_STATUSES, q as isProcessedStatus, r as isTerminalStatus, w as getNonTerminalPaymentRequestsQuery } from '../shared/bank.ESTBT4J6.mjs';
|
|
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
|
-
import { j as initiateConnector, g as toIncomingPayment, d as assignAccount, t as toBatchedPayment, h as toPaymentRequestInsert, a as FinbricksClient, F as FINBRICKS_ENDPOINTS } from '../shared/bank.
|
|
6
|
+
import { j as initiateConnector, g as toIncomingPayment, d as assignAccount, t as toBatchedPayment, h as toPaymentRequestInsert, a as FinbricksClient, F as FINBRICKS_ENDPOINTS } from '../shared/bank.Cwg6oHMM.mjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import { z } from 'zod';
|
|
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, k as accountInsertSchema, e as PAYMENT_REQUEST_STATUSES } from '../shared/bank.CXBeULUL.mjs';
|
|
10
9
|
import { CURRENCY_CODES } from '@develit-io/general-codes';
|
|
11
10
|
import 'date-fns';
|
|
12
11
|
import 'node:crypto';
|
|
13
|
-
import '../shared/bank.
|
|
14
|
-
import 'drizzle-orm/relations';
|
|
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.CPLR0Ul7.mjs';
|
|
15
13
|
import 'drizzle-orm/sqlite-core';
|
|
14
|
+
import 'drizzle-orm/relations';
|
|
16
15
|
import 'drizzle-zod';
|
|
17
16
|
|
|
18
17
|
const upsertAccountCommand = (db, { account }) => {
|
|
@@ -335,17 +334,27 @@ const getPaymentRequestsQuery = async (db, params) => {
|
|
|
335
334
|
return { paymentRequests, totalCount };
|
|
336
335
|
};
|
|
337
336
|
|
|
338
|
-
const
|
|
339
|
-
"
|
|
340
|
-
"
|
|
341
|
-
"
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
337
|
+
const SIGNAL_MAP = {
|
|
338
|
+
OPENED: "paymentRequestOpened",
|
|
339
|
+
AUTHORIZED: "paymentRequestAuthorized",
|
|
340
|
+
COMPLETED: "paymentRequestCompleted",
|
|
341
|
+
BOOKED: "paymentRequestBooked",
|
|
342
|
+
SETTLED: "paymentRequestSettled",
|
|
343
|
+
REJECTED: "paymentRequestRejected",
|
|
344
|
+
CLOSED: "paymentRequestClosed"
|
|
345
|
+
};
|
|
346
|
+
function buildPaymentRequestEvent(pr) {
|
|
347
|
+
return {
|
|
348
|
+
eventType: "BANK_PAYMENT_REQUEST",
|
|
349
|
+
eventSignal: SIGNAL_MAP[pr.status],
|
|
350
|
+
paymentRequest: pr,
|
|
351
|
+
metadata: {
|
|
352
|
+
correlationId: pr.correlationId,
|
|
353
|
+
entityId: pr.id,
|
|
354
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
}
|
|
349
358
|
|
|
350
359
|
const sendPaymentInputSchema = z.object({
|
|
351
360
|
correlationId: z.string().min(1),
|
|
@@ -761,28 +770,12 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
761
770
|
await updatePaymentRequestStatusCommand(this.db, {
|
|
762
771
|
id: pr.id,
|
|
763
772
|
status: newStatus,
|
|
764
|
-
processedAt: newStatus
|
|
773
|
+
processedAt: isProcessedStatus(newStatus) ? /* @__PURE__ */ new Date() : void 0
|
|
765
774
|
}).command.execute();
|
|
766
775
|
statusChanged++;
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
COMPLETED: "paymentRequestCompleted",
|
|
771
|
-
BOOKED: "paymentRequestBooked",
|
|
772
|
-
SETTLED: "paymentRequestSettled",
|
|
773
|
-
REJECTED: "paymentRequestRejected",
|
|
774
|
-
CLOSED: "paymentRequestClosed"
|
|
775
|
-
};
|
|
776
|
-
eventsToEmit.push({
|
|
777
|
-
eventType: "BANK_PAYMENT_REQUEST",
|
|
778
|
-
eventSignal: signalMap[newStatus],
|
|
779
|
-
paymentRequest: { ...pr, status: newStatus },
|
|
780
|
-
metadata: {
|
|
781
|
-
correlationId: pr.correlationId,
|
|
782
|
-
entityId: pr.id,
|
|
783
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
784
|
-
}
|
|
785
|
-
});
|
|
776
|
+
eventsToEmit.push(
|
|
777
|
+
buildPaymentRequestEvent({ ...pr, status: newStatus })
|
|
778
|
+
);
|
|
786
779
|
}
|
|
787
780
|
processed++;
|
|
788
781
|
} catch (err) {
|
|
@@ -819,25 +812,10 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
819
812
|
if (!batch || batch.status === "COMPLETED" || batch.status === "FAILED")
|
|
820
813
|
return;
|
|
821
814
|
if (allPRs.length === 0) return;
|
|
822
|
-
const terminalStatuses = [
|
|
823
|
-
"SETTLED",
|
|
824
|
-
"REJECTED",
|
|
825
|
-
"CLOSED"
|
|
826
|
-
];
|
|
827
|
-
const authorizedOrHigher = [
|
|
828
|
-
"AUTHORIZED",
|
|
829
|
-
"COMPLETED",
|
|
830
|
-
"BOOKED",
|
|
831
|
-
"SETTLED"
|
|
832
|
-
];
|
|
833
815
|
const allTerminal = allPRs.every(
|
|
834
|
-
(pr) =>
|
|
835
|
-
);
|
|
836
|
-
const allAuthorizedOrHigher = allPRs.every(
|
|
837
|
-
(pr) => [...authorizedOrHigher, ...terminalStatuses].includes(
|
|
838
|
-
pr.status
|
|
839
|
-
)
|
|
816
|
+
(pr) => isTerminalStatus(pr.status)
|
|
840
817
|
);
|
|
818
|
+
const allAuthorizedOrHigher = allPRs.every((pr) => pr.status !== "OPENED");
|
|
841
819
|
if (allTerminal) {
|
|
842
820
|
const hasFailed = allPRs.some(
|
|
843
821
|
(pr) => pr.status === "REJECTED" || pr.status === "CLOSED"
|
|
@@ -1297,9 +1275,11 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
1297
1275
|
}
|
|
1298
1276
|
await updatePaymentRequestStatusCommand(this.db, {
|
|
1299
1277
|
id: incomingPayment.id,
|
|
1278
|
+
status: initiated.payment.status,
|
|
1300
1279
|
bankRefId: initiated.payment.bankRefId,
|
|
1301
1280
|
initiatedAt: initiated.payment.initiatedAt,
|
|
1302
|
-
authorizationUrl: initiated.authorizationUrl
|
|
1281
|
+
authorizationUrl: initiated.authorizationUrl,
|
|
1282
|
+
processedAt: isProcessedStatus(initiated.payment.status) ? /* @__PURE__ */ new Date() : void 0
|
|
1303
1283
|
}).command.execute();
|
|
1304
1284
|
const paymentRequest = await getPaymentRequestByIdQuery(this.db, {
|
|
1305
1285
|
paymentRequestId: incomingPayment.id
|
|
@@ -1311,6 +1291,12 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
1311
1291
|
status: 500
|
|
1312
1292
|
});
|
|
1313
1293
|
}
|
|
1294
|
+
if (initiated.payment.status !== "OPENED") {
|
|
1295
|
+
await this.pushToQueue(
|
|
1296
|
+
this.env.QUEUE_BUS_QUEUE,
|
|
1297
|
+
buildPaymentRequestEvent(paymentRequest)
|
|
1298
|
+
);
|
|
1299
|
+
}
|
|
1314
1300
|
return {
|
|
1315
1301
|
paymentRequest,
|
|
1316
1302
|
authorizationUrl: initiated.authorizationUrl
|
|
@@ -1462,9 +1448,11 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
1462
1448
|
const updatePrCmds = preparedPayments.map(
|
|
1463
1449
|
(pp, i) => updatePaymentRequestStatusCommand(this.db, {
|
|
1464
1450
|
id: pp.id,
|
|
1451
|
+
status: pp.status,
|
|
1465
1452
|
bankRefId: pp.bankRefId,
|
|
1466
1453
|
initiatedAt: pp.initiatedAt,
|
|
1467
|
-
authorizationUrl: isPerPaymentFallback ? authorizationUrls[i] : authorizationUrls[0]
|
|
1454
|
+
authorizationUrl: isPerPaymentFallback ? authorizationUrls[i] : authorizationUrls[0],
|
|
1455
|
+
processedAt: isProcessedStatus(pp.status) ? /* @__PURE__ */ new Date() : void 0
|
|
1468
1456
|
}).command
|
|
1469
1457
|
);
|
|
1470
1458
|
const updateBatchCmd = upsertBatchCommand(this.db, {
|
|
@@ -1479,7 +1467,25 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
1479
1467
|
}
|
|
1480
1468
|
}).command;
|
|
1481
1469
|
await this.db.batch([updateBatchCmd, ...updatePrCmds]);
|
|
1482
|
-
|
|
1470
|
+
const [updatedBatch, paymentRequests] = await Promise.all([
|
|
1471
|
+
getBatchByIdQuery(this.db, { batchId }),
|
|
1472
|
+
getPaymentRequestsByBatchIdQuery(this.db, { batchId })
|
|
1473
|
+
]);
|
|
1474
|
+
if (!updatedBatch) {
|
|
1475
|
+
throw createInternalError(null, {
|
|
1476
|
+
message: `Batch ${batchId} not found after creation`,
|
|
1477
|
+
code: "DB-B-010",
|
|
1478
|
+
status: 500
|
|
1479
|
+
});
|
|
1480
|
+
}
|
|
1481
|
+
const prEvents = paymentRequests.filter((pr) => pr.status !== "OPENED").map((pr) => buildPaymentRequestEvent(pr));
|
|
1482
|
+
if (prEvents.length > 0) {
|
|
1483
|
+
await this.pushToQueue(
|
|
1484
|
+
this.env.QUEUE_BUS_QUEUE,
|
|
1485
|
+
prEvents
|
|
1486
|
+
);
|
|
1487
|
+
}
|
|
1488
|
+
return { ...updatedBatch, paymentRequests };
|
|
1483
1489
|
}
|
|
1484
1490
|
);
|
|
1485
1491
|
}
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
|
-
const
|
|
5
|
-
const batchLifecycle = require('../shared/bank.
|
|
6
|
-
const mock_connector = require('../shared/bank.
|
|
4
|
+
const database_schema = require('../shared/bank.o95cOH_P.cjs');
|
|
5
|
+
const batchLifecycle = require('../shared/bank.NF8bZBy0.cjs');
|
|
6
|
+
const mock_connector = require('../shared/bank.DWsHTK_n.cjs');
|
|
7
7
|
const drizzleOrm = require('drizzle-orm');
|
|
8
|
+
const credentialsResolver = require('../shared/bank.vGCuP898.cjs');
|
|
8
9
|
const cloudflare_workers = require('cloudflare:workers');
|
|
9
10
|
const cloudflare_workflows = require('cloudflare:workflows');
|
|
10
11
|
const d1 = require('drizzle-orm/d1');
|
|
11
12
|
require('node:crypto');
|
|
12
|
-
require('../shared/bank.BBXoZ5QU.cjs');
|
|
13
|
-
require('drizzle-orm/relations');
|
|
14
13
|
require('drizzle-orm/sqlite-core');
|
|
15
14
|
require('date-fns');
|
|
16
15
|
require('jose');
|
|
17
16
|
require('@develit-io/general-codes');
|
|
17
|
+
require('drizzle-orm/relations');
|
|
18
18
|
require('drizzle-zod');
|
|
19
|
-
require('../shared/bank.CVi6R7fr.cjs');
|
|
20
19
|
|
|
21
20
|
const updateAccountLastSyncCommand = (db, {
|
|
22
21
|
lastSyncAt,
|
|
23
22
|
accountId,
|
|
24
23
|
lastSyncMetadata
|
|
25
24
|
}) => {
|
|
26
|
-
const command = db.update(
|
|
25
|
+
const command = db.update(database_schema.tables.account).set({
|
|
27
26
|
lastSyncAt,
|
|
28
27
|
lastSyncMetadata
|
|
29
|
-
}).where(drizzleOrm.eq(
|
|
28
|
+
}).where(drizzleOrm.eq(database_schema.tables.account.id, accountId)).returning();
|
|
30
29
|
return {
|
|
31
30
|
command
|
|
32
31
|
};
|
|
@@ -43,14 +42,14 @@ function pushToQueue$1(queue, message) {
|
|
|
43
42
|
}
|
|
44
43
|
async function failBatchAndPayments(db, batch, paymentRequests, reason) {
|
|
45
44
|
const prCmds = paymentRequests.filter((p) => p.status !== "REJECTED").map(
|
|
46
|
-
(p) =>
|
|
45
|
+
(p) => credentialsResolver.updatePaymentRequestStatusCommand(db, {
|
|
47
46
|
id: p.id,
|
|
48
47
|
status: "REJECTED",
|
|
49
48
|
statusReason: reason,
|
|
50
49
|
processedAt: /* @__PURE__ */ new Date()
|
|
51
50
|
}).command
|
|
52
51
|
);
|
|
53
|
-
const batchCmd =
|
|
52
|
+
const batchCmd = credentialsResolver.upsertBatchCommand(db, {
|
|
54
53
|
batch: { ...batch, status: "FAILED" }
|
|
55
54
|
}).command;
|
|
56
55
|
const allCmds = [batchCmd, ...prCmds];
|
|
@@ -61,9 +60,9 @@ async function failBatchAndPayments(db, batch, paymentRequests, reason) {
|
|
|
61
60
|
class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
62
61
|
async run(event, step) {
|
|
63
62
|
const { batchId } = event.payload;
|
|
64
|
-
const db = d1.drizzle(this.env.BANK_D1, { schema:
|
|
63
|
+
const db = d1.drizzle(this.env.BANK_D1, { schema: database_schema.tables });
|
|
65
64
|
const batch = await step.do("load batch", async () => {
|
|
66
|
-
const batch2 = await
|
|
65
|
+
const batch2 = await credentialsResolver.getBatchByIdQuery(db, { batchId });
|
|
67
66
|
if (!batch2) {
|
|
68
67
|
throw new cloudflare_workflows.NonRetryableError(`Batch not found`);
|
|
69
68
|
}
|
|
@@ -72,13 +71,13 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
72
71
|
return batch2;
|
|
73
72
|
});
|
|
74
73
|
const paymentRequests = await step.do("load payment requests", async () => {
|
|
75
|
-
return await
|
|
74
|
+
return await credentialsResolver.getPaymentRequestsByBatchIdQuery(db, { batchId });
|
|
76
75
|
});
|
|
77
76
|
if (paymentRequests.length === 0) {
|
|
78
77
|
throw new cloudflare_workflows.NonRetryableError("No payments found for batch");
|
|
79
78
|
}
|
|
80
79
|
await step.do("lock batch", async () => {
|
|
81
|
-
const paymentsChecksum =
|
|
80
|
+
const paymentsChecksum = credentialsResolver.checksum(paymentRequests);
|
|
82
81
|
if (batch.paymentsChecksum && batch.paymentsChecksum !== paymentsChecksum)
|
|
83
82
|
throw new cloudflare_workflows.NonRetryableError(
|
|
84
83
|
`Batch payments have been modified externally, manual review needed`
|
|
@@ -88,7 +87,7 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
88
87
|
`Batch is in FAILED status and cannot be processed, manual review needed`
|
|
89
88
|
);
|
|
90
89
|
if (batchLifecycle.isBatchProcessing(batch)) {
|
|
91
|
-
const updatedBatch = await
|
|
90
|
+
const updatedBatch = await credentialsResolver.upsertBatchCommand(db, {
|
|
92
91
|
batch: {
|
|
93
92
|
...batch,
|
|
94
93
|
status: "PROCESSING",
|
|
@@ -109,7 +108,7 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
109
108
|
const batchedPayments = paymentRequests.map(
|
|
110
109
|
mock_connector.toBatchedPaymentFromPaymentRequest
|
|
111
110
|
);
|
|
112
|
-
const currentBatch = await
|
|
111
|
+
const currentBatch = await credentialsResolver.getBatchByIdQuery(db, { batchId });
|
|
113
112
|
if (currentBatch?.batchPaymentInitiatedAt) {
|
|
114
113
|
return {
|
|
115
114
|
authorizationUrls: currentBatch.authorizationUrls,
|
|
@@ -123,7 +122,7 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
123
122
|
metadata: currentBatch.metadata
|
|
124
123
|
};
|
|
125
124
|
}
|
|
126
|
-
const account = await
|
|
125
|
+
const account = await credentialsResolver.getAccountByIdQuery(db, {
|
|
127
126
|
accountId: batch.accountId
|
|
128
127
|
});
|
|
129
128
|
if (!account) {
|
|
@@ -131,7 +130,7 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
131
130
|
await failBatchAndPayments(db, batch, paymentRequests, msg);
|
|
132
131
|
throw new cloudflare_workflows.NonRetryableError(msg);
|
|
133
132
|
}
|
|
134
|
-
const resolveCredentials = await
|
|
133
|
+
const resolveCredentials = await credentialsResolver.createCredentialsResolver(db, this.env);
|
|
135
134
|
const connector = await mock_connector.initiateConnector({
|
|
136
135
|
env: this.env,
|
|
137
136
|
bank: account.connectorKey,
|
|
@@ -188,7 +187,7 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
188
187
|
const { preparedPayments, authorizationUrls } = batchResult;
|
|
189
188
|
const isPaymentRequestFallback = authorizationUrls.length === preparedPayments.length;
|
|
190
189
|
const updateCommands = preparedPayments.map(
|
|
191
|
-
(pp, i) =>
|
|
190
|
+
(pp, i) => credentialsResolver.updatePaymentRequestStatusCommand(db, {
|
|
192
191
|
id: pp.id,
|
|
193
192
|
status: "OPENED",
|
|
194
193
|
bankRefId: pp.bankRefId,
|
|
@@ -202,7 +201,7 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
202
201
|
return { updated: updateCommands.length };
|
|
203
202
|
});
|
|
204
203
|
await step.do("update batch to ready to sign", async () => {
|
|
205
|
-
const upsertBatch =
|
|
204
|
+
const upsertBatch = credentialsResolver.upsertBatchCommand(db, {
|
|
206
205
|
batch: {
|
|
207
206
|
...batch,
|
|
208
207
|
authorizationUrls: batchResult.authorizationUrls,
|
|
@@ -224,14 +223,14 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
224
223
|
await step.do("mock: complete payments and update batch", async () => {
|
|
225
224
|
const processedAt = /* @__PURE__ */ new Date();
|
|
226
225
|
const updateCommands = batchResult.preparedPayments.map(
|
|
227
|
-
(p) =>
|
|
226
|
+
(p) => credentialsResolver.updatePaymentRequestStatusCommand(db, {
|
|
228
227
|
id: p.id,
|
|
229
228
|
status: "SETTLED",
|
|
230
229
|
bankRefId: `MOCK-${backendSdk.uuidv4()}`,
|
|
231
230
|
processedAt
|
|
232
231
|
}).command
|
|
233
232
|
);
|
|
234
|
-
const updateBatchCommand =
|
|
233
|
+
const updateBatchCommand = credentialsResolver.upsertBatchCommand(db, {
|
|
235
234
|
batch: {
|
|
236
235
|
...batch,
|
|
237
236
|
status: "COMPLETED",
|
|
@@ -296,14 +295,14 @@ function pushToQueue(queue, message) {
|
|
|
296
295
|
class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
297
296
|
async run(event, step) {
|
|
298
297
|
const { accountId } = event.payload;
|
|
299
|
-
const db = d1.drizzle(this.env.BANK_D1, { schema:
|
|
298
|
+
const db = d1.drizzle(this.env.BANK_D1, { schema: database_schema.tables });
|
|
300
299
|
if (!accountId) {
|
|
301
300
|
throw new cloudflare_workflows.NonRetryableError(`Haven't obtained accountId to load.`);
|
|
302
301
|
}
|
|
303
302
|
while (true) {
|
|
304
303
|
const now = /* @__PURE__ */ new Date();
|
|
305
304
|
const account = await step.do("load account", async () => {
|
|
306
|
-
const account2 = await
|
|
305
|
+
const account2 = await credentialsResolver.getAccountByIdQuery(db, { accountId });
|
|
307
306
|
if (!account2) {
|
|
308
307
|
throw new cloudflare_workflows.NonRetryableError(`Bank account not found: ${accountId}`);
|
|
309
308
|
}
|
|
@@ -320,7 +319,7 @@ class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
320
319
|
},
|
|
321
320
|
async () => {
|
|
322
321
|
try {
|
|
323
|
-
const resolveCredentials = await
|
|
322
|
+
const resolveCredentials = await credentialsResolver.createCredentialsResolver(
|
|
324
323
|
db,
|
|
325
324
|
this.env
|
|
326
325
|
);
|
|
@@ -346,7 +345,7 @@ class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
346
345
|
}
|
|
347
346
|
);
|
|
348
347
|
const paymentsToProcess = payments.filter(
|
|
349
|
-
(p) =>
|
|
348
|
+
(p) => database_schema.isPaymentCompleted(p.parsed)
|
|
350
349
|
);
|
|
351
350
|
if (paymentsToProcess.length) {
|
|
352
351
|
const lastSyncBankRefIds = account.lastSyncMetadata?.lastSyncBankRefIds || [];
|
|
@@ -358,12 +357,12 @@ class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
358
357
|
async () => {
|
|
359
358
|
const eventsToEmit = [];
|
|
360
359
|
const bankRefIds = paymentsToInsert.map((p) => p.parsed.bankRefId).filter((id) => id != null);
|
|
361
|
-
const matchingRequests = bankRefIds.length > 0 ? await db.select().from(
|
|
360
|
+
const matchingRequests = bankRefIds.length > 0 ? await db.select().from(database_schema.tables.paymentRequest).where(
|
|
362
361
|
drizzleOrm.and(
|
|
363
|
-
drizzleOrm.inArray(
|
|
364
|
-
drizzleOrm.eq(
|
|
362
|
+
drizzleOrm.inArray(database_schema.tables.paymentRequest.bankRefId, bankRefIds),
|
|
363
|
+
drizzleOrm.eq(database_schema.tables.paymentRequest.accountId, account.id),
|
|
365
364
|
drizzleOrm.eq(
|
|
366
|
-
|
|
365
|
+
database_schema.tables.paymentRequest.connectorKey,
|
|
367
366
|
account.connectorKey
|
|
368
367
|
)
|
|
369
368
|
)
|
|
@@ -398,16 +397,7 @@ class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
398
397
|
};
|
|
399
398
|
});
|
|
400
399
|
const createCommands = enrichedPayments.map(
|
|
401
|
-
(p) =>
|
|
402
|
-
);
|
|
403
|
-
const prCompleteCommands = matchingRequests.filter(
|
|
404
|
-
(req) => req.status !== "SETTLED" && req.status !== "REJECTED"
|
|
405
|
-
).map(
|
|
406
|
-
(req) => drizzle.updatePaymentRequestStatusCommand(db, {
|
|
407
|
-
id: req.id,
|
|
408
|
-
status: "SETTLED",
|
|
409
|
-
processedAt: /* @__PURE__ */ new Date()
|
|
410
|
-
}).command
|
|
400
|
+
(p) => credentialsResolver.createPaymentCommand(db, { payment: p.parsed }).command
|
|
411
401
|
);
|
|
412
402
|
eventsToEmit.push(
|
|
413
403
|
...enrichedPayments.map((p) => ({
|
|
@@ -436,11 +426,7 @@ class BankSyncAccountPayments extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
436
426
|
}).command;
|
|
437
427
|
if (eventsToEmit.length) {
|
|
438
428
|
await db.batch(
|
|
439
|
-
backendSdk.asNonEmpty([
|
|
440
|
-
updateLastSyncCommand,
|
|
441
|
-
...createCommands,
|
|
442
|
-
...prCompleteCommands
|
|
443
|
-
])
|
|
429
|
+
backendSdk.asNonEmpty([updateLastSyncCommand, ...createCommands])
|
|
444
430
|
);
|
|
445
431
|
await pushToQueue(
|
|
446
432
|
this.env.QUEUE_BUS_QUEUE,
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { first, uuidv4, asNonEmpty } from '@develit-io/backend-sdk';
|
|
2
|
-
import {
|
|
3
|
-
import { i as isBatchAuthorized, b as isBatchFailed, d as isBatchProcessing
|
|
4
|
-
import { e as toBatchedPaymentFromPaymentRequest, i as toPreparedPayment, j as initiateConnector } from '../shared/bank.
|
|
2
|
+
import { v as tables, o as isPaymentCompleted } from '../shared/bank.ESTBT4J6.mjs';
|
|
3
|
+
import { i as isBatchAuthorized, b as isBatchFailed, d as isBatchProcessing } from '../shared/bank.XqSw509X.mjs';
|
|
4
|
+
import { e as toBatchedPaymentFromPaymentRequest, i as toPreparedPayment, j as initiateConnector } from '../shared/bank.Cwg6oHMM.mjs';
|
|
5
5
|
import { eq, and, inArray } from 'drizzle-orm';
|
|
6
|
+
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.CPLR0Ul7.mjs';
|
|
6
7
|
import { WorkflowEntrypoint } from 'cloudflare:workers';
|
|
7
8
|
import { NonRetryableError } from 'cloudflare:workflows';
|
|
8
9
|
import { drizzle } from 'drizzle-orm/d1';
|
|
9
10
|
import 'node:crypto';
|
|
10
|
-
import '../shared/bank.CXBeULUL.mjs';
|
|
11
|
-
import 'drizzle-orm/relations';
|
|
12
11
|
import 'drizzle-orm/sqlite-core';
|
|
13
12
|
import 'date-fns';
|
|
14
13
|
import 'jose';
|
|
15
14
|
import '@develit-io/general-codes';
|
|
15
|
+
import 'drizzle-orm/relations';
|
|
16
16
|
import 'drizzle-zod';
|
|
17
|
-
import '../shared/bank.CR0UlyRi.mjs';
|
|
18
17
|
|
|
19
18
|
const updateAccountLastSyncCommand = (db, {
|
|
20
19
|
lastSyncAt,
|
|
@@ -398,15 +397,6 @@ class BankSyncAccountPayments extends WorkflowEntrypoint {
|
|
|
398
397
|
const createCommands = enrichedPayments.map(
|
|
399
398
|
(p) => createPaymentCommand(db, { payment: p.parsed }).command
|
|
400
399
|
);
|
|
401
|
-
const prCompleteCommands = matchingRequests.filter(
|
|
402
|
-
(req) => req.status !== "SETTLED" && req.status !== "REJECTED"
|
|
403
|
-
).map(
|
|
404
|
-
(req) => updatePaymentRequestStatusCommand(db, {
|
|
405
|
-
id: req.id,
|
|
406
|
-
status: "SETTLED",
|
|
407
|
-
processedAt: /* @__PURE__ */ new Date()
|
|
408
|
-
}).command
|
|
409
|
-
);
|
|
410
400
|
eventsToEmit.push(
|
|
411
401
|
...enrichedPayments.map((p) => ({
|
|
412
402
|
eventType: "BANK_PAYMENT",
|
|
@@ -434,11 +424,7 @@ class BankSyncAccountPayments extends WorkflowEntrypoint {
|
|
|
434
424
|
}).command;
|
|
435
425
|
if (eventsToEmit.length) {
|
|
436
426
|
await db.batch(
|
|
437
|
-
asNonEmpty([
|
|
438
|
-
updateLastSyncCommand,
|
|
439
|
-
...createCommands,
|
|
440
|
-
...prCompleteCommands
|
|
441
|
-
])
|
|
427
|
+
asNonEmpty([updateLastSyncCommand, ...createCommands])
|
|
442
428
|
);
|
|
443
429
|
await pushToQueue(
|
|
444
430
|
this.env.QUEUE_BUS_QUEUE,
|
|
@@ -5147,6 +5147,9 @@ declare const tables: typeof schema;
|
|
|
5147
5147
|
* 5. CompletedPayment - Fully processed (status: COMPLETED/BOOKED/SETTLED/REJECTED/CLOSED, has bankRefId)
|
|
5148
5148
|
*/
|
|
5149
5149
|
|
|
5150
|
+
declare function isTerminalStatus(status: PaymentRequestStatus): boolean;
|
|
5151
|
+
declare function isPendingStatus(status: PaymentRequestStatus): boolean;
|
|
5152
|
+
declare function isProcessedStatus(status: PaymentRequestStatus): boolean;
|
|
5150
5153
|
/**
|
|
5151
5154
|
* Stage 1: Incoming Payment
|
|
5152
5155
|
*/
|
|
@@ -5176,7 +5179,7 @@ type BatchedPayment = Omit<PaymentRequestInsertType, 'bankRefId' | 'status'> & {
|
|
|
5176
5179
|
* Stage 4: Prepared Payment
|
|
5177
5180
|
*/
|
|
5178
5181
|
type PreparedPayment = Omit<PaymentRequestInsertType, 'status' | 'bankRefId'> & {
|
|
5179
|
-
status:
|
|
5182
|
+
status: PaymentRequestStatus;
|
|
5180
5183
|
bankRefId?: string;
|
|
5181
5184
|
};
|
|
5182
5185
|
/**
|
|
@@ -5294,5 +5297,5 @@ declare function isBatchFailed(batch: {
|
|
|
5294
5297
|
status?: string | null;
|
|
5295
5298
|
}): batch is CompletedBatch;
|
|
5296
5299
|
|
|
5297
|
-
export { IBankConnector as I, BATCH_MODES as K, BATCH_STATUSES as M, CHARGE_BEARERS as V, CONNECTOR_KEYS as W, COUNTRY_CODES as X, CREDENTIALS_TYPES as Y, INSTRUCTION_PRIORITIES as a1, PAYMENT_DIRECTIONS as a3, PAYMENT_REQUEST_STATUSES as a4, PAYMENT_STATUSES as a5, PAYMENT_TYPES as a6,
|
|
5298
|
-
export type { CountryCode as $, AccountSelectType as A, BatchSelectType as B, ConfigEnvironmentBank as C, AccountCredentialsUpdateType as D, AccountPatchType as E, AccountStatus as F, AccountUpdateType as G, HandleAuthorizationCallbackInput as H, AuthorizedBatch as J, LastSyncMetadata as L, BankAccountWithLastSync as N, BankCode as O,
|
|
5300
|
+
export { IBankConnector as I, BATCH_MODES as K, BATCH_STATUSES as M, CHARGE_BEARERS as V, CONNECTOR_KEYS as W, COUNTRY_CODES as X, CREDENTIALS_TYPES as Y, INSTRUCTION_PRIORITIES as a1, PAYMENT_DIRECTIONS as a3, PAYMENT_REQUEST_STATUSES as a4, PAYMENT_STATUSES as a5, PAYMENT_TYPES as a6, accountCredentials as aA, batch as aB, ott as aC, payment as aD, paymentRelations as aE, paymentRequest as aF, paymentRequestRelations as aG, TOKEN_TYPES as ag, accountCredentialsInsertSchema as ai, accountCredentialsSelectSchema as aj, accountCredentialsUpdateSchema as ak, accountInsertSchema as al, accountSelectSchema as am, accountUpdateSchema as an, hasPaymentAccountAssigned as ao, isBatchAuthorized as ap, isBatchCompleted as aq, isBatchFailed as ar, isBatchInitiated as as, isBatchProcessing as at, isBatchReadyToSign as au, isPaymentCompleted as av, isPendingStatus as aw, isProcessedStatus as ax, isTerminalStatus as ay, account as az, tables as t, ACCOUNT_STATUSES as x };
|
|
5301
|
+
export type { CountryCode as $, AccountSelectType as A, BatchSelectType as B, ConfigEnvironmentBank as C, AccountCredentialsUpdateType as D, AccountPatchType as E, AccountStatus as F, AccountUpdateType as G, HandleAuthorizationCallbackInput as H, AuthorizedBatch as J, LastSyncMetadata as L, BankAccountWithLastSync as N, BankCode as O, PaymentRequestSelectType as P, BatchInsertType as Q, BatchLifecycle as R, BatchMode as S, BatchPayment as T, BatchStatus as U, ChargeBearer as Z, CompletedBatch as _, PaymentSelectType as a, CredentialsType as a0, InstructionPriority as a2, PaymentDirection as a7, PaymentFailedInsertType as a8, PaymentInsertType as a9, PaymentLifecycle as aa, PaymentPreparedInsertType as ab, PaymentStatus as ac, ProcessingBatch as ad, ReadyToSignBatch as ae, ResolvedCredentials as af, TokenType as ah, ConnectorKey as b, PaymentType as c, CurrencyCode as d, HandleAuthorizationCallbackOutput as e, ConnectedAccount as f, CredentialsResolver as g, AccountCredentialsInsertType as h, AccountInsertType as i, BatchedPayment as j, InitiatedBatch as k, IncomingPayment as l, InitiatedPayment as m, ParsedBankPayment as n, PaymentRequestStatus as o, AuthorizationCallbackResult as p, BatchMetadata as q, Currency as r, AccountAssignedPayment as s, PreparedPayment as u, CompletedPayment as v, PaymentRequestInsertType as w, AccountCredentialsPatchType as y, AccountCredentialsSelectType as z };
|
|
@@ -5147,6 +5147,9 @@ declare const tables: typeof schema;
|
|
|
5147
5147
|
* 5. CompletedPayment - Fully processed (status: COMPLETED/BOOKED/SETTLED/REJECTED/CLOSED, has bankRefId)
|
|
5148
5148
|
*/
|
|
5149
5149
|
|
|
5150
|
+
declare function isTerminalStatus(status: PaymentRequestStatus): boolean;
|
|
5151
|
+
declare function isPendingStatus(status: PaymentRequestStatus): boolean;
|
|
5152
|
+
declare function isProcessedStatus(status: PaymentRequestStatus): boolean;
|
|
5150
5153
|
/**
|
|
5151
5154
|
* Stage 1: Incoming Payment
|
|
5152
5155
|
*/
|
|
@@ -5176,7 +5179,7 @@ type BatchedPayment = Omit<PaymentRequestInsertType, 'bankRefId' | 'status'> & {
|
|
|
5176
5179
|
* Stage 4: Prepared Payment
|
|
5177
5180
|
*/
|
|
5178
5181
|
type PreparedPayment = Omit<PaymentRequestInsertType, 'status' | 'bankRefId'> & {
|
|
5179
|
-
status:
|
|
5182
|
+
status: PaymentRequestStatus;
|
|
5180
5183
|
bankRefId?: string;
|
|
5181
5184
|
};
|
|
5182
5185
|
/**
|
|
@@ -5294,5 +5297,5 @@ declare function isBatchFailed(batch: {
|
|
|
5294
5297
|
status?: string | null;
|
|
5295
5298
|
}): batch is CompletedBatch;
|
|
5296
5299
|
|
|
5297
|
-
export { IBankConnector as I, BATCH_MODES as K, BATCH_STATUSES as M, CHARGE_BEARERS as V, CONNECTOR_KEYS as W, COUNTRY_CODES as X, CREDENTIALS_TYPES as Y, INSTRUCTION_PRIORITIES as a1, PAYMENT_DIRECTIONS as a3, PAYMENT_REQUEST_STATUSES as a4, PAYMENT_STATUSES as a5, PAYMENT_TYPES as a6,
|
|
5298
|
-
export type { CountryCode as $, AccountSelectType as A, BatchSelectType as B, ConfigEnvironmentBank as C, AccountCredentialsUpdateType as D, AccountPatchType as E, AccountStatus as F, AccountUpdateType as G, HandleAuthorizationCallbackInput as H, AuthorizedBatch as J, LastSyncMetadata as L, BankAccountWithLastSync as N, BankCode as O,
|
|
5300
|
+
export { IBankConnector as I, BATCH_MODES as K, BATCH_STATUSES as M, CHARGE_BEARERS as V, CONNECTOR_KEYS as W, COUNTRY_CODES as X, CREDENTIALS_TYPES as Y, INSTRUCTION_PRIORITIES as a1, PAYMENT_DIRECTIONS as a3, PAYMENT_REQUEST_STATUSES as a4, PAYMENT_STATUSES as a5, PAYMENT_TYPES as a6, accountCredentials as aA, batch as aB, ott as aC, payment as aD, paymentRelations as aE, paymentRequest as aF, paymentRequestRelations as aG, TOKEN_TYPES as ag, accountCredentialsInsertSchema as ai, accountCredentialsSelectSchema as aj, accountCredentialsUpdateSchema as ak, accountInsertSchema as al, accountSelectSchema as am, accountUpdateSchema as an, hasPaymentAccountAssigned as ao, isBatchAuthorized as ap, isBatchCompleted as aq, isBatchFailed as ar, isBatchInitiated as as, isBatchProcessing as at, isBatchReadyToSign as au, isPaymentCompleted as av, isPendingStatus as aw, isProcessedStatus as ax, isTerminalStatus as ay, account as az, tables as t, ACCOUNT_STATUSES as x };
|
|
5301
|
+
export type { CountryCode as $, AccountSelectType as A, BatchSelectType as B, ConfigEnvironmentBank as C, AccountCredentialsUpdateType as D, AccountPatchType as E, AccountStatus as F, AccountUpdateType as G, HandleAuthorizationCallbackInput as H, AuthorizedBatch as J, LastSyncMetadata as L, BankAccountWithLastSync as N, BankCode as O, PaymentRequestSelectType as P, BatchInsertType as Q, BatchLifecycle as R, BatchMode as S, BatchPayment as T, BatchStatus as U, ChargeBearer as Z, CompletedBatch as _, PaymentSelectType as a, CredentialsType as a0, InstructionPriority as a2, PaymentDirection as a7, PaymentFailedInsertType as a8, PaymentInsertType as a9, PaymentLifecycle as aa, PaymentPreparedInsertType as ab, PaymentStatus as ac, ProcessingBatch as ad, ReadyToSignBatch as ae, ResolvedCredentials as af, TokenType as ah, ConnectorKey as b, PaymentType as c, CurrencyCode as d, HandleAuthorizationCallbackOutput as e, ConnectedAccount as f, CredentialsResolver as g, AccountCredentialsInsertType as h, AccountInsertType as i, BatchedPayment as j, InitiatedBatch as k, IncomingPayment as l, InitiatedPayment as m, ParsedBankPayment as n, PaymentRequestStatus as o, AuthorizationCallbackResult as p, BatchMetadata as q, Currency as r, AccountAssignedPayment as s, PreparedPayment as u, CompletedPayment as v, PaymentRequestInsertType as w, AccountCredentialsPatchType as y, AccountCredentialsSelectType as z };
|