@pluv/platform-pluv 0.33.0 → 0.34.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @pluv/platform-pluv@0.33.0 build /home/runner/work/pluv/pluv/packages/platform-pluv
2
+ > @pluv/platform-pluv@0.34.0 build /home/runner/work/pluv/pluv/packages/platform-pluv
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,11 +8,11 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- CJS dist/index.js 9.75 KB
12
- CJS ⚡️ Build success in 100ms
13
- ESM dist/index.mjs 8.85 KB
14
- ESM ⚡️ Build success in 101ms
11
+ CJS dist/index.js 10.70 KB
12
+ CJS ⚡️ Build success in 82ms
13
+ ESM dist/index.mjs 9.82 KB
14
+ ESM ⚡️ Build success in 90ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 6378ms
17
- DTS dist/index.d.mts 6.99 KB
18
- DTS dist/index.d.ts 6.99 KB
16
+ DTS ⚡️ Build success in 6566ms
17
+ DTS dist/index.d.mts 2.91 KB
18
+ DTS dist/index.d.ts 2.91 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,63 @@
1
1
  # @pluv/platform-pluv
2
2
 
3
+ ## 0.34.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 70af3b2: **BREAKING**: The API has been updated to now be called as function `platformPluv` into `createIO` from `@pluv/io`.
8
+
9
+ ```ts
10
+ // Before
11
+
12
+ import { createIO } from "@pluv/platform-pluv";
13
+
14
+ export const io = createIO({
15
+ authorize: {
16
+ user: z.object({
17
+ id: z.string(),
18
+ }),
19
+ },
20
+ basePath: "/api/pluv",
21
+ publicKey: "pk_...",
22
+ secretKey: "sk_...",
23
+ webhookSecret: "whsec_...",
24
+ });
25
+
26
+ export const GET = pluv.handler;
27
+
28
+ // After
29
+
30
+ import { createIO } from "@pluv/io";
31
+ import { platformPluv } from "@pluv/platform-pluv";
32
+
33
+ export const io = createIO({
34
+ authorize: {
35
+ user: z.object({
36
+ id: z.string(),
37
+ }),
38
+ },
39
+ platform: platformPluv({
40
+ basePath: "/api/pluv",
41
+ publicKey: "pk_...",
42
+ secretKey: "sk_...",
43
+ webhookSecret: "whsec_...",
44
+ }),
45
+ });
46
+
47
+ export const ioServer = io.server();
48
+
49
+ // Example: If you're on Next.js
50
+ export const GET = ioServer.fetch;
51
+ ```
52
+
53
+ ### Patch Changes
54
+
55
+ - Updated dependencies [0c920ea]
56
+ - Updated dependencies [70af3b2]
57
+ - @pluv/io@0.34.0
58
+ - @pluv/crdt@0.34.0
59
+ - @pluv/types@0.34.0
60
+
3
61
  ## 0.33.0
4
62
 
5
63
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,27 +1,5 @@
1
- import { AbstractPlatform, WebSocketRegistrationMode, AbstractWebSocket, ConvertWebSocketConfig, WebSocketSerializedState, AbstractPlatformConfig, JWTEncodeParams, GetInitialStorageFn, BaseUser as BaseUser$1 } from '@pluv/io';
2
- import * as hono from 'hono';
3
- import { BaseUser, InputZodLike, IOLike } from '@pluv/types';
4
- import { z } from 'zod';
1
+ import { AbstractPlatform, JWTEncodeParams, AbstractWebSocket, ConvertWebSocketConfig, WebSocketSerializedState, AbstractPlatformConfig } from '@pluv/io';
5
2
 
6
- declare class PluvPlatform extends AbstractPlatform {
7
- _registrationMode: WebSocketRegistrationMode;
8
- acceptWebSocket(webSocket: AbstractWebSocket): Promise<void>;
9
- convertWebSocket(webSocket: any, config: ConvertWebSocketConfig): AbstractWebSocket;
10
- getLastPing(webSocket: AbstractWebSocket): number | null;
11
- getSerializedState(webSocket: any): WebSocketSerializedState | null;
12
- getSessionId(webSocket: any): string | null;
13
- getWebSockets(): readonly any[];
14
- initialize(config: AbstractPlatformConfig<{}>): this;
15
- parseData(data: string | ArrayBuffer): Record<string, any>;
16
- randomUUID(): string;
17
- setSerializedState(webSocket: AbstractWebSocket, state: WebSocketSerializedState): void;
18
- }
19
-
20
- interface PluvAuthorize<TUser extends BaseUser> {
21
- required: true;
22
- secret: string;
23
- user: InputZodLike<TUser>;
24
- }
25
3
  interface PluvIOEndpoints {
26
4
  createToken: string;
27
5
  }
@@ -29,30 +7,18 @@ type RoomDeletedMessageEventData = {
29
7
  encodedState: string | null;
30
8
  room: string;
31
9
  };
32
- type UserConnectedEventData<TUser extends BaseUser> = {
10
+ type UserConnectedEventData = {
33
11
  encodedState: string | null;
34
12
  room: string;
35
- user: TUser;
13
+ user: any;
36
14
  };
37
- type UserDisconnectedEventData<TUser extends BaseUser> = {
15
+ type UserDisconnectedEventData = {
38
16
  encodedState: string | null;
39
17
  room: string;
40
- user: TUser;
41
- };
42
- type PluvIOListeners<TUser extends BaseUser> = {
43
- getInitialStorage?: GetInitialStorageFn<{}>;
44
- onRoomDeleted: (event: RoomDeletedMessageEventData) => void;
45
- onUserConnected: (event: UserConnectedEventData<TUser>) => void;
46
- onUserDisconnected: (event: UserDisconnectedEventData<TUser>) => void;
18
+ user: any;
47
19
  };
48
- type WebhooksConfig<TUser extends BaseUser> = ({
49
- webhookSecret?: undefined;
50
- } & {
51
- [P in keyof PluvIOListeners<TUser>]?: undefined;
52
- }) | ({
53
- webhookSecret: string;
54
- } & Partial<PluvIOListeners<TUser>>);
55
- type PluvIOConfig<TUser extends BaseUser> = WebhooksConfig<TUser> & {
20
+
21
+ interface PluvPlatformConfig {
56
22
  /**
57
23
  * @ignore
58
24
  * @readonly
@@ -61,187 +27,68 @@ type PluvIOConfig<TUser extends BaseUser> = WebhooksConfig<TUser> & {
61
27
  _defs?: {
62
28
  endpoints?: PluvIOEndpoints;
63
29
  };
64
- authorize: {
65
- user: InputZodLike<TUser>;
66
- };
67
30
  basePath: string;
68
31
  publicKey: string;
69
32
  secretKey: string;
70
- };
71
- declare class PluvIO<TUser extends BaseUser> implements IOLike<PluvAuthorize<TUser>, {}> {
72
- private readonly _authorize;
33
+ webhookSecret?: string;
34
+ }
35
+ declare class PluvPlatform extends AbstractPlatform<any, {}, {}, {
36
+ authorize: {
37
+ required: false;
38
+ secret: false;
39
+ };
40
+ handleMode: "fetch";
41
+ registrationMode: "attached";
42
+ requireAuth: true;
43
+ listeners: {
44
+ onRoomDeleted: true;
45
+ onRoomMessage: false;
46
+ onStorageUpdated: false;
47
+ onUserConnected: true;
48
+ onUserDisconnected: true;
49
+ };
50
+ }> {
51
+ readonly _config: {
52
+ authorize: {
53
+ required: false;
54
+ secret: false;
55
+ };
56
+ handleMode: "fetch";
57
+ registrationMode: "attached";
58
+ requireAuth: true;
59
+ listeners: {
60
+ onRoomDeleted: true;
61
+ onRoomMessage: false;
62
+ onStorageUpdated: false;
63
+ onUserConnected: true;
64
+ onUserDisconnected: true;
65
+ };
66
+ };
67
+ readonly _name = "platformPluv";
68
+ private _authorize;
73
69
  private readonly _basePath;
74
70
  private readonly _endpoints;
75
- private readonly _getInitialStorage?;
76
- private readonly _listeners;
71
+ private _getInitialStorage?;
72
+ private _listeners?;
77
73
  private readonly _publicKey;
78
74
  private readonly _secretKey;
79
75
  private readonly _webhookSecret?;
80
- /**
81
- * @ignore
82
- * @readonly
83
- * @deprecated Internal use only. Changes to this will never be marked as breaking.
84
- */
85
- get _defs(): {
86
- authorize: PluvAuthorize<TUser>;
87
- context: {};
88
- events: {};
89
- readonly platform: void;
90
- };
91
- get fetch(): (request: Request, Env?: unknown, executionCtx?: hono.ExecutionContext) => Response | Promise<Response>;
92
- get handler(): (req: Request) => Response | Promise<Response>;
76
+ _createToken: (params: JWTEncodeParams<any, any>) => Promise<string>;
77
+ constructor(params: PluvPlatformConfig);
78
+ acceptWebSocket(webSocket: AbstractWebSocket): Promise<void>;
79
+ convertWebSocket(webSocket: any, config: ConvertWebSocketConfig): AbstractWebSocket;
80
+ getLastPing(webSocket: AbstractWebSocket): number | null;
81
+ getSerializedState(webSocket: any): WebSocketSerializedState | null;
82
+ getSessionId(webSocket: any): string | null;
83
+ getWebSockets(): readonly any[];
84
+ initialize(config: AbstractPlatformConfig<{}>): this;
85
+ parseData(data: string | ArrayBuffer): Record<string, any>;
86
+ randomUUID(): string;
87
+ setSerializedState(webSocket: AbstractWebSocket, state: WebSocketSerializedState): void;
88
+ validateConfig(config: any): void;
93
89
  private _webhooks;
94
- constructor(options: PluvIOConfig<TUser>);
95
- createToken(params: JWTEncodeParams<TUser, PluvPlatform>): Promise<string>;
96
90
  }
97
91
 
98
- declare const createIO: <TUser extends BaseUser$1>(config: PluvIOConfig<TUser>) => PluvIO<TUser>;
99
-
100
- declare const ZodEvent: z.ZodDiscriminatedUnion<"event", [z.ZodObject<{
101
- event: z.ZodLiteral<"initial-storage">;
102
- data: z.ZodObject<{
103
- room: z.ZodNullable<z.ZodString>;
104
- }, "strip", z.ZodTypeAny, {
105
- room: string | null;
106
- }, {
107
- room: string | null;
108
- }>;
109
- }, "strip", z.ZodTypeAny, {
110
- event: "initial-storage";
111
- data: {
112
- room: string | null;
113
- };
114
- }, {
115
- event: "initial-storage";
116
- data: {
117
- room: string | null;
118
- };
119
- }>, z.ZodObject<{
120
- event: z.ZodLiteral<"room-deleted">;
121
- data: z.ZodObject<{
122
- room: z.ZodString;
123
- storage: z.ZodNullable<z.ZodString>;
124
- }, "strip", z.ZodTypeAny, {
125
- room: string;
126
- storage: string | null;
127
- }, {
128
- room: string;
129
- storage: string | null;
130
- }>;
131
- }, "strip", z.ZodTypeAny, {
132
- event: "room-deleted";
133
- data: {
134
- room: string;
135
- storage: string | null;
136
- };
137
- }, {
138
- event: "room-deleted";
139
- data: {
140
- room: string;
141
- storage: string | null;
142
- };
143
- }>, z.ZodObject<{
144
- event: z.ZodLiteral<"user-connected">;
145
- data: z.ZodObject<{
146
- room: z.ZodString;
147
- storage: z.ZodNullable<z.ZodString>;
148
- user: z.ZodObject<{
149
- id: z.ZodString;
150
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
151
- id: z.ZodString;
152
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
153
- id: z.ZodString;
154
- }, z.ZodTypeAny, "passthrough">>;
155
- }, "strip", z.ZodTypeAny, {
156
- room: string;
157
- storage: string | null;
158
- user: {
159
- id: string;
160
- } & {
161
- [k: string]: unknown;
162
- };
163
- }, {
164
- room: string;
165
- storage: string | null;
166
- user: {
167
- id: string;
168
- } & {
169
- [k: string]: unknown;
170
- };
171
- }>;
172
- }, "strip", z.ZodTypeAny, {
173
- event: "user-connected";
174
- data: {
175
- room: string;
176
- storage: string | null;
177
- user: {
178
- id: string;
179
- } & {
180
- [k: string]: unknown;
181
- };
182
- };
183
- }, {
184
- event: "user-connected";
185
- data: {
186
- room: string;
187
- storage: string | null;
188
- user: {
189
- id: string;
190
- } & {
191
- [k: string]: unknown;
192
- };
193
- };
194
- }>, z.ZodObject<{
195
- event: z.ZodLiteral<"user-disconnected">;
196
- data: z.ZodObject<{
197
- room: z.ZodString;
198
- storage: z.ZodNullable<z.ZodString>;
199
- user: z.ZodObject<{
200
- id: z.ZodString;
201
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
202
- id: z.ZodString;
203
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
204
- id: z.ZodString;
205
- }, z.ZodTypeAny, "passthrough">>;
206
- }, "strip", z.ZodTypeAny, {
207
- room: string;
208
- storage: string | null;
209
- user: {
210
- id: string;
211
- } & {
212
- [k: string]: unknown;
213
- };
214
- }, {
215
- room: string;
216
- storage: string | null;
217
- user: {
218
- id: string;
219
- } & {
220
- [k: string]: unknown;
221
- };
222
- }>;
223
- }, "strip", z.ZodTypeAny, {
224
- event: "user-disconnected";
225
- data: {
226
- room: string;
227
- storage: string | null;
228
- user: {
229
- id: string;
230
- } & {
231
- [k: string]: unknown;
232
- };
233
- };
234
- }, {
235
- event: "user-disconnected";
236
- data: {
237
- room: string;
238
- storage: string | null;
239
- user: {
240
- id: string;
241
- } & {
242
- [k: string]: unknown;
243
- };
244
- };
245
- }>]>;
92
+ declare const platformPluv: (config: PluvPlatformConfig) => PluvPlatform;
246
93
 
247
- export { PluvIO, type PluvIOConfig, PluvPlatform, ZodEvent, createIO };
94
+ export { type PluvIOEndpoints, PluvPlatform, type RoomDeletedMessageEventData, type UserConnectedEventData, type UserDisconnectedEventData, platformPluv };
package/dist/index.d.ts CHANGED
@@ -1,27 +1,5 @@
1
- import { AbstractPlatform, WebSocketRegistrationMode, AbstractWebSocket, ConvertWebSocketConfig, WebSocketSerializedState, AbstractPlatformConfig, JWTEncodeParams, GetInitialStorageFn, BaseUser as BaseUser$1 } from '@pluv/io';
2
- import * as hono from 'hono';
3
- import { BaseUser, InputZodLike, IOLike } from '@pluv/types';
4
- import { z } from 'zod';
1
+ import { AbstractPlatform, JWTEncodeParams, AbstractWebSocket, ConvertWebSocketConfig, WebSocketSerializedState, AbstractPlatformConfig } from '@pluv/io';
5
2
 
6
- declare class PluvPlatform extends AbstractPlatform {
7
- _registrationMode: WebSocketRegistrationMode;
8
- acceptWebSocket(webSocket: AbstractWebSocket): Promise<void>;
9
- convertWebSocket(webSocket: any, config: ConvertWebSocketConfig): AbstractWebSocket;
10
- getLastPing(webSocket: AbstractWebSocket): number | null;
11
- getSerializedState(webSocket: any): WebSocketSerializedState | null;
12
- getSessionId(webSocket: any): string | null;
13
- getWebSockets(): readonly any[];
14
- initialize(config: AbstractPlatformConfig<{}>): this;
15
- parseData(data: string | ArrayBuffer): Record<string, any>;
16
- randomUUID(): string;
17
- setSerializedState(webSocket: AbstractWebSocket, state: WebSocketSerializedState): void;
18
- }
19
-
20
- interface PluvAuthorize<TUser extends BaseUser> {
21
- required: true;
22
- secret: string;
23
- user: InputZodLike<TUser>;
24
- }
25
3
  interface PluvIOEndpoints {
26
4
  createToken: string;
27
5
  }
@@ -29,30 +7,18 @@ type RoomDeletedMessageEventData = {
29
7
  encodedState: string | null;
30
8
  room: string;
31
9
  };
32
- type UserConnectedEventData<TUser extends BaseUser> = {
10
+ type UserConnectedEventData = {
33
11
  encodedState: string | null;
34
12
  room: string;
35
- user: TUser;
13
+ user: any;
36
14
  };
37
- type UserDisconnectedEventData<TUser extends BaseUser> = {
15
+ type UserDisconnectedEventData = {
38
16
  encodedState: string | null;
39
17
  room: string;
40
- user: TUser;
41
- };
42
- type PluvIOListeners<TUser extends BaseUser> = {
43
- getInitialStorage?: GetInitialStorageFn<{}>;
44
- onRoomDeleted: (event: RoomDeletedMessageEventData) => void;
45
- onUserConnected: (event: UserConnectedEventData<TUser>) => void;
46
- onUserDisconnected: (event: UserDisconnectedEventData<TUser>) => void;
18
+ user: any;
47
19
  };
48
- type WebhooksConfig<TUser extends BaseUser> = ({
49
- webhookSecret?: undefined;
50
- } & {
51
- [P in keyof PluvIOListeners<TUser>]?: undefined;
52
- }) | ({
53
- webhookSecret: string;
54
- } & Partial<PluvIOListeners<TUser>>);
55
- type PluvIOConfig<TUser extends BaseUser> = WebhooksConfig<TUser> & {
20
+
21
+ interface PluvPlatformConfig {
56
22
  /**
57
23
  * @ignore
58
24
  * @readonly
@@ -61,187 +27,68 @@ type PluvIOConfig<TUser extends BaseUser> = WebhooksConfig<TUser> & {
61
27
  _defs?: {
62
28
  endpoints?: PluvIOEndpoints;
63
29
  };
64
- authorize: {
65
- user: InputZodLike<TUser>;
66
- };
67
30
  basePath: string;
68
31
  publicKey: string;
69
32
  secretKey: string;
70
- };
71
- declare class PluvIO<TUser extends BaseUser> implements IOLike<PluvAuthorize<TUser>, {}> {
72
- private readonly _authorize;
33
+ webhookSecret?: string;
34
+ }
35
+ declare class PluvPlatform extends AbstractPlatform<any, {}, {}, {
36
+ authorize: {
37
+ required: false;
38
+ secret: false;
39
+ };
40
+ handleMode: "fetch";
41
+ registrationMode: "attached";
42
+ requireAuth: true;
43
+ listeners: {
44
+ onRoomDeleted: true;
45
+ onRoomMessage: false;
46
+ onStorageUpdated: false;
47
+ onUserConnected: true;
48
+ onUserDisconnected: true;
49
+ };
50
+ }> {
51
+ readonly _config: {
52
+ authorize: {
53
+ required: false;
54
+ secret: false;
55
+ };
56
+ handleMode: "fetch";
57
+ registrationMode: "attached";
58
+ requireAuth: true;
59
+ listeners: {
60
+ onRoomDeleted: true;
61
+ onRoomMessage: false;
62
+ onStorageUpdated: false;
63
+ onUserConnected: true;
64
+ onUserDisconnected: true;
65
+ };
66
+ };
67
+ readonly _name = "platformPluv";
68
+ private _authorize;
73
69
  private readonly _basePath;
74
70
  private readonly _endpoints;
75
- private readonly _getInitialStorage?;
76
- private readonly _listeners;
71
+ private _getInitialStorage?;
72
+ private _listeners?;
77
73
  private readonly _publicKey;
78
74
  private readonly _secretKey;
79
75
  private readonly _webhookSecret?;
80
- /**
81
- * @ignore
82
- * @readonly
83
- * @deprecated Internal use only. Changes to this will never be marked as breaking.
84
- */
85
- get _defs(): {
86
- authorize: PluvAuthorize<TUser>;
87
- context: {};
88
- events: {};
89
- readonly platform: void;
90
- };
91
- get fetch(): (request: Request, Env?: unknown, executionCtx?: hono.ExecutionContext) => Response | Promise<Response>;
92
- get handler(): (req: Request) => Response | Promise<Response>;
76
+ _createToken: (params: JWTEncodeParams<any, any>) => Promise<string>;
77
+ constructor(params: PluvPlatformConfig);
78
+ acceptWebSocket(webSocket: AbstractWebSocket): Promise<void>;
79
+ convertWebSocket(webSocket: any, config: ConvertWebSocketConfig): AbstractWebSocket;
80
+ getLastPing(webSocket: AbstractWebSocket): number | null;
81
+ getSerializedState(webSocket: any): WebSocketSerializedState | null;
82
+ getSessionId(webSocket: any): string | null;
83
+ getWebSockets(): readonly any[];
84
+ initialize(config: AbstractPlatformConfig<{}>): this;
85
+ parseData(data: string | ArrayBuffer): Record<string, any>;
86
+ randomUUID(): string;
87
+ setSerializedState(webSocket: AbstractWebSocket, state: WebSocketSerializedState): void;
88
+ validateConfig(config: any): void;
93
89
  private _webhooks;
94
- constructor(options: PluvIOConfig<TUser>);
95
- createToken(params: JWTEncodeParams<TUser, PluvPlatform>): Promise<string>;
96
90
  }
97
91
 
98
- declare const createIO: <TUser extends BaseUser$1>(config: PluvIOConfig<TUser>) => PluvIO<TUser>;
99
-
100
- declare const ZodEvent: z.ZodDiscriminatedUnion<"event", [z.ZodObject<{
101
- event: z.ZodLiteral<"initial-storage">;
102
- data: z.ZodObject<{
103
- room: z.ZodNullable<z.ZodString>;
104
- }, "strip", z.ZodTypeAny, {
105
- room: string | null;
106
- }, {
107
- room: string | null;
108
- }>;
109
- }, "strip", z.ZodTypeAny, {
110
- event: "initial-storage";
111
- data: {
112
- room: string | null;
113
- };
114
- }, {
115
- event: "initial-storage";
116
- data: {
117
- room: string | null;
118
- };
119
- }>, z.ZodObject<{
120
- event: z.ZodLiteral<"room-deleted">;
121
- data: z.ZodObject<{
122
- room: z.ZodString;
123
- storage: z.ZodNullable<z.ZodString>;
124
- }, "strip", z.ZodTypeAny, {
125
- room: string;
126
- storage: string | null;
127
- }, {
128
- room: string;
129
- storage: string | null;
130
- }>;
131
- }, "strip", z.ZodTypeAny, {
132
- event: "room-deleted";
133
- data: {
134
- room: string;
135
- storage: string | null;
136
- };
137
- }, {
138
- event: "room-deleted";
139
- data: {
140
- room: string;
141
- storage: string | null;
142
- };
143
- }>, z.ZodObject<{
144
- event: z.ZodLiteral<"user-connected">;
145
- data: z.ZodObject<{
146
- room: z.ZodString;
147
- storage: z.ZodNullable<z.ZodString>;
148
- user: z.ZodObject<{
149
- id: z.ZodString;
150
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
151
- id: z.ZodString;
152
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
153
- id: z.ZodString;
154
- }, z.ZodTypeAny, "passthrough">>;
155
- }, "strip", z.ZodTypeAny, {
156
- room: string;
157
- storage: string | null;
158
- user: {
159
- id: string;
160
- } & {
161
- [k: string]: unknown;
162
- };
163
- }, {
164
- room: string;
165
- storage: string | null;
166
- user: {
167
- id: string;
168
- } & {
169
- [k: string]: unknown;
170
- };
171
- }>;
172
- }, "strip", z.ZodTypeAny, {
173
- event: "user-connected";
174
- data: {
175
- room: string;
176
- storage: string | null;
177
- user: {
178
- id: string;
179
- } & {
180
- [k: string]: unknown;
181
- };
182
- };
183
- }, {
184
- event: "user-connected";
185
- data: {
186
- room: string;
187
- storage: string | null;
188
- user: {
189
- id: string;
190
- } & {
191
- [k: string]: unknown;
192
- };
193
- };
194
- }>, z.ZodObject<{
195
- event: z.ZodLiteral<"user-disconnected">;
196
- data: z.ZodObject<{
197
- room: z.ZodString;
198
- storage: z.ZodNullable<z.ZodString>;
199
- user: z.ZodObject<{
200
- id: z.ZodString;
201
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
202
- id: z.ZodString;
203
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
204
- id: z.ZodString;
205
- }, z.ZodTypeAny, "passthrough">>;
206
- }, "strip", z.ZodTypeAny, {
207
- room: string;
208
- storage: string | null;
209
- user: {
210
- id: string;
211
- } & {
212
- [k: string]: unknown;
213
- };
214
- }, {
215
- room: string;
216
- storage: string | null;
217
- user: {
218
- id: string;
219
- } & {
220
- [k: string]: unknown;
221
- };
222
- }>;
223
- }, "strip", z.ZodTypeAny, {
224
- event: "user-disconnected";
225
- data: {
226
- room: string;
227
- storage: string | null;
228
- user: {
229
- id: string;
230
- } & {
231
- [k: string]: unknown;
232
- };
233
- };
234
- }, {
235
- event: "user-disconnected";
236
- data: {
237
- room: string;
238
- storage: string | null;
239
- user: {
240
- id: string;
241
- } & {
242
- [k: string]: unknown;
243
- };
244
- };
245
- }>]>;
92
+ declare const platformPluv: (config: PluvPlatformConfig) => PluvPlatform;
246
93
 
247
- export { PluvIO, type PluvIOConfig, PluvPlatform, ZodEvent, createIO };
94
+ export { type PluvIOEndpoints, PluvPlatform, type RoomDeletedMessageEventData, type UserConnectedEventData, type UserDisconnectedEventData, platformPluv };