@rotorsoft/act-http 1.10.0 → 1.10.2
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/dist/.tsbuildinfo +1 -1
- package/dist/@types/api/sse-wiring.d.ts +15 -8
- package/dist/@types/api/sse-wiring.d.ts.map +1 -1
- package/dist/@types/sse/broadcast.d.ts +19 -1
- package/dist/@types/sse/broadcast.d.ts.map +1 -1
- package/dist/@types/sse/state-cache.d.ts +8 -1
- package/dist/@types/sse/state-cache.d.ts.map +1 -1
- package/dist/@types/sse/types.d.ts +19 -0
- package/dist/@types/sse/types.d.ts.map +1 -1
- package/dist/api/index.cjs +6100 -1729
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.js +3 -2
- package/dist/{chunk-BNEUODIM.js → chunk-EQDDWLTJ.js} +23 -4
- package/dist/chunk-EQDDWLTJ.js.map +1 -0
- package/dist/{chunk-WGFX4G27.js → chunk-IXMRQX4Y.js} +6078 -1726
- package/dist/chunk-IXMRQX4Y.js.map +1 -0
- package/dist/chunk-MKD3SM3N.js +9 -0
- package/dist/chunk-MKD3SM3N.js.map +1 -0
- package/dist/hono/index.cjs +6104 -1736
- package/dist/hono/index.cjs.map +1 -1
- package/dist/hono/index.js +6 -8
- package/dist/hono/index.js.map +1 -1
- package/dist/openapi/index.cjs +6106 -1754
- package/dist/openapi/index.cjs.map +1 -1
- package/dist/openapi/index.js +1 -1
- package/dist/sse/index.cjs +63 -20
- package/dist/sse/index.cjs.map +1 -1
- package/dist/sse/index.js +63 -20
- package/dist/sse/index.js.map +1 -1
- package/dist/trpc/index.cjs +6100 -1729
- package/dist/trpc/index.cjs.map +1 -1
- package/dist/trpc/index.js +3 -2
- package/dist/trpc/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/chunk-BNEUODIM.js.map +0 -1
- package/dist/chunk-WGFX4G27.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/sse/types.ts"],"sourcesContent":["import type { DeepPartial } from \"@rotorsoft/act-patch\";\n\n/**\n * Base constraint for state objects managed by the broadcast system.\n * Apps extend this with their own domain state shape.\n */\nexport type BroadcastState = Record<string, unknown> & {\n /** Event store stream version — set by the broadcast layer from snap.event.version */\n _v: number;\n};\n\n/**\n * SSE message: version-keyed domain patches.\n * Keys are stringified version numbers, values are domain patches (deep partials).\n * Multi-event commits produce multiple version-keyed entries.\n *\n * The optional `_overlay` marker flags a version-neutral update (presence,\n * computed-field refresh) emitted by {@link BroadcastChannel.overlay} — a\n * single entry keyed at the *current* version. It tells `applyPatchMessage`\n * to merge the entry on top of the client's caught-up state instead of\n * rejecting it as stale (a same-version patch WITHOUT the marker stays\n * stale). Ordinary version-bumping patches from `publish()` omit it.\n *\n * `_resync` carries no versions at all. The server emits it when it cannot\n * construct a patch — today, when `overlay()` finds the stream's baseline\n * evicted from the LRU. A client that receives one always reports `behind`\n * and refetches. Without it the server had nothing to say in that case, so\n * live subscribers silently stopped receiving presence updates and had no\n * way to notice (#1423).\n */\nexport type PatchMessage<S extends BroadcastState = BroadcastState> = Record<\n number,\n DeepPartial<S>\n> & { readonly _overlay?: true; readonly _resync?: true };\n\n/**\n * Subscriber callback — receives version-keyed patch messages.\n */\nexport type Subscriber<S extends BroadcastState = BroadcastState> = (\n msg: PatchMessage<S>\n) => void;\n\n/**\n * The frame that tells a client to refetch: no versions, so\n * `applyPatchMessage` always reports `behind`.\n *\n * Every producer of a resync uses this — `overlay()` on a missing baseline,\n * the cache on evicting overlay state, and the SSE backlog when it cannot\n * drop a frame without losing it silently. One factory so the shape cannot\n * drift between them.\n */\nexport const resync_frame = <S extends BroadcastState>(): PatchMessage<S> =>\n ({ _resync: true }) as PatchMessage<S>;\n\n/**\n * Whether a frame carries no versions, so `applyPatchMessage` can never\n * classify it as a gap.\n *\n * A version-keyed patch that goes missing is self-announcing: the next frame\n * skips a version and the client refetches. An `_overlay` or `_resync` frame\n * is not, which is why anything that drops frames has to tell them apart.\n */\nexport const is_version_neutral = <S extends BroadcastState>(\n msg: PatchMessage<S>\n): boolean => msg._overlay === true || msg._resync === true;\n"],"mappings":";AAmDO,IAAM,eAAe,OACzB,EAAE,SAAS,KAAK;AAUZ,IAAM,qBAAqB,CAChC,QACY,IAAI,aAAa,QAAQ,IAAI,YAAY;","names":[]}
|