@inditextech/weave-store-azure-web-pubsub 0.13.0 → 0.14.0
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/server.cjs +2 -1
- package/dist/server.d.cts +31 -2
- package/dist/server.d.ts +31 -2
- package/dist/server.js +4 -4
- package/package.json +2 -2
package/dist/server.cjs
CHANGED
|
@@ -1283,4 +1283,5 @@ var WeaveAzureWebPubsubServer = class {
|
|
|
1283
1283
|
//#endregion
|
|
1284
1284
|
exports.WEAVE_STORE_AZURE_WEB_PUBSUB = WEAVE_STORE_AZURE_WEB_PUBSUB
|
|
1285
1285
|
exports.WEAVE_STORE_AZURE_WEB_PUBSUB_CONNECTION_STATUS = WEAVE_STORE_AZURE_WEB_PUBSUB_CONNECTION_STATUS
|
|
1286
|
-
exports.WeaveAzureWebPubsubServer = WeaveAzureWebPubsubServer
|
|
1286
|
+
exports.WeaveAzureWebPubsubServer = WeaveAzureWebPubsubServer
|
|
1287
|
+
exports.WeaveStoreAzureWebPubSubSyncHost = WeaveStoreAzureWebPubSubSyncHost
|
package/dist/server.d.cts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import * as Y$1 from "yjs";
|
|
1
2
|
import * as Y from "yjs";
|
|
2
3
|
import { RequestHandler } from "express-serve-static-core";
|
|
4
|
+
import * as awarenessProtocol from "y-protocols/awareness";
|
|
5
|
+
import { WebPubSubServiceClient } from "@azure/web-pubsub";
|
|
3
6
|
|
|
4
7
|
//#region src/constants.d.ts
|
|
5
8
|
declare const WEAVE_STORE_AZURE_WEB_PUBSUB = "store-azure-web-pubsub";
|
|
@@ -31,7 +34,7 @@ type WeaveStoreAzureWebPubsubStoreCallbacks = {
|
|
|
31
34
|
onConnectionStatusChange?: (status: WeaveStoreAzureWebPubsubConnectionStatus) => void;
|
|
32
35
|
};
|
|
33
36
|
type FetchClient = (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
|
|
34
|
-
type FetchInitialState = (doc: Y.Doc) => void;
|
|
37
|
+
type FetchInitialState = (doc: Y$1.Doc) => void;
|
|
35
38
|
type PersistRoom = (roomId: string, actualState: Uint8Array<ArrayBufferLike>) => Promise<void>;
|
|
36
39
|
type FetchRoom = (roomId: string) => Promise<Uint8Array | null>;
|
|
37
40
|
|
|
@@ -58,4 +61,30 @@ declare class WeaveAzureWebPubsubServer {
|
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
//#endregion
|
|
61
|
-
|
|
64
|
+
//#region src/server/azure-web-pubsub-host.d.ts
|
|
65
|
+
interface WebPubSubHostOptions {
|
|
66
|
+
WebSocketPolyfill: any;
|
|
67
|
+
}
|
|
68
|
+
declare class WeaveStoreAzureWebPubSubSyncHost {
|
|
69
|
+
doc: Y.Doc;
|
|
70
|
+
topic: string;
|
|
71
|
+
private _client;
|
|
72
|
+
private _polyfill;
|
|
73
|
+
private _conn;
|
|
74
|
+
private _awareness;
|
|
75
|
+
constructor(client: WebPubSubServiceClient, topic: string, doc: Y.Doc, {
|
|
76
|
+
WebSocketPolyfill
|
|
77
|
+
}: WebPubSubHostOptions);
|
|
78
|
+
get awareness(): awarenessProtocol.Awareness;
|
|
79
|
+
sendInitAwarenessInfo(): void;
|
|
80
|
+
start(): Promise<void>;
|
|
81
|
+
private broadcast;
|
|
82
|
+
private send;
|
|
83
|
+
private onClientInit;
|
|
84
|
+
private onClientSync;
|
|
85
|
+
private onAwareness;
|
|
86
|
+
private negotiate;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
//#endregion
|
|
90
|
+
export { FetchClient, FetchInitialState, FetchRoom, PersistRoom, WEAVE_STORE_AZURE_WEB_PUBSUB, WEAVE_STORE_AZURE_WEB_PUBSUB_CONNECTION_STATUS, WeaveAzureWebPubsubConfig, WeaveAzureWebPubsubServer, WeaveStoreAzureWebPubSubSyncHost, WeaveStoreAzureWebPubsubConnectionStatus, WeaveStoreAzureWebPubsubConnectionStatusKeys, WeaveStoreAzureWebPubsubOptions, WeaveStoreAzureWebPubsubStoreCallbacks };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { WebPubSubServiceClient } from "@azure/web-pubsub";
|
|
2
|
+
import * as Y$1 from "yjs";
|
|
1
3
|
import * as Y from "yjs";
|
|
2
4
|
import { RequestHandler } from "express-serve-static-core";
|
|
5
|
+
import * as awarenessProtocol from "y-protocols/awareness";
|
|
3
6
|
|
|
4
7
|
//#region src/constants.d.ts
|
|
5
8
|
declare const WEAVE_STORE_AZURE_WEB_PUBSUB = "store-azure-web-pubsub";
|
|
@@ -31,7 +34,7 @@ type WeaveStoreAzureWebPubsubStoreCallbacks = {
|
|
|
31
34
|
onConnectionStatusChange?: (status: WeaveStoreAzureWebPubsubConnectionStatus) => void;
|
|
32
35
|
};
|
|
33
36
|
type FetchClient = (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
|
|
34
|
-
type FetchInitialState = (doc: Y.Doc) => void;
|
|
37
|
+
type FetchInitialState = (doc: Y$1.Doc) => void;
|
|
35
38
|
type PersistRoom = (roomId: string, actualState: Uint8Array<ArrayBufferLike>) => Promise<void>;
|
|
36
39
|
type FetchRoom = (roomId: string) => Promise<Uint8Array | null>;
|
|
37
40
|
|
|
@@ -58,4 +61,30 @@ declare class WeaveAzureWebPubsubServer {
|
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
//#endregion
|
|
61
|
-
|
|
64
|
+
//#region src/server/azure-web-pubsub-host.d.ts
|
|
65
|
+
interface WebPubSubHostOptions {
|
|
66
|
+
WebSocketPolyfill: any;
|
|
67
|
+
}
|
|
68
|
+
declare class WeaveStoreAzureWebPubSubSyncHost {
|
|
69
|
+
doc: Y.Doc;
|
|
70
|
+
topic: string;
|
|
71
|
+
private _client;
|
|
72
|
+
private _polyfill;
|
|
73
|
+
private _conn;
|
|
74
|
+
private _awareness;
|
|
75
|
+
constructor(client: WebPubSubServiceClient, topic: string, doc: Y.Doc, {
|
|
76
|
+
WebSocketPolyfill
|
|
77
|
+
}: WebPubSubHostOptions);
|
|
78
|
+
get awareness(): awarenessProtocol.Awareness;
|
|
79
|
+
sendInitAwarenessInfo(): void;
|
|
80
|
+
start(): Promise<void>;
|
|
81
|
+
private broadcast;
|
|
82
|
+
private send;
|
|
83
|
+
private onClientInit;
|
|
84
|
+
private onClientSync;
|
|
85
|
+
private onAwareness;
|
|
86
|
+
private negotiate;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
//#endregion
|
|
90
|
+
export { FetchClient, FetchInitialState, FetchRoom, PersistRoom, WEAVE_STORE_AZURE_WEB_PUBSUB, WEAVE_STORE_AZURE_WEB_PUBSUB_CONNECTION_STATUS, WeaveAzureWebPubsubConfig, WeaveAzureWebPubsubServer, WeaveStoreAzureWebPubSubSyncHost, WeaveStoreAzureWebPubsubConnectionStatus, WeaveStoreAzureWebPubsubConnectionStatusKeys, WeaveStoreAzureWebPubsubOptions, WeaveStoreAzureWebPubsubStoreCallbacks };
|
package/dist/server.js
CHANGED
|
@@ -2,7 +2,7 @@ import { AzureKeyCredential, WebPubSubServiceClient } from "@azure/web-pubsub";
|
|
|
2
2
|
import * as Y$2 from "yjs";
|
|
3
3
|
import * as Y$1 from "yjs";
|
|
4
4
|
import * as Y from "yjs";
|
|
5
|
-
import WebSocket, { WebSocket
|
|
5
|
+
import WebSocket$1, { WebSocket } from "ws";
|
|
6
6
|
import { WebPubSubEventHandler } from "@azure/web-pubsub-express";
|
|
7
7
|
|
|
8
8
|
//#region src/constants.ts
|
|
@@ -1029,7 +1029,7 @@ let MessageDataType = /* @__PURE__ */ function(MessageDataType$1) {
|
|
|
1029
1029
|
}({});
|
|
1030
1030
|
const HostUserId = "host";
|
|
1031
1031
|
var WeaveStoreAzureWebPubSubSyncHost = class {
|
|
1032
|
-
constructor(client, topic, doc, { WebSocketPolyfill = WebSocket
|
|
1032
|
+
constructor(client, topic, doc, { WebSocketPolyfill = WebSocket }) {
|
|
1033
1033
|
this.doc = doc;
|
|
1034
1034
|
this.topic = topic;
|
|
1035
1035
|
this._client = client;
|
|
@@ -1194,7 +1194,7 @@ var WeaveAzureWebPubsubSyncHandler = class extends WebPubSubEventHandler {
|
|
|
1194
1194
|
if (this.actualServer && this.actualServer.fetchRoom) documentData = await this.actualServer.fetchRoom(roomId);
|
|
1195
1195
|
if (documentData) Y$1.applyUpdate(doc, documentData);
|
|
1196
1196
|
else this.initialState(doc);
|
|
1197
|
-
const connection = new WeaveStoreAzureWebPubSubSyncHost(this._client, roomId, doc, { WebSocketPolyfill: WebSocket });
|
|
1197
|
+
const connection = new WeaveStoreAzureWebPubSubSyncHost(this._client, roomId, doc, { WebSocketPolyfill: WebSocket$1 });
|
|
1198
1198
|
connection.start();
|
|
1199
1199
|
this._connections.set(roomId, connection);
|
|
1200
1200
|
await this.setupRoomPersistence(roomId, connection);
|
|
@@ -1259,4 +1259,4 @@ var WeaveAzureWebPubsubServer = class {
|
|
|
1259
1259
|
};
|
|
1260
1260
|
|
|
1261
1261
|
//#endregion
|
|
1262
|
-
export { WEAVE_STORE_AZURE_WEB_PUBSUB, WEAVE_STORE_AZURE_WEB_PUBSUB_CONNECTION_STATUS, WeaveAzureWebPubsubServer };
|
|
1262
|
+
export { WEAVE_STORE_AZURE_WEB_PUBSUB, WEAVE_STORE_AZURE_WEB_PUBSUB_CONNECTION_STATUS, WeaveAzureWebPubsubServer, WeaveStoreAzureWebPubSubSyncHost };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inditextech/weave-store-azure-web-pubsub",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Jesus Manuel Piñeiro Cid <jesusmpc@inditex.com>",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"yjs": "13.6.26"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@inditextech/weave-sdk": "0.
|
|
65
|
+
"@inditextech/weave-sdk": "0.14.0",
|
|
66
66
|
"@types/express": "^5.0.1",
|
|
67
67
|
"@types/node": "^22.15.3",
|
|
68
68
|
"@types/uuid": "^10.0.0",
|