@bwi-mentorspaces/application-utils-npm 0.0.137 → 0.0.139

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.
Files changed (50) hide show
  1. package/chat/stream/enum/index.d.ts +2 -0
  2. package/chat/stream/enum/index.js +2 -0
  3. package/chat/stream/enum/index.js.map +1 -1
  4. package/chat/stream/models/_/event.data.d.ts +11 -0
  5. package/package.json +3 -1
  6. package/program-engagement/index.d.ts +3 -0
  7. package/program-engagement/index.js +16 -0
  8. package/program-engagement/index.js.map +1 -0
  9. package/program-engagement/model.d.ts +93 -0
  10. package/program-engagement/model.js +6 -0
  11. package/program-engagement/model.js.map +1 -0
  12. package/program-engagement/period.d.ts +50 -0
  13. package/program-engagement/period.js +193 -0
  14. package/program-engagement/period.js.map +1 -0
  15. package/program-engagement/query.d.ts +11 -0
  16. package/program-engagement/query.js +129 -0
  17. package/program-engagement/query.js.map +1 -0
  18. package/meet/index.d.ts +0 -36
  19. package/meet/index.js +0 -74
  20. package/meet/index.js.map +0 -1
  21. package/meet/tests/unit/twilio/twilio.room.test.d.ts +0 -1
  22. package/meet/tests/unit/twilio/twilio.room.test.js +0 -33
  23. package/meet/tests/unit/twilio/twilio.room.test.js.map +0 -1
  24. package/meet/twilio/enum/index.d.ts +0 -6
  25. package/meet/twilio/enum/index.js +0 -11
  26. package/meet/twilio/enum/index.js.map +0 -1
  27. package/meet/twilio/index.d.ts +0 -5
  28. package/meet/twilio/index.js +0 -32
  29. package/meet/twilio/index.js.map +0 -1
  30. package/meet/twilio/models/_/room.data.d.ts +0 -6
  31. package/meet/twilio/models/_/room.data.js +0 -3
  32. package/meet/twilio/models/_/room.data.js.map +0 -1
  33. package/meet/twilio/models/_/twilio.config.d.ts +0 -29
  34. package/meet/twilio/models/_/twilio.config.js +0 -3
  35. package/meet/twilio/models/_/twilio.config.js.map +0 -1
  36. package/meet/twilio/models/index.d.ts +0 -3
  37. package/meet/twilio/models/index.js +0 -3
  38. package/meet/twilio/models/index.js.map +0 -1
  39. package/meet/twilio/twilio.api.d.ts +0 -28
  40. package/meet/twilio/twilio.api.js +0 -46
  41. package/meet/twilio/twilio.api.js.map +0 -1
  42. package/meet/twilio/twilio.auth.d.ts +0 -55
  43. package/meet/twilio/twilio.auth.js +0 -116
  44. package/meet/twilio/twilio.auth.js.map +0 -1
  45. package/meet/twilio/twilio.base.d.ts +0 -41
  46. package/meet/twilio/twilio.base.js +0 -54
  47. package/meet/twilio/twilio.base.js.map +0 -1
  48. package/meet/twilio/twilio.room.d.ts +0 -58
  49. package/meet/twilio/twilio.room.js +0 -173
  50. package/meet/twilio/twilio.room.js.map +0 -1
package/meet/index.js DELETED
@@ -1,74 +0,0 @@
1
- "use strict";
2
- var __decorate =
3
- (this && this.__decorate) ||
4
- function (decorators, target, key, desc) {
5
- var c = arguments.length,
6
- r = c < 3 ? target : desc === null ? (desc = Object.getOwnPropertyDescriptor(target, key)) : desc,
7
- d;
8
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
9
- r = Reflect.decorate(decorators, target, key, desc);
10
- else
11
- for (var i = decorators.length - 1; i >= 0; i--)
12
- if ((d = decorators[i])) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
13
- return c > 3 && r && Object.defineProperty(target, key, r), r;
14
- };
15
- var __metadata =
16
- (this && this.__metadata) ||
17
- function (k, v) {
18
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
19
- };
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.Meet = void 0;
22
- const tsyringe_1 = require("tsyringe");
23
- const enum_1 = require("./twilio/enum");
24
- const twilio_api_1 = require("./twilio/twilio.api");
25
- /**
26
- * Meet implementation
27
- */
28
- let Meet =
29
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
30
- class Meet {
31
- /**
32
- * Meet constructor
33
- *
34
- * @param {ClientType} clientType client type
35
- * @param {IMeetConfig} config meet configuration
36
- */
37
- constructor(clientType, config) {
38
- this._clientType = clientType;
39
- this._config = config;
40
- this.init();
41
- }
42
- // getter / setter
43
- /**
44
- * getter for client
45
- *
46
- * @returns {T} client of type T
47
- */
48
- get client() {
49
- return this._client;
50
- }
51
- // methods
52
- /**
53
- * initialize method
54
- *
55
- * @returns {void} promise of type void
56
- */
57
- init() {
58
- // change to switch when adding new client types
59
- //Create a new Stream Client
60
- if (this._clientType == enum_1.ClientType.Twilio) {
61
- this._client = new twilio_api_1.TwilioApi(this._config);
62
- }
63
- }
64
- };
65
- Meet = __decorate(
66
- [
67
- (0, tsyringe_1.injectable)(),
68
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
69
- __metadata("design:paramtypes", [String, Object])
70
- ],
71
- Meet
72
- );
73
- exports.Meet = Meet;
74
- //# sourceMappingURL=index.js.map
package/meet/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../meet/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAsC;AACtC,wCAA2C;AAE3C,oDAAgD;AAUhD;;GAEG;AAGH,IAAa,IAAI;AADjB,6DAA6D;AAC7D,MAAa,IAAI;IAMb;;;;;OAKG;IACH,YAAY,UAAsB,EAAE,MAAmB;QACnD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,kBAAkB;IAClB;;;;OAIG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,UAAU;IACV;;;;OAIG;IACK,IAAI;QACR,gDAAgD;QAChD,4BAA4B;QAC5B,IAAI,IAAI,CAAC,WAAW,IAAI,iBAAU,CAAC,MAAM,EAAE;YACvC,IAAI,CAAC,OAAO,GAAG,IAAI,sBAAS,CAAC,IAAI,CAAC,OAAO,CAAiB,CAAC;SAC9D;IACL,CAAC;CACJ,CAAA;AAzCY,IAAI;IAFhB,IAAA,qBAAU,GAAE;IACb,6DAA6D;;;GAChD,IAAI,CAyChB;AAzCY,oBAAI"}
@@ -1 +0,0 @@
1
- import "reflect-metadata";
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- require("reflect-metadata");
4
- const globals_1 = require("@jest/globals");
5
- const twilio_auth_1 = require("../../../twilio/twilio.auth");
6
- const twilio_room_1 = require("../../../twilio/twilio.room");
7
- const twilio_1 = require("twilio");
8
- globals_1.jest.mock("twilio");
9
- globals_1.jest.mock("../../../twilio/twilio.auth");
10
- (0, globals_1.describe)("Twilio Room", () => {
11
- const mockedTwilioAuth = globals_1.jest.mocked(twilio_auth_1.TwilioAuth);
12
- const mockedTwilio = globals_1.jest.mocked(twilio_1.Twilio);
13
- const room = new twilio_room_1.TwilioRoom(mockedTwilioAuth.prototype, mockedTwilio.prototype, 0);
14
- (0, globals_1.describe)("#validateRoomType", function () {
15
- (0, globals_1.it)("should return true when a valid room type is given", function () {
16
- room.validateRoomType("peer-to-peer").then((result) => {
17
- (0, globals_1.expect)(result).toBeTruthy();
18
- });
19
- room.validateRoomType("go").then((result) => {
20
- (0, globals_1.expect)(result).toBeTruthy();
21
- });
22
- room.validateRoomType("group").then((result) => {
23
- (0, globals_1.expect)(result).toBeTruthy();
24
- });
25
- });
26
- (0, globals_1.it)("should return false when an invalid room type is given", function () {
27
- room.validateRoomType("room-type-that-does-not-exist").then((result) => {
28
- (0, globals_1.expect)(result).toBeFalsy();
29
- });
30
- });
31
- });
32
- });
33
- //# sourceMappingURL=twilio.room.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"twilio.room.test.js","sourceRoot":"","sources":["../../../../../meet/tests/unit/twilio/twilio.room.test.ts"],"names":[],"mappings":";;AAAA,4BAA0B;AAC1B,2CAA2D;AAC3D,6DAAyD;AACzD,6DAAyD;AACzD,mCAAgC;AAEhC,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACpB,cAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;AAEzC,IAAA,kBAAQ,EAAC,aAAa,EAAE,GAAG,EAAE;IACzB,MAAM,gBAAgB,GAAG,cAAI,CAAC,MAAM,CAAC,wBAAU,CAAC,CAAC;IACjD,MAAM,YAAY,GAAG,cAAI,CAAC,MAAM,CAAC,eAAM,CAAC,CAAC;IAEzC,MAAM,IAAI,GAAG,IAAI,wBAAU,CAAC,gBAAgB,CAAC,SAAS,EAAE,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAEnF,IAAA,kBAAQ,EAAC,mBAAmB,EAAE;QAC1B,IAAA,YAAE,EAAC,oDAAoD,EAAE;YACrD,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,MAAe,EAAE,EAAE;gBAC3D,IAAA,gBAAM,EAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,MAAe,EAAE,EAAE;gBACjD,IAAA,gBAAM,EAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAe,EAAE,EAAE;gBACpD,IAAA,gBAAM,EAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,IAAA,YAAE,EAAC,wDAAwD,EAAE;YACzD,IAAI,CAAC,gBAAgB,CAAC,+BAA+B,CAAC,CAAC,IAAI,CAAC,CAAC,MAAe,EAAE,EAAE;gBAC5E,IAAA,gBAAM,EAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAC/B,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Client Type enum
3
- */
4
- export declare enum ClientType {
5
- Twilio = "twilio"
6
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ClientType = void 0;
4
- /**
5
- * Client Type enum
6
- */
7
- var ClientType;
8
- (function (ClientType) {
9
- ClientType["Twilio"] = "twilio";
10
- })((ClientType = exports.ClientType || (exports.ClientType = {})));
11
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../meet/twilio/enum/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,UAEX;AAFD,WAAY,UAAU;IAClB,+BAAiB,CAAA;AACrB,CAAC,EAFW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAErB"}
@@ -1,5 +0,0 @@
1
- import { TwilioAuth } from "./twilio.auth";
2
- import { TwilioApi } from "./twilio.api";
3
- import { TwilioBase } from "./twilio.base";
4
- import { TwilioRoom } from "./twilio.room";
5
- export { TwilioApi, TwilioAuth, TwilioBase, TwilioRoom };
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TwilioRoom = exports.TwilioBase = exports.TwilioAuth = exports.TwilioApi = void 0;
4
- const twilio_auth_1 = require("./twilio.auth");
5
- Object.defineProperty(exports, "TwilioAuth", {
6
- enumerable: true,
7
- get: function () {
8
- return twilio_auth_1.TwilioAuth;
9
- }
10
- });
11
- const twilio_api_1 = require("./twilio.api");
12
- Object.defineProperty(exports, "TwilioApi", {
13
- enumerable: true,
14
- get: function () {
15
- return twilio_api_1.TwilioApi;
16
- }
17
- });
18
- const twilio_base_1 = require("./twilio.base");
19
- Object.defineProperty(exports, "TwilioBase", {
20
- enumerable: true,
21
- get: function () {
22
- return twilio_base_1.TwilioBase;
23
- }
24
- });
25
- const twilio_room_1 = require("./twilio.room");
26
- Object.defineProperty(exports, "TwilioRoom", {
27
- enumerable: true,
28
- get: function () {
29
- return twilio_room_1.TwilioRoom;
30
- }
31
- });
32
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../meet/twilio/index.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAKvB,2FALX,wBAAU,OAKW;AAJ9B,6CAAyC;AAIhC,0FAJA,sBAAS,OAIA;AAHlB,+CAA2C;AAGX,2FAHvB,wBAAU,OAGuB;AAF1C,+CAA2C;AAEC,2FAFnC,wBAAU,OAEmC"}
@@ -1,6 +0,0 @@
1
- /** Twilio Room data*/
2
- export interface IRoomData {
3
- sid: string;
4
- exist: boolean;
5
- status: string;
6
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=room.data.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"room.data.js","sourceRoot":"","sources":["../../../../../meet/twilio/models/_/room.data.ts"],"names":[],"mappings":""}
@@ -1,29 +0,0 @@
1
- /**
2
- * Twilio Configuration declaration
3
- */
4
- export interface IMeetConfig {
5
- account: {
6
- main: {
7
- sid: string;
8
- api: {
9
- key: string;
10
- secret: string;
11
- };
12
- };
13
- sub: {
14
- sid: string;
15
- api: {
16
- secret: string;
17
- };
18
- };
19
- };
20
- options: ITwilioConfig;
21
- }
22
- /**
23
- * Twilio config / type = option
24
- */
25
- export interface ITwilioConfig {
26
- room: {
27
- expiration: number;
28
- };
29
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=twilio.config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"twilio.config.js","sourceRoot":"","sources":["../../../../../meet/twilio/models/_/twilio.config.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import { IRoomData } from "./_/room.data";
2
- import { IMeetConfig, ITwilioConfig } from "./_/twilio.config";
3
- export { IMeetConfig, ITwilioConfig, IRoomData };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../meet/twilio/models/index.ts"],"names":[],"mappings":""}
@@ -1,28 +0,0 @@
1
- import { IMeetConfig } from "./models/_/twilio.config";
2
- import { TwilioBase } from "./twilio.base";
3
- import { TwilioRoom } from "./twilio.room";
4
- /**
5
- * Twilio implementation
6
- */
7
- export declare class TwilioApi extends TwilioBase {
8
- private _config;
9
- private _twilioRoom;
10
- /**
11
- * Twilio api constructor
12
- *
13
- * @param {IApiConfig} config api configuration
14
- */
15
- constructor(config: IMeetConfig);
16
- /**
17
- * getter for Twilio API Room
18
- *
19
- * @returns {TwilioRoom} twilio room instance
20
- */
21
- get twilioRoom(): TwilioRoom;
22
- /**
23
- * initialize method
24
- *
25
- * @returns {void} promise of type void
26
- */
27
- private init;
28
- }
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TwilioApi = void 0;
4
- const twilio_auth_1 = require("./twilio.auth");
5
- const twilio_base_1 = require("./twilio.base");
6
- const twilio_1 = require("twilio");
7
- const twilio_room_1 = require("./twilio.room");
8
- /**
9
- * Twilio implementation
10
- */
11
- class TwilioApi extends twilio_base_1.TwilioBase {
12
- /**
13
- * Twilio api constructor
14
- *
15
- * @param {IApiConfig} config api configuration
16
- */
17
- constructor(config) {
18
- super();
19
- this._config = config;
20
- this.init();
21
- }
22
- /**
23
- * getter for Twilio API Room
24
- *
25
- * @returns {TwilioRoom} twilio room instance
26
- */
27
- get twilioRoom() {
28
- return this._twilioRoom;
29
- }
30
- //methods
31
- /**
32
- * initialize method
33
- *
34
- * @returns {void} promise of type void
35
- */
36
- init() {
37
- // instance the client
38
- super.server = new twilio_1.Twilio(this._config.account.sub.sid, this._config.account.sub.api.secret);
39
- super.auth = new twilio_auth_1.TwilioAuth(this._config);
40
- // create instances of all sub-api classes
41
- this._twilioRoom = new twilio_room_1.TwilioRoom(super.auth, super.server, this._config.options.room.expiration);
42
- }
43
- }
44
- exports.TwilioApi = TwilioApi;
45
- module.exports = { TwilioApi };
46
- //# sourceMappingURL=twilio.api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"twilio.api.js","sourceRoot":"","sources":["../../../meet/twilio/twilio.api.ts"],"names":[],"mappings":";;;AACA,+CAA2C;AAC3C,+CAA2C;AAE3C,mCAAgC;AAChC,+CAA2C;AAE3C;;GAEG;AACH,MAAa,SAAU,SAAQ,wBAAU;IAKrC;;;;OAIG;IACH,YAAY,MAAmB;QAC3B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACH,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,SAAS;IAET;;;;OAIG;IACK,IAAI;QACR,sBAAsB;QACtB,KAAK,CAAC,MAAM,GAAG,IAAI,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC7F,KAAK,CAAC,IAAI,GAAG,IAAI,wBAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE1C,0CAA0C;QAC1C,IAAI,CAAC,WAAW,GAAG,IAAI,wBAAU,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACtG,CAAC;CACJ;AAxCD,8BAwCC;AAED,MAAM,CAAC,OAAO,GAAG,EAAE,SAAS,EAAE,CAAC"}
@@ -1,55 +0,0 @@
1
- import { IMeetConfig } from "./models";
2
- /**
3
- * Twilio Auth middleware
4
- */
5
- interface ITwilioAuth {
6
- /**
7
- * Authentication initialization
8
- *
9
- * @param {string} apiSID api sid
10
- * @param {string} apiKey api key
11
- * @param {string} apiSecret apy secret
12
- */
13
- init(apiSID: string, apiKey: string, apiSecret: string): void;
14
- /**
15
- * Get token to connect with Twilio
16
- *
17
- * @param {string} userId user id
18
- * @param {string} roomSID room sid
19
- * @param {boolean} refresh refresh token
20
- * @returns {string} stream token string
21
- */
22
- token(userId: string, roomSID: string, refresh?: boolean): string;
23
- }
24
- /**
25
- * Meet Auth implementation
26
- */
27
- export declare class TwilioAuth implements ITwilioAuth {
28
- private _mainAccountSID;
29
- private _mainApiKeySID;
30
- private _mainApiKeySecret;
31
- /**
32
- * Twilio auth constructor
33
- *
34
- * @param {IMeetConfig} config meet config
35
- */
36
- constructor(config: IMeetConfig);
37
- /**
38
- * Instance the twilio client
39
- *
40
- * @param {string} mainAccountSID main account SID
41
- * @param {string} mainApiKeySID main api SID
42
- * @param {string} mainApiKeySecret main apy secret
43
- * @returns {void} promise of type void
44
- */
45
- init(mainAccountSID: string, mainApiKeySID: string, mainApiKeySecret: string): void;
46
- /**
47
- * Get token
48
- *
49
- * @param {string} userId user id
50
- * @param {string} roomName room name
51
- * @returns {string} returns token value
52
- */
53
- token(userId: string, roomName: string): string;
54
- }
55
- export {};
@@ -1,116 +0,0 @@
1
- "use strict";
2
- var __createBinding =
3
- (this && this.__createBinding) ||
4
- (Object.create
5
- ? function (o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- Object.defineProperty(o, k2, {
8
- enumerable: true,
9
- get: function () {
10
- return m[k];
11
- }
12
- });
13
- }
14
- : function (o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- o[k2] = m[k];
17
- });
18
- var __setModuleDefault =
19
- (this && this.__setModuleDefault) ||
20
- (Object.create
21
- ? function (o, v) {
22
- Object.defineProperty(o, "default", { enumerable: true, value: v });
23
- }
24
- : function (o, v) {
25
- o["default"] = v;
26
- });
27
- var __decorate =
28
- (this && this.__decorate) ||
29
- function (decorators, target, key, desc) {
30
- var c = arguments.length,
31
- r = c < 3 ? target : desc === null ? (desc = Object.getOwnPropertyDescriptor(target, key)) : desc,
32
- d;
33
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
34
- r = Reflect.decorate(decorators, target, key, desc);
35
- else
36
- for (var i = decorators.length - 1; i >= 0; i--)
37
- if ((d = decorators[i])) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
38
- return c > 3 && r && Object.defineProperty(target, key, r), r;
39
- };
40
- var __importStar =
41
- (this && this.__importStar) ||
42
- function (mod) {
43
- if (mod && mod.__esModule) return mod;
44
- var result = {};
45
- if (mod != null)
46
- for (var k in mod)
47
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
48
- __setModuleDefault(result, mod);
49
- return result;
50
- };
51
- var __metadata =
52
- (this && this.__metadata) ||
53
- function (k, v) {
54
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
55
- };
56
- Object.defineProperty(exports, "__esModule", { value: true });
57
- exports.TwilioAuth = void 0;
58
- const tsyringe_1 = require("tsyringe");
59
- const AccessToken_1 = __importStar(require("twilio/lib/jwt/AccessToken"));
60
- /**
61
- * Meet Auth implementation
62
- */
63
- let TwilioAuth =
64
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
65
- class TwilioAuth {
66
- /**
67
- * Twilio auth constructor
68
- *
69
- * @param {IMeetConfig} config meet config
70
- */
71
- constructor(config) {
72
- this.init(config.account.main.sid, config.account.main.api.key, config.account.main.api.secret);
73
- }
74
- /**
75
- * Instance the twilio client
76
- *
77
- * @param {string} mainAccountSID main account SID
78
- * @param {string} mainApiKeySID main api SID
79
- * @param {string} mainApiKeySecret main apy secret
80
- * @returns {void} promise of type void
81
- */
82
- init(mainAccountSID, mainApiKeySID, mainApiKeySecret) {
83
- this._mainAccountSID = mainAccountSID;
84
- this._mainApiKeySID = mainApiKeySID;
85
- this._mainApiKeySecret = mainApiKeySecret;
86
- }
87
- /**
88
- * Get token
89
- *
90
- * @param {string} userId user id
91
- * @param {string} roomName room name
92
- * @returns {string} returns token value
93
- */
94
- token(userId, roomName) {
95
- //Instance the AccessToken token
96
- const token = new AccessToken_1.default(this._mainAccountSID, this._mainApiKeySID, this._mainApiKeySecret);
97
- // Assign identity to the token
98
- token.identity = userId;
99
- // Grant the access token Twilio Video capabilities
100
- const grant = new AccessToken_1.VideoGrant();
101
- grant.room = roomName;
102
- token.addGrant(grant);
103
- // Serialize the token to a JWT string
104
- return token.toJwt();
105
- }
106
- };
107
- TwilioAuth = __decorate(
108
- [
109
- (0, tsyringe_1.injectable)(),
110
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
111
- __metadata("design:paramtypes", [Object])
112
- ],
113
- TwilioAuth
114
- );
115
- exports.TwilioAuth = TwilioAuth;
116
- //# sourceMappingURL=twilio.auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"twilio.auth.js","sourceRoot":"","sources":["../../../meet/twilio/twilio.auth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AACtC,0EAAqE;AA2BrE;;GAEG;AAGH,IAAa,UAAU;AADvB,6DAA6D;AAC7D,MAAa,UAAU;IAMnB;;;;OAIG;IACH,YAAY,MAAmB;QAC3B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpG,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,cAAsB,EAAE,aAAqB,EAAE,gBAAwB;QACxE,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;QACtC,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;IAC9C,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAc,EAAE,QAAgB;QAClC,gCAAgC;QAChC,MAAM,KAAK,GAAG,IAAI,qBAAW,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAEjG,+BAA+B;QAC/B,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;QAExB,mDAAmD;QACnD,MAAM,KAAK,GAAG,IAAI,wBAAU,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC;QACtB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAEtB,sCAAsC;QACtC,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;CACJ,CAAA;AAnDY,UAAU;IAFtB,IAAA,qBAAU,GAAE;IACb,6DAA6D;;;GAChD,UAAU,CAmDtB;AAnDY,gCAAU"}
@@ -1,41 +0,0 @@
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 +0,0 @@
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
- //# sourceMappingURL=twilio.base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"twilio.base.js","sourceRoot":"","sources":["../../../meet/twilio/twilio.base.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAsB,UAAU;IAK5B,kBAAkB;IAClB;;;;OAIG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IACD;;;;OAIG;IACH,IAAW,MAAM,CAAC,KAAa;QAC3B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACH,IAAW,IAAI,CAAC,KAAiB;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,UAAU;IAEV;;;;;;OAMG;IACI,QAAQ,CAAC,MAAc,EAAE,QAAgB;QAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;CACJ;AArDD,gCAqDC"}