namirasoft-node-redis 1.4.27 → 1.4.28

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,6 +1,12 @@
1
1
  import * as Redis from "ioredis";
2
- export declare abstract class RedisInstance {
2
+ import { IDatabase } from "namirasoft-node";
3
+ export declare abstract class RedisInstance implements IDatabase {
3
4
  client: Redis.Redis;
4
5
  constructor(host: string, port: number, password: string, db?: number);
6
+ init(): Promise<void>;
7
+ connect(): Promise<void>;
8
+ seedBefore(): Promise<void>;
9
+ seedAfter(): Promise<void>;
10
+ sync(): Promise<void>;
5
11
  disconnect(): void;
6
12
  }
@@ -32,6 +32,15 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
35
44
  Object.defineProperty(exports, "__esModule", { value: true });
36
45
  exports.RedisInstance = void 0;
37
46
  const Redis = __importStar(require("ioredis"));
@@ -44,6 +53,26 @@ class RedisInstance {
44
53
  (_a = namirasoft_log_1.Logger.main) === null || _a === void 0 ? void 0 : _a.success(`Redis was connected to: ${host}:${port}`);
45
54
  this.disconnect = this.disconnect.bind(this);
46
55
  }
56
+ init() {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ });
59
+ }
60
+ connect() {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ });
63
+ }
64
+ seedBefore() {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ });
67
+ }
68
+ seedAfter() {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ });
71
+ }
72
+ sync() {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ });
75
+ }
47
76
  disconnect() {
48
77
  var _a;
49
78
  (_a = this.client) === null || _a === void 0 ? void 0 : _a.disconnect();
@@ -1 +1 @@
1
- {"version":3,"file":"RedisInstance.js","sourceRoot":"","sources":["../src/RedisInstance.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,mDAAwC;AAExC,MAAsB,aAAa;IAG/B,YAAY,IAAY,EAAE,IAAY,EAAE,QAAgB,EAAE,KAAa,CAAC;;QAEpE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe;YAC5B,IAAI,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;QAChE,MAAA,uBAAM,CAAC,IAAI,0CAAE,OAAO,CAAC,2BAA2B,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;QAChE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IACD,UAAU;;QAEN,MAAA,IAAI,CAAC,MAAM,0CAAE,UAAU,EAAE,CAAC;IAC9B,CAAC;CACJ;AAdD,sCAcC;AAAA,CAAC"}
1
+ {"version":3,"file":"RedisInstance.js","sourceRoot":"","sources":["../src/RedisInstance.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,mDAAwC;AAGxC,MAAsB,aAAa;IAG/B,YAAY,IAAY,EAAE,IAAY,EAAE,QAAgB,EAAE,KAAa,CAAC;;QAEpE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe;YAC5B,IAAI,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;QAChE,MAAA,uBAAM,CAAC,IAAI,0CAAE,OAAO,CAAC,2BAA2B,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;QAChE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IACK,IAAI;;QAEV,CAAC;KAAA;IACK,OAAO;;QAEb,CAAC;KAAA;IACK,UAAU;;QAEhB,CAAC;KAAA;IACK,SAAS;;QAEf,CAAC;KAAA;IACK,IAAI;;QAEV,CAAC;KAAA;IACD,UAAU;;QAEN,MAAA,IAAI,CAAC,MAAM,0CAAE,UAAU,EAAE,CAAC;IAC9B,CAAC;CACJ;AA7BD,sCA6BC;AAAA,CAAC"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.27",
11
+ "version": "1.4.28",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -17,9 +17,10 @@
17
17
  "build": ""
18
18
  },
19
19
  "dependencies": {
20
- "@types/node": "^24.1.0",
20
+ "@types/node": "^24.2.0",
21
21
  "ioredis": "^5.7.0",
22
22
  "namirasoft-core": "^1.4.80",
23
- "namirasoft-log": "^1.4.30"
23
+ "namirasoft-log": "^1.4.30",
24
+ "namirasoft-node": "^1.4.108"
24
25
  }
25
- }
26
+ }
@@ -1,7 +1,8 @@
1
1
  import * as Redis from "ioredis";
2
2
  import { Logger } from "namirasoft-log";
3
+ import { IDatabase } from "namirasoft-node";
3
4
 
4
- export abstract class RedisInstance
5
+ export abstract class RedisInstance implements IDatabase
5
6
  {
6
7
  public client!: Redis.Redis;
7
8
  constructor(host: string, port: number, password: string, db: number = 0)
@@ -11,6 +12,21 @@ export abstract class RedisInstance
11
12
  Logger.main?.success(`Redis was connected to: ${host}:${port}`);
12
13
  this.disconnect = this.disconnect.bind(this);
13
14
  }
15
+ async init()
16
+ {
17
+ }
18
+ async connect()
19
+ {
20
+ }
21
+ async seedBefore()
22
+ {
23
+ }
24
+ async seedAfter()
25
+ {
26
+ }
27
+ async sync()
28
+ {
29
+ }
14
30
  disconnect()
15
31
  {
16
32
  this.client?.disconnect();