@develit-services/bank 1.1.4 → 1.1.7
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 +3 -3
- package/dist/export/worker.d.cts +322 -243
- package/dist/export/worker.d.mts +322 -243
- package/dist/export/worker.d.ts +322 -243
- package/dist/export/worker.mjs +3 -3
- package/dist/export/workflows.cjs +4 -4
- package/dist/export/workflows.mjs +4 -4
- package/dist/shared/{bank.DtYQpNaw.mjs → bank.B5s4U2l_.mjs} +20 -10
- package/dist/shared/{bank.BZgBHNO2.cjs → bank.BA7TdO2v.cjs} +1 -1
- package/dist/shared/{bank.BdXRtxv4.cjs → bank.BgSk2k9D.cjs} +19 -9
- package/dist/shared/{bank.PgwVTzWA.mjs → bank.Bv1uIGoZ.mjs} +1 -1
- package/dist/shared/{bank.Du_eLi7g.cjs → bank.CKtCVDQI.cjs} +5 -3
- package/dist/shared/{bank._cKBU-qa.d.cts → bank.DCFpapec.d.cts} +1 -1
- package/dist/shared/{bank.B2q-mVzl.mjs → bank.DW4baqPr.mjs} +5 -3
- package/dist/shared/{bank.CxL32wdh.d.cts → bank.DffXtMaE.d.cts} +530 -293
- package/dist/shared/{bank.CxL32wdh.d.mts → bank.DffXtMaE.d.mts} +530 -293
- package/dist/shared/{bank.CxL32wdh.d.ts → bank.DffXtMaE.d.ts} +530 -293
- package/dist/shared/{bank.Bp4Ss72q.d.ts → bank.GB5jJbtl.d.ts} +1 -1
- package/dist/shared/{bank.BP_yYGTT.d.mts → bank.okndj9_R.d.mts} +1 -1
- package/dist/types.cjs +2 -2
- package/dist/types.d.cts +4 -4
- package/dist/types.d.mts +4 -4
- package/dist/types.d.ts +4 -4
- package/dist/types.mjs +2 -2
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { first, uuidv4, asNonEmpty } from '@develit-io/backend-sdk';
|
|
2
|
-
import { v as tables, o as isPaymentCompleted } from '../shared/bank.
|
|
2
|
+
import { v as tables, o as isPaymentCompleted } from '../shared/bank.B5s4U2l_.mjs';
|
|
3
3
|
import { i as isBatchAuthorized, b as isBatchFailed, d as isBatchProcessing } from '../shared/bank.XqSw509X.mjs';
|
|
4
|
-
import { e as toBatchedPaymentFromPaymentRequest, i as toPreparedPayment, j as initiateConnector } from '../shared/bank.
|
|
4
|
+
import { e as toBatchedPaymentFromPaymentRequest, i as toPreparedPayment, j as initiateConnector } from '../shared/bank.DW4baqPr.mjs';
|
|
5
5
|
import { eq, and, inArray } from 'drizzle-orm';
|
|
6
|
-
import { g as getBatchByIdQuery, a as getPaymentRequestsByBatchIdQuery, c as checksum, u as upsertBatchCommand, b as getAccountByIdQuery, d as createCredentialsResolver, e as updatePaymentRequestStatusCommand, f as createPaymentCommand } from '../shared/bank.
|
|
6
|
+
import { g as getBatchByIdQuery, a as getPaymentRequestsByBatchIdQuery, c as checksum, u as upsertBatchCommand, b as getAccountByIdQuery, d as createCredentialsResolver, e as updatePaymentRequestStatusCommand, f as createPaymentCommand } from '../shared/bank.Bv1uIGoZ.mjs';
|
|
7
7
|
import { WorkflowEntrypoint } from 'cloudflare:workers';
|
|
8
8
|
import { NonRetryableError } from 'cloudflare:workflows';
|
|
9
9
|
import { drizzle } from 'drizzle-orm/d1';
|
|
@@ -314,7 +314,7 @@ class BankSyncAccountPayments extends WorkflowEntrypoint {
|
|
|
314
314
|
"fetch bank payments",
|
|
315
315
|
{
|
|
316
316
|
retries: { limit: 5, delay: 2e3, backoff: "constant" },
|
|
317
|
-
timeout: "
|
|
317
|
+
timeout: "60 seconds"
|
|
318
318
|
},
|
|
319
319
|
async () => {
|
|
320
320
|
try {
|
|
@@ -2,7 +2,7 @@ import { bankAccount, base, structuredAddressSchema } from '@develit-io/backend-
|
|
|
2
2
|
import { sqliteTable, text, integer, unique, real, index } from 'drizzle-orm/sqlite-core';
|
|
3
3
|
import 'date-fns';
|
|
4
4
|
import 'jose';
|
|
5
|
-
import { COUNTRY_CODES_2, BANK_CODES } from '@develit-io/general-codes';
|
|
5
|
+
import { COUNTRY_CODES_2, BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
6
6
|
import { relations } from 'drizzle-orm/relations';
|
|
7
7
|
import { and, not, inArray, isNull } from 'drizzle-orm';
|
|
8
8
|
import 'node:crypto';
|
|
@@ -124,7 +124,7 @@ const account = sqliteTable(
|
|
|
124
124
|
(t) => [unique().on(t.iban)]
|
|
125
125
|
);
|
|
126
126
|
|
|
127
|
-
const
|
|
127
|
+
const baseOverrides = {
|
|
128
128
|
id: z.string(),
|
|
129
129
|
createdBy: z.string().nullable().optional(),
|
|
130
130
|
updatedBy: z.string().nullable().optional(),
|
|
@@ -133,9 +133,11 @@ const textColumnOverrides = {
|
|
|
133
133
|
number: z.string(),
|
|
134
134
|
name: z.string().nullable().optional(),
|
|
135
135
|
iban: z.string(),
|
|
136
|
-
bankCode: z.
|
|
137
|
-
connectorKey: z.
|
|
138
|
-
status: z.
|
|
136
|
+
bankCode: z.enum(BANK_CODES),
|
|
137
|
+
connectorKey: z.enum(CONNECTOR_KEYS),
|
|
138
|
+
status: z.enum(ACCOUNT_STATUSES),
|
|
139
|
+
countryCode: z.enum(COUNTRY_CODES),
|
|
140
|
+
currency: z.enum(CURRENCY_CODES),
|
|
139
141
|
bankRefId: z.string(),
|
|
140
142
|
swiftBic: z.string().nullable().optional(),
|
|
141
143
|
bicCor: z.string().nullable().optional(),
|
|
@@ -143,12 +145,20 @@ const textColumnOverrides = {
|
|
|
143
145
|
sortCode: z.string().nullable().optional(),
|
|
144
146
|
clabe: z.string().nullable().optional(),
|
|
145
147
|
bsb: z.string().nullable().optional(),
|
|
146
|
-
brBankNumber: z.string().nullable().optional()
|
|
147
|
-
address: structuredAddressSchema.nullable().optional()
|
|
148
|
+
brBankNumber: z.string().nullable().optional()
|
|
148
149
|
};
|
|
149
|
-
const accountInsertSchema = createInsertSchema(account).extend(
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
const accountInsertSchema = createInsertSchema(account).extend({
|
|
151
|
+
...baseOverrides,
|
|
152
|
+
address: structuredAddressSchema.nullable().optional()
|
|
153
|
+
});
|
|
154
|
+
const accountUpdateSchema = createUpdateSchema(account).extend({
|
|
155
|
+
...baseOverrides,
|
|
156
|
+
address: structuredAddressSchema.nullable().optional()
|
|
157
|
+
});
|
|
158
|
+
const accountSelectSchema = createSelectSchema(account).extend({
|
|
159
|
+
...baseOverrides,
|
|
160
|
+
address: structuredAddressSchema.nullable()
|
|
161
|
+
});
|
|
152
162
|
|
|
153
163
|
const accountCredentials = sqliteTable("account_credentials", {
|
|
154
164
|
...base,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const drizzleOrm = require('drizzle-orm');
|
|
4
|
-
const database_schema = require('./bank.
|
|
4
|
+
const database_schema = require('./bank.BgSk2k9D.cjs');
|
|
5
5
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
6
6
|
require('date-fns');
|
|
7
7
|
require('jose');
|
|
@@ -126,7 +126,7 @@ const account = sqliteCore.sqliteTable(
|
|
|
126
126
|
(t) => [sqliteCore.unique().on(t.iban)]
|
|
127
127
|
);
|
|
128
128
|
|
|
129
|
-
const
|
|
129
|
+
const baseOverrides = {
|
|
130
130
|
id: zod.z.string(),
|
|
131
131
|
createdBy: zod.z.string().nullable().optional(),
|
|
132
132
|
updatedBy: zod.z.string().nullable().optional(),
|
|
@@ -135,9 +135,11 @@ const textColumnOverrides = {
|
|
|
135
135
|
number: zod.z.string(),
|
|
136
136
|
name: zod.z.string().nullable().optional(),
|
|
137
137
|
iban: zod.z.string(),
|
|
138
|
-
bankCode: zod.z.
|
|
139
|
-
connectorKey: zod.z.
|
|
140
|
-
status: zod.z.
|
|
138
|
+
bankCode: zod.z.enum(generalCodes.BANK_CODES),
|
|
139
|
+
connectorKey: zod.z.enum(CONNECTOR_KEYS),
|
|
140
|
+
status: zod.z.enum(ACCOUNT_STATUSES),
|
|
141
|
+
countryCode: zod.z.enum(COUNTRY_CODES),
|
|
142
|
+
currency: zod.z.enum(generalCodes.CURRENCY_CODES),
|
|
141
143
|
bankRefId: zod.z.string(),
|
|
142
144
|
swiftBic: zod.z.string().nullable().optional(),
|
|
143
145
|
bicCor: zod.z.string().nullable().optional(),
|
|
@@ -145,12 +147,20 @@ const textColumnOverrides = {
|
|
|
145
147
|
sortCode: zod.z.string().nullable().optional(),
|
|
146
148
|
clabe: zod.z.string().nullable().optional(),
|
|
147
149
|
bsb: zod.z.string().nullable().optional(),
|
|
148
|
-
brBankNumber: zod.z.string().nullable().optional()
|
|
149
|
-
address: backendSdk.structuredAddressSchema.nullable().optional()
|
|
150
|
+
brBankNumber: zod.z.string().nullable().optional()
|
|
150
151
|
};
|
|
151
|
-
const accountInsertSchema = drizzleZod.createInsertSchema(account).extend(
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
const accountInsertSchema = drizzleZod.createInsertSchema(account).extend({
|
|
153
|
+
...baseOverrides,
|
|
154
|
+
address: backendSdk.structuredAddressSchema.nullable().optional()
|
|
155
|
+
});
|
|
156
|
+
const accountUpdateSchema = drizzleZod.createUpdateSchema(account).extend({
|
|
157
|
+
...baseOverrides,
|
|
158
|
+
address: backendSdk.structuredAddressSchema.nullable().optional()
|
|
159
|
+
});
|
|
160
|
+
const accountSelectSchema = drizzleZod.createSelectSchema(account).extend({
|
|
161
|
+
...baseOverrides,
|
|
162
|
+
address: backendSdk.structuredAddressSchema.nullable()
|
|
163
|
+
});
|
|
154
164
|
|
|
155
165
|
const accountCredentials = sqliteCore.sqliteTable("account_credentials", {
|
|
156
166
|
...backendSdk.base,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
4
|
const dateFns = require('date-fns');
|
|
5
5
|
const generalCodes = require('@develit-io/general-codes');
|
|
6
|
-
require('./bank.
|
|
6
|
+
require('./bank.BgSk2k9D.cjs');
|
|
7
7
|
require('drizzle-orm');
|
|
8
8
|
const jose = require('jose');
|
|
9
9
|
require('node:crypto');
|
|
@@ -1674,6 +1674,8 @@ class DbuConnector extends IBankConnector {
|
|
|
1674
1674
|
filter
|
|
1675
1675
|
}) {
|
|
1676
1676
|
try {
|
|
1677
|
+
const dateFrom = dateFns.format(filter.dateFrom, "yyyy-MM-dd");
|
|
1678
|
+
const dateTo = dateFns.format(filter.dateTo || /* @__PURE__ */ new Date(), "yyyy-MM-dd");
|
|
1677
1679
|
const allPayments = [];
|
|
1678
1680
|
let offset = 0;
|
|
1679
1681
|
const limit = 10;
|
|
@@ -1691,8 +1693,8 @@ class DbuConnector extends IBankConnector {
|
|
|
1691
1693
|
// 'filter.mainAccount': account.number!,
|
|
1692
1694
|
// Date filtering
|
|
1693
1695
|
"filter.idAccount": account.bankRefId,
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
+
"filter.validFromStart": dateFrom,
|
|
1697
|
+
"filter.validFromEnd": dateTo,
|
|
1696
1698
|
// Pagination parameters
|
|
1697
1699
|
offset: offset.toString(),
|
|
1698
1700
|
limit: limit.toString()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as CurrencyCode, O as BankCode, $ as CountryCode, P as PaymentRequestSelectType } from './bank.
|
|
1
|
+
import { d as CurrencyCode, O as BankCode, $ as CountryCode, P as PaymentRequestSelectType } from './bank.DffXtMaE.cjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { uuidv4, createInternalError, useResult } from '@develit-io/backend-sdk';
|
|
2
2
|
import { format, parseISO } from 'date-fns';
|
|
3
3
|
import { CURRENCY_CODES } from '@develit-io/general-codes';
|
|
4
|
-
import './bank.
|
|
4
|
+
import './bank.B5s4U2l_.mjs';
|
|
5
5
|
import 'drizzle-orm';
|
|
6
6
|
import { importPKCS8, SignJWT } from 'jose';
|
|
7
7
|
import 'node:crypto';
|
|
@@ -1672,6 +1672,8 @@ class DbuConnector extends IBankConnector {
|
|
|
1672
1672
|
filter
|
|
1673
1673
|
}) {
|
|
1674
1674
|
try {
|
|
1675
|
+
const dateFrom = format(filter.dateFrom, "yyyy-MM-dd");
|
|
1676
|
+
const dateTo = format(filter.dateTo || /* @__PURE__ */ new Date(), "yyyy-MM-dd");
|
|
1675
1677
|
const allPayments = [];
|
|
1676
1678
|
let offset = 0;
|
|
1677
1679
|
const limit = 10;
|
|
@@ -1689,8 +1691,8 @@ class DbuConnector extends IBankConnector {
|
|
|
1689
1691
|
// 'filter.mainAccount': account.number!,
|
|
1690
1692
|
// Date filtering
|
|
1691
1693
|
"filter.idAccount": account.bankRefId,
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
+
"filter.validFromStart": dateFrom,
|
|
1695
|
+
"filter.validFromEnd": dateTo,
|
|
1694
1696
|
// Pagination parameters
|
|
1695
1697
|
offset: offset.toString(),
|
|
1696
1698
|
limit: limit.toString()
|