@freelog/tools-lib 0.1.147 → 0.1.150

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.
@@ -7,6 +7,7 @@ interface CollectionResourcesParamsType {
7
7
  limit?: number;
8
8
  keywords?: string;
9
9
  resourceType?: string;
10
+ resourceTypeCode?: string;
10
11
  omitResourceType?: string;
11
12
  resourceStatus?: 0 | 1 | 2 | 4;
12
13
  }
@@ -15,6 +15,7 @@ import * as Statistic from './statistics';
15
15
  import * as I18n from './i18n';
16
16
  import * as Policy from './policies';
17
17
  import * as recombination from './recombinations';
18
+ import * as Operation from './operation';
18
19
  declare const FServiceAPI: {
19
20
  Node: typeof Node;
20
21
  Exhibit: typeof Exhibit;
@@ -33,5 +34,6 @@ declare const FServiceAPI: {
33
34
  I18n: typeof I18n;
34
35
  Policy: typeof Policy;
35
36
  recombination: typeof recombination;
37
+ Operation: typeof Operation;
36
38
  };
37
39
  export default FServiceAPI;
@@ -18,4 +18,13 @@ interface NodesParamsType {
18
18
  projection?: string;
19
19
  }
20
20
  export declare function nodes(params: NodesParamsType): Promise<any>;
21
+ interface SetNodeInfoParamsType {
22
+ nodeId: number;
23
+ nodeLogo: string;
24
+ nodeTitle: string;
25
+ nodeShortDescription: string;
26
+ status: 1 | 2 | 8;
27
+ nodeSuspendInfo: string;
28
+ }
29
+ export declare function setNodeInfo(params: SetNodeInfoParamsType): Promise<any>;
21
30
  export {};
@@ -0,0 +1,5 @@
1
+ interface OperationCategoriesParamsType {
2
+ name?: string;
3
+ }
4
+ export declare function operationCategories({ ...params }?: OperationCategoriesParamsType): Promise<any>;
5
+ export {};
@@ -74,6 +74,7 @@ interface PresentablesParamsType {
74
74
  skip?: number;
75
75
  limit?: number;
76
76
  resourceType?: string;
77
+ resourceTypeCode?: string;
77
78
  omitResourceType?: string;
78
79
  onlineStatus?: number;
79
80
  tags?: string;
@@ -29,7 +29,8 @@ interface IResourceInfo {
29
29
  }
30
30
  export interface CreateParamsType {
31
31
  name: string;
32
- resourceType: string[];
32
+ resourceTypeCode: string;
33
+ resourceTypeName?: string;
33
34
  policies?: any[];
34
35
  coverImages?: string[];
35
36
  intro?: string;
@@ -58,6 +59,7 @@ interface ListParamsType {
58
59
  limit?: number;
59
60
  keywords?: string;
60
61
  resourceType?: string;
62
+ resourceTypeCode?: string;
61
63
  omitResourceType?: string;
62
64
  isSelf?: 0 | 1;
63
65
  userId?: number;
@@ -70,6 +72,7 @@ interface ListParamsType {
70
72
  endCreateDate?: string;
71
73
  tags?: string;
72
74
  sort?: string;
75
+ operationCategoryCode?: string;
73
76
  }
74
77
  export declare function list(params: ListParamsType): Promise<any>;
75
78
  interface InfoParamsType {
@@ -122,6 +125,7 @@ interface CreateVersionParamsType {
122
125
  }[];
123
126
  customPropertyDescriptors?: {
124
127
  key: string;
128
+ name: string;
125
129
  defaultValue: string;
126
130
  type: 'editableText' | 'readonlyText' | 'radio' | 'checkbox' | 'select';
127
131
  candidateItems?: string[];
@@ -165,6 +169,7 @@ interface UpdateResourceVersionInfoParamsType {
165
169
  description?: string;
166
170
  customPropertyDescriptors?: {
167
171
  key: string;
172
+ name: string;
168
173
  defaultValue: string;
169
174
  type: 'editableText' | 'readonlyText' | 'radio' | 'checkbox' | 'select';
170
175
  candidateItems?: string[];
@@ -270,4 +275,22 @@ interface AvailableTagsParamsType {
270
275
  resourceType: string;
271
276
  }
272
277
  export declare function availableTags({ ...params }: AvailableTagsParamsType): Promise<any>;
278
+ interface ResourceTypesParamsType {
279
+ codeOrName?: string;
280
+ category?: 1 | 2;
281
+ }
282
+ export declare function resourceTypes({ ...params }?: ResourceTypesParamsType): Promise<any>;
283
+ interface ListSimpleByParentCodeParamsType {
284
+ parentCode: string;
285
+ name?: string;
286
+ category?: 1 | 2;
287
+ }
288
+ export declare function ListSimpleByParentCode({ ...params }: ListSimpleByParentCodeParamsType): Promise<any>;
289
+ interface GetResourceTypeInfoByCodeParamsType {
290
+ code: string;
291
+ }
292
+ export declare function getResourceTypeInfoByCode({ ...params }: GetResourceTypeInfoByCodeParamsType): Promise<any>;
293
+ interface GetResourceAttrListSimple {
294
+ }
295
+ export declare function getResourceAttrListSimple({ ...params }: GetResourceAttrListSimple): Promise<any>;
273
296
  export {};
@@ -23,6 +23,7 @@ interface ObjectListParamsType {
23
23
  skip?: number;
24
24
  bucketName: string;
25
25
  resourceType?: string;
26
+ resourceTypeCode?: string;
26
27
  isLoadingTypeless?: 0 | 1;
27
28
  keywords?: string;
28
29
  projection?: string;
@@ -91,6 +92,7 @@ interface UpdateObjectParamsType {
91
92
  versionRange?: string;
92
93
  }[];
93
94
  resourceType?: string[];
95
+ resourceTypeCode?: string;
94
96
  }
95
97
  export declare function updateObject({ objectIdOrName, ...params }: UpdateObjectParamsType): Promise<any>;
96
98
  interface BatchObjectListParamsType {
@@ -1002,21 +1002,26 @@ function details(params) {
1002
1002
  });
1003
1003
  }
1004
1004
  function nodes(params) {
1005
- // return FUtil.Axios.get('/v2/nodes', {
1006
- // params
1007
- // });
1008
1005
  return FUtil.Request({
1009
1006
  method: 'GET',
1010
1007
  url: "/v2/nodes",
1011
1008
  params: params
1012
1009
  });
1013
1010
  }
1011
+ function setNodeInfo(params) {
1012
+ return FUtil.Request({
1013
+ method: 'POST',
1014
+ url: "/v2/nodes/setNodeInfo",
1015
+ data: params
1016
+ });
1017
+ }
1014
1018
 
1015
1019
  var Node = {
1016
1020
  __proto__: null,
1017
1021
  create: create,
1018
1022
  details: details,
1019
- nodes: nodes
1023
+ nodes: nodes,
1024
+ setNodeInfo: setNodeInfo
1020
1025
  };
1021
1026
 
1022
1027
  var _excluded$1 = ["presentableId"],
@@ -1769,6 +1774,43 @@ function availableTags(_ref16) {
1769
1774
  params: params
1770
1775
  });
1771
1776
  }
1777
+ function resourceTypes$1(_temp) {
1778
+ var _ref17 = _temp === void 0 ? {} : _temp,
1779
+ params = _extends({}, _ref17);
1780
+
1781
+ return FUtil.Request({
1782
+ method: 'GET',
1783
+ url: "/v2/resources/types/listSimpleByGroup",
1784
+ params: params
1785
+ });
1786
+ }
1787
+ function ListSimpleByParentCode(_ref18) {
1788
+ var params = _extends({}, _ref18);
1789
+
1790
+ return FUtil.Request({
1791
+ method: 'GET',
1792
+ url: "/v2/resources/types/listSimpleByParentCode",
1793
+ params: params
1794
+ });
1795
+ }
1796
+ function getResourceTypeInfoByCode(_ref19) {
1797
+ var params = _extends({}, _ref19);
1798
+
1799
+ return FUtil.Request({
1800
+ method: 'GET',
1801
+ url: "/v2/resources/types/getInfoByCode",
1802
+ params: params
1803
+ });
1804
+ }
1805
+ function getResourceAttrListSimple(_ref20) {
1806
+ var params = _extends({}, _ref20);
1807
+
1808
+ return FUtil.Request({
1809
+ method: 'GET',
1810
+ url: "/v2/resources/attrs/listSimple",
1811
+ params: params
1812
+ });
1813
+ }
1772
1814
 
1773
1815
  var Resource = {
1774
1816
  __proto__: null,
@@ -1798,7 +1840,11 @@ var Resource = {
1798
1840
  resourcesCount: resourcesCount,
1799
1841
  batchAuth: batchAuth$1,
1800
1842
  resourcesRecommend: resourcesRecommend,
1801
- availableTags: availableTags
1843
+ availableTags: availableTags,
1844
+ resourceTypes: resourceTypes$1,
1845
+ ListSimpleByParentCode: ListSimpleByParentCode,
1846
+ getResourceTypeInfoByCode: getResourceTypeInfoByCode,
1847
+ getResourceAttrListSimple: getResourceAttrListSimple
1802
1848
  };
1803
1849
 
1804
1850
  var _excluded$4 = ["loginName"];
@@ -2821,6 +2867,19 @@ function promiseSleep(ms) {
2821
2867
  }, ms);
2822
2868
  });
2823
2869
  }
2870
+ /**
2871
+ * 获取用户头像URL
2872
+ * @param userID
2873
+ */
2874
+
2875
+ function getAvatarUrl(userID) {
2876
+ if (userID === void 0) {
2877
+ userID = 0;
2878
+ }
2879
+
2880
+ // return `${completeUrlByDomain('image')}/headImage/${userID || getUserIDByCookies()}?t=${Date.now()}`;
2881
+ return "https://image.freelog.com/headImage/" + (userID || getUserIDByCookies()) + "?t=" + Date.now();
2882
+ }
2824
2883
 
2825
2884
  var Tool = {
2826
2885
  __proto__: null,
@@ -2828,7 +2887,8 @@ var Tool = {
2828
2887
  generateRandomCode: generateRandomCode,
2829
2888
  getUserIDByCookies: getUserIDByCookies,
2830
2889
  transformServerAPIContractState: transformServerAPIContractState,
2831
- promiseSleep: promiseSleep
2890
+ promiseSleep: promiseSleep,
2891
+ getAvatarUrl: getAvatarUrl
2832
2892
  };
2833
2893
 
2834
2894
  function getFilesSha1Info(_x, _x2) {
@@ -2961,6 +3021,22 @@ var recombination = {
2961
3021
  getFilesSha1Info: getFilesSha1Info
2962
3022
  };
2963
3023
 
3024
+ function operationCategories(_temp) {
3025
+ var _ref = _temp === void 0 ? {} : _temp,
3026
+ params = _extends({}, _ref);
3027
+
3028
+ return FUtil.Request({
3029
+ method: 'GET',
3030
+ url: "/v2/resources/operation-categories/listSimpleByGroup",
3031
+ params: params
3032
+ });
3033
+ }
3034
+
3035
+ var Operation = {
3036
+ __proto__: null,
3037
+ operationCategories: operationCategories
3038
+ };
3039
+
2964
3040
  var FServiceAPI = {
2965
3041
  Node: Node,
2966
3042
  Exhibit: Exhibit,
@@ -2978,7 +3054,8 @@ var FServiceAPI = {
2978
3054
  Statistic: Statistic,
2979
3055
  I18n: I18n,
2980
3056
  Policy: Policy,
2981
- recombination: recombination
3057
+ recombination: recombination,
3058
+ Operation: Operation
2982
3059
  };
2983
3060
 
2984
3061
  var codeMessage = {
@@ -3259,7 +3336,7 @@ var I18nNext = /*#__PURE__*/function () {
3259
3336
  }();
3260
3337
 
3261
3338
  _proto.t = function t(key, options) {
3262
- return i18next.t(key, options);
3339
+ return i18next.t(key.trim(), options);
3263
3340
  };
3264
3341
 
3265
3342
  _proto.changeLanguage = function changeLanguage(lng) {