@pluv/io 0.32.2 → 0.32.3
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/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +8 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +25 -1
- package/dist/index.mjs +25 -1
- package/package.json +7 -7
- package/src/IORoom.ts +26 -0
- package/src/version.generated.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/io@0.32.
|
|
2
|
+
> @pluv/io@0.32.3 build /home/runner/work/pluv/pluv/packages/io
|
|
3
3
|
> pnpm run version && tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @pluv/io@0.32.
|
|
6
|
+
> @pluv/io@0.32.3 version /home/runner/work/pluv/pluv/packages/io
|
|
7
7
|
> genversion ./src/version.generated.ts --esm
|
|
8
8
|
|
|
9
9
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
[34mCLI[39m Target: es6
|
|
13
13
|
[34mESM[39m Build start
|
|
14
14
|
[34mCJS[39m Build start
|
|
15
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m40.
|
|
16
|
-
[32mESM[39m ⚡️ Build success in
|
|
17
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
18
|
-
[32mCJS[39m ⚡️ Build success in
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m40.83 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 163ms
|
|
17
|
+
[32mCJS[39m [1mdist/index.js [22m[32m43.00 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 172ms
|
|
19
19
|
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
|
21
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m26.
|
|
22
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m26.
|
|
20
|
+
[32mDTS[39m ⚡️ Build success in 2374ms
|
|
21
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m26.66 KB[39m
|
|
22
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m26.66 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -313,6 +313,16 @@ declare class IORoom<TPlatform extends AbstractPlatform<any> = AbstractPlatform<
|
|
|
313
313
|
get broadcast(): BroadcastProxy<this>;
|
|
314
314
|
private get _initialized();
|
|
315
315
|
constructor(id: string, config: IORoomConfig<TPlatform, TAuthorize, TContext, TEvents>);
|
|
316
|
+
/**
|
|
317
|
+
* @description Closes a connection with the specified sessionId
|
|
318
|
+
* @param sessionId The session id of the connection to close
|
|
319
|
+
*/
|
|
320
|
+
evict(sessionId: string): Promise<void>;
|
|
321
|
+
/**
|
|
322
|
+
* @description Closes all connections to this room, effectively destroying
|
|
323
|
+
* the room
|
|
324
|
+
*/
|
|
325
|
+
evictAll(): Promise<void>;
|
|
316
326
|
getSize(): number;
|
|
317
327
|
onClose(webSocket: WebSocketType<TPlatform>): (event: AbstractCloseEvent) => Promise<void>;
|
|
318
328
|
onError(webSocket: WebSocketType<TPlatform>): (event: AbstractErrorEvent) => Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -313,6 +313,16 @@ declare class IORoom<TPlatform extends AbstractPlatform<any> = AbstractPlatform<
|
|
|
313
313
|
get broadcast(): BroadcastProxy<this>;
|
|
314
314
|
private get _initialized();
|
|
315
315
|
constructor(id: string, config: IORoomConfig<TPlatform, TAuthorize, TContext, TEvents>);
|
|
316
|
+
/**
|
|
317
|
+
* @description Closes a connection with the specified sessionId
|
|
318
|
+
* @param sessionId The session id of the connection to close
|
|
319
|
+
*/
|
|
320
|
+
evict(sessionId: string): Promise<void>;
|
|
321
|
+
/**
|
|
322
|
+
* @description Closes all connections to this room, effectively destroying
|
|
323
|
+
* the room
|
|
324
|
+
*/
|
|
325
|
+
evictAll(): Promise<void>;
|
|
316
326
|
getSize(): number;
|
|
317
327
|
onClose(webSocket: WebSocketType<TPlatform>): (event: AbstractCloseEvent) => Promise<void>;
|
|
318
328
|
onError(webSocket: WebSocketType<TPlatform>): (event: AbstractErrorEvent) => Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -462,6 +462,30 @@ var IORoom = class {
|
|
|
462
462
|
var _a;
|
|
463
463
|
return Promise.resolve(!!((_a = this._uninitialize) == null ? void 0 : _a.then((result) => !!result)));
|
|
464
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
* @description Closes a connection with the specified sessionId
|
|
467
|
+
* @param sessionId The session id of the connection to close
|
|
468
|
+
*/
|
|
469
|
+
evict(sessionId) {
|
|
470
|
+
return __async(this, null, function* () {
|
|
471
|
+
const session = this._sessions.get(sessionId);
|
|
472
|
+
if (session) session.state.quit = true;
|
|
473
|
+
yield this._emitQuitters();
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* @description Closes all connections to this room, effectively destroying
|
|
478
|
+
* the room
|
|
479
|
+
*/
|
|
480
|
+
evictAll() {
|
|
481
|
+
return __async(this, null, function* () {
|
|
482
|
+
const sessions = Array.from(this._sessions.values());
|
|
483
|
+
sessions.forEach((session) => {
|
|
484
|
+
session.state.quit = true;
|
|
485
|
+
});
|
|
486
|
+
yield this._emitQuitters();
|
|
487
|
+
});
|
|
488
|
+
}
|
|
465
489
|
getSize() {
|
|
466
490
|
const currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
467
491
|
return Array.from(this._sessions.values()).reduce((count, pluvWs) => {
|
|
@@ -933,7 +957,7 @@ var IORoom = class {
|
|
|
933
957
|
};
|
|
934
958
|
|
|
935
959
|
// src/version.generated.ts
|
|
936
|
-
var version = "0.32.
|
|
960
|
+
var version = "0.32.3";
|
|
937
961
|
|
|
938
962
|
// src/PluvServer.ts
|
|
939
963
|
var PluvServer = class {
|
package/dist/index.mjs
CHANGED
|
@@ -420,6 +420,30 @@ var IORoom = class {
|
|
|
420
420
|
var _a;
|
|
421
421
|
return Promise.resolve(!!((_a = this._uninitialize) == null ? void 0 : _a.then((result) => !!result)));
|
|
422
422
|
}
|
|
423
|
+
/**
|
|
424
|
+
* @description Closes a connection with the specified sessionId
|
|
425
|
+
* @param sessionId The session id of the connection to close
|
|
426
|
+
*/
|
|
427
|
+
evict(sessionId) {
|
|
428
|
+
return __async(this, null, function* () {
|
|
429
|
+
const session = this._sessions.get(sessionId);
|
|
430
|
+
if (session) session.state.quit = true;
|
|
431
|
+
yield this._emitQuitters();
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* @description Closes all connections to this room, effectively destroying
|
|
436
|
+
* the room
|
|
437
|
+
*/
|
|
438
|
+
evictAll() {
|
|
439
|
+
return __async(this, null, function* () {
|
|
440
|
+
const sessions = Array.from(this._sessions.values());
|
|
441
|
+
sessions.forEach((session) => {
|
|
442
|
+
session.state.quit = true;
|
|
443
|
+
});
|
|
444
|
+
yield this._emitQuitters();
|
|
445
|
+
});
|
|
446
|
+
}
|
|
423
447
|
getSize() {
|
|
424
448
|
const currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
425
449
|
return Array.from(this._sessions.values()).reduce((count, pluvWs) => {
|
|
@@ -891,7 +915,7 @@ var IORoom = class {
|
|
|
891
915
|
};
|
|
892
916
|
|
|
893
917
|
// src/version.generated.ts
|
|
894
|
-
var version = "0.32.
|
|
918
|
+
var version = "0.32.3";
|
|
895
919
|
|
|
896
920
|
// src/PluvServer.ts
|
|
897
921
|
var PluvServer = class {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/io",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.3",
|
|
4
4
|
"description": "@pluv/io server-side websocket manager",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@panva/hkdf": "^1.2.1",
|
|
21
|
-
"jose": "^5.9.
|
|
21
|
+
"jose": "^5.9.4",
|
|
22
22
|
"kleur": "^4.1.5",
|
|
23
23
|
"wonka": "^6.3.4",
|
|
24
|
-
"@pluv/crdt": "^0.32.
|
|
25
|
-
"@pluv/types": "^0.32.
|
|
24
|
+
"@pluv/crdt": "^0.32.3",
|
|
25
|
+
"@pluv/types": "^0.32.3"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"eslint": "^8.57.0",
|
|
29
29
|
"genversion": "^3.2.0",
|
|
30
30
|
"tsup": "^8.3.0",
|
|
31
|
-
"typescript": "^5.6.
|
|
32
|
-
"@pluv/tsconfig": "^0.32.
|
|
33
|
-
"eslint-config-pluv": "^0.32.
|
|
31
|
+
"typescript": "^5.6.3",
|
|
32
|
+
"@pluv/tsconfig": "^0.32.3",
|
|
33
|
+
"eslint-config-pluv": "^0.32.3"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "pnpm run version && tsup src/index.ts --format esm,cjs --dts",
|
package/src/IORoom.ts
CHANGED
|
@@ -191,6 +191,32 @@ export class IORoom<
|
|
|
191
191
|
this._uninitialize = uninitialize;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
+
/**
|
|
195
|
+
* @description Closes a connection with the specified sessionId
|
|
196
|
+
* @param sessionId The session id of the connection to close
|
|
197
|
+
*/
|
|
198
|
+
public async evict(sessionId: string): Promise<void> {
|
|
199
|
+
const session = this._sessions.get(sessionId);
|
|
200
|
+
|
|
201
|
+
if (session) session.state.quit = true;
|
|
202
|
+
|
|
203
|
+
await this._emitQuitters();
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @description Closes all connections to this room, effectively destroying
|
|
208
|
+
* the room
|
|
209
|
+
*/
|
|
210
|
+
public async evictAll(): Promise<void> {
|
|
211
|
+
const sessions = Array.from(this._sessions.values());
|
|
212
|
+
|
|
213
|
+
sessions.forEach((session) => {
|
|
214
|
+
session.state.quit = true;
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
await this._emitQuitters();
|
|
218
|
+
}
|
|
219
|
+
|
|
194
220
|
public getSize(): number {
|
|
195
221
|
const currentTime = new Date().getTime();
|
|
196
222
|
|
package/src/version.generated.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '0.32.
|
|
2
|
+
export const version = '0.32.3'
|