@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.js CHANGED
@@ -535,6 +535,9 @@ function buildSchemaDefinition(data) {
535
535
  if (data.target !== void 0 && typeof data.target === "string") {
536
536
  schema.target = data.target;
537
537
  }
538
+ if (data.priority !== void 0 && typeof data.priority === "number") {
539
+ schema.priority = data.priority;
540
+ }
538
541
  if (data.displayName !== void 0 && isLocalizedString(data.displayName)) {
539
542
  schema.displayName = data.displayName;
540
543
  }
@@ -899,6 +902,11 @@ function mergePartialSchemas(schemas, partials) {
899
902
  cleanSchemas[key] = schema;
900
903
  }
901
904
  }
905
+ partialSchemas.sort((a, b) => {
906
+ const priorityA = a.priority ?? 50;
907
+ const priorityB = b.priority ?? 50;
908
+ return priorityA - priorityB;
909
+ });
902
910
  for (const partial of partialSchemas) {
903
911
  const targetName = partial.target;
904
912
  if (!targetName) {
@@ -2951,6 +2959,25 @@ function validatePartialSchema(schema, filePath) {
2951
2959
  )
2952
2960
  );
2953
2961
  }
2962
+ if (schema.priority !== void 0) {
2963
+ if (typeof schema.priority !== "number") {
2964
+ errors.push(
2965
+ validationError(
2966
+ "Partial schema priority must be a number",
2967
+ buildLocation7(filePath),
2968
+ "Example: priority: 10 (lower = higher priority, default is 50)"
2969
+ )
2970
+ );
2971
+ } else if (schema.priority < 1 || schema.priority > 100) {
2972
+ errors.push(
2973
+ validationError(
2974
+ `Partial schema priority must be between 1 and 100 (got ${schema.priority})`,
2975
+ buildLocation7(filePath),
2976
+ "Use 1-49 for high priority, 51-100 for low priority (default is 50)"
2977
+ )
2978
+ );
2979
+ }
2980
+ }
2954
2981
  if (!schema.properties || Object.keys(schema.properties).length === 0) {
2955
2982
  errors.push(
2956
2983
  validationError(