@azure/web-pubsub 1.1.4-alpha.20241125.1 → 1.1.4-alpha.20241126.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/dist/web-pubsub.d.ts +0 -676
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@azure/web-pubsub",
|
3
|
-
"version": "1.1.4-alpha.
|
3
|
+
"version": "1.1.4-alpha.20241126.2",
|
4
4
|
"description": "Azure client library for Azure Web PubSub",
|
5
5
|
"sdk-type": "client",
|
6
6
|
"main": "./dist/commonjs/index.js",
|
@@ -65,7 +65,7 @@
|
|
65
65
|
"dependencies": {
|
66
66
|
"@azure/core-auth": "^1.9.0",
|
67
67
|
"@azure/core-client": "^1.9.2",
|
68
|
-
"@azure/core-rest-pipeline": "
|
68
|
+
"@azure/core-rest-pipeline": "^1.18.0",
|
69
69
|
"@azure/core-tracing": "^1.2.0",
|
70
70
|
"@azure/logger": "^1.1.4",
|
71
71
|
"jsonwebtoken": "^9.0.2",
|
package/dist/web-pubsub.d.ts
DELETED
@@ -1,676 +0,0 @@
|
|
1
|
-
import { AzureKeyCredential } from '@azure/core-auth';
|
2
|
-
import type { CommonClientOptions } from '@azure/core-client';
|
3
|
-
import type { OperationOptions } from '@azure/core-client';
|
4
|
-
import type { RequestBodyType } from '@azure/core-rest-pipeline';
|
5
|
-
import type { TokenCredential } from '@azure/core-auth';
|
6
|
-
|
7
|
-
export { AzureKeyCredential }
|
8
|
-
|
9
|
-
/**
|
10
|
-
* A response containing the client token.
|
11
|
-
*/
|
12
|
-
export declare interface ClientTokenResponse {
|
13
|
-
/**
|
14
|
-
* The client token.
|
15
|
-
*/
|
16
|
-
token: string;
|
17
|
-
/**
|
18
|
-
* The URL client connects to
|
19
|
-
*/
|
20
|
-
baseUrl: string;
|
21
|
-
/**
|
22
|
-
* The URL client connects to with access_token query string
|
23
|
-
*/
|
24
|
-
url: string;
|
25
|
-
}
|
26
|
-
|
27
|
-
/**
|
28
|
-
* Options for generating a token to connect a client to the Azure Web Pubsub service.
|
29
|
-
*/
|
30
|
-
export declare interface GenerateClientTokenOptions extends OperationOptions {
|
31
|
-
/**
|
32
|
-
* The userId for the client.
|
33
|
-
*/
|
34
|
-
userId?: string;
|
35
|
-
/**
|
36
|
-
* The roles that the connection with the generated token will have.
|
37
|
-
* Roles give the client initial permissions to leave, join, or publish to groups when using PubSub subprotocol
|
38
|
-
* * `webpubsub.joinLeaveGroup`: the client can join or leave any group
|
39
|
-
* * `webpubsub.sendToGroup`: the client can send messages to any group
|
40
|
-
* * `webpubsub.joinLeaveGroup.<group>`: the client can join or leave group `<group>`
|
41
|
-
* * `webpubsub.sendToGroup.<group>`: the client can send messages to group `<group>`
|
42
|
-
*
|
43
|
-
* {@link https://azure.github.io/azure-webpubsub/references/pubsub-websocket-subprotocol#permissions}
|
44
|
-
*/
|
45
|
-
roles?: string[];
|
46
|
-
/**
|
47
|
-
* Minutes until the token expires.
|
48
|
-
*/
|
49
|
-
expirationTimeInMinutes?: number;
|
50
|
-
/**
|
51
|
-
* The groups to join when the client connects
|
52
|
-
*/
|
53
|
-
groups?: string[];
|
54
|
-
/**
|
55
|
-
* The protocol type of the client
|
56
|
-
* * `default`: Default WebPubSub Client. Example Client Connection URL: _wss://exampleHost.com/client/hubs/exampleHub_
|
57
|
-
* * `mqtt`: MQTT Client. Example Client Connection URL: _wss://exampleHost.com/client/mqtt/hubs/exampleHub_
|
58
|
-
*/
|
59
|
-
clientProtocol?: WebPubSubClientProtocol;
|
60
|
-
}
|
61
|
-
|
62
|
-
/**
|
63
|
-
* Options for adding a connection to a group.
|
64
|
-
*/
|
65
|
-
export declare interface GroupAddConnectionOptions extends OperationOptions {
|
66
|
-
}
|
67
|
-
|
68
|
-
/**
|
69
|
-
* Options for adding a user to a group.
|
70
|
-
*/
|
71
|
-
export declare interface GroupAddUserOptions extends OperationOptions {
|
72
|
-
}
|
73
|
-
|
74
|
-
/**
|
75
|
-
* Options for constructing a GroupAdmin client.
|
76
|
-
*/
|
77
|
-
export declare interface GroupAdminClientOptions extends CommonClientOptions {
|
78
|
-
}
|
79
|
-
|
80
|
-
/**
|
81
|
-
* Options for closing all connections to a group.
|
82
|
-
*/
|
83
|
-
export declare interface GroupCloseAllConnectionsOptions extends OperationOptions {
|
84
|
-
/**
|
85
|
-
* Reason the connection is being closed.
|
86
|
-
*/
|
87
|
-
reason?: string;
|
88
|
-
}
|
89
|
-
|
90
|
-
/**
|
91
|
-
* Options for checking if a user is in a group
|
92
|
-
*/
|
93
|
-
export declare interface GroupHasUserOptions extends OperationOptions {
|
94
|
-
}
|
95
|
-
|
96
|
-
/**
|
97
|
-
* Options for removing a connection from a group
|
98
|
-
*/
|
99
|
-
export declare interface GroupRemoveConnectionOptions extends OperationOptions {
|
100
|
-
}
|
101
|
-
|
102
|
-
/**
|
103
|
-
* Options for removing a user from a group
|
104
|
-
*/
|
105
|
-
export declare interface GroupRemoveUserOptions extends OperationOptions {
|
106
|
-
}
|
107
|
-
|
108
|
-
/**
|
109
|
-
* Options for sending text messages to a group..
|
110
|
-
*/
|
111
|
-
export declare interface GroupSendTextToAllOptions extends GroupSendToAllOptions {
|
112
|
-
/**
|
113
|
-
* The content will be sent to the clients in plain text.
|
114
|
-
*/
|
115
|
-
contentType: "text/plain";
|
116
|
-
}
|
117
|
-
|
118
|
-
/**
|
119
|
-
* Options for sending messages to a group.
|
120
|
-
*/
|
121
|
-
export declare interface GroupSendToAllOptions extends OperationOptions {
|
122
|
-
/**
|
123
|
-
* Connection ids to exclude from receiving this message.
|
124
|
-
*/
|
125
|
-
excludedConnections?: string[];
|
126
|
-
/**
|
127
|
-
* The filter syntax to filter out the connections to send the messages to following OData filter syntax.
|
128
|
-
* Examples:
|
129
|
-
* * Exclude connections from `user1` and `user2`: `userId ne 'user1' and userId ne 'user2'`
|
130
|
-
* * Exclude connections in `group1`: `not('group1' in groups)`
|
131
|
-
* Details about `filter` syntax please see [OData filter syntax for Azure Web PubSub](https://aka.ms/awps/filter-syntax).
|
132
|
-
*/
|
133
|
-
filter?: string;
|
134
|
-
/**
|
135
|
-
* The time-to-live (TTL) value in seconds for messages sent to the service.
|
136
|
-
* 0 is the default value, which means the message never expires.
|
137
|
-
* 300 is the maximum value.
|
138
|
-
* If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service.
|
139
|
-
* This parameter can help when the client's bandwidth is limited.
|
140
|
-
*/
|
141
|
-
messageTtlSeconds?: number;
|
142
|
-
}
|
143
|
-
|
144
|
-
/**
|
145
|
-
* Options for checking if a connection exists.
|
146
|
-
*/
|
147
|
-
export declare interface HasConnectionOptions extends OperationOptions {
|
148
|
-
}
|
149
|
-
|
150
|
-
/**
|
151
|
-
* Options for closing all connections to a hub.
|
152
|
-
*/
|
153
|
-
export declare interface HubCloseAllConnectionsOptions extends OperationOptions {
|
154
|
-
/**
|
155
|
-
* Reason the connection is being closed.
|
156
|
-
*/
|
157
|
-
reason?: string;
|
158
|
-
}
|
159
|
-
|
160
|
-
/**
|
161
|
-
* Options for closing a connection to a hub.
|
162
|
-
*/
|
163
|
-
export declare interface HubCloseConnectionOptions extends OperationOptions {
|
164
|
-
/**
|
165
|
-
* Reason the connection is being closed.
|
166
|
-
*/
|
167
|
-
reason?: string;
|
168
|
-
}
|
169
|
-
|
170
|
-
/**
|
171
|
-
* Options for closing all of a user's connections to a hub.
|
172
|
-
*/
|
173
|
-
export declare interface HubCloseUserConnectionsOptions extends OperationOptions {
|
174
|
-
/**
|
175
|
-
* Reason the connection is being closed.
|
176
|
-
*/
|
177
|
-
reason?: string;
|
178
|
-
}
|
179
|
-
|
180
|
-
/**
|
181
|
-
* Options for grant permissions to a connection
|
182
|
-
*/
|
183
|
-
export declare interface HubGrantPermissionOptions extends OperationOptions {
|
184
|
-
/**
|
185
|
-
* The meaning of the target depends on the specific permission.
|
186
|
-
* For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.
|
187
|
-
*/
|
188
|
-
targetName?: string;
|
189
|
-
}
|
190
|
-
|
191
|
-
/**
|
192
|
-
* Options for checking if a group exists.
|
193
|
-
*/
|
194
|
-
export declare interface HubHasGroupOptions extends OperationOptions {
|
195
|
-
}
|
196
|
-
|
197
|
-
/**
|
198
|
-
* Options for checking if a connection has the specified permission
|
199
|
-
*/
|
200
|
-
export declare interface HubHasPermissionOptions extends OperationOptions {
|
201
|
-
/**
|
202
|
-
* The meaning of the target depends on the specific permission.
|
203
|
-
* For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.
|
204
|
-
*/
|
205
|
-
targetName?: string;
|
206
|
-
}
|
207
|
-
|
208
|
-
/**
|
209
|
-
* Options for checking if a user exists.
|
210
|
-
*/
|
211
|
-
export declare interface HubHasUserOptions extends OperationOptions {
|
212
|
-
}
|
213
|
-
|
214
|
-
/**
|
215
|
-
* Options for removing a user from all groups.
|
216
|
-
*/
|
217
|
-
export declare interface HubRemoveUserFromAllGroupsOptions extends HubCloseConnectionOptions {
|
218
|
-
}
|
219
|
-
|
220
|
-
/**
|
221
|
-
* Options for revoke permissions from a connection
|
222
|
-
*/
|
223
|
-
export declare interface HubRevokePermissionOptions extends OperationOptions {
|
224
|
-
/**
|
225
|
-
* The meaning of the target depends on the specific permission.
|
226
|
-
* For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.
|
227
|
-
*/
|
228
|
-
targetName?: string;
|
229
|
-
}
|
230
|
-
|
231
|
-
/**
|
232
|
-
* Options for sending text messages to hubs.
|
233
|
-
*/
|
234
|
-
export declare interface HubSendTextToAllOptions extends HubSendToAllOptions {
|
235
|
-
/**
|
236
|
-
* The content will be sent to the clients in plain text.
|
237
|
-
*/
|
238
|
-
contentType: "text/plain";
|
239
|
-
}
|
240
|
-
|
241
|
-
/**
|
242
|
-
* Options for sending a text message to a connection.
|
243
|
-
*/
|
244
|
-
export declare interface HubSendTextToConnectionOptions extends HubSendToConnectionOptions {
|
245
|
-
contentType: "text/plain";
|
246
|
-
}
|
247
|
-
|
248
|
-
/**
|
249
|
-
* Options for sending a text message to a user.
|
250
|
-
*/
|
251
|
-
export declare interface HubSendTextToUserOptions extends HubSendToUserOptions {
|
252
|
-
/**
|
253
|
-
* The content will be sent to the clients in plain text.
|
254
|
-
*/
|
255
|
-
contentType: "text/plain";
|
256
|
-
}
|
257
|
-
|
258
|
-
/**
|
259
|
-
* Options for sending messages to hubs.
|
260
|
-
*/
|
261
|
-
export declare interface HubSendToAllOptions extends OperationOptions {
|
262
|
-
/**
|
263
|
-
* Connection ids to exclude from receiving this message.
|
264
|
-
*/
|
265
|
-
excludedConnections?: string[];
|
266
|
-
/**
|
267
|
-
* The filter syntax to filter out the connections to send the messages to following OData filter syntax.
|
268
|
-
* Examples:
|
269
|
-
* * Exclude connections from `user1` and `user2`: `userId ne 'user1' and userId ne 'user2'`
|
270
|
-
* * Exclude connections in `group1`: `not('group1' in groups)`
|
271
|
-
* Details about `filter` syntax please see [OData filter syntax for Azure Web PubSub](https://aka.ms/awps/filter-syntax).
|
272
|
-
*/
|
273
|
-
filter?: string;
|
274
|
-
/**
|
275
|
-
* The time-to-live (TTL) value in seconds for messages sent to the service.
|
276
|
-
* 0 is the default value, which means the message never expires.
|
277
|
-
* 300 is the maximum value.
|
278
|
-
* If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service.
|
279
|
-
* This parameter can help when the client's bandwidth is limited.
|
280
|
-
*/
|
281
|
-
messageTtlSeconds?: number;
|
282
|
-
}
|
283
|
-
|
284
|
-
/**
|
285
|
-
* Options for sending a message to a specific connection.
|
286
|
-
*/
|
287
|
-
export declare interface HubSendToConnectionOptions extends OperationOptions {
|
288
|
-
/**
|
289
|
-
* The time-to-live (TTL) value in seconds for messages sent to the service.
|
290
|
-
* 0 is the default value, which means the message never expires.
|
291
|
-
* 300 is the maximum value.
|
292
|
-
* If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service.
|
293
|
-
* This parameter can help when the client's bandwidth is limited.
|
294
|
-
*/
|
295
|
-
messageTtlSeconds?: number;
|
296
|
-
}
|
297
|
-
|
298
|
-
/**
|
299
|
-
* Options for sending a message to a user.
|
300
|
-
*/
|
301
|
-
export declare interface HubSendToUserOptions extends OperationOptions {
|
302
|
-
/**
|
303
|
-
* The filter syntax to filter out the connections to send the messages to following OData filter syntax.
|
304
|
-
* Examples:
|
305
|
-
* * Exclude connections in `group1`: `not('group1' in groups)`
|
306
|
-
* * Send to connections in `group1` or `group2`: `'group1' in groups or `group2` in groups`
|
307
|
-
* Details about `filter` syntax please see [OData filter syntax for Azure Web PubSub](https://aka.ms/awps/filter-syntax).
|
308
|
-
*/
|
309
|
-
filter?: string;
|
310
|
-
/**
|
311
|
-
* The time-to-live (TTL) value in seconds for messages sent to the service.
|
312
|
-
* 0 is the default value, which means the message never expires.
|
313
|
-
* 300 is the maximum value.
|
314
|
-
* If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service.
|
315
|
-
* This parameter can help when the client's bandwidth is limited.
|
316
|
-
*/
|
317
|
-
messageTtlSeconds?: number;
|
318
|
-
}
|
319
|
-
|
320
|
-
/**
|
321
|
-
* Types which can be serialized and sent as JSON.
|
322
|
-
*/
|
323
|
-
export declare type JSONTypes = string | number | boolean | object;
|
324
|
-
|
325
|
-
/**
|
326
|
-
* Escapes an odata filter expression to avoid errors with quoting string literals.
|
327
|
-
* Example usage:
|
328
|
-
* ```ts
|
329
|
-
* const userId = "vic's";
|
330
|
-
* const anonymous = null;
|
331
|
-
* const length = 3
|
332
|
-
* const filter = odata`userId eq ${anonymous} or userId eq ${userId} or length(userId) > ${length}`;
|
333
|
-
* ```
|
334
|
-
* @param strings - Array of strings for the expression
|
335
|
-
* @param values - Array of values for the expression
|
336
|
-
*/
|
337
|
-
export declare function odata(strings: TemplateStringsArray, ...values: unknown[]): string;
|
338
|
-
|
339
|
-
export declare type Permission = "joinLeaveGroup" | "sendToGroup";
|
340
|
-
|
341
|
-
/**
|
342
|
-
* The type of client endpoint that is being requested.
|
343
|
-
*/
|
344
|
-
export declare type WebPubSubClientProtocol = "default" | "mqtt" | "socketio";
|
345
|
-
|
346
|
-
export declare interface WebPubSubGroup {
|
347
|
-
/**
|
348
|
-
* The name of this group
|
349
|
-
*/
|
350
|
-
readonly groupName: string;
|
351
|
-
/**
|
352
|
-
* The name of the hub this group belongs to
|
353
|
-
*/
|
354
|
-
readonly hubName: string;
|
355
|
-
/**
|
356
|
-
* The Web PubSub API version being used by this client
|
357
|
-
*/
|
358
|
-
readonly apiVersion: string;
|
359
|
-
/**
|
360
|
-
* The Web PubSub endpoint this client is connected to
|
361
|
-
*/
|
362
|
-
readonly endpoint: string;
|
363
|
-
/**
|
364
|
-
* Add a specific connection to this group
|
365
|
-
*
|
366
|
-
* @param connectionId - The connection id to add to this group
|
367
|
-
* @param options - Additional options
|
368
|
-
*/
|
369
|
-
addConnection(connectionId: string, options?: GroupAddConnectionOptions): Promise<void>;
|
370
|
-
/**
|
371
|
-
* Remove a specific connection from this group
|
372
|
-
*
|
373
|
-
* @param connectionId - The connection id to remove from this group
|
374
|
-
* @param options - Additional options
|
375
|
-
*/
|
376
|
-
removeConnection(connectionId: string, options?: GroupRemoveConnectionOptions): Promise<void>;
|
377
|
-
/**
|
378
|
-
* Close all connections to the group
|
379
|
-
*
|
380
|
-
* @param options - Additional options
|
381
|
-
*/
|
382
|
-
closeAllConnections(options?: GroupCloseAllConnectionsOptions): Promise<void>;
|
383
|
-
/**
|
384
|
-
* Add a user to this group
|
385
|
-
*
|
386
|
-
* @param username - The user name to add
|
387
|
-
* @param options - Additional options
|
388
|
-
*/
|
389
|
-
addUser(username: string, options?: GroupAddUserOptions): Promise<void>;
|
390
|
-
/**
|
391
|
-
* Remove a user from this group
|
392
|
-
*
|
393
|
-
* @param username - The user name to remove
|
394
|
-
* @param options - Additional options
|
395
|
-
*/
|
396
|
-
removeUser(username: string, options?: GroupRemoveUserOptions): Promise<void>;
|
397
|
-
/**
|
398
|
-
* Send a text message to every connection in this group
|
399
|
-
*
|
400
|
-
* @param message - The message to send
|
401
|
-
* @param options - Additional options
|
402
|
-
*/
|
403
|
-
sendToAll(message: string, options: GroupSendTextToAllOptions): Promise<void>;
|
404
|
-
/**
|
405
|
-
* Send a json message to every connection in this group
|
406
|
-
*
|
407
|
-
* @param message - The message to send
|
408
|
-
* @param options - Additional options
|
409
|
-
*/
|
410
|
-
sendToAll(message: JSONTypes, options?: GroupSendToAllOptions): Promise<void>;
|
411
|
-
/**
|
412
|
-
* Send a binary message to every connection in this group
|
413
|
-
*
|
414
|
-
* @param message - The binary message to send
|
415
|
-
* @param options - Additional options
|
416
|
-
*/
|
417
|
-
sendToAll(message: RequestBodyType, options?: GroupSendToAllOptions): Promise<void>;
|
418
|
-
}
|
419
|
-
|
420
|
-
/**
|
421
|
-
* Client for connecting to a Web PubSub hub
|
422
|
-
*/
|
423
|
-
export declare class WebPubSubServiceClient {
|
424
|
-
private readonly client;
|
425
|
-
private credential;
|
426
|
-
private readonly clientOptions?;
|
427
|
-
/**
|
428
|
-
* The name of the hub this client is connected to
|
429
|
-
*/
|
430
|
-
readonly hubName: string;
|
431
|
-
/**
|
432
|
-
* The Web PubSub API version being used by this client
|
433
|
-
*/
|
434
|
-
readonly apiVersion: string;
|
435
|
-
/**
|
436
|
-
* The Web PubSub endpoint this client is connected to
|
437
|
-
*/
|
438
|
-
endpoint: string;
|
439
|
-
/**
|
440
|
-
* Creates an instance of a WebPubSubServiceClient for sending messages and managing groups, connections, and users.
|
441
|
-
*
|
442
|
-
* Example usage:
|
443
|
-
* ```ts
|
444
|
-
* import { WebPubSubServiceClient } from "@azure/web-pubsub";
|
445
|
-
* const connectionString = process.env['WEB_PUBSUB_CONNECTION_STRING'];
|
446
|
-
* const client = new WebPubSubServiceClient(connectionString, 'chat');
|
447
|
-
* ```
|
448
|
-
*
|
449
|
-
* @param connectionString - The connection string
|
450
|
-
* @param hubName - The name of the hub to connect to. If omitted, '_default' is used.
|
451
|
-
* @param options - Options to configure the http pipeline
|
452
|
-
*/
|
453
|
-
constructor(connectionString: string, hubName: string, options?: WebPubSubServiceClientOptions);
|
454
|
-
/**
|
455
|
-
* Creates an instance of a WebPubSubServiceClient for sending messages and managing groups, connections, and users.
|
456
|
-
*
|
457
|
-
* Example usage:
|
458
|
-
* ```ts
|
459
|
-
* import { WebPubSubServiceClient, AzureKeyCredential } from "@azure/web-pubsub";
|
460
|
-
* const cred = new AzureKeyCredential("<your web pubsub api key>");
|
461
|
-
* const endpoint = "https://xxxx.webpubsubdev.azure.com"
|
462
|
-
* const client = new WebPubSubServiceClient(endpoint, cred, 'chat');
|
463
|
-
* ```
|
464
|
-
*
|
465
|
-
* @param endpoint - The endpoint to connect to
|
466
|
-
* @param credential - An AzureKeyCredential holding your service key
|
467
|
-
* @param hubName - The name of the hub to connect to.
|
468
|
-
* @param options - Options to configure the http pipeline
|
469
|
-
*/
|
470
|
-
constructor(endpoint: string, credential: AzureKeyCredential | TokenCredential, hubName: string, options?: WebPubSubServiceClientOptions);
|
471
|
-
/**
|
472
|
-
* Get a client for a group
|
473
|
-
* @param groupName - The name of the group to connect to.
|
474
|
-
*/
|
475
|
-
group(groupName: string): WebPubSubGroup;
|
476
|
-
/**
|
477
|
-
* Broadcast a text message to all connections on this hub.
|
478
|
-
*
|
479
|
-
* @param message - The text message to send
|
480
|
-
* @param options - Additional options
|
481
|
-
*/
|
482
|
-
sendToAll(message: string, options: HubSendTextToAllOptions): Promise<void>;
|
483
|
-
/**
|
484
|
-
* Broadcast a JSON message to all connections on this hub.
|
485
|
-
*
|
486
|
-
* @param message - The JSON message to send
|
487
|
-
* @param options - Additional options
|
488
|
-
*/
|
489
|
-
sendToAll(message: JSONTypes, options?: HubSendToAllOptions): Promise<void>;
|
490
|
-
/**
|
491
|
-
* Broadcast a binary message to all connections on this hub.
|
492
|
-
*
|
493
|
-
* @param message - The message to send
|
494
|
-
* @param options - Additional options
|
495
|
-
*/
|
496
|
-
sendToAll(message: RequestBodyType, options?: HubSendToAllOptions): Promise<void>;
|
497
|
-
/**
|
498
|
-
* Send a text message to a specific user
|
499
|
-
*
|
500
|
-
* @param username - User name to send to
|
501
|
-
* @param message - The text message to send
|
502
|
-
* @param options - Additional options
|
503
|
-
*/
|
504
|
-
sendToUser(username: string, message: string, options: HubSendTextToUserOptions): Promise<void>;
|
505
|
-
/**
|
506
|
-
* Send a JSON message to a specific user
|
507
|
-
*
|
508
|
-
* @param username - User name to send to
|
509
|
-
* @param message - The josn message to send
|
510
|
-
* @param options - Additional options
|
511
|
-
*/
|
512
|
-
sendToUser(username: string, message: JSONTypes, options?: HubSendToUserOptions): Promise<void>;
|
513
|
-
/**
|
514
|
-
* Send a binary message to a specific user
|
515
|
-
*
|
516
|
-
* @param username - The user name to send to
|
517
|
-
* @param message - The binary message to send
|
518
|
-
* @param options - Additional options
|
519
|
-
*/
|
520
|
-
sendToUser(username: string, message: RequestBodyType, options?: HubSendToUserOptions | HubSendTextToUserOptions): Promise<void>;
|
521
|
-
/**
|
522
|
-
* Send a text message to a specific connection
|
523
|
-
*
|
524
|
-
* @param connectionId - Connection id to send to
|
525
|
-
* @param message - The text message
|
526
|
-
* @param options - Additional options
|
527
|
-
*/
|
528
|
-
sendToConnection(connectionId: string, message: string, options: HubSendTextToConnectionOptions): Promise<void>;
|
529
|
-
/**
|
530
|
-
* Send a binary message to a specific connection
|
531
|
-
*
|
532
|
-
* @param connectionId - Connection id to send to
|
533
|
-
* @param message - The JSON message
|
534
|
-
* @param options - Additional options
|
535
|
-
*/
|
536
|
-
sendToConnection(connectionId: string, message: JSONTypes, options?: HubSendToConnectionOptions): Promise<void>;
|
537
|
-
/**
|
538
|
-
* Send a binary message to a specific connection
|
539
|
-
*
|
540
|
-
* @param connectionId - Connection id to send to
|
541
|
-
* @param message - The binary message
|
542
|
-
* @param options - Additional options
|
543
|
-
*/
|
544
|
-
sendToConnection(connectionId: string, message: RequestBodyType, options?: HubSendToConnectionOptions | HubSendTextToConnectionOptions): Promise<void>;
|
545
|
-
/**
|
546
|
-
* Check if a specific connection is connected to this hub
|
547
|
-
*
|
548
|
-
* @param connectionId - Connection id to check
|
549
|
-
* @param options - Additional options
|
550
|
-
*/
|
551
|
-
connectionExists(connectionId: string, options?: HasConnectionOptions): Promise<boolean>;
|
552
|
-
/**
|
553
|
-
* Close a specific connection to this hub
|
554
|
-
*
|
555
|
-
* @param connectionId - Connection id to close
|
556
|
-
* @param options - Additional options
|
557
|
-
*/
|
558
|
-
closeConnection(connectionId: string, options?: HubCloseConnectionOptions): Promise<void>;
|
559
|
-
/**
|
560
|
-
* Close all connections to this hub
|
561
|
-
*
|
562
|
-
* @param options - Additional options
|
563
|
-
*/
|
564
|
-
closeAllConnections(options?: HubCloseAllConnectionsOptions): Promise<void>;
|
565
|
-
/**
|
566
|
-
* Close all connections with the given user id
|
567
|
-
*
|
568
|
-
* @param user - User id to close
|
569
|
-
* @param options - Additional options
|
570
|
-
*/
|
571
|
-
closeUserConnections(userId: string, options?: HubCloseUserConnectionsOptions): Promise<void>;
|
572
|
-
/**
|
573
|
-
* Remove a specific user from all groups they are joined to
|
574
|
-
* @param userId - The user id to remove from all groups
|
575
|
-
* @param options - Additional options
|
576
|
-
*/
|
577
|
-
removeUserFromAllGroups(userId: string, options?: HubCloseConnectionOptions): Promise<void>;
|
578
|
-
/**
|
579
|
-
* Remove a specific connection from all groups they are joined to
|
580
|
-
* @param connectionId - The connection id to remove from all groups
|
581
|
-
* @param options - Additional options
|
582
|
-
*/
|
583
|
-
removeConnectionFromAllGroups(connectionId: string, options?: HubCloseConnectionOptions): Promise<void>;
|
584
|
-
/**
|
585
|
-
* Add filtered connections to multiple groups
|
586
|
-
* @param groups - A list of groups which target connections will be added into
|
587
|
-
* @param filter - An OData filter which target connections satisfy
|
588
|
-
* @param options - Additional options
|
589
|
-
*/
|
590
|
-
addConnectionsToGroups(groups: string[], filter: string, options?: GroupAddConnectionOptions): Promise<void>;
|
591
|
-
/**
|
592
|
-
* Remove filtered connections from multiple groups
|
593
|
-
* @param groups - A list of groups which target connections will be removed from
|
594
|
-
* @param filter - An OData filter which target connections satisfy
|
595
|
-
* @param options - Additional options
|
596
|
-
*/
|
597
|
-
removeConnectionsFromGroups(groups: string[], filter: string, options?: GroupRemoveConnectionOptions): Promise<void>;
|
598
|
-
/**
|
599
|
-
* Check if a particular group exists (i.e. has active connections).
|
600
|
-
*
|
601
|
-
* @param groupName - The group name to check for
|
602
|
-
* @param options - Additional options
|
603
|
-
*/
|
604
|
-
groupExists(groupName: string, options?: HubHasGroupOptions): Promise<boolean>;
|
605
|
-
/**
|
606
|
-
* Check if a particular user is connected to this hub.
|
607
|
-
*
|
608
|
-
* @param username - The user name to check for
|
609
|
-
* @param options - Additional options
|
610
|
-
*/
|
611
|
-
userExists(username: string, options?: HubHasUserOptions): Promise<boolean>;
|
612
|
-
/**
|
613
|
-
* Grant permissions to a connection
|
614
|
-
*
|
615
|
-
* @param connectionId - The connection id to grant permissions to
|
616
|
-
* @param Permission - The permission to grant
|
617
|
-
* @param options - Additional options
|
618
|
-
*/
|
619
|
-
grantPermission(connectionId: string, permission: Permission, options?: HubGrantPermissionOptions): Promise<void>;
|
620
|
-
/**
|
621
|
-
* Revoke permissions from a connection
|
622
|
-
*
|
623
|
-
* @param connectionId - The connection id to revoke permissions from
|
624
|
-
* @param Permission - The permission to revoke
|
625
|
-
* @param options - Additional options
|
626
|
-
*/
|
627
|
-
revokePermission(connectionId: string, permission: Permission, options?: HubRevokePermissionOptions): Promise<void>;
|
628
|
-
/**
|
629
|
-
* Check if the connection has the specified permission
|
630
|
-
*
|
631
|
-
* @param connectionId - The connection id to check permission
|
632
|
-
* @param Permission - The permission to check
|
633
|
-
* @param options - Additional options
|
634
|
-
*/
|
635
|
-
hasPermission(connectionId: string, permission: Permission, options?: HubHasPermissionOptions): Promise<boolean>;
|
636
|
-
/**
|
637
|
-
* Generate a token for a client to connect to the Azure Web PubSub service.
|
638
|
-
*
|
639
|
-
* @param options - Additional options
|
640
|
-
*/
|
641
|
-
getClientAccessToken(options?: GenerateClientTokenOptions): Promise<ClientTokenResponse>;
|
642
|
-
}
|
643
|
-
|
644
|
-
/**
|
645
|
-
* Options to configure the logging options.
|
646
|
-
*/
|
647
|
-
export declare interface WebPubSubServiceClientLogOptions {
|
648
|
-
/**
|
649
|
-
* Header names whose values will be logged when logging is enabled.
|
650
|
-
* Defaults include a list of well-known safe headers. Any headers
|
651
|
-
* specified in this field will be added to that list. Any other values will
|
652
|
-
* be written to logs as "REDACTED".
|
653
|
-
*/
|
654
|
-
additionalAllowedHeaderNames?: string[];
|
655
|
-
/**
|
656
|
-
* Query string names whose values will be logged when logging is enabled. By default no
|
657
|
-
* query string values are logged.
|
658
|
-
*/
|
659
|
-
additionalAllowedQueryParameters?: string[];
|
660
|
-
}
|
661
|
-
|
662
|
-
/**
|
663
|
-
* Options for constructing a HubAdmin client.
|
664
|
-
*/
|
665
|
-
export declare interface WebPubSubServiceClientOptions extends CommonClientOptions {
|
666
|
-
/**
|
667
|
-
* Reverse proxy endpoint (for example, your Azure API management endpoint)
|
668
|
-
*/
|
669
|
-
reverseProxyEndpoint?: string;
|
670
|
-
/**
|
671
|
-
* Options to configure the logging options.
|
672
|
-
*/
|
673
|
-
loggingOptions?: WebPubSubServiceClientLogOptions;
|
674
|
-
}
|
675
|
-
|
676
|
-
export { }
|