@freelog/tools-lib 0.1.76 → 0.1.80

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.
@@ -44,7 +44,10 @@ interface PresentableDetailsParamsType1 {
44
44
  projection?: string;
45
45
  isLoadVersionProperty?: 0 | 1;
46
46
  isLoadPolicyInfo?: 0 | 1;
47
+ isTranslate?: 0 | 1;
47
48
  isLoadCustomPropertyDescriptors?: 0 | 1;
49
+ isLoadResourceDetailInfo?: 0 | 1;
50
+ isLoadResourceVersionInfo?: 0 | 1;
48
51
  }
49
52
  interface PresentableDetailsParamsType2 {
50
53
  nodeId: number;
@@ -79,6 +82,7 @@ interface PresentableListParamsType {
79
82
  resourceNames?: string;
80
83
  isLoadVersionProperty?: 0 | 1;
81
84
  isLoadPolicyInfo?: 0 | 1;
85
+ isTranslate?: 0 | 1;
82
86
  projection?: string;
83
87
  resolveResourceIds?: string;
84
88
  }
@@ -40,6 +40,7 @@ export declare function list(params: ListParamsType): Promise<any>;
40
40
  interface InfoParamsType {
41
41
  resourceIdOrName: string;
42
42
  isLoadPolicyInfo?: 0 | 1;
43
+ isTranslate?: 0 | 1;
43
44
  isLoadLatestVersionInfo?: 0 | 1;
44
45
  projection?: string;
45
46
  }
@@ -48,6 +49,7 @@ interface BatchInfoParamsType {
48
49
  resourceIds?: string;
49
50
  resourceNames?: string;
50
51
  isLoadPolicyInfo?: 0 | 1;
52
+ isTranslate?: 0 | 1;
51
53
  isLoadLatestVersionInfo?: 0 | 1;
52
54
  projection?: string;
53
55
  }
@@ -984,7 +984,11 @@ var USERNAME = /*#__PURE__*/new RegExp(/^([A-Za-z0-9][A-Za-z0-9-]{0,28})?[A-Za-z
984
984
 
985
985
  var PASSWORD = /*#__PURE__*/new RegExp(/^(?=.*[0-9])(?=.*[a-zA-Z])(.{6,24})$/); // 自然数
986
986
 
987
- var NATURAL_NUMBER = /*#__PURE__*/new RegExp(/^[0-9]*$/); // 对象的Bucket名称
987
+ var NATURAL_NUMBER = /*#__PURE__*/new RegExp(/^[0-9]*$/); // 正整数
988
+
989
+ var POSITIVE_INTEGER = /*#__PURE__*/new RegExp(/^[1-9]\d*$/); // 最多两位小数的正数
990
+
991
+ var MAX_2_DECIMAL_POSITIVE_NUMBER = /*#__PURE__*/new RegExp(/^\d+(.\d{1,2})?$/); // 对象的Bucket名称
988
992
 
989
993
  var BUCKET_NAME = /*#__PURE__*/new RegExp(/^([a-z0-9][a-z0-9-]{0,61})?[a-z0-9]$/); // JS变量名称
990
994
 
@@ -1004,6 +1008,8 @@ var Regexp = {
1004
1008
  USERNAME: USERNAME,
1005
1009
  PASSWORD: PASSWORD,
1006
1010
  NATURAL_NUMBER: NATURAL_NUMBER,
1011
+ POSITIVE_INTEGER: POSITIVE_INTEGER,
1012
+ MAX_2_DECIMAL_POSITIVE_NUMBER: MAX_2_DECIMAL_POSITIVE_NUMBER,
1007
1013
  BUCKET_NAME: BUCKET_NAME,
1008
1014
  JS_VARIABLE_NAME: JS_VARIABLE_NAME
1009
1015
  };
@@ -1161,18 +1167,20 @@ function retrieveUserPassword(_temp10) {
1161
1167
 
1162
1168
  function retrievePayPassword() {
1163
1169
  return "/retrievePayPassword";
1164
- } // 钱包
1170
+ } // 我的钱包
1165
1171
  // interface WalletParamsType {
1166
1172
  // }
1167
1173
 
1168
1174
  function wallet() {
1169
1175
  return "/logged/wallet";
1170
- } // interface ContractParamsType {
1176
+ } // 我的合约
1177
+ // interface ContractParamsType {
1171
1178
  // }
1172
1179
 
1173
1180
  function contract() {
1174
1181
  return "/logged/contract";
1175
- } // interface SettingParamsType {
1182
+ } // 个人设置
1183
+ // interface SettingParamsType {
1176
1184
  // }
1177
1185
 
1178
1186
  function setting() {
@@ -1478,12 +1486,37 @@ function getUserIDByCookies() {
1478
1486
 
1479
1487
  return Number(uid.replace('uid=', ''));
1480
1488
  }
1489
+ function transformServerAPIContractState(_ref) {
1490
+ var status = _ref.status,
1491
+ authStatus = _ref.authStatus;
1492
+
1493
+ if (status === 0) {
1494
+ if (authStatus === 1 || authStatus === 3) {
1495
+ return 'active';
1496
+ }
1497
+
1498
+ if (authStatus === 2) {
1499
+ return 'testActive';
1500
+ }
1501
+
1502
+ if (authStatus === 128) {
1503
+ return 'inactive';
1504
+ }
1505
+ }
1506
+
1507
+ if (status === 1) {
1508
+ return 'terminal';
1509
+ }
1510
+
1511
+ return 'exception';
1512
+ }
1481
1513
 
1482
1514
  var Tool = {
1483
1515
  __proto__: null,
1484
1516
  getSHA1Hash: getSHA1Hash,
1485
1517
  generateRandomCode: generateRandomCode,
1486
- getUserIDByCookies: getUserIDByCookies
1518
+ getUserIDByCookies: getUserIDByCookies,
1519
+ transformServerAPIContractState: transformServerAPIContractState
1487
1520
  };
1488
1521
 
1489
1522
  var FUtil = {
@@ -1605,9 +1638,6 @@ function presentableDetails(params) {
1605
1638
  });
1606
1639
  }
1607
1640
  function presentables(params) {
1608
- // return FUtil.Axios.get(`/v2/presentables`, {
1609
- // params,
1610
- // });
1611
1641
  return FUtil.Request({
1612
1642
  method: 'GET',
1613
1643
  url: "/v2/presentables",
@@ -1615,9 +1645,6 @@ function presentables(params) {
1615
1645
  });
1616
1646
  }
1617
1647
  function presentableList(params) {
1618
- // return FUtil.Axios.get(`/v2/presentables/list`, {
1619
- // params,
1620
- // });
1621
1648
  return FUtil.Request({
1622
1649
  method: 'GET',
1623
1650
  url: "/v2/presentables/list",
@@ -2030,7 +2057,6 @@ var _excluded$3 = ["resourceIdOrName"],
2030
2057
  _excluded10$1 = ["resourceId"],
2031
2058
  _excluded11 = ["resourceId"];
2032
2059
  function create$1(params) {
2033
- // return FUtil.Axios.post('/v2/resources', params)
2034
2060
  return FUtil.Request({
2035
2061
  method: 'POST',
2036
2062
  url: "/v2/resources",
@@ -2038,7 +2064,6 @@ function create$1(params) {
2038
2064
  });
2039
2065
  }
2040
2066
  function update(params) {
2041
- // return FUtil.Axios.put(`/v2/resources/${params.resourceId}`, params);
2042
2067
  return FUtil.Request({
2043
2068
  method: 'PUT',
2044
2069
  url: "/v2/resources/" + params.resourceId,
@@ -2046,9 +2071,6 @@ function update(params) {
2046
2071
  });
2047
2072
  }
2048
2073
  function list(params) {
2049
- // return FUtil.Axios.get('/v2/resources', {
2050
- // params,
2051
- // });
2052
2074
  return FUtil.Request({
2053
2075
  method: 'GET',
2054
2076
  url: "/v2/resources",
@@ -2059,9 +2081,6 @@ function info(_ref) {
2059
2081
  var resourceIdOrName = _ref.resourceIdOrName,
2060
2082
  params = _objectWithoutPropertiesLoose(_ref, _excluded$3);
2061
2083
 
2062
- // return FUtil.Axios.get(`/v2/resources/${encodeURIComponent(resourceIdOrName)}`, {
2063
- // params: params,
2064
- // });
2065
2084
  return FUtil.Request({
2066
2085
  method: 'GET',
2067
2086
  url: "/v2/resources/" + encodeURIComponent(resourceIdOrName),
@@ -2069,9 +2088,6 @@ function info(_ref) {
2069
2088
  });
2070
2089
  }
2071
2090
  function batchInfo(params) {
2072
- // return FUtil.Axios.get(`/v2/resources/list`, {
2073
- // params: params,
2074
- // });
2075
2091
  return FUtil.Request({
2076
2092
  method: 'GET',
2077
2093
  url: "/v2/resources/list",
@@ -2082,9 +2098,6 @@ function dependencyTree$1(_ref2) {
2082
2098
  var resourceId = _ref2.resourceId,
2083
2099
  params = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
2084
2100
 
2085
- // return FUtil.Axios.get(`/v2/resources/${resourceId}/dependencyTree`, {
2086
- // params: params,
2087
- // });
2088
2101
  return FUtil.Request({
2089
2102
  method: 'GET',
2090
2103
  url: "/v2/resources/" + resourceId + "/dependencyTree",
@@ -2095,9 +2108,6 @@ function authTree$1(_ref3) {
2095
2108
  var resourceId = _ref3.resourceId,
2096
2109
  params = _objectWithoutPropertiesLoose(_ref3, _excluded3$2);
2097
2110
 
2098
- // return FUtil.Axios.get(`/v2/resources/${resourceId}/authTree`, {
2099
- // params: params,
2100
- // });
2101
2111
  return FUtil.Request({
2102
2112
  method: 'GET',
2103
2113
  url: "/v2/resources/" + resourceId + "/authTree",
@@ -2116,22 +2126,13 @@ function createVersion(_ref4) {
2116
2126
  });
2117
2127
  }
2118
2128
  function resourceVersionInfo(params) {
2119
- // console.log('####!AAA');
2120
2129
  if (params.version) {
2121
- // return FUtil.Axios.get(`/v2/resources/${(params as ResourceVersionInfoParamsType1).resourceId}/versions/${(params as ResourceVersionInfoParamsType1).version}`, {
2122
- // params: {
2123
- // projection: params.projection,
2124
- // }
2125
- // });
2126
2130
  return FUtil.Request({
2127
2131
  method: 'GET',
2128
2132
  url: "/v2/resources/" + params.resourceId + "/versions/" + params.version,
2129
2133
  params: params
2130
2134
  });
2131
- } // return FUtil.Axios.get(`/v2/resources/versions/detail`, {
2132
- // params,
2133
- // });
2134
-
2135
+ }
2135
2136
 
2136
2137
  return FUtil.Request({
2137
2138
  method: 'GET',