@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.
Files changed (122) hide show
  1. package/chat/index.d.ts +36 -36
  2. package/chat/index.js +58 -58
  3. package/chat/stream/enum/index.d.ts +33 -27
  4. package/chat/stream/enum/index.js +41 -34
  5. package/chat/stream/enum/index.js.map +1 -1
  6. package/chat/stream/index.d.ts +9 -9
  7. package/chat/stream/index.js +17 -17
  8. package/chat/stream/models/_/channel.data.d.ts +19 -19
  9. package/chat/stream/models/_/channel.data.js +2 -2
  10. package/chat/stream/models/_/channel.member.d.ts +14 -14
  11. package/chat/stream/models/_/channel.member.js +11 -11
  12. package/chat/stream/models/_/channel.response.d.ts +8 -8
  13. package/chat/stream/models/_/channel.response.js +2 -2
  14. package/chat/stream/models/_/event.data.d.ts +16 -0
  15. package/chat/stream/models/_/event.data.js +4 -0
  16. package/chat/stream/models/_/event.data.js.map +1 -0
  17. package/chat/stream/models/_/message.response.d.ts +8 -8
  18. package/chat/stream/models/_/message.response.js +2 -2
  19. package/chat/stream/models/_/stream.config.d.ts +22 -22
  20. package/chat/stream/models/_/stream.config.js +2 -2
  21. package/chat/stream/models/_/user.response.d.ts +8 -8
  22. package/chat/stream/models/_/user.response.js +2 -2
  23. package/chat/stream/models/index.d.ts +9 -7
  24. package/chat/stream/models/index.js +5 -5
  25. package/chat/stream/models/index.js.map +1 -1
  26. package/chat/stream/stream.api.d.ts +63 -63
  27. package/chat/stream/stream.api.js +76 -76
  28. package/chat/stream/stream.auth.d.ts +70 -70
  29. package/chat/stream/stream.auth.js +80 -80
  30. package/chat/stream/stream.base.d.ts +56 -56
  31. package/chat/stream/stream.base.js +93 -93
  32. package/chat/stream/stream.channel.d.ts +132 -118
  33. package/chat/stream/stream.channel.js +306 -285
  34. package/chat/stream/stream.channel.js.map +1 -1
  35. package/chat/stream/stream.error.d.ts +19 -19
  36. package/chat/stream/stream.error.js +17 -17
  37. package/chat/stream/stream.member.d.ts +75 -75
  38. package/chat/stream/stream.member.js +175 -175
  39. package/chat/stream/stream.message.d.ts +59 -59
  40. package/chat/stream/stream.message.js +112 -112
  41. package/chat/stream/stream.user.d.ts +49 -49
  42. package/chat/stream/stream.user.js +90 -90
  43. package/core/_/api-error.d.ts +24 -24
  44. package/core/_/api-error.js +21 -21
  45. package/core/_/api-response.d.ts +25 -25
  46. package/core/_/api-response.js +21 -21
  47. package/core/_/cors-headers.d.ts +16 -16
  48. package/core/_/cors-headers.js +32 -32
  49. package/core/_/model.d.ts +39 -31
  50. package/core/_/model.js +2 -2
  51. package/core/_/service-request.d.ts +66 -66
  52. package/core/_/service-request.js +104 -104
  53. package/core/_/service-request.js.map +1 -1
  54. package/core/index.d.ts +10 -10
  55. package/core/index.js +11 -11
  56. package/coverage/coverage-final.json +4 -0
  57. package/deployment/_/serverless.d.ts +26 -26
  58. package/deployment/_/serverless.js +43 -43
  59. package/deployment/index.d.ts +2 -2
  60. package/deployment/index.js +5 -5
  61. package/endpoint-test-factory/_/test-factory.d.ts +45 -45
  62. package/endpoint-test-factory/_/test-factory.js +91 -91
  63. package/endpoint-test-factory/index.d.ts +2 -2
  64. package/endpoint-test-factory/index.js +5 -5
  65. package/enums/index.d.ts +92 -92
  66. package/enums/index.js +2 -2
  67. package/jest.config.d.ts +12 -0
  68. package/jest.config.js +16 -0
  69. package/jest.config.js.map +1 -0
  70. package/meet/index.d.ts +36 -36
  71. package/meet/index.js +58 -58
  72. package/meet/tests/unit/twilio/twilio.room.test.d.ts +1 -0
  73. package/meet/tests/unit/twilio/twilio.room.test.js +33 -0
  74. package/meet/tests/unit/twilio/twilio.room.test.js.map +1 -0
  75. package/meet/twilio/enum/index.d.ts +6 -6
  76. package/meet/twilio/enum/index.js +10 -10
  77. package/meet/twilio/index.d.ts +5 -5
  78. package/meet/twilio/index.js +11 -11
  79. package/meet/twilio/models/_/room.data.d.ts +6 -6
  80. package/meet/twilio/models/_/room.data.js +2 -2
  81. package/meet/twilio/models/_/twilio.config.d.ts +29 -29
  82. package/meet/twilio/models/_/twilio.config.js +2 -2
  83. package/meet/twilio/models/index.d.ts +3 -3
  84. package/meet/twilio/models/index.js +2 -2
  85. package/meet/twilio/twilio.api.d.ts +28 -28
  86. package/meet/twilio/twilio.api.js +45 -45
  87. package/meet/twilio/twilio.auth.d.ts +55 -55
  88. package/meet/twilio/twilio.auth.js +83 -83
  89. package/meet/twilio/twilio.base.d.ts +41 -41
  90. package/meet/twilio/twilio.base.js +53 -53
  91. package/meet/twilio/twilio.room.d.ts +58 -46
  92. package/meet/twilio/twilio.room.js +141 -124
  93. package/meet/twilio/twilio.room.js.map +1 -1
  94. package/package.json +64 -57
  95. package/swagger/_/swagger.config.d.ts +21 -21
  96. package/swagger/_/swagger.config.js +2 -2
  97. package/swagger/_/swagger.d.ts +37 -37
  98. package/swagger/_/swagger.js +78 -78
  99. package/swagger/index.d.ts +3 -3
  100. package/swagger/index.js +5 -5
  101. package/types/index.d.ts +19 -19
  102. package/types/index.js +2 -2
  103. package/utils/_/encoder.d.ts +19 -19
  104. package/utils/_/encoder.js +27 -27
  105. package/utils/_/encryptor.d.ts +26 -26
  106. package/utils/_/encryptor.js +67 -67
  107. package/utils/_/hasher.d.ts +25 -25
  108. package/utils/_/hasher.js +63 -63
  109. package/utils/_/object-mapper.d.ts +12 -12
  110. package/utils/_/object-mapper.js +22 -22
  111. package/utils/_/string-formatter.d.ts +34 -34
  112. package/utils/_/string-formatter.js +49 -49
  113. package/utils/_/utc-date.d.ts +35 -35
  114. package/utils/_/utc-date.js +84 -84
  115. package/utils/index.d.ts +7 -7
  116. package/utils/index.js +15 -15
  117. package/validators/_/checker.d.ts +62 -62
  118. package/validators/_/checker.js +98 -98
  119. package/validators/_/regex.d.ts +98 -98
  120. package/validators/_/regex.js +142 -142
  121. package/validators/index.d.ts +3 -3
  122. package/validators/index.js +7 -7
package/meet/index.js CHANGED
@@ -1,59 +1,59 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Meet = void 0;
13
- const tsyringe_1 = require("tsyringe");
14
- const enum_1 = require("./twilio/enum");
15
- const twilio_api_1 = require("./twilio/twilio.api");
16
- /**
17
- * Meet implementation
18
- */
19
- let Meet = class Meet {
20
- /**
21
- * Meet constructor
22
- *
23
- * @param {ClientType} clientType client type
24
- * @param {IMeetConfig} config meet configuration
25
- */
26
- constructor(clientType, config) {
27
- this._clientType = clientType;
28
- this._config = config;
29
- this.init();
30
- }
31
- // getter / setter
32
- /**
33
- * getter for client
34
- *
35
- * @returns {T} client of type T
36
- */
37
- get client() {
38
- return this._client;
39
- }
40
- // methods
41
- /**
42
- * initialize method
43
- *
44
- * @returns {void} promise of type void
45
- */
46
- init() {
47
- // change to switch when adding new client types
48
- //Create a new Stream Client
49
- if (this._clientType == enum_1.ClientType.Twilio) {
50
- this._client = new twilio_api_1.TwilioApi(this._config);
51
- }
52
- }
53
- };
54
- Meet = __decorate([
55
- (0, tsyringe_1.injectable)(),
56
- __metadata("design:paramtypes", [String, Object])
57
- ], Meet);
58
- exports.Meet = Meet;
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Meet = void 0;
13
+ const tsyringe_1 = require("tsyringe");
14
+ const enum_1 = require("./twilio/enum");
15
+ const twilio_api_1 = require("./twilio/twilio.api");
16
+ /**
17
+ * Meet implementation
18
+ */
19
+ let Meet = class Meet {
20
+ /**
21
+ * Meet constructor
22
+ *
23
+ * @param {ClientType} clientType client type
24
+ * @param {IMeetConfig} config meet configuration
25
+ */
26
+ constructor(clientType, config) {
27
+ this._clientType = clientType;
28
+ this._config = config;
29
+ this.init();
30
+ }
31
+ // getter / setter
32
+ /**
33
+ * getter for client
34
+ *
35
+ * @returns {T} client of type T
36
+ */
37
+ get client() {
38
+ return this._client;
39
+ }
40
+ // methods
41
+ /**
42
+ * initialize method
43
+ *
44
+ * @returns {void} promise of type void
45
+ */
46
+ init() {
47
+ // change to switch when adding new client types
48
+ //Create a new Stream Client
49
+ if (this._clientType == enum_1.ClientType.Twilio) {
50
+ this._client = new twilio_api_1.TwilioApi(this._config);
51
+ }
52
+ }
53
+ };
54
+ Meet = __decorate([
55
+ (0, tsyringe_1.injectable)(),
56
+ __metadata("design:paramtypes", [String, Object])
57
+ ], Meet);
58
+ exports.Meet = Meet;
59
59
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ import "reflect-metadata";
@@ -0,0 +1,33 @@
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
@@ -0,0 +1 @@
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 +1,6 @@
1
- /**
2
- * Client Type enum
3
- */
4
- export declare enum ClientType {
5
- Twilio = "twilio"
6
- }
1
+ /**
2
+ * Client Type enum
3
+ */
4
+ export declare enum ClientType {
5
+ Twilio = "twilio"
6
+ }
@@ -1,11 +1,11 @@
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 = {}));
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
11
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
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
+ 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,12 +1,12 @@
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", { enumerable: true, get: function () { return twilio_auth_1.TwilioAuth; } });
6
- const twilio_api_1 = require("./twilio.api");
7
- Object.defineProperty(exports, "TwilioApi", { enumerable: true, get: function () { return twilio_api_1.TwilioApi; } });
8
- const twilio_base_1 = require("./twilio.base");
9
- Object.defineProperty(exports, "TwilioBase", { enumerable: true, get: function () { return twilio_base_1.TwilioBase; } });
10
- const twilio_room_1 = require("./twilio.room");
11
- Object.defineProperty(exports, "TwilioRoom", { enumerable: true, get: function () { return twilio_room_1.TwilioRoom; } });
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", { enumerable: true, get: function () { return twilio_auth_1.TwilioAuth; } });
6
+ const twilio_api_1 = require("./twilio.api");
7
+ Object.defineProperty(exports, "TwilioApi", { enumerable: true, get: function () { return twilio_api_1.TwilioApi; } });
8
+ const twilio_base_1 = require("./twilio.base");
9
+ Object.defineProperty(exports, "TwilioBase", { enumerable: true, get: function () { return twilio_base_1.TwilioBase; } });
10
+ const twilio_room_1 = require("./twilio.room");
11
+ Object.defineProperty(exports, "TwilioRoom", { enumerable: true, get: function () { return twilio_room_1.TwilioRoom; } });
12
12
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
- /** Twilio Room data*/
2
- export interface IRoomData {
3
- sid: string;
4
- exist: boolean;
5
- status: string;
6
- }
1
+ /** Twilio Room data*/
2
+ export interface IRoomData {
3
+ sid: string;
4
+ exist: boolean;
5
+ status: string;
6
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=room.data.js.map
@@ -1,29 +1,29 @@
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
+ /**
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 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=twilio.config.js.map
@@ -1,3 +1,3 @@
1
- import { IRoomData } from "./_/room.data";
2
- import { IMeetConfig, ITwilioConfig } from "./_/twilio.config";
3
- export { IMeetConfig, ITwilioConfig, IRoomData };
1
+ import { IRoomData } from "./_/room.data";
2
+ import { IMeetConfig, ITwilioConfig } from "./_/twilio.config";
3
+ export { IMeetConfig, ITwilioConfig, IRoomData };
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=index.js.map
@@ -1,28 +1,28 @@
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
+ 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 +1,46 @@
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 };
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
46
  //# sourceMappingURL=twilio.api.js.map
@@ -1,55 +1,55 @@
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
+ 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 {};