@iobroker/repochecker 5.19.2 → 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 +8 -0
- package/lib/M3000_Testing.js +1 -5
- 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,14 @@ 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
|
+
|
|
32
|
+
### 5.19.3 (2026-06-28)
|
|
33
|
+
|
|
34
|
+
- (mcm1957) false positives for test-and.release workflow logs ans wwwOnly adapters has been fixed
|
|
35
|
+
|
|
28
36
|
### 5.19.2 (2026-06-28)
|
|
29
37
|
|
|
30
38
|
- (mcm1957) suggest to always use i18n flag at jsonCOnfig.json
|
package/lib/M3000_Testing.js
CHANGED
|
@@ -37,7 +37,6 @@ const EXPECTED_TEST_PACKAGE_LINES = [
|
|
|
37
37
|
'✔ The property "repository" exists',
|
|
38
38
|
'✔ The property "repository.type" exists',
|
|
39
39
|
'✔ The package name is correct',
|
|
40
|
-
'✔ property main is defined for non onlyWWW adapters',
|
|
41
40
|
'✔ The repository type is "git"',
|
|
42
41
|
'✔ npm is not listed as a dependency',
|
|
43
42
|
'✔ iobroker.js-controller is not listed as a dependency',
|
|
@@ -61,7 +60,6 @@ const EXPECTED_TEST_PACKAGE_LINES = [
|
|
|
61
60
|
'✔ if common.licenseInformation exists, it is an object with required properties',
|
|
62
61
|
'✔ common.license should not exist together with common.licenseInformation',
|
|
63
62
|
'✔ common.tier must be 1, 2 or 3',
|
|
64
|
-
'✔ The adapter uses a supported admin UI',
|
|
65
63
|
'Compare contents of package.json and io-package.json',
|
|
66
64
|
'✔ The name matches',
|
|
67
65
|
'✔ The version matches',
|
|
@@ -1300,9 +1298,7 @@ async function checkTests(context) {
|
|
|
1300
1298
|
context.checks.push('Job "adapter-tests" check skipped (onlyWWW adapter).');
|
|
1301
1299
|
} else if (!jobs['adapter-tests']) {
|
|
1302
1300
|
common.debug(' job adapter-tests not found');
|
|
1303
|
-
context.errors.push(
|
|
1304
|
-
`[E3011] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" is missing. Please add it.`,
|
|
1305
|
-
);
|
|
1301
|
+
context.errors.push(`[E3011] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" is missing. Please add it.`);
|
|
1306
1302
|
} else {
|
|
1307
1303
|
common.debug(' job adapter-tests found');
|
|
1308
1304
|
context.checks.push('Job "adapter-tests" found.');
|
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