kaltura
Version:
Kaltura NodeJS clientlibs
1,393 lines (1,363 loc) • 423 kB
JavaScript
// ===================================================================================================
// _ __ _ _
// | |/ /__ _| | |_ _ _ _ _ __ _
// | ' </ _` | | _| || | '_/ _` |
// |_|\_\__,_|_|\__|\_,_|_| \__,_|
//
// This file is part of the Kaltura Collaborative Media Suite which allows users
// to do with audio, video, and animation what Wiki platfroms allow them to do with
// text.
//
// Copyright (C) 2006-2016 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
// ===================================================================================================
var util = require('util');
var kaltura = require('./KalturaClientBase');
/**
*Class definition for the Kaltura service: accessControlProfile.
* The available service actions:
* @action add Add new access control profile.
* @action get Get access control profile by id.
* @action update Update access control profile by id.
* @action delete Delete access control profile by id.
* @action list List access control profiles by filter and pager.
*/
function KalturaAccessControlProfileService(client){
KalturaAccessControlProfileService.super_.call(this);
this.init(client);
}
util.inherits(KalturaAccessControlProfileService, kaltura.KalturaServiceBase);
module.exports.KalturaAccessControlProfileService = KalturaAccessControlProfileService;
/**
* Add new access control profile.
* @param accessControlProfile KalturaAccessControlProfile (optional).
* @return KalturaAccessControlProfile.
*/
KalturaAccessControlProfileService.prototype.add = function(callback, accessControlProfile){
var kparams = {};
this.client.addParam(kparams, 'accessControlProfile', kaltura.toParams(accessControlProfile));
this.client.queueServiceActionCall('accesscontrolprofile', 'add', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Get access control profile by id.
* @param id int (optional).
* @return KalturaAccessControlProfile.
*/
KalturaAccessControlProfileService.prototype.get = function(callback, id){
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.queueServiceActionCall('accesscontrolprofile', 'get', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Update access control profile by id.
* @param id int (optional).
* @param accessControlProfile KalturaAccessControlProfile (optional).
* @return KalturaAccessControlProfile.
*/
KalturaAccessControlProfileService.prototype.update = function(callback, id, accessControlProfile){
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.addParam(kparams, 'accessControlProfile', kaltura.toParams(accessControlProfile));
this.client.queueServiceActionCall('accesscontrolprofile', 'update', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Delete access control profile by id.
* @param id int (optional).
* @return .
*/
KalturaAccessControlProfileService.prototype.deleteAction = function(callback, id){
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.queueServiceActionCall('accesscontrolprofile', 'delete', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* List access control profiles by filter and pager.
* @param filter KalturaAccessControlProfileFilter (optional, default: null).
* @param pager KalturaFilterPager (optional, default: null).
* @return KalturaAccessControlProfileListResponse.
*/
KalturaAccessControlProfileService.prototype.listAction = function(callback, filter, pager){
if(!filter){
filter = null;
}
if(!pager){
pager = null;
}
var kparams = {};
if (filter !== null){
this.client.addParam(kparams, 'filter', kaltura.toParams(filter));
}
if (pager !== null){
this.client.addParam(kparams, 'pager', kaltura.toParams(pager));
}
this.client.queueServiceActionCall('accesscontrolprofile', 'list', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
*Class definition for the Kaltura service: accessControl.
* The available service actions:
* @action add Add new Access Control Profile.
* @action get Get Access Control Profile by id.
* @action update Update Access Control Profile by id.
* @action delete Delete Access Control Profile by id.
* @action list List Access Control Profiles by filter and pager.
*/
function KalturaAccessControlService(client){
KalturaAccessControlService.super_.call(this);
this.init(client);
}
util.inherits(KalturaAccessControlService, kaltura.KalturaServiceBase);
module.exports.KalturaAccessControlService = KalturaAccessControlService;
/**
* Add new Access Control Profile.
* @param accessControl KalturaAccessControl (optional).
* @return KalturaAccessControl.
*/
KalturaAccessControlService.prototype.add = function(callback, accessControl){
var kparams = {};
this.client.addParam(kparams, 'accessControl', kaltura.toParams(accessControl));
this.client.queueServiceActionCall('accesscontrol', 'add', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Get Access Control Profile by id.
* @param id int (optional).
* @return KalturaAccessControl.
*/
KalturaAccessControlService.prototype.get = function(callback, id){
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.queueServiceActionCall('accesscontrol', 'get', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Update Access Control Profile by id.
* @param id int (optional).
* @param accessControl KalturaAccessControl (optional).
* @return KalturaAccessControl.
*/
KalturaAccessControlService.prototype.update = function(callback, id, accessControl){
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.addParam(kparams, 'accessControl', kaltura.toParams(accessControl));
this.client.queueServiceActionCall('accesscontrol', 'update', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Delete Access Control Profile by id.
* @param id int (optional).
* @return .
*/
KalturaAccessControlService.prototype.deleteAction = function(callback, id){
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.queueServiceActionCall('accesscontrol', 'delete', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* List Access Control Profiles by filter and pager.
* @param filter KalturaAccessControlFilter (optional, default: null).
* @param pager KalturaFilterPager (optional, default: null).
* @return KalturaAccessControlListResponse.
*/
KalturaAccessControlService.prototype.listAction = function(callback, filter, pager){
if(!filter){
filter = null;
}
if(!pager){
pager = null;
}
var kparams = {};
if (filter !== null){
this.client.addParam(kparams, 'filter', kaltura.toParams(filter));
}
if (pager !== null){
this.client.addParam(kparams, 'pager', kaltura.toParams(pager));
}
this.client.queueServiceActionCall('accesscontrol', 'list', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
*Class definition for the Kaltura service: adminUser.
* The available service actions:
* @action updatePassword Update admin user password and email.
* @action resetPassword Reset admin user password and send it to the users email address.
* @action login Get an admin session using admin email and password (Used for login to the KMC application).
* @action setInitialPassword Set initial users password.
*/
function KalturaAdminUserService(client){
KalturaAdminUserService.super_.call(this);
this.init(client);
}
util.inherits(KalturaAdminUserService, kaltura.KalturaServiceBase);
module.exports.KalturaAdminUserService = KalturaAdminUserService;
/**
* Update admin user password and email.
* @param email string (optional).
* @param password string (optional).
* @param newEmail string Optional, provide only when you want to update the email (optional).
* @param newPassword string (optional).
* @return KalturaAdminUser.
*/
KalturaAdminUserService.prototype.updatePassword = function(callback, email, password, newEmail, newPassword){
if(!newEmail){
newEmail = '';
}
if(!newPassword){
newPassword = '';
}
var kparams = {};
this.client.addParam(kparams, 'email', email);
this.client.addParam(kparams, 'password', password);
this.client.addParam(kparams, 'newEmail', newEmail);
this.client.addParam(kparams, 'newPassword', newPassword);
this.client.queueServiceActionCall('adminuser', 'updatePassword', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Reset admin user password and send it to the users email address.
* @param email string (optional).
* @return .
*/
KalturaAdminUserService.prototype.resetPassword = function(callback, email){
var kparams = {};
this.client.addParam(kparams, 'email', email);
this.client.queueServiceActionCall('adminuser', 'resetPassword', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Get an admin session using admin email and password (Used for login to the KMC application).
* @param email string (optional).
* @param password string (optional).
* @param partnerId int (optional, default: null).
* @return string.
*/
KalturaAdminUserService.prototype.login = function(callback, email, password, partnerId){
if(!partnerId){
partnerId = null;
}
var kparams = {};
this.client.addParam(kparams, 'email', email);
this.client.addParam(kparams, 'password', password);
this.client.addParam(kparams, 'partnerId', partnerId);
this.client.queueServiceActionCall('adminuser', 'login', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Set initial users password.
* @param hashKey string (optional).
* @param newPassword string new password to set (optional).
* @return .
*/
KalturaAdminUserService.prototype.setInitialPassword = function(callback, hashKey, newPassword){
var kparams = {};
this.client.addParam(kparams, 'hashKey', hashKey);
this.client.addParam(kparams, 'newPassword', newPassword);
this.client.queueServiceActionCall('adminuser', 'setInitialPassword', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
*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.
*/
function KalturaAnalyticsService(client){
KalturaAnalyticsService.super_.call(this);
this.init(client);
}
util.inherits(KalturaAnalyticsService, kaltura.KalturaServiceBase);
module.exports.KalturaAnalyticsService = KalturaAnalyticsService;
/**
* report query action allows to get a analytics data for specific query dimensions, metrics and filters.
* @param filter KalturaAnalyticsFilter the analytics query filter (optional).
* @return KalturaReportResponse.
*/
KalturaAnalyticsService.prototype.query = function(callback, filter){
var kparams = {};
this.client.addParam(kparams, 'filter', kaltura.toParams(filter));
this.client.queueServiceActionCall('analytics', 'query', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
*Class definition for the Kaltura service: appToken.
* The available service actions:
* @action add Add new application authentication token.
* @action get Get application authentication token by id.
* @action update Update application authentication token by id.
* @action delete Delete 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 application authentication token id.
*/
function KalturaAppTokenService(client){
KalturaAppTokenService.super_.call(this);
this.init(client);
}
util.inherits(KalturaAppTokenService, kaltura.KalturaServiceBase);
module.exports.KalturaAppTokenService = KalturaAppTokenService;
/**
* Add new application authentication token.
* @param appToken KalturaAppToken (optional).
* @return KalturaAppToken.
*/
KalturaAppTokenService.prototype.add = function(callback, appToken){
var kparams = {};
this.client.addParam(kparams, 'appToken', kaltura.toParams(appToken));
this.client.queueServiceActionCall('apptoken', 'add', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Get application authentication token by id.
* @param id string (optional).
* @return KalturaAppToken.
*/
KalturaAppTokenService.prototype.get = function(callback, id){
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.queueServiceActionCall('apptoken', 'get', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Update application authentication token by id.
* @param id string (optional).
* @param appToken KalturaAppToken (optional).
* @return KalturaAppToken.
*/
KalturaAppTokenService.prototype.update = function(callback, id, appToken){
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.addParam(kparams, 'appToken', kaltura.toParams(appToken));
this.client.queueServiceActionCall('apptoken', 'update', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Delete application authentication token by id.
* @param id string (optional).
* @return .
*/
KalturaAppTokenService.prototype.deleteAction = function(callback, id){
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.queueServiceActionCall('apptoken', 'delete', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* List application authentication tokens by filter and pager.
* @param filter KalturaAppTokenFilter (optional, default: null).
* @param pager KalturaFilterPager (optional, default: null).
* @return KalturaAppTokenListResponse.
*/
KalturaAppTokenService.prototype.listAction = function(callback, filter, pager){
if(!filter){
filter = null;
}
if(!pager){
pager = null;
}
var kparams = {};
if (filter !== null){
this.client.addParam(kparams, 'filter', kaltura.toParams(filter));
}
if (pager !== null){
this.client.addParam(kparams, 'pager', kaltura.toParams(pager));
}
this.client.queueServiceActionCall('apptoken', 'list', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Starts a new KS (kaltura Session) based on application authentication token id.
* @param id string application token id (optional).
* @param tokenHash string hashed token, built of sha1 on current KS concatenated with the application token (optional).
* @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 already defined on the application token (optional, enum: KalturaSessionType, default: null).
* @param expiry int session expiry (in seconds), could be overwritten by shorter expiry of the application token and the session-expiry that defined on the application token (optional, default: null).
* @return KalturaSessionInfo.
*/
KalturaAppTokenService.prototype.startSession = function(callback, id, tokenHash, userId, type, expiry){
if(!userId){
userId = null;
}
if(!type){
type = null;
}
if(!expiry){
expiry = null;
}
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.addParam(kparams, 'tokenHash', tokenHash);
this.client.addParam(kparams, 'userId', userId);
this.client.addParam(kparams, 'type', type);
this.client.addParam(kparams, 'expiry', expiry);
this.client.queueServiceActionCall('apptoken', 'startSession', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
*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 get Get base entry by ID.
* @action getRemotePaths Get remote storage existing paths for the asset.
* @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 getByIds Get an array of KalturaBaseEntry objects by a comma-separated list of ids.
* @action delete Delete an entry.
* @action list List base entries by filter with paging support.
* @action listByReferenceId List base entries by filter according to reference id.
* @action count Count base entries by filter.
* @action upload Upload a file to Kaltura, that can be used to create an entry.
* @action updateThumbnailJpeg Update entry thumbnail using a raw jpeg file.
* @action updateThumbnailFromUrl Update entry thumbnail using url.
* @action updateThumbnailFromSourceEntry Update entry thumbnail from a different entry by a specified time offset (in seconds).
* @action flag Flag inappropriate entry for moderation.
* @action reject Reject the entry and mark the pending flags (if any) as moderated (this will make the entry non-playable).
* @action approve Approve the entry and mark the pending flags (if any) as moderated (this will make the entry playable).
* @action listFlags List all pending flags for the entry.
* @action anonymousRank Anonymously rank an entry, no validation is done on duplicate rankings.
* @action getContextData This action delivers entry-related data, based on the user's context: access control, restriction, playback format and storage information.
* @action export .
* @action index Index an entry by id.
* @action clone Clone an entry with optional attributes to apply to the clone.
*/
function KalturaBaseEntryService(client){
KalturaBaseEntryService.super_.call(this);
this.init(client);
}
util.inherits(KalturaBaseEntryService, kaltura.KalturaServiceBase);
module.exports.KalturaBaseEntryService = KalturaBaseEntryService;
/**
* Generic add entry, should be used when the uploaded entry type is not known.
* @param entry KalturaBaseEntry (optional).
* @param type string (optional, enum: KalturaEntryType, default: null).
* @return KalturaBaseEntry.
*/
KalturaBaseEntryService.prototype.add = function(callback, entry, type){
if(!type){
type = null;
}
var kparams = {};
this.client.addParam(kparams, 'entry', kaltura.toParams(entry));
this.client.addParam(kparams, 'type', type);
this.client.queueServiceActionCall('baseentry', 'add', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Attach content resource to entry in status NO_MEDIA.
* @param entryId string (optional).
* @param resource KalturaResource (optional).
* @return KalturaBaseEntry.
*/
KalturaBaseEntryService.prototype.addContent = function(callback, entryId, resource){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.addParam(kparams, 'resource', kaltura.toParams(resource));
this.client.queueServiceActionCall('baseentry', 'addContent', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Generic add entry using an uploaded file, should be used when the uploaded entry type is not known.
* @param entry KalturaBaseEntry (optional).
* @param uploadTokenId string (optional).
* @param type string (optional, enum: KalturaEntryType, default: null).
* @return KalturaBaseEntry.
*/
KalturaBaseEntryService.prototype.addFromUploadedFile = function(callback, entry, uploadTokenId, type){
if(!type){
type = null;
}
var kparams = {};
this.client.addParam(kparams, 'entry', kaltura.toParams(entry));
this.client.addParam(kparams, 'uploadTokenId', uploadTokenId);
this.client.addParam(kparams, 'type', type);
this.client.queueServiceActionCall('baseentry', 'addFromUploadedFile', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Get base entry by ID.
* @param entryId string Entry id (optional).
* @param version int Desired version of the data (optional, default: -1).
* @return KalturaBaseEntry.
*/
KalturaBaseEntryService.prototype.get = function(callback, entryId, version){
if(!version){
version = -1;
}
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.addParam(kparams, 'version', version);
this.client.queueServiceActionCall('baseentry', 'get', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Get remote storage existing paths for the asset.
* @param entryId string (optional).
* @return KalturaRemotePathListResponse.
*/
KalturaBaseEntryService.prototype.getRemotePaths = function(callback, entryId){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.queueServiceActionCall('baseentry', 'getRemotePaths', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Update base entry. Only the properties that were set will be updated.
* @param entryId string Entry id to update (optional).
* @param baseEntry KalturaBaseEntry Base entry metadata to update (optional).
* @return KalturaBaseEntry.
*/
KalturaBaseEntryService.prototype.update = function(callback, entryId, baseEntry){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.addParam(kparams, 'baseEntry', kaltura.toParams(baseEntry));
this.client.queueServiceActionCall('baseentry', 'update', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Update the content resource associated with the entry.
* @param entryId string Entry id to update (optional).
* @param resource KalturaResource Resource to be used to replace entry content (optional).
* @param conversionProfileId int The conversion profile id to be used on the entry (optional, default: null).
* @param advancedOptions KalturaEntryReplacementOptions Additional update content options (optional, default: null).
* @return KalturaBaseEntry.
*/
KalturaBaseEntryService.prototype.updateContent = function(callback, entryId, resource, conversionProfileId, advancedOptions){
if(!conversionProfileId){
conversionProfileId = null;
}
if(!advancedOptions){
advancedOptions = null;
}
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.addParam(kparams, 'resource', kaltura.toParams(resource));
this.client.addParam(kparams, 'conversionProfileId', conversionProfileId);
if (advancedOptions !== null){
this.client.addParam(kparams, 'advancedOptions', kaltura.toParams(advancedOptions));
}
this.client.queueServiceActionCall('baseentry', 'updateContent', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Get an array of KalturaBaseEntry objects by a comma-separated list of ids.
* @param entryIds string Comma separated string of entry ids (optional).
* @return array.
*/
KalturaBaseEntryService.prototype.getByIds = function(callback, entryIds){
var kparams = {};
this.client.addParam(kparams, 'entryIds', entryIds);
this.client.queueServiceActionCall('baseentry', 'getByIds', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Delete an entry.
* @param entryId string Entry id to delete (optional).
* @return .
*/
KalturaBaseEntryService.prototype.deleteAction = function(callback, entryId){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.queueServiceActionCall('baseentry', 'delete', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* List base entries by filter with paging support.
* @param filter KalturaBaseEntryFilter Entry filter (optional, default: null).
* @param pager KalturaFilterPager Pager (optional, default: null).
* @return KalturaBaseEntryListResponse.
*/
KalturaBaseEntryService.prototype.listAction = function(callback, filter, pager){
if(!filter){
filter = null;
}
if(!pager){
pager = null;
}
var kparams = {};
if (filter !== null){
this.client.addParam(kparams, 'filter', kaltura.toParams(filter));
}
if (pager !== null){
this.client.addParam(kparams, 'pager', kaltura.toParams(pager));
}
this.client.queueServiceActionCall('baseentry', 'list', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* List base entries by filter according to reference id.
* @param refId string Entry Reference ID (optional).
* @param pager KalturaFilterPager Pager (optional, default: null).
* @return KalturaBaseEntryListResponse.
*/
KalturaBaseEntryService.prototype.listByReferenceId = function(callback, refId, pager){
if(!pager){
pager = null;
}
var kparams = {};
this.client.addParam(kparams, 'refId', refId);
if (pager !== null){
this.client.addParam(kparams, 'pager', kaltura.toParams(pager));
}
this.client.queueServiceActionCall('baseentry', 'listByReferenceId', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Count base entries by filter.
* @param filter KalturaBaseEntryFilter Entry filter (optional, default: null).
* @return int.
*/
KalturaBaseEntryService.prototype.count = function(callback, filter){
if(!filter){
filter = null;
}
var kparams = {};
if (filter !== null){
this.client.addParam(kparams, 'filter', kaltura.toParams(filter));
}
this.client.queueServiceActionCall('baseentry', 'count', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Upload a file to Kaltura, that can be used to create an entry.
* @param fileData file The file data (optional).
* @return string.
*/
KalturaBaseEntryService.prototype.upload = function(callback, fileData){
var kparams = {};
var kfiles = {};
this.client.addParam(kfiles, 'fileData', fileData);
this.client.queueServiceActionCall('baseentry', 'upload', kparams, kfiles);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Update entry thumbnail using a raw jpeg file.
* @param entryId string Media entry id (optional).
* @param fileData file Jpeg file data (optional).
* @return KalturaBaseEntry.
*/
KalturaBaseEntryService.prototype.updateThumbnailJpeg = function(callback, entryId, fileData){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
var kfiles = {};
this.client.addParam(kfiles, 'fileData', fileData);
this.client.queueServiceActionCall('baseentry', 'updateThumbnailJpeg', kparams, kfiles);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Update entry thumbnail using url.
* @param entryId string Media entry id (optional).
* @param url string file url (optional).
* @return KalturaBaseEntry.
*/
KalturaBaseEntryService.prototype.updateThumbnailFromUrl = function(callback, entryId, url){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.addParam(kparams, 'url', url);
this.client.queueServiceActionCall('baseentry', 'updateThumbnailFromUrl', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Update entry thumbnail from a different entry by a specified time offset (in seconds).
* @param entryId string Media entry id (optional).
* @param sourceEntryId string Media entry id (optional).
* @param timeOffset int Time offset (in seconds) (optional).
* @return KalturaBaseEntry.
*/
KalturaBaseEntryService.prototype.updateThumbnailFromSourceEntry = function(callback, entryId, sourceEntryId, timeOffset){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.addParam(kparams, 'sourceEntryId', sourceEntryId);
this.client.addParam(kparams, 'timeOffset', timeOffset);
this.client.queueServiceActionCall('baseentry', 'updateThumbnailFromSourceEntry', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Flag inappropriate entry for moderation.
* @param moderationFlag KalturaModerationFlag (optional).
* @return .
*/
KalturaBaseEntryService.prototype.flag = function(callback, moderationFlag){
var kparams = {};
this.client.addParam(kparams, 'moderationFlag', kaltura.toParams(moderationFlag));
this.client.queueServiceActionCall('baseentry', 'flag', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Reject the entry and mark the pending flags (if any) as moderated (this will make the entry non-playable).
* @param entryId string (optional).
* @return .
*/
KalturaBaseEntryService.prototype.reject = function(callback, entryId){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.queueServiceActionCall('baseentry', 'reject', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Approve the entry and mark the pending flags (if any) as moderated (this will make the entry playable).
* @param entryId string (optional).
* @return .
*/
KalturaBaseEntryService.prototype.approve = function(callback, entryId){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.queueServiceActionCall('baseentry', 'approve', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* List all pending flags for the entry.
* @param entryId string (optional).
* @param pager KalturaFilterPager (optional, default: null).
* @return KalturaModerationFlagListResponse.
*/
KalturaBaseEntryService.prototype.listFlags = function(callback, entryId, pager){
if(!pager){
pager = null;
}
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
if (pager !== null){
this.client.addParam(kparams, 'pager', kaltura.toParams(pager));
}
this.client.queueServiceActionCall('baseentry', 'listFlags', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Anonymously rank an entry, no validation is done on duplicate rankings.
* @param entryId string (optional).
* @param rank int (optional).
* @return .
*/
KalturaBaseEntryService.prototype.anonymousRank = function(callback, entryId, rank){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.addParam(kparams, 'rank', rank);
this.client.queueServiceActionCall('baseentry', 'anonymousRank', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* This action delivers entry-related data, based on the user's context: access control, restriction, playback format and storage information.
* @param entryId string (optional).
* @param contextDataParams KalturaEntryContextDataParams (optional).
* @return KalturaEntryContextDataResult.
*/
KalturaBaseEntryService.prototype.getContextData = function(callback, entryId, contextDataParams){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.addParam(kparams, 'contextDataParams', kaltura.toParams(contextDataParams));
this.client.queueServiceActionCall('baseentry', 'getContextData', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* .
* @param entryId string (optional).
* @param storageProfileId int (optional).
* @return KalturaBaseEntry.
*/
KalturaBaseEntryService.prototype.exportAction = function(callback, entryId, storageProfileId){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.addParam(kparams, 'storageProfileId', storageProfileId);
this.client.queueServiceActionCall('baseentry', 'export', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Index an entry by id.
* @param id string (optional).
* @param shouldUpdate bool (optional, default: true).
* @return int.
*/
KalturaBaseEntryService.prototype.index = function(callback, id, shouldUpdate){
if(!shouldUpdate){
shouldUpdate = true;
}
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.addParam(kparams, 'shouldUpdate', shouldUpdate);
this.client.queueServiceActionCall('baseentry', 'index', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Clone an entry with optional attributes to apply to the clone.
* @param entryId string Id of entry to clone (optional).
* @param cloneOptions array (optional, default: null).
* @return KalturaBaseEntry.
*/
KalturaBaseEntryService.prototype.cloneAction = function(callback, entryId, cloneOptions){
if(!cloneOptions){
cloneOptions = null;
}
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
if(cloneOptions !== null){
for(var index in cloneOptions)
{
var obj = cloneOptions[index];
this.client.addParam(kparams, 'cloneOptions:' + index, kaltura.toParams(obj));
}
}
this.client.queueServiceActionCall('baseentry', 'clone', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
*Class definition for the Kaltura service: bulkUpload.
* The available service actions:
* @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.
* @action abort Aborts the bulk upload and all its child jobs.
*/
function KalturaBulkUploadService(client){
KalturaBulkUploadService.super_.call(this);
this.init(client);
}
util.inherits(KalturaBulkUploadService, kaltura.KalturaServiceBase);
module.exports.KalturaBulkUploadService = KalturaBulkUploadService;
/**
* 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 Convertion profile id to use for converting the current bulk (-1 to use partner's default) (optional).
* @param csvFileData file bulk upload file (optional).
* @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.
*/
KalturaBulkUploadService.prototype.add = function(callback, conversionProfileId, csvFileData, bulkUploadType, uploadedBy, fileName){
if(!bulkUploadType){
bulkUploadType = null;
}
if(!uploadedBy){
uploadedBy = null;
}
if(!fileName){
fileName = null;
}
var kparams = {};
this.client.addParam(kparams, 'conversionProfileId', conversionProfileId);
var kfiles = {};
this.client.addParam(kfiles, 'csvFileData', csvFileData);
this.client.addParam(kparams, 'bulkUploadType', bulkUploadType);
this.client.addParam(kparams, 'uploadedBy', uploadedBy);
this.client.addParam(kparams, 'fileName', fileName);
this.client.queueServiceActionCall('bulkupload', 'add', kparams, kfiles);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Get bulk upload batch job by id.
* @param id int (optional).
* @return KalturaBulkUpload.
*/
KalturaBulkUploadService.prototype.get = function(callback, id){
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.queueServiceActionCall('bulkupload', 'get', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* List bulk upload batch jobs.
* @param pager KalturaFilterPager (optional, default: null).
* @return KalturaBulkUploadListResponse.
*/
KalturaBulkUploadService.prototype.listAction = function(callback, pager){
if(!pager){
pager = null;
}
var kparams = {};
if (pager !== null){
this.client.addParam(kparams, 'pager', kaltura.toParams(pager));
}
this.client.queueServiceActionCall('bulkupload', 'list', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Aborts the bulk upload and all its child jobs.
* @param id int job id (optional).
* @return KalturaBulkUpload.
*/
KalturaBulkUploadService.prototype.abort = function(callback, id){
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.queueServiceActionCall('bulkupload', 'abort', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
*Class definition for the Kaltura service: categoryEntry.
* The available service actions:
* @action add Add new CategoryEntry.
* @action delete Delete CategoryEntry.
* @action list List all categoryEntry.
* @action index Index CategoryEntry by Id.
* @action activate activate CategoryEntry when it is pending moderation.
* @action reject activate CategoryEntry when it is pending moderation.
* @action syncPrivacyContext update privacy context from the category.
* @action addFromBulkUpload .
*/
function KalturaCategoryEntryService(client){
KalturaCategoryEntryService.super_.call(this);
this.init(client);
}
util.inherits(KalturaCategoryEntryService, kaltura.KalturaServiceBase);
module.exports.KalturaCategoryEntryService = KalturaCategoryEntryService;
/**
* Add new CategoryEntry.
* @param categoryEntry KalturaCategoryEntry (optional).
* @return KalturaCategoryEntry.
*/
KalturaCategoryEntryService.prototype.add = function(callback, categoryEntry){
var kparams = {};
this.client.addParam(kparams, 'categoryEntry', kaltura.toParams(categoryEntry));
this.client.queueServiceActionCall('categoryentry', 'add', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Delete CategoryEntry.
* @param entryId string (optional).
* @param categoryId int (optional).
* @return .
*/
KalturaCategoryEntryService.prototype.deleteAction = function(callback, entryId, categoryId){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.addParam(kparams, 'categoryId', categoryId);
this.client.queueServiceActionCall('categoryentry', 'delete', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* List all categoryEntry.
* @param filter KalturaCategoryEntryFilter (optional, default: null).
* @param pager KalturaFilterPager (optional, default: null).
* @return KalturaCategoryEntryListResponse.
*/
KalturaCategoryEntryService.prototype.listAction = function(callback, filter, pager){
if(!filter){
filter = null;
}
if(!pager){
pager = null;
}
var kparams = {};
if (filter !== null){
this.client.addParam(kparams, 'filter', kaltura.toParams(filter));
}
if (pager !== null){
this.client.addParam(kparams, 'pager', kaltura.toParams(pager));
}
this.client.queueServiceActionCall('categoryentry', 'list', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Index CategoryEntry by Id.
* @param entryId string (optional).
* @param categoryId int (optional).
* @param shouldUpdate bool (optional, default: true).
* @return int.
*/
KalturaCategoryEntryService.prototype.index = function(callback, entryId, categoryId, shouldUpdate){
if(!shouldUpdate){
shouldUpdate = true;
}
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.addParam(kparams, 'categoryId', categoryId);
this.client.addParam(kparams, 'shouldUpdate', shouldUpdate);
this.client.queueServiceActionCall('categoryentry', 'index', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* activate CategoryEntry when it is pending moderation.
* @param entryId string (optional).
* @param categoryId int (optional).
* @return .
*/
KalturaCategoryEntryService.prototype.activate = function(callback, entryId, categoryId){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.addParam(kparams, 'categoryId', categoryId);
this.client.queueServiceActionCall('categoryentry', 'activate', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* activate CategoryEntry when it is pending moderation.
* @param entryId string (optional).
* @param categoryId int (optional).
* @return .
*/
KalturaCategoryEntryService.prototype.reject = function(callback, entryId, categoryId){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.addParam(kparams, 'categoryId', categoryId);
this.client.queueServiceActionCall('categoryentry', 'reject', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* update privacy context from the category.
* @param entryId string (optional).
* @param categoryId int (optional).
* @return .
*/
KalturaCategoryEntryService.prototype.syncPrivacyContext = function(callback, entryId, categoryId){
var kparams = {};
this.client.addParam(kparams, 'entryId', entryId);
this.client.addParam(kparams, 'categoryId', categoryId);
this.client.queueServiceActionCall('categoryentry', 'syncPrivacyContext', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* .
* @param bulkUploadData KalturaBulkServiceData (optional).
* @param bulkUploadCategoryEntryData KalturaBulkUploadCategoryEntryData (optional, default: null).
* @return KalturaBulkUpload.
*/
KalturaCategoryEntryService.prototype.addFromBulkUpload = function(callback, bulkUploadData, bulkUploadCategoryEntryData){
if(!bulkUploadCategoryEntryData){
bulkUploadCategoryEntryData = null;
}
var kparams = {};
this.client.addParam(kparams, 'bulkUploadData', kaltura.toParams(bulkUploadData));
if (bulkUploadCategoryEntryData !== null){
this.client.addParam(kparams, 'bulkUploadCategoryEntryData', kaltura.toParams(bulkUploadCategoryEntryData));
}
this.client.queueServiceActionCall('categoryentry', 'addFromBulkUpload', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
*Class definition for the Kaltura service: category.
* The available service actions:
* @action add Add new Category.
* @action get Get Category by id.
* @action update Update Category.
* @action delete Delete a Category.
* @action list List all categories.
* @action index Index Category by id.
* @action move Move categories that belong to the same parent category to a target categroy - enabled only for ks with disable entitlement.
* @action unlockCategories Unlock categories.
* @action addFromBulkUpload .
*/
function KalturaCategoryService(client){
KalturaCategoryService.super_.call(this);
this.init(client);
}
util.inherits(KalturaCategoryService, kaltura.KalturaServiceBase);
module.exports.KalturaCategoryService = KalturaCategoryService;
/**
* Add new Category.
* @param category KalturaCategory (optional).
* @return KalturaCategory.
*/
KalturaCategoryService.prototype.add = function(callback, category){
var kparams = {};
this.client.addParam(kparams, 'category', kaltura.toParams(category));
this.client.queueServiceActionCall('category', 'add', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Get Category by id.
* @param id int (optional).
* @return KalturaCategory.
*/
KalturaCategoryService.prototype.get = function(callback, id){
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.queueServiceActionCall('category', 'get', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Update Category.
* @param id int (optional).
* @param category KalturaCategory (optional).
* @return KalturaCategory.
*/
KalturaCategoryService.prototype.update = function(callback, id, category){
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.addParam(kparams, 'category', kaltura.toParams(category));
this.client.queueServiceActionCall('category', 'update', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Delete a Category.
* @param id int (optional).
* @param moveEntriesToParentCategory int (optional, enum: KalturaNullableBoolean, default: 1).
* @return .
*/
KalturaCategoryService.prototype.deleteAction = function(callback, id, moveEntriesToParentCategory){
if(!moveEntriesToParentCategory){
moveEntriesToParentCategory = 1;
}
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.addParam(kparams, 'moveEntriesToParentCategory', moveEntriesToParentCategory);
this.client.queueServiceActionCall('category', 'delete', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* List all categories.
* @param filter KalturaCategoryFilter (optional, default: null).
* @param pager KalturaFilterPager (optional, default: null).
* @return KalturaCategoryListResponse.
*/
KalturaCategoryService.prototype.listAction = function(callback, filter, pager){
if(!filter){
filter = null;
}
if(!pager){
pager = null;
}
var kparams = {};
if (filter !== null){
this.client.addParam(kparams, 'filter', kaltura.toParams(filter));
}
if (pager !== null){
this.client.addParam(kparams, 'pager', kaltura.toParams(pager));
}
this.client.queueServiceActionCall('category', 'list', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Index Category by id.
* @param id int (optional).
* @param shouldUpdate bool (optional, default: true).
* @return int.
*/
KalturaCategoryService.prototype.index = function(callback, id, shouldUpdate){
if(!shouldUpdate){
shouldUpdate = true;
}
var kparams = {};
this.client.addParam(kparams, 'id', id);
this.client.addParam(kparams, 'shouldUpdate', shouldUpdate);
this.client.queueServiceActionCall('category', 'index', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Move categories that belong to the same parent category to a target categroy - enabled only for ks with disable entitlement.
* @param categoryIds string (optional).
* @param targetCategoryParentId int (optional).
* @return KalturaCategoryListResponse.
*/
KalturaCategoryService.prototype.move = function(callback, categoryIds, targetCategoryParentId){
var kparams = {};
this.client.addParam(kparams, 'categoryIds', categoryIds);
this.client.addParam(kparams, 'targetCategoryParentId', targetCategoryParentId);
this.client.queueServiceActionCall('category', 'move', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* Unlock categories.
* @return .
*/
KalturaCategoryService.prototype.unlockCategories = function(callback){
var kparams = {};
this.client.queueServiceActionCall('category', 'unlockCategories', kparams);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
* .
* @param fileData file (optional).
* @param bulkUploadData KalturaBulkUploadJobData (optional, default: null).
* @param bulkUploadCategoryData KalturaBulkUploadCategoryData (optional, default: null).
* @return KalturaBulkUpload.
*/
KalturaCategoryService.prototype.addFromBulkUpload = function(callback, fileData, bulkUploadData, bulkUploadCategoryData){
if(!bulkUploadData){
bulkUploadData = null;
}
if(!bulkUploadCategoryData){
bulkUploadCategoryData = null;
}
var kparams = {};
var kfiles = {};
this.client.addParam(kfiles, 'fileData', fileData);
if (bulkUploadData !== null){
this.client.addParam(kparams, 'bulkUploadData', kaltura.toParams(bulkUploadData));
}
if (bulkUploadCategoryData !== null){
this.client.addParam(kparams, 'bulkUploadCategoryData', kaltura.toParams(bulkUploadCategoryData));
}
this.client.queueServiceActionCall('category', 'addFromBulkUpload', kparams, kfiles);
if (!this.client.isMultiRequest()){
this.client.doQueue(callback);
}
};
/**
*Class definition for the Kaltura service: categoryUser.
* The available service actions:
* @action add Add new CategoryUser.
* @action get Get CategoryUser by id.
* @action update Update CategoryUser by id.
* @action delete Delete a CategoryUser.
* @action activate activate CategoryUser.
* @action deactivate reject CategoryUser.
* @action list List all categories.
* @action copyFromCategory Copy all memeber from parent category.
* @action index Index CategoryUser by userid and category id.
* @action addFromBulkUpload .
*/
function KalturaCategoryUserService(client){
KalturaCategoryUserService.super_.call(this);
this.init(client);
}
util.inherits(KalturaCategoryUserService, kaltura.KalturaServiceBase);
module.exports.KalturaCategoryUserService = KalturaCategoryUserService;
/**
* Add new CategoryUser.
* @param categoryUser KalturaCategoryUser (optional).
* @return KalturaCategoryUser.
*/
KalturaCategoryUserService.prototype.add = function(callback, categoryUser){
var kparams = {};
this.client.addParam(kparams, 'categoryUser', kaltura.toParams