@next-core/brick-kit 2.88.0 → 2.89.2

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.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.89.1...@next-core/brick-kit@2.89.2) (2021-11-25)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * get stroyboard v2 ([602d086](https://github.com/easyops-cn/next-core/commit/602d0860fc6c7c9e5ffc116ff023addb0f57efe1))
12
+
13
+
14
+
15
+
16
+
17
+ ## [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)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * bootsrtrap 增加开关控制 ([360b913](https://github.com/easyops-cn/next-core/commit/360b913f324f10ac79b1d637ec598583a89a61da))
23
+
24
+
25
+
26
+
27
+
28
+ # [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)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * refine storyboard function ([90c42c1](https://github.com/easyops-cn/next-core/commit/90c42c1f49a7d7e8297d424bd02a3957787fb8e3))
34
+
35
+
36
+ ### Features
37
+
38
+ * use global noCurrentApp as default ([4e18163](https://github.com/easyops-cn/next-core/commit/4e18163eeefa24cb022cb9b936746c9e7ad80e70))
39
+
40
+
41
+
42
+
43
+
44
+ ## [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)
45
+
46
+
47
+ ### Bug Fixes
48
+
49
+ * app 字段合并 boostrap 接口详情的 app 信息 ([2dffa41](https://github.com/easyops-cn/next-core/commit/2dffa41e020e92994c6275a62977128b0a7a4bad))
50
+ * use boostreap v2 api ([e1fbf03](https://github.com/easyops-cn/next-core/commit/e1fbf0366e29b28f823915bda4707368910c013e))
51
+
52
+
53
+
54
+
55
+
6
56
  # [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)
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,46 @@
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
+ }();
4772
+ /**
4773
+ * @description 获取app storyboard初始化信息
4774
+ * @endpoint GET /api/auth/v2/bootstrap/:appId
4775
+ */
4776
+
4777
+
4778
+ var BootstrapV2Api_getAppStoryboardV2 = /*#__PURE__*/function () {
4779
+ var _ref = _asyncToGenerator__default["default"](function* (appId, params, options) {
4780
+ return (
4781
+ /**! @contract easyops.api.api_gateway.bootstrap_v2.GetAppStoryboardV2@1.0.0 */
4782
+ (yield brickHttp.http.get("api/auth/v2/bootstrap/".concat(appId), _objectSpread__default["default"](_objectSpread__default["default"]({}, options), {}, {
4783
+ params
4784
+ }))).data
4785
+ );
4786
+ });
4787
+
4788
+ return function BootstrapV2Api_getAppStoryboardV2(_x, _x2, _x3) {
4789
+ return _ref.apply(this, arguments);
4790
+ };
4791
+ }();
4750
4792
  /**
4751
4793
  * @description 通过defaultOrg查找单个契约信息
4752
4794
  * @endpoint POST /api/contract/single_search
@@ -4756,7 +4798,7 @@
4756
4798
  var ContractApi_searchSingleContract = /*#__PURE__*/function () {
4757
4799
  var _ref = _asyncToGenerator__default["default"](function* (data, options) {
4758
4800
  return (
4759
- /**! @contract easyops.api.api_gateway.contract.SearchSingleContract */
4801
+ /**! @contract easyops.api.api_gateway.contract.SearchSingleContract@1.0.0 */
4760
4802
  (yield brickHttp.http.post("api/contract/single_search", data, options)).data
4761
4803
  );
4762
4804
  });
@@ -6209,7 +6251,14 @@
6209
6251
  var _this3 = this;
6210
6252
 
6211
6253
  return _asyncToGenerator__default["default"](function* () {
6212
- var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : bootstrap(_objectSpread__default["default"]({
6254
+ // Todo(jojiang): boostrap V2 接口测试通过后移除 V1 版本的兼容
6255
+ var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : localStorage.getItem("__$$use-bootstrap-v2-provider$$__") ? BootstrapV2Api_bootstrapV2(_objectSpread__default["default"]({
6256
+ appFields: "defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status",
6257
+ ignoreTemplateFields: "templates",
6258
+ ignoreBrickFields: "bricks,processors,providers,editors"
6259
+ }, params), {
6260
+ interceptorParams
6261
+ }) : bootstrap(_objectSpread__default["default"]({
6213
6262
  brief: true
6214
6263
  }, params), {
6215
6264
  interceptorParams
@@ -6259,13 +6308,16 @@
6259
6308
  $$fulfilled: true
6260
6309
  });
6261
6310
  } else {
6311
+ /* istanbul ignore next */
6262
6312
  var {
6263
6313
  routes,
6264
- meta
6265
- } = yield getAppStoryboard(storyboard.app.id);
6314
+ meta,
6315
+ app
6316
+ } = yield localStorage.getItem("__$$use-bootstrap-v2-provider$$__") ? BootstrapV2Api_getAppStoryboardV2(storyboard.app.id, {}) : getAppStoryboard(storyboard.app.id);
6266
6317
  Object.assign(storyboard, {
6267
6318
  routes,
6268
6319
  meta,
6320
+ app: _objectSpread__default["default"](_objectSpread__default["default"]({}, storyboard.app), app),
6269
6321
  $$fulfilled: true
6270
6322
  });
6271
6323
  }
@@ -9276,6 +9328,8 @@
9276
9328
  };
9277
9329
 
9278
9330
  if (storyboard) {
9331
+ var _currentApp$breadcrum, _currentApp$breadcrum2;
9332
+
9279
9333
  if (appChanged && currentApp.id && isLoggedIn()) {
9280
9334
  var usedCustomApis = brickUtils.mapCustomApisToNameAndNamespace(brickUtils.scanCustomApisInStoryboard(storyboard));
9281
9335
 
@@ -9292,7 +9346,7 @@
9292
9346
  appBar: {
9293
9347
  breadcrumb: [],
9294
9348
  documentId: null,
9295
- noCurrentApp: false
9349
+ 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
9296
9350
  },
9297
9351
  flags: {
9298
9352
  redirect: undefined,