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

buttplug

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buttplug - npm Package Compare versions

Comparing version 0.12.3 to 0.13.0

dist/main/src/client/ButtplugClientForwarder.d.ts

17

CHANGELOG.md

@@ -0,1 +1,18 @@

# Version 0.13.0 - 2020/03/29
## Features
- Added Device Forwarder Support
- Allows developers to create a device manager that can accept "forwarded"
devices from another client. Basically turns Buttplug into a full
teledildonics system, using its own protocol.
- ButtplugClientDevice now emits "deviceremoved" when it is disconnected.
- This is alongside the client emitting it.
## Bugfixes
- Fixed WeVibe Melt support
- Fixed references to buttplug-server-cli in README
- This is now at https://github.com/intiface/intiface-node-cli
# Version 0.12.3 - 2020/03/25

@@ -2,0 +19,0 @@

283

dependencies/buttplug-schema/package-lock.json

@@ -8,29 +8,29 @@ {

"abbrev": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz",
"integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
"dev": true
},
"ajv": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-5.2.0.tgz",
"integrity": "sha1-wXNQJMXaLvdcwZBxMHPUTwmL9IY=",
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz",
"integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==",
"dev": true,
"requires": {
"co": "^4.6.0",
"fast-deep-equal": "^0.1.0",
"json-schema-traverse": "^0.3.0",
"json-stable-stringify": "^1.0.1"
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"ajv-cli": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/ajv-cli/-/ajv-cli-2.1.0.tgz",
"integrity": "sha1-JvlC3fSx0U08Y5yyjbgH8CyjeHw=",
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/ajv-cli/-/ajv-cli-3.1.0.tgz",
"integrity": "sha512-QSHstRjJin970EspY92Qr8lDGYE9C88AwW7LJYJ/MFhKDsE6I75H2b8WObCeF+2q/1fJiolm0xX7I/VyGmw/JQ==",
"dev": true,
"requires": {
"ajv": "^5.0.0",
"ajv": "^6.7.0",
"ajv-pack": "^0.3.0",
"fast-json-patch": "^0.5.6",
"glob": "^7.0.3",
"fast-json-patch": "^2.0.0",
"glob": "^7.1.0",
"json-schema-migrate": "^0.2.0",

@@ -41,5 +41,5 @@ "minimist": "^1.2.0"

"ajv-pack": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/ajv-pack/-/ajv-pack-0.3.0.tgz",
"integrity": "sha1-QCcsn3a6PknR+NpLZMYo5DF7ITg=",
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/ajv-pack/-/ajv-pack-0.3.1.tgz",
"integrity": "sha1-tyxNQhnjko5ihC10Le2Tv1B5ZWA=",
"dev": true,

@@ -57,12 +57,6 @@ "requires": {

},
"bluebird": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz",
"integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=",
"dev": true
},
"brace-expansion": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,

@@ -81,9 +75,6 @@ "requires": {

"commander": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz",
"integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=",
"dev": true,
"requires": {
"graceful-readlink": ">= 1.0.0"
}
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"dev": true
},

@@ -97,5 +88,5 @@ "concat-map": {

"config-chain": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.11.tgz",
"integrity": "sha1-q6CXR9++TD5w52am5BWG4YWfxvI=",
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz",
"integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==",
"dev": true,

@@ -108,10 +99,10 @@ "requires": {

"editorconfig": {
"version": "0.13.2",
"resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.13.2.tgz",
"integrity": "sha1-jleSbZ7mmrbLmZ8CfCFxRnrM6zU=",
"version": "0.15.3",
"resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz",
"integrity": "sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==",
"dev": true,
"requires": {
"bluebird": "^3.0.5",
"commander": "^2.9.0",
"lru-cache": "^3.2.0",
"commander": "^2.19.0",
"lru-cache": "^4.1.5",
"semver": "^5.6.0",
"sigmund": "^1.0.1"

@@ -121,11 +112,28 @@ }

"fast-deep-equal": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-0.1.0.tgz",
"integrity": "sha1-XG9FmaumszPuM0Li7ZeGcvEAH40=",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
"dev": true
},
"fast-json-patch": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-0.5.7.tgz",
"integrity": "sha1-taj0nSWWJFlu+YuHLz/aiVtNhmU=",
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-2.2.1.tgz",
"integrity": "sha512-4j5uBaTnsYAV5ebkidvxiLUYOwjQ+JSFljeqfTxCrH9bDmlCQaOJFS84oDJ2rAXZq2yskmk3ORfoP9DCwqFNig==",
"dev": true,
"requires": {
"fast-deep-equal": "^2.0.1"
},
"dependencies": {
"fast-deep-equal": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
"dev": true
}
}
},
"fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
"dev": true

@@ -140,5 +148,5 @@ },

"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"dev": true,

@@ -154,8 +162,2 @@ "requires": {

},
"graceful-readlink": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
"integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=",
"dev": true
},
"inflight": {

@@ -172,23 +174,24 @@ "version": "1.0.6",

"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
},
"ini": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz",
"integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=",
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
"dev": true
},
"js-beautify": {
"version": "1.6.14",
"resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.6.14.tgz",
"integrity": "sha1-07j3Mi0CuSd9WL0jgmTDJ+WARM0=",
"version": "1.10.3",
"resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.10.3.tgz",
"integrity": "sha512-wfk/IAWobz1TfApSdivH5PJ0miIHgDoYb1ugSqHcODPmaYu46rYe5FVuIEkhjg8IQiv6rDNPyhsqbsohI/C2vQ==",
"dev": true,
"requires": {
"config-chain": "~1.1.5",
"editorconfig": "^0.13.2",
"mkdirp": "~0.5.0",
"nopt": "~3.0.1"
"config-chain": "^1.1.12",
"editorconfig": "^0.15.3",
"glob": "^7.1.3",
"mkdirp": "~0.5.1",
"nopt": "~4.0.1"
}

@@ -203,32 +206,44 @@ },

"ajv": "^5.0.0"
},
"dependencies": {
"ajv": {
"version": "5.5.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
"integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
"dev": true,
"requires": {
"co": "^4.6.0",
"fast-deep-equal": "^1.0.0",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.3.0"
}
},
"fast-deep-equal": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
"integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=",
"dev": true
},
"json-schema-traverse": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
"integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=",
"dev": true
}
}
},
"json-schema-traverse": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.0.tgz",
"integrity": "sha1-ABbAscoe/kbUTTdUG838Gdz64Ns=",
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
"json-stable-stringify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
"integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=",
"dev": true,
"requires": {
"jsonify": "~0.0.0"
}
},
"jsonify": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
"integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=",
"dev": true
},
"lru-cache": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz",
"integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=",
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
"dev": true,
"requires": {
"pseudomap": "^1.0.1"
"pseudomap": "^1.0.2",
"yallist": "^2.1.2"
}

@@ -246,31 +261,24 @@ },

"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
},
"mkdirp": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz",
"integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==",
"dev": true,
"requires": {
"minimist": "0.0.8"
},
"dependencies": {
"minimist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
}
"minimist": "^1.2.5"
}
},
"nopt": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
"integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=",
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz",
"integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==",
"dev": true,
"requires": {
"abbrev": "1"
"abbrev": "1",
"osenv": "^0.1.4"
}

@@ -287,2 +295,24 @@ },

},
"os-homedir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
"dev": true
},
"os-tmpdir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true
},
"osenv": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
"dev": true,
"requires": {
"os-homedir": "^1.0.0",
"os-tmpdir": "^1.0.0"
}
},
"path-is-absolute": {

@@ -306,2 +336,8 @@ "version": "1.0.1",

},
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
"dev": true
},
"require-from-string": {

@@ -313,2 +349,8 @@ "version": "1.2.1",

},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true
},
"sigmund": {

@@ -320,2 +362,11 @@ "version": "1.0.1",

},
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
"integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
"dev": true,
"requires": {
"punycode": "^2.1.0"
}
},
"wrappy": {

@@ -326,4 +377,10 @@ "version": "1.0.2",

"dev": true
},
"yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
"dev": true
}
}
}

@@ -14,5 +14,6 @@ /*!

private _url;
private _shouldUseSorter;
private _sorter;
private _ws;
constructor(_url: string);
constructor(_url: string, _shouldUseSorter?: boolean);
get Connected(): boolean;

@@ -19,0 +20,0 @@ Connect: () => Promise<void>;

@@ -21,8 +21,9 @@ /*!

const MessageUtils_1 = require("../core/MessageUtils");
const ButtplugMessageSorter_1 = require("./ButtplugMessageSorter");
const ButtplugMessageSorter_1 = require("../utils/ButtplugMessageSorter");
class ButtplugBrowserWebsocketClientConnector extends events_1.EventEmitter {
constructor(_url) {
constructor(_url, _shouldUseSorter = true) {
super();
this._url = _url;
this._sorter = new ButtplugMessageSorter_1.ButtplugMessageSorter();
this._shouldUseSorter = _shouldUseSorter;
this._sorter = new ButtplugMessageSorter_1.ButtplugMessageSorter(true);
this.Connect = () => __awaiter(this, void 0, void 0, function* () {

@@ -59,3 +60,3 @@ const ws = new WebSocket(this._url);

}
const p = this._sorter.PrepareOutgoingMessage(aMsg);
const p = this._shouldUseSorter ? this._sorter.PrepareOutgoingMessage(aMsg) : aMsg;
this._ws.send("[" + aMsg.toJSON() + "]");

@@ -62,0 +63,0 @@ return yield p;

@@ -8,7 +8,9 @@ /*!

*/
/// <reference types="node" />
import * as Messages from "../core/Messages";
import { EventEmitter } from "events";
/**
* Represents an abstract device, capable of taking certain kinds of messages.
*/
export declare class ButtplugClientDevice {
export declare class ButtplugClientDevice extends EventEmitter {
private _index;

@@ -29,2 +31,3 @@ private _name;

get AllowedMessages(): string[];
get AllowedMessagesObject(): object;
static fromMsg(aMsg: Messages.DeviceAdded | Messages.DeviceInfoWithSpecifications, sendClosure: (aDevice: ButtplugClientDevice, aMsg: Messages.ButtplugDeviceMessage) => Promise<void>): ButtplugClientDevice;

@@ -52,3 +55,4 @@ private allowedMsgs;

SendKiirooCmd(aPosition: number): Promise<void>;
EmitDisconnected(): void;
private CheckGenericSubcommandList;
}

@@ -28,6 +28,7 @@ /*!

const Exceptions_1 = require("../core/Exceptions");
const events_1 = require("events");
/**
* Represents an abstract device, capable of taking certain kinds of messages.
*/
class ButtplugClientDevice {
class ButtplugClientDevice extends events_1.EventEmitter {
/**

@@ -39,2 +40,3 @@ * @param _index Index of the device, as created by the device manager.

constructor(_index, _name, allowedMsgsObj, _sendClosure) {
super();
this._index = _index;

@@ -67,2 +69,7 @@ this._name = _name;

}
get AllowedMessagesObject() {
const obj = {};
this.allowedMsgs.forEach((value, key) => { obj[key] = value; });
return obj;
}
static fromMsg(aMsg, sendClosure) {

@@ -178,2 +185,5 @@ return new ButtplugClientDevice(aMsg.DeviceIndex, aMsg.DeviceName, aMsg.DeviceMessages, sendClosure);

}
EmitDisconnected() {
this.emit("deviceremoved");
}
CheckGenericSubcommandList(aType, aCmdList, aLimitValue) {

@@ -180,0 +190,0 @@ if (aCmdList.length === 0 || aCmdList.length > aLimitValue) {

@@ -84,3 +84,3 @@ /*!

this.CheckConnector();
const msg = yield this.SendMessage(new Messages.RequestServerInfo(this._clientName, 1));
const msg = yield this.SendMessage(new Messages.RequestServerInfo(this._clientName, Messages.MESSAGE_SPEC_VERSION));
switch (msg.constructor) {

@@ -210,2 +210,3 @@ case Messages.ServerInfo: {

const removedDevice = this._devices.get(removedMsg.DeviceIndex);
removedDevice === null || removedDevice === void 0 ? void 0 : removedDevice.EmitDisconnected();
this._devices.delete(removedMsg.DeviceIndex);

@@ -212,0 +213,0 @@ this.emit("deviceremoved", removedDevice);

@@ -12,2 +12,3 @@ /*!

export declare const MAX_ID = 4294967295;
export declare const MESSAGE_SPEC_VERSION = 1;
export declare abstract class ButtplugMessage {

@@ -14,0 +15,0 @@ Id: number;

@@ -17,2 +17,3 @@ /*!

exports.MAX_ID = 4294967295;
exports.MESSAGE_SPEC_VERSION = 1;
class ButtplugMessage {

@@ -19,0 +20,0 @@ constructor(Id) {

@@ -24,4 +24,3 @@ /*!

get Id(): string;
get AllowedMessageTypes(): Function[];
ParseMessage: (aMsg: Messages.ButtplugDeviceMessage) => Promise<Messages.ButtplugMessage>;
}

@@ -53,10 +53,4 @@ "use strict";

}
// See ButtplugDeviceProtocol.MsgFuncs comment
//
// tslint:disable-next-line:ban-types
get AllowedMessageTypes() {
return this._protocol.AllowedMessageTypes;
}
}
exports.ButtplugDevice = ButtplugDevice;
//# sourceMappingURL=ButtplugDevice.js.map

@@ -13,3 +13,2 @@ /*!

readonly MessageSpecifications: object;
readonly AllowedMessageTypes: Function[];
readonly Name: string;

@@ -16,0 +15,0 @@ readonly Id: string;

@@ -23,2 +23,3 @@ /*!

private _vibratorSpeed;
private _max8bit;
constructor(aDeviceImpl: IButtplugDeviceImpl);

@@ -25,0 +26,0 @@ get MessageSpecifications(): object;

@@ -36,2 +36,3 @@ "use strict";

this._vibratorSpeed = [0.0, 0.0];
this._max8bit = 12;
this.HandleVibrateCmd = (aMsg) => __awaiter(this, void 0, void 0, function* () {

@@ -59,4 +60,4 @@ if (aMsg.Speeds.length < 1 || aMsg.Speeds.length > this._vibratorCount) {

if (this._eightBitSpeed) {
rSpeedInt = Math.round(this._vibratorSpeed[0] * 12);
rSpeedExt = Math.round(this._vibratorSpeed[this._vibratorCount - 1] * 12);
rSpeedInt = Math.round(this._vibratorSpeed[0] * this._max8bit);
rSpeedExt = Math.round(this._vibratorSpeed[this._vibratorCount - 1] * this._max8bit);
data[3] = (rSpeedExt + 3); // External

@@ -100,2 +101,5 @@ data[4] = (rSpeedInt + 3); // Internal

}
if (aDeviceImpl.Name === "Melt") {
this._max8bit = 22;
}
this._eightBitSpeed = WeVibe.EightBitSpeed.find((x) => x === aDeviceImpl.Name) ? true : false;

@@ -123,3 +127,3 @@ this.MsgFuncs.set(Messages.StopDeviceCmd, this.HandleStopDeviceCmd);

};
WeVibe.EightBitSpeed = ["Moxie", "Vector"];
WeVibe.EightBitSpeed = ["Melt", "Moxie", "Vector"];
//# sourceMappingURL=WeVibe.js.map

@@ -13,3 +13,4 @@ /*!

export * from "./client/ButtplugEmbeddedClientConnector";
export * from "./client/ButtplugMessageSorter";
export * from "./client/ButtplugClientForwarder";
export * from "./utils/ButtplugMessageSorter";
export * from "./client/IButtplugClientConnector";

@@ -36,2 +37,5 @@ export * from "./core/Messages";

export * from "./server/IDeviceSubtypeManager";
export * from "./server/managers/forwardeddevices/ForwardedDevice";
export * from "./server/managers/forwardeddevices/ForwardedDeviceManager";
export * from "./server/managers/forwardeddevices/ForwardedDeviceProtocol";
export * from "./test/TestDeviceImpl";

@@ -38,0 +42,0 @@ export * from "./test/TestDeviceProtocol";

@@ -18,3 +18,4 @@ "use strict";

__export(require("./client/ButtplugEmbeddedClientConnector"));
__export(require("./client/ButtplugMessageSorter"));
__export(require("./client/ButtplugClientForwarder"));
__export(require("./utils/ButtplugMessageSorter"));
__export(require("./core/Messages"));

@@ -35,2 +36,5 @@ __export(require("./core/MessageUtils"));

__export(require("./server/ButtplugServer"));
__export(require("./server/managers/forwardeddevices/ForwardedDevice"));
__export(require("./server/managers/forwardeddevices/ForwardedDeviceManager"));
__export(require("./server/managers/forwardeddevices/ForwardedDeviceProtocol"));
__export(require("./test/TestDeviceImpl"));

@@ -37,0 +41,0 @@ __export(require("./test/TestDeviceProtocol"));

@@ -119,5 +119,3 @@ "use strict";

const device = this._devices.get(deviceMsg.DeviceIndex);
if (device.AllowedMessageTypes.indexOf(aMessage.Type) < 0) {
throw Exceptions_1.ButtplugException.LogAndError(Exceptions_1.ButtplugDeviceException, this._logger, `Device ${device.Name} does not take message type ${aMessage.Type.name}`, id);
}
// Pass all device messages to ParseMessage, if it fails there, we'll error out.
this._logger.Trace(`DeviceManager: Sending ${deviceMsg.Type} to ${device.Name} (${deviceMsg.Id})`);

@@ -124,0 +122,0 @@ return yield device.ParseMessage(deviceMsg);

{
"name": "buttplug",
"version": "0.12.3",
"version": "0.13.0",
"description": "Javascript library for creating or accessing Buttplug Intimate Hardware Protocol servers/clients, for node or web",

@@ -42,3 +42,3 @@ "homepage": "https://github.com/buttplugio/buttplug-js/packages/buttplug#readme",

"dependencies": {
"ajv": "^6.10.2",
"ajv": "^6.12.0",
"class-transformer": "^0.2.3",

@@ -45,0 +45,0 @@ "reflect-metadata": "^0.1.13"

@@ -15,10 +15,10 @@ /*!

import { FromJSON } from "../core/MessageUtils";
import { ButtplugMessageSorter } from "./ButtplugMessageSorter";
import { ButtplugMessageSorter } from "../utils/ButtplugMessageSorter";
export class ButtplugBrowserWebsocketClientConnector extends EventEmitter implements IButtplugClientConnector {
private _sorter: ButtplugMessageSorter = new ButtplugMessageSorter();
private _sorter: ButtplugMessageSorter = new ButtplugMessageSorter(true);
private _ws: WebSocket | undefined;
public constructor(private _url: string) {
public constructor(private _url: string, private _shouldUseSorter: boolean = true) {
super();

@@ -64,3 +64,3 @@ }

}
const p = this._sorter.PrepareOutgoingMessage(aMsg);
const p = this._shouldUseSorter? this._sorter.PrepareOutgoingMessage(aMsg) : aMsg;
this._ws!.send("[" + aMsg.toJSON() + "]");

@@ -67,0 +67,0 @@ return await p;

@@ -12,2 +12,3 @@ /*!

import { ButtplugDeviceException } from "../core/Exceptions";
import { EventEmitter } from "events";

@@ -17,3 +18,3 @@ /**

*/
export class ButtplugClientDevice {
export class ButtplugClientDevice extends EventEmitter {

@@ -40,2 +41,9 @@ /**

}
public get AllowedMessagesObject(): object {
const obj = {};
this.allowedMsgs.forEach((value, key) => { obj[key] = value; });
return obj;
}
public static fromMsg(aMsg: Messages.DeviceAdded | Messages.DeviceInfoWithSpecifications,

@@ -63,2 +71,3 @@ sendClosure: (aDevice: ButtplugClientDevice,

aMsg: Messages.ButtplugDeviceMessage) => Promise<void>) {
super();
for (const k of Object.keys(allowedMsgsObj)) {

@@ -177,2 +186,6 @@ this.allowedMsgs.set(k, allowedMsgsObj[k]);

public EmitDisconnected() {
this.emit("deviceremoved");
}
private CheckGenericSubcommandList<T extends Messages.GenericMessageSubcommand>(aType: string,

@@ -179,0 +192,0 @@ aCmdList: T[],

@@ -141,2 +141,3 @@ /*!

const removedDevice = this._devices.get(removedMsg.DeviceIndex);
removedDevice?.EmitDisconnected();
this._devices.delete(removedMsg.DeviceIndex);

@@ -156,3 +157,3 @@ this.emit("deviceremoved", removedDevice);

this.CheckConnector();
const msg = await this.SendMessage(new Messages.RequestServerInfo(this._clientName, 1));
const msg = await this.SendMessage(new Messages.RequestServerInfo(this._clientName, Messages.MESSAGE_SPEC_VERSION));
switch (msg.constructor) {

@@ -159,0 +160,0 @@ case Messages.ServerInfo: {

@@ -19,2 +19,3 @@ /*!

export const MAX_ID = 4294967295;
export const MESSAGE_SPEC_VERSION = 1;

@@ -21,0 +22,0 @@ export abstract class ButtplugMessage {

@@ -54,9 +54,2 @@ /*!

// See ButtplugDeviceProtocol.MsgFuncs comment
//
// tslint:disable-next-line:ban-types
public get AllowedMessageTypes(): Function[] {
return this._protocol.AllowedMessageTypes;
}
public ParseMessage = async (aMsg: Messages.ButtplugDeviceMessage): Promise<Messages.ButtplugMessage> => {

@@ -63,0 +56,0 @@ return await this._protocol.ParseMessage(aMsg);

@@ -15,4 +15,2 @@ /*!

import { IButtplugDeviceImpl } from "./IButtplugDeviceImpl";
import { ButtplugDeviceWriteOptions } from "./ButtplugDeviceWriteOptions";
import { ButtplugDeviceReadOptions } from "./ButtplugDeviceReadOptions";

@@ -19,0 +17,0 @@ export abstract class ButtplugDeviceProtocol extends EventEmitter implements IButtplugDeviceProtocol {

@@ -14,6 +14,2 @@ /*!

readonly MessageSpecifications: object;
// See ButtplugDeviceProtocol.MsgFuncs comment
//
// tslint:disable-next-line:ban-types
readonly AllowedMessageTypes: Function[];
readonly Name: string;

@@ -20,0 +16,0 @@ readonly Id: string;

@@ -23,3 +23,3 @@ /*!

};
public static readonly EightBitSpeed: string[] = ["Moxie", "Vector"];
public static readonly EightBitSpeed: string[] = ["Melt", "Moxie", "Vector"];

@@ -30,2 +30,3 @@ private readonly _vibratorCount: number = 1;

private _vibratorSpeed = [ 0.0, 0.0 ];
private _max8bit = 12;

@@ -38,2 +39,5 @@ public constructor(aDeviceImpl: IButtplugDeviceImpl) {

}
if(aDeviceImpl.Name === "Melt") {
this._max8bit = 22;
}
this._eightBitSpeed = WeVibe.EightBitSpeed.find((x) => x === aDeviceImpl.Name) ? true : false;

@@ -82,4 +86,4 @@ this.MsgFuncs.set(Messages.StopDeviceCmd, this.HandleStopDeviceCmd);

if (this._eightBitSpeed) {
rSpeedInt = Math.round(this._vibratorSpeed[0] * 12);
rSpeedExt = Math.round(this._vibratorSpeed[this._vibratorCount - 1] * 12);
rSpeedInt = Math.round(this._vibratorSpeed[0] * this._max8bit);
rSpeedExt = Math.round(this._vibratorSpeed[this._vibratorCount - 1] * this._max8bit);

@@ -86,0 +90,0 @@ data[3] = (rSpeedExt + 3); // External

@@ -14,3 +14,4 @@ /*!

export * from "./client/ButtplugEmbeddedClientConnector";
export * from "./client/ButtplugMessageSorter";
export * from "./client/ButtplugClientForwarder";
export * from "./utils/ButtplugMessageSorter";
export * from "./client/IButtplugClientConnector";

@@ -37,2 +38,5 @@ export * from "./core/Messages";

export * from "./server/IDeviceSubtypeManager";
export * from "./server/managers/forwardeddevices/ForwardedDevice";
export * from "./server/managers/forwardeddevices/ForwardedDeviceManager";
export * from "./server/managers/forwardeddevices/ForwardedDeviceProtocol";
export * from "./test/TestDeviceImpl";

@@ -39,0 +43,0 @@ export * from "./test/TestDeviceProtocol";

@@ -144,8 +144,3 @@ /*!

const device = this._devices.get(deviceMsg.DeviceIndex)!;
if (device.AllowedMessageTypes.indexOf(aMessage.Type) < 0) {
throw ButtplugException.LogAndError(ButtplugDeviceException,
this._logger,
`Device ${device.Name} does not take message type ${aMessage.Type.name}`,
id);
}
// Pass all device messages to ParseMessage, if it fails there, we'll error out.
this._logger.Trace(`DeviceManager: Sending ${deviceMsg.Type} to ${device.Name} (${deviceMsg.Id})`);

@@ -152,0 +147,0 @@ return await device.ParseMessage(deviceMsg);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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