convention_builder 2.0.0 → 2.0.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.
- package/dist/module/index.js +25 -1
- package/dist/node/index.js +25 -1
- package/package.json +1 -1
package/dist/module/index.js
CHANGED
|
@@ -10679,7 +10679,6 @@ var require_convention_builder = __commonJS({
|
|
|
10679
10679
|
let firstLevel = attribute.split(/\./)[0];
|
|
10680
10680
|
let siblingModifications = Array.from(this.modifiedAttributes).filter((attr) => attr != attribute).filter((attr) => attr.includes(`${firstLevel}.`));
|
|
10681
10681
|
let isOnlyModification = siblingModifications.length == 0;
|
|
10682
|
-
console.log(`${attribute} is only modification? ${isOnlyModification}, there are ${siblingModifications.join(", ")}`);
|
|
10683
10682
|
if (isOnlyModification) {
|
|
10684
10683
|
delete this.overlay.properties.attributes.properties[firstLevel];
|
|
10685
10684
|
}
|
|
@@ -25830,12 +25829,35 @@ var require_array_examples_preparator = __commonJS({
|
|
|
25830
25829
|
}
|
|
25831
25830
|
});
|
|
25832
25831
|
|
|
25832
|
+
// src/entity_sorting.js
|
|
25833
|
+
var require_entity_sorting = __commonJS({
|
|
25834
|
+
"src/entity_sorting.js"(exports) {
|
|
25835
|
+
var ENTITY_PREFIXES = {
|
|
25836
|
+
LOG: "log--",
|
|
25837
|
+
ASSET: "asset--"
|
|
25838
|
+
};
|
|
25839
|
+
function categorizeKeysByEntityType(keys, specialKeys = []) {
|
|
25840
|
+
const special = specialKeys.filter((k) => keys.includes(k));
|
|
25841
|
+
const logs = keys.filter((k) => k.startsWith(ENTITY_PREFIXES.LOG));
|
|
25842
|
+
const assets = keys.filter((k) => k.startsWith(ENTITY_PREFIXES.ASSET));
|
|
25843
|
+
const others = keys.filter(
|
|
25844
|
+
(k) => !specialKeys.includes(k) && !k.startsWith(ENTITY_PREFIXES.LOG) && !k.startsWith(ENTITY_PREFIXES.ASSET)
|
|
25845
|
+
);
|
|
25846
|
+
return { special, logs, assets, others };
|
|
25847
|
+
}
|
|
25848
|
+
__name(categorizeKeysByEntityType, "categorizeKeysByEntityType");
|
|
25849
|
+
exports.categorizeKeysByEntityType = categorizeKeysByEntityType;
|
|
25850
|
+
exports.ENTITY_PREFIXES = ENTITY_PREFIXES;
|
|
25851
|
+
}
|
|
25852
|
+
});
|
|
25853
|
+
|
|
25833
25854
|
// src/index.js
|
|
25834
25855
|
var require_index = __commonJS({
|
|
25835
25856
|
"src/index.js"(exports) {
|
|
25836
25857
|
var { SchemaOverlay, ConventionSchema, InputConventionChanges } = require_convention_builder();
|
|
25837
25858
|
var schemaUtils = require_schema_utilities();
|
|
25838
25859
|
var { ArrayDataOrganizer } = require_array_examples_preparator();
|
|
25860
|
+
var { categorizeKeysByEntityType, ENTITY_PREFIXES } = require_entity_sorting();
|
|
25839
25861
|
exports.SchemaOverlay = SchemaOverlay;
|
|
25840
25862
|
exports.InputConventionChanges = InputConventionChanges;
|
|
25841
25863
|
exports.ConventionSchema = ConventionSchema;
|
|
@@ -25855,6 +25877,8 @@ var require_index = __commonJS({
|
|
|
25855
25877
|
exports.reduceSchemaToRequiredFields = schemaUtils.reduceSchemaToRequiredFields;
|
|
25856
25878
|
exports.flattenJSONSchema = schemaUtils.flattenJSONSchema;
|
|
25857
25879
|
exports.ArrayDataOrganizer = ArrayDataOrganizer;
|
|
25880
|
+
exports.categorizeKeysByEntityType = categorizeKeysByEntityType;
|
|
25881
|
+
exports.ENTITY_PREFIXES = ENTITY_PREFIXES;
|
|
25858
25882
|
}
|
|
25859
25883
|
});
|
|
25860
25884
|
export default require_index();
|
package/dist/node/index.js
CHANGED
|
@@ -10673,7 +10673,6 @@ var require_convention_builder = __commonJS({
|
|
|
10673
10673
|
let firstLevel = attribute.split(/\./)[0];
|
|
10674
10674
|
let siblingModifications = Array.from(this.modifiedAttributes).filter((attr) => attr != attribute).filter((attr) => attr.includes(`${firstLevel}.`));
|
|
10675
10675
|
let isOnlyModification = siblingModifications.length == 0;
|
|
10676
|
-
console.log(`${attribute} is only modification? ${isOnlyModification}, there are ${siblingModifications.join(", ")}`);
|
|
10677
10676
|
if (isOnlyModification) {
|
|
10678
10677
|
delete this.overlay.properties.attributes.properties[firstLevel];
|
|
10679
10678
|
}
|
|
@@ -25824,10 +25823,33 @@ var require_array_examples_preparator = __commonJS({
|
|
|
25824
25823
|
}
|
|
25825
25824
|
});
|
|
25826
25825
|
|
|
25826
|
+
// src/entity_sorting.js
|
|
25827
|
+
var require_entity_sorting = __commonJS({
|
|
25828
|
+
"src/entity_sorting.js"(exports2) {
|
|
25829
|
+
var ENTITY_PREFIXES2 = {
|
|
25830
|
+
LOG: "log--",
|
|
25831
|
+
ASSET: "asset--"
|
|
25832
|
+
};
|
|
25833
|
+
function categorizeKeysByEntityType2(keys, specialKeys = []) {
|
|
25834
|
+
const special = specialKeys.filter((k) => keys.includes(k));
|
|
25835
|
+
const logs = keys.filter((k) => k.startsWith(ENTITY_PREFIXES2.LOG));
|
|
25836
|
+
const assets = keys.filter((k) => k.startsWith(ENTITY_PREFIXES2.ASSET));
|
|
25837
|
+
const others = keys.filter(
|
|
25838
|
+
(k) => !specialKeys.includes(k) && !k.startsWith(ENTITY_PREFIXES2.LOG) && !k.startsWith(ENTITY_PREFIXES2.ASSET)
|
|
25839
|
+
);
|
|
25840
|
+
return { special, logs, assets, others };
|
|
25841
|
+
}
|
|
25842
|
+
__name(categorizeKeysByEntityType2, "categorizeKeysByEntityType");
|
|
25843
|
+
exports2.categorizeKeysByEntityType = categorizeKeysByEntityType2;
|
|
25844
|
+
exports2.ENTITY_PREFIXES = ENTITY_PREFIXES2;
|
|
25845
|
+
}
|
|
25846
|
+
});
|
|
25847
|
+
|
|
25827
25848
|
// src/index.js
|
|
25828
25849
|
var { SchemaOverlay, ConventionSchema, InputConventionChanges } = require_convention_builder();
|
|
25829
25850
|
var schemaUtils = require_schema_utilities();
|
|
25830
25851
|
var { ArrayDataOrganizer } = require_array_examples_preparator();
|
|
25852
|
+
var { categorizeKeysByEntityType, ENTITY_PREFIXES } = require_entity_sorting();
|
|
25831
25853
|
exports.SchemaOverlay = SchemaOverlay;
|
|
25832
25854
|
exports.InputConventionChanges = InputConventionChanges;
|
|
25833
25855
|
exports.ConventionSchema = ConventionSchema;
|
|
@@ -25847,6 +25869,8 @@ exports.trimNonRequiredFields = schemaUtils.trimNonRequiredFields;
|
|
|
25847
25869
|
exports.reduceSchemaToRequiredFields = schemaUtils.reduceSchemaToRequiredFields;
|
|
25848
25870
|
exports.flattenJSONSchema = schemaUtils.flattenJSONSchema;
|
|
25849
25871
|
exports.ArrayDataOrganizer = ArrayDataOrganizer;
|
|
25872
|
+
exports.categorizeKeysByEntityType = categorizeKeysByEntityType;
|
|
25873
|
+
exports.ENTITY_PREFIXES = ENTITY_PREFIXES;
|
|
25850
25874
|
/*! Bundled license information:
|
|
25851
25875
|
|
|
25852
25876
|
uri-js/dist/es5/uri.all.js:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "convention_builder",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Helper tools that offer a high level interface that transforms a convention description into it's json schema.",
|
|
5
5
|
"main": "./dist/node/index.js",
|
|
6
6
|
"browser": "./dist/browser/index.js",
|