plugnmeet-sdk-js 1.0.1 → 1.0.2
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/PlugNmeet.d.ts +5 -0
- package/PlugNmeet.js +20 -0
- package/README.md +1 -0
- package/api.js +18 -8
- package/index.d.ts +2 -1
- package/package.json +12 -12
- package/types/clientFiles.d.ts +6 -0
- package/types/clientFiles.js +2 -0
package/PlugNmeet.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { EndRoomParams, EndRoomResponse } from './types/endRoom';
|
|
|
7
7
|
import { FetchRecordingsParams, FetchRecordingsResponse } from './types/fetchRecordings';
|
|
8
8
|
import { DeleteRecordingsParams, DeleteRecordingsResponse } from './types/deleteRecordings';
|
|
9
9
|
import { RecordingDownloadTokenParams, RecordingDownloadTokenResponse } from './types/RecordingDownloadToken';
|
|
10
|
+
import { ClientFilesResponse } from './types/clientFiles';
|
|
10
11
|
export declare class PlugNmeet {
|
|
11
12
|
protected defaultPath: string;
|
|
12
13
|
/**
|
|
@@ -62,6 +63,10 @@ export declare class PlugNmeet {
|
|
|
62
63
|
* @returns Promise<DeleteRecordingsResponse>
|
|
63
64
|
*/
|
|
64
65
|
deleteRecordings(params: DeleteRecordingsParams): Promise<DeleteRecordingsResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* @returns Promise<ClientFilesResponse>
|
|
68
|
+
*/
|
|
69
|
+
getClientFiles(): Promise<ClientFilesResponse>;
|
|
65
70
|
/**
|
|
66
71
|
* Generate token to download recording
|
|
67
72
|
* @param params: RecordingDownloadTokenParams
|
package/PlugNmeet.js
CHANGED
|
@@ -185,6 +185,26 @@ class PlugNmeet {
|
|
|
185
185
|
};
|
|
186
186
|
});
|
|
187
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
|
+
}
|
|
188
208
|
/**
|
|
189
209
|
* Generate token to download recording
|
|
190
210
|
* @param params: RecordingDownloadTokenParams
|
package/README.md
CHANGED
|
@@ -52,3 +52,4 @@ Please check `examples` directory to see some examples.
|
|
|
52
52
|
| [fetchRecordings](https://mynaparrot.github.io/plugNmeet-sdk-js/classes/PlugNmeet.html#fetchRecordings) | Fetch recordings |
|
|
53
53
|
| [deleteRecordings](https://mynaparrot.github.io/plugNmeet-sdk-js/classes/PlugNmeet.html#deleteRecordings) | Delete recording |
|
|
54
54
|
| [getRecordingDownloadToken](https://mynaparrot.github.io/plugNmeet-sdk-js/classes/PlugNmeet.html#getRecordingDownloadToken) | Generate token to download recording |
|
|
55
|
+
| [getClientFiles](https://mynaparrot.github.io/plugNmeet-sdk-js/classes/PlugNmeet.html#getClientFiles) | Get client's files |
|
package/api.js
CHANGED
|
@@ -15,14 +15,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.sendRequest = exports.prepareAPI = void 0;
|
|
16
16
|
const http_1 = __importDefault(require("http"));
|
|
17
17
|
const https_1 = __importDefault(require("https"));
|
|
18
|
-
|
|
18
|
+
const crypto_1 = require("crypto");
|
|
19
|
+
let mainOptions, isSecure = true, _apiKey = "", _apiSecret = "";
|
|
19
20
|
const prepareAPI = (apiEndPointURL, apiKey, apiSecret) => {
|
|
20
21
|
var _a;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'API-KEY': apiKey,
|
|
24
|
-
'API-SECRET': apiSecret,
|
|
25
|
-
};
|
|
22
|
+
_apiKey = apiKey;
|
|
23
|
+
_apiSecret = apiSecret;
|
|
26
24
|
const url = new URL(apiEndPointURL);
|
|
27
25
|
let port = url.protocol === 'https:' ? 443 : 80;
|
|
28
26
|
isSecure = (_a = url.protocol === 'https:') !== null && _a !== void 0 ? _a : false;
|
|
@@ -35,18 +33,30 @@ const prepareAPI = (apiEndPointURL, apiKey, apiSecret) => {
|
|
|
35
33
|
path: url.pathname,
|
|
36
34
|
method: 'POST',
|
|
37
35
|
port,
|
|
38
|
-
headers,
|
|
39
36
|
};
|
|
40
37
|
};
|
|
41
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
|
+
};
|
|
42
50
|
const sendRequest = (path, body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
51
|
return new Promise((resolve) => {
|
|
44
52
|
const output = {
|
|
45
53
|
status: false,
|
|
46
54
|
response: undefined,
|
|
47
55
|
};
|
|
56
|
+
const chunk = JSON.stringify(body);
|
|
48
57
|
const options = Object.assign({}, mainOptions);
|
|
49
58
|
options.path += path;
|
|
59
|
+
options.headers = prepareHeader(chunk);
|
|
50
60
|
const req = (isSecure ? https_1.default : http_1.default).request(options, (res) => {
|
|
51
61
|
const body = [];
|
|
52
62
|
res.on('data', (chunk) => body.push(chunk));
|
|
@@ -67,7 +77,7 @@ const sendRequest = (path, body) => __awaiter(void 0, void 0, void 0, function*
|
|
|
67
77
|
output.response = error.message;
|
|
68
78
|
resolve(output);
|
|
69
79
|
});
|
|
70
|
-
req.write(
|
|
80
|
+
req.write(chunk);
|
|
71
81
|
req.end();
|
|
72
82
|
});
|
|
73
83
|
});
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { RooMetadata, CreateRoomParams, CreateRoomResponse, CreateRoomResponseRoomInfo, LockSettingsParams, RoomFeaturesParams, ChatFeaturesParams, SharedNotePadFeaturesParams, WhiteboardFeaturesParams, } from './types/createRoom';
|
|
1
|
+
export { RooMetadata, CreateRoomParams, CreateRoomResponse, CreateRoomResponseRoomInfo, LockSettingsParams, RoomFeaturesParams, ChatFeaturesParams, SharedNotePadFeaturesParams, WhiteboardFeaturesParams, ExternalMediaPlayerFeatures, WaitingRoomFeatures, BreakoutRoomFeatures, } from './types/createRoom';
|
|
2
2
|
export { JoinTokenParams, JoinTokenResponse, JoinTokenUserMetadata, JoinTokenUserInfo, } from './types/joinToken';
|
|
3
3
|
export { IsRoomActiveParams, IsRoomActiveResponse } from './types/isRoomActive';
|
|
4
4
|
export { Room, ActiveRoomInfoParams, ActiveRoomInfoResponse, ParticipantInfo, ActiveRoomInfo, } from './types/activeRoomInfo';
|
|
@@ -7,4 +7,5 @@ export { EndRoomParams, EndRoomResponse } from './types/endRoom';
|
|
|
7
7
|
export { FetchRecordingsParams, FetchRecordingsResponse, FetchRecordingsResult, RecordingInfo, } from './types/fetchRecordings';
|
|
8
8
|
export { DeleteRecordingsParams, DeleteRecordingsResponse, } from './types/deleteRecordings';
|
|
9
9
|
export { RecordingDownloadTokenParams, RecordingDownloadTokenResponse, } from './types/RecordingDownloadToken';
|
|
10
|
+
export { ClientFilesResponse } from './types/clientFiles';
|
|
10
11
|
export { PlugNmeet } from './PlugNmeet';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plugnmeet-sdk-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "plugNmeet JS SDK",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
"author": "Jibon L. Costa",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@types/node": "
|
|
15
|
-
"@typescript-eslint/eslint-plugin": "
|
|
16
|
-
"@typescript-eslint/parser": "
|
|
17
|
-
"concurrently": "
|
|
18
|
-
"eslint": "
|
|
19
|
-
"eslint-config-prettier": "
|
|
20
|
-
"eslint-plugin-prettier": "
|
|
21
|
-
"eslint-watch": "
|
|
22
|
-
"prettier": "
|
|
23
|
-
"typedoc": "
|
|
24
|
-
"typescript": "
|
|
14
|
+
"@types/node": "18.7.18",
|
|
15
|
+
"@typescript-eslint/eslint-plugin": "5.37.0",
|
|
16
|
+
"@typescript-eslint/parser": "5.37.0",
|
|
17
|
+
"concurrently": "7.4.0",
|
|
18
|
+
"eslint": "8.23.1",
|
|
19
|
+
"eslint-config-prettier": "8.5.0",
|
|
20
|
+
"eslint-plugin-prettier": "4.2.1",
|
|
21
|
+
"eslint-watch": "8.0.0",
|
|
22
|
+
"prettier": "2.7.1",
|
|
23
|
+
"typedoc": "0.23.14",
|
|
24
|
+
"typescript": "4.8.3"
|
|
25
25
|
}
|
|
26
26
|
}
|