@freelog/tools-lib 0.1.76 → 0.1.77
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/presentables.d.ts +3 -0
- package/dist/service-API/resources.d.ts +1 -0
- package/dist/tools-lib.cjs.development.js +1 -33
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +1 -33
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/types/InformalNodeTypes.d.ts +23 -0
- package/dist/types/contractTypes.d.ts +1 -0
- package/package.json +64 -64
- package/src/index.ts +7 -7
- package/src/service-API/presentables.ts +281 -284
- package/src/service-API/resources.ts +1 -26
- package/src/types/InformalNodeTypes.ts +28 -0
- package/src/types/contractTypes.ts +1 -0
|
@@ -1,284 +1,281 @@
|
|
|
1
|
-
import FUtil from '../utils';
|
|
2
|
-
|
|
3
|
-
// 创建展品
|
|
4
|
-
export interface CreatePresentableParamsType {
|
|
5
|
-
nodeId: number;
|
|
6
|
-
resourceId: string;
|
|
7
|
-
version: string;
|
|
8
|
-
resolveResources: {
|
|
9
|
-
resourceId: string;
|
|
10
|
-
contracts: {
|
|
11
|
-
policyId: string;
|
|
12
|
-
}[];
|
|
13
|
-
}[];
|
|
14
|
-
presentableName: string;
|
|
15
|
-
tags?: string[];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function createPresentable(params: CreatePresentableParamsType) {
|
|
19
|
-
// return FUtil.Axios.post(`/v2/presentables`, params);
|
|
20
|
-
return FUtil.Request({
|
|
21
|
-
method: 'POST',
|
|
22
|
-
url: `/v2/presentables`,
|
|
23
|
-
data: params,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// 更新展品
|
|
28
|
-
interface UpdatePresentableParamsType {
|
|
29
|
-
presentableId: string;
|
|
30
|
-
presentableTitle?: string;
|
|
31
|
-
tags?: string[];
|
|
32
|
-
coverImages?: string[];
|
|
33
|
-
addPolicies?: {
|
|
34
|
-
policyName: string;
|
|
35
|
-
policyText: string;
|
|
36
|
-
status?: 0 | 1;
|
|
37
|
-
}[];
|
|
38
|
-
updatePolicies?: {
|
|
39
|
-
policyId: string;
|
|
40
|
-
status: 0 | 1;
|
|
41
|
-
}[];
|
|
42
|
-
resolveResources?: {
|
|
43
|
-
resourceId: string;
|
|
44
|
-
contracts: {
|
|
45
|
-
policyId: string;
|
|
46
|
-
}[];
|
|
47
|
-
}[];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function updatePresentable({presentableId, ...params}: UpdatePresentableParamsType) {
|
|
51
|
-
// return FUtil.Axios.put(`/v2/presentables/${presentableId}`, params);
|
|
52
|
-
return FUtil.Request({
|
|
53
|
-
method: 'PUT',
|
|
54
|
-
url: `/v2/presentables/${presentableId}`,
|
|
55
|
-
data: params,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// 上下线presentable
|
|
60
|
-
interface PresentablesOnlineParamsType {
|
|
61
|
-
presentableId: string;
|
|
62
|
-
onlineStatus: 0 | 1;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function presentablesOnlineStatus({presentableId, ...params}: PresentablesOnlineParamsType) {
|
|
66
|
-
// return FUtil.Axios.put(`/v2/presentables/${presentableId}/onlineStatus`, params);
|
|
67
|
-
return FUtil.Request({
|
|
68
|
-
method: 'PUT',
|
|
69
|
-
url: `/v2/presentables/${presentableId}/onlineStatus`,
|
|
70
|
-
data: params,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// 查看展品详情
|
|
75
|
-
interface PresentableDetailsParamsType1 {
|
|
76
|
-
presentableId: string;
|
|
77
|
-
projection?: string;
|
|
78
|
-
isLoadVersionProperty?: 0 | 1;
|
|
79
|
-
isLoadPolicyInfo?: 0 | 1;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return FUtil.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return FUtil.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return FUtil.Request({
|
|
136
|
-
method: 'GET',
|
|
137
|
-
url: `/v2/presentables`,
|
|
138
|
-
params: params,
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// 批量查询展品列表
|
|
143
|
-
interface PresentableListParamsType {
|
|
144
|
-
nodeId?: number;
|
|
145
|
-
userId?: number;
|
|
146
|
-
presentableIds?: string;
|
|
147
|
-
resourceIds?: string;
|
|
148
|
-
resourceNames?: string;
|
|
149
|
-
isLoadVersionProperty?: 0 | 1;
|
|
150
|
-
isLoadPolicyInfo?: 0 | 1;
|
|
151
|
-
projection?: string;
|
|
152
|
-
resolveResourceIds?: string;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export function presentableList(params: PresentableListParamsType) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
//
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
params: params,
|
|
283
|
-
});
|
|
284
|
-
}
|
|
1
|
+
import FUtil from '../utils';
|
|
2
|
+
|
|
3
|
+
// 创建展品
|
|
4
|
+
export interface CreatePresentableParamsType {
|
|
5
|
+
nodeId: number;
|
|
6
|
+
resourceId: string;
|
|
7
|
+
version: string;
|
|
8
|
+
resolveResources: {
|
|
9
|
+
resourceId: string;
|
|
10
|
+
contracts: {
|
|
11
|
+
policyId: string;
|
|
12
|
+
}[];
|
|
13
|
+
}[];
|
|
14
|
+
presentableName: string;
|
|
15
|
+
tags?: string[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function createPresentable(params: CreatePresentableParamsType) {
|
|
19
|
+
// return FUtil.Axios.post(`/v2/presentables`, params);
|
|
20
|
+
return FUtil.Request({
|
|
21
|
+
method: 'POST',
|
|
22
|
+
url: `/v2/presentables`,
|
|
23
|
+
data: params,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 更新展品
|
|
28
|
+
interface UpdatePresentableParamsType {
|
|
29
|
+
presentableId: string;
|
|
30
|
+
presentableTitle?: string;
|
|
31
|
+
tags?: string[];
|
|
32
|
+
coverImages?: string[];
|
|
33
|
+
addPolicies?: {
|
|
34
|
+
policyName: string;
|
|
35
|
+
policyText: string;
|
|
36
|
+
status?: 0 | 1;
|
|
37
|
+
}[];
|
|
38
|
+
updatePolicies?: {
|
|
39
|
+
policyId: string;
|
|
40
|
+
status: 0 | 1;
|
|
41
|
+
}[];
|
|
42
|
+
resolveResources?: {
|
|
43
|
+
resourceId: string;
|
|
44
|
+
contracts: {
|
|
45
|
+
policyId: string;
|
|
46
|
+
}[];
|
|
47
|
+
}[];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function updatePresentable({presentableId, ...params}: UpdatePresentableParamsType) {
|
|
51
|
+
// return FUtil.Axios.put(`/v2/presentables/${presentableId}`, params);
|
|
52
|
+
return FUtil.Request({
|
|
53
|
+
method: 'PUT',
|
|
54
|
+
url: `/v2/presentables/${presentableId}`,
|
|
55
|
+
data: params,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 上下线presentable
|
|
60
|
+
interface PresentablesOnlineParamsType {
|
|
61
|
+
presentableId: string;
|
|
62
|
+
onlineStatus: 0 | 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function presentablesOnlineStatus({presentableId, ...params}: PresentablesOnlineParamsType) {
|
|
66
|
+
// return FUtil.Axios.put(`/v2/presentables/${presentableId}/onlineStatus`, params);
|
|
67
|
+
return FUtil.Request({
|
|
68
|
+
method: 'PUT',
|
|
69
|
+
url: `/v2/presentables/${presentableId}/onlineStatus`,
|
|
70
|
+
data: params,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// 查看展品详情
|
|
75
|
+
interface PresentableDetailsParamsType1 {
|
|
76
|
+
presentableId: string;
|
|
77
|
+
projection?: string;
|
|
78
|
+
isLoadVersionProperty?: 0 | 1;
|
|
79
|
+
isLoadPolicyInfo?: 0 | 1;
|
|
80
|
+
isTranslate?: 0 | 1;
|
|
81
|
+
isLoadCustomPropertyDescriptors?: 0 | 1;
|
|
82
|
+
isLoadResourceDetailInfo?: 0 | 1;
|
|
83
|
+
isLoadResourceVersionInfo?: 0 | 1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface PresentableDetailsParamsType2 {
|
|
87
|
+
nodeId: number;
|
|
88
|
+
resourceId?: string;
|
|
89
|
+
resourceName?: string;
|
|
90
|
+
presentableName?: string;
|
|
91
|
+
projection?: string;
|
|
92
|
+
isLoadVersionProperty?: 0 | 1;
|
|
93
|
+
isLoadPolicyInfo?: 0 | 1;
|
|
94
|
+
isLoadCustomPropertyDescriptors?: 0 | 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function presentableDetails(params: PresentableDetailsParamsType1 | PresentableDetailsParamsType2) {
|
|
98
|
+
if ((params as PresentableDetailsParamsType2).nodeId) {
|
|
99
|
+
// return FUtil.Axios.get(`/v2/presentables/detail`, {
|
|
100
|
+
// params,
|
|
101
|
+
// });
|
|
102
|
+
return FUtil.Request({
|
|
103
|
+
method: 'GET',
|
|
104
|
+
url: `/v2/presentables/detail`,
|
|
105
|
+
params: params,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
const {presentableId, ...p} = params as PresentableDetailsParamsType1;
|
|
109
|
+
// return FUtil.Axios.get(`/v2/presentables/${presentableId}`, {
|
|
110
|
+
// params: p,
|
|
111
|
+
// });
|
|
112
|
+
return FUtil.Request({
|
|
113
|
+
method: 'GET',
|
|
114
|
+
url: `/v2/presentables/${presentableId}`,
|
|
115
|
+
params: p,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// 查询展品分页列表
|
|
120
|
+
interface PresentablesParamsType {
|
|
121
|
+
nodeId: number;
|
|
122
|
+
skip?: number;
|
|
123
|
+
limit?: number;
|
|
124
|
+
resourceType?: string;
|
|
125
|
+
omitResourceType?: string;
|
|
126
|
+
onlineStatus?: number;
|
|
127
|
+
tags?: string;
|
|
128
|
+
projection?: string;
|
|
129
|
+
keywords?: string;
|
|
130
|
+
isLoadVersionProperty?: 0 | 1;
|
|
131
|
+
isLoadPolicyInfo?: 0 | 1;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export function presentables(params: PresentablesParamsType) {
|
|
135
|
+
return FUtil.Request({
|
|
136
|
+
method: 'GET',
|
|
137
|
+
url: `/v2/presentables`,
|
|
138
|
+
params: params,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// 批量查询展品列表
|
|
143
|
+
interface PresentableListParamsType {
|
|
144
|
+
nodeId?: number;
|
|
145
|
+
userId?: number;
|
|
146
|
+
presentableIds?: string;
|
|
147
|
+
resourceIds?: string;
|
|
148
|
+
resourceNames?: string;
|
|
149
|
+
isLoadVersionProperty?: 0 | 1;
|
|
150
|
+
isLoadPolicyInfo?: 0 | 1;
|
|
151
|
+
projection?: string;
|
|
152
|
+
resolveResourceIds?: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export function presentableList(params: PresentableListParamsType) {
|
|
156
|
+
return FUtil.Request({
|
|
157
|
+
method: 'GET',
|
|
158
|
+
url: `/v2/presentables/list`,
|
|
159
|
+
params: params,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// 查看展品依赖树
|
|
164
|
+
interface DependencyTreeParamsType {
|
|
165
|
+
presentableId: string;
|
|
166
|
+
maxDeep?: number;
|
|
167
|
+
nid?: string;
|
|
168
|
+
isContainRootNode?: boolean;
|
|
169
|
+
version?: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export function dependencyTree({presentableId, ...params}: DependencyTreeParamsType) {
|
|
173
|
+
// return FUtil.Axios.get(`/v2/presentables/${presentableId}/dependencyTree`, {params});
|
|
174
|
+
return FUtil.Request({
|
|
175
|
+
method: 'GET',
|
|
176
|
+
url: `/v2/presentables/${presentableId}/dependencyTree`,
|
|
177
|
+
params: params,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// 查看展品关系树
|
|
182
|
+
interface RelationTreeParamsType {
|
|
183
|
+
presentableId: string;
|
|
184
|
+
version?: string;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export function relationTree({presentableId, ...params}: RelationTreeParamsType) {
|
|
188
|
+
// return FUtil.Axios.get(`/v2/presentables/${presentableId}/relationTree`, {params});
|
|
189
|
+
return FUtil.Request({
|
|
190
|
+
method: 'GET',
|
|
191
|
+
url: `/v2/presentables/${presentableId}/relationTree`,
|
|
192
|
+
params: params,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// 查看展品授权树
|
|
197
|
+
interface AuthTreeParamsType {
|
|
198
|
+
presentableId: string;
|
|
199
|
+
maxDeep?: number;
|
|
200
|
+
nid?: string;
|
|
201
|
+
isContainRootNode?: boolean;
|
|
202
|
+
version?: string;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export function authTree({presentableId, ...params}: AuthTreeParamsType) {
|
|
206
|
+
// return FUtil.Axios.get(`/v2/presentables/${presentableId}/authTree`, {params});
|
|
207
|
+
return FUtil.Request({
|
|
208
|
+
method: 'GET',
|
|
209
|
+
url: `/v2/presentables/${presentableId}/authTree`,
|
|
210
|
+
params: params,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// 切换展品版本
|
|
215
|
+
interface PresentablesVersionParamsType {
|
|
216
|
+
presentableId: string;
|
|
217
|
+
version: string;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export function presentablesVersion({presentableId, ...params}: PresentablesVersionParamsType) {
|
|
221
|
+
// return FUtil.Axios.put(`/v2/presentables/${presentableId}/version`, params);
|
|
222
|
+
return FUtil.Request({
|
|
223
|
+
method: 'PUT',
|
|
224
|
+
url: `/v2/presentables/${presentableId}/version`,
|
|
225
|
+
data: params,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// 设置展品自定义属性
|
|
230
|
+
interface UpdateRewritePropertyParamsType {
|
|
231
|
+
presentableId: string;
|
|
232
|
+
rewriteProperty: {
|
|
233
|
+
key: string;
|
|
234
|
+
value: string;
|
|
235
|
+
remark: string;
|
|
236
|
+
}[];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export function updateRewriteProperty({presentableId, ...params}: UpdateRewritePropertyParamsType) {
|
|
240
|
+
// return FUtil.Axios.put(`/v2/presentables/${presentableId}/rewriteProperty`, params);
|
|
241
|
+
return FUtil.Request({
|
|
242
|
+
method: 'PUT',
|
|
243
|
+
url: `/v2/presentables/${presentableId}/rewriteProperty`,
|
|
244
|
+
data: params,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// 批量获取展品授权结果
|
|
249
|
+
interface BatchAuthParamsType {
|
|
250
|
+
nodeId: number;
|
|
251
|
+
authType: 1 | 2 | 3; // 1:节点侧授权 2:资源侧授权 3:节点+资源侧授权
|
|
252
|
+
presentableIds: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export function batchAuth({nodeId, ...params}: BatchAuthParamsType) {
|
|
256
|
+
// return FUtil.Axios.get(`/v2/auths/presentables/nodes/${nodeId}/batchAuth/result`, {
|
|
257
|
+
// params,
|
|
258
|
+
// });
|
|
259
|
+
return FUtil.Request({
|
|
260
|
+
method: 'GET',
|
|
261
|
+
url: `/v2/auths/presentables/nodes/${nodeId}/batchAuth/result`,
|
|
262
|
+
params: params,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// 查看合约应用的展品列表
|
|
267
|
+
interface ContractAppliedPresentableParamsType {
|
|
268
|
+
nodeId: number;
|
|
269
|
+
contractIds: string;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export function contractAppliedPresentable({nodeId, ...params}: ContractAppliedPresentableParamsType) {
|
|
273
|
+
// return FUtil.Axios.get(`/v2/presentables/${nodeId}/contractAppliedPresentable`, {
|
|
274
|
+
// params,
|
|
275
|
+
// });
|
|
276
|
+
return FUtil.Request({
|
|
277
|
+
method: 'GET',
|
|
278
|
+
url: `/v2/presentables/${nodeId}/contractAppliedPresentable`,
|
|
279
|
+
params: params,
|
|
280
|
+
});
|
|
281
|
+
}
|
|
@@ -11,7 +11,6 @@ export interface CreateParamsType {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export function create(params: CreateParamsType) {
|
|
14
|
-
// return FUtil.Axios.post('/v2/resources', params)
|
|
15
14
|
return FUtil.Request({
|
|
16
15
|
method: 'POST',
|
|
17
16
|
url: `/v2/resources`,
|
|
@@ -37,7 +36,6 @@ interface UpdateParamsType {
|
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
export function update(params: UpdateParamsType) {
|
|
40
|
-
// return FUtil.Axios.put(`/v2/resources/${params.resourceId}`, params);
|
|
41
39
|
return FUtil.Request({
|
|
42
40
|
method: 'PUT',
|
|
43
41
|
url: `/v2/resources/${params.resourceId}`,
|
|
@@ -61,9 +59,6 @@ interface ListParamsType {
|
|
|
61
59
|
}
|
|
62
60
|
|
|
63
61
|
export function list(params: ListParamsType) {
|
|
64
|
-
// return FUtil.Axios.get('/v2/resources', {
|
|
65
|
-
// params,
|
|
66
|
-
// });
|
|
67
62
|
return FUtil.Request({
|
|
68
63
|
method: 'GET',
|
|
69
64
|
url: `/v2/resources`,
|
|
@@ -75,14 +70,12 @@ export function list(params: ListParamsType) {
|
|
|
75
70
|
interface InfoParamsType {
|
|
76
71
|
resourceIdOrName: string;
|
|
77
72
|
isLoadPolicyInfo?: 0 | 1;
|
|
73
|
+
isTranslate?: 0 | 1;
|
|
78
74
|
isLoadLatestVersionInfo?: 0 | 1;
|
|
79
75
|
projection?: string;
|
|
80
76
|
}
|
|
81
77
|
|
|
82
78
|
export function info({resourceIdOrName, ...params}: InfoParamsType) {
|
|
83
|
-
// return FUtil.Axios.get(`/v2/resources/${encodeURIComponent(resourceIdOrName)}`, {
|
|
84
|
-
// params: params,
|
|
85
|
-
// });
|
|
86
79
|
return FUtil.Request({
|
|
87
80
|
method: 'GET',
|
|
88
81
|
url: `/v2/resources/${encodeURIComponent(resourceIdOrName)}`,
|
|
@@ -100,9 +93,6 @@ interface BatchInfoParamsType {
|
|
|
100
93
|
}
|
|
101
94
|
|
|
102
95
|
export function batchInfo(params: BatchInfoParamsType) {
|
|
103
|
-
// return FUtil.Axios.get(`/v2/resources/list`, {
|
|
104
|
-
// params: params,
|
|
105
|
-
// });
|
|
106
96
|
return FUtil.Request({
|
|
107
97
|
method: 'GET',
|
|
108
98
|
url: `/v2/resources/list`,
|
|
@@ -120,9 +110,6 @@ interface DependencyTreeParamsType {
|
|
|
120
110
|
}
|
|
121
111
|
|
|
122
112
|
export function dependencyTree({resourceId, ...params}: DependencyTreeParamsType) {
|
|
123
|
-
// return FUtil.Axios.get(`/v2/resources/${resourceId}/dependencyTree`, {
|
|
124
|
-
// params: params,
|
|
125
|
-
// });
|
|
126
113
|
return FUtil.Request({
|
|
127
114
|
method: 'GET',
|
|
128
115
|
url: `/v2/resources/${resourceId}/dependencyTree`,
|
|
@@ -137,9 +124,6 @@ interface AuthTreeParamsType {
|
|
|
137
124
|
}
|
|
138
125
|
|
|
139
126
|
export function authTree({resourceId, ...params}: AuthTreeParamsType) {
|
|
140
|
-
// return FUtil.Axios.get(`/v2/resources/${resourceId}/authTree`, {
|
|
141
|
-
// params: params,
|
|
142
|
-
// });
|
|
143
127
|
return FUtil.Request({
|
|
144
128
|
method: 'GET',
|
|
145
129
|
url: `/v2/resources/${resourceId}/authTree`,
|
|
@@ -198,13 +182,7 @@ interface ResourceVersionInfoParamsType2 {
|
|
|
198
182
|
}
|
|
199
183
|
|
|
200
184
|
export function resourceVersionInfo(params: ResourceVersionInfoParamsType1 | ResourceVersionInfoParamsType2) {
|
|
201
|
-
// console.log('####!AAA');
|
|
202
185
|
if ((params as ResourceVersionInfoParamsType1).version) {
|
|
203
|
-
// return FUtil.Axios.get(`/v2/resources/${(params as ResourceVersionInfoParamsType1).resourceId}/versions/${(params as ResourceVersionInfoParamsType1).version}`, {
|
|
204
|
-
// params: {
|
|
205
|
-
// projection: params.projection,
|
|
206
|
-
// }
|
|
207
|
-
// });
|
|
208
186
|
return FUtil.Request({
|
|
209
187
|
method: 'GET',
|
|
210
188
|
url: `/v2/resources/${(params as ResourceVersionInfoParamsType1).resourceId}/versions/${(params as ResourceVersionInfoParamsType1).version}`,
|
|
@@ -212,9 +190,6 @@ export function resourceVersionInfo(params: ResourceVersionInfoParamsType1 | Res
|
|
|
212
190
|
});
|
|
213
191
|
}
|
|
214
192
|
|
|
215
|
-
// return FUtil.Axios.get(`/v2/resources/versions/detail`, {
|
|
216
|
-
// params,
|
|
217
|
-
// });
|
|
218
193
|
return FUtil.Request({
|
|
219
194
|
method: 'GET',
|
|
220
195
|
url: `/v2/resources/versions/detail`,
|