@duvdu-v1/duvdu 1.1.58 → 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;
@@ -47,7 +47,6 @@ const userSchema = new mongoose_1.Schema({
47
47
  ret.coverImage = process.env.BUCKET_HOST + '/' + ret.coverImage;
48
48
  if (ret.profileImage)
49
49
  ret.profileImage = process.env.BUCKET_HOST + '/' + ret.profileImage;
50
- return ret;
51
50
  },
52
51
  },
53
52
  }).index({ name: 'text' });
@@ -42,7 +42,6 @@ exports.PortfolioPosts = (0, mongoose_1.model)(model_names_1.MODELS.portfolioPos
42
42
  ret.cover = process.env.BUCKET_HOST + '/' + ret.cover;
43
43
  if (ret.attachments)
44
44
  ret.attachments = ret.attachments.map((el) => process.env.BUCKET_HOST + '/' + el);
45
- return ret;
46
45
  },
47
46
  }
48
47
  })
@@ -71,7 +71,6 @@ exports.ProducerBooking = (0, mongoose_1.model)(model_names_1.MODELS.producerBoo
71
71
  transform(doc, ret) {
72
72
  if (ret.attachments)
73
73
  ret.attachments = ret.attachments.map((el) => process.env.BUCKET_HOST + '/' + el);
74
- return ret;
75
74
  },
76
75
  } }));
77
76
  exports.Producer = (0, mongoose_1.model)(model_names_1.MODELS.producer, new mongoose_1.Schema({
@@ -35,7 +35,6 @@ exports.Report = (0, mongoose_1.model)(model_names_1.MODELS.report, new mongoose
35
35
  transform(doc, ret) {
36
36
  if (ret.attachments)
37
37
  ret.attachments = ret.attachments.map((el) => process.env.BUCKET_HOST + '/' + el);
38
- return ret;
39
38
  },
40
39
  },
41
40
  }));
@@ -79,7 +79,6 @@ exports.studioBooking = (0, mongoose_1.model)(model_names_1.MODELS.studioBooking
79
79
  ret.cover = process.env.BUCKET_HOST + '/' + ret.cover;
80
80
  if (ret.attachments)
81
81
  ret.attachments = ret.attachments.map((el) => process.env.BUCKET_HOST + '/' + el);
82
- return ret;
83
82
  },
84
83
  }
85
84
  }));
@@ -106,7 +106,6 @@ exports.TeamProject = (0, mongoose_1.model)(model_names_1.MODELS.teamProject, ne
106
106
  ret.cover = process.env.BUCKET_HOST + '/' + ret.cover;
107
107
  if (ret.attachments)
108
108
  ret.attachments = ret.attachments.map((el) => process.env.BUCKET_HOST + '/' + el);
109
- return ret;
110
109
  },
111
110
  }
112
111
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.58",
3
+ "version": "1.1.60",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [