buttplug 3.2.2 → 4.0.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.
Files changed (179) hide show
  1. package/.eslintrc.js +25 -25
  2. package/.jscsrc +2 -2
  3. package/.jshintrc +5 -5
  4. package/.prettierrc.json +3 -3
  5. package/.yarnrc.yml +5 -5
  6. package/CHANGELOG.md +577 -577
  7. package/LICENSE +27 -27
  8. package/README.md +97 -97
  9. package/dist/main/src/client/ButtplugBrowserWebsocketClientConnector.js +6 -9
  10. package/dist/main/src/client/ButtplugBrowserWebsocketClientConnector.js.map +1 -1
  11. package/dist/main/src/client/{Client.d.ts → ButtplugClient.d.ts} +3 -4
  12. package/dist/main/src/client/ButtplugClient.js +227 -0
  13. package/dist/main/src/client/ButtplugClient.js.map +1 -0
  14. package/dist/main/src/client/ButtplugClientConnectorException.js +17 -7
  15. package/dist/main/src/client/ButtplugClientConnectorException.js.map +1 -1
  16. package/dist/main/src/client/ButtplugClientDevice.d.ts +13 -28
  17. package/dist/main/src/client/ButtplugClientDevice.js +105 -247
  18. package/dist/main/src/client/ButtplugClientDevice.js.map +1 -1
  19. package/dist/main/src/client/ButtplugClientDeviceCommand.d.ts +42 -0
  20. package/dist/main/src/client/ButtplugClientDeviceCommand.js +105 -0
  21. package/dist/main/src/client/ButtplugClientDeviceCommand.js.map +1 -0
  22. package/dist/main/src/client/ButtplugClientDeviceFeature.d.ts +18 -0
  23. package/dist/main/src/client/ButtplugClientDeviceFeature.js +166 -0
  24. package/dist/main/src/client/ButtplugClientDeviceFeature.js.map +1 -0
  25. package/dist/main/src/client/ButtplugNodeWebsocketClientConnector.d.ts +1 -8
  26. package/dist/main/src/client/ButtplugNodeWebsocketClientConnector.js +1 -4
  27. package/dist/main/src/client/ButtplugNodeWebsocketClientConnector.js.map +1 -1
  28. package/dist/main/src/core/Exceptions.js +27 -9
  29. package/dist/main/src/core/Exceptions.js.map +1 -1
  30. package/dist/main/src/core/Logging.js +12 -6
  31. package/dist/main/src/core/Logging.js.map +1 -1
  32. package/dist/main/src/core/Messages.d.ts +118 -228
  33. package/dist/main/src/core/Messages.js +51 -404
  34. package/dist/main/src/core/Messages.js.map +1 -1
  35. package/dist/main/src/index.d.ts +2 -2
  36. package/dist/main/src/index.js +4 -2
  37. package/dist/main/src/index.js.map +1 -1
  38. package/dist/main/src/utils/ButtplugBrowserWebsocketConnector.js +40 -52
  39. package/dist/main/src/utils/ButtplugBrowserWebsocketConnector.js.map +1 -1
  40. package/dist/main/src/utils/ButtplugMessageSorter.js +27 -15
  41. package/dist/main/src/utils/ButtplugMessageSorter.js.map +1 -1
  42. package/dist/main/src/utils/Utils.js +1 -2
  43. package/dist/main/src/utils/Utils.js.map +1 -1
  44. package/dist/web/buttplug.js +1 -38
  45. package/dist/web/buttplug.mjs +595 -1984
  46. package/dist/web/client/ButtplugBrowserWebsocketClientConnector.d.ts +0 -7
  47. package/dist/web/client/{Client.d.ts → ButtplugClient.d.ts} +3 -11
  48. package/dist/web/client/ButtplugClientConnectorException.d.ts +0 -7
  49. package/dist/web/client/ButtplugClientDevice.d.ts +14 -29
  50. package/dist/web/client/ButtplugClientDeviceCommand.d.ts +42 -0
  51. package/dist/web/client/ButtplugClientDeviceFeature.d.ts +18 -0
  52. package/dist/web/client/ButtplugNodeWebsocketClientConnector.d.ts +1 -15
  53. package/dist/web/client/IButtplugClientConnector.d.ts +0 -7
  54. package/dist/web/core/Exceptions.d.ts +1 -1
  55. package/dist/web/core/Logging.d.ts +0 -7
  56. package/dist/web/core/Messages.d.ts +118 -227
  57. package/dist/web/index.d.ts +2 -2
  58. package/dist/web/utils/ButtplugBrowserWebsocketConnector.d.ts +0 -7
  59. package/examples/node/SYNC_MANIFEST.md +105 -0
  60. package/examples/node/application-example.ts +213 -0
  61. package/examples/node/async-example.ts +124 -0
  62. package/examples/node/connection-example.ts +76 -0
  63. package/examples/node/device-control-example.ts +131 -0
  64. package/examples/node/device-enumeration-example.ts +86 -0
  65. package/examples/node/device-info-example.ts +131 -0
  66. package/examples/node/errors-example.ts +166 -0
  67. package/examples/node/package-lock.json +281 -0
  68. package/examples/node/package.json +25 -0
  69. package/examples/node/remote-connector-example.ts +84 -0
  70. package/examples/node/tsconfig.json +14 -0
  71. package/examples/web/application-example.js +197 -0
  72. package/examples/web/async-example.js +90 -0
  73. package/examples/web/device-control-example.js +87 -0
  74. package/examples/web/device-enumeration-example.js +49 -0
  75. package/examples/web/device-info-example.js +100 -0
  76. package/examples/web/errors-example.js +110 -0
  77. package/examples/web/index.html +55 -0
  78. package/examples/web/logging.js +42 -0
  79. package/examples/web/ping-timeout-example.js +59 -0
  80. package/examples/web/remote-connector-example.js +68 -0
  81. package/node-test.js +24 -0
  82. package/node-test.ts +23 -5
  83. package/package.json +85 -87
  84. package/src/client/ButtplugBrowserWebsocketClientConnector.ts +25 -25
  85. package/src/client/ButtplugClient.ts +242 -0
  86. package/src/client/ButtplugClientConnectorException.ts +16 -16
  87. package/src/client/ButtplugClientDevice.ts +178 -401
  88. package/src/client/ButtplugClientDeviceCommand.ts +112 -0
  89. package/src/client/ButtplugClientDeviceFeature.ts +138 -0
  90. package/src/client/ButtplugNodeWebsocketClientConnector.ts +17 -17
  91. package/src/client/IButtplugClientConnector.ts +18 -18
  92. package/src/core/Exceptions.ts +107 -101
  93. package/src/core/Logging.ts +197 -197
  94. package/src/core/Messages.ts +209 -480
  95. package/src/core/index.d.ts +4 -4
  96. package/src/index.ts +21 -19
  97. package/src/utils/ButtplugBrowserWebsocketConnector.ts +89 -89
  98. package/src/utils/ButtplugMessageSorter.ts +66 -65
  99. package/src/utils/Utils.ts +3 -3
  100. package/tsconfig.json +22 -22
  101. package/tsfmt.json +14 -14
  102. package/tslint.json +27 -27
  103. package/typedocconfig.js +6 -6
  104. package/vite.config.ts +26 -26
  105. package/dist/main/src/client/Client.js +0 -242
  106. package/dist/main/src/client/Client.js.map +0 -1
  107. package/dist/main/src/core/MessageUtils.d.ts +0 -10
  108. package/dist/main/src/core/MessageUtils.js +0 -65
  109. package/dist/main/src/core/MessageUtils.js.map +0 -1
  110. package/dist/web/core/MessageUtils.d.ts +0 -10
  111. package/doc/.nojekyll +0 -1
  112. package/doc/assets/highlight.css +0 -22
  113. package/doc/assets/main.js +0 -58
  114. package/doc/assets/search.js +0 -1
  115. package/doc/assets/style.css +0 -1280
  116. package/doc/classes/ButtplugBrowserWebsocketClientConnector.html +0 -234
  117. package/doc/classes/ButtplugClient.html +0 -331
  118. package/doc/classes/ButtplugClientConnectorException.html +0 -216
  119. package/doc/classes/ButtplugClientDevice.html +0 -489
  120. package/doc/classes/ButtplugDeviceError.html +0 -218
  121. package/doc/classes/ButtplugDeviceMessage.html +0 -165
  122. package/doc/classes/ButtplugError.html +0 -220
  123. package/doc/classes/ButtplugInitError.html +0 -218
  124. package/doc/classes/ButtplugLogger.html +0 -288
  125. package/doc/classes/ButtplugMessage.html +0 -147
  126. package/doc/classes/ButtplugMessageError.html +0 -218
  127. package/doc/classes/ButtplugMessageSorter.html +0 -128
  128. package/doc/classes/ButtplugNodeWebsocketClientConnector.html +0 -239
  129. package/doc/classes/ButtplugPingError.html +0 -218
  130. package/doc/classes/ButtplugSystemMessage.html +0 -150
  131. package/doc/classes/ButtplugUnknownError.html +0 -218
  132. package/doc/classes/DeviceAdded.html +0 -186
  133. package/doc/classes/DeviceInfo.html +0 -114
  134. package/doc/classes/DeviceList.html +0 -160
  135. package/doc/classes/DeviceRemoved.html +0 -158
  136. package/doc/classes/Error.html +0 -179
  137. package/doc/classes/GenericDeviceMessageAttributes.html +0 -107
  138. package/doc/classes/GenericMessageSubcommand.html +0 -90
  139. package/doc/classes/LinearCmd.html +0 -187
  140. package/doc/classes/LogMessage.html +0 -134
  141. package/doc/classes/MessageAttributes.html +0 -160
  142. package/doc/classes/Ok.html +0 -151
  143. package/doc/classes/Ping.html +0 -151
  144. package/doc/classes/RawDeviceMessageAttributes.html +0 -86
  145. package/doc/classes/RawReadCmd.html +0 -188
  146. package/doc/classes/RawReading.html +0 -179
  147. package/doc/classes/RawSubscribeCmd.html +0 -170
  148. package/doc/classes/RawUnsubscribeCmd.html +0 -170
  149. package/doc/classes/RawWriteCmd.html +0 -188
  150. package/doc/classes/RequestDeviceList.html +0 -151
  151. package/doc/classes/RequestServerInfo.html +0 -169
  152. package/doc/classes/RotateCmd.html +0 -187
  153. package/doc/classes/RotateSubcommand.html +0 -108
  154. package/doc/classes/ScalarCmd.html +0 -170
  155. package/doc/classes/ScalarSubcommand.html +0 -108
  156. package/doc/classes/ScanningFinished.html +0 -146
  157. package/doc/classes/SensorDeviceMessageAttributes.html +0 -107
  158. package/doc/classes/SensorReadCmd.html +0 -179
  159. package/doc/classes/SensorReading.html +0 -188
  160. package/doc/classes/ServerInfo.html +0 -178
  161. package/doc/classes/StartScanning.html +0 -151
  162. package/doc/classes/StopAllDevices.html +0 -151
  163. package/doc/classes/StopDeviceCmd.html +0 -161
  164. package/doc/classes/StopScanning.html +0 -151
  165. package/doc/classes/VectorSubcommand.html +0 -108
  166. package/doc/enums/ActuatorType.html +0 -104
  167. package/doc/enums/ButtplugLogLevel.html +0 -97
  168. package/doc/enums/ErrorClass.html +0 -90
  169. package/doc/enums/SensorType.html +0 -90
  170. package/doc/functions/FromJSON.html +0 -113
  171. package/doc/index.html +0 -184
  172. package/doc/interfaces/IButtplugClientConnector.html +0 -137
  173. package/doc/modules.html +0 -176
  174. package/doc/variables/DEFAULT_MESSAGE_ID.html +0 -104
  175. package/doc/variables/MAX_ID.html +0 -104
  176. package/doc/variables/MESSAGE_SPEC_VERSION.html +0 -104
  177. package/doc/variables/SYSTEM_MESSAGE_ID.html +0 -104
  178. package/src/client/Client.ts +0 -276
  179. package/src/core/MessageUtils.ts +0 -48
package/LICENSE CHANGED
@@ -1,27 +1,27 @@
1
- Copyright (c) 2017-2018, Nonpolynomial Labs LLC
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without
5
- modification, are permitted provided that the following conditions are met:
6
-
7
- * Redistributions of source code must retain the above copyright notice, this
8
- list of conditions and the following disclaimer.
9
-
10
- * Redistributions in binary form must reproduce the above copyright notice,
11
- this list of conditions and the following disclaimer in the documentation
12
- and/or other materials provided with the distribution.
13
-
14
- * Neither the name of buttplug-js nor the names of its
15
- contributors may be used to endorse or promote products derived from
16
- this software without specific prior written permission.
17
-
18
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ Copyright (c) 2017-2018, Nonpolynomial Labs LLC
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+
10
+ * Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+
14
+ * Neither the name of buttplug-js nor the names of its
15
+ contributors may be used to endorse or promote products derived from
16
+ this software without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
@@ -1,98 +1,98 @@
1
- # Buttplug Typescript/JS Client Implementation
2
-
3
- [![Patreon donate button](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/qdot)
4
- [![Github donate button](https://img.shields.io/badge/github-donate-ff69b4.svg)](https://www.github.com/sponsors/qdot)
5
-
6
- [![Discourse Forum](https://img.shields.io/badge/discourse-forum-blue.svg)](https://discuss.buttplug.io)
7
- [![Discord](https://img.shields.io/discord/353303527587708932.svg?logo=discord)](https://discord.buttplug.io)
8
- [![Twitter](https://img.shields.io/twitter/follow/buttplugio.svg?style=social&logo=twitter)](https://twitter.com/buttplugio)
9
-
10
- A implementation of the Buttplug Client in Typescript/Javascript, implementing the Version 3
11
- Buttplug Spec. It is expected to run from a browser against either [Intiface Central
12
- (GUI)](https://intiface.com/central), [Initface Engine
13
- (CLI)](https://github.com/intiface/intiface-engine), or [the Buttplug WASM Server](https://github.com/buttplugio/buttplug-js).
14
-
15
- ## Compilation information
16
-
17
- buttplug-js builds to 3 different types of library:
18
-
19
- - CommonJS for node
20
- - UMD and ES Modules for the web
21
-
22
- For node, simply include the package as you would any other package.
23
-
24
- For inclusion in web projects, the UMD project can be found at `dist/web/buttplug.js` (Note that the namespace is `buttplug`, so you'll access types like `buttplug.ButtplugClient`, etc...), and the es6 module at `dist/web/buttplug.mjs`.
25
-
26
- ## Using buttplug-js with Node
27
-
28
- buttplug-js works with both pure web builds, as well as node applications. To use buttplug-js with
29
- node, use the `ButtplugNodeWebsocketClientConnector` class instead of the
30
- `ButtplugBrowserWebsocketClientConnector` class. That should be the only change needed, all of the
31
- API stays the same. See the Documentation section for more info.
32
-
33
- (The WASM Server *does not work* with pure node applications. It requires a browser environment in order to run. See the WASM project README for more info.)
34
-
35
- ## Documentation and Examples
36
-
37
- Documentation on how to use Buttplug in general, as well as examples for buttplug-js, can be found in the [Buttplug Developer Guide](https://docs.buttplug.io/docs/dev-guide).
38
-
39
- API documentation for buttplug-js can be found at https://buttplugio.github.io/buttplug-js.
40
-
41
- If you would like to see a demo of using Buttplug in a pure web context, check out the following glitch project, which shows how to pull the Buttplug libraries from a CDN and use them in a pure HTML/JS context without node:
42
-
43
- https://glitch.com/edit/#!/how-to-buttplug
44
-
45
- ## Contributing
46
-
47
- If you have issues or feature requests, [please feel free to file an issue on this repo](issues/).
48
-
49
- We are not looking for code contributions or pull requests at this time, and will not accept pull
50
- requests that do not have a matching issue where the matter was previously discussed. Pull requests
51
- should only be submitted after talking to [qdot](https://github.com/qdot) via issues on this repo
52
- (or on [discourse](https://discuss.buttplug.io) or [discord](https://discord.buttplug.io) if you
53
- would like to stay anonymous and out of recorded info on the repo) before submitting PRs. Random PRs
54
- without matching issues and discussion are likely to be closed without merging. and receiving
55
- approval to develop code based on an issue. Any random or non-issue pull requests will most likely
56
- be closed without merging.
57
-
58
- If you'd like to contribute in a non-technical way, we need money to keep up with supporting the
59
- latest and greatest hardware. We have multiple ways to donate!
60
-
61
- - [Patreon](https://patreon.com/qdot)
62
- - [Github Sponsors](https://github.com/sponsors/qdot)
63
- - [Ko-Fi](https://ko-fi.com/qdot76367)
64
-
65
- ## License
66
-
67
- This project is BSD 3-Clause licensed.
68
-
69
- ```text
70
-
71
- Copyright (c) 2016-2023, Nonpolynomial Labs, LLC
72
- All rights reserved.
73
-
74
- Redistribution and use in source and binary forms, with or without
75
- modification, are permitted provided that the following conditions are met:
76
-
77
- * Redistributions of source code must retain the above copyright notice, this
78
- list of conditions and the following disclaimer.
79
-
80
- * Redistributions in binary form must reproduce the above copyright notice,
81
- this list of conditions and the following disclaimer in the documentation
82
- and/or other materials provided with the distribution.
83
-
84
- * Neither the name of buttplug nor the names of its
85
- contributors may be used to endorse or promote products derived from
86
- this software without specific prior written permission.
87
-
88
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
89
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
90
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
91
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
92
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
93
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
94
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
95
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
96
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
97
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ # Buttplug Typescript/JS Client Implementation
2
+
3
+ [![Patreon donate button](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/qdot)
4
+ [![Github donate button](https://img.shields.io/badge/github-donate-ff69b4.svg)](https://www.github.com/sponsors/qdot)
5
+
6
+ [![Discourse Forum](https://img.shields.io/badge/discourse-forum-blue.svg)](https://discuss.buttplug.io)
7
+ [![Discord](https://img.shields.io/discord/353303527587708932.svg?logo=discord)](https://discord.buttplug.io)
8
+ [![Twitter](https://img.shields.io/twitter/follow/buttplugio.svg?style=social&logo=twitter)](https://twitter.com/buttplugio)
9
+
10
+ A implementation of the Buttplug Client in Typescript/Javascript, implementing the Version 3
11
+ Buttplug Spec. It is expected to run from a browser against either [Intiface Central
12
+ (GUI)](https://intiface.com/central), [Initface Engine
13
+ (CLI)](https://github.com/intiface/intiface-engine), or [the Buttplug WASM Server](https://github.com/buttplugio/buttplug-js).
14
+
15
+ ## Compilation information
16
+
17
+ buttplug-js builds to 3 different types of library:
18
+
19
+ - CommonJS for node
20
+ - UMD and ES Modules for the web
21
+
22
+ For node, simply include the package as you would any other package.
23
+
24
+ For inclusion in web projects, the UMD project can be found at `dist/web/buttplug.js` (Note that the namespace is `buttplug`, so you'll access types like `buttplug.ButtplugClient`, etc...), and the es6 module at `dist/web/buttplug.mjs`.
25
+
26
+ ## Using buttplug-js with Node
27
+
28
+ buttplug-js works with both pure web builds, as well as node applications. To use buttplug-js with
29
+ node, use the `ButtplugNodeWebsocketClientConnector` class instead of the
30
+ `ButtplugBrowserWebsocketClientConnector` class. That should be the only change needed, all of the
31
+ API stays the same. See the Documentation section for more info.
32
+
33
+ (The WASM Server *does not work* with pure node applications. It requires a browser environment in order to run. See the WASM project README for more info.)
34
+
35
+ ## Documentation and Examples
36
+
37
+ Documentation on how to use Buttplug in general, as well as examples for buttplug-js, can be found in the [Buttplug Developer Guide](https://docs.buttplug.io/docs/dev-guide).
38
+
39
+ API documentation for buttplug-js can be found at https://buttplugio.github.io/buttplug-js.
40
+
41
+ If you would like to see a demo of using Buttplug in a pure web context, check out the following glitch project, which shows how to pull the Buttplug libraries from a CDN and use them in a pure HTML/JS context without node:
42
+
43
+ https://glitch.com/edit/#!/how-to-buttplug
44
+
45
+ ## Contributing
46
+
47
+ If you have issues or feature requests, [please feel free to file an issue on this repo](issues/).
48
+
49
+ We are not looking for code contributions or pull requests at this time, and will not accept pull
50
+ requests that do not have a matching issue where the matter was previously discussed. Pull requests
51
+ should only be submitted after talking to [qdot](https://github.com/qdot) via issues on this repo
52
+ (or on [discourse](https://discuss.buttplug.io) or [discord](https://discord.buttplug.io) if you
53
+ would like to stay anonymous and out of recorded info on the repo) before submitting PRs. Random PRs
54
+ without matching issues and discussion are likely to be closed without merging. and receiving
55
+ approval to develop code based on an issue. Any random or non-issue pull requests will most likely
56
+ be closed without merging.
57
+
58
+ If you'd like to contribute in a non-technical way, we need money to keep up with supporting the
59
+ latest and greatest hardware. We have multiple ways to donate!
60
+
61
+ - [Patreon](https://patreon.com/qdot)
62
+ - [Github Sponsors](https://github.com/sponsors/qdot)
63
+ - [Ko-Fi](https://ko-fi.com/qdot76367)
64
+
65
+ ## License
66
+
67
+ This project is BSD 3-Clause licensed.
68
+
69
+ ```text
70
+
71
+ Copyright (c) 2016-2023, Nonpolynomial Labs, LLC
72
+ All rights reserved.
73
+
74
+ Redistribution and use in source and binary forms, with or without
75
+ modification, are permitted provided that the following conditions are met:
76
+
77
+ * Redistributions of source code must retain the above copyright notice, this
78
+ list of conditions and the following disclaimer.
79
+
80
+ * Redistributions in binary form must reproduce the above copyright notice,
81
+ this list of conditions and the following disclaimer in the documentation
82
+ and/or other materials provided with the distribution.
83
+
84
+ * Neither the name of buttplug nor the names of its
85
+ contributors may be used to endorse or promote products derived from
86
+ this software without specific prior written permission.
87
+
88
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
89
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
90
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
91
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
92
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
93
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
94
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
95
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
96
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
97
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
98
98
  ```
@@ -10,15 +10,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.ButtplugBrowserWebsocketClientConnector = void 0;
11
11
  const ButtplugBrowserWebsocketConnector_1 = require("../utils/ButtplugBrowserWebsocketConnector");
12
12
  class ButtplugBrowserWebsocketClientConnector extends ButtplugBrowserWebsocketConnector_1.ButtplugBrowserWebsocketConnector {
13
- constructor() {
14
- super(...arguments);
15
- this.send = (msg) => {
16
- if (!this.Connected) {
17
- throw new Error('ButtplugClient not connected');
18
- }
19
- this.sendMessage(msg);
20
- };
21
- }
13
+ send = (msg) => {
14
+ if (!this.Connected) {
15
+ throw new Error('ButtplugClient not connected');
16
+ }
17
+ this.sendMessage(msg);
18
+ };
22
19
  }
23
20
  exports.ButtplugBrowserWebsocketClientConnector = ButtplugBrowserWebsocketClientConnector;
24
21
  //# sourceMappingURL=ButtplugBrowserWebsocketClientConnector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtplugBrowserWebsocketClientConnector.js","sourceRoot":"","sources":["../../../../src/client/ButtplugBrowserWebsocketClientConnector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,CAAC;;;AAIb,kGAA+F;AAE/F,MAAa,uCACX,SAAQ,qEAAiC;IAD3C;;QAIS,SAAI,GAAG,CAAC,GAAoB,EAAQ,EAAE;YAC3C,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;gBACnB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;aACjD;YACD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC;CAAA;AAVD,0FAUC"}
1
+ {"version":3,"file":"ButtplugBrowserWebsocketClientConnector.js","sourceRoot":"","sources":["../../../../src/client/ButtplugBrowserWebsocketClientConnector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,CAAC;;;AAIb,kGAA+F;AAE/F,MAAa,uCACX,SAAQ,qEAAiC;IAGlC,IAAI,GAAG,CAAC,GAAoB,EAAQ,EAAE;QAC3C,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC,CAAC;CACH;AAVD,0FAUC"}
@@ -5,7 +5,6 @@
5
5
  *
6
6
  * @copyright Copyright (c) Nonpolynomial Labs LLC. All rights reserved.
7
7
  */
8
- /// <reference types="node" />
9
8
  import { ButtplugLogger } from '../core/Logging';
10
9
  import { EventEmitter } from 'eventemitter3';
11
10
  import { ButtplugClientDevice } from './ButtplugClientDevice';
@@ -21,21 +20,21 @@ export declare class ButtplugClient extends EventEmitter {
21
20
  private _sorter;
22
21
  constructor(clientName?: string);
23
22
  get connected(): boolean;
24
- get devices(): ButtplugClientDevice[];
23
+ get devices(): Map<number, ButtplugClientDevice>;
25
24
  get isScanning(): boolean;
26
25
  connect: (connector: IButtplugClientConnector) => Promise<void>;
27
26
  disconnect: () => Promise<void>;
28
27
  startScanning: () => Promise<void>;
29
28
  stopScanning: () => Promise<void>;
30
29
  stopAllDevices: () => Promise<void>;
31
- private sendDeviceMessage;
32
30
  protected disconnectHandler: () => void;
33
31
  protected parseMessages: (msgs: Messages.ButtplugMessage[]) => void;
34
32
  protected initializeConnection: () => Promise<boolean>;
33
+ private parseDeviceList;
35
34
  protected requestDeviceList: () => Promise<void>;
36
35
  protected shutdownConnection: () => Promise<void>;
37
36
  protected sendMessage(msg: Messages.ButtplugMessage): Promise<Messages.ButtplugMessage>;
38
37
  protected checkConnector(): void;
39
38
  protected sendMsgExpectOk: (msg: Messages.ButtplugMessage) => Promise<void>;
40
- protected sendDeviceMessageClosure: (device: ButtplugClientDevice, msg: Messages.ButtplugDeviceMessage) => Promise<Messages.ButtplugMessage>;
39
+ protected sendMessageClosure: (msg: Messages.ButtplugMessage) => Promise<Messages.ButtplugMessage>;
41
40
  }
@@ -0,0 +1,227 @@
1
+ /*!
2
+ * Buttplug JS Source Code File - Visit https://buttplug.io for more info about
3
+ * the project. Licensed under the BSD 3-Clause license. See LICENSE file in the
4
+ * project root for full license information.
5
+ *
6
+ * @copyright Copyright (c) Nonpolynomial Labs LLC. All rights reserved.
7
+ */
8
+ 'use strict';
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || (function () {
26
+ var ownKeys = function(o) {
27
+ ownKeys = Object.getOwnPropertyNames || function (o) {
28
+ var ar = [];
29
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
+ return ar;
31
+ };
32
+ return ownKeys(o);
33
+ };
34
+ return function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
41
+ })();
42
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ exports.ButtplugClient = void 0;
44
+ const Logging_1 = require("../core/Logging");
45
+ const eventemitter3_1 = require("eventemitter3");
46
+ const ButtplugClientDevice_1 = require("./ButtplugClientDevice");
47
+ const ButtplugMessageSorter_1 = require("../utils/ButtplugMessageSorter");
48
+ const Messages = __importStar(require("../core/Messages"));
49
+ const Exceptions_1 = require("../core/Exceptions");
50
+ const ButtplugClientConnectorException_1 = require("./ButtplugClientConnectorException");
51
+ class ButtplugClient extends eventemitter3_1.EventEmitter {
52
+ _pingTimer = null;
53
+ _connector = null;
54
+ _devices = new Map();
55
+ _clientName;
56
+ _logger = Logging_1.ButtplugLogger.Logger;
57
+ _isScanning = false;
58
+ _sorter = new ButtplugMessageSorter_1.ButtplugMessageSorter(true);
59
+ constructor(clientName = 'Generic Buttplug Client') {
60
+ super();
61
+ this._clientName = clientName;
62
+ this._logger.Debug(`ButtplugClient: Client ${clientName} created.`);
63
+ }
64
+ get connected() {
65
+ return this._connector !== null && this._connector.Connected;
66
+ }
67
+ get devices() {
68
+ // While this function doesn't actually send a message, if we don't have a
69
+ // connector, we shouldn't have devices.
70
+ this.checkConnector();
71
+ return this._devices;
72
+ }
73
+ get isScanning() {
74
+ return this._isScanning;
75
+ }
76
+ connect = async (connector) => {
77
+ this._logger.Info(`ButtplugClient: Connecting using ${connector.constructor.name}`);
78
+ await connector.connect();
79
+ this._connector = connector;
80
+ this._connector.addListener('message', this.parseMessages);
81
+ this._connector.addListener('disconnect', this.disconnectHandler);
82
+ await this.initializeConnection();
83
+ };
84
+ disconnect = async () => {
85
+ this._logger.Debug('ButtplugClient: Disconnect called');
86
+ this.checkConnector();
87
+ await this.shutdownConnection();
88
+ await this._connector.disconnect();
89
+ };
90
+ startScanning = async () => {
91
+ this._logger.Debug('ButtplugClient: StartScanning called');
92
+ this._isScanning = true;
93
+ await this.sendMsgExpectOk({ StartScanning: { Id: 1 } });
94
+ };
95
+ stopScanning = async () => {
96
+ this._logger.Debug('ButtplugClient: StopScanning called');
97
+ this._isScanning = false;
98
+ await this.sendMsgExpectOk({ StopScanning: { Id: 1 } });
99
+ };
100
+ stopAllDevices = async () => {
101
+ this._logger.Debug('ButtplugClient: StopAllDevices');
102
+ await this.sendMsgExpectOk({ StopAllDevices: { Id: 1 } });
103
+ };
104
+ disconnectHandler = () => {
105
+ this._logger.Info('ButtplugClient: Disconnect event receieved.');
106
+ this.emit('disconnect');
107
+ };
108
+ parseMessages = (msgs) => {
109
+ const leftoverMsgs = this._sorter.ParseIncomingMessages(msgs);
110
+ for (const x of leftoverMsgs) {
111
+ if (x.DeviceList !== undefined) {
112
+ this.parseDeviceList(x);
113
+ break;
114
+ }
115
+ else if (x.ScanningFinished !== undefined) {
116
+ this._isScanning = false;
117
+ this.emit('scanningfinished', x);
118
+ }
119
+ else {
120
+ console.log(JSON.stringify(msgs));
121
+ }
122
+ }
123
+ };
124
+ initializeConnection = async () => {
125
+ this.checkConnector();
126
+ const msg = await this.sendMessage({
127
+ RequestServerInfo: {
128
+ ClientName: this._clientName,
129
+ Id: 1,
130
+ ProtocolVersionMajor: Messages.MESSAGE_SPEC_VERSION_MAJOR,
131
+ ProtocolVersionMinor: Messages.MESSAGE_SPEC_VERSION_MINOR
132
+ }
133
+ });
134
+ if (msg.ServerInfo !== undefined) {
135
+ const serverinfo = msg;
136
+ this._logger.Info(`ButtplugClient: Connected to Server ${serverinfo.ServerName}`);
137
+ // TODO: maybe store server name, do something with message template version?
138
+ const ping = serverinfo.MaxPingTime;
139
+ // If the server version is lower than the client version, the server will disconnect here.
140
+ if (ping > 0) {
141
+ /*
142
+ this._pingTimer = setInterval(async () => {
143
+ // If we've disconnected, stop trying to ping the server.
144
+ if (!this.Connected) {
145
+ await this.ShutdownConnection();
146
+ return;
147
+ }
148
+ await this.SendMessage(new Messages.Ping());
149
+ } , Math.round(ping / 2));
150
+ */
151
+ }
152
+ await this.requestDeviceList();
153
+ return true;
154
+ }
155
+ else if (msg.Error !== undefined) {
156
+ // Disconnect and throw an exception with the error message we got back.
157
+ // This will usually only error out if we have a version mismatch that the
158
+ // server has detected.
159
+ await this._connector.disconnect();
160
+ const err = msg.Error;
161
+ throw Exceptions_1.ButtplugError.LogAndError(Exceptions_1.ButtplugInitError, this._logger, `Cannot connect to server. ${err.ErrorMessage}`);
162
+ }
163
+ return false;
164
+ };
165
+ parseDeviceList = (list) => {
166
+ for (let [_, d] of Object.entries(list.Devices)) {
167
+ if (!this._devices.has(d.DeviceIndex)) {
168
+ const device = ButtplugClientDevice_1.ButtplugClientDevice.fromMsg(d, this.sendMessageClosure);
169
+ this._logger.Debug(`ButtplugClient: Adding Device: ${device}`);
170
+ this._devices.set(d.DeviceIndex, device);
171
+ this.emit('deviceadded', device);
172
+ }
173
+ else {
174
+ this._logger.Debug(`ButtplugClient: Device already added: ${d}`);
175
+ }
176
+ }
177
+ for (let [index, device] of this._devices.entries()) {
178
+ if (!list.Devices.hasOwnProperty(index.toString())) {
179
+ this._devices.delete(index);
180
+ this.emit('deviceremoved', device);
181
+ }
182
+ }
183
+ };
184
+ requestDeviceList = async () => {
185
+ this.checkConnector();
186
+ this._logger.Debug('ButtplugClient: ReceiveDeviceList called');
187
+ const response = (await this.sendMessage({
188
+ RequestDeviceList: { Id: 1 }
189
+ }));
190
+ this.parseDeviceList(response.DeviceList);
191
+ };
192
+ shutdownConnection = async () => {
193
+ await this.stopAllDevices();
194
+ if (this._pingTimer !== null) {
195
+ clearInterval(this._pingTimer);
196
+ this._pingTimer = null;
197
+ }
198
+ };
199
+ async sendMessage(msg) {
200
+ this.checkConnector();
201
+ const p = this._sorter.PrepareOutgoingMessage(msg);
202
+ await this._connector.send(msg);
203
+ return await p;
204
+ }
205
+ checkConnector() {
206
+ if (!this.connected) {
207
+ throw new ButtplugClientConnectorException_1.ButtplugClientConnectorException('ButtplugClient not connected');
208
+ }
209
+ }
210
+ sendMsgExpectOk = async (msg) => {
211
+ const response = await this.sendMessage(msg);
212
+ if (response.Ok !== undefined) {
213
+ return;
214
+ }
215
+ else if (response.Error !== undefined) {
216
+ throw Exceptions_1.ButtplugError.FromError(response);
217
+ }
218
+ else {
219
+ throw Exceptions_1.ButtplugError.LogAndError(Exceptions_1.ButtplugMessageError, this._logger, `Message ${response} not handled by SendMsgExpectOk`);
220
+ }
221
+ };
222
+ sendMessageClosure = async (msg) => {
223
+ return await this.sendMessage(msg);
224
+ };
225
+ }
226
+ exports.ButtplugClient = ButtplugClient;
227
+ //# sourceMappingURL=ButtplugClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtplugClient.js","sourceRoot":"","sources":["../../../../src/client/ButtplugClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,6CAAiD;AACjD,iDAA6C;AAC7C,iEAA8D;AAE9D,0EAAuE;AACvE,2DAA6C;AAC7C,mDAI4B;AAC5B,yFAAsF;AAEtF,MAAa,cAAe,SAAQ,4BAAY;IACpC,UAAU,GAA0B,IAAI,CAAC;IACzC,UAAU,GAAoC,IAAI,CAAC;IACnD,QAAQ,GAAsC,IAAI,GAAG,EAAE,CAAC;IACxD,WAAW,CAAS;IACpB,OAAO,GAAG,wBAAc,CAAC,MAAM,CAAC;IAChC,WAAW,GAAG,KAAK,CAAC;IACtB,OAAO,GAA0B,IAAI,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aAAM,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YACxC,MAAM,0BAAa,CAAC,SAAS,CAAC,QAA0B,CAAC,CAAC;QAC5D,CAAC;aAAM,CAAC;YACN,MAAM,0BAAa,CAAC,WAAW,CAC7B,iCAAoB,EACpB,IAAI,CAAC,OAAO,EACZ,WAAW,QAAQ,iCAAiC,CACrD,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;IAEQ,kBAAkB,GAAG,KAAK,EAClC,GAA6B,EACM,EAAE;QACrC,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC;CACH;AAtND,wCAsNC"}
@@ -22,13 +22,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
22
22
  }) : function(o, v) {
23
23
  o["default"] = v;
24
24
  });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
25
+ var __importStar = (this && this.__importStar) || (function () {
26
+ var ownKeys = function(o) {
27
+ ownKeys = Object.getOwnPropertyNames || function (o) {
28
+ var ar = [];
29
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
+ return ar;
31
+ };
32
+ return ownKeys(o);
33
+ };
34
+ return function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
41
+ })();
32
42
  Object.defineProperty(exports, "__esModule", { value: true });
33
43
  exports.ButtplugClientConnectorException = void 0;
34
44
  const Exceptions_1 = require("../core/Exceptions");
@@ -1 +1 @@
1
- {"version":3,"file":"ButtplugClientConnectorException.js","sourceRoot":"","sources":["../../../../src/client/ButtplugClientConnectorException.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAmD;AACnD,2DAA6C;AAE7C,MAAa,gCAAiC,SAAQ,0BAAa;IACjE,YAAmB,OAAe;QAChC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACpD,CAAC;CACF;AAJD,4EAIC"}
1
+ {"version":3,"file":"ButtplugClientConnectorException.js","sourceRoot":"","sources":["../../../../src/client/ButtplugClientConnectorException.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAmD;AACnD,2DAA6C;AAE7C,MAAa,gCAAiC,SAAQ,0BAAa;IACjE,YAAmB,OAAe;QAChC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACpD,CAAC;CACF;AAJD,4EAIC"}