@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/CHANGELOG.md +11 -0
- package/dist/index.bundle.js +7 -6
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +7 -6
- package/dist/index.esm.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.35.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.34.2...@next-core/brick-utils@2.35.0) (2022-02-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* record brick instance id in storyboard for development ([9d1193e](https://github.com/easyops-cn/next-core/commit/9d1193e11cf5cd35d10d36afe4f07a52a7f7841a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [2.34.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.34.1...@next-core/brick-utils@2.34.2) (2022-02-17)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @next-core/brick-utils
|
package/dist/index.bundle.js
CHANGED
|
@@ -21751,23 +21751,24 @@
|
|
|
21751
21751
|
|
|
21752
21752
|
var yamlFieldsInBrick = ["permissionsPreCheck", "transformFrom"]; // Fields started with `_` will be removed by default.
|
|
21753
21753
|
|
|
21754
|
-
var
|
|
21755
|
-
var
|
|
21754
|
+
var baseFieldsToRemove = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
|
|
21755
|
+
var fieldsToRemoveInRoute = baseFieldsToRemove.concat("instanceId");
|
|
21756
|
+
var fieldsToRemoveInBrick = baseFieldsToRemove.concat("type", "alias"); // Those fields can be disposed if value is null.
|
|
21756
21757
|
|
|
21757
21758
|
var disposableNullFields = ["alias", "documentId", "hybrid", "bg", "context", "exports", "ref", "portal", "analyticsData"];
|
|
21758
21759
|
function normalizeBuilderNode(node) {
|
|
21759
21760
|
if (isBrickNode(node)) {
|
|
21760
|
-
return normalize(node, fieldsToRemoveInBrick, jsonFieldsInBrick, yamlFieldsInBrick,
|
|
21761
|
+
return normalize(node, fieldsToRemoveInBrick, jsonFieldsInBrick, yamlFieldsInBrick, "brick");
|
|
21761
21762
|
}
|
|
21762
21763
|
|
|
21763
21764
|
if (isRouteNode(node)) {
|
|
21764
|
-
return normalize(node, fieldsToRemoveInRoute, jsonFieldsInRoute, yamlFieldsInRoute,
|
|
21765
|
+
return normalize(node, fieldsToRemoveInRoute, jsonFieldsInRoute, yamlFieldsInRoute, "route");
|
|
21765
21766
|
}
|
|
21766
21767
|
|
|
21767
21768
|
return null;
|
|
21768
21769
|
}
|
|
21769
21770
|
|
|
21770
|
-
function normalize(node, fieldsToRemove, jsonFields, yamlFields,
|
|
21771
|
+
function normalize(node, fieldsToRemove, jsonFields, yamlFields, type) {
|
|
21771
21772
|
return Object.fromEntries(Object.entries(node) // Remove unused fields from CMDB.
|
|
21772
21773
|
// Consider fields started with `_` as unused.
|
|
21773
21774
|
.filter(_ref => {
|
|
@@ -21776,7 +21777,7 @@
|
|
|
21776
21777
|
}) // Parse specific fields.
|
|
21777
21778
|
.map(_ref2 => {
|
|
21778
21779
|
var [key, value] = _ref2;
|
|
21779
|
-
return [key,
|
|
21780
|
+
return [key === "instanceId" ? "iid" : key, type === "route" && key === "segues" ? getCleanSegues(value) : jsonFields.includes(key) ? safeJsonParse(value) : yamlFields.includes(key) ? safeYamlParse(value) : lodash.cloneDeep(value)];
|
|
21780
21781
|
}));
|
|
21781
21782
|
} // Clear `segue._view` which is for development only.
|
|
21782
21783
|
|