@develit-services/bank 0.3.47 → 0.3.48
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 +54 -17
- package/dist/export/worker.d.cts +30 -15
- package/dist/export/worker.d.mts +30 -15
- package/dist/export/worker.d.ts +30 -15
- package/dist/export/worker.mjs +56 -19
- package/dist/shared/{bank.CF4oNDZH.d.cts → bank.CG0gMBFx.d.cts} +4 -4
- package/dist/shared/{bank.CF4oNDZH.d.mts → bank.CG0gMBFx.d.mts} +4 -4
- package/dist/shared/{bank.CF4oNDZH.d.ts → bank.CG0gMBFx.d.ts} +4 -4
- package/dist/types.d.cts +2 -2
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a9 as account, aa as accountCredentials, a5 as batch, a8 as ott, a6 as payment, a7 as paymentRelations } from '../shared/bank.
|
|
1
|
+
export { a9 as account, aa as accountCredentials, a5 as batch, a8 as ott, a6 as payment, a7 as paymentRelations } from '../shared/bank.CG0gMBFx.cjs';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'drizzle-zod';
|
|
4
4
|
import 'drizzle-orm/sqlite-core';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a9 as account, aa as accountCredentials, a5 as batch, a8 as ott, a6 as payment, a7 as paymentRelations } from '../shared/bank.
|
|
1
|
+
export { a9 as account, aa as accountCredentials, a5 as batch, a8 as ott, a6 as payment, a7 as paymentRelations } from '../shared/bank.CG0gMBFx.mjs';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'drizzle-zod';
|
|
4
4
|
import 'drizzle-orm/sqlite-core';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a9 as account, aa as accountCredentials, a5 as batch, a8 as ott, a6 as payment, a7 as paymentRelations } from '../shared/bank.
|
|
1
|
+
export { a9 as account, aa as accountCredentials, a5 as batch, a8 as ott, a6 as payment, a7 as paymentRelations } from '../shared/bank.CG0gMBFx.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'drizzle-zod';
|
|
4
4
|
import 'drizzle-orm/sqlite-core';
|
package/dist/export/worker.cjs
CHANGED
|
@@ -93,6 +93,27 @@ const deletePaymentsByAccountCommand = (db, { accountId }) => {
|
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
+
const getAccountBatchCountsQuery = async (db, { accountId }) => {
|
|
97
|
+
const result = await db.select({
|
|
98
|
+
totalCount: drizzleOrm.sql`COUNT(*)`.as("totalCount"),
|
|
99
|
+
openCount: drizzleOrm.sql`SUM(CASE WHEN ${drizzle.tables.batch.status} = 'OPEN' THEN 1 ELSE 0 END)`.as(
|
|
100
|
+
"openCount"
|
|
101
|
+
),
|
|
102
|
+
readyToSignCount: drizzleOrm.sql`SUM(CASE WHEN ${drizzle.tables.batch.status} = 'READY_TO_SIGN' THEN 1 ELSE 0 END)`.as(
|
|
103
|
+
"readyToSignCount"
|
|
104
|
+
),
|
|
105
|
+
failedCount: drizzleOrm.sql`SUM(CASE WHEN ${drizzle.tables.batch.status} = 'FAILED' THEN 1 ELSE 0 END)`.as(
|
|
106
|
+
"failedCount"
|
|
107
|
+
)
|
|
108
|
+
}).from(drizzle.tables.batch).where(drizzleOrm.eq(drizzle.tables.batch.accountId, accountId)).then(backendSdk.first);
|
|
109
|
+
return result || {
|
|
110
|
+
totalCount: 0,
|
|
111
|
+
openCount: 0,
|
|
112
|
+
readyToSignCount: 0,
|
|
113
|
+
failedCount: 0
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
|
|
96
117
|
const getAccountByIbanQuery = async (db, { iban }) => {
|
|
97
118
|
return await db.select().from(drizzle.tables.account).where(drizzleOrm.eq(drizzle.tables.account.iban, iban)).get();
|
|
98
119
|
};
|
|
@@ -385,6 +406,13 @@ const updateAccountInputSchema = zod.z.object({
|
|
|
385
406
|
account: database_schema.accountInsertSchema
|
|
386
407
|
});
|
|
387
408
|
|
|
409
|
+
const getBankAccountsInputSchema = zod.z.object({
|
|
410
|
+
includes: zod.z.object({
|
|
411
|
+
workflow: zod.z.boolean().optional(),
|
|
412
|
+
batchCounts: zod.z.boolean().optional()
|
|
413
|
+
}).optional()
|
|
414
|
+
});
|
|
415
|
+
|
|
388
416
|
const disconnectAccountInputSchema = zod.z.object({
|
|
389
417
|
accountId: zod.z.uuid()
|
|
390
418
|
});
|
|
@@ -981,32 +1009,41 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
|
|
|
981
1009
|
}
|
|
982
1010
|
);
|
|
983
1011
|
}
|
|
984
|
-
async getBankAccounts() {
|
|
1012
|
+
async getBankAccounts(input) {
|
|
985
1013
|
return this.handleAction(
|
|
986
|
-
|
|
1014
|
+
{ data: input, schema: getBankAccountsInputSchema },
|
|
987
1015
|
{ successMessage: "Bank accounts retrieved successfully" },
|
|
988
|
-
async () => {
|
|
1016
|
+
async ({ includes }) => {
|
|
989
1017
|
const accounts = await this._getAccounts();
|
|
990
|
-
const
|
|
1018
|
+
const includeWorkflow = includes?.workflow ?? true;
|
|
1019
|
+
const includeBatchCounts = includes?.batchCounts ?? false;
|
|
1020
|
+
const accountsWithOptionalFields = await Promise.all(
|
|
991
1021
|
accounts.map(async (a) => {
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
workflow
|
|
1022
|
+
const result = { ...a };
|
|
1023
|
+
if (includeWorkflow) {
|
|
1024
|
+
let status;
|
|
1025
|
+
try {
|
|
1026
|
+
const instance = await this.env.SYNC_ACCOUNT_PAYMENTS_WORKFLOW.get(a.id);
|
|
1027
|
+
status = await instance.status();
|
|
1028
|
+
} catch (_) {
|
|
1029
|
+
status = null;
|
|
1030
|
+
}
|
|
1031
|
+
result.workflow = status ? {
|
|
1002
1032
|
instanceId: a.id,
|
|
1003
1033
|
details: status
|
|
1004
|
-
} : null
|
|
1005
|
-
}
|
|
1034
|
+
} : null;
|
|
1035
|
+
}
|
|
1036
|
+
if (includeBatchCounts) {
|
|
1037
|
+
const batchCounts = await getAccountBatchCountsQuery(this.db, {
|
|
1038
|
+
accountId: a.id
|
|
1039
|
+
});
|
|
1040
|
+
result.batches = batchCounts;
|
|
1041
|
+
}
|
|
1042
|
+
return result;
|
|
1006
1043
|
})
|
|
1007
1044
|
);
|
|
1008
1045
|
return {
|
|
1009
|
-
accounts:
|
|
1046
|
+
accounts: accountsWithOptionalFields,
|
|
1010
1047
|
totalCount: accounts.length
|
|
1011
1048
|
};
|
|
1012
1049
|
}
|
package/dist/export/worker.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.
|
|
1
|
+
import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.CG0gMBFx.cjs';
|
|
2
2
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
3
3
|
import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
@@ -1531,19 +1531,19 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
1531
1531
|
}, z.core.$strip>;
|
|
1532
1532
|
filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
|
|
1533
1533
|
filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1534
|
+
FAILED: "FAILED";
|
|
1534
1535
|
OPEN: "OPEN";
|
|
1535
1536
|
PROCESSING: "PROCESSING";
|
|
1536
1537
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1537
1538
|
SIGNED: "SIGNED";
|
|
1538
1539
|
SIGNATURE_FAILED: "SIGNATURE_FAILED";
|
|
1539
|
-
FAILED: "FAILED";
|
|
1540
1540
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1541
|
+
FAILED: "FAILED";
|
|
1541
1542
|
OPEN: "OPEN";
|
|
1542
1543
|
PROCESSING: "PROCESSING";
|
|
1543
1544
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1544
1545
|
SIGNED: "SIGNED";
|
|
1545
1546
|
SIGNATURE_FAILED: "SIGNATURE_FAILED";
|
|
1546
|
-
FAILED: "FAILED";
|
|
1547
1547
|
}>>]>>;
|
|
1548
1548
|
}, z.core.$strip>;
|
|
1549
1549
|
type GetBatchesInput = z.input<typeof getBatchesInputSchema>;
|
|
@@ -1788,16 +1788,16 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
1788
1788
|
filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
|
|
1789
1789
|
filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
|
|
1790
1790
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1791
|
-
FAILED: "FAILED";
|
|
1792
1791
|
PREPARED: "PREPARED";
|
|
1793
1792
|
INITIALIZED: "INITIALIZED";
|
|
1793
|
+
FAILED: "FAILED";
|
|
1794
1794
|
PENDING: "PENDING";
|
|
1795
1795
|
COMPLETED: "COMPLETED";
|
|
1796
1796
|
CREATED: "CREATED";
|
|
1797
1797
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1798
|
-
FAILED: "FAILED";
|
|
1799
1798
|
PREPARED: "PREPARED";
|
|
1800
1799
|
INITIALIZED: "INITIALIZED";
|
|
1800
|
+
FAILED: "FAILED";
|
|
1801
1801
|
PENDING: "PENDING";
|
|
1802
1802
|
COMPLETED: "COMPLETED";
|
|
1803
1803
|
CREATED: "CREATED";
|
|
@@ -2394,14 +2394,29 @@ declare const updateAccountInputSchema: z.ZodObject<{
|
|
|
2394
2394
|
type UpdateAccountInput = z.infer<typeof updateAccountInputSchema>;
|
|
2395
2395
|
type UpdateAccountOutput = AccountSelectType;
|
|
2396
2396
|
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
}
|
|
2397
|
+
declare const getBankAccountsInputSchema: z.ZodObject<{
|
|
2398
|
+
includes: z.ZodOptional<z.ZodObject<{
|
|
2399
|
+
workflow: z.ZodOptional<z.ZodBoolean>;
|
|
2400
|
+
batchCounts: z.ZodOptional<z.ZodBoolean>;
|
|
2401
|
+
}, z.core.$strip>>;
|
|
2402
|
+
}, z.core.$strip>;
|
|
2403
|
+
type GetBankAccountsInput = z.infer<typeof getBankAccountsInputSchema>;
|
|
2404
|
+
type WorkflowInfo = {
|
|
2405
|
+
instanceId: string;
|
|
2406
|
+
details: WorkflowInstanceStatus;
|
|
2407
|
+
} | null;
|
|
2408
|
+
type BatchCounts = {
|
|
2409
|
+
totalCount: number;
|
|
2410
|
+
openCount: number;
|
|
2411
|
+
readyToSignCount: number;
|
|
2412
|
+
failedCount: number;
|
|
2413
|
+
};
|
|
2414
|
+
type AccountWithOptionalFields = AccountSelectType & {
|
|
2415
|
+
workflow?: WorkflowInfo;
|
|
2416
|
+
batches?: BatchCounts;
|
|
2402
2417
|
};
|
|
2403
|
-
type
|
|
2404
|
-
accounts:
|
|
2418
|
+
type GetBankAccountsOutput = {
|
|
2419
|
+
accounts: AccountWithOptionalFields[];
|
|
2405
2420
|
totalCount: number;
|
|
2406
2421
|
};
|
|
2407
2422
|
|
|
@@ -2497,14 +2512,14 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2497
2512
|
addPaymentsToBatch({ paymentsToBatch, }: {
|
|
2498
2513
|
paymentsToBatch: SendPaymentInput[];
|
|
2499
2514
|
}): Promise<IRPCResponse<{
|
|
2500
|
-
status: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | "FAILED" | null;
|
|
2501
2515
|
id: string;
|
|
2502
2516
|
createdAt: Date | null;
|
|
2503
2517
|
updatedAt: Date | null;
|
|
2504
2518
|
deletedAt: Date | null;
|
|
2505
|
-
accountId: string | null;
|
|
2506
2519
|
batchPaymentInitiatedAt: Date | null;
|
|
2507
2520
|
authorizationUrls: string[] | null;
|
|
2521
|
+
status: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | null;
|
|
2522
|
+
accountId: string | null;
|
|
2508
2523
|
statusReason: string | null;
|
|
2509
2524
|
payments: PaymentInsertType[];
|
|
2510
2525
|
metadata: BatchMetadata | null;
|
|
@@ -2518,7 +2533,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2518
2533
|
authorizeAccount(input: AuthorizeAccountInput): Promise<IRPCResponse<AuthorizeAccountOutput>>;
|
|
2519
2534
|
simulateDeposit(input: SimulateDepositInput): Promise<IRPCResponse<SimulateDepositOutput>>;
|
|
2520
2535
|
sendPayment(input: SendPaymentInput): Promise<IRPCResponse<SendPaymentOutput>>;
|
|
2521
|
-
getBankAccounts(): Promise<IRPCResponse<
|
|
2536
|
+
getBankAccounts(input: GetBankAccountsInput): Promise<IRPCResponse<GetBankAccountsOutput>>;
|
|
2522
2537
|
updateAccount(input: UpdateAccountInput): Promise<IRPCResponse<UpdateAccountOutput>>;
|
|
2523
2538
|
disconnectAccount(input: DisconnectAccountInput): Promise<IRPCResponse<DisconnectAccountOutput>>;
|
|
2524
2539
|
getBatches(input: GetBatchesInput): Promise<IRPCResponse<GetBatchesOutput>>;
|
package/dist/export/worker.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.
|
|
1
|
+
import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.CG0gMBFx.mjs';
|
|
2
2
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
3
3
|
import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
@@ -1531,19 +1531,19 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
1531
1531
|
}, z.core.$strip>;
|
|
1532
1532
|
filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
|
|
1533
1533
|
filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1534
|
+
FAILED: "FAILED";
|
|
1534
1535
|
OPEN: "OPEN";
|
|
1535
1536
|
PROCESSING: "PROCESSING";
|
|
1536
1537
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1537
1538
|
SIGNED: "SIGNED";
|
|
1538
1539
|
SIGNATURE_FAILED: "SIGNATURE_FAILED";
|
|
1539
|
-
FAILED: "FAILED";
|
|
1540
1540
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1541
|
+
FAILED: "FAILED";
|
|
1541
1542
|
OPEN: "OPEN";
|
|
1542
1543
|
PROCESSING: "PROCESSING";
|
|
1543
1544
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1544
1545
|
SIGNED: "SIGNED";
|
|
1545
1546
|
SIGNATURE_FAILED: "SIGNATURE_FAILED";
|
|
1546
|
-
FAILED: "FAILED";
|
|
1547
1547
|
}>>]>>;
|
|
1548
1548
|
}, z.core.$strip>;
|
|
1549
1549
|
type GetBatchesInput = z.input<typeof getBatchesInputSchema>;
|
|
@@ -1788,16 +1788,16 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
1788
1788
|
filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
|
|
1789
1789
|
filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
|
|
1790
1790
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1791
|
-
FAILED: "FAILED";
|
|
1792
1791
|
PREPARED: "PREPARED";
|
|
1793
1792
|
INITIALIZED: "INITIALIZED";
|
|
1793
|
+
FAILED: "FAILED";
|
|
1794
1794
|
PENDING: "PENDING";
|
|
1795
1795
|
COMPLETED: "COMPLETED";
|
|
1796
1796
|
CREATED: "CREATED";
|
|
1797
1797
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1798
|
-
FAILED: "FAILED";
|
|
1799
1798
|
PREPARED: "PREPARED";
|
|
1800
1799
|
INITIALIZED: "INITIALIZED";
|
|
1800
|
+
FAILED: "FAILED";
|
|
1801
1801
|
PENDING: "PENDING";
|
|
1802
1802
|
COMPLETED: "COMPLETED";
|
|
1803
1803
|
CREATED: "CREATED";
|
|
@@ -2394,14 +2394,29 @@ declare const updateAccountInputSchema: z.ZodObject<{
|
|
|
2394
2394
|
type UpdateAccountInput = z.infer<typeof updateAccountInputSchema>;
|
|
2395
2395
|
type UpdateAccountOutput = AccountSelectType;
|
|
2396
2396
|
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
}
|
|
2397
|
+
declare const getBankAccountsInputSchema: z.ZodObject<{
|
|
2398
|
+
includes: z.ZodOptional<z.ZodObject<{
|
|
2399
|
+
workflow: z.ZodOptional<z.ZodBoolean>;
|
|
2400
|
+
batchCounts: z.ZodOptional<z.ZodBoolean>;
|
|
2401
|
+
}, z.core.$strip>>;
|
|
2402
|
+
}, z.core.$strip>;
|
|
2403
|
+
type GetBankAccountsInput = z.infer<typeof getBankAccountsInputSchema>;
|
|
2404
|
+
type WorkflowInfo = {
|
|
2405
|
+
instanceId: string;
|
|
2406
|
+
details: WorkflowInstanceStatus;
|
|
2407
|
+
} | null;
|
|
2408
|
+
type BatchCounts = {
|
|
2409
|
+
totalCount: number;
|
|
2410
|
+
openCount: number;
|
|
2411
|
+
readyToSignCount: number;
|
|
2412
|
+
failedCount: number;
|
|
2413
|
+
};
|
|
2414
|
+
type AccountWithOptionalFields = AccountSelectType & {
|
|
2415
|
+
workflow?: WorkflowInfo;
|
|
2416
|
+
batches?: BatchCounts;
|
|
2402
2417
|
};
|
|
2403
|
-
type
|
|
2404
|
-
accounts:
|
|
2418
|
+
type GetBankAccountsOutput = {
|
|
2419
|
+
accounts: AccountWithOptionalFields[];
|
|
2405
2420
|
totalCount: number;
|
|
2406
2421
|
};
|
|
2407
2422
|
|
|
@@ -2497,14 +2512,14 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2497
2512
|
addPaymentsToBatch({ paymentsToBatch, }: {
|
|
2498
2513
|
paymentsToBatch: SendPaymentInput[];
|
|
2499
2514
|
}): Promise<IRPCResponse<{
|
|
2500
|
-
status: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | "FAILED" | null;
|
|
2501
2515
|
id: string;
|
|
2502
2516
|
createdAt: Date | null;
|
|
2503
2517
|
updatedAt: Date | null;
|
|
2504
2518
|
deletedAt: Date | null;
|
|
2505
|
-
accountId: string | null;
|
|
2506
2519
|
batchPaymentInitiatedAt: Date | null;
|
|
2507
2520
|
authorizationUrls: string[] | null;
|
|
2521
|
+
status: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | null;
|
|
2522
|
+
accountId: string | null;
|
|
2508
2523
|
statusReason: string | null;
|
|
2509
2524
|
payments: PaymentInsertType[];
|
|
2510
2525
|
metadata: BatchMetadata | null;
|
|
@@ -2518,7 +2533,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2518
2533
|
authorizeAccount(input: AuthorizeAccountInput): Promise<IRPCResponse<AuthorizeAccountOutput>>;
|
|
2519
2534
|
simulateDeposit(input: SimulateDepositInput): Promise<IRPCResponse<SimulateDepositOutput>>;
|
|
2520
2535
|
sendPayment(input: SendPaymentInput): Promise<IRPCResponse<SendPaymentOutput>>;
|
|
2521
|
-
getBankAccounts(): Promise<IRPCResponse<
|
|
2536
|
+
getBankAccounts(input: GetBankAccountsInput): Promise<IRPCResponse<GetBankAccountsOutput>>;
|
|
2522
2537
|
updateAccount(input: UpdateAccountInput): Promise<IRPCResponse<UpdateAccountOutput>>;
|
|
2523
2538
|
disconnectAccount(input: DisconnectAccountInput): Promise<IRPCResponse<DisconnectAccountOutput>>;
|
|
2524
2539
|
getBatches(input: GetBatchesInput): Promise<IRPCResponse<GetBatchesOutput>>;
|
package/dist/export/worker.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.
|
|
1
|
+
import { A as AccountSelectType, P as PaymentSelectType, B as BatchSelectType, L as LastSyncMetadata, C as ConfigEnvironmentBank, t as tables, a as ConnectorKey, I as IBankConnector, b as PaymentInsertType, c as BatchMetadata } from '../shared/bank.CG0gMBFx.js';
|
|
2
2
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
3
3
|
import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
@@ -1531,19 +1531,19 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
1531
1531
|
}, z.core.$strip>;
|
|
1532
1532
|
filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
|
|
1533
1533
|
filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1534
|
+
FAILED: "FAILED";
|
|
1534
1535
|
OPEN: "OPEN";
|
|
1535
1536
|
PROCESSING: "PROCESSING";
|
|
1536
1537
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1537
1538
|
SIGNED: "SIGNED";
|
|
1538
1539
|
SIGNATURE_FAILED: "SIGNATURE_FAILED";
|
|
1539
|
-
FAILED: "FAILED";
|
|
1540
1540
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1541
|
+
FAILED: "FAILED";
|
|
1541
1542
|
OPEN: "OPEN";
|
|
1542
1543
|
PROCESSING: "PROCESSING";
|
|
1543
1544
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1544
1545
|
SIGNED: "SIGNED";
|
|
1545
1546
|
SIGNATURE_FAILED: "SIGNATURE_FAILED";
|
|
1546
|
-
FAILED: "FAILED";
|
|
1547
1547
|
}>>]>>;
|
|
1548
1548
|
}, z.core.$strip>;
|
|
1549
1549
|
type GetBatchesInput = z.input<typeof getBatchesInputSchema>;
|
|
@@ -1788,16 +1788,16 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
1788
1788
|
filterPaymentDateFrom: z.ZodOptional<z.ZodDate>;
|
|
1789
1789
|
filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
|
|
1790
1790
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1791
|
-
FAILED: "FAILED";
|
|
1792
1791
|
PREPARED: "PREPARED";
|
|
1793
1792
|
INITIALIZED: "INITIALIZED";
|
|
1793
|
+
FAILED: "FAILED";
|
|
1794
1794
|
PENDING: "PENDING";
|
|
1795
1795
|
COMPLETED: "COMPLETED";
|
|
1796
1796
|
CREATED: "CREATED";
|
|
1797
1797
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1798
|
-
FAILED: "FAILED";
|
|
1799
1798
|
PREPARED: "PREPARED";
|
|
1800
1799
|
INITIALIZED: "INITIALIZED";
|
|
1800
|
+
FAILED: "FAILED";
|
|
1801
1801
|
PENDING: "PENDING";
|
|
1802
1802
|
COMPLETED: "COMPLETED";
|
|
1803
1803
|
CREATED: "CREATED";
|
|
@@ -2394,14 +2394,29 @@ declare const updateAccountInputSchema: z.ZodObject<{
|
|
|
2394
2394
|
type UpdateAccountInput = z.infer<typeof updateAccountInputSchema>;
|
|
2395
2395
|
type UpdateAccountOutput = AccountSelectType;
|
|
2396
2396
|
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
}
|
|
2397
|
+
declare const getBankAccountsInputSchema: z.ZodObject<{
|
|
2398
|
+
includes: z.ZodOptional<z.ZodObject<{
|
|
2399
|
+
workflow: z.ZodOptional<z.ZodBoolean>;
|
|
2400
|
+
batchCounts: z.ZodOptional<z.ZodBoolean>;
|
|
2401
|
+
}, z.core.$strip>>;
|
|
2402
|
+
}, z.core.$strip>;
|
|
2403
|
+
type GetBankAccountsInput = z.infer<typeof getBankAccountsInputSchema>;
|
|
2404
|
+
type WorkflowInfo = {
|
|
2405
|
+
instanceId: string;
|
|
2406
|
+
details: WorkflowInstanceStatus;
|
|
2407
|
+
} | null;
|
|
2408
|
+
type BatchCounts = {
|
|
2409
|
+
totalCount: number;
|
|
2410
|
+
openCount: number;
|
|
2411
|
+
readyToSignCount: number;
|
|
2412
|
+
failedCount: number;
|
|
2413
|
+
};
|
|
2414
|
+
type AccountWithOptionalFields = AccountSelectType & {
|
|
2415
|
+
workflow?: WorkflowInfo;
|
|
2416
|
+
batches?: BatchCounts;
|
|
2402
2417
|
};
|
|
2403
|
-
type
|
|
2404
|
-
accounts:
|
|
2418
|
+
type GetBankAccountsOutput = {
|
|
2419
|
+
accounts: AccountWithOptionalFields[];
|
|
2405
2420
|
totalCount: number;
|
|
2406
2421
|
};
|
|
2407
2422
|
|
|
@@ -2497,14 +2512,14 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2497
2512
|
addPaymentsToBatch({ paymentsToBatch, }: {
|
|
2498
2513
|
paymentsToBatch: SendPaymentInput[];
|
|
2499
2514
|
}): Promise<IRPCResponse<{
|
|
2500
|
-
status: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | "FAILED" | null;
|
|
2501
2515
|
id: string;
|
|
2502
2516
|
createdAt: Date | null;
|
|
2503
2517
|
updatedAt: Date | null;
|
|
2504
2518
|
deletedAt: Date | null;
|
|
2505
|
-
accountId: string | null;
|
|
2506
2519
|
batchPaymentInitiatedAt: Date | null;
|
|
2507
2520
|
authorizationUrls: string[] | null;
|
|
2521
|
+
status: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | null;
|
|
2522
|
+
accountId: string | null;
|
|
2508
2523
|
statusReason: string | null;
|
|
2509
2524
|
payments: PaymentInsertType[];
|
|
2510
2525
|
metadata: BatchMetadata | null;
|
|
@@ -2518,7 +2533,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2518
2533
|
authorizeAccount(input: AuthorizeAccountInput): Promise<IRPCResponse<AuthorizeAccountOutput>>;
|
|
2519
2534
|
simulateDeposit(input: SimulateDepositInput): Promise<IRPCResponse<SimulateDepositOutput>>;
|
|
2520
2535
|
sendPayment(input: SendPaymentInput): Promise<IRPCResponse<SendPaymentOutput>>;
|
|
2521
|
-
getBankAccounts(): Promise<IRPCResponse<
|
|
2536
|
+
getBankAccounts(input: GetBankAccountsInput): Promise<IRPCResponse<GetBankAccountsOutput>>;
|
|
2522
2537
|
updateAccount(input: UpdateAccountInput): Promise<IRPCResponse<UpdateAccountOutput>>;
|
|
2523
2538
|
disconnectAccount(input: DisconnectAccountInput): Promise<IRPCResponse<DisconnectAccountOutput>>;
|
|
2524
2539
|
getBatches(input: GetBatchesInput): Promise<IRPCResponse<GetBatchesOutput>>;
|
package/dist/export/worker.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { uuidv4, bankAccountMetadataSchema, workflowInstanceStatusSchema, develitWorker, createInternalError,
|
|
1
|
+
import { uuidv4, first, bankAccountMetadataSchema, workflowInstanceStatusSchema, develitWorker, createInternalError, action, service } from '@develit-io/backend-sdk';
|
|
2
2
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
3
3
|
import { drizzle } from 'drizzle-orm/d1';
|
|
4
4
|
import { t as tables } from '../shared/bank.D7JSg_d9.mjs';
|
|
@@ -6,7 +6,7 @@ import { z } from 'zod';
|
|
|
6
6
|
import { I as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, P as PAYMENT_TYPES, d as CONNECTOR_KEYS, B as BATCH_STATUSES, a as PAYMENT_STATUSES, b as PAYMENT_DIRECTIONS, f as accountInsertSchema } from '../shared/bank.m2X4FSvr.mjs';
|
|
7
7
|
import { CURRENCY_CODES } from '@develit-io/general-codes';
|
|
8
8
|
import 'date-fns';
|
|
9
|
-
import { eq, inArray, and,
|
|
9
|
+
import { eq, sql, inArray, and, asc, desc, gte, lte } from 'drizzle-orm';
|
|
10
10
|
import 'jose';
|
|
11
11
|
import 'node:crypto';
|
|
12
12
|
import { f as encrypt, i as importAesKey, a as getCredentialsByAccountId, b as initiateConnector, u as upsertBatchCommand, d as getBatchByIdQuery, c as createPaymentCommand, g as getAccountByIdQuery } from '../shared/bank.DYJuicD-.mjs';
|
|
@@ -91,6 +91,27 @@ const deletePaymentsByAccountCommand = (db, { accountId }) => {
|
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
+
const getAccountBatchCountsQuery = async (db, { accountId }) => {
|
|
95
|
+
const result = await db.select({
|
|
96
|
+
totalCount: sql`COUNT(*)`.as("totalCount"),
|
|
97
|
+
openCount: sql`SUM(CASE WHEN ${tables.batch.status} = 'OPEN' THEN 1 ELSE 0 END)`.as(
|
|
98
|
+
"openCount"
|
|
99
|
+
),
|
|
100
|
+
readyToSignCount: sql`SUM(CASE WHEN ${tables.batch.status} = 'READY_TO_SIGN' THEN 1 ELSE 0 END)`.as(
|
|
101
|
+
"readyToSignCount"
|
|
102
|
+
),
|
|
103
|
+
failedCount: sql`SUM(CASE WHEN ${tables.batch.status} = 'FAILED' THEN 1 ELSE 0 END)`.as(
|
|
104
|
+
"failedCount"
|
|
105
|
+
)
|
|
106
|
+
}).from(tables.batch).where(eq(tables.batch.accountId, accountId)).then(first);
|
|
107
|
+
return result || {
|
|
108
|
+
totalCount: 0,
|
|
109
|
+
openCount: 0,
|
|
110
|
+
readyToSignCount: 0,
|
|
111
|
+
failedCount: 0
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
|
|
94
115
|
const getAccountByIbanQuery = async (db, { iban }) => {
|
|
95
116
|
return await db.select().from(tables.account).where(eq(tables.account.iban, iban)).get();
|
|
96
117
|
};
|
|
@@ -383,6 +404,13 @@ const updateAccountInputSchema = z.object({
|
|
|
383
404
|
account: accountInsertSchema
|
|
384
405
|
});
|
|
385
406
|
|
|
407
|
+
const getBankAccountsInputSchema = z.object({
|
|
408
|
+
includes: z.object({
|
|
409
|
+
workflow: z.boolean().optional(),
|
|
410
|
+
batchCounts: z.boolean().optional()
|
|
411
|
+
}).optional()
|
|
412
|
+
});
|
|
413
|
+
|
|
386
414
|
const disconnectAccountInputSchema = z.object({
|
|
387
415
|
accountId: z.uuid()
|
|
388
416
|
});
|
|
@@ -979,32 +1007,41 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
979
1007
|
}
|
|
980
1008
|
);
|
|
981
1009
|
}
|
|
982
|
-
async getBankAccounts() {
|
|
1010
|
+
async getBankAccounts(input) {
|
|
983
1011
|
return this.handleAction(
|
|
984
|
-
|
|
1012
|
+
{ data: input, schema: getBankAccountsInputSchema },
|
|
985
1013
|
{ successMessage: "Bank accounts retrieved successfully" },
|
|
986
|
-
async () => {
|
|
1014
|
+
async ({ includes }) => {
|
|
987
1015
|
const accounts = await this._getAccounts();
|
|
988
|
-
const
|
|
1016
|
+
const includeWorkflow = includes?.workflow ?? true;
|
|
1017
|
+
const includeBatchCounts = includes?.batchCounts ?? false;
|
|
1018
|
+
const accountsWithOptionalFields = await Promise.all(
|
|
989
1019
|
accounts.map(async (a) => {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
workflow
|
|
1020
|
+
const result = { ...a };
|
|
1021
|
+
if (includeWorkflow) {
|
|
1022
|
+
let status;
|
|
1023
|
+
try {
|
|
1024
|
+
const instance = await this.env.SYNC_ACCOUNT_PAYMENTS_WORKFLOW.get(a.id);
|
|
1025
|
+
status = await instance.status();
|
|
1026
|
+
} catch (_) {
|
|
1027
|
+
status = null;
|
|
1028
|
+
}
|
|
1029
|
+
result.workflow = status ? {
|
|
1000
1030
|
instanceId: a.id,
|
|
1001
1031
|
details: status
|
|
1002
|
-
} : null
|
|
1003
|
-
}
|
|
1032
|
+
} : null;
|
|
1033
|
+
}
|
|
1034
|
+
if (includeBatchCounts) {
|
|
1035
|
+
const batchCounts = await getAccountBatchCountsQuery(this.db, {
|
|
1036
|
+
accountId: a.id
|
|
1037
|
+
});
|
|
1038
|
+
result.batches = batchCounts;
|
|
1039
|
+
}
|
|
1040
|
+
return result;
|
|
1004
1041
|
})
|
|
1005
1042
|
);
|
|
1006
1043
|
return {
|
|
1007
|
-
accounts:
|
|
1044
|
+
accounts: accountsWithOptionalFields,
|
|
1008
1045
|
totalCount: accounts.length
|
|
1009
1046
|
};
|
|
1010
1047
|
}
|
|
@@ -71,7 +71,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
71
71
|
tableName: "batch";
|
|
72
72
|
dataType: "string";
|
|
73
73
|
columnType: "SQLiteText";
|
|
74
|
-
data: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED"
|
|
74
|
+
data: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED";
|
|
75
75
|
driverParam: string;
|
|
76
76
|
notNull: false;
|
|
77
77
|
hasDefault: false;
|
|
@@ -84,7 +84,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
84
84
|
generated: undefined;
|
|
85
85
|
}, {}, {
|
|
86
86
|
length: number | undefined;
|
|
87
|
-
$type: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED"
|
|
87
|
+
$type: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED";
|
|
88
88
|
}>;
|
|
89
89
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
90
90
|
name: "status_reason";
|
|
@@ -418,7 +418,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
418
418
|
tableName: "payment";
|
|
419
419
|
dataType: "string";
|
|
420
420
|
columnType: "SQLiteText";
|
|
421
|
-
data: "
|
|
421
|
+
data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
422
422
|
driverParam: string;
|
|
423
423
|
notNull: true;
|
|
424
424
|
hasDefault: false;
|
|
@@ -431,7 +431,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
431
431
|
generated: undefined;
|
|
432
432
|
}, {}, {
|
|
433
433
|
length: number | undefined;
|
|
434
|
-
$type: "
|
|
434
|
+
$type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
435
435
|
}>;
|
|
436
436
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
437
437
|
name: "status_reason";
|
|
@@ -71,7 +71,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
71
71
|
tableName: "batch";
|
|
72
72
|
dataType: "string";
|
|
73
73
|
columnType: "SQLiteText";
|
|
74
|
-
data: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED"
|
|
74
|
+
data: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED";
|
|
75
75
|
driverParam: string;
|
|
76
76
|
notNull: false;
|
|
77
77
|
hasDefault: false;
|
|
@@ -84,7 +84,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
84
84
|
generated: undefined;
|
|
85
85
|
}, {}, {
|
|
86
86
|
length: number | undefined;
|
|
87
|
-
$type: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED"
|
|
87
|
+
$type: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED";
|
|
88
88
|
}>;
|
|
89
89
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
90
90
|
name: "status_reason";
|
|
@@ -418,7 +418,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
418
418
|
tableName: "payment";
|
|
419
419
|
dataType: "string";
|
|
420
420
|
columnType: "SQLiteText";
|
|
421
|
-
data: "
|
|
421
|
+
data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
422
422
|
driverParam: string;
|
|
423
423
|
notNull: true;
|
|
424
424
|
hasDefault: false;
|
|
@@ -431,7 +431,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
431
431
|
generated: undefined;
|
|
432
432
|
}, {}, {
|
|
433
433
|
length: number | undefined;
|
|
434
|
-
$type: "
|
|
434
|
+
$type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
435
435
|
}>;
|
|
436
436
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
437
437
|
name: "status_reason";
|
|
@@ -71,7 +71,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
71
71
|
tableName: "batch";
|
|
72
72
|
dataType: "string";
|
|
73
73
|
columnType: "SQLiteText";
|
|
74
|
-
data: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED"
|
|
74
|
+
data: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED";
|
|
75
75
|
driverParam: string;
|
|
76
76
|
notNull: false;
|
|
77
77
|
hasDefault: false;
|
|
@@ -84,7 +84,7 @@ declare const batch: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
84
84
|
generated: undefined;
|
|
85
85
|
}, {}, {
|
|
86
86
|
length: number | undefined;
|
|
87
|
-
$type: "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED"
|
|
87
|
+
$type: "FAILED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED";
|
|
88
88
|
}>;
|
|
89
89
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
90
90
|
name: "status_reason";
|
|
@@ -418,7 +418,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
418
418
|
tableName: "payment";
|
|
419
419
|
dataType: "string";
|
|
420
420
|
columnType: "SQLiteText";
|
|
421
|
-
data: "
|
|
421
|
+
data: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
422
422
|
driverParam: string;
|
|
423
423
|
notNull: true;
|
|
424
424
|
hasDefault: false;
|
|
@@ -431,7 +431,7 @@ declare const payment: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
431
431
|
generated: undefined;
|
|
432
432
|
}, {}, {
|
|
433
433
|
length: number | undefined;
|
|
434
|
-
$type: "
|
|
434
|
+
$type: "PREPARED" | "INITIALIZED" | "FAILED" | "PENDING" | "COMPLETED" | "CREATED";
|
|
435
435
|
}>;
|
|
436
436
|
statusReason: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
437
437
|
name: "status_reason";
|
package/dist/types.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.
|
|
2
|
-
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.CG0gMBFx.cjs';
|
|
2
|
+
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.CG0gMBFx.cjs';
|
|
3
3
|
import { Environment, BaseEvent } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
5
|
export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.Dh_H_5rC.cjs';
|
package/dist/types.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.
|
|
2
|
-
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.CG0gMBFx.mjs';
|
|
2
|
+
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.CG0gMBFx.mjs';
|
|
3
3
|
import { Environment, BaseEvent } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
5
|
export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.Dh_H_5rC.mjs';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.
|
|
2
|
-
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.
|
|
1
|
+
import { I as IBankConnector, d as IncomingPaymentMessage, e as InitiatedPayment, a as ConnectorKey, f as ConnectedAccount, g as AccountCredentialsInsertType, h as AccountInsertType, i as PaymentPreparedInsertType, j as InitiatedBatch, c as BatchMetadata, A as AccountSelectType, k as ParsedBankPayment, l as PaymentStatus, m as BatchStatus, n as CurrencyCode, o as BankCode, p as CountryCode, q as AuthInput, t as tables, r as Currency, P as PaymentSelectType } from './shared/bank.CG0gMBFx.js';
|
|
2
|
+
export { K as ACCOUNT_STATUSES, a3 as AccountCredentialsPatchType, a4 as AccountCredentialsSelectType, a2 as AccountCredentialsUpdateType, _ as AccountPatchType, M as AccountStatus, Z as AccountUpdateType, w as BATCH_STATUES, w as BATCH_STATUSES, Q as BankAccountWithLastSync, v as BatchInsertType, B as BatchSelectType, z as CHARGE_BEARERS, R as CONNECTOR_KEYS, N as COUNTRY_CODES, S as CREDENTIALS_TYPES, D as ChargeBearer, C as ConfigEnvironmentBank, T as CredentialsType, E as INSTRUCTION_PRIORITIES, F as InstructionPriority, L as LastSyncMetadata, O as OutgoingPaymentMessage, H as PAYMENT_DIRECTIONS, G as PAYMENT_STATUSES, x as PAYMENT_TYPES, J as PaymentDirection, s as PaymentFailedInsertType, u as PaymentInitializedInsertType, b as PaymentInsertType, y as PaymentType, U as TOKEN_TYPES, V as TokenType, $ as accountCredentialsInsertSchema, a1 as accountCredentialsSelectSchema, a0 as accountCredentialsUpdateSchema, W as accountInsertSchema, Y as accountSelectSchema, X as accountUpdateSchema } from './shared/bank.CG0gMBFx.js';
|
|
3
3
|
import { Environment, BaseEvent } from '@develit-io/backend-sdk';
|
|
4
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
5
|
export { b as BankServiceEnv, a as BankServiceEnvironmentConfig, B as BankServiceWranglerConfig } from './shared/bank.Dh_H_5rC.js';
|