@freelog/tools-lib 0.1.108 → 0.1.111
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/index.d.ts +2 -2
- package/dist/service-API/recombinations/index.d.ts +12 -0
- package/dist/service-API/resources.d.ts +4 -0
- package/dist/service-API/user.d.ts +8 -0
- package/dist/tools-lib.cjs.development.js +230 -117
- 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 +230 -117
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/linkTo.d.ts +4 -2
- package/dist/utils/tools.d.ts +5 -0
- package/package.json +1 -1
- package/src/service-API/index.ts +2 -2
- package/src/service-API/{combinations → recombinations}/.gitkeep +0 -0
- package/src/service-API/recombinations/index.ts +65 -0
- package/src/service-API/resources.ts +511 -497
- package/src/service-API/user.ts +28 -1
- package/src/utils/linkTo.ts +346 -344
- package/src/utils/tools.ts +85 -72
- package/dist/service-API/combinations/index.d.ts +0 -7
- package/src/service-API/combinations/index.ts +0 -27
package/dist/utils/linkTo.d.ts
CHANGED
|
@@ -16,8 +16,9 @@ interface DashboardParamsType {
|
|
|
16
16
|
}
|
|
17
17
|
export declare function dashboard({}?: DashboardParamsType): string;
|
|
18
18
|
interface MarketParamsType {
|
|
19
|
+
query?: string;
|
|
19
20
|
}
|
|
20
|
-
export declare function market({}?: MarketParamsType): TReturnType;
|
|
21
|
+
export declare function market({ ...params }?: MarketParamsType): TReturnType;
|
|
21
22
|
interface ExampleNodesParamsType {
|
|
22
23
|
}
|
|
23
24
|
export declare function exampleNodes({}?: ExampleNodesParamsType): TReturnType;
|
|
@@ -57,8 +58,9 @@ interface NodeCreatorParamsType {
|
|
|
57
58
|
export declare function nodeCreator({}?: NodeCreatorParamsType): TReturnType;
|
|
58
59
|
interface NodeManagementParamsType {
|
|
59
60
|
nodeID: number;
|
|
61
|
+
showPage?: 'exhibit' | 'theme';
|
|
60
62
|
}
|
|
61
|
-
export declare function nodeManagement({ nodeID }: NodeManagementParamsType): TReturnType;
|
|
63
|
+
export declare function nodeManagement({ nodeID, showPage, ...params }: NodeManagementParamsType): TReturnType;
|
|
62
64
|
interface ExhibitManagementParamsType {
|
|
63
65
|
exhibitID: string;
|
|
64
66
|
}
|
package/dist/utils/tools.d.ts
CHANGED
|
@@ -20,4 +20,9 @@ interface TransformServerAPIContractStateParams {
|
|
|
20
20
|
authStatus: 1 | 2 | 128 | number;
|
|
21
21
|
}
|
|
22
22
|
export declare function transformServerAPIContractState({ status, authStatus, }: TransformServerAPIContractStateParams): 'active' | 'testActive' | 'inactive' | 'terminal' | 'exception';
|
|
23
|
+
/**
|
|
24
|
+
* 暂时休眠
|
|
25
|
+
* @param ms 休眠时常(毫秒)
|
|
26
|
+
*/
|
|
27
|
+
export declare function promiseSleep(ms?: number): Promise<void>;
|
|
23
28
|
export {};
|
package/package.json
CHANGED
package/src/service-API/index.ts
CHANGED
|
@@ -13,7 +13,7 @@ import * as Activity from './activities';
|
|
|
13
13
|
import * as TestQualification from './testQualifications';
|
|
14
14
|
import * as Statistic from './statistics';
|
|
15
15
|
import * as I18n from './i18n';
|
|
16
|
-
import * as
|
|
16
|
+
import * as recombination from './recombinations';
|
|
17
17
|
|
|
18
18
|
const FServiceAPI = {
|
|
19
19
|
Node,
|
|
@@ -31,7 +31,7 @@ const FServiceAPI = {
|
|
|
31
31
|
TestQualification,
|
|
32
32
|
Statistic,
|
|
33
33
|
I18n,
|
|
34
|
-
|
|
34
|
+
recombination,
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
export default FServiceAPI;
|
|
File without changes
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as FUtil 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 needHandleSha1: string[] = [...sha1];
|
|
22
|
+
|
|
23
|
+
let allData: FileInfo[] = [];
|
|
24
|
+
|
|
25
|
+
while (true) {
|
|
26
|
+
const {data} = await Storage.filesListInfo({
|
|
27
|
+
sha1: needHandleSha1,
|
|
28
|
+
});
|
|
29
|
+
needHandleSha1 = data
|
|
30
|
+
.filter((d: any) => {
|
|
31
|
+
return d.metaAnalyzeStatus && d.metaAnalyzeStatus === 1;
|
|
32
|
+
})
|
|
33
|
+
.map((d: any) => {
|
|
34
|
+
return d.sha1;
|
|
35
|
+
});
|
|
36
|
+
const finishedInfo: FileInfo[] = data
|
|
37
|
+
.filter((d: any) => {
|
|
38
|
+
return !d.metaAnalyzeStatus || d.metaAnalyzeStatus !== 1;
|
|
39
|
+
})
|
|
40
|
+
.map((d: any) => {
|
|
41
|
+
let state: 'success' | 'fail' | 'nonentity' = 'fail';
|
|
42
|
+
if (!d.metaAnalyzeStatus) {
|
|
43
|
+
state = 'nonentity';
|
|
44
|
+
} else if (d.metaAnalyzeStatus === 2) {
|
|
45
|
+
state = 'success';
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
sha1: d.sha1,
|
|
49
|
+
state,
|
|
50
|
+
info: d,
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
cdPartially && cdPartially(finishedInfo);
|
|
54
|
+
allData = [
|
|
55
|
+
...allData,
|
|
56
|
+
...finishedInfo,
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
if (needHandleSha1.length === 0) {
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
await FUtil.promiseSleep(3000)
|
|
63
|
+
}
|
|
64
|
+
return allData;
|
|
65
|
+
}
|