@freelog/tools-lib 0.1.105 → 0.1.108
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.
- package/dist/service-API/combinations/index.d.ts +7 -0
- package/dist/service-API/index.d.ts +2 -0
- package/dist/service-API/resources.d.ts +2 -2
- package/dist/service-API/storages.d.ts +5 -2
- package/dist/service-API/user.d.ts +6 -0
- package/dist/tools-lib.cjs.development.js +91 -11
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +91 -11
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/format.d.ts +5 -0
- package/package.json +67 -65
- package/src/i18n/I18nNext.ts +146 -134
- package/src/i18n/index.ts +7 -7
- package/src/index.ts +9 -9
- package/src/service-API/combinations/index.ts +27 -0
- package/src/service-API/i18n.ts +35 -35
- package/src/service-API/index.ts +2 -0
- package/src/service-API/resources.ts +2 -2
- package/src/service-API/storages.ts +358 -345
- package/src/service-API/user.ts +205 -190
- package/src/utils/format.ts +9 -0
- package/src/utils/index.ts +20 -20
package/dist/tools-lib.esm.js
CHANGED
|
@@ -6,6 +6,7 @@ import NProgress from 'nprogress';
|
|
|
6
6
|
import 'nprogress/nprogress.css';
|
|
7
7
|
import { lib, SHA1 } from 'crypto-js';
|
|
8
8
|
import i18next from 'i18next';
|
|
9
|
+
import Cookies from 'js-cookie';
|
|
9
10
|
|
|
10
11
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
11
12
|
try {
|
|
@@ -889,6 +890,10 @@ function completeUrlByDomain(domain) {
|
|
|
889
890
|
function policyCodeTranslationToText(_x, _x2) {
|
|
890
891
|
return _policyCodeTranslationToText.apply(this, arguments);
|
|
891
892
|
}
|
|
893
|
+
/**
|
|
894
|
+
* 将资源类型关键字数组,转换成标准展示文字
|
|
895
|
+
* @param arr 关键字数组
|
|
896
|
+
*/
|
|
892
897
|
|
|
893
898
|
function _policyCodeTranslationToText() {
|
|
894
899
|
_policyCodeTranslationToText = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(code, targetType) {
|
|
@@ -943,12 +948,17 @@ function _policyCodeTranslationToText() {
|
|
|
943
948
|
return _policyCodeTranslationToText.apply(this, arguments);
|
|
944
949
|
}
|
|
945
950
|
|
|
951
|
+
function resourceTypeKeyArrToResourceType(arr) {
|
|
952
|
+
return arr.join(' / ');
|
|
953
|
+
}
|
|
954
|
+
|
|
946
955
|
var Format = {
|
|
947
956
|
__proto__: null,
|
|
948
957
|
humanizeSize: humanizeSize,
|
|
949
958
|
formatDateTime: formatDateTime,
|
|
950
959
|
completeUrlByDomain: completeUrlByDomain,
|
|
951
|
-
policyCodeTranslationToText: policyCodeTranslationToText
|
|
960
|
+
policyCodeTranslationToText: policyCodeTranslationToText,
|
|
961
|
+
resourceTypeKeyArrToResourceType: resourceTypeKeyArrToResourceType
|
|
952
962
|
};
|
|
953
963
|
|
|
954
964
|
// 展品名称
|
|
@@ -1727,7 +1737,7 @@ function updateObject(_ref5) {
|
|
|
1727
1737
|
|
|
1728
1738
|
return FUtil.Request({
|
|
1729
1739
|
method: 'PUT',
|
|
1730
|
-
url: "/
|
|
1740
|
+
url: "/v2/storages/objects/" + objectIdOrName,
|
|
1731
1741
|
data: params
|
|
1732
1742
|
});
|
|
1733
1743
|
}
|
|
@@ -1767,6 +1777,15 @@ function clearUserNodeData(_ref8) {
|
|
|
1767
1777
|
data: params
|
|
1768
1778
|
});
|
|
1769
1779
|
}
|
|
1780
|
+
function filesListInfo(_ref9) {
|
|
1781
|
+
var params = _extends({}, _ref9);
|
|
1782
|
+
|
|
1783
|
+
return FUtil.Request({
|
|
1784
|
+
method: 'GET',
|
|
1785
|
+
url: "/v2/storages/files/list/info",
|
|
1786
|
+
params: params
|
|
1787
|
+
});
|
|
1788
|
+
}
|
|
1770
1789
|
|
|
1771
1790
|
var Storage = {
|
|
1772
1791
|
__proto__: null,
|
|
@@ -1789,7 +1808,8 @@ var Storage = {
|
|
|
1789
1808
|
batchObjectList: batchObjectList,
|
|
1790
1809
|
fileProperty: fileProperty,
|
|
1791
1810
|
cycleDependencyCheck: cycleDependencyCheck,
|
|
1792
|
-
clearUserNodeData: clearUserNodeData
|
|
1811
|
+
clearUserNodeData: clearUserNodeData,
|
|
1812
|
+
filesListInfo: filesListInfo
|
|
1793
1813
|
};
|
|
1794
1814
|
|
|
1795
1815
|
function collectResource(params) {
|
|
@@ -2233,6 +2253,13 @@ function updateMobileOrEmail(params) {
|
|
|
2233
2253
|
data: params
|
|
2234
2254
|
});
|
|
2235
2255
|
}
|
|
2256
|
+
function registerOrBind(params) {
|
|
2257
|
+
return FUtil.Request({
|
|
2258
|
+
method: 'POST',
|
|
2259
|
+
url: "/v2/thirdParty/registerOrBind",
|
|
2260
|
+
data: params
|
|
2261
|
+
});
|
|
2262
|
+
}
|
|
2236
2263
|
|
|
2237
2264
|
var User = {
|
|
2238
2265
|
__proto__: null,
|
|
@@ -2247,7 +2274,8 @@ var User = {
|
|
|
2247
2274
|
updateDetailInfo: updateDetailInfo,
|
|
2248
2275
|
verifyLoginPassword: verifyLoginPassword,
|
|
2249
2276
|
areasProvinces: areasProvinces,
|
|
2250
|
-
updateMobileOrEmail: updateMobileOrEmail
|
|
2277
|
+
updateMobileOrEmail: updateMobileOrEmail,
|
|
2278
|
+
registerOrBind: registerOrBind
|
|
2251
2279
|
};
|
|
2252
2280
|
|
|
2253
2281
|
var _excluded$5 = ["nodeId"],
|
|
@@ -2715,6 +2743,47 @@ var I18n = {
|
|
|
2715
2743
|
configsList: configsList
|
|
2716
2744
|
};
|
|
2717
2745
|
|
|
2746
|
+
function getFilesSha1Info(_x) {
|
|
2747
|
+
return _getFilesSha1Info.apply(this, arguments);
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
function _getFilesSha1Info() {
|
|
2751
|
+
_getFilesSha1Info = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref) {
|
|
2752
|
+
var sha1, cdPartiallySuccess, cdPartiallyFail, _yield$Storage$filesL, data, all, success, fail;
|
|
2753
|
+
|
|
2754
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
2755
|
+
while (1) {
|
|
2756
|
+
switch (_context.prev = _context.next) {
|
|
2757
|
+
case 0:
|
|
2758
|
+
sha1 = _ref.sha1, cdPartiallySuccess = _ref.cdPartiallySuccess, cdPartiallyFail = _ref.cdPartiallyFail;
|
|
2759
|
+
_context.next = 3;
|
|
2760
|
+
return filesListInfo({
|
|
2761
|
+
sha1: sha1
|
|
2762
|
+
});
|
|
2763
|
+
|
|
2764
|
+
case 3:
|
|
2765
|
+
_yield$Storage$filesL = _context.sent;
|
|
2766
|
+
data = _yield$Storage$filesL.data;
|
|
2767
|
+
all = [];
|
|
2768
|
+
success = [];
|
|
2769
|
+
fail = [];
|
|
2770
|
+
console.log(data, all, success, fail, cdPartiallySuccess, cdPartiallyFail, '093oijsdlkfsjdl');
|
|
2771
|
+
|
|
2772
|
+
case 9:
|
|
2773
|
+
case "end":
|
|
2774
|
+
return _context.stop();
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
}, _callee);
|
|
2778
|
+
}));
|
|
2779
|
+
return _getFilesSha1Info.apply(this, arguments);
|
|
2780
|
+
}
|
|
2781
|
+
|
|
2782
|
+
var C = {
|
|
2783
|
+
__proto__: null,
|
|
2784
|
+
getFilesSha1Info: getFilesSha1Info
|
|
2785
|
+
};
|
|
2786
|
+
|
|
2718
2787
|
var FServiceAPI = {
|
|
2719
2788
|
Node: Node,
|
|
2720
2789
|
Exhibit: Exhibit,
|
|
@@ -2730,7 +2799,8 @@ var FServiceAPI = {
|
|
|
2730
2799
|
Activity: Activity,
|
|
2731
2800
|
TestQualification: TestQualification,
|
|
2732
2801
|
Statistic: Statistic,
|
|
2733
|
-
I18n: I18n
|
|
2802
|
+
I18n: I18n,
|
|
2803
|
+
C: C
|
|
2734
2804
|
};
|
|
2735
2805
|
|
|
2736
2806
|
var codeMessage = {
|
|
@@ -2984,7 +3054,7 @@ var FUtil = {
|
|
|
2984
3054
|
};
|
|
2985
3055
|
|
|
2986
3056
|
var ossJsonUrl = 'https://freelog-i18n.oss-cn-shenzhen.aliyuncs.com/configs/i18n.json';
|
|
2987
|
-
var localStorage_i18nextLng_key = '
|
|
3057
|
+
var localStorage_i18nextLng_key = 'locale';
|
|
2988
3058
|
var localStorage_i18nextResources_key = 'i18nextResources';
|
|
2989
3059
|
var allLanguage = [{
|
|
2990
3060
|
value: 'en_US',
|
|
@@ -2998,8 +3068,9 @@ var self;
|
|
|
2998
3068
|
var I18nNext = /*#__PURE__*/function () {
|
|
2999
3069
|
function I18nNext() {
|
|
3000
3070
|
this._loadingData = 'NotStart';
|
|
3001
|
-
this._taskQueue = [];
|
|
3002
|
-
|
|
3071
|
+
this._taskQueue = []; // private _currentLanguage: LanguageKeyType = window.localStorage.getItem(localStorage_i18nextLng_key) as null || 'zh_CN';
|
|
3072
|
+
|
|
3073
|
+
this._currentLanguage = Cookies.get(localStorage_i18nextLng_key) || 'zh_CN';
|
|
3003
3074
|
self = this;
|
|
3004
3075
|
self.ready();
|
|
3005
3076
|
}
|
|
@@ -3093,7 +3164,11 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3093
3164
|
|
|
3094
3165
|
_proto.changeLanguage = function changeLanguage(lng) {
|
|
3095
3166
|
// return i18next.changeLanguage(lng);
|
|
3096
|
-
window.localStorage.setItem(localStorage_i18nextLng_key, lng)
|
|
3167
|
+
// window.localStorage.setItem(localStorage_i18nextLng_key, lng)
|
|
3168
|
+
Cookies.set(localStorage_i18nextLng_key, lng, {
|
|
3169
|
+
expires: 36525,
|
|
3170
|
+
domain: FUtil.Format.completeUrlByDomain('').replace(/http(s)?:\/\//, '')
|
|
3171
|
+
});
|
|
3097
3172
|
};
|
|
3098
3173
|
|
|
3099
3174
|
_proto.getAllLanguage = function getAllLanguage() {
|
|
@@ -3112,7 +3187,8 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3112
3187
|
switch (_context3.prev = _context3.next) {
|
|
3113
3188
|
case 0:
|
|
3114
3189
|
lng = self._currentLanguage;
|
|
3115
|
-
resource = window.localStorage.getItem(localStorage_i18nextResources_key);
|
|
3190
|
+
resource = window.localStorage.getItem(localStorage_i18nextResources_key); // const resource: string | undefined = Cookies.get(decodeURIComponent(localStorage_i18nextResources_key));
|
|
3191
|
+
|
|
3116
3192
|
i18nextResources = resource ? JSON.parse(resource) : null;
|
|
3117
3193
|
|
|
3118
3194
|
if (i18nextResources) {
|
|
@@ -3195,7 +3271,11 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3195
3271
|
}
|
|
3196
3272
|
}; // console.log(result, 'result093sdolkfjlsdkjl');
|
|
3197
3273
|
|
|
3198
|
-
window.localStorage.setItem(localStorage_i18nextResources_key, JSON.stringify(result));
|
|
3274
|
+
window.localStorage.setItem(localStorage_i18nextResources_key, JSON.stringify(result)); // Cookies.set(localStorage_i18nextResources_key, encodeURIComponent(JSON.stringify(result)), {
|
|
3275
|
+
// expires: 36525,
|
|
3276
|
+
// domain: FUtil.Format.completeUrlByDomain('').replace(/http(s)?:\/\//, ''),
|
|
3277
|
+
// });
|
|
3278
|
+
|
|
3199
3279
|
return _context4.abrupt("return", result);
|
|
3200
3280
|
|
|
3201
3281
|
case 9:
|