node-easywechat 2.8.0 → 2.9.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.
Files changed (142) hide show
  1. package/README.md +51 -4
  2. package/dist/BaseService/Jssdk/JssdkClient.js +5 -5
  3. package/dist/BaseService/Media/MediaClient.js +1 -1
  4. package/dist/Core/AES.d.ts +1 -1
  5. package/dist/Core/AES.js +4 -4
  6. package/dist/Core/BaseAccessToken.js +2 -2
  7. package/dist/Core/BaseApplication.js +4 -4
  8. package/dist/Core/BaseClient.js +2 -2
  9. package/dist/Core/Cache/FileCache.js +3 -3
  10. package/dist/Core/Encryptor.js +3 -3
  11. package/dist/Core/Http/Request.js +13 -13
  12. package/dist/Core/Http/StreamResponse.js +1 -1
  13. package/dist/Core/Messages/Media.js +2 -2
  14. package/dist/Core/Messages/Message.js +7 -7
  15. package/dist/Core/Mixins/HttpMixin.js +4 -4
  16. package/dist/Core/ServerGuard.d.ts +2 -2
  17. package/dist/Core/ServerGuard.js +5 -5
  18. package/dist/Core/Types.d.ts +34 -4
  19. package/dist/Core/Utils.js +18 -18
  20. package/dist/MicroMerchant/Application.js +1 -1
  21. package/dist/MicroMerchant/Base/MicroMerchantBase.js +6 -6
  22. package/dist/MicroMerchant/Certficates/CertficatesClient.js +1 -1
  23. package/dist/MicroMerchant/Core/BaseClient.js +8 -8
  24. package/dist/MicroMerchant/Media/MediaClient.js +1 -1
  25. package/dist/MicroMerchant/MerchantConfig/MerchantConfigClient.js +1 -1
  26. package/dist/MicroMerchant/Meterial/MeterialClient.js +4 -4
  27. package/dist/MicroMerchant/Withdraw/WithdrawClient.js +2 -2
  28. package/dist/MiniProgram/ActivityMessage/ActivityMessageClient.js +3 -3
  29. package/dist/MiniProgram/AppCode/AppCodeClient.js +2 -2
  30. package/dist/MiniProgram/Application.d.ts +16 -0
  31. package/dist/MiniProgram/Application.js +40 -0
  32. package/dist/MiniProgram/Base/MiniProgramBase.js +1 -1
  33. package/dist/MiniProgram/NearbyPoi/NearbyPoiClient.js +3 -3
  34. package/dist/MiniProgram/OpenData/OpenDataClient.js +2 -2
  35. package/dist/MiniProgram/RealtimeLog/RealtimeLogClient.js +1 -1
  36. package/dist/MiniProgram/Shop/AccoutClient.d.ts +25 -0
  37. package/dist/MiniProgram/Shop/AccoutClient.js +42 -0
  38. package/dist/MiniProgram/Shop/AftersaleClient.d.ts +22 -0
  39. package/dist/MiniProgram/Shop/AftersaleClient.js +35 -0
  40. package/dist/MiniProgram/Shop/BasicClient.d.ts +39 -0
  41. package/dist/MiniProgram/Shop/BasicClient.js +69 -0
  42. package/dist/MiniProgram/Shop/DeliveryClient.d.ts +20 -0
  43. package/dist/MiniProgram/Shop/DeliveryClient.js +32 -0
  44. package/dist/MiniProgram/Shop/OrderClient.d.ts +32 -0
  45. package/dist/MiniProgram/Shop/OrderClient.js +51 -0
  46. package/dist/MiniProgram/Shop/RegisterClient.d.ts +25 -0
  47. package/dist/MiniProgram/Shop/RegisterClient.js +43 -0
  48. package/dist/MiniProgram/Shop/SpuClient.d.ts +67 -0
  49. package/dist/MiniProgram/Shop/SpuClient.js +92 -0
  50. package/dist/MiniProgram/ShortLink/ShortLinkClient.d.ts +11 -0
  51. package/dist/MiniProgram/ShortLink/ShortLinkClient.js +23 -0
  52. package/dist/MiniProgram/SubscribeMessage/SubscribeMessageClient.js +5 -5
  53. package/dist/MiniProgram/UniformMessage/UniformMessageClient.js +3 -3
  54. package/dist/MiniProgram/UrlLink/UrlLinkClient.d.ts +6 -1
  55. package/dist/MiniProgram/UrlLink/UrlLinkClient.js +7 -2
  56. package/dist/OfficialAccount/Base/OfficialAccountBase.js +2 -2
  57. package/dist/OfficialAccount/Broadcasting/BroadcastingClient.js +2 -2
  58. package/dist/OfficialAccount/Broadcasting/MessageBuilder.js +1 -1
  59. package/dist/OfficialAccount/Card/Client.js +1 -1
  60. package/dist/OfficialAccount/Card/JssdkClient.js +2 -2
  61. package/dist/OfficialAccount/Card/MemberCardClient.js +1 -1
  62. package/dist/OfficialAccount/CustomerService/CustomerServiceClient.js +2 -2
  63. package/dist/OfficialAccount/CustomerService/Messenger.js +1 -1
  64. package/dist/OfficialAccount/DataCube/DataCubeClient.js +1 -1
  65. package/dist/OfficialAccount/Material/MaterialClient.js +2 -2
  66. package/dist/OfficialAccount/OCR/OCRClient.js +1 -1
  67. package/dist/OfficialAccount/Semantic/SemanticClient.js +1 -1
  68. package/dist/OfficialAccount/SubscribeMessage/SubscribeMessageClient.js +4 -4
  69. package/dist/OfficialAccount/TemplateMessage/TemplateMessageClient.js +4 -4
  70. package/dist/OpenPlatform/Application.js +8 -8
  71. package/dist/OpenPlatform/Authorizer/Auth/AccessToken.js +1 -1
  72. package/dist/OpenPlatform/Authorizer/OfficialAccount/Account/Client.js +1 -1
  73. package/dist/OpenWork/Application.d.ts +37 -0
  74. package/dist/OpenWork/Application.js +128 -0
  75. package/dist/OpenWork/Auth/ProviderAccessToken.d.ts +8 -0
  76. package/dist/OpenWork/Auth/ProviderAccessToken.js +33 -0
  77. package/dist/OpenWork/Auth/SuiteAccessToken.d.ts +8 -0
  78. package/dist/OpenWork/Auth/SuiteAccessToken.js +34 -0
  79. package/dist/OpenWork/Auth/SuiteTicket.d.ts +8 -0
  80. package/dist/OpenWork/Auth/SuiteTicket.js +40 -0
  81. package/dist/OpenWork/Corp/CorpClient.d.ts +72 -0
  82. package/dist/OpenWork/Corp/CorpClient.js +150 -0
  83. package/dist/OpenWork/MiniProgram/MiniProgramClient.d.ts +5 -0
  84. package/dist/OpenWork/MiniProgram/MiniProgramClient.js +18 -0
  85. package/dist/OpenWork/Provider/ProviderClient.d.ts +81 -0
  86. package/dist/OpenWork/Provider/ProviderClient.js +172 -0
  87. package/dist/OpenWork/Server/OpenWorkGuard.d.ts +13 -0
  88. package/dist/OpenWork/Server/OpenWorkGuard.js +51 -0
  89. package/dist/OpenWork/Work/Application.d.ts +5 -0
  90. package/dist/OpenWork/Work/Application.js +22 -0
  91. package/dist/OpenWork/Work/Auth/AccessToken.d.ts +12 -0
  92. package/dist/OpenWork/Work/Auth/AccessToken.js +44 -0
  93. package/dist/Payment/Application.js +4 -4
  94. package/dist/Payment/Bill/BillClient.js +2 -2
  95. package/dist/Payment/Core/BaseClient.js +8 -8
  96. package/dist/Payment/Jssdk/JssdkClient.js +14 -14
  97. package/dist/Payment/Merchant/MerchantClient.js +1 -1
  98. package/dist/Payment/Notify/Handler.js +5 -5
  99. package/dist/Payment/Notify/Refunded.js +1 -1
  100. package/dist/Payment/Notify/Scanned.js +2 -2
  101. package/dist/Payment/Order/OrderClient.js +1 -1
  102. package/dist/Payment/Redpack/RedpackClient.js +5 -5
  103. package/dist/Payment/Refund/RefundClient.js +3 -3
  104. package/dist/Payment/Sandbox/SandboxClient.js +1 -1
  105. package/dist/Payment/Transfer/TransferClient.js +1 -1
  106. package/dist/Work/Agent/AgentClient.js +1 -1
  107. package/dist/Work/Agent/WorkbenchClient.d.ts +24 -0
  108. package/dist/Work/Agent/WorkbenchClient.js +39 -0
  109. package/dist/Work/Application.d.ts +8 -0
  110. package/dist/Work/Application.js +20 -0
  111. package/dist/Work/Calendar/CalendarClient.js +1 -1
  112. package/dist/Work/Chat/ChatClient.js +1 -1
  113. package/dist/Work/CorpGroup/CorpGroupClient.d.ts +34 -0
  114. package/dist/Work/CorpGroup/CorpGroupClient.js +42 -0
  115. package/dist/Work/Department/DepartmentClient.js +1 -1
  116. package/dist/Work/ExternalContact/Client.d.ts +56 -0
  117. package/dist/Work/ExternalContact/Client.js +88 -0
  118. package/dist/Work/ExternalContact/ContactWayClient.d.ts +37 -0
  119. package/dist/Work/ExternalContact/ContactWayClient.js +51 -2
  120. package/dist/Work/ExternalContact/MessageClient.js +4 -4
  121. package/dist/Work/ExternalContact/MessageTemplateClient.js +3 -3
  122. package/dist/Work/ExternalContact/MomentClient.d.ts +56 -3
  123. package/dist/Work/ExternalContact/MomentClient.js +62 -3
  124. package/dist/Work/ExternalContact/StatisticsClient.d.ts +24 -0
  125. package/dist/Work/ExternalContact/StatisticsClient.js +35 -0
  126. package/dist/Work/Jssdk/JssdkClient.js +3 -3
  127. package/dist/Work/Kf/KfAccountClient.d.ts +41 -0
  128. package/dist/Work/Kf/KfAccountClient.js +71 -0
  129. package/dist/Work/Kf/KfMessageClient.d.ts +44 -0
  130. package/dist/Work/Kf/KfMessageClient.js +73 -0
  131. package/dist/Work/Kf/KfServicerClient.d.ts +26 -0
  132. package/dist/Work/Kf/KfServicerClient.js +47 -0
  133. package/dist/Work/Media/MediaClient.js +1 -1
  134. package/dist/Work/Message/Messenger.js +2 -2
  135. package/dist/Work/Schedule/ScheduleClient.js +1 -1
  136. package/dist/Work/Server/Guard.d.ts +1 -1
  137. package/dist/Work/User/UserClient.js +3 -3
  138. package/dist/index.d.ts +8 -2
  139. package/dist/index.js +9 -7
  140. package/node-easywechat.file_cache.easywechat.kernel.access_token.8a9684b45da7de42a06a70ba01a7005a.cache +1 -1
  141. package/node-easywechat.file_cache.easywechat.kernel.access_token.c3d06edaf326aad75d32f31348df787a.cache +1 -1
  142. package/package.json +11 -11
@@ -0,0 +1,44 @@
1
+ import BaseClient from '../../Core/BaseClient';
2
+ export default class KfMessageClient extends BaseClient {
3
+ /**
4
+ * 获取会话状态
5
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94669
6
+ * @param openKfId
7
+ * @param externalUserId
8
+ * @returns
9
+ */
10
+ state(openKfId: string, externalUserId: string): Promise<any>;
11
+ /**
12
+ * 变更会话状态
13
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94669
14
+ * @param openKfId
15
+ * @param externalUserId
16
+ * @param serviceState
17
+ * @param serviceUserId
18
+ * @returns
19
+ */
20
+ del(openKfId: string, externalUserId: string, serviceState: number, serviceUserId: string): Promise<any>;
21
+ /**
22
+ * 读取消息
23
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94670
24
+ * @param cursor
25
+ * @param token
26
+ * @param limit
27
+ * @returns
28
+ */
29
+ sync(cursor: string, token: string, limit: number): Promise<any>;
30
+ /**
31
+ * 发送消息
32
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94677
33
+ * @param params
34
+ * @returns
35
+ */
36
+ send(params: object): Promise<any>;
37
+ /**
38
+ * 发送事件响应消息
39
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94677
40
+ * @param params
41
+ * @returns
42
+ */
43
+ event(params: object): Promise<any>;
44
+ }
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const BaseClient_1 = __importDefault(require("../../Core/BaseClient"));
7
+ class KfMessageClient extends BaseClient_1.default {
8
+ /**
9
+ * 获取会话状态
10
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94669
11
+ * @param openKfId
12
+ * @param externalUserId
13
+ * @returns
14
+ */
15
+ state(openKfId, externalUserId) {
16
+ let params = {
17
+ open_kfid: openKfId,
18
+ external_userid: externalUserId,
19
+ };
20
+ return this.httpPostJson('cgi-bin/kf/service_state/get', params);
21
+ }
22
+ /**
23
+ * 变更会话状态
24
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94669
25
+ * @param openKfId
26
+ * @param externalUserId
27
+ * @param serviceState
28
+ * @param serviceUserId
29
+ * @returns
30
+ */
31
+ del(openKfId, externalUserId, serviceState, serviceUserId) {
32
+ return this.httpPostJson('cgi-bin/kf/service_state/trans', {
33
+ open_kfid: openKfId,
34
+ external_userid: externalUserId,
35
+ service_state: serviceState,
36
+ servicer_userid: serviceUserId,
37
+ });
38
+ }
39
+ /**
40
+ * 读取消息
41
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94670
42
+ * @param cursor
43
+ * @param token
44
+ * @param limit
45
+ * @returns
46
+ */
47
+ sync(cursor, token, limit) {
48
+ return this.httpPostJson('cgi-bin/kf/sync_msg', {
49
+ cursor,
50
+ token,
51
+ limit,
52
+ });
53
+ }
54
+ /**
55
+ * 发送消息
56
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94677
57
+ * @param params
58
+ * @returns
59
+ */
60
+ send(params) {
61
+ return this.httpPostJson('cgi-bin/kf/send_msg', params);
62
+ }
63
+ /**
64
+ * 发送事件响应消息
65
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94677
66
+ * @param params
67
+ * @returns
68
+ */
69
+ event(params) {
70
+ return this.httpPostJson('cgi-bin/kf/send_msg_on_event', params);
71
+ }
72
+ }
73
+ exports.default = KfMessageClient;
@@ -0,0 +1,26 @@
1
+ import BaseClient from '../../Core/BaseClient';
2
+ export default class KfServicerClient extends BaseClient {
3
+ /**
4
+ * 添加接待人员
5
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94646
6
+ * @param openKfId
7
+ * @param userIds
8
+ * @returns
9
+ */
10
+ add(openKfId: string, userIds: string[]): Promise<any>;
11
+ /**
12
+ * 删除接待人员
13
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94647
14
+ * @param openKfId
15
+ * @param userIds
16
+ * @returns
17
+ */
18
+ del(openKfId: string, userIds: string[]): Promise<any>;
19
+ /**
20
+ * 获取接待人员列表
21
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94645
22
+ * @param openKfId
23
+ * @returns
24
+ */
25
+ list(openKfId: string): Promise<any>;
26
+ }
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const BaseClient_1 = __importDefault(require("../../Core/BaseClient"));
7
+ class KfServicerClient extends BaseClient_1.default {
8
+ /**
9
+ * 添加接待人员
10
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94646
11
+ * @param openKfId
12
+ * @param userIds
13
+ * @returns
14
+ */
15
+ add(openKfId, userIds) {
16
+ let params = {
17
+ open_kfid: openKfId,
18
+ media_id: userIds,
19
+ };
20
+ return this.httpPostJson('cgi-bin/kf/servicer/add', params);
21
+ }
22
+ /**
23
+ * 删除接待人员
24
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94647
25
+ * @param openKfId
26
+ * @param userIds
27
+ * @returns
28
+ */
29
+ del(openKfId, userIds) {
30
+ return this.httpPostJson('cgi-bin/kf/servicer/del', {
31
+ open_kfid: openKfId,
32
+ userid_list: userIds,
33
+ });
34
+ }
35
+ /**
36
+ * 获取接待人员列表
37
+ * @see https://open.work.weixin.qq.com/api/doc/90000/90135/94645
38
+ * @param openKfId
39
+ * @returns
40
+ */
41
+ list(openKfId) {
42
+ return this.httpGet('cgi-bin/kf/servicer/list', {
43
+ open_kfid: openKfId,
44
+ });
45
+ }
46
+ }
47
+ exports.default = KfServicerClient;
@@ -69,7 +69,7 @@ class MediaClient extends BaseClient_1.default {
69
69
  if (!file) {
70
70
  throw new Error(`File does not exist, or the file is unreadable: '${file}'`);
71
71
  }
72
- if (!Utils_1.inArray(type, this.allowTypes)) {
72
+ if (!(0, Utils_1.inArray)(type, this.allowTypes)) {
73
73
  throw new Error(`Unsupported media type: '${type}'`);
74
74
  }
75
75
  let files = {
@@ -32,7 +32,7 @@ class Messenger {
32
32
  return this;
33
33
  }
34
34
  setRecipients(ids, key) {
35
- if (Utils_1.isArray(ids)) {
35
+ if ((0, Utils_1.isArray)(ids)) {
36
36
  ids = ids.join('|');
37
37
  }
38
38
  this.to = {};
@@ -58,7 +58,7 @@ class Messenger {
58
58
  if (!this.agentId) {
59
59
  throw new Error('No agentid specified.');
60
60
  }
61
- let data = this.message.transformForJsonRequest(Utils_1.merge({
61
+ let data = this.message.transformForJsonRequest((0, Utils_1.merge)({
62
62
  agentid: this.agentId,
63
63
  safe: this.secretive ? 1 : 0,
64
64
  }, this.to));
@@ -13,7 +13,7 @@ class ScheduleClient extends BaseClient_1.default {
13
13
  }
14
14
  update(id, schedule) {
15
15
  return this.httpPostJson('cgi-bin/oa/schedule/update', {
16
- schedule: Utils_1.merge({
16
+ schedule: (0, Utils_1.merge)({
17
17
  schedule_id: id,
18
18
  }, schedule)
19
19
  });
@@ -1,6 +1,6 @@
1
1
  import ServerGuard from '../../Core/ServerGuard';
2
2
  export default class Guard extends ServerGuard {
3
- protected validate(): Promise<this>;
3
+ validate(): Promise<this>;
4
4
  protected isSafeMode(): Promise<boolean>;
5
5
  protected shouldReturnRawResponse(): Promise<boolean>;
6
6
  }
@@ -10,12 +10,12 @@ class UserClient extends BaseClient_1.default {
10
10
  return this.httpPostJson('cgi-bin/user/create', data);
11
11
  }
12
12
  update(id, data) {
13
- return this.httpPostJson('cgi-bin/user/update', Utils_1.merge({
13
+ return this.httpPostJson('cgi-bin/user/update', (0, Utils_1.merge)({
14
14
  userid: id,
15
15
  }, data));
16
16
  }
17
17
  delete(userId) {
18
- if (Utils_1.isArray(userId)) {
18
+ if ((0, Utils_1.isArray)(userId)) {
19
19
  return this.batchDelete(userId);
20
20
  }
21
21
  return this.httpGet('cgi-bin/user/delete', {
@@ -69,7 +69,7 @@ class UserClient extends BaseClient_1.default {
69
69
  return this.httpPostJson('cgi-bin/batch/invite', params);
70
70
  }
71
71
  getInvitationQrCode(sizeType = 1) {
72
- if (Utils_1.inArray(sizeType, [1, 2, 3, 4])) {
72
+ if ((0, Utils_1.inArray)(sizeType, [1, 2, 3, 4])) {
73
73
  throw new Error('The sizeType must be 1, 2, 3, 4.');
74
74
  }
75
75
  return this.httpGet('cgi-bin/corp/get_join_qrcode', {
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import OfficialAccount from './OfficialAccount/Application';
2
2
  import BaseService from './BaseService/Application';
3
3
  import MiniProgram from './MiniProgram/Application';
4
4
  import OpenPlatform from './OpenPlatform/Application';
5
+ import OpenWork from './OpenWork/Application';
5
6
  import Payment from './Payment/Application';
6
7
  import Work from './Work/Application';
7
8
  import MicroMerchant from './MicroMerchant/Application';
@@ -15,13 +16,14 @@ import * as Messages from './Core/Messages';
15
16
  import { EasyWechatConfig } from './Core/Types';
16
17
  /**
17
18
  * 通用获取实例方法
18
- * @param service 服务名称,可选值:'BaseService' | 'OfficialAccount' | 'MiniProgram' | 'OpenPlatform' | 'Payment'
19
+ * @param service 服务名称,可选值:'BaseService' | 'OfficialAccount' | 'MiniProgram' | 'OpenPlatform' | 'OpenWork' | 'Payment' | 'Work'
19
20
  * @param config 对应的配置参数
20
21
  */
21
22
  declare function getInstance(service: 'OfficialAccount', config?: EasyWechatConfig): OfficialAccount;
22
23
  declare function getInstance(service: 'BaseService', config?: EasyWechatConfig): BaseService;
23
24
  declare function getInstance(service: 'MiniProgram', config?: EasyWechatConfig): MiniProgram;
24
25
  declare function getInstance(service: 'OpenPlatform', config?: EasyWechatConfig): OpenPlatform;
26
+ declare function getInstance(service: 'OpenWork', config?: EasyWechatConfig): OpenWork;
25
27
  declare function getInstance(service: 'Payment', config?: EasyWechatConfig): Payment;
26
28
  declare function getInstance(service: 'Work', config?: EasyWechatConfig): Work;
27
29
  declare function getInstance(service: 'MicroMerchant', config?: EasyWechatConfig): MicroMerchant;
@@ -46,6 +48,10 @@ declare class EasyWechat {
46
48
  * 开放平台类
47
49
  */
48
50
  OpenPlatform: typeof OpenPlatform;
51
+ /**
52
+ * 企业微信开放平台类
53
+ */
54
+ OpenWork: typeof OpenWork;
49
55
  /**
50
56
  * 支付类
51
57
  */
@@ -60,7 +66,7 @@ declare class EasyWechat {
60
66
  MicroMerchant: typeof MicroMerchant;
61
67
  /**
62
68
  * 通用获取实例方法
63
- * @param service 服务名称,可选值:'BaseService' | 'OfficialAccount' | 'MiniProgram' | 'OpenPlatform' | 'Payment'
69
+ * @param service 服务名称,可选值:'BaseService' | 'OfficialAccount' | 'MiniProgram' | 'OpenPlatform' | 'OpenWork' | 'Payment' | 'Work'
64
70
  * @param config 对应的配置参数
65
71
  */
66
72
  getInstance: typeof getInstance;
package/dist/index.js CHANGED
@@ -26,9 +26,10 @@ const Application_1 = __importDefault(require("./OfficialAccount/Application"));
26
26
  const Application_2 = __importDefault(require("./BaseService/Application"));
27
27
  const Application_3 = __importDefault(require("./MiniProgram/Application"));
28
28
  const Application_4 = __importDefault(require("./OpenPlatform/Application"));
29
- const Application_5 = __importDefault(require("./Payment/Application"));
30
- const Application_6 = __importDefault(require("./Work/Application"));
31
- const Application_7 = __importDefault(require("./MicroMerchant/Application"));
29
+ const Application_5 = __importDefault(require("./OpenWork/Application"));
30
+ const Application_6 = __importDefault(require("./Payment/Application"));
31
+ const Application_7 = __importDefault(require("./Work/Application"));
32
+ const Application_8 = __importDefault(require("./MicroMerchant/Application"));
32
33
  const CacheInterface_1 = __importDefault(require("./Core/Contracts/CacheInterface"));
33
34
  const FinallResult_1 = __importDefault(require("./Core/Decorators/FinallResult"));
34
35
  const TerminateResult_1 = __importDefault(require("./Core/Decorators/TerminateResult"));
@@ -38,7 +39,7 @@ const StreamResponse_1 = __importDefault(require("./Core/Http/StreamResponse"));
38
39
  const Messages = __importStar(require("./Core/Messages"));
39
40
  function getInstance(service, config) {
40
41
  try {
41
- let s = Utils_1.strStudly(service);
42
+ let s = (0, Utils_1.strStudly)(service);
42
43
  let applicationClass = this[s];
43
44
  return new applicationClass(config);
44
45
  }
@@ -62,9 +63,10 @@ class EasyWechat {
62
63
  BaseService: Application_2.default,
63
64
  MiniProgram: Application_3.default,
64
65
  OpenPlatform: Application_4.default,
65
- Payment: Application_5.default,
66
- Work: Application_6.default,
67
- MicroMerchant: Application_7.default,
66
+ OpenWork: Application_5.default,
67
+ Payment: Application_6.default,
68
+ Work: Application_7.default,
69
+ MicroMerchant: Application_8.default,
68
70
  getInstance: getInstance,
69
71
  };
70
72
  this.CacheInterface = CacheInterface_1.default;
@@ -1 +1 @@
1
- {"data":{"errcode":0,"errmsg":"ok","access_token":"moke-token","expires_in":7200},"lifeTime":1641409629}
1
+ {"data":{"errcode":0,"errmsg":"ok","access_token":"moke-token","expires_in":7200},"lifeTime":1643310403}
@@ -1 +1 @@
1
- {"data":{"errcode":0,"errmsg":"ok"},"lifeTime":1641409628}
1
+ {"data":{"errcode":0,"errmsg":"ok"},"lifeTime":1643310403}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-easywechat",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "description": "EasyWechat SDK for Node.js (NOT OFFICIAL)",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -19,19 +19,19 @@
19
19
  "author": "Hpyer",
20
20
  "license": "MIT",
21
21
  "devDependencies": {
22
- "@types/node": "^12.12.7",
23
- "mocha": "^8.3.0",
24
- "sinon": "^9.2.4",
25
- "typedoc": "^0.21.5",
26
- "typedoc-plugin-markdown": "^3.10.4",
27
- "typescript": "^4.2.3"
22
+ "@types/node": "^17.0.8",
23
+ "mocha": "^9.1.3",
24
+ "sinon": "^12.0.1",
25
+ "typedoc": "^0.22.10",
26
+ "typedoc-plugin-markdown": "^3.11.9",
27
+ "typescript": "^4.5.4"
28
28
  },
29
29
  "dependencies": {
30
- "axios": "^0.21.4",
30
+ "axios": "^0.24.0",
31
31
  "form-data": "^4.0.0",
32
- "node-socialite": "^1.2.4",
33
- "qs": "^6.10.1",
34
- "raw-body": "^2.4.1",
32
+ "node-socialite": "^1.2.5",
33
+ "qs": "^6.10.2",
34
+ "raw-body": "^2.4.2",
35
35
  "xml2js": "^0.4.23"
36
36
  }
37
37
  }