@bwi-mentorspaces/application-utils-npm 0.0.6 → 0.0.9
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/chat/index.d.ts +36 -36
- package/chat/index.js +58 -58
- package/chat/stream/enum/index.d.ts +33 -27
- package/chat/stream/enum/index.js +41 -34
- package/chat/stream/enum/index.js.map +1 -1
- package/chat/stream/index.d.ts +9 -9
- package/chat/stream/index.js +17 -17
- package/chat/stream/models/_/channel.data.d.ts +19 -19
- package/chat/stream/models/_/channel.data.js +2 -2
- package/chat/stream/models/_/channel.member.d.ts +14 -14
- package/chat/stream/models/_/channel.member.js +11 -11
- package/chat/stream/models/_/channel.response.d.ts +8 -8
- package/chat/stream/models/_/channel.response.js +2 -2
- package/chat/stream/models/_/event.data.d.ts +16 -0
- package/chat/stream/models/_/event.data.js +4 -0
- package/chat/stream/models/_/event.data.js.map +1 -0
- package/chat/stream/models/_/message.response.d.ts +8 -8
- package/chat/stream/models/_/message.response.js +2 -2
- package/chat/stream/models/_/stream.config.d.ts +22 -22
- package/chat/stream/models/_/stream.config.js +2 -2
- package/chat/stream/models/_/user.response.d.ts +8 -8
- package/chat/stream/models/_/user.response.js +2 -2
- package/chat/stream/models/index.d.ts +9 -7
- package/chat/stream/models/index.js +5 -5
- package/chat/stream/models/index.js.map +1 -1
- package/chat/stream/stream.api.d.ts +63 -63
- package/chat/stream/stream.api.js +76 -76
- package/chat/stream/stream.auth.d.ts +70 -70
- package/chat/stream/stream.auth.js +80 -80
- package/chat/stream/stream.base.d.ts +56 -56
- package/chat/stream/stream.base.js +93 -93
- package/chat/stream/stream.channel.d.ts +132 -118
- package/chat/stream/stream.channel.js +306 -285
- package/chat/stream/stream.channel.js.map +1 -1
- package/chat/stream/stream.error.d.ts +19 -19
- package/chat/stream/stream.error.js +17 -17
- package/chat/stream/stream.member.d.ts +75 -75
- package/chat/stream/stream.member.js +175 -175
- package/chat/stream/stream.message.d.ts +59 -59
- package/chat/stream/stream.message.js +112 -112
- package/chat/stream/stream.user.d.ts +49 -49
- package/chat/stream/stream.user.js +90 -90
- package/core/_/api-error.d.ts +24 -24
- package/core/_/api-error.js +21 -21
- package/core/_/api-response.d.ts +25 -25
- package/core/_/api-response.js +21 -21
- package/core/_/cors-headers.d.ts +16 -16
- package/core/_/cors-headers.js +32 -32
- package/core/_/model.d.ts +39 -31
- package/core/_/model.js +2 -2
- package/core/_/service-request.d.ts +66 -66
- package/core/_/service-request.js +104 -104
- package/core/_/service-request.js.map +1 -1
- package/core/index.d.ts +10 -10
- package/core/index.js +11 -11
- package/coverage/coverage-final.json +4 -0
- package/deployment/_/serverless.d.ts +26 -26
- package/deployment/_/serverless.js +43 -43
- package/deployment/index.d.ts +2 -2
- package/deployment/index.js +5 -5
- package/endpoint-test-factory/_/test-factory.d.ts +45 -45
- package/endpoint-test-factory/_/test-factory.js +91 -91
- package/endpoint-test-factory/index.d.ts +2 -2
- package/endpoint-test-factory/index.js +5 -5
- package/enums/index.d.ts +92 -92
- package/enums/index.js +2 -2
- package/jest.config.d.ts +12 -0
- package/jest.config.js +16 -0
- package/jest.config.js.map +1 -0
- package/meet/index.d.ts +36 -36
- package/meet/index.js +58 -58
- package/meet/tests/unit/twilio/twilio.room.test.d.ts +1 -0
- package/meet/tests/unit/twilio/twilio.room.test.js +33 -0
- package/meet/tests/unit/twilio/twilio.room.test.js.map +1 -0
- package/meet/twilio/enum/index.d.ts +6 -6
- package/meet/twilio/enum/index.js +10 -10
- package/meet/twilio/index.d.ts +5 -5
- package/meet/twilio/index.js +11 -11
- package/meet/twilio/models/_/room.data.d.ts +6 -6
- package/meet/twilio/models/_/room.data.js +2 -2
- package/meet/twilio/models/_/twilio.config.d.ts +29 -29
- package/meet/twilio/models/_/twilio.config.js +2 -2
- package/meet/twilio/models/index.d.ts +3 -3
- package/meet/twilio/models/index.js +2 -2
- package/meet/twilio/twilio.api.d.ts +28 -28
- package/meet/twilio/twilio.api.js +45 -45
- package/meet/twilio/twilio.auth.d.ts +55 -55
- package/meet/twilio/twilio.auth.js +83 -83
- package/meet/twilio/twilio.base.d.ts +41 -41
- package/meet/twilio/twilio.base.js +53 -53
- package/meet/twilio/twilio.room.d.ts +58 -46
- package/meet/twilio/twilio.room.js +141 -124
- package/meet/twilio/twilio.room.js.map +1 -1
- package/package.json +64 -57
- package/swagger/_/swagger.config.d.ts +21 -21
- package/swagger/_/swagger.config.js +2 -2
- package/swagger/_/swagger.d.ts +37 -37
- package/swagger/_/swagger.js +78 -78
- package/swagger/index.d.ts +3 -3
- package/swagger/index.js +5 -5
- package/types/index.d.ts +19 -19
- package/types/index.js +2 -2
- package/utils/_/encoder.d.ts +19 -19
- package/utils/_/encoder.js +27 -27
- package/utils/_/encryptor.d.ts +26 -26
- package/utils/_/encryptor.js +67 -67
- package/utils/_/hasher.d.ts +25 -25
- package/utils/_/hasher.js +63 -63
- package/utils/_/object-mapper.d.ts +12 -12
- package/utils/_/object-mapper.js +22 -22
- package/utils/_/string-formatter.d.ts +34 -34
- package/utils/_/string-formatter.js +49 -49
- package/utils/_/utc-date.d.ts +35 -35
- package/utils/_/utc-date.js +84 -84
- package/utils/index.d.ts +7 -7
- package/utils/index.js +15 -15
- package/validators/_/checker.d.ts +62 -62
- package/validators/_/checker.js +98 -98
- package/validators/_/regex.d.ts +98 -98
- package/validators/_/regex.js +142 -142
- package/validators/index.d.ts +3 -3
- package/validators/index.js +7 -7
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
-
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;
|
|
18
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
-
};
|
|
20
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
-
if (mod && mod.__esModule) return mod;
|
|
22
|
-
var result = {};
|
|
23
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
-
__setModuleDefault(result, mod);
|
|
25
|
-
return result;
|
|
26
|
-
};
|
|
27
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
28
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.TwilioAuth = void 0;
|
|
32
|
-
const tsyringe_1 = require("tsyringe");
|
|
33
|
-
const AccessToken_1 = __importStar(require("twilio/lib/jwt/AccessToken"));
|
|
34
|
-
/**
|
|
35
|
-
* Meet Auth implementation
|
|
36
|
-
*/
|
|
37
|
-
let TwilioAuth = class TwilioAuth {
|
|
38
|
-
/**
|
|
39
|
-
* Twilio auth constructor
|
|
40
|
-
*
|
|
41
|
-
* @param {IMeetConfig} config meet config
|
|
42
|
-
*/
|
|
43
|
-
constructor(config) {
|
|
44
|
-
this.init(config.account.main.sid, config.account.main.api.key, config.account.main.api.secret);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Instance the twilio client
|
|
48
|
-
*
|
|
49
|
-
* @param {string} mainAccountSID main account SID
|
|
50
|
-
* @param {string} mainApiKeySID main api SID
|
|
51
|
-
* @param {string} mainApiKeySecret main apy secret
|
|
52
|
-
* @returns {void} promise of type void
|
|
53
|
-
*/
|
|
54
|
-
init(mainAccountSID, mainApiKeySID, mainApiKeySecret) {
|
|
55
|
-
this._mainAccountSID = mainAccountSID;
|
|
56
|
-
this._mainApiKeySID = mainApiKeySID;
|
|
57
|
-
this._mainApiKeySecret = mainApiKeySecret;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Get token
|
|
61
|
-
*
|
|
62
|
-
* @param {string} userId user id
|
|
63
|
-
* @param {string} roomName room name
|
|
64
|
-
* @returns {string} returns token value
|
|
65
|
-
*/
|
|
66
|
-
token(userId, roomName) {
|
|
67
|
-
//Instance the AccessToken token
|
|
68
|
-
const token = new AccessToken_1.default(this._mainAccountSID, this._mainApiKeySID, this._mainApiKeySecret);
|
|
69
|
-
// Assign identity to the token
|
|
70
|
-
token.identity = userId;
|
|
71
|
-
// Grant the access token Twilio Video capabilities
|
|
72
|
-
const grant = new AccessToken_1.VideoGrant();
|
|
73
|
-
grant.room = roomName;
|
|
74
|
-
token.addGrant(grant);
|
|
75
|
-
// Serialize the token to a JWT string
|
|
76
|
-
return token.toJwt();
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
TwilioAuth = __decorate([
|
|
80
|
-
(0, tsyringe_1.injectable)(),
|
|
81
|
-
__metadata("design:paramtypes", [Object])
|
|
82
|
-
], TwilioAuth);
|
|
83
|
-
exports.TwilioAuth = TwilioAuth;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
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;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
};
|
|
20
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
+
if (mod && mod.__esModule) return mod;
|
|
22
|
+
var result = {};
|
|
23
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
+
__setModuleDefault(result, mod);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
28
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.TwilioAuth = void 0;
|
|
32
|
+
const tsyringe_1 = require("tsyringe");
|
|
33
|
+
const AccessToken_1 = __importStar(require("twilio/lib/jwt/AccessToken"));
|
|
34
|
+
/**
|
|
35
|
+
* Meet Auth implementation
|
|
36
|
+
*/
|
|
37
|
+
let TwilioAuth = class TwilioAuth {
|
|
38
|
+
/**
|
|
39
|
+
* Twilio auth constructor
|
|
40
|
+
*
|
|
41
|
+
* @param {IMeetConfig} config meet config
|
|
42
|
+
*/
|
|
43
|
+
constructor(config) {
|
|
44
|
+
this.init(config.account.main.sid, config.account.main.api.key, config.account.main.api.secret);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Instance the twilio client
|
|
48
|
+
*
|
|
49
|
+
* @param {string} mainAccountSID main account SID
|
|
50
|
+
* @param {string} mainApiKeySID main api SID
|
|
51
|
+
* @param {string} mainApiKeySecret main apy secret
|
|
52
|
+
* @returns {void} promise of type void
|
|
53
|
+
*/
|
|
54
|
+
init(mainAccountSID, mainApiKeySID, mainApiKeySecret) {
|
|
55
|
+
this._mainAccountSID = mainAccountSID;
|
|
56
|
+
this._mainApiKeySID = mainApiKeySID;
|
|
57
|
+
this._mainApiKeySecret = mainApiKeySecret;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get token
|
|
61
|
+
*
|
|
62
|
+
* @param {string} userId user id
|
|
63
|
+
* @param {string} roomName room name
|
|
64
|
+
* @returns {string} returns token value
|
|
65
|
+
*/
|
|
66
|
+
token(userId, roomName) {
|
|
67
|
+
//Instance the AccessToken token
|
|
68
|
+
const token = new AccessToken_1.default(this._mainAccountSID, this._mainApiKeySID, this._mainApiKeySecret);
|
|
69
|
+
// Assign identity to the token
|
|
70
|
+
token.identity = userId;
|
|
71
|
+
// Grant the access token Twilio Video capabilities
|
|
72
|
+
const grant = new AccessToken_1.VideoGrant();
|
|
73
|
+
grant.room = roomName;
|
|
74
|
+
token.addGrant(grant);
|
|
75
|
+
// Serialize the token to a JWT string
|
|
76
|
+
return token.toJwt();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
TwilioAuth = __decorate([
|
|
80
|
+
(0, tsyringe_1.injectable)(),
|
|
81
|
+
__metadata("design:paramtypes", [Object])
|
|
82
|
+
], TwilioAuth);
|
|
83
|
+
exports.TwilioAuth = TwilioAuth;
|
|
84
84
|
//# sourceMappingURL=twilio.auth.js.map
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { TwilioAuth } from "./twilio.auth";
|
|
2
|
-
import { Twilio } from "twilio";
|
|
3
|
-
/**
|
|
4
|
-
* Base client class
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class TwilioBase {
|
|
7
|
-
private _server;
|
|
8
|
-
private _auth;
|
|
9
|
-
/**
|
|
10
|
-
* getter for twilio instance
|
|
11
|
-
*
|
|
12
|
-
* @returns {Twilio} twilio instance
|
|
13
|
-
*/
|
|
14
|
-
get server(): Twilio;
|
|
15
|
-
/**
|
|
16
|
-
* setter for twilio instance
|
|
17
|
-
*
|
|
18
|
-
* @param {TwilioAuth} value twilio instance
|
|
19
|
-
*/
|
|
20
|
-
set server(value: Twilio);
|
|
21
|
-
/**
|
|
22
|
-
* getter for twilio auth
|
|
23
|
-
*
|
|
24
|
-
* @returns {TwilioAuth} twilio auth instance
|
|
25
|
-
*/
|
|
26
|
-
get auth(): TwilioAuth;
|
|
27
|
-
/**
|
|
28
|
-
* setter for twilio auth instance
|
|
29
|
-
*
|
|
30
|
-
* @param {TwilioAuth} value twilio auth instance
|
|
31
|
-
*/
|
|
32
|
-
set auth(value: TwilioAuth);
|
|
33
|
-
/**
|
|
34
|
-
* Get token for extended classes
|
|
35
|
-
*
|
|
36
|
-
* @param {string} userId user id
|
|
37
|
-
* @param {string} roomName room name
|
|
38
|
-
* @returns {string} returns the token value
|
|
39
|
-
*/
|
|
40
|
-
getToken(userId: string, roomName: string): string;
|
|
41
|
-
}
|
|
1
|
+
import { TwilioAuth } from "./twilio.auth";
|
|
2
|
+
import { Twilio } from "twilio";
|
|
3
|
+
/**
|
|
4
|
+
* Base client class
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class TwilioBase {
|
|
7
|
+
private _server;
|
|
8
|
+
private _auth;
|
|
9
|
+
/**
|
|
10
|
+
* getter for twilio instance
|
|
11
|
+
*
|
|
12
|
+
* @returns {Twilio} twilio instance
|
|
13
|
+
*/
|
|
14
|
+
get server(): Twilio;
|
|
15
|
+
/**
|
|
16
|
+
* setter for twilio instance
|
|
17
|
+
*
|
|
18
|
+
* @param {TwilioAuth} value twilio instance
|
|
19
|
+
*/
|
|
20
|
+
set server(value: Twilio);
|
|
21
|
+
/**
|
|
22
|
+
* getter for twilio auth
|
|
23
|
+
*
|
|
24
|
+
* @returns {TwilioAuth} twilio auth instance
|
|
25
|
+
*/
|
|
26
|
+
get auth(): TwilioAuth;
|
|
27
|
+
/**
|
|
28
|
+
* setter for twilio auth instance
|
|
29
|
+
*
|
|
30
|
+
* @param {TwilioAuth} value twilio auth instance
|
|
31
|
+
*/
|
|
32
|
+
set auth(value: TwilioAuth);
|
|
33
|
+
/**
|
|
34
|
+
* Get token for extended classes
|
|
35
|
+
*
|
|
36
|
+
* @param {string} userId user id
|
|
37
|
+
* @param {string} roomName room name
|
|
38
|
+
* @returns {string} returns the token value
|
|
39
|
+
*/
|
|
40
|
+
getToken(userId: string, roomName: string): string;
|
|
41
|
+
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TwilioBase = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Base client class
|
|
6
|
-
*/
|
|
7
|
-
class TwilioBase {
|
|
8
|
-
// getter / setter
|
|
9
|
-
/**
|
|
10
|
-
* getter for twilio instance
|
|
11
|
-
*
|
|
12
|
-
* @returns {Twilio} twilio instance
|
|
13
|
-
*/
|
|
14
|
-
get server() {
|
|
15
|
-
return this._server;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* setter for twilio instance
|
|
19
|
-
*
|
|
20
|
-
* @param {TwilioAuth} value twilio instance
|
|
21
|
-
*/
|
|
22
|
-
set server(value) {
|
|
23
|
-
this._server = value;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* getter for twilio auth
|
|
27
|
-
*
|
|
28
|
-
* @returns {TwilioAuth} twilio auth instance
|
|
29
|
-
*/
|
|
30
|
-
get auth() {
|
|
31
|
-
return this._auth;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* setter for twilio auth instance
|
|
35
|
-
*
|
|
36
|
-
* @param {TwilioAuth} value twilio auth instance
|
|
37
|
-
*/
|
|
38
|
-
set auth(value) {
|
|
39
|
-
this._auth = value;
|
|
40
|
-
}
|
|
41
|
-
// methods
|
|
42
|
-
/**
|
|
43
|
-
* Get token for extended classes
|
|
44
|
-
*
|
|
45
|
-
* @param {string} userId user id
|
|
46
|
-
* @param {string} roomName room name
|
|
47
|
-
* @returns {string} returns the token value
|
|
48
|
-
*/
|
|
49
|
-
getToken(userId, roomName) {
|
|
50
|
-
return this.auth.token(userId, roomName);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.TwilioBase = TwilioBase;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TwilioBase = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Base client class
|
|
6
|
+
*/
|
|
7
|
+
class TwilioBase {
|
|
8
|
+
// getter / setter
|
|
9
|
+
/**
|
|
10
|
+
* getter for twilio instance
|
|
11
|
+
*
|
|
12
|
+
* @returns {Twilio} twilio instance
|
|
13
|
+
*/
|
|
14
|
+
get server() {
|
|
15
|
+
return this._server;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* setter for twilio instance
|
|
19
|
+
*
|
|
20
|
+
* @param {TwilioAuth} value twilio instance
|
|
21
|
+
*/
|
|
22
|
+
set server(value) {
|
|
23
|
+
this._server = value;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* getter for twilio auth
|
|
27
|
+
*
|
|
28
|
+
* @returns {TwilioAuth} twilio auth instance
|
|
29
|
+
*/
|
|
30
|
+
get auth() {
|
|
31
|
+
return this._auth;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* setter for twilio auth instance
|
|
35
|
+
*
|
|
36
|
+
* @param {TwilioAuth} value twilio auth instance
|
|
37
|
+
*/
|
|
38
|
+
set auth(value) {
|
|
39
|
+
this._auth = value;
|
|
40
|
+
}
|
|
41
|
+
// methods
|
|
42
|
+
/**
|
|
43
|
+
* Get token for extended classes
|
|
44
|
+
*
|
|
45
|
+
* @param {string} userId user id
|
|
46
|
+
* @param {string} roomName room name
|
|
47
|
+
* @returns {string} returns the token value
|
|
48
|
+
*/
|
|
49
|
+
getToken(userId, roomName) {
|
|
50
|
+
return this.auth.token(userId, roomName);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.TwilioBase = TwilioBase;
|
|
54
54
|
//# sourceMappingURL=twilio.base.js.map
|
|
@@ -1,46 +1,58 @@
|
|
|
1
|
-
import { TwilioAuth } from "./twilio.auth";
|
|
2
|
-
import { Twilio } from "twilio";
|
|
3
|
-
import { TwilioBase } from "./twilio.base";
|
|
4
|
-
import { IRoomData } from "./models";
|
|
5
|
-
/**
|
|
6
|
-
* Twilio Room API declarations
|
|
7
|
-
*/
|
|
8
|
-
interface ITwilioRoom {
|
|
9
|
-
/**
|
|
10
|
-
* Create a new room in Twilio
|
|
11
|
-
*/
|
|
12
|
-
findOrCreateRoom(roomName: string): Promise<IRoomData>;
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+
import { TwilioAuth } from "./twilio.auth";
|
|
2
|
+
import { Twilio } from "twilio";
|
|
3
|
+
import { TwilioBase } from "./twilio.base";
|
|
4
|
+
import { IRoomData } from "./models";
|
|
5
|
+
/**
|
|
6
|
+
* Twilio Room API declarations
|
|
7
|
+
*/
|
|
8
|
+
interface ITwilioRoom {
|
|
9
|
+
/**
|
|
10
|
+
* Create a new room in Twilio
|
|
11
|
+
*/
|
|
12
|
+
findOrCreateRoom(roomName: string, roomType: string): Promise<IRoomData>;
|
|
13
|
+
/**
|
|
14
|
+
* Determines whether or not a room type is one we support.
|
|
15
|
+
*/
|
|
16
|
+
validateRoomType(roomType: string): Promise<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* Find an existing room un Twilio
|
|
19
|
+
*/
|
|
20
|
+
findRoom(roomName: string): Promise<IRoomData>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Twilio Room API implementation
|
|
24
|
+
*/
|
|
25
|
+
export declare class TwilioRoom extends TwilioBase implements ITwilioRoom {
|
|
26
|
+
private _expMinutes;
|
|
27
|
+
/**
|
|
28
|
+
* Twilio room constructor
|
|
29
|
+
*
|
|
30
|
+
* @param {TwilioAuth} auth Twilio auth
|
|
31
|
+
* @param {Twilio} server Twilio API Server
|
|
32
|
+
* @param {number} expMins expiration time for the timeout room, in minutes.
|
|
33
|
+
*/
|
|
34
|
+
constructor(auth: TwilioAuth, server: Twilio, expMins: number);
|
|
35
|
+
/**
|
|
36
|
+
* This will find or Create a new room in Twilio
|
|
37
|
+
*
|
|
38
|
+
* @param {string} roomName room name
|
|
39
|
+
* @param {string} roomTypeStr room type to create in Twilio ("group" | "peer-to-peer" | "go")
|
|
40
|
+
* @returns {Promise<IRoomData>} promise of the result to create or get a room
|
|
41
|
+
*/
|
|
42
|
+
findOrCreateRoom(roomName: string, roomTypeStr?: string): Promise<IRoomData>;
|
|
43
|
+
/**
|
|
44
|
+
* Convenience method to determine if a roomType is valid
|
|
45
|
+
*
|
|
46
|
+
* @param {string} roomType The room type to validate.
|
|
47
|
+
* @returns {Promise<boolean>} true if a valid roomType, false otherwise
|
|
48
|
+
*/
|
|
49
|
+
validateRoomType(roomType: string): Promise<boolean>;
|
|
50
|
+
/**
|
|
51
|
+
* Find an existing room un Twilio
|
|
52
|
+
*
|
|
53
|
+
* @param {string} roomName room name
|
|
54
|
+
* @returns {Promise<IRoomData>} promise of the result to get a room
|
|
55
|
+
*/
|
|
56
|
+
findRoom(roomName: string): Promise<IRoomData>;
|
|
57
|
+
}
|
|
58
|
+
export {};
|