@pluv/platform-pluv 2.2.0 → 2.2.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.
@@ -1,18 +1,18 @@
1
1
 
2
- > @pluv/platform-pluv@2.2.0 build /home/runner/work/pluv/pluv/packages/platform-pluv
2
+ > @pluv/platform-pluv@2.2.2 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
6
6
  CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.4.0
7
+ CLI tsup v8.5.0
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- ESM dist/index.mjs 12.46 KB
12
- ESM ⚡️ Build success in 83ms
13
- CJS dist/index.js 14.29 KB
14
- CJS ⚡️ Build success in 81ms
11
+ CJS dist/index.js 14.25 KB
12
+ CJS ⚡️ Build success in 96ms
13
+ ESM dist/index.mjs 12.42 KB
14
+ ESM ⚡️ Build success in 99ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 7205ms
17
- DTS dist/index.d.mts 3.67 KB
18
- DTS dist/index.d.ts 3.67 KB
16
+ DTS ⚡️ Build success in 5981ms
17
+ DTS dist/index.d.mts 3.65 KB
18
+ DTS dist/index.d.ts 3.65 KB
package/CHANGELOG.md CHANGED
@@ -1,13 +1,30 @@
1
1
  # @pluv/platform-pluv
2
2
 
3
+ ## 2.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - @pluv/crdt@2.2.2
8
+ - @pluv/io@2.2.2
9
+ - @pluv/types@2.2.2
10
+
11
+ ## 2.2.1
12
+
13
+ ### Patch Changes
14
+
15
+ - 6563957: Fix `createToken` throwing a TypeError.
16
+ - @pluv/crdt@2.2.1
17
+ - @pluv/io@2.2.1
18
+ - @pluv/types@2.2.1
19
+
3
20
  ## 2.2.0
4
21
 
5
22
  ### Patch Changes
6
23
 
7
24
  - Updated dependencies [cb660cd]
8
- - @pluv/io@2.2.0
9
- - @pluv/crdt@2.2.0
10
- - @pluv/types@2.2.0
25
+ - @pluv/io@2.2.0
26
+ - @pluv/crdt@2.2.0
27
+ - @pluv/types@2.2.0
11
28
 
12
29
  ## 2.1.0
13
30
 
@@ -38,9 +55,9 @@
38
55
  ### Patch Changes
39
56
 
40
57
  - Updated dependencies [047a1d8]
41
- - @pluv/types@2.0.0
42
- - @pluv/crdt@2.0.0
43
- - @pluv/io@2.0.0
58
+ - @pluv/types@2.0.0
59
+ - @pluv/crdt@2.0.0
60
+ - @pluv/io@2.0.0
44
61
 
45
62
  ## 1.0.2
46
63
 
@@ -55,9 +72,9 @@
55
72
  ### Patch Changes
56
73
 
57
74
  - Updated dependencies [c583be9]
58
- - @pluv/io@1.0.1
59
- - @pluv/crdt@1.0.1
60
- - @pluv/types@1.0.1
75
+ - @pluv/io@1.0.1
76
+ - @pluv/crdt@1.0.1
77
+ - @pluv/types@1.0.1
61
78
 
62
79
  ## 1.0.0
63
80
 
@@ -65,16 +82,16 @@
65
82
 
66
83
  - af94706: pluv.io is now stable and production ready!
67
84
 
68
- With this v1 release, pluv.io will now follow [semantic versioning](https://semver.org/) with more comprehensive release notes for future changes to the library.
85
+ With this v1 release, pluv.io will now follow [semantic versioning](https://semver.org/) with more comprehensive release notes for future changes to the library.
69
86
 
70
- Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
87
+ Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
71
88
 
72
89
  ### Patch Changes
73
90
 
74
91
  - Updated dependencies [af94706]
75
- - @pluv/crdt@1.0.0
76
- - @pluv/io@1.0.0
77
- - @pluv/types@1.0.0
92
+ - @pluv/crdt@1.0.0
93
+ - @pluv/io@1.0.0
94
+ - @pluv/types@1.0.0
78
95
 
79
96
  ## 0.44.2
80
97
 
@@ -108,9 +125,9 @@
108
125
  - Updated dependencies [0063e80]
109
126
  - Updated dependencies [244a973]
110
127
  - Updated dependencies [4b0fbb3]
111
- - @pluv/io@0.43.0
112
- - @pluv/crdt@0.43.0
113
- - @pluv/types@0.43.0
128
+ - @pluv/io@0.43.0
129
+ - @pluv/crdt@0.43.0
130
+ - @pluv/types@0.43.0
114
131
 
115
132
  ## 0.42.0
116
133
 
@@ -118,18 +135,18 @@
118
135
 
119
136
  - def08bc: Fix default endpoint for `createToken`.
120
137
  - Updated dependencies [cf1529a]
121
- - @pluv/io@0.42.0
122
- - @pluv/crdt@0.42.0
123
- - @pluv/types@0.42.0
138
+ - @pluv/io@0.42.0
139
+ - @pluv/crdt@0.42.0
140
+ - @pluv/types@0.42.0
124
141
 
125
142
  ## 0.41.7
126
143
 
127
144
  ### Patch Changes
128
145
 
129
146
  - c698c24: Update hidden endpoints parameter to be provided as a function.
130
- - @pluv/crdt@0.41.7
131
- - @pluv/io@0.41.7
132
- - @pluv/types@0.41.7
147
+ - @pluv/crdt@0.41.7
148
+ - @pluv/io@0.41.7
149
+ - @pluv/types@0.41.7
133
150
 
134
151
  ## 0.41.6
135
152
 
@@ -152,18 +169,18 @@
152
169
  ### Patch Changes
153
170
 
154
171
  - 8857e8e: Added the ability to use functions to return public keys, secret keys and webhook secrets for `@pluv/platform-pluv`.
155
- - @pluv/crdt@0.41.4
156
- - @pluv/io@0.41.4
157
- - @pluv/types@0.41.4
172
+ - @pluv/crdt@0.41.4
173
+ - @pluv/io@0.41.4
174
+ - @pluv/types@0.41.4
158
175
 
159
176
  ## 0.41.3
160
177
 
161
178
  ### Patch Changes
162
179
 
163
180
  - Updated dependencies [49051c0]
164
- - @pluv/io@0.41.3
165
- - @pluv/crdt@0.41.3
166
- - @pluv/types@0.41.3
181
+ - @pluv/io@0.41.3
182
+ - @pluv/crdt@0.41.3
183
+ - @pluv/types@0.41.3
167
184
 
168
185
  ## 0.41.2
169
186
 
@@ -192,9 +209,9 @@
192
209
  - Updated dependencies [555b88d]
193
210
  - Updated dependencies [a663c65]
194
211
  - Updated dependencies [555b88d]
195
- - @pluv/io@0.41.0
196
- - @pluv/crdt@0.41.0
197
- - @pluv/types@0.41.0
212
+ - @pluv/io@0.41.0
213
+ - @pluv/crdt@0.41.0
214
+ - @pluv/types@0.41.0
198
215
 
199
216
  ## 0.40.2
200
217
 
@@ -234,9 +251,9 @@
234
251
 
235
252
  - Updated dependencies [fe6e239]
236
253
  - Updated dependencies [737d508]
237
- - @pluv/io@0.39.0
238
- - @pluv/crdt@0.39.0
239
- - @pluv/types@0.39.0
254
+ - @pluv/io@0.39.0
255
+ - @pluv/crdt@0.39.0
256
+ - @pluv/types@0.39.0
240
257
 
241
258
  ## 0.38.14
242
259
 
@@ -251,9 +268,9 @@
251
268
  ### Patch Changes
252
269
 
253
270
  - Updated dependencies [809afd3]
254
- - @pluv/io@0.38.13
255
- - @pluv/crdt@0.38.13
256
- - @pluv/types@0.38.13
271
+ - @pluv/io@0.38.13
272
+ - @pluv/crdt@0.38.13
273
+ - @pluv/types@0.38.13
257
274
 
258
275
  ## 0.38.12
259
276
 
@@ -284,72 +301,72 @@
284
301
  ### Patch Changes
285
302
 
286
303
  - 9b3af07: Updated internal event handlers to return more meaningful status codes and room identifiers.
287
- - @pluv/crdt@0.38.9
288
- - @pluv/io@0.38.9
289
- - @pluv/types@0.38.9
304
+ - @pluv/crdt@0.38.9
305
+ - @pluv/io@0.38.9
306
+ - @pluv/types@0.38.9
290
307
 
291
308
  ## 0.38.8
292
309
 
293
310
  ### Patch Changes
294
311
 
295
312
  - a39343b: Fix the `onUserDisconnected` event triggering when `onUserConnected` event triggers.
296
- - @pluv/crdt@0.38.8
297
- - @pluv/io@0.38.8
298
- - @pluv/types@0.38.8
313
+ - @pluv/crdt@0.38.8
314
+ - @pluv/io@0.38.8
315
+ - @pluv/types@0.38.8
299
316
 
300
317
  ## 0.38.7
301
318
 
302
319
  ### Patch Changes
303
320
 
304
321
  - 05c6f1a: Fix `TypeError` on event handler invocations once again.
305
- - @pluv/crdt@0.38.7
306
- - @pluv/io@0.38.7
307
- - @pluv/types@0.38.7
322
+ - @pluv/crdt@0.38.7
323
+ - @pluv/io@0.38.7
324
+ - @pluv/types@0.38.7
308
325
 
309
326
  ## 0.38.6
310
327
 
311
328
  ### Patch Changes
312
329
 
313
330
  - 07fbeef: Fix `TypeError` on event handler invocations.
314
- - @pluv/crdt@0.38.6
315
- - @pluv/io@0.38.6
316
- - @pluv/types@0.38.6
331
+ - @pluv/crdt@0.38.6
332
+ - @pluv/io@0.38.6
333
+ - @pluv/types@0.38.6
317
334
 
318
335
  ## 0.38.5
319
336
 
320
337
  ### Patch Changes
321
338
 
322
339
  - 77df696: Fixed platform event contexts being undefined.
323
- - @pluv/crdt@0.38.5
324
- - @pluv/io@0.38.5
325
- - @pluv/types@0.38.5
340
+ - @pluv/crdt@0.38.5
341
+ - @pluv/io@0.38.5
342
+ - @pluv/types@0.38.5
326
343
 
327
344
  ## 0.38.4
328
345
 
329
346
  ### Patch Changes
330
347
 
331
348
  - 15399b7: Fix webhook signature validation.
332
- - @pluv/crdt@0.38.4
333
- - @pluv/io@0.38.4
334
- - @pluv/types@0.38.4
349
+ - @pluv/crdt@0.38.4
350
+ - @pluv/io@0.38.4
351
+ - @pluv/types@0.38.4
335
352
 
336
353
  ## 0.38.3
337
354
 
338
355
  ### Patch Changes
339
356
 
340
357
  - Updated dependencies [8346273]
341
- - @pluv/io@0.38.3
342
- - @pluv/crdt@0.38.3
343
- - @pluv/types@0.38.3
358
+ - @pluv/io@0.38.3
359
+ - @pluv/crdt@0.38.3
360
+ - @pluv/types@0.38.3
344
361
 
345
362
  ## 0.38.2
346
363
 
347
364
  ### Patch Changes
348
365
 
349
366
  - Updated dependencies [039cd64]
350
- - @pluv/io@0.38.2
351
- - @pluv/crdt@0.38.2
352
- - @pluv/types@0.38.2
367
+ - @pluv/io@0.38.2
368
+ - @pluv/crdt@0.38.2
369
+ - @pluv/types@0.38.2
353
370
 
354
371
  ## 0.38.1
355
372
 
@@ -364,36 +381,36 @@
364
381
  ### Patch Changes
365
382
 
366
383
  - Updated dependencies [f4ceca3]
367
- - @pluv/types@0.38.0
368
- - @pluv/io@0.38.0
369
- - @pluv/crdt@0.38.0
384
+ - @pluv/types@0.38.0
385
+ - @pluv/io@0.38.0
386
+ - @pluv/crdt@0.38.0
370
387
 
371
388
  ## 0.37.7
372
389
 
373
390
  ### Patch Changes
374
391
 
375
392
  - c874f25: Fixed webhook signature verification.
376
- - @pluv/crdt@0.37.7
377
- - @pluv/io@0.37.7
378
- - @pluv/types@0.37.7
393
+ - @pluv/crdt@0.37.7
394
+ - @pluv/io@0.37.7
395
+ - @pluv/types@0.37.7
379
396
 
380
397
  ## 0.37.6
381
398
 
382
399
  ### Patch Changes
383
400
 
384
401
  - Updated dependencies [3a874f1]
385
- - @pluv/io@0.37.6
386
- - @pluv/crdt@0.37.6
387
- - @pluv/types@0.37.6
402
+ - @pluv/io@0.37.6
403
+ - @pluv/crdt@0.37.6
404
+ - @pluv/types@0.37.6
388
405
 
389
406
  ## 0.37.5
390
407
 
391
408
  ### Patch Changes
392
409
 
393
410
  - Updated dependencies [9a9ecee]
394
- - @pluv/io@0.37.5
395
- - @pluv/crdt@0.37.5
396
- - @pluv/types@0.37.5
411
+ - @pluv/io@0.37.5
412
+ - @pluv/crdt@0.37.5
413
+ - @pluv/types@0.37.5
397
414
 
398
415
  ## 0.37.4
399
416
 
@@ -433,51 +450,51 @@
433
450
 
434
451
  - 5165be0: **BREAKING**
435
452
 
436
- Updated the `platformPluv` function to return an entire `createIO` input object. Now `createIO` must be called with `platformPluv`'s return value as an input.
453
+ Updated the `platformPluv` function to return an entire `createIO` input object. Now `createIO` must be called with `platformPluv`'s return value as an input.
437
454
 
438
- ```ts
439
- // Before
455
+ ```ts
456
+ // Before
440
457
 
441
- import { createIO } from "@pluv/io";
442
- import { platformPluv } from "@pluv/platform-pluv";
458
+ import { createIO } from "@pluv/io";
459
+ import { platformPluv } from "@pluv/platform-pluv";
443
460
 
444
- export const io = createIO({
445
- authorize: {
446
- // ...
447
- },
448
- context: {
449
- // ...
450
- },
451
- platform: platformPluv({
452
- // ...
453
- }),
454
- // ...
455
- });
461
+ export const io = createIO({
462
+ authorize: {
463
+ // ...
464
+ },
465
+ context: {
466
+ // ...
467
+ },
468
+ platform: platformPluv({
469
+ // ...
470
+ }),
471
+ // ...
472
+ });
456
473
 
457
- // After
474
+ // After
458
475
 
459
- import { createIO } from "@pluv/io";
460
- import { platformPluv } from "@pluv/platform-pluv";
476
+ import { createIO } from "@pluv/io";
477
+ import { platformPluv } from "@pluv/platform-pluv";
461
478
 
462
- export const io = createIO(
463
- platformPluv({
464
- authorize: {
465
- // ...
466
- },
467
- context: {
468
- // ...
469
- },
470
- }),
471
- );
472
- ```
479
+ export const io = createIO(
480
+ platformPluv({
481
+ authorize: {
482
+ // ...
483
+ },
484
+ context: {
485
+ // ...
486
+ },
487
+ }),
488
+ );
489
+ ```
473
490
 
474
491
  ### Patch Changes
475
492
 
476
493
  - 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).
477
494
  - Updated dependencies [9b74abb]
478
- - @pluv/io@0.37.0
479
- - @pluv/crdt@0.37.0
480
- - @pluv/types@0.37.0
495
+ - @pluv/io@0.37.0
496
+ - @pluv/crdt@0.37.0
497
+ - @pluv/types@0.37.0
481
498
 
482
499
  ## 0.36.0
483
500
 
@@ -492,9 +509,9 @@
492
509
  ### Patch Changes
493
510
 
494
511
  - Updated dependencies [5d3a56f]
495
- - @pluv/io@0.35.4
496
- - @pluv/crdt@0.35.4
497
- - @pluv/types@0.35.4
512
+ - @pluv/io@0.35.4
513
+ - @pluv/crdt@0.35.4
514
+ - @pluv/types@0.35.4
498
515
 
499
516
  ## 0.35.3
500
517
 
@@ -510,9 +527,9 @@
510
527
 
511
528
  - 47ab053: Remove unused check for `authorize.required` for `@pluv/platform-pluv`.
512
529
  - Updated dependencies [81cb692]
513
- - @pluv/types@0.35.2
514
- - @pluv/io@0.35.2
515
- - @pluv/crdt@0.35.2
530
+ - @pluv/types@0.35.2
531
+ - @pluv/io@0.35.2
532
+ - @pluv/crdt@0.35.2
516
533
 
517
534
  ## 0.35.1
518
535
 
@@ -527,18 +544,18 @@
527
544
  ### Patch Changes
528
545
 
529
546
  - Updated dependencies [c9073ad]
530
- - @pluv/io@0.35.0
531
- - @pluv/crdt@0.35.0
532
- - @pluv/types@0.35.0
547
+ - @pluv/io@0.35.0
548
+ - @pluv/crdt@0.35.0
549
+ - @pluv/types@0.35.0
533
550
 
534
551
  ## 0.34.1
535
552
 
536
553
  ### Patch Changes
537
554
 
538
555
  - Updated dependencies [d639427]
539
- - @pluv/io@0.34.1
540
- - @pluv/crdt@0.34.1
541
- - @pluv/types@0.34.1
556
+ - @pluv/io@0.34.1
557
+ - @pluv/crdt@0.34.1
558
+ - @pluv/types@0.34.1
542
559
 
543
560
  ## 0.34.0
544
561
 
@@ -546,66 +563,66 @@
546
563
 
547
564
  - 70af3b2: **BREAKING**: The API has been updated to now be called as function `platformPluv` into `createIO` from `@pluv/io`.
548
565
 
549
- ```ts
550
- // Before
566
+ ```ts
567
+ // Before
551
568
 
552
- import { createIO } from "@pluv/platform-pluv";
569
+ import { createIO } from "@pluv/platform-pluv";
553
570
 
554
- export const io = createIO({
555
- authorize: {
556
- user: z.object({
557
- id: z.string(),
558
- }),
559
- },
560
- basePath: "/api/pluv",
561
- publicKey: "pk_...",
562
- secretKey: "sk_...",
563
- webhookSecret: "whsec_...",
564
- });
571
+ export const io = createIO({
572
+ authorize: {
573
+ user: z.object({
574
+ id: z.string(),
575
+ }),
576
+ },
577
+ basePath: "/api/pluv",
578
+ publicKey: "pk_...",
579
+ secretKey: "sk_...",
580
+ webhookSecret: "whsec_...",
581
+ });
565
582
 
566
- export const GET = pluv.handler;
583
+ export const GET = pluv.handler;
567
584
 
568
- // After
585
+ // After
569
586
 
570
- import { createIO } from "@pluv/io";
571
- import { platformPluv } from "@pluv/platform-pluv";
587
+ import { createIO } from "@pluv/io";
588
+ import { platformPluv } from "@pluv/platform-pluv";
572
589
 
573
- export const io = createIO({
574
- authorize: {
575
- user: z.object({
576
- id: z.string(),
577
- }),
578
- },
579
- platform: platformPluv({
580
- basePath: "/api/pluv",
581
- publicKey: "pk_...",
582
- secretKey: "sk_...",
583
- webhookSecret: "whsec_...",
584
- }),
585
- });
590
+ export const io = createIO({
591
+ authorize: {
592
+ user: z.object({
593
+ id: z.string(),
594
+ }),
595
+ },
596
+ platform: platformPluv({
597
+ basePath: "/api/pluv",
598
+ publicKey: "pk_...",
599
+ secretKey: "sk_...",
600
+ webhookSecret: "whsec_...",
601
+ }),
602
+ });
586
603
 
587
- export const ioServer = io.server();
604
+ export const ioServer = io.server();
588
605
 
589
- // Example: If you're on Next.js
590
- export const GET = ioServer.fetch;
591
- ```
606
+ // Example: If you're on Next.js
607
+ export const GET = ioServer.fetch;
608
+ ```
592
609
 
593
610
  ### Patch Changes
594
611
 
595
612
  - Updated dependencies [0c920ea]
596
613
  - Updated dependencies [70af3b2]
597
- - @pluv/io@0.34.0
598
- - @pluv/crdt@0.34.0
599
- - @pluv/types@0.34.0
614
+ - @pluv/io@0.34.0
615
+ - @pluv/crdt@0.34.0
616
+ - @pluv/types@0.34.0
600
617
 
601
618
  ## 0.33.0
602
619
 
603
620
  ### Patch Changes
604
621
 
605
622
  - f14b3be: Updated webhooks path to base path.
606
- - @pluv/crdt@0.33.0
607
- - @pluv/io@0.33.0
608
- - @pluv/types@0.33.0
623
+ - @pluv/crdt@0.33.0
624
+ - @pluv/io@0.33.0
625
+ - @pluv/types@0.33.0
609
626
 
610
627
  ## 0.32.9
611
628
 
@@ -620,18 +637,18 @@
620
637
  ### Patch Changes
621
638
 
622
639
  - Updated dependencies [e659f8a]
623
- - @pluv/io@0.32.8
624
- - @pluv/crdt@0.32.8
625
- - @pluv/types@0.32.8
640
+ - @pluv/io@0.32.8
641
+ - @pluv/crdt@0.32.8
642
+ - @pluv/types@0.32.8
626
643
 
627
644
  ## 0.32.7
628
645
 
629
646
  ### Patch Changes
630
647
 
631
648
  - a9a1f7b: Export event schemas.
632
- - @pluv/crdt@0.32.7
633
- - @pluv/io@0.32.7
634
- - @pluv/types@0.32.7
649
+ - @pluv/crdt@0.32.7
650
+ - @pluv/io@0.32.7
651
+ - @pluv/types@0.32.7
635
652
 
636
653
  ## 0.32.6
637
654
 
@@ -640,55 +657,55 @@
640
657
  - 25292d4: Fix event payload types to only contain serializable fields.
641
658
  - c0956e7: Add `onUserConnected` and `onUserDisconnected` events on `PluvServer`.
642
659
 
643
- ```ts
644
- import { createIO } from "@pluv/io";
660
+ ```ts
661
+ import { createIO } from "@pluv/io";
645
662
 
646
- const io = createIO({
647
- /* ... */
648
- });
663
+ const io = createIO({
664
+ /* ... */
665
+ });
649
666
 
650
- const ioServer = io.server({
651
- // ...
652
- onUserConnected: (event) => {
653
- // ...
654
- },
655
- onUserDisconnected: (event) => {
656
- // ...
657
- },
658
- });
659
- ```
667
+ const ioServer = io.server({
668
+ // ...
669
+ onUserConnected: (event) => {
670
+ // ...
671
+ },
672
+ onUserDisconnected: (event) => {
673
+ // ...
674
+ },
675
+ });
676
+ ```
660
677
 
661
678
  - fc83a44: Enable `onUserConnected` and `onUserDisconnected` event listeners.
662
679
  - be1488f: Validate webhook signatures via webhook secrets.
663
680
 
664
- ```ts
665
- import { createIO } from "@pluv/platform-pluv";
666
-
667
- const io = createIO({
668
- // ...
669
- // If you provide a webhookSecret
670
- webhookSecret: "whsec_...",
671
-
672
- // The following properties will be made available to configure
673
- getInitialStorage: (event) => {
674
- /* ... */
675
- },
676
- onRoomDeleted: (event) => {
677
- /* ... */
678
- },
679
- onUserConnected: (event) => {
680
- /* ... */
681
- },
682
- onUserDisconnected: (event) => {
683
- /* ... */
684
- },
685
- });
686
- ```
681
+ ```ts
682
+ import { createIO } from "@pluv/platform-pluv";
683
+
684
+ const io = createIO({
685
+ // ...
686
+ // If you provide a webhookSecret
687
+ webhookSecret: "whsec_...",
688
+
689
+ // The following properties will be made available to configure
690
+ getInitialStorage: (event) => {
691
+ /* ... */
692
+ },
693
+ onRoomDeleted: (event) => {
694
+ /* ... */
695
+ },
696
+ onUserConnected: (event) => {
697
+ /* ... */
698
+ },
699
+ onUserDisconnected: (event) => {
700
+ /* ... */
701
+ },
702
+ });
703
+ ```
687
704
 
688
705
  - Updated dependencies [c0956e7]
689
- - @pluv/io@0.32.6
690
- - @pluv/crdt@0.32.6
691
- - @pluv/types@0.32.6
706
+ - @pluv/io@0.32.6
707
+ - @pluv/crdt@0.32.6
708
+ - @pluv/types@0.32.6
692
709
 
693
710
  ## 0.32.5
694
711
 
@@ -713,36 +730,36 @@
713
730
  - cce989d: Added properties for internal use only.
714
731
  - 5a3114f: Fixed thrown error when calling `createToken`.
715
732
  - Updated dependencies [bb21274]
716
- - @pluv/io@0.32.3
717
- - @pluv/crdt@0.32.3
718
- - @pluv/types@0.32.3
733
+ - @pluv/io@0.32.3
734
+ - @pluv/crdt@0.32.3
735
+ - @pluv/types@0.32.3
719
736
 
720
737
  ## 0.32.2
721
738
 
722
739
  ### Patch Changes
723
740
 
724
741
  - Updated dependencies [890d45b]
725
- - @pluv/io@0.32.2
726
- - @pluv/crdt@0.32.2
727
- - @pluv/types@0.32.2
742
+ - @pluv/io@0.32.2
743
+ - @pluv/crdt@0.32.2
744
+ - @pluv/types@0.32.2
728
745
 
729
746
  ## 0.32.1
730
747
 
731
748
  ### Patch Changes
732
749
 
733
750
  - 7ae3df3: Update endpoint to generate authorization tokens.
734
- - @pluv/crdt@0.32.1
735
- - @pluv/io@0.32.1
736
- - @pluv/types@0.32.1
751
+ - @pluv/crdt@0.32.1
752
+ - @pluv/io@0.32.1
753
+ - @pluv/types@0.32.1
737
754
 
738
755
  ## 0.32.0
739
756
 
740
757
  ### Patch Changes
741
758
 
742
759
  - Updated dependencies [cde5305]
743
- - @pluv/io@0.32.0
744
- - @pluv/crdt@0.32.0
745
- - @pluv/types@0.32.0
760
+ - @pluv/io@0.32.0
761
+ - @pluv/crdt@0.32.0
762
+ - @pluv/types@0.32.0
746
763
 
747
764
  ## 0.31.0
748
765
 
@@ -750,86 +767,86 @@
750
767
 
751
768
  - b3c31d7: **BREAKING**
752
769
 
753
- Fixed platform context types. This will require additional properties when registering a websocket and creating authorization tokens. See example below:
754
-
755
- ```ts
756
- // @pluv/platform-node example
757
-
758
- import { platformNode } from "@pluv/platform-node";
759
- import { createIO } from "@pluv/io";
760
- import type { IncomingMessage } from "node:http";
761
- import { z } from "zod";
762
-
763
- const io = createIO({
764
- // If using a function authorize parameter, `req` is now available as a param
765
- authorize: ({ req }) => ({
766
- required: true,
767
- secret: "MY-CUSTOM-SECRET",
768
- user: z.object({
769
- id: z.string(),
770
- }),
771
- }),
772
- platformNode(),
773
- });
774
-
775
- // Before
776
- io.createToken({
777
- room: "my-custom-room",
778
- user: { id: "abc123" },
779
- });
780
-
781
- // After
782
- io.createToken({
783
- room: "my-custom-room",
784
- user: { id: "abc123" },
785
-
786
- // Previously not required, but now required
787
- req: req as IncomingMessage,
788
- });
789
- ```
790
-
791
- ```ts
792
- // @pluv/platform-cloudflare example
793
-
794
- import { platformCloudflare } from "@pluv/platform-cloudflare";
795
- import { createIO } from "@pluv/io";
796
- import { z } from "zod";
797
-
798
- const io = createIO({
799
- // If using a function authorize parameter, `env` and `request` are now available as params
800
- authorize: ({ env, request }) => ({
801
- required: true,
802
- secret: "MY-CUSTOM-SECRET",
803
- user: z.object({
804
- id: z.string(),
805
- }),
806
- }),
807
- platformCloudflare(),
808
- });
809
-
810
- // Before
811
- io.createToken({
812
- room: "my-custom-room",
813
- user: { id: "abc123" },
814
- });
815
-
816
- // After
817
- io.createToken({
818
- room: "my-custom-room",
819
- user: { id: "abc123" },
820
-
821
- // Previously not required, but now required
822
- env: env as Env,
823
- request: request as Request,
824
- });
825
- ```
770
+ Fixed platform context types. This will require additional properties when registering a websocket and creating authorization tokens. See example below:
771
+
772
+ ```ts
773
+ // @pluv/platform-node example
774
+
775
+ import { platformNode } from "@pluv/platform-node";
776
+ import { createIO } from "@pluv/io";
777
+ import type { IncomingMessage } from "node:http";
778
+ import { z } from "zod";
779
+
780
+ const io = createIO({
781
+ // If using a function authorize parameter, `req` is now available as a param
782
+ authorize: ({ req }) => ({
783
+ required: true,
784
+ secret: "MY-CUSTOM-SECRET",
785
+ user: z.object({
786
+ id: z.string(),
787
+ }),
788
+ }),
789
+ platformNode(),
790
+ });
791
+
792
+ // Before
793
+ io.createToken({
794
+ room: "my-custom-room",
795
+ user: { id: "abc123" },
796
+ });
797
+
798
+ // After
799
+ io.createToken({
800
+ room: "my-custom-room",
801
+ user: { id: "abc123" },
802
+
803
+ // Previously not required, but now required
804
+ req: req as IncomingMessage,
805
+ });
806
+ ```
807
+
808
+ ```ts
809
+ // @pluv/platform-cloudflare example
810
+
811
+ import { platformCloudflare } from "@pluv/platform-cloudflare";
812
+ import { createIO } from "@pluv/io";
813
+ import { z } from "zod";
814
+
815
+ const io = createIO({
816
+ // If using a function authorize parameter, `env` and `request` are now available as params
817
+ authorize: ({ env, request }) => ({
818
+ required: true,
819
+ secret: "MY-CUSTOM-SECRET",
820
+ user: z.object({
821
+ id: z.string(),
822
+ }),
823
+ }),
824
+ platformCloudflare(),
825
+ });
826
+
827
+ // Before
828
+ io.createToken({
829
+ room: "my-custom-room",
830
+ user: { id: "abc123" },
831
+ });
832
+
833
+ // After
834
+ io.createToken({
835
+ room: "my-custom-room",
836
+ user: { id: "abc123" },
837
+
838
+ // Previously not required, but now required
839
+ env: env as Env,
840
+ request: request as Request,
841
+ });
842
+ ```
826
843
 
827
844
  ### Patch Changes
828
845
 
829
846
  - Updated dependencies [b3c31d7]
830
- - @pluv/io@0.31.0
831
- - @pluv/crdt@0.31.0
832
- - @pluv/types@0.31.0
847
+ - @pluv/io@0.31.0
848
+ - @pluv/crdt@0.31.0
849
+ - @pluv/types@0.31.0
833
850
 
834
851
  ## 0.30.2
835
852
 
@@ -845,9 +862,9 @@
845
862
 
846
863
  - 47784d5: Add missing `publicKey` param to `createIO`.
847
864
  - Updated dependencies [b9c3633]
848
- - @pluv/io@0.30.1
849
- - @pluv/crdt@0.30.1
850
- - @pluv/types@0.30.1
865
+ - @pluv/io@0.30.1
866
+ - @pluv/crdt@0.30.1
867
+ - @pluv/types@0.30.1
851
868
 
852
869
  ## 0.30.0
853
870
 
@@ -858,6 +875,6 @@
858
875
  ### Patch Changes
859
876
 
860
877
  - Updated dependencies [7246a9e]
861
- - @pluv/io@0.30.0
862
- - @pluv/crdt@0.30.0
863
- - @pluv/types@0.30.0
878
+ - @pluv/io@0.30.0
879
+ - @pluv/crdt@0.30.0
880
+ - @pluv/types@0.30.0
package/dist/index.d.mts CHANGED
@@ -57,7 +57,6 @@ declare class PluvPlatform<TContext extends Record<string, any> = {}, TUser exte
57
57
  };
58
58
  readonly _name = "platformPluv";
59
59
  private readonly _app;
60
- private _authorize;
61
60
  private readonly _basePath;
62
61
  private readonly _context;
63
62
  private readonly _endpoints;
package/dist/index.d.ts CHANGED
@@ -57,7 +57,6 @@ declare class PluvPlatform<TContext extends Record<string, any> = {}, TUser exte
57
57
  };
58
58
  readonly _name = "platformPluv";
59
59
  private readonly _app;
60
- private _authorize;
61
60
  private readonly _basePath;
62
61
  private readonly _context;
63
62
  private readonly _endpoints;
package/dist/index.js CHANGED
@@ -152,7 +152,7 @@ var getCrypto = () => {
152
152
  };
153
153
 
154
154
  // src/shared/createHmac.ts
155
- var createHmac = (params) => __async(void 0, null, function* () {
155
+ var createHmac = (params) => __async(null, null, function* () {
156
156
  const { payload, secret } = params;
157
157
  if (!payload || !secret) throw new Error("Secret and payload are required to sign payload");
158
158
  const encoder = new TextEncoder();
@@ -200,7 +200,7 @@ var timingSafeEqual = (a, b) => {
200
200
  };
201
201
 
202
202
  // src/shared/verifyWebhook.ts
203
- var verifyWebhook = (params) => __async(void 0, null, function* () {
203
+ var verifyWebhook = (params) => __async(null, null, function* () {
204
204
  const { payload, secret, signature } = params;
205
205
  if (!secret || !payload || !signature) {
206
206
  throw new Error("Secret, payload and signature are required to verify payload");
@@ -238,7 +238,7 @@ var PluvPlatform = class extends import_io.AbstractPlatform {
238
238
  this._name = "platformPluv";
239
239
  this._createToken = (params) => __async(this, null, function* () {
240
240
  var _a;
241
- const parsed = this._authorize.user.parse(params.user);
241
+ const parsed = params.authorize.user.parse(params.user);
242
242
  const [endpoints, publicKey, secretKey] = yield Promise.all([
243
243
  typeof this._endpoints === "object" ? this._endpoints : this._endpoints(),
244
244
  typeof this._publicKey === "string" ? this._publicKey : this._publicKey(),
@@ -386,7 +386,6 @@ var PluvPlatform = class extends import_io.AbstractPlatform {
386
386
  throw new Error("Config `onRoomMessage` is not supported on `platformPluv`");
387
387
  if (!!config.onStorageUpdated)
388
388
  throw new Error("Config `onStorageUpdated` is not supported on `platformPluv`");
389
- this._authorize = config.authorize;
390
389
  this._getInitialStorage = config.getInitialStorage;
391
390
  this._listeners = {
392
391
  onRoomDeleted: (event) => {
package/dist/index.mjs CHANGED
@@ -116,13 +116,13 @@ var getCrypto = () => {
116
116
  return crypto;
117
117
  }
118
118
  if (typeof __require === "function") {
119
- return __require("node:crypto").webcrypto;
119
+ return __require("crypto").webcrypto;
120
120
  }
121
121
  throw new Error("Missing crypto module");
122
122
  };
123
123
 
124
124
  // src/shared/createHmac.ts
125
- var createHmac = (params) => __async(void 0, null, function* () {
125
+ var createHmac = (params) => __async(null, null, function* () {
126
126
  const { payload, secret } = params;
127
127
  if (!payload || !secret) throw new Error("Secret and payload are required to sign payload");
128
128
  const encoder = new TextEncoder();
@@ -170,7 +170,7 @@ var timingSafeEqual = (a, b) => {
170
170
  };
171
171
 
172
172
  // src/shared/verifyWebhook.ts
173
- var verifyWebhook = (params) => __async(void 0, null, function* () {
173
+ var verifyWebhook = (params) => __async(null, null, function* () {
174
174
  const { payload, secret, signature } = params;
175
175
  if (!secret || !payload || !signature) {
176
176
  throw new Error("Secret, payload and signature are required to verify payload");
@@ -208,7 +208,7 @@ var PluvPlatform = class extends AbstractPlatform {
208
208
  this._name = "platformPluv";
209
209
  this._createToken = (params) => __async(this, null, function* () {
210
210
  var _a;
211
- const parsed = this._authorize.user.parse(params.user);
211
+ const parsed = params.authorize.user.parse(params.user);
212
212
  const [endpoints, publicKey, secretKey] = yield Promise.all([
213
213
  typeof this._endpoints === "object" ? this._endpoints : this._endpoints(),
214
214
  typeof this._publicKey === "string" ? this._publicKey : this._publicKey(),
@@ -356,7 +356,6 @@ var PluvPlatform = class extends AbstractPlatform {
356
356
  throw new Error("Config `onRoomMessage` is not supported on `platformPluv`");
357
357
  if (!!config.onStorageUpdated)
358
358
  throw new Error("Config `onStorageUpdated` is not supported on `platformPluv`");
359
- this._authorize = config.authorize;
360
359
  this._getInitialStorage = config.getInitialStorage;
361
360
  this._listeners = {
362
361
  onRoomDeleted: (event) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/platform-pluv",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "@pluv/io adapter for pluv.io",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -19,18 +19,18 @@
19
19
  "dependencies": {
20
20
  "@types/node": "^22.15.18",
21
21
  "fast-json-stable-stringify": "^2.1.0",
22
- "hono": "^4.7.9",
22
+ "hono": "^4.7.10",
23
23
  "zod": "^3.24.4",
24
- "@pluv/crdt": "^2.2.0",
25
- "@pluv/io": "^2.2.0",
26
- "@pluv/types": "^2.2.0"
24
+ "@pluv/crdt": "^2.2.2",
25
+ "@pluv/io": "^2.2.2",
26
+ "@pluv/types": "^2.2.2"
27
27
  },
28
28
  "devDependencies": {
29
- "eslint": "^9.26.0",
30
- "tsup": "^8.4.0",
29
+ "eslint": "^9.27.0",
30
+ "tsup": "^8.5.0",
31
31
  "typescript": "^5.8.3",
32
- "@pluv/tsconfig": "^2.2.0",
33
- "eslint-config-pluv": "^2.2.0"
32
+ "@pluv/tsconfig": "^2.2.2",
33
+ "eslint-config-pluv": "^2.2.2"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "tsup src/index.ts --format esm,cjs --dts",
@@ -81,7 +81,6 @@ export class PluvPlatform<
81
81
  public readonly _name = "platformPluv";
82
82
 
83
83
  private readonly _app: Hono;
84
- private _authorize: any;
85
84
  private readonly _basePath: string;
86
85
  private readonly _context: any;
87
86
  private readonly _endpoints: PluvIOEndpoints | (() => MaybePromise<PluvIOEndpoints>);
@@ -92,7 +91,7 @@ export class PluvPlatform<
92
91
  private readonly _webhookSecret?: WebhookSecret;
93
92
 
94
93
  public _createToken = async (params: JWTEncodeParams<any, any>): Promise<string> => {
95
- const parsed = this._authorize.user.parse(params.user);
94
+ const parsed = params.authorize.user.parse(params.user);
96
95
 
97
96
  const [endpoints, publicKey, secretKey] = await Promise.all([
98
97
  typeof this._endpoints === "object" ? this._endpoints : this._endpoints(),
@@ -192,13 +191,6 @@ export class PluvPlatform<
192
191
  if (!!config.onStorageUpdated)
193
192
  throw new Error("Config `onStorageUpdated` is not supported on `platformPluv`");
194
193
 
195
- /**
196
- * !HACK
197
- * @description Assign these on the validation step, because we know this will happen on the
198
- * server constructor internally.
199
- * @date December 16, 2024
200
- */
201
- this._authorize = config.authorize;
202
194
  this._getInitialStorage = config.getInitialStorage;
203
195
  this._listeners = {
204
196
  onRoomDeleted: (event) => config.onRoomDeleted?.(event),