@rotorsoft/act-http 1.11.2 → 1.12.0

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.
Files changed (41) hide show
  1. package/README.md +2 -5
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/@types/api/actor.d.ts +4 -6
  4. package/dist/@types/api/actor.d.ts.map +1 -1
  5. package/dist/@types/api/dispatch.d.ts +46 -1
  6. package/dist/@types/api/dispatch.d.ts.map +1 -1
  7. package/dist/@types/api/sse-wiring.d.ts +2 -2
  8. package/dist/@types/api/sse-wiring.d.ts.map +1 -1
  9. package/dist/@types/hono/index.d.ts +80 -13
  10. package/dist/@types/hono/index.d.ts.map +1 -1
  11. package/dist/@types/openapi/index.d.ts.map +1 -1
  12. package/dist/@types/sse/broadcast.d.ts +4 -2
  13. package/dist/@types/sse/broadcast.d.ts.map +1 -1
  14. package/dist/@types/trpc/index.d.ts +107 -35
  15. package/dist/@types/trpc/index.d.ts.map +1 -1
  16. package/dist/api/index.cjs +1 -3
  17. package/dist/api/index.cjs.map +1 -1
  18. package/dist/api/index.js +1 -1
  19. package/dist/{chunk-QM6YP2XH.js → chunk-QSH2Y3YR.js} +2 -2
  20. package/dist/chunk-QSH2Y3YR.js.map +1 -0
  21. package/dist/{chunk-75DA7NJI.js → chunk-YEDAY2PC.js} +2 -4
  22. package/dist/chunk-YEDAY2PC.js.map +1 -0
  23. package/dist/hono/index.cjs +1 -3
  24. package/dist/hono/index.cjs.map +1 -1
  25. package/dist/hono/index.js +2 -2
  26. package/dist/hono/index.js.map +1 -1
  27. package/dist/openapi/index.cjs +102 -34
  28. package/dist/openapi/index.cjs.map +1 -1
  29. package/dist/openapi/index.js +103 -35
  30. package/dist/openapi/index.js.map +1 -1
  31. package/dist/sse/index.cjs +2 -1
  32. package/dist/sse/index.cjs.map +1 -1
  33. package/dist/sse/index.js +2 -1
  34. package/dist/sse/index.js.map +1 -1
  35. package/dist/trpc/index.cjs +2 -8
  36. package/dist/trpc/index.cjs.map +1 -1
  37. package/dist/trpc/index.js +3 -7
  38. package/dist/trpc/index.js.map +1 -1
  39. package/package.json +2 -2
  40. package/dist/chunk-75DA7NJI.js.map +0 -1
  41. package/dist/chunk-QM6YP2XH.js.map +0 -1
package/README.md CHANGED
@@ -168,10 +168,7 @@ import { trpc } from "@rotorsoft/act-http/trpc";
168
168
  type Ctx = { user: { id: string; name: string }; tenant: string };
169
169
 
170
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
- },
171
+ actor: (ctx) => ({ id: ctx.user.id, name: ctx.user.name }),
175
172
  stream: (action, input, ctx) => `tenant-${ctx.tenant}`,
176
173
  });
177
174
 
@@ -185,7 +182,7 @@ api.get("/openapi.json", (c) =>
185
182
  );
186
183
  ```
187
184
 
188
- Framework errors share one envelope (`{ error, detail?, code? }`) and [one status table](https://rotorsoft.github.io/act-root/docs/guides/auto-generated-api#apierror-envelope--error_map--toapierror). Optimistic concurrency (`expectedVersion`), `Idempotency-Key` handling, SSE subscriptions (`sse: { channel }`), auth composition and deployment recipes are in the [auto-generated API guide](https://rotorsoft.github.io/act-root/docs/guides/auto-generated-api).
185
+ Both are typed from the app: a tRPC client and Hono's `hc<typeof api>` see each action's payload and the snapshots it returns, with no casts. Framework errors share one envelope (`{ error, detail?, code? }`) and [one status table](https://rotorsoft.github.io/act-root/docs/guides/auto-generated-api#apierror-envelope--error_map--toapierror). Optimistic concurrency (`expectedVersion`), `Idempotency-Key` handling, SSE subscriptions (`sse: { channel }`), auth composition and deployment recipes are in the [auto-generated API guide](https://rotorsoft.github.io/act-root/docs/guides/auto-generated-api).
189
186
 
190
187
  ### `sse` — live state broadcast
191
188