@rotorsoft/act-http 1.10.21 → 1.10.23
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 +11 -6
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/api/dispatch.d.ts +44 -0
- package/dist/@types/api/dispatch.d.ts.map +1 -0
- package/dist/@types/api/sse-wiring.d.ts +1 -1
- package/dist/@types/hono/index.d.ts +2 -20
- package/dist/@types/hono/index.d.ts.map +1 -1
- package/dist/@types/openapi/index.d.ts +2 -19
- package/dist/@types/openapi/index.d.ts.map +1 -1
- package/dist/@types/receiver/express/index.d.ts.map +1 -1
- package/dist/@types/receiver/fastify/index.d.ts.map +1 -1
- package/dist/@types/receiver/finalize.d.ts +15 -2
- package/dist/@types/receiver/finalize.d.ts.map +1 -1
- package/dist/@types/receiver/hono/index.d.ts.map +1 -1
- package/dist/@types/receiver/index.d.ts +8 -4
- package/dist/@types/receiver/index.d.ts.map +1 -1
- package/dist/@types/receiver/trpc/index.d.ts.map +1 -1
- package/dist/@types/trpc/index.d.ts +19 -91
- package/dist/@types/trpc/index.d.ts.map +1 -1
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.js +1 -1
- package/dist/{chunk-DMDU25DN.js → chunk-G5FNOSDX.js} +5 -3
- package/dist/{chunk-DMDU25DN.js.map → chunk-G5FNOSDX.js.map} +1 -1
- package/dist/chunk-H545LMMV.js +28 -0
- package/dist/chunk-H545LMMV.js.map +1 -0
- package/dist/{chunk-KC2NW7XQ.js → chunk-TTVMQYNN.js} +8 -17
- package/dist/chunk-TTVMQYNN.js.map +1 -0
- package/dist/{chunk-BGXQRSSQ.js → chunk-ZQGGGU4E.js} +1 -1
- package/dist/chunk-ZQGGGU4E.js.map +1 -0
- package/dist/hono/index.cjs +72 -64
- package/dist/hono/index.cjs.map +1 -1
- package/dist/hono/index.js +44 -53
- package/dist/hono/index.js.map +1 -1
- package/dist/openapi/index.cjs.map +1 -1
- package/dist/openapi/index.js.map +1 -1
- package/dist/receiver/express/index.cjs +4 -12
- package/dist/receiver/express/index.cjs.map +1 -1
- package/dist/receiver/express/index.js +3 -13
- package/dist/receiver/express/index.js.map +1 -1
- package/dist/receiver/fastify/index.cjs +4 -12
- package/dist/receiver/fastify/index.cjs.map +1 -1
- package/dist/receiver/fastify/index.js +3 -13
- package/dist/receiver/fastify/index.js.map +1 -1
- package/dist/receiver/hono/index.cjs +8 -15
- package/dist/receiver/hono/index.cjs.map +1 -1
- package/dist/receiver/hono/index.js +2 -2
- package/dist/receiver/index.cjs +8 -15
- package/dist/receiver/index.cjs.map +1 -1
- package/dist/receiver/index.js +2 -2
- package/dist/receiver/trpc/index.cjs +8 -15
- package/dist/receiver/trpc/index.cjs.map +1 -1
- package/dist/receiver/trpc/index.js +7 -16
- package/dist/receiver/trpc/index.js.map +1 -1
- package/dist/trpc/index.cjs +54 -55
- package/dist/trpc/index.cjs.map +1 -1
- package/dist/trpc/index.js +26 -44
- package/dist/trpc/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-BGXQRSSQ.js.map +0 -1
- package/dist/chunk-KC2NW7XQ.js.map +0 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
_HTTP integrations for [@rotorsoft/act](https://www.npmjs.com/package/@rotorsoft/act) — outbound webhooks and incremental state broadcast over Server-Sent Events._
|
|
8
8
|
|
|
9
|
-
> **Note.**
|
|
9
|
+
> **Note.** The `/sse` subpath is the home of the surface once published as `@rotorsoft/act-sse`. That package's status is in the [deprecation policy](../../STABILITY.md#deprecation-policy).
|
|
10
10
|
|
|
11
11
|
## Why this package
|
|
12
12
|
|
|
@@ -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
|
-
|
|
169
|
-
|
|
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
|
|
|
@@ -180,7 +185,7 @@ api.get("/openapi.json", (c) =>
|
|
|
180
185
|
);
|
|
181
186
|
```
|
|
182
187
|
|
|
183
|
-
Framework errors share one envelope (`{ error, detail?, code? }`) and one status table
|
|
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).
|
|
184
189
|
|
|
185
190
|
### `sse` — live state broadcast
|
|
186
191
|
|
|
@@ -348,12 +353,12 @@ For the recommended receiver-side idempotency contract that pairs with `webhook`
|
|
|
348
353
|
|
|
349
354
|
## Stability
|
|
350
355
|
|
|
351
|
-
Public API governed by the [Act Stability Charter](../../STABILITY.md). Both subpaths (`@rotorsoft/act-http/webhook` and `@rotorsoft/act-http/sse`) are covered by the charter.
|
|
356
|
+
Public API governed by the [Act Stability Charter](../../STABILITY.md). Both subpaths (`@rotorsoft/act-http/webhook` and `@rotorsoft/act-http/sse`) are covered by the charter. Charter is **in effect as of 1.0.0**; the milestone tracker is [milestone 1.0](https://github.com/Rotorsoft/act-root/milestone/1).
|
|
352
357
|
|
|
353
358
|
## Related packages
|
|
354
359
|
|
|
355
360
|
- **[@rotorsoft/act](https://www.npmjs.com/package/@rotorsoft/act)** — core framework. `webhook` composes with `.do(handler, { backoff })`; `BroadcastChannel` publishes from `app.do()` snapshots.
|
|
356
|
-
- **[@rotorsoft/act-sse](https://www.npmjs.com/package/@rotorsoft/act-sse)** — predecessor of the `/sse` subpath here
|
|
361
|
+
- **[@rotorsoft/act-sse](https://www.npmjs.com/package/@rotorsoft/act-sse)** — predecessor of the `/sse` subpath here; its status is in the [deprecation policy](../../STABILITY.md#deprecation-policy).
|
|
357
362
|
- **[@rotorsoft/act-patch](https://www.npmjs.com/package/@rotorsoft/act-patch)** — the immutable patch utility that powers the SSE state merge.
|
|
358
363
|
- **[@rotorsoft/act-pg](https://www.npmjs.com/package/@rotorsoft/act-pg)** / **[@rotorsoft/act-sqlite](https://www.npmjs.com/package/@rotorsoft/act-sqlite)** — store adapters. `webhook` reactions persist their watermarks through whichever store you've wired.
|
|
359
364
|
|