@freelog/tools-lib 0.1.155 → 0.1.157
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/activities.d.ts +9 -0
- package/dist/service-API/operation.d.ts +9 -0
- package/dist/service-API/presentables.d.ts +1 -0
- package/dist/tools-lib.cjs.development.js +89 -13
- 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 +89 -13
- package/dist/tools-lib.esm.js.map +1 -1
- package/package.json +1 -3
- package/src/service-API/activities.ts +286 -259
- package/src/service-API/operation.ts +42 -15
- package/src/service-API/presentables.ts +293 -292
- package/src/service-API/resources.ts +645 -645
- package/src/utils/tools.ts +102 -93
|
@@ -83,4 +83,13 @@ interface GetRewardRecordInfosParamsType {
|
|
|
83
83
|
status?: 1 | 2 | 3;
|
|
84
84
|
}
|
|
85
85
|
export declare function getRewardRecordInfos(params: GetRewardRecordInfosParamsType): Promise<any>;
|
|
86
|
+
interface ListRewardRecordInfosParamsType {
|
|
87
|
+
rewardGroupCodes?: string[];
|
|
88
|
+
statusArray?: number[];
|
|
89
|
+
}
|
|
90
|
+
export declare function listRewardRecordInfos(params?: ListRewardRecordInfosParamsType): Promise<any>;
|
|
91
|
+
interface StatisticRewardRecordsParamsType {
|
|
92
|
+
codes: string[];
|
|
93
|
+
}
|
|
94
|
+
export declare function statisticRewardRecords(params: StatisticRewardRecordsParamsType): Promise<any>;
|
|
86
95
|
export {};
|
|
@@ -3,4 +3,13 @@ interface OperationCategoriesParamsType {
|
|
|
3
3
|
status?: number;
|
|
4
4
|
}
|
|
5
5
|
export declare function operationCategories({ ...params }?: OperationCategoriesParamsType): Promise<any>;
|
|
6
|
+
interface RecordRankParamsType {
|
|
7
|
+
coinAccountType: 1 | 2;
|
|
8
|
+
limit: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function recordRank({ ...params }: RecordRankParamsType): Promise<any>;
|
|
11
|
+
interface RankInfoParamsType {
|
|
12
|
+
coinAccountType: 1 | 2;
|
|
13
|
+
}
|
|
14
|
+
export declare function rankInfo({ ...params }: RankInfoParamsType): Promise<any>;
|
|
6
15
|
export {};
|
|
@@ -20,6 +20,7 @@ export declare function createPresentable(params: CreatePresentableParamsType):
|
|
|
20
20
|
interface UpdatePresentableParamsType {
|
|
21
21
|
presentableId: string;
|
|
22
22
|
presentableTitle?: string;
|
|
23
|
+
presentableIntro?: string;
|
|
23
24
|
tags?: string[];
|
|
24
25
|
coverImages?: string[];
|
|
25
26
|
addPolicies?: {
|
|
@@ -7,7 +7,6 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
7
7
|
var moment = _interopDefault(require('moment'));
|
|
8
8
|
var querystring = require('querystring');
|
|
9
9
|
var axios = _interopDefault(require('axios'));
|
|
10
|
-
var CryptoJS = require('crypto-js');
|
|
11
10
|
var React = require('react');
|
|
12
11
|
var i18next = _interopDefault(require('i18next'));
|
|
13
12
|
var Cookies = _interopDefault(require('js-cookie'));
|
|
@@ -2631,6 +2630,24 @@ function getRewardRecordInfos(params) {
|
|
|
2631
2630
|
data: params
|
|
2632
2631
|
});
|
|
2633
2632
|
}
|
|
2633
|
+
function listRewardRecordInfos(params) {
|
|
2634
|
+
if (params === void 0) {
|
|
2635
|
+
params = {};
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2638
|
+
return FUtil.Request({
|
|
2639
|
+
method: 'POST',
|
|
2640
|
+
url: "/v2/activities/facade/listRewardRecordInfos",
|
|
2641
|
+
data: params
|
|
2642
|
+
});
|
|
2643
|
+
}
|
|
2644
|
+
function statisticRewardRecords(params) {
|
|
2645
|
+
return FUtil.Request({
|
|
2646
|
+
method: 'POST',
|
|
2647
|
+
url: "/v2/activities/facade/statisticRewardRecords",
|
|
2648
|
+
data: params
|
|
2649
|
+
});
|
|
2650
|
+
}
|
|
2634
2651
|
|
|
2635
2652
|
var Activity = {
|
|
2636
2653
|
__proto__: null,
|
|
@@ -2652,7 +2669,9 @@ var Activity = {
|
|
|
2652
2669
|
lotteryList: lotteryList,
|
|
2653
2670
|
lotteryShow: lotteryShow,
|
|
2654
2671
|
listInviteFriendInfos: listInviteFriendInfos,
|
|
2655
|
-
getRewardRecordInfos: getRewardRecordInfos
|
|
2672
|
+
getRewardRecordInfos: getRewardRecordInfos,
|
|
2673
|
+
listRewardRecordInfos: listRewardRecordInfos,
|
|
2674
|
+
statisticRewardRecords: statisticRewardRecords
|
|
2656
2675
|
};
|
|
2657
2676
|
|
|
2658
2677
|
var _excluded$9 = ["recordId"];
|
|
@@ -2835,23 +2854,60 @@ var Policy = {
|
|
|
2835
2854
|
policyTransferTranslation: policyTransferTranslation
|
|
2836
2855
|
};
|
|
2837
2856
|
|
|
2857
|
+
// import * as CryptoJS from 'crypto-js';
|
|
2858
|
+
|
|
2838
2859
|
/**
|
|
2839
2860
|
* 根据 File 获取 SHA1 Hash 字符串
|
|
2840
2861
|
* @param file
|
|
2841
2862
|
* @return {Promise<string>}
|
|
2842
2863
|
*/
|
|
2843
|
-
|
|
2844
2864
|
function getSHA1Hash(file) {
|
|
2845
2865
|
return new Promise(function (resolve) {
|
|
2846
2866
|
var reader = new FileReader();
|
|
2867
|
+
reader.readAsArrayBuffer(file);
|
|
2868
|
+
reader.onload = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2869
|
+
var sha1;
|
|
2870
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2871
|
+
while (1) {
|
|
2872
|
+
switch (_context.prev = _context.next) {
|
|
2873
|
+
case 0:
|
|
2874
|
+
if (reader.result) {
|
|
2875
|
+
_context.next = 3;
|
|
2876
|
+
break;
|
|
2877
|
+
}
|
|
2847
2878
|
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
var hash = CryptoJS.SHA1(wordArray).toString();
|
|
2851
|
-
resolve(hash);
|
|
2852
|
-
};
|
|
2879
|
+
resolve('');
|
|
2880
|
+
return _context.abrupt("return", '');
|
|
2853
2881
|
|
|
2854
|
-
|
|
2882
|
+
case 3:
|
|
2883
|
+
if (!(typeof reader.result === 'string')) {
|
|
2884
|
+
_context.next = 6;
|
|
2885
|
+
break;
|
|
2886
|
+
}
|
|
2887
|
+
|
|
2888
|
+
resolve('');
|
|
2889
|
+
return _context.abrupt("return", '');
|
|
2890
|
+
|
|
2891
|
+
case 6:
|
|
2892
|
+
_context.next = 8;
|
|
2893
|
+
return self.crypto.subtle.digest('SHA-1', reader.result).then(function (a) {
|
|
2894
|
+
return Array.from(new Uint8Array(a)).map(function (a) {
|
|
2895
|
+
return a.toString(16).padStart(2, '0');
|
|
2896
|
+
}).join('');
|
|
2897
|
+
});
|
|
2898
|
+
|
|
2899
|
+
case 8:
|
|
2900
|
+
sha1 = _context.sent;
|
|
2901
|
+
resolve(sha1);
|
|
2902
|
+
return _context.abrupt("return", '');
|
|
2903
|
+
|
|
2904
|
+
case 11:
|
|
2905
|
+
case "end":
|
|
2906
|
+
return _context.stop();
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
}, _callee);
|
|
2910
|
+
}));
|
|
2855
2911
|
});
|
|
2856
2912
|
}
|
|
2857
2913
|
/**
|
|
@@ -2887,9 +2943,9 @@ function getUserIDByCookies() {
|
|
|
2887
2943
|
|
|
2888
2944
|
return Number(uid.replace('uid=', ''));
|
|
2889
2945
|
}
|
|
2890
|
-
function transformServerAPIContractState(
|
|
2891
|
-
var status =
|
|
2892
|
-
authStatus =
|
|
2946
|
+
function transformServerAPIContractState(_ref2) {
|
|
2947
|
+
var status = _ref2.status,
|
|
2948
|
+
authStatus = _ref2.authStatus;
|
|
2893
2949
|
|
|
2894
2950
|
if (status === 0) {
|
|
2895
2951
|
if (authStatus === 1 || authStatus === 3) {
|
|
@@ -3092,10 +3148,30 @@ function operationCategories(_temp) {
|
|
|
3092
3148
|
params: params
|
|
3093
3149
|
});
|
|
3094
3150
|
}
|
|
3151
|
+
function recordRank(_ref2) {
|
|
3152
|
+
var params = _extends({}, _ref2);
|
|
3153
|
+
|
|
3154
|
+
return FUtil.Request({
|
|
3155
|
+
method: 'POST',
|
|
3156
|
+
url: "/v2/activities/coin/record/rank",
|
|
3157
|
+
data: params
|
|
3158
|
+
});
|
|
3159
|
+
}
|
|
3160
|
+
function rankInfo(_ref3) {
|
|
3161
|
+
var params = _extends({}, _ref3);
|
|
3162
|
+
|
|
3163
|
+
return FUtil.Request({
|
|
3164
|
+
method: 'POST',
|
|
3165
|
+
url: "/v2/activities/coin/record/rankInfo",
|
|
3166
|
+
data: params
|
|
3167
|
+
});
|
|
3168
|
+
}
|
|
3095
3169
|
|
|
3096
3170
|
var Operation = {
|
|
3097
3171
|
__proto__: null,
|
|
3098
|
-
operationCategories: operationCategories
|
|
3172
|
+
operationCategories: operationCategories,
|
|
3173
|
+
recordRank: recordRank,
|
|
3174
|
+
rankInfo: rankInfo
|
|
3099
3175
|
};
|
|
3100
3176
|
|
|
3101
3177
|
var FServiceAPI = {
|