@develit-services/bank 0.3.44 → 0.3.46

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 (37) hide show
  1. package/dist/database/schema.cjs +4 -4
  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 +4 -4
  6. package/dist/export/worker.cjs +201 -183
  7. package/dist/export/worker.d.cts +51 -20
  8. package/dist/export/worker.d.mts +51 -20
  9. package/dist/export/worker.d.ts +51 -20
  10. package/dist/export/worker.mjs +161 -143
  11. package/dist/export/workflows.cjs +214 -18
  12. package/dist/export/workflows.mjs +207 -12
  13. package/dist/export/wrangler.d.cts +1 -2
  14. package/dist/export/wrangler.d.mts +1 -2
  15. package/dist/export/wrangler.d.ts +1 -2
  16. package/dist/shared/{bank.DFRS9oN5.mjs → bank.B1Gpn3ht.mjs} +9 -172
  17. package/dist/shared/{bank.D8wUOeOK.d.cts → bank.BEL1HIxZ.d.cts} +20 -1
  18. package/dist/shared/{bank.D8wUOeOK.d.mts → bank.BEL1HIxZ.d.mts} +20 -1
  19. package/dist/shared/{bank.D8wUOeOK.d.ts → bank.BEL1HIxZ.d.ts} +20 -1
  20. package/dist/shared/bank.BUEmFxS8.mjs +174 -0
  21. package/dist/shared/{bank.C335-raZ.cjs → bank.CPYfE-Ei.cjs} +9 -197
  22. package/dist/shared/bank.CpwLFudl.cjs +198 -0
  23. package/dist/shared/bank.D-3fzX63.mjs +170 -0
  24. package/dist/shared/bank.D0a-MZon.cjs +184 -0
  25. package/dist/shared/{bank.BchnXQDL.d.cts → bank.Dh_H_5rC.d.cts} +0 -1
  26. package/dist/shared/{bank.BchnXQDL.d.mts → bank.Dh_H_5rC.d.mts} +0 -1
  27. package/dist/shared/{bank.BchnXQDL.d.ts → bank.Dh_H_5rC.d.ts} +0 -1
  28. package/dist/types.cjs +14 -14
  29. package/dist/types.d.cts +3 -6
  30. package/dist/types.d.mts +3 -6
  31. package/dist/types.d.ts +3 -6
  32. package/dist/types.mjs +5 -5
  33. package/package.json +1 -1
  34. package/dist/shared/bank.Cj-oB02_.mjs +0 -392
  35. package/dist/shared/bank.ClRIj2Ma.cjs +0 -11
  36. package/dist/shared/bank.DhPfZ6b_.mjs +0 -9
  37. package/dist/shared/bank.DwyrLcKu.cjs +0 -402
@@ -1,4 +1,4 @@
1
- import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, I as IBankConnector, a as ConnectorKey, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.D8wUOeOK.cjs';
1
+ import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.BEL1HIxZ.cjs';
2
2
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
3
3
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
@@ -772,6 +772,8 @@ type GetAuthUriOutput = {
772
772
  declare const authorizeAccountInputSchema: z.ZodObject<{
773
773
  ott: z.ZodString;
774
774
  urlParams: z.ZodString;
775
+ syncIntervalS: z.ZodOptional<z.ZodNumber>;
776
+ startSync: z.ZodOptional<z.ZodBoolean>;
775
777
  }, z.core.$strip>;
776
778
  interface AuthorizeAccountInput extends z.infer<typeof authorizeAccountInputSchema> {
777
779
  }
@@ -1642,19 +1644,15 @@ interface ProcessBatchRestartInput extends z.infer<typeof processBatchRestartInp
1642
1644
  }
1643
1645
  type ProcessBatchRestartOutput = z.infer<typeof processBatchRestartOutputSchema>;
1644
1646
 
1645
- declare const processBatchEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1646
- batchId: z.ZodUUID;
1647
- eventType: z.ZodLiteral<"batch-authorized">;
1648
- payload: z.ZodObject<{
1649
- authorized: z.ZodBoolean;
1650
- }, z.core.$strip>;
1651
- }, z.core.$strip>], "eventType">;
1652
- declare const processBatchEventOutputSchema: z.ZodObject<{
1653
- success: z.ZodBoolean;
1654
- message: z.ZodString;
1647
+ declare const updateBatchStatusesInputSchema: z.ZodOptional<z.ZodObject<{
1648
+ batchId: z.ZodOptional<z.ZodUUID>;
1649
+ }, z.core.$strip>>;
1650
+ declare const updateBatchStatusesOutputSchema: z.ZodObject<{
1651
+ processed: z.ZodNumber;
1652
+ statusChanged: z.ZodNumber;
1655
1653
  }, z.core.$strip>;
1656
- type ProcessBatchEventInput = z.infer<typeof processBatchEventInputSchema>;
1657
- type ProcessBatchEventOutput = z.infer<typeof processBatchEventOutputSchema>;
1654
+ type UpdateBatchStatusesInput = z.infer<typeof updateBatchStatusesInputSchema>;
1655
+ type UpdateBatchStatusesOutput = z.infer<typeof updateBatchStatusesOutputSchema>;
1658
1656
 
1659
1657
  declare const getPaymentsInputSchema: z.ZodObject<{
1660
1658
  page: z.ZodNumber;
@@ -2420,7 +2418,6 @@ interface DisconnectAccountOutput extends AccountSelectType {
2420
2418
  declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
2421
2419
  declare class BankServiceBase extends BankServiceBase_base {
2422
2420
  readonly db: DrizzleD1Database<typeof tables>;
2423
- protected bankConnector: IBankConnector;
2424
2421
  protected allowedProviders: ConnectorKey[];
2425
2422
  constructor(ctx: ExecutionContext, env: BankEnv, config: ConfigEnvironmentBank);
2426
2423
  _getAccounts(): Promise<{
@@ -2452,11 +2449,39 @@ declare class BankServiceBase extends BankServiceBase_base {
2452
2449
  updatedAt: Date | null;
2453
2450
  deletedAt: Date | null;
2454
2451
  }[]>;
2455
- _initiateBankConnector({ connectorKey, withAuth, }: {
2452
+ _getConnectedAccounts(): Promise<{
2453
+ expiresAt: Date | undefined;
2454
+ number: string;
2455
+ name: string | null;
2456
+ iban: string;
2457
+ 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";
2458
+ connectorKey: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA";
2459
+ status: "AUTHORIZED" | "DISABLED" | "EXPIRED";
2460
+ bankRefId: string;
2461
+ batchSizeLimit: number;
2462
+ syncIntervalS: number;
2463
+ lastSyncAt: Date | null;
2464
+ lastSyncMetadata: LastSyncMetadata | null;
2465
+ holderName: string;
2466
+ address: string | null;
2467
+ swiftBic: string | null;
2468
+ bicCor: string | null;
2469
+ 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";
2470
+ 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";
2471
+ routingNumber: string | null;
2472
+ sortCode: string | null;
2473
+ clabe: string | null;
2474
+ bsb: string | null;
2475
+ brBankNumber: string | null;
2476
+ id: string;
2477
+ createdAt: Date | null;
2478
+ updatedAt: Date | null;
2479
+ deletedAt: Date | null;
2480
+ }[]>;
2481
+ _initiateBankConnector({ connectorKey, skipAccounts, }: {
2456
2482
  connectorKey: ConnectorKey;
2457
- withAuth?: boolean;
2458
- }): Promise<void>;
2459
- _accountFetchInterval(connectorKey: ConnectorKey): number;
2483
+ skipAccounts?: boolean;
2484
+ }): Promise<IBankConnector>;
2460
2485
  getPayments(input: GetPaymentsInput): Promise<IRPCResponse<GetPaymentsOutput>>;
2461
2486
  syncAccount(input: SyncAccountInput): Promise<IRPCResponse<SyncAccountOutput>>;
2462
2487
  syncAccountStatus(input: SyncAccountStatusInput): Promise<IRPCResponse<SyncAccountStatusOutput>>;
@@ -2464,7 +2489,13 @@ declare class BankServiceBase extends BankServiceBase_base {
2464
2489
  syncAccountTerminate(input: SyncAccountTerminateInput): Promise<IRPCResponse<SyncAccountTerminateOutput>>;
2465
2490
  syncAccounts(): Promise<IRPCResponse<never>>;
2466
2491
  scheduled(controller: ScheduledController): Promise<void>;
2467
- updateBatchStatuses(): Promise<void>;
2492
+ _resolveSingleBatch(batch: BatchSelectType, connector: IBankConnector): Promise<{
2493
+ batchId: string;
2494
+ previousStatus: string | null;
2495
+ currentStatus: string;
2496
+ statusChanged: boolean;
2497
+ } | null>;
2498
+ updateBatchStatuses(input?: UpdateBatchStatusesInput): Promise<IRPCResponse<UpdateBatchStatusesOutput>>;
2468
2499
  addPaymentsToBatch({ paymentsToBatch, }: {
2469
2500
  paymentsToBatch: SendPaymentInput[];
2470
2501
  }): Promise<IRPCResponse<{
@@ -2476,6 +2507,7 @@ declare class BankServiceBase extends BankServiceBase_base {
2476
2507
  accountId: string | null;
2477
2508
  batchPaymentInitiatedAt: Date | null;
2478
2509
  authorizationUrls: string[] | null;
2510
+ statusReason: string | null;
2479
2511
  payments: PaymentInsertType[];
2480
2512
  metadata: BatchMetadata | null;
2481
2513
  paymentsChecksum: string | null;
@@ -2483,7 +2515,6 @@ declare class BankServiceBase extends BankServiceBase_base {
2483
2515
  processBatch(input: ProcessBatchInput): Promise<IRPCResponse<ProcessBatchOutput>>;
2484
2516
  processBatchStatus(input: ProcessBatchStatusInput): Promise<IRPCResponse<ProcessBatchStatusOutput>>;
2485
2517
  processBatchRestart(input: ProcessBatchRestartInput): Promise<IRPCResponse<ProcessBatchRestartOutput>>;
2486
- processBatchEvent(input: ProcessBatchEventInput): Promise<IRPCResponse<ProcessBatchEventOutput>>;
2487
2518
  queue(b: MessageBatch<SendPaymentInput>): Promise<void>;
2488
2519
  getAuthUri(input: GetAuthUriInput): Promise<IRPCResponse<GetAuthUriOutput>>;
2489
2520
  authorizeAccount(input: AuthorizeAccountInput): Promise<IRPCResponse<AuthorizeAccountOutput>>;
@@ -1,4 +1,4 @@
1
- import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, I as IBankConnector, a as ConnectorKey, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.D8wUOeOK.mjs';
1
+ import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.BEL1HIxZ.mjs';
2
2
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
3
3
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
@@ -772,6 +772,8 @@ type GetAuthUriOutput = {
772
772
  declare const authorizeAccountInputSchema: z.ZodObject<{
773
773
  ott: z.ZodString;
774
774
  urlParams: z.ZodString;
775
+ syncIntervalS: z.ZodOptional<z.ZodNumber>;
776
+ startSync: z.ZodOptional<z.ZodBoolean>;
775
777
  }, z.core.$strip>;
776
778
  interface AuthorizeAccountInput extends z.infer<typeof authorizeAccountInputSchema> {
777
779
  }
@@ -1642,19 +1644,15 @@ interface ProcessBatchRestartInput extends z.infer<typeof processBatchRestartInp
1642
1644
  }
1643
1645
  type ProcessBatchRestartOutput = z.infer<typeof processBatchRestartOutputSchema>;
1644
1646
 
1645
- declare const processBatchEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1646
- batchId: z.ZodUUID;
1647
- eventType: z.ZodLiteral<"batch-authorized">;
1648
- payload: z.ZodObject<{
1649
- authorized: z.ZodBoolean;
1650
- }, z.core.$strip>;
1651
- }, z.core.$strip>], "eventType">;
1652
- declare const processBatchEventOutputSchema: z.ZodObject<{
1653
- success: z.ZodBoolean;
1654
- message: z.ZodString;
1647
+ declare const updateBatchStatusesInputSchema: z.ZodOptional<z.ZodObject<{
1648
+ batchId: z.ZodOptional<z.ZodUUID>;
1649
+ }, z.core.$strip>>;
1650
+ declare const updateBatchStatusesOutputSchema: z.ZodObject<{
1651
+ processed: z.ZodNumber;
1652
+ statusChanged: z.ZodNumber;
1655
1653
  }, z.core.$strip>;
1656
- type ProcessBatchEventInput = z.infer<typeof processBatchEventInputSchema>;
1657
- type ProcessBatchEventOutput = z.infer<typeof processBatchEventOutputSchema>;
1654
+ type UpdateBatchStatusesInput = z.infer<typeof updateBatchStatusesInputSchema>;
1655
+ type UpdateBatchStatusesOutput = z.infer<typeof updateBatchStatusesOutputSchema>;
1658
1656
 
1659
1657
  declare const getPaymentsInputSchema: z.ZodObject<{
1660
1658
  page: z.ZodNumber;
@@ -2420,7 +2418,6 @@ interface DisconnectAccountOutput extends AccountSelectType {
2420
2418
  declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
2421
2419
  declare class BankServiceBase extends BankServiceBase_base {
2422
2420
  readonly db: DrizzleD1Database<typeof tables>;
2423
- protected bankConnector: IBankConnector;
2424
2421
  protected allowedProviders: ConnectorKey[];
2425
2422
  constructor(ctx: ExecutionContext, env: BankEnv, config: ConfigEnvironmentBank);
2426
2423
  _getAccounts(): Promise<{
@@ -2452,11 +2449,39 @@ declare class BankServiceBase extends BankServiceBase_base {
2452
2449
  updatedAt: Date | null;
2453
2450
  deletedAt: Date | null;
2454
2451
  }[]>;
2455
- _initiateBankConnector({ connectorKey, withAuth, }: {
2452
+ _getConnectedAccounts(): Promise<{
2453
+ expiresAt: Date | undefined;
2454
+ number: string;
2455
+ name: string | null;
2456
+ iban: string;
2457
+ 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";
2458
+ connectorKey: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA";
2459
+ status: "AUTHORIZED" | "DISABLED" | "EXPIRED";
2460
+ bankRefId: string;
2461
+ batchSizeLimit: number;
2462
+ syncIntervalS: number;
2463
+ lastSyncAt: Date | null;
2464
+ lastSyncMetadata: LastSyncMetadata | null;
2465
+ holderName: string;
2466
+ address: string | null;
2467
+ swiftBic: string | null;
2468
+ bicCor: string | null;
2469
+ 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";
2470
+ 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";
2471
+ routingNumber: string | null;
2472
+ sortCode: string | null;
2473
+ clabe: string | null;
2474
+ bsb: string | null;
2475
+ brBankNumber: string | null;
2476
+ id: string;
2477
+ createdAt: Date | null;
2478
+ updatedAt: Date | null;
2479
+ deletedAt: Date | null;
2480
+ }[]>;
2481
+ _initiateBankConnector({ connectorKey, skipAccounts, }: {
2456
2482
  connectorKey: ConnectorKey;
2457
- withAuth?: boolean;
2458
- }): Promise<void>;
2459
- _accountFetchInterval(connectorKey: ConnectorKey): number;
2483
+ skipAccounts?: boolean;
2484
+ }): Promise<IBankConnector>;
2460
2485
  getPayments(input: GetPaymentsInput): Promise<IRPCResponse<GetPaymentsOutput>>;
2461
2486
  syncAccount(input: SyncAccountInput): Promise<IRPCResponse<SyncAccountOutput>>;
2462
2487
  syncAccountStatus(input: SyncAccountStatusInput): Promise<IRPCResponse<SyncAccountStatusOutput>>;
@@ -2464,7 +2489,13 @@ declare class BankServiceBase extends BankServiceBase_base {
2464
2489
  syncAccountTerminate(input: SyncAccountTerminateInput): Promise<IRPCResponse<SyncAccountTerminateOutput>>;
2465
2490
  syncAccounts(): Promise<IRPCResponse<never>>;
2466
2491
  scheduled(controller: ScheduledController): Promise<void>;
2467
- updateBatchStatuses(): Promise<void>;
2492
+ _resolveSingleBatch(batch: BatchSelectType, connector: IBankConnector): Promise<{
2493
+ batchId: string;
2494
+ previousStatus: string | null;
2495
+ currentStatus: string;
2496
+ statusChanged: boolean;
2497
+ } | null>;
2498
+ updateBatchStatuses(input?: UpdateBatchStatusesInput): Promise<IRPCResponse<UpdateBatchStatusesOutput>>;
2468
2499
  addPaymentsToBatch({ paymentsToBatch, }: {
2469
2500
  paymentsToBatch: SendPaymentInput[];
2470
2501
  }): Promise<IRPCResponse<{
@@ -2476,6 +2507,7 @@ declare class BankServiceBase extends BankServiceBase_base {
2476
2507
  accountId: string | null;
2477
2508
  batchPaymentInitiatedAt: Date | null;
2478
2509
  authorizationUrls: string[] | null;
2510
+ statusReason: string | null;
2479
2511
  payments: PaymentInsertType[];
2480
2512
  metadata: BatchMetadata | null;
2481
2513
  paymentsChecksum: string | null;
@@ -2483,7 +2515,6 @@ declare class BankServiceBase extends BankServiceBase_base {
2483
2515
  processBatch(input: ProcessBatchInput): Promise<IRPCResponse<ProcessBatchOutput>>;
2484
2516
  processBatchStatus(input: ProcessBatchStatusInput): Promise<IRPCResponse<ProcessBatchStatusOutput>>;
2485
2517
  processBatchRestart(input: ProcessBatchRestartInput): Promise<IRPCResponse<ProcessBatchRestartOutput>>;
2486
- processBatchEvent(input: ProcessBatchEventInput): Promise<IRPCResponse<ProcessBatchEventOutput>>;
2487
2518
  queue(b: MessageBatch<SendPaymentInput>): Promise<void>;
2488
2519
  getAuthUri(input: GetAuthUriInput): Promise<IRPCResponse<GetAuthUriOutput>>;
2489
2520
  authorizeAccount(input: AuthorizeAccountInput): Promise<IRPCResponse<AuthorizeAccountOutput>>;
@@ -1,4 +1,4 @@
1
- import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, I as IBankConnector, a as ConnectorKey, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.D8wUOeOK.js';
1
+ import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.BEL1HIxZ.js';
2
2
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
3
3
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
@@ -772,6 +772,8 @@ type GetAuthUriOutput = {
772
772
  declare const authorizeAccountInputSchema: z.ZodObject<{
773
773
  ott: z.ZodString;
774
774
  urlParams: z.ZodString;
775
+ syncIntervalS: z.ZodOptional<z.ZodNumber>;
776
+ startSync: z.ZodOptional<z.ZodBoolean>;
775
777
  }, z.core.$strip>;
776
778
  interface AuthorizeAccountInput extends z.infer<typeof authorizeAccountInputSchema> {
777
779
  }
@@ -1642,19 +1644,15 @@ interface ProcessBatchRestartInput extends z.infer<typeof processBatchRestartInp
1642
1644
  }
1643
1645
  type ProcessBatchRestartOutput = z.infer<typeof processBatchRestartOutputSchema>;
1644
1646
 
1645
- declare const processBatchEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1646
- batchId: z.ZodUUID;
1647
- eventType: z.ZodLiteral<"batch-authorized">;
1648
- payload: z.ZodObject<{
1649
- authorized: z.ZodBoolean;
1650
- }, z.core.$strip>;
1651
- }, z.core.$strip>], "eventType">;
1652
- declare const processBatchEventOutputSchema: z.ZodObject<{
1653
- success: z.ZodBoolean;
1654
- message: z.ZodString;
1647
+ declare const updateBatchStatusesInputSchema: z.ZodOptional<z.ZodObject<{
1648
+ batchId: z.ZodOptional<z.ZodUUID>;
1649
+ }, z.core.$strip>>;
1650
+ declare const updateBatchStatusesOutputSchema: z.ZodObject<{
1651
+ processed: z.ZodNumber;
1652
+ statusChanged: z.ZodNumber;
1655
1653
  }, z.core.$strip>;
1656
- type ProcessBatchEventInput = z.infer<typeof processBatchEventInputSchema>;
1657
- type ProcessBatchEventOutput = z.infer<typeof processBatchEventOutputSchema>;
1654
+ type UpdateBatchStatusesInput = z.infer<typeof updateBatchStatusesInputSchema>;
1655
+ type UpdateBatchStatusesOutput = z.infer<typeof updateBatchStatusesOutputSchema>;
1658
1656
 
1659
1657
  declare const getPaymentsInputSchema: z.ZodObject<{
1660
1658
  page: z.ZodNumber;
@@ -2420,7 +2418,6 @@ interface DisconnectAccountOutput extends AccountSelectType {
2420
2418
  declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
2421
2419
  declare class BankServiceBase extends BankServiceBase_base {
2422
2420
  readonly db: DrizzleD1Database<typeof tables>;
2423
- protected bankConnector: IBankConnector;
2424
2421
  protected allowedProviders: ConnectorKey[];
2425
2422
  constructor(ctx: ExecutionContext, env: BankEnv, config: ConfigEnvironmentBank);
2426
2423
  _getAccounts(): Promise<{
@@ -2452,11 +2449,39 @@ declare class BankServiceBase extends BankServiceBase_base {
2452
2449
  updatedAt: Date | null;
2453
2450
  deletedAt: Date | null;
2454
2451
  }[]>;
2455
- _initiateBankConnector({ connectorKey, withAuth, }: {
2452
+ _getConnectedAccounts(): Promise<{
2453
+ expiresAt: Date | undefined;
2454
+ number: string;
2455
+ name: string | null;
2456
+ iban: string;
2457
+ 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";
2458
+ connectorKey: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA";
2459
+ status: "AUTHORIZED" | "DISABLED" | "EXPIRED";
2460
+ bankRefId: string;
2461
+ batchSizeLimit: number;
2462
+ syncIntervalS: number;
2463
+ lastSyncAt: Date | null;
2464
+ lastSyncMetadata: LastSyncMetadata | null;
2465
+ holderName: string;
2466
+ address: string | null;
2467
+ swiftBic: string | null;
2468
+ bicCor: string | null;
2469
+ 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";
2470
+ 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";
2471
+ routingNumber: string | null;
2472
+ sortCode: string | null;
2473
+ clabe: string | null;
2474
+ bsb: string | null;
2475
+ brBankNumber: string | null;
2476
+ id: string;
2477
+ createdAt: Date | null;
2478
+ updatedAt: Date | null;
2479
+ deletedAt: Date | null;
2480
+ }[]>;
2481
+ _initiateBankConnector({ connectorKey, skipAccounts, }: {
2456
2482
  connectorKey: ConnectorKey;
2457
- withAuth?: boolean;
2458
- }): Promise<void>;
2459
- _accountFetchInterval(connectorKey: ConnectorKey): number;
2483
+ skipAccounts?: boolean;
2484
+ }): Promise<IBankConnector>;
2460
2485
  getPayments(input: GetPaymentsInput): Promise<IRPCResponse<GetPaymentsOutput>>;
2461
2486
  syncAccount(input: SyncAccountInput): Promise<IRPCResponse<SyncAccountOutput>>;
2462
2487
  syncAccountStatus(input: SyncAccountStatusInput): Promise<IRPCResponse<SyncAccountStatusOutput>>;
@@ -2464,7 +2489,13 @@ declare class BankServiceBase extends BankServiceBase_base {
2464
2489
  syncAccountTerminate(input: SyncAccountTerminateInput): Promise<IRPCResponse<SyncAccountTerminateOutput>>;
2465
2490
  syncAccounts(): Promise<IRPCResponse<never>>;
2466
2491
  scheduled(controller: ScheduledController): Promise<void>;
2467
- updateBatchStatuses(): Promise<void>;
2492
+ _resolveSingleBatch(batch: BatchSelectType, connector: IBankConnector): Promise<{
2493
+ batchId: string;
2494
+ previousStatus: string | null;
2495
+ currentStatus: string;
2496
+ statusChanged: boolean;
2497
+ } | null>;
2498
+ updateBatchStatuses(input?: UpdateBatchStatusesInput): Promise<IRPCResponse<UpdateBatchStatusesOutput>>;
2468
2499
  addPaymentsToBatch({ paymentsToBatch, }: {
2469
2500
  paymentsToBatch: SendPaymentInput[];
2470
2501
  }): Promise<IRPCResponse<{
@@ -2476,6 +2507,7 @@ declare class BankServiceBase extends BankServiceBase_base {
2476
2507
  accountId: string | null;
2477
2508
  batchPaymentInitiatedAt: Date | null;
2478
2509
  authorizationUrls: string[] | null;
2510
+ statusReason: string | null;
2479
2511
  payments: PaymentInsertType[];
2480
2512
  metadata: BatchMetadata | null;
2481
2513
  paymentsChecksum: string | null;
@@ -2483,7 +2515,6 @@ declare class BankServiceBase extends BankServiceBase_base {
2483
2515
  processBatch(input: ProcessBatchInput): Promise<IRPCResponse<ProcessBatchOutput>>;
2484
2516
  processBatchStatus(input: ProcessBatchStatusInput): Promise<IRPCResponse<ProcessBatchStatusOutput>>;
2485
2517
  processBatchRestart(input: ProcessBatchRestartInput): Promise<IRPCResponse<ProcessBatchRestartOutput>>;
2486
- processBatchEvent(input: ProcessBatchEventInput): Promise<IRPCResponse<ProcessBatchEventOutput>>;
2487
2518
  queue(b: MessageBatch<SendPaymentInput>): Promise<void>;
2488
2519
  getAuthUri(input: GetAuthUriInput): Promise<IRPCResponse<GetAuthUriOutput>>;
2489
2520
  authorizeAccount(input: AuthorizeAccountInput): Promise<IRPCResponse<AuthorizeAccountOutput>>;