openvidu-node-client initial version

pull/20/head
pabloFuente 2017-06-10 01:44:31 +02:00
parent 1e046f80c0
commit 12fdd21315
24 changed files with 506 additions and 0 deletions

43
openvidu-node-client/.gitignore vendored Normal file
View File

@ -0,0 +1,43 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# dependencies
/node_modules
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
testem.log
/typings
# e2e
/e2e/*.js
/e2e/*.map
# System Files
.DS_Store
Thumbs.db
*.editorconfig

View File

@ -0,0 +1,28 @@
# OpenviduNodeClient
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.2.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

View File

@ -0,0 +1,7 @@
import { Session } from "./Session";
export declare class OpenVidu {
private urlOpenViduServer;
private secret;
constructor(urlOpenViduServer: string, secret: string);
createSession(): Session;
}

View File

@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Session_1 = require("./Session");
var OpenVidu = (function () {
function OpenVidu(urlOpenViduServer, secret) {
this.urlOpenViduServer = urlOpenViduServer;
this.secret = secret;
}
OpenVidu.prototype.createSession = function () {
return new Session_1.Session(this.urlOpenViduServer, this.secret);
};
return OpenVidu;
}());
exports.OpenVidu = OpenVidu;
//# sourceMappingURL=OpenVidu.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"OpenVidu.js","sourceRoot":"","sources":["../src/OpenVidu.ts"],"names":[],"mappings":";;AAAA,qCAAoC;AAEpC;IAEE,kBAAoB,iBAAyB,EAAU,MAAc;QAAjD,sBAAiB,GAAjB,iBAAiB,CAAQ;QAAU,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAElE,gCAAa,GAApB;QACI,MAAM,CAAC,IAAI,iBAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;IAEH,eAAC;AAAD,CAAC,AARD,IAQC;AARY,4BAAQ"}

View File

@ -0,0 +1,5 @@
export declare enum OpenViduRole {
SUBSCRIBER,
PUBLISHER,
MODERATOR,
}

View File

@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var OpenViduRole;
(function (OpenViduRole) {
OpenViduRole[OpenViduRole["SUBSCRIBER"] = 'SUBSCRIBER'] = "SUBSCRIBER";
OpenViduRole[OpenViduRole["PUBLISHER"] = 'PUBLISHER'] = "PUBLISHER";
OpenViduRole[OpenViduRole["MODERATOR"] = 'MODERATOR'] = "MODERATOR";
})(OpenViduRole = exports.OpenViduRole || (exports.OpenViduRole = {}));
//# sourceMappingURL=OpenViduRole.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"OpenViduRole.js","sourceRoot":"","sources":["../src/OpenViduRole.ts"],"names":[],"mappings":";;AAAA,IAAY,YAIX;AAJD,WAAY,YAAY;IACvB,0CAAkB,YAAY,gBAAA,CAAA;IAC9B,yCAAiB,WAAW,eAAA,CAAA;IAC5B,yCAAiB,WAAW,eAAA,CAAA;AAC7B,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB"}

15
openvidu-node-client/lib/Session.d.ts vendored Normal file
View File

@ -0,0 +1,15 @@
import { TokenOptions } from './TokenOptions';
export declare class Session {
private urlOpenViduServer;
private secret;
private sessionIdURL;
private tokenURL;
private sessionId;
private hostname;
private port;
constructor(urlOpenViduServer: string, secret: string);
getSessionId(callback: Function): string;
generateToken(tokenOptions: TokenOptions, callback: Function): void;
private getBasicAuth();
private setHostnameAndPort();
}

View File

@ -0,0 +1,100 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var https = require('https');
var Session = (function () {
function Session(urlOpenViduServer, secret) {
this.urlOpenViduServer = urlOpenViduServer;
this.secret = secret;
this.sessionIdURL = '/api/sessions';
this.tokenURL = '/api/tokens';
this.sessionId = "";
this.setHostnameAndPort();
}
Session.prototype.getSessionId = function (callback) {
var _this = this;
if (this.sessionId) {
return this.sessionId;
}
var options = {
hostname: this.hostname,
port: this.port,
path: this.sessionIdURL,
method: 'POST',
headers: {
'Authorization': this.getBasicAuth()
}
};
var req = https.request(options, function (res) {
var body = '';
res.on('data', function (d) {
// Continuously update stream with data
body += d;
});
res.on('end', function () {
// Data reception is done
var parsed = JSON.parse(body);
_this.sessionId = parsed.id;
callback(parsed.id);
});
});
req.on('error', function (e) {
console.error(e);
});
req.end();
};
Session.prototype.generateToken = function (tokenOptions, callback) {
var requestBody = JSON.stringify({
'session': this.sessionId,
'role': tokenOptions.getRole(),
'data': tokenOptions.getData()
});
var options = {
hostname: this.hostname,
port: this.port,
path: this.tokenURL,
method: 'POST',
headers: {
'Authorization': this.getBasicAuth(),
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
var req = https.request(options, function (res) {
var body = '';
res.on('data', function (d) {
// Continuously update stream with data
body += d;
});
res.on('end', function () {
// Data reception is done
var parsed = JSON.parse(body);
callback(parsed.id);
});
});
req.on('error', function (e) {
console.error(e);
});
req.write(requestBody);
req.end();
};
Session.prototype.getBasicAuth = function () {
return 'Basic ' + (new Buffer('OPENVIDUAPP:' + this.secret).toString('base64'));
};
Session.prototype.setHostnameAndPort = function () {
var urlSplitted = this.urlOpenViduServer.split(':');
if (urlSplitted.length === 3) {
this.hostname = this.urlOpenViduServer.split(':')[1].replace(/\//g, '');
this.port = parseInt(this.urlOpenViduServer.split(':')[2].replace(/\//g, ''));
}
else if (urlSplitted.length == 2) {
this.hostname = this.urlOpenViduServer.split(':')[0].replace(/\//g, '');
this.port = parseInt(this.urlOpenViduServer.split(':')[1].replace(/\//g, ''));
}
else {
console.error("URL format incorrect: it must contain hostname and port (current value: '" + this.urlOpenViduServer + "')");
}
};
return Session;
}());
exports.Session = Session;
//# sourceMappingURL=Session.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Session.js","sourceRoot":"","sources":["../src/Session.ts"],"names":[],"mappings":";;AAKA,IAAI,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE7B;IAQI,iBAAoB,iBAAyB,EAAU,MAAc;QAAjD,sBAAiB,GAAjB,iBAAiB,CAAQ;QAAU,WAAM,GAAN,MAAM,CAAQ;QAN7D,iBAAY,GAAW,eAAe,CAAC;QACvC,aAAQ,GAAW,aAAa,CAAC;QACjC,cAAS,GAAW,EAAE,CAAC;QAK3B,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC9B,CAAC;IAEM,8BAAY,GAAnB,UAAoB,QAAkB;QAAtC,iBAiCC;QA/BG,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;YACjB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;QAED,IAAI,OAAO,GAAG;YACV,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,YAAY;YACvB,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACL,eAAe,EAAE,IAAI,CAAC,YAAY,EAAE;aACvC;SACJ,CAAA;QACD,IAAM,GAAG,GAAG,KAAK,CAA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CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;QAClF,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACxE,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;QAClF,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,OAAO,CAAC,KAAK,CAAC,2EAA2E,GAAG,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;QAC/H,CAAC;IACL,CAAC;IAEL,cAAC;AAAD,CAAC,AArGD,IAqGC;AArGY,0BAAO"}

View File

@ -0,0 +1,17 @@
import { OpenViduRole } from "./OpenViduRole";
export declare class TokenOptions {
private data;
private role;
constructor(data: string, role: OpenViduRole);
getData(): string;
getRole(): OpenViduRole;
}
export declare namespace TokenOptions {
class Builder {
private dataProp;
private roleProp;
build(): TokenOptions;
data(data: string): Builder;
role(role: OpenViduRole): Builder;
}
}

View File

@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var TokenOptions = (function () {
function TokenOptions(data, role) {
this.data = data;
this.role = role;
this.data = data;
this.role = role;
}
TokenOptions.prototype.getData = function () {
return this.data;
};
TokenOptions.prototype.getRole = function () {
return this.role;
};
return TokenOptions;
}());
exports.TokenOptions = TokenOptions;
(function (TokenOptions) {
var Builder = (function () {
function Builder() {
}
Builder.prototype.build = function () {
return new TokenOptions(this.dataProp, this.roleProp);
};
Builder.prototype.data = function (data) {
this.dataProp = data;
return this;
};
Builder.prototype.role = function (role) {
this.roleProp = role;
return this;
};
return Builder;
}());
TokenOptions.Builder = Builder;
;
})(TokenOptions = exports.TokenOptions || (exports.TokenOptions = {}));
exports.TokenOptions = TokenOptions;
//# sourceMappingURL=TokenOptions.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"TokenOptions.js","sourceRoot":"","sources":["../src/TokenOptions.ts"],"names":[],"mappings":";;AAEA;IAEI,sBAAoB,IAAY,EAAU,IAAkB;QAAxC,SAAI,GAAJ,IAAI,CAAQ;QAAU,SAAI,GAAJ,IAAI,CAAc;QACxD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAEM,8BAAO,GAAd;QACI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAEM,8BAAO,GAAd;QACI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IACL,mBAAC;AAAD,CAAC,AAdD,IAcC;AAdY,oCAAY;AAgBzB,WAAiB,YAAY;IACzB;QAAA;QAmBA,CAAC;QAdG,uBAAK,GAAL;YACI,MAAM,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC1D,CAAC;QAED,sBAAI,GAAJ,UAAK,IAAY;YACb,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC;QAED,sBAAI,GAAJ,UAAK,IAAkB;YACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC;QAEL,cAAC;IAAD,CAAC,AAnBD,IAmBC;IAnBY,oBAAO,UAmBnB,CAAA;IAAA,CAAC;AACN,CAAC,EArBgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAqB5B;AArCY,oCAAY"}

4
openvidu-node-client/lib/index.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
export * from './OpenVidu';
export * from './OpenViduRole';
export * from './Session';
export * from './TokenOptions';

View File

@ -0,0 +1,10 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./OpenVidu"));
__export(require("./OpenViduRole"));
__export(require("./Session"));
__export(require("./TokenOptions"));
//# sourceMappingURL=index.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,gCAA2B;AAC3B,oCAA+B;AAC/B,+BAA0B;AAC1B,oCAA+B"}

View File

@ -0,0 +1,19 @@
{
"name": "openvidu-node-client",
"version": "1.0.0",
"license": "MIT",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"scripts": {
"build": "tsc"
},
"private": true,
"dependencies": {},
"devDependencies": {
"@types/node": "^6.0.78",
"codelyzer": "~2.0.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "2.3.4"
}
}

View File

@ -0,0 +1,11 @@
import { Session } from "./Session";
export class OpenVidu {
constructor(private urlOpenViduServer: string, private secret: string){ }
public createSession(): Session {
return new Session(this.urlOpenViduServer, this.secret);
}
}

View File

@ -0,0 +1,5 @@
export enum OpenViduRole {
SUBSCRIBER = <any>'SUBSCRIBER',
PUBLISHER = <any>'PUBLISHER',
MODERATOR = <any>'MODERATOR'
}

View File

@ -0,0 +1,109 @@
import { TokenOptions } from './TokenOptions';
declare const Buffer;
declare const require;
var https = require('https');
export class Session {
private sessionIdURL: string = '/api/sessions';
private tokenURL: string = '/api/tokens';
private sessionId: string = "";
private hostname: string;
private port: number;
constructor(private urlOpenViduServer: string, private secret: string) {
this.setHostnameAndPort();
}
public getSessionId(callback: Function) {
if (this.sessionId) {
return this.sessionId;
}
let options = {
hostname: this.hostname,
port: this.port,
path: this.sessionIdURL,
method: 'POST',
headers: {
'Authorization': this.getBasicAuth()
}
}
const req = https.request(options, (res) => {
var body = '';
res.on('data', (d) => {
// Continuously update stream with data
body += d;
});
res.on('end', () => {
// Data reception is done
var parsed = JSON.parse(body);
this.sessionId = parsed.id;
callback(parsed.id);
});
});
req.on('error', (e) => {
console.error(e);
});
req.end();
}
public generateToken(tokenOptions: TokenOptions, callback: Function) {
var requestBody = JSON.stringify({
'session': this.sessionId,
'role': tokenOptions.getRole(),
'data': tokenOptions.getData()
});
var options = {
hostname: this.hostname,
port: this.port,
path: this.tokenURL,
method: 'POST',
headers: {
'Authorization': this.getBasicAuth(),
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const req = https.request(options, (res) => {
var body = '';
res.on('data', (d) => {
// Continuously update stream with data
body += d;
});
res.on('end', () => {
// Data reception is done
var parsed = JSON.parse(body);
callback(parsed.id);
});
});
req.on('error', (e) => {
console.error(e);
});
req.write(requestBody);
req.end();
}
private getBasicAuth() {
return 'Basic ' + (new Buffer('OPENVIDUAPP:' + this.secret).toString('base64'));
}
private setHostnameAndPort() {
var urlSplitted = this.urlOpenViduServer.split(':');
if (urlSplitted.length === 3) { // URL has format: http:// + hostname + :port
this.hostname = this.urlOpenViduServer.split(':')[1].replace(/\//g, '');
this.port = parseInt(this.urlOpenViduServer.split(':')[2].replace(/\//g, ''));
} else if (urlSplitted.length == 2) { // URL has format: hostname + :port
this.hostname = this.urlOpenViduServer.split(':')[0].replace(/\//g, '');
this.port = parseInt(this.urlOpenViduServer.split(':')[1].replace(/\//g, ''));
} else {
console.error("URL format incorrect: it must contain hostname and port (current value: '" + this.urlOpenViduServer + "')");
}
}
}

View File

@ -0,0 +1,40 @@
import { OpenViduRole } from "./OpenViduRole";
export class TokenOptions {
constructor(private data: string, private role: OpenViduRole) {
this.data = data;
this.role = role;
}
public getData(): string {
return this.data;
}
public getRole(): OpenViduRole {
return this.role;
}
}
export namespace TokenOptions {
export class Builder {
private dataProp: string;
private roleProp: OpenViduRole;
build(): TokenOptions {
return new TokenOptions(this.dataProp, this.roleProp);
}
data(data: string): Builder {
this.dataProp = data;
return this;
}
role(role: OpenViduRole): Builder {
this.roleProp = role;
return this;
}
};
}

View File

@ -0,0 +1,4 @@
export * from './OpenVidu';
export * from './OpenViduRole';
export * from './Session';
export * from './TokenOptions';

View File

@ -0,0 +1,20 @@
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "lib",
"baseUrl": "src",
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2016",
"dom"
]
}
}