@pluv/io 0.10.1 → 0.10.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 +8 -8
- package/CHANGELOG.md +16 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +6 -2
- package/dist/index.mjs +6 -2
- package/package.json +5 -5
- package/src/PluvIO.ts +10 -2
- package/src/index.ts +1 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/io@0.10.
|
|
2
|
+
> @pluv/io@0.10.3 build /home/runner/work/pluv/pluv/packages/io
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m29.
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[32m31.
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m29.29 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 73ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m31.35 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 78ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m17.
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m17.
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 3387ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m17.12 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m17.12 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @pluv/io
|
|
2
2
|
|
|
3
|
+
## 0.10.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a7d3ad1: Exposed context and getInitialProps from @pluv/io.
|
|
8
|
+
- @pluv/crdt-yjs@0.10.3
|
|
9
|
+
- @pluv/types@0.10.3
|
|
10
|
+
|
|
11
|
+
## 0.10.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 3deee13: Expose type AbstractPlatformConfig from @pluv/io.
|
|
16
|
+
- @pluv/crdt-yjs@0.10.2
|
|
17
|
+
- @pluv/types@0.10.2
|
|
18
|
+
|
|
3
19
|
## 0.10.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -257,12 +257,12 @@ type GetRoomOptions<TPlatform extends AbstractPlatform> = {
|
|
|
257
257
|
debug?: boolean;
|
|
258
258
|
} & InferPlatformRoomContextType<TPlatform>;
|
|
259
259
|
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> {
|
|
260
|
-
private _context;
|
|
261
|
-
private _getInitialStorage;
|
|
262
260
|
private _rooms;
|
|
263
261
|
readonly _authorize: TAuthorize | null;
|
|
262
|
+
readonly _context: TContext;
|
|
264
263
|
readonly _debug: boolean;
|
|
265
264
|
readonly _events: InferEventConfig<TPlatform, TContext, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>;
|
|
265
|
+
readonly _getInitialStorage: GetInitialStorageFn<TPlatform> | null;
|
|
266
266
|
readonly _listeners: PluvIOListeners<TPlatform>;
|
|
267
267
|
readonly _platform: TPlatform;
|
|
268
268
|
constructor(options: PluvIOConfig<TPlatform, TAuthorize, TContext, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>);
|
|
@@ -283,4 +283,4 @@ type CreateIOParams<TPlatform extends AbstractPlatform<any> = AbstractPlatform<a
|
|
|
283
283
|
};
|
|
284
284
|
declare const createIO: <TPlatform extends AbstractPlatform<any, {}, {}> = AbstractPlatform<any, {}, {}>, TContext extends JsonObject = {}, TAuthorizeUser extends BaseUser = BaseUser, TAuthorizeRequired extends boolean = false>(params: CreateIOParams<TPlatform, TContext, TAuthorizeUser, TAuthorizeRequired>) => PluvIO<TPlatform, IOAuthorize<TAuthorizeUser, TAuthorizeRequired>, TContext, BaseClientEventRecord, BaseIOEventRecord<IOAuthorize<TAuthorizeUser, TAuthorizeRequired>>, {}, {}>;
|
|
285
285
|
|
|
286
|
-
export { AbstractCloseEvent, AbstractErrorEvent, AbstractEvent, AbstractEventMap, AbstractListener, AbstractMessageEvent, AbstractPersistance, AbstractPlatform, AbstractPubSub, AbstractWebSocket, AbstractWebSocketConfig, AbstractWebSocketHandleErrorParams, AuthorizeModule, AuthorizeParams, ConvertWebSocketConfig, CreateIOParams, GetRoomOptions, IOPubSubEventMessage, IORoom, InferIORoom, InferPlatformEventContextType, InferPlatformRoomContextType, InferPlatformWebSocketType, JWT, JWTEncodeParams, PluvIO, PluvIOConfig, createIO };
|
|
286
|
+
export { AbstractCloseEvent, AbstractErrorEvent, AbstractEvent, AbstractEventMap, AbstractListener, AbstractMessageEvent, AbstractPersistance, AbstractPlatform, AbstractPlatformConfig, AbstractPubSub, AbstractWebSocket, AbstractWebSocketConfig, AbstractWebSocketHandleErrorParams, AuthorizeModule, AuthorizeParams, ConvertWebSocketConfig, CreateIOParams, GetRoomOptions, IOPubSubEventMessage, IORoom, InferIORoom, InferPlatformEventContextType, InferPlatformRoomContextType, InferPlatformWebSocketType, JWT, JWTEncodeParams, PluvIO, PluvIOConfig, createIO };
|
package/dist/index.d.ts
CHANGED
|
@@ -257,12 +257,12 @@ type GetRoomOptions<TPlatform extends AbstractPlatform> = {
|
|
|
257
257
|
debug?: boolean;
|
|
258
258
|
} & InferPlatformRoomContextType<TPlatform>;
|
|
259
259
|
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> {
|
|
260
|
-
private _context;
|
|
261
|
-
private _getInitialStorage;
|
|
262
260
|
private _rooms;
|
|
263
261
|
readonly _authorize: TAuthorize | null;
|
|
262
|
+
readonly _context: TContext;
|
|
264
263
|
readonly _debug: boolean;
|
|
265
264
|
readonly _events: InferEventConfig<TPlatform, TContext, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>;
|
|
265
|
+
readonly _getInitialStorage: GetInitialStorageFn<TPlatform> | null;
|
|
266
266
|
readonly _listeners: PluvIOListeners<TPlatform>;
|
|
267
267
|
readonly _platform: TPlatform;
|
|
268
268
|
constructor(options: PluvIOConfig<TPlatform, TAuthorize, TContext, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>);
|
|
@@ -283,4 +283,4 @@ type CreateIOParams<TPlatform extends AbstractPlatform<any> = AbstractPlatform<a
|
|
|
283
283
|
};
|
|
284
284
|
declare const createIO: <TPlatform extends AbstractPlatform<any, {}, {}> = AbstractPlatform<any, {}, {}>, TContext extends JsonObject = {}, TAuthorizeUser extends BaseUser = BaseUser, TAuthorizeRequired extends boolean = false>(params: CreateIOParams<TPlatform, TContext, TAuthorizeUser, TAuthorizeRequired>) => PluvIO<TPlatform, IOAuthorize<TAuthorizeUser, TAuthorizeRequired>, TContext, BaseClientEventRecord, BaseIOEventRecord<IOAuthorize<TAuthorizeUser, TAuthorizeRequired>>, {}, {}>;
|
|
285
285
|
|
|
286
|
-
export { AbstractCloseEvent, AbstractErrorEvent, AbstractEvent, AbstractEventMap, AbstractListener, AbstractMessageEvent, AbstractPersistance, AbstractPlatform, AbstractPubSub, AbstractWebSocket, AbstractWebSocketConfig, AbstractWebSocketHandleErrorParams, AuthorizeModule, AuthorizeParams, ConvertWebSocketConfig, CreateIOParams, GetRoomOptions, IOPubSubEventMessage, IORoom, InferIORoom, InferPlatformEventContextType, InferPlatformRoomContextType, InferPlatformWebSocketType, JWT, JWTEncodeParams, PluvIO, PluvIOConfig, createIO };
|
|
286
|
+
export { AbstractCloseEvent, AbstractErrorEvent, AbstractEvent, AbstractEventMap, AbstractListener, AbstractMessageEvent, AbstractPersistance, AbstractPlatform, AbstractPlatformConfig, AbstractPubSub, AbstractWebSocket, AbstractWebSocketConfig, AbstractWebSocketHandleErrorParams, AuthorizeModule, AuthorizeParams, ConvertWebSocketConfig, CreateIOParams, GetRoomOptions, IOPubSubEventMessage, IORoom, InferIORoom, InferPlatformEventContextType, InferPlatformRoomContextType, InferPlatformWebSocketType, JWT, JWTEncodeParams, PluvIO, PluvIOConfig, createIO };
|
package/dist/index.js
CHANGED
|
@@ -732,10 +732,9 @@ var IORoom = class {
|
|
|
732
732
|
// src/PluvIO.ts
|
|
733
733
|
var PluvIO = class _PluvIO {
|
|
734
734
|
constructor(options) {
|
|
735
|
-
this._context = {};
|
|
736
|
-
this._getInitialStorage = null;
|
|
737
735
|
this._rooms = /* @__PURE__ */ new Map();
|
|
738
736
|
this._authorize = null;
|
|
737
|
+
this._context = {};
|
|
739
738
|
this._events = {
|
|
740
739
|
$GET_OTHERS: {
|
|
741
740
|
resolver: {
|
|
@@ -836,6 +835,7 @@ var PluvIO = class _PluvIO {
|
|
|
836
835
|
}
|
|
837
836
|
}
|
|
838
837
|
};
|
|
838
|
+
this._getInitialStorage = null;
|
|
839
839
|
const {
|
|
840
840
|
authorize: authorize2,
|
|
841
841
|
context,
|
|
@@ -941,16 +941,20 @@ var PluvIO = class _PluvIO {
|
|
|
941
941
|
static merge(first, second) {
|
|
942
942
|
var _a;
|
|
943
943
|
const authorize2 = (_a = first._authorize) != null ? _a : void 0;
|
|
944
|
+
const context = first._context;
|
|
944
945
|
const debug = first._debug;
|
|
945
946
|
const platform = first._platform;
|
|
947
|
+
const getInitialStorage = first._getInitialStorage;
|
|
946
948
|
const events1 = first._events;
|
|
947
949
|
const events2 = second._events;
|
|
948
950
|
const { onRoomDeleted, onStorageUpdated } = first._listeners;
|
|
949
951
|
const events = Object.assign(/* @__PURE__ */ Object.create(null), events1, events2);
|
|
950
952
|
return new _PluvIO({
|
|
951
953
|
authorize: authorize2,
|
|
954
|
+
context,
|
|
952
955
|
debug,
|
|
953
956
|
events,
|
|
957
|
+
getInitialStorage,
|
|
954
958
|
onRoomDeleted,
|
|
955
959
|
onStorageUpdated,
|
|
956
960
|
platform
|
package/dist/index.mjs
CHANGED
|
@@ -695,10 +695,9 @@ var IORoom = class {
|
|
|
695
695
|
// src/PluvIO.ts
|
|
696
696
|
var PluvIO = class _PluvIO {
|
|
697
697
|
constructor(options) {
|
|
698
|
-
this._context = {};
|
|
699
|
-
this._getInitialStorage = null;
|
|
700
698
|
this._rooms = /* @__PURE__ */ new Map();
|
|
701
699
|
this._authorize = null;
|
|
700
|
+
this._context = {};
|
|
702
701
|
this._events = {
|
|
703
702
|
$GET_OTHERS: {
|
|
704
703
|
resolver: {
|
|
@@ -799,6 +798,7 @@ var PluvIO = class _PluvIO {
|
|
|
799
798
|
}
|
|
800
799
|
}
|
|
801
800
|
};
|
|
801
|
+
this._getInitialStorage = null;
|
|
802
802
|
const {
|
|
803
803
|
authorize: authorize2,
|
|
804
804
|
context,
|
|
@@ -904,16 +904,20 @@ var PluvIO = class _PluvIO {
|
|
|
904
904
|
static merge(first, second) {
|
|
905
905
|
var _a;
|
|
906
906
|
const authorize2 = (_a = first._authorize) != null ? _a : void 0;
|
|
907
|
+
const context = first._context;
|
|
907
908
|
const debug = first._debug;
|
|
908
909
|
const platform = first._platform;
|
|
910
|
+
const getInitialStorage = first._getInitialStorage;
|
|
909
911
|
const events1 = first._events;
|
|
910
912
|
const events2 = second._events;
|
|
911
913
|
const { onRoomDeleted, onStorageUpdated } = first._listeners;
|
|
912
914
|
const events = Object.assign(/* @__PURE__ */ Object.create(null), events1, events2);
|
|
913
915
|
return new _PluvIO({
|
|
914
916
|
authorize: authorize2,
|
|
917
|
+
context,
|
|
915
918
|
debug,
|
|
916
919
|
events,
|
|
920
|
+
getInitialStorage,
|
|
917
921
|
onRoomDeleted,
|
|
918
922
|
onStorageUpdated,
|
|
919
923
|
platform
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/io",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"description": "@pluv/io server-side websocket manager",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"jose": "^4.14.4",
|
|
22
22
|
"kleur": "^4.1.5",
|
|
23
23
|
"wonka": "^6.3.4",
|
|
24
|
-
"@pluv/crdt-yjs": "^0.10.
|
|
25
|
-
"@pluv/types": "^0.10.
|
|
24
|
+
"@pluv/crdt-yjs": "^0.10.3",
|
|
25
|
+
"@pluv/types": "^0.10.3"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"yjs": "^13.0.0"
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"tsup": "^7.2.0",
|
|
33
33
|
"typescript": "^5.1.6",
|
|
34
34
|
"yjs": "^13.6.7",
|
|
35
|
-
"@pluv/tsconfig": "^0.10.
|
|
36
|
-
"eslint-config-pluv": "^0.
|
|
35
|
+
"@pluv/tsconfig": "^0.10.3",
|
|
36
|
+
"eslint-config-pluv": "^0.10.3"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/PluvIO.ts
CHANGED
|
@@ -107,8 +107,6 @@ export class PluvIO<
|
|
|
107
107
|
> implements
|
|
108
108
|
IOLike<TAuthorize, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>
|
|
109
109
|
{
|
|
110
|
-
private _context: TContext = {} as TContext;
|
|
111
|
-
private _getInitialStorage: GetInitialStorageFn<TPlatform> | null = null;
|
|
112
110
|
private _rooms = new Map<
|
|
113
111
|
string,
|
|
114
112
|
IORoom<
|
|
@@ -123,6 +121,7 @@ export class PluvIO<
|
|
|
123
121
|
>();
|
|
124
122
|
|
|
125
123
|
readonly _authorize: TAuthorize | null = null;
|
|
124
|
+
readonly _context: TContext = {} as TContext;
|
|
126
125
|
readonly _debug: boolean;
|
|
127
126
|
readonly _events: InferEventConfig<
|
|
128
127
|
TPlatform,
|
|
@@ -274,6 +273,7 @@ export class PluvIO<
|
|
|
274
273
|
TOutputSelf,
|
|
275
274
|
TOutputSync
|
|
276
275
|
>;
|
|
276
|
+
readonly _getInitialStorage: GetInitialStorageFn<TPlatform> | null = null;
|
|
277
277
|
readonly _listeners: PluvIOListeners<TPlatform>;
|
|
278
278
|
readonly _platform: TPlatform;
|
|
279
279
|
|
|
@@ -492,9 +492,15 @@ export class PluvIO<
|
|
|
492
492
|
> {
|
|
493
493
|
const authorize = (first._authorize ??
|
|
494
494
|
undefined) as InferIOAuthorize<TIO1>;
|
|
495
|
+
const context = first._context as InferIOContext<TIO1>;
|
|
495
496
|
const debug = first._debug;
|
|
496
497
|
const platform = first._platform as InferIOPlatform<TIO1>;
|
|
497
498
|
|
|
499
|
+
const getInitialStorage =
|
|
500
|
+
first._getInitialStorage as GetInitialStorageFn<
|
|
501
|
+
InferIOPlatform<TIO1>
|
|
502
|
+
>;
|
|
503
|
+
|
|
498
504
|
const events1 = first._events;
|
|
499
505
|
const events2 = second._events;
|
|
500
506
|
|
|
@@ -504,8 +510,10 @@ export class PluvIO<
|
|
|
504
510
|
|
|
505
511
|
return new PluvIO({
|
|
506
512
|
authorize,
|
|
513
|
+
context,
|
|
507
514
|
debug,
|
|
508
515
|
events,
|
|
516
|
+
getInitialStorage,
|
|
509
517
|
onRoomDeleted,
|
|
510
518
|
onStorageUpdated,
|
|
511
519
|
platform,
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type {
|
|
|
7
7
|
export { AbstractPersistance } from "./AbstractPersistance";
|
|
8
8
|
export { AbstractPlatform } from "./AbstractPlatform";
|
|
9
9
|
export type {
|
|
10
|
+
AbstractPlatformConfig,
|
|
10
11
|
ConvertWebSocketConfig,
|
|
11
12
|
InferPlatformEventContextType,
|
|
12
13
|
InferPlatformRoomContextType,
|