@jibb-open/jssdk 3.5.8 → 3.5.9

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.
Files changed (42) hide show
  1. package/dist/api/admin.js +418 -0
  2. package/dist/api/auth.js +246 -0
  3. package/dist/api/eventbus.js +249 -0
  4. package/dist/api/index.js +53 -0
  5. package/dist/api/meeting.js +488 -0
  6. package/dist/api/recording.js +260 -0
  7. package/dist/api/superadmin.js +105 -0
  8. package/dist/api/user.js +51 -0
  9. package/dist/api/webexbot.js +41 -0
  10. package/dist/api/whiteboard.js +179 -0
  11. package/dist/config.js +16 -0
  12. package/dist/examples/browser/462.jibb.js +306 -0
  13. package/dist/examples/browser/index.html +17 -0
  14. package/dist/examples/browser/jibb.js +7381 -0
  15. package/dist/examples/browser/startSession.js +102 -0
  16. package/dist/examples/examples.js +6 -0
  17. package/dist/examples/webexDevicesMacros/cameraPresets/jibb.js +280 -0
  18. package/dist/examples/webexDevicesMacros/simplestExample/jibb.js +182 -0
  19. package/dist/examples/webexDevicesMacros/webexDevice JSSDK/jibb_WebexXapi.js +3033 -0
  20. package/dist/examples/webexDevicesMacros/withCameraControl/jibb.js +264 -0
  21. package/dist/package.json +69 -0
  22. package/dist/post-processing.js +43 -0
  23. package/dist/types/exceptions.js +55 -0
  24. package/dist/types/jibb.pb.js +1324 -0
  25. package/dist/types/proto.js +15 -0
  26. package/dist/types/types.js +67 -0
  27. package/dist/utils/cached_variable.js +25 -0
  28. package/dist/utils/future.js +31 -0
  29. package/dist/utils/http/http.axios.js +41 -0
  30. package/dist/utils/http/index.js +10 -0
  31. package/dist/utils/index.js +11 -0
  32. package/dist/utils/logger/index.js +19 -0
  33. package/dist/utils/logger/logger.empty.js +25 -0
  34. package/dist/utils/logger/logger.pino.js +19 -0
  35. package/dist/ws/connection_base.js +95 -0
  36. package/dist/ws/eventbus.js +376 -0
  37. package/dist/ws/index.js +36 -0
  38. package/dist/ws/ipsa.js +262 -0
  39. package/dist/ws/meeting.js +181 -0
  40. package/dist/ws/observable_connection.js +87 -0
  41. package/dist/ws/retry_connection.js +94 -0
  42. package/package.json +1 -1
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.types = exports.meeting = exports.ipsa = exports.cilix = void 0;
7
+ const root = require("./jibb.pb.js");
8
+ const ipsa = root.lookup("jibb.ipsa.v1");
9
+ exports.ipsa = ipsa;
10
+ const types = root.lookup("types");
11
+ exports.types = types;
12
+ const cilix = root.lookup("cilix");
13
+ exports.cilix = cilix;
14
+ const meeting = root.lookup("meeting");
15
+ exports.meeting = meeting;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.UserType = exports.UserClaims = exports.MeetingTypes = exports.MeetingClaims = exports.AccessLevel = void 0;
7
+ var _jwtDecode = _interopRequireDefault(require("jwt-decode"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const MeetingTypes = {
10
+ DEFAULT: 0,
11
+ WHITEBOARD: 1
12
+ };
13
+ exports.MeetingTypes = MeetingTypes;
14
+ const AccessLevel = {
15
+ USER: "USER",
16
+ ADMIN: "ADMIN",
17
+ SUPERADMIN: "SUPERADMIN"
18
+ };
19
+ exports.AccessLevel = AccessLevel;
20
+ const UserType = {
21
+ UNKNOWN: 0,
22
+ LIMITED: 1,
23
+ MEMBER: 2,
24
+ ADMIN: 3,
25
+ OWNER: 4
26
+ };
27
+ exports.UserType = UserType;
28
+ class MeetingClaims {
29
+ constructor(token) {
30
+ this.claims = (0, _jwtDecode.default)(token);
31
+ this.expiryTime = new Date(this.claims.exp * 1000);
32
+ this.owner = this.claims.data.owner;
33
+ this.meetindId = this.claims.data.meeting_id;
34
+ this.title = this.claims.data.title;
35
+ this.capacity = this.claims.data.capacity;
36
+ this.permission = this.claims.data.permission;
37
+ this.meetingType = this.claims.data.meeting_type;
38
+ this.isTemporary = this.claims.data.is_temporary;
39
+ }
40
+ getSecondsUntilExpiry() {
41
+ return this.expiryTime - Date.now() - 60;
42
+ }
43
+ isExpired() {
44
+ return this.getSecondsUntilExpiry() <= 0;
45
+ }
46
+ }
47
+ exports.MeetingClaims = MeetingClaims;
48
+ class UserClaims {
49
+ constructor(token) {
50
+ var _this$claims$data;
51
+ this.token = token;
52
+ this.claims = (0, _jwtDecode.default)(token);
53
+ this.expiryTime = new Date(this.claims.exp * 1000);
54
+ this.email = (_this$claims$data = this.claims.data) === null || _this$claims$data === void 0 ? void 0 : _this$claims$data.email;
55
+ this.userId = this.claims.sub;
56
+ }
57
+ getSecondsUntilExpiry() {
58
+ return this.expiryTime - Date.now() - 60;
59
+ }
60
+ isExpired() {
61
+ return this.getSecondsUntilExpiry() <= 0;
62
+ }
63
+ getUserId() {
64
+ return this.userId;
65
+ }
66
+ }
67
+ exports.UserClaims = UserClaims;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CachedVariable = void 0;
7
+ class CachedVariable {
8
+ constructor() {
9
+ let expirySeconds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 60;
10
+ this.value = null;
11
+ this.expirySeconds = expirySeconds;
12
+ this.expiryTime = Date.now();
13
+ }
14
+ isExpired() {
15
+ return this.value == null || Date.now() > this.expiryTime;
16
+ }
17
+ get() {
18
+ if (this.isExpired()) return undefined;else return this.value;
19
+ }
20
+ set(value) {
21
+ this.value = value;
22
+ this.expiryTime = Date.now() + this.expirySeconds * 1000;
23
+ }
24
+ }
25
+ exports.CachedVariable = CachedVariable;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Future = void 0;
7
+ require("core-js/modules/es.promise.js");
8
+ class Future {
9
+ constructor() {
10
+ let self = this;
11
+ this.resolve = undefined;
12
+ this.reject = undefined;
13
+ this.promise = new Promise((resolve, reject) => {
14
+ self.resolve = resolve;
15
+ self.reject = reject;
16
+ });
17
+ this.promise.catch(() => {
18
+ return undefined;
19
+ });
20
+ }
21
+ get() {
22
+ return this.promise;
23
+ }
24
+ reject(val) {
25
+ this.reject(val);
26
+ }
27
+ set(val) {
28
+ this.resolve(val);
29
+ }
30
+ }
31
+ exports.Future = Future;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.promise.js");
4
+ require("core-js/modules/es.global-this.js");
5
+ var _axios = _interopRequireDefault(require("axios"));
6
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7
+ class HttpClient {
8
+ async get(url, headers) {
9
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
10
+ options.headers = headers;
11
+ return _axios.default.get(url, options);
12
+ }
13
+ async post(url) {
14
+ let body = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
15
+ let headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
16
+ return _axios.default.post(url, body, {
17
+ headers: headers
18
+ });
19
+ }
20
+ async patch(url) {
21
+ let body = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
22
+ let headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23
+ return _axios.default.patch(url, body, {
24
+ headers: headers
25
+ });
26
+ }
27
+ async put(url) {
28
+ let body = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
29
+ let headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
30
+ return _axios.default.put(url, body, {
31
+ headers: headers
32
+ });
33
+ }
34
+ async delete(url) {
35
+ let headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
36
+ return _axios.default.delete(url, {
37
+ headers: headers
38
+ });
39
+ }
40
+ }
41
+ globalThis.http = new HttpClient();
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.http = void 0;
7
+ require("core-js/modules/es.global-this.js");
8
+ require("./http.axios.js");
9
+ let http = globalThis.http;
10
+ exports.http = http;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _logger = require("./logger.js");
8
+ var _default = {
9
+ logger: _logger.logger
10
+ };
11
+ exports.default = _default;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.logger = exports.initPinoLogger = void 0;
7
+ require("core-js/modules/es.promise.js");
8
+ require("core-js/modules/web.dom-collections.iterator.js");
9
+ var _loggerEmpty = require("./logger.empty.js");
10
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
+ let logger = _loggerEmpty.logger;
13
+ exports.logger = logger;
14
+ const initPinoLogger = () => {
15
+ Promise.resolve().then(() => _interopRequireWildcard(require("./logger.pino.js"))).then(_exports => {
16
+ exports.logger = logger = _exports.logger;
17
+ });
18
+ };
19
+ exports.initPinoLogger = initPinoLogger;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.logger = void 0;
7
+ class EmptyLoggerr {
8
+ error() {
9
+ // This is intentional
10
+ }
11
+ debug() {
12
+ // This is intentional
13
+ }
14
+ warn() {
15
+ // This is intentional
16
+ }
17
+ info() {
18
+ // This is intentional
19
+ }
20
+ setLevel() {
21
+ // This is intentional
22
+ }
23
+ }
24
+ let logger = new EmptyLoggerr();
25
+ exports.logger = logger;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.logger = void 0;
7
+ var _pino = _interopRequireDefault(require("pino"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ let logger = new _pino.default({
10
+ browser: {
11
+ asObject: false
12
+ },
13
+ timestamp: false,
14
+ level: "warn"
15
+ });
16
+ exports.logger = logger;
17
+ logger.setLevel = level => {
18
+ logger.level = level;
19
+ };
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ConnectionStatus = exports.ConnectionBase = void 0;
7
+ require("core-js/modules/web.dom-collections.iterator.js");
8
+ var _index = require("../utils/logger/index.js");
9
+ var _future = require("../utils/future.js");
10
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
11
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
12
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
13
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
14
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
15
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
16
+ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
17
+ const ConnectionStatus = {
18
+ CONNECTED: "CONNECTED",
19
+ DISCONNECTED: "DISCONNECTED",
20
+ CONNECTING: "CONNECTING"
21
+ };
22
+ exports.ConnectionStatus = ConnectionStatus;
23
+ var _name = /*#__PURE__*/new WeakMap();
24
+ var _connectionStatus = /*#__PURE__*/new WeakMap();
25
+ var _connectionFuture = /*#__PURE__*/new WeakMap();
26
+ class ConnectionBase {
27
+ constructor(name) {
28
+ _classPrivateFieldInitSpec(this, _name, {
29
+ writable: true,
30
+ value: void 0
31
+ });
32
+ _classPrivateFieldInitSpec(this, _connectionStatus, {
33
+ writable: true,
34
+ value: void 0
35
+ });
36
+ _classPrivateFieldInitSpec(this, _connectionFuture, {
37
+ writable: true,
38
+ value: void 0
39
+ });
40
+ _classPrivateFieldSet(this, _name, name);
41
+ _classPrivateFieldSet(this, _connectionStatus, ConnectionStatus.DISCONNECTED);
42
+ _classPrivateFieldSet(this, _connectionFuture, new _future.Future());
43
+ _classPrivateFieldGet(this, _connectionFuture).reject("disconnected");
44
+ }
45
+ getName() {
46
+ return _classPrivateFieldGet(this, _name);
47
+ }
48
+ connect() {
49
+ switch (_classPrivateFieldGet(this, _connectionStatus)) {
50
+ case ConnectionStatus.CONNECTED:
51
+ _index.logger.error("".concat(this.getName(), ": already connected"));
52
+ break;
53
+ case ConnectionStatus.CONNECTING:
54
+ _index.logger.error("".concat(this.getName(), ": connection already in progress"));
55
+ break;
56
+ case ConnectionStatus.DISCONNECTED:
57
+ _index.logger.info("".concat(this.getName(), ": connecting ..."));
58
+ _classPrivateFieldSet(this, _connectionStatus, ConnectionStatus.CONNECTING);
59
+ _classPrivateFieldSet(this, _connectionFuture, new _future.Future());
60
+ break;
61
+ }
62
+ }
63
+ disconnect() {
64
+ this.onDisconnected();
65
+ }
66
+ onConnected() {
67
+ _index.logger.info("".concat(this.getName(), ": connected"));
68
+ _classPrivateFieldSet(this, _connectionStatus, ConnectionStatus.CONNECTED);
69
+ _classPrivateFieldGet(this, _connectionFuture).set("connected");
70
+ }
71
+ onDisconnected() {
72
+ _index.logger.warn("".concat(this.getName(), ": disconnected"));
73
+ _classPrivateFieldSet(this, _connectionStatus, ConnectionStatus.DISCONNECTED);
74
+ _classPrivateFieldGet(this, _connectionFuture).reject("disconnected");
75
+ }
76
+ isConnected() {
77
+ return _classPrivateFieldGet(this, _connectionStatus) == ConnectionStatus.CONNECTED;
78
+ }
79
+ waitForConnection() {
80
+ return _classPrivateFieldGet(this, _connectionFuture).get();
81
+ }
82
+ getConnectionStatus() {
83
+ return _classPrivateFieldGet(this, _connectionStatus);
84
+ }
85
+ onErrorMessage(code, reason) {
86
+ _index.logger.warn("".concat(this.getName(), ": onErrorMessage, code: ").concat(code, ", reason: ").concat(reason));
87
+ }
88
+ onWarningMessage(code, reason) {
89
+ _index.logger.warn("".concat(this.getName(), ": onWarningMessage, code: ").concat(code, ", reason: ").concat(reason));
90
+ }
91
+ onInfoMessage(code, reason) {
92
+ _index.logger.info("".concat(this.getName(), ": onInfoMessage, code: ").concat(code, ", reason: ").concat(reason));
93
+ }
94
+ }
95
+ exports.ConnectionBase = ConnectionBase;