@freelog/tools-lib 0.1.77 → 0.1.81
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 +8 -0
- package/dist/service-API/presentables.d.ts +1 -0
- package/dist/service-API/resources.d.ts +57 -4
- package/dist/service-API/tools/index.d.ts +5 -0
- package/dist/tools-lib.cjs.development.js +38 -5
- 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 +38 -5
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/regexp.d.ts +2 -0
- package/dist/utils/tools.d.ts +9 -0
- package/package.json +1 -1
- package/src/service-API/activities.ts +26 -0
- package/src/service-API/captcha.ts +30 -30
- package/src/service-API/contracts.ts +84 -84
- package/src/service-API/informalNodes.ts +237 -237
- package/src/service-API/nodes.ts +65 -65
- package/src/service-API/presentables.ts +282 -281
- package/src/service-API/resources.ts +496 -438
- package/src/service-API/storages.ts +345 -345
- package/src/service-API/tools/index.ts +5 -0
- package/src/service-API/transactions.ts +109 -109
- package/src/service-API/user.ts +188 -188
- package/src/utils/linkTo.ts +276 -275
- package/src/utils/predefined.ts +37 -37
- package/src/utils/regexp.ts +52 -46
- package/src/utils/tools.ts +31 -0
- package/dist/types/InformalNodeTypes.d.ts +0 -23
- package/dist/types/contractTypes.d.ts +0 -1
- package/src/types/InformalNodeTypes.ts +0 -28
- package/src/types/contractTypes.ts +0 -1
package/dist/utils/regexp.d.ts
CHANGED
|
@@ -10,5 +10,7 @@ export declare const EMAIL_ADDRESS: RegExp;
|
|
|
10
10
|
export declare const USERNAME: RegExp;
|
|
11
11
|
export declare const PASSWORD: RegExp;
|
|
12
12
|
export declare const NATURAL_NUMBER: RegExp;
|
|
13
|
+
export declare const POSITIVE_INTEGER: RegExp;
|
|
14
|
+
export declare const MAX_2_DECIMAL_POSITIVE_NUMBER: RegExp;
|
|
13
15
|
export declare const BUCKET_NAME: RegExp;
|
|
14
16
|
export declare const JS_VARIABLE_NAME: RegExp;
|
package/dist/utils/tools.d.ts
CHANGED
|
@@ -12,3 +12,12 @@ export declare function generateRandomCode(strLen?: number): string;
|
|
|
12
12
|
* 通过读取 cookies 获取用户 ID
|
|
13
13
|
*/
|
|
14
14
|
export declare function getUserIDByCookies(): number;
|
|
15
|
+
/**
|
|
16
|
+
* 将服务端的合约状态转换成前端需要的状态
|
|
17
|
+
*/
|
|
18
|
+
interface TransformServerAPIContractStateParams {
|
|
19
|
+
status: 0 | 1 | 2;
|
|
20
|
+
authStatus: 1 | 2 | 128 | number;
|
|
21
|
+
}
|
|
22
|
+
export declare function transformServerAPIContractState({ status, authStatus, }: TransformServerAPIContractStateParams): 'active' | 'testActive' | 'inactive' | 'terminal' | 'exception';
|
|
23
|
+
export {};
|
package/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import FUtil from '../utils';
|
|
2
|
+
|
|
3
|
+
// 列出活动
|
|
4
|
+
interface List4ClientParamsType {
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function list4Client(params: List4ClientParamsType) {
|
|
8
|
+
return FUtil.Request({
|
|
9
|
+
method: 'GET',
|
|
10
|
+
url: `/v2/activities/list4Client`,
|
|
11
|
+
params: params,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// 查询活动
|
|
16
|
+
interface Find4ClientParamsType {
|
|
17
|
+
_id: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function find4Client(params: Find4ClientParamsType) {
|
|
21
|
+
return FUtil.Request({
|
|
22
|
+
method: 'GET',
|
|
23
|
+
url: `/v2/activities/find4Client`,
|
|
24
|
+
params: params,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import FUtil from '../utils';
|
|
2
|
-
|
|
3
|
-
// 发送短信或邮件验证码
|
|
4
|
-
interface SendVerificationCodeParamsType {
|
|
5
|
-
loginName: string;
|
|
6
|
-
authCodeType: 'register' | 'resetPassword' | 'activateTransactionAccount' | 'updateTransactionAccountPwd' | 'updateMobileOrEmail';
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function sendVerificationCode(params: SendVerificationCodeParamsType) {
|
|
10
|
-
return FUtil.Request({
|
|
11
|
-
method: 'POST',
|
|
12
|
-
url: `/v2/messages/send`,
|
|
13
|
-
data: params,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// 校验短信或邮件验证码
|
|
18
|
-
interface VerifyVerificationCodeParamsType {
|
|
19
|
-
authCode: string;
|
|
20
|
-
address: string;
|
|
21
|
-
authCodeType: 'register' | 'resetPassword' | 'activateTransactionAccount' | 'updateTransactionAccountPwd' | 'updateMobileOrEmail';
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function verifyVerificationCode(params: VerifyVerificationCodeParamsType): Promise<any> {
|
|
25
|
-
return FUtil.Request({
|
|
26
|
-
method: 'GET',
|
|
27
|
-
url: `/v2/messages/verify`,
|
|
28
|
-
params: params,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
1
|
+
import FUtil from '../utils';
|
|
2
|
+
|
|
3
|
+
// 发送短信或邮件验证码
|
|
4
|
+
interface SendVerificationCodeParamsType {
|
|
5
|
+
loginName: string;
|
|
6
|
+
authCodeType: 'register' | 'resetPassword' | 'activateTransactionAccount' | 'updateTransactionAccountPwd' | 'updateMobileOrEmail';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function sendVerificationCode(params: SendVerificationCodeParamsType) {
|
|
10
|
+
return FUtil.Request({
|
|
11
|
+
method: 'POST',
|
|
12
|
+
url: `/v2/messages/send`,
|
|
13
|
+
data: params,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 校验短信或邮件验证码
|
|
18
|
+
interface VerifyVerificationCodeParamsType {
|
|
19
|
+
authCode: string;
|
|
20
|
+
address: string;
|
|
21
|
+
authCodeType: 'register' | 'resetPassword' | 'activateTransactionAccount' | 'updateTransactionAccountPwd' | 'updateMobileOrEmail';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function verifyVerificationCode(params: VerifyVerificationCodeParamsType): Promise<any> {
|
|
25
|
+
return FUtil.Request({
|
|
26
|
+
method: 'GET',
|
|
27
|
+
url: `/v2/messages/verify`,
|
|
28
|
+
params: params,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import FUtil from '../utils';
|
|
2
|
-
|
|
3
|
-
// 查看合同详情
|
|
4
|
-
interface ContractDetailsParamsType {
|
|
5
|
-
contractId: string;
|
|
6
|
-
isLoadPolicyInfo?: 0 | 1;
|
|
7
|
-
projection?: string;
|
|
8
|
-
isTranslate?: 0 | 1;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function contractDetails({contractId, ...params}: ContractDetailsParamsType) {
|
|
12
|
-
return FUtil.Request({
|
|
13
|
-
method: 'GET',
|
|
14
|
-
url: `/v2/contracts/${contractId}`,
|
|
15
|
-
params: params,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// 查询合同分页列表
|
|
20
|
-
interface ContractsParamsType {
|
|
21
|
-
skip?: number;
|
|
22
|
-
limit?: number;
|
|
23
|
-
identityType: 1 | 2;
|
|
24
|
-
licensorId?: string;
|
|
25
|
-
licenseeId?: string;
|
|
26
|
-
subjectIds?: string;
|
|
27
|
-
subjectType?: 1 | 2 | 3;
|
|
28
|
-
isDefault?: number;
|
|
29
|
-
keywords?: string;
|
|
30
|
-
status?: 0 | 1 | 2; // 合同状态 0:生效中 1:已终止 2:异常的
|
|
31
|
-
authStatus?: 1 | 2 | 128; // 合同授权状态 1:正式授权 2:测试授权 128:未获得授权,多个通过'与'运算
|
|
32
|
-
order?: 'asc' | 'desc'; // asc:正序 desc:倒序
|
|
33
|
-
licenseeIdentityType?: number;
|
|
34
|
-
isLoadPolicyInfo?: 0 | 1;
|
|
35
|
-
isTranslate?: 0 | 1;
|
|
36
|
-
startDate?: string;
|
|
37
|
-
endDate?: string;
|
|
38
|
-
projection?: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function contracts(params: ContractsParamsType) {
|
|
42
|
-
return FUtil.Request({
|
|
43
|
-
method: 'GET',
|
|
44
|
-
url: `/v2/contracts`,
|
|
45
|
-
params: params,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// 批量查询合同列表
|
|
50
|
-
interface BatchContractsParamsType {
|
|
51
|
-
contractIds?: string;
|
|
52
|
-
subjectIds?: string;
|
|
53
|
-
subjectType?: 1 | 2 | 3;
|
|
54
|
-
licenseeIdentityType?: 1 | 2 | 3;
|
|
55
|
-
licensorId?: string;
|
|
56
|
-
licenseeId?: string | number;
|
|
57
|
-
isLoadPolicyInfo?: 0 | 1;
|
|
58
|
-
projection?: string;
|
|
59
|
-
isTranslate?: 0 | 1;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function batchContracts(params: BatchContractsParamsType) {
|
|
63
|
-
return FUtil.Request({
|
|
64
|
-
method: 'GET',
|
|
65
|
-
url: `/v2/contracts/list`,
|
|
66
|
-
params: params,
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// 查看合同流转记录分页列表
|
|
71
|
-
interface TransitionRecordsParamsType {
|
|
72
|
-
contractId: string;
|
|
73
|
-
skip?: number;
|
|
74
|
-
limit?: number;
|
|
75
|
-
isTranslate?: 0 | 1;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function transitionRecords({contractId, ...params}: TransitionRecordsParamsType) {
|
|
79
|
-
return FUtil.Request({
|
|
80
|
-
method: 'GET',
|
|
81
|
-
url: `/v2/contracts/${contractId}/transitionRecords`,
|
|
82
|
-
params: params,
|
|
83
|
-
});
|
|
84
|
-
}
|
|
1
|
+
import FUtil from '../utils';
|
|
2
|
+
|
|
3
|
+
// 查看合同详情
|
|
4
|
+
interface ContractDetailsParamsType {
|
|
5
|
+
contractId: string;
|
|
6
|
+
isLoadPolicyInfo?: 0 | 1;
|
|
7
|
+
projection?: string;
|
|
8
|
+
isTranslate?: 0 | 1;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function contractDetails({contractId, ...params}: ContractDetailsParamsType) {
|
|
12
|
+
return FUtil.Request({
|
|
13
|
+
method: 'GET',
|
|
14
|
+
url: `/v2/contracts/${contractId}`,
|
|
15
|
+
params: params,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// 查询合同分页列表
|
|
20
|
+
interface ContractsParamsType {
|
|
21
|
+
skip?: number;
|
|
22
|
+
limit?: number;
|
|
23
|
+
identityType: 1 | 2;
|
|
24
|
+
licensorId?: string;
|
|
25
|
+
licenseeId?: string;
|
|
26
|
+
subjectIds?: string;
|
|
27
|
+
subjectType?: 1 | 2 | 3;
|
|
28
|
+
isDefault?: number;
|
|
29
|
+
keywords?: string;
|
|
30
|
+
status?: 0 | 1 | 2; // 合同状态 0:生效中 1:已终止 2:异常的
|
|
31
|
+
authStatus?: 1 | 2 | 128; // 合同授权状态 1:正式授权 2:测试授权 128:未获得授权,多个通过'与'运算
|
|
32
|
+
order?: 'asc' | 'desc'; // asc:正序 desc:倒序
|
|
33
|
+
licenseeIdentityType?: number;
|
|
34
|
+
isLoadPolicyInfo?: 0 | 1;
|
|
35
|
+
isTranslate?: 0 | 1;
|
|
36
|
+
startDate?: string;
|
|
37
|
+
endDate?: string;
|
|
38
|
+
projection?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function contracts(params: ContractsParamsType) {
|
|
42
|
+
return FUtil.Request({
|
|
43
|
+
method: 'GET',
|
|
44
|
+
url: `/v2/contracts`,
|
|
45
|
+
params: params,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// 批量查询合同列表
|
|
50
|
+
interface BatchContractsParamsType {
|
|
51
|
+
contractIds?: string;
|
|
52
|
+
subjectIds?: string;
|
|
53
|
+
subjectType?: 1 | 2 | 3;
|
|
54
|
+
licenseeIdentityType?: 1 | 2 | 3;
|
|
55
|
+
licensorId?: string;
|
|
56
|
+
licenseeId?: string | number;
|
|
57
|
+
isLoadPolicyInfo?: 0 | 1;
|
|
58
|
+
projection?: string;
|
|
59
|
+
isTranslate?: 0 | 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function batchContracts(params: BatchContractsParamsType) {
|
|
63
|
+
return FUtil.Request({
|
|
64
|
+
method: 'GET',
|
|
65
|
+
url: `/v2/contracts/list`,
|
|
66
|
+
params: params,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// 查看合同流转记录分页列表
|
|
71
|
+
interface TransitionRecordsParamsType {
|
|
72
|
+
contractId: string;
|
|
73
|
+
skip?: number;
|
|
74
|
+
limit?: number;
|
|
75
|
+
isTranslate?: 0 | 1;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function transitionRecords({contractId, ...params}: TransitionRecordsParamsType) {
|
|
79
|
+
return FUtil.Request({
|
|
80
|
+
method: 'GET',
|
|
81
|
+
url: `/v2/contracts/${contractId}/transitionRecords`,
|
|
82
|
+
params: params,
|
|
83
|
+
});
|
|
84
|
+
}
|