diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 0d6bb43..0000000 --- a/.npmignore +++ /dev/null @@ -1,25 +0,0 @@ -.git -.travis.yml -.vs*/ -.editorconfig -appveyor.yml -node_modules/ -src/ -test/ -travis/ - -tslint.json -tsconfig.json -iobroker.*.tgz -Thumbs.db - - -# NYC coverage files -coverage -.nyc* - -# test files -**/src/**/*.test.ts* -**/build/**/*.test.js* -**/build/**/*.test.d.ts -**/build/**/*.test.map diff --git a/README.md b/README.md index 041ebe4..d797c37 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Currently, the following **methods** are available: - `commonTools.pattern2RegEx` - Converts a pattern to match object IDs into a RegEx string that can be used in `new RegExp(...)` - `commonTools.getAdapterDir` - Finds the adapter directory of a given adapter -- `commonTools.getInstalledInfo` - Get list of all installed adapters and controller version on this host +- `commonTools.getInstalledInfo` - Get a list of all installed adapters and controller version on this host - `commonTools.getLocalAddress` - Get the localhost (IPv6 or IPv4) address according to the ioBroker config - `commonTools.getListenAllAddress` - Get the "listen all" (IPv6 or IPv4) address according to the ioBroker config - `commonTools.isLocalAddress` - Check if given IPv4 or IPv6 ip address corresponds to localhost @@ -100,8 +100,8 @@ This path is relative to the path returned by `getAbsoluteDefaultDataDir()`. The ## Tips while working on this module -- `npm run build` creates a clean rebuild of the module. This is done automatically before every build -- `npm run lint` checks for linting errors +- `npm run build` creates a clean rebuild of the module. This is done automatically before every build; +- `npm run lint` checks for linting errors; - `npm run watch` creates an initial build and then incrementally compiles the changes while working. ## Errors in the definitions? @@ -199,7 +199,7 @@ If you find errors in the definitions, e.g., function calls that should be allow - (AlCalzone) Updated core declarations to v3.0.2. This includes support for new methods in JS-Controller 3.0 ### v2.2.1 (2020-01-27) -- (AlCalzone) Included typings for the objects and states cache in the adapter class +- (AlCalzone) Included the typings for the objects and states cache in the adapter class ### v2.0.0 (2019-12-27) - (AlCalzone) Updated core declarations to v2.0.0. This removes access to `adapter.objects` and `adapter.states`. You must use the new methods `adapter.getObjectView` and `adapter.getObjectList` instead of their counterparts from `objects`. diff --git a/build/cjs/controllerTools.d.ts b/build/cjs/controllerTools.d.ts index 6d7c614..5197b87 100644 --- a/build/cjs/controllerTools.d.ts +++ b/build/cjs/controllerTools.d.ts @@ -16,7 +16,7 @@ declare function pattern2RegEx(pattern: string): string; /** * Finds the adapter directory of a given adapter * - * @param adapter name of the adapter, e.g. hm-rpc + * @param adapter name of the adapter, e.g., hm-rpc * @returns path to adapter directory or null if no directory found */ declare function getAdapterDir(adapter: string): string | null; @@ -35,7 +35,7 @@ export interface InstalledInfo { licenseUrl?: string; } /** - * Get list of all installed adapters and controller version on this host + * Get a list of all installed adapters and controller version on this host * @param hostJsControllerVersion Version of the running js-controller, will be included in the returned information if provided * @returns object containing information about installed host */ diff --git a/build/cjs/controllerTools.js b/build/cjs/controllerTools.js index 9828baf..4a636e2 100644 --- a/build/cjs/controllerTools.js +++ b/build/cjs/controllerTools.js @@ -30,12 +30,12 @@ __export(controllerTools_exports, { resolveNamedModule: () => resolveNamedModule }); module.exports = __toCommonJS(controllerTools_exports); -var path = __toESM(require("node:path")); -var import_helpers = require("./helpers.js"); -var utils = __toESM(require("./utils.js")); +var path = __toESM(require("node:path"), 1); var import_node_module = require("node:module"); +var import_helpers = require("./helpers.js"); +var utils = __toESM(require("./utils.js"), 1); const import_meta = {}; -const require2 = (0, import_node_module.createRequire)(import_meta.url || "file://" + __filename); +const require2 = (0, import_node_module.createRequire)(import_meta.url || `file://${__filename}`); let controllerCommonModulesInternal; function resolveControllerTools() { let importPath = (0, import_helpers.tryResolvePackage)(["@iobroker/js-controller-common"]); @@ -43,8 +43,9 @@ function resolveControllerTools() { try { controllerCommonModulesInternal = require2(importPath); const { tools } = controllerCommonModulesInternal; - if (tools) + if (tools) { return tools; + } } catch { } } @@ -53,16 +54,18 @@ function resolveControllerTools() { try { controllerCommonModulesInternal = require2(importPath); const { tools } = controllerCommonModulesInternal; - if (tools) + if (tools) { return tools; + } } catch { } } importPath = path.join(utils.controllerDir, "lib"); try { const tools = require2(path.join(importPath, "tools")); - if (tools) + if (tools) { return tools; + } } catch { } throw new Error("Cannot resolve tools module"); @@ -79,8 +82,9 @@ function resolveNamedModule(name, exportName = name) { for (const importPath of importPaths) { try { const module2 = require2(importPath); - if (module2) + if (module2) { return module2; + } } catch { } } diff --git a/build/cjs/controllerTools.js.map b/build/cjs/controllerTools.js.map index 45322c5..95ab267 100644 --- a/build/cjs/controllerTools.js.map +++ b/build/cjs/controllerTools.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../esm/controllerTools.js"], - "sourcesContent": ["import * as path from \"node:path\";\nimport { tryResolvePackage } from \"./helpers.js\";\nimport * as utils from \"./utils.js\";\nimport { createRequire } from \"node:module\";\n// eslint-disable-next-line unicorn/prefer-module\nconst require = createRequire(import.meta.url || \"file://\" + __filename);\nexport let controllerCommonModulesInternal;\nfunction resolveControllerTools() {\n // Attempt 1: Resolve @iobroker/js-controller-common from here - JS-Controller 4.1+\n let importPath = tryResolvePackage([\"@iobroker/js-controller-common\"]);\n if (importPath) {\n try {\n controllerCommonModulesInternal = require(importPath);\n const { tools } = controllerCommonModulesInternal;\n if (tools)\n return tools;\n }\n catch {\n // did not work, continue\n }\n }\n // Attempt 2: Resolve @iobroker/js-controller-common in JS-Controller dir - JS-Controller 4.1+\n importPath = tryResolvePackage([\"@iobroker/js-controller-common\"], [path.join(utils.controllerDir, \"node_modules\")]);\n if (importPath) {\n try {\n controllerCommonModulesInternal = require(importPath);\n const { tools } = controllerCommonModulesInternal;\n if (tools)\n return tools;\n }\n catch {\n // did not work, continue\n }\n }\n // Attempt 3: Legacy resolve - until JS-Controller 4.0\n importPath = path.join(utils.controllerDir, \"lib\");\n try {\n // This was a default export prior to the TS migration\n const tools = require(path.join(importPath, \"tools\"));\n if (tools)\n return tools;\n }\n catch {\n // did not work, continue\n }\n throw new Error(\"Cannot resolve tools module\");\n //return process.exit(10);\n}\n/** The collection of utility functions in JS-Controller, formerly `lib/tools.js` */\nexport const controllerToolsInternal = resolveControllerTools();\n// Export a subset of the utilties in controllerTools\n/**\n * Resolve a module that is either exported by @iobroker/js-controller-common (new controllers) or located in the controller's `lib` directory (old controllers).\n * @param name - The filename of the module to resolve\n * @param exportName - The name under which the module may be exported. Defaults to `name`.\n */\nexport function resolveNamedModule(name, exportName = name) {\n // The requested module might be moved to @iobroker/js-controller-common and exported from there\n if (controllerCommonModulesInternal?.[exportName])\n return controllerCommonModulesInternal[exportName];\n // Otherwise it was not moved yet, or we're dealing with JS-Controller <= 4.0\n const importPaths = [\n // Attempt 1: JS-Controller 6+\n path.join(utils.controllerDir, \"build/cjs/lib\", name),\n // Attempt 2: JS-Controller 4.1+\n path.join(utils.controllerDir, \"build/lib\", name),\n // Attempt 3: JS-Controller <= 4.0\n path.join(utils.controllerDir, \"lib\", name),\n ];\n for (const importPath of importPaths) {\n try {\n // This was a default export prior to the TS migration\n const module = require(importPath);\n if (module)\n return module;\n }\n catch {\n // did not work, continue\n }\n }\n throw new Error(`Cannot resolve JS-Controller module ${name}.js`);\n //return process.exit(10);\n}\n// TODO: Import types from @iobroker/js-controller-common and iobroker.js-controller\n/**\n * Converts a pattern to match object IDs into a RegEx string that can be used in `new RegExp(...)`\n * @param pattern The pattern to convert\n * @returns The RegEx string\n */\nfunction pattern2RegEx(pattern) {\n return controllerToolsInternal.pattern2RegEx(pattern);\n}\n/**\n * Finds the adapter directory of a given adapter\n *\n * @param adapter name of the adapter, e.g. hm-rpc\n * @returns path to adapter directory or null if no directory found\n */\nfunction getAdapterDir(adapter) {\n return controllerToolsInternal.getAdapterDir(adapter);\n}\n/**\n * Get list of all installed adapters and controller version on this host\n * @param hostJsControllerVersion Version of the running js-controller, will be included in the returned information if provided\n * @returns object containing information about installed host\n */\nfunction getInstalledInfo(hostJsControllerVersion) {\n return controllerToolsInternal.getInstalledInfo(hostJsControllerVersion);\n}\n/**\n * Checks if we are running inside a docker container\n */\nfunction isDocker() {\n return controllerToolsInternal.isDocker();\n}\n/**\n * Checks if given ip address is matching ipv4 or ipv6 localhost\n * @param ip ipv4 or ipv6 address\n */\nfunction isLocalAddress(ip) {\n return controllerToolsInternal.isLocalAddress(ip);\n}\n/**\n * Checks if given ip address is matching ipv4 or ipv6 \"listen all\" address\n * @param ip ipv4 or ipv6 address\n */\nfunction isListenAllAddress(ip) {\n return controllerToolsInternal.isListenAllAddress(ip);\n}\n/**\n * Retrieve the localhost address according to the configured DNS resolution strategy\n */\nfunction getLocalAddress() {\n return controllerToolsInternal.getLocalAddress();\n}\n/**\n * Get the ip to listen to all addresses according to configured DNS resolution strategy\n */\nfunction getListenAllAddress() {\n return controllerToolsInternal.getListenAllAddress();\n}\nexport const commonTools = {\n pattern2RegEx,\n getAdapterDir,\n getInstalledInfo,\n isDocker,\n getLocalAddress,\n getListenAllAddress,\n isLocalAddress,\n isListenAllAddress,\n // TODO: Add more methods from lib/tools.js as needed\n password: resolveNamedModule(\"password\"),\n session: resolveNamedModule(\"session\"),\n zipFiles: resolveNamedModule(\"zipFiles\"),\n // TODO: expose more (internal) controller modules as needed\n};\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAsB;AACtB,qBAAkC;AAClC,YAAuB;AACvB,yBAA8B;AAH9B;AAKA,MAAMA,eAAU,kCAAc,YAAY,OAAO,YAAY,UAAU;AAChE,IAAI;AACX,SAAS,yBAAyB;AAE9B,MAAI,iBAAa,kCAAkB,CAAC,gCAAgC,CAAC;AACrE,MAAI,YAAY;AACZ,QAAI;AACA,wCAAkCA,SAAQ,UAAU;AACpD,YAAM,EAAE,MAAM,IAAI;AAClB,UAAI;AACA,eAAO;AAAA,IACf,QACA;AAAA,IAEA;AAAA,EACJ;AAEA,mBAAa,kCAAkB,CAAC,gCAAgC,GAAG,CAAC,KAAK,KAAK,MAAM,eAAe,cAAc,CAAC,CAAC;AACnH,MAAI,YAAY;AACZ,QAAI;AACA,wCAAkCA,SAAQ,UAAU;AACpD,YAAM,EAAE,MAAM,IAAI;AAClB,UAAI;AACA,eAAO;AAAA,IACf,QACA;AAAA,IAEA;AAAA,EACJ;AAEA,eAAa,KAAK,KAAK,MAAM,eAAe,KAAK;AACjD,MAAI;AAEA,UAAM,QAAQA,SAAQ,KAAK,KAAK,YAAY,OAAO,CAAC;AACpD,QAAI;AACA,aAAO;AAAA,EACf,QACA;AAAA,EAEA;AACA,QAAM,IAAI,MAAM,6BAA6B;AAEjD;AAEO,MAAM,0BAA0B,uBAAuB;AAOvD,SAAS,mBAAmB,MAAM,aAAa,MAAM;AAExD,MAAI,mFAAkC;AAClC,WAAO,gCAAgC;AAE3C,QAAM,cAAc;AAAA,IAEhB,KAAK,KAAK,MAAM,eAAe,iBAAiB,IAAI;AAAA,IAEpD,KAAK,KAAK,MAAM,eAAe,aAAa,IAAI;AAAA,IAEhD,KAAK,KAAK,MAAM,eAAe,OAAO,IAAI;AAAA,EAC9C;AACA,aAAW,cAAc,aAAa;AAClC,QAAI;AAEA,YAAMC,UAASD,SAAQ,UAAU;AACjC,UAAIC;AACA,eAAOA;AAAA,IACf,QACA;AAAA,IAEA;AAAA,EACJ;AACA,QAAM,IAAI,MAAM,uCAAuC,SAAS;AAEpE;AAOA,SAAS,cAAc,SAAS;AAC5B,SAAO,wBAAwB,cAAc,OAAO;AACxD;AAOA,SAAS,cAAc,SAAS;AAC5B,SAAO,wBAAwB,cAAc,OAAO;AACxD;AAMA,SAAS,iBAAiB,yBAAyB;AAC/C,SAAO,wBAAwB,iBAAiB,uBAAuB;AAC3E;AAIA,SAAS,WAAW;AAChB,SAAO,wBAAwB,SAAS;AAC5C;AAKA,SAAS,eAAe,IAAI;AACxB,SAAO,wBAAwB,eAAe,EAAE;AACpD;AAKA,SAAS,mBAAmB,IAAI;AAC5B,SAAO,wBAAwB,mBAAmB,EAAE;AACxD;AAIA,SAAS,kBAAkB;AACvB,SAAO,wBAAwB,gBAAgB;AACnD;AAIA,SAAS,sBAAsB;AAC3B,SAAO,wBAAwB,oBAAoB;AACvD;AACO,MAAM,cAAc;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,UAAU,mBAAmB,UAAU;AAAA,EACvC,SAAS,mBAAmB,SAAS;AAAA,EACrC,UAAU,mBAAmB,UAAU;AAE3C;", + "sourcesContent": ["import * as path from \"node:path\";\nimport { createRequire } from \"node:module\";\nimport { tryResolvePackage } from \"./helpers.js\";\nimport * as utils from \"./utils.js\";\n// eslint-disable-next-line unicorn/prefer-module\nconst require = createRequire(import.meta.url || `file://${__filename}`);\nexport let controllerCommonModulesInternal;\nfunction resolveControllerTools() {\n // Attempt 1: Resolve @iobroker/js-controller-common from here - JS-Controller 4.1+\n let importPath = tryResolvePackage([\"@iobroker/js-controller-common\"]);\n if (importPath) {\n try {\n controllerCommonModulesInternal = require(importPath);\n const { tools } = controllerCommonModulesInternal;\n if (tools) {\n return tools;\n }\n }\n catch {\n // did not work, continue\n }\n }\n // Attempt 2: Resolve @iobroker/js-controller-common in JS-Controller dir - JS-Controller 4.1+\n importPath = tryResolvePackage([\"@iobroker/js-controller-common\"], [path.join(utils.controllerDir, \"node_modules\")]);\n if (importPath) {\n try {\n controllerCommonModulesInternal = require(importPath);\n const { tools } = controllerCommonModulesInternal;\n if (tools) {\n return tools;\n }\n }\n catch {\n // did not work, continue\n }\n }\n // Attempt 3: Legacy resolve - until JS-Controller 4.0\n importPath = path.join(utils.controllerDir, \"lib\");\n try {\n // This was a default export prior to the TS migration\n const tools = require(path.join(importPath, \"tools\"));\n if (tools) {\n return tools;\n }\n }\n catch {\n // did not work, continue\n }\n throw new Error(\"Cannot resolve tools module\");\n //return process.exit(10);\n}\n/** The collection of utility functions in JS-Controller, formerly `lib/tools.js` */\nexport const controllerToolsInternal = resolveControllerTools();\n// Export a subset of the utilities in controllerTools\n/**\n * Resolve a module that is either exported by @iobroker/js-controller-common (new controllers) or located in the controller's `lib` directory (old controllers).\n * @param name - The filename of the module to resolve\n * @param exportName - The name under which the module may be exported. Defaults to `name`.\n */\nexport function resolveNamedModule(name, exportName = name) {\n // The requested module might be moved to @iobroker/js-controller-common and exported from there\n if (controllerCommonModulesInternal?.[exportName])\n return controllerCommonModulesInternal[exportName];\n // Otherwise it was not moved yet, or we're dealing with JS-Controller <= 4.0\n const importPaths = [\n // Attempt 1: JS-Controller 6+\n path.join(utils.controllerDir, \"build/cjs/lib\", name),\n // Attempt 2: JS-Controller 4.1+\n path.join(utils.controllerDir, \"build/lib\", name),\n // Attempt 3: JS-Controller <= 4.0\n path.join(utils.controllerDir, \"lib\", name),\n ];\n for (const importPath of importPaths) {\n try {\n // This was a default export prior to the TS migration\n const module = require(importPath);\n if (module) {\n return module;\n }\n }\n catch {\n // did not work, continue\n }\n }\n throw new Error(`Cannot resolve JS-Controller module ${name}.js`);\n //return process.exit(10);\n}\n// TODO: Import types from @iobroker/js-controller-common and iobroker.js-controller\n/**\n * Converts a pattern to match object IDs into a RegEx string that can be used in `new RegExp(...)`\n * @param pattern The pattern to convert\n * @returns The RegEx string\n */\nfunction pattern2RegEx(pattern) {\n return controllerToolsInternal.pattern2RegEx(pattern);\n}\n/**\n * Finds the adapter directory of a given adapter\n *\n * @param adapter name of the adapter, e.g., hm-rpc\n * @returns path to adapter directory or null if no directory found\n */\nfunction getAdapterDir(adapter) {\n return controllerToolsInternal.getAdapterDir(adapter);\n}\n/**\n * Get a list of all installed adapters and controller version on this host\n * @param hostJsControllerVersion Version of the running js-controller, will be included in the returned information if provided\n * @returns object containing information about installed host\n */\nfunction getInstalledInfo(hostJsControllerVersion) {\n return controllerToolsInternal.getInstalledInfo(hostJsControllerVersion);\n}\n/**\n * Checks if we are running inside a docker container\n */\nfunction isDocker() {\n return controllerToolsInternal.isDocker();\n}\n/**\n * Checks if given ip address is matching ipv4 or ipv6 localhost\n * @param ip ipv4 or ipv6 address\n */\nfunction isLocalAddress(ip) {\n return controllerToolsInternal.isLocalAddress(ip);\n}\n/**\n * Checks if given ip address is matching ipv4 or ipv6 \"listen all\" address\n * @param ip ipv4 or ipv6 address\n */\nfunction isListenAllAddress(ip) {\n return controllerToolsInternal.isListenAllAddress(ip);\n}\n/**\n * Retrieve the localhost address according to the configured DNS resolution strategy\n */\nfunction getLocalAddress() {\n return controllerToolsInternal.getLocalAddress();\n}\n/**\n * Get the ip to listen to all addresses according to configured DNS resolution strategy\n */\nfunction getListenAllAddress() {\n return controllerToolsInternal.getListenAllAddress();\n}\nexport const commonTools = {\n pattern2RegEx,\n getAdapterDir,\n getInstalledInfo,\n isDocker,\n getLocalAddress,\n getListenAllAddress,\n isLocalAddress,\n isListenAllAddress,\n // TODO: Add more methods from lib/tools.js as needed\n password: resolveNamedModule(\"password\"),\n session: resolveNamedModule(\"session\"),\n zipFiles: resolveNamedModule(\"zipFiles\"),\n // TODO: expose more (internal) controller modules as needed\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAsB;AACtB,yBAA8B;AAC9B,qBAAkC;AAClC,YAAuB;AAHvB;AAKA,MAAMA,eAAU,kCAAc,YAAY,OAAO,UAAU,YAAY;AAChE,IAAI;AACX,SAAS,yBAAyB;AAE9B,MAAI,iBAAa,kCAAkB,CAAC,gCAAgC,CAAC;AACrE,MAAI,YAAY;AACZ,QAAI;AACA,wCAAkCA,SAAQ,UAAU;AACpD,YAAM,EAAE,MAAM,IAAI;AAClB,UAAI,OAAO;AACP,eAAO;AAAA,MACX;AAAA,IACJ,QACA;AAAA,IAEA;AAAA,EACJ;AAEA,mBAAa,kCAAkB,CAAC,gCAAgC,GAAG,CAAC,KAAK,KAAK,MAAM,eAAe,cAAc,CAAC,CAAC;AACnH,MAAI,YAAY;AACZ,QAAI;AACA,wCAAkCA,SAAQ,UAAU;AACpD,YAAM,EAAE,MAAM,IAAI;AAClB,UAAI,OAAO;AACP,eAAO;AAAA,MACX;AAAA,IACJ,QACA;AAAA,IAEA;AAAA,EACJ;AAEA,eAAa,KAAK,KAAK,MAAM,eAAe,KAAK;AACjD,MAAI;AAEA,UAAM,QAAQA,SAAQ,KAAK,KAAK,YAAY,OAAO,CAAC;AACpD,QAAI,OAAO;AACP,aAAO;AAAA,IACX;AAAA,EACJ,QACA;AAAA,EAEA;AACA,QAAM,IAAI,MAAM,6BAA6B;AAEjD;AAEO,MAAM,0BAA0B,uBAAuB;AAOvD,SAAS,mBAAmB,MAAM,aAAa,MAAM;AAExD,MAAI,mFAAkC;AAClC,WAAO,gCAAgC;AAE3C,QAAM,cAAc;AAAA,IAEhB,KAAK,KAAK,MAAM,eAAe,iBAAiB,IAAI;AAAA,IAEpD,KAAK,KAAK,MAAM,eAAe,aAAa,IAAI;AAAA,IAEhD,KAAK,KAAK,MAAM,eAAe,OAAO,IAAI;AAAA,EAC9C;AACA,aAAW,cAAc,aAAa;AAClC,QAAI;AAEA,YAAMC,UAASD,SAAQ,UAAU;AACjC,UAAIC,SAAQ;AACR,eAAOA;AAAA,MACX;AAAA,IACJ,QACA;AAAA,IAEA;AAAA,EACJ;AACA,QAAM,IAAI,MAAM,uCAAuC,SAAS;AAEpE;AAOA,SAAS,cAAc,SAAS;AAC5B,SAAO,wBAAwB,cAAc,OAAO;AACxD;AAOA,SAAS,cAAc,SAAS;AAC5B,SAAO,wBAAwB,cAAc,OAAO;AACxD;AAMA,SAAS,iBAAiB,yBAAyB;AAC/C,SAAO,wBAAwB,iBAAiB,uBAAuB;AAC3E;AAIA,SAAS,WAAW;AAChB,SAAO,wBAAwB,SAAS;AAC5C;AAKA,SAAS,eAAe,IAAI;AACxB,SAAO,wBAAwB,eAAe,EAAE;AACpD;AAKA,SAAS,mBAAmB,IAAI;AAC5B,SAAO,wBAAwB,mBAAmB,EAAE;AACxD;AAIA,SAAS,kBAAkB;AACvB,SAAO,wBAAwB,gBAAgB;AACnD;AAIA,SAAS,sBAAsB;AAC3B,SAAO,wBAAwB,oBAAoB;AACvD;AACO,MAAM,cAAc;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,UAAU,mBAAmB,UAAU;AAAA,EACvC,SAAS,mBAAmB,SAAS;AAAA,EACrC,UAAU,mBAAmB,UAAU;AAE3C;", "names": ["require", "module"] } diff --git a/build/cjs/helpers.js b/build/cjs/helpers.js index 66ea9c7..52a8715 100644 --- a/build/cjs/helpers.js +++ b/build/cjs/helpers.js @@ -28,14 +28,14 @@ __export(helpers_exports, { tryResolvePackage: () => tryResolvePackage }); module.exports = __toCommonJS(helpers_exports); -var fs = __toESM(require("node:fs")); -var path = __toESM(require("node:path")); +var fs = __toESM(require("node:fs"), 1); +var path = __toESM(require("node:path"), 1); var import_node_module = require("node:module"); -var url = __toESM(require("node:url")); +var url = __toESM(require("node:url"), 1); const import_meta = {}; -const require2 = (0, import_node_module.createRequire)(import_meta.url || "file://" + __filename); +const require2 = (0, import_node_module.createRequire)(import_meta.url || `file://${__filename}`); const thisDir = url.fileURLToPath( - new URL(".", import_meta.url || "file://" + __filename) + new URL(".", import_meta.url || `file://${__filename}`) ); function tryResolvePackage(possiblePaths, lookupPaths) { for (const pkg of possiblePaths) { diff --git a/build/cjs/helpers.js.map b/build/cjs/helpers.js.map index 2aaf61f..749c6e9 100644 --- a/build/cjs/helpers.js.map +++ b/build/cjs/helpers.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../esm/helpers.js"], - "sourcesContent": ["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { createRequire } from \"node:module\";\nimport * as url from \"node:url\";\n// eslint-disable-next-line unicorn/prefer-module\nconst require = createRequire(import.meta.url || \"file://\" + __filename);\nconst thisDir = url.fileURLToPath(\n// eslint-disable-next-line unicorn/prefer-module\nnew URL(\".\", import.meta.url || \"file://\" + __filename));\n/**\n * Tries to resolve a package using Node.js resolution.\n * Directory names differing from the package name and alternate lookup paths can be passed.\n */\nexport function tryResolvePackage(possiblePaths, lookupPaths) {\n for (const pkg of possiblePaths) {\n try {\n // package.json is guaranteed to be in the module root folder\n // so once that is resolved, take the dirname and we're done\n const possiblePath = require.resolve(`${pkg}/package.json`, lookupPaths?.length ? { paths: lookupPaths } : undefined);\n if (fs.existsSync(possiblePath)) {\n return path.dirname(possiblePath);\n }\n }\n catch {\n /* not found */\n }\n }\n}\n/**\n * Scans for a package by walking up the directory tree and inspecting package.json\n * Directory names differing from the package name and an alternate start dir can be passed.\n */\nexport function scanForPackage(possiblePaths, startDir = thisDir) {\n // We start in the node_modules subfolder of adapter-core, which is the deepest we should be able to expect the controller\n let curDir = path.join(startDir, \"../node_modules\");\n while (true) {\n for (const pkg of possiblePaths) {\n const possiblePath = path.join(curDir, pkg, \"package.json\");\n try {\n // If package.json exists in the directory and its name field matches, we've found js-controller\n if (fs.existsSync(possiblePath) &&\n JSON.parse(fs.readFileSync(possiblePath, \"utf8\")).name ===\n pkg.toLowerCase()) {\n return path.dirname(possiblePath);\n }\n }\n catch {\n // don't care\n }\n }\n // Nothing found here, go up one level\n const parentDir = path.dirname(curDir);\n if (parentDir === curDir) {\n // we've reached the root without finding js-controller\n break;\n }\n curDir = parentDir;\n }\n}\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AACtB,yBAA8B;AAC9B,UAAqB;AAHrB;AAKA,MAAMA,eAAU,kCAAc,YAAY,OAAO,YAAY,UAAU;AACvE,MAAM,UAAU,IAAI;AAAA,EAEpB,IAAI,IAAI,KAAK,YAAY,OAAO,YAAY,UAAU;AAAC;AAKhD,SAAS,kBAAkB,eAAe,aAAa;AAC1D,aAAW,OAAO,eAAe;AAC7B,QAAI;AAGA,YAAM,eAAeA,SAAQ,QAAQ,GAAG,qBAAoB,2CAAa,UAAS,EAAE,OAAO,YAAY,IAAI,MAAS;AACpH,UAAI,GAAG,WAAW,YAAY,GAAG;AAC7B,eAAO,KAAK,QAAQ,YAAY;AAAA,MACpC;AAAA,IACJ,QACA;AAAA,IAEA;AAAA,EACJ;AACJ;AAKO,SAAS,eAAe,eAAe,WAAW,SAAS;AAE9D,MAAI,SAAS,KAAK,KAAK,UAAU,iBAAiB;AAClD,SAAO,MAAM;AACT,eAAW,OAAO,eAAe;AAC7B,YAAM,eAAe,KAAK,KAAK,QAAQ,KAAK,cAAc;AAC1D,UAAI;AAEA,YAAI,GAAG,WAAW,YAAY,KAC1B,KAAK,MAAM,GAAG,aAAa,cAAc,MAAM,CAAC,EAAE,SAC9C,IAAI,YAAY,GAAG;AACvB,iBAAO,KAAK,QAAQ,YAAY;AAAA,QACpC;AAAA,MACJ,QACA;AAAA,MAEA;AAAA,IACJ;AAEA,UAAM,YAAY,KAAK,QAAQ,MAAM;AACrC,QAAI,cAAc,QAAQ;AAEtB;AAAA,IACJ;AACA,aAAS;AAAA,EACb;AACJ;", + "sourcesContent": ["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { createRequire } from \"node:module\";\nimport * as url from \"node:url\";\n// eslint-disable-next-line unicorn/prefer-module\nconst require = createRequire(import.meta.url || `file://${__filename}`);\nconst thisDir = url.fileURLToPath(\n// eslint-disable-next-line unicorn/prefer-module\nnew URL(\".\", import.meta.url || `file://${__filename}`));\n/**\n * Tries to resolve a package using Node.js resolution.\n * Directory names differing from the package name and alternate lookup paths can be passed.\n */\nexport function tryResolvePackage(possiblePaths, lookupPaths) {\n for (const pkg of possiblePaths) {\n try {\n // package.json is guaranteed to be in the module root folder\n // so once that is resolved, take the dirname and we're done\n const possiblePath = require.resolve(`${pkg}/package.json`, lookupPaths?.length ? { paths: lookupPaths } : undefined);\n if (fs.existsSync(possiblePath)) {\n return path.dirname(possiblePath);\n }\n }\n catch {\n /* not found */\n }\n }\n}\n/**\n * Scans for a package by walking up the directory tree and inspecting package.json\n * Directory names differing from the package name and an alternate start dir can be passed.\n */\nexport function scanForPackage(possiblePaths, startDir = thisDir) {\n // We start in the node_modules subfolder of adapter-core, which is the deepest we should be able to expect the controller\n let curDir = path.join(startDir, \"../node_modules\");\n while (true) {\n for (const pkg of possiblePaths) {\n const possiblePath = path.join(curDir, pkg, \"package.json\");\n try {\n // If package.json exists in the directory and its name field matches, we've found js-controller\n if (fs.existsSync(possiblePath) &&\n JSON.parse(fs.readFileSync(possiblePath, \"utf8\")).name ===\n pkg.toLowerCase()) {\n return path.dirname(possiblePath);\n }\n }\n catch {\n // don't care\n }\n }\n // Nothing found here, go up one level\n const parentDir = path.dirname(curDir);\n if (parentDir === curDir) {\n // we've reached the root without finding js-controller\n break;\n }\n curDir = parentDir;\n }\n}\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AACtB,yBAA8B;AAC9B,UAAqB;AAHrB;AAKA,MAAMA,eAAU,kCAAc,YAAY,OAAO,UAAU,YAAY;AACvE,MAAM,UAAU,IAAI;AAAA,EAEpB,IAAI,IAAI,KAAK,YAAY,OAAO,UAAU,YAAY;AAAC;AAKhD,SAAS,kBAAkB,eAAe,aAAa;AAC1D,aAAW,OAAO,eAAe;AAC7B,QAAI;AAGA,YAAM,eAAeA,SAAQ,QAAQ,GAAG,qBAAoB,2CAAa,UAAS,EAAE,OAAO,YAAY,IAAI,MAAS;AACpH,UAAI,GAAG,WAAW,YAAY,GAAG;AAC7B,eAAO,KAAK,QAAQ,YAAY;AAAA,MACpC;AAAA,IACJ,QACA;AAAA,IAEA;AAAA,EACJ;AACJ;AAKO,SAAS,eAAe,eAAe,WAAW,SAAS;AAE9D,MAAI,SAAS,KAAK,KAAK,UAAU,iBAAiB;AAClD,SAAO,MAAM;AACT,eAAW,OAAO,eAAe;AAC7B,YAAM,eAAe,KAAK,KAAK,QAAQ,KAAK,cAAc;AAC1D,UAAI;AAEA,YAAI,GAAG,WAAW,YAAY,KAC1B,KAAK,MAAM,GAAG,aAAa,cAAc,MAAM,CAAC,EAAE,SAC9C,IAAI,YAAY,GAAG;AACvB,iBAAO,KAAK,QAAQ,YAAY;AAAA,QACpC;AAAA,MACJ,QACA;AAAA,MAEA;AAAA,IACJ;AAEA,UAAM,YAAY,KAAK,QAAQ,MAAM;AACrC,QAAI,cAAc,QAAQ;AAEtB;AAAA,IACJ;AACA,aAAS;AAAA,EACb;AACJ;", "names": ["require"] } diff --git a/build/cjs/index.js b/build/cjs/index.js index 192cc26..b51b249 100644 --- a/build/cjs/index.js +++ b/build/cjs/index.js @@ -31,9 +31,9 @@ __export(esm_exports, { getAbsoluteInstanceDataDir: () => getAbsoluteInstanceDataDir }); module.exports = __toCommonJS(esm_exports); -var path = __toESM(require("node:path")); +var path = __toESM(require("node:path"), 1); var import_controllerTools = require("./controllerTools.js"); -var utils = __toESM(require("./utils.js")); +var utils = __toESM(require("./utils.js"), 1); var import_types = require("@iobroker/types"); var import_controllerTools2 = require("./controllerTools.js"); __reExport(esm_exports, require("./utils.js"), module.exports); diff --git a/build/cjs/utils.js b/build/cjs/utils.js index 0a4a111..cdbe966 100644 --- a/build/cjs/utils.js +++ b/build/cjs/utils.js @@ -30,27 +30,28 @@ __export(utils_exports, { getConfig: () => getConfig }); module.exports = __toCommonJS(utils_exports); -var fs = __toESM(require("node:fs")); -var path = __toESM(require("node:path")); +var fs = __toESM(require("node:fs"), 1); +var path = __toESM(require("node:path"), 1); var import_node_module = require("node:module"); var import_helpers = require("./helpers.js"); const import_meta = {}; var _a; -const require2 = (0, import_node_module.createRequire)(import_meta.url || "file://" + __filename); +const require2 = (0, import_node_module.createRequire)(import_meta.url || `file://${__filename}`); function getControllerDir(isInstall) { const possibilities = ["iobroker.js-controller", "ioBroker.js-controller"]; let controllerDir2 = (0, import_helpers.tryResolvePackage)(possibilities); - if (controllerDir2) + if (controllerDir2) { return controllerDir2; + } controllerDir2 = (0, import_helpers.scanForPackage)(possibilities); - if (controllerDir2) + if (controllerDir2) { return controllerDir2; + } if (!isInstall) { console.log("Cannot find js-controller"); return process.exit(10); - } else { - return process.exit(); } + return process.exit(); } const controllerDir = getControllerDir(!!((_a = process == null ? void 0 : process.argv) == null ? void 0 : _a.includes("--install"))); function resolveAdapterConstructor() { @@ -58,8 +59,9 @@ function resolveAdapterConstructor() { if (adapterPath) { try { const { Adapter: Adapter2 } = require2(adapterPath); - if (Adapter2) + if (Adapter2) { return Adapter2; + } } catch { } } @@ -67,30 +69,34 @@ function resolveAdapterConstructor() { if (adapterPath) { try { const { Adapter: Adapter2 } = require2(adapterPath); - if (Adapter2) + if (Adapter2) { return Adapter2; + } } catch { } } adapterPath = path.join(controllerDir, "build/cjs/lib/adapter.js"); try { const Adapter2 = require2(adapterPath); - if (Adapter2) + if (Adapter2) { return Adapter2; + } } catch { } adapterPath = path.join(controllerDir, "build/lib/adapter.js"); try { const Adapter2 = require2(adapterPath); - if (Adapter2) + if (Adapter2) { return Adapter2; + } } catch { } adapterPath = path.join(controllerDir, "lib/adapter.js"); try { const Adapter2 = require2(adapterPath); - if (Adapter2) + if (Adapter2) { return Adapter2; + } } catch { } throw new Error("Cannot resolve adapter class"); diff --git a/build/cjs/utils.js.map b/build/cjs/utils.js.map index e6a6669..1f9d0fd 100644 --- a/build/cjs/utils.js.map +++ b/build/cjs/utils.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../esm/utils.js"], - "sourcesContent": ["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { createRequire } from \"node:module\";\nimport { scanForPackage, tryResolvePackage } from \"./helpers.js\";\n// eslint-disable-next-line unicorn/prefer-module\nconst require = createRequire(import.meta.url || \"file://\" + __filename);\n/**\n * Resolves the root directory of JS-Controller and returns it or exits the process\n * @param isInstall Whether the adapter is run in \"install\" mode or if it should execute normally\n */\nfunction getControllerDir(isInstall) {\n // Find the js-controller location\n const possibilities = [\"iobroker.js-controller\", \"ioBroker.js-controller\"];\n // First try to let Node.js resolve the package by itself\n let controllerDir = tryResolvePackage(possibilities);\n // Apparently, checking vs null/undefined may miss the odd case of controllerPath being \"\"\n // Thus we check for falsyness, which includes failing on an empty path\n if (controllerDir)\n return controllerDir;\n // As a fallback solution, we walk up the directory tree until we reach the root or find js-controller\n controllerDir = scanForPackage(possibilities);\n if (controllerDir)\n return controllerDir;\n if (!isInstall) {\n console.log(\"Cannot find js-controller\");\n return process.exit(10);\n }\n else {\n return process.exit();\n }\n}\n/** The root directory of JS-Controller */\nexport const controllerDir = getControllerDir(!!process?.argv?.includes(\"--install\"));\nfunction resolveAdapterConstructor() {\n // Attempt 1: Resolve @iobroker/js-controller-adapter from here - JS-Controller 4.1+\n let adapterPath = tryResolvePackage([\"@iobroker/js-controller-adapter\"]);\n if (adapterPath) {\n try {\n const { Adapter } = require(adapterPath);\n if (Adapter)\n return Adapter;\n }\n catch {\n // did not work, continue\n }\n }\n // Attempt 2: Resolve @iobroker/js-controller-adapter in JS-Controller dir - JS-Controller 4.1+\n adapterPath = tryResolvePackage([\"@iobroker/js-controller-adapter\"], [path.join(controllerDir, \"node_modules\")]);\n if (adapterPath) {\n try {\n const { Adapter } = require(adapterPath);\n if (Adapter)\n return Adapter;\n }\n catch {\n // did not work, continue\n }\n }\n // Attempt 3: JS-Controller 6+ with adapter stub\n adapterPath = path.join(controllerDir, \"build/cjs/lib/adapter.js\");\n try {\n // This was a default export prior to the TS migration\n const Adapter = require(adapterPath);\n if (Adapter)\n return Adapter;\n }\n catch {\n // did not work, continue\n }\n // Attempt 4: JS-Controller 4.1+ with adapter stub\n adapterPath = path.join(controllerDir, \"build/lib/adapter.js\");\n try {\n // This was a default export prior to the TS migration\n const Adapter = require(adapterPath);\n if (Adapter)\n return Adapter;\n }\n catch {\n // did not work, continue\n }\n // Attempt 5: Legacy resolve - until JS-Controller 4.0\n adapterPath = path.join(controllerDir, \"lib/adapter.js\");\n try {\n // This was a default export prior to the TS migration\n const Adapter = require(adapterPath);\n if (Adapter)\n return Adapter;\n }\n catch {\n // did not work, continue\n }\n throw new Error(\"Cannot resolve adapter class\");\n return process.exit(10);\n}\n/** Reads the configuration file of JS-Controller */\nexport function getConfig() {\n return JSON.parse(fs.readFileSync(path.join(controllerDir, \"conf/iobroker.json\"), \"utf8\"));\n}\n/** Creates a new adapter instance */\nexport const adapter = resolveAdapterConstructor();\n/** Creates a new adapter instance */\nexport const Adapter = adapter;\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AACtB,yBAA8B;AAC9B,qBAAkD;AAHlD;AAAA;AAKA,MAAMA,eAAU,kCAAc,YAAY,OAAO,YAAY,UAAU;AAKvE,SAAS,iBAAiB,WAAW;AAEjC,QAAM,gBAAgB,CAAC,0BAA0B,wBAAwB;AAEzE,MAAIC,qBAAgB,kCAAkB,aAAa;AAGnD,MAAIA;AACA,WAAOA;AAEX,EAAAA,qBAAgB,+BAAe,aAAa;AAC5C,MAAIA;AACA,WAAOA;AACX,MAAI,CAAC,WAAW;AACZ,YAAQ,IAAI,2BAA2B;AACvC,WAAO,QAAQ,KAAK,EAAE;AAAA,EAC1B,OACK;AACD,WAAO,QAAQ,KAAK;AAAA,EACxB;AACJ;AAEO,MAAM,gBAAgB,iBAAiB,CAAC,GAAC,wCAAS,SAAT,mBAAe,SAAS,aAAY;AACpF,SAAS,4BAA4B;AAEjC,MAAI,kBAAc,kCAAkB,CAAC,iCAAiC,CAAC;AACvE,MAAI,aAAa;AACb,QAAI;AACA,YAAM,EAAE,SAAAC,SAAQ,IAAIF,SAAQ,WAAW;AACvC,UAAIE;AACA,eAAOA;AAAA,IACf,QACA;AAAA,IAEA;AAAA,EACJ;AAEA,oBAAc,kCAAkB,CAAC,iCAAiC,GAAG,CAAC,KAAK,KAAK,eAAe,cAAc,CAAC,CAAC;AAC/G,MAAI,aAAa;AACb,QAAI;AACA,YAAM,EAAE,SAAAA,SAAQ,IAAIF,SAAQ,WAAW;AACvC,UAAIE;AACA,eAAOA;AAAA,IACf,QACA;AAAA,IAEA;AAAA,EACJ;AAEA,gBAAc,KAAK,KAAK,eAAe,0BAA0B;AACjE,MAAI;AAEA,UAAMA,WAAUF,SAAQ,WAAW;AACnC,QAAIE;AACA,aAAOA;AAAA,EACf,QACA;AAAA,EAEA;AAEA,gBAAc,KAAK,KAAK,eAAe,sBAAsB;AAC7D,MAAI;AAEA,UAAMA,WAAUF,SAAQ,WAAW;AACnC,QAAIE;AACA,aAAOA;AAAA,EACf,QACA;AAAA,EAEA;AAEA,gBAAc,KAAK,KAAK,eAAe,gBAAgB;AACvD,MAAI;AAEA,UAAMA,WAAUF,SAAQ,WAAW;AACnC,QAAIE;AACA,aAAOA;AAAA,EACf,QACA;AAAA,EAEA;AACA,QAAM,IAAI,MAAM,8BAA8B;AAC9C,SAAO,QAAQ,KAAK,EAAE;AAC1B;AAEO,SAAS,YAAY;AACxB,SAAO,KAAK,MAAM,GAAG,aAAa,KAAK,KAAK,eAAe,oBAAoB,GAAG,MAAM,CAAC;AAC7F;AAEO,MAAM,UAAU,0BAA0B;AAE1C,MAAM,UAAU;", + "sourcesContent": ["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { createRequire } from \"node:module\";\nimport { scanForPackage, tryResolvePackage } from \"./helpers.js\";\n// eslint-disable-next-line unicorn/prefer-module\nconst require = createRequire(import.meta.url || `file://${__filename}`);\n/**\n * Resolves the root directory of JS-Controller and returns it or exits the process\n * @param isInstall Whether the adapter is run in \"install\" mode or if it should execute normally\n */\nfunction getControllerDir(isInstall) {\n // Find the js-controller location\n const possibilities = [\"iobroker.js-controller\", \"ioBroker.js-controller\"];\n // First, try to let Node.js resolve the package by itself\n let controllerDir = tryResolvePackage(possibilities);\n // Apparently, checking vs. null/undefined may miss the odd case of controllerPath being \"\"\n // Thus we check for falseness, which includes failing on an empty path\n if (controllerDir) {\n return controllerDir;\n }\n // As a fallback solution, we walk up the directory tree until we reach the root or find js-controller\n controllerDir = scanForPackage(possibilities);\n if (controllerDir) {\n return controllerDir;\n }\n if (!isInstall) {\n console.log(\"Cannot find js-controller\");\n return process.exit(10);\n }\n return process.exit();\n}\n/** The root directory of JS-Controller */\nexport const controllerDir = getControllerDir(!!process?.argv?.includes(\"--install\"));\nfunction resolveAdapterConstructor() {\n // Attempt 1: Resolve @iobroker/js-controller-adapter from here - JS-Controller 4.1+\n let adapterPath = tryResolvePackage([\"@iobroker/js-controller-adapter\"]);\n if (adapterPath) {\n try {\n const { Adapter } = require(adapterPath);\n if (Adapter) {\n return Adapter;\n }\n }\n catch {\n // did not work, continue\n }\n }\n // Attempt 2: Resolve @iobroker/js-controller-adapter in JS-Controller dir - JS-Controller 4.1+\n adapterPath = tryResolvePackage([\"@iobroker/js-controller-adapter\"], [path.join(controllerDir, \"node_modules\")]);\n if (adapterPath) {\n try {\n const { Adapter } = require(adapterPath);\n if (Adapter) {\n return Adapter;\n }\n }\n catch {\n // did not work, continue\n }\n }\n // Attempt 3: JS-Controller 6+ with adapter stub\n adapterPath = path.join(controllerDir, \"build/cjs/lib/adapter.js\");\n try {\n // This was a default export prior to the TS migration\n const Adapter = require(adapterPath);\n if (Adapter) {\n return Adapter;\n }\n }\n catch {\n // did not work, continue\n }\n // Attempt 4: JS-Controller 4.1+ with adapter stub\n adapterPath = path.join(controllerDir, \"build/lib/adapter.js\");\n try {\n // This was a default export prior to the TS migration\n const Adapter = require(adapterPath);\n if (Adapter) {\n return Adapter;\n }\n }\n catch {\n // did not work, continue\n }\n // Attempt 5: Legacy resolve - until JS-Controller 4.0\n adapterPath = path.join(controllerDir, \"lib/adapter.js\");\n try {\n // This was a default export prior to the TS migration\n const Adapter = require(adapterPath);\n if (Adapter) {\n return Adapter;\n }\n }\n catch {\n // did not work, continue\n }\n throw new Error(\"Cannot resolve adapter class\");\n return process.exit(10);\n}\n/** Reads the configuration file of JS-Controller */\nexport function getConfig() {\n return JSON.parse(fs.readFileSync(path.join(controllerDir, \"conf/iobroker.json\"), \"utf8\"));\n}\n/** Creates a new adapter instance */\nexport const adapter = resolveAdapterConstructor();\n/** Creates a new adapter instance */\nexport const Adapter = adapter;\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AACtB,yBAA8B;AAC9B,qBAAkD;AAHlD;AAAA;AAKA,MAAMA,eAAU,kCAAc,YAAY,OAAO,UAAU,YAAY;AAKvE,SAAS,iBAAiB,WAAW;AAEjC,QAAM,gBAAgB,CAAC,0BAA0B,wBAAwB;AAEzE,MAAIC,qBAAgB,kCAAkB,aAAa;AAGnD,MAAIA,gBAAe;AACf,WAAOA;AAAA,EACX;AAEA,EAAAA,qBAAgB,+BAAe,aAAa;AAC5C,MAAIA,gBAAe;AACf,WAAOA;AAAA,EACX;AACA,MAAI,CAAC,WAAW;AACZ,YAAQ,IAAI,2BAA2B;AACvC,WAAO,QAAQ,KAAK,EAAE;AAAA,EAC1B;AACA,SAAO,QAAQ,KAAK;AACxB;AAEO,MAAM,gBAAgB,iBAAiB,CAAC,GAAC,wCAAS,SAAT,mBAAe,SAAS,aAAY;AACpF,SAAS,4BAA4B;AAEjC,MAAI,kBAAc,kCAAkB,CAAC,iCAAiC,CAAC;AACvE,MAAI,aAAa;AACb,QAAI;AACA,YAAM,EAAE,SAAAC,SAAQ,IAAIF,SAAQ,WAAW;AACvC,UAAIE,UAAS;AACT,eAAOA;AAAA,MACX;AAAA,IACJ,QACA;AAAA,IAEA;AAAA,EACJ;AAEA,oBAAc,kCAAkB,CAAC,iCAAiC,GAAG,CAAC,KAAK,KAAK,eAAe,cAAc,CAAC,CAAC;AAC/G,MAAI,aAAa;AACb,QAAI;AACA,YAAM,EAAE,SAAAA,SAAQ,IAAIF,SAAQ,WAAW;AACvC,UAAIE,UAAS;AACT,eAAOA;AAAA,MACX;AAAA,IACJ,QACA;AAAA,IAEA;AAAA,EACJ;AAEA,gBAAc,KAAK,KAAK,eAAe,0BAA0B;AACjE,MAAI;AAEA,UAAMA,WAAUF,SAAQ,WAAW;AACnC,QAAIE,UAAS;AACT,aAAOA;AAAA,IACX;AAAA,EACJ,QACA;AAAA,EAEA;AAEA,gBAAc,KAAK,KAAK,eAAe,sBAAsB;AAC7D,MAAI;AAEA,UAAMA,WAAUF,SAAQ,WAAW;AACnC,QAAIE,UAAS;AACT,aAAOA;AAAA,IACX;AAAA,EACJ,QACA;AAAA,EAEA;AAEA,gBAAc,KAAK,KAAK,eAAe,gBAAgB;AACvD,MAAI;AAEA,UAAMA,WAAUF,SAAQ,WAAW;AACnC,QAAIE,UAAS;AACT,aAAOA;AAAA,IACX;AAAA,EACJ,QACA;AAAA,EAEA;AACA,QAAM,IAAI,MAAM,8BAA8B;AAC9C,SAAO,QAAQ,KAAK,EAAE;AAC1B;AAEO,SAAS,YAAY;AACxB,SAAO,KAAK,MAAM,GAAG,aAAa,KAAK,KAAK,eAAe,oBAAoB,GAAG,MAAM,CAAC;AAC7F;AAEO,MAAM,UAAU,0BAA0B;AAE1C,MAAM,UAAU;", "names": ["require", "controllerDir", "Adapter"] } diff --git a/build/esm/controllerTools.d.ts b/build/esm/controllerTools.d.ts index 6d7c614..5197b87 100644 --- a/build/esm/controllerTools.d.ts +++ b/build/esm/controllerTools.d.ts @@ -16,7 +16,7 @@ declare function pattern2RegEx(pattern: string): string; /** * Finds the adapter directory of a given adapter * - * @param adapter name of the adapter, e.g. hm-rpc + * @param adapter name of the adapter, e.g., hm-rpc * @returns path to adapter directory or null if no directory found */ declare function getAdapterDir(adapter: string): string | null; @@ -35,7 +35,7 @@ export interface InstalledInfo { licenseUrl?: string; } /** - * Get list of all installed adapters and controller version on this host + * Get a list of all installed adapters and controller version on this host * @param hostJsControllerVersion Version of the running js-controller, will be included in the returned information if provided * @returns object containing information about installed host */ diff --git a/build/esm/controllerTools.js b/build/esm/controllerTools.js index ac0992a..f521e64 100644 --- a/build/esm/controllerTools.js +++ b/build/esm/controllerTools.js @@ -1,9 +1,9 @@ import * as path from "node:path"; +import { createRequire } from "node:module"; import { tryResolvePackage } from "./helpers.js"; import * as utils from "./utils.js"; -import { createRequire } from "node:module"; // eslint-disable-next-line unicorn/prefer-module -const require = createRequire(import.meta.url || "file://" + __filename); +const require = createRequire(import.meta.url || `file://${__filename}`); export let controllerCommonModulesInternal; function resolveControllerTools() { // Attempt 1: Resolve @iobroker/js-controller-common from here - JS-Controller 4.1+ @@ -12,8 +12,9 @@ function resolveControllerTools() { try { controllerCommonModulesInternal = require(importPath); const { tools } = controllerCommonModulesInternal; - if (tools) + if (tools) { return tools; + } } catch { // did not work, continue @@ -25,8 +26,9 @@ function resolveControllerTools() { try { controllerCommonModulesInternal = require(importPath); const { tools } = controllerCommonModulesInternal; - if (tools) + if (tools) { return tools; + } } catch { // did not work, continue @@ -37,8 +39,9 @@ function resolveControllerTools() { try { // This was a default export prior to the TS migration const tools = require(path.join(importPath, "tools")); - if (tools) + if (tools) { return tools; + } } catch { // did not work, continue @@ -48,7 +51,7 @@ function resolveControllerTools() { } /** The collection of utility functions in JS-Controller, formerly `lib/tools.js` */ export const controllerToolsInternal = resolveControllerTools(); -// Export a subset of the utilties in controllerTools +// Export a subset of the utilities in controllerTools /** * Resolve a module that is either exported by @iobroker/js-controller-common (new controllers) or located in the controller's `lib` directory (old controllers). * @param name - The filename of the module to resolve @@ -71,8 +74,9 @@ export function resolveNamedModule(name, exportName = name) { try { // This was a default export prior to the TS migration const module = require(importPath); - if (module) + if (module) { return module; + } } catch { // did not work, continue @@ -93,14 +97,14 @@ function pattern2RegEx(pattern) { /** * Finds the adapter directory of a given adapter * - * @param adapter name of the adapter, e.g. hm-rpc + * @param adapter name of the adapter, e.g., hm-rpc * @returns path to adapter directory or null if no directory found */ function getAdapterDir(adapter) { return controllerToolsInternal.getAdapterDir(adapter); } /** - * Get list of all installed adapters and controller version on this host + * Get a list of all installed adapters and controller version on this host * @param hostJsControllerVersion Version of the running js-controller, will be included in the returned information if provided * @returns object containing information about installed host */ diff --git a/build/esm/helpers.js b/build/esm/helpers.js index 5cb4ecf..0c87199 100644 --- a/build/esm/helpers.js +++ b/build/esm/helpers.js @@ -3,10 +3,10 @@ import * as path from "node:path"; import { createRequire } from "node:module"; import * as url from "node:url"; // eslint-disable-next-line unicorn/prefer-module -const require = createRequire(import.meta.url || "file://" + __filename); +const require = createRequire(import.meta.url || `file://${__filename}`); const thisDir = url.fileURLToPath( // eslint-disable-next-line unicorn/prefer-module -new URL(".", import.meta.url || "file://" + __filename)); +new URL(".", import.meta.url || `file://${__filename}`)); /** * Tries to resolve a package using Node.js resolution. * Directory names differing from the package name and alternate lookup paths can be passed. diff --git a/build/esm/utils.js b/build/esm/utils.js index 239fcc5..abaa1bf 100644 --- a/build/esm/utils.js +++ b/build/esm/utils.js @@ -3,7 +3,7 @@ import * as path from "node:path"; import { createRequire } from "node:module"; import { scanForPackage, tryResolvePackage } from "./helpers.js"; // eslint-disable-next-line unicorn/prefer-module -const require = createRequire(import.meta.url || "file://" + __filename); +const require = createRequire(import.meta.url || `file://${__filename}`); /** * Resolves the root directory of JS-Controller and returns it or exits the process * @param isInstall Whether the adapter is run in "install" mode or if it should execute normally @@ -11,23 +11,23 @@ const require = createRequire(import.meta.url || "file://" + __filename); function getControllerDir(isInstall) { // Find the js-controller location const possibilities = ["iobroker.js-controller", "ioBroker.js-controller"]; - // First try to let Node.js resolve the package by itself + // First, try to let Node.js resolve the package by itself let controllerDir = tryResolvePackage(possibilities); - // Apparently, checking vs null/undefined may miss the odd case of controllerPath being "" - // Thus we check for falsyness, which includes failing on an empty path - if (controllerDir) + // Apparently, checking vs. null/undefined may miss the odd case of controllerPath being "" + // Thus we check for falseness, which includes failing on an empty path + if (controllerDir) { return controllerDir; + } // As a fallback solution, we walk up the directory tree until we reach the root or find js-controller controllerDir = scanForPackage(possibilities); - if (controllerDir) + if (controllerDir) { return controllerDir; + } if (!isInstall) { console.log("Cannot find js-controller"); return process.exit(10); } - else { - return process.exit(); - } + return process.exit(); } /** The root directory of JS-Controller */ export const controllerDir = getControllerDir(!!process?.argv?.includes("--install")); @@ -37,8 +37,9 @@ function resolveAdapterConstructor() { if (adapterPath) { try { const { Adapter } = require(adapterPath); - if (Adapter) + if (Adapter) { return Adapter; + } } catch { // did not work, continue @@ -49,8 +50,9 @@ function resolveAdapterConstructor() { if (adapterPath) { try { const { Adapter } = require(adapterPath); - if (Adapter) + if (Adapter) { return Adapter; + } } catch { // did not work, continue @@ -61,8 +63,9 @@ function resolveAdapterConstructor() { try { // This was a default export prior to the TS migration const Adapter = require(adapterPath); - if (Adapter) + if (Adapter) { return Adapter; + } } catch { // did not work, continue @@ -72,8 +75,9 @@ function resolveAdapterConstructor() { try { // This was a default export prior to the TS migration const Adapter = require(adapterPath); - if (Adapter) + if (Adapter) { return Adapter; + } } catch { // did not work, continue @@ -83,8 +87,9 @@ function resolveAdapterConstructor() { try { // This was a default export prior to the TS migration const Adapter = require(adapterPath); - if (Adapter) + if (Adapter) { return Adapter; + } } catch { // did not work, continue diff --git a/package-lock.json b/package-lock.json index 10a573d..2d6bb8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,39 +10,39 @@ "license": "MIT", "devDependencies": { "@alcalzone/esm2cjs": "^1.1.2", - "@alcalzone/release-script": "~3.5.9", - "@alcalzone/release-script-plugin-license": "~3.5.9", - "@foxriver76/eslint-config": "^1.0.4", - "@types/chai": "^4.3.4", - "@types/chai-as-promised": "^7.1.5", - "@types/mocha": "^10.0.1", - "@types/node": "^18.15.7", - "@types/proxyquire": "^1.3.28", - "@types/sinon": "^10.0.13", - "@types/sinon-chai": "^3.2.9", - "@typescript-eslint/eslint-plugin": "^6.2.1", - "@typescript-eslint/parser": "^6.0.0", - "chai": "^4.3.7", - "chai-as-promised": "^7.1.1", + "@alcalzone/release-script": "~3.8.0", + "@alcalzone/release-script-plugin-license": "~3.7.0", + "@foxriver76/eslint-config": "^1.0.5", + "@types/chai": "^4.3.17", + "@types/chai-as-promised": "^7.1.8", + "@types/mocha": "^10.0.7", + "@types/node": "^22.1.0", + "@types/proxyquire": "^1.3.31", + "@types/sinon": "^17.0.3", + "@types/sinon-chai": "^3.2.12", + "@typescript-eslint/eslint-plugin": "^8.0.1", + "@typescript-eslint/parser": "^8.0.1", + "chai": "^4.5.0", + "chai-as-promised": "^7.1.2", "cpy-cli": "^4.2.0", - "eslint": "^8.41.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-prettier": "^5.1.3", - "mocha": "^10.2.0", - "prettier": "^3.2.5", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.2.1", + "mocha": "^10.7.0", + "prettier": "^3.3.3", "proxyquire": "^2.1.3", - "rimraf": "^3.0.2", - "sinon": "^15.1.0", + "rimraf": "^5.0.10", + "sinon": "^18.0.0", "sinon-chai": "^3.7.0", "source-map-support": "^0.5.21", - "ts-node": "^10.9.1", - "typescript": "^5.4.5" + "ts-node": "^10.9.2", + "typescript": "^5.5.4" }, "engines": { "npm": ">=7.0.0" }, "peerDependencies": { - "@iobroker/types": "^6.0.9" + "@iobroker/types": "^6.0.10" } }, "node_modules/@alcalzone/esm2cjs": { @@ -61,43 +61,59 @@ } }, "node_modules/@alcalzone/pak": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@alcalzone/pak/-/pak-0.8.1.tgz", - "integrity": "sha512-sPdxNxdXLH96kbyWLdIljVSIY2N6/qnPqkq5AlWvuizjGQUwHIUtWZHLss9XNDV/hY7YkgdIb9ILHbMTnRBxVQ==", + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@alcalzone/pak/-/pak-0.10.2.tgz", + "integrity": "sha512-v+kM7HlfIVNLDlGBcbZvrG3yVK3rPLH5kIoGRJbCcoHwpUqQbfEMzXAy1ZrfP+zbI5phHw2PhgrXZr3z6nh7Ow==", "dev": true, "dependencies": { - "axios": "^0.26.0", - "execa": "^5.0.0", - "fs-extra": "^10.0.1" + "axios": "^1.6.2", + "execa": "~5.0.1", + "fs-extra": "^10.1.0", + "semver": "^7.3.7", + "tiny-glob": "^0.2.9" } }, - "node_modules/@alcalzone/pak/node_modules/axios": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", - "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "node_modules/@alcalzone/pak/node_modules/execa": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.1.tgz", + "integrity": "sha512-4hFTjFbFzQa3aCLobpbPJR/U+VoL1wdV5ozOWjeet0AWDeYr9UFGM1eUFWHX+VtOWFq4p0xXUXfW1YxUaP4fpw==", "dev": true, "dependencies": { - "follow-redirects": "^1.14.8" + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, "node_modules/@alcalzone/release-script": { - "version": "3.5.9", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script/-/release-script-3.5.9.tgz", - "integrity": "sha512-2qBUyh+wd/7KToZGXrJDp8v1nos1jm+xsDiSvI2jv5Co+105N415DCJNtgOvR6s2+/G2lbIZ08oYopl+evHgkw==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script/-/release-script-3.8.0.tgz", + "integrity": "sha512-9H3imn8o9n3Ekpkie9TMgPeJfgT6WmklCMtOZ1wuwvMw/obNA0Ao1ZZ8CJfHk1YNjiLGmWn0kQFEGTqz4DoD7w==", "dev": true, "dependencies": { - "@alcalzone/release-script-core": "3.5.9", - "@alcalzone/release-script-plugin-changelog": "3.5.9", - "@alcalzone/release-script-plugin-exec": "3.5.9", - "@alcalzone/release-script-plugin-git": "3.5.9", - "@alcalzone/release-script-plugin-package": "3.5.9", - "@alcalzone/release-script-plugin-version": "3.5.9", + "@alcalzone/release-script-core": "3.7.0", + "@alcalzone/release-script-plugin-changelog": "3.7.0", + "@alcalzone/release-script-plugin-exec": "3.7.0", + "@alcalzone/release-script-plugin-git": "3.8.0", + "@alcalzone/release-script-plugin-package": "3.7.3", + "@alcalzone/release-script-plugin-version": "3.7.0", "alcalzone-shared": "^4.0.1", - "axios": "^0.27.1", + "axios": "^1.6.2", "enquirer": "^2.3.6", "fs-extra": "^10.1.0", "picocolors": "1.0.0", - "semver": "^7.3.7", + "semver": "^7.5.2", "source-map-support": "^0.5.21", "yargs": "^17.4.1" }, @@ -109,9 +125,9 @@ } }, "node_modules/@alcalzone/release-script-core": { - "version": "3.5.9", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-core/-/release-script-core-3.5.9.tgz", - "integrity": "sha512-rRxosfZMtpDcIm+sPTdwP5oVRBLX1WLYImrp0nUhqOPNN/UD5l9TxNVXDhGUsstXhaRXXBYS2BnOQwR308OfyA==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-core/-/release-script-core-3.7.0.tgz", + "integrity": "sha512-4np4dBziwX/aNRhS/gpK8bwa0wpLe7oomzJ7YTUXf5bUtV/UTpN2a9tm5Bp7ElnisKj6N3AqHl4lVXRo4L9hYg==", "dev": true, "dependencies": { "execa": "^5.1.1" @@ -121,12 +137,12 @@ } }, "node_modules/@alcalzone/release-script-plugin-changelog": { - "version": "3.5.9", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-changelog/-/release-script-plugin-changelog-3.5.9.tgz", - "integrity": "sha512-KmOMbjd7ta/Wl2OWQUxMpNza6Sr5/sB7AfV7BC0uCl839StnoivSjqywDfNcgJq97fxMs7hnGT/uYaz7oTUm7A==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-changelog/-/release-script-plugin-changelog-3.7.0.tgz", + "integrity": "sha512-AlLOIjIPP42uBmvcdYkfijYDzolyY6JmfbTmdxQDBLyrgYXnuUr2GaKxbpeWSbvcAuUhNvHCAyI6LI90X3OTEg==", "dev": true, "dependencies": { - "@alcalzone/release-script-core": "3.5.9", + "@alcalzone/release-script-core": "3.7.0", "alcalzone-shared": "^4.0.1", "fs-extra": "^10.1.0" }, @@ -135,12 +151,12 @@ } }, "node_modules/@alcalzone/release-script-plugin-exec": { - "version": "3.5.9", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-exec/-/release-script-plugin-exec-3.5.9.tgz", - "integrity": "sha512-Y6OM+gEpfYYoDvHdzNUtgVZiBAgOzGWZk9yRPF5l8UWE3+tQAyMWavk2m08ExbEICfGV1lb8lRBzAdQaf7/0HA==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-exec/-/release-script-plugin-exec-3.7.0.tgz", + "integrity": "sha512-ZhlKGhxa71mLyYB1/ojzik2RKcSAeIjuwKzlWRd6oUvKoZPe7eAjLYneXx5viQC6tvDJE4dvN1NlkFGWsSlZYA==", "dev": true, "dependencies": { - "@alcalzone/release-script-core": "3.5.9", + "@alcalzone/release-script-core": "3.7.0", "alcalzone-shared": "^4.0.1" }, "engines": { @@ -148,12 +164,12 @@ } }, "node_modules/@alcalzone/release-script-plugin-git": { - "version": "3.5.9", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-git/-/release-script-plugin-git-3.5.9.tgz", - "integrity": "sha512-LT8YSevyLqZFI4rx4ET1qRnqTNnU5rVmQvGFCnC+d375zU5/U2cu19s/WVLChMHkvmUbAwBld+xhqqos2hQrKw==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-git/-/release-script-plugin-git-3.8.0.tgz", + "integrity": "sha512-rI9EqSmvMWaNZ5xxOUBZjD4WOv1Enl+/ZxhUoTROq+K/9RYYHQaAXilGWNvnz2DYr14Q+Yx/fs54GXgAVf0scg==", "dev": true, "dependencies": { - "@alcalzone/release-script-core": "3.5.9", + "@alcalzone/release-script-core": "3.7.0", "fs-extra": "^10.1.0" }, "engines": { @@ -161,12 +177,12 @@ } }, "node_modules/@alcalzone/release-script-plugin-license": { - "version": "3.5.9", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-license/-/release-script-plugin-license-3.5.9.tgz", - "integrity": "sha512-Wa+RN968zYK0ZNkkaIRfD3Ru2ndWLD5e+VNbah4krtoeHqvQDiOPlfcWM0McU8q3ud+AMPwhYEwR1mh2lwi0gg==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-license/-/release-script-plugin-license-3.7.0.tgz", + "integrity": "sha512-HLnKHr3pc6NJJ7zAa8S/SdC305oEurnkRa9XNP5F6rgrixsxUiynBVh0tpPsVsOTdndm7fNIBRfR66IGnw0cag==", "dev": true, "dependencies": { - "@alcalzone/release-script-core": "3.5.9", + "@alcalzone/release-script-core": "3.7.0", "fs-extra": "^10.1.0", "tiny-glob": "^0.2.9" }, @@ -175,31 +191,31 @@ } }, "node_modules/@alcalzone/release-script-plugin-package": { - "version": "3.5.9", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-package/-/release-script-plugin-package-3.5.9.tgz", - "integrity": "sha512-jYmWzm9Dvnnc6RWTrZApQbeXzaFYSrHqkEHViAtx5NvBztfH3ANwVl6jS4UEaMm2NbIIq6toWGznVvNtnVzEjg==", + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-package/-/release-script-plugin-package-3.7.3.tgz", + "integrity": "sha512-5oKSwbvHs9jRhARJ04eQ7xqig3a7NmPJlhtBxAqUM8+0cjs2g/V1xTxM6o8aZ09uRSdq80YGVxJm871SyszAWQ==", "dev": true, "dependencies": { - "@alcalzone/pak": "^0.8.1", - "@alcalzone/release-script-core": "3.5.9", + "@alcalzone/pak": "^0.10.1", + "@alcalzone/release-script-core": "3.7.0", "alcalzone-shared": "^4.0.1", "fs-extra": "^10.1.0", - "semver": "^7.3.7" + "semver": "^7.5.2" }, "engines": { "node": ">=12.20" } }, "node_modules/@alcalzone/release-script-plugin-version": { - "version": "3.5.9", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-version/-/release-script-plugin-version-3.5.9.tgz", - "integrity": "sha512-CYN49aXx4QSFRWQN11wCC13SK1ZygILlohYlUFkRiA0g6u2G7z1rjW8QZSLXrR6C6gxzR4zL12VJ/xFZqYeuZA==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-version/-/release-script-plugin-version-3.7.0.tgz", + "integrity": "sha512-030NGQeB+mglVz/58cx0WO4QiFChaSd/pz35mnOrUc9PbKWRpzisTVOt4IhCV/++YiAVibJO31NMNzvipPdx4Q==", "dev": true, "dependencies": { - "@alcalzone/release-script-core": "3.5.9", + "@alcalzone/release-script-core": "3.7.0", "alcalzone-shared": "^4.0.1", "fs-extra": "^10.1.0", - "semver": "^7.3.7", + "semver": "^7.5.2", "tiny-glob": "^0.2.9" }, "engines": { @@ -452,19 +468,19 @@ } }, "node_modules/@foxriver76/eslint-config": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@foxriver76/eslint-config/-/eslint-config-1.0.4.tgz", - "integrity": "sha512-iWEHs3COV5WI861f2b1XHBjNtwT4o1bdzJA31pNJnxVxIPS23uOCIZl9fi4+6IsPI187WgBrVdl9ARHmESIxGQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@foxriver76/eslint-config/-/eslint-config-1.0.5.tgz", + "integrity": "sha512-lNtsRoW03BTTCJTe+Ghl5CipZMCzBz5ca7q6DNpSgCaBd4gRcdX3Bb5axx26wy1k4ytimJrtN7XU7087kifOfw==", "dev": true, "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^6.2.1", - "@typescript-eslint/parser": "^6.2.1", - "eslint": "^8.48.0", - "eslint-config-prettier": "^8.10.0", - "eslint-plugin-jsdoc": "^48.2.1", - "eslint-plugin-prettier": "^5.0.0", - "eslint-plugin-unicorn": "^52.0.0", - "prettier": "^3.0.1" + "@typescript-eslint/eslint-plugin": "^8.0.0", + "@typescript-eslint/parser": "^8.0.0", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-jsdoc": "^48.11.0", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-unicorn": "^55.0.0", + "prettier": "^3.3.3" } }, "node_modules/@humanwhocodes/config-array": { @@ -525,14 +541,110 @@ "dev": true }, "node_modules/@iobroker/types": { - "version": "6.0.9", - "resolved": "https://registry.npmjs.org/@iobroker/types/-/types-6.0.9.tgz", - "integrity": "sha512-8+u5c/cawj5cmnQaW95TJv1vBMs68GaepPko7urvylGfixPE/vJ0nwNq392v67B52PwHPi41kctmR9gNt9M+tw==", + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/@iobroker/types/-/types-6.0.10.tgz", + "integrity": "sha512-3OT4a4QbLuWujobiea+zWA5JIksVdf0diZYzxcEv8W5BuvV5DUR3HlCUzXhLfF6X8Jgc+uFt3wRQ1s+m9v4/aw==", "peer": true, "engines": { "node": ">=12.0.0" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", @@ -593,6 +705,16 @@ "node": ">= 8" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@pkgr/core": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", @@ -615,9 +737,9 @@ } }, "node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "version": "11.2.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz", + "integrity": "sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==", "dev": true, "dependencies": { "@sinonjs/commons": "^3.0.0" @@ -674,9 +796,9 @@ "dev": true }, "node_modules/@types/chai": { - "version": "4.3.16", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.16.tgz", - "integrity": "sha512-PatH4iOdyh3MyWtmHVFXLWCCIhUbopaltqddG9BzB+gMIzee2MJrvd+jouii9Z3wzQJruGWAm7WOMjgfG8hQlQ==", + "version": "4.3.17", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.17.tgz", + "integrity": "sha512-zmZ21EWzR71B4Sscphjief5djsLre50M6lI622OSySTmn9DB3j+C3kWroHfBQWXbOBwbgg/M8CG/hUxDLIloow==", "dev": true }, "node_modules/@types/chai-as-promised": { @@ -688,12 +810,6 @@ "@types/chai": "*" } }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, "node_modules/@types/minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", @@ -707,12 +823,12 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.19.42", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.42.tgz", - "integrity": "sha512-d2ZFc/3lnK2YCYhos8iaNIYu9Vfhr92nHiyJHRltXWjXUBjEE+A4I58Tdbnw4VhggSW+2j5y5gTrLs4biNnubg==", + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", + "integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==", "dev": true, "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.13.0" } }, "node_modules/@types/normalize-package-data": { @@ -727,16 +843,10 @@ "integrity": "sha512-uALowNG2TSM1HNPMMOR0AJwv4aPYPhqB0xlEhkeRTMuto5hjoSPZkvgu1nbPUkz3gEPAHv4sy4DmKsurZiEfRQ==", "dev": true }, - "node_modules/@types/semver": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", - "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", - "dev": true - }, "node_modules/@types/sinon": { - "version": "10.0.20", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.20.tgz", - "integrity": "sha512-2APKKruFNCAZgx3daAyACGzWuJ028VVCUDk6o2rw/Z4PXT0ogwdV4KUegW0MwVs0Zu59auPXbbuBJHF12Sx1Eg==", + "version": "17.0.3", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.3.tgz", + "integrity": "sha512-j3uovdn8ewky9kRBG19bOwaZbexJu/XjtkHyjvUgt4xfPFz18dcORIMqnYh66Fx3Powhcr85NT5+er3+oViapw==", "dev": true, "dependencies": { "@types/sinonjs__fake-timers": "*" @@ -759,33 +869,31 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", - "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.1.tgz", + "integrity": "sha512-5g3Y7GDFsJAnY4Yhvk8sZtFfV6YNF2caLzjrRPUBzewjPCaj0yokePB4LJSobyCzGMzjZZYFbwuzbfDHlimXbQ==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/type-utils": "6.21.0", - "@typescript-eslint/utils": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", - "debug": "^4.3.4", + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/type-utils": "8.0.1", + "@typescript-eslint/utils": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", "graphemer": "^1.4.0", - "ignore": "^5.2.4", + "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", - "eslint": "^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -794,26 +902,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", - "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.0.1.tgz", + "integrity": "sha512-5IgYJ9EO/12pOUwiBKFkpU7rS3IU21mtXzB81TNwq2xEybcmAZrE9qwDtsb5uQd9aVO9o0fdabFyAmKveXyujg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/typescript-estree": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", "debug": "^4.3.4" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -822,16 +930,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", - "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.1.tgz", + "integrity": "sha512-NpixInP5dm7uukMiRyiHjRKkom5RIFA4dfiHvalanD2cF0CLUuQqxfg8PtEUo9yqJI2bBhF+pcSafqnG3UBnRQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0" + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -839,26 +947,23 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", - "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.0.1.tgz", + "integrity": "sha512-+/UT25MWvXeDX9YaHv1IS6KI1fiuTto43WprE7pgSMswHbn1Jm9GEM4Txp+X74ifOWV8emu2AWcbLhpJAvD5Ng==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/typescript-estree": "8.0.1", + "@typescript-eslint/utils": "8.0.1", "debug": "^4.3.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" - }, "peerDependenciesMeta": { "typescript": { "optional": true @@ -866,12 +971,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", - "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.1.tgz", + "integrity": "sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==", "dev": true, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -879,22 +984,22 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", - "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.1.tgz", + "integrity": "sha512-8V9hriRvZQXPWU3bbiUV4Epo7EvgM6RTs+sUmxp5G//dBGy402S7Fx0W0QkB2fb4obCF8SInoUzvTYtc3bkb5w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -907,41 +1012,38 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", - "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.0.1.tgz", + "integrity": "sha512-CBFR0G0sCt0+fzfnKaciu9IBsKvEKYwN9UZ+eeogK1fYHg4Qxk1yf/wLQkLXlq8wbU2dFlgAesxt8Gi76E8RTA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "semver": "^7.5.4" + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/typescript-estree": "8.0.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.57.0 || ^9.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", - "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.1.tgz", + "integrity": "sha512-W5E+o0UfUcK5EgchLZsyVWqARmsM7v54/qEq6PY3YI5arkgmCzHiuk0zKSJJbm71V0xdRna4BGomkCTXz2/LkQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", - "eslint-visitor-keys": "^3.4.1" + "@typescript-eslint/types": "8.0.1", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -1148,13 +1250,14 @@ "dev": true }, "node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.3.tgz", + "integrity": "sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==", "dev": true, "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, "node_modules/balanced-match": { @@ -1203,9 +1306,9 @@ "dev": true }, "node_modules/browserslist": { - "version": "4.23.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz", - "integrity": "sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==", + "version": "4.23.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", + "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", "dev": true, "funding": [ { @@ -1223,9 +1326,9 @@ ], "peer": true, "dependencies": { - "caniuse-lite": "^1.0.30001640", - "electron-to-chromium": "^1.4.820", - "node-releases": "^2.0.14", + "caniuse-lite": "^1.0.30001646", + "electron-to-chromium": "^1.5.4", + "node-releases": "^2.0.18", "update-browserslist-db": "^1.1.0" }, "bin": { @@ -1306,9 +1409,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001643", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz", - "integrity": "sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==", + "version": "1.0.30001649", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001649.tgz", + "integrity": "sha512-fJegqZZ0ZX8HOWr6rcafGr72+xcgJKI9oWfDW5DrD7ExUtgZC7a7R7ZYmZqplh7XDocFdGeIFn7roAxhOeYrPQ==", "dev": true, "funding": [ { @@ -1327,9 +1430,9 @@ "peer": true }, "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", "dev": true, "dependencies": { "assertion-error": "^1.1.0", @@ -1338,7 +1441,7 @@ "get-func-name": "^2.0.2", "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.8" + "type-detect": "^4.1.0" }, "engines": { "node": ">=4" @@ -1356,6 +1459,15 @@ "chai": ">= 2.1.2 < 6" } }, + "node_modules/chai/node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -1547,13 +1659,13 @@ "dev": true }, "node_modules/core-js-compat": { - "version": "3.37.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.1.tgz", - "integrity": "sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==", + "version": "3.38.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.0.tgz", + "integrity": "sha512-75LAicdLa4OJVwFxFbQR3NdnZjNgX6ILpVcVzcC4T2smerB5lELMrJQQQoWV6TiuC/vlaFqgU2tKQx9w5s0e0A==", "dev": true, "peer": true, "dependencies": { - "browserslist": "^4.23.0" + "browserslist": "^4.23.3" }, "funding": { "type": "opencollective", @@ -1793,10 +1905,16 @@ "node": ">=6.0.0" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, "node_modules/electron-to-chromium": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.0.tgz", - "integrity": "sha512-Vb3xHHYnLseK8vlMJQKJYXJ++t4u1/qJ3vykuVrVjvdiOEhYyT1AuP4x03G8EnPmYvYOhe9T+dADTmthjRQMkA==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.4.tgz", + "integrity": "sha512-orzA81VqLyIGUEA77YkVA1D+N+nNfl2isJVjjmOyrlxuooZ19ynb+dOlaDTqd/idKRS9lDCSBmtzM+kyCsMnkA==", "dev": true, "peer": true }, @@ -2269,9 +2387,9 @@ } }, "node_modules/eslint-config-prettier": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz", - "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" @@ -2281,9 +2399,9 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "48.8.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.8.3.tgz", - "integrity": "sha512-AtIvwwW9D17MRkM0Z0y3/xZYaa9mdAvJrkY6fU/HNUwGbmMtHVvK4qRM9CDixGVtfNrQitb8c6zQtdh6cTOvLg==", + "version": "48.11.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.11.0.tgz", + "integrity": "sha512-d12JHJDPNo7IFwTOAItCeJY1hcqoIxE0lHA8infQByLilQ9xkqrRa6laWCnsuCrf+8rUnvxXY1XuTbibRBNylA==", "dev": true, "peer": true, "dependencies": { @@ -2292,6 +2410,7 @@ "comment-parser": "1.4.1", "debug": "^4.3.5", "escape-string-regexp": "^4.0.0", + "espree": "^10.1.0", "esquery": "^1.6.0", "parse-imports": "^2.1.1", "semver": "^7.6.3", @@ -2305,6 +2424,37 @@ "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" } }, + "node_modules/eslint-plugin-jsdoc/node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true, + "peer": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/espree": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", + "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==", + "dev": true, + "peer": true, + "dependencies": { + "acorn": "^8.12.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint-plugin-prettier": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", @@ -2336,19 +2486,19 @@ } }, "node_modules/eslint-plugin-unicorn": { - "version": "52.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-52.0.0.tgz", - "integrity": "sha512-1Yzm7/m+0R4djH0tjDjfVei/ju2w3AzUGjG6q8JnuNIL5xIwsflyCooW5sfBvQp2pMYQFSWWCFONsjCax1EHng==", + "version": "55.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-55.0.0.tgz", + "integrity": "sha512-n3AKiVpY2/uDcGrS3+QsYDkjPfaOrNrsfQxU9nt5nitd9KuvVXrfAvgCO9DYPSfap+Gqjw9EOrXIsBp5tlHZjA==", "dev": true, "peer": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.24.5", "@eslint-community/eslint-utils": "^4.4.0", - "@eslint/eslintrc": "^2.1.4", "ci-info": "^4.0.0", "clean-regexp": "^1.0.0", - "core-js-compat": "^3.34.0", + "core-js-compat": "^3.37.0", "esquery": "^1.5.0", + "globals": "^15.7.0", "indent-string": "^4.0.0", "is-builtin-module": "^3.2.1", "jsesc": "^3.0.2", @@ -2356,11 +2506,11 @@ "read-pkg-up": "^7.0.1", "regexp-tree": "^0.1.27", "regjsparser": "^0.10.0", - "semver": "^7.5.4", + "semver": "^7.6.1", "strip-indent": "^3.0.0" }, "engines": { - "node": ">=16" + "node": ">=18.18" }, "funding": { "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" @@ -2369,6 +2519,19 @@ "eslint": ">=8.56.0" } }, + "node_modules/eslint-plugin-unicorn/node_modules/globals": { + "version": "15.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.9.0.tgz", + "integrity": "sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", @@ -2638,6 +2801,65 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/flat-cache/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/flat-cache/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/flat-cache/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/flat-cache/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/flatted": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", @@ -2664,6 +2886,34 @@ } } }, + "node_modules/foreground-child": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", + "integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -3120,6 +3370,21 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3508,9 +3773,9 @@ } }, "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -3545,6 +3810,15 @@ "node": ">=0.10.0" } }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mocha": { "version": "10.7.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.0.tgz", @@ -3667,9 +3941,9 @@ "dev": true }, "node_modules/nise": { - "version": "5.1.9", - "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.9.tgz", - "integrity": "sha512-qOnoujW4SV6e40dYxJOb3uvuoPHtmLzIk4TFo+j0jPJoC+5Z9xja5qH5JZobEPsa8+YYphMrOSwnrshEhG2qww==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/nise/-/nise-6.0.0.tgz", + "integrity": "sha512-K8ePqo9BFvN31HXwEtTNGzgrPpmvgciDsFz8aztFjt4LqKO/JeFD8tBOeuDiCMXrIl/m1YvfH8auSpxfaD09wg==", "dev": true, "dependencies": { "@sinonjs/commons": "^3.0.0", @@ -3679,15 +3953,6 @@ "path-to-regexp": "^6.2.1" } }, - "node_modules/nise/node_modules/@sinonjs/fake-timers": { - "version": "11.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz", - "integrity": "sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^3.0.0" - } - }, "node_modules/node-releases": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", @@ -3878,6 +4143,12 @@ "node": ">=6" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "dev": true + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -3955,6 +4226,28 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true + }, "node_modules/path-to-regexp": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.2.tgz", @@ -4043,6 +4336,12 @@ "node": ">=6.0.0" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, "node_modules/proxyquire": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-2.1.3.tgz", @@ -4378,64 +4677,40 @@ } }, "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", "dev": true, "dependencies": { - "glob": "^7.1.3" + "glob": "^10.3.7" }, "bin": { - "rimraf": "bin.js" + "rimraf": "dist/esm/bin.mjs" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/rimraf/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, - "engines": { - "node": "*" + "bin": { + "glob": "dist/esm/bin.mjs" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -4528,18 +4803,17 @@ "dev": true }, "node_modules/sinon": { - "version": "15.2.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-15.2.0.tgz", - "integrity": "sha512-nPS85arNqwBXaIsFCkolHjGIkFo+Oxu9vbgmBJizLAhqe6P2o3Qmj3KCUoRkfhHtvgDhZdWD3risLHAUJ8npjw==", - "deprecated": "16.1.1", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-18.0.0.tgz", + "integrity": "sha512-+dXDXzD1sBO6HlmZDd7mXZCR/y5ECiEiGCBSGuFD/kZ0bDTofPYc6JaeGmPSF+1j1MejGUWkORbYOLDyvqCWpA==", "dev": true, "dependencies": { - "@sinonjs/commons": "^3.0.0", - "@sinonjs/fake-timers": "^10.3.0", + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^11.2.2", "@sinonjs/samsam": "^8.0.0", - "diff": "^5.1.0", - "nise": "^5.1.4", - "supports-color": "^7.2.0" + "diff": "^5.2.0", + "nise": "^6.0.0", + "supports-color": "^7" }, "funding": { "type": "opencollective", @@ -4648,6 +4922,21 @@ "node": ">=8" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -4660,6 +4949,19 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -4891,9 +5193,9 @@ } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz", + "integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==", "dev": true }, "node_modules/universalify": { @@ -5025,6 +5327,24 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 8c5934e..9393c24 100644 --- a/package.json +++ b/package.json @@ -46,40 +46,41 @@ "url": "https://github.com/ioBroker/adapter-core/issues" }, "files": [ - "build" + "build", + "LICENSE" ], "homepage": "https://github.com/ioBroker/adapter-core#readme", "devDependencies": { "@alcalzone/esm2cjs": "^1.1.2", - "@alcalzone/release-script": "~3.5.9", - "@alcalzone/release-script-plugin-license": "~3.5.9", - "@foxriver76/eslint-config": "^1.0.4", - "@types/chai": "^4.3.4", - "@types/chai-as-promised": "^7.1.5", - "@types/mocha": "^10.0.1", - "@types/node": "^18.15.7", - "@types/proxyquire": "^1.3.28", - "@types/sinon": "^10.0.13", - "@types/sinon-chai": "^3.2.9", - "@typescript-eslint/eslint-plugin": "^6.2.1", - "@typescript-eslint/parser": "^6.0.0", - "chai": "^4.3.7", - "chai-as-promised": "^7.1.1", + "@alcalzone/release-script": "~3.8.0", + "@alcalzone/release-script-plugin-license": "~3.7.0", + "@foxriver76/eslint-config": "^1.0.5", + "@types/chai": "^4.3.17", + "@types/chai-as-promised": "^7.1.8", + "@types/mocha": "^10.0.7", + "@types/node": "^22.1.0", + "@types/proxyquire": "^1.3.31", + "@types/sinon": "^17.0.3", + "@types/sinon-chai": "^3.2.12", + "@typescript-eslint/eslint-plugin": "^8.0.1", + "@typescript-eslint/parser": "^8.0.1", + "chai": "^4.5.0", + "chai-as-promised": "^7.1.2", "cpy-cli": "^4.2.0", - "eslint": "^8.41.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-prettier": "^5.1.3", - "mocha": "^10.2.0", - "prettier": "^3.2.5", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.2.1", + "mocha": "^10.7.0", + "prettier": "^3.3.3", "proxyquire": "^2.1.3", - "rimraf": "^3.0.2", - "sinon": "^15.1.0", + "rimraf": "^5.0.10", + "sinon": "^18.0.0", "sinon-chai": "^3.7.0", "source-map-support": "^0.5.21", - "ts-node": "^10.9.1", - "typescript": "^5.4.5" + "ts-node": "^10.9.2", + "typescript": "^5.5.4" }, "peerDependencies": { - "@iobroker/types": "^6.0.9" + "@iobroker/types": "^6.0.10" } } diff --git a/src/controllerTools.ts b/src/controllerTools.ts index 2c37903..2016b06 100644 --- a/src/controllerTools.ts +++ b/src/controllerTools.ts @@ -1,10 +1,10 @@ import * as path from "node:path"; +import { createRequire } from "node:module"; import { tryResolvePackage } from "./helpers.js"; import * as utils from "./utils.js"; -import { createRequire } from "node:module"; // eslint-disable-next-line unicorn/prefer-module -const require = createRequire(import.meta.url || "file://" + __filename); +const require = createRequire(import.meta.url || `file://${__filename}`); export let controllerCommonModulesInternal: any; @@ -15,7 +15,9 @@ function resolveControllerTools(): any | never { try { controllerCommonModulesInternal = require(importPath); const { tools } = controllerCommonModulesInternal; - if (tools) return tools; + if (tools) { + return tools; + } } catch { // did not work, continue } @@ -30,7 +32,9 @@ function resolveControllerTools(): any | never { try { controllerCommonModulesInternal = require(importPath); const { tools } = controllerCommonModulesInternal; - if (tools) return tools; + if (tools) { + return tools; + } } catch { // did not work, continue } @@ -41,7 +45,9 @@ function resolveControllerTools(): any | never { try { // This was a default export prior to the TS migration const tools = require(path.join(importPath, "tools")); - if (tools) return tools; + if (tools) { + return tools; + } } catch { // did not work, continue } @@ -53,7 +59,7 @@ function resolveControllerTools(): any | never { /** The collection of utility functions in JS-Controller, formerly `lib/tools.js` */ export const controllerToolsInternal = resolveControllerTools(); -// Export a subset of the utilties in controllerTools +// Export a subset of the utilities in controllerTools /** * Resolve a module that is either exported by @iobroker/js-controller-common (new controllers) or located in the controller's `lib` directory (old controllers). @@ -83,7 +89,9 @@ export function resolveNamedModule( try { // This was a default export prior to the TS migration const module = require(importPath); - if (module) return module; + if (module) { + return module; + } } catch { // did not work, continue } @@ -107,7 +115,7 @@ function pattern2RegEx(pattern: string): string { /** * Finds the adapter directory of a given adapter * - * @param adapter name of the adapter, e.g. hm-rpc + * @param adapter name of the adapter, e.g., hm-rpc * @returns path to adapter directory or null if no directory found */ function getAdapterDir(adapter: string): string | null { @@ -129,7 +137,7 @@ export interface InstalledInfo { licenseUrl?: string; } /** - * Get list of all installed adapters and controller version on this host + * Get a list of all installed adapters and controller version on this host * @param hostJsControllerVersion Version of the running js-controller, will be included in the returned information if provided * @returns object containing information about installed host */ diff --git a/src/helpers.ts b/src/helpers.ts index 7ba8c46..71b263e 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -3,11 +3,11 @@ import * as path from "node:path"; import { createRequire } from "node:module"; import * as url from "node:url"; // eslint-disable-next-line unicorn/prefer-module -const require = createRequire(import.meta.url || "file://" + __filename); +const require = createRequire(import.meta.url || `file://${__filename}`); const thisDir = url.fileURLToPath( // eslint-disable-next-line unicorn/prefer-module - new URL(".", import.meta.url || "file://" + __filename), + new URL(".", import.meta.url || `file://${__filename}`), ); /** diff --git a/src/utils.ts b/src/utils.ts index a2f255e..413fabb 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -4,7 +4,7 @@ import { createRequire } from "node:module"; import { scanForPackage, tryResolvePackage } from "./helpers.js"; // eslint-disable-next-line unicorn/prefer-module -const require = createRequire(import.meta.url || "file://" + __filename); +const require = createRequire(import.meta.url || `file://${__filename}`); /** * Resolves the root directory of JS-Controller and returns it or exits the process @@ -13,22 +13,25 @@ const require = createRequire(import.meta.url || "file://" + __filename); function getControllerDir(isInstall: boolean): string | never { // Find the js-controller location const possibilities = ["iobroker.js-controller", "ioBroker.js-controller"]; - // First try to let Node.js resolve the package by itself + // First, try to let Node.js resolve the package by itself let controllerDir = tryResolvePackage(possibilities); - // Apparently, checking vs null/undefined may miss the odd case of controllerPath being "" - // Thus we check for falsyness, which includes failing on an empty path - if (controllerDir) return controllerDir; + // Apparently, checking vs. null/undefined may miss the odd case of controllerPath being "" + // Thus we check for falseness, which includes failing on an empty path + if (controllerDir) { + return controllerDir; + } // As a fallback solution, we walk up the directory tree until we reach the root or find js-controller controllerDir = scanForPackage(possibilities); - if (controllerDir) return controllerDir; + if (controllerDir) { + return controllerDir; + } if (!isInstall) { console.log("Cannot find js-controller"); return process.exit(10); - } else { - return process.exit(); } + return process.exit(); } /** The root directory of JS-Controller */ @@ -42,7 +45,9 @@ function resolveAdapterConstructor(): any | never { if (adapterPath) { try { const { Adapter } = require(adapterPath); - if (Adapter) return Adapter; + if (Adapter) { + return Adapter; + } } catch { // did not work, continue } @@ -56,7 +61,9 @@ function resolveAdapterConstructor(): any | never { if (adapterPath) { try { const { Adapter } = require(adapterPath); - if (Adapter) return Adapter; + if (Adapter) { + return Adapter; + } } catch { // did not work, continue } @@ -67,7 +74,9 @@ function resolveAdapterConstructor(): any | never { try { // This was a default export prior to the TS migration const Adapter = require(adapterPath); - if (Adapter) return Adapter; + if (Adapter) { + return Adapter; + } } catch { // did not work, continue } @@ -77,7 +86,9 @@ function resolveAdapterConstructor(): any | never { try { // This was a default export prior to the TS migration const Adapter = require(adapterPath); - if (Adapter) return Adapter; + if (Adapter) { + return Adapter; + } } catch { // did not work, continue } @@ -87,7 +98,9 @@ function resolveAdapterConstructor(): any | never { try { // This was a default export prior to the TS migration const Adapter = require(adapterPath); - if (Adapter) return Adapter; + if (Adapter) { + return Adapter; + } } catch { // did not work, continue } diff --git a/test/mocha.setup.js b/test/mocha.setup.js index ed3d681..a147ed0 100644 --- a/test/mocha.setup.js +++ b/test/mocha.setup.js @@ -8,7 +8,7 @@ process.on("unhandledRejection", (e) => { throw e; }); -// enable the should interface with sinon +// enable the `should` interface with sinon // and load chai-as-promised and sinon-chai by default const sinonChai = require("sinon-chai"); const chaiAsPromised = require("chai-as-promised"); @@ -16,4 +16,4 @@ const { should, use } = require("chai"); should(); use(sinonChai); -use(chaiAsPromised); \ No newline at end of file +use(chaiAsPromised);