@famgia/omnify-core 0.0.129 → 0.0.130
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/dist/index.cjs +27 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -647,6 +647,9 @@ function buildSchemaDefinition(data) {
|
|
|
647
647
|
if (data.target !== void 0 && typeof data.target === "string") {
|
|
648
648
|
schema.target = data.target;
|
|
649
649
|
}
|
|
650
|
+
if (data.priority !== void 0 && typeof data.priority === "number") {
|
|
651
|
+
schema.priority = data.priority;
|
|
652
|
+
}
|
|
650
653
|
if (data.displayName !== void 0 && (0, import_omnify_types.isLocalizedString)(data.displayName)) {
|
|
651
654
|
schema.displayName = data.displayName;
|
|
652
655
|
}
|
|
@@ -1011,6 +1014,11 @@ function mergePartialSchemas(schemas, partials) {
|
|
|
1011
1014
|
cleanSchemas[key] = schema;
|
|
1012
1015
|
}
|
|
1013
1016
|
}
|
|
1017
|
+
partialSchemas.sort((a, b) => {
|
|
1018
|
+
const priorityA = a.priority ?? 50;
|
|
1019
|
+
const priorityB = b.priority ?? 50;
|
|
1020
|
+
return priorityA - priorityB;
|
|
1021
|
+
});
|
|
1014
1022
|
for (const partial of partialSchemas) {
|
|
1015
1023
|
const targetName = partial.target;
|
|
1016
1024
|
if (!targetName) {
|
|
@@ -3063,6 +3071,25 @@ function validatePartialSchema(schema, filePath) {
|
|
|
3063
3071
|
)
|
|
3064
3072
|
);
|
|
3065
3073
|
}
|
|
3074
|
+
if (schema.priority !== void 0) {
|
|
3075
|
+
if (typeof schema.priority !== "number") {
|
|
3076
|
+
errors.push(
|
|
3077
|
+
validationError(
|
|
3078
|
+
"Partial schema priority must be a number",
|
|
3079
|
+
buildLocation7(filePath),
|
|
3080
|
+
"Example: priority: 10 (lower = higher priority, default is 50)"
|
|
3081
|
+
)
|
|
3082
|
+
);
|
|
3083
|
+
} else if (schema.priority < 1 || schema.priority > 100) {
|
|
3084
|
+
errors.push(
|
|
3085
|
+
validationError(
|
|
3086
|
+
`Partial schema priority must be between 1 and 100 (got ${schema.priority})`,
|
|
3087
|
+
buildLocation7(filePath),
|
|
3088
|
+
"Use 1-49 for high priority, 51-100 for low priority (default is 50)"
|
|
3089
|
+
)
|
|
3090
|
+
);
|
|
3091
|
+
}
|
|
3092
|
+
}
|
|
3066
3093
|
if (!schema.properties || Object.keys(schema.properties).length === 0) {
|
|
3067
3094
|
errors.push(
|
|
3068
3095
|
validationError(
|