@freelog/tools-lib 0.1.153 → 0.1.155

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.
@@ -12,6 +12,9 @@ declare class I18nNext {
12
12
  t(this: I18nNext, key: string, options?: {
13
13
  [key: string]: any;
14
14
  }): string;
15
+ tJSXElement(this: I18nNext, key: string, options?: {
16
+ [key: string]: any;
17
+ }): string | JSX.Element | JSX.Element[];
15
18
  changeLanguage(this: I18nNext, lng: LanguageKeyType): void;
16
19
  getAllLanguage(this: I18nNext): typeof allLanguage;
17
20
  getCurrentLanguage(this: I18nNext): LanguageKeyType;
@@ -42,6 +42,7 @@ interface GetRewardRecordInfoParamsType {
42
42
  export declare function getRewardRecordInfo(params: GetRewardRecordInfoParamsType): Promise<any>;
43
43
  interface PushMessageTaskParamsType {
44
44
  taskConfigCode: string;
45
+ meta?: any;
45
46
  }
46
47
  export declare function pushMessageTask(params: PushMessageTaskParamsType): Promise<any>;
47
48
  interface GetCoinAccountParamsType {
@@ -40,6 +40,7 @@ export declare function create(params: CreateParamsType): Promise<any>;
40
40
  interface UpdateParamsType {
41
41
  resourceId: string;
42
42
  status?: 0 | 1;
43
+ resourceTitle?: string;
43
44
  intro?: string;
44
45
  tags?: string[];
45
46
  coverImages?: string[];
@@ -141,7 +142,7 @@ interface CreateVersionParamsType {
141
142
  policyId: string;
142
143
  }[];
143
144
  }[];
144
- inputAttrs: {
145
+ inputAttrs?: {
145
146
  key: string;
146
147
  value: string;
147
148
  }[];
@@ -11,6 +11,7 @@ var CryptoJS = require('crypto-js');
11
11
  var React = require('react');
12
12
  var i18next = _interopDefault(require('i18next'));
13
13
  var Cookies = _interopDefault(require('js-cookie'));
14
+ var htmlReactParser = _interopDefault(require('html-react-parser'));
14
15
 
15
16
  // import {ContractEntity} from '@freelog/resource-policy-lang/dist/tools/ContractTool';
16
17
  // const {compile} = require('@freelog/resource-policy-lang');
@@ -677,89 +678,100 @@ function myCollects(_temp8) {
677
678
  }
678
679
  function resourceInfo(_ref11) {
679
680
  var resourceID = _ref11.resourceID;
680
- return "/resource/info/" + resourceID;
681
+ return "/resource/sidebar/info/" + resourceID;
681
682
  }
682
- function resourceAuth(_ref12) {
683
+ function resourcePolicy(_ref12) {
683
684
  var resourceID = _ref12.resourceID;
684
- return "/resource/auth/" + resourceID;
685
+ return "/resource/sidebar/policy/" + resourceID;
685
686
  }
686
- function resourceCreateVersion(_ref13) {
687
+ function resourceContract(_ref13) {
687
688
  var resourceID = _ref13.resourceID;
688
- return "/resource/version/creator/" + resourceID;
689
+ return "/resource/sidebar/contract/" + resourceID;
689
690
  }
690
- function resourceVersion(_ref14) {
691
- var resourceID = _ref14.resourceID,
692
- version = _ref14.version;
693
- return "/resource/version/info/" + resourceID + "/" + version;
691
+ function resourceDependency(_ref14) {
692
+ var resourceID = _ref14.resourceID;
693
+ return "/resource/sidebar/dependency/" + resourceID;
694
+ }
695
+ function resourceVersionCreator(_ref15) {
696
+ var resourceID = _ref15.resourceID;
697
+ return "/resource/versionCreator/" + resourceID;
698
+ }
699
+ function resourceVersionInfo(_ref16) {
700
+ var resourceID = _ref16.resourceID,
701
+ _ref16$version = _ref16.version,
702
+ version = _ref16$version === void 0 ? '' : _ref16$version;
703
+ return "/resource/sidebar/versionInfo/" + resourceID + handleQuery({
704
+ version: version
705
+ });
694
706
  }
695
707
  function nodeCreator(_temp9) {
696
- var _ref15 = _temp9 === void 0 ? {} : _temp9;
708
+ var _ref17 = _temp9 === void 0 ? {} : _temp9;
697
709
 
698
- _objectDestructuringEmpty(_ref15);
710
+ _objectDestructuringEmpty(_ref17);
699
711
 
700
712
  return "/node/creator";
701
713
  }
702
- function nodeManagement(_ref16) {
703
- var nodeID = _ref16.nodeID,
704
- _ref16$showPage = _ref16.showPage,
705
- showPage = _ref16$showPage === void 0 ? 'exhibit' : _ref16$showPage,
706
- params = _objectWithoutPropertiesLoose(_ref16, _excluded2);
714
+ function nodeManagement(_ref18) {
715
+ var nodeID = _ref18.nodeID,
716
+ _ref18$showPage = _ref18.showPage,
717
+ showPage = _ref18$showPage === void 0 ? 'exhibit' : _ref18$showPage,
718
+ params = _objectWithoutPropertiesLoose(_ref18, _excluded2);
707
719
 
708
720
  return "/node/formal/" + nodeID + handleQuery(_extends({
709
721
  showPage: showPage
710
722
  }, params));
711
723
  }
712
- function exhibitManagement(_ref17) {
713
- var exhibitID = _ref17.exhibitID;
724
+ function exhibitManagement(_ref19) {
725
+ var exhibitID = _ref19.exhibitID;
714
726
  return "/node/exhibit/formal/" + exhibitID;
715
727
  }
716
- function informNodeManagement(_ref18) {
717
- var nodeID = _ref18.nodeID,
718
- _ref18$showPage = _ref18.showPage,
719
- showPage = _ref18$showPage === void 0 ? 'exhibit' : _ref18$showPage,
720
- params = _objectWithoutPropertiesLoose(_ref18, _excluded3);
728
+ function informNodeManagement(_ref20) {
729
+ var nodeID = _ref20.nodeID,
730
+ _ref20$showPage = _ref20.showPage,
731
+ showPage = _ref20$showPage === void 0 ? 'exhibit' : _ref20$showPage,
732
+ params = _objectWithoutPropertiesLoose(_ref20, _excluded3);
721
733
 
722
734
  return "/node/informal/" + nodeID + handleQuery(_extends({
723
735
  showPage: showPage
724
736
  }, params));
725
737
  }
726
- function informExhibitManagement(_ref19) {
727
- var exhibitID = _ref19.exhibitID;
738
+ function informExhibitManagement(_ref21) {
739
+ var exhibitID = _ref21.exhibitID;
728
740
  return "/node/exhibit/informal/" + exhibitID;
729
741
  }
730
742
  function storageSpace(_temp10) {
731
- var _ref20 = _temp10 === void 0 ? {} : _temp10,
732
- params = _extends({}, _ref20);
743
+ var _ref22 = _temp10 === void 0 ? {} : _temp10,
744
+ params = _extends({}, _ref22);
733
745
 
734
746
  return "/storage" + handleQuery(params);
735
747
  }
736
- function objectDetails(_ref21) {
737
- var params = _extends({}, _ref21);
748
+ function objectDetails(_ref23) {
749
+ var params = _extends({}, _ref23);
738
750
 
739
751
  return "/storage" + handleQuery(params);
740
752
  }
741
- function resourceCreateSuccess(_ref22) {
742
- var resourceID = _ref22.resourceID;
753
+ function resourceCreateSuccess(_ref24) {
754
+ var resourceID = _ref24.resourceID;
743
755
  return "/result/resource/create/success/" + resourceID;
744
756
  }
745
- function resourceVersionCreateSuccess(_ref23) {
746
- var resourceID = _ref23.resourceID,
747
- version = _ref23.version;
757
+ function resourceVersionCreateSuccess(_ref25) {
758
+ var resourceID = _ref25.resourceID,
759
+ version = _ref25.version;
748
760
  return "/result/resource/version/create/success/" + resourceID + "/" + version;
749
761
  }
750
- function resourceVersionCreateRelease(_ref24) {
751
- var resourceID = _ref24.resourceID,
752
- version = _ref24.version;
762
+ function resourceVersionCreateRelease(_ref26) {
763
+ var resourceID = _ref26.resourceID,
764
+ version = _ref26.version;
753
765
  return "/result/resource/version/create/release/" + resourceID + "/" + version;
754
766
  }
755
- function nodeCreateSuccess(_ref25) {
756
- var nodeID = _ref25.nodeID;
767
+ function nodeCreateSuccess(_ref27) {
768
+ var nodeID = _ref27.nodeID;
757
769
  return "/result/node/create/success/" + nodeID;
758
770
  }
759
771
  function invitation(_temp11) {
760
- var _ref26 = _temp11 === void 0 ? {} : _temp11,
761
- goTo = _ref26.goTo,
762
- params = _objectWithoutPropertiesLoose(_ref26, _excluded4);
772
+ var _ref28 = _temp11 === void 0 ? {} : _temp11,
773
+ goTo = _ref28.goTo,
774
+ params = _objectWithoutPropertiesLoose(_ref28, _excluded4);
763
775
 
764
776
  // console.log(params.goTo, 'goTo9iowjefklsdj;flksdjflk')
765
777
  return "/invitation" + handleQuery(_extends({}, params, {
@@ -767,8 +779,8 @@ function invitation(_temp11) {
767
779
  }));
768
780
  }
769
781
  function exception403(_temp12) {
770
- var _ref27 = _temp12 === void 0 ? {} : _temp12,
771
- params = _extends({}, _ref27);
782
+ var _ref29 = _temp12 === void 0 ? {} : _temp12,
783
+ params = _extends({}, _ref29);
772
784
 
773
785
  var fromUrl = params.from || '';
774
786
 
@@ -783,42 +795,42 @@ function exception403(_temp12) {
783
795
  from: fromUrl
784
796
  });
785
797
  }
786
- function nodeFreeze(_ref28) {
787
- var nodeID = _ref28.nodeID;
798
+ function nodeFreeze(_ref30) {
799
+ var nodeID = _ref30.nodeID;
788
800
  return "/result/node/freeze/" + nodeID;
789
801
  }
790
- function resourceFreeze(_ref29) {
791
- var resourceID = _ref29.resourceID;
802
+ function resourceFreeze(_ref31) {
803
+ var resourceID = _ref31.resourceID;
792
804
  return "/result/resource/freeze/" + resourceID;
793
805
  }
794
- function globalSearch(_ref30) {
795
- var search = _ref30.search;
806
+ function globalSearch(_ref32) {
807
+ var search = _ref32.search;
796
808
  return "/search" + handleQuery({
797
809
  search: search
798
810
  });
799
811
  }
800
812
  function login(_temp13) {
801
- var _ref31 = _temp13 === void 0 ? {} : _temp13,
802
- goTo = _ref31.goTo;
813
+ var _ref33 = _temp13 === void 0 ? {} : _temp13,
814
+ goTo = _ref33.goTo;
803
815
 
804
816
  return "/login" + handleQuery({
805
817
  goTo: goTo ? encodeURIComponent(goTo) : undefined
806
818
  });
807
819
  }
808
820
  function logon(_temp14) {
809
- var _ref32 = _temp14 === void 0 ? {} : _temp14,
810
- goTo = _ref32.goTo,
811
- params = _objectWithoutPropertiesLoose(_ref32, _excluded5);
821
+ var _ref34 = _temp14 === void 0 ? {} : _temp14,
822
+ goTo = _ref34.goTo,
823
+ params = _objectWithoutPropertiesLoose(_ref34, _excluded5);
812
824
 
813
825
  return "/logon" + handleQuery(_extends({
814
826
  goTo: goTo ? encodeURIComponent(goTo) : undefined
815
827
  }, params));
816
828
  }
817
829
  function bind(_temp15) {
818
- var _ref33 = _temp15 === void 0 ? {} : _temp15,
819
- goTo = _ref33.goTo,
820
- returnUrl = _ref33.returnUrl,
821
- params = _objectWithoutPropertiesLoose(_ref33, _excluded6);
830
+ var _ref35 = _temp15 === void 0 ? {} : _temp15,
831
+ goTo = _ref35.goTo,
832
+ returnUrl = _ref35.returnUrl,
833
+ params = _objectWithoutPropertiesLoose(_ref35, _excluded6);
822
834
 
823
835
  return "/bind" + handleQuery(_extends({
824
836
  goTo: goTo ? encodeURIComponent(goTo) : undefined,
@@ -826,66 +838,66 @@ function bind(_temp15) {
826
838
  }, params));
827
839
  }
828
840
  function retrieveUserPassword(_temp16) {
829
- var _ref34 = _temp16 === void 0 ? {} : _temp16,
830
- goTo = _ref34.goTo;
841
+ var _ref36 = _temp16 === void 0 ? {} : _temp16,
842
+ goTo = _ref36.goTo;
831
843
 
832
844
  return "/retrieve" + handleQuery({
833
845
  goTo: goTo ? encodeURIComponent(goTo) : undefined
834
846
  });
835
847
  }
836
848
  function retrievePayPassword(_temp17) {
837
- var _ref35 = _temp17 === void 0 ? {} : _temp17;
849
+ var _ref37 = _temp17 === void 0 ? {} : _temp17;
838
850
 
839
- _objectDestructuringEmpty(_ref35);
851
+ _objectDestructuringEmpty(_ref37);
840
852
 
841
853
  return "/retrievePayPassword";
842
854
  }
843
855
  function userFreeze(_temp18) {
844
- var _ref36 = _temp18 === void 0 ? {} : _temp18;
856
+ var _ref38 = _temp18 === void 0 ? {} : _temp18;
845
857
 
846
- _objectDestructuringEmpty(_ref36);
858
+ _objectDestructuringEmpty(_ref38);
847
859
 
848
860
  return "/freeze";
849
861
  }
850
862
  function wallet(_temp19) {
851
- var _ref37 = _temp19 === void 0 ? {} : _temp19;
863
+ var _ref39 = _temp19 === void 0 ? {} : _temp19;
852
864
 
853
- _objectDestructuringEmpty(_ref37);
865
+ _objectDestructuringEmpty(_ref39);
854
866
 
855
867
  return "/logged/wallet";
856
868
  }
857
869
  function reward(_temp20) {
858
- var _ref38 = _temp20 === void 0 ? {} : _temp20;
870
+ var _ref40 = _temp20 === void 0 ? {} : _temp20;
859
871
 
860
- _objectDestructuringEmpty(_ref38);
872
+ _objectDestructuringEmpty(_ref40);
861
873
 
862
874
  return "/logged/reward";
863
875
  }
864
876
  function contract(_temp21) {
865
- var _ref39 = _temp21 === void 0 ? {} : _temp21;
877
+ var _ref41 = _temp21 === void 0 ? {} : _temp21;
866
878
 
867
- _objectDestructuringEmpty(_ref39);
879
+ _objectDestructuringEmpty(_ref41);
868
880
 
869
881
  return "/logged/contract";
870
882
  }
871
883
  function setting(_temp22) {
872
- var _ref40 = _temp22 === void 0 ? {} : _temp22;
884
+ var _ref42 = _temp22 === void 0 ? {} : _temp22;
873
885
 
874
- _objectDestructuringEmpty(_ref40);
886
+ _objectDestructuringEmpty(_ref42);
875
887
 
876
888
  return "/logged/setting";
877
889
  }
878
890
  function binding(_temp23) {
879
- var _ref41 = _temp23 === void 0 ? {} : _temp23;
891
+ var _ref43 = _temp23 === void 0 ? {} : _temp23;
880
892
 
881
- _objectDestructuringEmpty(_ref41);
893
+ _objectDestructuringEmpty(_ref43);
882
894
 
883
895
  return "/logged/binding";
884
896
  }
885
897
  function resultBindingSuccess(_temp24) {
886
- var _ref42 = _temp24 === void 0 ? {} : _temp24;
898
+ var _ref44 = _temp24 === void 0 ? {} : _temp24;
887
899
 
888
- _objectDestructuringEmpty(_ref42);
900
+ _objectDestructuringEmpty(_ref44);
889
901
 
890
902
  return "/result/binding";
891
903
  }
@@ -921,9 +933,11 @@ var LinkTo = {
921
933
  myResources: myResources,
922
934
  myCollects: myCollects,
923
935
  resourceInfo: resourceInfo,
924
- resourceAuth: resourceAuth,
925
- resourceCreateVersion: resourceCreateVersion,
926
- resourceVersion: resourceVersion,
936
+ resourcePolicy: resourcePolicy,
937
+ resourceContract: resourceContract,
938
+ resourceDependency: resourceDependency,
939
+ resourceVersionCreator: resourceVersionCreator,
940
+ resourceVersionInfo: resourceVersionInfo,
927
941
  nodeCreator: nodeCreator,
928
942
  nodeManagement: nodeManagement,
929
943
  exhibitManagement: exhibitManagement,
@@ -2923,8 +2937,8 @@ function getAvatarUrl(userID) {
2923
2937
  userID = 0;
2924
2938
  }
2925
2939
 
2926
- // return `${completeUrlByDomain('image')}/headImage/${userID || getUserIDByCookies()}?t=${Date.now()}`;
2927
- return "https://image.freelog.com/headImage/" + (userID || getUserIDByCookies()) + "?t=" + Date.now();
2940
+ // return `${completeUrlByDomain('image')}/avatar/${userID || getUserIDByCookies()}?t=${Date.now()}`;
2941
+ return "https://image.freelog.com/avatar/" + (userID || getUserIDByCookies()) + "?t=" + Date.now();
2928
2942
  }
2929
2943
 
2930
2944
  var Tool = {
@@ -3411,6 +3425,10 @@ var I18nNext = /*#__PURE__*/function () {
3411
3425
  return i18next.t(key.trim(), options);
3412
3426
  };
3413
3427
 
3428
+ _proto.tJSXElement = function tJSXElement(key, options) {
3429
+ return htmlReactParser(i18next.t(key.trim(), options));
3430
+ };
3431
+
3414
3432
  _proto.changeLanguage = function changeLanguage(lng) {
3415
3433
  // return i18next.changeLanguage(lng);
3416
3434
  // window.localStorage.setItem(localStorage_i18nextLng_key, lng)