@next-core/brick-kit 2.99.2 → 2.100.0
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 +12 -0
- package/dist/index.bundle.js +17 -7
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +17 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/MockRegistry.d.ts +4 -1
- package/dist/types/core/MockRegistry.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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.100.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.99.2...@next-core/brick-kit@2.100.0) (2022-01-04)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **MockRegistry:** remove version in mock url ([e291d52](https://github.com/easyops-cn/next-core/commit/e291d52626e5565a9ebd8cf6370cb6cf7dd33903))
|
|
12
|
+
* **MockRegistry:** update RegExp ([423be36](https://github.com/easyops-cn/next-core/commit/423be36023068c1ebf07215d15117af4299ec039))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [2.99.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.99.1...@next-core/brick-kit@2.99.2) (2022-01-04)
|
|
7
19
|
|
|
8
20
|
|
package/dist/index.bundle.js
CHANGED
|
@@ -9203,15 +9203,25 @@
|
|
|
9203
9203
|
|
|
9204
9204
|
if (useMocks) mocks = _objectSpread__default["default"](_objectSpread__default["default"]({}, useMocks), {}, {
|
|
9205
9205
|
mockList: (_useMocks$mockList = useMocks.mockList) === null || _useMocks$mockList === void 0 ? void 0 : _useMocks$mockList.map(item => _objectSpread__default["default"](_objectSpread__default["default"]({}, item), {}, {
|
|
9206
|
-
uri: item.uri.replace(/(easyops\.api\.)(
|
|
9207
|
-
return "(".concat(p1, ")?").concat(p2, "(@\\d+\\.\\d+\\.\\d+)
|
|
9208
|
-
}).replace(/:\w+/g, "[
|
|
9206
|
+
uri: item.uri.replace(/(easyops\.api\.)(.+?)\/(.+)/, (_match, p1, p2, p3) => {
|
|
9207
|
+
return "(".concat(p1, ")?").concat(p2, "(@\\d+\\.\\d+\\.\\d+)?/").concat(p3, "$");
|
|
9208
|
+
}).replace(/:\w+/g, "([^/]+)")
|
|
9209
9209
|
}))
|
|
9210
9210
|
});
|
|
9211
9211
|
}
|
|
9212
|
-
var
|
|
9213
|
-
|
|
9214
|
-
|
|
9212
|
+
var getMockInfo = requestUrl => {
|
|
9213
|
+
var item = mocks.mockList.find(item => new RegExp(item.uri).test(requestUrl));
|
|
9214
|
+
|
|
9215
|
+
if (item) {
|
|
9216
|
+
return {
|
|
9217
|
+
url: requestUrl.replace(/(api\/gateway\/.+?)(@\d+\.\d+\.\d+)?\/(.+)/, (_match, p1, _p2, p3) => {
|
|
9218
|
+
return "".concat(p1, "/").concat(p3);
|
|
9219
|
+
}).replace(/(api\/gateway)/, "api/gateway/mock_server.proxy.".concat(mocks.mockId)),
|
|
9220
|
+
mockId: mocks.mockId
|
|
9221
|
+
};
|
|
9222
|
+
}
|
|
9223
|
+
|
|
9224
|
+
return;
|
|
9215
9225
|
};
|
|
9216
9226
|
|
|
9217
9227
|
class Router {
|
|
@@ -11713,7 +11723,7 @@
|
|
|
11713
11723
|
exports.event = event;
|
|
11714
11724
|
exports.getAuth = getAuth;
|
|
11715
11725
|
exports.getHistory = getHistory;
|
|
11716
|
-
exports.
|
|
11726
|
+
exports.getMockInfo = getMockInfo;
|
|
11717
11727
|
exports.getRuntime = getRuntime;
|
|
11718
11728
|
exports.handleHttpError = handleHttpError;
|
|
11719
11729
|
exports.httpErrorToString = httpErrorToString;
|