@ndarilek/janus
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -0,1 +1,6 @@ | ||
# V0.2.1 (2016-04-15) | ||
* Remove runtime typechecking as it interferes with statics properties. | ||
* Add additional typechecks. | ||
# V0.2.0 (2016-04-14) | ||
@@ -2,0 +7,0 @@ |
import * as EventEmitter from "eventemitter3"; | ||
export { EventEmitter }; | ||
export default class Session extends EventEmitter { | ||
@@ -6,7 +7,7 @@ private endpoint; | ||
private handles; | ||
destroyed: boolean; | ||
sessionId: number; | ||
private destroyed; | ||
private sessionId; | ||
constructor(endpoint: string); | ||
fullEndpoint(): string; | ||
_poll(): void; | ||
private poll(); | ||
attach(pluginId: string): Promise<Handle>; | ||
@@ -19,7 +20,7 @@ destroy(): void; | ||
constructor(session: Session, id: number); | ||
fullEndpoint(): string; | ||
private fullEndpoint(); | ||
message(body: Object, jsep: Object): Promise<any>; | ||
trickle(candidates: any): Promise<any>; | ||
trickle(candidates?: Array<Object> | Object): Promise<any>; | ||
hangup(): Promise<any>; | ||
destroy(): void; | ||
} |
@@ -7,16 +7,7 @@ "use strict"; | ||
}; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var es6_promise_1 = require("es6-promise"); | ||
var EventEmitter = require("eventemitter3"); | ||
exports.EventEmitter = EventEmitter; | ||
var _ = require("lodash"); | ||
var objectAssign = require("object-assign"); | ||
var runtime_type_checks_1 = require('runtime-type-checks'); | ||
var getTransactionId = function () { return (Math.random() * 10000000).toFixed().toString(); }; | ||
@@ -45,2 +36,4 @@ var janusFetch = function (endpoint, args) { return fetch(endpoint, objectAssign({ | ||
throw new Error("Endpoint not specified"); | ||
if (typeof (endpoint) != "string") | ||
throw new Error("Endpoint not a string"); | ||
janusFetch(endpoint, { | ||
@@ -56,3 +49,3 @@ method: "POST", | ||
_this.emit("connected"); | ||
_this._poll(); | ||
_this.poll(); | ||
}).catch(console.error); | ||
@@ -63,3 +56,3 @@ } | ||
}; | ||
Session.prototype._poll = function () { | ||
Session.prototype.poll = function () { | ||
var _this = this; | ||
@@ -95,3 +88,3 @@ janusFetch(this.fullEndpoint()) | ||
if (!_this.destroyed) | ||
_this._poll(); | ||
_this.poll(); | ||
}); | ||
@@ -131,6 +124,2 @@ }; | ||
Session.getTransactionId = getTransactionId; | ||
Session = __decorate([ | ||
runtime_type_checks_1.CheckParams(), | ||
__metadata('design:paramtypes', [String]) | ||
], Session); | ||
return Session; | ||
@@ -196,8 +185,4 @@ }(EventEmitter)); | ||
}; | ||
Handle = __decorate([ | ||
runtime_type_checks_1.CheckParams(), | ||
__metadata('design:paramtypes', [Session, Number]) | ||
], Handle); | ||
return Handle; | ||
}(EventEmitter)); | ||
exports.Handle = Handle; |
{ | ||
"name": "@ndarilek/janus", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Simple API for the Janus media server", | ||
@@ -37,5 +37,4 @@ "main": "lib/index.js", | ||
"isomorphic-fetch": "^2.2.1", | ||
"lodash": "^4.8.2", | ||
"runtime-type-checks": "0.0.4" | ||
"lodash": "^4.8.2" | ||
} | ||
} |
@@ -15,3 +15,3 @@ import assert from "assert" | ||
simple.mock(Session.prototype, "emit") | ||
simple.mock(Session.prototype, "_poll").resolveWith(true) | ||
simple.mock(Session.prototype, "poll").resolveWith(true) | ||
}) | ||
@@ -63,3 +63,3 @@ | ||
setTimeout(() => { | ||
assert(s._poll.called) | ||
assert(s.poll.called) | ||
done() | ||
@@ -66,0 +66,0 @@ }, 50) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4
3
13408
262
- Removedruntime-type-checks@0.0.4
- Removedreflect-metadata@0.1.14(transitive)
- Removedruntime-type-checks@0.0.4(transitive)