@iobroker/db-objects-jsonl 7.2.3-alpha.8-20260709-8d8c9c5ed → 7.2.3
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/build/cjs/index.js +3 -5
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/lib/objects/objectsInMemJsonlDB.d.ts +7 -38
- package/build/cjs/lib/objects/objectsInMemJsonlDB.js +31 -67
- package/build/cjs/lib/objects/objectsInMemJsonlDB.js.map +3 -3
- package/build/cjs/lib/objects/objectsInMemServerClass.d.ts +8 -41
- package/build/cjs/lib/objects/objectsInMemServerClass.js +2 -27
- package/build/cjs/lib/objects/objectsInMemServerClass.js.map +3 -3
- package/build/cjs/lib/objects/objectsInMemServerRedis.d.ts +30 -50
- package/build/cjs/lib/objects/objectsInMemServerRedis.js +34 -69
- package/build/cjs/lib/objects/objectsInMemServerRedis.js.map +4 -4
- package/build/esm/lib/objects/objectsInMemJsonlDB.d.ts +7 -38
- package/build/esm/lib/objects/objectsInMemJsonlDB.d.ts.map +1 -1
- package/build/esm/lib/objects/objectsInMemJsonlDB.js +36 -67
- package/build/esm/lib/objects/objectsInMemJsonlDB.js.map +1 -1
- package/build/esm/lib/objects/objectsInMemServerClass.d.ts +8 -41
- package/build/esm/lib/objects/objectsInMemServerClass.d.ts.map +1 -1
- package/build/esm/lib/objects/objectsInMemServerClass.js +1 -25
- package/build/esm/lib/objects/objectsInMemServerClass.js.map +1 -1
- package/build/esm/lib/objects/objectsInMemServerRedis.d.ts +30 -50
- package/build/esm/lib/objects/objectsInMemServerRedis.d.ts.map +1 -1
- package/build/esm/lib/objects/objectsInMemServerRedis.js +68 -87
- package/build/esm/lib/objects/objectsInMemServerRedis.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +9 -9
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Object DB in memory - Server
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2013-
|
|
4
|
+
* Copyright 2013-2024 bluefox <dogafox@gmail.com>
|
|
5
5
|
*
|
|
6
6
|
* MIT License
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
import { ObjectsInMemoryFileDB } from '@iobroker/db-objects-file';
|
|
10
|
+
import { JsonlDB } from '@alcalzone/jsonl-db';
|
|
10
11
|
import path from 'node:path';
|
|
11
12
|
import fs from 'node:fs';
|
|
12
13
|
import os from 'node:os';
|
|
13
|
-
import { ObjectsInMemoryFileDB } from '@iobroker/db-objects-file';
|
|
14
|
-
import { JsonlDB } from '@alcalzone/jsonl-db';
|
|
15
14
|
import { tools } from '@iobroker/js-controller-common-db';
|
|
16
15
|
/**
|
|
17
16
|
* Normalizes options for the JsonlDB
|
|
18
17
|
*
|
|
19
18
|
* @param conf The jsonlOptions options from iobroker.json
|
|
20
|
-
* @returns
|
|
19
|
+
* @returns
|
|
21
20
|
*/
|
|
22
21
|
function normalizeJsonlOptions(conf = {}) {
|
|
23
22
|
const ret = {
|
|
@@ -44,26 +43,21 @@ function normalizeJsonlOptions(conf = {}) {
|
|
|
44
43
|
},
|
|
45
44
|
};
|
|
46
45
|
// Be really careful what we allow here. Incorrect settings may cause problems in production.
|
|
47
|
-
if (
|
|
46
|
+
if (tools.isObject(conf.autoCompress)) {
|
|
48
47
|
const ac = conf.autoCompress;
|
|
49
|
-
|
|
50
|
-
throw new Error('Unexpected autoCompress');
|
|
51
|
-
} // Letting the DB grow more than 100x is risky
|
|
48
|
+
// Letting the DB grow more than 100x is risky
|
|
52
49
|
if (typeof ac.sizeFactor === 'number' && ac.sizeFactor >= 2 && ac.sizeFactor <= 100) {
|
|
53
50
|
ret.autoCompress.sizeFactor = ac.sizeFactor;
|
|
54
51
|
}
|
|
55
|
-
// Also we should definitely compress once the DB has reached 100k lines
|
|
52
|
+
// Also we should definitely compress once the DB has reached 100k lines or it might grow too big
|
|
56
53
|
if (typeof ac.sizeFactorMinimumSize === 'number' &&
|
|
57
54
|
ac.sizeFactorMinimumSize >= 0 &&
|
|
58
55
|
ac.sizeFactorMinimumSize <= 100000) {
|
|
59
56
|
ret.autoCompress.sizeFactorMinimumSize = ac.sizeFactorMinimumSize;
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
|
-
if (
|
|
59
|
+
if (tools.isObject(conf.throttleFS)) {
|
|
63
60
|
const thr = conf.throttleFS;
|
|
64
|
-
if (!ret.throttleFS) {
|
|
65
|
-
throw new Error('Unexpected throttle fs');
|
|
66
|
-
}
|
|
67
61
|
// Don't write more often than every second and write at least once every hour
|
|
68
62
|
if (typeof thr.intervalMs === 'number' && thr.intervalMs >= 1000 && thr.intervalMs <= 3600000) {
|
|
69
63
|
ret.throttleFS.intervalMs = thr.intervalMs;
|
|
@@ -78,31 +72,23 @@ function normalizeJsonlOptions(conf = {}) {
|
|
|
78
72
|
return ret;
|
|
79
73
|
}
|
|
80
74
|
/**
|
|
81
|
-
* This class inherits InMemoryFileDB class and adds all relevant logic for objects
|
|
75
|
+
* This class inherits InMemoryFileDB class and adds all relevant logic for objects
|
|
82
76
|
* including the available methods for use by js-controller directly
|
|
83
77
|
*/
|
|
84
78
|
export class ObjectsInMemoryJsonlDB extends ObjectsInMemoryFileDB {
|
|
85
|
-
_db;
|
|
86
|
-
_backupInterval;
|
|
87
|
-
/**
|
|
88
|
-
* @param settings Settings for the objects database
|
|
89
|
-
*/
|
|
90
79
|
constructor(settings) {
|
|
80
|
+
settings = settings || {};
|
|
91
81
|
settings.fileDB = {
|
|
92
82
|
fileName: 'objects.json',
|
|
93
83
|
backupDirName: 'backup-objects',
|
|
94
84
|
};
|
|
95
85
|
const jsonlOptions = normalizeJsonlOptions(settings.connection.jsonlOptions);
|
|
96
|
-
const jsonlFileName = 'objects.jsonl';
|
|
97
86
|
settings.jsonlDB = {
|
|
98
|
-
fileName:
|
|
87
|
+
fileName: 'objects.jsonl',
|
|
99
88
|
};
|
|
100
89
|
super(settings);
|
|
101
|
-
this._db = new JsonlDB(path.join(this.dataDir,
|
|
90
|
+
this._db = new JsonlDB(path.join(this.dataDir, settings.jsonlDB.fileName), jsonlOptions);
|
|
102
91
|
}
|
|
103
|
-
/**
|
|
104
|
-
* Open the JSONL database, migrating from the legacy file DB if necessary
|
|
105
|
-
*/
|
|
106
92
|
async open() {
|
|
107
93
|
if (!(await this._maybeMigrateFileDB())) {
|
|
108
94
|
await this._db.open();
|
|
@@ -110,31 +96,31 @@ export class ObjectsInMemoryJsonlDB extends ObjectsInMemoryFileDB {
|
|
|
110
96
|
// Create an object-like wrapper around the internal Map
|
|
111
97
|
this.dataset = new Proxy(this._db, {
|
|
112
98
|
/**
|
|
113
|
-
* @param target
|
|
114
|
-
* @param prop
|
|
99
|
+
* @param target
|
|
100
|
+
* @param prop
|
|
115
101
|
*/
|
|
116
102
|
get(target, prop) {
|
|
117
103
|
return target.get(prop);
|
|
118
104
|
},
|
|
119
105
|
/**
|
|
120
|
-
* @param target
|
|
121
|
-
* @param prop
|
|
106
|
+
* @param target
|
|
107
|
+
* @param prop
|
|
122
108
|
*/
|
|
123
109
|
has(target, prop) {
|
|
124
110
|
return target.has(prop);
|
|
125
111
|
},
|
|
126
112
|
/**
|
|
127
|
-
* @param target
|
|
128
|
-
* @param prop
|
|
129
|
-
* @param value
|
|
113
|
+
* @param target
|
|
114
|
+
* @param prop
|
|
115
|
+
* @param value
|
|
130
116
|
*/
|
|
131
117
|
set(target, prop, value) {
|
|
132
118
|
target.set(prop, value);
|
|
133
119
|
return true;
|
|
134
120
|
},
|
|
135
121
|
/**
|
|
136
|
-
* @param target
|
|
137
|
-
* @param prop
|
|
122
|
+
* @param target
|
|
123
|
+
* @param prop
|
|
138
124
|
*/
|
|
139
125
|
deleteProperty(target, prop) {
|
|
140
126
|
return target.delete(prop);
|
|
@@ -143,8 +129,8 @@ export class ObjectsInMemoryJsonlDB extends ObjectsInMemoryFileDB {
|
|
|
143
129
|
return [...target.keys()];
|
|
144
130
|
},
|
|
145
131
|
/**
|
|
146
|
-
* @param target
|
|
147
|
-
* @param prop
|
|
132
|
+
* @param target
|
|
133
|
+
* @param prop
|
|
148
134
|
*/
|
|
149
135
|
getOwnPropertyDescriptor(target, prop) {
|
|
150
136
|
if (!target.has(prop)) {
|
|
@@ -158,9 +144,9 @@ export class ObjectsInMemoryJsonlDB extends ObjectsInMemoryFileDB {
|
|
|
158
144
|
};
|
|
159
145
|
},
|
|
160
146
|
});
|
|
161
|
-
if (this.settings.backup
|
|
147
|
+
if (this.settings.backup && this.settings.backup.period && !this.settings.backup.disabled) {
|
|
162
148
|
this._backupInterval = setInterval(() => {
|
|
163
|
-
this.saveBackup()
|
|
149
|
+
this.saveBackup();
|
|
164
150
|
}, this.settings.backup.period);
|
|
165
151
|
}
|
|
166
152
|
}
|
|
@@ -171,14 +157,9 @@ export class ObjectsInMemoryJsonlDB extends ObjectsInMemoryFileDB {
|
|
|
171
157
|
* If this returns true, the jsonl DB was opened and doesn't need to be opened again.
|
|
172
158
|
*/
|
|
173
159
|
async _maybeMigrateFileDB() {
|
|
174
|
-
const
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
return false;
|
|
178
|
-
}
|
|
179
|
-
const jsonlFileName = path.join(this.dataDir, jsonlName);
|
|
180
|
-
const jsonFileName = path.join(this.dataDir, jsonName);
|
|
181
|
-
const bakFileName = path.join(this.dataDir, `${jsonName}.bak`);
|
|
160
|
+
const jsonlFileName = path.join(this.dataDir, this.settings.jsonlDB.fileName);
|
|
161
|
+
const jsonFileName = path.join(this.dataDir, this.settings.fileDB.fileName);
|
|
162
|
+
const bakFileName = path.join(this.dataDir, `${this.settings.fileDB.fileName}.bak`);
|
|
182
163
|
// Check the timestamps of each file, defaulting to 0 if they don't exist
|
|
183
164
|
let jsonlTimeStamp = 0;
|
|
184
165
|
let jsonTimeStamp = 0;
|
|
@@ -186,7 +167,7 @@ export class ObjectsInMemoryJsonlDB extends ObjectsInMemoryFileDB {
|
|
|
186
167
|
try {
|
|
187
168
|
const stat = fs.statSync(jsonlFileName);
|
|
188
169
|
if (stat.isFile()) {
|
|
189
|
-
jsonlTimeStamp = stat.
|
|
170
|
+
jsonlTimeStamp = stat.mtime;
|
|
190
171
|
}
|
|
191
172
|
}
|
|
192
173
|
catch {
|
|
@@ -195,7 +176,7 @@ export class ObjectsInMemoryJsonlDB extends ObjectsInMemoryFileDB {
|
|
|
195
176
|
try {
|
|
196
177
|
const stat = fs.statSync(jsonFileName);
|
|
197
178
|
if (stat.isFile()) {
|
|
198
|
-
jsonTimeStamp = stat.
|
|
179
|
+
jsonTimeStamp = stat.mtime;
|
|
199
180
|
}
|
|
200
181
|
}
|
|
201
182
|
catch {
|
|
@@ -204,7 +185,7 @@ export class ObjectsInMemoryJsonlDB extends ObjectsInMemoryFileDB {
|
|
|
204
185
|
try {
|
|
205
186
|
const stat = fs.statSync(bakFileName);
|
|
206
187
|
if (stat.isFile()) {
|
|
207
|
-
bakTimeStamp = stat.
|
|
188
|
+
bakTimeStamp = stat.mtime;
|
|
208
189
|
}
|
|
209
190
|
}
|
|
210
191
|
catch {
|
|
@@ -225,7 +206,7 @@ export class ObjectsInMemoryJsonlDB extends ObjectsInMemoryFileDB {
|
|
|
225
206
|
}
|
|
226
207
|
await this._db.open();
|
|
227
208
|
this._db.clear();
|
|
228
|
-
this._db.
|
|
209
|
+
await this._db.importJson(importFilename);
|
|
229
210
|
// And rename the existing files to avoid redoing the work next time
|
|
230
211
|
if (fs.existsSync(jsonFileName)) {
|
|
231
212
|
try {
|
|
@@ -246,23 +227,14 @@ export class ObjectsInMemoryJsonlDB extends ObjectsInMemoryFileDB {
|
|
|
246
227
|
// Signal to the caller that the DB is already open
|
|
247
228
|
return true;
|
|
248
229
|
}
|
|
249
|
-
/**
|
|
250
|
-
* Persist the state. Nothing to do here as the JSONL DB saves behind the scenes.
|
|
251
|
-
*/
|
|
252
230
|
async saveState() {
|
|
253
231
|
// Nothing to do, the DB saves behind the scenes
|
|
254
232
|
}
|
|
255
|
-
|
|
256
|
-
* Regularly called to store a compressed backup of the DB
|
|
257
|
-
*/
|
|
233
|
+
// Is regularly called and stores a compressed backup of the DB
|
|
258
234
|
async saveBackup() {
|
|
259
|
-
const jsonlFileName = this.settings.jsonlDB?.fileName;
|
|
260
|
-
if (!jsonlFileName) {
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
235
|
const now = Date.now();
|
|
264
|
-
const tmpBackupFileName = path.join(os.tmpdir(), `${this.getTimeStr(now)}_${
|
|
265
|
-
const backupFileName = path.join(this.backupDir, `${this.getTimeStr(now)}_${
|
|
236
|
+
const tmpBackupFileName = path.join(os.tmpdir(), `${this.getTimeStr(now)}_${this.settings.jsonlDB.fileName}`);
|
|
237
|
+
const backupFileName = path.join(this.backupDir, `${this.getTimeStr(now)}_${this.settings.jsonlDB.fileName}.gz`);
|
|
266
238
|
if (!this._db.isOpen) {
|
|
267
239
|
this.log.warn(`${this.namespace} Cannot save backup ${backupFileName}: DB is closed`);
|
|
268
240
|
return;
|
|
@@ -276,15 +248,12 @@ export class ObjectsInMemoryJsonlDB extends ObjectsInMemoryFileDB {
|
|
|
276
248
|
// and zip it
|
|
277
249
|
await tools.compressFileGZip(tmpBackupFileName, backupFileName, { deleteInput: true });
|
|
278
250
|
// figure out if older files need to be deleted
|
|
279
|
-
this.deleteOldBackupFiles(
|
|
251
|
+
this.deleteOldBackupFiles(this.settings.jsonlDB.fileName);
|
|
280
252
|
}
|
|
281
253
|
catch (e) {
|
|
282
254
|
this.log.error(`${this.namespace} Cannot save backup ${backupFileName}: ${e.message}`);
|
|
283
255
|
}
|
|
284
256
|
}
|
|
285
|
-
/**
|
|
286
|
-
* Stop the backup interval, close the DB and clean up
|
|
287
|
-
*/
|
|
288
257
|
async destroy() {
|
|
289
258
|
await super.destroy();
|
|
290
259
|
if (this._backupInterval) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectsInMemJsonlDB.js","sourceRoot":"","sources":["../../../../src/lib/objects/objectsInMemJsonlDB.
|
|
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C;YAED,mBAAmB;YACnB,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YACvC,aAAa;YACb,MAAM,KAAK,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,cAAc,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;YACvF,+CAA+C;YAC/C,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC9D,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,uBAAuB,cAAc,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3F,CAAC;IACL,CAAC;IAED,KAAK,CAAC,OAAO;QACT,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;QAEtB,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YACX,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;QAC3B,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1,45 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* MIT License
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
import { Client as ObjectsInRedisClient, type ObjectsSettings } from '@iobroker/db-objects-redis';
|
|
10
|
-
import { type DbStatus } from '@iobroker/db-base';
|
|
11
|
-
/**
|
|
12
|
-
* Objects database client that also starts an in-memory server speaking the Redis protocol
|
|
13
|
-
*/
|
|
14
|
-
export declare class ObjectsInMemoryServerClass extends ObjectsInRedisClient {
|
|
15
|
-
private readonly objectsServer;
|
|
16
|
-
/**
|
|
17
|
-
* @param settings Settings for the objects client and the in-memory server
|
|
18
|
-
*/
|
|
19
|
-
constructor(settings: ObjectsSettings);
|
|
20
|
-
/**
|
|
21
|
-
* Destroy the client first and the in-memory server afterwards
|
|
22
|
-
*/
|
|
23
|
-
destroy(): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Get the status as reported by the in-memory server
|
|
26
|
-
*/
|
|
27
|
-
getStatus(): DbStatus;
|
|
28
|
-
/**
|
|
29
|
-
* Synchronize the file directory of the in-memory server
|
|
30
|
-
*
|
|
31
|
-
* @param limitId Optional object ID to limit the synchronization to
|
|
32
|
-
*/
|
|
33
|
-
syncFileDirectory(limitId?: string): {
|
|
1
|
+
export class ObjectsInMemoryServerClass extends ObjectsInRedisClient {
|
|
2
|
+
constructor(settings: any);
|
|
3
|
+
objectsServer: ObjectsInMemoryServer;
|
|
4
|
+
syncFileDirectory(limitId: any): {
|
|
34
5
|
numberSuccess: number;
|
|
35
|
-
notifications:
|
|
6
|
+
notifications: any[];
|
|
36
7
|
};
|
|
37
|
-
|
|
38
|
-
* Check whether a directory exists in the in-memory server's file storage
|
|
39
|
-
*
|
|
40
|
-
* @param id The object ID owning the files
|
|
41
|
-
* @param name The directory path to check
|
|
42
|
-
*/
|
|
43
|
-
dirExists(id: string, name: string): boolean;
|
|
8
|
+
dirExists(id: any, name: any): boolean;
|
|
44
9
|
}
|
|
10
|
+
import { Client as ObjectsInRedisClient } from '@iobroker/db-objects-redis';
|
|
11
|
+
import { ObjectsInMemoryServer } from './objectsInMemServerRedis.js';
|
|
45
12
|
//# sourceMappingURL=objectsInMemServerClass.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectsInMemServerClass.d.ts","sourceRoot":"","sources":["../../../../src/lib/objects/objectsInMemServerClass.
|
|
1
|
+
{"version":3,"file":"objectsInMemServerClass.d.ts","sourceRoot":"","sources":["../../../../src/lib/objects/objectsInMemServerClass.js"],"names":[],"mappings":"AAYA;IACI,2BAcC;IADG,qCAA8D;IAYlE;;;MAEC;IAED,uCAEC;CACJ;+CApC8C,4BAA4B;sCACrC,8BAA8B"}
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* States DB in memory - Server with Redis protocol
|
|
3
3
|
*
|
|
4
|
-
* Copyright 2013-
|
|
4
|
+
* Copyright 2013-2024 bluefox <dogafox@gmail.com>
|
|
5
5
|
*
|
|
6
6
|
* MIT License
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
9
|
import { Client as ObjectsInRedisClient } from '@iobroker/db-objects-redis';
|
|
10
10
|
import { ObjectsInMemoryServer } from './objectsInMemServerRedis.js';
|
|
11
|
-
/**
|
|
12
|
-
* Objects database client that also starts an in-memory server speaking the Redis protocol
|
|
13
|
-
*/
|
|
14
11
|
export class ObjectsInMemoryServerClass extends ObjectsInRedisClient {
|
|
15
|
-
objectsServer;
|
|
16
|
-
/**
|
|
17
|
-
* @param settings Settings for the objects client and the in-memory server
|
|
18
|
-
*/
|
|
19
12
|
constructor(settings) {
|
|
20
13
|
settings.autoConnect = false; // delay Client connection to when we need it
|
|
21
14
|
super(settings);
|
|
@@ -30,33 +23,16 @@ export class ObjectsInMemoryServerClass extends ObjectsInRedisClient {
|
|
|
30
23
|
};
|
|
31
24
|
this.objectsServer = new ObjectsInMemoryServer(serverSettings);
|
|
32
25
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Destroy the client first and the in-memory server afterwards
|
|
35
|
-
*/
|
|
36
26
|
async destroy() {
|
|
37
27
|
await super.destroy(); // destroy client first
|
|
38
28
|
await this.objectsServer.destroy(); // server afterwards too
|
|
39
29
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Get the status as reported by the in-memory server
|
|
42
|
-
*/
|
|
43
30
|
getStatus() {
|
|
44
31
|
return this.objectsServer.getStatus(); // return Status as Server
|
|
45
32
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Synchronize the file directory of the in-memory server
|
|
48
|
-
*
|
|
49
|
-
* @param limitId Optional object ID to limit the synchronization to
|
|
50
|
-
*/
|
|
51
33
|
syncFileDirectory(limitId) {
|
|
52
34
|
return this.objectsServer.syncFileDirectory(limitId);
|
|
53
35
|
}
|
|
54
|
-
/**
|
|
55
|
-
* Check whether a directory exists in the in-memory server's file storage
|
|
56
|
-
*
|
|
57
|
-
* @param id The object ID owning the files
|
|
58
|
-
* @param name The directory path to check
|
|
59
|
-
*/
|
|
60
36
|
dirExists(id, name) {
|
|
61
37
|
return this.objectsServer.dirExists(id, name);
|
|
62
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectsInMemServerClass.js","sourceRoot":"","sources":["../../../../src/lib/objects/objectsInMemServerClass.
|
|
1
|
+
{"version":3,"file":"objectsInMemServerClass.js","sourceRoot":"","sources":["../../../../src/lib/objects/objectsInMemServerClass.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,MAAM,OAAO,0BAA2B,SAAQ,oBAAoB;IAChE,YAAY,QAAQ;QAChB,QAAQ,CAAC,WAAW,GAAG,KAAK,CAAC,CAAC,6CAA6C;QAC3E,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEhB,MAAM,cAAc,GAAG;YACnB,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,QAAQ;YACzE,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,SAAS,EAAE,GAAG,EAAE;gBACZ,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,mDAAmD;YACzE,CAAC;SACJ,CAAC;QACF,IAAI,CAAC,aAAa,GAAG,IAAI,qBAAqB,CAAC,cAAc,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,OAAO;QACT,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,uBAAuB;QAC9C,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,wBAAwB;IAChE,CAAC;IAED,SAAS;QACL,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC,CAAC,0BAA0B;IACrE,CAAC;IAED,iBAAiB,CAAC,OAAO;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,SAAS,CAAC,EAAE,EAAE,IAAI;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;CACJ"}
|
|
@@ -1,45 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Objects DB in memory - Server with Redis protocol
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2013-2026 bluefox <dogafox@gmail.com>
|
|
5
|
-
*
|
|
6
|
-
* MIT License
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
import net from 'node:net';
|
|
10
|
-
import { RedisHandler, type ConnectionOptions, type FileDbSettings } from '@iobroker/db-base';
|
|
11
|
-
import { ObjectsInMemoryJsonlDB } from './objectsInMemJsonlDB.js';
|
|
12
|
-
type RedisHandlerInternal = RedisHandler & {
|
|
13
|
-
_subscribe?: Record<string, {
|
|
14
|
-
pattern: string;
|
|
15
|
-
regex: RegExp;
|
|
16
|
-
}[]>;
|
|
17
|
-
};
|
|
18
1
|
/**
|
|
19
2
|
* This class inherits statesInMemoryJsonlDB class and adds redis communication layer
|
|
20
3
|
* to access the methods via redis protocol
|
|
21
4
|
*/
|
|
22
|
-
export
|
|
23
|
-
private readonly serverConnections;
|
|
24
|
-
private readonly namespaceObjects;
|
|
25
|
-
private readonly namespaceFile;
|
|
26
|
-
private readonly namespaceObj;
|
|
27
|
-
private readonly namespaceSet;
|
|
28
|
-
private readonly namespaceSetLen;
|
|
29
|
-
private readonly namespaceFileLen;
|
|
30
|
-
private readonly namespaceObjLen;
|
|
31
|
-
private readonly namespaceMeta;
|
|
32
|
-
private readonly namespaceMetaLen;
|
|
33
|
-
private readonly knownScripts;
|
|
34
|
-
private readonly normalizeFileRegex1;
|
|
35
|
-
private readonly normalizeFileRegex2;
|
|
36
|
-
private server;
|
|
5
|
+
export class ObjectsInMemoryServer extends ObjectsInMemoryJsonlDB {
|
|
37
6
|
/**
|
|
38
7
|
* Constructor
|
|
39
8
|
*
|
|
40
9
|
* @param settings State and InMem-DB settings
|
|
41
10
|
*/
|
|
42
|
-
constructor(settings:
|
|
11
|
+
constructor(settings: any);
|
|
12
|
+
serverConnections: {};
|
|
13
|
+
namespaceObjects: string;
|
|
14
|
+
namespaceFile: string;
|
|
15
|
+
namespaceObj: string;
|
|
16
|
+
namespaceSet: string;
|
|
17
|
+
namespaceSetLen: number;
|
|
18
|
+
namespaceFileLen: number;
|
|
19
|
+
namespaceObjLen: number;
|
|
20
|
+
namespaceMeta: string;
|
|
21
|
+
namespaceMetaLen: number;
|
|
22
|
+
knownScripts: {};
|
|
23
|
+
normalizeFileRegex1: RegExp;
|
|
24
|
+
normalizeFileRegex2: RegExp;
|
|
43
25
|
/**
|
|
44
26
|
* Separate Namespace from ID and return both
|
|
45
27
|
*
|
|
@@ -47,8 +29,8 @@ export declare class ObjectsInMemoryServer extends ObjectsInMemoryJsonlDB<RedisH
|
|
|
47
29
|
* @returns Object with namespace and the
|
|
48
30
|
* ID/Array of IDs without the namespace
|
|
49
31
|
*/
|
|
50
|
-
_normalizeId(idWithNamespace:
|
|
51
|
-
id: string | null;
|
|
32
|
+
_normalizeId(idWithNamespace: any): {
|
|
33
|
+
id: string | any[] | null;
|
|
52
34
|
namespace: string;
|
|
53
35
|
name: string;
|
|
54
36
|
isMeta: boolean | undefined;
|
|
@@ -62,7 +44,7 @@ export declare class ObjectsInMemoryServer extends ObjectsInMemoryJsonlDB<RedisH
|
|
|
62
44
|
* @param obj Object to publish
|
|
63
45
|
* @returns Publish counter 0 or 1 depending on if send out or not
|
|
64
46
|
*/
|
|
65
|
-
publishToClients(client:
|
|
47
|
+
publishToClients(client: any, type: any, id: any, obj: any): 1 | 0;
|
|
66
48
|
/**
|
|
67
49
|
* Generate ID for a File
|
|
68
50
|
*
|
|
@@ -71,45 +53,43 @@ export declare class ObjectsInMemoryServer extends ObjectsInMemoryJsonlDB<RedisH
|
|
|
71
53
|
* @param isMeta generate a META ID or a Data ID?
|
|
72
54
|
* @returns File-ID
|
|
73
55
|
*/
|
|
74
|
-
getFileId(id:
|
|
56
|
+
getFileId(id: any, name: any, isMeta: any): string;
|
|
75
57
|
/**
|
|
76
58
|
* Register all event listeners for Handler and implement the relevant logic
|
|
77
59
|
*
|
|
78
60
|
* @param handler RedisHandler instance
|
|
79
61
|
*/
|
|
80
|
-
_socketEvents(handler:
|
|
62
|
+
_socketEvents(handler: any): void;
|
|
81
63
|
/**
|
|
82
64
|
* Return connected RedisHandlers/Connections
|
|
83
65
|
*
|
|
84
|
-
* @returns
|
|
66
|
+
* @returns
|
|
85
67
|
*/
|
|
86
|
-
getClients():
|
|
87
|
-
/**
|
|
88
|
-
* Destructor of the class. Called by shutting down.
|
|
89
|
-
*/
|
|
90
|
-
destroy(): Promise<void>;
|
|
68
|
+
getClients(): {};
|
|
91
69
|
/**
|
|
92
70
|
* Get keys matching pattern and send it to given responseId, for "SCAN" and "KEYS" - Objects and files supported
|
|
93
71
|
*
|
|
94
72
|
* @param handler RedisHandler instance
|
|
95
73
|
* @param pattern - pattern without namespace prefix
|
|
96
|
-
* @param responseId -
|
|
74
|
+
* @param responseId - Id where response will be sent to
|
|
97
75
|
* @param isScan - if used by "SCAN" this flag should be true
|
|
98
76
|
*/
|
|
99
|
-
_handleScanOrKeys(handler:
|
|
77
|
+
_handleScanOrKeys(handler: any, pattern: any, responseId: any, isScan?: boolean): any;
|
|
100
78
|
/**
|
|
101
79
|
* Initialize RedisHandler for a new network connection
|
|
102
80
|
*
|
|
103
81
|
* @param socket Network socket
|
|
104
82
|
*/
|
|
105
|
-
_initSocket(socket:
|
|
83
|
+
_initSocket(socket: any): void;
|
|
106
84
|
/**
|
|
107
85
|
* Initialize Redis Server
|
|
108
86
|
*
|
|
109
87
|
* @param settings Settings object
|
|
110
|
-
* @returns
|
|
88
|
+
* @returns
|
|
111
89
|
*/
|
|
112
|
-
_initRedisServer(settings:
|
|
90
|
+
_initRedisServer(settings: any): Promise<any>;
|
|
91
|
+
server: net.Server | undefined;
|
|
113
92
|
}
|
|
114
|
-
|
|
93
|
+
import { ObjectsInMemoryJsonlDB } from './objectsInMemJsonlDB.js';
|
|
94
|
+
import net from 'node:net';
|
|
115
95
|
//# sourceMappingURL=objectsInMemServerRedis.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectsInMemServerRedis.d.ts","sourceRoot":"","sources":["../../../../src/lib/objects/objectsInMemServerRedis.
|
|
1
|
+
{"version":3,"file":"objectsInMemServerRedis.d.ts","sourceRoot":"","sources":["../../../../src/lib/objects/objectsInMemServerRedis.js"],"names":[],"mappings":"AA0CA;;;GAGG;AACH;IACI;;;;OAIG;IACH,2BA4CC;IAzCG,sBAA2B;IAC3B,yBAEG;IACH,sBAAiD;IACjD,qBAAgD;IAChD,qBAAgD;IAChD,wBAA+C;IAG/C,yBAAiD;IACjD,wBAA+C;IAC/C,sBAAgE;IAChE,yBAAiD;IAEjD,iBAAsB;IAEtB,4BAA4E;IAC5E,4BAAiE;IAyBrE;;;;;;OAMG;IACH;;;;;MAwDC;IAED;;;;;;;;OAQG;IACH,mEA8BC;IAED;;;;;;;OAOG;IACH,mDAYC;IAED;;;;OAIG;IACH,kCAymBC;IAED;;;;OAIG;IACH,iBAEC;IA4BD;;;;;;;OAOG;IACH,sFAwEC;IAED;;;;OAIG;IACH,+BAmBC;IAED;;;;;OAKG;IACH,8CAyBC;IAnBW,+BAAgC;CAoB/C;uCA/+BsC,0BAA0B;gBATjD,UAAU"}
|