@pluv/io 0.4.1 → 0.4.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @pluv/io@0.4.1 build /home/runner/work/pluv/pluv/packages/io
2
+ > @pluv/io@0.4.2 build /home/runner/work/pluv/pluv/packages/io
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,10 +8,10 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- CJS dist/index.js 30.01 KB
12
- CJS ⚡️ Build success in 89ms
13
- ESM dist/index.mjs 27.95 KB
14
- ESM ⚡️ Build success in 93ms
11
+ CJS dist/index.js 30.12 KB
12
+ CJS ⚡️ Build success in 109ms
13
+ ESM dist/index.mjs 28.06 KB
14
+ ESM ⚡️ Build success in 112ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 2921ms
17
- DTS dist/index.d.ts 14.84 KB
16
+ DTS ⚡️ Build success in 3144ms
17
+ DTS dist/index.d.ts 14.86 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @pluv/io
2
2
 
3
+ ## 0.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 8917309: fixed PluvIO listeners onRoomDeleted and onStorageUpdated not working when additional events were added
8
+
3
9
  ## 0.4.1
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -247,11 +247,11 @@ interface GetRoomOptions {
247
247
  declare class PluvIO<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends IOAuthorize<any, any> = BaseIOAuthorize, TContext extends JsonObject = {}, TInput extends EventRecord<string, any> = {}, TOutputBroadcast extends EventRecord<string, any> = {}, TOutputSelf extends EventRecord<string, any> = {}, TOutputSync extends EventRecord<string, any> = {}> implements IOLike<TAuthorize, TInput, TOutputBroadcast, TOutputSelf, TOutputSync> {
248
248
  private _context;
249
249
  private _initialStorage;
250
- private _listeners;
251
250
  private _rooms;
252
251
  readonly _authorize: TAuthorize | null;
253
252
  readonly _debug: boolean;
254
253
  readonly _events: InferEventConfig<TContext, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>;
254
+ readonly _listeners: PluvIOListeners;
255
255
  readonly _platform: TPlatform;
256
256
  constructor(options: PluvIOConfig<TPlatform, TAuthorize, TContext, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>);
257
257
  createToken(params: JWTEncodeParams<InferIOAuthorizeUser<InferIOAuthorize<this>>>): Promise<string>;
package/dist/index.js CHANGED
@@ -924,11 +924,14 @@ var PluvIO = class {
924
924
  const platform = first._platform;
925
925
  const events1 = first._events;
926
926
  const events2 = second._events;
927
+ const { onRoomDeleted, onStorageUpdated } = first._listeners;
927
928
  const events = Object.assign(/* @__PURE__ */ Object.create(null), events1, events2);
928
929
  return new PluvIO({
929
930
  authorize: authorize2,
930
931
  debug,
931
932
  events,
933
+ onRoomDeleted,
934
+ onStorageUpdated,
932
935
  platform
933
936
  });
934
937
  }
package/dist/index.mjs CHANGED
@@ -887,11 +887,14 @@ var PluvIO = class {
887
887
  const platform = first._platform;
888
888
  const events1 = first._events;
889
889
  const events2 = second._events;
890
+ const { onRoomDeleted, onStorageUpdated } = first._listeners;
890
891
  const events = Object.assign(/* @__PURE__ */ Object.create(null), events1, events2);
891
892
  return new PluvIO({
892
893
  authorize: authorize2,
893
894
  debug,
894
895
  events,
896
+ onRoomDeleted,
897
+ onStorageUpdated,
895
898
  platform
896
899
  });
897
900
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/io",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "@pluv/io server-side websocket manager",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
package/src/PluvIO.ts CHANGED
@@ -105,7 +105,6 @@ export class PluvIO<
105
105
  private _initialStorage:
106
106
  | ((room: string) => MaybePromise<Maybe<string>>)
107
107
  | null = null;
108
- private _listeners: PluvIOListeners;
109
108
  private _rooms = new Map<
110
109
  string,
111
110
  IORoom<
@@ -256,6 +255,7 @@ export class PluvIO<
256
255
  TOutputSelf,
257
256
  TOutputSync
258
257
  >;
258
+ readonly _listeners: PluvIOListeners;
259
259
  readonly _platform: TPlatform;
260
260
 
261
261
  constructor(
@@ -467,12 +467,16 @@ export class PluvIO<
467
467
  const events1 = first._events;
468
468
  const events2 = second._events;
469
469
 
470
+ const { onRoomDeleted, onStorageUpdated } = first._listeners;
471
+
470
472
  const events = Object.assign(Object.create(null), events1, events2);
471
473
 
472
474
  return new PluvIO({
473
475
  authorize,
474
476
  debug,
475
477
  events,
478
+ onRoomDeleted,
479
+ onStorageUpdated,
476
480
  platform,
477
481
  });
478
482
  }