@iobroker/db-states-jsonl
Advanced tools
Comparing version 5.0.20-alpha.0-20240409-d68ed299 to 5.0.20-alpha.0-20240418-165fc4c8
@@ -1,3 +0,5 @@ | ||
export declare const Client: any; | ||
export declare const Server: any; | ||
import { Client as StatesClient } from '@iobroker/db-states-redis'; | ||
import StatesServer from './lib/states/statesInMemServerClass.js'; | ||
export declare const Client: typeof StatesClient; | ||
export declare const Server: typeof StatesServer; | ||
/** | ||
@@ -4,0 +6,0 @@ * Get the default port of the objects db |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getDefaultPort = exports.Server = exports.Client = void 0; | ||
exports.Client = require("@iobroker/db-states-redis").Client; | ||
exports.Server = require("./lib/states/statesInMemServerClass.js"); | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var esm_exports = {}; | ||
__export(esm_exports, { | ||
Client: () => Client, | ||
Server: () => Server, | ||
getDefaultPort: () => getDefaultPort | ||
}); | ||
module.exports = __toCommonJS(esm_exports); | ||
var import_db_states_redis = require("@iobroker/db-states-redis"); | ||
var import_statesInMemServerClass = __toESM(require("./lib/states/statesInMemServerClass.js"), 1); | ||
const Client = import_db_states_redis.Client; | ||
const Server = import_statesInMemServerClass.default; | ||
function getDefaultPort() { | ||
return 9e3; | ||
} | ||
exports.getDefaultPort = getDefaultPort; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
Client, | ||
Server, | ||
getDefaultPort | ||
}); | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,2 @@ | ||
export = StatesInMemoryJsonlDB; | ||
declare const StatesInMemoryJsonlDB_base: any; | ||
declare const StatesInMemoryJsonlDB_base: typeof import("../../../../../node_modules/@iobroker/db-states-file/build/esm/lib/states/statesInMemFileDB.js").default; | ||
/** | ||
@@ -7,9 +6,6 @@ * This class inherits InMemoryFileDB class and adds all relevant logic for states | ||
**/ | ||
declare class StatesInMemoryJsonlDB extends StatesInMemoryJsonlDB_base { | ||
[x: string]: any; | ||
export default class StatesInMemoryJsonlDB extends StatesInMemoryJsonlDB_base { | ||
constructor(settings: any); | ||
/** @type {JsonlDB<any>} */ | ||
_db: JsonlDB<any>; | ||
open(): Promise<void>; | ||
dataset: JsonlDB<any> | undefined; | ||
_backupInterval: NodeJS.Timer | undefined; | ||
@@ -22,7 +18,6 @@ /** | ||
_maybeMigrateFileDB(): Promise<boolean>; | ||
saveState(): Promise<void>; | ||
saveBackup(): Promise<void>; | ||
destroy(): Promise<void>; | ||
} | ||
import { JsonlDB } from "@alcalzone/jsonl-db"; | ||
import { JsonlDB } from '@alcalzone/jsonl-db'; | ||
export {}; | ||
//# sourceMappingURL=statesInMemJsonlDB.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const { StatesInMemoryFileDB } = require("@iobroker/db-states-file"); | ||
const { JsonlDB } = require("@alcalzone/jsonl-db"); | ||
const path = require("path"); | ||
const fs = require("fs"); | ||
const os = require("os"); | ||
const { tools } = require("@iobroker/js-controller-common"); | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var statesInMemJsonlDB_exports = {}; | ||
__export(statesInMemJsonlDB_exports, { | ||
default: () => StatesInMemoryJsonlDB | ||
}); | ||
module.exports = __toCommonJS(statesInMemJsonlDB_exports); | ||
var import_db_states_file = require("@iobroker/db-states-file"); | ||
var import_jsonl_db = require("@alcalzone/jsonl-db"); | ||
var import_node_path = __toESM(require("node:path"), 1); | ||
var import_node_fs = __toESM(require("node:fs"), 1); | ||
var import_node_os = __toESM(require("node:os"), 1); | ||
var import_js_controller_common = require("@iobroker/js-controller-common"); | ||
function normalizeJsonlOptions(conf = {}) { | ||
@@ -27,3 +54,3 @@ const ret = { | ||
}; | ||
if (tools.isObject(conf.autoCompress)) { | ||
if (import_js_controller_common.tools.isObject(conf.autoCompress)) { | ||
const ac = conf.autoCompress; | ||
@@ -37,3 +64,3 @@ if (typeof ac.sizeFactor === "number" && ac.sizeFactor >= 2 && ac.sizeFactor <= 100) { | ||
} | ||
if (tools.isObject(conf.throttleFS)) { | ||
if (import_js_controller_common.tools.isObject(conf.throttleFS)) { | ||
const thr = conf.throttleFS; | ||
@@ -49,3 +76,3 @@ if (typeof thr.intervalMs === "number" && thr.intervalMs >= 1e3 && thr.intervalMs <= 36e5) { | ||
} | ||
class StatesInMemoryJsonlDB extends StatesInMemoryFileDB { | ||
class StatesInMemoryJsonlDB extends import_db_states_file.StatesInMemoryFileDB { | ||
constructor(settings) { | ||
@@ -62,3 +89,3 @@ settings = settings || {}; | ||
super(settings); | ||
this._db = new JsonlDB(path.join(this.dataDir, settings.jsonlDB.fileName), jsonlOptions); | ||
this._db = new import_jsonl_db.JsonlDB(import_node_path.default.join(this.dataDir, settings.jsonlDB.fileName), jsonlOptions); | ||
} | ||
@@ -105,5 +132,5 @@ async open() { | ||
async _maybeMigrateFileDB() { | ||
const jsonlFileName = path.join(this.dataDir, this.settings.jsonlDB.fileName); | ||
const jsonFileName = path.join(this.dataDir, this.settings.fileDB.fileName); | ||
const bakFileName = path.join(this.dataDir, this.settings.fileDB.fileName + ".bak"); | ||
const jsonlFileName = import_node_path.default.join(this.dataDir, this.settings.jsonlDB.fileName); | ||
const jsonFileName = import_node_path.default.join(this.dataDir, this.settings.fileDB.fileName); | ||
const bakFileName = import_node_path.default.join(this.dataDir, this.settings.fileDB.fileName + ".bak"); | ||
let jsonlTimeStamp = 0; | ||
@@ -113,3 +140,3 @@ let jsonTimeStamp = 0; | ||
try { | ||
const stat = fs.statSync(jsonlFileName); | ||
const stat = import_node_fs.default.statSync(jsonlFileName); | ||
if (stat.isFile()) { | ||
@@ -121,3 +148,3 @@ jsonlTimeStamp = stat.mtime; | ||
try { | ||
const stat = fs.statSync(jsonFileName); | ||
const stat = import_node_fs.default.statSync(jsonFileName); | ||
if (stat.isFile()) { | ||
@@ -129,3 +156,3 @@ jsonTimeStamp = stat.mtime; | ||
try { | ||
const stat = fs.statSync(bakFileName); | ||
const stat = import_node_fs.default.statSync(bakFileName); | ||
if (stat.isFile()) { | ||
@@ -147,11 +174,11 @@ bakTimeStamp = stat.mtime; | ||
await this._db.importJson(importFilename); | ||
if (fs.existsSync(jsonFileName)) { | ||
if (import_node_fs.default.existsSync(jsonFileName)) { | ||
try { | ||
fs.renameSync(jsonFileName, `${jsonFileName}.migrated`); | ||
import_node_fs.default.renameSync(jsonFileName, `${jsonFileName}.migrated`); | ||
} catch { | ||
} | ||
} | ||
if (fs.existsSync(bakFileName)) { | ||
if (import_node_fs.default.existsSync(bakFileName)) { | ||
try { | ||
fs.renameSync(bakFileName, `${bakFileName}.migrated`); | ||
import_node_fs.default.renameSync(bakFileName, `${bakFileName}.migrated`); | ||
} catch { | ||
@@ -166,4 +193,4 @@ } | ||
const now = Date.now(); | ||
const tmpBackupFileName = path.join(os.tmpdir(), `${this.getTimeStr(now)}_${this.settings.jsonlDB.fileName}`); | ||
const backupFileName = path.join(this.backupDir, `${this.getTimeStr(now)}_${this.settings.jsonlDB.fileName}.gz`); | ||
const tmpBackupFileName = import_node_path.default.join(import_node_os.default.tmpdir(), `${this.getTimeStr(now)}_${this.settings.jsonlDB.fileName}`); | ||
const backupFileName = import_node_path.default.join(this.backupDir, `${this.getTimeStr(now)}_${this.settings.jsonlDB.fileName}.gz`); | ||
if (!this._db.isOpen) { | ||
@@ -174,7 +201,7 @@ this.log.warn(`${this.namespace} Cannot save backup ${backupFileName}: DB is closed`); | ||
try { | ||
if (fs.existsSync(backupFileName)) { | ||
if (import_node_fs.default.existsSync(backupFileName)) { | ||
return; | ||
} | ||
await this._db.dump(tmpBackupFileName); | ||
await tools.compressFileGZip(tmpBackupFileName, backupFileName, { deleteInput: true }); | ||
await import_js_controller_common.tools.compressFileGZip(tmpBackupFileName, backupFileName, { deleteInput: true }); | ||
this.deleteOldBackupFiles(this.settings.jsonlDB.fileName); | ||
@@ -195,3 +222,4 @@ } catch (e) { | ||
} | ||
module.exports = StatesInMemoryJsonlDB; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = {}); | ||
//# sourceMappingURL=statesInMemJsonlDB.js.map |
@@ -1,10 +0,7 @@ | ||
export = StatesInMemoryServerClass; | ||
declare class StatesInMemoryServerClass extends StatesInRedisClient { | ||
export default class StatesInMemoryServerClass extends StatesInRedisClient { | ||
constructor(settings: any); | ||
statesServer: StatesInMemServer; | ||
getStatus(): any; | ||
} | ||
import StatesInRedisClient_1 = require("../../../../../node_modules/@iobroker/db-states-redis/build/cjs/lib/states/statesInRedisClient"); | ||
import StatesInRedisClient = StatesInRedisClient_1.Client; | ||
import StatesInMemServer = require("./statesInMemServerRedis"); | ||
import { Client as StatesInRedisClient } from '@iobroker/db-states-redis'; | ||
import StatesInMemServer from './statesInMemServerRedis.js'; | ||
//# sourceMappingURL=statesInMemServerClass.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const StatesInRedisClient = require("@iobroker/db-states-redis").Client; | ||
const StatesInMemServer = require("./statesInMemServerRedis"); | ||
class StatesInMemoryServerClass extends StatesInRedisClient { | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var statesInMemServerClass_exports = {}; | ||
__export(statesInMemServerClass_exports, { | ||
default: () => StatesInMemoryServerClass | ||
}); | ||
module.exports = __toCommonJS(statesInMemServerClass_exports); | ||
var import_db_states_redis = require("@iobroker/db-states-redis"); | ||
var import_statesInMemServerRedis = __toESM(require("./statesInMemServerRedis.js"), 1); | ||
class StatesInMemoryServerClass extends import_db_states_redis.Client { | ||
constructor(settings) { | ||
@@ -18,3 +45,3 @@ settings.autoConnect = false; | ||
}; | ||
this.statesServer = new StatesInMemServer(serverSettings); | ||
this.statesServer = new import_statesInMemServerRedis.default(serverSettings); | ||
} | ||
@@ -29,3 +56,4 @@ async destroy() { | ||
} | ||
module.exports = StatesInMemoryServerClass; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = {}); | ||
//# sourceMappingURL=statesInMemServerClass.js.map |
@@ -1,3 +0,2 @@ | ||
/// <reference types="node" /> | ||
export = StatesInMemoryServer; | ||
/// <reference types="node" resolution-mode="require"/> | ||
/** | ||
@@ -7,3 +6,3 @@ * This class inherits statesInMemoryFileDB class and adds socket.io communication layer | ||
*/ | ||
declare class StatesInMemoryServer extends StatesInMemoryJsonlDB { | ||
export default class StatesInMemoryServer extends StatesInMemoryJsonlDB { | ||
/** | ||
@@ -72,4 +71,4 @@ * Constructor | ||
} | ||
import StatesInMemoryJsonlDB = require("./statesInMemJsonlDB"); | ||
import net = require("net"); | ||
import StatesInMemoryJsonlDB from './statesInMemJsonlDB.js'; | ||
import net from 'node:net'; | ||
//# sourceMappingURL=statesInMemServerRedis.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const net = require("net"); | ||
const { inspect } = require("util"); | ||
const { RedisHandler } = require("@iobroker/db-base"); | ||
const StatesInMemoryJsonlDB = require("./statesInMemJsonlDB"); | ||
const { getLocalAddress } = require("@iobroker/js-controller-common/tools"); | ||
class StatesInMemoryServer extends StatesInMemoryJsonlDB { | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var statesInMemServerRedis_exports = {}; | ||
__export(statesInMemServerRedis_exports, { | ||
default: () => StatesInMemoryServer | ||
}); | ||
module.exports = __toCommonJS(statesInMemServerRedis_exports); | ||
var import_node_net = __toESM(require("node:net"), 1); | ||
var import_node_util = require("node:util"); | ||
var import_db_base = require("@iobroker/db-base"); | ||
var import_statesInMemJsonlDB = __toESM(require("./statesInMemJsonlDB.js"), 1); | ||
var import_tools = require("@iobroker/js-controller-common/tools"); | ||
class StatesInMemoryServer extends import_statesInMemJsonlDB.default { | ||
constructor(settings) { | ||
@@ -72,3 +99,3 @@ super(settings); | ||
} catch (e) { | ||
this.log.error(`${this.namespace} Error on publishing state: ${id}=${inspect(obj)}: ${e.message}`); | ||
this.log.error(`${this.namespace} Error on publishing state: ${id}=${(0, import_node_util.inspect)(obj)}: ${e.message}`); | ||
return 0; | ||
@@ -338,3 +365,3 @@ } | ||
}; | ||
const handler = new RedisHandler(socket, options); | ||
const handler = new import_db_base.RedisHandler(socket, options); | ||
this._socketEvents(handler); | ||
@@ -354,6 +381,6 @@ this.serverConnections[socket.remoteAddress + ":" + socket.remotePort] = handler; | ||
try { | ||
this.server = net.createServer(); | ||
this.server = import_node_net.default.createServer(); | ||
this.server.on("error", (err) => this.log.info(`${this.namespace} ${settings.secure ? "Secure " : ""} Error inMem-objects listening on port ${settings.port || 9001}: ${err}`)); | ||
this.server.on("connection", (socket) => this._initSocket(socket)); | ||
this.server.listen(settings.port || 9e3, settings.host === "localhost" ? getLocalAddress() : settings.host ? settings.host : void 0, () => resolve()); | ||
this.server.listen(settings.port || 9e3, settings.host === "localhost" ? (0, import_tools.getLocalAddress)() : settings.host ? settings.host : void 0, () => resolve()); | ||
} catch (err) { | ||
@@ -365,3 +392,4 @@ reject(err); | ||
} | ||
module.exports = StatesInMemoryServer; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = {}); | ||
//# sourceMappingURL=statesInMemServerRedis.js.map |
@@ -1,3 +0,5 @@ | ||
export declare const Client: any; | ||
export declare const Server: any; | ||
import { Client as StatesClient } from '@iobroker/db-states-redis'; | ||
import StatesServer from './lib/states/statesInMemServerClass.js'; | ||
export declare const Client: typeof StatesClient; | ||
export declare const Server: typeof StatesServer; | ||
/** | ||
@@ -4,0 +6,0 @@ * Get the default port of the objects db |
@@ -1,15 +0,11 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getDefaultPort = exports.Server = exports.Client = void 0; | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
exports.Client = require('@iobroker/db-states-redis').Client; | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
exports.Server = require('./lib/states/statesInMemServerClass.js'); | ||
import { Client as StatesClient } from '@iobroker/db-states-redis'; | ||
import StatesServer from './lib/states/statesInMemServerClass.js'; | ||
export const Client = StatesClient; | ||
export const Server = StatesServer; | ||
/** | ||
* Get the default port of the objects db | ||
*/ | ||
function getDefaultPort() { | ||
export function getDefaultPort() { | ||
return 9000; | ||
} | ||
exports.getDefaultPort = getDefaultPort; | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,2 @@ | ||
export = StatesInMemoryJsonlDB; | ||
declare const StatesInMemoryJsonlDB_base: any; | ||
declare const StatesInMemoryJsonlDB_base: typeof import("../../../../../node_modules/@iobroker/db-states-file/build/esm/lib/states/statesInMemFileDB.js").default; | ||
/** | ||
@@ -7,9 +6,6 @@ * This class inherits InMemoryFileDB class and adds all relevant logic for states | ||
**/ | ||
declare class StatesInMemoryJsonlDB extends StatesInMemoryJsonlDB_base { | ||
[x: string]: any; | ||
export default class StatesInMemoryJsonlDB extends StatesInMemoryJsonlDB_base { | ||
constructor(settings: any); | ||
/** @type {JsonlDB<any>} */ | ||
_db: JsonlDB<any>; | ||
open(): Promise<void>; | ||
dataset: JsonlDB<any> | undefined; | ||
_backupInterval: NodeJS.Timer | undefined; | ||
@@ -22,7 +18,6 @@ /** | ||
_maybeMigrateFileDB(): Promise<boolean>; | ||
saveState(): Promise<void>; | ||
saveBackup(): Promise<void>; | ||
destroy(): Promise<void>; | ||
} | ||
import { JsonlDB } from "@alcalzone/jsonl-db"; | ||
import { JsonlDB } from '@alcalzone/jsonl-db'; | ||
export {}; | ||
//# sourceMappingURL=statesInMemJsonlDB.d.ts.map |
@@ -9,14 +9,8 @@ /** | ||
*/ | ||
/** @module StatesInMemoryFileDB */ | ||
/* jshint -W097 */ | ||
/* jshint strict:false */ | ||
/* jslint node: true */ | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const { StatesInMemoryFileDB } = require('@iobroker/db-states-file'); | ||
const { JsonlDB } = require('@alcalzone/jsonl-db'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const os = require('os'); | ||
const { tools } = require('@iobroker/js-controller-common'); | ||
import { StatesInMemoryFileDB } from '@iobroker/db-states-file'; | ||
import { JsonlDB } from '@alcalzone/jsonl-db'; | ||
import path from 'node:path'; | ||
import fs from 'node:fs'; | ||
import os from 'node:os'; | ||
import { tools } from '@iobroker/js-controller-common'; | ||
// settings = { | ||
@@ -105,3 +99,3 @@ // change: function (id, state) {}, | ||
**/ | ||
class StatesInMemoryJsonlDB extends StatesInMemoryFileDB { | ||
export default class StatesInMemoryJsonlDB extends StatesInMemoryFileDB { | ||
constructor(settings) { | ||
@@ -281,3 +275,2 @@ settings = settings || {}; | ||
} | ||
module.exports = StatesInMemoryJsonlDB; | ||
//# sourceMappingURL=statesInMemJsonlDB.js.map |
@@ -1,10 +0,7 @@ | ||
export = StatesInMemoryServerClass; | ||
declare class StatesInMemoryServerClass extends StatesInRedisClient { | ||
export default class StatesInMemoryServerClass extends StatesInRedisClient { | ||
constructor(settings: any); | ||
statesServer: StatesInMemServer; | ||
getStatus(): any; | ||
} | ||
import StatesInRedisClient_1 = require("../../../../../node_modules/@iobroker/db-states-redis/build/cjs/lib/states/statesInRedisClient"); | ||
import StatesInRedisClient = StatesInRedisClient_1.Client; | ||
import StatesInMemServer = require("./statesInMemServerRedis"); | ||
import { Client as StatesInRedisClient } from '@iobroker/db-states-redis'; | ||
import StatesInMemServer from './statesInMemServerRedis.js'; | ||
//# sourceMappingURL=statesInMemServerClass.d.ts.map |
@@ -9,11 +9,5 @@ /** | ||
*/ | ||
/** @module statesInMemory */ | ||
/* jshint -W097 */ | ||
/* jshint strict:false */ | ||
/* jslint node: true */ | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const StatesInRedisClient = require('@iobroker/db-states-redis').Client; | ||
const StatesInMemServer = require('./statesInMemServerRedis'); | ||
class StatesInMemoryServerClass extends StatesInRedisClient { | ||
import { Client as StatesInRedisClient } from '@iobroker/db-states-redis'; | ||
import StatesInMemServer from './statesInMemServerRedis.js'; | ||
export default class StatesInMemoryServerClass extends StatesInRedisClient { | ||
constructor(settings) { | ||
@@ -41,3 +35,2 @@ settings.autoConnect = false; // delay Client connection to when we need it | ||
} | ||
module.exports = StatesInMemoryServerClass; | ||
//# sourceMappingURL=statesInMemServerClass.js.map |
@@ -1,3 +0,2 @@ | ||
/// <reference types="node" /> | ||
export = StatesInMemoryServer; | ||
/// <reference types="node" resolution-mode="require"/> | ||
/** | ||
@@ -7,3 +6,3 @@ * This class inherits statesInMemoryFileDB class and adds socket.io communication layer | ||
*/ | ||
declare class StatesInMemoryServer extends StatesInMemoryJsonlDB { | ||
export default class StatesInMemoryServer extends StatesInMemoryJsonlDB { | ||
/** | ||
@@ -72,4 +71,4 @@ * Constructor | ||
} | ||
import StatesInMemoryJsonlDB = require("./statesInMemJsonlDB"); | ||
import net = require("net"); | ||
import StatesInMemoryJsonlDB from './statesInMemJsonlDB.js'; | ||
import net from 'node:net'; | ||
//# sourceMappingURL=statesInMemServerRedis.d.ts.map |
@@ -9,13 +9,7 @@ /** | ||
*/ | ||
/** @module statesInMemory */ | ||
/* jshint -W097 */ | ||
/* jshint strict:false */ | ||
/* jslint node: true */ | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const net = require('net'); | ||
const { inspect } = require('util'); | ||
const { RedisHandler } = require('@iobroker/db-base'); | ||
const StatesInMemoryJsonlDB = require('./statesInMemJsonlDB'); | ||
const { getLocalAddress } = require('@iobroker/js-controller-common/tools'); | ||
import net from 'node:net'; | ||
import { inspect } from 'node:util'; | ||
import { RedisHandler } from '@iobroker/db-base'; | ||
import StatesInMemoryJsonlDB from './statesInMemJsonlDB.js'; | ||
import { getLocalAddress } from '@iobroker/js-controller-common/tools'; | ||
// settings = { | ||
@@ -45,3 +39,3 @@ // change: function (id, state) {}, | ||
*/ | ||
class StatesInMemoryServer extends StatesInMemoryJsonlDB { | ||
export default class StatesInMemoryServer extends StatesInMemoryJsonlDB { | ||
/** | ||
@@ -510,3 +504,2 @@ * Constructor | ||
} | ||
module.exports = StatesInMemoryServer; | ||
//# sourceMappingURL=statesInMemServerRedis.js.map |
{ | ||
"name": "@iobroker/db-states-jsonl", | ||
"version": "5.0.20-alpha.0-20240409-d68ed299", | ||
"type": "module", | ||
"version": "5.0.20-alpha.0-20240418-165fc4c8", | ||
"engines": { | ||
@@ -9,5 +10,5 @@ "node": ">=12.0.0" | ||
"@alcalzone/jsonl-db": "~3.1.1", | ||
"@iobroker/db-base": "5.0.20-alpha.0-20240409-d68ed299", | ||
"@iobroker/db-states-file": "5.0.20-alpha.0-20240409-d68ed299", | ||
"@iobroker/db-states-redis": "5.0.20-alpha.0-20240409-d68ed299" | ||
"@iobroker/db-base": "5.0.20-alpha.0-20240418-165fc4c8", | ||
"@iobroker/db-states-file": "5.0.20-alpha.0-20240418-165fc4c8", | ||
"@iobroker/db-states-redis": "5.0.20-alpha.0-20240418-165fc4c8" | ||
}, | ||
@@ -31,3 +32,3 @@ "keywords": [ | ||
"build": "tsc -b tsconfig.build.json", | ||
"postbuild": "esm2cjs --in build/esm --out build/cjs -l error && cpy ./**/*.d.ts ./build/cjs/ --cwd=build/esm/" | ||
"postbuild": "esm2cjs --in build/esm --out build/cjs -l error -t node18 && cpy ./**/*.d.ts ./build/cjs/ --cwd=build/esm/" | ||
}, | ||
@@ -51,3 +52,3 @@ "main": "build/cjs/index.js", | ||
], | ||
"gitHead": "177223a8779da419012abbbff883d3cc649045d0" | ||
"gitHead": "ba7b732f23ddf0da772e23ed6175185ec204ee6b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
195119
1732
0
0
Yes
+ Added@iobroker/db-base@5.0.20-alpha.0-20240418-165fc4c8(transitive)
+ Added@iobroker/db-states-file@5.0.20-alpha.0-20240418-165fc4c8(transitive)
+ Added@iobroker/db-states-redis@5.0.20-alpha.0-20240418-165fc4c8(transitive)
+ Added@iobroker/js-controller-common@5.0.20-alpha.0-20240418-165fc4c8(transitive)
- Removed@iobroker/db-base@5.0.20-alpha.0-20240409-d68ed299(transitive)
- Removed@iobroker/db-states-file@5.0.20-alpha.0-20240409-d68ed299(transitive)
- Removed@iobroker/db-states-redis@5.0.20-alpha.0-20240409-d68ed299(transitive)
- Removed@iobroker/js-controller-common@5.0.20-alpha.0-20240409-d68ed299(transitive)
Updated@iobroker/db-states-file@5.0.20-alpha.0-20240418-165fc4c8
Updated@iobroker/db-states-redis@5.0.20-alpha.0-20240418-165fc4c8