@next-core/brick-kit 2.122.1 → 2.122.4

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 CHANGED
@@ -3,121 +3,93 @@
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.122.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.122.0...@next-core/brick-kit@2.122.1) (2022-06-23)
7
-
8
- **Note:** Version bump only for package @next-core/brick-kit
9
-
10
-
6
+ ## [2.122.4](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.122.3...@next-core/brick-kit@2.122.4) (2022-06-27)
11
7
 
12
8
 
9
+ ### Bug Fixes
13
10
 
14
- # [2.122.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.121.3...@next-core/brick-kit@2.122.0) (2022-06-16)
11
+ * remove the request to fetch contarcts ([18f80d9](https://github.com/easyops-cn/next-core/commit/18f80d917f588956251621f27cc2d523cb5916fd))
15
12
 
16
13
 
17
- ### Features
18
14
 
19
- * 增加开关控制6.0或8.0UI的切换 ([54007a4](https://github.com/easyops-cn/next-core/commit/54007a43d81e97d0eb62efd28266adc2a2ccd631))
20
15
 
21
16
 
17
+ ## [2.122.3](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.122.2...@next-core/brick-kit@2.122.3) (2022-06-24)
22
18
 
19
+ **Note:** Version bump only for package @next-core/brick-kit
23
20
 
24
21
 
25
- ## [2.121.3](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.121.2...@next-core/brick-kit@2.121.3) (2022-06-10)
26
22
 
27
- **Note:** Version bump only for package @next-core/brick-kit
28
23
 
29
24
 
25
+ ## [2.122.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.122.1...@next-core/brick-kit@2.122.2) (2022-06-24)
30
26
 
27
+ ### Bug Fixes
31
28
 
29
+ - 对于任意布局,在路由跳转的时候都应该重置浏览器标题 ([1b74aef](https://github.com/easyops-cn/next-core/commit/1b74aefd3689ede050bde022e5bf6c3cc0b6f456))
32
30
 
33
- ## [2.121.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.121.1...@next-core/brick-kit@2.121.2) (2022-06-10)
31
+ ## [2.122.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.122.0...@next-core/brick-kit@2.122.1) (2022-06-23)
34
32
 
35
33
  **Note:** Version bump only for package @next-core/brick-kit
36
34
 
35
+ # [2.122.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.121.3...@next-core/brick-kit@2.122.0) (2022-06-16)
37
36
 
37
+ ### Features
38
38
 
39
+ - 增加开关控制 6.0 或 8.0UI 的切换 ([54007a4](https://github.com/easyops-cn/next-core/commit/54007a43d81e97d0eb62efd28266adc2a2ccd631))
39
40
 
40
-
41
- ## [2.121.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.121.0...@next-core/brick-kit@2.121.1) (2022-06-06)
41
+ ## [2.121.3](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.121.2...@next-core/brick-kit@2.121.3) (2022-06-10)
42
42
 
43
43
  **Note:** Version bump only for package @next-core/brick-kit
44
44
 
45
+ ## [2.121.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.121.1...@next-core/brick-kit@2.121.2) (2022-06-10)
45
46
 
47
+ **Note:** Version bump only for package @next-core/brick-kit
46
48
 
49
+ ## [2.121.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.121.0...@next-core/brick-kit@2.121.1) (2022-06-06)
47
50
 
51
+ **Note:** Version bump only for package @next-core/brick-kit
48
52
 
49
53
  # [2.121.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.120.1...@next-core/brick-kit@2.121.0) (2022-06-01)
50
54
 
51
-
52
55
  ### Features
53
56
 
54
- * **MessageDispatcher:** call error callbacks on WS error event ([d89a993](https://github.com/easyops-cn/next-core/commit/d89a993347107b8bc15e2e54cce68a620374d451))
55
-
56
-
57
-
58
-
57
+ - **MessageDispatcher:** call error callbacks on WS error event ([d89a993](https://github.com/easyops-cn/next-core/commit/d89a993347107b8bc15e2e54cce68a620374d451))
59
58
 
60
59
  ## [2.120.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.120.0...@next-core/brick-kit@2.120.1) (2022-05-27)
61
60
 
62
-
63
61
  ### Bug Fixes
64
62
 
65
- * theme dark ([8ff6958](https://github.com/easyops-cn/next-core/commit/8ff6958e134c199e58ec4e026003839dcbc5ea57))
66
- * 兼容message事件传多个参数的情况 ([fbde026](https://github.com/easyops-cn/next-core/commit/fbde026b51f8bd2d4a83b3c2ac3ac93bf6515179))
67
- * 支持message.*传任意多个参数 ([abbfaeb](https://github.com/easyops-cn/next-core/commit/abbfaeb4752b408005a82e6a6cf57505b9d3aeb8))
68
-
69
-
70
-
71
-
63
+ - theme dark ([8ff6958](https://github.com/easyops-cn/next-core/commit/8ff6958e134c199e58ec4e026003839dcbc5ea57))
64
+ - 兼容 message 事件传多个参数的情况 ([fbde026](https://github.com/easyops-cn/next-core/commit/fbde026b51f8bd2d4a83b3c2ac3ac93bf6515179))
65
+ - 支持 message.\*传任意多个参数 ([abbfaeb](https://github.com/easyops-cn/next-core/commit/abbfaeb4752b408005a82e6a6cf57505b9d3aeb8))
72
66
 
73
67
  # [2.120.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.119.1...@next-core/brick-kit@2.120.0) (2022-05-26)
74
68
 
75
-
76
69
  ### Features
77
70
 
78
- * support lifeCycle.onScrollIntoView ([4e3a4ec](https://github.com/easyops-cn/next-core/commit/4e3a4ec99a78b312c6efe595d82e214a843458d0))
79
-
80
-
81
-
82
-
71
+ - support lifeCycle.onScrollIntoView ([4e3a4ec](https://github.com/easyops-cn/next-core/commit/4e3a4ec99a78b312c6efe595d82e214a843458d0))
83
72
 
84
73
  ## [2.119.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.119.0...@next-core/brick-kit@2.119.1) (2022-05-13)
85
74
 
86
75
  **Note:** Version bump only for package @next-core/brick-kit
87
76
 
88
-
89
-
90
-
91
-
92
77
  # [2.119.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.118.7...@next-core/brick-kit@2.119.0) (2022-05-11)
93
78
 
94
-
95
79
  ### Features
96
80
 
97
- * **mock:** add note ([74c0031](https://github.com/easyops-cn/next-core/commit/74c0031c81ded97014384213d99fedce8ed55d54))
98
- * **mock:** update mock rule ([c8fe9fc](https://github.com/easyops-cn/next-core/commit/c8fe9fccb46117330e1ff2ef42a18bef8dfff864))
99
- * **mock:** update mock rule ([5898ecf](https://github.com/easyops-cn/next-core/commit/5898ecfd604ca418feeb954a6091e3b940a1e867))
100
-
101
-
102
-
103
-
81
+ - **mock:** add note ([74c0031](https://github.com/easyops-cn/next-core/commit/74c0031c81ded97014384213d99fedce8ed55d54))
82
+ - **mock:** update mock rule ([c8fe9fc](https://github.com/easyops-cn/next-core/commit/c8fe9fccb46117330e1ff2ef42a18bef8dfff864))
83
+ - **mock:** update mock rule ([5898ecf](https://github.com/easyops-cn/next-core/commit/5898ecfd604ca418feeb954a6091e3b940a1e867))
104
84
 
105
85
  ## [2.118.7](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.118.6...@next-core/brick-kit@2.118.7) (2022-05-10)
106
86
 
107
87
  **Note:** Version bump only for package @next-core/brick-kit
108
88
 
109
-
110
-
111
-
112
-
113
89
  ## [2.118.6](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.118.5...@next-core/brick-kit@2.118.6) (2022-05-09)
114
90
 
115
91
  **Note:** Version bump only for package @next-core/brick-kit
116
92
 
117
-
118
-
119
-
120
-
121
93
  ## [2.118.5](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.118.4...@next-core/brick-kit@2.118.5) (2022-05-07)
122
94
 
123
95
  **Note:** Version bump only for package @next-core/brick-kit
@@ -563,24 +563,6 @@
563
563
  return _ref.apply(this, arguments);
564
564
  };
565
565
  }();
566
- /**
567
- * @description 搜索实例V3 (支持多属性排序)
568
- * @endpoint POST /v3/object/:objectId/instance/_search
569
- */
570
-
571
-
572
- var InstanceApi_postSearchV3 = /*#__PURE__*/function () {
573
- var _ref = _asyncToGenerator$3(function* (objectId, data, options) {
574
- return (
575
- /**! @contract easyops.api.cmdb.instance.PostSearchV3 */
576
- (yield brickHttp.http.post("api/gateway/cmdb.instance.PostSearchV3/v3/object/".concat(objectId, "/instance/_search"), data, options)).data
577
- );
578
- });
579
-
580
- return function InstanceApi_postSearchV3(_x, _x2, _x3) {
581
- return _ref.apply(this, arguments);
582
- };
583
- }();
584
566
 
585
567
  function supply(attemptToVisitGlobals, providedGlobalVariables, mock) {
586
568
  var globalVariables = _objectSpread__default["default"]({}, providedGlobalVariables); // Allow limited browser builtin values.
@@ -5841,51 +5823,6 @@
5841
5823
  };
5842
5824
  }();
5843
5825
 
5844
- var mocks = {
5845
- mockId: null,
5846
- mockList: []
5847
- };
5848
- function registerMock(useMocks) {
5849
- var _useMocks$mockList;
5850
-
5851
- if (useMocks) mocks = _objectSpread__default["default"](_objectSpread__default["default"]({}, useMocks), {}, {
5852
- mockList: (_useMocks$mockList = useMocks.mockList) === null || _useMocks$mockList === void 0 ? void 0 : _useMocks$mockList.map(item => {
5853
- var isFlowAPi = isCustomApiProvider(item.provider);
5854
- return _objectSpread__default["default"](_objectSpread__default["default"]({}, item), {}, {
5855
- uri: "".concat(isFlowAPi ? item.uri.replace(/(.+?)\/(.+)/, (_match, p1, p2) => {
5856
- return "/".concat(p1, "(@\\d+\\.\\d+\\.\\d+)?/").concat(p2, "$");
5857
- }) : "/".concat(item.uri.split(".").slice(2).join("."), "$")).replace(/:\w+/g, "([^/]+)")
5858
- });
5859
- })
5860
- });
5861
- }
5862
- function getMockList() {
5863
- return mocks.mockList;
5864
- }
5865
- var getMockInfo = (requestUrl, method) => {
5866
- var transformGetMethod = method => {
5867
- if (method.toUpperCase() === "LIST") {
5868
- return "GET";
5869
- }
5870
-
5871
- return method === null || method === void 0 ? void 0 : method.toUpperCase();
5872
- };
5873
-
5874
- var item = mocks.mockList.find(item => new RegExp(item.uri).test(requestUrl) && transformGetMethod(item.method) === (method === null || method === void 0 ? void 0 : method.toUpperCase()));
5875
-
5876
- if (item) {
5877
- return {
5878
- url: requestUrl.replace(/(api\/gateway\/.+?)(@\d+\.\d+\.\d+)?\/(.+)/, (_match, p1, _p2, p3) => {
5879
- // 忽略版本
5880
- return "".concat(p1, "/").concat(p3);
5881
- }).replace(/(api\/gateway)/, "api/gateway/mock_server.proxy.".concat(mocks.mockId)),
5882
- mockId: mocks.mockId
5883
- };
5884
- }
5885
-
5886
- return;
5887
- };
5888
-
5889
5826
  var contractsMap = new Map();
5890
5827
  function collectContract(contracts) {
5891
5828
  contracts === null || contracts === void 0 ? void 0 : contracts.forEach(contract => {
@@ -6022,75 +5959,40 @@
6022
5959
  _fetchFlowApiDefinition2 = _asyncToGenerator__default["default"](function* (provider) {
6023
5960
  var [namespaceName, nameWithVersion] = provider.split("@");
6024
5961
  var [name, version] = nameWithVersion.split(":");
6025
- var isUseMock = getMockList().find(item => item.provider === "".concat(namespaceName, "@").concat(name));
5962
+ var contract;
6026
5963
 
6027
- if (isUseMock) {
6028
- var _list$;
6029
-
6030
- var {
6031
- list
6032
- } = yield InstanceApi_postSearchV3("FLOW_BUILDER_API_CONTRACT@EASYOPS", {
6033
- fields: ["name", "namespaceId", "endpoint", "response", "version", "serviceName"],
6034
- query: {
6035
- namespaceId: {
6036
- $eq: namespaceName
6037
- },
6038
- name: {
6039
- $eq: name
6040
- }
5964
+ if (contract = getContract("".concat(namespaceName, ".").concat(name))) {
5965
+ return {
5966
+ name: contract.name,
5967
+ namespace: contract.namespaceId,
5968
+ serviceName: contract.serviceName,
5969
+ version: contract.version,
5970
+ contract: {
5971
+ endpoint: contract.endpoint,
5972
+ response: contract.response
6041
5973
  }
6042
- });
6043
-
6044
- if ((_list$ = list[0]) !== null && _list$ !== void 0 && _list$.instanceId) {
6045
- var _list$2, _list$3;
6046
-
6047
- return {
6048
- name: list[0].name,
6049
- namespace: (_list$2 = list[0]) === null || _list$2 === void 0 ? void 0 : _list$2.namespaceId,
6050
- serviceName: (_list$3 = list[0]) === null || _list$3 === void 0 ? void 0 : _list$3.serviceName,
6051
- version: list[0].version,
6052
- contract: {
6053
- endpoint: list[0].endpoint,
6054
- response: list[0].response
6055
- }
6056
- };
6057
- }
5974
+ };
6058
5975
  } else {
6059
- var contract;
5976
+ var {
5977
+ contractData
5978
+ } = yield ContractApi_searchSingleContract({
5979
+ contractName: "".concat(namespaceName, ".").concat(name),
5980
+ version
5981
+ }); // return undefined if don't found contract
5982
+
5983
+ if (contractData) {
5984
+ var _contractData$namespa, _contractData$namespa2;
6060
5985
 
6061
- if (contract = getContract("".concat(namespaceName, ".").concat(name))) {
6062
5986
  return {
6063
- name: contract.name,
6064
- namespace: contract.namespaceId,
6065
- serviceName: contract.serviceName,
6066
- version: contract.version,
5987
+ name: contractData.name,
5988
+ namespace: (_contractData$namespa = contractData.namespace) === null || _contractData$namespa === void 0 ? void 0 : (_contractData$namespa2 = _contractData$namespa[0]) === null || _contractData$namespa2 === void 0 ? void 0 : _contractData$namespa2.name,
5989
+ serviceName: contractData.serviceName,
5990
+ version: contractData.version,
6067
5991
  contract: {
6068
- endpoint: contract.endpoint,
6069
- response: contract.response
5992
+ endpoint: contractData.endpoint,
5993
+ response: contractData.response
6070
5994
  }
6071
5995
  };
6072
- } else {
6073
- var {
6074
- contractData
6075
- } = yield ContractApi_searchSingleContract({
6076
- contractName: "".concat(namespaceName, ".").concat(name),
6077
- version
6078
- }); // return undefined if don't found contract
6079
-
6080
- if (contractData) {
6081
- var _contractData$namespa, _contractData$namespa2;
6082
-
6083
- return {
6084
- name: contractData.name,
6085
- namespace: (_contractData$namespa = contractData.namespace) === null || _contractData$namespa === void 0 ? void 0 : (_contractData$namespa2 = _contractData$namespa[0]) === null || _contractData$namespa2 === void 0 ? void 0 : _contractData$namespa2.name,
6086
- serviceName: contractData.serviceName,
6087
- version: contractData.version,
6088
- contract: {
6089
- endpoint: contractData.endpoint,
6090
- response: contractData.response
6091
- }
6092
- };
6093
- }
6094
5996
  }
6095
5997
  }
6096
5998
  });
@@ -8528,6 +8430,7 @@
8528
8430
  legacy
8529
8431
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8530
8432
  this.toggleBars(true);
8433
+ getRuntime().applyPageTitle(null);
8531
8434
 
8532
8435
  if (this.currentLayout !== "console") {
8533
8436
  // No bars should be unset for the business layout.
@@ -8542,8 +8445,6 @@
8542
8445
  // 对于 Legacy 页面,仅当切换应用时重设面包屑。
8543
8446
  this.appBar.setBreadcrumb(null);
8544
8447
  }
8545
-
8546
- getRuntime().applyPageTitle(null);
8547
8448
  }
8548
8449
 
8549
8450
  toggleLegacyIframe(visible) {
@@ -10339,6 +10240,48 @@
10339
10240
  return defaultCollapsed || defaultCollapsedBreakpoint && document.documentElement.clientWidth < defaultCollapsedBreakpoint;
10340
10241
  }
10341
10242
 
10243
+ var mocks = {
10244
+ mockId: null,
10245
+ mockList: []
10246
+ };
10247
+ function registerMock(useMocks) {
10248
+ var _useMocks$mockList;
10249
+
10250
+ if (useMocks) mocks = _objectSpread__default["default"](_objectSpread__default["default"]({}, useMocks), {}, {
10251
+ mockList: (_useMocks$mockList = useMocks.mockList) === null || _useMocks$mockList === void 0 ? void 0 : _useMocks$mockList.map(item => {
10252
+ var isFlowAPi = isCustomApiProvider(item.provider);
10253
+ return _objectSpread__default["default"](_objectSpread__default["default"]({}, item), {}, {
10254
+ uri: "".concat(isFlowAPi ? item.uri.replace(/(.+?)\/(.+)/, (_match, p1, p2) => {
10255
+ return "/".concat(p1, "(@\\d+\\.\\d+\\.\\d+)?/").concat(p2, "$");
10256
+ }) : "/".concat(item.uri.split(".").slice(2).join("."), "$")).replace(/:\w+/g, "([^/]+)")
10257
+ });
10258
+ })
10259
+ });
10260
+ }
10261
+ var getMockInfo = (requestUrl, method) => {
10262
+ var transformGetMethod = method => {
10263
+ if (method.toUpperCase() === "LIST") {
10264
+ return "GET";
10265
+ }
10266
+
10267
+ return method === null || method === void 0 ? void 0 : method.toUpperCase();
10268
+ };
10269
+
10270
+ var item = mocks.mockList.find(item => new RegExp(item.uri).test(requestUrl) && transformGetMethod(item.method) === (method === null || method === void 0 ? void 0 : method.toUpperCase()));
10271
+
10272
+ if (item) {
10273
+ return {
10274
+ url: requestUrl.replace(/(api\/gateway\/.+?)(@\d+\.\d+\.\d+)?\/(.+)/, (_match, p1, _p2, p3) => {
10275
+ // 忽略版本
10276
+ return "".concat(p1, "/").concat(p3);
10277
+ }).replace(/(api\/gateway)/, "api/gateway/mock_server.proxy.".concat(mocks.mockId)),
10278
+ mockId: mocks.mockId
10279
+ };
10280
+ }
10281
+
10282
+ return;
10283
+ };
10284
+
10342
10285
  class Router {
10343
10286
  constructor(kernel) {
10344
10287
  _defineProperty__default["default"](this, "defaultCollapsed", false);