node-easywechat 2.7.2 → 2.8.3
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/BaseService/Jssdk/JssdkClient.js +5 -5
- package/dist/BaseService/Media/MediaClient.js +1 -1
- package/dist/Core/AES.d.ts +1 -1
- package/dist/Core/AES.js +4 -4
- package/dist/Core/BaseAccessToken.js +2 -2
- package/dist/Core/BaseApplication.js +4 -4
- package/dist/Core/BaseClient.js +2 -2
- package/dist/Core/Cache/FileCache.js +3 -3
- package/dist/Core/Encryptor.js +3 -3
- package/dist/Core/Http/Request.js +11 -11
- package/dist/Core/Http/StreamResponse.js +1 -1
- package/dist/Core/Messages/Media.js +2 -2
- package/dist/Core/Messages/Message.js +7 -7
- package/dist/Core/Mixins/HttpMixin.js +4 -4
- package/dist/Core/ServerGuard.js +5 -5
- package/dist/Core/Utils.js +18 -18
- package/dist/MicroMerchant/Application.js +1 -1
- package/dist/MicroMerchant/Base/MicroMerchantBase.js +6 -6
- package/dist/MicroMerchant/Certficates/CertficatesClient.js +1 -1
- package/dist/MicroMerchant/Core/BaseClient.js +8 -8
- package/dist/MicroMerchant/Media/MediaClient.js +1 -1
- package/dist/MicroMerchant/MerchantConfig/MerchantConfigClient.js +1 -1
- package/dist/MicroMerchant/Meterial/MeterialClient.js +4 -4
- package/dist/MicroMerchant/Withdraw/WithdrawClient.js +2 -2
- package/dist/MiniProgram/ActivityMessage/ActivityMessageClient.js +3 -3
- package/dist/MiniProgram/AppCode/AppCodeClient.js +2 -2
- package/dist/MiniProgram/Application.d.ts +20 -0
- package/dist/MiniProgram/Application.js +50 -0
- package/dist/MiniProgram/Base/MiniProgramBase.js +1 -1
- package/dist/MiniProgram/NearbyPoi/NearbyPoiClient.js +3 -3
- package/dist/MiniProgram/OpenData/OpenDataClient.js +2 -2
- package/dist/MiniProgram/PhoneNumber/PhoneNumberClient.d.ts +10 -0
- package/dist/MiniProgram/PhoneNumber/PhoneNumberClient.js +20 -0
- package/dist/MiniProgram/RealtimeLog/RealtimeLogClient.js +1 -1
- package/dist/MiniProgram/Shop/AccoutClient.d.ts +25 -0
- package/dist/MiniProgram/Shop/AccoutClient.js +42 -0
- package/dist/MiniProgram/Shop/AftersaleClient.d.ts +22 -0
- package/dist/MiniProgram/Shop/AftersaleClient.js +35 -0
- package/dist/MiniProgram/Shop/BasicClient.d.ts +39 -0
- package/dist/MiniProgram/Shop/BasicClient.js +69 -0
- package/dist/MiniProgram/Shop/DeliveryClient.d.ts +20 -0
- package/dist/MiniProgram/Shop/DeliveryClient.js +32 -0
- package/dist/MiniProgram/Shop/OrderClient.d.ts +32 -0
- package/dist/MiniProgram/Shop/OrderClient.js +51 -0
- package/dist/MiniProgram/Shop/RegisterClient.d.ts +25 -0
- package/dist/MiniProgram/Shop/RegisterClient.js +43 -0
- package/dist/MiniProgram/Shop/SpuClient.d.ts +67 -0
- package/dist/MiniProgram/Shop/SpuClient.js +92 -0
- package/dist/MiniProgram/ShortLink/ShortLinkClient.d.ts +11 -0
- package/dist/MiniProgram/ShortLink/ShortLinkClient.js +23 -0
- package/dist/MiniProgram/SubscribeMessage/SubscribeMessageClient.js +5 -5
- package/dist/MiniProgram/UniformMessage/UniformMessageClient.js +3 -3
- package/dist/MiniProgram/Union/UnionClient.d.ts +3 -0
- package/dist/MiniProgram/Union/UnionClient.js +9 -0
- package/dist/MiniProgram/UrlLink/UrlLinkClient.d.ts +9 -0
- package/dist/MiniProgram/UrlLink/UrlLinkClient.js +17 -0
- package/dist/OfficialAccount/Base/OfficialAccountBase.js +2 -2
- package/dist/OfficialAccount/Broadcasting/BroadcastingClient.js +2 -2
- package/dist/OfficialAccount/Broadcasting/MessageBuilder.js +1 -1
- package/dist/OfficialAccount/Card/Client.js +1 -1
- package/dist/OfficialAccount/Card/JssdkClient.js +2 -2
- package/dist/OfficialAccount/Card/MemberCardClient.js +1 -1
- package/dist/OfficialAccount/CustomerService/CustomerServiceClient.js +2 -2
- package/dist/OfficialAccount/CustomerService/Messenger.js +1 -1
- package/dist/OfficialAccount/DataCube/DataCubeClient.js +1 -1
- package/dist/OfficialAccount/Material/MaterialClient.js +2 -2
- package/dist/OfficialAccount/OCR/OCRClient.js +1 -1
- package/dist/OfficialAccount/Semantic/SemanticClient.js +1 -1
- package/dist/OfficialAccount/SubscribeMessage/SubscribeMessageClient.js +4 -4
- package/dist/OfficialAccount/TemplateMessage/TemplateMessageClient.js +4 -4
- package/dist/OpenPlatform/Application.js +7 -7
- package/dist/OpenPlatform/Authorizer/Auth/AccessToken.js +1 -1
- package/dist/OpenPlatform/Authorizer/OfficialAccount/Account/Client.js +1 -1
- package/dist/Payment/Application.js +4 -4
- package/dist/Payment/Bill/BillClient.js +2 -2
- package/dist/Payment/Core/BaseClient.js +8 -8
- package/dist/Payment/Jssdk/JssdkClient.d.ts +12 -0
- package/dist/Payment/Jssdk/JssdkClient.js +41 -9
- package/dist/Payment/Merchant/MerchantClient.js +1 -1
- package/dist/Payment/Notify/Handler.js +5 -5
- package/dist/Payment/Notify/Refunded.js +1 -1
- package/dist/Payment/Notify/Scanned.js +2 -2
- package/dist/Payment/Order/OrderClient.js +1 -1
- package/dist/Payment/Redpack/RedpackClient.js +5 -5
- package/dist/Payment/Refund/RefundClient.js +3 -3
- package/dist/Payment/Sandbox/SandboxClient.js +1 -1
- package/dist/Payment/Transfer/TransferClient.js +1 -1
- package/dist/Work/Agent/AgentClient.js +1 -1
- package/dist/Work/Agent/WorkbenchClient.d.ts +24 -0
- package/dist/Work/Agent/WorkbenchClient.js +39 -0
- package/dist/Work/Application.d.ts +8 -0
- package/dist/Work/Application.js +20 -0
- package/dist/Work/Calendar/CalendarClient.js +1 -1
- package/dist/Work/Chat/ChatClient.js +1 -1
- package/dist/Work/CorpGroup/CorpGroupClient.d.ts +34 -0
- package/dist/Work/CorpGroup/CorpGroupClient.js +42 -0
- package/dist/Work/Department/DepartmentClient.js +1 -1
- package/dist/Work/ExternalContact/Client.d.ts +202 -3
- package/dist/Work/ExternalContact/Client.js +244 -6
- package/dist/Work/ExternalContact/ContactWayClient.d.ts +37 -0
- package/dist/Work/ExternalContact/ContactWayClient.js +51 -2
- package/dist/Work/ExternalContact/MessageClient.d.ts +45 -0
- package/dist/Work/ExternalContact/MessageClient.js +90 -4
- package/dist/Work/ExternalContact/MessageTemplateClient.js +3 -3
- package/dist/Work/ExternalContact/MomentClient.d.ts +56 -3
- package/dist/Work/ExternalContact/MomentClient.js +62 -3
- package/dist/Work/ExternalContact/StatisticsClient.d.ts +24 -0
- package/dist/Work/ExternalContact/StatisticsClient.js +35 -0
- package/dist/Work/Jssdk/JssdkClient.js +3 -3
- package/dist/Work/Kf/KfAccountClient.d.ts +41 -0
- package/dist/Work/Kf/KfAccountClient.js +71 -0
- package/dist/Work/Kf/KfMessageClient.d.ts +44 -0
- package/dist/Work/Kf/KfMessageClient.js +73 -0
- package/dist/Work/Kf/KfServicerClient.d.ts +26 -0
- package/dist/Work/Kf/KfServicerClient.js +47 -0
- package/dist/Work/Media/MediaClient.js +1 -1
- package/dist/Work/Message/Messenger.js +2 -2
- package/dist/Work/Schedule/ScheduleClient.js +1 -1
- package/dist/Work/User/UserClient.js +3 -3
- package/dist/index.js +1 -1
- package/node-easywechat.file_cache.easywechat.kernel.access_token.8a9684b45da7de42a06a70ba01a7005a.cache +1 -1
- package/node-easywechat.file_cache.easywechat.kernel.access_token.c3d06edaf326aad75d32f31348df787a.cache +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1,32 @@
|
|
|
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 DeliveryClient extends BaseClient_1.default {
|
|
8
|
+
/**
|
|
9
|
+
* 获取快递公司列表
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
getCompanyList() {
|
|
13
|
+
return this.httpPostJson('shop/delivery/get_company_list');
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 订单发货
|
|
17
|
+
* @param order
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
send(order) {
|
|
21
|
+
return this.httpPostJson('shop/delivery/send', order);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 订单确认收货
|
|
25
|
+
* @param order
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
recieve(order) {
|
|
29
|
+
return this.httpPostJson('shop/delivery/recieve', order);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = DeliveryClient;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import BaseClient from '../../Core/BaseClient';
|
|
2
|
+
export default class OrderClient extends BaseClient {
|
|
3
|
+
/**
|
|
4
|
+
* 检查场景值是否在支付校验范围内
|
|
5
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/order/check_scene.html
|
|
6
|
+
* @param scene
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
sceneCheck(scene: number): Promise<any>;
|
|
10
|
+
/**
|
|
11
|
+
* 生成订单
|
|
12
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/order/add_order.html
|
|
13
|
+
* @param order
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
add(order: object): Promise<any>;
|
|
17
|
+
/**
|
|
18
|
+
* 获取订单详情
|
|
19
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/order/get_order.html
|
|
20
|
+
* @param openid 用户的openid
|
|
21
|
+
* @param orderIds {order_id, out_order_id} 二选一
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
get(openid: string, orderIds: object): Promise<any>;
|
|
25
|
+
/**
|
|
26
|
+
* 同步订单支付结果
|
|
27
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/order/pay_order.html
|
|
28
|
+
* @param object
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
pay(params: object): Promise<any>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
const Utils_1 = require("../../Core/Utils");
|
|
8
|
+
class OrderClient extends BaseClient_1.default {
|
|
9
|
+
/**
|
|
10
|
+
* 检查场景值是否在支付校验范围内
|
|
11
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/order/check_scene.html
|
|
12
|
+
* @param scene
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
sceneCheck(scene) {
|
|
16
|
+
return this.httpPostJson('shop/scene/check', {
|
|
17
|
+
scene,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 生成订单
|
|
22
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/order/add_order.html
|
|
23
|
+
* @param order
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
add(order) {
|
|
27
|
+
return this.httpPostJson('shop/order/add', order);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 获取订单详情
|
|
31
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/order/get_order.html
|
|
32
|
+
* @param openid 用户的openid
|
|
33
|
+
* @param orderIds {order_id, out_order_id} 二选一
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
get(openid, orderIds) {
|
|
37
|
+
return this.httpPostJson('shop/order/get', (0, Utils_1.merge)((0, Utils_1.merge)({}, orderIds), {
|
|
38
|
+
openid,
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 同步订单支付结果
|
|
43
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/order/pay_order.html
|
|
44
|
+
* @param object
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
pay(params) {
|
|
48
|
+
return this.httpPostJson('shop/order/pay', params);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.default = OrderClient;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import BaseClient from '../../Core/BaseClient';
|
|
2
|
+
export default class RegisterClient extends BaseClient {
|
|
3
|
+
/**
|
|
4
|
+
* 接入申请
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
apply(): Promise<any>;
|
|
8
|
+
/**
|
|
9
|
+
* 获取接入状态
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
check(): Promise<any>;
|
|
13
|
+
/**
|
|
14
|
+
* 完成接入任务
|
|
15
|
+
* @param accessInfoItem 6:完成spu接口,7:完成订单接口,8:完成物流接口,9:完成售后接口,10:测试完成,11:发版完成
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
finishAccessInfo(accessInfoItem: number): Promise<any>;
|
|
19
|
+
/**
|
|
20
|
+
* 场景接入申请
|
|
21
|
+
* @param sceneGroupId 1:视频号、公众号场景
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
applyScene(sceneGroupId: number): Promise<any>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 RegisterClient extends BaseClient_1.default {
|
|
8
|
+
/**
|
|
9
|
+
* 接入申请
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
apply() {
|
|
13
|
+
return this.httpPostJson('shop/register/apply');
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 获取接入状态
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
check() {
|
|
20
|
+
return this.httpPostJson('shop/register/check');
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 完成接入任务
|
|
24
|
+
* @param accessInfoItem 6:完成spu接口,7:完成订单接口,8:完成物流接口,9:完成售后接口,10:测试完成,11:发版完成
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
finishAccessInfo(accessInfoItem) {
|
|
28
|
+
return this.httpPostJson('shop/register/finish_access_info', {
|
|
29
|
+
access_info_item: accessInfoItem,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 场景接入申请
|
|
34
|
+
* @param sceneGroupId 1:视频号、公众号场景
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
applyScene(sceneGroupId) {
|
|
38
|
+
return this.httpPostJson('shop/register/apply_scene', {
|
|
39
|
+
scene_group_id: sceneGroupId,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.default = RegisterClient;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import BaseClient from '../../Core/BaseClient';
|
|
2
|
+
export default class SpuClient extends BaseClient {
|
|
3
|
+
/**
|
|
4
|
+
* 添加商品
|
|
5
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/add_spu.html
|
|
6
|
+
* @param product
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
add(product: object): Promise<any>;
|
|
10
|
+
/**
|
|
11
|
+
* 删除商品
|
|
12
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/del_spu.html
|
|
13
|
+
* @param params
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
del(params: object): Promise<any>;
|
|
17
|
+
/**
|
|
18
|
+
* 获取商品
|
|
19
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/get_spu.html
|
|
20
|
+
* @param params
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
get(params: object): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* 获取商品列表
|
|
26
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/get_spu_list.html
|
|
27
|
+
* @param product
|
|
28
|
+
* @param page
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
getList(product: object, page: object): Promise<any>;
|
|
32
|
+
/**
|
|
33
|
+
* 撤回商品审核
|
|
34
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/del_spu_audit.html
|
|
35
|
+
* @param params
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
delAudit(params: object): Promise<any>;
|
|
39
|
+
/**
|
|
40
|
+
* 更新商品
|
|
41
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/update_spu.html
|
|
42
|
+
* @param params
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
update(params: object): Promise<any>;
|
|
46
|
+
/**
|
|
47
|
+
* 免审更新商品
|
|
48
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/update_spu_without_audit.html
|
|
49
|
+
* @param params
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
updateWithoutAudit(params: object): Promise<any>;
|
|
53
|
+
/**
|
|
54
|
+
* 上架商品
|
|
55
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/listing_spu.html
|
|
56
|
+
* @param params
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
59
|
+
listing(params: object): Promise<any>;
|
|
60
|
+
/**
|
|
61
|
+
* 下架商品
|
|
62
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/delisting_spu.html
|
|
63
|
+
* @param params
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
delisting(params: object): Promise<any>;
|
|
67
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
const Utils_1 = require("../../Core/Utils");
|
|
8
|
+
class SpuClient extends BaseClient_1.default {
|
|
9
|
+
/**
|
|
10
|
+
* 添加商品
|
|
11
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/add_spu.html
|
|
12
|
+
* @param product
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
add(product) {
|
|
16
|
+
return this.httpPostJson('shop/spu/add', product);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 删除商品
|
|
20
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/del_spu.html
|
|
21
|
+
* @param params
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
del(params) {
|
|
25
|
+
return this.httpPostJson('shop/spu/del', params);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 获取商品
|
|
29
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/get_spu.html
|
|
30
|
+
* @param params
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
get(params) {
|
|
34
|
+
return this.httpPostJson('shop/spu/get', params);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 获取商品列表
|
|
38
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/get_spu_list.html
|
|
39
|
+
* @param product
|
|
40
|
+
* @param page
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
getList(product, page) {
|
|
44
|
+
return this.httpPostJson('shop/spu/get_list', (0, Utils_1.merge)((0, Utils_1.merge)({}, product), page));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 撤回商品审核
|
|
48
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/del_spu_audit.html
|
|
49
|
+
* @param params
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
delAudit(params) {
|
|
53
|
+
return this.httpPostJson('shop/spu/del_audit', params);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* 更新商品
|
|
57
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/update_spu.html
|
|
58
|
+
* @param params
|
|
59
|
+
* @returns
|
|
60
|
+
*/
|
|
61
|
+
update(params) {
|
|
62
|
+
return this.httpPostJson('shop/spu/update', params);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 免审更新商品
|
|
66
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/update_spu_without_audit.html
|
|
67
|
+
* @param params
|
|
68
|
+
* @returns
|
|
69
|
+
*/
|
|
70
|
+
updateWithoutAudit(params) {
|
|
71
|
+
return this.httpPostJson('shop/spu/update_without_audit', params);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 上架商品
|
|
75
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/listing_spu.html
|
|
76
|
+
* @param params
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
listing(params) {
|
|
80
|
+
return this.httpPostJson('shop/spu/listing', params);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 下架商品
|
|
84
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/SPU/delisting_spu.html
|
|
85
|
+
* @param params
|
|
86
|
+
* @returns
|
|
87
|
+
*/
|
|
88
|
+
delisting(params) {
|
|
89
|
+
return this.httpPostJson('shop/spu/delisting', params);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.default = SpuClient;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import BaseClient from '../../Core/BaseClient';
|
|
2
|
+
export default class ShortLinkClient extends BaseClient {
|
|
3
|
+
/**
|
|
4
|
+
* 获取小程序 Short Link
|
|
5
|
+
* @param pageUrl
|
|
6
|
+
* @param pageTitle
|
|
7
|
+
* @param isPermanent
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
getShortLink(pageUrl: string, pageTitle: string, isPermanent?: boolean): Promise<any>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 ShortLinkClient extends BaseClient_1.default {
|
|
8
|
+
/**
|
|
9
|
+
* 获取小程序 Short Link
|
|
10
|
+
* @param pageUrl
|
|
11
|
+
* @param pageTitle
|
|
12
|
+
* @param isPermanent
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
getShortLink(pageUrl, pageTitle, isPermanent = false) {
|
|
16
|
+
return this.httpPostJson('wxa/genwxashortlink', {
|
|
17
|
+
page_url: pageUrl,
|
|
18
|
+
page_title: pageTitle,
|
|
19
|
+
is_permanent: isPermanent,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.default = ShortLinkClient;
|
|
@@ -26,9 +26,9 @@ class SubscribeMessageClient extends BaseClient_1.default {
|
|
|
26
26
|
return this.httpPostJson('cgi-bin/message/subscribe/send', params);
|
|
27
27
|
}
|
|
28
28
|
formatMessage(data) {
|
|
29
|
-
let params = Utils_1.merge(Utils_1.merge({}, this.message), data);
|
|
29
|
+
let params = (0, Utils_1.merge)((0, Utils_1.merge)({}, this.message), data);
|
|
30
30
|
for (let key in params) {
|
|
31
|
-
if (Utils_1.inArray(key, this.required) && !params[key]) {
|
|
31
|
+
if ((0, Utils_1.inArray)(key, this.required) && !params[key]) {
|
|
32
32
|
throw new Error(`Attribute "${key}" can not be empty!`);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -39,13 +39,13 @@ class SubscribeMessageClient extends BaseClient_1.default {
|
|
|
39
39
|
let formatted = {}, value;
|
|
40
40
|
for (let key in data) {
|
|
41
41
|
value = {};
|
|
42
|
-
if (Utils_1.isArray(data[key]) && data[key].length == 2) {
|
|
42
|
+
if ((0, Utils_1.isArray)(data[key]) && data[key].length == 2) {
|
|
43
43
|
value = {
|
|
44
44
|
value: data[key][0],
|
|
45
45
|
color: data[key][1],
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
else if (Utils_1.isObject(data[key]) && data[key]['value']) {
|
|
48
|
+
else if ((0, Utils_1.isObject)(data[key]) && data[key]['value']) {
|
|
49
49
|
value = data[key];
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
@@ -101,7 +101,7 @@ class SubscribeMessageClient extends BaseClient_1.default {
|
|
|
101
101
|
start,
|
|
102
102
|
limit,
|
|
103
103
|
};
|
|
104
|
-
if (Utils_1.isArray(ids)) {
|
|
104
|
+
if ((0, Utils_1.isArray)(ids)) {
|
|
105
105
|
query.ids = ids.join(',');
|
|
106
106
|
}
|
|
107
107
|
return this.httpGet('wxaapi/newtmpl/getpubtemplatetitles', query);
|
|
@@ -29,7 +29,7 @@ class UniformMessageClient extends TemplateMessageClient_1.default {
|
|
|
29
29
|
this.required = ['touser', 'template_id', 'form_id', 'miniprogram', 'appid'];
|
|
30
30
|
}
|
|
31
31
|
formatMessage(data) {
|
|
32
|
-
let params = Utils_1.merge(Utils_1.merge({}, this.message), data);
|
|
32
|
+
let params = (0, Utils_1.merge)((0, Utils_1.merge)({}, this.message), data);
|
|
33
33
|
if (!params['touser']) {
|
|
34
34
|
throw new Error('Attribute "touser" can not be empty!');
|
|
35
35
|
}
|
|
@@ -55,9 +55,9 @@ class UniformMessageClient extends TemplateMessageClient_1.default {
|
|
|
55
55
|
return params;
|
|
56
56
|
}
|
|
57
57
|
baseFormat(data = {}, defaultData = {}) {
|
|
58
|
-
let params = Utils_1.merge(Utils_1.merge({}, defaultData), data);
|
|
58
|
+
let params = (0, Utils_1.merge)((0, Utils_1.merge)({}, defaultData), data);
|
|
59
59
|
for (let key in params) {
|
|
60
|
-
if (Utils_1.inArray(key, this.required) && !params[key] && !defaultData[key]) {
|
|
60
|
+
if ((0, Utils_1.inArray)(key, this.required) && !params[key] && !defaultData[key]) {
|
|
61
61
|
throw new Error(`Attribute "${key}" can not be empty!`);
|
|
62
62
|
}
|
|
63
63
|
params[key] = params[key] || defaultData[key];
|
|
@@ -10,4 +10,7 @@ export default class UnionClient extends BaseClient {
|
|
|
10
10
|
getOrderInfo(orderIdList: string[]): Promise<any>;
|
|
11
11
|
searchOrder(page?: number, startTimestamp?: string, endTimestamp?: string, commissionStatus?: string): Promise<any>;
|
|
12
12
|
getFeaturedProducts(params: object): Promise<any>;
|
|
13
|
+
getTargetPlanInfo(params: object): Promise<any>;
|
|
14
|
+
applyJoinTargetPlan(params: object): Promise<any>;
|
|
15
|
+
getTargetPlanStatus(params: object): Promise<any>;
|
|
13
16
|
}
|
|
@@ -56,5 +56,14 @@ class UnionClient extends BaseClient_1.default {
|
|
|
56
56
|
getFeaturedProducts(params) {
|
|
57
57
|
return this.httpGet('union/promoter/product/select', params);
|
|
58
58
|
}
|
|
59
|
+
getTargetPlanInfo(params) {
|
|
60
|
+
return this.httpGet('union/promoter/target/plan_info', params);
|
|
61
|
+
}
|
|
62
|
+
applyJoinTargetPlan(params) {
|
|
63
|
+
return this.httpPostJson('union/promoter/target/apply_target', params);
|
|
64
|
+
}
|
|
65
|
+
getTargetPlanStatus(params) {
|
|
66
|
+
return this.httpGet('union/promoter/target/apply_status', params);
|
|
67
|
+
}
|
|
59
68
|
}
|
|
60
69
|
exports.default = UnionClient;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 UrlLinkClient extends BaseClient_1.default {
|
|
8
|
+
/**
|
|
9
|
+
* 获取小程序 URL Link
|
|
10
|
+
* @param params
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
generate(params = {}) {
|
|
14
|
+
return this.httpPostJson('wxa/generate_urllink', params);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = UrlLinkClient;
|
|
@@ -22,11 +22,11 @@ class OfficialAccountBase extends BaseClient_1.default {
|
|
|
22
22
|
return this.httpGet('cgi-bin/getcallbackip');
|
|
23
23
|
}
|
|
24
24
|
checkCallbackUrl(action = 'all', operator = 'DEFAULT') {
|
|
25
|
-
if (!Utils_1.inArray(action, ['dns', 'ping', 'all'], true)) {
|
|
25
|
+
if (!(0, Utils_1.inArray)(action, ['dns', 'ping', 'all'], true)) {
|
|
26
26
|
throw new Error('The action must be dns, ping, all.');
|
|
27
27
|
}
|
|
28
28
|
operator = operator.toUpperCase();
|
|
29
|
-
if (!Utils_1.inArray(operator, ['CHINANET', 'UNICOM', 'CAP', 'DEFAULT'], true)) {
|
|
29
|
+
if (!(0, Utils_1.inArray)(operator, ['CHINANET', 'UNICOM', 'CAP', 'DEFAULT'], true)) {
|
|
30
30
|
throw new Error('The operator must be CHINANET, UNICOM, CAP, DEFAULT.');
|
|
31
31
|
}
|
|
32
32
|
return this.httpPostJson('cgi-bin/callback/check', {
|
|
@@ -49,10 +49,10 @@ class BroadcastingClient extends BaseClient_1.default {
|
|
|
49
49
|
*/
|
|
50
50
|
sendMessage(message, reception = null, attributes = {}) {
|
|
51
51
|
let msg = (new MessageBuilder_1.default).message(message).with(attributes).toAll();
|
|
52
|
-
if (Utils_1.isNumber(reception) && reception > 0) {
|
|
52
|
+
if ((0, Utils_1.isNumber)(reception) && reception > 0) {
|
|
53
53
|
msg.toTag(reception);
|
|
54
54
|
}
|
|
55
|
-
else if (Utils_1.isArray(reception)) {
|
|
55
|
+
else if ((0, Utils_1.isArray)(reception)) {
|
|
56
56
|
msg.toUsers(reception);
|
|
57
57
|
}
|
|
58
58
|
return this.send(msg.build());
|
|
@@ -50,7 +50,7 @@ class MessageBuilder {
|
|
|
50
50
|
if (!prepends) {
|
|
51
51
|
prepends = this._to;
|
|
52
52
|
}
|
|
53
|
-
let message = Utils_1.merge(Utils_1.merge(Utils_1.merge({}, prepends), content), this._attributes);
|
|
53
|
+
let message = (0, Utils_1.merge)((0, Utils_1.merge)((0, Utils_1.merge)({}, prepends), content), this._attributes);
|
|
54
54
|
return message;
|
|
55
55
|
}
|
|
56
56
|
buildForPreview(by, user) {
|
|
@@ -114,7 +114,7 @@ class Client extends BaseClient_1.default {
|
|
|
114
114
|
status: res.getStatusCode(),
|
|
115
115
|
headers: res.getHeaders(),
|
|
116
116
|
body: res.getContent(),
|
|
117
|
-
url: baseUrl + '?' + Utils_1.buildQueryString(params),
|
|
117
|
+
url: baseUrl + '?' + (0, Utils_1.buildQueryString)(params),
|
|
118
118
|
};
|
|
119
119
|
});
|
|
120
120
|
}
|
|
@@ -43,8 +43,8 @@ class JssdkClient extends JssdkClient_1.default {
|
|
|
43
43
|
}
|
|
44
44
|
attachExtension(cardId, extension = {}) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
let timestamp = Utils_1.getTimestamp();
|
|
47
|
-
let nonce_str = Utils_1.randomString(6);
|
|
46
|
+
let timestamp = (0, Utils_1.getTimestamp)();
|
|
47
|
+
let nonce_str = (0, Utils_1.randomString)(6);
|
|
48
48
|
let ticket = yield this.getTicket()['ticket'];
|
|
49
49
|
let ext = {
|
|
50
50
|
timestamp,
|
|
@@ -19,7 +19,7 @@ class MemberCardClient extends Client_1.default {
|
|
|
19
19
|
* @param settings 会员卡激活时的选项
|
|
20
20
|
*/
|
|
21
21
|
setActivationForm(cardId, settings) {
|
|
22
|
-
let params = Utils_1.merge({
|
|
22
|
+
let params = (0, Utils_1.merge)({
|
|
23
23
|
card_id: cardId,
|
|
24
24
|
}, settings);
|
|
25
25
|
return this.httpPostJson('card/membercard/activateuserform/set', params);
|
|
@@ -68,8 +68,8 @@ class CustomerServiceClient extends BaseClient_1.default {
|
|
|
68
68
|
}
|
|
69
69
|
messages(startTime, endTime, msgId = 1, number = 10000) {
|
|
70
70
|
return this.httpPostJson('customservice/msgrecord/getmsglist', {
|
|
71
|
-
starttime: Utils_1.getTimestamp(startTime),
|
|
72
|
-
endtime: Utils_1.getTimestamp(endTime),
|
|
71
|
+
starttime: (0, Utils_1.getTimestamp)(startTime),
|
|
72
|
+
endtime: (0, Utils_1.getTimestamp)(endTime),
|
|
73
73
|
msgid: msgId,
|
|
74
74
|
number: number,
|
|
75
75
|
});
|
|
@@ -193,7 +193,7 @@ class DataCubeClient extends BaseClient_1.default {
|
|
|
193
193
|
return this.query('datacube/getcardmembercarddetail', from, to, ext);
|
|
194
194
|
}
|
|
195
195
|
query(api, from, to, ext = {}) {
|
|
196
|
-
let params = Utils_1.merge({
|
|
196
|
+
let params = (0, Utils_1.merge)({
|
|
197
197
|
begin_date: from,
|
|
198
198
|
end_date: to,
|
|
199
199
|
}, ext);
|
|
@@ -70,10 +70,10 @@ class MaterialClient extends BaseClient_1.default {
|
|
|
70
70
|
if (!file) {
|
|
71
71
|
throw new Error(`File does not exist, or the file is unreadable: '${file}'`);
|
|
72
72
|
}
|
|
73
|
-
if (Utils_1.isString(file)) {
|
|
73
|
+
if ((0, Utils_1.isString)(file)) {
|
|
74
74
|
file = fs_1.default.createReadStream(file);
|
|
75
75
|
}
|
|
76
|
-
if (!Utils_1.inArray(type, this.allowTypes)) {
|
|
76
|
+
if (!(0, Utils_1.inArray)(type, this.allowTypes)) {
|
|
77
77
|
throw new Error(`Unsupported media type: '${type}'`);
|
|
78
78
|
}
|
|
79
79
|
let formData = new form_data_1.default();
|
|
@@ -19,7 +19,7 @@ class OCRClient extends BaseClient_1.default {
|
|
|
19
19
|
* @param type
|
|
20
20
|
*/
|
|
21
21
|
idCard(img_url, type = 'photo') {
|
|
22
|
-
if (!Utils_1.inArray(type, this.allowTypes, true)) {
|
|
22
|
+
if (!(0, Utils_1.inArray)(type, this.allowTypes, true)) {
|
|
23
23
|
throw new Error(`Unsupported type: '${type}'`);
|
|
24
24
|
}
|
|
25
25
|
return this.httpPost('cv/ocr/idcard', {
|
|
@@ -13,7 +13,7 @@ class SemanticClient extends BaseClient_1.default {
|
|
|
13
13
|
* @param optional 其它参数。属性:latitude,纬度,与城市二选一;longitude,经度,与城市二选一;city,城市,与经纬度二选一;region,区域名称,在城市存在的情况下可省;uid,用户唯一id(非开发者id);
|
|
14
14
|
*/
|
|
15
15
|
query(keyword, categories, optional = {}) {
|
|
16
|
-
let params = Utils_1.merge({
|
|
16
|
+
let params = (0, Utils_1.merge)({
|
|
17
17
|
query: keyword,
|
|
18
18
|
category: categories,
|
|
19
19
|
appid: this.app.config.app_id,
|