@juzi/wechaty-puppet-service 1.0.67 → 1.0.69
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/cjs/src/client/puppet-service.d.ts +3 -11
- package/dist/cjs/src/client/puppet-service.d.ts.map +1 -1
- package/dist/cjs/src/client/puppet-service.js +24 -19
- package/dist/cjs/src/client/puppet-service.js.map +1 -1
- package/dist/cjs/src/package-json.d.ts.map +1 -1
- package/dist/cjs/src/package-json.js +3 -4
- package/dist/cjs/src/package-json.js.map +1 -1
- package/dist/cjs/src/server/event-stream-manager.d.ts.map +1 -1
- package/dist/cjs/src/server/event-stream-manager.js +7 -0
- package/dist/cjs/src/server/event-stream-manager.js.map +1 -1
- package/dist/cjs/src/server/puppet-implementation.d.ts.map +1 -1
- package/dist/cjs/src/server/puppet-implementation.js +36 -0
- package/dist/cjs/src/server/puppet-implementation.js.map +1 -1
- package/dist/esm/src/client/puppet-service.d.ts +3 -11
- package/dist/esm/src/client/puppet-service.d.ts.map +1 -1
- package/dist/esm/src/client/puppet-service.js +24 -21
- package/dist/esm/src/client/puppet-service.js.map +1 -1
- package/dist/esm/src/package-json.d.ts.map +1 -1
- package/dist/esm/src/package-json.js +3 -4
- package/dist/esm/src/package-json.js.map +1 -1
- package/dist/esm/src/server/event-stream-manager.d.ts.map +1 -1
- package/dist/esm/src/server/event-stream-manager.js +7 -0
- package/dist/esm/src/server/event-stream-manager.js.map +1 -1
- package/dist/esm/src/server/puppet-implementation.d.ts.map +1 -1
- package/dist/esm/src/server/puppet-implementation.js +36 -0
- package/dist/esm/src/server/puppet-implementation.js.map +1 -1
- package/package.json +3 -4
- package/src/client/puppet-service.ts +40 -35
- package/src/package-json.ts +3 -4
- package/src/server/event-stream-manager.ts +7 -0
- package/src/server/puppet-implementation.ts +47 -0
- package/dist/cjs/src/client/duck/actions.d.ts +0 -6
- package/dist/cjs/src/client/duck/actions.d.ts.map +0 -1
- package/dist/cjs/src/client/duck/actions.js +0 -54
- package/dist/cjs/src/client/duck/actions.js.map +0 -1
- package/dist/cjs/src/client/duck/epic-recover.d.ts +0 -36
- package/dist/cjs/src/client/duck/epic-recover.d.ts.map +0 -1
- package/dist/cjs/src/client/duck/epic-recover.js +0 -41
- package/dist/cjs/src/client/duck/epic-recover.js.map +0 -1
- package/dist/cjs/src/client/duck/epic-recover.spec.d.ts +0 -3
- package/dist/cjs/src/client/duck/epic-recover.spec.d.ts.map +0 -1
- package/dist/cjs/src/client/duck/epic-recover.spec.js +0 -131
- package/dist/cjs/src/client/duck/epic-recover.spec.js.map +0 -1
- package/dist/cjs/src/client/duck/epics.d.ts +0 -4
- package/dist/cjs/src/client/duck/epics.d.ts.map +0 -1
- package/dist/cjs/src/client/duck/epics.js +0 -36
- package/dist/cjs/src/client/duck/epics.js.map +0 -1
- package/dist/cjs/src/client/duck/mod.d.ts +0 -29
- package/dist/cjs/src/client/duck/mod.d.ts.map +0 -1
- package/dist/cjs/src/client/duck/mod.js +0 -63
- package/dist/cjs/src/client/duck/mod.js.map +0 -1
- package/dist/cjs/src/client/duck/operations.d.ts +0 -23
- package/dist/cjs/src/client/duck/operations.d.ts.map +0 -1
- package/dist/cjs/src/client/duck/operations.js +0 -30
- package/dist/cjs/src/client/duck/operations.js.map +0 -1
- package/dist/cjs/src/client/duck/reducers.d.ts +0 -59
- package/dist/cjs/src/client/duck/reducers.d.ts.map +0 -1
- package/dist/cjs/src/client/duck/reducers.js +0 -51
- package/dist/cjs/src/client/duck/reducers.js.map +0 -1
- package/dist/cjs/src/client/duck/selectors.d.ts +0 -21
- package/dist/cjs/src/client/duck/selectors.d.ts.map +0 -1
- package/dist/cjs/src/client/duck/selectors.js +0 -23
- package/dist/cjs/src/client/duck/selectors.js.map +0 -1
- package/dist/cjs/src/client/duck/tests.spec.d.ts +0 -3
- package/dist/cjs/src/client/duck/tests.spec.d.ts.map +0 -1
- package/dist/cjs/src/client/duck/tests.spec.js +0 -49
- package/dist/cjs/src/client/duck/tests.spec.js.map +0 -1
- package/dist/cjs/src/client/duck/types.d.ts +0 -21
- package/dist/cjs/src/client/duck/types.d.ts.map +0 -1
- package/dist/cjs/src/client/duck/types.js +0 -24
- package/dist/cjs/src/client/duck/types.js.map +0 -1
- package/dist/cjs/src/client/duck/utils.d.ts +0 -21
- package/dist/cjs/src/client/duck/utils.d.ts.map +0 -1
- package/dist/cjs/src/client/duck/utils.js +0 -3
- package/dist/cjs/src/client/duck/utils.js.map +0 -1
- package/dist/esm/src/client/duck/actions.d.ts +0 -6
- package/dist/esm/src/client/duck/actions.d.ts.map +0 -1
- package/dist/esm/src/client/duck/actions.js +0 -28
- package/dist/esm/src/client/duck/actions.js.map +0 -1
- package/dist/esm/src/client/duck/epic-recover.d.ts +0 -36
- package/dist/esm/src/client/duck/epic-recover.d.ts.map +0 -1
- package/dist/esm/src/client/duck/epic-recover.js +0 -36
- package/dist/esm/src/client/duck/epic-recover.js.map +0 -1
- package/dist/esm/src/client/duck/epic-recover.spec.d.ts +0 -3
- package/dist/esm/src/client/duck/epic-recover.spec.d.ts.map +0 -1
- package/dist/esm/src/client/duck/epic-recover.spec.js +0 -126
- package/dist/esm/src/client/duck/epic-recover.spec.js.map +0 -1
- package/dist/esm/src/client/duck/epics.d.ts +0 -4
- package/dist/esm/src/client/duck/epics.d.ts.map +0 -1
- package/dist/esm/src/client/duck/epics.js +0 -33
- package/dist/esm/src/client/duck/epics.js.map +0 -1
- package/dist/esm/src/client/duck/mod.d.ts +0 -29
- package/dist/esm/src/client/duck/mod.d.ts.map +0 -1
- package/dist/esm/src/client/duck/mod.js +0 -29
- package/dist/esm/src/client/duck/mod.js.map +0 -1
- package/dist/esm/src/client/duck/operations.d.ts +0 -23
- package/dist/esm/src/client/duck/operations.d.ts.map +0 -1
- package/dist/esm/src/client/duck/operations.js +0 -4
- package/dist/esm/src/client/duck/operations.js.map +0 -1
- package/dist/esm/src/client/duck/reducers.d.ts +0 -59
- package/dist/esm/src/client/duck/reducers.d.ts.map +0 -1
- package/dist/esm/src/client/duck/reducers.js +0 -26
- package/dist/esm/src/client/duck/reducers.js.map +0 -1
- package/dist/esm/src/client/duck/selectors.d.ts +0 -21
- package/dist/esm/src/client/duck/selectors.d.ts.map +0 -1
- package/dist/esm/src/client/duck/selectors.js +0 -22
- package/dist/esm/src/client/duck/selectors.js.map +0 -1
- package/dist/esm/src/client/duck/tests.spec.d.ts +0 -3
- package/dist/esm/src/client/duck/tests.spec.d.ts.map +0 -1
- package/dist/esm/src/client/duck/tests.spec.js +0 -24
- package/dist/esm/src/client/duck/tests.spec.js.map +0 -1
- package/dist/esm/src/client/duck/types.d.ts +0 -21
- package/dist/esm/src/client/duck/types.d.ts.map +0 -1
- package/dist/esm/src/client/duck/types.js +0 -21
- package/dist/esm/src/client/duck/types.js.map +0 -1
- package/dist/esm/src/client/duck/utils.d.ts +0 -21
- package/dist/esm/src/client/duck/utils.d.ts.map +0 -1
- package/dist/esm/src/client/duck/utils.js +0 -2
- package/dist/esm/src/client/duck/utils.js.map +0 -1
- package/src/client/duck/actions.ts +0 -31
- package/src/client/duck/epic-recover.spec.ts +0 -180
- package/src/client/duck/epic-recover.ts +0 -109
- package/src/client/duck/epics.ts +0 -53
- package/src/client/duck/mod.ts +0 -38
- package/src/client/duck/operations.ts +0 -28
- package/src/client/duck/reducers.ts +0 -36
- package/src/client/duck/selectors.ts +0 -27
- package/src/client/duck/tests.spec.ts +0 -25
- package/src/client/duck/types.ts +0 -20
- package/src/client/duck/utils.ts +0 -20
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wechaty Open Source Software - https://github.com/wechaty
|
|
3
|
-
*
|
|
4
|
-
* @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
|
|
5
|
-
* Wechaty Contributors <https://github.com/wechaty>.
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
import {
|
|
21
|
-
Observable,
|
|
22
|
-
interval,
|
|
23
|
-
timer,
|
|
24
|
-
} from 'rxjs'
|
|
25
|
-
import {
|
|
26
|
-
debounce,
|
|
27
|
-
filter,
|
|
28
|
-
map,
|
|
29
|
-
switchMap,
|
|
30
|
-
takeUntil,
|
|
31
|
-
tap,
|
|
32
|
-
} from 'rxjs/operators'
|
|
33
|
-
import {
|
|
34
|
-
isActionOf,
|
|
35
|
-
} from 'typesafe-actions'
|
|
36
|
-
import type {
|
|
37
|
-
// type Action,
|
|
38
|
-
AnyAction,
|
|
39
|
-
} from 'redux'
|
|
40
|
-
import {
|
|
41
|
-
Duck as PuppetDuck,
|
|
42
|
-
} from '@juzi/wechaty-redux'
|
|
43
|
-
import { log } from '@juzi/wechaty-puppet'
|
|
44
|
-
|
|
45
|
-
const stateActive$ = (action$: Observable<AnyAction>) => action$.pipe(
|
|
46
|
-
filter(isActionOf(PuppetDuck.actions.STATE_ACTIVATED_EVENT)),
|
|
47
|
-
filter(action => action.payload.state === true),
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
const stateInactive$ = (action$: Observable<AnyAction>) => action$.pipe(
|
|
51
|
-
filter(isActionOf(PuppetDuck.actions.STATE_INACTIVATED_EVENT)),
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
const heartbeat$ = (action$: Observable<AnyAction>) => action$.pipe(
|
|
55
|
-
filter(isActionOf([
|
|
56
|
-
PuppetDuck.actions.HEARTBEAT_RECEIVED_EVENT,
|
|
57
|
-
PuppetDuck.actions.DONG_RECEIVED_EVENT,
|
|
58
|
-
])),
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
// Emit once when an active puppet lost heartbeat after a timeout period
|
|
62
|
-
const monitorHeartbeat$ = (timeoutMilliseconds: number) =>
|
|
63
|
-
(action$: Observable<AnyAction>) =>
|
|
64
|
-
stateActive$(action$).pipe(
|
|
65
|
-
switchMap(action => heartbeat$(action$).pipe(
|
|
66
|
-
debounce(() => interval(timeoutMilliseconds)),
|
|
67
|
-
tap(() => log.verbose('PuppetService', 'monitorHeartbeat$() %d seconds TIMEOUT',
|
|
68
|
-
Math.floor(timeoutMilliseconds / 1000),
|
|
69
|
-
)),
|
|
70
|
-
map(() => PuppetDuck.actions.ERROR_RECEIVED_EVENT(
|
|
71
|
-
action.meta.puppetId,
|
|
72
|
-
{ gerror: `monitorHeartbeat$() TIMEOUT(${timeoutMilliseconds})` },
|
|
73
|
-
)),
|
|
74
|
-
)),
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
const epicRecoverDing$ = (timeoutMilliseconds: number) =>
|
|
78
|
-
(action$: Observable<AnyAction>) =>
|
|
79
|
-
monitorHeartbeat$(timeoutMilliseconds)(action$).pipe(
|
|
80
|
-
switchMap(action => timer(0, Math.floor(timeoutMilliseconds)).pipe(
|
|
81
|
-
tap(n => log.verbose('PuppetService', 'epicRecoverDing$() actions.ding() emitted #%d', n)),
|
|
82
|
-
map(() => PuppetDuck.actions.DING_COMMAND(
|
|
83
|
-
action.meta.puppetId,
|
|
84
|
-
'epicRecoverDing$',
|
|
85
|
-
)),
|
|
86
|
-
takeUntil(heartbeat$(action$)),
|
|
87
|
-
takeUntil(stateInactive$(action$)),
|
|
88
|
-
)),
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
const epicRecoverReset$ = (timeoutMilliseconds: number) =>
|
|
92
|
-
(action$: Observable<AnyAction>) =>
|
|
93
|
-
monitorHeartbeat$(timeoutMilliseconds)(action$).pipe(
|
|
94
|
-
switchMap(action => timer(0, timeoutMilliseconds * 2).pipe(
|
|
95
|
-
tap(n => log.verbose('PuppetService', 'epicRecoverReset$() actions.reset() emitted #%d', n)),
|
|
96
|
-
map(() => PuppetDuck.actions.RESET_COMMAND(
|
|
97
|
-
action.meta.puppetId,
|
|
98
|
-
'epicRecoverReset$',
|
|
99
|
-
)),
|
|
100
|
-
takeUntil(heartbeat$(action$)),
|
|
101
|
-
takeUntil(stateInactive$(action$)),
|
|
102
|
-
)),
|
|
103
|
-
)
|
|
104
|
-
|
|
105
|
-
export {
|
|
106
|
-
monitorHeartbeat$,
|
|
107
|
-
epicRecoverReset$,
|
|
108
|
-
epicRecoverDing$,
|
|
109
|
-
}
|
package/src/client/duck/epics.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wechaty Open Source Software - https://github.com/wechaty
|
|
3
|
-
*
|
|
4
|
-
* @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
|
|
5
|
-
* Wechaty Contributors <https://github.com/wechaty>.
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
import {
|
|
21
|
-
Observable,
|
|
22
|
-
merge,
|
|
23
|
-
} from 'rxjs'
|
|
24
|
-
import type {
|
|
25
|
-
AnyAction,
|
|
26
|
-
} from 'redux'
|
|
27
|
-
import type {
|
|
28
|
-
Epic,
|
|
29
|
-
} from 'redux-observable'
|
|
30
|
-
|
|
31
|
-
import {
|
|
32
|
-
epicRecoverDing$,
|
|
33
|
-
epicRecoverReset$,
|
|
34
|
-
} from './epic-recover.js'
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* The GRPC keepalive timeout is 20 seconds
|
|
38
|
-
* So we use 15 seconds to save the GRPC keepalive cost
|
|
39
|
-
*
|
|
40
|
-
* https://github.com/grpc/grpc/blob/master/doc/keepalive.md
|
|
41
|
-
* GRPC_ARG_KEEPALIVE_TIMEOUT_MS 20000 (20 seconds) 20000 (20 seconds)
|
|
42
|
-
*/
|
|
43
|
-
const TIMEOUT_SOFT = 15 * 1000
|
|
44
|
-
const TIMEOUT_HARD = Math.floor(4.5 * TIMEOUT_SOFT)
|
|
45
|
-
|
|
46
|
-
const recoverEpic: Epic = (action$: Observable<AnyAction>) => merge(
|
|
47
|
-
epicRecoverDing$(TIMEOUT_SOFT)(action$),
|
|
48
|
-
epicRecoverReset$(TIMEOUT_HARD)(action$),
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
export {
|
|
52
|
-
recoverEpic,
|
|
53
|
-
}
|
package/src/client/duck/mod.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wechaty Open Source Software - https://github.com/wechaty
|
|
3
|
-
*
|
|
4
|
-
* @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
|
|
5
|
-
* Wechaty Contributors <https://github.com/wechaty>.
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
import reducer from './reducers.js'
|
|
21
|
-
|
|
22
|
-
import * as actions from './actions.js'
|
|
23
|
-
import * as epics from './epics.js'
|
|
24
|
-
import * as operations from './operations.js'
|
|
25
|
-
import * as selectors from './selectors.js'
|
|
26
|
-
import * as types from './types.js'
|
|
27
|
-
import * as utils from './utils.js'
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
actions,
|
|
31
|
-
epics,
|
|
32
|
-
operations,
|
|
33
|
-
selectors,
|
|
34
|
-
types,
|
|
35
|
-
utils,
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export default reducer
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wechaty Open Source Software - https://github.com/wechaty
|
|
3
|
-
*
|
|
4
|
-
* @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
|
|
5
|
-
* Wechaty Contributors <https://github.com/wechaty>.
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
import type { Dispatch } from 'redux'
|
|
21
|
-
|
|
22
|
-
import * as actions from './actions.js'
|
|
23
|
-
|
|
24
|
-
const nop = (dispatch: Dispatch) => () => dispatch(actions.nop())
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
nop,
|
|
28
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wechaty Open Source Software - https://github.com/wechaty
|
|
3
|
-
*
|
|
4
|
-
* @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
|
|
5
|
-
* Wechaty Contributors <https://github.com/wechaty>.
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
import {
|
|
21
|
-
createReducer,
|
|
22
|
-
type ActionType,
|
|
23
|
-
} from 'typesafe-actions'
|
|
24
|
-
import type {
|
|
25
|
-
DeepReadonly,
|
|
26
|
-
} from 'utility-types'
|
|
27
|
-
|
|
28
|
-
import * as actions from './actions.js'
|
|
29
|
-
|
|
30
|
-
const initialState: DeepReadonly<{}> = {}
|
|
31
|
-
|
|
32
|
-
const reducer = createReducer<typeof initialState, ActionType<typeof actions>>(initialState)
|
|
33
|
-
.handleAction(actions.nop, (state, _action) => state)
|
|
34
|
-
|
|
35
|
-
export type State = ReturnType<typeof reducer>
|
|
36
|
-
export default reducer
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wechaty Open Source Software - https://github.com/wechaty
|
|
3
|
-
*
|
|
4
|
-
* @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
|
|
5
|
-
* Wechaty Contributors <https://github.com/wechaty>.
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
// import type { State } from './reducers.js'
|
|
21
|
-
|
|
22
|
-
// const getQrCode = (state: State) => (wechatyId: string) => state[wechatyId]?.qrcode
|
|
23
|
-
// const getCurrentUser = (state: State) => (wechatyId: string) => state[wechatyId]?.currentUser // PUPPET.payloads.Contact
|
|
24
|
-
// const isLoggedIn = (state: State) => (wechatyId: string) => state[wechatyId]?.currentUser !== undefined
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env -S node --no-warnings --loader ts-node/esm
|
|
2
|
-
/**
|
|
3
|
-
* Wechaty Open Source Software - https://github.com/wechaty
|
|
4
|
-
*
|
|
5
|
-
* @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
|
|
6
|
-
* Wechaty Contributors <https://github.com/wechaty>.
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
import { validateDuck } from 'ducks'
|
|
22
|
-
|
|
23
|
-
import * as Duck from './mod.js'
|
|
24
|
-
|
|
25
|
-
validateDuck(Duck)
|
package/src/client/duck/types.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wechaty Open Source Software - https://github.com/wechaty
|
|
3
|
-
*
|
|
4
|
-
* @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
|
|
5
|
-
* Wechaty Contributors <https://github.com/wechaty>.
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
export const NOP = 'wechaty-puppet-service/NOP'
|
package/src/client/duck/utils.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wechaty Open Source Software - https://github.com/wechaty
|
|
3
|
-
*
|
|
4
|
-
* @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
|
|
5
|
-
* Wechaty Contributors <https://github.com/wechaty>.
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
export {}
|