@freelog/tools-lib 0.1.105 → 0.1.108

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.
@@ -0,0 +1,7 @@
1
+ interface GetFileInfosBySha1Params {
2
+ sha1: string[];
3
+ cdPartiallySuccess?: (s: any[]) => void;
4
+ cdPartiallyFail?: (f: any[]) => void;
5
+ }
6
+ export declare function getFilesSha1Info({ sha1, cdPartiallySuccess, cdPartiallyFail }: GetFileInfosBySha1Params): Promise<void>;
7
+ export {};
@@ -13,6 +13,7 @@ import * as Activity from './activities';
13
13
  import * as TestQualification from './testQualifications';
14
14
  import * as Statistic from './statistics';
15
15
  import * as I18n from './i18n';
16
+ import * as C from './combinations';
16
17
  declare const FServiceAPI: {
17
18
  Node: typeof Node;
18
19
  Exhibit: typeof Exhibit;
@@ -29,5 +30,6 @@ declare const FServiceAPI: {
29
30
  TestQualification: typeof TestQualification;
30
31
  Statistic: typeof Statistic;
31
32
  I18n: typeof I18n;
33
+ C: typeof C;
32
34
  };
33
35
  export default FServiceAPI;
@@ -15,7 +15,7 @@ interface IResourceInfo {
15
15
  }[];
16
16
  resourceId: string;
17
17
  resourceName: string;
18
- resourceType: string;
18
+ resourceType: string[];
19
19
  resourceVersions: {
20
20
  createDate: string;
21
21
  version: string;
@@ -29,7 +29,7 @@ interface IResourceInfo {
29
29
  }
30
30
  export interface CreateParamsType {
31
31
  name: string;
32
- resourceType: string;
32
+ resourceType: string[];
33
33
  policies?: any[];
34
34
  coverImages?: string[];
35
35
  intro?: string;
@@ -90,7 +90,7 @@ interface UpdateObjectParamsType {
90
90
  type: string;
91
91
  versionRange?: string;
92
92
  }[];
93
- resourceType?: string;
93
+ resourceType?: string[];
94
94
  }
95
95
  export declare function updateObject({ objectIdOrName, ...params }: UpdateObjectParamsType): Promise<any>;
96
96
  interface BatchObjectListParamsType {
@@ -101,7 +101,6 @@ interface BatchObjectListParamsType {
101
101
  export declare function batchObjectList(params: BatchObjectListParamsType): Promise<any>;
102
102
  interface FilePropertyParamsType {
103
103
  sha1: string;
104
- resourceType: string;
105
104
  }
106
105
  export declare function fileProperty({ sha1, ...params }: FilePropertyParamsType): Promise<any>;
107
106
  interface CycleDependencyCheckParamsType {
@@ -118,4 +117,8 @@ interface ClearUserNodeDataParamsType {
118
117
  nodeDomains?: string[];
119
118
  }
120
119
  export declare function clearUserNodeData({ ...params }: ClearUserNodeDataParamsType): Promise<any>;
120
+ interface FilesListInfoParamsType {
121
+ sha1: string[];
122
+ }
123
+ export declare function filesListInfo({ ...params }: FilesListInfoParamsType): Promise<any>;
121
124
  export {};
@@ -62,4 +62,10 @@ interface UpdateMobileOrEmailParamsType {
62
62
  newLoginName: string;
63
63
  }
64
64
  export declare function updateMobileOrEmail(params: UpdateMobileOrEmailParamsType): Promise<any>;
65
+ interface RegisterOrBindParamsType {
66
+ loginName: string;
67
+ password: string;
68
+ identityId: string;
69
+ }
70
+ export declare function registerOrBind(params: RegisterOrBindParamsType): Promise<any>;
65
71
  export {};
@@ -12,6 +12,7 @@ var NProgress = _interopDefault(require('nprogress'));
12
12
  require('nprogress/nprogress.css');
13
13
  var CryptoJS = require('crypto-js');
14
14
  var i18next = _interopDefault(require('i18next'));
15
+ var Cookies = _interopDefault(require('js-cookie'));
15
16
 
16
17
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
17
18
  try {
@@ -895,6 +896,10 @@ function completeUrlByDomain(domain) {
895
896
  function policyCodeTranslationToText(_x, _x2) {
896
897
  return _policyCodeTranslationToText.apply(this, arguments);
897
898
  }
899
+ /**
900
+ * 将资源类型关键字数组,转换成标准展示文字
901
+ * @param arr 关键字数组
902
+ */
898
903
 
899
904
  function _policyCodeTranslationToText() {
900
905
  _policyCodeTranslationToText = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(code, targetType) {
@@ -949,12 +954,17 @@ function _policyCodeTranslationToText() {
949
954
  return _policyCodeTranslationToText.apply(this, arguments);
950
955
  }
951
956
 
957
+ function resourceTypeKeyArrToResourceType(arr) {
958
+ return arr.join(' / ');
959
+ }
960
+
952
961
  var Format = {
953
962
  __proto__: null,
954
963
  humanizeSize: humanizeSize,
955
964
  formatDateTime: formatDateTime,
956
965
  completeUrlByDomain: completeUrlByDomain,
957
- policyCodeTranslationToText: policyCodeTranslationToText
966
+ policyCodeTranslationToText: policyCodeTranslationToText,
967
+ resourceTypeKeyArrToResourceType: resourceTypeKeyArrToResourceType
958
968
  };
959
969
 
960
970
  // 展品名称
@@ -1733,7 +1743,7 @@ function updateObject(_ref5) {
1733
1743
 
1734
1744
  return FUtil.Request({
1735
1745
  method: 'PUT',
1736
- url: "/v1/storages/objects/" + objectIdOrName,
1746
+ url: "/v2/storages/objects/" + objectIdOrName,
1737
1747
  data: params
1738
1748
  });
1739
1749
  }
@@ -1773,6 +1783,15 @@ function clearUserNodeData(_ref8) {
1773
1783
  data: params
1774
1784
  });
1775
1785
  }
1786
+ function filesListInfo(_ref9) {
1787
+ var params = _extends({}, _ref9);
1788
+
1789
+ return FUtil.Request({
1790
+ method: 'GET',
1791
+ url: "/v2/storages/files/list/info",
1792
+ params: params
1793
+ });
1794
+ }
1776
1795
 
1777
1796
  var Storage = {
1778
1797
  __proto__: null,
@@ -1795,7 +1814,8 @@ var Storage = {
1795
1814
  batchObjectList: batchObjectList,
1796
1815
  fileProperty: fileProperty,
1797
1816
  cycleDependencyCheck: cycleDependencyCheck,
1798
- clearUserNodeData: clearUserNodeData
1817
+ clearUserNodeData: clearUserNodeData,
1818
+ filesListInfo: filesListInfo
1799
1819
  };
1800
1820
 
1801
1821
  function collectResource(params) {
@@ -2239,6 +2259,13 @@ function updateMobileOrEmail(params) {
2239
2259
  data: params
2240
2260
  });
2241
2261
  }
2262
+ function registerOrBind(params) {
2263
+ return FUtil.Request({
2264
+ method: 'POST',
2265
+ url: "/v2/thirdParty/registerOrBind",
2266
+ data: params
2267
+ });
2268
+ }
2242
2269
 
2243
2270
  var User = {
2244
2271
  __proto__: null,
@@ -2253,7 +2280,8 @@ var User = {
2253
2280
  updateDetailInfo: updateDetailInfo,
2254
2281
  verifyLoginPassword: verifyLoginPassword,
2255
2282
  areasProvinces: areasProvinces,
2256
- updateMobileOrEmail: updateMobileOrEmail
2283
+ updateMobileOrEmail: updateMobileOrEmail,
2284
+ registerOrBind: registerOrBind
2257
2285
  };
2258
2286
 
2259
2287
  var _excluded$5 = ["nodeId"],
@@ -2721,6 +2749,47 @@ var I18n = {
2721
2749
  configsList: configsList
2722
2750
  };
2723
2751
 
2752
+ function getFilesSha1Info(_x) {
2753
+ return _getFilesSha1Info.apply(this, arguments);
2754
+ }
2755
+
2756
+ function _getFilesSha1Info() {
2757
+ _getFilesSha1Info = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref) {
2758
+ var sha1, cdPartiallySuccess, cdPartiallyFail, _yield$Storage$filesL, data, all, success, fail;
2759
+
2760
+ return runtime_1.wrap(function _callee$(_context) {
2761
+ while (1) {
2762
+ switch (_context.prev = _context.next) {
2763
+ case 0:
2764
+ sha1 = _ref.sha1, cdPartiallySuccess = _ref.cdPartiallySuccess, cdPartiallyFail = _ref.cdPartiallyFail;
2765
+ _context.next = 3;
2766
+ return filesListInfo({
2767
+ sha1: sha1
2768
+ });
2769
+
2770
+ case 3:
2771
+ _yield$Storage$filesL = _context.sent;
2772
+ data = _yield$Storage$filesL.data;
2773
+ all = [];
2774
+ success = [];
2775
+ fail = [];
2776
+ console.log(data, all, success, fail, cdPartiallySuccess, cdPartiallyFail, '093oijsdlkfsjdl');
2777
+
2778
+ case 9:
2779
+ case "end":
2780
+ return _context.stop();
2781
+ }
2782
+ }
2783
+ }, _callee);
2784
+ }));
2785
+ return _getFilesSha1Info.apply(this, arguments);
2786
+ }
2787
+
2788
+ var C = {
2789
+ __proto__: null,
2790
+ getFilesSha1Info: getFilesSha1Info
2791
+ };
2792
+
2724
2793
  var FServiceAPI = {
2725
2794
  Node: Node,
2726
2795
  Exhibit: Exhibit,
@@ -2736,7 +2805,8 @@ var FServiceAPI = {
2736
2805
  Activity: Activity,
2737
2806
  TestQualification: TestQualification,
2738
2807
  Statistic: Statistic,
2739
- I18n: I18n
2808
+ I18n: I18n,
2809
+ C: C
2740
2810
  };
2741
2811
 
2742
2812
  var codeMessage = {
@@ -2990,7 +3060,7 @@ var FUtil = {
2990
3060
  };
2991
3061
 
2992
3062
  var ossJsonUrl = 'https://freelog-i18n.oss-cn-shenzhen.aliyuncs.com/configs/i18n.json';
2993
- var localStorage_i18nextLng_key = 'i18nextLng';
3063
+ var localStorage_i18nextLng_key = 'locale';
2994
3064
  var localStorage_i18nextResources_key = 'i18nextResources';
2995
3065
  var allLanguage = [{
2996
3066
  value: 'en_US',
@@ -3004,8 +3074,9 @@ var self;
3004
3074
  var I18nNext = /*#__PURE__*/function () {
3005
3075
  function I18nNext() {
3006
3076
  this._loadingData = 'NotStart';
3007
- this._taskQueue = [];
3008
- this._currentLanguage = window.localStorage.getItem(localStorage_i18nextLng_key) || 'zh_CN';
3077
+ this._taskQueue = []; // private _currentLanguage: LanguageKeyType = window.localStorage.getItem(localStorage_i18nextLng_key) as null || 'zh_CN';
3078
+
3079
+ this._currentLanguage = Cookies.get(localStorage_i18nextLng_key) || 'zh_CN';
3009
3080
  self = this;
3010
3081
  self.ready();
3011
3082
  }
@@ -3099,7 +3170,11 @@ var I18nNext = /*#__PURE__*/function () {
3099
3170
 
3100
3171
  _proto.changeLanguage = function changeLanguage(lng) {
3101
3172
  // return i18next.changeLanguage(lng);
3102
- window.localStorage.setItem(localStorage_i18nextLng_key, lng);
3173
+ // window.localStorage.setItem(localStorage_i18nextLng_key, lng)
3174
+ Cookies.set(localStorage_i18nextLng_key, lng, {
3175
+ expires: 36525,
3176
+ domain: FUtil.Format.completeUrlByDomain('').replace(/http(s)?:\/\//, '')
3177
+ });
3103
3178
  };
3104
3179
 
3105
3180
  _proto.getAllLanguage = function getAllLanguage() {
@@ -3118,7 +3193,8 @@ var I18nNext = /*#__PURE__*/function () {
3118
3193
  switch (_context3.prev = _context3.next) {
3119
3194
  case 0:
3120
3195
  lng = self._currentLanguage;
3121
- resource = window.localStorage.getItem(localStorage_i18nextResources_key);
3196
+ resource = window.localStorage.getItem(localStorage_i18nextResources_key); // const resource: string | undefined = Cookies.get(decodeURIComponent(localStorage_i18nextResources_key));
3197
+
3122
3198
  i18nextResources = resource ? JSON.parse(resource) : null;
3123
3199
 
3124
3200
  if (i18nextResources) {
@@ -3201,7 +3277,11 @@ var I18nNext = /*#__PURE__*/function () {
3201
3277
  }
3202
3278
  }; // console.log(result, 'result093sdolkfjlsdkjl');
3203
3279
 
3204
- window.localStorage.setItem(localStorage_i18nextResources_key, JSON.stringify(result));
3280
+ window.localStorage.setItem(localStorage_i18nextResources_key, JSON.stringify(result)); // Cookies.set(localStorage_i18nextResources_key, encodeURIComponent(JSON.stringify(result)), {
3281
+ // expires: 36525,
3282
+ // domain: FUtil.Format.completeUrlByDomain('').replace(/http(s)?:\/\//, ''),
3283
+ // });
3284
+
3205
3285
  return _context4.abrupt("return", result);
3206
3286
 
3207
3287
  case 9: