@midwayjs/core 3.13.0 → 3.13.6
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.
|
@@ -21,6 +21,7 @@ export declare const FrameworkErrorEnum: {
|
|
|
21
21
|
readonly RETRY_OVER_MAX_TIME: "MIDWAY_10017";
|
|
22
22
|
readonly INVOKE_METHOD_FORBIDDEN: "MIDWAY_10018";
|
|
23
23
|
readonly CODE_INVOKE_TIMEOUT: "MIDWAY_10019";
|
|
24
|
+
readonly MAIN_FRAMEWORK_MISSING: "MIDWAY_10020";
|
|
24
25
|
};
|
|
25
26
|
export declare class MidwayCommonError extends MidwayError {
|
|
26
27
|
constructor(message: string);
|
|
@@ -82,4 +83,7 @@ export declare class MidwayInvokeForbiddenError extends MidwayError {
|
|
|
82
83
|
export declare class MidwayCodeInvokeTimeoutError extends MidwayError {
|
|
83
84
|
constructor(methodName: string, timeout: number);
|
|
84
85
|
}
|
|
86
|
+
export declare class MidwayMainFrameworkMissingError extends MidwayError {
|
|
87
|
+
constructor();
|
|
88
|
+
}
|
|
85
89
|
//# sourceMappingURL=framework.d.ts.map
|
package/dist/error/framework.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MidwayCodeInvokeTimeoutError = exports.MidwayInvokeForbiddenError = exports.MidwayRetryExceededMaxTimesError = exports.MidwayDuplicateControllerOptionsError = exports.MidwayDuplicateClassNameError = exports.MidwayInconsistentVersionError = exports.MidwayUtilHttpClientTimeoutError = exports.MidwayMissingImportComponentError = exports.MidwaySingletonInjectRequestError = exports.MidwayUseWrongMethodError = exports.MidwayDuplicateRouteError = exports.MidwayResolverMissingError = exports.MidwayInvalidConfigError = exports.MidwayConfigMissingError = exports.MidwayFeatureNotImplementedError = exports.MidwayFeatureNoLongerSupportedError = exports.MidwayDefinitionNotFoundError = exports.MidwayParameterError = exports.MidwayCommonError = exports.FrameworkErrorEnum = void 0;
|
|
3
|
+
exports.MidwayMainFrameworkMissingError = exports.MidwayCodeInvokeTimeoutError = exports.MidwayInvokeForbiddenError = exports.MidwayRetryExceededMaxTimesError = exports.MidwayDuplicateControllerOptionsError = exports.MidwayDuplicateClassNameError = exports.MidwayInconsistentVersionError = exports.MidwayUtilHttpClientTimeoutError = exports.MidwayMissingImportComponentError = exports.MidwaySingletonInjectRequestError = exports.MidwayUseWrongMethodError = exports.MidwayDuplicateRouteError = exports.MidwayResolverMissingError = exports.MidwayInvalidConfigError = exports.MidwayConfigMissingError = exports.MidwayFeatureNotImplementedError = exports.MidwayFeatureNoLongerSupportedError = exports.MidwayDefinitionNotFoundError = exports.MidwayParameterError = exports.MidwayCommonError = exports.FrameworkErrorEnum = void 0;
|
|
4
4
|
const base_1 = require("./base");
|
|
5
5
|
exports.FrameworkErrorEnum = (0, base_1.registerErrorCode)('midway', {
|
|
6
6
|
UNKNOWN: 10000,
|
|
@@ -23,6 +23,7 @@ exports.FrameworkErrorEnum = (0, base_1.registerErrorCode)('midway', {
|
|
|
23
23
|
RETRY_OVER_MAX_TIME: 10017,
|
|
24
24
|
INVOKE_METHOD_FORBIDDEN: 10018,
|
|
25
25
|
CODE_INVOKE_TIMEOUT: 10019,
|
|
26
|
+
MAIN_FRAMEWORK_MISSING: 10020,
|
|
26
27
|
});
|
|
27
28
|
class MidwayCommonError extends base_1.MidwayError {
|
|
28
29
|
constructor(message) {
|
|
@@ -159,4 +160,10 @@ class MidwayCodeInvokeTimeoutError extends base_1.MidwayError {
|
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
exports.MidwayCodeInvokeTimeoutError = MidwayCodeInvokeTimeoutError;
|
|
163
|
+
class MidwayMainFrameworkMissingError extends base_1.MidwayError {
|
|
164
|
+
constructor() {
|
|
165
|
+
super('Main framework missing, please check your configuration.', exports.FrameworkErrorEnum.MAIN_FRAMEWORK_MISSING);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
exports.MidwayMainFrameworkMissingError = MidwayMainFrameworkMissingError;
|
|
162
169
|
//# sourceMappingURL=framework.js.map
|
|
@@ -3,26 +3,25 @@
|
|
|
3
3
|
/// <reference types="node" />
|
|
4
4
|
import http = require('http');
|
|
5
5
|
import https = require('https');
|
|
6
|
-
type
|
|
7
|
-
interface
|
|
6
|
+
export type HttpClientMimeType = 'text' | 'json' | undefined;
|
|
7
|
+
export interface HttpClientOptions<Data = any> extends https.RequestOptions {
|
|
8
8
|
headers?: any;
|
|
9
|
-
contentType?:
|
|
10
|
-
dataType?:
|
|
11
|
-
data?:
|
|
9
|
+
contentType?: HttpClientMimeType;
|
|
10
|
+
dataType?: HttpClientMimeType;
|
|
11
|
+
data?: Data;
|
|
12
12
|
timeout?: number;
|
|
13
13
|
}
|
|
14
|
-
export interface
|
|
14
|
+
export interface HttpClientResponse<ResType = any> extends http.IncomingMessage {
|
|
15
15
|
status: number;
|
|
16
16
|
data: Buffer | string | ResType;
|
|
17
17
|
}
|
|
18
|
-
export declare function makeHttpRequest<ResType>(url: string, options?:
|
|
18
|
+
export declare function makeHttpRequest<ResType>(url: string, options?: HttpClientOptions): Promise<HttpClientResponse<ResType>>;
|
|
19
19
|
/**
|
|
20
20
|
* A simple http client
|
|
21
21
|
*/
|
|
22
22
|
export declare class HttpClient {
|
|
23
|
-
readonly defaultOptions: Pick<
|
|
24
|
-
constructor(defaultOptions?: Pick<
|
|
25
|
-
request(url: string, options?:
|
|
23
|
+
readonly defaultOptions: Pick<HttpClientOptions, 'headers' | 'timeout' | 'method'>;
|
|
24
|
+
constructor(defaultOptions?: Pick<HttpClientOptions, 'headers' | 'timeout' | 'method'>);
|
|
25
|
+
request(url: string, options?: HttpClientOptions): Promise<HttpClientResponse>;
|
|
26
26
|
}
|
|
27
|
-
export {};
|
|
28
27
|
//# sourceMappingURL=httpclient.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/core",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.6",
|
|
4
4
|
"description": "midway core",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@midwayjs/logger": "^3.0.0",
|
|
26
26
|
"koa": "2.14.2",
|
|
27
|
-
"mm": "3.
|
|
27
|
+
"mm": "3.4.0",
|
|
28
28
|
"raw-body": "2.5.2",
|
|
29
29
|
"sinon": "15.2.0"
|
|
30
30
|
},
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=12"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "684bb9ff9e66bf0d4e2e13559fac562dd9205bc4"
|
|
46
46
|
}
|