{"_id":"@emdzej/bimmerz-rpc-core","_rev":"2-5218f4d45b3cd104c27bdbd341a2fa69","name":"@emdzej/bimmerz-rpc-core","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@emdzej/bimmerz-rpc-core","version":"0.1.0","_id":"@emdzej/bimmerz-rpc-core@0.1.0","maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"homepage":"https://github.com/emdzej/bimmerz#readme","bugs":{"url":"https://github.com/emdzej/bimmerz/issues"},"dist":{"shasum":"0ff426f34222b74d21d980582eb236a888fc248c","tarball":"https://registry.npmjs.org/@emdzej/bimmerz-rpc-core/-/bimmerz-rpc-core-0.1.0.tgz","fileCount":23,"integrity":"sha512-JuZ1D1Q4Sjb443g0tNqBNSpMYGX9+q93TBDjlGwmkh92T02lNFuHxklrKRewd5cyc3ulvkBdb/dwwdRnSieSSQ==","signatures":[{"sig":"MEYCIQDLowjz0uHGxz0JgV3Gsy533pqx/9L4fYhhP0cKNcGIDAIhALgGKwYEGXhDw8AXhguacLivRyqCaICGtT33DPrqw/A2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36498},"main":"dist/index.js","type":"module","_from":"file:emdzej-bimmerz-rpc-core-0.1.0.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","lint":"eslint .","build":"tsc","clean":"rm -rf dist .turbo *.tsbuildinfo","typecheck":"tsc --noEmit"},"_npmUser":{"name":"emdzej","email":"michal@jaskolski.pro"},"_resolved":"/private/var/folders/7h/x_w_580x4s9dq3sq11tpvzkwy3nbj8/T/9112ad33ab4adfbaa3f64e34dc62efd1/emdzej-bimmerz-rpc-core-0.1.0.tgz","_integrity":"sha512-JuZ1D1Q4Sjb443g0tNqBNSpMYGX9+q93TBDjlGwmkh92T02lNFuHxklrKRewd5cyc3ulvkBdb/dwwdRnSieSSQ==","repository":{"url":"git+https://github.com/emdzej/bimmerz.git","type":"git","directory":"packages/rpc-core"},"_npmVersion":"11.16.0","description":"JSON-RPC 2.0 over WebSocket client used by the bimmerz-box dongle's /rpc endpoints. Transport-only — protocol-specific clients (UART, CAN, ...) build on top.","directories":{},"_nodeVersion":"22.22.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.13.1"},"_npmOperationalInternal":{"tmp":"tmp/bimmerz-rpc-core_0.1.0_1781257936750_0.21269244760451778","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"_id":"@emdzej/bimmerz-rpc-core@0.3.0","bugs":{"url":"https://github.com/emdzej/bimmerz-core/issues"},"dist":{"shasum":"af61c9d260753b2599dd77861c4035ca5a2c1734","tarball":"https://registry.npmjs.org/@emdzej/bimmerz-rpc-core/-/bimmerz-rpc-core-0.3.0.tgz","fileCount":23,"integrity":"sha512-sAo+pnhN9yDF84IlVROA4iZDAhv8XatsgR4zyA0QtyZxjm/XBB0fwyd7Qv3u/df1pDxhaICuXIm92tQQp/5skA==","signatures":[{"sig":"MEYCIQCIP0IeYnTi2Ok64bOCCx4uHJu1ogY9ls1ueH7vcK+WrwIhAMC87p2Zcn5b34P6O1NpQ9LpjjkLUHqXRCo2b0iz4u/O","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHraZayx1uXdflAoNaFUZZN55xfixOIcT+PYJQR5pbQqAiEAjP+H7wJWDuWO3w5PDxmqtqkYAbsrfV52ff6j3xjYXRU="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@emdzej%2fbimmerz-rpc-core@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":42223},"main":"dist/index.js","name":"@emdzej/bimmerz-rpc-core","type":"module","_from":"file:emdzej-bimmerz-rpc-core-0.3.0.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"license":"PolyForm-Noncommercial-1.0.0","scripts":{"dev":"tsc --watch","lint":"eslint .","test":"vitest run","build":"tsc","clean":"rm -rf dist .turbo *.tsbuildinfo","typecheck":"tsc --noEmit"},"version":"0.3.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:32035740-3c4a-4ec5-9ea6-aa22aa6e8a40"}},"homepage":"https://github.com/emdzej/bimmerz-core#readme","_resolved":"/tmp/a6ec4510aa4761017f1086830c309cb5/emdzej-bimmerz-rpc-core-0.3.0.tgz","_integrity":"sha512-sAo+pnhN9yDF84IlVROA4iZDAhv8XatsgR4zyA0QtyZxjm/XBB0fwyd7Qv3u/df1pDxhaICuXIm92tQQp/5skA==","repository":{"url":"git+https://github.com/emdzej/bimmerz-core.git","type":"git","directory":"packages/rpc-core"},"_npmVersion":"12.1.0","description":"JSON-RPC 2.0 over WebSocket client used by the bimmerz-box dongle's /rpc endpoints. Transport-only — protocol-specific clients (UART, CAN, ...) build on top.","directories":{},"maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"_nodeVersion":"22.23.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^5.0.1","typescript":"^5.7.3","@types/node":"^22.13.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bimmerz-rpc-core_0.3.0_1790327303031_0.7574371724777089"}}},"time":{"created":"2026-06-12T09:52:16.536Z","modified":"2026-09-25T09:08:23.416Z","0.1.0":"2026-06-12T09:52:16.926Z","0.3.0":"2026-09-25T09:08:23.111Z"},"bugs":{"url":"https://github.com/emdzej/bimmerz-core/issues"},"homepage":"https://github.com/emdzej/bimmerz-core#readme","repository":{"url":"git+https://github.com/emdzej/bimmerz-core.git","type":"git","directory":"packages/rpc-core"},"description":"JSON-RPC 2.0 over WebSocket client used by the bimmerz-box dongle's /rpc endpoints. Transport-only — protocol-specific clients (UART, CAN, ...) build on top.","maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"readme":"# @emdzej/bimmerz-rpc-core\n\nJSON-RPC 2.0 client over a single WebSocket, used by the bimmerz-box\ndongle's `/rpc/...` endpoints. Transport-only — protocol-specific\nclients (UART, CAN, ...) build on top.\n\n## Install\n\n```sh\npnpm add @emdzej/bimmerz-rpc-core\n```\n\nNode 22+ (WebSocket is a global) or any modern browser. For older Node\nruntimes, install [`ws`](https://www.npmjs.com/package/ws) and pass it\nvia `WebSocketImpl`.\n\n## Use\n\n```ts\nimport { RpcClient } from \"@emdzej/bimmerz-rpc-core\";\n\nconst rpc = new RpcClient(\"ws://172.16.7.1/rpc/uart/0\", {\n  requestTimeoutMs: 5_000,\n  autoReconnect: true,\n});\n\nawait rpc.connect();\n\n// Request → expect one result or one error\nconst result = await rpc.request<{ ok: boolean }>(\"uart.open\", {\n  baud: 9600,\n  parity: \"even\",\n});\n\n// Subscribe to server-sent notifications\nconst off = rpc.on<{ data: string }>(\"uart.rx\", ({ data }) => {\n  // base64 RX bytes — decode with the helpers in this package\n});\n\n// Observe lifecycle\nrpc.onStatusChange((s) => console.log(\"status:\", s));\n\n// Tear down (cancels reconnect)\noff();\nrpc.close();\n```\n\n## Errors\n\nThe promise returned by `request()` rejects with one of:\n\n- `RpcError(code, message, data?)` — server returned a JSON-RPC error\n- `RpcTimeoutError(method, timeoutMs)` — no reply within budget\n- `RpcDisconnectedError` — socket closed before the reply arrived\n\n## Binary payloads\n\nThe dongle wraps binary blobs (UART bytes, CAN data) as base64 strings\ninside the JSON envelope. Use `encodeBase64` / `decodeBase64` exported\nhere, or rely on the typed facades (`@emdzej/bimmerz-rpc-uart`,\n`@emdzej/bimmerz-rpc-can`) which hide the conversion.\n\n## See also\n\n- [bimmerz-box API reference](https://github.com/emdzej/bimmerz-box/blob/main/docs/api.md)\n- `@emdzej/bimmerz-rpc-uart` — typed UART client\n- `@emdzej/bimmerz-rpc-can` — typed CAN client\n","readmeFilename":"README.md","license":"PolyForm-Noncommercial-1.0.0"}