@jibb-open/jssdk 3.5.13 → 3.5.16

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/api/recording.js CHANGED
@@ -1,260 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.deleteImage = deleteImage;
7
- exports.deleteRecording = deleteRecording;
8
- exports.getAllRecordImages = getAllRecordImages;
9
- exports.getImage = getImage;
10
- exports.getImageList = getImageList;
11
- exports.getRecording = getRecording;
12
- exports.getRecordingList = getRecordingList;
13
- exports.startRecording = startRecording;
14
- exports.stopRecording = stopRecording;
15
- exports.takeSnapshot = takeSnapshot;
16
- exports.updateRecording = updateRecording;
17
- require("core-js/modules/es.promise.js");
18
- require("core-js/modules/es.json.stringify.js");
19
- require("core-js/modules/web.dom-collections.iterator.js");
20
- var _config = require("../config.js");
21
- var _auth = require("./auth.js");
22
- var _index = require("../utils/http/index.js");
23
- /**
24
- * @module Recording
25
- * This is an experimental API.
26
- *
27
- */
28
-
29
- /**
30
- *
31
- * @async
32
- * @param {object} param0
33
- * @param {string} param0.recordingId
34
- * @param {string} param0.title
35
- * @returns - http result
36
- */
37
- async function updateRecording(_ref) {
38
- let {
39
- recordingId,
40
- title
41
- } = _ref;
42
- let headers = {
43
- "Content-Type": "application/json",
44
- Accept: "application/json",
45
- "x-jibb-user-jwt": await _auth.Auth.getUserToken()
46
- };
47
- let body = {
48
- title: title
49
- };
50
- return _index.http.post("".concat(_config.Config.apiBaseURL, "/v1/meetings/recordings/").concat(recordingId), body, headers);
51
- }
52
- /**
53
- *
54
- * @async
55
- * @param {string} recordingId
56
- * @returns {list}
57
- */
58
- async function getRecording(recordingId) {
59
- let headers = {
60
- "Content-Type": "application/json",
61
- Accept: "application/json",
62
- "x-jibb-user-jwt": await _auth.Auth.getUserToken()
63
- };
64
- let response = await _index.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings/recordings/").concat(recordingId), headers);
65
- return response.data;
66
- }
67
-
68
- /**
69
- *
70
- * @async
71
- * @param {*} pagination
72
- * @returns {}
73
- */
74
- async function getRecordingList(pagination) {
75
- let headers = {
76
- "Content-Type": "application/json",
77
- Accept: "application/json",
78
- "x-jibb-user-jwt": await _auth.Auth.getUserToken()
79
- };
80
- if (pagination !== undefined) headers["x-jibb-pagination"] = JSON.stringify(pagination);
81
- let response = await _index.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings/recordings"), headers);
82
- pagination = response.headers["x-jibb-pagination"];
83
- pagination = pagination && JSON.parse(pagination);
84
- return {
85
- items: response.data.items,
86
- pagination: pagination
87
- };
88
- }
89
-
90
- /**
91
- *
92
- * @async
93
- * @param {string} recordingId
94
- * @returns - http result
95
- */
96
- async function deleteRecording(recordingId) {
97
- let headers = {
98
- "Content-Type": "application/json",
99
- Accept: "application/json",
100
- "x-jibb-user-jwt": await _auth.Auth.getUserToken()
101
- };
102
- return _index.http.delete("".concat(_config.Config.apiBaseURL, "/v1/meetings/recordings/").concat(recordingId), headers);
103
- }
104
-
105
- /**
106
- *
107
- * @async
108
- * @param {string} recordingId
109
- * @returns {array}
110
- */
111
- async function getImageList(recordingId) {
112
- let headers = {
113
- "Content-Type": "application/json",
114
- Accept: "application/json",
115
- "x-jibb-user-jwt": await _auth.Auth.getUserToken()
116
- };
117
- let response = await _index.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings/recordings/").concat(recordingId, "/images"), headers);
118
- return response.data.imageName;
119
- }
120
- /**
121
- * @async
122
- * @param {object} param0
123
- * @param {string} param0.recordingId
124
- * @param {string} param0.imageName
125
- * @returns {data}
126
- */
127
- async function getImage(_ref2) {
128
- let {
129
- recordingId,
130
- imageName
131
- } = _ref2;
132
- let headers = {
133
- "Content-Type": "application/json",
134
- Accept: "image/jpeg",
135
- "x-jibb-user-jwt": await _auth.Auth.getUserToken()
136
- };
137
- let url = "".concat(_config.Config.apiBaseURL, "/v1/meetings/recordings/").concat(recordingId, "/images/").concat(imageName);
138
- let response = await _index.http.get(url, headers, {
139
- responseType: "arraybuffer"
140
- });
141
- return response.data;
142
- }
143
-
144
- /**
145
- *
146
- * @async
147
- * @param {string} recordingId
148
- * @returns {array}
149
- */
150
- async function getAllRecordImages(recordingId) {
151
- let imageList = [];
152
- let imageNameList = await this.getImageList(recordingId);
153
- for (const imageName of imageNameList) {
154
- let headers = {
155
- "Content-Type": "application/json",
156
- Accept: "application/json",
157
- "x-jibb-user-jwt": await _auth.Auth.getUserToken()
158
- };
159
- let response = await _index.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings/recordings/").concat(recordingId, "/images/").concat(imageName), {
160
- headers
161
- });
162
- imageList.push({
163
- imageName: imageName,
164
- data: response.data
165
- });
166
- }
167
- return imageList;
168
- }
169
-
170
- /**
171
- *
172
- * @async
173
- * @param {object} param0
174
- * @param {string} param0.recordingId
175
- * @param {string} param0.imageName
176
- * @returns - http result
177
- */
178
- async function deleteImage(_ref3) {
179
- let {
180
- recordingId,
181
- imageName
182
- } = _ref3;
183
- let headers = {
184
- "Content-Type": "application/json",
185
- Accept: "application/json",
186
- "x-jibb-user-jwt": await _auth.Auth.getUserToken()
187
- };
188
- return _index.http.delete("".concat(_config.Config.apiBaseURL, "/v1/meetings/recordings/").concat(recordingId, "/images/").concat(imageName), headers);
189
- }
190
-
191
- /**
192
- *
193
- * @async
194
- * @param {object} options
195
- * @param {string} options.meetingId
196
- * @param {string} options.meetingToken
197
- * @param {string} [options.title="UNTITLED"]
198
- * @param {number} [options.interval=60]
199
- * @returns {data} - recording details
200
- */
201
- async function startRecording() {
202
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
203
- meetingId,
204
- meetingToken,
205
- title: "UNTITLED",
206
- interval: 60
207
- };
208
- return async function () {
209
- let meetingToken = options === null || options === void 0 ? void 0 : options.meetingToken;
210
- let title = (options === null || options === void 0 ? void 0 : options.title) || "UNTITLED";
211
- let interval = (options === null || options === void 0 ? void 0 : options.interval) || 60;
212
- let meetingId = options === null || options === void 0 ? void 0 : options.meetingId;
213
- let headers = {
214
- "Content-Type": "application/json",
215
- Accept: "application/json",
216
- "x-jibb-user-jwt": await _auth.Auth.getUserToken(),
217
- "x-jibb-meeting-jwt": meetingToken
218
- };
219
- let body = {
220
- title: title,
221
- write_interval: interval,
222
- meeting_id: meetingId
223
- };
224
- let response = await _index.http.post("".concat(_config.Config.apiBaseURL, "/v1/meetings/recordings/start"), body, headers);
225
- return response.data;
226
- }();
227
- }
228
-
229
- /**
230
- *
231
- * @async
232
- * @returns - http result
233
- */
234
- async function stopRecording() {
235
- let headers = {
236
- "Content-Type": "application/json",
237
- Accept: "application/json",
238
- "x-jibb-user-jwt": await _auth.Auth.getUserToken()
239
- };
240
- let body = {};
241
- let response = await _index.http.post("".concat(_config.Config.apiBaseURL, "/v1/meetings/recordings/stop"), body, headers);
242
- return response.data;
243
- }
244
-
245
- /**
246
- *
247
- * @async
248
- * @returns {data}
249
- */
250
-
251
- async function takeSnapshot() {
252
- let headers = {
253
- "Content-Type": "application/json",
254
- Accept: "application/json",
255
- "x-jibb-user-jwt": await _auth.Auth.getUserToken()
256
- };
257
- let body = {};
258
- let response = await _index.http.post("".concat(_config.Config.apiBaseURL, "/v1/meetings/recordings/snapshot"), body, headers);
259
- return response.data;
260
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.deleteImage=deleteImage,exports.deleteRecording=deleteRecording,exports.getAllRecordImages=getAllRecordImages,exports.getImage=getImage,exports.getImageList=getImageList,exports.getRecording=getRecording,exports.getRecordingList=getRecordingList,exports.startRecording=startRecording,exports.stopRecording=stopRecording,exports.takeSnapshot=takeSnapshot,exports.updateRecording=updateRecording,require("core-js/modules/es.promise.js"),require("core-js/modules/es.json.stringify.js"),require("core-js/modules/web.dom-collections.iterator.js");var _config=require("../config.js"),_auth=require("./auth.js"),_index=require("../utils/http/index.js");async function updateRecording(a){let{recordingId:b,title:c}=a,d={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()};return _index.http.post("".concat(_config.Config.apiBaseURL,"/v1/meetings/recordings/").concat(b),{title:c},d)}async function getRecording(a){let b={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()},c=await _index.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings/recordings/").concat(a),b);return c.data}async function getRecordingList(a){let b={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()};void 0!==a&&(b["x-jibb-pagination"]=JSON.stringify(a));let c=await _index.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings/recordings"),b);return a=c.headers["x-jibb-pagination"],a=a&&JSON.parse(a),{items:c.data.items,pagination:a}}async function deleteRecording(a){let b={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()};return _index.http.delete("".concat(_config.Config.apiBaseURL,"/v1/meetings/recordings/").concat(a),b)}async function getImageList(a){let b={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()},c=await _index.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings/recordings/").concat(a,"/images"),b);return c.data.imageName}async function getImage(a){let{recordingId:b,imageName:c}=a,d={"Content-Type":"application/json",Accept:"image/jpeg","x-jibb-user-jwt":await _auth.Auth.getUserToken()},e="".concat(_config.Config.apiBaseURL,"/v1/meetings/recordings/").concat(b,"/images/").concat(c),f=await _index.http.get(e,d,{responseType:"arraybuffer"});return f.data}async function getAllRecordImages(a){let b=[],c=await this.getImageList(a);for(const d of c){let c={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()},e=await _index.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings/recordings/").concat(a,"/images/").concat(d),{headers:c});b.push({imageName:d,data:e.data})}return b}async function deleteImage(a){let{recordingId:b,imageName:c}=a,d={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()};return _index.http.delete("".concat(_config.Config.apiBaseURL,"/v1/meetings/recordings/").concat(b,"/images/").concat(c),d)}async function startRecording(){let a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{meetingId,meetingToken,title:"UNTITLED",interval:60};return async function(){let b=null===a||void 0===a?void 0:a.meetingToken,c=(null===a||void 0===a?void 0:a.title)||"UNTITLED",d=(null===a||void 0===a?void 0:a.interval)||60,e=null===a||void 0===a?void 0:a.meetingId,f={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken(),"x-jibb-meeting-jwt":b},g=await _index.http.post("".concat(_config.Config.apiBaseURL,"/v1/meetings/recordings/start"),{title:c,write_interval:d,meeting_id:e},f);return g.data}()}async function stopRecording(){let a={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()},b=await _index.http.post("".concat(_config.Config.apiBaseURL,"/v1/meetings/recordings/stop"),{},a);return b.data}async function takeSnapshot(){let a={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()},b=await _index.http.post("".concat(_config.Config.apiBaseURL,"/v1/meetings/recordings/snapshot"),{},a);return b.data}
package/api/superadmin.js CHANGED
@@ -1,105 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createOrganization = createOrganization;
7
- exports.deleteOrganization = deleteOrganization;
8
- exports.getOrganization = getOrganization;
9
- exports.getOrganizationList = getOrganizationList;
10
- require("core-js/modules/es.promise.js");
11
- var _config = require("../config.js");
12
- var _index = require("../utils/http/index.js");
13
- var _types = require("../types/types.js");
14
- var _auth = require("./auth.js");
15
- /**
16
- * @module superadmin
17
- * This is an experimental API.
18
- */
19
-
20
- let accessLevel = _types.AccessLevel.SUPERADMIN;
21
-
22
- /**
23
- *
24
- * @returns {list}
25
- */
26
- async function getOrganizationList() {
27
- let headers = {
28
- "Content-Type": "application/json",
29
- Accept: "application/json",
30
- "x-jibb-user-jwt": await _auth.Auth.getUserToken({
31
- accessLevel: accessLevel
32
- })
33
- };
34
- let response = await _index.http.get("".concat(_config.Config.apiBaseURL, "/v1/superadmin/organizations"), headers);
35
- return response.data.organizations;
36
- }
37
- /**
38
- *
39
- * @param {number} orgId
40
- * @returns {object}
41
- */
42
- async function getOrganization(orgId) {
43
- if (orgId === "") {
44
- throw new Error("organization ID can not be empty");
45
- }
46
- let headers = {
47
- "Content-Type": "application/json",
48
- Accept: "application/json",
49
- "x-jibb-user-jwt": await _auth.Auth.getUserToken({
50
- accessLevel: accessLevel
51
- })
52
- };
53
- let response = await _index.http.get("".concat(_config.Config.apiBaseURL, "/v1/superadmin/organizations/").concat(orgId), headers);
54
- return response.data;
55
- }
56
-
57
- /**
58
- *
59
- * @param {object} param0
60
- * @param {string} param0.organizationName
61
- * @param {string} param0.ownerEmail
62
- * @param {number} param0.level - FREE = 0;BASIC = 1;STUDENT = 2;PRO = 3;BUSINESS = 4; ENTERPRISE = 5;EDUCATION = 6;
63
- * @param {number} param0.licenseCount
64
- * @param {data} param0.expiryDate
65
- * @returns - http result
66
- */
67
- async function createOrganization(_ref) {
68
- let {
69
- organizationName,
70
- ownerEmail,
71
- level,
72
- licenseCount,
73
- expiryDate
74
- } = _ref;
75
- let headers = {
76
- "Content-Type": "application/json",
77
- Accept: "application/json",
78
- "x-jibb-user-jwt": await _auth.Auth.getUserToken({
79
- accessLevel: accessLevel
80
- })
81
- };
82
- let body = {
83
- name: organizationName,
84
- owner_email: ownerEmail,
85
- level: level,
86
- license_count: licenseCount,
87
- expiry_date: expiryDate
88
- };
89
- return _index.http.post("".concat(_config.Config.apiBaseURL, "/v1/superadmin/organizations/"), body, headers);
90
- }
91
- /**
92
- *
93
- * @param {number} orgId
94
- * @returns - http result
95
- */
96
- async function deleteOrganization(orgId) {
97
- let headers = {
98
- "Content-Type": "application/json",
99
- Accept: "application/json",
100
- "x-jibb-user-jwt": await _auth.Auth.getUserToken({
101
- accessLevel: accessLevel
102
- })
103
- };
104
- return _index.http.delete("".concat(_config.Config.apiBaseURL, "/v1/superadmin/organizations/").concat(orgId), headers);
105
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createOrganization=createOrganization,exports.deleteOrganization=deleteOrganization,exports.getOrganization=getOrganization,exports.getOrganizationList=getOrganizationList,require("core-js/modules/es.promise.js");var _config=require("../config.js"),_index=require("../utils/http/index.js"),_types=require("../types/types.js"),_auth=require("./auth.js");let accessLevel=_types.AccessLevel.SUPERADMIN;async function getOrganizationList(){let a={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken({accessLevel:accessLevel})},b=await _index.http.get("".concat(_config.Config.apiBaseURL,"/v1/superadmin/organizations"),a);return b.data.organizations}async function getOrganization(a){if(""===a)throw new Error("organization ID can not be empty");let b={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken({accessLevel:accessLevel})},c=await _index.http.get("".concat(_config.Config.apiBaseURL,"/v1/superadmin/organizations/").concat(a),b);return c.data}async function createOrganization(a){let{organizationName:b,ownerEmail:c,level:d,licenseCount:e,expiryDate:f}=a,g={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken({accessLevel:accessLevel})};return _index.http.post("".concat(_config.Config.apiBaseURL,"/v1/superadmin/organizations/"),{name:b,owner_email:c,level:d,license_count:e,expiry_date:f},g)}async function deleteOrganization(a){let b={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken({accessLevel:accessLevel})};return _index.http.delete("".concat(_config.Config.apiBaseURL,"/v1/superadmin/organizations/").concat(a),b)}
package/api/user.js CHANGED
@@ -1,51 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.activateUser = activateUser;
7
- exports.getUserInfo = getUserInfo;
8
- require("core-js/modules/es.promise.js");
9
- var _config = require("../config.js");
10
- var _auth = require("./auth.js");
11
- var _index = require("../utils/http/index.js");
12
- /**
13
- * @export
14
- * EventBus.
15
- * @module User
16
- * This is an experimental API.
17
- *
18
- *
19
- */
20
-
21
- /**
22
- *
23
- * @async
24
- * @returns {object}
25
- */
26
- async function getUserInfo() {
27
- let headers = {
28
- "Content-Type": "application/json",
29
- Accept: "application/json",
30
- "x-jibb-user-jwt": await _auth.Auth.getUserToken()
31
- };
32
- let response = await _index.http.get("".concat(_config.Config.apiBaseURL, "/v1/users/me"), headers);
33
- return response.data;
34
- }
35
-
36
- /**
37
- * @async
38
- * @param {number} orgId
39
- * @returns - http result
40
- */
41
- async function activateUser(orgId) {
42
- let headers = {
43
- "Content-Type": "application/json",
44
- Accept: "application/json",
45
- "x-jibb-user-jwt": await _auth.Auth.getUserToken()
46
- };
47
- let body = {
48
- organizationId: orgId
49
- };
50
- return _index.http.post("".concat(_config.Config.apiBaseURL, "/v1/users/activate"), body, headers);
51
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.activateUser=activateUser,exports.getUserInfo=getUserInfo,require("core-js/modules/es.promise.js");var _config=require("../config.js"),_auth=require("./auth.js"),_index=require("../utils/http/index.js");async function getUserInfo(){let a={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()},b=await _index.http.get("".concat(_config.Config.apiBaseURL,"/v1/users/me"),a);return b.data}async function activateUser(a){let b={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()};return _index.http.post("".concat(_config.Config.apiBaseURL,"/v1/users/activate"),{organizationId:a},b)}
package/api/webexbot.js CHANGED
@@ -1,41 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.shareImage = shareImage;
7
- require("core-js/modules/es.promise.js");
8
- var _config = require("../config.js");
9
- var _index = require("../utils/http/index.js");
10
- /**
11
- * @module webexbot
12
- * This is an experimental API.
13
- *
14
- */
15
-
16
- /**
17
- *
18
- * @param {object} param0
19
- * @param {string} param0.meetingToken
20
- * @param {string} param0.message
21
- * @param {data} param0.image
22
- * @returns - http response
23
- */
24
- async function shareImage(_ref) {
25
- let {
26
- meetingToken,
27
- message,
28
- image
29
- } = _ref;
30
- let headers = {
31
- "Content-Type": "application/json",
32
- Accept: "application/json",
33
- "x-jibb-meeting-jwt": meetingToken
34
- };
35
- let body = {
36
- image: image,
37
- message: message
38
- };
39
- let response = await _index.http.post("".concat(_config.Config.apiBaseURL, "/v1/webexbot/message"), body, headers);
40
- return response.data;
41
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shareImage=shareImage,require("core-js/modules/es.promise.js");var _config=require("../config.js"),_index=require("../utils/http/index.js");async function shareImage(a){let{meetingToken:b,message:c,image:d}=a,e=await _index.http.post("".concat(_config.Config.apiBaseURL,"/v1/webexbot/message"),{image:d,message:c},{"Content-Type":"application/json",Accept:"application/json","x-jibb-meeting-jwt":b});return e.data}
package/api/whiteboard.js CHANGED
@@ -1,179 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Whiteboard = void 0;
7
- require("core-js/modules/es.promise.js");
8
- require("core-js/modules/web.dom-collections.iterator.js");
9
- var _config = require("../config.js");
10
- var _index = require("../utils/http/index.js");
11
- /**
12
- *
13
- * @class Whiteboard
14
- * This is an experimental API.
15
- *
16
- */
17
- class Whiteboard {
18
- constructor(meetingId, meetingToken) {
19
- this.meetingId = meetingId;
20
- this.meetingToken = meetingToken;
21
- }
22
- /**
23
- *
24
- * @async
25
- * @param {object} param0
26
- * @param {string} param0.image
27
- * @param {data} param0.type
28
- * @returns {string}
29
- */
30
- async saveImage(_ref) {
31
- let {
32
- image,
33
- type
34
- } = _ref;
35
- type = type || "";
36
- switch (type.toLowerCase()) {
37
- case "jpeg":
38
- type = "IMAGE_JPEG";
39
- break;
40
- case "webp":
41
- type = "IMAGE_WEBP";
42
- break;
43
- default:
44
- type = "";
45
- break;
46
- }
47
- let headers = {
48
- "Content-Type": "image/jpeg",
49
- Accept: "application/json",
50
- "x-jibb-meeting-jwt": this.meetingToken
51
- };
52
- let body = {
53
- image: image,
54
- type: type
55
- };
56
- let response = await _index.http.post("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(this.meetingId, "/whiteboard/images"), body, headers);
57
- return response.data.imageName;
58
- }
59
-
60
- /**
61
- *
62
- * @async
63
- * @returns {array}
64
- */
65
- async getImageList() {
66
- let headers = {
67
- "Content-Type": "application/json",
68
- Accept: "application/json",
69
- "x-jibb-meeting-jwt": this.meetingToken
70
- };
71
- let response = await _index.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(this.meetingId, "/whiteboard/images"), headers);
72
- return response.data.imagesName;
73
- }
74
-
75
- /**
76
- *
77
- * @async
78
- * @param {string} imageName
79
- * @returns {data}
80
- */
81
- async getImage(imageName) {
82
- let headers = {
83
- "Content-Type": "application/json",
84
- Accept: "image/jpeg",
85
- "x-jibb-meeting-jwt": this.meetingToken
86
- };
87
- let url = "".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(this.meetingId, "/whiteboard/images/").concat(imageName);
88
- let response = await _index.http.get(url, headers, {
89
- responseType: "arraybuffer"
90
- });
91
- return response.data;
92
- }
93
- /**
94
- *
95
- * @async
96
- * @returns {array}
97
- */
98
-
99
- async getImages() {
100
- let imageList = [];
101
- let imageNameList = await this.getImageList();
102
- for (const imageName of imageNameList) {
103
- let headers = {
104
- "Content-Type": "application/json",
105
- Accept: "application/json",
106
- "x-jibb-meeting-jwt": this.meetingToken
107
- };
108
- let response = await _index.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(this.meetingId, "/whiteboard/images/").concat(imageName), {
109
- headers
110
- });
111
- imageList.push({
112
- imageName: imageName,
113
- data: response.data
114
- });
115
- }
116
- return imageList;
117
- }
118
-
119
- /**
120
- *
121
- * @param {string} imageName
122
- * @returns - http result
123
- */
124
- async deleteImage(imageName) {
125
- let headers = {
126
- "Content-Type": "application/json",
127
- Accept: "application/json",
128
- "x-jibb-meeting-jwt": this.meetingToken
129
- };
130
- return _index.http.delete("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(this.meetingId, "/whiteboard/images/").concat(imageName), headers);
131
- }
132
- /**
133
- *
134
- * @async
135
- * @param {string} board
136
- * @returns {}
137
- */
138
- async saveBoard(board) {
139
- let headers = {
140
- "Content-Type": "application/json",
141
- Accept: "application/json",
142
- "x-jibb-meeting-jwt": this.meetingToken
143
- };
144
- let body = {
145
- board: board
146
- };
147
- let response = await _index.http.post("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(this.meetingId, "/whiteboard"), body, headers);
148
- return response.data;
149
- }
150
- /**
151
- *
152
- * @async
153
- * @returns {string}
154
- */
155
- async getBoard() {
156
- let headers = {
157
- "Content-Type": "application/json",
158
- Accept: "image/jpeg",
159
- "x-jibb-meeting-jwt": this.meetingToken
160
- };
161
- let response = await _index.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(this.meetingId, "/whiteboard"), headers);
162
- return response.data;
163
- }
164
-
165
- /**
166
- *
167
- * @async
168
- * @returns - http result
169
- */
170
- async deleteBoard() {
171
- let headers = {
172
- "Content-Type": "application/json",
173
- Accept: "application/json",
174
- "x-jibb-meeting-jwt": this.meetingToken
175
- };
176
- return _index.http.delete("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(this.meetingId, "/whiteboard"), headers);
177
- }
178
- }
179
- exports.Whiteboard = Whiteboard;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Whiteboard=void 0,require("core-js/modules/es.promise.js"),require("core-js/modules/web.dom-collections.iterator.js");var _config=require("../config.js"),_index=require("../utils/http/index.js");class Whiteboard{constructor(a,b){this.meetingId=a,this.meetingToken=b}async saveImage(a){let{image:b,type:c}=a;switch(c=c||"",c.toLowerCase()){case"jpeg":c="IMAGE_JPEG";break;case"webp":c="IMAGE_WEBP";break;default:c="";}let d={"Content-Type":"image/jpeg",Accept:"application/json","x-jibb-meeting-jwt":this.meetingToken},e={image:b,type:c},f=await _index.http.post("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(this.meetingId,"/whiteboard/images"),e,d);return f.data.imageName}async getImageList(){let a={"Content-Type":"application/json",Accept:"application/json","x-jibb-meeting-jwt":this.meetingToken},b=await _index.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(this.meetingId,"/whiteboard/images"),a);return b.data.imagesName}async getImage(a){let b={"Content-Type":"application/json",Accept:"image/jpeg","x-jibb-meeting-jwt":this.meetingToken},c="".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(this.meetingId,"/whiteboard/images/").concat(a),d=await _index.http.get(c,b,{responseType:"arraybuffer"});return d.data}async getImages(){let a=[],b=await this.getImageList();for(const c of b){let b={"Content-Type":"application/json",Accept:"application/json","x-jibb-meeting-jwt":this.meetingToken},d=await _index.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(this.meetingId,"/whiteboard/images/").concat(c),{headers:b});a.push({imageName:c,data:d.data})}return a}async deleteImage(a){let b={"Content-Type":"application/json",Accept:"application/json","x-jibb-meeting-jwt":this.meetingToken};return _index.http.delete("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(this.meetingId,"/whiteboard/images/").concat(a),b)}async saveBoard(a){let b={"Content-Type":"application/json",Accept:"application/json","x-jibb-meeting-jwt":this.meetingToken},c=await _index.http.post("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(this.meetingId,"/whiteboard"),{board:a},b);return c.data}async getBoard(){let a={"Content-Type":"application/json",Accept:"image/jpeg","x-jibb-meeting-jwt":this.meetingToken},b=await _index.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(this.meetingId,"/whiteboard"),a);return b.data}async deleteBoard(){let a={"Content-Type":"application/json",Accept:"application/json","x-jibb-meeting-jwt":this.meetingToken};return _index.http.delete("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(this.meetingId,"/whiteboard"),a)}}exports.Whiteboard=Whiteboard;
package/config.js CHANGED
@@ -1,16 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Config = void 0;
7
- class ConfigClass {
8
- constructor() {
9
- this.apiBaseURL = process.env.API_BASE_URL || "https://api.jibb.ai";
10
- }
11
- setApiBaseURL(url) {
12
- this.apiBaseURL = url;
13
- }
14
- }
15
- let Config = new ConfigClass();
16
- exports.Config = Config;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Config=void 0;class ConfigClass{constructor(){this.apiBaseURL=process.env.API_BASE_URL||"https://api.jibb.ai"}setApiBaseURL(a){this.apiBaseURL=a}}let Config=new ConfigClass;exports.Config=Config;