Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aicore/cocodb-ws-client

Package Overview
Dependencies
Maintainers
3
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aicore/cocodb-ws-client - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"name": "@aicore/cocodb-ws-client",
"version": "1.0.4",
"version": "1.0.5",
"description": "Websocket client for cocoDb",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -5,3 +5,3 @@ import {WS} from "./WebSocket.js";

let client = null;
const WEBSOCKET_ENDPOINT_COCO_DB = '/ws';
const WEBSOCKET_ENDPOINT_COCO_DB = '/ws/';
const ID_TO_RESOLVE_REJECT_MAP = {};

@@ -12,4 +12,10 @@ let id = 0;

/**
* It creates a websocket connection to the cocoDbServiceEndPoint and listens for messages
* @param {string} cocoDbServiceEndPoint - The URL of the coco-db service.
* @param {string} authKey - The authKey is a base64 encoded string of the username and password.
*/
export function init(cocoDbServiceEndPoint, authKey) {
if (isStringEmpty(cocoDbServiceEndPoint)) {
if (isStringEmpty(cocoDbServiceEndPoint) || !(cocoDbServiceEndPoint.startsWith('ws://')
|| cocoDbServiceEndPoint.startsWith('wss://'))) {
throw new Error('Please provide valid cocoDbServiceEndPoint');

@@ -20,3 +26,3 @@ }

}
client = new WS.WebSocket(`ws://${cocoDbServiceEndPoint}${WEBSOCKET_ENDPOINT_COCO_DB}`, {
client = new WS.WebSocket(cocoDbServiceEndPoint.trim() + WEBSOCKET_ENDPOINT_COCO_DB, {
perMessageDeflate: false,

@@ -46,2 +52,6 @@ headers: {

/**
* It closes the connection to the server
* @returns The function close() is being returned.
*/
export function close() {

@@ -54,2 +64,6 @@ if (!client) {

/**
* It returns a string representation of the next integer in a sequence
* @returns {string} A function that increments the id variable and returns the new value as a hexadecimal string.
*/
function getId() {

@@ -56,0 +70,0 @@ id++;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc