Skip to content

Commit

Permalink
New clientlib ver
Browse files Browse the repository at this point in the history
  • Loading branch information
KalturaCommunity committed Jul 8, 2021
1 parent b6baf66 commit 1bb8541
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 11 deletions.
4 changes: 2 additions & 2 deletions KalturaClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class Client extends kaltura.ClientBase {
*/
constructor(config) {
super(config);
this.setApiVersion('17.3.0');
this.setClientTag('node:21-07-07');
this.setApiVersion('17.5.0');
this.setClientTag('node:21-07-08');
}
}

Expand Down
27 changes: 21 additions & 6 deletions KalturaClientBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,12 @@ class RequestBuilder extends kaltura.VolatileRequestData {
let files = this.getFiles();
let callback = this.callback;
let requestUrl = this.getUrl(client);
let headers = this.getHeaders(client);

let options = {
uri: requestUrl,
};
options.method = 'POST';
options.headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
method: 'POST',
headers: headers
};

let jsonBody = JSON.stringify(json, (key, value) => (value === null ? undefined : value));
Expand Down Expand Up @@ -311,7 +309,6 @@ class RequestBuilder extends kaltura.VolatileRequestData {
body = jsonBody;
}

options.headers['Content-Length'] = body.length;
options.body = body;

client.request(options, (err, response, data) => {
Expand Down Expand Up @@ -371,6 +368,11 @@ class RequestBuilder extends kaltura.VolatileRequestData {
this.data.kalsig = signature;
}

setSessionId(sessionId) {
this.sessionId = sessionId
return this;
}

getUrl(client) {
let requestUrl = client.config.serviceUrl + client.config.serviceBase;
requestUrl += '/' + this.service + '/action/' + this.action;
Expand All @@ -393,6 +395,19 @@ class RequestBuilder extends kaltura.VolatileRequestData {
return this.data;
}

getHeaders(client) {
let headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
};

if (this.sessionId) {
headers['x-kaltura-session-id'] = this.sessionId;
}

return headers;
}

execute(client, callback) {
copyObject(client.requestData, this.requestData);

Expand Down
105 changes: 105 additions & 0 deletions KalturaModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5489,6 +5489,96 @@ class Partner extends kaltura.BaseObject{
getMonitorUsage() {
return this.monitorUsage;
}

/**
*
* @return string
*/
getPasswordStructureValidations() {
return this.passwordStructureValidations;
}

/**
* @param passwordStructureValidations string
*/
setPasswordStructureValidations(passwordStructureValidations) {
this.passwordStructureValidations = passwordStructureValidations;
}

/**
*
* @return string
*/
getPasswordStructureValidationsDescription() {
return this.passwordStructureValidationsDescription;
}

/**
* @param passwordStructureValidationsDescription string
*/
setPasswordStructureValidationsDescription(passwordStructureValidationsDescription) {
this.passwordStructureValidationsDescription = passwordStructureValidationsDescription;
}

/**
*
* @return int
*/
getPassReplaceFreq() {
return this.passReplaceFreq;
}

/**
* @param passReplaceFreq int
*/
setPassReplaceFreq(passReplaceFreq) {
this.passReplaceFreq = passReplaceFreq;
}

/**
*
* @return int
*/
getMaxLoginAttempts() {
return this.maxLoginAttempts;
}

/**
* @param maxLoginAttempts int
*/
setMaxLoginAttempts(maxLoginAttempts) {
this.maxLoginAttempts = maxLoginAttempts;
}

/**
*
* @return int
*/
getLoginBlockPeriod() {
return this.loginBlockPeriod;
}

/**
* @param loginBlockPeriod int
*/
setLoginBlockPeriod(loginBlockPeriod) {
this.loginBlockPeriod = loginBlockPeriod;
}

/**
*
* @return int
*/
getNumPrevPassToKeep() {
return this.numPrevPassToKeep;
}

/**
* @param numPrevPassToKeep int
*/
setNumPrevPassToKeep(numPrevPassToKeep) {
this.numPrevPassToKeep = numPrevPassToKeep;
}
}
module.exports.Partner = Partner;

Expand Down Expand Up @@ -12196,6 +12286,21 @@ class DropFolder extends kaltura.BaseObject{
this.fileDeletePolicy = fileDeletePolicy;
}

/**
*
* @return string
*/
getFileDeleteRegex() {
return this.fileDeleteRegex;
}

/**
* @param fileDeleteRegex string
*/
setFileDeleteRegex(fileDeleteRegex) {
this.fileDeleteRegex = fileDeleteRegex;
}

/**
*
* @return int
Expand Down
1 change: 1 addition & 0 deletions KalturaTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6161,6 +6161,7 @@ UPDATED_AT_DESC : '-updatedAt',

module.exports.VideoCodec = {
NONE : '',
AV1 : 'AV1',
APCH : 'apch',
APCN : 'apcn',
APCO : 'apco',
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Kaltura node.js API Client Library.
Compatible with Kaltura server version 17.3.0 and above.
Compatible with Kaltura server version 17.5.0 and above.
This client library replaces the older architecture that presented in previous node.js client library.

[![NPM](https://nodei.co/npm/kaltura-client.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/kaltura-client/)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kaltura-client",
"version": "17.3.0",
"version": "17.5.0",
"description": "Kaltura NodeJS client library (new implementation)",
"main": "KalturaClient.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion test/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("Add media", () => {

let entry = new kaltura.objects.MediaEntry({
mediaType: kaltura.enums.MediaType.VIDEO,
name: 'test'
name: 'test עברית عربيه हिन्दू'
});

let uploadToken = new kaltura.objects.UploadToken({
Expand Down

0 comments on commit 1bb8541

Please sign in to comment.