@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.
Files changed (83) hide show
  1. package/api/admin.js +418 -0
  2. package/api/auth.js +246 -0
  3. package/api/eventbus.js +249 -0
  4. package/api/index.js +53 -0
  5. package/api/meeting.js +488 -0
  6. package/api/recording.js +260 -0
  7. package/api/superadmin.js +105 -0
  8. package/api/user.js +51 -0
  9. package/api/webexbot.js +41 -0
  10. package/api/whiteboard.js +179 -0
  11. package/config.js +16 -0
  12. package/examples/browser/462.jibb.js +306 -0
  13. package/{src/examples → examples}/browser/index.html +0 -0
  14. package/examples/browser/jibb.js +7381 -0
  15. package/examples/browser/startSession.js +102 -0
  16. package/{src/examples → examples}/examples.js +1 -0
  17. package/examples/webexDevicesMacros/cameraPresets/jibb.js +280 -0
  18. package/examples/webexDevicesMacros/simplestExample/jibb.js +182 -0
  19. package/examples/webexDevicesMacros/webexDevice JSSDK/jibb_WebexXapi.js +3033 -0
  20. package/examples/webexDevicesMacros/withCameraControl/jibb.js +264 -0
  21. package/package.json +1 -1
  22. package/post-processing.js +43 -0
  23. package/types/exceptions.js +55 -0
  24. package/{src/types → types}/jibb.pb.js +5 -38
  25. package/types/proto.js +15 -0
  26. package/types/types.js +67 -0
  27. package/utils/cached_variable.js +25 -0
  28. package/utils/future.js +31 -0
  29. package/utils/http/http.axios.js +41 -0
  30. package/utils/http/index.js +10 -0
  31. package/utils/index.js +11 -0
  32. package/utils/logger/index.js +19 -0
  33. package/utils/logger/logger.empty.js +25 -0
  34. package/utils/logger/logger.pino.js +19 -0
  35. package/ws/connection_base.js +95 -0
  36. package/ws/eventbus.js +376 -0
  37. package/ws/index.js +36 -0
  38. package/ws/ipsa.js +262 -0
  39. package/ws/meeting.js +181 -0
  40. package/ws/observable_connection.js +87 -0
  41. package/ws/retry_connection.js +94 -0
  42. package/.babelrc +0 -31
  43. package/README.md +0 -4
  44. package/src/api/admin.js +0 -333
  45. package/src/api/auth.js +0 -208
  46. package/src/api/eventbus.js +0 -246
  47. package/src/api/index.js +0 -26
  48. package/src/api/meeting.js +0 -421
  49. package/src/api/recording.js +0 -225
  50. package/src/api/superadmin.js +0 -84
  51. package/src/api/user.js +0 -46
  52. package/src/api/webexbot.js +0 -32
  53. package/src/api/whiteboard.js +0 -175
  54. package/src/config.js +0 -12
  55. package/src/examples/browser/462.jibb.js +0 -1
  56. package/src/examples/browser/jibb.js +0 -2
  57. package/src/examples/browser/startSession.js +0 -112
  58. package/src/examples/webexDevicesMacros/cameraPresets/jibb.js +0 -338
  59. package/src/examples/webexDevicesMacros/simplestExample/jibb.js +0 -212
  60. package/src/examples/webexDevicesMacros/webexDevice JSSDK/jibb_WebexXapi.js +0 -2
  61. package/src/examples/webexDevicesMacros/withCameraControl/jibb.js +0 -303
  62. package/src/index.webex-devices.js +0 -13
  63. package/src/post-processing.js +0 -39
  64. package/src/types/exceptions.js +0 -48
  65. package/src/types/proto.js +0 -7
  66. package/src/types/types.js +0 -64
  67. package/src/utils/cached_variable.js +0 -23
  68. package/src/utils/future.js +0 -24
  69. package/src/utils/http/http.axios.js +0 -34
  70. package/src/utils/http/http.xapi.js +0 -87
  71. package/src/utils/http/index.js +0 -8
  72. package/src/utils/index.js +0 -5
  73. package/src/utils/logger/index.js +0 -11
  74. package/src/utils/logger/logger.empty.js +0 -25
  75. package/src/utils/logger/logger.pino.js +0 -15
  76. package/src/ws/connection_base.js +0 -81
  77. package/src/ws/eventbus.js +0 -363
  78. package/src/ws/index.js +0 -15
  79. package/src/ws/ipsa.js +0 -246
  80. package/src/ws/meeting.js +0 -170
  81. package/src/ws/observable_connection.js +0 -84
  82. package/src/ws/retry_connection.js +0 -82
  83. package/webpack.config.cjs +0 -144
@@ -1,64 +0,0 @@
1
- import jwt_decode from "jwt-decode";
2
-
3
- export const MeetingTypes = {
4
- DEFAULT: 0,
5
- WHITEBOARD: 1,
6
- }
7
-
8
- export const AccessLevel = {
9
- USER: "USER",
10
- ADMIN: "ADMIN",
11
- SUPERADMIN: "SUPERADMIN",
12
- };
13
-
14
- export const UserType = {
15
- UNKNOWN: 0,
16
- LIMITED: 1,
17
- MEMBER: 2,
18
- ADMIN: 3,
19
- OWNER: 4,
20
- };
21
-
22
- export class MeetingClaims {
23
- constructor(token) {
24
- this.claims = jwt_decode(token)
25
- this.expiryTime = new Date(this.claims.exp * 1000)
26
- this.owner = this.claims.data.owner
27
- this.meetindId = this.claims.data.meeting_id
28
- this.title = this.claims.data.title
29
- this.capacity = this.claims.data.capacity
30
- this.permission = this.claims.data.permission
31
- this.meetingType = this.claims.data.meeting_type
32
- this.isTemporary = this.claims.data.is_temporary
33
- }
34
-
35
- getSecondsUntilExpiry() {
36
- return this.expiryTime - Date.now() - 60
37
- }
38
-
39
- isExpired() {
40
- return this.getSecondsUntilExpiry() <= 0
41
- }
42
- }
43
-
44
- export class UserClaims {
45
- constructor(token) {
46
- this.token = token
47
- this.claims = jwt_decode(token)
48
- this.expiryTime = new Date(this.claims.exp * 1000)
49
- this.email = this.claims.data?.email
50
- this.userId = this.claims.sub
51
- }
52
-
53
- getSecondsUntilExpiry() {
54
- return this.expiryTime - Date.now() - 60
55
- }
56
-
57
- isExpired() {
58
- return this.getSecondsUntilExpiry() <= 0
59
- }
60
-
61
- getUserId() {
62
- return this.userId
63
- }
64
- }
@@ -1,23 +0,0 @@
1
- export class CachedVariable {
2
- constructor(expirySeconds = 60) {
3
- this.value = null
4
- this.expirySeconds = expirySeconds
5
- this.expiryTime = Date.now()
6
- }
7
-
8
- isExpired() {
9
- return (this.value == null) || (Date.now() > this.expiryTime)
10
- }
11
-
12
- get() {
13
- if (this.isExpired())
14
- return undefined
15
- else
16
- return this.value
17
- }
18
-
19
- set(value) {
20
- this.value = value
21
- this.expiryTime = Date.now() + (this.expirySeconds * 1000)
22
- }
23
- }
@@ -1,24 +0,0 @@
1
- export class Future {
2
- constructor() {
3
- let self = this
4
- this.resolve = undefined
5
- this.reject = undefined
6
- this.promise = new Promise((resolve, reject) => {
7
- self.resolve = resolve
8
- self.reject = reject
9
- })
10
- this.promise.catch(() => {return undefined})
11
- }
12
-
13
- get() {
14
- return this.promise
15
- }
16
-
17
- reject(val) {
18
- this.reject(val)
19
- }
20
-
21
- set(val) {
22
- this.resolve(val)
23
- }
24
- }
@@ -1,34 +0,0 @@
1
- import axios from "axios"
2
-
3
- class HttpClient {
4
- async get(url, headers, options = {}) {
5
- options.headers = headers
6
- return axios.get(url, options)
7
- }
8
-
9
- async post(url, body = {}, headers = {}) {
10
- return axios.post(url, body, {
11
- headers: headers,
12
- })
13
- }
14
-
15
- async patch(url, body = {}, headers = {}) {
16
- return axios.patch(url, body, {
17
- headers: headers,
18
- })
19
- }
20
-
21
- async put(url, body = {}, headers = {}) {
22
- return axios.put(url, body, {
23
- headers: headers,
24
- })
25
- }
26
-
27
- async delete(url, headers = {}) {
28
- return axios.delete(url, {
29
- headers: headers,
30
- })
31
- }
32
- }
33
-
34
- globalThis.http = new HttpClient()
@@ -1,87 +0,0 @@
1
- import xapi from "xapi";
2
-
3
- class HttpClient {
4
- async get(url, headers) {
5
- let response = await xapi.Command.HttpClient.Get({
6
- AllowInsecureHTTPS: "True",
7
- Header: this.#makeStringHeader(headers),
8
- Url: url,
9
- ResultBody: "PlainText",
10
- })
11
-
12
- return this.#parseAndChangeResponseKeyName(response)
13
- }
14
-
15
- async post(url, body = {}, headers = {}) {
16
- let response = await xapi.Command.HttpClient.Post(
17
- {
18
- AllowInsecureHTTPS: "True",
19
- Header: this.#makeStringHeader(headers),
20
- Url: url,
21
- ResultBody: "PlainText",
22
- },
23
- JSON.stringify(body)
24
- )
25
- return this.#parseAndChangeResponseKeyName(response)
26
- }
27
-
28
- async patch(url, body = {}, headers = {}) {
29
- let response = await xapi.Command.HttpClient.Patch(
30
- {
31
- AllowInsecureHTTPS: "True",
32
- Header: this.#makeStringHeader(headers),
33
- Url: url,
34
- ResultBody: "PlainText",
35
- },
36
- JSON.stringify(body)
37
- )
38
-
39
- return this.#parseAndChangeResponseKeyName(response)
40
- }
41
-
42
- async put(url, body = {}, headers = {}) {
43
- let response = await xapi.Command.HttpClient.Put(
44
- {
45
- AllowInsecureHTTPS: "True",
46
- Header: this.#makeStringHeader(headers),
47
- Url: url,
48
- ResultBody: "PlainText",
49
- },
50
- JSON.stringify(body)
51
- )
52
-
53
- return this.#parseAndChangeResponseKeyName(response)
54
- }
55
-
56
- async delete(url, headers = {}) {
57
- let response = await xapi.Command.HttpClient.Delete({
58
- AllowInsecureHTTPS: "True",
59
- Header: this.#makeStringHeader(headers),
60
- Url: url,
61
- ResultBody: "PlainText",
62
- })
63
-
64
- return this.#parseAndChangeResponseKeyName(response)
65
- }
66
-
67
- #makeStringHeader(header) {
68
- let result = []
69
- for (const [k, v] of Object.entries(header)) {
70
- result.push(`${k}: ${v}`)
71
- }
72
- return result
73
- }
74
-
75
- #parseAndChangeResponseKeyName(obj) {
76
- let result = obj
77
- result["data"] = JSON.parse(result.Body)
78
- delete result["Body"]
79
- return result
80
- }
81
- }
82
-
83
- // webex devices running enviroment dose not have globalThis object, creating global.globalThis.http in this file enable the value assingment index.js line 4
84
-
85
- global.globalThis = {}
86
- global.globalThis.http = new HttpClient()
87
-
@@ -1,8 +0,0 @@
1
- import './http.axios.js'
2
- import "./http.xapi.js"
3
-
4
- let http = globalThis.http
5
-
6
- export {
7
- http
8
- }
@@ -1,5 +0,0 @@
1
- import {logger} from './logger.js'
2
-
3
- export default {
4
- logger,
5
- }
@@ -1,11 +0,0 @@
1
- import {logger as emptyLogger} from "./logger.empty.js"
2
-
3
- let logger = emptyLogger;
4
-
5
- const initPinoLogger = () => {
6
- import("./logger.pino.js").then((exports) => {
7
- logger = exports.logger
8
- })
9
- }
10
-
11
- export {logger, initPinoLogger}
@@ -1,25 +0,0 @@
1
- class EmptyLoggerr {
2
- error() {
3
- // This is intentional
4
- }
5
-
6
- debug() {
7
- // This is intentional
8
- }
9
-
10
- warn() {
11
- // This is intentional
12
- }
13
-
14
- info() {
15
- // This is intentional
16
- }
17
-
18
- setLevel() {
19
- // This is intentional
20
- }
21
- }
22
-
23
- let logger = new EmptyLoggerr()
24
-
25
- export {logger}
@@ -1,15 +0,0 @@
1
- import Pino from "pino"
2
-
3
- let logger = new Pino({
4
- browser: {
5
- asObject: false,
6
- },
7
- timestamp: false,
8
- level: "warn",
9
- })
10
-
11
- logger.setLevel = (level) => {
12
- logger.level = level
13
- }
14
-
15
- export { logger }
@@ -1,81 +0,0 @@
1
- import { logger } from "../utils/logger/index.js"
2
- import { Future } from "../utils/future.js"
3
-
4
- export const ConnectionStatus = {
5
- CONNECTED: "CONNECTED",
6
- DISCONNECTED: "DISCONNECTED",
7
- CONNECTING: "CONNECTING",
8
- }
9
-
10
- export class ConnectionBase {
11
- #name
12
- #connectionStatus
13
- #connectionFuture
14
-
15
- constructor(name) {
16
- this.#name = name
17
- this.#connectionStatus = ConnectionStatus.DISCONNECTED
18
- this.#connectionFuture = new Future()
19
- this.#connectionFuture.reject("disconnected")
20
- }
21
-
22
- getName() {
23
- return this.#name
24
- }
25
-
26
- connect() {
27
- switch (this.#connectionStatus) {
28
- case ConnectionStatus.CONNECTED:
29
- logger.error(`${this.getName()}: already connected`)
30
- break
31
- case ConnectionStatus.CONNECTING:
32
- logger.error(`${this.getName()}: connection already in progress`)
33
- break
34
- case ConnectionStatus.DISCONNECTED:
35
- logger.info(`${this.getName()}: connecting ...`)
36
- this.#connectionStatus = ConnectionStatus.CONNECTING
37
- this.#connectionFuture = new Future()
38
- break
39
- }
40
- }
41
-
42
- disconnect() {
43
- this.onDisconnected()
44
- }
45
-
46
- onConnected() {
47
- logger.info(`${this.getName()}: connected`)
48
- this.#connectionStatus = ConnectionStatus.CONNECTED
49
- this.#connectionFuture.set("connected")
50
- }
51
-
52
- onDisconnected() {
53
- logger.warn(`${this.getName()}: disconnected`)
54
- this.#connectionStatus = ConnectionStatus.DISCONNECTED
55
- this.#connectionFuture.reject("disconnected")
56
- }
57
-
58
- isConnected() {
59
- return this.#connectionStatus == ConnectionStatus.CONNECTED
60
- }
61
-
62
- waitForConnection() {
63
- return this.#connectionFuture.get()
64
- }
65
-
66
- getConnectionStatus() {
67
- return this.#connectionStatus
68
- }
69
-
70
- onErrorMessage(code, reason) {
71
- logger.warn(`${this.getName()}: onErrorMessage, code: ${code}, reason: ${reason}`)
72
- }
73
-
74
- onWarningMessage(code, reason) {
75
- logger.warn(`${this.getName()}: onWarningMessage, code: ${code}, reason: ${reason}`)
76
- }
77
-
78
- onInfoMessage(code, reason) {
79
- logger.info(`${this.getName()}: onInfoMessage, code: ${code}, reason: ${reason}`)
80
- }
81
- }