@next-core/brick-utils 2.34.2 → 2.35.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/index.esm.js CHANGED
@@ -21746,23 +21746,24 @@ var jsonFieldsInBrick = ["properties", "events", "lifeCycle", "params", "if", "t
21746
21746
 
21747
21747
  var yamlFieldsInBrick = ["permissionsPreCheck", "transformFrom"]; // Fields started with `_` will be removed by default.
21748
21748
 
21749
- var fieldsToRemoveInRoute = ["appId", "children", "creator", "ctime", "id", "instanceId", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
21750
- var fieldsToRemoveInBrick = fieldsToRemoveInRoute.concat("type", "alias"); // Those fields can be disposed if value is null.
21749
+ var baseFieldsToRemove = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
21750
+ var fieldsToRemoveInRoute = baseFieldsToRemove.concat("instanceId");
21751
+ var fieldsToRemoveInBrick = baseFieldsToRemove.concat("type", "alias"); // Those fields can be disposed if value is null.
21751
21752
 
21752
21753
  var disposableNullFields = ["alias", "documentId", "hybrid", "bg", "context", "exports", "ref", "portal", "analyticsData"];
21753
21754
  function normalizeBuilderNode(node) {
21754
21755
  if (isBrickNode(node)) {
21755
- return normalize(node, fieldsToRemoveInBrick, jsonFieldsInBrick, yamlFieldsInBrick, false);
21756
+ return normalize(node, fieldsToRemoveInBrick, jsonFieldsInBrick, yamlFieldsInBrick, "brick");
21756
21757
  }
21757
21758
 
21758
21759
  if (isRouteNode(node)) {
21759
- return normalize(node, fieldsToRemoveInRoute, jsonFieldsInRoute, yamlFieldsInRoute, true);
21760
+ return normalize(node, fieldsToRemoveInRoute, jsonFieldsInRoute, yamlFieldsInRoute, "route");
21760
21761
  }
21761
21762
 
21762
21763
  return null;
21763
21764
  }
21764
21765
 
21765
- function normalize(node, fieldsToRemove, jsonFields, yamlFields, cleanUpSegues) {
21766
+ function normalize(node, fieldsToRemove, jsonFields, yamlFields, type) {
21766
21767
  return Object.fromEntries(Object.entries(node) // Remove unused fields from CMDB.
21767
21768
  // Consider fields started with `_` as unused.
21768
21769
  .filter(_ref => {
@@ -21771,7 +21772,7 @@ function normalize(node, fieldsToRemove, jsonFields, yamlFields, cleanUpSegues)
21771
21772
  }) // Parse specific fields.
21772
21773
  .map(_ref2 => {
21773
21774
  var [key, value] = _ref2;
21774
- return [key, cleanUpSegues && key === "segues" ? getCleanSegues(value) : jsonFields.includes(key) ? safeJsonParse(value) : yamlFields.includes(key) ? safeYamlParse(value) : cloneDeep(value)];
21775
+ return [key === "instanceId" ? "iid" : key, type === "route" && key === "segues" ? getCleanSegues(value) : jsonFields.includes(key) ? safeJsonParse(value) : yamlFields.includes(key) ? safeYamlParse(value) : cloneDeep(value)];
21775
21776
  }));
21776
21777
  } // Clear `segue._view` which is for development only.
21777
21778