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/package.json
CHANGED
|
@@ -1,36 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plugnmeet-sdk-js",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "plugNmeet JS SDK",
|
|
5
5
|
"author": "Jibon L. Costa",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"require": "./dist/cjs/index.js"
|
|
13
|
-
},
|
|
7
|
+
"repository": "https://github.com/mynaparrot/plugNmeet-sdk-js",
|
|
8
|
+
"source": "src/PlugNmeet.ts",
|
|
9
|
+
"main": "dist/PlugNmeet.cjs",
|
|
10
|
+
"module": "dist/PlugNmeet.mjs",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
14
12
|
"files": [
|
|
15
13
|
"dist",
|
|
16
|
-
"
|
|
14
|
+
"LICENSE",
|
|
15
|
+
"README.md"
|
|
17
16
|
],
|
|
18
17
|
"scripts": {
|
|
19
18
|
"start": "rm -rf ./dist && concurrently -c \"red,green\" --kill-others \"tsc --watch -p . --outDir ./dist && esw -w --ext '.ts','.js' --fix\"",
|
|
20
|
-
"build": "rm -rf ./dist &&
|
|
19
|
+
"build": "rm -rf ./dist && parcel build",
|
|
21
20
|
"build-docs": "typedoc --sort source-order"
|
|
22
21
|
},
|
|
22
|
+
"targets": {
|
|
23
|
+
"node": {
|
|
24
|
+
"isLibrary": true,
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">= 16"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
23
30
|
"devDependencies": {
|
|
24
|
-
"@
|
|
25
|
-
"@typescript-
|
|
26
|
-
"@
|
|
27
|
-
"
|
|
28
|
-
"eslint": "
|
|
29
|
-
"
|
|
31
|
+
"@parcel/packager-ts": "^2.8.3",
|
|
32
|
+
"@parcel/transformer-typescript-types": "^2.8.3",
|
|
33
|
+
"@types/node": "^18.15.11",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "5.58.0",
|
|
35
|
+
"@typescript-eslint/parser": "5.58.0",
|
|
36
|
+
"concurrently": "8.0.1",
|
|
37
|
+
"eslint": "8.38.0",
|
|
38
|
+
"eslint-config-prettier": "8.8.0",
|
|
30
39
|
"eslint-plugin-prettier": "4.2.1",
|
|
31
40
|
"eslint-watch": "8.0.0",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
41
|
+
"parcel": "^2.8.3",
|
|
42
|
+
"prettier": "2.8.7",
|
|
43
|
+
"typedoc": "0.24.1",
|
|
44
|
+
"typescript": "5.0.4"
|
|
35
45
|
}
|
|
36
|
-
}
|
|
46
|
+
}
|
package/dist/PlugNmeet.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/api.d.ts
DELETED
package/dist/api.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import http from 'http';
|
|
2
|
-
import https from 'https';
|
|
3
|
-
import { createHmac } from 'crypto';
|
|
4
|
-
let mainOptions, isSecure = true, _apiKey = "", _apiSecret = "";
|
|
5
|
-
export const prepareAPI = (apiEndPointURL, apiKey, apiSecret) => {
|
|
6
|
-
_apiKey = apiKey;
|
|
7
|
-
_apiSecret = apiSecret;
|
|
8
|
-
const url = new URL(apiEndPointURL);
|
|
9
|
-
let port = url.protocol === 'https:' ? 443 : 80;
|
|
10
|
-
isSecure = url.protocol === 'https:' ?? false;
|
|
11
|
-
// use port if supplied with url
|
|
12
|
-
if (url.port) {
|
|
13
|
-
port = Number(url.port);
|
|
14
|
-
}
|
|
15
|
-
mainOptions = {
|
|
16
|
-
hostname: url.hostname,
|
|
17
|
-
path: url.pathname,
|
|
18
|
-
method: 'POST',
|
|
19
|
-
port,
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
const prepareHeader = (body) => {
|
|
23
|
-
const signature = createHmac('sha256', _apiSecret)
|
|
24
|
-
.update(body)
|
|
25
|
-
.digest('hex');
|
|
26
|
-
const headers = {
|
|
27
|
-
'Content-Type': 'application/json',
|
|
28
|
-
'API-KEY': _apiKey,
|
|
29
|
-
'HASH-SIGNATURE': signature,
|
|
30
|
-
};
|
|
31
|
-
return headers;
|
|
32
|
-
};
|
|
33
|
-
export const sendRequest = async (path, body) => {
|
|
34
|
-
return new Promise((resolve) => {
|
|
35
|
-
const output = {
|
|
36
|
-
status: false,
|
|
37
|
-
response: undefined,
|
|
38
|
-
};
|
|
39
|
-
const chunk = JSON.stringify(body);
|
|
40
|
-
const options = { ...mainOptions };
|
|
41
|
-
options.path += path;
|
|
42
|
-
options.headers = prepareHeader(chunk);
|
|
43
|
-
const req = (isSecure ? https : http).request(options, (res) => {
|
|
44
|
-
const body = [];
|
|
45
|
-
res.on('data', (chunk) => body.push(chunk));
|
|
46
|
-
res.on('end', () => {
|
|
47
|
-
const resString = Buffer.concat(body).toString();
|
|
48
|
-
try {
|
|
49
|
-
output.status = true;
|
|
50
|
-
output.response = JSON.parse(resString);
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
output.status = false;
|
|
54
|
-
output.response = error;
|
|
55
|
-
}
|
|
56
|
-
resolve(output);
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
req.on('error', (error) => {
|
|
60
|
-
output.response = error.message;
|
|
61
|
-
resolve(output);
|
|
62
|
-
});
|
|
63
|
-
req.write(chunk);
|
|
64
|
-
req.end();
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAyB,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,IAAI,WAA2B,EAC7B,QAAQ,GAAG,IAAI,EAAE,OAAO,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,CAAC;AAOjD,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,cAAsB,EACtB,MAAc,EACd,SAAiB,EACjB,EAAE;IACF,OAAO,GAAG,MAAM,CAAC;IACjB,UAAU,GAAG,SAAS,CAAC;IAEvB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,CAAC;IACpC,IAAI,IAAI,GAAG,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAChD,QAAQ,GAAG,GAAG,CAAC,QAAQ,KAAK,QAAQ,IAAI,KAAK,CAAC;IAE9C,gCAAgC;IAChC,IAAI,GAAG,CAAC,IAAI,EAAE;QACZ,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;KACzB;IAED,WAAW,GAAG;QACZ,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,IAAI,EAAE,GAAG,CAAC,QAAQ;QAClB,MAAM,EAAE,MAAM;QACd,IAAI;KACL,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,aA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MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;oBACrB,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;iBACzC;gBAAC,OAAO,KAAK,EAAE;oBACd,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC;oBACtB,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC;iBACzB;gBAED,OAAO,CAAC,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,CAAC"}
|
package/dist/cjs/PlugNmeet.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/cjs/PlugNmeet.js
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,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,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ;aACnC,CAAC;QACJ,CAAC;KAAA;IAED;;;;OAIG;IACU,YAAY,CACvB,MAAuB;;YAEvB,MAAM,MAAM,GAAG,MAAM,IAAA,iBAAW,EAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;YAC/D,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,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cjs/api.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
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
|
-
});
|
|
83
|
-
});
|
|
84
|
-
exports.sendRequest = sendRequest;
|
|
85
|
-
//# sourceMappingURL=api.js.map
|
package/dist/cjs/api.js.map
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AAC;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"}
|
package/dist/cjs/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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';
|
package/dist/cjs/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AA+CA,yCAAwC;AAA/B,sGAAA,SAAS,OAAA"}
|