@freelog/tools-lib 0.1.113 → 0.1.116
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/service-API/resources.d.ts +9 -0
- package/dist/service-API/user.d.ts +17 -1
- package/dist/tools-lib.cjs.development.js +87 -38
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +87 -38
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/linkTo.d.ts +11 -0
- package/package.json +1 -2
- package/src/i18n/I18nNext.ts +2 -0
- package/src/service-API/index.ts +37 -37
- package/src/service-API/recombinations/index.ts +69 -66
- package/src/service-API/resources.ts +529 -511
- package/src/service-API/storages.ts +358 -358
- package/src/service-API/user.ts +261 -232
- package/src/utils/axios.ts +5 -2
- package/src/utils/linkTo.ts +375 -346
- package/src/utils/tools.ts +85 -85
- package/src/service-API/recombinations/.gitkeep +0 -0
|
@@ -65,6 +65,8 @@ interface ListParamsType {
|
|
|
65
65
|
isLoadLatestVersionInfo?: 0 | 1;
|
|
66
66
|
projection?: string;
|
|
67
67
|
sort?: string;
|
|
68
|
+
userId?: number;
|
|
69
|
+
isLoadFreezeReason?: 0 | 1;
|
|
68
70
|
}
|
|
69
71
|
interface ListReturnType extends CommonReturn {
|
|
70
72
|
data: IResourceInfo[];
|
|
@@ -76,6 +78,7 @@ interface InfoParamsType {
|
|
|
76
78
|
isTranslate?: 0 | 1;
|
|
77
79
|
isLoadLatestVersionInfo?: 0 | 1;
|
|
78
80
|
projection?: string;
|
|
81
|
+
isLoadFreezeReason?: 0 | 1;
|
|
79
82
|
}
|
|
80
83
|
interface InfoReturnType extends CommonReturn {
|
|
81
84
|
data: IResourceInfo;
|
|
@@ -88,6 +91,7 @@ interface BatchInfoParamsType {
|
|
|
88
91
|
isTranslate?: 0 | 1;
|
|
89
92
|
isLoadLatestVersionInfo?: 0 | 1;
|
|
90
93
|
projection?: string;
|
|
94
|
+
isLoadFreezeReason?: 0 | 1;
|
|
91
95
|
}
|
|
92
96
|
interface BatchInfoReturnType extends CommonReturn {
|
|
93
97
|
data: IResourceInfo[];
|
|
@@ -247,6 +251,11 @@ interface RelationTreeAuthParamsType {
|
|
|
247
251
|
versionRange?: string;
|
|
248
252
|
}
|
|
249
253
|
export declare function relationTreeAuth({ resourceId, ...params }: RelationTreeAuthParamsType): Promise<any>;
|
|
254
|
+
interface ResourcesCountParamsType {
|
|
255
|
+
userIds: string;
|
|
256
|
+
status?: 0 | 1 | 2 | 3;
|
|
257
|
+
}
|
|
258
|
+
export declare function resourcesCount({ ...params }: ResourcesCountParamsType): Promise<any>;
|
|
250
259
|
interface BatchAuthParamsType {
|
|
251
260
|
resourceIds: string;
|
|
252
261
|
versions?: string;
|
|
@@ -11,7 +11,23 @@ interface LogoutParamsType {
|
|
|
11
11
|
returnUrl?: string;
|
|
12
12
|
}
|
|
13
13
|
export declare function logout({ ...params }?: LogoutParamsType): Promise<any>;
|
|
14
|
-
|
|
14
|
+
interface UsersParamsType {
|
|
15
|
+
skip?: number;
|
|
16
|
+
limit?: number;
|
|
17
|
+
keywords?: string;
|
|
18
|
+
userId?: number;
|
|
19
|
+
tagIds?: string;
|
|
20
|
+
startRegisteredDate?: string;
|
|
21
|
+
endRegisteredDate?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function users(params: UsersParamsType): Promise<any>;
|
|
24
|
+
interface BatchUserListParamsType {
|
|
25
|
+
userIds: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function batchUserList(params: BatchUserListParamsType): Promise<any>;
|
|
28
|
+
interface CurrentUserInfoParamsType {
|
|
29
|
+
}
|
|
30
|
+
export declare function currentUserInfo({}?: CurrentUserInfoParamsType): Promise<any>;
|
|
15
31
|
interface UserDetailsParamsType {
|
|
16
32
|
mobile?: string;
|
|
17
33
|
username?: string;
|
|
@@ -1195,55 +1195,70 @@ function exception403(_temp12) {
|
|
|
1195
1195
|
from: fromUrl
|
|
1196
1196
|
});
|
|
1197
1197
|
}
|
|
1198
|
+
function nodeFreeze(_ref27) {
|
|
1199
|
+
var nodeID = _ref27.nodeID;
|
|
1200
|
+
return "/result/node/freeze/" + nodeID;
|
|
1201
|
+
}
|
|
1202
|
+
function resourceFreeze(_ref28) {
|
|
1203
|
+
var resourceID = _ref28.resourceID;
|
|
1204
|
+
return "/result/resource/freeze/" + resourceID;
|
|
1205
|
+
}
|
|
1198
1206
|
function login(_temp13) {
|
|
1199
|
-
var
|
|
1200
|
-
goTo =
|
|
1207
|
+
var _ref29 = _temp13 === void 0 ? {} : _temp13,
|
|
1208
|
+
goTo = _ref29.goTo;
|
|
1201
1209
|
|
|
1202
1210
|
return "/login" + handleQuery({
|
|
1203
1211
|
goTo: goTo ? encodeURIComponent(goTo) : undefined
|
|
1204
1212
|
});
|
|
1205
1213
|
}
|
|
1206
1214
|
function logon(_temp14) {
|
|
1207
|
-
var
|
|
1208
|
-
goTo =
|
|
1215
|
+
var _ref30 = _temp14 === void 0 ? {} : _temp14,
|
|
1216
|
+
goTo = _ref30.goTo;
|
|
1209
1217
|
|
|
1210
1218
|
return "/logon" + handleQuery({
|
|
1211
1219
|
goTo: goTo ? encodeURIComponent(goTo) : undefined
|
|
1212
1220
|
});
|
|
1213
1221
|
}
|
|
1214
1222
|
function retrieveUserPassword(_temp15) {
|
|
1215
|
-
var
|
|
1216
|
-
goTo =
|
|
1223
|
+
var _ref31 = _temp15 === void 0 ? {} : _temp15,
|
|
1224
|
+
goTo = _ref31.goTo;
|
|
1217
1225
|
|
|
1218
1226
|
return "/retrieve" + handleQuery({
|
|
1219
1227
|
goTo: goTo ? encodeURIComponent(goTo) : undefined
|
|
1220
1228
|
});
|
|
1221
1229
|
}
|
|
1222
1230
|
function retrievePayPassword(_temp16) {
|
|
1223
|
-
var
|
|
1231
|
+
var _ref32 = _temp16 === void 0 ? {} : _temp16;
|
|
1224
1232
|
|
|
1225
|
-
_objectDestructuringEmpty(
|
|
1233
|
+
_objectDestructuringEmpty(_ref32);
|
|
1226
1234
|
|
|
1227
1235
|
return "/retrievePayPassword";
|
|
1228
1236
|
}
|
|
1229
|
-
function
|
|
1230
|
-
var
|
|
1237
|
+
function userFreeze(_temp17) {
|
|
1238
|
+
var _ref33 = _temp17 === void 0 ? {} : _temp17;
|
|
1231
1239
|
|
|
1232
|
-
_objectDestructuringEmpty(
|
|
1240
|
+
_objectDestructuringEmpty(_ref33);
|
|
1241
|
+
|
|
1242
|
+
return "/freeze";
|
|
1243
|
+
}
|
|
1244
|
+
function wallet(_temp18) {
|
|
1245
|
+
var _ref34 = _temp18 === void 0 ? {} : _temp18;
|
|
1246
|
+
|
|
1247
|
+
_objectDestructuringEmpty(_ref34);
|
|
1233
1248
|
|
|
1234
1249
|
return "/logged/wallet";
|
|
1235
1250
|
}
|
|
1236
|
-
function contract(
|
|
1237
|
-
var
|
|
1251
|
+
function contract(_temp19) {
|
|
1252
|
+
var _ref35 = _temp19 === void 0 ? {} : _temp19;
|
|
1238
1253
|
|
|
1239
|
-
_objectDestructuringEmpty(
|
|
1254
|
+
_objectDestructuringEmpty(_ref35);
|
|
1240
1255
|
|
|
1241
1256
|
return "/logged/contract";
|
|
1242
1257
|
}
|
|
1243
|
-
function setting(
|
|
1244
|
-
var
|
|
1258
|
+
function setting(_temp20) {
|
|
1259
|
+
var _ref36 = _temp20 === void 0 ? {} : _temp20;
|
|
1245
1260
|
|
|
1246
|
-
_objectDestructuringEmpty(
|
|
1261
|
+
_objectDestructuringEmpty(_ref36);
|
|
1247
1262
|
|
|
1248
1263
|
return "/logged/setting";
|
|
1249
1264
|
}
|
|
@@ -1294,10 +1309,13 @@ var LinkTo = {
|
|
|
1294
1309
|
nodeCreateSuccess: nodeCreateSuccess,
|
|
1295
1310
|
invitation: invitation,
|
|
1296
1311
|
exception403: exception403,
|
|
1312
|
+
nodeFreeze: nodeFreeze,
|
|
1313
|
+
resourceFreeze: resourceFreeze,
|
|
1297
1314
|
login: login,
|
|
1298
1315
|
logon: logon,
|
|
1299
1316
|
retrieveUserPassword: retrieveUserPassword,
|
|
1300
1317
|
retrievePayPassword: retrievePayPassword,
|
|
1318
|
+
userFreeze: userFreeze,
|
|
1301
1319
|
wallet: wallet,
|
|
1302
1320
|
contract: contract,
|
|
1303
1321
|
setting: setting
|
|
@@ -2107,18 +2125,27 @@ function relationTreeAuth(_ref12) {
|
|
|
2107
2125
|
params: params
|
|
2108
2126
|
});
|
|
2109
2127
|
}
|
|
2110
|
-
function
|
|
2128
|
+
function resourcesCount(_ref13) {
|
|
2111
2129
|
var params = _extends({}, _ref13);
|
|
2112
2130
|
|
|
2113
2131
|
return FUtil.Request({
|
|
2114
2132
|
method: 'GET',
|
|
2115
|
-
url: "/v2/
|
|
2133
|
+
url: "/v2/resources/count",
|
|
2116
2134
|
params: params
|
|
2117
2135
|
});
|
|
2118
2136
|
}
|
|
2119
|
-
function
|
|
2137
|
+
function batchAuth$1(_ref14) {
|
|
2120
2138
|
var params = _extends({}, _ref14);
|
|
2121
2139
|
|
|
2140
|
+
return FUtil.Request({
|
|
2141
|
+
method: 'GET',
|
|
2142
|
+
url: "/v2/auths/resources/batchAuth/results",
|
|
2143
|
+
params: params
|
|
2144
|
+
});
|
|
2145
|
+
}
|
|
2146
|
+
function resourcesRecommend(_ref15) {
|
|
2147
|
+
var params = _extends({}, _ref15);
|
|
2148
|
+
|
|
2122
2149
|
return FUtil.Request({
|
|
2123
2150
|
method: 'GET',
|
|
2124
2151
|
url: "/v2/resources/recommend",
|
|
@@ -2151,6 +2178,7 @@ var Resource = {
|
|
|
2151
2178
|
cycleDependencyCheck: cycleDependencyCheck$1,
|
|
2152
2179
|
relationTree: relationTree$1,
|
|
2153
2180
|
relationTreeAuth: relationTreeAuth,
|
|
2181
|
+
resourcesCount: resourcesCount,
|
|
2154
2182
|
batchAuth: batchAuth$1,
|
|
2155
2183
|
resourcesRecommend: resourcesRecommend
|
|
2156
2184
|
};
|
|
@@ -2172,9 +2200,6 @@ function logout(_temp) {
|
|
|
2172
2200
|
var _ref2 = _temp === void 0 ? {} : _temp,
|
|
2173
2201
|
params = _extends({}, _ref2);
|
|
2174
2202
|
|
|
2175
|
-
// return FUtil.Axios.get(`/passport/logout`, {
|
|
2176
|
-
// params,
|
|
2177
|
-
// });
|
|
2178
2203
|
return FUtil.Request({
|
|
2179
2204
|
method: 'GET',
|
|
2180
2205
|
url: '/v2/passport/logout',
|
|
@@ -2182,11 +2207,26 @@ function logout(_temp) {
|
|
|
2182
2207
|
}, {
|
|
2183
2208
|
noRedirect: true
|
|
2184
2209
|
});
|
|
2185
|
-
}
|
|
2186
|
-
|
|
2187
|
-
|
|
2210
|
+
}
|
|
2211
|
+
function users(params) {
|
|
2212
|
+
return FUtil.Request({
|
|
2213
|
+
method: 'GET',
|
|
2214
|
+
url: "/v2/users",
|
|
2215
|
+
params: params
|
|
2216
|
+
});
|
|
2217
|
+
}
|
|
2218
|
+
function batchUserList(params) {
|
|
2219
|
+
return FUtil.Request({
|
|
2220
|
+
method: 'GET',
|
|
2221
|
+
url: "/v2/users/list",
|
|
2222
|
+
params: params
|
|
2223
|
+
});
|
|
2224
|
+
}
|
|
2225
|
+
function currentUserInfo(_temp2) {
|
|
2226
|
+
var _ref3 = _temp2 === void 0 ? {} : _temp2;
|
|
2227
|
+
|
|
2228
|
+
_objectDestructuringEmpty(_ref3);
|
|
2188
2229
|
|
|
2189
|
-
function currentUserInfo() {
|
|
2190
2230
|
// return FUtil.Axios.get(`/v1/userinfos/current`);
|
|
2191
2231
|
return FUtil.Request({
|
|
2192
2232
|
method: 'GET',
|
|
@@ -2207,9 +2247,9 @@ function logon$1(params) {
|
|
|
2207
2247
|
data: params
|
|
2208
2248
|
});
|
|
2209
2249
|
}
|
|
2210
|
-
function resetPassword(
|
|
2211
|
-
var loginName =
|
|
2212
|
-
params = _objectWithoutPropertiesLoose(
|
|
2250
|
+
function resetPassword(_ref4) {
|
|
2251
|
+
var loginName = _ref4.loginName,
|
|
2252
|
+
params = _objectWithoutPropertiesLoose(_ref4, _excluded$4);
|
|
2213
2253
|
|
|
2214
2254
|
return FUtil.Request({
|
|
2215
2255
|
method: 'PUT',
|
|
@@ -2307,6 +2347,8 @@ var User = {
|
|
|
2307
2347
|
__proto__: null,
|
|
2308
2348
|
login: login$1,
|
|
2309
2349
|
logout: logout,
|
|
2350
|
+
users: users,
|
|
2351
|
+
batchUserList: batchUserList,
|
|
2310
2352
|
currentUserInfo: currentUserInfo,
|
|
2311
2353
|
userDetails: userDetails,
|
|
2312
2354
|
logon: logon$1,
|
|
@@ -2895,7 +2937,7 @@ function getFilesSha1Info(_x, _x2) {
|
|
|
2895
2937
|
|
|
2896
2938
|
function _getFilesSha1Info() {
|
|
2897
2939
|
_getFilesSha1Info = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref, cdPartially) {
|
|
2898
|
-
var sha1, needHandleSha1, allData, _yield$Storage$filesL, data, finishedInfo;
|
|
2940
|
+
var sha1, delay, needHandleSha1, allData, _yield$Storage$filesL, data, finishedInfo;
|
|
2899
2941
|
|
|
2900
2942
|
return runtime_1.wrap(function _callee$(_context) {
|
|
2901
2943
|
while (1) {
|
|
@@ -2917,12 +2959,12 @@ function _getFilesSha1Info() {
|
|
|
2917
2959
|
return _context.abrupt("return", []);
|
|
2918
2960
|
|
|
2919
2961
|
case 4:
|
|
2962
|
+
delay = 500;
|
|
2920
2963
|
needHandleSha1 = [].concat(sha1);
|
|
2921
2964
|
allData = [];
|
|
2922
2965
|
|
|
2923
|
-
case
|
|
2966
|
+
case 7:
|
|
2924
2967
|
|
|
2925
|
-
console.log(needHandleSha1.join(','), 'needHandleSha1.join()90ojlskdfjsdlk');
|
|
2926
2968
|
_context.next = 10;
|
|
2927
2969
|
return filesListInfo({
|
|
2928
2970
|
sha1: needHandleSha1.join(',')
|
|
@@ -2965,10 +3007,10 @@ function _getFilesSha1Info() {
|
|
|
2965
3007
|
|
|
2966
3008
|
case 18:
|
|
2967
3009
|
_context.next = 20;
|
|
2968
|
-
return promiseSleep(
|
|
3010
|
+
return promiseSleep(delay);
|
|
2969
3011
|
|
|
2970
3012
|
case 20:
|
|
2971
|
-
_context.next =
|
|
3013
|
+
_context.next = 7;
|
|
2972
3014
|
break;
|
|
2973
3015
|
|
|
2974
3016
|
case 22:
|
|
@@ -3136,7 +3178,7 @@ function _request() {
|
|
|
3136
3178
|
case 3:
|
|
3137
3179
|
result = _context.sent;
|
|
3138
3180
|
|
|
3139
|
-
if (!(
|
|
3181
|
+
if (!(result.ret === 0 && result.errCode === 30 && !noRedirect)) {
|
|
3140
3182
|
_context.next = 8;
|
|
3141
3183
|
break;
|
|
3142
3184
|
}
|
|
@@ -3150,10 +3192,15 @@ function _request() {
|
|
|
3150
3192
|
}));
|
|
3151
3193
|
|
|
3152
3194
|
case 8:
|
|
3195
|
+
if (result.ret === 4 && result.errCode === 10 && !noRedirect) {
|
|
3196
|
+
window.location.replace("" + completeUrlByDomain('user') + userFreeze({
|
|
3197
|
+
goTo: window.location.href
|
|
3198
|
+
}));
|
|
3199
|
+
}
|
|
3153
3200
|
|
|
3154
3201
|
return _context.abrupt("return", result);
|
|
3155
3202
|
|
|
3156
|
-
case
|
|
3203
|
+
case 11:
|
|
3157
3204
|
case "end":
|
|
3158
3205
|
return _context.stop();
|
|
3159
3206
|
}
|
|
@@ -3337,7 +3384,9 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3337
3384
|
lng: lng,
|
|
3338
3385
|
fallbackLng: 'zh_CN',
|
|
3339
3386
|
interpolation: {
|
|
3340
|
-
escapeValue: false
|
|
3387
|
+
escapeValue: false,
|
|
3388
|
+
prefix: '{',
|
|
3389
|
+
suffix: '}'
|
|
3341
3390
|
}
|
|
3342
3391
|
});
|
|
3343
3392
|
|