cloud189-sdk 1.0.2 → 1.0.4
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/README.md +2 -3
- package/dist/CloudClient.d.ts +43 -17
- package/dist/CloudClient.js +10 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# cloud189-sdk
|
|
2
2
|
|
|
3
3
|
## 安装依赖
|
|
4
|
-
```
|
|
4
|
+
``` console
|
|
5
5
|
npm i cloud189-sdk
|
|
6
6
|
```
|
|
7
7
|
或者
|
|
8
|
-
```
|
|
8
|
+
``` console
|
|
9
9
|
yarn add cloud189-sdk
|
|
10
10
|
```
|
|
11
11
|
## 测试代码
|
|
@@ -47,5 +47,4 @@ const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
47
47
|
const info = await client.getUserSizeInfo();
|
|
48
48
|
console.log(info);
|
|
49
49
|
})();
|
|
50
|
-
``
|
|
51
50
|
```
|
package/dist/CloudClient.d.ts
CHANGED
|
@@ -1,31 +1,39 @@
|
|
|
1
1
|
interface CacheQuery {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
appId: string;
|
|
3
|
+
reqId: string;
|
|
4
|
+
lt: string;
|
|
4
5
|
}
|
|
5
6
|
interface FamilyListResponse {
|
|
6
7
|
familyInfoResp: [
|
|
7
8
|
{
|
|
8
|
-
familyId:
|
|
9
|
+
familyId: number;
|
|
10
|
+
remarkName: string;
|
|
11
|
+
type: number;
|
|
12
|
+
userRole: number;
|
|
9
13
|
}
|
|
10
14
|
];
|
|
11
15
|
}
|
|
12
|
-
interface
|
|
13
|
-
result: number;
|
|
14
|
-
msg: string;
|
|
15
|
-
}
|
|
16
|
-
interface UserBriefInfoResponse extends APIResponse {
|
|
16
|
+
interface UserBriefInfoResponse {
|
|
17
17
|
sessionKey: string;
|
|
18
18
|
}
|
|
19
|
-
interface AccessTokenResponse
|
|
19
|
+
interface AccessTokenResponse {
|
|
20
20
|
accessToken: string;
|
|
21
21
|
}
|
|
22
|
-
interface FamilyUserSignResponse
|
|
22
|
+
interface FamilyUserSignResponse {
|
|
23
23
|
bonusSpace: number;
|
|
24
24
|
signFamilyId: number;
|
|
25
25
|
signStatus: number;
|
|
26
26
|
signTime: string;
|
|
27
27
|
userId: string;
|
|
28
28
|
}
|
|
29
|
+
interface UserSizeInfoResponse {
|
|
30
|
+
cloudCapacityInfo: {
|
|
31
|
+
totalSize: number;
|
|
32
|
+
};
|
|
33
|
+
familyCapacityInfo: {
|
|
34
|
+
totalSize: number;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
29
37
|
interface UserSignResponse {
|
|
30
38
|
isSign: boolean;
|
|
31
39
|
netdiskBonus: number;
|
|
@@ -34,15 +42,24 @@ interface TaskResponse {
|
|
|
34
42
|
errorCode: string;
|
|
35
43
|
prizeName: string;
|
|
36
44
|
}
|
|
45
|
+
interface UserSizeInfoResponse {
|
|
46
|
+
account: string;
|
|
47
|
+
cloudCapacityInfo: {
|
|
48
|
+
totalSize: number;
|
|
49
|
+
};
|
|
50
|
+
familyCapacityInfo: {
|
|
51
|
+
totalSize: number;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
37
54
|
declare class CloudClient {
|
|
38
55
|
#private;
|
|
39
56
|
username: string;
|
|
40
57
|
password: string;
|
|
41
58
|
cacheQuery: CacheQuery;
|
|
42
|
-
constructor(username:
|
|
59
|
+
constructor(username: string, password: string);
|
|
43
60
|
getEncrypt: () => Promise<any>;
|
|
44
61
|
redirectURL: () => Promise<unknown>;
|
|
45
|
-
appConf: (query:
|
|
62
|
+
appConf: (query: CacheQuery) => Promise<any>;
|
|
46
63
|
/**
|
|
47
64
|
* 登录流程
|
|
48
65
|
* 1.获取公钥
|
|
@@ -51,16 +68,25 @@ declare class CloudClient {
|
|
|
51
68
|
* 4.跳转到登录页
|
|
52
69
|
* */
|
|
53
70
|
login: () => Promise<any>;
|
|
54
|
-
fetchAPI: (task:
|
|
55
|
-
getUserSizeInfo: () => Promise<
|
|
71
|
+
fetchAPI: (task: string) => Promise<any>;
|
|
72
|
+
getUserSizeInfo: () => Promise<UserSizeInfoResponse>;
|
|
56
73
|
userSign: () => Promise<UserSignResponse>;
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated 任务无效, 1.0.4版本废弃
|
|
76
|
+
*/
|
|
57
77
|
taskSign: () => Promise<TaskResponse>;
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated 任务无效, 1.0.4版本废弃
|
|
80
|
+
*/
|
|
58
81
|
taskPhoto: () => Promise<TaskResponse>;
|
|
82
|
+
/**
|
|
83
|
+
* @deprecated 任务无效, 1.0.3版本废弃
|
|
84
|
+
*/
|
|
59
85
|
taskKJ: () => Promise<TaskResponse>;
|
|
60
86
|
getUserBriefInfo: () => Promise<UserBriefInfoResponse>;
|
|
61
|
-
getAccessTokenBySsKey: (sessionKey:
|
|
62
|
-
fetchFamilyAPI: (path:
|
|
87
|
+
getAccessTokenBySsKey: (sessionKey: string) => Promise<AccessTokenResponse>;
|
|
88
|
+
fetchFamilyAPI: (path: string) => Promise<any>;
|
|
63
89
|
getFamilyList: () => Promise<FamilyListResponse>;
|
|
64
|
-
familyUserSign: (familyId:
|
|
90
|
+
familyUserSign: (familyId: number) => Promise<FamilyUserSignResponse>;
|
|
65
91
|
}
|
|
66
92
|
export default CloudClient;
|
package/dist/CloudClient.js
CHANGED
|
@@ -119,7 +119,7 @@ class CloudClient {
|
|
|
119
119
|
headers: {
|
|
120
120
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/76.0",
|
|
121
121
|
Referer: "https://open.e.189.cn/",
|
|
122
|
-
REQID: this.cacheQuery.
|
|
122
|
+
REQID: this.cacheQuery.reqId,
|
|
123
123
|
lt: this.cacheQuery.lt,
|
|
124
124
|
},
|
|
125
125
|
form: data,
|
|
@@ -161,12 +161,21 @@ class CloudClient {
|
|
|
161
161
|
this.userSign = () => {
|
|
162
162
|
return this.fetchAPI(`https://cloud.189.cn/mkt/userSign.action?rand=${new Date().getTime()}&clientType=TELEANDROID&version=${config.version}&model=${config.model}`);
|
|
163
163
|
};
|
|
164
|
+
/**
|
|
165
|
+
* @deprecated 任务无效, 1.0.4版本废弃
|
|
166
|
+
*/
|
|
164
167
|
this.taskSign = () => {
|
|
165
168
|
return this.fetchAPI("https://m.cloud.189.cn/v2/drawPrizeMarketDetails.action?taskId=TASK_SIGNIN&activityId=ACT_SIGNIN");
|
|
166
169
|
};
|
|
170
|
+
/**
|
|
171
|
+
* @deprecated 任务无效, 1.0.4版本废弃
|
|
172
|
+
*/
|
|
167
173
|
this.taskPhoto = () => {
|
|
168
174
|
return this.fetchAPI("https://m.cloud.189.cn/v2/drawPrizeMarketDetails.action?taskId=TASK_SIGNIN_PHOTOS&activityId=ACT_SIGNIN");
|
|
169
175
|
};
|
|
176
|
+
/**
|
|
177
|
+
* @deprecated 任务无效, 1.0.3版本废弃
|
|
178
|
+
*/
|
|
170
179
|
this.taskKJ = () => {
|
|
171
180
|
return this.fetchAPI("https://m.cloud.189.cn/v2/drawPrizeMarketDetails.action?taskId=TASK_2022_FLDFS_KJ&activityId=ACT_SIGNIN");
|
|
172
181
|
};
|