@freelog/tools-lib 0.1.184 → 0.1.185

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,75 +1,93 @@
1
- // import {Base64} from 'js-base64';
2
- import FUtil from '../utils';
3
-
4
- // 批量获取授权策略列表
5
- interface PoliciesParamsType {
6
- page?: number;
7
- pageSize?: number;
8
- subjectType?: 1 | 2 | 3; // 1:资源 2:展品 3:用户组
9
- projection?: string;
10
- }
11
-
12
- export function policies(params: PoliciesParamsType) {
13
- return FUtil.Request({
14
- method: 'GET',
15
- url: `/v2/policies`,
16
- params: params,
17
- });
18
- }
19
-
20
- // 批量获取授权策略列表
21
- interface PoliciesListParamsType {
22
- policyIds: string;
23
- subjectType?: number;
24
- userId?: number;
25
- projection?: string;
26
- }
27
-
28
- export function policiesList(params: PoliciesListParamsType) {
29
- return FUtil.Request({
30
- method: 'GET',
31
- url: `/v2/policies/list`,
32
- params: params,
33
- });
34
- }
35
-
36
- // 策略模板
37
- interface PolicyTemplatesParamsType {
38
- }
39
-
40
- export function policyTemplates(params: PolicyTemplatesParamsType = {}) {
41
- return FUtil.Request({
42
- method: 'GET',
43
- url: `/v2/translate/translate-config/list4Client`,
44
- params: params,
45
- });
46
- }
47
-
48
- // 模板策略翻译
49
- interface PolicyTranslationParamsType {
50
- contract: string;
51
- }
52
-
53
- export function policyTranslation({contract}: PolicyTranslationParamsType) {
54
- return FUtil.Request({
55
- method: 'POST',
56
- url: `/v2/translate/translate`,
57
- data: {
58
- contract: contract,
59
- },
60
- });
61
- }
62
-
63
- // 模板策略翻译
64
- interface PolicyTransferTranslationParamsType {
65
- contract: string;
66
- fsmTransfers: any;
67
- }
68
-
69
- export function policyTransferTranslation(params: PolicyTransferTranslationParamsType) {
70
- return FUtil.Request({
71
- method: 'POST',
72
- url: `/v2/translate/transfer`,
73
- data: params,
74
- });
75
- }
1
+ // import {Base64} from 'js-base64';
2
+ import FUtil from '../utils';
3
+
4
+ // 批量获取授权策略列表
5
+ interface PoliciesParamsType {
6
+ page?: number;
7
+ pageSize?: number;
8
+ subjectType?: 1 | 2 | 3; // 1:资源 2:展品 3:用户组
9
+ projection?: string;
10
+ }
11
+
12
+ export function policies(params: PoliciesParamsType) {
13
+ return FUtil.Request({
14
+ method: 'GET',
15
+ url: `/v2/policies`,
16
+ params: params,
17
+ });
18
+ }
19
+
20
+ // 批量获取授权策略列表
21
+ interface PoliciesListParamsType {
22
+ policyIds: string;
23
+ subjectType?: number;
24
+ userId?: number;
25
+ projection?: string;
26
+ }
27
+
28
+ export function policiesList(params: PoliciesListParamsType) {
29
+ return FUtil.Request({
30
+ method: 'GET',
31
+ url: `/v2/policies/list`,
32
+ params: params,
33
+ });
34
+ }
35
+
36
+ // 策略模板
37
+ interface PolicyTemplatesParamsType {
38
+ }
39
+
40
+ export function policyTemplates(params: PolicyTemplatesParamsType = {}) {
41
+ return FUtil.Request({
42
+ method: 'GET',
43
+ url: `/v2/translate/translate-config/list4Client`,
44
+ params: params,
45
+ });
46
+ }
47
+
48
+ // 重新编译
49
+ interface PolicyReCompileParamsType {
50
+ _id?: string;
51
+ contract?: string;
52
+ fillArgs: {
53
+ name: string;
54
+ value: string;
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
+
66
+ // 模板策略翻译
67
+ interface PolicyTranslationParamsType {
68
+ contract: string;
69
+ }
70
+
71
+ export function policyTranslation({contract}: PolicyTranslationParamsType) {
72
+ return FUtil.Request({
73
+ method: 'POST',
74
+ url: `/v2/translate/translate`,
75
+ data: {
76
+ contract: contract,
77
+ },
78
+ });
79
+ }
80
+
81
+ // 模板策略翻译
82
+ interface PolicyTransferTranslationParamsType {
83
+ contract: string;
84
+ fsmTransfers: any;
85
+ }
86
+
87
+ export function policyTransferTranslation(params: PolicyTransferTranslationParamsType) {
88
+ return FUtil.Request({
89
+ method: 'POST',
90
+ url: `/v2/translate/transfer`,
91
+ data: params,
92
+ });
93
+ }