oak-external-sdk/lib/types/Wechat.d.ts

141 lines
3.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 微信服务器向应用服务器推送的公众号消息或事件
* https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html
* https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_event_pushes.html
* https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Template_Message_Interface.html#%E4%BA%8B%E4%BB%B6%E6%8E%A8%E9%80%81
*
* 微信推送的数据格式是xml需要自主转化成json对象
*/
export type WechatPublicEventData = {
ToUserName: string;
FromUserName: string;
CreateTime: number;
MsgID: string;
MsgType: 'text' | 'image' | 'voice' | 'video' | 'location' | 'link' | 'event';
Event?: 'subscribe' | 'unsubscribe' | 'SCAN' | 'LOCATION' | 'CLICK' | 'VIEW' | 'TEMPLATESENDJOBFINISH';
EventKey?: string;
Ticket?: string;
Latitude?: string;
Longitude?: string;
Precision?: string;
Status?: string;
Content?: string;
MsgDataId?: string;
PicUrl?: string;
MediaId?: string;
Format?: string;
Recognition?: string;
ThumbMediaId?: string;
Location_X?: number;
Location_Y?: number;
Scale?: number;
Label?: string;
Title?: string;
Description?: string;
Url?: string;
Idx?: number;
};
export declare type WechatMpEventData = {
ToUserName: string;
FromUserName: string;
CreateTime: number;
MsgID: string;
MsgType: 'text' | 'image' | 'miniprogrampage' | 'event';
Event?: 'user_enter_tempsession';
SessionFrom?: string;
Content?: string;
MediaId?: string;
PicUrl?: string;
Title?: string;
AppId?: string;
PagePath?: string;
ThumbUrl?: string;
ThumbMediaId?: string;
};
type ExpressUserData = {
name?: string;
tel?: string;
mobile?: string;
company?: string;
post_code?: string;
country?: string;
province?: string;
city?: string;
area?: string;
address?: string;
};
export type AddExpressOrderData = {
order_id: string;
openid?: string;
delivery_id: string;
biz_id: string;
custom_remark?: string;
tagid?: number;
add_source: 0 | 2;
wx_appid?: string;
sender: ExpressUserData;
receiver: ExpressUserData;
cargo: {
count: number;
weight: number;
space_x: number;
space_y: number;
space_z: number;
detail_list: Array<{
name: string;
count: number;
}>;
};
shop: {
wxa_path?: string;
img_url?: string;
goods_name?: string;
goods_count?: number;
detail_list?: Array<object>;
};
insured: {
use_insured: 0 | 1;
insured_value?: number;
};
service: {
service_type: number;
service_name: string;
};
expect_time?: number;
take_mode?: number;
};
export type CancelExpressOrderData = {
openid?: string;
delivery_id: string;
waybill_id: string;
order_id: string;
};
export type GetExpressPathData = {
openid?: string;
delivery_id: string;
waybill_id: string;
};
export type GetExpressOrderData = {
order_id: string;
openid?: string;
delivery_id: string;
waybill_id?: string;
print_type?: number;
custom_remark?: string;
};
export type NotifyConfirmReceiveData = {
transaction_id?: string;
merchant_id?: string;
sub_merchant_id?: string;
merchant_trade_no?: string;
received_time: number;
};
export type BindExpressAccountData = {
type: 'bind' | 'unbind';
biz_id: string;
delivery_id: string;
password?: string;
remark_content?: string;
};
export {};