@freelog/tools-lib 0.1.98 → 0.1.101

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freelog/tools-lib",
3
- "version": "0.1.98",
3
+ "version": "0.1.101",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -1,31 +1,33 @@
1
- import * as Node from './nodes';
2
- import * as Exhibit from './presentables';
3
- import * as Storage from './storages';
4
- import * as Collection from './collections';
5
- import * as Resource from './resources';
6
- import * as User from './user';
7
- import * as InformalNode from './informalNodes';
8
- import * as Contract from './contracts';
9
- import * as Transaction from './transactions';
10
- import * as Captcha from './captcha';
11
- import * as Event from './events';
12
- import * as Activity from './activities';
13
- import * as TestQualification from './testQualifications';
14
-
15
- const FServiceAPI = {
16
- Node,
17
- Exhibit,
18
- Storage,
19
- Collection,
20
- Resource,
21
- User,
22
- InformalNode,
23
- Contract,
24
- Transaction,
25
- Captcha,
26
- Event,
27
- Activity,
28
- TestQualification,
29
- };
30
-
31
- export default FServiceAPI;
1
+ import * as Node from './nodes';
2
+ import * as Exhibit from './presentables';
3
+ import * as Storage from './storages';
4
+ import * as Collection from './collections';
5
+ import * as Resource from './resources';
6
+ import * as User from './user';
7
+ import * as InformalNode from './informalNodes';
8
+ import * as Contract from './contracts';
9
+ import * as Transaction from './transactions';
10
+ import * as Captcha from './captcha';
11
+ import * as Event from './events';
12
+ import * as Activity from './activities';
13
+ import * as TestQualification from './testQualifications';
14
+ import * as Statistic from './statistics';
15
+
16
+ const FServiceAPI = {
17
+ Node,
18
+ Exhibit,
19
+ Storage,
20
+ Collection,
21
+ Resource,
22
+ User,
23
+ InformalNode,
24
+ Contract,
25
+ Transaction,
26
+ Captcha,
27
+ Event,
28
+ Activity,
29
+ TestQualification,
30
+ Statistic,
31
+ };
32
+
33
+ export default FServiceAPI;
@@ -0,0 +1,20 @@
1
+ import FUtil from '../utils';
2
+ // import {AxiosRequestConfig, Canceler} from 'axios';
3
+
4
+ // 查询通用交易统计信息
5
+ export interface TransactionsCommonParamsType {
6
+ ownerId: string | number;
7
+ ownerType?: 1 | 2;
8
+ objectId?: string;
9
+ objectType?: 2 | 3;
10
+ beginDate?: string;
11
+ endDate?: string;
12
+ }
13
+
14
+ export function transactionsCommon(params: TransactionsCommonParamsType) {
15
+ return FUtil.Request({
16
+ method: 'GET',
17
+ url: `/v2/statistics/transactions/common`,
18
+ params: params,
19
+ });
20
+ }
@@ -1,56 +1,56 @@
1
- import FUtil from '../utils';
2
-
3
- // 使用邀请码激活内测资格
4
- interface BetaCodesActivateParamsType {
5
- code: string;
6
- }
7
-
8
- export function betaCodesActivate({...params}: BetaCodesActivateParamsType) {
9
- return FUtil.Request({
10
- method: 'POST',
11
- url: `/v2/testQualifications/beta/codes/activate`,
12
- data: params,
13
- });
14
- }
15
-
16
- // 用户申请内测资格
17
- interface BetaApplyParamsType {
18
- // province: string;
19
- // city: string;
20
- areaCode: string;
21
- occupation: string;
22
- description: string;
23
- }
24
-
25
- export function betaApply({...params}: BetaApplyParamsType) {
26
- return FUtil.Request({
27
- method: 'POST',
28
- url: `/v2/testQualifications/beta/apply`,
29
- data: params,
30
- });
31
- }
32
-
33
- // 查看内测资格申请详情
34
- interface GetBetaApply1ParamsType {
35
-
36
- }
37
-
38
- export function getBetaApply1({...params}: GetBetaApply1ParamsType = {}) {
39
- return FUtil.Request({
40
- method: 'GET',
41
- url: `/v2/testQualifications/beta/apply/current`,
42
- params: params,
43
- });
44
- }
45
-
46
- interface GetBetaApply2ParamsType {
47
- recordId: string;
48
- }
49
-
50
- export function getBetaApply2({recordId, ...params}: GetBetaApply2ParamsType) {
51
- return FUtil.Request({
52
- method: 'GET',
53
- url: `/v2/testQualifications/beta/apply/${recordId}`,
54
- data: params,
55
- });
56
- }
1
+ import FUtil from '../utils';
2
+
3
+ // 使用邀请码激活内测资格
4
+ interface BetaCodesActivateParamsType {
5
+ code: string;
6
+ }
7
+
8
+ export function betaCodesActivate({...params}: BetaCodesActivateParamsType) {
9
+ return FUtil.Request({
10
+ method: 'POST',
11
+ url: `/v2/testQualifications/beta/codes/activate`,
12
+ data: params,
13
+ });
14
+ }
15
+
16
+ // 用户申请内测资格
17
+ interface BetaApplyParamsType {
18
+ // province: string;
19
+ // city: string;
20
+ areaCode: string;
21
+ occupation: string;
22
+ description: string;
23
+ }
24
+
25
+ export function betaApply({...params}: BetaApplyParamsType) {
26
+ return FUtil.Request({
27
+ method: 'POST',
28
+ url: `/v2/testQualifications/beta/apply`,
29
+ data: params,
30
+ });
31
+ }
32
+
33
+ // 查看内测资格申请详情
34
+ interface GetBetaApply1ParamsType {
35
+
36
+ }
37
+
38
+ export function getBetaApply1({...params}: GetBetaApply1ParamsType = {}) {
39
+ return FUtil.Request({
40
+ method: 'GET',
41
+ url: `/v2/testQualifications/beta/apply/current`,
42
+ params: params,
43
+ });
44
+ }
45
+
46
+ interface GetBetaApply2ParamsType {
47
+ recordId: string;
48
+ }
49
+
50
+ export function getBetaApply2({recordId, ...params}: GetBetaApply2ParamsType) {
51
+ return FUtil.Request({
52
+ method: 'GET',
53
+ url: `/v2/testQualifications/beta/apply/${recordId}`,
54
+ data: params,
55
+ });
56
+ }
@@ -1,188 +1,190 @@
1
- import FUtil from '../utils';
2
-
3
- // 用户登录
4
- interface LoginParamsType {
5
- loginName: string;
6
- password: string;
7
- isRemember?: 0 | 1;
8
- returnUrl?: string;
9
- jwtType?: string;
10
- }
11
-
12
- export function login({...params}: LoginParamsType) {
13
- // return FUtil.Axios.post(`/v2/passport/login`, params);
14
- return FUtil.Request({
15
- method: 'POST',
16
- url: '/v2/passport/login',
17
- data: params,
18
- }, {noRedirect: true});
19
- }
20
-
21
- // 用户登出
22
- interface LogoutParamsType {
23
- returnUrl?: string;
24
- }
25
-
26
- export function logout({...params}: LogoutParamsType = {}) {
27
- // return FUtil.Axios.get(`/passport/logout`, {
28
- // params,
29
- // });
30
- return FUtil.Request({
31
- method: 'GET',
32
- url: '/v2/passport/logout',
33
- params: params,
34
- }, {noRedirect: true});
35
- }
36
-
37
- // 获取当前登录用户信息
38
- // interface CurrentUserInfoParamsType {
39
-
40
- // }
41
-
42
- export function currentUserInfo() {
43
- // return FUtil.Axios.get(`/v1/userinfos/current`);
44
- return FUtil.Request({
45
- method: 'GET',
46
- url: '/v2/users/current',
47
- // params: params,
48
- });
49
- }
50
-
51
- // 查看用户详情
52
- interface UserDetailsParamsType {
53
- mobile?: string;
54
- username?: string;
55
- email?: string;
56
- userId?: number;
57
- }
58
-
59
- export function userDetails(params: UserDetailsParamsType) {
60
- return FUtil.Request({
61
- method: 'GET',
62
- url: `/v2/users/detail`,
63
- params: params,
64
- });
65
- }
66
-
67
- // 注册用户
68
- interface LogonParamsType {
69
- loginName: string;
70
- password: string;
71
- username: string;
72
- authCode: string;
73
- }
74
-
75
- export function logon(params: LogonParamsType) {
76
- return FUtil.Request({
77
- method: 'POST',
78
- url: '/v2/users',
79
- data: params,
80
- });
81
- }
82
-
83
- // 重置密码
84
- interface ResetPasswordParamsType {
85
- loginName: string;
86
- password: string;
87
- authCode: string;
88
- }
89
-
90
- export function resetPassword({loginName, ...params}: ResetPasswordParamsType) {
91
- return FUtil.Request({
92
- method: 'PUT',
93
- url: `/v2/users/${loginName}/resetPassword`,
94
- data: params,
95
- });
96
- }
97
-
98
- // 修改密码
99
- interface UpdatePasswordParamsType {
100
- oldPassword: string;
101
- newPassword: string;
102
- }
103
-
104
- export function updatePassword(params: UpdatePasswordParamsType) {
105
- return FUtil.Request({
106
- method: 'PUT',
107
- url: `/v2/users/current/updatePassword`,
108
- data: params,
109
- });
110
- }
111
-
112
- // 上传头像
113
- interface UploadHeadImgParamsType {
114
- file: File;
115
- }
116
-
117
- export function uploadHeadImg(params: UploadHeadImgParamsType) {
118
-
119
- const formData = new FormData();
120
- for (const [key, value] of Object.entries(params)) {
121
- if (value) {
122
- formData.append(key, value);
123
- }
124
- }
125
-
126
- return FUtil.Request({
127
- method: 'POST',
128
- url: `/v2/users/current/uploadHeadImg`,
129
- data: params,
130
- });
131
- }
132
-
133
- // 修改用户详细信息
134
- interface UpdateDetailInfoParamsType {
135
- areaCode?: string;
136
- occupation?: string;
137
- birthday?: string;
138
- sex?: 0 | 1 | 2; // 性别 0:未知 1:男 2:女
139
- intro?: string;
140
- }
141
-
142
- export function updateDetailInfo(params: UpdateDetailInfoParamsType) {
143
- return FUtil.Request({
144
- method: 'PUT',
145
- url: `/v2/users/current/detailInfo`,
146
- data: params,
147
- });
148
- }
149
-
150
- // 校验当前登录用户的密码
151
- interface VerifyLoginPasswordParamsType {
152
- password: string;
153
- }
154
-
155
- export function verifyLoginPassword(params: VerifyLoginPasswordParamsType) {
156
- return FUtil.Request({
157
- method: 'GET',
158
- url: `/v2/users/verifyLoginPassword`,
159
- params: params,
160
- });
161
- }
162
-
163
- // 获取省份列表
164
- interface AreasProvincesParamsType {
165
- }
166
-
167
- export function areasProvinces(params: AreasProvincesParamsType = {}) {
168
- return FUtil.Request({
169
- method: 'GET',
170
- url: `/v2/areas/provinces`,
171
- params: params,
172
- });
173
- }
174
-
175
- // 绑定或换绑手机号和邮箱
176
- interface UpdateMobileOrEmailParamsType {
177
- oldAuthCode?: string;
178
- newAuthCode: string;
179
- newLoginName: string;
180
- }
181
-
182
- export function updateMobileOrEmail(params: UpdateMobileOrEmailParamsType) {
183
- return FUtil.Request({
184
- method: 'PUT',
185
- url: `/v2/users/current/mobileOrEmail`,
186
- data: params,
187
- });
188
- }
1
+ import FUtil from '../utils';
2
+ import {AxiosRequestConfig} from "axios";
3
+
4
+ // 用户登录
5
+ interface LoginParamsType {
6
+ loginName: string;
7
+ password: string;
8
+ isRemember?: 0 | 1;
9
+ returnUrl?: string;
10
+ jwtType?: string;
11
+ }
12
+
13
+ export function login({...params}: LoginParamsType) {
14
+ // return FUtil.Axios.post(`/v2/passport/login`, params);
15
+ return FUtil.Request({
16
+ method: 'POST',
17
+ url: '/v2/passport/login',
18
+ data: params,
19
+ }, {noRedirect: true});
20
+ }
21
+
22
+ // 用户登出
23
+ interface LogoutParamsType {
24
+ returnUrl?: string;
25
+ }
26
+
27
+ export function logout({...params}: LogoutParamsType = {}) {
28
+ // return FUtil.Axios.get(`/passport/logout`, {
29
+ // params,
30
+ // });
31
+ return FUtil.Request({
32
+ method: 'GET',
33
+ url: '/v2/passport/logout',
34
+ params: params,
35
+ }, {noRedirect: true});
36
+ }
37
+
38
+ // 获取当前登录用户信息
39
+ // interface CurrentUserInfoParamsType {
40
+
41
+ // }
42
+
43
+ export function currentUserInfo() {
44
+ // return FUtil.Axios.get(`/v1/userinfos/current`);
45
+ return FUtil.Request({
46
+ method: 'GET',
47
+ url: '/v2/users/current',
48
+ // params: params,
49
+ });
50
+ }
51
+
52
+ // 查看用户详情
53
+ interface UserDetailsParamsType {
54
+ mobile?: string;
55
+ username?: string;
56
+ email?: string;
57
+ userId?: number;
58
+ }
59
+
60
+ export function userDetails(params: UserDetailsParamsType) {
61
+ return FUtil.Request({
62
+ method: 'GET',
63
+ url: `/v2/users/detail`,
64
+ params: params,
65
+ });
66
+ }
67
+
68
+ // 注册用户
69
+ interface LogonParamsType {
70
+ loginName: string;
71
+ password: string;
72
+ username: string;
73
+ authCode: string;
74
+ }
75
+
76
+ export function logon(params: LogonParamsType) {
77
+ return FUtil.Request({
78
+ method: 'POST',
79
+ url: '/v2/users',
80
+ data: params,
81
+ });
82
+ }
83
+
84
+ // 重置密码
85
+ interface ResetPasswordParamsType {
86
+ loginName: string;
87
+ password: string;
88
+ authCode: string;
89
+ }
90
+
91
+ export function resetPassword({loginName, ...params}: ResetPasswordParamsType) {
92
+ return FUtil.Request({
93
+ method: 'PUT',
94
+ url: `/v2/users/${loginName}/resetPassword`,
95
+ data: params,
96
+ });
97
+ }
98
+
99
+ // 修改密码
100
+ interface UpdatePasswordParamsType {
101
+ oldPassword: string;
102
+ newPassword: string;
103
+ }
104
+
105
+ export function updatePassword(params: UpdatePasswordParamsType) {
106
+ return FUtil.Request({
107
+ method: 'PUT',
108
+ url: `/v2/users/current/updatePassword`,
109
+ data: params,
110
+ });
111
+ }
112
+
113
+ // 上传头像
114
+ interface UploadHeadImgParamsType {
115
+ file: File;
116
+ }
117
+
118
+ export function uploadHeadImg(params: UploadHeadImgParamsType, config?: AxiosRequestConfig) {
119
+
120
+ const formData = new FormData();
121
+ for (const [key, value] of Object.entries(params)) {
122
+ if (value) {
123
+ formData.append(key, value);
124
+ }
125
+ }
126
+
127
+ return FUtil.Request({
128
+ method: 'POST',
129
+ url: `/v2/users/current/uploadHeadImg`,
130
+ data: formData,
131
+ ...config,
132
+ });
133
+ }
134
+
135
+ // 修改用户详细信息
136
+ interface UpdateDetailInfoParamsType {
137
+ areaCode?: string;
138
+ occupation?: string;
139
+ birthday?: string;
140
+ sex?: 0 | 1 | 2; // 性别 0:未知 1:男 2:女
141
+ intro?: string;
142
+ }
143
+
144
+ export function updateDetailInfo(params: UpdateDetailInfoParamsType) {
145
+ return FUtil.Request({
146
+ method: 'PUT',
147
+ url: `/v2/users/current/detailInfo`,
148
+ data: params,
149
+ });
150
+ }
151
+
152
+ // 校验当前登录用户的密码
153
+ interface VerifyLoginPasswordParamsType {
154
+ password: string;
155
+ }
156
+
157
+ export function verifyLoginPassword(params: VerifyLoginPasswordParamsType) {
158
+ return FUtil.Request({
159
+ method: 'GET',
160
+ url: `/v2/users/verifyLoginPassword`,
161
+ params: params,
162
+ });
163
+ }
164
+
165
+ // 获取省份列表
166
+ interface AreasProvincesParamsType {
167
+ }
168
+
169
+ export function areasProvinces(params: AreasProvincesParamsType = {}) {
170
+ return FUtil.Request({
171
+ method: 'GET',
172
+ url: `/v2/areas/provinces`,
173
+ params: params,
174
+ });
175
+ }
176
+
177
+ // 绑定或换绑手机号和邮箱
178
+ interface UpdateMobileOrEmailParamsType {
179
+ oldAuthCode?: string;
180
+ newAuthCode: string;
181
+ newLoginName: string;
182
+ }
183
+
184
+ export function updateMobileOrEmail(params: UpdateMobileOrEmailParamsType) {
185
+ return FUtil.Request({
186
+ method: 'PUT',
187
+ url: `/v2/users/current/mobileOrEmail`,
188
+ data: params,
189
+ });
190
+ }