@jibb-open/jssdk 3.5.8 → 3.5.10
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/admin.js +418 -0
- package/api/auth.js +246 -0
- package/api/eventbus.js +249 -0
- package/api/index.js +53 -0
- package/api/meeting.js +488 -0
- package/api/recording.js +260 -0
- package/api/superadmin.js +105 -0
- package/api/user.js +51 -0
- package/api/webexbot.js +41 -0
- package/api/whiteboard.js +179 -0
- package/config.js +16 -0
- package/examples/browser/462.jibb.js +306 -0
- package/{src/examples → examples}/browser/index.html +0 -0
- package/examples/browser/jibb.js +7381 -0
- package/examples/browser/startSession.js +102 -0
- package/{src/examples → examples}/examples.js +1 -0
- package/examples/webexDevicesMacros/cameraPresets/jibb.js +280 -0
- package/examples/webexDevicesMacros/simplestExample/jibb.js +182 -0
- package/examples/webexDevicesMacros/webexDevice JSSDK/jibb_WebexXapi.js +3033 -0
- package/examples/webexDevicesMacros/withCameraControl/jibb.js +264 -0
- package/package.json +1 -1
- package/post-processing.js +43 -0
- package/types/exceptions.js +55 -0
- package/{src/types → types}/jibb.pb.js +5 -38
- package/types/proto.js +15 -0
- package/types/types.js +67 -0
- package/utils/cached_variable.js +25 -0
- package/utils/future.js +31 -0
- package/utils/http/http.axios.js +41 -0
- package/utils/http/index.js +10 -0
- package/utils/index.js +11 -0
- package/utils/logger/index.js +19 -0
- package/utils/logger/logger.empty.js +25 -0
- package/utils/logger/logger.pino.js +19 -0
- package/ws/connection_base.js +95 -0
- package/ws/eventbus.js +376 -0
- package/ws/index.js +36 -0
- package/ws/ipsa.js +262 -0
- package/ws/meeting.js +181 -0
- package/ws/observable_connection.js +87 -0
- package/ws/retry_connection.js +94 -0
- package/.babelrc +0 -31
- package/README.md +0 -4
- package/src/api/admin.js +0 -333
- package/src/api/auth.js +0 -208
- package/src/api/eventbus.js +0 -246
- package/src/api/index.js +0 -26
- package/src/api/meeting.js +0 -421
- package/src/api/recording.js +0 -225
- package/src/api/superadmin.js +0 -84
- package/src/api/user.js +0 -46
- package/src/api/webexbot.js +0 -32
- package/src/api/whiteboard.js +0 -175
- package/src/config.js +0 -12
- package/src/examples/browser/462.jibb.js +0 -1
- package/src/examples/browser/jibb.js +0 -2
- package/src/examples/browser/startSession.js +0 -112
- package/src/examples/webexDevicesMacros/cameraPresets/jibb.js +0 -338
- package/src/examples/webexDevicesMacros/simplestExample/jibb.js +0 -212
- package/src/examples/webexDevicesMacros/webexDevice JSSDK/jibb_WebexXapi.js +0 -2
- package/src/examples/webexDevicesMacros/withCameraControl/jibb.js +0 -303
- package/src/index.webex-devices.js +0 -13
- package/src/post-processing.js +0 -39
- package/src/types/exceptions.js +0 -48
- package/src/types/proto.js +0 -7
- package/src/types/types.js +0 -64
- package/src/utils/cached_variable.js +0 -23
- package/src/utils/future.js +0 -24
- package/src/utils/http/http.axios.js +0 -34
- package/src/utils/http/http.xapi.js +0 -87
- package/src/utils/http/index.js +0 -8
- package/src/utils/index.js +0 -5
- package/src/utils/logger/index.js +0 -11
- package/src/utils/logger/logger.empty.js +0 -25
- package/src/utils/logger/logger.pino.js +0 -15
- package/src/ws/connection_base.js +0 -81
- package/src/ws/eventbus.js +0 -363
- package/src/ws/index.js +0 -15
- package/src/ws/ipsa.js +0 -246
- package/src/ws/meeting.js +0 -170
- package/src/ws/observable_connection.js +0 -84
- package/src/ws/retry_connection.js +0 -82
- package/webpack.config.cjs +0 -144
package/api/recording.js
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
}
|
package/api/user.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
}
|
package/api/webexbot.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
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;
|
package/config.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
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;
|