@freelog/tools-lib 0.1.114 → 0.1.117
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 +8 -0
- package/dist/service-API/user.d.ts +7 -1
- package/dist/tools-lib.cjs.development.js +77 -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 +77 -38
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/linkTo.d.ts +11 -0
- package/package.json +1 -1
- package/src/service-API/resources.ts +529 -512
- package/src/service-API/user.ts +261 -251
- package/src/utils/axios.ts +5 -2
- package/src/utils/linkTo.ts +29 -0
- package/src/service-API/recombinations/.gitkeep +0 -0
|
@@ -66,6 +66,7 @@ interface ListParamsType {
|
|
|
66
66
|
projection?: string;
|
|
67
67
|
sort?: string;
|
|
68
68
|
userId?: number;
|
|
69
|
+
isLoadFreezeReason?: 0 | 1;
|
|
69
70
|
}
|
|
70
71
|
interface ListReturnType extends CommonReturn {
|
|
71
72
|
data: IResourceInfo[];
|
|
@@ -77,6 +78,7 @@ interface InfoParamsType {
|
|
|
77
78
|
isTranslate?: 0 | 1;
|
|
78
79
|
isLoadLatestVersionInfo?: 0 | 1;
|
|
79
80
|
projection?: string;
|
|
81
|
+
isLoadFreezeReason?: 0 | 1;
|
|
80
82
|
}
|
|
81
83
|
interface InfoReturnType extends CommonReturn {
|
|
82
84
|
data: IResourceInfo;
|
|
@@ -89,6 +91,7 @@ interface BatchInfoParamsType {
|
|
|
89
91
|
isTranslate?: 0 | 1;
|
|
90
92
|
isLoadLatestVersionInfo?: 0 | 1;
|
|
91
93
|
projection?: string;
|
|
94
|
+
isLoadFreezeReason?: 0 | 1;
|
|
92
95
|
}
|
|
93
96
|
interface BatchInfoReturnType extends CommonReturn {
|
|
94
97
|
data: IResourceInfo[];
|
|
@@ -248,6 +251,11 @@ interface RelationTreeAuthParamsType {
|
|
|
248
251
|
versionRange?: string;
|
|
249
252
|
}
|
|
250
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>;
|
|
251
259
|
interface BatchAuthParamsType {
|
|
252
260
|
resourceIds: string;
|
|
253
261
|
versions?: string;
|
|
@@ -11,7 +11,6 @@ interface LogoutParamsType {
|
|
|
11
11
|
returnUrl?: string;
|
|
12
12
|
}
|
|
13
13
|
export declare function logout({ ...params }?: LogoutParamsType): Promise<any>;
|
|
14
|
-
export declare function currentUserInfo(): Promise<any>;
|
|
15
14
|
interface UsersParamsType {
|
|
16
15
|
skip?: number;
|
|
17
16
|
limit?: number;
|
|
@@ -22,6 +21,13 @@ interface UsersParamsType {
|
|
|
22
21
|
endRegisteredDate?: string;
|
|
23
22
|
}
|
|
24
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>;
|
|
25
31
|
interface UserDetailsParamsType {
|
|
26
32
|
mobile?: string;
|
|
27
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,24 +2207,32 @@ function logout(_temp) {
|
|
|
2182
2207
|
}, {
|
|
2183
2208
|
noRedirect: true
|
|
2184
2209
|
});
|
|
2185
|
-
}
|
|
2186
|
-
|
|
2187
|
-
// }
|
|
2188
|
-
|
|
2189
|
-
function currentUserInfo() {
|
|
2190
|
-
// return FUtil.Axios.get(`/v1/userinfos/current`);
|
|
2210
|
+
}
|
|
2211
|
+
function users(params) {
|
|
2191
2212
|
return FUtil.Request({
|
|
2192
2213
|
method: 'GET',
|
|
2193
|
-
url:
|
|
2214
|
+
url: "/v2/users",
|
|
2215
|
+
params: params
|
|
2194
2216
|
});
|
|
2195
2217
|
}
|
|
2196
|
-
function
|
|
2218
|
+
function batchUserList(params) {
|
|
2197
2219
|
return FUtil.Request({
|
|
2198
2220
|
method: 'GET',
|
|
2199
|
-
url: "/v2/users",
|
|
2221
|
+
url: "/v2/users/list",
|
|
2200
2222
|
params: params
|
|
2201
2223
|
});
|
|
2202
2224
|
}
|
|
2225
|
+
function currentUserInfo(_temp2) {
|
|
2226
|
+
var _ref3 = _temp2 === void 0 ? {} : _temp2;
|
|
2227
|
+
|
|
2228
|
+
_objectDestructuringEmpty(_ref3);
|
|
2229
|
+
|
|
2230
|
+
// return FUtil.Axios.get(`/v1/userinfos/current`);
|
|
2231
|
+
return FUtil.Request({
|
|
2232
|
+
method: 'GET',
|
|
2233
|
+
url: '/v2/users/current'
|
|
2234
|
+
});
|
|
2235
|
+
}
|
|
2203
2236
|
function userDetails(params) {
|
|
2204
2237
|
return FUtil.Request({
|
|
2205
2238
|
method: 'GET',
|
|
@@ -2214,9 +2247,9 @@ function logon$1(params) {
|
|
|
2214
2247
|
data: params
|
|
2215
2248
|
});
|
|
2216
2249
|
}
|
|
2217
|
-
function resetPassword(
|
|
2218
|
-
var loginName =
|
|
2219
|
-
params = _objectWithoutPropertiesLoose(
|
|
2250
|
+
function resetPassword(_ref4) {
|
|
2251
|
+
var loginName = _ref4.loginName,
|
|
2252
|
+
params = _objectWithoutPropertiesLoose(_ref4, _excluded$4);
|
|
2220
2253
|
|
|
2221
2254
|
return FUtil.Request({
|
|
2222
2255
|
method: 'PUT',
|
|
@@ -2314,8 +2347,9 @@ var User = {
|
|
|
2314
2347
|
__proto__: null,
|
|
2315
2348
|
login: login$1,
|
|
2316
2349
|
logout: logout,
|
|
2317
|
-
currentUserInfo: currentUserInfo,
|
|
2318
2350
|
users: users,
|
|
2351
|
+
batchUserList: batchUserList,
|
|
2352
|
+
currentUserInfo: currentUserInfo,
|
|
2319
2353
|
userDetails: userDetails,
|
|
2320
2354
|
logon: logon$1,
|
|
2321
2355
|
resetPassword: resetPassword,
|
|
@@ -3144,7 +3178,7 @@ function _request() {
|
|
|
3144
3178
|
case 3:
|
|
3145
3179
|
result = _context.sent;
|
|
3146
3180
|
|
|
3147
|
-
if (!(
|
|
3181
|
+
if (!(result.ret === 0 && result.errCode === 30 && !noRedirect)) {
|
|
3148
3182
|
_context.next = 8;
|
|
3149
3183
|
break;
|
|
3150
3184
|
}
|
|
@@ -3158,10 +3192,15 @@ function _request() {
|
|
|
3158
3192
|
}));
|
|
3159
3193
|
|
|
3160
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
|
+
}
|
|
3161
3200
|
|
|
3162
3201
|
return _context.abrupt("return", result);
|
|
3163
3202
|
|
|
3164
|
-
case
|
|
3203
|
+
case 11:
|
|
3165
3204
|
case "end":
|
|
3166
3205
|
return _context.stop();
|
|
3167
3206
|
}
|