@develit-services/bank 0.0.13 → 0.0.15
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.
- package/dist/database/schema.d.cts +1 -1
- package/dist/database/schema.d.mts +1 -1
- package/dist/database/schema.d.ts +1 -1
- package/dist/export/worker.cjs +42 -24
- package/dist/export/worker.d.cts +5 -4
- package/dist/export/worker.d.mts +5 -4
- package/dist/export/worker.d.ts +5 -4
- package/dist/export/worker.mjs +43 -25
- package/dist/export/wrangler.d.cts +4 -3
- package/dist/export/wrangler.d.mts +4 -3
- package/dist/export/wrangler.d.ts +4 -3
- package/dist/shared/{bank.BYxCT5rk.d.ts → bank.BlmUZQ6s.d.cts} +20 -8
- package/dist/shared/{bank.DxGqqFhD.d.cts → bank.CJFy17-g.d.cts} +3 -1
- package/dist/shared/{bank.DxGqqFhD.d.mts → bank.CJFy17-g.d.mts} +3 -1
- package/dist/shared/{bank.DxGqqFhD.d.ts → bank.CJFy17-g.d.ts} +3 -1
- package/dist/shared/{bank.BU2_AKRG.cjs → bank.Ce58djRL.cjs} +500 -320
- package/dist/shared/{bank.TOYdvcg7.mjs → bank.DZS4d3MJ.mjs} +498 -322
- package/dist/shared/{bank.CBNQZ5Pd.d.cts → bank.DiMNzl60.d.cts} +8 -6
- package/dist/shared/{bank.CBNQZ5Pd.d.mts → bank.DiMNzl60.d.mts} +8 -6
- package/dist/shared/{bank.CBNQZ5Pd.d.ts → bank.DiMNzl60.d.ts} +8 -6
- package/dist/shared/{bank.BULPVep1.d.cts → bank.j2Z-uViN.d.ts} +20 -8
- package/dist/shared/{bank.Dxfp5h5B.d.mts → bank.tyFkXmr8.d.mts} +20 -8
- package/dist/{@types.cjs → types.cjs} +8 -3
- package/dist/{@types.d.cts → types.d.cts} +142 -22
- package/dist/{@types.d.mts → types.d.mts} +142 -22
- package/dist/{@types.d.ts → types.d.ts} +142 -22
- package/dist/types.mjs +11 -0
- package/package.json +4 -4
- package/dist/@types.mjs +0 -10
|
@@ -82,16 +82,18 @@ 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;
|
|
92
92
|
bankPaymentInitiatedAt: z.ZodCoercedDate<unknown>;
|
|
93
93
|
bankPaymentProcessedAt: z.ZodCoercedDate<unknown>;
|
|
94
94
|
bankingVs: z.ZodString;
|
|
95
|
+
bankingSs: z.ZodString;
|
|
96
|
+
bankingKs: z.ZodString;
|
|
95
97
|
message: z.ZodString;
|
|
96
98
|
creditorIban: z.ZodString;
|
|
97
99
|
creditorHolderName: z.ZodString;
|
|
@@ -163,7 +165,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
163
165
|
tableName: "batch";
|
|
164
166
|
dataType: "string";
|
|
165
167
|
columnType: "SQLiteText";
|
|
166
|
-
data: "
|
|
168
|
+
data: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
|
|
167
169
|
driverParam: string;
|
|
168
170
|
notNull: false;
|
|
169
171
|
hasDefault: false;
|
|
@@ -176,7 +178,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
176
178
|
generated: undefined;
|
|
177
179
|
}, {}, {
|
|
178
180
|
length: number | undefined;
|
|
179
|
-
$type: "
|
|
181
|
+
$type: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
|
|
180
182
|
}>;
|
|
181
183
|
payments: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
182
184
|
name: "payments";
|
|
@@ -414,7 +416,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
414
416
|
tableName: "payment";
|
|
415
417
|
dataType: "string";
|
|
416
418
|
columnType: "SQLiteText";
|
|
417
|
-
data: "PREPARED" | "
|
|
419
|
+
data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
418
420
|
driverParam: string;
|
|
419
421
|
notNull: true;
|
|
420
422
|
hasDefault: false;
|
|
@@ -427,7 +429,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
427
429
|
generated: undefined;
|
|
428
430
|
}, {}, {
|
|
429
431
|
length: number | undefined;
|
|
430
|
-
$type: "PREPARED" | "
|
|
432
|
+
$type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
431
433
|
}>;
|
|
432
434
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
433
435
|
name: "status_reason";
|
|
@@ -82,16 +82,18 @@ 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;
|
|
92
92
|
bankPaymentInitiatedAt: z.ZodCoercedDate<unknown>;
|
|
93
93
|
bankPaymentProcessedAt: z.ZodCoercedDate<unknown>;
|
|
94
94
|
bankingVs: z.ZodString;
|
|
95
|
+
bankingSs: z.ZodString;
|
|
96
|
+
bankingKs: z.ZodString;
|
|
95
97
|
message: z.ZodString;
|
|
96
98
|
creditorIban: z.ZodString;
|
|
97
99
|
creditorHolderName: z.ZodString;
|
|
@@ -163,7 +165,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
163
165
|
tableName: "batch";
|
|
164
166
|
dataType: "string";
|
|
165
167
|
columnType: "SQLiteText";
|
|
166
|
-
data: "
|
|
168
|
+
data: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
|
|
167
169
|
driverParam: string;
|
|
168
170
|
notNull: false;
|
|
169
171
|
hasDefault: false;
|
|
@@ -176,7 +178,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
176
178
|
generated: undefined;
|
|
177
179
|
}, {}, {
|
|
178
180
|
length: number | undefined;
|
|
179
|
-
$type: "
|
|
181
|
+
$type: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
|
|
180
182
|
}>;
|
|
181
183
|
payments: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
182
184
|
name: "payments";
|
|
@@ -414,7 +416,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
414
416
|
tableName: "payment";
|
|
415
417
|
dataType: "string";
|
|
416
418
|
columnType: "SQLiteText";
|
|
417
|
-
data: "PREPARED" | "
|
|
419
|
+
data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
418
420
|
driverParam: string;
|
|
419
421
|
notNull: true;
|
|
420
422
|
hasDefault: false;
|
|
@@ -427,7 +429,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
427
429
|
generated: undefined;
|
|
428
430
|
}, {}, {
|
|
429
431
|
length: number | undefined;
|
|
430
|
-
$type: "PREPARED" | "
|
|
432
|
+
$type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
431
433
|
}>;
|
|
432
434
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
433
435
|
name: "status_reason";
|
|
@@ -82,16 +82,18 @@ 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;
|
|
92
92
|
bankPaymentInitiatedAt: z.ZodCoercedDate<unknown>;
|
|
93
93
|
bankPaymentProcessedAt: z.ZodCoercedDate<unknown>;
|
|
94
94
|
bankingVs: z.ZodString;
|
|
95
|
+
bankingSs: z.ZodString;
|
|
96
|
+
bankingKs: z.ZodString;
|
|
95
97
|
message: z.ZodString;
|
|
96
98
|
creditorIban: z.ZodString;
|
|
97
99
|
creditorHolderName: z.ZodString;
|
|
@@ -163,7 +165,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
163
165
|
tableName: "batch";
|
|
164
166
|
dataType: "string";
|
|
165
167
|
columnType: "SQLiteText";
|
|
166
|
-
data: "
|
|
168
|
+
data: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
|
|
167
169
|
driverParam: string;
|
|
168
170
|
notNull: false;
|
|
169
171
|
hasDefault: false;
|
|
@@ -176,7 +178,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
176
178
|
generated: undefined;
|
|
177
179
|
}, {}, {
|
|
178
180
|
length: number | undefined;
|
|
179
|
-
$type: "
|
|
181
|
+
$type: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "WAITING_FOR_PROCESSING" | "PROCESSING" | "READY_TO_SIGN";
|
|
180
182
|
}>;
|
|
181
183
|
payments: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
182
184
|
name: "payments";
|
|
@@ -414,7 +416,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
414
416
|
tableName: "payment";
|
|
415
417
|
dataType: "string";
|
|
416
418
|
columnType: "SQLiteText";
|
|
417
|
-
data: "PREPARED" | "
|
|
419
|
+
data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
418
420
|
driverParam: string;
|
|
419
421
|
notNull: true;
|
|
420
422
|
hasDefault: false;
|
|
@@ -427,7 +429,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
427
429
|
generated: undefined;
|
|
428
430
|
}, {}, {
|
|
429
431
|
length: number | undefined;
|
|
430
|
-
$type: "PREPARED" | "
|
|
432
|
+
$type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
431
433
|
}>;
|
|
432
434
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
433
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.
|
|
3
|
+
import { a as PaymentInsertType, t as tables } from './bank.DiMNzl60.js';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
5
|
|
|
6
6
|
declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "IFSC", "DOMESTIC"];
|
|
@@ -25,14 +25,10 @@ type BankCode = (typeof BANK_CODES)[number];
|
|
|
25
25
|
declare const COUNTRY_CODES: ["AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW", ...("AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW")[]];
|
|
26
26
|
type CountryCode = (typeof COUNTRY_CODES)[number];
|
|
27
27
|
|
|
28
|
-
interface SyncLog {
|
|
29
|
-
lastSyncedAt: Date;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
28
|
interface BankAccountWithLastSync extends ConfigBankAccount {
|
|
33
29
|
lastSyncAt: SyncLog;
|
|
34
30
|
}
|
|
35
|
-
type ConnectorKey = 'ERSTE' | 'FINBRICKS' | 'MOCK' | 'CREDITAS' | 'MOCK_COBS' | 'FIO';
|
|
31
|
+
type ConnectorKey = 'ERSTE' | 'FINBRICKS' | 'MOCK' | 'CREDITAS' | 'MOCK_COBS' | 'FIO' | 'MONETA';
|
|
36
32
|
interface ConfigBankAccount {
|
|
37
33
|
connectorKey: ConnectorKey;
|
|
38
34
|
id: string;
|
|
@@ -51,6 +47,10 @@ interface ConfigEnvironmentBankAccount {
|
|
|
51
47
|
productionAccounts: ConfigBankAccount[];
|
|
52
48
|
}
|
|
53
49
|
|
|
50
|
+
interface SyncLog {
|
|
51
|
+
lastSyncedAt: Date;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
54
|
type WithStatus<T extends {
|
|
55
55
|
status: PaymentStatus;
|
|
56
56
|
}, S extends PaymentStatus> = Omit<T, 'status'> & {
|
|
@@ -77,9 +77,15 @@ type AuthInput = {
|
|
|
77
77
|
token: string;
|
|
78
78
|
refreshToken?: string;
|
|
79
79
|
};
|
|
80
|
+
type AccountConnection = {
|
|
81
|
+
clientId: string;
|
|
82
|
+
redirectUrl: string;
|
|
83
|
+
};
|
|
80
84
|
declare abstract class IBankConnector {
|
|
81
85
|
abstract connectorKey: ConnectorKey;
|
|
82
86
|
abstract authenticate(code: AuthInput): Promise<string>;
|
|
87
|
+
abstract connectUserAccount(): Promise<AccountConnection>;
|
|
88
|
+
abstract listAccounts(): Promise<[]>;
|
|
83
89
|
abstract preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
|
|
84
90
|
abstract initiateBatchFromPayments({ payments, }: {
|
|
85
91
|
payments: PaymentPreparedInsertType[];
|
|
@@ -91,6 +97,12 @@ declare abstract class IBankConnector {
|
|
|
91
97
|
db: DrizzleD1Database<typeof tables>;
|
|
92
98
|
env: Environment;
|
|
93
99
|
}): Promise<PaymentInsertType[]>;
|
|
100
|
+
abstract getPaymentStatus({ paymentId, }: {
|
|
101
|
+
paymentId: string;
|
|
102
|
+
}): Promise<PaymentStatus>;
|
|
103
|
+
abstract getBatchStatus({ batchId, }: {
|
|
104
|
+
batchId: string;
|
|
105
|
+
}): Promise<BatchStatus>;
|
|
94
106
|
}
|
|
95
107
|
|
|
96
108
|
interface IncomingPaymentMessage extends PaymentInsertType {
|
|
@@ -98,5 +110,5 @@ interface IncomingPaymentMessage extends PaymentInsertType {
|
|
|
98
110
|
interface OutgoingPaymentMessage extends PaymentInsertType {
|
|
99
111
|
}
|
|
100
112
|
|
|
101
|
-
export { IBankConnector as I, BATCH_STATUSES as
|
|
102
|
-
export type {
|
|
113
|
+
export { IBankConnector as I, BATCH_STATUSES as o, PAYMENT_TYPES as q, PAYMENT_STATUSES as s, PAYMENT_DIRECTIONS as t, COUNTRY_CODES as v };
|
|
114
|
+
export type { AccountConnection as A, BankAccountWithLastSync as B, ConfigEnvironmentBankAccount as C, OutgoingPaymentMessage as O, PaymentPreparedInsertType as P, SyncLog as S, ConfigBankAccount as a, ConnectorKey as b, CurrencyCode as c, BankCode as d, CountryCode as e, AuthInput as f, IncomingPaymentMessage as g, InitiatedBatch as h, InitiatedPayment as i, PaymentStatus as j, BatchStatus as k, BatchMetadata as l, Currency as m, PaymentFailedInsertType as n, paymentInitializedInsertType as p, PaymentType as r, PaymentDirection as u };
|
|
@@ -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.
|
|
3
|
+
import { a as PaymentInsertType, t as tables } from './bank.DiMNzl60.mjs';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
5
|
|
|
6
6
|
declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "IFSC", "DOMESTIC"];
|
|
@@ -25,14 +25,10 @@ type BankCode = (typeof BANK_CODES)[number];
|
|
|
25
25
|
declare const COUNTRY_CODES: ["AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW", ...("AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BG" | "BF" | "BI" | "KH" | "CM" | "CA" | "CV" | "CF" | "TD" | "CL" | "CN" | "CO" | "KM" | "CK" | "CR" | "HR" | "CW" | "CY" | "CZ" | "CD" | "DK" | "DJ" | "DM" | "DO" | "TL" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GR" | "GD" | "GP" | "GU" | "GT" | "GN" | "GW" | "GY" | "HT" | "HN" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "XK" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LI" | "LT" | "LU" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MQ" | "MR" | "MU" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "NA" | "NP" | "NL" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "NO" | "OM" | "PK" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PL" | "PT" | "PR" | "QA" | "CG" | "RE" | "RO" | "RU" | "RW" | "BL" | "KN" | "LC" | "MF" | "VC" | "WS" | "SM" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SO" | "ZA" | "KR" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "TW" | "TJ" | "TZ" | "TH" | "TG" | "TO" | "TT" | "TN" | "TR" | "TM" | "UM" | "VI" | "UG" | "UA" | "AE" | "GB" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW")[]];
|
|
26
26
|
type CountryCode = (typeof COUNTRY_CODES)[number];
|
|
27
27
|
|
|
28
|
-
interface SyncLog {
|
|
29
|
-
lastSyncedAt: Date;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
28
|
interface BankAccountWithLastSync extends ConfigBankAccount {
|
|
33
29
|
lastSyncAt: SyncLog;
|
|
34
30
|
}
|
|
35
|
-
type ConnectorKey = 'ERSTE' | 'FINBRICKS' | 'MOCK' | 'CREDITAS' | 'MOCK_COBS' | 'FIO';
|
|
31
|
+
type ConnectorKey = 'ERSTE' | 'FINBRICKS' | 'MOCK' | 'CREDITAS' | 'MOCK_COBS' | 'FIO' | 'MONETA';
|
|
36
32
|
interface ConfigBankAccount {
|
|
37
33
|
connectorKey: ConnectorKey;
|
|
38
34
|
id: string;
|
|
@@ -51,6 +47,10 @@ interface ConfigEnvironmentBankAccount {
|
|
|
51
47
|
productionAccounts: ConfigBankAccount[];
|
|
52
48
|
}
|
|
53
49
|
|
|
50
|
+
interface SyncLog {
|
|
51
|
+
lastSyncedAt: Date;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
54
|
type WithStatus<T extends {
|
|
55
55
|
status: PaymentStatus;
|
|
56
56
|
}, S extends PaymentStatus> = Omit<T, 'status'> & {
|
|
@@ -77,9 +77,15 @@ type AuthInput = {
|
|
|
77
77
|
token: string;
|
|
78
78
|
refreshToken?: string;
|
|
79
79
|
};
|
|
80
|
+
type AccountConnection = {
|
|
81
|
+
clientId: string;
|
|
82
|
+
redirectUrl: string;
|
|
83
|
+
};
|
|
80
84
|
declare abstract class IBankConnector {
|
|
81
85
|
abstract connectorKey: ConnectorKey;
|
|
82
86
|
abstract authenticate(code: AuthInput): Promise<string>;
|
|
87
|
+
abstract connectUserAccount(): Promise<AccountConnection>;
|
|
88
|
+
abstract listAccounts(): Promise<[]>;
|
|
83
89
|
abstract preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
|
|
84
90
|
abstract initiateBatchFromPayments({ payments, }: {
|
|
85
91
|
payments: PaymentPreparedInsertType[];
|
|
@@ -91,6 +97,12 @@ declare abstract class IBankConnector {
|
|
|
91
97
|
db: DrizzleD1Database<typeof tables>;
|
|
92
98
|
env: Environment;
|
|
93
99
|
}): Promise<PaymentInsertType[]>;
|
|
100
|
+
abstract getPaymentStatus({ paymentId, }: {
|
|
101
|
+
paymentId: string;
|
|
102
|
+
}): Promise<PaymentStatus>;
|
|
103
|
+
abstract getBatchStatus({ batchId, }: {
|
|
104
|
+
batchId: string;
|
|
105
|
+
}): Promise<BatchStatus>;
|
|
94
106
|
}
|
|
95
107
|
|
|
96
108
|
interface IncomingPaymentMessage extends PaymentInsertType {
|
|
@@ -98,5 +110,5 @@ interface IncomingPaymentMessage extends PaymentInsertType {
|
|
|
98
110
|
interface OutgoingPaymentMessage extends PaymentInsertType {
|
|
99
111
|
}
|
|
100
112
|
|
|
101
|
-
export { IBankConnector as I, BATCH_STATUSES as
|
|
102
|
-
export type {
|
|
113
|
+
export { IBankConnector as I, BATCH_STATUSES as o, PAYMENT_TYPES as q, PAYMENT_STATUSES as s, PAYMENT_DIRECTIONS as t, COUNTRY_CODES as v };
|
|
114
|
+
export type { AccountConnection as A, BankAccountWithLastSync as B, ConfigEnvironmentBankAccount as C, OutgoingPaymentMessage as O, PaymentPreparedInsertType as P, SyncLog as S, ConfigBankAccount as a, ConnectorKey as b, CurrencyCode as c, BankCode as d, CountryCode as e, AuthInput as f, IncomingPaymentMessage as g, InitiatedBatch as h, InitiatedPayment as i, PaymentStatus as j, BatchStatus as k, BatchMetadata as l, Currency as m, PaymentFailedInsertType as n, paymentInitializedInsertType as p, PaymentType as r, PaymentDirection as u };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const db = require('./shared/bank.
|
|
3
|
+
const db = require('./shared/bank.Ce58djRL.cjs');
|
|
4
4
|
const generalCodes = require('@develit-io/general-codes');
|
|
5
5
|
require('@develit-io/backend-sdk');
|
|
6
6
|
require('./shared/bank.CrAQe4PH.cjs');
|
|
7
7
|
require('drizzle-orm/sqlite-core');
|
|
8
8
|
require('drizzle-orm/relations');
|
|
9
9
|
require('drizzle-orm');
|
|
10
|
-
require('date-fns');
|
|
11
|
-
require('jose');
|
|
12
10
|
require('zod');
|
|
11
|
+
require('jose');
|
|
12
|
+
require('superjson');
|
|
13
|
+
require('date-fns');
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
|
|
@@ -17,6 +18,8 @@ exports.BATCH_STATUES = db.BATCH_STATUSES;
|
|
|
17
18
|
exports.BATCH_STATUSES = db.BATCH_STATUSES;
|
|
18
19
|
exports.COUNTRY_CODES = db.COUNTRY_CODES;
|
|
19
20
|
exports.ErsteConnector = db.ErsteConnector;
|
|
21
|
+
exports.FINBRICKS_ENDPOINTS = db.FINBRICKS_ENDPOINTS;
|
|
22
|
+
exports.FinbricksClient = db.FinbricksClient;
|
|
20
23
|
exports.FinbricksConnector = db.FinbricksConnector;
|
|
21
24
|
exports.IBankConnector = db.IBankConnector;
|
|
22
25
|
exports.MockCobsConnector = db.MockCobsConnector;
|
|
@@ -25,5 +28,7 @@ exports.PAYMENT_DIRECTIONS = db.PAYMENT_DIRECTIONS;
|
|
|
25
28
|
exports.PAYMENT_STATUSES = db.PAYMENT_STATUSES;
|
|
26
29
|
exports.PAYMENT_TYPES = db.PAYMENT_TYPES;
|
|
27
30
|
exports.paymentInsertTypeZod = db.paymentInsertTypeZod;
|
|
31
|
+
exports.signFinbricksJws = db.signFinbricksJws;
|
|
32
|
+
exports.useFinbricksFetch = db.useFinbricksFetch;
|
|
28
33
|
exports.BANK_CODES = generalCodes.BANK_CODES;
|
|
29
34
|
exports.CURRENCY_CODES = generalCodes.CURRENCY_CODES;
|
|
@@ -1,16 +1,44 @@
|
|
|
1
|
-
import { c as CurrencyCode, d as BankCode, e as CountryCode, I as IBankConnector, b as ConnectorKey, A as
|
|
2
|
-
export {
|
|
3
|
-
import { t as tables, a as PaymentInsertType } from './shared/bank.
|
|
4
|
-
export { b as BatchInsertType, B as BatchSelectType,
|
|
5
|
-
import { Environment } from '@develit-io/backend-sdk';
|
|
1
|
+
import { c as CurrencyCode, d as BankCode, e as CountryCode, I as IBankConnector, b as ConnectorKey, A as AccountConnection, f as AuthInput, g as IncomingPaymentMessage, P as PaymentPreparedInsertType, h as InitiatedBatch, i as InitiatedPayment, a as ConfigBankAccount, S as SyncLog, j as PaymentStatus, k as BatchStatus, l as BatchMetadata, m as Currency } from './shared/bank.BlmUZQ6s.cjs';
|
|
2
|
+
export { o as BATCH_STATUES, o as BATCH_STATUSES, B as BankAccountWithLastSync, v as COUNTRY_CODES, C as ConfigEnvironmentBankAccount, O as OutgoingPaymentMessage, t as PAYMENT_DIRECTIONS, s as PAYMENT_STATUSES, q as PAYMENT_TYPES, u as PaymentDirection, n as PaymentFailedInsertType, r as PaymentType, p as paymentInitializedInsertType } from './shared/bank.BlmUZQ6s.cjs';
|
|
3
|
+
import { t as tables, a as PaymentInsertType, P as PaymentSelectType } from './shared/bank.DiMNzl60.cjs';
|
|
4
|
+
export { b as BatchInsertType, B as BatchSelectType, p as paymentInsertTypeZod } from './shared/bank.DiMNzl60.cjs';
|
|
5
|
+
import { Environment, BaseEvent } from '@develit-io/backend-sdk';
|
|
6
6
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
7
|
-
export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.
|
|
7
|
+
export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.CJFy17-g.cjs';
|
|
8
8
|
export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
9
9
|
import 'drizzle-orm/sqlite-core';
|
|
10
10
|
import 'drizzle-orm';
|
|
11
11
|
import 'zod';
|
|
12
12
|
|
|
13
|
-
type FinbricksProvider = 'KB' | 'ERSTE' | 'CSOB' | 'MOCK_COBS' | 'CREDITAS' | 'FIO';
|
|
13
|
+
type FinbricksProvider = 'KB' | 'ERSTE' | 'CSOB' | 'MOCK_COBS' | 'CREDITAS' | 'FIO' | 'MONETA';
|
|
14
|
+
declare const FINBRICKS_TRANSACTION_STATUSES: readonly ["OPENED", "AUTHORIZED", "COMPLETED", "BOOKED", "SETTLED", "REJECTED", "CLOSED"];
|
|
15
|
+
type FinbricksTransactionStatus = (typeof FINBRICKS_TRANSACTION_STATUSES)[number];
|
|
16
|
+
type FinbricksGetTransactionStatusResponse = {
|
|
17
|
+
merchantTransactionId: string;
|
|
18
|
+
resultCode: FinbricksTransactionStatus;
|
|
19
|
+
instructionPriority?: 'NORM' | 'INST';
|
|
20
|
+
finalBankStatus?: boolean;
|
|
21
|
+
transactionRecoveryUrl?: string;
|
|
22
|
+
foundSettledData?: {
|
|
23
|
+
debtor: {
|
|
24
|
+
name: string;
|
|
25
|
+
accountIdentificationType: string;
|
|
26
|
+
accountIdentificationValue: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
declare const FINBRICKS_BATCH_STATUSES: readonly ["OPENED", "AUTHORIZED", "REJECTED"];
|
|
31
|
+
type FinbricksBatchStatus = (typeof FINBRICKS_BATCH_STATUSES)[number];
|
|
32
|
+
type FinbricksGetBatchStatusResponse = {
|
|
33
|
+
merchantBatchId: string;
|
|
34
|
+
batchResultCode: FinbricksBatchStatus;
|
|
35
|
+
payments: {
|
|
36
|
+
merchantTransactionId: string;
|
|
37
|
+
resultCode: FinbricksTransactionStatus;
|
|
38
|
+
finalbankStatus: boolean;
|
|
39
|
+
};
|
|
40
|
+
batchRecoveryUrl: string;
|
|
41
|
+
};
|
|
14
42
|
type FinbricksPaymentBody = {
|
|
15
43
|
merchantId: string;
|
|
16
44
|
merchantTransactionId: string;
|
|
@@ -29,6 +57,14 @@ type FinbricksPaymentBody = {
|
|
|
29
57
|
initiatorName?: string;
|
|
30
58
|
paymentProvider: FinbricksProvider;
|
|
31
59
|
};
|
|
60
|
+
type FinbricksConnectAccountBody = {
|
|
61
|
+
merchantId: string;
|
|
62
|
+
clientId: string;
|
|
63
|
+
paymentProvider: FinbricksProvider;
|
|
64
|
+
callbackUrl?: string;
|
|
65
|
+
scope?: 'AISP_PISP' | 'AISP';
|
|
66
|
+
psuId?: string;
|
|
67
|
+
};
|
|
32
68
|
type FinbricksBatchBody = {
|
|
33
69
|
batchPaymentIdentification: {
|
|
34
70
|
merchantId: string;
|
|
@@ -51,9 +87,23 @@ type FinbricksBatchBody = {
|
|
|
51
87
|
initiatorName?: string;
|
|
52
88
|
}[];
|
|
53
89
|
};
|
|
90
|
+
type FinbricksGetBatchStatusBody = {
|
|
91
|
+
merchantId: string;
|
|
92
|
+
merchantBatchId: string;
|
|
93
|
+
merchantTransactionId?: string;
|
|
94
|
+
finalBankStatus?: boolean;
|
|
95
|
+
};
|
|
54
96
|
|
|
55
97
|
type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
|
|
56
98
|
|
|
99
|
+
type FinbricksAuthTokenResponse = {
|
|
100
|
+
clientId: string;
|
|
101
|
+
provider: string;
|
|
102
|
+
scope: 'AISP' | 'AISP_PISP';
|
|
103
|
+
validFrom: string;
|
|
104
|
+
validTo: string;
|
|
105
|
+
stronglyAuthenticatedTo?: string;
|
|
106
|
+
}[];
|
|
57
107
|
type RedirectUrl = {
|
|
58
108
|
redirectUrl: string;
|
|
59
109
|
};
|
|
@@ -85,6 +135,7 @@ type FinbricksAccount = {
|
|
|
85
135
|
};
|
|
86
136
|
type FinbricksPaymentResponse = RedirectUrl;
|
|
87
137
|
type FinbricksBatchResponse = RedirectUrl;
|
|
138
|
+
type FinbricksConnectAccountResponse = RedirectUrl;
|
|
88
139
|
type FinbricksAccountsListResponse = {
|
|
89
140
|
accounts: FinbricksAccount[];
|
|
90
141
|
};
|
|
@@ -213,10 +264,55 @@ type FinbricksAccountTransactionsResponse = {
|
|
|
213
264
|
transactions: FinbricksTransaction[];
|
|
214
265
|
};
|
|
215
266
|
|
|
216
|
-
|
|
267
|
+
interface FinbricksFetchConfig {
|
|
268
|
+
baseUrl: string;
|
|
269
|
+
endpoint: string;
|
|
270
|
+
merchantId: string;
|
|
271
|
+
privateKeyPem: string;
|
|
272
|
+
method?: 'GET' | 'PUT' | 'POST' | 'DELETE';
|
|
273
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
274
|
+
body?: unknown;
|
|
275
|
+
correlationId?: string;
|
|
276
|
+
psuIp?: string;
|
|
277
|
+
psuAgent?: string;
|
|
278
|
+
}
|
|
279
|
+
interface FinbricksRequestInit {
|
|
280
|
+
headers?: Record<string, string>;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
declare const useFinbricksFetch: <TResponse>(config: FinbricksFetchConfig, init?: FinbricksRequestInit) => Promise<TResponse>;
|
|
284
|
+
declare class FinbricksClient {
|
|
285
|
+
readonly BASE_URL: string;
|
|
286
|
+
readonly MERCHANT_ID: string;
|
|
287
|
+
private readonly PRIVATE_KEY_PEM;
|
|
288
|
+
constructor(baseUrl: string, merchantId: string, privateKeyPem: string);
|
|
289
|
+
request<T>(params: Omit<FinbricksFetchConfig, 'baseUrl' | 'merchantId' | 'privateKeyPem'>): Promise<T>;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
declare const FINBRICKS_ENDPOINTS: {
|
|
293
|
+
readonly AUTHENTICATE_V2: "/v2/auth/authenticate";
|
|
294
|
+
readonly AUTH_TOKEN_STATUS: "/auth/token";
|
|
295
|
+
readonly AUTH_TOKEN_REVOKE: "/auth/revoke";
|
|
296
|
+
readonly ACCOUNT_LIST: "/account/list";
|
|
297
|
+
readonly ACCOUNT_BALANCE: "/account/balance";
|
|
298
|
+
readonly ACCOUNT_TRANSACTIONS: "/account/transactions";
|
|
299
|
+
readonly TRANSACTION_INIT: "/transaction/platform/init";
|
|
300
|
+
readonly TRANSACTION_STATUS: "/transaction/platform/status";
|
|
301
|
+
readonly TRANSACTION_BATCH_INIT: "/transaction/platform/batchPayment/init";
|
|
302
|
+
readonly BATCH_STATUS: "/transaction/platform/batchPayment/status";
|
|
303
|
+
};
|
|
304
|
+
type FinbricksEndpoint = keyof typeof FINBRICKS_ENDPOINTS;
|
|
305
|
+
type FinbricksEndpointPath = (typeof FINBRICKS_ENDPOINTS)[FinbricksEndpoint];
|
|
306
|
+
|
|
307
|
+
interface FinbricksJWSData {
|
|
217
308
|
uri: string;
|
|
218
309
|
body: string;
|
|
219
|
-
}
|
|
310
|
+
}
|
|
311
|
+
declare function signFinbricksJws({ privateKeyPem, merchantId, jwsData, }: {
|
|
312
|
+
privateKeyPem: string;
|
|
313
|
+
merchantId: string;
|
|
314
|
+
jwsData: FinbricksJWSData;
|
|
315
|
+
}): Promise<string>;
|
|
220
316
|
|
|
221
317
|
interface FinbricksConnectorConfig {
|
|
222
318
|
MERCHANT_ID: string;
|
|
@@ -225,19 +321,16 @@ interface FinbricksConnectorConfig {
|
|
|
225
321
|
}
|
|
226
322
|
declare abstract class FinbricksConnector extends IBankConnector {
|
|
227
323
|
connectorKey: ConnectorKey;
|
|
228
|
-
readonly
|
|
229
|
-
readonly
|
|
230
|
-
|
|
231
|
-
private readonly PROVIDER;
|
|
324
|
+
protected readonly finbricks: FinbricksClient;
|
|
325
|
+
protected readonly PROVIDER: FinbricksProvider;
|
|
326
|
+
protected lastValidClientId: string;
|
|
232
327
|
static readonly FETCH_INTERVAL: number;
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
jwsData: FinbricksJWSData;
|
|
238
|
-
}): Promise<string>;
|
|
239
|
-
authenticate({ token }: AuthInput): Promise<string>;
|
|
328
|
+
constructor(provider: FinbricksProvider, { BASE_URI, MERCHANT_ID, PRIVATE_KEY_PEM }: FinbricksConnectorConfig);
|
|
329
|
+
connectUserAccount(): Promise<AccountConnection>;
|
|
330
|
+
authenticate({ token: clientId }: AuthInput): Promise<string>;
|
|
331
|
+
revokeAuthentication(clientId: string): Promise<void>;
|
|
240
332
|
isClientIdExpired(clientId: string): Promise<boolean>;
|
|
333
|
+
listAccounts(): Promise<[]>;
|
|
241
334
|
preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
|
|
242
335
|
initiateBatchFromPayments({ payments, }: {
|
|
243
336
|
payments: PaymentPreparedInsertType[];
|
|
@@ -249,6 +342,12 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
249
342
|
db: DrizzleD1Database<typeof tables>;
|
|
250
343
|
env: Environment;
|
|
251
344
|
}): Promise<PaymentInsertType[]>;
|
|
345
|
+
getPaymentStatus({ paymentId, }: {
|
|
346
|
+
paymentId: string;
|
|
347
|
+
}): Promise<PaymentStatus>;
|
|
348
|
+
getBatchStatus({ batchId }: {
|
|
349
|
+
batchId: string;
|
|
350
|
+
}): Promise<BatchStatus>;
|
|
252
351
|
}
|
|
253
352
|
|
|
254
353
|
interface ErsteConnectorConfig {
|
|
@@ -261,6 +360,7 @@ interface ErsteConnectorConfig {
|
|
|
261
360
|
ACCOUNTS_URI: string;
|
|
262
361
|
}
|
|
263
362
|
declare class ErsteConnector extends IBankConnector {
|
|
363
|
+
connectUserAccount(): Promise<AccountConnection>;
|
|
264
364
|
static readonly FETCH_INTERVAL: number;
|
|
265
365
|
private readonly API_KEY;
|
|
266
366
|
private readonly CLIENT_ID;
|
|
@@ -274,6 +374,7 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
274
374
|
constructor(config: ErsteConnectorConfig);
|
|
275
375
|
get adminCodeCreationURI(): string;
|
|
276
376
|
authenticate({ token, refreshToken }: AuthInput): Promise<string>;
|
|
377
|
+
listAccounts(): Promise<[]>;
|
|
277
378
|
preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
|
|
278
379
|
initiateBatchFromPayments({ payments, }: {
|
|
279
380
|
payments: PaymentPreparedInsertType[];
|
|
@@ -288,12 +389,20 @@ declare class ErsteConnector extends IBankConnector {
|
|
|
288
389
|
account: ConfigBankAccount;
|
|
289
390
|
lastSync: SyncLog;
|
|
290
391
|
}): Promise<PaymentInsertType[]>;
|
|
392
|
+
getPaymentStatus(_: {
|
|
393
|
+
paymentId: string;
|
|
394
|
+
}): Promise<PaymentStatus>;
|
|
395
|
+
getBatchStatus(_: {
|
|
396
|
+
batchId: string;
|
|
397
|
+
}): Promise<BatchStatus>;
|
|
291
398
|
}
|
|
292
399
|
|
|
293
400
|
declare class MockConnector extends IBankConnector {
|
|
294
401
|
connectorKey: ConnectorKey;
|
|
295
402
|
static readonly FETCH_INTERVAL: number;
|
|
296
403
|
authenticate(): Promise<string>;
|
|
404
|
+
listAccounts(): Promise<[]>;
|
|
405
|
+
connectUserAccount(): Promise<AccountConnection>;
|
|
297
406
|
preparePayment(payment: IncomingPaymentMessage): Promise<PaymentPreparedInsertType>;
|
|
298
407
|
initiateSinglePayment(payment: PaymentPreparedInsertType): Promise<InitiatedPayment>;
|
|
299
408
|
initiateBatchFromPayments({ payments, }: {
|
|
@@ -302,6 +411,12 @@ declare class MockConnector extends IBankConnector {
|
|
|
302
411
|
getAllAccountPayments({ db, }: {
|
|
303
412
|
db: DrizzleD1Database<typeof tables>;
|
|
304
413
|
}): Promise<PaymentInsertType[]>;
|
|
414
|
+
getPaymentStatus(_: {
|
|
415
|
+
paymentId: string;
|
|
416
|
+
}): Promise<PaymentStatus>;
|
|
417
|
+
getBatchStatus(_: {
|
|
418
|
+
batchId: string;
|
|
419
|
+
}): Promise<BatchStatus>;
|
|
305
420
|
}
|
|
306
421
|
|
|
307
422
|
declare class MockCobsConnector extends FinbricksConnector {
|
|
@@ -441,5 +556,10 @@ interface ErsteObtainAuthorizationURLResponse {
|
|
|
441
556
|
};
|
|
442
557
|
}
|
|
443
558
|
|
|
444
|
-
|
|
445
|
-
|
|
559
|
+
type BankPaymentEvent = BaseEvent & {
|
|
560
|
+
eventType: 'BANK_PAYMENT';
|
|
561
|
+
bankPayment: Partial<PaymentSelectType>;
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
export { AccountConnection, AuthInput, BankCode, BatchMetadata, BatchStatus, ConfigBankAccount, ConnectorKey, CountryCode, Currency, CurrencyCode, ErsteConnector, FINBRICKS_ENDPOINTS, FinbricksClient, FinbricksConnector, IBankConnector, IncomingPaymentMessage, InitiatedBatch, InitiatedPayment, MockCobsConnector, MockConnector, PaymentInsertType, PaymentPreparedInsertType, PaymentSelectType, PaymentStatus, signFinbricksJws, useFinbricksFetch };
|
|
565
|
+
export type { BankPaymentEvent, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksAccountTransactionsResponse, FinbricksAccountsListResponse, FinbricksAuthTokenResponse, FinbricksBatchBody, FinbricksBatchResponse, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectAccountResponse, FinbricksConnectorConfig, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksPaymentResponse, FinbricksProvider, FinbricksRequestInit, FinbricksTransactionStatus };
|