@develit-services/bank 0.1.7 → 0.1.9
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.cjs +1 -1
- 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/database/schema.mjs +1 -1
- package/dist/export/worker.cjs +13 -15
- package/dist/export/worker.d.cts +16 -17
- package/dist/export/worker.d.mts +16 -17
- package/dist/export/worker.d.ts +16 -17
- package/dist/export/worker.mjs +3 -5
- package/dist/export/workflows.cjs +160 -9
- package/dist/export/workflows.d.cts +10 -2
- package/dist/export/workflows.d.mts +10 -2
- package/dist/export/workflows.d.ts +10 -2
- package/dist/export/workflows.mjs +163 -8
- package/dist/shared/bank.-FurAs09.cjs +120 -0
- package/dist/shared/{bank.D2ZeOkyc.mjs → bank.BvXwHpBp.mjs} +1 -1
- package/dist/shared/{bank.DCTBX1dp.d.ts → bank.CRVH1wUH.d.cts} +7 -7
- package/dist/shared/{bank.CrRs_x0N.d.mts → bank.Ckn_klvT.d.ts} +7 -7
- package/dist/shared/{bank.BFGDv0oC.d.cts → bank.CsvBtQib.d.cts} +8 -8
- package/dist/shared/{bank.BFGDv0oC.d.mts → bank.CsvBtQib.d.mts} +8 -8
- package/dist/shared/{bank.BFGDv0oC.d.ts → bank.CsvBtQib.d.ts} +8 -8
- package/dist/shared/bank.DTdKHhGd.mjs +113 -0
- package/dist/shared/{bank.DSVzOCrh.d.cts → bank.DouutABZ.d.mts} +7 -7
- package/dist/shared/{bank.xIMAnZ4v.mjs → bank.W4h6Dlzi.mjs} +62 -2
- package/dist/shared/{bank.PDmcU0T-.cjs → bank.tLe0jhjo.cjs} +61 -1
- package/dist/shared/{bank.BcCfzRPi.cjs → bank.z4VxSea3.cjs} +1 -1
- package/dist/types.cjs +2 -2
- package/dist/types.d.cts +69 -5
- package/dist/types.d.mts +69 -5
- package/dist/types.d.ts +69 -5
- package/dist/types.mjs +2 -2
- package/package.json +1 -1
- package/dist/shared/bank.B3isylGM.cjs +0 -284
- package/dist/shared/bank.ChAGzUFo.d.cts +0 -18
- package/dist/shared/bank.ChAGzUFo.d.mts +0 -18
- package/dist/shared/bank.ChAGzUFo.d.ts +0 -18
- package/dist/shared/bank.JtGSu6eH.mjs +0 -275
package/dist/database/schema.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { f as account, g as accountCredentials, c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.
|
|
1
|
+
export { f as account, g as accountCredentials, c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.CsvBtQib.cjs';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
3
|
import 'drizzle-orm';
|
|
4
4
|
import 'zod';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { f as account, g as accountCredentials, c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.
|
|
1
|
+
export { f as account, g as accountCredentials, c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.CsvBtQib.mjs';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
3
|
import 'drizzle-orm';
|
|
4
4
|
import 'zod';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { f as account, g as accountCredentials, c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.
|
|
1
|
+
export { f as account, g as accountCredentials, c as batch, o as ott, d as payment, e as paymentRelations } from '../shared/bank.CsvBtQib.js';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
3
|
import 'drizzle-orm';
|
|
4
4
|
import 'zod';
|
package/dist/database/schema.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { D as account, G as accountCredentials, w as batch, z as ott, x as payment, y as paymentRelations } from '../shared/bank.
|
|
1
|
+
export { D as account, G as accountCredentials, w as batch, z as ott, x as payment, y as paymentRelations } from '../shared/bank.W4h6Dlzi.mjs';
|
|
2
2
|
import '@develit-io/backend-sdk';
|
|
3
3
|
import 'drizzle-orm/sqlite-core';
|
|
4
4
|
import 'date-fns';
|
package/dist/export/worker.cjs
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const export_workflows = require('../shared/bank.B3isylGM.cjs');
|
|
4
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
5
4
|
const cloudflare_workers = require('cloudflare:workers');
|
|
6
5
|
const d1 = require('drizzle-orm/d1');
|
|
7
|
-
const database_schema = require('../shared/bank.
|
|
6
|
+
const database_schema = require('../shared/bank.tLe0jhjo.cjs');
|
|
8
7
|
require('jose');
|
|
9
8
|
const generalCodes = require('@develit-io/general-codes');
|
|
10
9
|
const zod = require('zod');
|
|
10
|
+
const bank = require('../shared/bank.-FurAs09.cjs');
|
|
11
11
|
const drizzleOrm = require('drizzle-orm');
|
|
12
|
-
require('cloudflare:workflows');
|
|
13
|
-
require('../shared/bank.BcCfzRPi.cjs');
|
|
14
12
|
require('drizzle-orm/sqlite-core');
|
|
15
13
|
require('date-fns');
|
|
16
14
|
require('drizzle-zod');
|
|
17
15
|
require('drizzle-orm/relations');
|
|
16
|
+
require('../shared/bank.z4VxSea3.cjs');
|
|
18
17
|
|
|
19
18
|
const upsertAccountCommand = (db, { account }) => {
|
|
20
19
|
const id = account.id || backendSdk.uuidv4();
|
|
@@ -419,7 +418,7 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
|
|
|
419
418
|
}
|
|
420
419
|
if (allFetchedPayments.length < 1) return;
|
|
421
420
|
const bankRefIds = allFetchedPayments.map((payment) => payment.bankRefId).filter(Boolean);
|
|
422
|
-
const alreadyExistingPayments = await
|
|
421
|
+
const alreadyExistingPayments = await bank.getPaymentsByBankRefIdsQuery(
|
|
423
422
|
this.db,
|
|
424
423
|
{
|
|
425
424
|
ids: bankRefIds
|
|
@@ -442,7 +441,7 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
|
|
|
442
441
|
timestamp: (/* @__PURE__ */ new Date()).toDateString()
|
|
443
442
|
}
|
|
444
443
|
});
|
|
445
|
-
return
|
|
444
|
+
return bank.updatePaymentCommand(this.db, { payment }).command;
|
|
446
445
|
}
|
|
447
446
|
eventsToPush.push({
|
|
448
447
|
eventType: "BANK_PAYMENT",
|
|
@@ -454,7 +453,7 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
|
|
|
454
453
|
timestamp: (/* @__PURE__ */ new Date()).toDateString()
|
|
455
454
|
}
|
|
456
455
|
});
|
|
457
|
-
return
|
|
456
|
+
return bank.createPaymentCommand(this.db, { payment }).command;
|
|
458
457
|
});
|
|
459
458
|
await this.db.batch([paymentsCommands[0], ...paymentsCommands.slice(1)]);
|
|
460
459
|
await this.pushToQueue(
|
|
@@ -475,7 +474,7 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
|
|
|
475
474
|
)[0];
|
|
476
475
|
}
|
|
477
476
|
if (lastSyncPayment.createdAt) {
|
|
478
|
-
await
|
|
477
|
+
await bank.updateAccountLastSyncCommand(this.db, {
|
|
479
478
|
accountId: account.id,
|
|
480
479
|
lastSyncedAt: lastSyncPayment.createdAt
|
|
481
480
|
}).command.execute();
|
|
@@ -497,7 +496,7 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
|
|
|
497
496
|
);
|
|
498
497
|
const accountsWithCredentials = await Promise.all(
|
|
499
498
|
accountsForConnector.map(async (acc) => {
|
|
500
|
-
const credentials = await
|
|
499
|
+
const credentials = await bank.getCredentialsByAccountId(this.db, {
|
|
501
500
|
accountId: acc.id
|
|
502
501
|
});
|
|
503
502
|
if (!credentials) {
|
|
@@ -514,7 +513,7 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
|
|
|
514
513
|
};
|
|
515
514
|
})
|
|
516
515
|
);
|
|
517
|
-
this.bankConnector =
|
|
516
|
+
this.bankConnector = bank.initiateConnector({
|
|
518
517
|
bank: connectorKey,
|
|
519
518
|
connectedAccounts: accountsWithCredentials,
|
|
520
519
|
env: this.env
|
|
@@ -833,7 +832,7 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
|
|
|
833
832
|
...preparedBatch.failedPayments,
|
|
834
833
|
...preparedBatch.newlyPreparedPayments
|
|
835
834
|
].map(
|
|
836
|
-
(p) =>
|
|
835
|
+
(p) => bank.createPaymentCommand(this.db, { payment: p }).command.execute()
|
|
837
836
|
)
|
|
838
837
|
]);
|
|
839
838
|
await upsertBatchCommand(this.db, {
|
|
@@ -870,7 +869,7 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
|
|
|
870
869
|
}
|
|
871
870
|
});
|
|
872
871
|
const updatePayments = payments.map(
|
|
873
|
-
(payment) =>
|
|
872
|
+
(payment) => bank.updatePaymentCommand(this.db, {
|
|
874
873
|
payment: { ...payment, status: "INITIALIZED" }
|
|
875
874
|
}).command
|
|
876
875
|
);
|
|
@@ -1047,7 +1046,7 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
|
|
|
1047
1046
|
debtor,
|
|
1048
1047
|
debtorIban: debtor.iban
|
|
1049
1048
|
};
|
|
1050
|
-
const { command } =
|
|
1049
|
+
const { command } = bank.createPaymentCommand(this.db, { payment });
|
|
1051
1050
|
const createdPayment = await command.execute().then(backendSdk.first);
|
|
1052
1051
|
this.logQueuePush({ payment, isPaymentExecuted: true });
|
|
1053
1052
|
await this.pushToQueue(this.env.QUEUE_BUS_QUEUE, {
|
|
@@ -1078,7 +1077,7 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
|
|
|
1078
1077
|
message: "Account for this organization does not exist."
|
|
1079
1078
|
});
|
|
1080
1079
|
}
|
|
1081
|
-
await
|
|
1080
|
+
await bank.updateAccountLastSyncCommand(this.db, {
|
|
1082
1081
|
accountId: account.id,
|
|
1083
1082
|
lastSyncedAt
|
|
1084
1083
|
}).command.execute();
|
|
@@ -1221,5 +1220,4 @@ function defineBankService({
|
|
|
1221
1220
|
};
|
|
1222
1221
|
}
|
|
1223
1222
|
|
|
1224
|
-
exports.BankWorkflows = export_workflows.workflows;
|
|
1225
1223
|
exports.defineBankService = defineBankService;
|
package/dist/export/worker.d.cts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export { w as BankWorkflows } from '../shared/bank.ChAGzUFo.cjs';
|
|
2
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
3
2
|
import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
|
|
4
3
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
|
-
import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.
|
|
7
|
-
import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey } from '../shared/bank.
|
|
5
|
+
import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.CsvBtQib.cjs';
|
|
6
|
+
import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey } from '../shared/bank.CRVH1wUH.cjs';
|
|
8
7
|
import { z } from 'zod';
|
|
9
8
|
import * as drizzle_zod from 'drizzle-zod';
|
|
10
9
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
@@ -1539,21 +1538,21 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
1539
1538
|
}, z.core.$strip>;
|
|
1540
1539
|
filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
|
|
1541
1540
|
filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1541
|
+
PREPARED: "PREPARED";
|
|
1542
|
+
FAILED: "FAILED";
|
|
1543
|
+
COMPLETED: "COMPLETED";
|
|
1542
1544
|
OPEN: "OPEN";
|
|
1543
1545
|
PROCESSING: "PROCESSING";
|
|
1544
1546
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1545
1547
|
WAITING_FOR_PROCESSING: "WAITING_FOR_PROCESSING";
|
|
1548
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
1546
1549
|
PREPARED: "PREPARED";
|
|
1547
|
-
COMPLETED: "COMPLETED";
|
|
1548
1550
|
FAILED: "FAILED";
|
|
1549
|
-
|
|
1551
|
+
COMPLETED: "COMPLETED";
|
|
1550
1552
|
OPEN: "OPEN";
|
|
1551
1553
|
PROCESSING: "PROCESSING";
|
|
1552
1554
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1553
1555
|
WAITING_FOR_PROCESSING: "WAITING_FOR_PROCESSING";
|
|
1554
|
-
PREPARED: "PREPARED";
|
|
1555
|
-
COMPLETED: "COMPLETED";
|
|
1556
|
-
FAILED: "FAILED";
|
|
1557
1556
|
}>>]>>;
|
|
1558
1557
|
}, z.core.$strip>;
|
|
1559
1558
|
type GetBatchesInput = z.input<typeof getBatchesInputSchema>;
|
|
@@ -1582,9 +1581,9 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
1582
1581
|
limit: z.ZodNumber;
|
|
1583
1582
|
sort: z.ZodObject<{
|
|
1584
1583
|
column: z.ZodEnum<{
|
|
1584
|
+
amount: "amount";
|
|
1585
1585
|
createdAt: "createdAt";
|
|
1586
1586
|
updatedAt: "updatedAt";
|
|
1587
|
-
amount: "amount";
|
|
1588
1587
|
}>;
|
|
1589
1588
|
direction: z.ZodEnum<{
|
|
1590
1589
|
asc: "asc";
|
|
@@ -1713,17 +1712,17 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
1713
1712
|
filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
|
|
1714
1713
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1715
1714
|
PREPARED: "PREPARED";
|
|
1716
|
-
COMPLETED: "COMPLETED";
|
|
1717
|
-
FAILED: "FAILED";
|
|
1718
1715
|
INITIALIZED: "INITIALIZED";
|
|
1716
|
+
FAILED: "FAILED";
|
|
1719
1717
|
PENDING: "PENDING";
|
|
1718
|
+
COMPLETED: "COMPLETED";
|
|
1720
1719
|
CREATED: "CREATED";
|
|
1721
1720
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1722
1721
|
PREPARED: "PREPARED";
|
|
1723
|
-
COMPLETED: "COMPLETED";
|
|
1724
|
-
FAILED: "FAILED";
|
|
1725
1722
|
INITIALIZED: "INITIALIZED";
|
|
1723
|
+
FAILED: "FAILED";
|
|
1726
1724
|
PENDING: "PENDING";
|
|
1725
|
+
COMPLETED: "COMPLETED";
|
|
1727
1726
|
CREATED: "CREATED";
|
|
1728
1727
|
}>>]>>;
|
|
1729
1728
|
}, z.core.$strip>;
|
|
@@ -1863,14 +1862,14 @@ declare const updateAccountInputSchema: z.ZodObject<{
|
|
|
1863
1862
|
tableName: "account";
|
|
1864
1863
|
dataType: "string";
|
|
1865
1864
|
columnType: "SQLiteText";
|
|
1866
|
-
data:
|
|
1865
|
+
data: "5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500";
|
|
1867
1866
|
driverParam: string;
|
|
1868
1867
|
notNull: true;
|
|
1869
1868
|
hasDefault: false;
|
|
1870
1869
|
isPrimaryKey: false;
|
|
1871
1870
|
isAutoincrement: false;
|
|
1872
1871
|
hasRuntimeDefault: false;
|
|
1873
|
-
enumValues: [
|
|
1872
|
+
enumValues: ["5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500", ...("5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500")[]];
|
|
1874
1873
|
baseColumn: never;
|
|
1875
1874
|
identity: undefined;
|
|
1876
1875
|
generated: undefined;
|
|
@@ -2292,7 +2291,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2292
2291
|
expiresAt: Date | undefined;
|
|
2293
2292
|
number: string;
|
|
2294
2293
|
iban: string;
|
|
2295
|
-
bankCode:
|
|
2294
|
+
bankCode: "5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500";
|
|
2296
2295
|
connectorKey: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA";
|
|
2297
2296
|
status: "AUTHORIZED" | "DISABLED" | "EXPIRED";
|
|
2298
2297
|
bankRefId: string;
|
|
@@ -2334,7 +2333,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2334
2333
|
addPaymentsToBatch({ paymentsToBatch, }: {
|
|
2335
2334
|
paymentsToBatch: SendPaymentInput[];
|
|
2336
2335
|
}): Promise<IRPCResponse<{
|
|
2337
|
-
status: "
|
|
2336
|
+
status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | null;
|
|
2338
2337
|
id: string;
|
|
2339
2338
|
createdAt: Date | null;
|
|
2340
2339
|
updatedAt: Date | null;
|
package/dist/export/worker.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export { w as BankWorkflows } from '../shared/bank.ChAGzUFo.mjs';
|
|
2
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
3
2
|
import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
|
|
4
3
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
|
-
import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.
|
|
7
|
-
import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey } from '../shared/bank.
|
|
5
|
+
import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.CsvBtQib.mjs';
|
|
6
|
+
import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey } from '../shared/bank.DouutABZ.mjs';
|
|
8
7
|
import { z } from 'zod';
|
|
9
8
|
import * as drizzle_zod from 'drizzle-zod';
|
|
10
9
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
@@ -1539,21 +1538,21 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
1539
1538
|
}, z.core.$strip>;
|
|
1540
1539
|
filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
|
|
1541
1540
|
filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1541
|
+
PREPARED: "PREPARED";
|
|
1542
|
+
FAILED: "FAILED";
|
|
1543
|
+
COMPLETED: "COMPLETED";
|
|
1542
1544
|
OPEN: "OPEN";
|
|
1543
1545
|
PROCESSING: "PROCESSING";
|
|
1544
1546
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1545
1547
|
WAITING_FOR_PROCESSING: "WAITING_FOR_PROCESSING";
|
|
1548
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
1546
1549
|
PREPARED: "PREPARED";
|
|
1547
|
-
COMPLETED: "COMPLETED";
|
|
1548
1550
|
FAILED: "FAILED";
|
|
1549
|
-
|
|
1551
|
+
COMPLETED: "COMPLETED";
|
|
1550
1552
|
OPEN: "OPEN";
|
|
1551
1553
|
PROCESSING: "PROCESSING";
|
|
1552
1554
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1553
1555
|
WAITING_FOR_PROCESSING: "WAITING_FOR_PROCESSING";
|
|
1554
|
-
PREPARED: "PREPARED";
|
|
1555
|
-
COMPLETED: "COMPLETED";
|
|
1556
|
-
FAILED: "FAILED";
|
|
1557
1556
|
}>>]>>;
|
|
1558
1557
|
}, z.core.$strip>;
|
|
1559
1558
|
type GetBatchesInput = z.input<typeof getBatchesInputSchema>;
|
|
@@ -1582,9 +1581,9 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
1582
1581
|
limit: z.ZodNumber;
|
|
1583
1582
|
sort: z.ZodObject<{
|
|
1584
1583
|
column: z.ZodEnum<{
|
|
1584
|
+
amount: "amount";
|
|
1585
1585
|
createdAt: "createdAt";
|
|
1586
1586
|
updatedAt: "updatedAt";
|
|
1587
|
-
amount: "amount";
|
|
1588
1587
|
}>;
|
|
1589
1588
|
direction: z.ZodEnum<{
|
|
1590
1589
|
asc: "asc";
|
|
@@ -1713,17 +1712,17 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
1713
1712
|
filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
|
|
1714
1713
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1715
1714
|
PREPARED: "PREPARED";
|
|
1716
|
-
COMPLETED: "COMPLETED";
|
|
1717
|
-
FAILED: "FAILED";
|
|
1718
1715
|
INITIALIZED: "INITIALIZED";
|
|
1716
|
+
FAILED: "FAILED";
|
|
1719
1717
|
PENDING: "PENDING";
|
|
1718
|
+
COMPLETED: "COMPLETED";
|
|
1720
1719
|
CREATED: "CREATED";
|
|
1721
1720
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1722
1721
|
PREPARED: "PREPARED";
|
|
1723
|
-
COMPLETED: "COMPLETED";
|
|
1724
|
-
FAILED: "FAILED";
|
|
1725
1722
|
INITIALIZED: "INITIALIZED";
|
|
1723
|
+
FAILED: "FAILED";
|
|
1726
1724
|
PENDING: "PENDING";
|
|
1725
|
+
COMPLETED: "COMPLETED";
|
|
1727
1726
|
CREATED: "CREATED";
|
|
1728
1727
|
}>>]>>;
|
|
1729
1728
|
}, z.core.$strip>;
|
|
@@ -1863,14 +1862,14 @@ declare const updateAccountInputSchema: z.ZodObject<{
|
|
|
1863
1862
|
tableName: "account";
|
|
1864
1863
|
dataType: "string";
|
|
1865
1864
|
columnType: "SQLiteText";
|
|
1866
|
-
data:
|
|
1865
|
+
data: "5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500";
|
|
1867
1866
|
driverParam: string;
|
|
1868
1867
|
notNull: true;
|
|
1869
1868
|
hasDefault: false;
|
|
1870
1869
|
isPrimaryKey: false;
|
|
1871
1870
|
isAutoincrement: false;
|
|
1872
1871
|
hasRuntimeDefault: false;
|
|
1873
|
-
enumValues: [
|
|
1872
|
+
enumValues: ["5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500", ...("5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500")[]];
|
|
1874
1873
|
baseColumn: never;
|
|
1875
1874
|
identity: undefined;
|
|
1876
1875
|
generated: undefined;
|
|
@@ -2292,7 +2291,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2292
2291
|
expiresAt: Date | undefined;
|
|
2293
2292
|
number: string;
|
|
2294
2293
|
iban: string;
|
|
2295
|
-
bankCode:
|
|
2294
|
+
bankCode: "5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500";
|
|
2296
2295
|
connectorKey: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA";
|
|
2297
2296
|
status: "AUTHORIZED" | "DISABLED" | "EXPIRED";
|
|
2298
2297
|
bankRefId: string;
|
|
@@ -2334,7 +2333,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2334
2333
|
addPaymentsToBatch({ paymentsToBatch, }: {
|
|
2335
2334
|
paymentsToBatch: SendPaymentInput[];
|
|
2336
2335
|
}): Promise<IRPCResponse<{
|
|
2337
|
-
status: "
|
|
2336
|
+
status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | null;
|
|
2338
2337
|
id: string;
|
|
2339
2338
|
createdAt: Date | null;
|
|
2340
2339
|
updatedAt: Date | null;
|
package/dist/export/worker.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export { w as BankWorkflows } from '../shared/bank.ChAGzUFo.js';
|
|
2
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
3
2
|
import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
|
|
4
3
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
|
-
import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.
|
|
7
|
-
import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey } from '../shared/bank.
|
|
5
|
+
import { P as PaymentSelectType, B as BatchSelectType, t as tables, a as PaymentInsertType } from '../shared/bank.CsvBtQib.js';
|
|
6
|
+
import { A as AccountSelectType, C as ConfigEnvironmentBank, I as IBankConnector, a as ConnectorKey } from '../shared/bank.Ckn_klvT.js';
|
|
8
7
|
import { z } from 'zod';
|
|
9
8
|
import * as drizzle_zod from 'drizzle-zod';
|
|
10
9
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
@@ -1539,21 +1538,21 @@ declare const getBatchesInputSchema: z.ZodObject<{
|
|
|
1539
1538
|
}, z.core.$strip>;
|
|
1540
1539
|
filterBatchAccountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodArray<z.ZodUUID>]>>;
|
|
1541
1540
|
filterBatchStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1541
|
+
PREPARED: "PREPARED";
|
|
1542
|
+
FAILED: "FAILED";
|
|
1543
|
+
COMPLETED: "COMPLETED";
|
|
1542
1544
|
OPEN: "OPEN";
|
|
1543
1545
|
PROCESSING: "PROCESSING";
|
|
1544
1546
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1545
1547
|
WAITING_FOR_PROCESSING: "WAITING_FOR_PROCESSING";
|
|
1548
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
1546
1549
|
PREPARED: "PREPARED";
|
|
1547
|
-
COMPLETED: "COMPLETED";
|
|
1548
1550
|
FAILED: "FAILED";
|
|
1549
|
-
|
|
1551
|
+
COMPLETED: "COMPLETED";
|
|
1550
1552
|
OPEN: "OPEN";
|
|
1551
1553
|
PROCESSING: "PROCESSING";
|
|
1552
1554
|
READY_TO_SIGN: "READY_TO_SIGN";
|
|
1553
1555
|
WAITING_FOR_PROCESSING: "WAITING_FOR_PROCESSING";
|
|
1554
|
-
PREPARED: "PREPARED";
|
|
1555
|
-
COMPLETED: "COMPLETED";
|
|
1556
|
-
FAILED: "FAILED";
|
|
1557
1556
|
}>>]>>;
|
|
1558
1557
|
}, z.core.$strip>;
|
|
1559
1558
|
type GetBatchesInput = z.input<typeof getBatchesInputSchema>;
|
|
@@ -1582,9 +1581,9 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
1582
1581
|
limit: z.ZodNumber;
|
|
1583
1582
|
sort: z.ZodObject<{
|
|
1584
1583
|
column: z.ZodEnum<{
|
|
1584
|
+
amount: "amount";
|
|
1585
1585
|
createdAt: "createdAt";
|
|
1586
1586
|
updatedAt: "updatedAt";
|
|
1587
|
-
amount: "amount";
|
|
1588
1587
|
}>;
|
|
1589
1588
|
direction: z.ZodEnum<{
|
|
1590
1589
|
asc: "asc";
|
|
@@ -1713,17 +1712,17 @@ declare const getPaymentsInputSchema: z.ZodObject<{
|
|
|
1713
1712
|
filterPaymentDateTo: z.ZodOptional<z.ZodDate>;
|
|
1714
1713
|
filterPaymentStatus: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1715
1714
|
PREPARED: "PREPARED";
|
|
1716
|
-
COMPLETED: "COMPLETED";
|
|
1717
|
-
FAILED: "FAILED";
|
|
1718
1715
|
INITIALIZED: "INITIALIZED";
|
|
1716
|
+
FAILED: "FAILED";
|
|
1719
1717
|
PENDING: "PENDING";
|
|
1718
|
+
COMPLETED: "COMPLETED";
|
|
1720
1719
|
CREATED: "CREATED";
|
|
1721
1720
|
}>, z.ZodArray<z.ZodEnum<{
|
|
1722
1721
|
PREPARED: "PREPARED";
|
|
1723
|
-
COMPLETED: "COMPLETED";
|
|
1724
|
-
FAILED: "FAILED";
|
|
1725
1722
|
INITIALIZED: "INITIALIZED";
|
|
1723
|
+
FAILED: "FAILED";
|
|
1726
1724
|
PENDING: "PENDING";
|
|
1725
|
+
COMPLETED: "COMPLETED";
|
|
1727
1726
|
CREATED: "CREATED";
|
|
1728
1727
|
}>>]>>;
|
|
1729
1728
|
}, z.core.$strip>;
|
|
@@ -1863,14 +1862,14 @@ declare const updateAccountInputSchema: z.ZodObject<{
|
|
|
1863
1862
|
tableName: "account";
|
|
1864
1863
|
dataType: "string";
|
|
1865
1864
|
columnType: "SQLiteText";
|
|
1866
|
-
data:
|
|
1865
|
+
data: "5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500";
|
|
1867
1866
|
driverParam: string;
|
|
1868
1867
|
notNull: true;
|
|
1869
1868
|
hasDefault: false;
|
|
1870
1869
|
isPrimaryKey: false;
|
|
1871
1870
|
isAutoincrement: false;
|
|
1872
1871
|
hasRuntimeDefault: false;
|
|
1873
|
-
enumValues: [
|
|
1872
|
+
enumValues: ["5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500", ...("5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500")[]];
|
|
1874
1873
|
baseColumn: never;
|
|
1875
1874
|
identity: undefined;
|
|
1876
1875
|
generated: undefined;
|
|
@@ -2292,7 +2291,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2292
2291
|
expiresAt: Date | undefined;
|
|
2293
2292
|
number: string;
|
|
2294
2293
|
iban: string;
|
|
2295
|
-
bankCode:
|
|
2294
|
+
bankCode: "5051" | "0100" | "0300" | "0600" | "0710" | "0800" | "2010" | "2060" | "2070" | "2100" | "2200" | "2220" | "2250" | "2260" | "2600" | "2700" | "3030" | "3060" | "3500" | "4300" | "5500" | "5800" | "6000" | "6200" | "6210" | "6300" | "6363" | "6700" | "6800" | "7910" | "7950" | "7960" | "7970" | "7990" | "8030" | "8040" | "8060" | "8090" | "8150" | "8190" | "8198" | "8220" | "8250" | "8255" | "8265" | "8500";
|
|
2296
2295
|
connectorKey: "ERSTE" | "FINBRICKS" | "MOCK" | "CREDITAS" | "MOCK_COBS" | "FIO" | "MONETA";
|
|
2297
2296
|
status: "AUTHORIZED" | "DISABLED" | "EXPIRED";
|
|
2298
2297
|
bankRefId: string;
|
|
@@ -2334,7 +2333,7 @@ declare class BankServiceBase extends BankServiceBase_base {
|
|
|
2334
2333
|
addPaymentsToBatch({ paymentsToBatch, }: {
|
|
2335
2334
|
paymentsToBatch: SendPaymentInput[];
|
|
2336
2335
|
}): Promise<IRPCResponse<{
|
|
2337
|
-
status: "
|
|
2336
|
+
status: "PREPARED" | "FAILED" | "COMPLETED" | "OPEN" | "PROCESSING" | "READY_TO_SIGN" | "WAITING_FOR_PROCESSING" | null;
|
|
2338
2337
|
id: string;
|
|
2339
2338
|
createdAt: Date | null;
|
|
2340
2339
|
updatedAt: Date | null;
|
package/dist/export/worker.mjs
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { g as getPaymentsByBankRefIdsQuery, u as updatePaymentCommand, c as createPaymentCommand, a as updateAccountLastSyncCommand, b as getCredentialsByAccountId, i as initiateConnector } from '../shared/bank.JtGSu6eH.mjs';
|
|
2
|
-
export { w as BankWorkflows } from '../shared/bank.JtGSu6eH.mjs';
|
|
3
1
|
import { uuidv4, bankAccountMetadataSchema, workflowInstanceStatusSchema, develitWorker, createInternalError, first, action, service } from '@develit-io/backend-sdk';
|
|
4
2
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
3
|
import { drizzle } from 'drizzle-orm/d1';
|
|
6
|
-
import { t as tables, c as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, P as PAYMENT_TYPES, g as CONNECTOR_KEYS, B as BATCH_STATUSES, d as PAYMENT_STATUSES, e as PAYMENT_DIRECTIONS, i as accountInsertSchema, v as getPaymentDirection, M as MockConnector, F as FinbricksConnector, E as ErsteConnector } from '../shared/bank.
|
|
4
|
+
import { t as tables, c as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, P as PAYMENT_TYPES, g as CONNECTOR_KEYS, B as BATCH_STATUSES, d as PAYMENT_STATUSES, e as PAYMENT_DIRECTIONS, i as accountInsertSchema, v as getPaymentDirection, M as MockConnector, F as FinbricksConnector, E as ErsteConnector } from '../shared/bank.W4h6Dlzi.mjs';
|
|
7
5
|
import 'jose';
|
|
8
6
|
import { CURRENCY_CODES } from '@develit-io/general-codes';
|
|
9
7
|
import { z } from 'zod';
|
|
8
|
+
import { a as getPaymentsByBankRefIdsQuery, u as updatePaymentCommand, c as createPaymentCommand, b as updateAccountLastSyncCommand, g as getCredentialsByAccountId, i as initiateConnector } from '../shared/bank.DTdKHhGd.mjs';
|
|
10
9
|
import { eq, inArray, and, sql, asc, desc, gte, lte } from 'drizzle-orm';
|
|
11
|
-
import 'cloudflare:workflows';
|
|
12
|
-
import '../shared/bank.D2ZeOkyc.mjs';
|
|
13
10
|
import 'drizzle-orm/sqlite-core';
|
|
14
11
|
import 'date-fns';
|
|
15
12
|
import 'drizzle-zod';
|
|
16
13
|
import 'drizzle-orm/relations';
|
|
14
|
+
import '../shared/bank.BvXwHpBp.mjs';
|
|
17
15
|
|
|
18
16
|
const upsertAccountCommand = (db, { account }) => {
|
|
19
17
|
const id = account.id || uuidv4();
|