@develit-services/bank 0.3.59 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/database/schema.cjs +9 -9
- package/dist/database/schema.d.cts +4 -5
- package/dist/database/schema.d.mts +4 -5
- package/dist/database/schema.d.ts +4 -5
- package/dist/database/schema.mjs +3 -3
- package/dist/export/worker.cjs +91 -85
- package/dist/export/worker.d.cts +32 -771
- package/dist/export/worker.d.mts +32 -771
- package/dist/export/worker.d.ts +32 -771
- package/dist/export/worker.mjs +72 -66
- package/dist/export/workflows.cjs +215 -211
- package/dist/export/workflows.d.cts +4 -4
- package/dist/export/workflows.d.mts +4 -4
- package/dist/export/workflows.d.ts +4 -4
- package/dist/export/workflows.mjs +210 -206
- package/dist/export/wrangler.d.cts +3 -1
- package/dist/export/wrangler.d.mts +3 -1
- package/dist/export/wrangler.d.ts +3 -1
- package/dist/shared/{bank.CXcZewU9.mjs → bank.B51e8oDT.mjs} +6 -76
- package/dist/shared/{bank.Dh_H_5rC.d.cts → bank.BJvgLwyZ.d.cts} +2 -0
- package/dist/shared/{bank.Dh_H_5rC.d.mts → bank.BJvgLwyZ.d.mts} +2 -0
- package/dist/shared/{bank.Dh_H_5rC.d.ts → bank.BJvgLwyZ.d.ts} +2 -0
- package/dist/shared/bank.BUSlmr6r.mjs +13 -0
- package/dist/shared/{bank.BnDb4liE.cjs → bank.BeIpkWR-.cjs} +6 -15
- package/dist/shared/bank.Bg3Pdwm4.cjs +44 -0
- package/dist/shared/bank.CDoYUKBx.d.cts +748 -0
- package/dist/shared/bank.CDoYUKBx.d.mts +748 -0
- package/dist/shared/bank.CDoYUKBx.d.ts +748 -0
- package/dist/shared/{bank.0IwqmnZ7.cjs → bank.CfSZTfWS.cjs} +634 -179
- package/dist/shared/{bank.BwXpqjVU.d.mts → bank.CsJuzqZH.d.cts} +2400 -2116
- package/dist/shared/{bank.BwXpqjVU.d.ts → bank.CsJuzqZH.d.mts} +2400 -2116
- package/dist/shared/{bank.BwXpqjVU.d.cts → bank.CsJuzqZH.d.ts} +2400 -2116
- package/dist/shared/{bank.Cg05BigT.cjs → bank.DEvSNsEs.cjs} +12 -82
- package/dist/shared/{bank.Dh6IUoHL.mjs → bank.DinCwx0P.mjs} +627 -179
- package/dist/shared/bank.Dpx6PvkA.mjs +33 -0
- package/dist/shared/bank.c38V_FCq.cjs +15 -0
- package/dist/shared/{bank.BPxg79Tw.mjs → bank.qc8ALZwm.mjs} +7 -15
- package/dist/types.cjs +51 -33
- package/dist/types.d.cts +165 -40
- package/dist/types.d.mts +165 -40
- package/dist/types.d.ts +165 -40
- package/dist/types.mjs +4 -3
- package/package.json +7 -10
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { n as account, p as accountCredentials, q as batch, r as ott, s as payment, t as paymentRelations } from './bank.qc8ALZwm.mjs';
|
|
2
|
+
|
|
3
|
+
const schema = {
|
|
4
|
+
__proto__: null,
|
|
5
|
+
account: account,
|
|
6
|
+
accountCredentials: accountCredentials,
|
|
7
|
+
batch: batch,
|
|
8
|
+
ott: ott,
|
|
9
|
+
payment: payment,
|
|
10
|
+
paymentRelations: paymentRelations
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { schema as s };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
|
+
const relations = require('drizzle-orm/relations');
|
|
4
5
|
const sqliteCore = require('drizzle-orm/sqlite-core');
|
|
5
6
|
require('date-fns');
|
|
6
|
-
const relations = require('drizzle-orm/relations');
|
|
7
7
|
const generalCodes = require('@develit-io/general-codes');
|
|
8
|
-
require('drizzle-orm');
|
|
9
8
|
require('jose');
|
|
9
|
+
require('drizzle-orm');
|
|
10
10
|
require('node:crypto');
|
|
11
11
|
const drizzleZod = require('drizzle-zod');
|
|
12
12
|
|
|
@@ -15,7 +15,6 @@ const CHARGE_BEARERS = ["SHA", "OUR", "BEN"];
|
|
|
15
15
|
const INSTRUCTION_PRIORITIES = ["NORM", "HIGH", "INST"];
|
|
16
16
|
const PAYMENT_STATUSES = [
|
|
17
17
|
"PREPARED",
|
|
18
|
-
"INITIALIZED",
|
|
19
18
|
"FAILED",
|
|
20
19
|
"PENDING",
|
|
21
20
|
"COMPLETED",
|
|
@@ -40,7 +39,10 @@ const CONNECTOR_KEYS = [
|
|
|
40
39
|
"CREDITAS",
|
|
41
40
|
"MOCK_COBS",
|
|
42
41
|
"FIO",
|
|
43
|
-
"MONETA"
|
|
42
|
+
"MONETA",
|
|
43
|
+
"DBU",
|
|
44
|
+
"CSAS",
|
|
45
|
+
"AIRBANK"
|
|
44
46
|
];
|
|
45
47
|
const CREDENTIALS_TYPES = [
|
|
46
48
|
"AUTH_TOKEN",
|
|
@@ -165,16 +167,6 @@ const paymentRelations = relations.relations(payment, ({ one }) => ({
|
|
|
165
167
|
batch: one(batch, { fields: [payment.batchId], references: [batch.id] })
|
|
166
168
|
}));
|
|
167
169
|
|
|
168
|
-
const schema = {
|
|
169
|
-
__proto__: null,
|
|
170
|
-
account: account,
|
|
171
|
-
accountCredentials: accountCredentials,
|
|
172
|
-
batch: batch,
|
|
173
|
-
ott: ott,
|
|
174
|
-
payment: payment,
|
|
175
|
-
paymentRelations: paymentRelations
|
|
176
|
-
};
|
|
177
|
-
|
|
178
170
|
exports.ACCOUNT_STATUSES = ACCOUNT_STATUSES;
|
|
179
171
|
exports.BATCH_STATUSES = BATCH_STATUSES;
|
|
180
172
|
exports.CHARGE_BEARERS = CHARGE_BEARERS;
|
|
@@ -201,4 +193,3 @@ exports.ottSelectSchema = ottSelectSchema;
|
|
|
201
193
|
exports.ottUpdateSchema = ottUpdateSchema;
|
|
202
194
|
exports.payment = payment;
|
|
203
195
|
exports.paymentRelations = paymentRelations;
|
|
204
|
-
exports.schema = schema;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function hasPaymentAccountAssigned(payment) {
|
|
4
|
+
return "accountId" in payment && "connectorKey" in payment && payment.accountId !== void 0 && payment.connectorKey !== void 0;
|
|
5
|
+
}
|
|
6
|
+
function isPaymentPrepared(payment) {
|
|
7
|
+
return payment.status === "PREPARED";
|
|
8
|
+
}
|
|
9
|
+
function isPaymentCompleted(payment) {
|
|
10
|
+
return (payment.status === "COMPLETED" || payment.status === "PENDING" || payment.status === "FAILED") && "bankRefId" in payment && typeof payment.bankRefId === "string";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function isBatchInitiated(batch) {
|
|
14
|
+
return "authorizationUrls" in batch && batch.authorizationUrls !== null && batch.authorizationUrls !== void 0 && batch.authorizationUrls.length > 0;
|
|
15
|
+
}
|
|
16
|
+
function isBatchReadyToSign(batch) {
|
|
17
|
+
return "status" in batch && batch.status === "READY_TO_SIGN";
|
|
18
|
+
}
|
|
19
|
+
function isBatchSigned(batch) {
|
|
20
|
+
return "status" in batch && batch.status === "SIGNED";
|
|
21
|
+
}
|
|
22
|
+
function isBatchProcessing(batch) {
|
|
23
|
+
return "status" in batch && batch.status === "PROCESSING";
|
|
24
|
+
}
|
|
25
|
+
function isBatchCompleted(batch) {
|
|
26
|
+
return "status" in batch && (batch.status === "COMPLETED" || batch.status === "FAILED" || batch.status === "SIGNATURE_FAILED");
|
|
27
|
+
}
|
|
28
|
+
function isBatchOpen(batch) {
|
|
29
|
+
return "status" in batch && batch.status === "OPEN";
|
|
30
|
+
}
|
|
31
|
+
function isBatchFailed(batch) {
|
|
32
|
+
return "status" in batch && batch.status === "FAILED";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
exports.hasPaymentAccountAssigned = hasPaymentAccountAssigned;
|
|
36
|
+
exports.isBatchCompleted = isBatchCompleted;
|
|
37
|
+
exports.isBatchFailed = isBatchFailed;
|
|
38
|
+
exports.isBatchInitiated = isBatchInitiated;
|
|
39
|
+
exports.isBatchOpen = isBatchOpen;
|
|
40
|
+
exports.isBatchProcessing = isBatchProcessing;
|
|
41
|
+
exports.isBatchReadyToSign = isBatchReadyToSign;
|
|
42
|
+
exports.isBatchSigned = isBatchSigned;
|
|
43
|
+
exports.isPaymentCompleted = isPaymentCompleted;
|
|
44
|
+
exports.isPaymentPrepared = isPaymentPrepared;
|