convention_builder 1.7.4 → 1.8.0
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 +19 -1
- package/dist/node/index.js +19 -1
- package/package.json +1 -1
package/dist/module/index.js
CHANGED
|
@@ -10604,7 +10604,7 @@ var require_convention_builder = __commonJS({
|
|
|
10604
10604
|
*/
|
|
10605
10605
|
updateSchema() {
|
|
10606
10606
|
this.schema = {};
|
|
10607
|
-
|
|
10607
|
+
this.schema = structuredClone(this.baseSchema);
|
|
10608
10608
|
this.schema.$id = this.repoURLTemplateFunction({ overlayName: this.name, projectID: this.gitlabProjectId, baseEntityTypeAndBundle: this.typeAndBundle });
|
|
10609
10609
|
let allModifiedAttributes = listAttributesAndSubAttributes(this.overlay);
|
|
10610
10610
|
this.modifiedAttributes = allModifiedAttributes;
|
|
@@ -10676,6 +10676,24 @@ var require_convention_builder = __commonJS({
|
|
|
10676
10676
|
this.updateAttributeStatus(attribute);
|
|
10677
10677
|
this.updateSchema();
|
|
10678
10678
|
}
|
|
10679
|
+
/**
|
|
10680
|
+
* Allows to "reset" a section to be able to set new constraints or leave it in a "generic" state altogether. This is mostly useful when creating a child convention and a preexisting attribute needs to be modified.
|
|
10681
|
+
* @param {} attribute
|
|
10682
|
+
*/
|
|
10683
|
+
cleanGenericSection({ attribute }) {
|
|
10684
|
+
bury(this.overlay.properties.attributes.properties, attribute, dig(this.baseSchema.properties.attributes.properties, attribute), false);
|
|
10685
|
+
this.unmodifiedAttributes.add(attribute);
|
|
10686
|
+
this.modifiedAttributes.delete(attribute);
|
|
10687
|
+
this.updateSchema();
|
|
10688
|
+
}
|
|
10689
|
+
/**
|
|
10690
|
+
* Edits the description for an attribute, independently of any schema limitations set on it. It will overwrite previous descriptions.
|
|
10691
|
+
* @param {} attribute
|
|
10692
|
+
* @param {} description
|
|
10693
|
+
*/
|
|
10694
|
+
setDescription({ attribute, description }) {
|
|
10695
|
+
bury(this.overlay.properties.attributes.properties, attribute.concat(".description"), description, false);
|
|
10696
|
+
}
|
|
10679
10697
|
/**
|
|
10680
10698
|
* Sets an attribute as a constant as indicated by the given value.
|
|
10681
10699
|
* @param {string} attribute -- Attribute name for the attribute which will be set to a constant.
|
package/dist/node/index.js
CHANGED
|
@@ -10597,7 +10597,7 @@ var require_convention_builder = __commonJS({
|
|
|
10597
10597
|
*/
|
|
10598
10598
|
updateSchema() {
|
|
10599
10599
|
this.schema = {};
|
|
10600
|
-
|
|
10600
|
+
this.schema = structuredClone(this.baseSchema);
|
|
10601
10601
|
this.schema.$id = this.repoURLTemplateFunction({ overlayName: this.name, projectID: this.gitlabProjectId, baseEntityTypeAndBundle: this.typeAndBundle });
|
|
10602
10602
|
let allModifiedAttributes = listAttributesAndSubAttributes(this.overlay);
|
|
10603
10603
|
this.modifiedAttributes = allModifiedAttributes;
|
|
@@ -10669,6 +10669,24 @@ var require_convention_builder = __commonJS({
|
|
|
10669
10669
|
this.updateAttributeStatus(attribute);
|
|
10670
10670
|
this.updateSchema();
|
|
10671
10671
|
}
|
|
10672
|
+
/**
|
|
10673
|
+
* Allows to "reset" a section to be able to set new constraints or leave it in a "generic" state altogether. This is mostly useful when creating a child convention and a preexisting attribute needs to be modified.
|
|
10674
|
+
* @param {} attribute
|
|
10675
|
+
*/
|
|
10676
|
+
cleanGenericSection({ attribute }) {
|
|
10677
|
+
bury(this.overlay.properties.attributes.properties, attribute, dig(this.baseSchema.properties.attributes.properties, attribute), false);
|
|
10678
|
+
this.unmodifiedAttributes.add(attribute);
|
|
10679
|
+
this.modifiedAttributes.delete(attribute);
|
|
10680
|
+
this.updateSchema();
|
|
10681
|
+
}
|
|
10682
|
+
/**
|
|
10683
|
+
* Edits the description for an attribute, independently of any schema limitations set on it. It will overwrite previous descriptions.
|
|
10684
|
+
* @param {} attribute
|
|
10685
|
+
* @param {} description
|
|
10686
|
+
*/
|
|
10687
|
+
setDescription({ attribute, description }) {
|
|
10688
|
+
bury(this.overlay.properties.attributes.properties, attribute.concat(".description"), description, false);
|
|
10689
|
+
}
|
|
10672
10690
|
/**
|
|
10673
10691
|
* Sets an attribute as a constant as indicated by the given value.
|
|
10674
10692
|
* @param {string} attribute -- Attribute name for the attribute which will be set to a constant.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "convention_builder",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
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",
|