@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
package/dist/utils/linkTo.d.ts
CHANGED
|
@@ -105,6 +105,14 @@ interface Exception403ParamsType {
|
|
|
105
105
|
from?: string;
|
|
106
106
|
}
|
|
107
107
|
export declare function exception403({ ...params }?: Exception403ParamsType): string;
|
|
108
|
+
interface NodeFreezeParamsType {
|
|
109
|
+
nodeID: number;
|
|
110
|
+
}
|
|
111
|
+
export declare function nodeFreeze({ nodeID }: NodeFreezeParamsType): string;
|
|
112
|
+
interface ResourceFreezeParamsType {
|
|
113
|
+
resourceID: string;
|
|
114
|
+
}
|
|
115
|
+
export declare function resourceFreeze({ resourceID }: ResourceFreezeParamsType): string;
|
|
108
116
|
/************** console End ******************************************************/
|
|
109
117
|
/************** user Start ******************************************************/
|
|
110
118
|
interface LoginParamsType {
|
|
@@ -123,6 +131,9 @@ interface RetrievePayPasswordParamsType {
|
|
|
123
131
|
goTo?: string;
|
|
124
132
|
}
|
|
125
133
|
export declare function retrievePayPassword({}?: RetrievePayPasswordParamsType): string;
|
|
134
|
+
interface UserFreezeParamsType {
|
|
135
|
+
}
|
|
136
|
+
export declare function userFreeze({}?: UserFreezeParamsType): string;
|
|
126
137
|
interface WalletParamsType {
|
|
127
138
|
}
|
|
128
139
|
export declare function wallet({}?: WalletParamsType): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@freelog/tools-lib",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.116",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@freelog/resource-policy-lang": "1.1.26",
|
|
59
|
-
"@freelog/tools-lib": "^0.1.43",
|
|
60
59
|
"axios": "^0.21.1",
|
|
61
60
|
"crypto-js": "^4.0.0",
|
|
62
61
|
"i18next": "^21.8.10",
|
package/src/i18n/I18nNext.ts
CHANGED
package/src/service-API/index.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import * as Node from './nodes';
|
|
2
|
-
import * as Exhibit from './presentables';
|
|
3
|
-
import * as Storage from './storages';
|
|
4
|
-
import * as Collection from './collections';
|
|
5
|
-
import * as Resource from './resources';
|
|
6
|
-
import * as User from './user';
|
|
7
|
-
import * as InformalNode from './informalNodes';
|
|
8
|
-
import * as Contract from './contracts';
|
|
9
|
-
import * as Transaction from './transactions';
|
|
10
|
-
import * as Captcha from './captcha';
|
|
11
|
-
import * as Event from './events';
|
|
12
|
-
import * as Activity from './activities';
|
|
13
|
-
import * as TestQualification from './testQualifications';
|
|
14
|
-
import * as Statistic from './statistics';
|
|
15
|
-
import * as I18n from './i18n';
|
|
16
|
-
import * as recombination from './recombinations';
|
|
17
|
-
|
|
18
|
-
const FServiceAPI = {
|
|
19
|
-
Node,
|
|
20
|
-
Exhibit,
|
|
21
|
-
Storage,
|
|
22
|
-
Collection,
|
|
23
|
-
Resource,
|
|
24
|
-
User,
|
|
25
|
-
InformalNode,
|
|
26
|
-
Contract,
|
|
27
|
-
Transaction,
|
|
28
|
-
Captcha,
|
|
29
|
-
Event,
|
|
30
|
-
Activity,
|
|
31
|
-
TestQualification,
|
|
32
|
-
Statistic,
|
|
33
|
-
I18n,
|
|
34
|
-
recombination,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default FServiceAPI;
|
|
1
|
+
import * as Node from './nodes';
|
|
2
|
+
import * as Exhibit from './presentables';
|
|
3
|
+
import * as Storage from './storages';
|
|
4
|
+
import * as Collection from './collections';
|
|
5
|
+
import * as Resource from './resources';
|
|
6
|
+
import * as User from './user';
|
|
7
|
+
import * as InformalNode from './informalNodes';
|
|
8
|
+
import * as Contract from './contracts';
|
|
9
|
+
import * as Transaction from './transactions';
|
|
10
|
+
import * as Captcha from './captcha';
|
|
11
|
+
import * as Event from './events';
|
|
12
|
+
import * as Activity from './activities';
|
|
13
|
+
import * as TestQualification from './testQualifications';
|
|
14
|
+
import * as Statistic from './statistics';
|
|
15
|
+
import * as I18n from './i18n';
|
|
16
|
+
import * as recombination from './recombinations';
|
|
17
|
+
|
|
18
|
+
const FServiceAPI = {
|
|
19
|
+
Node,
|
|
20
|
+
Exhibit,
|
|
21
|
+
Storage,
|
|
22
|
+
Collection,
|
|
23
|
+
Resource,
|
|
24
|
+
User,
|
|
25
|
+
InformalNode,
|
|
26
|
+
Contract,
|
|
27
|
+
Transaction,
|
|
28
|
+
Captcha,
|
|
29
|
+
Event,
|
|
30
|
+
Activity,
|
|
31
|
+
TestQualification,
|
|
32
|
+
Statistic,
|
|
33
|
+
I18n,
|
|
34
|
+
recombination,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default FServiceAPI;
|
|
@@ -1,66 +1,69 @@
|
|
|
1
|
-
import * as Tool from '../../utils/tools';
|
|
2
|
-
import * as Storage from '../storages';
|
|
3
|
-
|
|
4
|
-
interface FileInfo {
|
|
5
|
-
sha1: string;
|
|
6
|
-
state: 'success' | 'fail' | 'nonentity';
|
|
7
|
-
info: {
|
|
8
|
-
[key: string]: any;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface GetFileInfosBySha1Params {
|
|
13
|
-
sha1: string[];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export async function getFilesSha1Info({sha1}: GetFileInfosBySha1Params, cdPartially: (s: any[]) => void = () => undefined): Promise<FileInfo[]> {
|
|
17
|
-
if (sha1.length === 0) {
|
|
18
|
-
return [];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
state = '
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
import * as Tool from '../../utils/tools';
|
|
2
|
+
import * as Storage from '../storages';
|
|
3
|
+
|
|
4
|
+
interface FileInfo {
|
|
5
|
+
sha1: string;
|
|
6
|
+
state: 'success' | 'fail' | 'nonentity';
|
|
7
|
+
info: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface GetFileInfosBySha1Params {
|
|
13
|
+
sha1: string[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export async function getFilesSha1Info({sha1}: GetFileInfosBySha1Params, cdPartially: (s: any[]) => void = () => undefined): Promise<FileInfo[]> {
|
|
17
|
+
if (sha1.length === 0) {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let delay: number = 500;
|
|
22
|
+
|
|
23
|
+
let needHandleSha1: string[] = [...sha1];
|
|
24
|
+
|
|
25
|
+
let allData: FileInfo[] = [];
|
|
26
|
+
|
|
27
|
+
while (true) {
|
|
28
|
+
// console.log(needHandleSha1.join(','), 'needHandleSha1.join()90ojlskdfjsdlk')
|
|
29
|
+
const {data} = await Storage.filesListInfo({
|
|
30
|
+
sha1: needHandleSha1.join(','),
|
|
31
|
+
});
|
|
32
|
+
needHandleSha1 = data
|
|
33
|
+
.filter((d: any) => {
|
|
34
|
+
return d.metaAnalyzeStatus && d.metaAnalyzeStatus === 1;
|
|
35
|
+
})
|
|
36
|
+
.map((d: any) => {
|
|
37
|
+
return d.sha1;
|
|
38
|
+
});
|
|
39
|
+
const finishedInfo: FileInfo[] = data
|
|
40
|
+
.filter((d: any) => {
|
|
41
|
+
return !d.metaAnalyzeStatus || d.metaAnalyzeStatus !== 1;
|
|
42
|
+
})
|
|
43
|
+
.map((d: any) => {
|
|
44
|
+
let state: 'success' | 'fail' | 'nonentity' = 'fail';
|
|
45
|
+
if (!d.metaAnalyzeStatus) {
|
|
46
|
+
state = 'nonentity';
|
|
47
|
+
} else if (d.metaAnalyzeStatus === 2) {
|
|
48
|
+
state = 'success';
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
sha1: d.sha1,
|
|
52
|
+
state,
|
|
53
|
+
info: d,
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
cdPartially && cdPartially(finishedInfo);
|
|
57
|
+
allData = [
|
|
58
|
+
...allData,
|
|
59
|
+
...finishedInfo,
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
if (needHandleSha1.length === 0) {
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
await Tool.promiseSleep(delay);
|
|
66
|
+
// delay += 500;
|
|
67
|
+
}
|
|
68
|
+
return allData;
|
|
69
|
+
}
|