@wix/realtime 1.0.16 → 1.0.17

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.
@@ -0,0 +1,1136 @@
1
+ {
2
+ "typeDocModel": {
3
+ "id": 0,
4
+ "name": "@wix/realtime",
5
+ "variant": "project",
6
+ "kind": 1,
7
+ "flags": {},
8
+ "children": [
9
+ {
10
+ "id": 23,
11
+ "name": "publisher",
12
+ "variant": "declaration",
13
+ "kind": 4,
14
+ "flags": {},
15
+ "children": [
16
+ {
17
+ "id": 24,
18
+ "name": "publish",
19
+ "variant": "declaration",
20
+ "kind": 64,
21
+ "flags": {},
22
+ "signatures": [
23
+ {
24
+ "id": 25,
25
+ "name": "publish",
26
+ "variant": "signature",
27
+ "kind": 4096,
28
+ "flags": {},
29
+ "comment": {
30
+ "summary": [
31
+ {
32
+ "kind": "text",
33
+ "text": "Publishes a message to a realtime channel.\n\nMust be called from a backend function (server-to-server) as it requires\napp-level permissions to publish messages via the Duplexer API.\n\nThere are two ways to use this function depending on the Wix client type:\n\n**Manual client (self-hosted / explicit auth) — no elevation needed:**\nThe client's own credentials (instanceId, metaSiteId) are used directly.\nThis ensures messages are scoped to the correct site.\n\n"
34
+ },
35
+ {
36
+ "kind": "code",
37
+ "text": "```ts\nimport { publisher } from '@wix/realtime';\nimport { createClient, AppStrategy } from '@wix/sdk';\n\nconst client = createClient({\n modules: { publisher },\n auth: AppStrategy({ appId, appSecret, instanceId }),\n});\nawait client.publisher.publish({ name: 'my-channel' }, { message: 'hello' });\n```"
38
+ },
39
+ {
40
+ "kind": "text",
41
+ "text": "\n\n**Contextual client (Wix-hosted) — elevation needed:**\nThe contextual httpClient may not have sufficient permissions on its own.\nWrap the call with "
42
+ },
43
+ {
44
+ "kind": "code",
45
+ "text": "`elevate()`"
46
+ },
47
+ {
48
+ "kind": "text",
49
+ "text": " to obtain the host's backend credentials.\n\n"
50
+ },
51
+ {
52
+ "kind": "code",
53
+ "text": "```ts\nimport { publisher } from '@wix/realtime';\nimport { elevate } from '@wix/sdk/context';\n\nawait elevate(publisher.publish)({ name: 'my-channel' }, { message: 'hello' });\n```"
54
+ }
55
+ ]
56
+ },
57
+ "parameters": [
58
+ {
59
+ "id": 26,
60
+ "name": "channel",
61
+ "variant": "param",
62
+ "kind": 32768,
63
+ "flags": {},
64
+ "type": {
65
+ "type": "reference",
66
+ "target": {
67
+ "sourceFileName": "../realtime-common/cjs/build/types.d.ts",
68
+ "qualifiedName": "Channel"
69
+ },
70
+ "name": "Channel",
71
+ "package": "@wix/realtime-common"
72
+ }
73
+ },
74
+ {
75
+ "id": 27,
76
+ "name": "payload",
77
+ "variant": "param",
78
+ "kind": 32768,
79
+ "flags": {},
80
+ "type": {
81
+ "type": "reference",
82
+ "target": {
83
+ "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
84
+ "qualifiedName": "Record"
85
+ },
86
+ "typeArguments": [
87
+ {
88
+ "type": "intrinsic",
89
+ "name": "string"
90
+ },
91
+ {
92
+ "type": "intrinsic",
93
+ "name": "any"
94
+ }
95
+ ],
96
+ "name": "Record",
97
+ "package": "typescript"
98
+ }
99
+ }
100
+ ],
101
+ "type": {
102
+ "type": "reference",
103
+ "target": {
104
+ "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
105
+ "qualifiedName": "Promise"
106
+ },
107
+ "typeArguments": [
108
+ {
109
+ "type": "intrinsic",
110
+ "name": "void"
111
+ }
112
+ ],
113
+ "name": "Promise",
114
+ "package": "typescript"
115
+ }
116
+ },
117
+ {
118
+ "id": 28,
119
+ "name": "publish",
120
+ "variant": "signature",
121
+ "kind": 4096,
122
+ "flags": {},
123
+ "comment": {
124
+ "summary": [
125
+ {
126
+ "kind": "text",
127
+ "text": "Publishes a message to a realtime channel.\n\nMust be called from a backend function (server-to-server) as it requires\napp-level permissions to publish messages via the Duplexer API.\n\nThere are two ways to use this function depending on the Wix client type:\n\n**Manual client (self-hosted / explicit auth) — no elevation needed:**\nThe client's own credentials (instanceId, metaSiteId) are used directly.\nThis ensures messages are scoped to the correct site.\n\n"
128
+ },
129
+ {
130
+ "kind": "code",
131
+ "text": "```ts\nimport { publisher } from '@wix/realtime';\nimport { createClient, AppStrategy } from '@wix/sdk';\n\nconst client = createClient({\n modules: { publisher },\n auth: AppStrategy({ appId, appSecret, instanceId }),\n});\nawait client.publisher.publish({ name: 'my-channel' }, { message: 'hello' });\n```"
132
+ },
133
+ {
134
+ "kind": "text",
135
+ "text": "\n\n**Contextual client (Wix-hosted) — elevation needed:**\nThe contextual httpClient may not have sufficient permissions on its own.\nWrap the call with "
136
+ },
137
+ {
138
+ "kind": "code",
139
+ "text": "`elevate()`"
140
+ },
141
+ {
142
+ "kind": "text",
143
+ "text": " to obtain the host's backend credentials.\n\n"
144
+ },
145
+ {
146
+ "kind": "code",
147
+ "text": "```ts\nimport { publisher } from '@wix/realtime';\nimport { elevate } from '@wix/sdk/context';\n\nawait elevate(publisher.publish)({ name: 'my-channel' }, { message: 'hello' });\n```"
148
+ }
149
+ ]
150
+ },
151
+ "parameters": [
152
+ {
153
+ "id": 29,
154
+ "name": "httpClient",
155
+ "variant": "param",
156
+ "kind": 32768,
157
+ "flags": {},
158
+ "type": {
159
+ "type": "reference",
160
+ "target": {
161
+ "sourceFileName": "../../node_modules/@wix/sdk-types/build/index.d.ts",
162
+ "qualifiedName": "HttpClient"
163
+ },
164
+ "name": "HttpClient",
165
+ "package": "@wix/sdk-types"
166
+ }
167
+ }
168
+ ],
169
+ "type": {
170
+ "type": "reference",
171
+ "target": {
172
+ "sourceFileName": "src/publisher/publisher.public.ts",
173
+ "qualifiedName": "PublishSignature"
174
+ },
175
+ "name": "PublishSignature",
176
+ "package": "@wix/realtime"
177
+ }
178
+ }
179
+ ]
180
+ }
181
+ ],
182
+ "groups": [
183
+ {
184
+ "title": "Functions",
185
+ "children": [
186
+ 24
187
+ ]
188
+ }
189
+ ]
190
+ },
191
+ {
192
+ "id": 1,
193
+ "name": "site",
194
+ "variant": "declaration",
195
+ "kind": 4,
196
+ "flags": {},
197
+ "children": [
198
+ {
199
+ "id": 7,
200
+ "name": "PermissionsRouter",
201
+ "variant": "declaration",
202
+ "kind": 256,
203
+ "flags": {},
204
+ "comment": {
205
+ "summary": [
206
+ {
207
+ "kind": "text",
208
+ "text": "IPermissionsRouter"
209
+ }
210
+ ],
211
+ "blockTags": [
212
+ {
213
+ "tag": "@summary",
214
+ "content": [
215
+ {
216
+ "kind": "text",
217
+ "text": "A router for defining and checking permissions."
218
+ }
219
+ ]
220
+ },
221
+ {
222
+ "tag": "@description",
223
+ "content": [
224
+ {
225
+ "kind": "text",
226
+ "text": "Use the permissions router to define the permissions you want to grant to subscribers\n on channels or channel resources. You can set permissions on the channel and channel\n resource level. If you do not define permissions for a particular channel resource,\n that resource inherits the permissions of its parent channel.\n\n Typically you use the permissions router in the **realtime-permissions.js** file in\n your site's backend to:\n\n + Set default permissions for all channels and channel resources where no explicit\n permissions are defined.\n + Add permissions logic for specific channels or channel resources.\n + Check the permissions for a specific subscriber on a specific channel.\n\n > **Note:** Although it is recommended, you do not need to use the permissions router to set permissions. You can also define all your permissions logic in the ["
227
+ },
228
+ {
229
+ "kind": "code",
230
+ "text": "`realtime_check_permission()`"
231
+ },
232
+ {
233
+ "kind": "text",
234
+ "text": "](#realtime_check_permission) function."
235
+ }
236
+ ]
237
+ }
238
+ ]
239
+ },
240
+ "children": [
241
+ {
242
+ "id": 8,
243
+ "name": "add",
244
+ "variant": "declaration",
245
+ "kind": 2048,
246
+ "flags": {},
247
+ "signatures": [
248
+ {
249
+ "id": 9,
250
+ "name": "add",
251
+ "variant": "signature",
252
+ "kind": 4096,
253
+ "flags": {},
254
+ "comment": {
255
+ "summary": [],
256
+ "blockTags": [
257
+ {
258
+ "tag": "@function",
259
+ "content": [
260
+ {
261
+ "kind": "text",
262
+ "text": "add"
263
+ }
264
+ ]
265
+ },
266
+ {
267
+ "tag": "@summary",
268
+ "content": [
269
+ {
270
+ "kind": "text",
271
+ "text": "Sets a permissions handler for a specific channel or channel resource."
272
+ }
273
+ ]
274
+ },
275
+ {
276
+ "tag": "@description",
277
+ "content": [
278
+ {
279
+ "kind": "text",
280
+ "text": "The handler set by the "
281
+ },
282
+ {
283
+ "kind": "code",
284
+ "text": "`add()`"
285
+ },
286
+ {
287
+ "kind": "text",
288
+ "text": " function is used for permission checks by the permissions\n router for the channel or channel resource specified in the "
289
+ },
290
+ {
291
+ "kind": "code",
292
+ "text": "`channel`"
293
+ },
294
+ {
295
+ "kind": "text",
296
+ "text": " property.\n\n Adding a handler to a specific channel without a specified resource adds a handler for\n all permissions checks on the channel and all permissions checks on any of the channel's\n resources that do not have their own permissions handlers.\n\n For example, suppose you have the following channel, resources, and permissions:\n\n + channel: A, permissions: handler X is specified using the "
297
+ },
298
+ {
299
+ "kind": "code",
300
+ "text": "`add()`"
301
+ },
302
+ {
303
+ "kind": "text",
304
+ "text": " function\n + channel: A, resource: 1, permissions: handler Y is specified using the "
305
+ },
306
+ {
307
+ "kind": "code",
308
+ "text": "`add()`"
309
+ },
310
+ {
311
+ "kind": "text",
312
+ "text": " function\n + channel: A, resource: 2, permissions: no handler is specified\n\n\n Permissions will be checked as follows:\n\n + A: use handler X\n + A, 1: use handler Y\n + A, 2: use handler X"
313
+ }
314
+ ]
315
+ }
316
+ ]
317
+ },
318
+ "parameters": [
319
+ {
320
+ "id": 10,
321
+ "name": "channel",
322
+ "variant": "param",
323
+ "kind": 32768,
324
+ "flags": {},
325
+ "comment": {
326
+ "summary": [
327
+ {
328
+ "kind": "text",
329
+ "text": "The channel, and optionally the resource, to publish to."
330
+ }
331
+ ]
332
+ },
333
+ "type": {
334
+ "type": "reference",
335
+ "target": {
336
+ "sourceFileName": "../realtime-common/cjs/build/types.d.ts",
337
+ "qualifiedName": "Channel"
338
+ },
339
+ "name": "Channel",
340
+ "package": "@wix/realtime-common"
341
+ }
342
+ },
343
+ {
344
+ "id": 11,
345
+ "name": "permissionHandler",
346
+ "variant": "param",
347
+ "kind": 32768,
348
+ "flags": {},
349
+ "comment": {
350
+ "summary": [
351
+ {
352
+ "kind": "text",
353
+ "text": "Handles setting of permissions for a subscriber on a channel or\n channel resource."
354
+ }
355
+ ]
356
+ },
357
+ "type": {
358
+ "type": "reference",
359
+ "target": {
360
+ "sourceFileName": "../site/cjs/build/types.d.ts",
361
+ "qualifiedName": "PermissionHandler"
362
+ },
363
+ "name": "PermissionHandler",
364
+ "package": "@wix/sdk_realtime_site"
365
+ }
366
+ }
367
+ ],
368
+ "type": {
369
+ "type": "intrinsic",
370
+ "name": "void"
371
+ }
372
+ }
373
+ ]
374
+ },
375
+ {
376
+ "id": 15,
377
+ "name": "check",
378
+ "variant": "declaration",
379
+ "kind": 2048,
380
+ "flags": {},
381
+ "signatures": [
382
+ {
383
+ "id": 16,
384
+ "name": "check",
385
+ "variant": "signature",
386
+ "kind": 4096,
387
+ "flags": {},
388
+ "comment": {
389
+ "summary": [],
390
+ "blockTags": [
391
+ {
392
+ "tag": "@function",
393
+ "content": [
394
+ {
395
+ "kind": "text",
396
+ "text": "check"
397
+ }
398
+ ]
399
+ },
400
+ {
401
+ "tag": "@summary",
402
+ "content": [
403
+ {
404
+ "kind": "text",
405
+ "text": "Checks the permissions for a subscriber on a channel or channel resource."
406
+ }
407
+ ]
408
+ },
409
+ {
410
+ "tag": "@description",
411
+ "content": [
412
+ {
413
+ "kind": "text",
414
+ "text": "The "
415
+ },
416
+ {
417
+ "kind": "code",
418
+ "text": "`check()`"
419
+ },
420
+ {
421
+ "kind": "text",
422
+ "text": " function returns a Promise that resolves to the permissions for the\n specified user on the specified channel or channel resource.\n\n The check is performed as follows:\n\n 1. If a permissions handler for the specified channel or channel resource exists,\n it's invoked and its result is returned.\n 1. If no handler is found for the specified channel resource, but a handler\n exists for the resource's channel, it's invoked and its result is returned.\n 1. If no handler is found for the specified channel, but a default permissions handler\n exists, it's invoked and its result is returned.\n 1. If the default handler has not been found, the default permissions are returned.\n\n The default permissions are:\n "
423
+ },
424
+ {
425
+ "kind": "code",
426
+ "text": "`{\"read\": true}`"
427
+ },
428
+ {
429
+ "kind": "text",
430
+ "text": "\n\n\n This function is typically called in the body of the\n ["
431
+ },
432
+ {
433
+ "kind": "code",
434
+ "text": "`realtime_check_permission()`"
435
+ },
436
+ {
437
+ "kind": "text",
438
+ "text": "](https://dev.wix.com/docs/sdk/backend-modules/realtime/site/realtime-check-permission) function like so:\n\n "
439
+ },
440
+ {
441
+ "kind": "code",
442
+ "text": "```JavaScript\n export function realtime_check_permission(channel, subscriber) {\n return permissionsRouter.check(channel,subscriber);\n }\n ```"
443
+ }
444
+ ]
445
+ },
446
+ {
447
+ "tag": "@returns",
448
+ "content": []
449
+ }
450
+ ]
451
+ },
452
+ "parameters": [
453
+ {
454
+ "id": 17,
455
+ "name": "channel",
456
+ "variant": "param",
457
+ "kind": 32768,
458
+ "flags": {},
459
+ "comment": {
460
+ "summary": [
461
+ {
462
+ "kind": "text",
463
+ "text": "The channel, and optionally the resource, to publish to."
464
+ }
465
+ ]
466
+ },
467
+ "type": {
468
+ "type": "reference",
469
+ "target": {
470
+ "sourceFileName": "../realtime-common/cjs/build/types.d.ts",
471
+ "qualifiedName": "Channel"
472
+ },
473
+ "name": "Channel",
474
+ "package": "@wix/realtime-common"
475
+ }
476
+ },
477
+ {
478
+ "id": 18,
479
+ "name": "subscriber",
480
+ "variant": "param",
481
+ "kind": 32768,
482
+ "flags": {},
483
+ "comment": {
484
+ "summary": [
485
+ {
486
+ "kind": "text",
487
+ "text": "The subscriber to grant permissions to."
488
+ }
489
+ ]
490
+ },
491
+ "type": {
492
+ "type": "reference",
493
+ "target": {
494
+ "sourceFileName": "../realtime-common/cjs/build/types.d.ts",
495
+ "qualifiedName": "Subscriber"
496
+ },
497
+ "name": "Subscriber",
498
+ "package": "@wix/realtime-common"
499
+ }
500
+ }
501
+ ],
502
+ "type": {
503
+ "type": "reference",
504
+ "target": {
505
+ "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
506
+ "qualifiedName": "Promise"
507
+ },
508
+ "typeArguments": [
509
+ {
510
+ "type": "reflection",
511
+ "declaration": {
512
+ "id": 19,
513
+ "name": "__type",
514
+ "variant": "declaration",
515
+ "kind": 65536,
516
+ "flags": {},
517
+ "children": [
518
+ {
519
+ "id": 20,
520
+ "name": "read",
521
+ "variant": "declaration",
522
+ "kind": 1024,
523
+ "flags": {},
524
+ "type": {
525
+ "type": "intrinsic",
526
+ "name": "boolean"
527
+ }
528
+ },
529
+ {
530
+ "id": 21,
531
+ "name": "write",
532
+ "variant": "declaration",
533
+ "kind": 1024,
534
+ "flags": {},
535
+ "type": {
536
+ "type": "intrinsic",
537
+ "name": "boolean"
538
+ }
539
+ }
540
+ ],
541
+ "groups": [
542
+ {
543
+ "title": "Properties",
544
+ "children": [
545
+ 20,
546
+ 21
547
+ ]
548
+ }
549
+ ]
550
+ }
551
+ }
552
+ ],
553
+ "name": "Promise",
554
+ "package": "typescript"
555
+ }
556
+ }
557
+ ]
558
+ },
559
+ {
560
+ "id": 12,
561
+ "name": "default",
562
+ "variant": "declaration",
563
+ "kind": 2048,
564
+ "flags": {},
565
+ "signatures": [
566
+ {
567
+ "id": 13,
568
+ "name": "default",
569
+ "variant": "signature",
570
+ "kind": 4096,
571
+ "flags": {},
572
+ "comment": {
573
+ "summary": [],
574
+ "blockTags": [
575
+ {
576
+ "tag": "@function",
577
+ "content": [
578
+ {
579
+ "kind": "text",
580
+ "text": "default"
581
+ }
582
+ ]
583
+ },
584
+ {
585
+ "tag": "@summary",
586
+ "content": [
587
+ {
588
+ "kind": "text",
589
+ "text": "Sets a permissions handler for default permissions."
590
+ }
591
+ ]
592
+ },
593
+ {
594
+ "tag": "@description",
595
+ "content": [
596
+ {
597
+ "kind": "text",
598
+ "text": "The handler set by the "
599
+ },
600
+ {
601
+ "kind": "code",
602
+ "text": "`default()`"
603
+ },
604
+ {
605
+ "kind": "text",
606
+ "text": " function is used for permission checks by the permissions\n router for all channels where an explicit handler has not been added. For channel resources,\n if no explicit handler has been set, the resource will inherit the permissions of its parent\n channel.\n\n For example, suppose you have the following channel, resources, and permissions:\n\n + channel: A, permissions: no handler specified\n + channel: A, resource: 1, permissions: no handler specified\n + channel: A, resource: 2, permissions: handler is specified\n\n\n Permissions will be checked as follows:\n\n + A: use the handler set by "
607
+ },
608
+ {
609
+ "kind": "code",
610
+ "text": "`default()`"
611
+ },
612
+ {
613
+ "kind": "text",
614
+ "text": " function\n + A, 1: use the handler set by "
615
+ },
616
+ {
617
+ "kind": "code",
618
+ "text": "`default()`"
619
+ },
620
+ {
621
+ "kind": "text",
622
+ "text": " function\n + A, 2: use the handler set by "
623
+ },
624
+ {
625
+ "kind": "code",
626
+ "text": "`add()`"
627
+ },
628
+ {
629
+ "kind": "text",
630
+ "text": " function for this resource\n\n\n If no default handler is set, subscribers to channels without explicit permissions handlers will\n receive the following permissions:\n "
631
+ },
632
+ {
633
+ "kind": "code",
634
+ "text": "`{\"read\": true}`"
635
+ }
636
+ ]
637
+ }
638
+ ]
639
+ },
640
+ "parameters": [
641
+ {
642
+ "id": 14,
643
+ "name": "permissionHandler",
644
+ "variant": "param",
645
+ "kind": 32768,
646
+ "flags": {},
647
+ "comment": {
648
+ "summary": [
649
+ {
650
+ "kind": "text",
651
+ "text": "Handles setting of permissions for a subscriber on a channel or\n channel resource."
652
+ }
653
+ ]
654
+ },
655
+ "type": {
656
+ "type": "reference",
657
+ "target": {
658
+ "sourceFileName": "../site/cjs/build/types.d.ts",
659
+ "qualifiedName": "PermissionHandler"
660
+ },
661
+ "name": "PermissionHandler",
662
+ "package": "@wix/sdk_realtime_site"
663
+ }
664
+ }
665
+ ],
666
+ "type": {
667
+ "type": "intrinsic",
668
+ "name": "void"
669
+ }
670
+ }
671
+ ]
672
+ }
673
+ ],
674
+ "groups": [
675
+ {
676
+ "title": "Methods",
677
+ "children": [
678
+ 8,
679
+ 15,
680
+ 12
681
+ ]
682
+ }
683
+ ]
684
+ },
685
+ {
686
+ "id": 22,
687
+ "name": "permissionsRouter",
688
+ "variant": "declaration",
689
+ "kind": 32,
690
+ "flags": {
691
+ "isConst": true
692
+ },
693
+ "comment": {
694
+ "summary": [
695
+ {
696
+ "kind": "text",
697
+ "text": "Implementation of the IPermissionsRouter interface."
698
+ }
699
+ ]
700
+ },
701
+ "type": {
702
+ "type": "reference",
703
+ "target": 7,
704
+ "name": "PermissionsRouter",
705
+ "package": "@wix/sdk_realtime_site"
706
+ }
707
+ },
708
+ {
709
+ "id": 2,
710
+ "name": "publish",
711
+ "variant": "declaration",
712
+ "kind": 64,
713
+ "flags": {
714
+ "isPublic": true
715
+ },
716
+ "signatures": [
717
+ {
718
+ "id": 3,
719
+ "name": "publish",
720
+ "variant": "signature",
721
+ "kind": 4096,
722
+ "flags": {},
723
+ "comment": {
724
+ "summary": [
725
+ {
726
+ "kind": "text",
727
+ "text": "The "
728
+ },
729
+ {
730
+ "kind": "code",
731
+ "text": "`publish()`"
732
+ },
733
+ {
734
+ "kind": "text",
735
+ "text": " function publishes a message to the specified channel or\n channel resource.\n\n When site visitors subscribe to a channel, they do not\n receive messages published to a resource on that same channel. Similarly,\n when site visitors subscribe to a channel resource, they do not\n receive messages published to that same channel without a specified resource.\n\n To publish a message to specific users only, specify the users by ID in\n the "
736
+ },
737
+ {
738
+ "kind": "code",
739
+ "text": "`PublishOptions`"
740
+ },
741
+ {
742
+ "kind": "text",
743
+ "text": " object sent to the "
744
+ },
745
+ {
746
+ "kind": "code",
747
+ "text": "`options`"
748
+ },
749
+ {
750
+ "kind": "text",
751
+ "text": " parameter.\n\n To include the ID of the user who triggered the publish in the published message,\n set the "
752
+ },
753
+ {
754
+ "kind": "code",
755
+ "text": "`includePublisher`"
756
+ },
757
+ {
758
+ "kind": "text",
759
+ "text": " property of the "
760
+ },
761
+ {
762
+ "kind": "code",
763
+ "text": "`PublishOptions`"
764
+ },
765
+ {
766
+ "kind": "text",
767
+ "text": " object to "
768
+ },
769
+ {
770
+ "kind": "code",
771
+ "text": "`true`"
772
+ },
773
+ {
774
+ "kind": "text",
775
+ "text": "."
776
+ }
777
+ ]
778
+ },
779
+ "parameters": [
780
+ {
781
+ "id": 4,
782
+ "name": "channel",
783
+ "variant": "param",
784
+ "kind": 32768,
785
+ "flags": {},
786
+ "comment": {
787
+ "summary": [
788
+ {
789
+ "kind": "text",
790
+ "text": "The channel, and optionally the resource, to publish to."
791
+ }
792
+ ]
793
+ },
794
+ "type": {
795
+ "type": "reference",
796
+ "target": {
797
+ "sourceFileName": "../realtime-common/cjs/build/types.d.ts",
798
+ "qualifiedName": "Channel"
799
+ },
800
+ "name": "Channel",
801
+ "package": "@wix/realtime-common"
802
+ }
803
+ },
804
+ {
805
+ "id": 5,
806
+ "name": "payload",
807
+ "variant": "param",
808
+ "kind": 32768,
809
+ "flags": {},
810
+ "comment": {
811
+ "summary": [
812
+ {
813
+ "kind": "text",
814
+ "text": "Message payload. <br /><br /> Max: 10kb"
815
+ }
816
+ ]
817
+ },
818
+ "type": {
819
+ "type": "intrinsic",
820
+ "name": "any"
821
+ }
822
+ },
823
+ {
824
+ "id": 6,
825
+ "name": "options",
826
+ "variant": "param",
827
+ "kind": 32768,
828
+ "flags": {
829
+ "isOptional": true
830
+ },
831
+ "comment": {
832
+ "summary": [
833
+ {
834
+ "kind": "text",
835
+ "text": "Options to use when publishing."
836
+ }
837
+ ]
838
+ },
839
+ "type": {
840
+ "type": "reference",
841
+ "target": {
842
+ "sourceFileName": "../realtime-common/cjs/build/types.d.ts",
843
+ "qualifiedName": "PublishOptions"
844
+ },
845
+ "name": "PublishOptions",
846
+ "package": "@wix/realtime-common"
847
+ }
848
+ }
849
+ ],
850
+ "type": {
851
+ "type": "union",
852
+ "types": [
853
+ {
854
+ "type": "intrinsic",
855
+ "name": "void"
856
+ },
857
+ {
858
+ "type": "reference",
859
+ "target": {
860
+ "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
861
+ "qualifiedName": "Promise"
862
+ },
863
+ "typeArguments": [
864
+ {
865
+ "type": "intrinsic",
866
+ "name": "void"
867
+ }
868
+ ],
869
+ "name": "Promise",
870
+ "package": "typescript"
871
+ }
872
+ ]
873
+ }
874
+ }
875
+ ]
876
+ }
877
+ ],
878
+ "groups": [
879
+ {
880
+ "title": "Interfaces",
881
+ "children": [
882
+ 7
883
+ ]
884
+ },
885
+ {
886
+ "title": "Variables",
887
+ "children": [
888
+ 22
889
+ ]
890
+ },
891
+ {
892
+ "title": "Functions",
893
+ "children": [
894
+ 2
895
+ ]
896
+ }
897
+ ]
898
+ },
899
+ {
900
+ "id": 30,
901
+ "name": "subscriber",
902
+ "variant": "declaration",
903
+ "kind": 4,
904
+ "flags": {},
905
+ "children": [
906
+ {
907
+ "id": 31,
908
+ "name": "subscribe",
909
+ "variant": "declaration",
910
+ "kind": 64,
911
+ "flags": {},
912
+ "signatures": [
913
+ {
914
+ "id": 32,
915
+ "name": "subscribe",
916
+ "variant": "signature",
917
+ "kind": 4096,
918
+ "flags": {},
919
+ "parameters": [
920
+ {
921
+ "id": 33,
922
+ "name": "channel",
923
+ "variant": "param",
924
+ "kind": 32768,
925
+ "flags": {},
926
+ "type": {
927
+ "type": "reference",
928
+ "target": {
929
+ "sourceFileName": "../realtime-common/cjs/build/types.d.ts",
930
+ "qualifiedName": "Channel"
931
+ },
932
+ "name": "Channel",
933
+ "package": "@wix/realtime-common"
934
+ }
935
+ },
936
+ {
937
+ "id": 34,
938
+ "name": "messageHandler",
939
+ "variant": "param",
940
+ "kind": 32768,
941
+ "flags": {},
942
+ "type": {
943
+ "type": "reference",
944
+ "target": {
945
+ "sourceFileName": "../realtime-common/cjs/build/types.d.ts",
946
+ "qualifiedName": "MessageHandler"
947
+ },
948
+ "name": "MessageHandler",
949
+ "package": "@wix/realtime-common"
950
+ }
951
+ },
952
+ {
953
+ "id": 35,
954
+ "name": "options",
955
+ "variant": "param",
956
+ "kind": 32768,
957
+ "flags": {
958
+ "isOptional": true
959
+ },
960
+ "type": {
961
+ "type": "reference",
962
+ "target": {
963
+ "sourceFileName": "../realtime-common/cjs/build/types.d.ts",
964
+ "qualifiedName": "SubscriptionOptions"
965
+ },
966
+ "name": "SubscriptionOptions",
967
+ "package": "@wix/realtime-common"
968
+ }
969
+ }
970
+ ],
971
+ "type": {
972
+ "type": "intrinsic",
973
+ "name": "string"
974
+ }
975
+ },
976
+ {
977
+ "id": 36,
978
+ "name": "subscribe",
979
+ "variant": "signature",
980
+ "kind": 4096,
981
+ "flags": {},
982
+ "comment": {
983
+ "summary": [
984
+ {
985
+ "kind": "text",
986
+ "text": "Subscribe to a channel. Returns a subscriptionId immediately; the\nactual connection is established asynchronously in the background. Use the\noptional "
987
+ },
988
+ {
989
+ "kind": "code",
990
+ "text": "`options`"
991
+ },
992
+ {
993
+ "kind": "text",
994
+ "text": " parameter to handle subscription lifecycle events."
995
+ }
996
+ ]
997
+ },
998
+ "parameters": [
999
+ {
1000
+ "id": 37,
1001
+ "name": "httpClient",
1002
+ "variant": "param",
1003
+ "kind": 32768,
1004
+ "flags": {},
1005
+ "type": {
1006
+ "type": "reference",
1007
+ "target": {
1008
+ "sourceFileName": "../../node_modules/@wix/sdk-types/build/index.d.ts",
1009
+ "qualifiedName": "HttpClient"
1010
+ },
1011
+ "name": "HttpClient",
1012
+ "package": "@wix/sdk-types"
1013
+ }
1014
+ }
1015
+ ],
1016
+ "type": {
1017
+ "type": "reference",
1018
+ "target": {
1019
+ "sourceFileName": "src/subscriber/subscriber.public.ts",
1020
+ "qualifiedName": "SubscribeSignature"
1021
+ },
1022
+ "name": "SubscribeSignature",
1023
+ "package": "@wix/realtime"
1024
+ }
1025
+ }
1026
+ ]
1027
+ },
1028
+ {
1029
+ "id": 38,
1030
+ "name": "unsubscribe",
1031
+ "variant": "declaration",
1032
+ "kind": 64,
1033
+ "flags": {},
1034
+ "signatures": [
1035
+ {
1036
+ "id": 39,
1037
+ "name": "unsubscribe",
1038
+ "variant": "signature",
1039
+ "kind": 4096,
1040
+ "flags": {},
1041
+ "parameters": [
1042
+ {
1043
+ "id": 40,
1044
+ "name": "options",
1045
+ "variant": "param",
1046
+ "kind": 32768,
1047
+ "flags": {},
1048
+ "type": {
1049
+ "type": "reference",
1050
+ "target": {
1051
+ "sourceFileName": "../realtime-common/cjs/build/types.d.ts",
1052
+ "qualifiedName": "UnsubscribeOptions"
1053
+ },
1054
+ "name": "UnsubscribeOptions",
1055
+ "package": "@wix/realtime-common"
1056
+ }
1057
+ }
1058
+ ],
1059
+ "type": {
1060
+ "type": "intrinsic",
1061
+ "name": "void"
1062
+ }
1063
+ },
1064
+ {
1065
+ "id": 41,
1066
+ "name": "unsubscribe",
1067
+ "variant": "signature",
1068
+ "kind": 4096,
1069
+ "flags": {},
1070
+ "comment": {
1071
+ "summary": [
1072
+ {
1073
+ "kind": "text",
1074
+ "text": "Unsubscribe from a subscription by its ID, by channel, or both."
1075
+ }
1076
+ ]
1077
+ },
1078
+ "parameters": [
1079
+ {
1080
+ "id": 42,
1081
+ "name": "_",
1082
+ "variant": "param",
1083
+ "kind": 32768,
1084
+ "flags": {},
1085
+ "type": {
1086
+ "type": "reference",
1087
+ "target": {
1088
+ "sourceFileName": "../../node_modules/@wix/sdk-types/build/index.d.ts",
1089
+ "qualifiedName": "HttpClient"
1090
+ },
1091
+ "name": "HttpClient",
1092
+ "package": "@wix/sdk-types"
1093
+ }
1094
+ }
1095
+ ],
1096
+ "type": {
1097
+ "type": "reference",
1098
+ "target": {
1099
+ "sourceFileName": "src/subscriber/subscriber.public.ts",
1100
+ "qualifiedName": "UnsubscribeSignature"
1101
+ },
1102
+ "name": "UnsubscribeSignature",
1103
+ "package": "@wix/realtime"
1104
+ }
1105
+ }
1106
+ ]
1107
+ }
1108
+ ],
1109
+ "groups": [
1110
+ {
1111
+ "title": "Functions",
1112
+ "children": [
1113
+ 31,
1114
+ 38
1115
+ ]
1116
+ }
1117
+ ]
1118
+ }
1119
+ ],
1120
+ "groups": [
1121
+ {
1122
+ "title": "Namespaces",
1123
+ "children": [
1124
+ 23,
1125
+ 1,
1126
+ 30
1127
+ ]
1128
+ }
1129
+ ],
1130
+ "packageName": "@wix/realtime",
1131
+ "symbolIdMap": {}
1132
+ },
1133
+ "appendices": {},
1134
+ "standaloneTypes": {},
1135
+ "metadata": {}
1136
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/realtime",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -30,6 +30,7 @@
30
30
  },
31
31
  "files": [
32
32
  "es",
33
+ "dist",
33
34
  "types",
34
35
  "cjs"
35
36
  ],
@@ -44,19 +45,25 @@
44
45
  "uuid": "^11.1.0"
45
46
  },
46
47
  "devDependencies": {
48
+ "@wix/docs-ts-model": "^1.54.0",
47
49
  "typescript": "^5.7.3",
48
50
  "vitest": "^3.0.5"
49
51
  },
50
52
  "scripts": {
51
- "build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json",
53
+ "build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json && npm run docs",
54
+ "docs": "docs-ts-model --disableSources --entryPoint src/index.ts",
52
55
  "test": "vitest run"
53
56
  },
54
57
  "wix": {
55
58
  "artifact": {
56
59
  "groupId": "com.wixpress.sdk",
57
60
  "artifactId": "realtime",
61
+ "targets": {
62
+ "static": true,
63
+ "build-docs": true
64
+ },
58
65
  "isRootPublicSdk": true
59
66
  }
60
67
  },
61
- "falconPackageHash": "c9c9fdd807cf8de849e3fa8047ca30f2b255ee52cd0f24cfe4570299"
68
+ "falconPackageHash": "81914dd350cf929362cd768817ec3d4a9f6370728a02d38283d6cdb4"
62
69
  }