@spfn/core 0.2.0-beta.51 → 0.2.0-beta.53
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/config/index.d.ts +72 -0
- package/dist/config/index.js +18 -1
- package/dist/config/index.js.map +1 -1
- package/dist/event/index.d.ts +3 -3
- package/dist/event/index.js +7 -2
- package/dist/event/index.js.map +1 -1
- package/dist/event/sse/client.d.ts +2 -2
- package/dist/event/sse/index.d.ts +4 -4
- package/dist/event/sse/index.js +71 -25
- package/dist/event/sse/index.js.map +1 -1
- package/dist/event/ws/client.d.ts +2 -2
- package/dist/event/ws/index.d.ts +3 -3
- package/dist/middleware/index.d.ts +109 -2
- package/dist/middleware/index.js +244 -2
- package/dist/middleware/index.js.map +1 -1
- package/dist/nextjs/server.d.ts +10 -0
- package/dist/nextjs/server.js +98 -1
- package/dist/nextjs/server.js.map +1 -1
- package/dist/server/index.d.ts +30 -4
- package/dist/server/index.js +392 -28
- package/dist/server/index.js.map +1 -1
- package/dist/{token-manager-CyG7la3p.d.ts → token-manager-C2Ag5-s8.d.ts} +6 -0
- package/dist/{types-Cfj--lfr.d.ts → types-CKsmzaB8.d.ts} +19 -1
- package/dist/{types-C1jMLGwK.d.ts → types-VpVQIsyB.d.ts} +27 -2
- package/package.json +1 -1
|
@@ -59,6 +59,12 @@ interface EventDef<TPayload = void> {
|
|
|
59
59
|
* Called by job registration system
|
|
60
60
|
*/
|
|
61
61
|
_registerJobQueue: (queueName: string, sender: JobQueueSender) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Internal: Drop the cache binding (cache + subscribed flag).
|
|
64
|
+
* Called by the event cache transport on shutdown so a later useCache can
|
|
65
|
+
* rebind a fresh cache in the same process.
|
|
66
|
+
*/
|
|
67
|
+
_resetCache: () => void;
|
|
62
68
|
/**
|
|
63
69
|
* Type inference helper
|
|
64
70
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context } from 'hono';
|
|
2
|
-
import { a as EventDef, E as EventRouterDef, h as SSETokenStore, S as SSETokenManager, I as InferEventNames, b as InferEventPayload } from './token-manager-
|
|
2
|
+
import { a as EventDef, E as EventRouterDef, h as SSETokenStore, S as SSETokenManager, I as InferEventNames, b as InferEventPayload } from './token-manager-C2Ag5-s8.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* WebSocket Types
|
|
@@ -83,6 +83,24 @@ interface WSHandlerConfig {
|
|
|
83
83
|
* @default 30000
|
|
84
84
|
*/
|
|
85
85
|
pingInterval?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Cross-pod event broadcast via the cache (Redis/Valkey) pub/sub.
|
|
88
|
+
*
|
|
89
|
+
* When `true` (default) and a cache is configured (`CACHE_URL`), each event
|
|
90
|
+
* is auto-wired so an `emit` on one pod reaches subscribers on every pod.
|
|
91
|
+
* Without a cache this is a no-op (events stay in-process). Set `false` to
|
|
92
|
+
* force in-process even when a cache is present.
|
|
93
|
+
*
|
|
94
|
+
* @default true
|
|
95
|
+
*/
|
|
96
|
+
multiInstance?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Pub/sub channel prefix for cross-pod broadcast.
|
|
99
|
+
*
|
|
100
|
+
* Defaults to env `SPFN_SSE_CHANNEL_PREFIX`, else `spfn:sse:`. Use distinct
|
|
101
|
+
* prefixes to isolate apps/tenants that share one Redis instance.
|
|
102
|
+
*/
|
|
103
|
+
channelPrefix?: string;
|
|
86
104
|
/**
|
|
87
105
|
* Authentication and authorization configuration
|
|
88
106
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context } from 'hono';
|
|
2
|
-
import { h as SSETokenStore, S as SSETokenManager, E as EventRouterDef, I as InferEventNames, b as InferEventPayload } from './token-manager-
|
|
2
|
+
import { h as SSETokenStore, S as SSETokenManager, E as EventRouterDef, I as InferEventNames, b as InferEventPayload } from './token-manager-C2Ag5-s8.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* SSE Types
|
|
@@ -120,13 +120,38 @@ interface SSEAuthConfig<TRouter extends EventRouterDef<any>> {
|
|
|
120
120
|
interface SSEHandlerConfig {
|
|
121
121
|
/**
|
|
122
122
|
* Keep-alive ping interval in milliseconds
|
|
123
|
-
* @default
|
|
123
|
+
* @default 10000
|
|
124
124
|
*/
|
|
125
125
|
pingInterval?: number;
|
|
126
126
|
/**
|
|
127
127
|
* Custom headers for SSE response
|
|
128
128
|
*/
|
|
129
129
|
headers?: Record<string, string>;
|
|
130
|
+
/**
|
|
131
|
+
* Max outbound frames buffered per connection before a slow consumer is
|
|
132
|
+
* dropped (connection closed). Bounds memory under a fast producer + slow
|
|
133
|
+
* client; the client reconnects rather than receiving corrupted/partial data.
|
|
134
|
+
* @default 1000
|
|
135
|
+
*/
|
|
136
|
+
maxQueue?: number;
|
|
137
|
+
/**
|
|
138
|
+
* Cross-pod event broadcast via the cache (Redis/Valkey) pub/sub.
|
|
139
|
+
*
|
|
140
|
+
* When `true` (default) and a cache is configured (`CACHE_URL`), each event
|
|
141
|
+
* is auto-wired so an `emit` on one pod reaches subscribers on every pod.
|
|
142
|
+
* Without a cache this is a no-op (events stay in-process). Set `false` to
|
|
143
|
+
* force in-process even when a cache is present.
|
|
144
|
+
*
|
|
145
|
+
* @default true
|
|
146
|
+
*/
|
|
147
|
+
multiInstance?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Pub/sub channel prefix for cross-pod broadcast.
|
|
150
|
+
*
|
|
151
|
+
* Defaults to env `SPFN_SSE_CHANNEL_PREFIX`, else `spfn:sse:`. Use distinct
|
|
152
|
+
* prefixes to isolate apps/tenants that share one Redis instance.
|
|
153
|
+
*/
|
|
154
|
+
channelPrefix?: string;
|
|
130
155
|
/**
|
|
131
156
|
* Authentication and authorization configuration
|
|
132
157
|
*/
|