{"_id":"@dogsvr/cl-tsrpc","_rev":"6-3e4e2dc2d5194136c6a383caf5a3cc51","name":"@dogsvr/cl-tsrpc","dist-tags":{"latest":"0.4.2"},"versions":{"0.0.1":{"name":"@dogsvr/cl-tsrpc","version":"0.0.1","author":{"name":"rowanzhu"},"license":"MIT","_id":"@dogsvr/cl-tsrpc@0.0.1","maintainers":[{"name":"rowanzhu","email":"rowanzhu@gmail.com"}],"homepage":"https://github.com/dogsvr/cl-tsrpc#readme","bugs":{"url":"https://github.com/dogsvr/cl-tsrpc/issues"},"dist":{"shasum":"ace239e424f346ed6b24ed0e820af931e09dece1","tarball":"https://registry.npmjs.org/@dogsvr/cl-tsrpc/-/cl-tsrpc-0.0.1.tgz","fileCount":10,"integrity":"sha512-zA+4NaZ34wvhz/yQu4AmybrtRndDg8YWMM7rByvz8F1QWHd8VPqTzu1pKn159HP2dX8ls3jPOS3VHnh8v58oUg==","signatures":[{"sig":"MEQCIBH4rh1yzdpzi6d77Or+ZH9pe0hjQEKcIJQNwLGmu7KVAiA/8Om8b+wcNB+91o27KJhTHJXaoJieKLcMyWJes55lNg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6360},"main":"index.js","types":"./index.d.ts","gitHead":"744ea3dcc46001e071bc46516db33c27bea726e8","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rm -rf dist && mkdir dist && cp package.json README.md dist && npx tsc","tsrpcproto":"npx tsrpc proto"},"_npmUser":{"name":"rowanzhu","email":"rowanzhu@gmail.com"},"repository":{"url":"git+https://github.com/dogsvr/cl-tsrpc.git","type":"git"},"_npmVersion":"8.11.0","description":"","directories":{},"_nodeVersion":"16.15.1","dependencies":{"tsrpc":"^3.4.17"},"_hasShrinkwrap":false,"devDependencies":{"tsrpc-cli":"^2.4.5","typescript":"^5.6.3","@dogsvr/dogsvr":"latest"},"_npmOperationalInternal":{"tmp":"tmp/cl-tsrpc_0.0.1_1731832613306_0.6244815281005218","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@dogsvr/cl-tsrpc","version":"0.0.2","author":{"name":"rowanzhu"},"license":"MIT","_id":"@dogsvr/cl-tsrpc@0.0.2","maintainers":[{"name":"rowanzhu","email":"rowanzhu@gmail.com"}],"homepage":"https://github.com/dogsvr/cl-tsrpc#readme","bugs":{"url":"https://github.com/dogsvr/cl-tsrpc/issues"},"dist":{"shasum":"c061964e3c3da002843b4091b91c8a21d65603e6","tarball":"https://registry.npmjs.org/@dogsvr/cl-tsrpc/-/cl-tsrpc-0.0.2.tgz","fileCount":14,"integrity":"sha512-Gms07tbT6SJiHAj4Zm3Ndmj1oASderv+ynQiZbYNGSelJy4PbW9027LtHClE8i/qNt207R1F6XPRzpjWF1F6+w==","signatures":[{"sig":"MEUCIBm/1yFueW4KrZCBWreZQEUAL971dCB0dEqsrF5eUXqCAiEAvI4UprvmYbjdEXPu1HXKkJk3KRIHDRYsARV2byN0N5s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10814},"main":"index.js","types":"./index.d.ts","gitHead":"7faad73bc0173ec094ccae7d5bf07940e39a7873","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rm -rf dist && mkdir dist && cp package.json README.md dist && npx tsc","protoc":"npx tsrpc proto"},"_npmUser":{"name":"rowanzhu","email":"rowanzhu@gmail.com"},"repository":{"url":"git+https://github.com/dogsvr/cl-tsrpc.git","type":"git"},"_npmVersion":"8.11.0","description":"","directories":{},"_nodeVersion":"16.15.1","dependencies":{"tsrpc":"^3.4.17"},"_hasShrinkwrap":false,"devDependencies":{"tsrpc-cli":"^2.4.5","typescript":"^5.6.3","@dogsvr/dogsvr":"latest"},"_npmOperationalInternal":{"tmp":"tmp/cl-tsrpc_0.0.2_1733651413906_0.3705416266957684","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@dogsvr/cl-tsrpc","version":"0.0.4","author":{"name":"rowanzhu"},"license":"MIT","_id":"@dogsvr/cl-tsrpc@0.0.4","maintainers":[{"name":"rowanzhu","email":"rowanzhu@gmail.com"}],"homepage":"https://github.com/dogsvr/cl-tsrpc#readme","bugs":{"url":"https://github.com/dogsvr/cl-tsrpc/issues"},"dist":{"shasum":"d193b6134794e5d5b043542cc171056be31f8594","tarball":"https://registry.npmjs.org/@dogsvr/cl-tsrpc/-/cl-tsrpc-0.0.4.tgz","fileCount":14,"integrity":"sha512-CdKk77dJECMv1T/V1F+mRGFGf7QjcwNMLsCCqA9FS4n0C25ImzVk3Nr+NHLOHx5zm/SRNCusYdcbjtzjsH1+XA==","signatures":[{"sig":"MEQCIFENz3oj9zqNrIAbAKY1rjWezwmZCdBk/SRypdxK64M0AiB+n0tccf2B/rGx7flMsYrGQzfYyHonUs1aQo2iEi3lHg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10861},"main":"index.js","types":"./index.d.ts","gitHead":"e24e71c8020be4cf7acfc15b9c01072771aaf1f8","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rm -rf dist && mkdir dist && cp package.json README.md dist && npx tsc","protoc":"npx tsrpc proto"},"_npmUser":{"name":"rowanzhu","email":"rowanzhu@gmail.com"},"repository":{"url":"git+https://github.com/dogsvr/cl-tsrpc.git","type":"git"},"_npmVersion":"8.11.0","description":"","directories":{},"_nodeVersion":"16.15.1","dependencies":{"tsrpc":"^3.4.17"},"_hasShrinkwrap":false,"devDependencies":{"tsrpc-cli":"^2.4.5","typescript":"^5.6.3","@dogsvr/dogsvr":"latest"},"_npmOperationalInternal":{"tmp":"tmp/cl-tsrpc_0.0.4_1734798670853_0.9573764145119861","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@dogsvr/cl-tsrpc","version":"0.4.0","keywords":["dogsvr","tsrpc","websocket","connection-layer"],"author":{"name":"rowanzhu"},"license":"MIT","_id":"@dogsvr/cl-tsrpc@0.4.0","maintainers":[{"name":"rowanzhu","email":"rowanzhu@gmail.com"}],"homepage":"https://github.com/dogsvr/cl-tsrpc#readme","bugs":{"url":"https://github.com/dogsvr/cl-tsrpc/issues"},"dist":{"shasum":"cd782e9847f02e274b1ac5a08142cf05ab3da357","tarball":"https://registry.npmjs.org/@dogsvr/cl-tsrpc/-/cl-tsrpc-0.4.0.tgz","fileCount":15,"integrity":"sha512-iMJ4SCQq/5mI4bW33T2JRebqtlsbiGY5hdW6mfIcejU5bWhCjnFSPCbFBrdHoO+CunOrzmzdhNoWDCKpRCL3Xg==","signatures":[{"sig":"MEYCIQDD0u8izd/mQliQJOb/DIQu8YVi34VuFtOd/eiGpx+sMgIhAKujUKaRX3g6ldSUkhOqPXgsOnV8riOUgF43EVKxDKck","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17382},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"6be2713c8678d280f6e9412f842c699ba59cbbde","scripts":{"build":"rm -rf dist && tsc","protoc":"npx tsrpc proto"},"_npmUser":{"name":"rowanzhu","email":"rowanzhu@gmail.com"},"repository":{"url":"git+https://github.com/dogsvr/cl-tsrpc.git","type":"git"},"_npmVersion":"11.6.2","description":"TSRPC (WebSocket/HTTP) connection layer for @dogsvr/dogsvr.","directories":{},"_nodeVersion":"24.13.0","dependencies":{"tsrpc":"^3.4.21"},"_hasShrinkwrap":false,"devDependencies":{"tsrpc-cli":"^2.4.5","typescript":"^6.0.3","@types/node":"^24.12.2","@dogsvr/dogsvr":"^0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/cl-tsrpc_0.4.0_1777810719564_0.7638929949185911","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@dogsvr/cl-tsrpc","version":"0.4.1","keywords":["dogsvr","tsrpc","websocket","connection-layer"],"author":{"name":"rowanzhu"},"license":"MIT","_id":"@dogsvr/cl-tsrpc@0.4.1","maintainers":[{"name":"rowanzhu","email":"rowanzhu@gmail.com"}],"homepage":"https://github.com/dogsvr/cl-tsrpc#readme","bugs":{"url":"https://github.com/dogsvr/cl-tsrpc/issues"},"dist":{"shasum":"656cd782bb02ebf7779e3a5e27f43177369dea6d","tarball":"https://registry.npmjs.org/@dogsvr/cl-tsrpc/-/cl-tsrpc-0.4.1.tgz","fileCount":15,"integrity":"sha512-dfEJCroohM4M3nVWcB4AopaEr3vDpoNM7f9JG5SCZVsn3yqlGauOA8o5cadx6sjZQRIkyt+MEGLmNiMWBgryyg==","signatures":[{"sig":"MEQCIASXppj8b5VEbAdA7YqKSnuYVQS9IRScNbg7ytQoN3O2AiBN8u+Qx2GTb1n/KP+K93tjw56fp8/IE8qtj/BrTRtZSQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17510},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./protocols/*":{"types":"./dist/shared/protocols/*.d.ts","default":"./dist/shared/protocols/*.js"},"./package.json":"./package.json"},"gitHead":"96c6e777454a567822f7d91facb0d2fb5169fe7c","scripts":{"build":"rm -rf dist && tsc","protoc":"npx tsrpc proto"},"_npmUser":{"name":"rowanzhu","email":"rowanzhu@gmail.com"},"repository":{"url":"git+https://github.com/dogsvr/cl-tsrpc.git","type":"git"},"_npmVersion":"11.6.2","description":"TSRPC (WebSocket/HTTP) connection layer for @dogsvr/dogsvr.","directories":{},"_nodeVersion":"24.13.0","dependencies":{"tsrpc":"^3.4.21"},"_hasShrinkwrap":false,"devDependencies":{"tsrpc-cli":"^2.4.5","typescript":"^6.0.3","@types/node":"^24.12.2","@dogsvr/dogsvr":"^0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/cl-tsrpc_0.4.1_1777872758378_0.004685579526335859","host":"s3://npm-registry-packages-npm-production"}},"0.4.2":{"name":"@dogsvr/cl-tsrpc","version":"0.4.2","description":"TSRPC (WebSocket/HTTP) connection layer for @dogsvr/dogsvr.","keywords":["dogsvr","tsrpc","websocket","connection-layer"],"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./protocols/*":{"types":"./dist/shared/protocols/*.d.ts","default":"./dist/shared/protocols/*.js"},"./package.json":"./package.json"},"scripts":{"protoc":"npx tsrpc proto","build":"rm -rf dist && tsc"},"repository":{"type":"git","url":"git+https://github.com/dogsvr/cl-tsrpc.git"},"author":{"name":"rowanzhu"},"license":"MIT","bugs":{"url":"https://github.com/dogsvr/cl-tsrpc/issues"},"homepage":"https://github.com/dogsvr/cl-tsrpc#readme","dependencies":{"tsrpc":"^3.4.21"},"peerDependencies":{"@dogsvr/dogsvr":"^0.4.0"},"devDependencies":{"@dogsvr/dogsvr":"^0.4.0","@types/node":"^24.12.2","tsrpc-cli":"^2.4.5","typescript":"^6.0.3"},"gitHead":"8051770874298cea4b21c888e1ceefa9212fc3ea","_id":"@dogsvr/cl-tsrpc@0.4.2","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-skAqs3ewbt3OnDLOEz7R2ozAOCcSWgO8OaVwu8ggxhI5FdZqJSjP5aHKXtPHIWVWYK60ULmtHByDbLBfYh4EkA==","shasum":"a5e50a5d06794d12f3d7afc4d882e2b4224e2c8e","tarball":"https://registry.npmjs.org/@dogsvr/cl-tsrpc/-/cl-tsrpc-0.4.2.tgz","fileCount":15,"unpackedSize":20829,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD2vRXtfAGVCvqtgjer2NkKJYadszZ89w7gsin2l3r5xgIhAKPWfdP53cbKyOmFgYOdDXYmadQpXscxk5sYJ4nqSm9I"}]},"_npmUser":{"name":"rowanzhu","email":"rowanzhu@gmail.com"},"directories":{},"maintainers":[{"name":"rowanzhu","email":"rowanzhu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cl-tsrpc_0.4.2_1785065890320_0.7545131875616291"},"_hasShrinkwrap":false}},"time":{"created":"2024-11-17T08:36:53.186Z","modified":"2026-07-26T11:38:10.752Z","0.0.1":"2024-11-17T08:36:53.497Z","0.0.2":"2024-12-08T09:50:14.111Z","0.0.4":"2024-12-21T16:31:11.062Z","0.4.0":"2026-05-03T12:18:39.711Z","0.4.1":"2026-05-04T05:32:38.544Z","0.4.2":"2026-07-26T11:38:10.485Z"},"bugs":{"url":"https://github.com/dogsvr/cl-tsrpc/issues"},"author":{"name":"rowanzhu"},"license":"MIT","homepage":"https://github.com/dogsvr/cl-tsrpc#readme","keywords":["dogsvr","tsrpc","websocket","connection-layer"],"repository":{"type":"git","url":"git+https://github.com/dogsvr/cl-tsrpc.git"},"description":"TSRPC (WebSocket/HTTP) connection layer for @dogsvr/dogsvr.","maintainers":[{"name":"rowanzhu","email":"rowanzhu@gmail.com"}],"readme":"# @dogsvr/cl-tsrpc\n\nTSRPC connection layer for [`@dogsvr/dogsvr`](https://github.com/dogsvr/dogsvr) — inbound WebSocket and HTTP transport, with per-connection auth and identity binding (`openId` / `zoneId` / `gid`).\n\n## Install\n\n```sh\nnpm install @dogsvr/cl-tsrpc\n```\n\n**Node.js**: tested on **v24.13.0 on Linux (x86-64)**; other maintained LTS lines are expected to work but are not routinely exercised. File an issue if something breaks on your runtime.\n\n## Usage\n\nImporting the package in the main thread self-registers a `\"tsrpc\"` CL factory with `@dogsvr/dogsvr`:\n\n```ts\nimport * as dogsvr from '@dogsvr/dogsvr/main_thread';\nimport '@dogsvr/cl-tsrpc';\ndogsvr.startServer(__dirname + '/main_thread_config.json');\n```\n\nAdd a CL entry to `main_thread_config.json`:\n\n```jsonc\n{\n    \"cl\": {\n        \"tsrpc\": { \"type\": \"tsrpc\", \"svrType\": \"ws\",   \"port\": 20000 }\n        // or:    { \"type\": \"tsrpc\", \"svrType\": \"http\", \"port\": 10000 }\n    }\n}\n```\n\nThe layer hooks `ApiCommon` on each incoming call: the first request must carry `openId` + `zoneId`; once authenticated, the identity is bound to the connection. `gid` is populated from the first worker response and auto-filled on subsequent messages.\n\n### Logging\n\ntsrpc's internal logs (connection accept/disconnect, `[ApiReq]`/`[ApiRes]`/`[SendMsg]`/`[RecvMsg]`, etc.) are routed through dogsvr's logger as `module: \"tsrpc\"`.\n\n**Default level: `warn`.** This is intentional: tsrpc emits per-RPC bodies at `info` (request and response payloads). Defaulting to `warn` keeps prod logs clean and avoids accidentally logging request bodies (PII / auth tokens). Override per-CL when you need protocol detail:\n\n```jsonc\n\"cl\": {\n    \"tsrpc\": { \"type\": \"tsrpc\", \"svrType\": \"ws\", \"port\": 20000, \"log\": { \"level\": \"debug\" } }\n}\n```\n\nAccepts tsrpc-proto's `LogLevel`: **`\"debug\"` | `\"info\"` | `\"warn\"` | `\"error\"` | `\"none\"`** — all lower-case, no other spellings accepted. Values pass straight to the `tsrpc` server's `logLevel`. **Case-sensitive**: any other spelling (e.g. `\"WARN\"`, `\"Warn\"`) makes tsrpc throw `Invalid logLevel: '...'` at construction.\n\n### Regenerating TSRPC protos\n\nThis package owns the TSRPC proto used internally:\n\n```sh\nnpm run protoc      # tsrpc-cli\n```\n\n## Role in dogsvr\n\nOne of several pluggable **connection layers** that plug into the dogsvr main thread. See the [dogsvr README](https://github.com/dogsvr/dogsvr) for how CL factories are registered and how worker threads consume the routed messages.\n\n## See also\n\n- [`example-proj`](https://github.com/dogsvr/example-proj) — three-server reference that uses this CL on `dir` (HTTP) and `zonesvr` (WS)\n- [`@dogsvr/cl-grpc`](https://github.com/dogsvr/cl-grpc) — gRPC CL for server-to-server calls\n","readmeFilename":"README.md"}