@freelog/tools-lib 0.1.145 → 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 +68 -53
- 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 +68 -53
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/axios.d.ts +0 -1
- package/dist/utils/linkTo.d.ts +7 -1
- 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 -401
|
@@ -8,7 +8,7 @@ interface CollectionResourcesParamsType {
|
|
|
8
8
|
keywords?: string;
|
|
9
9
|
resourceType?: string;
|
|
10
10
|
omitResourceType?: string;
|
|
11
|
-
resourceStatus?: 0 | 1 | 2;
|
|
11
|
+
resourceStatus?: 0 | 1 | 2 | 4;
|
|
12
12
|
}
|
|
13
13
|
export declare function collectionResources(params: CollectionResourcesParamsType): Promise<any>;
|
|
14
14
|
interface DeleteCollectResourceParamsType {
|
|
@@ -42,6 +42,10 @@ export declare function updatePresentable({ presentableId, ...params }: UpdatePr
|
|
|
42
42
|
interface PresentablesOnlineParamsType {
|
|
43
43
|
presentableId: string;
|
|
44
44
|
onlineStatus: 0 | 1;
|
|
45
|
+
updatePolicies?: {
|
|
46
|
+
policyId: string;
|
|
47
|
+
status: 0 | 1;
|
|
48
|
+
};
|
|
45
49
|
}
|
|
46
50
|
export declare function presentablesOnlineStatus({ presentableId, ...params }: PresentablesOnlineParamsType): Promise<any>;
|
|
47
51
|
interface PresentableDetailsParamsType1 {
|
|
@@ -21,7 +21,7 @@ interface IResourceInfo {
|
|
|
21
21
|
version: string;
|
|
22
22
|
versionId: string;
|
|
23
23
|
}[];
|
|
24
|
-
status: 0 | 1 | 2 |
|
|
24
|
+
status: 0 | 1 | 2 | 4;
|
|
25
25
|
tags: string[];
|
|
26
26
|
updateDate: string;
|
|
27
27
|
userId: number;
|
|
@@ -61,7 +61,7 @@ interface ListParamsType {
|
|
|
61
61
|
omitResourceType?: string;
|
|
62
62
|
isSelf?: 0 | 1;
|
|
63
63
|
userId?: number;
|
|
64
|
-
status?: 0 | 1 | 2;
|
|
64
|
+
status?: 0 | 1 | 2 | 4;
|
|
65
65
|
isLoadPolicyInfo?: 0 | 1;
|
|
66
66
|
isLoadLatestVersionInfo?: 0 | 1;
|
|
67
67
|
isLoadFreezeReason?: 0 | 1;
|
|
@@ -266,4 +266,8 @@ interface ResourcesRecommendParamsType {
|
|
|
266
266
|
recommendType: 1 | 2;
|
|
267
267
|
}
|
|
268
268
|
export declare function resourcesRecommend({ ...params }: ResourcesRecommendParamsType): Promise<any>;
|
|
269
|
+
interface AvailableTagsParamsType {
|
|
270
|
+
resourceType: string;
|
|
271
|
+
}
|
|
272
|
+
export declare function availableTags({ ...params }: AvailableTagsParamsType): Promise<any>;
|
|
269
273
|
export {};
|
|
@@ -7,8 +7,6 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
7
7
|
var moment = _interopDefault(require('moment'));
|
|
8
8
|
var querystring = require('querystring');
|
|
9
9
|
var axios = _interopDefault(require('axios'));
|
|
10
|
-
var NProgress = _interopDefault(require('nprogress'));
|
|
11
|
-
require('nprogress/nprogress.css');
|
|
12
10
|
var CryptoJS = require('crypto-js');
|
|
13
11
|
var i18next = _interopDefault(require('i18next'));
|
|
14
12
|
var Cookies = _interopDefault(require('js-cookie'));
|
|
@@ -601,7 +599,8 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
601
599
|
var _excluded = ["resourceID"],
|
|
602
600
|
_excluded2 = ["nodeID", "showPage"],
|
|
603
601
|
_excluded3 = ["nodeID", "showPage"],
|
|
604
|
-
_excluded4 = ["goTo"]
|
|
602
|
+
_excluded4 = ["goTo"],
|
|
603
|
+
_excluded5 = ["goTo"];
|
|
605
604
|
function home(_temp) {
|
|
606
605
|
var _ref = _temp === void 0 ? {} : _temp;
|
|
607
606
|
|
|
@@ -739,22 +738,28 @@ function resourceVersionCreateSuccess(_ref23) {
|
|
|
739
738
|
version = _ref23.version;
|
|
740
739
|
return "/result/resource/version/create/success/" + resourceID + "/" + version;
|
|
741
740
|
}
|
|
742
|
-
function
|
|
743
|
-
var
|
|
741
|
+
function resourceVersionCreateRelease(_ref24) {
|
|
742
|
+
var resourceID = _ref24.resourceID,
|
|
743
|
+
version = _ref24.version;
|
|
744
|
+
return "/result/resource/version/create/release/" + resourceID + "/" + version;
|
|
745
|
+
}
|
|
746
|
+
function nodeCreateSuccess(_ref25) {
|
|
747
|
+
var nodeID = _ref25.nodeID;
|
|
744
748
|
return "/result/node/create/success/" + nodeID;
|
|
745
749
|
}
|
|
746
750
|
function invitation(_temp11) {
|
|
747
|
-
var
|
|
748
|
-
|
|
751
|
+
var _ref26 = _temp11 === void 0 ? {} : _temp11,
|
|
752
|
+
goTo = _ref26.goTo,
|
|
753
|
+
params = _objectWithoutPropertiesLoose(_ref26, _excluded4);
|
|
749
754
|
|
|
750
755
|
// console.log(params.goTo, 'goTo9iowjefklsdj;flksdjflk')
|
|
751
|
-
return "/invitation" + handleQuery({
|
|
752
|
-
returnUrl:
|
|
753
|
-
});
|
|
756
|
+
return "/invitation" + handleQuery(_extends({}, params, {
|
|
757
|
+
returnUrl: goTo ? encodeURIComponent(goTo) : undefined
|
|
758
|
+
}));
|
|
754
759
|
}
|
|
755
760
|
function exception403(_temp12) {
|
|
756
|
-
var
|
|
757
|
-
params = _extends({},
|
|
761
|
+
var _ref27 = _temp12 === void 0 ? {} : _temp12,
|
|
762
|
+
params = _extends({}, _ref27);
|
|
758
763
|
|
|
759
764
|
var fromUrl = params.from || '';
|
|
760
765
|
|
|
@@ -769,92 +774,92 @@ function exception403(_temp12) {
|
|
|
769
774
|
from: fromUrl
|
|
770
775
|
});
|
|
771
776
|
}
|
|
772
|
-
function nodeFreeze(
|
|
773
|
-
var nodeID =
|
|
777
|
+
function nodeFreeze(_ref28) {
|
|
778
|
+
var nodeID = _ref28.nodeID;
|
|
774
779
|
return "/result/node/freeze/" + nodeID;
|
|
775
780
|
}
|
|
776
|
-
function resourceFreeze(
|
|
777
|
-
var resourceID =
|
|
781
|
+
function resourceFreeze(_ref29) {
|
|
782
|
+
var resourceID = _ref29.resourceID;
|
|
778
783
|
return "/result/resource/freeze/" + resourceID;
|
|
779
784
|
}
|
|
780
785
|
function login(_temp13) {
|
|
781
|
-
var
|
|
782
|
-
goTo =
|
|
786
|
+
var _ref30 = _temp13 === void 0 ? {} : _temp13,
|
|
787
|
+
goTo = _ref30.goTo;
|
|
783
788
|
|
|
784
789
|
return "/login" + handleQuery({
|
|
785
790
|
goTo: goTo ? encodeURIComponent(goTo) : undefined
|
|
786
791
|
});
|
|
787
792
|
}
|
|
788
793
|
function logon(_temp14) {
|
|
789
|
-
var
|
|
790
|
-
goTo =
|
|
791
|
-
params = _objectWithoutPropertiesLoose(
|
|
794
|
+
var _ref31 = _temp14 === void 0 ? {} : _temp14,
|
|
795
|
+
goTo = _ref31.goTo,
|
|
796
|
+
params = _objectWithoutPropertiesLoose(_ref31, _excluded5);
|
|
792
797
|
|
|
793
798
|
return "/logon" + handleQuery(_extends({
|
|
794
799
|
goTo: goTo ? encodeURIComponent(goTo) : undefined
|
|
795
800
|
}, params));
|
|
796
801
|
}
|
|
797
802
|
function retrieveUserPassword(_temp15) {
|
|
798
|
-
var
|
|
799
|
-
goTo =
|
|
803
|
+
var _ref32 = _temp15 === void 0 ? {} : _temp15,
|
|
804
|
+
goTo = _ref32.goTo;
|
|
800
805
|
|
|
801
806
|
return "/retrieve" + handleQuery({
|
|
802
807
|
goTo: goTo ? encodeURIComponent(goTo) : undefined
|
|
803
808
|
});
|
|
804
809
|
}
|
|
805
810
|
function retrievePayPassword(_temp16) {
|
|
806
|
-
var
|
|
811
|
+
var _ref33 = _temp16 === void 0 ? {} : _temp16;
|
|
807
812
|
|
|
808
|
-
_objectDestructuringEmpty(
|
|
813
|
+
_objectDestructuringEmpty(_ref33);
|
|
809
814
|
|
|
810
815
|
return "/retrievePayPassword";
|
|
811
816
|
}
|
|
812
817
|
function userFreeze(_temp17) {
|
|
813
|
-
var
|
|
818
|
+
var _ref34 = _temp17 === void 0 ? {} : _temp17;
|
|
814
819
|
|
|
815
|
-
_objectDestructuringEmpty(
|
|
820
|
+
_objectDestructuringEmpty(_ref34);
|
|
816
821
|
|
|
817
822
|
return "/freeze";
|
|
818
823
|
}
|
|
819
824
|
function wallet(_temp18) {
|
|
820
|
-
var
|
|
825
|
+
var _ref35 = _temp18 === void 0 ? {} : _temp18;
|
|
821
826
|
|
|
822
|
-
_objectDestructuringEmpty(
|
|
827
|
+
_objectDestructuringEmpty(_ref35);
|
|
823
828
|
|
|
824
829
|
return "/logged/wallet";
|
|
825
830
|
}
|
|
826
831
|
function reward(_temp19) {
|
|
827
|
-
var
|
|
832
|
+
var _ref36 = _temp19 === void 0 ? {} : _temp19;
|
|
828
833
|
|
|
829
|
-
_objectDestructuringEmpty(
|
|
834
|
+
_objectDestructuringEmpty(_ref36);
|
|
830
835
|
|
|
831
836
|
return "/logged/reward";
|
|
832
837
|
}
|
|
833
838
|
function contract(_temp20) {
|
|
834
|
-
var
|
|
839
|
+
var _ref37 = _temp20 === void 0 ? {} : _temp20;
|
|
835
840
|
|
|
836
|
-
_objectDestructuringEmpty(
|
|
841
|
+
_objectDestructuringEmpty(_ref37);
|
|
837
842
|
|
|
838
843
|
return "/logged/contract";
|
|
839
844
|
}
|
|
840
845
|
function setting(_temp21) {
|
|
841
|
-
var
|
|
846
|
+
var _ref38 = _temp21 === void 0 ? {} : _temp21;
|
|
842
847
|
|
|
843
|
-
_objectDestructuringEmpty(
|
|
848
|
+
_objectDestructuringEmpty(_ref38);
|
|
844
849
|
|
|
845
850
|
return "/logged/setting";
|
|
846
851
|
}
|
|
847
852
|
function binding(_temp22) {
|
|
848
|
-
var
|
|
853
|
+
var _ref39 = _temp22 === void 0 ? {} : _temp22;
|
|
849
854
|
|
|
850
|
-
_objectDestructuringEmpty(
|
|
855
|
+
_objectDestructuringEmpty(_ref39);
|
|
851
856
|
|
|
852
857
|
return "/logged/binding";
|
|
853
858
|
}
|
|
854
859
|
function resultBindingSuccess(_temp23) {
|
|
855
|
-
var
|
|
860
|
+
var _ref40 = _temp23 === void 0 ? {} : _temp23;
|
|
856
861
|
|
|
857
|
-
_objectDestructuringEmpty(
|
|
862
|
+
_objectDestructuringEmpty(_ref40);
|
|
858
863
|
|
|
859
864
|
return "/result/binding";
|
|
860
865
|
}
|
|
@@ -902,6 +907,7 @@ var LinkTo = {
|
|
|
902
907
|
objectDetails: objectDetails,
|
|
903
908
|
resourceCreateSuccess: resourceCreateSuccess,
|
|
904
909
|
resourceVersionCreateSuccess: resourceVersionCreateSuccess,
|
|
910
|
+
resourceVersionCreateRelease: resourceVersionCreateRelease,
|
|
905
911
|
nodeCreateSuccess: nodeCreateSuccess,
|
|
906
912
|
invitation: invitation,
|
|
907
913
|
exception403: exception403,
|
|
@@ -1017,7 +1023,7 @@ var _excluded$1 = ["presentableId"],
|
|
|
1017
1023
|
_excluded2$1 = ["presentableId"],
|
|
1018
1024
|
_excluded3$1 = ["presentableId"],
|
|
1019
1025
|
_excluded4$1 = ["presentableId"],
|
|
1020
|
-
_excluded5 = ["presentableId"],
|
|
1026
|
+
_excluded5$1 = ["presentableId"],
|
|
1021
1027
|
_excluded6 = ["presentableId"],
|
|
1022
1028
|
_excluded7 = ["presentableId"],
|
|
1023
1029
|
_excluded8 = ["presentableId"],
|
|
@@ -1104,7 +1110,7 @@ function dependencyTree(_ref3) {
|
|
|
1104
1110
|
}
|
|
1105
1111
|
function relationTree(_ref4) {
|
|
1106
1112
|
var presentableId = _ref4.presentableId,
|
|
1107
|
-
params = _objectWithoutPropertiesLoose(_ref4, _excluded5);
|
|
1113
|
+
params = _objectWithoutPropertiesLoose(_ref4, _excluded5$1);
|
|
1108
1114
|
|
|
1109
1115
|
// return FUtil.Axios.get(`/v2/presentables/${presentableId}/relationTree`, {params});
|
|
1110
1116
|
return FUtil.Request({
|
|
@@ -1194,7 +1200,7 @@ var _excluded$2 = ["bucketName"],
|
|
|
1194
1200
|
_excluded2$2 = ["bucketName"],
|
|
1195
1201
|
_excluded3$2 = ["objectIdOrName"],
|
|
1196
1202
|
_excluded4$2 = ["sha1"],
|
|
1197
|
-
_excluded5$
|
|
1203
|
+
_excluded5$2 = ["objectIdOrName"];
|
|
1198
1204
|
function createBucket(params) {
|
|
1199
1205
|
return FUtil.Request({
|
|
1200
1206
|
method: 'POST',
|
|
@@ -1389,7 +1395,7 @@ function fileProperty(_ref6) {
|
|
|
1389
1395
|
}
|
|
1390
1396
|
function cycleDependencyCheck(_ref7) {
|
|
1391
1397
|
var objectIdOrName = _ref7.objectIdOrName,
|
|
1392
|
-
params = _objectWithoutPropertiesLoose(_ref7, _excluded5$
|
|
1398
|
+
params = _objectWithoutPropertiesLoose(_ref7, _excluded5$2);
|
|
1393
1399
|
|
|
1394
1400
|
return FUtil.Request({
|
|
1395
1401
|
method: 'POST',
|
|
@@ -1499,7 +1505,7 @@ var _excluded$3 = ["resourceIdOrName"],
|
|
|
1499
1505
|
_excluded2$3 = ["resourceId"],
|
|
1500
1506
|
_excluded3$3 = ["resourceId"],
|
|
1501
1507
|
_excluded4$3 = ["resourceId"],
|
|
1502
|
-
_excluded5$
|
|
1508
|
+
_excluded5$3 = ["resourceId", "version"],
|
|
1503
1509
|
_excluded6$1 = ["fileSha1"],
|
|
1504
1510
|
_excluded7$1 = ["fileSha1"],
|
|
1505
1511
|
_excluded8$1 = ["resourceId"],
|
|
@@ -1582,7 +1588,7 @@ function createVersion(_ref4) {
|
|
|
1582
1588
|
function resourceVersionInfo1(_ref5) {
|
|
1583
1589
|
var resourceId = _ref5.resourceId,
|
|
1584
1590
|
version = _ref5.version,
|
|
1585
|
-
params = _objectWithoutPropertiesLoose(_ref5, _excluded5$
|
|
1591
|
+
params = _objectWithoutPropertiesLoose(_ref5, _excluded5$3);
|
|
1586
1592
|
|
|
1587
1593
|
return FUtil.Request({
|
|
1588
1594
|
method: 'GET',
|
|
@@ -1754,6 +1760,15 @@ function resourcesRecommend(_ref15) {
|
|
|
1754
1760
|
params: params
|
|
1755
1761
|
});
|
|
1756
1762
|
}
|
|
1763
|
+
function availableTags(_ref16) {
|
|
1764
|
+
var params = _extends({}, _ref16);
|
|
1765
|
+
|
|
1766
|
+
return FUtil.Request({
|
|
1767
|
+
method: 'GET',
|
|
1768
|
+
url: "/v2/resources/tags/availableTags",
|
|
1769
|
+
params: params
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1757
1772
|
|
|
1758
1773
|
var Resource = {
|
|
1759
1774
|
__proto__: null,
|
|
@@ -1782,7 +1797,8 @@ var Resource = {
|
|
|
1782
1797
|
relationTreeAuth: relationTreeAuth,
|
|
1783
1798
|
resourcesCount: resourcesCount,
|
|
1784
1799
|
batchAuth: batchAuth$1,
|
|
1785
|
-
resourcesRecommend: resourcesRecommend
|
|
1800
|
+
resourcesRecommend: resourcesRecommend,
|
|
1801
|
+
availableTags: availableTags
|
|
1786
1802
|
};
|
|
1787
1803
|
|
|
1788
1804
|
var _excluded$4 = ["loginName"];
|
|
@@ -1994,7 +2010,7 @@ var _excluded$5 = ["nodeId"],
|
|
|
1994
2010
|
_excluded2$4 = ["nodeId"],
|
|
1995
2011
|
_excluded3$4 = ["nodeId"],
|
|
1996
2012
|
_excluded4$4 = ["nodeId"],
|
|
1997
|
-
_excluded5$
|
|
2013
|
+
_excluded5$4 = ["nodeId"],
|
|
1998
2014
|
_excluded6$2 = ["testResourceId"],
|
|
1999
2015
|
_excluded7$2 = ["testResourceId"],
|
|
2000
2016
|
_excluded8$2 = ["nodeId"],
|
|
@@ -2043,7 +2059,7 @@ function dependencyTree$2(_ref4) {
|
|
|
2043
2059
|
}
|
|
2044
2060
|
function putRules(_ref5) {
|
|
2045
2061
|
var nodeId = _ref5.nodeId,
|
|
2046
|
-
params = _objectWithoutPropertiesLoose(_ref5, _excluded5$
|
|
2062
|
+
params = _objectWithoutPropertiesLoose(_ref5, _excluded5$4);
|
|
2047
2063
|
|
|
2048
2064
|
return FUtil.Request({
|
|
2049
2065
|
method: 'PUT',
|
|
@@ -3016,11 +3032,11 @@ if (window.location.hostname.includes('.com')) {
|
|
|
3016
3032
|
|
|
3017
3033
|
axios.interceptors.request.use(function (config) {
|
|
3018
3034
|
// Do something before request is sent
|
|
3019
|
-
NProgress.start();
|
|
3035
|
+
// NProgress.start();
|
|
3020
3036
|
return config;
|
|
3021
3037
|
}, function (error) {
|
|
3022
3038
|
// Do something with request error
|
|
3023
|
-
NProgress.done();
|
|
3039
|
+
// NProgress.done();
|
|
3024
3040
|
return Promise.reject(error);
|
|
3025
3041
|
});
|
|
3026
3042
|
/**
|
|
@@ -3032,8 +3048,7 @@ axios.interceptors.response.use(function (response) {
|
|
|
3032
3048
|
|
|
3033
3049
|
// Do something with response data
|
|
3034
3050
|
// console.log(response, 'response!!!!!!');
|
|
3035
|
-
NProgress.done();
|
|
3036
|
-
|
|
3051
|
+
// NProgress.done();
|
|
3037
3052
|
if (response.status !== 200) {
|
|
3038
3053
|
var error = {
|
|
3039
3054
|
description: codeMessage[response.status],
|
|
@@ -3065,7 +3080,7 @@ axios.interceptors.response.use(function (response) {
|
|
|
3065
3080
|
return data;
|
|
3066
3081
|
}, function (error) {
|
|
3067
3082
|
// Do something with response error
|
|
3068
|
-
NProgress.done();
|
|
3083
|
+
// NProgress.done();
|
|
3069
3084
|
return Promise.reject(error);
|
|
3070
3085
|
});
|
|
3071
3086
|
function request(_x, _x2) {
|