@pluv/client 0.35.0 → 0.35.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.
- package/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +15 -0
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/package.json +6 -6
- package/src/PluvClient.ts +2 -2
- package/src/PluvRoom.ts +4 -1
- package/src/createClient.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/client@0.35.
|
|
2
|
+
> @pluv/client@0.35.2 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.18 KB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in 90ms
|
|
13
11
|
[32mCJS[39m [1mdist/index.js [22m[32m48.48 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 142ms
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m47.18 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 145ms
|
|
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 3509ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m22.65 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m22.65 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @pluv/client
|
|
2
2
|
|
|
3
|
+
## 0.35.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [81cb692]
|
|
8
|
+
- @pluv/types@0.35.2
|
|
9
|
+
- @pluv/crdt@0.35.2
|
|
10
|
+
|
|
11
|
+
## 0.35.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- @pluv/crdt@0.35.1
|
|
16
|
+
- @pluv/types@0.35.1
|
|
17
|
+
|
|
3
18
|
## 0.35.0
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CrdtType, AbstractCrdtDoc, InferCrdtJson, AbstractCrdtDocFactory } from '@pluv/crdt';
|
|
2
2
|
export { CrdtType, InferCrdtJson } from '@pluv/crdt';
|
|
3
|
-
import { IOLike, InferIOOutput, Id, IOEventMessage, JsonObject, InferIOAuthorizeUser, InferIOAuthorize, EventRecord, MaybePromise, InputZodLike, ProcedureLike, IORouterLike, InferIOInput } from '@pluv/types';
|
|
3
|
+
import { IOLike, InferIOOutput, Id, IOEventMessage, JsonObject, InferIOAuthorizeUser, InferIOAuthorize, EventRecord, MaybePromise, InputZodLike, ProcedureLike, IORouterLike, InferIOInput, BaseUser } from '@pluv/types';
|
|
4
4
|
export { BaseUser, EventMessage, EventRecord, IOEventMessage } from '@pluv/types';
|
|
5
5
|
import { Subject } from 'wonka';
|
|
6
6
|
|
|
@@ -163,10 +163,10 @@ type FetchOptions = {
|
|
|
163
163
|
};
|
|
164
164
|
type RoomEndpoints<TIO extends IOLike, TMetadata extends JsonObject> = {
|
|
165
165
|
wsEndpoint?: WsEndpoint<TMetadata>;
|
|
166
|
-
} & (InferIOAuthorize<TIO
|
|
167
|
-
authEndpoint?: undefined;
|
|
168
|
-
} : {
|
|
166
|
+
} & (InferIOAuthorizeUser<InferIOAuthorize<TIO>> extends BaseUser ? {
|
|
169
167
|
authEndpoint: AuthEndpoint<TMetadata>;
|
|
168
|
+
} : {
|
|
169
|
+
authEndpoint?: undefined;
|
|
170
170
|
});
|
|
171
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>;
|
|
172
172
|
interface PluvRoomAddonInput<TIO extends IOLike = IOLike, TMetadata extends JsonObject = {}, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}> {
|
|
@@ -289,10 +289,10 @@ declare class PluvRoom<TIO extends IOLike<any, any>, TMetadata extends JsonObjec
|
|
|
289
289
|
|
|
290
290
|
declare const identity: <T extends unknown>(x: T) => T;
|
|
291
291
|
|
|
292
|
-
type InferCallback<TIO extends IOLike
|
|
292
|
+
type InferCallback<TIO extends IOLike<any, any>> = (i: typeof identity) => {
|
|
293
293
|
io: (io: TIO) => TIO;
|
|
294
294
|
};
|
|
295
|
-
type PluvClientOptions<TIO extends IOLike, TPresence extends JsonObject, TStorage extends Record<string, CrdtType<any, any>>, TMetadata extends JsonObject> = RoomEndpoints<TIO, TMetadata> & {
|
|
295
|
+
type PluvClientOptions<TIO extends IOLike<any, any>, TPresence extends JsonObject, TStorage extends Record<string, CrdtType<any, any>>, TMetadata extends JsonObject> = RoomEndpoints<TIO, TMetadata> & {
|
|
296
296
|
debug?: boolean;
|
|
297
297
|
infer: InferCallback<TIO>;
|
|
298
298
|
initialStorage?: AbstractCrdtDocFactory<TStorage>;
|
|
@@ -334,7 +334,7 @@ declare class PluvClient<TIO extends IOLike = IOLike, TPresence extends JsonObje
|
|
|
334
334
|
private _logDebug;
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
declare const createClient: <TIO extends IOLike
|
|
337
|
+
declare const createClient: <TIO extends IOLike<any, any>, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}, TMetadata extends JsonObject = {}>(options: PluvClientOptions<TIO, TPresence, TStorage, TMetadata>) => PluvClient<TIO, TPresence, TStorage, TMetadata>;
|
|
338
338
|
|
|
339
339
|
type MockedRoomEvents<TIO extends IOLike> = Partial<{
|
|
340
340
|
[P in keyof InferIOInput<TIO>]: (data: Id<InferIOInput<TIO>[P]>) => Partial<InferIOOutput<TIO>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CrdtType, AbstractCrdtDoc, InferCrdtJson, AbstractCrdtDocFactory } from '@pluv/crdt';
|
|
2
2
|
export { CrdtType, InferCrdtJson } from '@pluv/crdt';
|
|
3
|
-
import { IOLike, InferIOOutput, Id, IOEventMessage, JsonObject, InferIOAuthorizeUser, InferIOAuthorize, EventRecord, MaybePromise, InputZodLike, ProcedureLike, IORouterLike, InferIOInput } from '@pluv/types';
|
|
3
|
+
import { IOLike, InferIOOutput, Id, IOEventMessage, JsonObject, InferIOAuthorizeUser, InferIOAuthorize, EventRecord, MaybePromise, InputZodLike, ProcedureLike, IORouterLike, InferIOInput, BaseUser } from '@pluv/types';
|
|
4
4
|
export { BaseUser, EventMessage, EventRecord, IOEventMessage } from '@pluv/types';
|
|
5
5
|
import { Subject } from 'wonka';
|
|
6
6
|
|
|
@@ -163,10 +163,10 @@ type FetchOptions = {
|
|
|
163
163
|
};
|
|
164
164
|
type RoomEndpoints<TIO extends IOLike, TMetadata extends JsonObject> = {
|
|
165
165
|
wsEndpoint?: WsEndpoint<TMetadata>;
|
|
166
|
-
} & (InferIOAuthorize<TIO
|
|
167
|
-
authEndpoint?: undefined;
|
|
168
|
-
} : {
|
|
166
|
+
} & (InferIOAuthorizeUser<InferIOAuthorize<TIO>> extends BaseUser ? {
|
|
169
167
|
authEndpoint: AuthEndpoint<TMetadata>;
|
|
168
|
+
} : {
|
|
169
|
+
authEndpoint?: undefined;
|
|
170
170
|
});
|
|
171
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>;
|
|
172
172
|
interface PluvRoomAddonInput<TIO extends IOLike = IOLike, TMetadata extends JsonObject = {}, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}> {
|
|
@@ -289,10 +289,10 @@ declare class PluvRoom<TIO extends IOLike<any, any>, TMetadata extends JsonObjec
|
|
|
289
289
|
|
|
290
290
|
declare const identity: <T extends unknown>(x: T) => T;
|
|
291
291
|
|
|
292
|
-
type InferCallback<TIO extends IOLike
|
|
292
|
+
type InferCallback<TIO extends IOLike<any, any>> = (i: typeof identity) => {
|
|
293
293
|
io: (io: TIO) => TIO;
|
|
294
294
|
};
|
|
295
|
-
type PluvClientOptions<TIO extends IOLike, TPresence extends JsonObject, TStorage extends Record<string, CrdtType<any, any>>, TMetadata extends JsonObject> = RoomEndpoints<TIO, TMetadata> & {
|
|
295
|
+
type PluvClientOptions<TIO extends IOLike<any, any>, TPresence extends JsonObject, TStorage extends Record<string, CrdtType<any, any>>, TMetadata extends JsonObject> = RoomEndpoints<TIO, TMetadata> & {
|
|
296
296
|
debug?: boolean;
|
|
297
297
|
infer: InferCallback<TIO>;
|
|
298
298
|
initialStorage?: AbstractCrdtDocFactory<TStorage>;
|
|
@@ -334,7 +334,7 @@ declare class PluvClient<TIO extends IOLike = IOLike, TPresence extends JsonObje
|
|
|
334
334
|
private _logDebug;
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
declare const createClient: <TIO extends IOLike
|
|
337
|
+
declare const createClient: <TIO extends IOLike<any, any>, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}, TMetadata extends JsonObject = {}>(options: PluvClientOptions<TIO, TPresence, TStorage, TMetadata>) => PluvClient<TIO, TPresence, TStorage, TMetadata>;
|
|
338
338
|
|
|
339
339
|
type MockedRoomEvents<TIO extends IOLike> = Partial<{
|
|
340
340
|
[P in keyof InferIOInput<TIO>]: (data: Id<InferIOInput<TIO>[P]>) => Partial<InferIOOutput<TIO>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/client",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.2",
|
|
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.35.
|
|
22
|
-
"@pluv/types": "^0.35.
|
|
21
|
+
"@pluv/crdt": "^0.35.2",
|
|
22
|
+
"@pluv/types": "^0.35.2"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"eslint": "^8.57.1",
|
|
26
26
|
"tsup": "^8.3.5",
|
|
27
|
-
"typescript": "^5.7.
|
|
28
|
-
"@pluv/tsconfig": "^0.35.
|
|
29
|
-
"eslint-config-pluv": "^0.35.
|
|
27
|
+
"typescript": "^5.7.3",
|
|
28
|
+
"@pluv/tsconfig": "^0.35.2",
|
|
29
|
+
"eslint-config-pluv": "^0.35.2"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/PluvClient.ts
CHANGED
|
@@ -7,12 +7,12 @@ import type { PluvRouterEventConfig } from "./PluvRouter";
|
|
|
7
7
|
import { PluvRouter } from "./PluvRouter";
|
|
8
8
|
import type { identity } from "./utils";
|
|
9
9
|
|
|
10
|
-
export type InferCallback<TIO extends IOLike
|
|
10
|
+
export type InferCallback<TIO extends IOLike<any, any>> = (i: typeof identity) => {
|
|
11
11
|
io: (io: TIO) => TIO;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export type PluvClientOptions<
|
|
15
|
-
TIO extends IOLike,
|
|
15
|
+
TIO extends IOLike<any, any>,
|
|
16
16
|
TPresence extends JsonObject,
|
|
17
17
|
TStorage extends Record<string, CrdtType<any, any>>,
|
|
18
18
|
TMetadata extends JsonObject,
|
package/src/PluvRoom.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AbstractCrdtDoc, CrdtType, InferCrdtJson } from "@pluv/crdt";
|
|
2
2
|
import type {
|
|
3
3
|
BaseIOEventRecord,
|
|
4
|
+
BaseUser,
|
|
4
5
|
EventMessage,
|
|
5
6
|
IOEventMessage,
|
|
6
7
|
IOLike,
|
|
@@ -102,7 +103,9 @@ type FetchOptions = { url: string; options?: RequestInit };
|
|
|
102
103
|
|
|
103
104
|
export type RoomEndpoints<TIO extends IOLike, TMetadata extends JsonObject> = {
|
|
104
105
|
wsEndpoint?: WsEndpoint<TMetadata>;
|
|
105
|
-
} & (InferIOAuthorize<TIO
|
|
106
|
+
} & (InferIOAuthorizeUser<InferIOAuthorize<TIO>> extends BaseUser
|
|
107
|
+
? { authEndpoint: AuthEndpoint<TMetadata> }
|
|
108
|
+
: { authEndpoint?: undefined });
|
|
106
109
|
|
|
107
110
|
interface InternalListeners {
|
|
108
111
|
onAuthorizationFail: (error: Error) => void;
|
package/src/createClient.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { PluvClientOptions } from "./PluvClient";
|
|
|
4
4
|
import { PluvClient } from "./PluvClient";
|
|
5
5
|
|
|
6
6
|
export const createClient = <
|
|
7
|
-
TIO extends IOLike
|
|
7
|
+
TIO extends IOLike<any, any>,
|
|
8
8
|
TPresence extends JsonObject = {},
|
|
9
9
|
TStorage extends Record<string, CrdtType<any, any>> = {},
|
|
10
10
|
TMetadata extends JsonObject = {},
|