@freelog/tools-lib 0.1.183 → 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,605 +1,605 @@
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
- batchSignContracts?: {
15
- resourceId: string;
16
- subjectType: number;
17
- policyIds: string[];
18
- }[];
19
- presentableName: string;
20
- presentableTitle?: string;
21
- tags?: string[];
22
- policies?: {
23
- policyName: string;
24
- policyText: string;
25
- status?: 0 | 1;
26
- }[];
27
- }
28
-
29
- export function createPresentable(params: CreatePresentableParamsType) {
30
- return FUtil.Request({
31
- method: 'POST',
32
- url: `/v2/presentables`,
33
- data: params,
34
- });
35
- }
36
-
37
- // 更新展品
38
- interface UpdatePresentableParamsType {
39
- presentableId: string;
40
- presentableTitle?: string;
41
- presentableIntro?: string;
42
- tags?: string[];
43
- coverImages?: string[];
44
- addPolicies?: {
45
- policyName: string;
46
- policyText: string;
47
- status?: 0 | 1;
48
- }[];
49
- updatePolicies?: {
50
- policyId: string;
51
- status: 0 | 1;
52
- }[];
53
- resolveResources?: {
54
- resourceId: string;
55
- contracts: {
56
- policyId: string;
57
- }[];
58
- }[];
59
- autoUpdateStatus?: 0 | 1;
60
- }
61
-
62
- export function updatePresentable({
63
- presentableId,
64
- ...params
65
- }: UpdatePresentableParamsType) {
66
- return FUtil.Request({
67
- method: 'PUT',
68
- url: `/v2/presentables/${presentableId}`,
69
- data: params,
70
- });
71
- }
72
-
73
- // 上下线presentable
74
- interface PresentablesOnlineParamsType {
75
- presentableId: string;
76
- onlineStatus: 0 | 1;
77
- updatePolicies?: {
78
- policyId: string;
79
- status: 0 | 1;
80
- };
81
- }
82
-
83
- export function presentablesOnlineStatus({
84
- presentableId,
85
- ...params
86
- }: PresentablesOnlineParamsType) {
87
- return FUtil.Request({
88
- method: 'PUT',
89
- url: `/v2/presentables/${presentableId}/onlineStatus`,
90
- data: params,
91
- });
92
- }
93
-
94
- // 查看展品详情
95
- interface PresentableDetailsParamsType1 {
96
- presentableId: string;
97
- projection?: string;
98
- isLoadVersionProperty?: 0 | 1;
99
- isLoadPolicyInfo?: 0 | 1;
100
- isTranslate?: 0 | 1;
101
- isLoadCustomPropertyDescriptors?: 0 | 1;
102
- isLoadResourceDetailInfo?: 0 | 1;
103
- isLoadResourceVersionInfo?: 0 | 1;
104
- }
105
-
106
- interface PresentableDetailsParamsType2 {
107
- nodeId: number;
108
- resourceId?: string;
109
- resourceName?: string;
110
- presentableName?: string;
111
- projection?: string;
112
- isLoadVersionProperty?: 0 | 1;
113
- isLoadPolicyInfo?: 0 | 1;
114
- isLoadCustomPropertyDescriptors?: 0 | 1;
115
- }
116
-
117
- export function presentableDetails(
118
- params: PresentableDetailsParamsType1 | PresentableDetailsParamsType2
119
- ) {
120
- if ((params as PresentableDetailsParamsType2).nodeId) {
121
- return FUtil.Request({
122
- method: 'GET',
123
- url: `/v2/presentables/detail`,
124
- params: params,
125
- });
126
- }
127
- const { presentableId, ...p } = params as PresentableDetailsParamsType1;
128
- return FUtil.Request({
129
- method: 'GET',
130
- url: `/v2/presentables/${presentableId}`,
131
- params: p,
132
- });
133
- }
134
-
135
- // 查询展品分页列表
136
- interface PresentablesParamsType {
137
- nodeId: number;
138
- skip?: number;
139
- limit?: number;
140
- resourceType?: string;
141
- resourceTypeCode?: string;
142
- omitResourceType?: string;
143
- onlineStatus?: number;
144
- tags?: string;
145
- projection?: string;
146
- keywords?: string;
147
- isLoadVersionProperty?: 0 | 1;
148
- isLoadPolicyInfo?: 0 | 1;
149
- isLoadResourceDetailInfo?: 0 | 1;
150
- isLoadVersionUpdateTip?: 0 | 1;
151
- subjectType?: 1 | 4 | 5;
152
- }
153
-
154
- export function presentables(params: PresentablesParamsType) {
155
- return FUtil.Request({
156
- method: 'GET',
157
- url: `/v2/presentables`,
158
- params: params,
159
- });
160
- }
161
-
162
- // 批量查询展品列表
163
- interface PresentableListParamsType {
164
- nodeId?: number;
165
- userId?: number;
166
- presentableIds?: string;
167
- resourceIds?: string;
168
- resourceNames?: string;
169
- isLoadVersionProperty?: 0 | 1;
170
- isLoadPolicyInfo?: 0 | 1;
171
- isTranslate?: 0 | 1;
172
- projection?: string;
173
- resolveResourceIds?: string;
174
- }
175
-
176
- export function presentableList(params: PresentableListParamsType) {
177
- return FUtil.Request({
178
- method: 'GET',
179
- url: `/v2/presentables/list`,
180
- params: params,
181
- });
182
- }
183
-
184
- // 查看展品依赖树
185
- interface DependencyTreeParamsType {
186
- presentableId: string;
187
- maxDeep?: number;
188
- nid?: string;
189
- isContainRootNode?: boolean;
190
- version?: string;
191
- }
192
-
193
- export function dependencyTree({
194
- presentableId,
195
- ...params
196
- }: DependencyTreeParamsType) {
197
- return FUtil.Request({
198
- method: 'GET',
199
- url: `/v2/presentables/${presentableId}/dependencyTree`,
200
- params: params,
201
- });
202
- }
203
-
204
- // 查看展品关系树
205
- interface RelationTreeParamsType {
206
- presentableId: string;
207
- version?: string;
208
- }
209
-
210
- export function relationTree({
211
- presentableId,
212
- ...params
213
- }: RelationTreeParamsType) {
214
- return FUtil.Request({
215
- method: 'GET',
216
- url: `/v2/presentables/${presentableId}/relationTree`,
217
- params: params,
218
- });
219
- }
220
-
221
- // 查看展品授权树
222
- interface AuthTreeParamsType {
223
- presentableId: string;
224
- maxDeep?: number;
225
- nid?: string;
226
- isContainRootNode?: boolean;
227
- version?: string;
228
- }
229
-
230
- export function authTree({ presentableId, ...params }: AuthTreeParamsType) {
231
- return FUtil.Request({
232
- method: 'GET',
233
- url: `/v2/presentables/${presentableId}/authTree`,
234
- params: params,
235
- });
236
- }
237
-
238
- // 切换展品版本
239
- interface PresentablesVersionParamsType {
240
- presentableId: string;
241
- version: string;
242
- }
243
-
244
- export function presentablesVersion({
245
- presentableId,
246
- ...params
247
- }: PresentablesVersionParamsType) {
248
- return FUtil.Request({
249
- method: 'PUT',
250
- url: `/v2/presentables/${presentableId}/version`,
251
- data: params,
252
- });
253
- }
254
-
255
- // 设置展品自定义属性
256
- interface UpdateRewritePropertyParamsType {
257
- presentableId: string;
258
- rewriteProperty: {
259
- key: string;
260
- value: string;
261
- remark: string;
262
- }[];
263
- }
264
-
265
- export function updateRewriteProperty({
266
- presentableId,
267
- ...params
268
- }: UpdateRewritePropertyParamsType) {
269
- return FUtil.Request({
270
- method: 'PUT',
271
- url: `/v2/presentables/${presentableId}/rewriteProperty`,
272
- data: params,
273
- });
274
- }
275
-
276
- // 批量获取展品授权结果
277
- interface BatchAuthParamsType {
278
- nodeId: number;
279
- authType: 1 | 2 | 3; // 1:节点侧授权 2:资源侧授权 3:节点+资源侧授权
280
- presentableIds: string;
281
- }
282
-
283
- export function batchAuth({ nodeId, ...params }: BatchAuthParamsType) {
284
- return FUtil.Request({
285
- method: 'GET',
286
- url: `/v2/auths/presentables/nodes/${nodeId}/batchAuth/result`,
287
- params: params,
288
- });
289
- }
290
-
291
- // 查看合约应用的展品列表
292
- interface ContractAppliedPresentableParamsType {
293
- nodeId: number;
294
- contractIds: string;
295
- }
296
-
297
- export function contractAppliedPresentable({
298
- nodeId,
299
- ...params
300
- }: ContractAppliedPresentableParamsType) {
301
- return FUtil.Request({
302
- method: 'GET',
303
- url: `/v2/presentables/${nodeId}/contractAppliedPresentable`,
304
- params: params,
305
- });
306
- }
307
-
308
- // 一键批量创建展品
309
- export interface BatchCreatePresentableParamsType {
310
- nodeId: number;
311
- resources: {
312
- resourceId: string;
313
- policyId?: string;
314
- }[];
315
- }
316
-
317
- export function batchCreatePresentable(
318
- params: BatchCreatePresentableParamsType
319
- ) {
320
- return FUtil.Request({
321
- method: 'POST',
322
- url: `/v2/presentables/createPresentableBatchEasy`,
323
- data: params,
324
- });
325
- }
326
-
327
- // 批量更新展品
328
- interface BatchUpdatePresentableParamsType {
329
- presentableIds: string[];
330
- addPolicies: {
331
- policyName: string;
332
- policyText: string;
333
- status?: 0 | 1;
334
- }[];
335
- }
336
-
337
- export function batchUpdatePresentable({
338
- ...params
339
- }: BatchUpdatePresentableParamsType) {
340
- return FUtil.Request({
341
- method: 'PUT',
342
- url: `/v2/presentables/updatePresentableBatch`,
343
- data: params,
344
- });
345
- }
346
-
347
- // 批量切换展品上下线状态
348
- interface BatchUpdatePresentableStatusParamsType {
349
- presentableIds: string[];
350
- onlineStatus: 0 | 1;
351
- }
352
-
353
- export function batchUpdatePresentableStatus({
354
- ...params
355
- }: BatchUpdatePresentableStatusParamsType) {
356
- return FUtil.Request({
357
- method: 'PUT',
358
- url: `/v2/presentables/updatePresentableOnlineStatusBatch`,
359
- data: params,
360
- });
361
- }
362
-
363
- // 忽略展品更新提醒
364
- interface IgnorePresentableVersionUpdateTipParamsType {
365
- presentableId: string;
366
- ignoreVersion: string;
367
- }
368
-
369
- export function ignorePresentableVersionUpdateTip({
370
- presentableId,
371
- ...params
372
- }: IgnorePresentableVersionUpdateTipParamsType) {
373
- return FUtil.Request({
374
- method: 'POST',
375
- url: `/v2/presentables/${presentableId}/ignorePresentableVersionUpdateTip`,
376
- data: params,
377
- });
378
- }
379
-
380
- // 创建展品合集
381
- interface CreatePresentableCollectionParamsType {
382
- nodeId: number;
383
- presentableName: string;
384
- presentableTitle?: string;
385
- policies?: {
386
- policyName: string;
387
- policyText: string;
388
- status: 0 | 1;
389
- }[];
390
- tags?: string[];
391
- coverImages?: string[];
392
- resourceTypeCode?: string;
393
- }
394
-
395
- export function createPresentableCollection({
396
- ...params
397
- }: CreatePresentableCollectionParamsType) {
398
- return FUtil.Request({
399
- method: 'POST',
400
- url: `/v2/presentables/catalogues`,
401
- data: params,
402
- });
403
- }
404
-
405
- // 更新展品合集
406
- interface UpdatePresentableCollectionParamsType {
407
- presentableId: string;
408
- catalogueProperty?: {
409
- collection_sort_list:
410
- | 'collection_sort_ascending'
411
- | 'collection_sort_descending';
412
- };
413
- }
414
-
415
- export function updatePresentableCollection({
416
- presentableId,
417
- ...params
418
- }: UpdatePresentableCollectionParamsType) {
419
- return FUtil.Request({
420
- method: 'PUT',
421
- url: `/v2/presentables/catalogues/${presentableId}`,
422
- data: params,
423
- });
424
- }
425
-
426
- // 批量为展品合集添加单品
427
- interface AddItemsToPresentableCollectionParamsType {
428
- presentableId: string;
429
- addCollectionItems: {
430
- presentableId: string;
431
- }[];
432
- }
433
-
434
- export function addItemsToPresentableCollection({
435
- presentableId,
436
- ...params
437
- }: AddItemsToPresentableCollectionParamsType) {
438
- return FUtil.Request({
439
- method: 'POST',
440
- url: `/v2/presentables/catalogues/${presentableId}/items`,
441
- data: params,
442
- });
443
- }
444
-
445
- // 批量从展品合集中移除单品
446
- interface RemoveItemsFromPresentableCollectionParamsType {
447
- presentableId: string;
448
- removeIds: string;
449
- idType?: 'resourceId' | 'presentableId' | 'itemId';
450
- }
451
-
452
- export function removeItemsFromPresentableCollection({
453
- presentableId,
454
- ...params
455
- }: RemoveItemsFromPresentableCollectionParamsType) {
456
- return FUtil.Request({
457
- method: 'DELETE',
458
- url: `/v2/presentables/catalogues/${presentableId}/items`,
459
- params: params,
460
- });
461
- }
462
-
463
- // 查询展品合集中的单品分页列表
464
- interface GetItemsFromPresentableCollectionParamsType {
465
- presentableId: string;
466
- isLoadLatestVersionInfo?: 0 | 1;
467
- skip?: number;
468
- limit?: number;
469
- keywords?: string;
470
- sortField?: 'createDate' | 'sortId';
471
- sortType?: -1 | 1;
472
- }
473
-
474
- export function getItemsFromPresentableCollection({
475
- presentableId,
476
- ...params
477
- }: GetItemsFromPresentableCollectionParamsType) {
478
- return FUtil.Request({
479
- method: 'GET',
480
- url: `/v2/presentables/catalogues/${presentableId}/items`,
481
- params: params,
482
- });
483
- }
484
-
485
- // 查询展品合集中的是否存在指定单品
486
- interface GetItemsFromPresentableCollectionIsExistParamsType {
487
- presentableId: string;
488
- mountIds: string;
489
- idType?: 'resourceId' | 'presentableId';
490
- }
491
-
492
- export function getItemsFromPresentableCollectionIsExist({
493
- presentableId,
494
- ...params
495
- }: GetItemsFromPresentableCollectionIsExistParamsType) {
496
- return FUtil.Request({
497
- method: 'GET',
498
- url: `/v2/presentables/catalogues/${presentableId}/items/checkExists`,
499
- params: params,
500
- });
501
- }
502
-
503
- // 设置展品合集中的单品排序-手动排序
504
- interface SetItemsSortFromPresentableCollectionManualParamsType {
505
- presentableId: string;
506
- itemIds: string[];
507
- targetSortId: number;
508
- }
509
-
510
- export function setItemsSortFromPresentableCollectionManual({
511
- presentableId,
512
- ...params
513
- }: SetItemsSortFromPresentableCollectionManualParamsType) {
514
- return FUtil.Request({
515
- method: 'PUT',
516
- url: `/v2/presentables/catalogues/${presentableId}/manualSort`,
517
- data: params,
518
- });
519
- }
520
-
521
- // 设置展品合集中的单品排序-快速排序
522
- interface SetItemsSortFromPresentableCollectionQuickParamsType {
523
- presentableId: string;
524
- sortField:
525
- | 'createDate'
526
- | 'itemTitle'
527
- | 'sortId'
528
- | 'resourceFirstVersionReleaseDate';
529
- sortType: 1 | -1;
530
- }
531
-
532
- export function setItemsSortFromPresentableCollectionQuick({
533
- presentableId,
534
- ...params
535
- }: SetItemsSortFromPresentableCollectionQuickParamsType) {
536
- return FUtil.Request({
537
- method: 'PUT',
538
- url: `/v2/presentables/catalogues/${presentableId}/reorder`,
539
- data: params,
540
- });
541
- }
542
-
543
- // 获取合集单品自动收录规则
544
- interface GetItemsAutoCollectRuleParamsType {
545
- presentableId: string;
546
- }
547
-
548
- export function getItemsAutoCollectRule({
549
- presentableId,
550
- }: // ...params
551
- GetItemsAutoCollectRuleParamsType) {
552
- return FUtil.Request({
553
- method: 'GET',
554
- url: `/v2/presentables/catalogues/${presentableId}/items/collectRules`,
555
- // params: params,
556
- });
557
- }
558
-
559
- // 创建或更新合集单品自动收录规则
560
- interface SetItemsAutoCollectRuleParamsType {
561
- presentableId: string;
562
- status: 0 | 1;
563
- conditionType: 1 | 2;
564
- filterConditions: {
565
- key: 'presentableTitle' | 'resourceTypeCode' | 'authIdentity';
566
- limitOperatorType:
567
- | 'INCLUDES'
568
- | 'NOT_INCLUDES'
569
- | 'STARTS_WITH'
570
- | 'ENDS_WITH'
571
- | 'EQUAL'
572
- | 'NOT_EQUAL';
573
- value: string;
574
- }[];
575
- }
576
-
577
- export function setItemsAutoCollectRule({
578
- presentableId,
579
- ...params
580
- }: SetItemsAutoCollectRuleParamsType) {
581
- return FUtil.Request({
582
- method: 'POST',
583
- url: `/v2/presentables/catalogues/${presentableId}/items/collectRules`,
584
- data: params,
585
- });
586
- }
587
-
588
- // 批量查询展品合集下的单品
589
- interface GetItemsFromPresentableCollectionsParamsType {
590
- presentableIds: string;
591
- sortType?: 1 | -1;
592
- sortField?: 'createDate';
593
- limit?: number;
594
- }
595
-
596
- export function getItemsFromPresentableCollections({
597
- ...params
598
- }: GetItemsFromPresentableCollectionsParamsType) {
599
- return FUtil.Request({
600
- method: 'GET',
601
- // url: `/v2/presentables/catalogues/items/batch/list?presentableIds=685cf423e1502e002fe3053b&limit=1&sortType=-1&sortField=createDate`,
602
- url: `/v2/presentables/catalogues/items/batch/list`,
603
- params: params,
604
- });
605
- }
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
+ batchSignContracts?: {
15
+ resourceId: string;
16
+ subjectType: number;
17
+ policyIds: string[];
18
+ }[];
19
+ presentableName: string;
20
+ presentableTitle?: string;
21
+ tags?: string[];
22
+ policies?: {
23
+ policyName: string;
24
+ policyText: string;
25
+ status?: 0 | 1;
26
+ }[];
27
+ }
28
+
29
+ export function createPresentable(params: CreatePresentableParamsType) {
30
+ return FUtil.Request({
31
+ method: 'POST',
32
+ url: `/v2/presentables`,
33
+ data: params,
34
+ });
35
+ }
36
+
37
+ // 更新展品
38
+ interface UpdatePresentableParamsType {
39
+ presentableId: string;
40
+ presentableTitle?: string;
41
+ presentableIntro?: string;
42
+ tags?: string[];
43
+ coverImages?: string[];
44
+ addPolicies?: {
45
+ policyName: string;
46
+ policyText: string;
47
+ status?: 0 | 1;
48
+ }[];
49
+ updatePolicies?: {
50
+ policyId: string;
51
+ status: 0 | 1;
52
+ }[];
53
+ resolveResources?: {
54
+ resourceId: string;
55
+ contracts: {
56
+ policyId: string;
57
+ }[];
58
+ }[];
59
+ autoUpdateStatus?: 0 | 1;
60
+ }
61
+
62
+ export function updatePresentable({
63
+ presentableId,
64
+ ...params
65
+ }: UpdatePresentableParamsType) {
66
+ return FUtil.Request({
67
+ method: 'PUT',
68
+ url: `/v2/presentables/${presentableId}`,
69
+ data: params,
70
+ });
71
+ }
72
+
73
+ // 上下线presentable
74
+ interface PresentablesOnlineParamsType {
75
+ presentableId: string;
76
+ onlineStatus: 0 | 1;
77
+ updatePolicies?: {
78
+ policyId: string;
79
+ status: 0 | 1;
80
+ };
81
+ }
82
+
83
+ export function presentablesOnlineStatus({
84
+ presentableId,
85
+ ...params
86
+ }: PresentablesOnlineParamsType) {
87
+ return FUtil.Request({
88
+ method: 'PUT',
89
+ url: `/v2/presentables/${presentableId}/onlineStatus`,
90
+ data: params,
91
+ });
92
+ }
93
+
94
+ // 查看展品详情
95
+ interface PresentableDetailsParamsType1 {
96
+ presentableId: string;
97
+ projection?: string;
98
+ isLoadVersionProperty?: 0 | 1;
99
+ isLoadPolicyInfo?: 0 | 1;
100
+ isTranslate?: 0 | 1;
101
+ isLoadCustomPropertyDescriptors?: 0 | 1;
102
+ isLoadResourceDetailInfo?: 0 | 1;
103
+ isLoadResourceVersionInfo?: 0 | 1;
104
+ }
105
+
106
+ interface PresentableDetailsParamsType2 {
107
+ nodeId: number;
108
+ resourceId?: string;
109
+ resourceName?: string;
110
+ presentableName?: string;
111
+ projection?: string;
112
+ isLoadVersionProperty?: 0 | 1;
113
+ isLoadPolicyInfo?: 0 | 1;
114
+ isLoadCustomPropertyDescriptors?: 0 | 1;
115
+ }
116
+
117
+ export function presentableDetails(
118
+ params: PresentableDetailsParamsType1 | PresentableDetailsParamsType2
119
+ ) {
120
+ if ((params as PresentableDetailsParamsType2).nodeId) {
121
+ return FUtil.Request({
122
+ method: 'GET',
123
+ url: `/v2/presentables/detail`,
124
+ params: params,
125
+ });
126
+ }
127
+ const { presentableId, ...p } = params as PresentableDetailsParamsType1;
128
+ return FUtil.Request({
129
+ method: 'GET',
130
+ url: `/v2/presentables/${presentableId}`,
131
+ params: p,
132
+ });
133
+ }
134
+
135
+ // 查询展品分页列表
136
+ interface PresentablesParamsType {
137
+ nodeId: number;
138
+ skip?: number;
139
+ limit?: number;
140
+ resourceType?: string;
141
+ resourceTypeCode?: string;
142
+ omitResourceType?: string;
143
+ onlineStatus?: number;
144
+ tags?: string;
145
+ projection?: string;
146
+ keywords?: string;
147
+ isLoadVersionProperty?: 0 | 1;
148
+ isLoadPolicyInfo?: 0 | 1;
149
+ isLoadResourceDetailInfo?: 0 | 1;
150
+ isLoadVersionUpdateTip?: 0 | 1;
151
+ subjectType?: 1 | 4 | 5;
152
+ }
153
+
154
+ export function presentables(params: PresentablesParamsType) {
155
+ return FUtil.Request({
156
+ method: 'GET',
157
+ url: `/v2/presentables`,
158
+ params: params,
159
+ });
160
+ }
161
+
162
+ // 批量查询展品列表
163
+ interface PresentableListParamsType {
164
+ nodeId?: number;
165
+ userId?: number;
166
+ presentableIds?: string;
167
+ resourceIds?: string;
168
+ resourceNames?: string;
169
+ isLoadVersionProperty?: 0 | 1;
170
+ isLoadPolicyInfo?: 0 | 1;
171
+ isTranslate?: 0 | 1;
172
+ projection?: string;
173
+ resolveResourceIds?: string;
174
+ }
175
+
176
+ export function presentableList(params: PresentableListParamsType) {
177
+ return FUtil.Request({
178
+ method: 'GET',
179
+ url: `/v2/presentables/list`,
180
+ params: params,
181
+ });
182
+ }
183
+
184
+ // 查看展品依赖树
185
+ interface DependencyTreeParamsType {
186
+ presentableId: string;
187
+ maxDeep?: number;
188
+ nid?: string;
189
+ isContainRootNode?: boolean;
190
+ version?: string;
191
+ }
192
+
193
+ export function dependencyTree({
194
+ presentableId,
195
+ ...params
196
+ }: DependencyTreeParamsType) {
197
+ return FUtil.Request({
198
+ method: 'GET',
199
+ url: `/v2/presentables/${presentableId}/dependencyTree`,
200
+ params: params,
201
+ });
202
+ }
203
+
204
+ // 查看展品关系树
205
+ interface RelationTreeParamsType {
206
+ presentableId: string;
207
+ version?: string;
208
+ }
209
+
210
+ export function relationTree({
211
+ presentableId,
212
+ ...params
213
+ }: RelationTreeParamsType) {
214
+ return FUtil.Request({
215
+ method: 'GET',
216
+ url: `/v2/presentables/${presentableId}/relationTree`,
217
+ params: params,
218
+ });
219
+ }
220
+
221
+ // 查看展品授权树
222
+ interface AuthTreeParamsType {
223
+ presentableId: string;
224
+ maxDeep?: number;
225
+ nid?: string;
226
+ isContainRootNode?: boolean;
227
+ version?: string;
228
+ }
229
+
230
+ export function authTree({ presentableId, ...params }: AuthTreeParamsType) {
231
+ return FUtil.Request({
232
+ method: 'GET',
233
+ url: `/v2/presentables/${presentableId}/authTree`,
234
+ params: params,
235
+ });
236
+ }
237
+
238
+ // 切换展品版本
239
+ interface PresentablesVersionParamsType {
240
+ presentableId: string;
241
+ version: string;
242
+ }
243
+
244
+ export function presentablesVersion({
245
+ presentableId,
246
+ ...params
247
+ }: PresentablesVersionParamsType) {
248
+ return FUtil.Request({
249
+ method: 'PUT',
250
+ url: `/v2/presentables/${presentableId}/version`,
251
+ data: params,
252
+ });
253
+ }
254
+
255
+ // 设置展品自定义属性
256
+ interface UpdateRewritePropertyParamsType {
257
+ presentableId: string;
258
+ rewriteProperty: {
259
+ key: string;
260
+ value: string;
261
+ remark: string;
262
+ }[];
263
+ }
264
+
265
+ export function updateRewriteProperty({
266
+ presentableId,
267
+ ...params
268
+ }: UpdateRewritePropertyParamsType) {
269
+ return FUtil.Request({
270
+ method: 'PUT',
271
+ url: `/v2/presentables/${presentableId}/rewriteProperty`,
272
+ data: params,
273
+ });
274
+ }
275
+
276
+ // 批量获取展品授权结果
277
+ interface BatchAuthParamsType {
278
+ nodeId: number;
279
+ authType: 1 | 2 | 3; // 1:节点侧授权 2:资源侧授权 3:节点+资源侧授权
280
+ presentableIds: string;
281
+ }
282
+
283
+ export function batchAuth({ nodeId, ...params }: BatchAuthParamsType) {
284
+ return FUtil.Request({
285
+ method: 'GET',
286
+ url: `/v2/auths/presentables/nodes/${nodeId}/batchAuth/result`,
287
+ params: params,
288
+ });
289
+ }
290
+
291
+ // 查看合约应用的展品列表
292
+ interface ContractAppliedPresentableParamsType {
293
+ nodeId: number;
294
+ contractIds: string;
295
+ }
296
+
297
+ export function contractAppliedPresentable({
298
+ nodeId,
299
+ ...params
300
+ }: ContractAppliedPresentableParamsType) {
301
+ return FUtil.Request({
302
+ method: 'GET',
303
+ url: `/v2/presentables/${nodeId}/contractAppliedPresentable`,
304
+ params: params,
305
+ });
306
+ }
307
+
308
+ // 一键批量创建展品
309
+ export interface BatchCreatePresentableParamsType {
310
+ nodeId: number;
311
+ resources: {
312
+ resourceId: string;
313
+ policyId?: string;
314
+ }[];
315
+ }
316
+
317
+ export function batchCreatePresentable(
318
+ params: BatchCreatePresentableParamsType
319
+ ) {
320
+ return FUtil.Request({
321
+ method: 'POST',
322
+ url: `/v2/presentables/createPresentableBatchEasy`,
323
+ data: params,
324
+ });
325
+ }
326
+
327
+ // 批量更新展品
328
+ interface BatchUpdatePresentableParamsType {
329
+ presentableIds: string[];
330
+ addPolicies: {
331
+ policyName: string;
332
+ policyText: string;
333
+ status?: 0 | 1;
334
+ }[];
335
+ }
336
+
337
+ export function batchUpdatePresentable({
338
+ ...params
339
+ }: BatchUpdatePresentableParamsType) {
340
+ return FUtil.Request({
341
+ method: 'PUT',
342
+ url: `/v2/presentables/updatePresentableBatch`,
343
+ data: params,
344
+ });
345
+ }
346
+
347
+ // 批量切换展品上下线状态
348
+ interface BatchUpdatePresentableStatusParamsType {
349
+ presentableIds: string[];
350
+ onlineStatus: 0 | 1;
351
+ }
352
+
353
+ export function batchUpdatePresentableStatus({
354
+ ...params
355
+ }: BatchUpdatePresentableStatusParamsType) {
356
+ return FUtil.Request({
357
+ method: 'PUT',
358
+ url: `/v2/presentables/updatePresentableOnlineStatusBatch`,
359
+ data: params,
360
+ });
361
+ }
362
+
363
+ // 忽略展品更新提醒
364
+ interface IgnorePresentableVersionUpdateTipParamsType {
365
+ presentableId: string;
366
+ ignoreVersion: string;
367
+ }
368
+
369
+ export function ignorePresentableVersionUpdateTip({
370
+ presentableId,
371
+ ...params
372
+ }: IgnorePresentableVersionUpdateTipParamsType) {
373
+ return FUtil.Request({
374
+ method: 'POST',
375
+ url: `/v2/presentables/${presentableId}/ignorePresentableVersionUpdateTip`,
376
+ data: params,
377
+ });
378
+ }
379
+
380
+ // 创建展品合集
381
+ interface CreatePresentableCollectionParamsType {
382
+ nodeId: number;
383
+ presentableName: string;
384
+ presentableTitle?: string;
385
+ policies?: {
386
+ policyName: string;
387
+ policyText: string;
388
+ status: 0 | 1;
389
+ }[];
390
+ tags?: string[];
391
+ coverImages?: string[];
392
+ resourceTypeCode?: string;
393
+ }
394
+
395
+ export function createPresentableCollection({
396
+ ...params
397
+ }: CreatePresentableCollectionParamsType) {
398
+ return FUtil.Request({
399
+ method: 'POST',
400
+ url: `/v2/presentables/catalogues`,
401
+ data: params,
402
+ });
403
+ }
404
+
405
+ // 更新展品合集
406
+ interface UpdatePresentableCollectionParamsType {
407
+ presentableId: string;
408
+ catalogueProperty?: {
409
+ collection_sort_list:
410
+ | 'collection_sort_ascending'
411
+ | 'collection_sort_descending';
412
+ };
413
+ }
414
+
415
+ export function updatePresentableCollection({
416
+ presentableId,
417
+ ...params
418
+ }: UpdatePresentableCollectionParamsType) {
419
+ return FUtil.Request({
420
+ method: 'PUT',
421
+ url: `/v2/presentables/catalogues/${presentableId}`,
422
+ data: params,
423
+ });
424
+ }
425
+
426
+ // 批量为展品合集添加单品
427
+ interface AddItemsToPresentableCollectionParamsType {
428
+ presentableId: string;
429
+ addCollectionItems: {
430
+ presentableId: string;
431
+ }[];
432
+ }
433
+
434
+ export function addItemsToPresentableCollection({
435
+ presentableId,
436
+ ...params
437
+ }: AddItemsToPresentableCollectionParamsType) {
438
+ return FUtil.Request({
439
+ method: 'POST',
440
+ url: `/v2/presentables/catalogues/${presentableId}/items`,
441
+ data: params,
442
+ });
443
+ }
444
+
445
+ // 批量从展品合集中移除单品
446
+ interface RemoveItemsFromPresentableCollectionParamsType {
447
+ presentableId: string;
448
+ removeIds: string;
449
+ idType?: 'resourceId' | 'presentableId' | 'itemId';
450
+ }
451
+
452
+ export function removeItemsFromPresentableCollection({
453
+ presentableId,
454
+ ...params
455
+ }: RemoveItemsFromPresentableCollectionParamsType) {
456
+ return FUtil.Request({
457
+ method: 'DELETE',
458
+ url: `/v2/presentables/catalogues/${presentableId}/items`,
459
+ params: params,
460
+ });
461
+ }
462
+
463
+ // 查询展品合集中的单品分页列表
464
+ interface GetItemsFromPresentableCollectionParamsType {
465
+ presentableId: string;
466
+ isLoadLatestVersionInfo?: 0 | 1;
467
+ skip?: number;
468
+ limit?: number;
469
+ keywords?: string;
470
+ sortField?: 'createDate' | 'sortId';
471
+ sortType?: -1 | 1;
472
+ }
473
+
474
+ export function getItemsFromPresentableCollection({
475
+ presentableId,
476
+ ...params
477
+ }: GetItemsFromPresentableCollectionParamsType) {
478
+ return FUtil.Request({
479
+ method: 'GET',
480
+ url: `/v2/presentables/catalogues/${presentableId}/items`,
481
+ params: params,
482
+ });
483
+ }
484
+
485
+ // 查询展品合集中的是否存在指定单品
486
+ interface GetItemsFromPresentableCollectionIsExistParamsType {
487
+ presentableId: string;
488
+ mountIds: string;
489
+ idType?: 'resourceId' | 'presentableId';
490
+ }
491
+
492
+ export function getItemsFromPresentableCollectionIsExist({
493
+ presentableId,
494
+ ...params
495
+ }: GetItemsFromPresentableCollectionIsExistParamsType) {
496
+ return FUtil.Request({
497
+ method: 'GET',
498
+ url: `/v2/presentables/catalogues/${presentableId}/items/checkExists`,
499
+ params: params,
500
+ });
501
+ }
502
+
503
+ // 设置展品合集中的单品排序-手动排序
504
+ interface SetItemsSortFromPresentableCollectionManualParamsType {
505
+ presentableId: string;
506
+ itemIds: string[];
507
+ targetSortId: number;
508
+ }
509
+
510
+ export function setItemsSortFromPresentableCollectionManual({
511
+ presentableId,
512
+ ...params
513
+ }: SetItemsSortFromPresentableCollectionManualParamsType) {
514
+ return FUtil.Request({
515
+ method: 'PUT',
516
+ url: `/v2/presentables/catalogues/${presentableId}/manualSort`,
517
+ data: params,
518
+ });
519
+ }
520
+
521
+ // 设置展品合集中的单品排序-快速排序
522
+ interface SetItemsSortFromPresentableCollectionQuickParamsType {
523
+ presentableId: string;
524
+ sortField:
525
+ | 'createDate'
526
+ | 'itemTitle'
527
+ | 'sortId'
528
+ | 'resourceFirstVersionReleaseDate';
529
+ sortType: 1 | -1;
530
+ }
531
+
532
+ export function setItemsSortFromPresentableCollectionQuick({
533
+ presentableId,
534
+ ...params
535
+ }: SetItemsSortFromPresentableCollectionQuickParamsType) {
536
+ return FUtil.Request({
537
+ method: 'PUT',
538
+ url: `/v2/presentables/catalogues/${presentableId}/reorder`,
539
+ data: params,
540
+ });
541
+ }
542
+
543
+ // 获取合集单品自动收录规则
544
+ interface GetItemsAutoCollectRuleParamsType {
545
+ presentableId: string;
546
+ }
547
+
548
+ export function getItemsAutoCollectRule({
549
+ presentableId,
550
+ }: // ...params
551
+ GetItemsAutoCollectRuleParamsType) {
552
+ return FUtil.Request({
553
+ method: 'GET',
554
+ url: `/v2/presentables/catalogues/${presentableId}/items/collectRules`,
555
+ // params: params,
556
+ });
557
+ }
558
+
559
+ // 创建或更新合集单品自动收录规则
560
+ interface SetItemsAutoCollectRuleParamsType {
561
+ presentableId: string;
562
+ status: 0 | 1;
563
+ conditionType: 1 | 2;
564
+ filterConditions: {
565
+ key: 'presentableTitle' | 'resourceTypeCode' | 'authIdentity';
566
+ limitOperatorType:
567
+ | 'INCLUDES'
568
+ | 'NOT_INCLUDES'
569
+ | 'STARTS_WITH'
570
+ | 'ENDS_WITH'
571
+ | 'EQUAL'
572
+ | 'NOT_EQUAL';
573
+ value: string;
574
+ }[];
575
+ }
576
+
577
+ export function setItemsAutoCollectRule({
578
+ presentableId,
579
+ ...params
580
+ }: SetItemsAutoCollectRuleParamsType) {
581
+ return FUtil.Request({
582
+ method: 'POST',
583
+ url: `/v2/presentables/catalogues/${presentableId}/items/collectRules`,
584
+ data: params,
585
+ });
586
+ }
587
+
588
+ // 批量查询展品合集下的单品
589
+ interface GetItemsFromPresentableCollectionsParamsType {
590
+ presentableIds: string;
591
+ sortType?: 1 | -1;
592
+ sortField?: 'createDate';
593
+ limit?: number;
594
+ }
595
+
596
+ export function getItemsFromPresentableCollections({
597
+ ...params
598
+ }: GetItemsFromPresentableCollectionsParamsType) {
599
+ return FUtil.Request({
600
+ method: 'GET',
601
+ // url: `/v2/presentables/catalogues/items/batch/list?presentableIds=685cf423e1502e002fe3053b&limit=1&sortType=-1&sortField=createDate`,
602
+ url: `/v2/presentables/catalogues/items/batch/list`,
603
+ params: params,
604
+ });
605
+ }