forked from Sander-Code/bsn-cloud-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbs-content-manager.d.ts
More file actions
3441 lines (3381 loc) · 159 KB
/
bs-content-manager.d.ts
File metadata and controls
3441 lines (3381 loc) · 159 KB
1
2
3
4
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* tslint:disable:quotemark max-line-length trailing-comma */
import {AssetLocation, AssetType, BsAssetData, BsAssetItem, BsAssetLocator, BsAssetThumbnail, BsnObjectPermission, BsnTagKeySpecification, BsnTagSpecification, BsSize, MediaType, BsAssetContainerLocator, BsAudioData, BsImageData, BsMediaFileData, BsnDataFeedReference, BsnPresentationReference, BsVideoData, MediaLegalityResults, BsnTextFeedProperties, BsnMediaFeedProperties, BsnDynamicPlaylistProperties, BsnFilterSpecification, BsnTaggedListSpecification, BsnTaggedPlaylistProperties, BsnTagSortSpecification, BsnHtmlSiteAssetItem, BsnHtmlSiteProperties, BsnGroupItem, BsnPresentationProperties, BsnPresentationStatus, BsUploadItemResult, FileSpec, BsAssetSpecification, PublishData, PresentationScheduleItem, BsnAutorunProperties, PlayerModel, BsDsSetupParams, DeviceNetworkingConfiguration, BDeployDevice, BsUploadFileItemSpec, BsUploadFileProgress, BsUploadWebPageProgress, BsUploadWebPageSessionSpec, BsUploadItemStatus, BsRoleOperationPermission, BseChildAssetType, BsnTagKeyPatternSpecification, BsnTagValuePatternSpecification} from './bscore';
import {DmBsProjectState, DmState, BsDmId} from './bsdatamodel';
import {BsnRegularGroupEntity, BsnDeviceHealthStatus, BsnDeviceField, BsnFilter, BsnDeviceDownloadEntity, BsnDeviceEntity, BsnDeviceErrorEntity, BsnDeviceUpdateData, BsniDeviceLogFilter, BsniDeviceLogSortElement, BsniDeviceLogRecord, BsnDeviceSubscriptionEntity, BsnPermissionEntity, BsnPermissionPrincipalRoleInfoEntity, BsnPermissionPrincipalUserInfoEntity, BsnRoleEntity, BsnUserEntity, BsnBusinessOperationEntity, BsnBusinessOperationType, BsnOperationAction, BsnSession} from './bsnconnector';
import {BsTask, BsTaskId, BsTaskManager, BsTaskProgress, BsTaskResult, BsTaskStatus, BsTaskType} from './bs-task-manager';
import {PlDmState} from './bs-playlist-dm';
export interface CmThumbnail {
url: string;
size: BsSize | null;
hash: string | null;
}
/**
* Base for both CmiAsset and CmiAssetContainer
* This interfaces holds properties that are common to both of these fundamental objects.
*/
export interface CmiAssetBase {
/**
* Asset or Container name
*/
readonly name: string;
/**
* AssetItem type (always Folder for a container)
*/
readonly assetType: AssetType;
/**
* AssetItem/Container location (Local or BSN)
*/
readonly assetLocation: AssetLocation;
/**
* AssetItem/Container scope (BSN network name or local machine ID)
*/
readonly assetScope: string;
/**
* AssetItem/Folder creation date
* Null if not a network based asset or a system container.
*/
readonly creationDate: Date | null;
/**
* AssetItem/Folder last modified date
*/
readonly lastModifiedDate: Date | null;
/**
* AssetItem/Container parent path (without base name)
*/
readonly dirPath: string;
/**
* AssetItem/Container full path (including base name/extension)
*/
readonly fullPath: string;
/**
* Return locatorHash for the asset - the locatorHash
* is used in asset management operations, and also depends on asset scope.
*/
readonly locatorHash: string;
/**
* Simple cloned BsAssetLocator object containing the data necessary to locate the asset or container.
*/
readonly assetLocator: BsAssetLocator;
/**
* AssetItem media type - this applies only to AssetType.Content assets.
*/
readonly mediaType: MediaType;
/**
* Simple cloned BsAssetItem object for use with bsDataModel, etc.
* This returned item does not include assetData, assetUsage, or local asset permissions.
* AssetData contents can be accessed by accessors in derived CmiAsset classes.
* AssetUsage contents can be accessed by accessors in derived CmiAsset classes
* for AssetTypes that maintain usage data.
* For AssetContainers, this returns a simplified AssetItem structure to allow the containers to be handled
* by the same code that handles regular assets.
*/
readonly assetItem: BsAssetItem;
}
/**
* CmiAsset and its extended 'sub-classes' encapsulate file/folder information contained in the BsAssetItem object,
* plus additional derived data and functionality specific to the each asset type.
*/
export interface CmiAsset extends CmiAssetBase {
/**
* AssetItem size (in bytes)
*/
readonly fileSize: number;
/**
* If a network based asset, the upload date for the asset.
* Null if not a network based asset.
*/
readonly uploadDate: Date | null;
/**
* AssetItem locatorKey - this is a unique key string for each asset based on its actual location within its
* scope. This value is typically used to determine asset uniqueness within a data model, and can be used
* to key a map of assets used within the data model. If an asset has a locator key value equivalent to an asset
* already in the collection, the assets are assumed to be the same. The locatorKey algorithm is defined in
* the bsCore package.
*/
readonly locatorKey: string;
/**
* Get assetData associated with this asset. Some assets that are parts
* of other compound assets such as a DynamicPlaylist or a MediaFeed will have assetData objects
* such as BsnDynamicPlaylistItemProperties or BsnMediaFeedItemProperties.
*/
readonly assetData: BsAssetData | null;
/** True if this is a temporary asset (i.e., it is not backed by a cached assetItem) */
readonly isTemporaryAsset: boolean;
/** @deprecated use property 'locatorKey' */
readonly locator: string;
/** @deprecated this will go away when content-manager-store is refactored. */
readonly rawAssetItem: BsAssetItem;
/**
* Get thumbnail for asset file, if asset is a video or an image file.
* This function is potentially asynchronous and returns a Promise.
* This function caches newly created thumbnails and will return data from the ThumbnailCache if the
* thumbnail info is stored there.
* This function can be called in a non-renderer environment to retrieve thumbnail data, however
* it is expected that the getThumbnail will be normally used from the renderer process.
* @returns {Promise<BsAssetThumbnail | null>}
* Returned thumbnail may be either BsNetworkAssetThumbnail or BsLocalAssetThumbnail.
* Note: thumbnails returned from this method for local system files are raw data, not browser blobs.
*/
getAssetThumbnail(): Promise<BsAssetThumbnail | null>;
/**
* Return URL and thumbnail metadata for thumbnail that can be used in renderer.
* This method must be called in the renderer process for local assets on a desktop system.
* Any blob created for a local file asset will be cached in the CmiAsset object.
*
* @returns {Promise<CmThumbnail | null>} CmThumbnail object with URL, size, and hash for the thumbnail,
* or null is thumbnail URL cannot be created or found.
* Note: currently, size and has for BSN thumbnails will be null.
*/
getThumbnail(): Promise<CmThumbnail | null>;
/**
* Return fileHash (SHA1) for the asset. This function can be overridden in subclasses to compute
* the hash if it is not present. The function will resolve with null if the hash cannot be obtained.
* @returns {Promise<string | null>}
*/
getFileHash(): Promise<string | null>;
/**
* Retrieve the asset data for this asset. This is useful in cases where the asset was constructed from
* an assetItem that may have been incomplete, or simply to refresh the data
* @return {Promise<CmiAsset>} current object, after update
*/
fetchAssetItemData(): Promise<CmiAsset>;
/**
* Check to see if the asset exists at its declared AssetLocation.
* @returns {Promise<boolean>}
*/
testAssetExists(): Promise<boolean>;
replacePermissions(objectPermissions: BsnObjectPermission[]): Promise<CmiAsset>;
setTags(tags: BsnTagSpecification[]): Promise<void>;
deleteTags(tagKeys: BsnTagKeySpecification[]): Promise<void>;
}
/** @deprecated renamed to CmiAsset */
export type BsAssetBase = CmiAsset;
export interface CmiContentAsset extends CmiAsset {
/**
* Return list of permissions associated with asset.
*/
readonly permissions: BsnObjectPermission[];
/**
* Move content asset to the specified path.
* @param destinationPath
*/
moveAsset(destinationPath: string): Promise<void>;
}
export interface CmiFolderAsset extends CmiContentAsset {
/**
* True if the folder asset has sub-folders. Will return null if it is not known if the folder has subfolders.
*/
readonly hasSubFolders: boolean | null;
/**
* True if the folder asset contains files. Will return null if it is not known if the folder contains files.
*/
readonly hasFiles: boolean | null;
/**
* Simple cloned BsAssetContainerLocator object containing the data necessary to locate the folder.
* Returns BsAssetContainerLocator since a folder is a container of other assets.
*/
readonly assetLocator: BsAssetContainerLocator;
/**
* Retrieve the asset data for this asset. This is useful in cases where the asset was constructed from
* an assetItem that may have been incomplete. This function refreshes the assetItem data from the file source.
*/
fetchAssetItemData(): Promise<CmiFolderAsset>;
/**
* Replace all object permissions for the current asset with the given permission list.
* @param objectPermissions {BsnObjectPermission[]}
* @returns {Promise<CmcFolderAsset>}
*/
replacePermissions(objectPermissions: BsnObjectPermission[]): Promise<CmiFolderAsset>;
}
/** @deprecated use CmiFolderAsset */
export type BsFolderAsset = CmiFolderAsset;
export interface CmiMediaAsset extends CmiContentAsset {
/**
* Return list of presentation reference objects for all presentations using this media asset.
*/
readonly presentationList: BsnPresentationReference[];
/**
* Return count of presentations using this media asset.
*/
readonly presentationCount: number;
/**
* Return list of dynamic playlist reference objects for all dynamic playlists using this media asset.
*/
readonly dynamicPlaylistList: BsnDataFeedReference[];
/**
* Return count of dynamic playlists using this media asset.
*/
readonly dynamicPlaylistCount: number;
/**
* Return list of media feed reference objects for all media feeds using this media asset.
*/
readonly liveMediaFeedList: BsnDataFeedReference[];
/**
* Return count of media feeds using this media asset.
*/
readonly liveMediaFeedCount: number;
/**
* Return list of tagged playlist reference objects for all tagged playlists using this media asset.
*/
readonly taggedPlaylistList: BsnDataFeedReference[];
/**
* Return count of tagged playlists using this media asset.
*/
readonly taggedPlaylistCount: number;
/**
* Return array of tags.
*/
readonly tags: Array<Readonly<BsnTagSpecification>>;
/**
* Get video metadata, if asset is a video file. Return null if not a video file.
* This function is potentially asynchronous and returns a Promise.
*/
getVideoData(): Promise<BsVideoData | null>;
/**
* Get audio metadata, if asset is a video or an audio file. Return null if not a video or audio file.
* This function is potentially asynchronous and returns a Promise.
* For video files, this function returns BsVideoData, which is a superset if BsAudioData.
*/
getAudioData(): Promise<BsAudioData | BsVideoData | null>;
/**
* Get image metadata, if asset is an image file. Return null if not an image file.
* This function is potentially asynchronous and returns a Promise.
*/
getImageData(): Promise<BsImageData | null>;
/**
* Get media file metadata (for any type of media file.
*/
getMediaFileData(): Promise<BsMediaFileData | null>;
isMediaFileLegalForProject(state: DmBsProjectState | DmState): Promise<MediaLegalityResults>;
/**
* Retrieve the asset data for this asset. This is useful in cases where the asset was constructed from
* an assetItem that may have been incomplete. This function refreshes the assetItem data from the file source.
*/
fetchAssetItemData(): Promise<CmiMediaAsset>;
/**
* Replace all object permissions for the current asset with the given permission list.
* @param objectPermissions {BsnObjectPermission[]}
* @returns {Promise<CmcMediaAsset>}
*/
replacePermissions(objectPermissions: BsnObjectPermission[]): Promise<CmiMediaAsset>;
}
/** @deprecated use CmiMediaAsset */
export type BsMediaAsset = CmiMediaAsset;
/**
* CmiTextFeedAsset encapsulates an assetItem of type
* AssetType.[BSNDataFeed, BSNMediaFeed, BSNDynamicPlaylist, BSNTaggedPlaylist]
* Methods are provided to access the data feed content.
*/
export interface CmiTextFeedAsset extends CmiAsset {
/**
* Return true if feed content data has been retrieved
*/
readonly isContentDataValid: boolean;
/**
* Basic TextFeed properties (null if TextFeed name is not found).
* The object returned from this is guaranteed only to contain basic properties. This object contains the entire
* object returned from BSN, and some of the basic values in this object are copied to the base BsAssetItem.
* Tis object can be used to retrieve data feed specific information.
* The 'items' list may be null, as that is not retrieved in a basic enumeration.
* To get TextFeed properties with a guaranteed complete items list, call {@link getFeedInfoWithContent}
*/
readonly feedInfo: BsnTextFeedProperties | null;
/**
* Return list of presentation reference objects for all presentations using this text feed.
*/
readonly presentationList: BsnPresentationReference[];
/**
* Return count of presentations using this text feed.
*/
readonly presentationCount: number;
/**
* Return list of permissions associated with the text feed.
*/
readonly permissions: BsnObjectPermission[];
/**
* Get full TextFeed properties object, including media feed item or content list.
* Once the item list has been retrieved for this media feed, this method will resolve immediately since the
* properties object is cached within the assetData.
*
* @returns {Promise<BsnTextFeedProperties>} a Promise that will resolve with the TextFeed properties object
*/
getFeedInfoWithContent(): Promise<BsnTextFeedProperties>;
/**
* Retrieve the asset data for this asset. This is useful in cases where the asset was constructed from
* an assetItem that may have been incomplete. This function refreshes the assetItem data from the file source.
*/
fetchAssetItemData(): Promise<CmiTextFeedAsset>;
/**
* Replace all object permissions for the current asset with the given permission list.
* @param objectPermissions {BsnObjectPermission[]}
* @returns {Promise<CmcTextFeedAsset>}
*/
replacePermissions(objectPermissions: BsnObjectPermission[]): Promise<CmiTextFeedAsset>;
/**
* Update text feed with new textFeed data model state
* @param state - textFeed state
*/
updateTextFeed(state: object): Promise<void>;
}
/** @deprecated use CmiTextFeedAsset */
export type BsTextFeedAsset = CmiTextFeedAsset;
/**
* CmiMediaFeedAsset encapsulates an assetItem of type AssetType.BSNMediaFeed.
* Methods are provided to access the media feed content.
*/
export interface CmiMediaFeedAsset extends CmiAsset {
/**
* Return true if feed content data has been retrieved
*/
readonly isContentDataValid: boolean;
/**
* Basic MediaFeed properties.
* The object returned from this is guaranteed only to contain basic properties. This object contains the entire
* object as returned from BSN, and some of the basic values in this object are copied to the base BsAssetItem.
* Tis object can be used to retrieve data feed specific information.
* The 'content' list may be null, as that is not retrieved in a basic enumeration.
* To get MediaFeed properties with a guaranteed complete content list, call {@link getFeedInfoWithContent}
*/
readonly feedInfo: BsnMediaFeedProperties | null;
/**
* Return list of presentation reference objects for all presentations using this media feed.
*/
readonly presentationList: BsnPresentationReference[];
/**
* Return count of presentations using this media feed.
*/
readonly presentationCount: number;
/**
* Return list of permissions associated with the media feed.
*/
readonly permissions: BsnObjectPermission[];
/**
* Get full MediaFeed properties object, including media feed content list.
* Once the item list has been retrieved for this media feed, this method will resolve immediately since the
* properties object is cached within the assetData.
*/
getFeedInfoWithContent(): Promise<BsnMediaFeedProperties>;
/**
* Return the custom field names for mediaFeed items. This returns a Promise because ity may be necessary
* to retrieve the media feed content.
*/
getCustomFieldNames(): Promise<string[]>;
/**
* Retrieve the asset data for this asset. This is useful in cases where the asset was constructed from
* an assetItem that may have been incomplete. This function refreshes the assetItem data from the file source.
*/
fetchAssetItemData(): Promise<CmiMediaFeedAsset>;
/**
* Replace all object permissions for the current asset with the given permission list.
*/
replacePermissions(objectPermissions: BsnObjectPermission[]): Promise<CmiMediaFeedAsset>;
/**
* Update media feed with new mediaFeed data model state
* @param state - mediaFeed state
*/
updateMediaFeed(state: object): Promise<void>;
}
/** @deprecated use CmiMediaFeedAsset */
export type BsMediaFeedAsset = CmiMediaFeedAsset;
/**
* CmiDynamicPlaylistAsset encapsulates an assetItem of type AssetType.BSNDynamicPlaylist.
* Methods are provided to access the data feed content.
*/
export interface CmiDynamicPlaylistAsset extends CmiAsset {
/**
* Return true if feed content data has been retrieved
*/
readonly isContentDataValid: boolean;
/**
* Basic DynamicPlaylist properties.
* The object returned from this is guaranteed only to contain basic properties. This object contains the entire
* object as returned from BSN, and some of the basic values in this object are copied to the base BsAssetItem.
* This object can be used to retrieve data feed specific information.
* The 'items' or 'content' list may be null, as that is not retrieved in a basic enumeration.
* To get DynamicPlaylist properties with a guaranteed complete items or content list,
* call {@link getFeedInfoWithContent}
*/
readonly feedInfo: BsnDynamicPlaylistProperties | null;
/**
* Return list of presentation reference objects for all presentations using this dynamic playlist.
*/
readonly presentationList: BsnPresentationReference[];
/**
* Return count of presentations using this dynamic playlist.
*/
readonly presentationCount: number;
/**
* Return list of permissions associated with the dynamic playlist.
*/
readonly permissions: BsnObjectPermission[];
/**
* Get full DynamicPlaylist properties object, including media feed content list.
* Once the item list has been retrieved for this media feed, this method will resolve immediately since the
* properties object is cached within the assetData.
*/
getFeedInfoWithContent(): Promise<BsnDynamicPlaylistProperties>;
/**
* Retrieve the asset data for this asset. This is useful in cases where the asset was constructed from
* an assetItem that may have been incomplete. This function refreshes the assetItem data from the file source.
*/
fetchAssetItemData(): Promise<CmiDynamicPlaylistAsset>;
/**
* Replace all object permissions for the current asset with the given permission list.
* @param objectPermissions
*/
replacePermissions(objectPermissions: BsnObjectPermission[]): Promise<CmiDynamicPlaylistAsset>;
/**
* Update dynamic playlist with new dynamicPlaylist data model state
* @param state - dynamicPlaylist state
*/
updateDynamicPlaylist(state: object): Promise<void>;
}
/** @deprecated use CmiDynamicPlaylistAsset */
export type BsDynamicPlaylistAsset = CmiDynamicPlaylistAsset;
/**
* CmiTaggedPlaylistAsset encapsulates an assetItem of type AssetType.BSNTaggedPlaylist.
* Methods are provided to access the data feed content.
*/
export interface CmiTaggedPlaylistAsset extends CmiAsset {
/**
* Return true if feed content data has been retrieved
*/
readonly isContentDataValid: boolean;
/**
* Basic TaggedPlaylist properties.
* The object returned from this is guaranteed only to contain basic properties. This object contains the entire
* object as returned from BSN, and some of the basic values in this object are copied to the base BsAssetItem.
* Tis object can be used to retrieve data feed specific information.
* The 'items' or 'content' list may be null, as that is not retrieved in a basic enumeration.
* To get TaggedPlaylist properties with a guaranteed complete items or content list,
* call {@link getFeedInfoWithContent}
*/
readonly feedInfo: BsnTaggedPlaylistProperties | null;
/**
* VirtualPath for the contents of the tagged playlist
* If this object does not have valid feedInfo data, null is returned.
*/
readonly contentsVirtualPath: string | null;
/**
* TaggedPlaylist rule, expressed as a BsnFilterSpecification.
* If this object does not have valid feedInfo data, null is returned.
*/
readonly tagRuleFilterSpecification: BsnFilterSpecification | null;
/**
* TaggedPlaylist sort specification, expressed as BsnTagSortSpecification.
* If this object does not have valid feedInfo data, null is returned.
*/
readonly tagSortSpecification: BsnTagSortSpecification | null;
/**
* TaggedPlaylistSpecification, expressed as BsnTaggedListSpecification.
* If this object does not have valid feedInfo data, null is returned.
*/
readonly taggedPlaylistSpecification: BsnTaggedListSpecification | null;
/**
* Return list of presentation reference objects for all presentations using this tagged playlist.
*/
readonly presentationList: BsnPresentationReference[];
/**
* Return count of presentations using this tagged playlist.
*/
readonly presentationCount: number;
/**
* Return list of permissions associated with tagged playlist.
*/
readonly permissions: BsnObjectPermission[];
/**
* Get full TaggedPlaylist properties object, including media feed content list.
* Once the item list has been retrieved for this media feed, this method will resolve immediately since the
* properties object is cached within the assetData.
*/
getFeedInfoWithContent(): Promise<BsnTaggedPlaylistProperties>;
/**
* Retrieve the asset data for this asset. This is useful in cases where the asset was constructed from
* an assetItem that may have been incomplete. This function refreshes the assetItem data from the file source.
*/
fetchAssetItemData(): Promise<CmiTaggedPlaylistAsset>;
/**
* Replace all object permissions for the current asset with the given permission list.
*/
replacePermissions(objectPermissions: BsnObjectPermission[]): Promise<CmiTaggedPlaylistAsset>;
/**
* Update tagged playlist with new taggedPlaylist data model state
* @param state - taggedPlaylist state
*/
updateTaggedPlaylist(state: object): Promise<void>;
}
/** @deprecated use CmiTaggedPlaylistAsset */
export type BsTaggedPlaylistAsset = CmiTaggedPlaylistAsset;
/**
* CmiHtmlSiteAsset encapsulates an assetItem of type AssetType.HtmlSite
* Methods are provided to access the HtmlSite content.
*/
export interface CmiHtmlSiteAsset extends CmiAsset {
/**
* If site is a BSN based web site, this will return the BSN property info for the site. If getHtmlSiteAssetList
* has been called, the 'assets' property will hold a list of file assets associated with the site.
*/
readonly htmlSiteInfo: BsnHtmlSiteProperties | null;
/**
* If site is a BSN based web site, this will return the BSN indexFile property for the site.
*/
readonly indexFile: BsnHtmlSiteAssetItem | null;
/**
* Return list of presentation reference objects for all presentations using this HTML Site.
*/
readonly presentationList: BsnPresentationReference[];
/**
* Return count of presentations using this HTML Site.
*/
readonly presentationCount: number;
/**
* Return list of permissions associated with the HTML site.
*/
readonly permissions: BsnObjectPermission[];
/**
* Return list of assets associated with the HTML Site (i.e., files other than the index file.)
*/
getHtmlSiteAssetList(): Promise<BsnHtmlSiteAssetItem[] | null>;
/**
* Retrieve the asset data for this asset. This is useful in cases where the asset was constructed from
* an assetItem that may have been incomplete. This function refreshes the assetItem data from the file source.
*/
fetchAssetItemData(): Promise<CmiHtmlSiteAsset>;
/**
* Replace all object permissions for the current asset with the given permission list.
*/
replacePermissions(objectPermissions: BsnObjectPermission[]): Promise<CmiHtmlSiteAsset>;
}
/** @deprecated use CmiHtmlSiteAsset */
export type BsHtmlSiteAsset = CmiHtmlSiteAsset;
/**
* CmiDeviceWebPageAsset encapsulates an assetItem of type AssetType.DeviceHtmlSite
* Methods are provided to access the DeviceHtmlSite content.
*/
export interface CmiDeviceWebPageAsset extends CmiAsset {
/**
* For a BSN DeviceWebPage, this will return the BSN property info for the webPage. If getDeviceWebPageAssetList
* has been called, the 'assets' property will hold a list of file assets associated with the webPage.
*/
readonly deviceWebPageInfo: BsnHtmlSiteProperties | null;
/**
* This will return the BSN indexFile property for the deviceWebPage.
*/
readonly indexFile: BsnHtmlSiteAssetItem | null;
/**
* Return list of presentation reference objects for all presentations using this deviceWebPage.
*/
readonly presentationList: BsnPresentationReference[];
/**
* Return count of presentations using this deviceWebPage.
*/
readonly presentationCount: number;
/**
* Return list of permissions associated with the deviceWebPage.
*/
readonly permissions: BsnObjectPermission[];
/**
* Return list of assets associated with the deviceWebPage (i.e., files other than the index file.)
*/
getDeviceWebPageAssetList(): Promise<BsnHtmlSiteAssetItem[] | null>;
/**
* Retrieve the asset data for this asset. This is useful in cases where the asset was constructed from
* an assetItem that may have been incomplete. This function refreshes the assetItem data from the file source.
*/
fetchAssetItemData(): Promise<CmiDeviceWebPageAsset>;
/**
* Replace all object permissions for the current asset with the given permission list.
* @param objectPermissions {BsnObjectPermission[]}
* @returns {Promise<BsDeviceWebPageAsset>}
*/
replacePermissions(objectPermissions: BsnObjectPermission[]): Promise<CmiDeviceWebPageAsset>;
}
/** @deprecated use CmiDeviceWebPageAsset */
export type BsDeviceWebPageAsset = CmiDeviceWebPageAsset;
export interface CmiPresentationSaveOptions {
autorunVersion?: string;
}
export interface CmiPresentationPublishOptions extends CmiPresentationSaveOptions {
autoplayFileData?: object | null;
resourcesFileData?: Uint8Array;
resourcesFileId?: number;
userDefinedEventsData?: object | null;
userDefinedEventsId?: number;
}
/**
* CmiPresentationAsset encapsulates an assetItem of type AssetType.Project or AssetType.ProjectBpf.
* Methods are provided to manage the presentation defined by the asset (update, open, etc.)
*/
export interface CmiPresentationAsset extends CmiAsset {
readonly presentationProperties: BsnPresentationProperties | null;
readonly presentationBsnStatus: BsnPresentationStatus;
readonly isScheduledOnBsn: boolean;
readonly bsnGroups: BsnGroupItem[] | null;
readonly dependentPresentationNames: string[];
/**
* Return list of permissions associated with presentation.
*/
readonly permissions: BsnObjectPermission[];
/**
* Retrieve the asset data for this asset. This is useful in cases where the asset was constructed from
* an assetItem that may have been incomplete. This function refreshes the assetItem data from the file source.
*/
fetchAssetItemData(): Promise<CmiPresentationAsset>;
/**
* Retrieve BSN presentationProperties for the presentation, fetching data from BSN if necessary.
* Returns null if assetLocation is not BSN.
*/
getPresentationProperties(): Promise<BsnPresentationProperties | null>;
/**
* Replace all object permissions for the current asset with the given permission list.
* @param objectPermissions
*/
replacePermissions(objectPermissions: BsnObjectPermission[]): Promise<CmiPresentationAsset>;
/**
* Retrieve project state.
*/
getProjectState(): Promise<DmBsProjectState | DmState>;
/**
* Retrieve AssetLocators of the presentation dependencies for the presentation asset
* (i.e., linked presentations.)
*/
getLinkedPresentationAssetLocators(): Promise<BsAssetLocator[]>;
/**
* Update project with new project state. On BSN, this will set the presentation to Draft mode, even
* it is currently in Published mode.
* If autorunVersion is not specified in options, CurrentAutorunVersion will be used,
* However, if the presentation is scheduled on BSN to one or more groups, an exception will be thrown.
* @param state - project state
* @param [options] {CmiPresentationSaveOptions} - autorun version string
*/
saveProjectState(state: DmBsProjectState | DmState, options?: CmiPresentationSaveOptions): Promise<BsAssetItem>;
/**
* Supported only for BSN at present - will be rejected for local presentations.
* Update project with project state, upload autoplay and other presentation execution files, and specify
* all presentation assets to the presentation entity. This will set the presentation to Published mode.
* If autoplayFile object is not supplied in options parameter, it will be automatically generated
* from the project state.
* @param state - project state
* @param options - publish options (autoplayFile object, resources file, etc.)
*/
publish(state: DmBsProjectState | DmState, options?: CmiPresentationPublishOptions): Promise<BsAssetItem>;
}
/** @deprecated use CmiPresentationAsset */
export type BsPresentationAsset = CmiPresentationAsset;
/**
* CmiBrightScriptAsset encapsulates an assetItem of type AssetType.BrightScript
*/
export interface CmiBrightScriptAsset extends CmiAsset {
savePlugin(file: FileSpec): Promise<BsUploadItemResult>;
/**
* Retrieve the asset data for this asset. Overridden to provide the correct return type.
*/
fetchAssetItemData(): Promise<CmiBrightScriptAsset>;
}
/** @deprecated use CmiBrightScriptAsset */
export type BsBrightScriptAsset = CmiBrightScriptAsset;
export interface CmiScheduleAsset extends CmiAsset {
/**
* Update schedule with new schedule state.
*
* @param state - schedule state
*/
saveSchedule(state: object): Promise<BsAssetItem>;
/**
* Retrieve schedule state
*/
getScheduleState(): Promise<object>;
}
/** @deprecated use CmiScheduleAsset */
export type BsScheduleAsset = CmiScheduleAsset;
export interface BsAssetItemMatchProperties {
name: string;
fileHash: string | null;
destinationPath?: string | null;
}
/**
* The CmiAssetCollection interface encapsulates enumeration of a file system folder for any supported AssetLocation.
* Enumeration is updated via the update method, and can be filtered.
* After updating, the object holds a map of enumerated CmiAsset objects for each enumerated file or folder.
*
* @class CmcAssetCollection
*/
export interface CmiAssetCollection {
/**
* True if collection has finished updating all assets.
* If not, updateNext can be called again to enumerate next group of assets
*/
readonly isComplete: boolean;
/**
* Determines the base location (local or BSN) of the folder to be enumerated.
* On browser based systems, any attempt to set the assetLocation to the local file system will silently fail.
*/
readonly currentAssetLocation: AssetLocation;
/**
* Return the primary assetType for assets in this collection. This is
* always the first assetType entry in the assetTypes array, and generally corresponds to the main
* type of asset in the array, with secondary types such as AssetType.Folder following. For true
* multi-type collections (on local systems,) this value may not have much significance.
*/
readonly assetType: AssetType;
/**
* Array of AssetTypes included in the collection, or null
* if no AssetType filter was applied. For collections that can only enumerate one primary assetType (e.g., BSN,)
* the primary assetType is the first array element. In such cases, 'secondary' assetTypes are limited
* to types such as AssetType.Folder (if an asset types can be organized by folder - e.g., Content,) or related
* related assetTypes (such as AssetType.ProjectBpf legacy project files.)
*/
readonly assetTypes: AssetType[];
/**
* Directory path for the current enumerated directory.
*/
readonly currentDirectory: string;
/**
* Determines the scope (BSN network name or local machine ID) of the collection
*/
readonly currentAssetScope: string;
/**
* Enumeration options for this enumerator.
* This includes options such as MediaType filters for content enumerators, whether or not sub-folders
* are included, etc.
*/
readonly enumerationOptions: CmiAssetEnumerationOptions;
/**
* SortField property can be set with enumeration options when collection is created, and can be set
* at any time after that using the setSortOptions method.
* This is the field on which asset name lists are sorted.
*/
readonly sortField: AssetSortField;
/**
* SortDescending property can be set with enumeration options when collection is created, and can be set
* at any time after that using the setSortOptions method.
* True if asset name lists are sorted in descending order.
*/
readonly sortDescending: boolean;
/**
* Set of sort fields that can be used for assets in the collection.
*/
readonly sortFieldSet: Set<AssetSortField>;
/**
* Return or set current sort options.
*/
sortOptions: CmiSortOptions;
/**
* Array of names of all enumerated file and/or folder asset items.
*/
readonly assetNames: string[];
/**
* Array of names of newly enumerated file and/or folder asset items.
* If the enumeration is segmented (as from BSN) this returns only the names of newly enumerated assets.
*/
readonly newAssetNames: string[];
/**
* Array of names of newly added asset items.
*/
readonly addedAssetNames: string[];
/**
* Array of names of newly updated asset items.
*/
readonly updatedAssetNames: string[];
/**
* Array of names of removed asset items.
*/
readonly removedAssetNames: string[];
/**
* Array of names of pinned asset items. Pinned assetItems are assetItems that are pre-loaded
* and/or persist across enumerations.
*/
readonly pinnedAssetNames: string[];
/**
* Array of names of all enumerated folder (subdirectory) asset items.
*/
readonly folderAssetNames: string[];
/**
* Array of names of all enumerated file asset items.
*/
readonly fileAssetNames: string[];
/**
* Array of AssetLocator objects for all enumerated asset items, in current sort order.
*/
readonly assetLocators: BsAssetLocator[];
/**
* Array of AssetLocator objects for all enumerated folder (subdirectory) asset items, in current sort order.
*/
readonly folderAssetLocators: BsAssetLocator[];
/**
* Array of AssetLocator objects for enumerated file asset items, in current sort order.
*/
readonly fileAssetLocators: BsAssetLocator[];
/**
* Array of locatorHash strings for all enumerated asset items, in current sort order.
*/
readonly assetLocatorHashes: string[];
/**
* Array of locatorHash strings for all enumerated folder (subdirectory) asset items, in current sort order.
*/
readonly folderLocatorHashes: string[];
/**
* Array of locatorHash strings for enumerated file asset items, in current sort order.
*/
readonly fileLocatorHashes: string[];
/**
* Array of CmiFolderAsset objects for all enumerated folder (subdirectory) asset items.
*/
readonly folderAssets: CmiFolderAsset[];
/**
* Array of CmiAsset objects for all enumerated file asset items.
*/
readonly fileAssets: CmiAsset[];
/**
* Array of CmiAsset objects for all added asset items.
*/
readonly addedAssets: CmiAsset[];
/**
* Array of CmiAsset objects for all updated asset items.
*/
readonly updatedAssets: CmiAsset[];
/**
* Array of CmiAsset objects for all removed asset items.
*/
readonly removedAssets: CmiAsset[];
/**
* Array of CmiAsset objects for all enumerated file and/or folder asset items.
*/
readonly allAssets: CmiAsset[];
/**
* Return a string that uniquely identifies all parameters of this collection,
* including AssetLocation, AssetTypes, directory path, and enumeration options.
*/
readonly locatorHash: string;
/** @deprecated Use property name locatorHash */
readonly functionalLocator: string;
/**
* Update asset directory from local file system or BSN and resolve with list of asset names. This method will
* enumerate all assets matching the search criteria in the asset folder, regardless of the number.
* In order to get resolution for each set of assets returned in a segmented enumeration (as from BSN,)
* use {@link startUpdate} and {@link updateNext}.
* This method restarts enumeration on each call.
* The promise resolves with an array of sorted asset names.
*/
update(): Promise<string[]>;
/**
* (Re)Start update of asset directory from local file system or BSN.
* Unlike {@link update}, if enumeration returns partial results (e.g., BSN with long asset lists), the promise
* returned from this method will resolve with the first segment of results. The caller should check the
* {@link isComplete} property to determine if updating is complete. If not, {@link updateNext} can be called
* to get the next segment.
* The collection object returned by the promise is the original, but updated, collection object
*/
startUpdate(): Promise<CmiAssetCollection>;
/**
* Continue updating asset directory from local file system or BSN
* This method should be called after an initial call to {@link startUpdate} or a subsequent call to this method
* when the {@link isComplete} property is false.
* The collection object returned by the promise is the original, but updated, collection object
*/
updateNext(): Promise<CmiAssetCollection>;
/**
* Update the AssetItem properties for all pinned assets.
*/
updatePinnedAssetItems(): Promise<CmiAssetCollection>;
/**
* Return count of assets on the asset storage backend matching the enumerationOptions
* for the collection
* The AssetCollection does NOT have to be updated before calling this method (i.e., the existing assets do not
* have to be enumerated.)
*/
getBackendCount(): Promise<number>;
/**
* Return list of assetItems that duplicate any of the names in the given nameList. If hashes are provided
* in the matchList, an item is NOT returned as a duplicate if the hashes match.
* The AssetCollection does NOT have to be updated before calling this method (i.e., the existing assets do not
* have to be enumerated.)
* @param matchList {BsAssetItemMatchProperties[]} - Object list where each object contains name and hash of
* each entity to be matched. Note: some entities don't have a hash.
*/
getDuplicateNames(matchList: BsAssetItemMatchProperties[]): Promise<BsAssetItem[]>;
/**
* Return list of assets that match the given filter options, in current sort order.
* @param filterOptions {CmiAssetFilterOptions}
*/
getFilteredAssets(filterOptions: CmiAssetFilterOptions): CmiAsset[];
/**
* Return list of assetLocators for assets that match the given filter options, in current sort order.
* @param filterOptions {CmiAssetFilterOptions}
*/
getFilteredAssetLocators(filterOptions: CmiAssetFilterOptions): BsAssetLocator[];
/**
* Set sort parameters for the collection.
*/
setSortOptions(sortField: AssetSortField, sortDescending?: boolean): void;
/**
* Return true if an asset with the given name is in the folder collection.
*/
hasAssetName(name: string): boolean;
/**
* Return AssetType for given asset name in the collection. If the name is not found in the collection,
* null is returned.
*/
getAssetTypeForName(name: string): AssetType | null;
/**
* Get asset names for all enumerated assets of given type.
* @param assetType (AssetType} - type to match for returned names
*/
getAssetNamesForType(assetType: AssetType): string[];
/**
* Get an array of all CmiAsset objects of given type.
* @param assetType - type to match for returned assetItems
*/
getAssetsForType(assetType: AssetType): CmiAsset[];
/**
* Get asset names for all enumerated Content assets of given MediaType.
* @param mediaType - mediaType to match for returned names
*/
getAssetNamesForMediaType(mediaType: MediaType): string[];
/**
* Get all enumerated Content CmiAsset objects of given MediaType.
* @param mediaType - mediaType to match for returned assetItems
*/
getAssetsForMediaType(mediaType: MediaType): CmiAsset[];
/**
* Get CmiAsset object for given asset name, or null if name is not found.
* For derived collections, this function will return an object derived from CmiAsset
* with specific functionality for the type of asset.
* @param name - Asset name (file or folder name)
*/
getAsset(name: string): CmiAsset | null;
/**
* Get CmiAsset object for given asset name in the removed asset list, or null if name is not found.
* @param name - Asset name (file or folder name)
*/
getRemovedAsset(name: string): CmiAsset | null;
isAssetTypeIncluded(assetType: AssetType): boolean;
/**
* Clear list of added assets.
*/
clearAddedAssets(): void;
/**
* Clear list of updated assets.
*/
clearUpdatedAssets(): void;
/**
* Clear list of removed assets.
*/
clearRemovedAssets(): void;
/**
* Unpin all pinned assetItems.
*/
unpinAllPinnedAssetItems(): void;
/**
* Create a folder within the AssetCollection.
* The AssetCollection does NOT have to be updated before calling this method (i.e., the existing assets do not
* have to be enumerated.)
* This method will fail and return null if folders are not supported for the collection (e.g., any BSN collection
* other than a Content collection.)
* This method will also fail on a collection built from an asset list, as there is no well-defined parent folder
* for that case.
* @param {string} name - name of the folder (directory) to be created
* @returns {Promise<BsAssetItem | null>} AssetItem representing the created folder
*/
createFolder(name: string): Promise<BsAssetItem | null>;
/**
* Remove a folder from the current collection. All folder contents are also removed.
* The AssetCollection does NOT have to be updated before calling this method (i.e., the existing assets do not
* have to be enumerated.)
* This method will fail and return null if folders are not supported for the collection (e.g., any BSN collection
* other than a Content collection.)
* This method will also throw an exception on a collection built from an asset list.