@develit-services/bank 0.0.19 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- export { c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.mGCkS7Y9.cjs';
1
+ export { c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.BuNG2S8h.cjs';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import 'zod';
@@ -1,4 +1,4 @@
1
- export { c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.mGCkS7Y9.mjs';
1
+ export { c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.BuNG2S8h.mjs';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import 'zod';
@@ -1,4 +1,4 @@
1
- export { c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.mGCkS7Y9.js';
1
+ export { c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.BuNG2S8h.js';
2
2
  import 'drizzle-orm/sqlite-core';
3
3
  import 'drizzle-orm';
4
4
  import 'zod';
@@ -73,6 +73,11 @@ const getBatchesInputSchema = zod.z.object({
73
73
  offset: zod.z.number().min(0).optional().default(0)
74
74
  });
75
75
 
76
+ const processBatchInputSchema = zod.z.object({
77
+ connectorKey: zod.z.enum(database_schema.CONNECTOR_KEYS),
78
+ batch: zod.z.custom()
79
+ });
80
+
76
81
  const createPaymentCommand = (db$1, { payment }) => {
77
82
  return {
78
83
  command: db$1.insert(db.tables.payment).values(payment).returning()
@@ -441,126 +446,126 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
441
446
  }
442
447
  });
443
448
  }
444
- async processBatch({
445
- batch,
446
- connectorKey
447
- }) {
448
- return this.handleAction(null, {}, async () => {
449
- this.logInput({ batch, connectorKey });
450
- await upsertBatchCommand(this.db, {
451
- batch: {
452
- ...batch,
453
- status: "PROCESSING"
454
- }
455
- }).command.execute();
456
- await this.initiateBankConnector({ connectorKey });
457
- if (!this.bankConnector) {
449
+ async processBatch(input) {
450
+ return this.handleAction(
451
+ { data: input, schema: processBatchInputSchema },
452
+ {},
453
+ async ({ batch, connectorKey }) => {
458
454
  await upsertBatchCommand(this.db, {
459
455
  batch: {
460
456
  ...batch,
461
- status: "FAILED"
457
+ status: "PROCESSING"
462
458
  }
463
459
  }).command.execute();
464
- throw backendSdk.createInternalError(null, {
465
- message: `\u274C Failed to initialize ${connectorKey} bank connector`
466
- });
467
- }
468
- this.log({
469
- message: `\u2705 Bank connector initialized successfully for account ${connectorKey}`
470
- });
471
- const preparedBatch = {
472
- retriedPayments: [],
473
- newlyPreparedPayments: [],
474
- failedPayments: []
475
- };
476
- for (const payment of batch.payments) {
477
- const existingPayment = await getPaymentByRefIdQuery(this.db, {
478
- refId: payment.refId
479
- });
480
- if (existingPayment) {
481
- preparedBatch.retriedPayments.push({
482
- ...existingPayment,
483
- status: "PREPARED"
484
- });
485
- this.log({
486
- message: `\u2705 Payment ${existingPayment.id} already exists`
460
+ await this.initiateBankConnector({ connectorKey });
461
+ if (!this.bankConnector) {
462
+ await upsertBatchCommand(this.db, {
463
+ batch: {
464
+ ...batch,
465
+ status: "FAILED"
466
+ }
467
+ }).command.execute();
468
+ throw backendSdk.createInternalError(null, {
469
+ message: `\u274C Failed to initialize ${connectorKey} bank connector`
487
470
  });
488
- continue;
489
471
  }
490
- const newlyPreparedPayment = await this.bankConnector.preparePayment(payment);
491
- if (!newlyPreparedPayment) {
492
- preparedBatch.failedPayments.push({ ...payment, status: "FAILED" });
493
- continue;
494
- }
495
- preparedBatch.newlyPreparedPayments.push(newlyPreparedPayment);
496
- }
497
- await Promise.all([
498
- [
499
- ...preparedBatch.failedPayments,
500
- ...preparedBatch.newlyPreparedPayments
501
- ].map(
502
- (p) => createPaymentCommand(this.db, { payment: p }).command.execute()
503
- )
504
- ]);
505
- await upsertBatchCommand(this.db, {
506
- batch: {
507
- ...batch,
508
- status: "PREPARED"
472
+ this.log({
473
+ message: `\u2705 Bank connector initialized successfully for account ${connectorKey}`
474
+ });
475
+ const preparedBatch = {
476
+ retriedPayments: [],
477
+ newlyPreparedPayments: [],
478
+ failedPayments: []
479
+ };
480
+ for (const payment of batch.payments) {
481
+ const existingPayment = await getPaymentByRefIdQuery(this.db, {
482
+ refId: payment.refId
483
+ });
484
+ if (existingPayment) {
485
+ preparedBatch.retriedPayments.push({
486
+ ...existingPayment,
487
+ status: "PREPARED"
488
+ });
489
+ this.log({
490
+ message: `\u2705 Payment ${existingPayment.id} already exists`
491
+ });
492
+ continue;
493
+ }
494
+ const newlyPreparedPayment = await this.bankConnector.preparePayment(payment);
495
+ if (!newlyPreparedPayment) {
496
+ preparedBatch.failedPayments.push({ ...payment, status: "FAILED" });
497
+ continue;
498
+ }
499
+ preparedBatch.newlyPreparedPayments.push(newlyPreparedPayment);
509
500
  }
510
- }).command.execute();
511
- const { authorizationUrls, payments, metadata } = await this.bankConnector.initiateBatchFromPayments({
512
- payments: [
513
- ...preparedBatch.newlyPreparedPayments,
514
- ...preparedBatch.retriedPayments
515
- ]
516
- });
517
- if (!authorizationUrls) {
518
- this.logError({ message: "Failed to retrieve signing URI" });
501
+ await Promise.all([
502
+ [
503
+ ...preparedBatch.failedPayments,
504
+ ...preparedBatch.newlyPreparedPayments
505
+ ].map(
506
+ (p) => createPaymentCommand(this.db, { payment: p }).command.execute()
507
+ )
508
+ ]);
519
509
  await upsertBatchCommand(this.db, {
520
510
  batch: {
521
511
  ...batch,
522
- status: "FAILED"
512
+ status: "PREPARED"
523
513
  }
524
514
  }).command.execute();
525
- return;
526
- }
527
- const { command: upsertBatch } = upsertBatchCommand(this.db, {
528
- batch: {
529
- ...batch,
530
- payments,
531
- metadata,
532
- status: "READY_TO_SIGN",
533
- authorizationUrls,
534
- batchPaymentInitiatedAt: /* @__PURE__ */ new Date()
515
+ const { authorizationUrls, payments, metadata } = await this.bankConnector.initiateBatchFromPayments({
516
+ payments: [
517
+ ...preparedBatch.newlyPreparedPayments,
518
+ ...preparedBatch.retriedPayments
519
+ ]
520
+ });
521
+ if (!authorizationUrls) {
522
+ this.logError({ message: "Failed to retrieve signing URI" });
523
+ await upsertBatchCommand(this.db, {
524
+ batch: {
525
+ ...batch,
526
+ status: "FAILED"
527
+ }
528
+ }).command.execute();
529
+ return;
535
530
  }
536
- });
537
- const updatePayments = payments.map(
538
- (payment) => updatePaymentCommand(this.db, {
539
- payment: { ...payment, status: "INITIALIZED" }
540
- }).command
541
- );
542
- await this.db.batch([upsertBatch, ...updatePayments]);
543
- this.log({
544
- message: "Authorization Urls for batch to create",
545
- authorizationUrl: authorizationUrls[0]
546
- });
547
- await this.pushToQueue(this.env.NOTIFICATIONS_QUEUE, {
548
- type: "email",
549
- payload: {
550
- email: {
551
- to: [this.env.BANK_AUTH_RECIPIENT],
552
- subject: "Payment Authorization",
553
- text: authorizationUrls[0] || "No Authorization Url"
531
+ const { command: upsertBatch } = upsertBatchCommand(this.db, {
532
+ batch: {
533
+ ...batch,
534
+ payments,
535
+ metadata,
536
+ status: "READY_TO_SIGN",
537
+ authorizationUrls,
538
+ batchPaymentInitiatedAt: /* @__PURE__ */ new Date()
554
539
  }
555
- },
556
- metadata: {
557
- initiator: {
558
- service: this.name
540
+ });
541
+ const updatePayments = payments.map(
542
+ (payment) => updatePaymentCommand(this.db, {
543
+ payment: { ...payment, status: "INITIALIZED" }
544
+ }).command
545
+ );
546
+ await this.db.batch([upsertBatch, ...updatePayments]);
547
+ this.log({
548
+ message: "Authorization Urls for batch to create",
549
+ authorizationUrl: authorizationUrls[0]
550
+ });
551
+ await this.pushToQueue(this.env.NOTIFICATIONS_QUEUE, {
552
+ type: "email",
553
+ payload: {
554
+ email: {
555
+ to: [this.env.BANK_AUTH_RECIPIENT],
556
+ subject: "Payment Authorization",
557
+ text: authorizationUrls[0] || "No Authorization Url"
558
+ }
559
+ },
560
+ metadata: {
561
+ initiator: {
562
+ service: this.name
563
+ }
559
564
  }
560
- }
561
- });
562
- this.logOutput({ message: "Batch successfully processed" });
563
- });
565
+ });
566
+ this.logOutput({ message: "Batch successfully processed" });
567
+ }
568
+ );
564
569
  }
565
570
  async queue(b) {
566
571
  await this.handleAction(
@@ -1,10 +1,10 @@
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.mGCkS7Y9.cjs';
3
+ import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.BuNG2S8h.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.TyzHNrzR.cjs';
7
+ import { C as ConfigEnvironmentBankAccount, I as IBankConnector, a as ConfigBankAccount, b as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.DmypH3Au.cjs';
8
8
  import 'drizzle-orm/sqlite-core';
9
9
  import 'drizzle-orm';
10
10
  import '@develit-io/general-codes';
@@ -212,6 +212,21 @@ interface GetBatchesOutput {
212
212
  totalCount: number;
213
213
  }
214
214
 
215
+ declare const processBatchInputSchema: z.ZodObject<{
216
+ connectorKey: z.ZodEnum<{
217
+ ERSTE: "ERSTE";
218
+ FINBRICKS: "FINBRICKS";
219
+ MOCK: "MOCK";
220
+ CREDITAS: "CREDITAS";
221
+ MOCK_COBS: "MOCK_COBS";
222
+ FIO: "FIO";
223
+ MONETA: "MONETA";
224
+ }>;
225
+ batch: z.ZodCustom<BatchSelectType, BatchSelectType>;
226
+ }, z.core.$strip>;
227
+ interface ProcessBatchInput extends z.infer<typeof processBatchInputSchema> {
228
+ }
229
+
215
230
  declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
216
231
  declare class BankServiceBase extends BankServiceBase_base {
217
232
  readonly configAccounts: ConfigEnvironmentBankAccount;
@@ -226,21 +241,18 @@ declare class BankServiceBase extends BankServiceBase_base {
226
241
  addPaymentsToBatch({ paymentsToBatch, }: {
227
242
  paymentsToBatch: SendPaymentInput[];
228
243
  }): Promise<IRPCResponse<{
229
- batchPaymentInitiatedAt: Date | null;
230
- authorizationUrls: string | string[] | null;
231
244
  accountId: string | null;
232
- status: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED" | null;
233
- payments: PaymentInsertType[];
234
- metadata: object | null;
235
245
  id: string;
236
246
  createdAt: Date | null;
237
247
  updatedAt: Date | null;
238
248
  deletedAt: Date | null;
249
+ status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
250
+ batchPaymentInitiatedAt: Date | null;
251
+ authorizationUrls: string | string[] | null;
252
+ payments: PaymentInsertType[];
253
+ metadata: object | null;
239
254
  }[] | undefined>>;
240
- processBatch({ batch, connectorKey, }: {
241
- batch: BatchSelectType;
242
- connectorKey: ConnectorKey;
243
- }): Promise<IRPCResponse<void>>;
255
+ processBatch(input: ProcessBatchInput): Promise<IRPCResponse<void>>;
244
256
  queue(b: MessageBatch<SendPaymentInput>): Promise<void>;
245
257
  getAuthUri(input: GetAuthUriInput): Promise<IRPCResponse<GetAuthUriOutput>>;
246
258
  authorizeAccount(input: AuthorizeAccountInput): Promise<IRPCResponse<AuthorizeAccountOutput>>;
@@ -1,10 +1,10 @@
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.mGCkS7Y9.mjs';
3
+ import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.BuNG2S8h.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.C8aShbaN.mjs';
7
+ import { C as ConfigEnvironmentBankAccount, I as IBankConnector, a as ConfigBankAccount, b as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.DWVLVMDa.mjs';
8
8
  import 'drizzle-orm/sqlite-core';
9
9
  import 'drizzle-orm';
10
10
  import '@develit-io/general-codes';
@@ -212,6 +212,21 @@ interface GetBatchesOutput {
212
212
  totalCount: number;
213
213
  }
214
214
 
215
+ declare const processBatchInputSchema: z.ZodObject<{
216
+ connectorKey: z.ZodEnum<{
217
+ ERSTE: "ERSTE";
218
+ FINBRICKS: "FINBRICKS";
219
+ MOCK: "MOCK";
220
+ CREDITAS: "CREDITAS";
221
+ MOCK_COBS: "MOCK_COBS";
222
+ FIO: "FIO";
223
+ MONETA: "MONETA";
224
+ }>;
225
+ batch: z.ZodCustom<BatchSelectType, BatchSelectType>;
226
+ }, z.core.$strip>;
227
+ interface ProcessBatchInput extends z.infer<typeof processBatchInputSchema> {
228
+ }
229
+
215
230
  declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
216
231
  declare class BankServiceBase extends BankServiceBase_base {
217
232
  readonly configAccounts: ConfigEnvironmentBankAccount;
@@ -226,21 +241,18 @@ declare class BankServiceBase extends BankServiceBase_base {
226
241
  addPaymentsToBatch({ paymentsToBatch, }: {
227
242
  paymentsToBatch: SendPaymentInput[];
228
243
  }): Promise<IRPCResponse<{
229
- batchPaymentInitiatedAt: Date | null;
230
- authorizationUrls: string | string[] | null;
231
244
  accountId: string | null;
232
- status: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED" | null;
233
- payments: PaymentInsertType[];
234
- metadata: object | null;
235
245
  id: string;
236
246
  createdAt: Date | null;
237
247
  updatedAt: Date | null;
238
248
  deletedAt: Date | null;
249
+ status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
250
+ batchPaymentInitiatedAt: Date | null;
251
+ authorizationUrls: string | string[] | null;
252
+ payments: PaymentInsertType[];
253
+ metadata: object | null;
239
254
  }[] | undefined>>;
240
- processBatch({ batch, connectorKey, }: {
241
- batch: BatchSelectType;
242
- connectorKey: ConnectorKey;
243
- }): Promise<IRPCResponse<void>>;
255
+ processBatch(input: ProcessBatchInput): Promise<IRPCResponse<void>>;
244
256
  queue(b: MessageBatch<SendPaymentInput>): Promise<void>;
245
257
  getAuthUri(input: GetAuthUriInput): Promise<IRPCResponse<GetAuthUriOutput>>;
246
258
  authorizeAccount(input: AuthorizeAccountInput): Promise<IRPCResponse<AuthorizeAccountOutput>>;
@@ -1,10 +1,10 @@
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.mGCkS7Y9.js';
3
+ import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.BuNG2S8h.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.zK_DX1oe.js';
7
+ import { C as ConfigEnvironmentBankAccount, I as IBankConnector, a as ConfigBankAccount, b as ConnectorKey, B as BankAccountWithLastSync } from '../shared/bank.BkLncGmL.js';
8
8
  import 'drizzle-orm/sqlite-core';
9
9
  import 'drizzle-orm';
10
10
  import '@develit-io/general-codes';
@@ -212,6 +212,21 @@ interface GetBatchesOutput {
212
212
  totalCount: number;
213
213
  }
214
214
 
215
+ declare const processBatchInputSchema: z.ZodObject<{
216
+ connectorKey: z.ZodEnum<{
217
+ ERSTE: "ERSTE";
218
+ FINBRICKS: "FINBRICKS";
219
+ MOCK: "MOCK";
220
+ CREDITAS: "CREDITAS";
221
+ MOCK_COBS: "MOCK_COBS";
222
+ FIO: "FIO";
223
+ MONETA: "MONETA";
224
+ }>;
225
+ batch: z.ZodCustom<BatchSelectType, BatchSelectType>;
226
+ }, z.core.$strip>;
227
+ interface ProcessBatchInput extends z.infer<typeof processBatchInputSchema> {
228
+ }
229
+
215
230
  declare const BankServiceBase_base: (abstract new (ctx: ExecutionContext, env: BankEnv) => WorkerEntrypoint<BankEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
216
231
  declare class BankServiceBase extends BankServiceBase_base {
217
232
  readonly configAccounts: ConfigEnvironmentBankAccount;
@@ -226,21 +241,18 @@ declare class BankServiceBase extends BankServiceBase_base {
226
241
  addPaymentsToBatch({ paymentsToBatch, }: {
227
242
  paymentsToBatch: SendPaymentInput[];
228
243
  }): Promise<IRPCResponse<{
229
- batchPaymentInitiatedAt: Date | null;
230
- authorizationUrls: string | string[] | null;
231
244
  accountId: string | null;
232
- status: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED" | null;
233
- payments: PaymentInsertType[];
234
- metadata: object | null;
235
245
  id: string;
236
246
  createdAt: Date | null;
237
247
  updatedAt: Date | null;
238
248
  deletedAt: Date | null;
249
+ status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | null;
250
+ batchPaymentInitiatedAt: Date | null;
251
+ authorizationUrls: string | string[] | null;
252
+ payments: PaymentInsertType[];
253
+ metadata: object | null;
239
254
  }[] | undefined>>;
240
- processBatch({ batch, connectorKey, }: {
241
- batch: BatchSelectType;
242
- connectorKey: ConnectorKey;
243
- }): Promise<IRPCResponse<void>>;
255
+ processBatch(input: ProcessBatchInput): Promise<IRPCResponse<void>>;
244
256
  queue(b: MessageBatch<SendPaymentInput>): Promise<void>;
245
257
  getAuthUri(input: GetAuthUriInput): Promise<IRPCResponse<GetAuthUriOutput>>;
246
258
  authorizeAccount(input: AuthorizeAccountInput): Promise<IRPCResponse<AuthorizeAccountOutput>>;
@@ -65,6 +65,11 @@ const getBatchesInputSchema = z.object({
65
65
  offset: z.number().min(0).optional().default(0)
66
66
  });
67
67
 
68
+ const processBatchInputSchema = z.object({
69
+ connectorKey: z.enum(CONNECTOR_KEYS),
70
+ batch: z.custom()
71
+ });
72
+
68
73
  const createPaymentCommand = (db, { payment }) => {
69
74
  return {
70
75
  command: db.insert(tables.payment).values(payment).returning()
@@ -433,126 +438,126 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
433
438
  }
434
439
  });
435
440
  }
436
- async processBatch({
437
- batch,
438
- connectorKey
439
- }) {
440
- return this.handleAction(null, {}, async () => {
441
- this.logInput({ batch, connectorKey });
442
- await upsertBatchCommand(this.db, {
443
- batch: {
444
- ...batch,
445
- status: "PROCESSING"
446
- }
447
- }).command.execute();
448
- await this.initiateBankConnector({ connectorKey });
449
- if (!this.bankConnector) {
441
+ async processBatch(input) {
442
+ return this.handleAction(
443
+ { data: input, schema: processBatchInputSchema },
444
+ {},
445
+ async ({ batch, connectorKey }) => {
450
446
  await upsertBatchCommand(this.db, {
451
447
  batch: {
452
448
  ...batch,
453
- status: "FAILED"
449
+ status: "PROCESSING"
454
450
  }
455
451
  }).command.execute();
456
- throw createInternalError(null, {
457
- message: `\u274C Failed to initialize ${connectorKey} bank connector`
458
- });
459
- }
460
- this.log({
461
- message: `\u2705 Bank connector initialized successfully for account ${connectorKey}`
462
- });
463
- const preparedBatch = {
464
- retriedPayments: [],
465
- newlyPreparedPayments: [],
466
- failedPayments: []
467
- };
468
- for (const payment of batch.payments) {
469
- const existingPayment = await getPaymentByRefIdQuery(this.db, {
470
- refId: payment.refId
471
- });
472
- if (existingPayment) {
473
- preparedBatch.retriedPayments.push({
474
- ...existingPayment,
475
- status: "PREPARED"
476
- });
477
- this.log({
478
- message: `\u2705 Payment ${existingPayment.id} already exists`
452
+ await this.initiateBankConnector({ connectorKey });
453
+ if (!this.bankConnector) {
454
+ await upsertBatchCommand(this.db, {
455
+ batch: {
456
+ ...batch,
457
+ status: "FAILED"
458
+ }
459
+ }).command.execute();
460
+ throw createInternalError(null, {
461
+ message: `\u274C Failed to initialize ${connectorKey} bank connector`
479
462
  });
480
- continue;
481
463
  }
482
- const newlyPreparedPayment = await this.bankConnector.preparePayment(payment);
483
- if (!newlyPreparedPayment) {
484
- preparedBatch.failedPayments.push({ ...payment, status: "FAILED" });
485
- continue;
486
- }
487
- preparedBatch.newlyPreparedPayments.push(newlyPreparedPayment);
488
- }
489
- await Promise.all([
490
- [
491
- ...preparedBatch.failedPayments,
492
- ...preparedBatch.newlyPreparedPayments
493
- ].map(
494
- (p) => createPaymentCommand(this.db, { payment: p }).command.execute()
495
- )
496
- ]);
497
- await upsertBatchCommand(this.db, {
498
- batch: {
499
- ...batch,
500
- status: "PREPARED"
464
+ this.log({
465
+ message: `\u2705 Bank connector initialized successfully for account ${connectorKey}`
466
+ });
467
+ const preparedBatch = {
468
+ retriedPayments: [],
469
+ newlyPreparedPayments: [],
470
+ failedPayments: []
471
+ };
472
+ for (const payment of batch.payments) {
473
+ const existingPayment = await getPaymentByRefIdQuery(this.db, {
474
+ refId: payment.refId
475
+ });
476
+ if (existingPayment) {
477
+ preparedBatch.retriedPayments.push({
478
+ ...existingPayment,
479
+ status: "PREPARED"
480
+ });
481
+ this.log({
482
+ message: `\u2705 Payment ${existingPayment.id} already exists`
483
+ });
484
+ continue;
485
+ }
486
+ const newlyPreparedPayment = await this.bankConnector.preparePayment(payment);
487
+ if (!newlyPreparedPayment) {
488
+ preparedBatch.failedPayments.push({ ...payment, status: "FAILED" });
489
+ continue;
490
+ }
491
+ preparedBatch.newlyPreparedPayments.push(newlyPreparedPayment);
501
492
  }
502
- }).command.execute();
503
- const { authorizationUrls, payments, metadata } = await this.bankConnector.initiateBatchFromPayments({
504
- payments: [
505
- ...preparedBatch.newlyPreparedPayments,
506
- ...preparedBatch.retriedPayments
507
- ]
508
- });
509
- if (!authorizationUrls) {
510
- this.logError({ message: "Failed to retrieve signing URI" });
493
+ await Promise.all([
494
+ [
495
+ ...preparedBatch.failedPayments,
496
+ ...preparedBatch.newlyPreparedPayments
497
+ ].map(
498
+ (p) => createPaymentCommand(this.db, { payment: p }).command.execute()
499
+ )
500
+ ]);
511
501
  await upsertBatchCommand(this.db, {
512
502
  batch: {
513
503
  ...batch,
514
- status: "FAILED"
504
+ status: "PREPARED"
515
505
  }
516
506
  }).command.execute();
517
- return;
518
- }
519
- const { command: upsertBatch } = upsertBatchCommand(this.db, {
520
- batch: {
521
- ...batch,
522
- payments,
523
- metadata,
524
- status: "READY_TO_SIGN",
525
- authorizationUrls,
526
- batchPaymentInitiatedAt: /* @__PURE__ */ new Date()
507
+ const { authorizationUrls, payments, metadata } = await this.bankConnector.initiateBatchFromPayments({
508
+ payments: [
509
+ ...preparedBatch.newlyPreparedPayments,
510
+ ...preparedBatch.retriedPayments
511
+ ]
512
+ });
513
+ if (!authorizationUrls) {
514
+ this.logError({ message: "Failed to retrieve signing URI" });
515
+ await upsertBatchCommand(this.db, {
516
+ batch: {
517
+ ...batch,
518
+ status: "FAILED"
519
+ }
520
+ }).command.execute();
521
+ return;
527
522
  }
528
- });
529
- const updatePayments = payments.map(
530
- (payment) => updatePaymentCommand(this.db, {
531
- payment: { ...payment, status: "INITIALIZED" }
532
- }).command
533
- );
534
- await this.db.batch([upsertBatch, ...updatePayments]);
535
- this.log({
536
- message: "Authorization Urls for batch to create",
537
- authorizationUrl: authorizationUrls[0]
538
- });
539
- await this.pushToQueue(this.env.NOTIFICATIONS_QUEUE, {
540
- type: "email",
541
- payload: {
542
- email: {
543
- to: [this.env.BANK_AUTH_RECIPIENT],
544
- subject: "Payment Authorization",
545
- text: authorizationUrls[0] || "No Authorization Url"
523
+ const { command: upsertBatch } = upsertBatchCommand(this.db, {
524
+ batch: {
525
+ ...batch,
526
+ payments,
527
+ metadata,
528
+ status: "READY_TO_SIGN",
529
+ authorizationUrls,
530
+ batchPaymentInitiatedAt: /* @__PURE__ */ new Date()
546
531
  }
547
- },
548
- metadata: {
549
- initiator: {
550
- service: this.name
532
+ });
533
+ const updatePayments = payments.map(
534
+ (payment) => updatePaymentCommand(this.db, {
535
+ payment: { ...payment, status: "INITIALIZED" }
536
+ }).command
537
+ );
538
+ await this.db.batch([upsertBatch, ...updatePayments]);
539
+ this.log({
540
+ message: "Authorization Urls for batch to create",
541
+ authorizationUrl: authorizationUrls[0]
542
+ });
543
+ await this.pushToQueue(this.env.NOTIFICATIONS_QUEUE, {
544
+ type: "email",
545
+ payload: {
546
+ email: {
547
+ to: [this.env.BANK_AUTH_RECIPIENT],
548
+ subject: "Payment Authorization",
549
+ text: authorizationUrls[0] || "No Authorization Url"
550
+ }
551
+ },
552
+ metadata: {
553
+ initiator: {
554
+ service: this.name
555
+ }
551
556
  }
552
- }
553
- });
554
- this.logOutput({ message: "Batch successfully processed" });
555
- });
557
+ });
558
+ this.logOutput({ message: "Batch successfully processed" });
559
+ }
560
+ );
556
561
  }
557
562
  async queue(b) {
558
563
  await this.handleAction(
@@ -1,6 +1,6 @@
1
1
  import { Environment } from '@develit-io/backend-sdk';
2
2
  import { BANK_CODES, CURRENCY_CODES, CODES } from '@develit-io/general-codes';
3
- import { a as PaymentInsertType, t as tables } from './bank.mGCkS7Y9.js';
3
+ import { a as PaymentInsertType, t as tables } from './bank.BuNG2S8h.js';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
5
 
6
6
  declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "IFSC", "DOMESTIC"];
@@ -82,10 +82,10 @@ declare const paymentInsertTypeZod: z.ZodObject<{
82
82
  }>;
83
83
  status: z.ZodEnum<{
84
84
  PREPARED: "PREPARED";
85
- COMPLETED: "COMPLETED";
86
- FAILED: "FAILED";
87
85
  INITIALIZED: "INITIALIZED";
86
+ FAILED: "FAILED";
88
87
  PENDING: "PENDING";
88
+ COMPLETED: "COMPLETED";
89
89
  CREATED: "CREATED";
90
90
  }>;
91
91
  batchId: z.ZodString;
@@ -165,7 +165,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
165
165
  tableName: "batch";
166
166
  dataType: "string";
167
167
  columnType: "SQLiteText";
168
- data: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
168
+ data: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
169
169
  driverParam: string;
170
170
  notNull: false;
171
171
  hasDefault: false;
@@ -178,7 +178,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
178
178
  generated: undefined;
179
179
  }, {}, {
180
180
  length: number | undefined;
181
- $type: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
181
+ $type: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
182
182
  }>;
183
183
  payments: drizzle_orm_sqlite_core.SQLiteColumn<{
184
184
  name: "payments";
@@ -416,7 +416,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
416
416
  tableName: "payment";
417
417
  dataType: "string";
418
418
  columnType: "SQLiteText";
419
- data: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
419
+ data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
420
420
  driverParam: string;
421
421
  notNull: true;
422
422
  hasDefault: false;
@@ -429,7 +429,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
429
429
  generated: undefined;
430
430
  }, {}, {
431
431
  length: number | undefined;
432
- $type: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
432
+ $type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
433
433
  }>;
434
434
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
435
435
  name: "status_reason";
@@ -82,10 +82,10 @@ declare const paymentInsertTypeZod: z.ZodObject<{
82
82
  }>;
83
83
  status: z.ZodEnum<{
84
84
  PREPARED: "PREPARED";
85
- COMPLETED: "COMPLETED";
86
- FAILED: "FAILED";
87
85
  INITIALIZED: "INITIALIZED";
86
+ FAILED: "FAILED";
88
87
  PENDING: "PENDING";
88
+ COMPLETED: "COMPLETED";
89
89
  CREATED: "CREATED";
90
90
  }>;
91
91
  batchId: z.ZodString;
@@ -165,7 +165,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
165
165
  tableName: "batch";
166
166
  dataType: "string";
167
167
  columnType: "SQLiteText";
168
- data: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
168
+ data: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
169
169
  driverParam: string;
170
170
  notNull: false;
171
171
  hasDefault: false;
@@ -178,7 +178,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
178
178
  generated: undefined;
179
179
  }, {}, {
180
180
  length: number | undefined;
181
- $type: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
181
+ $type: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
182
182
  }>;
183
183
  payments: drizzle_orm_sqlite_core.SQLiteColumn<{
184
184
  name: "payments";
@@ -416,7 +416,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
416
416
  tableName: "payment";
417
417
  dataType: "string";
418
418
  columnType: "SQLiteText";
419
- data: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
419
+ data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
420
420
  driverParam: string;
421
421
  notNull: true;
422
422
  hasDefault: false;
@@ -429,7 +429,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
429
429
  generated: undefined;
430
430
  }, {}, {
431
431
  length: number | undefined;
432
- $type: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
432
+ $type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
433
433
  }>;
434
434
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
435
435
  name: "status_reason";
@@ -82,10 +82,10 @@ declare const paymentInsertTypeZod: z.ZodObject<{
82
82
  }>;
83
83
  status: z.ZodEnum<{
84
84
  PREPARED: "PREPARED";
85
- COMPLETED: "COMPLETED";
86
- FAILED: "FAILED";
87
85
  INITIALIZED: "INITIALIZED";
86
+ FAILED: "FAILED";
88
87
  PENDING: "PENDING";
88
+ COMPLETED: "COMPLETED";
89
89
  CREATED: "CREATED";
90
90
  }>;
91
91
  batchId: z.ZodString;
@@ -165,7 +165,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
165
165
  tableName: "batch";
166
166
  dataType: "string";
167
167
  columnType: "SQLiteText";
168
- data: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
168
+ data: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
169
169
  driverParam: string;
170
170
  notNull: false;
171
171
  hasDefault: false;
@@ -178,7 +178,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
178
178
  generated: undefined;
179
179
  }, {}, {
180
180
  length: number | undefined;
181
- $type: "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN" | "PREPARED" | "COMPLETED" | "FAILED";
181
+ $type: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
182
182
  }>;
183
183
  payments: drizzle_orm_sqlite_core.SQLiteColumn<{
184
184
  name: "payments";
@@ -416,7 +416,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
416
416
  tableName: "payment";
417
417
  dataType: "string";
418
418
  columnType: "SQLiteText";
419
- data: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
419
+ data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
420
420
  driverParam: string;
421
421
  notNull: true;
422
422
  hasDefault: false;
@@ -429,7 +429,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
429
429
  generated: undefined;
430
430
  }, {}, {
431
431
  length: number | undefined;
432
- $type: "PREPARED" | "COMPLETED" | "FAILED" | "INITIALIZED" | "PENDING" | "CREATED";
432
+ $type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
433
433
  }>;
434
434
  statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
435
435
  name: "status_reason";
@@ -1,6 +1,6 @@
1
1
  import { Environment } from '@develit-io/backend-sdk';
2
2
  import { BANK_CODES, CURRENCY_CODES, CODES } from '@develit-io/general-codes';
3
- import { a as PaymentInsertType, t as tables } from './bank.mGCkS7Y9.mjs';
3
+ import { a as PaymentInsertType, t as tables } from './bank.BuNG2S8h.mjs';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
5
 
6
6
  declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "IFSC", "DOMESTIC"];
@@ -1,6 +1,6 @@
1
1
  import { Environment } from '@develit-io/backend-sdk';
2
2
  import { BANK_CODES, CURRENCY_CODES, CODES } from '@develit-io/general-codes';
3
- import { a as PaymentInsertType, t as tables } from './bank.mGCkS7Y9.cjs';
3
+ import { a as PaymentInsertType, t as tables } from './bank.BuNG2S8h.cjs';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
5
 
6
6
  declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "IFSC", "DOMESTIC"];
package/dist/types.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { c as CurrencyCode, d as BankCode, e as CountryCode, I as IBankConnector, b as ConnectorKey, A as AuthInput, f as IncomingPaymentMessage, P as PaymentPreparedInsertType, g as InitiatedBatch, h as InitiatedPayment, a as ConfigBankAccount, S as SyncLog, i as PaymentStatus, j as BatchStatus, k as BatchMetadata, l as Currency } from './shared/bank.TyzHNrzR.cjs';
2
- export { n as BATCH_STATUES, n as BATCH_STATUSES, B as BankAccountWithLastSync, v as CONNECTOR_KEYS, u as COUNTRY_CODES, C as ConfigEnvironmentBankAccount, O as OutgoingPaymentMessage, s as PAYMENT_DIRECTIONS, r as PAYMENT_STATUSES, o as PAYMENT_TYPES, t as PaymentDirection, m as PaymentFailedInsertType, q as PaymentType, T as TOKEN_TYPES, w as TokenType, p as paymentInitializedInsertType } from './shared/bank.TyzHNrzR.cjs';
3
- import { t as tables, a as PaymentInsertType, P as PaymentSelectType } from './shared/bank.mGCkS7Y9.cjs';
4
- export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.mGCkS7Y9.cjs';
1
+ import { c as CurrencyCode, d as BankCode, e as CountryCode, I as IBankConnector, b as ConnectorKey, A as AuthInput, f as IncomingPaymentMessage, P as PaymentPreparedInsertType, g as InitiatedBatch, h as InitiatedPayment, a as ConfigBankAccount, S as SyncLog, i as PaymentStatus, j as BatchStatus, k as BatchMetadata, l as Currency } from './shared/bank.DmypH3Au.cjs';
2
+ export { n as BATCH_STATUES, n as BATCH_STATUSES, B as BankAccountWithLastSync, v as CONNECTOR_KEYS, u as COUNTRY_CODES, C as ConfigEnvironmentBankAccount, O as OutgoingPaymentMessage, s as PAYMENT_DIRECTIONS, r as PAYMENT_STATUSES, o as PAYMENT_TYPES, t as PaymentDirection, m as PaymentFailedInsertType, q as PaymentType, T as TOKEN_TYPES, w as TokenType, p as paymentInitializedInsertType } from './shared/bank.DmypH3Au.cjs';
3
+ import { t as tables, a as PaymentInsertType, P as PaymentSelectType } from './shared/bank.BuNG2S8h.cjs';
4
+ export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.BuNG2S8h.cjs';
5
5
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
6
6
  import { DrizzleD1Database } from 'drizzle-orm/d1';
7
7
  export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CEZKAEiY.cjs';
package/dist/types.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { c as CurrencyCode, d as BankCode, e as CountryCode, I as IBankConnector, b as ConnectorKey, A as AuthInput, f as IncomingPaymentMessage, P as PaymentPreparedInsertType, g as InitiatedBatch, h as InitiatedPayment, a as ConfigBankAccount, S as SyncLog, i as PaymentStatus, j as BatchStatus, k as BatchMetadata, l as Currency } from './shared/bank.C8aShbaN.mjs';
2
- export { n as BATCH_STATUES, n as BATCH_STATUSES, B as BankAccountWithLastSync, v as CONNECTOR_KEYS, u as COUNTRY_CODES, C as ConfigEnvironmentBankAccount, O as OutgoingPaymentMessage, s as PAYMENT_DIRECTIONS, r as PAYMENT_STATUSES, o as PAYMENT_TYPES, t as PaymentDirection, m as PaymentFailedInsertType, q as PaymentType, T as TOKEN_TYPES, w as TokenType, p as paymentInitializedInsertType } from './shared/bank.C8aShbaN.mjs';
3
- import { t as tables, a as PaymentInsertType, P as PaymentSelectType } from './shared/bank.mGCkS7Y9.mjs';
4
- export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.mGCkS7Y9.mjs';
1
+ import { c as CurrencyCode, d as BankCode, e as CountryCode, I as IBankConnector, b as ConnectorKey, A as AuthInput, f as IncomingPaymentMessage, P as PaymentPreparedInsertType, g as InitiatedBatch, h as InitiatedPayment, a as ConfigBankAccount, S as SyncLog, i as PaymentStatus, j as BatchStatus, k as BatchMetadata, l as Currency } from './shared/bank.DWVLVMDa.mjs';
2
+ export { n as BATCH_STATUES, n as BATCH_STATUSES, B as BankAccountWithLastSync, v as CONNECTOR_KEYS, u as COUNTRY_CODES, C as ConfigEnvironmentBankAccount, O as OutgoingPaymentMessage, s as PAYMENT_DIRECTIONS, r as PAYMENT_STATUSES, o as PAYMENT_TYPES, t as PaymentDirection, m as PaymentFailedInsertType, q as PaymentType, T as TOKEN_TYPES, w as TokenType, p as paymentInitializedInsertType } from './shared/bank.DWVLVMDa.mjs';
3
+ import { t as tables, a as PaymentInsertType, P as PaymentSelectType } from './shared/bank.BuNG2S8h.mjs';
4
+ export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.BuNG2S8h.mjs';
5
5
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
6
6
  import { DrizzleD1Database } from 'drizzle-orm/d1';
7
7
  export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CEZKAEiY.mjs';
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { c as CurrencyCode, d as BankCode, e as CountryCode, I as IBankConnector, b as ConnectorKey, A as AuthInput, f as IncomingPaymentMessage, P as PaymentPreparedInsertType, g as InitiatedBatch, h as InitiatedPayment, a as ConfigBankAccount, S as SyncLog, i as PaymentStatus, j as BatchStatus, k as BatchMetadata, l as Currency } from './shared/bank.zK_DX1oe.js';
2
- export { n as BATCH_STATUES, n as BATCH_STATUSES, B as BankAccountWithLastSync, v as CONNECTOR_KEYS, u as COUNTRY_CODES, C as ConfigEnvironmentBankAccount, O as OutgoingPaymentMessage, s as PAYMENT_DIRECTIONS, r as PAYMENT_STATUSES, o as PAYMENT_TYPES, t as PaymentDirection, m as PaymentFailedInsertType, q as PaymentType, T as TOKEN_TYPES, w as TokenType, p as paymentInitializedInsertType } from './shared/bank.zK_DX1oe.js';
3
- import { t as tables, a as PaymentInsertType, P as PaymentSelectType } from './shared/bank.mGCkS7Y9.js';
4
- export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.mGCkS7Y9.js';
1
+ import { c as CurrencyCode, d as BankCode, e as CountryCode, I as IBankConnector, b as ConnectorKey, A as AuthInput, f as IncomingPaymentMessage, P as PaymentPreparedInsertType, g as InitiatedBatch, h as InitiatedPayment, a as ConfigBankAccount, S as SyncLog, i as PaymentStatus, j as BatchStatus, k as BatchMetadata, l as Currency } from './shared/bank.BkLncGmL.js';
2
+ export { n as BATCH_STATUES, n as BATCH_STATUSES, B as BankAccountWithLastSync, v as CONNECTOR_KEYS, u as COUNTRY_CODES, C as ConfigEnvironmentBankAccount, O as OutgoingPaymentMessage, s as PAYMENT_DIRECTIONS, r as PAYMENT_STATUSES, o as PAYMENT_TYPES, t as PaymentDirection, m as PaymentFailedInsertType, q as PaymentType, T as TOKEN_TYPES, w as TokenType, p as paymentInitializedInsertType } from './shared/bank.BkLncGmL.js';
3
+ import { t as tables, a as PaymentInsertType, P as PaymentSelectType } from './shared/bank.BuNG2S8h.js';
4
+ export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.BuNG2S8h.js';
5
5
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
6
6
  import { DrizzleD1Database } from 'drizzle-orm/d1';
7
7
  export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CEZKAEiY.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/bank",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {