@pluv/platform-pluv 0.35.4 → 0.37.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 +9 -9
- package/CHANGELOG.md +60 -0
- package/dist/index.d.mts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +10 -2
- package/dist/index.mjs +10 -2
- package/package.json +10 -10
- package/src/PluvPlatform.ts +2 -0
- package/src/index.ts +1 -0
- package/src/platformPluv.ts +25 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/platform-pluv@0.
|
|
2
|
+
> @pluv/platform-pluv@0.37.0 build /home/runner/work/pluv/pluv/packages/platform-pluv
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v8.
|
|
7
|
+
[34mCLI[39m tsup v8.4.0
|
|
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[32m9.
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[32m10.
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m9.79 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 90ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m10.68 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 90ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 6612ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m3.54 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.54 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
1
|
# @pluv/platform-pluv
|
|
2
2
|
|
|
3
|
+
## 0.37.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5165be0: **BREAKING**
|
|
8
|
+
|
|
9
|
+
Updated the `platformPluv` function to return an entire `createIO` input object. Now `createIO` must be called with `platformPluv`'s return value as an input.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
// Before
|
|
13
|
+
|
|
14
|
+
import { createIO } from "@pluv/io";
|
|
15
|
+
import { platformPluv } from "@pluv/platform-pluv";
|
|
16
|
+
|
|
17
|
+
export const io = createIO({
|
|
18
|
+
authorize: {
|
|
19
|
+
// ...
|
|
20
|
+
},
|
|
21
|
+
context: {
|
|
22
|
+
// ...
|
|
23
|
+
},
|
|
24
|
+
platform: platformPluv({
|
|
25
|
+
// ...
|
|
26
|
+
}),
|
|
27
|
+
// ...
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// After
|
|
31
|
+
|
|
32
|
+
import { createIO } from "@pluv/io";
|
|
33
|
+
import { platformPluv } from "@pluv/platform-pluv";
|
|
34
|
+
|
|
35
|
+
export const io = createIO(
|
|
36
|
+
platformPluv({
|
|
37
|
+
authorize: {
|
|
38
|
+
// ...
|
|
39
|
+
},
|
|
40
|
+
context: {
|
|
41
|
+
// ...
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
);
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- 9b74abb: Improved type inference when calling `PluvIO.server` to not include options that are always undefined (i.e. are not allowed by the specified platform).
|
|
50
|
+
- Updated dependencies [9b74abb]
|
|
51
|
+
- @pluv/io@0.37.0
|
|
52
|
+
- @pluv/crdt@0.37.0
|
|
53
|
+
- @pluv/types@0.37.0
|
|
54
|
+
|
|
55
|
+
## 0.36.0
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- @pluv/crdt@0.36.0
|
|
60
|
+
- @pluv/io@0.36.0
|
|
61
|
+
- @pluv/types@0.36.0
|
|
62
|
+
|
|
3
63
|
## 0.35.4
|
|
4
64
|
|
|
5
65
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AbstractPlatform, JWTEncodeParams, AbstractWebSocket, ConvertWebSocketConfig, WebSocketSerializedState, AbstractPlatformConfig } from '@pluv/io';
|
|
1
|
+
import { AbstractPlatform, JWTEncodeParams, AbstractWebSocket, ConvertWebSocketConfig, WebSocketSerializedState, AbstractPlatformConfig, CreateIOParams, PluvIOAuthorize, InferInitContextType, PluvContext } from '@pluv/io';
|
|
2
|
+
import { BaseUser, Id } from '@pluv/types';
|
|
2
3
|
|
|
3
4
|
interface PluvIOEndpoints {
|
|
4
5
|
createToken: string;
|
|
@@ -46,6 +47,7 @@ declare class PluvPlatform extends AbstractPlatform<any, {}, {}, {
|
|
|
46
47
|
onUserConnected: true;
|
|
47
48
|
onUserDisconnected: true;
|
|
48
49
|
};
|
|
50
|
+
router: false;
|
|
49
51
|
}> {
|
|
50
52
|
readonly _config: {
|
|
51
53
|
authorize: {
|
|
@@ -61,6 +63,7 @@ declare class PluvPlatform extends AbstractPlatform<any, {}, {}, {
|
|
|
61
63
|
onUserConnected: true;
|
|
62
64
|
onUserDisconnected: true;
|
|
63
65
|
};
|
|
66
|
+
router: false;
|
|
64
67
|
};
|
|
65
68
|
readonly _name = "platformPluv";
|
|
66
69
|
private _authorize;
|
|
@@ -87,6 +90,10 @@ declare class PluvPlatform extends AbstractPlatform<any, {}, {}, {
|
|
|
87
90
|
private _webhooks;
|
|
88
91
|
}
|
|
89
92
|
|
|
90
|
-
|
|
93
|
+
type PlatformPluvCreateIOParams<TContext extends Record<string, any> = {}, TUser extends BaseUser = BaseUser> = Id<PluvPlatformConfig & Omit<CreateIOParams<PluvPlatform, TContext, TUser>, "authorize" | "context" | "platform"> & {
|
|
94
|
+
authorize: PluvIOAuthorize<PluvPlatform, TUser, InferInitContextType<PluvPlatform>>;
|
|
95
|
+
context?: PluvContext<PluvPlatform, TContext>;
|
|
96
|
+
}>;
|
|
97
|
+
declare const platformPluv: <TContext extends Record<string, any> = {}, TUser extends BaseUser = BaseUser>(config: PlatformPluvCreateIOParams<TContext, TUser>) => CreateIOParams<PluvPlatform, TContext, TUser>;
|
|
91
98
|
|
|
92
|
-
export { type PluvIOEndpoints, PluvPlatform, type RoomDeletedMessageEventData, type UserConnectedEventData, type UserDisconnectedEventData, platformPluv };
|
|
99
|
+
export { type PlatformPluvCreateIOParams, type PluvIOEndpoints, PluvPlatform, type RoomDeletedMessageEventData, type UserConnectedEventData, type UserDisconnectedEventData, platformPluv };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AbstractPlatform, JWTEncodeParams, AbstractWebSocket, ConvertWebSocketConfig, WebSocketSerializedState, AbstractPlatformConfig } from '@pluv/io';
|
|
1
|
+
import { AbstractPlatform, JWTEncodeParams, AbstractWebSocket, ConvertWebSocketConfig, WebSocketSerializedState, AbstractPlatformConfig, CreateIOParams, PluvIOAuthorize, InferInitContextType, PluvContext } from '@pluv/io';
|
|
2
|
+
import { BaseUser, Id } from '@pluv/types';
|
|
2
3
|
|
|
3
4
|
interface PluvIOEndpoints {
|
|
4
5
|
createToken: string;
|
|
@@ -46,6 +47,7 @@ declare class PluvPlatform extends AbstractPlatform<any, {}, {}, {
|
|
|
46
47
|
onUserConnected: true;
|
|
47
48
|
onUserDisconnected: true;
|
|
48
49
|
};
|
|
50
|
+
router: false;
|
|
49
51
|
}> {
|
|
50
52
|
readonly _config: {
|
|
51
53
|
authorize: {
|
|
@@ -61,6 +63,7 @@ declare class PluvPlatform extends AbstractPlatform<any, {}, {}, {
|
|
|
61
63
|
onUserConnected: true;
|
|
62
64
|
onUserDisconnected: true;
|
|
63
65
|
};
|
|
66
|
+
router: false;
|
|
64
67
|
};
|
|
65
68
|
readonly _name = "platformPluv";
|
|
66
69
|
private _authorize;
|
|
@@ -87,6 +90,10 @@ declare class PluvPlatform extends AbstractPlatform<any, {}, {}, {
|
|
|
87
90
|
private _webhooks;
|
|
88
91
|
}
|
|
89
92
|
|
|
90
|
-
|
|
93
|
+
type PlatformPluvCreateIOParams<TContext extends Record<string, any> = {}, TUser extends BaseUser = BaseUser> = Id<PluvPlatformConfig & Omit<CreateIOParams<PluvPlatform, TContext, TUser>, "authorize" | "context" | "platform"> & {
|
|
94
|
+
authorize: PluvIOAuthorize<PluvPlatform, TUser, InferInitContextType<PluvPlatform>>;
|
|
95
|
+
context?: PluvContext<PluvPlatform, TContext>;
|
|
96
|
+
}>;
|
|
97
|
+
declare const platformPluv: <TContext extends Record<string, any> = {}, TUser extends BaseUser = BaseUser>(config: PlatformPluvCreateIOParams<TContext, TUser>) => CreateIOParams<PluvPlatform, TContext, TUser>;
|
|
91
98
|
|
|
92
|
-
export { type PluvIOEndpoints, PluvPlatform, type RoomDeletedMessageEventData, type UserConnectedEventData, type UserDisconnectedEventData, platformPluv };
|
|
99
|
+
export { type PlatformPluvCreateIOParams, type PluvIOEndpoints, PluvPlatform, type RoomDeletedMessageEventData, type UserConnectedEventData, type UserDisconnectedEventData, platformPluv };
|
package/dist/index.js
CHANGED
|
@@ -177,7 +177,8 @@ var PluvPlatform = class extends import_io.AbstractPlatform {
|
|
|
177
177
|
onStorageUpdated: false,
|
|
178
178
|
onUserConnected: true,
|
|
179
179
|
onUserDisconnected: true
|
|
180
|
-
}
|
|
180
|
+
},
|
|
181
|
+
router: false
|
|
181
182
|
};
|
|
182
183
|
this._name = "platformPluv";
|
|
183
184
|
this._createToken = (params) => __async(this, null, function* () {
|
|
@@ -299,7 +300,14 @@ var PluvPlatform = class extends import_io.AbstractPlatform {
|
|
|
299
300
|
|
|
300
301
|
// src/platformPluv.ts
|
|
301
302
|
var platformPluv = (config) => {
|
|
302
|
-
|
|
303
|
+
const { authorize, context, crdt, debug } = config;
|
|
304
|
+
return {
|
|
305
|
+
authorize,
|
|
306
|
+
context,
|
|
307
|
+
crdt,
|
|
308
|
+
debug,
|
|
309
|
+
platform: new PluvPlatform(config)
|
|
310
|
+
};
|
|
303
311
|
};
|
|
304
312
|
// Annotate the CommonJS export names for ESM import in node:
|
|
305
313
|
0 && (module.exports = {
|
package/dist/index.mjs
CHANGED
|
@@ -159,7 +159,8 @@ var PluvPlatform = class extends AbstractPlatform {
|
|
|
159
159
|
onStorageUpdated: false,
|
|
160
160
|
onUserConnected: true,
|
|
161
161
|
onUserDisconnected: true
|
|
162
|
-
}
|
|
162
|
+
},
|
|
163
|
+
router: false
|
|
163
164
|
};
|
|
164
165
|
this._name = "platformPluv";
|
|
165
166
|
this._createToken = (params) => __async(this, null, function* () {
|
|
@@ -281,7 +282,14 @@ var PluvPlatform = class extends AbstractPlatform {
|
|
|
281
282
|
|
|
282
283
|
// src/platformPluv.ts
|
|
283
284
|
var platformPluv = (config) => {
|
|
284
|
-
|
|
285
|
+
const { authorize, context, crdt, debug } = config;
|
|
286
|
+
return {
|
|
287
|
+
authorize,
|
|
288
|
+
context,
|
|
289
|
+
crdt,
|
|
290
|
+
debug,
|
|
291
|
+
platform: new PluvPlatform(config)
|
|
292
|
+
};
|
|
285
293
|
};
|
|
286
294
|
export {
|
|
287
295
|
PluvPlatform,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/platform-pluv",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "@pluv/io adapter for pluv.io",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@types/node": "^22.13.
|
|
21
|
-
"hono": "^4.7.
|
|
20
|
+
"@types/node": "^22.13.7",
|
|
21
|
+
"hono": "^4.7.2",
|
|
22
22
|
"zod": "^3.24.2",
|
|
23
|
-
"@pluv/crdt": "^0.
|
|
24
|
-
"@pluv/io": "^0.
|
|
25
|
-
"@pluv/types": "^0.
|
|
23
|
+
"@pluv/crdt": "^0.37.0",
|
|
24
|
+
"@pluv/io": "^0.37.0",
|
|
25
|
+
"@pluv/types": "^0.37.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"eslint": "^8.57.1",
|
|
29
|
-
"tsup": "^8.
|
|
30
|
-
"typescript": "^5.
|
|
31
|
-
"@pluv/tsconfig": "^0.
|
|
32
|
-
"eslint-config-pluv": "^0.
|
|
29
|
+
"tsup": "^8.4.0",
|
|
30
|
+
"typescript": "^5.8.2",
|
|
31
|
+
"@pluv/tsconfig": "^0.37.0",
|
|
32
|
+
"eslint-config-pluv": "^0.37.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/PluvPlatform.ts
CHANGED
|
@@ -46,6 +46,7 @@ export class PluvPlatform extends AbstractPlatform<
|
|
|
46
46
|
onUserConnected: true;
|
|
47
47
|
onUserDisconnected: true;
|
|
48
48
|
};
|
|
49
|
+
router: false;
|
|
49
50
|
}
|
|
50
51
|
> {
|
|
51
52
|
public readonly _config = {
|
|
@@ -62,6 +63,7 @@ export class PluvPlatform extends AbstractPlatform<
|
|
|
62
63
|
onUserConnected: true as const,
|
|
63
64
|
onUserDisconnected: true as const,
|
|
64
65
|
},
|
|
66
|
+
router: false as const,
|
|
65
67
|
};
|
|
66
68
|
public readonly _name = "platformPluv";
|
|
67
69
|
|
package/src/index.ts
CHANGED
package/src/platformPluv.ts
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
|
+
import type { CreateIOParams, InferInitContextType, PluvContext, PluvIOAuthorize } from "@pluv/io";
|
|
2
|
+
import type { BaseUser, Id } from "@pluv/types";
|
|
1
3
|
import type { PluvPlatformConfig } from "./PluvPlatform";
|
|
2
4
|
import { PluvPlatform } from "./PluvPlatform";
|
|
3
5
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
+
export type PlatformPluvCreateIOParams<
|
|
7
|
+
TContext extends Record<string, any> = {},
|
|
8
|
+
TUser extends BaseUser = BaseUser,
|
|
9
|
+
> = Id<
|
|
10
|
+
PluvPlatformConfig &
|
|
11
|
+
Omit<CreateIOParams<PluvPlatform, TContext, TUser>, "authorize" | "context" | "platform"> & {
|
|
12
|
+
authorize: PluvIOAuthorize<PluvPlatform, TUser, InferInitContextType<PluvPlatform>>;
|
|
13
|
+
context?: PluvContext<PluvPlatform, TContext>;
|
|
14
|
+
}
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
export const platformPluv = <TContext extends Record<string, any> = {}, TUser extends BaseUser = BaseUser>(
|
|
18
|
+
config: PlatformPluvCreateIOParams<TContext, TUser>,
|
|
19
|
+
): CreateIOParams<PluvPlatform, TContext, TUser> => {
|
|
20
|
+
const { authorize, context, crdt, debug } = config;
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
authorize,
|
|
24
|
+
context,
|
|
25
|
+
crdt,
|
|
26
|
+
debug,
|
|
27
|
+
platform: new PluvPlatform(config),
|
|
28
|
+
};
|
|
6
29
|
};
|