@freelog/tools-lib 0.1.84 → 0.1.87

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,4 +1,6 @@
1
1
  interface List4ClientParamsType {
2
+ skip?: number;
3
+ limit?: number;
2
4
  }
3
5
  export declare function list4Client(params: List4ClientParamsType): Promise<any>;
4
6
  interface Find4ClientParamsType {
@@ -8,36 +8,49 @@ interface TestResourcesParamsType {
8
8
  omitResourceType?: string;
9
9
  keywords?: string;
10
10
  }
11
- export declare function testResources({ nodeId, ...params }: TestResourcesParamsType): Promise<any>;
11
+ export declare function testResources({ nodeId, ...params }: TestResourcesParamsType): Promise<void | (import("./tools").CommonReturn & {
12
+ data: any;
13
+ })>;
12
14
  interface CreateRulesParamsType {
13
15
  nodeId: number;
14
16
  testRuleText: string;
15
17
  }
16
- export declare function createRules({ nodeId, ...params }: CreateRulesParamsType): Promise<any>;
18
+ export declare function createRules({ nodeId, ...params }: CreateRulesParamsType): Promise<void | (import("./tools").CommonReturn & {
19
+ data: any;
20
+ })>;
17
21
  interface BatchTestResourcesParamsType {
18
22
  nodeId: number;
19
23
  entityType?: 'resource' | 'object';
20
24
  entityIds?: string;
21
25
  entityNames?: string;
26
+ testResourceNames?: string;
22
27
  projection?: string;
23
28
  }
24
- export declare function batchTestResources({ nodeId, ...params }: BatchTestResourcesParamsType): Promise<any>;
29
+ export declare function batchTestResources({ nodeId, ...params }: BatchTestResourcesParamsType): Promise<void | (import("./tools").CommonReturn & {
30
+ data: any;
31
+ })>;
25
32
  interface DependencyTreeParamsType {
26
33
  nodeId: number;
27
34
  keywords: string;
28
35
  resourceType?: string;
29
36
  omitResourceType?: string;
30
37
  }
31
- export declare function dependencyTree({ nodeId, ...params }: DependencyTreeParamsType): Promise<any>;
38
+ export declare function dependencyTree({ nodeId, ...params }: DependencyTreeParamsType): Promise<void | (import("./tools").CommonReturn & {
39
+ data: any;
40
+ })>;
32
41
  interface PutRulesParamsType {
33
42
  nodeId: number;
34
43
  additionalTestRule: string;
35
44
  }
36
- export declare function putRules({ nodeId, ...params }: PutRulesParamsType): Promise<any>;
45
+ export declare function putRules({ nodeId, ...params }: PutRulesParamsType): Promise<void | (import("./tools").CommonReturn & {
46
+ data: any;
47
+ })>;
37
48
  interface TestNodeRulesParamsType {
38
49
  nodeId: number;
39
50
  }
40
- export declare function testNodeRules({ nodeId }: TestNodeRulesParamsType): Promise<any>;
51
+ export declare function testNodeRules({ nodeId }: TestNodeRulesParamsType): Promise<void | (import("./tools").CommonReturn & {
52
+ data: any;
53
+ })>;
41
54
  interface UpdateTestResourceContractsParamsType {
42
55
  testResourceId: string;
43
56
  resolveResources: {
@@ -47,25 +60,35 @@ interface UpdateTestResourceContractsParamsType {
47
60
  }[];
48
61
  }[];
49
62
  }
50
- export declare function updateTestResourceContracts({ testResourceId, ...params }: UpdateTestResourceContractsParamsType): Promise<any>;
63
+ export declare function updateTestResourceContracts({ testResourceId, ...params }: UpdateTestResourceContractsParamsType): Promise<void | (import("./tools").CommonReturn & {
64
+ data: any;
65
+ })>;
51
66
  interface DependencyTreeFilterParamsType {
52
67
  testResourceId: string;
53
68
  dependentEntityId: string;
54
69
  dependentEntityVersionRange?: string;
55
70
  }
56
- export declare function dependencyTreeFilter({ testResourceId, ...params }: DependencyTreeFilterParamsType): Promise<any>;
71
+ export declare function dependencyTreeFilter({ testResourceId, ...params }: DependencyTreeFilterParamsType): Promise<void | (import("./tools").CommonReturn & {
72
+ data: any;
73
+ })>;
57
74
  interface TestResourcesDependencyTreeParamsType {
58
75
  testResourceId: string;
59
76
  }
60
- export declare function testResourcesDependencyTree({ testResourceId }: TestResourcesDependencyTreeParamsType): Promise<any>;
77
+ export declare function testResourcesDependencyTree({ testResourceId }: TestResourcesDependencyTreeParamsType): Promise<void | (import("./tools").CommonReturn & {
78
+ data: any;
79
+ })>;
61
80
  interface TestResourcesAuthTreeParamsType {
62
81
  testResourceId: string;
63
82
  }
64
- export declare function testResourcesAuthTree({ testResourceId }: TestResourcesAuthTreeParamsType): Promise<any>;
83
+ export declare function testResourcesAuthTree({ testResourceId }: TestResourcesAuthTreeParamsType): Promise<void | (import("./tools").CommonReturn & {
84
+ data: any;
85
+ })>;
65
86
  interface TestResourceDetailsParamsType {
66
87
  testResourceId: string;
67
88
  }
68
- export declare function testResourceDetails({ testResourceId }: TestResourceDetailsParamsType): Promise<any>;
89
+ export declare function testResourceDetails({ testResourceId }: TestResourceDetailsParamsType): Promise<void | (import("./tools").CommonReturn & {
90
+ data: any;
91
+ })>;
69
92
  interface SearchTestResourcesByDependencyParamsType {
70
93
  nodeId: number;
71
94
  dependentEntityId: string;
@@ -73,21 +96,29 @@ interface SearchTestResourcesByDependencyParamsType {
73
96
  resourceType?: string;
74
97
  omitResourceType?: string;
75
98
  }
76
- export declare function searchTestResourcesByDependency({ nodeId, ...params }: SearchTestResourcesByDependencyParamsType): Promise<any>;
99
+ export declare function searchTestResourcesByDependency({ nodeId, ...params }: SearchTestResourcesByDependencyParamsType): Promise<void | (import("./tools").CommonReturn & {
100
+ data: any;
101
+ })>;
77
102
  interface RulesRematchParamsType {
78
103
  nodeId: number;
79
104
  isMandatoryMatch?: 0 | 1;
80
105
  }
81
- export declare function rulesRematch({ nodeId, ...params }: RulesRematchParamsType): Promise<any>;
106
+ export declare function rulesRematch({ nodeId, ...params }: RulesRematchParamsType): Promise<void | (import("./tools").CommonReturn & {
107
+ data: any;
108
+ })>;
82
109
  interface RulesPreExecutionParamsType {
83
110
  nodeId: number;
84
111
  testRuleText: string;
85
112
  }
86
- export declare function rulesPreExecution({ nodeId, ...params }: RulesPreExecutionParamsType): Promise<any>;
113
+ export declare function rulesPreExecution({ nodeId, ...params }: RulesPreExecutionParamsType): Promise<void | (import("./tools").CommonReturn & {
114
+ data: any;
115
+ })>;
87
116
  interface BatchGetAuthsParamsType {
88
117
  nodeId: number;
89
118
  exhibitIds: string;
90
119
  authType: 1 | 2 | 3;
91
120
  }
92
- export declare function batchGetAuths({ nodeId, ...params }: BatchGetAuthsParamsType): Promise<any>;
121
+ export declare function batchGetAuths({ nodeId, ...params }: BatchGetAuthsParamsType): Promise<void | (import("./tools").CommonReturn & {
122
+ data: any;
123
+ })>;
93
124
  export {};
@@ -4,12 +4,16 @@ interface PoliciesParamsType {
4
4
  subjectType?: 1 | 2 | 3;
5
5
  projection?: string;
6
6
  }
7
- export declare function policies(params: PoliciesParamsType): Promise<any>;
7
+ export declare function policies(params: PoliciesParamsType): Promise<void | (import("./tools").CommonReturn & {
8
+ data: any;
9
+ })>;
8
10
  interface PoliciesListParamsType {
9
11
  policyIds: string;
10
12
  subjectType?: number;
11
13
  userId?: number;
12
14
  projection?: string;
13
15
  }
14
- export declare function policiesList(params: PoliciesListParamsType): Promise<any>;
16
+ export declare function policiesList(params: PoliciesListParamsType): Promise<void | (import("./tools").CommonReturn & {
17
+ data: any;
18
+ })>;
15
19
  export {};
@@ -133,16 +133,17 @@ interface CreateVersionParamsType {
133
133
  }[];
134
134
  }
135
135
  export declare function createVersion({ resourceId, ...params }: CreateVersionParamsType): Promise<any>;
136
- interface ResourceVersionInfoParamsType1 {
136
+ interface ResourceVersionInfo1ParamsType {
137
137
  resourceId: string;
138
138
  version: string;
139
139
  projection?: string;
140
140
  }
141
- interface ResourceVersionInfoParamsType2 {
141
+ interface ResourceVersionInfo2ParamsType {
142
142
  versionId: string;
143
143
  projection?: string;
144
144
  }
145
- export declare function resourceVersionInfo(params: ResourceVersionInfoParamsType1 | ResourceVersionInfoParamsType2): Promise<any>;
145
+ export declare function resourceVersionInfo1({ resourceId, version, ...params }: ResourceVersionInfo1ParamsType): Promise<any>;
146
+ export declare function resourceVersionInfo2(params: ResourceVersionInfo2ParamsType): Promise<any>;
146
147
  interface GetResourceVersionBySha1ParamsType {
147
148
  fileSha1: string;
148
149
  projection?: string;
@@ -3,3 +3,7 @@ export interface CommonReturn {
3
3
  msg: string;
4
4
  ret: number;
5
5
  }
6
+ export interface RequestParamsType {
7
+ noRedirect?: boolean;
8
+ noErrorAlert?: boolean;
9
+ }
@@ -1028,11 +1028,11 @@ function activities(_temp2) {
1028
1028
 
1029
1029
  _objectDestructuringEmpty(_ref2);
1030
1030
 
1031
- return "/activity";
1031
+ return "/activities";
1032
1032
  }
1033
1033
  function activity(_ref3) {
1034
1034
  var activityID = _ref3.activityID;
1035
- return "/activityDetail/" + activityID;
1035
+ return "/activity/" + activityID;
1036
1036
  }
1037
1037
  function dashboard(_temp3) {
1038
1038
  var _ref4 = _temp3 === void 0 ? {} : _temp3;
@@ -1432,20 +1432,20 @@ function request(_x, _x2) {
1432
1432
 
1433
1433
  function _request() {
1434
1434
  _request = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(config, _temp) {
1435
- var _ref, _ref$noRedirect, noRedirect, result;
1435
+ var _ref, _ref$noRedirect, noRedirect, _ref$noErrorAlert, noErrorAlert, result;
1436
1436
 
1437
1437
  return runtime_1.wrap(function _callee$(_context) {
1438
1438
  while (1) {
1439
1439
  switch (_context.prev = _context.next) {
1440
1440
  case 0:
1441
- _ref = _temp === void 0 ? {} : _temp, _ref$noRedirect = _ref.noRedirect, noRedirect = _ref$noRedirect === void 0 ? false : _ref$noRedirect;
1441
+ _ref = _temp === void 0 ? {} : _temp, _ref$noRedirect = _ref.noRedirect, noRedirect = _ref$noRedirect === void 0 ? false : _ref$noRedirect, _ref$noErrorAlert = _ref.noErrorAlert, noErrorAlert = _ref$noErrorAlert === void 0 ? false : _ref$noErrorAlert;
1442
1442
  _context.next = 3;
1443
1443
  return axios.request(config);
1444
1444
 
1445
1445
  case 3:
1446
1446
  result = _context.sent;
1447
1447
 
1448
- if (!((result.errCode === 30 || result.errcode === 30) && !noRedirect)) {
1448
+ if (!((result.errCode === 30 || result.errCode === 30) && !noRedirect)) {
1449
1449
  _context.next = 6;
1450
1450
  break;
1451
1451
  }
@@ -1455,9 +1455,10 @@ function _request() {
1455
1455
  })));
1456
1456
 
1457
1457
  case 6:
1458
+
1458
1459
  return _context.abrupt("return", result);
1459
1460
 
1460
- case 7:
1461
+ case 8:
1461
1462
  case "end":
1462
1463
  return _context.stop();
1463
1464
  }
@@ -2082,13 +2083,14 @@ var _excluded$3 = ["resourceIdOrName"],
2082
2083
  _excluded2$3 = ["resourceId"],
2083
2084
  _excluded3$2 = ["resourceId"],
2084
2085
  _excluded4$2 = ["resourceId"],
2085
- _excluded5$2 = ["fileSha1"],
2086
+ _excluded5$2 = ["resourceId", "version"],
2086
2087
  _excluded6$1 = ["fileSha1"],
2087
- _excluded7$1 = ["resourceId"],
2088
+ _excluded7$1 = ["fileSha1"],
2088
2089
  _excluded8$1 = ["resourceId"],
2089
2090
  _excluded9$1 = ["resourceId"],
2090
2091
  _excluded10$1 = ["resourceId"],
2091
- _excluded11 = ["resourceId"];
2092
+ _excluded11 = ["resourceId"],
2093
+ _excluded12 = ["resourceId"];
2092
2094
  function create$1(params) {
2093
2095
  return FUtil.Request({
2094
2096
  method: 'POST',
@@ -2158,24 +2160,27 @@ function createVersion(_ref4) {
2158
2160
  data: params
2159
2161
  });
2160
2162
  }
2161
- function resourceVersionInfo(params) {
2162
- if (params.version) {
2163
- return FUtil.Request({
2164
- method: 'GET',
2165
- url: "/v2/resources/" + params.resourceId + "/versions/" + params.version,
2166
- params: params
2167
- });
2168
- }
2163
+ function resourceVersionInfo1(_ref5) {
2164
+ var resourceId = _ref5.resourceId,
2165
+ version = _ref5.version,
2166
+ params = _objectWithoutPropertiesLoose(_ref5, _excluded5$2);
2169
2167
 
2168
+ return FUtil.Request({
2169
+ method: 'GET',
2170
+ url: "/v2/resources/" + resourceId + "/versions/" + version,
2171
+ params: params
2172
+ });
2173
+ }
2174
+ function resourceVersionInfo2(params) {
2170
2175
  return FUtil.Request({
2171
2176
  method: 'GET',
2172
2177
  url: "/v2/resources/versions/detail",
2173
2178
  params: params
2174
2179
  });
2175
2180
  }
2176
- function getResourceVersionBySha1(_ref5) {
2177
- var fileSha1 = _ref5.fileSha1,
2178
- params = _objectWithoutPropertiesLoose(_ref5, _excluded5$2);
2181
+ function getResourceVersionBySha1(_ref6) {
2182
+ var fileSha1 = _ref6.fileSha1,
2183
+ params = _objectWithoutPropertiesLoose(_ref6, _excluded6$1);
2179
2184
 
2180
2185
  // return FUtil.Axios.get(`/v2/resources/files/${fileSha1}/versions`, {
2181
2186
  // params,
@@ -2186,9 +2191,9 @@ function getResourceVersionBySha1(_ref5) {
2186
2191
  params: params
2187
2192
  });
2188
2193
  }
2189
- function getResourceBySha1(_ref6) {
2190
- var fileSha1 = _ref6.fileSha1,
2191
- params = _objectWithoutPropertiesLoose(_ref6, _excluded6$1);
2194
+ function getResourceBySha1(_ref7) {
2195
+ var fileSha1 = _ref7.fileSha1,
2196
+ params = _objectWithoutPropertiesLoose(_ref7, _excluded7$1);
2192
2197
 
2193
2198
  // return FUtil.Axios.get(`/v2/resources/files/${fileSha1}`, {
2194
2199
  // params,
@@ -2238,9 +2243,9 @@ function resourcesDownload(params) {
2238
2243
  // responseType: 'arraybuffer',
2239
2244
  // });
2240
2245
  }
2241
- function batchGetCoverageVersions(_ref7) {
2242
- var resourceId = _ref7.resourceId,
2243
- params = _objectWithoutPropertiesLoose(_ref7, _excluded7$1);
2246
+ function batchGetCoverageVersions(_ref8) {
2247
+ var resourceId = _ref8.resourceId,
2248
+ params = _objectWithoutPropertiesLoose(_ref8, _excluded8$1);
2244
2249
 
2245
2250
  // return FUtil.Axios.get(`/v2/resources/${resourceId}/contracts/coverageVersions`, {
2246
2251
  // params,
@@ -2258,9 +2263,9 @@ function resolveResources(params) {
2258
2263
  url: "/v2/resources/" + params.resourceId + "/resolveResources"
2259
2264
  });
2260
2265
  }
2261
- function batchSetContracts(_ref8) {
2262
- var resourceId = _ref8.resourceId,
2263
- params = _objectWithoutPropertiesLoose(_ref8, _excluded8$1);
2266
+ function batchSetContracts(_ref9) {
2267
+ var resourceId = _ref9.resourceId,
2268
+ params = _objectWithoutPropertiesLoose(_ref9, _excluded9$1);
2264
2269
 
2265
2270
  // return FUtil.Axios.put(`/v2/resources/${resourceId}/versions/batchSetContracts`, params);
2266
2271
  return FUtil.Request({
@@ -2269,9 +2274,9 @@ function batchSetContracts(_ref8) {
2269
2274
  data: params
2270
2275
  });
2271
2276
  }
2272
- function cycleDependencyCheck$1(_ref9) {
2273
- var resourceId = _ref9.resourceId,
2274
- params = _objectWithoutPropertiesLoose(_ref9, _excluded9$1);
2277
+ function cycleDependencyCheck$1(_ref10) {
2278
+ var resourceId = _ref10.resourceId,
2279
+ params = _objectWithoutPropertiesLoose(_ref10, _excluded10$1);
2275
2280
 
2276
2281
  // return FUtil.Axios.post(`/v2/resources/${resourceId}/versions/cycleDependencyCheck`, params);
2277
2282
  return FUtil.Request({
@@ -2280,9 +2285,9 @@ function cycleDependencyCheck$1(_ref9) {
2280
2285
  data: params
2281
2286
  });
2282
2287
  }
2283
- function relationTree$1(_ref10) {
2284
- var resourceId = _ref10.resourceId,
2285
- params = _objectWithoutPropertiesLoose(_ref10, _excluded10$1);
2288
+ function relationTree$1(_ref11) {
2289
+ var resourceId = _ref11.resourceId,
2290
+ params = _objectWithoutPropertiesLoose(_ref11, _excluded11);
2286
2291
 
2287
2292
  // return FUtil.Axios.get(`/v2/resources/${resourceId}/relationTree`, {
2288
2293
  // params,
@@ -2293,9 +2298,9 @@ function relationTree$1(_ref10) {
2293
2298
  params: params
2294
2299
  });
2295
2300
  }
2296
- function relationTreeAuth(_ref11) {
2297
- var resourceId = _ref11.resourceId,
2298
- params = _objectWithoutPropertiesLoose(_ref11, _excluded11);
2301
+ function relationTreeAuth(_ref12) {
2302
+ var resourceId = _ref12.resourceId,
2303
+ params = _objectWithoutPropertiesLoose(_ref12, _excluded12);
2299
2304
 
2300
2305
  return FUtil.Request({
2301
2306
  method: 'GET',
@@ -2303,8 +2308,8 @@ function relationTreeAuth(_ref11) {
2303
2308
  params: params
2304
2309
  });
2305
2310
  }
2306
- function batchAuth$1(_ref12) {
2307
- var params = _extends({}, _ref12);
2311
+ function batchAuth$1(_ref13) {
2312
+ var params = _extends({}, _ref13);
2308
2313
 
2309
2314
  return FUtil.Request({
2310
2315
  method: 'GET',
@@ -2323,7 +2328,8 @@ var Resource = {
2323
2328
  dependencyTree: dependencyTree$1,
2324
2329
  authTree: authTree$1,
2325
2330
  createVersion: createVersion,
2326
- resourceVersionInfo: resourceVersionInfo,
2331
+ resourceVersionInfo1: resourceVersionInfo1,
2332
+ resourceVersionInfo2: resourceVersionInfo2,
2327
2333
  getResourceVersionBySha1: getResourceVersionBySha1,
2328
2334
  getResourceBySha1: getResourceBySha1,
2329
2335
  updateResourceVersionInfo: updateResourceVersionInfo,