@develit-services/bank 0.3.43 → 0.3.45
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 +4 -4
- 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 +4 -4
- package/dist/export/worker.cjs +166 -183
- package/dist/export/worker.d.cts +43 -22
- package/dist/export/worker.d.mts +43 -22
- package/dist/export/worker.d.ts +43 -22
- package/dist/export/worker.mjs +126 -143
- package/dist/export/workflows.cjs +214 -18
- package/dist/export/workflows.mjs +207 -12
- package/dist/export/wrangler.d.cts +1 -2
- package/dist/export/wrangler.d.mts +1 -2
- package/dist/export/wrangler.d.ts +1 -2
- package/dist/shared/{bank.YiArmBW2.mjs → bank.B1Gpn3ht.mjs} +12 -174
- package/dist/shared/{bank.xrXNjWCo.d.cts → bank.BEL1HIxZ.d.cts} +21 -1
- package/dist/shared/{bank.xrXNjWCo.d.mts → bank.BEL1HIxZ.d.mts} +21 -1
- package/dist/shared/{bank.xrXNjWCo.d.ts → bank.BEL1HIxZ.d.ts} +21 -1
- package/dist/shared/bank.BUEmFxS8.mjs +174 -0
- package/dist/shared/{bank.CLF9wee9.cjs → bank.CPYfE-Ei.cjs} +12 -199
- package/dist/shared/bank.CpwLFudl.cjs +198 -0
- package/dist/shared/bank.D-3fzX63.mjs +170 -0
- package/dist/shared/bank.D0a-MZon.cjs +184 -0
- package/dist/shared/{bank.BchnXQDL.d.cts → bank.Dh_H_5rC.d.cts} +0 -1
- package/dist/shared/{bank.BchnXQDL.d.mts → bank.Dh_H_5rC.d.mts} +0 -1
- package/dist/shared/{bank.BchnXQDL.d.ts → bank.Dh_H_5rC.d.ts} +0 -1
- package/dist/types.cjs +14 -14
- package/dist/types.d.cts +9 -9
- package/dist/types.d.mts +9 -9
- package/dist/types.d.ts +9 -9
- package/dist/types.mjs +5 -5
- package/package.json +1 -1
- package/dist/shared/bank.CNtiZSem.mjs +0 -9
- package/dist/shared/bank.CUU0Daxj.mjs +0 -391
- package/dist/shared/bank.ChffLgyT.cjs +0 -401
- package/dist/shared/bank.DfE0M5H3.cjs +0 -11
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { bankAccount, base } from '@develit-io/backend-sdk';
|
|
2
|
+
import { sqliteTable, text, integer, unique, real } from 'drizzle-orm/sqlite-core';
|
|
3
|
+
import 'date-fns';
|
|
4
|
+
import { relations } from 'drizzle-orm/relations';
|
|
5
|
+
import { COUNTRY_CODES_2, BANK_CODES } from '@develit-io/general-codes';
|
|
6
|
+
import 'drizzle-orm';
|
|
7
|
+
import 'jose';
|
|
8
|
+
import 'node:crypto';
|
|
9
|
+
import { createInsertSchema, createUpdateSchema, createSelectSchema } from 'drizzle-zod';
|
|
10
|
+
|
|
11
|
+
const PAYMENT_TYPES = ["SEPA", "SWIFT", "DOMESTIC", "UNKNOWN"];
|
|
12
|
+
const CHARGE_BEARERS = ["SHA", "OUR", "BEN"];
|
|
13
|
+
const INSTRUCTION_PRIORITIES = ["NORM", "HIGH", "INST"];
|
|
14
|
+
const PAYMENT_STATUSES = [
|
|
15
|
+
"PREPARED",
|
|
16
|
+
"INITIALIZED",
|
|
17
|
+
"FAILED",
|
|
18
|
+
"PENDING",
|
|
19
|
+
"COMPLETED",
|
|
20
|
+
"CREATED"
|
|
21
|
+
];
|
|
22
|
+
const PAYMENT_DIRECTIONS = ["INCOMING", "OUTGOING"];
|
|
23
|
+
const BATCH_STATUSES = [
|
|
24
|
+
"OPEN",
|
|
25
|
+
"FULL",
|
|
26
|
+
"PROCESSING",
|
|
27
|
+
"READY_TO_SIGN",
|
|
28
|
+
"SIGNED",
|
|
29
|
+
"SIGNATURE_FAILED",
|
|
30
|
+
"FAILED"
|
|
31
|
+
];
|
|
32
|
+
const ACCOUNT_STATUSES = ["AUTHORIZED", "DISABLED", "EXPIRED"];
|
|
33
|
+
const COUNTRY_CODES = COUNTRY_CODES_2;
|
|
34
|
+
|
|
35
|
+
const CONNECTOR_KEYS = [
|
|
36
|
+
"ERSTE",
|
|
37
|
+
"FINBRICKS",
|
|
38
|
+
"MOCK",
|
|
39
|
+
"CREDITAS",
|
|
40
|
+
"MOCK_COBS",
|
|
41
|
+
"FIO",
|
|
42
|
+
"MONETA"
|
|
43
|
+
];
|
|
44
|
+
const CREDENTIALS_TYPES = [
|
|
45
|
+
"AUTH_TOKEN",
|
|
46
|
+
"REFRESH_TOKEN",
|
|
47
|
+
"CLIENT_ID",
|
|
48
|
+
"API_KEY"
|
|
49
|
+
];
|
|
50
|
+
const TOKEN_TYPES = ["ACCOUNT_AUTHORIZATION"];
|
|
51
|
+
|
|
52
|
+
const account = sqliteTable(
|
|
53
|
+
"account",
|
|
54
|
+
{
|
|
55
|
+
...base,
|
|
56
|
+
...bankAccount,
|
|
57
|
+
number: text("number").notNull(),
|
|
58
|
+
name: text("name"),
|
|
59
|
+
iban: text("iban").notNull(),
|
|
60
|
+
bankCode: text("bank_code", { enum: BANK_CODES }).notNull(),
|
|
61
|
+
connectorKey: text("connector_key", {
|
|
62
|
+
enum: CONNECTOR_KEYS
|
|
63
|
+
}).$type().notNull(),
|
|
64
|
+
status: text("status", { enum: ACCOUNT_STATUSES }).$type().notNull(),
|
|
65
|
+
bankRefId: text("bank_ref_id").notNull(),
|
|
66
|
+
batchSizeLimit: integer("batch_size_limit").notNull().default(50),
|
|
67
|
+
syncIntervalS: integer("sync_interval_s").notNull().default(600),
|
|
68
|
+
lastSyncAt: integer("last_sync_at", { mode: "timestamp_ms" }),
|
|
69
|
+
lastSyncMetadata: text("last_sync_metadata", {
|
|
70
|
+
mode: "json"
|
|
71
|
+
}).$type()
|
|
72
|
+
},
|
|
73
|
+
(t) => [unique().on(t.iban)]
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const accountInsertSchema = createInsertSchema(account);
|
|
77
|
+
const accountUpdateSchema = createUpdateSchema(account);
|
|
78
|
+
const accountSelectSchema = createSelectSchema(account);
|
|
79
|
+
|
|
80
|
+
const accountCredentials = sqliteTable("account_credentials", {
|
|
81
|
+
...base,
|
|
82
|
+
accountId: text("account_id").references(() => account.id).notNull(),
|
|
83
|
+
connectorKey: text("connector_key", {
|
|
84
|
+
enum: CONNECTOR_KEYS
|
|
85
|
+
}).$type().notNull(),
|
|
86
|
+
type: text("type", {
|
|
87
|
+
enum: CREDENTIALS_TYPES
|
|
88
|
+
}).$type().notNull(),
|
|
89
|
+
value: text("value").notNull(),
|
|
90
|
+
expiresAt: integer("expires_at", { mode: "timestamp_ms" }).notNull()
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const accountCredentialsInsertSchema = createInsertSchema(accountCredentials);
|
|
94
|
+
const accountCredentialsUpdateSchema = createUpdateSchema(accountCredentials);
|
|
95
|
+
const accountCredentialsSelectSchema = createSelectSchema(accountCredentials);
|
|
96
|
+
|
|
97
|
+
const ott = sqliteTable("ott", {
|
|
98
|
+
...base,
|
|
99
|
+
oneTimeToken: text("one_time_token").notNull(),
|
|
100
|
+
refId: text("ref_id").notNull(),
|
|
101
|
+
tokenType: text("token_type", { enum: TOKEN_TYPES }).$type().notNull(),
|
|
102
|
+
expiresAt: integer("expires_at", { mode: "timestamp_ms" }).notNull()
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const ottInsertSchema = createInsertSchema(ott);
|
|
106
|
+
const ottUpdateSchema = createUpdateSchema(ott);
|
|
107
|
+
const ottSelectSchema = createSelectSchema(ott);
|
|
108
|
+
|
|
109
|
+
const batch = sqliteTable("batch", {
|
|
110
|
+
...base,
|
|
111
|
+
batchPaymentInitiatedAt: integer("batch_payment_initiated_at", {
|
|
112
|
+
mode: "timestamp_ms"
|
|
113
|
+
}),
|
|
114
|
+
authorizationUrls: text("authorization_urls", { mode: "json" }).$type(),
|
|
115
|
+
accountId: text("account_id").references(() => account.id),
|
|
116
|
+
status: text("status", { enum: BATCH_STATUSES }).$type(),
|
|
117
|
+
statusReason: text("status_reason"),
|
|
118
|
+
payments: text("payments", { mode: "json" }).$type().notNull(),
|
|
119
|
+
metadata: text("metadata", { mode: "json" }).$type(),
|
|
120
|
+
paymentsChecksum: text("payments_checksum")
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
const payment = sqliteTable(
|
|
124
|
+
"payment",
|
|
125
|
+
{
|
|
126
|
+
...base,
|
|
127
|
+
correlationId: text("correlation_id").notNull(),
|
|
128
|
+
refId: text("ref_id"),
|
|
129
|
+
bankRefId: text("bank_ref_id").notNull(),
|
|
130
|
+
accountId: text("account_id").references(() => account.id).notNull(),
|
|
131
|
+
connectorKey: text("connector_key", { enum: CONNECTOR_KEYS }).$type().notNull(),
|
|
132
|
+
amount: real("amount").notNull(),
|
|
133
|
+
direction: text("direction").$type().notNull(),
|
|
134
|
+
paymentType: text("payment_type").$type().notNull(),
|
|
135
|
+
currency: text("currency").$type().notNull(),
|
|
136
|
+
status: text("status").$type().notNull(),
|
|
137
|
+
statusReason: text("status_reason"),
|
|
138
|
+
batchId: text("bank_execution_batch_id"),
|
|
139
|
+
initiatedAt: integer("initiated_at", {
|
|
140
|
+
mode: "timestamp_ms"
|
|
141
|
+
}),
|
|
142
|
+
vs: text("vs"),
|
|
143
|
+
ss: text("ss"),
|
|
144
|
+
ks: text("ks"),
|
|
145
|
+
message: text("message"),
|
|
146
|
+
processedAt: integer("processed_at", {
|
|
147
|
+
mode: "timestamp_ms"
|
|
148
|
+
}),
|
|
149
|
+
creditor: text("creditor", { mode: "json" }).$type().notNull(),
|
|
150
|
+
creditorIban: text("creditor_iban"),
|
|
151
|
+
debtor: text("debtor", { mode: "json" }).$type().notNull(),
|
|
152
|
+
debtorIban: text("debtor_iban")
|
|
153
|
+
},
|
|
154
|
+
(t) => [unique().on(t.connectorKey, t.bankRefId)]
|
|
155
|
+
);
|
|
156
|
+
const paymentRelations = relations(payment, ({ one }) => ({
|
|
157
|
+
batch: one(batch, { fields: [payment.batchId], references: [batch.id] })
|
|
158
|
+
}));
|
|
159
|
+
|
|
160
|
+
const schema = {
|
|
161
|
+
__proto__: null,
|
|
162
|
+
account: account,
|
|
163
|
+
accountCredentials: accountCredentials,
|
|
164
|
+
batch: batch,
|
|
165
|
+
ott: ott,
|
|
166
|
+
payment: payment,
|
|
167
|
+
paymentRelations: paymentRelations
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export { ACCOUNT_STATUSES as A, BATCH_STATUSES as B, CHARGE_BEARERS as C, INSTRUCTION_PRIORITIES as I, PAYMENT_TYPES as P, TOKEN_TYPES as T, PAYMENT_STATUSES as a, PAYMENT_DIRECTIONS as b, COUNTRY_CODES as c, CONNECTOR_KEYS as d, CREDENTIALS_TYPES as e, accountInsertSchema as f, accountUpdateSchema as g, accountSelectSchema as h, accountCredentialsInsertSchema as i, accountCredentialsUpdateSchema as j, accountCredentialsSelectSchema as k, ottUpdateSchema as l, ottSelectSchema as m, batch as n, ottInsertSchema as o, payment as p, paymentRelations as q, ott as r, schema as s, account as t, accountCredentials as u };
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const drizzle = require('./bank.CPYfE-Ei.cjs');
|
|
4
|
+
const backendSdk = require('@develit-io/backend-sdk');
|
|
5
|
+
const drizzleOrm = require('drizzle-orm');
|
|
6
|
+
require('date-fns');
|
|
7
|
+
require('jose');
|
|
8
|
+
require('@develit-io/general-codes');
|
|
9
|
+
require('./bank.CpwLFudl.cjs');
|
|
10
|
+
const node_crypto = require('node:crypto');
|
|
11
|
+
|
|
12
|
+
const createPaymentCommand = (db, { payment }) => {
|
|
13
|
+
return {
|
|
14
|
+
command: db.insert(drizzle.tables.payment).values({
|
|
15
|
+
...payment,
|
|
16
|
+
creditorIban: payment.creditor.iban,
|
|
17
|
+
debtorIban: payment.debtor.iban
|
|
18
|
+
}).returning()
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const upsertBatchCommand = (db, { batch }) => {
|
|
23
|
+
const id = batch.id || backendSdk.uuidv4();
|
|
24
|
+
const command = db.insert(drizzle.tables.batch).values({
|
|
25
|
+
...batch,
|
|
26
|
+
id
|
|
27
|
+
}).onConflictDoUpdate({
|
|
28
|
+
target: drizzle.tables.batch.id,
|
|
29
|
+
set: {
|
|
30
|
+
...batch
|
|
31
|
+
}
|
|
32
|
+
}).returning();
|
|
33
|
+
return {
|
|
34
|
+
id,
|
|
35
|
+
command
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const getAccountByIdQuery = async (db, { accountId }) => {
|
|
40
|
+
return await db.select().from(drizzle.tables.account).where(drizzleOrm.eq(drizzle.tables.account.id, accountId)).get();
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const getBatchByIdQuery = async (db, { batchId }) => {
|
|
44
|
+
return await db.select().from(drizzle.tables.batch).where(drizzleOrm.eq(drizzle.tables.batch.id, batchId)).get();
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const getCredentialsByAccountId = async (db, encryptionKey, { accountId }) => {
|
|
48
|
+
const cred = await db.select().from(drizzle.tables.accountCredentials).where(drizzleOrm.eq(drizzle.tables.accountCredentials.accountId, accountId)).get();
|
|
49
|
+
return cred ? {
|
|
50
|
+
...cred,
|
|
51
|
+
value: await decrypt(cred.value, encryptionKey)
|
|
52
|
+
} : void 0;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
class CreditasConnector extends drizzle.FinbricksConnector {
|
|
56
|
+
constructor(config) {
|
|
57
|
+
super("CREDITAS", config);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
class FioConnector extends drizzle.FinbricksConnector {
|
|
62
|
+
constructor(config) {
|
|
63
|
+
super("FIO", config);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
class MonetaConnector extends drizzle.FinbricksConnector {
|
|
68
|
+
constructor(config) {
|
|
69
|
+
super("MONETA", config);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const initiateConnector = ({
|
|
74
|
+
bank,
|
|
75
|
+
env,
|
|
76
|
+
connectedAccounts
|
|
77
|
+
}) => {
|
|
78
|
+
switch (bank) {
|
|
79
|
+
case "ERSTE":
|
|
80
|
+
return new drizzle.ErsteConnector({
|
|
81
|
+
API_KEY: env.ERSTE_API_KEY,
|
|
82
|
+
CLIENT_ID: env.ERSTE_CLIENT_ID,
|
|
83
|
+
CLIENT_SECRET: env.ERSTE_CLIENT_SECRET,
|
|
84
|
+
REDIRECT_URI: env.REDIRECT_URI,
|
|
85
|
+
AUTH_URI: env.ERSTE_AUTH_URI,
|
|
86
|
+
PAYMENTS_URI: env.ERSTE_PAYMENTS_URI,
|
|
87
|
+
ACCOUNTS_URI: env.ERSTE_ACCOUNTS_URI,
|
|
88
|
+
connectedAccounts
|
|
89
|
+
});
|
|
90
|
+
case "CREDITAS":
|
|
91
|
+
return new CreditasConnector({
|
|
92
|
+
BASE_URI: env.FINBRICKS_BASE_URI,
|
|
93
|
+
MERCHANT_ID: env.FINBRICKS_MERCHANT_ID,
|
|
94
|
+
PRIVATE_KEY_PEM: env.FINBRICKS_PRIVATE_KEY_PEM,
|
|
95
|
+
REDIRECT_URI: env.REDIRECT_URI,
|
|
96
|
+
connectedAccounts
|
|
97
|
+
});
|
|
98
|
+
case "MOCK_COBS":
|
|
99
|
+
return new drizzle.MockCobsConnector({
|
|
100
|
+
BASE_URI: env.FINBRICKS_BASE_URI,
|
|
101
|
+
MERCHANT_ID: env.FINBRICKS_MERCHANT_ID,
|
|
102
|
+
PRIVATE_KEY_PEM: env.FINBRICKS_PRIVATE_KEY_PEM,
|
|
103
|
+
REDIRECT_URI: env.REDIRECT_URI,
|
|
104
|
+
connectedAccounts
|
|
105
|
+
});
|
|
106
|
+
case "FIO":
|
|
107
|
+
return new FioConnector({
|
|
108
|
+
BASE_URI: env.FINBRICKS_BASE_URI,
|
|
109
|
+
MERCHANT_ID: env.FINBRICKS_MERCHANT_ID,
|
|
110
|
+
PRIVATE_KEY_PEM: env.FINBRICKS_PRIVATE_KEY_PEM,
|
|
111
|
+
REDIRECT_URI: env.REDIRECT_URI,
|
|
112
|
+
connectedAccounts
|
|
113
|
+
});
|
|
114
|
+
case "MONETA":
|
|
115
|
+
return new MonetaConnector({
|
|
116
|
+
BASE_URI: env.FINBRICKS_BASE_URI,
|
|
117
|
+
MERCHANT_ID: env.FINBRICKS_MERCHANT_ID,
|
|
118
|
+
PRIVATE_KEY_PEM: env.FINBRICKS_PRIVATE_KEY_PEM,
|
|
119
|
+
REDIRECT_URI: env.REDIRECT_URI,
|
|
120
|
+
connectedAccounts
|
|
121
|
+
});
|
|
122
|
+
default:
|
|
123
|
+
return new drizzle.MockConnector();
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
async function importAesKey(base64Key) {
|
|
128
|
+
const raw = Uint8Array.from(atob(base64Key), (c) => c.charCodeAt(0));
|
|
129
|
+
return await crypto.subtle.importKey("raw", raw, { name: "AES-GCM" }, false, [
|
|
130
|
+
"encrypt",
|
|
131
|
+
"decrypt"
|
|
132
|
+
]);
|
|
133
|
+
}
|
|
134
|
+
async function encrypt(value, key) {
|
|
135
|
+
const encoder = new TextEncoder();
|
|
136
|
+
const iv = crypto.getRandomValues(new Uint8Array(12));
|
|
137
|
+
const ciphertext = await crypto.subtle.encrypt(
|
|
138
|
+
{ name: "AES-GCM", iv },
|
|
139
|
+
key,
|
|
140
|
+
encoder.encode(value)
|
|
141
|
+
);
|
|
142
|
+
const combined = new Uint8Array(iv.length + ciphertext.byteLength);
|
|
143
|
+
combined.set(iv, 0);
|
|
144
|
+
combined.set(new Uint8Array(ciphertext), iv.length);
|
|
145
|
+
return btoa(String.fromCharCode(...combined));
|
|
146
|
+
}
|
|
147
|
+
async function decrypt(base64, key) {
|
|
148
|
+
const raw = Uint8Array.from(atob(base64), (c) => c.charCodeAt(0));
|
|
149
|
+
const iv = raw.slice(0, 12);
|
|
150
|
+
const ciphertext = raw.slice(12);
|
|
151
|
+
const decrypted = await crypto.subtle.decrypt(
|
|
152
|
+
{ name: "AES-GCM", iv },
|
|
153
|
+
key,
|
|
154
|
+
ciphertext
|
|
155
|
+
);
|
|
156
|
+
return new TextDecoder().decode(decrypted);
|
|
157
|
+
}
|
|
158
|
+
function canonicalize(value) {
|
|
159
|
+
if (value === null || typeof value !== "object") return value;
|
|
160
|
+
if (Array.isArray(value)) {
|
|
161
|
+
return value.map(canonicalize);
|
|
162
|
+
}
|
|
163
|
+
const obj = value;
|
|
164
|
+
const sorted = Object.keys(obj).sort().reduce((acc, key) => {
|
|
165
|
+
acc[key] = canonicalize(obj[key]);
|
|
166
|
+
return acc;
|
|
167
|
+
}, {});
|
|
168
|
+
return sorted;
|
|
169
|
+
}
|
|
170
|
+
function checksum(input) {
|
|
171
|
+
const canonical = canonicalize(input);
|
|
172
|
+
const json = JSON.stringify(canonical);
|
|
173
|
+
return node_crypto.createHash("sha256").update(json).digest("hex");
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
exports.checksum = checksum;
|
|
177
|
+
exports.createPaymentCommand = createPaymentCommand;
|
|
178
|
+
exports.encrypt = encrypt;
|
|
179
|
+
exports.getAccountByIdQuery = getAccountByIdQuery;
|
|
180
|
+
exports.getBatchByIdQuery = getBatchByIdQuery;
|
|
181
|
+
exports.getCredentialsByAccountId = getCredentialsByAccountId;
|
|
182
|
+
exports.importAesKey = importAesKey;
|
|
183
|
+
exports.initiateConnector = initiateConnector;
|
|
184
|
+
exports.upsertBatchCommand = upsertBatchCommand;
|
|
@@ -16,7 +16,6 @@ interface BankServiceEnvironmentConfig {
|
|
|
16
16
|
ERSTE_AUTH_URI: 'https://webapi.developers.erstegroup.com/api/csas/sandbox/v1/sandbox-idp';
|
|
17
17
|
ERSTE_PAYMENTS_URI: 'https://webapi.developers.erstegroup.com/api/csas/public/sandbox/v1/payments';
|
|
18
18
|
ERSTE_ACCOUNTS_URI: 'https://webapi.developers.erstegroup.com/api/csas/public/sandbox/v3/accounts';
|
|
19
|
-
ERSTE_FETCH_INTERVAL: 300;
|
|
20
19
|
FINBRICKS_BASE_URI: 'https://api.sandbox.finbricks.com';
|
|
21
20
|
FINBRICKS_MERCHANT_ID: string;
|
|
22
21
|
CRON_BATCH_STATUSES: string;
|
|
@@ -16,7 +16,6 @@ interface BankServiceEnvironmentConfig {
|
|
|
16
16
|
ERSTE_AUTH_URI: 'https://webapi.developers.erstegroup.com/api/csas/sandbox/v1/sandbox-idp';
|
|
17
17
|
ERSTE_PAYMENTS_URI: 'https://webapi.developers.erstegroup.com/api/csas/public/sandbox/v1/payments';
|
|
18
18
|
ERSTE_ACCOUNTS_URI: 'https://webapi.developers.erstegroup.com/api/csas/public/sandbox/v3/accounts';
|
|
19
|
-
ERSTE_FETCH_INTERVAL: 300;
|
|
20
19
|
FINBRICKS_BASE_URI: 'https://api.sandbox.finbricks.com';
|
|
21
20
|
FINBRICKS_MERCHANT_ID: string;
|
|
22
21
|
CRON_BATCH_STATUSES: string;
|
|
@@ -16,7 +16,6 @@ interface BankServiceEnvironmentConfig {
|
|
|
16
16
|
ERSTE_AUTH_URI: 'https://webapi.developers.erstegroup.com/api/csas/sandbox/v1/sandbox-idp';
|
|
17
17
|
ERSTE_PAYMENTS_URI: 'https://webapi.developers.erstegroup.com/api/csas/public/sandbox/v1/payments';
|
|
18
18
|
ERSTE_ACCOUNTS_URI: 'https://webapi.developers.erstegroup.com/api/csas/public/sandbox/v3/accounts';
|
|
19
|
-
ERSTE_FETCH_INTERVAL: 300;
|
|
20
19
|
FINBRICKS_BASE_URI: 'https://api.sandbox.finbricks.com';
|
|
21
20
|
FINBRICKS_MERCHANT_ID: string;
|
|
22
21
|
CRON_BATCH_STATUSES: string;
|
package/dist/types.cjs
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
3
|
+
const drizzle = require('./shared/bank.CPYfE-Ei.cjs');
|
|
4
|
+
const database_schema = require('./shared/bank.CpwLFudl.cjs');
|
|
5
5
|
const generalCodes = require('@develit-io/general-codes');
|
|
6
6
|
require('@develit-io/backend-sdk');
|
|
7
|
-
require('drizzle-orm/sqlite-core');
|
|
8
7
|
require('date-fns');
|
|
9
8
|
require('drizzle-orm');
|
|
10
9
|
require('jose');
|
|
11
|
-
require('drizzle-zod');
|
|
12
|
-
require('drizzle-orm/relations');
|
|
13
10
|
require('node:crypto');
|
|
11
|
+
require('drizzle-orm/sqlite-core');
|
|
12
|
+
require('drizzle-orm/relations');
|
|
13
|
+
require('drizzle-zod');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
exports.ErsteConnector = drizzle.ErsteConnector;
|
|
18
|
+
exports.FINBRICKS_ENDPOINTS = drizzle.FINBRICKS_ENDPOINTS;
|
|
19
|
+
exports.FinbricksClient = drizzle.FinbricksClient;
|
|
20
|
+
exports.FinbricksConnector = drizzle.FinbricksConnector;
|
|
21
|
+
exports.IBankConnector = drizzle.IBankConnector;
|
|
22
|
+
exports.MockCobsConnector = drizzle.MockCobsConnector;
|
|
23
|
+
exports.MockConnector = drizzle.MockConnector;
|
|
24
|
+
exports.signFinbricksJws = drizzle.signFinbricksJws;
|
|
25
|
+
exports.useFinbricksFetch = drizzle.useFinbricksFetch;
|
|
17
26
|
exports.ACCOUNT_STATUSES = database_schema.ACCOUNT_STATUSES;
|
|
18
27
|
exports.BATCH_STATUES = database_schema.BATCH_STATUSES;
|
|
19
28
|
exports.BATCH_STATUSES = database_schema.BATCH_STATUSES;
|
|
@@ -21,13 +30,7 @@ exports.CHARGE_BEARERS = database_schema.CHARGE_BEARERS;
|
|
|
21
30
|
exports.CONNECTOR_KEYS = database_schema.CONNECTOR_KEYS;
|
|
22
31
|
exports.COUNTRY_CODES = database_schema.COUNTRY_CODES;
|
|
23
32
|
exports.CREDENTIALS_TYPES = database_schema.CREDENTIALS_TYPES;
|
|
24
|
-
exports.ErsteConnector = database_schema.ErsteConnector;
|
|
25
|
-
exports.FINBRICKS_ENDPOINTS = database_schema.FINBRICKS_ENDPOINTS;
|
|
26
|
-
exports.FinbricksClient = database_schema.FinbricksClient;
|
|
27
|
-
exports.FinbricksConnector = database_schema.FinbricksConnector;
|
|
28
|
-
exports.IBankConnector = database_schema.IBankConnector;
|
|
29
33
|
exports.INSTRUCTION_PRIORITIES = database_schema.INSTRUCTION_PRIORITIES;
|
|
30
|
-
exports.MockConnector = database_schema.MockConnector;
|
|
31
34
|
exports.PAYMENT_DIRECTIONS = database_schema.PAYMENT_DIRECTIONS;
|
|
32
35
|
exports.PAYMENT_STATUSES = database_schema.PAYMENT_STATUSES;
|
|
33
36
|
exports.PAYMENT_TYPES = database_schema.PAYMENT_TYPES;
|
|
@@ -41,8 +44,5 @@ exports.accountUpdateSchema = database_schema.accountUpdateSchema;
|
|
|
41
44
|
exports.ottInsertSchema = database_schema.ottInsertSchema;
|
|
42
45
|
exports.ottSelectSchema = database_schema.ottSelectSchema;
|
|
43
46
|
exports.ottUpdateSchema = database_schema.ottUpdateSchema;
|
|
44
|
-
exports.signFinbricksJws = database_schema.signFinbricksJws;
|
|
45
|
-
exports.useFinbricksFetch = database_schema.useFinbricksFetch;
|
|
46
|
-
exports.MockCobsConnector = mockCobs_connector.MockCobsConnector;
|
|
47
47
|
exports.BANK_CODES = generalCodes.BANK_CODES;
|
|
48
48
|
exports.CURRENCY_CODES = generalCodes.CURRENCY_CODES;
|
package/dist/types.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.
|
|
2
|
-
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.BEL1HIxZ.cjs';
|
|
2
|
+
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.BEL1HIxZ.cjs';
|
|
3
3
|
import { Environment, BaseEvent } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
|
-
export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.
|
|
5
|
+
export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.Dh_H_5rC.cjs';
|
|
6
6
|
import * as drizzle_zod from 'drizzle-zod';
|
|
7
7
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
8
8
|
import { z } from 'zod';
|
|
@@ -21,7 +21,6 @@ interface ErsteConnectorConfig {
|
|
|
21
21
|
}
|
|
22
22
|
declare class ErsteConnector extends IBankConnector {
|
|
23
23
|
initiateSEPAPayment(payment: IncomingPaymentMessage): Promise<InitiatedPayment>;
|
|
24
|
-
static readonly FETCH_INTERVAL: number;
|
|
25
24
|
private readonly API_KEY;
|
|
26
25
|
private readonly CLIENT_ID;
|
|
27
26
|
private readonly CLIENT_SECRET;
|
|
@@ -48,7 +47,8 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
48
47
|
}): Promise<string>;
|
|
49
48
|
listAccounts(): Promise<[]>;
|
|
50
49
|
preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
|
|
51
|
-
initiateBatchFromPayments({ payments, }: {
|
|
50
|
+
initiateBatchFromPayments({ batchId, payments, }: {
|
|
51
|
+
batchId: string;
|
|
52
52
|
payments: PaymentPreparedInsertType[];
|
|
53
53
|
}): Promise<InitiatedBatch>;
|
|
54
54
|
initiateSinglePayment(): Promise<InitiatedPayment>;
|
|
@@ -456,7 +456,6 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
456
456
|
connectedAccounts: ConnectedAccount[];
|
|
457
457
|
protected readonly finbricks: FinbricksClient;
|
|
458
458
|
protected readonly PROVIDER: FinbricksProvider;
|
|
459
|
-
static readonly FETCH_INTERVAL: number;
|
|
460
459
|
constructor(provider: FinbricksProvider, { BASE_URI, MERCHANT_ID, PRIVATE_KEY_PEM, REDIRECT_URI, connectedAccounts, }: FinbricksConnectorConfig);
|
|
461
460
|
getAuthUri({ ott }: {
|
|
462
461
|
ott: string;
|
|
@@ -477,7 +476,8 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
477
476
|
}): Promise<FinbricksAccount[]>;
|
|
478
477
|
listAccounts(): Promise<AccountInsertType[]>;
|
|
479
478
|
preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
|
|
480
|
-
initiateBatchFromPayments({ payments, }: {
|
|
479
|
+
initiateBatchFromPayments({ batchId, payments, }: {
|
|
480
|
+
batchId: string;
|
|
481
481
|
payments: PaymentPreparedInsertType[];
|
|
482
482
|
}): Promise<InitiatedBatch>;
|
|
483
483
|
initiateForeignPayment(payment: IncomingPaymentMessage): Promise<InitiatedPayment>;
|
|
@@ -503,7 +503,6 @@ declare class MockConnector extends IBankConnector {
|
|
|
503
503
|
initiateSEPAPayment(payment: IncomingPaymentMessage): Promise<InitiatedPayment>;
|
|
504
504
|
connectedAccounts: ConnectedAccount[];
|
|
505
505
|
connectorKey: ConnectorKey;
|
|
506
|
-
static readonly FETCH_INTERVAL: number;
|
|
507
506
|
constructor();
|
|
508
507
|
authenticate(): Promise<string>;
|
|
509
508
|
listAccounts(): Promise<[]>;
|
|
@@ -519,7 +518,8 @@ declare class MockConnector extends IBankConnector {
|
|
|
519
518
|
}>;
|
|
520
519
|
preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
|
|
521
520
|
initiateSinglePayment(payment: PaymentPreparedInsertType): Promise<InitiatedPayment>;
|
|
522
|
-
initiateBatchFromPayments({ payments, }: {
|
|
521
|
+
initiateBatchFromPayments({ batchId, payments, }: {
|
|
522
|
+
batchId: string;
|
|
523
523
|
payments: IncomingPaymentMessage[];
|
|
524
524
|
}): Promise<InitiatedBatch>;
|
|
525
525
|
getAllAccountPayments({ db, }: {
|
package/dist/types.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.
|
|
2
|
-
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.BEL1HIxZ.mjs';
|
|
2
|
+
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.BEL1HIxZ.mjs';
|
|
3
3
|
import { Environment, BaseEvent } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
|
-
export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.
|
|
5
|
+
export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.Dh_H_5rC.mjs';
|
|
6
6
|
import * as drizzle_zod from 'drizzle-zod';
|
|
7
7
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
8
8
|
import { z } from 'zod';
|
|
@@ -21,7 +21,6 @@ interface ErsteConnectorConfig {
|
|
|
21
21
|
}
|
|
22
22
|
declare class ErsteConnector extends IBankConnector {
|
|
23
23
|
initiateSEPAPayment(payment: IncomingPaymentMessage): Promise<InitiatedPayment>;
|
|
24
|
-
static readonly FETCH_INTERVAL: number;
|
|
25
24
|
private readonly API_KEY;
|
|
26
25
|
private readonly CLIENT_ID;
|
|
27
26
|
private readonly CLIENT_SECRET;
|
|
@@ -48,7 +47,8 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
48
47
|
}): Promise<string>;
|
|
49
48
|
listAccounts(): Promise<[]>;
|
|
50
49
|
preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
|
|
51
|
-
initiateBatchFromPayments({ payments, }: {
|
|
50
|
+
initiateBatchFromPayments({ batchId, payments, }: {
|
|
51
|
+
batchId: string;
|
|
52
52
|
payments: PaymentPreparedInsertType[];
|
|
53
53
|
}): Promise<InitiatedBatch>;
|
|
54
54
|
initiateSinglePayment(): Promise<InitiatedPayment>;
|
|
@@ -456,7 +456,6 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
456
456
|
connectedAccounts: ConnectedAccount[];
|
|
457
457
|
protected readonly finbricks: FinbricksClient;
|
|
458
458
|
protected readonly PROVIDER: FinbricksProvider;
|
|
459
|
-
static readonly FETCH_INTERVAL: number;
|
|
460
459
|
constructor(provider: FinbricksProvider, { BASE_URI, MERCHANT_ID, PRIVATE_KEY_PEM, REDIRECT_URI, connectedAccounts, }: FinbricksConnectorConfig);
|
|
461
460
|
getAuthUri({ ott }: {
|
|
462
461
|
ott: string;
|
|
@@ -477,7 +476,8 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
477
476
|
}): Promise<FinbricksAccount[]>;
|
|
478
477
|
listAccounts(): Promise<AccountInsertType[]>;
|
|
479
478
|
preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
|
|
480
|
-
initiateBatchFromPayments({ payments, }: {
|
|
479
|
+
initiateBatchFromPayments({ batchId, payments, }: {
|
|
480
|
+
batchId: string;
|
|
481
481
|
payments: PaymentPreparedInsertType[];
|
|
482
482
|
}): Promise<InitiatedBatch>;
|
|
483
483
|
initiateForeignPayment(payment: IncomingPaymentMessage): Promise<InitiatedPayment>;
|
|
@@ -503,7 +503,6 @@ declare class MockConnector extends IBankConnector {
|
|
|
503
503
|
initiateSEPAPayment(payment: IncomingPaymentMessage): Promise<InitiatedPayment>;
|
|
504
504
|
connectedAccounts: ConnectedAccount[];
|
|
505
505
|
connectorKey: ConnectorKey;
|
|
506
|
-
static readonly FETCH_INTERVAL: number;
|
|
507
506
|
constructor();
|
|
508
507
|
authenticate(): Promise<string>;
|
|
509
508
|
listAccounts(): Promise<[]>;
|
|
@@ -519,7 +518,8 @@ declare class MockConnector extends IBankConnector {
|
|
|
519
518
|
}>;
|
|
520
519
|
preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
|
|
521
520
|
initiateSinglePayment(payment: PaymentPreparedInsertType): Promise<InitiatedPayment>;
|
|
522
|
-
initiateBatchFromPayments({ payments, }: {
|
|
521
|
+
initiateBatchFromPayments({ batchId, payments, }: {
|
|
522
|
+
batchId: string;
|
|
523
523
|
payments: IncomingPaymentMessage[];
|
|
524
524
|
}): Promise<InitiatedBatch>;
|
|
525
525
|
getAllAccountPayments({ db, }: {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.
|
|
2
|
-
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.BEL1HIxZ.js';
|
|
2
|
+
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.BEL1HIxZ.js';
|
|
3
3
|
import { Environment, BaseEvent } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
|
-
export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.
|
|
5
|
+
export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.Dh_H_5rC.js';
|
|
6
6
|
import * as drizzle_zod from 'drizzle-zod';
|
|
7
7
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
8
8
|
import { z } from 'zod';
|
|
@@ -21,7 +21,6 @@ interface ErsteConnectorConfig {
|
|
|
21
21
|
}
|
|
22
22
|
declare class ErsteConnector extends IBankConnector {
|
|
23
23
|
initiateSEPAPayment(payment: IncomingPaymentMessage): Promise<InitiatedPayment>;
|
|
24
|
-
static readonly FETCH_INTERVAL: number;
|
|
25
24
|
private readonly API_KEY;
|
|
26
25
|
private readonly CLIENT_ID;
|
|
27
26
|
private readonly CLIENT_SECRET;
|
|
@@ -48,7 +47,8 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
48
47
|
}): Promise<string>;
|
|
49
48
|
listAccounts(): Promise<[]>;
|
|
50
49
|
preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
|
|
51
|
-
initiateBatchFromPayments({ payments, }: {
|
|
50
|
+
initiateBatchFromPayments({ batchId, payments, }: {
|
|
51
|
+
batchId: string;
|
|
52
52
|
payments: PaymentPreparedInsertType[];
|
|
53
53
|
}): Promise<InitiatedBatch>;
|
|
54
54
|
initiateSinglePayment(): Promise<InitiatedPayment>;
|
|
@@ -456,7 +456,6 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
456
456
|
connectedAccounts: ConnectedAccount[];
|
|
457
457
|
protected readonly finbricks: FinbricksClient;
|
|
458
458
|
protected readonly PROVIDER: FinbricksProvider;
|
|
459
|
-
static readonly FETCH_INTERVAL: number;
|
|
460
459
|
constructor(provider: FinbricksProvider, { BASE_URI, MERCHANT_ID, PRIVATE_KEY_PEM, REDIRECT_URI, connectedAccounts, }: FinbricksConnectorConfig);
|
|
461
460
|
getAuthUri({ ott }: {
|
|
462
461
|
ott: string;
|
|
@@ -477,7 +476,8 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
477
476
|
}): Promise<FinbricksAccount[]>;
|
|
478
477
|
listAccounts(): Promise<AccountInsertType[]>;
|
|
479
478
|
preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
|
|
480
|
-
initiateBatchFromPayments({ payments, }: {
|
|
479
|
+
initiateBatchFromPayments({ batchId, payments, }: {
|
|
480
|
+
batchId: string;
|
|
481
481
|
payments: PaymentPreparedInsertType[];
|
|
482
482
|
}): Promise<InitiatedBatch>;
|
|
483
483
|
initiateForeignPayment(payment: IncomingPaymentMessage): Promise<InitiatedPayment>;
|
|
@@ -503,7 +503,6 @@ declare class MockConnector extends IBankConnector {
|
|
|
503
503
|
initiateSEPAPayment(payment: IncomingPaymentMessage): Promise<InitiatedPayment>;
|
|
504
504
|
connectedAccounts: ConnectedAccount[];
|
|
505
505
|
connectorKey: ConnectorKey;
|
|
506
|
-
static readonly FETCH_INTERVAL: number;
|
|
507
506
|
constructor();
|
|
508
507
|
authenticate(): Promise<string>;
|
|
509
508
|
listAccounts(): Promise<[]>;
|
|
@@ -519,7 +518,8 @@ declare class MockConnector extends IBankConnector {
|
|
|
519
518
|
}>;
|
|
520
519
|
preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
|
|
521
520
|
initiateSinglePayment(payment: PaymentPreparedInsertType): Promise<InitiatedPayment>;
|
|
522
|
-
initiateBatchFromPayments({ payments, }: {
|
|
521
|
+
initiateBatchFromPayments({ batchId, payments, }: {
|
|
522
|
+
batchId: string;
|
|
523
523
|
payments: IncomingPaymentMessage[];
|
|
524
524
|
}): Promise<InitiatedBatch>;
|
|
525
525
|
getAllAccountPayments({ db, }: {
|
package/dist/types.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { E as ErsteConnector, c as FINBRICKS_ENDPOINTS, b as FinbricksClient, F as FinbricksConnector, I as IBankConnector, a as MockCobsConnector, M as MockConnector, s as signFinbricksJws, u as useFinbricksFetch } from './shared/bank.B1Gpn3ht.mjs';
|
|
2
|
+
export { A as ACCOUNT_STATUSES, B as BATCH_STATUES, B as BATCH_STATUSES, C as CHARGE_BEARERS, d as CONNECTOR_KEYS, c as COUNTRY_CODES, e as CREDENTIALS_TYPES, I as INSTRUCTION_PRIORITIES, b as PAYMENT_DIRECTIONS, a as PAYMENT_STATUSES, P as PAYMENT_TYPES, T as TOKEN_TYPES, i as accountCredentialsInsertSchema, k as accountCredentialsSelectSchema, j as accountCredentialsUpdateSchema, f as accountInsertSchema, h as accountSelectSchema, g as accountUpdateSchema, o as ottInsertSchema, m as ottSelectSchema, l as ottUpdateSchema } from './shared/bank.D-3fzX63.mjs';
|
|
3
3
|
export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
4
4
|
import '@develit-io/backend-sdk';
|
|
5
|
-
import 'drizzle-orm/sqlite-core';
|
|
6
5
|
import 'date-fns';
|
|
7
6
|
import 'drizzle-orm';
|
|
8
7
|
import 'jose';
|
|
9
|
-
import 'drizzle-zod';
|
|
10
|
-
import 'drizzle-orm/relations';
|
|
11
8
|
import 'node:crypto';
|
|
9
|
+
import 'drizzle-orm/sqlite-core';
|
|
10
|
+
import 'drizzle-orm/relations';
|
|
11
|
+
import 'drizzle-zod';
|