@jibb-open/jssdk 3.5.9 → 3.5.11
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/README.md +5 -2
- package/{dist/api → api}/admin.js +0 -0
- package/{dist/api → api}/auth.js +0 -0
- package/{dist/api → api}/eventbus.js +0 -0
- package/{dist/api → api}/index.js +0 -0
- package/{dist/api → api}/meeting.js +0 -0
- package/{dist/api → api}/recording.js +0 -0
- package/{dist/api → api}/superadmin.js +0 -0
- package/{dist/api → api}/user.js +0 -0
- package/{dist/api → api}/webexbot.js +0 -0
- package/{dist/api → api}/whiteboard.js +0 -0
- package/{dist/config.js → config.js} +0 -0
- package/{dist/examples → examples}/browser/462.jibb.js +0 -0
- package/{dist/examples → examples}/browser/index.html +0 -0
- package/{dist/examples → examples}/browser/jibb.js +0 -0
- package/{dist/examples → examples}/browser/startSession.js +0 -0
- package/{dist/examples → examples}/examples.js +0 -0
- package/{dist/examples → examples}/webexDevicesMacros/cameraPresets/jibb.js +2 -3
- package/{dist/examples/webexDevicesMacros/webexDevice JSSDK → examples/webexDevicesMacros/jssdk}/jibb_WebexXapi.js +0 -0
- package/{dist/examples → examples}/webexDevicesMacros/simplestExample/jibb.js +2 -3
- package/{dist/examples → examples}/webexDevicesMacros/withCameraControl/jibb.js +2 -3
- package/package.json +1 -1
- package/{dist/post-processing.js → post-processing.js} +0 -0
- package/{dist/types → types}/exceptions.js +0 -0
- package/{dist/types → types}/jibb.pb.js +0 -0
- package/{dist/types → types}/proto.js +0 -0
- package/{dist/types → types}/types.js +0 -0
- package/{dist/utils → utils}/cached_variable.js +0 -0
- package/{dist/utils → utils}/future.js +0 -0
- package/{dist/utils → utils}/http/http.axios.js +0 -0
- package/{dist/utils → utils}/http/index.js +0 -0
- package/{dist/utils → utils}/index.js +0 -0
- package/{dist/utils → utils}/logger/index.js +0 -0
- package/{dist/utils → utils}/logger/logger.empty.js +0 -0
- package/{dist/utils → utils}/logger/logger.pino.js +0 -0
- package/{dist/ws → ws}/connection_base.js +0 -0
- package/{dist/ws → ws}/eventbus.js +0 -0
- package/{dist/ws → ws}/index.js +0 -0
- package/{dist/ws → ws}/ipsa.js +0 -0
- package/{dist/ws → ws}/meeting.js +0 -0
- package/{dist/ws → ws}/observable_connection.js +0 -0
- package/{dist/ws → ws}/retry_connection.js +0 -0
- package/.babelrc +0 -31
- package/dist/package.json +0 -69
- 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/index.html +0 -17
- package/src/examples/browser/jibb.js +0 -2
- package/src/examples/browser/startSession.js +0 -112
- package/src/examples/examples.js +0 -5
- 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/jibb.pb.js +0 -1357
- 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/src/api/superadmin.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import {Config} from '../config.js';
|
|
2
|
-
import {http} from "../utils/http/index.js"
|
|
3
|
-
import {AccessLevel} from "../types/types.js"
|
|
4
|
-
import { Auth } from "./auth.js"
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @module superadmin
|
|
8
|
-
* This is an experimental API.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
let accessLevel = AccessLevel.SUPERADMIN
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @returns {list}
|
|
16
|
-
*/
|
|
17
|
-
export async function getOrganizationList() {
|
|
18
|
-
let headers = {
|
|
19
|
-
"Content-Type": "application/json",
|
|
20
|
-
Accept: "application/json",
|
|
21
|
-
"x-jibb-user-jwt": await Auth.getUserToken({ accessLevel: accessLevel }),
|
|
22
|
-
}
|
|
23
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/superadmin/organizations`, headers)
|
|
24
|
-
return response.data.organizations
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @param {number} orgId
|
|
29
|
-
* @returns {object}
|
|
30
|
-
*/
|
|
31
|
-
export async function getOrganization(orgId) {
|
|
32
|
-
if (orgId === "") {
|
|
33
|
-
throw new Error("organization ID can not be empty")
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
let headers = {
|
|
37
|
-
"Content-Type": "application/json",
|
|
38
|
-
Accept: "application/json",
|
|
39
|
-
"x-jibb-user-jwt": await Auth.getUserToken({ accessLevel: accessLevel }),
|
|
40
|
-
}
|
|
41
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/superadmin/organizations/${orgId}`, headers)
|
|
42
|
-
return response.data
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
* @param {object} param0
|
|
48
|
-
* @param {string} param0.organizationName
|
|
49
|
-
* @param {string} param0.ownerEmail
|
|
50
|
-
* @param {number} param0.level - FREE = 0;BASIC = 1;STUDENT = 2;PRO = 3;BUSINESS = 4; ENTERPRISE = 5;EDUCATION = 6;
|
|
51
|
-
* @param {number} param0.licenseCount
|
|
52
|
-
* @param {data} param0.expiryDate
|
|
53
|
-
* @returns - http result
|
|
54
|
-
*/
|
|
55
|
-
export async function createOrganization({ organizationName, ownerEmail, level, licenseCount, expiryDate }) {
|
|
56
|
-
let headers = {
|
|
57
|
-
"Content-Type": "application/json",
|
|
58
|
-
Accept: "application/json",
|
|
59
|
-
"x-jibb-user-jwt": await Auth.getUserToken({ accessLevel: accessLevel }),
|
|
60
|
-
}
|
|
61
|
-
let body = {
|
|
62
|
-
name: organizationName,
|
|
63
|
-
owner_email: ownerEmail,
|
|
64
|
-
level: level,
|
|
65
|
-
license_count: licenseCount,
|
|
66
|
-
expiry_date: expiryDate,
|
|
67
|
-
}
|
|
68
|
-
return http.post(`${Config.apiBaseURL}/v1/superadmin/organizations/`, body, headers)
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
*
|
|
72
|
-
* @param {number} orgId
|
|
73
|
-
* @returns - http result
|
|
74
|
-
*/
|
|
75
|
-
export async function deleteOrganization(orgId) {
|
|
76
|
-
let headers = {
|
|
77
|
-
"Content-Type": "application/json",
|
|
78
|
-
Accept: "application/json",
|
|
79
|
-
"x-jibb-user-jwt": await Auth.getUserToken({ accessLevel: accessLevel }),
|
|
80
|
-
}
|
|
81
|
-
return http.delete(`${Config.apiBaseURL}/v1/superadmin/organizations/${orgId}`, headers)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
package/src/api/user.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Config } from "../config.js"
|
|
2
|
-
import { Auth } from "./auth.js"
|
|
3
|
-
import { http } from "../utils/http/index.js"
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @export
|
|
7
|
-
* EventBus.
|
|
8
|
-
* @module User
|
|
9
|
-
* This is an experimental API.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* @async
|
|
17
|
-
* @returns {object}
|
|
18
|
-
*/
|
|
19
|
-
export async function getUserInfo() {
|
|
20
|
-
let headers = {
|
|
21
|
-
"Content-Type": "application/json",
|
|
22
|
-
Accept: "application/json",
|
|
23
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/users/me`, headers)
|
|
27
|
-
return response.data
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @async
|
|
32
|
-
* @param {number} orgId
|
|
33
|
-
* @returns - http result
|
|
34
|
-
*/
|
|
35
|
-
export async function activateUser(orgId) {
|
|
36
|
-
let headers = {
|
|
37
|
-
"Content-Type": "application/json",
|
|
38
|
-
Accept: "application/json",
|
|
39
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
let body = {
|
|
43
|
-
organizationId: orgId,
|
|
44
|
-
}
|
|
45
|
-
return http.post(`${Config.apiBaseURL}/v1/users/activate`, body, headers)
|
|
46
|
-
}
|
package/src/api/webexbot.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {Config} from '../config.js';
|
|
2
|
-
import {http} from "../utils/http/index.js"
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @module webexbot
|
|
6
|
-
* This is an experimental API.
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* @param {object} param0
|
|
13
|
-
* @param {string} param0.meetingToken
|
|
14
|
-
* @param {string} param0.message
|
|
15
|
-
* @param {data} param0.image
|
|
16
|
-
* @returns - http response
|
|
17
|
-
*/
|
|
18
|
-
export async function shareImage({meetingToken, message, image}) {
|
|
19
|
-
let headers = {
|
|
20
|
-
"Content-Type": "application/json",
|
|
21
|
-
Accept: "application/json",
|
|
22
|
-
"x-jibb-meeting-jwt": meetingToken,
|
|
23
|
-
}
|
|
24
|
-
let body = {
|
|
25
|
-
image: image,
|
|
26
|
-
message: message,
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
let response = await http.post(`${Config.apiBaseURL}/v1/webexbot/message`, body, headers)
|
|
30
|
-
return response.data
|
|
31
|
-
}
|
|
32
|
-
|
package/src/api/whiteboard.js
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import {Config} from "../config.js";
|
|
2
|
-
import {http} from "../utils/http/index.js"
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @class Whiteboard
|
|
7
|
-
* This is an experimental API.
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
export class Whiteboard {
|
|
11
|
-
constructor(meetingId, meetingToken) {
|
|
12
|
-
this.meetingId = meetingId
|
|
13
|
-
this.meetingToken = meetingToken
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @async
|
|
18
|
-
* @param {object} param0
|
|
19
|
-
* @param {string} param0.image
|
|
20
|
-
* @param {data} param0.type
|
|
21
|
-
* @returns {string}
|
|
22
|
-
*/
|
|
23
|
-
async saveImage({ image, type }) {
|
|
24
|
-
type = type || ""
|
|
25
|
-
|
|
26
|
-
switch (type.toLowerCase()) {
|
|
27
|
-
case "jpeg":
|
|
28
|
-
type = "IMAGE_JPEG"
|
|
29
|
-
break
|
|
30
|
-
case "webp":
|
|
31
|
-
type = "IMAGE_WEBP"
|
|
32
|
-
break
|
|
33
|
-
default:
|
|
34
|
-
type = ""
|
|
35
|
-
break
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
let headers = {
|
|
39
|
-
"Content-Type": "image/jpeg",
|
|
40
|
-
Accept: "application/json",
|
|
41
|
-
"x-jibb-meeting-jwt": this.meetingToken,
|
|
42
|
-
}
|
|
43
|
-
let body = {
|
|
44
|
-
image: image,
|
|
45
|
-
type: type,
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
let response = await http.post(
|
|
49
|
-
`${Config.apiBaseURL}/v1/meetings/${this.meetingId}/whiteboard/images`,
|
|
50
|
-
body,
|
|
51
|
-
headers
|
|
52
|
-
)
|
|
53
|
-
return response.data.imageName
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
*
|
|
58
|
-
* @async
|
|
59
|
-
* @returns {array}
|
|
60
|
-
*/
|
|
61
|
-
async getImageList() {
|
|
62
|
-
let headers = {
|
|
63
|
-
"Content-Type": "application/json",
|
|
64
|
-
Accept: "application/json",
|
|
65
|
-
"x-jibb-meeting-jwt": this.meetingToken,
|
|
66
|
-
}
|
|
67
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/meetings/${this.meetingId}/whiteboard/images`, headers)
|
|
68
|
-
return response.data.imagesName
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
* @async
|
|
74
|
-
* @param {string} imageName
|
|
75
|
-
* @returns {data}
|
|
76
|
-
*/
|
|
77
|
-
async getImage(imageName) {
|
|
78
|
-
let headers = {
|
|
79
|
-
"Content-Type": "application/json",
|
|
80
|
-
Accept: "image/jpeg",
|
|
81
|
-
"x-jibb-meeting-jwt": this.meetingToken,
|
|
82
|
-
}
|
|
83
|
-
let url = `${Config.apiBaseURL}/v1/meetings/${this.meetingId}/whiteboard/images/${imageName}`
|
|
84
|
-
let response = await http.get(url, headers, { responseType: "arraybuffer" })
|
|
85
|
-
return response.data
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
*
|
|
89
|
-
* @async
|
|
90
|
-
* @returns {array}
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
async getImages() {
|
|
94
|
-
let imageList = []
|
|
95
|
-
let imageNameList = await this.getImageList()
|
|
96
|
-
|
|
97
|
-
for (const imageName of imageNameList) {
|
|
98
|
-
let headers = {
|
|
99
|
-
"Content-Type": "application/json",
|
|
100
|
-
Accept: "application/json",
|
|
101
|
-
"x-jibb-meeting-jwt": this.meetingToken,
|
|
102
|
-
}
|
|
103
|
-
let response = await http.get(
|
|
104
|
-
`${Config.apiBaseURL}/v1/meetings/${this.meetingId}/whiteboard/images/${imageName}`,
|
|
105
|
-
{
|
|
106
|
-
headers,
|
|
107
|
-
}
|
|
108
|
-
)
|
|
109
|
-
imageList.push({ imageName: imageName, data: response.data })
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return imageList
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
*
|
|
117
|
-
* @param {string} imageName
|
|
118
|
-
* @returns - http result
|
|
119
|
-
*/
|
|
120
|
-
async deleteImage(imageName) {
|
|
121
|
-
let headers = {
|
|
122
|
-
"Content-Type": "application/json",
|
|
123
|
-
Accept: "application/json",
|
|
124
|
-
"x-jibb-meeting-jwt": this.meetingToken,
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return http.delete(`${Config.apiBaseURL}/v1/meetings/${this.meetingId}/whiteboard/images/${imageName}`, headers)
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
*
|
|
131
|
-
* @async
|
|
132
|
-
* @param {string} board
|
|
133
|
-
* @returns {}
|
|
134
|
-
*/
|
|
135
|
-
async saveBoard(board) {
|
|
136
|
-
let headers = {
|
|
137
|
-
"Content-Type": "application/json",
|
|
138
|
-
Accept: "application/json",
|
|
139
|
-
"x-jibb-meeting-jwt": this.meetingToken,
|
|
140
|
-
}
|
|
141
|
-
let body = { board: board }
|
|
142
|
-
|
|
143
|
-
let response = await http.post(`${Config.apiBaseURL}/v1/meetings/${this.meetingId}/whiteboard`, body, headers)
|
|
144
|
-
return response.data
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
*
|
|
148
|
-
* @async
|
|
149
|
-
* @returns {string}
|
|
150
|
-
*/
|
|
151
|
-
async getBoard() {
|
|
152
|
-
let headers = {
|
|
153
|
-
"Content-Type": "application/json",
|
|
154
|
-
Accept: "image/jpeg",
|
|
155
|
-
"x-jibb-meeting-jwt": this.meetingToken,
|
|
156
|
-
}
|
|
157
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/meetings/${this.meetingId}/whiteboard`, headers)
|
|
158
|
-
return response.data
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
*
|
|
163
|
-
* @async
|
|
164
|
-
* @returns - http result
|
|
165
|
-
*/
|
|
166
|
-
async deleteBoard() {
|
|
167
|
-
let headers = {
|
|
168
|
-
"Content-Type": "application/json",
|
|
169
|
-
Accept: "application/json",
|
|
170
|
-
"x-jibb-meeting-jwt": this.meetingToken,
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
return http.delete(`${Config.apiBaseURL}/v1/meetings/${this.meetingId}/whiteboard`, headers)
|
|
174
|
-
}
|
|
175
|
-
}
|
package/src/config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunkJIBB=globalThis.webpackChunkJIBB||[]).push([[462],{360:e=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,i,n){var s=n&&n.stringify||t;if("object"===r(e)&&null!==e){var l=i.length+1;if(1===l)return e;var o=new Array(l);o[0]=s(e);for(var a=1;a<l;a++)o[a]=s(i[a]);return o.join(" ")}if("string"!=typeof e)return e;var f=i.length;if(0===f)return e;for(var u="",c=0,v=-1,b=e&&e.length||0,h=0;h<b;){if(37===e.charCodeAt(h)&&h+1<b){switch(v=v>-1?v:0,e.charCodeAt(h+1)){case 100:case 102:if(c>=f)break;if(null==i[c])break;v<h&&(u+=e.slice(v,h)),u+=Number(i[c]),v=h+2,h++;break;case 105:if(c>=f)break;if(null==i[c])break;v<h&&(u+=e.slice(v,h)),u+=Math.floor(Number(i[c])),v=h+2,h++;break;case 79:case 111:case 106:if(c>=f)break;if(void 0===i[c])break;v<h&&(u+=e.slice(v,h));var g=r(i[c]);if("string"===g){u+="'"+i[c]+"'",v=h+2,h++;break}if("function"===g){u+=i[c].name||"<anonymous>",v=h+2,h++;break}u+=s(i[c]),v=h+2,h++;break;case 115:if(c>=f)break;v<h&&(u+=e.slice(v,h)),u+=String(i[c]),v=h+2,h++;break;case 37:v<h&&(u+=e.slice(v,h)),u+="%",v=h+2,h++,c--}++c}++h}return-1===v?e:(v<b&&(u+=e.slice(v)),u)}},462:(e,r,t)=>{t.r(r),t.d(r,{logger:()=>n});var i=t(288),n=new(t.n(i)())({browser:{asObject:!1},timestamp:!1,level:"warn"});n.setLevel=function(e){n.level=e}},288:(e,r,t)=>{function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var n=t(360);e.exports=o;var s=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(r){return e(self)||e(window)||e(this)||{}}}().console||{},l={mapHttpRequest:g,mapHttpResponse:g,wrapRequestSerializer:m,wrapResponseSerializer:m,wrapErrorSerializer:m,req:g,res:g,err:function(e){var r={type:e.constructor.name,msg:e.message,stack:e.stack};for(var t in e)void 0===r[t]&&(r[t]=e[t]);return r}};function o(e){(e=e||{}).browser=e.browser||{};var r=e.browser.transmit;if(r&&"function"!=typeof r.send)throw Error("pino: transmit option must have a send function");var t=e.browser.write||s;e.browser.write&&(e.browser.asObject=!0);var i=e.serializers||{},n=function(e,r){return Array.isArray(e)?e.filter((function(e){return"!stdSerializers.err"!==e})):!0===e&&Object.keys(r)}(e.browser.serialize,i),l=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(l=!1),"function"==typeof t&&(t.error=t.fatal=t.warn=t.info=t.debug=t.trace=t),!1===e.enabled&&(e.level="silent");var f=e.level||"info",v=Object.create(t);v.log||(v.log=p),Object.defineProperty(v,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(v,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,a(g,v,"error","log"),a(g,v,"fatal","error"),a(g,v,"warn","error"),a(g,v,"info","log"),a(g,v,"debug","log"),a(g,v,"trace","log")}});var g={transmit:r,serialize:n,asObject:e.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:h(e)};return v.levels=o.levels,v.level=f,v.setMaxListeners=v.getMaxListeners=v.emit=v.addListener=v.on=v.prependListener=v.once=v.prependOnceListener=v.removeListener=v.removeAllListeners=v.listeners=v.listenerCount=v.eventNames=v.write=v.flush=p,v.serializers=i,v._serialize=n,v._stdErrSerialize=l,v.child=function(t,s){if(!t)throw new Error("missing bindings for child Pino");s=s||{},n&&t.serializers&&(s.serializers=t.serializers);var l=s.serializers;if(n&&l){var o=Object.assign({},i,l),a=!0===e.browser.serialize?Object.keys(o):n;delete t.serializers,u([t],a,o,this._stdErrSerialize)}function f(e){this._childLevel=1+(0|e._childLevel),this.error=c(e,t,"error"),this.fatal=c(e,t,"fatal"),this.warn=c(e,t,"warn"),this.info=c(e,t,"info"),this.debug=c(e,t,"debug"),this.trace=c(e,t,"trace"),o&&(this.serializers=o,this._serialize=a),r&&(this._logEvent=b([].concat(e._logEvent.bindings,t)))}return f.prototype=this,new f(this)},r&&(v._logEvent=b()),v}function a(e,r,t,i){var n=Object.getPrototypeOf(r);r[t]=r.levelVal>r.levels.values[t]?p:n[t]?n[t]:s[t]||s[i]||p,function(e,r,t){var i;(e.transmit||r[t]!==p)&&(r[t]=(i=r[t],function(){for(var n=e.timestamp(),l=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===s?s:this,c=0;c<l.length;c++)l[c]=arguments[c];if(e.serialize&&!e.asObject&&u(l,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?i.call(a,f(this,t,l,n)):i.apply(a,l),e.transmit){var b=e.transmit.level||r.level,h=o.levels.values[b],g=o.levels.values[t];if(g<h)return;v(this,{ts:n,methodLevel:t,methodValue:g,transmitLevel:b,transmitValue:o.levels.values[e.transmit.level||r.level],send:e.transmit.send,val:r.levelVal},l)}}))}(e,r,t)}function f(e,r,t,s){e._serialize&&u(t,e._serialize,e.serializers,e._stdErrSerialize);var l=t.slice(),a=l[0],f={};s&&(f.time=s),f.level=o.levels.values[r];var c=1+(0|e._childLevel);if(c<1&&(c=1),null!==a&&"object"===i(a)){for(;c--&&"object"===i(l[0]);)Object.assign(f,l.shift());a=l.length?n(l.shift(),l):void 0}else"string"==typeof a&&(a=n(l.shift(),l));return void 0!==a&&(f.msg=a),f}function u(e,r,t,n){for(var s in e)if(n&&e[s]instanceof Error)e[s]=o.stdSerializers.err(e[s]);else if("object"===i(e[s])&&!Array.isArray(e[s]))for(var l in e[s])r&&r.indexOf(l)>-1&&l in t&&(e[s][l]=t[l](e[s][l]))}function c(e,r,t){return function(){var i=new Array(1+arguments.length);i[0]=r;for(var n=1;n<i.length;n++)i[n]=arguments[n-1];return e[t].apply(this,i)}}function v(e,r,t){var i=r.send,n=r.ts,s=r.methodLevel,l=r.methodValue,o=r.val,a=e._logEvent.bindings;u(t,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=n,e._logEvent.messages=t.filter((function(e){return-1===a.indexOf(e)})),e._logEvent.level.label=s,e._logEvent.level.value=l,i(s,e._logEvent,o),e._logEvent=b(a)}function b(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function h(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?d:y}function g(){return{}}function m(e){return e}function p(){}function d(){return!1}function y(){return Date.now()}o.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},o.stdSerializers=l,o.stdTimeFunctions=Object.assign({},{nullTime:d,epochTime:y,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}})}}]);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<title>Example</title>
|
|
6
|
-
</head>
|
|
7
|
-
<body>
|
|
8
|
-
|
|
9
|
-
<h1>The script testing start session</h1>
|
|
10
|
-
<script type="module">
|
|
11
|
-
import * as JIBB from './jibb.js'
|
|
12
|
-
</script>
|
|
13
|
-
<script type="module" src="startSession.js">
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
</body>
|
|
17
|
-
</html>
|