@next-core/brick-kit 2.87.0 → 2.89.1

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.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.89.0...@next-core/brick-kit@2.89.1) (2021-11-25)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * bootsrtrap 增加开关控制 ([360b913](https://github.com/easyops-cn/next-core/commit/360b913f324f10ac79b1d637ec598583a89a61da))
12
+
13
+
14
+
15
+
16
+
17
+ # [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)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * refine storyboard function ([90c42c1](https://github.com/easyops-cn/next-core/commit/90c42c1f49a7d7e8297d424bd02a3957787fb8e3))
23
+
24
+
25
+ ### Features
26
+
27
+ * use global noCurrentApp as default ([4e18163](https://github.com/easyops-cn/next-core/commit/4e18163eeefa24cb022cb9b936746c9e7ad80e70))
28
+
29
+
30
+
31
+
32
+
33
+ ## [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)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * app 字段合并 boostrap 接口详情的 app 信息 ([2dffa41](https://github.com/easyops-cn/next-core/commit/2dffa41e020e92994c6275a62977128b0a7a4bad))
39
+ * use boostreap v2 api ([e1fbf03](https://github.com/easyops-cn/next-core/commit/e1fbf0366e29b28f823915bda4707368910c013e))
40
+
41
+
42
+
43
+
44
+
45
+ # [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)
46
+
47
+
48
+ ### Features
49
+
50
+ * **Router:** set noCurrentApp default value ([8d5efe1](https://github.com/easyops-cn/next-core/commit/8d5efe14230b72ede0a87eeacf8881433b1e4829))
51
+
52
+
53
+
54
+
55
+
6
56
  # [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)
7
57
 
8
58
 
@@ -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
  });
@@ -6209,7 +6231,14 @@
6209
6231
  var _this3 = this;
6210
6232
 
6211
6233
  return _asyncToGenerator__default["default"](function* () {
6212
- var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : bootstrap(_objectSpread__default["default"]({
6234
+ // Todo(jojiang): boostrap V2 接口测试通过后移除 V1 版本的兼容
6235
+ var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : localStorage.getItem("__$$use-bootstrap-v2-provider$$__") ? BootstrapV2Api_bootstrapV2(_objectSpread__default["default"]({
6236
+ appFields: "defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status",
6237
+ ignoreTemplateFields: "templates",
6238
+ ignoreBrickFields: "bricks,processors,providers,editors"
6239
+ }, params), {
6240
+ interceptorParams
6241
+ }) : bootstrap(_objectSpread__default["default"]({
6213
6242
  brief: true
6214
6243
  }, params), {
6215
6244
  interceptorParams
@@ -6261,11 +6290,13 @@
6261
6290
  } else {
6262
6291
  var {
6263
6292
  routes,
6264
- meta
6293
+ meta,
6294
+ app
6265
6295
  } = yield getAppStoryboard(storyboard.app.id);
6266
6296
  Object.assign(storyboard, {
6267
6297
  routes,
6268
6298
  meta,
6299
+ app: _objectSpread__default["default"](_objectSpread__default["default"]({}, storyboard.app), app),
6269
6300
  $$fulfilled: true
6270
6301
  });
6271
6302
  }
@@ -9276,6 +9307,8 @@
9276
9307
  };
9277
9308
 
9278
9309
  if (storyboard) {
9310
+ var _currentApp$breadcrum, _currentApp$breadcrum2;
9311
+
9279
9312
  if (appChanged && currentApp.id && isLoggedIn()) {
9280
9313
  var usedCustomApis = brickUtils.mapCustomApisToNameAndNamespace(brickUtils.scanCustomApisInStoryboard(storyboard));
9281
9314
 
@@ -9291,7 +9324,8 @@
9291
9324
  portal: [],
9292
9325
  appBar: {
9293
9326
  breadcrumb: [],
9294
- documentId: null
9327
+ documentId: null,
9328
+ 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
9295
9329
  },
9296
9330
  flags: {
9297
9331
  redirect: undefined,