@freelog/tools-lib 0.1.139 → 0.1.140

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.139",
3
+ "version": "0.1.140",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -19,7 +19,7 @@
19
19
  "prepare": "tsdx build",
20
20
  "size": "size-limit",
21
21
  "analyze": "size-limit --why",
22
- "publish": "npm publish --access public"
22
+ "publish": "npm publish --access=public"
23
23
  },
24
24
  "husky": {
25
25
  "hooks": {}
@@ -1,101 +1,137 @@
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
- }
85
-
86
- // 统计合约签约量
87
- interface ContractsSignCountParamsType {
88
- objectIds: string | number;
89
- objectType: 1 | 2 | 3 | 4 | 5; // 统计对象类型(1:甲方ID 2:甲方所属ID 3:乙方ID 4:乙方所属ID 5:标的物ID)
90
- subjectType: 1 | 2 | 3; // 标的物类型(1:资源 2:展品 3:用户组)
91
- startDate?: string;
92
- endDate?: string;
93
- }
94
-
95
- export function contractsSignCount(params: ContractsSignCountParamsType) {
96
- return FUtil.Request({
97
- method: 'GET',
98
- url: `/v2/contracts/signCount`,
99
- params: params,
100
- });
101
- }
1
+ import FUtil from '../utils';
2
+
3
+ // 创建合同
4
+ interface CreateContractParamsType {
5
+ subjectId: string;
6
+ subjectType: 1 | 2 | 3; // 标的物类型 1:资源 2:展品 3:用户组
7
+ policyId: string;
8
+ licenseeId: string | number;
9
+ licenseeIdentityType: 1 | 2 | 3; // 乙方身份类型 1:资源方 2:节点方 3:C端用户
10
+ }
11
+
12
+ export function createContract({...params}: CreateContractParamsType) {
13
+ return FUtil.Request({
14
+ method: 'POST',
15
+ url: `/v2/contracts`,
16
+ data: params,
17
+ });
18
+ }
19
+
20
+ // 批量创建合同
21
+ interface BatchCreateContractsParamsType {
22
+ subjects: {
23
+ subjectId: string;
24
+ policyId: string;
25
+ }[];
26
+ subjectType: 1 | 2 | 3; // 标的物类型 1:资源 2:展品 3:用户组
27
+ licenseeId: string | number;
28
+ licenseeIdentityType: 1 | 2 | 3; // 乙方身份类型 1:资源方 2:节点方 3:C端用户
29
+ }
30
+
31
+ export function batchCreateContracts({...params}: BatchCreateContractsParamsType) {
32
+ return FUtil.Request({
33
+ method: 'POST',
34
+ url: `/v2/contracts/batchSign`,
35
+ data: params,
36
+ });
37
+ }
38
+
39
+ // 查看合同详情
40
+ interface ContractDetailsParamsType {
41
+ contractId: string;
42
+ isLoadPolicyInfo?: 0 | 1;
43
+ projection?: string;
44
+ isTranslate?: 0 | 1;
45
+ }
46
+
47
+ export function contractDetails({contractId, ...params}: ContractDetailsParamsType) {
48
+ return FUtil.Request({
49
+ method: 'GET',
50
+ url: `/v2/contracts/${contractId}`,
51
+ params: params,
52
+ });
53
+ }
54
+
55
+ // 查询合同分页列表
56
+ interface ContractsParamsType {
57
+ skip?: number;
58
+ limit?: number;
59
+ identityType: 1 | 2;
60
+ licensorId?: string;
61
+ licenseeId?: string;
62
+ subjectIds?: string;
63
+ subjectType?: 1 | 2 | 3;
64
+ isDefault?: number;
65
+ keywords?: string;
66
+ status?: 0 | 1 | 2; // 合同状态 0:生效中 1:已终止 2:异常的
67
+ authStatus?: 1 | 2 | 128; // 合同授权状态 1:正式授权 2:测试授权 128:未获得授权,多个通过'与'运算
68
+ order?: 'asc' | 'desc'; // asc:正序 desc:倒序
69
+ licenseeIdentityType?: number;
70
+ isLoadPolicyInfo?: 0 | 1;
71
+ isTranslate?: 0 | 1;
72
+ startDate?: string;
73
+ endDate?: string;
74
+ projection?: string;
75
+ }
76
+
77
+ export function contracts(params: ContractsParamsType) {
78
+ return FUtil.Request({
79
+ method: 'GET',
80
+ url: `/v2/contracts`,
81
+ params: params,
82
+ });
83
+ }
84
+
85
+ // 批量查询合同列表
86
+ interface BatchContractsParamsType {
87
+ contractIds?: string;
88
+ subjectIds?: string;
89
+ subjectType?: 1 | 2 | 3;
90
+ licenseeIdentityType?: 1 | 2 | 3;
91
+ licensorId?: string;
92
+ licenseeId?: string | number;
93
+ isLoadPolicyInfo?: 0 | 1;
94
+ projection?: string;
95
+ isTranslate?: 0 | 1;
96
+ }
97
+
98
+ export function batchContracts(params: BatchContractsParamsType) {
99
+ return FUtil.Request({
100
+ method: 'GET',
101
+ url: `/v2/contracts/list`,
102
+ params: params,
103
+ });
104
+ }
105
+
106
+ // 查看合同流转记录分页列表
107
+ interface TransitionRecordsParamsType {
108
+ contractId: string;
109
+ skip?: number;
110
+ limit?: number;
111
+ isTranslate?: 0 | 1;
112
+ }
113
+
114
+ export function transitionRecords({contractId, ...params}: TransitionRecordsParamsType) {
115
+ return FUtil.Request({
116
+ method: 'GET',
117
+ url: `/v2/contracts/${contractId}/transitionRecords`,
118
+ params: params,
119
+ });
120
+ }
121
+
122
+ // 统计合约签约量
123
+ interface ContractsSignCountParamsType {
124
+ objectIds: string | number;
125
+ objectType: 1 | 2 | 3 | 4 | 5; // 统计对象类型(1:甲方ID 2:甲方所属ID 3:乙方ID 4:乙方所属ID 5:标的物ID)
126
+ subjectType: 1 | 2 | 3; // 标的物类型(1:资源 2:展品 3:用户组)
127
+ startDate?: string;
128
+ endDate?: string;
129
+ }
130
+
131
+ export function contractsSignCount(params: ContractsSignCountParamsType) {
132
+ return FUtil.Request({
133
+ method: 'GET',
134
+ url: `/v2/contracts/signCount`,
135
+ params: params,
136
+ });
137
+ }