@bwi-mentorspaces/application-utils-npm 0.0.42 → 0.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/session/index.js +0 -1
- package/session/index.js.map +1 -1
- package/session/ms.live/index.d.ts +1 -2
- package/session/ms.live/index.js +1 -3
- package/session/ms.live/index.js.map +1 -1
- package/session/ms.live/models/_/ms.live.config.d.ts +2 -4
- package/session/ms.live/ms.live.api.d.ts +7 -9
- package/session/ms.live/ms.live.api.js +30 -35
- package/session/ms.live/ms.live.api.js.map +1 -1
- package/session/ms.live/ms.live.auth.js +2 -1
- package/session/ms.live/ms.live.auth.js.map +1 -1
- package/session/ms.live/ms.live.base.d.ts +37 -0
- package/session/ms.live/ms.live.base.js +50 -0
- package/session/ms.live/ms.live.base.js.map +1 -0
- package/session/ms.live/ms.live.room.d.ts +14 -5
- package/session/ms.live/ms.live.room.js +28 -11
- package/session/ms.live/ms.live.room.js.map +1 -1
- package/session/ms.live/ms.live.template.d.ts +0 -39
- package/session/ms.live/ms.live.template.js +0 -210
- package/session/ms.live/ms.live.template.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bwi-mentorspaces/application-utils-npm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.45",
|
|
4
4
|
"description": "Mentor Spaces npm packages for reusable models, utils, and abstracted, commonly used processes for DB Repo, Logging, etc.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mentor Spaces",
|
package/session/index.js
CHANGED
package/session/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../session/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAsC;AACtC,yCAA4C;AAE5C,uDAAkD;AAUlD;;GAEG;AAEI,IAAM,OAAO,GAAb,MAAM,OAAO;IAMhB;;;;OAIG;IACH,YAAY,UAAsB,EAAE,MAAqB;QACrD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,kBAAkB;IAClB;;;OAGG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,UAAU;IACV;;;OAGG;IACK,IAAI;QACR,gDAAgD;QAChD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../session/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAsC;AACtC,yCAA4C;AAE5C,uDAAkD;AAUlD;;GAEG;AAEI,IAAM,OAAO,GAAb,MAAM,OAAO;IAMhB;;;;OAIG;IACH,YAAY,UAAsB,EAAE,MAAqB;QACrD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,kBAAkB;IAClB;;;OAGG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,UAAU;IACV;;;OAGG;IACK,IAAI;QACR,gDAAgD;QAChD,IAAI,IAAI,CAAC,WAAW,IAAI,iBAAU,CAAC,MAAM,EAAE;YACvC,IAAI,CAAC,OAAO,GAAG,IAAI,uBAAS,CAAC,IAAI,CAAC,OAAO,CAAiB,CAAC;SAC9D;IACL,CAAC;CACJ,CAAA;AArCY,OAAO;IADnB,IAAA,qBAAU,GAAE;;GACA,OAAO,CAqCnB;AArCY,0BAAO"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { MSLiveAuth } from "./ms.live.auth";
|
|
2
2
|
import { MSLiveAPI } from "./ms.live.api";
|
|
3
3
|
import { MSLiveRoom } from "./ms.live.room";
|
|
4
|
-
|
|
5
|
-
export { MSLiveAPI, MSLiveAuth, MSLiveRoom, MSLiveTemplate };
|
|
4
|
+
export { MSLiveAPI, MSLiveAuth, MSLiveRoom };
|
package/session/ms.live/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.MSLiveRoom = exports.MSLiveAuth = exports.MSLiveAPI = void 0;
|
|
4
4
|
const ms_live_auth_1 = require("./ms.live.auth");
|
|
5
5
|
Object.defineProperty(exports, "MSLiveAuth", { enumerable: true, get: function () { return ms_live_auth_1.MSLiveAuth; } });
|
|
6
6
|
const ms_live_api_1 = require("./ms.live.api");
|
|
7
7
|
Object.defineProperty(exports, "MSLiveAPI", { enumerable: true, get: function () { return ms_live_api_1.MSLiveAPI; } });
|
|
8
8
|
const ms_live_room_1 = require("./ms.live.room");
|
|
9
9
|
Object.defineProperty(exports, "MSLiveRoom", { enumerable: true, get: function () { return ms_live_room_1.MSLiveRoom; } });
|
|
10
|
-
const ms_live_template_1 = require("./ms.live.template");
|
|
11
|
-
Object.defineProperty(exports, "MSLiveTemplate", { enumerable: true, get: function () { return ms_live_template_1.MSLiveTemplate; } });
|
|
12
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../session/ms.live/index.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../session/ms.live/index.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAIxB,2FAJX,yBAAU,OAIW;AAH9B,+CAA0C;AAGjC,0FAHA,uBAAS,OAGA;AAFlB,iDAA4C;AAEZ,2FAFvB,yBAAU,OAEuB"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { IMSLiveConfig } from "./models";
|
|
2
|
+
import { MSLiveBase } from "./ms.live.base";
|
|
2
3
|
import { MSLiveRoom } from "./ms.live.room";
|
|
3
|
-
|
|
4
|
-
export declare class MSLiveAPI {
|
|
4
|
+
export declare class MSLiveAPI extends MSLiveBase {
|
|
5
5
|
#private;
|
|
6
6
|
private _msLiveRoom;
|
|
7
|
-
private
|
|
7
|
+
private _config;
|
|
8
8
|
constructor(config: IMSLiveConfig);
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @returns {
|
|
10
|
+
* initialize method
|
|
11
|
+
* @returns {void} promise of type void
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
private init;
|
|
14
14
|
/**
|
|
15
15
|
* getter for MSLive API Room
|
|
16
16
|
* @returns {MSLiveRoom} twilio room instance
|
|
17
17
|
*/
|
|
18
|
-
get
|
|
19
|
-
get(path: string, queryParams: any): Promise<any>;
|
|
20
|
-
post(path: string, payload: any): Promise<any>;
|
|
18
|
+
get msLiveRoom(): MSLiveRoom;
|
|
21
19
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12
12
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
@@ -26,55 +26,45 @@ var _MSLiveAPI_instances, _MSLiveAPI_axiosInstance, _MSLiveAPI_msLiveAuthInstanc
|
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
exports.MSLiveAPI = void 0;
|
|
28
28
|
const axios_1 = __importDefault(require("axios"));
|
|
29
|
+
const tsyringe_1 = require("tsyringe");
|
|
29
30
|
const ms_live_auth_1 = require("./ms.live.auth");
|
|
31
|
+
const ms_live_base_1 = require("./ms.live.base");
|
|
32
|
+
const ms_live_room_1 = require("./ms.live.room");
|
|
30
33
|
// A service class for all REST API operations
|
|
31
|
-
class MSLiveAPI {
|
|
34
|
+
let MSLiveAPI = class MSLiveAPI extends ms_live_base_1.MSLiveBase {
|
|
32
35
|
constructor(config) {
|
|
36
|
+
super();
|
|
33
37
|
_MSLiveAPI_instances.add(this);
|
|
34
38
|
_MSLiveAPI_axiosInstance.set(this, void 0);
|
|
35
39
|
/* eslint-disable */
|
|
36
40
|
_MSLiveAPI_msLiveAuthInstance.set(this, void 0);
|
|
41
|
+
this._config = config;
|
|
37
42
|
// Set Axios baseURL to 100ms API BaseURI
|
|
38
43
|
__classPrivateFieldSet(this, _MSLiveAPI_axiosInstance, axios_1.default.create({
|
|
39
44
|
baseURL: "https://api.100ms.live/v2",
|
|
40
45
|
timeout: 3 * 60000
|
|
41
46
|
}), "f");
|
|
42
|
-
__classPrivateFieldSet(this, _MSLiveAPI_msLiveAuthInstance, new ms_live_auth_1.MSLiveAuth(config), "f");
|
|
43
47
|
__classPrivateFieldGet(this, _MSLiveAPI_instances, "m", _MSLiveAPI_configureAxios).call(this);
|
|
48
|
+
this.init();
|
|
44
49
|
}
|
|
45
50
|
/**
|
|
46
|
-
*
|
|
47
|
-
* @returns {
|
|
51
|
+
* initialize method
|
|
52
|
+
* @returns {void} promise of type void
|
|
48
53
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
init() {
|
|
55
|
+
super.auth = new ms_live_auth_1.MSLiveAuth(this._config);
|
|
56
|
+
__classPrivateFieldSet(this, _MSLiveAPI_msLiveAuthInstance, super.auth, "f");
|
|
57
|
+
// create instances of all sub-api classes
|
|
58
|
+
this._msLiveRoom = new ms_live_room_1.MSLiveRoom(__classPrivateFieldGet(this, _MSLiveAPI_axiosInstance, "f"));
|
|
51
59
|
}
|
|
52
60
|
/**
|
|
53
61
|
* getter for MSLive API Room
|
|
54
62
|
* @returns {MSLiveRoom} twilio room instance
|
|
55
63
|
*/
|
|
56
|
-
get
|
|
57
|
-
return this.
|
|
58
|
-
}
|
|
59
|
-
// A method for GET requests using the configured Axios instance
|
|
60
|
-
get(path, queryParams) {
|
|
61
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
const res = yield __classPrivateFieldGet(this, _MSLiveAPI_axiosInstance, "f").get(path, { params: queryParams });
|
|
63
|
-
console.log(`get call to path - ${path}, status code - ${res.status}`);
|
|
64
|
-
return res.data;
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
// A method for POST requests using the configured Axios instance
|
|
68
|
-
post(path, payload) {
|
|
69
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
const res = yield __classPrivateFieldGet(this, _MSLiveAPI_axiosInstance, "f").post(path, payload || {});
|
|
71
|
-
console.log("payload", payload);
|
|
72
|
-
console.log(`post call to path - ${path}, status code - ${res.status}`);
|
|
73
|
-
return res.data;
|
|
74
|
-
});
|
|
64
|
+
get msLiveRoom() {
|
|
65
|
+
return this._msLiveRoom;
|
|
75
66
|
}
|
|
76
|
-
}
|
|
77
|
-
exports.MSLiveAPI = MSLiveAPI;
|
|
67
|
+
};
|
|
78
68
|
_MSLiveAPI_axiosInstance = new WeakMap(), _MSLiveAPI_msLiveAuthInstance = new WeakMap(), _MSLiveAPI_instances = new WeakSet(), _MSLiveAPI_configureAxios = function _MSLiveAPI_configureAxios() {
|
|
79
69
|
/* eslint-disable */
|
|
80
70
|
__classPrivateFieldGet(this, _MSLiveAPI_axiosInstance, "f").interceptors.request.use((config) => {
|
|
@@ -109,5 +99,10 @@ _MSLiveAPI_axiosInstance = new WeakMap(), _MSLiveAPI_msLiveAuthInstance = new We
|
|
|
109
99
|
return Promise.reject(error);
|
|
110
100
|
});
|
|
111
101
|
};
|
|
102
|
+
MSLiveAPI = __decorate([
|
|
103
|
+
(0, tsyringe_1.injectable)(),
|
|
104
|
+
__metadata("design:paramtypes", [Object])
|
|
105
|
+
], MSLiveAPI);
|
|
106
|
+
exports.MSLiveAPI = MSLiveAPI;
|
|
112
107
|
module.exports = { MSLiveAPI };
|
|
113
108
|
//# sourceMappingURL=ms.live.api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ms.live.api.js","sourceRoot":"","sources":["../../../session/ms.live/ms.live.api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA6C;
|
|
1
|
+
{"version":3,"file":"ms.live.api.js","sourceRoot":"","sources":["../../../session/ms.live/ms.live.api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,uCAAsC;AAEtC,iDAA4C;AAC5C,iDAA4C;AAC5C,iDAA4C;AAE5C,8CAA8C;AAEvC,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,yBAAU;IAMrC,YAAY,MAAqB;QAC7B,KAAK,EAAE,CAAC;;QAJZ,2CAA8B;QAC9B,oBAAoB;QACpB,gDAAmB;QAGf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,yCAAyC;QACzC,uBAAA,IAAI,4BAAkB,eAAK,CAAC,MAAM,CAC9B;YACI,OAAO,EAAE,2BAA2B;YACpC,OAAO,EAAE,CAAC,GAAG,KAAK;SACrB,CAAC,MAAA,CAAC;QAEP,uBAAA,IAAI,uD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AK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,CAAC;YAClE,CAAC,eAAe,CAAC,MAAM,EACzB;YACE,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;YACrD,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;YAE9B,0DAA0D;YAC1D,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,SAAS,GAAG,uBAAA,IAAI,qCAAoB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;YAC/G,IAAI;gBACA,OAAO,IAAA,eAAK,EAAC,eAAe,CAAC,CAAC;aACjC;YAAC,OAAO,KAAK,EAAE;gBACZ,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;aACrC;SACJ;QACD,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC,CACJ,CAAC;AACN,CAAC;AA9EQ,SAAS;IADrB,IAAA,qBAAU,GAAE;;GACA,SAAS,CA+ErB;AA/EY,8BAAS;AAiFtB,MAAM,CAAC,OAAO,GAAG,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -31,7 +31,7 @@ let MSLiveAuth = class MSLiveAuth {
|
|
|
31
31
|
*/
|
|
32
32
|
constructor(config) {
|
|
33
33
|
_MSLiveAuth_instances.add(this);
|
|
34
|
-
this.init(config.
|
|
34
|
+
this.init(config.msLiveAccessKey, config.msLiveSecretKey);
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* Get MSLive Credentials
|
|
@@ -56,6 +56,7 @@ let MSLiveAuth = class MSLiveAuth {
|
|
|
56
56
|
};
|
|
57
57
|
this._managementToken = __classPrivateFieldGet(this, _MSLiveAuth_instances, "m", _MSLiveAuth_signPayloadToToken).call(this, payload);
|
|
58
58
|
}
|
|
59
|
+
console.log("this._managementToken: ", this._managementToken);
|
|
59
60
|
return this._managementToken;
|
|
60
61
|
}
|
|
61
62
|
// Generate new Auth token for a peer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ms.live.auth.js","sourceRoot":"","sources":["../../../session/ms.live/ms.live.auth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AAEtC,oBAAoB;AACpB,MAAM,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AACpC,+BAAoC;AA6BpC,oBAAoB;AACpB;;GAEG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAU;IAMnB;;;OAGG;IACH,YAAY,MAAqB;;QAC7B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"ms.live.auth.js","sourceRoot":"","sources":["../../../session/ms.live/ms.live.auth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AAEtC,oBAAoB;AACpB,MAAM,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AACpC,+BAAoC;AA6BpC,oBAAoB;AACpB;;GAEG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAU;IAMnB;;;OAGG;IACH,YAAY,MAAqB;;QAC7B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,iBAAyB,EAAE,eAAuB;QACnD,IAAI,CAAC,gBAAgB,GAAG,iBAAiB,CAAC;QAC1C,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IA8BD,sDAAsD;IACtD,kBAAkB,CAAC,QAAQ;QACvB,IAAI,QAAQ,IAAI,uBAAA,IAAI,yDAAgB,MAApB,IAAI,EAAiB,IAAI,CAAC,gBAAgB,CAAC,EAA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CACJ,CAAC;IACF,oBAAoB;IACpB,OAAO,KAAK,CAAC;AACjB,CAAC,mEAGe,KAAK;IACjB,IAAI;QACA,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,4CAA4C;QAC/D,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,IAAI,GAAG,GAAG,MAAM,GAAG,eAAe,CAAC;KACjD;IAAC,OAAO,GAAG,EAAE;QACV,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC;KACf;AACL,CAAC;AApDQ,UAAU;IADtB,IAAA,qBAAU,GAAE;;GACA,UAAU,CAoFtB;AApFY,gCAAU;AAsFvB,MAAM,CAAC,OAAO,GAAG,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MSLiveAuth } from "./ms.live.auth";
|
|
2
|
+
import { AxiosInstance } from "axios";
|
|
3
|
+
/**
|
|
4
|
+
* Base client class
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class MSLiveBase {
|
|
7
|
+
private _server;
|
|
8
|
+
private _auth;
|
|
9
|
+
/**
|
|
10
|
+
* getter for msLive instance
|
|
11
|
+
* @returns {AxiosInstance} msLive instance
|
|
12
|
+
*/
|
|
13
|
+
get server(): AxiosInstance;
|
|
14
|
+
/**
|
|
15
|
+
* setter for msLive instance
|
|
16
|
+
* @param {MSLiveAuth} value msLive instance
|
|
17
|
+
*/
|
|
18
|
+
set server(value: AxiosInstance);
|
|
19
|
+
/**
|
|
20
|
+
* getter for msLive auth
|
|
21
|
+
* @returns {MSLiveAuth} msLive auth instance
|
|
22
|
+
*/
|
|
23
|
+
get auth(): MSLiveAuth;
|
|
24
|
+
/**
|
|
25
|
+
* setter for msLive auth instance
|
|
26
|
+
* @param {MSLiveAuth} value msLive auth instance
|
|
27
|
+
*/
|
|
28
|
+
set auth(value: MSLiveAuth);
|
|
29
|
+
/**
|
|
30
|
+
* Get token for extended classes
|
|
31
|
+
* @param {string} roomId 100ms room id
|
|
32
|
+
* @param {string} userId peer's user id
|
|
33
|
+
* @param {string} role role in room
|
|
34
|
+
* @returns {string} returns the token value
|
|
35
|
+
*/
|
|
36
|
+
getToken(roomId: string, userId: string, role: string): string;
|
|
37
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MSLiveBase = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Base client class
|
|
6
|
+
*/
|
|
7
|
+
class MSLiveBase {
|
|
8
|
+
// getter / setter
|
|
9
|
+
/**
|
|
10
|
+
* getter for msLive instance
|
|
11
|
+
* @returns {AxiosInstance} msLive instance
|
|
12
|
+
*/
|
|
13
|
+
get server() {
|
|
14
|
+
return this._server;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* setter for msLive instance
|
|
18
|
+
* @param {MSLiveAuth} value msLive instance
|
|
19
|
+
*/
|
|
20
|
+
set server(value) {
|
|
21
|
+
this._server = value;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* getter for msLive auth
|
|
25
|
+
* @returns {MSLiveAuth} msLive auth instance
|
|
26
|
+
*/
|
|
27
|
+
get auth() {
|
|
28
|
+
return this._auth;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* setter for msLive auth instance
|
|
32
|
+
* @param {MSLiveAuth} value msLive auth instance
|
|
33
|
+
*/
|
|
34
|
+
set auth(value) {
|
|
35
|
+
this._auth = value;
|
|
36
|
+
}
|
|
37
|
+
// methods
|
|
38
|
+
/**
|
|
39
|
+
* Get token for extended classes
|
|
40
|
+
* @param {string} roomId 100ms room id
|
|
41
|
+
* @param {string} userId peer's user id
|
|
42
|
+
* @param {string} role role in room
|
|
43
|
+
* @returns {string} returns the token value
|
|
44
|
+
*/
|
|
45
|
+
getToken(roomId, userId, role) {
|
|
46
|
+
return this.auth.getAuthToken(roomId, userId, role);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.MSLiveBase = MSLiveBase;
|
|
50
|
+
//# sourceMappingURL=ms.live.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ms.live.base.js","sourceRoot":"","sources":["../../../session/ms.live/ms.live.base.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAsB,UAAU;IAK5B,kBAAkB;IAClB;;;OAGG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IACD;;;OAGG;IACH,IAAW,MAAM,CAAC,KAAoB;QAClC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,IAAW,IAAI,CAAC,KAAiB;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,UAAU;IAEV;;;;;;OAMG;IACI,QAAQ,CAAC,MAAc,EAAE,MAAc,EAAE,IAAY;QACxD,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;CACJ;AAjDD,gCAiDC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { MSLiveAPI } from "./ms.live.api";
|
|
2
1
|
import { IMSRoomCode, IMSRoomData } from "./models";
|
|
2
|
+
import { MSLiveBase } from "./ms.live.base";
|
|
3
|
+
import { AxiosInstance } from "axios";
|
|
3
4
|
/**
|
|
4
5
|
* MSLive Room API declarations
|
|
5
6
|
*/
|
|
@@ -12,6 +13,10 @@ interface IMSLiveRoom {
|
|
|
12
13
|
* Find an existing room in MSLive
|
|
13
14
|
*/
|
|
14
15
|
findRoom(roomId: string): Promise<IMSRoomData>;
|
|
16
|
+
/**
|
|
17
|
+
* Get all MS rooms
|
|
18
|
+
*/
|
|
19
|
+
getAllRooms(): Promise<IMSRoomData[]>;
|
|
15
20
|
/**
|
|
16
21
|
* Create room codes
|
|
17
22
|
*/
|
|
@@ -32,13 +37,12 @@ interface IMSLiveRoom {
|
|
|
32
37
|
/**
|
|
33
38
|
* MSLive Room API implementation
|
|
34
39
|
*/
|
|
35
|
-
export declare class MSLiveRoom implements IMSLiveRoom {
|
|
36
|
-
private _server;
|
|
40
|
+
export declare class MSLiveRoom extends MSLiveBase implements IMSLiveRoom {
|
|
37
41
|
/**
|
|
38
42
|
* MSLive room constructor
|
|
39
|
-
* @param {
|
|
43
|
+
* @param { AxiosInstance } server Axios instance
|
|
40
44
|
*/
|
|
41
|
-
constructor(server:
|
|
45
|
+
constructor(server: AxiosInstance);
|
|
42
46
|
/**
|
|
43
47
|
* Create a new room in MSLive
|
|
44
48
|
* @param {string} name room name
|
|
@@ -53,6 +57,11 @@ export declare class MSLiveRoom implements IMSLiveRoom {
|
|
|
53
57
|
* @returns {Promise<IMSRoomData>} promise of the result to get a room
|
|
54
58
|
*/
|
|
55
59
|
findRoom(roomId: string): Promise<IMSRoomData>;
|
|
60
|
+
/**
|
|
61
|
+
* Get all rooms
|
|
62
|
+
* @returns {Promise<IMSRoomCode[]>} promise of the result to get room codes
|
|
63
|
+
*/
|
|
64
|
+
getAllRooms(): Promise<IMSRoomData[]>;
|
|
56
65
|
/**
|
|
57
66
|
* Create room codes
|
|
58
67
|
* @param {string} roomId 100ms room id
|
|
@@ -20,17 +20,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.MSLiveRoom = void 0;
|
|
22
22
|
const tsyringe_1 = require("tsyringe");
|
|
23
|
-
const
|
|
23
|
+
const ms_live_base_1 = require("./ms.live.base");
|
|
24
24
|
/**
|
|
25
25
|
* MSLive Room API implementation
|
|
26
26
|
*/
|
|
27
|
-
let MSLiveRoom = class MSLiveRoom {
|
|
27
|
+
let MSLiveRoom = class MSLiveRoom extends ms_live_base_1.MSLiveBase {
|
|
28
28
|
/**
|
|
29
29
|
* MSLive room constructor
|
|
30
|
-
* @param {
|
|
30
|
+
* @param { AxiosInstance } server Axios instance
|
|
31
31
|
*/
|
|
32
32
|
constructor(server) {
|
|
33
|
-
|
|
33
|
+
super();
|
|
34
|
+
this.server = server;
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
37
|
* Create a new room in MSLive
|
|
@@ -47,7 +48,8 @@ let MSLiveRoom = class MSLiveRoom {
|
|
|
47
48
|
template_id: templateId,
|
|
48
49
|
region: "us",
|
|
49
50
|
};
|
|
50
|
-
|
|
51
|
+
const roomData = yield this.server.post("/rooms", payload);
|
|
52
|
+
return roomData.data;
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
@@ -57,7 +59,18 @@ let MSLiveRoom = class MSLiveRoom {
|
|
|
57
59
|
*/
|
|
58
60
|
findRoom(roomId) {
|
|
59
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
|
|
62
|
+
const roomData = yield this.server.get(`/rooms/${roomId}`);
|
|
63
|
+
return roomData.data;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get all rooms
|
|
68
|
+
* @returns {Promise<IMSRoomCode[]>} promise of the result to get room codes
|
|
69
|
+
*/
|
|
70
|
+
getAllRooms() {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const roomData = yield this.server.get(`/rooms`);
|
|
73
|
+
return roomData.data.data;
|
|
61
74
|
});
|
|
62
75
|
}
|
|
63
76
|
/**
|
|
@@ -67,7 +80,8 @@ let MSLiveRoom = class MSLiveRoom {
|
|
|
67
80
|
*/
|
|
68
81
|
createRoomCodes(roomId) {
|
|
69
82
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
|
|
83
|
+
const roomCode = yield this.server.post(`/room-codes/room/${roomId}`);
|
|
84
|
+
return roomCode.data;
|
|
71
85
|
});
|
|
72
86
|
}
|
|
73
87
|
/**
|
|
@@ -77,7 +91,8 @@ let MSLiveRoom = class MSLiveRoom {
|
|
|
77
91
|
*/
|
|
78
92
|
getRoomCodes(roomId) {
|
|
79
93
|
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
|
|
94
|
+
const roomCode = yield this.server.get(`/room-codes/room/${roomId}`);
|
|
95
|
+
return roomCode.data;
|
|
81
96
|
});
|
|
82
97
|
}
|
|
83
98
|
/**
|
|
@@ -87,7 +102,8 @@ let MSLiveRoom = class MSLiveRoom {
|
|
|
87
102
|
*/
|
|
88
103
|
disableRoom(roomId) {
|
|
89
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
|
|
105
|
+
const roomData = yield this.server.post(`/rooms/${roomId}`, { enabled: false });
|
|
106
|
+
return roomData.data;
|
|
91
107
|
});
|
|
92
108
|
}
|
|
93
109
|
/**
|
|
@@ -97,13 +113,14 @@ let MSLiveRoom = class MSLiveRoom {
|
|
|
97
113
|
*/
|
|
98
114
|
enableRoom(roomId) {
|
|
99
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
|
|
116
|
+
const roomData = yield this.server.post(`/rooms/${roomId}`, { enabled: true });
|
|
117
|
+
return roomData.data;
|
|
101
118
|
});
|
|
102
119
|
}
|
|
103
120
|
};
|
|
104
121
|
MSLiveRoom = __decorate([
|
|
105
122
|
(0, tsyringe_1.injectable)(),
|
|
106
|
-
__metadata("design:paramtypes", [
|
|
123
|
+
__metadata("design:paramtypes", [Function])
|
|
107
124
|
], MSLiveRoom);
|
|
108
125
|
exports.MSLiveRoom = MSLiveRoom;
|
|
109
126
|
//# sourceMappingURL=ms.live.room.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ms.live.room.js","sourceRoot":"","sources":["../../../session/ms.live/ms.live.room.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,uCAAsC;
|
|
1
|
+
{"version":3,"file":"ms.live.room.js","sourceRoot":"","sources":["../../../session/ms.live/ms.live.room.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AAEtC,iDAA4C;AA4C5C;;GAEG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,yBAAU;IAEtC;;;OAGG;IACH,YAAY,MAAqB;QAC7B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACxB,CAAC;IAED;;;;;;OAMG;IACG,UAAU,CAAC,IAAY,EAAE,WAAmB,EAAE,UAAkB;;YAClE,MAAM,OAAO,GAAG;gBACZ,IAAI,EAAE,IAAI;gBACV,WAAW,EAAE,WAAW;gBACxB,WAAW,EAAE,UAAU;gBACvB,MAAM,EAAE,IAAI;aACf,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC3D,OAAO,QAAQ,CAAC,IAAI,CAAC;QACzB,CAAC;KAAA;IAED;;;;OAIG;IACG,QAAQ,CAAC,MAAc;;YACzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,MAAM,EAAE,CAAC,CAAC;YAC3D,OAAO,QAAQ,CAAC,IAAI,CAAA;QACxB,CAAC;KAAA;IAED;;;OAGG;IACG,WAAW;;YACb,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACjD,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAA;QAC7B,CAAC;KAAA;IAED;;;;OAIG;IACG,eAAe,CAAC,MAAc;;YAChC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,MAAM,EAAE,CAAC,CAAC;YACtE,OAAO,QAAQ,CAAC,IAAI,CAAC;QACzB,CAAC;KAAA;IAED;;;;OAIG;IACG,YAAY,CAAC,MAAc;;YAC7B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,MAAM,EAAE,CAAC,CAAC;YACrE,OAAO,QAAQ,CAAC,IAAI,CAAC;QACzB,CAAC;KAAA;IAED;;;;OAIG;IACG,WAAW,CAAC,MAAc;;YAC5B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;YAChF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACzB,CAAC;KAAA;IAED;;;;OAIG;IACG,UAAU,CAAC,MAAc;;YAC3B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YAC/E,OAAO,QAAQ,CAAC,IAAI,CAAC;QACzB,CAAC;KAAA;CACJ,CAAA;AAxFY,UAAU;IADtB,IAAA,qBAAU,GAAE;;GACA,UAAU,CAwFtB;AAxFY,gCAAU"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { MSLiveAPI } from "./ms.live.api";
|
|
2
|
-
import { IMSTemplateData } from "./models";
|
|
3
|
-
/**
|
|
4
|
-
* MSLive Room API declarations
|
|
5
|
-
*/
|
|
6
|
-
interface IMSLiveTemplate {
|
|
7
|
-
/**
|
|
8
|
-
* Creates a new 100ms Template
|
|
9
|
-
*/
|
|
10
|
-
createTemplate(name: string, description: string, templateId: string): Promise<IMSTemplateData>;
|
|
11
|
-
/**
|
|
12
|
-
* Get 100ms Template by Id
|
|
13
|
-
*/
|
|
14
|
-
findTemplate(roomId: string): Promise<IMSTemplateData>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* MSLive Room API implementation
|
|
18
|
-
*/
|
|
19
|
-
export declare class MSLiveTemplate implements IMSLiveTemplate {
|
|
20
|
-
private _server;
|
|
21
|
-
/**
|
|
22
|
-
* MSLive room constructor
|
|
23
|
-
* @param { IMSLiveConfig } config msLive config
|
|
24
|
-
*/
|
|
25
|
-
constructor(server: MSLiveAPI);
|
|
26
|
-
/**
|
|
27
|
-
* Create a new template in MSLive
|
|
28
|
-
* @param {string} name template name
|
|
29
|
-
* @returns {Promise<IMSTemplateData>} promise of the result to get template
|
|
30
|
-
*/
|
|
31
|
-
createTemplate(name: string): Promise<IMSTemplateData>;
|
|
32
|
-
/**
|
|
33
|
-
* Get 100ms template by id
|
|
34
|
-
* @param {string} templateId 100ms template id
|
|
35
|
-
* @returns {Promise<IMSTemplateData>} promise of the result to get template
|
|
36
|
-
*/
|
|
37
|
-
findTemplate(templateId: string): Promise<IMSTemplateData>;
|
|
38
|
-
}
|
|
39
|
-
export {};
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.MSLiveTemplate = void 0;
|
|
22
|
-
const tsyringe_1 = require("tsyringe");
|
|
23
|
-
const ms_live_api_1 = require("./ms.live.api");
|
|
24
|
-
/**
|
|
25
|
-
* MSLive Room API implementation
|
|
26
|
-
*/
|
|
27
|
-
let MSLiveTemplate = class MSLiveTemplate {
|
|
28
|
-
/**
|
|
29
|
-
* MSLive room constructor
|
|
30
|
-
* @param { IMSLiveConfig } config msLive config
|
|
31
|
-
*/
|
|
32
|
-
constructor(server) {
|
|
33
|
-
this._server = server;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Create a new template in MSLive
|
|
37
|
-
* @param {string} name template name
|
|
38
|
-
* @returns {Promise<IMSTemplateData>} promise of the result to get template
|
|
39
|
-
*/
|
|
40
|
-
createTemplate(name) {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
const payload = {
|
|
43
|
-
name: name,
|
|
44
|
-
default: false,
|
|
45
|
-
roles: {
|
|
46
|
-
organizer: {
|
|
47
|
-
name: "organizer",
|
|
48
|
-
publishParams: {
|
|
49
|
-
allowed: ["audio", "video", "screen", "simulcast"],
|
|
50
|
-
audio: {
|
|
51
|
-
bitRate: 60,
|
|
52
|
-
codec: "opus"
|
|
53
|
-
},
|
|
54
|
-
video: {
|
|
55
|
-
bitRate: 400,
|
|
56
|
-
codec: "vp8",
|
|
57
|
-
frameRate: 30,
|
|
58
|
-
width: 480,
|
|
59
|
-
height: 360
|
|
60
|
-
},
|
|
61
|
-
screen: {
|
|
62
|
-
codec: "vp8",
|
|
63
|
-
frameRate: 10,
|
|
64
|
-
width: 1920,
|
|
65
|
-
height: 1080
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
subscribeParams: {
|
|
69
|
-
subscribeToRoles: ["organizer", "presenter", "attendee"],
|
|
70
|
-
maxSubsBitRate: 3200,
|
|
71
|
-
subscribeDegradation: {
|
|
72
|
-
packetLossThreshold: 25,
|
|
73
|
-
degradeGracePeriodSeconds: 1,
|
|
74
|
-
recoverGracePeriodSeconds: 4
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
permissions: {
|
|
78
|
-
sendRoomState: true,
|
|
79
|
-
endRoom: false,
|
|
80
|
-
removeOthers: false,
|
|
81
|
-
mute: false,
|
|
82
|
-
unmute: false,
|
|
83
|
-
changeRole: false,
|
|
84
|
-
browserRecording: false,
|
|
85
|
-
rtmpStreaming: false,
|
|
86
|
-
hlsStreaming: false,
|
|
87
|
-
},
|
|
88
|
-
priority: 1,
|
|
89
|
-
maxPeerCount: 0
|
|
90
|
-
},
|
|
91
|
-
presenter: {
|
|
92
|
-
name: "organizer",
|
|
93
|
-
publishParams: {
|
|
94
|
-
allowed: ["audio", "video", "screen", "simulcast"],
|
|
95
|
-
audio: {
|
|
96
|
-
bitRate: 32,
|
|
97
|
-
codec: "opus"
|
|
98
|
-
},
|
|
99
|
-
video: {
|
|
100
|
-
bitRate: 300,
|
|
101
|
-
codec: "vp8",
|
|
102
|
-
frameRate: 30,
|
|
103
|
-
width: 480,
|
|
104
|
-
height: 360
|
|
105
|
-
},
|
|
106
|
-
screen: {
|
|
107
|
-
codec: "vp8",
|
|
108
|
-
frameRate: 10,
|
|
109
|
-
width: 1920,
|
|
110
|
-
height: 1080
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
subscribeParams: {
|
|
114
|
-
subscribeToRoles: ["organizer", "presenter", "attendee"],
|
|
115
|
-
maxSubsBitRate: 3200,
|
|
116
|
-
subscribeDegradation: {
|
|
117
|
-
packetLossThreshold: 25,
|
|
118
|
-
degradeGracePeriodSeconds: 1,
|
|
119
|
-
recoverGracePeriodSeconds: 4
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
permissions: {
|
|
123
|
-
sendRoomState: true,
|
|
124
|
-
endRoom: true,
|
|
125
|
-
removeOthers: true,
|
|
126
|
-
mute: true,
|
|
127
|
-
unmute: true,
|
|
128
|
-
changeRole: true,
|
|
129
|
-
browserRecording: true,
|
|
130
|
-
rtmpStreaming: true,
|
|
131
|
-
hlsStreaming: true,
|
|
132
|
-
},
|
|
133
|
-
priority: 1,
|
|
134
|
-
maxPeerCount: 0
|
|
135
|
-
},
|
|
136
|
-
attendee: {
|
|
137
|
-
name: "organizer",
|
|
138
|
-
publishParams: {
|
|
139
|
-
allowed: ["audio", "video", "screen", "simulcast"],
|
|
140
|
-
audio: {
|
|
141
|
-
bitRate: 32,
|
|
142
|
-
codec: "opus"
|
|
143
|
-
},
|
|
144
|
-
video: {
|
|
145
|
-
bitRate: 300,
|
|
146
|
-
codec: "vp8",
|
|
147
|
-
frameRate: 30,
|
|
148
|
-
width: 480,
|
|
149
|
-
height: 360
|
|
150
|
-
},
|
|
151
|
-
screen: {
|
|
152
|
-
codec: "vp8",
|
|
153
|
-
frameRate: 10,
|
|
154
|
-
width: 1920,
|
|
155
|
-
height: 1080
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
subscribeParams: {
|
|
159
|
-
subscribeToRoles: ["organizer", "presenter", "attendee"],
|
|
160
|
-
maxSubsBitRate: 3200,
|
|
161
|
-
subscribeDegradation: {
|
|
162
|
-
packetLossThreshold: 25,
|
|
163
|
-
degradeGracePeriodSeconds: 1,
|
|
164
|
-
recoverGracePeriodSeconds: 4
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
permissions: {
|
|
168
|
-
sendRoomState: false,
|
|
169
|
-
endRoom: true,
|
|
170
|
-
removeOthers: true,
|
|
171
|
-
mute: true,
|
|
172
|
-
unmute: true,
|
|
173
|
-
changeRole: true,
|
|
174
|
-
browserRecording: true,
|
|
175
|
-
rtmpStreaming: true,
|
|
176
|
-
hlsStreaming: true,
|
|
177
|
-
},
|
|
178
|
-
priority: 5,
|
|
179
|
-
maxPeerCount: 0
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
settings: {
|
|
183
|
-
region: "us",
|
|
184
|
-
roomState: {
|
|
185
|
-
messageInterval: 5,
|
|
186
|
-
sendPeerList: true,
|
|
187
|
-
enabled: true
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
};
|
|
191
|
-
return yield this._server.post("/templates", payload);
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Get 100ms template by id
|
|
196
|
-
* @param {string} templateId 100ms template id
|
|
197
|
-
* @returns {Promise<IMSTemplateData>} promise of the result to get template
|
|
198
|
-
*/
|
|
199
|
-
findTemplate(templateId) {
|
|
200
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
201
|
-
return yield this._server.get(`/templates`, templateId);
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
MSLiveTemplate = __decorate([
|
|
206
|
-
(0, tsyringe_1.injectable)(),
|
|
207
|
-
__metadata("design:paramtypes", [ms_live_api_1.MSLiveAPI])
|
|
208
|
-
], MSLiveTemplate);
|
|
209
|
-
exports.MSLiveTemplate = MSLiveTemplate;
|
|
210
|
-
//# sourceMappingURL=ms.live.template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ms.live.template.js","sourceRoot":"","sources":["../../../session/ms.live/ms.live.template.ts"],"names":[],"mappings":";;;;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