@freelog/tools-lib 0.1.75 → 0.1.78
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/index.d.ts +1 -2
- package/dist/service-API/presentables.d.ts +4 -0
- package/dist/service-API/resources.d.ts +2 -0
- package/dist/tools-lib.cjs.development.js +1 -51
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +2 -51
- package/dist/tools-lib.esm.js.map +1 -1
- package/package.json +64 -64
- package/src/index.ts +7 -9
- package/src/service-API/presentables.ts +282 -284
- package/src/service-API/resources.ts +2 -26
- package/dist/types/ContractTypes.d.ts +0 -1
- package/dist/types/InformalNodeTypes.d.ts +0 -23
- package/dist/types/index.d.ts +0 -7
- package/src/types/ContractTypes.ts +0 -1
- package/src/types/InformalNodeTypes.ts +0 -28
- package/src/types/index.ts +0 -10
|
@@ -1,284 +1,282 @@
|
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
-
|
|
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
|
+
isTranslate?: 0 | 1;
|
|
152
|
+
projection?: string;
|
|
153
|
+
resolveResourceIds?: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function presentableList(params: PresentableListParamsType) {
|
|
157
|
+
return FUtil.Request({
|
|
158
|
+
method: 'GET',
|
|
159
|
+
url: `/v2/presentables/list`,
|
|
160
|
+
params: params,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// 查看展品依赖树
|
|
165
|
+
interface DependencyTreeParamsType {
|
|
166
|
+
presentableId: string;
|
|
167
|
+
maxDeep?: number;
|
|
168
|
+
nid?: string;
|
|
169
|
+
isContainRootNode?: boolean;
|
|
170
|
+
version?: string;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export function dependencyTree({presentableId, ...params}: DependencyTreeParamsType) {
|
|
174
|
+
// return FUtil.Axios.get(`/v2/presentables/${presentableId}/dependencyTree`, {params});
|
|
175
|
+
return FUtil.Request({
|
|
176
|
+
method: 'GET',
|
|
177
|
+
url: `/v2/presentables/${presentableId}/dependencyTree`,
|
|
178
|
+
params: params,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// 查看展品关系树
|
|
183
|
+
interface RelationTreeParamsType {
|
|
184
|
+
presentableId: string;
|
|
185
|
+
version?: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export function relationTree({presentableId, ...params}: RelationTreeParamsType) {
|
|
189
|
+
// return FUtil.Axios.get(`/v2/presentables/${presentableId}/relationTree`, {params});
|
|
190
|
+
return FUtil.Request({
|
|
191
|
+
method: 'GET',
|
|
192
|
+
url: `/v2/presentables/${presentableId}/relationTree`,
|
|
193
|
+
params: params,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// 查看展品授权树
|
|
198
|
+
interface AuthTreeParamsType {
|
|
199
|
+
presentableId: string;
|
|
200
|
+
maxDeep?: number;
|
|
201
|
+
nid?: string;
|
|
202
|
+
isContainRootNode?: boolean;
|
|
203
|
+
version?: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function authTree({presentableId, ...params}: AuthTreeParamsType) {
|
|
207
|
+
// return FUtil.Axios.get(`/v2/presentables/${presentableId}/authTree`, {params});
|
|
208
|
+
return FUtil.Request({
|
|
209
|
+
method: 'GET',
|
|
210
|
+
url: `/v2/presentables/${presentableId}/authTree`,
|
|
211
|
+
params: params,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// 切换展品版本
|
|
216
|
+
interface PresentablesVersionParamsType {
|
|
217
|
+
presentableId: string;
|
|
218
|
+
version: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export function presentablesVersion({presentableId, ...params}: PresentablesVersionParamsType) {
|
|
222
|
+
// return FUtil.Axios.put(`/v2/presentables/${presentableId}/version`, params);
|
|
223
|
+
return FUtil.Request({
|
|
224
|
+
method: 'PUT',
|
|
225
|
+
url: `/v2/presentables/${presentableId}/version`,
|
|
226
|
+
data: params,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// 设置展品自定义属性
|
|
231
|
+
interface UpdateRewritePropertyParamsType {
|
|
232
|
+
presentableId: string;
|
|
233
|
+
rewriteProperty: {
|
|
234
|
+
key: string;
|
|
235
|
+
value: string;
|
|
236
|
+
remark: string;
|
|
237
|
+
}[];
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export function updateRewriteProperty({presentableId, ...params}: UpdateRewritePropertyParamsType) {
|
|
241
|
+
// return FUtil.Axios.put(`/v2/presentables/${presentableId}/rewriteProperty`, params);
|
|
242
|
+
return FUtil.Request({
|
|
243
|
+
method: 'PUT',
|
|
244
|
+
url: `/v2/presentables/${presentableId}/rewriteProperty`,
|
|
245
|
+
data: params,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// 批量获取展品授权结果
|
|
250
|
+
interface BatchAuthParamsType {
|
|
251
|
+
nodeId: number;
|
|
252
|
+
authType: 1 | 2 | 3; // 1:节点侧授权 2:资源侧授权 3:节点+资源侧授权
|
|
253
|
+
presentableIds: string;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export function batchAuth({nodeId, ...params}: BatchAuthParamsType) {
|
|
257
|
+
// return FUtil.Axios.get(`/v2/auths/presentables/nodes/${nodeId}/batchAuth/result`, {
|
|
258
|
+
// params,
|
|
259
|
+
// });
|
|
260
|
+
return FUtil.Request({
|
|
261
|
+
method: 'GET',
|
|
262
|
+
url: `/v2/auths/presentables/nodes/${nodeId}/batchAuth/result`,
|
|
263
|
+
params: params,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// 查看合约应用的展品列表
|
|
268
|
+
interface ContractAppliedPresentableParamsType {
|
|
269
|
+
nodeId: number;
|
|
270
|
+
contractIds: string;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export function contractAppliedPresentable({nodeId, ...params}: ContractAppliedPresentableParamsType) {
|
|
274
|
+
// return FUtil.Axios.get(`/v2/presentables/${nodeId}/contractAppliedPresentable`, {
|
|
275
|
+
// params,
|
|
276
|
+
// });
|
|
277
|
+
return FUtil.Request({
|
|
278
|
+
method: 'GET',
|
|
279
|
+
url: `/v2/presentables/${nodeId}/contractAppliedPresentable`,
|
|
280
|
+
params: params,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
@@ -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)}`,
|
|
@@ -95,14 +88,12 @@ interface BatchInfoParamsType {
|
|
|
95
88
|
resourceIds?: string;
|
|
96
89
|
resourceNames?: string;
|
|
97
90
|
isLoadPolicyInfo?: 0 | 1;
|
|
91
|
+
isTranslate?: 0 | 1;
|
|
98
92
|
isLoadLatestVersionInfo?: 0 | 1;
|
|
99
93
|
projection?: string;
|
|
100
94
|
}
|
|
101
95
|
|
|
102
96
|
export function batchInfo(params: BatchInfoParamsType) {
|
|
103
|
-
// return FUtil.Axios.get(`/v2/resources/list`, {
|
|
104
|
-
// params: params,
|
|
105
|
-
// });
|
|
106
97
|
return FUtil.Request({
|
|
107
98
|
method: 'GET',
|
|
108
99
|
url: `/v2/resources/list`,
|
|
@@ -120,9 +111,6 @@ interface DependencyTreeParamsType {
|
|
|
120
111
|
}
|
|
121
112
|
|
|
122
113
|
export function dependencyTree({resourceId, ...params}: DependencyTreeParamsType) {
|
|
123
|
-
// return FUtil.Axios.get(`/v2/resources/${resourceId}/dependencyTree`, {
|
|
124
|
-
// params: params,
|
|
125
|
-
// });
|
|
126
114
|
return FUtil.Request({
|
|
127
115
|
method: 'GET',
|
|
128
116
|
url: `/v2/resources/${resourceId}/dependencyTree`,
|
|
@@ -137,9 +125,6 @@ interface AuthTreeParamsType {
|
|
|
137
125
|
}
|
|
138
126
|
|
|
139
127
|
export function authTree({resourceId, ...params}: AuthTreeParamsType) {
|
|
140
|
-
// return FUtil.Axios.get(`/v2/resources/${resourceId}/authTree`, {
|
|
141
|
-
// params: params,
|
|
142
|
-
// });
|
|
143
128
|
return FUtil.Request({
|
|
144
129
|
method: 'GET',
|
|
145
130
|
url: `/v2/resources/${resourceId}/authTree`,
|
|
@@ -198,13 +183,7 @@ interface ResourceVersionInfoParamsType2 {
|
|
|
198
183
|
}
|
|
199
184
|
|
|
200
185
|
export function resourceVersionInfo(params: ResourceVersionInfoParamsType1 | ResourceVersionInfoParamsType2) {
|
|
201
|
-
// console.log('####!AAA');
|
|
202
186
|
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
187
|
return FUtil.Request({
|
|
209
188
|
method: 'GET',
|
|
210
189
|
url: `/v2/resources/${(params as ResourceVersionInfoParamsType1).resourceId}/versions/${(params as ResourceVersionInfoParamsType1).version}`,
|
|
@@ -212,9 +191,6 @@ export function resourceVersionInfo(params: ResourceVersionInfoParamsType1 | Res
|
|
|
212
191
|
});
|
|
213
192
|
}
|
|
214
193
|
|
|
215
|
-
// return FUtil.Axios.get(`/v2/resources/versions/detail`, {
|
|
216
|
-
// params,
|
|
217
|
-
// });
|
|
218
194
|
return FUtil.Request({
|
|
219
195
|
method: 'GET',
|
|
220
196
|
url: `/v2/resources/versions/detail`,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type ContractStatus = 'active' | 'testActive' | 'inactive' | 'terminal';
|