@develit-services/bank 0.0.28 → 0.0.29
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 -1
- 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 +8 -1
- package/dist/export/worker.cjs +762 -575
- package/dist/export/worker.d.cts +52 -12
- package/dist/export/worker.d.mts +52 -12
- package/dist/export/worker.d.ts +52 -12
- package/dist/export/worker.mjs +732 -545
- package/dist/export/wrangler.cjs +1 -1
- package/dist/export/wrangler.d.cts +2 -3
- package/dist/export/wrangler.d.mts +2 -3
- package/dist/export/wrangler.d.ts +2 -3
- package/dist/export/wrangler.mjs +1 -1
- package/dist/shared/{bank.BuNG2S8h.d.cts → bank.07oMM145.d.cts} +528 -11
- package/dist/shared/{bank.BuNG2S8h.d.mts → bank.07oMM145.d.mts} +528 -11
- package/dist/shared/{bank.BuNG2S8h.d.ts → bank.07oMM145.d.ts} +528 -11
- package/dist/shared/bank.5CiXtVIb.mjs +9 -0
- package/dist/shared/{bank.CEZKAEiY.d.cts → bank.BchnXQDL.d.cts} +2 -2
- package/dist/shared/{bank.CEZKAEiY.d.mts → bank.BchnXQDL.d.mts} +2 -2
- package/dist/shared/{bank.CEZKAEiY.d.ts → bank.BchnXQDL.d.ts} +2 -2
- package/dist/shared/bank.BeJh7l2V.cjs +11 -0
- package/dist/shared/bank.By8Vh0l5.d.ts +1648 -0
- package/dist/shared/bank.CWt0unt2.d.cts +1648 -0
- package/dist/shared/{bank.DnDcNEvX.mjs → bank.Ce4ZEpjD.mjs} +329 -107
- package/dist/shared/bank.DS18_iuS.d.mts +1648 -0
- package/dist/shared/{bank.Cy_TcyKb.cjs → bank.DXzEZPsO.cjs} +346 -106
- package/dist/types.cjs +32 -20
- package/dist/types.d.cts +496 -35
- package/dist/types.d.mts +496 -35
- package/dist/types.d.ts +496 -35
- package/dist/types.mjs +5 -4
- package/package.json +1 -1
- package/dist/shared/bank.BkLncGmL.d.ts +0 -122
- package/dist/shared/bank.C9jAvwna.mjs +0 -90
- package/dist/shared/bank.DWVLVMDa.d.mts +0 -122
- package/dist/shared/bank.DmypH3Au.d.cts +0 -122
- package/dist/shared/bank.P9gDUycr.cjs +0 -98
package/dist/export/worker.d.cts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.
|
|
3
|
+
import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.07oMM145.cjs';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
6
|
import { z } from 'zod';
|
|
7
|
-
import {
|
|
7
|
+
import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.CWt0unt2.cjs';
|
|
8
8
|
import 'drizzle-orm/sqlite-core';
|
|
9
9
|
import 'drizzle-orm';
|
|
10
10
|
import '@develit-io/general-codes';
|
|
11
|
+
import 'drizzle-zod';
|
|
11
12
|
|
|
12
13
|
declare const sendPaymentInputSchema: z.ZodObject<{
|
|
13
14
|
refId: z.ZodString;
|
|
@@ -89,7 +90,15 @@ interface SendPaymentInput extends z.infer<typeof sendPaymentInputSchema> {
|
|
|
89
90
|
type SendPaymentOutput = void;
|
|
90
91
|
|
|
91
92
|
declare const getAuthUriInputSchema: z.ZodObject<{
|
|
92
|
-
|
|
93
|
+
connectorKey: z.ZodEnum<{
|
|
94
|
+
ERSTE: "ERSTE";
|
|
95
|
+
FINBRICKS: "FINBRICKS";
|
|
96
|
+
MOCK: "MOCK";
|
|
97
|
+
CREDITAS: "CREDITAS";
|
|
98
|
+
MOCK_COBS: "MOCK_COBS";
|
|
99
|
+
FIO: "FIO";
|
|
100
|
+
MONETA: "MONETA";
|
|
101
|
+
}>;
|
|
93
102
|
}, z.core.$strip>;
|
|
94
103
|
type GetAuthUriInput = z.infer<typeof getAuthUriInputSchema>;
|
|
95
104
|
type GetAuthUriOutput = {
|
|
@@ -103,7 +112,7 @@ declare const authorizeAccountInputSchema: z.ZodObject<{
|
|
|
103
112
|
interface AuthorizeAccountInput extends z.infer<typeof authorizeAccountInputSchema> {
|
|
104
113
|
}
|
|
105
114
|
type AuthorizeAccountOutput = {
|
|
106
|
-
|
|
115
|
+
accounts: AccountSelectType[];
|
|
107
116
|
};
|
|
108
117
|
|
|
109
118
|
declare const simulateDepositInputSchema: z.ZodObject<{
|
|
@@ -171,6 +180,15 @@ declare const simulateDepositInputSchema: z.ZodObject<{
|
|
|
171
180
|
creditorHolderName: z.ZodString;
|
|
172
181
|
debtorIban: z.ZodString;
|
|
173
182
|
debtorHolderName: z.ZodString;
|
|
183
|
+
connectorKey: z.ZodEnum<{
|
|
184
|
+
ERSTE: "ERSTE";
|
|
185
|
+
FINBRICKS: "FINBRICKS";
|
|
186
|
+
MOCK: "MOCK";
|
|
187
|
+
CREDITAS: "CREDITAS";
|
|
188
|
+
MOCK_COBS: "MOCK_COBS";
|
|
189
|
+
FIO: "FIO";
|
|
190
|
+
MONETA: "MONETA";
|
|
191
|
+
}>;
|
|
174
192
|
}, z.core.$strip>;
|
|
175
193
|
interface SimulateDepositInput extends z.infer<typeof simulateDepositInputSchema> {
|
|
176
194
|
}
|
|
@@ -195,6 +213,7 @@ declare const initiateConnectorInputSchema: z.ZodObject<{
|
|
|
195
213
|
FIO: "FIO";
|
|
196
214
|
MONETA: "MONETA";
|
|
197
215
|
}>;
|
|
216
|
+
withAuth: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
198
217
|
}, z.core.$strip>;
|
|
199
218
|
interface initiateConnectorInput extends z.input<typeof initiateConnectorInputSchema> {
|
|
200
219
|
}
|
|
@@ -229,26 +248,47 @@ interface ProcessBatchInput extends z.infer<typeof processBatchInputSchema> {
|
|
|
229
248
|
|
|
230
249
|
declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
231
250
|
declare class BankServiceBase extends BankServiceBase_base {
|
|
232
|
-
readonly configAccounts: ConfigEnvironmentBankAccount;
|
|
233
251
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
234
252
|
protected bankConnector: IBankConnector;
|
|
235
|
-
|
|
236
|
-
|
|
253
|
+
protected allowedProviders: ConnectorKey[];
|
|
254
|
+
constructor(ctx: ExecutionContext, env: BankEnv, config: ConfigEnvironmentBank);
|
|
255
|
+
getAllowedProviders(): ConnectorKey[];
|
|
256
|
+
getAccounts(): Promise<{
|
|
257
|
+
connectorKey: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA";
|
|
258
|
+
status: "AUTHORIZED" | "DISABLED" | "EXPIRED";
|
|
259
|
+
sync: boolean;
|
|
260
|
+
syncPeriod: number | null;
|
|
261
|
+
lastSyncedAt: Date | null;
|
|
262
|
+
holderName: string;
|
|
263
|
+
number: string;
|
|
264
|
+
bankCode: "5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500";
|
|
265
|
+
iban: string;
|
|
266
|
+
address: string | null;
|
|
267
|
+
swiftBic: string | null;
|
|
268
|
+
bicCor: string | null;
|
|
269
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
270
|
+
countryCode: "AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW";
|
|
271
|
+
id: string;
|
|
272
|
+
createdAt: Date | null;
|
|
273
|
+
updatedAt: Date | null;
|
|
274
|
+
deletedAt: Date | null;
|
|
275
|
+
}[]>;
|
|
237
276
|
accountFetchInterval(connectorKey: ConnectorKey): number;
|
|
238
277
|
syncAccounts(): Promise<IRPCResponse<void>>;
|
|
239
278
|
scheduled(controller: ScheduledController): Promise<void>;
|
|
279
|
+
updateBatchStatuses(): Promise<void>;
|
|
240
280
|
initiateBankConnector(input: initiateConnectorInput): Promise<initiateConnectorOutput>;
|
|
241
281
|
addPaymentsToBatch({ paymentsToBatch, }: {
|
|
242
282
|
paymentsToBatch: SendPaymentInput[];
|
|
243
283
|
}): Promise<IRPCResponse<{
|
|
244
|
-
|
|
284
|
+
status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | null;
|
|
245
285
|
id: string;
|
|
246
286
|
createdAt: Date | null;
|
|
247
287
|
updatedAt: Date | null;
|
|
248
288
|
deletedAt: Date | null;
|
|
249
289
|
batchPaymentInitiatedAt: Date | null;
|
|
250
290
|
authorizationUrls: string | string[] | null;
|
|
251
|
-
|
|
291
|
+
accountId: string | null;
|
|
252
292
|
payments: PaymentInsertType[];
|
|
253
293
|
metadata: object | null;
|
|
254
294
|
}[] | undefined>>;
|
|
@@ -260,11 +300,11 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
260
300
|
simulateDeposit(input: SimulateDepositInput): Promise<IRPCResponse<SimulateDepositOutput>>;
|
|
261
301
|
setLastSyncAt(input: SetLastSyncAtInput): Promise<IRPCResponse<SetLastSyncAtOutput>>;
|
|
262
302
|
sendPayment(input: SendPaymentInput): Promise<IRPCResponse<SendPaymentOutput>>;
|
|
263
|
-
getBankAccounts(): Promise<IRPCResponse<
|
|
303
|
+
getBankAccounts(): Promise<IRPCResponse<AccountSelectType[]>>;
|
|
264
304
|
getBatches(input: GetBatchesInput): Promise<IRPCResponse<GetBatchesOutput>>;
|
|
265
305
|
}
|
|
266
|
-
declare function defineBankService({
|
|
267
|
-
|
|
306
|
+
declare function defineBankService({ config, }: {
|
|
307
|
+
config: ConfigEnvironmentBank;
|
|
268
308
|
}): new (ctx: ExecutionContext, env: BankEnv) => BankServiceBase;
|
|
269
309
|
|
|
270
310
|
declare const _default: new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv>;
|
package/dist/export/worker.d.mts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.
|
|
3
|
+
import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.07oMM145.mjs';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
6
|
import { z } from 'zod';
|
|
7
|
-
import {
|
|
7
|
+
import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.DS18_iuS.mjs';
|
|
8
8
|
import 'drizzle-orm/sqlite-core';
|
|
9
9
|
import 'drizzle-orm';
|
|
10
10
|
import '@develit-io/general-codes';
|
|
11
|
+
import 'drizzle-zod';
|
|
11
12
|
|
|
12
13
|
declare const sendPaymentInputSchema: z.ZodObject<{
|
|
13
14
|
refId: z.ZodString;
|
|
@@ -89,7 +90,15 @@ interface SendPaymentInput extends z.infer<typeof sendPaymentInputSchema> {
|
|
|
89
90
|
type SendPaymentOutput = void;
|
|
90
91
|
|
|
91
92
|
declare const getAuthUriInputSchema: z.ZodObject<{
|
|
92
|
-
|
|
93
|
+
connectorKey: z.ZodEnum<{
|
|
94
|
+
ERSTE: "ERSTE";
|
|
95
|
+
FINBRICKS: "FINBRICKS";
|
|
96
|
+
MOCK: "MOCK";
|
|
97
|
+
CREDITAS: "CREDITAS";
|
|
98
|
+
MOCK_COBS: "MOCK_COBS";
|
|
99
|
+
FIO: "FIO";
|
|
100
|
+
MONETA: "MONETA";
|
|
101
|
+
}>;
|
|
93
102
|
}, z.core.$strip>;
|
|
94
103
|
type GetAuthUriInput = z.infer<typeof getAuthUriInputSchema>;
|
|
95
104
|
type GetAuthUriOutput = {
|
|
@@ -103,7 +112,7 @@ declare const authorizeAccountInputSchema: z.ZodObject<{
|
|
|
103
112
|
interface AuthorizeAccountInput extends z.infer<typeof authorizeAccountInputSchema> {
|
|
104
113
|
}
|
|
105
114
|
type AuthorizeAccountOutput = {
|
|
106
|
-
|
|
115
|
+
accounts: AccountSelectType[];
|
|
107
116
|
};
|
|
108
117
|
|
|
109
118
|
declare const simulateDepositInputSchema: z.ZodObject<{
|
|
@@ -171,6 +180,15 @@ declare const simulateDepositInputSchema: z.ZodObject<{
|
|
|
171
180
|
creditorHolderName: z.ZodString;
|
|
172
181
|
debtorIban: z.ZodString;
|
|
173
182
|
debtorHolderName: z.ZodString;
|
|
183
|
+
connectorKey: z.ZodEnum<{
|
|
184
|
+
ERSTE: "ERSTE";
|
|
185
|
+
FINBRICKS: "FINBRICKS";
|
|
186
|
+
MOCK: "MOCK";
|
|
187
|
+
CREDITAS: "CREDITAS";
|
|
188
|
+
MOCK_COBS: "MOCK_COBS";
|
|
189
|
+
FIO: "FIO";
|
|
190
|
+
MONETA: "MONETA";
|
|
191
|
+
}>;
|
|
174
192
|
}, z.core.$strip>;
|
|
175
193
|
interface SimulateDepositInput extends z.infer<typeof simulateDepositInputSchema> {
|
|
176
194
|
}
|
|
@@ -195,6 +213,7 @@ declare const initiateConnectorInputSchema: z.ZodObject<{
|
|
|
195
213
|
FIO: "FIO";
|
|
196
214
|
MONETA: "MONETA";
|
|
197
215
|
}>;
|
|
216
|
+
withAuth: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
198
217
|
}, z.core.$strip>;
|
|
199
218
|
interface initiateConnectorInput extends z.input<typeof initiateConnectorInputSchema> {
|
|
200
219
|
}
|
|
@@ -229,26 +248,47 @@ interface ProcessBatchInput extends z.infer<typeof processBatchInputSchema> {
|
|
|
229
248
|
|
|
230
249
|
declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
231
250
|
declare class BankServiceBase extends BankServiceBase_base {
|
|
232
|
-
readonly configAccounts: ConfigEnvironmentBankAccount;
|
|
233
251
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
234
252
|
protected bankConnector: IBankConnector;
|
|
235
|
-
|
|
236
|
-
|
|
253
|
+
protected allowedProviders: ConnectorKey[];
|
|
254
|
+
constructor(ctx: ExecutionContext, env: BankEnv, config: ConfigEnvironmentBank);
|
|
255
|
+
getAllowedProviders(): ConnectorKey[];
|
|
256
|
+
getAccounts(): Promise<{
|
|
257
|
+
connectorKey: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA";
|
|
258
|
+
status: "AUTHORIZED" | "DISABLED" | "EXPIRED";
|
|
259
|
+
sync: boolean;
|
|
260
|
+
syncPeriod: number | null;
|
|
261
|
+
lastSyncedAt: Date | null;
|
|
262
|
+
holderName: string;
|
|
263
|
+
number: string;
|
|
264
|
+
bankCode: "5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500";
|
|
265
|
+
iban: string;
|
|
266
|
+
address: string | null;
|
|
267
|
+
swiftBic: string | null;
|
|
268
|
+
bicCor: string | null;
|
|
269
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
270
|
+
countryCode: "AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW";
|
|
271
|
+
id: string;
|
|
272
|
+
createdAt: Date | null;
|
|
273
|
+
updatedAt: Date | null;
|
|
274
|
+
deletedAt: Date | null;
|
|
275
|
+
}[]>;
|
|
237
276
|
accountFetchInterval(connectorKey: ConnectorKey): number;
|
|
238
277
|
syncAccounts(): Promise<IRPCResponse<void>>;
|
|
239
278
|
scheduled(controller: ScheduledController): Promise<void>;
|
|
279
|
+
updateBatchStatuses(): Promise<void>;
|
|
240
280
|
initiateBankConnector(input: initiateConnectorInput): Promise<initiateConnectorOutput>;
|
|
241
281
|
addPaymentsToBatch({ paymentsToBatch, }: {
|
|
242
282
|
paymentsToBatch: SendPaymentInput[];
|
|
243
283
|
}): Promise<IRPCResponse<{
|
|
244
|
-
|
|
284
|
+
status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | null;
|
|
245
285
|
id: string;
|
|
246
286
|
createdAt: Date | null;
|
|
247
287
|
updatedAt: Date | null;
|
|
248
288
|
deletedAt: Date | null;
|
|
249
289
|
batchPaymentInitiatedAt: Date | null;
|
|
250
290
|
authorizationUrls: string | string[] | null;
|
|
251
|
-
|
|
291
|
+
accountId: string | null;
|
|
252
292
|
payments: PaymentInsertType[];
|
|
253
293
|
metadata: object | null;
|
|
254
294
|
}[] | undefined>>;
|
|
@@ -260,11 +300,11 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
260
300
|
simulateDeposit(input: SimulateDepositInput): Promise<IRPCResponse<SimulateDepositOutput>>;
|
|
261
301
|
setLastSyncAt(input: SetLastSyncAtInput): Promise<IRPCResponse<SetLastSyncAtOutput>>;
|
|
262
302
|
sendPayment(input: SendPaymentInput): Promise<IRPCResponse<SendPaymentOutput>>;
|
|
263
|
-
getBankAccounts(): Promise<IRPCResponse<
|
|
303
|
+
getBankAccounts(): Promise<IRPCResponse<AccountSelectType[]>>;
|
|
264
304
|
getBatches(input: GetBatchesInput): Promise<IRPCResponse<GetBatchesOutput>>;
|
|
265
305
|
}
|
|
266
|
-
declare function defineBankService({
|
|
267
|
-
|
|
306
|
+
declare function defineBankService({ config, }: {
|
|
307
|
+
config: ConfigEnvironmentBank;
|
|
268
308
|
}): new (ctx: ExecutionContext, env: BankEnv) => BankServiceBase;
|
|
269
309
|
|
|
270
310
|
declare const _default: new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv>;
|
package/dist/export/worker.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.
|
|
3
|
+
import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.07oMM145.js';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
6
|
import { z } from 'zod';
|
|
7
|
-
import {
|
|
7
|
+
import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.By8Vh0l5.js';
|
|
8
8
|
import 'drizzle-orm/sqlite-core';
|
|
9
9
|
import 'drizzle-orm';
|
|
10
10
|
import '@develit-io/general-codes';
|
|
11
|
+
import 'drizzle-zod';
|
|
11
12
|
|
|
12
13
|
declare const sendPaymentInputSchema: z.ZodObject<{
|
|
13
14
|
refId: z.ZodString;
|
|
@@ -89,7 +90,15 @@ interface SendPaymentInput extends z.infer<typeof sendPaymentInputSchema> {
|
|
|
89
90
|
type SendPaymentOutput = void;
|
|
90
91
|
|
|
91
92
|
declare const getAuthUriInputSchema: z.ZodObject<{
|
|
92
|
-
|
|
93
|
+
connectorKey: z.ZodEnum<{
|
|
94
|
+
ERSTE: "ERSTE";
|
|
95
|
+
FINBRICKS: "FINBRICKS";
|
|
96
|
+
MOCK: "MOCK";
|
|
97
|
+
CREDITAS: "CREDITAS";
|
|
98
|
+
MOCK_COBS: "MOCK_COBS";
|
|
99
|
+
FIO: "FIO";
|
|
100
|
+
MONETA: "MONETA";
|
|
101
|
+
}>;
|
|
93
102
|
}, z.core.$strip>;
|
|
94
103
|
type GetAuthUriInput = z.infer<typeof getAuthUriInputSchema>;
|
|
95
104
|
type GetAuthUriOutput = {
|
|
@@ -103,7 +112,7 @@ declare const authorizeAccountInputSchema: z.ZodObject<{
|
|
|
103
112
|
interface AuthorizeAccountInput extends z.infer<typeof authorizeAccountInputSchema> {
|
|
104
113
|
}
|
|
105
114
|
type AuthorizeAccountOutput = {
|
|
106
|
-
|
|
115
|
+
accounts: AccountSelectType[];
|
|
107
116
|
};
|
|
108
117
|
|
|
109
118
|
declare const simulateDepositInputSchema: z.ZodObject<{
|
|
@@ -171,6 +180,15 @@ declare const simulateDepositInputSchema: z.ZodObject<{
|
|
|
171
180
|
creditorHolderName: z.ZodString;
|
|
172
181
|
debtorIban: z.ZodString;
|
|
173
182
|
debtorHolderName: z.ZodString;
|
|
183
|
+
connectorKey: z.ZodEnum<{
|
|
184
|
+
ERSTE: "ERSTE";
|
|
185
|
+
FINBRICKS: "FINBRICKS";
|
|
186
|
+
MOCK: "MOCK";
|
|
187
|
+
CREDITAS: "CREDITAS";
|
|
188
|
+
MOCK_COBS: "MOCK_COBS";
|
|
189
|
+
FIO: "FIO";
|
|
190
|
+
MONETA: "MONETA";
|
|
191
|
+
}>;
|
|
174
192
|
}, z.core.$strip>;
|
|
175
193
|
interface SimulateDepositInput extends z.infer<typeof simulateDepositInputSchema> {
|
|
176
194
|
}
|
|
@@ -195,6 +213,7 @@ declare const initiateConnectorInputSchema: z.ZodObject<{
|
|
|
195
213
|
FIO: "FIO";
|
|
196
214
|
MONETA: "MONETA";
|
|
197
215
|
}>;
|
|
216
|
+
withAuth: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
198
217
|
}, z.core.$strip>;
|
|
199
218
|
interface initiateConnectorInput extends z.input<typeof initiateConnectorInputSchema> {
|
|
200
219
|
}
|
|
@@ -229,26 +248,47 @@ interface ProcessBatchInput extends z.infer<typeof processBatchInputSchema> {
|
|
|
229
248
|
|
|
230
249
|
declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
231
250
|
declare class BankServiceBase extends BankServiceBase_base {
|
|
232
|
-
readonly configAccounts: ConfigEnvironmentBankAccount;
|
|
233
251
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
234
252
|
protected bankConnector: IBankConnector;
|
|
235
|
-
|
|
236
|
-
|
|
253
|
+
protected allowedProviders: ConnectorKey[];
|
|
254
|
+
constructor(ctx: ExecutionContext, env: BankEnv, config: ConfigEnvironmentBank);
|
|
255
|
+
getAllowedProviders(): ConnectorKey[];
|
|
256
|
+
getAccounts(): Promise<{
|
|
257
|
+
connectorKey: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA";
|
|
258
|
+
status: "AUTHORIZED" | "DISABLED" | "EXPIRED";
|
|
259
|
+
sync: boolean;
|
|
260
|
+
syncPeriod: number | null;
|
|
261
|
+
lastSyncedAt: Date | null;
|
|
262
|
+
holderName: string;
|
|
263
|
+
number: string;
|
|
264
|
+
bankCode: "5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500";
|
|
265
|
+
iban: string;
|
|
266
|
+
address: string | null;
|
|
267
|
+
swiftBic: string | null;
|
|
268
|
+
bicCor: string | null;
|
|
269
|
+
currency: "CZK" | "EUR" | "USD" | "PLN" | "RON" | "GBP" | "RUB" | "HUF" | "CHF" | "DKK" | "SEK" | "HRK" | "NOK" | "BGN" | "TRY" | "AUD" | "CAD" | "JPY" | "CNY" | "INR" | "BRL" | "MXN" | "ZAR" | "SGD" | "HKD" | "KRW" | "MYR" | "THB" | "IDR" | "PHP" | "AED" | "SAR" | "ILS" | "EGP" | "NGN" | "PKR" | "COP" | "CLP" | "PEN" | "VND" | "KZT" | "UAH" | "BTC" | "ETH" | "ADA" | "DOT" | "ATOM" | "XRP" | "LTC" | "SOL" | "DOGE" | "MATIC" | "AVAX";
|
|
270
|
+
countryCode: "AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW";
|
|
271
|
+
id: string;
|
|
272
|
+
createdAt: Date | null;
|
|
273
|
+
updatedAt: Date | null;
|
|
274
|
+
deletedAt: Date | null;
|
|
275
|
+
}[]>;
|
|
237
276
|
accountFetchInterval(connectorKey: ConnectorKey): number;
|
|
238
277
|
syncAccounts(): Promise<IRPCResponse<void>>;
|
|
239
278
|
scheduled(controller: ScheduledController): Promise<void>;
|
|
279
|
+
updateBatchStatuses(): Promise<void>;
|
|
240
280
|
initiateBankConnector(input: initiateConnectorInput): Promise<initiateConnectorOutput>;
|
|
241
281
|
addPaymentsToBatch({ paymentsToBatch, }: {
|
|
242
282
|
paymentsToBatch: SendPaymentInput[];
|
|
243
283
|
}): Promise<IRPCResponse<{
|
|
244
|
-
|
|
284
|
+
status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | null;
|
|
245
285
|
id: string;
|
|
246
286
|
createdAt: Date | null;
|
|
247
287
|
updatedAt: Date | null;
|
|
248
288
|
deletedAt: Date | null;
|
|
249
289
|
batchPaymentInitiatedAt: Date | null;
|
|
250
290
|
authorizationUrls: string | string[] | null;
|
|
251
|
-
|
|
291
|
+
accountId: string | null;
|
|
252
292
|
payments: PaymentInsertType[];
|
|
253
293
|
metadata: object | null;
|
|
254
294
|
}[] | undefined>>;
|
|
@@ -260,11 +300,11 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
260
300
|
simulateDeposit(input: SimulateDepositInput): Promise<IRPCResponse<SimulateDepositOutput>>;
|
|
261
301
|
setLastSyncAt(input: SetLastSyncAtInput): Promise<IRPCResponse<SetLastSyncAtOutput>>;
|
|
262
302
|
sendPayment(input: SendPaymentInput): Promise<IRPCResponse<SendPaymentOutput>>;
|
|
263
|
-
getBankAccounts(): Promise<IRPCResponse<
|
|
303
|
+
getBankAccounts(): Promise<IRPCResponse<AccountSelectType[]>>;
|
|
264
304
|
getBatches(input: GetBatchesInput): Promise<IRPCResponse<GetBatchesOutput>>;
|
|
265
305
|
}
|
|
266
|
-
declare function defineBankService({
|
|
267
|
-
|
|
306
|
+
declare function defineBankService({ config, }: {
|
|
307
|
+
config: ConfigEnvironmentBank;
|
|
268
308
|
}): new (ctx: ExecutionContext, env: BankEnv) => BankServiceBase;
|
|
269
309
|
|
|
270
310
|
declare const _default: new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv>;
|