@pacoyang/wechaty-puppet-wechat 0.28.5
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/.editorconfig +14 -0
- package/.eslintrc.js +7 -0
- package/.github/workflows/npm.yml +91 -0
- package/.markdownlintrc +13 -0
- package/.travis.yml +62 -0
- package/.vscode/settings.json +73 -0
- package/CODEOWNERS +9 -0
- package/LICENSE +201 -0
- package/NOTICE +8 -0
- package/README.md +145 -0
- package/dist/examples/demo.d.ts +20 -0
- package/dist/examples/demo.d.ts.map +1 -0
- package/dist/examples/demo.js +113 -0
- package/dist/examples/demo.js.map +1 -0
- package/dist/scripts/retry-unit-tests.d.ts +10 -0
- package/dist/scripts/retry-unit-tests.d.ts.map +1 -0
- package/dist/scripts/retry-unit-tests.js +47 -0
- package/dist/scripts/retry-unit-tests.js.map +1 -0
- package/dist/src/bridge.d.ts +100 -0
- package/dist/src/bridge.d.ts.map +1 -0
- package/dist/src/bridge.js +927 -0
- package/dist/src/bridge.js.map +1 -0
- package/dist/src/bridge.spec.d.ts +21 -0
- package/dist/src/bridge.spec.d.ts.map +1 -0
- package/dist/src/bridge.spec.js +191 -0
- package/dist/src/bridge.spec.js.map +1 -0
- package/dist/src/config.d.ts +10 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +57 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/event.d.ts +23 -0
- package/dist/src/event.d.ts.map +1 -0
- package/dist/src/event.js +166 -0
- package/dist/src/event.js.map +1 -0
- package/dist/src/event.spec.d.ts +3 -0
- package/dist/src/event.spec.d.ts.map +1 -0
- package/dist/src/event.spec.js +41 -0
- package/dist/src/event.spec.js.map +1 -0
- package/dist/src/firer.d.ts +50 -0
- package/dist/src/firer.d.ts.map +1 -0
- package/dist/src/firer.js +409 -0
- package/dist/src/firer.js.map +1 -0
- package/dist/src/firer.spec.d.ts +21 -0
- package/dist/src/firer.spec.d.ts.map +1 -0
- package/dist/src/firer.spec.js +190 -0
- package/dist/src/firer.spec.js.map +1 -0
- package/dist/src/mod.d.ts +23 -0
- package/dist/src/mod.d.ts.map +1 -0
- package/dist/src/mod.js +28 -0
- package/dist/src/mod.js.map +1 -0
- package/dist/src/puppet-wechat.d.ts +164 -0
- package/dist/src/puppet-wechat.d.ts.map +1 -0
- package/dist/src/puppet-wechat.js +1287 -0
- package/dist/src/puppet-wechat.js.map +1 -0
- package/dist/src/puppet-wechat.spec.d.ts +21 -0
- package/dist/src/puppet-wechat.spec.d.ts.map +1 -0
- package/dist/src/puppet-wechat.spec.js +123 -0
- package/dist/src/puppet-wechat.spec.js.map +1 -0
- package/dist/src/pure-function-helpers/is-type.d.ts +3 -0
- package/dist/src/pure-function-helpers/is-type.d.ts.map +1 -0
- package/dist/src/pure-function-helpers/is-type.js +12 -0
- package/dist/src/pure-function-helpers/is-type.js.map +1 -0
- package/dist/src/pure-function-helpers/message-extname.d.ts +3 -0
- package/dist/src/pure-function-helpers/message-extname.d.ts.map +1 -0
- package/dist/src/pure-function-helpers/message-extname.js +44 -0
- package/dist/src/pure-function-helpers/message-extname.js.map +1 -0
- package/dist/src/pure-function-helpers/message-filename.d.ts +3 -0
- package/dist/src/pure-function-helpers/message-filename.d.ts.map +1 -0
- package/dist/src/pure-function-helpers/message-filename.js +19 -0
- package/dist/src/pure-function-helpers/message-filename.js.map +1 -0
- package/dist/src/pure-function-helpers/message-raw-payload-parser.d.ts +4 -0
- package/dist/src/pure-function-helpers/message-raw-payload-parser.d.ts.map +1 -0
- package/dist/src/pure-function-helpers/message-raw-payload-parser.js +67 -0
- package/dist/src/pure-function-helpers/message-raw-payload-parser.js.map +1 -0
- package/dist/src/pure-function-helpers/mod.d.ts +7 -0
- package/dist/src/pure-function-helpers/mod.d.ts.map +1 -0
- package/dist/src/pure-function-helpers/mod.js +23 -0
- package/dist/src/pure-function-helpers/mod.js.map +1 -0
- package/dist/src/pure-function-helpers/normalize-scan-status.d.ts +3 -0
- package/dist/src/pure-function-helpers/normalize-scan-status.d.ts.map +1 -0
- package/dist/src/pure-function-helpers/normalize-scan-status.js +21 -0
- package/dist/src/pure-function-helpers/normalize-scan-status.js.map +1 -0
- package/dist/src/pure-function-helpers/normalize-scan-status.spec.d.ts +21 -0
- package/dist/src/pure-function-helpers/normalize-scan-status.spec.d.ts.map +1 -0
- package/dist/src/pure-function-helpers/normalize-scan-status.spec.js +37 -0
- package/dist/src/pure-function-helpers/normalize-scan-status.spec.js.map +1 -0
- package/dist/src/pure-function-helpers/web-message-type.d.ts +4 -0
- package/dist/src/pure-function-helpers/web-message-type.d.ts.map +1 -0
- package/dist/src/pure-function-helpers/web-message-type.js +58 -0
- package/dist/src/pure-function-helpers/web-message-type.js.map +1 -0
- package/dist/src/pure-function-helpers/xml.d.ts +14 -0
- package/dist/src/pure-function-helpers/xml.d.ts.map +1 -0
- package/dist/src/pure-function-helpers/xml.js +64 -0
- package/dist/src/pure-function-helpers/xml.js.map +1 -0
- package/dist/src/version.d.ts +6 -0
- package/dist/src/version.d.ts.map +1 -0
- package/dist/src/version.js +9 -0
- package/dist/src/version.js.map +1 -0
- package/dist/src/version.spec.d.ts +3 -0
- package/dist/src/version.spec.d.ts.map +1 -0
- package/dist/src/version.spec.js +13 -0
- package/dist/src/version.spec.js.map +1 -0
- package/dist/src/web-schemas.d.ts +249 -0
- package/dist/src/web-schemas.d.ts.map +1 -0
- package/dist/src/web-schemas.js +118 -0
- package/dist/src/web-schemas.js.map +1 -0
- package/dist/src/wechaty-bro.js +868 -0
- package/dist/tests/puppeteer-contact.spec.d.ts +21 -0
- package/dist/tests/puppeteer-contact.spec.d.ts.map +1 -0
- package/dist/tests/puppeteer-contact.spec.js +67 -0
- package/dist/tests/puppeteer-contact.spec.js.map +1 -0
- package/dist/tests/puppeteer-friendship.spec.d.ts +21 -0
- package/dist/tests/puppeteer-friendship.spec.d.ts.map +1 -0
- package/dist/tests/puppeteer-friendship.spec.js +115 -0
- package/dist/tests/puppeteer-friendship.spec.js.map +1 -0
- package/dist/tests/puppeteer-message.spec.d.ts +21 -0
- package/dist/tests/puppeteer-message.spec.d.ts.map +1 -0
- package/dist/tests/puppeteer-message.spec.js +184 -0
- package/dist/tests/puppeteer-message.spec.js.map +1 -0
- package/dist/tests/puppeteer-room.spec.d.ts +21 -0
- package/dist/tests/puppeteer-room.spec.d.ts.map +1 -0
- package/dist/tests/puppeteer-room.spec.js +129 -0
- package/dist/tests/puppeteer-room.spec.js.map +1 -0
- package/dist/tests/puppeteer.spec.d.ts +21 -0
- package/dist/tests/puppeteer.spec.d.ts.map +1 -0
- package/dist/tests/puppeteer.spec.js +213 -0
- package/dist/tests/puppeteer.spec.js.map +1 -0
- package/docs/images/puppeteer-logo.png +0 -0
- package/docs/images/wechaty-puppet-wechat.png +0 -0
- package/examples/demo.ts +130 -0
- package/package.json +94 -0
- package/scripts/generate-version.sh +18 -0
- package/scripts/npm-pack-testing.sh +49 -0
- package/scripts/package-publish-config-tag.sh +13 -0
- package/scripts/retry-unit-tests.ts +57 -0
- package/src/bridge.spec.ts +224 -0
- package/src/bridge.ts +1122 -0
- package/src/config.ts +71 -0
- package/src/event.spec.ts +41 -0
- package/src/event.ts +247 -0
- package/src/firer.spec.ts +208 -0
- package/src/firer.ts +530 -0
- package/src/mod.ts +29 -0
- package/src/puppet-wechat.spec.ts +149 -0
- package/src/puppet-wechat.ts +1659 -0
- package/src/pure-function-helpers/is-type.ts +7 -0
- package/src/pure-function-helpers/message-extname.ts +57 -0
- package/src/pure-function-helpers/message-filename.ts +25 -0
- package/src/pure-function-helpers/message-raw-payload-parser.ts +85 -0
- package/src/pure-function-helpers/mod.ts +6 -0
- package/src/pure-function-helpers/normalize-scan-status.spec.ts +44 -0
- package/src/pure-function-helpers/normalize-scan-status.ts +23 -0
- package/src/pure-function-helpers/web-message-type.ts +71 -0
- package/src/pure-function-helpers/xml.ts +79 -0
- package/src/typings.d.ts +19 -0
- package/src/version.spec.ts +10 -0
- package/src/version.ts +6 -0
- package/src/web-schemas.ts +298 -0
- package/src/wechaty-bro.js +868 -0
- package/tests/fixtures/inject-file.js +7 -0
- package/tests/fixtures/smoke-testing.ts +42 -0
- package/tests/puppeteer-contact.spec.ts +78 -0
- package/tests/puppeteer-friendship.spec.ts +157 -0
- package/tests/puppeteer-message.spec.ts +249 -0
- package/tests/puppeteer-room.spec.ts +166 -0
- package/tests/puppeteer.spec.ts +262 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wechaty - https://github.com/chatie/wechaty
|
|
3
|
+
*
|
|
4
|
+
* @copyright 2016-2018 Huan LI <zixia@zixia.net>
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
// tslint:disable:max-line-length
|
|
21
|
+
|
|
22
|
+
export interface WebContactRawPayload {
|
|
23
|
+
Alias: string,
|
|
24
|
+
City: string,
|
|
25
|
+
NickName: string,
|
|
26
|
+
Province: string,
|
|
27
|
+
RemarkName: string,
|
|
28
|
+
Sex: number,
|
|
29
|
+
Signature: string,
|
|
30
|
+
StarFriend: string,
|
|
31
|
+
Uin: string,
|
|
32
|
+
UserName: string,
|
|
33
|
+
HeadImgUrl: string,
|
|
34
|
+
|
|
35
|
+
stranger?: string, // assign by injectio.js
|
|
36
|
+
VerifyFlag: number,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface WebMessageMediaPayload {
|
|
40
|
+
ToUserName: string,
|
|
41
|
+
MsgType: number,
|
|
42
|
+
MediaId: string,
|
|
43
|
+
FileName: string,
|
|
44
|
+
FileSize: number,
|
|
45
|
+
FileMd5?: string,
|
|
46
|
+
FileType?: number,
|
|
47
|
+
MMFileExt?: string,
|
|
48
|
+
Signature?: string,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface WebMessageRawPayload {
|
|
52
|
+
MsgId: string,
|
|
53
|
+
|
|
54
|
+
MMActualSender: string, // getUserContact(message.MMActualSender,message.MMPeerUserName).isContact()
|
|
55
|
+
MMPeerUserName: string, // message.MsgType == CONF.MSGTYPE_TEXT && message.MMPeerUserName == 'newsapp'
|
|
56
|
+
ToUserName: string,
|
|
57
|
+
FromUserName: string,
|
|
58
|
+
MMActualContent: string, // Content has @id prefix added by wx
|
|
59
|
+
Content: string,
|
|
60
|
+
|
|
61
|
+
MMDigest: string,
|
|
62
|
+
MMDisplayTime: number, // Javascript timestamp of milliseconds
|
|
63
|
+
CreateTime: number,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* MsgType == MSGTYPE_APP && message.AppMsgType == CONF.APPMSGTYPE_URL
|
|
67
|
+
* class="cover" mm-src="{{getMsgImg(message.MsgId,'slave')}}"
|
|
68
|
+
*/
|
|
69
|
+
Url: string,
|
|
70
|
+
MMAppMsgDesc: string, // class="desc" ng-bind="message.MMAppMsgDesc"
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Attachment
|
|
74
|
+
*
|
|
75
|
+
* MsgType == MSGTYPE_APP && message.AppMsgType == CONF.APPMSGTYPE_ATTACH
|
|
76
|
+
*/
|
|
77
|
+
FileName: string, // FileName: '钢甲互联项目BP1108.pdf',
|
|
78
|
+
FileSize: number, // FileSize: '2845701',
|
|
79
|
+
MediaId: string, // MediaId: '@crypt_b1a45e3f_c21dceb3ac01349...
|
|
80
|
+
MMFileExt: string, // doc, docx ... 'undefined'?
|
|
81
|
+
Signature: string, // checkUpload return the signature used to upload large files
|
|
82
|
+
|
|
83
|
+
MMAppMsgFileExt: string, // doc, docx ... 'undefined'?
|
|
84
|
+
MMAppMsgFileSize: string, // '2.7MB',
|
|
85
|
+
MMAppMsgDownloadUrl: string, // 'https://file.wx.qq.com/cgi-bin/mmwebwx-bin/webwxgetmedia?sender=@4f549c2dafd5ad731afa4d857bf03c10&mediaid=@crypt_b1a45e3f
|
|
86
|
+
// <a download ng-if="message.MMFileStatus == CONF.MM_SEND_FILE_STATUS_SUCCESS
|
|
87
|
+
// && (massage.MMStatus == CONF.MSG_SEND_STATUS_SUCC || massage.MMStatus === undefined)
|
|
88
|
+
// " href="{{message.MMAppMsgDownloadUrl}}">下载</a>
|
|
89
|
+
MMUploadProgress: number, // < 100
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* 模板消息
|
|
93
|
+
* MSGTYPE_APP && message.AppMsgType == CONF.APPMSGTYPE_READER_TYPE
|
|
94
|
+
* item.url
|
|
95
|
+
* item.title
|
|
96
|
+
* item.pub_time
|
|
97
|
+
* item.cover
|
|
98
|
+
* item.digest
|
|
99
|
+
*/
|
|
100
|
+
MMCategory: any[], // item in message.MMCategory
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Type
|
|
104
|
+
*
|
|
105
|
+
* MsgType == CONF.MSGTYPE_VOICE : ng-style="{'width':40 + 7*message.VoiceLength/1000}
|
|
106
|
+
*/
|
|
107
|
+
MsgType: number,
|
|
108
|
+
AppMsgType: WebAppMsgType, // message.MsgType == CONF.MSGTYPE_APP && message.AppMsgType == CONF.APPMSGTYPE_URL
|
|
109
|
+
// message.MsgType == CONF.MSGTYPE_TEXT && message.SubMsgType != CONF.MSGTYPE_LOCATION
|
|
110
|
+
|
|
111
|
+
SubMsgType: WebMessageType, // "msgType":"{{message.MsgType}}","subType":{{message.SubMsgType||0}},"msgId":"{{message.MsgId}}"
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Status-es
|
|
115
|
+
*/
|
|
116
|
+
Status: string,
|
|
117
|
+
MMStatus: number, // img ng-show="message.MMStatus == 1" class="ico_loading"
|
|
118
|
+
// ng-click="resendMsg(message)" ng-show="message.MMStatus == 5" title="重新发送"
|
|
119
|
+
MMFileStatus: number, // <p class="loading" ng-show="message.MMStatus == 1 || message.MMFileStatus == CONF.MM_SEND_FILE_STATUS_FAIL">
|
|
120
|
+
// CONF.MM_SEND_FILE_STATUS_QUEUED, MM_SEND_FILE_STATUS_SENDING
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Location
|
|
124
|
+
*/
|
|
125
|
+
MMLocationUrl: string, // ng-if="message.MsgType == CONF.MSGTYPE_TEXT && message.SubMsgType == CONF.MSGTYPE_LOCATION"
|
|
126
|
+
// <a href="{{message.MMLocationUrl}}" target="_blank">
|
|
127
|
+
// 'http://apis.map.qq.com/uri/v1/geocoder?coord=40.075041,116.338994'
|
|
128
|
+
MMLocationDesc: string, // MMLocationDesc: '北京市昌平区回龙观龙腾苑(五区)内(龙腾街南)',
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* MsgType == CONF.MSGTYPE_EMOTICON
|
|
132
|
+
*
|
|
133
|
+
* getMsgImg(message.MsgId,'big',message)
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Image
|
|
138
|
+
*
|
|
139
|
+
* getMsgImg(message.MsgId,'slave')
|
|
140
|
+
*/
|
|
141
|
+
MMImgStyle: string, // ng-style="message.MMImgStyle"
|
|
142
|
+
MMPreviewSrc: string, // message.MMPreviewSrc || message.MMThumbSrc || getMsgImg(message.MsgId,'slave')
|
|
143
|
+
MMThumbSrc: string,
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Friend Request & ShareCard ?
|
|
147
|
+
*
|
|
148
|
+
* MsgType == CONF.MSGTYPE_SHARECARD" ng-click="showProfile($event,message.RecommendInfo.UserName)
|
|
149
|
+
* MsgType == CONF.MSGTYPE_VERIFYMSG
|
|
150
|
+
*/
|
|
151
|
+
RecommendInfo? : WebRecomendInfo,
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Transpond Message
|
|
155
|
+
*/
|
|
156
|
+
MsgIdBeforeTranspond? : string, // oldMsg.MsgIdBeforeTranspond || oldMsg.MsgId,
|
|
157
|
+
isTranspond? : boolean,
|
|
158
|
+
MMSourceMsgId? : string,
|
|
159
|
+
MMSendContent? : string,
|
|
160
|
+
|
|
161
|
+
MMIsChatRoom? : boolean,
|
|
162
|
+
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// export type MessageTypeName = 'TEXT' | 'IMAGE' | 'VOICE' | 'VERIFYMSG' | 'POSSIBLEFRIEND_MSG'
|
|
166
|
+
// | 'SHARECARD' | 'VIDEO' | 'EMOTICON' | 'LOCATION' | 'APP' | 'VOIPMSG' | 'STATUSNOTIFY'
|
|
167
|
+
// | 'VOIPNOTIFY' | 'VOIPINVITE' | 'MICROVIDEO' | 'SYSNOTICE' | 'SYS' | 'RECALLED'
|
|
168
|
+
|
|
169
|
+
// export type MessageTypeValue = 1 | 3 | 34 | 37 | 40 | 42 | 43 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 62 | 9999 | 10000 | 10002
|
|
170
|
+
|
|
171
|
+
// export interface WebMsgTypeDict {
|
|
172
|
+
// [index: string]: string|number,
|
|
173
|
+
// // MessageTypeName: MessageTypeValue
|
|
174
|
+
// // , MessageTypeValue: MessageTypeName
|
|
175
|
+
// }
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
*
|
|
179
|
+
* Enum for AppMsgType values.
|
|
180
|
+
*
|
|
181
|
+
* @enum {number}
|
|
182
|
+
* @property {number} TEXT - AppMsgType.TEXT (1) for TEXT
|
|
183
|
+
* @property {number} IMG - AppMsgType.IMG (2) for IMG
|
|
184
|
+
* @property {number} AUDIO - AppMsgType.AUDIO (3) for AUDIO
|
|
185
|
+
* @property {number} VIDEO - AppMsgType.VIDEO (4) for VIDEO
|
|
186
|
+
* @property {number} URL - AppMsgType.URL (5) for URL
|
|
187
|
+
* @property {number} ATTACH - AppMsgType.ATTACH (6) for ATTACH
|
|
188
|
+
* @property {number} OPEN - AppMsgType.OPEN (7) for OPEN
|
|
189
|
+
* @property {number} EMOJI - AppMsgType.EMOJI (8) for EMOJI
|
|
190
|
+
* @property {number} VOICE_REMIND - AppMsgType.VOICE_REMIND (9) for VOICE_REMIND
|
|
191
|
+
* @property {number} SCAN_GOOD - AppMsgType.SCAN_GOOD (10) for SCAN_GOOD
|
|
192
|
+
* @property {number} GOOD - AppMsgType.GOOD (13) for GOOD
|
|
193
|
+
* @property {number} EMOTION - AppMsgType.EMOTION (15) for EMOTION
|
|
194
|
+
* @property {number} CARD_TICKET - AppMsgType.CARD_TICKET (16) for CARD_TICKET
|
|
195
|
+
* @property {number} REALTIME_SHARE_LOCATION - AppMsgType.REALTIME_SHARE_LOCATION (17) for REALTIME_SHARE_LOCATION
|
|
196
|
+
* @property {number} TRANSFERS - AppMsgType.TRANSFERS (2e3) for TRANSFERS
|
|
197
|
+
* @property {number} RED_ENVELOPES - AppMsgType.RED_ENVELOPES (2001) for RED_ENVELOPES
|
|
198
|
+
* @property {number} READER_TYPE - AppMsgType.READER_TYPE (100001) for READER_TYPE
|
|
199
|
+
*/
|
|
200
|
+
export enum WebAppMsgType {
|
|
201
|
+
TEXT = 1,
|
|
202
|
+
IMG = 2,
|
|
203
|
+
AUDIO = 3,
|
|
204
|
+
VIDEO = 4,
|
|
205
|
+
URL = 5,
|
|
206
|
+
ATTACH = 6,
|
|
207
|
+
OPEN = 7,
|
|
208
|
+
EMOJI = 8,
|
|
209
|
+
VOICE_REMIND = 9,
|
|
210
|
+
SCAN_GOOD = 10,
|
|
211
|
+
GOOD = 13,
|
|
212
|
+
EMOTION = 15,
|
|
213
|
+
CARD_TICKET = 16,
|
|
214
|
+
REALTIME_SHARE_LOCATION = 17,
|
|
215
|
+
TRANSFERS = 2e3,
|
|
216
|
+
RED_ENVELOPES = 2001,
|
|
217
|
+
READER_TYPE = 100001,
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
*
|
|
222
|
+
* Enum for MsgType values.
|
|
223
|
+
* @enum {number}
|
|
224
|
+
* @property {number} TEXT - MsgType.TEXT (1) for TEXT
|
|
225
|
+
* @property {number} IMAGE - MsgType.IMAGE (3) for IMAGE
|
|
226
|
+
* @property {number} VOICE - MsgType.VOICE (34) for VOICE
|
|
227
|
+
* @property {number} VERIFYMSG - MsgType.VERIFYMSG (37) for VERIFYMSG
|
|
228
|
+
* @property {number} POSSIBLEFRIEND_MSG - MsgType.POSSIBLEFRIEND_MSG (40) for POSSIBLEFRIEND_MSG
|
|
229
|
+
* @property {number} SHARECARD - MsgType.SHARECARD (42) for SHARECARD
|
|
230
|
+
* @property {number} VIDEO - MsgType.VIDEO (43) for VIDEO
|
|
231
|
+
* @property {number} EMOTICON - MsgType.EMOTICON (47) for EMOTICON
|
|
232
|
+
* @property {number} LOCATION - MsgType.LOCATION (48) for LOCATION
|
|
233
|
+
* @property {number} APP - MsgType.APP (49) for APP
|
|
234
|
+
* @property {number} VOIPMSG - MsgType.VOIPMSG (50) for VOIPMSG
|
|
235
|
+
* @property {number} STATUSNOTIFY - MsgType.STATUSNOTIFY (51) for STATUSNOTIFY
|
|
236
|
+
* @property {number} VOIPNOTIFY - MsgType.VOIPNOTIFY (52) for VOIPNOTIFY
|
|
237
|
+
* @property {number} VOIPINVITE - MsgType.VOIPINVITE (53) for VOIPINVITE
|
|
238
|
+
* @property {number} MICROVIDEO - MsgType.MICROVIDEO (62) for MICROVIDEO
|
|
239
|
+
* @property {number} SYSNOTICE - MsgType.SYSNOTICE (9999) for SYSNOTICE
|
|
240
|
+
* @property {number} SYS - MsgType.SYS (10000) for SYS
|
|
241
|
+
* @property {number} RECALLED - MsgType.RECALLED (10002) for RECALLED
|
|
242
|
+
*/
|
|
243
|
+
export enum WebMessageType {
|
|
244
|
+
TEXT = 1,
|
|
245
|
+
IMAGE = 3,
|
|
246
|
+
VOICE = 34,
|
|
247
|
+
VERIFYMSG = 37,
|
|
248
|
+
POSSIBLEFRIEND_MSG = 40,
|
|
249
|
+
SHARECARD = 42,
|
|
250
|
+
VIDEO = 43,
|
|
251
|
+
EMOTICON = 47,
|
|
252
|
+
LOCATION = 48,
|
|
253
|
+
APP = 49,
|
|
254
|
+
VOIPMSG = 50,
|
|
255
|
+
STATUSNOTIFY = 51,
|
|
256
|
+
VOIPNOTIFY = 52,
|
|
257
|
+
VOIPINVITE = 53,
|
|
258
|
+
MICROVIDEO = 62,
|
|
259
|
+
SYSNOTICE = 9999,
|
|
260
|
+
SYS = 10000,
|
|
261
|
+
RECALLED = 10002,
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* from Message
|
|
266
|
+
*/
|
|
267
|
+
export interface WebRecomendInfo {
|
|
268
|
+
UserName : string,
|
|
269
|
+
NickName : string, // display_name
|
|
270
|
+
Content : string, // request message
|
|
271
|
+
HeadImgUrl : string, // message.RecommendInfo.HeadImgUrl
|
|
272
|
+
|
|
273
|
+
Ticket : string, // a pass token
|
|
274
|
+
VerifyFlag : number,
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export const enum WebMediaType {
|
|
278
|
+
Image = 'pic',
|
|
279
|
+
Video = 'video',
|
|
280
|
+
Attachment = 'doc',
|
|
281
|
+
// Audio = 3, useless now
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export interface WebRoomRawMember {
|
|
285
|
+
UserName : string,
|
|
286
|
+
NickName : string,
|
|
287
|
+
DisplayName : string,
|
|
288
|
+
HeadImgUrl : string,
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export interface WebRoomRawPayload {
|
|
292
|
+
UserName: string,
|
|
293
|
+
EncryChatRoomId: string,
|
|
294
|
+
NickName: string,
|
|
295
|
+
OwnerUin: number,
|
|
296
|
+
ChatRoomOwner: string,
|
|
297
|
+
MemberList?: WebRoomRawMember[],
|
|
298
|
+
}
|