@kittycad/lib
Advanced tools
@@ -19,6 +19,16 @@ import { Client } from '../../client.js'; | ||
| /** | ||
| * Open a websocket which accepts modeling commands. | ||
| * Opens a WebSocket to a Zoo KittyCAD engine instance. | ||
| * | ||
| * Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine. | ||
| * **Note**: Currently it's recommended to set `webrtc=true` in the WebSocket query string, otherwise some features, such as opacity setting, will cause the engine to fail. | ||
| * | ||
| * Due to the long-lived nature of the instances, it's possible the resources on have been used and not freed entirely, or the instance is in a bad state. Thus it's good practice to expect to have to potentially reconnect at any moment -even almost immediately after the first connection! | ||
| * | ||
| * Authorization happens via a pseudo HTTP header over the WebSocket: `{ type: "headers", headers: { "Authorization": "Bearer xxxxxxxxx" }}` | ||
| * | ||
| * The very next thing recommended is to setup a ping-pong interval. The current timeout is 10s and has no documented guarantee, so use a conservative number below that. 5s should be sufficient. A ping-pong interval is sending `{ type: 'ping" }` when `{ request_id, success, resp: { type: "pong", data: {} } }` message is received. | ||
| * | ||
| * You're ready to start sending modeling commands! | ||
| * | ||
| * If you want to understand how to connect to the WebRTC video stream, https://github.com/KittyCAD/kittycad.ts/blob/main/src/webrtc.ts is a nice example to learn from. | ||
| * | ||
| * Tags: modeling | ||
@@ -25,0 +35,0 @@ * |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"modeling_commands_ws.d.ts","sourceRoot":"","sources":["../../../../../src/api/modeling/modeling_commands_ws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,iBAAiB,CAAA;AAIpD,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,iBAAiB,CAAA;AAExB,UAAU,wBAAwB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,WAAW,CAAC,EAAE,cAAc,CAAA;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8BAA8B,CAAC,EAAE,OAAO,CAAA;IACxC,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAkB;;IAGrC;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,wBAAwB,GAAG,GAAG;IA2B1E,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAAE,wBAAwB,EAC5C,EAAE,EAAE,SAAS;IAqBf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,GAAG,UAAU;IAIjD;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,EAAE,EAAE,YAAY,GAAG,iBAAiB;CAgCzD"} | ||
| {"version":3,"file":"modeling_commands_ws.d.ts","sourceRoot":"","sources":["../../../../../src/api/modeling/modeling_commands_ws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,iBAAiB,CAAA;AAIpD,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,iBAAiB,CAAA;AAExB,UAAU,wBAAwB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,WAAW,CAAC,EAAE,cAAc,CAAA;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8BAA8B,CAAC,EAAE,OAAO,CAAA;IACxC,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAkB;;IAGrC;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,wBAAwB,GAAG,GAAG;IA2B1E,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAAE,wBAAwB,EAC5C,EAAE,EAAE,SAAS;IAqBf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,GAAG,UAAU;IAIjD;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,EAAE,EAAE,YAAY,GAAG,iBAAiB;CAgCzD"} |
+1
-1
| { | ||
| "name": "@kittycad/lib", | ||
| "version": "4.3.30", | ||
| "version": "4.3.31", | ||
| "description": "Javascript library for KittyCAD API", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
1616711
0.66%20296
0.24%