@freelog/tools-lib 0.1.143 → 0.1.145

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,3 +1,21 @@
1
+ interface CreateContractParamsType {
2
+ subjectId: string;
3
+ subjectType: 1 | 2 | 3;
4
+ policyId: string;
5
+ licenseeId: string | number;
6
+ licenseeIdentityType: 1 | 2 | 3;
7
+ }
8
+ export declare function createContract({ ...params }: CreateContractParamsType): Promise<any>;
9
+ interface BatchCreateContractsParamsType {
10
+ subjects: {
11
+ subjectId: string;
12
+ policyId: string;
13
+ }[];
14
+ subjectType: 1 | 2 | 3;
15
+ licenseeId: string | number;
16
+ licenseeIdentityType: 1 | 2 | 3;
17
+ }
18
+ export declare function batchCreateContracts({ ...params }: BatchCreateContractsParamsType): Promise<any>;
1
19
  interface ContractDetailsParamsType {
2
20
  contractId: string;
3
21
  isLoadPolicyInfo?: 0 | 1;
@@ -600,7 +600,8 @@ function _objectWithoutPropertiesLoose(source, excluded) {
600
600
 
601
601
  var _excluded = ["resourceID"],
602
602
  _excluded2 = ["nodeID", "showPage"],
603
- _excluded3 = ["nodeID", "showPage"];
603
+ _excluded3 = ["nodeID", "showPage"],
604
+ _excluded4 = ["goTo"];
604
605
  function home(_temp) {
605
606
  var _ref = _temp === void 0 ? {} : _temp;
606
607
 
@@ -786,11 +787,12 @@ function login(_temp13) {
786
787
  }
787
788
  function logon(_temp14) {
788
789
  var _ref30 = _temp14 === void 0 ? {} : _temp14,
789
- goTo = _ref30.goTo;
790
+ goTo = _ref30.goTo,
791
+ params = _objectWithoutPropertiesLoose(_ref30, _excluded4);
790
792
 
791
- return "/logon" + handleQuery({
793
+ return "/logon" + handleQuery(_extends({
792
794
  goTo: goTo ? encodeURIComponent(goTo) : undefined
793
- });
795
+ }, params));
794
796
  }
795
797
  function retrieveUserPassword(_temp15) {
796
798
  var _ref31 = _temp15 === void 0 ? {} : _temp15,
@@ -1014,7 +1016,7 @@ var Node = {
1014
1016
  var _excluded$1 = ["presentableId"],
1015
1017
  _excluded2$1 = ["presentableId"],
1016
1018
  _excluded3$1 = ["presentableId"],
1017
- _excluded4 = ["presentableId"],
1019
+ _excluded4$1 = ["presentableId"],
1018
1020
  _excluded5 = ["presentableId"],
1019
1021
  _excluded6 = ["presentableId"],
1020
1022
  _excluded7 = ["presentableId"],
@@ -1091,7 +1093,7 @@ function presentableList(params) {
1091
1093
  }
1092
1094
  function dependencyTree(_ref3) {
1093
1095
  var presentableId = _ref3.presentableId,
1094
- params = _objectWithoutPropertiesLoose(_ref3, _excluded4);
1096
+ params = _objectWithoutPropertiesLoose(_ref3, _excluded4$1);
1095
1097
 
1096
1098
  // return FUtil.Axios.get(`/v2/presentables/${presentableId}/dependencyTree`, {params});
1097
1099
  return FUtil.Request({
@@ -1191,19 +1193,19 @@ var Exhibit = {
1191
1193
  var _excluded$2 = ["bucketName"],
1192
1194
  _excluded2$2 = ["bucketName"],
1193
1195
  _excluded3$2 = ["objectIdOrName"],
1194
- _excluded4$1 = ["sha1"],
1196
+ _excluded4$2 = ["sha1"],
1195
1197
  _excluded5$1 = ["objectIdOrName"];
1196
1198
  function createBucket(params) {
1197
1199
  return FUtil.Request({
1198
1200
  method: 'POST',
1199
- url: "/v1/storages/buckets",
1201
+ url: "/v2/storages/buckets",
1200
1202
  data: params
1201
1203
  });
1202
1204
  }
1203
1205
  function bucketList(params) {
1204
1206
  return FUtil.Request({
1205
1207
  method: 'GET',
1206
- url: "/v1/storages/buckets",
1208
+ url: "/v2/storages/buckets",
1207
1209
  params: params
1208
1210
  });
1209
1211
  }
@@ -1214,21 +1216,21 @@ function spaceStatistics(params) {
1214
1216
 
1215
1217
  return FUtil.Request({
1216
1218
  method: 'GET',
1217
- url: "/v1/storages/buckets/spaceStatistics",
1219
+ url: "/v2/storages/buckets/spaceStatistics",
1218
1220
  params: params
1219
1221
  });
1220
1222
  }
1221
1223
  function deleteBucket(params) {
1222
1224
  return FUtil.Request({
1223
1225
  method: 'DELETE',
1224
- url: "/v1/storages/buckets/" + params.bucketName
1226
+ url: "/v2/storages/buckets/" + params.bucketName
1225
1227
  });
1226
1228
  }
1227
1229
  function bucketDetails(_ref) {
1228
1230
  var bucketName = _ref.bucketName;
1229
1231
  return FUtil.Request({
1230
1232
  method: 'GET',
1231
- url: "/v1/storages/buckets/" + bucketName
1233
+ url: "/v2/storages/buckets/" + bucketName
1232
1234
  });
1233
1235
  }
1234
1236
  function objectList(_ref2) {
@@ -1237,7 +1239,7 @@ function objectList(_ref2) {
1237
1239
 
1238
1240
  return FUtil.Request({
1239
1241
  method: 'GET',
1240
- url: "/v1/storages/buckets/" + bucketName + "/objects",
1242
+ url: "/v2/storages/buckets/" + bucketName + "/objects",
1241
1243
  params: params
1242
1244
  });
1243
1245
  }
@@ -1254,7 +1256,7 @@ function createObject(_ref3) {
1254
1256
 
1255
1257
  return FUtil.Request({
1256
1258
  method: 'POST',
1257
- url: "/v1/storages/buckets/" + bucketName + "/objects",
1259
+ url: "/v2/storages/buckets/" + bucketName + "/objects",
1258
1260
  data: params
1259
1261
  });
1260
1262
  }
@@ -1262,21 +1264,21 @@ function objectDetails$1(params) {
1262
1264
  if (params.objectIdOrName) {
1263
1265
  return FUtil.Request({
1264
1266
  method: 'GET',
1265
- url: "/v1/storages/objects/" + encodeURIComponent(params.objectIdOrName),
1267
+ url: "/v2/storages/objects/" + encodeURIComponent(params.objectIdOrName),
1266
1268
  params: params
1267
1269
  });
1268
1270
  }
1269
1271
 
1270
1272
  return FUtil.Request({
1271
1273
  method: 'GET',
1272
- url: "/v1/storages/buckets/" + params.bucketName + "/objects/" + params.objectId,
1274
+ url: "/v2/storages/buckets/" + params.bucketName + "/objects/" + params.objectId,
1273
1275
  params: params
1274
1276
  });
1275
1277
  }
1276
1278
  function deleteObjects(params) {
1277
1279
  return FUtil.Request({
1278
1280
  method: 'DELETE',
1279
- url: "/v1/storages/buckets/" + params.bucketName + "/objects/" + params.objectIds,
1281
+ url: "/v2/storages/buckets/" + params.bucketName + "/objects/" + params.objectIds,
1280
1282
  data: params
1281
1283
  });
1282
1284
  }
@@ -1284,16 +1286,16 @@ function bucketIsExist(_ref4) {
1284
1286
  var bucketName = _ref4.bucketName;
1285
1287
  return FUtil.Request({
1286
1288
  method: 'GET',
1287
- url: "/v1/storages/buckets/" + bucketName + "/isExist"
1289
+ url: "/v2/storages/buckets/" + bucketName + "/isExist"
1288
1290
  });
1289
1291
  }
1290
1292
  function downloadObject(params) {
1291
- return window.location.href = FUtil.Format.completeUrlByDomain('qi') + ("/v1/storages/objects/" + params.objectIdOrName + "/file");
1293
+ return window.location.href = FUtil.Format.completeUrlByDomain('qi') + ("/v2/storages/objects/" + params.objectIdOrName + "/file");
1292
1294
  }
1293
1295
  function fileIsExist(params) {
1294
1296
  return FUtil.Request({
1295
1297
  method: 'GET',
1296
- url: "/v1/storages/files/fileIsExist",
1298
+ url: "/v2/storages/files/fileIsExist",
1297
1299
  params: params
1298
1300
  });
1299
1301
  }
@@ -1315,15 +1317,15 @@ function uploadFile(params, config, returnCancel) {
1315
1317
  }
1316
1318
 
1317
1319
  if (!returnCancel) {
1318
- // return FUtil.Axios.post('/v1/storages/files/upload', formData, config);
1320
+ // return FUtil.Axios.post('/v2/storages/files/upload', formData, config);
1319
1321
  return FUtil.Request(_extends({
1320
1322
  method: 'POST',
1321
- url: "/v1/storages/files/upload",
1323
+ url: "/v2/storages/files/upload",
1322
1324
  data: formData
1323
1325
  }, config));
1324
1326
  }
1325
1327
 
1326
- var cancel = null; // const promise = FUtil.Axios.post('/v1/storages/files/upload', formData, {
1328
+ var cancel = null; // const promise = FUtil.Axios.post('/v2/storages/files/upload', formData, {
1327
1329
  // cancelToken: new FUtil.Axios.CancelToken((c) => {
1328
1330
  // cancel = c;
1329
1331
  // }),
@@ -1331,7 +1333,7 @@ function uploadFile(params, config, returnCancel) {
1331
1333
 
1332
1334
  var promise = FUtil.Request(_extends({
1333
1335
  method: 'POST',
1334
- url: "/v1/storages/files/upload",
1336
+ url: "/v2/storages/files/upload",
1335
1337
  data: formData,
1336
1338
  cancelToken: new FUtil.Axios.CancelToken(function (c) {
1337
1339
  cancel = c;
@@ -1354,7 +1356,7 @@ function uploadImage(params, config) {
1354
1356
 
1355
1357
  return FUtil.Request(_extends({
1356
1358
  method: 'POST',
1357
- url: "/v1/storages/files/uploadImage",
1359
+ url: "/v2/storages/files/uploadImage",
1358
1360
  data: formData
1359
1361
  }, config));
1360
1362
  }
@@ -1371,17 +1373,17 @@ function updateObject(_ref5) {
1371
1373
  function batchObjectList(params) {
1372
1374
  return FUtil.Request({
1373
1375
  method: 'GET',
1374
- url: "/v1/storages/objects/list",
1376
+ url: "/v2/storages/objects/list",
1375
1377
  params: params
1376
1378
  });
1377
1379
  }
1378
1380
  function fileProperty(_ref6) {
1379
1381
  var sha1 = _ref6.sha1,
1380
- params = _objectWithoutPropertiesLoose(_ref6, _excluded4$1);
1382
+ params = _objectWithoutPropertiesLoose(_ref6, _excluded4$2);
1381
1383
 
1382
1384
  return FUtil.Request({
1383
1385
  method: 'GET',
1384
- url: "/v1/storages/files/" + sha1 + "/property",
1386
+ url: "/v2/storages/files/" + sha1 + "/property",
1385
1387
  params: params
1386
1388
  });
1387
1389
  }
@@ -1391,7 +1393,7 @@ function cycleDependencyCheck(_ref7) {
1391
1393
 
1392
1394
  return FUtil.Request({
1393
1395
  method: 'POST',
1394
- url: "/v1/storages/objects/" + objectIdOrName + "/cycleDependencyCheck",
1396
+ url: "/v2/storages/objects/" + objectIdOrName + "/cycleDependencyCheck",
1395
1397
  data: params
1396
1398
  });
1397
1399
  }
@@ -1496,7 +1498,7 @@ var Collection = {
1496
1498
  var _excluded$3 = ["resourceIdOrName"],
1497
1499
  _excluded2$3 = ["resourceId"],
1498
1500
  _excluded3$3 = ["resourceId"],
1499
- _excluded4$2 = ["resourceId"],
1501
+ _excluded4$3 = ["resourceId"],
1500
1502
  _excluded5$2 = ["resourceId", "version"],
1501
1503
  _excluded6$1 = ["fileSha1"],
1502
1504
  _excluded7$1 = ["fileSha1"],
@@ -1568,7 +1570,7 @@ function authTree$1(_ref3) {
1568
1570
  }
1569
1571
  function createVersion(_ref4) {
1570
1572
  var resourceId = _ref4.resourceId,
1571
- params = _objectWithoutPropertiesLoose(_ref4, _excluded4$2);
1573
+ params = _objectWithoutPropertiesLoose(_ref4, _excluded4$3);
1572
1574
 
1573
1575
  // return FUtil.Axios.post(`/v2/resources/${resourceId}/versions`, params);
1574
1576
  return FUtil.Request({
@@ -1991,7 +1993,7 @@ var User = {
1991
1993
  var _excluded$5 = ["nodeId"],
1992
1994
  _excluded2$4 = ["nodeId"],
1993
1995
  _excluded3$4 = ["nodeId"],
1994
- _excluded4$3 = ["nodeId"],
1996
+ _excluded4$4 = ["nodeId"],
1995
1997
  _excluded5$3 = ["nodeId"],
1996
1998
  _excluded6$2 = ["testResourceId"],
1997
1999
  _excluded7$2 = ["testResourceId"],
@@ -2031,7 +2033,7 @@ function batchTestResources(_ref3) {
2031
2033
  }
2032
2034
  function dependencyTree$2(_ref4) {
2033
2035
  var nodeId = _ref4.nodeId,
2034
- params = _objectWithoutPropertiesLoose(_ref4, _excluded4$3);
2036
+ params = _objectWithoutPropertiesLoose(_ref4, _excluded4$4);
2035
2037
 
2036
2038
  return FUtil.Request({
2037
2039
  method: 'GET',
@@ -2168,9 +2170,27 @@ var InformalNode = {
2168
2170
 
2169
2171
  var _excluded$6 = ["contractId"],
2170
2172
  _excluded2$5 = ["contractId"];
2171
- function contractDetails(_ref) {
2172
- var contractId = _ref.contractId,
2173
- params = _objectWithoutPropertiesLoose(_ref, _excluded$6);
2173
+ function createContract(_ref) {
2174
+ var params = _extends({}, _ref);
2175
+
2176
+ return FUtil.Request({
2177
+ method: 'POST',
2178
+ url: "/v2/contracts",
2179
+ data: params
2180
+ });
2181
+ }
2182
+ function batchCreateContracts(_ref2) {
2183
+ var params = _extends({}, _ref2);
2184
+
2185
+ return FUtil.Request({
2186
+ method: 'POST',
2187
+ url: "/v2/contracts/batchSign",
2188
+ data: params
2189
+ });
2190
+ }
2191
+ function contractDetails(_ref3) {
2192
+ var contractId = _ref3.contractId,
2193
+ params = _objectWithoutPropertiesLoose(_ref3, _excluded$6);
2174
2194
 
2175
2195
  return FUtil.Request({
2176
2196
  method: 'GET',
@@ -2192,9 +2212,9 @@ function batchContracts(params) {
2192
2212
  params: params
2193
2213
  });
2194
2214
  }
2195
- function transitionRecords(_ref2) {
2196
- var contractId = _ref2.contractId,
2197
- params = _objectWithoutPropertiesLoose(_ref2, _excluded2$5);
2215
+ function transitionRecords(_ref4) {
2216
+ var contractId = _ref4.contractId,
2217
+ params = _objectWithoutPropertiesLoose(_ref4, _excluded2$5);
2198
2218
 
2199
2219
  return FUtil.Request({
2200
2220
  method: 'GET',
@@ -2212,6 +2232,8 @@ function contractsSignCount(params) {
2212
2232
 
2213
2233
  var Contract = {
2214
2234
  __proto__: null,
2235
+ createContract: createContract,
2236
+ batchCreateContracts: batchCreateContracts,
2215
2237
  contractDetails: contractDetails,
2216
2238
  contracts: contracts,
2217
2239
  batchContracts: batchContracts,
@@ -3048,13 +3070,7 @@ axios.interceptors.response.use(function (response) {
3048
3070
  });
3049
3071
  function request(_x, _x2) {
3050
3072
  return _request.apply(this, arguments);
3051
- } // export function downloadFile(res: AxiosResponse) {
3052
- // const {data, headers} = res;
3053
- // // const fileName = headers['content-disposition'].replace(/attachment; filename="(.*)"/, '$1');
3054
- // const fileName = headers['content-disposition'].replace(/attachment; filename="(.*)"/, '$1');
3055
- // const blob = new Blob([data], {});
3056
- // FileSaver.saveAs(blob, fileName);
3057
- // }
3073
+ }
3058
3074
 
3059
3075
  function _request() {
3060
3076
  _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config, _temp) {
@@ -3072,7 +3088,7 @@ function _request() {
3072
3088
  result = _context.sent;
3073
3089
 
3074
3090
  if (!(result.ret === 0 && result.errCode === 30 && !noRedirect)) {
3075
- _context.next = 8;
3091
+ _context.next = 10;
3076
3092
  break;
3077
3093
  }
3078
3094
 
@@ -3083,17 +3099,20 @@ function _request() {
3083
3099
  window.location.replace("" + completeUrlByDomain('user') + login({
3084
3100
  goTo: window.location.href
3085
3101
  }));
3102
+ _context.next = 11;
3103
+ break;
3086
3104
 
3087
- case 8:
3105
+ case 10:
3088
3106
  if (result.ret === 4 && result.errCode === 10 && !noRedirect) {
3089
3107
  window.location.replace("" + completeUrlByDomain('user') + userFreeze({
3090
3108
  goTo: window.location.href
3091
3109
  }));
3092
3110
  }
3093
3111
 
3112
+ case 11:
3094
3113
  return _context.abrupt("return", result);
3095
3114
 
3096
- case 11:
3115
+ case 12:
3097
3116
  case "end":
3098
3117
  return _context.stop();
3099
3118
  }
@@ -3309,18 +3328,19 @@ var I18nNext = /*#__PURE__*/function () {
3309
3328
 
3310
3329
  _proto._fetchData = /*#__PURE__*/function () {
3311
3330
  var _fetchData2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3312
- var res, en_US, zh_CN, _i, _Object$entries, _Object$entries$_i, key, value, result;
3331
+ var url, res, en_US, zh_CN, _i, _Object$entries, _Object$entries$_i, key, value, result;
3313
3332
 
3314
3333
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3315
3334
  while (1) {
3316
3335
  switch (_context4.prev = _context4.next) {
3317
3336
  case 0:
3318
- _context4.next = 2;
3319
- return axios.get(window.location.origin.includes('.freelog.com') ? ossJsonUrl : ossJsonUrl_Test, {
3337
+ url = window.location.origin.includes('.freelog.com') ? ossJsonUrl : ossJsonUrl_Test;
3338
+ _context4.next = 3;
3339
+ return axios.get(url + '?timestamp=' + Date.now(), {
3320
3340
  withCredentials: false
3321
3341
  });
3322
3342
 
3323
- case 2:
3343
+ case 3:
3324
3344
  res = _context4.sent;
3325
3345
  // console.log(res, 'data09oiw3qjelsfkdfjlsdkfjl');
3326
3346
  en_US = {};
@@ -3349,7 +3369,7 @@ var I18nNext = /*#__PURE__*/function () {
3349
3369
 
3350
3370
  return _context4.abrupt("return", result);
3351
3371
 
3352
- case 9:
3372
+ case 10:
3353
3373
  case "end":
3354
3374
  return _context4.stop();
3355
3375
  }