@rotorsoft/act-http 1.11.1 → 1.11.3
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 +2 -5
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/api/actor.d.ts +4 -6
- package/dist/@types/api/actor.d.ts.map +1 -1
- package/dist/@types/api/dispatch.d.ts +46 -1
- package/dist/@types/api/dispatch.d.ts.map +1 -1
- package/dist/@types/api/index.d.ts +3 -3
- package/dist/@types/api/sse-wiring.d.ts +4 -4
- package/dist/@types/api/sse-wiring.d.ts.map +1 -1
- package/dist/@types/hono/index.d.ts +80 -13
- package/dist/@types/hono/index.d.ts.map +1 -1
- package/dist/@types/openapi/index.d.ts.map +1 -1
- package/dist/@types/receiver/extract.d.ts +4 -4
- package/dist/@types/receiver/hono/index.d.ts +1 -1
- package/dist/@types/receiver/verify.d.ts +2 -2
- package/dist/@types/sse/apply-patch.d.ts.map +1 -1
- package/dist/@types/sse/broadcast.d.ts +6 -24
- package/dist/@types/sse/broadcast.d.ts.map +1 -1
- package/dist/@types/sse/state-cache.d.ts +1 -1
- package/dist/@types/sse/types.d.ts +4 -5
- package/dist/@types/sse/types.d.ts.map +1 -1
- package/dist/@types/trpc/index.d.ts +107 -35
- package/dist/@types/trpc/index.d.ts.map +1 -1
- package/dist/@types/webhook/index.d.ts +1 -1
- package/dist/@types/webhook/index.d.ts.map +1 -1
- package/dist/@types/webhook/types.d.ts +1 -1
- package/dist/api/index.cjs +1 -3
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.js +2 -2
- package/dist/{chunk-MKD3SM3N.js → chunk-BOJG4555.js} +1 -1
- package/dist/chunk-BOJG4555.js.map +1 -0
- package/dist/{chunk-EERALS5E.js → chunk-CVCTDLJA.js} +1 -1
- package/dist/chunk-CVCTDLJA.js.map +1 -0
- package/dist/{chunk-G5FNOSDX.js → chunk-ET2PACPO.js} +1 -1
- package/dist/chunk-ET2PACPO.js.map +1 -0
- package/dist/{chunk-TTVMQYNN.js → chunk-OEMQP5ZM.js} +2 -2
- package/dist/chunk-OEMQP5ZM.js.map +1 -0
- package/dist/{chunk-5KZI37IT.js → chunk-QSH2Y3YR.js} +3 -3
- package/dist/chunk-QSH2Y3YR.js.map +1 -0
- package/dist/{chunk-FSN52BXM.js → chunk-YEDAY2PC.js} +3 -5
- package/dist/chunk-YEDAY2PC.js.map +1 -0
- package/dist/hono/index.cjs +1 -3
- package/dist/hono/index.cjs.map +1 -1
- package/dist/hono/index.js +4 -4
- package/dist/hono/index.js.map +1 -1
- package/dist/openapi/index.cjs +103 -35
- package/dist/openapi/index.cjs.map +1 -1
- package/dist/openapi/index.js +104 -36
- package/dist/openapi/index.js.map +1 -1
- package/dist/receiver/express/index.cjs.map +1 -1
- package/dist/receiver/express/index.js +1 -1
- package/dist/receiver/fastify/index.cjs.map +1 -1
- package/dist/receiver/fastify/index.js +1 -1
- package/dist/receiver/hono/index.cjs.map +1 -1
- package/dist/receiver/hono/index.js +2 -2
- package/dist/receiver/index.cjs.map +1 -1
- package/dist/receiver/index.js +3 -3
- package/dist/receiver/index.js.map +1 -1
- package/dist/receiver/trpc/index.cjs.map +1 -1
- package/dist/receiver/trpc/index.js +1 -1
- package/dist/sse/index.cjs +7 -25
- package/dist/sse/index.cjs.map +1 -1
- package/dist/sse/index.js +8 -26
- package/dist/sse/index.js.map +1 -1
- package/dist/trpc/index.cjs +2 -8
- package/dist/trpc/index.cjs.map +1 -1
- package/dist/trpc/index.js +5 -9
- package/dist/trpc/index.js.map +1 -1
- package/dist/webhook/index.cjs.map +1 -1
- package/dist/webhook/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-5KZI37IT.js.map +0 -1
- package/dist/chunk-EERALS5E.js.map +0 -1
- package/dist/chunk-FSN52BXM.js.map +0 -1
- package/dist/chunk-G5FNOSDX.js.map +0 -1
- package/dist/chunk-MKD3SM3N.js.map +0 -1
- package/dist/chunk-TTVMQYNN.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
|
|