@develit-services/bank 0.0.21 → 0.0.23
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/export/worker.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
6
|
-
const db = require('../shared/bank.
|
|
6
|
+
const db = require('../shared/bank.Ql9pV2Nn.cjs');
|
|
7
7
|
const cloudflare_workers = require('cloudflare:workers');
|
|
8
8
|
const d1 = require('drizzle-orm/d1');
|
|
9
9
|
const zod = require('zod');
|
package/dist/export/worker.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { uuidv4, useResult, createInternalError, develitWorker, first, RPCResponse, action, service } from '@develit-io/backend-sdk';
|
|
2
|
-
import { P as PAYMENT_TYPES, t as tables, F as FinbricksConnector, M as MockConnector, a as MockCobsConnector, E as ErsteConnector, g as getPaymentDirection } from '../shared/bank.
|
|
2
|
+
import { P as PAYMENT_TYPES, t as tables, F as FinbricksConnector, M as MockConnector, a as MockCobsConnector, E as ErsteConnector, g as getPaymentDirection } from '../shared/bank.C_0Iw0vw.mjs';
|
|
3
3
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
4
4
|
import { drizzle } from 'drizzle-orm/d1';
|
|
5
5
|
import { z } from 'zod';
|
|
@@ -276,13 +276,19 @@ class FinbricksConnector extends IBankConnector {
|
|
|
276
276
|
}
|
|
277
277
|
async getClientIds() {
|
|
278
278
|
let saved = await this.kv.get(this.storageKey);
|
|
279
|
+
console.log("storage key", this.storageKey);
|
|
280
|
+
console.log("saved ids", saved);
|
|
279
281
|
if (!saved) {
|
|
282
|
+
console.log("not saved", true);
|
|
280
283
|
const empty = Object.fromEntries(CONNECTOR_KEYS.map((v) => [v, ""]));
|
|
281
284
|
empty["FIO"] = "d32a83cf-d352-41f3-96d7-4d2961336ddc";
|
|
285
|
+
console.log("empty", empty);
|
|
282
286
|
await this.kv.put(this.storageKey, JSON.stringify(empty));
|
|
283
287
|
saved = JSON.stringify(empty);
|
|
284
288
|
}
|
|
289
|
+
console.log("saved ids after", saved);
|
|
285
290
|
this._clientIds = JSON.parse(saved);
|
|
291
|
+
console.log("client ids", this._clientIds);
|
|
286
292
|
return this._clientIds;
|
|
287
293
|
}
|
|
288
294
|
async setClientIds(value) {
|
|
@@ -467,6 +473,9 @@ class FinbricksConnector extends IBankConnector {
|
|
|
467
473
|
let cursor = null;
|
|
468
474
|
const allPayments = [];
|
|
469
475
|
const fetchTransactions = async (cursor2) => {
|
|
476
|
+
console.log("provider", this.PROVIDER);
|
|
477
|
+
console.log("clientids", this._clientIds);
|
|
478
|
+
console.log("clientid", this._clientIds[this.PROVIDER]);
|
|
470
479
|
console.log({
|
|
471
480
|
method: "GET",
|
|
472
481
|
endpoint: FINBRICKS_ENDPOINTS.ACCOUNT_TRANSACTIONS,
|
|
@@ -488,7 +497,9 @@ class FinbricksConnector extends IBankConnector {
|
|
|
488
497
|
endpoint: FINBRICKS_ENDPOINTS.ACCOUNT_TRANSACTIONS,
|
|
489
498
|
query: {
|
|
490
499
|
merchantId: this.finbricks.MERCHANT_ID,
|
|
491
|
-
|
|
500
|
+
// TODO: Desperate times require desperate solution. Don't forget to remove this.
|
|
501
|
+
clientId: "d32a83cf-d352-41f3-96d7-4d2961336ddc",
|
|
502
|
+
// clientId: this._clientIds[this.PROVIDER],
|
|
492
503
|
paymentProvider: this.PROVIDER,
|
|
493
504
|
bankAccountId: account.identification.number,
|
|
494
505
|
dateFrom,
|
|
@@ -278,13 +278,19 @@ class FinbricksConnector extends IBankConnector {
|
|
|
278
278
|
}
|
|
279
279
|
async getClientIds() {
|
|
280
280
|
let saved = await this.kv.get(this.storageKey);
|
|
281
|
+
console.log("storage key", this.storageKey);
|
|
282
|
+
console.log("saved ids", saved);
|
|
281
283
|
if (!saved) {
|
|
284
|
+
console.log("not saved", true);
|
|
282
285
|
const empty = Object.fromEntries(database_schema.CONNECTOR_KEYS.map((v) => [v, ""]));
|
|
283
286
|
empty["FIO"] = "d32a83cf-d352-41f3-96d7-4d2961336ddc";
|
|
287
|
+
console.log("empty", empty);
|
|
284
288
|
await this.kv.put(this.storageKey, JSON.stringify(empty));
|
|
285
289
|
saved = JSON.stringify(empty);
|
|
286
290
|
}
|
|
291
|
+
console.log("saved ids after", saved);
|
|
287
292
|
this._clientIds = JSON.parse(saved);
|
|
293
|
+
console.log("client ids", this._clientIds);
|
|
288
294
|
return this._clientIds;
|
|
289
295
|
}
|
|
290
296
|
async setClientIds(value) {
|
|
@@ -469,6 +475,9 @@ class FinbricksConnector extends IBankConnector {
|
|
|
469
475
|
let cursor = null;
|
|
470
476
|
const allPayments = [];
|
|
471
477
|
const fetchTransactions = async (cursor2) => {
|
|
478
|
+
console.log("provider", this.PROVIDER);
|
|
479
|
+
console.log("clientids", this._clientIds);
|
|
480
|
+
console.log("clientid", this._clientIds[this.PROVIDER]);
|
|
472
481
|
console.log({
|
|
473
482
|
method: "GET",
|
|
474
483
|
endpoint: FINBRICKS_ENDPOINTS.ACCOUNT_TRANSACTIONS,
|
|
@@ -490,7 +499,9 @@ class FinbricksConnector extends IBankConnector {
|
|
|
490
499
|
endpoint: FINBRICKS_ENDPOINTS.ACCOUNT_TRANSACTIONS,
|
|
491
500
|
query: {
|
|
492
501
|
merchantId: this.finbricks.MERCHANT_ID,
|
|
493
|
-
|
|
502
|
+
// TODO: Desperate times require desperate solution. Don't forget to remove this.
|
|
503
|
+
clientId: "d32a83cf-d352-41f3-96d7-4d2961336ddc",
|
|
504
|
+
// clientId: this._clientIds[this.PROVIDER],
|
|
494
505
|
paymentProvider: this.PROVIDER,
|
|
495
506
|
bankAccountId: account.identification.number,
|
|
496
507
|
dateFrom,
|
package/dist/types.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const db = require('./shared/bank.
|
|
3
|
+
const db = require('./shared/bank.Ql9pV2Nn.cjs');
|
|
4
4
|
const database_schema = require('./shared/bank.P9gDUycr.cjs');
|
|
5
5
|
const generalCodes = require('@develit-io/general-codes');
|
|
6
6
|
require('@develit-io/backend-sdk');
|
package/dist/types.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BATCH_STATUES, B as BATCH_STATUSES, C as COUNTRY_CODES, E as ErsteConnector, c as FINBRICKS_ENDPOINTS, b as FinbricksClient, F as FinbricksConnector, I as IBankConnector, a as MockCobsConnector, M as MockConnector, e as PAYMENT_DIRECTIONS, d as PAYMENT_STATUSES, P as PAYMENT_TYPES, p as paymentInsertTypeZod, s as signFinbricksJws, u as useFinbricksFetch } from './shared/bank.
|
|
1
|
+
export { B as BATCH_STATUES, B as BATCH_STATUSES, C as COUNTRY_CODES, E as ErsteConnector, c as FINBRICKS_ENDPOINTS, b as FinbricksClient, F as FinbricksConnector, I as IBankConnector, a as MockCobsConnector, M as MockConnector, e as PAYMENT_DIRECTIONS, d as PAYMENT_STATUSES, P as PAYMENT_TYPES, p as paymentInsertTypeZod, s as signFinbricksJws, u as useFinbricksFetch } from './shared/bank.C_0Iw0vw.mjs';
|
|
2
2
|
export { C as CONNECTOR_KEYS, T as TOKEN_TYPES } from './shared/bank.C9jAvwna.mjs';
|
|
3
3
|
export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
4
4
|
import '@develit-io/backend-sdk';
|