@rdlabo/workers-hono-kit 0.7.0 → 0.7.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.
@@ -0,0 +1,6 @@
1
+ export { acknowledgeHibernationWebSocketClose, broadcastHibernationWebSockets, closeHibernationWebSocket, configureHibernationAutoResponse, upgradeHibernationWebSocket, } from './hibernation.js';
2
+ export type { HibernationAutoResponseOptions, HibernationUpgradeOptions, HibernationWebSocketLike, HibernationWebSocketStateLike, WebSocketAutoResponsePairFactory, WebSocketPairFactory, } from './hibernation.js';
3
+ export { createLegacySseBridge } from './legacy-sse.js';
4
+ export type { LegacySseBridgeOptions, RealtimeDurableObjectNamespaceLike } from './legacy-sse.js';
5
+ export { isRetryableDurableObjectError, retryDurableObjectOperation } from './retry.js';
6
+ export type { DurableObjectErrorLike, DurableObjectRetryOptions } from './retry.js';
@@ -0,0 +1,3 @@
1
+ export { acknowledgeHibernationWebSocketClose, broadcastHibernationWebSockets, closeHibernationWebSocket, configureHibernationAutoResponse, upgradeHibernationWebSocket, } from './hibernation.js';
2
+ export { createLegacySseBridge } from './legacy-sse.js';
3
+ export { isRetryableDurableObjectError, retryDurableObjectOperation } from './retry.js';
@@ -1,13 +1,13 @@
1
1
  /** Minimal Durable Object namespace needed by the legacy SSE bridge. */
2
- export interface RealtimeDurableObjectNamespaceLike {
3
- idFromName(name: string): unknown;
4
- get(id: unknown): {
2
+ export interface RealtimeDurableObjectNamespaceLike<TId = unknown> {
3
+ idFromName(name: string): TId;
4
+ get(id: TId): {
5
5
  fetch(input: string | URL | Request, init?: RequestInit): Promise<Response>;
6
6
  };
7
7
  }
8
8
  /** Options for bridging legacy SSE clients to Hibernation WebSocket rooms. */
9
- export interface LegacySseBridgeOptions {
10
- namespace: RealtimeDurableObjectNamespaceLike;
9
+ export interface LegacySseBridgeOptions<TId = unknown> {
10
+ namespace: RealtimeDurableObjectNamespaceLike<TId>;
11
11
  roomNames: readonly string[];
12
12
  signal: AbortSignal;
13
13
  protocol: string;
@@ -22,4 +22,4 @@ export interface LegacySseBridgeOptions {
22
22
  * The heartbeat lives in the outer Worker only; Durable Objects remain hibernatable. Aborting the
23
23
  * downstream request also aborts pending upgrades, including the late-upgrade race during teardown.
24
24
  */
25
- export declare function createLegacySseBridge(options: LegacySseBridgeOptions): Response;
25
+ export declare function createLegacySseBridge<TId>(options: LegacySseBridgeOptions<TId>): Response;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdlabo/workers-hono-kit",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -59,6 +59,11 @@
59
59
  "import": "./dist/business-time/index.js",
60
60
  "default": "./dist/business-time/index.js"
61
61
  },
62
+ "./realtime": {
63
+ "types": "./dist/realtime/index.d.ts",
64
+ "import": "./dist/realtime/index.js",
65
+ "default": "./dist/realtime/index.js"
66
+ },
62
67
  "./testing": {
63
68
  "types": "./dist/testing/index.d.ts",
64
69
  "import": "./dist/testing/index.js",