@pluv/client 0.34.1 → 0.35.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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +7 -0
- package/dist/index.d.mts +6 -7
- package/dist/index.d.ts +6 -7
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
- package/src/PluvRoom.ts +3 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/client@0.
|
|
2
|
+
> @pluv/client@0.35.0 build /home/runner/work/pluv/pluv/packages/client
|
|
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[32m47.
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[32m48.
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m47.18 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 90ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m48.48 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 91ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m22.
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m22.
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 3640ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m22.61 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m22.61 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CrdtType, AbstractCrdtDoc, InferCrdtJson, AbstractCrdtDocFactory } from '@pluv/crdt';
|
|
2
2
|
export { CrdtType, InferCrdtJson } from '@pluv/crdt';
|
|
3
|
-
import
|
|
4
|
-
import { IOLike, InferIOOutput, Id, IOEventMessage, JsonObject, InferIOAuthorizeUser, InferIOAuthorize, EventRecord, MaybePromise, InputZodLike, ProcedureLike, IORouterLike, InferIOInput, InferIOAuthorizeRequired } from '@pluv/types';
|
|
3
|
+
import { IOLike, InferIOOutput, Id, IOEventMessage, JsonObject, InferIOAuthorizeUser, InferIOAuthorize, EventRecord, MaybePromise, InputZodLike, ProcedureLike, IORouterLike, InferIOInput } from '@pluv/types';
|
|
5
4
|
export { BaseUser, EventMessage, EventRecord, IOEventMessage } from '@pluv/types';
|
|
6
5
|
import { Subject } from 'wonka';
|
|
7
6
|
|
|
@@ -164,10 +163,10 @@ type FetchOptions = {
|
|
|
164
163
|
};
|
|
165
164
|
type RoomEndpoints<TIO extends IOLike, TMetadata extends JsonObject> = {
|
|
166
165
|
wsEndpoint?: WsEndpoint<TMetadata>;
|
|
167
|
-
} & (
|
|
168
|
-
authEndpoint: AuthEndpoint<TMetadata>;
|
|
169
|
-
} : {
|
|
166
|
+
} & (InferIOAuthorize<TIO> extends null ? {
|
|
170
167
|
authEndpoint?: undefined;
|
|
168
|
+
} : {
|
|
169
|
+
authEndpoint: AuthEndpoint<TMetadata>;
|
|
171
170
|
});
|
|
172
171
|
type PluvRoomAddon<TIO extends IOLike = IOLike, TMetadata extends JsonObject = {}, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}> = (input: PluvRoomAddonInput<TIO, TMetadata, TPresence, TStorage>) => Partial<PluvRoomAddonResult>;
|
|
173
172
|
interface PluvRoomAddonInput<TIO extends IOLike = IOLike, TMetadata extends JsonObject = {}, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}> {
|
|
@@ -191,7 +190,7 @@ type RoomConfig<TIO extends IOLike, TMetadata extends JsonObject = {}, TPresence
|
|
|
191
190
|
} : {
|
|
192
191
|
metadata: TMetadata;
|
|
193
192
|
})>;
|
|
194
|
-
declare class PluvRoom<TIO extends IOLike, TMetadata extends JsonObject = {}, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}, TEvents extends PluvRouterEventConfig<TIO, TPresence, TStorage> = {}> extends AbstractRoom<TIO, TPresence, TStorage> {
|
|
193
|
+
declare class PluvRoom<TIO extends IOLike<any, any>, TMetadata extends JsonObject = {}, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}, TEvents extends PluvRouterEventConfig<TIO, TPresence, TStorage> = {}> extends AbstractRoom<TIO, TPresence, TStorage> {
|
|
195
194
|
readonly _endpoints: RoomEndpoints<TIO, TMetadata>;
|
|
196
195
|
private readonly _crdtManager;
|
|
197
196
|
private readonly _crdtNotifier;
|
|
@@ -335,7 +334,7 @@ declare class PluvClient<TIO extends IOLike = IOLike, TPresence extends JsonObje
|
|
|
335
334
|
private _logDebug;
|
|
336
335
|
}
|
|
337
336
|
|
|
338
|
-
declare const createClient: <TIO extends IOLike = IOLike<
|
|
337
|
+
declare const createClient: <TIO extends IOLike = IOLike<null, {}>, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}, TMetadata extends JsonObject = {}>(options: PluvClientOptions<TIO, TPresence, TStorage, TMetadata>) => PluvClient<TIO, TPresence, TStorage, TMetadata>;
|
|
339
338
|
|
|
340
339
|
type MockedRoomEvents<TIO extends IOLike> = Partial<{
|
|
341
340
|
[P in keyof InferIOInput<TIO>]: (data: Id<InferIOInput<TIO>[P]>) => Partial<InferIOOutput<TIO>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CrdtType, AbstractCrdtDoc, InferCrdtJson, AbstractCrdtDocFactory } from '@pluv/crdt';
|
|
2
2
|
export { CrdtType, InferCrdtJson } from '@pluv/crdt';
|
|
3
|
-
import
|
|
4
|
-
import { IOLike, InferIOOutput, Id, IOEventMessage, JsonObject, InferIOAuthorizeUser, InferIOAuthorize, EventRecord, MaybePromise, InputZodLike, ProcedureLike, IORouterLike, InferIOInput, InferIOAuthorizeRequired } from '@pluv/types';
|
|
3
|
+
import { IOLike, InferIOOutput, Id, IOEventMessage, JsonObject, InferIOAuthorizeUser, InferIOAuthorize, EventRecord, MaybePromise, InputZodLike, ProcedureLike, IORouterLike, InferIOInput } from '@pluv/types';
|
|
5
4
|
export { BaseUser, EventMessage, EventRecord, IOEventMessage } from '@pluv/types';
|
|
6
5
|
import { Subject } from 'wonka';
|
|
7
6
|
|
|
@@ -164,10 +163,10 @@ type FetchOptions = {
|
|
|
164
163
|
};
|
|
165
164
|
type RoomEndpoints<TIO extends IOLike, TMetadata extends JsonObject> = {
|
|
166
165
|
wsEndpoint?: WsEndpoint<TMetadata>;
|
|
167
|
-
} & (
|
|
168
|
-
authEndpoint: AuthEndpoint<TMetadata>;
|
|
169
|
-
} : {
|
|
166
|
+
} & (InferIOAuthorize<TIO> extends null ? {
|
|
170
167
|
authEndpoint?: undefined;
|
|
168
|
+
} : {
|
|
169
|
+
authEndpoint: AuthEndpoint<TMetadata>;
|
|
171
170
|
});
|
|
172
171
|
type PluvRoomAddon<TIO extends IOLike = IOLike, TMetadata extends JsonObject = {}, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}> = (input: PluvRoomAddonInput<TIO, TMetadata, TPresence, TStorage>) => Partial<PluvRoomAddonResult>;
|
|
173
172
|
interface PluvRoomAddonInput<TIO extends IOLike = IOLike, TMetadata extends JsonObject = {}, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}> {
|
|
@@ -191,7 +190,7 @@ type RoomConfig<TIO extends IOLike, TMetadata extends JsonObject = {}, TPresence
|
|
|
191
190
|
} : {
|
|
192
191
|
metadata: TMetadata;
|
|
193
192
|
})>;
|
|
194
|
-
declare class PluvRoom<TIO extends IOLike, TMetadata extends JsonObject = {}, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}, TEvents extends PluvRouterEventConfig<TIO, TPresence, TStorage> = {}> extends AbstractRoom<TIO, TPresence, TStorage> {
|
|
193
|
+
declare class PluvRoom<TIO extends IOLike<any, any>, TMetadata extends JsonObject = {}, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}, TEvents extends PluvRouterEventConfig<TIO, TPresence, TStorage> = {}> extends AbstractRoom<TIO, TPresence, TStorage> {
|
|
195
194
|
readonly _endpoints: RoomEndpoints<TIO, TMetadata>;
|
|
196
195
|
private readonly _crdtManager;
|
|
197
196
|
private readonly _crdtNotifier;
|
|
@@ -335,7 +334,7 @@ declare class PluvClient<TIO extends IOLike = IOLike, TPresence extends JsonObje
|
|
|
335
334
|
private _logDebug;
|
|
336
335
|
}
|
|
337
336
|
|
|
338
|
-
declare const createClient: <TIO extends IOLike = IOLike<
|
|
337
|
+
declare const createClient: <TIO extends IOLike = IOLike<null, {}>, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}, TMetadata extends JsonObject = {}>(options: PluvClientOptions<TIO, TPresence, TStorage, TMetadata>) => PluvClient<TIO, TPresence, TStorage, TMetadata>;
|
|
339
338
|
|
|
340
339
|
type MockedRoomEvents<TIO extends IOLike> = Partial<{
|
|
341
340
|
[P in keyof InferIOInput<TIO>]: (data: Id<InferIOInput<TIO>[P]>) => Partial<InferIOOutput<TIO>>;
|
package/dist/index.js
CHANGED
|
@@ -890,7 +890,7 @@ var PluvRoom = class extends AbstractRoom {
|
|
|
890
890
|
this._updateState((oldState) => {
|
|
891
891
|
oldState.connection.count += 1;
|
|
892
892
|
oldState.connection.id = connectionId;
|
|
893
|
-
oldState.authorization.user = user;
|
|
893
|
+
oldState.authorization.user = user != null ? user : null;
|
|
894
894
|
return oldState;
|
|
895
895
|
});
|
|
896
896
|
this._usersManager.setMyself(connectionId, user);
|
package/dist/index.mjs
CHANGED
|
@@ -860,7 +860,7 @@ var PluvRoom = class extends AbstractRoom {
|
|
|
860
860
|
this._updateState((oldState) => {
|
|
861
861
|
oldState.connection.count += 1;
|
|
862
862
|
oldState.connection.id = connectionId;
|
|
863
|
-
oldState.authorization.user = user;
|
|
863
|
+
oldState.authorization.user = user != null ? user : null;
|
|
864
864
|
return oldState;
|
|
865
865
|
});
|
|
866
866
|
this._usersManager.setMyself(connectionId, user);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "@pluv/io frontend client",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"wonka": "^6.3.4",
|
|
21
|
-
"@pluv/crdt": "^0.
|
|
22
|
-
"@pluv/types": "^0.
|
|
21
|
+
"@pluv/crdt": "^0.35.0",
|
|
22
|
+
"@pluv/types": "^0.35.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"eslint": "^8.57.1",
|
|
26
26
|
"tsup": "^8.3.5",
|
|
27
27
|
"typescript": "^5.7.2",
|
|
28
|
-
"@pluv/tsconfig": "^0.
|
|
29
|
-
"eslint-config-pluv": "^0.
|
|
28
|
+
"@pluv/tsconfig": "^0.35.0",
|
|
29
|
+
"eslint-config-pluv": "^0.35.0"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/PluvRoom.ts
CHANGED
|
@@ -6,7 +6,6 @@ import type {
|
|
|
6
6
|
IOLike,
|
|
7
7
|
Id,
|
|
8
8
|
InferIOAuthorize,
|
|
9
|
-
InferIOAuthorizeRequired,
|
|
10
9
|
InferIOAuthorizeUser,
|
|
11
10
|
InferIOInput,
|
|
12
11
|
InferIOOutput,
|
|
@@ -103,9 +102,7 @@ type FetchOptions = { url: string; options?: RequestInit };
|
|
|
103
102
|
|
|
104
103
|
export type RoomEndpoints<TIO extends IOLike, TMetadata extends JsonObject> = {
|
|
105
104
|
wsEndpoint?: WsEndpoint<TMetadata>;
|
|
106
|
-
} & (
|
|
107
|
-
? { authEndpoint: AuthEndpoint<TMetadata> }
|
|
108
|
-
: { authEndpoint?: undefined });
|
|
105
|
+
} & (InferIOAuthorize<TIO> extends null ? { authEndpoint?: undefined } : { authEndpoint: AuthEndpoint<TMetadata> });
|
|
109
106
|
|
|
110
107
|
interface InternalListeners {
|
|
111
108
|
onAuthorizationFail: (error: Error) => void;
|
|
@@ -156,7 +153,7 @@ export type RoomConfig<
|
|
|
156
153
|
>;
|
|
157
154
|
|
|
158
155
|
export class PluvRoom<
|
|
159
|
-
TIO extends IOLike,
|
|
156
|
+
TIO extends IOLike<any, any>,
|
|
160
157
|
TMetadata extends JsonObject = {},
|
|
161
158
|
TPresence extends JsonObject = {},
|
|
162
159
|
TStorage extends Record<string, CrdtType<any, any>> = {},
|
|
@@ -823,7 +820,7 @@ export class PluvRoom<
|
|
|
823
820
|
this._updateState((oldState) => {
|
|
824
821
|
oldState.connection.count += 1;
|
|
825
822
|
oldState.connection.id = connectionId;
|
|
826
|
-
oldState.authorization.user = user;
|
|
823
|
+
oldState.authorization.user = user ?? null;
|
|
827
824
|
|
|
828
825
|
return oldState;
|
|
829
826
|
});
|