@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.
@@ -595,7 +595,8 @@ function _objectWithoutPropertiesLoose(source, excluded) {
595
595
  var _excluded = ["resourceID"],
596
596
  _excluded2 = ["nodeID", "showPage"],
597
597
  _excluded3 = ["nodeID", "showPage"],
598
- _excluded4 = ["goTo"];
598
+ _excluded4 = ["goTo"],
599
+ _excluded5 = ["goTo"];
599
600
  function home(_temp) {
600
601
  var _ref = _temp === void 0 ? {} : _temp;
601
602
 
@@ -739,12 +740,13 @@ function nodeCreateSuccess(_ref24) {
739
740
  }
740
741
  function invitation(_temp11) {
741
742
  var _ref25 = _temp11 === void 0 ? {} : _temp11,
742
- params = _extends({}, _ref25);
743
+ goTo = _ref25.goTo,
744
+ params = _objectWithoutPropertiesLoose(_ref25, _excluded4);
743
745
 
744
746
  // console.log(params.goTo, 'goTo9iowjefklsdj;flksdjflk')
745
- return "/invitation" + handleQuery({
746
- returnUrl: params.goTo ? encodeURIComponent(params.goTo) : undefined
747
- });
747
+ return "/invitation" + handleQuery(_extends({}, params, {
748
+ returnUrl: goTo ? encodeURIComponent(goTo) : undefined
749
+ }));
748
750
  }
749
751
  function exception403(_temp12) {
750
752
  var _ref26 = _temp12 === void 0 ? {} : _temp12,
@@ -782,7 +784,7 @@ function login(_temp13) {
782
784
  function logon(_temp14) {
783
785
  var _ref30 = _temp14 === void 0 ? {} : _temp14,
784
786
  goTo = _ref30.goTo,
785
- params = _objectWithoutPropertiesLoose(_ref30, _excluded4);
787
+ params = _objectWithoutPropertiesLoose(_ref30, _excluded5);
786
788
 
787
789
  return "/logon" + handleQuery(_extends({
788
790
  goTo: goTo ? encodeURIComponent(goTo) : undefined
@@ -1011,7 +1013,7 @@ var _excluded$1 = ["presentableId"],
1011
1013
  _excluded2$1 = ["presentableId"],
1012
1014
  _excluded3$1 = ["presentableId"],
1013
1015
  _excluded4$1 = ["presentableId"],
1014
- _excluded5 = ["presentableId"],
1016
+ _excluded5$1 = ["presentableId"],
1015
1017
  _excluded6 = ["presentableId"],
1016
1018
  _excluded7 = ["presentableId"],
1017
1019
  _excluded8 = ["presentableId"],
@@ -1098,7 +1100,7 @@ function dependencyTree(_ref3) {
1098
1100
  }
1099
1101
  function relationTree(_ref4) {
1100
1102
  var presentableId = _ref4.presentableId,
1101
- params = _objectWithoutPropertiesLoose(_ref4, _excluded5);
1103
+ params = _objectWithoutPropertiesLoose(_ref4, _excluded5$1);
1102
1104
 
1103
1105
  // return FUtil.Axios.get(`/v2/presentables/${presentableId}/relationTree`, {params});
1104
1106
  return FUtil.Request({
@@ -1188,18 +1190,18 @@ var _excluded$2 = ["bucketName"],
1188
1190
  _excluded2$2 = ["bucketName"],
1189
1191
  _excluded3$2 = ["objectIdOrName"],
1190
1192
  _excluded4$2 = ["sha1"],
1191
- _excluded5$1 = ["objectIdOrName"];
1193
+ _excluded5$2 = ["objectIdOrName"];
1192
1194
  function createBucket(params) {
1193
1195
  return FUtil.Request({
1194
1196
  method: 'POST',
1195
- url: "/v1/storages/buckets",
1197
+ url: "/v2/storages/buckets",
1196
1198
  data: params
1197
1199
  });
1198
1200
  }
1199
1201
  function bucketList(params) {
1200
1202
  return FUtil.Request({
1201
1203
  method: 'GET',
1202
- url: "/v1/storages/buckets",
1204
+ url: "/v2/storages/buckets",
1203
1205
  params: params
1204
1206
  });
1205
1207
  }
@@ -1210,21 +1212,21 @@ function spaceStatistics(params) {
1210
1212
 
1211
1213
  return FUtil.Request({
1212
1214
  method: 'GET',
1213
- url: "/v1/storages/buckets/spaceStatistics",
1215
+ url: "/v2/storages/buckets/spaceStatistics",
1214
1216
  params: params
1215
1217
  });
1216
1218
  }
1217
1219
  function deleteBucket(params) {
1218
1220
  return FUtil.Request({
1219
1221
  method: 'DELETE',
1220
- url: "/v1/storages/buckets/" + params.bucketName
1222
+ url: "/v2/storages/buckets/" + params.bucketName
1221
1223
  });
1222
1224
  }
1223
1225
  function bucketDetails(_ref) {
1224
1226
  var bucketName = _ref.bucketName;
1225
1227
  return FUtil.Request({
1226
1228
  method: 'GET',
1227
- url: "/v1/storages/buckets/" + bucketName
1229
+ url: "/v2/storages/buckets/" + bucketName
1228
1230
  });
1229
1231
  }
1230
1232
  function objectList(_ref2) {
@@ -1233,7 +1235,7 @@ function objectList(_ref2) {
1233
1235
 
1234
1236
  return FUtil.Request({
1235
1237
  method: 'GET',
1236
- url: "/v1/storages/buckets/" + bucketName + "/objects",
1238
+ url: "/v2/storages/buckets/" + bucketName + "/objects",
1237
1239
  params: params
1238
1240
  });
1239
1241
  }
@@ -1250,7 +1252,7 @@ function createObject(_ref3) {
1250
1252
 
1251
1253
  return FUtil.Request({
1252
1254
  method: 'POST',
1253
- url: "/v1/storages/buckets/" + bucketName + "/objects",
1255
+ url: "/v2/storages/buckets/" + bucketName + "/objects",
1254
1256
  data: params
1255
1257
  });
1256
1258
  }
@@ -1258,21 +1260,21 @@ function objectDetails$1(params) {
1258
1260
  if (params.objectIdOrName) {
1259
1261
  return FUtil.Request({
1260
1262
  method: 'GET',
1261
- url: "/v1/storages/objects/" + encodeURIComponent(params.objectIdOrName),
1263
+ url: "/v2/storages/objects/" + encodeURIComponent(params.objectIdOrName),
1262
1264
  params: params
1263
1265
  });
1264
1266
  }
1265
1267
 
1266
1268
  return FUtil.Request({
1267
1269
  method: 'GET',
1268
- url: "/v1/storages/buckets/" + params.bucketName + "/objects/" + params.objectId,
1270
+ url: "/v2/storages/buckets/" + params.bucketName + "/objects/" + params.objectId,
1269
1271
  params: params
1270
1272
  });
1271
1273
  }
1272
1274
  function deleteObjects(params) {
1273
1275
  return FUtil.Request({
1274
1276
  method: 'DELETE',
1275
- url: "/v1/storages/buckets/" + params.bucketName + "/objects/" + params.objectIds,
1277
+ url: "/v2/storages/buckets/" + params.bucketName + "/objects/" + params.objectIds,
1276
1278
  data: params
1277
1279
  });
1278
1280
  }
@@ -1280,16 +1282,16 @@ function bucketIsExist(_ref4) {
1280
1282
  var bucketName = _ref4.bucketName;
1281
1283
  return FUtil.Request({
1282
1284
  method: 'GET',
1283
- url: "/v1/storages/buckets/" + bucketName + "/isExist"
1285
+ url: "/v2/storages/buckets/" + bucketName + "/isExist"
1284
1286
  });
1285
1287
  }
1286
1288
  function downloadObject(params) {
1287
- return window.location.href = FUtil.Format.completeUrlByDomain('qi') + ("/v1/storages/objects/" + params.objectIdOrName + "/file");
1289
+ return window.location.href = FUtil.Format.completeUrlByDomain('qi') + ("/v2/storages/objects/" + params.objectIdOrName + "/file");
1288
1290
  }
1289
1291
  function fileIsExist(params) {
1290
1292
  return FUtil.Request({
1291
1293
  method: 'GET',
1292
- url: "/v1/storages/files/fileIsExist",
1294
+ url: "/v2/storages/files/fileIsExist",
1293
1295
  params: params
1294
1296
  });
1295
1297
  }
@@ -1311,15 +1313,15 @@ function uploadFile(params, config, returnCancel) {
1311
1313
  }
1312
1314
 
1313
1315
  if (!returnCancel) {
1314
- // return FUtil.Axios.post('/v1/storages/files/upload', formData, config);
1316
+ // return FUtil.Axios.post('/v2/storages/files/upload', formData, config);
1315
1317
  return FUtil.Request(_extends({
1316
1318
  method: 'POST',
1317
- url: "/v1/storages/files/upload",
1319
+ url: "/v2/storages/files/upload",
1318
1320
  data: formData
1319
1321
  }, config));
1320
1322
  }
1321
1323
 
1322
- var cancel = null; // const promise = FUtil.Axios.post('/v1/storages/files/upload', formData, {
1324
+ var cancel = null; // const promise = FUtil.Axios.post('/v2/storages/files/upload', formData, {
1323
1325
  // cancelToken: new FUtil.Axios.CancelToken((c) => {
1324
1326
  // cancel = c;
1325
1327
  // }),
@@ -1327,7 +1329,7 @@ function uploadFile(params, config, returnCancel) {
1327
1329
 
1328
1330
  var promise = FUtil.Request(_extends({
1329
1331
  method: 'POST',
1330
- url: "/v1/storages/files/upload",
1332
+ url: "/v2/storages/files/upload",
1331
1333
  data: formData,
1332
1334
  cancelToken: new FUtil.Axios.CancelToken(function (c) {
1333
1335
  cancel = c;
@@ -1350,7 +1352,7 @@ function uploadImage(params, config) {
1350
1352
 
1351
1353
  return FUtil.Request(_extends({
1352
1354
  method: 'POST',
1353
- url: "/v1/storages/files/uploadImage",
1355
+ url: "/v2/storages/files/uploadImage",
1354
1356
  data: formData
1355
1357
  }, config));
1356
1358
  }
@@ -1367,7 +1369,7 @@ function updateObject(_ref5) {
1367
1369
  function batchObjectList(params) {
1368
1370
  return FUtil.Request({
1369
1371
  method: 'GET',
1370
- url: "/v1/storages/objects/list",
1372
+ url: "/v2/storages/objects/list",
1371
1373
  params: params
1372
1374
  });
1373
1375
  }
@@ -1377,17 +1379,17 @@ function fileProperty(_ref6) {
1377
1379
 
1378
1380
  return FUtil.Request({
1379
1381
  method: 'GET',
1380
- url: "/v1/storages/files/" + sha1 + "/property",
1382
+ url: "/v2/storages/files/" + sha1 + "/property",
1381
1383
  params: params
1382
1384
  });
1383
1385
  }
1384
1386
  function cycleDependencyCheck(_ref7) {
1385
1387
  var objectIdOrName = _ref7.objectIdOrName,
1386
- params = _objectWithoutPropertiesLoose(_ref7, _excluded5$1);
1388
+ params = _objectWithoutPropertiesLoose(_ref7, _excluded5$2);
1387
1389
 
1388
1390
  return FUtil.Request({
1389
1391
  method: 'POST',
1390
- url: "/v1/storages/objects/" + objectIdOrName + "/cycleDependencyCheck",
1392
+ url: "/v2/storages/objects/" + objectIdOrName + "/cycleDependencyCheck",
1391
1393
  data: params
1392
1394
  });
1393
1395
  }
@@ -1493,7 +1495,7 @@ var _excluded$3 = ["resourceIdOrName"],
1493
1495
  _excluded2$3 = ["resourceId"],
1494
1496
  _excluded3$3 = ["resourceId"],
1495
1497
  _excluded4$3 = ["resourceId"],
1496
- _excluded5$2 = ["resourceId", "version"],
1498
+ _excluded5$3 = ["resourceId", "version"],
1497
1499
  _excluded6$1 = ["fileSha1"],
1498
1500
  _excluded7$1 = ["fileSha1"],
1499
1501
  _excluded8$1 = ["resourceId"],
@@ -1576,7 +1578,7 @@ function createVersion(_ref4) {
1576
1578
  function resourceVersionInfo1(_ref5) {
1577
1579
  var resourceId = _ref5.resourceId,
1578
1580
  version = _ref5.version,
1579
- params = _objectWithoutPropertiesLoose(_ref5, _excluded5$2);
1581
+ params = _objectWithoutPropertiesLoose(_ref5, _excluded5$3);
1580
1582
 
1581
1583
  return FUtil.Request({
1582
1584
  method: 'GET',
@@ -1988,7 +1990,7 @@ var _excluded$5 = ["nodeId"],
1988
1990
  _excluded2$4 = ["nodeId"],
1989
1991
  _excluded3$4 = ["nodeId"],
1990
1992
  _excluded4$4 = ["nodeId"],
1991
- _excluded5$3 = ["nodeId"],
1993
+ _excluded5$4 = ["nodeId"],
1992
1994
  _excluded6$2 = ["testResourceId"],
1993
1995
  _excluded7$2 = ["testResourceId"],
1994
1996
  _excluded8$2 = ["nodeId"],
@@ -2037,7 +2039,7 @@ function dependencyTree$2(_ref4) {
2037
2039
  }
2038
2040
  function putRules(_ref5) {
2039
2041
  var nodeId = _ref5.nodeId,
2040
- params = _objectWithoutPropertiesLoose(_ref5, _excluded5$3);
2042
+ params = _objectWithoutPropertiesLoose(_ref5, _excluded5$4);
2041
2043
 
2042
2044
  return FUtil.Request({
2043
2045
  method: 'PUT',
@@ -2164,9 +2166,27 @@ var InformalNode = {
2164
2166
 
2165
2167
  var _excluded$6 = ["contractId"],
2166
2168
  _excluded2$5 = ["contractId"];
2167
- function contractDetails(_ref) {
2168
- var contractId = _ref.contractId,
2169
- params = _objectWithoutPropertiesLoose(_ref, _excluded$6);
2169
+ function createContract(_ref) {
2170
+ var params = _extends({}, _ref);
2171
+
2172
+ return FUtil.Request({
2173
+ method: 'POST',
2174
+ url: "/v2/contracts",
2175
+ data: params
2176
+ });
2177
+ }
2178
+ function batchCreateContracts(_ref2) {
2179
+ var params = _extends({}, _ref2);
2180
+
2181
+ return FUtil.Request({
2182
+ method: 'POST',
2183
+ url: "/v2/contracts/batchSign",
2184
+ data: params
2185
+ });
2186
+ }
2187
+ function contractDetails(_ref3) {
2188
+ var contractId = _ref3.contractId,
2189
+ params = _objectWithoutPropertiesLoose(_ref3, _excluded$6);
2170
2190
 
2171
2191
  return FUtil.Request({
2172
2192
  method: 'GET',
@@ -2188,9 +2208,9 @@ function batchContracts(params) {
2188
2208
  params: params
2189
2209
  });
2190
2210
  }
2191
- function transitionRecords(_ref2) {
2192
- var contractId = _ref2.contractId,
2193
- params = _objectWithoutPropertiesLoose(_ref2, _excluded2$5);
2211
+ function transitionRecords(_ref4) {
2212
+ var contractId = _ref4.contractId,
2213
+ params = _objectWithoutPropertiesLoose(_ref4, _excluded2$5);
2194
2214
 
2195
2215
  return FUtil.Request({
2196
2216
  method: 'GET',
@@ -2208,6 +2228,8 @@ function contractsSignCount(params) {
2208
2228
 
2209
2229
  var Contract = {
2210
2230
  __proto__: null,
2231
+ createContract: createContract,
2232
+ batchCreateContracts: batchCreateContracts,
2211
2233
  contractDetails: contractDetails,
2212
2234
  contracts: contracts,
2213
2235
  batchContracts: batchContracts,
@@ -3044,13 +3066,7 @@ axios.interceptors.response.use(function (response) {
3044
3066
  });
3045
3067
  function request(_x, _x2) {
3046
3068
  return _request.apply(this, arguments);
3047
- } // export function downloadFile(res: AxiosResponse) {
3048
- // const {data, headers} = res;
3049
- // // const fileName = headers['content-disposition'].replace(/attachment; filename="(.*)"/, '$1');
3050
- // const fileName = headers['content-disposition'].replace(/attachment; filename="(.*)"/, '$1');
3051
- // const blob = new Blob([data], {});
3052
- // FileSaver.saveAs(blob, fileName);
3053
- // }
3069
+ }
3054
3070
 
3055
3071
  function _request() {
3056
3072
  _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config, _temp) {
@@ -3068,7 +3084,7 @@ function _request() {
3068
3084
  result = _context.sent;
3069
3085
 
3070
3086
  if (!(result.ret === 0 && result.errCode === 30 && !noRedirect)) {
3071
- _context.next = 8;
3087
+ _context.next = 10;
3072
3088
  break;
3073
3089
  }
3074
3090
 
@@ -3079,17 +3095,20 @@ function _request() {
3079
3095
  window.location.replace("" + completeUrlByDomain('user') + login({
3080
3096
  goTo: window.location.href
3081
3097
  }));
3098
+ _context.next = 11;
3099
+ break;
3082
3100
 
3083
- case 8:
3101
+ case 10:
3084
3102
  if (result.ret === 4 && result.errCode === 10 && !noRedirect) {
3085
3103
  window.location.replace("" + completeUrlByDomain('user') + userFreeze({
3086
3104
  goTo: window.location.href
3087
3105
  }));
3088
3106
  }
3089
3107
 
3108
+ case 11:
3090
3109
  return _context.abrupt("return", result);
3091
3110
 
3092
- case 11:
3111
+ case 12:
3093
3112
  case "end":
3094
3113
  return _context.stop();
3095
3114
  }
@@ -3305,18 +3324,19 @@ var I18nNext = /*#__PURE__*/function () {
3305
3324
 
3306
3325
  _proto._fetchData = /*#__PURE__*/function () {
3307
3326
  var _fetchData2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3308
- var res, en_US, zh_CN, _i, _Object$entries, _Object$entries$_i, key, value, result;
3327
+ var url, res, en_US, zh_CN, _i, _Object$entries, _Object$entries$_i, key, value, result;
3309
3328
 
3310
3329
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3311
3330
  while (1) {
3312
3331
  switch (_context4.prev = _context4.next) {
3313
3332
  case 0:
3314
- _context4.next = 2;
3315
- return axios.get(window.location.origin.includes('.freelog.com') ? ossJsonUrl : ossJsonUrl_Test, {
3333
+ url = window.location.origin.includes('.freelog.com') ? ossJsonUrl : ossJsonUrl_Test;
3334
+ _context4.next = 3;
3335
+ return axios.get(url + '?timestamp=' + Date.now(), {
3316
3336
  withCredentials: false
3317
3337
  });
3318
3338
 
3319
- case 2:
3339
+ case 3:
3320
3340
  res = _context4.sent;
3321
3341
  // console.log(res, 'data09oiw3qjelsfkdfjlsdkfjl');
3322
3342
  en_US = {};
@@ -3345,7 +3365,7 @@ var I18nNext = /*#__PURE__*/function () {
3345
3365
 
3346
3366
  return _context4.abrupt("return", result);
3347
3367
 
3348
- case 9:
3368
+ case 10:
3349
3369
  case "end":
3350
3370
  return _context4.stop();
3351
3371
  }