@iobroker/adapter-core
Advanced tools
Comparing version 2.6.6 to 2.6.7
@@ -13,6 +13,49 @@ export declare let controllerCommonModulesInternal: any; | ||
* @param pattern The pattern to convert | ||
* @returns The RegEx string | ||
*/ | ||
declare function pattern2RegEx(pattern: string): string; | ||
/** | ||
* Finds the adapter directory of a given adapter | ||
* | ||
* @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; | ||
interface Multilingual { | ||
en: string; | ||
de?: string; | ||
ru?: string; | ||
pt?: string; | ||
nl?: string; | ||
fr?: string; | ||
it?: string; | ||
es?: string; | ||
pl?: string; | ||
uk?: string; | ||
"zh-cn"?: string; | ||
} | ||
export interface GetInstalledInfoReponse { | ||
controller?: boolean; | ||
version?: string; | ||
icon?: string; | ||
title?: string; | ||
titleLang?: Multilingual; | ||
desc?: Multilingual; | ||
platform?: string; | ||
keywords?: string[]; | ||
readme?: string; | ||
runningVersion?: string; | ||
license?: string; | ||
licenseUrl?: string; | ||
} | ||
/** | ||
* Get 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 | ||
*/ | ||
declare function getInstalledInfo(hostJsControllerVersion?: string): GetInstalledInfoReponse; | ||
export declare const commonTools: { | ||
pattern2RegEx: typeof pattern2RegEx; | ||
getAdapterDir: typeof getAdapterDir; | ||
getInstalledInfo: typeof getInstalledInfo; | ||
password: any; | ||
@@ -19,0 +62,0 @@ letsEncrypt: any; |
@@ -46,3 +46,3 @@ "use strict"; | ||
throw new Error("Cannot resolve tools module"); | ||
return process.exit(10); | ||
//return process.exit(10); | ||
} | ||
@@ -85,3 +85,3 @@ /** The collection of utility functions in JS-Controller, formerly `lib/tools.js` */ | ||
throw new Error(`Cannot resolve JS-Controller module ${name}.js`); | ||
return process.exit(10); | ||
//return process.exit(10); | ||
} | ||
@@ -93,2 +93,3 @@ exports.resolveNamedModule = resolveNamedModule; | ||
* @param pattern The pattern to convert | ||
* @returns The RegEx string | ||
*/ | ||
@@ -98,4 +99,23 @@ function pattern2RegEx(pattern) { | ||
} | ||
/** | ||
* Finds the adapter directory of a given adapter | ||
* | ||
* @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 exports.controllerToolsInternal.getAdapterDir(adapter); | ||
} | ||
/** | ||
* Get 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 | ||
*/ | ||
function getInstalledInfo(hostJsControllerVersion) { | ||
return exports.controllerToolsInternal.getInstalledInfo(hostJsControllerVersion); | ||
} | ||
exports.commonTools = { | ||
pattern2RegEx, | ||
getAdapterDir, | ||
getInstalledInfo, | ||
// TODO: Add more methods from lib/tools.js as needed | ||
@@ -102,0 +122,0 @@ password: resolveNamedModule("password"), |
{ | ||
"name": "@iobroker/adapter-core", | ||
"version": "2.6.6", | ||
"version": "2.6.7", | ||
"description": "Core module to be used in ioBroker adapters. Acts as the bridge to js-controller.", | ||
@@ -43,11 +43,11 @@ "author": { | ||
"@types/mocha": "^9.1.0", | ||
"@types/node": "^18.7.17", | ||
"@types/node": "^18.7.23", | ||
"@types/proxyquire": "^1.3.28", | ||
"@types/sinon": "^10.0.11", | ||
"@types/sinon-chai": "^3.2.8", | ||
"@typescript-eslint/eslint-plugin": "^5.37.0", | ||
"@typescript-eslint/parser": "^5.37.0", | ||
"@typescript-eslint/eslint-plugin": "^5.38.1", | ||
"@typescript-eslint/parser": "^5.38.1", | ||
"chai": "^4.3.6", | ||
"chai-as-promised": "^7.1.1", | ||
"eslint": "^8.23.1", | ||
"eslint": "^8.24.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
@@ -63,7 +63,7 @@ "eslint-plugin-prettier": "^4.2.1", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.8.3" | ||
"typescript": "^4.8.4" | ||
}, | ||
"dependencies": { | ||
"@types/iobroker": "^4.0.4" | ||
"@types/iobroker": "^4.0.5" | ||
} | ||
} |
@@ -68,2 +68,4 @@ # Adapter-Core | ||
- `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 | ||
@@ -109,2 +111,5 @@ And the following **modules** are exposed: | ||
--> | ||
### 2.6.7 (2022-10-08) | ||
- (Apollon77) Expose more JS-Controller internals under the `commonTools` export | ||
### 2.6.6 (2022-09-13) | ||
@@ -111,0 +116,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36242
545
190
Updated@types/iobroker@^4.0.5