@wix/realtime 1.0.16 → 1.0.18
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/cjs/build/index.d.ts +4 -0
- package/cjs/build/index.js +4 -1
- package/cjs/build/publisher/publisher.context.d.ts +3 -0
- package/cjs/build/publisher/publisher.context.js +3 -0
- package/cjs/build/subscriber/subscriber.context.d.ts +81 -0
- package/cjs/build/subscriber/subscriber.context.js +81 -0
- package/cjs/build/subscriber/subscriber.public.d.ts +0 -8
- package/cjs/build/subscriber/subscriber.public.js +0 -8
- package/cjs/build/types.d.ts +1 -1
- package/dist/statics/docs-ts-model.json +2406 -0
- package/es/build/index.d.ts +4 -0
- package/es/build/index.js +2 -0
- package/es/build/publisher/publisher.context.d.ts +3 -0
- package/es/build/publisher/publisher.context.js +3 -0
- package/es/build/subscriber/subscriber.context.d.ts +81 -0
- package/es/build/subscriber/subscriber.context.js +81 -0
- package/es/build/subscriber/subscriber.public.d.ts +0 -8
- package/es/build/subscriber/subscriber.public.js +0 -8
- package/es/build/types.d.ts +1 -1
- package/package.json +12 -5
|
@@ -0,0 +1,2406 @@
|
|
|
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
|
+
"comment": {
|
|
65
|
+
"summary": [
|
|
66
|
+
{
|
|
67
|
+
"kind": "text",
|
|
68
|
+
"text": "The channel, and optionally the resource, to publish to."
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"type": {
|
|
73
|
+
"type": "reference",
|
|
74
|
+
"target": 43,
|
|
75
|
+
"name": "Channel",
|
|
76
|
+
"package": "@wix/realtime-common"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": 27,
|
|
81
|
+
"name": "payload",
|
|
82
|
+
"variant": "param",
|
|
83
|
+
"kind": 32768,
|
|
84
|
+
"flags": {},
|
|
85
|
+
"comment": {
|
|
86
|
+
"summary": [
|
|
87
|
+
{
|
|
88
|
+
"kind": "text",
|
|
89
|
+
"text": "Message payload. Max: 10kb"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
"type": {
|
|
94
|
+
"type": "reference",
|
|
95
|
+
"target": {
|
|
96
|
+
"sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
|
|
97
|
+
"qualifiedName": "Record"
|
|
98
|
+
},
|
|
99
|
+
"typeArguments": [
|
|
100
|
+
{
|
|
101
|
+
"type": "intrinsic",
|
|
102
|
+
"name": "string"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"type": "intrinsic",
|
|
106
|
+
"name": "any"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"name": "Record",
|
|
110
|
+
"package": "typescript"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"type": {
|
|
115
|
+
"type": "reference",
|
|
116
|
+
"target": {
|
|
117
|
+
"sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
|
|
118
|
+
"qualifiedName": "Promise"
|
|
119
|
+
},
|
|
120
|
+
"typeArguments": [
|
|
121
|
+
{
|
|
122
|
+
"type": "intrinsic",
|
|
123
|
+
"name": "void"
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"name": "Promise",
|
|
127
|
+
"package": "typescript"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": 28,
|
|
132
|
+
"name": "publish",
|
|
133
|
+
"variant": "signature",
|
|
134
|
+
"kind": 4096,
|
|
135
|
+
"flags": {},
|
|
136
|
+
"comment": {
|
|
137
|
+
"summary": [
|
|
138
|
+
{
|
|
139
|
+
"kind": "text",
|
|
140
|
+
"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"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"kind": "code",
|
|
144
|
+
"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```"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"kind": "text",
|
|
148
|
+
"text": "\n\n**Contextual client (Wix-hosted) — elevation needed:**\nThe contextual httpClient may not have sufficient permissions on its own.\nWrap the call with "
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"kind": "code",
|
|
152
|
+
"text": "`elevate()`"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"kind": "text",
|
|
156
|
+
"text": " to obtain the host's backend credentials.\n\n"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"kind": "code",
|
|
160
|
+
"text": "```ts\nimport { publisher } from '@wix/realtime';\nimport { elevate } from '@wix/sdk/context';\n\nawait elevate(publisher.publish)({ name: 'my-channel' }, { message: 'hello' });\n```"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"parameters": [
|
|
165
|
+
{
|
|
166
|
+
"id": 29,
|
|
167
|
+
"name": "httpClient",
|
|
168
|
+
"variant": "param",
|
|
169
|
+
"kind": 32768,
|
|
170
|
+
"flags": {},
|
|
171
|
+
"type": {
|
|
172
|
+
"type": "reference",
|
|
173
|
+
"target": {
|
|
174
|
+
"sourceFileName": "../../node_modules/@wix/sdk-types/build/index.d.ts",
|
|
175
|
+
"qualifiedName": "HttpClient"
|
|
176
|
+
},
|
|
177
|
+
"name": "HttpClient",
|
|
178
|
+
"package": "@wix/sdk-types"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"type": {
|
|
183
|
+
"type": "reference",
|
|
184
|
+
"target": {
|
|
185
|
+
"sourceFileName": "src/publisher/publisher.public.ts",
|
|
186
|
+
"qualifiedName": "PublishSignature"
|
|
187
|
+
},
|
|
188
|
+
"name": "PublishSignature",
|
|
189
|
+
"package": "@wix/realtime"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"groups": [
|
|
196
|
+
{
|
|
197
|
+
"title": "Functions",
|
|
198
|
+
"children": [
|
|
199
|
+
24
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"id": 1,
|
|
206
|
+
"name": "site",
|
|
207
|
+
"variant": "declaration",
|
|
208
|
+
"kind": 4,
|
|
209
|
+
"flags": {},
|
|
210
|
+
"children": [
|
|
211
|
+
{
|
|
212
|
+
"id": 7,
|
|
213
|
+
"name": "PermissionsRouter",
|
|
214
|
+
"variant": "declaration",
|
|
215
|
+
"kind": 256,
|
|
216
|
+
"flags": {},
|
|
217
|
+
"comment": {
|
|
218
|
+
"summary": [
|
|
219
|
+
{
|
|
220
|
+
"kind": "text",
|
|
221
|
+
"text": "IPermissionsRouter"
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
"blockTags": [
|
|
225
|
+
{
|
|
226
|
+
"tag": "@summary",
|
|
227
|
+
"content": [
|
|
228
|
+
{
|
|
229
|
+
"kind": "text",
|
|
230
|
+
"text": "A router for defining and checking permissions."
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"tag": "@description",
|
|
236
|
+
"content": [
|
|
237
|
+
{
|
|
238
|
+
"kind": "text",
|
|
239
|
+
"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 ["
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"kind": "code",
|
|
243
|
+
"text": "`realtime_check_permission()`"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"kind": "text",
|
|
247
|
+
"text": "](#realtime_check_permission) function."
|
|
248
|
+
}
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
"children": [
|
|
254
|
+
{
|
|
255
|
+
"id": 8,
|
|
256
|
+
"name": "add",
|
|
257
|
+
"variant": "declaration",
|
|
258
|
+
"kind": 2048,
|
|
259
|
+
"flags": {},
|
|
260
|
+
"signatures": [
|
|
261
|
+
{
|
|
262
|
+
"id": 9,
|
|
263
|
+
"name": "add",
|
|
264
|
+
"variant": "signature",
|
|
265
|
+
"kind": 4096,
|
|
266
|
+
"flags": {},
|
|
267
|
+
"comment": {
|
|
268
|
+
"summary": [],
|
|
269
|
+
"blockTags": [
|
|
270
|
+
{
|
|
271
|
+
"tag": "@function",
|
|
272
|
+
"content": [
|
|
273
|
+
{
|
|
274
|
+
"kind": "text",
|
|
275
|
+
"text": "add"
|
|
276
|
+
}
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"tag": "@summary",
|
|
281
|
+
"content": [
|
|
282
|
+
{
|
|
283
|
+
"kind": "text",
|
|
284
|
+
"text": "Sets a permissions handler for a specific channel or channel resource."
|
|
285
|
+
}
|
|
286
|
+
]
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"tag": "@description",
|
|
290
|
+
"content": [
|
|
291
|
+
{
|
|
292
|
+
"kind": "text",
|
|
293
|
+
"text": "The handler set by the "
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"kind": "code",
|
|
297
|
+
"text": "`add()`"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"kind": "text",
|
|
301
|
+
"text": " function is used for permission checks by the permissions\n router for the channel or channel resource specified in the "
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"kind": "code",
|
|
305
|
+
"text": "`channel`"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"kind": "text",
|
|
309
|
+
"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 "
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"kind": "code",
|
|
313
|
+
"text": "`add()`"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"kind": "text",
|
|
317
|
+
"text": " function\n + channel: A, resource: 1, permissions: handler Y is specified using the "
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"kind": "code",
|
|
321
|
+
"text": "`add()`"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"kind": "text",
|
|
325
|
+
"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"
|
|
326
|
+
}
|
|
327
|
+
]
|
|
328
|
+
}
|
|
329
|
+
]
|
|
330
|
+
},
|
|
331
|
+
"parameters": [
|
|
332
|
+
{
|
|
333
|
+
"id": 10,
|
|
334
|
+
"name": "channel",
|
|
335
|
+
"variant": "param",
|
|
336
|
+
"kind": 32768,
|
|
337
|
+
"flags": {},
|
|
338
|
+
"comment": {
|
|
339
|
+
"summary": [
|
|
340
|
+
{
|
|
341
|
+
"kind": "text",
|
|
342
|
+
"text": "The channel, and optionally the resource, to publish to."
|
|
343
|
+
}
|
|
344
|
+
]
|
|
345
|
+
},
|
|
346
|
+
"type": {
|
|
347
|
+
"type": "reference",
|
|
348
|
+
"target": 43,
|
|
349
|
+
"name": "Channel",
|
|
350
|
+
"package": "@wix/realtime-common"
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"id": 11,
|
|
355
|
+
"name": "permissionHandler",
|
|
356
|
+
"variant": "param",
|
|
357
|
+
"kind": 32768,
|
|
358
|
+
"flags": {},
|
|
359
|
+
"comment": {
|
|
360
|
+
"summary": [
|
|
361
|
+
{
|
|
362
|
+
"kind": "text",
|
|
363
|
+
"text": "Handles setting of permissions for a subscriber on a channel or\n channel resource."
|
|
364
|
+
}
|
|
365
|
+
]
|
|
366
|
+
},
|
|
367
|
+
"type": {
|
|
368
|
+
"type": "reference",
|
|
369
|
+
"target": {
|
|
370
|
+
"sourceFileName": "../site/cjs/build/types.d.ts",
|
|
371
|
+
"qualifiedName": "PermissionHandler"
|
|
372
|
+
},
|
|
373
|
+
"name": "PermissionHandler",
|
|
374
|
+
"package": "@wix/sdk_realtime_site"
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
],
|
|
378
|
+
"type": {
|
|
379
|
+
"type": "intrinsic",
|
|
380
|
+
"name": "void"
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
]
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"id": 15,
|
|
387
|
+
"name": "check",
|
|
388
|
+
"variant": "declaration",
|
|
389
|
+
"kind": 2048,
|
|
390
|
+
"flags": {},
|
|
391
|
+
"signatures": [
|
|
392
|
+
{
|
|
393
|
+
"id": 16,
|
|
394
|
+
"name": "check",
|
|
395
|
+
"variant": "signature",
|
|
396
|
+
"kind": 4096,
|
|
397
|
+
"flags": {},
|
|
398
|
+
"comment": {
|
|
399
|
+
"summary": [],
|
|
400
|
+
"blockTags": [
|
|
401
|
+
{
|
|
402
|
+
"tag": "@function",
|
|
403
|
+
"content": [
|
|
404
|
+
{
|
|
405
|
+
"kind": "text",
|
|
406
|
+
"text": "check"
|
|
407
|
+
}
|
|
408
|
+
]
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"tag": "@summary",
|
|
412
|
+
"content": [
|
|
413
|
+
{
|
|
414
|
+
"kind": "text",
|
|
415
|
+
"text": "Checks the permissions for a subscriber on a channel or channel resource."
|
|
416
|
+
}
|
|
417
|
+
]
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"tag": "@description",
|
|
421
|
+
"content": [
|
|
422
|
+
{
|
|
423
|
+
"kind": "text",
|
|
424
|
+
"text": "The "
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
"kind": "code",
|
|
428
|
+
"text": "`check()`"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"kind": "text",
|
|
432
|
+
"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 "
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"kind": "code",
|
|
436
|
+
"text": "`{\"read\": true}`"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"kind": "text",
|
|
440
|
+
"text": "\n\n\n This function is typically called in the body of the\n ["
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"kind": "code",
|
|
444
|
+
"text": "`realtime_check_permission()`"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"kind": "text",
|
|
448
|
+
"text": "](https://dev.wix.com/docs/sdk/backend-modules/realtime/site/realtime-check-permission) function like so:\n\n "
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"kind": "code",
|
|
452
|
+
"text": "```JavaScript\n export function realtime_check_permission(channel, subscriber) {\n return permissionsRouter.check(channel,subscriber);\n }\n ```"
|
|
453
|
+
}
|
|
454
|
+
]
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"tag": "@returns",
|
|
458
|
+
"content": []
|
|
459
|
+
}
|
|
460
|
+
]
|
|
461
|
+
},
|
|
462
|
+
"parameters": [
|
|
463
|
+
{
|
|
464
|
+
"id": 17,
|
|
465
|
+
"name": "channel",
|
|
466
|
+
"variant": "param",
|
|
467
|
+
"kind": 32768,
|
|
468
|
+
"flags": {},
|
|
469
|
+
"comment": {
|
|
470
|
+
"summary": [
|
|
471
|
+
{
|
|
472
|
+
"kind": "text",
|
|
473
|
+
"text": "The channel, and optionally the resource, to publish to."
|
|
474
|
+
}
|
|
475
|
+
]
|
|
476
|
+
},
|
|
477
|
+
"type": {
|
|
478
|
+
"type": "reference",
|
|
479
|
+
"target": 43,
|
|
480
|
+
"name": "Channel",
|
|
481
|
+
"package": "@wix/realtime-common"
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"id": 18,
|
|
486
|
+
"name": "subscriber",
|
|
487
|
+
"variant": "param",
|
|
488
|
+
"kind": 32768,
|
|
489
|
+
"flags": {},
|
|
490
|
+
"comment": {
|
|
491
|
+
"summary": [
|
|
492
|
+
{
|
|
493
|
+
"kind": "text",
|
|
494
|
+
"text": "The subscriber to grant permissions to."
|
|
495
|
+
}
|
|
496
|
+
]
|
|
497
|
+
},
|
|
498
|
+
"type": {
|
|
499
|
+
"type": "reference",
|
|
500
|
+
"target": {
|
|
501
|
+
"sourceFileName": "../realtime-common/cjs/build/types.d.ts",
|
|
502
|
+
"qualifiedName": "Subscriber"
|
|
503
|
+
},
|
|
504
|
+
"name": "Subscriber",
|
|
505
|
+
"package": "@wix/realtime-common"
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
],
|
|
509
|
+
"type": {
|
|
510
|
+
"type": "reference",
|
|
511
|
+
"target": {
|
|
512
|
+
"sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
|
|
513
|
+
"qualifiedName": "Promise"
|
|
514
|
+
},
|
|
515
|
+
"typeArguments": [
|
|
516
|
+
{
|
|
517
|
+
"type": "reflection",
|
|
518
|
+
"declaration": {
|
|
519
|
+
"id": 19,
|
|
520
|
+
"name": "__type",
|
|
521
|
+
"variant": "declaration",
|
|
522
|
+
"kind": 65536,
|
|
523
|
+
"flags": {},
|
|
524
|
+
"children": [
|
|
525
|
+
{
|
|
526
|
+
"id": 20,
|
|
527
|
+
"name": "read",
|
|
528
|
+
"variant": "declaration",
|
|
529
|
+
"kind": 1024,
|
|
530
|
+
"flags": {},
|
|
531
|
+
"type": {
|
|
532
|
+
"type": "intrinsic",
|
|
533
|
+
"name": "boolean"
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"id": 21,
|
|
538
|
+
"name": "write",
|
|
539
|
+
"variant": "declaration",
|
|
540
|
+
"kind": 1024,
|
|
541
|
+
"flags": {},
|
|
542
|
+
"type": {
|
|
543
|
+
"type": "intrinsic",
|
|
544
|
+
"name": "boolean"
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
],
|
|
548
|
+
"groups": [
|
|
549
|
+
{
|
|
550
|
+
"title": "Properties",
|
|
551
|
+
"children": [
|
|
552
|
+
20,
|
|
553
|
+
21
|
|
554
|
+
]
|
|
555
|
+
}
|
|
556
|
+
]
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
],
|
|
560
|
+
"name": "Promise",
|
|
561
|
+
"package": "typescript"
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
]
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
"id": 12,
|
|
568
|
+
"name": "default",
|
|
569
|
+
"variant": "declaration",
|
|
570
|
+
"kind": 2048,
|
|
571
|
+
"flags": {},
|
|
572
|
+
"signatures": [
|
|
573
|
+
{
|
|
574
|
+
"id": 13,
|
|
575
|
+
"name": "default",
|
|
576
|
+
"variant": "signature",
|
|
577
|
+
"kind": 4096,
|
|
578
|
+
"flags": {},
|
|
579
|
+
"comment": {
|
|
580
|
+
"summary": [],
|
|
581
|
+
"blockTags": [
|
|
582
|
+
{
|
|
583
|
+
"tag": "@function",
|
|
584
|
+
"content": [
|
|
585
|
+
{
|
|
586
|
+
"kind": "text",
|
|
587
|
+
"text": "default"
|
|
588
|
+
}
|
|
589
|
+
]
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
"tag": "@summary",
|
|
593
|
+
"content": [
|
|
594
|
+
{
|
|
595
|
+
"kind": "text",
|
|
596
|
+
"text": "Sets a permissions handler for default permissions."
|
|
597
|
+
}
|
|
598
|
+
]
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
"tag": "@description",
|
|
602
|
+
"content": [
|
|
603
|
+
{
|
|
604
|
+
"kind": "text",
|
|
605
|
+
"text": "The handler set by the "
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"kind": "code",
|
|
609
|
+
"text": "`default()`"
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"kind": "text",
|
|
613
|
+
"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 "
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
"kind": "code",
|
|
617
|
+
"text": "`default()`"
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
"kind": "text",
|
|
621
|
+
"text": " function\n + A, 1: use the handler set by "
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"kind": "code",
|
|
625
|
+
"text": "`default()`"
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
"kind": "text",
|
|
629
|
+
"text": " function\n + A, 2: use the handler set by "
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"kind": "code",
|
|
633
|
+
"text": "`add()`"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"kind": "text",
|
|
637
|
+
"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 "
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"kind": "code",
|
|
641
|
+
"text": "`{\"read\": true}`"
|
|
642
|
+
}
|
|
643
|
+
]
|
|
644
|
+
}
|
|
645
|
+
]
|
|
646
|
+
},
|
|
647
|
+
"parameters": [
|
|
648
|
+
{
|
|
649
|
+
"id": 14,
|
|
650
|
+
"name": "permissionHandler",
|
|
651
|
+
"variant": "param",
|
|
652
|
+
"kind": 32768,
|
|
653
|
+
"flags": {},
|
|
654
|
+
"comment": {
|
|
655
|
+
"summary": [
|
|
656
|
+
{
|
|
657
|
+
"kind": "text",
|
|
658
|
+
"text": "Handles setting of permissions for a subscriber on a channel or\n channel resource."
|
|
659
|
+
}
|
|
660
|
+
]
|
|
661
|
+
},
|
|
662
|
+
"type": {
|
|
663
|
+
"type": "reference",
|
|
664
|
+
"target": {
|
|
665
|
+
"sourceFileName": "../site/cjs/build/types.d.ts",
|
|
666
|
+
"qualifiedName": "PermissionHandler"
|
|
667
|
+
},
|
|
668
|
+
"name": "PermissionHandler",
|
|
669
|
+
"package": "@wix/sdk_realtime_site"
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
],
|
|
673
|
+
"type": {
|
|
674
|
+
"type": "intrinsic",
|
|
675
|
+
"name": "void"
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
]
|
|
679
|
+
}
|
|
680
|
+
],
|
|
681
|
+
"groups": [
|
|
682
|
+
{
|
|
683
|
+
"title": "Methods",
|
|
684
|
+
"children": [
|
|
685
|
+
8,
|
|
686
|
+
15,
|
|
687
|
+
12
|
|
688
|
+
]
|
|
689
|
+
}
|
|
690
|
+
]
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
"id": 22,
|
|
694
|
+
"name": "permissionsRouter",
|
|
695
|
+
"variant": "declaration",
|
|
696
|
+
"kind": 32,
|
|
697
|
+
"flags": {
|
|
698
|
+
"isConst": true
|
|
699
|
+
},
|
|
700
|
+
"comment": {
|
|
701
|
+
"summary": [
|
|
702
|
+
{
|
|
703
|
+
"kind": "text",
|
|
704
|
+
"text": "Implementation of the IPermissionsRouter interface."
|
|
705
|
+
}
|
|
706
|
+
]
|
|
707
|
+
},
|
|
708
|
+
"type": {
|
|
709
|
+
"type": "reference",
|
|
710
|
+
"target": 7,
|
|
711
|
+
"name": "PermissionsRouter",
|
|
712
|
+
"package": "@wix/sdk_realtime_site"
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"id": 2,
|
|
717
|
+
"name": "publish",
|
|
718
|
+
"variant": "declaration",
|
|
719
|
+
"kind": 64,
|
|
720
|
+
"flags": {
|
|
721
|
+
"isPublic": true
|
|
722
|
+
},
|
|
723
|
+
"signatures": [
|
|
724
|
+
{
|
|
725
|
+
"id": 3,
|
|
726
|
+
"name": "publish",
|
|
727
|
+
"variant": "signature",
|
|
728
|
+
"kind": 4096,
|
|
729
|
+
"flags": {},
|
|
730
|
+
"comment": {
|
|
731
|
+
"summary": [
|
|
732
|
+
{
|
|
733
|
+
"kind": "text",
|
|
734
|
+
"text": "The "
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"kind": "code",
|
|
738
|
+
"text": "`publish()`"
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
"kind": "text",
|
|
742
|
+
"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 "
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
"kind": "code",
|
|
746
|
+
"text": "`PublishOptions`"
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
"kind": "text",
|
|
750
|
+
"text": " object sent to the "
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
"kind": "code",
|
|
754
|
+
"text": "`options`"
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"kind": "text",
|
|
758
|
+
"text": " parameter.\n\n To include the ID of the user who triggered the publish in the published message,\n set the "
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"kind": "code",
|
|
762
|
+
"text": "`includePublisher`"
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
"kind": "text",
|
|
766
|
+
"text": " property of the "
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
"kind": "code",
|
|
770
|
+
"text": "`PublishOptions`"
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
"kind": "text",
|
|
774
|
+
"text": " object to "
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
"kind": "code",
|
|
778
|
+
"text": "`true`"
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
"kind": "text",
|
|
782
|
+
"text": "."
|
|
783
|
+
}
|
|
784
|
+
]
|
|
785
|
+
},
|
|
786
|
+
"parameters": [
|
|
787
|
+
{
|
|
788
|
+
"id": 4,
|
|
789
|
+
"name": "channel",
|
|
790
|
+
"variant": "param",
|
|
791
|
+
"kind": 32768,
|
|
792
|
+
"flags": {},
|
|
793
|
+
"comment": {
|
|
794
|
+
"summary": [
|
|
795
|
+
{
|
|
796
|
+
"kind": "text",
|
|
797
|
+
"text": "The channel, and optionally the resource, to publish to."
|
|
798
|
+
}
|
|
799
|
+
]
|
|
800
|
+
},
|
|
801
|
+
"type": {
|
|
802
|
+
"type": "reference",
|
|
803
|
+
"target": 43,
|
|
804
|
+
"name": "Channel",
|
|
805
|
+
"package": "@wix/realtime-common"
|
|
806
|
+
}
|
|
807
|
+
},
|
|
808
|
+
{
|
|
809
|
+
"id": 5,
|
|
810
|
+
"name": "payload",
|
|
811
|
+
"variant": "param",
|
|
812
|
+
"kind": 32768,
|
|
813
|
+
"flags": {},
|
|
814
|
+
"comment": {
|
|
815
|
+
"summary": [
|
|
816
|
+
{
|
|
817
|
+
"kind": "text",
|
|
818
|
+
"text": "Message payload. <br /><br /> Max: 10kb"
|
|
819
|
+
}
|
|
820
|
+
]
|
|
821
|
+
},
|
|
822
|
+
"type": {
|
|
823
|
+
"type": "intrinsic",
|
|
824
|
+
"name": "any"
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
"id": 6,
|
|
829
|
+
"name": "options",
|
|
830
|
+
"variant": "param",
|
|
831
|
+
"kind": 32768,
|
|
832
|
+
"flags": {
|
|
833
|
+
"isOptional": true
|
|
834
|
+
},
|
|
835
|
+
"comment": {
|
|
836
|
+
"summary": [
|
|
837
|
+
{
|
|
838
|
+
"kind": "text",
|
|
839
|
+
"text": "Options to use when publishing."
|
|
840
|
+
}
|
|
841
|
+
]
|
|
842
|
+
},
|
|
843
|
+
"type": {
|
|
844
|
+
"type": "reference",
|
|
845
|
+
"target": {
|
|
846
|
+
"sourceFileName": "../realtime-common/cjs/build/types.d.ts",
|
|
847
|
+
"qualifiedName": "PublishOptions"
|
|
848
|
+
},
|
|
849
|
+
"name": "PublishOptions",
|
|
850
|
+
"package": "@wix/realtime-common"
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
],
|
|
854
|
+
"type": {
|
|
855
|
+
"type": "union",
|
|
856
|
+
"types": [
|
|
857
|
+
{
|
|
858
|
+
"type": "intrinsic",
|
|
859
|
+
"name": "void"
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
"type": "reference",
|
|
863
|
+
"target": {
|
|
864
|
+
"sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
|
|
865
|
+
"qualifiedName": "Promise"
|
|
866
|
+
},
|
|
867
|
+
"typeArguments": [
|
|
868
|
+
{
|
|
869
|
+
"type": "intrinsic",
|
|
870
|
+
"name": "void"
|
|
871
|
+
}
|
|
872
|
+
],
|
|
873
|
+
"name": "Promise",
|
|
874
|
+
"package": "typescript"
|
|
875
|
+
}
|
|
876
|
+
]
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
]
|
|
880
|
+
}
|
|
881
|
+
],
|
|
882
|
+
"groups": [
|
|
883
|
+
{
|
|
884
|
+
"title": "Interfaces",
|
|
885
|
+
"children": [
|
|
886
|
+
7
|
|
887
|
+
]
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
"title": "Variables",
|
|
891
|
+
"children": [
|
|
892
|
+
22
|
|
893
|
+
]
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
"title": "Functions",
|
|
897
|
+
"children": [
|
|
898
|
+
2
|
|
899
|
+
]
|
|
900
|
+
}
|
|
901
|
+
]
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"id": 30,
|
|
905
|
+
"name": "subscriber",
|
|
906
|
+
"variant": "declaration",
|
|
907
|
+
"kind": 4,
|
|
908
|
+
"flags": {},
|
|
909
|
+
"children": [
|
|
910
|
+
{
|
|
911
|
+
"id": 31,
|
|
912
|
+
"name": "subscribe",
|
|
913
|
+
"variant": "declaration",
|
|
914
|
+
"kind": 64,
|
|
915
|
+
"flags": {},
|
|
916
|
+
"signatures": [
|
|
917
|
+
{
|
|
918
|
+
"id": 32,
|
|
919
|
+
"name": "subscribe",
|
|
920
|
+
"variant": "signature",
|
|
921
|
+
"kind": 4096,
|
|
922
|
+
"flags": {},
|
|
923
|
+
"comment": {
|
|
924
|
+
"summary": [
|
|
925
|
+
{
|
|
926
|
+
"kind": "text",
|
|
927
|
+
"text": "Subscribe to a channel. Returns a subscriptionId immediately; the\nactual connection is established asynchronously in the background. Use the\noptional "
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
"kind": "code",
|
|
931
|
+
"text": "`options`"
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
"kind": "text",
|
|
935
|
+
"text": " parameter to handle subscription lifecycle events.\n\n**Manual client (self-hosted / explicit auth):**\n\n"
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
"kind": "code",
|
|
939
|
+
"text": "```ts\nimport { subscriber } from '@wix/realtime';\nimport { createClient, AppStrategy } from '@wix/sdk';\n\nconst client = createClient({\n modules: { subscriber },\n auth: AppStrategy({ appId, appSecret, instanceId }),\n});\n\nconst subscriptionId = client.subscriber.subscribe(\n { name: 'my-channel' },\n (message, channel) => {\n console.log('Received:', message.payload);\n },\n {\n onSubscribed: (id, isSynced) => console.log('Subscribed', id),\n onSubscriptionError: (error, id) => console.error('Error', error),\n },\n);\n```"
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
"kind": "text",
|
|
943
|
+
"text": "\n\n**Contextual client (Wix-hosted):**\n\n"
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
"kind": "code",
|
|
947
|
+
"text": "```ts\nimport { subscriber } from '@wix/realtime';\n\nconst subscriptionId = subscriber.subscribe(\n { name: 'my-channel' },\n (message, channel) => {\n console.log('Received:', message.payload);\n },\n);\n```"
|
|
948
|
+
}
|
|
949
|
+
]
|
|
950
|
+
},
|
|
951
|
+
"parameters": [
|
|
952
|
+
{
|
|
953
|
+
"id": 33,
|
|
954
|
+
"name": "channel",
|
|
955
|
+
"variant": "param",
|
|
956
|
+
"kind": 32768,
|
|
957
|
+
"flags": {},
|
|
958
|
+
"comment": {
|
|
959
|
+
"summary": [
|
|
960
|
+
{
|
|
961
|
+
"kind": "text",
|
|
962
|
+
"text": "The channel, and optionally the resource, to subscribe to."
|
|
963
|
+
}
|
|
964
|
+
]
|
|
965
|
+
},
|
|
966
|
+
"type": {
|
|
967
|
+
"type": "reference",
|
|
968
|
+
"target": 43,
|
|
969
|
+
"name": "Channel",
|
|
970
|
+
"package": "@wix/realtime-common"
|
|
971
|
+
}
|
|
972
|
+
},
|
|
973
|
+
{
|
|
974
|
+
"id": 34,
|
|
975
|
+
"name": "messageHandler",
|
|
976
|
+
"variant": "param",
|
|
977
|
+
"kind": 32768,
|
|
978
|
+
"flags": {},
|
|
979
|
+
"comment": {
|
|
980
|
+
"summary": [
|
|
981
|
+
{
|
|
982
|
+
"kind": "text",
|
|
983
|
+
"text": "Callback invoked whenever a message is published to the channel."
|
|
984
|
+
}
|
|
985
|
+
]
|
|
986
|
+
},
|
|
987
|
+
"type": {
|
|
988
|
+
"type": "reference",
|
|
989
|
+
"target": 49,
|
|
990
|
+
"name": "MessageHandler",
|
|
991
|
+
"package": "@wix/realtime-common"
|
|
992
|
+
}
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
"id": 35,
|
|
996
|
+
"name": "options",
|
|
997
|
+
"variant": "param",
|
|
998
|
+
"kind": 32768,
|
|
999
|
+
"flags": {
|
|
1000
|
+
"isOptional": true
|
|
1001
|
+
},
|
|
1002
|
+
"comment": {
|
|
1003
|
+
"summary": [
|
|
1004
|
+
{
|
|
1005
|
+
"kind": "text",
|
|
1006
|
+
"text": "Optional lifecycle handlers for subscription events."
|
|
1007
|
+
}
|
|
1008
|
+
]
|
|
1009
|
+
},
|
|
1010
|
+
"type": {
|
|
1011
|
+
"type": "reference",
|
|
1012
|
+
"target": 66,
|
|
1013
|
+
"name": "SubscriptionOptions",
|
|
1014
|
+
"package": "@wix/realtime-common"
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
],
|
|
1018
|
+
"type": {
|
|
1019
|
+
"type": "intrinsic",
|
|
1020
|
+
"name": "string"
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
{
|
|
1024
|
+
"id": 36,
|
|
1025
|
+
"name": "subscribe",
|
|
1026
|
+
"variant": "signature",
|
|
1027
|
+
"kind": 4096,
|
|
1028
|
+
"flags": {},
|
|
1029
|
+
"comment": {
|
|
1030
|
+
"summary": [
|
|
1031
|
+
{
|
|
1032
|
+
"kind": "text",
|
|
1033
|
+
"text": "Subscribe to a channel. Returns a subscriptionId immediately; the\nactual connection is established asynchronously in the background. Use the\noptional "
|
|
1034
|
+
},
|
|
1035
|
+
{
|
|
1036
|
+
"kind": "code",
|
|
1037
|
+
"text": "`options`"
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
"kind": "text",
|
|
1041
|
+
"text": " parameter to handle subscription lifecycle events.\n\n**Manual client (self-hosted / explicit auth):**\n\n"
|
|
1042
|
+
},
|
|
1043
|
+
{
|
|
1044
|
+
"kind": "code",
|
|
1045
|
+
"text": "```ts\nimport { subscriber } from '@wix/realtime';\nimport { createClient, AppStrategy } from '@wix/sdk';\n\nconst client = createClient({\n modules: { subscriber },\n auth: AppStrategy({ appId, appSecret, instanceId }),\n});\n\nconst subscriptionId = client.subscriber.subscribe(\n { name: 'my-channel' },\n (message, channel) => {\n console.log('Received:', message.payload);\n },\n {\n onSubscribed: (id, isSynced) => console.log('Subscribed', id),\n onSubscriptionError: (error, id) => console.error('Error', error),\n },\n);\n```"
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
"kind": "text",
|
|
1049
|
+
"text": "\n\n**Contextual client (Wix-hosted):**\n\n"
|
|
1050
|
+
},
|
|
1051
|
+
{
|
|
1052
|
+
"kind": "code",
|
|
1053
|
+
"text": "```ts\nimport { subscriber } from '@wix/realtime';\n\nconst subscriptionId = subscriber.subscribe(\n { name: 'my-channel' },\n (message, channel) => {\n console.log('Received:', message.payload);\n },\n);\n```"
|
|
1054
|
+
}
|
|
1055
|
+
]
|
|
1056
|
+
},
|
|
1057
|
+
"parameters": [
|
|
1058
|
+
{
|
|
1059
|
+
"id": 37,
|
|
1060
|
+
"name": "httpClient",
|
|
1061
|
+
"variant": "param",
|
|
1062
|
+
"kind": 32768,
|
|
1063
|
+
"flags": {},
|
|
1064
|
+
"type": {
|
|
1065
|
+
"type": "reference",
|
|
1066
|
+
"target": {
|
|
1067
|
+
"sourceFileName": "../../node_modules/@wix/sdk-types/build/index.d.ts",
|
|
1068
|
+
"qualifiedName": "HttpClient"
|
|
1069
|
+
},
|
|
1070
|
+
"name": "HttpClient",
|
|
1071
|
+
"package": "@wix/sdk-types"
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
],
|
|
1075
|
+
"type": {
|
|
1076
|
+
"type": "reference",
|
|
1077
|
+
"target": {
|
|
1078
|
+
"sourceFileName": "src/subscriber/subscriber.public.ts",
|
|
1079
|
+
"qualifiedName": "SubscribeSignature"
|
|
1080
|
+
},
|
|
1081
|
+
"name": "SubscribeSignature",
|
|
1082
|
+
"package": "@wix/realtime"
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
]
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
"id": 38,
|
|
1089
|
+
"name": "unsubscribe",
|
|
1090
|
+
"variant": "declaration",
|
|
1091
|
+
"kind": 64,
|
|
1092
|
+
"flags": {},
|
|
1093
|
+
"signatures": [
|
|
1094
|
+
{
|
|
1095
|
+
"id": 39,
|
|
1096
|
+
"name": "unsubscribe",
|
|
1097
|
+
"variant": "signature",
|
|
1098
|
+
"kind": 4096,
|
|
1099
|
+
"flags": {},
|
|
1100
|
+
"comment": {
|
|
1101
|
+
"summary": [
|
|
1102
|
+
{
|
|
1103
|
+
"kind": "text",
|
|
1104
|
+
"text": "Unsubscribe from a subscription by its ID, by channel, or both.\n\nYou can unsubscribe in three ways:\n- By "
|
|
1105
|
+
},
|
|
1106
|
+
{
|
|
1107
|
+
"kind": "code",
|
|
1108
|
+
"text": "`subscriptionId`"
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
"kind": "text",
|
|
1112
|
+
"text": " — removes a single subscription.\n- By "
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
"kind": "code",
|
|
1116
|
+
"text": "`channel`"
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
"kind": "text",
|
|
1120
|
+
"text": " — removes all subscriptions to that channel.\n- By both — removes the specific subscription, verifying it matches the channel.\n\n**Manual client (self-hosted / explicit auth):**\n\n"
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
"kind": "code",
|
|
1124
|
+
"text": "```ts\nimport { subscriber } from '@wix/realtime';\nimport { createClient, AppStrategy } from '@wix/sdk';\n\nconst client = createClient({\n modules: { subscriber },\n auth: AppStrategy({ appId, appSecret, instanceId }),\n});\n\n// Unsubscribe by subscription ID\nclient.subscriber.unsubscribe({ subscriptionId });\n\n// Unsubscribe from all subscriptions to a channel\nclient.subscriber.unsubscribe({ channel: { name: 'my-channel' } });\n```"
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
"kind": "text",
|
|
1128
|
+
"text": "\n\n**Contextual client (Wix-hosted):**\n\n"
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
"kind": "code",
|
|
1132
|
+
"text": "```ts\nimport { subscriber } from '@wix/realtime';\n\nsubscriber.unsubscribe({ subscriptionId });\n```"
|
|
1133
|
+
}
|
|
1134
|
+
]
|
|
1135
|
+
},
|
|
1136
|
+
"parameters": [
|
|
1137
|
+
{
|
|
1138
|
+
"id": 40,
|
|
1139
|
+
"name": "options",
|
|
1140
|
+
"variant": "param",
|
|
1141
|
+
"kind": 32768,
|
|
1142
|
+
"flags": {},
|
|
1143
|
+
"comment": {
|
|
1144
|
+
"summary": [
|
|
1145
|
+
{
|
|
1146
|
+
"kind": "text",
|
|
1147
|
+
"text": "Identifies what to unsubscribe from — by subscription ID, channel, or both."
|
|
1148
|
+
}
|
|
1149
|
+
]
|
|
1150
|
+
},
|
|
1151
|
+
"type": {
|
|
1152
|
+
"type": "reference",
|
|
1153
|
+
"target": 69,
|
|
1154
|
+
"name": "UnsubscribeOptions",
|
|
1155
|
+
"package": "@wix/realtime-common"
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
],
|
|
1159
|
+
"type": {
|
|
1160
|
+
"type": "intrinsic",
|
|
1161
|
+
"name": "void"
|
|
1162
|
+
}
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
"id": 41,
|
|
1166
|
+
"name": "unsubscribe",
|
|
1167
|
+
"variant": "signature",
|
|
1168
|
+
"kind": 4096,
|
|
1169
|
+
"flags": {},
|
|
1170
|
+
"comment": {
|
|
1171
|
+
"summary": [
|
|
1172
|
+
{
|
|
1173
|
+
"kind": "text",
|
|
1174
|
+
"text": "Unsubscribe from a subscription by its ID, by channel, or both.\n\nYou can unsubscribe in three ways:\n- By "
|
|
1175
|
+
},
|
|
1176
|
+
{
|
|
1177
|
+
"kind": "code",
|
|
1178
|
+
"text": "`subscriptionId`"
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
"kind": "text",
|
|
1182
|
+
"text": " — removes a single subscription.\n- By "
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
"kind": "code",
|
|
1186
|
+
"text": "`channel`"
|
|
1187
|
+
},
|
|
1188
|
+
{
|
|
1189
|
+
"kind": "text",
|
|
1190
|
+
"text": " — removes all subscriptions to that channel.\n- By both — removes the specific subscription, verifying it matches the channel.\n\n**Manual client (self-hosted / explicit auth):**\n\n"
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
"kind": "code",
|
|
1194
|
+
"text": "```ts\nimport { subscriber } from '@wix/realtime';\nimport { createClient, AppStrategy } from '@wix/sdk';\n\nconst client = createClient({\n modules: { subscriber },\n auth: AppStrategy({ appId, appSecret, instanceId }),\n});\n\n// Unsubscribe by subscription ID\nclient.subscriber.unsubscribe({ subscriptionId });\n\n// Unsubscribe from all subscriptions to a channel\nclient.subscriber.unsubscribe({ channel: { name: 'my-channel' } });\n```"
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
"kind": "text",
|
|
1198
|
+
"text": "\n\n**Contextual client (Wix-hosted):**\n\n"
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
"kind": "code",
|
|
1202
|
+
"text": "```ts\nimport { subscriber } from '@wix/realtime';\n\nsubscriber.unsubscribe({ subscriptionId });\n```"
|
|
1203
|
+
}
|
|
1204
|
+
]
|
|
1205
|
+
},
|
|
1206
|
+
"parameters": [
|
|
1207
|
+
{
|
|
1208
|
+
"id": 42,
|
|
1209
|
+
"name": "_",
|
|
1210
|
+
"variant": "param",
|
|
1211
|
+
"kind": 32768,
|
|
1212
|
+
"flags": {},
|
|
1213
|
+
"type": {
|
|
1214
|
+
"type": "reference",
|
|
1215
|
+
"target": {
|
|
1216
|
+
"sourceFileName": "../../node_modules/@wix/sdk-types/build/index.d.ts",
|
|
1217
|
+
"qualifiedName": "HttpClient"
|
|
1218
|
+
},
|
|
1219
|
+
"name": "HttpClient",
|
|
1220
|
+
"package": "@wix/sdk-types"
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
],
|
|
1224
|
+
"type": {
|
|
1225
|
+
"type": "reference",
|
|
1226
|
+
"target": {
|
|
1227
|
+
"sourceFileName": "src/subscriber/subscriber.public.ts",
|
|
1228
|
+
"qualifiedName": "UnsubscribeSignature"
|
|
1229
|
+
},
|
|
1230
|
+
"name": "UnsubscribeSignature",
|
|
1231
|
+
"package": "@wix/realtime"
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
]
|
|
1235
|
+
}
|
|
1236
|
+
],
|
|
1237
|
+
"groups": [
|
|
1238
|
+
{
|
|
1239
|
+
"title": "Functions",
|
|
1240
|
+
"children": [
|
|
1241
|
+
31,
|
|
1242
|
+
38
|
|
1243
|
+
]
|
|
1244
|
+
}
|
|
1245
|
+
]
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
"id": 86,
|
|
1249
|
+
"name": "RealtimeErrorCode",
|
|
1250
|
+
"variant": "declaration",
|
|
1251
|
+
"kind": 8,
|
|
1252
|
+
"flags": {},
|
|
1253
|
+
"comment": {
|
|
1254
|
+
"summary": [
|
|
1255
|
+
{
|
|
1256
|
+
"kind": "text",
|
|
1257
|
+
"text": "Error codes for realtime errors."
|
|
1258
|
+
}
|
|
1259
|
+
]
|
|
1260
|
+
},
|
|
1261
|
+
"children": [
|
|
1262
|
+
{
|
|
1263
|
+
"id": 90,
|
|
1264
|
+
"name": "BadInput",
|
|
1265
|
+
"variant": "declaration",
|
|
1266
|
+
"kind": 16,
|
|
1267
|
+
"flags": {},
|
|
1268
|
+
"comment": {
|
|
1269
|
+
"summary": [
|
|
1270
|
+
{
|
|
1271
|
+
"kind": "text",
|
|
1272
|
+
"text": "Invalid input (e.g. bad channel name)."
|
|
1273
|
+
}
|
|
1274
|
+
]
|
|
1275
|
+
},
|
|
1276
|
+
"type": {
|
|
1277
|
+
"type": "literal",
|
|
1278
|
+
"value": "BAD_INPUT"
|
|
1279
|
+
}
|
|
1280
|
+
},
|
|
1281
|
+
{
|
|
1282
|
+
"id": 88,
|
|
1283
|
+
"name": "ConnectionError",
|
|
1284
|
+
"variant": "declaration",
|
|
1285
|
+
"kind": 16,
|
|
1286
|
+
"flags": {},
|
|
1287
|
+
"comment": {
|
|
1288
|
+
"summary": [
|
|
1289
|
+
{
|
|
1290
|
+
"kind": "text",
|
|
1291
|
+
"text": "A connection attempt failed. The client keeps retrying automatically."
|
|
1292
|
+
}
|
|
1293
|
+
]
|
|
1294
|
+
},
|
|
1295
|
+
"type": {
|
|
1296
|
+
"type": "literal",
|
|
1297
|
+
"value": "CONNECTION_ERROR"
|
|
1298
|
+
}
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
"id": 87,
|
|
1302
|
+
"name": "Disconnected",
|
|
1303
|
+
"variant": "declaration",
|
|
1304
|
+
"kind": 16,
|
|
1305
|
+
"flags": {},
|
|
1306
|
+
"comment": {
|
|
1307
|
+
"summary": [
|
|
1308
|
+
{
|
|
1309
|
+
"kind": "text",
|
|
1310
|
+
"text": "The connection was closed, either intentionally or due to an error."
|
|
1311
|
+
}
|
|
1312
|
+
]
|
|
1313
|
+
},
|
|
1314
|
+
"type": {
|
|
1315
|
+
"type": "literal",
|
|
1316
|
+
"value": "DISCONNECTED"
|
|
1317
|
+
}
|
|
1318
|
+
},
|
|
1319
|
+
{
|
|
1320
|
+
"id": 89,
|
|
1321
|
+
"name": "SubscriptionFailed",
|
|
1322
|
+
"variant": "declaration",
|
|
1323
|
+
"kind": 16,
|
|
1324
|
+
"flags": {},
|
|
1325
|
+
"comment": {
|
|
1326
|
+
"summary": [
|
|
1327
|
+
{
|
|
1328
|
+
"kind": "text",
|
|
1329
|
+
"text": "The subscription request failed (e.g. authorization error)."
|
|
1330
|
+
}
|
|
1331
|
+
]
|
|
1332
|
+
},
|
|
1333
|
+
"type": {
|
|
1334
|
+
"type": "literal",
|
|
1335
|
+
"value": "SUBSCRIPTION_FAILED"
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
],
|
|
1339
|
+
"groups": [
|
|
1340
|
+
{
|
|
1341
|
+
"title": "Enumeration Members",
|
|
1342
|
+
"children": [
|
|
1343
|
+
90,
|
|
1344
|
+
88,
|
|
1345
|
+
87,
|
|
1346
|
+
89
|
|
1347
|
+
]
|
|
1348
|
+
}
|
|
1349
|
+
]
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
"id": 72,
|
|
1353
|
+
"name": "RealtimeError",
|
|
1354
|
+
"variant": "declaration",
|
|
1355
|
+
"kind": 128,
|
|
1356
|
+
"flags": {},
|
|
1357
|
+
"comment": {
|
|
1358
|
+
"summary": [
|
|
1359
|
+
{
|
|
1360
|
+
"kind": "text",
|
|
1361
|
+
"text": "An object representing an error."
|
|
1362
|
+
}
|
|
1363
|
+
]
|
|
1364
|
+
},
|
|
1365
|
+
"children": [
|
|
1366
|
+
{
|
|
1367
|
+
"id": 73,
|
|
1368
|
+
"name": "constructor",
|
|
1369
|
+
"variant": "declaration",
|
|
1370
|
+
"kind": 512,
|
|
1371
|
+
"flags": {},
|
|
1372
|
+
"signatures": [
|
|
1373
|
+
{
|
|
1374
|
+
"id": 74,
|
|
1375
|
+
"name": "new RealtimeError",
|
|
1376
|
+
"variant": "signature",
|
|
1377
|
+
"kind": 16384,
|
|
1378
|
+
"flags": {},
|
|
1379
|
+
"parameters": [
|
|
1380
|
+
{
|
|
1381
|
+
"id": 75,
|
|
1382
|
+
"name": "errorCode",
|
|
1383
|
+
"variant": "param",
|
|
1384
|
+
"kind": 32768,
|
|
1385
|
+
"flags": {},
|
|
1386
|
+
"type": {
|
|
1387
|
+
"type": "reference",
|
|
1388
|
+
"target": 86,
|
|
1389
|
+
"name": "RealtimeErrorCode",
|
|
1390
|
+
"package": "@wix/realtime-common"
|
|
1391
|
+
}
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
"id": 76,
|
|
1395
|
+
"name": "message",
|
|
1396
|
+
"variant": "param",
|
|
1397
|
+
"kind": 32768,
|
|
1398
|
+
"flags": {},
|
|
1399
|
+
"type": {
|
|
1400
|
+
"type": "intrinsic",
|
|
1401
|
+
"name": "string"
|
|
1402
|
+
}
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
"id": 77,
|
|
1406
|
+
"name": "options",
|
|
1407
|
+
"variant": "param",
|
|
1408
|
+
"kind": 32768,
|
|
1409
|
+
"flags": {
|
|
1410
|
+
"isOptional": true
|
|
1411
|
+
},
|
|
1412
|
+
"type": {
|
|
1413
|
+
"type": "reflection",
|
|
1414
|
+
"declaration": {
|
|
1415
|
+
"id": 78,
|
|
1416
|
+
"name": "__type",
|
|
1417
|
+
"variant": "declaration",
|
|
1418
|
+
"kind": 65536,
|
|
1419
|
+
"flags": {},
|
|
1420
|
+
"children": [
|
|
1421
|
+
{
|
|
1422
|
+
"id": 79,
|
|
1423
|
+
"name": "channel",
|
|
1424
|
+
"variant": "declaration",
|
|
1425
|
+
"kind": 1024,
|
|
1426
|
+
"flags": {
|
|
1427
|
+
"isOptional": true
|
|
1428
|
+
},
|
|
1429
|
+
"type": {
|
|
1430
|
+
"type": "reference",
|
|
1431
|
+
"target": 43,
|
|
1432
|
+
"name": "Channel",
|
|
1433
|
+
"package": "@wix/realtime-common"
|
|
1434
|
+
}
|
|
1435
|
+
},
|
|
1436
|
+
{
|
|
1437
|
+
"id": 80,
|
|
1438
|
+
"name": "recoverable",
|
|
1439
|
+
"variant": "declaration",
|
|
1440
|
+
"kind": 1024,
|
|
1441
|
+
"flags": {
|
|
1442
|
+
"isOptional": true
|
|
1443
|
+
},
|
|
1444
|
+
"type": {
|
|
1445
|
+
"type": "intrinsic",
|
|
1446
|
+
"name": "boolean"
|
|
1447
|
+
}
|
|
1448
|
+
},
|
|
1449
|
+
{
|
|
1450
|
+
"id": 81,
|
|
1451
|
+
"name": "status",
|
|
1452
|
+
"variant": "declaration",
|
|
1453
|
+
"kind": 1024,
|
|
1454
|
+
"flags": {
|
|
1455
|
+
"isOptional": true
|
|
1456
|
+
},
|
|
1457
|
+
"type": {
|
|
1458
|
+
"type": "intrinsic",
|
|
1459
|
+
"name": "number"
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
],
|
|
1463
|
+
"groups": [
|
|
1464
|
+
{
|
|
1465
|
+
"title": "Properties",
|
|
1466
|
+
"children": [
|
|
1467
|
+
79,
|
|
1468
|
+
80,
|
|
1469
|
+
81
|
|
1470
|
+
]
|
|
1471
|
+
}
|
|
1472
|
+
]
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
],
|
|
1477
|
+
"type": {
|
|
1478
|
+
"type": "reference",
|
|
1479
|
+
"target": 72,
|
|
1480
|
+
"name": "RealtimeError",
|
|
1481
|
+
"package": "@wix/realtime-common"
|
|
1482
|
+
},
|
|
1483
|
+
"overwrites": {
|
|
1484
|
+
"type": "reference",
|
|
1485
|
+
"target": -1,
|
|
1486
|
+
"name": "Error.constructor"
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
],
|
|
1490
|
+
"overwrites": {
|
|
1491
|
+
"type": "reference",
|
|
1492
|
+
"target": -1,
|
|
1493
|
+
"name": "Error.constructor"
|
|
1494
|
+
}
|
|
1495
|
+
},
|
|
1496
|
+
{
|
|
1497
|
+
"id": 83,
|
|
1498
|
+
"name": "channel",
|
|
1499
|
+
"variant": "declaration",
|
|
1500
|
+
"kind": 1024,
|
|
1501
|
+
"flags": {
|
|
1502
|
+
"isOptional": true
|
|
1503
|
+
},
|
|
1504
|
+
"comment": {
|
|
1505
|
+
"summary": [
|
|
1506
|
+
{
|
|
1507
|
+
"kind": "text",
|
|
1508
|
+
"text": "Channel related to the error."
|
|
1509
|
+
}
|
|
1510
|
+
]
|
|
1511
|
+
},
|
|
1512
|
+
"type": {
|
|
1513
|
+
"type": "reference",
|
|
1514
|
+
"target": 43,
|
|
1515
|
+
"name": "Channel",
|
|
1516
|
+
"package": "@wix/realtime-common"
|
|
1517
|
+
}
|
|
1518
|
+
},
|
|
1519
|
+
{
|
|
1520
|
+
"id": 82,
|
|
1521
|
+
"name": "errorCode",
|
|
1522
|
+
"variant": "declaration",
|
|
1523
|
+
"kind": 1024,
|
|
1524
|
+
"flags": {},
|
|
1525
|
+
"comment": {
|
|
1526
|
+
"summary": [
|
|
1527
|
+
{
|
|
1528
|
+
"kind": "text",
|
|
1529
|
+
"text": "Error code."
|
|
1530
|
+
}
|
|
1531
|
+
]
|
|
1532
|
+
},
|
|
1533
|
+
"type": {
|
|
1534
|
+
"type": "reference",
|
|
1535
|
+
"target": 86,
|
|
1536
|
+
"name": "RealtimeErrorCode",
|
|
1537
|
+
"package": "@wix/realtime-common"
|
|
1538
|
+
}
|
|
1539
|
+
},
|
|
1540
|
+
{
|
|
1541
|
+
"id": 84,
|
|
1542
|
+
"name": "recoverable",
|
|
1543
|
+
"variant": "declaration",
|
|
1544
|
+
"kind": 1024,
|
|
1545
|
+
"flags": {
|
|
1546
|
+
"isOptional": true
|
|
1547
|
+
},
|
|
1548
|
+
"comment": {
|
|
1549
|
+
"summary": [
|
|
1550
|
+
{
|
|
1551
|
+
"kind": "text",
|
|
1552
|
+
"text": "Whether the error is recoverable. When "
|
|
1553
|
+
},
|
|
1554
|
+
{
|
|
1555
|
+
"kind": "code",
|
|
1556
|
+
"text": "`true`"
|
|
1557
|
+
},
|
|
1558
|
+
{
|
|
1559
|
+
"kind": "text",
|
|
1560
|
+
"text": ", the client is\nautomatically attempting to reconnect. When "
|
|
1561
|
+
},
|
|
1562
|
+
{
|
|
1563
|
+
"kind": "code",
|
|
1564
|
+
"text": "`false`"
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
"kind": "text",
|
|
1568
|
+
"text": ", user action\nis required (for example, the subscription must be re-created)."
|
|
1569
|
+
}
|
|
1570
|
+
]
|
|
1571
|
+
},
|
|
1572
|
+
"type": {
|
|
1573
|
+
"type": "intrinsic",
|
|
1574
|
+
"name": "boolean"
|
|
1575
|
+
}
|
|
1576
|
+
},
|
|
1577
|
+
{
|
|
1578
|
+
"id": 85,
|
|
1579
|
+
"name": "status",
|
|
1580
|
+
"variant": "declaration",
|
|
1581
|
+
"kind": 1024,
|
|
1582
|
+
"flags": {
|
|
1583
|
+
"isOptional": true
|
|
1584
|
+
},
|
|
1585
|
+
"comment": {
|
|
1586
|
+
"summary": [
|
|
1587
|
+
{
|
|
1588
|
+
"kind": "text",
|
|
1589
|
+
"text": "HTTP status code from the server response.\nPresent on subscription failed errors (e.g. 401, 403, 500)."
|
|
1590
|
+
}
|
|
1591
|
+
]
|
|
1592
|
+
},
|
|
1593
|
+
"type": {
|
|
1594
|
+
"type": "intrinsic",
|
|
1595
|
+
"name": "number"
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
],
|
|
1599
|
+
"groups": [
|
|
1600
|
+
{
|
|
1601
|
+
"title": "Constructors",
|
|
1602
|
+
"children": [
|
|
1603
|
+
73
|
|
1604
|
+
]
|
|
1605
|
+
},
|
|
1606
|
+
{
|
|
1607
|
+
"title": "Properties",
|
|
1608
|
+
"children": [
|
|
1609
|
+
83,
|
|
1610
|
+
82,
|
|
1611
|
+
84,
|
|
1612
|
+
85
|
|
1613
|
+
]
|
|
1614
|
+
}
|
|
1615
|
+
],
|
|
1616
|
+
"extendedTypes": [
|
|
1617
|
+
{
|
|
1618
|
+
"type": "reference",
|
|
1619
|
+
"target": {
|
|
1620
|
+
"sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
|
|
1621
|
+
"qualifiedName": "Error"
|
|
1622
|
+
},
|
|
1623
|
+
"name": "Error",
|
|
1624
|
+
"package": "typescript"
|
|
1625
|
+
}
|
|
1626
|
+
]
|
|
1627
|
+
},
|
|
1628
|
+
{
|
|
1629
|
+
"id": 43,
|
|
1630
|
+
"name": "Channel",
|
|
1631
|
+
"variant": "declaration",
|
|
1632
|
+
"kind": 256,
|
|
1633
|
+
"flags": {},
|
|
1634
|
+
"comment": {
|
|
1635
|
+
"summary": [
|
|
1636
|
+
{
|
|
1637
|
+
"kind": "text",
|
|
1638
|
+
"text": "An object representing a realtime channel."
|
|
1639
|
+
}
|
|
1640
|
+
]
|
|
1641
|
+
},
|
|
1642
|
+
"children": [
|
|
1643
|
+
{
|
|
1644
|
+
"id": 44,
|
|
1645
|
+
"name": "name",
|
|
1646
|
+
"variant": "declaration",
|
|
1647
|
+
"kind": 1024,
|
|
1648
|
+
"flags": {},
|
|
1649
|
+
"comment": {
|
|
1650
|
+
"summary": [
|
|
1651
|
+
{
|
|
1652
|
+
"kind": "text",
|
|
1653
|
+
"text": "Channel name. Only alphanumeric characters, hyphens, and underscores are allowed.\nThe combined length of "
|
|
1654
|
+
},
|
|
1655
|
+
{
|
|
1656
|
+
"kind": "code",
|
|
1657
|
+
"text": "`name`"
|
|
1658
|
+
},
|
|
1659
|
+
{
|
|
1660
|
+
"kind": "text",
|
|
1661
|
+
"text": " and "
|
|
1662
|
+
},
|
|
1663
|
+
{
|
|
1664
|
+
"kind": "code",
|
|
1665
|
+
"text": "`resourceId`"
|
|
1666
|
+
},
|
|
1667
|
+
{
|
|
1668
|
+
"kind": "text",
|
|
1669
|
+
"text": " cannot exceed 140 characters."
|
|
1670
|
+
}
|
|
1671
|
+
]
|
|
1672
|
+
},
|
|
1673
|
+
"type": {
|
|
1674
|
+
"type": "intrinsic",
|
|
1675
|
+
"name": "string"
|
|
1676
|
+
}
|
|
1677
|
+
},
|
|
1678
|
+
{
|
|
1679
|
+
"id": 45,
|
|
1680
|
+
"name": "resourceId",
|
|
1681
|
+
"variant": "declaration",
|
|
1682
|
+
"kind": 1024,
|
|
1683
|
+
"flags": {
|
|
1684
|
+
"isOptional": true
|
|
1685
|
+
},
|
|
1686
|
+
"comment": {
|
|
1687
|
+
"summary": [
|
|
1688
|
+
{
|
|
1689
|
+
"kind": "text",
|
|
1690
|
+
"text": "ID of a specific channel resource."
|
|
1691
|
+
}
|
|
1692
|
+
]
|
|
1693
|
+
},
|
|
1694
|
+
"type": {
|
|
1695
|
+
"type": "intrinsic",
|
|
1696
|
+
"name": "string"
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
],
|
|
1700
|
+
"groups": [
|
|
1701
|
+
{
|
|
1702
|
+
"title": "Properties",
|
|
1703
|
+
"children": [
|
|
1704
|
+
44,
|
|
1705
|
+
45
|
|
1706
|
+
]
|
|
1707
|
+
}
|
|
1708
|
+
]
|
|
1709
|
+
},
|
|
1710
|
+
{
|
|
1711
|
+
"id": 46,
|
|
1712
|
+
"name": "Message",
|
|
1713
|
+
"variant": "declaration",
|
|
1714
|
+
"kind": 256,
|
|
1715
|
+
"flags": {},
|
|
1716
|
+
"comment": {
|
|
1717
|
+
"summary": [
|
|
1718
|
+
{
|
|
1719
|
+
"kind": "text",
|
|
1720
|
+
"text": "An object representing a published message."
|
|
1721
|
+
}
|
|
1722
|
+
]
|
|
1723
|
+
},
|
|
1724
|
+
"children": [
|
|
1725
|
+
{
|
|
1726
|
+
"id": 47,
|
|
1727
|
+
"name": "payload",
|
|
1728
|
+
"variant": "declaration",
|
|
1729
|
+
"kind": 1024,
|
|
1730
|
+
"flags": {},
|
|
1731
|
+
"comment": {
|
|
1732
|
+
"summary": [
|
|
1733
|
+
{
|
|
1734
|
+
"kind": "text",
|
|
1735
|
+
"text": "Message payload.\nMax: 10kb"
|
|
1736
|
+
}
|
|
1737
|
+
]
|
|
1738
|
+
},
|
|
1739
|
+
"type": {
|
|
1740
|
+
"type": "reference",
|
|
1741
|
+
"target": {
|
|
1742
|
+
"sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts",
|
|
1743
|
+
"qualifiedName": "Record"
|
|
1744
|
+
},
|
|
1745
|
+
"typeArguments": [
|
|
1746
|
+
{
|
|
1747
|
+
"type": "intrinsic",
|
|
1748
|
+
"name": "string"
|
|
1749
|
+
},
|
|
1750
|
+
{
|
|
1751
|
+
"type": "intrinsic",
|
|
1752
|
+
"name": "any"
|
|
1753
|
+
}
|
|
1754
|
+
],
|
|
1755
|
+
"name": "Record",
|
|
1756
|
+
"package": "typescript"
|
|
1757
|
+
}
|
|
1758
|
+
},
|
|
1759
|
+
{
|
|
1760
|
+
"id": 48,
|
|
1761
|
+
"name": "publisher",
|
|
1762
|
+
"variant": "declaration",
|
|
1763
|
+
"kind": 1024,
|
|
1764
|
+
"flags": {
|
|
1765
|
+
"isOptional": true
|
|
1766
|
+
},
|
|
1767
|
+
"comment": {
|
|
1768
|
+
"summary": [
|
|
1769
|
+
{
|
|
1770
|
+
"kind": "text",
|
|
1771
|
+
"text": "Message publisher, if sent."
|
|
1772
|
+
}
|
|
1773
|
+
]
|
|
1774
|
+
},
|
|
1775
|
+
"type": {
|
|
1776
|
+
"type": "reference",
|
|
1777
|
+
"target": 54,
|
|
1778
|
+
"name": "Publisher",
|
|
1779
|
+
"package": "@wix/realtime-common"
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
],
|
|
1783
|
+
"groups": [
|
|
1784
|
+
{
|
|
1785
|
+
"title": "Properties",
|
|
1786
|
+
"children": [
|
|
1787
|
+
47,
|
|
1788
|
+
48
|
|
1789
|
+
]
|
|
1790
|
+
}
|
|
1791
|
+
]
|
|
1792
|
+
},
|
|
1793
|
+
{
|
|
1794
|
+
"id": 54,
|
|
1795
|
+
"name": "Publisher",
|
|
1796
|
+
"variant": "declaration",
|
|
1797
|
+
"kind": 256,
|
|
1798
|
+
"flags": {},
|
|
1799
|
+
"comment": {
|
|
1800
|
+
"summary": [
|
|
1801
|
+
{
|
|
1802
|
+
"kind": "text",
|
|
1803
|
+
"text": "An object representing a publisher."
|
|
1804
|
+
}
|
|
1805
|
+
]
|
|
1806
|
+
},
|
|
1807
|
+
"children": [
|
|
1808
|
+
{
|
|
1809
|
+
"id": 55,
|
|
1810
|
+
"name": "id",
|
|
1811
|
+
"variant": "declaration",
|
|
1812
|
+
"kind": 1024,
|
|
1813
|
+
"flags": {},
|
|
1814
|
+
"comment": {
|
|
1815
|
+
"summary": [
|
|
1816
|
+
{
|
|
1817
|
+
"kind": "text",
|
|
1818
|
+
"text": "ID of the publisher."
|
|
1819
|
+
}
|
|
1820
|
+
]
|
|
1821
|
+
},
|
|
1822
|
+
"type": {
|
|
1823
|
+
"type": "intrinsic",
|
|
1824
|
+
"name": "string"
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
],
|
|
1828
|
+
"groups": [
|
|
1829
|
+
{
|
|
1830
|
+
"title": "Properties",
|
|
1831
|
+
"children": [
|
|
1832
|
+
55
|
|
1833
|
+
]
|
|
1834
|
+
}
|
|
1835
|
+
]
|
|
1836
|
+
},
|
|
1837
|
+
{
|
|
1838
|
+
"id": 66,
|
|
1839
|
+
"name": "SubscriptionOptions",
|
|
1840
|
+
"variant": "declaration",
|
|
1841
|
+
"kind": 256,
|
|
1842
|
+
"flags": {},
|
|
1843
|
+
"comment": {
|
|
1844
|
+
"summary": [
|
|
1845
|
+
{
|
|
1846
|
+
"kind": "text",
|
|
1847
|
+
"text": "An object containing optional lifecycle handlers for a subscription."
|
|
1848
|
+
}
|
|
1849
|
+
]
|
|
1850
|
+
},
|
|
1851
|
+
"children": [
|
|
1852
|
+
{
|
|
1853
|
+
"id": 67,
|
|
1854
|
+
"name": "onSubscribed",
|
|
1855
|
+
"variant": "declaration",
|
|
1856
|
+
"kind": 1024,
|
|
1857
|
+
"flags": {
|
|
1858
|
+
"isOptional": true
|
|
1859
|
+
},
|
|
1860
|
+
"comment": {
|
|
1861
|
+
"summary": [
|
|
1862
|
+
{
|
|
1863
|
+
"kind": "text",
|
|
1864
|
+
"text": "Runs when the subscription is successfully established.\n\nThis fires on the initial subscription and again every time the\nsubscription is automatically restored after a reconnection, so make\nsure your handler is idempotent.\n\nThe "
|
|
1865
|
+
},
|
|
1866
|
+
{
|
|
1867
|
+
"kind": "code",
|
|
1868
|
+
"text": "`isSynced`"
|
|
1869
|
+
},
|
|
1870
|
+
{
|
|
1871
|
+
"kind": "text",
|
|
1872
|
+
"text": " flag indicates whether the server was able to restore\nmissed messages since the last disconnection:\n\n- **First subscription** — always "
|
|
1873
|
+
},
|
|
1874
|
+
{
|
|
1875
|
+
"kind": "code",
|
|
1876
|
+
"text": "`false`"
|
|
1877
|
+
},
|
|
1878
|
+
{
|
|
1879
|
+
"kind": "text",
|
|
1880
|
+
"text": ". The client has no prior\n message history, so the server cannot restore anything. The app\n should load its own initial state.\n\n- **Re-subscription after reconnect, "
|
|
1881
|
+
},
|
|
1882
|
+
{
|
|
1883
|
+
"kind": "code",
|
|
1884
|
+
"text": "`isSynced: true`"
|
|
1885
|
+
},
|
|
1886
|
+
{
|
|
1887
|
+
"kind": "text",
|
|
1888
|
+
"text": "** — the server\n found the last received message and replayed everything since.\n No action needed from the app.\n\n- **Re-subscription after reconnect, "
|
|
1889
|
+
},
|
|
1890
|
+
{
|
|
1891
|
+
"kind": "code",
|
|
1892
|
+
"text": "`isSynced: false`"
|
|
1893
|
+
},
|
|
1894
|
+
{
|
|
1895
|
+
"kind": "text",
|
|
1896
|
+
"text": "** — the server\n could not restore missed messages (e.g. they expired). The app\n should resync its state independently."
|
|
1897
|
+
}
|
|
1898
|
+
],
|
|
1899
|
+
"blockTags": [
|
|
1900
|
+
{
|
|
1901
|
+
"tag": "@param",
|
|
1902
|
+
"name": "subscriptionId",
|
|
1903
|
+
"content": [
|
|
1904
|
+
{
|
|
1905
|
+
"kind": "text",
|
|
1906
|
+
"text": "The ID of the subscription that was established."
|
|
1907
|
+
}
|
|
1908
|
+
]
|
|
1909
|
+
},
|
|
1910
|
+
{
|
|
1911
|
+
"tag": "@param",
|
|
1912
|
+
"name": "isSynced",
|
|
1913
|
+
"content": [
|
|
1914
|
+
{
|
|
1915
|
+
"kind": "text",
|
|
1916
|
+
"text": "Whether the server successfully restored missed messages."
|
|
1917
|
+
}
|
|
1918
|
+
]
|
|
1919
|
+
}
|
|
1920
|
+
]
|
|
1921
|
+
},
|
|
1922
|
+
"type": {
|
|
1923
|
+
"type": "reference",
|
|
1924
|
+
"target": 61,
|
|
1925
|
+
"name": "SubscriptionHandler",
|
|
1926
|
+
"package": "@wix/realtime-common"
|
|
1927
|
+
}
|
|
1928
|
+
},
|
|
1929
|
+
{
|
|
1930
|
+
"id": 68,
|
|
1931
|
+
"name": "onSubscriptionError",
|
|
1932
|
+
"variant": "declaration",
|
|
1933
|
+
"kind": 1024,
|
|
1934
|
+
"flags": {
|
|
1935
|
+
"isOptional": true
|
|
1936
|
+
},
|
|
1937
|
+
"comment": {
|
|
1938
|
+
"summary": [
|
|
1939
|
+
{
|
|
1940
|
+
"kind": "text",
|
|
1941
|
+
"text": "Runs when a subscription error occurs.\n\nThis handler is triggered in the following scenarios:\n\n- **Subscription failed** — Authorization failure. The subscription\n request returned a non-2xx status. The error includes the HTTP\n "
|
|
1942
|
+
},
|
|
1943
|
+
{
|
|
1944
|
+
"kind": "code",
|
|
1945
|
+
"text": "`status`"
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
"kind": "text",
|
|
1949
|
+
"text": " code and a "
|
|
1950
|
+
},
|
|
1951
|
+
{
|
|
1952
|
+
"kind": "code",
|
|
1953
|
+
"text": "`message`"
|
|
1954
|
+
},
|
|
1955
|
+
{
|
|
1956
|
+
"kind": "text",
|
|
1957
|
+
"text": " with details. This is non-recoverable;\n the subscription will not retry automatically.\n\n- **Disconnected** — The connection was closed, either intentionally\n or due to an error. When caused by an error, the "
|
|
1958
|
+
},
|
|
1959
|
+
{
|
|
1960
|
+
"kind": "code",
|
|
1961
|
+
"text": "`recoverable`"
|
|
1962
|
+
},
|
|
1963
|
+
{
|
|
1964
|
+
"kind": "text",
|
|
1965
|
+
"text": " flag\n on the error indicates whether the client will auto-reconnect\n ("
|
|
1966
|
+
},
|
|
1967
|
+
{
|
|
1968
|
+
"kind": "code",
|
|
1969
|
+
"text": "`true`"
|
|
1970
|
+
},
|
|
1971
|
+
{
|
|
1972
|
+
"kind": "text",
|
|
1973
|
+
"text": ") or whether manual action is required ("
|
|
1974
|
+
},
|
|
1975
|
+
{
|
|
1976
|
+
"kind": "code",
|
|
1977
|
+
"text": "`false`"
|
|
1978
|
+
},
|
|
1979
|
+
{
|
|
1980
|
+
"kind": "text",
|
|
1981
|
+
"text": ", e.g. a 401\n means the signed instance is invalid).\n\n- **Connection error** — Fired on every reconnection attempt that\n fails. The "
|
|
1982
|
+
},
|
|
1983
|
+
{
|
|
1984
|
+
"kind": "code",
|
|
1985
|
+
"text": "`recoverable`"
|
|
1986
|
+
},
|
|
1987
|
+
{
|
|
1988
|
+
"kind": "text",
|
|
1989
|
+
"text": " flag is always "
|
|
1990
|
+
},
|
|
1991
|
+
{
|
|
1992
|
+
"kind": "code",
|
|
1993
|
+
"text": "`true`"
|
|
1994
|
+
},
|
|
1995
|
+
{
|
|
1996
|
+
"kind": "text",
|
|
1997
|
+
"text": " for these errors\n (the client keeps retrying with exponential backoff). If the error\n becomes non-recoverable, a disconnection with "
|
|
1998
|
+
},
|
|
1999
|
+
{
|
|
2000
|
+
"kind": "code",
|
|
2001
|
+
"text": "`recoverable: false`"
|
|
2002
|
+
},
|
|
2003
|
+
{
|
|
2004
|
+
"kind": "text",
|
|
2005
|
+
"text": "\n is fired instead.\n\nInspect "
|
|
2006
|
+
},
|
|
2007
|
+
{
|
|
2008
|
+
"kind": "code",
|
|
2009
|
+
"text": "`error.recoverable`"
|
|
2010
|
+
},
|
|
2011
|
+
{
|
|
2012
|
+
"kind": "text",
|
|
2013
|
+
"text": " to distinguish transient errors (where\nthe client is auto-reconnecting) from permanent failures (where user\naction is required).\n\nNote: this handler may fire multiple times during a single session.\nFor example, a typical recovery flow looks like:\n"
|
|
2014
|
+
},
|
|
2015
|
+
{
|
|
2016
|
+
"kind": "code",
|
|
2017
|
+
"text": "`subscribed → error (recoverable) → error (recoverable) → subscribed`"
|
|
2018
|
+
},
|
|
2019
|
+
{
|
|
2020
|
+
"kind": "text",
|
|
2021
|
+
"text": "\nThis happens because the client automatically tries to recover itself\nafter an unexpected disconnection."
|
|
2022
|
+
}
|
|
2023
|
+
],
|
|
2024
|
+
"blockTags": [
|
|
2025
|
+
{
|
|
2026
|
+
"tag": "@param",
|
|
2027
|
+
"name": "error",
|
|
2028
|
+
"content": [
|
|
2029
|
+
{
|
|
2030
|
+
"kind": "text",
|
|
2031
|
+
"text": "The error that occurred, including "
|
|
2032
|
+
},
|
|
2033
|
+
{
|
|
2034
|
+
"kind": "code",
|
|
2035
|
+
"text": "`errorCode`"
|
|
2036
|
+
},
|
|
2037
|
+
{
|
|
2038
|
+
"kind": "text",
|
|
2039
|
+
"text": ",\n "
|
|
2040
|
+
},
|
|
2041
|
+
{
|
|
2042
|
+
"kind": "code",
|
|
2043
|
+
"text": "`recoverable`"
|
|
2044
|
+
},
|
|
2045
|
+
{
|
|
2046
|
+
"kind": "text",
|
|
2047
|
+
"text": ", and optionally "
|
|
2048
|
+
},
|
|
2049
|
+
{
|
|
2050
|
+
"kind": "code",
|
|
2051
|
+
"text": "`channel`"
|
|
2052
|
+
},
|
|
2053
|
+
{
|
|
2054
|
+
"kind": "text",
|
|
2055
|
+
"text": " and "
|
|
2056
|
+
},
|
|
2057
|
+
{
|
|
2058
|
+
"kind": "code",
|
|
2059
|
+
"text": "`status`"
|
|
2060
|
+
},
|
|
2061
|
+
{
|
|
2062
|
+
"kind": "text",
|
|
2063
|
+
"text": "."
|
|
2064
|
+
}
|
|
2065
|
+
]
|
|
2066
|
+
},
|
|
2067
|
+
{
|
|
2068
|
+
"tag": "@param",
|
|
2069
|
+
"name": "subscriptionId",
|
|
2070
|
+
"content": [
|
|
2071
|
+
{
|
|
2072
|
+
"kind": "text",
|
|
2073
|
+
"text": "The ID of the affected subscription."
|
|
2074
|
+
}
|
|
2075
|
+
]
|
|
2076
|
+
}
|
|
2077
|
+
]
|
|
2078
|
+
},
|
|
2079
|
+
"type": {
|
|
2080
|
+
"type": "reference",
|
|
2081
|
+
"target": 56,
|
|
2082
|
+
"name": "SubscriptionErrorHandler",
|
|
2083
|
+
"package": "@wix/realtime-common"
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
],
|
|
2087
|
+
"groups": [
|
|
2088
|
+
{
|
|
2089
|
+
"title": "Properties",
|
|
2090
|
+
"children": [
|
|
2091
|
+
67,
|
|
2092
|
+
68
|
|
2093
|
+
]
|
|
2094
|
+
}
|
|
2095
|
+
]
|
|
2096
|
+
},
|
|
2097
|
+
{
|
|
2098
|
+
"id": 69,
|
|
2099
|
+
"name": "UnsubscribeOptions",
|
|
2100
|
+
"variant": "declaration",
|
|
2101
|
+
"kind": 256,
|
|
2102
|
+
"flags": {},
|
|
2103
|
+
"comment": {
|
|
2104
|
+
"summary": [
|
|
2105
|
+
{
|
|
2106
|
+
"kind": "text",
|
|
2107
|
+
"text": "An object containing options to be used when unsubscribing from a\nchannel or channel resource."
|
|
2108
|
+
}
|
|
2109
|
+
]
|
|
2110
|
+
},
|
|
2111
|
+
"children": [
|
|
2112
|
+
{
|
|
2113
|
+
"id": 70,
|
|
2114
|
+
"name": "channel",
|
|
2115
|
+
"variant": "declaration",
|
|
2116
|
+
"kind": 1024,
|
|
2117
|
+
"flags": {
|
|
2118
|
+
"isOptional": true
|
|
2119
|
+
},
|
|
2120
|
+
"comment": {
|
|
2121
|
+
"summary": [
|
|
2122
|
+
{
|
|
2123
|
+
"kind": "text",
|
|
2124
|
+
"text": "The channel, and optionally the resource, to\nunsubscribe from. Use this property when unsubscribing from all subscriptions to a channel\nor channel resource."
|
|
2125
|
+
}
|
|
2126
|
+
]
|
|
2127
|
+
},
|
|
2128
|
+
"type": {
|
|
2129
|
+
"type": "reference",
|
|
2130
|
+
"target": 43,
|
|
2131
|
+
"name": "Channel",
|
|
2132
|
+
"package": "@wix/realtime-common"
|
|
2133
|
+
}
|
|
2134
|
+
},
|
|
2135
|
+
{
|
|
2136
|
+
"id": 71,
|
|
2137
|
+
"name": "subscriptionId",
|
|
2138
|
+
"variant": "declaration",
|
|
2139
|
+
"kind": 1024,
|
|
2140
|
+
"flags": {
|
|
2141
|
+
"isOptional": true
|
|
2142
|
+
},
|
|
2143
|
+
"comment": {
|
|
2144
|
+
"summary": [
|
|
2145
|
+
{
|
|
2146
|
+
"kind": "text",
|
|
2147
|
+
"text": "ID of the subscription to unsubscribe from. Use this\nproperty when unsubscribing from one of multiple subscriptions to a channel or channel\nresource."
|
|
2148
|
+
}
|
|
2149
|
+
]
|
|
2150
|
+
},
|
|
2151
|
+
"type": {
|
|
2152
|
+
"type": "intrinsic",
|
|
2153
|
+
"name": "string"
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
],
|
|
2157
|
+
"groups": [
|
|
2158
|
+
{
|
|
2159
|
+
"title": "Properties",
|
|
2160
|
+
"children": [
|
|
2161
|
+
70,
|
|
2162
|
+
71
|
|
2163
|
+
]
|
|
2164
|
+
}
|
|
2165
|
+
]
|
|
2166
|
+
},
|
|
2167
|
+
{
|
|
2168
|
+
"id": 49,
|
|
2169
|
+
"name": "MessageHandler",
|
|
2170
|
+
"variant": "declaration",
|
|
2171
|
+
"kind": 4194304,
|
|
2172
|
+
"flags": {},
|
|
2173
|
+
"type": {
|
|
2174
|
+
"type": "reflection",
|
|
2175
|
+
"declaration": {
|
|
2176
|
+
"id": 50,
|
|
2177
|
+
"name": "__type",
|
|
2178
|
+
"variant": "declaration",
|
|
2179
|
+
"kind": 65536,
|
|
2180
|
+
"flags": {},
|
|
2181
|
+
"signatures": [
|
|
2182
|
+
{
|
|
2183
|
+
"id": 51,
|
|
2184
|
+
"name": "__type",
|
|
2185
|
+
"variant": "signature",
|
|
2186
|
+
"kind": 4096,
|
|
2187
|
+
"flags": {},
|
|
2188
|
+
"comment": {
|
|
2189
|
+
"summary": [
|
|
2190
|
+
{
|
|
2191
|
+
"kind": "text",
|
|
2192
|
+
"text": "Handles a message published to a channel or channel resource."
|
|
2193
|
+
}
|
|
2194
|
+
]
|
|
2195
|
+
},
|
|
2196
|
+
"parameters": [
|
|
2197
|
+
{
|
|
2198
|
+
"id": 52,
|
|
2199
|
+
"name": "message",
|
|
2200
|
+
"variant": "param",
|
|
2201
|
+
"kind": 32768,
|
|
2202
|
+
"flags": {},
|
|
2203
|
+
"type": {
|
|
2204
|
+
"type": "reference",
|
|
2205
|
+
"target": 46,
|
|
2206
|
+
"name": "Message",
|
|
2207
|
+
"package": "@wix/realtime-common"
|
|
2208
|
+
}
|
|
2209
|
+
},
|
|
2210
|
+
{
|
|
2211
|
+
"id": 53,
|
|
2212
|
+
"name": "channel",
|
|
2213
|
+
"variant": "param",
|
|
2214
|
+
"kind": 32768,
|
|
2215
|
+
"flags": {},
|
|
2216
|
+
"type": {
|
|
2217
|
+
"type": "reference",
|
|
2218
|
+
"target": 43,
|
|
2219
|
+
"name": "Channel",
|
|
2220
|
+
"package": "@wix/realtime-common"
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
],
|
|
2224
|
+
"type": {
|
|
2225
|
+
"type": "intrinsic",
|
|
2226
|
+
"name": "void"
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
]
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
},
|
|
2233
|
+
{
|
|
2234
|
+
"id": 56,
|
|
2235
|
+
"name": "SubscriptionErrorHandler",
|
|
2236
|
+
"variant": "declaration",
|
|
2237
|
+
"kind": 4194304,
|
|
2238
|
+
"flags": {},
|
|
2239
|
+
"type": {
|
|
2240
|
+
"type": "reflection",
|
|
2241
|
+
"declaration": {
|
|
2242
|
+
"id": 57,
|
|
2243
|
+
"name": "__type",
|
|
2244
|
+
"variant": "declaration",
|
|
2245
|
+
"kind": 65536,
|
|
2246
|
+
"flags": {},
|
|
2247
|
+
"signatures": [
|
|
2248
|
+
{
|
|
2249
|
+
"id": 58,
|
|
2250
|
+
"name": "__type",
|
|
2251
|
+
"variant": "signature",
|
|
2252
|
+
"kind": 4096,
|
|
2253
|
+
"flags": {},
|
|
2254
|
+
"comment": {
|
|
2255
|
+
"summary": [
|
|
2256
|
+
{
|
|
2257
|
+
"kind": "text",
|
|
2258
|
+
"text": "Handles a subscription error event."
|
|
2259
|
+
}
|
|
2260
|
+
]
|
|
2261
|
+
},
|
|
2262
|
+
"parameters": [
|
|
2263
|
+
{
|
|
2264
|
+
"id": 59,
|
|
2265
|
+
"name": "error",
|
|
2266
|
+
"variant": "param",
|
|
2267
|
+
"kind": 32768,
|
|
2268
|
+
"flags": {},
|
|
2269
|
+
"type": {
|
|
2270
|
+
"type": "reference",
|
|
2271
|
+
"target": 72,
|
|
2272
|
+
"name": "RealtimeError",
|
|
2273
|
+
"package": "@wix/realtime-common"
|
|
2274
|
+
}
|
|
2275
|
+
},
|
|
2276
|
+
{
|
|
2277
|
+
"id": 60,
|
|
2278
|
+
"name": "subscriptionId",
|
|
2279
|
+
"variant": "param",
|
|
2280
|
+
"kind": 32768,
|
|
2281
|
+
"flags": {},
|
|
2282
|
+
"type": {
|
|
2283
|
+
"type": "intrinsic",
|
|
2284
|
+
"name": "string"
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
],
|
|
2288
|
+
"type": {
|
|
2289
|
+
"type": "intrinsic",
|
|
2290
|
+
"name": "void"
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
]
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
},
|
|
2297
|
+
{
|
|
2298
|
+
"id": 61,
|
|
2299
|
+
"name": "SubscriptionHandler",
|
|
2300
|
+
"variant": "declaration",
|
|
2301
|
+
"kind": 4194304,
|
|
2302
|
+
"flags": {},
|
|
2303
|
+
"type": {
|
|
2304
|
+
"type": "reflection",
|
|
2305
|
+
"declaration": {
|
|
2306
|
+
"id": 62,
|
|
2307
|
+
"name": "__type",
|
|
2308
|
+
"variant": "declaration",
|
|
2309
|
+
"kind": 65536,
|
|
2310
|
+
"flags": {},
|
|
2311
|
+
"signatures": [
|
|
2312
|
+
{
|
|
2313
|
+
"id": 63,
|
|
2314
|
+
"name": "__type",
|
|
2315
|
+
"variant": "signature",
|
|
2316
|
+
"kind": 4096,
|
|
2317
|
+
"flags": {},
|
|
2318
|
+
"comment": {
|
|
2319
|
+
"summary": [
|
|
2320
|
+
{
|
|
2321
|
+
"kind": "text",
|
|
2322
|
+
"text": "Handles a successful subscription or re-subscription event."
|
|
2323
|
+
}
|
|
2324
|
+
]
|
|
2325
|
+
},
|
|
2326
|
+
"parameters": [
|
|
2327
|
+
{
|
|
2328
|
+
"id": 64,
|
|
2329
|
+
"name": "subscriptionId",
|
|
2330
|
+
"variant": "param",
|
|
2331
|
+
"kind": 32768,
|
|
2332
|
+
"flags": {},
|
|
2333
|
+
"type": {
|
|
2334
|
+
"type": "intrinsic",
|
|
2335
|
+
"name": "string"
|
|
2336
|
+
}
|
|
2337
|
+
},
|
|
2338
|
+
{
|
|
2339
|
+
"id": 65,
|
|
2340
|
+
"name": "isSynced",
|
|
2341
|
+
"variant": "param",
|
|
2342
|
+
"kind": 32768,
|
|
2343
|
+
"flags": {},
|
|
2344
|
+
"type": {
|
|
2345
|
+
"type": "intrinsic",
|
|
2346
|
+
"name": "boolean"
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
],
|
|
2350
|
+
"type": {
|
|
2351
|
+
"type": "intrinsic",
|
|
2352
|
+
"name": "void"
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
]
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
],
|
|
2360
|
+
"groups": [
|
|
2361
|
+
{
|
|
2362
|
+
"title": "Namespaces",
|
|
2363
|
+
"children": [
|
|
2364
|
+
23,
|
|
2365
|
+
1,
|
|
2366
|
+
30
|
|
2367
|
+
]
|
|
2368
|
+
},
|
|
2369
|
+
{
|
|
2370
|
+
"title": "Enumerations",
|
|
2371
|
+
"children": [
|
|
2372
|
+
86
|
|
2373
|
+
]
|
|
2374
|
+
},
|
|
2375
|
+
{
|
|
2376
|
+
"title": "Classes",
|
|
2377
|
+
"children": [
|
|
2378
|
+
72
|
|
2379
|
+
]
|
|
2380
|
+
},
|
|
2381
|
+
{
|
|
2382
|
+
"title": "Interfaces",
|
|
2383
|
+
"children": [
|
|
2384
|
+
43,
|
|
2385
|
+
46,
|
|
2386
|
+
54,
|
|
2387
|
+
66,
|
|
2388
|
+
69
|
|
2389
|
+
]
|
|
2390
|
+
},
|
|
2391
|
+
{
|
|
2392
|
+
"title": "Type Aliases",
|
|
2393
|
+
"children": [
|
|
2394
|
+
49,
|
|
2395
|
+
56,
|
|
2396
|
+
61
|
|
2397
|
+
]
|
|
2398
|
+
}
|
|
2399
|
+
],
|
|
2400
|
+
"packageName": "@wix/realtime",
|
|
2401
|
+
"symbolIdMap": {}
|
|
2402
|
+
},
|
|
2403
|
+
"appendices": {},
|
|
2404
|
+
"standaloneTypes": {},
|
|
2405
|
+
"metadata": {}
|
|
2406
|
+
}
|