@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.
@@ -1,8 +1,6 @@
1
1
  import moment from 'moment';
2
2
  import { stringify } from 'querystring';
3
3
  import axios from 'axios';
4
- import NProgress from 'nprogress';
5
- import 'nprogress/nprogress.css';
6
4
  import { lib, SHA1 } from 'crypto-js';
7
5
  import i18next from 'i18next';
8
6
  import Cookies from 'js-cookie';
@@ -595,7 +593,8 @@ function _objectWithoutPropertiesLoose(source, excluded) {
595
593
  var _excluded = ["resourceID"],
596
594
  _excluded2 = ["nodeID", "showPage"],
597
595
  _excluded3 = ["nodeID", "showPage"],
598
- _excluded4 = ["goTo"];
596
+ _excluded4 = ["goTo"],
597
+ _excluded5 = ["goTo"];
599
598
  function home(_temp) {
600
599
  var _ref = _temp === void 0 ? {} : _temp;
601
600
 
@@ -733,22 +732,28 @@ function resourceVersionCreateSuccess(_ref23) {
733
732
  version = _ref23.version;
734
733
  return "/result/resource/version/create/success/" + resourceID + "/" + version;
735
734
  }
736
- function nodeCreateSuccess(_ref24) {
737
- var nodeID = _ref24.nodeID;
735
+ function resourceVersionCreateRelease(_ref24) {
736
+ var resourceID = _ref24.resourceID,
737
+ version = _ref24.version;
738
+ return "/result/resource/version/create/release/" + resourceID + "/" + version;
739
+ }
740
+ function nodeCreateSuccess(_ref25) {
741
+ var nodeID = _ref25.nodeID;
738
742
  return "/result/node/create/success/" + nodeID;
739
743
  }
740
744
  function invitation(_temp11) {
741
- var _ref25 = _temp11 === void 0 ? {} : _temp11,
742
- params = _extends({}, _ref25);
745
+ var _ref26 = _temp11 === void 0 ? {} : _temp11,
746
+ goTo = _ref26.goTo,
747
+ params = _objectWithoutPropertiesLoose(_ref26, _excluded4);
743
748
 
744
749
  // console.log(params.goTo, 'goTo9iowjefklsdj;flksdjflk')
745
- return "/invitation" + handleQuery({
746
- returnUrl: params.goTo ? encodeURIComponent(params.goTo) : undefined
747
- });
750
+ return "/invitation" + handleQuery(_extends({}, params, {
751
+ returnUrl: goTo ? encodeURIComponent(goTo) : undefined
752
+ }));
748
753
  }
749
754
  function exception403(_temp12) {
750
- var _ref26 = _temp12 === void 0 ? {} : _temp12,
751
- params = _extends({}, _ref26);
755
+ var _ref27 = _temp12 === void 0 ? {} : _temp12,
756
+ params = _extends({}, _ref27);
752
757
 
753
758
  var fromUrl = params.from || '';
754
759
 
@@ -763,92 +768,92 @@ function exception403(_temp12) {
763
768
  from: fromUrl
764
769
  });
765
770
  }
766
- function nodeFreeze(_ref27) {
767
- var nodeID = _ref27.nodeID;
771
+ function nodeFreeze(_ref28) {
772
+ var nodeID = _ref28.nodeID;
768
773
  return "/result/node/freeze/" + nodeID;
769
774
  }
770
- function resourceFreeze(_ref28) {
771
- var resourceID = _ref28.resourceID;
775
+ function resourceFreeze(_ref29) {
776
+ var resourceID = _ref29.resourceID;
772
777
  return "/result/resource/freeze/" + resourceID;
773
778
  }
774
779
  function login(_temp13) {
775
- var _ref29 = _temp13 === void 0 ? {} : _temp13,
776
- goTo = _ref29.goTo;
780
+ var _ref30 = _temp13 === void 0 ? {} : _temp13,
781
+ goTo = _ref30.goTo;
777
782
 
778
783
  return "/login" + handleQuery({
779
784
  goTo: goTo ? encodeURIComponent(goTo) : undefined
780
785
  });
781
786
  }
782
787
  function logon(_temp14) {
783
- var _ref30 = _temp14 === void 0 ? {} : _temp14,
784
- goTo = _ref30.goTo,
785
- params = _objectWithoutPropertiesLoose(_ref30, _excluded4);
788
+ var _ref31 = _temp14 === void 0 ? {} : _temp14,
789
+ goTo = _ref31.goTo,
790
+ params = _objectWithoutPropertiesLoose(_ref31, _excluded5);
786
791
 
787
792
  return "/logon" + handleQuery(_extends({
788
793
  goTo: goTo ? encodeURIComponent(goTo) : undefined
789
794
  }, params));
790
795
  }
791
796
  function retrieveUserPassword(_temp15) {
792
- var _ref31 = _temp15 === void 0 ? {} : _temp15,
793
- goTo = _ref31.goTo;
797
+ var _ref32 = _temp15 === void 0 ? {} : _temp15,
798
+ goTo = _ref32.goTo;
794
799
 
795
800
  return "/retrieve" + handleQuery({
796
801
  goTo: goTo ? encodeURIComponent(goTo) : undefined
797
802
  });
798
803
  }
799
804
  function retrievePayPassword(_temp16) {
800
- var _ref32 = _temp16 === void 0 ? {} : _temp16;
805
+ var _ref33 = _temp16 === void 0 ? {} : _temp16;
801
806
 
802
- _objectDestructuringEmpty(_ref32);
807
+ _objectDestructuringEmpty(_ref33);
803
808
 
804
809
  return "/retrievePayPassword";
805
810
  }
806
811
  function userFreeze(_temp17) {
807
- var _ref33 = _temp17 === void 0 ? {} : _temp17;
812
+ var _ref34 = _temp17 === void 0 ? {} : _temp17;
808
813
 
809
- _objectDestructuringEmpty(_ref33);
814
+ _objectDestructuringEmpty(_ref34);
810
815
 
811
816
  return "/freeze";
812
817
  }
813
818
  function wallet(_temp18) {
814
- var _ref34 = _temp18 === void 0 ? {} : _temp18;
819
+ var _ref35 = _temp18 === void 0 ? {} : _temp18;
815
820
 
816
- _objectDestructuringEmpty(_ref34);
821
+ _objectDestructuringEmpty(_ref35);
817
822
 
818
823
  return "/logged/wallet";
819
824
  }
820
825
  function reward(_temp19) {
821
- var _ref35 = _temp19 === void 0 ? {} : _temp19;
826
+ var _ref36 = _temp19 === void 0 ? {} : _temp19;
822
827
 
823
- _objectDestructuringEmpty(_ref35);
828
+ _objectDestructuringEmpty(_ref36);
824
829
 
825
830
  return "/logged/reward";
826
831
  }
827
832
  function contract(_temp20) {
828
- var _ref36 = _temp20 === void 0 ? {} : _temp20;
833
+ var _ref37 = _temp20 === void 0 ? {} : _temp20;
829
834
 
830
- _objectDestructuringEmpty(_ref36);
835
+ _objectDestructuringEmpty(_ref37);
831
836
 
832
837
  return "/logged/contract";
833
838
  }
834
839
  function setting(_temp21) {
835
- var _ref37 = _temp21 === void 0 ? {} : _temp21;
840
+ var _ref38 = _temp21 === void 0 ? {} : _temp21;
836
841
 
837
- _objectDestructuringEmpty(_ref37);
842
+ _objectDestructuringEmpty(_ref38);
838
843
 
839
844
  return "/logged/setting";
840
845
  }
841
846
  function binding(_temp22) {
842
- var _ref38 = _temp22 === void 0 ? {} : _temp22;
847
+ var _ref39 = _temp22 === void 0 ? {} : _temp22;
843
848
 
844
- _objectDestructuringEmpty(_ref38);
849
+ _objectDestructuringEmpty(_ref39);
845
850
 
846
851
  return "/logged/binding";
847
852
  }
848
853
  function resultBindingSuccess(_temp23) {
849
- var _ref39 = _temp23 === void 0 ? {} : _temp23;
854
+ var _ref40 = _temp23 === void 0 ? {} : _temp23;
850
855
 
851
- _objectDestructuringEmpty(_ref39);
856
+ _objectDestructuringEmpty(_ref40);
852
857
 
853
858
  return "/result/binding";
854
859
  }
@@ -896,6 +901,7 @@ var LinkTo = {
896
901
  objectDetails: objectDetails,
897
902
  resourceCreateSuccess: resourceCreateSuccess,
898
903
  resourceVersionCreateSuccess: resourceVersionCreateSuccess,
904
+ resourceVersionCreateRelease: resourceVersionCreateRelease,
899
905
  nodeCreateSuccess: nodeCreateSuccess,
900
906
  invitation: invitation,
901
907
  exception403: exception403,
@@ -1011,7 +1017,7 @@ var _excluded$1 = ["presentableId"],
1011
1017
  _excluded2$1 = ["presentableId"],
1012
1018
  _excluded3$1 = ["presentableId"],
1013
1019
  _excluded4$1 = ["presentableId"],
1014
- _excluded5 = ["presentableId"],
1020
+ _excluded5$1 = ["presentableId"],
1015
1021
  _excluded6 = ["presentableId"],
1016
1022
  _excluded7 = ["presentableId"],
1017
1023
  _excluded8 = ["presentableId"],
@@ -1098,7 +1104,7 @@ function dependencyTree(_ref3) {
1098
1104
  }
1099
1105
  function relationTree(_ref4) {
1100
1106
  var presentableId = _ref4.presentableId,
1101
- params = _objectWithoutPropertiesLoose(_ref4, _excluded5);
1107
+ params = _objectWithoutPropertiesLoose(_ref4, _excluded5$1);
1102
1108
 
1103
1109
  // return FUtil.Axios.get(`/v2/presentables/${presentableId}/relationTree`, {params});
1104
1110
  return FUtil.Request({
@@ -1188,7 +1194,7 @@ var _excluded$2 = ["bucketName"],
1188
1194
  _excluded2$2 = ["bucketName"],
1189
1195
  _excluded3$2 = ["objectIdOrName"],
1190
1196
  _excluded4$2 = ["sha1"],
1191
- _excluded5$1 = ["objectIdOrName"];
1197
+ _excluded5$2 = ["objectIdOrName"];
1192
1198
  function createBucket(params) {
1193
1199
  return FUtil.Request({
1194
1200
  method: 'POST',
@@ -1383,7 +1389,7 @@ function fileProperty(_ref6) {
1383
1389
  }
1384
1390
  function cycleDependencyCheck(_ref7) {
1385
1391
  var objectIdOrName = _ref7.objectIdOrName,
1386
- params = _objectWithoutPropertiesLoose(_ref7, _excluded5$1);
1392
+ params = _objectWithoutPropertiesLoose(_ref7, _excluded5$2);
1387
1393
 
1388
1394
  return FUtil.Request({
1389
1395
  method: 'POST',
@@ -1493,7 +1499,7 @@ var _excluded$3 = ["resourceIdOrName"],
1493
1499
  _excluded2$3 = ["resourceId"],
1494
1500
  _excluded3$3 = ["resourceId"],
1495
1501
  _excluded4$3 = ["resourceId"],
1496
- _excluded5$2 = ["resourceId", "version"],
1502
+ _excluded5$3 = ["resourceId", "version"],
1497
1503
  _excluded6$1 = ["fileSha1"],
1498
1504
  _excluded7$1 = ["fileSha1"],
1499
1505
  _excluded8$1 = ["resourceId"],
@@ -1576,7 +1582,7 @@ function createVersion(_ref4) {
1576
1582
  function resourceVersionInfo1(_ref5) {
1577
1583
  var resourceId = _ref5.resourceId,
1578
1584
  version = _ref5.version,
1579
- params = _objectWithoutPropertiesLoose(_ref5, _excluded5$2);
1585
+ params = _objectWithoutPropertiesLoose(_ref5, _excluded5$3);
1580
1586
 
1581
1587
  return FUtil.Request({
1582
1588
  method: 'GET',
@@ -1748,6 +1754,15 @@ function resourcesRecommend(_ref15) {
1748
1754
  params: params
1749
1755
  });
1750
1756
  }
1757
+ function availableTags(_ref16) {
1758
+ var params = _extends({}, _ref16);
1759
+
1760
+ return FUtil.Request({
1761
+ method: 'GET',
1762
+ url: "/v2/resources/tags/availableTags",
1763
+ params: params
1764
+ });
1765
+ }
1751
1766
 
1752
1767
  var Resource = {
1753
1768
  __proto__: null,
@@ -1776,7 +1791,8 @@ var Resource = {
1776
1791
  relationTreeAuth: relationTreeAuth,
1777
1792
  resourcesCount: resourcesCount,
1778
1793
  batchAuth: batchAuth$1,
1779
- resourcesRecommend: resourcesRecommend
1794
+ resourcesRecommend: resourcesRecommend,
1795
+ availableTags: availableTags
1780
1796
  };
1781
1797
 
1782
1798
  var _excluded$4 = ["loginName"];
@@ -1988,7 +2004,7 @@ var _excluded$5 = ["nodeId"],
1988
2004
  _excluded2$4 = ["nodeId"],
1989
2005
  _excluded3$4 = ["nodeId"],
1990
2006
  _excluded4$4 = ["nodeId"],
1991
- _excluded5$3 = ["nodeId"],
2007
+ _excluded5$4 = ["nodeId"],
1992
2008
  _excluded6$2 = ["testResourceId"],
1993
2009
  _excluded7$2 = ["testResourceId"],
1994
2010
  _excluded8$2 = ["nodeId"],
@@ -2037,7 +2053,7 @@ function dependencyTree$2(_ref4) {
2037
2053
  }
2038
2054
  function putRules(_ref5) {
2039
2055
  var nodeId = _ref5.nodeId,
2040
- params = _objectWithoutPropertiesLoose(_ref5, _excluded5$3);
2056
+ params = _objectWithoutPropertiesLoose(_ref5, _excluded5$4);
2041
2057
 
2042
2058
  return FUtil.Request({
2043
2059
  method: 'PUT',
@@ -3010,11 +3026,11 @@ if (window.location.hostname.includes('.com')) {
3010
3026
 
3011
3027
  axios.interceptors.request.use(function (config) {
3012
3028
  // Do something before request is sent
3013
- NProgress.start();
3029
+ // NProgress.start();
3014
3030
  return config;
3015
3031
  }, function (error) {
3016
3032
  // Do something with request error
3017
- NProgress.done();
3033
+ // NProgress.done();
3018
3034
  return Promise.reject(error);
3019
3035
  });
3020
3036
  /**
@@ -3026,8 +3042,7 @@ axios.interceptors.response.use(function (response) {
3026
3042
 
3027
3043
  // Do something with response data
3028
3044
  // console.log(response, 'response!!!!!!');
3029
- NProgress.done();
3030
-
3045
+ // NProgress.done();
3031
3046
  if (response.status !== 200) {
3032
3047
  var error = {
3033
3048
  description: codeMessage[response.status],
@@ -3059,7 +3074,7 @@ axios.interceptors.response.use(function (response) {
3059
3074
  return data;
3060
3075
  }, function (error) {
3061
3076
  // Do something with response error
3062
- NProgress.done();
3077
+ // NProgress.done();
3063
3078
  return Promise.reject(error);
3064
3079
  });
3065
3080
  function request(_x, _x2) {