plugnmeet-sdk-js 1.2.0 → 1.2.1

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 (93) hide show
  1. package/README.md +1 -1
  2. package/{PlugNmeet.d.ts → dist/PlugNmeet.d.ts} +0 -0
  3. package/{PlugNmeet.js → dist/PlugNmeet.js} +0 -0
  4. package/{PlugNmeet.js.map → dist/PlugNmeet.js.map} +0 -0
  5. package/{api.d.ts → dist/api.d.ts} +0 -0
  6. package/{api.js → dist/api.js} +0 -0
  7. package/{api.js.map → dist/api.js.map} +0 -0
  8. package/dist/cjs/PlugNmeet.d.ts +76 -0
  9. package/dist/cjs/PlugNmeet.js +231 -0
  10. package/dist/cjs/PlugNmeet.js.map +1 -0
  11. package/dist/cjs/api.d.ts +6 -0
  12. package/dist/cjs/api.js +85 -0
  13. package/dist/cjs/api.js.map +1 -0
  14. package/{index.d.ts → dist/cjs/index.d.ts} +0 -0
  15. package/dist/cjs/index.js +6 -0
  16. package/dist/cjs/index.js.map +1 -0
  17. package/{types → dist/cjs/types}/RecordingDownloadToken.d.ts +0 -0
  18. package/dist/cjs/types/RecordingDownloadToken.js +3 -0
  19. package/dist/cjs/types/RecordingDownloadToken.js.map +1 -0
  20. package/{types → dist/cjs/types}/activeRoomInfo.d.ts +0 -0
  21. package/dist/cjs/types/activeRoomInfo.js +3 -0
  22. package/dist/cjs/types/activeRoomInfo.js.map +1 -0
  23. package/{types → dist/cjs/types}/activeRoomsInfo.d.ts +0 -0
  24. package/dist/cjs/types/activeRoomsInfo.js +3 -0
  25. package/dist/cjs/types/activeRoomsInfo.js.map +1 -0
  26. package/{types → dist/cjs/types}/clientFiles.d.ts +0 -0
  27. package/dist/cjs/types/clientFiles.js +3 -0
  28. package/dist/cjs/types/clientFiles.js.map +1 -0
  29. package/{types → dist/cjs/types}/createRoom.d.ts +0 -0
  30. package/dist/cjs/types/createRoom.js +3 -0
  31. package/dist/cjs/types/createRoom.js.map +1 -0
  32. package/{types → dist/cjs/types}/deleteRecordings.d.ts +0 -0
  33. package/dist/cjs/types/deleteRecordings.js +3 -0
  34. package/dist/cjs/types/deleteRecordings.js.map +1 -0
  35. package/{types → dist/cjs/types}/endRoom.d.ts +0 -0
  36. package/dist/cjs/types/endRoom.js +3 -0
  37. package/dist/cjs/types/endRoom.js.map +1 -0
  38. package/{types → dist/cjs/types}/fetchRecordings.d.ts +0 -0
  39. package/dist/cjs/types/fetchRecordings.js +3 -0
  40. package/dist/cjs/types/fetchRecordings.js.map +1 -0
  41. package/{types → dist/cjs/types}/isRoomActive.d.ts +0 -0
  42. package/dist/cjs/types/isRoomActive.js +3 -0
  43. package/dist/cjs/types/isRoomActive.js.map +1 -0
  44. package/{types → dist/cjs/types}/joinToken.d.ts +0 -0
  45. package/dist/cjs/types/joinToken.js +3 -0
  46. package/dist/cjs/types/joinToken.js.map +1 -0
  47. package/dist/index.d.ts +11 -0
  48. package/{index.js → dist/index.js} +0 -0
  49. package/{index.js.map → dist/index.js.map} +0 -0
  50. package/dist/types/RecordingDownloadToken.d.ts +8 -0
  51. package/{types → dist/types}/RecordingDownloadToken.js +0 -0
  52. package/{types → dist/types}/RecordingDownloadToken.js.map +0 -0
  53. package/dist/types/activeRoomInfo.d.ts +34 -0
  54. package/{types → dist/types}/activeRoomInfo.js +0 -0
  55. package/{types → dist/types}/activeRoomInfo.js.map +0 -0
  56. package/dist/types/activeRoomsInfo.d.ts +6 -0
  57. package/{types → dist/types}/activeRoomsInfo.js +0 -0
  58. package/{types → dist/types}/activeRoomsInfo.js.map +0 -0
  59. package/dist/types/clientFiles.d.ts +6 -0
  60. package/{types → dist/types}/clientFiles.js +0 -0
  61. package/{types → dist/types}/clientFiles.js.map +0 -0
  62. package/dist/types/createRoom.d.ts +82 -0
  63. package/{types → dist/types}/createRoom.js +0 -0
  64. package/{types → dist/types}/createRoom.js.map +0 -0
  65. package/dist/types/deleteRecordings.d.ts +7 -0
  66. package/{types → dist/types}/deleteRecordings.js +0 -0
  67. package/{types → dist/types}/deleteRecordings.js.map +0 -0
  68. package/dist/types/endRoom.d.ts +7 -0
  69. package/{types → dist/types}/endRoom.js +0 -0
  70. package/{types → dist/types}/endRoom.js.map +0 -0
  71. package/dist/types/fetchRecordings.d.ts +27 -0
  72. package/{types → dist/types}/fetchRecordings.js +0 -0
  73. package/{types → dist/types}/fetchRecordings.js.map +0 -0
  74. package/dist/types/isRoomActive.d.ts +7 -0
  75. package/{types → dist/types}/isRoomActive.js +0 -0
  76. package/{types → dist/types}/isRoomActive.js.map +0 -0
  77. package/dist/types/joinToken.d.ts +21 -0
  78. package/{types → dist/types}/joinToken.js +0 -0
  79. package/{types → dist/types}/joinToken.js.map +0 -0
  80. package/package.json +11 -9
  81. package/src/PlugNmeet.ts +255 -0
  82. package/src/api.ts +92 -0
  83. package/src/index.ts +48 -0
  84. package/src/types/RecordingDownloadToken.ts +9 -0
  85. package/src/types/activeRoomInfo.ts +38 -0
  86. package/src/types/activeRoomsInfo.ts +7 -0
  87. package/src/types/clientFiles.ts +6 -0
  88. package/src/types/createRoom.ts +94 -0
  89. package/src/types/deleteRecordings.ts +8 -0
  90. package/src/types/endRoom.ts +8 -0
  91. package/src/types/fetchRecordings.ts +30 -0
  92. package/src/types/isRoomActive.ts +8 -0
  93. package/src/types/joinToken.ts +25 -0
package/README.md CHANGED
@@ -15,7 +15,7 @@ npm install plugnmeet-sdk-js
15
15
  JavaScript:
16
16
 
17
17
  ```js
18
- const plugNmeet = require('plugnmeet-sdk-js').PlugNmeet;
18
+ const plugNmeet = require('plugnmeet-sdk-js/cjs').PlugNmeet;
19
19
 
20
20
  // now
21
21
  const pnm = new plugNmeet(
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,76 @@
1
+ import { CreateRoomParams, CreateRoomResponse } from './types/createRoom';
2
+ import { JoinTokenParams, JoinTokenResponse } from './types/joinToken';
3
+ import { IsRoomActiveParams, IsRoomActiveResponse } from './types/isRoomActive';
4
+ import { ActiveRoomInfoParams, ActiveRoomInfoResponse } from './types/activeRoomInfo';
5
+ import { ActiveRoomsInfoResponse } from './types/activeRoomsInfo';
6
+ import { EndRoomParams, EndRoomResponse } from './types/endRoom';
7
+ import { FetchRecordingsParams, FetchRecordingsResponse } from './types/fetchRecordings';
8
+ import { DeleteRecordingsParams, DeleteRecordingsResponse } from './types/deleteRecordings';
9
+ import { RecordingDownloadTokenParams, RecordingDownloadTokenResponse } from './types/RecordingDownloadToken';
10
+ import { ClientFilesResponse } from './types/clientFiles';
11
+ export declare class PlugNmeet {
12
+ protected defaultPath: string;
13
+ /**
14
+ * @param serverUrl plugNmeet server URL
15
+ * @param apiKey plugNmeet API_Key
16
+ * @param apiSecret plugNmeet API_Secret
17
+ */
18
+ constructor(serverUrl: string, apiKey: string, apiSecret: string);
19
+ /**
20
+ * Create new room
21
+ * @param params: CreateRoomParams
22
+ * @returns Promise<CreateRoomResponse>
23
+ */
24
+ createRoom(params: CreateRoomParams): Promise<CreateRoomResponse>;
25
+ /**
26
+ * Generate join token
27
+ * @param params: JoinTokenParams
28
+ * @returns Promise<JoinTokenResponse>
29
+ */
30
+ getJoinToken(params: JoinTokenParams): Promise<JoinTokenResponse>;
31
+ /**
32
+ * If room is active or not
33
+ * @param params: IsRoomActiveParams
34
+ * @returns Promise<IsRoomActiveResponse>
35
+ */
36
+ isRoomActive(params: IsRoomActiveParams): Promise<IsRoomActiveResponse>;
37
+ /**
38
+ * Get active room information
39
+ * @param params: ActiveRoomInfoParams
40
+ * @returns Promise<ActiveRoomInfoResponse>
41
+ */
42
+ getActiveRoomInfo(params: ActiveRoomInfoParams): Promise<ActiveRoomInfoResponse>;
43
+ /**
44
+ * Get all active rooms
45
+ * @returns Promise<ActiveRoomsInfoResponse>
46
+ */
47
+ getActiveRoomsInfo(): Promise<ActiveRoomsInfoResponse>;
48
+ /**
49
+ * End active room
50
+ * @param params: EndRoomParams
51
+ * @returns Promise<EndRoomResponse>
52
+ */
53
+ endRoom(params: EndRoomParams): Promise<EndRoomResponse>;
54
+ /**
55
+ * Fetch recordings
56
+ * @param params: FetchRecordingsParams
57
+ * @returns Promise<FetchRecordingsResponse>
58
+ */
59
+ fetchRecordings(params: FetchRecordingsParams): Promise<FetchRecordingsResponse>;
60
+ /**
61
+ * Delete recording
62
+ * @param params: DeleteRecordingsParams
63
+ * @returns Promise<DeleteRecordingsResponse>
64
+ */
65
+ deleteRecordings(params: DeleteRecordingsParams): Promise<DeleteRecordingsResponse>;
66
+ /**
67
+ * @returns Promise<ClientFilesResponse>
68
+ */
69
+ getClientFiles(): Promise<ClientFilesResponse>;
70
+ /**
71
+ * Generate token to download recording
72
+ * @param params: RecordingDownloadTokenParams
73
+ * @returns Promise<RecordingDownloadTokenResponse>
74
+ */
75
+ getRecordingDownloadToken(params: RecordingDownloadTokenParams): Promise<RecordingDownloadTokenResponse>;
76
+ }
@@ -0,0 +1,231 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PlugNmeet = void 0;
13
+ const api_1 = require("./api");
14
+ class PlugNmeet {
15
+ /**
16
+ * @param serverUrl plugNmeet server URL
17
+ * @param apiKey plugNmeet API_Key
18
+ * @param apiSecret plugNmeet API_Secret
19
+ */
20
+ constructor(serverUrl, apiKey, apiSecret) {
21
+ this.defaultPath = '/auth';
22
+ (0, api_1.prepareAPI)(serverUrl + this.defaultPath, apiKey, apiSecret);
23
+ }
24
+ /**
25
+ * Create new room
26
+ * @param params: CreateRoomParams
27
+ * @returns Promise<CreateRoomResponse>
28
+ */
29
+ createRoom(params) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ const output = yield (0, api_1.sendRequest)('/room/create', params);
32
+ if (!output.status) {
33
+ return {
34
+ status: false,
35
+ msg: output.response,
36
+ };
37
+ }
38
+ return {
39
+ status: output.response.status,
40
+ msg: output.response.msg,
41
+ roomInfo: output.response.roomInfo,
42
+ };
43
+ });
44
+ }
45
+ /**
46
+ * Generate join token
47
+ * @param params: JoinTokenParams
48
+ * @returns Promise<JoinTokenResponse>
49
+ */
50
+ getJoinToken(params) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ const output = yield (0, api_1.sendRequest)('/room/getJoinToken', params);
53
+ if (!output.status) {
54
+ return {
55
+ status: false,
56
+ msg: output.response,
57
+ };
58
+ }
59
+ return {
60
+ status: output.response.status,
61
+ msg: output.response.msg,
62
+ token: output.response.token,
63
+ };
64
+ });
65
+ }
66
+ /**
67
+ * If room is active or not
68
+ * @param params: IsRoomActiveParams
69
+ * @returns Promise<IsRoomActiveResponse>
70
+ */
71
+ isRoomActive(params) {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ const output = yield (0, api_1.sendRequest)('/room/isRoomActive', params);
74
+ if (!output.status) {
75
+ return {
76
+ status: false,
77
+ msg: output.response,
78
+ };
79
+ }
80
+ return {
81
+ status: output.response.status,
82
+ msg: output.response.msg,
83
+ };
84
+ });
85
+ }
86
+ /**
87
+ * Get active room information
88
+ * @param params: ActiveRoomInfoParams
89
+ * @returns Promise<ActiveRoomInfoResponse>
90
+ */
91
+ getActiveRoomInfo(params) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ const output = yield (0, api_1.sendRequest)('/room/getActiveRoomInfo', params);
94
+ if (!output.status) {
95
+ return {
96
+ status: false,
97
+ msg: output.response,
98
+ };
99
+ }
100
+ return {
101
+ status: output.response.status,
102
+ msg: output.response.msg,
103
+ room: output.response.room,
104
+ };
105
+ });
106
+ }
107
+ /**
108
+ * Get all active rooms
109
+ * @returns Promise<ActiveRoomsInfoResponse>
110
+ */
111
+ getActiveRoomsInfo() {
112
+ return __awaiter(this, void 0, void 0, function* () {
113
+ const output = yield (0, api_1.sendRequest)('/room/getActiveRoomsInfo', {});
114
+ if (!output.status) {
115
+ return {
116
+ status: false,
117
+ msg: output.response,
118
+ };
119
+ }
120
+ return {
121
+ status: output.response.status,
122
+ msg: output.response.msg,
123
+ rooms: output.response.rooms,
124
+ };
125
+ });
126
+ }
127
+ /**
128
+ * End active room
129
+ * @param params: EndRoomParams
130
+ * @returns Promise<EndRoomResponse>
131
+ */
132
+ endRoom(params) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ const output = yield (0, api_1.sendRequest)('/room/endRoom', params);
135
+ if (!output.status) {
136
+ return {
137
+ status: false,
138
+ msg: output.response,
139
+ };
140
+ }
141
+ return {
142
+ status: output.response.status,
143
+ msg: output.response.msg,
144
+ };
145
+ });
146
+ }
147
+ /**
148
+ * Fetch recordings
149
+ * @param params: FetchRecordingsParams
150
+ * @returns Promise<FetchRecordingsResponse>
151
+ */
152
+ fetchRecordings(params) {
153
+ return __awaiter(this, void 0, void 0, function* () {
154
+ const output = yield (0, api_1.sendRequest)('/recording/fetch', params);
155
+ if (!output.status) {
156
+ return {
157
+ status: false,
158
+ msg: output.response,
159
+ };
160
+ }
161
+ return {
162
+ status: output.response.status,
163
+ msg: output.response.msg,
164
+ result: output.response.result,
165
+ };
166
+ });
167
+ }
168
+ /**
169
+ * Delete recording
170
+ * @param params: DeleteRecordingsParams
171
+ * @returns Promise<DeleteRecordingsResponse>
172
+ */
173
+ deleteRecordings(params) {
174
+ return __awaiter(this, void 0, void 0, function* () {
175
+ const output = yield (0, api_1.sendRequest)('/recording/delete', params);
176
+ if (!output.status) {
177
+ return {
178
+ status: false,
179
+ msg: output.response,
180
+ };
181
+ }
182
+ return {
183
+ status: output.response.status,
184
+ msg: output.response.msg,
185
+ };
186
+ });
187
+ }
188
+ /**
189
+ * @returns Promise<ClientFilesResponse>
190
+ */
191
+ getClientFiles() {
192
+ return __awaiter(this, void 0, void 0, function* () {
193
+ const output = yield (0, api_1.sendRequest)('/getClientFiles', {});
194
+ if (!output.status) {
195
+ return {
196
+ status: false,
197
+ msg: output.response,
198
+ };
199
+ }
200
+ return {
201
+ status: output.response.status,
202
+ msg: output.response.msg,
203
+ css: output.response.css,
204
+ js: output.response.js,
205
+ };
206
+ });
207
+ }
208
+ /**
209
+ * Generate token to download recording
210
+ * @param params: RecordingDownloadTokenParams
211
+ * @returns Promise<RecordingDownloadTokenResponse>
212
+ */
213
+ getRecordingDownloadToken(params) {
214
+ return __awaiter(this, void 0, void 0, function* () {
215
+ const output = yield (0, api_1.sendRequest)('/recording/getDownloadToken', params);
216
+ if (!output.status) {
217
+ return {
218
+ status: false,
219
+ msg: output.response,
220
+ };
221
+ }
222
+ return {
223
+ status: output.response.status,
224
+ msg: output.response.msg,
225
+ token: output.response.token,
226
+ };
227
+ });
228
+ }
229
+ }
230
+ exports.PlugNmeet = PlugNmeet;
231
+ //# sourceMappingURL=PlugNmeet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlugNmeet.js","sourceRoot":"","sources":["../../src/PlugNmeet.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAAgD;AAwBhD,MAAa,SAAS;IAGpB;;;;OAIG;IACH,YAAY,SAAiB,EAAE,MAAc,EAAE,SAAiB;QAPtD,gBAAW,GAAG,OAAO,CAAC;QAQ9B,IAAA,gBAAU,EAAC,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACU,UAAU,CACrB,MAAwB;;YAExB,MAAM,MAAM,GAAG,MAAM,IAAA,iBAAW,EAAC,cAAc,EAAE,MAAM,CAAC,CAAC;YACzD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;gBAClB,O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,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE;aACvB,CAAC;QACJ,CAAC;KAAA;IAED;;;;OAIG;IACU,yBAAyB,CACpC,MAAoC;;YAEpC,MAAM,MAAM,GAAG,MAAM,IAAA,iBAAW,EAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;YACxE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;gBAClB,OAAO;oBACL,MAAM,EAAE,KAAK;oBACb,GAAG,EAAE,MAAM,CAAC,QAAQ;iBACrB,CAAC;aACH;YAED,OAAO;gBACL,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;gBAC9B,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG;gBACxB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK;aAC7B,CAAC;QACJ,CAAC;KAAA;CACF;AAtOD,8BAsOC"}
@@ -0,0 +1,6 @@
1
+ export type APIResponse = {
2
+ status: boolean;
3
+ response: any;
4
+ };
5
+ export declare const prepareAPI: (apiEndPointURL: string, apiKey: string, apiSecret: string) => void;
6
+ export declare const sendRequest: (path: string, body: any) => Promise<APIResponse>;
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.sendRequest = exports.prepareAPI = void 0;
16
+ const http_1 = __importDefault(require("http"));
17
+ const https_1 = __importDefault(require("https"));
18
+ const crypto_1 = require("crypto");
19
+ let mainOptions, isSecure = true, _apiKey = "", _apiSecret = "";
20
+ const prepareAPI = (apiEndPointURL, apiKey, apiSecret) => {
21
+ var _a;
22
+ _apiKey = apiKey;
23
+ _apiSecret = apiSecret;
24
+ const url = new URL(apiEndPointURL);
25
+ let port = url.protocol === 'https:' ? 443 : 80;
26
+ isSecure = (_a = url.protocol === 'https:') !== null && _a !== void 0 ? _a : false;
27
+ // use port if supplied with url
28
+ if (url.port) {
29
+ port = Number(url.port);
30
+ }
31
+ mainOptions = {
32
+ hostname: url.hostname,
33
+ path: url.pathname,
34
+ method: 'POST',
35
+ port,
36
+ };
37
+ };
38
+ exports.prepareAPI = prepareAPI;
39
+ const prepareHeader = (body) => {
40
+ const signature = (0, crypto_1.createHmac)('sha256', _apiSecret)
41
+ .update(body)
42
+ .digest('hex');
43
+ const headers = {
44
+ 'Content-Type': 'application/json',
45
+ 'API-KEY': _apiKey,
46
+ 'HASH-SIGNATURE': signature,
47
+ };
48
+ return headers;
49
+ };
50
+ const sendRequest = (path, body) => __awaiter(void 0, void 0, void 0, function* () {
51
+ return new Promise((resolve) => {
52
+ const output = {
53
+ status: false,
54
+ response: undefined,
55
+ };
56
+ const chunk = JSON.stringify(body);
57
+ const options = Object.assign({}, mainOptions);
58
+ options.path += path;
59
+ options.headers = prepareHeader(chunk);
60
+ const req = (isSecure ? https_1.default : http_1.default).request(options, (res) => {
61
+ const body = [];
62
+ res.on('data', (chunk) => body.push(chunk));
63
+ res.on('end', () => {
64
+ const resString = Buffer.concat(body).toString();
65
+ try {
66
+ output.status = true;
67
+ output.response = JSON.parse(resString);
68
+ }
69
+ catch (error) {
70
+ output.status = false;
71
+ output.response = error;
72
+ }
73
+ resolve(output);
74
+ });
75
+ });
76
+ req.on('error', (error) => {
77
+ output.response = error.message;
78
+ resolve(output);
79
+ });
80
+ req.write(chunk);
81
+ req.end();
82
+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AAC,MAAM,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACxB,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;YAChC,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACjB,GAAG,CAAC,GAAG,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAxCW,QAAA,WAAW,eAwCtB"}
File without changes
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PlugNmeet = void 0;
4
+ var PlugNmeet_1 = require("./PlugNmeet");
5
+ Object.defineProperty(exports, "PlugNmeet", { enumerable: true, get: function () { return PlugNmeet_1.PlugNmeet; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AA+CA,yCAAwC;AAA/B,sGAAA,SAAS,OAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=RecordingDownloadToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecordingDownloadToken.js","sourceRoot":"","sources":["../../../src/types/RecordingDownloadToken.ts"],"names":[],"mappings":""}
File without changes
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=activeRoomInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activeRoomInfo.js","sourceRoot":"","sources":["../../../src/types/activeRoomInfo.ts"],"names":[],"mappings":""}
File without changes
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=activeRoomsInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activeRoomsInfo.js","sourceRoot":"","sources":["../../../src/types/activeRoomsInfo.ts"],"names":[],"mappings":""}
File without changes
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=clientFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientFiles.js","sourceRoot":"","sources":["../../../src/types/clientFiles.ts"],"names":[],"mappings":""}
File without changes
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=createRoom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRoom.js","sourceRoot":"","sources":["../../../src/types/createRoom.ts"],"names":[],"mappings":""}
File without changes
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=deleteRecordings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteRecordings.js","sourceRoot":"","sources":["../../../src/types/deleteRecordings.ts"],"names":[],"mappings":""}
File without changes
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=endRoom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endRoom.js","sourceRoot":"","sources":["../../../src/types/endRoom.ts"],"names":[],"mappings":""}
File without changes
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=fetchRecordings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchRecordings.js","sourceRoot":"","sources":["../../../src/types/fetchRecordings.ts"],"names":[],"mappings":""}
File without changes
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=isRoomActive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isRoomActive.js","sourceRoot":"","sources":["../../../src/types/isRoomActive.ts"],"names":[],"mappings":""}
File without changes
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=joinToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joinToken.js","sourceRoot":"","sources":["../../../src/types/joinToken.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ export { RooMetadata, CreateRoomParams, CreateRoomResponse, CreateRoomResponseRoomInfo, LockSettingsParams, RoomFeaturesParams, RecordingFeaturesParams, ChatFeaturesParams, SharedNotePadFeaturesParams, WhiteboardFeaturesParams, ExternalMediaPlayerFeatures, WaitingRoomFeatures, BreakoutRoomFeatures, } from './types/createRoom';
2
+ export { JoinTokenParams, JoinTokenResponse, JoinTokenUserMetadata, JoinTokenUserInfo, } from './types/joinToken';
3
+ export { IsRoomActiveParams, IsRoomActiveResponse } from './types/isRoomActive';
4
+ export { Room, ActiveRoomInfoParams, ActiveRoomInfoResponse, ParticipantInfo, ActiveRoomInfo, } from './types/activeRoomInfo';
5
+ export { ActiveRoomsInfoResponse } from './types/activeRoomsInfo';
6
+ export { EndRoomParams, EndRoomResponse } from './types/endRoom';
7
+ export { FetchRecordingsParams, FetchRecordingsResponse, FetchRecordingsResult, RecordingInfo, } from './types/fetchRecordings';
8
+ export { DeleteRecordingsParams, DeleteRecordingsResponse, } from './types/deleteRecordings';
9
+ export { RecordingDownloadTokenParams, RecordingDownloadTokenResponse, } from './types/RecordingDownloadToken';
10
+ export { ClientFilesResponse } from './types/clientFiles';
11
+ export { PlugNmeet } from './PlugNmeet';
File without changes
File without changes
@@ -0,0 +1,8 @@
1
+ export type RecordingDownloadTokenParams = {
2
+ record_id: string;
3
+ };
4
+ export type RecordingDownloadTokenResponse = {
5
+ status: boolean;
6
+ msg: string;
7
+ token?: string;
8
+ };
File without changes
@@ -0,0 +1,34 @@
1
+ export type ActiveRoomInfoParams = {
2
+ room_id: string;
3
+ };
4
+ export type ActiveRoomInfoResponse = {
5
+ status: boolean;
6
+ msg: string;
7
+ room?: Room;
8
+ };
9
+ export type Room = {
10
+ room_info: ActiveRoomInfo;
11
+ participants_info: Array<ParticipantInfo>;
12
+ };
13
+ export type ActiveRoomInfo = {
14
+ room_title: string;
15
+ room_id: string;
16
+ sid: string;
17
+ joined_participants: number;
18
+ is_running: boolean;
19
+ is_recording: boolean;
20
+ is_active_rtmp: boolean;
21
+ webhook_url: string;
22
+ creation_time: number;
23
+ metadata: string;
24
+ };
25
+ export type ParticipantInfo = {
26
+ sid: string;
27
+ identity: string;
28
+ state: string;
29
+ metadata: string;
30
+ joined_at: number;
31
+ name: string;
32
+ version: number;
33
+ permission: any;
34
+ };
File without changes
File without changes
@@ -0,0 +1,6 @@
1
+ import { Room } from './activeRoomInfo';
2
+ export type ActiveRoomsInfoResponse = {
3
+ status: boolean;
4
+ msg: string;
5
+ rooms?: Array<Room>;
6
+ };