@cognigy/webchat 3.40.0 → 3.41.0
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/OSS_LICENSES.txt +3 -3
- package/dist/webchat.esm.js +3 -3
- package/dist/webchat.js +3 -3
- package/package.json +3 -3
package/OSS_LICENSES.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Created on
|
|
1
|
+
Created on 02-04-2026 at 13:38:12
|
|
2
2
|
|
|
3
3
|
{
|
|
4
4
|
"@babel/code-frame@7.29.0": {
|
|
@@ -163,14 +163,14 @@ Created on 09-03-2026 at 12:42:58
|
|
|
163
163
|
"licenseFile": "node_modules/@cognigy/chat-components/LICENSE",
|
|
164
164
|
"copyright": "Copyright (c) 2024 Cognigy GmbH"
|
|
165
165
|
},
|
|
166
|
-
"@cognigy/socket-client@5.0.0-beta.
|
|
166
|
+
"@cognigy/socket-client@5.0.0-beta.26": {
|
|
167
167
|
"licenses": "MIT*",
|
|
168
168
|
"publisher": "Robin Schuster",
|
|
169
169
|
"email": "r.schuster@cognigy.com",
|
|
170
170
|
"licenseFile": "node_modules/@cognigy/socket-client/LICENSE",
|
|
171
171
|
"copyright": "Copyright (c) 2019 Cognigy GmbH"
|
|
172
172
|
},
|
|
173
|
-
"@cognigy/webchat@3.
|
|
173
|
+
"@cognigy/webchat@3.41.0": {
|
|
174
174
|
"licenses": "MIT*",
|
|
175
175
|
"repository": "https://github.com/Cognigy/Webchat",
|
|
176
176
|
"publisher": "Cognigy GmbH",
|
package/dist/webchat.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* webchat.esm.js v3.
|
|
3
|
-
* https://github.com/Cognigy/Webchat/tree/v3.
|
|
4
|
-
* https://github.com/Cognigy/Webchat/tree/v3.
|
|
2
|
+
* webchat.esm.js v3.41.0
|
|
3
|
+
* https://github.com/Cognigy/Webchat/tree/v3.41.0
|
|
4
|
+
* https://github.com/Cognigy/Webchat/tree/v3.41.0/OSS_LICENSES.txt
|
|
5
5
|
*/
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
7
7
|
import * as __WEBPACK_EXTERNAL_MODULE_react_dom_7dac9eee__ from "react-dom";
|
package/dist/webchat.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* webchat.js v3.
|
|
3
|
-
* https://github.com/Cognigy/Webchat/tree/v3.
|
|
4
|
-
* https://github.com/Cognigy/Webchat/tree/v3.
|
|
2
|
+
* webchat.js v3.41.0
|
|
3
|
+
* https://github.com/Cognigy/Webchat/tree/v3.41.0
|
|
4
|
+
* https://github.com/Cognigy/Webchat/tree/v3.41.0/OSS_LICENSES.txt
|
|
5
5
|
*/(()=>{var e,t,n={1510(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldForceWebsockets=void 0;const r=(0,n(8809).detect)();t.shouldForceWebsockets=()=>{if(!r)return!0;switch(r.name){case"ie":case"ios":case"ios-webview":case"crios":case"safari":case"chrome":case"chromium-webview":case"node":return console.log('[SocketClient] Enabling "forceWebsockets" by default for compatibility with this environment.'),!0;default:return!0}}},2166(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SocketClient=void 0;const i=n(8657),o=n(5325),a=n(4845),s=n(1510);class l extends i.EventEmitter{static createDefaultSocketOptions(){return{channel:"socket-client",userId:`user-${(0,a.v4)()}`,sessionId:`session-${(0,a.v4)()}`,testMode:!1,emitWithAck:!0,expiresIn:null,forceWebsockets:!1,disableWebsockets:!1,interval:1e4,passthroughIP:null,reconnection:!0,reconnectionLimit:5,enableInnerSocketHandshake:!1,resetFlow:!1}}static completeSocketOptions(e={}){const t=Object.assign(Object.assign({},l.createDefaultSocketOptions()),e);return e.forceWebsockets||e.disableWebsockets||(t.forceWebsockets=(0,s.shouldForceWebsockets)()),t}constructor(e,t,n){super(),this.messageBuffer=[],this._isEndpointReady=!1,this.socketUrl=e,this.socketURLToken=t,this.socketOptions=l.completeSocketOptions(n),this.reconnectCounter=0,this.updateLastUsed()}resetReconnectionCounter(){this.reconnectCounter=0}registerReconnectionAttempt(){this.reconnectCounter++,console.log("[SocketClient] Trying to reconnect"),this.shouldStopReconnecting()&&(console.log("[SocketClient] Reconnection attempts limit reached. Giving up."),this.emit("socket/error",{type:"RECONNECTION_LIMIT"}))}shouldStopReconnecting(){const{reconnectionLimit:e}=this.socketOptions;return 0!==e&&e<=this.reconnectCounter}flushMessageBuffer(){if(this.messageBuffer.length>0)if(this.connected&&this.isEndpointReady){console.log("[SocketClient] Starting to send your buffered messages...");for(let e of this.messageBuffer)this.sendMessage(e.text,e.data);console.log(`[SocketClient] Finished sending ${this.messageBuffer.length} buffered messages.`),this.messageBuffer=[]}else console.log("[SocketClient] Could not send your buffered messages because we are not connected or the Endpoint is not yet ready")}setupReconnectInterval(){this.socketReconnectInterval||(this.socketReconnectInterval=setInterval(()=>r(this,void 0,void 0,function*(){if(!this.connected&&!this.shouldStopReconnecting()){this.registerReconnectionAttempt();try{const e=!0;yield this.connect(e),console.log("[SocketClient] Successfully reconnected.")}catch(e){console.error(`[SocketClient] Failed to reconnect, error was: ${JSON.stringify(e)}`)}}}),this.socketOptions.interval))}updateLastUsed(){this.lastUsed=Date.now()}get isEndpointReady(){return this._isEndpointReady}get connected(){return!!this.socket&&this.socket.connected}get expired(){return null!==this.socketOptions.expiresIn&&Date.now()-this.lastUsed>this.socketOptions.expiresIn}connect(e=!1){return r(this,void 0,void 0,function*(){const e=new URL(this.socketUrl),t={path:e.pathname&&"/"!==e.pathname?e.pathname+"/socket.io":null,reconnection:!1,upgrade:!0,transports:["polling","websocket"],autoConnect:!1};this.socketOptions.forceWebsockets?t.transports=["websocket"]:this.socketOptions.disableWebsockets&&(t.transports=["polling"],t.upgrade=!1),this.socketOptions.enableInnerSocketHandshake?t.query={handshake:"true"}:t.query={sessionId:encodeURIComponent(this.socketOptions.sessionId),urlToken:encodeURIComponent(this.socketURLToken),userId:encodeURIComponent(this.socketOptions.userId),testMode:encodeURIComponent(this.socketOptions.testMode?"true":"false"),emitWithAck:encodeURIComponent(this.socketOptions.emitWithAck?"true":"false")};const n=(0,o.io)(e.origin,t);return["connect","connect_error","connect_timeout","error","disconnect","reconnect","reconnect_attempt","reconnecting","reconnect_error","reconnect_failed","ping","pong"].forEach(e=>{n.on(e,t=>{this.emit(`socket/${e}`,t)})}),n.on("exception",e=>this.emit("exception",e)),n.on("typingStatus",e=>this.emit("typingStatus",e)),n.on("finalPing",(e,t)=>{t&&"function"==typeof t&&t(),this.emit("finalPing",e)}),n.on("output",(e,t)=>{if(t&&"function"==typeof t&&t(),e&&"error"===e.type)return this.emit("error",e.data.error);if(e&&"output"===e.type){let t=e.data;this.emit("output",t)}e&&"finalPing"===e.type&&this.emit("finalPing",e.data)}),yield new Promise((e,t)=>{n.on("connect_error",()=>t(new Error("[SocketClient] Error connecting"))),n.on("connect_timeout",()=>t(new Error("[SocketClient] Error connecting"))),this.socketOptions.enableInnerSocketHandshake&&n.on("handshake",t=>{const{userId:n,sessionId:r,testMode:i,emitWithAck:o}=this.socketOptions,a={userId:n,sessionId:r,urlToken:this.socketURLToken,testMode:i,emitWithAck:o};console.log("[SocketClient] completing session handshake"),t(a),e()}),n.on("connect",()=>{this._isEndpointReady=!1,this.socket=n,this.socketOptions.reconnection&&this.setupReconnectInterval()}),n.once("endpoint-ready",()=>{this._isEndpointReady=!0,this.flushMessageBuffer(),e()}),n.connect()}),this})}switchSession(e){return r(this,void 0,void 0,function*(){return this.disconnect(),this.socketOptions.sessionId=e||`session-${(0,a.v4)()}`,this.reconnectCounter=0,this.updateLastUsed(),yield this.connect(),console.log("[SocketClient] switched session"),this})}disconnect(){return clearInterval(this.socketReconnectInterval),this.socketReconnectInterval=null,this.socket&&(this.socket.disconnect(),this.socket=null),this}sendMessage(e,t){return this.connected&&this.isEndpointReady?(this.resetReconnectionCounter(),this.updateLastUsed(),this.socket.emit("processInput",{URLToken:this.socketURLToken,userId:this.socketOptions.userId,sessionId:this.socketOptions.sessionId,channel:this.socketOptions.channel,source:"device",passthroughIP:this.socketOptions.passthroughIP,resetFlow:!!this.socketOptions.resetFlow,text:e,data:t})):(this.messageBuffer.push({text:e,data:t}),console.log("[SocketClient] Unable to directly send your message since we are not connected or the Endpoint is not yet ready to accept messages. Your message will be buffered and sent later on.")),this}sendTypingStatus(e){return this.connected&&this.isEndpointReady&&this.socket.emit("typingStatus",{status:e}),this}}t.SocketClient=l},7028(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&a[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),t.push(u))}},t}},3051(e){"use strict";e.exports=function(e){return e[1]}},1636(e,t){
|
|
6
6
|
/*!
|
|
7
7
|
* Converts CSS stylesheets between left-to-right and right-to-left.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognigy/webchat",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.41.0",
|
|
4
4
|
"description": "Webchat for Cognigy.AI",
|
|
5
5
|
"author": "Cognigy GmbH <info@cognigy.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@braintree/sanitize-url": "^6.0.0",
|
|
57
|
-
"@cognigy/chat-components": "
|
|
58
|
-
"@cognigy/socket-client": "5.0.0-beta.
|
|
57
|
+
"@cognigy/chat-components": "0.69.0",
|
|
58
|
+
"@cognigy/socket-client": "5.0.0-beta.26",
|
|
59
59
|
"@emotion/cache": "^10.0.29",
|
|
60
60
|
"@emotion/react": "^11.13.0",
|
|
61
61
|
"@emotion/serialize": "1.3.0",
|