@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.
- package/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +319 -302
- package/dist/index.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +3 -4
- package/dist/index.mjs +4 -5
- package/package.json +9 -9
- package/src/PluvPlatform.ts +1 -9
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/platform-pluv@2.2.
|
|
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
|
[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.5.0
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m14.25 KB[39m
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 96ms
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m12.42 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 99ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m3.
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 5981ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m3.65 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.65 KB[39m
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
-
|
|
288
|
-
|
|
289
|
-
|
|
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
|
-
|
|
297
|
-
|
|
298
|
-
|
|
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
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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
|
-
|
|
315
|
-
|
|
316
|
-
|
|
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
|
-
|
|
324
|
-
|
|
325
|
-
|
|
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
|
-
|
|
333
|
-
|
|
334
|
-
|
|
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
|
-
|
|
342
|
-
|
|
343
|
-
|
|
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
|
-
|
|
351
|
-
|
|
352
|
-
|
|
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
|
-
|
|
368
|
-
|
|
369
|
-
|
|
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
|
-
|
|
377
|
-
|
|
378
|
-
|
|
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
|
-
|
|
386
|
-
|
|
387
|
-
|
|
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
|
-
|
|
395
|
-
|
|
396
|
-
|
|
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
|
-
|
|
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
|
-
|
|
439
|
-
|
|
455
|
+
```ts
|
|
456
|
+
// Before
|
|
440
457
|
|
|
441
|
-
|
|
442
|
-
|
|
458
|
+
import { createIO } from "@pluv/io";
|
|
459
|
+
import { platformPluv } from "@pluv/platform-pluv";
|
|
443
460
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
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
|
-
|
|
474
|
+
// After
|
|
458
475
|
|
|
459
|
-
|
|
460
|
-
|
|
476
|
+
import { createIO } from "@pluv/io";
|
|
477
|
+
import { platformPluv } from "@pluv/platform-pluv";
|
|
461
478
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
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
|
-
|
|
479
|
-
|
|
480
|
-
|
|
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
|
-
|
|
496
|
-
|
|
497
|
-
|
|
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
|
-
|
|
514
|
-
|
|
515
|
-
|
|
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
|
-
|
|
531
|
-
|
|
532
|
-
|
|
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
|
-
|
|
540
|
-
|
|
541
|
-
|
|
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
|
-
|
|
550
|
-
|
|
566
|
+
```ts
|
|
567
|
+
// Before
|
|
551
568
|
|
|
552
|
-
|
|
569
|
+
import { createIO } from "@pluv/platform-pluv";
|
|
553
570
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
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
|
-
|
|
583
|
+
export const GET = pluv.handler;
|
|
567
584
|
|
|
568
|
-
|
|
585
|
+
// After
|
|
569
586
|
|
|
570
|
-
|
|
571
|
-
|
|
587
|
+
import { createIO } from "@pluv/io";
|
|
588
|
+
import { platformPluv } from "@pluv/platform-pluv";
|
|
572
589
|
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
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
|
-
|
|
604
|
+
export const ioServer = io.server();
|
|
588
605
|
|
|
589
|
-
|
|
590
|
-
|
|
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
|
-
|
|
598
|
-
|
|
599
|
-
|
|
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
|
-
|
|
607
|
-
|
|
608
|
-
|
|
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
|
-
|
|
624
|
-
|
|
625
|
-
|
|
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
|
-
|
|
633
|
-
|
|
634
|
-
|
|
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
|
-
|
|
644
|
-
|
|
660
|
+
```ts
|
|
661
|
+
import { createIO } from "@pluv/io";
|
|
645
662
|
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
663
|
+
const io = createIO({
|
|
664
|
+
/* ... */
|
|
665
|
+
});
|
|
649
666
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
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
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
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
|
-
|
|
690
|
-
|
|
691
|
-
|
|
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
|
-
|
|
717
|
-
|
|
718
|
-
|
|
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
|
-
|
|
726
|
-
|
|
727
|
-
|
|
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
|
-
|
|
735
|
-
|
|
736
|
-
|
|
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
|
-
|
|
744
|
-
|
|
745
|
-
|
|
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
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
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
|
-
|
|
831
|
-
|
|
832
|
-
|
|
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
|
-
|
|
849
|
-
|
|
850
|
-
|
|
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
|
-
|
|
862
|
-
|
|
863
|
-
|
|
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(
|
|
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(
|
|
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 =
|
|
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("
|
|
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(
|
|
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(
|
|
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 =
|
|
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.
|
|
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.
|
|
22
|
+
"hono": "^4.7.10",
|
|
23
23
|
"zod": "^3.24.4",
|
|
24
|
-
"@pluv/crdt": "^2.2.
|
|
25
|
-
"@pluv/io": "^2.2.
|
|
26
|
-
"@pluv/types": "^2.2.
|
|
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.
|
|
30
|
-
"tsup": "^8.
|
|
29
|
+
"eslint": "^9.27.0",
|
|
30
|
+
"tsup": "^8.5.0",
|
|
31
31
|
"typescript": "^5.8.3",
|
|
32
|
-
"@pluv/tsconfig": "^2.2.
|
|
33
|
-
"eslint-config-pluv": "^2.2.
|
|
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",
|
package/src/PluvPlatform.ts
CHANGED
|
@@ -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 =
|
|
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),
|