@freelog/tools-lib 0.1.146 → 0.1.148
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 +71 -44
- 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 +71 -44
- 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/dist/utils/tools.d.ts +5 -0
- package/package.json +1 -1
- package/src/i18n/I18nNext.ts +155 -155
- 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/src/utils/tools.ts +8 -0
|
@@ -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'));
|
|
@@ -740,14 +738,19 @@ function resourceVersionCreateSuccess(_ref23) {
|
|
|
740
738
|
version = _ref23.version;
|
|
741
739
|
return "/result/resource/version/create/success/" + resourceID + "/" + version;
|
|
742
740
|
}
|
|
743
|
-
function
|
|
744
|
-
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;
|
|
745
748
|
return "/result/node/create/success/" + nodeID;
|
|
746
749
|
}
|
|
747
750
|
function invitation(_temp11) {
|
|
748
|
-
var
|
|
749
|
-
goTo =
|
|
750
|
-
params = _objectWithoutPropertiesLoose(
|
|
751
|
+
var _ref26 = _temp11 === void 0 ? {} : _temp11,
|
|
752
|
+
goTo = _ref26.goTo,
|
|
753
|
+
params = _objectWithoutPropertiesLoose(_ref26, _excluded4);
|
|
751
754
|
|
|
752
755
|
// console.log(params.goTo, 'goTo9iowjefklsdj;flksdjflk')
|
|
753
756
|
return "/invitation" + handleQuery(_extends({}, params, {
|
|
@@ -755,8 +758,8 @@ function invitation(_temp11) {
|
|
|
755
758
|
}));
|
|
756
759
|
}
|
|
757
760
|
function exception403(_temp12) {
|
|
758
|
-
var
|
|
759
|
-
params = _extends({},
|
|
761
|
+
var _ref27 = _temp12 === void 0 ? {} : _temp12,
|
|
762
|
+
params = _extends({}, _ref27);
|
|
760
763
|
|
|
761
764
|
var fromUrl = params.from || '';
|
|
762
765
|
|
|
@@ -771,92 +774,92 @@ function exception403(_temp12) {
|
|
|
771
774
|
from: fromUrl
|
|
772
775
|
});
|
|
773
776
|
}
|
|
774
|
-
function nodeFreeze(
|
|
775
|
-
var nodeID =
|
|
777
|
+
function nodeFreeze(_ref28) {
|
|
778
|
+
var nodeID = _ref28.nodeID;
|
|
776
779
|
return "/result/node/freeze/" + nodeID;
|
|
777
780
|
}
|
|
778
|
-
function resourceFreeze(
|
|
779
|
-
var resourceID =
|
|
781
|
+
function resourceFreeze(_ref29) {
|
|
782
|
+
var resourceID = _ref29.resourceID;
|
|
780
783
|
return "/result/resource/freeze/" + resourceID;
|
|
781
784
|
}
|
|
782
785
|
function login(_temp13) {
|
|
783
|
-
var
|
|
784
|
-
goTo =
|
|
786
|
+
var _ref30 = _temp13 === void 0 ? {} : _temp13,
|
|
787
|
+
goTo = _ref30.goTo;
|
|
785
788
|
|
|
786
789
|
return "/login" + handleQuery({
|
|
787
790
|
goTo: goTo ? encodeURIComponent(goTo) : undefined
|
|
788
791
|
});
|
|
789
792
|
}
|
|
790
793
|
function logon(_temp14) {
|
|
791
|
-
var
|
|
792
|
-
goTo =
|
|
793
|
-
params = _objectWithoutPropertiesLoose(
|
|
794
|
+
var _ref31 = _temp14 === void 0 ? {} : _temp14,
|
|
795
|
+
goTo = _ref31.goTo,
|
|
796
|
+
params = _objectWithoutPropertiesLoose(_ref31, _excluded5);
|
|
794
797
|
|
|
795
798
|
return "/logon" + handleQuery(_extends({
|
|
796
799
|
goTo: goTo ? encodeURIComponent(goTo) : undefined
|
|
797
800
|
}, params));
|
|
798
801
|
}
|
|
799
802
|
function retrieveUserPassword(_temp15) {
|
|
800
|
-
var
|
|
801
|
-
goTo =
|
|
803
|
+
var _ref32 = _temp15 === void 0 ? {} : _temp15,
|
|
804
|
+
goTo = _ref32.goTo;
|
|
802
805
|
|
|
803
806
|
return "/retrieve" + handleQuery({
|
|
804
807
|
goTo: goTo ? encodeURIComponent(goTo) : undefined
|
|
805
808
|
});
|
|
806
809
|
}
|
|
807
810
|
function retrievePayPassword(_temp16) {
|
|
808
|
-
var
|
|
811
|
+
var _ref33 = _temp16 === void 0 ? {} : _temp16;
|
|
809
812
|
|
|
810
|
-
_objectDestructuringEmpty(
|
|
813
|
+
_objectDestructuringEmpty(_ref33);
|
|
811
814
|
|
|
812
815
|
return "/retrievePayPassword";
|
|
813
816
|
}
|
|
814
817
|
function userFreeze(_temp17) {
|
|
815
|
-
var
|
|
818
|
+
var _ref34 = _temp17 === void 0 ? {} : _temp17;
|
|
816
819
|
|
|
817
|
-
_objectDestructuringEmpty(
|
|
820
|
+
_objectDestructuringEmpty(_ref34);
|
|
818
821
|
|
|
819
822
|
return "/freeze";
|
|
820
823
|
}
|
|
821
824
|
function wallet(_temp18) {
|
|
822
|
-
var
|
|
825
|
+
var _ref35 = _temp18 === void 0 ? {} : _temp18;
|
|
823
826
|
|
|
824
|
-
_objectDestructuringEmpty(
|
|
827
|
+
_objectDestructuringEmpty(_ref35);
|
|
825
828
|
|
|
826
829
|
return "/logged/wallet";
|
|
827
830
|
}
|
|
828
831
|
function reward(_temp19) {
|
|
829
|
-
var
|
|
832
|
+
var _ref36 = _temp19 === void 0 ? {} : _temp19;
|
|
830
833
|
|
|
831
|
-
_objectDestructuringEmpty(
|
|
834
|
+
_objectDestructuringEmpty(_ref36);
|
|
832
835
|
|
|
833
836
|
return "/logged/reward";
|
|
834
837
|
}
|
|
835
838
|
function contract(_temp20) {
|
|
836
|
-
var
|
|
839
|
+
var _ref37 = _temp20 === void 0 ? {} : _temp20;
|
|
837
840
|
|
|
838
|
-
_objectDestructuringEmpty(
|
|
841
|
+
_objectDestructuringEmpty(_ref37);
|
|
839
842
|
|
|
840
843
|
return "/logged/contract";
|
|
841
844
|
}
|
|
842
845
|
function setting(_temp21) {
|
|
843
|
-
var
|
|
846
|
+
var _ref38 = _temp21 === void 0 ? {} : _temp21;
|
|
844
847
|
|
|
845
|
-
_objectDestructuringEmpty(
|
|
848
|
+
_objectDestructuringEmpty(_ref38);
|
|
846
849
|
|
|
847
850
|
return "/logged/setting";
|
|
848
851
|
}
|
|
849
852
|
function binding(_temp22) {
|
|
850
|
-
var
|
|
853
|
+
var _ref39 = _temp22 === void 0 ? {} : _temp22;
|
|
851
854
|
|
|
852
|
-
_objectDestructuringEmpty(
|
|
855
|
+
_objectDestructuringEmpty(_ref39);
|
|
853
856
|
|
|
854
857
|
return "/logged/binding";
|
|
855
858
|
}
|
|
856
859
|
function resultBindingSuccess(_temp23) {
|
|
857
|
-
var
|
|
860
|
+
var _ref40 = _temp23 === void 0 ? {} : _temp23;
|
|
858
861
|
|
|
859
|
-
_objectDestructuringEmpty(
|
|
862
|
+
_objectDestructuringEmpty(_ref40);
|
|
860
863
|
|
|
861
864
|
return "/result/binding";
|
|
862
865
|
}
|
|
@@ -904,6 +907,7 @@ var LinkTo = {
|
|
|
904
907
|
objectDetails: objectDetails,
|
|
905
908
|
resourceCreateSuccess: resourceCreateSuccess,
|
|
906
909
|
resourceVersionCreateSuccess: resourceVersionCreateSuccess,
|
|
910
|
+
resourceVersionCreateRelease: resourceVersionCreateRelease,
|
|
907
911
|
nodeCreateSuccess: nodeCreateSuccess,
|
|
908
912
|
invitation: invitation,
|
|
909
913
|
exception403: exception403,
|
|
@@ -1756,6 +1760,15 @@ function resourcesRecommend(_ref15) {
|
|
|
1756
1760
|
params: params
|
|
1757
1761
|
});
|
|
1758
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
|
+
}
|
|
1759
1772
|
|
|
1760
1773
|
var Resource = {
|
|
1761
1774
|
__proto__: null,
|
|
@@ -1784,7 +1797,8 @@ var Resource = {
|
|
|
1784
1797
|
relationTreeAuth: relationTreeAuth,
|
|
1785
1798
|
resourcesCount: resourcesCount,
|
|
1786
1799
|
batchAuth: batchAuth$1,
|
|
1787
|
-
resourcesRecommend: resourcesRecommend
|
|
1800
|
+
resourcesRecommend: resourcesRecommend,
|
|
1801
|
+
availableTags: availableTags
|
|
1788
1802
|
};
|
|
1789
1803
|
|
|
1790
1804
|
var _excluded$4 = ["loginName"];
|
|
@@ -2807,6 +2821,19 @@ function promiseSleep(ms) {
|
|
|
2807
2821
|
}, ms);
|
|
2808
2822
|
});
|
|
2809
2823
|
}
|
|
2824
|
+
/**
|
|
2825
|
+
* 获取用户头像URL
|
|
2826
|
+
* @param userID
|
|
2827
|
+
*/
|
|
2828
|
+
|
|
2829
|
+
function getAvatarUrl(userID) {
|
|
2830
|
+
if (userID === void 0) {
|
|
2831
|
+
userID = 0;
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
// return `${completeUrlByDomain('image')}/headImage/${userID || getUserIDByCookies()}?t=${Date.now()}`;
|
|
2835
|
+
return "https://image.freelog.com/headImage/" + (userID || getUserIDByCookies()) + "?t=" + Date.now();
|
|
2836
|
+
}
|
|
2810
2837
|
|
|
2811
2838
|
var Tool = {
|
|
2812
2839
|
__proto__: null,
|
|
@@ -2814,7 +2841,8 @@ var Tool = {
|
|
|
2814
2841
|
generateRandomCode: generateRandomCode,
|
|
2815
2842
|
getUserIDByCookies: getUserIDByCookies,
|
|
2816
2843
|
transformServerAPIContractState: transformServerAPIContractState,
|
|
2817
|
-
promiseSleep: promiseSleep
|
|
2844
|
+
promiseSleep: promiseSleep,
|
|
2845
|
+
getAvatarUrl: getAvatarUrl
|
|
2818
2846
|
};
|
|
2819
2847
|
|
|
2820
2848
|
function getFilesSha1Info(_x, _x2) {
|
|
@@ -3018,11 +3046,11 @@ if (window.location.hostname.includes('.com')) {
|
|
|
3018
3046
|
|
|
3019
3047
|
axios.interceptors.request.use(function (config) {
|
|
3020
3048
|
// Do something before request is sent
|
|
3021
|
-
NProgress.start();
|
|
3049
|
+
// NProgress.start();
|
|
3022
3050
|
return config;
|
|
3023
3051
|
}, function (error) {
|
|
3024
3052
|
// Do something with request error
|
|
3025
|
-
NProgress.done();
|
|
3053
|
+
// NProgress.done();
|
|
3026
3054
|
return Promise.reject(error);
|
|
3027
3055
|
});
|
|
3028
3056
|
/**
|
|
@@ -3034,8 +3062,7 @@ axios.interceptors.response.use(function (response) {
|
|
|
3034
3062
|
|
|
3035
3063
|
// Do something with response data
|
|
3036
3064
|
// console.log(response, 'response!!!!!!');
|
|
3037
|
-
NProgress.done();
|
|
3038
|
-
|
|
3065
|
+
// NProgress.done();
|
|
3039
3066
|
if (response.status !== 200) {
|
|
3040
3067
|
var error = {
|
|
3041
3068
|
description: codeMessage[response.status],
|
|
@@ -3067,7 +3094,7 @@ axios.interceptors.response.use(function (response) {
|
|
|
3067
3094
|
return data;
|
|
3068
3095
|
}, function (error) {
|
|
3069
3096
|
// Do something with response error
|
|
3070
|
-
NProgress.done();
|
|
3097
|
+
// NProgress.done();
|
|
3071
3098
|
return Promise.reject(error);
|
|
3072
3099
|
});
|
|
3073
3100
|
function request(_x, _x2) {
|
|
@@ -3246,7 +3273,7 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3246
3273
|
}();
|
|
3247
3274
|
|
|
3248
3275
|
_proto.t = function t(key, options) {
|
|
3249
|
-
return i18next.t(key, options);
|
|
3276
|
+
return i18next.t(key.trim(), options);
|
|
3250
3277
|
};
|
|
3251
3278
|
|
|
3252
3279
|
_proto.changeLanguage = function changeLanguage(lng) {
|