@duvdu-v1/duvdu 1.1.29 → 1.1.30

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.
@@ -1,29 +1,9 @@
1
1
  "use strict";
2
- // import RedisStore from 'connect-redis';
3
- // import { createClient } from 'redis';
4
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
5
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
6
4
  };
7
5
  Object.defineProperty(exports, "__esModule", { value: true });
8
6
  exports.sessionStore = exports.redisConnection = void 0;
9
- // import { DatabaseConnectionError } from '../errors/data-base-connections';
10
- // export const redisConnection = (url: string , password:string , port:number) => {
11
- // const client = createClient({
12
- // password,
13
- // socket:{
14
- // host:url,
15
- // port
16
- // }
17
- // });
18
- // client
19
- // .connect()
20
- // .then(() => console.log(`redis connected in : ${url}`))
21
- // .catch(() => {
22
- // throw new DatabaseConnectionError(`cannot connect to redis : ${url}`);
23
- // });
24
- // return client;
25
- // };
26
- // export const sessionStore = (url: string , password:string , port:number) => new RedisStore({ client: redisConnection(url, password , port) });
27
7
  const connect_redis_1 = __importDefault(require("connect-redis"));
28
8
  const redis_1 = require("redis");
29
9
  const data_base_connections_1 = require("../errors/data-base-connections");
@@ -32,21 +12,17 @@ const redisConnection = (url, password, port) => {
32
12
  password,
33
13
  socket: {
34
14
  host: url,
35
- port,
15
+ port
36
16
  }
37
17
  });
38
- client.on('connect', () => {
39
- console.log(`Redis connected to ${url}:${port}`);
40
- });
41
- client.on('error', (err) => {
42
- console.error(`Redis connection error: ${err}`);
43
- throw new data_base_connections_1.DatabaseConnectionError(`Cannot connect to Redis: ${err}`);
18
+ client
19
+ .connect()
20
+ .then(() => console.log(`redis connected in : ${url}`))
21
+ .catch(() => {
22
+ throw new data_base_connections_1.DatabaseConnectionError(`cannot connect to redis : ${url}`);
44
23
  });
45
24
  return client;
46
25
  };
47
26
  exports.redisConnection = redisConnection;
48
- const sessionStore = (url, password, port) => {
49
- const client = (0, exports.redisConnection)(url, password, port);
50
- return new connect_redis_1.default({ client });
51
- };
27
+ const sessionStore = (url, password, port) => new connect_redis_1.default({ client: (0, exports.redisConnection)(url, password, port) });
52
28
  exports.sessionStore = sessionStore;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.29",
3
+ "version": "1.1.30",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [