openclaw-openagent 1.0.1 → 1.0.2
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/index.d.ts +25 -0
- package/dist/index.js +105 -0
- package/dist/src/app/channel-tools.d.ts +28 -0
- package/dist/src/app/channel-tools.js +251 -0
- package/dist/src/app/discovery-tools.d.ts +35 -0
- package/dist/src/app/discovery-tools.js +243 -0
- package/dist/src/app/download-file-tool.d.ts +10 -0
- package/dist/src/app/download-file-tool.js +104 -0
- package/dist/src/app/hooks.d.ts +14 -0
- package/dist/src/app/hooks.js +118 -0
- package/dist/src/app/index.d.ts +13 -0
- package/dist/src/app/index.js +44 -0
- package/dist/src/app/messaging-tools.d.ts +11 -0
- package/dist/src/app/messaging-tools.js +79 -0
- package/dist/src/app/ops-tools.d.ts +21 -0
- package/dist/src/app/ops-tools.js +158 -0
- package/dist/src/app/remote-agent-tool.d.ts +27 -0
- package/dist/src/app/remote-agent-tool.js +461 -0
- package/dist/src/app/types.d.ts +61 -0
- package/dist/src/app/types.js +11 -0
- package/dist/src/app/upload-file-tool.d.ts +16 -0
- package/dist/src/app/upload-file-tool.js +353 -0
- package/dist/src/app/verbose-preflight.d.ts +2 -0
- package/dist/src/app/verbose-preflight.js +145 -0
- package/dist/src/auth/config.d.ts +79 -0
- package/dist/src/auth/config.js +133 -0
- package/dist/src/auth/credential-manager.d.ts +65 -0
- package/dist/src/auth/credential-manager.js +122 -0
- package/dist/src/auth/index.d.ts +6 -0
- package/dist/src/auth/index.js +6 -0
- package/dist/src/auth/verify.d.ts +42 -0
- package/dist/src/auth/verify.js +60 -0
- package/dist/src/channel.d.ts +269 -0
- package/dist/src/channel.js +488 -0
- package/dist/src/compat.d.ts +37 -0
- package/dist/src/compat.js +70 -0
- package/dist/src/config/config-schema.d.ts +56 -0
- package/dist/src/config/config-schema.js +34 -0
- package/dist/src/messaging/aggregator.d.ts +25 -0
- package/dist/src/messaging/aggregator.js +90 -0
- package/dist/src/messaging/collector.d.ts +27 -0
- package/dist/src/messaging/collector.js +76 -0
- package/dist/src/messaging/executor.d.ts +14 -0
- package/dist/src/messaging/executor.js +59 -0
- package/dist/src/messaging/inbound.d.ts +97 -0
- package/dist/src/messaging/inbound.js +63 -0
- package/dist/src/messaging/index.d.ts +10 -0
- package/dist/src/messaging/index.js +9 -0
- package/dist/src/messaging/mention-protocol.d.ts +42 -0
- package/dist/src/messaging/mention-protocol.js +74 -0
- package/dist/src/messaging/process-c2c-request.d.ts +55 -0
- package/dist/src/messaging/process-c2c-request.js +445 -0
- package/dist/src/messaging/process-message.d.ts +62 -0
- package/dist/src/messaging/process-message.js +282 -0
- package/dist/src/messaging/scheduler.d.ts +17 -0
- package/dist/src/messaging/scheduler.js +47 -0
- package/dist/src/messaging/types.d.ts +34 -0
- package/dist/src/messaging/types.js +4 -0
- package/dist/src/plugin-ui/assets/openagent-override.js +9267 -0
- package/dist/src/plugin-ui/index.d.ts +13 -0
- package/dist/src/plugin-ui/index.js +16 -0
- package/dist/src/plugin-ui/ui-extension-loader/backup.d.ts +23 -0
- package/dist/src/plugin-ui/ui-extension-loader/backup.js +82 -0
- package/dist/src/plugin-ui/ui-extension-loader/index.d.ts +28 -0
- package/dist/src/plugin-ui/ui-extension-loader/index.js +240 -0
- package/dist/src/plugin-ui/ui-extension-loader/locator.d.ts +35 -0
- package/dist/src/plugin-ui/ui-extension-loader/locator.js +129 -0
- package/dist/src/plugin-ui/ui-extension-loader/manifest.d.ts +26 -0
- package/dist/src/plugin-ui/ui-extension-loader/manifest.js +45 -0
- package/dist/src/plugin-ui/ui-extension-loader/registry-regex.d.ts +9 -0
- package/dist/src/plugin-ui/ui-extension-loader/registry-regex.js +701 -0
- package/dist/src/plugin-ui/ui-extension-loader/removed-extensions.d.ts +8 -0
- package/dist/src/plugin-ui/ui-extension-loader/removed-extensions.js +58 -0
- package/dist/src/plugin-ui/ui-extension-loader/types.d.ts +55 -0
- package/dist/src/plugin-ui/ui-extension-loader/types.js +23 -0
- package/dist/src/proxy/auth-proxy.d.ts +20 -0
- package/dist/src/proxy/auth-proxy.js +337 -0
- package/dist/src/runtime/account.d.ts +156 -0
- package/dist/src/runtime/account.js +491 -0
- package/dist/src/runtime/index.d.ts +5 -0
- package/dist/src/runtime/index.js +6 -0
- package/dist/src/runtime/plugin-runtime.d.ts +40 -0
- package/dist/src/runtime/plugin-runtime.js +72 -0
- package/dist/src/runtime/registry.d.ts +41 -0
- package/dist/src/runtime/registry.js +60 -0
- package/dist/src/sdk/CLASS_MAP.md +143 -0
- package/dist/src/sdk/index.d.ts +126 -0
- package/dist/src/sdk/index.js +23990 -0
- package/dist/src/sdk/modules/cloud-search-module.js +1117 -0
- package/dist/src/sdk/modules/follow-module.js +1069 -0
- package/dist/src/sdk/modules/group-module.js +7397 -0
- package/dist/src/sdk/modules/relationship-module.js +2269 -0
- package/dist/src/sdk/modules/signaling-module.js +1468 -0
- package/dist/src/sdk/modules/tim-upload-plugin.js +730 -0
- package/dist/src/sdk/node-env/http-request.js +90 -0
- package/dist/src/sdk/node-env/index.js +57 -0
- package/dist/src/sdk/node-env/storage.js +114 -0
- package/dist/src/sdk/package.json +10 -0
- package/dist/src/sdk/sdk/CLASS_MAP.md +143 -0
- package/dist/src/sdk/sdk/index.d.ts +126 -0
- package/dist/src/sdk/sdk/index.js +23990 -0
- package/dist/src/sdk/sdk/modules/cloud-search-module.js +1117 -0
- package/dist/src/sdk/sdk/modules/follow-module.js +1069 -0
- package/dist/src/sdk/sdk/modules/group-module.js +7397 -0
- package/dist/src/sdk/sdk/modules/relationship-module.js +2269 -0
- package/dist/src/sdk/sdk/modules/signaling-module.js +1468 -0
- package/dist/src/sdk/sdk/modules/tim-upload-plugin.js +730 -0
- package/dist/src/sdk/sdk/node-env/http-request.js +90 -0
- package/dist/src/sdk/sdk/node-env/index.js +57 -0
- package/dist/src/sdk/sdk/node-env/storage.js +114 -0
- package/dist/src/sdk/sdk/package.json +10 -0
- package/dist/src/sdk/sdk/tsconfig.json +16 -0
- package/dist/src/sdk/tsconfig.json +16 -0
- package/dist/src/state/pending-invocation-store.d.ts +26 -0
- package/dist/src/state/pending-invocation-store.js +39 -0
- package/dist/src/state/store.d.ts +165 -0
- package/dist/src/state/store.js +535 -0
- package/dist/src/tim/c2c.d.ts +83 -0
- package/dist/src/tim/c2c.js +318 -0
- package/dist/src/tim/channels.d.ts +95 -0
- package/dist/src/tim/channels.js +279 -0
- package/dist/src/tim/client.d.ts +54 -0
- package/dist/src/tim/client.js +268 -0
- package/dist/src/tim/index.d.ts +6 -0
- package/dist/src/tim/index.js +6 -0
- package/dist/src/tim/messages.d.ts +50 -0
- package/dist/src/tim/messages.js +104 -0
- package/dist/src/tim/sdk-logger-init.d.ts +13 -0
- package/dist/src/tim/sdk-logger-init.js +46 -0
- package/dist/src/tools.d.ts +9 -0
- package/dist/src/tools.js +8 -0
- package/dist/src/transport/factory.d.ts +63 -0
- package/dist/src/transport/factory.js +54 -0
- package/dist/src/transport/oasn/index.d.ts +12 -0
- package/dist/src/transport/oasn/index.js +9 -0
- package/dist/src/transport/oasn/oasn-agent-card.d.ts +38 -0
- package/dist/src/transport/oasn/oasn-agent-card.js +102 -0
- package/dist/src/transport/oasn/oasn-discovery.d.ts +33 -0
- package/dist/src/transport/oasn/oasn-discovery.js +97 -0
- package/dist/src/transport/oasn/oasn-files.d.ts +64 -0
- package/dist/src/transport/oasn/oasn-files.js +174 -0
- package/dist/src/transport/oasn/oasn-http.d.ts +98 -0
- package/dist/src/transport/oasn/oasn-http.js +362 -0
- package/dist/src/transport/oasn/oasn-invocation.d.ts +154 -0
- package/dist/src/transport/oasn/oasn-invocation.js +432 -0
- package/dist/src/transport/oasn/oasn-normalize.d.ts +6 -0
- package/dist/src/transport/oasn/oasn-normalize.js +112 -0
- package/dist/src/transport/oasn/oasn-register.d.ts +19 -0
- package/dist/src/transport/oasn/oasn-register.js +24 -0
- package/dist/src/transport/oasn/oasn-transport.d.ts +114 -0
- package/dist/src/transport/oasn/oasn-transport.js +230 -0
- package/dist/src/transport/oasn/oasn-types.d.ts +331 -0
- package/dist/src/transport/oasn/oasn-types.js +44 -0
- package/dist/src/transport/tim/index.d.ts +7 -0
- package/dist/src/transport/tim/index.js +6 -0
- package/dist/src/transport/tim/tim-transport.d.ts +122 -0
- package/dist/src/transport/tim/tim-transport.js +402 -0
- package/dist/src/transport/types.d.ts +450 -0
- package/dist/src/transport/types.js +38 -0
- package/dist/src/util/http.d.ts +21 -0
- package/dist/src/util/http.js +93 -0
- package/dist/src/util/logger.d.ts +20 -0
- package/dist/src/util/logger.js +100 -0
- package/dist/src/util/url-resolver.d.ts +7 -0
- package/dist/src/util/url-resolver.js +20 -0
- package/index.ts +11 -0
- package/openclaw.plugin.json +9 -0
- package/package.json +7 -4
- package/src/app/download-file-tool.ts +133 -0
- package/src/app/hooks.ts +89 -5
- package/src/app/index.ts +6 -0
- package/src/app/remote-agent-tool.ts +46 -0
- package/src/app/types.ts +1 -0
- package/src/app/upload-file-tool.ts +411 -0
- package/src/plugin-ui/assets/openagent-override.js +1 -63
- package/src/plugin-ui/modules/agent-book/panel/agent-book.js +0 -61
- package/src/plugin-ui/modules/agent-book/panel/agent-data.js +0 -1
- package/src/plugin-ui/ui-extension-loader/registry-regex.ts +30 -13
- package/src/runtime/account.ts +0 -23
- package/src/transport/oasn/oasn-files.ts +5 -5
- package/src/transport/oasn/oasn-invocation.ts +44 -2
- package/src/transport/oasn/oasn-normalize.ts +0 -26
- package/src/transport/oasn/oasn-register.ts +8 -81
- package/src/transport/oasn/oasn-transport.ts +9 -32
- package/src/transport/oasn/oasn-types.ts +53 -6
- package/src/transport/types.ts +33 -36
- package/src/util/url-resolver.ts +17 -0
|
@@ -0,0 +1,1069 @@
|
|
|
1
|
+
let t = 12,
|
|
2
|
+
e = 20,
|
|
3
|
+
s = 23,
|
|
4
|
+
o = 27;
|
|
5
|
+
class n {
|
|
6
|
+
constructor(t = 0, e = 0) {
|
|
7
|
+
((this.high = t), (this.low = e));
|
|
8
|
+
}
|
|
9
|
+
equal(t) {
|
|
10
|
+
return null !== t && this.low === t.low && this.high === t.high;
|
|
11
|
+
}
|
|
12
|
+
toString() {
|
|
13
|
+
var t = Number(this.high).toString(16);
|
|
14
|
+
let e = Number(this.low).toString(16);
|
|
15
|
+
if (e.length < 8) {
|
|
16
|
+
let t = 8 - e.length;
|
|
17
|
+
for (; t; ) ((e = "0" + e), t--);
|
|
18
|
+
}
|
|
19
|
+
return t + e;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
let i = {
|
|
23
|
+
TEST: {
|
|
24
|
+
CHINA: { DEFAULT: "wss://wss-dev.tim.qq.com" },
|
|
25
|
+
OVERSEA: { DEFAULT: "wss://wss-dev.tim.qq.com" },
|
|
26
|
+
SINGAPORE: { DEFAULT: "wss://wsssgp-dev.im.qcloud.com" },
|
|
27
|
+
KOREA: { DEFAULT: "wss://wsskr-dev.im.qcloud.com" },
|
|
28
|
+
GERMANY: { DEFAULT: "wss://wssger-dev.im.qcloud.com" },
|
|
29
|
+
IND: { DEFAULT: "wss://wssind-dev.im.qcloud.com" },
|
|
30
|
+
JPN: { DEFAULT: "wss://wssjpn-dev.im.qcloud.com" },
|
|
31
|
+
USA: { DEFAULT: "wss://wssusa-dev.im.qcloud.com" },
|
|
32
|
+
INDONESIA: { DEFAULT: "wss://wssidn-dev.im.qcloud.com" },
|
|
33
|
+
},
|
|
34
|
+
PRODUCTION: {
|
|
35
|
+
CHINA: {
|
|
36
|
+
DEFAULT0: "wss://*w4c.my-imcloud.com",
|
|
37
|
+
DEFAULT: "wss://wss.im.qcloud.com",
|
|
38
|
+
IPV6: "wss://wssv6.im.qcloud.com",
|
|
39
|
+
BACKUP: "wss://wss.tim.qq.com",
|
|
40
|
+
BACKUP_WEB: "wss://*w4c.my-cpaas.com",
|
|
41
|
+
BACKUP_CN: "wss://wss.im.tencent.cn",
|
|
42
|
+
STAT: "https://events.im.qcloud.com",
|
|
43
|
+
ANYCAST: "wss://162.14.13.203",
|
|
44
|
+
},
|
|
45
|
+
OVERSEA: {
|
|
46
|
+
DEFAULT0: "wss://*w4c.my-imcloud.com",
|
|
47
|
+
DEFAULT: "wss://wss.im.qcloud.com",
|
|
48
|
+
IPV6: "wss://wssv6.im.qcloud.com",
|
|
49
|
+
BACKUP: "wss://wss.my-imcloud.com",
|
|
50
|
+
BACKUP_WEB: "wss://*w4c.my-cpaas.com",
|
|
51
|
+
BACKUP_CN: "wss://wss.im.tencent.cn",
|
|
52
|
+
STAT: "https://api.my-imcloud.com",
|
|
53
|
+
},
|
|
54
|
+
SINGAPORE: {
|
|
55
|
+
DEFAULT0: "wss://*w4s.my-imcloud.com",
|
|
56
|
+
DEFAULT: "wss://wsssgp.im.qcloud.com",
|
|
57
|
+
IPV6: "wss://wsssgpv6.im.qcloud.com",
|
|
58
|
+
BACKUP: "wss://wsssgp.my-imcloud.com",
|
|
59
|
+
BACKUP_WEB: "wss://*w4s.my-cpaas.com",
|
|
60
|
+
STAT: "https://apisgp.my-imcloud.com",
|
|
61
|
+
ANYCAST: "wss://162.14.19.159",
|
|
62
|
+
},
|
|
63
|
+
KOREA: {
|
|
64
|
+
DEFAULT0: "wss://*w4k.my-imcloud.com",
|
|
65
|
+
DEFAULT: "wss://wsskr.im.qcloud.com",
|
|
66
|
+
IPV6: "wss://wsskrv6.im.qcloud.com",
|
|
67
|
+
BACKUP: "wss://wsskr.my-imcloud.com",
|
|
68
|
+
BACKUP_WEB: "wss://*w4k.my-cpaas.com",
|
|
69
|
+
STAT: "https://apikr.my-imcloud.com",
|
|
70
|
+
ANYCAST: "wss://162.14.13.104",
|
|
71
|
+
},
|
|
72
|
+
GERMANY: {
|
|
73
|
+
DEFAULT0: "wss://*w4g.my-imcloud.com",
|
|
74
|
+
DEFAULT: "wss://wssger.im.qcloud.com",
|
|
75
|
+
IPV6: "wss://wssgerv6.im.qcloud.com",
|
|
76
|
+
BACKUP: "wss://wssger.my-imcloud.com",
|
|
77
|
+
BACKUP_WEB: "wss://*w4g.my-cpaas.com",
|
|
78
|
+
STAT: "https://apiger.my-imcloud.com",
|
|
79
|
+
ANYCAST: "wss://162.14.3.17",
|
|
80
|
+
},
|
|
81
|
+
IND: {
|
|
82
|
+
DEFAULT0: "wss://*w4i.my-imcloud.com",
|
|
83
|
+
DEFAULT: "wss://wssind.my-imcloud.com",
|
|
84
|
+
IPV6: "wss://wssindv6.im.qcloud.com",
|
|
85
|
+
BACKUP: "wss://wssind.im.qcloud.com",
|
|
86
|
+
BACKUP_WEB: "wss://*w4i.my-cpaas.com",
|
|
87
|
+
STAT: "https://apiind.my-imcloud.com",
|
|
88
|
+
ANYCAST: "wss://162.14.19.46",
|
|
89
|
+
},
|
|
90
|
+
JPN: {
|
|
91
|
+
DEFAULT0: "wss://*w4j.my-imcloud.com",
|
|
92
|
+
DEFAULT: "wss://wssjpn.im.qcloud.com",
|
|
93
|
+
IPV6: "wss://wssjpnv6.im.qcloud.com",
|
|
94
|
+
BACKUP: "wss://wssjpn.my-imcloud.com",
|
|
95
|
+
BACKUP_WEB: "wss://*w4j.my-cpaas.com",
|
|
96
|
+
STAT: "https://apijpn.my-imcloud.com",
|
|
97
|
+
ANYCAST: "wss://162.14.13.254",
|
|
98
|
+
},
|
|
99
|
+
USA: {
|
|
100
|
+
DEFAULT0: "wss://*w4u.my-imcloud.com",
|
|
101
|
+
DEFAULT: "wss://wssusa.im.qcloud.com",
|
|
102
|
+
IPV6: "wss://wssusav6.im.qcloud.com",
|
|
103
|
+
BACKUP: "wss://wssusa.my-imcloud.com",
|
|
104
|
+
BACKUP_WEB: "wss://*w4u.my-cpaas.com",
|
|
105
|
+
STAT: "https://apiusa.my-imcloud.com",
|
|
106
|
+
ANYCAST: "wss://162.14.10.42",
|
|
107
|
+
},
|
|
108
|
+
INDONESIA: {
|
|
109
|
+
DEFAULT0: "wss://*w4y.my-imcloud.com",
|
|
110
|
+
DEFAULT: "wss://wssidn.im.qcloud.com",
|
|
111
|
+
IPV6: "wss://wssidnv6.im.qcloud.com",
|
|
112
|
+
BACKUP: "wss://wssidn.my-imcloud.com",
|
|
113
|
+
BACKUP_WEB: "wss://*w4y.my-cpaas.com",
|
|
114
|
+
STAT: "https://apiidn.my-imcloud.com",
|
|
115
|
+
ANYCAST: "wss://43.129.34.169",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
r = {
|
|
120
|
+
ANDROID: 2,
|
|
121
|
+
IOS: 3,
|
|
122
|
+
MAC: 4,
|
|
123
|
+
WEB: 7,
|
|
124
|
+
WX_MP: 8,
|
|
125
|
+
QQ_MP: 9,
|
|
126
|
+
TT_MP: 10,
|
|
127
|
+
BAIDU_MP: 11,
|
|
128
|
+
ALI_MP: 12,
|
|
129
|
+
IPAD: 13,
|
|
130
|
+
UNI_NATIVE_APP: 15,
|
|
131
|
+
DONUT_NATIVE_APP: 19,
|
|
132
|
+
NS_NATIVE_APP: 20,
|
|
133
|
+
RN_NATIVE_APP: 21,
|
|
134
|
+
},
|
|
135
|
+
l = "CHINA",
|
|
136
|
+
c = {
|
|
137
|
+
HOST: {
|
|
138
|
+
CURRENT: {
|
|
139
|
+
DEFAULT: "wss://wss.im.qcloud.com",
|
|
140
|
+
STAT: "https://events.im.qcloud.com",
|
|
141
|
+
},
|
|
142
|
+
setCurrent(t = l) {
|
|
143
|
+
this.CURRENT = i.PRODUCTION[t];
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
NAME: {
|
|
147
|
+
OPEN_IM: "openim",
|
|
148
|
+
OPEN_IM_MSG_EXT: "openim_msg_ext_http_svc",
|
|
149
|
+
GRP: "group_open_http_svc",
|
|
150
|
+
GRP_AV: "group_open_avchatroom_http_svc",
|
|
151
|
+
GRP_COMMUNITY: "million_group_open_http_svc",
|
|
152
|
+
GRP_ATTR: "group_open_attr_http_svc",
|
|
153
|
+
FD: "sns",
|
|
154
|
+
PROFILE: "profile",
|
|
155
|
+
RECENT_CONTACT: "recentcontact",
|
|
156
|
+
PIC: "openpic",
|
|
157
|
+
BIG_GRP_NO_AUTH: "group_open_http_noauth_svc",
|
|
158
|
+
BIG_GRP_POLLING: "group_open_long_polling_http_svc",
|
|
159
|
+
BIG_GRP_POLLING_NO_AUTH: "group_open_long_polling_http_noauth_svc",
|
|
160
|
+
IM_OPEN_STAT: "imopenstat",
|
|
161
|
+
WEB_IM: "webim",
|
|
162
|
+
IM_COS_SIGN: "im_cos_sign_svr",
|
|
163
|
+
CUSTOM_UPLOAD: "im_cos_msg",
|
|
164
|
+
HEARTBEAT: "heartbeat",
|
|
165
|
+
IM_OPEN_PUSH: "im_open_push",
|
|
166
|
+
IM_OPEN_STATUS: "im_open_status",
|
|
167
|
+
IM_LONG_MSG: "im_long_msg",
|
|
168
|
+
IM_CONFIG_MANAGER: "im_sdk_config_mgr",
|
|
169
|
+
STAT_SERVICE: "StatSvc",
|
|
170
|
+
OVERLOAD_PUSH: "OverLoadPush",
|
|
171
|
+
IM_MSG_AUDIT_MGR: "im_msg_audit_mgr",
|
|
172
|
+
TUIROOM_SVR: "tui_room_svr",
|
|
173
|
+
IM_OPEN_TRANSLATE: "im_open_translate",
|
|
174
|
+
IM_OPEN_SPEECH: "im_open_speech",
|
|
175
|
+
MSG_SEARCH: "message_search",
|
|
176
|
+
GRP_SEARCH: "group_search",
|
|
177
|
+
GRP_MEMBER_SEARCH: "group_member_search",
|
|
178
|
+
USER_SEARCH: "user_search",
|
|
179
|
+
FOLLOW: "follow",
|
|
180
|
+
OFFLINE_PUSH_REPORT: "offline_push_report",
|
|
181
|
+
IM_MSG_LOGIC: "im_msg_db_logic",
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
u = {
|
|
185
|
+
SEARCH_GRP_SNS: new n(0, Math.pow(2, 1)).toString(),
|
|
186
|
+
AV_HISTORY_MSG: new n(0, Math.pow(2, 2)).toString(),
|
|
187
|
+
GRP_COMMUNITY: new n(0, Math.pow(2, 3)).toString(),
|
|
188
|
+
MSG_TO_SPECIFIED_GRP_MBR: new n(0, Math.pow(2, 4)).toString(),
|
|
189
|
+
AV_MBR_LIST: new n(0, Math.pow(2, 6)).toString(),
|
|
190
|
+
USER_STATUS: new n(0, Math.pow(2, 7)).toString(),
|
|
191
|
+
CONV_MARK: new n(0, Math.pow(2, 9)).toString(),
|
|
192
|
+
CONV_GROUP: new n(0, Math.pow(2, 10)).toString(),
|
|
193
|
+
AV_BAN_MBR: new n(0, Math.pow(2, 11)).toString(),
|
|
194
|
+
MSG_EXT: new n(0, Math.pow(2, 13)).toString(),
|
|
195
|
+
GRP_COUNTER: new n(0, Math.pow(2, 15)).toString(),
|
|
196
|
+
PLUGIN_TRANSLATE: new n(Math.pow(2, 6)).toString(),
|
|
197
|
+
PLUGIN_VOICE_TO_TEXT: new n(Math.pow(2, 7)).toString(),
|
|
198
|
+
PLUGIN_CS: new n(Math.pow(2, 8)).toString(),
|
|
199
|
+
PLUGIN_PUSH: new n(Math.pow(2, 9)).toString(),
|
|
200
|
+
PLUGIN_BOT: new n(Math.pow(2, 10)).toString(),
|
|
201
|
+
MSG_REACTION: new n(Math.pow(2, 16)).toString(),
|
|
202
|
+
FOLLOW: new n(Math.pow(2, 20)).toString(),
|
|
203
|
+
},
|
|
204
|
+
a =
|
|
205
|
+
(c.HOST.setCurrent(l),
|
|
206
|
+
"undefined" != typeof wx &&
|
|
207
|
+
"function" == typeof wx.getSystemInfoSync &&
|
|
208
|
+
("mac" === wx.getSystemInfoSync().platform ||
|
|
209
|
+
"windows" === wx.getSystemInfoSync().platform) &&
|
|
210
|
+
void 0 === wx.getSystemInfoSync().uniPlatform),
|
|
211
|
+
_ =
|
|
212
|
+
("undefined" != typeof wx &&
|
|
213
|
+
"function" == typeof wx.getSystemInfoSync &&
|
|
214
|
+
Boolean(wx.getSystemInfoSync().fontSizeSetting)) ||
|
|
215
|
+
a,
|
|
216
|
+
m =
|
|
217
|
+
(_ && wx.createGamePortal,
|
|
218
|
+
"undefined" != typeof qq &&
|
|
219
|
+
"function" == typeof qq.getSystemInfoSync &&
|
|
220
|
+
Boolean(qq.getSystemInfoSync().fontSizeSetting)),
|
|
221
|
+
g =
|
|
222
|
+
"undefined" != typeof tt &&
|
|
223
|
+
"function" == typeof tt.getSystemInfoSync &&
|
|
224
|
+
Boolean(tt.getSystemInfoSync().fontSizeSetting),
|
|
225
|
+
h =
|
|
226
|
+
"undefined" != typeof swan &&
|
|
227
|
+
"function" == typeof swan.getSystemInfoSync &&
|
|
228
|
+
Boolean(swan.getSystemInfoSync().fontSizeSetting),
|
|
229
|
+
w =
|
|
230
|
+
"undefined" != typeof my &&
|
|
231
|
+
"function" == typeof my.getSystemInfoSync &&
|
|
232
|
+
Boolean(my.getSystemInfoSync().fontSizeSetting),
|
|
233
|
+
f = "undefined" != typeof jd && "function" == typeof jd.getSystemInfoSync,
|
|
234
|
+
d =
|
|
235
|
+
"undefined" != typeof uni &&
|
|
236
|
+
"undefined" == typeof window &&
|
|
237
|
+
"function" == typeof uni.requireNativePlugin,
|
|
238
|
+
p = _ && "object" == typeof wx.miniapp,
|
|
239
|
+
I = (g && tt.enterChat, _ || m || g || h || w || d || f),
|
|
240
|
+
T =
|
|
241
|
+
"undefined" == typeof window &&
|
|
242
|
+
!I &&
|
|
243
|
+
"undefined" != typeof global &&
|
|
244
|
+
void 0 !== global.NativeScriptGlobals,
|
|
245
|
+
A =
|
|
246
|
+
"undefined" != typeof global &&
|
|
247
|
+
(void 0 !== global.nativeModuleProxy || void 0 !== global.ReactNative),
|
|
248
|
+
y = "undefined" != typeof uni ? !I : "undefined" != typeof window && !I && !A,
|
|
249
|
+
S =
|
|
250
|
+
(m ? qq : g ? tt : h ? swan : w ? my : _ ? wx : d ? uni : f && jd,
|
|
251
|
+
(y && window && window.navigator && window.navigator.userAgent) || ""),
|
|
252
|
+
E = /(micromessenger|webbrowser)/i.test(S),
|
|
253
|
+
M = (function () {
|
|
254
|
+
let t = "WEB";
|
|
255
|
+
return (
|
|
256
|
+
E
|
|
257
|
+
? (t = "WEB")
|
|
258
|
+
: m
|
|
259
|
+
? (t = "QQ_MP")
|
|
260
|
+
: g
|
|
261
|
+
? (t = "TT_MP")
|
|
262
|
+
: h
|
|
263
|
+
? (t = "BAIDU_MP")
|
|
264
|
+
: w
|
|
265
|
+
? (t = "ALI_MP")
|
|
266
|
+
: _
|
|
267
|
+
? (t = p ? "DONUT_NATIVE_APP" : "WX_MP")
|
|
268
|
+
: d
|
|
269
|
+
? (t = "UNI_NATIVE_APP")
|
|
270
|
+
: T
|
|
271
|
+
? (t = "NS_NATIVE_APP")
|
|
272
|
+
: A && (t = "RN_NATIVE_APP"),
|
|
273
|
+
r[t]
|
|
274
|
+
);
|
|
275
|
+
})(),
|
|
276
|
+
L =
|
|
277
|
+
(!(function () {
|
|
278
|
+
var t = S.match(/OS (\d+)_/i);
|
|
279
|
+
t && t[1] && t[1];
|
|
280
|
+
})(),
|
|
281
|
+
(function () {
|
|
282
|
+
var t,
|
|
283
|
+
e,
|
|
284
|
+
s = S.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);
|
|
285
|
+
s &&
|
|
286
|
+
((t = s[1] && parseFloat(s[1])), (e = s[2] && parseFloat(s[2])), t) &&
|
|
287
|
+
e &&
|
|
288
|
+
parseFloat(s[1] + "." + s[2]);
|
|
289
|
+
})(),
|
|
290
|
+
/MSIE/.test(S) || (-1 < S.indexOf("Trident") && -1 < S.indexOf("rv:11.0"))),
|
|
291
|
+
U,
|
|
292
|
+
P,
|
|
293
|
+
O =
|
|
294
|
+
(!(function () {
|
|
295
|
+
var t = /MSIE\s(\d+)\.\d/.exec(S),
|
|
296
|
+
t = t && parseFloat(t[1]);
|
|
297
|
+
!t && /Trident\/7.0/i.test(S) && /rv:11.0/.test(S);
|
|
298
|
+
})(),
|
|
299
|
+
(U =
|
|
300
|
+
"undefined" != typeof console
|
|
301
|
+
? console
|
|
302
|
+
: "undefined" != typeof global && global.console
|
|
303
|
+
? global.console
|
|
304
|
+
: "undefined" != typeof window && window.console
|
|
305
|
+
? window.console
|
|
306
|
+
: {}),
|
|
307
|
+
function () {}),
|
|
308
|
+
N = [
|
|
309
|
+
"assert",
|
|
310
|
+
"clear",
|
|
311
|
+
"count",
|
|
312
|
+
"debug",
|
|
313
|
+
"dir",
|
|
314
|
+
"dirxml",
|
|
315
|
+
"error",
|
|
316
|
+
"group",
|
|
317
|
+
"groupCollapsed",
|
|
318
|
+
"groupEnd",
|
|
319
|
+
"info",
|
|
320
|
+
"log",
|
|
321
|
+
"profile",
|
|
322
|
+
"profileEnd",
|
|
323
|
+
"table",
|
|
324
|
+
"time",
|
|
325
|
+
"timeEnd",
|
|
326
|
+
"timeStamp",
|
|
327
|
+
"trace",
|
|
328
|
+
"warn",
|
|
329
|
+
],
|
|
330
|
+
C = N.length;
|
|
331
|
+
for (; C--; ) ((P = N[C]), console[P] || (U[P] = O));
|
|
332
|
+
var F = U;
|
|
333
|
+
let D = function () {
|
|
334
|
+
return new Date().getTime() + 0;
|
|
335
|
+
},
|
|
336
|
+
v = "Tag_Profile_IM_Nick",
|
|
337
|
+
R = "Tag_Profile_IM_Gender",
|
|
338
|
+
b = "Tag_Profile_IM_BirthDay",
|
|
339
|
+
k = "Tag_Profile_IM_Location",
|
|
340
|
+
q = "Tag_Profile_IM_SelfSignature",
|
|
341
|
+
B = "Tag_Profile_IM_AllowType",
|
|
342
|
+
G = "Tag_Profile_IM_Language",
|
|
343
|
+
x = "Tag_Profile_IM_Image",
|
|
344
|
+
W = "Tag_Profile_IM_MsgSettings",
|
|
345
|
+
$ = "Tag_Profile_IM_AdminForbidType",
|
|
346
|
+
V = "Tag_Profile_IM_Level",
|
|
347
|
+
K = "Tag_Profile_IM_Role",
|
|
348
|
+
j = Object.prototype.hasOwnProperty,
|
|
349
|
+
H = function (t) {
|
|
350
|
+
return "map" === et(t);
|
|
351
|
+
},
|
|
352
|
+
Y = function (t) {
|
|
353
|
+
return "set" === et(t);
|
|
354
|
+
},
|
|
355
|
+
X = function (t) {
|
|
356
|
+
return "file" === et(t);
|
|
357
|
+
},
|
|
358
|
+
z = function (t) {
|
|
359
|
+
return (
|
|
360
|
+
null !== t &&
|
|
361
|
+
(("number" == typeof t && !isNaN(+t)) ||
|
|
362
|
+
("object" == typeof t && t.constructor === Number))
|
|
363
|
+
);
|
|
364
|
+
},
|
|
365
|
+
J = function (t) {
|
|
366
|
+
if ("object" != typeof t || null === t) return !1;
|
|
367
|
+
t = Object.getPrototypeOf(t);
|
|
368
|
+
if (null === t) return !0;
|
|
369
|
+
let e = t;
|
|
370
|
+
for (; null !== Object.getPrototypeOf(e); ) e = Object.getPrototypeOf(e);
|
|
371
|
+
return t === e;
|
|
372
|
+
},
|
|
373
|
+
Q = function (t) {
|
|
374
|
+
return void 0 === t;
|
|
375
|
+
},
|
|
376
|
+
Z = function (t) {
|
|
377
|
+
return (
|
|
378
|
+
(e = t),
|
|
379
|
+
("function" == typeof Array.isArray
|
|
380
|
+
? Array.isArray(e)
|
|
381
|
+
: "array" === et(e)) ||
|
|
382
|
+
(null !== t && "object" == typeof t)
|
|
383
|
+
);
|
|
384
|
+
var e;
|
|
385
|
+
},
|
|
386
|
+
et = function (t) {
|
|
387
|
+
return Object.prototype.toString
|
|
388
|
+
.call(t)
|
|
389
|
+
.match(/^\[object (.*)\]$/)[1]
|
|
390
|
+
.toLowerCase();
|
|
391
|
+
};
|
|
392
|
+
function st() {
|
|
393
|
+
return !L && !I;
|
|
394
|
+
}
|
|
395
|
+
Date.now ||
|
|
396
|
+
(Date.now = function () {
|
|
397
|
+
return new Date().getTime();
|
|
398
|
+
});
|
|
399
|
+
let ot = 0;
|
|
400
|
+
function nt() {
|
|
401
|
+
return st() ? "%c Chat %c" : "Chat";
|
|
402
|
+
}
|
|
403
|
+
function it() {
|
|
404
|
+
(t = new Date()).setTime(D());
|
|
405
|
+
var t;
|
|
406
|
+
return (
|
|
407
|
+
t.toLocaleTimeString("en-US", { hour12: !1 }) +
|
|
408
|
+
"." +
|
|
409
|
+
(function (t) {
|
|
410
|
+
let e;
|
|
411
|
+
switch (t.toString().length) {
|
|
412
|
+
case 1:
|
|
413
|
+
e = "00" + t;
|
|
414
|
+
break;
|
|
415
|
+
case 2:
|
|
416
|
+
e = "0" + t;
|
|
417
|
+
break;
|
|
418
|
+
default:
|
|
419
|
+
e = t;
|
|
420
|
+
}
|
|
421
|
+
return e;
|
|
422
|
+
})(t.getMilliseconds())
|
|
423
|
+
);
|
|
424
|
+
}
|
|
425
|
+
let rt = {
|
|
426
|
+
arguments2String(s) {
|
|
427
|
+
let o = "";
|
|
428
|
+
if (1 === s.length) o = s[0];
|
|
429
|
+
else
|
|
430
|
+
for (let t = 0, e = s.length; t < e; t++) {
|
|
431
|
+
if (Z(s[t]))
|
|
432
|
+
try {
|
|
433
|
+
o +=
|
|
434
|
+
s[t] instanceof Error
|
|
435
|
+
? JSON.stringify(s[t], ["message", "code"])
|
|
436
|
+
: JSON.stringify(s[t]);
|
|
437
|
+
} catch (t) {
|
|
438
|
+
o += t ? t.message : "";
|
|
439
|
+
break;
|
|
440
|
+
}
|
|
441
|
+
else o += s[t];
|
|
442
|
+
o += " ";
|
|
443
|
+
}
|
|
444
|
+
return o;
|
|
445
|
+
},
|
|
446
|
+
_exec(t, e) {
|
|
447
|
+
st()
|
|
448
|
+
? F[t](
|
|
449
|
+
nt(),
|
|
450
|
+
"background:#0abf5b; padding:1px; border-radius:3px; color: #fff",
|
|
451
|
+
"background:transparent",
|
|
452
|
+
it(),
|
|
453
|
+
e,
|
|
454
|
+
)
|
|
455
|
+
: F[t](`${nt()} ${it()} ` + e);
|
|
456
|
+
},
|
|
457
|
+
d: function () {
|
|
458
|
+
var t;
|
|
459
|
+
ot <= -1 &&
|
|
460
|
+
((t = this.arguments2String(arguments)), this._exec("debug", t));
|
|
461
|
+
},
|
|
462
|
+
l: function () {
|
|
463
|
+
var t;
|
|
464
|
+
ot <= 0 && ((t = this.arguments2String(arguments)), this._exec("log", t));
|
|
465
|
+
},
|
|
466
|
+
log: function () {
|
|
467
|
+
var t;
|
|
468
|
+
ot <= 0 && ((t = this.arguments2String(arguments)), this._exec("log", t));
|
|
469
|
+
},
|
|
470
|
+
i: function () {
|
|
471
|
+
var t;
|
|
472
|
+
ot <= 1 &&
|
|
473
|
+
((t = this.arguments2String(arguments)), this._exec("info", t));
|
|
474
|
+
},
|
|
475
|
+
w: function () {
|
|
476
|
+
var t;
|
|
477
|
+
ot <= 2 &&
|
|
478
|
+
((t = this.arguments2String(arguments)), this._exec("warn", t));
|
|
479
|
+
},
|
|
480
|
+
e: function () {
|
|
481
|
+
var t;
|
|
482
|
+
ot <= 3 &&
|
|
483
|
+
((t = this.arguments2String(arguments)), this._exec("error", t));
|
|
484
|
+
},
|
|
485
|
+
setLevel: function (t) {
|
|
486
|
+
(t < 4 && this._exec("log", "set level from " + ot + " to " + t),
|
|
487
|
+
(ot = t));
|
|
488
|
+
},
|
|
489
|
+
getLevel: function () {
|
|
490
|
+
return ot;
|
|
491
|
+
},
|
|
492
|
+
},
|
|
493
|
+
lt = function (t) {
|
|
494
|
+
return { code: 0, data: t || {} };
|
|
495
|
+
};
|
|
496
|
+
class ct extends Error {
|
|
497
|
+
constructor(t) {
|
|
498
|
+
super();
|
|
499
|
+
var { code: t, message: e, data: s } = t;
|
|
500
|
+
((this.code = t),
|
|
501
|
+
e
|
|
502
|
+
? (this.message = e)
|
|
503
|
+
: this._getErrMsg && (this.message = this._getErrMsg(this.code)),
|
|
504
|
+
(this.data = s || {}));
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
let ut = 2805,
|
|
508
|
+
at = 2903,
|
|
509
|
+
_t = 3122,
|
|
510
|
+
mt = "onMyFollowersListUpdated",
|
|
511
|
+
gt = "onMyFollowingListUpdated",
|
|
512
|
+
ht = "onMutualFollowersListUpdated",
|
|
513
|
+
wt = "error",
|
|
514
|
+
ft = null,
|
|
515
|
+
dt = function (t, e = !1) {
|
|
516
|
+
if (t instanceof ct)
|
|
517
|
+
return (e && null !== ft && ft.emit(wt, t), Promise.reject(t));
|
|
518
|
+
if (t instanceof Error) {
|
|
519
|
+
let t = new ct({ code: at });
|
|
520
|
+
return (e && null !== ft && ft.emit(wt, t), Promise.reject(t));
|
|
521
|
+
}
|
|
522
|
+
return Q(t) || Q(t.code)
|
|
523
|
+
? Promise.reject(new ct({ code: at }))
|
|
524
|
+
: ((t = new ct(t)),
|
|
525
|
+
e && null !== ft && ft.emit(wt, t),
|
|
526
|
+
Promise.reject(t));
|
|
527
|
+
},
|
|
528
|
+
pt = "follow_add",
|
|
529
|
+
It = "follow_delete",
|
|
530
|
+
Tt = "follow_get",
|
|
531
|
+
At = "follow_get_info",
|
|
532
|
+
yt = "follow_check",
|
|
533
|
+
St = { info: 4, warning: 5, error: 6 },
|
|
534
|
+
Et = {
|
|
535
|
+
wifi: 1,
|
|
536
|
+
"2g": 2,
|
|
537
|
+
"3g": 3,
|
|
538
|
+
"4g": 4,
|
|
539
|
+
"5g": 5,
|
|
540
|
+
unknown: 6,
|
|
541
|
+
none: 7,
|
|
542
|
+
online: 8,
|
|
543
|
+
},
|
|
544
|
+
Mt = {
|
|
545
|
+
login: 4,
|
|
546
|
+
plugin_search: 16,
|
|
547
|
+
plugin_translate: 16,
|
|
548
|
+
plugin_voice_to_text: 16,
|
|
549
|
+
plugin_cs: 16,
|
|
550
|
+
plugin_push: 16,
|
|
551
|
+
plugin_bot: 16,
|
|
552
|
+
plugin_emoji_reaction: 16,
|
|
553
|
+
tui_key_features: 16,
|
|
554
|
+
};
|
|
555
|
+
class Lt {
|
|
556
|
+
constructor(t) {
|
|
557
|
+
((this._n = "SSOLogData"),
|
|
558
|
+
(this.eventType = Mt[t] || 0),
|
|
559
|
+
(this.timestamp = 0),
|
|
560
|
+
(this.networkType = 8),
|
|
561
|
+
(this.code = 0),
|
|
562
|
+
(this.message = ""),
|
|
563
|
+
(this.moreMessage = ""),
|
|
564
|
+
(this.extension = t),
|
|
565
|
+
(this.costTime = 0),
|
|
566
|
+
(this.duplicate = !1),
|
|
567
|
+
(this.level = 4),
|
|
568
|
+
(this.uiPlatform = void 0),
|
|
569
|
+
(this._sentFlag = !1),
|
|
570
|
+
(this._startts = D()));
|
|
571
|
+
}
|
|
572
|
+
static bindEventStatModule(t) {
|
|
573
|
+
Lt.prototype._eventStatModule = t;
|
|
574
|
+
}
|
|
575
|
+
static bindNetMonitorModule(t) {
|
|
576
|
+
Lt.prototype._netMonitorModule = t;
|
|
577
|
+
}
|
|
578
|
+
updateTimeStamp() {
|
|
579
|
+
this.timestamp = D();
|
|
580
|
+
}
|
|
581
|
+
start(t) {
|
|
582
|
+
return ((this._startts = t), this);
|
|
583
|
+
}
|
|
584
|
+
end(t = !1) {
|
|
585
|
+
if (!this._sentFlag) {
|
|
586
|
+
if (this._netMonitorModule) {
|
|
587
|
+
let t = this._netMonitorModule.getNetworkType();
|
|
588
|
+
this.setNetworkType(t);
|
|
589
|
+
}
|
|
590
|
+
var e = D();
|
|
591
|
+
(0 === this.costTime && (this.costTime = e - this._startts),
|
|
592
|
+
this.setMoreMessage(`startts:${this._startts} endts:` + e),
|
|
593
|
+
t
|
|
594
|
+
? ((this._sentFlag = !0),
|
|
595
|
+
this._eventStatModule && this._eventStatModule.pushIn(this))
|
|
596
|
+
: setTimeout(() => {
|
|
597
|
+
((this._sentFlag = !0),
|
|
598
|
+
this._eventStatModule && this._eventStatModule.pushIn(this));
|
|
599
|
+
}, 0));
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
setError(e) {
|
|
603
|
+
if (e instanceof Error) {
|
|
604
|
+
if (!this._sentFlag) {
|
|
605
|
+
let t = !0;
|
|
606
|
+
if (
|
|
607
|
+
(t = this._netMonitorModule ? this._netMonitorModule.isOnline() : t)
|
|
608
|
+
)
|
|
609
|
+
(e.code && this.setCode(e.code),
|
|
610
|
+
e.message && this.setMoreMessage(e.message));
|
|
611
|
+
else {
|
|
612
|
+
let t = ut;
|
|
613
|
+
this.setCode(t);
|
|
614
|
+
}
|
|
615
|
+
this.setLevel("error");
|
|
616
|
+
}
|
|
617
|
+
} else
|
|
618
|
+
rt.w(this._n + ".setError value not instanceof Error, please check!");
|
|
619
|
+
return this;
|
|
620
|
+
}
|
|
621
|
+
setCode(t) {
|
|
622
|
+
return (
|
|
623
|
+
Q(t) ||
|
|
624
|
+
this._sentFlag ||
|
|
625
|
+
("ECONNABORTED" === t && (this.code = 103),
|
|
626
|
+
z(t)
|
|
627
|
+
? (this.code = t)
|
|
628
|
+
: rt.w(
|
|
629
|
+
this._n + ".setCode value not a number, please check!",
|
|
630
|
+
t,
|
|
631
|
+
typeof t,
|
|
632
|
+
)),
|
|
633
|
+
this
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
setMessage(t) {
|
|
637
|
+
return (
|
|
638
|
+
Q(t) ||
|
|
639
|
+
this._sentFlag ||
|
|
640
|
+
(z(t) && (this.message = t.toString()),
|
|
641
|
+
"string" == typeof t && (this.message = t)),
|
|
642
|
+
this
|
|
643
|
+
);
|
|
644
|
+
}
|
|
645
|
+
setCostTime(t) {
|
|
646
|
+
return ((this.costTime = t), this);
|
|
647
|
+
}
|
|
648
|
+
setLevel(t) {
|
|
649
|
+
return (Q(t) || this._sentFlag || (this.level = St[t]), this);
|
|
650
|
+
}
|
|
651
|
+
setMoreMessage(t) {
|
|
652
|
+
return (
|
|
653
|
+
(function (t) {
|
|
654
|
+
if (null == t) return 1;
|
|
655
|
+
if ("boolean" != typeof t) {
|
|
656
|
+
if ("number" == typeof t) return 0 === t;
|
|
657
|
+
if ("string" == typeof t) return 0 === t.length;
|
|
658
|
+
if ("function" == typeof t) return 0 === t.length;
|
|
659
|
+
if (Array.isArray(t)) return 0 === t.length;
|
|
660
|
+
if (t instanceof Error) return "" === t.message;
|
|
661
|
+
if (J(t)) {
|
|
662
|
+
for (var e in t) if (j.call(t, e)) return;
|
|
663
|
+
return 1;
|
|
664
|
+
}
|
|
665
|
+
return (H(t) || Y(t) || X(t)) && 0 === t.size;
|
|
666
|
+
}
|
|
667
|
+
})(this.moreMessage)
|
|
668
|
+
? (this.moreMessage = "" + t)
|
|
669
|
+
: (this.moreMessage += " " + t),
|
|
670
|
+
this
|
|
671
|
+
);
|
|
672
|
+
}
|
|
673
|
+
setNetworkType(t) {
|
|
674
|
+
return (
|
|
675
|
+
Q(t)
|
|
676
|
+
? rt.w(this._n + ".setNetworkType value is undefined, please check!")
|
|
677
|
+
: ((t = Et[t.toLowerCase()]), Q(t) || (this.networkType = t)),
|
|
678
|
+
this
|
|
679
|
+
);
|
|
680
|
+
}
|
|
681
|
+
getStartTs() {
|
|
682
|
+
return this._startts;
|
|
683
|
+
}
|
|
684
|
+
setUIPlatform(t) {
|
|
685
|
+
return ((this.uiPlatform = t), this);
|
|
686
|
+
}
|
|
687
|
+
setExtension(t) {
|
|
688
|
+
return ((this.extension = t), this);
|
|
689
|
+
}
|
|
690
|
+
setEventType(t) {
|
|
691
|
+
return ((this.eventType = t), this);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
let Ut = {
|
|
695
|
+
A2KEY_AND_TINYID_UPDATED: "_inner1",
|
|
696
|
+
CLOUD_CONFIG: "_inner2",
|
|
697
|
+
PROFILE_UPDATED: "_inner3",
|
|
698
|
+
CONV_SYNC_COMPLETED: "_inner4",
|
|
699
|
+
C2C_UNREAD_HANDLE_COMPLETED: "_inner5",
|
|
700
|
+
},
|
|
701
|
+
Pt = { NONE: 0, FOLLOWERS: 1, FOLLOWING: 2, MUTUAL: 3 };
|
|
702
|
+
class Ot extends class {
|
|
703
|
+
constructor(t) {
|
|
704
|
+
((this._m = t), (this._n = ""));
|
|
705
|
+
}
|
|
706
|
+
isLoggedIn() {
|
|
707
|
+
return this._m.get(t).isLoggedIn();
|
|
708
|
+
}
|
|
709
|
+
isOversea() {
|
|
710
|
+
return this._m.get(t).isOversea();
|
|
711
|
+
}
|
|
712
|
+
isPrivateNetWork() {
|
|
713
|
+
var e = this._m.get(t);
|
|
714
|
+
return e.isPrivateNetWork() && !e.getFileDownloadProxy();
|
|
715
|
+
}
|
|
716
|
+
getFileDownloadProxy() {
|
|
717
|
+
return this._m.get(t).getFileDownloadProxy();
|
|
718
|
+
}
|
|
719
|
+
getDownloadFileAuthKey() {
|
|
720
|
+
return this._m.get(t).getDownloadFileAuthKey();
|
|
721
|
+
}
|
|
722
|
+
getMyUserID() {
|
|
723
|
+
return this._m.get(t).getUserID();
|
|
724
|
+
}
|
|
725
|
+
getMyTinyID() {
|
|
726
|
+
return this._m.get(t).getTinyID();
|
|
727
|
+
}
|
|
728
|
+
getSDKAppID() {
|
|
729
|
+
return this._m.get(t).getSDKAppID();
|
|
730
|
+
}
|
|
731
|
+
isIntl() {
|
|
732
|
+
return this._m.get(t).isIntl();
|
|
733
|
+
}
|
|
734
|
+
isUsingChatCore() {
|
|
735
|
+
return this._m.get(t).isUsingChatCore();
|
|
736
|
+
}
|
|
737
|
+
isDevMode() {
|
|
738
|
+
return this._m.get(t).isDevMode();
|
|
739
|
+
}
|
|
740
|
+
get(t) {
|
|
741
|
+
return this._m.get(t);
|
|
742
|
+
}
|
|
743
|
+
getPlatform() {
|
|
744
|
+
return M;
|
|
745
|
+
}
|
|
746
|
+
getCloudConfig(t) {
|
|
747
|
+
return this._m.get(s).getCloudConfig(t);
|
|
748
|
+
}
|
|
749
|
+
emitOEvt(t, e) {
|
|
750
|
+
this._m.getOEmitInst().emit(t, e);
|
|
751
|
+
}
|
|
752
|
+
emitIEvt(t, e) {
|
|
753
|
+
this._m.getIEmitInst().emit(t, e);
|
|
754
|
+
}
|
|
755
|
+
getIEmitInst() {
|
|
756
|
+
return this._m.getIEmitInst();
|
|
757
|
+
}
|
|
758
|
+
req(t) {
|
|
759
|
+
return this._m.get(e).req(t);
|
|
760
|
+
}
|
|
761
|
+
canIUse(t) {
|
|
762
|
+
return this._m.get(o).canIUse(t);
|
|
763
|
+
}
|
|
764
|
+
getErrMsg(t, e, s) {
|
|
765
|
+
return this._m.getErrMsg(t, e, s);
|
|
766
|
+
}
|
|
767
|
+
warn(t, e, s) {
|
|
768
|
+
t = this.getErrMsg(t, e, s);
|
|
769
|
+
t && rt.w(t);
|
|
770
|
+
}
|
|
771
|
+
noUse(t) {
|
|
772
|
+
var e = _t;
|
|
773
|
+
return dt({ code: e, message: this.getErrMsg(e, t) });
|
|
774
|
+
}
|
|
775
|
+
} {
|
|
776
|
+
constructor(t) {
|
|
777
|
+
(super(t),
|
|
778
|
+
(this._n = "FollowModule"),
|
|
779
|
+
(this.DEFAULT_COUNT = 500),
|
|
780
|
+
(this.MAX_COUNT = 1e3),
|
|
781
|
+
this.getIEmitInst().on(Ut.CLOUD_CONFIG, this._onCloudConfig, this));
|
|
782
|
+
}
|
|
783
|
+
_onCloudConfig() {
|
|
784
|
+
var t = this.getCloudConfig("follow_req_count");
|
|
785
|
+
Q(t) ||
|
|
786
|
+
((t = Number(t)),
|
|
787
|
+
(this.DEFAULT_COUNT = t > this.MAX_COUNT ? this.MAX_COUNT : t));
|
|
788
|
+
}
|
|
789
|
+
onFollowNotify(t) {
|
|
790
|
+
t = t.dataList || [];
|
|
791
|
+
(rt.l(this._n + ".onFollowNotify followChangeList:" + t.length),
|
|
792
|
+
t.forEach((t) => {
|
|
793
|
+
let { followDiffList: e = [], ...s } = t,
|
|
794
|
+
{ from: o, ...n } = s;
|
|
795
|
+
e.forEach((t) => {
|
|
796
|
+
var { isAdd: t, followType: e = 0 } = t,
|
|
797
|
+
s = this._initFollowInfo();
|
|
798
|
+
(1 === t
|
|
799
|
+
? ((n.userID = o), s[e].userInfoList.push(n), (s[e].isAdd = !0))
|
|
800
|
+
: (s[e].userInfoList.push(o), (s[e].isAdd = !1)),
|
|
801
|
+
this._emitEvent(s));
|
|
802
|
+
});
|
|
803
|
+
}));
|
|
804
|
+
}
|
|
805
|
+
_initFollowInfo() {
|
|
806
|
+
let e = {};
|
|
807
|
+
return (
|
|
808
|
+
Object.values(Pt).forEach((t) => {
|
|
809
|
+
t !== Pt.NONE && (e[t] = { userInfoList: [], isAdd: !1 });
|
|
810
|
+
}),
|
|
811
|
+
e
|
|
812
|
+
);
|
|
813
|
+
}
|
|
814
|
+
_emitEvent(s) {
|
|
815
|
+
Object.keys(s).forEach((t) => {
|
|
816
|
+
var t = Number(t),
|
|
817
|
+
e = s[t];
|
|
818
|
+
0 < e.userInfoList.length &&
|
|
819
|
+
(t === Pt.FOLLOWERS && this.emitOEvt(mt, e),
|
|
820
|
+
t === Pt.FOLLOWING && this.emitOEvt(gt, e),
|
|
821
|
+
t === Pt.MUTUAL) &&
|
|
822
|
+
this.emitOEvt(ht, e);
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
followUser(t) {
|
|
826
|
+
if (!this.canIUse(u.FOLLOW)) return this.noUse("followUser");
|
|
827
|
+
let e = this._n + ".followUser",
|
|
828
|
+
s = "userIDList:" + t.length,
|
|
829
|
+
o = new Lt("followUser");
|
|
830
|
+
return (
|
|
831
|
+
o.setMessage(s),
|
|
832
|
+
rt.l(e + " " + s),
|
|
833
|
+
this.req({
|
|
834
|
+
P: pt,
|
|
835
|
+
data: {
|
|
836
|
+
fromAccount: this.getMyUserID(),
|
|
837
|
+
userIDList: t.map((t) => ({ userID: t })),
|
|
838
|
+
},
|
|
839
|
+
})
|
|
840
|
+
.then((t) => (o.end(), rt.l(e + " ok."), lt(t.data.resultList)))
|
|
841
|
+
.catch(
|
|
842
|
+
(t) => (o.setError(t).end(), rt.e(e + " failed. error:", t), dt(t)),
|
|
843
|
+
)
|
|
844
|
+
);
|
|
845
|
+
}
|
|
846
|
+
unfollowUser(t) {
|
|
847
|
+
if (!this.canIUse(u.FOLLOW)) return this.noUse("unfollowUser");
|
|
848
|
+
let e = this._n + ".unfollowUser",
|
|
849
|
+
s = "userIDList:" + t.length,
|
|
850
|
+
o = new Lt("unfollowUser");
|
|
851
|
+
return (
|
|
852
|
+
o.setMessage(s),
|
|
853
|
+
rt.l(e + " " + s),
|
|
854
|
+
this.req({
|
|
855
|
+
P: It,
|
|
856
|
+
data: { fromAccount: this.getMyUserID(), userIDList: t },
|
|
857
|
+
})
|
|
858
|
+
.then((t) => (o.end(), rt.l(e + " ok."), lt(t.data.resultList)))
|
|
859
|
+
.catch(
|
|
860
|
+
(t) => (o.setError(t).end(), rt.e(e + " failed. error:", t), dt(t)),
|
|
861
|
+
)
|
|
862
|
+
);
|
|
863
|
+
}
|
|
864
|
+
getMyFollowersList(t = "") {
|
|
865
|
+
return this.canIUse(u.FOLLOW)
|
|
866
|
+
? this._getFollowList(t, Pt.FOLLOWERS).then((t) => {
|
|
867
|
+
var { nextCursor: e, resultList: s = [] } = t;
|
|
868
|
+
return (
|
|
869
|
+
rt.l(
|
|
870
|
+
`${this._n}.getMyFollowersList ok, count:${s.length} nextCursor:` +
|
|
871
|
+
e,
|
|
872
|
+
),
|
|
873
|
+
lt(t)
|
|
874
|
+
);
|
|
875
|
+
})
|
|
876
|
+
: this.noUse("getMyFollowersList");
|
|
877
|
+
}
|
|
878
|
+
getMyFollowingList(t = "") {
|
|
879
|
+
return this.canIUse(u.FOLLOW)
|
|
880
|
+
? this._getFollowList(t, Pt.FOLLOWING).then((t) => {
|
|
881
|
+
var { nextCursor: e, resultList: s = [] } = t;
|
|
882
|
+
return (
|
|
883
|
+
rt.l(
|
|
884
|
+
`${this._n}.getMyFollowingList ok, count:${s.length} nextCursor:` +
|
|
885
|
+
e,
|
|
886
|
+
),
|
|
887
|
+
lt(t)
|
|
888
|
+
);
|
|
889
|
+
})
|
|
890
|
+
: this.noUse("getMyFollowingList");
|
|
891
|
+
}
|
|
892
|
+
getMutualFollowersList(t = "") {
|
|
893
|
+
return this.canIUse(u.FOLLOW)
|
|
894
|
+
? this._getFollowList(t, Pt.MUTUAL).then((t) => {
|
|
895
|
+
var { nextCursor: e, resultList: s = [] } = t;
|
|
896
|
+
return (
|
|
897
|
+
rt.l(
|
|
898
|
+
`${this._n}.getMutualFollowersList ok, count:${s.length} nextCursor:` +
|
|
899
|
+
e,
|
|
900
|
+
),
|
|
901
|
+
lt(t)
|
|
902
|
+
);
|
|
903
|
+
})
|
|
904
|
+
: this.noUse("getMutualFollowersList");
|
|
905
|
+
}
|
|
906
|
+
_getFollowList(t, e) {
|
|
907
|
+
let n = new Lt("_getFollowList");
|
|
908
|
+
return (
|
|
909
|
+
n.setMessage(`nextCursor:${t} type:` + e),
|
|
910
|
+
this.req({
|
|
911
|
+
P: Tt,
|
|
912
|
+
data: {
|
|
913
|
+
fromAccount: this.getMyUserID(),
|
|
914
|
+
count: this.DEFAULT_COUNT,
|
|
915
|
+
nextCursor: t,
|
|
916
|
+
type: e,
|
|
917
|
+
},
|
|
918
|
+
})
|
|
919
|
+
.then((t) => {
|
|
920
|
+
n.end();
|
|
921
|
+
let { resultList: e = [], nextCursor: s = "" } = t.data,
|
|
922
|
+
o = [];
|
|
923
|
+
return (
|
|
924
|
+
e.forEach((t) => {
|
|
925
|
+
var { userID: t, followTime: e, profileList: s = [] } = t;
|
|
926
|
+
o.push({
|
|
927
|
+
userID: t,
|
|
928
|
+
followTime: e,
|
|
929
|
+
...this._handleProfileItem(s),
|
|
930
|
+
});
|
|
931
|
+
}),
|
|
932
|
+
{ resultList: o, nextCursor: s }
|
|
933
|
+
);
|
|
934
|
+
})
|
|
935
|
+
.catch(
|
|
936
|
+
(t) => (
|
|
937
|
+
n.setError(t).end(),
|
|
938
|
+
rt.e(this._n + "._getFollowList failed. error:", t),
|
|
939
|
+
dt(t)
|
|
940
|
+
),
|
|
941
|
+
)
|
|
942
|
+
);
|
|
943
|
+
}
|
|
944
|
+
_handleProfileItem(t) {
|
|
945
|
+
let e = {};
|
|
946
|
+
return (
|
|
947
|
+
t.forEach((t) => {
|
|
948
|
+
switch (t.tag) {
|
|
949
|
+
case v:
|
|
950
|
+
e.nick = t.value;
|
|
951
|
+
break;
|
|
952
|
+
case R:
|
|
953
|
+
e.gender = t.value;
|
|
954
|
+
break;
|
|
955
|
+
case b:
|
|
956
|
+
e.birthday = t.value;
|
|
957
|
+
break;
|
|
958
|
+
case k:
|
|
959
|
+
e.location = t.value;
|
|
960
|
+
break;
|
|
961
|
+
case q:
|
|
962
|
+
e.selfSignature = t.value;
|
|
963
|
+
break;
|
|
964
|
+
case B:
|
|
965
|
+
e.allowType = t.value;
|
|
966
|
+
break;
|
|
967
|
+
case G:
|
|
968
|
+
e.language = t.value;
|
|
969
|
+
break;
|
|
970
|
+
case x:
|
|
971
|
+
e.avatar = t.value;
|
|
972
|
+
break;
|
|
973
|
+
case W:
|
|
974
|
+
e.messageSettings = t.value;
|
|
975
|
+
break;
|
|
976
|
+
case $:
|
|
977
|
+
e.adminForbidType = t.value;
|
|
978
|
+
break;
|
|
979
|
+
case V:
|
|
980
|
+
e.level = t.value;
|
|
981
|
+
break;
|
|
982
|
+
case K:
|
|
983
|
+
e.role = t.value;
|
|
984
|
+
break;
|
|
985
|
+
default:
|
|
986
|
+
e[t.tag] = t.value;
|
|
987
|
+
}
|
|
988
|
+
}),
|
|
989
|
+
e
|
|
990
|
+
);
|
|
991
|
+
}
|
|
992
|
+
getUserFollowInfo(t) {
|
|
993
|
+
if (!this.canIUse(u.FOLLOW)) return this.noUse("getUserFollowInfo");
|
|
994
|
+
let e = t,
|
|
995
|
+
s = !1,
|
|
996
|
+
n =
|
|
997
|
+
(Q(t) && ((e = [this.getMyUserID()]), (s = !0)),
|
|
998
|
+
this._n + ".getUserFollowInfo"),
|
|
999
|
+
o = `userIDList:${e.length} isGetMyFollowInfo:` + s,
|
|
1000
|
+
r = new Lt("getUserFollowInfo");
|
|
1001
|
+
return (
|
|
1002
|
+
r.setMessage(o),
|
|
1003
|
+
rt.l(n + " " + o),
|
|
1004
|
+
this.req({
|
|
1005
|
+
P: At,
|
|
1006
|
+
data: { fromAccount: this.getMyUserID(), userIDList: e },
|
|
1007
|
+
})
|
|
1008
|
+
.then((t) => {
|
|
1009
|
+
(r.end(), rt.l(n + " ok."));
|
|
1010
|
+
let { followInfoList: e = [] } = t.data,
|
|
1011
|
+
o = [];
|
|
1012
|
+
return (
|
|
1013
|
+
e.forEach((t) => {
|
|
1014
|
+
var {
|
|
1015
|
+
followersCount: t,
|
|
1016
|
+
followingCount: e,
|
|
1017
|
+
mutualFollowersCount: s,
|
|
1018
|
+
} = t;
|
|
1019
|
+
o.push({
|
|
1020
|
+
followersCount: t,
|
|
1021
|
+
followingCount: e,
|
|
1022
|
+
mutualFollowersCount: s,
|
|
1023
|
+
});
|
|
1024
|
+
}),
|
|
1025
|
+
lt(o)
|
|
1026
|
+
);
|
|
1027
|
+
})
|
|
1028
|
+
.catch(
|
|
1029
|
+
(t) => (r.setError(t).end(), rt.e(n + " failed. error:", t), dt(t)),
|
|
1030
|
+
)
|
|
1031
|
+
);
|
|
1032
|
+
}
|
|
1033
|
+
checkFollowType(t) {
|
|
1034
|
+
if (!this.canIUse(u.FOLLOW)) return this.noUse("checkFollowType");
|
|
1035
|
+
100 < t.length &&
|
|
1036
|
+
((t = t.slice(0, 100)),
|
|
1037
|
+
rt.w(o + " " + "the length of userIDList cannot exceed 100"));
|
|
1038
|
+
let o = this._n + ".checkFollowType",
|
|
1039
|
+
e = `userIDList length:${t.length} `,
|
|
1040
|
+
n = new Lt("checkFollowType");
|
|
1041
|
+
return (
|
|
1042
|
+
n.setMessage(e),
|
|
1043
|
+
rt.l(o + " " + e),
|
|
1044
|
+
this.req({
|
|
1045
|
+
P: yt,
|
|
1046
|
+
data: { fromAccount: this.getMyUserID(), userIDList: t },
|
|
1047
|
+
})
|
|
1048
|
+
.then((t) => {
|
|
1049
|
+
(n.end(), rt.l(o + " ok."));
|
|
1050
|
+
let { resultList: e = [] } = t.data,
|
|
1051
|
+
s = [];
|
|
1052
|
+
return (
|
|
1053
|
+
e.forEach((t) => {
|
|
1054
|
+
var { userID: t, followType: e } = t;
|
|
1055
|
+
s.push({ userID: t, followType: e });
|
|
1056
|
+
}),
|
|
1057
|
+
lt(s)
|
|
1058
|
+
);
|
|
1059
|
+
})
|
|
1060
|
+
.catch(
|
|
1061
|
+
(t) => (n.setError(t).end(), rt.e(o + " failed. error:", t), dt(t)),
|
|
1062
|
+
)
|
|
1063
|
+
);
|
|
1064
|
+
}
|
|
1065
|
+
reset() {
|
|
1066
|
+
rt.l(this._n + ".reset");
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
export { Ot as default };
|