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
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {create as $
|
|
2
|
-
import
|
|
3
|
-
import $
|
|
4
|
-
import {createHmac as $
|
|
1
|
+
import {create as $149c1bd638913645$re_export$createRequest, toJsonString as $hgUW1$toJsonString, fromJsonString as $hgUW1$fromJsonString} from "@bufbuild/protobuf";
|
|
2
|
+
import * as $hgUW1$plugnmeetprotocoljs from "plugnmeet-protocol-js";
|
|
3
|
+
import $hgUW1$axios from "axios";
|
|
4
|
+
import {createHmac as $hgUW1$createHmac} from "crypto";
|
|
5
|
+
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
|
|
7
9
|
|
|
@@ -10,7 +12,7 @@ import {createHmac as $gvjLo$createHmac} from "crypto";
|
|
|
10
12
|
class $e666bfa8019d90ff$export$5a82ec1641dd9681 {
|
|
11
13
|
constructor(apiEndPointURL, apiKey, apiSecret){
|
|
12
14
|
this.prepareHeader = (body)=>{
|
|
13
|
-
const signature = (0, $
|
|
15
|
+
const signature = (0, $hgUW1$createHmac)('sha256', this.apiSecret).update(body).digest('hex');
|
|
14
16
|
return {
|
|
15
17
|
'API-KEY': this.apiKey,
|
|
16
18
|
'HASH-SIGNATURE': signature
|
|
@@ -42,7 +44,7 @@ class $e666bfa8019d90ff$export$5a82ec1641dd9681 {
|
|
|
42
44
|
};
|
|
43
45
|
this.apiKey = apiKey;
|
|
44
46
|
this.apiSecret = apiSecret;
|
|
45
|
-
this.axios = (0, $
|
|
47
|
+
this.axios = (0, $hgUW1$axios).create({
|
|
46
48
|
baseURL: apiEndPointURL,
|
|
47
49
|
headers: {
|
|
48
50
|
'Content-Type': 'application/json'
|
|
@@ -66,237 +68,239 @@ class $cdaf723153ba18be$export$1402da7f2870faee {
|
|
|
66
68
|
* @param params
|
|
67
69
|
* @returns Promise<CreateRoomRes>
|
|
68
70
|
*/ async createRoom(params) {
|
|
69
|
-
const body = (0, $
|
|
70
|
-
const res = await this.apiTransport.sendRequest('/room/create', (0, $
|
|
71
|
-
const output = (0, $
|
|
71
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$CreateRoomReqSchema), params);
|
|
72
|
+
const res = await this.apiTransport.sendRequest('/room/create', (0, $hgUW1$toJsonString)((0, $hgUW1$CreateRoomReqSchema), body));
|
|
73
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$CreateRoomResSchema));
|
|
72
74
|
if (!res.status) {
|
|
73
75
|
output.msg = res.response;
|
|
74
76
|
return output;
|
|
75
77
|
}
|
|
76
|
-
return (0, $
|
|
78
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$CreateRoomResSchema), res.response);
|
|
77
79
|
}
|
|
78
80
|
/**
|
|
79
81
|
* Generate join token
|
|
80
82
|
* @param params
|
|
81
83
|
* @returns Promise<GenerateTokenRes>
|
|
82
84
|
*/ async getJoinToken(params) {
|
|
83
|
-
const body = (0, $
|
|
84
|
-
const res = await this.apiTransport.sendRequest('/room/getJoinToken', (0, $
|
|
85
|
-
const output = (0, $
|
|
85
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$GenerateTokenReqSchema), params);
|
|
86
|
+
const res = await this.apiTransport.sendRequest('/room/getJoinToken', (0, $hgUW1$toJsonString)((0, $hgUW1$GenerateTokenReqSchema), body));
|
|
87
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$GenerateTokenResSchema));
|
|
86
88
|
if (!res.status) {
|
|
87
89
|
output.msg = res.response;
|
|
88
90
|
return output;
|
|
89
91
|
}
|
|
90
|
-
return (0, $
|
|
92
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$GenerateTokenResSchema), res.response);
|
|
91
93
|
}
|
|
92
94
|
/**
|
|
93
95
|
* If room is active or not
|
|
94
96
|
* @param params
|
|
95
97
|
* @returns Promise<IsRoomActiveRes>
|
|
96
98
|
*/ async isRoomActive(params) {
|
|
97
|
-
const body = (0, $
|
|
98
|
-
const res = await this.apiTransport.sendRequest('/room/isRoomActive', (0, $
|
|
99
|
-
const output = (0, $
|
|
99
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$IsRoomActiveReqSchema), params);
|
|
100
|
+
const res = await this.apiTransport.sendRequest('/room/isRoomActive', (0, $hgUW1$toJsonString)((0, $hgUW1$IsRoomActiveReqSchema), body));
|
|
101
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$IsRoomActiveResSchema));
|
|
100
102
|
if (!res.status) {
|
|
101
103
|
output.msg = res.response;
|
|
102
104
|
return output;
|
|
103
105
|
}
|
|
104
|
-
return (0, $
|
|
106
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$IsRoomActiveResSchema), res.response);
|
|
105
107
|
}
|
|
106
108
|
/**
|
|
107
109
|
* Get active room information
|
|
108
110
|
* @param params
|
|
109
111
|
* @returns Promise<GetActiveRoomInfoRes>
|
|
110
112
|
*/ async getActiveRoomInfo(params) {
|
|
111
|
-
const body = (0, $
|
|
112
|
-
const res = await this.apiTransport.sendRequest('/room/getActiveRoomInfo', (0, $
|
|
113
|
-
const output = (0, $
|
|
113
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$GetActiveRoomInfoReqSchema), params);
|
|
114
|
+
const res = await this.apiTransport.sendRequest('/room/getActiveRoomInfo', (0, $hgUW1$toJsonString)((0, $hgUW1$GetActiveRoomInfoReqSchema), body));
|
|
115
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$GetActiveRoomInfoResSchema));
|
|
114
116
|
if (!res.status) {
|
|
115
117
|
output.msg = res.response;
|
|
116
118
|
return output;
|
|
117
119
|
}
|
|
118
|
-
return (0, $
|
|
120
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$GetActiveRoomInfoResSchema), res.response);
|
|
119
121
|
}
|
|
120
122
|
/**
|
|
121
123
|
* Get all active rooms
|
|
122
124
|
* @returns Promise<GetActiveRoomsInfoRes>
|
|
123
125
|
*/ async getActiveRoomsInfo() {
|
|
124
126
|
const res = await this.apiTransport.sendRequest('/room/getActiveRoomsInfo', '{}');
|
|
125
|
-
const output = (0, $
|
|
127
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$GetActiveRoomsInfoResSchema));
|
|
126
128
|
if (!res.status) {
|
|
127
129
|
output.msg = res.response;
|
|
128
130
|
return output;
|
|
129
131
|
}
|
|
130
|
-
return (0, $
|
|
132
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$GetActiveRoomsInfoResSchema), res.response);
|
|
131
133
|
}
|
|
132
134
|
/**
|
|
133
135
|
* Fetch info about past rooms
|
|
134
136
|
* @param params
|
|
135
137
|
* @returns Promise<FetchPastRoomsRes>
|
|
136
138
|
*/ async fetchPastRoomsInfo(params) {
|
|
137
|
-
const body = (0, $
|
|
138
|
-
const res = await this.apiTransport.sendRequest('/room/fetchPastRooms', (0, $
|
|
139
|
-
const output = (0, $
|
|
139
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$FetchPastRoomsReqSchema), params);
|
|
140
|
+
const res = await this.apiTransport.sendRequest('/room/fetchPastRooms', (0, $hgUW1$toJsonString)((0, $hgUW1$FetchPastRoomsReqSchema), body));
|
|
141
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$FetchPastRoomsResSchema));
|
|
140
142
|
if (!res.status) {
|
|
141
143
|
output.msg = res.response;
|
|
142
144
|
return output;
|
|
143
145
|
}
|
|
144
|
-
return (0, $
|
|
146
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$FetchPastRoomsResSchema), res.response);
|
|
145
147
|
}
|
|
146
148
|
/**
|
|
147
149
|
* End active room
|
|
148
150
|
* @param params
|
|
149
151
|
* @returns Promise<RoomEndRes>
|
|
150
152
|
*/ async endRoom(params) {
|
|
151
|
-
const body = (0, $
|
|
152
|
-
const res = await this.apiTransport.sendRequest('/room/endRoom', (0, $
|
|
153
|
-
const output = (0, $
|
|
153
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$RoomEndReqSchema), params);
|
|
154
|
+
const res = await this.apiTransport.sendRequest('/room/endRoom', (0, $hgUW1$toJsonString)((0, $hgUW1$RoomEndReqSchema), body));
|
|
155
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$RoomEndResSchema));
|
|
154
156
|
if (!res.status) {
|
|
155
157
|
output.msg = res.response;
|
|
156
158
|
return output;
|
|
157
159
|
}
|
|
158
|
-
return (0, $
|
|
160
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$RoomEndResSchema), res.response);
|
|
159
161
|
}
|
|
160
162
|
/**
|
|
161
163
|
* Fetch artifacts
|
|
162
164
|
* @param params
|
|
163
165
|
* @returns Promise<FetchArtifactsRes>
|
|
164
166
|
*/ async fetchArtifacts(params) {
|
|
165
|
-
const body = (0, $
|
|
166
|
-
const res = await this.apiTransport.sendRequest('/artifact/fetch', (0, $
|
|
167
|
-
const output = (0, $
|
|
167
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$FetchArtifactsReqSchema), params);
|
|
168
|
+
const res = await this.apiTransport.sendRequest('/artifact/fetch', (0, $hgUW1$toJsonString)((0, $hgUW1$FetchArtifactsReqSchema), body));
|
|
169
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$FetchArtifactsResSchema));
|
|
168
170
|
if (!res.status) {
|
|
169
171
|
output.msg = res.response;
|
|
170
172
|
return output;
|
|
171
173
|
}
|
|
172
|
-
return (0, $
|
|
174
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$FetchArtifactsResSchema), res.response);
|
|
173
175
|
}
|
|
174
176
|
/**
|
|
175
177
|
* Delete artifact
|
|
176
178
|
* @param params
|
|
177
179
|
* @returns Promise<DeleteArtifactRes>
|
|
178
180
|
*/ async deleteArtifact(params) {
|
|
179
|
-
const body = (0, $
|
|
180
|
-
const res = await this.apiTransport.sendRequest('/artifact/delete', (0, $
|
|
181
|
-
const output = (0, $
|
|
181
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$DeleteArtifactReqSchema), params);
|
|
182
|
+
const res = await this.apiTransport.sendRequest('/artifact/delete', (0, $hgUW1$toJsonString)((0, $hgUW1$DeleteArtifactReqSchema), body));
|
|
183
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$DeleteArtifactResSchema));
|
|
182
184
|
if (!res.status) {
|
|
183
185
|
output.msg = res.response;
|
|
184
186
|
return output;
|
|
185
187
|
}
|
|
186
|
-
return (0, $
|
|
188
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$DeleteArtifactResSchema), res.response);
|
|
187
189
|
}
|
|
188
190
|
/**
|
|
189
191
|
* Generate token to download Artifact
|
|
190
192
|
* @param params
|
|
191
193
|
* @returns Promise<GetArtifactDownloadTokenRes>
|
|
192
194
|
*/ async getArtifactDownloadToken(params) {
|
|
193
|
-
const body = (0, $
|
|
194
|
-
const res = await this.apiTransport.sendRequest('/artifact/getDownloadToken', (0, $
|
|
195
|
-
const output = (0, $
|
|
195
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$GetArtifactDownloadTokenReqSchema), params);
|
|
196
|
+
const res = await this.apiTransport.sendRequest('/artifact/getDownloadToken', (0, $hgUW1$toJsonString)((0, $hgUW1$GetArtifactDownloadTokenReqSchema), body));
|
|
197
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$GetArtifactDownloadTokenResSchema));
|
|
196
198
|
if (!res.status) {
|
|
197
199
|
output.msg = res.response;
|
|
198
200
|
return output;
|
|
199
201
|
}
|
|
200
|
-
return (0, $
|
|
202
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$GetArtifactDownloadTokenResSchema), res.response);
|
|
201
203
|
}
|
|
202
204
|
/**
|
|
203
205
|
* Get Artifact details
|
|
204
206
|
* @param params
|
|
205
207
|
* @returns Promise<ArtifactInfoRes>
|
|
206
208
|
*/ async getArtifactInfo(params) {
|
|
207
|
-
const body = (0, $
|
|
208
|
-
const res = await this.apiTransport.sendRequest('/artifact/info', (0, $
|
|
209
|
-
const output = (0, $
|
|
209
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$ArtifactInfoReqSchema), params);
|
|
210
|
+
const res = await this.apiTransport.sendRequest('/artifact/info', (0, $hgUW1$toJsonString)((0, $hgUW1$ArtifactInfoReqSchema), body));
|
|
211
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$ArtifactInfoResSchema));
|
|
210
212
|
if (!res.status) {
|
|
211
213
|
output.msg = res.response;
|
|
212
214
|
return output;
|
|
213
215
|
}
|
|
214
|
-
return (0, $
|
|
216
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$ArtifactInfoResSchema), res.response);
|
|
215
217
|
}
|
|
216
218
|
/**
|
|
217
219
|
* Fetch recordings
|
|
218
220
|
* @param params
|
|
219
221
|
* @returns Promise<FetchRecordingsRes>
|
|
220
222
|
*/ async fetchRecordings(params) {
|
|
221
|
-
const body = (0, $
|
|
222
|
-
const res = await this.apiTransport.sendRequest('/recording/fetch', (0, $
|
|
223
|
-
const output = (0, $
|
|
223
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$FetchRecordingsReqSchema), params);
|
|
224
|
+
const res = await this.apiTransport.sendRequest('/recording/fetch', (0, $hgUW1$toJsonString)((0, $hgUW1$FetchRecordingsReqSchema), body));
|
|
225
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$FetchRecordingsResSchema));
|
|
224
226
|
if (!res.status) {
|
|
225
227
|
output.msg = res.response;
|
|
226
228
|
return output;
|
|
227
229
|
}
|
|
228
|
-
return (0, $
|
|
230
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$FetchRecordingsResSchema), res.response);
|
|
229
231
|
}
|
|
230
232
|
/**
|
|
231
233
|
* Delete recording
|
|
232
234
|
* @param params
|
|
233
235
|
* @returns Promise<DeleteRecordingRes>
|
|
234
236
|
*/ async deleteRecordings(params) {
|
|
235
|
-
const body = (0, $
|
|
236
|
-
const res = await this.apiTransport.sendRequest('/recording/delete', (0, $
|
|
237
|
-
const output = (0, $
|
|
237
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$DeleteRecordingReqSchema), params);
|
|
238
|
+
const res = await this.apiTransport.sendRequest('/recording/delete', (0, $hgUW1$toJsonString)((0, $hgUW1$DeleteRecordingReqSchema), body));
|
|
239
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$DeleteRecordingResSchema));
|
|
238
240
|
if (!res.status) {
|
|
239
241
|
output.msg = res.response;
|
|
240
242
|
return output;
|
|
241
243
|
}
|
|
242
|
-
return (0, $
|
|
244
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$DeleteRecordingResSchema), res.response);
|
|
243
245
|
}
|
|
244
246
|
/**
|
|
245
247
|
* Generate token to download recording
|
|
246
248
|
* @param params
|
|
247
249
|
* @returns Promise<GetDownloadTokenRes>
|
|
248
250
|
*/ async getRecordingDownloadToken(params) {
|
|
249
|
-
const body = (0, $
|
|
250
|
-
const res = await this.apiTransport.sendRequest('/recording/getDownloadToken', (0, $
|
|
251
|
-
const output = (0, $
|
|
251
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$GetDownloadTokenReqSchema), params);
|
|
252
|
+
const res = await this.apiTransport.sendRequest('/recording/getDownloadToken', (0, $hgUW1$toJsonString)((0, $hgUW1$GetDownloadTokenReqSchema), body));
|
|
253
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$GetDownloadTokenResSchema));
|
|
252
254
|
if (!res.status) {
|
|
253
255
|
output.msg = res.response;
|
|
254
256
|
return output;
|
|
255
257
|
}
|
|
256
|
-
return (0, $
|
|
258
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$GetDownloadTokenResSchema), res.response);
|
|
257
259
|
}
|
|
258
260
|
/**
|
|
259
261
|
* Update recording metadata info
|
|
260
262
|
* @param params
|
|
261
263
|
* @returns Promise<UpdateRecordingMetadataRes>
|
|
262
264
|
*/ async updateRecordingMetadata(params) {
|
|
263
|
-
const body = (0, $
|
|
264
|
-
const res = await this.apiTransport.sendRequest('/recording/updateMetadata', (0, $
|
|
265
|
-
const output = (0, $
|
|
265
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$UpdateRecordingMetadataReqSchema), params);
|
|
266
|
+
const res = await this.apiTransport.sendRequest('/recording/updateMetadata', (0, $hgUW1$toJsonString)((0, $hgUW1$UpdateRecordingMetadataReqSchema), body));
|
|
267
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$UpdateRecordingMetadataResSchema));
|
|
266
268
|
if (!res.status) {
|
|
267
269
|
output.msg = res.response;
|
|
268
270
|
return output;
|
|
269
271
|
}
|
|
270
|
-
return (0, $
|
|
272
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$UpdateRecordingMetadataResSchema), res.response);
|
|
271
273
|
}
|
|
272
274
|
/**
|
|
273
275
|
* Get recording details
|
|
274
276
|
* @param params
|
|
275
277
|
* @returns Promise<RecordingInfoRes>
|
|
276
278
|
*/ async getRecordingInfo(params) {
|
|
277
|
-
const body = (0, $
|
|
278
|
-
const res = await this.apiTransport.sendRequest('/recording/info', (0, $
|
|
279
|
-
const output = (0, $
|
|
279
|
+
const body = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$RecordingInfoReqSchema), params);
|
|
280
|
+
const res = await this.apiTransport.sendRequest('/recording/info', (0, $hgUW1$toJsonString)((0, $hgUW1$RecordingInfoReqSchema), body));
|
|
281
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$RecordingInfoResSchema));
|
|
280
282
|
if (!res.status) {
|
|
281
283
|
output.msg = res.response;
|
|
282
284
|
return output;
|
|
283
285
|
}
|
|
284
|
-
return (0, $
|
|
286
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$RecordingInfoResSchema), res.response);
|
|
285
287
|
}
|
|
286
288
|
/**
|
|
287
289
|
* To get JS & CSS files to build interface
|
|
288
290
|
* @returns Promise<GetClientFilesRes>
|
|
289
291
|
*/ async getClientFiles() {
|
|
290
292
|
const res = await this.apiTransport.sendRequest('/getClientFiles', '{}');
|
|
291
|
-
const output = (0, $
|
|
293
|
+
const output = (0, $149c1bd638913645$re_export$createRequest)((0, $hgUW1$GetClientFilesResSchema));
|
|
292
294
|
if (!res.status) {
|
|
293
295
|
output.msg = res.response;
|
|
294
296
|
return output;
|
|
295
297
|
}
|
|
296
|
-
return (0, $
|
|
298
|
+
return (0, $hgUW1$fromJsonString)((0, $hgUW1$GetClientFilesResSchema), res.response);
|
|
297
299
|
}
|
|
298
300
|
}
|
|
299
301
|
|
|
300
302
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
export {$149c1bd638913645$re_export$createRequest as createRequest, $cdaf723153ba18be$export$1402da7f2870faee as PlugNmeet};
|
|
306
|
+
//# sourceMappingURL=index.mjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;AEQO,MAAM;IAKX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iBAA6C;QACxD,MAAM,MAAM,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,mBAAmB;QACnE,MAAM,SAAS,CAAA,GAAA,yCAAK,EAAE,CAAA,GAAA,8BAAsB;QAE5C,IAAI,CAAC,IAAI,MAAM,EAAE;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/index.ts","src/PlugNmeet.ts","src/ApiTransport.ts"],"sourcesContent":["export { create as createRequest } from '@bufbuild/protobuf';\nexport * from 'plugnmeet-protocol-js';\n\nexport { PlugNmeet } from './PlugNmeet';\n","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":"index.mjs.js.map"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plugnmeet-sdk-js",
|
|
3
|
-
"version": "2.0.2-
|
|
3
|
+
"version": "2.0.2-3",
|
|
4
4
|
"description": "plugNmeet JS SDK",
|
|
5
5
|
"author": "Jibon L. Costa",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "https://github.com/mynaparrot/plugNmeet-sdk-js",
|
|
8
|
-
"source": "src/
|
|
9
|
-
"main": "dist/
|
|
10
|
-
"module": "dist/
|
|
8
|
+
"source": "src/index.ts",
|
|
9
|
+
"main": "dist/index.cjs.js",
|
|
10
|
+
"module": "dist/index.mjs.js",
|
|
11
11
|
"types": "dist/index.d.ts",
|
|
12
12
|
"files": [
|
|
13
13
|
"dist",
|