@pluv/platform-pluv 0.32.6 → 0.32.7

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.32.6 build /home/runner/work/pluv/pluv/packages/platform-pluv
2
+ > @pluv/platform-pluv@0.32.7 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
- ESM dist/index.mjs 8.83 KB
12
- ESM ⚡️ Build success in 80ms
13
- CJS dist/index.js 9.70 KB
14
- CJS ⚡️ Build success in 81ms
11
+ ESM dist/index.mjs 8.84 KB
12
+ ESM ⚡️ Build success in 78ms
13
+ CJS dist/index.js 9.74 KB
14
+ CJS ⚡️ Build success in 80ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 6208ms
17
- DTS dist/index.d.mts 3.54 KB
18
- DTS dist/index.d.ts 3.54 KB
16
+ DTS ⚡️ Build success in 6515ms
17
+ DTS dist/index.d.mts 6.99 KB
18
+ DTS dist/index.d.ts 6.99 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @pluv/platform-pluv
2
2
 
3
+ ## 0.32.7
4
+
5
+ ### Patch Changes
6
+
7
+ - a9a1f7b: Export event schemas.
8
+ - @pluv/crdt@0.32.7
9
+ - @pluv/io@0.32.7
10
+ - @pluv/types@0.32.7
11
+
3
12
  ## 0.32.6
4
13
 
5
14
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { AbstractPlatform, WebSocketRegistrationMode, AbstractWebSocket, ConvertWebSocketConfig, WebSocketSerializedState, AbstractPlatformConfig, JWTEncodeParams, GetInitialStorageFn, BaseUser as BaseUser$1 } from '@pluv/io';
2
2
  import * as hono from 'hono';
3
3
  import { BaseUser, InputZodLike, IOLike } from '@pluv/types';
4
+ import { z } from 'zod';
4
5
 
5
6
  declare class PluvPlatform extends AbstractPlatform {
6
7
  _registrationMode: WebSocketRegistrationMode;
@@ -96,4 +97,151 @@ declare class PluvIO<TUser extends BaseUser> implements IOLike<PluvAuthorize<TUs
96
97
 
97
98
  declare const createIO: <TUser extends BaseUser$1>(config: PluvIOConfig<TUser>) => PluvIO<TUser>;
98
99
 
99
- export { PluvIO, type PluvIOConfig, PluvPlatform, createIO };
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
+ }>]>;
246
+
247
+ export { PluvIO, type PluvIOConfig, PluvPlatform, ZodEvent, createIO };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { AbstractPlatform, WebSocketRegistrationMode, AbstractWebSocket, ConvertWebSocketConfig, WebSocketSerializedState, AbstractPlatformConfig, JWTEncodeParams, GetInitialStorageFn, BaseUser as BaseUser$1 } from '@pluv/io';
2
2
  import * as hono from 'hono';
3
3
  import { BaseUser, InputZodLike, IOLike } from '@pluv/types';
4
+ import { z } from 'zod';
4
5
 
5
6
  declare class PluvPlatform extends AbstractPlatform {
6
7
  _registrationMode: WebSocketRegistrationMode;
@@ -96,4 +97,151 @@ declare class PluvIO<TUser extends BaseUser> implements IOLike<PluvAuthorize<TUs
96
97
 
97
98
  declare const createIO: <TUser extends BaseUser$1>(config: PluvIOConfig<TUser>) => PluvIO<TUser>;
98
99
 
99
- export { PluvIO, type PluvIOConfig, PluvPlatform, createIO };
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
+ }>]>;
246
+
247
+ export { PluvIO, type PluvIOConfig, PluvPlatform, ZodEvent, createIO };
package/dist/index.js CHANGED
@@ -54,6 +54,7 @@ var __async = (__this, __arguments, generator) => {
54
54
  // src/index.ts
55
55
  var src_exports = {};
56
56
  __export(src_exports, {
57
+ ZodEvent: () => ZodEvent,
57
58
  createIO: () => createIO
58
59
  });
59
60
  module.exports = __toCommonJS(src_exports);
@@ -289,5 +290,6 @@ var createIO = (config) => {
289
290
  };
290
291
  // Annotate the CommonJS export names for ESM import in node:
291
292
  0 && (module.exports = {
293
+ ZodEvent,
292
294
  createIO
293
295
  });
package/dist/index.mjs CHANGED
@@ -271,5 +271,6 @@ var createIO = (config) => {
271
271
  return new PluvIO(config);
272
272
  };
273
273
  export {
274
+ ZodEvent,
274
275
  createIO
275
276
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/platform-pluv",
3
- "version": "0.32.6",
3
+ "version": "0.32.7",
4
4
  "description": "@pluv/io adapter for pluv.io",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -20,16 +20,16 @@
20
20
  "@types/node": "^22.8.1",
21
21
  "hono": "^4.6.7",
22
22
  "zod": "^3.23.8",
23
- "@pluv/crdt": "^0.32.6",
24
- "@pluv/io": "^0.32.6",
25
- "@pluv/types": "^0.32.6"
23
+ "@pluv/crdt": "^0.32.7",
24
+ "@pluv/io": "^0.32.7",
25
+ "@pluv/types": "^0.32.7"
26
26
  },
27
27
  "devDependencies": {
28
28
  "eslint": "^8.57.0",
29
29
  "tsup": "^8.3.5",
30
30
  "typescript": "^5.6.3",
31
- "@pluv/tsconfig": "^0.32.6",
32
- "eslint-config-pluv": "^0.32.6"
31
+ "eslint-config-pluv": "^0.32.7",
32
+ "@pluv/tsconfig": "^0.32.7"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "tsup src/index.ts --format esm,cjs --dts",
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { createIO } from "./createIO";
2
2
  export type { PluvIO, PluvIOConfig } from "./PluvIO";
3
3
  export type { PluvPlatform } from "./PluvPlatform";
4
+ export { ZodEvent } from "./schemas";