nitropack-nightly 2.11.9-20250410-104945.044f5266 → 2.11.10-20250411-093402.adfc4562
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/meta/index.mjs
CHANGED
|
@@ -13,6 +13,7 @@ export default _default;
|
|
|
13
13
|
export declare class $DurableObject extends DurableObject {
|
|
14
14
|
constructor(state: DurableObjectState, env: Record<string, any>);
|
|
15
15
|
fetch(request: Request): Promise<Response>;
|
|
16
|
+
publish(topic: string, data: unknown, opts: any): void;
|
|
16
17
|
alarm(): void | Promise<void>;
|
|
17
18
|
webSocketMessage(client: WebSocket, message: ArrayBuffer | string): Promise<void>;
|
|
18
19
|
webSocketClose(client: WebSocket, code: number, reason: string, wasClean: boolean): Promise<void>;
|
|
@@ -55,6 +55,12 @@ export class $DurableObject extends DurableObject {
|
|
|
55
55
|
durable: this
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
+
publish(topic, data, opts) {
|
|
59
|
+
if (!ws) {
|
|
60
|
+
throw new Error("WebSocket not available");
|
|
61
|
+
}
|
|
62
|
+
return ws.publish(topic, data, opts);
|
|
63
|
+
}
|
|
58
64
|
alarm() {
|
|
59
65
|
this.ctx.waitUntil(
|
|
60
66
|
nitroApp.hooks.callHook("cloudflare:durable:alarm", this)
|
package/package.json
CHANGED