@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.
Files changed (60) hide show
  1. package/README.md +11 -6
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/@types/api/dispatch.d.ts +44 -0
  4. package/dist/@types/api/dispatch.d.ts.map +1 -0
  5. package/dist/@types/api/sse-wiring.d.ts +1 -1
  6. package/dist/@types/hono/index.d.ts +2 -20
  7. package/dist/@types/hono/index.d.ts.map +1 -1
  8. package/dist/@types/openapi/index.d.ts +2 -19
  9. package/dist/@types/openapi/index.d.ts.map +1 -1
  10. package/dist/@types/receiver/express/index.d.ts.map +1 -1
  11. package/dist/@types/receiver/fastify/index.d.ts.map +1 -1
  12. package/dist/@types/receiver/finalize.d.ts +15 -2
  13. package/dist/@types/receiver/finalize.d.ts.map +1 -1
  14. package/dist/@types/receiver/hono/index.d.ts.map +1 -1
  15. package/dist/@types/receiver/index.d.ts +8 -4
  16. package/dist/@types/receiver/index.d.ts.map +1 -1
  17. package/dist/@types/receiver/trpc/index.d.ts.map +1 -1
  18. package/dist/@types/trpc/index.d.ts +19 -91
  19. package/dist/@types/trpc/index.d.ts.map +1 -1
  20. package/dist/api/index.cjs.map +1 -1
  21. package/dist/api/index.js +1 -1
  22. package/dist/{chunk-DMDU25DN.js → chunk-G5FNOSDX.js} +5 -3
  23. package/dist/{chunk-DMDU25DN.js.map → chunk-G5FNOSDX.js.map} +1 -1
  24. package/dist/chunk-H545LMMV.js +28 -0
  25. package/dist/chunk-H545LMMV.js.map +1 -0
  26. package/dist/{chunk-KC2NW7XQ.js → chunk-TTVMQYNN.js} +8 -17
  27. package/dist/chunk-TTVMQYNN.js.map +1 -0
  28. package/dist/{chunk-BGXQRSSQ.js → chunk-ZQGGGU4E.js} +1 -1
  29. package/dist/chunk-ZQGGGU4E.js.map +1 -0
  30. package/dist/hono/index.cjs +72 -64
  31. package/dist/hono/index.cjs.map +1 -1
  32. package/dist/hono/index.js +44 -53
  33. package/dist/hono/index.js.map +1 -1
  34. package/dist/openapi/index.cjs.map +1 -1
  35. package/dist/openapi/index.js.map +1 -1
  36. package/dist/receiver/express/index.cjs +4 -12
  37. package/dist/receiver/express/index.cjs.map +1 -1
  38. package/dist/receiver/express/index.js +3 -13
  39. package/dist/receiver/express/index.js.map +1 -1
  40. package/dist/receiver/fastify/index.cjs +4 -12
  41. package/dist/receiver/fastify/index.cjs.map +1 -1
  42. package/dist/receiver/fastify/index.js +3 -13
  43. package/dist/receiver/fastify/index.js.map +1 -1
  44. package/dist/receiver/hono/index.cjs +8 -15
  45. package/dist/receiver/hono/index.cjs.map +1 -1
  46. package/dist/receiver/hono/index.js +2 -2
  47. package/dist/receiver/index.cjs +8 -15
  48. package/dist/receiver/index.cjs.map +1 -1
  49. package/dist/receiver/index.js +2 -2
  50. package/dist/receiver/trpc/index.cjs +8 -15
  51. package/dist/receiver/trpc/index.cjs.map +1 -1
  52. package/dist/receiver/trpc/index.js +7 -16
  53. package/dist/receiver/trpc/index.js.map +1 -1
  54. package/dist/trpc/index.cjs +54 -55
  55. package/dist/trpc/index.cjs.map +1 -1
  56. package/dist/trpc/index.js +26 -44
  57. package/dist/trpc/index.js.map +1 -1
  58. package/package.json +4 -4
  59. package/dist/chunk-BGXQRSSQ.js.map +0 -1
  60. 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.** This package consolidates the SSE integration that previously shipped as standalone `@rotorsoft/act-sse`. New projects should install this umbrella and import from the `/sse` subpath; existing `@rotorsoft/act-sse` users can migrate with a one-import change. See [@rotorsoft/act-sse](https://www.npmjs.com/package/@rotorsoft/act-sse) for the deprecation note + migration steps.
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
- 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
 
@@ -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: `ValidationError` → 422, `InvariantError` → 409, `ConcurrencyError` → 412, `StreamClosedError` → 410, `NonRetryableError` → 400, anything else → 500. tRPC has no 410, so `StreamClosedError` is `NOT_FOUND` there. 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).
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. The `sse` subpath hosts the surface formerly published as `@rotorsoft/act-sse`, now deprecated. Charter is **in effect as of 1.0.0**; the milestone tracker is [milestone 1.0](https://github.com/Rotorsoft/act-root/milestone/1).
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. Being deprecated; migrate to `@rotorsoft/act-http/sse`.
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