@freelog/tools-lib 0.1.165 → 0.1.166
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/resources.d.ts +38 -72
- package/dist/service-API/storages.d.ts +1 -1
- package/dist/service-API/user.d.ts +6 -0
- package/dist/tools-lib.cjs.development.js +149 -123
- 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 +149 -123
- package/dist/tools-lib.esm.js.map +1 -1
- package/package.json +68 -67
- package/src/i18n/I18nNext.ts +156 -162
- package/src/service-API/nodes.ts +113 -113
- package/src/service-API/presentables.ts +343 -343
- package/src/service-API/resources.ts +285 -136
- package/src/service-API/storages.ts +418 -418
- package/src/service-API/user.ts +14 -0
- package/src/utils/linkTo.ts +594 -594
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import FUtil from '../utils';
|
|
2
|
-
import {CommonReturn} from
|
|
3
|
-
|
|
4
|
-
interface IResourceInfo {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
2
|
+
import { CommonReturn } from './tools';
|
|
3
|
+
|
|
4
|
+
// interface IResourceInfo {
|
|
5
|
+
// baseUpcastResources: {
|
|
6
|
+
// resourceId: string;
|
|
7
|
+
// resourceName: string;
|
|
8
|
+
// }[],
|
|
9
|
+
// coverImages: string[],
|
|
10
|
+
// createDate: string;
|
|
11
|
+
// intro: string;
|
|
12
|
+
// latestVersion: string;
|
|
13
|
+
// policies: {
|
|
14
|
+
// policyId: string;
|
|
15
|
+
// policyName: string;
|
|
16
|
+
// status: 0 | 1;
|
|
17
|
+
// }[];
|
|
18
|
+
// resourceId: string;
|
|
19
|
+
// resourceName: string;
|
|
20
|
+
// resourceTitle: string;
|
|
21
|
+
// resourceType: string[];
|
|
22
|
+
// resourceVersions: {
|
|
23
|
+
// createDate: string;
|
|
24
|
+
// version: string;
|
|
25
|
+
// versionId: string;
|
|
26
|
+
// }[];
|
|
27
|
+
// status: 0 | 1 | 2 | 4; // 0:待发行(初始状态) 1:上架 2:冻结 4:下架(也叫待上架)
|
|
28
|
+
// tags: string[];
|
|
29
|
+
// updateDate: string;
|
|
30
|
+
// userId: number;
|
|
31
|
+
// username: string;
|
|
32
|
+
// operationType: number;
|
|
33
|
+
// }
|
|
34
34
|
|
|
35
35
|
// 创建资源
|
|
36
36
|
export interface CreateParamsType {
|
|
@@ -216,11 +216,12 @@ interface InfoParamsType {
|
|
|
216
216
|
isLoadFreezeReason?: 0 | 1;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
interface InfoReturnType extends CommonReturn {
|
|
220
|
-
|
|
221
|
-
}
|
|
219
|
+
// interface InfoReturnType extends CommonReturn {
|
|
220
|
+
// data: IResourceInfo
|
|
221
|
+
// }
|
|
222
222
|
|
|
223
|
-
export function info({resourceIdOrName, ...params}: InfoParamsType)
|
|
223
|
+
export function info({ resourceIdOrName, ...params }: InfoParamsType) {
|
|
224
|
+
// : Promise<InfoReturnType>
|
|
224
225
|
return FUtil.Request({
|
|
225
226
|
method: 'GET',
|
|
226
227
|
url: `/v2/resources/${encodeURIComponent(resourceIdOrName)}`,
|
|
@@ -239,11 +240,12 @@ interface BatchInfoParamsType {
|
|
|
239
240
|
isLoadFreezeReason?: 0 | 1;
|
|
240
241
|
}
|
|
241
242
|
|
|
242
|
-
interface BatchInfoReturnType extends CommonReturn {
|
|
243
|
-
|
|
244
|
-
}
|
|
243
|
+
// interface BatchInfoReturnType extends CommonReturn {
|
|
244
|
+
// data: IResourceInfo[];
|
|
245
|
+
// }
|
|
245
246
|
|
|
246
|
-
export function batchInfo(params: BatchInfoParamsType)
|
|
247
|
+
export function batchInfo(params: BatchInfoParamsType) {
|
|
248
|
+
// : Promise<BatchInfoReturnType>
|
|
247
249
|
return FUtil.Request({
|
|
248
250
|
method: 'GET',
|
|
249
251
|
url: `/v2/resources/list`,
|
|
@@ -260,7 +262,10 @@ interface DependencyTreeParamsType {
|
|
|
260
262
|
isContainRootNode?: boolean;
|
|
261
263
|
}
|
|
262
264
|
|
|
263
|
-
export function dependencyTree({
|
|
265
|
+
export function dependencyTree({
|
|
266
|
+
resourceId,
|
|
267
|
+
...params
|
|
268
|
+
}: DependencyTreeParamsType) {
|
|
264
269
|
return FUtil.Request({
|
|
265
270
|
method: 'GET',
|
|
266
271
|
url: `/v2/resources/${resourceId}/dependencyTree`,
|
|
@@ -274,7 +279,7 @@ interface AuthTreeParamsType {
|
|
|
274
279
|
version?: string;
|
|
275
280
|
}
|
|
276
281
|
|
|
277
|
-
export function authTree({resourceId, ...params}: AuthTreeParamsType) {
|
|
282
|
+
export function authTree({ resourceId, ...params }: AuthTreeParamsType) {
|
|
278
283
|
return FUtil.Request({
|
|
279
284
|
method: 'GET',
|
|
280
285
|
url: `/v2/resources/${resourceId}/authTree`,
|
|
@@ -289,10 +294,6 @@ interface CreateVersionParamsType {
|
|
|
289
294
|
fileSha1: string;
|
|
290
295
|
filename: string;
|
|
291
296
|
description?: string;
|
|
292
|
-
dependencies?: {
|
|
293
|
-
resourceId: string;
|
|
294
|
-
versionRange: string;
|
|
295
|
-
}[];
|
|
296
297
|
customPropertyDescriptors?: {
|
|
297
298
|
key: string;
|
|
298
299
|
name: string;
|
|
@@ -301,22 +302,39 @@ interface CreateVersionParamsType {
|
|
|
301
302
|
candidateItems?: string[];
|
|
302
303
|
remark?: string;
|
|
303
304
|
}[];
|
|
305
|
+
// resolveResources: {
|
|
306
|
+
// resourceId: string;
|
|
307
|
+
// contracts: {
|
|
308
|
+
// policyId: string;
|
|
309
|
+
// }[];
|
|
310
|
+
// }[];
|
|
311
|
+
inputAttrs?: {
|
|
312
|
+
key: string;
|
|
313
|
+
value: string;
|
|
314
|
+
}[];
|
|
315
|
+
|
|
316
|
+
dependencies?: {
|
|
317
|
+
resourceId: string;
|
|
318
|
+
versionRange: string;
|
|
319
|
+
}[];
|
|
304
320
|
baseUpcastResources?: {
|
|
305
321
|
resourceId: string;
|
|
306
322
|
}[];
|
|
307
|
-
|
|
323
|
+
batchSignContracts?: {
|
|
308
324
|
resourceId: string;
|
|
309
|
-
|
|
310
|
-
policyId: string;
|
|
311
|
-
}[];
|
|
325
|
+
policyIds: string[];
|
|
312
326
|
}[];
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
327
|
+
authExcludedItems: {
|
|
328
|
+
resourceId: string;
|
|
329
|
+
excludedType: 'contract' | 'policy';
|
|
330
|
+
excludedValue: string;
|
|
316
331
|
}[];
|
|
317
332
|
}
|
|
318
333
|
|
|
319
|
-
export function createVersion({
|
|
334
|
+
export function createVersion({
|
|
335
|
+
resourceId,
|
|
336
|
+
...params
|
|
337
|
+
}: CreateVersionParamsType) {
|
|
320
338
|
// return FUtil.Axios.post(`/v2/resources/${resourceId}/versions`, params);
|
|
321
339
|
return FUtil.Request({
|
|
322
340
|
method: 'POST',
|
|
@@ -337,7 +355,11 @@ interface ResourceVersionInfo2ParamsType {
|
|
|
337
355
|
projection?: string;
|
|
338
356
|
}
|
|
339
357
|
|
|
340
|
-
export function resourceVersionInfo1({
|
|
358
|
+
export function resourceVersionInfo1({
|
|
359
|
+
resourceId,
|
|
360
|
+
version,
|
|
361
|
+
...params
|
|
362
|
+
}: ResourceVersionInfo1ParamsType) {
|
|
341
363
|
return FUtil.Request({
|
|
342
364
|
method: 'GET',
|
|
343
365
|
url: `/v2/resources/${resourceId}/versions/${version}`,
|
|
@@ -353,13 +375,32 @@ export function resourceVersionInfo2(params: ResourceVersionInfo2ParamsType) {
|
|
|
353
375
|
});
|
|
354
376
|
}
|
|
355
377
|
|
|
378
|
+
// 查看资源版本列表
|
|
379
|
+
interface getVersionListByResourceIDParamsType {
|
|
380
|
+
resourceId: string;
|
|
381
|
+
version?: string;
|
|
382
|
+
projection?: string;
|
|
383
|
+
sort?: string;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export function getVersionListByResourceID({
|
|
387
|
+
resourceId,
|
|
388
|
+
...params
|
|
389
|
+
}: getVersionListByResourceIDParamsType) {
|
|
390
|
+
return FUtil.Request({
|
|
391
|
+
method: 'GET',
|
|
392
|
+
url: `/v2/resources/${resourceId}/versions`,
|
|
393
|
+
params: params,
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
|
|
356
397
|
// 批量查询资源版本列表
|
|
357
398
|
interface GetVersionListParamsType {
|
|
358
399
|
versionIds: string;
|
|
359
400
|
projection?: string;
|
|
360
401
|
}
|
|
361
402
|
|
|
362
|
-
export function getVersionList({...params}: GetVersionListParamsType) {
|
|
403
|
+
export function getVersionList({ ...params }: GetVersionListParamsType) {
|
|
363
404
|
return FUtil.Request({
|
|
364
405
|
method: 'GET',
|
|
365
406
|
url: `/v2/resources/versions/list`,
|
|
@@ -373,7 +414,10 @@ interface GetResourceVersionBySha1ParamsType {
|
|
|
373
414
|
projection?: string;
|
|
374
415
|
}
|
|
375
416
|
|
|
376
|
-
export function getResourceVersionBySha1({
|
|
417
|
+
export function getResourceVersionBySha1({
|
|
418
|
+
fileSha1,
|
|
419
|
+
...params
|
|
420
|
+
}: GetResourceVersionBySha1ParamsType) {
|
|
377
421
|
return FUtil.Request({
|
|
378
422
|
method: 'GET',
|
|
379
423
|
url: `/v2/resources/files/${fileSha1}/versions`,
|
|
@@ -387,7 +431,10 @@ interface GetResourceBySha1ParamsType {
|
|
|
387
431
|
projection?: string;
|
|
388
432
|
}
|
|
389
433
|
|
|
390
|
-
export function getResourceBySha1({
|
|
434
|
+
export function getResourceBySha1({
|
|
435
|
+
fileSha1,
|
|
436
|
+
...params
|
|
437
|
+
}: GetResourceBySha1ParamsType) {
|
|
391
438
|
// return FUtil.Axios.get(`/v2/resources/files/${fileSha1}`, {
|
|
392
439
|
// params,
|
|
393
440
|
// });
|
|
@@ -423,7 +470,9 @@ interface UpdateResourceVersionInfoParamsType {
|
|
|
423
470
|
}[];
|
|
424
471
|
}
|
|
425
472
|
|
|
426
|
-
export function updateResourceVersionInfo(
|
|
473
|
+
export function updateResourceVersionInfo(
|
|
474
|
+
params: UpdateResourceVersionInfoParamsType
|
|
475
|
+
) {
|
|
427
476
|
// return FUtil.Axios.put(`/v2/resources/${params.resourceId}/versions/${params.version}`, params);
|
|
428
477
|
return FUtil.Request({
|
|
429
478
|
method: 'PUT',
|
|
@@ -466,7 +515,9 @@ interface DeleteResourceDraftParamsType {
|
|
|
466
515
|
resourceId: string;
|
|
467
516
|
}
|
|
468
517
|
|
|
469
|
-
export function deleteResourceDraft({
|
|
518
|
+
export function deleteResourceDraft({
|
|
519
|
+
resourceId,
|
|
520
|
+
}: DeleteResourceDraftParamsType) {
|
|
470
521
|
// return FUtil.Axios.post(`/v2/resources/${params.resourceId}/versions/drafts`, params);
|
|
471
522
|
return FUtil.Request({
|
|
472
523
|
method: 'DELETE',
|
|
@@ -498,7 +549,9 @@ interface ResourcesDownloadParamsType {
|
|
|
498
549
|
}
|
|
499
550
|
|
|
500
551
|
export function resourcesDownload(params: ResourcesDownloadParamsType) {
|
|
501
|
-
return window.location.href =
|
|
552
|
+
return (window.location.href =
|
|
553
|
+
FUtil.Format.completeUrlByDomain('api') +
|
|
554
|
+
`/v2/resources/${params.resourceId}/versions/${params.version}/download`);
|
|
502
555
|
// return request.get(`/v2/resources/${params.resourceId}/versions/${params.$version}/download`, {
|
|
503
556
|
// responseType: 'arraybuffer',
|
|
504
557
|
// });
|
|
@@ -510,7 +563,10 @@ interface BatchGetCoverageVersionsParamsType {
|
|
|
510
563
|
contractIds: string;
|
|
511
564
|
}
|
|
512
565
|
|
|
513
|
-
export function batchGetCoverageVersions({
|
|
566
|
+
export function batchGetCoverageVersions({
|
|
567
|
+
resourceId,
|
|
568
|
+
...params
|
|
569
|
+
}: BatchGetCoverageVersionsParamsType) {
|
|
514
570
|
// return FUtil.Axios.get(`/v2/resources/${resourceId}/contracts/coverageVersions`, {
|
|
515
571
|
// params,
|
|
516
572
|
// });
|
|
@@ -541,7 +597,9 @@ interface CreateVersionReturnType extends CommonReturn {
|
|
|
541
597
|
}[];
|
|
542
598
|
}
|
|
543
599
|
|
|
544
|
-
export function resolveResources(
|
|
600
|
+
export function resolveResources(
|
|
601
|
+
params: ResolveResourcesParamsType
|
|
602
|
+
): Promise<CreateVersionReturnType> {
|
|
545
603
|
// return FUtil.Axios.get(`/v2/resources/${params.resourceId}/resolveResources`);
|
|
546
604
|
return FUtil.Request({
|
|
547
605
|
method: 'GET',
|
|
@@ -563,7 +621,10 @@ interface BatchSetContractsParamsType {
|
|
|
563
621
|
}[];
|
|
564
622
|
}
|
|
565
623
|
|
|
566
|
-
export function batchSetContracts({
|
|
624
|
+
export function batchSetContracts({
|
|
625
|
+
resourceId,
|
|
626
|
+
...params
|
|
627
|
+
}: BatchSetContractsParamsType) {
|
|
567
628
|
// return FUtil.Axios.put(`/v2/resources/${resourceId}/versions/batchSetContracts`, params);
|
|
568
629
|
return FUtil.Request({
|
|
569
630
|
method: 'PUT',
|
|
@@ -581,7 +642,10 @@ interface CycleDependencyCheckParamsType {
|
|
|
581
642
|
}[];
|
|
582
643
|
}
|
|
583
644
|
|
|
584
|
-
export function cycleDependencyCheck({
|
|
645
|
+
export function cycleDependencyCheck({
|
|
646
|
+
resourceId,
|
|
647
|
+
...params
|
|
648
|
+
}: CycleDependencyCheckParamsType) {
|
|
585
649
|
// return FUtil.Axios.post(`/v2/resources/${resourceId}/versions/cycleDependencyCheck`, params);
|
|
586
650
|
return FUtil.Request({
|
|
587
651
|
method: 'POST',
|
|
@@ -597,7 +661,10 @@ interface RelationTreeParamsType {
|
|
|
597
661
|
versionRange?: string;
|
|
598
662
|
}
|
|
599
663
|
|
|
600
|
-
export function relationTree({
|
|
664
|
+
export function relationTree({
|
|
665
|
+
resourceId,
|
|
666
|
+
...params
|
|
667
|
+
}: RelationTreeParamsType) {
|
|
601
668
|
// return FUtil.Axios.get(`/v2/resources/${resourceId}/relationTree`, {
|
|
602
669
|
// params,
|
|
603
670
|
// });
|
|
@@ -615,7 +682,10 @@ interface RelationTreeAuthParamsType {
|
|
|
615
682
|
versionRange?: string;
|
|
616
683
|
}
|
|
617
684
|
|
|
618
|
-
export function relationTreeAuth({
|
|
685
|
+
export function relationTreeAuth({
|
|
686
|
+
resourceId,
|
|
687
|
+
...params
|
|
688
|
+
}: RelationTreeAuthParamsType) {
|
|
619
689
|
return FUtil.Request({
|
|
620
690
|
method: 'GET',
|
|
621
691
|
url: `/v2/auths/resources/${resourceId}/relationTreeAuth`,
|
|
@@ -629,7 +699,7 @@ interface ResourcesCountParamsType {
|
|
|
629
699
|
status?: 0 | 1 | 2 | 3; // 0:下架 1:上架 2:冻结(冻结时处于下架状态) 3:冻结(冻结时处于上架状态)
|
|
630
700
|
}
|
|
631
701
|
|
|
632
|
-
export function resourcesCount({...params}: ResourcesCountParamsType) {
|
|
702
|
+
export function resourcesCount({ ...params }: ResourcesCountParamsType) {
|
|
633
703
|
return FUtil.Request({
|
|
634
704
|
method: 'GET',
|
|
635
705
|
url: `/v2/resources/count`,
|
|
@@ -644,7 +714,7 @@ interface BatchAuthParamsType {
|
|
|
644
714
|
versionRanges?: string;
|
|
645
715
|
}
|
|
646
716
|
|
|
647
|
-
export function batchAuth({...params}: BatchAuthParamsType) {
|
|
717
|
+
export function batchAuth({ ...params }: BatchAuthParamsType) {
|
|
648
718
|
return FUtil.Request({
|
|
649
719
|
method: 'GET',
|
|
650
720
|
url: `/v2/auths/resources/batchAuth/results`,
|
|
@@ -657,7 +727,9 @@ interface ResourcesRecommendParamsType {
|
|
|
657
727
|
recommendType: 1 | 2; // 1: 推荐主题 2:占位主题
|
|
658
728
|
}
|
|
659
729
|
|
|
660
|
-
export function resourcesRecommend({
|
|
730
|
+
export function resourcesRecommend({
|
|
731
|
+
...params
|
|
732
|
+
}: ResourcesRecommendParamsType) {
|
|
661
733
|
return FUtil.Request({
|
|
662
734
|
method: 'GET',
|
|
663
735
|
url: `/v2/resources/recommend`,
|
|
@@ -670,7 +742,7 @@ interface AvailableTagsParamsType {
|
|
|
670
742
|
resourceTypeCode: string;
|
|
671
743
|
}
|
|
672
744
|
|
|
673
|
-
export function availableTags({...params}: AvailableTagsParamsType) {
|
|
745
|
+
export function availableTags({ ...params }: AvailableTagsParamsType) {
|
|
674
746
|
return FUtil.Request({
|
|
675
747
|
method: 'GET',
|
|
676
748
|
url: `/v2/resources/tags/availableTags`,
|
|
@@ -687,7 +759,7 @@ interface ResourceTypesParamsType {
|
|
|
687
759
|
supportCreateBatch?: 1 | 2;
|
|
688
760
|
}
|
|
689
761
|
|
|
690
|
-
export function resourceTypes({...params}: ResourceTypesParamsType = {}) {
|
|
762
|
+
export function resourceTypes({ ...params }: ResourceTypesParamsType = {}) {
|
|
691
763
|
return FUtil.Request({
|
|
692
764
|
method: 'GET',
|
|
693
765
|
url: `/v2/resources/types/listSimpleByGroup`,
|
|
@@ -705,7 +777,9 @@ interface ListSimpleByParentCodeParamsType {
|
|
|
705
777
|
nameChain?: string;
|
|
706
778
|
}
|
|
707
779
|
|
|
708
|
-
export function ListSimpleByParentCode({
|
|
780
|
+
export function ListSimpleByParentCode({
|
|
781
|
+
...params
|
|
782
|
+
}: ListSimpleByParentCodeParamsType) {
|
|
709
783
|
return FUtil.Request({
|
|
710
784
|
method: 'GET',
|
|
711
785
|
url: `/v2/resources/types/listSimpleByParentCode`,
|
|
@@ -718,7 +792,9 @@ interface GetResourceTypeInfoByCodeParamsType {
|
|
|
718
792
|
code: string;
|
|
719
793
|
}
|
|
720
794
|
|
|
721
|
-
export function getResourceTypeInfoByCode({
|
|
795
|
+
export function getResourceTypeInfoByCode({
|
|
796
|
+
...params
|
|
797
|
+
}: GetResourceTypeInfoByCodeParamsType) {
|
|
722
798
|
return FUtil.Request({
|
|
723
799
|
method: 'GET',
|
|
724
800
|
url: `/v2/resources/types/getInfoByCode`,
|
|
@@ -727,11 +803,11 @@ export function getResourceTypeInfoByCode({...params}: GetResourceTypeInfoByCode
|
|
|
727
803
|
}
|
|
728
804
|
|
|
729
805
|
//
|
|
730
|
-
interface GetResourceAttrListSimpleParamsType {
|
|
731
|
-
|
|
732
|
-
}
|
|
806
|
+
interface GetResourceAttrListSimpleParamsType {}
|
|
733
807
|
|
|
734
|
-
export function getResourceAttrListSimple({
|
|
808
|
+
export function getResourceAttrListSimple({
|
|
809
|
+
...params
|
|
810
|
+
}: GetResourceAttrListSimpleParamsType) {
|
|
735
811
|
return FUtil.Request({
|
|
736
812
|
method: 'GET',
|
|
737
813
|
url: `/v2/resources/attrs/listSimple`,
|
|
@@ -739,11 +815,11 @@ export function getResourceAttrListSimple({...params}: GetResourceAttrListSimple
|
|
|
739
815
|
});
|
|
740
816
|
}
|
|
741
817
|
|
|
742
|
-
interface ListSimple4RecentlyParamsType {
|
|
818
|
+
interface ListSimple4RecentlyParamsType {}
|
|
743
819
|
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
820
|
+
export function listSimple4Recently({
|
|
821
|
+
...params
|
|
822
|
+
}: ListSimple4RecentlyParamsType = {}) {
|
|
747
823
|
return FUtil.Request({
|
|
748
824
|
method: 'GET',
|
|
749
825
|
url: `/v2/resources/types/listSimple4Recently`,
|
|
@@ -756,7 +832,7 @@ interface GetAttrsInfoByKeyParamsType {
|
|
|
756
832
|
key: string;
|
|
757
833
|
}
|
|
758
834
|
|
|
759
|
-
export function getAttrsInfoByKey({...params}: GetAttrsInfoByKeyParamsType) {
|
|
835
|
+
export function getAttrsInfoByKey({ ...params }: GetAttrsInfoByKeyParamsType) {
|
|
760
836
|
return FUtil.Request({
|
|
761
837
|
method: 'GET',
|
|
762
838
|
url: `/v2/resources/attrs/getInfoByKey`,
|
|
@@ -769,7 +845,9 @@ interface GenerateResourceNamesParamsType {
|
|
|
769
845
|
resourceNames: string[];
|
|
770
846
|
}
|
|
771
847
|
|
|
772
|
-
export function generateResourceNames({
|
|
848
|
+
export function generateResourceNames({
|
|
849
|
+
resourceNames,
|
|
850
|
+
}: GenerateResourceNamesParamsType) {
|
|
773
851
|
return FUtil.Request({
|
|
774
852
|
method: 'POST',
|
|
775
853
|
url: `/v2/resources/generateResourceNames`,
|
|
@@ -799,7 +877,7 @@ interface UpdateCollectionParamsType {
|
|
|
799
877
|
resourceId: string;
|
|
800
878
|
contracts: {
|
|
801
879
|
policyId: string;
|
|
802
|
-
}[]
|
|
880
|
+
}[];
|
|
803
881
|
}[];
|
|
804
882
|
// optionalResolveResources?: {
|
|
805
883
|
// resourceId: string;
|
|
@@ -812,15 +890,28 @@ interface UpdateCollectionParamsType {
|
|
|
812
890
|
// itemTitle: string;
|
|
813
891
|
// }[];
|
|
814
892
|
catalogueProperty?: {
|
|
815
|
-
collection_item_no_display?:
|
|
816
|
-
|
|
817
|
-
|
|
893
|
+
collection_item_no_display?:
|
|
894
|
+
| 'collection_item_no_display_show'
|
|
895
|
+
| 'collection_item_no_display_hide';
|
|
896
|
+
collection_item_image_display?:
|
|
897
|
+
| 'collection_item_image_display_show'
|
|
898
|
+
| 'collection_item_image_display_hide';
|
|
899
|
+
collection_item_descr_display?:
|
|
900
|
+
| 'collection_item_descr_display_show'
|
|
901
|
+
| 'collection_item_descr_display_hide';
|
|
818
902
|
collection_view?: 'collection_view_list' | 'collection_view_card';
|
|
819
903
|
};
|
|
820
904
|
isMergeCatalogueDraft?: 0 | 1;
|
|
905
|
+
inputAttrs?: {
|
|
906
|
+
key: string;
|
|
907
|
+
value: string;
|
|
908
|
+
}[];
|
|
821
909
|
}
|
|
822
910
|
|
|
823
|
-
export function updateCollection({
|
|
911
|
+
export function updateCollection({
|
|
912
|
+
resourceId,
|
|
913
|
+
...params
|
|
914
|
+
}: UpdateCollectionParamsType) {
|
|
824
915
|
return FUtil.Request({
|
|
825
916
|
method: 'PUT',
|
|
826
917
|
url: `/v2/resources/catalogue/${resourceId}`,
|
|
@@ -835,12 +926,14 @@ interface deleteCollectionUnitResourcesParamsType {
|
|
|
835
926
|
}
|
|
836
927
|
|
|
837
928
|
export function deleteCollectionUnitResource({
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
929
|
+
resourceId,
|
|
930
|
+
removeCollectionItemIds,
|
|
931
|
+
}: deleteCollectionUnitResourcesParamsType) {
|
|
841
932
|
return FUtil.Request({
|
|
842
933
|
method: 'DELETE',
|
|
843
|
-
url: `/v2/resources/catalogue/${resourceId}?removeCollectionItemIds=${removeCollectionItemIds.join(
|
|
934
|
+
url: `/v2/resources/catalogue/${resourceId}?removeCollectionItemIds=${removeCollectionItemIds.join(
|
|
935
|
+
','
|
|
936
|
+
)}`,
|
|
844
937
|
// data: params,
|
|
845
938
|
});
|
|
846
939
|
}
|
|
@@ -856,7 +949,10 @@ interface GetCollectionItemsParamsType {
|
|
|
856
949
|
isLoadLatestVersionInfo?: 0 | 1;
|
|
857
950
|
}
|
|
858
951
|
|
|
859
|
-
export function getCollectionItems({
|
|
952
|
+
export function getCollectionItems({
|
|
953
|
+
resourceId,
|
|
954
|
+
...params
|
|
955
|
+
}: GetCollectionItemsParamsType) {
|
|
860
956
|
return FUtil.Request({
|
|
861
957
|
method: 'GET',
|
|
862
958
|
url: `/v2/resources/catalogue/${resourceId}/items`,
|
|
@@ -875,7 +971,10 @@ interface GetCollectionItems_Draft_ParamsType {
|
|
|
875
971
|
isLoadLatestVersionInfo?: 0 | 1;
|
|
876
972
|
}
|
|
877
973
|
|
|
878
|
-
export function getCollectionItems_Draft({
|
|
974
|
+
export function getCollectionItems_Draft({
|
|
975
|
+
resourceId,
|
|
976
|
+
...params
|
|
977
|
+
}: GetCollectionItems_Draft_ParamsType) {
|
|
879
978
|
return FUtil.Request({
|
|
880
979
|
method: 'GET',
|
|
881
980
|
url: `/v2/resources/catalogues/drafts/${resourceId}/items`,
|
|
@@ -890,7 +989,10 @@ interface SetCollectionItemSortParamsType {
|
|
|
890
989
|
targetSortId: number;
|
|
891
990
|
}
|
|
892
991
|
|
|
893
|
-
export function setCollectionItemSort({
|
|
992
|
+
export function setCollectionItemSort({
|
|
993
|
+
resourceId,
|
|
994
|
+
...params
|
|
995
|
+
}: SetCollectionItemSortParamsType) {
|
|
894
996
|
return FUtil.Request({
|
|
895
997
|
method: 'PUT',
|
|
896
998
|
url: `/v2/resources/catalogue/${resourceId}/manualSort`,
|
|
@@ -905,7 +1007,10 @@ interface ReorderCollectionItemsSortParamsType {
|
|
|
905
1007
|
sortType: 1 | -1;
|
|
906
1008
|
}
|
|
907
1009
|
|
|
908
|
-
export function reorderCollectionItemsSort({
|
|
1010
|
+
export function reorderCollectionItemsSort({
|
|
1011
|
+
resourceId,
|
|
1012
|
+
...params
|
|
1013
|
+
}: ReorderCollectionItemsSortParamsType) {
|
|
909
1014
|
return FUtil.Request({
|
|
910
1015
|
method: 'PUT',
|
|
911
1016
|
url: `/v2/resources/catalogue/${resourceId}/reorder`,
|
|
@@ -919,7 +1024,10 @@ interface CheckExistCollectionItemsParamsType {
|
|
|
919
1024
|
resourceIds: string;
|
|
920
1025
|
}
|
|
921
1026
|
|
|
922
|
-
export function checkExistCollectionItems({
|
|
1027
|
+
export function checkExistCollectionItems({
|
|
1028
|
+
resourceId,
|
|
1029
|
+
...params
|
|
1030
|
+
}: CheckExistCollectionItemsParamsType) {
|
|
923
1031
|
return FUtil.Request({
|
|
924
1032
|
method: 'GET',
|
|
925
1033
|
url: `/v2/resources/catalogue/${resourceId}/items/checkExists`,
|
|
@@ -933,7 +1041,10 @@ interface GetCollectionItemsAuthParamsType {
|
|
|
933
1041
|
itemIds: string;
|
|
934
1042
|
}
|
|
935
1043
|
|
|
936
|
-
export function getCollectionItemsAuth({
|
|
1044
|
+
export function getCollectionItemsAuth({
|
|
1045
|
+
resourceId,
|
|
1046
|
+
...params
|
|
1047
|
+
}: GetCollectionItemsAuthParamsType) {
|
|
937
1048
|
return FUtil.Request({
|
|
938
1049
|
method: 'GET',
|
|
939
1050
|
url: `/v2/auths/resources/${resourceId}/items/batchAuth`,
|
|
@@ -950,7 +1061,9 @@ interface BatchResourceItemsParamsType {
|
|
|
950
1061
|
isLoadItemResourceDetailInfo?: 0 | 1;
|
|
951
1062
|
}
|
|
952
1063
|
|
|
953
|
-
export function batchResourceItems({
|
|
1064
|
+
export function batchResourceItems({
|
|
1065
|
+
...params
|
|
1066
|
+
}: BatchResourceItemsParamsType) {
|
|
954
1067
|
return FUtil.Request({
|
|
955
1068
|
method: 'GET',
|
|
956
1069
|
url: `/v2/resources/catalogue/items/batch/list`,
|
|
@@ -967,7 +1080,9 @@ interface BatchResourceItems_Draft_ParamsType {
|
|
|
967
1080
|
isLoadItemResourceDetailInfo?: 0 | 1;
|
|
968
1081
|
}
|
|
969
1082
|
|
|
970
|
-
export function batchResourceItems_Draft({
|
|
1083
|
+
export function batchResourceItems_Draft({
|
|
1084
|
+
...params
|
|
1085
|
+
}: BatchResourceItems_Draft_ParamsType) {
|
|
971
1086
|
return FUtil.Request({
|
|
972
1087
|
method: 'GET',
|
|
973
1088
|
url: `/v2/resources/catalogues/drafts/items/batch/list`,
|
|
@@ -983,7 +1098,10 @@ interface GetCollectionUpdateLogsParamsType {
|
|
|
983
1098
|
sortType?: 1 | -1;
|
|
984
1099
|
}
|
|
985
1100
|
|
|
986
|
-
export function getCollectionUpdateLogs({
|
|
1101
|
+
export function getCollectionUpdateLogs({
|
|
1102
|
+
resourceId,
|
|
1103
|
+
...params
|
|
1104
|
+
}: GetCollectionUpdateLogsParamsType) {
|
|
987
1105
|
return FUtil.Request({
|
|
988
1106
|
method: 'GET',
|
|
989
1107
|
url: `/v2/resources/catalogue/${resourceId}/updateLogs`,
|
|
@@ -996,7 +1114,9 @@ interface GetCollectionCollectRulesParamsType {
|
|
|
996
1114
|
resourceId: string;
|
|
997
1115
|
}
|
|
998
1116
|
|
|
999
|
-
export function getCollectionCollectRules({
|
|
1117
|
+
export function getCollectionCollectRules({
|
|
1118
|
+
resourceId,
|
|
1119
|
+
}: GetCollectionCollectRulesParamsType) {
|
|
1000
1120
|
return FUtil.Request({
|
|
1001
1121
|
method: 'GET',
|
|
1002
1122
|
url: `/v2/resources/catalogue/${resourceId}/items/collectRules`,
|
|
@@ -1012,12 +1132,21 @@ interface SetCollectRulesParamsType {
|
|
|
1012
1132
|
conditionType: 1 | 2;
|
|
1013
1133
|
filterConditions: {
|
|
1014
1134
|
key: 'resourceTitle' | 'resourceTypeCode' | 'authIdentity';
|
|
1015
|
-
limitOperatorType:
|
|
1135
|
+
limitOperatorType:
|
|
1136
|
+
| 'INCLUDES'
|
|
1137
|
+
| 'NOT_INCLUDES'
|
|
1138
|
+
| 'STARTS_WITH'
|
|
1139
|
+
| 'ENDS_WITH'
|
|
1140
|
+
| 'EQUAL'
|
|
1141
|
+
| 'NOT_EQUAL';
|
|
1016
1142
|
value: string;
|
|
1017
1143
|
}[];
|
|
1018
1144
|
}
|
|
1019
1145
|
|
|
1020
|
-
export function setCollectRules({
|
|
1146
|
+
export function setCollectRules({
|
|
1147
|
+
resourceId,
|
|
1148
|
+
...params
|
|
1149
|
+
}: SetCollectRulesParamsType) {
|
|
1021
1150
|
return FUtil.Request({
|
|
1022
1151
|
method: 'POST',
|
|
1023
1152
|
url: `/v2/resources/catalogue/${resourceId}/items/collectRules`,
|
|
@@ -1034,7 +1163,7 @@ interface SetItemsTitleParamsType {
|
|
|
1034
1163
|
}[];
|
|
1035
1164
|
}
|
|
1036
1165
|
|
|
1037
|
-
export function setItemsTitle({resourceId, data}: SetItemsTitleParamsType) {
|
|
1166
|
+
export function setItemsTitle({ resourceId, data }: SetItemsTitleParamsType) {
|
|
1038
1167
|
return FUtil.Request({
|
|
1039
1168
|
method: 'PUT',
|
|
1040
1169
|
url: `/v2/resources/catalogue/${resourceId}/items`,
|
|
@@ -1045,16 +1174,18 @@ export function setItemsTitle({resourceId, data}: SetItemsTitleParamsType) {
|
|
|
1045
1174
|
// 批量删除合集资源单品(草稿)
|
|
1046
1175
|
interface deleteCollectionItems_Draft_ParamsType {
|
|
1047
1176
|
resourceId: string;
|
|
1048
|
-
removeCollectionItemIds: string[]
|
|
1177
|
+
removeCollectionItemIds: string[];
|
|
1049
1178
|
}
|
|
1050
1179
|
|
|
1051
1180
|
export function deleteCollectionItems_Draft({
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1181
|
+
resourceId,
|
|
1182
|
+
removeCollectionItemIds,
|
|
1183
|
+
}: deleteCollectionItems_Draft_ParamsType) {
|
|
1055
1184
|
return FUtil.Request({
|
|
1056
1185
|
method: 'DELETE',
|
|
1057
|
-
url: `/v2/resources/catalogues/drafts/${resourceId}/items?removeCollectionItemIds=${removeCollectionItemIds.join(
|
|
1186
|
+
url: `/v2/resources/catalogues/drafts/${resourceId}/items?removeCollectionItemIds=${removeCollectionItemIds.join(
|
|
1187
|
+
','
|
|
1188
|
+
)}`,
|
|
1058
1189
|
// data: params,
|
|
1059
1190
|
});
|
|
1060
1191
|
}
|
|
@@ -1063,12 +1194,15 @@ export function deleteCollectionItems_Draft({
|
|
|
1063
1194
|
interface SetCollectionItemsSortID_Draft_ParamsType {
|
|
1064
1195
|
resourceId: string;
|
|
1065
1196
|
data: {
|
|
1066
|
-
|
|
1197
|
+
itemIds: string[];
|
|
1067
1198
|
targetSortId: number;
|
|
1068
1199
|
};
|
|
1069
1200
|
}
|
|
1070
1201
|
|
|
1071
|
-
export function setCollectionItemsSortID_Draft({
|
|
1202
|
+
export function setCollectionItemsSortID_Draft({
|
|
1203
|
+
resourceId,
|
|
1204
|
+
data,
|
|
1205
|
+
}: SetCollectionItemsSortID_Draft_ParamsType) {
|
|
1072
1206
|
return FUtil.Request({
|
|
1073
1207
|
method: 'PUT',
|
|
1074
1208
|
url: `/v2/resources/catalogues/drafts/${resourceId}/manualSort`,
|
|
@@ -1083,7 +1217,10 @@ interface ReorderCollectionItems_Draft_ParamsType {
|
|
|
1083
1217
|
sortType: -1 | 1;
|
|
1084
1218
|
}
|
|
1085
1219
|
|
|
1086
|
-
export function reorderCollectionItems_Draft({
|
|
1220
|
+
export function reorderCollectionItems_Draft({
|
|
1221
|
+
resourceId,
|
|
1222
|
+
...params
|
|
1223
|
+
}: ReorderCollectionItems_Draft_ParamsType) {
|
|
1087
1224
|
return FUtil.Request({
|
|
1088
1225
|
method: 'PUT',
|
|
1089
1226
|
url: `/v2/resources/catalogues/drafts/${resourceId}/reorder`,
|
|
@@ -1097,7 +1234,10 @@ interface ResourceIsExistInItems_Draft_ParamsType {
|
|
|
1097
1234
|
resourceIds: string;
|
|
1098
1235
|
}
|
|
1099
1236
|
|
|
1100
|
-
export function resourceIsExistInItems_Draft({
|
|
1237
|
+
export function resourceIsExistInItems_Draft({
|
|
1238
|
+
resourceId,
|
|
1239
|
+
...params
|
|
1240
|
+
}: ResourceIsExistInItems_Draft_ParamsType) {
|
|
1101
1241
|
return FUtil.Request({
|
|
1102
1242
|
method: 'GET',
|
|
1103
1243
|
url: `/v2/resources/catalogues/drafts/${resourceId}/items/checkExists`,
|
|
@@ -1114,7 +1254,10 @@ interface UpdateCollectionItemsInfo_Draft_ParamsType {
|
|
|
1114
1254
|
}[];
|
|
1115
1255
|
}
|
|
1116
1256
|
|
|
1117
|
-
export function updateCollectionItemsInfo_Draft({
|
|
1257
|
+
export function updateCollectionItemsInfo_Draft({
|
|
1258
|
+
resourceId,
|
|
1259
|
+
data,
|
|
1260
|
+
}: UpdateCollectionItemsInfo_Draft_ParamsType) {
|
|
1118
1261
|
return FUtil.Request({
|
|
1119
1262
|
method: 'PUT',
|
|
1120
1263
|
// url: `/v2/resources/catalogue/${resourceId}/items`,
|
|
@@ -1127,24 +1270,24 @@ export function updateCollectionItemsInfo_Draft({resourceId, data}: UpdateCollec
|
|
|
1127
1270
|
interface UpdateCollectionItemAuthorization_Draft_ParamsType {
|
|
1128
1271
|
resourceId: string;
|
|
1129
1272
|
itemId: string;
|
|
1130
|
-
resolveResources: {
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
}[];
|
|
1273
|
+
// resolveResources: {
|
|
1274
|
+
// resourceId: string;
|
|
1275
|
+
// contracts: {
|
|
1276
|
+
// policyId: string;
|
|
1277
|
+
// }[];
|
|
1278
|
+
// }[];
|
|
1136
1279
|
}
|
|
1137
1280
|
|
|
1138
1281
|
export function updateCollectionItemAuthorization_Draft({
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1282
|
+
resourceId,
|
|
1283
|
+
itemId,
|
|
1284
|
+
...data
|
|
1285
|
+
}: UpdateCollectionItemAuthorization_Draft_ParamsType) {
|
|
1143
1286
|
return FUtil.Request({
|
|
1144
1287
|
method: 'PUT',
|
|
1145
1288
|
// url: `/v2/resources/catalogues/${resourceId}/items/${itemId}`,
|
|
1146
1289
|
url: `/v2/resources/catalogues/drafts/${resourceId}/items/${itemId}`,
|
|
1147
|
-
data:
|
|
1290
|
+
data: data,
|
|
1148
1291
|
});
|
|
1149
1292
|
}
|
|
1150
1293
|
|
|
@@ -1154,17 +1297,20 @@ interface AddResourceItems_Draft_ParamsType {
|
|
|
1154
1297
|
addCollectionItems: {
|
|
1155
1298
|
resourceId: string;
|
|
1156
1299
|
itemTitle: string;
|
|
1157
|
-
resolveResources?: {
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
}[];
|
|
1300
|
+
// resolveResources?: {
|
|
1301
|
+
// resourceId: string;
|
|
1302
|
+
// contracts: {
|
|
1303
|
+
// policyId: string;
|
|
1304
|
+
// }[];
|
|
1305
|
+
// }[];
|
|
1163
1306
|
}[];
|
|
1164
|
-
isPublish
|
|
1307
|
+
isPublish?: 1 | 0;
|
|
1165
1308
|
}
|
|
1166
1309
|
|
|
1167
|
-
export function addResourceItems_Draft({
|
|
1310
|
+
export function addResourceItems_Draft({
|
|
1311
|
+
resourceId,
|
|
1312
|
+
...params
|
|
1313
|
+
}: AddResourceItems_Draft_ParamsType) {
|
|
1168
1314
|
return FUtil.Request({
|
|
1169
1315
|
method: 'POST',
|
|
1170
1316
|
url: `/v2/resources/catalogues/drafts/${resourceId}/items`,
|
|
@@ -1178,7 +1324,10 @@ interface GetCollectionItemsAuth_Draft_ParamsType {
|
|
|
1178
1324
|
itemIds: string;
|
|
1179
1325
|
}
|
|
1180
1326
|
|
|
1181
|
-
export function getCollectionItemsAuth_Draft({
|
|
1327
|
+
export function getCollectionItemsAuth_Draft({
|
|
1328
|
+
resourceId,
|
|
1329
|
+
...params
|
|
1330
|
+
}: GetCollectionItemsAuth_Draft_ParamsType) {
|
|
1182
1331
|
return FUtil.Request({
|
|
1183
1332
|
method: 'GET',
|
|
1184
1333
|
url: `/v2/resources/catalogues/drafts/${resourceId}/items/batchAuth`,
|