@develit-services/bank 0.3.57 → 0.3.59

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 { aa as account, ab as accountCredentials, a6 as batch, a9 as ott, a7 as payment, a8 as paymentRelations } from '../shared/bank.Clkw7jCx.cjs';
1
+ export { aa as account, ab as accountCredentials, a6 as batch, a9 as ott, a7 as payment, a8 as paymentRelations } from '../shared/bank.BwXpqjVU.cjs';
2
2
  import 'zod';
3
3
  import 'drizzle-zod';
4
4
  import 'drizzle-orm/sqlite-core';
@@ -1,4 +1,4 @@
1
- export { aa as account, ab as accountCredentials, a6 as batch, a9 as ott, a7 as payment, a8 as paymentRelations } from '../shared/bank.Clkw7jCx.mjs';
1
+ export { aa as account, ab as accountCredentials, a6 as batch, a9 as ott, a7 as payment, a8 as paymentRelations } from '../shared/bank.BwXpqjVU.mjs';
2
2
  import 'zod';
3
3
  import 'drizzle-zod';
4
4
  import 'drizzle-orm/sqlite-core';
@@ -1,4 +1,4 @@
1
- export { aa as account, ab as accountCredentials, a6 as batch, a9 as ott, a7 as payment, a8 as paymentRelations } from '../shared/bank.Clkw7jCx.js';
1
+ export { aa as account, ab as accountCredentials, a6 as batch, a9 as ott, a7 as payment, a8 as paymentRelations } from '../shared/bank.BwXpqjVU.js';
2
2
  import 'zod';
3
3
  import 'drizzle-zod';
4
4
  import 'drizzle-orm/sqlite-core';
@@ -883,7 +883,6 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
883
883
  );
884
884
  const base = { ...acc };
885
885
  const existingPart = existingAccount ? {
886
- id: existingAccount.id,
887
886
  lastSyncAt: existingAccount.lastSyncAt
888
887
  } : {
889
888
  lastSyncAt: lastSyncAt ?? /* @__PURE__ */ new Date(),
@@ -914,8 +913,8 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
914
913
  });
915
914
  await this.db.batch([
916
915
  updateOtt,
917
- ...upsertAccounts,
918
916
  ...deleteCredentials,
917
+ ...upsertAccounts,
919
918
  ...createAccountCredentials
920
919
  ]);
921
920
  const fetchedAccounts = await this._getAccounts();
@@ -1030,6 +1029,7 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
1030
1029
  accounts.map(async (a) => {
1031
1030
  const result = {
1032
1031
  ...a,
1032
+ expiresAt: a.expiresAt || null,
1033
1033
  workflow: null,
1034
1034
  batches: null
1035
1035
  };
@@ -1,4 +1,4 @@
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 BatchPayment, c as BatchMetadata } from '../shared/bank.Clkw7jCx.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 BatchPayment, c as BatchMetadata } from '../shared/bank.BwXpqjVU.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';
@@ -2413,6 +2413,7 @@ type BatchCounts = {
2413
2413
  type AccountWithOptionalFields = AccountSelectType & {
2414
2414
  workflow: WorkflowInfo;
2415
2415
  batches: BatchCounts;
2416
+ expiresAt: Date | null;
2416
2417
  };
2417
2418
  type GetBankAccountsOutput = {
2418
2419
  accounts: AccountWithOptionalFields[];
@@ -1,4 +1,4 @@
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 BatchPayment, c as BatchMetadata } from '../shared/bank.Clkw7jCx.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 BatchPayment, c as BatchMetadata } from '../shared/bank.BwXpqjVU.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';
@@ -2413,6 +2413,7 @@ type BatchCounts = {
2413
2413
  type AccountWithOptionalFields = AccountSelectType & {
2414
2414
  workflow: WorkflowInfo;
2415
2415
  batches: BatchCounts;
2416
+ expiresAt: Date | null;
2416
2417
  };
2417
2418
  type GetBankAccountsOutput = {
2418
2419
  accounts: AccountWithOptionalFields[];
@@ -1,4 +1,4 @@
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 BatchPayment, c as BatchMetadata } from '../shared/bank.Clkw7jCx.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 BatchPayment, c as BatchMetadata } from '../shared/bank.BwXpqjVU.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';
@@ -2413,6 +2413,7 @@ type BatchCounts = {
2413
2413
  type AccountWithOptionalFields = AccountSelectType & {
2414
2414
  workflow: WorkflowInfo;
2415
2415
  batches: BatchCounts;
2416
+ expiresAt: Date | null;
2416
2417
  };
2417
2418
  type GetBankAccountsOutput = {
2418
2419
  accounts: AccountWithOptionalFields[];
@@ -881,7 +881,6 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
881
881
  );
882
882
  const base = { ...acc };
883
883
  const existingPart = existingAccount ? {
884
- id: existingAccount.id,
885
884
  lastSyncAt: existingAccount.lastSyncAt
886
885
  } : {
887
886
  lastSyncAt: lastSyncAt ?? /* @__PURE__ */ new Date(),
@@ -912,8 +911,8 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
912
911
  });
913
912
  await this.db.batch([
914
913
  updateOtt,
915
- ...upsertAccounts,
916
914
  ...deleteCredentials,
915
+ ...upsertAccounts,
917
916
  ...createAccountCredentials
918
917
  ]);
919
918
  const fetchedAccounts = await this._getAccounts();
@@ -1028,6 +1027,7 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
1028
1027
  accounts.map(async (a) => {
1029
1028
  const result = {
1030
1029
  ...a,
1030
+ expiresAt: a.expiresAt || null,
1031
1031
  workflow: null,
1032
1032
  batches: null
1033
1033
  };
@@ -1688,7 +1688,7 @@ declare abstract class IBankConnector {
1688
1688
  abstract authorizeAccount({ urlParams }: {
1689
1689
  urlParams: string;
1690
1690
  }): Promise<{
1691
- credentials: AccountCredentialsInsertType[];
1691
+ credentials: Omit<AccountCredentialsInsertType, 'accountId'>[];
1692
1692
  accounts: AccountInsertType[];
1693
1693
  }>;
1694
1694
  abstract listAccounts(): Promise<AccountInsertType[]>;
@@ -1688,7 +1688,7 @@ declare abstract class IBankConnector {
1688
1688
  abstract authorizeAccount({ urlParams }: {
1689
1689
  urlParams: string;
1690
1690
  }): Promise<{
1691
- credentials: AccountCredentialsInsertType[];
1691
+ credentials: Omit<AccountCredentialsInsertType, 'accountId'>[];
1692
1692
  accounts: AccountInsertType[];
1693
1693
  }>;
1694
1694
  abstract listAccounts(): Promise<AccountInsertType[]>;
@@ -1688,7 +1688,7 @@ declare abstract class IBankConnector {
1688
1688
  abstract authorizeAccount({ urlParams }: {
1689
1689
  urlParams: string;
1690
1690
  }): Promise<{
1691
- credentials: AccountCredentialsInsertType[];
1691
+ credentials: Omit<AccountCredentialsInsertType, 'accountId'>[];
1692
1692
  accounts: AccountInsertType[];
1693
1693
  }>;
1694
1694
  abstract listAccounts(): Promise<AccountInsertType[]>;
package/dist/types.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.Clkw7jCx.cjs';
2
- export { M as ACCOUNT_STATUSES, a4 as AccountCredentialsPatchType, a5 as AccountCredentialsSelectType, a3 as AccountCredentialsUpdateType, $ as AccountPatchType, N as AccountStatus, _ as AccountUpdateType, x as BATCH_STATUES, x as BATCH_STATUSES, R as BankAccountWithLastSync, w as BatchInsertType, b as BatchPayment, B as BatchSelectType, D as CHARGE_BEARERS, S as CONNECTOR_KEYS, Q as COUNTRY_CODES, T as CREDENTIALS_TYPES, E as ChargeBearer, C as ConfigEnvironmentBank, U as CredentialsType, F as INSTRUCTION_PRIORITIES, G as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, J as PAYMENT_DIRECTIONS, H as PAYMENT_STATUSES, y as PAYMENT_TYPES, K as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, v as PaymentInsertType, z as PaymentType, V as TOKEN_TYPES, W as TokenType, a0 as accountCredentialsInsertSchema, a2 as accountCredentialsSelectSchema, a1 as accountCredentialsUpdateSchema, X as accountInsertSchema, Z as accountSelectSchema, Y as accountUpdateSchema } from './shared/bank.Clkw7jCx.cjs';
1
+ import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.BwXpqjVU.cjs';
2
+ export { M as ACCOUNT_STATUSES, a4 as AccountCredentialsPatchType, a5 as AccountCredentialsSelectType, a3 as AccountCredentialsUpdateType, $ as AccountPatchType, N as AccountStatus, _ as AccountUpdateType, x as BATCH_STATUES, x as BATCH_STATUSES, R as BankAccountWithLastSync, w as BatchInsertType, b as BatchPayment, B as BatchSelectType, D as CHARGE_BEARERS, S as CONNECTOR_KEYS, Q as COUNTRY_CODES, T as CREDENTIALS_TYPES, E as ChargeBearer, C as ConfigEnvironmentBank, U as CredentialsType, F as INSTRUCTION_PRIORITIES, G as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, J as PAYMENT_DIRECTIONS, H as PAYMENT_STATUSES, y as PAYMENT_TYPES, K as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, v as PaymentInsertType, z as PaymentType, V as TOKEN_TYPES, W as TokenType, a0 as accountCredentialsInsertSchema, a2 as accountCredentialsSelectSchema, a1 as accountCredentialsUpdateSchema, X as accountInsertSchema, Z as accountSelectSchema, Y as accountUpdateSchema } from './shared/bank.BwXpqjVU.cjs';
3
3
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
5
  export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.Dh_H_5rC.cjs';
package/dist/types.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.Clkw7jCx.mjs';
2
- export { M as ACCOUNT_STATUSES, a4 as AccountCredentialsPatchType, a5 as AccountCredentialsSelectType, a3 as AccountCredentialsUpdateType, $ as AccountPatchType, N as AccountStatus, _ as AccountUpdateType, x as BATCH_STATUES, x as BATCH_STATUSES, R as BankAccountWithLastSync, w as BatchInsertType, b as BatchPayment, B as BatchSelectType, D as CHARGE_BEARERS, S as CONNECTOR_KEYS, Q as COUNTRY_CODES, T as CREDENTIALS_TYPES, E as ChargeBearer, C as ConfigEnvironmentBank, U as CredentialsType, F as INSTRUCTION_PRIORITIES, G as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, J as PAYMENT_DIRECTIONS, H as PAYMENT_STATUSES, y as PAYMENT_TYPES, K as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, v as PaymentInsertType, z as PaymentType, V as TOKEN_TYPES, W as TokenType, a0 as accountCredentialsInsertSchema, a2 as accountCredentialsSelectSchema, a1 as accountCredentialsUpdateSchema, X as accountInsertSchema, Z as accountSelectSchema, Y as accountUpdateSchema } from './shared/bank.Clkw7jCx.mjs';
1
+ import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.BwXpqjVU.mjs';
2
+ export { M as ACCOUNT_STATUSES, a4 as AccountCredentialsPatchType, a5 as AccountCredentialsSelectType, a3 as AccountCredentialsUpdateType, $ as AccountPatchType, N as AccountStatus, _ as AccountUpdateType, x as BATCH_STATUES, x as BATCH_STATUSES, R as BankAccountWithLastSync, w as BatchInsertType, b as BatchPayment, B as BatchSelectType, D as CHARGE_BEARERS, S as CONNECTOR_KEYS, Q as COUNTRY_CODES, T as CREDENTIALS_TYPES, E as ChargeBearer, C as ConfigEnvironmentBank, U as CredentialsType, F as INSTRUCTION_PRIORITIES, G as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, J as PAYMENT_DIRECTIONS, H as PAYMENT_STATUSES, y as PAYMENT_TYPES, K as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, v as PaymentInsertType, z as PaymentType, V as TOKEN_TYPES, W as TokenType, a0 as accountCredentialsInsertSchema, a2 as accountCredentialsSelectSchema, a1 as accountCredentialsUpdateSchema, X as accountInsertSchema, Z as accountSelectSchema, Y as accountUpdateSchema } from './shared/bank.BwXpqjVU.mjs';
3
3
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
5
  export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.Dh_H_5rC.mjs';
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.Clkw7jCx.js';
2
- export { M as ACCOUNT_STATUSES, a4 as AccountCredentialsPatchType, a5 as AccountCredentialsSelectType, a3 as AccountCredentialsUpdateType, $ as AccountPatchType, N as AccountStatus, _ as AccountUpdateType, x as BATCH_STATUES, x as BATCH_STATUSES, R as BankAccountWithLastSync, w as BatchInsertType, b as BatchPayment, B as BatchSelectType, D as CHARGE_BEARERS, S as CONNECTOR_KEYS, Q as COUNTRY_CODES, T as CREDENTIALS_TYPES, E as ChargeBearer, C as ConfigEnvironmentBank, U as CredentialsType, F as INSTRUCTION_PRIORITIES, G as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, J as PAYMENT_DIRECTIONS, H as PAYMENT_STATUSES, y as PAYMENT_TYPES, K as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, v as PaymentInsertType, z as PaymentType, V as TOKEN_TYPES, W as TokenType, a0 as accountCredentialsInsertSchema, a2 as accountCredentialsSelectSchema, a1 as accountCredentialsUpdateSchema, X as accountInsertSchema, Z as accountSelectSchema, Y as accountUpdateSchema } from './shared/bank.Clkw7jCx.js';
1
+ import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.BwXpqjVU.js';
2
+ export { M as ACCOUNT_STATUSES, a4 as AccountCredentialsPatchType, a5 as AccountCredentialsSelectType, a3 as AccountCredentialsUpdateType, $ as AccountPatchType, N as AccountStatus, _ as AccountUpdateType, x as BATCH_STATUES, x as BATCH_STATUSES, R as BankAccountWithLastSync, w as BatchInsertType, b as BatchPayment, B as BatchSelectType, D as CHARGE_BEARERS, S as CONNECTOR_KEYS, Q as COUNTRY_CODES, T as CREDENTIALS_TYPES, E as ChargeBearer, C as ConfigEnvironmentBank, U as CredentialsType, F as INSTRUCTION_PRIORITIES, G as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, J as PAYMENT_DIRECTIONS, H as PAYMENT_STATUSES, y as PAYMENT_TYPES, K as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, v as PaymentInsertType, z as PaymentType, V as TOKEN_TYPES, W as TokenType, a0 as accountCredentialsInsertSchema, a2 as accountCredentialsSelectSchema, a1 as accountCredentialsUpdateSchema, X as accountInsertSchema, Z as accountSelectSchema, Y as accountUpdateSchema } from './shared/bank.BwXpqjVU.js';
3
3
  import { Environment, BaseEvent } from '@develit-io/backend-sdk';
4
4
  import { DrizzleD1Database } from 'drizzle-orm/d1';
5
5
  export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.Dh_H_5rC.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/bank",
3
- "version": "0.3.57",
3
+ "version": "0.3.59",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {