@develit-services/bank 4.3.0 → 5.0.0

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/{export/worker.cjs → base.cjs} +27 -27
  2. package/dist/{export/worker.d.ts → base.d.cts} +4 -4
  3. package/dist/{export/worker.d.mts → base.d.mts} +4 -4
  4. package/dist/{export/worker.d.cts → base.d.ts} +4 -4
  5. package/dist/{export/worker.mjs → base.mjs} +4 -4
  6. package/dist/database/schema.d.cts +1 -1
  7. package/dist/database/schema.d.mts +1 -1
  8. package/dist/database/schema.d.ts +1 -1
  9. package/dist/export/workflows.cjs +2 -2
  10. package/dist/export/workflows.mjs +2 -2
  11. package/dist/service.cjs +40 -0
  12. package/dist/service.d.cts +222 -0
  13. package/dist/service.d.mts +222 -0
  14. package/dist/service.d.ts +222 -0
  15. package/dist/service.mjs +37 -0
  16. package/dist/shared/{bank.NjHGMD3j.cjs → bank.BSX82jhx.cjs} +67 -22
  17. package/dist/shared/{bank.DyueVCXo.mjs → bank.BdTj54NO.mjs} +1 -1
  18. package/dist/shared/{bank.CkSgCZ-W.d.cts → bank.C-edstpR.d.cts} +1 -1
  19. package/dist/shared/{bank.tefvLkrJ.d.mts → bank.C6BQDtpF.d.mts} +1 -1
  20. package/dist/shared/{bank.BmDlJzUz.mjs → bank.CZ8MQDPa.mjs} +67 -22
  21. package/dist/shared/{bank.C-XeuTid.cjs → bank.CibQRM2D.cjs} +1 -1
  22. package/dist/shared/{bank.d4sMg6i0.d.cts → bank.Do1KUeDr.d.cts} +1 -1
  23. package/dist/shared/{bank.d4sMg6i0.d.mts → bank.Do1KUeDr.d.mts} +1 -1
  24. package/dist/shared/{bank.d4sMg6i0.d.ts → bank.Do1KUeDr.d.ts} +1 -1
  25. package/dist/shared/{bank.B2FLbr0c.d.ts → bank.pZQAWlIB.d.ts} +1 -1
  26. package/dist/types.cjs +1 -1
  27. package/dist/types.d.cts +4 -5
  28. package/dist/types.d.mts +4 -5
  29. package/dist/types.d.ts +4 -5
  30. package/dist/types.mjs +1 -1
  31. package/package.json +13 -12
  32. package/dist/export/wrangler.cjs +0 -75
  33. package/dist/export/wrangler.d.cts +0 -80
  34. package/dist/export/wrangler.d.mts +0 -80
  35. package/dist/export/wrangler.d.ts +0 -80
  36. package/dist/export/wrangler.mjs +0 -73
  37. package/dist/shared/bank.DyZBd2qL.d.cts +0 -43
  38. package/dist/shared/bank.DyZBd2qL.d.mts +0 -43
  39. package/dist/shared/bank.DyZBd2qL.d.ts +0 -43
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
3
  const backendSdk = require('@develit-io/backend-sdk');
4
- const ott_zod = require('../shared/bank.NjHGMD3j.cjs');
4
+ const ott_zod = require('./shared/bank.BSX82jhx.cjs');
5
5
  const drizzleOrm = require('drizzle-orm');
6
6
  const cloudflare_workers = require('cloudflare:workers');
7
7
  const d1 = require('drizzle-orm/d1');
8
8
  require('jose');
9
9
  const zod = require('zod');
10
- const database_schema = require('../shared/bank.9Yw4KHyl.cjs');
10
+ const database_schema = require('./shared/bank.9Yw4KHyl.cjs');
11
11
  const generalCodes = require('@develit-io/general-codes');
12
12
  require('date-fns');
13
13
  require('node:crypto');
14
- const credentialsResolver = require('../shared/bank.C-XeuTid.cjs');
14
+ const credentialsResolver = require('./shared/bank.CibQRM2D.cjs');
15
15
  require('drizzle-orm/zod');
16
16
  require('drizzle-orm/sqlite-core');
17
17
 
@@ -684,7 +684,7 @@ var __decorateClass = (decorators, target, key, kind) => {
684
684
  if (kind && result) __defProp(target, key, result);
685
685
  return result;
686
686
  };
687
- let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.WorkerEntrypoint) {
687
+ exports.BankServiceBase = class BankServiceBase extends backendSdk.develitWorker(cloudflare_workers.WorkerEntrypoint) {
688
688
  constructor(ctx, env, config) {
689
689
  super(ctx, env);
690
690
  this.allowedProviders = [];
@@ -1997,71 +1997,71 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
1997
1997
  };
1998
1998
  __decorateClass([
1999
1999
  backendSdk.action("get-payments")
2000
- ], BankServiceBase.prototype, "getPayments", 1);
2000
+ ], exports.BankServiceBase.prototype, "getPayments", 1);
2001
2001
  __decorateClass([
2002
2002
  backendSdk.action("sync-account")
2003
- ], BankServiceBase.prototype, "syncAccount", 1);
2003
+ ], exports.BankServiceBase.prototype, "syncAccount", 1);
2004
2004
  __decorateClass([
2005
2005
  backendSdk.action("synchronize-accounts")
2006
- ], BankServiceBase.prototype, "syncAccounts", 1);
2006
+ ], exports.BankServiceBase.prototype, "syncAccounts", 1);
2007
2007
  __decorateClass([
2008
2008
  backendSdk.action("update-payment-request-statuses")
2009
- ], BankServiceBase.prototype, "updatePaymentRequestStatuses", 1);
2009
+ ], exports.BankServiceBase.prototype, "updatePaymentRequestStatuses", 1);
2010
2010
  __decorateClass([
2011
2011
  backendSdk.action("scheduled")
2012
- ], BankServiceBase.prototype, "scheduled", 1);
2012
+ ], exports.BankServiceBase.prototype, "scheduled", 1);
2013
2013
  __decorateClass([
2014
2014
  backendSdk.action("handle-authorization-callback")
2015
- ], BankServiceBase.prototype, "handleAuthorizationCallback", 1);
2015
+ ], exports.BankServiceBase.prototype, "handleAuthorizationCallback", 1);
2016
2016
  __decorateClass([
2017
2017
  backendSdk.action("process-batch")
2018
- ], BankServiceBase.prototype, "processBatch", 1);
2018
+ ], exports.BankServiceBase.prototype, "processBatch", 1);
2019
2019
  __decorateClass([
2020
2020
  backendSdk.action("get-auth-uri")
2021
- ], BankServiceBase.prototype, "getAuthUri", 1);
2021
+ ], exports.BankServiceBase.prototype, "getAuthUri", 1);
2022
2022
  __decorateClass([
2023
2023
  backendSdk.action("authorize-account")
2024
- ], BankServiceBase.prototype, "authorizeAccount", 1);
2024
+ ], exports.BankServiceBase.prototype, "authorizeAccount", 1);
2025
2025
  __decorateClass([
2026
2026
  backendSdk.action("simulate-deposit")
2027
- ], BankServiceBase.prototype, "simulateDeposit", 1);
2027
+ ], exports.BankServiceBase.prototype, "simulateDeposit", 1);
2028
2028
  __decorateClass([
2029
2029
  backendSdk.action("send-payment")
2030
- ], BankServiceBase.prototype, "sendPayment", 1);
2030
+ ], exports.BankServiceBase.prototype, "sendPayment", 1);
2031
2031
  __decorateClass([
2032
2032
  backendSdk.action("send-payment-sync")
2033
- ], BankServiceBase.prototype, "sendPaymentSync", 1);
2033
+ ], exports.BankServiceBase.prototype, "sendPaymentSync", 1);
2034
2034
  __decorateClass([
2035
2035
  backendSdk.action("send-batch")
2036
- ], BankServiceBase.prototype, "sendBatch", 1);
2036
+ ], exports.BankServiceBase.prototype, "sendBatch", 1);
2037
2037
  __decorateClass([
2038
2038
  backendSdk.action("get-bank-accounts")
2039
- ], BankServiceBase.prototype, "getBankAccounts", 1);
2039
+ ], exports.BankServiceBase.prototype, "getBankAccounts", 1);
2040
2040
  __decorateClass([
2041
2041
  backendSdk.action("get-account-balance")
2042
- ], BankServiceBase.prototype, "getAccountBalance", 1);
2042
+ ], exports.BankServiceBase.prototype, "getAccountBalance", 1);
2043
2043
  __decorateClass([
2044
2044
  backendSdk.action("update-account")
2045
- ], BankServiceBase.prototype, "updateAccount", 1);
2045
+ ], exports.BankServiceBase.prototype, "updateAccount", 1);
2046
2046
  __decorateClass([
2047
2047
  backendSdk.action("disconnectAccount")
2048
- ], BankServiceBase.prototype, "disconnectAccount", 1);
2048
+ ], exports.BankServiceBase.prototype, "disconnectAccount", 1);
2049
2049
  __decorateClass([
2050
2050
  backendSdk.action("getBatches")
2051
- ], BankServiceBase.prototype, "getBatches", 1);
2051
+ ], exports.BankServiceBase.prototype, "getBatches", 1);
2052
2052
  __decorateClass([
2053
2053
  backendSdk.action("get-payment-requests")
2054
- ], BankServiceBase.prototype, "getPaymentRequests", 1);
2054
+ ], exports.BankServiceBase.prototype, "getPaymentRequests", 1);
2055
2055
  __decorateClass([
2056
2056
  backendSdk.action("get-payment-request")
2057
- ], BankServiceBase.prototype, "getPaymentRequest", 1);
2058
- BankServiceBase = __decorateClass([
2057
+ ], exports.BankServiceBase.prototype, "getPaymentRequest", 1);
2058
+ exports.BankServiceBase = __decorateClass([
2059
2059
  backendSdk.service("bank")
2060
- ], BankServiceBase);
2060
+ ], exports.BankServiceBase);
2061
2061
  function defineBankService({
2062
2062
  config
2063
2063
  }) {
2064
- return class BankService extends BankServiceBase {
2064
+ return class BankService extends exports.BankServiceBase {
2065
2065
  constructor(ctx, env) {
2066
2066
  super(ctx, env, config);
2067
2067
  }
@@ -1,6 +1,6 @@
1
1
  import * as drizzle_orm from 'drizzle-orm';
2
- import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, b as ConfigEnvironmentBank, t as tables, c as ConnectorKey, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from '../shared/bank.d4sMg6i0.js';
3
- import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from '../shared/bank.B2FLbr0c.js';
2
+ import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.Do1KUeDr.cjs';
3
+ import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.C-edstpR.cjs';
4
4
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
5
5
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
6
6
  import { WorkerEntrypoint } from 'cloudflare:workers';
@@ -2691,9 +2691,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
2691
2691
  limit: z.ZodNumber;
2692
2692
  sort: z.ZodObject<{
2693
2693
  column: z.ZodEnum<{
2694
+ batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
2694
2695
  createdAt: "createdAt";
2695
2696
  updatedAt: "updatedAt";
2696
- batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
2697
2697
  }>;
2698
2698
  direction: z.ZodEnum<{
2699
2699
  asc: "asc";
@@ -3943,4 +3943,4 @@ declare function defineBankService({ config, }: {
3943
3943
  config: ConfigEnvironmentBank;
3944
3944
  }): typeof BankServiceBase;
3945
3945
 
3946
- export { defineBankService };
3946
+ export { BankServiceBase, defineBankService };
@@ -1,6 +1,6 @@
1
1
  import * as drizzle_orm from 'drizzle-orm';
2
- import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, b as ConfigEnvironmentBank, t as tables, c as ConnectorKey, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from '../shared/bank.d4sMg6i0.mjs';
3
- import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from '../shared/bank.tefvLkrJ.mjs';
2
+ import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.Do1KUeDr.mjs';
3
+ import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.C6BQDtpF.mjs';
4
4
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
5
5
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
6
6
  import { WorkerEntrypoint } from 'cloudflare:workers';
@@ -2691,9 +2691,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
2691
2691
  limit: z.ZodNumber;
2692
2692
  sort: z.ZodObject<{
2693
2693
  column: z.ZodEnum<{
2694
+ batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
2694
2695
  createdAt: "createdAt";
2695
2696
  updatedAt: "updatedAt";
2696
- batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
2697
2697
  }>;
2698
2698
  direction: z.ZodEnum<{
2699
2699
  asc: "asc";
@@ -3943,4 +3943,4 @@ declare function defineBankService({ config, }: {
3943
3943
  config: ConfigEnvironmentBank;
3944
3944
  }): typeof BankServiceBase;
3945
3945
 
3946
- export { defineBankService };
3946
+ export { BankServiceBase, defineBankService };
@@ -1,6 +1,6 @@
1
1
  import * as drizzle_orm from 'drizzle-orm';
2
- import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, b as ConfigEnvironmentBank, t as tables, c as ConnectorKey, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from '../shared/bank.d4sMg6i0.cjs';
3
- import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from '../shared/bank.CkSgCZ-W.cjs';
2
+ import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.Do1KUeDr.js';
3
+ import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.pZQAWlIB.js';
4
4
  import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
5
5
  import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
6
6
  import { WorkerEntrypoint } from 'cloudflare:workers';
@@ -2691,9 +2691,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
2691
2691
  limit: z.ZodNumber;
2692
2692
  sort: z.ZodObject<{
2693
2693
  column: z.ZodEnum<{
2694
+ batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
2694
2695
  createdAt: "createdAt";
2695
2696
  updatedAt: "updatedAt";
2696
- batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
2697
2697
  }>;
2698
2698
  direction: z.ZodEnum<{
2699
2699
  asc: "asc";
@@ -3943,4 +3943,4 @@ declare function defineBankService({ config, }: {
3943
3943
  config: ConfigEnvironmentBank;
3944
3944
  }): typeof BankServiceBase;
3945
3945
 
3946
- export { defineBankService };
3946
+ export { BankServiceBase, defineBankService };
@@ -1,15 +1,15 @@
1
1
  import { bankAccountMetadataSchema, structuredAddressSchema, uuidv4, first, buildMultiFilterConditions as buildMultiFilterConditions$1, workflowInstanceStatusSchema, develitWorker, createInternalError, action, service } from '@develit-io/backend-sdk';
2
- import { G as tables, g as accountInsertSchema, H as relations, J as initiateConnector, o as isProcessedStatus, p as isTerminalStatus, L as getNonTerminalPaymentRequestsQuery, x as toIncomingPayment, j as assignAccount, u as toBatchedPayment, y as toPaymentRequestInsert, a as FinbricksClient, F as FINBRICKS_ENDPOINTS } from '../shared/bank.BmDlJzUz.mjs';
2
+ import { G as tables, g as accountInsertSchema, H as relations, J as initiateConnector, o as isProcessedStatus, p as isTerminalStatus, L as getNonTerminalPaymentRequestsQuery, x as toIncomingPayment, j as assignAccount, u as toBatchedPayment, y as toPaymentRequestInsert, a as FinbricksClient, F as FINBRICKS_ENDPOINTS } from './shared/bank.CZ8MQDPa.mjs';
3
3
  import { eq, sql, and, like, asc, desc, inArray, gte, lte, isNull, count } from 'drizzle-orm';
4
4
  import { WorkerEntrypoint } from 'cloudflare:workers';
5
5
  import { drizzle } from 'drizzle-orm/d1';
6
6
  import 'jose';
7
7
  import { z } from 'zod';
8
- import { I as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, g as PAYMENT_TYPES, b as CONNECTOR_KEYS, a as BATCH_STATUSES, f as PAYMENT_STATUSES, P as PAYMENT_DIRECTIONS, e as PAYMENT_REQUEST_STATUSES } from '../shared/bank.BzDNLxB_.mjs';
8
+ import { I as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, g as PAYMENT_TYPES, b as CONNECTOR_KEYS, a as BATCH_STATUSES, f as PAYMENT_STATUSES, P as PAYMENT_DIRECTIONS, e as PAYMENT_REQUEST_STATUSES } from './shared/bank.BzDNLxB_.mjs';
9
9
  import { CURRENCY_CODES } from '@develit-io/general-codes';
10
10
  import 'date-fns';
11
11
  import 'node:crypto';
12
- import { h as encrypt, d as createCredentialsResolver, e as updatePaymentRequestStatusCommand, a as getPaymentRequestsByBatchIdQuery, g as getBatchByIdQuery, u as upsertBatchCommand, i as importAesKey, f as createPaymentCommand, b as getAccountByIdQuery } from '../shared/bank.DyueVCXo.mjs';
12
+ import { h as encrypt, d as createCredentialsResolver, e as updatePaymentRequestStatusCommand, a as getPaymentRequestsByBatchIdQuery, g as getBatchByIdQuery, u as upsertBatchCommand, i as importAesKey, f as createPaymentCommand, b as getAccountByIdQuery } from './shared/bank.BdTj54NO.mjs';
13
13
  import 'drizzle-orm/zod';
14
14
  import 'drizzle-orm/sqlite-core';
15
15
 
@@ -2066,4 +2066,4 @@ function defineBankService({
2066
2066
  };
2067
2067
  }
2068
2068
 
2069
- export { defineBankService };
2069
+ export { BankServiceBase, defineBankService };
@@ -1,4 +1,4 @@
1
- export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.d4sMg6i0.cjs';
1
+ export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.Do1KUeDr.cjs';
2
2
  import 'drizzle-orm';
3
3
  import 'drizzle-orm/sqlite-core';
4
4
  import '@develit-io/general-codes';
@@ -1,4 +1,4 @@
1
- export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.d4sMg6i0.mjs';
1
+ export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.Do1KUeDr.mjs';
2
2
  import 'drizzle-orm';
3
3
  import 'drizzle-orm/sqlite-core';
4
4
  import '@develit-io/general-codes';
@@ -1,4 +1,4 @@
1
- export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.d4sMg6i0.js';
1
+ export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.Do1KUeDr.js';
2
2
  import 'drizzle-orm';
3
3
  import 'drizzle-orm/sqlite-core';
4
4
  import '@develit-io/general-codes';
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  const backendSdk = require('@develit-io/backend-sdk');
4
- const ott_zod = require('../shared/bank.NjHGMD3j.cjs');
4
+ const ott_zod = require('../shared/bank.BSX82jhx.cjs');
5
5
  const batchLifecycle = require('../shared/bank.NF8bZBy0.cjs');
6
6
  const drizzleOrm = require('drizzle-orm');
7
- const credentialsResolver = require('../shared/bank.C-XeuTid.cjs');
7
+ const credentialsResolver = require('../shared/bank.CibQRM2D.cjs');
8
8
  const cloudflare_workers = require('cloudflare:workers');
9
9
  const cloudflare_workflows = require('cloudflare:workflows');
10
10
  const d1 = require('drizzle-orm/d1');
@@ -1,8 +1,8 @@
1
1
  import { first, uuidv4, asNonEmpty } from '@develit-io/backend-sdk';
2
- import { G as tables, H as relations, v as toBatchedPaymentFromPaymentRequest, z as toPreparedPayment, J as initiateConnector, m as isPaymentCompleted } from '../shared/bank.BmDlJzUz.mjs';
2
+ import { G as tables, H as relations, v as toBatchedPaymentFromPaymentRequest, z as toPreparedPayment, J as initiateConnector, m as isPaymentCompleted } from '../shared/bank.CZ8MQDPa.mjs';
3
3
  import { i as isBatchAuthorized, b as isBatchFailed, d as isBatchProcessing } from '../shared/bank.XqSw509X.mjs';
4
4
  import { eq, and, inArray } from 'drizzle-orm';
5
- import { g as getBatchByIdQuery, a as getPaymentRequestsByBatchIdQuery, c as checksum, u as upsertBatchCommand, b as getAccountByIdQuery, d as createCredentialsResolver, e as updatePaymentRequestStatusCommand, f as createPaymentCommand } from '../shared/bank.DyueVCXo.mjs';
5
+ import { g as getBatchByIdQuery, a as getPaymentRequestsByBatchIdQuery, c as checksum, u as upsertBatchCommand, b as getAccountByIdQuery, d as createCredentialsResolver, e as updatePaymentRequestStatusCommand, f as createPaymentCommand } from '../shared/bank.BdTj54NO.mjs';
6
6
  import { WorkflowEntrypoint } from 'cloudflare:workers';
7
7
  import { NonRetryableError } from 'cloudflare:workflows';
8
8
  import { drizzle } from 'drizzle-orm/d1';
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ const serviceConfig = require('@develit-io/platform-sdk/service-config');
4
+
5
+ const BANK_SERVICE_BINDINGS = {
6
+ SECRETS_STORE: { kind: "service", target: "secrets-store" },
7
+ BANK_KV: { kind: "kv", suffix: "bank" },
8
+ BANK_D1: { kind: "d1", suffix: "bank" },
9
+ QUEUE_BUS_QUEUE: { kind: "queueProducer", suffix: "queue-bus" },
10
+ NOTIFICATIONS_QUEUE: { kind: "queueProducer", suffix: "notifications" },
11
+ SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
12
+ kind: "workflow",
13
+ class: "BankSyncAccountPayments",
14
+ suffix: "bank-sync-account-payments",
15
+ limits: { steps: 25e3 }
16
+ },
17
+ PROCESS_BATCH_WORKFLOW: {
18
+ kind: "workflow",
19
+ class: "BankProcessBatch",
20
+ suffix: "bank-process-batch"
21
+ },
22
+ DBU_CBS_BACKOFFICE_DEV: {
23
+ kind: "vpc",
24
+ serviceId: "019c2962-172c-75a2-a000-b76e246d25d7"
25
+ }
26
+ };
27
+ const baseBankServiceConfig = serviceConfig.createTypedServiceConfigFactory()(BANK_SERVICE_BINDINGS);
28
+ function bankServiceConfig(project, version, options) {
29
+ const config = baseBankServiceConfig(project, version, options);
30
+ const callable = (deployment, bindings) => ({
31
+ resourceName: "bank",
32
+ variables: config.vars[serviceConfig.configKeyFor(deployment.environment)],
33
+ bindings,
34
+ crons: config.triggers.crons[serviceConfig.configKeyFor(deployment.environment)]
35
+ });
36
+ return Object.assign(callable, config);
37
+ }
38
+
39
+ exports.BANK_SERVICE_BINDINGS = BANK_SERVICE_BINDINGS;
40
+ exports.bankServiceConfig = bankServiceConfig;
@@ -0,0 +1,222 @@
1
+ import * as _develit_io_platform_sdk from '@develit-io/platform-sdk';
2
+ import { Deployment } from '@develit-io/platform-sdk';
3
+ import { BindingsFromDescriptor } from '@develit-io/platform-sdk/service-config';
4
+
5
+ interface BankServiceVariables {
6
+ ERSTE_AUTH_URI: string;
7
+ ERSTE_PAYMENTS_URI: string;
8
+ ERSTE_ACCOUNTS_URI: string;
9
+ FINBRICKS_BASE_URI: string;
10
+ FINBRICKS_MERCHANT_ID: string;
11
+ CRON_PAYMENT_STATUSES: string;
12
+ CRON_SYNC_WORKFLOW_HEARTBEAT: string;
13
+ BANK_AUTH_RECIPIENT: string;
14
+ DBUCS_BASE_URI: string;
15
+ DBUCS_USERNAME: string;
16
+ DBUCS_APPLICATION_CODE: string;
17
+ DBUCS_TX_AUTH_URI: string;
18
+ REDIRECT_URI: string;
19
+ SYNC_WORKFLOW_RESET_AFTER_ITERATIONS: string;
20
+ [key: string]: string | number | boolean;
21
+ }
22
+ declare const BANK_SERVICE_BINDINGS: {
23
+ readonly SECRETS_STORE: {
24
+ readonly kind: "service";
25
+ readonly target: "secrets-store";
26
+ };
27
+ readonly BANK_KV: {
28
+ readonly kind: "kv";
29
+ readonly suffix: "bank";
30
+ };
31
+ readonly BANK_D1: {
32
+ readonly kind: "d1";
33
+ readonly suffix: "bank";
34
+ };
35
+ readonly QUEUE_BUS_QUEUE: {
36
+ readonly kind: "queueProducer";
37
+ readonly suffix: "queue-bus";
38
+ };
39
+ readonly NOTIFICATIONS_QUEUE: {
40
+ readonly kind: "queueProducer";
41
+ readonly suffix: "notifications";
42
+ };
43
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
44
+ readonly kind: "workflow";
45
+ readonly class: "BankSyncAccountPayments";
46
+ readonly suffix: "bank-sync-account-payments";
47
+ readonly limits: {
48
+ readonly steps: 25000;
49
+ };
50
+ };
51
+ readonly PROCESS_BATCH_WORKFLOW: {
52
+ readonly kind: "workflow";
53
+ readonly class: "BankProcessBatch";
54
+ readonly suffix: "bank-process-batch";
55
+ };
56
+ readonly DBU_CBS_BACKOFFICE_DEV: {
57
+ readonly kind: "vpc";
58
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
59
+ };
60
+ };
61
+ declare const baseBankServiceConfig: (project: string, version: string, options?: _develit_io_platform_sdk.ServiceConfigOptions<BankServiceVariables, _develit_io_platform_sdk.MiniflareIds<{
62
+ readonly SECRETS_STORE: {
63
+ readonly kind: "service";
64
+ readonly target: "secrets-store";
65
+ };
66
+ readonly BANK_KV: {
67
+ readonly kind: "kv";
68
+ readonly suffix: "bank";
69
+ };
70
+ readonly BANK_D1: {
71
+ readonly kind: "d1";
72
+ readonly suffix: "bank";
73
+ };
74
+ readonly QUEUE_BUS_QUEUE: {
75
+ readonly kind: "queueProducer";
76
+ readonly suffix: "queue-bus";
77
+ };
78
+ readonly NOTIFICATIONS_QUEUE: {
79
+ readonly kind: "queueProducer";
80
+ readonly suffix: "notifications";
81
+ };
82
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
83
+ readonly kind: "workflow";
84
+ readonly class: "BankSyncAccountPayments";
85
+ readonly suffix: "bank-sync-account-payments";
86
+ readonly limits: {
87
+ readonly steps: 25000;
88
+ };
89
+ };
90
+ readonly PROCESS_BATCH_WORKFLOW: {
91
+ readonly kind: "workflow";
92
+ readonly class: "BankProcessBatch";
93
+ readonly suffix: "bank-process-batch";
94
+ };
95
+ readonly DBU_CBS_BACKOFFICE_DEV: {
96
+ readonly kind: "vpc";
97
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
98
+ };
99
+ }>> | undefined) => _develit_io_platform_sdk.ServiceConfigWithBindings<BankServiceVariables, {
100
+ readonly SECRETS_STORE: {
101
+ readonly kind: "service";
102
+ readonly target: "secrets-store";
103
+ };
104
+ readonly BANK_KV: {
105
+ readonly kind: "kv";
106
+ readonly suffix: "bank";
107
+ };
108
+ readonly BANK_D1: {
109
+ readonly kind: "d1";
110
+ readonly suffix: "bank";
111
+ };
112
+ readonly QUEUE_BUS_QUEUE: {
113
+ readonly kind: "queueProducer";
114
+ readonly suffix: "queue-bus";
115
+ };
116
+ readonly NOTIFICATIONS_QUEUE: {
117
+ readonly kind: "queueProducer";
118
+ readonly suffix: "notifications";
119
+ };
120
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
121
+ readonly kind: "workflow";
122
+ readonly class: "BankSyncAccountPayments";
123
+ readonly suffix: "bank-sync-account-payments";
124
+ readonly limits: {
125
+ readonly steps: 25000;
126
+ };
127
+ };
128
+ readonly PROCESS_BATCH_WORKFLOW: {
129
+ readonly kind: "workflow";
130
+ readonly class: "BankProcessBatch";
131
+ readonly suffix: "bank-process-batch";
132
+ };
133
+ readonly DBU_CBS_BACKOFFICE_DEV: {
134
+ readonly kind: "vpc";
135
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
136
+ };
137
+ }, readonly []>;
138
+ declare function bankServiceConfig(project: string, version: string, options?: Parameters<typeof baseBankServiceConfig>[2]): ((deployment: Deployment, bindings: BindingsFromDescriptor<typeof BANK_SERVICE_BINDINGS>) => {
139
+ resourceName: "bank";
140
+ variables: BankServiceVariables;
141
+ bindings: BindingsFromDescriptor<{
142
+ readonly SECRETS_STORE: {
143
+ readonly kind: "service";
144
+ readonly target: "secrets-store";
145
+ };
146
+ readonly BANK_KV: {
147
+ readonly kind: "kv";
148
+ readonly suffix: "bank";
149
+ };
150
+ readonly BANK_D1: {
151
+ readonly kind: "d1";
152
+ readonly suffix: "bank";
153
+ };
154
+ readonly QUEUE_BUS_QUEUE: {
155
+ readonly kind: "queueProducer";
156
+ readonly suffix: "queue-bus";
157
+ };
158
+ readonly NOTIFICATIONS_QUEUE: {
159
+ readonly kind: "queueProducer";
160
+ readonly suffix: "notifications";
161
+ };
162
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
163
+ readonly kind: "workflow";
164
+ readonly class: "BankSyncAccountPayments";
165
+ readonly suffix: "bank-sync-account-payments";
166
+ readonly limits: {
167
+ readonly steps: 25000;
168
+ };
169
+ };
170
+ readonly PROCESS_BATCH_WORKFLOW: {
171
+ readonly kind: "workflow";
172
+ readonly class: "BankProcessBatch";
173
+ readonly suffix: "bank-process-batch";
174
+ };
175
+ readonly DBU_CBS_BACKOFFICE_DEV: {
176
+ readonly kind: "vpc";
177
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
178
+ };
179
+ }>;
180
+ crons: string[];
181
+ }) & _develit_io_platform_sdk.ServiceConfigWithBindings<BankServiceVariables, {
182
+ readonly SECRETS_STORE: {
183
+ readonly kind: "service";
184
+ readonly target: "secrets-store";
185
+ };
186
+ readonly BANK_KV: {
187
+ readonly kind: "kv";
188
+ readonly suffix: "bank";
189
+ };
190
+ readonly BANK_D1: {
191
+ readonly kind: "d1";
192
+ readonly suffix: "bank";
193
+ };
194
+ readonly QUEUE_BUS_QUEUE: {
195
+ readonly kind: "queueProducer";
196
+ readonly suffix: "queue-bus";
197
+ };
198
+ readonly NOTIFICATIONS_QUEUE: {
199
+ readonly kind: "queueProducer";
200
+ readonly suffix: "notifications";
201
+ };
202
+ readonly SYNC_ACCOUNT_PAYMENTS_WORKFLOW: {
203
+ readonly kind: "workflow";
204
+ readonly class: "BankSyncAccountPayments";
205
+ readonly suffix: "bank-sync-account-payments";
206
+ readonly limits: {
207
+ readonly steps: 25000;
208
+ };
209
+ };
210
+ readonly PROCESS_BATCH_WORKFLOW: {
211
+ readonly kind: "workflow";
212
+ readonly class: "BankProcessBatch";
213
+ readonly suffix: "bank-process-batch";
214
+ };
215
+ readonly DBU_CBS_BACKOFFICE_DEV: {
216
+ readonly kind: "vpc";
217
+ readonly serviceId: "019c2962-172c-75a2-a000-b76e246d25d7";
218
+ };
219
+ }, readonly []>;
220
+
221
+ export { BANK_SERVICE_BINDINGS, bankServiceConfig };
222
+ export type { BankServiceVariables };