@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.
Files changed (39) hide show
  1. package/dist/database/schema.cjs +10 -1
  2. package/dist/database/schema.d.cts +1 -1
  3. package/dist/database/schema.d.mts +1 -1
  4. package/dist/database/schema.d.ts +1 -1
  5. package/dist/database/schema.mjs +8 -1
  6. package/dist/export/worker.cjs +762 -575
  7. package/dist/export/worker.d.cts +52 -12
  8. package/dist/export/worker.d.mts +52 -12
  9. package/dist/export/worker.d.ts +52 -12
  10. package/dist/export/worker.mjs +732 -545
  11. package/dist/export/wrangler.cjs +1 -1
  12. package/dist/export/wrangler.d.cts +2 -3
  13. package/dist/export/wrangler.d.mts +2 -3
  14. package/dist/export/wrangler.d.ts +2 -3
  15. package/dist/export/wrangler.mjs +1 -1
  16. package/dist/shared/{bank.BuNG2S8h.d.cts → bank.07oMM145.d.cts} +528 -11
  17. package/dist/shared/{bank.BuNG2S8h.d.mts → bank.07oMM145.d.mts} +528 -11
  18. package/dist/shared/{bank.BuNG2S8h.d.ts → bank.07oMM145.d.ts} +528 -11
  19. package/dist/shared/bank.5CiXtVIb.mjs +9 -0
  20. package/dist/shared/{bank.CEZKAEiY.d.cts → bank.BchnXQDL.d.cts} +2 -2
  21. package/dist/shared/{bank.CEZKAEiY.d.mts → bank.BchnXQDL.d.mts} +2 -2
  22. package/dist/shared/{bank.CEZKAEiY.d.ts → bank.BchnXQDL.d.ts} +2 -2
  23. package/dist/shared/bank.BeJh7l2V.cjs +11 -0
  24. package/dist/shared/bank.By8Vh0l5.d.ts +1648 -0
  25. package/dist/shared/bank.CWt0unt2.d.cts +1648 -0
  26. package/dist/shared/{bank.DnDcNEvX.mjs → bank.Ce4ZEpjD.mjs} +329 -107
  27. package/dist/shared/bank.DS18_iuS.d.mts +1648 -0
  28. package/dist/shared/{bank.Cy_TcyKb.cjs → bank.DXzEZPsO.cjs} +346 -106
  29. package/dist/types.cjs +32 -20
  30. package/dist/types.d.cts +496 -35
  31. package/dist/types.d.mts +496 -35
  32. package/dist/types.d.ts +496 -35
  33. package/dist/types.mjs +5 -4
  34. package/package.json +1 -1
  35. package/dist/shared/bank.BkLncGmL.d.ts +0 -122
  36. package/dist/shared/bank.C9jAvwna.mjs +0 -90
  37. package/dist/shared/bank.DWVLVMDa.d.mts +0 -122
  38. package/dist/shared/bank.DmypH3Au.d.cts +0 -122
  39. package/dist/shared/bank.P9gDUycr.cjs +0 -98
@@ -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.BuNG2S8h.cjs';
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 { C as ConfigEnvironmentBankAccount, I as IBankConnector, a as ConfigBankAccount, b as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.DmypH3Au.cjs';
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
- accountId: z.ZodString;
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
- authorized: boolean;
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
- constructor(ctx: ExecutionContext, env: BankEnv, configAccounts: ConfigEnvironmentBankAccount);
236
- protected get accounts(): ConfigBankAccount[];
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
- accountId: string | null;
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
- status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
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<ConfigBankAccount[]>>;
303
+ getBankAccounts(): Promise<IRPCResponse<AccountSelectType[]>>;
264
304
  getBatches(input: GetBatchesInput): Promise<IRPCResponse<GetBatchesOutput>>;
265
305
  }
266
- declare function defineBankService({ configAccounts, }: {
267
- configAccounts: ConfigEnvironmentBankAccount;
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>;
@@ -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.BuNG2S8h.mjs';
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 { C as ConfigEnvironmentBankAccount, I as IBankConnector, a as ConfigBankAccount, b as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.DWVLVMDa.mjs';
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
- accountId: z.ZodString;
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
- authorized: boolean;
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
- constructor(ctx: ExecutionContext, env: BankEnv, configAccounts: ConfigEnvironmentBankAccount);
236
- protected get accounts(): ConfigBankAccount[];
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
- accountId: string | null;
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
- status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
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<ConfigBankAccount[]>>;
303
+ getBankAccounts(): Promise<IRPCResponse<AccountSelectType[]>>;
264
304
  getBatches(input: GetBatchesInput): Promise<IRPCResponse<GetBatchesOutput>>;
265
305
  }
266
- declare function defineBankService({ configAccounts, }: {
267
- configAccounts: ConfigEnvironmentBankAccount;
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>;
@@ -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.BuNG2S8h.js';
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 { C as ConfigEnvironmentBankAccount, I as IBankConnector, a as ConfigBankAccount, b as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.BkLncGmL.js';
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
- accountId: z.ZodString;
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
- authorized: boolean;
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
- constructor(ctx: ExecutionContext, env: BankEnv, configAccounts: ConfigEnvironmentBankAccount);
236
- protected get accounts(): ConfigBankAccount[];
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
- accountId: string | null;
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
- status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
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<ConfigBankAccount[]>>;
303
+ getBankAccounts(): Promise<IRPCResponse<AccountSelectType[]>>;
264
304
  getBatches(input: GetBatchesInput): Promise<IRPCResponse<GetBatchesOutput>>;
265
305
  }
266
- declare function defineBankService({ configAccounts, }: {
267
- configAccounts: ConfigEnvironmentBankAccount;
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>;