@freelog/tools-lib 0.1.146 → 0.1.147
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/collections.d.ts +1 -1
- package/dist/service-API/presentables.d.ts +4 -0
- package/dist/service-API/resources.d.ts +6 -2
- package/dist/tools-lib.cjs.development.js +55 -42
- 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 +55 -42
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/axios.d.ts +0 -1
- package/dist/utils/linkTo.d.ts +5 -0
- package/package.json +1 -1
- package/src/service-API/collections.ts +81 -81
- package/src/service-API/presentables.ts +291 -287
- package/src/service-API/resources.ts +545 -533
- package/src/utils/axios.ts +141 -141
- package/src/utils/linkTo.ts +413 -403
package/dist/utils/axios.d.ts
CHANGED
package/dist/utils/linkTo.d.ts
CHANGED
|
@@ -93,6 +93,11 @@ interface ResourceVersionCreateSuccessParamsType {
|
|
|
93
93
|
version: string;
|
|
94
94
|
}
|
|
95
95
|
export declare function resourceVersionCreateSuccess({ resourceID, version }: ResourceVersionCreateSuccessParamsType): string;
|
|
96
|
+
interface ResourceVersionCreateReleaseParamsType {
|
|
97
|
+
resourceID: string;
|
|
98
|
+
version: string;
|
|
99
|
+
}
|
|
100
|
+
export declare function resourceVersionCreateRelease({ resourceID, version }: ResourceVersionCreateReleaseParamsType): string;
|
|
96
101
|
interface NodeCreateSuccessParamsType {
|
|
97
102
|
nodeID: number;
|
|
98
103
|
}
|
package/package.json
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import FUtil from '../utils';
|
|
2
|
-
|
|
3
|
-
// 收藏资源
|
|
4
|
-
interface CollectResourceParamsType {
|
|
5
|
-
resourceId: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function collectResource(params: CollectResourceParamsType) {
|
|
9
|
-
// return FUtil.Axios.post('/v2/collections/resources', params);
|
|
10
|
-
return FUtil.Request({
|
|
11
|
-
method: 'POST',
|
|
12
|
-
url: `/v2/collections/resources`,
|
|
13
|
-
data: params,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// 查看收藏的资源列表
|
|
18
|
-
interface CollectionResourcesParamsType {
|
|
19
|
-
skip?: number;
|
|
20
|
-
limit?: number;
|
|
21
|
-
keywords?: string;
|
|
22
|
-
resourceType?: string;
|
|
23
|
-
omitResourceType?: string;
|
|
24
|
-
resourceStatus?: 0 | 1 | 2;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function collectionResources(params: CollectionResourcesParamsType) {
|
|
28
|
-
// return FUtil.Axios.get('/v2/collections/resources', {
|
|
29
|
-
// params
|
|
30
|
-
// });
|
|
31
|
-
return FUtil.Request({
|
|
32
|
-
method: 'GET',
|
|
33
|
-
url: `/v2/collections/resources`,
|
|
34
|
-
params: params,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// 删除收藏的资源
|
|
40
|
-
interface DeleteCollectResourceParamsType {
|
|
41
|
-
resourceId: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function deleteCollectResource({resourceId}: DeleteCollectResourceParamsType) {
|
|
45
|
-
// return FUtil.Axios.delete(`/v2/collections/resources/${resourceId}`);
|
|
46
|
-
return FUtil.Request({
|
|
47
|
-
method: 'DELETE',
|
|
48
|
-
url: `/v2/collections/resources/${resourceId}`,
|
|
49
|
-
// params: params,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// 批量查询资源是否收藏
|
|
54
|
-
interface IsCollectedParamsType {
|
|
55
|
-
resourceIds: string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function isCollected(params: IsCollectedParamsType) {
|
|
59
|
-
// return FUtil.Axios.get('/v2/collections/resources/isCollected', {
|
|
60
|
-
// params
|
|
61
|
-
// });
|
|
62
|
-
return FUtil.Request({
|
|
63
|
-
method: 'GET',
|
|
64
|
-
url: `/v2/collections/resources/isCollected`,
|
|
65
|
-
params: params,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// 查询资源总收藏数量
|
|
70
|
-
interface CollectedCountParamsType {
|
|
71
|
-
resourceId: string;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function collectedCount({resourceId}: CollectedCountParamsType) {
|
|
75
|
-
// return FUtil.Axios.get(`/v2/collections/resources/${resourceId}/count`);
|
|
76
|
-
return FUtil.Request({
|
|
77
|
-
method: 'GET',
|
|
78
|
-
url: `/v2/collections/resources/${resourceId}/count`,
|
|
79
|
-
// params: params,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
1
|
+
import FUtil from '../utils';
|
|
2
|
+
|
|
3
|
+
// 收藏资源
|
|
4
|
+
interface CollectResourceParamsType {
|
|
5
|
+
resourceId: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function collectResource(params: CollectResourceParamsType) {
|
|
9
|
+
// return FUtil.Axios.post('/v2/collections/resources', params);
|
|
10
|
+
return FUtil.Request({
|
|
11
|
+
method: 'POST',
|
|
12
|
+
url: `/v2/collections/resources`,
|
|
13
|
+
data: params,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 查看收藏的资源列表
|
|
18
|
+
interface CollectionResourcesParamsType {
|
|
19
|
+
skip?: number;
|
|
20
|
+
limit?: number;
|
|
21
|
+
keywords?: string;
|
|
22
|
+
resourceType?: string;
|
|
23
|
+
omitResourceType?: string;
|
|
24
|
+
resourceStatus?: 0 | 1 | 2 | 4;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function collectionResources(params: CollectionResourcesParamsType) {
|
|
28
|
+
// return FUtil.Axios.get('/v2/collections/resources', {
|
|
29
|
+
// params
|
|
30
|
+
// });
|
|
31
|
+
return FUtil.Request({
|
|
32
|
+
method: 'GET',
|
|
33
|
+
url: `/v2/collections/resources`,
|
|
34
|
+
params: params,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 删除收藏的资源
|
|
40
|
+
interface DeleteCollectResourceParamsType {
|
|
41
|
+
resourceId: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function deleteCollectResource({resourceId}: DeleteCollectResourceParamsType) {
|
|
45
|
+
// return FUtil.Axios.delete(`/v2/collections/resources/${resourceId}`);
|
|
46
|
+
return FUtil.Request({
|
|
47
|
+
method: 'DELETE',
|
|
48
|
+
url: `/v2/collections/resources/${resourceId}`,
|
|
49
|
+
// params: params,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// 批量查询资源是否收藏
|
|
54
|
+
interface IsCollectedParamsType {
|
|
55
|
+
resourceIds: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function isCollected(params: IsCollectedParamsType) {
|
|
59
|
+
// return FUtil.Axios.get('/v2/collections/resources/isCollected', {
|
|
60
|
+
// params
|
|
61
|
+
// });
|
|
62
|
+
return FUtil.Request({
|
|
63
|
+
method: 'GET',
|
|
64
|
+
url: `/v2/collections/resources/isCollected`,
|
|
65
|
+
params: params,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 查询资源总收藏数量
|
|
70
|
+
interface CollectedCountParamsType {
|
|
71
|
+
resourceId: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function collectedCount({resourceId}: CollectedCountParamsType) {
|
|
75
|
+
// return FUtil.Axios.get(`/v2/collections/resources/${resourceId}/count`);
|
|
76
|
+
return FUtil.Request({
|
|
77
|
+
method: 'GET',
|
|
78
|
+
url: `/v2/collections/resources/${resourceId}/count`,
|
|
79
|
+
// params: params,
|
|
80
|
+
});
|
|
81
|
+
}
|