@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
|
@@ -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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as CurrencyCode, O as BankCode, $ as CountryCode,
|
|
1
|
+
import { d as CurrencyCode, O as BankCode, $ as CountryCode, P as PaymentRequestSelectType } from './bank.BOY6AI1t.cjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { sql, and, eq, isNull } from 'drizzle-orm';
|
|
2
|
+
import { v as tables } from './bank.ESTBT4J6.mjs';
|
|
2
3
|
import { uuidv4 } from '@develit-io/backend-sdk';
|
|
3
|
-
import './bank.CXBeULUL.mjs';
|
|
4
4
|
import 'date-fns';
|
|
5
5
|
import 'jose';
|
|
6
6
|
import '@develit-io/general-codes';
|
|
7
7
|
import { createHash } from 'node:crypto';
|
|
8
|
-
import { s as schema } from './bank.CR0UlyRi.mjs';
|
|
9
8
|
|
|
10
9
|
const createPaymentCommand = (db, { payment }) => {
|
|
11
10
|
return {
|
|
@@ -142,6 +141,4 @@ const createCredentialsResolver = async (db, env) => {
|
|
|
142
141
|
return (accountId) => getCredentialsByAccountId(db, encryptionKey, { accountId });
|
|
143
142
|
};
|
|
144
143
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
export { getPaymentRequestsByBatchIdQuery as a, getAccountByIdQuery as b, checksum as c, createCredentialsResolver as d, updatePaymentRequestStatusCommand as e, createPaymentCommand as f, getBatchByIdQuery as g, encrypt as h, importAesKey as i, tables as t, upsertBatchCommand as u };
|
|
144
|
+
export { getPaymentRequestsByBatchIdQuery as a, getAccountByIdQuery as b, checksum as c, createCredentialsResolver as d, updatePaymentRequestStatusCommand as e, createPaymentCommand as f, getBatchByIdQuery as g, encrypt as h, importAesKey as i, upsertBatchCommand as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { uuidv4, createInternalError, useResult } from '@develit-io/backend-sdk';
|
|
2
2
|
import { format, parseISO } from 'date-fns';
|
|
3
3
|
import { CURRENCY_CODES } from '@develit-io/general-codes';
|
|
4
|
-
import './bank.
|
|
4
|
+
import './bank.ESTBT4J6.mjs';
|
|
5
5
|
import 'drizzle-orm';
|
|
6
6
|
import { importPKCS8, SignJWT } from 'jose';
|
|
7
7
|
import 'node:crypto';
|
|
@@ -1554,11 +1554,12 @@ class DbuConnector extends IBankConnector {
|
|
|
1554
1554
|
}
|
|
1555
1555
|
);
|
|
1556
1556
|
const bankRefId = response.idRequiredTransaction.toString();
|
|
1557
|
+
const status = this.mapDbuStatusToPaymentRequestStatus(response.status);
|
|
1557
1558
|
return {
|
|
1558
1559
|
authorizationUrl: `${this.txAuthUri}/${bankRefId}`,
|
|
1559
1560
|
payment: {
|
|
1560
1561
|
...payment,
|
|
1561
|
-
status
|
|
1562
|
+
status,
|
|
1562
1563
|
bankRefId
|
|
1563
1564
|
}
|
|
1564
1565
|
};
|
|
@@ -1600,11 +1601,12 @@ class DbuConnector extends IBankConnector {
|
|
|
1600
1601
|
}
|
|
1601
1602
|
);
|
|
1602
1603
|
const bankRefId = response.idRequiredTransaction.toString();
|
|
1604
|
+
const status = this.mapDbuStatusToPaymentRequestStatus(response.status);
|
|
1603
1605
|
return {
|
|
1604
1606
|
authorizationUrl: `${this.txAuthUri}/${bankRefId}`,
|
|
1605
1607
|
payment: {
|
|
1606
1608
|
...payment,
|
|
1607
|
-
status
|
|
1609
|
+
status,
|
|
1608
1610
|
bankRefId
|
|
1609
1611
|
}
|
|
1610
1612
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
4
|
const dateFns = require('date-fns');
|
|
5
5
|
const generalCodes = require('@develit-io/general-codes');
|
|
6
|
-
require('./bank.
|
|
6
|
+
require('./bank.o95cOH_P.cjs');
|
|
7
7
|
require('drizzle-orm');
|
|
8
8
|
const jose = require('jose');
|
|
9
9
|
require('node:crypto');
|
|
@@ -1556,11 +1556,12 @@ class DbuConnector extends IBankConnector {
|
|
|
1556
1556
|
}
|
|
1557
1557
|
);
|
|
1558
1558
|
const bankRefId = response.idRequiredTransaction.toString();
|
|
1559
|
+
const status = this.mapDbuStatusToPaymentRequestStatus(response.status);
|
|
1559
1560
|
return {
|
|
1560
1561
|
authorizationUrl: `${this.txAuthUri}/${bankRefId}`,
|
|
1561
1562
|
payment: {
|
|
1562
1563
|
...payment,
|
|
1563
|
-
status
|
|
1564
|
+
status,
|
|
1564
1565
|
bankRefId
|
|
1565
1566
|
}
|
|
1566
1567
|
};
|
|
@@ -1602,11 +1603,12 @@ class DbuConnector extends IBankConnector {
|
|
|
1602
1603
|
}
|
|
1603
1604
|
);
|
|
1604
1605
|
const bankRefId = response.idRequiredTransaction.toString();
|
|
1606
|
+
const status = this.mapDbuStatusToPaymentRequestStatus(response.status);
|
|
1605
1607
|
return {
|
|
1606
1608
|
authorizationUrl: `${this.txAuthUri}/${bankRefId}`,
|
|
1607
1609
|
payment: {
|
|
1608
1610
|
...payment,
|
|
1609
|
-
status
|
|
1611
|
+
status,
|
|
1610
1612
|
bankRefId
|
|
1611
1613
|
}
|
|
1612
1614
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as CurrencyCode, O as BankCode, $ as CountryCode,
|
|
1
|
+
import { d as CurrencyCode, O as BankCode, $ as CountryCode, P as PaymentRequestSelectType } from './bank.BOY6AI1t.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { bankAccount, base } from '@develit-io/backend-sdk';
|
|
2
|
-
import { relations } from 'drizzle-orm/relations';
|
|
3
2
|
import { sqliteTable, text, integer, unique, real, index } from 'drizzle-orm/sqlite-core';
|
|
4
3
|
import 'date-fns';
|
|
5
4
|
import 'jose';
|
|
6
5
|
import { COUNTRY_CODES_2, BANK_CODES } from '@develit-io/general-codes';
|
|
7
|
-
import 'drizzle-orm';
|
|
6
|
+
import { relations } from 'drizzle-orm/relations';
|
|
7
|
+
import { and, not, inArray, isNull } from 'drizzle-orm';
|
|
8
8
|
import 'node:crypto';
|
|
9
9
|
import { createInsertSchema, createUpdateSchema, createSelectSchema } from 'drizzle-zod';
|
|
10
10
|
|
|
@@ -42,6 +42,39 @@ const BATCH_MODES = ["NATIVE", "SINGLE"];
|
|
|
42
42
|
const ACCOUNT_STATUSES = ["AUTHORIZED", "DISABLED", "EXPIRED"];
|
|
43
43
|
const COUNTRY_CODES = COUNTRY_CODES_2;
|
|
44
44
|
|
|
45
|
+
const TERMINAL_STATUSES$1 = /* @__PURE__ */ new Set([
|
|
46
|
+
"SETTLED",
|
|
47
|
+
"REJECTED",
|
|
48
|
+
"CLOSED"
|
|
49
|
+
]);
|
|
50
|
+
const PENDING_STATUSES = /* @__PURE__ */ new Set([
|
|
51
|
+
"OPENED",
|
|
52
|
+
"AUTHORIZED"
|
|
53
|
+
]);
|
|
54
|
+
function isTerminalStatus(status) {
|
|
55
|
+
return TERMINAL_STATUSES$1.has(status);
|
|
56
|
+
}
|
|
57
|
+
function isPendingStatus(status) {
|
|
58
|
+
return PENDING_STATUSES.has(status);
|
|
59
|
+
}
|
|
60
|
+
function isProcessedStatus(status) {
|
|
61
|
+
return !isPendingStatus(status);
|
|
62
|
+
}
|
|
63
|
+
function hasPaymentAccountAssigned(payment) {
|
|
64
|
+
return "accountId" in payment && "connectorKey" in payment && payment.accountId !== void 0 && payment.connectorKey !== void 0;
|
|
65
|
+
}
|
|
66
|
+
function isPaymentCompleted(payment) {
|
|
67
|
+
return (payment.status === "COMPLETED" || payment.status === "BOOKED" || payment.status === "SETTLED" || payment.status === "REJECTED" || payment.status === "CLOSED") && "bankRefId" in payment && typeof payment.bankRefId === "string";
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const TERMINAL_STATUSES = PAYMENT_REQUEST_STATUSES.filter(isTerminalStatus);
|
|
71
|
+
const getNonTerminalPaymentRequestsQuery = (db) => db.select().from(tables.paymentRequest).where(
|
|
72
|
+
and(
|
|
73
|
+
not(inArray(tables.paymentRequest.status, TERMINAL_STATUSES)),
|
|
74
|
+
isNull(tables.paymentRequest.deletedAt)
|
|
75
|
+
)
|
|
76
|
+
);
|
|
77
|
+
|
|
45
78
|
const CONNECTOR_KEYS = [
|
|
46
79
|
"ERSTE",
|
|
47
80
|
"FINBRICKS",
|
|
@@ -269,4 +302,18 @@ const paymentRequestRelations = relations(paymentRequest, ({ one }) => ({
|
|
|
269
302
|
})
|
|
270
303
|
}));
|
|
271
304
|
|
|
272
|
-
|
|
305
|
+
const schema = {
|
|
306
|
+
__proto__: null,
|
|
307
|
+
account: account,
|
|
308
|
+
accountCredentials: accountCredentials,
|
|
309
|
+
batch: batch,
|
|
310
|
+
ott: ott,
|
|
311
|
+
payment: payment,
|
|
312
|
+
paymentRelations: paymentRelations,
|
|
313
|
+
paymentRequest: paymentRequest,
|
|
314
|
+
paymentRequestRelations: paymentRequestRelations
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
const tables = schema;
|
|
318
|
+
|
|
319
|
+
export { ACCOUNT_STATUSES as A, BATCH_MODES as B, CHARGE_BEARERS as C, ott as D, payment as E, paymentRelations as F, paymentRequest as G, paymentRequestRelations as H, INSTRUCTION_PRIORITIES as I, PAYMENT_DIRECTIONS as P, TOKEN_TYPES as T, BATCH_STATUSES as a, CONNECTOR_KEYS as b, COUNTRY_CODES as c, CREDENTIALS_TYPES as d, PAYMENT_REQUEST_STATUSES as e, PAYMENT_STATUSES as f, PAYMENT_TYPES as g, accountCredentialsInsertSchema as h, accountCredentialsSelectSchema as i, accountCredentialsUpdateSchema as j, accountInsertSchema as k, accountSelectSchema as l, accountUpdateSchema as m, hasPaymentAccountAssigned as n, isPaymentCompleted as o, isPendingStatus as p, isProcessedStatus as q, isTerminalStatus as r, ottInsertSchema as s, ottSelectSchema as t, ottUpdateSchema as u, tables as v, getNonTerminalPaymentRequestsQuery as w, account as x, accountCredentials as y, batch as z };
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function hasPaymentAccountAssigned(payment) {
|
|
4
|
-
return "accountId" in payment && "connectorKey" in payment && payment.accountId !== void 0 && payment.connectorKey !== void 0;
|
|
5
|
-
}
|
|
6
|
-
function isPaymentCompleted(payment) {
|
|
7
|
-
return (payment.status === "COMPLETED" || payment.status === "BOOKED" || payment.status === "SETTLED" || payment.status === "REJECTED" || payment.status === "CLOSED") && "bankRefId" in payment && typeof payment.bankRefId === "string";
|
|
8
|
-
}
|
|
9
|
-
|
|
10
3
|
function isBatchInitiated(batch) {
|
|
11
4
|
return "authorizationUrls" in batch && batch.authorizationUrls !== null && batch.authorizationUrls !== void 0 && batch.authorizationUrls.length > 0;
|
|
12
5
|
}
|
|
@@ -26,11 +19,9 @@ function isBatchFailed(batch) {
|
|
|
26
19
|
return "status" in batch && batch.status === "FAILED";
|
|
27
20
|
}
|
|
28
21
|
|
|
29
|
-
exports.hasPaymentAccountAssigned = hasPaymentAccountAssigned;
|
|
30
22
|
exports.isBatchAuthorized = isBatchAuthorized;
|
|
31
23
|
exports.isBatchCompleted = isBatchCompleted;
|
|
32
24
|
exports.isBatchFailed = isBatchFailed;
|
|
33
25
|
exports.isBatchInitiated = isBatchInitiated;
|
|
34
26
|
exports.isBatchProcessing = isBatchProcessing;
|
|
35
27
|
exports.isBatchReadyToSign = isBatchReadyToSign;
|
|
36
|
-
exports.isPaymentCompleted = isPaymentCompleted;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
function hasPaymentAccountAssigned(payment) {
|
|
2
|
-
return "accountId" in payment && "connectorKey" in payment && payment.accountId !== void 0 && payment.connectorKey !== void 0;
|
|
3
|
-
}
|
|
4
|
-
function isPaymentCompleted(payment) {
|
|
5
|
-
return (payment.status === "COMPLETED" || payment.status === "BOOKED" || payment.status === "SETTLED" || payment.status === "REJECTED" || payment.status === "CLOSED") && "bankRefId" in payment && typeof payment.bankRefId === "string";
|
|
6
|
-
}
|
|
7
|
-
|
|
8
1
|
function isBatchInitiated(batch) {
|
|
9
2
|
return "authorizationUrls" in batch && batch.authorizationUrls !== null && batch.authorizationUrls !== void 0 && batch.authorizationUrls.length > 0;
|
|
10
3
|
}
|
|
@@ -24,4 +17,4 @@ function isBatchFailed(batch) {
|
|
|
24
17
|
return "status" in batch && batch.status === "FAILED";
|
|
25
18
|
}
|
|
26
19
|
|
|
27
|
-
export { isBatchCompleted as a, isBatchFailed as b, isBatchInitiated as c, isBatchProcessing as d, isBatchReadyToSign as e,
|
|
20
|
+
export { isBatchCompleted as a, isBatchFailed as b, isBatchInitiated as c, isBatchProcessing as d, isBatchReadyToSign as e, isBatchAuthorized as i };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as CurrencyCode, O as BankCode, $ as CountryCode,
|
|
1
|
+
import { d as CurrencyCode, O as BankCode, $ as CountryCode, P as PaymentRequestSelectType } from './bank.BOY6AI1t.mjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
|
|
@@ -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');
|
|
5
4
|
const sqliteCore = require('drizzle-orm/sqlite-core');
|
|
6
5
|
require('date-fns');
|
|
7
6
|
require('jose');
|
|
8
7
|
const generalCodes = require('@develit-io/general-codes');
|
|
9
|
-
require('drizzle-orm');
|
|
8
|
+
const relations = require('drizzle-orm/relations');
|
|
9
|
+
const drizzleOrm = require('drizzle-orm');
|
|
10
10
|
require('node:crypto');
|
|
11
11
|
const drizzleZod = require('drizzle-zod');
|
|
12
12
|
|
|
@@ -44,6 +44,39 @@ const BATCH_MODES = ["NATIVE", "SINGLE"];
|
|
|
44
44
|
const ACCOUNT_STATUSES = ["AUTHORIZED", "DISABLED", "EXPIRED"];
|
|
45
45
|
const COUNTRY_CODES = generalCodes.COUNTRY_CODES_2;
|
|
46
46
|
|
|
47
|
+
const TERMINAL_STATUSES$1 = /* @__PURE__ */ new Set([
|
|
48
|
+
"SETTLED",
|
|
49
|
+
"REJECTED",
|
|
50
|
+
"CLOSED"
|
|
51
|
+
]);
|
|
52
|
+
const PENDING_STATUSES = /* @__PURE__ */ new Set([
|
|
53
|
+
"OPENED",
|
|
54
|
+
"AUTHORIZED"
|
|
55
|
+
]);
|
|
56
|
+
function isTerminalStatus(status) {
|
|
57
|
+
return TERMINAL_STATUSES$1.has(status);
|
|
58
|
+
}
|
|
59
|
+
function isPendingStatus(status) {
|
|
60
|
+
return PENDING_STATUSES.has(status);
|
|
61
|
+
}
|
|
62
|
+
function isProcessedStatus(status) {
|
|
63
|
+
return !isPendingStatus(status);
|
|
64
|
+
}
|
|
65
|
+
function hasPaymentAccountAssigned(payment) {
|
|
66
|
+
return "accountId" in payment && "connectorKey" in payment && payment.accountId !== void 0 && payment.connectorKey !== void 0;
|
|
67
|
+
}
|
|
68
|
+
function isPaymentCompleted(payment) {
|
|
69
|
+
return (payment.status === "COMPLETED" || payment.status === "BOOKED" || payment.status === "SETTLED" || payment.status === "REJECTED" || payment.status === "CLOSED") && "bankRefId" in payment && typeof payment.bankRefId === "string";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const TERMINAL_STATUSES = PAYMENT_REQUEST_STATUSES.filter(isTerminalStatus);
|
|
73
|
+
const getNonTerminalPaymentRequestsQuery = (db) => db.select().from(tables.paymentRequest).where(
|
|
74
|
+
drizzleOrm.and(
|
|
75
|
+
drizzleOrm.not(drizzleOrm.inArray(tables.paymentRequest.status, TERMINAL_STATUSES)),
|
|
76
|
+
drizzleOrm.isNull(tables.paymentRequest.deletedAt)
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
|
|
47
80
|
const CONNECTOR_KEYS = [
|
|
48
81
|
"ERSTE",
|
|
49
82
|
"FINBRICKS",
|
|
@@ -271,6 +304,20 @@ const paymentRequestRelations = relations.relations(paymentRequest, ({ one }) =>
|
|
|
271
304
|
})
|
|
272
305
|
}));
|
|
273
306
|
|
|
307
|
+
const schema = {
|
|
308
|
+
__proto__: null,
|
|
309
|
+
account: account,
|
|
310
|
+
accountCredentials: accountCredentials,
|
|
311
|
+
batch: batch,
|
|
312
|
+
ott: ott,
|
|
313
|
+
payment: payment,
|
|
314
|
+
paymentRelations: paymentRelations,
|
|
315
|
+
paymentRequest: paymentRequest,
|
|
316
|
+
paymentRequestRelations: paymentRequestRelations
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
const tables = schema;
|
|
320
|
+
|
|
274
321
|
exports.ACCOUNT_STATUSES = ACCOUNT_STATUSES;
|
|
275
322
|
exports.BATCH_MODES = BATCH_MODES;
|
|
276
323
|
exports.BATCH_STATUSES = BATCH_STATUSES;
|
|
@@ -293,6 +340,12 @@ exports.accountInsertSchema = accountInsertSchema;
|
|
|
293
340
|
exports.accountSelectSchema = accountSelectSchema;
|
|
294
341
|
exports.accountUpdateSchema = accountUpdateSchema;
|
|
295
342
|
exports.batch = batch;
|
|
343
|
+
exports.getNonTerminalPaymentRequestsQuery = getNonTerminalPaymentRequestsQuery;
|
|
344
|
+
exports.hasPaymentAccountAssigned = hasPaymentAccountAssigned;
|
|
345
|
+
exports.isPaymentCompleted = isPaymentCompleted;
|
|
346
|
+
exports.isPendingStatus = isPendingStatus;
|
|
347
|
+
exports.isProcessedStatus = isProcessedStatus;
|
|
348
|
+
exports.isTerminalStatus = isTerminalStatus;
|
|
296
349
|
exports.ott = ott;
|
|
297
350
|
exports.ottInsertSchema = ottInsertSchema;
|
|
298
351
|
exports.ottSelectSchema = ottSelectSchema;
|
|
@@ -301,3 +354,4 @@ exports.payment = payment;
|
|
|
301
354
|
exports.paymentRelations = paymentRelations;
|
|
302
355
|
exports.paymentRequest = paymentRequest;
|
|
303
356
|
exports.paymentRequestRelations = paymentRequestRelations;
|
|
357
|
+
exports.tables = tables;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const drizzleOrm = require('drizzle-orm');
|
|
4
|
+
const database_schema = require('./bank.o95cOH_P.cjs');
|
|
4
5
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
5
|
-
require('./bank.BBXoZ5QU.cjs');
|
|
6
6
|
require('date-fns');
|
|
7
7
|
require('jose');
|
|
8
8
|
require('@develit-io/general-codes');
|
|
9
9
|
const node_crypto = require('node:crypto');
|
|
10
|
-
const database_schema = require('./bank.CVi6R7fr.cjs');
|
|
11
10
|
|
|
12
11
|
const createPaymentCommand = (db, { payment }) => {
|
|
13
12
|
return {
|
|
14
|
-
command: db.insert(tables.payment).values({
|
|
13
|
+
command: db.insert(database_schema.tables.payment).values({
|
|
15
14
|
...payment,
|
|
16
15
|
creditorIban: payment.creditor.iban,
|
|
17
16
|
debtorIban: payment.debtor.iban
|
|
18
17
|
}).onConflictDoUpdate({
|
|
19
18
|
// Unique index: (connector_key, bank_ref_id)
|
|
20
|
-
target: [tables.payment.connectorKey, tables.payment.bankRefId],
|
|
19
|
+
target: [database_schema.tables.payment.connectorKey, database_schema.tables.payment.bankRefId],
|
|
21
20
|
set: {
|
|
22
21
|
status: drizzleOrm.sql`excluded.status`,
|
|
23
22
|
statusReason: drizzleOrm.sql`excluded.status_reason`,
|
|
@@ -34,11 +33,11 @@ const createPaymentCommand = (db, { payment }) => {
|
|
|
34
33
|
|
|
35
34
|
const upsertBatchCommand = (db, { batch }) => {
|
|
36
35
|
const id = batch.id || backendSdk.uuidv4();
|
|
37
|
-
const command = db.insert(tables.batch).values({
|
|
36
|
+
const command = db.insert(database_schema.tables.batch).values({
|
|
38
37
|
...batch,
|
|
39
38
|
id
|
|
40
39
|
}).onConflictDoUpdate({
|
|
41
|
-
target: tables.batch.id,
|
|
40
|
+
target: database_schema.tables.batch.id,
|
|
42
41
|
set: {
|
|
43
42
|
...batch
|
|
44
43
|
}
|
|
@@ -52,25 +51,25 @@ const upsertBatchCommand = (db, { batch }) => {
|
|
|
52
51
|
const updatePaymentRequestStatusCommand = (db, values) => {
|
|
53
52
|
const { id, ...set } = values;
|
|
54
53
|
return {
|
|
55
|
-
command: db.update(tables.paymentRequest).set(set).where(
|
|
54
|
+
command: db.update(database_schema.tables.paymentRequest).set(set).where(
|
|
56
55
|
drizzleOrm.and(
|
|
57
|
-
drizzleOrm.eq(tables.paymentRequest.id, id),
|
|
58
|
-
drizzleOrm.isNull(tables.paymentRequest.deletedAt)
|
|
56
|
+
drizzleOrm.eq(database_schema.tables.paymentRequest.id, id),
|
|
57
|
+
drizzleOrm.isNull(database_schema.tables.paymentRequest.deletedAt)
|
|
59
58
|
)
|
|
60
59
|
).returning()
|
|
61
60
|
};
|
|
62
61
|
};
|
|
63
62
|
|
|
64
63
|
const getAccountByIdQuery = async (db, { accountId }) => {
|
|
65
|
-
return await db.select().from(tables.account).where(drizzleOrm.eq(tables.account.id, accountId)).get();
|
|
64
|
+
return await db.select().from(database_schema.tables.account).where(drizzleOrm.eq(database_schema.tables.account.id, accountId)).get();
|
|
66
65
|
};
|
|
67
66
|
|
|
68
67
|
const getBatchByIdQuery = async (db, { batchId }) => {
|
|
69
|
-
return await db.select().from(tables.batch).where(drizzleOrm.eq(tables.batch.id, batchId)).get();
|
|
68
|
+
return await db.select().from(database_schema.tables.batch).where(drizzleOrm.eq(database_schema.tables.batch.id, batchId)).get();
|
|
70
69
|
};
|
|
71
70
|
|
|
72
71
|
const getCredentialsByAccountId = async (db, encryptionKey, { accountId }) => {
|
|
73
|
-
const cred = await db.select().from(tables.accountCredentials).where(drizzleOrm.eq(tables.accountCredentials.accountId, accountId)).get();
|
|
72
|
+
const cred = await db.select().from(database_schema.tables.accountCredentials).where(drizzleOrm.eq(database_schema.tables.accountCredentials.accountId, accountId)).get();
|
|
74
73
|
return cred ? {
|
|
75
74
|
...cred,
|
|
76
75
|
value: await decrypt(cred.value, encryptionKey)
|
|
@@ -78,10 +77,10 @@ const getCredentialsByAccountId = async (db, encryptionKey, { accountId }) => {
|
|
|
78
77
|
};
|
|
79
78
|
|
|
80
79
|
const getPaymentRequestsByBatchIdQuery = async (db, { batchId }) => {
|
|
81
|
-
return await db.select().from(tables.paymentRequest).where(
|
|
80
|
+
return await db.select().from(database_schema.tables.paymentRequest).where(
|
|
82
81
|
drizzleOrm.and(
|
|
83
|
-
drizzleOrm.eq(tables.paymentRequest.batchId, batchId),
|
|
84
|
-
drizzleOrm.isNull(tables.paymentRequest.deletedAt)
|
|
82
|
+
drizzleOrm.eq(database_schema.tables.paymentRequest.batchId, batchId),
|
|
83
|
+
drizzleOrm.isNull(database_schema.tables.paymentRequest.deletedAt)
|
|
85
84
|
)
|
|
86
85
|
);
|
|
87
86
|
};
|
|
@@ -144,8 +143,6 @@ const createCredentialsResolver = async (db, env) => {
|
|
|
144
143
|
return (accountId) => getCredentialsByAccountId(db, encryptionKey, { accountId });
|
|
145
144
|
};
|
|
146
145
|
|
|
147
|
-
const tables = database_schema.schema;
|
|
148
|
-
|
|
149
146
|
exports.checksum = checksum;
|
|
150
147
|
exports.createCredentialsResolver = createCredentialsResolver;
|
|
151
148
|
exports.createPaymentCommand = createPaymentCommand;
|
|
@@ -154,6 +151,5 @@ exports.getAccountByIdQuery = getAccountByIdQuery;
|
|
|
154
151
|
exports.getBatchByIdQuery = getBatchByIdQuery;
|
|
155
152
|
exports.getPaymentRequestsByBatchIdQuery = getPaymentRequestsByBatchIdQuery;
|
|
156
153
|
exports.importAesKey = importAesKey;
|
|
157
|
-
exports.tables = tables;
|
|
158
154
|
exports.updatePaymentRequestStatusCommand = updatePaymentRequestStatusCommand;
|
|
159
155
|
exports.upsertBatchCommand = upsertBatchCommand;
|
package/dist/types.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const mock_connector = require('./shared/bank.
|
|
4
|
-
const
|
|
5
|
-
const batchLifecycle = require('./shared/bank.
|
|
3
|
+
const mock_connector = require('./shared/bank.DWsHTK_n.cjs');
|
|
4
|
+
const database_schema = require('./shared/bank.o95cOH_P.cjs');
|
|
5
|
+
const batchLifecycle = require('./shared/bank.NF8bZBy0.cjs');
|
|
6
6
|
const generalCodes = require('@develit-io/general-codes');
|
|
7
7
|
require('@develit-io/backend-sdk');
|
|
8
8
|
require('date-fns');
|
|
9
9
|
require('drizzle-orm');
|
|
10
10
|
require('jose');
|
|
11
11
|
require('node:crypto');
|
|
12
|
-
require('drizzle-orm/relations');
|
|
13
12
|
require('drizzle-orm/sqlite-core');
|
|
13
|
+
require('drizzle-orm/relations');
|
|
14
14
|
require('drizzle-zod');
|
|
15
15
|
|
|
16
16
|
|
|
@@ -34,36 +34,39 @@ exports.toIncomingPayment = mock_connector.toIncomingPayment;
|
|
|
34
34
|
exports.toPaymentRequestInsert = mock_connector.toPaymentRequestInsert;
|
|
35
35
|
exports.toPreparedPayment = mock_connector.toPreparedPayment;
|
|
36
36
|
exports.useFinbricksFetch = mock_connector.useFinbricksFetch;
|
|
37
|
-
exports.ACCOUNT_STATUSES =
|
|
38
|
-
exports.BATCH_MODES =
|
|
39
|
-
exports.BATCH_STATUES =
|
|
40
|
-
exports.BATCH_STATUSES =
|
|
41
|
-
exports.CHARGE_BEARERS =
|
|
42
|
-
exports.CONNECTOR_KEYS =
|
|
43
|
-
exports.COUNTRY_CODES =
|
|
44
|
-
exports.CREDENTIALS_TYPES =
|
|
45
|
-
exports.INSTRUCTION_PRIORITIES =
|
|
46
|
-
exports.PAYMENT_DIRECTIONS =
|
|
47
|
-
exports.PAYMENT_REQUEST_STATUSES =
|
|
48
|
-
exports.PAYMENT_STATUSES =
|
|
49
|
-
exports.PAYMENT_TYPES =
|
|
50
|
-
exports.TOKEN_TYPES =
|
|
51
|
-
exports.accountCredentialsInsertSchema =
|
|
52
|
-
exports.accountCredentialsSelectSchema =
|
|
53
|
-
exports.accountCredentialsUpdateSchema =
|
|
54
|
-
exports.accountInsertSchema =
|
|
55
|
-
exports.accountSelectSchema =
|
|
56
|
-
exports.accountUpdateSchema =
|
|
57
|
-
exports.
|
|
58
|
-
exports.
|
|
59
|
-
exports.
|
|
60
|
-
exports.
|
|
37
|
+
exports.ACCOUNT_STATUSES = database_schema.ACCOUNT_STATUSES;
|
|
38
|
+
exports.BATCH_MODES = database_schema.BATCH_MODES;
|
|
39
|
+
exports.BATCH_STATUES = database_schema.BATCH_STATUSES;
|
|
40
|
+
exports.BATCH_STATUSES = database_schema.BATCH_STATUSES;
|
|
41
|
+
exports.CHARGE_BEARERS = database_schema.CHARGE_BEARERS;
|
|
42
|
+
exports.CONNECTOR_KEYS = database_schema.CONNECTOR_KEYS;
|
|
43
|
+
exports.COUNTRY_CODES = database_schema.COUNTRY_CODES;
|
|
44
|
+
exports.CREDENTIALS_TYPES = database_schema.CREDENTIALS_TYPES;
|
|
45
|
+
exports.INSTRUCTION_PRIORITIES = database_schema.INSTRUCTION_PRIORITIES;
|
|
46
|
+
exports.PAYMENT_DIRECTIONS = database_schema.PAYMENT_DIRECTIONS;
|
|
47
|
+
exports.PAYMENT_REQUEST_STATUSES = database_schema.PAYMENT_REQUEST_STATUSES;
|
|
48
|
+
exports.PAYMENT_STATUSES = database_schema.PAYMENT_STATUSES;
|
|
49
|
+
exports.PAYMENT_TYPES = database_schema.PAYMENT_TYPES;
|
|
50
|
+
exports.TOKEN_TYPES = database_schema.TOKEN_TYPES;
|
|
51
|
+
exports.accountCredentialsInsertSchema = database_schema.accountCredentialsInsertSchema;
|
|
52
|
+
exports.accountCredentialsSelectSchema = database_schema.accountCredentialsSelectSchema;
|
|
53
|
+
exports.accountCredentialsUpdateSchema = database_schema.accountCredentialsUpdateSchema;
|
|
54
|
+
exports.accountInsertSchema = database_schema.accountInsertSchema;
|
|
55
|
+
exports.accountSelectSchema = database_schema.accountSelectSchema;
|
|
56
|
+
exports.accountUpdateSchema = database_schema.accountUpdateSchema;
|
|
57
|
+
exports.hasPaymentAccountAssigned = database_schema.hasPaymentAccountAssigned;
|
|
58
|
+
exports.isPaymentCompleted = database_schema.isPaymentCompleted;
|
|
59
|
+
exports.isPendingStatus = database_schema.isPendingStatus;
|
|
60
|
+
exports.isProcessedStatus = database_schema.isProcessedStatus;
|
|
61
|
+
exports.isTerminalStatus = database_schema.isTerminalStatus;
|
|
62
|
+
exports.ottInsertSchema = database_schema.ottInsertSchema;
|
|
63
|
+
exports.ottSelectSchema = database_schema.ottSelectSchema;
|
|
64
|
+
exports.ottUpdateSchema = database_schema.ottUpdateSchema;
|
|
61
65
|
exports.isBatchAuthorized = batchLifecycle.isBatchAuthorized;
|
|
62
66
|
exports.isBatchCompleted = batchLifecycle.isBatchCompleted;
|
|
63
67
|
exports.isBatchFailed = batchLifecycle.isBatchFailed;
|
|
64
68
|
exports.isBatchInitiated = batchLifecycle.isBatchInitiated;
|
|
65
69
|
exports.isBatchProcessing = batchLifecycle.isBatchProcessing;
|
|
66
70
|
exports.isBatchReadyToSign = batchLifecycle.isBatchReadyToSign;
|
|
67
|
-
exports.isPaymentCompleted = batchLifecycle.isPaymentCompleted;
|
|
68
71
|
exports.BANK_CODES = generalCodes.BANK_CODES;
|
|
69
72
|
exports.CURRENCY_CODES = generalCodes.CURRENCY_CODES;
|
package/dist/types.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency,
|
|
2
|
-
export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted } from './shared/bank.
|
|
3
|
-
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.
|
|
4
|
-
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, s as AccountAssignedPayment, u as PreparedPayment, v as CompletedPayment, w as PaymentRequestInsertType } from './shared/bank.BOY6AI1t.cjs';
|
|
2
|
+
export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted, aw as isPendingStatus, ax as isProcessedStatus, ay as isTerminalStatus } from './shared/bank.BOY6AI1t.cjs';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.Bo01T_MM.cjs';
|
|
4
|
+
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.Bo01T_MM.cjs';
|
|
5
5
|
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.DMjtitKo.cjs';
|
|
6
6
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_zod from 'drizzle-zod';
|
package/dist/types.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency,
|
|
2
|
-
export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted } from './shared/bank.
|
|
3
|
-
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.
|
|
4
|
-
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, s as AccountAssignedPayment, u as PreparedPayment, v as CompletedPayment, w as PaymentRequestInsertType } from './shared/bank.BOY6AI1t.mjs';
|
|
2
|
+
export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted, aw as isPendingStatus, ax as isProcessedStatus, ay as isTerminalStatus } from './shared/bank.BOY6AI1t.mjs';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.jRGa7MKk.mjs';
|
|
4
|
+
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.jRGa7MKk.mjs';
|
|
5
5
|
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.DMjtitKo.mjs';
|
|
6
6
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_zod from 'drizzle-zod';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency,
|
|
2
|
-
export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted } from './shared/bank.
|
|
3
|
-
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.
|
|
4
|
-
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, b as ConnectorKey, f as ConnectedAccount, c as PaymentType, g as CredentialsResolver, h as AccountCredentialsInsertType, i as AccountInsertType, j as BatchedPayment, k as InitiatedBatch, l as IncomingPayment, m as InitiatedPayment, A as AccountSelectType, n as ParsedBankPayment, o as PaymentRequestStatus, p as AuthorizationCallbackResult, q as BatchMetadata, r as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, s as AccountAssignedPayment, u as PreparedPayment, v as CompletedPayment, w as PaymentRequestInsertType } from './shared/bank.BOY6AI1t.js';
|
|
2
|
+
export { x as ACCOUNT_STATUSES, y as AccountCredentialsPatchType, z as AccountCredentialsSelectType, D as AccountCredentialsUpdateType, E as AccountPatchType, F as AccountStatus, G as AccountUpdateType, J as AuthorizedBatch, K as BATCH_MODES, M as BATCH_STATUES, M as BATCH_STATUSES, N as BankAccountWithLastSync, O as BankCode, Q as BatchInsertType, R as BatchLifecycle, S as BatchMode, T as BatchPayment, B as BatchSelectType, U as BatchStatus, V as CHARGE_BEARERS, W as CONNECTOR_KEYS, X as COUNTRY_CODES, Y as CREDENTIALS_TYPES, Z as ChargeBearer, _ as CompletedBatch, C as ConfigEnvironmentBank, $ as CountryCode, a0 as CredentialsType, d as CurrencyCode, a1 as INSTRUCTION_PRIORITIES, a2 as InstructionPriority, L as LastSyncMetadata, a3 as PAYMENT_DIRECTIONS, a4 as PAYMENT_REQUEST_STATUSES, a5 as PAYMENT_STATUSES, a6 as PAYMENT_TYPES, a7 as PaymentDirection, a8 as PaymentFailedInsertType, a9 as PaymentInsertType, aa as PaymentLifecycle, ab as PaymentPreparedInsertType, ac as PaymentStatus, ad as ProcessingBatch, ae as ReadyToSignBatch, af as ResolvedCredentials, ag as TOKEN_TYPES, ah as TokenType, ai as accountCredentialsInsertSchema, aj as accountCredentialsSelectSchema, ak as accountCredentialsUpdateSchema, al as accountInsertSchema, am as accountSelectSchema, an as accountUpdateSchema, ao as hasPaymentAccountAssigned, ap as isBatchAuthorized, aq as isBatchCompleted, ar as isBatchFailed, as as isBatchInitiated, at as isBatchProcessing, au as isBatchReadyToSign, av as isPaymentCompleted, aw as isPendingStatus, ax as isProcessedStatus, ay as isTerminalStatus } from './shared/bank.BOY6AI1t.js';
|
|
3
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.DfTdMAi9.js';
|
|
4
|
+
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.DfTdMAi9.js';
|
|
5
5
|
export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.DMjtitKo.js';
|
|
6
6
|
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_zod from 'drizzle-zod';
|