{"_id":"@curvebeamai/test-web-socket-service","_rev":"4-d955417d683b4ae85aa02cf74e224f80","name":"@curvebeamai/test-web-socket-service","dist-tags":{"latest":"1.1.8"},"versions":{"1.0.2":{"name":"@curvebeamai/test-web-socket-service","version":"1.0.2","author":{"name":"DevOpsCurvebeamAI"},"license":"MIT","_id":"@curvebeamai/test-web-socket-service@1.0.2","maintainers":[{"name":"curvebeamai","email":"devops@straxcorp.com"}],"dist":{"shasum":"8f60d69d6382f1d23aa9b5fe919cc45a1bbc11f3","tarball":"https://registry.npmjs.org/@curvebeamai/test-web-socket-service/-/test-web-socket-service-1.0.2.tgz","fileCount":12,"integrity":"sha512-4ot49SOFck2br5dRe1PQxAXW/1iKL13vlQbAJ5VDGGNR+1ErCSdfd9PZu/IQBqJ84AFMTkUGTRK9nbHzCb9xHg==","signatures":[{"sig":"MEUCIEQKp4yBVE0y56UUQatZWcVP+zj3s34+6uZsuzYsUx2iAiEAjR9h2IopN1gyXVI9vl/dkW60hL9rvc3FaqA8MUCD/gg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113605},"main":"dist/index.js","husky":{"hooks":{"pre-commit":"tsdx lint"}},"module":"dist/web-socket-service.esm.js","engines":{"node":">=10"},"gitHead":"0cca533c68d2fafca21e119f38eb0ac3403da7af","scripts":{"lint":"tsdx lint","size":"size-limit","test":"tsdx test","build":"tsdx build","start":"tsdx watch","analyze":"size-limit --why","prepare":"tsdx build"},"typings":"dist/index.d.ts","_npmUser":{"name":"curvebeamai","email":"devops@straxcorp.com"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/web-socket-service.cjs.production.min.js","limit":"10 KB"},{"path":"dist/web-socket-service.esm.js","limit":"10 KB"}],"_npmVersion":"10.2.4","description":"Enable communication between applications using web sockets","directories":{},"_nodeVersion":"21.3.0","_hasShrinkwrap":false,"devDependencies":{"tsdx":"^0.14.1","husky":"^8.0.3","tslib":"^2.6.2","size-limit":"^9.0.0","typescript":"^3.9.10","@size-limit/preset-small-lib":"^9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/test-web-socket-service_1.0.2_1721804487755_0.5636970303176077","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@curvebeamai/test-web-socket-service","version":"1.0.3","author":{"name":"DevOpsCurvebeamAI"},"license":"MIT","_id":"@curvebeamai/test-web-socket-service@1.0.3","maintainers":[{"name":"curvebeamai","email":"devops@straxcorp.com"}],"dist":{"shasum":"6e26e47c5cbb1a74e7569ae704fb371bae7e64d5","tarball":"https://registry.npmjs.org/@curvebeamai/test-web-socket-service/-/test-web-socket-service-1.0.3.tgz","fileCount":12,"integrity":"sha512-psjQ9gLn2UEqNFUI4RmUeWfFwrKZBoWGavkyxNcqof8QMISHh/HsVs4un1lxYqsmvdbddug7SUUPZxvus9GHRQ==","signatures":[{"sig":"MEYCIQD/ryp6wLiB4LKaKR/DmlZxK/LoFQO3gTHpzPorSW7H+wIhAL9aMl5DtgGr1b67DmNGLlHILSjxdB0136PH28WNGCUi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":111779},"main":"dist/index.js","husky":{"hooks":{"pre-commit":"tsdx lint"}},"module":"dist/web-socket-service.esm.js","engines":{"node":">=10"},"scripts":{"lint":"tsdx lint","size":"size-limit","test":"tsdx test","build":"tsdx build","start":"tsdx watch","analyze":"size-limit --why","prepare":"tsdx build"},"typings":"dist/index.d.ts","_npmUser":{"name":"curvebeamai","email":"devops@straxcorp.com"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/web-socket-service.cjs.production.min.js","limit":"10 KB"},{"path":"dist/web-socket-service.esm.js","limit":"10 KB"}],"_npmVersion":"10.2.4","description":"Enable communication between applications using web sockets","directories":{},"_nodeVersion":"18.19.1","_hasShrinkwrap":false,"devDependencies":{"tsdx":"^0.14.1","husky":"^8.0.3","tslib":"^2.6.2","size-limit":"^9.0.0","typescript":"^3.9.10","@size-limit/preset-small-lib":"^9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/test-web-socket-service_1.0.3_1721969159288_0.02334108374816468","host":"s3://npm-registry-packages"}},"1.1.7":{"name":"@curvebeamai/test-web-socket-service","version":"1.1.7","author":{"name":"curvebeamai"},"license":"MIT","_id":"@curvebeamai/test-web-socket-service@1.1.7","maintainers":[{"name":"curvebeamai","email":"devops@straxcorp.com"}],"dist":{"shasum":"610d9f3e56d7d7063759127830c01dd6f1fed178","tarball":"https://registry.npmjs.org/@curvebeamai/test-web-socket-service/-/test-web-socket-service-1.1.7.tgz","fileCount":40,"integrity":"sha512-URZIJXnajsPS7TM0iyvUAflEerHx84W6rvPx6rITdploYeyyYyUJ+XXNiiTX/0pj0bHyT1yo8lL6oUx90gTV1Q==","signatures":[{"sig":"MEUCIDFH5OuidKRjjYuT2RXFLtKAaNnb77fWmsp607ASPHwkAiEAnUell70hzeQElRdjoa7A8ZotZyGy8czblkZ2Yk5LVpM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":310239},"main":"dist/index.js","husky":{"hooks":{"pre-commit":"tsdx lint"}},"module":"dist/test-web-socket-service.esm.js","engines":{"node":">=10"},"scripts":{"lint":"tsdx lint","size":"size-limit","test":"tsdx test","build":"tsdx build","start":"tsdx watch","analyze":"size-limit --why","prepare":"tsdx build"},"typings":"dist/index.d.ts","_npmUser":{"name":"curvebeamai","email":"devops@straxcorp.com"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/test-web-socket-service.cjs.production.min.js","limit":"10 KB"},{"path":"dist/test-web-socket-service.esm.js","limit":"10 KB"}],"_npmVersion":"10.8.2","description":"Web connect service is a typescript library for connecting to a web socket and enabling communication between two frontend clients.","directories":{},"_nodeVersion":"18.20.8","_hasShrinkwrap":false,"devDependencies":{"tsdx":"^0.14.1","husky":"^8.0.3","tslib":"^2.6.2","size-limit":"^9.0.0","typescript":"^3.9.10","@size-limit/preset-small-lib":"^9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/test-web-socket-service_1.1.7_1769736603508_0.4850665309626476","host":"s3://npm-registry-packages-npm-production"}},"1.1.8":{"version":"1.1.8","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why"},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"name":"@curvebeamai/test-web-socket-service","author":{"name":"curvebeamai"},"module":"dist/test-web-socket-service.esm.js","size-limit":[{"path":"dist/test-web-socket-service.cjs.production.min.js","limit":"10 KB"},{"path":"dist/test-web-socket-service.esm.js","limit":"10 KB"}],"devDependencies":{"@size-limit/preset-small-lib":"^9.0.0","husky":"^8.0.3","size-limit":"^9.0.0","tsdx":"^0.14.1","tslib":"^2.6.2","typescript":"^3.9.10"},"_id":"@curvebeamai/test-web-socket-service@1.1.8","description":"Web connect service is a typescript library for connecting to a web socket and enabling communication between two frontend clients.","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-gZN4fhjgy6wC/LOsq0r2G/RkBjbqYVAka/OyQL2nvhcOVqfJr+RfeYBcs4oVGfNwN5/osQHtrqOLGnIZYMmvrg==","shasum":"08c718692f8ea57eadbcf6e945705103b835a0f6","tarball":"https://registry.npmjs.org/@curvebeamai/test-web-socket-service/-/test-web-socket-service-1.1.8.tgz","fileCount":40,"unpackedSize":310239,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDd1LPjIbXOf/OpTdOl5D023WF4O6FVFgSluddQxWUYDAiEA3++9PYiGd+lkancC968NiutYBTzE1XiovZpNPBxg7Lw="}]},"_npmUser":{"name":"curvebeamai","email":"devops@straxcorp.com"},"directories":{},"maintainers":[{"name":"curvebeamai","email":"devops@straxcorp.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/test-web-socket-service_1.1.8_1769740356850_0.9995273242609126"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-24T07:01:27.682Z","modified":"2026-01-30T02:32:37.150Z","1.0.2":"2024-07-24T07:01:27.931Z","1.0.3":"2024-07-26T04:45:59.446Z","1.1.7":"2026-01-30T01:30:03.663Z","1.1.8":"2026-01-30T02:32:37.019Z"},"author":{"name":"curvebeamai"},"license":"MIT","description":"Web connect service is a typescript library for connecting to a web socket and enabling communication between two frontend clients.","maintainers":[{"name":"curvebeamai","email":"devops@straxcorp.com"}],"readme":"\n# Web Connect Service\n\nWeb connect service is a typescript library for connecting to a web socket and enabling communication between two frontend clients. \n\n## Installation\n\n```shell\nnpm install @curvebeamai/web-connect-service\n```\n\n## Usage\n**Connect to Web socket**\n\n```typescript\nimport { WebSocketService } from \"@curvebeamai/web-connect-service\";\nconst webSocketServiceInstance = WebSocketService.getInstance();\nconst connectionOptions = new ConnectionOptions(\n      webSocketURL,\n      clientId,\n      sessionId,\n      tokenValidationEndpoint\n    );\nwebSocketServiceInstance.connect(connectionOptions).then((response: WebSocketServiceResponseObject) => {\n    // your application logic here\n});\n```\n\nFor sending messages and other options read on ...\n\n## Methods Summary\n\n| Method Name | Description |\n| ----------- | ----------- |\n[`registerDisconnectHandler`](#registerDisconnectHandler) | Register the method to call when the web socket connection is disconnected |\n| [`sendMessage`](#sendmessage) | Send message to all the connected applications through web socket |\n| [`closeConnection`](#closeconnection) | Close the web socket connection |\n\n## Methods\n\n### registerDisconnectHandler\n\nThis method registers the callback to be called when the web socket has successfully disconnected.\n\nExample:\n\n```typescript\nimport { WebSocketService } from \"@curvebeamai/web-connect-service\";\n\nfunction handleDisconnect(response: WebSocketServiceResponseObject){\n    // your application disconnect logic here\n}\n webSocketServiceInstance.RegisterDisconnectHandler(handleDisconnect);\n```\n\n### sendMessage\n\nSend message on web socket for all the connected applications.\nReturns a boolean variab\n\nExample:\n\n```javascript\nimport { WebSocketService } from \"@curvebeamai/web-connect-service\";\n\n// create message and request object\n    const dataObject = new WebSocketDataObject(\"Message to Send\", sessionId);\n    const message = new WebSocketRequestObject(\"web-socket-action\", dataObject);\n    webSocketServiceInstance.sendMessage(message);\n```\n\n### closeConnection\n\nClose the web socket connection \n\nExample:\n\n```javascript\nimport { WebSocketService } from \"@curvebeamai/web-connect-service\";\nwebSocketServiceInstance.closeConnection();\n```","readmeFilename":"README.md"}