plugnmeet-sdk-js 1.2.2 → 1.2.4
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/README.md +1 -1
- package/dist/PlugNmeet.cjs +248 -0
- package/dist/PlugNmeet.cjs.map +1 -0
- package/dist/PlugNmeet.js +184 -137
- package/dist/PlugNmeet.js.map +1 -1
- package/dist/PlugNmeet.mjs +241 -0
- package/dist/PlugNmeet.mjs.map +1 -0
- package/dist/index.d.ts +280 -11
- package/dist/index.d.ts.map +1 -0
- package/package.json +30 -20
- package/dist/PlugNmeet.d.ts +0 -76
- package/dist/api.d.ts +0 -6
- package/dist/api.js +0 -67
- package/dist/api.js.map +0 -1
- package/dist/cjs/PlugNmeet.d.ts +0 -76
- package/dist/cjs/PlugNmeet.js +0 -231
- package/dist/cjs/PlugNmeet.js.map +0 -1
- package/dist/cjs/api.d.ts +0 -6
- package/dist/cjs/api.js +0 -85
- package/dist/cjs/api.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -11
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/types/RecordingDownloadToken.d.ts +0 -8
- package/dist/cjs/types/RecordingDownloadToken.js +0 -3
- package/dist/cjs/types/RecordingDownloadToken.js.map +0 -1
- package/dist/cjs/types/activeRoomInfo.d.ts +0 -34
- package/dist/cjs/types/activeRoomInfo.js +0 -3
- package/dist/cjs/types/activeRoomInfo.js.map +0 -1
- package/dist/cjs/types/activeRoomsInfo.d.ts +0 -6
- package/dist/cjs/types/activeRoomsInfo.js +0 -3
- package/dist/cjs/types/activeRoomsInfo.js.map +0 -1
- package/dist/cjs/types/clientFiles.d.ts +0 -6
- package/dist/cjs/types/clientFiles.js +0 -3
- package/dist/cjs/types/clientFiles.js.map +0 -1
- package/dist/cjs/types/createRoom.d.ts +0 -83
- package/dist/cjs/types/createRoom.js +0 -3
- package/dist/cjs/types/createRoom.js.map +0 -1
- package/dist/cjs/types/deleteRecordings.d.ts +0 -7
- package/dist/cjs/types/deleteRecordings.js +0 -3
- package/dist/cjs/types/deleteRecordings.js.map +0 -1
- package/dist/cjs/types/endRoom.d.ts +0 -7
- package/dist/cjs/types/endRoom.js +0 -3
- package/dist/cjs/types/endRoom.js.map +0 -1
- package/dist/cjs/types/fetchRecordings.d.ts +0 -27
- package/dist/cjs/types/fetchRecordings.js +0 -3
- package/dist/cjs/types/fetchRecordings.js.map +0 -1
- package/dist/cjs/types/isRoomActive.d.ts +0 -7
- package/dist/cjs/types/isRoomActive.js +0 -3
- package/dist/cjs/types/isRoomActive.js.map +0 -1
- package/dist/cjs/types/joinToken.d.ts +0 -21
- package/dist/cjs/types/joinToken.js +0 -3
- package/dist/cjs/types/joinToken.js.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/types/RecordingDownloadToken.d.ts +0 -8
- package/dist/types/RecordingDownloadToken.js +0 -2
- package/dist/types/RecordingDownloadToken.js.map +0 -1
- package/dist/types/activeRoomInfo.d.ts +0 -34
- package/dist/types/activeRoomInfo.js +0 -2
- package/dist/types/activeRoomInfo.js.map +0 -1
- package/dist/types/activeRoomsInfo.d.ts +0 -6
- package/dist/types/activeRoomsInfo.js +0 -2
- package/dist/types/activeRoomsInfo.js.map +0 -1
- package/dist/types/clientFiles.d.ts +0 -6
- package/dist/types/clientFiles.js +0 -2
- package/dist/types/clientFiles.js.map +0 -1
- package/dist/types/createRoom.d.ts +0 -83
- package/dist/types/createRoom.js +0 -2
- package/dist/types/createRoom.js.map +0 -1
- package/dist/types/deleteRecordings.d.ts +0 -7
- package/dist/types/deleteRecordings.js +0 -2
- package/dist/types/deleteRecordings.js.map +0 -1
- package/dist/types/endRoom.d.ts +0 -7
- package/dist/types/endRoom.js +0 -2
- package/dist/types/endRoom.js.map +0 -1
- package/dist/types/fetchRecordings.d.ts +0 -27
- package/dist/types/fetchRecordings.js +0 -2
- package/dist/types/fetchRecordings.js.map +0 -1
- package/dist/types/isRoomActive.d.ts +0 -7
- package/dist/types/isRoomActive.js +0 -2
- package/dist/types/isRoomActive.js.map +0 -1
- package/dist/types/joinToken.d.ts +0 -21
- package/dist/types/joinToken.js +0 -2
- package/dist/types/joinToken.js.map +0 -1
- package/src/PlugNmeet.ts +0 -255
- package/src/api.ts +0 -92
- package/src/index.ts +0 -48
- package/src/types/RecordingDownloadToken.ts +0 -9
- package/src/types/activeRoomInfo.ts +0 -38
- package/src/types/activeRoomsInfo.ts +0 -7
- package/src/types/clientFiles.ts +0 -6
- package/src/types/createRoom.ts +0 -95
- package/src/types/deleteRecordings.ts +0 -8
- package/src/types/endRoom.ts +0 -8
- package/src/types/fetchRecordings.ts +0 -30
- package/src/types/isRoomActive.ts +0 -8
- package/src/types/joinToken.ts +0 -25
package/README.md
CHANGED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
var $jMCoD$buffer = require("buffer");
|
|
2
|
+
var $jMCoD$http = require("http");
|
|
3
|
+
var $jMCoD$https = require("https");
|
|
4
|
+
var $jMCoD$crypto = require("crypto");
|
|
5
|
+
|
|
6
|
+
function $parcel$export(e, n, v, s) {
|
|
7
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
8
|
+
}
|
|
9
|
+
function $parcel$interopDefault(a) {
|
|
10
|
+
return a && a.__esModule ? a.default : a;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
$parcel$export(module.exports, "PlugNmeet", () => $405dcbf07186a1ff$export$1402da7f2870faee);
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
var $74b0cf9d3dbd5b46$require$Buffer = $jMCoD$buffer.Buffer;
|
|
19
|
+
let $74b0cf9d3dbd5b46$var$mainOptions, $74b0cf9d3dbd5b46$var$isSecure = true, $74b0cf9d3dbd5b46$var$_apiKey = "", $74b0cf9d3dbd5b46$var$_apiSecret = "";
|
|
20
|
+
const $74b0cf9d3dbd5b46$export$84c28a9528d0e9cd = (apiEndPointURL, apiKey, apiSecret)=>{
|
|
21
|
+
$74b0cf9d3dbd5b46$var$_apiKey = apiKey;
|
|
22
|
+
$74b0cf9d3dbd5b46$var$_apiSecret = apiSecret;
|
|
23
|
+
const url = new URL(apiEndPointURL);
|
|
24
|
+
let port = url.protocol === "https:" ? 443 : 80;
|
|
25
|
+
$74b0cf9d3dbd5b46$var$isSecure = (url.protocol === "https:") ?? false;
|
|
26
|
+
// use port if supplied with url
|
|
27
|
+
if (url.port) port = Number(url.port);
|
|
28
|
+
$74b0cf9d3dbd5b46$var$mainOptions = {
|
|
29
|
+
hostname: url.hostname,
|
|
30
|
+
path: url.pathname,
|
|
31
|
+
method: "POST",
|
|
32
|
+
port: port
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
const $74b0cf9d3dbd5b46$var$prepareHeader = (body)=>{
|
|
36
|
+
const signature = (0, $jMCoD$crypto.createHmac)("sha256", $74b0cf9d3dbd5b46$var$_apiSecret).update(body).digest("hex");
|
|
37
|
+
const headers = {
|
|
38
|
+
"Content-Type": "application/json",
|
|
39
|
+
"API-KEY": $74b0cf9d3dbd5b46$var$_apiKey,
|
|
40
|
+
"HASH-SIGNATURE": signature
|
|
41
|
+
};
|
|
42
|
+
return headers;
|
|
43
|
+
};
|
|
44
|
+
const $74b0cf9d3dbd5b46$export$d5a1e65f8aa21b51 = async (path, body)=>{
|
|
45
|
+
return new Promise((resolve)=>{
|
|
46
|
+
const output = {
|
|
47
|
+
status: false,
|
|
48
|
+
response: undefined
|
|
49
|
+
};
|
|
50
|
+
const chunk = JSON.stringify(body);
|
|
51
|
+
const options = {
|
|
52
|
+
...$74b0cf9d3dbd5b46$var$mainOptions
|
|
53
|
+
};
|
|
54
|
+
options.path += path;
|
|
55
|
+
options.headers = $74b0cf9d3dbd5b46$var$prepareHeader(chunk);
|
|
56
|
+
const req = ($74b0cf9d3dbd5b46$var$isSecure ? (0, ($parcel$interopDefault($jMCoD$https))) : (0, ($parcel$interopDefault($jMCoD$http)))).request(options, (res)=>{
|
|
57
|
+
const body = [];
|
|
58
|
+
res.on("data", (chunk)=>body.push(chunk));
|
|
59
|
+
res.on("end", ()=>{
|
|
60
|
+
const resString = $74b0cf9d3dbd5b46$require$Buffer.concat(body).toString();
|
|
61
|
+
try {
|
|
62
|
+
output.status = true;
|
|
63
|
+
output.response = JSON.parse(resString);
|
|
64
|
+
} catch (error) {
|
|
65
|
+
output.status = false;
|
|
66
|
+
output.response = error;
|
|
67
|
+
}
|
|
68
|
+
resolve(output);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
req.on("error", (error)=>{
|
|
72
|
+
output.response = error.message;
|
|
73
|
+
resolve(output);
|
|
74
|
+
});
|
|
75
|
+
req.write(chunk);
|
|
76
|
+
req.end();
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class $405dcbf07186a1ff$export$1402da7f2870faee {
|
|
82
|
+
defaultPath = "/auth";
|
|
83
|
+
/**
|
|
84
|
+
* @param serverUrl plugNmeet server URL
|
|
85
|
+
* @param apiKey plugNmeet API_Key
|
|
86
|
+
* @param apiSecret plugNmeet API_Secret
|
|
87
|
+
*/ constructor(serverUrl, apiKey, apiSecret){
|
|
88
|
+
(0, $74b0cf9d3dbd5b46$export$84c28a9528d0e9cd)(serverUrl + this.defaultPath, apiKey, apiSecret);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Create new room
|
|
92
|
+
* @param params: CreateRoomParams
|
|
93
|
+
* @returns Promise<CreateRoomResponse>
|
|
94
|
+
*/ async createRoom(params) {
|
|
95
|
+
const output = await (0, $74b0cf9d3dbd5b46$export$d5a1e65f8aa21b51)("/room/create", params);
|
|
96
|
+
if (!output.status) return {
|
|
97
|
+
status: false,
|
|
98
|
+
msg: output.response
|
|
99
|
+
};
|
|
100
|
+
return {
|
|
101
|
+
status: output.response.status,
|
|
102
|
+
msg: output.response.msg,
|
|
103
|
+
roomInfo: output.response.roomInfo
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Generate join token
|
|
108
|
+
* @param params: JoinTokenParams
|
|
109
|
+
* @returns Promise<JoinTokenResponse>
|
|
110
|
+
*/ async getJoinToken(params) {
|
|
111
|
+
const output = await (0, $74b0cf9d3dbd5b46$export$d5a1e65f8aa21b51)("/room/getJoinToken", params);
|
|
112
|
+
if (!output.status) return {
|
|
113
|
+
status: false,
|
|
114
|
+
msg: output.response
|
|
115
|
+
};
|
|
116
|
+
return {
|
|
117
|
+
status: output.response.status,
|
|
118
|
+
msg: output.response.msg,
|
|
119
|
+
token: output.response.token
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* If room is active or not
|
|
124
|
+
* @param params: IsRoomActiveParams
|
|
125
|
+
* @returns Promise<IsRoomActiveResponse>
|
|
126
|
+
*/ async isRoomActive(params) {
|
|
127
|
+
const output = await (0, $74b0cf9d3dbd5b46$export$d5a1e65f8aa21b51)("/room/isRoomActive", params);
|
|
128
|
+
if (!output.status) return {
|
|
129
|
+
status: false,
|
|
130
|
+
msg: output.response
|
|
131
|
+
};
|
|
132
|
+
return {
|
|
133
|
+
status: output.response.status,
|
|
134
|
+
msg: output.response.msg
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Get active room information
|
|
139
|
+
* @param params: ActiveRoomInfoParams
|
|
140
|
+
* @returns Promise<ActiveRoomInfoResponse>
|
|
141
|
+
*/ async getActiveRoomInfo(params) {
|
|
142
|
+
const output = await (0, $74b0cf9d3dbd5b46$export$d5a1e65f8aa21b51)("/room/getActiveRoomInfo", params);
|
|
143
|
+
if (!output.status) return {
|
|
144
|
+
status: false,
|
|
145
|
+
msg: output.response
|
|
146
|
+
};
|
|
147
|
+
return {
|
|
148
|
+
status: output.response.status,
|
|
149
|
+
msg: output.response.msg,
|
|
150
|
+
room: output.response.room
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Get all active rooms
|
|
155
|
+
* @returns Promise<ActiveRoomsInfoResponse>
|
|
156
|
+
*/ async getActiveRoomsInfo() {
|
|
157
|
+
const output = await (0, $74b0cf9d3dbd5b46$export$d5a1e65f8aa21b51)("/room/getActiveRoomsInfo", {});
|
|
158
|
+
if (!output.status) return {
|
|
159
|
+
status: false,
|
|
160
|
+
msg: output.response
|
|
161
|
+
};
|
|
162
|
+
return {
|
|
163
|
+
status: output.response.status,
|
|
164
|
+
msg: output.response.msg,
|
|
165
|
+
rooms: output.response.rooms
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* End active room
|
|
170
|
+
* @param params: EndRoomParams
|
|
171
|
+
* @returns Promise<EndRoomResponse>
|
|
172
|
+
*/ async endRoom(params) {
|
|
173
|
+
const output = await (0, $74b0cf9d3dbd5b46$export$d5a1e65f8aa21b51)("/room/endRoom", params);
|
|
174
|
+
if (!output.status) return {
|
|
175
|
+
status: false,
|
|
176
|
+
msg: output.response
|
|
177
|
+
};
|
|
178
|
+
return {
|
|
179
|
+
status: output.response.status,
|
|
180
|
+
msg: output.response.msg
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Fetch recordings
|
|
185
|
+
* @param params: FetchRecordingsParams
|
|
186
|
+
* @returns Promise<FetchRecordingsResponse>
|
|
187
|
+
*/ async fetchRecordings(params) {
|
|
188
|
+
const output = await (0, $74b0cf9d3dbd5b46$export$d5a1e65f8aa21b51)("/recording/fetch", params);
|
|
189
|
+
if (!output.status) return {
|
|
190
|
+
status: false,
|
|
191
|
+
msg: output.response
|
|
192
|
+
};
|
|
193
|
+
return {
|
|
194
|
+
status: output.response.status,
|
|
195
|
+
msg: output.response.msg,
|
|
196
|
+
result: output.response.result
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Delete recording
|
|
201
|
+
* @param params: DeleteRecordingsParams
|
|
202
|
+
* @returns Promise<DeleteRecordingsResponse>
|
|
203
|
+
*/ async deleteRecordings(params) {
|
|
204
|
+
const output = await (0, $74b0cf9d3dbd5b46$export$d5a1e65f8aa21b51)("/recording/delete", params);
|
|
205
|
+
if (!output.status) return {
|
|
206
|
+
status: false,
|
|
207
|
+
msg: output.response
|
|
208
|
+
};
|
|
209
|
+
return {
|
|
210
|
+
status: output.response.status,
|
|
211
|
+
msg: output.response.msg
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* @returns Promise<ClientFilesResponse>
|
|
216
|
+
*/ async getClientFiles() {
|
|
217
|
+
const output = await (0, $74b0cf9d3dbd5b46$export$d5a1e65f8aa21b51)("/getClientFiles", {});
|
|
218
|
+
if (!output.status) return {
|
|
219
|
+
status: false,
|
|
220
|
+
msg: output.response
|
|
221
|
+
};
|
|
222
|
+
return {
|
|
223
|
+
status: output.response.status,
|
|
224
|
+
msg: output.response.msg,
|
|
225
|
+
css: output.response.css,
|
|
226
|
+
js: output.response.js
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Generate token to download recording
|
|
231
|
+
* @param params: RecordingDownloadTokenParams
|
|
232
|
+
* @returns Promise<RecordingDownloadTokenResponse>
|
|
233
|
+
*/ async getRecordingDownloadToken(params) {
|
|
234
|
+
const output = await (0, $74b0cf9d3dbd5b46$export$d5a1e65f8aa21b51)("/recording/getDownloadToken", params);
|
|
235
|
+
if (!output.status) return {
|
|
236
|
+
status: false,
|
|
237
|
+
msg: output.response
|
|
238
|
+
};
|
|
239
|
+
return {
|
|
240
|
+
status: output.response.status,
|
|
241
|
+
msg: output.response.msg,
|
|
242
|
+
token: output.response.token
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
//# sourceMappingURL=PlugNmeet.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;ACAA;;;;;AAIA,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OAAO,OAAO,QAAQ,CAAC,KAAK;QAC9B;IACF;AACF","sources":["src/PlugNmeet.ts","src/api.ts"],"sourcesContent":["import { prepareAPI, sendRequest } from './api';\nimport { CreateRoomParams, CreateRoomResponse } from './types/createRoom';\nimport { JoinTokenParams, JoinTokenResponse } from './types/joinToken';\nimport { IsRoomActiveParams, IsRoomActiveResponse } from './types/isRoomActive';\nimport {\n ActiveRoomInfoParams,\n ActiveRoomInfoResponse,\n} from './types/activeRoomInfo';\nimport { ActiveRoomsInfoResponse } from './types/activeRoomsInfo';\nimport { EndRoomParams, EndRoomResponse } from './types/endRoom';\nimport {\n FetchRecordingsParams,\n FetchRecordingsResponse,\n} from './types/fetchRecordings';\nimport {\n DeleteRecordingsParams,\n DeleteRecordingsResponse,\n} from './types/deleteRecordings';\nimport {\n RecordingDownloadTokenParams,\n RecordingDownloadTokenResponse,\n} from './types/RecordingDownloadToken';\nimport { ClientFilesResponse } from './types/clientFiles';\n\nexport class PlugNmeet {\n protected defaultPath = '/auth';\n\n /**\n * @param serverUrl plugNmeet server URL\n * @param apiKey plugNmeet API_Key\n * @param apiSecret plugNmeet API_Secret\n */\n constructor(serverUrl: string, apiKey: string, apiSecret: string) {\n prepareAPI(serverUrl + this.defaultPath, apiKey, apiSecret);\n }\n\n /**\n * Create new room\n * @param params: CreateRoomParams\n * @returns Promise<CreateRoomResponse>\n */\n public async createRoom(\n params: CreateRoomParams,\n ): Promise<CreateRoomResponse> {\n const output = await sendRequest('/room/create', params);\n if (!output.status) {\n return {\n status: false,\n msg: output.response,\n };\n }\n\n return {\n status: output.response.status,\n msg: output.response.msg,\n roomInfo: output.response.roomInfo,\n };\n }\n\n /**\n * Generate join token\n * @param params: JoinTokenParams\n * @returns Promise<JoinTokenResponse>\n */\n public async getJoinToken(\n params: JoinTokenParams,\n ): Promise<JoinTokenResponse> {\n const output = await sendRequest('/room/getJoinToken', params);\n if (!output.status) {\n return {\n status: false,\n msg: output.response,\n };\n }\n\n return {\n status: output.response.status,\n msg: output.response.msg,\n token: output.response.token,\n };\n }\n\n /**\n * If room is active or not\n * @param params: IsRoomActiveParams\n * @returns Promise<IsRoomActiveResponse>\n */\n public async isRoomActive(\n params: IsRoomActiveParams,\n ): Promise<IsRoomActiveResponse> {\n const output = await sendRequest('/room/isRoomActive', params);\n if (!output.status) {\n return {\n status: false,\n msg: output.response,\n };\n }\n\n return {\n status: output.response.status,\n msg: output.response.msg,\n };\n }\n\n /**\n * Get active room information\n * @param params: ActiveRoomInfoParams\n * @returns Promise<ActiveRoomInfoResponse>\n */\n public async getActiveRoomInfo(\n params: ActiveRoomInfoParams,\n ): Promise<ActiveRoomInfoResponse> {\n const output = await sendRequest('/room/getActiveRoomInfo', params);\n if (!output.status) {\n return {\n status: false,\n msg: output.response,\n };\n }\n\n return {\n status: output.response.status,\n msg: output.response.msg,\n room: output.response.room,\n };\n }\n\n /**\n * Get all active rooms\n * @returns Promise<ActiveRoomsInfoResponse>\n */\n public async getActiveRoomsInfo(): Promise<ActiveRoomsInfoResponse> {\n const output = await sendRequest('/room/getActiveRoomsInfo', {});\n if (!output.status) {\n return {\n status: false,\n msg: output.response,\n };\n }\n\n return {\n status: output.response.status,\n msg: output.response.msg,\n rooms: output.response.rooms,\n };\n }\n\n /**\n * End active room\n * @param params: EndRoomParams\n * @returns Promise<EndRoomResponse>\n */\n public async endRoom(params: EndRoomParams): Promise<EndRoomResponse> {\n const output = await sendRequest('/room/endRoom', params);\n if (!output.status) {\n return {\n status: false,\n msg: output.response,\n };\n }\n\n return {\n status: output.response.status,\n msg: output.response.msg,\n };\n }\n\n /**\n * Fetch recordings\n * @param params: FetchRecordingsParams\n * @returns Promise<FetchRecordingsResponse>\n */\n public async fetchRecordings(\n params: FetchRecordingsParams,\n ): Promise<FetchRecordingsResponse> {\n const output = await sendRequest('/recording/fetch', params);\n if (!output.status) {\n return {\n status: false,\n msg: output.response,\n };\n }\n\n return {\n status: output.response.status,\n msg: output.response.msg,\n result: output.response.result,\n };\n }\n\n /**\n * Delete recording\n * @param params: DeleteRecordingsParams\n * @returns Promise<DeleteRecordingsResponse>\n */\n public async deleteRecordings(\n params: DeleteRecordingsParams,\n ): Promise<DeleteRecordingsResponse> {\n const output = await sendRequest('/recording/delete', params);\n if (!output.status) {\n return {\n status: false,\n msg: output.response,\n };\n }\n\n return {\n status: output.response.status,\n msg: output.response.msg,\n };\n }\n\n /**\n * @returns Promise<ClientFilesResponse>\n */\n public async getClientFiles(): Promise<ClientFilesResponse> {\n const output = await sendRequest('/getClientFiles', {});\n if (!output.status) {\n return {\n status: false,\n msg: output.response,\n };\n }\n\n return {\n status: output.response.status,\n msg: output.response.msg,\n css: output.response.css,\n js: output.response.js,\n };\n }\n\n /**\n * Generate token to download recording\n * @param params: RecordingDownloadTokenParams\n * @returns Promise<RecordingDownloadTokenResponse>\n */\n public async getRecordingDownloadToken(\n params: RecordingDownloadTokenParams,\n ): Promise<RecordingDownloadTokenResponse> {\n const output = await sendRequest('/recording/getDownloadToken', params);\n if (!output.status) {\n return {\n status: false,\n msg: output.response,\n };\n }\n\n return {\n status: output.response.status,\n msg: output.response.msg,\n token: output.response.token,\n };\n }\n}\n","import http from 'http';\nimport https, { RequestOptions } from 'https';\nimport { createHmac } from 'crypto';\n\nlet mainOptions: RequestOptions,\n isSecure = true, _apiKey = \"\", _apiSecret = \"\";\n\nexport type APIResponse = {\n status: boolean;\n response: any;\n};\n\nexport const prepareAPI = (\n apiEndPointURL: string,\n apiKey: string,\n apiSecret: string,\n) => {\n _apiKey = apiKey;\n _apiSecret = apiSecret;\n\n const url = new URL(apiEndPointURL);\n let port = url.protocol === 'https:' ? 443 : 80;\n isSecure = url.protocol === 'https:' ?? false;\n\n // use port if supplied with url\n if (url.port) {\n port = Number(url.port);\n }\n\n mainOptions = {\n hostname: url.hostname,\n path: url.pathname,\n method: 'POST',\n port,\n };\n};\n\nconst prepareHeader = (body: string) => {\n const signature = createHmac('sha256', _apiSecret)\n .update(body)\n .digest('hex');\n\n const headers = {\n 'Content-Type': 'application/json',\n 'API-KEY': _apiKey,\n 'HASH-SIGNATURE': signature,\n };\n\n return headers;\n};\n\nexport const sendRequest = async (path: string, body: any) => {\n return new Promise<APIResponse>((resolve) => {\n const output: APIResponse = {\n status: false,\n response: undefined,\n };\n\n const chunk = JSON.stringify(body);\n\n const options = { ...mainOptions };\n options.path += path;\n options.headers = prepareHeader(chunk);\n\n const req = (isSecure ? https : http).request(options, (res) => {\n const body: Array<Uint8Array> = [];\n res.on('data', (chunk) => body.push(chunk));\n\n res.on('end', () => {\n const resString = Buffer.concat(body).toString();\n\n try {\n output.status = true;\n output.response = JSON.parse(resString);\n } catch (error) {\n output.status = false;\n output.response = error;\n }\n\n resolve(output);\n });\n });\n\n req.on('error', (error) => {\n output.response = error.message;\n resolve(output);\n });\n\n req.write(chunk);\n req.end();\n });\n};\n"],"names":[],"version":3,"file":"PlugNmeet.cjs.map"}
|
package/dist/PlugNmeet.js
CHANGED
|
@@ -1,198 +1,245 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var $d6kgz$http = require("http");
|
|
2
|
+
var $d6kgz$https = require("https");
|
|
3
|
+
var $d6kgz$crypto = require("crypto");
|
|
4
|
+
|
|
5
|
+
function $parcel$export(e, n, v, s) {
|
|
6
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
|
+
}
|
|
8
|
+
function $parcel$interopDefault(a) {
|
|
9
|
+
return a && a.__esModule ? a.default : a;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
$parcel$export(module.exports, "PlugNmeet", () => $8e30a24c4952589a$export$1402da7f2870faee);
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
let $9f73057a20513a82$var$mainOptions, $9f73057a20513a82$var$isSecure = true, $9f73057a20513a82$var$_apiKey = "", $9f73057a20513a82$var$_apiSecret = "";
|
|
17
|
+
const $9f73057a20513a82$export$84c28a9528d0e9cd = (apiEndPointURL, apiKey, apiSecret)=>{
|
|
18
|
+
$9f73057a20513a82$var$_apiKey = apiKey;
|
|
19
|
+
$9f73057a20513a82$var$_apiSecret = apiSecret;
|
|
20
|
+
const url = new URL(apiEndPointURL);
|
|
21
|
+
let port = url.protocol === "https:" ? 443 : 80;
|
|
22
|
+
$9f73057a20513a82$var$isSecure = (url.protocol === "https:") ?? false;
|
|
23
|
+
// use port if supplied with url
|
|
24
|
+
if (url.port) port = Number(url.port);
|
|
25
|
+
$9f73057a20513a82$var$mainOptions = {
|
|
26
|
+
hostname: url.hostname,
|
|
27
|
+
path: url.pathname,
|
|
28
|
+
method: "POST",
|
|
29
|
+
port: port
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const $9f73057a20513a82$var$prepareHeader = (body)=>{
|
|
33
|
+
const signature = (0, $d6kgz$crypto.createHmac)("sha256", $9f73057a20513a82$var$_apiSecret).update(body).digest("hex");
|
|
34
|
+
const headers = {
|
|
35
|
+
"Content-Type": "application/json",
|
|
36
|
+
"API-KEY": $9f73057a20513a82$var$_apiKey,
|
|
37
|
+
"HASH-SIGNATURE": signature
|
|
38
|
+
};
|
|
39
|
+
return headers;
|
|
40
|
+
};
|
|
41
|
+
const $9f73057a20513a82$export$d5a1e65f8aa21b51 = async (path, body)=>{
|
|
42
|
+
return new Promise((resolve)=>{
|
|
43
|
+
const output = {
|
|
44
|
+
status: false,
|
|
45
|
+
response: undefined
|
|
46
|
+
};
|
|
47
|
+
const chunk = JSON.stringify(body);
|
|
48
|
+
const options = {
|
|
49
|
+
...$9f73057a20513a82$var$mainOptions
|
|
50
|
+
};
|
|
51
|
+
options.path += path;
|
|
52
|
+
options.headers = $9f73057a20513a82$var$prepareHeader(chunk);
|
|
53
|
+
const req = ($9f73057a20513a82$var$isSecure ? (0, ($parcel$interopDefault($d6kgz$https))) : (0, ($parcel$interopDefault($d6kgz$http)))).request(options, (res)=>{
|
|
54
|
+
const body = [];
|
|
55
|
+
res.on("data", (chunk)=>body.push(chunk));
|
|
56
|
+
res.on("end", ()=>{
|
|
57
|
+
const resString = Buffer.concat(body).toString();
|
|
58
|
+
try {
|
|
59
|
+
output.status = true;
|
|
60
|
+
output.response = JSON.parse(resString);
|
|
61
|
+
} catch (error) {
|
|
62
|
+
output.status = false;
|
|
63
|
+
output.response = error;
|
|
64
|
+
}
|
|
65
|
+
resolve(output);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
req.on("error", (error)=>{
|
|
69
|
+
output.response = error.message;
|
|
70
|
+
resolve(output);
|
|
71
|
+
});
|
|
72
|
+
req.write(chunk);
|
|
73
|
+
req.end();
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class $8e30a24c4952589a$export$1402da7f2870faee {
|
|
79
|
+
defaultPath = "/auth";
|
|
3
80
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this.defaultPath = '/auth';
|
|
10
|
-
prepareAPI(serverUrl + this.defaultPath, apiKey, apiSecret);
|
|
81
|
+
* @param serverUrl plugNmeet server URL
|
|
82
|
+
* @param apiKey plugNmeet API_Key
|
|
83
|
+
* @param apiSecret plugNmeet API_Secret
|
|
84
|
+
*/ constructor(serverUrl, apiKey, apiSecret){
|
|
85
|
+
(0, $9f73057a20513a82$export$84c28a9528d0e9cd)(serverUrl + this.defaultPath, apiKey, apiSecret);
|
|
11
86
|
}
|
|
12
87
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
msg: output.response,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
88
|
+
* Create new room
|
|
89
|
+
* @param params: CreateRoomParams
|
|
90
|
+
* @returns Promise<CreateRoomResponse>
|
|
91
|
+
*/ async createRoom(params) {
|
|
92
|
+
const output = await (0, $9f73057a20513a82$export$d5a1e65f8aa21b51)("/room/create", params);
|
|
93
|
+
if (!output.status) return {
|
|
94
|
+
status: false,
|
|
95
|
+
msg: output.response
|
|
96
|
+
};
|
|
25
97
|
return {
|
|
26
98
|
status: output.response.status,
|
|
27
99
|
msg: output.response.msg,
|
|
28
|
-
roomInfo: output.response.roomInfo
|
|
100
|
+
roomInfo: output.response.roomInfo
|
|
29
101
|
};
|
|
30
102
|
}
|
|
31
103
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
msg: output.response,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
104
|
+
* Generate join token
|
|
105
|
+
* @param params: JoinTokenParams
|
|
106
|
+
* @returns Promise<JoinTokenResponse>
|
|
107
|
+
*/ async getJoinToken(params) {
|
|
108
|
+
const output = await (0, $9f73057a20513a82$export$d5a1e65f8aa21b51)("/room/getJoinToken", params);
|
|
109
|
+
if (!output.status) return {
|
|
110
|
+
status: false,
|
|
111
|
+
msg: output.response
|
|
112
|
+
};
|
|
44
113
|
return {
|
|
45
114
|
status: output.response.status,
|
|
46
115
|
msg: output.response.msg,
|
|
47
|
-
token: output.response.token
|
|
116
|
+
token: output.response.token
|
|
48
117
|
};
|
|
49
118
|
}
|
|
50
119
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
msg: output.response,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
120
|
+
* If room is active or not
|
|
121
|
+
* @param params: IsRoomActiveParams
|
|
122
|
+
* @returns Promise<IsRoomActiveResponse>
|
|
123
|
+
*/ async isRoomActive(params) {
|
|
124
|
+
const output = await (0, $9f73057a20513a82$export$d5a1e65f8aa21b51)("/room/isRoomActive", params);
|
|
125
|
+
if (!output.status) return {
|
|
126
|
+
status: false,
|
|
127
|
+
msg: output.response
|
|
128
|
+
};
|
|
63
129
|
return {
|
|
64
130
|
status: output.response.status,
|
|
65
|
-
msg: output.response.msg
|
|
131
|
+
msg: output.response.msg
|
|
66
132
|
};
|
|
67
133
|
}
|
|
68
134
|
/**
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
msg: output.response,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
135
|
+
* Get active room information
|
|
136
|
+
* @param params: ActiveRoomInfoParams
|
|
137
|
+
* @returns Promise<ActiveRoomInfoResponse>
|
|
138
|
+
*/ async getActiveRoomInfo(params) {
|
|
139
|
+
const output = await (0, $9f73057a20513a82$export$d5a1e65f8aa21b51)("/room/getActiveRoomInfo", params);
|
|
140
|
+
if (!output.status) return {
|
|
141
|
+
status: false,
|
|
142
|
+
msg: output.response
|
|
143
|
+
};
|
|
81
144
|
return {
|
|
82
145
|
status: output.response.status,
|
|
83
146
|
msg: output.response.msg,
|
|
84
|
-
room: output.response.room
|
|
147
|
+
room: output.response.room
|
|
85
148
|
};
|
|
86
149
|
}
|
|
87
150
|
/**
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
msg: output.response,
|
|
97
|
-
};
|
|
98
|
-
}
|
|
151
|
+
* Get all active rooms
|
|
152
|
+
* @returns Promise<ActiveRoomsInfoResponse>
|
|
153
|
+
*/ async getActiveRoomsInfo() {
|
|
154
|
+
const output = await (0, $9f73057a20513a82$export$d5a1e65f8aa21b51)("/room/getActiveRoomsInfo", {});
|
|
155
|
+
if (!output.status) return {
|
|
156
|
+
status: false,
|
|
157
|
+
msg: output.response
|
|
158
|
+
};
|
|
99
159
|
return {
|
|
100
160
|
status: output.response.status,
|
|
101
161
|
msg: output.response.msg,
|
|
102
|
-
rooms: output.response.rooms
|
|
162
|
+
rooms: output.response.rooms
|
|
103
163
|
};
|
|
104
164
|
}
|
|
105
165
|
/**
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
msg: output.response,
|
|
116
|
-
};
|
|
117
|
-
}
|
|
166
|
+
* End active room
|
|
167
|
+
* @param params: EndRoomParams
|
|
168
|
+
* @returns Promise<EndRoomResponse>
|
|
169
|
+
*/ async endRoom(params) {
|
|
170
|
+
const output = await (0, $9f73057a20513a82$export$d5a1e65f8aa21b51)("/room/endRoom", params);
|
|
171
|
+
if (!output.status) return {
|
|
172
|
+
status: false,
|
|
173
|
+
msg: output.response
|
|
174
|
+
};
|
|
118
175
|
return {
|
|
119
176
|
status: output.response.status,
|
|
120
|
-
msg: output.response.msg
|
|
177
|
+
msg: output.response.msg
|
|
121
178
|
};
|
|
122
179
|
}
|
|
123
180
|
/**
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
msg: output.response,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
181
|
+
* Fetch recordings
|
|
182
|
+
* @param params: FetchRecordingsParams
|
|
183
|
+
* @returns Promise<FetchRecordingsResponse>
|
|
184
|
+
*/ async fetchRecordings(params) {
|
|
185
|
+
const output = await (0, $9f73057a20513a82$export$d5a1e65f8aa21b51)("/recording/fetch", params);
|
|
186
|
+
if (!output.status) return {
|
|
187
|
+
status: false,
|
|
188
|
+
msg: output.response
|
|
189
|
+
};
|
|
136
190
|
return {
|
|
137
191
|
status: output.response.status,
|
|
138
192
|
msg: output.response.msg,
|
|
139
|
-
result: output.response.result
|
|
193
|
+
result: output.response.result
|
|
140
194
|
};
|
|
141
195
|
}
|
|
142
196
|
/**
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
msg: output.response,
|
|
153
|
-
};
|
|
154
|
-
}
|
|
197
|
+
* Delete recording
|
|
198
|
+
* @param params: DeleteRecordingsParams
|
|
199
|
+
* @returns Promise<DeleteRecordingsResponse>
|
|
200
|
+
*/ async deleteRecordings(params) {
|
|
201
|
+
const output = await (0, $9f73057a20513a82$export$d5a1e65f8aa21b51)("/recording/delete", params);
|
|
202
|
+
if (!output.status) return {
|
|
203
|
+
status: false,
|
|
204
|
+
msg: output.response
|
|
205
|
+
};
|
|
155
206
|
return {
|
|
156
207
|
status: output.response.status,
|
|
157
|
-
msg: output.response.msg
|
|
208
|
+
msg: output.response.msg
|
|
158
209
|
};
|
|
159
210
|
}
|
|
160
211
|
/**
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
msg: output.response,
|
|
169
|
-
};
|
|
170
|
-
}
|
|
212
|
+
* @returns Promise<ClientFilesResponse>
|
|
213
|
+
*/ async getClientFiles() {
|
|
214
|
+
const output = await (0, $9f73057a20513a82$export$d5a1e65f8aa21b51)("/getClientFiles", {});
|
|
215
|
+
if (!output.status) return {
|
|
216
|
+
status: false,
|
|
217
|
+
msg: output.response
|
|
218
|
+
};
|
|
171
219
|
return {
|
|
172
220
|
status: output.response.status,
|
|
173
221
|
msg: output.response.msg,
|
|
174
222
|
css: output.response.css,
|
|
175
|
-
js: output.response.js
|
|
223
|
+
js: output.response.js
|
|
176
224
|
};
|
|
177
225
|
}
|
|
178
226
|
/**
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
msg: output.response,
|
|
189
|
-
};
|
|
190
|
-
}
|
|
227
|
+
* Generate token to download recording
|
|
228
|
+
* @param params: RecordingDownloadTokenParams
|
|
229
|
+
* @returns Promise<RecordingDownloadTokenResponse>
|
|
230
|
+
*/ async getRecordingDownloadToken(params) {
|
|
231
|
+
const output = await (0, $9f73057a20513a82$export$d5a1e65f8aa21b51)("/recording/getDownloadToken", params);
|
|
232
|
+
if (!output.status) return {
|
|
233
|
+
status: false,
|
|
234
|
+
msg: output.response
|
|
235
|
+
};
|
|
191
236
|
return {
|
|
192
237
|
status: output.response.status,
|
|
193
238
|
msg: output.response.msg,
|
|
194
|
-
token: output.response.token
|
|
239
|
+
token: output.response.token
|
|
195
240
|
};
|
|
196
241
|
}
|
|
197
242
|
}
|
|
198
|
-
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
//# sourceMappingURL=PlugNmeet.js.map
|