@specverse/engines 6.2.0 → 6.2.1
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.
|
@@ -352,7 +352,10 @@ import type { ParserEngine, InferenceEngine, RealizeEngine } from '@specverse/ty
|
|
|
352
352
|
if (typeof attrDef === 'string') {
|
|
353
353
|
const parts = attrDef.split(' ');
|
|
354
354
|
const kv = (key: string) => parts.find((p: string) => p.startsWith(key + '='))?.split('=')[1];
|
|
355
|
-
|
|
355
|
+
const auto = kv('auto');
|
|
356
|
+
const explicitCategory = kv('category');
|
|
357
|
+
const category = explicitCategory || (auto || attrName === 'id' ? 'metadata' : 'business');
|
|
358
|
+
return { name: attrName, type: parts[0], required: parts.includes('required'), unique: parts.includes('unique'), auto, category };
|
|
356
359
|
}
|
|
357
360
|
return { name: attrName, ...(typeof attrDef === 'object' ? attrDef : {}) };
|
|
358
361
|
});
|
|
@@ -407,7 +407,10 @@ import type { ParserEngine, InferenceEngine, RealizeEngine } from '@specverse/ty
|
|
|
407
407
|
if (typeof attrDef === 'string') {
|
|
408
408
|
const parts = attrDef.split(' ');
|
|
409
409
|
const kv = (key: string) => parts.find((p: string) => p.startsWith(key + '='))?.split('=')[1];
|
|
410
|
-
|
|
410
|
+
const auto = kv('auto');
|
|
411
|
+
const explicitCategory = kv('category');
|
|
412
|
+
const category = explicitCategory || (auto || attrName === 'id' ? 'metadata' : 'business');
|
|
413
|
+
return { name: attrName, type: parts[0], required: parts.includes('required'), unique: parts.includes('unique'), auto, category };
|
|
411
414
|
}
|
|
412
415
|
return { name: attrName, ...(typeof attrDef === 'object' ? attrDef : {}) };
|
|
413
416
|
});
|