@freelog/tools-lib 0.1.125 → 0.1.128
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/i18n/I18nNext.d.ts +5 -5
- package/dist/service-API/activities.d.ts +34 -0
- package/dist/service-API/resources.d.ts +1 -4
- package/dist/service-API/testQualifications.d.ts +4 -0
- package/dist/tools-lib.cjs.development.js +142 -24
- 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 +142 -24
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/linkTo.d.ts +9 -0
- package/package.json +2 -2
- package/src/i18n/I18nNext.ts +29 -23
- package/src/service-API/activities.ts +106 -0
- package/src/service-API/resources.ts +532 -532
- package/src/service-API/testQualifications.ts +14 -1
- package/src/utils/linkTo.ts +399 -375
- package/src/utils/tools.ts +85 -85
package/dist/i18n/I18nNext.d.ts
CHANGED
|
@@ -8,13 +8,13 @@ declare class I18nNext {
|
|
|
8
8
|
private _taskQueue;
|
|
9
9
|
private _currentLanguage;
|
|
10
10
|
constructor();
|
|
11
|
-
ready(): Promise<unknown>;
|
|
12
|
-
t(key: string, options?: {
|
|
11
|
+
ready(this: I18nNext): Promise<unknown>;
|
|
12
|
+
t(this: I18nNext, key: string, options?: {
|
|
13
13
|
[key: string]: any;
|
|
14
14
|
}): string;
|
|
15
|
-
changeLanguage(lng: LanguageKeyType): void;
|
|
16
|
-
getAllLanguage(): typeof allLanguage;
|
|
17
|
-
getCurrentLanguage(): LanguageKeyType;
|
|
15
|
+
changeLanguage(this: I18nNext, lng: LanguageKeyType): void;
|
|
16
|
+
getAllLanguage(this: I18nNext): typeof allLanguage;
|
|
17
|
+
getCurrentLanguage(this: I18nNext): LanguageKeyType;
|
|
18
18
|
private _handleData;
|
|
19
19
|
private _fetchData;
|
|
20
20
|
}
|
|
@@ -28,4 +28,38 @@ export declare function getResourceTaskInfo(params?: GetResourceTaskInfoParamsTy
|
|
|
28
28
|
interface GetNodeTaskInfoParamsType {
|
|
29
29
|
}
|
|
30
30
|
export declare function getNodeTaskInfo(params?: GetNodeTaskInfoParamsType): Promise<any>;
|
|
31
|
+
interface GetRewardRecordInfoParamsType {
|
|
32
|
+
rewardConfigCode: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function getRewardRecordInfo(params: GetRewardRecordInfoParamsType): Promise<any>;
|
|
35
|
+
interface PushMessageTaskParamsType {
|
|
36
|
+
taskConfigCode: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function pushMessageTask(params: PushMessageTaskParamsType): Promise<any>;
|
|
39
|
+
interface GetCoinAccountParamsType {
|
|
40
|
+
type: 1;
|
|
41
|
+
}
|
|
42
|
+
export declare function getCoinAccount(params: GetCoinAccountParamsType): Promise<any>;
|
|
43
|
+
interface WithdrawCoinAccountParamsType {
|
|
44
|
+
reUserName: string;
|
|
45
|
+
amount: number;
|
|
46
|
+
}
|
|
47
|
+
export declare function withdrawCoinAccount(params: WithdrawCoinAccountParamsType): Promise<any>;
|
|
48
|
+
interface GetCoinAccountRecordsParamsType {
|
|
49
|
+
skip?: number;
|
|
50
|
+
limit?: number;
|
|
51
|
+
coinAccountType: 1;
|
|
52
|
+
}
|
|
53
|
+
export declare function getCoinAccountRecords(params: GetCoinAccountRecordsParamsType): Promise<any>;
|
|
54
|
+
interface GetWechatOfficialAccountInfoParamsType {
|
|
55
|
+
}
|
|
56
|
+
export declare function getWechatOfficialAccountInfo(params?: GetWechatOfficialAccountInfoParamsType): Promise<any>;
|
|
57
|
+
interface LotteryListParamsType {
|
|
58
|
+
}
|
|
59
|
+
export declare function lotteryList(params?: LotteryListParamsType): Promise<any>;
|
|
60
|
+
interface LotteryShowParamsType {
|
|
61
|
+
startDate: string;
|
|
62
|
+
limitDate: string;
|
|
63
|
+
}
|
|
64
|
+
export declare function lotteryShow(params: LotteryShowParamsType): Promise<any>;
|
|
31
65
|
export {};
|
|
@@ -70,10 +70,7 @@ interface ListParamsType {
|
|
|
70
70
|
tags?: string;
|
|
71
71
|
sort?: string;
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
data: IResourceInfo[];
|
|
75
|
-
}
|
|
76
|
-
export declare function list(params: ListParamsType): Promise<ListReturnType>;
|
|
73
|
+
export declare function list(params: ListParamsType): Promise<any>;
|
|
77
74
|
interface InfoParamsType {
|
|
78
75
|
resourceIdOrName: string;
|
|
79
76
|
isLoadPolicyInfo?: 0 | 1;
|
|
@@ -29,4 +29,8 @@ interface GetBetaApply2ParamsType {
|
|
|
29
29
|
recordId: string;
|
|
30
30
|
}
|
|
31
31
|
export declare function getBetaApply2({ recordId, ...params }: GetBetaApply2ParamsType): Promise<any>;
|
|
32
|
+
interface InviteesParamsType {
|
|
33
|
+
userId: number;
|
|
34
|
+
}
|
|
35
|
+
export declare function invitees({ ...params }: InviteesParamsType): Promise<any>;
|
|
32
36
|
export {};
|
|
@@ -1248,20 +1248,41 @@ function wallet(_temp18) {
|
|
|
1248
1248
|
|
|
1249
1249
|
return "/logged/wallet";
|
|
1250
1250
|
}
|
|
1251
|
-
function
|
|
1251
|
+
function reward(_temp19) {
|
|
1252
1252
|
var _ref35 = _temp19 === void 0 ? {} : _temp19;
|
|
1253
1253
|
|
|
1254
1254
|
_objectDestructuringEmpty(_ref35);
|
|
1255
1255
|
|
|
1256
|
-
return "/logged/
|
|
1256
|
+
return "/logged/reward";
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1258
|
+
function contract(_temp20) {
|
|
1259
1259
|
var _ref36 = _temp20 === void 0 ? {} : _temp20;
|
|
1260
1260
|
|
|
1261
1261
|
_objectDestructuringEmpty(_ref36);
|
|
1262
1262
|
|
|
1263
|
+
return "/logged/contract";
|
|
1264
|
+
}
|
|
1265
|
+
function setting(_temp21) {
|
|
1266
|
+
var _ref37 = _temp21 === void 0 ? {} : _temp21;
|
|
1267
|
+
|
|
1268
|
+
_objectDestructuringEmpty(_ref37);
|
|
1269
|
+
|
|
1263
1270
|
return "/logged/setting";
|
|
1264
1271
|
}
|
|
1272
|
+
function binding(_temp22) {
|
|
1273
|
+
var _ref38 = _temp22 === void 0 ? {} : _temp22;
|
|
1274
|
+
|
|
1275
|
+
_objectDestructuringEmpty(_ref38);
|
|
1276
|
+
|
|
1277
|
+
return "/logged/binding";
|
|
1278
|
+
}
|
|
1279
|
+
function resultBindingSuccess(_temp23) {
|
|
1280
|
+
var _ref39 = _temp23 === void 0 ? {} : _temp23;
|
|
1281
|
+
|
|
1282
|
+
_objectDestructuringEmpty(_ref39);
|
|
1283
|
+
|
|
1284
|
+
return "/result/binding";
|
|
1285
|
+
}
|
|
1265
1286
|
/************** user End ******************************************************/
|
|
1266
1287
|
|
|
1267
1288
|
function handleQuery(query) {
|
|
@@ -1317,8 +1338,11 @@ var LinkTo = {
|
|
|
1317
1338
|
retrievePayPassword: retrievePayPassword,
|
|
1318
1339
|
userFreeze: userFreeze,
|
|
1319
1340
|
wallet: wallet,
|
|
1341
|
+
reward: reward,
|
|
1320
1342
|
contract: contract,
|
|
1321
|
-
setting: setting
|
|
1343
|
+
setting: setting,
|
|
1344
|
+
binding: binding,
|
|
1345
|
+
resultBindingSuccess: resultBindingSuccess
|
|
1322
1346
|
};
|
|
1323
1347
|
|
|
1324
1348
|
// export const apiHost = `${window.location.protocol}//qi.${(window.location.host.match(/(?<=\.).*/) || [''])[0]}`;
|
|
@@ -1921,7 +1945,10 @@ function update(params) {
|
|
|
1921
1945
|
url: "/v2/resources/" + params.resourceId,
|
|
1922
1946
|
data: params
|
|
1923
1947
|
});
|
|
1924
|
-
}
|
|
1948
|
+
} // interface ListReturnType extends CommonReturn {
|
|
1949
|
+
// data: IResourceInfo[];
|
|
1950
|
+
// }
|
|
1951
|
+
|
|
1925
1952
|
function list(params) {
|
|
1926
1953
|
return FUtil.Request({
|
|
1927
1954
|
method: 'GET',
|
|
@@ -2771,6 +2798,70 @@ function getNodeTaskInfo(params) {
|
|
|
2771
2798
|
params: params
|
|
2772
2799
|
});
|
|
2773
2800
|
}
|
|
2801
|
+
function getRewardRecordInfo(params) {
|
|
2802
|
+
return FUtil.Request({
|
|
2803
|
+
method: 'GET',
|
|
2804
|
+
url: "/v2/activities/facade/getRewardRecordInfo",
|
|
2805
|
+
params: params
|
|
2806
|
+
});
|
|
2807
|
+
}
|
|
2808
|
+
function pushMessageTask(params) {
|
|
2809
|
+
return FUtil.Request({
|
|
2810
|
+
method: 'POST',
|
|
2811
|
+
url: "/v2/activities/facade/pushMessage4Task",
|
|
2812
|
+
data: params
|
|
2813
|
+
});
|
|
2814
|
+
}
|
|
2815
|
+
function getCoinAccount(params) {
|
|
2816
|
+
return FUtil.Request({
|
|
2817
|
+
method: 'GET',
|
|
2818
|
+
url: "/v2/activities/coin/account/find4Client",
|
|
2819
|
+
params: params
|
|
2820
|
+
});
|
|
2821
|
+
}
|
|
2822
|
+
function withdrawCoinAccount(params) {
|
|
2823
|
+
return FUtil.Request({
|
|
2824
|
+
method: 'POST',
|
|
2825
|
+
url: "/v2/activities/coin/account/cash4Client",
|
|
2826
|
+
data: params
|
|
2827
|
+
});
|
|
2828
|
+
}
|
|
2829
|
+
function getCoinAccountRecords(params) {
|
|
2830
|
+
return FUtil.Request({
|
|
2831
|
+
method: 'GET',
|
|
2832
|
+
url: "/v2/activities/coin/record/list4Client",
|
|
2833
|
+
params: params
|
|
2834
|
+
});
|
|
2835
|
+
}
|
|
2836
|
+
function getWechatOfficialAccountInfo(params) {
|
|
2837
|
+
if (params === void 0) {
|
|
2838
|
+
params = {};
|
|
2839
|
+
}
|
|
2840
|
+
|
|
2841
|
+
return FUtil.Request({
|
|
2842
|
+
method: 'GET',
|
|
2843
|
+
url: "/v2/extensions/wechat/getRelationship4Client",
|
|
2844
|
+
params: params
|
|
2845
|
+
});
|
|
2846
|
+
}
|
|
2847
|
+
function lotteryList(params) {
|
|
2848
|
+
if (params === void 0) {
|
|
2849
|
+
params = {};
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2852
|
+
return FUtil.Request({
|
|
2853
|
+
method: 'GET',
|
|
2854
|
+
url: "/v2/activities/lottery/resource/list",
|
|
2855
|
+
params: params
|
|
2856
|
+
});
|
|
2857
|
+
}
|
|
2858
|
+
function lotteryShow(params) {
|
|
2859
|
+
return FUtil.Request({
|
|
2860
|
+
method: 'GET',
|
|
2861
|
+
url: "/v2/activities/lottery/resource/show",
|
|
2862
|
+
params: params
|
|
2863
|
+
});
|
|
2864
|
+
}
|
|
2774
2865
|
|
|
2775
2866
|
var Activity = {
|
|
2776
2867
|
__proto__: null,
|
|
@@ -2780,7 +2871,15 @@ var Activity = {
|
|
|
2780
2871
|
adsDetails: adsDetails,
|
|
2781
2872
|
getBaseTaskInfo: getBaseTaskInfo,
|
|
2782
2873
|
getResourceTaskInfo: getResourceTaskInfo,
|
|
2783
|
-
getNodeTaskInfo: getNodeTaskInfo
|
|
2874
|
+
getNodeTaskInfo: getNodeTaskInfo,
|
|
2875
|
+
getRewardRecordInfo: getRewardRecordInfo,
|
|
2876
|
+
pushMessageTask: pushMessageTask,
|
|
2877
|
+
getCoinAccount: getCoinAccount,
|
|
2878
|
+
withdrawCoinAccount: withdrawCoinAccount,
|
|
2879
|
+
getCoinAccountRecords: getCoinAccountRecords,
|
|
2880
|
+
getWechatOfficialAccountInfo: getWechatOfficialAccountInfo,
|
|
2881
|
+
lotteryList: lotteryList,
|
|
2882
|
+
lotteryShow: lotteryShow
|
|
2784
2883
|
};
|
|
2785
2884
|
|
|
2786
2885
|
var _excluded$9 = ["recordId"];
|
|
@@ -2843,7 +2942,16 @@ function getBetaApply2(_ref7) {
|
|
|
2843
2942
|
return FUtil.Request({
|
|
2844
2943
|
method: 'GET',
|
|
2845
2944
|
url: "/v2/testQualifications/beta/apply/" + recordId,
|
|
2846
|
-
|
|
2945
|
+
params: params
|
|
2946
|
+
});
|
|
2947
|
+
}
|
|
2948
|
+
function invitees(_ref8) {
|
|
2949
|
+
var params = _extends({}, _ref8);
|
|
2950
|
+
|
|
2951
|
+
return FUtil.Request({
|
|
2952
|
+
method: 'GET',
|
|
2953
|
+
url: "/v2/testQualifications/beta/codes/invitees",
|
|
2954
|
+
params: params
|
|
2847
2955
|
});
|
|
2848
2956
|
}
|
|
2849
2957
|
|
|
@@ -2855,7 +2963,8 @@ var TestQualification = {
|
|
|
2855
2963
|
usedRecords: usedRecords,
|
|
2856
2964
|
betaApply: betaApply,
|
|
2857
2965
|
getBetaApply1: getBetaApply1,
|
|
2858
|
-
getBetaApply2: getBetaApply2
|
|
2966
|
+
getBetaApply2: getBetaApply2,
|
|
2967
|
+
invitees: invitees
|
|
2859
2968
|
};
|
|
2860
2969
|
|
|
2861
2970
|
function transactionsCommon(params) {
|
|
@@ -3292,6 +3401,7 @@ var FUtil = {
|
|
|
3292
3401
|
};
|
|
3293
3402
|
|
|
3294
3403
|
var ossJsonUrl = 'https://freelog-i18n.oss-cn-shenzhen.aliyuncs.com/configs/i18n.json';
|
|
3404
|
+
var ossJsonUrl_Test = 'https://freelog-i18n.oss-cn-shenzhen.aliyuncs.com/configs-test/i18n.json';
|
|
3295
3405
|
var localStorage_i18nextLng_key = 'locale';
|
|
3296
3406
|
var localStorage_i18nextResources_key = 'i18nextResources';
|
|
3297
3407
|
var allLanguage = [{
|
|
@@ -3301,7 +3411,6 @@ var allLanguage = [{
|
|
|
3301
3411
|
value: 'zh_CN',
|
|
3302
3412
|
label: '简体中文'
|
|
3303
3413
|
}];
|
|
3304
|
-
var self;
|
|
3305
3414
|
|
|
3306
3415
|
var I18nNext = /*#__PURE__*/function () {
|
|
3307
3416
|
function I18nNext() {
|
|
@@ -3309,22 +3418,28 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3309
3418
|
this._taskQueue = []; // private _currentLanguage: LanguageKeyType = window.localStorage.getItem(localStorage_i18nextLng_key) as null || 'zh_CN';
|
|
3310
3419
|
|
|
3311
3420
|
this._currentLanguage = Cookies.get(localStorage_i18nextLng_key) || 'zh_CN';
|
|
3312
|
-
|
|
3313
|
-
|
|
3421
|
+
this.ready();
|
|
3422
|
+
this.ready = this.ready.bind(this);
|
|
3423
|
+
this.t = this.t.bind(this);
|
|
3424
|
+
this.changeLanguage = this.changeLanguage.bind(this);
|
|
3425
|
+
this.getAllLanguage = this.getAllLanguage.bind(this);
|
|
3426
|
+
this.getCurrentLanguage = this.getCurrentLanguage.bind(this);
|
|
3314
3427
|
}
|
|
3315
3428
|
|
|
3316
3429
|
var _proto = I18nNext.prototype;
|
|
3317
3430
|
|
|
3318
3431
|
_proto.ready = /*#__PURE__*/function () {
|
|
3319
3432
|
var _ready = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
3433
|
+
var _this = this;
|
|
3434
|
+
|
|
3320
3435
|
var exc, handleTasks, promise;
|
|
3321
3436
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
3322
3437
|
while (1) {
|
|
3323
3438
|
switch (_context2.prev = _context2.next) {
|
|
3324
3439
|
case 0:
|
|
3325
3440
|
exc = function exc() {
|
|
3326
|
-
while (
|
|
3327
|
-
var task =
|
|
3441
|
+
while (_this._taskQueue.length > 0) {
|
|
3442
|
+
var task = _this._taskQueue.shift();
|
|
3328
3443
|
|
|
3329
3444
|
task && task();
|
|
3330
3445
|
}
|
|
@@ -3336,7 +3451,7 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3336
3451
|
while (1) {
|
|
3337
3452
|
switch (_context.prev = _context.next) {
|
|
3338
3453
|
case 0:
|
|
3339
|
-
if (!(
|
|
3454
|
+
if (!(_this._loadingData === 'End')) {
|
|
3340
3455
|
_context.next = 3;
|
|
3341
3456
|
break;
|
|
3342
3457
|
}
|
|
@@ -3345,7 +3460,7 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3345
3460
|
return _context.abrupt("return");
|
|
3346
3461
|
|
|
3347
3462
|
case 3:
|
|
3348
|
-
if (!(
|
|
3463
|
+
if (!(_this._loadingData === 'Start')) {
|
|
3349
3464
|
_context.next = 5;
|
|
3350
3465
|
break;
|
|
3351
3466
|
}
|
|
@@ -3354,9 +3469,9 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3354
3469
|
|
|
3355
3470
|
case 5:
|
|
3356
3471
|
// NO_START
|
|
3357
|
-
|
|
3472
|
+
_this._loadingData = 'Start';
|
|
3358
3473
|
_context.next = 8;
|
|
3359
|
-
return
|
|
3474
|
+
return _this._handleData();
|
|
3360
3475
|
|
|
3361
3476
|
case 8:
|
|
3362
3477
|
// console.log('######');
|
|
@@ -3376,7 +3491,7 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3376
3491
|
}();
|
|
3377
3492
|
|
|
3378
3493
|
promise = new Promise(function (resolve) {
|
|
3379
|
-
|
|
3494
|
+
_this._taskQueue.push(resolve);
|
|
3380
3495
|
});
|
|
3381
3496
|
handleTasks();
|
|
3382
3497
|
return _context2.abrupt("return", promise);
|
|
@@ -3414,7 +3529,7 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3414
3529
|
};
|
|
3415
3530
|
|
|
3416
3531
|
_proto.getCurrentLanguage = function getCurrentLanguage() {
|
|
3417
|
-
return
|
|
3532
|
+
return this._currentLanguage;
|
|
3418
3533
|
};
|
|
3419
3534
|
|
|
3420
3535
|
_proto._handleData = /*#__PURE__*/function () {
|
|
@@ -3424,7 +3539,7 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3424
3539
|
while (1) {
|
|
3425
3540
|
switch (_context3.prev = _context3.next) {
|
|
3426
3541
|
case 0:
|
|
3427
|
-
lng =
|
|
3542
|
+
lng = this._currentLanguage;
|
|
3428
3543
|
resource = window.localStorage.getItem(localStorage_i18nextResources_key); // const resource: string | undefined = Cookies.get(decodeURIComponent(localStorage_i18nextResources_key));
|
|
3429
3544
|
|
|
3430
3545
|
i18nextResources = resource ? JSON.parse(resource) : null;
|
|
@@ -3435,7 +3550,7 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3435
3550
|
}
|
|
3436
3551
|
|
|
3437
3552
|
_context3.next = 6;
|
|
3438
|
-
return
|
|
3553
|
+
return this._fetchData();
|
|
3439
3554
|
|
|
3440
3555
|
case 6:
|
|
3441
3556
|
i18nextResources = _context3.sent;
|
|
@@ -3443,7 +3558,7 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3443
3558
|
break;
|
|
3444
3559
|
|
|
3445
3560
|
case 9:
|
|
3446
|
-
|
|
3561
|
+
this._fetchData();
|
|
3447
3562
|
|
|
3448
3563
|
case 10:
|
|
3449
3564
|
_context3.next = 12;
|
|
@@ -3462,11 +3577,14 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3462
3577
|
});
|
|
3463
3578
|
|
|
3464
3579
|
case 12:
|
|
3580
|
+
this._loadingData = 'End';
|
|
3581
|
+
|
|
3582
|
+
case 13:
|
|
3465
3583
|
case "end":
|
|
3466
3584
|
return _context3.stop();
|
|
3467
3585
|
}
|
|
3468
3586
|
}
|
|
3469
|
-
}, _callee3);
|
|
3587
|
+
}, _callee3, this);
|
|
3470
3588
|
}));
|
|
3471
3589
|
|
|
3472
3590
|
function _handleData() {
|
|
@@ -3485,7 +3603,7 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3485
3603
|
switch (_context4.prev = _context4.next) {
|
|
3486
3604
|
case 0:
|
|
3487
3605
|
_context4.next = 2;
|
|
3488
|
-
return axios.get(ossJsonUrl, {
|
|
3606
|
+
return axios.get(window.location.origin.includes('.freelog.com') ? ossJsonUrl : ossJsonUrl_Test, {
|
|
3489
3607
|
withCredentials: false
|
|
3490
3608
|
});
|
|
3491
3609
|
|