NapCatQQ/packages/napcat-test
手瓜一十雪 3bead89d46 Support object references and deep proxying
Introduce remote object references (refId) and deep proxy support across client, server, serializer and types. Key changes:

- Add refId propagation in client proxies so child proxies inherit and include refId on RPC requests.
- Extend serializer to handle a new SerializedValueType.OBJECT_REF, add refResolver and pass refId to proxyCreator.
- Server: store object references in a Map with generated ref IDs, resolve paths with optional refId, serialize results to OBJECT_REF when shouldProxyResult returns true, and release cleans up references. Add defaultShouldProxyResult heuristic to decide which return values should remain proxied (class instances and objects with methods).
- Types: add refId fields and ObjectRef shape, expose shouldProxyResult option on RpcServerOptions, and include refId in ProxyMeta and serialized values.
- Tests updated across the suite to expect proxied return values (arrays/objects/class instances) and to await property access or method calls; add comprehensive tests for deep return value proxying, chained calls, callbacks, constructors on returned proxies, and lifecycle of remote object proxies.

These changes enable returning live/proxied remote objects (including class instances and objects with methods) from RPC calls, preserving remote behavior and allowing subsequent operations to target the same server-side object.
2026-02-02 18:43:37 +08:00
..
imageSize.test.ts Add TIFF parser and buffer-based image size APIs 2026-02-01 17:42:58 +08:00
package.json Add napcat-rpc package with deep RPC 2026-02-02 17:12:05 +08:00
Readme.md Add napcat-test package and Vitest setup 2025-11-15 16:05:09 +08:00
rpc.test.ts Support object references and deep proxying 2026-02-02 18:43:37 +08:00
sha1Stream.test.ts Add ESLint config and update code style 2025-11-15 16:21:59 +08:00
tsconfig.json Add napcat-test package and Vitest setup 2025-11-15 16:05:09 +08:00
vitest.config.ts Add napcat-rpc package with deep RPC 2026-02-02 17:12:05 +08:00

NapCat-Test

测试方向

测试过程不涉及账号登录