@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.
@@ -594,7 +594,8 @@ function _objectWithoutPropertiesLoose(source, excluded) {
594
594
 
595
595
  var _excluded = ["resourceID"],
596
596
  _excluded2 = ["nodeID", "showPage"],
597
- _excluded3 = ["nodeID", "showPage"];
597
+ _excluded3 = ["nodeID", "showPage"],
598
+ _excluded4 = ["goTo"];
598
599
  function home(_temp) {
599
600
  var _ref = _temp === void 0 ? {} : _temp;
600
601
 
@@ -780,11 +781,12 @@ function login(_temp13) {
780
781
  }
781
782
  function logon(_temp14) {
782
783
  var _ref30 = _temp14 === void 0 ? {} : _temp14,
783
- goTo = _ref30.goTo;
784
+ goTo = _ref30.goTo,
785
+ params = _objectWithoutPropertiesLoose(_ref30, _excluded4);
784
786
 
785
- return "/logon" + handleQuery({
787
+ return "/logon" + handleQuery(_extends({
786
788
  goTo: goTo ? encodeURIComponent(goTo) : undefined
787
- });
789
+ }, params));
788
790
  }
789
791
  function retrieveUserPassword(_temp15) {
790
792
  var _ref31 = _temp15 === void 0 ? {} : _temp15,
@@ -1008,7 +1010,7 @@ var Node = {
1008
1010
  var _excluded$1 = ["presentableId"],
1009
1011
  _excluded2$1 = ["presentableId"],
1010
1012
  _excluded3$1 = ["presentableId"],
1011
- _excluded4 = ["presentableId"],
1013
+ _excluded4$1 = ["presentableId"],
1012
1014
  _excluded5 = ["presentableId"],
1013
1015
  _excluded6 = ["presentableId"],
1014
1016
  _excluded7 = ["presentableId"],
@@ -1085,7 +1087,7 @@ function presentableList(params) {
1085
1087
  }
1086
1088
  function dependencyTree(_ref3) {
1087
1089
  var presentableId = _ref3.presentableId,
1088
- params = _objectWithoutPropertiesLoose(_ref3, _excluded4);
1090
+ params = _objectWithoutPropertiesLoose(_ref3, _excluded4$1);
1089
1091
 
1090
1092
  // return FUtil.Axios.get(`/v2/presentables/${presentableId}/dependencyTree`, {params});
1091
1093
  return FUtil.Request({
@@ -1185,19 +1187,19 @@ var Exhibit = {
1185
1187
  var _excluded$2 = ["bucketName"],
1186
1188
  _excluded2$2 = ["bucketName"],
1187
1189
  _excluded3$2 = ["objectIdOrName"],
1188
- _excluded4$1 = ["sha1"],
1190
+ _excluded4$2 = ["sha1"],
1189
1191
  _excluded5$1 = ["objectIdOrName"];
1190
1192
  function createBucket(params) {
1191
1193
  return FUtil.Request({
1192
1194
  method: 'POST',
1193
- url: "/v1/storages/buckets",
1195
+ url: "/v2/storages/buckets",
1194
1196
  data: params
1195
1197
  });
1196
1198
  }
1197
1199
  function bucketList(params) {
1198
1200
  return FUtil.Request({
1199
1201
  method: 'GET',
1200
- url: "/v1/storages/buckets",
1202
+ url: "/v2/storages/buckets",
1201
1203
  params: params
1202
1204
  });
1203
1205
  }
@@ -1208,21 +1210,21 @@ function spaceStatistics(params) {
1208
1210
 
1209
1211
  return FUtil.Request({
1210
1212
  method: 'GET',
1211
- url: "/v1/storages/buckets/spaceStatistics",
1213
+ url: "/v2/storages/buckets/spaceStatistics",
1212
1214
  params: params
1213
1215
  });
1214
1216
  }
1215
1217
  function deleteBucket(params) {
1216
1218
  return FUtil.Request({
1217
1219
  method: 'DELETE',
1218
- url: "/v1/storages/buckets/" + params.bucketName
1220
+ url: "/v2/storages/buckets/" + params.bucketName
1219
1221
  });
1220
1222
  }
1221
1223
  function bucketDetails(_ref) {
1222
1224
  var bucketName = _ref.bucketName;
1223
1225
  return FUtil.Request({
1224
1226
  method: 'GET',
1225
- url: "/v1/storages/buckets/" + bucketName
1227
+ url: "/v2/storages/buckets/" + bucketName
1226
1228
  });
1227
1229
  }
1228
1230
  function objectList(_ref2) {
@@ -1231,7 +1233,7 @@ function objectList(_ref2) {
1231
1233
 
1232
1234
  return FUtil.Request({
1233
1235
  method: 'GET',
1234
- url: "/v1/storages/buckets/" + bucketName + "/objects",
1236
+ url: "/v2/storages/buckets/" + bucketName + "/objects",
1235
1237
  params: params
1236
1238
  });
1237
1239
  }
@@ -1248,7 +1250,7 @@ function createObject(_ref3) {
1248
1250
 
1249
1251
  return FUtil.Request({
1250
1252
  method: 'POST',
1251
- url: "/v1/storages/buckets/" + bucketName + "/objects",
1253
+ url: "/v2/storages/buckets/" + bucketName + "/objects",
1252
1254
  data: params
1253
1255
  });
1254
1256
  }
@@ -1256,21 +1258,21 @@ function objectDetails$1(params) {
1256
1258
  if (params.objectIdOrName) {
1257
1259
  return FUtil.Request({
1258
1260
  method: 'GET',
1259
- url: "/v1/storages/objects/" + encodeURIComponent(params.objectIdOrName),
1261
+ url: "/v2/storages/objects/" + encodeURIComponent(params.objectIdOrName),
1260
1262
  params: params
1261
1263
  });
1262
1264
  }
1263
1265
 
1264
1266
  return FUtil.Request({
1265
1267
  method: 'GET',
1266
- url: "/v1/storages/buckets/" + params.bucketName + "/objects/" + params.objectId,
1268
+ url: "/v2/storages/buckets/" + params.bucketName + "/objects/" + params.objectId,
1267
1269
  params: params
1268
1270
  });
1269
1271
  }
1270
1272
  function deleteObjects(params) {
1271
1273
  return FUtil.Request({
1272
1274
  method: 'DELETE',
1273
- url: "/v1/storages/buckets/" + params.bucketName + "/objects/" + params.objectIds,
1275
+ url: "/v2/storages/buckets/" + params.bucketName + "/objects/" + params.objectIds,
1274
1276
  data: params
1275
1277
  });
1276
1278
  }
@@ -1278,16 +1280,16 @@ function bucketIsExist(_ref4) {
1278
1280
  var bucketName = _ref4.bucketName;
1279
1281
  return FUtil.Request({
1280
1282
  method: 'GET',
1281
- url: "/v1/storages/buckets/" + bucketName + "/isExist"
1283
+ url: "/v2/storages/buckets/" + bucketName + "/isExist"
1282
1284
  });
1283
1285
  }
1284
1286
  function downloadObject(params) {
1285
- return window.location.href = FUtil.Format.completeUrlByDomain('qi') + ("/v1/storages/objects/" + params.objectIdOrName + "/file");
1287
+ return window.location.href = FUtil.Format.completeUrlByDomain('qi') + ("/v2/storages/objects/" + params.objectIdOrName + "/file");
1286
1288
  }
1287
1289
  function fileIsExist(params) {
1288
1290
  return FUtil.Request({
1289
1291
  method: 'GET',
1290
- url: "/v1/storages/files/fileIsExist",
1292
+ url: "/v2/storages/files/fileIsExist",
1291
1293
  params: params
1292
1294
  });
1293
1295
  }
@@ -1309,15 +1311,15 @@ function uploadFile(params, config, returnCancel) {
1309
1311
  }
1310
1312
 
1311
1313
  if (!returnCancel) {
1312
- // return FUtil.Axios.post('/v1/storages/files/upload', formData, config);
1314
+ // return FUtil.Axios.post('/v2/storages/files/upload', formData, config);
1313
1315
  return FUtil.Request(_extends({
1314
1316
  method: 'POST',
1315
- url: "/v1/storages/files/upload",
1317
+ url: "/v2/storages/files/upload",
1316
1318
  data: formData
1317
1319
  }, config));
1318
1320
  }
1319
1321
 
1320
- var cancel = null; // const promise = FUtil.Axios.post('/v1/storages/files/upload', formData, {
1322
+ var cancel = null; // const promise = FUtil.Axios.post('/v2/storages/files/upload', formData, {
1321
1323
  // cancelToken: new FUtil.Axios.CancelToken((c) => {
1322
1324
  // cancel = c;
1323
1325
  // }),
@@ -1325,7 +1327,7 @@ function uploadFile(params, config, returnCancel) {
1325
1327
 
1326
1328
  var promise = FUtil.Request(_extends({
1327
1329
  method: 'POST',
1328
- url: "/v1/storages/files/upload",
1330
+ url: "/v2/storages/files/upload",
1329
1331
  data: formData,
1330
1332
  cancelToken: new FUtil.Axios.CancelToken(function (c) {
1331
1333
  cancel = c;
@@ -1348,7 +1350,7 @@ function uploadImage(params, config) {
1348
1350
 
1349
1351
  return FUtil.Request(_extends({
1350
1352
  method: 'POST',
1351
- url: "/v1/storages/files/uploadImage",
1353
+ url: "/v2/storages/files/uploadImage",
1352
1354
  data: formData
1353
1355
  }, config));
1354
1356
  }
@@ -1365,17 +1367,17 @@ function updateObject(_ref5) {
1365
1367
  function batchObjectList(params) {
1366
1368
  return FUtil.Request({
1367
1369
  method: 'GET',
1368
- url: "/v1/storages/objects/list",
1370
+ url: "/v2/storages/objects/list",
1369
1371
  params: params
1370
1372
  });
1371
1373
  }
1372
1374
  function fileProperty(_ref6) {
1373
1375
  var sha1 = _ref6.sha1,
1374
- params = _objectWithoutPropertiesLoose(_ref6, _excluded4$1);
1376
+ params = _objectWithoutPropertiesLoose(_ref6, _excluded4$2);
1375
1377
 
1376
1378
  return FUtil.Request({
1377
1379
  method: 'GET',
1378
- url: "/v1/storages/files/" + sha1 + "/property",
1380
+ url: "/v2/storages/files/" + sha1 + "/property",
1379
1381
  params: params
1380
1382
  });
1381
1383
  }
@@ -1385,7 +1387,7 @@ function cycleDependencyCheck(_ref7) {
1385
1387
 
1386
1388
  return FUtil.Request({
1387
1389
  method: 'POST',
1388
- url: "/v1/storages/objects/" + objectIdOrName + "/cycleDependencyCheck",
1390
+ url: "/v2/storages/objects/" + objectIdOrName + "/cycleDependencyCheck",
1389
1391
  data: params
1390
1392
  });
1391
1393
  }
@@ -1490,7 +1492,7 @@ var Collection = {
1490
1492
  var _excluded$3 = ["resourceIdOrName"],
1491
1493
  _excluded2$3 = ["resourceId"],
1492
1494
  _excluded3$3 = ["resourceId"],
1493
- _excluded4$2 = ["resourceId"],
1495
+ _excluded4$3 = ["resourceId"],
1494
1496
  _excluded5$2 = ["resourceId", "version"],
1495
1497
  _excluded6$1 = ["fileSha1"],
1496
1498
  _excluded7$1 = ["fileSha1"],
@@ -1562,7 +1564,7 @@ function authTree$1(_ref3) {
1562
1564
  }
1563
1565
  function createVersion(_ref4) {
1564
1566
  var resourceId = _ref4.resourceId,
1565
- params = _objectWithoutPropertiesLoose(_ref4, _excluded4$2);
1567
+ params = _objectWithoutPropertiesLoose(_ref4, _excluded4$3);
1566
1568
 
1567
1569
  // return FUtil.Axios.post(`/v2/resources/${resourceId}/versions`, params);
1568
1570
  return FUtil.Request({
@@ -1985,7 +1987,7 @@ var User = {
1985
1987
  var _excluded$5 = ["nodeId"],
1986
1988
  _excluded2$4 = ["nodeId"],
1987
1989
  _excluded3$4 = ["nodeId"],
1988
- _excluded4$3 = ["nodeId"],
1990
+ _excluded4$4 = ["nodeId"],
1989
1991
  _excluded5$3 = ["nodeId"],
1990
1992
  _excluded6$2 = ["testResourceId"],
1991
1993
  _excluded7$2 = ["testResourceId"],
@@ -2025,7 +2027,7 @@ function batchTestResources(_ref3) {
2025
2027
  }
2026
2028
  function dependencyTree$2(_ref4) {
2027
2029
  var nodeId = _ref4.nodeId,
2028
- params = _objectWithoutPropertiesLoose(_ref4, _excluded4$3);
2030
+ params = _objectWithoutPropertiesLoose(_ref4, _excluded4$4);
2029
2031
 
2030
2032
  return FUtil.Request({
2031
2033
  method: 'GET',
@@ -2162,9 +2164,27 @@ var InformalNode = {
2162
2164
 
2163
2165
  var _excluded$6 = ["contractId"],
2164
2166
  _excluded2$5 = ["contractId"];
2165
- function contractDetails(_ref) {
2166
- var contractId = _ref.contractId,
2167
- params = _objectWithoutPropertiesLoose(_ref, _excluded$6);
2167
+ function createContract(_ref) {
2168
+ var params = _extends({}, _ref);
2169
+
2170
+ return FUtil.Request({
2171
+ method: 'POST',
2172
+ url: "/v2/contracts",
2173
+ data: params
2174
+ });
2175
+ }
2176
+ function batchCreateContracts(_ref2) {
2177
+ var params = _extends({}, _ref2);
2178
+
2179
+ return FUtil.Request({
2180
+ method: 'POST',
2181
+ url: "/v2/contracts/batchSign",
2182
+ data: params
2183
+ });
2184
+ }
2185
+ function contractDetails(_ref3) {
2186
+ var contractId = _ref3.contractId,
2187
+ params = _objectWithoutPropertiesLoose(_ref3, _excluded$6);
2168
2188
 
2169
2189
  return FUtil.Request({
2170
2190
  method: 'GET',
@@ -2186,9 +2206,9 @@ function batchContracts(params) {
2186
2206
  params: params
2187
2207
  });
2188
2208
  }
2189
- function transitionRecords(_ref2) {
2190
- var contractId = _ref2.contractId,
2191
- params = _objectWithoutPropertiesLoose(_ref2, _excluded2$5);
2209
+ function transitionRecords(_ref4) {
2210
+ var contractId = _ref4.contractId,
2211
+ params = _objectWithoutPropertiesLoose(_ref4, _excluded2$5);
2192
2212
 
2193
2213
  return FUtil.Request({
2194
2214
  method: 'GET',
@@ -2206,6 +2226,8 @@ function contractsSignCount(params) {
2206
2226
 
2207
2227
  var Contract = {
2208
2228
  __proto__: null,
2229
+ createContract: createContract,
2230
+ batchCreateContracts: batchCreateContracts,
2209
2231
  contractDetails: contractDetails,
2210
2232
  contracts: contracts,
2211
2233
  batchContracts: batchContracts,
@@ -3042,13 +3064,7 @@ axios.interceptors.response.use(function (response) {
3042
3064
  });
3043
3065
  function request(_x, _x2) {
3044
3066
  return _request.apply(this, arguments);
3045
- } // export function downloadFile(res: AxiosResponse) {
3046
- // const {data, headers} = res;
3047
- // // const fileName = headers['content-disposition'].replace(/attachment; filename="(.*)"/, '$1');
3048
- // const fileName = headers['content-disposition'].replace(/attachment; filename="(.*)"/, '$1');
3049
- // const blob = new Blob([data], {});
3050
- // FileSaver.saveAs(blob, fileName);
3051
- // }
3067
+ }
3052
3068
 
3053
3069
  function _request() {
3054
3070
  _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config, _temp) {
@@ -3066,7 +3082,7 @@ function _request() {
3066
3082
  result = _context.sent;
3067
3083
 
3068
3084
  if (!(result.ret === 0 && result.errCode === 30 && !noRedirect)) {
3069
- _context.next = 8;
3085
+ _context.next = 10;
3070
3086
  break;
3071
3087
  }
3072
3088
 
@@ -3077,17 +3093,20 @@ function _request() {
3077
3093
  window.location.replace("" + completeUrlByDomain('user') + login({
3078
3094
  goTo: window.location.href
3079
3095
  }));
3096
+ _context.next = 11;
3097
+ break;
3080
3098
 
3081
- case 8:
3099
+ case 10:
3082
3100
  if (result.ret === 4 && result.errCode === 10 && !noRedirect) {
3083
3101
  window.location.replace("" + completeUrlByDomain('user') + userFreeze({
3084
3102
  goTo: window.location.href
3085
3103
  }));
3086
3104
  }
3087
3105
 
3106
+ case 11:
3088
3107
  return _context.abrupt("return", result);
3089
3108
 
3090
- case 11:
3109
+ case 12:
3091
3110
  case "end":
3092
3111
  return _context.stop();
3093
3112
  }
@@ -3303,18 +3322,19 @@ var I18nNext = /*#__PURE__*/function () {
3303
3322
 
3304
3323
  _proto._fetchData = /*#__PURE__*/function () {
3305
3324
  var _fetchData2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3306
- var res, en_US, zh_CN, _i, _Object$entries, _Object$entries$_i, key, value, result;
3325
+ var url, res, en_US, zh_CN, _i, _Object$entries, _Object$entries$_i, key, value, result;
3307
3326
 
3308
3327
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3309
3328
  while (1) {
3310
3329
  switch (_context4.prev = _context4.next) {
3311
3330
  case 0:
3312
- _context4.next = 2;
3313
- return axios.get(window.location.origin.includes('.freelog.com') ? ossJsonUrl : ossJsonUrl_Test, {
3331
+ url = window.location.origin.includes('.freelog.com') ? ossJsonUrl : ossJsonUrl_Test;
3332
+ _context4.next = 3;
3333
+ return axios.get(url + '?timestamp=' + Date.now(), {
3314
3334
  withCredentials: false
3315
3335
  });
3316
3336
 
3317
- case 2:
3337
+ case 3:
3318
3338
  res = _context4.sent;
3319
3339
  // console.log(res, 'data09oiw3qjelsfkdfjlsdkfjl');
3320
3340
  en_US = {};
@@ -3343,7 +3363,7 @@ var I18nNext = /*#__PURE__*/function () {
3343
3363
 
3344
3364
  return _context4.abrupt("return", result);
3345
3365
 
3346
- case 9:
3366
+ case 10:
3347
3367
  case "end":
3348
3368
  return _context4.stop();
3349
3369
  }