@iobroker/repochecker 5.19.3 → 5.19.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/lib/config_StateRoles.js +1 -0
- package/lib/objectStructure.js +43 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,10 @@ Example:
|
|
|
25
25
|
Placeholder for the next version (at the beginning of the line):
|
|
26
26
|
### **WORK IN PROGRESS**
|
|
27
27
|
-->
|
|
28
|
+
### 5.19.4 (2026-06-29)
|
|
29
|
+
|
|
30
|
+
- (mcm1957) false positives related to objectChecker have been fixed
|
|
31
|
+
|
|
28
32
|
### 5.19.3 (2026-06-28)
|
|
29
33
|
|
|
30
34
|
- (mcm1957) false positives for test-and.release workflow logs ans wwwOnly adapters has been fixed
|
package/lib/config_StateRoles.js
CHANGED
package/lib/objectStructure.js
CHANGED
|
@@ -138,6 +138,42 @@ function parseSerializedValue(value) {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Validates the common.enums array.
|
|
143
|
+
*/
|
|
144
|
+
function validateEnums(objectId, enums, collector) {
|
|
145
|
+
if (!Array.isArray(enums)) {
|
|
146
|
+
collector.error('E4001', `Object "${objectId}": common.enums must be an array.`);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
for (let i = 0; i < enums.length; i++) {
|
|
150
|
+
const entry = enums[i];
|
|
151
|
+
const prefix = `Object "${objectId}": common.enums[${i}]`;
|
|
152
|
+
if (!isPlainObject(entry)) {
|
|
153
|
+
collector.error('E4002', `${prefix} must be an object.`);
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
if (typeof entry._id !== 'string') {
|
|
157
|
+
collector.error('E4003', `${prefix} must have a string "_id".`);
|
|
158
|
+
}
|
|
159
|
+
if (entry.type !== 'enum') {
|
|
160
|
+
collector.error('E4004', `${prefix} must have "type" = "enum".`);
|
|
161
|
+
}
|
|
162
|
+
if (!isPlainObject(entry.common)) {
|
|
163
|
+
collector.error('E4005', `${prefix} must have an object "common".`);
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
if (entry.common.name === undefined) {
|
|
167
|
+
collector.error('E4006', `${prefix}.common must have a "name".`);
|
|
168
|
+
}
|
|
169
|
+
const allowedCommonKeys = new Set(['name', 'smartName', 'icon', 'color', 'desc']);
|
|
170
|
+
const unknownKeys = Object.keys(entry.common).filter(k => !allowedCommonKeys.has(k));
|
|
171
|
+
if (unknownKeys.length > 0) {
|
|
172
|
+
collector.warning('W4001', `${prefix}.common contains unexpected keys: ${unknownKeys.join(', ')}.`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
141
177
|
function matchesCommonType(value, commonType) {
|
|
142
178
|
switch (commonType) {
|
|
143
179
|
case 'mixed':
|
|
@@ -508,6 +544,13 @@ function validateObjectDump(objects, adapter, collector) {
|
|
|
508
544
|
validateStateCommon(objectId, common, collector, roleRuleMaps);
|
|
509
545
|
}
|
|
510
546
|
|
|
547
|
+
// --- Validate common.enums on all objects ---
|
|
548
|
+
for (const [objectId, objectData] of entries) {
|
|
549
|
+
if (isPlainObject(objectData.common) && objectData.common.enums !== undefined) {
|
|
550
|
+
validateEnums(objectId, objectData.common.enums, collector);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
511
554
|
return relevantIds;
|
|
512
555
|
}
|
|
513
556
|
|
package/package.json
CHANGED