@develit-services/bank 0.8.2 → 0.8.3

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 (41) hide show
  1. package/README.md +82 -6
  2. package/dist/database/schema.cjs +9 -7
  3. package/dist/database/schema.d.cts +1 -1
  4. package/dist/database/schema.d.mts +1 -1
  5. package/dist/database/schema.d.ts +1 -1
  6. package/dist/database/schema.mjs +1 -1
  7. package/dist/export/worker.cjs +210 -42
  8. package/dist/export/worker.d.cts +23 -8
  9. package/dist/export/worker.d.mts +23 -8
  10. package/dist/export/worker.d.ts +23 -8
  11. package/dist/export/worker.mjs +201 -33
  12. package/dist/export/workflows.cjs +71 -52
  13. package/dist/export/workflows.mjs +71 -52
  14. package/dist/export/wrangler.d.cts +1 -2
  15. package/dist/export/wrangler.d.mts +1 -2
  16. package/dist/export/wrangler.d.ts +1 -2
  17. package/dist/shared/{bank.Du70-Kk_.d.cts → bank.BE9bK1n7.d.mts} +211 -1
  18. package/dist/shared/{bank.Bs7mkXbR.cjs → bank.BOnP9p9Y.cjs} +15 -2
  19. package/dist/shared/bank.C-T1FQxg.cjs +17 -0
  20. package/dist/shared/{bank.993UA65l.mjs → bank.C4VOdIx1.mjs} +57 -5
  21. package/dist/shared/{bank.BC06Rbrx.d.cts → bank.CQBfbG8u.d.cts} +0 -1
  22. package/dist/shared/{bank.BC06Rbrx.d.mts → bank.CQBfbG8u.d.mts} +0 -1
  23. package/dist/shared/{bank.BC06Rbrx.d.ts → bank.CQBfbG8u.d.ts} +0 -1
  24. package/dist/shared/{bank.Ce-NBBw1.cjs → bank.CQURey1E.cjs} +64 -7
  25. package/dist/shared/{bank.CGIeLo8U.mjs → bank.Cpy9PULF.mjs} +14 -3
  26. package/dist/shared/bank.DDHrdFgy.mjs +15 -0
  27. package/dist/shared/{bank.BJ7LqYtJ.d.cts → bank.DDveEfub.d.cts} +707 -126
  28. package/dist/shared/{bank.BJ7LqYtJ.d.mts → bank.DDveEfub.d.mts} +707 -126
  29. package/dist/shared/{bank.BJ7LqYtJ.d.ts → bank.DDveEfub.d.ts} +707 -126
  30. package/dist/shared/{bank.CeRbuycV.mjs → bank.DRrBrAdI.mjs} +62 -8
  31. package/dist/shared/{bank.IVhZ_RlH.cjs → bank.SQ4Mmr8u.cjs} +57 -3
  32. package/dist/shared/{bank.Du70-Kk_.d.mts → bank.gl4dlxWy.d.cts} +211 -1
  33. package/dist/shared/{bank.Du70-Kk_.d.ts → bank.pngKIcOl.d.ts} +211 -1
  34. package/dist/types.cjs +25 -23
  35. package/dist/types.d.cts +29 -180
  36. package/dist/types.d.mts +29 -180
  37. package/dist/types.d.ts +29 -180
  38. package/dist/types.mjs +2 -2
  39. package/package.json +1 -1
  40. package/dist/shared/bank.Cp0yvOdq.cjs +0 -15
  41. package/dist/shared/bank.fIGTiPnp.mjs +0 -13
package/dist/types.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const mock_connector = require('./shared/bank.Ce-NBBw1.cjs');
4
- const payment_schema = require('./shared/bank.IVhZ_RlH.cjs');
3
+ const mock_connector = require('./shared/bank.CQURey1E.cjs');
4
+ const paymentRequest_schema = require('./shared/bank.SQ4Mmr8u.cjs');
5
5
  const batchLifecycle = require('./shared/bank.Bg3Pdwm4.cjs');
6
6
  const generalCodes = require('@develit-io/general-codes');
7
7
  require('@develit-io/backend-sdk');
@@ -29,31 +29,33 @@ exports.assignAccount = mock_connector.assignAccount;
29
29
  exports.batchTransform = mock_connector.batchTransform;
30
30
  exports.signFinbricksJws = mock_connector.signFinbricksJws;
31
31
  exports.toBatchedPayment = mock_connector.toBatchedPayment;
32
+ exports.toBatchedPaymentFromPaymentRequest = mock_connector.toBatchedPaymentFromPaymentRequest;
32
33
  exports.toCompletedPayment = mock_connector.toCompletedPayment;
33
34
  exports.toIncomingPayment = mock_connector.toIncomingPayment;
35
+ exports.toPaymentRequestInsert = mock_connector.toPaymentRequestInsert;
34
36
  exports.toPreparedPayment = mock_connector.toPreparedPayment;
35
37
  exports.useFinbricksFetch = mock_connector.useFinbricksFetch;
36
- exports.ACCOUNT_STATUSES = payment_schema.ACCOUNT_STATUSES;
37
- exports.BATCH_STATUES = payment_schema.BATCH_STATUSES;
38
- exports.BATCH_STATUSES = payment_schema.BATCH_STATUSES;
39
- exports.CHARGE_BEARERS = payment_schema.CHARGE_BEARERS;
40
- exports.CONNECTOR_KEYS = payment_schema.CONNECTOR_KEYS;
41
- exports.COUNTRY_CODES = payment_schema.COUNTRY_CODES;
42
- exports.CREDENTIALS_TYPES = payment_schema.CREDENTIALS_TYPES;
43
- exports.INSTRUCTION_PRIORITIES = payment_schema.INSTRUCTION_PRIORITIES;
44
- exports.PAYMENT_DIRECTIONS = payment_schema.PAYMENT_DIRECTIONS;
45
- exports.PAYMENT_STATUSES = payment_schema.PAYMENT_STATUSES;
46
- exports.PAYMENT_TYPES = payment_schema.PAYMENT_TYPES;
47
- exports.TOKEN_TYPES = payment_schema.TOKEN_TYPES;
48
- exports.accountCredentialsInsertSchema = payment_schema.accountCredentialsInsertSchema;
49
- exports.accountCredentialsSelectSchema = payment_schema.accountCredentialsSelectSchema;
50
- exports.accountCredentialsUpdateSchema = payment_schema.accountCredentialsUpdateSchema;
51
- exports.accountInsertSchema = payment_schema.accountInsertSchema;
52
- exports.accountSelectSchema = payment_schema.accountSelectSchema;
53
- exports.accountUpdateSchema = payment_schema.accountUpdateSchema;
54
- exports.ottInsertSchema = payment_schema.ottInsertSchema;
55
- exports.ottSelectSchema = payment_schema.ottSelectSchema;
56
- exports.ottUpdateSchema = payment_schema.ottUpdateSchema;
38
+ exports.ACCOUNT_STATUSES = paymentRequest_schema.ACCOUNT_STATUSES;
39
+ exports.BATCH_STATUES = paymentRequest_schema.BATCH_STATUSES;
40
+ exports.BATCH_STATUSES = paymentRequest_schema.BATCH_STATUSES;
41
+ exports.CHARGE_BEARERS = paymentRequest_schema.CHARGE_BEARERS;
42
+ exports.CONNECTOR_KEYS = paymentRequest_schema.CONNECTOR_KEYS;
43
+ exports.COUNTRY_CODES = paymentRequest_schema.COUNTRY_CODES;
44
+ exports.CREDENTIALS_TYPES = paymentRequest_schema.CREDENTIALS_TYPES;
45
+ exports.INSTRUCTION_PRIORITIES = paymentRequest_schema.INSTRUCTION_PRIORITIES;
46
+ exports.PAYMENT_DIRECTIONS = paymentRequest_schema.PAYMENT_DIRECTIONS;
47
+ exports.PAYMENT_STATUSES = paymentRequest_schema.PAYMENT_STATUSES;
48
+ exports.PAYMENT_TYPES = paymentRequest_schema.PAYMENT_TYPES;
49
+ exports.TOKEN_TYPES = paymentRequest_schema.TOKEN_TYPES;
50
+ exports.accountCredentialsInsertSchema = paymentRequest_schema.accountCredentialsInsertSchema;
51
+ exports.accountCredentialsSelectSchema = paymentRequest_schema.accountCredentialsSelectSchema;
52
+ exports.accountCredentialsUpdateSchema = paymentRequest_schema.accountCredentialsUpdateSchema;
53
+ exports.accountInsertSchema = paymentRequest_schema.accountInsertSchema;
54
+ exports.accountSelectSchema = paymentRequest_schema.accountSelectSchema;
55
+ exports.accountUpdateSchema = paymentRequest_schema.accountUpdateSchema;
56
+ exports.ottInsertSchema = paymentRequest_schema.ottInsertSchema;
57
+ exports.ottSelectSchema = paymentRequest_schema.ottSelectSchema;
58
+ exports.ottUpdateSchema = paymentRequest_schema.ottUpdateSchema;
57
59
  exports.hasPaymentAccountAssigned = batchLifecycle.hasPaymentAccountAssigned;
58
60
  exports.isBatchCompleted = batchLifecycle.isBatchCompleted;
59
61
  exports.isBatchFailed = batchLifecycle.isBatchFailed;
package/dist/types.d.cts CHANGED
@@ -1,12 +1,12 @@
1
- import { b as CurrencyCode, c as BankCode, d as CountryCode, I as IBankConnector, a as ConnectorKey, e as ConnectedAccount, f as CredentialsResolver, g as AccountCredentialsInsertType, h as AccountInsertType, i as BatchedPayment, j as InitiatedBatch, k as IncomingPayment, l as InitiatedPayment, A as AccountSelectType, m as ParsedBankPayment, n as PaymentStatus, o as BatchStatus, p as PaymentType, q as BatchMetadata, r as Currency, P as PaymentSelectType, s as AccountAssignedPayment, u as PreparedPayment, v as CompletedPayment } from './shared/bank.BJ7LqYtJ.cjs';
2
- export { w as ACCOUNT_STATUSES, x as AccountCredentialsPatchType, y as AccountCredentialsSelectType, z as AccountCredentialsUpdateType, D as AccountPatchType, E as AccountStatus, F as AccountUpdateType, G as BATCH_STATUES, G as BATCH_STATUSES, H as BankAccountWithLastSync, J as BatchInsertType, K as BatchLifecycle, M as BatchPayment, B as BatchSelectType, N as CHARGE_BEARERS, O as CONNECTOR_KEYS, Q as COUNTRY_CODES, R as CREDENTIALS_TYPES, S as ChargeBearer, T as CompletedBatch, C as ConfigEnvironmentBank, U as CreatedBatch, V as CredentialsType, W as INSTRUCTION_PRIORITIES, X as InstructionPriority, L as LastSyncMetadata, Y as PAYMENT_DIRECTIONS, Z as PAYMENT_STATUSES, _ as PAYMENT_TYPES, $ as PaymentDirection, a0 as PaymentFailedInsertType, a1 as PaymentInsertType, a2 as PaymentLifecycle, a3 as PaymentPreparedInsertType, a4 as ProcessingBatch, a5 as ReadyToSignBatch, a6 as ResolvedCredentials, a7 as SignedBatch, a8 as TOKEN_TYPES, a9 as TokenType, aa as accountCredentialsInsertSchema, ab as accountCredentialsSelectSchema, ac as accountCredentialsUpdateSchema, ad as accountInsertSchema, ae as accountSelectSchema, af as accountUpdateSchema, ag as hasPaymentAccountAssigned, ah as isBatchCompleted, ai as isBatchFailed, aj as isBatchInitiated, ak as isBatchOpen, al as isBatchProcessing, am as isBatchReadyToSign, an as isBatchSigned, ao as isPaymentCompleted, ap as isPaymentPrepared } from './shared/bank.BJ7LqYtJ.cjs';
3
- export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.BC06Rbrx.cjs';
1
+ import { I as IBankConnector, a as ConnectorKey, b as ConnectedAccount, c as CredentialsResolver, d as AccountCredentialsInsertType, e as AccountInsertType, f as BatchedPayment, g as InitiatedBatch, h as IncomingPayment, i as InitiatedPayment, A as AccountSelectType, j as ParsedBankPayment, k as PaymentStatus, l as BatchStatus, m as PaymentType, n as BatchMetadata, o as Currency, P as PaymentSelectType, p as AccountAssignedPayment, q as PaymentRequestSelectType, r as PreparedPayment, s as CompletedPayment, u as PaymentRequestInsertType } from './shared/bank.DDveEfub.cjs';
2
+ export { v as ACCOUNT_STATUSES, w as AccountCredentialsPatchType, x as AccountCredentialsSelectType, y as AccountCredentialsUpdateType, z as AccountPatchType, D as AccountStatus, E as AccountUpdateType, F as BATCH_STATUES, F as BATCH_STATUSES, G as BankAccountWithLastSync, H as BankCode, J as BatchInsertType, K as BatchLifecycle, M as BatchPayment, B as BatchSelectType, N as CHARGE_BEARERS, O as CONNECTOR_KEYS, Q as COUNTRY_CODES, R as CREDENTIALS_TYPES, S as ChargeBearer, T as CompletedBatch, C as ConfigEnvironmentBank, U as CountryCode, V as CreatedBatch, W as CredentialsType, X as CurrencyCode, Y as INSTRUCTION_PRIORITIES, Z as InstructionPriority, L as LastSyncMetadata, _ as PAYMENT_DIRECTIONS, $ as PAYMENT_STATUSES, a0 as PAYMENT_TYPES, a1 as PaymentDirection, a2 as PaymentFailedInsertType, a3 as PaymentInsertType, a4 as PaymentLifecycle, a5 as PaymentPreparedInsertType, a6 as ProcessingBatch, a7 as ReadyToSignBatch, a8 as ResolvedCredentials, a9 as SignedBatch, aa as TOKEN_TYPES, ab as TokenType, ac as accountCredentialsInsertSchema, ad as accountCredentialsSelectSchema, ae as accountCredentialsUpdateSchema, af as accountInsertSchema, ag as accountSelectSchema, ah as accountUpdateSchema, ai as hasPaymentAccountAssigned, aj as isBatchCompleted, ak as isBatchFailed, al as isBatchInitiated, am as isBatchOpen, an as isBatchProcessing, ao as isBatchReadyToSign, ap as isBatchSigned, aq as isPaymentCompleted, ar as isPaymentPrepared } from './shared/bank.DDveEfub.cjs';
3
+ import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.gl4dlxWy.cjs';
4
+ export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.gl4dlxWy.cjs';
5
+ export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CQBfbG8u.cjs';
4
6
  import { BaseEvent } from '@develit-io/backend-sdk';
5
7
  import * as drizzle_zod from 'drizzle-zod';
6
8
  import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
7
9
  import { z } from 'zod';
8
- import { S as SendPaymentInput } from './shared/bank.Du70-Kk_.cjs';
9
- export { b as SendPaymentSyncInput } from './shared/bank.Du70-Kk_.cjs';
10
10
  export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
11
11
  import 'drizzle-orm';
12
12
 
@@ -93,6 +93,25 @@ type FinbricksGetBatchStatusBody = {
93
93
  merchantTransactionId?: string;
94
94
  finalBankStatus?: boolean;
95
95
  };
96
+ type FinbricksSupportedBanksQuery = {
97
+ merchantId: string;
98
+ countryCode?: string;
99
+ domesticInstantPaymentCreditorSupported?: boolean;
100
+ domesticInstantPaymentDebtorSupported?: boolean;
101
+ sepaInstantPaymentCreditorSupported?: boolean;
102
+ sepaInstantPaymentDebtorSupported?: boolean;
103
+ sepaPaymentSupported?: boolean;
104
+ foreignPaymentSupported?: boolean;
105
+ domesticPaymentSupported?: boolean;
106
+ accountInformationSupported?: boolean;
107
+ accountBalanceSupported?: boolean;
108
+ accountTransactionsSupported?: boolean;
109
+ batchPaymentSupported?: boolean;
110
+ recurringPaymentSupported?: boolean;
111
+ paymentPairingSupported?: boolean;
112
+ statusSettledSupported?: boolean;
113
+ enabledForMerchant?: boolean;
114
+ };
96
115
  type FinbricksForeignPaymentBody = {
97
116
  merchantIdentification: {
98
117
  merchantId: string;
@@ -156,179 +175,6 @@ type FinbricksForeignPaymentBody = {
156
175
  };
157
176
  };
158
177
 
159
- type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
160
-
161
- type FinbricksAuthTokenResponse = {
162
- clientId: string;
163
- provider: string;
164
- scope: 'AISP' | 'AISP_PISP';
165
- validFrom: string;
166
- validTo: string;
167
- stronglyAuthenticatedTo?: string;
168
- }[];
169
- type RedirectUrl = {
170
- redirectUrl: string;
171
- };
172
- type FinbricksIdentification = {
173
- accountNumber: string;
174
- iban: string;
175
- other: {
176
- type: string;
177
- value: string;
178
- };
179
- };
180
- type FinbricksServicer = {
181
- bankCode: BankCode;
182
- countryCode: CountryCode;
183
- bic: string;
184
- };
185
- type FinbricksAccount = {
186
- id: string;
187
- identification: FinbricksIdentification;
188
- currency: CurrencyCode;
189
- servicer: FinbricksServicer;
190
- accountName: string;
191
- productName: string;
192
- ownersNames: string[];
193
- relationship: {
194
- isOwner: boolean;
195
- };
196
- pispSuitable: boolean;
197
- };
198
- type FinbricksPaymentResponse = RedirectUrl;
199
- type FinbricksBatchResponse = RedirectUrl;
200
- type FinbricksConnectAccountResponse = RedirectUrl;
201
- type FinbricksAccountsListResponse = {
202
- accounts: FinbricksAccount[];
203
- };
204
- type FinbricksTransactionLink = {
205
- rel: string;
206
- value: string;
207
- };
208
- type FinbricksAmount = {
209
- value: number;
210
- currency: CurrencyCode;
211
- };
212
- type FinbricksAddress = {
213
- streetName: string;
214
- buildingNumber: string;
215
- postCode: string;
216
- townName: string;
217
- country: CountryCode;
218
- adressLine: string;
219
- };
220
- type FinbricksTransaction = {
221
- fbxReference: string;
222
- entryReference: string;
223
- amount: FinbricksAmount;
224
- creditDebitIndicator: 'CRDT' | 'DBIT';
225
- reversalIndicator: boolean;
226
- status: string;
227
- bookingDate: {
228
- date: Date;
229
- };
230
- valueDate: {
231
- date: Date;
232
- };
233
- bankTransactionCode: {
234
- proprietary: {
235
- code: string;
236
- issuer: string;
237
- };
238
- };
239
- entryDetails: {
240
- transactionDetails: {
241
- references: {
242
- messageIdentification: string;
243
- accountServicerReference: string;
244
- paymentInformationIdentification: string;
245
- instructionIdentification: string;
246
- endToEndIdentification: string;
247
- chequeNumber: string;
248
- clearingSystemReference: string;
249
- };
250
- amountDetails: {
251
- instructedAmount: {
252
- amount: FinbricksAmount;
253
- };
254
- transactionAmount: {
255
- amount: FinbricksAmount;
256
- };
257
- counterValueAmount: {
258
- amount: FinbricksAmount;
259
- currencyExchange: {
260
- sourceCurrency: CurrencyCode;
261
- targetCurrency: CurrencyCode;
262
- exchangeRate: number;
263
- };
264
- };
265
- proprietaryAmount: {
266
- type: string;
267
- amount: FinbricksAmount;
268
- };
269
- };
270
- charges: {
271
- bearer: string;
272
- value: number;
273
- currency: CurrencyCode;
274
- };
275
- relatedParties: {
276
- debtor?: {
277
- name: string;
278
- postalAddress: FinbricksAddress;
279
- identification: {
280
- organizationIdentification: {
281
- bicOrBei: string;
282
- };
283
- };
284
- };
285
- debtorAccount?: {
286
- name: string;
287
- identification: {
288
- iban: string;
289
- other: {
290
- identification: string;
291
- };
292
- };
293
- };
294
- creditor?: {
295
- name: string;
296
- postalAddress: FinbricksAddress;
297
- identification: {
298
- organizationIdentification: {
299
- bicOrBei: string;
300
- };
301
- };
302
- };
303
- creditorAccount?: {
304
- name: string;
305
- identification: {
306
- iban: string;
307
- other: {
308
- identification: string;
309
- };
310
- };
311
- };
312
- };
313
- remittanceInformation: {
314
- unstructured: string;
315
- structured: {
316
- creditorReferenceInformation: {
317
- reference: ReferenceType[];
318
- };
319
- };
320
- };
321
- additionalRemittanceInformation: string;
322
- additionalTransactionInformation: string;
323
- };
324
- };
325
- };
326
- type FinbricksAccountTransactionsResponse = {
327
- pageSize: number;
328
- links: FinbricksTransactionLink[];
329
- transactions: FinbricksTransaction[];
330
- };
331
-
332
178
  interface FinbricksFetchConfig {
333
179
  baseUrl: string;
334
180
  endpoint: string;
@@ -368,6 +214,7 @@ declare const FINBRICKS_ENDPOINTS: {
368
214
  readonly TRANSACTION_FOREIGN_INIT: "/transaction/platform/foreign/init";
369
215
  readonly TRANSACTION_BATCH_INIT: "/transaction/platform/batchPayment/init";
370
216
  readonly BATCH_STATUS: "/transaction/platform/batchPayment/status";
217
+ readonly BANK_INFO: "/status/bankInfo";
371
218
  };
372
219
  type FinbricksEndpoint = keyof typeof FINBRICKS_ENDPOINTS;
373
220
  type FinbricksEndpointPath = (typeof FINBRICKS_ENDPOINTS)[FinbricksEndpoint];
@@ -1496,6 +1343,8 @@ declare function toCompletedPayment(payment: PreparedPayment, status: 'COMPLETED
1496
1343
  * @returns Array of transformed payments
1497
1344
  */
1498
1345
  declare function batchTransform<TInput, TOutput>(payments: TInput[], transformer: (payment: TInput) => TOutput): TOutput[];
1346
+ declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string): PaymentRequestInsertType;
1347
+ declare function toBatchedPaymentFromPaymentRequest(sp: PaymentRequestSelectType): BatchedPayment;
1499
1348
 
1500
- export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BankCode, BatchMetadata, BatchStatus, BatchedPayment, CompletedPayment, ConnectedAccount, ConnectorKey, CountryCode, CredentialsResolver, CsobConnector, Currency, CurrencyCode, DbuConnector, ErsteConnector, FINBRICKS_ENDPOINTS, FinbricksClient, FinbricksConnector, IBankConnector, IncomingPayment, IncomingPayment as IncomingPaymentMessage, InitiatedBatch, InitiatedPayment, KBConnector, MockCobsConnector, MockConnector, ParsedBankPayment, PaymentSelectType, PaymentStatus, PaymentType, PreparedPayment, SendPaymentInput, assignAccount, batchTransform, ottInsertSchema, ottSelectSchema, ottUpdateSchema, signFinbricksJws, toBatchedPayment, toCompletedPayment, toIncomingPayment, toPreparedPayment, useFinbricksFetch };
1501
- export type { BankPaymentEvent, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksAccount, FinbricksAccountTransactionsResponse, FinbricksAccountsListResponse, FinbricksAuthTokenResponse, FinbricksBatchBody, FinbricksBatchResponse, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectAccountResponse, FinbricksConnectorConfig, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksPaymentResponse, FinbricksProvider, FinbricksRequestInit, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
1349
+ export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchStatus, BatchedPayment, CompletedPayment, ConnectedAccount, ConnectorKey, CredentialsResolver, CsobConnector, Currency, DbuConnector, ErsteConnector, FINBRICKS_ENDPOINTS, FinbricksAccount, FinbricksClient, FinbricksConnector, IBankConnector, IncomingPayment, IncomingPayment as IncomingPaymentMessage, InitiatedBatch, InitiatedPayment, KBConnector, MockCobsConnector, MockConnector, ParsedBankPayment, PaymentRequestInsertType, PaymentRequestSelectType, PaymentSelectType, PaymentStatus, PaymentType, PreparedPayment, SendPaymentInput, assignAccount, batchTransform, ottInsertSchema, ottSelectSchema, ottUpdateSchema, signFinbricksJws, toBatchedPayment, toBatchedPaymentFromPaymentRequest, toCompletedPayment, toIncomingPayment, toPaymentRequestInsert, toPreparedPayment, useFinbricksFetch };
1350
+ export type { BankPaymentEvent, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksBatchBody, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectorConfig, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksProvider, FinbricksRequestInit, FinbricksSupportedBanksQuery, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
package/dist/types.d.mts CHANGED
@@ -1,12 +1,12 @@
1
- import { b as CurrencyCode, c as BankCode, d as CountryCode, I as IBankConnector, a as ConnectorKey, e as ConnectedAccount, f as CredentialsResolver, g as AccountCredentialsInsertType, h as AccountInsertType, i as BatchedPayment, j as InitiatedBatch, k as IncomingPayment, l as InitiatedPayment, A as AccountSelectType, m as ParsedBankPayment, n as PaymentStatus, o as BatchStatus, p as PaymentType, q as BatchMetadata, r as Currency, P as PaymentSelectType, s as AccountAssignedPayment, u as PreparedPayment, v as CompletedPayment } from './shared/bank.BJ7LqYtJ.mjs';
2
- export { w as ACCOUNT_STATUSES, x as AccountCredentialsPatchType, y as AccountCredentialsSelectType, z as AccountCredentialsUpdateType, D as AccountPatchType, E as AccountStatus, F as AccountUpdateType, G as BATCH_STATUES, G as BATCH_STATUSES, H as BankAccountWithLastSync, J as BatchInsertType, K as BatchLifecycle, M as BatchPayment, B as BatchSelectType, N as CHARGE_BEARERS, O as CONNECTOR_KEYS, Q as COUNTRY_CODES, R as CREDENTIALS_TYPES, S as ChargeBearer, T as CompletedBatch, C as ConfigEnvironmentBank, U as CreatedBatch, V as CredentialsType, W as INSTRUCTION_PRIORITIES, X as InstructionPriority, L as LastSyncMetadata, Y as PAYMENT_DIRECTIONS, Z as PAYMENT_STATUSES, _ as PAYMENT_TYPES, $ as PaymentDirection, a0 as PaymentFailedInsertType, a1 as PaymentInsertType, a2 as PaymentLifecycle, a3 as PaymentPreparedInsertType, a4 as ProcessingBatch, a5 as ReadyToSignBatch, a6 as ResolvedCredentials, a7 as SignedBatch, a8 as TOKEN_TYPES, a9 as TokenType, aa as accountCredentialsInsertSchema, ab as accountCredentialsSelectSchema, ac as accountCredentialsUpdateSchema, ad as accountInsertSchema, ae as accountSelectSchema, af as accountUpdateSchema, ag as hasPaymentAccountAssigned, ah as isBatchCompleted, ai as isBatchFailed, aj as isBatchInitiated, ak as isBatchOpen, al as isBatchProcessing, am as isBatchReadyToSign, an as isBatchSigned, ao as isPaymentCompleted, ap as isPaymentPrepared } from './shared/bank.BJ7LqYtJ.mjs';
3
- export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.BC06Rbrx.mjs';
1
+ import { I as IBankConnector, a as ConnectorKey, b as ConnectedAccount, c as CredentialsResolver, d as AccountCredentialsInsertType, e as AccountInsertType, f as BatchedPayment, g as InitiatedBatch, h as IncomingPayment, i as InitiatedPayment, A as AccountSelectType, j as ParsedBankPayment, k as PaymentStatus, l as BatchStatus, m as PaymentType, n as BatchMetadata, o as Currency, P as PaymentSelectType, p as AccountAssignedPayment, q as PaymentRequestSelectType, r as PreparedPayment, s as CompletedPayment, u as PaymentRequestInsertType } from './shared/bank.DDveEfub.mjs';
2
+ export { v as ACCOUNT_STATUSES, w as AccountCredentialsPatchType, x as AccountCredentialsSelectType, y as AccountCredentialsUpdateType, z as AccountPatchType, D as AccountStatus, E as AccountUpdateType, F as BATCH_STATUES, F as BATCH_STATUSES, G as BankAccountWithLastSync, H as BankCode, J as BatchInsertType, K as BatchLifecycle, M as BatchPayment, B as BatchSelectType, N as CHARGE_BEARERS, O as CONNECTOR_KEYS, Q as COUNTRY_CODES, R as CREDENTIALS_TYPES, S as ChargeBearer, T as CompletedBatch, C as ConfigEnvironmentBank, U as CountryCode, V as CreatedBatch, W as CredentialsType, X as CurrencyCode, Y as INSTRUCTION_PRIORITIES, Z as InstructionPriority, L as LastSyncMetadata, _ as PAYMENT_DIRECTIONS, $ as PAYMENT_STATUSES, a0 as PAYMENT_TYPES, a1 as PaymentDirection, a2 as PaymentFailedInsertType, a3 as PaymentInsertType, a4 as PaymentLifecycle, a5 as PaymentPreparedInsertType, a6 as ProcessingBatch, a7 as ReadyToSignBatch, a8 as ResolvedCredentials, a9 as SignedBatch, aa as TOKEN_TYPES, ab as TokenType, ac as accountCredentialsInsertSchema, ad as accountCredentialsSelectSchema, ae as accountCredentialsUpdateSchema, af as accountInsertSchema, ag as accountSelectSchema, ah as accountUpdateSchema, ai as hasPaymentAccountAssigned, aj as isBatchCompleted, ak as isBatchFailed, al as isBatchInitiated, am as isBatchOpen, an as isBatchProcessing, ao as isBatchReadyToSign, ap as isBatchSigned, aq as isPaymentCompleted, ar as isPaymentPrepared } from './shared/bank.DDveEfub.mjs';
3
+ import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.BE9bK1n7.mjs';
4
+ export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.BE9bK1n7.mjs';
5
+ export { a as BankServiceEnv, b as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CQBfbG8u.mjs';
4
6
  import { BaseEvent } from '@develit-io/backend-sdk';
5
7
  import * as drizzle_zod from 'drizzle-zod';
6
8
  import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
7
9
  import { z } from 'zod';
8
- import { S as SendPaymentInput } from './shared/bank.Du70-Kk_.mjs';
9
- export { b as SendPaymentSyncInput } from './shared/bank.Du70-Kk_.mjs';
10
10
  export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
11
11
  import 'drizzle-orm';
12
12
 
@@ -93,6 +93,25 @@ type FinbricksGetBatchStatusBody = {
93
93
  merchantTransactionId?: string;
94
94
  finalBankStatus?: boolean;
95
95
  };
96
+ type FinbricksSupportedBanksQuery = {
97
+ merchantId: string;
98
+ countryCode?: string;
99
+ domesticInstantPaymentCreditorSupported?: boolean;
100
+ domesticInstantPaymentDebtorSupported?: boolean;
101
+ sepaInstantPaymentCreditorSupported?: boolean;
102
+ sepaInstantPaymentDebtorSupported?: boolean;
103
+ sepaPaymentSupported?: boolean;
104
+ foreignPaymentSupported?: boolean;
105
+ domesticPaymentSupported?: boolean;
106
+ accountInformationSupported?: boolean;
107
+ accountBalanceSupported?: boolean;
108
+ accountTransactionsSupported?: boolean;
109
+ batchPaymentSupported?: boolean;
110
+ recurringPaymentSupported?: boolean;
111
+ paymentPairingSupported?: boolean;
112
+ statusSettledSupported?: boolean;
113
+ enabledForMerchant?: boolean;
114
+ };
96
115
  type FinbricksForeignPaymentBody = {
97
116
  merchantIdentification: {
98
117
  merchantId: string;
@@ -156,179 +175,6 @@ type FinbricksForeignPaymentBody = {
156
175
  };
157
176
  };
158
177
 
159
- type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
160
-
161
- type FinbricksAuthTokenResponse = {
162
- clientId: string;
163
- provider: string;
164
- scope: 'AISP' | 'AISP_PISP';
165
- validFrom: string;
166
- validTo: string;
167
- stronglyAuthenticatedTo?: string;
168
- }[];
169
- type RedirectUrl = {
170
- redirectUrl: string;
171
- };
172
- type FinbricksIdentification = {
173
- accountNumber: string;
174
- iban: string;
175
- other: {
176
- type: string;
177
- value: string;
178
- };
179
- };
180
- type FinbricksServicer = {
181
- bankCode: BankCode;
182
- countryCode: CountryCode;
183
- bic: string;
184
- };
185
- type FinbricksAccount = {
186
- id: string;
187
- identification: FinbricksIdentification;
188
- currency: CurrencyCode;
189
- servicer: FinbricksServicer;
190
- accountName: string;
191
- productName: string;
192
- ownersNames: string[];
193
- relationship: {
194
- isOwner: boolean;
195
- };
196
- pispSuitable: boolean;
197
- };
198
- type FinbricksPaymentResponse = RedirectUrl;
199
- type FinbricksBatchResponse = RedirectUrl;
200
- type FinbricksConnectAccountResponse = RedirectUrl;
201
- type FinbricksAccountsListResponse = {
202
- accounts: FinbricksAccount[];
203
- };
204
- type FinbricksTransactionLink = {
205
- rel: string;
206
- value: string;
207
- };
208
- type FinbricksAmount = {
209
- value: number;
210
- currency: CurrencyCode;
211
- };
212
- type FinbricksAddress = {
213
- streetName: string;
214
- buildingNumber: string;
215
- postCode: string;
216
- townName: string;
217
- country: CountryCode;
218
- adressLine: string;
219
- };
220
- type FinbricksTransaction = {
221
- fbxReference: string;
222
- entryReference: string;
223
- amount: FinbricksAmount;
224
- creditDebitIndicator: 'CRDT' | 'DBIT';
225
- reversalIndicator: boolean;
226
- status: string;
227
- bookingDate: {
228
- date: Date;
229
- };
230
- valueDate: {
231
- date: Date;
232
- };
233
- bankTransactionCode: {
234
- proprietary: {
235
- code: string;
236
- issuer: string;
237
- };
238
- };
239
- entryDetails: {
240
- transactionDetails: {
241
- references: {
242
- messageIdentification: string;
243
- accountServicerReference: string;
244
- paymentInformationIdentification: string;
245
- instructionIdentification: string;
246
- endToEndIdentification: string;
247
- chequeNumber: string;
248
- clearingSystemReference: string;
249
- };
250
- amountDetails: {
251
- instructedAmount: {
252
- amount: FinbricksAmount;
253
- };
254
- transactionAmount: {
255
- amount: FinbricksAmount;
256
- };
257
- counterValueAmount: {
258
- amount: FinbricksAmount;
259
- currencyExchange: {
260
- sourceCurrency: CurrencyCode;
261
- targetCurrency: CurrencyCode;
262
- exchangeRate: number;
263
- };
264
- };
265
- proprietaryAmount: {
266
- type: string;
267
- amount: FinbricksAmount;
268
- };
269
- };
270
- charges: {
271
- bearer: string;
272
- value: number;
273
- currency: CurrencyCode;
274
- };
275
- relatedParties: {
276
- debtor?: {
277
- name: string;
278
- postalAddress: FinbricksAddress;
279
- identification: {
280
- organizationIdentification: {
281
- bicOrBei: string;
282
- };
283
- };
284
- };
285
- debtorAccount?: {
286
- name: string;
287
- identification: {
288
- iban: string;
289
- other: {
290
- identification: string;
291
- };
292
- };
293
- };
294
- creditor?: {
295
- name: string;
296
- postalAddress: FinbricksAddress;
297
- identification: {
298
- organizationIdentification: {
299
- bicOrBei: string;
300
- };
301
- };
302
- };
303
- creditorAccount?: {
304
- name: string;
305
- identification: {
306
- iban: string;
307
- other: {
308
- identification: string;
309
- };
310
- };
311
- };
312
- };
313
- remittanceInformation: {
314
- unstructured: string;
315
- structured: {
316
- creditorReferenceInformation: {
317
- reference: ReferenceType[];
318
- };
319
- };
320
- };
321
- additionalRemittanceInformation: string;
322
- additionalTransactionInformation: string;
323
- };
324
- };
325
- };
326
- type FinbricksAccountTransactionsResponse = {
327
- pageSize: number;
328
- links: FinbricksTransactionLink[];
329
- transactions: FinbricksTransaction[];
330
- };
331
-
332
178
  interface FinbricksFetchConfig {
333
179
  baseUrl: string;
334
180
  endpoint: string;
@@ -368,6 +214,7 @@ declare const FINBRICKS_ENDPOINTS: {
368
214
  readonly TRANSACTION_FOREIGN_INIT: "/transaction/platform/foreign/init";
369
215
  readonly TRANSACTION_BATCH_INIT: "/transaction/platform/batchPayment/init";
370
216
  readonly BATCH_STATUS: "/transaction/platform/batchPayment/status";
217
+ readonly BANK_INFO: "/status/bankInfo";
371
218
  };
372
219
  type FinbricksEndpoint = keyof typeof FINBRICKS_ENDPOINTS;
373
220
  type FinbricksEndpointPath = (typeof FINBRICKS_ENDPOINTS)[FinbricksEndpoint];
@@ -1496,6 +1343,8 @@ declare function toCompletedPayment(payment: PreparedPayment, status: 'COMPLETED
1496
1343
  * @returns Array of transformed payments
1497
1344
  */
1498
1345
  declare function batchTransform<TInput, TOutput>(payments: TInput[], transformer: (payment: TInput) => TOutput): TOutput[];
1346
+ declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string): PaymentRequestInsertType;
1347
+ declare function toBatchedPaymentFromPaymentRequest(sp: PaymentRequestSelectType): BatchedPayment;
1499
1348
 
1500
- export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BankCode, BatchMetadata, BatchStatus, BatchedPayment, CompletedPayment, ConnectedAccount, ConnectorKey, CountryCode, CredentialsResolver, CsobConnector, Currency, CurrencyCode, DbuConnector, ErsteConnector, FINBRICKS_ENDPOINTS, FinbricksClient, FinbricksConnector, IBankConnector, IncomingPayment, IncomingPayment as IncomingPaymentMessage, InitiatedBatch, InitiatedPayment, KBConnector, MockCobsConnector, MockConnector, ParsedBankPayment, PaymentSelectType, PaymentStatus, PaymentType, PreparedPayment, SendPaymentInput, assignAccount, batchTransform, ottInsertSchema, ottSelectSchema, ottUpdateSchema, signFinbricksJws, toBatchedPayment, toCompletedPayment, toIncomingPayment, toPreparedPayment, useFinbricksFetch };
1501
- export type { BankPaymentEvent, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksAccount, FinbricksAccountTransactionsResponse, FinbricksAccountsListResponse, FinbricksAuthTokenResponse, FinbricksBatchBody, FinbricksBatchResponse, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectAccountResponse, FinbricksConnectorConfig, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksPaymentResponse, FinbricksProvider, FinbricksRequestInit, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
1349
+ export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchStatus, BatchedPayment, CompletedPayment, ConnectedAccount, ConnectorKey, CredentialsResolver, CsobConnector, Currency, DbuConnector, ErsteConnector, FINBRICKS_ENDPOINTS, FinbricksAccount, FinbricksClient, FinbricksConnector, IBankConnector, IncomingPayment, IncomingPayment as IncomingPaymentMessage, InitiatedBatch, InitiatedPayment, KBConnector, MockCobsConnector, MockConnector, ParsedBankPayment, PaymentRequestInsertType, PaymentRequestSelectType, PaymentSelectType, PaymentStatus, PaymentType, PreparedPayment, SendPaymentInput, assignAccount, batchTransform, ottInsertSchema, ottSelectSchema, ottUpdateSchema, signFinbricksJws, toBatchedPayment, toBatchedPaymentFromPaymentRequest, toCompletedPayment, toIncomingPayment, toPaymentRequestInsert, toPreparedPayment, useFinbricksFetch };
1350
+ export type { BankPaymentEvent, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksBatchBody, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectorConfig, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksProvider, FinbricksRequestInit, FinbricksSupportedBanksQuery, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };