-
Notifications
You must be signed in to change notification settings - Fork 16
/
KalturaServices.js
11294 lines (10325 loc) · 354 KB
/
KalturaServices.js
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
// ===================================================================================================
// _ __ _ _
// | |/ /__ _| | |_ _ _ _ _ __ _
// | ' </ _` | | _| || | '_/ _` |
// |_|\_\__,_|_|\__|\_,_|_| \__,_|
//
// This file is part of the Kaltura Collaborative Media Suite which allows users
// to do with audio, video, and animation what Wiki platforms allow them to do with
// text.
//
// Copyright (C) 2006-2023 Kaltura Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// @ignore
// ===================================================================================================
const kaltura = require('./KalturaClientBase');
/**
*Class definition for the Kaltura service: accessControlProfile.
* The available service actions:
* @action add Add new access control profile.
* @action delete Delete access control profile by id.
* @action get Get access control profile by id.
* @action list List access control profiles by filter and pager.
* @action update Update access control profile by id.
*/
class accessControlProfile{
/**
* Add new access control profile.
* @param accessControlProfile AccessControlProfile
* @return KalturaAccessControlProfile
*/
static add(accessControlProfile){
let kparams = {};
kparams.accessControlProfile = accessControlProfile;
return new kaltura.RequestBuilder('accesscontrolprofile', 'add', kparams);
};
/**
* Delete access control profile by id.
* @param id int
*/
static deleteAction(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('accesscontrolprofile', 'delete', kparams);
};
/**
* Get access control profile by id.
* @param id int
* @return KalturaAccessControlProfile
*/
static get(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('accesscontrolprofile', 'get', kparams);
};
/**
* List access control profiles by filter and pager.
* @param filter AccessControlProfileFilter (optional, default: null)
* @param pager FilterPager (optional, default: null)
* @return KalturaAccessControlProfileListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('accesscontrolprofile', 'list', kparams);
};
/**
* Update access control profile by id.
* @param id int
* @param accessControlProfile AccessControlProfile
* @return KalturaAccessControlProfile
*/
static update(id, accessControlProfile){
let kparams = {};
kparams.id = id;
kparams.accessControlProfile = accessControlProfile;
return new kaltura.RequestBuilder('accesscontrolprofile', 'update', kparams);
};
}
module.exports.accessControlProfile = accessControlProfile;
/**
*Class definition for the Kaltura service: accessControl.
* The available service actions:
* @action add Add new Access Control Profile.
* @action delete Delete Access Control Profile by id.
* @action get Get Access Control Profile by id.
* @action list List Access Control Profiles by filter and pager.
* @action update Update Access Control Profile by id.
*/
class accessControl{
/**
* Add new Access Control Profile.
* @param accessControl AccessControl
* @return KalturaAccessControl
*/
static add(accessControl){
let kparams = {};
kparams.accessControl = accessControl;
return new kaltura.RequestBuilder('accesscontrol', 'add', kparams);
};
/**
* Delete Access Control Profile by id.
* @param id int
*/
static deleteAction(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('accesscontrol', 'delete', kparams);
};
/**
* Get Access Control Profile by id.
* @param id int
* @return KalturaAccessControl
*/
static get(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('accesscontrol', 'get', kparams);
};
/**
* List Access Control Profiles by filter and pager.
* @param filter AccessControlFilter (optional, default: null)
* @param pager FilterPager (optional, default: null)
* @return KalturaAccessControlListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('accesscontrol', 'list', kparams);
};
/**
* Update Access Control Profile by id.
* @param id int
* @param accessControl AccessControl
* @return KalturaAccessControl
*/
static update(id, accessControl){
let kparams = {};
kparams.id = id;
kparams.accessControl = accessControl;
return new kaltura.RequestBuilder('accesscontrol', 'update', kparams);
};
}
module.exports.accessControl = accessControl;
/**
*Class definition for the Kaltura service: adminUser.
* The available service actions:
* @action login Get an admin session using admin email and password (Used for login to the KMC application).
* @action resetPassword Reset admin user password and send it to the users email address.
* @action setInitialPassword Set initial users password.
* @action updatePassword Update admin user password and email.
*/
class adminUser{
/**
* Get an admin session using admin email and password (Used for login to the KMC application).
* @param email string
* @param password string
* @param partnerId int (optional, default: null)
* @return string
*/
static login(email, password, partnerId = null){
let kparams = {};
kparams.email = email;
kparams.password = password;
kparams.partnerId = partnerId;
return new kaltura.RequestBuilder('adminuser', 'login', kparams);
};
/**
* Reset admin user password and send it to the users email address.
* @param email string
*/
static resetPassword(email){
let kparams = {};
kparams.email = email;
return new kaltura.RequestBuilder('adminuser', 'resetPassword', kparams);
};
/**
* Set initial users password.
* @param hashKey string
* @param newPassword string new password to set
* @return KalturaAuthentication
*/
static setInitialPassword(hashKey, newPassword){
let kparams = {};
kparams.hashKey = hashKey;
kparams.newPassword = newPassword;
return new kaltura.RequestBuilder('adminuser', 'setInitialPassword', kparams);
};
/**
* Update admin user password and email.
* @param email string
* @param password string
* @param newEmail string Optional, provide only when you want to update the email (optional)
* @param newPassword string (optional)
* @param otp string the user's one-time password (optional, default: null)
* @return KalturaAdminUser
*/
static updatePassword(email, password, newEmail = '', newPassword = '', otp = null){
let kparams = {};
kparams.email = email;
kparams.password = password;
kparams.newEmail = newEmail;
kparams.newPassword = newPassword;
kparams.otp = otp;
return new kaltura.RequestBuilder('adminuser', 'updatePassword', kparams);
};
}
module.exports.adminUser = adminUser;
/**
*Class definition for the Kaltura service: analytics.
* The available service actions:
* @action query report query action allows to get a analytics data for specific query dimensions, metrics and filters.
*/
class analytics{
/**
* report query action allows to get a analytics data for specific query dimensions, metrics and filters.
* @param filter AnalyticsFilter the analytics query filter
* @param pager FilterPager the analytics query result pager (optional, default: null)
* @return KalturaReportResponse
*/
static query(filter, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('analytics', 'query', kparams);
};
}
module.exports.analytics = analytics;
/**
*Class definition for the Kaltura service: appToken.
* The available service actions:
* @action add Add new application authentication token.
* @action delete Delete application authentication token by ID.
* @action get Get application authentication token by ID.
* @action list List application authentication tokens by filter and pager.
* @action startSession Starts a new KS (kaltura Session) based on an application authentication token ID.
* @action update Update application authentication token by ID.
*/
class appToken{
/**
* Add new application authentication token.
* @param appToken AppToken
* @return KalturaAppToken
*/
static add(appToken){
let kparams = {};
kparams.appToken = appToken;
return new kaltura.RequestBuilder('apptoken', 'add', kparams);
};
/**
* Delete application authentication token by ID.
* @param id string
*/
static deleteAction(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('apptoken', 'delete', kparams);
};
/**
* Get application authentication token by ID.
* @param id string
* @return KalturaAppToken
*/
static get(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('apptoken', 'get', kparams);
};
/**
* List application authentication tokens by filter and pager.
* @param filter AppTokenFilter (optional, default: null)
* @param pager FilterPager (optional, default: null)
* @return KalturaAppTokenListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('apptoken', 'list', kparams);
};
/**
* Starts a new KS (kaltura Session) based on an application authentication token ID.
* @param id string application token ID
* @param tokenHash string a hash [MD5, SHA1, SHA256 and SHA512 are supported] of the current KS concatenated with the application token
* @param userId string session user ID, will be ignored if a different user ID already defined on the application token (optional, default: null)
* @param type int session type, will be ignored if a different session type is already defined on the application token (optional, enum: KalturaSessionType, default: null)
* @param expiry int session expiry (in seconds), could be overridden by shorter expiry of the application token (optional, default: null)
* @param sessionPrivileges string session privileges, will be ignored if a similar privilege is already defined on the application token or the privilege is server reserved (optional, default: null)
* @return KalturaSessionInfo
*/
static startSession(id, tokenHash, userId = null, type = null, expiry = null, sessionPrivileges = null){
let kparams = {};
kparams.id = id;
kparams.tokenHash = tokenHash;
kparams.userId = userId;
kparams.type = type;
kparams.expiry = expiry;
kparams.sessionPrivileges = sessionPrivileges;
return new kaltura.RequestBuilder('apptoken', 'startSession', kparams);
};
/**
* Update application authentication token by ID.
* @param id string
* @param appToken AppToken
* @return KalturaAppToken
*/
static update(id, appToken){
let kparams = {};
kparams.id = id;
kparams.appToken = appToken;
return new kaltura.RequestBuilder('apptoken', 'update', kparams);
};
}
module.exports.appToken = appToken;
/**
*Class definition for the Kaltura service: baseEntry.
* The available service actions:
* @action add Generic add entry, should be used when the uploaded entry type is not known.
* @action addContent Attach content resource to entry in status NO_MEDIA.
* @action addFromUploadedFile Generic add entry using an uploaded file, should be used when the uploaded entry type is not known.
* @action anonymousRank Anonymously rank an entry, no validation is done on duplicate rankings.
* @action approve Approve the entry and mark the pending flags (if any) as moderated (this will make the entry playable).
* @action clone Clone an entry with optional attributes to apply to the clone.
* @action count Count base entries by filter.
* @action delete Delete an entry.
* @action export .
* @action exportToCsv add batch job that sends an email with a link to download an updated CSV that contains list of entries.
* @action flag Flag inappropriate entry for moderation.
* @action get Get base entry by ID.
* @action getByIds Get an array of KalturaBaseEntry objects by a comma-separated list of ids.
* @action getContextData This action delivers entry-related data, based on the user's context: access control, restriction, playback format and storage information.
* @action getPlaybackContext This action delivers all data relevant for player.
* @action getRemotePaths Get remote storage existing paths for the asset.
* @action index Index an entry by id.
* @action list List base entries by filter with paging support.
* @action listByReferenceId List base entries by filter according to reference id.
* @action listFlags List all pending flags for the entry.
* @action recycle Move the entry to the recycle bin.
* @action reject Reject the entry and mark the pending flags (if any) as moderated (this will make the entry non-playable).
* @action restoreRecycled Restore the entry from the recycle bin.
* @action update Update base entry. Only the properties that were set will be updated.
* @action updateContent Update the content resource associated with the entry.
* @action updateThumbnailFromSourceEntry Update entry thumbnail from a different entry by a specified time offset (in seconds).
* @action updateThumbnailFromUrl Update entry thumbnail using URL.
* @action updateThumbnailJpeg Update entry thumbnail using a raw jpeg file.
* @action upload Upload a file to Kaltura, that can be used to create an entry.
*/
class baseEntry{
/**
* Generic add entry, should be used when the uploaded entry type is not known.
* @param entry BaseEntry
* @param type string (optional, enum: KalturaEntryType, default: null)
* @return KalturaBaseEntry
*/
static add(entry, type = null){
let kparams = {};
kparams.entry = entry;
kparams.type = type;
return new kaltura.RequestBuilder('baseentry', 'add', kparams);
};
/**
* Attach content resource to entry in status NO_MEDIA.
* @param entryId string
* @param resource Resource
* @return KalturaBaseEntry
*/
static addContent(entryId, resource){
let kparams = {};
kparams.entryId = entryId;
kparams.resource = resource;
return new kaltura.RequestBuilder('baseentry', 'addContent', kparams);
};
/**
* Generic add entry using an uploaded file, should be used when the uploaded entry type is not known.
* @param entry BaseEntry
* @param uploadTokenId string
* @param type string (optional, enum: KalturaEntryType, default: null)
* @return KalturaBaseEntry
*/
static addFromUploadedFile(entry, uploadTokenId, type = null){
let kparams = {};
kparams.entry = entry;
kparams.uploadTokenId = uploadTokenId;
kparams.type = type;
return new kaltura.RequestBuilder('baseentry', 'addFromUploadedFile', kparams);
};
/**
* Anonymously rank an entry, no validation is done on duplicate rankings.
* @param entryId string
* @param rank int
*/
static anonymousRank(entryId, rank){
let kparams = {};
kparams.entryId = entryId;
kparams.rank = rank;
return new kaltura.RequestBuilder('baseentry', 'anonymousRank', kparams);
};
/**
* Approve the entry and mark the pending flags (if any) as moderated (this will make the entry playable).
* @param entryId string
*/
static approve(entryId){
let kparams = {};
kparams.entryId = entryId;
return new kaltura.RequestBuilder('baseentry', 'approve', kparams);
};
/**
* Clone an entry with optional attributes to apply to the clone.
* @param entryId string Id of entry to clone
* @param cloneOptions array (optional, default: null)
* @return KalturaBaseEntry
*/
static cloneAction(entryId, cloneOptions = null){
let kparams = {};
kparams.entryId = entryId;
kparams.cloneOptions = cloneOptions;
return new kaltura.RequestBuilder('baseentry', 'clone', kparams);
};
/**
* Count base entries by filter.
* @param filter BaseEntryFilter Entry filter (optional, default: null)
* @return int
*/
static count(filter = null){
let kparams = {};
kparams.filter = filter;
return new kaltura.RequestBuilder('baseentry', 'count', kparams);
};
/**
* Delete an entry.
* @param entryId string Entry id to delete
*/
static deleteAction(entryId){
let kparams = {};
kparams.entryId = entryId;
return new kaltura.RequestBuilder('baseentry', 'delete', kparams);
};
/**
* .
* @param entryId string
* @param storageProfileId int
* @return KalturaBaseEntry
*/
static exportAction(entryId, storageProfileId){
let kparams = {};
kparams.entryId = entryId;
kparams.storageProfileId = storageProfileId;
return new kaltura.RequestBuilder('baseentry', 'export', kparams);
};
/**
* add batch job that sends an email with a link to download an updated CSV that contains list of entries.
* @param filter BaseEntryFilter A filter used to exclude specific entries (optional, default: null)
* @param metadataProfileId int (optional, default: null)
* @param additionalFields array (optional, default: null)
* @param mappedFields array mapping between field headline and its mapped value (optional, default: null)
* @param options ExportToCsvOptions (optional, default: null)
* @return string
*/
static exportToCsv(filter = null, metadataProfileId = null, additionalFields = null, mappedFields = null, options = null){
let kparams = {};
kparams.filter = filter;
kparams.metadataProfileId = metadataProfileId;
kparams.additionalFields = additionalFields;
kparams.mappedFields = mappedFields;
kparams.options = options;
return new kaltura.RequestBuilder('baseentry', 'exportToCsv', kparams);
};
/**
* Flag inappropriate entry for moderation.
* @param moderationFlag ModerationFlag
*/
static flag(moderationFlag){
let kparams = {};
kparams.moderationFlag = moderationFlag;
return new kaltura.RequestBuilder('baseentry', 'flag', kparams);
};
/**
* Get base entry by ID.
* @param entryId string Entry id
* @param version int Desired version of the data (optional, default: -1)
* @return KalturaBaseEntry
*/
static get(entryId, version = -1){
let kparams = {};
kparams.entryId = entryId;
kparams.version = version;
return new kaltura.RequestBuilder('baseentry', 'get', kparams);
};
/**
* Get an array of KalturaBaseEntry objects by a comma-separated list of ids.
* @param entryIds string Comma separated string of entry ids
* @return array
*/
static getByIds(entryIds){
let kparams = {};
kparams.entryIds = entryIds;
return new kaltura.RequestBuilder('baseentry', 'getByIds', kparams);
};
/**
* This action delivers entry-related data, based on the user's context: access control, restriction, playback format and storage information.
* @param entryId string
* @param contextDataParams EntryContextDataParams
* @return KalturaEntryContextDataResult
*/
static getContextData(entryId, contextDataParams){
let kparams = {};
kparams.entryId = entryId;
kparams.contextDataParams = contextDataParams;
return new kaltura.RequestBuilder('baseentry', 'getContextData', kparams);
};
/**
* This action delivers all data relevant for player.
* @param entryId string
* @param contextDataParams PlaybackContextOptions
* @return KalturaPlaybackContext
*/
static getPlaybackContext(entryId, contextDataParams){
let kparams = {};
kparams.entryId = entryId;
kparams.contextDataParams = contextDataParams;
return new kaltura.RequestBuilder('baseentry', 'getPlaybackContext', kparams);
};
/**
* Get remote storage existing paths for the asset.
* @param entryId string
* @return KalturaRemotePathListResponse
*/
static getRemotePaths(entryId){
let kparams = {};
kparams.entryId = entryId;
return new kaltura.RequestBuilder('baseentry', 'getRemotePaths', kparams);
};
/**
* Index an entry by id.
* @param id string
* @param shouldUpdate bool (optional, default: true)
* @return int
*/
static index(id, shouldUpdate = true){
let kparams = {};
kparams.id = id;
kparams.shouldUpdate = shouldUpdate;
return new kaltura.RequestBuilder('baseentry', 'index', kparams);
};
/**
* List base entries by filter with paging support.
* @param filter BaseEntryFilter Entry filter (optional, default: null)
* @param pager FilterPager Pager (optional, default: null)
* @return KalturaBaseEntryListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('baseentry', 'list', kparams);
};
/**
* List base entries by filter according to reference id.
* @param refId string Entry Reference ID
* @param pager FilterPager Pager (optional, default: null)
* @return KalturaBaseEntryListResponse
*/
static listByReferenceId(refId, pager = null){
let kparams = {};
kparams.refId = refId;
kparams.pager = pager;
return new kaltura.RequestBuilder('baseentry', 'listByReferenceId', kparams);
};
/**
* List all pending flags for the entry.
* @param entryId string
* @param pager FilterPager (optional, default: null)
* @return KalturaModerationFlagListResponse
*/
static listFlags(entryId, pager = null){
let kparams = {};
kparams.entryId = entryId;
kparams.pager = pager;
return new kaltura.RequestBuilder('baseentry', 'listFlags', kparams);
};
/**
* Move the entry to the recycle bin.
* @param entryId string
* @return KalturaBaseEntry
*/
static recycle(entryId){
let kparams = {};
kparams.entryId = entryId;
return new kaltura.RequestBuilder('baseentry', 'recycle', kparams);
};
/**
* Reject the entry and mark the pending flags (if any) as moderated (this will make the entry non-playable).
* @param entryId string
*/
static reject(entryId){
let kparams = {};
kparams.entryId = entryId;
return new kaltura.RequestBuilder('baseentry', 'reject', kparams);
};
/**
* Restore the entry from the recycle bin.
* @param entryId string
* @return KalturaBaseEntry
*/
static restoreRecycled(entryId){
let kparams = {};
kparams.entryId = entryId;
return new kaltura.RequestBuilder('baseentry', 'restoreRecycled', kparams);
};
/**
* Update base entry. Only the properties that were set will be updated.
* @param entryId string Entry id to update
* @param baseEntry BaseEntry Base entry metadata to update
* @return KalturaBaseEntry
*/
static update(entryId, baseEntry){
let kparams = {};
kparams.entryId = entryId;
kparams.baseEntry = baseEntry;
return new kaltura.RequestBuilder('baseentry', 'update', kparams);
};
/**
* Update the content resource associated with the entry.
* @param entryId string Entry id to update
* @param resource Resource Resource to be used to replace entry content
* @param conversionProfileId int The conversion profile id to be used on the entry (optional, default: null)
* @param advancedOptions EntryReplacementOptions Additional update content options (optional, default: null)
* @return KalturaBaseEntry
*/
static updateContent(entryId, resource, conversionProfileId = null, advancedOptions = null){
let kparams = {};
kparams.entryId = entryId;
kparams.resource = resource;
kparams.conversionProfileId = conversionProfileId;
kparams.advancedOptions = advancedOptions;
return new kaltura.RequestBuilder('baseentry', 'updateContent', kparams);
};
/**
* Update entry thumbnail from a different entry by a specified time offset (in seconds).
* @param entryId string Media entry id
* @param sourceEntryId string Media entry id
* @param timeOffset int Time offset (in seconds)
* @return KalturaBaseEntry
*/
static updateThumbnailFromSourceEntry(entryId, sourceEntryId, timeOffset){
let kparams = {};
kparams.entryId = entryId;
kparams.sourceEntryId = sourceEntryId;
kparams.timeOffset = timeOffset;
return new kaltura.RequestBuilder('baseentry', 'updateThumbnailFromSourceEntry', kparams);
};
/**
* Update entry thumbnail using URL.
* @param entryId string Media entry id
* @param url string file url
* @return KalturaBaseEntry
*/
static updateThumbnailFromUrl(entryId, url){
let kparams = {};
kparams.entryId = entryId;
kparams.url = url;
return new kaltura.RequestBuilder('baseentry', 'updateThumbnailFromUrl', kparams);
};
/**
* Update entry thumbnail using a raw jpeg file.
* @param entryId string Media entry id
* @param fileData file Jpeg file data
* @return KalturaBaseEntry
*/
static updateThumbnailJpeg(entryId, fileData){
let kparams = {};
kparams.entryId = entryId;
let kfiles = {};
kfiles.fileData = fileData;
return new kaltura.RequestBuilder('baseentry', 'updateThumbnailJpeg', kparams, kfiles);
};
/**
* Upload a file to Kaltura, that can be used to create an entry.
* @param fileData file The file data
* @return string
*/
static upload(fileData){
let kparams = {};
let kfiles = {};
kfiles.fileData = fileData;
return new kaltura.RequestBuilder('baseentry', 'upload', kparams, kfiles);
};
}
module.exports.baseEntry = baseEntry;
/**
*Class definition for the Kaltura service: bulkUpload.
* The available service actions:
* @action abort Aborts the bulk upload and all its child jobs.
* @action add Add new bulk upload batch job
* Conversion profile id can be specified in the API or in the CSV file, the one in the CSV file will be stronger.
* If no conversion profile was specified, partner's default will be used.
* @action get Get bulk upload batch job by id.
* @action list List bulk upload batch jobs.
*/
class bulkUpload{
/**
* Aborts the bulk upload and all its child jobs.
* @param id int job id
* @return KalturaBulkUpload
*/
static abort(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('bulkupload', 'abort', kparams);
};
/**
* Add new bulk upload batch job
* Conversion profile id can be specified in the API or in the CSV file, the one in the CSV file will be stronger.
* If no conversion profile was specified, partner's default will be used.
* @param conversionProfileId int Conversion profile id to use for converting the current bulk (-1 to use partner's default)
* @param csvFileData file bulk upload file
* @param bulkUploadType string (optional, enum: KalturaBulkUploadType, default: null)
* @param uploadedBy string (optional, default: null)
* @param fileName string Friendly name of the file, used to be recognized later in the logs (optional, default: null)
* @return KalturaBulkUpload
*/
static add(conversionProfileId, csvFileData, bulkUploadType = null, uploadedBy = null, fileName = null){
let kparams = {};
kparams.conversionProfileId = conversionProfileId;
let kfiles = {};
kfiles.csvFileData = csvFileData;
kparams.bulkUploadType = bulkUploadType;
kparams.uploadedBy = uploadedBy;
kparams.fileName = fileName;
return new kaltura.RequestBuilder('bulkupload', 'add', kparams, kfiles);
};
/**
* Get bulk upload batch job by id.
* @param id int
* @return KalturaBulkUpload
*/
static get(id){
let kparams = {};
kparams.id = id;
return new kaltura.RequestBuilder('bulkupload', 'get', kparams);
};
/**
* List bulk upload batch jobs.
* @param pager FilterPager (optional, default: null)
* @return KalturaBulkUploadListResponse
*/
static listAction(pager = null){
let kparams = {};
kparams.pager = pager;
return new kaltura.RequestBuilder('bulkupload', 'list', kparams);
};
}
module.exports.bulkUpload = bulkUpload;
/**
*Class definition for the Kaltura service: categoryEntry.
* The available service actions:
* @action activate activate CategoryEntry when it is pending moderation.
* @action add Add new CategoryEntry.
* @action addFromBulkUpload .
* @action delete Delete CategoryEntry.
* @action index Index CategoryEntry by Id.
* @action list List all categoryEntry.
* @action reject activate CategoryEntry when it is pending moderation.
* @action syncPrivacyContext update privacy context from the category.
* @action updateStatusFromBulk .
*/
class categoryEntry{
/**
* activate CategoryEntry when it is pending moderation.
* @param entryId string
* @param categoryId int
*/
static activate(entryId, categoryId){
let kparams = {};
kparams.entryId = entryId;
kparams.categoryId = categoryId;
return new kaltura.RequestBuilder('categoryentry', 'activate', kparams);
};
/**
* Add new CategoryEntry.
* @param categoryEntry CategoryEntry
* @return KalturaCategoryEntry
*/
static add(categoryEntry){
let kparams = {};
kparams.categoryEntry = categoryEntry;
return new kaltura.RequestBuilder('categoryentry', 'add', kparams);
};
/**
* .
* @param bulkUploadData BulkServiceData
* @param bulkUploadCategoryEntryData BulkUploadCategoryEntryData (optional, default: null)
* @return KalturaBulkUpload
*/
static addFromBulkUpload(bulkUploadData, bulkUploadCategoryEntryData = null){
let kparams = {};
kparams.bulkUploadData = bulkUploadData;
kparams.bulkUploadCategoryEntryData = bulkUploadCategoryEntryData;
return new kaltura.RequestBuilder('categoryentry', 'addFromBulkUpload', kparams);
};
/**
* Delete CategoryEntry.
* @param entryId string
* @param categoryId int
*/
static deleteAction(entryId, categoryId){
let kparams = {};
kparams.entryId = entryId;
kparams.categoryId = categoryId;
return new kaltura.RequestBuilder('categoryentry', 'delete', kparams);
};
/**
* Index CategoryEntry by Id.
* @param entryId string
* @param categoryId int
* @param shouldUpdate bool (optional, default: true)
* @return int
*/
static index(entryId, categoryId, shouldUpdate = true){
let kparams = {};
kparams.entryId = entryId;
kparams.categoryId = categoryId;
kparams.shouldUpdate = shouldUpdate;
return new kaltura.RequestBuilder('categoryentry', 'index', kparams);
};
/**
* List all categoryEntry.
* @param filter CategoryEntryFilter (optional, default: null)
* @param pager FilterPager (optional, default: null)
* @return KalturaCategoryEntryListResponse
*/
static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('categoryentry', 'list', kparams);
};
/**
* activate CategoryEntry when it is pending moderation.
* @param entryId string
* @param categoryId int
*/
static reject(entryId, categoryId){
let kparams = {};
kparams.entryId = entryId;
kparams.categoryId = categoryId;
return new kaltura.RequestBuilder('categoryentry', 'reject', kparams);
};
/**
* update privacy context from the category.
* @param entryId string
* @param categoryId int
*/
static syncPrivacyContext(entryId, categoryId){
let kparams = {};
kparams.entryId = entryId;
kparams.categoryId = categoryId;
return new kaltura.RequestBuilder('categoryentry', 'syncPrivacyContext', kparams);
};
/**
* .
* @param fileData file
* @param bulkUploadData BulkUploadJobData (optional, default: null)
* @param bulkUploadCategoryEntryData BulkUploadCategoryEntryData (optional, default: null)
* @return KalturaBulkUpload
*/
static updateStatusFromBulk(fileData, bulkUploadData = null, bulkUploadCategoryEntryData = null){
let kparams = {};
let kfiles = {};
kfiles.fileData = fileData;
kparams.bulkUploadData = bulkUploadData;
kparams.bulkUploadCategoryEntryData = bulkUploadCategoryEntryData;
return new kaltura.RequestBuilder('categoryentry', 'updateStatusFromBulk', kparams, kfiles);
};
}
module.exports.categoryEntry = categoryEntry;
/**
*Class definition for the Kaltura service: category.
* The available service actions:
* @action add Add new Category.
* @action addFromBulkUpload .
* @action clone Clone Category.
* @action delete Delete a Category.
* @action exportToCsv Creates a batch job that sends an email with a link to download a CSV containing a list of categories.
* @action get Get Category by id.
* @action index Index Category by id.
* @action list List all categories.
* @action move Move categories that belong to the same parent category to a target category - enabled only for ks with disable entitlement.
* @action unlockCategories Unlock categories.
* @action update Update Category.
*/
class category{
/**
* Add new Category.
* @param category Category
* @return KalturaCategory
*/
static add(category){
let kparams = {};
kparams.category = category;
return new kaltura.RequestBuilder('category', 'add', kparams);
};
/**
* .