@freelog/tools-lib 0.1.184 → 0.1.186
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/index.d.ts +2 -0
- package/dist/service-API/payment.d.ts +35 -0
- package/dist/service-API/policies.d.ts +9 -0
- package/dist/service-API/resources.d.ts +1 -1
- package/dist/tools-lib.cjs.development.js +430 -572
- 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 +430 -572
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/linkTo.d.ts +7 -1
- package/package.json +4 -3
- package/src/i18n/I18nNext.ts +156 -156
- package/src/service-API/contracts.ts +157 -157
- package/src/service-API/index.ts +45 -43
- package/src/service-API/payment.ts +82 -0
- package/src/service-API/policies.ts +18 -0
- package/src/service-API/presentables.ts +605 -605
- package/src/service-API/resources.ts +1379 -1379
- package/src/service-API/storages.ts +418 -418
- package/src/service-API/user.ts +324 -324
- package/src/utils/linkTo.ts +21 -1
package/src/service-API/index.ts
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
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
|
-
import * as I18n from './i18n';
|
|
16
|
-
import * as Policy from './policies';
|
|
17
|
-
import * as recombination from './recombinations';
|
|
18
|
-
import * as Operation from './operation';
|
|
19
|
-
import * as ResourceType from './resourceType';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
+
import * as I18n from './i18n';
|
|
16
|
+
import * as Policy from './policies';
|
|
17
|
+
import * as recombination from './recombinations';
|
|
18
|
+
import * as Operation from './operation';
|
|
19
|
+
import * as ResourceType from './resourceType';
|
|
20
|
+
import * as Payment from './payment';
|
|
21
|
+
|
|
22
|
+
const FServiceAPI = {
|
|
23
|
+
Node,
|
|
24
|
+
Exhibit,
|
|
25
|
+
Storage,
|
|
26
|
+
Collection,
|
|
27
|
+
Resource,
|
|
28
|
+
User,
|
|
29
|
+
InformalNode,
|
|
30
|
+
Contract,
|
|
31
|
+
Transaction,
|
|
32
|
+
Captcha,
|
|
33
|
+
Event,
|
|
34
|
+
Activity,
|
|
35
|
+
TestQualification,
|
|
36
|
+
Statistic,
|
|
37
|
+
I18n,
|
|
38
|
+
Policy,
|
|
39
|
+
recombination,
|
|
40
|
+
Operation,
|
|
41
|
+
ResourceType,
|
|
42
|
+
Payment,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default FServiceAPI;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import FUtil from '../utils';
|
|
3
|
+
|
|
4
|
+
// 证件上传与识别
|
|
5
|
+
interface UploadIDCardParamsType {
|
|
6
|
+
file: File;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function uploadIDCard(params: UploadIDCardParamsType, config?: AxiosRequestConfig) {
|
|
10
|
+
const formData = new FormData();
|
|
11
|
+
for (const [key, value] of Object.entries(params)) {
|
|
12
|
+
if (value) {
|
|
13
|
+
formData.append(key, value);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return FUtil.Request({
|
|
17
|
+
method: 'POST',
|
|
18
|
+
url: `/v3/transactions/accounts/idCardUploadAndOcr`,
|
|
19
|
+
data: formData,
|
|
20
|
+
...config,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
// 开通金融账户
|
|
26
|
+
interface OpenFinancialAccountParamsType {
|
|
27
|
+
accountType: 1 | 2; // 账户类型(1:个人账户 2:节点账户)
|
|
28
|
+
ownerId: number; // 账户所有者ID; 根据账户类型动态赋值userId或nodeId
|
|
29
|
+
certType: '00'; // 证件类型(00:身份证)
|
|
30
|
+
certNo: string; // 证件号码;例如身份证号
|
|
31
|
+
name: string; // 证件上的名称;例如身份证上的姓名
|
|
32
|
+
certValidityType: 0 | 1; // 证件有效期是否是长期; 0:非长期有效 1:长期有效
|
|
33
|
+
certBeginDate: string; // 证件有效期开始日期
|
|
34
|
+
certEndDate?: string; // 证件有效期结束日期(长期有效时此处不传)
|
|
35
|
+
mobile: string; // 开户人真实手机号;
|
|
36
|
+
certImagePaths: string[]; // 证件照保密存放的path部分; 身份证号码识别接口会返回
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function openFinancialAccount(params: OpenFinancialAccountParamsType, config?: AxiosRequestConfig) {
|
|
40
|
+
return FUtil.Request({
|
|
41
|
+
method: 'POST',
|
|
42
|
+
url: `/v3/transactions/accounts`,
|
|
43
|
+
data: params,
|
|
44
|
+
...config,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 金融账户绑定提现卡
|
|
49
|
+
interface BindWithdrawCardParamsType {
|
|
50
|
+
accountId: string; // 金融账户ID
|
|
51
|
+
cardType: 0 | 1 | 2 | 4; // 0:对公,1:对私法人,2:对私非法人,4:对公非同名;个人商户/用户不支持对公类型,对私非法人类型;
|
|
52
|
+
bankName: string; // 开户行名称
|
|
53
|
+
cardName: string; // 持卡人姓名
|
|
54
|
+
cardNo: string; // 卡号
|
|
55
|
+
provId: string; // 银行所在省ID
|
|
56
|
+
areaId: string; // 银行所在城市ID
|
|
57
|
+
branchCode?: string; // 银行支行联行号; 当card_type=0时必填
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function bindWithdrawCard({accountId, ...params}: BindWithdrawCardParamsType, config?: AxiosRequestConfig) {
|
|
61
|
+
return FUtil.Request({
|
|
62
|
+
method: 'POST',
|
|
63
|
+
url: `/v3/transactions/accounts/${accountId}/bindCashCard`,
|
|
64
|
+
data: params,
|
|
65
|
+
...config,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 登录用户关联金融登账户信息查询
|
|
70
|
+
interface QueryFinancialAccountInfoParamsType {
|
|
71
|
+
accountType: 1 | 2; // 账户类型(1:个人账户 2:节点账户)
|
|
72
|
+
ownerId: number; // 账户所有者ID; 根据账户类型动态赋值userId或nodeId
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function queryFinancialAccountInfo(params: QueryFinancialAccountInfoParamsType, config?: AxiosRequestConfig) {
|
|
76
|
+
return FUtil.Request({
|
|
77
|
+
method: 'GET',
|
|
78
|
+
url: `/v3/transactions/accounts/query`,
|
|
79
|
+
params: params,
|
|
80
|
+
...config,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
@@ -45,6 +45,24 @@ export function policyTemplates(params: PolicyTemplatesParamsType = {}) {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
// 重新编译
|
|
49
|
+
interface PolicyReCompileParamsType {
|
|
50
|
+
_id?: string;
|
|
51
|
+
contract?: string;
|
|
52
|
+
fillArgs: {
|
|
53
|
+
name: string;
|
|
54
|
+
value: string | number;
|
|
55
|
+
}[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function policyReCompile(data: PolicyReCompileParamsType) {
|
|
59
|
+
return FUtil.Request({
|
|
60
|
+
method: 'POST',
|
|
61
|
+
url: `/v2/translate/reCompile`,
|
|
62
|
+
data: data,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
48
66
|
// 模板策略翻译
|
|
49
67
|
interface PolicyTranslationParamsType {
|
|
50
68
|
contract: string;
|