@duvdu-v1/duvdu 1.1.59 → 1.1.60
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,5 +1,5 @@
|
|
|
1
1
|
import RedisStore from 'connect-redis';
|
|
2
|
-
export declare const redisConnection: (url: string, password: string) => import("@redis/client").RedisClientType<{
|
|
2
|
+
export declare const redisConnection: (url: string, password: string) => Promise<import("@redis/client").RedisClientType<{
|
|
3
3
|
graph: {
|
|
4
4
|
CONFIG_GET: typeof import("@redis/graph/dist/commands/CONFIG_GET");
|
|
5
5
|
configGet: typeof import("@redis/graph/dist/commands/CONFIG_GET");
|
|
@@ -288,5 +288,5 @@ export declare const redisConnection: (url: string, password: string) => import(
|
|
|
288
288
|
RESERVE: typeof import("@redis/bloom/dist/commands/top-k/RESERVE");
|
|
289
289
|
reserve: typeof import("@redis/bloom/dist/commands/top-k/RESERVE");
|
|
290
290
|
};
|
|
291
|
-
} & import("redis").RedisModules, import("redis").RedisFunctions, import("redis").RedisScripts
|
|
291
|
+
} & import("redis").RedisModules, import("redis").RedisFunctions, import("redis").RedisScripts>>;
|
|
292
292
|
export declare const sessionStore: (url: string, password: string) => RedisStore;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
13
|
};
|
|
@@ -7,16 +16,16 @@ exports.sessionStore = exports.redisConnection = void 0;
|
|
|
7
16
|
const connect_redis_1 = __importDefault(require("connect-redis"));
|
|
8
17
|
const redis_1 = require("redis");
|
|
9
18
|
const data_base_connections_1 = require("../errors/data-base-connections");
|
|
10
|
-
const redisConnection = (url, password) => {
|
|
19
|
+
const redisConnection = (url, password) => __awaiter(void 0, void 0, void 0, function* () {
|
|
11
20
|
const client = (0, redis_1.createClient)({ url, password });
|
|
12
|
-
client
|
|
21
|
+
yield client
|
|
13
22
|
.connect()
|
|
14
23
|
.then(() => console.log(`redis connected in : ${url}`))
|
|
15
24
|
.catch(() => {
|
|
16
25
|
throw new data_base_connections_1.DatabaseConnectionError(`cannot connect to redis : ${url}`);
|
|
17
26
|
});
|
|
18
27
|
return client;
|
|
19
|
-
};
|
|
28
|
+
});
|
|
20
29
|
exports.redisConnection = redisConnection;
|
|
21
30
|
const sessionStore = (url, password) => new connect_redis_1.default({ client: (0, exports.redisConnection)(url, password) });
|
|
22
31
|
exports.sessionStore = sessionStore;
|