@freelog/tools-lib 0.1.89 → 0.1.93

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.
Files changed (36) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +103 -103
  3. package/dist/service-API/activities.d.ts +12 -0
  4. package/dist/service-API/informalNodes.d.ts +15 -45
  5. package/dist/service-API/policies.d.ts +2 -6
  6. package/dist/tools-lib.cjs.development.js +536 -926
  7. package/dist/tools-lib.cjs.development.js.map +1 -1
  8. package/dist/tools-lib.cjs.production.min.js +1 -1
  9. package/dist/tools-lib.cjs.production.min.js.map +1 -1
  10. package/dist/tools-lib.esm.js +536 -926
  11. package/dist/tools-lib.esm.js.map +1 -1
  12. package/dist/utils/axios.d.ts +1 -4
  13. package/package.json +1 -1
  14. package/src/index.ts +7 -7
  15. package/src/service-API/activities.ts +32 -0
  16. package/src/service-API/captcha.ts +30 -30
  17. package/src/service-API/collections.ts +81 -81
  18. package/src/service-API/contracts.ts +84 -84
  19. package/src/service-API/events.ts +18 -18
  20. package/src/service-API/index.ts +29 -29
  21. package/src/service-API/informalNodes.ts +238 -238
  22. package/src/service-API/nodes.ts +65 -65
  23. package/src/service-API/policies.ts +39 -39
  24. package/src/service-API/presentables.ts +282 -282
  25. package/src/service-API/resources.ts +496 -496
  26. package/src/service-API/storages.ts +345 -345
  27. package/src/service-API/tools/index.ts +10 -10
  28. package/src/service-API/transactions.ts +109 -109
  29. package/src/service-API/user.ts +188 -188
  30. package/src/utils/axios.ts +8 -3
  31. package/src/utils/format.ts +89 -89
  32. package/src/utils/index.ts +18 -18
  33. package/src/utils/linkTo.ts +332 -332
  34. package/src/utils/predefined.ts +37 -37
  35. package/src/utils/regexp.ts +52 -52
  36. package/src/utils/tools.ts +72 -72
@@ -1,7 +1,4 @@
1
1
  import axios, { AxiosRequestConfig } from 'axios';
2
2
  import "nprogress/nprogress.css";
3
- import { CommonReturn, RequestParamsType } from "../service-API/tools";
4
3
  export default axios;
5
- export declare function request(config: AxiosRequestConfig, { noRedirect, noErrorAlert, }?: RequestParamsType): Promise<CommonReturn & {
6
- data: any;
7
- } | void>;
4
+ export declare function request(config: AxiosRequestConfig, { noRedirect, noErrorAlert, }?: any): Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freelog/tools-lib",
3
- "version": "0.1.89",
3
+ "version": "0.1.93",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
- import FUtil from './utils';
2
- import FServiceAPI from './service-API';
3
-
4
- export {
5
- FUtil,
6
- FServiceAPI,
7
- };
1
+ import FUtil from './utils';
2
+ import FServiceAPI from './service-API';
3
+
4
+ export {
5
+ FUtil,
6
+ FServiceAPI,
7
+ };
@@ -26,3 +26,35 @@ export function find4Client(params: Find4ClientParamsType) {
26
26
  params: params,
27
27
  });
28
28
  }
29
+
30
+ // 列出广告
31
+ interface AdsListParamsType {
32
+ skip?: number;
33
+ limit?: number;
34
+ place: 1 | 2 | 3 | 4; // 投放位置 1:顶部公告栏 2:右侧浮窗 3:概览页 4:发现页
35
+
36
+ }
37
+
38
+ export function adsList(params: AdsListParamsType) {
39
+ return FUtil.Request({
40
+ method: 'GET',
41
+ url: `/v2/activities/ads/list4Client`,
42
+ params: params,
43
+ });
44
+ }
45
+
46
+ // 查询广告
47
+ interface AdsDetailsParamsType {
48
+ skip?: number;
49
+ limit?: number;
50
+ place: 1 | 2 | 3 | 4; // 投放位置 1:顶部公告栏 2:右侧浮窗 3:概览页 4:发现页
51
+
52
+ }
53
+
54
+ export function adsDetails(params: AdsDetailsParamsType) {
55
+ return FUtil.Request({
56
+ method: 'GET',
57
+ url: `/v2/activities/ads/find4Client`,
58
+ params: params,
59
+ });
60
+ }
@@ -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,81 +1,81 @@
1
- import FUtil from '../utils';
2
-
3
- // 收藏资源
4
- interface CollectResourceParamsType {
5
- resourceId: string;
6
- }
7
-
8
- export function collectResource(params: CollectResourceParamsType) {
9
- // return FUtil.Axios.post('/v2/collections/resources', params);
10
- return FUtil.Request({
11
- method: 'POST',
12
- url: `/v2/collections/resources`,
13
- data: params,
14
- });
15
- }
16
-
17
- // 查看收藏的资源列表
18
- interface CollectionResourcesParamsType {
19
- skip?: number;
20
- limit?: number;
21
- keywords?: string;
22
- resourceType?: string;
23
- omitResourceType?: string;
24
- resourceStatus?: 0 | 1 | 2;
25
- }
26
-
27
- export function collectionResources(params: CollectionResourcesParamsType) {
28
- // return FUtil.Axios.get('/v2/collections/resources', {
29
- // params
30
- // });
31
- return FUtil.Request({
32
- method: 'GET',
33
- url: `/v2/collections/resources`,
34
- params: params,
35
- });
36
-
37
- }
38
-
39
- // 删除收藏的资源
40
- interface DeleteCollectResourceParamsType {
41
- resourceId: string;
42
- }
43
-
44
- export function deleteCollectResource({resourceId}: DeleteCollectResourceParamsType) {
45
- // return FUtil.Axios.delete(`/v2/collections/resources/${resourceId}`);
46
- return FUtil.Request({
47
- method: 'DELETE',
48
- url: `/v2/collections/resources/${resourceId}`,
49
- // params: params,
50
- });
51
- }
52
-
53
- // 批量查询资源是否收藏
54
- interface IsCollectedParamsType {
55
- resourceIds: string;
56
- }
57
-
58
- export function isCollected(params: IsCollectedParamsType) {
59
- // return FUtil.Axios.get('/v2/collections/resources/isCollected', {
60
- // params
61
- // });
62
- return FUtil.Request({
63
- method: 'GET',
64
- url: `/v2/collections/resources/isCollected`,
65
- params: params,
66
- });
67
- }
68
-
69
- // 查询资源总收藏数量
70
- interface CollectedCountParamsType {
71
- resourceId: string;
72
- }
73
-
74
- export function collectedCount({resourceId}: CollectedCountParamsType) {
75
- // return FUtil.Axios.get(`/v2/collections/resources/${resourceId}/count`);
76
- return FUtil.Request({
77
- method: 'GET',
78
- url: `/v2/collections/resources/${resourceId}/count`,
79
- // params: params,
80
- });
81
- }
1
+ import FUtil from '../utils';
2
+
3
+ // 收藏资源
4
+ interface CollectResourceParamsType {
5
+ resourceId: string;
6
+ }
7
+
8
+ export function collectResource(params: CollectResourceParamsType) {
9
+ // return FUtil.Axios.post('/v2/collections/resources', params);
10
+ return FUtil.Request({
11
+ method: 'POST',
12
+ url: `/v2/collections/resources`,
13
+ data: params,
14
+ });
15
+ }
16
+
17
+ // 查看收藏的资源列表
18
+ interface CollectionResourcesParamsType {
19
+ skip?: number;
20
+ limit?: number;
21
+ keywords?: string;
22
+ resourceType?: string;
23
+ omitResourceType?: string;
24
+ resourceStatus?: 0 | 1 | 2;
25
+ }
26
+
27
+ export function collectionResources(params: CollectionResourcesParamsType) {
28
+ // return FUtil.Axios.get('/v2/collections/resources', {
29
+ // params
30
+ // });
31
+ return FUtil.Request({
32
+ method: 'GET',
33
+ url: `/v2/collections/resources`,
34
+ params: params,
35
+ });
36
+
37
+ }
38
+
39
+ // 删除收藏的资源
40
+ interface DeleteCollectResourceParamsType {
41
+ resourceId: string;
42
+ }
43
+
44
+ export function deleteCollectResource({resourceId}: DeleteCollectResourceParamsType) {
45
+ // return FUtil.Axios.delete(`/v2/collections/resources/${resourceId}`);
46
+ return FUtil.Request({
47
+ method: 'DELETE',
48
+ url: `/v2/collections/resources/${resourceId}`,
49
+ // params: params,
50
+ });
51
+ }
52
+
53
+ // 批量查询资源是否收藏
54
+ interface IsCollectedParamsType {
55
+ resourceIds: string;
56
+ }
57
+
58
+ export function isCollected(params: IsCollectedParamsType) {
59
+ // return FUtil.Axios.get('/v2/collections/resources/isCollected', {
60
+ // params
61
+ // });
62
+ return FUtil.Request({
63
+ method: 'GET',
64
+ url: `/v2/collections/resources/isCollected`,
65
+ params: params,
66
+ });
67
+ }
68
+
69
+ // 查询资源总收藏数量
70
+ interface CollectedCountParamsType {
71
+ resourceId: string;
72
+ }
73
+
74
+ export function collectedCount({resourceId}: CollectedCountParamsType) {
75
+ // return FUtil.Axios.get(`/v2/collections/resources/${resourceId}/count`);
76
+ return FUtil.Request({
77
+ method: 'GET',
78
+ url: `/v2/collections/resources/${resourceId}/count`,
79
+ // params: params,
80
+ });
81
+ }
@@ -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
+ }
@@ -1,18 +1,18 @@
1
- import FUtil from '../utils';
2
-
3
- // 批量获取授权策略列表
4
- interface TransactionParamsType {
5
- contractId: string;
6
- eventId: string;
7
- accountId: string;
8
- transactionAmount: number;
9
- password: string;
10
- }
11
-
12
- export function transaction({contractId, ...params}: TransactionParamsType) {
13
- return FUtil.Request({
14
- method: 'POST',
15
- url: `/v2/contracts/${contractId}/events/payment`,
16
- data: params,
17
- });
18
- }
1
+ import FUtil from '../utils';
2
+
3
+ // 批量获取授权策略列表
4
+ interface TransactionParamsType {
5
+ contractId: string;
6
+ eventId: string;
7
+ accountId: string;
8
+ transactionAmount: number;
9
+ password: string;
10
+ }
11
+
12
+ export function transaction({contractId, ...params}: TransactionParamsType) {
13
+ return FUtil.Request({
14
+ method: 'POST',
15
+ url: `/v2/contracts/${contractId}/events/payment`,
16
+ data: params,
17
+ });
18
+ }
@@ -1,29 +1,29 @@
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
-
14
- const FServiceAPI = {
15
- Node,
16
- Exhibit,
17
- Storage,
18
- Collection,
19
- Resource,
20
- User,
21
- InformalNode,
22
- Contract,
23
- Transaction,
24
- Captcha,
25
- Event,
26
- Activity,
27
- };
28
-
29
- 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
+
14
+ const FServiceAPI = {
15
+ Node,
16
+ Exhibit,
17
+ Storage,
18
+ Collection,
19
+ Resource,
20
+ User,
21
+ InformalNode,
22
+ Contract,
23
+ Transaction,
24
+ Captcha,
25
+ Event,
26
+ Activity,
27
+ };
28
+
29
+ export default FServiceAPI;