@develit-services/bank 5.6.1 → 5.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.cjs +137 -5
- package/dist/base.d.cts +21 -10
- package/dist/base.d.mts +21 -10
- package/dist/base.d.ts +21 -10
- package/dist/base.mjs +137 -5
- package/dist/database/schema.d.cts +1 -1
- package/dist/database/schema.d.mts +1 -1
- package/dist/database/schema.d.ts +1 -1
- package/dist/export/workflows.cjs +2 -2
- package/dist/export/workflows.mjs +2 -2
- package/dist/shared/{bank.B-7lJ4uA.cjs → bank.B0DNtuUM.cjs} +15 -1
- package/dist/shared/{bank.CGVCfq1B.d.mts → bank.BQwwtIR4.d.cts} +4 -4
- package/dist/shared/{bank.CGVCfq1B.d.ts → bank.BQwwtIR4.d.mts} +4 -4
- package/dist/shared/{bank.CGVCfq1B.d.cts → bank.BQwwtIR4.d.ts} +4 -4
- package/dist/shared/{bank.BqTBTu_N.d.cts → bank.BUzoc8p6.d.cts} +1 -1
- package/dist/shared/{bank.BZkc4e0m.mjs → bank.BVXtqHnq.mjs} +58 -11
- package/dist/shared/{bank.CYJ75FSr.d.ts → bank.CBpXmaTL.d.ts} +1 -1
- package/dist/shared/{bank.CYnp7V23.cjs → bank.CQjuudum.cjs} +58 -11
- package/dist/shared/{bank.toAgXBfS.mjs → bank.DLU1sOBm.mjs} +15 -1
- package/dist/shared/{bank.SSqNFzWn.d.mts → bank.DZ3Ow4bP.d.mts} +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.cts +13 -6
- package/dist/types.d.mts +13 -6
- package/dist/types.d.ts +13 -6
- package/dist/types.mjs +1 -1
- package/package.json +1 -1
package/dist/base.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
|
-
const paymentDirection = require('./shared/bank.
|
|
4
|
+
const paymentDirection = require('./shared/bank.CQjuudum.cjs');
|
|
5
5
|
const drizzleOrm = require('drizzle-orm');
|
|
6
6
|
const cloudflare_workers = require('cloudflare:workers');
|
|
7
7
|
const d1 = require('drizzle-orm/d1');
|
|
8
8
|
require('jose');
|
|
9
|
-
const bank = require('./shared/bank.
|
|
9
|
+
const bank = require('./shared/bank.B0DNtuUM.cjs');
|
|
10
10
|
const zod = require('zod');
|
|
11
11
|
const database_schema = require('./shared/bank.9Yw4KHyl.cjs');
|
|
12
12
|
const generalCodes = require('@develit-io/general-codes');
|
|
@@ -735,6 +735,11 @@ const getAccountBalanceInputSchema = zod.z.object({
|
|
|
735
735
|
accountId: zod.z.string().uuid()
|
|
736
736
|
});
|
|
737
737
|
|
|
738
|
+
const closePaymentRequestInputSchema = zod.z.object({
|
|
739
|
+
paymentRequestId: zod.z.string(),
|
|
740
|
+
statusReason: zod.z.string().optional()
|
|
741
|
+
});
|
|
742
|
+
|
|
738
743
|
var __defProp = Object.defineProperty;
|
|
739
744
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
740
745
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -752,6 +757,9 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
|
|
|
752
757
|
// ── Unified status resolution ──────────────────────────────────────
|
|
753
758
|
this.POLLING_TIMEOUT_MS = 14 * 24 * 60 * 60 * 1e3;
|
|
754
759
|
// 14 days
|
|
760
|
+
// OPENED = authorization never completed; auth links are short-lived, so close much sooner
|
|
761
|
+
this.OPENED_TIMEOUT_MS = 48 * 60 * 60 * 1e3;
|
|
762
|
+
// 48 hours
|
|
755
763
|
this.COMPLETED_POLLING_WINDOW_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
756
764
|
this.allowedProviders = config.allowedProviders;
|
|
757
765
|
this.db = d1.drizzle(this.env.BANK_D1, { schema: paymentDirection.tables, relations: paymentDirection.relations });
|
|
@@ -1097,13 +1105,16 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
|
|
|
1097
1105
|
console.log("[updatePaymentRequestStatuses] By connector", byConnector);
|
|
1098
1106
|
const now = Date.now();
|
|
1099
1107
|
const pollableIds = [];
|
|
1108
|
+
const closedEvents = [];
|
|
1100
1109
|
for (const pr of nonTerminalPRs) {
|
|
1101
1110
|
const status = pr.status;
|
|
1102
1111
|
if (paymentDirection.isTerminalStatus(status, pr.connectorKey)) {
|
|
1103
1112
|
continue;
|
|
1104
1113
|
}
|
|
1105
1114
|
if (status === "OPENED" || status === "AUTHORIZED") {
|
|
1106
|
-
|
|
1115
|
+
const timeoutMs = status === "OPENED" ? this.OPENED_TIMEOUT_MS : this.POLLING_TIMEOUT_MS;
|
|
1116
|
+
const statusReason = status === "OPENED" ? "Authorization not completed within 48 hours" : "Polling timeout: no final status received after 14 days";
|
|
1117
|
+
if (pr.createdAt != null && now - pr.createdAt.getTime() > timeoutMs) {
|
|
1107
1118
|
console.warn(
|
|
1108
1119
|
"[updatePaymentRequestStatuses] Closing PR due to timeout",
|
|
1109
1120
|
{
|
|
@@ -1115,17 +1126,42 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
|
|
|
1115
1126
|
age: `${Math.floor((now - pr.createdAt.getTime()) / (24 * 60 * 60 * 1e3))} days`
|
|
1116
1127
|
}
|
|
1117
1128
|
);
|
|
1129
|
+
const processedAt = /* @__PURE__ */ new Date();
|
|
1118
1130
|
await bank.updatePaymentRequestStatusCommand(this.db, {
|
|
1119
1131
|
id: pr.id,
|
|
1120
1132
|
status: "CLOSED",
|
|
1121
|
-
statusReason
|
|
1122
|
-
processedAt
|
|
1133
|
+
statusReason,
|
|
1134
|
+
processedAt
|
|
1123
1135
|
}).command.execute();
|
|
1136
|
+
closedEvents.push(
|
|
1137
|
+
buildPaymentRequestEvent({
|
|
1138
|
+
...pr,
|
|
1139
|
+
status: "CLOSED",
|
|
1140
|
+
statusReason,
|
|
1141
|
+
processedAt
|
|
1142
|
+
})
|
|
1143
|
+
);
|
|
1124
1144
|
continue;
|
|
1125
1145
|
}
|
|
1126
1146
|
pollableIds.push(pr.id);
|
|
1127
1147
|
}
|
|
1128
1148
|
}
|
|
1149
|
+
if (closedEvents.length > 0) {
|
|
1150
|
+
try {
|
|
1151
|
+
await this.pushToQueue(
|
|
1152
|
+
this.env.QUEUE_BUS_QUEUE,
|
|
1153
|
+
closedEvents
|
|
1154
|
+
);
|
|
1155
|
+
} catch (err) {
|
|
1156
|
+
console.error(
|
|
1157
|
+
"[updatePaymentRequestStatuses] Failed to push timeout-close events to queue",
|
|
1158
|
+
{
|
|
1159
|
+
eventCount: closedEvents.length,
|
|
1160
|
+
error: err instanceof Error ? err.message : String(err)
|
|
1161
|
+
}
|
|
1162
|
+
);
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1129
1165
|
const result = await this._resolvePaymentRequestStatuses(pollableIds);
|
|
1130
1166
|
const duration = Date.now() - startTime;
|
|
1131
1167
|
console.log("[updatePaymentRequestStatuses] Completed", {
|
|
@@ -1218,6 +1254,18 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
|
|
|
1218
1254
|
});
|
|
1219
1255
|
const result = connector.parseAuthorizationCallback(callbackUrl);
|
|
1220
1256
|
if (!result.success) {
|
|
1257
|
+
if (paymentRequestId) {
|
|
1258
|
+
try {
|
|
1259
|
+
await bank.updatePaymentRequestStatusCommand(this.db, {
|
|
1260
|
+
id: paymentRequestId,
|
|
1261
|
+
statusReason: `Authorization error: ${result.error}`
|
|
1262
|
+
}).command.execute();
|
|
1263
|
+
} catch (err) {
|
|
1264
|
+
this.logError({
|
|
1265
|
+
message: `[handleAuthorizationCallback] Failed to persist error reason for PR ${paymentRequestId}: ${err}`
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1221
1269
|
return {
|
|
1222
1270
|
paymentsUpdated: 0,
|
|
1223
1271
|
batchId: null,
|
|
@@ -1246,6 +1294,87 @@ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker
|
|
|
1246
1294
|
}
|
|
1247
1295
|
);
|
|
1248
1296
|
}
|
|
1297
|
+
async closePaymentRequest(input) {
|
|
1298
|
+
return this.handleAction(
|
|
1299
|
+
{ data: input, schema: closePaymentRequestInputSchema },
|
|
1300
|
+
{ successMessage: "Payment request closed" },
|
|
1301
|
+
async ({ paymentRequestId, statusReason }) => {
|
|
1302
|
+
const pr = await getPaymentRequestByIdQuery(this.db, {
|
|
1303
|
+
paymentRequestId
|
|
1304
|
+
});
|
|
1305
|
+
if (!pr) {
|
|
1306
|
+
throw backendSdk.createInternalError(null, {
|
|
1307
|
+
message: `Payment request ${paymentRequestId} not found`,
|
|
1308
|
+
code: "DB-B-011",
|
|
1309
|
+
status: 404
|
|
1310
|
+
});
|
|
1311
|
+
}
|
|
1312
|
+
if (pr.status !== "OPENED") {
|
|
1313
|
+
throw backendSdk.createInternalError(null, {
|
|
1314
|
+
message: `Only OPENED payment requests can be closed (current status: ${pr.status})`,
|
|
1315
|
+
code: "DB-B-012",
|
|
1316
|
+
status: 400
|
|
1317
|
+
});
|
|
1318
|
+
}
|
|
1319
|
+
let bankStatus = null;
|
|
1320
|
+
try {
|
|
1321
|
+
const connector = await this._initiateBankConnector({
|
|
1322
|
+
connectorKey: pr.connectorKey
|
|
1323
|
+
});
|
|
1324
|
+
bankStatus = await connector.getPaymentStatus({
|
|
1325
|
+
paymentId: pr.bankRefId ?? pr.id
|
|
1326
|
+
});
|
|
1327
|
+
} catch (err) {
|
|
1328
|
+
this.logError({
|
|
1329
|
+
message: `[closePaymentRequest] Status re-poll failed for PR ${pr.id}, closing anyway: ${err}`
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
if (bankStatus && bankStatus !== "OPENED") {
|
|
1333
|
+
await this._resolvePaymentRequestStatuses([pr.id]);
|
|
1334
|
+
throw backendSdk.createInternalError(null, {
|
|
1335
|
+
message: `Payment request is no longer OPENED at the bank (current status: ${bankStatus})`,
|
|
1336
|
+
code: "DB-B-013",
|
|
1337
|
+
status: 409
|
|
1338
|
+
});
|
|
1339
|
+
}
|
|
1340
|
+
const processedAt = /* @__PURE__ */ new Date();
|
|
1341
|
+
const reason = statusReason ?? "Closed by operator";
|
|
1342
|
+
const updated = backendSdk.first(
|
|
1343
|
+
await bank.updatePaymentRequestStatusCommand(this.db, {
|
|
1344
|
+
id: pr.id,
|
|
1345
|
+
status: "CLOSED",
|
|
1346
|
+
statusReason: reason,
|
|
1347
|
+
processedAt
|
|
1348
|
+
}).command.execute()
|
|
1349
|
+
);
|
|
1350
|
+
try {
|
|
1351
|
+
await this.pushToQueue(
|
|
1352
|
+
this.env.QUEUE_BUS_QUEUE,
|
|
1353
|
+
[
|
|
1354
|
+
buildPaymentRequestEvent({
|
|
1355
|
+
...pr,
|
|
1356
|
+
status: "CLOSED",
|
|
1357
|
+
statusReason: reason,
|
|
1358
|
+
processedAt
|
|
1359
|
+
})
|
|
1360
|
+
]
|
|
1361
|
+
);
|
|
1362
|
+
} catch (err) {
|
|
1363
|
+
this.logError({
|
|
1364
|
+
message: `[closePaymentRequest] Failed to push close event for PR ${pr.id}: ${err}`
|
|
1365
|
+
});
|
|
1366
|
+
}
|
|
1367
|
+
return {
|
|
1368
|
+
paymentRequest: updated ?? {
|
|
1369
|
+
...pr,
|
|
1370
|
+
status: "CLOSED",
|
|
1371
|
+
statusReason: reason,
|
|
1372
|
+
processedAt
|
|
1373
|
+
}
|
|
1374
|
+
};
|
|
1375
|
+
}
|
|
1376
|
+
);
|
|
1377
|
+
}
|
|
1249
1378
|
async processBatch(input) {
|
|
1250
1379
|
return this.handleAction(
|
|
1251
1380
|
{ data: input, schema: processBatchInputSchema },
|
|
@@ -2098,6 +2227,9 @@ __decorateClass([
|
|
|
2098
2227
|
__decorateClass([
|
|
2099
2228
|
backendSdk.action("handle-authorization-callback")
|
|
2100
2229
|
], exports.BankServiceBase.prototype, "handleAuthorizationCallback", 1);
|
|
2230
|
+
__decorateClass([
|
|
2231
|
+
backendSdk.action("close-payment-request")
|
|
2232
|
+
], exports.BankServiceBase.prototype, "closePaymentRequest", 1);
|
|
2101
2233
|
__decorateClass([
|
|
2102
2234
|
backendSdk.action("process-batch")
|
|
2103
2235
|
], exports.BankServiceBase.prototype, "processBatch", 1);
|
package/dist/base.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.
|
|
2
|
-
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.
|
|
1
|
+
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.BQwwtIR4.cjs';
|
|
2
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.BUzoc8p6.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';
|
|
@@ -2957,19 +2957,19 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2957
2957
|
filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
|
|
2958
2958
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
2959
2959
|
PROCESSING: "PROCESSING";
|
|
2960
|
-
BOOKED: "BOOKED";
|
|
2961
|
-
REJECTED: "REJECTED";
|
|
2962
2960
|
PENDING: "PENDING";
|
|
2961
|
+
BOOKED: "BOOKED";
|
|
2963
2962
|
CANCELLED: "CANCELLED";
|
|
2963
|
+
REJECTED: "REJECTED";
|
|
2964
2964
|
SCHEDULED: "SCHEDULED";
|
|
2965
2965
|
HOLD: "HOLD";
|
|
2966
2966
|
INFO: "INFO";
|
|
2967
2967
|
}>, z.ZodArray<z.ZodEnum<{
|
|
2968
2968
|
PROCESSING: "PROCESSING";
|
|
2969
|
-
BOOKED: "BOOKED";
|
|
2970
|
-
REJECTED: "REJECTED";
|
|
2971
2969
|
PENDING: "PENDING";
|
|
2970
|
+
BOOKED: "BOOKED";
|
|
2972
2971
|
CANCELLED: "CANCELLED";
|
|
2972
|
+
REJECTED: "REJECTED";
|
|
2973
2973
|
SCHEDULED: "SCHEDULED";
|
|
2974
2974
|
HOLD: "HOLD";
|
|
2975
2975
|
INFO: "INFO";
|
|
@@ -3888,18 +3888,18 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
|
|
|
3888
3888
|
filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3889
3889
|
AUTHORIZED: "AUTHORIZED";
|
|
3890
3890
|
COMPLETED: "COMPLETED";
|
|
3891
|
-
OPENED: "OPENED";
|
|
3892
3891
|
BOOKED: "BOOKED";
|
|
3893
|
-
SETTLED: "SETTLED";
|
|
3894
3892
|
REJECTED: "REJECTED";
|
|
3893
|
+
OPENED: "OPENED";
|
|
3894
|
+
SETTLED: "SETTLED";
|
|
3895
3895
|
CLOSED: "CLOSED";
|
|
3896
3896
|
}>, z.ZodArray<z.ZodEnum<{
|
|
3897
3897
|
AUTHORIZED: "AUTHORIZED";
|
|
3898
3898
|
COMPLETED: "COMPLETED";
|
|
3899
|
-
OPENED: "OPENED";
|
|
3900
3899
|
BOOKED: "BOOKED";
|
|
3901
|
-
SETTLED: "SETTLED";
|
|
3902
3900
|
REJECTED: "REJECTED";
|
|
3901
|
+
OPENED: "OPENED";
|
|
3902
|
+
SETTLED: "SETTLED";
|
|
3903
3903
|
CLOSED: "CLOSED";
|
|
3904
3904
|
}>>]>>;
|
|
3905
3905
|
filterPaymentType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
@@ -4060,6 +4060,15 @@ type GetAccountBalanceOutput = {
|
|
|
4060
4060
|
}>;
|
|
4061
4061
|
};
|
|
4062
4062
|
|
|
4063
|
+
declare const closePaymentRequestInputSchema: z.ZodObject<{
|
|
4064
|
+
paymentRequestId: z.ZodString;
|
|
4065
|
+
statusReason: z.ZodOptional<z.ZodString>;
|
|
4066
|
+
}, z.core.$strip>;
|
|
4067
|
+
type ClosePaymentRequestInput = z.infer<typeof closePaymentRequestInputSchema>;
|
|
4068
|
+
type ClosePaymentRequestOutput = {
|
|
4069
|
+
paymentRequest: PaymentRequestSelectType;
|
|
4070
|
+
};
|
|
4071
|
+
|
|
4063
4072
|
declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
4064
4073
|
declare class BankServiceBase extends BankServiceBase_base {
|
|
4065
4074
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
@@ -4161,6 +4170,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
4161
4170
|
syncAccountTerminate(input: SyncAccountTerminateInput): Promise<IRPCResponse<SyncAccountTerminateOutput>>;
|
|
4162
4171
|
syncAccounts(): Promise<IRPCResponse<never>>;
|
|
4163
4172
|
private readonly POLLING_TIMEOUT_MS;
|
|
4173
|
+
private readonly OPENED_TIMEOUT_MS;
|
|
4164
4174
|
private readonly COMPLETED_POLLING_WINDOW_MS;
|
|
4165
4175
|
/**
|
|
4166
4176
|
* Core status resolution logic. Polls connector for each PR and updates status.
|
|
@@ -4185,6 +4195,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
4185
4195
|
scheduled(controller: ScheduledController): Promise<void>;
|
|
4186
4196
|
private heartbeatSyncWorkflows;
|
|
4187
4197
|
handleAuthorizationCallback(input: HandleAuthorizationCallbackInput): Promise<IRPCResponse<HandleAuthorizationCallbackOutput>>;
|
|
4198
|
+
closePaymentRequest(input: ClosePaymentRequestInput): Promise<IRPCResponse<ClosePaymentRequestOutput>>;
|
|
4188
4199
|
processBatch(input: ProcessBatchInput): Promise<IRPCResponse<ProcessBatchOutput>>;
|
|
4189
4200
|
processBatchStatus(input: ProcessBatchStatusInput): Promise<IRPCResponse<ProcessBatchStatusOutput>>;
|
|
4190
4201
|
processBatchRestart(input: ProcessBatchRestartInput): Promise<IRPCResponse<ProcessBatchRestartOutput>>;
|
package/dist/base.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.
|
|
2
|
-
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.
|
|
1
|
+
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.BQwwtIR4.mjs';
|
|
2
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.DZ3Ow4bP.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';
|
|
@@ -2957,19 +2957,19 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2957
2957
|
filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
|
|
2958
2958
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
2959
2959
|
PROCESSING: "PROCESSING";
|
|
2960
|
-
BOOKED: "BOOKED";
|
|
2961
|
-
REJECTED: "REJECTED";
|
|
2962
2960
|
PENDING: "PENDING";
|
|
2961
|
+
BOOKED: "BOOKED";
|
|
2963
2962
|
CANCELLED: "CANCELLED";
|
|
2963
|
+
REJECTED: "REJECTED";
|
|
2964
2964
|
SCHEDULED: "SCHEDULED";
|
|
2965
2965
|
HOLD: "HOLD";
|
|
2966
2966
|
INFO: "INFO";
|
|
2967
2967
|
}>, z.ZodArray<z.ZodEnum<{
|
|
2968
2968
|
PROCESSING: "PROCESSING";
|
|
2969
|
-
BOOKED: "BOOKED";
|
|
2970
|
-
REJECTED: "REJECTED";
|
|
2971
2969
|
PENDING: "PENDING";
|
|
2970
|
+
BOOKED: "BOOKED";
|
|
2972
2971
|
CANCELLED: "CANCELLED";
|
|
2972
|
+
REJECTED: "REJECTED";
|
|
2973
2973
|
SCHEDULED: "SCHEDULED";
|
|
2974
2974
|
HOLD: "HOLD";
|
|
2975
2975
|
INFO: "INFO";
|
|
@@ -3888,18 +3888,18 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
|
|
|
3888
3888
|
filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3889
3889
|
AUTHORIZED: "AUTHORIZED";
|
|
3890
3890
|
COMPLETED: "COMPLETED";
|
|
3891
|
-
OPENED: "OPENED";
|
|
3892
3891
|
BOOKED: "BOOKED";
|
|
3893
|
-
SETTLED: "SETTLED";
|
|
3894
3892
|
REJECTED: "REJECTED";
|
|
3893
|
+
OPENED: "OPENED";
|
|
3894
|
+
SETTLED: "SETTLED";
|
|
3895
3895
|
CLOSED: "CLOSED";
|
|
3896
3896
|
}>, z.ZodArray<z.ZodEnum<{
|
|
3897
3897
|
AUTHORIZED: "AUTHORIZED";
|
|
3898
3898
|
COMPLETED: "COMPLETED";
|
|
3899
|
-
OPENED: "OPENED";
|
|
3900
3899
|
BOOKED: "BOOKED";
|
|
3901
|
-
SETTLED: "SETTLED";
|
|
3902
3900
|
REJECTED: "REJECTED";
|
|
3901
|
+
OPENED: "OPENED";
|
|
3902
|
+
SETTLED: "SETTLED";
|
|
3903
3903
|
CLOSED: "CLOSED";
|
|
3904
3904
|
}>>]>>;
|
|
3905
3905
|
filterPaymentType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
@@ -4060,6 +4060,15 @@ type GetAccountBalanceOutput = {
|
|
|
4060
4060
|
}>;
|
|
4061
4061
|
};
|
|
4062
4062
|
|
|
4063
|
+
declare const closePaymentRequestInputSchema: z.ZodObject<{
|
|
4064
|
+
paymentRequestId: z.ZodString;
|
|
4065
|
+
statusReason: z.ZodOptional<z.ZodString>;
|
|
4066
|
+
}, z.core.$strip>;
|
|
4067
|
+
type ClosePaymentRequestInput = z.infer<typeof closePaymentRequestInputSchema>;
|
|
4068
|
+
type ClosePaymentRequestOutput = {
|
|
4069
|
+
paymentRequest: PaymentRequestSelectType;
|
|
4070
|
+
};
|
|
4071
|
+
|
|
4063
4072
|
declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
4064
4073
|
declare class BankServiceBase extends BankServiceBase_base {
|
|
4065
4074
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
@@ -4161,6 +4170,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
4161
4170
|
syncAccountTerminate(input: SyncAccountTerminateInput): Promise<IRPCResponse<SyncAccountTerminateOutput>>;
|
|
4162
4171
|
syncAccounts(): Promise<IRPCResponse<never>>;
|
|
4163
4172
|
private readonly POLLING_TIMEOUT_MS;
|
|
4173
|
+
private readonly OPENED_TIMEOUT_MS;
|
|
4164
4174
|
private readonly COMPLETED_POLLING_WINDOW_MS;
|
|
4165
4175
|
/**
|
|
4166
4176
|
* Core status resolution logic. Polls connector for each PR and updates status.
|
|
@@ -4185,6 +4195,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
4185
4195
|
scheduled(controller: ScheduledController): Promise<void>;
|
|
4186
4196
|
private heartbeatSyncWorkflows;
|
|
4187
4197
|
handleAuthorizationCallback(input: HandleAuthorizationCallbackInput): Promise<IRPCResponse<HandleAuthorizationCallbackOutput>>;
|
|
4198
|
+
closePaymentRequest(input: ClosePaymentRequestInput): Promise<IRPCResponse<ClosePaymentRequestOutput>>;
|
|
4188
4199
|
processBatch(input: ProcessBatchInput): Promise<IRPCResponse<ProcessBatchOutput>>;
|
|
4189
4200
|
processBatchStatus(input: ProcessBatchStatusInput): Promise<IRPCResponse<ProcessBatchStatusOutput>>;
|
|
4190
4201
|
processBatchRestart(input: ProcessBatchRestartInput): Promise<IRPCResponse<ProcessBatchRestartOutput>>;
|
package/dist/base.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.
|
|
2
|
-
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.
|
|
1
|
+
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.BQwwtIR4.js';
|
|
2
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.CBpXmaTL.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';
|
|
@@ -2957,19 +2957,19 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
2957
2957
|
filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
|
|
2958
2958
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
2959
2959
|
PROCESSING: "PROCESSING";
|
|
2960
|
-
BOOKED: "BOOKED";
|
|
2961
|
-
REJECTED: "REJECTED";
|
|
2962
2960
|
PENDING: "PENDING";
|
|
2961
|
+
BOOKED: "BOOKED";
|
|
2963
2962
|
CANCELLED: "CANCELLED";
|
|
2963
|
+
REJECTED: "REJECTED";
|
|
2964
2964
|
SCHEDULED: "SCHEDULED";
|
|
2965
2965
|
HOLD: "HOLD";
|
|
2966
2966
|
INFO: "INFO";
|
|
2967
2967
|
}>, z.ZodArray<z.ZodEnum<{
|
|
2968
2968
|
PROCESSING: "PROCESSING";
|
|
2969
|
-
BOOKED: "BOOKED";
|
|
2970
|
-
REJECTED: "REJECTED";
|
|
2971
2969
|
PENDING: "PENDING";
|
|
2970
|
+
BOOKED: "BOOKED";
|
|
2972
2971
|
CANCELLED: "CANCELLED";
|
|
2972
|
+
REJECTED: "REJECTED";
|
|
2973
2973
|
SCHEDULED: "SCHEDULED";
|
|
2974
2974
|
HOLD: "HOLD";
|
|
2975
2975
|
INFO: "INFO";
|
|
@@ -3888,18 +3888,18 @@ declare const getPaymentRequestsInputSchema: z.ZodObject<{
|
|
|
3888
3888
|
filterStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3889
3889
|
AUTHORIZED: "AUTHORIZED";
|
|
3890
3890
|
COMPLETED: "COMPLETED";
|
|
3891
|
-
OPENED: "OPENED";
|
|
3892
3891
|
BOOKED: "BOOKED";
|
|
3893
|
-
SETTLED: "SETTLED";
|
|
3894
3892
|
REJECTED: "REJECTED";
|
|
3893
|
+
OPENED: "OPENED";
|
|
3894
|
+
SETTLED: "SETTLED";
|
|
3895
3895
|
CLOSED: "CLOSED";
|
|
3896
3896
|
}>, z.ZodArray<z.ZodEnum<{
|
|
3897
3897
|
AUTHORIZED: "AUTHORIZED";
|
|
3898
3898
|
COMPLETED: "COMPLETED";
|
|
3899
|
-
OPENED: "OPENED";
|
|
3900
3899
|
BOOKED: "BOOKED";
|
|
3901
|
-
SETTLED: "SETTLED";
|
|
3902
3900
|
REJECTED: "REJECTED";
|
|
3901
|
+
OPENED: "OPENED";
|
|
3902
|
+
SETTLED: "SETTLED";
|
|
3903
3903
|
CLOSED: "CLOSED";
|
|
3904
3904
|
}>>]>>;
|
|
3905
3905
|
filterPaymentType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
@@ -4060,6 +4060,15 @@ type GetAccountBalanceOutput = {
|
|
|
4060
4060
|
}>;
|
|
4061
4061
|
};
|
|
4062
4062
|
|
|
4063
|
+
declare const closePaymentRequestInputSchema: z.ZodObject<{
|
|
4064
|
+
paymentRequestId: z.ZodString;
|
|
4065
|
+
statusReason: z.ZodOptional<z.ZodString>;
|
|
4066
|
+
}, z.core.$strip>;
|
|
4067
|
+
type ClosePaymentRequestInput = z.infer<typeof closePaymentRequestInputSchema>;
|
|
4068
|
+
type ClosePaymentRequestOutput = {
|
|
4069
|
+
paymentRequest: PaymentRequestSelectType;
|
|
4070
|
+
};
|
|
4071
|
+
|
|
4063
4072
|
declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
4064
4073
|
declare class BankServiceBase extends BankServiceBase_base {
|
|
4065
4074
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
@@ -4161,6 +4170,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
4161
4170
|
syncAccountTerminate(input: SyncAccountTerminateInput): Promise<IRPCResponse<SyncAccountTerminateOutput>>;
|
|
4162
4171
|
syncAccounts(): Promise<IRPCResponse<never>>;
|
|
4163
4172
|
private readonly POLLING_TIMEOUT_MS;
|
|
4173
|
+
private readonly OPENED_TIMEOUT_MS;
|
|
4164
4174
|
private readonly COMPLETED_POLLING_WINDOW_MS;
|
|
4165
4175
|
/**
|
|
4166
4176
|
* Core status resolution logic. Polls connector for each PR and updates status.
|
|
@@ -4185,6 +4195,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
4185
4195
|
scheduled(controller: ScheduledController): Promise<void>;
|
|
4186
4196
|
private heartbeatSyncWorkflows;
|
|
4187
4197
|
handleAuthorizationCallback(input: HandleAuthorizationCallbackInput): Promise<IRPCResponse<HandleAuthorizationCallbackOutput>>;
|
|
4198
|
+
closePaymentRequest(input: ClosePaymentRequestInput): Promise<IRPCResponse<ClosePaymentRequestOutput>>;
|
|
4188
4199
|
processBatch(input: ProcessBatchInput): Promise<IRPCResponse<ProcessBatchOutput>>;
|
|
4189
4200
|
processBatchStatus(input: ProcessBatchStatusInput): Promise<IRPCResponse<ProcessBatchStatusOutput>>;
|
|
4190
4201
|
processBatchRestart(input: ProcessBatchRestartInput): Promise<IRPCResponse<ProcessBatchRestartOutput>>;
|