node-easywechat 3.6.3 → 3.7.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 +7 -0
- package/README.md +25 -0
- package/dist/Channel/AccessToken.d.ts +8 -0
- package/dist/Channel/AccessToken.js +15 -0
- package/dist/Channel/Account.d.ts +4 -0
- package/dist/Channel/Account.js +8 -0
- package/dist/Channel/Application.d.ts +60 -0
- package/dist/Channel/Application.js +125 -0
- package/dist/Channel/Contracts/AccountInterface.d.ts +23 -0
- package/dist/Channel/Contracts/AccountInterface.js +25 -0
- package/dist/Channel/Contracts/ApplicationInterface.d.ts +62 -0
- package/dist/Channel/Contracts/ApplicationInterface.js +55 -0
- package/dist/Channel/Message.d.ts +542 -0
- package/dist/Channel/Message.js +9 -0
- package/dist/Channel/Server.d.ts +91 -0
- package/dist/Channel/Server.js +16 -0
- package/dist/Core/Contracts/ServerInterface.d.ts +3 -3
- package/dist/Core/Contracts/ServerInterface.js +3 -3
- package/dist/Core/Mixins/{DecryptXmlMessageMixin.d.ts → DecryptMessageMixin.d.ts} +2 -2
- package/dist/Core/Mixins/{DecryptXmlMessageMixin.js → DecryptMessageMixin.js} +11 -4
- package/dist/Core/Mixins/HandlersMixin.d.ts +8 -8
- package/dist/Core/Mixins/HandlersMixin.js +8 -8
- package/dist/Core/Mixins/{ResponseXmlMessageMixin.d.ts → ResponseMessageMixin.d.ts} +4 -3
- package/dist/Core/Mixins/{ResponseXmlMessageMixin.js → ResponseMessageMixin.js} +16 -5
- package/dist/OfficialAccount/Server.d.ts +24 -0
- package/dist/OfficialAccount/Server.js +4 -1
- package/dist/Types/global.d.ts +31 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.js +19 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Encryptor from "../Encryptor";
|
|
2
2
|
import Message from "../Message";
|
|
3
|
-
declare class
|
|
3
|
+
declare class DecryptMessageMixin {
|
|
4
4
|
/**
|
|
5
5
|
* 解密消息
|
|
6
6
|
* @returns
|
|
@@ -8,4 +8,4 @@ declare class DecryptXmlMessageMixin {
|
|
|
8
8
|
decryptMessage(message: Message, encryptor: Encryptor, signature: string, timestamp: number, nonce: string): Promise<Message>;
|
|
9
9
|
protected validateSignature(token: string, ciphertext: string, signature: string, timestamp: number, nonce: string): void;
|
|
10
10
|
}
|
|
11
|
-
export =
|
|
11
|
+
export = DecryptMessageMixin;
|
|
@@ -9,16 +9,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
const Utils_1 = require("../Support/Utils");
|
|
12
|
-
class
|
|
12
|
+
class DecryptMessageMixin {
|
|
13
13
|
/**
|
|
14
14
|
* 解密消息
|
|
15
15
|
* @returns
|
|
16
16
|
*/
|
|
17
17
|
decryptMessage(message, encryptor, signature, timestamp, nonce) {
|
|
18
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
|
|
19
|
+
const ciphertext = message['Encrypt'];
|
|
20
20
|
this.validateSignature(encryptor.getToken(), ciphertext, signature, timestamp, nonce);
|
|
21
|
-
|
|
21
|
+
const plaintext = encryptor.decrypt(ciphertext, signature, nonce, timestamp);
|
|
22
|
+
let attributes;
|
|
23
|
+
if (plaintext.substring(0, 1) === '<') {
|
|
24
|
+
attributes = yield (0, Utils_1.parseXml)(plaintext);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
attributes = JSON.parse(plaintext);
|
|
28
|
+
}
|
|
22
29
|
message.merge(attributes);
|
|
23
30
|
return message;
|
|
24
31
|
});
|
|
@@ -35,4 +42,4 @@ class DecryptXmlMessageMixin {
|
|
|
35
42
|
}
|
|
36
43
|
}
|
|
37
44
|
;
|
|
38
|
-
module.exports =
|
|
45
|
+
module.exports = DecryptMessageMixin;
|
|
@@ -20,33 +20,33 @@ declare class HandlersMixin {
|
|
|
20
20
|
*/
|
|
21
21
|
protected getHandlerHash(handler: ServerHandlerClosure<Message>): string;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* 从后添加处理器
|
|
24
|
+
* @param handler
|
|
24
25
|
*/
|
|
25
26
|
with(handler: ServerHandlerClosure<Message>): this;
|
|
26
27
|
/**
|
|
27
|
-
*
|
|
28
|
+
* 从后添加处理器
|
|
28
29
|
* @param handler
|
|
29
|
-
* @returns
|
|
30
30
|
*/
|
|
31
31
|
withHandler(handler: ServerHandlerClosure<Message>): this;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* 从前添加处理器
|
|
34
|
+
* @param handler
|
|
34
35
|
*/
|
|
35
36
|
prepend(handler: ServerHandlerClosure<Message>): this;
|
|
36
37
|
/**
|
|
37
|
-
*
|
|
38
|
+
* 从前添加处理器
|
|
38
39
|
* @param handler
|
|
39
|
-
* @returns
|
|
40
40
|
*/
|
|
41
41
|
prependHandler(handler: ServerHandlerClosure<Message>): this;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* 删除处理器
|
|
44
|
+
* @param handler
|
|
44
45
|
*/
|
|
45
46
|
without(handler: ServerHandlerClosure<Message>): this;
|
|
46
47
|
/**
|
|
47
48
|
* 删除处理器
|
|
48
49
|
* @param handler
|
|
49
|
-
* @returns
|
|
50
50
|
*/
|
|
51
51
|
withoutHandler(handler: ServerHandlerClosure<Message>): this;
|
|
52
52
|
/**
|
|
@@ -40,37 +40,38 @@ class HandlersMixin {
|
|
|
40
40
|
return (0, Utils_1.createHash)(handler.toString(), 'md5');
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* 从后添加处理器
|
|
44
|
+
* @param handler
|
|
44
45
|
*/
|
|
45
46
|
with(handler) {
|
|
46
47
|
return this.withHandler(handler);
|
|
47
48
|
}
|
|
48
49
|
/**
|
|
49
|
-
*
|
|
50
|
+
* 从后添加处理器
|
|
50
51
|
* @param handler
|
|
51
|
-
* @returns
|
|
52
52
|
*/
|
|
53
53
|
withHandler(handler) {
|
|
54
54
|
this.handlers.push(this.createHandlerItem(handler));
|
|
55
55
|
return this;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* 从前添加处理器
|
|
59
|
+
* @param handler
|
|
59
60
|
*/
|
|
60
61
|
prepend(handler) {
|
|
61
62
|
return this.prependHandler(handler);
|
|
62
63
|
}
|
|
63
64
|
/**
|
|
64
|
-
*
|
|
65
|
+
* 从前添加处理器
|
|
65
66
|
* @param handler
|
|
66
|
-
* @returns
|
|
67
67
|
*/
|
|
68
68
|
prependHandler(handler) {
|
|
69
69
|
this.handlers.unshift(this.createHandlerItem(handler));
|
|
70
70
|
return this;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* 删除处理器
|
|
74
|
+
* @param handler
|
|
74
75
|
*/
|
|
75
76
|
without(handler) {
|
|
76
77
|
return this.withoutHandler(handler);
|
|
@@ -78,7 +79,6 @@ class HandlersMixin {
|
|
|
78
79
|
/**
|
|
79
80
|
* 删除处理器
|
|
80
81
|
* @param handler
|
|
81
|
-
* @returns
|
|
82
82
|
*/
|
|
83
83
|
withoutHandler(handler) {
|
|
84
84
|
let index = this.indexOf(handler);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import Encryptor from "../Encryptor";
|
|
2
2
|
import ResponseInterface from "../Http/Contracts/ResponseInterface";
|
|
3
3
|
import Message from "../Message";
|
|
4
|
-
declare class
|
|
4
|
+
declare class ResponseMessageMixin {
|
|
5
5
|
/**
|
|
6
6
|
* 转化为回复消息
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
transformToReply(response: any, message: Message, encryptor?: Encryptor): Promise<ResponseInterface>;
|
|
9
|
+
transformToReply(response: any, message: Message, encryptor?: Encryptor, isXml?: boolean): Promise<ResponseInterface>;
|
|
10
10
|
protected normalizeResponse(response: any): Promise<Record<string, any>>;
|
|
11
11
|
protected createXmlResponse(attributes: Record<string, any>, encryptor?: Encryptor): ResponseInterface;
|
|
12
|
+
protected createJsonResponse(attributes: Record<string, any>, encryptor?: Encryptor): ResponseInterface;
|
|
12
13
|
}
|
|
13
|
-
export =
|
|
14
|
+
export = ResponseMessageMixin;
|
|
@@ -14,13 +14,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
const merge_1 = __importDefault(require("merge"));
|
|
15
15
|
const Response_1 = __importDefault(require("../Http/Response"));
|
|
16
16
|
const Utils_1 = require("../Support/Utils");
|
|
17
|
-
class
|
|
17
|
+
class ResponseMessageMixin {
|
|
18
18
|
/**
|
|
19
19
|
* 转化为回复消息
|
|
20
20
|
* @returns
|
|
21
21
|
*/
|
|
22
22
|
transformToReply(response_1, message_1) {
|
|
23
|
-
return __awaiter(this, arguments, void 0, function* (response, message, encryptor = null) {
|
|
23
|
+
return __awaiter(this, arguments, void 0, function* (response, message, encryptor = null, isXml = true) {
|
|
24
24
|
if (!response || response === true) {
|
|
25
25
|
return new Response_1.default(200, {}, 'success');
|
|
26
26
|
}
|
|
@@ -29,7 +29,12 @@ class ResponseXmlMessageMixin {
|
|
|
29
29
|
FromUserName: message['ToUserName'],
|
|
30
30
|
CreateTime: (0, Utils_1.getTimestamp)(),
|
|
31
31
|
}, yield this.normalizeResponse(response));
|
|
32
|
-
|
|
32
|
+
if (isXml) {
|
|
33
|
+
return this.createXmlResponse(attributes, encryptor);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return this.createJsonResponse(attributes, encryptor);
|
|
37
|
+
}
|
|
33
38
|
});
|
|
34
39
|
}
|
|
35
40
|
normalizeResponse(response) {
|
|
@@ -55,9 +60,15 @@ class ResponseXmlMessageMixin {
|
|
|
55
60
|
createXmlResponse(attributes, encryptor = null) {
|
|
56
61
|
let xml = (0, Utils_1.buildXml)(attributes);
|
|
57
62
|
return new Response_1.default(200, {
|
|
58
|
-
'Content-Type': '
|
|
63
|
+
'Content-Type': 'text/xml'
|
|
59
64
|
}, encryptor ? encryptor.encrypt(xml) : xml);
|
|
60
65
|
}
|
|
66
|
+
createJsonResponse(attributes, encryptor = null) {
|
|
67
|
+
let json = JSON.stringify(attributes);
|
|
68
|
+
return new Response_1.default(200, {
|
|
69
|
+
'Content-Type': 'application/json'
|
|
70
|
+
}, encryptor ? encryptor.encrypt(json) : json);
|
|
71
|
+
}
|
|
61
72
|
}
|
|
62
73
|
;
|
|
63
|
-
module.exports =
|
|
74
|
+
module.exports = ResponseMessageMixin;
|
|
@@ -36,11 +36,35 @@ declare class Server extends ServerInterface {
|
|
|
36
36
|
protected decryptRequestMessage(query: Record<string, any>): ServerHandlerClosure<Message>;
|
|
37
37
|
}
|
|
38
38
|
interface Server {
|
|
39
|
+
/**
|
|
40
|
+
* 从后添加处理器
|
|
41
|
+
* @param handler
|
|
42
|
+
*/
|
|
39
43
|
with(next: ServerHandlerClosure<Message>): this;
|
|
44
|
+
/**
|
|
45
|
+
* 从后添加处理器
|
|
46
|
+
* @param handler
|
|
47
|
+
*/
|
|
40
48
|
withHandler(next: ServerHandlerClosure<Message>): this;
|
|
49
|
+
/**
|
|
50
|
+
* 从前添加处理器
|
|
51
|
+
* @param handler
|
|
52
|
+
*/
|
|
41
53
|
prepend(next: ServerHandlerClosure<Message>): this;
|
|
54
|
+
/**
|
|
55
|
+
* 从前添加处理器
|
|
56
|
+
* @param handler
|
|
57
|
+
*/
|
|
42
58
|
prependHandler(next: ServerHandlerClosure<Message>): this;
|
|
59
|
+
/**
|
|
60
|
+
* 删除处理器
|
|
61
|
+
* @param handler
|
|
62
|
+
*/
|
|
43
63
|
without(next: ServerHandlerClosure<Message>): this;
|
|
64
|
+
/**
|
|
65
|
+
* 删除处理器
|
|
66
|
+
* @param handler
|
|
67
|
+
*/
|
|
44
68
|
withoutHandler(next: ServerHandlerClosure<Message>): this;
|
|
45
69
|
}
|
|
46
70
|
export = Server;
|
|
@@ -37,7 +37,10 @@ class Server extends ServerInterface_1.default {
|
|
|
37
37
|
}
|
|
38
38
|
let response = yield this.handle(new Response_1.default(200, {}, 'success'), message);
|
|
39
39
|
if (!(response instanceof Response_1.default)) {
|
|
40
|
-
|
|
40
|
+
const contentType = this.request.getHeader('content-type');
|
|
41
|
+
const contentBody = this.request.getBody().toString();
|
|
42
|
+
const isXml = (contentType && contentType.indexOf('xml') > -1) || contentBody.substring(0, 1) === '<';
|
|
43
|
+
response = yield this.transformToReply(response, message, this.encryptor, isXml);
|
|
41
44
|
}
|
|
42
45
|
return response;
|
|
43
46
|
});
|
package/dist/Types/global.d.ts
CHANGED
|
@@ -481,3 +481,34 @@ export interface PayAppConfig {
|
|
|
481
481
|
*/
|
|
482
482
|
sign: string;
|
|
483
483
|
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* 视频号配置
|
|
487
|
+
*/
|
|
488
|
+
export interface ChannelConfig extends BaseConfig {
|
|
489
|
+
/**
|
|
490
|
+
* 视频号 app_id
|
|
491
|
+
*/
|
|
492
|
+
app_id?: string;
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* 视频号 secret
|
|
496
|
+
*/
|
|
497
|
+
secret?: string;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* 服务端接口验证 token
|
|
501
|
+
*/
|
|
502
|
+
token?: string;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* 服务端消息加解密密钥 aes_key
|
|
506
|
+
*/
|
|
507
|
+
aes_key?: string;
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* 是否使用稳定版接口调用凭据,默认:false
|
|
511
|
+
* @see https://developers.weixin.qq.com/doc/channels/API/basics/getStableAccessToken.html
|
|
512
|
+
*/
|
|
513
|
+
use_stable_access_token?: boolean;
|
|
514
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { OfficialAccountConfig, MiniAppConfig, LogHandler, ServerEventType, ServerHandlerClosure, PayConfig, OpenPlatformConfig, WorkConfig, OpenWorkConfig, HttpClientFailureJudgeClosure, PaymentFailHandler, PaymentAlertHandler, PaymentPaidHandler, PaymentRefundedHandler, PaymentScannedHandler } from './Types/global';
|
|
1
|
+
import { OfficialAccountConfig, MiniAppConfig, LogHandler, ServerEventType, ServerHandlerClosure, PayConfig, OpenPlatformConfig, WorkConfig, OpenWorkConfig, ChannelConfig, HttpClientFailureJudgeClosure, PaymentFailHandler, PaymentAlertHandler, PaymentPaidHandler, PaymentRefundedHandler, PaymentScannedHandler } from './Types/global';
|
|
2
2
|
import OfficialAccount from './OfficialAccount/Application';
|
|
3
3
|
import MiniApp from './MiniApp/Application';
|
|
4
4
|
import Pay from './Pay/Application';
|
|
5
5
|
import OpenPlatform from './OpenPlatform/Application';
|
|
6
6
|
import Work from './Work/Application';
|
|
7
7
|
import OpenWork from './OpenWork/Application';
|
|
8
|
+
import Channel from './Channel/Application';
|
|
8
9
|
import CacheInterface from './Core/Contracts/CacheInterface';
|
|
9
10
|
import ServerRequest from './Core/Http/ServerRequest';
|
|
10
11
|
import FormData from 'form-data';
|
|
@@ -12,9 +13,10 @@ import OfficialAccountMessage from './OfficialAccount/Message';
|
|
|
12
13
|
import WorkMessage from './Work/Message';
|
|
13
14
|
import OpenPlatformMessage from './OpenPlatform/Message';
|
|
14
15
|
import OpenWorkMessage from './OpenWork/Message';
|
|
16
|
+
import ChannelMessage from './Channel/Message';
|
|
15
17
|
import { PublicKey } from './Core/Support/PublicKey';
|
|
16
18
|
import { PrivateKey } from './Core/Support/PrivateKey';
|
|
17
|
-
export { OfficialAccount, OfficialAccountConfig, MiniApp, MiniAppConfig, Pay, PayConfig, OpenPlatform, OpenPlatformConfig, Work, WorkConfig, OpenWork, OpenWorkConfig, CacheInterface, ServerRequest, LogHandler, ServerEventType, ServerHandlerClosure, PublicKey, PrivateKey,
|
|
19
|
+
export { OfficialAccount, OfficialAccountConfig, MiniApp, MiniAppConfig, Pay, PayConfig, OpenPlatform, OpenPlatformConfig, Work, WorkConfig, OpenWork, OpenWorkConfig, Channel, ChannelConfig, CacheInterface, ServerRequest, LogHandler, ServerEventType, ServerHandlerClosure, PublicKey, PrivateKey,
|
|
18
20
|
/**
|
|
19
21
|
* 表单对象
|
|
20
22
|
* @see https://github.com/axios/axios#formdata
|
|
@@ -51,6 +53,11 @@ export declare function defineWorkConfig(config: WorkConfig): WorkConfig;
|
|
|
51
53
|
* @param config
|
|
52
54
|
*/
|
|
53
55
|
export declare function defineOpenWorkConfig(config: OpenWorkConfig): OpenWorkConfig;
|
|
56
|
+
/**
|
|
57
|
+
* 定义视频号配置
|
|
58
|
+
* @param config
|
|
59
|
+
*/
|
|
60
|
+
export declare function defineChannelConfig(config: ChannelConfig): ChannelConfig;
|
|
54
61
|
/**
|
|
55
62
|
* 定义日志处理函数
|
|
56
63
|
* @param func
|
|
@@ -81,6 +88,11 @@ export declare function defineOpenPlatformServerHandler(func: ServerHandlerClosu
|
|
|
81
88
|
* @param func
|
|
82
89
|
*/
|
|
83
90
|
export declare function defineOpenWorkServerHandler(func: ServerHandlerClosure<OpenWorkMessage>): ServerHandlerClosure<OpenWorkMessage>;
|
|
91
|
+
/**
|
|
92
|
+
* 定义视频号服务端消息处理函数
|
|
93
|
+
* @param func
|
|
94
|
+
*/
|
|
95
|
+
export declare function defineChannelServerHandler(func: ServerHandlerClosure<ChannelMessage>): ServerHandlerClosure<ChannelMessage>;
|
|
84
96
|
/**
|
|
85
97
|
* 定义HttpClient错误判定回调
|
|
86
98
|
* @param func
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.definePaymentScannedHandler = exports.definePaymentRefundedHandler = exports.definePaymentPaidHandler = exports.definePaymentAlertHandler = exports.definePaymentFailHandler = exports.defineHttpClientFailureJudgeClosure = exports.defineOpenWorkServerHandler = exports.defineOpenPlatformServerHandler = exports.defineWorkServerHandler = exports.defineMiniAppServerHandler = exports.defineOfficeAccountServerHandler = exports.defineLogHandler = exports.defineOpenWorkConfig = exports.defineWorkConfig = exports.defineOpenPlatformConfig = exports.definePayConfig = exports.defineMiniAppConfig = exports.defineOfficialAccountConfig = exports.FormData = exports.PrivateKey = exports.PublicKey = exports.ServerRequest = exports.CacheInterface = exports.OpenWork = exports.Work = exports.OpenPlatform = exports.Pay = exports.MiniApp = exports.OfficialAccount = void 0;
|
|
6
|
+
exports.definePaymentScannedHandler = exports.definePaymentRefundedHandler = exports.definePaymentPaidHandler = exports.definePaymentAlertHandler = exports.definePaymentFailHandler = exports.defineHttpClientFailureJudgeClosure = exports.defineChannelServerHandler = exports.defineOpenWorkServerHandler = exports.defineOpenPlatformServerHandler = exports.defineWorkServerHandler = exports.defineMiniAppServerHandler = exports.defineOfficeAccountServerHandler = exports.defineLogHandler = exports.defineChannelConfig = exports.defineOpenWorkConfig = exports.defineWorkConfig = exports.defineOpenPlatformConfig = exports.definePayConfig = exports.defineMiniAppConfig = exports.defineOfficialAccountConfig = exports.FormData = exports.PrivateKey = exports.PublicKey = exports.ServerRequest = exports.CacheInterface = exports.Channel = exports.OpenWork = exports.Work = exports.OpenPlatform = exports.Pay = exports.MiniApp = exports.OfficialAccount = void 0;
|
|
7
7
|
const Application_1 = __importDefault(require("./OfficialAccount/Application"));
|
|
8
8
|
exports.OfficialAccount = Application_1.default;
|
|
9
9
|
const Application_2 = __importDefault(require("./MiniApp/Application"));
|
|
@@ -16,6 +16,8 @@ const Application_5 = __importDefault(require("./Work/Application"));
|
|
|
16
16
|
exports.Work = Application_5.default;
|
|
17
17
|
const Application_6 = __importDefault(require("./OpenWork/Application"));
|
|
18
18
|
exports.OpenWork = Application_6.default;
|
|
19
|
+
const Application_7 = __importDefault(require("./Channel/Application"));
|
|
20
|
+
exports.Channel = Application_7.default;
|
|
19
21
|
const CacheInterface_1 = __importDefault(require("./Core/Contracts/CacheInterface"));
|
|
20
22
|
exports.CacheInterface = CacheInterface_1.default;
|
|
21
23
|
const ServerRequest_1 = __importDefault(require("./Core/Http/ServerRequest"));
|
|
@@ -74,6 +76,14 @@ function defineOpenWorkConfig(config) {
|
|
|
74
76
|
return config;
|
|
75
77
|
}
|
|
76
78
|
exports.defineOpenWorkConfig = defineOpenWorkConfig;
|
|
79
|
+
/**
|
|
80
|
+
* 定义视频号配置
|
|
81
|
+
* @param config
|
|
82
|
+
*/
|
|
83
|
+
function defineChannelConfig(config) {
|
|
84
|
+
return config;
|
|
85
|
+
}
|
|
86
|
+
exports.defineChannelConfig = defineChannelConfig;
|
|
77
87
|
/**
|
|
78
88
|
* 定义日志处理函数
|
|
79
89
|
* @param func
|
|
@@ -122,6 +132,14 @@ function defineOpenWorkServerHandler(func) {
|
|
|
122
132
|
return func;
|
|
123
133
|
}
|
|
124
134
|
exports.defineOpenWorkServerHandler = defineOpenWorkServerHandler;
|
|
135
|
+
/**
|
|
136
|
+
* 定义视频号服务端消息处理函数
|
|
137
|
+
* @param func
|
|
138
|
+
*/
|
|
139
|
+
function defineChannelServerHandler(func) {
|
|
140
|
+
return func;
|
|
141
|
+
}
|
|
142
|
+
exports.defineChannelServerHandler = defineChannelServerHandler;
|
|
125
143
|
/**
|
|
126
144
|
* 定义HttpClient错误判定回调
|
|
127
145
|
* @param func
|