@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/dist/index.esm.js CHANGED
@@ -1402,8 +1402,6 @@ function StoryboardFunctionRegistryFactory() {
1402
1402
  }
1403
1403
 
1404
1404
  function getStoryboardFunction(name) {
1405
- var _collector, _collector2, _collector3, _collector4;
1406
-
1407
1405
  var fn = registeredFunctions.get(name);
1408
1406
 
1409
1407
  if (!fn) {
@@ -1422,8 +1420,8 @@ function StoryboardFunctionRegistryFactory() {
1422
1420
 
1423
1421
  var precooked = precookFunction(fn.source, {
1424
1422
  typescript: fn.typescript,
1425
- hooks: {
1426
- beforeVisit: (_collector = collector) === null || _collector === void 0 ? void 0 : _collector.beforeVisit
1423
+ hooks: collector && {
1424
+ beforeVisit: collector.beforeVisit
1427
1425
  }
1428
1426
  });
1429
1427
  fn.cooked = cook(precooked.function, fn.source, {
@@ -1434,10 +1432,10 @@ function StoryboardFunctionRegistryFactory() {
1434
1432
  // Functions can call other functions.
1435
1433
  FN: storyboardFunctions
1436
1434
  }),
1437
- hooks: {
1438
- beforeEvaluate: (_collector2 = collector) === null || _collector2 === void 0 ? void 0 : _collector2.beforeEvaluate,
1439
- beforeCall: (_collector3 = collector) === null || _collector3 === void 0 ? void 0 : _collector3.beforeCall,
1440
- beforeBranch: (_collector4 = collector) === null || _collector4 === void 0 ? void 0 : _collector4.beforeBranch
1435
+ hooks: collector && {
1436
+ beforeEvaluate: collector.beforeEvaluate,
1437
+ beforeCall: collector.beforeCall,
1438
+ beforeBranch: collector.beforeBranch
1441
1439
  }
1442
1440
  });
1443
1441
  fn.processed = true;
@@ -2401,11 +2399,15 @@ var fakeTplContext;
2401
2399
  /* istanbul ignore next */
2402
2400
 
2403
2401
  function _dev_only_getBrickPackages() {
2402
+ // eslint-disable-next-line no-console
2403
+ console.warn("`_dev_only_getBrickPackages()` is deprecated and will always return an empty array, please use `(await BootstrapV2Api_brickPackageInfo()).bricks` instead");
2404
2404
  return kernel.bootstrapData.brickPackages;
2405
2405
  }
2406
2406
  /* istanbul ignore next */
2407
2407
 
2408
2408
  function _dev_only_getTemplatePackages() {
2409
+ // eslint-disable-next-line no-console
2410
+ console.warn("`_dev_only_getTemplatePackages()` is deprecated and will always return an empty array, please use `(await BootstrapV2Api_brickPackageInfo()).templates` instead");
2409
2411
  return kernel.bootstrapData.templatePackages;
2410
2412
  }
2411
2413
  /* istanbul ignore next */
@@ -4730,6 +4732,46 @@ function clearPollTimeout() {
4730
4732
  timeoutIdList.clear();
4731
4733
  }
4732
4734
 
4735
+ /**
4736
+ * @description 获取系统初始化信息
4737
+ * @endpoint GET /api/auth/v2/bootstrap
4738
+ */
4739
+
4740
+
4741
+ var BootstrapV2Api_bootstrapV2 = /*#__PURE__*/function () {
4742
+ var _ref = _asyncToGenerator$4(function* (params, options) {
4743
+ return (
4744
+ /**! @contract easyops.api.api_gateway.bootstrap_v2.BootstrapV2@1.0.0 */
4745
+ (yield http.get("api/auth/v2/bootstrap", _objectSpread(_objectSpread({}, options), {}, {
4746
+ params
4747
+ }))).data
4748
+ );
4749
+ });
4750
+
4751
+ return function BootstrapV2Api_bootstrapV2(_x, _x2) {
4752
+ return _ref.apply(this, arguments);
4753
+ };
4754
+ }();
4755
+ /**
4756
+ * @description 获取app storyboard初始化信息
4757
+ * @endpoint GET /api/auth/v2/bootstrap/:appId
4758
+ */
4759
+
4760
+
4761
+ var BootstrapV2Api_getAppStoryboardV2 = /*#__PURE__*/function () {
4762
+ var _ref = _asyncToGenerator$4(function* (appId, params, options) {
4763
+ return (
4764
+ /**! @contract easyops.api.api_gateway.bootstrap_v2.GetAppStoryboardV2@1.0.0 */
4765
+ (yield http.get("api/auth/v2/bootstrap/".concat(appId), _objectSpread(_objectSpread({}, options), {}, {
4766
+ params
4767
+ }))).data
4768
+ );
4769
+ });
4770
+
4771
+ return function BootstrapV2Api_getAppStoryboardV2(_x, _x2, _x3) {
4772
+ return _ref.apply(this, arguments);
4773
+ };
4774
+ }();
4733
4775
  /**
4734
4776
  * @description 通过defaultOrg查找单个契约信息
4735
4777
  * @endpoint POST /api/contract/single_search
@@ -4739,7 +4781,7 @@ function clearPollTimeout() {
4739
4781
  var ContractApi_searchSingleContract = /*#__PURE__*/function () {
4740
4782
  var _ref = _asyncToGenerator$4(function* (data, options) {
4741
4783
  return (
4742
- /**! @contract easyops.api.api_gateway.contract.SearchSingleContract */
4784
+ /**! @contract easyops.api.api_gateway.contract.SearchSingleContract@1.0.0 */
4743
4785
  (yield http.post("api/contract/single_search", data, options)).data
4744
4786
  );
4745
4787
  });
@@ -6192,7 +6234,14 @@ class Kernel {
6192
6234
  var _this3 = this;
6193
6235
 
6194
6236
  return _asyncToGenerator$4(function* () {
6195
- var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : bootstrap(_objectSpread({
6237
+ // Todo(jojiang): boostrap V2 接口测试通过后移除 V1 版本的兼容
6238
+ var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : localStorage.getItem("__$$use-bootstrap-v2-provider$$__") ? BootstrapV2Api_bootstrapV2(_objectSpread({
6239
+ appFields: "defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status",
6240
+ ignoreTemplateFields: "templates",
6241
+ ignoreBrickFields: "bricks,processors,providers,editors"
6242
+ }, params), {
6243
+ interceptorParams
6244
+ }) : bootstrap(_objectSpread({
6196
6245
  brief: true
6197
6246
  }, params), {
6198
6247
  interceptorParams
@@ -6242,13 +6291,16 @@ class Kernel {
6242
6291
  $$fulfilled: true
6243
6292
  });
6244
6293
  } else {
6294
+ /* istanbul ignore next */
6245
6295
  var {
6246
6296
  routes,
6247
- meta
6248
- } = yield getAppStoryboard(storyboard.app.id);
6297
+ meta,
6298
+ app
6299
+ } = yield localStorage.getItem("__$$use-bootstrap-v2-provider$$__") ? BootstrapV2Api_getAppStoryboardV2(storyboard.app.id, {}) : getAppStoryboard(storyboard.app.id);
6249
6300
  Object.assign(storyboard, {
6250
6301
  routes,
6251
6302
  meta,
6303
+ app: _objectSpread(_objectSpread({}, storyboard.app), app),
6252
6304
  $$fulfilled: true
6253
6305
  });
6254
6306
  }
@@ -9259,6 +9311,8 @@ class Router {
9259
9311
  };
9260
9312
 
9261
9313
  if (storyboard) {
9314
+ var _currentApp$breadcrum, _currentApp$breadcrum2;
9315
+
9262
9316
  if (appChanged && currentApp.id && isLoggedIn()) {
9263
9317
  var usedCustomApis = mapCustomApisToNameAndNamespace(scanCustomApisInStoryboard(storyboard));
9264
9318
 
@@ -9275,7 +9329,7 @@ class Router {
9275
9329
  appBar: {
9276
9330
  breadcrumb: [],
9277
9331
  documentId: null,
9278
- noCurrentApp: false
9332
+ 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
9279
9333
  },
9280
9334
  flags: {
9281
9335
  redirect: undefined,