Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.Veneno.
wechaty
提交
1b8c7359
W
wechaty
项目概览
.Veneno.
/
wechaty
与 Fork 源项目一致
Fork自
wechaty / wechaty
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
wechaty
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1b8c7359
编写于
4月 20, 2017
作者:
Huan (李卓桓)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
merge
上级
c813bcff
变更
32
显示空白变更内容
内联
并排
Showing
32 changed file
with
133 addition
and
97 deletion
+133
-97
.editorconfig
.editorconfig
+0
-1
index.ts
index.ts
+10
-10
src/brolog-env.ts
src/brolog-env.ts
+1
-0
src/contact.ts
src/contact.ts
+2
-0
src/friend-request.ts
src/friend-request.ts
+4
-2
src/message.spec.ts
src/message.spec.ts
+2
-2
src/message.ts
src/message.ts
+7
-5
src/puppet-web/bridge.ts
src/puppet-web/bridge.ts
+4
-2
src/puppet-web/browser-cookie.ts
src/puppet-web/browser-cookie.ts
+4
-2
src/puppet-web/browser-driver.ts
src/puppet-web/browser-driver.ts
+2
-0
src/puppet-web/browser.ts
src/puppet-web/browser.ts
+7
-5
src/puppet-web/event.ts
src/puppet-web/event.ts
+7
-5
src/puppet-web/firer.ts
src/puppet-web/firer.ts
+6
-4
src/puppet-web/friend-request.spec.ts
src/puppet-web/friend-request.spec.ts
+6
-6
src/puppet-web/friend-request.ts
src/puppet-web/friend-request.ts
+5
-5
src/puppet-web/index.ts
src/puppet-web/index.ts
+11
-7
src/puppet-web/puppet-web.ts
src/puppet-web/puppet-web.ts
+13
-11
src/puppet-web/server.ts
src/puppet-web/server.ts
+3
-1
src/puppet-web/watchdog.ts
src/puppet-web/watchdog.ts
+5
-3
src/puppet.spec.ts
src/puppet.spec.ts
+2
-2
src/puppet.ts
src/puppet.ts
+5
-3
src/room.ts
src/room.ts
+4
-2
src/state-monitor.spec.ts
src/state-monitor.spec.ts
+1
-1
src/state-monitor.ts
src/state-monitor.ts
+2
-0
src/util-lib.spec.ts
src/util-lib.spec.ts
+1
-1
src/util-lib.ts
src/util-lib.ts
+2
-0
test/contact.spec.ts
test/contact.spec.ts
+4
-4
test/docker.spec.ts
test/docker.spec.ts
+1
-1
test/puppet-web/puppet-web.spec.ts
test/puppet-web/puppet-web.spec.ts
+2
-2
test/puppet-web/server.spec.ts
test/puppet-web/server.spec.ts
+5
-5
test/puppet-web/watchdog.spec.ts
test/puppet-web/watchdog.spec.ts
+1
-1
test/room.spec.ts
test/room.spec.ts
+4
-4
未找到文件。
.editorconfig
浏览文件 @
1b8c7359
...
...
@@ -9,7 +9,6 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = 0
trim_trailing_whitespace = false
index.ts
浏览文件 @
1b8c7359
...
...
@@ -3,22 +3,22 @@ import {
Sayable
,
log
,
}
from
'
./src/config
'
import
{
Contact
}
from
'
./src/contact
'
import
Contact
from
'
./src/contact
'
// ISSUE #70 import { FriendRequest } from './src/friend-request'
import
{
FriendRequest
}
from
'
./src/puppet-web/friend-request
'
import
FriendRequest
from
'
./src/puppet-web/friend-request
'
import
{
IoClient
}
from
'
./src/io-client
'
import
IoClient
from
'
./src/io-client
'
import
{
Message
,
MediaMessage
,
MsgType
,
}
from
'
./src/message
'
import
{
Puppet
}
from
'
./src/puppet
'
import
{
PuppetWeb
}
from
'
./src/puppet-web/
'
import
{
Room
}
from
'
./src/room
'
import
{
UtilLib
}
from
'
./src/util-lib
'
import
{
Wechaty
}
from
'
./src/wechaty
'
import
Puppet
from
'
./src/puppet
'
import
PuppetWeb
from
'
./src/puppet-web/
'
import
Room
from
'
./src/room
'
import
UtilLib
from
'
./src/util-lib
'
import
Wechaty
from
'
./src/wechaty
'
const
VERSION
=
require
(
'
./package.json
'
).
version
...
...
src/brolog-env.ts
浏览文件 @
1b8c7359
...
...
@@ -26,3 +26,4 @@ if (levelRegex.test(level)) {
}
export
{
Brolog
}
export
default
Brolog
src/contact.ts
浏览文件 @
1b8c7359
...
...
@@ -659,3 +659,5 @@ export class Contact implements Sayable {
// return []
// }
export
default
Contact
src/friend-request.ts
浏览文件 @
1b8c7359
...
...
@@ -14,7 +14,7 @@ import {
Config
,
log
,
}
from
'
./config
'
import
{
Contact
}
from
'
./contact
'
import
Contact
from
'
./contact
'
export
abstract
class
FriendRequest
{
...
...
@@ -34,3 +34,5 @@ export abstract class FriendRequest {
public
abstract
accept
():
Promise
<
boolean
>
}
export
default
FriendRequest
src/message.spec.ts
浏览文件 @
1b8c7359
...
...
@@ -11,8 +11,8 @@ import {
Config
,
log
,
}
from
'
./config
'
import
{
Message
}
from
'
./message
'
import
{
PuppetWeb
}
from
'
./puppet-web/
'
import
Message
from
'
./message
'
import
PuppetWeb
from
'
./puppet-web/
'
const
MOCK_USER_ID
=
'
TEST-USER-ID
'
...
...
src/message.ts
浏览文件 @
1b8c7359
...
...
@@ -17,11 +17,11 @@ import {
log
,
}
from
'
./config
'
import
{
Contact
}
from
'
./contact
'
import
{
Room
}
from
'
./room
'
import
{
UtilLib
}
from
'
./util-lib
'
import
{
PuppetWeb
}
from
'
./puppet-web/puppet-web
'
import
{
Bridge
}
from
'
./puppet-web/bridge
'
import
Contact
from
'
./contact
'
import
Room
from
'
./room
'
import
UtilLib
from
'
./util-lib
'
import
PuppetWeb
from
'
./puppet-web/puppet-web
'
import
Bridge
from
'
./puppet-web/bridge
'
export
type
MsgRawObj
=
{
MsgId
:
string
,
...
...
@@ -746,3 +746,5 @@ export class MediaMessage extends Message {
* &lang=en&pass_ticket=T6dAZXE27Y6R29%2FFppQPqaBlNwZzw9DAN5RJzzzqeBA%3D
* &wechat_real_lang=en
*/
export
default
Message
src/puppet-web/bridge.ts
浏览文件 @
1b8c7359
...
...
@@ -12,9 +12,9 @@
/* tslint:disable:no-var-requires */
const
retryPromise
=
require
(
'
retry-promise
'
).
default
import
{
log
}
from
'
../brolog-env
'
import
log
from
'
../brolog-env
'
import
{
PuppetWeb
}
from
'
./puppet-web
'
import
PuppetWeb
from
'
./puppet-web
'
export
class
Bridge
{
...
...
@@ -595,3 +595,5 @@ Object.keys(_contacts)
*
*/
export
default
Bridge
src/puppet-web/browser-cookie.ts
浏览文件 @
1b8c7359
...
...
@@ -14,7 +14,7 @@ import * as fs from 'fs'
import
{
log
}
from
'
../config
'
import
{
BrowserDriver
}
from
'
./browser-driver
'
import
BrowserDriver
from
'
./browser-driver
'
/**
* The reason that driverCookie type defined here
...
...
@@ -251,3 +251,5 @@ export class BrowserCookie {
}
}
export
default
BrowserCookie
src/puppet-web/browser-driver.ts
浏览文件 @
1b8c7359
...
...
@@ -344,3 +344,5 @@ export class BrowserDriver {
public
navigate
()
{
return
this
.
driver
.
navigate
()
as
any
}
public
quit
()
{
return
this
.
driver
.
quit
()
as
any
as
Promise
<
void
>
}
}
export
default
BrowserDriver
src/puppet-web/browser.ts
浏览文件 @
1b8c7359
...
...
@@ -18,14 +18,14 @@ import {
Config
,
HeadName
,
}
from
'
../config
'
import
{
StateMonitor
}
from
'
../state-monitor
'
import
{
log
}
from
'
../brolog-env
'
import
StateMonitor
from
'
../state-monitor
'
import
log
from
'
../brolog-env
'
import
{
CookieType
,
BrowserCookie
,
}
from
'
./browser-cookie
'
import
{
BrowserDriver
}
from
'
./browser-driver
'
import
BrowserDriver
from
'
./browser-driver
'
export
type
BrowserSetting
=
{
head
:
HeadName
,
...
...
@@ -445,3 +445,5 @@ export class Browser extends EventEmitter {
public
readCookie
()
{
return
this
.
cookie
.
read
()
}
public
cleanCookie
()
{
return
this
.
cookie
.
clean
()
}
}
export
default
Browser
src/puppet-web/event.ts
浏览文件 @
1b8c7359
...
...
@@ -20,7 +20,7 @@ import {
ScanInfo
,
log
,
}
from
'
../config
'
import
{
Contact
}
from
'
../contact
'
import
Contact
from
'
../contact
'
import
{
Message
,
MediaMessage
,
...
...
@@ -28,8 +28,8 @@ import {
MsgRawObj
,
}
from
'
../message
'
import
{
Firer
}
from
'
./firer
'
import
{
PuppetWeb
}
from
'
./puppet-web
'
import
Firer
from
'
./firer
'
import
PuppetWeb
from
'
./puppet-web
'
/* tslint:disable:variable-name */
export
const
Event
=
{
...
...
@@ -348,3 +348,5 @@ async function onServerMessage(this: PuppetWeb, obj: MsgRawObj): Promise<void> {
return
}
export
default
Event
src/puppet-web/firer.ts
浏览文件 @
1b8c7359
...
...
@@ -22,10 +22,10 @@ import {
// RecommendInfo
log
,
}
from
'
../config
'
import
{
Contact
}
from
'
../contact
'
import
{
Message
}
from
'
../message
'
import
Contact
from
'
../contact
'
import
Message
from
'
../message
'
import
{
FriendRequest
}
from
'
./friend-request
'
import
FriendRequest
from
'
./friend-request
'
/* tslint:disable:variable-name */
export
const
Firer
=
{
...
...
@@ -411,3 +411,5 @@ async function checkRoomTopic(m: Message): Promise<void> {
log
.
error
(
'
PuppetWebFirer
'
,
'
fireRoomTopic() co exception: %s
'
,
e
.
stack
)
}
}
export
default
Firer
src/puppet-web/friend-request.spec.ts
浏览文件 @
1b8c7359
...
...
@@ -7,11 +7,11 @@
*/
import
{
test
}
from
'
ava
'
import
{
Config
}
from
'
../config
'
import
{
Contact
}
from
'
../contact
'
import
{
Message
}
from
'
../message
'
import
{
Puppet
}
from
'
../puppet
'
import
{
FriendRequest
as
PuppetWebFriendRequest
}
from
'
./friend-request
'
import
Config
from
'
../config
'
import
Contact
from
'
../contact
'
import
Message
from
'
../message
'
import
Puppet
from
'
../puppet
'
import
PuppetWebFriendRequest
from
'
./friend-request
'
Config
.
puppetInstance
({
userId
:
'
xxx
'
,
...
...
src/puppet-web/friend-request.ts
浏览文件 @
1b8c7359
...
...
@@ -19,15 +19,15 @@
/* tslint:disable:no-var-requires */
const
retryPromise
=
require
(
'
retry-promise
'
).
default
import
{
Contact
}
from
'
../contact
'
import
Contact
from
'
../contact
'
import
{
Config
,
RecommendInfo
,
log
,
}
from
'
../config
'
import
{
FriendRequest
}
from
'
../friend-request
'
import
FriendRequest
from
'
../friend-request
'
class
PuppetWebFriendRequest
extends
FriendRequest
{
export
class
PuppetWebFriendRequest
extends
FriendRequest
{
public
info
:
RecommendInfo
...
...
@@ -131,4 +131,4 @@ class PuppetWebFriendRequest extends FriendRequest {
}
export
{
PuppetWebFriendRequest
as
FriendRequest
}
export
default
PuppetWebFriendRequest
src/puppet-web/index.ts
浏览文件 @
1b8c7359
...
...
@@ -11,7 +11,11 @@
export
{
Bridge
}
from
'
./bridge
'
export
{
Browser
}
from
'
./browser
'
export
{
Event
}
from
'
./event
'
export
{
FriendRequest
}
from
'
./friend-request
'
export
{
PuppetWeb
}
from
'
./puppet-web
'
export
{
PuppetWebFriendRequest
as
FriendRequest
}
from
'
./friend-request
'
export
{
Server
}
from
'
./server
'
export
{
Watchdog
}
from
'
./watchdog
'
import
PuppetWeb
from
'
./puppet-web
'
export
{
PuppetWeb
}
export
default
PuppetWeb
src/puppet-web/puppet-web.ts
浏览文件 @
1b8c7359
...
...
@@ -21,20 +21,20 @@ import {
log
,
}
from
'
../config
'
import
{
Contact
}
from
'
../contact
'
import
Contact
from
'
../contact
'
import
{
Message
,
MediaMessage
,
}
from
'
../message
'
import
{
Puppet
}
from
'
../puppet
'
import
{
Room
}
from
'
../room
'
import
{
UtilLib
}
from
'
../util-lib
'
import
Puppet
from
'
../puppet
'
import
Room
from
'
../room
'
import
UtilLib
from
'
../util-lib
'
import
{
Bridge
}
from
'
./bridge
'
import
{
Browser
}
from
'
./browser
'
import
{
Event
}
from
'
./event
'
import
{
Server
}
from
'
./server
'
import
{
Watchdog
}
from
'
./watchdog
'
import
Bridge
from
'
./bridge
'
import
Browser
from
'
./browser
'
import
Event
from
'
./event
'
import
Server
from
'
./server
'
import
Watchdog
from
'
./watchdog
'
import
*
as
request
from
'
request
'
import
*
as
bl
from
'
bl
'
...
...
@@ -675,3 +675,5 @@ export class PuppetWeb extends Puppet {
}
}
}
export
default
PuppetWeb
src/puppet-web/server.ts
浏览文件 @
1b8c7359
...
...
@@ -16,7 +16,7 @@ import * as bodyParser from 'body-parser'
import
*
as
express
from
'
express
'
import
{
EventEmitter
}
from
'
events
'
import
{
log
}
from
'
../config
'
import
log
from
'
../brolog-env
'
export
class
Server
extends
EventEmitter
{
private
express
:
express
.
Application
...
...
@@ -171,3 +171,5 @@ export class Server extends EventEmitter {
return
}
}
export
default
Server
src/puppet-web/watchdog.ts
浏览文件 @
1b8c7359
...
...
@@ -21,8 +21,8 @@ import {
log
,
}
from
'
../config
'
import
{
PuppetWeb
}
from
'
./puppet-web
'
import
{
Event
}
from
'
./event
'
import
PuppetWeb
from
'
./puppet-web
'
import
Event
from
'
./event
'
/* tslint:disable:variable-name */
export
const
Watchdog
=
{
...
...
@@ -190,3 +190,5 @@ function monitorScan(this: PuppetWeb, type: WatchdogFoodName) {
this
.
lastScanEventTime
=
Date
.
now
()
}
}
export
default
Watchdog
src/puppet.spec.ts
浏览文件 @
1b8c7359
...
...
@@ -6,7 +6,7 @@
*
*/
import
{
test
}
from
'
ava
'
import
{
PuppetWeb
}
from
'
./puppet-web
'
import
PuppetWeb
from
'
./puppet-web
'
test
(
'
Puppet smoking test
'
,
t
=>
{
const
p
=
new
PuppetWeb
()
...
...
src/puppet.ts
浏览文件 @
1b8c7359
...
...
@@ -3,13 +3,13 @@ import { EventEmitter } from 'events'
import
{
Sayable
,
}
from
'
./config
'
import
{
Contact
}
from
'
./contact
'
import
Contact
from
'
./contact
'
import
{
Message
,
MediaMessage
,
}
from
'
./message
'
import
{
StateMonitor
}
from
'
./state-monitor
'
import
{
Room
}
from
'
./room
'
import
StateMonitor
from
'
./state-monitor
'
import
Room
from
'
./room
'
// type ContactGetterFunc = {
// (id: string): Promise<any>
...
...
@@ -63,3 +63,5 @@ export abstract class Puppet extends EventEmitter implements Sayable {
public
abstract
contactFind
(
filterFunc
:
string
):
Promise
<
Contact
[]
>
public
abstract
contactAlias
(
contact
:
Contact
,
alias
:
string
|
null
):
Promise
<
boolean
>
}
export
default
Puppet
src/room.ts
浏览文件 @
1b8c7359
...
...
@@ -5,12 +5,12 @@ import {
Sayable
,
log
,
}
from
'
./config
'
import
{
Contact
}
from
'
./contact
'
import
Contact
from
'
./contact
'
import
{
Message
,
MediaMessage
,
}
from
'
./message
'
import
{
UtilLib
}
from
'
./util-lib
'
import
UtilLib
from
'
./util-lib
'
type
RoomObj
=
{
id
:
string
,
...
...
@@ -584,3 +584,5 @@ export class Room extends EventEmitter implements Sayable {
}
}
export
default
Room
src/state-monitor.spec.ts
浏览文件 @
1b8c7359
...
...
@@ -12,7 +12,7 @@
*/
import
test
from
'
ava
'
import
{
StateMonitor
}
from
'
./state-monitor
'
import
StateMonitor
from
'
./state-monitor
'
test
(
'
StateMonitor target/current & stable
'
,
t
=>
{
const
CLIENT_NAME
=
'
StateMonitorTest
'
...
...
src/state-monitor.ts
浏览文件 @
1b8c7359
...
...
@@ -117,3 +117,5 @@ export class StateMonitor <A, B>{
return
this
.
_client
}
}
export
default
StateMonitor
src/util-lib.spec.ts
浏览文件 @
1b8c7359
...
...
@@ -8,7 +8,7 @@
import
{
test
}
from
'
ava
'
import
*
as
express
from
'
express
'
import
{
UtilLib
}
from
'
./util-lib
'
import
UtilLib
from
'
./util-lib
'
// import * as http from 'http'
...
...
src/util-lib.ts
浏览文件 @
1b8c7359
...
...
@@ -283,3 +283,5 @@ export class UtilLib {
}
}
}
export
default
UtilLib
test/contact.spec.ts
浏览文件 @
1b8c7359
...
...
@@ -6,9 +6,9 @@
*
*/
import
{
test
}
from
'
ava
'
import
{
Config
}
from
'
../src/config
'
import
{
Contact
}
from
'
../src/contact
'
import
{
PuppetWeb
}
from
'
../src/puppet-web
'
import
Config
from
'
../src/config
'
import
Contact
from
'
../src/contact
'
import
PuppetWeb
from
'
../src/puppet-web
'
Config
.
puppetInstance
(
new
PuppetWeb
())
...
...
test/docker.spec.ts
浏览文件 @
1b8c7359
...
...
@@ -11,7 +11,7 @@ import * as fs from 'fs'
// import { execSync } from 'child_process'
// import * as sinon from 'sinon'
import
{
Config
}
from
'
../src/config
'
import
Config
from
'
../src/config
'
/**
* need keep this !Config.isDocker because ava need at least one test() inside.
...
...
test/puppet-web/puppet-web.spec.ts
浏览文件 @
1b8c7359
...
...
@@ -12,8 +12,8 @@ import {
log
,
}
from
'
../../src/config
'
// import { Message } from '../../src/message'
import
{
PuppetWeb
}
from
'
../../src/puppet-web
'
import
{
Server
}
from
'
../../src/puppet-web/server
'
import
PuppetWeb
from
'
../../src/puppet-web
'
import
Server
from
'
../../src/puppet-web/server
'
// import { spy } from 'sinon'
...
...
test/puppet-web/server.spec.ts
浏览文件 @
1b8c7359
...
...
@@ -11,8 +11,8 @@ import * as https from 'https'
import
*
as
sinon
from
'
sinon
'
import
{
Server
}
from
'
../../src/puppet-web/
'
import
{
UtilLib
}
from
'
../../src/util-lib
'
import
{
log
}
from
'
../../src/config
'
import
UtilLib
from
'
../../src/util-lib
'
import
log
from
'
../../src/brolog-env
'
test
(
'
create & close
'
,
async
t
=>
{
const
port
=
await
UtilLib
.
getPort
(
18788
)
...
...
test/puppet-web/watchdog.spec.ts
浏览文件 @
1b8c7359
...
...
@@ -11,7 +11,7 @@ import * as sinon from 'sinon'
/* tslint:disable:no-var-requires */
const
retryPromise
=
require
(
'
retry-promise
'
).
default
import
{
log
}
from
'
../../src/config
'
import
log
from
'
../../src/brolog-env
'
import
{
PuppetWeb
,
...
...
test/room.spec.ts
浏览文件 @
1b8c7359
...
...
@@ -7,10 +7,10 @@
*/
import
{
test
}
from
'
ava
'
import
{
Config
}
from
'
../src/config
'
import
{
Contact
}
from
'
../src/contact
'
import
{
PuppetWeb
}
from
'
../src/puppet-web
'
import
{
Room
}
from
'
../src/room
'
import
Config
from
'
../src/config
'
import
Contact
from
'
../src/contact
'
import
PuppetWeb
from
'
../src/puppet-web
'
import
Room
from
'
../src/room
'
Config
.
puppetInstance
(
new
PuppetWeb
())
// Room.attach(new PuppetWeb())
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录