@inditextech/weave-store-azure-web-pubsub 0.16.2 → 0.18.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 CHANGED
@@ -1187,8 +1187,8 @@ var WeaveStoreAzureWebPubSubSyncHost = class {
1187
1187
  var WeaveAzureWebPubsubSyncHandler = class extends __azure_web_pubsub_express.WebPubSubEventHandler {
1188
1188
  _connections = new Map();
1189
1189
  _store_persistence = new Map();
1190
- constructor(hub, path, client, initialState, server) {
1191
- super(hub, { path });
1190
+ constructor(server, client, initialState, hub, options) {
1191
+ super(hub, { ...options });
1192
1192
  this.actualServer = server;
1193
1193
  this.initialState = initialState;
1194
1194
  this._client = client;
@@ -1265,12 +1265,19 @@ function defaultInitialState(doc) {
1265
1265
  var WeaveAzureWebPubsubServer = class {
1266
1266
  persistRoom = void 0;
1267
1267
  fetchRoom = void 0;
1268
- constructor({ pubsubConfig, initialState = defaultInitialState, persistRoom, fetchRoom }) {
1268
+ constructor({ pubsubConfig, eventsHandlerConfig, initialState = defaultInitialState, persistRoom, fetchRoom }) {
1269
1269
  this.persistRoom = persistRoom;
1270
1270
  this.fetchRoom = fetchRoom;
1271
1271
  const credentials = new __azure_web_pubsub.AzureKeyCredential(pubsubConfig.key ?? "");
1272
1272
  const syncClient = new __azure_web_pubsub.WebPubSubServiceClient(pubsubConfig.endpoint, credentials, pubsubConfig.hubName);
1273
- this.syncHandler = new WeaveAzureWebPubsubSyncHandler(pubsubConfig.hubName, `/api/webpubsub/hubs/${pubsubConfig.hubName}`, syncClient, initialState, this);
1273
+ this.syncHandler = new WeaveAzureWebPubsubSyncHandler(
1274
+ this,
1275
+ syncClient,
1276
+ initialState,
1277
+ pubsubConfig.hubName,
1278
+ // `/api/webpubsub/hubs/${pubsubConfig.hubName}`,
1279
+ eventsHandlerConfig
1280
+ );
1274
1281
  }
1275
1282
  getMiddleware() {
1276
1283
  return this.syncHandler.getMiddleware();
package/dist/server.d.cts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as Y$1 from "yjs";
2
2
  import * as Y from "yjs";
3
3
  import { RequestHandler } from "express-serve-static-core";
4
+ import { WebPubSubEventHandlerOptions } from "@azure/web-pubsub-express";
4
5
  import * as awarenessProtocol from "y-protocols/awareness";
5
6
  import { WebPubSubServiceClient } from "@azure/web-pubsub";
6
7
 
@@ -43,6 +44,7 @@ type FetchRoom = (roomId: string) => Promise<Uint8Array | null>;
43
44
  type WeaveAzureWebPubsubServerParams = {
44
45
  initialState?: FetchInitialState;
45
46
  pubsubConfig: WeaveAzureWebPubsubConfig;
47
+ eventsHandlerConfig?: WebPubSubEventHandlerOptions;
46
48
  persistRoom?: PersistRoom;
47
49
  fetchRoom?: FetchRoom;
48
50
  };
@@ -52,6 +54,7 @@ declare class WeaveAzureWebPubsubServer {
52
54
  fetchRoom: FetchRoom | undefined;
53
55
  constructor({
54
56
  pubsubConfig,
57
+ eventsHandlerConfig,
55
58
  initialState,
56
59
  persistRoom,
57
60
  fetchRoom
package/dist/server.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { WebPubSubServiceClient } from "@azure/web-pubsub";
2
2
  import * as Y$1 from "yjs";
3
3
  import * as Y from "yjs";
4
+ import { WebPubSubEventHandlerOptions } from "@azure/web-pubsub-express";
4
5
  import { RequestHandler } from "express-serve-static-core";
5
6
  import * as awarenessProtocol from "y-protocols/awareness";
6
7
 
@@ -43,6 +44,7 @@ type FetchRoom = (roomId: string) => Promise<Uint8Array | null>;
43
44
  type WeaveAzureWebPubsubServerParams = {
44
45
  initialState?: FetchInitialState;
45
46
  pubsubConfig: WeaveAzureWebPubsubConfig;
47
+ eventsHandlerConfig?: WebPubSubEventHandlerOptions;
46
48
  persistRoom?: PersistRoom;
47
49
  fetchRoom?: FetchRoom;
48
50
  };
@@ -52,6 +54,7 @@ declare class WeaveAzureWebPubsubServer {
52
54
  fetchRoom: FetchRoom | undefined;
53
55
  constructor({
54
56
  pubsubConfig,
57
+ eventsHandlerConfig,
55
58
  initialState,
56
59
  persistRoom,
57
60
  fetchRoom
package/dist/server.js CHANGED
@@ -1165,8 +1165,8 @@ var WeaveStoreAzureWebPubSubSyncHost = class {
1165
1165
  var WeaveAzureWebPubsubSyncHandler = class extends WebPubSubEventHandler {
1166
1166
  _connections = new Map();
1167
1167
  _store_persistence = new Map();
1168
- constructor(hub, path, client, initialState, server) {
1169
- super(hub, { path });
1168
+ constructor(server, client, initialState, hub, options) {
1169
+ super(hub, { ...options });
1170
1170
  this.actualServer = server;
1171
1171
  this.initialState = initialState;
1172
1172
  this._client = client;
@@ -1243,12 +1243,19 @@ function defaultInitialState(doc) {
1243
1243
  var WeaveAzureWebPubsubServer = class {
1244
1244
  persistRoom = void 0;
1245
1245
  fetchRoom = void 0;
1246
- constructor({ pubsubConfig, initialState = defaultInitialState, persistRoom, fetchRoom }) {
1246
+ constructor({ pubsubConfig, eventsHandlerConfig, initialState = defaultInitialState, persistRoom, fetchRoom }) {
1247
1247
  this.persistRoom = persistRoom;
1248
1248
  this.fetchRoom = fetchRoom;
1249
1249
  const credentials = new AzureKeyCredential(pubsubConfig.key ?? "");
1250
1250
  const syncClient = new WebPubSubServiceClient(pubsubConfig.endpoint, credentials, pubsubConfig.hubName);
1251
- this.syncHandler = new WeaveAzureWebPubsubSyncHandler(pubsubConfig.hubName, `/api/webpubsub/hubs/${pubsubConfig.hubName}`, syncClient, initialState, this);
1251
+ this.syncHandler = new WeaveAzureWebPubsubSyncHandler(
1252
+ this,
1253
+ syncClient,
1254
+ initialState,
1255
+ pubsubConfig.hubName,
1256
+ // `/api/webpubsub/hubs/${pubsubConfig.hubName}`,
1257
+ eventsHandlerConfig
1258
+ );
1252
1259
  }
1253
1260
  getMiddleware() {
1254
1261
  return this.syncHandler.getMiddleware();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inditextech/weave-store-azure-web-pubsub",
3
- "version": "0.16.2",
3
+ "version": "0.18.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.16.2",
65
+ "@inditextech/weave-sdk": "0.18.0",
66
66
  "@types/express": "^5.0.1",
67
67
  "@types/node": "^22.15.3",
68
68
  "@types/uuid": "^10.0.0",