@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/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,26 @@ 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
+ }();
4733
4755
  /**
4734
4756
  * @description 通过defaultOrg查找单个契约信息
4735
4757
  * @endpoint POST /api/contract/single_search
@@ -4739,7 +4761,7 @@ function clearPollTimeout() {
4739
4761
  var ContractApi_searchSingleContract = /*#__PURE__*/function () {
4740
4762
  var _ref = _asyncToGenerator$4(function* (data, options) {
4741
4763
  return (
4742
- /**! @contract easyops.api.api_gateway.contract.SearchSingleContract */
4764
+ /**! @contract easyops.api.api_gateway.contract.SearchSingleContract@1.0.0 */
4743
4765
  (yield http.post("api/contract/single_search", data, options)).data
4744
4766
  );
4745
4767
  });
@@ -6192,7 +6214,14 @@ class Kernel {
6192
6214
  var _this3 = this;
6193
6215
 
6194
6216
  return _asyncToGenerator$4(function* () {
6195
- var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : bootstrap(_objectSpread({
6217
+ // Todo(jojiang): boostrap V2 接口测试通过后移除 V1 版本的兼容
6218
+ var data = yield window.STANDALONE_MICRO_APPS ? standaloneBootstrap() : localStorage.getItem("__$$use-bootstrap-v2-provider$$__") ? BootstrapV2Api_bootstrapV2(_objectSpread({
6219
+ appFields: "defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status",
6220
+ ignoreTemplateFields: "templates",
6221
+ ignoreBrickFields: "bricks,processors,providers,editors"
6222
+ }, params), {
6223
+ interceptorParams
6224
+ }) : bootstrap(_objectSpread({
6196
6225
  brief: true
6197
6226
  }, params), {
6198
6227
  interceptorParams
@@ -6244,11 +6273,13 @@ class Kernel {
6244
6273
  } else {
6245
6274
  var {
6246
6275
  routes,
6247
- meta
6276
+ meta,
6277
+ app
6248
6278
  } = yield getAppStoryboard(storyboard.app.id);
6249
6279
  Object.assign(storyboard, {
6250
6280
  routes,
6251
6281
  meta,
6282
+ app: _objectSpread(_objectSpread({}, storyboard.app), app),
6252
6283
  $$fulfilled: true
6253
6284
  });
6254
6285
  }
@@ -9259,6 +9290,8 @@ class Router {
9259
9290
  };
9260
9291
 
9261
9292
  if (storyboard) {
9293
+ var _currentApp$breadcrum, _currentApp$breadcrum2;
9294
+
9262
9295
  if (appChanged && currentApp.id && isLoggedIn()) {
9263
9296
  var usedCustomApis = mapCustomApisToNameAndNamespace(scanCustomApisInStoryboard(storyboard));
9264
9297
 
@@ -9274,7 +9307,8 @@ class Router {
9274
9307
  portal: [],
9275
9308
  appBar: {
9276
9309
  breadcrumb: [],
9277
- 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
9278
9312
  },
9279
9313
  flags: {
9280
9314
  redirect: undefined,