plugnmeet-sdk-js 2.0.2-1 → 2.0.2-3
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/dist/index.cjs.js +334 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +334 -0
- package/dist/index.js.map +1 -0
- package/dist/{PlugNmeet.mjs.js → index.mjs.js} +76 -72
- package/dist/index.mjs.js.map +1 -0
- package/package.json +4 -4
- package/dist/PlugNmeet.cjs.js +0 -311
- package/dist/PlugNmeet.cjs.js.map +0 -1
- package/dist/PlugNmeet.js +0 -311
- package/dist/PlugNmeet.js.map +0 -1
- package/dist/PlugNmeet.mjs.js.map +0 -1
package/dist/PlugNmeet.js
DELETED
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
var $d6kgz$bufbuildprotobuf = require("@bufbuild/protobuf");
|
|
2
|
-
var $d6kgz$plugnmeetprotocoljs = require("plugnmeet-protocol-js");
|
|
3
|
-
var $d6kgz$axios = require("axios");
|
|
4
|
-
var $d6kgz$crypto = require("crypto");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function $parcel$export(e, n, v, s) {
|
|
8
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function $parcel$interopDefault(a) {
|
|
12
|
-
return a && a.__esModule ? a.default : a;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
$parcel$export(module.exports, "PlugNmeet", () => $8e30a24c4952589a$export$1402da7f2870faee);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class $3437a6ece6919767$export$5a82ec1641dd9681 {
|
|
21
|
-
constructor(apiEndPointURL, apiKey, apiSecret){
|
|
22
|
-
this.prepareHeader = (body)=>{
|
|
23
|
-
const signature = (0, $d6kgz$crypto.createHmac)('sha256', this.apiSecret).update(body).digest('hex');
|
|
24
|
-
return {
|
|
25
|
-
'API-KEY': this.apiKey,
|
|
26
|
-
'HASH-SIGNATURE': signature
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
this.sendRequest = async (path, body)=>{
|
|
30
|
-
const output = {
|
|
31
|
-
status: false,
|
|
32
|
-
response: undefined
|
|
33
|
-
};
|
|
34
|
-
const headers = this.prepareHeader(body);
|
|
35
|
-
try {
|
|
36
|
-
const res = await this.axios.post(path, body, {
|
|
37
|
-
headers: headers,
|
|
38
|
-
// Return the raw response string, preventing axios from decoding it.
|
|
39
|
-
// The protobuf `fromJson` method will handle the parsing.
|
|
40
|
-
transformResponse: [
|
|
41
|
-
(data)=>data
|
|
42
|
-
]
|
|
43
|
-
});
|
|
44
|
-
output.status = true;
|
|
45
|
-
output.response = res.data;
|
|
46
|
-
return output;
|
|
47
|
-
} catch (error) {
|
|
48
|
-
output.response = error.message;
|
|
49
|
-
if (error.response) output.response = error.response.data;
|
|
50
|
-
return output;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
this.apiKey = apiKey;
|
|
54
|
-
this.apiSecret = apiSecret;
|
|
55
|
-
this.axios = (0, ($parcel$interopDefault($d6kgz$axios))).create({
|
|
56
|
-
baseURL: apiEndPointURL,
|
|
57
|
-
headers: {
|
|
58
|
-
'Content-Type': 'application/json'
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
class $8e30a24c4952589a$export$1402da7f2870faee {
|
|
66
|
-
/**
|
|
67
|
-
* @param serverUrl plugNmeet server URL
|
|
68
|
-
* @param apiKey plugNmeet API_Key
|
|
69
|
-
* @param apiSecret plugNmeet API_Secret
|
|
70
|
-
*/ constructor(serverUrl, apiKey, apiSecret){
|
|
71
|
-
this.defaultPath = '/auth';
|
|
72
|
-
this.apiTransport = new (0, $3437a6ece6919767$export$5a82ec1641dd9681)(serverUrl + this.defaultPath, apiKey, apiSecret);
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Create new room
|
|
76
|
-
* @param params
|
|
77
|
-
* @returns Promise<CreateRoomRes>
|
|
78
|
-
*/ async createRoom(params) {
|
|
79
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.CreateRoomReqSchema), params);
|
|
80
|
-
const res = await this.apiTransport.sendRequest('/room/create', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.CreateRoomReqSchema), body));
|
|
81
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.CreateRoomResSchema));
|
|
82
|
-
if (!res.status) {
|
|
83
|
-
output.msg = res.response;
|
|
84
|
-
return output;
|
|
85
|
-
}
|
|
86
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.CreateRoomResSchema), res.response);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Generate join token
|
|
90
|
-
* @param params
|
|
91
|
-
* @returns Promise<GenerateTokenRes>
|
|
92
|
-
*/ async getJoinToken(params) {
|
|
93
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.GenerateTokenReqSchema), params);
|
|
94
|
-
const res = await this.apiTransport.sendRequest('/room/getJoinToken', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.GenerateTokenReqSchema), body));
|
|
95
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.GenerateTokenResSchema));
|
|
96
|
-
if (!res.status) {
|
|
97
|
-
output.msg = res.response;
|
|
98
|
-
return output;
|
|
99
|
-
}
|
|
100
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.GenerateTokenResSchema), res.response);
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* If room is active or not
|
|
104
|
-
* @param params
|
|
105
|
-
* @returns Promise<IsRoomActiveRes>
|
|
106
|
-
*/ async isRoomActive(params) {
|
|
107
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.IsRoomActiveReqSchema), params);
|
|
108
|
-
const res = await this.apiTransport.sendRequest('/room/isRoomActive', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.IsRoomActiveReqSchema), body));
|
|
109
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.IsRoomActiveResSchema));
|
|
110
|
-
if (!res.status) {
|
|
111
|
-
output.msg = res.response;
|
|
112
|
-
return output;
|
|
113
|
-
}
|
|
114
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.IsRoomActiveResSchema), res.response);
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Get active room information
|
|
118
|
-
* @param params
|
|
119
|
-
* @returns Promise<GetActiveRoomInfoRes>
|
|
120
|
-
*/ async getActiveRoomInfo(params) {
|
|
121
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.GetActiveRoomInfoReqSchema), params);
|
|
122
|
-
const res = await this.apiTransport.sendRequest('/room/getActiveRoomInfo', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.GetActiveRoomInfoReqSchema), body));
|
|
123
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.GetActiveRoomInfoResSchema));
|
|
124
|
-
if (!res.status) {
|
|
125
|
-
output.msg = res.response;
|
|
126
|
-
return output;
|
|
127
|
-
}
|
|
128
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.GetActiveRoomInfoResSchema), res.response);
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Get all active rooms
|
|
132
|
-
* @returns Promise<GetActiveRoomsInfoRes>
|
|
133
|
-
*/ async getActiveRoomsInfo() {
|
|
134
|
-
const res = await this.apiTransport.sendRequest('/room/getActiveRoomsInfo', '{}');
|
|
135
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.GetActiveRoomsInfoResSchema));
|
|
136
|
-
if (!res.status) {
|
|
137
|
-
output.msg = res.response;
|
|
138
|
-
return output;
|
|
139
|
-
}
|
|
140
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.GetActiveRoomsInfoResSchema), res.response);
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Fetch info about past rooms
|
|
144
|
-
* @param params
|
|
145
|
-
* @returns Promise<FetchPastRoomsRes>
|
|
146
|
-
*/ async fetchPastRoomsInfo(params) {
|
|
147
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.FetchPastRoomsReqSchema), params);
|
|
148
|
-
const res = await this.apiTransport.sendRequest('/room/fetchPastRooms', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.FetchPastRoomsReqSchema), body));
|
|
149
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.FetchPastRoomsResSchema));
|
|
150
|
-
if (!res.status) {
|
|
151
|
-
output.msg = res.response;
|
|
152
|
-
return output;
|
|
153
|
-
}
|
|
154
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.FetchPastRoomsResSchema), res.response);
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* End active room
|
|
158
|
-
* @param params
|
|
159
|
-
* @returns Promise<RoomEndRes>
|
|
160
|
-
*/ async endRoom(params) {
|
|
161
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.RoomEndReqSchema), params);
|
|
162
|
-
const res = await this.apiTransport.sendRequest('/room/endRoom', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.RoomEndReqSchema), body));
|
|
163
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.RoomEndResSchema));
|
|
164
|
-
if (!res.status) {
|
|
165
|
-
output.msg = res.response;
|
|
166
|
-
return output;
|
|
167
|
-
}
|
|
168
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.RoomEndResSchema), res.response);
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Fetch artifacts
|
|
172
|
-
* @param params
|
|
173
|
-
* @returns Promise<FetchArtifactsRes>
|
|
174
|
-
*/ async fetchArtifacts(params) {
|
|
175
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.FetchArtifactsReqSchema), params);
|
|
176
|
-
const res = await this.apiTransport.sendRequest('/artifact/fetch', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.FetchArtifactsReqSchema), body));
|
|
177
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.FetchArtifactsResSchema));
|
|
178
|
-
if (!res.status) {
|
|
179
|
-
output.msg = res.response;
|
|
180
|
-
return output;
|
|
181
|
-
}
|
|
182
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.FetchArtifactsResSchema), res.response);
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Delete artifact
|
|
186
|
-
* @param params
|
|
187
|
-
* @returns Promise<DeleteArtifactRes>
|
|
188
|
-
*/ async deleteArtifact(params) {
|
|
189
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.DeleteArtifactReqSchema), params);
|
|
190
|
-
const res = await this.apiTransport.sendRequest('/artifact/delete', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.DeleteArtifactReqSchema), body));
|
|
191
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.DeleteArtifactResSchema));
|
|
192
|
-
if (!res.status) {
|
|
193
|
-
output.msg = res.response;
|
|
194
|
-
return output;
|
|
195
|
-
}
|
|
196
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.DeleteArtifactResSchema), res.response);
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Generate token to download Artifact
|
|
200
|
-
* @param params
|
|
201
|
-
* @returns Promise<GetArtifactDownloadTokenRes>
|
|
202
|
-
*/ async getArtifactDownloadToken(params) {
|
|
203
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.GetArtifactDownloadTokenReqSchema), params);
|
|
204
|
-
const res = await this.apiTransport.sendRequest('/artifact/getDownloadToken', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.GetArtifactDownloadTokenReqSchema), body));
|
|
205
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.GetArtifactDownloadTokenResSchema));
|
|
206
|
-
if (!res.status) {
|
|
207
|
-
output.msg = res.response;
|
|
208
|
-
return output;
|
|
209
|
-
}
|
|
210
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.GetArtifactDownloadTokenResSchema), res.response);
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Get Artifact details
|
|
214
|
-
* @param params
|
|
215
|
-
* @returns Promise<ArtifactInfoRes>
|
|
216
|
-
*/ async getArtifactInfo(params) {
|
|
217
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.ArtifactInfoReqSchema), params);
|
|
218
|
-
const res = await this.apiTransport.sendRequest('/artifact/info', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.ArtifactInfoReqSchema), body));
|
|
219
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.ArtifactInfoResSchema));
|
|
220
|
-
if (!res.status) {
|
|
221
|
-
output.msg = res.response;
|
|
222
|
-
return output;
|
|
223
|
-
}
|
|
224
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.ArtifactInfoResSchema), res.response);
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Fetch recordings
|
|
228
|
-
* @param params
|
|
229
|
-
* @returns Promise<FetchRecordingsRes>
|
|
230
|
-
*/ async fetchRecordings(params) {
|
|
231
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.FetchRecordingsReqSchema), params);
|
|
232
|
-
const res = await this.apiTransport.sendRequest('/recording/fetch', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.FetchRecordingsReqSchema), body));
|
|
233
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.FetchRecordingsResSchema));
|
|
234
|
-
if (!res.status) {
|
|
235
|
-
output.msg = res.response;
|
|
236
|
-
return output;
|
|
237
|
-
}
|
|
238
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.FetchRecordingsResSchema), res.response);
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Delete recording
|
|
242
|
-
* @param params
|
|
243
|
-
* @returns Promise<DeleteRecordingRes>
|
|
244
|
-
*/ async deleteRecordings(params) {
|
|
245
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.DeleteRecordingReqSchema), params);
|
|
246
|
-
const res = await this.apiTransport.sendRequest('/recording/delete', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.DeleteRecordingReqSchema), body));
|
|
247
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.DeleteRecordingResSchema));
|
|
248
|
-
if (!res.status) {
|
|
249
|
-
output.msg = res.response;
|
|
250
|
-
return output;
|
|
251
|
-
}
|
|
252
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.DeleteRecordingResSchema), res.response);
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Generate token to download recording
|
|
256
|
-
* @param params
|
|
257
|
-
* @returns Promise<GetDownloadTokenRes>
|
|
258
|
-
*/ async getRecordingDownloadToken(params) {
|
|
259
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.GetDownloadTokenReqSchema), params);
|
|
260
|
-
const res = await this.apiTransport.sendRequest('/recording/getDownloadToken', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.GetDownloadTokenReqSchema), body));
|
|
261
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.GetDownloadTokenResSchema));
|
|
262
|
-
if (!res.status) {
|
|
263
|
-
output.msg = res.response;
|
|
264
|
-
return output;
|
|
265
|
-
}
|
|
266
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.GetDownloadTokenResSchema), res.response);
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Update recording metadata info
|
|
270
|
-
* @param params
|
|
271
|
-
* @returns Promise<UpdateRecordingMetadataRes>
|
|
272
|
-
*/ async updateRecordingMetadata(params) {
|
|
273
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.UpdateRecordingMetadataReqSchema), params);
|
|
274
|
-
const res = await this.apiTransport.sendRequest('/recording/updateMetadata', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.UpdateRecordingMetadataReqSchema), body));
|
|
275
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.UpdateRecordingMetadataResSchema));
|
|
276
|
-
if (!res.status) {
|
|
277
|
-
output.msg = res.response;
|
|
278
|
-
return output;
|
|
279
|
-
}
|
|
280
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.UpdateRecordingMetadataResSchema), res.response);
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Get recording details
|
|
284
|
-
* @param params
|
|
285
|
-
* @returns Promise<RecordingInfoRes>
|
|
286
|
-
*/ async getRecordingInfo(params) {
|
|
287
|
-
const body = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.RecordingInfoReqSchema), params);
|
|
288
|
-
const res = await this.apiTransport.sendRequest('/recording/info', (0, $d6kgz$bufbuildprotobuf.toJsonString)((0, $d6kgz$plugnmeetprotocoljs.RecordingInfoReqSchema), body));
|
|
289
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.RecordingInfoResSchema));
|
|
290
|
-
if (!res.status) {
|
|
291
|
-
output.msg = res.response;
|
|
292
|
-
return output;
|
|
293
|
-
}
|
|
294
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.RecordingInfoResSchema), res.response);
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* To get JS & CSS files to build interface
|
|
298
|
-
* @returns Promise<GetClientFilesRes>
|
|
299
|
-
*/ async getClientFiles() {
|
|
300
|
-
const res = await this.apiTransport.sendRequest('/getClientFiles', '{}');
|
|
301
|
-
const output = (0, $d6kgz$bufbuildprotobuf.create)((0, $d6kgz$plugnmeetprotocoljs.GetClientFilesResSchema));
|
|
302
|
-
if (!res.status) {
|
|
303
|
-
output.msg = res.response;
|
|
304
|
-
return output;
|
|
305
|
-
}
|
|
306
|
-
return (0, $d6kgz$bufbuildprotobuf.fromJsonString)((0, $d6kgz$plugnmeetprotocoljs.GetClientFilesResSchema), res.response);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
//# sourceMappingURL=PlugNmeet.js.map
|
package/dist/PlugNmeet.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;ACQO,MAAM;IAKX,YAAY,cAAsB,EAAE,MAAc,EAAE,SAAiB,CAAE;aAY/D,gBAAgB,CAAC;YACvB,MAAM,YAAY,CAAA,GAAA,wBAAS,EAAE,UAAU,IAAI,CAAC,SAAS,EAClD,MAAM,CAAC,MACP,MAAM,CAAC;YAEV,OAAO;gBACL,WAAW,IAAI,CAAC,MAAM;gBACtB,kBAAkB;YACpB;QACF;aAEO,cAAc,OAAO,MAAc;YACxC,MAAM,SAAsB;gBAC1B,QAAQ;gBACR,UAAU;YACZ;YAEA,MAAM,UAAU,IAAI,CAAC,aAAa,CAAC;YAEnC,IAAI;gBACF,MAAM,MAAM,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,MAAM;6BAC5C;oBACA,qEAAqE;oBACrE,0DAA0D;oBAC1D,mBAAmB;wBAAC,CAAC,OAAS;qBAAK;gBACrC;gBACA,OAAO,MAAM,GAAG;gBAChB,OAAO,QAAQ,GAAG,IAAI,IAAI;gBAC1B,OAAO;YACT,EAAE,OAAO,OAAY;gBACnB,OAAO,QAAQ,GAAG,MAAM,OAAO;gBA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sCAAa,EAAE,CAAA,GAAA,2DAA+B,GAAG,IAAI,QAAQ;IACtE;IAEA;;;;GAIC,GACD,MAAa,iBACX,MAAwB,EACG;QAC3B,MAAM,OAAO,CAAA,GAAA,8BAAK,EAAE,CAAA,GAAA,iDAAqB,GAAG;QAC5C,MAAM,MAAM,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,CAC7C,mBACA,CAAA,GAAA,oCAAW,EAAE,CAAA,GAAA,iDAAqB,GAAG;QAEvC,MAAM,SAAS,CAAA,GAAA,8BAAK,EAAE,CAAA,GAAA,iDAAqB;QAE3C,IAAI,CAAC,IAAI,MAAM,EAAE;YACf,OAAO,GAAG,GAAG,IAAI,QAAQ;YACzB,OAAO;QACT;QAEA,OAAO,CAAA,GAAA,sCAAa,EAAE,CAAA,GAAA,iDAAqB,GAAG,IAAI,QAAQ;IAC5D;IAEA;;;GAGC,GACD,MAAa,iBAA6C;QACxD,MAAM,MAAM,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,mBAAmB;QACnE,MAAM,SAAS,CAAA,GAAA,8BAAK,EAAE,CAAA,GAAA,kDAAsB;QAE5C,IAAI,CAAC,IAAI,MAAM,EAAE;YACf,OAAO,GAAG,GAAG,IAAI,QAAQ;YACzB,OAAO;QACT;QAEA,OAAO,CAAA,GAAA,sCAAa,EAAE,CAAA,GAAA,kDAAsB,GAAG,IAAI,QAAQ;IAC7D;AACF","sources":["src/PlugNmeet.ts","src/ApiTransport.ts"],"sourcesContent":["import { create, fromJsonString, toJsonString } from '@bufbuild/protobuf';\nimport {\n CreateRoomReq,\n CreateRoomRes,\n GenerateTokenReq,\n GenerateTokenRes,\n IsRoomActiveReq,\n IsRoomActiveRes,\n GetActiveRoomInfoReq,\n GetActiveRoomInfoRes,\n GetActiveRoomsInfoRes,\n FetchPastRoomsReq,\n FetchPastRoomsRes,\n RoomEndReq,\n RoomEndRes,\n FetchArtifactsReq,\n FetchArtifactsRes,\n DeleteArtifactReq,\n DeleteArtifactRes,\n GetArtifactDownloadTokenReq,\n GetArtifactDownloadTokenRes,\n ArtifactInfoReq,\n ArtifactInfoRes,\n FetchRecordingsReq,\n FetchRecordingsRes,\n DeleteRecordingReq,\n DeleteRecordingRes,\n GetDownloadTokenReq,\n GetDownloadTokenRes,\n RecordingInfoReq,\n RecordingInfoRes,\n UpdateRecordingMetadataReq,\n UpdateRecordingMetadataRes,\n GetClientFilesRes,\n CreateRoomReqSchema,\n CreateRoomResSchema,\n GenerateTokenReqSchema,\n GenerateTokenResSchema,\n IsRoomActiveReqSchema,\n IsRoomActiveResSchema,\n GetActiveRoomInfoReqSchema,\n GetActiveRoomInfoResSchema,\n GetActiveRoomsInfoResSchema,\n FetchPastRoomsReqSchema,\n FetchPastRoomsResSchema,\n RoomEndReqSchema,\n RoomEndResSchema,\n FetchArtifactsReqSchema,\n FetchArtifactsResSchema,\n DeleteArtifactReqSchema,\n DeleteArtifactResSchema,\n GetArtifactDownloadTokenReqSchema,\n GetArtifactDownloadTokenResSchema,\n ArtifactInfoReqSchema,\n ArtifactInfoResSchema,\n FetchRecordingsReqSchema,\n FetchRecordingsResSchema,\n DeleteRecordingReqSchema,\n DeleteRecordingResSchema,\n GetDownloadTokenReqSchema,\n GetDownloadTokenResSchema,\n RecordingInfoReqSchema,\n RecordingInfoResSchema,\n UpdateRecordingMetadataReqSchema,\n UpdateRecordingMetadataResSchema,\n GetClientFilesResSchema,\n} from 'plugnmeet-protocol-js';\n\nimport { ApiTransport } from './ApiTransport';\nimport { PlugNmeetAPI } from './PlugNmeetAPI';\n\nexport class PlugNmeet implements PlugNmeetAPI {\n protected defaultPath = '/auth';\n private apiTransport: ApiTransport;\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 this.apiTransport = new ApiTransport(\n serverUrl + this.defaultPath,\n apiKey,\n apiSecret,\n );\n }\n\n /**\n * Create new room\n * @param params\n * @returns Promise<CreateRoomRes>\n */\n public async createRoom(params: CreateRoomReq): Promise<CreateRoomRes> {\n const body = create(CreateRoomReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/room/create',\n toJsonString(CreateRoomReqSchema, body),\n );\n const output = create(CreateRoomResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(CreateRoomResSchema, res.response);\n }\n\n /**\n * Generate join token\n * @param params\n * @returns Promise<GenerateTokenRes>\n */\n public async getJoinToken(\n params: GenerateTokenReq,\n ): Promise<GenerateTokenRes> {\n const body = create(GenerateTokenReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/room/getJoinToken',\n toJsonString(GenerateTokenReqSchema, body),\n );\n const output = create(GenerateTokenResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(GenerateTokenResSchema, res.response);\n }\n\n /**\n * If room is active or not\n * @param params\n * @returns Promise<IsRoomActiveRes>\n */\n public async isRoomActive(params: IsRoomActiveReq): Promise<IsRoomActiveRes> {\n const body = create(IsRoomActiveReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/room/isRoomActive',\n toJsonString(IsRoomActiveReqSchema, body),\n );\n const output = create(IsRoomActiveResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(IsRoomActiveResSchema, res.response);\n }\n\n /**\n * Get active room information\n * @param params\n * @returns Promise<GetActiveRoomInfoRes>\n */\n public async getActiveRoomInfo(\n params: GetActiveRoomInfoReq,\n ): Promise<GetActiveRoomInfoRes> {\n const body = create(GetActiveRoomInfoReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/room/getActiveRoomInfo',\n toJsonString(GetActiveRoomInfoReqSchema, body),\n );\n const output = create(GetActiveRoomInfoResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(GetActiveRoomInfoResSchema, res.response);\n }\n\n /**\n * Get all active rooms\n * @returns Promise<GetActiveRoomsInfoRes>\n */\n public async getActiveRoomsInfo(): Promise<GetActiveRoomsInfoRes> {\n const res = await this.apiTransport.sendRequest(\n '/room/getActiveRoomsInfo',\n '{}',\n );\n const output = create(GetActiveRoomsInfoResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(GetActiveRoomsInfoResSchema, res.response);\n }\n\n /**\n * Fetch info about past rooms\n * @param params\n * @returns Promise<FetchPastRoomsRes>\n */\n public async fetchPastRoomsInfo(\n params: FetchPastRoomsReq,\n ): Promise<FetchPastRoomsRes> {\n const body = create(FetchPastRoomsReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/room/fetchPastRooms',\n toJsonString(FetchPastRoomsReqSchema, body),\n );\n const output = create(FetchPastRoomsResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(FetchPastRoomsResSchema, res.response);\n }\n\n /**\n * End active room\n * @param params\n * @returns Promise<RoomEndRes>\n */\n public async endRoom(params: RoomEndReq): Promise<RoomEndRes> {\n const body = create(RoomEndReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/room/endRoom',\n toJsonString(RoomEndReqSchema, body),\n );\n const output = create(RoomEndResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(RoomEndResSchema, res.response);\n }\n\n /**\n * Fetch artifacts\n * @param params\n * @returns Promise<FetchArtifactsRes>\n */\n public async fetchArtifacts(\n params: FetchArtifactsReq,\n ): Promise<FetchArtifactsRes> {\n const body = create(FetchArtifactsReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/artifact/fetch',\n toJsonString(FetchArtifactsReqSchema, body),\n );\n const output = create(FetchArtifactsResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(FetchArtifactsResSchema, res.response);\n }\n\n /**\n * Delete artifact\n * @param params\n * @returns Promise<DeleteArtifactRes>\n */\n public async deleteArtifact(\n params: DeleteArtifactReq,\n ): Promise<DeleteArtifactRes> {\n const body = create(DeleteArtifactReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/artifact/delete',\n toJsonString(DeleteArtifactReqSchema, body),\n );\n const output = create(DeleteArtifactResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(DeleteArtifactResSchema, res.response);\n }\n\n /**\n * Generate token to download Artifact\n * @param params\n * @returns Promise<GetArtifactDownloadTokenRes>\n */\n public async getArtifactDownloadToken(\n params: GetArtifactDownloadTokenReq,\n ): Promise<GetArtifactDownloadTokenRes> {\n const body = create(GetArtifactDownloadTokenReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/artifact/getDownloadToken',\n toJsonString(GetArtifactDownloadTokenReqSchema, body),\n );\n const output = create(GetArtifactDownloadTokenResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(GetArtifactDownloadTokenResSchema, res.response);\n }\n\n /**\n * Get Artifact details\n * @param params\n * @returns Promise<ArtifactInfoRes>\n */\n public async getArtifactInfo(\n params: ArtifactInfoReq,\n ): Promise<ArtifactInfoRes> {\n const body = create(ArtifactInfoReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/artifact/info',\n toJsonString(ArtifactInfoReqSchema, body),\n );\n const output = create(ArtifactInfoResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(ArtifactInfoResSchema, res.response);\n }\n\n /**\n * Fetch recordings\n * @param params\n * @returns Promise<FetchRecordingsRes>\n */\n public async fetchRecordings(\n params: FetchRecordingsReq,\n ): Promise<FetchRecordingsRes> {\n const body = create(FetchRecordingsReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/recording/fetch',\n toJsonString(FetchRecordingsReqSchema, body),\n );\n const output = create(FetchRecordingsResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(FetchRecordingsResSchema, res.response);\n }\n\n /**\n * Delete recording\n * @param params\n * @returns Promise<DeleteRecordingRes>\n */\n public async deleteRecordings(\n params: DeleteRecordingReq,\n ): Promise<DeleteRecordingRes> {\n const body = create(DeleteRecordingReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/recording/delete',\n toJsonString(DeleteRecordingReqSchema, body),\n );\n const output = create(DeleteRecordingResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(DeleteRecordingResSchema, res.response);\n }\n\n /**\n * Generate token to download recording\n * @param params\n * @returns Promise<GetDownloadTokenRes>\n */\n public async getRecordingDownloadToken(\n params: GetDownloadTokenReq,\n ): Promise<GetDownloadTokenRes> {\n const body = create(GetDownloadTokenReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/recording/getDownloadToken',\n toJsonString(GetDownloadTokenReqSchema, body),\n );\n const output = create(GetDownloadTokenResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(GetDownloadTokenResSchema, res.response);\n }\n\n /**\n * Update recording metadata info\n * @param params\n * @returns Promise<UpdateRecordingMetadataRes>\n */\n public async updateRecordingMetadata(\n params: UpdateRecordingMetadataReq,\n ): Promise<UpdateRecordingMetadataRes> {\n const body = create(UpdateRecordingMetadataReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/recording/updateMetadata',\n toJsonString(UpdateRecordingMetadataReqSchema, body),\n );\n const output = create(UpdateRecordingMetadataResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(UpdateRecordingMetadataResSchema, res.response);\n }\n\n /**\n * Get recording details\n * @param params\n * @returns Promise<RecordingInfoRes>\n */\n public async getRecordingInfo(\n params: RecordingInfoReq,\n ): Promise<RecordingInfoRes> {\n const body = create(RecordingInfoReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/recording/info',\n toJsonString(RecordingInfoReqSchema, body),\n );\n const output = create(RecordingInfoResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(RecordingInfoResSchema, res.response);\n }\n\n /**\n * To get JS & CSS files to build interface\n * @returns Promise<GetClientFilesRes>\n */\n public async getClientFiles(): Promise<GetClientFilesRes> {\n const res = await this.apiTransport.sendRequest('/getClientFiles', '{}');\n const output = create(GetClientFilesResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(GetClientFilesResSchema, res.response);\n }\n}\n","import axios, { AxiosInstance } from 'axios';\nimport { createHmac } from 'crypto';\n\nexport type APIResponse = {\n status: boolean;\n response: any;\n};\n\nexport class ApiTransport {\n private readonly apiKey: string;\n private readonly apiSecret: string;\n private axios: AxiosInstance;\n\n constructor(apiEndPointURL: string, apiKey: string, apiSecret: string) {\n this.apiKey = apiKey;\n this.apiSecret = apiSecret;\n\n this.axios = axios.create({\n baseURL: apiEndPointURL,\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n }\n\n private prepareHeader = (body: string) => {\n const signature = createHmac('sha256', this.apiSecret)\n .update(body)\n .digest('hex');\n\n return {\n 'API-KEY': this.apiKey,\n 'HASH-SIGNATURE': signature,\n };\n };\n\n public sendRequest = async (path: string, body: string) => {\n const output: APIResponse = {\n status: false,\n response: undefined,\n };\n\n const headers = this.prepareHeader(body);\n\n try {\n const res = await this.axios.post(path, body, {\n headers,\n // Return the raw response string, preventing axios from decoding it.\n // The protobuf `fromJson` method will handle the parsing.\n transformResponse: [(data) => data],\n });\n output.status = true;\n output.response = res.data;\n return output;\n } catch (error: any) {\n output.response = error.message;\n if (error.response) {\n output.response = error.response.data;\n }\n return output;\n }\n };\n}\n"],"names":[],"version":3,"file":"PlugNmeet.js.map","sourceRoot":"../"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;ACQO,MAAM;IAKX,YAAY,cAAsB,EAAE,MAAc,EAAE,SAAiB,CAAE;aAY/D,gBAAgB,CAAC;YACvB,MAAM,YAAY,CAAA,GAAA,iBAAS,EAAE,UAAU,IAAI,CAAC,SAAS,E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AE;YACf,OAAO,GAAG,GAAG,IAAI,QAAQ;YACzB,OAAO;QACT;QAEA,OAAO,CAAA,GAAA,qBAAa,EAAE,CAAA,GAAA,8BAAsB,GAAG,IAAI,QAAQ;IAC7D;AACF","sources":["src/PlugNmeet.ts","src/ApiTransport.ts"],"sourcesContent":["import { create, fromJsonString, toJsonString } from '@bufbuild/protobuf';\nimport {\n CreateRoomReq,\n CreateRoomRes,\n GenerateTokenReq,\n GenerateTokenRes,\n IsRoomActiveReq,\n IsRoomActiveRes,\n GetActiveRoomInfoReq,\n GetActiveRoomInfoRes,\n GetActiveRoomsInfoRes,\n FetchPastRoomsReq,\n FetchPastRoomsRes,\n RoomEndReq,\n RoomEndRes,\n FetchArtifactsReq,\n FetchArtifactsRes,\n DeleteArtifactReq,\n DeleteArtifactRes,\n GetArtifactDownloadTokenReq,\n GetArtifactDownloadTokenRes,\n ArtifactInfoReq,\n ArtifactInfoRes,\n FetchRecordingsReq,\n FetchRecordingsRes,\n DeleteRecordingReq,\n DeleteRecordingRes,\n GetDownloadTokenReq,\n GetDownloadTokenRes,\n RecordingInfoReq,\n RecordingInfoRes,\n UpdateRecordingMetadataReq,\n UpdateRecordingMetadataRes,\n GetClientFilesRes,\n CreateRoomReqSchema,\n CreateRoomResSchema,\n GenerateTokenReqSchema,\n GenerateTokenResSchema,\n IsRoomActiveReqSchema,\n IsRoomActiveResSchema,\n GetActiveRoomInfoReqSchema,\n GetActiveRoomInfoResSchema,\n GetActiveRoomsInfoResSchema,\n FetchPastRoomsReqSchema,\n FetchPastRoomsResSchema,\n RoomEndReqSchema,\n RoomEndResSchema,\n FetchArtifactsReqSchema,\n FetchArtifactsResSchema,\n DeleteArtifactReqSchema,\n DeleteArtifactResSchema,\n GetArtifactDownloadTokenReqSchema,\n GetArtifactDownloadTokenResSchema,\n ArtifactInfoReqSchema,\n ArtifactInfoResSchema,\n FetchRecordingsReqSchema,\n FetchRecordingsResSchema,\n DeleteRecordingReqSchema,\n DeleteRecordingResSchema,\n GetDownloadTokenReqSchema,\n GetDownloadTokenResSchema,\n RecordingInfoReqSchema,\n RecordingInfoResSchema,\n UpdateRecordingMetadataReqSchema,\n UpdateRecordingMetadataResSchema,\n GetClientFilesResSchema,\n} from 'plugnmeet-protocol-js';\n\nimport { ApiTransport } from './ApiTransport';\nimport { PlugNmeetAPI } from './PlugNmeetAPI';\n\nexport class PlugNmeet implements PlugNmeetAPI {\n protected defaultPath = '/auth';\n private apiTransport: ApiTransport;\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 this.apiTransport = new ApiTransport(\n serverUrl + this.defaultPath,\n apiKey,\n apiSecret,\n );\n }\n\n /**\n * Create new room\n * @param params\n * @returns Promise<CreateRoomRes>\n */\n public async createRoom(params: CreateRoomReq): Promise<CreateRoomRes> {\n const body = create(CreateRoomReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/room/create',\n toJsonString(CreateRoomReqSchema, body),\n );\n const output = create(CreateRoomResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(CreateRoomResSchema, res.response);\n }\n\n /**\n * Generate join token\n * @param params\n * @returns Promise<GenerateTokenRes>\n */\n public async getJoinToken(\n params: GenerateTokenReq,\n ): Promise<GenerateTokenRes> {\n const body = create(GenerateTokenReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/room/getJoinToken',\n toJsonString(GenerateTokenReqSchema, body),\n );\n const output = create(GenerateTokenResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(GenerateTokenResSchema, res.response);\n }\n\n /**\n * If room is active or not\n * @param params\n * @returns Promise<IsRoomActiveRes>\n */\n public async isRoomActive(params: IsRoomActiveReq): Promise<IsRoomActiveRes> {\n const body = create(IsRoomActiveReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/room/isRoomActive',\n toJsonString(IsRoomActiveReqSchema, body),\n );\n const output = create(IsRoomActiveResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(IsRoomActiveResSchema, res.response);\n }\n\n /**\n * Get active room information\n * @param params\n * @returns Promise<GetActiveRoomInfoRes>\n */\n public async getActiveRoomInfo(\n params: GetActiveRoomInfoReq,\n ): Promise<GetActiveRoomInfoRes> {\n const body = create(GetActiveRoomInfoReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/room/getActiveRoomInfo',\n toJsonString(GetActiveRoomInfoReqSchema, body),\n );\n const output = create(GetActiveRoomInfoResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(GetActiveRoomInfoResSchema, res.response);\n }\n\n /**\n * Get all active rooms\n * @returns Promise<GetActiveRoomsInfoRes>\n */\n public async getActiveRoomsInfo(): Promise<GetActiveRoomsInfoRes> {\n const res = await this.apiTransport.sendRequest(\n '/room/getActiveRoomsInfo',\n '{}',\n );\n const output = create(GetActiveRoomsInfoResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(GetActiveRoomsInfoResSchema, res.response);\n }\n\n /**\n * Fetch info about past rooms\n * @param params\n * @returns Promise<FetchPastRoomsRes>\n */\n public async fetchPastRoomsInfo(\n params: FetchPastRoomsReq,\n ): Promise<FetchPastRoomsRes> {\n const body = create(FetchPastRoomsReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/room/fetchPastRooms',\n toJsonString(FetchPastRoomsReqSchema, body),\n );\n const output = create(FetchPastRoomsResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(FetchPastRoomsResSchema, res.response);\n }\n\n /**\n * End active room\n * @param params\n * @returns Promise<RoomEndRes>\n */\n public async endRoom(params: RoomEndReq): Promise<RoomEndRes> {\n const body = create(RoomEndReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/room/endRoom',\n toJsonString(RoomEndReqSchema, body),\n );\n const output = create(RoomEndResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(RoomEndResSchema, res.response);\n }\n\n /**\n * Fetch artifacts\n * @param params\n * @returns Promise<FetchArtifactsRes>\n */\n public async fetchArtifacts(\n params: FetchArtifactsReq,\n ): Promise<FetchArtifactsRes> {\n const body = create(FetchArtifactsReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/artifact/fetch',\n toJsonString(FetchArtifactsReqSchema, body),\n );\n const output = create(FetchArtifactsResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(FetchArtifactsResSchema, res.response);\n }\n\n /**\n * Delete artifact\n * @param params\n * @returns Promise<DeleteArtifactRes>\n */\n public async deleteArtifact(\n params: DeleteArtifactReq,\n ): Promise<DeleteArtifactRes> {\n const body = create(DeleteArtifactReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/artifact/delete',\n toJsonString(DeleteArtifactReqSchema, body),\n );\n const output = create(DeleteArtifactResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(DeleteArtifactResSchema, res.response);\n }\n\n /**\n * Generate token to download Artifact\n * @param params\n * @returns Promise<GetArtifactDownloadTokenRes>\n */\n public async getArtifactDownloadToken(\n params: GetArtifactDownloadTokenReq,\n ): Promise<GetArtifactDownloadTokenRes> {\n const body = create(GetArtifactDownloadTokenReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/artifact/getDownloadToken',\n toJsonString(GetArtifactDownloadTokenReqSchema, body),\n );\n const output = create(GetArtifactDownloadTokenResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(GetArtifactDownloadTokenResSchema, res.response);\n }\n\n /**\n * Get Artifact details\n * @param params\n * @returns Promise<ArtifactInfoRes>\n */\n public async getArtifactInfo(\n params: ArtifactInfoReq,\n ): Promise<ArtifactInfoRes> {\n const body = create(ArtifactInfoReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/artifact/info',\n toJsonString(ArtifactInfoReqSchema, body),\n );\n const output = create(ArtifactInfoResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(ArtifactInfoResSchema, res.response);\n }\n\n /**\n * Fetch recordings\n * @param params\n * @returns Promise<FetchRecordingsRes>\n */\n public async fetchRecordings(\n params: FetchRecordingsReq,\n ): Promise<FetchRecordingsRes> {\n const body = create(FetchRecordingsReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/recording/fetch',\n toJsonString(FetchRecordingsReqSchema, body),\n );\n const output = create(FetchRecordingsResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(FetchRecordingsResSchema, res.response);\n }\n\n /**\n * Delete recording\n * @param params\n * @returns Promise<DeleteRecordingRes>\n */\n public async deleteRecordings(\n params: DeleteRecordingReq,\n ): Promise<DeleteRecordingRes> {\n const body = create(DeleteRecordingReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/recording/delete',\n toJsonString(DeleteRecordingReqSchema, body),\n );\n const output = create(DeleteRecordingResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(DeleteRecordingResSchema, res.response);\n }\n\n /**\n * Generate token to download recording\n * @param params\n * @returns Promise<GetDownloadTokenRes>\n */\n public async getRecordingDownloadToken(\n params: GetDownloadTokenReq,\n ): Promise<GetDownloadTokenRes> {\n const body = create(GetDownloadTokenReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/recording/getDownloadToken',\n toJsonString(GetDownloadTokenReqSchema, body),\n );\n const output = create(GetDownloadTokenResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(GetDownloadTokenResSchema, res.response);\n }\n\n /**\n * Update recording metadata info\n * @param params\n * @returns Promise<UpdateRecordingMetadataRes>\n */\n public async updateRecordingMetadata(\n params: UpdateRecordingMetadataReq,\n ): Promise<UpdateRecordingMetadataRes> {\n const body = create(UpdateRecordingMetadataReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/recording/updateMetadata',\n toJsonString(UpdateRecordingMetadataReqSchema, body),\n );\n const output = create(UpdateRecordingMetadataResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(UpdateRecordingMetadataResSchema, res.response);\n }\n\n /**\n * Get recording details\n * @param params\n * @returns Promise<RecordingInfoRes>\n */\n public async getRecordingInfo(\n params: RecordingInfoReq,\n ): Promise<RecordingInfoRes> {\n const body = create(RecordingInfoReqSchema, params);\n const res = await this.apiTransport.sendRequest(\n '/recording/info',\n toJsonString(RecordingInfoReqSchema, body),\n );\n const output = create(RecordingInfoResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(RecordingInfoResSchema, res.response);\n }\n\n /**\n * To get JS & CSS files to build interface\n * @returns Promise<GetClientFilesRes>\n */\n public async getClientFiles(): Promise<GetClientFilesRes> {\n const res = await this.apiTransport.sendRequest('/getClientFiles', '{}');\n const output = create(GetClientFilesResSchema);\n\n if (!res.status) {\n output.msg = res.response;\n return output;\n }\n\n return fromJsonString(GetClientFilesResSchema, res.response);\n }\n}\n","import axios, { AxiosInstance } from 'axios';\nimport { createHmac } from 'crypto';\n\nexport type APIResponse = {\n status: boolean;\n response: any;\n};\n\nexport class ApiTransport {\n private readonly apiKey: string;\n private readonly apiSecret: string;\n private axios: AxiosInstance;\n\n constructor(apiEndPointURL: string, apiKey: string, apiSecret: string) {\n this.apiKey = apiKey;\n this.apiSecret = apiSecret;\n\n this.axios = axios.create({\n baseURL: apiEndPointURL,\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n }\n\n private prepareHeader = (body: string) => {\n const signature = createHmac('sha256', this.apiSecret)\n .update(body)\n .digest('hex');\n\n return {\n 'API-KEY': this.apiKey,\n 'HASH-SIGNATURE': signature,\n };\n };\n\n public sendRequest = async (path: string, body: string) => {\n const output: APIResponse = {\n status: false,\n response: undefined,\n };\n\n const headers = this.prepareHeader(body);\n\n try {\n const res = await this.axios.post(path, body, {\n headers,\n // Return the raw response string, preventing axios from decoding it.\n // The protobuf `fromJson` method will handle the parsing.\n transformResponse: [(data) => data],\n });\n output.status = true;\n output.response = res.data;\n return output;\n } catch (error: any) {\n output.response = error.message;\n if (error.response) {\n output.response = error.response.data;\n }\n return output;\n }\n };\n}\n"],"names":[],"version":3,"file":"PlugNmeet.mjs.js.map"}
|