Skip to content

Commit 99469b9

Browse files
Added desiredDependencies (#3011)
* Added desiredDependencies * Changed desiredDependencies * Changed desiredDependencies to ifInstalledDependencies * Changed ifInstalledDependencies to object * Changed ifInstalledDependencies to object * Changed ifInstalledDependencies to object * Changed ifInstalledDependencies to object * Changed comment
1 parent 03d82e2 commit 99469b9

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

packages/types-dev/objects.d.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ declare global {
593593
};
594594

595595
/** Format for local and global dependencies */
596-
type Depdendencies = { [adapterName: string]: string }[] | string[];
596+
type Dependencies = { [adapterName: string]: string }[] | string[];
597597

598598
interface AdapterCommon extends ObjectCommon {
599599
/** Custom attributes to be shown in admin in the object browser */
@@ -635,9 +635,11 @@ declare global {
635635
/** How the adapter will mainly receive its data. Set this together with @see connectionType */
636636
dataSource?: 'poll' | 'push' | 'assumption';
637637
/** A record of ioBroker adapters (including "js-controller") and version ranges which are required for this adapter on the same host. */
638-
dependencies?: Depdendencies;
638+
dependencies?: Dependencies;
639639
/** A record of ioBroker adapters (including "js-controller") and version ranges which are required for this adapter in the whole system. */
640-
globalDependencies?: Depdendencies;
640+
globalDependencies?: Dependencies;
641+
/** Similar to `dependencies`, but only checked if the specified adapter is already installed. If the adapter is not installed, the version check will pass */
642+
ifInstalledDependencies?: { [adapterName: string]: string };
641643
/** Which files outside the README.md have documentation for the adapter */
642644
docs?: Partial<Record<Languages, string | string[]>>;
643645
/** Whether new instances should be enabled by default. *Should* be `false`! */
@@ -797,7 +799,7 @@ declare global {
797799
ignoreVersion?: string;
798800
/** Sentry and other plugins */
799801
plugins?: { [pluginName: string]: Record<string, any> };
800-
/** Rules blocks for Javascript rules */
802+
/** Rules blocks for JavaScript rules */
801803
javascriptRules?: {
802804
/** Translations */
803805
i18n?: boolean | Record<string, Record<ioBroker.Languages, string>> | Record<string, string>;

schemas/io-package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,15 @@
11811181
]
11821182
}
11831183
},
1184+
"ifInstalledDependencies": {
1185+
"description": "Object like {\"admin\": \">=2.0.0\", \"javascript\": \">=3.0.0\"} that describes which versions of ioBroker modules are required for this adapter on one of the hosts, but only if this adapter is installed",
1186+
"type": "object",
1187+
"patternProperties": {
1188+
".+": {
1189+
"type": "string"
1190+
}
1191+
}
1192+
},
11841193
"icon": {
11851194
"description": "name of the local icon (should be located in subdirectory \"admin\")",
11861195
"type": "string"

0 commit comments

Comments
 (0)