@freelog/tools-lib 0.1.45 → 0.1.49

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.
@@ -1,5 +1,7 @@
1
1
  export declare const resourceTypes: string[];
2
2
  export declare const pageSize: number;
3
+ export declare const momentDateFormat: string;
4
+ export declare const momentDateTimeFormat: string;
3
5
  export declare enum EnumContractPartyIdentityType {
4
6
  resource = 1,
5
7
  node = 2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freelog/tools-lib",
3
- "version": "0.1.45",
3
+ "version": "0.1.49",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -1,89 +1,83 @@
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.Axios.get(`/v2/contracts/${contractId}`, {
13
- // params,
14
- // });
15
- return FUtil.Request({
16
- method: 'GET',
17
- url: `/v2/contracts/${contractId}`,
18
- params: params,
19
- });
20
- }
21
-
22
- // 查询合同分页列表
23
- interface ContractsParamsType {
24
- skip?: number;
25
- limit?: number;
26
- identityType: 1 | 2;
27
- licensorId?: string;
28
- licenseeId?: string;
29
- subjectIds?: string;
30
- subjectType?: number;
31
- isDefault?: number;
32
- keywords?: string;
33
- status?: 2 | 4 | 6;
34
- order?: string;
35
- licenseeIdentityType?: number;
36
- isLoadPolicyInfo?: 0 | 1;
37
- projection?: string;
38
- isTranslate?: 0 | 1;
39
- }
40
-
41
- export function contracts(params: ContractsParamsType) {
42
- // return FUtil.Axios.get('/v2/contracts', {
43
- // params,
44
- // });
45
- return FUtil.Request({
46
- method: 'GET',
47
- url: `/v2/contracts`,
48
- params: params,
49
- });
50
- }
51
-
52
- // 批量查询合同列表
53
- interface BatchContractsParamsType {
54
- contractIds?: string;
55
- subjectIds?: string;
56
- subjectType?: 1 | 2 | 3;
57
- licenseeIdentityType?: 1 | 2 | 3;
58
- licensorId?: string;
59
- licenseeId?: string | number;
60
- isLoadPolicyInfo?: 0 | 1;
61
- projection?: string;
62
- isTranslate?: 0 | 1;
63
- }
64
-
65
- export function batchContracts(params: BatchContractsParamsType) {
66
- // return FUtil.Axios.get('/v2/contracts/list', {
67
- // params,
68
- // });
69
- return FUtil.Request({
70
- method: 'GET',
71
- url: `/v2/contracts/list`,
72
- params: params,
73
- });
74
- }
75
-
76
- // 查看合同流转记录分页列表
77
- interface TransitionRecordsParamsType {
78
- skip?: number;
79
- limit?: number;
80
- contractId: string;
81
- }
82
-
83
- export function transitionRecords({contractId, ...params}: TransitionRecordsParamsType) {
84
- return FUtil.Request({
85
- method: 'GET',
86
- url: `/v2/contracts/${contractId}/transitionRecords`,
87
- params: params,
88
- });
89
- }
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
+ skip?: number;
73
+ limit?: number;
74
+ contractId: string;
75
+ }
76
+
77
+ export function transitionRecords({contractId, ...params}: TransitionRecordsParamsType) {
78
+ return FUtil.Request({
79
+ method: 'GET',
80
+ url: `/v2/contracts/${contractId}/transitionRecords`,
81
+ params: params,
82
+ });
83
+ }
@@ -1,33 +1,37 @@
1
- // export const apiHost = `${window.location.protocol}//qi.${(window.location.host.match(/(?<=\.).*/) || [''])[0]}`;
2
-
3
- // 预设资源类型
4
- export const resourceTypes: string[] = ['json', 'widget', 'image', 'audio', 'markdown', 'theme', 'reveal_slide', 'license', 'video', 'catalog'];
5
-
6
- // 全局列表加载条目数
7
- export const pageSize: number = 20;
8
-
9
- // 签约方用户的身份类型定义
10
- export enum EnumContractPartyIdentityType {
11
- resource = 1,
12
- node,
13
- consumer,
14
- }
15
-
16
- // 标的物类型定义
17
- export enum EnumSubjectType {
18
- resource = 1,
19
- exhibit,
20
- user,
21
- }
22
-
23
- // 合约状态定义
24
- export enum EnumContractStatus {
25
- pending,
26
- authorized,
27
- stopped,
28
- }
29
-
30
- // 合约授权状态定义
31
- // export enum ContractAuthStatus {
32
- //
33
- // }
1
+ // export const apiHost = `${window.location.protocol}//qi.${(window.location.host.match(/(?<=\.).*/) || [''])[0]}`;
2
+
3
+ // 预设资源类型
4
+ export const resourceTypes: string[] = ['json', 'widget', 'image', 'audio', 'markdown', 'theme', 'reveal_slide', 'license', 'video', 'catalog'];
5
+
6
+ // 全局列表加载条目数
7
+ export const pageSize: number = 100;
8
+
9
+ // Moment 日期时间格式
10
+ export const momentDateFormat: string = 'YYYY-MM-DD'
11
+ export const momentDateTimeFormat: string = 'YYYY-MM-DD HH:mm';
12
+
13
+ // 签约方用户的身份类型定义
14
+ export enum EnumContractPartyIdentityType {
15
+ resource = 1,
16
+ node,
17
+ consumer,
18
+ }
19
+
20
+ // 标的物类型定义
21
+ export enum EnumSubjectType {
22
+ resource = 1,
23
+ exhibit,
24
+ user,
25
+ }
26
+
27
+ // 合约状态定义
28
+ export enum EnumContractStatus {
29
+ pending,
30
+ authorized,
31
+ stopped,
32
+ }
33
+
34
+ // 合约授权状态定义
35
+ // export enum ContractAuthStatus {
36
+ //
37
+ // }