@next-core/brick-kit 2.86.1 → 2.89.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 CHANGED
@@ -3,6 +3,56 @@
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.89.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.88.1...@next-core/brick-kit@2.89.0) (2021-11-25)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * refine storyboard function ([90c42c1](https://github.com/easyops-cn/next-core/commit/90c42c1f49a7d7e8297d424bd02a3957787fb8e3))
12
+
13
+
14
+ ### Features
15
+
16
+ * use global noCurrentApp as default ([4e18163](https://github.com/easyops-cn/next-core/commit/4e18163eeefa24cb022cb9b936746c9e7ad80e70))
17
+
18
+
19
+
20
+
21
+
22
+ ## [2.88.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.88.0...@next-core/brick-kit@2.88.1) (2021-11-25)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * app 字段合并 boostrap 接口详情的 app 信息 ([2dffa41](https://github.com/easyops-cn/next-core/commit/2dffa41e020e92994c6275a62977128b0a7a4bad))
28
+ * use boostreap v2 api ([e1fbf03](https://github.com/easyops-cn/next-core/commit/e1fbf0366e29b28f823915bda4707368910c013e))
29
+
30
+
31
+
32
+
33
+
34
+ # [2.88.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.87.0...@next-core/brick-kit@2.88.0) (2021-11-23)
35
+
36
+
37
+ ### Features
38
+
39
+ * **Router:** set noCurrentApp default value ([8d5efe1](https://github.com/easyops-cn/next-core/commit/8d5efe14230b72ede0a87eeacf8881433b1e4829))
40
+
41
+
42
+
43
+
44
+
45
+ # [2.87.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.86.1...@next-core/brick-kit@2.87.0) (2021-11-23)
46
+
47
+
48
+ ### Features
49
+
50
+ * **locationContext:** add noCurrentApp ([8efc245](https://github.com/easyops-cn/next-core/commit/8efc245513f8e9ebf0aadcabfedd15647333d318))
51
+
52
+
53
+
54
+
55
+
6
56
  ## [2.86.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.86.0...@next-core/brick-kit@2.86.1) (2021-11-23)
7
57
 
8
58
  **Note:** Version bump only for package @next-core/brick-kit
@@ -1419,8 +1419,6 @@
1419
1419
  }
1420
1420
 
1421
1421
  function getStoryboardFunction(name) {
1422
- var _collector, _collector2, _collector3, _collector4;
1423
-
1424
1422
  var fn = registeredFunctions.get(name);
1425
1423
 
1426
1424
  if (!fn) {
@@ -1439,8 +1437,8 @@
1439
1437
 
1440
1438
  var precooked = brickUtils.precookFunction(fn.source, {
1441
1439
  typescript: fn.typescript,
1442
- hooks: {
1443
- beforeVisit: (_collector = collector) === null || _collector === void 0 ? void 0 : _collector.beforeVisit
1440
+ hooks: collector && {
1441
+ beforeVisit: collector.beforeVisit
1444
1442
  }
1445
1443
  });
1446
1444
  fn.cooked = brickUtils.cook(precooked.function, fn.source, {
@@ -1451,10 +1449,10 @@
1451
1449
  // Functions can call other functions.
1452
1450
  FN: storyboardFunctions
1453
1451
  }),
1454
- hooks: {
1455
- beforeEvaluate: (_collector2 = collector) === null || _collector2 === void 0 ? void 0 : _collector2.beforeEvaluate,
1456
- beforeCall: (_collector3 = collector) === null || _collector3 === void 0 ? void 0 : _collector3.beforeCall,
1457
- beforeBranch: (_collector4 = collector) === null || _collector4 === void 0 ? void 0 : _collector4.beforeBranch
1452
+ hooks: collector && {
1453
+ beforeEvaluate: collector.beforeEvaluate,
1454
+ beforeCall: collector.beforeCall,
1455
+ beforeBranch: collector.beforeBranch
1458
1456
  }
1459
1457
  });
1460
1458
  fn.processed = true;
@@ -2418,11 +2416,15 @@
2418
2416
  /* istanbul ignore next */
2419
2417
 
2420
2418
  function _dev_only_getBrickPackages() {
2419
+ // eslint-disable-next-line no-console
2420
+ console.warn("`_dev_only_getBrickPackages()` is deprecated and will always return an empty array, please use `(await BootstrapV2Api_brickPackageInfo()).bricks` instead");
2421
2421
  return kernel.bootstrapData.brickPackages;
2422
2422
  }
2423
2423
  /* istanbul ignore next */
2424
2424
 
2425
2425
  function _dev_only_getTemplatePackages() {
2426
+ // eslint-disable-next-line no-console
2427
+ console.warn("`_dev_only_getTemplatePackages()` is deprecated and will always return an empty array, please use `(await BootstrapV2Api_brickPackageInfo()).templates` instead");
2426
2428
  return kernel.bootstrapData.templatePackages;
2427
2429
  }
2428
2430
  /* istanbul ignore next */
@@ -4747,6 +4749,26 @@
4747
4749
  timeoutIdList.clear();
4748
4750
  }
4749
4751
 
4752
+ /**
4753
+ * @description 获取系统初始化信息
4754
+ * @endpoint GET /api/auth/v2/bootstrap
4755
+ */
4756
+
4757
+
4758
+ var BootstrapV2Api_bootstrapV2 = /*#__PURE__*/function () {
4759
+ var _ref = _asyncToGenerator__default["default"](function* (params, options) {
4760
+ return (
4761
+ /**! @contract easyops.api.api_gateway.bootstrap_v2.BootstrapV2@1.0.0 */
4762
+ (yield brickHttp.http.get("api/auth/v2/bootstrap", _objectSpread__default["default"](_objectSpread__default["default"]({}, options), {}, {
4763
+ params
4764
+ }))).data
4765
+ );
4766
+ });
4767
+
4768
+ return function BootstrapV2Api_bootstrapV2(_x, _x2) {
4769
+ return _ref.apply(this, arguments);
4770
+ };
4771
+ }();
4750
4772
  /**
4751
4773
  * @description 通过defaultOrg查找单个契约信息
4752
4774
  * @endpoint POST /api/contract/single_search
@@ -4756,7 +4778,7 @@
4756
4778
  var ContractApi_searchSingleContract = /*#__PURE__*/function () {
4757
4779
  var _ref = _asyncToGenerator__default["default"](function* (data, options) {
4758
4780
  return (
4759
- /**! @contract easyops.api.api_gateway.contract.SearchSingleContract */
4781
+ /**! @contract easyops.api.api_gateway.contract.SearchSingleContract@1.0.0 */
4760
4782
  (yield brickHttp.http.post("api/contract/single_search", data, options)).data
4761
4783
  );
4762
4784
  });
@@ -5760,18 +5782,6 @@
5760
5782
  };
5761
5783
  }();
5762
5784
 
5763
- var bootstrap = /*#__PURE__*/function () {
5764
- var _ref3 = _asyncToGenerator$1(function* (params, options) {
5765
- return (yield brickHttp.http.get("api/auth/bootstrap", _objectSpread2(_objectSpread2({}, options), {}, {
5766
- params
5767
- }))).data;
5768
- });
5769
-
5770
- return function bootstrap(_x4, _x5) {
5771
- return _ref3.apply(this, arguments);
5772
- };
5773
- }();
5774
-
5775
5785
  var getAppStoryboard = /*#__PURE__*/function () {
5776
5786
  var _ref4 = _asyncToGenerator$1(function* (appId, params, options) {
5777
5787
  return (yield brickHttp.http.get("api/auth/bootstrap/".concat(appId), _objectSpread2(_objectSpread2({}, options), {}, {
@@ -6209,8 +6219,10 @@
6209
6219
  var _this3 = this;
6210
6220
 
6211
6221
  return _asyncToGenerator__default["default"](function* () {
6212
- var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : bootstrap(_objectSpread__default["default"]({
6213
- brief: true
6222
+ var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : BootstrapV2Api_bootstrapV2(_objectSpread__default["default"]({
6223
+ appFields: "defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status",
6224
+ ignoreTemplateFields: "templates",
6225
+ ignoreBrickFields: "bricks,processors,providers,editors"
6214
6226
  }, params), {
6215
6227
  interceptorParams
6216
6228
  });
@@ -6261,11 +6273,13 @@
6261
6273
  } else {
6262
6274
  var {
6263
6275
  routes,
6264
- meta
6276
+ meta,
6277
+ app
6265
6278
  } = yield getAppStoryboard(storyboard.app.id);
6266
6279
  Object.assign(storyboard, {
6267
6280
  routes,
6268
6281
  meta,
6282
+ app: _objectSpread__default["default"](_objectSpread__default["default"]({}, storyboard.app), app),
6269
6283
  $$fulfilled: true
6270
6284
  });
6271
6285
  }
@@ -8185,6 +8199,8 @@
8185
8199
  } else {
8186
8200
  mountRoutesResult.appBar.breadcrumb = [...mountRoutesResult.appBar.breadcrumb, ...breadcrumb.items];
8187
8201
  }
8202
+
8203
+ if (brickUtils.hasOwnProperty(breadcrumb, "noCurrentApp")) mountRoutesResult.appBar.noCurrentApp = breadcrumb.noCurrentApp;
8188
8204
  }
8189
8205
  })();
8190
8206
  }
@@ -9274,6 +9290,8 @@
9274
9290
  };
9275
9291
 
9276
9292
  if (storyboard) {
9293
+ var _currentApp$breadcrum, _currentApp$breadcrum2;
9294
+
9277
9295
  if (appChanged && currentApp.id && isLoggedIn()) {
9278
9296
  var usedCustomApis = brickUtils.mapCustomApisToNameAndNamespace(brickUtils.scanCustomApisInStoryboard(storyboard));
9279
9297
 
@@ -9289,7 +9307,8 @@
9289
9307
  portal: [],
9290
9308
  appBar: {
9291
9309
  breadcrumb: [],
9292
- documentId: null
9310
+ documentId: null,
9311
+ noCurrentApp: (_currentApp$breadcrum = (_currentApp$breadcrum2 = currentApp.breadcrumb) === null || _currentApp$breadcrum2 === void 0 ? void 0 : _currentApp$breadcrum2.noCurrentApp) !== null && _currentApp$breadcrum !== void 0 ? _currentApp$breadcrum : false
9293
9312
  },
9294
9313
  flags: {
9295
9314
  redirect: undefined,