@cap-js-community/websocket
Version:
WebSocket adapter for CDS
195 lines (194 loc) • 6.17 kB
JSON
{
"name": "@cap-js-community/websocket",
"version": "1.7.3",
"description": "WebSocket adapter for CDS",
"homepage": "https://cap.cloud.sap/",
"engines": {
"node": ">=18"
},
"author": "Oliver Klemenz <oliver.klemenz@sap.com>",
"keywords": [
"CAP",
"CDS",
"WS",
"WebSocket",
"Socket.IO"
],
"files": [
"src",
"cds-plugin.js",
"CHANGELOG.md"
],
"main": "src/index.js",
"types": "src/index.d.ts",
"scripts": {
"run": "cd ./test/_env && cds-serve",
"start": "npm start --prefix=./test/_env",
"start:socketio": "npm run start:socketio --prefix=./test/_env",
"start:uaa": "npm run start:uaa --prefix=./test/_env",
"start:socketio:uaa": "npm run start:socketio:uaa --prefix=./test/_env",
"start:approuter": "npm start --prefix=./test/_env/approuter",
"start:redis": "CDS_ENV=ws npm start --prefix=./test/_env",
"start:socketio:redis": "CDS_ENV=socketio npm run start:socketio --prefix=./test/_env",
"test": "jest",
"test:update": "npm test -- -u",
"lint": "npm run eslint && npm run prettier",
"lint:ci": "npm run eslint:ci && npm run prettier:ci",
"eslint": "eslint --fix .",
"eslint:ci": "eslint .",
"prettier": "prettier \"**/*.{js,json,md,yml,yaml}\" --write --log-level error",
"prettier:ci": "prettier \"**/*.{js,json,md,yml,yaml}\" --check",
"upgrade-lock": "rm -rf package-lock.json node_modules && npm i",
"prepareRelease": "npm prune --production",
"audit": "npm audit --only=prod"
},
"dependencies": {
"@cap-js-community/common": "^0.2.6",
"socket.io": "^4.8.1",
"socket.io-client": "^4.8.1",
"ws": "^8.18.3"
},
"devDependencies": {
"@cap-js-community/websocket": "./",
"@cap-js/cds-test": "^0.4.0",
"@eslint/js": "^9.35.0",
"@sap/cds": "^9.3.1",
"@sap/cds-dk": "^9.3.0",
"@socket.io/redis-adapter": "^8.3.0",
"@socket.io/redis-streams-adapter": "^0.2.2",
"eslint": "^9.35.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-n": "^17.21.3",
"express": "^4.21.2",
"globals": "^16.3.0",
"jest": "^30.1.3",
"prettier": "^3.6.2"
},
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/cap-js-community/websocket.git"
},
"cds": {
"protocols": {
"ws": {
"path": "/ws",
"impl": "@cap-js-community/websocket"
},
"websocket": {
"path": "/ws",
"impl": "@cap-js-community/websocket"
}
},
"requires": {
"kinds": {
"websocket-ws": {
"impl": "@cap-js-community/websocket/src/socket/ws.js"
},
"websocket-socket.io": {
"impl": "@cap-js-community/websocket/src/socket/socket.io.js"
},
"websocket-client-ws": {
"impl": "@cap-js-community/websocket/src/client/ws.js",
"format": "json",
"url": "",
"headers": {},
"protocols": []
},
"websocket-client-socket.io": {
"impl": "@cap-js-community/websocket/src/client/socket.io.js",
"format": "json",
"url": "",
"headers": {},
"protocols": []
}
},
"redis-websocket": {
"vcap": {
"label": "redis-cache"
}
}
},
"schema": {
"cds": {
"websocket": {
"oneOf": [
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"description": "Websocket implementation kind",
"enum": [
"ws",
"socket.io"
],
"default": "ws"
},
"impl": {
"type": "string",
"description": "Websocket implementation path"
},
"options": {
"type": "object",
"description": "Websocket implementation configuration options",
"additionalProperties": true
},
"adapter": {
"type": "object",
"description": "Websocket adapter configuration options",
"properties": {
"impl": {
"type": "string",
"description": "Websocket adapter implementation",
"enum": [
"redis",
"@socket.io/redis-adapter",
"@socket.io/redis-streams-adapter"
]
},
"options": {
"type": "object",
"description": "Websocket adapter implementation options",
"properties": {
"key": {
"type": "string",
"description": "Websocket adapter channel prefix",
"default": "websocket"
}
},
"additionalProperties": true
},
"config": {
"type": "object",
"description": "Websocket adapter implementation configurations (i.e. Redis client options)",
"additionalProperties": true
},
"active": {
"type": "boolean",
"description": "Enable websocket adapter",
"default": true
},
"local": {
"type": "boolean",
"description": "Enable websocket adapter in local environment",
"default": false
}
}
}
}
},
{
"type": "boolean",
"description": "Set to false to disable websockets"
}
]
}
}
},
"websocket": {
"kind": "ws"
}
}
}