@rotorsoft/act-http 1.10.22 → 1.10.24

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.
package/README.md CHANGED
@@ -165,8 +165,13 @@ import { hono } from "@rotorsoft/act-http/hono";
165
165
  import { openapi } from "@rotorsoft/act-http/openapi";
166
166
  import { trpc } from "@rotorsoft/act-http/trpc";
167
167
 
168
- const router = trpc(app, {
169
- actor: (ctx) => ({ id: ctx.user.id, name: ctx.user.name }),
168
+ type Ctx = { user: { id: string; name: string }; tenant: string };
169
+
170
+ const router = trpc<Ctx, typeof app>(app, {
171
+ actor: (ctx) => {
172
+ const { user } = ctx as Ctx; // the extractor receives `unknown`
173
+ return { id: user.id, name: user.name };
174
+ },
170
175
  stream: (action, input, ctx) => `tenant-${ctx.tenant}`,
171
176
  });
172
177