@next-core/brick-kit 2.157.0 → 2.157.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.bundle.js +69 -41
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +69 -41
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/Kernel.d.ts.map +1 -1
- package/dist/types/core/standaloneBootstrap.d.ts +2 -0
- package/dist/types/core/standaloneBootstrap.d.ts.map +1 -1
- package/dist/types/internal/getStandaloneInstalledApps.d.ts +0 -1
- package/dist/types/internal/getStandaloneInstalledApps.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.bundle.js
CHANGED
|
@@ -6347,36 +6347,6 @@
|
|
|
6347
6347
|
};
|
|
6348
6348
|
}();
|
|
6349
6349
|
|
|
6350
|
-
/**
|
|
6351
|
-
* @description 独立小产品Runtime接口
|
|
6352
|
-
* @endpoint GET /api/v1/micro_app_standalone/runtime/:appId
|
|
6353
|
-
*/
|
|
6354
|
-
var RuntimeApi_runtimeMicroAppStandalone = /*#__PURE__*/function () {
|
|
6355
|
-
var _ref = _asyncToGenerator__default["default"](function* (appId, options) {
|
|
6356
|
-
return (/**! @contract easyops.api.micro_app_standalone.runtime.RuntimeMicroAppStandalone@1.0.1 */
|
|
6357
|
-
(yield brickHttp.http.get("api/gateway/micro_app_standalone.runtime.RuntimeMicroAppStandalone/api/v1/micro_app_standalone/runtime/".concat(appId), options)).data
|
|
6358
|
-
);
|
|
6359
|
-
});
|
|
6360
|
-
return function RuntimeApi_runtimeMicroAppStandalone(_x, _x2) {
|
|
6361
|
-
return _ref.apply(this, arguments);
|
|
6362
|
-
};
|
|
6363
|
-
}();
|
|
6364
|
-
|
|
6365
|
-
/**
|
|
6366
|
-
* @description 查询独立部署小产品
|
|
6367
|
-
* @endpoint POST /api/v1/micro_app_standalone/search
|
|
6368
|
-
*/
|
|
6369
|
-
var RuntimeApi_searchMicroAppStandalone = /*#__PURE__*/function () {
|
|
6370
|
-
var _ref = _asyncToGenerator__default["default"](function* (data, options) {
|
|
6371
|
-
return (/**! @contract easyops.api.micro_app_standalone.runtime.SearchMicroAppStandalone@1.0.1 */
|
|
6372
|
-
(yield brickHttp.http.post("api/gateway/micro_app_standalone.runtime.SearchMicroAppStandalone/api/v1/micro_app_standalone/search", data, options)).data
|
|
6373
|
-
);
|
|
6374
|
-
});
|
|
6375
|
-
return function RuntimeApi_searchMicroAppStandalone(_x, _x2) {
|
|
6376
|
-
return _ref.apply(this, arguments);
|
|
6377
|
-
};
|
|
6378
|
-
}();
|
|
6379
|
-
|
|
6380
6350
|
/**
|
|
6381
6351
|
* Merge `app.defaultConfig` and `app.userConfig` to `app.config`.
|
|
6382
6352
|
*
|
|
@@ -6558,6 +6528,36 @@
|
|
|
6558
6528
|
}
|
|
6559
6529
|
}
|
|
6560
6530
|
|
|
6531
|
+
/**
|
|
6532
|
+
* @description 独立小产品Runtime接口
|
|
6533
|
+
* @endpoint GET /api/v1/micro_app_standalone/runtime/:appId
|
|
6534
|
+
*/
|
|
6535
|
+
var RuntimeApi_runtimeMicroAppStandalone = /*#__PURE__*/function () {
|
|
6536
|
+
var _ref = _asyncToGenerator__default["default"](function* (appId, options) {
|
|
6537
|
+
return (/**! @contract easyops.api.micro_app_standalone.runtime.RuntimeMicroAppStandalone@1.0.1 */
|
|
6538
|
+
(yield brickHttp.http.get("api/gateway/micro_app_standalone.runtime.RuntimeMicroAppStandalone/api/v1/micro_app_standalone/runtime/".concat(appId), options)).data
|
|
6539
|
+
);
|
|
6540
|
+
});
|
|
6541
|
+
return function RuntimeApi_runtimeMicroAppStandalone(_x, _x2) {
|
|
6542
|
+
return _ref.apply(this, arguments);
|
|
6543
|
+
};
|
|
6544
|
+
}();
|
|
6545
|
+
|
|
6546
|
+
/**
|
|
6547
|
+
* @description 查询独立部署小产品
|
|
6548
|
+
* @endpoint POST /api/v1/micro_app_standalone/search
|
|
6549
|
+
*/
|
|
6550
|
+
var RuntimeApi_searchMicroAppStandalone = /*#__PURE__*/function () {
|
|
6551
|
+
var _ref = _asyncToGenerator__default["default"](function* (data, options) {
|
|
6552
|
+
return (/**! @contract easyops.api.micro_app_standalone.runtime.SearchMicroAppStandalone@1.0.1 */
|
|
6553
|
+
(yield brickHttp.http.post("api/gateway/micro_app_standalone.runtime.SearchMicroAppStandalone/api/v1/micro_app_standalone/search", data, options)).data
|
|
6554
|
+
);
|
|
6555
|
+
});
|
|
6556
|
+
return function RuntimeApi_searchMicroAppStandalone(_x, _x2) {
|
|
6557
|
+
return _ref.apply(this, arguments);
|
|
6558
|
+
};
|
|
6559
|
+
}();
|
|
6560
|
+
|
|
6561
6561
|
var _excluded$4 = ["feature_flags"],
|
|
6562
6562
|
_excluded2$1 = ["featureFlags", "misc"];
|
|
6563
6563
|
function standaloneBootstrap() {
|
|
@@ -6565,14 +6565,23 @@
|
|
|
6565
6565
|
}
|
|
6566
6566
|
function _standaloneBootstrap() {
|
|
6567
6567
|
_standaloneBootstrap = _asyncToGenerator__default["default"](function* () {
|
|
6568
|
-
var
|
|
6568
|
+
var requests = [brickHttp.http.get(window.BOOTSTRAP_FILE), brickHttp.http.get("".concat(window.APP_ROOT, "conf.yaml"), {
|
|
6569
6569
|
responseType: "text"
|
|
6570
|
-
}),
|
|
6570
|
+
}), BootstrapStandaloneApi_runtimeStandalone().catch(function (error) {
|
|
6571
6571
|
// make it not crash when the backend service is not updated.
|
|
6572
6572
|
// eslint-disable-next-line no-console
|
|
6573
6573
|
console.warn("request runtime api from api-gateway failed: ", error, ", something might went wrong running standalone micro app");
|
|
6574
|
-
return
|
|
6575
|
-
})]
|
|
6574
|
+
return;
|
|
6575
|
+
})];
|
|
6576
|
+
if (!window.NO_AUTH_GUARD) {
|
|
6577
|
+
var matches;
|
|
6578
|
+
var appId = window.APP_ID || (window.APP_ROOT && (matches = window.APP_ROOT.match(/^(?:\/next)?\/sa-static\/([^/]+)\/versions\//)) ? matches[1] : null);
|
|
6579
|
+
if (appId) {
|
|
6580
|
+
// No need to wait.
|
|
6581
|
+
safeGetRuntimeMicroAppStandalone(appId);
|
|
6582
|
+
}
|
|
6583
|
+
}
|
|
6584
|
+
var [bootstrapResult, confString, runtimeData] = yield Promise.all(requests);
|
|
6576
6585
|
var conf;
|
|
6577
6586
|
try {
|
|
6578
6587
|
conf = confString ? yaml__default["default"].safeLoad(confString, {
|
|
@@ -6613,16 +6622,16 @@
|
|
|
6613
6622
|
}
|
|
6614
6623
|
}
|
|
6615
6624
|
if (runtimeData) {
|
|
6616
|
-
var
|
|
6617
|
-
if (!_.isEmpty(
|
|
6625
|
+
var runtimeSettings = runtimeData.settings;
|
|
6626
|
+
if (!_.isEmpty(runtimeSettings)) {
|
|
6618
6627
|
// Merge Feature Flags
|
|
6619
6628
|
if (!settings) {
|
|
6620
|
-
settings =
|
|
6629
|
+
settings = runtimeSettings;
|
|
6621
6630
|
} else {
|
|
6622
6631
|
// Merge Feature Flags & Misc
|
|
6623
|
-
var rest = _objectWithoutProperties__default["default"](
|
|
6624
|
-
settings.featureFlags = _objectSpread__default["default"](_objectSpread__default["default"]({}, settings.featureFlags),
|
|
6625
|
-
settings.misc = _objectSpread__default["default"](_objectSpread__default["default"]({}, settings.misc),
|
|
6632
|
+
var rest = _objectWithoutProperties__default["default"](runtimeSettings, _excluded2$1);
|
|
6633
|
+
settings.featureFlags = _objectSpread__default["default"](_objectSpread__default["default"]({}, settings.featureFlags), runtimeSettings.featureFlags);
|
|
6634
|
+
settings.misc = _objectSpread__default["default"](_objectSpread__default["default"]({}, settings.misc), runtimeSettings.misc);
|
|
6626
6635
|
settings = Object.assign(settings, rest);
|
|
6627
6636
|
}
|
|
6628
6637
|
}
|
|
@@ -6633,6 +6642,24 @@
|
|
|
6633
6642
|
});
|
|
6634
6643
|
return _standaloneBootstrap.apply(this, arguments);
|
|
6635
6644
|
}
|
|
6645
|
+
var appRuntimeDataMap = new Map();
|
|
6646
|
+
function safeGetRuntimeMicroAppStandalone(_x) {
|
|
6647
|
+
return _safeGetRuntimeMicroAppStandalone.apply(this, arguments);
|
|
6648
|
+
}
|
|
6649
|
+
function _safeGetRuntimeMicroAppStandalone() {
|
|
6650
|
+
_safeGetRuntimeMicroAppStandalone = _asyncToGenerator__default["default"](function* (appId) {
|
|
6651
|
+
if (appRuntimeDataMap.has(appId)) {
|
|
6652
|
+
return appRuntimeDataMap.get(appId);
|
|
6653
|
+
}
|
|
6654
|
+
var promise = RuntimeApi_runtimeMicroAppStandalone(appId).catch(function (error) {
|
|
6655
|
+
// make it not crash when the backend service is not updated.
|
|
6656
|
+
// eslint-disable-next-line no-console
|
|
6657
|
+
console.warn("request standalone runtime api from micro-app-standalone failed: ", error, ", something might went wrong running standalone micro app");
|
|
6658
|
+
});
|
|
6659
|
+
appRuntimeDataMap.set(appId, promise);
|
|
6660
|
+
});
|
|
6661
|
+
return _safeGetRuntimeMicroAppStandalone.apply(this, arguments);
|
|
6662
|
+
}
|
|
6636
6663
|
|
|
6637
6664
|
/**
|
|
6638
6665
|
* Take input from [0, n] and return it as [0, 1]
|
|
@@ -8234,7 +8261,8 @@
|
|
|
8234
8261
|
if (!window.NO_AUTH_GUARD) {
|
|
8235
8262
|
var appRuntimeData;
|
|
8236
8263
|
try {
|
|
8237
|
-
|
|
8264
|
+
// Note: the request maybe have fired already during bootstrap.
|
|
8265
|
+
appRuntimeData = yield safeGetRuntimeMicroAppStandalone(storyboard.app.id);
|
|
8238
8266
|
} catch (error) {
|
|
8239
8267
|
// make it not crash when the backend service is not updated.
|
|
8240
8268
|
// eslint-disable-next-line no-console
|