@freelog/tools-lib 0.1.144 → 0.1.146

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;
@@ -601,7 +601,8 @@ function _objectWithoutPropertiesLoose(source, excluded) {
601
601
  var _excluded = ["resourceID"],
602
602
  _excluded2 = ["nodeID", "showPage"],
603
603
  _excluded3 = ["nodeID", "showPage"],
604
- _excluded4 = ["goTo"];
604
+ _excluded4 = ["goTo"],
605
+ _excluded5 = ["goTo"];
605
606
  function home(_temp) {
606
607
  var _ref = _temp === void 0 ? {} : _temp;
607
608
 
@@ -745,12 +746,13 @@ function nodeCreateSuccess(_ref24) {
745
746
  }
746
747
  function invitation(_temp11) {
747
748
  var _ref25 = _temp11 === void 0 ? {} : _temp11,
748
- params = _extends({}, _ref25);
749
+ goTo = _ref25.goTo,
750
+ params = _objectWithoutPropertiesLoose(_ref25, _excluded4);
749
751
 
750
752
  // console.log(params.goTo, 'goTo9iowjefklsdj;flksdjflk')
751
- return "/invitation" + handleQuery({
752
- returnUrl: params.goTo ? encodeURIComponent(params.goTo) : undefined
753
- });
753
+ return "/invitation" + handleQuery(_extends({}, params, {
754
+ returnUrl: goTo ? encodeURIComponent(goTo) : undefined
755
+ }));
754
756
  }
755
757
  function exception403(_temp12) {
756
758
  var _ref26 = _temp12 === void 0 ? {} : _temp12,
@@ -788,7 +790,7 @@ function login(_temp13) {
788
790
  function logon(_temp14) {
789
791
  var _ref30 = _temp14 === void 0 ? {} : _temp14,
790
792
  goTo = _ref30.goTo,
791
- params = _objectWithoutPropertiesLoose(_ref30, _excluded4);
793
+ params = _objectWithoutPropertiesLoose(_ref30, _excluded5);
792
794
 
793
795
  return "/logon" + handleQuery(_extends({
794
796
  goTo: goTo ? encodeURIComponent(goTo) : undefined
@@ -1017,7 +1019,7 @@ var _excluded$1 = ["presentableId"],
1017
1019
  _excluded2$1 = ["presentableId"],
1018
1020
  _excluded3$1 = ["presentableId"],
1019
1021
  _excluded4$1 = ["presentableId"],
1020
- _excluded5 = ["presentableId"],
1022
+ _excluded5$1 = ["presentableId"],
1021
1023
  _excluded6 = ["presentableId"],
1022
1024
  _excluded7 = ["presentableId"],
1023
1025
  _excluded8 = ["presentableId"],
@@ -1104,7 +1106,7 @@ function dependencyTree(_ref3) {
1104
1106
  }
1105
1107
  function relationTree(_ref4) {
1106
1108
  var presentableId = _ref4.presentableId,
1107
- params = _objectWithoutPropertiesLoose(_ref4, _excluded5);
1109
+ params = _objectWithoutPropertiesLoose(_ref4, _excluded5$1);
1108
1110
 
1109
1111
  // return FUtil.Axios.get(`/v2/presentables/${presentableId}/relationTree`, {params});
1110
1112
  return FUtil.Request({
@@ -1194,18 +1196,18 @@ var _excluded$2 = ["bucketName"],
1194
1196
  _excluded2$2 = ["bucketName"],
1195
1197
  _excluded3$2 = ["objectIdOrName"],
1196
1198
  _excluded4$2 = ["sha1"],
1197
- _excluded5$1 = ["objectIdOrName"];
1199
+ _excluded5$2 = ["objectIdOrName"];
1198
1200
  function createBucket(params) {
1199
1201
  return FUtil.Request({
1200
1202
  method: 'POST',
1201
- url: "/v1/storages/buckets",
1203
+ url: "/v2/storages/buckets",
1202
1204
  data: params
1203
1205
  });
1204
1206
  }
1205
1207
  function bucketList(params) {
1206
1208
  return FUtil.Request({
1207
1209
  method: 'GET',
1208
- url: "/v1/storages/buckets",
1210
+ url: "/v2/storages/buckets",
1209
1211
  params: params
1210
1212
  });
1211
1213
  }
@@ -1216,21 +1218,21 @@ function spaceStatistics(params) {
1216
1218
 
1217
1219
  return FUtil.Request({
1218
1220
  method: 'GET',
1219
- url: "/v1/storages/buckets/spaceStatistics",
1221
+ url: "/v2/storages/buckets/spaceStatistics",
1220
1222
  params: params
1221
1223
  });
1222
1224
  }
1223
1225
  function deleteBucket(params) {
1224
1226
  return FUtil.Request({
1225
1227
  method: 'DELETE',
1226
- url: "/v1/storages/buckets/" + params.bucketName
1228
+ url: "/v2/storages/buckets/" + params.bucketName
1227
1229
  });
1228
1230
  }
1229
1231
  function bucketDetails(_ref) {
1230
1232
  var bucketName = _ref.bucketName;
1231
1233
  return FUtil.Request({
1232
1234
  method: 'GET',
1233
- url: "/v1/storages/buckets/" + bucketName
1235
+ url: "/v2/storages/buckets/" + bucketName
1234
1236
  });
1235
1237
  }
1236
1238
  function objectList(_ref2) {
@@ -1239,7 +1241,7 @@ function objectList(_ref2) {
1239
1241
 
1240
1242
  return FUtil.Request({
1241
1243
  method: 'GET',
1242
- url: "/v1/storages/buckets/" + bucketName + "/objects",
1244
+ url: "/v2/storages/buckets/" + bucketName + "/objects",
1243
1245
  params: params
1244
1246
  });
1245
1247
  }
@@ -1256,7 +1258,7 @@ function createObject(_ref3) {
1256
1258
 
1257
1259
  return FUtil.Request({
1258
1260
  method: 'POST',
1259
- url: "/v1/storages/buckets/" + bucketName + "/objects",
1261
+ url: "/v2/storages/buckets/" + bucketName + "/objects",
1260
1262
  data: params
1261
1263
  });
1262
1264
  }
@@ -1264,21 +1266,21 @@ function objectDetails$1(params) {
1264
1266
  if (params.objectIdOrName) {
1265
1267
  return FUtil.Request({
1266
1268
  method: 'GET',
1267
- url: "/v1/storages/objects/" + encodeURIComponent(params.objectIdOrName),
1269
+ url: "/v2/storages/objects/" + encodeURIComponent(params.objectIdOrName),
1268
1270
  params: params
1269
1271
  });
1270
1272
  }
1271
1273
 
1272
1274
  return FUtil.Request({
1273
1275
  method: 'GET',
1274
- url: "/v1/storages/buckets/" + params.bucketName + "/objects/" + params.objectId,
1276
+ url: "/v2/storages/buckets/" + params.bucketName + "/objects/" + params.objectId,
1275
1277
  params: params
1276
1278
  });
1277
1279
  }
1278
1280
  function deleteObjects(params) {
1279
1281
  return FUtil.Request({
1280
1282
  method: 'DELETE',
1281
- url: "/v1/storages/buckets/" + params.bucketName + "/objects/" + params.objectIds,
1283
+ url: "/v2/storages/buckets/" + params.bucketName + "/objects/" + params.objectIds,
1282
1284
  data: params
1283
1285
  });
1284
1286
  }
@@ -1286,16 +1288,16 @@ function bucketIsExist(_ref4) {
1286
1288
  var bucketName = _ref4.bucketName;
1287
1289
  return FUtil.Request({
1288
1290
  method: 'GET',
1289
- url: "/v1/storages/buckets/" + bucketName + "/isExist"
1291
+ url: "/v2/storages/buckets/" + bucketName + "/isExist"
1290
1292
  });
1291
1293
  }
1292
1294
  function downloadObject(params) {
1293
- return window.location.href = FUtil.Format.completeUrlByDomain('qi') + ("/v1/storages/objects/" + params.objectIdOrName + "/file");
1295
+ return window.location.href = FUtil.Format.completeUrlByDomain('qi') + ("/v2/storages/objects/" + params.objectIdOrName + "/file");
1294
1296
  }
1295
1297
  function fileIsExist(params) {
1296
1298
  return FUtil.Request({
1297
1299
  method: 'GET',
1298
- url: "/v1/storages/files/fileIsExist",
1300
+ url: "/v2/storages/files/fileIsExist",
1299
1301
  params: params
1300
1302
  });
1301
1303
  }
@@ -1317,15 +1319,15 @@ function uploadFile(params, config, returnCancel) {
1317
1319
  }
1318
1320
 
1319
1321
  if (!returnCancel) {
1320
- // return FUtil.Axios.post('/v1/storages/files/upload', formData, config);
1322
+ // return FUtil.Axios.post('/v2/storages/files/upload', formData, config);
1321
1323
  return FUtil.Request(_extends({
1322
1324
  method: 'POST',
1323
- url: "/v1/storages/files/upload",
1325
+ url: "/v2/storages/files/upload",
1324
1326
  data: formData
1325
1327
  }, config));
1326
1328
  }
1327
1329
 
1328
- var cancel = null; // const promise = FUtil.Axios.post('/v1/storages/files/upload', formData, {
1330
+ var cancel = null; // const promise = FUtil.Axios.post('/v2/storages/files/upload', formData, {
1329
1331
  // cancelToken: new FUtil.Axios.CancelToken((c) => {
1330
1332
  // cancel = c;
1331
1333
  // }),
@@ -1333,7 +1335,7 @@ function uploadFile(params, config, returnCancel) {
1333
1335
 
1334
1336
  var promise = FUtil.Request(_extends({
1335
1337
  method: 'POST',
1336
- url: "/v1/storages/files/upload",
1338
+ url: "/v2/storages/files/upload",
1337
1339
  data: formData,
1338
1340
  cancelToken: new FUtil.Axios.CancelToken(function (c) {
1339
1341
  cancel = c;
@@ -1356,7 +1358,7 @@ function uploadImage(params, config) {
1356
1358
 
1357
1359
  return FUtil.Request(_extends({
1358
1360
  method: 'POST',
1359
- url: "/v1/storages/files/uploadImage",
1361
+ url: "/v2/storages/files/uploadImage",
1360
1362
  data: formData
1361
1363
  }, config));
1362
1364
  }
@@ -1373,7 +1375,7 @@ function updateObject(_ref5) {
1373
1375
  function batchObjectList(params) {
1374
1376
  return FUtil.Request({
1375
1377
  method: 'GET',
1376
- url: "/v1/storages/objects/list",
1378
+ url: "/v2/storages/objects/list",
1377
1379
  params: params
1378
1380
  });
1379
1381
  }
@@ -1383,17 +1385,17 @@ function fileProperty(_ref6) {
1383
1385
 
1384
1386
  return FUtil.Request({
1385
1387
  method: 'GET',
1386
- url: "/v1/storages/files/" + sha1 + "/property",
1388
+ url: "/v2/storages/files/" + sha1 + "/property",
1387
1389
  params: params
1388
1390
  });
1389
1391
  }
1390
1392
  function cycleDependencyCheck(_ref7) {
1391
1393
  var objectIdOrName = _ref7.objectIdOrName,
1392
- params = _objectWithoutPropertiesLoose(_ref7, _excluded5$1);
1394
+ params = _objectWithoutPropertiesLoose(_ref7, _excluded5$2);
1393
1395
 
1394
1396
  return FUtil.Request({
1395
1397
  method: 'POST',
1396
- url: "/v1/storages/objects/" + objectIdOrName + "/cycleDependencyCheck",
1398
+ url: "/v2/storages/objects/" + objectIdOrName + "/cycleDependencyCheck",
1397
1399
  data: params
1398
1400
  });
1399
1401
  }
@@ -1499,7 +1501,7 @@ var _excluded$3 = ["resourceIdOrName"],
1499
1501
  _excluded2$3 = ["resourceId"],
1500
1502
  _excluded3$3 = ["resourceId"],
1501
1503
  _excluded4$3 = ["resourceId"],
1502
- _excluded5$2 = ["resourceId", "version"],
1504
+ _excluded5$3 = ["resourceId", "version"],
1503
1505
  _excluded6$1 = ["fileSha1"],
1504
1506
  _excluded7$1 = ["fileSha1"],
1505
1507
  _excluded8$1 = ["resourceId"],
@@ -1582,7 +1584,7 @@ function createVersion(_ref4) {
1582
1584
  function resourceVersionInfo1(_ref5) {
1583
1585
  var resourceId = _ref5.resourceId,
1584
1586
  version = _ref5.version,
1585
- params = _objectWithoutPropertiesLoose(_ref5, _excluded5$2);
1587
+ params = _objectWithoutPropertiesLoose(_ref5, _excluded5$3);
1586
1588
 
1587
1589
  return FUtil.Request({
1588
1590
  method: 'GET',
@@ -1994,7 +1996,7 @@ var _excluded$5 = ["nodeId"],
1994
1996
  _excluded2$4 = ["nodeId"],
1995
1997
  _excluded3$4 = ["nodeId"],
1996
1998
  _excluded4$4 = ["nodeId"],
1997
- _excluded5$3 = ["nodeId"],
1999
+ _excluded5$4 = ["nodeId"],
1998
2000
  _excluded6$2 = ["testResourceId"],
1999
2001
  _excluded7$2 = ["testResourceId"],
2000
2002
  _excluded8$2 = ["nodeId"],
@@ -2043,7 +2045,7 @@ function dependencyTree$2(_ref4) {
2043
2045
  }
2044
2046
  function putRules(_ref5) {
2045
2047
  var nodeId = _ref5.nodeId,
2046
- params = _objectWithoutPropertiesLoose(_ref5, _excluded5$3);
2048
+ params = _objectWithoutPropertiesLoose(_ref5, _excluded5$4);
2047
2049
 
2048
2050
  return FUtil.Request({
2049
2051
  method: 'PUT',
@@ -2170,9 +2172,27 @@ var InformalNode = {
2170
2172
 
2171
2173
  var _excluded$6 = ["contractId"],
2172
2174
  _excluded2$5 = ["contractId"];
2173
- function contractDetails(_ref) {
2174
- var contractId = _ref.contractId,
2175
- params = _objectWithoutPropertiesLoose(_ref, _excluded$6);
2175
+ function createContract(_ref) {
2176
+ var params = _extends({}, _ref);
2177
+
2178
+ return FUtil.Request({
2179
+ method: 'POST',
2180
+ url: "/v2/contracts",
2181
+ data: params
2182
+ });
2183
+ }
2184
+ function batchCreateContracts(_ref2) {
2185
+ var params = _extends({}, _ref2);
2186
+
2187
+ return FUtil.Request({
2188
+ method: 'POST',
2189
+ url: "/v2/contracts/batchSign",
2190
+ data: params
2191
+ });
2192
+ }
2193
+ function contractDetails(_ref3) {
2194
+ var contractId = _ref3.contractId,
2195
+ params = _objectWithoutPropertiesLoose(_ref3, _excluded$6);
2176
2196
 
2177
2197
  return FUtil.Request({
2178
2198
  method: 'GET',
@@ -2194,9 +2214,9 @@ function batchContracts(params) {
2194
2214
  params: params
2195
2215
  });
2196
2216
  }
2197
- function transitionRecords(_ref2) {
2198
- var contractId = _ref2.contractId,
2199
- params = _objectWithoutPropertiesLoose(_ref2, _excluded2$5);
2217
+ function transitionRecords(_ref4) {
2218
+ var contractId = _ref4.contractId,
2219
+ params = _objectWithoutPropertiesLoose(_ref4, _excluded2$5);
2200
2220
 
2201
2221
  return FUtil.Request({
2202
2222
  method: 'GET',
@@ -2214,6 +2234,8 @@ function contractsSignCount(params) {
2214
2234
 
2215
2235
  var Contract = {
2216
2236
  __proto__: null,
2237
+ createContract: createContract,
2238
+ batchCreateContracts: batchCreateContracts,
2217
2239
  contractDetails: contractDetails,
2218
2240
  contracts: contracts,
2219
2241
  batchContracts: batchContracts,
@@ -3050,13 +3072,7 @@ axios.interceptors.response.use(function (response) {
3050
3072
  });
3051
3073
  function request(_x, _x2) {
3052
3074
  return _request.apply(this, arguments);
3053
- } // export function downloadFile(res: AxiosResponse) {
3054
- // const {data, headers} = res;
3055
- // // const fileName = headers['content-disposition'].replace(/attachment; filename="(.*)"/, '$1');
3056
- // const fileName = headers['content-disposition'].replace(/attachment; filename="(.*)"/, '$1');
3057
- // const blob = new Blob([data], {});
3058
- // FileSaver.saveAs(blob, fileName);
3059
- // }
3075
+ }
3060
3076
 
3061
3077
  function _request() {
3062
3078
  _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config, _temp) {
@@ -3074,7 +3090,7 @@ function _request() {
3074
3090
  result = _context.sent;
3075
3091
 
3076
3092
  if (!(result.ret === 0 && result.errCode === 30 && !noRedirect)) {
3077
- _context.next = 8;
3093
+ _context.next = 10;
3078
3094
  break;
3079
3095
  }
3080
3096
 
@@ -3085,17 +3101,20 @@ function _request() {
3085
3101
  window.location.replace("" + completeUrlByDomain('user') + login({
3086
3102
  goTo: window.location.href
3087
3103
  }));
3104
+ _context.next = 11;
3105
+ break;
3088
3106
 
3089
- case 8:
3107
+ case 10:
3090
3108
  if (result.ret === 4 && result.errCode === 10 && !noRedirect) {
3091
3109
  window.location.replace("" + completeUrlByDomain('user') + userFreeze({
3092
3110
  goTo: window.location.href
3093
3111
  }));
3094
3112
  }
3095
3113
 
3114
+ case 11:
3096
3115
  return _context.abrupt("return", result);
3097
3116
 
3098
- case 11:
3117
+ case 12:
3099
3118
  case "end":
3100
3119
  return _context.stop();
3101
3120
  }
@@ -3311,18 +3330,19 @@ var I18nNext = /*#__PURE__*/function () {
3311
3330
 
3312
3331
  _proto._fetchData = /*#__PURE__*/function () {
3313
3332
  var _fetchData2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3314
- var res, en_US, zh_CN, _i, _Object$entries, _Object$entries$_i, key, value, result;
3333
+ var url, res, en_US, zh_CN, _i, _Object$entries, _Object$entries$_i, key, value, result;
3315
3334
 
3316
3335
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3317
3336
  while (1) {
3318
3337
  switch (_context4.prev = _context4.next) {
3319
3338
  case 0:
3320
- _context4.next = 2;
3321
- return axios.get(window.location.origin.includes('.freelog.com') ? ossJsonUrl : ossJsonUrl_Test, {
3339
+ url = window.location.origin.includes('.freelog.com') ? ossJsonUrl : ossJsonUrl_Test;
3340
+ _context4.next = 3;
3341
+ return axios.get(url + '?timestamp=' + Date.now(), {
3322
3342
  withCredentials: false
3323
3343
  });
3324
3344
 
3325
- case 2:
3345
+ case 3:
3326
3346
  res = _context4.sent;
3327
3347
  // console.log(res, 'data09oiw3qjelsfkdfjlsdkfjl');
3328
3348
  en_US = {};
@@ -3351,7 +3371,7 @@ var I18nNext = /*#__PURE__*/function () {
3351
3371
 
3352
3372
  return _context4.abrupt("return", result);
3353
3373
 
3354
- case 9:
3374
+ case 10:
3355
3375
  case "end":
3356
3376
  return _context4.stop();
3357
3377
  }